@medusajs/js-sdk 2.0.5-snapshot-20241112130534 → 2.0.5-snapshot-20241120130614
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/admin/product-tag.d.ts +130 -0
- package/dist/admin/product-tag.d.ts.map +1 -1
- package/dist/admin/product-tag.js +130 -0
- package/dist/admin/product-tag.js.map +1 -1
- package/dist/admin/product-type.d.ts +131 -0
- package/dist/admin/product-type.d.ts.map +1 -1
- package/dist/admin/product-type.js +131 -0
- package/dist/admin/product-type.js.map +1 -1
- package/dist/admin/product-variant.d.ts +48 -1
- package/dist/admin/product-variant.d.ts.map +1 -1
- package/dist/admin/product-variant.js +49 -2
- package/dist/admin/product-variant.js.map +1 -1
- package/dist/admin/product.d.ts +634 -2
- package/dist/admin/product.d.ts.map +1 -1
- package/dist/admin/product.js +636 -4
- package/dist/admin/product.js.map +1 -1
- package/dist/esm/admin/product-tag.d.ts +130 -0
- package/dist/esm/admin/product-tag.d.ts.map +1 -1
- package/dist/esm/admin/product-tag.js +130 -0
- package/dist/esm/admin/product-tag.js.map +1 -1
- package/dist/esm/admin/product-type.d.ts +131 -0
- package/dist/esm/admin/product-type.d.ts.map +1 -1
- package/dist/esm/admin/product-type.js +131 -0
- package/dist/esm/admin/product-type.js.map +1 -1
- package/dist/esm/admin/product-variant.d.ts +48 -1
- package/dist/esm/admin/product-variant.d.ts.map +1 -1
- package/dist/esm/admin/product-variant.js +49 -2
- package/dist/esm/admin/product-variant.js.map +1 -1
- package/dist/esm/admin/product.d.ts +634 -2
- package/dist/esm/admin/product.d.ts.map +1 -1
- package/dist/esm/admin/product.js +636 -4
- package/dist/esm/admin/product.js.map +1 -1
- package/dist/esm/store/index.d.ts +15 -0
- package/dist/esm/store/index.d.ts.map +1 -1
- package/dist/esm/store/index.js +21 -0
- package/dist/esm/store/index.js.map +1 -1
- package/dist/store/index.d.ts +15 -0
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +21 -0
- package/dist/store/index.js.map +1 -1
- package/package.json +2 -2
@@ -10,6 +10,53 @@ export declare class ProductVariant {
|
|
10
10
|
* @ignore
|
11
11
|
*/
|
12
12
|
constructor(client: Client);
|
13
|
-
|
13
|
+
/**
|
14
|
+
* This method retrieves a paginated list of product variants. It sends a request to the
|
15
|
+
* [List Product Variants](https://docs.medusajs.com/api/admin#product-variants_getproductvariants)
|
16
|
+
* API route.
|
17
|
+
*
|
18
|
+
* @param query - Filters and pagination configurations.
|
19
|
+
* @param headers - Headers to pass in the request.
|
20
|
+
* @returns The paginated list of product variants.
|
21
|
+
*
|
22
|
+
* @example
|
23
|
+
* To retrieve the list of product variants:
|
24
|
+
*
|
25
|
+
* ```ts
|
26
|
+
* sdk.admin.productVariant.list()
|
27
|
+
* .then(({ variants, count, limit, offset }) => {
|
28
|
+
* console.log(variants)
|
29
|
+
* })
|
30
|
+
* ```
|
31
|
+
*
|
32
|
+
* To configure the pagination, pass the `limit` and `offset` query parameters.
|
33
|
+
*
|
34
|
+
* For example, to retrieve only 10 items and skip 10 items:
|
35
|
+
*
|
36
|
+
* ```ts
|
37
|
+
* sdk.admin.productVariant.list({
|
38
|
+
* limit: 10,
|
39
|
+
* offset: 10
|
40
|
+
* })
|
41
|
+
* .then(({ variants, count, limit, offset }) => {
|
42
|
+
* console.log(variants)
|
43
|
+
* })
|
44
|
+
* ```
|
45
|
+
*
|
46
|
+
* Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
47
|
+
* in each campaign:
|
48
|
+
*
|
49
|
+
* ```ts
|
50
|
+
* sdk.admin.productVariant.list({
|
51
|
+
* fields: "id,products"
|
52
|
+
* })
|
53
|
+
* .then(({ variants, count, limit, offset }) => {
|
54
|
+
* console.log(variants)
|
55
|
+
* })
|
56
|
+
* ```
|
57
|
+
*
|
58
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
59
|
+
*/
|
60
|
+
list(query?: HttpTypes.AdminProductVariantParams, headers?: ClientHeaders): Promise<HttpTypes.AdminProductVariantListResponse>;
|
14
61
|
}
|
15
62
|
//# sourceMappingURL=product-variant.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"product-variant.d.ts","sourceRoot":"","sources":["../../src/admin/product-variant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,qBAAa,cAAc;IACzB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAQ;IACtB;;OAEG;gBACS,MAAM,EAAE,MAAM;
|
1
|
+
{"version":3,"file":"product-variant.d.ts","sourceRoot":"","sources":["../../src/admin/product-variant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,qBAAa,cAAc;IACzB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAQ;IACtB;;OAEG;gBACS,MAAM,EAAE,MAAM;IAI1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACG,IAAI,CACR,KAAK,CAAC,EAAE,SAAS,CAAC,yBAAyB,EAC3C,OAAO,CAAC,EAAE,aAAa;CAU1B"}
|
@@ -8,10 +8,57 @@ class ProductVariant {
|
|
8
8
|
constructor(client) {
|
9
9
|
this.client = client;
|
10
10
|
}
|
11
|
-
|
11
|
+
/**
|
12
|
+
* This method retrieves a paginated list of product variants. It sends a request to the
|
13
|
+
* [List Product Variants](https://docs.medusajs.com/api/admin#product-variants_getproductvariants)
|
14
|
+
* API route.
|
15
|
+
*
|
16
|
+
* @param query - Filters and pagination configurations.
|
17
|
+
* @param headers - Headers to pass in the request.
|
18
|
+
* @returns The paginated list of product variants.
|
19
|
+
*
|
20
|
+
* @example
|
21
|
+
* To retrieve the list of product variants:
|
22
|
+
*
|
23
|
+
* ```ts
|
24
|
+
* sdk.admin.productVariant.list()
|
25
|
+
* .then(({ variants, count, limit, offset }) => {
|
26
|
+
* console.log(variants)
|
27
|
+
* })
|
28
|
+
* ```
|
29
|
+
*
|
30
|
+
* To configure the pagination, pass the `limit` and `offset` query parameters.
|
31
|
+
*
|
32
|
+
* For example, to retrieve only 10 items and skip 10 items:
|
33
|
+
*
|
34
|
+
* ```ts
|
35
|
+
* sdk.admin.productVariant.list({
|
36
|
+
* limit: 10,
|
37
|
+
* offset: 10
|
38
|
+
* })
|
39
|
+
* .then(({ variants, count, limit, offset }) => {
|
40
|
+
* console.log(variants)
|
41
|
+
* })
|
42
|
+
* ```
|
43
|
+
*
|
44
|
+
* Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
45
|
+
* in each campaign:
|
46
|
+
*
|
47
|
+
* ```ts
|
48
|
+
* sdk.admin.productVariant.list({
|
49
|
+
* fields: "id,products"
|
50
|
+
* })
|
51
|
+
* .then(({ variants, count, limit, offset }) => {
|
52
|
+
* console.log(variants)
|
53
|
+
* })
|
54
|
+
* ```
|
55
|
+
*
|
56
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
57
|
+
*/
|
58
|
+
async list(query, headers) {
|
12
59
|
return await this.client.fetch(`/admin/product-variants`, {
|
13
60
|
headers,
|
14
|
-
query
|
61
|
+
query,
|
15
62
|
});
|
16
63
|
}
|
17
64
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"product-variant.js","sourceRoot":"","sources":["../../src/admin/product-variant.ts"],"names":[],"mappings":";;;AAIA,MAAa,cAAc;IAKzB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,KAAK,CAAC,IAAI,CACR,
|
1
|
+
{"version":3,"file":"product-variant.js","sourceRoot":"","sources":["../../src/admin/product-variant.ts"],"names":[],"mappings":";;;AAIA,MAAa,cAAc;IAKzB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACH,KAAK,CAAC,IAAI,CACR,KAA2C,EAC3C,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,yBAAyB,EACzB;YACE,OAAO;YACP,KAAK;SACN,CACF,CAAA;IACH,CAAC;CACF;AAvED,wCAuEC"}
|