github-actions
released this
22 Apr 07:59
·
29 commits
to main
since this release
Patch Changes
-
6672edf: [CHANGED]
magentoModule
has been deprecated. UsemiddlewareModule
from@vue-storefront/sdk
package instead.- import { initSDK, buildModule } from '@vue-storefront/sdk'; - import { magentoModule } from '@vsf-enterprise/magento-sdk' + import { initSDK, buildModule, middlewareModule } from '@vue-storefront/sdk'; + import { Endpoints as MagentoEndpoints } from '@vsf-enterprise/sapcc-api'; // In Alokai Storefront you should import it from `storefront-middleware/types.ts` const sdkConfig = { magento: buildModule( - magentoModule, + middlewareModule<MagentoEndpoints>, { apiUrl: 'http://localhost:8181/magento' } ) };
Updating your
magentoModule
to this version should not disrupt your existing code; however, switching tomiddlewareModule
will require certain modifications.To migrate:
- Use custom query as a second argument of
middlewareModule
function.
const customQuery = { cart: 'cart-custom-query', metadata: { fields: 'id items { uid }' } }; - const cart = await sdk.magento.cart({ cartId: '123'}, { customQuery }); + const cart = await sdk.magento.cart({ cartId: '123'}, customQuery);
- Use custom query as a second argument of