@medusajs/js-sdk 2.0.5-preview-20241119120217 → 2.0.5-preview-20241119180151

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