Vue Storefront is now Alokai! Learn More
Change Log

Change Log

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. Use middlewareModule 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 your sapccModule to this version should not disrupt your existing code; however, switching to middlewareModule will require certain modifications.
    To migrate:
    • Replace addCartEntry with addToCart.
    • Replace updateCartEntry with updateCart.
    - 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
    +        }
    +      );
    +    },
      }),
    };
    

3.5.2

Patch Changes

  • CHANGED Extends props of getPaymentTypes method with userId.
  • 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 a userId prop exists and that it can be used with those methods.
  • FIXED Issue with handleRefreshTokenAndRetry has been fixed, it was failing because error.response.data was undefined. 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 enable handleRefreshTokenAndRetry during SSR, set ssrRefreshEnabled to true.
    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 the onTokenRefreshed 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.
  • c357ff5f: ### Features
    • Add support for order cancellation.
  • 70efa8b5: ### Features
    • B2B Cost Center
      • Add support for getActiveCostCenters functionality.
  • 89d81496: ### Features
    • B2B Cost Center
      • Add support for getBudgetsForCostCenter functionality.
  • f7499224: ### Features
    • B2B Carts
      • Added support for replaceOrgCartPaymentType.
  • 6fce91b5: ### Features
    • B2B Cost Center
      • Add support for getCostCenter functionality.
  • 86fb4da1: ### Features
    • B2B Categories
      • Add support for getProductsByCategory.
  • a36342c1: ### Features
    • B2B Carts
      • Added support for getCurrentOrgCart.
  • a60df41e: ### Features
    • B2B Carts
      • Added support for replaceOrgCartEntries.
  • 2c90bfe7: ### Features
    • Add support for get B2b product action
  • 75b34438: ### Features
    • B2B Carts
      • Added support for replaceOrgCartDeliveryAddress.
  • efaa6771: Add support for get B2B User action
  • 8377b9ba: ### Features
    • B2B Cost Center
      • Add support for getCostCenter functionality.
  • dd958cdc: ### Features
    • B2B Carts
      • Added support for replaceOrgCartCostCenter.
  • 6a5b0735: ### Features
    • B2B Carts
      • Added support for doAddOrgCartEntries.
  • c498025c: ### Features
    • Add support for B2B User create action
  • 2e81f083: ### Features
    • B2B Order Approvals
      • Add support for getOrderApproval endpoint.
  • 3116f725: ### Features
    • B2B Order Approvals
      • Add support for getOrderApprovals endpoint.

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.