<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
    <parameters>
        <parameter key="env(INSTANCE_ID)"/>
        <parameter key="instance_id">%env(INSTANCE_ID)%</parameter>
        <parameter key="shopware.store_endpoints" type="collection">
            <parameter key="my_extensions">/swplatform/licenseenvironment</parameter>
            <parameter key="my_plugin_updates">/swplatform/pluginupdates</parameter>
            <parameter key="environment_information">/swplatform/environmentinformation</parameter>
            <parameter key="updater_extension_compatibility">/swplatform/autoupdate</parameter>
            <parameter key="updater_permission">/swplatform/autoupdate/permission</parameter>
            <parameter key="plugin_download">/swplatform/pluginfiles/{pluginName}</parameter>
            <parameter key="app_generate_signature">/swplatform/generatesignature</parameter>
            <parameter key="cancel_license">/swplatform/pluginlicenses/%s/cancel</parameter>
            <parameter key="login">/swplatform/login</parameter>
            <parameter key="create_rating">/swplatform/extensionstore/extensions/%s/ratings</parameter>
            <parameter key="user_info">/swplatform/userinfo</parameter>
        </parameter>
    </parameters>
    <services>
        <service id="Shopware\Core\Framework\Store\Api\StoreController" public="true">
            <argument type="service" id="Shopware\Core\Framework\Store\Services\StoreClient" />
            <argument type="service" id="user.repository" />
            <argument type="service" id="Shopware\Core\Framework\Store\Services\AbstractExtensionDataProvider" />
            <call method="setContainer">
                <argument type="service" id="service_container"/>
            </call>
        </service>

        <service id="Shopware\Core\Framework\Store\Api\FirstRunWizardController" public="true">
            <argument type="service" id="Shopware\Core\Framework\Store\Services\FirstRunWizardService"/>
            <argument type="service" id="plugin.repository" />
            <argument type="service" id="app.repository" />
            <call method="setContainer">
                <argument type="service" id="service_container"/>
            </call>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\FirstRunWizardService">
            <argument type="service" id="Shopware\Core\Framework\Store\Services\StoreService"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="shopware.filesystem.public"/>
            <argument>%shopware.store.frw%</argument>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\Framework\Store\Services\FirstRunWizardClient"/>
            <argument type="service" id="user_config.repository"/>
            <argument type="service" id="Shopware\Core\Framework\Store\Services\TrackingEventClient"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\StoreClient">
            <argument>%shopware.store_endpoints%</argument>
            <argument type="service" id="Shopware\Core\Framework\Store\Services\StoreService" />
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="Shopware\Core\Framework\Store\Authentication\StoreRequestOptionsProvider" />
            <argument type="service" id="Shopware\Core\Framework\Store\Services\ExtensionLoader" />
            <argument type="service" id="shopware.store_client"/>
            <argument type="service" id="Shopware\Core\Framework\Store\Services\InstanceService"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\FirstRunWizardClient">
            <argument type="service" id="shopware.frw_client"/>
            <argument type="service" id="Shopware\Core\Framework\Store\Authentication\FrwRequestOptionsProvider"/>
            <argument type="service" id="Shopware\Core\Framework\Store\Services\InstanceService"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\StoreService" lazy="true">
            <argument type="service" id="user.repository"/>
            <argument type="service" id="Shopware\Core\Framework\Store\Services\TrackingEventClient"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\InstanceService">
            <argument>%kernel.shopware_version%</argument>
            <argument>%instance_id%</argument>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\OpenSSLVerifier">
            <argument type="collection">
                <argument>%kernel.shopware_core_dir%/Framework/Store/public.key</argument>
            </argument>
        </service>

        <service id="Shopware\Core\Framework\Store\Command\StoreDownloadCommand">
            <argument type="service" id="Shopware\Core\Framework\Store\Services\StoreClient" />
            <argument type="service" id="plugin.repository" />
            <argument type="service" id="Shopware\Core\Framework\Plugin\PluginManagementService" />
            <argument type="service" id="Shopware\Core\Framework\Plugin\PluginLifecycleService" />
            <argument type="service" id="user.repository" />
            <argument>%kernel.plugin_dir%</argument>
            <argument>%kernel.project_dir%</argument>

            <tag name="console.command"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Command\StoreLoginCommand">
            <argument type="service" id="Shopware\Core\Framework\Store\Services\StoreClient" />
            <argument type="service" id="user.repository" />
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <tag name="console.command"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Authentication\LocaleProvider">
            <argument type="service" id="user.repository"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Authentication\StoreRequestOptionsProvider" public="true">
            <argument type="service" id="user.repository"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="Shopware\Core\Framework\Store\Services\InstanceService"/>
            <argument type="service" id="Shopware\Core\Framework\Store\Authentication\LocaleProvider"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Authentication\FrwRequestOptionsProvider">
            <argument type="service" id="Shopware\Core\Framework\Store\Authentication\StoreRequestOptionsProvider"/>
            <argument type="service" id="user_config.repository"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\ExtensionLoader">
            <argument type="service" id="theme.repository" on-invalid="null"/>
            <argument type="service" id="Shopware\Core\Framework\App\Lifecycle\AppLoader"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\Service\ConfigurationService"/>
            <argument type="service" id="Shopware\Core\Framework\Store\Authentication\LocaleProvider"/>
            <argument type="service" id="Shopware\Core\System\Locale\LanguageLocaleCodeProvider"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\AbstractExtensionDataProvider" class="Shopware\Core\Framework\Store\Services\ExtensionDataProvider">
            <argument type="service" id="Shopware\Core\Framework\Store\Services\ExtensionLoader"/>
            <argument type="service" id="app.repository"/>
            <argument type="service" id="plugin.repository"/>
            <argument type="service" id="Shopware\Core\Framework\Store\Services\ExtensionListingLoader"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\ExtensionListingLoader">
            <argument type="service" id="Shopware\Core\Framework\Store\Services\StoreClient"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Api\ExtensionStoreDataController" public="true">
            <argument type="service" id="Shopware\Core\Framework\Store\Services\AbstractExtensionDataProvider"/>
            <argument type="service" id="user.repository"/>
            <argument type="service" id="language.repository"/>
            <call method="setContainer">
                <argument type="service" id="service_container"/>
            </call>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\AbstractStoreAppLifecycleService" class="Shopware\Core\Framework\Store\Services\StoreAppLifecycleService">
            <argument type="service" id="Shopware\Core\Framework\Store\Services\StoreClient"/>
            <argument type="service" id="Shopware\Core\Framework\App\Lifecycle\AppLoader"/>
            <argument type="service" id="Shopware\Core\Framework\App\Lifecycle\AppLifecycle"/>
            <argument type="service" id="app.repository"/>
            <argument type="service" id="sales_channel.repository"/>
            <argument type="service" id="theme.repository" on-invalid="null"/>
            <argument type="service" id="Shopware\Core\Framework\App\AppStateService"/>
            <argument type="service" id="Shopware\Core\Framework\App\Delta\AppConfirmationDeltaProvider"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\AbstractExtensionStoreLicensesService" class="Shopware\Core\Framework\Store\Services\ExtensionStoreLicensesService">
            <argument type="service" id="Shopware\Core\Framework\Store\Services\StoreClient"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Api\ExtensionStoreLicensesController" public="true">
            <argument type="service" id="Shopware\Core\Framework\Store\Services\AbstractExtensionStoreLicensesService"/>
            <call method="setContainer">
                <argument type="service" id="service_container"/>
            </call>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\ExtensionDownloader">
            <argument type="service" id="plugin.repository"/>
            <argument type="service" id="Shopware\Core\Framework\Store\Services\StoreClient"/>
            <argument type="service" id="Shopware\Core\Framework\Plugin\PluginManagementService"/>
            <argument>%kernel.plugin_dir%</argument>
            <argument>%kernel.project_dir%</argument>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\ExtensionLifecycleService">
            <argument type="service" id="Shopware\Core\Framework\Store\Services\AbstractStoreAppLifecycleService"/>
            <argument type="service" id="Shopware\Core\Framework\Plugin\PluginService"/>
            <argument type="service" id="Shopware\Core\Framework\Plugin\PluginLifecycleService"/>
            <argument type="service" id="Shopware\Core\Framework\Plugin\PluginManagementService"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Api\ExtensionStoreActionsController" public="true">
            <argument type="service" id="Shopware\Core\Framework\Store\Services\ExtensionLifecycleService"/>
            <argument type="service" id="Shopware\Core\Framework\Store\Services\ExtensionDownloader"/>
            <argument type="service" id="Shopware\Core\Framework\Plugin\PluginService"/>
            <argument type="service" id="Shopware\Core\Framework\Plugin\PluginManagementService"/>
            <argument type="service" id="Symfony\Component\Filesystem\Filesystem"/>
            <call method="setContainer">
                <argument type="service" id="service_container"/>
            </call>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\StoreClientFactory">
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
        </service>

        <service id="shopware.store_client" class="GuzzleHttp\Client" lazy="true" public="true">
            <factory service="Shopware\Core\Framework\Store\Services\StoreClientFactory" method="create"/>
            <argument type="tagged_iterator" tag="shopware.store_client.middleware"/>
        </service>

        <service id="shopware.frw_client" class="GuzzleHttp\Client" lazy="true" public="true">
            <factory service="Shopware\Core\Framework\Store\Services\StoreClientFactory" method="create"/>
            <argument type="tagged_iterator" tag="shopware.frw_client.middleware"/>
        </service>

        <service id="shopware.store_download_client" class="GuzzleHttp\Client" />

        <service id="Shopware\Core\Framework\Store\Subscriber\LicenseHostChangedSubscriber">
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="Doctrine\DBAL\Connection"/>

            <tag name="kernel.event_subscriber"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\VerifyResponseSignatureMiddleware" public="true">
            <argument type="service" id="Shopware\Core\Framework\Store\Services\OpenSSLVerifier"/>

            <tag name="shopware.store_client.middleware" priority="9999"/>
            <tag name="shopware.frw_client.middleware" priority="9999"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\StoreSessionExpiredMiddleware" public="true">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="request_stack"/>

            <tag name="shopware.store_client.middleware"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\ShopSecretInvalidMiddleware" public="true">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>

            <tag name="shopware.store_client.middleware"/>
        </service>

        <service id="Shopware\Core\Framework\Store\Services\TrackingEventClient">
            <argument type="service" id="shopware.store_client"/>
            <argument type="service" id="Shopware\Core\Framework\Store\Services\InstanceService"/>
        </service>
    </services>
</container>
