@epcc-sdk/sdks-shopper 0.0.30 → 0.0.32
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/README.md +30 -2
- package/dist/client/@tanstack/react-query.gen.cjs +38 -0
- package/dist/client/@tanstack/react-query.gen.cjs.map +1 -1
- package/dist/client/@tanstack/react-query.gen.d.cts +44 -2
- package/dist/client/@tanstack/react-query.gen.d.ts +44 -2
- package/dist/client/@tanstack/react-query.gen.mjs +36 -0
- package/dist/client/@tanstack/react-query.gen.mjs.map +1 -1
- package/dist/client/index.d.cts +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/client/sdk.gen.cjs +100 -0
- package/dist/client/sdk.gen.cjs.map +1 -1
- package/dist/client/sdk.gen.d.cts +147 -90
- package/dist/client/sdk.gen.d.ts +147 -90
- package/dist/client/sdk.gen.mjs +98 -0
- package/dist/client/sdk.gen.mjs.map +1 -1
- package/dist/client/transformers.gen.cjs +18 -3
- package/dist/client/transformers.gen.cjs.map +1 -1
- package/dist/client/transformers.gen.d.cts +4 -2
- package/dist/client/transformers.gen.d.ts +4 -2
- package/dist/client/transformers.gen.mjs +16 -3
- package/dist/client/transformers.gen.mjs.map +1 -1
- package/dist/client/types.gen.cjs.map +1 -1
- package/dist/client/types.gen.d.cts +537 -139
- package/dist/client/types.gen.d.ts +537 -139
- package/dist/index.cjs +0 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.mjs +0 -1
- package/dist/index.mjs.map +1 -1
- package/dist/react-query.cjs +23 -0
- package/dist/react-query.cjs.map +1 -0
- package/dist/react-query.d.cts +4 -0
- package/dist/react-query.d.ts +4 -0
- package/dist/react-query.mjs +2 -0
- package/dist/react-query.mjs.map +1 -0
- package/dist/utils/extract-product-image.cjs.map +1 -1
- package/dist/utils/extract-product-image.d.cts +2 -2
- package/dist/utils/extract-product-image.d.ts +2 -2
- package/dist/utils/extract-product-image.mjs.map +1 -1
- package/package.json +11 -1
package/README.md
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
# @epcc-sdk/sdks-shopper SDK
|
|
2
2
|
|
|
3
|
-
Below you
|
|
3
|
+
Below you'll find instructions on how to install, set up, and use the client, along with a list of available operations.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## React Query Support
|
|
7
|
+
|
|
8
|
+
This SDK provides optional React Query hooks for React applications. To use them, you need to:
|
|
9
|
+
|
|
10
|
+
1. Install `@tanstack/react-query` as a peer dependency:
|
|
11
|
+
```bash
|
|
12
|
+
npm install @tanstack/react-query
|
|
13
|
+
# or
|
|
14
|
+
pnpm install @tanstack/react-query
|
|
15
|
+
# or
|
|
16
|
+
yarn add @tanstack/react-query
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
2. Import hooks from the `/react-query` subpath:
|
|
20
|
+
```ts
|
|
21
|
+
import { useGetByContextProduct } from "@epcc-sdk/sdks-shopper/react-query";
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Note**: If you're not using React or React Query, you can use the SDK without installing `@tanstack/react-query`. The main exports work independently.
|
|
25
|
+
|
|
4
26
|
|
|
5
27
|
## Features
|
|
6
28
|
|
|
@@ -12,6 +34,7 @@ Below you’ll find instructions on how to install, set up, and use the client,
|
|
|
12
34
|
|
|
13
35
|
---
|
|
14
36
|
|
|
37
|
+
|
|
15
38
|
## Installation
|
|
16
39
|
|
|
17
40
|
```bash
|
|
@@ -227,6 +250,8 @@ const product = await getByContextProduct({
|
|
|
227
250
|
|
|
228
251
|
- **`getByContextProduct`** (`GET /catalog/products/{product_id}`)
|
|
229
252
|
|
|
253
|
+
- **`getByContextAllRelatedProducts`** (`GET /catalog/products/{product_id}/relationships/{custom_relationship_slug}/products`)
|
|
254
|
+
|
|
230
255
|
- **`getByContextComponentProductIds`** (`GET /catalog/products/{product_id}/relationships/component_products`)
|
|
231
256
|
|
|
232
257
|
- **`getByContextChildProducts`** (`GET /catalog/products/{product_id}/relationships/children`)
|
|
@@ -285,6 +310,8 @@ const product = await getByContextProduct({
|
|
|
285
310
|
|
|
286
311
|
- **`getProduct`** (`GET /catalogs/{catalog_id}/releases/{release_id}/products/{product_id}`)
|
|
287
312
|
|
|
313
|
+
- **`getAllRelatedProducts`** (`GET /catalogs/{catalog_id}/releases/{release_id}/products/{product_id}/relationships/{custom_relationship_slug}/products`)
|
|
314
|
+
|
|
288
315
|
- **`getComponentProductIds`** (`GET /catalogs/{catalog_id}/releases/{release_id}/products/{product_id}/relationships/component_products`)
|
|
289
316
|
|
|
290
317
|
- **`getChildProducts`** (`GET /catalogs/{catalog_id}/releases/{release_id}/products/{product_id}/relationships/children`)
|
|
@@ -463,4 +490,5 @@ const product = await getByContextProduct({
|
|
|
463
490
|
|
|
464
491
|
|
|
465
492
|
|
|
466
|
-
|
|
493
|
+
|
|
494
|
+
---
|
|
@@ -105,6 +105,8 @@ __export(react_query_gen_exports, {
|
|
|
105
105
|
getAllNodesQueryKey: () => getAllNodesQueryKey,
|
|
106
106
|
getAllProductsOptions: () => getAllProductsOptions,
|
|
107
107
|
getAllProductsQueryKey: () => getAllProductsQueryKey,
|
|
108
|
+
getAllRelatedProductsOptions: () => getAllRelatedProductsOptions,
|
|
109
|
+
getAllRelatedProductsQueryKey: () => getAllRelatedProductsQueryKey,
|
|
108
110
|
getAnOrderOptions: () => getAnOrderOptions,
|
|
109
111
|
getAnOrderQueryKey: () => getAnOrderQueryKey,
|
|
110
112
|
getByContextAllHierarchiesOptions: () => getByContextAllHierarchiesOptions,
|
|
@@ -113,6 +115,8 @@ __export(react_query_gen_exports, {
|
|
|
113
115
|
getByContextAllNodesQueryKey: () => getByContextAllNodesQueryKey,
|
|
114
116
|
getByContextAllProductsOptions: () => getByContextAllProductsOptions,
|
|
115
117
|
getByContextAllProductsQueryKey: () => getByContextAllProductsQueryKey,
|
|
118
|
+
getByContextAllRelatedProductsOptions: () => getByContextAllRelatedProductsOptions,
|
|
119
|
+
getByContextAllRelatedProductsQueryKey: () => getByContextAllRelatedProductsQueryKey,
|
|
116
120
|
getByContextChildNodesOptions: () => getByContextChildNodesOptions,
|
|
117
121
|
getByContextChildNodesQueryKey: () => getByContextChildNodesQueryKey,
|
|
118
122
|
getByContextChildProductsOptions: () => getByContextChildProductsOptions,
|
|
@@ -445,6 +449,21 @@ const getByContextProductOptions = (options) => {
|
|
|
445
449
|
queryKey: getByContextProductQueryKey(options)
|
|
446
450
|
});
|
|
447
451
|
};
|
|
452
|
+
const getByContextAllRelatedProductsQueryKey = (options) => [createQueryKey("getByContextAllRelatedProducts", options)];
|
|
453
|
+
const getByContextAllRelatedProductsOptions = (options) => {
|
|
454
|
+
return (0, import_react_query.queryOptions)({
|
|
455
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
456
|
+
const { data } = await (0, import_sdk.getByContextAllRelatedProducts)({
|
|
457
|
+
...options,
|
|
458
|
+
...queryKey[0],
|
|
459
|
+
signal,
|
|
460
|
+
throwOnError: true
|
|
461
|
+
});
|
|
462
|
+
return data;
|
|
463
|
+
},
|
|
464
|
+
queryKey: getByContextAllRelatedProductsQueryKey(options)
|
|
465
|
+
});
|
|
466
|
+
};
|
|
448
467
|
const getByContextComponentProductIdsQueryKey = (options) => [createQueryKey("getByContextComponentProductIds", options)];
|
|
449
468
|
const getByContextComponentProductIdsOptions = (options) => {
|
|
450
469
|
return (0, import_react_query.queryOptions)({
|
|
@@ -942,6 +961,21 @@ const getProductOptions = (options) => {
|
|
|
942
961
|
queryKey: getProductQueryKey(options)
|
|
943
962
|
});
|
|
944
963
|
};
|
|
964
|
+
const getAllRelatedProductsQueryKey = (options) => [createQueryKey("getAllRelatedProducts", options)];
|
|
965
|
+
const getAllRelatedProductsOptions = (options) => {
|
|
966
|
+
return (0, import_react_query.queryOptions)({
|
|
967
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
968
|
+
const { data } = await (0, import_sdk.getAllRelatedProducts)({
|
|
969
|
+
...options,
|
|
970
|
+
...queryKey[0],
|
|
971
|
+
signal,
|
|
972
|
+
throwOnError: true
|
|
973
|
+
});
|
|
974
|
+
return data;
|
|
975
|
+
},
|
|
976
|
+
queryKey: getAllRelatedProductsQueryKey(options)
|
|
977
|
+
});
|
|
978
|
+
};
|
|
945
979
|
const getComponentProductIdsQueryKey = (options) => [createQueryKey("getComponentProductIds", options)];
|
|
946
980
|
const getComponentProductIdsOptions = (options) => {
|
|
947
981
|
return (0, import_react_query.queryOptions)({
|
|
@@ -2622,6 +2656,8 @@ const getAFileOptions = (options) => {
|
|
|
2622
2656
|
getAllNodesQueryKey,
|
|
2623
2657
|
getAllProductsOptions,
|
|
2624
2658
|
getAllProductsQueryKey,
|
|
2659
|
+
getAllRelatedProductsOptions,
|
|
2660
|
+
getAllRelatedProductsQueryKey,
|
|
2625
2661
|
getAnOrderOptions,
|
|
2626
2662
|
getAnOrderQueryKey,
|
|
2627
2663
|
getByContextAllHierarchiesOptions,
|
|
@@ -2630,6 +2666,8 @@ const getAFileOptions = (options) => {
|
|
|
2630
2666
|
getByContextAllNodesQueryKey,
|
|
2631
2667
|
getByContextAllProductsOptions,
|
|
2632
2668
|
getByContextAllProductsQueryKey,
|
|
2669
|
+
getByContextAllRelatedProductsOptions,
|
|
2670
|
+
getByContextAllRelatedProductsQueryKey,
|
|
2633
2671
|
getByContextChildNodesOptions,
|
|
2634
2672
|
getByContextChildNodesQueryKey,
|
|
2635
2673
|
getByContextChildProductsOptions,
|