@scayle/storefront-core 8.27.0 → 8.28.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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # @scayle/storefront-core
2
2
 
3
+ ## 8.28.1
4
+
5
+ No changes in this release.
6
+
7
+ ## 8.28.0
8
+
9
+ ### Minor Changes
10
+
11
+ - Introduced the `getCategoryTree` RPC for retrieving the complete category tree.
12
+
3
13
  ## 8.27.0
4
14
 
5
15
  ### Minor Changes
@@ -88,3 +88,8 @@ export declare const getCategoryById: RpcHandler<{
88
88
  includeHidden?: true;
89
89
  properties?: ProductCategoryPropertyWith;
90
90
  }, Category>;
91
+ export declare const getCategoryTree: RpcHandler<{
92
+ children?: number;
93
+ includeHidden?: true;
94
+ properties?: ProductCategoryPropertyWith;
95
+ }, Category[]>;
@@ -88,3 +88,12 @@ export const getCategoryById = async function getCategoryById2({ id, children =
88
88
  includeHidden
89
89
  });
90
90
  };
91
+ export const getCategoryTree = async function getCategoryTree2({ children, includeHidden, properties }, context) {
92
+ const { cached, sapiClient } = context;
93
+ return await cached(sapiClient.categories.getRoots, {
94
+ cacheKeyPrefix: "root-categories"
95
+ })({
96
+ with: { children, properties },
97
+ includeHidden
98
+ });
99
+ };
@@ -36,7 +36,7 @@ export const getCheckoutToken = async function getCheckoutToken2(jwtPayload = {}
36
36
  carrier,
37
37
  basketId: context.basketKey,
38
38
  campaignKey
39
- }).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.27.0"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
39
+ }).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.28.1"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
40
40
  return {
41
41
  accessToken: refreshedAccessToken,
42
42
  checkoutJwt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-core",
3
- "version": "8.27.0",
3
+ "version": "8.28.1",
4
4
  "description": "Collection of essential utilities to work with the Storefront API",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",
@@ -77,7 +77,7 @@
77
77
  "devDependencies": {
78
78
  "@scayle/eslint-config-storefront": "4.5.2",
79
79
  "@types/crypto-js": "4.2.2",
80
- "@types/node": "22.15.19",
80
+ "@types/node": "22.15.21",
81
81
  "@types/webpack-env": "1.18.8",
82
82
  "@vitest/coverage-v8": "3.1.4",
83
83
  "dprint": "0.50.0",
@@ -92,6 +92,6 @@
92
92
  "vitest": "3.1.4"
93
93
  },
94
94
  "volta": {
95
- "node": "22.15.1"
95
+ "node": "22.16.0"
96
96
  }
97
97
  }