@commercelayer/sdk 7.0.0-beta.17 → 7.0.0-beta.19
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.
- package/lib/api.cjs +0 -1
- package/lib/api.js +0 -1
- package/lib/client.cjs +45 -54
- package/lib/client.js +45 -54
- package/lib/commercelayer.cjs +11 -13
- package/lib/commercelayer.js +11 -13
- package/lib/common.cjs +0 -1
- package/lib/common.js +0 -1
- package/lib/config.cjs +0 -2
- package/lib/config.js +0 -2
- package/lib/debug.cjs +0 -2
- package/lib/debug.js +0 -2
- package/lib/enum.cjs +0 -2
- package/lib/enum.js +0 -2
- package/lib/error.cjs +19 -22
- package/lib/error.js +19 -22
- package/lib/fetch.cjs +17 -24
- package/lib/fetch.js +17 -24
- package/lib/index.cjs +0 -1
- package/lib/index.d.cts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +0 -1
- package/lib/jsonapi.cjs +0 -1
- package/lib/jsonapi.js +0 -1
- package/lib/query.cjs +0 -1
- package/lib/query.js +0 -1
- package/lib/resource.cjs +21 -26
- package/lib/resource.js +21 -26
- package/lib/resources/addresses.cjs +10 -12
- package/lib/resources/addresses.js +10 -12
- package/lib/resources/adjustments.cjs +8 -10
- package/lib/resources/adjustments.js +8 -10
- package/lib/resources/adyen_gateways.cjs +8 -10
- package/lib/resources/adyen_gateways.js +8 -10
- package/lib/resources/adyen_payments.cjs +10 -12
- package/lib/resources/adyen_payments.js +10 -12
- package/lib/resources/applications.cjs +5 -7
- package/lib/resources/applications.js +5 -7
- package/lib/resources/attachments.cjs +8 -10
- package/lib/resources/attachments.js +8 -10
- package/lib/resources/authorizations.cjs +11 -13
- package/lib/resources/authorizations.js +11 -13
- package/lib/resources/avalara_accounts.cjs +8 -10
- package/lib/resources/avalara_accounts.js +8 -10
- package/lib/resources/axerve_gateways.cjs +8 -10
- package/lib/resources/axerve_gateways.js +8 -10
- package/lib/resources/axerve_payments.cjs +9 -11
- package/lib/resources/axerve_payments.js +9 -11
- package/lib/resources/bing_geocoders.cjs +8 -10
- package/lib/resources/bing_geocoders.js +8 -10
- package/lib/resources/braintree_gateways.cjs +8 -10
- package/lib/resources/braintree_gateways.js +8 -10
- package/lib/resources/braintree_payments.cjs +8 -10
- package/lib/resources/braintree_payments.js +8 -10
- package/lib/resources/bundles.cjs +12 -14
- package/lib/resources/bundles.js +12 -14
- package/lib/resources/buy_x_pay_y_promotions.cjs +12 -14
- package/lib/resources/buy_x_pay_y_promotions.js +12 -14
- package/lib/resources/captures.cjs +10 -12
- package/lib/resources/captures.js +10 -12
- package/lib/resources/carrier_accounts.cjs +8 -10
- package/lib/resources/carrier_accounts.js +8 -10
- package/lib/resources/checkout_com_gateways.cjs +8 -10
- package/lib/resources/checkout_com_gateways.js +8 -10
- package/lib/resources/checkout_com_payments.cjs +10 -12
- package/lib/resources/checkout_com_payments.js +10 -12
- package/lib/resources/cleanups.cjs +9 -11
- package/lib/resources/cleanups.js +9 -11
- package/lib/resources/coupon_codes_promotion_rules.cjs +8 -10
- package/lib/resources/coupon_codes_promotion_rules.js +8 -10
- package/lib/resources/coupon_recipients.cjs +8 -10
- package/lib/resources/coupon_recipients.js +8 -10
- package/lib/resources/coupons.cjs +10 -12
- package/lib/resources/coupons.js +10 -12
- package/lib/resources/custom_promotion_rules.cjs +8 -10
- package/lib/resources/custom_promotion_rules.js +8 -10
- package/lib/resources/customer_addresses.cjs +8 -10
- package/lib/resources/customer_addresses.js +8 -10
- package/lib/resources/customer_groups.cjs +8 -10
- package/lib/resources/customer_groups.js +8 -10
- package/lib/resources/customer_password_resets.cjs +9 -11
- package/lib/resources/customer_password_resets.js +9 -11
- package/lib/resources/customer_payment_sources.cjs +8 -10
- package/lib/resources/customer_payment_sources.js +8 -10
- package/lib/resources/customer_subscriptions.cjs +8 -10
- package/lib/resources/customer_subscriptions.js +8 -10
- package/lib/resources/customers.cjs +10 -12
- package/lib/resources/customers.js +10 -12
- package/lib/resources/delivery_lead_times.cjs +8 -10
- package/lib/resources/delivery_lead_times.js +8 -10
- package/lib/resources/discount_engine_items.cjs +5 -7
- package/lib/resources/discount_engine_items.js +5 -7
- package/lib/resources/discount_engines.cjs +5 -7
- package/lib/resources/discount_engines.js +5 -7
- package/lib/resources/easypost_pickups.cjs +9 -11
- package/lib/resources/easypost_pickups.js +9 -11
- package/lib/resources/event_callbacks.cjs +5 -7
- package/lib/resources/event_callbacks.js +5 -7
- package/lib/resources/events.cjs +7 -9
- package/lib/resources/events.js +7 -9
- package/lib/resources/exports.cjs +9 -11
- package/lib/resources/exports.js +9 -11
- package/lib/resources/external_gateways.cjs +9 -11
- package/lib/resources/external_gateways.js +9 -11
- package/lib/resources/external_payments.cjs +8 -10
- package/lib/resources/external_payments.js +8 -10
- package/lib/resources/external_promotions.cjs +13 -15
- package/lib/resources/external_promotions.js +13 -15
- package/lib/resources/external_tax_calculators.cjs +9 -11
- package/lib/resources/external_tax_calculators.js +9 -11
- package/lib/resources/fixed_amount_promotions.cjs +12 -14
- package/lib/resources/fixed_amount_promotions.js +12 -14
- package/lib/resources/fixed_price_promotions.cjs +12 -14
- package/lib/resources/fixed_price_promotions.js +12 -14
- package/lib/resources/flex_promotions.cjs +12 -14
- package/lib/resources/flex_promotions.js +12 -14
- package/lib/resources/free_gift_promotions.cjs +12 -14
- package/lib/resources/free_gift_promotions.js +12 -14
- package/lib/resources/free_shipping_promotions.cjs +12 -14
- package/lib/resources/free_shipping_promotions.js +12 -14
- package/lib/resources/geocoders.cjs +5 -7
- package/lib/resources/geocoders.js +5 -7
- package/lib/resources/gift_card_recipients.cjs +8 -10
- package/lib/resources/gift_card_recipients.js +8 -10
- package/lib/resources/gift_cards.cjs +14 -16
- package/lib/resources/gift_cards.js +14 -16
- package/lib/resources/google_geocoders.cjs +8 -10
- package/lib/resources/google_geocoders.js +8 -10
- package/lib/resources/imports.cjs +9 -11
- package/lib/resources/imports.js +9 -11
- package/lib/resources/in_stock_subscriptions.cjs +10 -12
- package/lib/resources/in_stock_subscriptions.js +10 -12
- package/lib/resources/inventory_models.cjs +8 -10
- package/lib/resources/inventory_models.js +8 -10
- package/lib/resources/inventory_return_locations.cjs +8 -10
- package/lib/resources/inventory_return_locations.js +8 -10
- package/lib/resources/inventory_stock_locations.cjs +8 -10
- package/lib/resources/inventory_stock_locations.js +8 -10
- package/lib/resources/klarna_gateways.cjs +8 -10
- package/lib/resources/klarna_gateways.js +8 -10
- package/lib/resources/klarna_payments.cjs +9 -11
- package/lib/resources/klarna_payments.js +9 -11
- package/lib/resources/line_item_options.cjs +10 -12
- package/lib/resources/line_item_options.js +10 -12
- package/lib/resources/line_items.cjs +13 -15
- package/lib/resources/line_items.js +13 -15
- package/lib/resources/links.cjs +10 -12
- package/lib/resources/links.js +10 -12
- package/lib/resources/manual_gateways.cjs +8 -10
- package/lib/resources/manual_gateways.js +8 -10
- package/lib/resources/manual_tax_calculators.cjs +8 -10
- package/lib/resources/manual_tax_calculators.js +8 -10
- package/lib/resources/markets.cjs +10 -12
- package/lib/resources/markets.js +10 -12
- package/lib/resources/merchants.cjs +8 -10
- package/lib/resources/merchants.js +8 -10
- package/lib/resources/notifications.cjs +8 -10
- package/lib/resources/notifications.js +8 -10
- package/lib/resources/order_amount_promotion_rules.cjs +8 -10
- package/lib/resources/order_amount_promotion_rules.js +8 -10
- package/lib/resources/order_copies.cjs +8 -10
- package/lib/resources/order_copies.js +8 -10
- package/lib/resources/order_factories.cjs +5 -7
- package/lib/resources/order_factories.js +5 -7
- package/lib/resources/order_subscription_items.cjs +8 -10
- package/lib/resources/order_subscription_items.js +8 -10
- package/lib/resources/order_subscriptions.cjs +14 -16
- package/lib/resources/order_subscriptions.js +14 -16
- package/lib/resources/orders.cjs +41 -43
- package/lib/resources/orders.js +41 -43
- package/lib/resources/organizations.cjs +5 -7
- package/lib/resources/organizations.js +5 -7
- package/lib/resources/packages.cjs +8 -10
- package/lib/resources/packages.js +8 -10
- package/lib/resources/parcel_line_items.cjs +8 -10
- package/lib/resources/parcel_line_items.js +8 -10
- package/lib/resources/parcels.cjs +8 -10
- package/lib/resources/parcels.js +8 -10
- package/lib/resources/payment_gateways.cjs +5 -7
- package/lib/resources/payment_gateways.js +5 -7
- package/lib/resources/payment_methods.cjs +10 -12
- package/lib/resources/payment_methods.js +10 -12
- package/lib/resources/payment_options.cjs +8 -10
- package/lib/resources/payment_options.js +8 -10
- package/lib/resources/paypal_gateways.cjs +8 -10
- package/lib/resources/paypal_gateways.js +8 -10
- package/lib/resources/paypal_payments.cjs +8 -10
- package/lib/resources/paypal_payments.js +8 -10
- package/lib/resources/percentage_discount_promotions.cjs +12 -14
- package/lib/resources/percentage_discount_promotions.js +12 -14
- package/lib/resources/pickups.cjs +5 -7
- package/lib/resources/pickups.js +5 -7
- package/lib/resources/price_frequency_tiers.cjs +8 -10
- package/lib/resources/price_frequency_tiers.js +8 -10
- package/lib/resources/price_list_schedulers.cjs +10 -12
- package/lib/resources/price_list_schedulers.js +10 -12
- package/lib/resources/price_lists.cjs +8 -10
- package/lib/resources/price_lists.js +8 -10
- package/lib/resources/price_tiers.cjs +5 -7
- package/lib/resources/price_tiers.js +5 -7
- package/lib/resources/price_volume_tiers.cjs +8 -10
- package/lib/resources/price_volume_tiers.js +8 -10
- package/lib/resources/prices.cjs +8 -10
- package/lib/resources/prices.js +8 -10
- package/lib/resources/promotion_rules.cjs +5 -7
- package/lib/resources/promotion_rules.js +5 -7
- package/lib/resources/promotions.cjs +5 -7
- package/lib/resources/promotions.js +5 -7
- package/lib/resources/recurring_order_copies.cjs +8 -10
- package/lib/resources/recurring_order_copies.js +8 -10
- package/lib/resources/refunds.cjs +7 -9
- package/lib/resources/refunds.js +7 -9
- package/lib/resources/reserved_stocks.cjs +5 -7
- package/lib/resources/reserved_stocks.js +5 -7
- package/lib/resources/resource_errors.cjs +5 -7
- package/lib/resources/resource_errors.js +5 -7
- package/lib/resources/return_line_items.cjs +9 -11
- package/lib/resources/return_line_items.js +9 -11
- package/lib/resources/returns.cjs +21 -23
- package/lib/resources/returns.js +21 -23
- package/lib/resources/satispay_gateways.cjs +8 -10
- package/lib/resources/satispay_gateways.js +8 -10
- package/lib/resources/satispay_payments.cjs +9 -11
- package/lib/resources/satispay_payments.js +9 -11
- package/lib/resources/shipments.cjs +23 -25
- package/lib/resources/shipments.js +23 -25
- package/lib/resources/shipping_categories.cjs +8 -10
- package/lib/resources/shipping_categories.js +8 -10
- package/lib/resources/shipping_method_tiers.cjs +5 -7
- package/lib/resources/shipping_method_tiers.js +5 -7
- package/lib/resources/shipping_methods.cjs +11 -13
- package/lib/resources/shipping_methods.js +11 -13
- package/lib/resources/shipping_weight_tiers.cjs +8 -10
- package/lib/resources/shipping_weight_tiers.js +8 -10
- package/lib/resources/shipping_zones.cjs +8 -10
- package/lib/resources/shipping_zones.js +8 -10
- package/lib/resources/sku_list_items.cjs +8 -10
- package/lib/resources/sku_list_items.js +8 -10
- package/lib/resources/sku_list_promotion_rules.cjs +8 -10
- package/lib/resources/sku_list_promotion_rules.js +8 -10
- package/lib/resources/sku_lists.cjs +8 -10
- package/lib/resources/sku_lists.js +8 -10
- package/lib/resources/sku_options.cjs +10 -12
- package/lib/resources/sku_options.js +10 -12
- package/lib/resources/skus.cjs +10 -12
- package/lib/resources/skus.js +10 -12
- package/lib/resources/stock_items.cjs +9 -11
- package/lib/resources/stock_items.js +9 -11
- package/lib/resources/stock_line_items.cjs +11 -13
- package/lib/resources/stock_line_items.js +11 -13
- package/lib/resources/stock_locations.cjs +8 -10
- package/lib/resources/stock_locations.js +8 -10
- package/lib/resources/stock_reservations.cjs +9 -11
- package/lib/resources/stock_reservations.js +9 -11
- package/lib/resources/stock_transfers.cjs +14 -16
- package/lib/resources/stock_transfers.js +14 -16
- package/lib/resources/stores.cjs +8 -10
- package/lib/resources/stores.js +8 -10
- package/lib/resources/stripe_gateways.cjs +8 -10
- package/lib/resources/stripe_gateways.js +8 -10
- package/lib/resources/stripe_payments.cjs +10 -12
- package/lib/resources/stripe_payments.js +10 -12
- package/lib/resources/stripe_tax_accounts.cjs +8 -10
- package/lib/resources/stripe_tax_accounts.js +8 -10
- package/lib/resources/subscription_models.cjs +8 -10
- package/lib/resources/subscription_models.js +8 -10
- package/lib/resources/tags.cjs +8 -10
- package/lib/resources/tags.js +8 -10
- package/lib/resources/talon_one_accounts.cjs +8 -10
- package/lib/resources/talon_one_accounts.js +8 -10
- package/lib/resources/tax_calculators.cjs +5 -7
- package/lib/resources/tax_calculators.js +5 -7
- package/lib/resources/tax_categories.cjs +8 -10
- package/lib/resources/tax_categories.js +8 -10
- package/lib/resources/tax_rules.cjs +8 -10
- package/lib/resources/tax_rules.js +8 -10
- package/lib/resources/taxjar_accounts.cjs +8 -10
- package/lib/resources/taxjar_accounts.js +8 -10
- package/lib/resources/transactions.cjs +5 -7
- package/lib/resources/transactions.js +5 -7
- package/lib/resources/versions.cjs +5 -7
- package/lib/resources/versions.js +5 -7
- package/lib/resources/vertex_accounts.cjs +9 -11
- package/lib/resources/vertex_accounts.js +9 -11
- package/lib/resources/voids.cjs +7 -9
- package/lib/resources/voids.js +7 -9
- package/lib/resources/webhooks.cjs +11 -13
- package/lib/resources/webhooks.js +11 -13
- package/lib/resources/wire_transfers.cjs +8 -10
- package/lib/resources/wire_transfers.js +8 -10
- package/lib/static.cjs +0 -1
- package/lib/static.js +0 -1
- package/lib/util.cjs +0 -2
- package/lib/util.js +0 -2
- package/package.json +4 -4
- package/lib/chunk-AQ5VUG5P.js +0 -12
- package/lib/chunk-JE77HYXB.cjs +0 -17
@@ -1,17 +1,17 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var chunkJE77HYXB_cjs = require('../chunk-JE77HYXB.cjs');
|
4
3
|
var resource = require('../resource');
|
5
4
|
|
6
|
-
|
5
|
+
class Returns extends resource.ApiResource {
|
6
|
+
static TYPE = "returns";
|
7
7
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create({ ...resource, type:
|
8
|
+
return this.resources.create({ ...resource, type: Returns.TYPE }, params, options);
|
9
9
|
}
|
10
10
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update({ ...resource, type:
|
11
|
+
return this.resources.update({ ...resource, type: Returns.TYPE }, params, options);
|
12
12
|
}
|
13
13
|
async delete(id, options) {
|
14
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
14
|
+
await this.resources.delete(typeof id === "string" ? { id, type: Returns.TYPE } : id, options);
|
15
15
|
}
|
16
16
|
async order(returnId, params, options) {
|
17
17
|
const _returnId = returnId.id || returnId;
|
@@ -66,46 +66,46 @@ const _Returns = class _Returns extends resource.ApiResource {
|
|
66
66
|
return this.resources.fetch({ type: "versions" }, `returns/${_returnId}/versions`, params, options);
|
67
67
|
}
|
68
68
|
async _request(id, params, options) {
|
69
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
69
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _request: true }, params, options);
|
70
70
|
}
|
71
71
|
async _approve(id, params, options) {
|
72
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
72
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _approve: true }, params, options);
|
73
73
|
}
|
74
74
|
async _cancel(id, params, options) {
|
75
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
75
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _cancel: true }, params, options);
|
76
76
|
}
|
77
77
|
async _ship(id, params, options) {
|
78
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
78
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _ship: true }, params, options);
|
79
79
|
}
|
80
80
|
async _reject(id, params, options) {
|
81
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
81
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _reject: true }, params, options);
|
82
82
|
}
|
83
83
|
async _receive(id, params, options) {
|
84
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
84
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _receive: true }, params, options);
|
85
85
|
}
|
86
86
|
async _restock(id, params, options) {
|
87
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
87
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _restock: true }, params, options);
|
88
88
|
}
|
89
89
|
async _archive(id, params, options) {
|
90
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
90
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _archive: true }, params, options);
|
91
91
|
}
|
92
92
|
async _unarchive(id, params, options) {
|
93
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
93
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _unarchive: true }, params, options);
|
94
94
|
}
|
95
95
|
async _refund(id, params, options) {
|
96
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
96
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _refund: true }, params, options);
|
97
97
|
}
|
98
98
|
async _refund_amount_cents(id, triggerValue, params, options) {
|
99
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
99
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _refund_amount_cents: triggerValue }, params, options);
|
100
100
|
}
|
101
101
|
async _add_tags(id, triggerValue, params, options) {
|
102
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
102
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _add_tags: triggerValue }, params, options);
|
103
103
|
}
|
104
104
|
async _remove_tags(id, triggerValue, params, options) {
|
105
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
105
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _remove_tags: triggerValue }, params, options);
|
106
106
|
}
|
107
107
|
isReturn(resource) {
|
108
|
-
return resource.type && resource.type ===
|
108
|
+
return resource.type && resource.type === Returns.TYPE;
|
109
109
|
}
|
110
110
|
relationship(id) {
|
111
111
|
return super.relationshipOneToOne(id);
|
@@ -114,11 +114,9 @@ const _Returns = class _Returns extends resource.ApiResource {
|
|
114
114
|
return super.relationshipOneToMany(...ids);
|
115
115
|
}
|
116
116
|
type() {
|
117
|
-
return
|
117
|
+
return Returns.TYPE;
|
118
118
|
}
|
119
|
-
}
|
120
|
-
chunkJE77HYXB_cjs.__publicField(_Returns, "TYPE", "returns");
|
121
|
-
let Returns = _Returns;
|
119
|
+
}
|
122
120
|
const instance = new Returns();
|
123
121
|
var returns_default = instance;
|
124
122
|
|
package/lib/resources/returns.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class Returns extends ApiResource {
|
4
|
+
static TYPE = "returns";
|
5
5
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type:
|
6
|
+
return this.resources.create({ ...resource, type: Returns.TYPE }, params, options);
|
7
7
|
}
|
8
8
|
async update(resource, params, options) {
|
9
|
-
return this.resources.update({ ...resource, type:
|
9
|
+
return this.resources.update({ ...resource, type: Returns.TYPE }, params, options);
|
10
10
|
}
|
11
11
|
async delete(id, options) {
|
12
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: Returns.TYPE } : id, options);
|
13
13
|
}
|
14
14
|
async order(returnId, params, options) {
|
15
15
|
const _returnId = returnId.id || returnId;
|
@@ -64,46 +64,46 @@ const _Returns = class _Returns extends ApiResource {
|
|
64
64
|
return this.resources.fetch({ type: "versions" }, `returns/${_returnId}/versions`, params, options);
|
65
65
|
}
|
66
66
|
async _request(id, params, options) {
|
67
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
67
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _request: true }, params, options);
|
68
68
|
}
|
69
69
|
async _approve(id, params, options) {
|
70
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
70
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _approve: true }, params, options);
|
71
71
|
}
|
72
72
|
async _cancel(id, params, options) {
|
73
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
73
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _cancel: true }, params, options);
|
74
74
|
}
|
75
75
|
async _ship(id, params, options) {
|
76
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
76
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _ship: true }, params, options);
|
77
77
|
}
|
78
78
|
async _reject(id, params, options) {
|
79
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
79
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _reject: true }, params, options);
|
80
80
|
}
|
81
81
|
async _receive(id, params, options) {
|
82
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
82
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _receive: true }, params, options);
|
83
83
|
}
|
84
84
|
async _restock(id, params, options) {
|
85
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
85
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _restock: true }, params, options);
|
86
86
|
}
|
87
87
|
async _archive(id, params, options) {
|
88
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
88
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _archive: true }, params, options);
|
89
89
|
}
|
90
90
|
async _unarchive(id, params, options) {
|
91
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
91
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _unarchive: true }, params, options);
|
92
92
|
}
|
93
93
|
async _refund(id, params, options) {
|
94
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
94
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _refund: true }, params, options);
|
95
95
|
}
|
96
96
|
async _refund_amount_cents(id, triggerValue, params, options) {
|
97
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
97
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _refund_amount_cents: triggerValue }, params, options);
|
98
98
|
}
|
99
99
|
async _add_tags(id, triggerValue, params, options) {
|
100
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
100
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _add_tags: triggerValue }, params, options);
|
101
101
|
}
|
102
102
|
async _remove_tags(id, triggerValue, params, options) {
|
103
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
103
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Returns.TYPE, _remove_tags: triggerValue }, params, options);
|
104
104
|
}
|
105
105
|
isReturn(resource) {
|
106
|
-
return resource.type && resource.type ===
|
106
|
+
return resource.type && resource.type === Returns.TYPE;
|
107
107
|
}
|
108
108
|
relationship(id) {
|
109
109
|
return super.relationshipOneToOne(id);
|
@@ -112,11 +112,9 @@ const _Returns = class _Returns extends ApiResource {
|
|
112
112
|
return super.relationshipOneToMany(...ids);
|
113
113
|
}
|
114
114
|
type() {
|
115
|
-
return
|
115
|
+
return Returns.TYPE;
|
116
116
|
}
|
117
|
-
}
|
118
|
-
__publicField(_Returns, "TYPE", "returns");
|
119
|
-
let Returns = _Returns;
|
117
|
+
}
|
120
118
|
const instance = new Returns();
|
121
119
|
var returns_default = instance;
|
122
120
|
|
@@ -1,17 +1,17 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var chunkJE77HYXB_cjs = require('../chunk-JE77HYXB.cjs');
|
4
3
|
var resource = require('../resource');
|
5
4
|
|
6
|
-
|
5
|
+
class SatispayGateways extends resource.ApiResource {
|
6
|
+
static TYPE = "satispay_gateways";
|
7
7
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create({ ...resource, type:
|
8
|
+
return this.resources.create({ ...resource, type: SatispayGateways.TYPE }, params, options);
|
9
9
|
}
|
10
10
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update({ ...resource, type:
|
11
|
+
return this.resources.update({ ...resource, type: SatispayGateways.TYPE }, params, options);
|
12
12
|
}
|
13
13
|
async delete(id, options) {
|
14
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
14
|
+
await this.resources.delete(typeof id === "string" ? { id, type: SatispayGateways.TYPE } : id, options);
|
15
15
|
}
|
16
16
|
async payment_methods(satispayGatewayId, params, options) {
|
17
17
|
const _satispayGatewayId = satispayGatewayId.id || satispayGatewayId;
|
@@ -26,7 +26,7 @@ const _SatispayGateways = class _SatispayGateways extends resource.ApiResource {
|
|
26
26
|
return this.resources.fetch({ type: "satispay_payments" }, `satispay_gateways/${_satispayGatewayId}/satispay_payments`, params, options);
|
27
27
|
}
|
28
28
|
isSatispayGateway(resource) {
|
29
|
-
return resource.type && resource.type ===
|
29
|
+
return resource.type && resource.type === SatispayGateways.TYPE;
|
30
30
|
}
|
31
31
|
relationship(id) {
|
32
32
|
return super.relationshipOneToOne(id);
|
@@ -35,11 +35,9 @@ const _SatispayGateways = class _SatispayGateways extends resource.ApiResource {
|
|
35
35
|
return super.relationshipOneToMany(...ids);
|
36
36
|
}
|
37
37
|
type() {
|
38
|
-
return
|
38
|
+
return SatispayGateways.TYPE;
|
39
39
|
}
|
40
|
-
}
|
41
|
-
chunkJE77HYXB_cjs.__publicField(_SatispayGateways, "TYPE", "satispay_gateways");
|
42
|
-
let SatispayGateways = _SatispayGateways;
|
40
|
+
}
|
43
41
|
const instance = new SatispayGateways();
|
44
42
|
var satispay_gateways_default = instance;
|
45
43
|
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class SatispayGateways extends ApiResource {
|
4
|
+
static TYPE = "satispay_gateways";
|
5
5
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type:
|
6
|
+
return this.resources.create({ ...resource, type: SatispayGateways.TYPE }, params, options);
|
7
7
|
}
|
8
8
|
async update(resource, params, options) {
|
9
|
-
return this.resources.update({ ...resource, type:
|
9
|
+
return this.resources.update({ ...resource, type: SatispayGateways.TYPE }, params, options);
|
10
10
|
}
|
11
11
|
async delete(id, options) {
|
12
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: SatispayGateways.TYPE } : id, options);
|
13
13
|
}
|
14
14
|
async payment_methods(satispayGatewayId, params, options) {
|
15
15
|
const _satispayGatewayId = satispayGatewayId.id || satispayGatewayId;
|
@@ -24,7 +24,7 @@ const _SatispayGateways = class _SatispayGateways extends ApiResource {
|
|
24
24
|
return this.resources.fetch({ type: "satispay_payments" }, `satispay_gateways/${_satispayGatewayId}/satispay_payments`, params, options);
|
25
25
|
}
|
26
26
|
isSatispayGateway(resource) {
|
27
|
-
return resource.type && resource.type ===
|
27
|
+
return resource.type && resource.type === SatispayGateways.TYPE;
|
28
28
|
}
|
29
29
|
relationship(id) {
|
30
30
|
return super.relationshipOneToOne(id);
|
@@ -33,11 +33,9 @@ const _SatispayGateways = class _SatispayGateways extends ApiResource {
|
|
33
33
|
return super.relationshipOneToMany(...ids);
|
34
34
|
}
|
35
35
|
type() {
|
36
|
-
return
|
36
|
+
return SatispayGateways.TYPE;
|
37
37
|
}
|
38
|
-
}
|
39
|
-
__publicField(_SatispayGateways, "TYPE", "satispay_gateways");
|
40
|
-
let SatispayGateways = _SatispayGateways;
|
38
|
+
}
|
41
39
|
const instance = new SatispayGateways();
|
42
40
|
var satispay_gateways_default = instance;
|
43
41
|
|
@@ -1,17 +1,17 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var chunkJE77HYXB_cjs = require('../chunk-JE77HYXB.cjs');
|
4
3
|
var resource = require('../resource');
|
5
4
|
|
6
|
-
|
5
|
+
class SatispayPayments extends resource.ApiResource {
|
6
|
+
static TYPE = "satispay_payments";
|
7
7
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create({ ...resource, type:
|
8
|
+
return this.resources.create({ ...resource, type: SatispayPayments.TYPE }, params, options);
|
9
9
|
}
|
10
10
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update({ ...resource, type:
|
11
|
+
return this.resources.update({ ...resource, type: SatispayPayments.TYPE }, params, options);
|
12
12
|
}
|
13
13
|
async delete(id, options) {
|
14
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
14
|
+
await this.resources.delete(typeof id === "string" ? { id, type: SatispayPayments.TYPE } : id, options);
|
15
15
|
}
|
16
16
|
async order(satispayPaymentId, params, options) {
|
17
17
|
const _satispayPaymentId = satispayPaymentId.id || satispayPaymentId;
|
@@ -26,10 +26,10 @@ const _SatispayPayments = class _SatispayPayments extends resource.ApiResource {
|
|
26
26
|
return this.resources.fetch({ type: "versions" }, `satispay_payments/${_satispayPaymentId}/versions`, params, options);
|
27
27
|
}
|
28
28
|
async _refresh(id, params, options) {
|
29
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
29
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: SatispayPayments.TYPE, _refresh: true }, params, options);
|
30
30
|
}
|
31
31
|
isSatispayPayment(resource) {
|
32
|
-
return resource.type && resource.type ===
|
32
|
+
return resource.type && resource.type === SatispayPayments.TYPE;
|
33
33
|
}
|
34
34
|
relationship(id) {
|
35
35
|
return super.relationshipOneToOne(id);
|
@@ -38,11 +38,9 @@ const _SatispayPayments = class _SatispayPayments extends resource.ApiResource {
|
|
38
38
|
return super.relationshipOneToMany(...ids);
|
39
39
|
}
|
40
40
|
type() {
|
41
|
-
return
|
41
|
+
return SatispayPayments.TYPE;
|
42
42
|
}
|
43
|
-
}
|
44
|
-
chunkJE77HYXB_cjs.__publicField(_SatispayPayments, "TYPE", "satispay_payments");
|
45
|
-
let SatispayPayments = _SatispayPayments;
|
43
|
+
}
|
46
44
|
const instance = new SatispayPayments();
|
47
45
|
var satispay_payments_default = instance;
|
48
46
|
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class SatispayPayments extends ApiResource {
|
4
|
+
static TYPE = "satispay_payments";
|
5
5
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type:
|
6
|
+
return this.resources.create({ ...resource, type: SatispayPayments.TYPE }, params, options);
|
7
7
|
}
|
8
8
|
async update(resource, params, options) {
|
9
|
-
return this.resources.update({ ...resource, type:
|
9
|
+
return this.resources.update({ ...resource, type: SatispayPayments.TYPE }, params, options);
|
10
10
|
}
|
11
11
|
async delete(id, options) {
|
12
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: SatispayPayments.TYPE } : id, options);
|
13
13
|
}
|
14
14
|
async order(satispayPaymentId, params, options) {
|
15
15
|
const _satispayPaymentId = satispayPaymentId.id || satispayPaymentId;
|
@@ -24,10 +24,10 @@ const _SatispayPayments = class _SatispayPayments extends ApiResource {
|
|
24
24
|
return this.resources.fetch({ type: "versions" }, `satispay_payments/${_satispayPaymentId}/versions`, params, options);
|
25
25
|
}
|
26
26
|
async _refresh(id, params, options) {
|
27
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
27
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: SatispayPayments.TYPE, _refresh: true }, params, options);
|
28
28
|
}
|
29
29
|
isSatispayPayment(resource) {
|
30
|
-
return resource.type && resource.type ===
|
30
|
+
return resource.type && resource.type === SatispayPayments.TYPE;
|
31
31
|
}
|
32
32
|
relationship(id) {
|
33
33
|
return super.relationshipOneToOne(id);
|
@@ -36,11 +36,9 @@ const _SatispayPayments = class _SatispayPayments extends ApiResource {
|
|
36
36
|
return super.relationshipOneToMany(...ids);
|
37
37
|
}
|
38
38
|
type() {
|
39
|
-
return
|
39
|
+
return SatispayPayments.TYPE;
|
40
40
|
}
|
41
|
-
}
|
42
|
-
__publicField(_SatispayPayments, "TYPE", "satispay_payments");
|
43
|
-
let SatispayPayments = _SatispayPayments;
|
41
|
+
}
|
44
42
|
const instance = new SatispayPayments();
|
45
43
|
var satispay_payments_default = instance;
|
46
44
|
|
@@ -1,17 +1,17 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var chunkJE77HYXB_cjs = require('../chunk-JE77HYXB.cjs');
|
4
3
|
var resource = require('../resource');
|
5
4
|
|
6
|
-
|
5
|
+
class Shipments extends resource.ApiResource {
|
6
|
+
static TYPE = "shipments";
|
7
7
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create({ ...resource, type:
|
8
|
+
return this.resources.create({ ...resource, type: Shipments.TYPE }, params, options);
|
9
9
|
}
|
10
10
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update({ ...resource, type:
|
11
|
+
return this.resources.update({ ...resource, type: Shipments.TYPE }, params, options);
|
12
12
|
}
|
13
13
|
async delete(id, options) {
|
14
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
14
|
+
await this.resources.delete(typeof id === "string" ? { id, type: Shipments.TYPE } : id, options);
|
15
15
|
}
|
16
16
|
async order(shipmentId, params, options) {
|
17
17
|
const _shipmentId = shipmentId.id || shipmentId;
|
@@ -90,52 +90,52 @@ const _Shipments = class _Shipments extends resource.ApiResource {
|
|
90
90
|
return this.resources.fetch({ type: "versions" }, `shipments/${_shipmentId}/versions`, params, options);
|
91
91
|
}
|
92
92
|
async _upcoming(id, params, options) {
|
93
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
93
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _upcoming: true }, params, options);
|
94
94
|
}
|
95
95
|
async _cancel(id, params, options) {
|
96
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
96
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _cancel: true }, params, options);
|
97
97
|
}
|
98
98
|
async _on_hold(id, params, options) {
|
99
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
99
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _on_hold: true }, params, options);
|
100
100
|
}
|
101
101
|
async _picking(id, params, options) {
|
102
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
102
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _picking: true }, params, options);
|
103
103
|
}
|
104
104
|
async _packing(id, params, options) {
|
105
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
105
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _packing: true }, params, options);
|
106
106
|
}
|
107
107
|
async _ready_to_ship(id, params, options) {
|
108
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
108
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _ready_to_ship: true }, params, options);
|
109
109
|
}
|
110
110
|
async _ship(id, params, options) {
|
111
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
111
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _ship: true }, params, options);
|
112
112
|
}
|
113
113
|
async _deliver(id, params, options) {
|
114
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
114
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _deliver: true }, params, options);
|
115
115
|
}
|
116
116
|
async _reserve_stock(id, params, options) {
|
117
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
117
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _reserve_stock: true }, params, options);
|
118
118
|
}
|
119
119
|
async _release_stock(id, params, options) {
|
120
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
120
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _release_stock: true }, params, options);
|
121
121
|
}
|
122
122
|
async _decrement_stock(id, params, options) {
|
123
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
123
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _decrement_stock: true }, params, options);
|
124
124
|
}
|
125
125
|
async _get_rates(id, params, options) {
|
126
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
126
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _get_rates: true }, params, options);
|
127
127
|
}
|
128
128
|
async _purchase(id, params, options) {
|
129
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
129
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _purchase: true }, params, options);
|
130
130
|
}
|
131
131
|
async _add_tags(id, triggerValue, params, options) {
|
132
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
132
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _add_tags: triggerValue }, params, options);
|
133
133
|
}
|
134
134
|
async _remove_tags(id, triggerValue, params, options) {
|
135
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
135
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _remove_tags: triggerValue }, params, options);
|
136
136
|
}
|
137
137
|
isShipment(resource) {
|
138
|
-
return resource.type && resource.type ===
|
138
|
+
return resource.type && resource.type === Shipments.TYPE;
|
139
139
|
}
|
140
140
|
relationship(id) {
|
141
141
|
return super.relationshipOneToOne(id);
|
@@ -144,11 +144,9 @@ const _Shipments = class _Shipments extends resource.ApiResource {
|
|
144
144
|
return super.relationshipOneToMany(...ids);
|
145
145
|
}
|
146
146
|
type() {
|
147
|
-
return
|
147
|
+
return Shipments.TYPE;
|
148
148
|
}
|
149
|
-
}
|
150
|
-
chunkJE77HYXB_cjs.__publicField(_Shipments, "TYPE", "shipments");
|
151
|
-
let Shipments = _Shipments;
|
149
|
+
}
|
152
150
|
const instance = new Shipments();
|
153
151
|
var shipments_default = instance;
|
154
152
|
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class Shipments extends ApiResource {
|
4
|
+
static TYPE = "shipments";
|
5
5
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type:
|
6
|
+
return this.resources.create({ ...resource, type: Shipments.TYPE }, params, options);
|
7
7
|
}
|
8
8
|
async update(resource, params, options) {
|
9
|
-
return this.resources.update({ ...resource, type:
|
9
|
+
return this.resources.update({ ...resource, type: Shipments.TYPE }, params, options);
|
10
10
|
}
|
11
11
|
async delete(id, options) {
|
12
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
12
|
+
await this.resources.delete(typeof id === "string" ? { id, type: Shipments.TYPE } : id, options);
|
13
13
|
}
|
14
14
|
async order(shipmentId, params, options) {
|
15
15
|
const _shipmentId = shipmentId.id || shipmentId;
|
@@ -88,52 +88,52 @@ const _Shipments = class _Shipments extends ApiResource {
|
|
88
88
|
return this.resources.fetch({ type: "versions" }, `shipments/${_shipmentId}/versions`, params, options);
|
89
89
|
}
|
90
90
|
async _upcoming(id, params, options) {
|
91
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
91
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _upcoming: true }, params, options);
|
92
92
|
}
|
93
93
|
async _cancel(id, params, options) {
|
94
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
94
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _cancel: true }, params, options);
|
95
95
|
}
|
96
96
|
async _on_hold(id, params, options) {
|
97
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
97
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _on_hold: true }, params, options);
|
98
98
|
}
|
99
99
|
async _picking(id, params, options) {
|
100
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
100
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _picking: true }, params, options);
|
101
101
|
}
|
102
102
|
async _packing(id, params, options) {
|
103
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
103
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _packing: true }, params, options);
|
104
104
|
}
|
105
105
|
async _ready_to_ship(id, params, options) {
|
106
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
106
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _ready_to_ship: true }, params, options);
|
107
107
|
}
|
108
108
|
async _ship(id, params, options) {
|
109
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
109
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _ship: true }, params, options);
|
110
110
|
}
|
111
111
|
async _deliver(id, params, options) {
|
112
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
112
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _deliver: true }, params, options);
|
113
113
|
}
|
114
114
|
async _reserve_stock(id, params, options) {
|
115
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
115
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _reserve_stock: true }, params, options);
|
116
116
|
}
|
117
117
|
async _release_stock(id, params, options) {
|
118
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
118
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _release_stock: true }, params, options);
|
119
119
|
}
|
120
120
|
async _decrement_stock(id, params, options) {
|
121
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
121
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _decrement_stock: true }, params, options);
|
122
122
|
}
|
123
123
|
async _get_rates(id, params, options) {
|
124
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
124
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _get_rates: true }, params, options);
|
125
125
|
}
|
126
126
|
async _purchase(id, params, options) {
|
127
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
127
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _purchase: true }, params, options);
|
128
128
|
}
|
129
129
|
async _add_tags(id, triggerValue, params, options) {
|
130
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
130
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _add_tags: triggerValue }, params, options);
|
131
131
|
}
|
132
132
|
async _remove_tags(id, triggerValue, params, options) {
|
133
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
133
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Shipments.TYPE, _remove_tags: triggerValue }, params, options);
|
134
134
|
}
|
135
135
|
isShipment(resource) {
|
136
|
-
return resource.type && resource.type ===
|
136
|
+
return resource.type && resource.type === Shipments.TYPE;
|
137
137
|
}
|
138
138
|
relationship(id) {
|
139
139
|
return super.relationshipOneToOne(id);
|
@@ -142,11 +142,9 @@ const _Shipments = class _Shipments extends ApiResource {
|
|
142
142
|
return super.relationshipOneToMany(...ids);
|
143
143
|
}
|
144
144
|
type() {
|
145
|
-
return
|
145
|
+
return Shipments.TYPE;
|
146
146
|
}
|
147
|
-
}
|
148
|
-
__publicField(_Shipments, "TYPE", "shipments");
|
149
|
-
let Shipments = _Shipments;
|
147
|
+
}
|
150
148
|
const instance = new Shipments();
|
151
149
|
var shipments_default = instance;
|
152
150
|
|
@@ -1,17 +1,17 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var chunkJE77HYXB_cjs = require('../chunk-JE77HYXB.cjs');
|
4
3
|
var resource = require('../resource');
|
5
4
|
|
6
|
-
|
5
|
+
class ShippingCategories extends resource.ApiResource {
|
6
|
+
static TYPE = "shipping_categories";
|
7
7
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create({ ...resource, type:
|
8
|
+
return this.resources.create({ ...resource, type: ShippingCategories.TYPE }, params, options);
|
9
9
|
}
|
10
10
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update({ ...resource, type:
|
11
|
+
return this.resources.update({ ...resource, type: ShippingCategories.TYPE }, params, options);
|
12
12
|
}
|
13
13
|
async delete(id, options) {
|
14
|
-
await this.resources.delete(typeof id === "string" ? { id, type:
|
14
|
+
await this.resources.delete(typeof id === "string" ? { id, type: ShippingCategories.TYPE } : id, options);
|
15
15
|
}
|
16
16
|
async skus(shippingCategoryId, params, options) {
|
17
17
|
const _shippingCategoryId = shippingCategoryId.id || shippingCategoryId;
|
@@ -26,7 +26,7 @@ const _ShippingCategories = class _ShippingCategories extends resource.ApiResour
|
|
26
26
|
return this.resources.fetch({ type: "versions" }, `shipping_categories/${_shippingCategoryId}/versions`, params, options);
|
27
27
|
}
|
28
28
|
isShippingCategory(resource) {
|
29
|
-
return resource.type && resource.type ===
|
29
|
+
return resource.type && resource.type === ShippingCategories.TYPE;
|
30
30
|
}
|
31
31
|
relationship(id) {
|
32
32
|
return super.relationshipOneToOne(id);
|
@@ -35,11 +35,9 @@ const _ShippingCategories = class _ShippingCategories extends resource.ApiResour
|
|
35
35
|
return super.relationshipOneToMany(...ids);
|
36
36
|
}
|
37
37
|
type() {
|
38
|
-
return
|
38
|
+
return ShippingCategories.TYPE;
|
39
39
|
}
|
40
|
-
}
|
41
|
-
chunkJE77HYXB_cjs.__publicField(_ShippingCategories, "TYPE", "shipping_categories");
|
42
|
-
let ShippingCategories = _ShippingCategories;
|
40
|
+
}
|
43
41
|
const instance = new ShippingCategories();
|
44
42
|
var shipping_categories_default = instance;
|
45
43
|
|