@scayle/storefront-core 7.48.1 → 7.48.2

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,11 @@
1
1
  # @scayle/storefront-core
2
2
 
3
+ ## 7.48.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixes an issue where the `refreshToken` was not exposed on the `RPCContext` even if the user is logged in.
8
+
3
9
  ## 7.48.1
4
10
 
5
11
  ### Patch Changes
@@ -17,23 +17,25 @@ export type WithParams = Partial<{
17
17
  export interface RuntimeConfiguration {
18
18
  [key: string]: any;
19
19
  }
20
- interface ContextWithSession {
20
+ export interface ContextWithSession {
21
21
  wishlistKey: string;
22
22
  basketKey: string;
23
23
  sessionId: string;
24
- user?: ShopUser;
25
- accessToken?: string;
24
+ user: ShopUser | undefined;
25
+ accessToken: string | undefined;
26
+ refreshToken: string | undefined;
26
27
  destroySession: () => Promise<void>;
27
28
  createUserBoundSession: () => Promise<void>;
28
29
  updateUser: (user: ShopUser) => void;
29
30
  updateTokens: (tokens: OAuthTokens) => void;
30
31
  }
31
- interface ContextNoSession {
32
+ export interface ContextWithoutSession {
32
33
  wishlistKey: undefined;
33
34
  basketKey: undefined;
34
35
  sessionId: undefined;
35
36
  user: undefined;
36
37
  accessToken: undefined;
38
+ refreshToken: undefined;
37
39
  destroySession: undefined;
38
40
  createUserBoundSession: undefined;
39
41
  updateUser: undefined;
@@ -54,7 +56,6 @@ export type RpcContext = {
54
56
  };
55
57
  bapiClient: BapiClient;
56
58
  cached: CachedType;
57
- refreshToken?: string;
58
59
  isCmsPreview: boolean;
59
60
  shopId: number;
60
61
  domain: string;
@@ -78,9 +79,6 @@ export type RpcContext = {
78
79
  runtimeConfiguration: RuntimeConfiguration;
79
80
  idp?: IDPConfig;
80
81
  headers: Headers;
81
- } & (ContextNoSession | ContextWithSession);
82
- export type RpcContextWithSession = RpcContext & {
83
- sessionId: string;
84
- };
82
+ } & (ContextWithoutSession | ContextWithSession);
83
+ export type RpcContextWithSession = RpcContext & ContextWithSession;
85
84
  export declare function assertSession(context: RpcContext): asserts context is RpcContextWithSession;
86
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-core",
3
- "version": "7.48.1",
3
+ "version": "7.48.2",
4
4
  "description": "Collection of essential utilities to work with the Storefront API",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",
@@ -73,7 +73,7 @@
73
73
  "@types/crypto-js": "4.2.2",
74
74
  "@types/node": "20.12.7",
75
75
  "@types/webpack-env": "1.18.4",
76
- "@vitest/coverage-v8": "1.4.0",
76
+ "@vitest/coverage-v8": "1.5.0",
77
77
  "dprint": "0.45.1",
78
78
  "eslint": "8.57.0",
79
79
  "eslint-formatter-gitlab": "5.1.0",
@@ -83,7 +83,7 @@
83
83
  "typescript": "5.4.5",
84
84
  "unbuild": "2.0.0",
85
85
  "unstorage": "1.10.2",
86
- "vitest": "1.4.0"
86
+ "vitest": "1.5.0"
87
87
  },
88
88
  "optionalDependencies": {
89
89
  "redis": "4"