getExtensionUpdateList example


        $pluginList = new ExtensionCollection();
        $pluginList->add((new ExtensionStruct())->assign([
            'name' => 'TestExtension',
            'version' => '1.0.0',
        ]));

        $this->getRequestHandler()->append(new Response(200, [], \json_encode([
            'data' => [],
        ], \JSON_THROW_ON_ERROR)));

        $updateList = $this->storeClient->getExtensionUpdateList($pluginList$this->storeContext);

        static::assertEquals([]$updateList);

        $lastRequest = $this->getRequestHandler()->getLastRequest();
        static::assertInstanceOf(RequestInterface::class$lastRequest);

        static::assertEquals(
            $this->getStoreTokenFromContext($this->storeContext),
            $lastRequest->getHeader('X-Shopware-Platform-Token')[0],
        );
    }

    
foreach ($collection->getElements() as $extension) {
            $sortedCollection->set($extension->getName()$extension);
        }

        return $sortedCollection;
    }

    private function addUpdateInformation(ExtensionCollection $localCollection, Context $context): void
    {
        try {
            $updates = $this->client->getExtensionUpdateList($localCollection$context);
        } catch (StoreApiException|ClientException) {
            return;
        }

        foreach ($updates as $update) {
            $extension = $localCollection->get($update->getName());

            if (!$extension) {
                continue;
            }

            


        return new Response();
    }

    #[Route(path: '/api/_action/store/updates', name: 'api.custom.store.updates', methods: ['GET'])]     public function getUpdateList(Context $context): JsonResponse
    {
        $extensions = $this->extensionDataProvider->getInstalledExtensions($context, false);

        try {
            $updatesList = $this->storeClient->getExtensionUpdateList($extensions$context);
        } catch (ClientException $exception) {
            throw new StoreApiException($exception);
        }

        return new JsonResponse([
            'items' => $updatesList,
            'total' => \count($updatesList),
        ]);
    }

    #[Route(path: '/api/_action/store/license-violations', name: 'api.custom.store.license-violations', methods: ['POST'])]
Home | Imprint | This part of the site doesn't use cookies.