@scayle/storefront-core 8.61.0 → 8.61.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.
Files changed (33) hide show
  1. package/CHANGELOG-V7.md +1 -11
  2. package/CHANGELOG.md +100 -103
  3. package/dist/api/customer.mjs +1 -3
  4. package/dist/api/oauth.mjs +9 -6
  5. package/dist/cache/providers/unstorage.mjs +1 -3
  6. package/dist/constants/withParameters.mjs +2 -16
  7. package/dist/helpers/attributeHelpers.mjs +3 -1
  8. package/dist/helpers/filterHelper.mjs +11 -8
  9. package/dist/helpers/productHelpers.mjs +1 -3
  10. package/dist/helpers/sanitizationHelpers.mjs +1 -4
  11. package/dist/helpers/sortingHelper.mjs +1 -3
  12. package/dist/rpc/methods/basket/basket.d.ts +2 -2
  13. package/dist/rpc/methods/basket/basket.mjs +334 -321
  14. package/dist/rpc/methods/brands.mjs +26 -20
  15. package/dist/rpc/methods/campaign.mjs +32 -23
  16. package/dist/rpc/methods/categories.mjs +156 -135
  17. package/dist/rpc/methods/cbd.mjs +52 -49
  18. package/dist/rpc/methods/checkout/checkout.mjs +42 -39
  19. package/dist/rpc/methods/checkout/order.mjs +46 -40
  20. package/dist/rpc/methods/checkout/shopUser.mjs +112 -106
  21. package/dist/rpc/methods/navigationTrees.mjs +50 -32
  22. package/dist/rpc/methods/oauth/idp.mjs +64 -55
  23. package/dist/rpc/methods/products.mjs +224 -212
  24. package/dist/rpc/methods/promotion.mjs +46 -31
  25. package/dist/rpc/methods/search.mjs +26 -20
  26. package/dist/rpc/methods/session.mjs +289 -260
  27. package/dist/rpc/methods/shopConfiguration.mjs +12 -9
  28. package/dist/rpc/methods/user.mjs +87 -78
  29. package/dist/rpc/methods/variants.mjs +17 -14
  30. package/dist/rpc/methods/wishlist.mjs +71 -62
  31. package/dist/utils/hash.mjs +2 -7
  32. package/dist/utils/sapi.mjs +10 -7
  33. package/package.json +4 -4
@@ -33,52 +33,61 @@ export async function resolveCategoryIdFromParams(context, params) {
33
33
  }
34
34
  return { category, categoryId };
35
35
  }
36
- export const getProductById = defineRpcHandler(async (options, context) => {
37
- const { sapiClient, cached, withParams } = context;
38
- const campaignKey = await context.callRpc?.("getCampaignKey");
39
- return await cached(
40
- mapSAPIFetchErrorToResponse(sapiClient.products.getById),
41
- {
42
- cacheKeyPrefix: `getById-product-${options.id}`,
43
- ttl: 5 * MINUTE
44
- }
45
- )(options.id, {
46
- with: options.with ?? withParams?.product ?? MIN_WITH_PARAMS_PRODUCT,
47
- campaignKey,
48
- pricePromotionKey: options.pricePromotionKey,
49
- includeSellableForFree: options.includeSellableForFree
50
- });
51
- }, { method: "GET" });
52
- export const getProductsByIds = defineRpcHandler(async (options, context) => {
53
- const { sapiClient, cached, withParams } = context;
54
- const campaignKey = await context.callRpc?.("getCampaignKey");
55
- return await cached(
56
- mapSAPIFetchErrorToResponse(sapiClient.products.getByIds),
57
- {
58
- cacheKeyPrefix: "getByIds-products",
59
- ttl: 5 * MINUTE
60
- }
61
- )(options.ids, {
62
- with: options.with ?? withParams?.product ?? MIN_WITH_PARAMS_PRODUCT,
63
- campaignKey,
64
- pricePromotionKey: options.pricePromotionKey
65
- });
66
- }, { method: "GET" });
67
- export const getProductsByReferenceKeys = defineRpcHandler(async (options, context) => {
68
- const { sapiClient, cached, withParams } = context;
69
- const campaignKey = await context.callRpc?.("getCampaignKey");
70
- return await cached(
71
- mapSAPIFetchErrorToResponse(sapiClient.products.getByReferenceKeys),
72
- {
73
- cacheKeyPrefix: "getByReferenceKeys-products",
74
- ttl: 5 * MINUTE
75
- }
76
- )(options.referenceKeys, {
77
- with: options.with ?? withParams?.product ?? MIN_WITH_PARAMS_PRODUCT,
78
- campaignKey,
79
- pricePromotionKey: options.pricePromotionKey
80
- });
81
- }, { method: "GET" });
36
+ export const getProductById = defineRpcHandler(
37
+ async (options, context) => {
38
+ const { sapiClient, cached, withParams } = context;
39
+ const campaignKey = await context.callRpc?.("getCampaignKey");
40
+ return await cached(
41
+ mapSAPIFetchErrorToResponse(sapiClient.products.getById),
42
+ {
43
+ cacheKeyPrefix: `getById-product-${options.id}`,
44
+ ttl: 5 * MINUTE
45
+ }
46
+ )(options.id, {
47
+ with: options.with ?? withParams?.product ?? MIN_WITH_PARAMS_PRODUCT,
48
+ campaignKey,
49
+ pricePromotionKey: options.pricePromotionKey,
50
+ includeSellableForFree: options.includeSellableForFree
51
+ });
52
+ },
53
+ { method: "GET" }
54
+ );
55
+ export const getProductsByIds = defineRpcHandler(
56
+ async (options, context) => {
57
+ const { sapiClient, cached, withParams } = context;
58
+ const campaignKey = await context.callRpc?.("getCampaignKey");
59
+ return await cached(
60
+ mapSAPIFetchErrorToResponse(sapiClient.products.getByIds),
61
+ {
62
+ cacheKeyPrefix: "getByIds-products",
63
+ ttl: 5 * MINUTE
64
+ }
65
+ )(options.ids, {
66
+ with: options.with ?? withParams?.product ?? MIN_WITH_PARAMS_PRODUCT,
67
+ campaignKey,
68
+ pricePromotionKey: options.pricePromotionKey
69
+ });
70
+ },
71
+ { method: "GET" }
72
+ );
73
+ export const getProductsByReferenceKeys = defineRpcHandler(
74
+ async (options, context) => {
75
+ const { sapiClient, cached, withParams } = context;
76
+ const campaignKey = await context.callRpc?.("getCampaignKey");
77
+ return await cached(
78
+ mapSAPIFetchErrorToResponse(sapiClient.products.getByReferenceKeys),
79
+ {
80
+ cacheKeyPrefix: "getByReferenceKeys-products",
81
+ ttl: 5 * MINUTE
82
+ }
83
+ )(options.referenceKeys, {
84
+ with: options.with ?? withParams?.product ?? MIN_WITH_PARAMS_PRODUCT,
85
+ campaignKey,
86
+ pricePromotionKey: options.pricePromotionKey
87
+ });
88
+ },
89
+ { method: "GET" }
90
+ );
82
91
  export const getProductsCount = defineRpcHandler(
83
92
  async (params, context) => {
84
93
  const {
@@ -112,10 +121,7 @@ export const getProductsCount = defineRpcHandler(
112
121
  where: {
113
122
  ...filter,
114
123
  categoryId,
115
- attributes: [
116
- ...sanitizedAttributes,
117
- ...whitelistAttributes || []
118
- ]
124
+ attributes: [...sanitizedAttributes, ...whitelistAttributes || []]
119
125
  },
120
126
  pagination: {
121
127
  perPage: 1
@@ -131,32 +137,35 @@ export const getProductsCount = defineRpcHandler(
131
137
  },
132
138
  { method: "GET" }
133
139
  );
134
- export const fetchAllFiltersForCategory = defineRpcHandler(async ({
135
- includedFilters = [],
136
- category,
137
- includeSoldOut,
138
- includeSellableForFree,
139
- orFiltersOperator
140
- }, context) => {
141
- const { cached, sapiClient } = context;
142
- const campaignKey = await context.callRpc?.("getCampaignKey");
143
- const fetchAndMapFiltersToSlugs = async () => {
144
- const filtersFromSAPI = await cached(sapiClient.filters.get)({
145
- where: { categoryId: category.id },
146
- campaignKey,
147
- including: includedFilters,
148
- includeSoldOut,
149
- includeSellableForFree,
150
- orFiltersOperator
151
- });
152
- return mapFiltersToSlugs(filtersFromSAPI);
153
- };
154
- return await cached(fetchAndMapFiltersToSlugs, {
155
- ttl: 4 * 60 * 60,
156
- // cached for 4 hours
157
- cacheKey: `filters-for-category-${category.id}`
158
- })();
159
- }, { method: "GET" });
140
+ export const fetchAllFiltersForCategory = defineRpcHandler(
141
+ async ({
142
+ includedFilters = [],
143
+ category,
144
+ includeSoldOut,
145
+ includeSellableForFree,
146
+ orFiltersOperator
147
+ }, context) => {
148
+ const { cached, sapiClient } = context;
149
+ const campaignKey = await context.callRpc?.("getCampaignKey");
150
+ const fetchAndMapFiltersToSlugs = async () => {
151
+ const filtersFromSAPI = await cached(sapiClient.filters.get)({
152
+ where: { categoryId: category.id },
153
+ campaignKey,
154
+ including: includedFilters,
155
+ includeSoldOut,
156
+ includeSellableForFree,
157
+ orFiltersOperator
158
+ });
159
+ return mapFiltersToSlugs(filtersFromSAPI);
160
+ };
161
+ return await cached(fetchAndMapFiltersToSlugs, {
162
+ ttl: 4 * 60 * 60,
163
+ // cached for 4 hours
164
+ cacheKey: `filters-for-category-${category.id}`
165
+ })();
166
+ },
167
+ { method: "GET" }
168
+ );
160
169
  async function getSanitizedAttributes(context, categoryId, attributes, includedFilters, includeSoldOut, includeSellableForFree, orFiltersOperator) {
161
170
  const response = await fetchAllFiltersForCategory(
162
171
  {
@@ -178,151 +187,154 @@ async function getSanitizedAttributes(context, categoryId, attributes, includedF
178
187
  includedFilters
179
188
  });
180
189
  }
181
- export const getFilters = defineRpcHandler(async (params, context) => {
182
- const {
183
- includedFilters,
184
- where = void 0,
185
- includeSoldOut = false,
186
- includeSellableForFree = false,
187
- orFiltersOperator
188
- } = params;
189
- const { cached, sapiClient } = context;
190
- const campaignKey = await context.callRpc?.("getCampaignKey");
191
- const { category, categoryId } = await resolveCategoryIdFromParams(
192
- context,
193
- params
194
- );
195
- const { attributes, whitelistAttributes, ...filter } = where || {};
196
- const response = await getSanitizedAttributes(
197
- context,
198
- categoryId,
199
- attributes || [],
200
- includedFilters,
201
- includeSoldOut,
202
- includeSellableForFree,
203
- orFiltersOperator
204
- );
205
- if (response instanceof ErrorResponse) {
206
- return response;
207
- }
208
- const sanitizedAttributes = response;
209
- const [filters, productCount] = await Promise.all([
210
- cached(sapiClient.filters.get, {
211
- cacheKeyPrefix: `get-filters-${categoryId}`
212
- })({
213
- where: {
214
- ...filter,
215
- categoryId,
216
- attributes: [
217
- ...sanitizedAttributes,
218
- ...whitelistAttributes || []
219
- ]
220
- },
190
+ export const getFilters = defineRpcHandler(
191
+ async (params, context) => {
192
+ const {
193
+ includedFilters,
194
+ where = void 0,
195
+ includeSoldOut = false,
196
+ includeSellableForFree = false,
197
+ orFiltersOperator
198
+ } = params;
199
+ const { cached, sapiClient } = context;
200
+ const campaignKey = await context.callRpc?.("getCampaignKey");
201
+ const { category, categoryId } = await resolveCategoryIdFromParams(
202
+ context,
203
+ params
204
+ );
205
+ const { attributes, whitelistAttributes, ...filter } = where || {};
206
+ const response = await getSanitizedAttributes(
207
+ context,
208
+ categoryId,
209
+ attributes || [],
210
+ includedFilters,
221
211
  includeSoldOut,
222
212
  includeSellableForFree,
223
- campaignKey,
224
- including: includedFilters,
225
213
  orFiltersOperator
226
- }),
227
- cached(sapiClient.products.query, {
228
- ttl: 15 * MINUTE,
229
- cacheKeyPrefix: `products-query-category-${category === "/" ? "root" : categoryId}`
230
- })({
214
+ );
215
+ if (response instanceof ErrorResponse) {
216
+ return response;
217
+ }
218
+ const sanitizedAttributes = response;
219
+ const [filters, productCount] = await Promise.all([
220
+ cached(sapiClient.filters.get, {
221
+ cacheKeyPrefix: `get-filters-${categoryId}`
222
+ })({
223
+ where: {
224
+ ...filter,
225
+ categoryId,
226
+ attributes: [
227
+ ...sanitizedAttributes,
228
+ ...whitelistAttributes || []
229
+ ]
230
+ },
231
+ includeSoldOut,
232
+ includeSellableForFree,
233
+ campaignKey,
234
+ including: includedFilters,
235
+ orFiltersOperator
236
+ }),
237
+ cached(sapiClient.products.query, {
238
+ ttl: 15 * MINUTE,
239
+ cacheKeyPrefix: `products-query-category-${category === "/" ? "root" : categoryId}`
240
+ })({
241
+ where: {
242
+ ...filter,
243
+ categoryId,
244
+ attributes: [
245
+ ...sanitizedAttributes,
246
+ ...whitelistAttributes || []
247
+ ]
248
+ },
249
+ pagination: {
250
+ perPage: 1
251
+ },
252
+ campaignKey,
253
+ includeSellableForFree,
254
+ includeSoldOut,
255
+ orFiltersOperator
256
+ })
257
+ ]);
258
+ return {
259
+ filters,
260
+ unfilteredCount: productCount?.pagination.total
261
+ };
262
+ },
263
+ { method: "GET" }
264
+ );
265
+ export const getProductsByCategory = defineRpcHandler(
266
+ async (params, context) => {
267
+ const {
268
+ includedFilters,
269
+ cache,
270
+ with: _with,
271
+ perPage = 20,
272
+ page = 1,
273
+ where = void 0,
274
+ sort = void 0,
275
+ pricePromotionKey = "",
276
+ includeSellableForFree = void 0,
277
+ includeSoldOut = void 0,
278
+ orFiltersOperator = void 0,
279
+ trackSearchAnalyticsEvent = void 0
280
+ } = params;
281
+ const { cached, sapiClient } = context;
282
+ const campaignKey = await context.callRpc?.("getCampaignKey");
283
+ const { category, categoryId } = await resolveCategoryIdFromParams(
284
+ context,
285
+ params
286
+ );
287
+ const { attributes, whitelistAttributes, ...filter } = where || {};
288
+ const response = await getSanitizedAttributes(
289
+ context,
290
+ categoryId,
291
+ attributes || [],
292
+ includedFilters,
293
+ includeSoldOut,
294
+ includeSellableForFree,
295
+ orFiltersOperator
296
+ );
297
+ if (response instanceof ErrorResponse) {
298
+ return response;
299
+ }
300
+ const sanitizedAttributes = response;
301
+ const { entities: products, pagination } = await cached(
302
+ sapiClient.products.query,
303
+ {
304
+ ...cache,
305
+ ttl: cache?.ttl ?? 15 * MINUTE,
306
+ cacheKeyPrefix: cache?.cacheKeyPrefix || `products-query-category-${category === "/" ? "root" : categoryId}`
307
+ }
308
+ )({
231
309
  where: {
232
310
  ...filter,
233
311
  categoryId,
234
- attributes: [
235
- ...sanitizedAttributes,
236
- ...whitelistAttributes || []
237
- ]
312
+ attributes: [...sanitizedAttributes, ...whitelistAttributes || []]
238
313
  },
239
314
  pagination: {
240
- perPage: 1
315
+ perPage: Math.min(perPage, MAX_PER_PAGE),
316
+ page
241
317
  },
242
318
  campaignKey,
243
319
  includeSellableForFree,
244
320
  includeSoldOut,
245
- orFiltersOperator
246
- })
247
- ]);
248
- return {
249
- filters,
250
- unfilteredCount: productCount?.pagination.total
251
- };
252
- }, { method: "GET" });
253
- export const getProductsByCategory = defineRpcHandler(async (params, context) => {
254
- const {
255
- includedFilters,
256
- cache,
257
- with: _with,
258
- perPage = 20,
259
- page = 1,
260
- where = void 0,
261
- sort = void 0,
262
- pricePromotionKey = "",
263
- includeSellableForFree = void 0,
264
- includeSoldOut = void 0,
265
- orFiltersOperator = void 0,
266
- trackSearchAnalyticsEvent = void 0
267
- } = params;
268
- const { cached, sapiClient } = context;
269
- const campaignKey = await context.callRpc?.("getCampaignKey");
270
- const { category, categoryId } = await resolveCategoryIdFromParams(
271
- context,
272
- params
273
- );
274
- const { attributes, whitelistAttributes, ...filter } = where || {};
275
- const response = await getSanitizedAttributes(
276
- context,
277
- categoryId,
278
- attributes || [],
279
- includedFilters,
280
- includeSoldOut,
281
- includeSellableForFree,
282
- orFiltersOperator
283
- );
284
- if (response instanceof ErrorResponse) {
285
- return response;
286
- }
287
- const sanitizedAttributes = response;
288
- const { entities: products, pagination } = await cached(
289
- sapiClient.products.query,
290
- {
291
- ...cache,
292
- ttl: cache?.ttl ?? 15 * MINUTE,
293
- cacheKeyPrefix: cache?.cacheKeyPrefix || `products-query-category-${category === "/" ? "root" : categoryId}`
294
- }
295
- )({
296
- where: {
297
- ...filter,
298
- categoryId,
299
- attributes: [
300
- ...sanitizedAttributes,
301
- ...whitelistAttributes || []
302
- ]
303
- },
304
- pagination: {
305
- perPage: Math.min(perPage, MAX_PER_PAGE),
306
- page
307
- },
308
- campaignKey,
309
- includeSellableForFree,
310
- includeSoldOut,
311
- orFiltersOperator,
312
- pricePromotionKey,
313
- with: _with ?? context.withParams?.product ?? MIN_WITH_PARAMS_PRODUCT,
314
- sort,
315
- // NOTE: We only pass the parameter value through and don't implement a custom check.
316
- // The consuming project should not include trackSearchAnalyticsEvent parameter when paginating through
317
- // results with the page parameter, as this logs the search term on every page request.
318
- // Instead, log the term only once, when the search is first performed.
319
- // https://scayle.dev/en/core-documentation/the-basics/shops/search#scayle-search-analytics
320
- trackSearchAnalyticsEvent
321
- });
322
- return {
323
- products,
324
- pagination: {
325
- ...pagination
326
- }
327
- };
328
- }, { method: "GET" });
321
+ orFiltersOperator,
322
+ pricePromotionKey,
323
+ with: _with ?? context.withParams?.product ?? MIN_WITH_PARAMS_PRODUCT,
324
+ sort,
325
+ // NOTE: We only pass the parameter value through and don't implement a custom check.
326
+ // The consuming project should not include trackSearchAnalyticsEvent parameter when paginating through
327
+ // results with the page parameter, as this logs the search term on every page request.
328
+ // Instead, log the term only once, when the search is first performed.
329
+ // https://scayle.dev/en/core-documentation/the-basics/shops/search#scayle-search-analytics
330
+ trackSearchAnalyticsEvent
331
+ });
332
+ return {
333
+ products,
334
+ pagination: {
335
+ ...pagination
336
+ }
337
+ };
338
+ },
339
+ { method: "GET" }
340
+ );
@@ -10,34 +10,49 @@ const setPaginationDefault = (pagination) => {
10
10
  perPage: pagination?.perPage || PROMOTION_PER_PAGE_DEFAULT
11
11
  };
12
12
  };
13
- export const getPromotions = defineRpcHandler(async (params = {}, context) => {
14
- const { sapiClient, cached } = context;
15
- return await cached(mapSAPIFetchErrorToResponse(sapiClient.promotions.get), {
16
- cacheKeyPrefix: "getPromotions"
17
- })({
18
- ...params,
19
- pagination: setPaginationDefault(params.pagination)
20
- });
21
- }, { method: "GET" });
22
- export const getCurrentPromotions = defineRpcHandler(async (params = {}, context) => {
23
- const { sapiClient, cached } = context;
24
- const now = /* @__PURE__ */ new Date();
25
- now.setSeconds(0, 0);
26
- const activeAt = now.toISOString();
27
- return await cached(mapSAPIFetchErrorToResponse(sapiClient.promotions.get), {
28
- cacheKeyPrefix: "getPromotions"
29
- })({
30
- ...params,
31
- activeAt,
32
- pagination: setPaginationDefault(params.pagination)
33
- });
34
- }, { method: "GET" });
35
- export const getPromotionsByIds = defineRpcHandler(async (ids, context) => {
36
- const { sapiClient, cached } = context;
37
- return await cached(
38
- mapSAPIFetchErrorToResponse(sapiClient.promotions.getByIds),
39
- {
40
- cacheKeyPrefix: "getByIds-promotions"
41
- }
42
- )(ids);
43
- }, { method: "GET" });
13
+ export const getPromotions = defineRpcHandler(
14
+ async (params = {}, context) => {
15
+ const { sapiClient, cached } = context;
16
+ return await cached(
17
+ mapSAPIFetchErrorToResponse(sapiClient.promotions.get),
18
+ {
19
+ cacheKeyPrefix: "getPromotions"
20
+ }
21
+ )({
22
+ ...params,
23
+ pagination: setPaginationDefault(params.pagination)
24
+ });
25
+ },
26
+ { method: "GET" }
27
+ );
28
+ export const getCurrentPromotions = defineRpcHandler(
29
+ async (params = {}, context) => {
30
+ const { sapiClient, cached } = context;
31
+ const now = /* @__PURE__ */ new Date();
32
+ now.setSeconds(0, 0);
33
+ const activeAt = now.toISOString();
34
+ return await cached(
35
+ mapSAPIFetchErrorToResponse(sapiClient.promotions.get),
36
+ {
37
+ cacheKeyPrefix: "getPromotions"
38
+ }
39
+ )({
40
+ ...params,
41
+ activeAt,
42
+ pagination: setPaginationDefault(params.pagination)
43
+ });
44
+ },
45
+ { method: "GET" }
46
+ );
47
+ export const getPromotionsByIds = defineRpcHandler(
48
+ async (ids, context) => {
49
+ const { sapiClient, cached } = context;
50
+ return await cached(
51
+ mapSAPIFetchErrorToResponse(sapiClient.promotions.getByIds),
52
+ {
53
+ cacheKeyPrefix: "getByIds-promotions"
54
+ }
55
+ )(ids);
56
+ },
57
+ { method: "GET" }
58
+ );
@@ -1,25 +1,31 @@
1
1
  import { mapSAPIFetchErrorToResponse } from "../../utils/sapi.mjs";
2
2
  import { defineRpcHandler } from "../../utils/index.mjs";
3
- export const getSearchSuggestions = defineRpcHandler(async ({ term, with: _with, categoryId }, context) => {
4
- const { sapiClient, withParams } = context;
5
- return await mapSAPIFetchErrorToResponse(sapiClient.searchv2.suggestions)(
6
- term,
7
- {
3
+ export const getSearchSuggestions = defineRpcHandler(
4
+ async ({ term, with: _with, categoryId }, context) => {
5
+ const { sapiClient, withParams } = context;
6
+ return await mapSAPIFetchErrorToResponse(sapiClient.searchv2.suggestions)(
7
+ term,
8
+ {
9
+ categoryId,
10
+ with: _with ?? withParams?.searchV2
11
+ }
12
+ );
13
+ },
14
+ { method: "GET" }
15
+ );
16
+ export const resolveSearch = defineRpcHandler(
17
+ async ({ term, with: _with, categoryId }, context) => {
18
+ const { cached, sapiClient, withParams } = context;
19
+ const resolvedEntity = await cached(sapiClient.searchv2.resolve, {
20
+ cacheKeyPrefix: `resolve-${term}`
21
+ })(term, {
8
22
  categoryId,
9
23
  with: _with ?? withParams?.searchV2
24
+ });
25
+ if (!resolvedEntity) {
26
+ return null;
10
27
  }
11
- );
12
- }, { method: "GET" });
13
- export const resolveSearch = defineRpcHandler(async ({ term, with: _with, categoryId }, context) => {
14
- const { cached, sapiClient, withParams } = context;
15
- const resolvedEntity = await cached(sapiClient.searchv2.resolve, {
16
- cacheKeyPrefix: `resolve-${term}`
17
- })(term, {
18
- categoryId,
19
- with: _with ?? withParams?.searchV2
20
- });
21
- if (!resolvedEntity) {
22
- return null;
23
- }
24
- return resolvedEntity;
25
- }, { method: "GET" });
28
+ return resolvedEntity;
29
+ },
30
+ { method: "GET" }
31
+ );