@scayle/storefront-core 8.55.0 → 8.57.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
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# @scayle/storefront-core
|
|
2
2
|
|
|
3
|
+
## 8.57.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- **\[Navigation\]** Exported Navigation V2 API types to provide TypeScript support for the new navigation endpoints.
|
|
8
|
+
|
|
9
|
+
The following types are now available from `@scayle/storefront-core`:
|
|
10
|
+
|
|
11
|
+
- `GetNavigationV2Parameters` - Parameters for fetching navigation trees via the V2 API
|
|
12
|
+
- `NavigationV2AllEndpointResponseData` - Response type for fetching all navigation trees
|
|
13
|
+
- `NavigationV2ByReferenceEndpointResponseData` - Response type for fetching a navigation tree by reference key
|
|
14
|
+
|
|
15
|
+
These types enable full TypeScript support when working with the Navigation V2 API, which uses reference keys instead of numeric IDs for more flexible navigation management.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
**Dependencies**
|
|
20
|
+
|
|
21
|
+
- Updated dependency to @scayle/storefront-api@18.20.0
|
|
22
|
+
|
|
23
|
+
## 8.56.0
|
|
24
|
+
|
|
25
|
+
### Minor Changes
|
|
26
|
+
|
|
27
|
+
- Added support for custom session data in the RPC context type definitions.
|
|
28
|
+
|
|
29
|
+
The `ContextWithSession` interface now includes a `sessionCustomData` property (which may be `undefined`) to read custom session data and an `updateSessionCustomData` method to update it.
|
|
30
|
+
The `ContextWithoutSession` interface has been updated accordingly to maintain type consistency.
|
|
31
|
+
The `SessionCustomData` interface can be augmented using TypeScript module augmentation to provide type safety for custom session properties.
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
**Dependencies**
|
|
36
|
+
|
|
37
|
+
- Updated dependency to @scayle/storefront-api@18.19.0
|
|
38
|
+
- Updated dependency to @scayle/unstorage-scayle-kv-driver@2.0.9
|
|
39
|
+
|
|
3
40
|
## 8.55.0
|
|
4
41
|
|
|
5
42
|
### Minor Changes
|
|
@@ -40,7 +40,7 @@ export const getCheckoutToken = defineRpcHandler(async (jwtPayload = {}, context
|
|
|
40
40
|
...customData,
|
|
41
41
|
...orderCustomData
|
|
42
42
|
}
|
|
43
|
-
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.
|
|
43
|
+
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.57.0"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
|
|
44
44
|
return {
|
|
45
45
|
accessToken: refreshedAccessToken,
|
|
46
46
|
checkoutJwt
|
|
@@ -27,7 +27,7 @@ export interface RuntimeConfiguration {
|
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Additional context information for RPC calls.
|
|
30
|
-
*
|
|
30
|
+
* This interface can be augmented to extend the `RpcContext` type and
|
|
31
31
|
* allows to adding custom properties to the RPC context.
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
@@ -42,6 +42,22 @@ export interface RuntimeConfiguration {
|
|
|
42
42
|
*/
|
|
43
43
|
export interface AdditionalRpcContext {
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Interface for custom session data.
|
|
47
|
+
* This interface can be augmented to extend the `RpcContextWithSession` type and
|
|
48
|
+
* allows to adding custom data properties to the session on the RPC context.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* declare module '@scayle/storefront-core' {
|
|
53
|
+
* interface SessionCustomData {
|
|
54
|
+
* myCustomData: string
|
|
55
|
+
* }
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export interface SessionCustomData {
|
|
60
|
+
}
|
|
45
61
|
/**
|
|
46
62
|
* Context interface with session information.
|
|
47
63
|
*/
|
|
@@ -52,8 +68,10 @@ export interface ContextWithSession {
|
|
|
52
68
|
user: ShopUser | undefined;
|
|
53
69
|
accessToken: string | undefined;
|
|
54
70
|
refreshToken: string | undefined;
|
|
71
|
+
sessionCustomData: SessionCustomData | undefined;
|
|
55
72
|
destroySession: () => Promise<void>;
|
|
56
73
|
createUserBoundSession: () => Promise<void>;
|
|
74
|
+
updateSessionCustomData: (updatedCustomData: SessionCustomData) => Promise<void>;
|
|
57
75
|
updateUser: (user: ShopUser) => void;
|
|
58
76
|
updateTokens: (tokens: OAuthTokens) => void;
|
|
59
77
|
}
|
|
@@ -67,9 +85,11 @@ export interface ContextWithoutSession {
|
|
|
67
85
|
user: undefined;
|
|
68
86
|
accessToken: undefined;
|
|
69
87
|
refreshToken: undefined;
|
|
88
|
+
sessionCustomData: undefined;
|
|
70
89
|
destroySession: undefined;
|
|
71
90
|
createUserBoundSession: undefined;
|
|
72
91
|
updateUser: undefined;
|
|
92
|
+
updateSessionCustomData: undefined;
|
|
73
93
|
updateTokens: undefined;
|
|
74
94
|
}
|
|
75
95
|
/**
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import type { GetNavigationParameters, NavigationItems } from '@scayle/storefront-api';
|
|
2
|
-
export type { NavigationItems, NavigationTree, NavigationItemExternal, NavigationItemPage, NavigationItemCategory, } from '@scayle/storefront-api';
|
|
1
|
+
import type { GetNavigationParameters, NavigationItems, NavigationV2Items } from '@scayle/storefront-api';
|
|
2
|
+
export type { NavigationItems, NavigationV2Items, NavigationV2Tree, NavigationV2ItemExternal, NavigationV2ItemCategory, NavigationV2ItemPage, NavigationTree, NavigationItemExternal, NavigationItemPage, NavigationItemCategory, GetNavigationV2Parameters, GetNavigationV2ByReferenceKeyParams, NavigationV2AllEndpointResponseData, NavigationV2ByReferenceEndpointResponseData, } from '@scayle/storefront-api';
|
|
3
3
|
/**
|
|
4
4
|
* Represents a navigation tree item.
|
|
5
5
|
*/
|
|
6
6
|
export type NavigationTreeItem = NavigationItems[0];
|
|
7
|
+
/**
|
|
8
|
+
* Represents a navigation tree item for Navigation V2.
|
|
9
|
+
*/
|
|
10
|
+
export type NavigationV2TreeItem = NavigationV2Items[0];
|
|
7
11
|
/**
|
|
8
12
|
* Parameters for fetching navigation trees.
|
|
9
13
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-core",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.57.0",
|
|
4
4
|
"description": "Collection of essential utilities to work with the Storefront API",
|
|
5
5
|
"author": "SCAYLE Commerce Engine",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,26 +48,26 @@
|
|
|
48
48
|
"ufo": "^1.5.3",
|
|
49
49
|
"uncrypto": "^0.1.3",
|
|
50
50
|
"utility-types": "^3.11.0",
|
|
51
|
-
"@scayle/storefront-api": "18.
|
|
51
|
+
"@scayle/storefront-api": "18.20.0",
|
|
52
52
|
"@scayle/unstorage-scayle-kv-driver": "2.0.9"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/crypto-js": "4.2.2",
|
|
56
|
-
"@types/node": "22.19.
|
|
56
|
+
"@types/node": "22.19.3",
|
|
57
57
|
"@types/webpack-env": "1.18.8",
|
|
58
|
-
"@vitest/coverage-v8": "4.0.
|
|
58
|
+
"@vitest/coverage-v8": "4.0.15",
|
|
59
59
|
"dprint": "0.50.2",
|
|
60
|
-
"eslint-formatter-gitlab": "7.0.
|
|
61
|
-
"eslint": "9.39.
|
|
62
|
-
"fishery": "2.
|
|
63
|
-
"publint": "0.3.
|
|
60
|
+
"eslint-formatter-gitlab": "7.0.1",
|
|
61
|
+
"eslint": "9.39.2",
|
|
62
|
+
"fishery": "2.4.0",
|
|
63
|
+
"publint": "0.3.16",
|
|
64
64
|
"rimraf": "6.1.2",
|
|
65
65
|
"typescript": "5.9.3",
|
|
66
66
|
"unbuild": "3.6.1",
|
|
67
67
|
"unstorage": "1.17.3",
|
|
68
|
-
"vitest": "4.0.
|
|
69
|
-
"@scayle/
|
|
70
|
-
"@scayle/
|
|
68
|
+
"vitest": "4.0.15",
|
|
69
|
+
"@scayle/eslint-config-storefront": "4.7.17",
|
|
70
|
+
"@scayle/vitest-config-storefront": "1.0.0"
|
|
71
71
|
},
|
|
72
72
|
"volta": {
|
|
73
73
|
"node": "22.21.1"
|