@scayle/storefront-core 8.48.1 → 8.49.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,30 @@
1
1
  # @scayle/storefront-core
2
2
 
3
+ ## 8.49.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Exported the `sha256` utility function as part of the public API.
8
+
9
+ This function provides a convenient way to calculate SHA256 hashes of strings using the Web Crypto API, returning hexadecimal strings.
10
+ Developers can now use this utility directly instead of implementing their own hashing logic or importing external cryptographic libraries.
11
+
12
+ Example:
13
+
14
+ ```ts
15
+ import { sha256 } from '@scayle/storefront-core'
16
+
17
+ const hash = await sha256('hello')
18
+ console.log(hash) // '2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824'
19
+ ```
20
+
21
+ ### Patch Changes
22
+
23
+ **Dependencies**
24
+
25
+ - Updated dependency to @scayle/storefront-api@18.18.1
26
+ - Updated dependency to @scayle/unstorage-scayle-kv-driver@2.0.7
27
+
3
28
  ## 8.48.1
4
29
 
5
30
  ### Patch Changes
@@ -37,7 +37,7 @@ export const getCheckoutToken = defineRpcHandler(async (jwtPayload = {}, context
37
37
  ...customData,
38
38
  ...orderCustomData
39
39
  }
40
- }).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.48.1"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
40
+ }).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.49.0"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
41
41
  return {
42
42
  accessToken: refreshedAccessToken,
43
43
  checkoutJwt
@@ -6,3 +6,4 @@ export * from './campaign';
6
6
  export { unwrap } from './response';
7
7
  export { generateBasketKey, generateWishlistKey } from './keys';
8
8
  export { defineRpcHandler } from './rpc';
9
+ export { sha256 } from './hash';
@@ -6,3 +6,4 @@ export * from "./campaign.mjs";
6
6
  export { unwrap } from "./response.mjs";
7
7
  export { generateBasketKey, generateWishlistKey } from "./keys.mjs";
8
8
  export { defineRpcHandler } from "./rpc.mjs";
9
+ export { sha256 } from "./hash.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-core",
3
- "version": "8.48.1",
3
+ "version": "8.49.0",
4
4
  "description": "Collection of essential utilities to work with the Storefront API",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",
@@ -53,12 +53,12 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/crypto-js": "4.2.2",
56
- "@types/node": "22.18.13",
56
+ "@types/node": "22.19.0",
57
57
  "@types/webpack-env": "1.18.8",
58
58
  "@vitest/coverage-v8": "3.2.4",
59
59
  "dprint": "0.50.2",
60
60
  "eslint-formatter-gitlab": "6.0.1",
61
- "eslint": "9.38.0",
61
+ "eslint": "9.39.1",
62
62
  "fishery": "2.3.1",
63
63
  "publint": "0.3.15",
64
64
  "rimraf": "6.1.0",
@@ -66,11 +66,11 @@
66
66
  "unbuild": "3.6.1",
67
67
  "unstorage": "1.17.1",
68
68
  "vitest": "3.2.4",
69
- "@scayle/eslint-config-storefront": "4.7.11",
69
+ "@scayle/eslint-config-storefront": "4.7.12",
70
70
  "@scayle/vitest-config-storefront": "1.0.0"
71
71
  },
72
72
  "volta": {
73
- "node": "22.21.0"
73
+ "node": "22.21.1"
74
74
  },
75
75
  "scripts": {
76
76
  "clean": "rimraf ./dist",