@salesforce/commerce-sdk-react 1.1.0-dev.1 → 1.1.0-nightly-20230728234208
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 +30 -25
- package/auth/index.d.ts +2 -1
- package/auth/index.js +5 -3
- package/hooks/utils.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
## v1.1.0-
|
|
2
|
-
## v1.1.0-dev.0 (Jul
|
|
3
|
-
##
|
|
4
|
-
##
|
|
5
|
-
## v1.1.0-dev (
|
|
6
|
-
|
|
7
|
-
## v1.1
|
|
1
|
+
## v1.1.0-nightly-20230728234208 (Jul 28, 2023)
|
|
2
|
+
## v1.1.0-dev.0 (Jul 28, 2023)
|
|
3
|
+
## v1.1.0-dev (Jul 28, 2023)
|
|
4
|
+
## v3.2.0-nightly-20230728234208 (Jul 28, 2023)
|
|
5
|
+
## v1.1.0-dev (TTBD)
|
|
6
|
+
|
|
7
|
+
## v1.0.1 (Jul 26, 2023)
|
|
8
|
+
|
|
9
|
+
- Updated the expiry of the guest refresh token cookie to 30 days, to match the actual [duration of the token](https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas.html?q=refresh+token#access-tokens-and-refresh-tokens). [#1342](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1342)
|
|
10
|
+
- Fix potential security vulnerability in `semver` dependency [#1358](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1358)
|
|
11
|
+
- Fix request headers to be the intended headers, rather than parameters [#1377](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1377)
|
|
12
|
+
|
|
8
13
|
## v1.0.0 (Jun 15, 2023)
|
|
9
14
|
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
15
|
+
- First public release of package on npm under `@salesforce/commerce-sdk-react`
|
|
16
|
+
- Add missing cache invalidation for contexts/customers/login/order [#1073](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1073)
|
|
17
|
+
- Upgrade React 18, React DOM 18, @types/react@18, @types/react-dom@v18 Testing library 14 [#1166](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1166)
|
|
13
18
|
|
|
14
19
|
## Older Versions Without Namespace
|
|
15
20
|
|
|
@@ -17,28 +22,28 @@ The older versions below were published without the `@salesforce` namespace.
|
|
|
17
22
|
|
|
18
23
|
## v2.7.1 (May 11, 2023)
|
|
19
24
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
25
|
+
- Re-generate lock files and fix hook lib tests [#1186](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1186)
|
|
26
|
+
- Add additional properties to ShopperLogin test types [#1185](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1185)
|
|
27
|
+
- Add missing cache invalidation for contexts/customers/login/order [#1073](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1073)
|
|
28
|
+
- Fix Shopper Baskets Test case [#1082](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1082)
|
|
29
|
+
- Implement remaining Shopper Baskets cache logic [#1070](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1070)
|
|
30
|
+
- Decode pre-fetched token and save auth data in storage [#1052](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1052)
|
|
31
|
+
- Allow query hook parameters to be null. [#1046](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1046)
|
|
32
|
+
- Implement updateCustomerPassword as no-op. [#1031](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1031)
|
|
28
33
|
|
|
29
34
|
## v2.7.0 (Mar 03, 2023)
|
|
30
35
|
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
36
|
+
- Add Page/Region/Component components for shopper experience/page designer page rendering [#963](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/963)
|
|
37
|
+
- Namespace `Auth` storage keys with site identifier to allow multi-site support [#911](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/911)
|
|
38
|
+
- Add Shopper Experience `usePage` and `usePages` hooks[#958](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/958)
|
|
34
39
|
|
|
35
40
|
## v2.6.0 (Jan 25, 2023)
|
|
36
41
|
|
|
37
42
|
## v2.5.0 (Jan 05, 2023)
|
|
38
43
|
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
44
|
+
- Exclude test files in package file to avoid publishing them [#856](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/856)
|
|
45
|
+
- Pass in 'headers' and 'rawResponse' options to mutation hooks [#845](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/845)
|
|
46
|
+
- Commerce hooks: basket mutations [#834](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/834)
|
|
47
|
+
- Remove overriding of params in mutation hooks [#859](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/859)
|
|
43
48
|
|
|
44
49
|
## v2.4.0 (Dec 01, 2022)
|
package/auth/index.d.ts
CHANGED
|
@@ -35,7 +35,8 @@ declare class Auth {
|
|
|
35
35
|
private shopperCustomersClient;
|
|
36
36
|
private redirectURI;
|
|
37
37
|
private pendingToken;
|
|
38
|
-
private
|
|
38
|
+
private REFRESH_TOKEN_EXPIRATION_DAYS_REGISTERED;
|
|
39
|
+
private REFRESH_TOKEN_EXPIRATION_DAYS_GUEST;
|
|
39
40
|
private stores;
|
|
40
41
|
private fetchedToken;
|
|
41
42
|
private OCAPISessionsURL;
|
package/auth/index.js
CHANGED
|
@@ -115,7 +115,8 @@ const DATA_MAP = {
|
|
|
115
115
|
* @Internal
|
|
116
116
|
*/
|
|
117
117
|
class Auth {
|
|
118
|
-
|
|
118
|
+
REFRESH_TOKEN_EXPIRATION_DAYS_REGISTERED = 90;
|
|
119
|
+
REFRESH_TOKEN_EXPIRATION_DAYS_GUEST = 30;
|
|
119
120
|
constructor(config) {
|
|
120
121
|
this.client = new _commerceSdkIsomorphic.ShopperLogin({
|
|
121
122
|
proxy: config.proxy,
|
|
@@ -265,11 +266,12 @@ class Auth {
|
|
|
265
266
|
this.set('customer_type', isGuest ? 'guest' : 'registered');
|
|
266
267
|
const refreshTokenKey = isGuest ? 'refresh_token_guest' : 'refresh_token_registered';
|
|
267
268
|
const refreshTokenCopyKey = isGuest ? 'refresh_token_guest_copy' : 'refresh_token_registered_copy';
|
|
269
|
+
const refreshTokenExpiry = isGuest ? this.REFRESH_TOKEN_EXPIRATION_DAYS_GUEST : this.REFRESH_TOKEN_EXPIRATION_DAYS_REGISTERED;
|
|
268
270
|
this.set(refreshTokenKey, res.refresh_token, {
|
|
269
|
-
expires:
|
|
271
|
+
expires: refreshTokenExpiry
|
|
270
272
|
});
|
|
271
273
|
this.set(refreshTokenCopyKey, res.refresh_token, {
|
|
272
|
-
expires:
|
|
274
|
+
expires: refreshTokenExpiry
|
|
273
275
|
});
|
|
274
276
|
}
|
|
275
277
|
|
package/hooks/utils.js
CHANGED
|
@@ -74,7 +74,7 @@ const mergeOptions = (client, options) => {
|
|
|
74
74
|
body: options.body
|
|
75
75
|
} : {}), {}, {
|
|
76
76
|
parameters: _objectSpread(_objectSpread({}, client.clientConfig.parameters), options.parameters ? omitNullable(options.parameters) : {}),
|
|
77
|
-
headers: _objectSpread(_objectSpread({}, client.clientConfig.
|
|
77
|
+
headers: _objectSpread(_objectSpread({}, client.clientConfig.headers), options.headers)
|
|
78
78
|
});
|
|
79
79
|
return merged;
|
|
80
80
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/commerce-sdk-react",
|
|
3
|
-
"version": "1.1.0-
|
|
3
|
+
"version": "1.1.0-nightly-20230728234208",
|
|
4
4
|
"description": "A library that provides react hooks for fetching data from Commerce Cloud",
|
|
5
5
|
"homepage": "https://github.com/SalesforceCommerceCloud/pwa-kit/tree/develop/packages/ecom-react-hooks#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"typedoc-plugin-missing-exports": "^2.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@salesforce/pwa-kit-dev": "3.
|
|
50
|
+
"@salesforce/pwa-kit-dev": "3.2.0-nightly-20230728234208",
|
|
51
51
|
"@tanstack/react-query": "^4.28.0",
|
|
52
52
|
"@testing-library/jest-dom": "^5.16.5",
|
|
53
53
|
"@testing-library/react": "^14.0.0",
|
|
@@ -59,14 +59,14 @@
|
|
|
59
59
|
"@types/react-dom": "^18.2.1",
|
|
60
60
|
"@types/react-helmet": "^6.1.6",
|
|
61
61
|
"cross-env": "^5.2.1",
|
|
62
|
-
"internal-lib-build": "3.
|
|
62
|
+
"internal-lib-build": "3.2.0-nightly-20230728234208",
|
|
63
63
|
"jsonwebtoken": "^9.0.0",
|
|
64
64
|
"nock": "^13.3.0",
|
|
65
65
|
"nodemon": "^2.0.22",
|
|
66
66
|
"react": "^18.2.0",
|
|
67
67
|
"react-dom": "^18.2.0",
|
|
68
68
|
"react-helmet": "^6.1.0",
|
|
69
|
-
"semver": "^7.
|
|
69
|
+
"semver": "^7.5.2",
|
|
70
70
|
"shelljs": "^0.8.5",
|
|
71
71
|
"typedoc": "^0.24.7",
|
|
72
72
|
"typescript": "4.9.5"
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"directory": "dist"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "6806647d69cadb77c3e8c86b7d7a2336a82e929f"
|
|
90
90
|
}
|