@medusajs/js-sdk 2.6.2-snapshot-20250328151043 → 2.7.0-preview-20250411080918

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.
@@ -28,7 +28,7 @@ export class DraftOrder {
28
28
  * To retrieve a draft order by its ID:
29
29
  *
30
30
  * ```ts
31
- * sdk.admin.draftOrder.retrieve("draft_order_123")
31
+ * sdk.admin.draftOrder.retrieve("order_123")
32
32
  * .then(({ draft_order }) => {
33
33
  * console.log(draft_order)
34
34
  * })
@@ -37,7 +37,7 @@ export class DraftOrder {
37
37
  * To specify the fields and relations to retrieve:
38
38
  *
39
39
  * ```ts
40
- * sdk.admin.draftOrder.retrieve("draft_order_123", {
40
+ * sdk.admin.draftOrder.retrieve("order_123", {
41
41
  * fields: "id,*items"
42
42
  * })
43
43
  * .then(({ draft_order }) => {
@@ -130,7 +130,7 @@ export class DraftOrder {
130
130
  * },
131
131
  * ],
132
132
  * region_id: "region_123",
133
- * sales_channel_id: "sales_channel_123",
133
+ * sales_channel_id: "sc_123",
134
134
  * })
135
135
  * .then(({ draft_order }) => {
136
136
  * console.log(draft_order)
@@ -160,7 +160,7 @@ export class DraftOrder {
160
160
  * To update a draft order:
161
161
  *
162
162
  * ```ts
163
- * sdk.admin.draftOrder.update("draft_order_123", {
163
+ * sdk.admin.draftOrder.update("order_123", {
164
164
  * email: "test@test.com",
165
165
  * })
166
166
  * .then(({ draft_order }) => {
@@ -178,5 +178,400 @@ export class DraftOrder {
178
178
  });
179
179
  });
180
180
  }
181
+ /**
182
+ * This method converts a draft order to an order. It sends a request to the
183
+ * [Convert Draft Order to Order](https://docs.medusajs.com/api/admin#draft-orders_postdraftordersidconvert-to-order) API route.
184
+ *
185
+ * @param id - The draft order's ID.
186
+ * @param query - Configure the fields to retrieve in the order.
187
+ * @param headers - Headers to pass in the request.
188
+ *
189
+ * @example
190
+ * To convert a draft order to an order:
191
+ *
192
+ * ```ts
193
+ * sdk.admin.draftOrder.convertToOrder("order_123")
194
+ * .then(({ order }) => {
195
+ * console.log(order)
196
+ * })
197
+ */
198
+ convertToOrder(id, query, headers) {
199
+ return __awaiter(this, void 0, void 0, function* () {
200
+ return yield this.client.fetch(`/admin/draft-orders/${id}/convert-to-order`, {
201
+ method: "POST",
202
+ query,
203
+ headers,
204
+ });
205
+ });
206
+ }
207
+ /**
208
+ * This method adds items to a draft order. It sends a request to the
209
+ * [Add Draft Order Items](https://docs.medusajs.com/api/admin#draft-orders_postordereditsiditems) API route.
210
+ *
211
+ * @param id - The draft order's ID.
212
+ * @param body - The data to add the items to the draft order.
213
+ * @param headers - Headers to pass in the request.
214
+ *
215
+ * @example
216
+ * To add items to a draft order:
217
+ *
218
+ * ```ts
219
+ * sdk.admin.draftOrder.addItems("order_123", {
220
+ * items: [
221
+ * {
222
+ * variant_id: "variant_123",
223
+ * quantity: 1,
224
+ * },
225
+ * ],
226
+ * })
227
+ * .then(({ draft_order_preview }) => {
228
+ * console.log(draft_order_preview)
229
+ * })
230
+ * ```
231
+ */
232
+ addItems(id, body, headers) {
233
+ return __awaiter(this, void 0, void 0, function* () {
234
+ return yield this.client.fetch(`/admin/draft-orders/${id}/edit/items`, {
235
+ method: "POST",
236
+ body,
237
+ headers,
238
+ });
239
+ });
240
+ }
241
+ /**
242
+ * This method updates an item that is part of an action in a draft order. It sends a request to the
243
+ * [Update Draft Order Item](https://docs.medusajs.com/api/admin#draft-orders_postordereditsiditemsaction_id) API route.
244
+ *
245
+ * @param id - The draft order's ID.
246
+ * @param actionId - The action ID.
247
+ * @param body - The data to update the item.
248
+ * @param headers - Headers to pass in the request.
249
+ *
250
+ * @example
251
+ * To update an item that is part of an action in a draft order:
252
+ *
253
+ * ```ts
254
+ * sdk.admin.draftOrder.updateActionItem("order_123", "action_123", {
255
+ * quantity: 2,
256
+ * })
257
+ * .then(({ draft_order_preview }) => {
258
+ * console.log(draft_order_preview)
259
+ * })
260
+ * ```
261
+ */
262
+ updateActionItem(id, actionId, body, headers) {
263
+ return __awaiter(this, void 0, void 0, function* () {
264
+ return yield this.client.fetch(`/admin/draft-orders/${id}/edit/items/${actionId}`, {
265
+ method: "POST",
266
+ body,
267
+ headers,
268
+ });
269
+ });
270
+ }
271
+ /**
272
+ * This method removes an item that is part of an action in a draft order. It sends a request to the
273
+ * [Remove Draft Order Item](https://docs.medusajs.com/api/admin#draft-orders_deleteordereditsiditemsaction_id) API route.
274
+ *
275
+ * @param id - The draft order's ID.
276
+ * @param actionId - The action ID.
277
+ * @param headers - Headers to pass in the request.
278
+ *
279
+ * @example
280
+ * To remove an item that is part of an action in a draft order:
281
+ *
282
+ * ```ts
283
+ * sdk.admin.draftOrder.removeActionItem("order_123", "action_123")
284
+ * .then(({ draft_order_preview }) => {
285
+ * console.log(draft_order_preview)
286
+ * })
287
+ * ```
288
+ */
289
+ removeActionItem(id, actionId, headers) {
290
+ return __awaiter(this, void 0, void 0, function* () {
291
+ return yield this.client.fetch(`/admin/draft-orders/${id}/edit/items/${actionId}`, {
292
+ method: "DELETE",
293
+ headers,
294
+ });
295
+ });
296
+ }
297
+ /**
298
+ * This method updates an item in a draft order. It sends a request to the
299
+ * [Update Draft Order Item](https://docs.medusajs.com/api/admin#draft-orders_postordereditsiditemsitem_id) API route.
300
+ *
301
+ * @param id - The draft order's ID.
302
+ * @param itemId - The item ID.
303
+ * @param body - The data to update the item.
304
+ * @param headers - Headers to pass in the request.
305
+ *
306
+ * @example
307
+ * To update an item in a draft order:
308
+ *
309
+ * ```ts
310
+ * sdk.admin.draftOrder.updateItem("order_123", "item_123", {
311
+ * quantity: 2,
312
+ * })
313
+ * .then(({ draft_order_preview }) => {
314
+ * console.log(draft_order_preview)
315
+ * })
316
+ * ```
317
+ */
318
+ updateItem(id, itemId, body, headers) {
319
+ return __awaiter(this, void 0, void 0, function* () {
320
+ return yield this.client.fetch(`/admin/draft-orders/${id}/edit/items/item/${itemId}`, {
321
+ method: "POST",
322
+ body,
323
+ headers,
324
+ });
325
+ });
326
+ }
327
+ /**
328
+ * This method adds promotions to a draft order. It sends a request to the
329
+ * [Add Draft Order Promotions](https://docs.medusajs.com/api/admin#draft-orders_postordereditsidpromotions) API route.
330
+ *
331
+ * @param id - The draft order's ID.
332
+ * @param body - The data to add the promotions to the draft order.
333
+ * @param headers - Headers to pass in the request.
334
+ *
335
+ * @example
336
+ * To add promotions to a draft order:
337
+ *
338
+ * ```ts
339
+ * sdk.admin.draftOrder.addPromotions("order_123", {
340
+ * promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"],
341
+ * })
342
+ * .then(({ draft_order_preview }) => {
343
+ * console.log(draft_order_preview)
344
+ * })
345
+ * ```
346
+ */
347
+ addPromotions(id, body, headers) {
348
+ return __awaiter(this, void 0, void 0, function* () {
349
+ return yield this.client.fetch(`/admin/draft-orders/${id}/edit/promotions`, {
350
+ method: "POST",
351
+ body,
352
+ headers,
353
+ });
354
+ });
355
+ }
356
+ /**
357
+ * This method removes promotions from a draft order. It sends a request to the
358
+ * [Remove Draft Order Promotions](https://docs.medusajs.com/api/admin#draft-orders_deleteordereditsidpromotions) API route.
359
+ *
360
+ * @param id - The draft order's ID.
361
+ * @param body - The data to remove the promotions from the draft order.
362
+ * @param headers - Headers to pass in the request.
363
+ *
364
+ * @example
365
+ * To remove promotions from a draft order:
366
+ *
367
+ * ```ts
368
+ * sdk.admin.draftOrder.removePromotions("order_123", {
369
+ * promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"],
370
+ * })
371
+ * ```
372
+ */
373
+ removePromotions(id, body, headers) {
374
+ return __awaiter(this, void 0, void 0, function* () {
375
+ return yield this.client.fetch(`/admin/draft-orders/${id}/edit/promotions`, {
376
+ method: "DELETE",
377
+ body,
378
+ headers,
379
+ });
380
+ });
381
+ }
382
+ /**
383
+ * This method adds a shipping method to a draft order. It sends a request to the
384
+ * [Add Draft Order Shipping Method](https://docs.medusajs.com/api/admin#draft-orders_postordereditsidshipping-methods) API route.
385
+ *
386
+ * @param id - The draft order's ID.
387
+ * @param body - The data to add the shipping method to the draft order.
388
+ * @param headers - Headers to pass in the request.
389
+ *
390
+ * @example
391
+ * To add a shipping method to a draft order:
392
+ *
393
+ * ```ts
394
+ * sdk.admin.draftOrder.addShippingMethod("order_123", {
395
+ * shipping_option_id: "shipping_option_123",
396
+ * })
397
+ * .then(({ draft_order_preview }) => {
398
+ * console.log(draft_order_preview)
399
+ * })
400
+ * ```
401
+ */
402
+ addShippingMethod(id, body, headers) {
403
+ return __awaiter(this, void 0, void 0, function* () {
404
+ return yield this.client.fetch(`/admin/draft-orders/${id}/edit/shipping-methods`, {
405
+ method: "POST",
406
+ body,
407
+ headers,
408
+ });
409
+ });
410
+ }
411
+ /**
412
+ * This method updates a shipping method in a draft order. It sends a request to the
413
+ * [Update Draft Order Shipping Method](https://docs.medusajs.com/api/admin#draft-orders_postordereditsidshipping-methodsaction_id) API route.
414
+ *
415
+ * @param id - The draft order's ID.
416
+ * @param actionId - The action ID.
417
+ * @param body - The data to update the shipping method.
418
+ * @param headers - Headers to pass in the request.
419
+ *
420
+ * @example
421
+ * To update a shipping method in a draft order:
422
+ *
423
+ * ```ts
424
+ * sdk.admin.draftOrder.updateShippingMethod("order_123", "action_123", {
425
+ * shipping_option_id: "shipping_option_123",
426
+ * })
427
+ * .then(({ draft_order_preview }) => {
428
+ * console.log(draft_order_preview)
429
+ * })
430
+ * ```
431
+ */
432
+ updateActionShippingMethod(id, actionId, body, headers) {
433
+ return __awaiter(this, void 0, void 0, function* () {
434
+ return yield this.client.fetch(`/admin/draft-orders/${id}/edit/shipping-methods/${actionId}`, {
435
+ method: "POST",
436
+ body,
437
+ headers,
438
+ });
439
+ });
440
+ }
441
+ /**
442
+ * This method removes a shipping method from a draft order. It sends a request to the
443
+ * [Remove Draft Order Shipping Method](https://docs.medusajs.com/api/admin#draft-orders_deleteordereditsidshipping-methodsaction_id) API route.
444
+ *
445
+ * @param id - The draft order's ID.
446
+ * @param actionId - The action ID.
447
+ * @param headers - Headers to pass in the request.
448
+ *
449
+ * @example
450
+ * To remove a shipping method from a draft order:
451
+ *
452
+ * ```ts
453
+ * sdk.admin.draftOrder.removeShippingMethod("order_123", "action_123")
454
+ * .then(({ draft_order_preview }) => {
455
+ * console.log(draft_order_preview)
456
+ * })
457
+ * ```
458
+ */
459
+ removeActionShippingMethod(id, actionId, headers) {
460
+ return __awaiter(this, void 0, void 0, function* () {
461
+ return yield this.client.fetch(`/admin/draft-orders/${id}/edit/shipping-methods/${actionId}`, {
462
+ method: "DELETE",
463
+ headers,
464
+ });
465
+ });
466
+ }
467
+ updateShippingMethod(id, methodId, body, headers) {
468
+ return __awaiter(this, void 0, void 0, function* () {
469
+ return yield this.client.fetch(`/admin/draft-orders/${id}/edit/shipping-methods/method/${methodId}`, {
470
+ method: "POST",
471
+ body,
472
+ headers,
473
+ });
474
+ });
475
+ }
476
+ /**
477
+ * This method begins an edit to a draft order. It sends a request to the
478
+ * [Begin Draft Order Edit](https://docs.medusajs.com/api/admin#draft-orders_postordereditsid) API route.
479
+ *
480
+ * @param id - The draft order's ID.
481
+ * @param headers - Headers to pass in the request.
482
+ *
483
+ * @example
484
+ * To begin an edit to a draft order:
485
+ *
486
+ * ```ts
487
+ * sdk.admin.draftOrder.beginEdit("order_123")
488
+ * .then(({ draft_order_preview }) => {
489
+ * console.log(draft_order_preview)
490
+ * })
491
+ * ```
492
+ */
493
+ beginEdit(id, headers) {
494
+ return __awaiter(this, void 0, void 0, function* () {
495
+ return yield this.client.fetch(`/admin/draft-orders/${id}/edit`, {
496
+ method: "POST",
497
+ headers,
498
+ });
499
+ });
500
+ }
501
+ /**
502
+ * This method cancels an edit to a draft order. It sends a request to the
503
+ * [Cancel Draft Order Edit](https://docs.medusajs.com/api/admin#draft-orders_deleteordereditsid) API route.
504
+ *
505
+ * @param id - The draft order's ID.
506
+ * @param headers - Headers to pass in the request.
507
+ *
508
+ * @example
509
+ * To cancel an edit to a draft order:
510
+ *
511
+ * ```ts
512
+ * sdk.admin.draftOrder.cancelEdit("order_123")
513
+ * .then(({ id, object, deleted }) => {
514
+ * console.log(id, object, deleted)
515
+ * })
516
+ * ```
517
+ */
518
+ cancelEdit(id, headers) {
519
+ return __awaiter(this, void 0, void 0, function* () {
520
+ return yield this.client.fetch(`/admin/draft-orders/${id}/edit`, {
521
+ method: "DELETE",
522
+ headers,
523
+ });
524
+ });
525
+ }
526
+ /**
527
+ * This method requests an edit to a draft order. It sends a request to the
528
+ * [Request Draft Order Edit](https://docs.medusajs.com/api/admin#draft-orders_postordereditsidrequest) API route.
529
+ *
530
+ * @param id - The draft order's ID.
531
+ * @param headers - Headers to pass in the request.
532
+ *
533
+ * @example
534
+ * To request an edit to a draft order:
535
+ *
536
+ * ```ts
537
+ * sdk.admin.draftOrder.requestEdit("order_123")
538
+ * .then(({ draft_order_preview }) => {
539
+ * console.log(draft_order_preview)
540
+ * })
541
+ * ```
542
+ */
543
+ requestEdit(id, headers) {
544
+ return __awaiter(this, void 0, void 0, function* () {
545
+ return yield this.client.fetch(`/admin/draft-orders/${id}/edit/request`, {
546
+ method: "POST",
547
+ headers,
548
+ });
549
+ });
550
+ }
551
+ /**
552
+ * This method confirms an edit to a draft order. It sends a request to the
553
+ * [Confirm Draft Order Edit](https://docs.medusajs.com/api/admin#draft-orders_postordereditsidconfirm) API route.
554
+ *
555
+ * @param id - The draft order's ID.
556
+ * @param headers - Headers to pass in the request.
557
+ *
558
+ * @example
559
+ * To confirm an edit to a draft order:
560
+ *
561
+ * ```ts
562
+ * sdk.admin.draftOrder.confirmEdit("order_123")
563
+ * .then(({ draft_order_preview }) => {
564
+ * console.log(draft_order_preview)
565
+ * })
566
+ * ```
567
+ */
568
+ confirmEdit(id, headers) {
569
+ return __awaiter(this, void 0, void 0, function* () {
570
+ return yield this.client.fetch(`/admin/draft-orders/${id}/edit/confirm`, {
571
+ method: "POST",
572
+ headers,
573
+ });
574
+ });
575
+ }
181
576
  }
182
577
  //# sourceMappingURL=draft-order.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"draft-order.js","sourceRoot":"","sources":["../../../src/admin/draft-order.ts"],"names":[],"mappings":";;;;;;;;;AAKA,MAAM,OAAO,UAAU;IAKrB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,QAAQ,CACZ,EAAU,EACV,KAAuC,EACvC,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,uBAAuB,EAAE,EAAE,EAC3B;gBACE,KAAK;gBACL,OAAO;aACR,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6CG;IACG,IAAI,CACR,WAAiD,EACjD,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,qBAAqB,EACrB;gBACE,KAAK,EAAE,WAAW;gBAClB,OAAO;aACR,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,MAAM,CACV,IAAqC,EACrC,KAAuC,EACvC,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,qBAAqB,EACrB;gBACE,MAAM,EAAE,MAAM;gBACd,IAAI;gBACJ,KAAK;gBACL,OAAO;aACR,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,MAAM,CACV,EAAU,EACV,IAAqC,EACrC,KAAuC,EACvC,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,uBAAuB,EAAE,EAAE,EAC3B;gBACE,MAAM,EAAE,MAAM;gBACd,IAAI;gBACJ,KAAK;gBACL,OAAO;aACR,CACF,CAAA;QACH,CAAC;KAAA;CACF"}
1
+ {"version":3,"file":"draft-order.js","sour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 @@ import { HttpTypes } from "@medusajs/types";
2
2
  import { Client } from "../client";
3
3
  import { ClientHeaders } from "../types";
4
4
  export declare class Plugin {
5
+ /**
6
+ * @ignore
7
+ */
5
8
  private client;
9
+ /**
10
+ * @ignore
11
+ */
6
12
  constructor(client: Client);
13
+ /**
14
+ * This method retrieves the list of plugins installed in a Medusa application.
15
+ *
16
+ * @param headers - Headers to pass in the request.
17
+ * @returns The list of plugins.
18
+ *
19
+ * @example
20
+ * sdk.admin.plugin.list()
21
+ * .then(({ plugins }) => {
22
+ * console.log(plugins)
23
+ * })
24
+ */
7
25
  list(headers?: ClientHeaders): Promise<HttpTypes.AdminPluginsListResponse>;
8
26
  }
9
27
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/admin/plugin.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,MAAM;IACjB,OAAO,CAAC,MAAM,CAAQ;gBAEV,MAAM,EAAE,MAAM;IAIpB,IAAI,CAAC,OAAO,CAAC,EAAE,aAAa;CASnC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/admin/plugin.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,MAAM;IACjB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAQ;IAEtB;;OAEG;gBACS,MAAM,EAAE,MAAM;IAI1B;;;;;;;;;;;OAWG;IACG,IAAI,CAAC,OAAO,CAAC,EAAE,aAAa;CASnC"}
@@ -8,9 +8,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  export class Plugin {
11
+ /**
12
+ * @ignore
13
+ */
11
14
  constructor(client) {
12
15
  this.client = client;
13
16
  }
17
+ /**
18
+ * This method retrieves the list of plugins installed in a Medusa application.
19
+ *
20
+ * @param headers - Headers to pass in the request.
21
+ * @returns The list of plugins.
22
+ *
23
+ * @example
24
+ * sdk.admin.plugin.list()
25
+ * .then(({ plugins }) => {
26
+ * console.log(plugins)
27
+ * })
28
+ */
14
29
  list(headers) {
15
30
  return __awaiter(this, void 0, void 0, function* () {
16
31
  return yield this.client.fetch(`/admin/plugins`, {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/admin/plugin.ts"],"names":[],"mappings":";;;;;;;;;AAIA,MAAM,OAAO,MAAM;IAGjB,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAEK,IAAI,CAAC,OAAuB;;YAChC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,gBAAgB,EAChB;gBACE,OAAO;gBACP,KAAK,EAAE,EAAE;aACV,CACF,CAAA;QACH,CAAC;KAAA;CACF"}
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/admin/plugin.ts"],"names":[],"mappings":";;;;;;;;;AAIA,MAAM,OAAO,MAAM;IAMjB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;OAWG;IACG,IAAI,CAAC,OAAuB;;YAChC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,gBAAgB,EAChB;gBACE,OAAO;gBACP,KAAK,EAAE,EAAE;aACV,CACF,CAAA;QACH,CAAC;KAAA;CACF"}