Change Log
6.0.0
Major Changes
- CHANGED Guarantee compatibility with
@alokai/connectpackage. - CHANGED Updated the package for compatibility with Node.js 22.
Key Updates:
- Upgraded to the latest version of Node.js 22
- Updated CI pipelines to use Node.js 22 for consistency.
- Updated
.nvmrcor.node-versionfiles to specify Node.js version22.14. - Upgraded
@types/nodeto version^22.13.17for compatibility with the latest Node.js features.
Recommendations:
- Use Node.js version
22.14.0or 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/connectpackage.@vue-storefront/middleware,@vue-storefront/sdk,vue-storefront/logger,vue-storefront/unified-data-model,@vue-storefront/multistorewere replaced with@alokai/connect. The replacement preserves the same functionality and interface as the original packages. To read more about the@alokai/connectpackage, please refer to the documentation. - CHANGED
sapccModuleis now based onmiddlewareModuleandSapccEndpoints. It also contains atransformImageUrlutility that can be used to transform image URLs to the correct format. Additionally,sapccModulehas a built-in feature that refreshes the token when it expires.
Migration Guide
If you were using the previous version of the sapccModule:
- Replace
addCartEntrywithaddToCart - Replace
updateCartEntrywithupdateCart
- const res = await sdk.sapcc.addCartEntry(params);
+ const res = await sdk.sapcc.addToCart(params);
- const res = await sdk.sapcc.updateCartEntry(params);
+ const res = await sdk.sapcc.updateCart(params);
If you were using the middlewareModule with SapccEndpoints:
- Replace the
middlewareModulewith thesapccModule
+ import { sapccModule } from "@vsf-enterprise/sapcc-sdk";
buildModule(sapccModule, {
apiUrl: `${config.apiUrl}/commerce`,
cdnCacheBustingId: config.cdnCacheBustingId,
defaultRequestConfig: {
getConfigSwitcherHeader,
headers: getRequestHeaders(),
},
ssrApiUrl: `${config.ssrApiUrl}/commerce`,
}),
Minor Changes
- CHANGED Update axios version to "^1.7.9"
Patch Changes
- Updated dependencies:
- @vsf-enterprise/sapcc-types@4.0.0
- @alokai/connect@1.0.0
- @vsf-enterprise/sap-commerce-assisted-service-module-webservices-sdk@4.0.0
- @vsf-enterprise/sap-commerce-webservices-sdk@7.0.0
6.0.0-rc.6
Major Changes
- CHANGED
sapccModuleis now based onmiddlewareModuleandSapccEndpoints. It also contains atransformImageUrlutility that can be used to transform image URLs to the correct format. Additionally,sapccModulehas a built-in feature that refreshes the token when it expires.
Migration Guide
If you were using the previous version of the sapccModule:
- Replace
addCartEntrywithaddToCart - Replace
updateCartEntrywithupdateCart
- const res = await sdk.sapcc.addCartEntry(params);
+ const res = await sdk.sapcc.addToCart(params);
- const res = await sdk.sapcc.updateCartEntry(params);
+ const res = await sdk.sapcc.updateCart(params);
If you were using the middlewareModule with SapccEndpoints:
- Replace the
middlewareModulewith thesapccModule
+ import { sapccModule } from "@vsf-enterprise/sapcc-sdk";
buildModule(sapccModule, {
apiUrl: `${config.apiUrl}/commerce`,
cdnCacheBustingId: config.cdnCacheBustingId,
defaultRequestConfig: {
getConfigSwitcherHeader,
headers: getRequestHeaders(),
},
ssrApiUrl: `${config.ssrApiUrl}/commerce`,
}),
6.0.0-rc.5
Patch Changes
- Updated dependencies:
- @alokai/connect@1.0.0-rc.4
6.0.0-rc.4
Major Changes
- CHANGED Updated the package for compatibility with Node.js 22.
Key Updates:
- Upgraded to the latest version of Node.js 22
- Updated CI pipelines to use Node.js 22 for consistency.
- Updated
.nvmrcor.node-versionfiles to specify Node.js version22.14. - Upgraded
@types/nodeto version^22.13.17for compatibility with the latest Node.js features.
Recommendations:
- Use Node.js version
22.14.0or 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 Changes
- Updated dependencies:
- @vsf-enterprise/sap-commerce-assisted-service-module-webservices-sdk@4.0.0-rc.0
- @vsf-enterprise/sap-commerce-webservices-sdk@7.0.0-rc.0
- @vsf-enterprise/sapcc-types@4.0.0-rc.1
- @alokai/connect@1.0.0-rc.3
6.0.0-rc.3
Minor Changes
- CHANGED Update axios version to "^1.7.9"
Patch Changes
- Updated dependencies:
- @alokai/connect@1.0.0-rc.2
6.0.0-rc.2
Patch Changes
- Updated dependencies:
- @alokai/connect@1.0.0-rc.1
6.0.0-rc.1
Major Changes
Update packages to work with connect rc version
Patch Changes
- Updated dependencies:
- @vsf-enterprise/sapcc-types@4.0.0-rc.0
- @alokai/connect@1.0.0-rc.0
6.0.0-rc.0
Major Changes
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.
5.0.6
Patch Changes
- CHANGED the version of
@vue-storefront/sdk-axios-request-senderpackage to^2.0.0.
5.0.5
Patch Changes
- ADDED Documentation about updating UID in SAP
5.0.4
Patch Changes
- ADDED Remark about fields available to update in updateAndGetUser SDK method
5.0.3
Patch Changes
- Updated dependencies:
- @vsf-enterprise/sap-commerce-webservices-sdk@6.0.0
- @vsf-enterprise/sap-commerce-assisted-service-module-webservices-sdk@3.0.0
5.0.3-rc.0
Patch Changes
- Updated dependencies:
- @vsf-enterprise/sap-commerce-webservices-sdk@6.0.0-rc.0
- @vsf-enterprise/sap-commerce-assisted-service-module-webservices-sdk@3.0.0-rc.0
- @vsf-enterprise/sapcc-types@3.0.2-rc.0
5.0.2
Patch Changes
- CHANGED Updated
@vue-storefront/middlewareversion to4.1.0.
5.0.1
Patch Changes
Update axios to ^0.28.0 to mitigate security vulnerability CVE-2023-45857
5.0.0
Major Changes
- 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 Changes
- Updated dependencies:
- @vsf-enterprise/sap-commerce-assisted-service-module-webservices-sdk@2.0.0
- @vsf-enterprise/sap-commerce-webservices-sdk@5.0.0
- @vsf-enterprise/sapcc-types@3.0.0
4.1.0
Minor Changes
- ADDED getProductsByIds method that allows fetching a list of products by their ids through Alokai-OCC extension.
// Fetching products by their IDs
const products = await sdk.commerce.getProductsByIds({
ids: ["1992695", "4392695"],
});
// Fetching a product and selecting response fields
const products = await sdk.commerce.getProductsByIds({
ids: ["1992695", "4392695"],
fields: "BASIC",
});
Patch Changes
- Updated dependencies:
- @vsf-enterprise/sap-commerce-webservices-sdk@4.1.0
- @vsf-enterprise/sapcc-types@2.4.0
4.0.1
Patch Changes
- 1e8c2700: - CHANGED Deprecated the
SAPCCModuleTypeinterface. It is no longer necessary to use this type. It's going to be removed in the next major version after Oct 1, 2024.import { initSDK, buildModule } from "@vue-storefront/sdk"; - import { sapccModule, SAPCCModuleType } from "@vue-storefront/sapcc-sdk"; + import { sapccModule } from "@vue-storefront/sapcc-sdk"; const sdkConfig = { - sapcc: buildModule<SAPCCModuleType>(sapccModule, { + sapcc: buildModule(sapccModule, { apiUrl: "http://localhost:8181/sapcc", }), }; export const sdk = initSDK(sdkConfig);
4.0.0
Major Changes
- CHANGED
sapccModulehas been deprecated. UsemiddlewareModulefrom@vue-storefront/sdkpackage instead.- import { initSDK, buildModule } from '@vue-storefront/sdk'; - import { sapccModule, SAPCCModuleType } from '@vsf-enterprise/sapcc-sdk' + import { initSDK, buildModule, middlewareModule } from '@vue-storefront/sdk'; + import { Endpoints as SapccEndpoints } from '@vsf-enterprise/sapcc-api'; // In Alokai Storefront you should import it from `storefront-middleware/types.d.ts` const sdkConfig = { sapcc: buildModule( - sapccModule, + middlewareModule<SapccEndpoints>, { apiUrl: 'http://localhost:8181/sapcc', ssrApiUrl: 'http://localhost:8181/sapcc' } ) };
Updating yoursapccModuleto this version should not disrupt your existing code; however, switching tomiddlewareModulewill require certain modifications.
To migrate:- Replace
addCartEntrywithaddToCart. - Replace
updateCartEntrywithupdateCart.
- const res = await sdk.sapcc.addCartEntry(params); + const res = await sdk.sapcc.addToCart(params); - const res = await sdk.sapcc.updateCartEntry(params); + const res = await sdk.sapcc.updateCart(params);- Remove
refreshTokenproperty from the options and apply a custom error handler:
+ import { createRefreshTokenAndRetryHandler } from "@vsf-enterprise/sapcc-sdk"; + + const handleRefreshTokenAndRetry = createRefreshTokenAndRetryHandler(); const sdkConfig = { sapcc: buildModule(sapccModule, middlewareModule<SapccEndpoints>, { apiUrl: "http://localhost:8181/sapcc", - refreshToken: { - isUnauthorized: (error) => { - // ... - }, - refreshTokenMethod: async () => { - // ... - }, - callbacks: { - onTokenRefreshed: async (refreshTokenRes) => { - // ... - }, - onTokenRefreshFailed: async (error) => { - // ... - }, - }, - ssrRefreshEnabled: false, // or true - }, + errorHandler: ({ error, url, params, config, httpClient }) => { + return handleRefreshTokenAndRetry( + error, + httpClient, + [url, params, config], + { + isUnauthorized: (error) => error.statusCode === 401, + refreshTokenMethod: async () => + httpClient( + "http://localhost:8181/sapcc/OAuthUserTokenRefresh", + [], + config + ), + callbacks: { + onTokenRefreshed: async (refreshTokenRes) => { + // ... + }, + onTokenRefreshFailed: async (error) => { + // ... + }, + }, + ssrRefreshEnabled: false, // or true + } + ); + }, }), }; - Replace
3.5.2
Patch Changes
- CHANGED Extends props of
getPaymentTypesmethod withuserId. - Updated dependencies
- @vsf-enterprise/sapcc-types@2.3.0
3.5.1
Patch Changes
- FIXED
getCurrentOrgCart,getConsentTemplates,getUser,getUserAddressesSDK methods should now suggest 'userId' as a possible prop in IDE code completions. Before this change, the api-client counterparts of the SDK methods knew how to handle userId, but the type definitions of the SDK methods did not let the user know that auserIdprop exists and that it can be used with those methods. - FIXED Issue with
handleRefreshTokenAndRetryhas been fixed, it was failing becauseerror.response.datawasundefined. Now, it's refreshing on all 401, not matter what is the error message. Behaviour can be also configured - by default the handler won't trigger during SSR. To enablehandleRefreshTokenAndRetryduring SSR, setssrRefreshEnabledtotrue.
Note: Browsers by default stores the cookies and sends them with every request. However, during SSR, the cookies are not sent by default. If you enable this option, you must ensure that the token is stored in the cookies manually in theonTokenRefreshedcallback.const handleRefreshTokenAndRetry = createRefreshTokenAndRetryHandler({ promise: null, lastRefresh: 0, retries: 0, }); handleRefreshTokenAndRetry({ ssrRefreshEnabled: true, callbacks: { onTokenRefreshed: async ( refreshTokenResponse: OAuthUserTokenResponse, ) => { // Store the token in the cookies }, }, });
3.5.0
Minor Changes
- 26268493: In some edge cases parallel requests can trigger unnecessary token refreshes. This is now fixed.
3.4.0
Minor Changes
- 1203f53d: Add Assisted Service Module's "autoComplete" method from Customer Controller
- f4e2787f: Add Assisted Service Module's "searchCustomer360" method from ASM Customer 360 Controller
- 4e5bead6: Add Assisted Service Module's "getPageableCustomers" method from Customer Controller
- 78ce68c9: Add Assisted Service Module's "customerLists" method from Customer Lists Controller
- 904c3dd4: Add Assisted Service Module's "bindCart" method from Customer Controller
- bdb12bec: Add Assisted Service Module's "createCustomer" method from Customer Controller
- 27246799: Add Assisted Service Module's "getCustomerListDetails" method from Customer Controller
- ef72c3be: Add Assisted Service Module's "getPointOfServices" method from Agent Controller
Patch Changes
- Updated dependencies 27246799
- @vsf-enterprise/sapcc-types@2.2.0
3.3.0
Minor Changes
- d574073c: Add a retry mechanism that on receiving 401 is going to refresh token and call the method once more.
3.2.0
Minor Changes
- 89a8b1e4: SDK methods now accept an additional generic type parameter allowing to overwrite the interface of the method props.
3.1.0
Minor Changes
- 16ba7f0f: ### Features
- B2B Order Approvals
- Add support for doMakeOrderApprovalDecision endpoint.
- B2B Order Approvals
- c357ff5f: ### Features
- Add support for order cancellation.
- 70efa8b5: ### Features
- B2B Cost Center
- Add support for getActiveCostCenters functionality.
- B2B Cost Center
- 89d81496: ### Features
- B2B Cost Center
- Add support for getBudgetsForCostCenter functionality.
- B2B Cost Center
- f7499224: ### Features
- B2B Carts
- Added support for replaceOrgCartPaymentType.
- B2B Carts
- 6fce91b5: ### Features
- B2B Cost Center
- Add support for getCostCenter functionality.
- B2B Cost Center
- 86fb4da1: ### Features
- B2B Categories
- Add support for getProductsByCategory.
- B2B Categories
- a36342c1: ### Features
- B2B Carts
- Added support for getCurrentOrgCart.
- B2B Carts
- a60df41e: ### Features
- B2B Carts
- Added support for replaceOrgCartEntries.
- B2B Carts
- 2c90bfe7: ### Features
- Add support for get B2b product action
- 75b34438: ### Features
- B2B Carts
- Added support for replaceOrgCartDeliveryAddress.
- B2B Carts
- efaa6771: Add support for get B2B User action
- 8377b9ba: ### Features
- B2B Cost Center
- Add support for getCostCenter functionality.
- B2B Cost Center
- dd958cdc: ### Features
- B2B Carts
- Added support for replaceOrgCartCostCenter.
- B2B Carts
- 6a5b0735: ### Features
- B2B Carts
- Added support for doAddOrgCartEntries.
- B2B Carts
- c498025c: ### Features
- Add support for B2B User create action
- 2e81f083: ### Features
- B2B Order Approvals
- Add support for getOrderApproval endpoint.
- B2B Order Approvals
- 3116f725: ### Features
- B2B Order Approvals
- Add support for getOrderApprovals endpoint.
- B2B Order Approvals
Patch Changes
- Updated dependencies 16ba7f0f
- Updated dependencies c357ff5f
- Updated dependencies 70efa8b5
- Updated dependencies 89d81496
- Updated dependencies f7499224
- Updated dependencies 6fce91b5
- Updated dependencies 86fb4da1
- Updated dependencies a36342c1
- Updated dependencies a60df41e
- Updated dependencies 75b34438
- Updated dependencies 8377b9ba
- Updated dependencies dd958cdc
- Updated dependencies 6a5b0735
- Updated dependencies c498025c
- Updated dependencies 2e81f083
- Updated dependencies 3116f725
- @vsf-enterprise/sapcc-types@2.1.0
3.0.0
Major Changes
- 8858fa66: Adjust packages to SAP Comerce Cloud v2211.13, as defined by CX template
Patch Changes
- Updated dependencies 8858fa66
- @vsf-enterprise/sap-commerce-webservices-sdk@4.0.0
- @vsf-enterprise/sapcc-types@2.0.0
2.1.0
Minor Changes
- 97889ddb: Implemented
updateUserLoginSDK method allowing to update customer's email address.
Patch Changes
- Updated dependencies d59b2fe1
- @vsf-enterprise/sapcc-types@1.2.0
2.0.1
Patch Changes
- 6da25e9a: Added examples how to send GET requests via SDK in the cookie-independent way so it's possible to cache responses
2.0.0
Major Changes
- Implemented
@vue-storefront/sdk-axios-request-senderpackage in all SDK methods. Also,getCategory,getBaseStore,getCatalogVersion,getCountries,getCountryRegions,getProduct,getProductReferences,getProductReviews,getProductSearchPageData,getSearchSuggestions,getTitles,searchProductmethods now send GET instead of POST requests to Alokai's Server Middleware.
1.2.0
Minor Changes
- Update packages to be compatibile with node >= 16 < 19
Patch Changes
- Updated dependencies [
3f1112d4]:- @vsf-enterprise/sap-commerce-webservices-sdk@3.1.0
1.1.0
Minor Changes
- Adds support for generic methods in SAPCC SDK
1.0.1
Patch Changes
- Update SDK dependency
1.0.0
This is the stable release of the 1.0.0 version of the @vsf-enterprise/sapcc-sdk package.
In this release we:
- covered 100% features the
@vsf-enterprise/sapcc-apifunctionalities, - created a new documentation focused on the SDK usage,
- made the module compatible with
v1.0.0of the@vue-storefront/sdkpackage.