Releases: vuestorefront/magento2
@vue-storefront/magento-sdk@2.3.2
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
@vue-storefront/magento-api@3.1.0
@vue-storefront/magento-sdk@2.3.1
Patch Changes
-
ae8a741: ### Change Log
- [CHANGED] Deprecated the
MagentoModuleType
interface inindex.ts
. It is no longer necessary to use this type. Please, check documentation ofmagentoModule
for alternatives. Below you can find a snippet of the new way of usingmagentoModule
. Pay attention to thebuildModule
function that is used to create a module instance, it no longer requires theMagentoModuleType
type as a generic parameter.
import { initSDK, buildModule } from "@vue-storefront/sdk"; import { magentoModule, MagentoModuleType, } from "@vue-storefront/magento2-sdk"; const sdkConfig = { magento: buildModule(magentoModule, { apiUrl: "http://localhost:8181/magento", }), }; export const sdk = initSDK(sdkConfig);
- [CHANGED] Made the
ssrApiUrl
property inModuleOptions.ts
optional.
- [CHANGED] Deprecated the
@vue-storefront/magento-api@3.0.0
Major Changes
-
8b8fdff: - [CHANGED]
Endpoints
interface. Previously, each endpoint containedcontext
param, which is internal and shouldn't be exposed in the final interface. Now,Endpoints
interface properties don't containcontext
param. If you need to usecontext
param, you should useApiMethods
type.- import { Endpoints } from '@vue-storefront/magento-api'; + import { ApiMethods } from '@vue-storefront/magento-api';
- [CHANGED] Removed
ContextualizedEndpoints
type. UseEndpoints
instead.
- import { ContextualizedEndpoints } from '@vue-storefront/magento-api'; + import { Endpoints } from '@vue-storefront/magento-api';
- [REMOVED]
MagentoApiMethods
interface. UseEndpoints
instead.
- import { MagentoApiMethods } from '@vue-storefront/magento-api'; + import { Endpoints } from '@vue-storefront/magento-api';
- [CHANGED] Removed
@vue-storefront/magento-types@1.2.0
Minor Changes
- 8b2a0c3: [ADDED]
categories
endpoint definition.
@vue-storefront/magento-sdk@2.3.0
@vue-storefront/magento-api@2.7.0
@vue-storefront/magento-types@1.1.0
Minor Changes
-
7ce4f9e: [CHANGED] Enhanced default GQL queries
CategorySearchQuery
new fields:url_key
- The url key assigned to the category.children
- Child categories tree.include_in_menu
is_anchor
level
name
position
product_count
uid
url_key
url_path
url_suffix
// get category `children` categories const category = sdk.commerce.categorySearch(); const children = category.children;
CategoryListQuery
new fields:children.url_key
- The url key assigned to the category.
// get `url_key` of category children const categoryList = sdk.commerce.categoryList(); for (let categoryChildren of categoryList.children) { const url_key = categoryChildren.url_key; }
ProductListsQuery
new fields:variants
- An array of variants ofConfigurableProduct
// get ConfigurableProduct `variants` products const products = sdk.commerce.products(); for (let product of products) { if (product.__typename === "ConfigurableProduct") { const variants = products.variants; } }
Patch Changes
-
7ce4f9e: [FIXED]
CategoryListQuery
returnsurl_key
property on each children level[CHANGED] Enhanced default GQL queries
CategoryListQuery
- fetch up to 5th level nested categories
children
- fetch up to 5th level nested categories
-
7ce4f9e: [CHANGED] Enhanced default GQL queries
ProductDetailsQuery
- enhanced
ConfigurableProduct
response withConfigurableVariants
- enhanced
-
7ce4f9e: [CHANGED] Enhanced default GQL queries with new fields
CartQuery
CustomerCartQuery
ApplyCouponToCartMutation
RemoveCouponFromCartMutation
AddProductsToCartMutation
RemoveItemFromCartMutation
SetShippingMethodsOnCartMutation
MergeCartsMutation
with new fields:
prices
subtotal_with_discount_excluding_tax
configured_variant
sku
name
only_x_left_in_stock
price_range
-
7ce4f9e: [FIXED]
getAvailableShippingMethods
method declaration argument type. Usingcart_id
instead ofcartId
. -
7ce4f9e: [FIXED]
updateCustomerAddress
method declaration argument type. Useid
instead ofaddressId
.[CHANGED] Enhanced default GQL queries
CreateCustomerAddress
response with fieldsfirstname
lastname
prefix
suffix
-
7ce4f9e: [CHANGED] Enhanced default GQL queries with new fields
SetGuestEmailOnCartMutation
SetBillingAddressOnCartMutation
SetPaymentMethodOnCartMutation
SetShippingAddressesOnCartMutation
with new fields:
prices
subtotal_with_discount_excluding_tax
configured_variant
sku
name
only_x_left_in_stock
price_range
@vue-storefront/magento-sdk@2.2.0
Minor Changes
- eda02ee: [ADDED] addBundleProductsToCart method to add one or more bundle products to the specified cart.
[ADDED] addConfigurableProductsToCart method to add one or more configurable products to the specified cart.
@vue-storefront/magento-api@2.6.0
Minor Changes
-
7ce4f9e: [CHANGED] Enhanced default GQL queries
CategorySearchQuery
new fields:url_key
- The url key assigned to the category.children
- Child categories tree.include_in_menu
is_anchor
level
name
position
product_count
uid
url_key
url_path
url_suffix
// get category `children` categories const category = sdk.commerce.categorySearch(); const children = category.children;
CategoryListQuery
new fields:children.url_key
- The url key assigned to the category.
// get `url_key` of category children const categoryList = sdk.commerce.categoryList(); for (let categoryChildren of categoryList.children) { const url_key = categoryChildren.url_key; }
ProductListsQuery
new fields:variants
- An array of variants ofConfigurableProduct
// get ConfigurableProduct `variants` products const products = sdk.commerce.products(); for (let product of products) { if (product.__typename === "ConfigurableProduct") { const variants = products.variants; } }
Patch Changes
-
7ce4f9e: [FIXED]
CategoryListQuery
returnsurl_key
property on each children level[CHANGED] Enhanced default GQL queries
CategoryListQuery
- fetch up to 5th level nested categories
children
- fetch up to 5th level nested categories
-
7ce4f9e: [CHANGED] Enhanced default GQL queries
ProductDetailsQuery
- enhanced
ConfigurableProduct
response withConfigurableVariants
- enhanced
-
7ce4f9e: [CHANGED] Enhanced default GQL queries with new fields
CartQuery
CustomerCartQuery
ApplyCouponToCartMutation
RemoveCouponFromCartMutation
AddProductsToCartMutation
RemoveItemFromCartMutation
SetShippingMethodsOnCartMutation
MergeCartsMutation
with new fields:
prices
subtotal_with_discount_excluding_tax
configured_variant
sku
name
only_x_left_in_stock
price_range
-
7ce4f9e: [FIXED]
updateCustomerAddress
method declaration argument type. Useid
instead ofaddressId
.[CHANGED] Enhanced default GQL queries
CreateCustomerAddress
response with fieldsfirstname
lastname
prefix
suffix
-
7ce4f9e: [CHANGED] Enhanced default GQL queries with new fields
SetGuestEmailOnCartMutation
SetBillingAddressOnCartMutation
SetPaymentMethodOnCartMutation
SetShippingAddressesOnCartMutation
with new fields:
prices
subtotal_with_discount_excluding_tax
configured_variant
sku
name
only_x_left_in_stock
price_range
-
Updated dependencies [7ce4f9e]
-
Updated dependencies [7ce4f9e]
-
Updated dependencies [7ce4f9e]
-
Updated dependencies [7ce4f9e]
-
Updated dependencies [7ce4f9e]
-
Updated dependencies [7ce4f9e]
-
Updated dependencies [7ce4f9e]
- @vue-storefront/magento-types@1.1.0