@medusajs/js-sdk 2.0.1 → 2.0.2-snapshot-20241104135243
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/admin/notification.d.ts +80 -0
- package/dist/admin/notification.d.ts.map +1 -1
- package/dist/admin/notification.js +80 -0
- package/dist/admin/notification.js.map +1 -1
- package/dist/admin/order-edit.d.ts +166 -1
- package/dist/admin/order-edit.d.ts.map +1 -1
- package/dist/admin/order-edit.js +165 -0
- package/dist/admin/order-edit.js.map +1 -1
- package/dist/admin/order.d.ts +248 -22
- package/dist/admin/order.d.ts.map +1 -1
- package/dist/admin/order.js +240 -0
- package/dist/admin/order.js.map +1 -1
- package/dist/admin/payment-collection.d.ts +55 -0
- package/dist/admin/payment-collection.d.ts.map +1 -1
- package/dist/admin/payment-collection.js +55 -0
- package/dist/admin/payment-collection.js.map +1 -1
- package/dist/admin/payment.d.ts +162 -1
- package/dist/admin/payment.d.ts.map +1 -1
- package/dist/admin/payment.js +161 -0
- package/dist/admin/payment.js.map +1 -1
- package/dist/esm/admin/notification.d.ts +80 -0
- package/dist/esm/admin/notification.d.ts.map +1 -1
- package/dist/esm/admin/notification.js +80 -0
- package/dist/esm/admin/notification.js.map +1 -1
- package/dist/esm/admin/order-edit.d.ts +166 -1
- package/dist/esm/admin/order-edit.d.ts.map +1 -1
- package/dist/esm/admin/order-edit.js +165 -0
- package/dist/esm/admin/order-edit.js.map +1 -1
- package/dist/esm/admin/order.d.ts +248 -22
- package/dist/esm/admin/order.d.ts.map +1 -1
- package/dist/esm/admin/order.js +240 -0
- package/dist/esm/admin/order.js.map +1 -1
- package/dist/esm/admin/payment-collection.d.ts +55 -0
- package/dist/esm/admin/payment-collection.d.ts.map +1 -1
- package/dist/esm/admin/payment-collection.js +55 -0
- package/dist/esm/admin/payment-collection.js.map +1 -1
- package/dist/esm/admin/payment.d.ts +162 -1
- package/dist/esm/admin/payment.d.ts.map +1 -1
- package/dist/esm/admin/payment.js +161 -0
- package/dist/esm/admin/payment.js.map +1 -1
- package/package.json +2 -2
@@ -10,13 +10,178 @@ export declare class OrderEdit {
|
|
10
10
|
* @ignore
|
11
11
|
*/
|
12
12
|
constructor(client: Client);
|
13
|
-
|
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;
|
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;IAI1B;;;;;;;;;;;;;;;;;OAiBG;IACG,eAAe,CACnB,IAAI,EAAE,SAAS,CAAC,6BAA6B,EAC7C,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,EAC9B,OAAO,CAAC,EAAE,aAAa;IAazB;;;;;;;;;;;;;;;OAeG;IACG,OAAO,CACX,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,EAC9B,OAAO,CAAC,EAAE,aAAa;IAYzB;;;;;;;;;;;;;;;OAeG;IACG,OAAO,CACX,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,EAC9B,OAAO,CAAC,EAAE,aAAa;IAYzB;;;;;;;;;;;;;;;OAeG;IACG,aAAa,CACjB,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,EAC9B,OAAO,CAAC,EAAE,aAAa;IAYzB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,QAAQ,CACZ,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,SAAS,CAAC,sBAAsB,EACtC,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,EAC9B,OAAO,CAAC,EAAE,aAAa;IAazB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,kBAAkB,CACtB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,CAAC,wBAAwB,EACxC,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,EAC9B,OAAO,CAAC,EAAE,aAAa;IAazB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,eAAe,CACnB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,SAAS,CAAC,wBAAwB,EACxC,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,EAC9B,OAAO,CAAC,EAAE,aAAa;IAazB;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,eAAe,CACnB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,EAC9B,OAAO,CAAC,EAAE,aAAa;CAW1B"}
|
@@ -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;
|
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;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;OAeG;IACG,aAAa,CACjB,EAAU,EACV,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,sBAAsB,EAAE,EAAE,EAC1B;gBACE,MAAM,EAAE,QAAQ;gBAChB,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,QAAQ,CACZ,EAAU,EACV,IAAsC,EACtC,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,sBAAsB,EAAE,QAAQ,EAChC;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,kBAAkB,CACtB,EAAU,EACV,MAAc,EACd,IAAwC,EACxC,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,sBAAsB,EAAE,eAAe,MAAM,EAAE,EAC/C;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,eAAe,CACnB,EAAU,EACV,QAAgB,EAChB,IAAwC,EACxC,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,sBAAsB,EAAE,UAAU,QAAQ,EAAE,EAC5C;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,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"}
|