Change Log
5.0.0ri:link
Major Changesri:link
- CHANGED
@vsf-enterprise/commercetools-sdk
is now based onmiddlewareModule
from@alokai/connect
package. Some methods has changed their interface. Migration guide:
- Migration from
middlewareModule
toctModule
:
import { defineSdkModule } from '@vue-storefront/next';
- import { CommerceEndpoints } from 'storefront-middleware/types';
+ import { ctModule } from '@vsf-enterprise/commercetools-sdk';
import { getConfigSwitcherHeader } from '@/sdk/modules/utils';
/**
* `sdk.commerce` allows you to call the raw eCommerce API endpoints.
* It doesn't return unified data, but the raw data from your eCommerce backend.
* By default, the Alokai Starter doesn't use this module, but you can use it to call the raw API endpoints.
*/
export const commerce = defineSdkModule(({ buildModule, config, getRequestHeaders, middlewareModule }) =>
- buildModule(middlewareModule<CommerceEndpoints>, {
+ buildModule(ctModule, {
apiUrl: `${config.apiUrl}/commerce`,
cdnCacheBustingId: config.cdnCacheBustingId,
defaultRequestConfig: {
getConfigSwitcherHeader,
headers: getRequestHeaders(),
},
ssrApiUrl: `${config.ssrApiUrl}/commerce`,
}),
);
- Migration from previous version of
@vue-storefront/commercetools-sdk
to the new one:
- const { customerCreatePasswordResetToken } = await sdk.commerce.customerCreatePasswordResetToken(
- { email: 'john.doe@gmail.com', expose: true }
- );
+ const { customerCreatePasswordResetToken } = await sdk.commerce.customerCreatePasswordResetToken(
+ 'john.doe@gmail.com',
+ true
+ );
const token = customerCreatePasswordResetToken?.value;
- const { cart } = await sdk.commerce.removeProductFromCart({
- cartId: "cart-id",
- cartVersion: 1,
- product,
- quantity: 1,
- });
+ const { cart } = await sdk.commerce.removeProductFromCart(
+ {
+ id: "cart-id",
+ version: 1,
+ },
+ {
+ product,
+ quantity: 1,
+ }
+ );
const { order } = await sdk.commerce.createMyOrderFromCart({
- cartId: "6931b5d2-986f-4d2b-8cba-45007a26eb5e",
- cartVersion: 1,
+ id: "6931b5d2-986f-4d2b-8cba-45007a26eb5e",
+ version: 1,
});
- await sdk.commerce.customerChangePassword({
- version: user.version,
- currentPassword: 'current_password',
- newPassword: 'new_password'
- });
+ await sdk.commerce.customerChangePassword(user.version, 'current_password', 'new_password');
4.0.0ri:link
Major Changesri:link
- CHANGED Guarantee compatibility with
@alokai/connect
package. - CHANGED Updated the package for compatibility with Node.js 22.
Key Updates:ri:link
- Upgraded to the latest version of Node.js 22
- Updated CI pipelines to use Node.js 22 for consistency.
- Updated
.nvmrc
or.node-version
files to specify Node.js version22.14
. - Upgraded
@types/node
to version^22.13.17
for compatibility with the latest Node.js features.
Recommendations:ri:link
- Use Node.js version
22.14.0
or higher for optimal performance, security, and compatibility. - While Node.js 20 is technically supported, it is not recommended as it may cause compatibility issues with certain packages and has not been thoroughly tested.
CHANGED Replaced core dependencies with a new
@alokai/connect
package.@vue-storefront/middleware
,@vue-storefront/sdk
,vue-storefront/logger
,vue-storefront/unified-data-model
,@vue-storefront/multistore
were replaced with@alokai/connect
. The replacement preserves the same functionality and interface as the original packages. To read more about the@alokai/connect
package, please refer to the documentation.
Minor Changesri:link
- CHANGED Update axios version to "^1.7.9"
Patch Changesri:link
- Updated dependencies:
- @vsf-enterprise/commercetools-types@3.0.0
- @alokai/connect@1.0.0
4.0.0-rc.5ri:link
Patch Changesri:link
- Updated dependencies:
- @alokai/connect@1.0.0-rc.4
4.0.0-rc.4ri:link
Major Changesri:link
- CHANGED Updated the package for compatibility with Node.js 22.
Key Updates:ri:link
- Upgraded to the latest version of Node.js 22
- Updated CI pipelines to use Node.js 22 for consistency.
- Updated
.nvmrc
or.node-version
files to specify Node.js version22.14
. - Upgraded
@types/node
to version^22.13.17
for compatibility with the latest Node.js features.
Recommendations:ri:link
- Use Node.js version
22.14.0
or higher for optimal performance, security, and compatibility. - While Node.js 20 is technically supported, it is not recommended as it may cause compatibility issues with certain packages and has not been thoroughly tested.
Patch Changesri:link
- Updated dependencies:
- @vsf-enterprise/commercetools-types@3.0.0-rc.1
- @alokai/connect@1.0.0-rc.3
4.0.0-rc.3ri:link
Minor Changesri:link
- CHANGED Update axios version to "^1.7.9"
Patch Changesri:link
- Updated dependencies:
- @alokai/connect@1.0.0-rc.2
4.0.0-rc.2ri:link
Patch Changesri:link
- Updated dependencies:
- @alokai/connect@1.0.0-rc.1
4.0.0-rc.1ri:link
Major Changesri:link
Update packages to work with connect rc version
Patch Changesri:link
- Updated dependencies:
- @vsf-enterprise/commercetools-types@3.0.0-rc.0
- @alokai/connect@1.0.0-rc.0
4.0.0-rc.0ri:link
Major Changesri:link
CHANGED Replaced core dependencies with a new @alokai/connect
package. @vue-storefront/middleware
, @vue-storefront/sdk
, vue-storefront/logger
, vue-storefront/unified-data-model
were replaced with @alokai/connect
. The replacement preserves the same functionality and interface as the original packages. To read more about the @alokai/connect
package, please refer to the documentation. You will also find a migration guide in the documentation.
3.0.4ri:link
Patch Changesri:link
- CHANGED the version of
@vue-storefront/sdk-axios-request-sender
package to^2.0.0
.
3.0.3ri:link
Patch Changesri:link
- CHANGED Updated
@vue-storefront/middleware
version to4.1.0
.
3.0.2ri:link
Patch Changesri:link
Update axios to ^0.28.0 to mitigate security vulnerability CVE-2023-45857
3.0.1ri:link
Patch Changesri:link
- CHANGED
ctModule
has been deprecated. UsemiddlewareModule
from@vue-storefront/sdk
package instead.- import { initSDK, buildModule } from '@vue-storefront/sdk'; - import { ctModule, CTModuleType } from '@vsf-enterprise/commercetools-sdk' + import { initSDK, buildModule, middlewareModule } from '@vue-storefront/sdk'; + import { Endpoints as CTEndpoints } from '@vsf-enterprise/commercetools-api'; const sdkConfig = { commerce: buildModule( - ctModule, + middlewareModule<CTEndpoints>, { apiUrl: 'http://localhost:8181/ct', ssrApiUrl: 'http://localhost:8181/ct' } ) }; export const sdk = initSDK(sdkConfig);
Migration from@vue-storefront/commercetools-sdk
to themiddlewareModule
:- const { customerCreatePasswordResetToken } = await sdk.commerce.customerCreatePasswordResetToken( - { email: 'john.doe@gmail.com', expose: true } - ); + const { customerCreatePasswordResetToken } = await sdk.commerce.customerCreatePasswordResetToken( + 'john.doe@gmail.com', + true + ); const token = customerCreatePasswordResetToken?.value; - const { cart } = await sdk.commerce.removeProductFromCart({ - cartId: "cart-id", - cartVersion: 1, - product, - quantity: 1, - }); + const { cart } = await sdk.commerce.removeProductFromCart( + { + id: "cart-id", + version: 1, + }, + { + product, + quantity: 1, + } + ); const { order } = await sdk.commerce.createMyOrderFromCart({ - cartId: "6931b5d2-986f-4d2b-8cba-45007a26eb5e", - cartVersion: 1, + id: "6931b5d2-986f-4d2b-8cba-45007a26eb5e", + version: 1, }); - await sdk.commerce.customerChangePassword({ - version: user.version, - currentPassword: 'current_password', - newPassword: 'new_password' - }); + await sdk.commerce.customerChangePassword(user.version, 'current_password', 'new_password');
- CHANGED Deprecated the
CTModuleType
interface. It is no longer necessary to use this type. It's going to be removed in the next major version after Nov 1, 2024.import { initSDK, buildModule } from "@vue-storefront/sdk"; - import { ctModule, CTModuleType } from "@vue-storefront/commercetools-sdk"; + import { ctModule } from "@vue-storefront/commercetools-sdk"; const sdkConfig = { - commerce: buildModule<CTModuleType>(ctModule, { + commerce: buildModule(ctModule, { apiUrl: "http://localhost:8181/ct", }), }; export const sdk = initSDK(sdkConfig);
3.0.0ri:link
Major Changesri:link
- CHANGED Changed minimum Node version from 16 to 18. The condition that was forcing the Node version to be lower than 19 is also removed.
Patch Changesri:link
- Updated dependencies:
- @vsf-enterprise/commercetools-types@2.0.0
2.1.0ri:link
Minor Changesri:link
- 2fb71d4d4: Added possibility to send cookie-independent requests via SDK to integration's GET endpoints in order to cache their response
Patch Changesri:link
- Updated dependencies 2fb71d4d4
- @vsf-enterprise/commercetools-types@1.13.0
2.0.0ri:link
Major Changesri:link
- Implemented
@vue-storefront/sdk-axios-request-sender
package in all SDK methods. Also,getCategories
,getStores
,getFacet
,getProduct
,getProductBySku
andgetProductReviews
methods now send GET instead of POST requests to Vue Storefront's Server Middleware.
1.5.0ri:link
Minor Changesri:link
- Used
@vue-storefront/sdk
instead of@vsf-enterprise/sdk
as devDependency
1.4.0ri:link
Minor Changesri:link
- Add support for node-18: >= 16 && < 19
1.3.0ri:link
Minor Changesri:link
- upgraded middleware to the latest version
1.2.0ri:link
Minor Changesri:link
- upgraded middleware to the latest version
1.1.0ri:link
Minor Changesri:link
- api-client getStores endpoint is now filterable
- sdk added getStores method
Patch Changesri:link
- Updated dependencies [
94acce411
]:- @vsf-enterprise/commercetools-types@1.12.0
1.0.3ri:link
In this release, we fixed the memory leak caused by axios interceptors registered on each request instead of once.
1.0.2ri:link
In this release, we fixed the issue with adding additional resposeType
to request's body on each request.
1.0.1ri:link
In this release, we've added missing ts-essentials@^9.3.1
and @vsf-enterprise/commercetools-types@^1.11.0
dependencies to fix typings issues.
1.0.0ri:link
In this release we:
- covered most of the features the
@vsf-enterprise/commercetools-api
functionalities, - created a new documentation focued on the SDK usage,
- made the module compatible with
v1.0.0
of the@vue-storefront/sdk
package.