@medusajs/js-sdk 2.0.1-snapshot-20241025090810 → 2.0.2-snapshot-20241104135243

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. package/dist/admin/notification.d.ts +80 -0
  2. package/dist/admin/notification.d.ts.map +1 -1
  3. package/dist/admin/notification.js +80 -0
  4. package/dist/admin/notification.js.map +1 -1
  5. package/dist/admin/order-edit.d.ts +166 -1
  6. package/dist/admin/order-edit.d.ts.map +1 -1
  7. package/dist/admin/order-edit.js +165 -0
  8. package/dist/admin/order-edit.js.map +1 -1
  9. package/dist/admin/order.d.ts +248 -22
  10. package/dist/admin/order.d.ts.map +1 -1
  11. package/dist/admin/order.js +240 -0
  12. package/dist/admin/order.js.map +1 -1
  13. package/dist/admin/payment-collection.d.ts +55 -0
  14. package/dist/admin/payment-collection.d.ts.map +1 -1
  15. package/dist/admin/payment-collection.js +55 -0
  16. package/dist/admin/payment-collection.js.map +1 -1
  17. package/dist/admin/payment.d.ts +162 -1
  18. package/dist/admin/payment.d.ts.map +1 -1
  19. package/dist/admin/payment.js +161 -0
  20. package/dist/admin/payment.js.map +1 -1
  21. package/dist/admin/price-list.d.ts +195 -1
  22. package/dist/admin/price-list.d.ts.map +1 -1
  23. package/dist/admin/price-list.js +194 -0
  24. package/dist/admin/price-list.js.map +1 -1
  25. package/dist/admin/price-preference.d.ts +133 -0
  26. package/dist/admin/price-preference.d.ts.map +1 -1
  27. package/dist/admin/price-preference.js +133 -0
  28. package/dist/admin/price-preference.js.map +1 -1
  29. package/dist/admin/product-category.d.ts +150 -0
  30. package/dist/admin/product-category.d.ts.map +1 -1
  31. package/dist/admin/product-category.js +150 -0
  32. package/dist/admin/product-category.js.map +1 -1
  33. package/dist/admin/product-collection.d.ts +149 -0
  34. package/dist/admin/product-collection.d.ts.map +1 -1
  35. package/dist/admin/product-collection.js +149 -0
  36. package/dist/admin/product-collection.js.map +1 -1
  37. package/dist/esm/admin/notification.d.ts +80 -0
  38. package/dist/esm/admin/notification.d.ts.map +1 -1
  39. package/dist/esm/admin/notification.js +80 -0
  40. package/dist/esm/admin/notification.js.map +1 -1
  41. package/dist/esm/admin/order-edit.d.ts +166 -1
  42. package/dist/esm/admin/order-edit.d.ts.map +1 -1
  43. package/dist/esm/admin/order-edit.js +165 -0
  44. package/dist/esm/admin/order-edit.js.map +1 -1
  45. package/dist/esm/admin/order.d.ts +248 -22
  46. package/dist/esm/admin/order.d.ts.map +1 -1
  47. package/dist/esm/admin/order.js +240 -0
  48. package/dist/esm/admin/order.js.map +1 -1
  49. package/dist/esm/admin/payment-collection.d.ts +55 -0
  50. package/dist/esm/admin/payment-collection.d.ts.map +1 -1
  51. package/dist/esm/admin/payment-collection.js +55 -0
  52. package/dist/esm/admin/payment-collection.js.map +1 -1
  53. package/dist/esm/admin/payment.d.ts +162 -1
  54. package/dist/esm/admin/payment.d.ts.map +1 -1
  55. package/dist/esm/admin/payment.js +161 -0
  56. package/dist/esm/admin/payment.js.map +1 -1
  57. package/dist/esm/admin/price-list.d.ts +195 -1
  58. package/dist/esm/admin/price-list.d.ts.map +1 -1
  59. package/dist/esm/admin/price-list.js +194 -0
  60. package/dist/esm/admin/price-list.js.map +1 -1
  61. package/dist/esm/admin/price-preference.d.ts +133 -0
  62. package/dist/esm/admin/price-preference.d.ts.map +1 -1
  63. package/dist/esm/admin/price-preference.js +133 -0
  64. package/dist/esm/admin/price-preference.js.map +1 -1
  65. package/dist/esm/admin/product-category.d.ts +150 -0
  66. package/dist/esm/admin/product-category.d.ts.map +1 -1
  67. package/dist/esm/admin/product-category.js +150 -0
  68. package/dist/esm/admin/product-category.js.map +1 -1
  69. package/dist/esm/admin/product-collection.d.ts +149 -0
  70. package/dist/esm/admin/product-collection.d.ts.map +1 -1
  71. package/dist/esm/admin/product-collection.js +149 -0
  72. package/dist/esm/admin/product-collection.js.map +1 -1
  73. package/package.json +2 -2
@@ -8,6 +8,24 @@ class ProductCollection {
8
8
  constructor(client) {
9
9
  this.client = client;
10
10
  }
11
+ /**
12
+ * This method creates a product collection. It sends a request to the
13
+ * [Create Collection](https://docs.medusajs.com/api/admin#collections_postcollections)
14
+ * API route.
15
+ *
16
+ * @param body - The details of the product collection to create.
17
+ * @param query - Configure the fields to retrieve in the product collection.
18
+ * @param headers - Headers to pass in the request
19
+ * @returns The product collection's details.
20
+ *
21
+ * @example
22
+ * sdk.admin.productCollection.create({
23
+ * title: "Summer Collection"
24
+ * })
25
+ * .then(({ collection }) => {
26
+ * console.log(collection)
27
+ * })
28
+ */
11
29
  async create(body, query, headers) {
12
30
  return this.client.fetch(`/admin/collections`, {
13
31
  method: "POST",
@@ -16,6 +34,25 @@ class ProductCollection {
16
34
  query,
17
35
  });
18
36
  }
37
+ /**
38
+ * This method updates a collection. It sends a request to the
39
+ * [Update Collection](https://docs.medusajs.com/api/admin#collections_postcollectionsid)
40
+ * API route.
41
+ *
42
+ * @param id - The ID of the collection.
43
+ * @param body - The data to update in the collection.
44
+ * @param query - Configure the fields to retrieve in the product collection.
45
+ * @param headers - Headers to pass in the request
46
+ * @returns The product collection's details.
47
+ *
48
+ * @example
49
+ * sdk.admin.productCollection.update("pcol_123", {
50
+ * title: "Summer Collection"
51
+ * })
52
+ * .then(({ collection }) => {
53
+ * console.log(collection)
54
+ * })
55
+ */
19
56
  async update(id, body, query, headers) {
20
57
  return this.client.fetch(`/admin/collections/${id}`, {
21
58
  method: "POST",
@@ -24,24 +61,136 @@ class ProductCollection {
24
61
  query,
25
62
  });
26
63
  }
64
+ /**
65
+ * This method retrieves a paginated list of collections. It sends a request to the
66
+ * [List Collections](https://docs.medusajs.com/api/admin#collections_getcollections) API route.
67
+ *
68
+ * @param query - Filters and pagination configurations.
69
+ * @param headers - Headers to pass in the request.
70
+ * @returns The paginated list of collections.
71
+ *
72
+ * @example
73
+ * To retrieve the list of collections:
74
+ *
75
+ * ```ts
76
+ * sdk.admin.productCollection.list()
77
+ * .then(({ collections, count, limit, offset }) => {
78
+ * console.log(collections)
79
+ * })
80
+ * ```
81
+ *
82
+ * To configure the pagination, pass the `limit` and `offset` query parameters.
83
+ *
84
+ * For example, to retrieve only 10 items and skip 10 items:
85
+ *
86
+ * ```ts
87
+ * sdk.admin.productCollection.list({
88
+ * limit: 10,
89
+ * offset: 10
90
+ * })
91
+ * .then(({ collections, count, limit, offset }) => {
92
+ * console.log(collections)
93
+ * })
94
+ * ```
95
+ *
96
+ * Using the `fields` query parameter, you can specify the fields and relations to retrieve
97
+ * in each collection:
98
+ *
99
+ * ```ts
100
+ * sdk.admin.productCollection.list({
101
+ * fields: "id,*products"
102
+ * })
103
+ * .then(({ collections, count, limit, offset }) => {
104
+ * console.log(collections)
105
+ * })
106
+ * ```
107
+ *
108
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
109
+ */
27
110
  async list(queryParams, headers) {
28
111
  return this.client.fetch(`/admin/collections`, {
29
112
  headers,
30
113
  query: queryParams,
31
114
  });
32
115
  }
116
+ /**
117
+ * This method retrieves a collection by its ID. It sends a request to the
118
+ * [Get Collection](https://docs.medusajs.com/api/admin#collections_getcollectionsid) API route.
119
+ *
120
+ * @param id - The collection's ID.
121
+ * @param query - Configure the fields to retrieve in the collection.
122
+ * @param headers - Headers to pass in the request
123
+ * @returns The collection's details.
124
+ *
125
+ * @example
126
+ * To retrieve a collection by its ID:
127
+ *
128
+ * ```ts
129
+ * sdk.admin.productCollection.retrieve("pcol_123")
130
+ * .then(({ collection }) => {
131
+ * console.log(collection)
132
+ * })
133
+ * ```
134
+ *
135
+ * To specify the fields and relations to retrieve:
136
+ *
137
+ * ```ts
138
+ * sdk.admin.productCollection.retrieve("pcol_123", {
139
+ * fields: "id,*products"
140
+ * })
141
+ * .then(({ collection }) => {
142
+ * console.log(collection)
143
+ * })
144
+ * ```
145
+ *
146
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
147
+ */
33
148
  async retrieve(id, query, headers) {
34
149
  return this.client.fetch(`/admin/collections/${id}`, {
35
150
  query,
36
151
  headers,
37
152
  });
38
153
  }
154
+ /**
155
+ * This method deletes a product collection. It sends a request to the
156
+ * [Delete Collection](https://docs.medusajs.com/api/admin#collections_deletecollectionsid)
157
+ * API route.
158
+ *
159
+ * @param id - The collection's ID.
160
+ * @param headers - Headers to pass in the request
161
+ * @returns The deletion's details.
162
+ *
163
+ * @example
164
+ * sdk.admin.productCollection.delete("pcol_123")
165
+ * .then(({ deleted }) => {
166
+ * console.log(deleted)
167
+ * })
168
+ */
39
169
  async delete(id, headers) {
40
170
  return this.client.fetch(`/admin/collections/${id}`, {
41
171
  method: "DELETE",
42
172
  headers,
43
173
  });
44
174
  }
175
+ /**
176
+ * This method manages the products of a collection to add or remove them. It sends a request
177
+ * to the [Manage Products](https://docs.medusajs.com/api/admin#collections_postcollectionsidproducts)
178
+ * API route.
179
+ *
180
+ * @param id - The collection's ID.
181
+ * @param body - The products to add or remove.
182
+ * @param headers - Headers to pass in the request
183
+ * @returns The product category's details.
184
+ *
185
+ * @example
186
+ * sdk.admin.productCollection.updateProducts("pcol_123", {
187
+ * add: ["prod_123"],
188
+ * remove: ["prod_321"]
189
+ * })
190
+ * .then(({ collection }) => {
191
+ * console.log(collection)
192
+ * })
193
+ */
45
194
  async updateProducts(id, body, headers) {
46
195
  return this.client.fetch(`/admin/collections/${id}/products`, {
47
196
  method: "POST",
@@ -1 +1 @@
1
- {"version":3,"file":"product-collection.js","sourceRoot":"","sources":["../../src/admin/product-collection.ts"],"names":[],"mappings":";;;AAIA,MAAa,iBAAiB;IAK5B;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,KAAK,CAAC,MAAM,CACV,IAAqC,EACrC,KAAuC,EACvC,OAAuB;QAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,oBAAoB,EACpB;YACE,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI;YACJ,KAAK;SACN,CACF,CAAA;IACH,CAAC;IACD,KAAK,CAAC,MAAM,CACV,EAAU,EACV,IAAqC,EACrC,KAAuC,EACvC,OAAuB;QAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,sBAAsB,EAAE,EAAE,EAC1B;YACE,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI;YACJ,KAAK;SACN,CACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CACR,WAAiD,EACjD,OAAuB;QAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,oBAAoB,EACpB;YACE,OAAO;YACP,KAAK,EAAE,WAAW;SACnB,CACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,EAAU,EACV,KAAuC,EACvC,OAAuB;QAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,sBAAsB,EAAE,EAAE,EAC1B;YACE,KAAK;YACL,OAAO;SACR,CACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,OAAuB;QAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,sBAAsB,EAAE,EAAE,EAC1B;YACE,MAAM,EAAE,QAAQ;YAChB,OAAO;SACR,CACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,EAAU,EACV,IAA6C,EAC7C,OAAuB;QAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,sBAAsB,EAAE,WAAW,EACnC;YACE,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI;SACL,CACF,CAAA;IACH,CAAC;CACF;AA/FD,8CA+FC"}
1
+ {"version":3,"file":"product-collection.js","sourceRoot":"","sources":["../../src/admin/product-collection.ts"],"names":[],"mappings":";;;AAIA,MAAa,iBAAiB;IAK5B;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,KAAK,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7C,OAAuB;QAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,sBAAsB,EAAE,WAAW,EACnC;YACE,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI;SACL,CACF,CAAA;IACH,CAAC;CACF;AArPD,8CAqPC"}
@@ -10,7 +10,87 @@ export declare class Notification {
10
10
  * @ignore
11
11
  */
12
12
  constructor(client: Client);
13
+ /**
14
+ * This method retrieves a notification's details. It sends a request to the
15
+ * [Get Notification](https://docs.medusajs.com/api/admin#notifications_getnotificationsid)
16
+ * API route.
17
+ *
18
+ * @param id - The notification's ID.
19
+ * @param query - Configure the fields to retrieve in the notification.
20
+ * @param headers - Headers to pass in the request
21
+ * @returns The notification's details.
22
+ *
23
+ * @example
24
+ * To retrieve a notification by its ID:
25
+ *
26
+ * ```ts
27
+ * sdk.admin.notification.retrieve("notif_123")
28
+ * .then(({ notification }) => {
29
+ * console.log(notification)
30
+ * })
31
+ * ```
32
+ *
33
+ * To specify the fields and relations to retrieve:
34
+ *
35
+ * ```ts
36
+ * sdk.admin.notification.retrieve("notif_123", {
37
+ * fields: "id,to"
38
+ * })
39
+ * .then(({ notification }) => {
40
+ * console.log(notification)
41
+ * })
42
+ * ```
43
+ *
44
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
45
+ */
13
46
  retrieve(id: string, query?: HttpTypes.AdminNotificationParams, headers?: ClientHeaders): Promise<HttpTypes.AdminNotificationResponse>;
47
+ /**
48
+ * This method retrieves a paginated list of notifications. It sends a request to the
49
+ * [List Notifications](https://docs.medusajs.com/api/admin#notifications_getnotifications)
50
+ * API route.
51
+ *
52
+ * @param query - Filters and pagination configurations.
53
+ * @param headers - Headers to pass in the request.
54
+ * @returns The paginated list of notifications.
55
+ *
56
+ * @example
57
+ * To retrieve the list of notifications:
58
+ *
59
+ * ```ts
60
+ * sdk.admin.notification.list()
61
+ * .then(({ notifications, count, limit, offset }) => {
62
+ * console.log(notifications)
63
+ * })
64
+ * ```
65
+ *
66
+ * To configure the pagination, pass the `limit` and `offset` query parameters.
67
+ *
68
+ * For example, to retrieve only 10 items and skip 10 items:
69
+ *
70
+ * ```ts
71
+ * sdk.admin.notification.list({
72
+ * limit: 10,
73
+ * offset: 10
74
+ * })
75
+ * .then(({ notifications, count, limit, offset }) => {
76
+ * console.log(notifications)
77
+ * })
78
+ * ```
79
+ *
80
+ * Using the `fields` query parameter, you can specify the fields and relations to retrieve
81
+ * in each notification:
82
+ *
83
+ * ```ts
84
+ * sdk.admin.notification.list({
85
+ * fields: "id,to"
86
+ * })
87
+ * .then(({ notifications, count, limit, offset }) => {
88
+ * console.log(notifications)
89
+ * })
90
+ * ```
91
+ *
92
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
93
+ */
14
94
  list(query?: HttpTypes.AdminNotificationListParams, headers?: ClientHeaders): Promise<HttpTypes.AdminNotificationListResponse>;
15
95
  }
16
96
  //# sourceMappingURL=notification.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/admin/notification.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,YAAY;IACvB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAQ;IACtB;;OAEG;gBACS,MAAM,EAAE,MAAM;IAIpB,QAAQ,CACZ,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,SAAS,CAAC,uBAAuB,EACzC,OAAO,CAAC,EAAE,aAAa;IAYnB,IAAI,CACR,KAAK,CAAC,EAAE,SAAS,CAAC,2BAA2B,EAC7C,OAAO,CAAC,EAAE,aAAa;CAW1B"}
1
+ {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/admin/notification.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,YAAY;IACvB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAQ;IACtB;;OAEG;gBACS,MAAM,EAAE,MAAM;IAI1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,QAAQ,CACZ,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,SAAS,CAAC,uBAAuB,EACzC,OAAO,CAAC,EAAE,aAAa;IAYzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACG,IAAI,CACR,KAAK,CAAC,EAAE,SAAS,CAAC,2BAA2B,EAC7C,OAAO,CAAC,EAAE,aAAa;CAW1B"}
@@ -14,6 +14,39 @@ export class Notification {
14
14
  constructor(client) {
15
15
  this.client = client;
16
16
  }
17
+ /**
18
+ * This method retrieves a notification's details. It sends a request to the
19
+ * [Get Notification](https://docs.medusajs.com/api/admin#notifications_getnotificationsid)
20
+ * API route.
21
+ *
22
+ * @param id - The notification's ID.
23
+ * @param query - Configure the fields to retrieve in the notification.
24
+ * @param headers - Headers to pass in the request
25
+ * @returns The notification's details.
26
+ *
27
+ * @example
28
+ * To retrieve a notification by its ID:
29
+ *
30
+ * ```ts
31
+ * sdk.admin.notification.retrieve("notif_123")
32
+ * .then(({ notification }) => {
33
+ * console.log(notification)
34
+ * })
35
+ * ```
36
+ *
37
+ * To specify the fields and relations to retrieve:
38
+ *
39
+ * ```ts
40
+ * sdk.admin.notification.retrieve("notif_123", {
41
+ * fields: "id,to"
42
+ * })
43
+ * .then(({ notification }) => {
44
+ * console.log(notification)
45
+ * })
46
+ * ```
47
+ *
48
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
49
+ */
17
50
  retrieve(id, query, headers) {
18
51
  return __awaiter(this, void 0, void 0, function* () {
19
52
  return yield this.client.fetch(`/admin/notifications/${id}`, {
@@ -23,6 +56,53 @@ export class Notification {
23
56
  });
24
57
  });
25
58
  }
59
+ /**
60
+ * This method retrieves a paginated list of notifications. It sends a request to the
61
+ * [List Notifications](https://docs.medusajs.com/api/admin#notifications_getnotifications)
62
+ * API route.
63
+ *
64
+ * @param query - Filters and pagination configurations.
65
+ * @param headers - Headers to pass in the request.
66
+ * @returns The paginated list of notifications.
67
+ *
68
+ * @example
69
+ * To retrieve the list of notifications:
70
+ *
71
+ * ```ts
72
+ * sdk.admin.notification.list()
73
+ * .then(({ notifications, count, limit, offset }) => {
74
+ * console.log(notifications)
75
+ * })
76
+ * ```
77
+ *
78
+ * To configure the pagination, pass the `limit` and `offset` query parameters.
79
+ *
80
+ * For example, to retrieve only 10 items and skip 10 items:
81
+ *
82
+ * ```ts
83
+ * sdk.admin.notification.list({
84
+ * limit: 10,
85
+ * offset: 10
86
+ * })
87
+ * .then(({ notifications, count, limit, offset }) => {
88
+ * console.log(notifications)
89
+ * })
90
+ * ```
91
+ *
92
+ * Using the `fields` query parameter, you can specify the fields and relations to retrieve
93
+ * in each notification:
94
+ *
95
+ * ```ts
96
+ * sdk.admin.notification.list({
97
+ * fields: "id,to"
98
+ * })
99
+ * .then(({ notifications, count, limit, offset }) => {
100
+ * console.log(notifications)
101
+ * })
102
+ * ```
103
+ *
104
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
105
+ */
26
106
  list(query, headers) {
27
107
  return __awaiter(this, void 0, void 0, function* () {
28
108
  return yield this.client.fetch(`/admin/notifications`, {
@@ -1 +1 @@
1
- {"version":3,"file":"notification.js","sourceRoot":"","sources":["../../../src/admin/notification.ts"],"names":[],"mappings":";;;;;;;;;AAIA,MAAM,OAAO,YAAY;IAKvB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAEK,QAAQ,CACZ,EAAU,EACV,KAAyC,EACzC,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,wBAAwB,EAAE,EAAE,EAC5B;gBACE,MAAM,EAAE,KAAK;gBACb,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAEK,IAAI,CACR,KAA6C,EAC7C,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,sBAAsB,EACtB;gBACE,MAAM,EAAE,KAAK;gBACb,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;CACF"}
1
+ {"version":3,"file":"notification.js","sourceRoot":"","sources":["../../../src/admin/notification.ts"],"names":[],"mappings":";;;;;;;;;AAIA,MAAM,OAAO,YAAY;IAKvB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,QAAQ,CACZ,EAAU,EACV,KAAyC,EACzC,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,wBAAwB,EAAE,EAAE,EAC5B;gBACE,MAAM,EAAE,KAAK;gBACb,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACG,IAAI,CACR,KAA6C,EAC7C,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,sBAAsB,EACtB;gBACE,MAAM,EAAE,KAAK;gBACb,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;CACF"}
@@ -10,13 +10,178 @@ export declare class OrderEdit {
10
10
  * @ignore
11
11
  */
12
12
  constructor(client: Client);
13
- initiateRequest(body: HttpTypes.AdminInitiateOrderEditRequest, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderEditPreviewResponse>;
13
+ /**
14
+ * This method creates an order edit request. It sends a HTTP request to the
15
+ * [Create Order Edit](https://docs.medusajs.com/api/admin#order-edits_postorderedits)
16
+ * API route.
17
+ *
18
+ * @param body - The order edit's details.
19
+ * @param query - Configure the fields to retrieve in the order edit.
20
+ * @param headers - Headers to pass in the request.
21
+ * @returns The order edit's details.
22
+ *
23
+ * @example
24
+ * sdk.admin.orderEdit.initiateRequest({
25
+ * order_id: "order_123"
26
+ * })
27
+ * .then(({ order_change }) => {
28
+ * console.log(order_change)
29
+ * })
30
+ */
31
+ initiateRequest(body: HttpTypes.AdminInitiateOrderEditRequest, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderEditResponse>;
32
+ /**
33
+ * This method changes an order edit to requested. It sends a request to the
34
+ * [Request Order Edit](https://docs.medusajs.com/api/admin#order-edits_postordereditsidrequest)
35
+ * API route.
36
+ *
37
+ * @param id - The order edit's ID.
38
+ * @param query - Configure the fields to retrieve in the order preview.
39
+ * @param headers - Headers to pass in the request.
40
+ * @returns The order preview's details.
41
+ *
42
+ * @example
43
+ * sdk.admin.orderEdit.request("ordch_123")
44
+ * .then(({ order_preview }) => {
45
+ * console.log(order_preview)
46
+ * })
47
+ */
14
48
  request(id: string, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderEditPreviewResponse>;
49
+ /**
50
+ * This method confirms an order edit and applies it on the order. It sends a request
51
+ * to the [Confirm Order Edit](https://docs.medusajs.com/api/admin#order-edits_postordereditsidconfirm)
52
+ * API route.
53
+ *
54
+ * @param id - The order edit's ID.
55
+ * @param query - Configure the fields to retrieve in the order preview.
56
+ * @param headers - Headers to pass in the request.
57
+ * @returns The order preview's details.
58
+ *
59
+ * @example
60
+ * sdk.admin.orderEdit.confirm("ordch_123")
61
+ * .then(({ order_preview }) => {
62
+ * console.log(order_preview)
63
+ * })
64
+ */
15
65
  confirm(id: string, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderEditPreviewResponse>;
66
+ /**
67
+ * This method cancels a requested order edit. It sends a request to the
68
+ * [Cancel Order Edit](https://docs.medusajs.com/api/admin#order-edits_deleteordereditsid)
69
+ * API route.
70
+ *
71
+ * @param id - The order edit's ID.
72
+ * @param query - Query parameters
73
+ * @param headers - Headers to pass in the request.
74
+ * @returns The deletion's details.
75
+ *
76
+ * @example
77
+ * sdk.admin.orderEdit.cancelRequest("ordch_123")
78
+ * .then(({ deleted }) => {
79
+ * console.log(deleted)
80
+ * })
81
+ */
16
82
  cancelRequest(id: string, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderEditDeleteResponse>;
83
+ /**
84
+ * This method adds items to an order edit. These items will have the action `ITEM_ADD`.
85
+ *
86
+ * The method sends a request to the [Add Items](https://docs.medusajs.com/api/admin#order-edits_postordereditsiditems)
87
+ * API route.
88
+ *
89
+ * @param id - The order edit's ID.
90
+ * @param body - The items to add.
91
+ * @param query - Configure the fields to retrieve in the order preview.
92
+ * @param headers - Headers to pass in the request.
93
+ * @returns The order preview's details.
94
+ *
95
+ * @example
96
+ * sdk.admin.orderEdit.addItems("ordch_123", {
97
+ * items: [
98
+ * {
99
+ * variant_id: "variant_123",
100
+ * quantity: 1
101
+ * }
102
+ * ]
103
+ * })
104
+ * .then(({ order_preview }) => {
105
+ * console.log(order_preview)
106
+ * })
107
+ */
17
108
  addItems(id: string, body: HttpTypes.AdminAddOrderEditItems, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderEditPreviewResponse>;
109
+ /**
110
+ * This method updates the quantity and other details of an item in an order. It sends a request to the
111
+ * [Update Item Quantity](https://docs.medusajs.com/api/admin#order-edits_postordereditsiditemsitemitem_id)
112
+ * API route.
113
+ *
114
+ * @param id - The order edit's ID.
115
+ * @param itemId - The item's ID in the order.
116
+ * @param body - The data to edit in the item.
117
+ * @param query - Configure the fields to retrieve in the order preview.
118
+ * @param headers - Headers to pass in the request.
119
+ * @returns The order preview's details.
120
+ *
121
+ * @example
122
+ * sdk.admin.orderEdit.updateOriginalItem(
123
+ * "ordch_123",
124
+ * "orli_123",
125
+ * {
126
+ * quantity: 1
127
+ * }
128
+ * )
129
+ * .then(({ order_preview }) => {
130
+ * console.log(order_preview)
131
+ * })
132
+ */
18
133
  updateOriginalItem(id: string, itemId: string, body: HttpTypes.AdminUpdateOrderEditItem, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderEditPreviewResponse>;
134
+ /**
135
+ * This method updates an added item in the order edit by the ID of the item's `ITEM_ADD` action.
136
+ *
137
+ * Every item has an `actions` property, whose value is an array of actions.
138
+ * You can check the action's name using its `action` property, and use the value of the `id` property.
139
+ *
140
+ * It sends a request
141
+ * to the [Update Item](https://docs.medusajs.com/api/admin#order-edits_postordereditsiditemsaction_id)
142
+ * API route.
143
+ *
144
+ * @param id - The order edit's ID.
145
+ * @param actionId - The id of the new item's `ITEM_ADD` action.
146
+ * @param body - The data to update.
147
+ * @param query - Configure the fields to retrieve in the order preview.
148
+ * @param headers - Headers to pass in the request.
149
+ * @returns The order preview's details.
150
+ *
151
+ * @example
152
+ * sdk.admin.orderEdit.updateAddedItem(
153
+ * "ordch_123",
154
+ * "orli_123",
155
+ * {
156
+ * quantity: 1
157
+ * }
158
+ * )
159
+ * .then(({ order_preview }) => {
160
+ * console.log(order_preview)
161
+ * })
162
+ */
19
163
  updateAddedItem(id: string, actionId: string, body: HttpTypes.AdminUpdateOrderEditItem, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderEditPreviewResponse>;
164
+ /**
165
+ * This method removes an added item in the order edit by the ID of the item's `ITEM_ADD` action.
166
+ *
167
+ * Every item has an `actions` property, whose value is an array of actions.
168
+ * You can check the action's name using its `action` property, and use the value of the `id` property.
169
+ *
170
+ * @param id - The order edit's ID.
171
+ * @param actionId - The id of the new item's `ITEM_ADD` action.
172
+ * @param query - Configure the fields to retrieve in the order preview.
173
+ * @param headers - Headers to pass in the request.
174
+ * @returns The order preview's details.
175
+ *
176
+ * @example
177
+ * sdk.admin.orderEdit.removeAddedItem(
178
+ * "ordch_123",
179
+ * "orli_123",
180
+ * )
181
+ * .then(({ order_preview }) => {
182
+ * console.log(order_preview)
183
+ * })
184
+ */
20
185
  removeAddedItem(id: string, actionId: string, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderEditPreviewResponse>;
21
186
  }
22
187
  //# sourceMappingURL=order-edit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"order-edit.d.ts","sourceRoot":"","sources":["../../../src/admin/order-edit.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,SAAS;IACpB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAQ;IACtB;;OAEG;gBACS,MAAM,EAAE,MAAM;IAIpB,eAAe,CACnB,IAAI,EAAE,SAAS,CAAC,6BAA6B,EAC7C,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,EAC9B,OAAO,CAAC,EAAE,aAAa;IAanB,OAAO,CACX,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,EAC9B,OAAO,CAAC,EAAE,aAAa;IAYnB,OAAO,CACX,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,EAC9B,OAAO,CAAC,EAAE,aAAa;IAYnB,aAAa,CACjB,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,EAC9B,OAAO,CAAC,EAAE,aAAa;IA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