@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
@@ -14,6 +14,24 @@ export class OrderEdit {
14
14
  constructor(client) {
15
15
  this.client = client;
16
16
  }
17
+ /**
18
+ * This method creates an order edit request. It sends a HTTP request to the
19
+ * [Create Order Edit](https://docs.medusajs.com/api/admin#order-edits_postorderedits)
20
+ * API route.
21
+ *
22
+ * @param body - The order edit's details.
23
+ * @param query - Configure the fields to retrieve in the order edit.
24
+ * @param headers - Headers to pass in the request.
25
+ * @returns The order edit's details.
26
+ *
27
+ * @example
28
+ * sdk.admin.orderEdit.initiateRequest({
29
+ * order_id: "order_123"
30
+ * })
31
+ * .then(({ order_change }) => {
32
+ * console.log(order_change)
33
+ * })
34
+ */
17
35
  initiateRequest(body, query, headers) {
18
36
  return __awaiter(this, void 0, void 0, function* () {
19
37
  return yield this.client.fetch(`/admin/order-edits`, {
@@ -24,6 +42,22 @@ export class OrderEdit {
24
42
  });
25
43
  });
26
44
  }
45
+ /**
46
+ * This method changes an order edit to requested. It sends a request to the
47
+ * [Request Order Edit](https://docs.medusajs.com/api/admin#order-edits_postordereditsidrequest)
48
+ * API route.
49
+ *
50
+ * @param id - The order edit's ID.
51
+ * @param query - Configure the fields to retrieve in the order preview.
52
+ * @param headers - Headers to pass in the request.
53
+ * @returns The order preview's details.
54
+ *
55
+ * @example
56
+ * sdk.admin.orderEdit.request("ordch_123")
57
+ * .then(({ order_preview }) => {
58
+ * console.log(order_preview)
59
+ * })
60
+ */
27
61
  request(id, query, headers) {
28
62
  return __awaiter(this, void 0, void 0, function* () {
29
63
  return yield this.client.fetch(`/admin/order-edits/${id}/request`, {
@@ -33,6 +67,22 @@ export class OrderEdit {
33
67
  });
34
68
  });
35
69
  }
70
+ /**
71
+ * This method confirms an order edit and applies it on the order. It sends a request
72
+ * to the [Confirm Order Edit](https://docs.medusajs.com/api/admin#order-edits_postordereditsidconfirm)
73
+ * API route.
74
+ *
75
+ * @param id - The order edit's ID.
76
+ * @param query - Configure the fields to retrieve in the order preview.
77
+ * @param headers - Headers to pass in the request.
78
+ * @returns The order preview's details.
79
+ *
80
+ * @example
81
+ * sdk.admin.orderEdit.confirm("ordch_123")
82
+ * .then(({ order_preview }) => {
83
+ * console.log(order_preview)
84
+ * })
85
+ */
36
86
  confirm(id, query, headers) {
37
87
  return __awaiter(this, void 0, void 0, function* () {
38
88
  return yield this.client.fetch(`/admin/order-edits/${id}/confirm`, {
@@ -42,6 +92,22 @@ export class OrderEdit {
42
92
  });
43
93
  });
44
94
  }
95
+ /**
96
+ * This method cancels a requested order edit. It sends a request to the
97
+ * [Cancel Order Edit](https://docs.medusajs.com/api/admin#order-edits_deleteordereditsid)
98
+ * API route.
99
+ *
100
+ * @param id - The order edit's ID.
101
+ * @param query - Query parameters
102
+ * @param headers - Headers to pass in the request.
103
+ * @returns The deletion's details.
104
+ *
105
+ * @example
106
+ * sdk.admin.orderEdit.cancelRequest("ordch_123")
107
+ * .then(({ deleted }) => {
108
+ * console.log(deleted)
109
+ * })
110
+ */
45
111
  cancelRequest(id, query, headers) {
46
112
  return __awaiter(this, void 0, void 0, function* () {
47
113
  return yield this.client.fetch(`/admin/order-edits/${id}`, {
@@ -51,6 +117,31 @@ export class OrderEdit {
51
117
  });
52
118
  });
53
119
  }
120
+ /**
121
+ * This method adds items to an order edit. These items will have the action `ITEM_ADD`.
122
+ *
123
+ * The method sends a request to the [Add Items](https://docs.medusajs.com/api/admin#order-edits_postordereditsiditems)
124
+ * API route.
125
+ *
126
+ * @param id - The order edit's ID.
127
+ * @param body - The items to add.
128
+ * @param query - Configure the fields to retrieve in the order preview.
129
+ * @param headers - Headers to pass in the request.
130
+ * @returns The order preview's details.
131
+ *
132
+ * @example
133
+ * sdk.admin.orderEdit.addItems("ordch_123", {
134
+ * items: [
135
+ * {
136
+ * variant_id: "variant_123",
137
+ * quantity: 1
138
+ * }
139
+ * ]
140
+ * })
141
+ * .then(({ order_preview }) => {
142
+ * console.log(order_preview)
143
+ * })
144
+ */
54
145
  addItems(id, body, query, headers) {
55
146
  return __awaiter(this, void 0, void 0, function* () {
56
147
  return yield this.client.fetch(`/admin/order-edits/${id}/items`, {
@@ -61,6 +152,30 @@ export class OrderEdit {
61
152
  });
62
153
  });
63
154
  }
155
+ /**
156
+ * This method updates the quantity and other details of an item in an order. It sends a request to the
157
+ * [Update Item Quantity](https://docs.medusajs.com/api/admin#order-edits_postordereditsiditemsitemitem_id)
158
+ * API route.
159
+ *
160
+ * @param id - The order edit's ID.
161
+ * @param itemId - The item's ID in the order.
162
+ * @param body - The data to edit in the item.
163
+ * @param query - Configure the fields to retrieve in the order preview.
164
+ * @param headers - Headers to pass in the request.
165
+ * @returns The order preview's details.
166
+ *
167
+ * @example
168
+ * sdk.admin.orderEdit.updateOriginalItem(
169
+ * "ordch_123",
170
+ * "orli_123",
171
+ * {
172
+ * quantity: 1
173
+ * }
174
+ * )
175
+ * .then(({ order_preview }) => {
176
+ * console.log(order_preview)
177
+ * })
178
+ */
64
179
  updateOriginalItem(id, itemId, body, query, headers) {
65
180
  return __awaiter(this, void 0, void 0, function* () {
66
181
  return yield this.client.fetch(`/admin/order-edits/${id}/items/item/${itemId}`, {
@@ -71,6 +186,35 @@ export class OrderEdit {
71
186
  });
72
187
  });
73
188
  }
189
+ /**
190
+ * This method updates an added item in the order edit by the ID of the item's `ITEM_ADD` action.
191
+ *
192
+ * Every item has an `actions` property, whose value is an array of actions.
193
+ * You can check the action's name using its `action` property, and use the value of the `id` property.
194
+ *
195
+ * It sends a request
196
+ * to the [Update Item](https://docs.medusajs.com/api/admin#order-edits_postordereditsiditemsaction_id)
197
+ * API route.
198
+ *
199
+ * @param id - The order edit's ID.
200
+ * @param actionId - The id of the new item's `ITEM_ADD` action.
201
+ * @param body - The data to update.
202
+ * @param query - Configure the fields to retrieve in the order preview.
203
+ * @param headers - Headers to pass in the request.
204
+ * @returns The order preview's details.
205
+ *
206
+ * @example
207
+ * sdk.admin.orderEdit.updateAddedItem(
208
+ * "ordch_123",
209
+ * "orli_123",
210
+ * {
211
+ * quantity: 1
212
+ * }
213
+ * )
214
+ * .then(({ order_preview }) => {
215
+ * console.log(order_preview)
216
+ * })
217
+ */
74
218
  updateAddedItem(id, actionId, body, query, headers) {
75
219
  return __awaiter(this, void 0, void 0, function* () {
76
220
  return yield this.client.fetch(`/admin/order-edits/${id}/items/${actionId}`, {
@@ -81,6 +225,27 @@ export class OrderEdit {
81
225
  });
82
226
  });
83
227
  }
228
+ /**
229
+ * This method removes an added item in the order edit by the ID of the item's `ITEM_ADD` action.
230
+ *
231
+ * Every item has an `actions` property, whose value is an array of actions.
232
+ * You can check the action's name using its `action` property, and use the value of the `id` property.
233
+ *
234
+ * @param id - The order edit's ID.
235
+ * @param actionId - The id of the new item's `ITEM_ADD` action.
236
+ * @param query - Configure the fields to retrieve in the order preview.
237
+ * @param headers - Headers to pass in the request.
238
+ * @returns The order preview's details.
239
+ *
240
+ * @example
241
+ * sdk.admin.orderEdit.removeAddedItem(
242
+ * "ordch_123",
243
+ * "orli_123",
244
+ * )
245
+ * .then(({ order_preview }) => {
246
+ * console.log(order_preview)
247
+ * })
248
+ */
84
249
  removeAddedItem(id, actionId, query, headers) {
85
250
  return __awaiter(this, void 0, void 0, function* () {
86
251
  return yield this.client.fetch(`/admin/order-edits/${id}/items/${actionId}`, {
@@ -1 +1 @@
1
- {"version":3,"file":"order-edit.js","sourceRoot":"","sources":["../../../src/admin/order-edit.ts"],"names":[],"mappings":";;;;;;;;;AAIA,MAAM,OAAO,SAAS;IAKpB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAEK,eAAe,CACnB,IAA6C,EAC7C,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,oBAAoB,EACpB;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAEK,OAAO,CACX,EAAU,EACV,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,sBAAsB,EAAE,UAAU,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gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAEK,eAAe,CACnB,EAAU,EACV,QAAgB,EAChB,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,sBAAsB,EAAE,UAAU,QAAQ,EAAE,EAC5C;gBACE,MAAM,EAAE,QAAQ;gBAChB,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;CACF"}
1
+ {"version":3,"file":"order-edit.js","sourceRoot":"","sources":["../../../src/admin/order-edit.ts"],"names":[],"mappings":";;;;;;;;;AAIA,MAAM,OAAO,SAAS;IAKpB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACG,eAAe,CACnB,IAA6C,EAC7C,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,oBAAoB,EACpB;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;OAeG;IACG,OAAO,CACX,EAAU,EACV,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,sBAAsB,EAAE,UAAU,EAClC;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;OAeG;IACG,OAAO,CACX,EAAU,EACV,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,sBAAsB,EAAE,UAAU,EAClC;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,KAAK;aACN,CACF,CAAA;Q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EAChB,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,sBAAsB,EAAE,UAAU,QAAQ,EAAE,EAC5C;gBACE,MAAM,EAAE,QAAQ;gBAChB,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;CACF"}
@@ -10,29 +10,255 @@ export declare class Order {
10
10
  * @ignore
11
11
  */
12
12
  constructor(client: Client);
13
- retrieve(id: string, query?: SelectParams, headers?: ClientHeaders): Promise<{
14
- order: HttpTypes.AdminOrder;
15
- }>;
13
+ /**
14
+ * This method retrieves an order by its ID. It sends a request to the
15
+ * [Get Order](https://docs.medusajs.com/api/admin#orders_getordersid)
16
+ * API route.
17
+ *
18
+ * @param id - The order's ID.
19
+ * @param query - Configure the fields to retrieve in the order.
20
+ * @param headers - Headers to pass in the request
21
+ * @returns The order's details.
22
+ *
23
+ * @example
24
+ * To retrieve an order by its ID:
25
+ *
26
+ * ```ts
27
+ * sdk.admin.order.retrieve("order_123")
28
+ * .then(({ order }) => {
29
+ * console.log(order)
30
+ * })
31
+ * ```
32
+ *
33
+ * To specify the fields and relations to retrieve:
34
+ *
35
+ * ```ts
36
+ * sdk.admin.order.retrieve("order_123", {
37
+ * fields: "id,*items"
38
+ * })
39
+ * .then(({ order }) => {
40
+ * console.log(order)
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
+ */
46
+ retrieve(id: string, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderResponse>;
47
+ /**
48
+ * This method retrieves the preview of an order based on its last associated change. It sends a request to the
49
+ * [Get Order Preview](https://docs.medusajs.com/api/admin#orders_getordersidpreview) API route.
50
+ *
51
+ * @param id - The order's ID.
52
+ * @param query - Query parameters.
53
+ * @param headers - Headers to pass in the request
54
+ * @returns The order preview's details.
55
+ *
56
+ * @example
57
+ * sdk.admin.order.retrievePreview("order_123")
58
+ * .then(({ order }) => {
59
+ * console.log(order)
60
+ * })
61
+ */
16
62
  retrievePreview(id: string, query?: HttpTypes.AdminOrderFilters, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderPreviewResponse>;
17
- list(queryParams?: FindParams & HttpTypes.AdminOrderFilters, headers?: ClientHeaders): Promise<HttpTypes.PaginatedResponse<{
18
- orders: HttpTypes.AdminOrder[];
19
- }>>;
20
- cancel(id: string, headers?: ClientHeaders): Promise<{
21
- order: HttpTypes.AdminOrder;
22
- }>;
23
- createFulfillment(id: string, body: HttpTypes.AdminCreateOrderFulfillment, query?: SelectParams, headers?: ClientHeaders): Promise<{
24
- order: HttpTypes.AdminOrder;
25
- }>;
26
- cancelFulfillment(id: string, fulfillmentId: string, body: HttpTypes.AdminCancelOrderFulfillment, headers?: ClientHeaders): Promise<{
27
- order: HttpTypes.AdminOrder;
28
- }>;
29
- createShipment(id: string, fulfillmentId: string, body: HttpTypes.AdminCreateOrderShipment, query?: SelectParams, headers?: ClientHeaders): Promise<{
30
- order: HttpTypes.AdminOrder;
31
- }>;
32
- markAsDelivered(id: string, fulfillmentId: string, body: HttpTypes.AdminMarkOrderFulfillmentAsDelivered, query?: SelectParams, headers?: ClientHeaders): Promise<{
33
- order: HttpTypes.AdminOrder;
34
- }>;
63
+ /**
64
+ * This method retrieves a paginated list of orders. It sends a request to the
65
+ * [List Orders](https://docs.medusajs.com/api/admin#orders_getorders) API route.
66
+ *
67
+ * @param queryParams - Filters and pagination configurations.
68
+ * @param headers - Headers to pass in the request.
69
+ * @returns The paginated list of orders.
70
+ *
71
+ * @example
72
+ * To retrieve the list of orders:
73
+ *
74
+ * ```ts
75
+ * sdk.admin.order.list()
76
+ * .then(({ orders, count, limit, offset }) => {
77
+ * console.log(orders)
78
+ * })
79
+ * ```
80
+ *
81
+ * To configure the pagination, pass the `limit` and `offset` query parameters.
82
+ *
83
+ * For example, to retrieve only 10 items and skip 10 items:
84
+ *
85
+ * ```ts
86
+ * sdk.admin.order.list({
87
+ * limit: 10,
88
+ * offset: 10
89
+ * })
90
+ * .then(({ orders, count, limit, offset }) => {
91
+ * console.log(orders)
92
+ * })
93
+ * ```
94
+ *
95
+ * Using the `fields` query parameter, you can specify the fields and relations to retrieve
96
+ * in each order:
97
+ *
98
+ * ```ts
99
+ * sdk.admin.order.list({
100
+ * fields: "id,*items"
101
+ * })
102
+ * .then(({ orders, count, limit, offset }) => {
103
+ * console.log(orders)
104
+ * })
105
+ * ```
106
+ *
107
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
108
+ */
109
+ list(queryParams?: HttpTypes.AdminOrderFilters, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderListResponse>;
110
+ /**
111
+ * This method cancels an order. It sends a request to the
112
+ * [Cancel Order](https://docs.medusajs.com/api/admin#orders_postordersidcancel)
113
+ * API route.
114
+ *
115
+ * @param id - The order's ID.
116
+ * @param headers - Headers to pass in the request.
117
+ * @returns The order's details.
118
+ *
119
+ * @example
120
+ * sdk.admin.order.cancel("order_123")
121
+ * .then(({ order }) => {
122
+ * console.log(order)
123
+ * })
124
+ */
125
+ cancel(id: string, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderResponse>;
126
+ /**
127
+ * This method creates a fulfillment for an order. It sends a request to the
128
+ * [Create Fulfillment](https://docs.medusajs.com/api/admin#orders_postordersidfulfillments)
129
+ * API route.
130
+ *
131
+ * @param id - The order's ID.
132
+ * @param body - The fulfillment's details.
133
+ * @param query - Configure the fields to retrieve in the order.
134
+ * @param headers - Headers to pass in the request
135
+ * @returns The order's details.
136
+ *
137
+ * @example
138
+ * sdk.admin.order.createFulfillment("order_123", {
139
+ * items: [
140
+ * {
141
+ * id: "orli_123",
142
+ * quantity: 1
143
+ * }
144
+ * ]
145
+ * })
146
+ * .then(({ order }) => {
147
+ * console.log(order)
148
+ * })
149
+ */
150
+ createFulfillment(id: string, body: HttpTypes.AdminCreateOrderFulfillment, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderResponse>;
151
+ /**
152
+ * This method cancels an order's fulfillment. It sends a request to the
153
+ * [Cancel Fulfillment](https://docs.medusajs.com/api/admin#orders_postordersidfulfillmentsfulfillment_idcancel)
154
+ * API route.
155
+ *
156
+ * @param id - The order's ID.
157
+ * @param fulfillmentId - The ID of the fulfillment to cancel.
158
+ * @param body - The cancelation's details.
159
+ * @param headers - Headers to pass in the request
160
+ * @returns The order's details.
161
+ *
162
+ * @example
163
+ * sdk.admin.order.cancelFulfillment(
164
+ * "order_123",
165
+ * "ful_123",
166
+ * {
167
+ * no_notification: false
168
+ * }
169
+ * )
170
+ * .then(({ order }) => {
171
+ * console.log(order)
172
+ * })
173
+ */
174
+ cancelFulfillment(id: string, fulfillmentId: string, body: HttpTypes.AdminCancelOrderFulfillment, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderResponse>;
175
+ /**
176
+ * This method creates a shipment for an order's fulfillment. It sends a request to the
177
+ * [Create Shipment](https://docs.medusajs.com/api/admin#orders_postordersidfulfillmentsfulfillment_idshipments)
178
+ * API route.
179
+ *
180
+ * @param id - The order's ID.
181
+ * @param fulfillmentId - The ID of the fulfillment.
182
+ * @param body - The shipment's details.
183
+ * @param query - Configure the fields to retrieve in the order.
184
+ * @param headers - Headers to pass in the request
185
+ * @returns The order's details.
186
+ *
187
+ * @example
188
+ * sdk.admin.order.createShipment(
189
+ * "order_123",
190
+ * "ful_123",
191
+ * {
192
+ * items: [
193
+ * {
194
+ * id: "fulit_123",
195
+ * quantity: 1
196
+ * }
197
+ * ]
198
+ * }
199
+ * )
200
+ * .then(({ order }) => {
201
+ * console.log(order)
202
+ * })
203
+ */
204
+ createShipment(id: string, fulfillmentId: string, body: HttpTypes.AdminCreateOrderShipment, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderResponse>;
205
+ /**
206
+ * This method marks an order's fulfillment as delivered. It sends a request to the
207
+ * [Mark Delivered ](https://docs.medusajs.com/api/admin#orders_postordersidfulfillmentsfulfillment_idmarkasdelivered)
208
+ * API route.
209
+ *
210
+ * @param id - The order's ID.
211
+ * @param fulfillmentId - The fulfillment's ID.
212
+ * @param body - The delivery details.
213
+ * @param query - Configure the fields to retrieve in the order.
214
+ * @param headers - Headers to pass in the request
215
+ * @returns The order's details.
216
+ *
217
+ * @example
218
+ * sdk.admin.order.markAsDelivered(
219
+ * "order_123",
220
+ * "ful_123",
221
+ * {}
222
+ * )
223
+ * .then(({ order }) => {
224
+ * console.log(order)
225
+ * })
226
+ */
227
+ markAsDelivered(id: string, fulfillmentId: string, body: HttpTypes.AdminMarkOrderFulfillmentAsDelivered, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderResponse>;
228
+ /**
229
+ * This method retrieves a list of changes made on an order, including returns, exchanges, etc...
230
+ *
231
+ * This method sends a request to the [List Changes](https://docs.medusajs.com/api/admin#orders_getordersidchanges)
232
+ * API route.
233
+ *
234
+ * @param id - The order's ID.
235
+ * @param queryParams - Configure the fields to retrieve in each order change.
236
+ * @param headers - Headers to pass in the request
237
+ * @returns The list of order changes.
238
+ *
239
+ * @example
240
+ * sdk.admin.order.listChanges("order_123")
241
+ * .then(({ order_changes }) => {
242
+ * console.log(order_changes)
243
+ * })
244
+ */
35
245
  listChanges(id: string, queryParams?: FindParams & HttpTypes.AdminOrderChangesFilters, headers?: ClientHeaders): Promise<HttpTypes.PaginatedResponse<HttpTypes.AdminOrderChangesResponse>>;
36
- listLineItems(id: string, queryParams?: FindParams & HttpTypes.AdminOrderItemsFilters, headers?: ClientHeaders): Promise<HttpTypes.PaginatedResponse<HttpTypes.AdminOrderLineItemsListResponse>>;
246
+ /**
247
+ * This method retrieves the order's line items. It sends a request to the
248
+ * [List Line Items](https://docs.medusajs.com/api/admin#orders_getordersidlineitems)
249
+ * API routes.
250
+ *
251
+ * @param id - The order's ID.
252
+ * @param queryParams - Configure the fields to retrieve in each line item.
253
+ * @param headers - Headers to pass in the request
254
+ * @returns The list of line items.
255
+ *
256
+ * @example
257
+ * sdk.admin.order.listLineItems("order_123")
258
+ * .then(({ order_items }) => {
259
+ * console.log(order_items)
260
+ * })
261
+ */
262
+ listLineItems(id: string, queryParams?: FindParams & HttpTypes.AdminOrderItemsFilters, headers?: ClientHeaders): Promise<HttpTypes.AdminOrderLineItemsListResponse>;
37
263
  }
38
264
  //# sourceMappingURL=order.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"order.d.ts","sourceRoot":"","sources":["../../../src/admin/order.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAET,YAAY,EACb,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,qBAAa,KAAK;IAChB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAQ;IACtB;;OAEG;gBACS,MAAM,EAAE,MAAM;IAIpB,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,aAAa;eAC9B,SAAS,CAAC,UAAU;;IASxD,eAAe,CACnB,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,SAAS,CAAC,iBAAiB,EACnC,OAAO,CAAC,EAAE,aAAa;IAWnB,IAAI,CACR,WAAW,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,iBAAiB,EACtD,OAAO,CAAC,EAAE,aAAa;gBAGO,SAAS,CAAC,UAAU,EAAE;;IAOhD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;eACN,SAAS,CAAC,UAAU;;IASxD,iBAAiB,CACrB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,SAAS,CAAC,2BAA2B,EAC3C,KAAK,CAAC,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa;eAEiB,SAAS,CAAC,UAAU;;IAWxD,iBAAi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