commerce-sdk-isomorphic 2.1.0 → 3.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/CHANGELOG.md +23 -0
- package/README.md +68 -116
- package/lib/index.cjs.d.ts +42 -18
- package/lib/index.cjs.js +1 -1
- package/lib/index.esm.d.ts +42 -18
- package/lib/index.esm.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## v3.0.0
|
|
4
|
+
|
|
5
|
+
### :warning: Planned API Changes :warning:
|
|
6
|
+
|
|
7
|
+
#### Shopper Context
|
|
8
|
+
|
|
9
|
+
Starting July 31st 2024, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025. You can read more about the planned change [here](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-context?meta=Summary) in the notes section.
|
|
10
|
+
|
|
11
|
+
#### Shopper Login (SLAS)
|
|
12
|
+
|
|
13
|
+
SLAS will soon require new tenants to pass `channel_id` as an argument for retrieving guest access tokens. You can read more about the planned change [here](https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas.html#guest-tokens).
|
|
14
|
+
|
|
15
|
+
Please be aware that existing tenants are on a temporary allow list and will see no immediate disruption to service. We do ask that all users seek to adhere to the `channel_id` requirement before the end of August to enhance your security posture before the holiday peak season.
|
|
16
|
+
|
|
17
|
+
In practice, we recommend:
|
|
18
|
+
|
|
19
|
+
- For customers using the SLAS helpers with a public client, it is recommended to upgrade to at least `v1.8.0` of the `commerce-sdk-isomorphic`.
|
|
20
|
+
- For customers using the SLAS helpers with a private client, it is recommended to upgrade to `v3.0.0` of the `commerce-sdk-isomorphic`.
|
|
21
|
+
|
|
22
|
+
### Enchancements
|
|
23
|
+
|
|
24
|
+
- Update SLAS helper function `loginGuestUserPrivate` to require `channel_id` through `clientConfig.parameters.siteId` [#165](https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic/pull/165)
|
|
25
|
+
|
|
3
26
|
## v2.1.0
|
|
4
27
|
|
|
5
28
|
### Enhancements
|
package/README.md
CHANGED
|
@@ -1,13 +1,32 @@
|
|
|
1
1
|
# commerce-sdk-isomorphic
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This SDK provides a Browser & Node.js JavaScript client for calling [B2C Commerce Shopper APIs](https://developer.salesforce.com/docs/commerce/commerce-api/overview).
|
|
4
|
+
|
|
5
|
+
_For a Node.js only SDK that can also access Admin APIs checkout [Commerce SDK](https://github.com/SalesforceCommerceCloud/commerce-sdk)._
|
|
6
|
+
|
|
7
|
+
## :warning: Planned API Changes :warning:
|
|
8
|
+
|
|
9
|
+
### Shopper Context
|
|
10
|
+
|
|
11
|
+
Starting July 31st 2024, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025. You can read more about the planned change [here](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-context?meta=Summary) in the notes section.
|
|
12
|
+
|
|
13
|
+
### Shopper Login (SLAS)
|
|
14
|
+
|
|
15
|
+
SLAS will soon require new tenants to pass `channel_id` as an argument for retrieving guest access tokens. You can read more about the planned change [here](https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas.html#guest-tokens).
|
|
16
|
+
|
|
17
|
+
Please be aware that existing tenants are on a temporary allow list and will see no immediate disruption to service. We do ask that all users seek to adhere to the `channel_id` requirement before the end of August to enhance your security posture before the holiday peak season.
|
|
18
|
+
|
|
19
|
+
In practice, we recommend:
|
|
20
|
+
|
|
21
|
+
- For customers using the SLAS helpers with a public client, it is recommended to upgrade to at least `v1.8.0` of the `commerce-sdk-isomorphic`.
|
|
22
|
+
- For customers using the SLAS helpers with a private client, it is recommended to upgrade to `v3.0.0` of the `commerce-sdk-isomorphic`.
|
|
4
23
|
|
|
5
24
|
## Getting Started
|
|
6
25
|
|
|
7
26
|
### Requirements
|
|
8
27
|
|
|
9
28
|
- Node `^12.x`, `^14.x`, `^16.x`, `^18.x`
|
|
10
|
-
|
|
29
|
+
- The SDK requires B2C Commerce API (SCAPI) to be configured. For more info see [Getting started with SCAPI](https://developer.salesforce.com/docs/commerce/commerce-api/guide/get-started.html).
|
|
11
30
|
|
|
12
31
|
### Installation
|
|
13
32
|
|
|
@@ -17,55 +36,25 @@ npm install commerce-sdk-isomorphic
|
|
|
17
36
|
|
|
18
37
|
### Usage
|
|
19
38
|
|
|
20
|
-
> **Note:** These are required parameters.
|
|
21
|
-
|
|
22
|
-
| Parameter | Description |
|
|
23
|
-
| -------------- | :------------------------------------------------------------------------- |
|
|
24
|
-
| clientId | ID of the client account created with Salesforce Commerce. |
|
|
25
|
-
| organizationId | The unique identifier for your Salesforce identity. |
|
|
26
|
-
| shortCode | Region-specific merchant ID. |
|
|
27
|
-
| siteId | Name of the site to access data from, for example, RefArch or SiteGenesis. |
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
### Configure the Isomorphic SDK
|
|
31
|
-
|
|
32
|
-
|
|
33
39
|
```javascript
|
|
34
|
-
/**
|
|
35
|
-
* Configure required parameters
|
|
36
|
-
*
|
|
37
|
-
* To learn more about the parameters please refer to https://developer.salesforce.com/docs/commerce/commerce-api/guide/get-started.html
|
|
38
|
-
*/
|
|
39
40
|
import {helpers, ShopperLogin, ShopperSearch} from 'commerce-sdk-isomorphic';
|
|
40
41
|
|
|
41
|
-
// Create a configuration to use when creating API clients
|
|
42
42
|
const config = {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
// SCAPI does not support CORS, so client side requests must use a reverse proxy.
|
|
44
|
+
proxy: 'https://localhost:3000',
|
|
45
45
|
parameters: {
|
|
46
46
|
clientId: '<your-client-id>',
|
|
47
47
|
organizationId: '<your-org-id>',
|
|
48
48
|
shortCode: '<your-short-code>',
|
|
49
49
|
siteId: '<your-site-id>',
|
|
50
50
|
},
|
|
51
|
-
throwOnBadResponse: true,
|
|
52
51
|
};
|
|
53
52
|
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
shopperLogin,
|
|
58
|
-
{redirectURI: `${config.proxy}/callback`} // Callback URL must be configured in SLAS Admin
|
|
53
|
+
const {access_token} = await helpers.loginGuestUser(
|
|
54
|
+
new ShopperLogin(config),
|
|
55
|
+
{redirectURI: `${config.proxy}/callback`}
|
|
59
56
|
);
|
|
60
57
|
|
|
61
|
-
// Execute Private Client OAuth with PKCE to acquire guest tokens
|
|
62
|
-
// ***WARNING*** Be cautious about using this function in the browser as you may end up exposing your client secret
|
|
63
|
-
// only use it when you know your slas client secret is secured
|
|
64
|
-
// const {access_token, refresh_token} = await helpers.loginGuestUserPrivate(
|
|
65
|
-
// shopperLogin,
|
|
66
|
-
// {}, {clientSecret: '<your-slas-client-secret>'}
|
|
67
|
-
// );
|
|
68
|
-
|
|
69
58
|
const shopperSearch = new ShopperSearch({
|
|
70
59
|
...config,
|
|
71
60
|
headers: {authorization: `Bearer ${access_token}`},
|
|
@@ -76,59 +65,33 @@ const searchResult = await shopperSearch.productSearch({
|
|
|
76
65
|
});
|
|
77
66
|
```
|
|
78
67
|
|
|
79
|
-
####
|
|
80
|
-
|
|
81
|
-
The Salesforce Commerce API (SCAPI) does not support CORS, so a proxy must be used to be able to use the SDK.
|
|
82
|
-
|
|
83
|
-
### Advanced Options
|
|
68
|
+
#### Fetch Options
|
|
84
69
|
|
|
85
|
-
|
|
86
|
-
This sample code shows how to configure HTTP timeout and agent options.
|
|
70
|
+
You can configure how the SDK makes requests using the `fetchOptions` parameter. It is passed to [node-fetch](https://github.com/node-fetch/node-fetch/1#api) on the server and [whatwg-fetch](https://github.github.io/fetch/) on browser.
|
|
87
71
|
|
|
88
72
|
```javascript
|
|
89
|
-
|
|
90
|
-
* Configure advanced timeout and agent parameters
|
|
91
|
-
*
|
|
92
|
-
* To learn more about the parameters please refer to the [Salesforce Developer Center](https://developer.salesforce.com/docs/commerce/commerce-api).
|
|
93
|
-
*/
|
|
94
|
-
// Create a configuration to use when creating API clients
|
|
95
|
-
const https = require('https');
|
|
73
|
+
const https = require("https");
|
|
96
74
|
|
|
97
75
|
const config = {
|
|
98
|
-
proxy: 'https://localhost:3000',
|
|
99
|
-
headers: {},
|
|
100
|
-
parameters: {
|
|
101
|
-
clientId: '<your-client-id>',
|
|
102
|
-
organizationId: '<your-org-id>',
|
|
103
|
-
shortCode: '<your-short-code>',
|
|
104
|
-
siteId: '<your-site-id>',
|
|
105
|
-
},
|
|
106
76
|
fetchOptions: {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}),
|
|
77
|
+
// By default, requests made using the SDK do not include cookies.
|
|
78
|
+
credentials: "include",
|
|
79
|
+
timeout: 2000,
|
|
80
|
+
agent: new https.agent({ keepAlive: true }),
|
|
112
81
|
},
|
|
113
82
|
};
|
|
114
83
|
```
|
|
115
84
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
_headers:_ A collection of key/value string pairs representing additional headers to include with API requests.
|
|
119
|
-
|
|
120
|
-
_throwOnBadResponse:_ Default value is false. When set to true, the SDK throws an Error on responses with statuses that are not 2xx or 304.
|
|
85
|
+
For more info, refer to the [documentation site](https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/).
|
|
121
86
|
|
|
122
|
-
|
|
87
|
+
#### Additional Config Settings
|
|
123
88
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
**⚠️ WARNING ⚠️**
|
|
127
|
-
Users should be extremely cautious about using the SLAS private client helper functions in the browser as it can expose your client secret. Ensure that your client secret is secured before running the function client side.
|
|
89
|
+
* `headers`: Headers to include with API requests.
|
|
90
|
+
* `throwOnBadResponse`: When `true`, the SDK throws an `Error` on responses whose status is not 2xx or 304.
|
|
128
91
|
|
|
129
92
|
### Custom Query Parameters
|
|
130
93
|
|
|
131
|
-
|
|
94
|
+
You can pass custom query parameters through the SDK to be used in [B2C Commerce API Hooks](https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html). Custom query parameters must begin with `c_`:
|
|
132
95
|
|
|
133
96
|
```javascript
|
|
134
97
|
const searchResult = await shopperSearch.productSearch({
|
|
@@ -139,19 +102,17 @@ const searchResult = await shopperSearch.productSearch({
|
|
|
139
102
|
});
|
|
140
103
|
```
|
|
141
104
|
|
|
142
|
-
Invalid query parameters that are not a part of the API and do not follow the `c_` custom query parameter convention
|
|
105
|
+
Invalid query parameters that are not a part of the API and do not follow the `c_` custom query parameter convention are filtered from the request with a warning.
|
|
143
106
|
|
|
144
107
|
### Custom APIs
|
|
145
108
|
|
|
146
|
-
The SDK supports calling [
|
|
147
|
-
|
|
148
|
-
Example usage:
|
|
109
|
+
The SDK supports calling [B2C Commerce Custom APIs](https://developer.salesforce.com/docs/commerce/commerce-api/guide/custom-apis.html) with a helper function, `callCustomEndpoint`:
|
|
149
110
|
|
|
150
111
|
```javascript
|
|
151
|
-
import pkg from
|
|
112
|
+
import pkg from "commerce-sdk-isomorphic";
|
|
152
113
|
const { helpers } = pkg;
|
|
153
114
|
|
|
154
|
-
const
|
|
115
|
+
const clientConfig = {
|
|
155
116
|
parameters: {
|
|
156
117
|
clientId: "<your-client-id>",
|
|
157
118
|
organizationId: "<your-org-id>",
|
|
@@ -161,63 +122,54 @@ const clientConfigExample = {
|
|
|
161
122
|
// If not provided, it'll use the default production URI:
|
|
162
123
|
// 'https://{shortCode}.api.commercecloud.salesforce.com/custom/{apiName}/{apiVersion}'
|
|
163
124
|
// path parameters should be wrapped in curly braces like the default production URI
|
|
164
|
-
baseUri: "<your-base-uri>"
|
|
125
|
+
baseUri: "<your-base-uri>",
|
|
165
126
|
};
|
|
166
127
|
|
|
167
128
|
// Required params: apiName, endpointPath, shortCode, organizaitonId
|
|
168
129
|
// Required path params can be passed into:
|
|
169
130
|
// options.customApiPathParameters or clientConfig.parameters
|
|
170
|
-
const
|
|
171
|
-
apiName:
|
|
172
|
-
apiVersion:
|
|
173
|
-
endpointPath:
|
|
174
|
-
}
|
|
131
|
+
const customApiPathParameters = {
|
|
132
|
+
apiName: "loyalty-info",
|
|
133
|
+
apiVersion: "v1", // defaults to v1 if not provided
|
|
134
|
+
endpointPath: "customers",
|
|
135
|
+
};
|
|
175
136
|
|
|
176
|
-
const accessToken =
|
|
137
|
+
const accessToken = "<INSERT ACCESS TOKEN HERE>";
|
|
177
138
|
|
|
178
|
-
|
|
139
|
+
await helpers.callCustomEndpoint({
|
|
179
140
|
options: {
|
|
180
|
-
method:
|
|
141
|
+
method: "GET",
|
|
181
142
|
parameters: {
|
|
182
|
-
queryParameter:
|
|
143
|
+
queryParameter: "queryParameter1",
|
|
183
144
|
},
|
|
184
145
|
headers: {
|
|
185
146
|
// Content-Type is defaulted to application/json if not provided
|
|
186
|
-
|
|
187
|
-
authorization: `Bearer ${
|
|
147
|
+
"Content-Type": "application/json",
|
|
148
|
+
authorization: `Bearer ${accessToken}`,
|
|
188
149
|
},
|
|
189
|
-
customApiPathParameters
|
|
190
|
-
},
|
|
191
|
-
clientConfig
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
let postResponse = await helpers.callCustomEndpoint({
|
|
150
|
+
customApiPathParameters,
|
|
151
|
+
},
|
|
152
|
+
clientConfig,
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
await helpers.callCustomEndpoint({
|
|
197
156
|
options: {
|
|
198
|
-
method:
|
|
157
|
+
method: "POST",
|
|
199
158
|
parameters: {
|
|
200
|
-
queryParameter:
|
|
159
|
+
queryParameter: "queryParameter1",
|
|
201
160
|
},
|
|
202
161
|
headers: {
|
|
203
|
-
authorization: `Bearer ${
|
|
162
|
+
authorization: `Bearer ${accessToken}`,
|
|
204
163
|
},
|
|
205
|
-
customApiPathParameters
|
|
206
|
-
body: JSON.stringify({ data:
|
|
207
|
-
},
|
|
208
|
-
clientConfig
|
|
209
|
-
|
|
210
|
-
rawResponse: false,
|
|
211
|
-
})
|
|
212
|
-
|
|
213
|
-
console.log('get response: ', getResponse)
|
|
214
|
-
console.log('post response: ', postResponse)
|
|
164
|
+
customApiPathParameters,
|
|
165
|
+
body: JSON.stringify({ data: "data" }),
|
|
166
|
+
},
|
|
167
|
+
clientConfig,
|
|
168
|
+
});
|
|
215
169
|
```
|
|
216
170
|
|
|
217
171
|
For more documentation about this helper function, please refer to the [commerce-sdk-isomorphic docs](https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/modules/helpers.html).
|
|
218
172
|
|
|
219
|
-
For more information about custom APIs, please refer to the [Salesforce Developer Docs](https://developer.salesforce.com/docs/commerce/commerce-api/guide/custom-apis.html)
|
|
220
|
-
|
|
221
173
|
## License Information
|
|
222
174
|
|
|
223
175
|
The Commerce SDK Isomorphic is licensed under BSD-3-Clause license. See the [license](./LICENSE.txt) for details.
|
package/lib/index.cjs.d.ts
CHANGED
|
@@ -8551,7 +8551,7 @@ type ShopperContextsParameters = ShopperContextsPathParameters & BaseUriParamete
|
|
|
8551
8551
|
* ```
|
|
8552
8552
|
*
|
|
8553
8553
|
* <span style="font-size:.7em; display:block; text-align: right">
|
|
8554
|
-
* API Version: 0.0.
|
|
8554
|
+
* API Version: 0.0.29<br />
|
|
8555
8555
|
* Last Updated: <br />
|
|
8556
8556
|
* </span>
|
|
8557
8557
|
*
|
|
@@ -8606,6 +8606,8 @@ declare class ShopperContexts<ConfigParameters extends ShopperContextsParameters
|
|
|
8606
8606
|
};
|
|
8607
8607
|
/**
|
|
8608
8608
|
* Gets the shopper's context based on the shopperJWT.
|
|
8609
|
+
|
|
8610
|
+
With B2C Commerce release 24.5, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025.
|
|
8609
8611
|
*
|
|
8610
8612
|
* If you would like to get a raw Response object use the other getShopperContext function.
|
|
8611
8613
|
*
|
|
@@ -8613,7 +8615,7 @@ declare class ShopperContexts<ConfigParameters extends ShopperContextsParameters
|
|
|
8613
8615
|
* @param parameters - An object containing the parameters for this method.
|
|
8614
8616
|
* @param organizationId -
|
|
8615
8617
|
* @param usid - The Shopper's unique identifier. It is a required parameter and is part of the response from the Guest or Registered User Shopper Login (SLAS) API call.
|
|
8616
|
-
* @param siteId - The identifier of the site to which the request is being sent. With B2C Commerce release 24.5, all new implementations of Shopper Context require the `siteId` query parameter to be passed. Existing customers with Shopper Context implementations should start including `siteId` going forward. Starting
|
|
8618
|
+
* @param siteId - The identifier of the site to which the request is being sent. With B2C Commerce release 24.5, all new implementations of Shopper Context require the `siteId` query parameter to be passed. Existing customers with Shopper Context implementations should start including `siteId` going forward. Starting January 2025, `siteId` will be required for all customers, and a bad request response code will be returned for requests without a `siteId`.
|
|
8617
8619
|
* @param headers - An object literal of key value pairs of the headers to be
|
|
8618
8620
|
* sent with this request.
|
|
8619
8621
|
*
|
|
@@ -8634,12 +8636,14 @@ declare class ShopperContexts<ConfigParameters extends ShopperContextsParameters
|
|
|
8634
8636
|
}>): Promise<ShopperContext>;
|
|
8635
8637
|
/**
|
|
8636
8638
|
* Gets the shopper's context based on the shopperJWT.
|
|
8639
|
+
|
|
8640
|
+
With B2C Commerce release 24.5, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025.
|
|
8637
8641
|
*
|
|
8638
8642
|
* @param options - An object containing the options for this method.
|
|
8639
8643
|
* @param parameters - An object containing the parameters for this method.
|
|
8640
8644
|
* @param organizationId -
|
|
8641
8645
|
* @param usid - The Shopper's unique identifier. It is a required parameter and is part of the response from the Guest or Registered User Shopper Login (SLAS) API call.
|
|
8642
|
-
* @param siteId - The identifier of the site to which the request is being sent. With B2C Commerce release 24.5, all new implementations of Shopper Context require the `siteId` query parameter to be passed. Existing customers with Shopper Context implementations should start including `siteId` going forward. Starting
|
|
8646
|
+
* @param siteId - The identifier of the site to which the request is being sent. With B2C Commerce release 24.5, all new implementations of Shopper Context require the `siteId` query parameter to be passed. Existing customers with Shopper Context implementations should start including `siteId` going forward. Starting January 2025, `siteId` will be required for all customers, and a bad request response code will be returned for requests without a `siteId`.
|
|
8643
8647
|
* @param headers - An object literal of key value pairs of the headers to be
|
|
8644
8648
|
* sent with this request.
|
|
8645
8649
|
* @param rawResponse - Set to true to return entire Response object instead of DTO.
|
|
@@ -8660,6 +8664,8 @@ declare class ShopperContexts<ConfigParameters extends ShopperContextsParameters
|
|
|
8660
8664
|
}>, rawResponse?: T): Promise<T extends true ? Response : ShopperContext>;
|
|
8661
8665
|
/**
|
|
8662
8666
|
* Creates the shopper's context based on shopperJWT.
|
|
8667
|
+
|
|
8668
|
+
With B2C Commerce release 24.5, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025.
|
|
8663
8669
|
*
|
|
8664
8670
|
* If you would like to get a raw Response object use the other createShopperContext function.
|
|
8665
8671
|
*
|
|
@@ -8698,6 +8704,8 @@ declare class ShopperContexts<ConfigParameters extends ShopperContextsParameters
|
|
|
8698
8704
|
}>): Promise<void | void>;
|
|
8699
8705
|
/**
|
|
8700
8706
|
* Creates the shopper's context based on shopperJWT.
|
|
8707
|
+
|
|
8708
|
+
With B2C Commerce release 24.5, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025.
|
|
8701
8709
|
*
|
|
8702
8710
|
* @param options - An object containing the options for this method.
|
|
8703
8711
|
* @param parameters - An object containing the parameters for this method.
|
|
@@ -8734,6 +8742,8 @@ declare class ShopperContexts<ConfigParameters extends ShopperContextsParameters
|
|
|
8734
8742
|
}>, rawResponse?: T): Promise<T extends true ? Response : void | void>;
|
|
8735
8743
|
/**
|
|
8736
8744
|
* Gets the shopper's context based on the shopperJWT.
|
|
8745
|
+
|
|
8746
|
+
With B2C Commerce release 24.5, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025.
|
|
8737
8747
|
*
|
|
8738
8748
|
* If you would like to get a raw Response object use the other deleteShopperContext function.
|
|
8739
8749
|
*
|
|
@@ -8762,6 +8772,8 @@ declare class ShopperContexts<ConfigParameters extends ShopperContextsParameters
|
|
|
8762
8772
|
}>): Promise<void>;
|
|
8763
8773
|
/**
|
|
8764
8774
|
* Gets the shopper's context based on the shopperJWT.
|
|
8775
|
+
|
|
8776
|
+
With B2C Commerce release 24.5, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025.
|
|
8765
8777
|
*
|
|
8766
8778
|
* @param options - An object containing the options for this method.
|
|
8767
8779
|
* @param parameters - An object containing the parameters for this method.
|
|
@@ -8788,6 +8800,8 @@ declare class ShopperContexts<ConfigParameters extends ShopperContextsParameters
|
|
|
8788
8800
|
}>, rawResponse?: T): Promise<T extends true ? Response : void>;
|
|
8789
8801
|
/**
|
|
8790
8802
|
* Updates the shopper's context based on the Shopper JWT. If the shopper context exists, it's updated with the patch body. If a `custom qualifier/assignment qualifer` or an `effectiveDateTime` or a `sourceCode` or a `customerGroupIds` is already present in the existing shopper context, its value is replaced by the corresponding value from the patch body. If a `custom qualifers'` or a `assignment qualifiers'` value is set to `null`, it's deleted from existing shopper context. If `effectiveDateTime` or `sourceCode` value is set to an empty string (\"\"), it's deleted from existing shopper context. If `effectiveDateTime` or `sourceCode` value is set to `null`, it's ignored. If an `effectiveDateTime` or `sourceCode` or `custom/assignment qualifiiers'` value is new, it's added to the existing Shopper context. If `customerGroupIds` is set to empty array `[]` the existing value in shopper context is deleted.
|
|
8803
|
+
|
|
8804
|
+
With B2C Commerce release 24.5, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025.
|
|
8791
8805
|
*
|
|
8792
8806
|
* If you would like to get a raw Response object use the other updateShopperContext function.
|
|
8793
8807
|
*
|
|
@@ -8826,6 +8840,8 @@ declare class ShopperContexts<ConfigParameters extends ShopperContextsParameters
|
|
|
8826
8840
|
}>): Promise<ShopperContext>;
|
|
8827
8841
|
/**
|
|
8828
8842
|
* Updates the shopper's context based on the Shopper JWT. If the shopper context exists, it's updated with the patch body. If a `custom qualifier/assignment qualifer` or an `effectiveDateTime` or a `sourceCode` or a `customerGroupIds` is already present in the existing shopper context, its value is replaced by the corresponding value from the patch body. If a `custom qualifers'` or a `assignment qualifiers'` value is set to `null`, it's deleted from existing shopper context. If `effectiveDateTime` or `sourceCode` value is set to an empty string (\"\"), it's deleted from existing shopper context. If `effectiveDateTime` or `sourceCode` value is set to `null`, it's ignored. If an `effectiveDateTime` or `sourceCode` or `custom/assignment qualifiiers'` value is new, it's added to the existing Shopper context. If `customerGroupIds` is set to empty array `[]` the existing value in shopper context is deleted.
|
|
8843
|
+
|
|
8844
|
+
With B2C Commerce release 24.5, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025.
|
|
8829
8845
|
*
|
|
8830
8846
|
* @param options - An object containing the options for this method.
|
|
8831
8847
|
* @param parameters - An object containing the parameters for this method.
|
|
@@ -9278,7 +9294,7 @@ declare namespace ShopperContextsTypes {
|
|
|
9278
9294
|
* ```
|
|
9279
9295
|
*
|
|
9280
9296
|
* <span style="font-size:.7em; display:block; text-align: right">
|
|
9281
|
-
* API Version: 0.0.
|
|
9297
|
+
* API Version: 0.0.29<br />
|
|
9282
9298
|
* Last Updated: <br />
|
|
9283
9299
|
* </span>
|
|
9284
9300
|
*
|
|
@@ -9333,6 +9349,8 @@ declare namespace ShopperContextsTypes {
|
|
|
9333
9349
|
};
|
|
9334
9350
|
/**
|
|
9335
9351
|
* Gets the shopper's context based on the shopperJWT.
|
|
9352
|
+
|
|
9353
|
+
With B2C Commerce release 24.5, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025.
|
|
9336
9354
|
*
|
|
9337
9355
|
* If you would like to get a raw Response object use the other getShopperContext function.
|
|
9338
9356
|
*
|
|
@@ -9340,7 +9358,7 @@ declare namespace ShopperContextsTypes {
|
|
|
9340
9358
|
* @param parameters - An object containing the parameters for this method.
|
|
9341
9359
|
* @param organizationId -
|
|
9342
9360
|
* @param usid - The Shopper's unique identifier. It is a required parameter and is part of the response from the Guest or Registered User Shopper Login (SLAS) API call.
|
|
9343
|
-
* @param siteId - The identifier of the site to which the request is being sent. With B2C Commerce release 24.5, all new implementations of Shopper Context require the `siteId` query parameter to be passed. Existing customers with Shopper Context implementations should start including `siteId` going forward. Starting
|
|
9361
|
+
* @param siteId - The identifier of the site to which the request is being sent. With B2C Commerce release 24.5, all new implementations of Shopper Context require the `siteId` query parameter to be passed. Existing customers with Shopper Context implementations should start including `siteId` going forward. Starting January 2025, `siteId` will be required for all customers, and a bad request response code will be returned for requests without a `siteId`.
|
|
9344
9362
|
* @param headers - An object literal of key value pairs of the headers to be
|
|
9345
9363
|
* sent with this request.
|
|
9346
9364
|
*
|
|
@@ -9361,12 +9379,14 @@ declare namespace ShopperContextsTypes {
|
|
|
9361
9379
|
}>): Promise<ShopperContext>;
|
|
9362
9380
|
/**
|
|
9363
9381
|
* Gets the shopper's context based on the shopperJWT.
|
|
9382
|
+
|
|
9383
|
+
With B2C Commerce release 24.5, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025.
|
|
9364
9384
|
*
|
|
9365
9385
|
* @param options - An object containing the options for this method.
|
|
9366
9386
|
* @param parameters - An object containing the parameters for this method.
|
|
9367
9387
|
* @param organizationId -
|
|
9368
9388
|
* @param usid - The Shopper's unique identifier. It is a required parameter and is part of the response from the Guest or Registered User Shopper Login (SLAS) API call.
|
|
9369
|
-
* @param siteId - The identifier of the site to which the request is being sent. With B2C Commerce release 24.5, all new implementations of Shopper Context require the `siteId` query parameter to be passed. Existing customers with Shopper Context implementations should start including `siteId` going forward. Starting
|
|
9389
|
+
* @param siteId - The identifier of the site to which the request is being sent. With B2C Commerce release 24.5, all new implementations of Shopper Context require the `siteId` query parameter to be passed. Existing customers with Shopper Context implementations should start including `siteId` going forward. Starting January 2025, `siteId` will be required for all customers, and a bad request response code will be returned for requests without a `siteId`.
|
|
9370
9390
|
* @param headers - An object literal of key value pairs of the headers to be
|
|
9371
9391
|
* sent with this request.
|
|
9372
9392
|
* @param rawResponse - Set to true to return entire Response object instead of DTO.
|
|
@@ -9387,6 +9407,8 @@ declare namespace ShopperContextsTypes {
|
|
|
9387
9407
|
}>, rawResponse?: T): Promise<T extends true ? Response : ShopperContext>;
|
|
9388
9408
|
/**
|
|
9389
9409
|
* Creates the shopper's context based on shopperJWT.
|
|
9410
|
+
|
|
9411
|
+
With B2C Commerce release 24.5, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025.
|
|
9390
9412
|
*
|
|
9391
9413
|
* If you would like to get a raw Response object use the other createShopperContext function.
|
|
9392
9414
|
*
|
|
@@ -9425,6 +9447,8 @@ declare namespace ShopperContextsTypes {
|
|
|
9425
9447
|
}>): Promise<void | void>;
|
|
9426
9448
|
/**
|
|
9427
9449
|
* Creates the shopper's context based on shopperJWT.
|
|
9450
|
+
|
|
9451
|
+
With B2C Commerce release 24.5, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025.
|
|
9428
9452
|
*
|
|
9429
9453
|
* @param options - An object containing the options for this method.
|
|
9430
9454
|
* @param parameters - An object containing the parameters for this method.
|
|
@@ -9461,6 +9485,8 @@ declare namespace ShopperContextsTypes {
|
|
|
9461
9485
|
}>, rawResponse?: T): Promise<T extends true ? Response : void | void>;
|
|
9462
9486
|
/**
|
|
9463
9487
|
* Gets the shopper's context based on the shopperJWT.
|
|
9488
|
+
|
|
9489
|
+
With B2C Commerce release 24.5, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025.
|
|
9464
9490
|
*
|
|
9465
9491
|
* If you would like to get a raw Response object use the other deleteShopperContext function.
|
|
9466
9492
|
*
|
|
@@ -9489,6 +9515,8 @@ declare namespace ShopperContextsTypes {
|
|
|
9489
9515
|
}>): Promise<void>;
|
|
9490
9516
|
/**
|
|
9491
9517
|
* Gets the shopper's context based on the shopperJWT.
|
|
9518
|
+
|
|
9519
|
+
With B2C Commerce release 24.5, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025.
|
|
9492
9520
|
*
|
|
9493
9521
|
* @param options - An object containing the options for this method.
|
|
9494
9522
|
* @param parameters - An object containing the parameters for this method.
|
|
@@ -9515,6 +9543,8 @@ declare namespace ShopperContextsTypes {
|
|
|
9515
9543
|
}>, rawResponse?: T): Promise<T extends true ? Response : void>;
|
|
9516
9544
|
/**
|
|
9517
9545
|
* Updates the shopper's context based on the Shopper JWT. If the shopper context exists, it's updated with the patch body. If a `custom qualifier/assignment qualifer` or an `effectiveDateTime` or a `sourceCode` or a `customerGroupIds` is already present in the existing shopper context, its value is replaced by the corresponding value from the patch body. If a `custom qualifers'` or a `assignment qualifiers'` value is set to `null`, it's deleted from existing shopper context. If `effectiveDateTime` or `sourceCode` value is set to an empty string (\"\"), it's deleted from existing shopper context. If `effectiveDateTime` or `sourceCode` value is set to `null`, it's ignored. If an `effectiveDateTime` or `sourceCode` or `custom/assignment qualifiiers'` value is new, it's added to the existing Shopper context. If `customerGroupIds` is set to empty array `[]` the existing value in shopper context is deleted.
|
|
9546
|
+
|
|
9547
|
+
With B2C Commerce release 24.5, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025.
|
|
9518
9548
|
*
|
|
9519
9549
|
* If you would like to get a raw Response object use the other updateShopperContext function.
|
|
9520
9550
|
*
|
|
@@ -9553,6 +9583,8 @@ declare namespace ShopperContextsTypes {
|
|
|
9553
9583
|
}>): Promise<ShopperContext>;
|
|
9554
9584
|
/**
|
|
9555
9585
|
* Updates the shopper's context based on the Shopper JWT. If the shopper context exists, it's updated with the patch body. If a `custom qualifier/assignment qualifer` or an `effectiveDateTime` or a `sourceCode` or a `customerGroupIds` is already present in the existing shopper context, its value is replaced by the corresponding value from the patch body. If a `custom qualifers'` or a `assignment qualifiers'` value is set to `null`, it's deleted from existing shopper context. If `effectiveDateTime` or `sourceCode` value is set to an empty string (\"\"), it's deleted from existing shopper context. If `effectiveDateTime` or `sourceCode` value is set to `null`, it's ignored. If an `effectiveDateTime` or `sourceCode` or `custom/assignment qualifiiers'` value is new, it's added to the existing Shopper context. If `customerGroupIds` is set to empty array `[]` the existing value in shopper context is deleted.
|
|
9586
|
+
|
|
9587
|
+
With B2C Commerce release 24.5, all endpoints in the Shopper context API will require the `siteId` parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025.
|
|
9556
9588
|
*
|
|
9557
9589
|
* @param options - An object containing the options for this method.
|
|
9558
9590
|
* @param parameters - An object containing the parameters for this method.
|
|
@@ -18229,8 +18261,6 @@ type GiftCertificate = {
|
|
|
18229
18261
|
};
|
|
18230
18262
|
type GiftCertificateRequest = {
|
|
18231
18263
|
giftCertificateCode: string;
|
|
18232
|
-
} & {
|
|
18233
|
-
[key: string]: any;
|
|
18234
18264
|
};
|
|
18235
18265
|
type RangeFilter$4 = {
|
|
18236
18266
|
[key: string]: any;
|
|
@@ -18374,7 +18404,7 @@ type ShopperGiftCertificatesParameters = ShopperGiftCertificatesPathParameters &
|
|
|
18374
18404
|
* ```
|
|
18375
18405
|
*
|
|
18376
18406
|
* <span style="font-size:.7em; display:block; text-align: right">
|
|
18377
|
-
* API Version: 1.0.
|
|
18407
|
+
* API Version: 1.0.17<br />
|
|
18378
18408
|
* Last Updated: <br />
|
|
18379
18409
|
* </span>
|
|
18380
18410
|
*
|
|
@@ -18560,8 +18590,6 @@ declare namespace ShopperGiftCertificatesTypes {
|
|
|
18560
18590
|
};
|
|
18561
18591
|
type GiftCertificateRequest = {
|
|
18562
18592
|
giftCertificateCode: string;
|
|
18563
|
-
} & {
|
|
18564
|
-
[key: string]: any;
|
|
18565
18593
|
};
|
|
18566
18594
|
type ErrorResponse = {
|
|
18567
18595
|
type: string;
|
|
@@ -18860,7 +18888,7 @@ declare namespace ShopperGiftCertificatesTypes {
|
|
|
18860
18888
|
* ```
|
|
18861
18889
|
*
|
|
18862
18890
|
* <span style="font-size:.7em; display:block; text-align: right">
|
|
18863
|
-
* API Version: 1.0.
|
|
18891
|
+
* API Version: 1.0.17<br />
|
|
18864
18892
|
* Last Updated: <br />
|
|
18865
18893
|
* </span>
|
|
18866
18894
|
*
|
|
@@ -26810,8 +26838,6 @@ type PromotionResult = {
|
|
|
26810
26838
|
limit: number;
|
|
26811
26839
|
data: Array<Promotion>;
|
|
26812
26840
|
total: number;
|
|
26813
|
-
} & {
|
|
26814
|
-
[key: string]: any;
|
|
26815
26841
|
};
|
|
26816
26842
|
type RangeFilter$8 = {
|
|
26817
26843
|
[key: string]: any;
|
|
@@ -26961,7 +26987,7 @@ type ShopperPromotionsParameters = ShopperPromotionsPathParameters & BaseUriPara
|
|
|
26961
26987
|
* ```
|
|
26962
26988
|
*
|
|
26963
26989
|
* <span style="font-size:.7em; display:block; text-align: right">
|
|
26964
|
-
* API Version: 1.0.
|
|
26990
|
+
* API Version: 1.0.27<br />
|
|
26965
26991
|
* Last Updated: <br />
|
|
26966
26992
|
* </span>
|
|
26967
26993
|
*
|
|
@@ -27240,8 +27266,6 @@ declare namespace ShopperPromotionsTypes {
|
|
|
27240
27266
|
limit: number;
|
|
27241
27267
|
data: Array<Promotion>;
|
|
27242
27268
|
total: number;
|
|
27243
|
-
} & {
|
|
27244
|
-
[key: string]: any;
|
|
27245
27269
|
};
|
|
27246
27270
|
type Error = {
|
|
27247
27271
|
type: string;
|
|
@@ -27546,7 +27570,7 @@ declare namespace ShopperPromotionsTypes {
|
|
|
27546
27570
|
* ```
|
|
27547
27571
|
*
|
|
27548
27572
|
* <span style="font-size:.7em; display:block; text-align: right">
|
|
27549
|
-
* API Version: 1.0.
|
|
27573
|
+
* API Version: 1.0.27<br />
|
|
27550
27574
|
* Last Updated: <br />
|
|
27551
27575
|
* </span>
|
|
27552
27576
|
*
|