@scayle/storefront-core 8.30.2 → 8.31.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,35 @@
1
1
  # @scayle/storefront-core
2
2
 
3
+ ## 8.31.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Added `minReduction` and `maxReduction` filter parameters to `FetchProductsByCategoryParams.where` and `FetchFiltersParams.where` types, and updated the `getProductsByCategory` and `getFilters` RPC methods to accept and handle these new reduction-based filtering conditions.
8
+
9
+ ```ts
10
+ const { data } = useRpc('getFilters', 'getFiltersKey', () => ({
11
+ where: {
12
+ minReduction: 10,
13
+ maxReduction: 20,
14
+ },
15
+ }))
16
+
17
+ const { data } = useRpc(
18
+ 'getProductsByCategory',
19
+ 'getProductsByCategoryKey',
20
+ () => ({
21
+ where: {
22
+ minReduction: 10,
23
+ maxReduction: 20,
24
+ },
25
+ }),
26
+ )
27
+ ```
28
+
29
+ ## 8.30.3
30
+
31
+ No changes in this release.
32
+
3
33
  ## 8.30.2
4
34
 
5
35
  ### Patch Changes
@@ -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.30.2"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
39
+ }).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.31.0"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
40
40
  return {
41
41
  accessToken: refreshedAccessToken,
42
42
  checkoutJwt
@@ -129,6 +129,8 @@ export declare const fetchAllFiltersForCategory: RpcHandler<{
129
129
  * @param params.where The where clause for filtering.
130
130
  * @param params.where.minPrice Minimum price.
131
131
  * @param params.where.maxPrice Maximum price.
132
+ * @param params.where.minReduction Minimum reduction.
133
+ * @param params.where.maxReduction Maximum reduction.
132
134
  * @param params.where.term Search term.
133
135
  * @param params.where.attributes Attributes for filtering.
134
136
  * @param params.where.whitelistAttributes Whitelisted attributes.
@@ -158,6 +160,8 @@ export declare const getFilters: RpcHandler<FetchFiltersParams, FetchFiltersResp
158
160
  * @param params.where The where clause for filtering.
159
161
  * @param params.where.minPrice Minimum price.
160
162
  * @param params.where.maxPrice Maximum price.
163
+ * @param params.where.minReduction Minimum reduction.
164
+ * @param params.where.maxReduction Maximum reduction.
161
165
  * @param params.where.term Search term.
162
166
  * @param params.where.attributes Attributes for filtering.
163
167
  * @param params.where.whitelistAttributes Whitelisted attributes.
@@ -193,6 +193,8 @@ export const getFilters = async function getFilters2(params, context) {
193
193
  categoryId,
194
194
  minPrice: where?.minPrice,
195
195
  maxPrice: where?.maxPrice,
196
+ minReduction: where?.minReduction,
197
+ maxReduction: where?.maxReduction,
196
198
  term: where?.term,
197
199
  attributes: [
198
200
  ...sanitizedAttributes,
@@ -277,6 +279,8 @@ export const getProductsByCategory = async function getProductsByCategory2(param
277
279
  categoryId,
278
280
  minPrice: where?.minPrice,
279
281
  maxPrice: where?.maxPrice,
282
+ minReduction: where?.minReduction,
283
+ maxReduction: where?.maxReduction,
280
284
  term: where?.term,
281
285
  attributes: [
282
286
  ...sanitizedAttributes,
@@ -38,6 +38,10 @@ export type FetchFiltersParams = {
38
38
  minPrice?: ProductSearchQuery['minPrice'];
39
39
  /** The maximum price. */
40
40
  maxPrice?: ProductSearchQuery['maxPrice'];
41
+ /** The minimum reduction. */
42
+ minReduction?: ProductSearchQuery['minReduction'];
43
+ /** The maximum reduction. */
44
+ maxReduction?: ProductSearchQuery['maxReduction'];
41
45
  /** The attributes filter. */
42
46
  attributes?: ProductSearchQuery['attributes'];
43
47
  /** wether to disable fuzziness on term */
@@ -105,6 +105,8 @@ export type FetchProductsByCategoryParams = {
105
105
  term?: ProductSearchQuery['term'];
106
106
  minPrice?: ProductSearchQuery['minPrice'];
107
107
  maxPrice?: ProductSearchQuery['maxPrice'];
108
+ minReduction?: ProductSearchQuery['minReduction'];
109
+ maxReduction?: ProductSearchQuery['maxReduction'];
108
110
  attributes?: ProductSearchQuery['attributes'];
109
111
  disableFuzziness?: ProductSearchQuery['disableFuzziness'];
110
112
  whitelistAttributes?: ProductSearchQuery['attributes'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-core",
3
- "version": "8.30.2",
3
+ "version": "8.31.0",
4
4
  "description": "Collection of essential utilities to work with the Storefront API",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",
@@ -45,21 +45,6 @@
45
45
  "engines": {
46
46
  "node": ">= 18.15.0"
47
47
  },
48
- "scripts": {
49
- "clean": "rimraf ./dist",
50
- "build:legacy": "tsc -p tsconfig.legacy.json",
51
- "build": "unbuild",
52
- "typecheck": "tsc --noEmit -p tsconfig.json",
53
- "format": "dprint check",
54
- "format:fix": "dprint fmt",
55
- "lint": "eslint .",
56
- "lint:ci": "eslint . --format gitlab",
57
- "lint:fix": "eslint . --fix",
58
- "package:lint": "publint",
59
- "test:watch": "vitest",
60
- "test": "vitest --run",
61
- "test:ci": "vitest --run --coverage --reporter=default --reporter=junit --outputFile=./coverage/junit.xml"
62
- },
63
48
  "peerDependencies": {
64
49
  "fishery": "^2.2.3"
65
50
  },
@@ -75,16 +60,16 @@
75
60
  "utility-types": "^3.11.0"
76
61
  },
77
62
  "devDependencies": {
78
- "@scayle/eslint-config-storefront": "4.5.9",
63
+ "@scayle/eslint-config-storefront": "4.5.11",
79
64
  "@types/crypto-js": "4.2.2",
80
- "@types/node": "22.15.32",
65
+ "@types/node": "22.15.33",
81
66
  "@types/webpack-env": "1.18.8",
82
67
  "@vitest/coverage-v8": "3.2.4",
83
68
  "dprint": "0.50.0",
84
69
  "eslint-formatter-gitlab": "6.0.1",
85
70
  "eslint": "9.29.0",
86
71
  "fishery": "2.3.1",
87
- "publint": "0.2.12",
72
+ "publint": "0.3.12",
88
73
  "rimraf": "6.0.1",
89
74
  "typescript": "5.8.3",
90
75
  "unbuild": "3.5.0",
@@ -93,5 +78,20 @@
93
78
  },
94
79
  "volta": {
95
80
  "node": "22.16.0"
81
+ },
82
+ "scripts": {
83
+ "clean": "rimraf ./dist",
84
+ "build:legacy": "tsc -p tsconfig.legacy.json",
85
+ "build": "unbuild",
86
+ "typecheck": "tsc --noEmit -p tsconfig.json",
87
+ "format": "dprint check",
88
+ "format:fix": "dprint fmt",
89
+ "lint": "eslint .",
90
+ "lint:ci": "eslint . --format gitlab",
91
+ "lint:fix": "eslint . --fix",
92
+ "package:lint": "publint",
93
+ "test:watch": "vitest",
94
+ "test": "vitest --run",
95
+ "test:ci": "vitest --run --coverage --reporter=default --reporter=junit --outputFile=./coverage/junit.xml"
96
96
  }
97
- }
97
+ }