@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
package/lib/resources/orders.cjs
CHANGED
@@ -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 Orders extends resource.ApiResource {
|
6
|
+
static TYPE = "orders";
|
7
7
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create({ ...resource, type:
|
8
|
+
return this.resources.create({ ...resource, type: Orders.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: Orders.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: Orders.TYPE } : id, options);
|
15
15
|
}
|
16
16
|
async market(orderId, params, options) {
|
17
17
|
const _orderId = orderId.id || orderId;
|
@@ -158,106 +158,106 @@ const _Orders = class _Orders extends resource.ApiResource {
|
|
158
158
|
return this.resources.fetch({ type: "versions" }, `orders/${_orderId}/versions`, params, options);
|
159
159
|
}
|
160
160
|
async _archive(id, params, options) {
|
161
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
161
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _archive: true }, params, options);
|
162
162
|
}
|
163
163
|
async _unarchive(id, params, options) {
|
164
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
164
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _unarchive: true }, params, options);
|
165
165
|
}
|
166
166
|
async _pending(id, params, options) {
|
167
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
167
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _pending: true }, params, options);
|
168
168
|
}
|
169
169
|
async _place(id, params, options) {
|
170
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
170
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _place: true }, params, options);
|
171
171
|
}
|
172
172
|
async _cancel(id, params, options) {
|
173
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
173
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _cancel: true }, params, options);
|
174
174
|
}
|
175
175
|
async _approve(id, params, options) {
|
176
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
176
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _approve: true }, params, options);
|
177
177
|
}
|
178
178
|
async _approve_and_capture(id, params, options) {
|
179
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
179
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _approve_and_capture: true }, params, options);
|
180
180
|
}
|
181
181
|
async _authorize(id, params, options) {
|
182
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
182
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _authorize: true }, params, options);
|
183
183
|
}
|
184
184
|
async _authorization_amount_cents(id, triggerValue, params, options) {
|
185
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
185
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _authorization_amount_cents: triggerValue }, params, options);
|
186
186
|
}
|
187
187
|
async _capture(id, params, options) {
|
188
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
188
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _capture: true }, params, options);
|
189
189
|
}
|
190
190
|
async _refund(id, params, options) {
|
191
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
191
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _refund: true }, params, options);
|
192
192
|
}
|
193
193
|
async _fulfill(id, params, options) {
|
194
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
194
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _fulfill: true }, params, options);
|
195
195
|
}
|
196
196
|
async _update_taxes(id, params, options) {
|
197
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
197
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _update_taxes: true }, params, options);
|
198
198
|
}
|
199
199
|
async _nullify_payment_source(id, params, options) {
|
200
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
200
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _nullify_payment_source: true }, params, options);
|
201
201
|
}
|
202
202
|
async _fix_payment_source(id, params, options) {
|
203
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
203
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _fix_payment_source: true }, params, options);
|
204
204
|
}
|
205
205
|
async _billing_address_clone_id(id, triggerValue, params, options) {
|
206
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
206
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _billing_address_clone_id: triggerValue }, params, options);
|
207
207
|
}
|
208
208
|
async _shipping_address_clone_id(id, triggerValue, params, options) {
|
209
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
209
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _shipping_address_clone_id: triggerValue }, params, options);
|
210
210
|
}
|
211
211
|
async _customer_payment_source_id(id, triggerValue, params, options) {
|
212
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
212
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _customer_payment_source_id: triggerValue }, params, options);
|
213
213
|
}
|
214
214
|
async _shipping_address_same_as_billing(id, params, options) {
|
215
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
215
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _shipping_address_same_as_billing: true }, params, options);
|
216
216
|
}
|
217
217
|
async _billing_address_same_as_shipping(id, params, options) {
|
218
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
218
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _billing_address_same_as_shipping: true }, params, options);
|
219
219
|
}
|
220
220
|
async _commit_invoice(id, params, options) {
|
221
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
221
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _commit_invoice: true }, params, options);
|
222
222
|
}
|
223
223
|
async _refund_invoice(id, params, options) {
|
224
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
224
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _refund_invoice: true }, params, options);
|
225
225
|
}
|
226
226
|
async _save_payment_source_to_customer_wallet(id, params, options) {
|
227
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
227
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _save_payment_source_to_customer_wallet: true }, params, options);
|
228
228
|
}
|
229
229
|
async _save_shipping_address_to_customer_address_book(id, params, options) {
|
230
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
230
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _save_shipping_address_to_customer_address_book: true }, params, options);
|
231
231
|
}
|
232
232
|
async _save_billing_address_to_customer_address_book(id, params, options) {
|
233
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
233
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _save_billing_address_to_customer_address_book: true }, params, options);
|
234
234
|
}
|
235
235
|
async _refresh(id, params, options) {
|
236
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
236
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _refresh: true }, params, options);
|
237
237
|
}
|
238
238
|
async _validate(id, params, options) {
|
239
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
239
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _validate: true }, params, options);
|
240
240
|
}
|
241
241
|
async _create_subscriptions(id, params, options) {
|
242
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
242
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _create_subscriptions: true }, params, options);
|
243
243
|
}
|
244
244
|
async _start_editing(id, params, options) {
|
245
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
245
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _start_editing: true }, params, options);
|
246
246
|
}
|
247
247
|
async _stop_editing(id, params, options) {
|
248
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
248
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _stop_editing: true }, params, options);
|
249
249
|
}
|
250
250
|
async _reset_circuit(id, params, options) {
|
251
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
251
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _reset_circuit: true }, params, options);
|
252
252
|
}
|
253
253
|
async _add_tags(id, triggerValue, params, options) {
|
254
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
254
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _add_tags: triggerValue }, params, options);
|
255
255
|
}
|
256
256
|
async _remove_tags(id, triggerValue, params, options) {
|
257
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
257
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _remove_tags: triggerValue }, params, options);
|
258
258
|
}
|
259
259
|
isOrder(resource) {
|
260
|
-
return resource.type && resource.type ===
|
260
|
+
return resource.type && resource.type === Orders.TYPE;
|
261
261
|
}
|
262
262
|
relationship(id) {
|
263
263
|
return super.relationshipOneToOne(id);
|
@@ -266,11 +266,9 @@ const _Orders = class _Orders extends resource.ApiResource {
|
|
266
266
|
return super.relationshipOneToMany(...ids);
|
267
267
|
}
|
268
268
|
type() {
|
269
|
-
return
|
269
|
+
return Orders.TYPE;
|
270
270
|
}
|
271
|
-
}
|
272
|
-
chunkJE77HYXB_cjs.__publicField(_Orders, "TYPE", "orders");
|
273
|
-
let Orders = _Orders;
|
271
|
+
}
|
274
272
|
const instance = new Orders();
|
275
273
|
var orders_default = instance;
|
276
274
|
|
package/lib/resources/orders.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class Orders extends ApiResource {
|
4
|
+
static TYPE = "orders";
|
5
5
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type:
|
6
|
+
return this.resources.create({ ...resource, type: Orders.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: Orders.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: Orders.TYPE } : id, options);
|
13
13
|
}
|
14
14
|
async market(orderId, params, options) {
|
15
15
|
const _orderId = orderId.id || orderId;
|
@@ -156,106 +156,106 @@ const _Orders = class _Orders extends ApiResource {
|
|
156
156
|
return this.resources.fetch({ type: "versions" }, `orders/${_orderId}/versions`, params, options);
|
157
157
|
}
|
158
158
|
async _archive(id, params, options) {
|
159
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
159
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _archive: true }, params, options);
|
160
160
|
}
|
161
161
|
async _unarchive(id, params, options) {
|
162
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
162
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _unarchive: true }, params, options);
|
163
163
|
}
|
164
164
|
async _pending(id, params, options) {
|
165
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
165
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _pending: true }, params, options);
|
166
166
|
}
|
167
167
|
async _place(id, params, options) {
|
168
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
168
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _place: true }, params, options);
|
169
169
|
}
|
170
170
|
async _cancel(id, params, options) {
|
171
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
171
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _cancel: true }, params, options);
|
172
172
|
}
|
173
173
|
async _approve(id, params, options) {
|
174
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
174
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _approve: true }, params, options);
|
175
175
|
}
|
176
176
|
async _approve_and_capture(id, params, options) {
|
177
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
177
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _approve_and_capture: true }, params, options);
|
178
178
|
}
|
179
179
|
async _authorize(id, params, options) {
|
180
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
180
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _authorize: true }, params, options);
|
181
181
|
}
|
182
182
|
async _authorization_amount_cents(id, triggerValue, params, options) {
|
183
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
183
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _authorization_amount_cents: triggerValue }, params, options);
|
184
184
|
}
|
185
185
|
async _capture(id, params, options) {
|
186
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
186
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _capture: true }, params, options);
|
187
187
|
}
|
188
188
|
async _refund(id, params, options) {
|
189
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
189
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _refund: true }, params, options);
|
190
190
|
}
|
191
191
|
async _fulfill(id, params, options) {
|
192
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
192
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _fulfill: true }, params, options);
|
193
193
|
}
|
194
194
|
async _update_taxes(id, params, options) {
|
195
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
195
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _update_taxes: true }, params, options);
|
196
196
|
}
|
197
197
|
async _nullify_payment_source(id, params, options) {
|
198
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
198
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _nullify_payment_source: true }, params, options);
|
199
199
|
}
|
200
200
|
async _fix_payment_source(id, params, options) {
|
201
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
201
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _fix_payment_source: true }, params, options);
|
202
202
|
}
|
203
203
|
async _billing_address_clone_id(id, triggerValue, params, options) {
|
204
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
204
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _billing_address_clone_id: triggerValue }, params, options);
|
205
205
|
}
|
206
206
|
async _shipping_address_clone_id(id, triggerValue, params, options) {
|
207
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
207
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _shipping_address_clone_id: triggerValue }, params, options);
|
208
208
|
}
|
209
209
|
async _customer_payment_source_id(id, triggerValue, params, options) {
|
210
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
210
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _customer_payment_source_id: triggerValue }, params, options);
|
211
211
|
}
|
212
212
|
async _shipping_address_same_as_billing(id, params, options) {
|
213
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
213
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _shipping_address_same_as_billing: true }, params, options);
|
214
214
|
}
|
215
215
|
async _billing_address_same_as_shipping(id, params, options) {
|
216
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
216
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _billing_address_same_as_shipping: true }, params, options);
|
217
217
|
}
|
218
218
|
async _commit_invoice(id, params, options) {
|
219
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
219
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _commit_invoice: true }, params, options);
|
220
220
|
}
|
221
221
|
async _refund_invoice(id, params, options) {
|
222
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
222
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _refund_invoice: true }, params, options);
|
223
223
|
}
|
224
224
|
async _save_payment_source_to_customer_wallet(id, params, options) {
|
225
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
225
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _save_payment_source_to_customer_wallet: true }, params, options);
|
226
226
|
}
|
227
227
|
async _save_shipping_address_to_customer_address_book(id, params, options) {
|
228
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
228
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _save_shipping_address_to_customer_address_book: true }, params, options);
|
229
229
|
}
|
230
230
|
async _save_billing_address_to_customer_address_book(id, params, options) {
|
231
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
231
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _save_billing_address_to_customer_address_book: true }, params, options);
|
232
232
|
}
|
233
233
|
async _refresh(id, params, options) {
|
234
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
234
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _refresh: true }, params, options);
|
235
235
|
}
|
236
236
|
async _validate(id, params, options) {
|
237
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
237
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _validate: true }, params, options);
|
238
238
|
}
|
239
239
|
async _create_subscriptions(id, params, options) {
|
240
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
240
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _create_subscriptions: true }, params, options);
|
241
241
|
}
|
242
242
|
async _start_editing(id, params, options) {
|
243
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
243
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _start_editing: true }, params, options);
|
244
244
|
}
|
245
245
|
async _stop_editing(id, params, options) {
|
246
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
246
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _stop_editing: true }, params, options);
|
247
247
|
}
|
248
248
|
async _reset_circuit(id, params, options) {
|
249
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
249
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _reset_circuit: true }, params, options);
|
250
250
|
}
|
251
251
|
async _add_tags(id, triggerValue, params, options) {
|
252
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
252
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _add_tags: triggerValue }, params, options);
|
253
253
|
}
|
254
254
|
async _remove_tags(id, triggerValue, params, options) {
|
255
|
-
return this.resources.update({ id: typeof id === "string" ? id : id.id, type:
|
255
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: Orders.TYPE, _remove_tags: triggerValue }, params, options);
|
256
256
|
}
|
257
257
|
isOrder(resource) {
|
258
|
-
return resource.type && resource.type ===
|
258
|
+
return resource.type && resource.type === Orders.TYPE;
|
259
259
|
}
|
260
260
|
relationship(id) {
|
261
261
|
return super.relationshipOneToOne(id);
|
@@ -264,11 +264,9 @@ const _Orders = class _Orders extends ApiResource {
|
|
264
264
|
return super.relationshipOneToMany(...ids);
|
265
265
|
}
|
266
266
|
type() {
|
267
|
-
return
|
267
|
+
return Orders.TYPE;
|
268
268
|
}
|
269
|
-
}
|
270
|
-
__publicField(_Orders, "TYPE", "orders");
|
271
|
-
let Orders = _Orders;
|
269
|
+
}
|
272
270
|
const instance = new Orders();
|
273
271
|
var orders_default = instance;
|
274
272
|
|
@@ -1,11 +1,11 @@
|
|
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 Organizations extends resource.ApiSingleton {
|
6
|
+
static TYPE = "organizations";
|
7
7
|
isOrganization(resource) {
|
8
|
-
return resource.type && resource.type ===
|
8
|
+
return resource.type && resource.type === Organizations.TYPE;
|
9
9
|
}
|
10
10
|
relationship(id) {
|
11
11
|
return super.relationshipOneToOne(id);
|
@@ -14,14 +14,12 @@ const _Organizations = class _Organizations extends resource.ApiSingleton {
|
|
14
14
|
return super.relationshipOneToMany(...ids);
|
15
15
|
}
|
16
16
|
type() {
|
17
|
-
return
|
17
|
+
return Organizations.TYPE;
|
18
18
|
}
|
19
19
|
path() {
|
20
20
|
return "organization";
|
21
21
|
}
|
22
|
-
}
|
23
|
-
chunkJE77HYXB_cjs.__publicField(_Organizations, "TYPE", "organizations");
|
24
|
-
let Organizations = _Organizations;
|
22
|
+
}
|
25
23
|
const instance = new Organizations();
|
26
24
|
var organizations_default = instance;
|
27
25
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiSingleton } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class Organizations extends ApiSingleton {
|
4
|
+
static TYPE = "organizations";
|
5
5
|
isOrganization(resource) {
|
6
|
-
return resource.type && resource.type ===
|
6
|
+
return resource.type && resource.type === Organizations.TYPE;
|
7
7
|
}
|
8
8
|
relationship(id) {
|
9
9
|
return super.relationshipOneToOne(id);
|
@@ -12,14 +12,12 @@ const _Organizations = class _Organizations extends ApiSingleton {
|
|
12
12
|
return super.relationshipOneToMany(...ids);
|
13
13
|
}
|
14
14
|
type() {
|
15
|
-
return
|
15
|
+
return Organizations.TYPE;
|
16
16
|
}
|
17
17
|
path() {
|
18
18
|
return "organization";
|
19
19
|
}
|
20
|
-
}
|
21
|
-
__publicField(_Organizations, "TYPE", "organizations");
|
22
|
-
let Organizations = _Organizations;
|
20
|
+
}
|
23
21
|
const instance = new Organizations();
|
24
22
|
var organizations_default = instance;
|
25
23
|
|
@@ -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 Packages extends resource.ApiResource {
|
6
|
+
static TYPE = "packages";
|
7
7
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create({ ...resource, type:
|
8
|
+
return this.resources.create({ ...resource, type: Packages.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: Packages.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: Packages.TYPE } : id, options);
|
15
15
|
}
|
16
16
|
async stock_location(packageId, params, options) {
|
17
17
|
const _packageId = packageId.id || packageId;
|
@@ -30,7 +30,7 @@ const _Packages = class _Packages extends resource.ApiResource {
|
|
30
30
|
return this.resources.fetch({ type: "versions" }, `packages/${_packageId}/versions`, params, options);
|
31
31
|
}
|
32
32
|
isPackage(resource) {
|
33
|
-
return resource.type && resource.type ===
|
33
|
+
return resource.type && resource.type === Packages.TYPE;
|
34
34
|
}
|
35
35
|
relationship(id) {
|
36
36
|
return super.relationshipOneToOne(id);
|
@@ -39,11 +39,9 @@ const _Packages = class _Packages extends resource.ApiResource {
|
|
39
39
|
return super.relationshipOneToMany(...ids);
|
40
40
|
}
|
41
41
|
type() {
|
42
|
-
return
|
42
|
+
return Packages.TYPE;
|
43
43
|
}
|
44
|
-
}
|
45
|
-
chunkJE77HYXB_cjs.__publicField(_Packages, "TYPE", "packages");
|
46
|
-
let Packages = _Packages;
|
44
|
+
}
|
47
45
|
const instance = new Packages();
|
48
46
|
var packages_default = instance;
|
49
47
|
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import { __publicField } from '../chunk-AQ5VUG5P.js';
|
2
1
|
import { ApiResource } from '../resource';
|
3
2
|
|
4
|
-
|
3
|
+
class Packages extends ApiResource {
|
4
|
+
static TYPE = "packages";
|
5
5
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type:
|
6
|
+
return this.resources.create({ ...resource, type: Packages.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: Packages.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: Packages.TYPE } : id, options);
|
13
13
|
}
|
14
14
|
async stock_location(packageId, params, options) {
|
15
15
|
const _packageId = packageId.id || packageId;
|
@@ -28,7 +28,7 @@ const _Packages = class _Packages extends ApiResource {
|
|
28
28
|
return this.resources.fetch({ type: "versions" }, `packages/${_packageId}/versions`, params, options);
|
29
29
|
}
|
30
30
|
isPackage(resource) {
|
31
|
-
return resource.type && resource.type ===
|
31
|
+
return resource.type && resource.type === Packages.TYPE;
|
32
32
|
}
|
33
33
|
relationship(id) {
|
34
34
|
return super.relationshipOneToOne(id);
|
@@ -37,11 +37,9 @@ const _Packages = class _Packages extends ApiResource {
|
|
37
37
|
return super.relationshipOneToMany(...ids);
|
38
38
|
}
|
39
39
|
type() {
|
40
|
-
return
|
40
|
+
return Packages.TYPE;
|
41
41
|
}
|
42
|
-
}
|
43
|
-
__publicField(_Packages, "TYPE", "packages");
|
44
|
-
let Packages = _Packages;
|
42
|
+
}
|
45
43
|
const instance = new Packages();
|
46
44
|
var packages_default = instance;
|
47
45
|
|
@@ -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 ParcelLineItems extends resource.ApiResource {
|
6
|
+
static TYPE = "parcel_line_items";
|
7
7
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create({ ...resource, type:
|
8
|
+
return this.resources.create({ ...resource, type: ParcelLineItems.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: ParcelLineItems.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: ParcelLineItems.TYPE } : id, options);
|
15
15
|
}
|
16
16
|
async parcel(parcelLineItemId, params, options) {
|
17
17
|
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
@@ -26,7 +26,7 @@ const _ParcelLineItems = class _ParcelLineItems extends resource.ApiResource {
|
|
26
26
|
return this.resources.fetch({ type: "versions" }, `parcel_line_items/${_parcelLineItemId}/versions`, params, options);
|
27
27
|
}
|
28
28
|
isParcelLineItem(resource) {
|
29
|
-
return resource.type && resource.type ===
|
29
|
+
return resource.type && resource.type === ParcelLineItems.TYPE;
|
30
30
|
}
|
31
31
|
relationship(id) {
|
32
32
|
return super.relationshipOneToOne(id);
|
@@ -35,11 +35,9 @@ const _ParcelLineItems = class _ParcelLineItems extends resource.ApiResource {
|
|
35
35
|
return super.relationshipOneToMany(...ids);
|
36
36
|
}
|
37
37
|
type() {
|
38
|
-
return
|
38
|
+
return ParcelLineItems.TYPE;
|
39
39
|
}
|
40
|
-
}
|
41
|
-
chunkJE77HYXB_cjs.__publicField(_ParcelLineItems, "TYPE", "parcel_line_items");
|
42
|
-
let ParcelLineItems = _ParcelLineItems;
|
40
|
+
}
|
43
41
|
const instance = new ParcelLineItems();
|
44
42
|
var parcel_line_items_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 ParcelLineItems extends ApiResource {
|
4
|
+
static TYPE = "parcel_line_items";
|
5
5
|
async create(resource, params, options) {
|
6
|
-
return this.resources.create({ ...resource, type:
|
6
|
+
return this.resources.create({ ...resource, type: ParcelLineItems.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: ParcelLineItems.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: ParcelLineItems.TYPE } : id, options);
|
13
13
|
}
|
14
14
|
async parcel(parcelLineItemId, params, options) {
|
15
15
|
const _parcelLineItemId = parcelLineItemId.id || parcelLineItemId;
|
@@ -24,7 +24,7 @@ const _ParcelLineItems = class _ParcelLineItems extends ApiResource {
|
|
24
24
|
return this.resources.fetch({ type: "versions" }, `parcel_line_items/${_parcelLineItemId}/versions`, params, options);
|
25
25
|
}
|
26
26
|
isParcelLineItem(resource) {
|
27
|
-
return resource.type && resource.type ===
|
27
|
+
return resource.type && resource.type === ParcelLineItems.TYPE;
|
28
28
|
}
|
29
29
|
relationship(id) {
|
30
30
|
return super.relationshipOneToOne(id);
|
@@ -33,11 +33,9 @@ const _ParcelLineItems = class _ParcelLineItems extends ApiResource {
|
|
33
33
|
return super.relationshipOneToMany(...ids);
|
34
34
|
}
|
35
35
|
type() {
|
36
|
-
return
|
36
|
+
return ParcelLineItems.TYPE;
|
37
37
|
}
|
38
|
-
}
|
39
|
-
__publicField(_ParcelLineItems, "TYPE", "parcel_line_items");
|
40
|
-
let ParcelLineItems = _ParcelLineItems;
|
38
|
+
}
|
41
39
|
const instance = new ParcelLineItems();
|
42
40
|
var parcel_line_items_default = instance;
|
43
41
|
|