@medusajs/js-sdk 1.0.0-rc-20241016093905 → 1.0.0-rc-20241022152047
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/admin/api-key.d.ts +150 -1
- package/dist/admin/api-key.d.ts.map +1 -1
- package/dist/admin/api-key.js +146 -0
- package/dist/admin/api-key.js.map +1 -1
- package/dist/admin/campaign.d.ts +141 -0
- package/dist/admin/campaign.d.ts.map +1 -1
- package/dist/admin/campaign.js +138 -0
- package/dist/admin/campaign.js.map +1 -1
- package/dist/admin/claim.d.ts +548 -20
- package/dist/admin/claim.d.ts.map +1 -1
- package/dist/admin/claim.js +526 -7
- package/dist/admin/claim.js.map +1 -1
- package/dist/admin/currency.d.ts +86 -1
- package/dist/admin/currency.d.ts.map +1 -1
- package/dist/admin/currency.js +84 -2
- package/dist/admin/currency.js.map +1 -1
- package/dist/admin/customer-group.d.ts +158 -2
- package/dist/admin/customer-group.d.ts.map +1 -1
- package/dist/admin/customer-group.js +153 -0
- package/dist/admin/customer-group.js.map +1 -1
- package/dist/admin/customer.d.ts +141 -13
- package/dist/admin/customer.d.ts.map +1 -1
- package/dist/admin/customer.js +133 -0
- package/dist/admin/customer.js.map +1 -1
- package/dist/admin/exchange.d.ts +477 -20
- package/dist/admin/exchange.d.ts.map +1 -1
- package/dist/admin/exchange.js +458 -30
- package/dist/admin/exchange.js.map +1 -1
- package/dist/admin/fulfillment-provider.d.ts +53 -0
- package/dist/admin/fulfillment-provider.d.ts.map +1 -1
- package/dist/admin/fulfillment-provider.js +50 -0
- package/dist/admin/fulfillment-provider.js.map +1 -1
- package/dist/admin/fulfillment-set.d.ts +128 -0
- package/dist/admin/fulfillment-set.d.ts.map +1 -1
- package/dist/admin/fulfillment-set.js +125 -0
- package/dist/admin/fulfillment-set.js.map +1 -1
- package/dist/admin/fulfillment.d.ts +80 -0
- package/dist/admin/fulfillment.d.ts.map +1 -1
- package/dist/admin/fulfillment.js +78 -0
- package/dist/admin/fulfillment.js.map +1 -1
- package/dist/admin/inventory-item.d.ts +258 -1
- package/dist/admin/inventory-item.d.ts.map +1 -1
- package/dist/admin/inventory-item.js +254 -0
- package/dist/admin/inventory-item.js.map +1 -1
- package/dist/admin/invite.d.ts +176 -15
- package/dist/admin/invite.d.ts.map +1 -1
- package/dist/admin/invite.js +165 -0
- package/dist/admin/invite.js.map +1 -1
- package/dist/admin/notification.d.ts +6 -0
- package/dist/admin/notification.d.ts.map +1 -1
- package/dist/admin/notification.js +3 -0
- package/dist/admin/notification.js.map +1 -1
- package/dist/admin/order-edit.d.ts +6 -0
- package/dist/admin/order-edit.d.ts.map +1 -1
- package/dist/admin/order-edit.js +3 -0
- package/dist/admin/order-edit.js.map +1 -1
- package/dist/admin/order.d.ts +7 -0
- package/dist/admin/order.d.ts.map +1 -1
- package/dist/admin/order.js +9 -0
- package/dist/admin/order.js.map +1 -1
- package/dist/admin/payment-collection.d.ts +6 -0
- package/dist/admin/payment-collection.d.ts.map +1 -1
- package/dist/admin/payment-collection.js +3 -0
- package/dist/admin/payment-collection.js.map +1 -1
- package/dist/admin/payment.d.ts +6 -0
- package/dist/admin/payment.d.ts.map +1 -1
- package/dist/admin/payment.js +3 -0
- package/dist/admin/payment.js.map +1 -1
- package/dist/admin/price-list.d.ts +6 -0
- package/dist/admin/price-list.d.ts.map +1 -1
- package/dist/admin/price-list.js +3 -0
- package/dist/admin/price-list.js.map +1 -1
- package/dist/admin/price-preference.d.ts +6 -0
- package/dist/admin/price-preference.d.ts.map +1 -1
- package/dist/admin/price-preference.js +3 -0
- package/dist/admin/price-preference.js.map +1 -1
- package/dist/admin/product-category.d.ts +6 -0
- package/dist/admin/product-category.d.ts.map +1 -1
- package/dist/admin/product-category.js +3 -0
- package/dist/admin/product-category.js.map +1 -1
- package/dist/admin/product-collection.d.ts +6 -0
- package/dist/admin/product-collection.d.ts.map +1 -1
- package/dist/admin/product-collection.js +3 -0
- package/dist/admin/product-collection.js.map +1 -1
- package/dist/admin/product-tag.d.ts +6 -0
- package/dist/admin/product-tag.d.ts.map +1 -1
- package/dist/admin/product-tag.js +3 -0
- package/dist/admin/product-tag.js.map +1 -1
- package/dist/admin/product-type.d.ts +6 -0
- package/dist/admin/product-type.d.ts.map +1 -1
- package/dist/admin/product-type.js +3 -0
- package/dist/admin/product-type.js.map +1 -1
- package/dist/admin/product-variant.d.ts +6 -0
- package/dist/admin/product-variant.d.ts.map +1 -1
- package/dist/admin/product-variant.js +3 -0
- package/dist/admin/product-variant.js.map +1 -1
- package/dist/admin/product.d.ts +6 -0
- package/dist/admin/product.d.ts.map +1 -1
- package/dist/admin/product.js +3 -0
- package/dist/admin/product.js.map +1 -1
- package/dist/admin/promotion.d.ts +6 -0
- package/dist/admin/promotion.d.ts.map +1 -1
- package/dist/admin/promotion.js +3 -0
- package/dist/admin/promotion.js.map +1 -1
- package/dist/admin/refund-reasons.d.ts +6 -0
- package/dist/admin/refund-reasons.d.ts.map +1 -1
- package/dist/admin/refund-reasons.js +3 -0
- package/dist/admin/refund-reasons.js.map +1 -1
- package/dist/admin/region.d.ts +6 -0
- package/dist/admin/region.d.ts.map +1 -1
- package/dist/admin/region.js +3 -0
- package/dist/admin/region.js.map +1 -1
- package/dist/admin/reservation.d.ts +6 -0
- package/dist/admin/reservation.d.ts.map +1 -1
- package/dist/admin/reservation.js +3 -0
- package/dist/admin/reservation.js.map +1 -1
- package/dist/admin/return-reason.d.ts +6 -0
- package/dist/admin/return-reason.d.ts.map +1 -1
- package/dist/admin/return-reason.js +3 -0
- package/dist/admin/return-reason.js.map +1 -1
- package/dist/admin/return.d.ts +6 -0
- package/dist/admin/return.d.ts.map +1 -1
- package/dist/admin/return.js +3 -0
- package/dist/admin/return.js.map +1 -1
- package/dist/admin/sales-channel.d.ts +6 -0
- package/dist/admin/sales-channel.d.ts.map +1 -1
- package/dist/admin/sales-channel.js +3 -0
- package/dist/admin/sales-channel.js.map +1 -1
- package/dist/admin/shipping-option.d.ts +6 -0
- package/dist/admin/shipping-option.d.ts.map +1 -1
- package/dist/admin/shipping-option.js +3 -0
- package/dist/admin/shipping-option.js.map +1 -1
- package/dist/admin/shipping-profile.d.ts +6 -0
- package/dist/admin/shipping-profile.d.ts.map +1 -1
- package/dist/admin/shipping-profile.js +3 -0
- package/dist/admin/shipping-profile.js.map +1 -1
- package/dist/admin/stock-location.d.ts +6 -0
- package/dist/admin/stock-location.d.ts.map +1 -1
- package/dist/admin/stock-location.js +3 -0
- package/dist/admin/stock-location.js.map +1 -1
- package/dist/admin/store.d.ts +6 -0
- package/dist/admin/store.d.ts.map +1 -1
- package/dist/admin/store.js +3 -0
- package/dist/admin/store.js.map +1 -1
- package/dist/admin/tax-rate.d.ts +6 -0
- package/dist/admin/tax-rate.d.ts.map +1 -1
- package/dist/admin/tax-rate.js +3 -0
- package/dist/admin/tax-rate.js.map +1 -1
- package/dist/admin/tax-region.d.ts +6 -0
- package/dist/admin/tax-region.d.ts.map +1 -1
- package/dist/admin/tax-region.js +3 -0
- package/dist/admin/tax-region.js.map +1 -1
- package/dist/admin/upload.d.ts +6 -0
- package/dist/admin/upload.d.ts.map +1 -1
- package/dist/admin/upload.js +3 -0
- package/dist/admin/upload.js.map +1 -1
- package/dist/admin/user.d.ts +6 -0
- package/dist/admin/user.d.ts.map +1 -1
- package/dist/admin/user.js +3 -0
- package/dist/admin/user.js.map +1 -1
- package/dist/admin/workflow-execution.d.ts +6 -0
- package/dist/admin/workflow-execution.d.ts.map +1 -1
- package/dist/admin/workflow-execution.js +3 -0
- package/dist/admin/workflow-execution.js.map +1 -1
- package/dist/auth/index.d.ts +156 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +152 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2 -1
- package/dist/client.js.map +1 -1
- package/dist/esm/admin/api-key.d.ts +150 -1
- package/dist/esm/admin/api-key.d.ts.map +1 -1
- package/dist/esm/admin/api-key.js +146 -0
- package/dist/esm/admin/api-key.js.map +1 -1
- package/dist/esm/admin/campaign.d.ts +141 -0
- package/dist/esm/admin/campaign.d.ts.map +1 -1
- package/dist/esm/admin/campaign.js +138 -0
- package/dist/esm/admin/campaign.js.map +1 -1
- package/dist/esm/admin/claim.d.ts +548 -20
- package/dist/esm/admin/claim.d.ts.map +1 -1
- package/dist/esm/admin/claim.js +526 -9
- package/dist/esm/admin/claim.js.map +1 -1
- package/dist/esm/admin/currency.d.ts +86 -1
- package/dist/esm/admin/currency.d.ts.map +1 -1
- package/dist/esm/admin/currency.js +84 -2
- package/dist/esm/admin/currency.js.map +1 -1
- package/dist/esm/admin/customer-group.d.ts +158 -2
- package/dist/esm/admin/customer-group.d.ts.map +1 -1
- package/dist/esm/admin/customer-group.js +153 -0
- package/dist/esm/admin/customer-group.js.map +1 -1
- package/dist/esm/admin/customer.d.ts +141 -13
- package/dist/esm/admin/customer.d.ts.map +1 -1
- package/dist/esm/admin/customer.js +133 -0
- package/dist/esm/admin/customer.js.map +1 -1
- package/dist/esm/admin/exchange.d.ts +477 -20
- package/dist/esm/admin/exchange.d.ts.map +1 -1
- package/dist/esm/admin/exchange.js +458 -38
- package/dist/esm/admin/exchange.js.map +1 -1
- package/dist/esm/admin/fulfillment-provider.d.ts +53 -0
- package/dist/esm/admin/fulfillment-provider.d.ts.map +1 -1
- package/dist/esm/admin/fulfillment-provider.js +50 -0
- package/dist/esm/admin/fulfillment-provider.js.map +1 -1
- package/dist/esm/admin/fulfillment-set.d.ts +128 -0
- package/dist/esm/admin/fulfillment-set.d.ts.map +1 -1
- package/dist/esm/admin/fulfillment-set.js +125 -0
- package/dist/esm/admin/fulfillment-set.js.map +1 -1
- package/dist/esm/admin/fulfillment.d.ts +80 -0
- package/dist/esm/admin/fulfillment.d.ts.map +1 -1
- package/dist/esm/admin/fulfillment.js +78 -0
- package/dist/esm/admin/fulfillment.js.map +1 -1
- package/dist/esm/admin/inventory-item.d.ts +258 -1
- package/dist/esm/admin/inventory-item.d.ts.map +1 -1
- package/dist/esm/admin/inventory-item.js +254 -0
- package/dist/esm/admin/inventory-item.js.map +1 -1
- package/dist/esm/admin/invite.d.ts +176 -15
- package/dist/esm/admin/invite.d.ts.map +1 -1
- package/dist/esm/admin/invite.js +165 -0
- package/dist/esm/admin/invite.js.map +1 -1
- package/dist/esm/admin/notification.d.ts +6 -0
- package/dist/esm/admin/notification.d.ts.map +1 -1
- package/dist/esm/admin/notification.js +3 -0
- package/dist/esm/admin/notification.js.map +1 -1
- package/dist/esm/admin/order-edit.d.ts +6 -0
- package/dist/esm/admin/order-edit.d.ts.map +1 -1
- package/dist/esm/admin/order-edit.js +3 -0
- package/dist/esm/admin/order-edit.js.map +1 -1
- package/dist/esm/admin/order.d.ts +7 -0
- package/dist/esm/admin/order.d.ts.map +1 -1
- package/dist/esm/admin/order.js +11 -0
- package/dist/esm/admin/order.js.map +1 -1
- package/dist/esm/admin/payment-collection.d.ts +6 -0
- package/dist/esm/admin/payment-collection.d.ts.map +1 -1
- package/dist/esm/admin/payment-collection.js +3 -0
- package/dist/esm/admin/payment-collection.js.map +1 -1
- package/dist/esm/admin/payment.d.ts +6 -0
- package/dist/esm/admin/payment.d.ts.map +1 -1
- package/dist/esm/admin/payment.js +3 -0
- package/dist/esm/admin/payment.js.map +1 -1
- package/dist/esm/admin/price-list.d.ts +6 -0
- package/dist/esm/admin/price-list.d.ts.map +1 -1
- package/dist/esm/admin/price-list.js +3 -0
- package/dist/esm/admin/price-list.js.map +1 -1
- package/dist/esm/admin/price-preference.d.ts +6 -0
- package/dist/esm/admin/price-preference.d.ts.map +1 -1
- package/dist/esm/admin/price-preference.js +3 -0
- package/dist/esm/admin/price-preference.js.map +1 -1
- package/dist/esm/admin/product-category.d.ts +6 -0
- package/dist/esm/admin/product-category.d.ts.map +1 -1
- package/dist/esm/admin/product-category.js +3 -0
- package/dist/esm/admin/product-category.js.map +1 -1
- package/dist/esm/admin/product-collection.d.ts +6 -0
- package/dist/esm/admin/product-collection.d.ts.map +1 -1
- package/dist/esm/admin/product-collection.js +3 -0
- package/dist/esm/admin/product-collection.js.map +1 -1
- package/dist/esm/admin/product-tag.d.ts +6 -0
- package/dist/esm/admin/product-tag.d.ts.map +1 -1
- package/dist/esm/admin/product-tag.js +3 -0
- package/dist/esm/admin/product-tag.js.map +1 -1
- package/dist/esm/admin/product-type.d.ts +6 -0
- package/dist/esm/admin/product-type.d.ts.map +1 -1
- package/dist/esm/admin/product-type.js +3 -0
- package/dist/esm/admin/product-type.js.map +1 -1
- package/dist/esm/admin/product-variant.d.ts +6 -0
- package/dist/esm/admin/product-variant.d.ts.map +1 -1
- package/dist/esm/admin/product-variant.js +3 -0
- package/dist/esm/admin/product-variant.js.map +1 -1
- package/dist/esm/admin/product.d.ts +6 -0
- package/dist/esm/admin/product.d.ts.map +1 -1
- package/dist/esm/admin/product.js +3 -0
- package/dist/esm/admin/product.js.map +1 -1
- package/dist/esm/admin/promotion.d.ts +6 -0
- package/dist/esm/admin/promotion.d.ts.map +1 -1
- package/dist/esm/admin/promotion.js +3 -0
- package/dist/esm/admin/promotion.js.map +1 -1
- package/dist/esm/admin/refund-reasons.d.ts +6 -0
- package/dist/esm/admin/refund-reasons.d.ts.map +1 -1
- package/dist/esm/admin/refund-reasons.js +3 -0
- package/dist/esm/admin/refund-reasons.js.map +1 -1
- package/dist/esm/admin/region.d.ts +6 -0
- package/dist/esm/admin/region.d.ts.map +1 -1
- package/dist/esm/admin/region.js +3 -0
- package/dist/esm/admin/region.js.map +1 -1
- package/dist/esm/admin/reservation.d.ts +6 -0
- package/dist/esm/admin/reservation.d.ts.map +1 -1
- package/dist/esm/admin/reservation.js +3 -0
- package/dist/esm/admin/reservation.js.map +1 -1
- package/dist/esm/admin/return-reason.d.ts +6 -0
- package/dist/esm/admin/return-reason.d.ts.map +1 -1
- package/dist/esm/admin/return-reason.js +3 -0
- package/dist/esm/admin/return-reason.js.map +1 -1
- package/dist/esm/admin/return.d.ts +6 -0
- package/dist/esm/admin/return.d.ts.map +1 -1
- package/dist/esm/admin/return.js +3 -0
- package/dist/esm/admin/return.js.map +1 -1
- package/dist/esm/admin/sales-channel.d.ts +6 -0
- package/dist/esm/admin/sales-channel.d.ts.map +1 -1
- package/dist/esm/admin/sales-channel.js +3 -0
- package/dist/esm/admin/sales-channel.js.map +1 -1
- package/dist/esm/admin/shipping-option.d.ts +6 -0
- package/dist/esm/admin/shipping-option.d.ts.map +1 -1
- package/dist/esm/admin/shipping-option.js +3 -0
- package/dist/esm/admin/shipping-option.js.map +1 -1
- package/dist/esm/admin/shipping-profile.d.ts +6 -0
- package/dist/esm/admin/shipping-profile.d.ts.map +1 -1
- package/dist/esm/admin/shipping-profile.js +3 -0
- package/dist/esm/admin/shipping-profile.js.map +1 -1
- package/dist/esm/admin/stock-location.d.ts +6 -0
- package/dist/esm/admin/stock-location.d.ts.map +1 -1
- package/dist/esm/admin/stock-location.js +3 -0
- package/dist/esm/admin/stock-location.js.map +1 -1
- package/dist/esm/admin/store.d.ts +6 -0
- package/dist/esm/admin/store.d.ts.map +1 -1
- package/dist/esm/admin/store.js +3 -0
- package/dist/esm/admin/store.js.map +1 -1
- package/dist/esm/admin/tax-rate.d.ts +6 -0
- package/dist/esm/admin/tax-rate.d.ts.map +1 -1
- package/dist/esm/admin/tax-rate.js +3 -0
- package/dist/esm/admin/tax-rate.js.map +1 -1
- package/dist/esm/admin/tax-region.d.ts +6 -0
- package/dist/esm/admin/tax-region.d.ts.map +1 -1
- package/dist/esm/admin/tax-region.js +3 -0
- package/dist/esm/admin/tax-region.js.map +1 -1
- package/dist/esm/admin/upload.d.ts +6 -0
- package/dist/esm/admin/upload.d.ts.map +1 -1
- package/dist/esm/admin/upload.js +3 -0
- package/dist/esm/admin/upload.js.map +1 -1
- package/dist/esm/admin/user.d.ts +6 -0
- package/dist/esm/admin/user.d.ts.map +1 -1
- package/dist/esm/admin/user.js +3 -0
- package/dist/esm/admin/user.js.map +1 -1
- package/dist/esm/admin/workflow-execution.d.ts +6 -0
- package/dist/esm/admin/workflow-execution.d.ts.map +1 -1
- package/dist/esm/admin/workflow-execution.js +3 -0
- package/dist/esm/admin/workflow-execution.js.map +1 -1
- package/dist/esm/auth/index.d.ts +156 -0
- package/dist/esm/auth/index.d.ts.map +1 -1
- package/dist/esm/auth/index.js +152 -1
- package/dist/esm/auth/index.js.map +1 -1
- package/dist/esm/client.d.ts +1 -1
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/client.js +2 -1
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/store/index.d.ts +973 -83
- package/dist/esm/store/index.d.ts.map +1 -1
- package/dist/esm/store/index.js +946 -0
- package/dist/esm/store/index.js.map +1 -1
- package/dist/esm/types.d.ts +6 -1
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/store/index.d.ts +973 -83
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +946 -0
- package/dist/store/index.js.map +1 -1
- package/dist/types.d.ts +6 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/admin/claim.js
CHANGED
@@ -2,21 +2,120 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.Claim = void 0;
|
4
4
|
class Claim {
|
5
|
+
/**
|
6
|
+
* @ignore
|
7
|
+
*/
|
5
8
|
constructor(client) {
|
6
9
|
this.client = client;
|
7
10
|
}
|
11
|
+
/**
|
12
|
+
* This method retrieves a paginated list of claims. It sends a request to the
|
13
|
+
* [List Claims](https://docs.medusajs.com/v2/api/admin#claims_getclaims) API route.
|
14
|
+
*
|
15
|
+
* @param query - Filters and pagination configurations.
|
16
|
+
* @param headers - Headers to pass in the request.
|
17
|
+
* @returns The paginated list of claims.
|
18
|
+
*
|
19
|
+
* @example
|
20
|
+
* To retrieve the list of claims:
|
21
|
+
*
|
22
|
+
* ```ts
|
23
|
+
* sdk.admin.claim.list()
|
24
|
+
* .then(({ claims, count, limit, offset }) => {
|
25
|
+
* console.log(claims)
|
26
|
+
* })
|
27
|
+
* ```
|
28
|
+
*
|
29
|
+
* To configure the pagination, pass the `limit` and `offset` query parameters.
|
30
|
+
*
|
31
|
+
* For example, to retrieve only 10 items and skip 10 items:
|
32
|
+
*
|
33
|
+
* ```ts
|
34
|
+
* sdk.admin.claim.list({
|
35
|
+
* limit: 10,
|
36
|
+
* offset: 10
|
37
|
+
* })
|
38
|
+
* .then(({ claims, count, limit, offset }) => {
|
39
|
+
* console.log(claims)
|
40
|
+
* })
|
41
|
+
* ```
|
42
|
+
*
|
43
|
+
* Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
44
|
+
* in each claim:
|
45
|
+
*
|
46
|
+
* ```ts
|
47
|
+
* sdk.admin.claim.list({
|
48
|
+
* fields: "id,*additional_items"
|
49
|
+
* })
|
50
|
+
* .then(({ claims, count, limit, offset }) => {
|
51
|
+
* console.log(claims)
|
52
|
+
* })
|
53
|
+
* ```
|
54
|
+
*
|
55
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
|
56
|
+
*/
|
8
57
|
async list(query, headers) {
|
9
58
|
return await this.client.fetch(`/admin/claims`, {
|
10
59
|
query,
|
11
60
|
headers,
|
12
61
|
});
|
13
62
|
}
|
63
|
+
/**
|
64
|
+
* This method retrieves a claim. It sends a request to the
|
65
|
+
* [Get Claim](https://docs.medusajs.com/v2/api/admin#claims_getclaimsid) API route.
|
66
|
+
*
|
67
|
+
* @param id - The claim's ID.
|
68
|
+
* @param query - Configure the fields to retrieve in the claim.
|
69
|
+
* @param headers - Headers to pass in the request
|
70
|
+
* @returns The claim's details.
|
71
|
+
*
|
72
|
+
* @example
|
73
|
+
* To retrieve a claim by its ID:
|
74
|
+
*
|
75
|
+
* ```ts
|
76
|
+
* sdk.admin.claim.retrieve("claim_123")
|
77
|
+
* .then(({ claim }) => {
|
78
|
+
* console.log(claim)
|
79
|
+
* })
|
80
|
+
* ```
|
81
|
+
*
|
82
|
+
* To specify the fields and relations to retrieve:
|
83
|
+
*
|
84
|
+
* ```ts
|
85
|
+
* sdk.admin.claim.retrieve("claim_123", {
|
86
|
+
* fields: "id,*additional_items"
|
87
|
+
* })
|
88
|
+
* .then(({ claim }) => {
|
89
|
+
* console.log(claim)
|
90
|
+
* })
|
91
|
+
* ```
|
92
|
+
*
|
93
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
|
94
|
+
*/
|
14
95
|
async retrieve(id, query, headers) {
|
15
96
|
return await this.client.fetch(`/admin/claims/${id}`, {
|
16
97
|
query,
|
17
98
|
headers,
|
18
99
|
});
|
19
100
|
}
|
101
|
+
/**
|
102
|
+
* This method creates a claim. It sends a request to the
|
103
|
+
* [Create Claim](https://docs.medusajs.com/v2/api/admin#claims_postclaims) API route.
|
104
|
+
*
|
105
|
+
* @param body - The claim's details.
|
106
|
+
* @param query - Configure the fields to retrieve in the claim.
|
107
|
+
* @param headers - Headers to pass in the request
|
108
|
+
* @returns The claim and order's details.
|
109
|
+
*
|
110
|
+
* @example
|
111
|
+
* sdk.admin.claim.create({
|
112
|
+
* type: "refund",
|
113
|
+
* order_id: "order_123",
|
114
|
+
* })
|
115
|
+
* .then(({ claim }) => {
|
116
|
+
* console.log(claim)
|
117
|
+
* })
|
118
|
+
*/
|
20
119
|
async create(body, query, headers) {
|
21
120
|
return await this.client.fetch(`/admin/claims`, {
|
22
121
|
method: "POST",
|
@@ -25,6 +124,21 @@ class Claim {
|
|
25
124
|
query,
|
26
125
|
});
|
27
126
|
}
|
127
|
+
/**
|
128
|
+
* This method cancels a claim. It sends a request to the
|
129
|
+
* [Cancel Claim](https://docs.medusajs.com/v2/api/admin#claims_postclaimsidcancel) API route.
|
130
|
+
*
|
131
|
+
* @param id - The claim's ID.
|
132
|
+
* @param query - Configure the fields to retrieve in the claim.
|
133
|
+
* @param headers - Headers to pass in the request
|
134
|
+
* @returns The claim's details.
|
135
|
+
*
|
136
|
+
* @example
|
137
|
+
* sdk.admin.claim.cancel("claim_123")
|
138
|
+
* .then(({ claim }) => {
|
139
|
+
* console.log(claim)
|
140
|
+
* })
|
141
|
+
*/
|
28
142
|
async cancel(id, query, headers) {
|
29
143
|
return await this.client.fetch(`/admin/claims/${id}/cancel`, {
|
30
144
|
method: "POST",
|
@@ -32,13 +146,29 @@ class Claim {
|
|
32
146
|
query,
|
33
147
|
});
|
34
148
|
}
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
149
|
+
/**
|
150
|
+
* This method adds items to the claim. It sends a request to the
|
151
|
+
* [Add Items](https://docs.medusajs.com/v2/api/admin#claims_postclaimsidclaimitems) API route.
|
152
|
+
*
|
153
|
+
* @param id - The ID of the claim to add the items to.
|
154
|
+
* @param body - The items' details.
|
155
|
+
* @param query - Configure the fields to retrieve in the claim.
|
156
|
+
* @param headers - Headers to pass in the request
|
157
|
+
* @returns The claim's details with a preview of the order when the claim is applied.
|
158
|
+
*
|
159
|
+
* @example
|
160
|
+
* sdk.admin.claim.addItems("claim_123", {
|
161
|
+
* items: [
|
162
|
+
* {
|
163
|
+
* id: "orli_123",
|
164
|
+
* quantity: 1
|
165
|
+
* }
|
166
|
+
* ]
|
167
|
+
* })
|
168
|
+
* .then(({ claim }) => {
|
169
|
+
* console.log(claim)
|
170
|
+
* })
|
171
|
+
*/
|
42
172
|
async addItems(id, body, query, headers) {
|
43
173
|
return await this.client.fetch(`/admin/claims/${id}/claim-items`, {
|
44
174
|
method: "POST",
|
@@ -47,6 +177,32 @@ class Claim {
|
|
47
177
|
query,
|
48
178
|
});
|
49
179
|
}
|
180
|
+
/**
|
181
|
+
* This method updates a claim item by the ID of the item's `WRITE_OFF_ITEM` action. It
|
182
|
+
* sends a request to the [Update Claim Item](https://docs.medusajs.com/v2/api/admin#claims_postclaimsidclaimitemsaction_id) API route.
|
183
|
+
*
|
184
|
+
* Every item has an `actions` property, whose value is an array of actions.
|
185
|
+
* You can check the action's name using its `action` property, and use the value of the `id` property.
|
186
|
+
*
|
187
|
+
* @param id - The claim's ID.
|
188
|
+
* @param actionId - The id of the order item's `WRITE_OFF_ITEM` action.
|
189
|
+
* @param body - The details to update.
|
190
|
+
* @param query - Configure the fields to retrieve in the claim.
|
191
|
+
* @param headers - Headers to pass in the request
|
192
|
+
* @returns The claim's details with a preview of the order when the claim is applied.
|
193
|
+
*
|
194
|
+
* @example
|
195
|
+
* sdk.admin.claim.updateItem(
|
196
|
+
* "claim_123",
|
197
|
+
* "ordchact_123",
|
198
|
+
* {
|
199
|
+
* quantity: 1
|
200
|
+
* }
|
201
|
+
* )
|
202
|
+
* .then(({ claim }) => {
|
203
|
+
* console.log(claim)
|
204
|
+
* })
|
205
|
+
*/
|
50
206
|
async updateItem(id, actionId, body, query, headers) {
|
51
207
|
return await this.client.fetch(`/admin/claims/${id}/claim-items/${actionId}`, {
|
52
208
|
method: "POST",
|
@@ -55,6 +211,29 @@ class Claim {
|
|
55
211
|
query,
|
56
212
|
});
|
57
213
|
}
|
214
|
+
/**
|
215
|
+
* This method removes a claim item from a claim by the ID of the item's `WRITE_OFF_ITEM` action.
|
216
|
+
* It sends a request to the [Remove Claim Item](https://docs.medusajs.com/v2/api/admin#claims_deleteclaimsidclaimitemsaction_id)
|
217
|
+
* API route.
|
218
|
+
*
|
219
|
+
* Every item has an `actions` property, whose value is an array of actions.
|
220
|
+
* You can check the action's name using its `action` property, and use the value of the `id` property.
|
221
|
+
*
|
222
|
+
* @param id - The claim's ID.
|
223
|
+
* @param actionId - The id of the order item's `WRITE_OFF_ITEM` action.
|
224
|
+
* @param query - Configure the fields to retrieve in the claim.
|
225
|
+
* @param headers - Headers to pass in the request
|
226
|
+
* @returns The claim's details with a preview of the order when the claim is applied.
|
227
|
+
*
|
228
|
+
* @example
|
229
|
+
* sdk.admin.claim.removeItem(
|
230
|
+
* "claim_123",
|
231
|
+
* "ordchact_123",
|
232
|
+
* )
|
233
|
+
* .then(({ claim }) => {
|
234
|
+
* console.log(claim)
|
235
|
+
* })
|
236
|
+
*/
|
58
237
|
async removeItem(id, actionId, query, headers) {
|
59
238
|
return await this.client.fetch(`/admin/claims/${id}/claim-items/${actionId}`, {
|
60
239
|
method: "DELETE",
|
@@ -62,6 +241,34 @@ class Claim {
|
|
62
241
|
query,
|
63
242
|
});
|
64
243
|
}
|
244
|
+
/**
|
245
|
+
* This method adds inbound (or return) items to the claim. These inbound items will have a `RETURN_ITEM` action.
|
246
|
+
*
|
247
|
+
* This method sends a request to the [Add Inbound Items](https://docs.medusajs.com/v2/api/admin#claims_postclaimsidinbounditems)
|
248
|
+
* API route.
|
249
|
+
*
|
250
|
+
* @param id - The ID of the claim to add the inbound items to.
|
251
|
+
* @param body - The inbound items' details.
|
252
|
+
* @param query - Configure the fields to retrieve in the return.
|
253
|
+
* @param headers - Headers to pass in the request
|
254
|
+
* @returns The details of the return associated with the claim, with a preview of the order when the claim is applied.
|
255
|
+
*
|
256
|
+
* @example
|
257
|
+
* sdk.admin.claim.addInboundItems(
|
258
|
+
* "claim_123",
|
259
|
+
* {
|
260
|
+
* items: [
|
261
|
+
* {
|
262
|
+
* id: "orli_123",
|
263
|
+
* quantity: 1
|
264
|
+
* }
|
265
|
+
* ]
|
266
|
+
* },
|
267
|
+
* )
|
268
|
+
* .then(({ return: returnData }) => {
|
269
|
+
* console.log(returnData)
|
270
|
+
* })
|
271
|
+
*/
|
65
272
|
async addInboundItems(id, body, query, headers) {
|
66
273
|
return await this.client.fetch(`/admin/claims/${id}/inbound/items`, {
|
67
274
|
method: "POST",
|
@@ -70,6 +277,33 @@ class Claim {
|
|
70
277
|
query,
|
71
278
|
});
|
72
279
|
}
|
280
|
+
/**
|
281
|
+
* This method updates an inbound (or return) item of a claim using the ID of the item's `RETURN_ITEM` action.
|
282
|
+
* It sends a request to the [Update Inbound Item](https://docs.medusajs.com/v2/api/admin#claims_postclaimsidinbounditemsaction_id)
|
283
|
+
* API route.
|
284
|
+
*
|
285
|
+
* Every item has an `actions` property, whose value is an array of actions.
|
286
|
+
* You can check the action's name using its `action` property, and use the value of the `id` property.
|
287
|
+
*
|
288
|
+
* @param id - The claim's ID.
|
289
|
+
* @param actionId - The id of the return item's `RETURN_ITEM` action.
|
290
|
+
* @param body - The details to update in the inbound item.
|
291
|
+
* @param query - Configure the fields to retrieve in the return.
|
292
|
+
* @param headers - Headers to pass in the request
|
293
|
+
* @returns The details of the return associated wth the claim, with a preview of the order when the claim is applied.
|
294
|
+
*
|
295
|
+
* @example
|
296
|
+
* sdk.admin.claim.updateInboundItem(
|
297
|
+
* "claim_123",
|
298
|
+
* "ordchact_123",
|
299
|
+
* {
|
300
|
+
* quantity: 1
|
301
|
+
* },
|
302
|
+
* )
|
303
|
+
* .then(({ return: returnData }) => {
|
304
|
+
* console.log(returnData)
|
305
|
+
* })
|
306
|
+
*/
|
73
307
|
async updateInboundItem(id, actionId, body, query, headers) {
|
74
308
|
return await this.client.fetch(`/admin/claims/${id}/inbound/items/${actionId}`, {
|
75
309
|
method: "POST",
|
@@ -78,6 +312,29 @@ class Claim {
|
|
78
312
|
query,
|
79
313
|
});
|
80
314
|
}
|
315
|
+
/**
|
316
|
+
* This method removes an inbound (or return) item from a claim using the ID of the item's `RETURN_ITEM` action.
|
317
|
+
* It sends a request to the [Remove Inbound Item](https://docs.medusajs.com/v2/api/admin#claims_deleteclaimsidinbounditemsaction_id)
|
318
|
+
* API route.
|
319
|
+
*
|
320
|
+
* Every item has an `actions` property, whose value is an array of actions.
|
321
|
+
* You can check the action's name using its `action` property, and use the value of the `id` property.
|
322
|
+
*
|
323
|
+
* @param id - The claim's ID.
|
324
|
+
* @param actionId - The ID of the return item's `RETURN_ITEM` action.
|
325
|
+
* @param query - Configure the fields to retrieve in the return.
|
326
|
+
* @param headers - Headers to pass in the request
|
327
|
+
* @returns The details of the return associated wth the claim, with a preview of the order when the claim is applied.
|
328
|
+
*
|
329
|
+
* @example
|
330
|
+
* sdk.admin.claim.removeInboundItem(
|
331
|
+
* "claim_123",
|
332
|
+
* "ordchact_123",
|
333
|
+
* )
|
334
|
+
* .then(({ return: returnData }) => {
|
335
|
+
* console.log(returnData)
|
336
|
+
* })
|
337
|
+
*/
|
81
338
|
async removeInboundItem(id, actionId, query, headers) {
|
82
339
|
return await this.client.fetch(`/admin/claims/${id}/inbound/items/${actionId}`, {
|
83
340
|
method: "DELETE",
|
@@ -85,6 +342,31 @@ class Claim {
|
|
85
342
|
query,
|
86
343
|
});
|
87
344
|
}
|
345
|
+
/**
|
346
|
+
* This method adds an inbound (or return) shipping method to a claim.
|
347
|
+
* The inbound shipping method will have a `SHIPPING_ADD` action.
|
348
|
+
*
|
349
|
+
* This method sends a request to the [Add Inbound Shipping](https://docs.medusajs.com/v2/api/admin#claims_postclaimsidinboundshippingmethod)
|
350
|
+
* API route.
|
351
|
+
*
|
352
|
+
* @param id - The claim's ID.
|
353
|
+
* @param body - The shipping method's details.
|
354
|
+
* @param query - Configure the fields to retrieve in the return.
|
355
|
+
* @param headers - Headers to pass in the request
|
356
|
+
* @returns The details of the return associated wth the claim, with a preview of the order when the claim is applied.
|
357
|
+
*
|
358
|
+
* @example
|
359
|
+
* sdk.admin.claim.addInboundShipping(
|
360
|
+
* "claim_123",
|
361
|
+
* {
|
362
|
+
* shipping_option_id: "so_123",
|
363
|
+
* custom_amount: 10
|
364
|
+
* },
|
365
|
+
* )
|
366
|
+
* .then(({ return: returnData }) => {
|
367
|
+
* console.log(returnData)
|
368
|
+
* })
|
369
|
+
*/
|
88
370
|
async addInboundShipping(id, body, query, headers) {
|
89
371
|
return await this.client.fetch(`/admin/claims/${id}/inbound/shipping-method`, {
|
90
372
|
method: "POST",
|
@@ -93,6 +375,33 @@ class Claim {
|
|
93
375
|
query,
|
94
376
|
});
|
95
377
|
}
|
378
|
+
/**
|
379
|
+
* This method updates a shipping method for returning items in the claim using the ID of the method's `SHIPPING_ADD` action.
|
380
|
+
* It sends a request to the [Update Inbound Shipping](https://docs.medusajs.com/v2/api/admin#claims_postclaimsidinboundshippingmethodaction_id)
|
381
|
+
* API route.
|
382
|
+
*
|
383
|
+
* Every shipping method has an `actions` property, whose value is an array of actions.
|
384
|
+
* You can check the action's name using its `action` property, and use the value of the `id` property.
|
385
|
+
*
|
386
|
+
* @param id - The claim's ID.
|
387
|
+
* @param actionId - The id of the shipping method's `SHIPPING_ADD` action.
|
388
|
+
* @param body - The details to update in the shipping method
|
389
|
+
* @param query - Configure the fields to retrieve in the claim.
|
390
|
+
* @param headers - Headers to pass in the request
|
391
|
+
* @returns The details of the claim, with a preview of the order when the claim is applied.
|
392
|
+
*
|
393
|
+
* @example
|
394
|
+
* sdk.admin.claim.updateInboundShipping(
|
395
|
+
* "claim_123",
|
396
|
+
* "ordchact_123",
|
397
|
+
* {
|
398
|
+
* custom_amount: 10
|
399
|
+
* },
|
400
|
+
* )
|
401
|
+
* .then(({ claim }) => {
|
402
|
+
* console.log(claim)
|
403
|
+
* })
|
404
|
+
*/
|
96
405
|
async updateInboundShipping(id, actionId, body, query, headers) {
|
97
406
|
return await this.client.fetch(`/admin/claims/${id}/inbound/shipping-method/${actionId}`, {
|
98
407
|
method: "POST",
|
@@ -101,6 +410,29 @@ class Claim {
|
|
101
410
|
query,
|
102
411
|
});
|
103
412
|
}
|
413
|
+
/**
|
414
|
+
* This method deletes a shipping method for returning items in the claim using the ID of the method's `SHIPPING_ADD` action.
|
415
|
+
* It sends a request to the [Remove Inbound Shipping](https://docs.medusajs.com/v2/api/admin#claims_deleteclaimsidinboundshippingmethodaction_id)
|
416
|
+
* API route.
|
417
|
+
*
|
418
|
+
* Every shipping method has an `actions` property, whose value is an array of actions.
|
419
|
+
* You can check the action's name using its `action` property, and use the value of the `id` property.
|
420
|
+
*
|
421
|
+
* @param id - The claim's ID.
|
422
|
+
* @param actionId - The id of the shipping method's `SHIPPING_ADD` action.
|
423
|
+
* @param query - Configure the fields to retrieve in the return.
|
424
|
+
* @param headers - Headers to pass in the request
|
425
|
+
* @returns The details of the return associated wth the claim, with a preview of the order when the claim is applied.
|
426
|
+
*
|
427
|
+
* @example
|
428
|
+
* sdk.admin.claim.deleteInboundShipping(
|
429
|
+
* "claim_123",
|
430
|
+
* "ordchact_123",
|
431
|
+
* )
|
432
|
+
* .then(({ return: returnData }) => {
|
433
|
+
* console.log(returnData)
|
434
|
+
* })
|
435
|
+
*/
|
104
436
|
async deleteInboundShipping(id, actionId, query, headers) {
|
105
437
|
return await this.client.fetch(`/admin/claims/${id}/inbound/shipping-method/${actionId}`, {
|
106
438
|
method: "DELETE",
|
@@ -108,6 +440,31 @@ class Claim {
|
|
108
440
|
query,
|
109
441
|
});
|
110
442
|
}
|
443
|
+
/**
|
444
|
+
* This method adds outbound (or new) items to a claim. These outbound items will have an `ITEM_ADD` action.
|
445
|
+
* It sends a request to the [Add Outbound Items](https://docs.medusajs.com/v2/api/admin#claims_postclaimsidoutbounditems)
|
446
|
+
* API route.
|
447
|
+
*
|
448
|
+
* @param id - The ID of the claim to add the outbound items to.
|
449
|
+
* @param body - The items' details.
|
450
|
+
* @param query - Configure the fields to retrieve in the claim.
|
451
|
+
* @param headers - Headers to pass in the request
|
452
|
+
* @returns The details of the claim, with a preview of the order when the claim is applied.
|
453
|
+
*
|
454
|
+
* @example
|
455
|
+
* sdk.admin.claim.addOutboundItems(
|
456
|
+
* "claim_123",
|
457
|
+
* {
|
458
|
+
* items: [{
|
459
|
+
* id: "orli_123",
|
460
|
+
* quantity: 1
|
461
|
+
* }]
|
462
|
+
* },
|
463
|
+
* )
|
464
|
+
* .then(({ claim }) => {
|
465
|
+
* console.log(claim)
|
466
|
+
* })
|
467
|
+
*/
|
111
468
|
async addOutboundItems(id, body, query, headers) {
|
112
469
|
return await this.client.fetch(`/admin/claims/${id}/outbound/items`, {
|
113
470
|
method: "POST",
|
@@ -116,6 +473,33 @@ class Claim {
|
|
116
473
|
query,
|
117
474
|
});
|
118
475
|
}
|
476
|
+
/**
|
477
|
+
* This method updates an outbound (or new) item of a claim using the ID of the item's `ITEM_ADD` action.
|
478
|
+
* It sends a request to the [Update Outbound Item](https://docs.medusajs.com/v2/api/admin#claims_postclaimsidoutbounditemsaction_id)
|
479
|
+
* API route.
|
480
|
+
*
|
481
|
+
* Every item has an `actions` property, whose value is an array of actions.
|
482
|
+
* You can check the action's name using its `action` property, and use the value of the `id` property.
|
483
|
+
*
|
484
|
+
* @param id - The claim's ID.
|
485
|
+
* @param actionId - The id of the new claim item's `ITEM_ADD` action.
|
486
|
+
* @param body - The item's details.
|
487
|
+
* @param query - Configure the fields to retrieve in the claim.
|
488
|
+
* @param headers - Headers to pass in the request
|
489
|
+
* @returns The details of the claim, with a preview of the order when the claim is applied.
|
490
|
+
*
|
491
|
+
* @example
|
492
|
+
* sdk.admin.claim.updateOutboundItem(
|
493
|
+
* "claim_123",
|
494
|
+
* "ordchact_123",
|
495
|
+
* {
|
496
|
+
* quantity: 1
|
497
|
+
* },
|
498
|
+
* )
|
499
|
+
* .then(({ claim }) => {
|
500
|
+
* console.log(claim)
|
501
|
+
* })
|
502
|
+
*/
|
119
503
|
async updateOutboundItem(id, actionId, body, query, headers) {
|
120
504
|
return await this.client.fetch(`/admin/claims/${id}/outbound/items/${actionId}`, {
|
121
505
|
method: "POST",
|
@@ -124,6 +508,29 @@ class Claim {
|
|
124
508
|
query,
|
125
509
|
});
|
126
510
|
}
|
511
|
+
/**
|
512
|
+
* This method removes an outbound (or new) item from a claim using the ID of the item's `ITEM_ADD` action.
|
513
|
+
* It sends a request to the [Remove Outbound Item](https://docs.medusajs.com/v2/api/admin#claims_deleteclaimsidoutbounditemsaction_id)
|
514
|
+
* API route.
|
515
|
+
*
|
516
|
+
* Every item has an `actions` property, whose value is an array of actions.
|
517
|
+
* You can check the action's name using its `action` property, and use the value of the `id` property.
|
518
|
+
*
|
519
|
+
* @param id - The claim's ID.
|
520
|
+
* @param actionId - The id of the new claim item's `ITEM_ADD` action.
|
521
|
+
* @param query - Configure the fields to retrieve in the claim.
|
522
|
+
* @param headers - Headers to pass in the request
|
523
|
+
* @returns The details of the claim, with a preview of the order when the claim is applied.
|
524
|
+
*
|
525
|
+
* @example
|
526
|
+
* sdk.admin.claim.removeOutboundItem(
|
527
|
+
* "claim_123",
|
528
|
+
* "ordchact_123",
|
529
|
+
* )
|
530
|
+
* .then(({ claim }) => {
|
531
|
+
* console.log(claim)
|
532
|
+
* })
|
533
|
+
*/
|
127
534
|
async removeOutboundItem(id, actionId, query, headers) {
|
128
535
|
return await this.client.fetch(`/admin/claims/${id}/outbound/items/${actionId}`, {
|
129
536
|
method: "DELETE",
|
@@ -131,6 +538,32 @@ class Claim {
|
|
131
538
|
query,
|
132
539
|
});
|
133
540
|
}
|
541
|
+
/**
|
542
|
+
* This method adds outbound an outbound shipping method to a claim.
|
543
|
+
* The outbound shipping method will have a `SHIPPING_ADD` action.
|
544
|
+
*
|
545
|
+
* This method sends a request to the
|
546
|
+
* [Add Outbound Shipping](https://docs.medusajs.com/v2/api/admin#claims_postclaimsidoutboundshippingmethod)
|
547
|
+
* API route.
|
548
|
+
*
|
549
|
+
* @param id - The claim's ID.
|
550
|
+
* @param body - The shipping method's details.
|
551
|
+
* @param query - Configure the fields to retrieve in the claim.
|
552
|
+
* @param headers - Headers to pass in the request
|
553
|
+
* @returns The details of the claim, with a preview of the order when the claim is applied.
|
554
|
+
*
|
555
|
+
* @example
|
556
|
+
* * sdk.admin.claim.addOutboundShipping(
|
557
|
+
* "claim_123",
|
558
|
+
* {
|
559
|
+
* shipping_option_id: "so_123",
|
560
|
+
* custom_amount: 10
|
561
|
+
* },
|
562
|
+
* )
|
563
|
+
* .then(({ claim }) => {
|
564
|
+
* console.log(claim)
|
565
|
+
* })
|
566
|
+
*/
|
134
567
|
async addOutboundShipping(id, body, query, headers) {
|
135
568
|
return await this.client.fetch(`/admin/claims/${id}/outbound/shipping-method`, {
|
136
569
|
method: "POST",
|
@@ -139,6 +572,33 @@ class Claim {
|
|
139
572
|
query,
|
140
573
|
});
|
141
574
|
}
|
575
|
+
/**
|
576
|
+
* This method updates the shipping method for delivering outbound items in a claim using the ID of the method's `SHIPPING_ADD` action.
|
577
|
+
* It sends a request to the [Update Outbound Shipping](https://docs.medusajs.com/v2/api/admin#claims_postclaimsidoutboundshippingmethodaction_id)
|
578
|
+
* API route.
|
579
|
+
*
|
580
|
+
* Every shipping method has an `actions` property, whose value is an array of actions.
|
581
|
+
* You can check the action's name using its `action` property, and use the value of the `id` property.
|
582
|
+
*
|
583
|
+
* @param id - The claim's ID.
|
584
|
+
* @param actionId - The id of the shipping method's `SHIPPING_ADD` action.
|
585
|
+
* @param body - The shipping method's details.
|
586
|
+
* @param query - Configure the fields to retrieve in the claim.
|
587
|
+
* @param headers - Headers to pass in the request
|
588
|
+
* @returns The details of the claim, with a preview of the order when the claim is applied.
|
589
|
+
*
|
590
|
+
* @example
|
591
|
+
* sdk.admin.claim.updateOutboundShipping(
|
592
|
+
* "claim_123",
|
593
|
+
* "ordchact_123",
|
594
|
+
* {
|
595
|
+
* custom_amount: 10
|
596
|
+
* },
|
597
|
+
* )
|
598
|
+
* .then(({ claim }) => {
|
599
|
+
* console.log(claim)
|
600
|
+
* })
|
601
|
+
*/
|
142
602
|
async updateOutboundShipping(id, actionId, body, query, headers) {
|
143
603
|
return await this.client.fetch(`/admin/claims/${id}/outbound/shipping-method/${actionId}`, {
|
144
604
|
method: "POST",
|
@@ -147,6 +607,27 @@ class Claim {
|
|
147
607
|
query,
|
148
608
|
});
|
149
609
|
}
|
610
|
+
/**
|
611
|
+
* This method deletes the shipping method for delivering outbound items in the claim using the ID of the method's `SHIPPING_ADD` action.
|
612
|
+
*
|
613
|
+
* Every shipping method has an `actions` property, whose value is an array of actions.
|
614
|
+
* You can check the action's name using its `action` property, and use the value of the `id` property.
|
615
|
+
*
|
616
|
+
* @param id - The claim's ID.
|
617
|
+
* @param actionId - The id of the shipping method's `SHIPPING_ADD` action.
|
618
|
+
* @param query - Configure the fields to retrieve in the claim.
|
619
|
+
* @param headers - Headers to pass in the request
|
620
|
+
* @returns The details of the claim, with a preview of the order when the claim is applied.
|
621
|
+
*
|
622
|
+
* @example
|
623
|
+
* sdk.admin.claim.deleteOutboundShipping(
|
624
|
+
* "claim_123",
|
625
|
+
* "ordchact_123",
|
626
|
+
* )
|
627
|
+
* .then(({ claim }) => {
|
628
|
+
* console.log(claim)
|
629
|
+
* })
|
630
|
+
*/
|
150
631
|
async deleteOutboundShipping(id, actionId, query, headers) {
|
151
632
|
return await this.client.fetch(`/admin/claims/${id}/outbound/shipping-method/${actionId}`, {
|
152
633
|
method: "DELETE",
|
@@ -154,6 +635,26 @@ class Claim {
|
|
154
635
|
query,
|
155
636
|
});
|
156
637
|
}
|
638
|
+
/**
|
639
|
+
* This method confirms a claim request, applying its changes on the associated order.
|
640
|
+
* It sends a request to the [Confirm Claim Request](https://docs.medusajs.com/v2/api/admin#claims_postclaimsidrequest)
|
641
|
+
* API route.
|
642
|
+
*
|
643
|
+
* @param id - The claim's ID.
|
644
|
+
* @param body - The confirmation details.
|
645
|
+
* @param query - Configure the fields to retrieve in the claim.
|
646
|
+
* @param headers - Headers to pass in the request
|
647
|
+
* @returns The details of the claim and its associated return, with a preview of the order when the claim is applied.
|
648
|
+
*
|
649
|
+
* @example
|
650
|
+
* sdk.admin.claim.request(
|
651
|
+
* "claim_123",
|
652
|
+
* {},
|
653
|
+
* )
|
654
|
+
* .then(({ claim }) => {
|
655
|
+
* console.log(claim)
|
656
|
+
* })
|
657
|
+
*/
|
157
658
|
async request(id, body, query, headers) {
|
158
659
|
return await this.client.fetch(`/admin/claims/${id}/request`, {
|
159
660
|
method: "POST",
|
@@ -162,6 +663,24 @@ class Claim {
|
|
162
663
|
query,
|
163
664
|
});
|
164
665
|
}
|
666
|
+
/**
|
667
|
+
* This method cancels a requested claim. It sends a request to the
|
668
|
+
* [Cancel Claim Request](https://docs.medusajs.com/v2/api/admin#claims_deleteclaimsidrequest)
|
669
|
+
* API route.
|
670
|
+
*
|
671
|
+
* @param id - The claim's ID.
|
672
|
+
* @param query - Configure the fields to retrieve in the claim.
|
673
|
+
* @param headers - Headers to pass in the request
|
674
|
+
* @returns The cancelation's details.
|
675
|
+
*
|
676
|
+
* @example
|
677
|
+
* sdk.admin.claim.cancelRequest(
|
678
|
+
* "claim_123",
|
679
|
+
* )
|
680
|
+
* .then(({ deleted }) => {
|
681
|
+
* console.log(deleted)
|
682
|
+
* })
|
683
|
+
*/
|
165
684
|
async cancelRequest(id, query, headers) {
|
166
685
|
return await this.client.fetch(`/admin/claims/${id}/request`, {
|
167
686
|
method: "DELETE",
|
package/dist/admin/claim.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"claim.js","sourceRoot":"","sources":["../../src/admin/claim.ts"],"names":[],"mappings":";;;AAKA,MAAa,KAAK;
|
1
|
+
{"version":3,"file":"claim.js","sourceRoot":"","sources":["../../src/admin/claim.ts"],"names":[],"mappings":";;;AAKA,MAAa,KAAK;IAKhB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6CG;IACH,KAAK,CAAC,IAAI,CAAC,KAAsC,EAAE,OAAuB;QACxE,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,eAAe,EACf;YACE,KAAK;YACL,OAAO;SACR,CACF,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,KAAK,CAAC,QAAQ,CACZ,EAAU,EACV,KAA8B,EAC9B,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,iBAAiB,EAAE,EAAE,EACrB;YACE,KAAK;YACL,OAAO;SACR,CACF,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,KAAK,CAAC,MAAM,CACV,IAAgC,EAChC,KAA8B,EAC9B,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,eAAe,EACf;YACE,MAAM,EA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