Change Log
5.0.6
Patch Changes
- CHANGED the version of
@vue-storefront/sdk-axios-request-sender
package 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/middleware
version 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
SAPCCModuleType
interface. 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
sapccModule
has been deprecated. UsemiddlewareModule
from@vue-storefront/sdk
package 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 yoursapccModule
to this version should not disrupt your existing code; however, switching tomiddlewareModule
will require certain modifications.
To migrate:- Replace
addCartEntry
withaddToCart
. - Replace
updateCartEntry
withupdateCart
.
- 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
refreshToken
property 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
getPaymentTypes
method withuserId
. - Updated dependencies
- @vsf-enterprise/sapcc-types@2.3.0
3.5.1
Patch Changes
- FIXED
getCurrentOrgCart
,getConsentTemplates
,getUser
,getUserAddresses
SDK 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 auserId
prop exists and that it can be used with those methods. - FIXED Issue with
handleRefreshTokenAndRetry
has been fixed, it was failing becauseerror.response.data
wasundefined
. 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 enablehandleRefreshTokenAndRetry
during SSR, setssrRefreshEnabled
totrue
.
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 theonTokenRefreshed
callback.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
updateUserLogin
SDK 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-sender
package in all SDK methods. Also,getCategory
,getBaseStore
,getCatalogVersion
,getCountries
,getCountryRegions
,getProduct
,getProductReferences
,getProductReviews
,getProductSearchPageData
,getSearchSuggestions
,getTitles
,searchProduct
methods 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-api
functionalities, - created a new documentation focused on the SDK usage,
- made the module compatible with
v1.0.0
of the@vue-storefront/sdk
package.