chore(js-sdk): fix TSDocs of draft orders in JS SDK (#12270)
This commit is contained in:
@@ -128,6 +128,7 @@ export class DraftOrder {
|
||||
* @param body - The data to create the draft order.
|
||||
* @param query - Configure the fields to retrieve in the draft order.
|
||||
* @param headers - Headers to pass in the request.
|
||||
* @returns The draft order's details.
|
||||
*
|
||||
* @example
|
||||
* sdk.admin.draftOrder.create({
|
||||
@@ -169,6 +170,7 @@ export class DraftOrder {
|
||||
* @param body - The data to update the draft order.
|
||||
* @param query - Configure the fields to retrieve in the draft order.
|
||||
* @param headers - Headers to pass in the request.
|
||||
* @returns The draft order's details.
|
||||
*
|
||||
* @example
|
||||
* sdk.admin.draftOrder.update("order_123", {
|
||||
@@ -197,11 +199,12 @@ export class DraftOrder {
|
||||
|
||||
/**
|
||||
* This method converts a draft order to an order. It sends a request to the
|
||||
* [Convert Draft Order to Order](https://docs.medusajs.com/api/admin#draft-orders_postdraftordersidconvert-to-order) API route.
|
||||
* [Convert Draft Order to Order](https://docs.medusajs.com/api/admin#draft-orders_postdraftordersidconverttoorder) API route.
|
||||
*
|
||||
* @param id - The draft order's ID.
|
||||
* @param query - Configure the fields to retrieve in the order.
|
||||
* @param headers - Headers to pass in the request.
|
||||
* @returns The order's details.
|
||||
*
|
||||
* @example
|
||||
* sdk.admin.draftOrder.convertToOrder("order_123")
|
||||
@@ -226,11 +229,12 @@ export class DraftOrder {
|
||||
|
||||
/**
|
||||
* This method adds items to a draft order. It sends a request to the
|
||||
* [Add Draft Order Items](https://docs.medusajs.com/api/admin#draft-orders_postordereditsiditems) API route.
|
||||
* [Add Draft Order Items](https://docs.medusajs.com/api/admin#draft-orders_postdraftordersidedititems) API route.
|
||||
*
|
||||
* @param id - The draft order's ID.
|
||||
* @param body - The data to add the items to the draft order.
|
||||
* @param headers - Headers to pass in the request.
|
||||
* @returns The draft order preview's details.
|
||||
*
|
||||
* @example
|
||||
* sdk.admin.draftOrder.addItems("order_123", {
|
||||
@@ -262,12 +266,13 @@ export class DraftOrder {
|
||||
|
||||
/**
|
||||
* This method updates an item that is part of an action in a draft order. It sends a request to the
|
||||
* [Update Draft Order Item](https://docs.medusajs.com/api/admin#draft-orders_postordereditsiditemsaction_id) API route.
|
||||
* [Update Draft Order Item](https://docs.medusajs.com/api/admin#draft-orders_postdraftordersidedititemsaction_id) API route.
|
||||
*
|
||||
* @param id - The draft order's ID.
|
||||
* @param actionId - The action ID.
|
||||
* @param body - The data to update the item.
|
||||
* @param headers - Headers to pass in the request.
|
||||
* @returns The draft order preview's details.
|
||||
*
|
||||
* @example
|
||||
* sdk.admin.draftOrder.updateActionItem("order_123", "action_123", {
|
||||
@@ -295,11 +300,12 @@ export class DraftOrder {
|
||||
|
||||
/**
|
||||
* This method removes an item that is part of an action in a draft order. It sends a request to the
|
||||
* [Remove Draft Order Item](https://docs.medusajs.com/api/admin#draft-orders_deleteordereditsiditemsaction_id) API route.
|
||||
* [Remove Draft Order Item](https://docs.medusajs.com/api/admin#draft-orders_deletedraftordersidedititemsaction_id) API route.
|
||||
*
|
||||
* @param id - The draft order's ID.
|
||||
* @param actionId - The action ID.
|
||||
* @param headers - Headers to pass in the request.
|
||||
* @returns The draft order preview's details.
|
||||
*
|
||||
* @example
|
||||
* sdk.admin.draftOrder.removeActionItem("order_123", "action_123")
|
||||
@@ -323,7 +329,7 @@ export class DraftOrder {
|
||||
|
||||
/**
|
||||
* This method updates an item in a draft order. It sends a request to the
|
||||
* [Update Draft Order Item](https://docs.medusajs.com/api/admin#draft-orders_postordereditsiditemsitem_id) API route.
|
||||
* [Update Draft Order Item](https://docs.medusajs.com/api/admin#draft-orders_postdraftordersidedititemsitemitem_id) API route.
|
||||
*
|
||||
* @param id - The draft order's ID.
|
||||
* @param itemId - The item ID.
|
||||
@@ -357,11 +363,12 @@ export class DraftOrder {
|
||||
|
||||
/**
|
||||
* This method adds promotions to a draft order. It sends a request to the
|
||||
* [Add Draft Order Promotions](https://docs.medusajs.com/api/admin#draft-orders_postordereditsidpromotions) API route.
|
||||
* [Add Draft Order Promotions](https://docs.medusajs.com/api/admin#draft-orders_postdraftordersideditpromotions) API route.
|
||||
*
|
||||
* @param id - The draft order's ID.
|
||||
* @param body - The data to add the promotions to the draft order.
|
||||
* @param headers - Headers to pass in the request.
|
||||
* @returns The draft order preview's details.
|
||||
*
|
||||
* @example
|
||||
* sdk.admin.draftOrder.addPromotions("order_123", {
|
||||
@@ -388,11 +395,12 @@ export class DraftOrder {
|
||||
|
||||
/**
|
||||
* This method removes promotions from a draft order. It sends a request to the
|
||||
* [Remove Draft Order Promotions](https://docs.medusajs.com/api/admin#draft-orders_deleteordereditsidpromotions) API route.
|
||||
* [Remove Draft Order Promotions](https://docs.medusajs.com/api/admin#draft-orders_deletedraftordersideditpromotions) API route.
|
||||
*
|
||||
* @param id - The draft order's ID.
|
||||
* @param body - The data to remove the promotions from the draft order.
|
||||
* @param headers - Headers to pass in the request.
|
||||
* @returns The draft order preview's details.
|
||||
*
|
||||
* @example
|
||||
* sdk.admin.draftOrder.removePromotions("order_123", {
|
||||
@@ -416,11 +424,12 @@ export class DraftOrder {
|
||||
|
||||
/**
|
||||
* This method adds a shipping method to a draft order. It sends a request to the
|
||||
* [Add Draft Order Shipping Method](https://docs.medusajs.com/api/admin#draft-orders_postordereditsidshipping-methods) API route.
|
||||
* [Add Draft Order Shipping Method](https://docs.medusajs.com/api/admin#draft-orders_postdraftordersideditshippingmethods) API route.
|
||||
*
|
||||
* @param id - The draft order's ID.
|
||||
* @param body - The data to add the shipping method to the draft order.
|
||||
* @param headers - Headers to pass in the request.
|
||||
* @returns The draft order preview's details.
|
||||
*
|
||||
* @example
|
||||
* sdk.admin.draftOrder.addShippingMethod("order_123", {
|
||||
@@ -447,12 +456,13 @@ export class DraftOrder {
|
||||
|
||||
/**
|
||||
* This method updates a shipping method in a draft order. It sends a request to the
|
||||
* [Update Draft Order Shipping Method](https://docs.medusajs.com/api/admin#draft-orders_postordereditsidshipping-methodsaction_id) API route.
|
||||
* [Update Draft Order Shipping Method](https://docs.medusajs.com/api/admin#draft-orders_postdraftordersideditshippingmethodsaction_id) API route.
|
||||
*
|
||||
* @param id - The draft order's ID.
|
||||
* @param actionId - The action ID.
|
||||
* @param body - The data to update the shipping method.
|
||||
* @param headers - Headers to pass in the request.
|
||||
* @returns The draft order preview's details.
|
||||
*
|
||||
* @example
|
||||
* sdk.admin.draftOrder.updateShippingMethod("order_123", "action_123", {
|
||||
@@ -480,11 +490,12 @@ export class DraftOrder {
|
||||
|
||||
/**
|
||||
* This method removes a shipping method from a draft order. It sends a request to the
|
||||
* [Remove Draft Order Shipping Method](https://docs.medusajs.com/api/admin#draft-orders_deleteordereditsidshipping-methodsaction_id) API route.
|
||||
* [Remove Draft Order Shipping Method](https://docs.medusajs.com/api/admin#draft-orders_deletedraftordersideditshippingmethodsaction_id) API route.
|
||||
*
|
||||
* @param id - The draft order's ID.
|
||||
* @param actionId - The action ID.
|
||||
* @param headers - Headers to pass in the request.
|
||||
* @returns The draft order preview's details.
|
||||
*
|
||||
* @example
|
||||
* sdk.admin.draftOrder.removeShippingMethod("order_123", "action_123")
|
||||
@@ -506,6 +517,24 @@ export class DraftOrder {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* This method removes a shipping method from an edited draft order. It sends a request to the
|
||||
* [Remove Draft Order Shipping Method](https://docs.medusajs.com/api/admin#draft-orders_deletedraftordersideditshippingmethodsmethodmethod_id) API route.
|
||||
*
|
||||
* @param id - The draft order's ID.
|
||||
* @param shippingMethodId - The shipping method's ID.
|
||||
* @param headers - Headers to pass in the request.
|
||||
* @returns The draft order preview's details.
|
||||
*
|
||||
* @example
|
||||
* sdk.admin.draftOrder.removeShippingMethod(
|
||||
* "order_123",
|
||||
* "shipping_method_123"
|
||||
* )
|
||||
* .then(({ draft_order_preview }) => {
|
||||
* console.log(draft_order_preview)
|
||||
* })
|
||||
*/
|
||||
async removeShippingMethod(
|
||||
id: string,
|
||||
shippingMethodId: string,
|
||||
@@ -522,7 +551,7 @@ export class DraftOrder {
|
||||
|
||||
/**
|
||||
* This method updates a shipping method in a draft order. It sends a request to the
|
||||
* [Update Draft Order Shipping Method](https://docs.medusajs.com/api/admin#draft-orders_postordereditsidshipping-methodsaction_id) API route.
|
||||
* [Update Draft Order Shipping Method](https://docs.medusajs.com/api/admin#draft-orders_postdraftordersideditshippingmethodsmethodmethod_id) API route.
|
||||
*
|
||||
* @param id - The draft order's ID.
|
||||
* @param methodId - The shipping method's ID.
|
||||
@@ -555,7 +584,7 @@ export class DraftOrder {
|
||||
}
|
||||
/**
|
||||
* This method begins an edit to a draft order. It sends a request to the
|
||||
* [Begin Draft Order Edit](https://docs.medusajs.com/api/admin#draft-orders_postordereditsid) API route.
|
||||
* [Begin Draft Order Edit](https://docs.medusajs.com/api/admin#draft-orders_postdraftordersidedit) API route.
|
||||
*
|
||||
* @param id - The draft order's ID.
|
||||
* @param headers - Headers to pass in the request.
|
||||
@@ -578,10 +607,11 @@ export class DraftOrder {
|
||||
|
||||
/**
|
||||
* This method cancels an edit to a draft order. It sends a request to the
|
||||
* [Cancel Draft Order Edit](https://docs.medusajs.com/api/admin#draft-orders_deleteordereditsid) API route.
|
||||
* [Cancel Draft Order Edit](https://docs.medusajs.com/api/admin#draft-orders_deletedraftordersidedit) API route.
|
||||
*
|
||||
* @param id - The draft order's ID.
|
||||
* @param headers - Headers to pass in the request.
|
||||
* @returns The cancelation's details.
|
||||
*
|
||||
* @example
|
||||
* sdk.admin.draftOrder.cancelEdit("order_123")
|
||||
@@ -600,10 +630,11 @@ export class DraftOrder {
|
||||
|
||||
/**
|
||||
* This method requests an edit to a draft order. It sends a request to the
|
||||
* [Request Draft Order Edit](https://docs.medusajs.com/api/admin#draft-orders_postordereditsidrequest) API route.
|
||||
* [Request Draft Order Edit](https://docs.medusajs.com/api/admin#draft-orders_postdraftordersideditrequest) API route.
|
||||
*
|
||||
* @param id - The draft order's ID.
|
||||
* @param headers - Headers to pass in the request.
|
||||
* @returns The draft order preview's details.
|
||||
*
|
||||
* @example
|
||||
* sdk.admin.draftOrder.requestEdit("order_123")
|
||||
@@ -623,10 +654,11 @@ export class DraftOrder {
|
||||
|
||||
/**
|
||||
* This method confirms an edit to a draft order. It sends a request to the
|
||||
* [Confirm Draft Order Edit](https://docs.medusajs.com/api/admin#draft-orders_postordereditsidconfirm) API route.
|
||||
* [Confirm Draft Order Edit](https://docs.medusajs.com/api/admin#draft-orders_postdraftordersideditconfirm) API route.
|
||||
*
|
||||
* @param id - The draft order's ID.
|
||||
* @param headers - Headers to pass in the request.
|
||||
* @returns The draft order preview's details.
|
||||
*
|
||||
* @example
|
||||
* sdk.admin.draftOrder.confirmEdit("order_123")
|
||||
|
||||
Reference in New Issue
Block a user