@scayle/storefront-core 7.39.0 → 7.40.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,17 @@
1
1
  # @scayle/storefront-core
2
2
 
3
+ ## 7.40.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Export Campaign types from @aboutyou/backbone
8
+
9
+ ## 7.39.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Persist accessToken to user.authentication
14
+
3
15
  ## 7.39.0
4
16
 
5
17
  ### Minor Changes
@@ -172,8 +184,8 @@
172
184
 
173
185
  ### Minor Changes
174
186
 
175
- - - Add `promotion` RPC methods and types
176
- - - Add promotion data within the basket payloads
187
+ - Add `promotion` RPC methods and types
188
+ - Add promotion data within the basket payloads
177
189
 
178
190
  ### Patch Changes
179
191
 
@@ -381,9 +393,9 @@
381
393
 
382
394
  ### Minor Changes
383
395
 
384
- - - Replaced `enums` with the companion object pattern approach.
385
- - - Replaced `HttpStatusMessage` number values with the actual message
386
- - - Exposed `HashAlgorithm` constant with its type and move it to the core
396
+ - Replaced `enums` with the companion object pattern approach.
397
+ - Replaced `HttpStatusMessage` number values with the actual message
398
+ - Exposed `HashAlgorithm` constant with its type and move it to the core
387
399
  - **Breaking:** If you are importing `HashAlgorithm` from `@scayle/storefront-nuxt2` change to importing it from `@scayle/storefront-core`
388
400
 
389
401
  ## 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.storefrontAccessToken = accessToken;
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.storefrontAccessToken = accessToken;
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
- ...{ loginShopId: shopId }
34
+ loginShopId: shopId
32
35
  });
33
36
  return { user };
34
37
  } catch {
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ export type { Campaign } from '@aboutyou/backbone/types/campaign';
File without changes
@@ -91,6 +91,17 @@ Object.keys(_brand).forEach(function (key) {
91
91
  }
92
92
  });
93
93
  });
94
+ var _campaign = require("./bapi/campaign.cjs");
95
+ Object.keys(_campaign).forEach(function (key) {
96
+ if (key === "default" || key === "__esModule") return;
97
+ if (key in exports && exports[key] === _campaign[key]) return;
98
+ Object.defineProperty(exports, key, {
99
+ enumerable: true,
100
+ get: function () {
101
+ return _campaign[key];
102
+ }
103
+ });
104
+ });
94
105
  var _category = require("./bapi/category.cjs");
95
106
  Object.keys(_category).forEach(function (key) {
96
107
  if (key === "default" || key === "__esModule") return;
@@ -7,6 +7,7 @@ export * from './api/auth';
7
7
  export type { BapiClient } from '@aboutyou/backbone';
8
8
  export * from './bapi/basket';
9
9
  export * from './bapi/brand';
10
+ export * from './bapi/campaign';
10
11
  export * from './bapi/category';
11
12
  export * from './bapi/filter';
12
13
  export * from './bapi/navigation';
@@ -6,6 +6,7 @@ export * from "./api/context.mjs";
6
6
  export * from "./api/auth.mjs";
7
7
  export * from "./bapi/basket.mjs";
8
8
  export * from "./bapi/brand.mjs";
9
+ export * from "./bapi/campaign.mjs";
9
10
  export * from "./bapi/category.mjs";
10
11
  export * from "./bapi/filter.mjs";
11
12
  export * from "./bapi/navigation.mjs";
@@ -14,7 +14,7 @@ interface MemberRole {
14
14
  memberPriority: number;
15
15
  memberRoleSap: string;
16
16
  }
17
- type AuthenticationType = 'facebook' | 'password' | 'apple';
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.0",
3
+ "version": "7.40.0",
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": "prettier --ignore-unknown --log-level warn --check .",
53
- "format:fix": "prettier --ignore-unknown --log-level warn --write .",
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.0",
62
+ "@aboutyou/backbone": "16.1.1",
63
63
  "crypto-js": "4.2.0",
64
- "jose": "5.2.0",
64
+ "jose": "5.2.2",
65
65
  "radash": "11.0.0",
66
66
  "slugify": "1.6.6",
67
- "ufo": "1.3.2",
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.10",
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",