@scayle/storefront-core 7.39.0 → 7.39.1
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 +11 -5
- package/dist/rpc/methods/user.cjs +6 -5
- package/dist/rpc/methods/user.mjs +6 -3
- package/dist/types/user.d.ts +1 -1
- package/package.json +8 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @scayle/storefront-core
|
|
2
2
|
|
|
3
|
+
## 7.39.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Persist accessToken to user.authentication
|
|
8
|
+
|
|
3
9
|
## 7.39.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -172,8 +178,8 @@
|
|
|
172
178
|
|
|
173
179
|
### Minor Changes
|
|
174
180
|
|
|
175
|
-
-
|
|
176
|
-
-
|
|
181
|
+
- Add `promotion` RPC methods and types
|
|
182
|
+
- Add promotion data within the basket payloads
|
|
177
183
|
|
|
178
184
|
### Patch Changes
|
|
179
185
|
|
|
@@ -381,9 +387,9 @@
|
|
|
381
387
|
|
|
382
388
|
### Minor Changes
|
|
383
389
|
|
|
384
|
-
-
|
|
385
|
-
-
|
|
386
|
-
-
|
|
390
|
+
- Replaced `enums` with the companion object pattern approach.
|
|
391
|
+
- Replaced `HttpStatusMessage` number values with the actual message
|
|
392
|
+
- Exposed `HashAlgorithm` constant with its type and move it to the core
|
|
387
393
|
- **Breaking:** If you are importing `HashAlgorithm` from `@scayle/storefront-nuxt2` change to importing it from `@scayle/storefront-core`
|
|
388
394
|
|
|
389
395
|
## 7.1.0
|
|
@@ -20,9 +20,12 @@ const fetchUser = exports.fetchUser = async function fetchUser2(payload, context
|
|
|
20
20
|
} = context;
|
|
21
21
|
const client = new _customer.CustomerAPIClient(context);
|
|
22
22
|
const user = await client.getMe(shopId, accessToken);
|
|
23
|
-
if (user.authentication) {
|
|
24
|
-
user.authentication
|
|
23
|
+
if (!user.authentication) {
|
|
24
|
+
user.authentication = {
|
|
25
|
+
type: "idp"
|
|
26
|
+
};
|
|
25
27
|
}
|
|
28
|
+
user.authentication.storefrontAccessToken = accessToken;
|
|
26
29
|
user.loginShopId = shopId;
|
|
27
30
|
return user;
|
|
28
31
|
};
|
|
@@ -41,9 +44,7 @@ const refreshUser = exports.refreshUser = async function refreshUser2(context) {
|
|
|
41
44
|
...user.authentication,
|
|
42
45
|
storefrontAccessToken: accessToken
|
|
43
46
|
} : void 0,
|
|
44
|
-
|
|
45
|
-
loginShopId: shopId
|
|
46
|
-
}
|
|
47
|
+
loginShopId: shopId
|
|
47
48
|
});
|
|
48
49
|
return {
|
|
49
50
|
user
|
|
@@ -10,9 +10,12 @@ const fetchUser = async function fetchUser2(payload, context) {
|
|
|
10
10
|
const { shopId } = context;
|
|
11
11
|
const client = new CustomerAPIClient(context);
|
|
12
12
|
const user = await client.getMe(shopId, accessToken);
|
|
13
|
-
if (user.authentication) {
|
|
14
|
-
user.authentication
|
|
13
|
+
if (!user.authentication) {
|
|
14
|
+
user.authentication = {
|
|
15
|
+
type: "idp"
|
|
16
|
+
};
|
|
15
17
|
}
|
|
18
|
+
user.authentication.storefrontAccessToken = accessToken;
|
|
16
19
|
user.loginShopId = shopId;
|
|
17
20
|
return user;
|
|
18
21
|
};
|
|
@@ -28,7 +31,7 @@ const refreshUser = async function refreshUser2(context) {
|
|
|
28
31
|
...user.authentication,
|
|
29
32
|
storefrontAccessToken: accessToken
|
|
30
33
|
} : void 0,
|
|
31
|
-
|
|
34
|
+
loginShopId: shopId
|
|
32
35
|
});
|
|
33
36
|
return { user };
|
|
34
37
|
} catch {
|
package/dist/types/user.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ interface MemberRole {
|
|
|
14
14
|
memberPriority: number;
|
|
15
15
|
memberRoleSap: string;
|
|
16
16
|
}
|
|
17
|
-
type AuthenticationType = '
|
|
17
|
+
type AuthenticationType = 'password' | string;
|
|
18
18
|
interface UserAuthentication {
|
|
19
19
|
data?: {
|
|
20
20
|
accessToken?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-core",
|
|
3
|
-
"version": "7.39.
|
|
3
|
+
"version": "7.39.1",
|
|
4
4
|
"description": "Collection of essential utilities to work with the Storefront API",
|
|
5
5
|
"author": "SCAYLE Commerce Engine",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"build:legacy": "tsc -p tsconfig.legacy.json",
|
|
50
50
|
"build": "unbuild",
|
|
51
51
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
52
|
-
"format": "
|
|
53
|
-
"format:fix": "
|
|
52
|
+
"format": "dprint check",
|
|
53
|
+
"format:fix": "dprint fmt",
|
|
54
54
|
"lint": "eslint . --format gitlab",
|
|
55
55
|
"lint:fix": "eslint . --fix",
|
|
56
56
|
"package:lint": "publint",
|
|
@@ -59,25 +59,24 @@
|
|
|
59
59
|
"test:ci": "vitest --run --passWithNoTests --coverage --reporter=default --reporter=junit"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@aboutyou/backbone": "16.1.
|
|
62
|
+
"@aboutyou/backbone": "16.1.1",
|
|
63
63
|
"crypto-js": "4.2.0",
|
|
64
|
-
"jose": "5.2.
|
|
64
|
+
"jose": "5.2.1",
|
|
65
65
|
"radash": "11.0.0",
|
|
66
66
|
"slugify": "1.6.6",
|
|
67
|
-
"ufo": "1.
|
|
67
|
+
"ufo": "1.4.0",
|
|
68
68
|
"uncrypto": "0.1.3",
|
|
69
69
|
"utility-types": "3.11.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@scayle/eslint-config-storefront": "3.2.6",
|
|
73
|
-
"@scayle/prettier-config-storefront": "2.0.2",
|
|
74
73
|
"@types/crypto-js": "4.2.2",
|
|
75
|
-
"@types/node": "20.11.
|
|
74
|
+
"@types/node": "20.11.17",
|
|
76
75
|
"@types/webpack-env": "1.18.4",
|
|
77
76
|
"@vitest/coverage-v8": "1.2.2",
|
|
77
|
+
"dprint": "0.45.0",
|
|
78
78
|
"eslint": "8.56.0",
|
|
79
79
|
"eslint-formatter-gitlab": "5.1.0",
|
|
80
|
-
"prettier": "3.0.0",
|
|
81
80
|
"publint": "0.2.7",
|
|
82
81
|
"rimraf": "5.0.5",
|
|
83
82
|
"ts-node": "10.9.2",
|