commerce-sdk-isomorphic 3.1.1 → 3.2.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 +26 -1
- package/lib/index.cjs.d.ts +8736 -8089
- package/lib/index.cjs.js +1 -1
- package/lib/index.esm.d.ts +8736 -8089
- package/lib/index.esm.js +1 -1
- package/package.json +6 -6
- package/CHANGELOG.md +0 -340
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "commerce-sdk-isomorphic",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Salesforce Commerce SDK Isomorphic",
|
|
6
6
|
"bugs": {
|
|
@@ -96,8 +96,8 @@
|
|
|
96
96
|
"depcheck/@babel/parser": "7.16.4"
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
|
-
"nanoid": "^3.3.
|
|
100
|
-
"node-fetch": "2.6.
|
|
99
|
+
"nanoid": "^3.3.8",
|
|
100
|
+
"node-fetch": "2.6.13",
|
|
101
101
|
"seedrandom": "^3.0.5"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
123
123
|
"@typescript-eslint/parser": "^4.33.0",
|
|
124
124
|
"autoprefixer": "9.8.8",
|
|
125
|
-
"
|
|
125
|
+
"bundlesize2": "^0.0.31",
|
|
126
126
|
"depcheck": "^1.4.3",
|
|
127
127
|
"dotenv": "^16.0.3",
|
|
128
128
|
"eslint": "^7.32.0",
|
|
@@ -177,11 +177,11 @@
|
|
|
177
177
|
"bundlesize": [
|
|
178
178
|
{
|
|
179
179
|
"path": "lib/**/*.js",
|
|
180
|
-
"maxSize": "
|
|
180
|
+
"maxSize": "50 kB"
|
|
181
181
|
},
|
|
182
182
|
{
|
|
183
183
|
"path": "commerce-sdk-isomorphic-with-deps.tgz",
|
|
184
|
-
"maxSize": "
|
|
184
|
+
"maxSize": "560 kB"
|
|
185
185
|
}
|
|
186
186
|
],
|
|
187
187
|
"proxy": "https://SHORTCODE.api.commercecloud.salesforce.com"
|
package/CHANGELOG.md
DELETED
|
@@ -1,340 +0,0 @@
|
|
|
1
|
-
# CHANGELOG
|
|
2
|
-
|
|
3
|
-
## v3.1.1
|
|
4
|
-
|
|
5
|
-
### Bug fixes
|
|
6
|
-
- Fixed a bug that may cause the DNT flag to be omitted [#170](https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic/pull/170)
|
|
7
|
-
|
|
8
|
-
## v3.1.0
|
|
9
|
-
|
|
10
|
-
### Enhancements
|
|
11
|
-
- Update SLAS helpers to support DNT parameter [#167](https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic/pull/167)
|
|
12
|
-
|
|
13
|
-
## v3.0.0
|
|
14
|
-
|
|
15
|
-
### :warning: Planned API Changes :warning:
|
|
16
|
-
|
|
17
|
-
#### Shopper Context
|
|
18
|
-
|
|
19
|
-
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.
|
|
20
|
-
|
|
21
|
-
#### Shopper Login (SLAS)
|
|
22
|
-
|
|
23
|
-
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).
|
|
24
|
-
|
|
25
|
-
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.
|
|
26
|
-
|
|
27
|
-
In practice, we recommend:
|
|
28
|
-
|
|
29
|
-
- 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`.
|
|
30
|
-
- For customers using the SLAS helpers with a private client, it is recommended to upgrade to `v3.0.0` of the `commerce-sdk-isomorphic`.
|
|
31
|
-
|
|
32
|
-
### Enchancements
|
|
33
|
-
|
|
34
|
-
- Update SLAS helper function `loginGuestUserPrivate` to require `channel_id` through `clientConfig.parameters.siteId` [#165](https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic/pull/165)
|
|
35
|
-
|
|
36
|
-
## v2.1.0
|
|
37
|
-
|
|
38
|
-
### Enhancements
|
|
39
|
-
- Export the parameter keys for each API endpoint [#158](https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic/pull/158)
|
|
40
|
-
|
|
41
|
-
### API Changes
|
|
42
|
-
*Shopper Baskets*
|
|
43
|
-
|
|
44
|
-
| **Endpoint Name** | **Description** |
|
|
45
|
-
| ------------- |-----------------------------------|
|
|
46
|
-
| updateItemsInBasket | Updates multiple items in a basket. |
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
## v2.0.0
|
|
50
|
-
|
|
51
|
-
#### API Changes
|
|
52
|
-
|
|
53
|
-
*Shopper Stores*
|
|
54
|
-
|
|
55
|
-
* API Added
|
|
56
|
-
|
|
57
|
-
*Shopper Orders*
|
|
58
|
-
|
|
59
|
-
* New endpoint added
|
|
60
|
-
|
|
61
|
-
| **Endpoint Name** | **Description** |
|
|
62
|
-
| ------------- |-------------|
|
|
63
|
-
| guestOrderLookup | Lookup a guest order |
|
|
64
|
-
|
|
65
|
-
*Shopper Customers*
|
|
66
|
-
|
|
67
|
-
- Removal of deprecated endpoints:
|
|
68
|
-
- `invalidateCustomerAuth`
|
|
69
|
-
- `authorizeCustomer`
|
|
70
|
-
- `authorizeTrustedSystem`
|
|
71
|
-
|
|
72
|
-
#### Enchancements
|
|
73
|
-
|
|
74
|
-
- Add helper function `callCustomEndpoint` to call [Custom APIs](https://developer.salesforce.com/docs/commerce/commerce-api/guide/custom-apis.html) - [#149](https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic/pull/149)
|
|
75
|
-
|
|
76
|
-
#### Bug fixes
|
|
77
|
-
|
|
78
|
-
- Fixed createCodeVerifier adding entropy to be successfully indexed by Google Search Console [#150](https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic/pull/150)
|
|
79
|
-
|
|
80
|
-
## v1.13.1
|
|
81
|
-
|
|
82
|
-
#### Bug fixes
|
|
83
|
-
|
|
84
|
-
- Fix the missing `offset` and `limit` paramters in Shopper Search
|
|
85
|
-
|
|
86
|
-
## v1.13.0
|
|
87
|
-
- Update APIs for [Shopper Search](https://developer.salesforce.com/docs/commerce/commerce-api/references/about-commerce-api/about.html#282024)
|
|
88
|
-
|
|
89
|
-
## v1.12.0
|
|
90
|
-
|
|
91
|
-
#### API Added
|
|
92
|
-
|
|
93
|
-
| **Endpoint Name** | **Description** |
|
|
94
|
-
| ------------- |-------------|
|
|
95
|
-
|getUrlMapping | Gets URL mapping information for a URL that a shopper clicked or typed in. The mapping information is based on URL rules and redirects set up in Business Manager. For more information about prerequisites and sample usage, see [URL Resolution](/docs/commerce/commerce-api/guide/url-resolution.html). You can customize the behavior of this endpoint by using hooks. See the hooks for getUrlMapping in the [Hook List](https://developer.salesforce.com/docs/commerce/commerce-api/guide/hook_list.html). |
|
|
96
|
-
|
|
97
|
-
## v1.11.0
|
|
98
|
-
|
|
99
|
-
#### Enhancements
|
|
100
|
-
|
|
101
|
-
* Add support for Shopper Login (SLAS) prviate client with helper functions [#148](https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic/pull/140)
|
|
102
|
-
* ⚠️ WARNING ⚠️: Users should be extremely cautious about using the SLAS private client helper functions in the browser as it can expose your client secret
|
|
103
|
-
* Add support for custom query parameters [#139](https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic/pull/139)
|
|
104
|
-
|
|
105
|
-
## v1.10.4
|
|
106
|
-
|
|
107
|
-
#### Bug fixes
|
|
108
|
-
|
|
109
|
-
- Mark `expand` query parameter for `getProduct` endpoint as optional instead of required
|
|
110
|
-
|
|
111
|
-
## v1.10.3
|
|
112
|
-
|
|
113
|
-
#### Bug fixes
|
|
114
|
-
|
|
115
|
-
- Fix `expand` query parameter for `shopper-products`
|
|
116
|
-
- Remove `retrieveCredQualityUserInfo` endpoint from `shopper-login` as this functionality was removed from SLAS
|
|
117
|
-
|
|
118
|
-
## v1.10.2
|
|
119
|
-
|
|
120
|
-
#### Documentation
|
|
121
|
-
- Descriptions for certain `shopper-login` and `shopper-context` operations have been updated on [generated documentation site](https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/)
|
|
122
|
-
|
|
123
|
-
## v1.10.1
|
|
124
|
-
|
|
125
|
-
#### Bug fixes
|
|
126
|
-
|
|
127
|
-
- The 'To is not a function' [issue](https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic/issues/122) is fixed.
|
|
128
|
-
|
|
129
|
-
## v1.10.0
|
|
130
|
-
|
|
131
|
-
#### Enhancements
|
|
132
|
-
|
|
133
|
-
- Cookies are disabled by default.
|
|
134
|
-
- The cross-fetch dependency has been removed. Now commerce-sdk-isomorphic uses native fetch in browser and node-fetch library in node. This has potential impact for client implementations. Passing `fetchOptions: {redirect: 'manual'}` as called on the server-side to prevent following of redirects prior to this upgrade had no effect on the client because `cross-fetch` used `XMLHttpRequest` and was silently ignored. The new approach respects this `redirect: 'manual'` directive, potentially causing redirects on the client (given these optional parameters) to not be followed, which breaks flows including the SLAS `authorizeCustomer` method, which could fail with an `opaqueredirect` error.
|
|
135
|
-
|
|
136
|
-
#### API Added
|
|
137
|
-
|
|
138
|
-
*Shopper Baskets*
|
|
139
|
-
|
|
140
|
-
* New Endpoints
|
|
141
|
-
|
|
142
|
-
| **Endpoint Name** | **Description** |
|
|
143
|
-
| ------------- |-------------|
|
|
144
|
-
| updateAsAgentBasket | Marks a basket as an agent basket. |
|
|
145
|
-
| addPriceAdjustmentToBasket | Adds a custom manual price adjustment to the basket. |
|
|
146
|
-
| removePriceAdjustmentFromBasket | Removes a custom manual price adjustment from the basket. |
|
|
147
|
-
| updatePriceAdjustmentInBasket | Updates a custom manual price adjustment on the basket. |
|
|
148
|
-
| updateAsStorefrontBasket | Marks a basket as a storefront basket. |
|
|
149
|
-
|
|
150
|
-
## v1.9.0
|
|
151
|
-
|
|
152
|
-
### API Added
|
|
153
|
-
|
|
154
|
-
* The [Shopper Experience](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-experience?meta=Summary) API has been added to the SDK.
|
|
155
|
-
|
|
156
|
-
## v1.8.0
|
|
157
|
-
|
|
158
|
-
#### API Changes
|
|
159
|
-
|
|
160
|
-
*Shopper Login*
|
|
161
|
-
|
|
162
|
-
* New Endpoints
|
|
163
|
-
|
|
164
|
-
| **Endpoint Name** | **Description** |
|
|
165
|
-
| ------------- |-------------|
|
|
166
|
-
| getSessionBridgeAccessToken | Get a shopper JWT access token for a registered customer using session bridge |
|
|
167
|
-
| getTrustedAgentAuthorizationToken | Obtains a new agent on behalf authorization token for a registered customer |
|
|
168
|
-
| getTrustedAgentAccessToken | Get a shopper JWT access token for a registered customer using a trusted agent (Merchant) |
|
|
169
|
-
|
|
170
|
-
#### Enhancements
|
|
171
|
-
|
|
172
|
-
* SLAS helpers support the `channel_id` (`siteId`) parameter
|
|
173
|
-
|
|
174
|
-
## v1.7.1
|
|
175
|
-
|
|
176
|
-
#### Bug fixes
|
|
177
|
-
|
|
178
|
-
* Fix SLAS callback error handling
|
|
179
|
-
* Fix SLAS logout function
|
|
180
|
-
|
|
181
|
-
## v1.7.0
|
|
182
|
-
|
|
183
|
-
* Export API type definitions. They are available as top-level exports, following the pattern `<API Name>Types`.
|
|
184
|
-
|
|
185
|
-
Example usage:
|
|
186
|
-
|
|
187
|
-
```typescript
|
|
188
|
-
import {ShopperBaskets, ShopperBasketsTypes} from "commerce-sdk-isomorphic"
|
|
189
|
-
|
|
190
|
-
const basketsClient = new ShopperBaskets(config)
|
|
191
|
-
const basket: ShopperBasketsTypes.Basket = await basketsClient.getBasket({ basketId: "some-basket" })
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
## v1.6.0
|
|
195
|
-
|
|
196
|
-
#### API Changes
|
|
197
|
-
|
|
198
|
-
*Shopper Login*
|
|
199
|
-
|
|
200
|
-
* New Endpoints
|
|
201
|
-
|
|
202
|
-
| **Endpoint Name** | **Description** |
|
|
203
|
-
| ------------- |-------------|
|
|
204
|
-
| getPasswordResetToken | Request a reset password token |
|
|
205
|
-
| resetPassword | Creates a new password |
|
|
206
|
-
|
|
207
|
-
#### Enchancements
|
|
208
|
-
|
|
209
|
-
* More error handling has been added in the SLAS helpers
|
|
210
|
-
|
|
211
|
-
#### Bug fixes
|
|
212
|
-
|
|
213
|
-
* SLAS helper `loginRegisteredUserB2C` no longer calls `redirectURI` when running server side
|
|
214
|
-
|
|
215
|
-
#### Documentation
|
|
216
|
-
|
|
217
|
-
* `README` updated to explicitly note lack of CORS support for SCAPI
|
|
218
|
-
|
|
219
|
-
## v1.5.2
|
|
220
|
-
|
|
221
|
-
### New Features
|
|
222
|
-
|
|
223
|
-
* If the `throwOnBadResponse` flag is set, the error thrown now includes the full HTTP response object.
|
|
224
|
-
|
|
225
|
-
### Bug Fixes
|
|
226
|
-
|
|
227
|
-
* An error about invalid user-agent is no longer printed to console when making requests in a browser.
|
|
228
|
-
|
|
229
|
-
## v1.5.1
|
|
230
|
-
|
|
231
|
-
#### Documentation
|
|
232
|
-
|
|
233
|
-
* Replaced links to the [Commerce Cloud Developer Center](https://developer.commercecloud.com/s/salesforce-developer-center) with links to the new [Salesforce Developer Portal](https://developer.salesforce.com/docs/commerce/commerce-api).
|
|
234
|
-
|
|
235
|
-
#### Bug Fixes
|
|
236
|
-
|
|
237
|
-
* SLAS Login Helper no longer requests `redirect_uri` when running server-side
|
|
238
|
-
|
|
239
|
-
## v1.5.0
|
|
240
|
-
|
|
241
|
-
#### New Features
|
|
242
|
-
|
|
243
|
-
* SLAS helper functions have been added.
|
|
244
|
-
* New client configuration setting `throwOnBadResponse`. When set to true, responses other than `2xx` and `304` will throw an error.
|
|
245
|
-
|
|
246
|
-
#### New APIs
|
|
247
|
-
|
|
248
|
-
* *Shopper Context* has been added to the SDK.
|
|
249
|
-
|
|
250
|
-
#### API Changes
|
|
251
|
-
|
|
252
|
-
*Shopper Login*
|
|
253
|
-
|
|
254
|
-
* New Endpoints
|
|
255
|
-
|
|
256
|
-
| **Endpoint Name** | **Description** |
|
|
257
|
-
| ------------- |-------------|
|
|
258
|
-
| authorizePasswordlessCustomer | Logs a customer in using Core with their customer profiles loaded in ECOM. Allows the user to authenticate when their identity provider (Core) is down. |
|
|
259
|
-
| getPasswordLessAccessToken | Evaluate the `pwdless_token` and issue the shopper token (JWT). |
|
|
260
|
-
|
|
261
|
-
#### Bug Fixes
|
|
262
|
-
|
|
263
|
-
* Added support for `application/x-www-form-urlencoded` request bodies.
|
|
264
|
-
* SLAS endpoints now work out of the box
|
|
265
|
-
|
|
266
|
-
## v1.4.0
|
|
267
|
-
|
|
268
|
-
#### New Features
|
|
269
|
-
|
|
270
|
-
* TypeScript type definitions are now exported! :tada:
|
|
271
|
-
* Any parameter for any method can now be specified in the client configuration.
|
|
272
|
-
* Parameters not used by an endpoint will now be ignored, rather than included.
|
|
273
|
-
* A custom user agent is now sent with requests (node.js only)
|
|
274
|
-
|
|
275
|
-
#### API Changes
|
|
276
|
-
|
|
277
|
-
*Shopper Baskets*
|
|
278
|
-
|
|
279
|
-
* New endpoints
|
|
280
|
-
|
|
281
|
-
| **Endpoint Name** | **Description** |
|
|
282
|
-
| ------------- |-------------|
|
|
283
|
-
| transferBasket | Transfer the previous shopper's basket to the current shopper by updating the basket's owner. No other values change. You must obtain the shopper authorization token via SLAS, and it must contain both the previous and current shopper IDs. |
|
|
284
|
-
| mergeBasket | Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS, and it must contain both the previous and current shopper IDs. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions. |
|
|
285
|
-
| updatePaymentInstrumentInBasket | Success, the response body contains the basket with the updated payment instrument. |
|
|
286
|
-
|
|
287
|
-
*Shopper Login*
|
|
288
|
-
|
|
289
|
-
* New endpoints
|
|
290
|
-
|
|
291
|
-
| **Endpoint Name** | **Description** |
|
|
292
|
-
| ------------- |-------------|
|
|
293
|
-
| retrieveCredQualityUserInfo | Retrieve credential quality statistics for a user. |
|
|
294
|
-
|
|
295
|
-
## v1.3.0
|
|
296
|
-
|
|
297
|
-
#### New APIs
|
|
298
|
-
|
|
299
|
-
* *Shopper Discovery Search* has been added to the SDK.
|
|
300
|
-
|
|
301
|
-
#### API Changes
|
|
302
|
-
|
|
303
|
-
*Shopper Login*
|
|
304
|
-
|
|
305
|
-
* New operation: `getTrustedSystemAccessToken`
|
|
306
|
-
|
|
307
|
-
## v1.2.0
|
|
308
|
-
|
|
309
|
-
#### API Changes
|
|
310
|
-
|
|
311
|
-
*Shopper Customers*
|
|
312
|
-
|
|
313
|
-
* New operations
|
|
314
|
-
* registerExternalProfile
|
|
315
|
-
* getExternalProfile
|
|
316
|
-
|
|
317
|
-
## v1.1.2
|
|
318
|
-
|
|
319
|
-
* Fixed issue causing endpoints that accept array values to not properly set `Content-Type` header to `application/json`.
|
|
320
|
-
|
|
321
|
-
## v1.1.1
|
|
322
|
-
|
|
323
|
-
* Fixed issue causing `shortCode` to not be properly set
|
|
324
|
-
|
|
325
|
-
## v1.1.0
|
|
326
|
-
|
|
327
|
-
#### **API Changes**
|
|
328
|
-
|
|
329
|
-
*Shopper Baskets API*
|
|
330
|
-
|
|
331
|
-
* Endpoint Added
|
|
332
|
-
* organizations/{organizationId}/baskets/{basketId}/price-books
|
|
333
|
-
|
|
334
|
-
*Shopper Login API*
|
|
335
|
-
|
|
336
|
-
* Endpoint Added
|
|
337
|
-
* organizations/{organizationId}/oauth2/logout
|
|
338
|
-
* customer_id and enc_user_id were added to the TokenResponse type
|
|
339
|
-
* LoginRequest type was added
|
|
340
|
-
* Query param uuid for /organizations/{organizationId}/oauth2/authorize was renamed to usid
|