commerce-sdk-isomorphic 3.3.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -7
- package/lib/index.cjs.d.ts +51486 -28523
- package/lib/index.cjs.js +1 -1
- package/lib/index.esm.d.ts +51486 -28523
- package/lib/index.esm.js +1 -1
- package/package.json +11 -9
package/README.md
CHANGED
|
@@ -4,6 +4,26 @@ This SDK provides a Browser & Node.js JavaScript client for calling [B2C Commerc
|
|
|
4
4
|
|
|
5
5
|
_For a Node.js only SDK that can also access Admin APIs checkout [Commerce SDK](https://github.com/SalesforceCommerceCloud/commerce-sdk)._
|
|
6
6
|
|
|
7
|
+
## Documentation
|
|
8
|
+
|
|
9
|
+
An auto-generated [documentation site](https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/) provides comprehensive reference for all available endpoints and types across API classes. Following the v4.0.0 release, the underlying SDK file structure has been reorganized, introducing additional layers of imports/exports that may affect navigation.
|
|
10
|
+
|
|
11
|
+
### Navigating the Documentation
|
|
12
|
+
|
|
13
|
+
**For API Classes:**
|
|
14
|
+
|
|
15
|
+
1. **Accessing API Classes:** Click on the API class name (e.g., `shopperProducts`) on the right hand side
|
|
16
|
+
2. **Viewing Endpoints:** Scroll to the `Classes` section and click the corresponding API class link (e.g., `ShopperProducts`) to see available endpoints and their parameters
|
|
17
|
+
3. **Type Definitions:** Scroll to the `Type aliases` section for available types
|
|
18
|
+
|
|
19
|
+
**Utility Classes:** Utility classes and methods such as `clientConfig` and `helpers` maintain the same structure as previous versions.
|
|
20
|
+
|
|
21
|
+
**NOTES:**
|
|
22
|
+
|
|
23
|
+
1. **Type Access**: API class types are accessible through the `<api_class>Types` namespace (e.g., `ShopperProductsTypes`). Individual types can be accessed as `ShopperProductsTypes.Product`.
|
|
24
|
+
|
|
25
|
+
2. **Type References**: The `References` section under API classes in the generated documentation may show duplicate entries. This occurs because types are exported both at their original definition and under the API class namespace. Both references point to the same underlying type definition.
|
|
26
|
+
|
|
7
27
|
## :warning: Planned API Changes :warning:
|
|
8
28
|
|
|
9
29
|
### Shopper Context
|
|
@@ -56,10 +76,10 @@ const config = {
|
|
|
56
76
|
},
|
|
57
77
|
};
|
|
58
78
|
|
|
59
|
-
const {access_token} = await helpers.loginGuestUser(
|
|
60
|
-
new ShopperLogin(config),
|
|
61
|
-
{redirectURI: `${config.proxy}/callback`}
|
|
62
|
-
);
|
|
79
|
+
const {access_token} = await helpers.loginGuestUser({
|
|
80
|
+
slasClient: new ShopperLogin(config),
|
|
81
|
+
parameters: {redirectURI: `${config.proxy}/callback`}
|
|
82
|
+
});
|
|
63
83
|
|
|
64
84
|
const shopperSearch = new ShopperSearch({
|
|
65
85
|
...config,
|
|
@@ -239,9 +259,9 @@ const scapiSpecialEncodedId = helpers.encodeSCAPISpecialCharacters(categoryId);
|
|
|
239
259
|
// <base-url>/product/shopper-products/v1/organizations/{organizationId}/categories/{id}
|
|
240
260
|
const categoryResult = await shopperProducts.getCategory({
|
|
241
261
|
parameters: {
|
|
242
|
-
//
|
|
243
|
-
//
|
|
244
|
-
id:
|
|
262
|
+
// No need to use `encodeURIComponent` as query parameters are single encoded by the SDK
|
|
263
|
+
// So the SCAPI special characters will end up double encoded as well
|
|
264
|
+
id: scapiSpecialEncodedId,
|
|
245
265
|
}
|
|
246
266
|
});
|
|
247
267
|
|