first commit

This commit is contained in:
2024-10-28 22:14:22 +01:00
commit b65352c452
40581 changed files with 5712079 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
drwxr-xr-x 4 30094 users 5 Oct 6 10:16 .
drwxr-xr-x 10 30094 users 21 Oct 6 10:16 ..
drwxr-xr-x 2 30094 users 3 Oct 6 10:16 admin
drwxr-xr-x 2 30094 users 14 Oct 6 10:16 front
-rw-r--r-- 1 30094 users 1273 Oct 14 2021 index.php

View File

@@ -0,0 +1,3 @@
drwxr-xr-x 2 30094 users 3 Oct 6 10:16 .
drwxr-xr-x 4 30094 users 5 Oct 6 10:16 ..
-rw-r--r-- 1 30094 users 1273 Oct 14 2021 index.php

View File

@@ -0,0 +1,34 @@
<?php
/**
* 2007-2020 PrestaShop.
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,14 @@
drwxr-xr-x 2 30094 users 14 Oct 6 10:16 .
drwxr-xr-x 4 30094 users 5 Oct 6 10:16 ..
-rw-r--r-- 1 30094 users 575 Oct 14 2021 apiCarrier.php
-rw-r--r-- 1 30094 users 557 Oct 14 2021 apiCarts.php
-rw-r--r-- 1 30094 users 583 Oct 14 2021 apiCategories.php
-rw-r--r-- 1 30094 users 981 Oct 14 2021 apiDeletedObjects.php
-rw-r--r-- 1 30094 users 842 Oct 14 2021 apiGoogleTaxonomies.php
-rw-r--r-- 1 30094 users 679 Oct 14 2021 apiHealthCheck.php
-rw-r--r-- 1 30094 users 1354 Oct 14 2021 apiInfo.php
-rw-r--r-- 1 30094 users 664 Oct 14 2021 apiModules.php
-rw-r--r-- 1 30094 users 563 Oct 14 2021 apiOrders.php
-rw-r--r-- 1 30094 users 575 Oct 14 2021 apiProducts.php
-rw-r--r-- 1 30094 users 1213 Oct 14 2021 apiThemes.php
-rw-r--r-- 1 30094 users 1273 Oct 14 2021 index.php

View File

@@ -0,0 +1,23 @@
<?php
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Provider\CarrierDataProvider;
class ps_EventbusApiCarrierModuleFrontController extends AbstractApiController
{
public $type = 'carrier';
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
$categoryDataProvider = $this->module->getService(CarrierDataProvider::class);
$response = $this->handleDataSync($categoryDataProvider);
$this->exitWithResponse($response);
}
}

View File

@@ -0,0 +1,25 @@
<?php
use PrestaShop\Module\PsEventbus\Config\Config;
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Provider\CarrierDataProvider;
class ps_EventbusApiCarriersModuleFrontController extends AbstractApiController
{
public $type = Config::COLLECTION_CARRIERS;
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
/** @var CarrierDataProvider $carrierDataProvider */
$carrierDataProvider = $this->module->getService(CarrierDataProvider::class);
$response = $this->handleDataSync($carrierDataProvider);
$this->exitWithResponse($response);
}
}

View File

@@ -0,0 +1,25 @@
<?php
use PrestaShop\Module\PsEventbus\Config\Config;
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Provider\CartDataProvider;
class ps_EventbusApiCartsModuleFrontController extends AbstractApiController
{
public $type = Config::COLLECTION_CARTS;
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
/** @var CartDataProvider $cartDataProvider */
$cartDataProvider = $this->module->getService(CartDataProvider::class);
$response = $this->handleDataSync($cartDataProvider);
$this->exitWithResponse($response);
}
}

View File

@@ -0,0 +1,25 @@
<?php
use PrestaShop\Module\PsEventbus\Config\Config;
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Provider\CategoryDataProvider;
class ps_EventbusApiCategoriesModuleFrontController extends AbstractApiController
{
public $type = Config::COLLECTION_CATEGORIES;
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
/** @var CategoryDataProvider $categoryDataProvider */
$categoryDataProvider = $this->module->getService(CategoryDataProvider::class);
$response = $this->handleDataSync($categoryDataProvider);
$this->exitWithResponse($response);
}
}

View File

@@ -0,0 +1,25 @@
<?php
use PrestaShop\Module\PsEventbus\Config\Config;
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Provider\CustomProductCarrierDataProvider;
class ps_EventbusApiCustomProductCarriersModuleFrontController extends AbstractApiController
{
public $type = Config::COLLECTION_CUSTOM_PRODUCT_CARRIERS;
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
/** @var CustomProductCarrierDataProvider $categoryDataProvider */
$categoryDataProvider = $this->module->getService(CustomProductCarrierDataProvider::class);
$response = $this->handleDataSync($categoryDataProvider);
$this->exitWithResponse($response);
}
}

View File

@@ -0,0 +1,32 @@
<?php
use PrestaShop\Module\PsEventbus\Config\Config;
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Exception\EnvVarException;
use PrestaShop\Module\PsEventbus\Service\DeletedObjectsService;
class ps_EventbusApiDeletedObjectsModuleFrontController extends AbstractApiController
{
public $type = Config::COLLECTION_DELETED;
/**
* @return void
*/
public function postProcess()
{
/** @var string $jobId */
$jobId = Tools::getValue('job_id', '');
/** @var DeletedObjectsService $deletedObjectsService */
$deletedObjectsService = $this->module->getService(DeletedObjectsService::class);
try {
$response = $deletedObjectsService->handleDeletedObjectsSync($jobId, $this->startTime);
$this->exitWithResponse($response);
} catch (PrestaShopDatabaseException $exception) {
$this->exitWithExceptionMessage($exception);
} catch (EnvVarException $exception) {
$this->exitWithExceptionMessage($exception);
}
}
}

View File

@@ -0,0 +1,29 @@
<?php
use PrestaShop\Module\PsEventbus\Config\Config;
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Provider\GoogleTaxonomyDataProvider;
class ps_EventbusApiGoogleTaxonomiesModuleFrontController extends AbstractApiController
{
public $type = Config::COLLECTION_TAXONOMIES;
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
if (!Module::isInstalled('ps_facebook')) {
$this->exitWithExceptionMessage(new Exception('Facebook module is not installed', Config::PS_FACEBOOK_NOT_INSTALLED));
}
/** @var GoogleTaxonomyDataProvider $categoryDataProvider */
$categoryDataProvider = $this->module->getService(GoogleTaxonomyDataProvider::class);
$response = $this->handleDataSync($categoryDataProvider);
$this->exitWithResponse($response);
}
}

View File

@@ -0,0 +1,27 @@
<?php
use PrestaShop\Module\PsEventbus\Config\Config;
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Repository\ServerInformationRepository;
class ps_EventbusApiHealthCheckModuleFrontController extends AbstractApiController
{
public $type = Config::COLLECTION_SHOPS;
public function init()
{
}
/**
* @return void
*/
public function postProcess()
{
/** @var ServerInformationRepository $serverInformationRepository */
$serverInformationRepository = $this->module->getService(ServerInformationRepository::class);
$status = $serverInformationRepository->getHealthCheckData();
$this->exitWithResponse($status);
}
}

View File

@@ -0,0 +1,46 @@
<?php
use PrestaShop\Module\PsEventbus\Config\Config;
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Exception\EnvVarException;
use PrestaShop\Module\PsEventbus\Repository\ServerInformationRepository;
class ps_EventbusApiInfoModuleFrontController extends AbstractApiController
{
public $type = Config::COLLECTION_SHOPS;
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
$response = [];
/** @var string $jobId */
$jobId = Tools::getValue('job_id');
/** @var ServerInformationRepository $serverInformationRepository */
$serverInformationRepository = $this->module->getService(ServerInformationRepository::class);
/** @var string $langIso */
$langIso = Tools::getValue('lang_iso', '');
$serverInfo = $serverInformationRepository->getServerInformation($langIso);
try {
$response = $this->proxyService->upload($jobId, $serverInfo, $this->startTime);
} catch (EnvVarException|Exception $exception) {
$this->exitWithExceptionMessage($exception);
}
$this->exitWithResponse(
array_merge(
[
'remaining_objects' => 0,
'total_objects' => 1,
],
$response
)
);
}
}

View File

@@ -0,0 +1,25 @@
<?php
use PrestaShop\Module\PsEventbus\Config\Config;
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Provider\ModuleDataProvider;
class ps_EventbusApiModulesModuleFrontController extends AbstractApiController
{
public $type = Config::COLLECTION_MODULES;
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
/** @var ModuleDataProvider $moduleDataProvider */
$moduleDataProvider = $this->module->getService(ModuleDataProvider::class);
$response = $this->handleDataSync($moduleDataProvider);
$this->exitWithResponse($response);
}
}

View File

@@ -0,0 +1,25 @@
<?php
use PrestaShop\Module\PsEventbus\Config\Config;
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Provider\OrderDataProvider;
class ps_EventbusApiOrdersModuleFrontController extends AbstractApiController
{
public $type = Config::COLLECTION_ORDERS;
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
/** @var OrderDataProvider $orderDataProvider */
$orderDataProvider = $this->module->getService(OrderDataProvider::class);
$response = $this->handleDataSync($orderDataProvider);
$this->exitWithResponse($response);
}
}

View File

@@ -0,0 +1,25 @@
<?php
use PrestaShop\Module\PsEventbus\Config\Config;
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Provider\ProductDataProvider;
class ps_EventbusApiProductsModuleFrontController extends AbstractApiController
{
public $type = Config::COLLECTION_PRODUCTS;
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
/** @var ProductDataProvider $productDataProvider */
$productDataProvider = $this->module->getService(ProductDataProvider::class);
$response = $this->handleDataSync($productDataProvider);
$this->exitWithResponse($response);
}
}

View File

@@ -0,0 +1,25 @@
<?php
use PrestaShop\Module\PsEventbus\Config\Config;
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Provider\CustomPriceDataProvider;
class ps_EventbusApiSpecificPricesModuleFrontController extends AbstractApiController
{
public $type = Config::COLLECTION_SPECIFIC_PRICES;
/**
* @throws PrestaShopException
*
* @return void
*/
public function postProcess()
{
/** @var CustomPriceDataProvider $productDataProvider */
$productDataProvider = $this->module->getService(CustomPriceDataProvider::class);
$response = $this->handleDataSync($productDataProvider);
$this->exitWithResponse($response);
}
}

View File

@@ -0,0 +1,44 @@
<?php
use PrestaShop\Module\PsEventbus\Config\Config;
use PrestaShop\Module\PsEventbus\Controller\AbstractApiController;
use PrestaShop\Module\PsEventbus\Exception\EnvVarException;
use PrestaShop\Module\PsEventbus\Repository\ThemeRepository;
class ps_EventbusApiThemesModuleFrontController extends AbstractApiController
{
public $type = Config::COLLECTION_THEMES;
/**
* @return void
*/
public function postProcess()
{
$response = [];
/** @var string $jobId */
$jobId = Tools::getValue('job_id');
/** @var ThemeRepository $themeRepository */
$themeRepository = $this->module->getService(ThemeRepository::class);
/** @var array $themeInfo */
$themeInfo = $themeRepository->getThemes();
try {
$response = $this->proxyService->upload($jobId, $themeInfo, $this->startTime);
} catch (EnvVarException|Exception $exception) {
$this->exitWithExceptionMessage($exception);
}
$this->exitWithResponse(
array_merge(
[
'remaining_objects' => 0,
'total_objects' => count($themeInfo),
],
$response
)
);
}
}

View File

@@ -0,0 +1,34 @@
<?php
/**
* 2007-2020 PrestaShop.
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,34 @@
<?php
/**
* 2007-2020 PrestaShop.
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;