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