@commercelayer/sdk 5.0.0-beta.4 → 5.0.0-beta.6
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/cjs/client.js +8 -3
- package/lib/cjs/commercelayer.d.ts +2 -2
- package/lib/cjs/commercelayer.js +1 -1
- package/lib/cjs/error.js +1 -1
- package/lib/cjs/jsonapi.js +5 -1
- package/lib/cjs/resource.js +7 -7
- package/lib/cjs/resources/addresses.js +2 -3
- package/lib/cjs/resources/adjustments.js +2 -3
- package/lib/cjs/resources/adyen_gateways.js +2 -3
- package/lib/cjs/resources/adyen_payments.js +2 -3
- package/lib/cjs/resources/application.js +0 -1
- package/lib/cjs/resources/attachments.js +2 -3
- package/lib/cjs/resources/authorizations.js +1 -2
- package/lib/cjs/resources/avalara_accounts.js +2 -3
- package/lib/cjs/resources/axerve_gateways.js +2 -3
- package/lib/cjs/resources/axerve_payments.js +2 -3
- package/lib/cjs/resources/billing_info_validation_rules.js +2 -3
- package/lib/cjs/resources/bing_geocoders.js +2 -3
- package/lib/cjs/resources/braintree_gateways.js +2 -3
- package/lib/cjs/resources/braintree_payments.js +2 -3
- package/lib/cjs/resources/bundles.js +2 -3
- package/lib/cjs/resources/captures.js +1 -2
- package/lib/cjs/resources/carrier_accounts.js +0 -1
- package/lib/cjs/resources/checkout_com_gateways.js +2 -3
- package/lib/cjs/resources/checkout_com_payments.js +2 -3
- package/lib/cjs/resources/cleanups.js +1 -2
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +2 -3
- package/lib/cjs/resources/coupon_recipients.js +2 -3
- package/lib/cjs/resources/coupons.js +2 -3
- package/lib/cjs/resources/customer_addresses.js +2 -3
- package/lib/cjs/resources/customer_groups.js +2 -3
- package/lib/cjs/resources/customer_password_resets.js +2 -3
- package/lib/cjs/resources/customer_payment_sources.js +2 -3
- package/lib/cjs/resources/customer_subscriptions.js +2 -3
- package/lib/cjs/resources/customers.js +2 -3
- package/lib/cjs/resources/delivery_lead_times.js +2 -3
- package/lib/cjs/resources/event_callbacks.js +0 -1
- package/lib/cjs/resources/events.js +0 -1
- package/lib/cjs/resources/exports.js +1 -2
- package/lib/cjs/resources/external_gateways.js +2 -3
- package/lib/cjs/resources/external_payments.js +2 -3
- package/lib/cjs/resources/external_promotions.js +2 -3
- package/lib/cjs/resources/external_tax_calculators.js +2 -3
- package/lib/cjs/resources/fixed_amount_promotions.js +2 -3
- package/lib/cjs/resources/fixed_price_promotions.js +2 -3
- package/lib/cjs/resources/free_gift_promotions.js +2 -3
- package/lib/cjs/resources/free_shipping_promotions.js +2 -3
- package/lib/cjs/resources/geocoders.js +0 -1
- package/lib/cjs/resources/gift_card_recipients.js +2 -3
- package/lib/cjs/resources/gift_cards.js +2 -3
- package/lib/cjs/resources/google_geocoders.js +2 -3
- package/lib/cjs/resources/imports.js +1 -2
- package/lib/cjs/resources/in_stock_subscriptions.js +2 -3
- package/lib/cjs/resources/inventory_models.js +2 -3
- package/lib/cjs/resources/inventory_return_locations.js +2 -3
- package/lib/cjs/resources/inventory_stock_locations.js +2 -3
- package/lib/cjs/resources/klarna_gateways.js +2 -3
- package/lib/cjs/resources/klarna_payments.js +2 -3
- package/lib/cjs/resources/line_item_options.js +2 -3
- package/lib/cjs/resources/line_items.d.ts +2 -2
- package/lib/cjs/resources/line_items.js +2 -3
- package/lib/cjs/resources/manual_gateways.js +2 -3
- package/lib/cjs/resources/manual_tax_calculators.js +2 -3
- package/lib/cjs/resources/markets.js +2 -3
- package/lib/cjs/resources/merchants.js +2 -3
- package/lib/cjs/resources/order_amount_promotion_rules.js +2 -3
- package/lib/cjs/resources/order_copies.js +1 -2
- package/lib/cjs/resources/order_subscriptions.js +2 -3
- package/lib/cjs/resources/order_validation_rules.js +0 -1
- package/lib/cjs/resources/orders.d.ts +2 -2
- package/lib/cjs/resources/orders.js +2 -3
- package/lib/cjs/resources/organization.js +0 -1
- package/lib/cjs/resources/packages.js +2 -3
- package/lib/cjs/resources/parcel_line_items.js +2 -3
- package/lib/cjs/resources/parcels.js +2 -3
- package/lib/cjs/resources/payment_gateways.js +0 -1
- package/lib/cjs/resources/payment_methods.js +2 -3
- package/lib/cjs/resources/paypal_gateways.js +2 -3
- package/lib/cjs/resources/paypal_payments.js +2 -3
- package/lib/cjs/resources/percentage_discount_promotions.js +2 -3
- package/lib/cjs/resources/price_lists.js +2 -3
- package/lib/cjs/resources/price_tiers.js +0 -1
- package/lib/cjs/resources/price_volume_tiers.js +2 -3
- package/lib/cjs/resources/prices.js +2 -3
- package/lib/cjs/resources/promotion_rules.js +0 -1
- package/lib/cjs/resources/promotions.js +0 -1
- package/lib/cjs/resources/refunds.js +0 -1
- package/lib/cjs/resources/return_line_items.js +2 -3
- package/lib/cjs/resources/returns.js +2 -3
- package/lib/cjs/resources/satispay_gateways.js +2 -3
- package/lib/cjs/resources/satispay_payments.js +2 -3
- package/lib/cjs/resources/shipments.js +1 -2
- package/lib/cjs/resources/shipping_categories.js +2 -3
- package/lib/cjs/resources/shipping_method_tiers.js +0 -1
- package/lib/cjs/resources/shipping_methods.js +2 -3
- package/lib/cjs/resources/shipping_weight_tiers.js +2 -3
- package/lib/cjs/resources/shipping_zones.js +2 -3
- package/lib/cjs/resources/sku_list_items.js +2 -3
- package/lib/cjs/resources/sku_list_promotion_rules.js +2 -3
- package/lib/cjs/resources/sku_lists.js +2 -3
- package/lib/cjs/resources/sku_options.js +2 -3
- package/lib/cjs/resources/skus.js +2 -3
- package/lib/cjs/resources/stock_items.js +2 -3
- package/lib/cjs/resources/stock_line_items.js +0 -1
- package/lib/cjs/resources/stock_locations.js +2 -3
- package/lib/cjs/resources/stock_transfers.js +2 -3
- package/lib/cjs/resources/stripe_gateways.js +2 -3
- package/lib/cjs/resources/stripe_payments.js +2 -3
- package/lib/cjs/resources/tax_calculators.js +0 -1
- package/lib/cjs/resources/tax_categories.js +2 -3
- package/lib/cjs/resources/tax_rules.js +2 -3
- package/lib/cjs/resources/taxjar_accounts.js +2 -3
- package/lib/cjs/resources/transactions.js +0 -1
- package/lib/cjs/resources/voids.js +0 -1
- package/lib/cjs/resources/webhooks.js +2 -3
- package/lib/cjs/resources/wire_transfers.js +2 -3
- package/lib/esm/client.js +8 -3
- package/lib/esm/commercelayer.d.ts +2 -2
- package/lib/esm/commercelayer.js +1 -1
- package/lib/esm/error.js +1 -1
- package/lib/esm/jsonapi.js +5 -1
- package/lib/esm/resource.js +7 -7
- package/lib/esm/resources/addresses.js +2 -3
- package/lib/esm/resources/adjustments.js +2 -3
- package/lib/esm/resources/adyen_gateways.js +2 -3
- package/lib/esm/resources/adyen_payments.js +2 -3
- package/lib/esm/resources/application.js +0 -1
- package/lib/esm/resources/attachments.js +2 -3
- package/lib/esm/resources/authorizations.js +1 -2
- package/lib/esm/resources/avalara_accounts.js +2 -3
- package/lib/esm/resources/axerve_gateways.js +2 -3
- package/lib/esm/resources/axerve_payments.js +2 -3
- package/lib/esm/resources/billing_info_validation_rules.js +2 -3
- package/lib/esm/resources/bing_geocoders.js +2 -3
- package/lib/esm/resources/braintree_gateways.js +2 -3
- package/lib/esm/resources/braintree_payments.js +2 -3
- package/lib/esm/resources/bundles.js +2 -3
- package/lib/esm/resources/captures.js +1 -2
- package/lib/esm/resources/carrier_accounts.js +0 -1
- package/lib/esm/resources/checkout_com_gateways.js +2 -3
- package/lib/esm/resources/checkout_com_payments.js +2 -3
- package/lib/esm/resources/cleanups.js +1 -2
- package/lib/esm/resources/coupon_codes_promotion_rules.js +2 -3
- package/lib/esm/resources/coupon_recipients.js +2 -3
- package/lib/esm/resources/coupons.js +2 -3
- package/lib/esm/resources/customer_addresses.js +2 -3
- package/lib/esm/resources/customer_groups.js +2 -3
- package/lib/esm/resources/customer_password_resets.js +2 -3
- package/lib/esm/resources/customer_payment_sources.js +2 -3
- package/lib/esm/resources/customer_subscriptions.js +2 -3
- package/lib/esm/resources/customers.js +2 -3
- package/lib/esm/resources/delivery_lead_times.js +2 -3
- package/lib/esm/resources/event_callbacks.js +0 -1
- package/lib/esm/resources/events.js +0 -1
- package/lib/esm/resources/exports.js +1 -2
- package/lib/esm/resources/external_gateways.js +2 -3
- package/lib/esm/resources/external_payments.js +2 -3
- package/lib/esm/resources/external_promotions.js +2 -3
- package/lib/esm/resources/external_tax_calculators.js +2 -3
- package/lib/esm/resources/fixed_amount_promotions.js +2 -3
- package/lib/esm/resources/fixed_price_promotions.js +2 -3
- package/lib/esm/resources/free_gift_promotions.js +2 -3
- package/lib/esm/resources/free_shipping_promotions.js +2 -3
- package/lib/esm/resources/geocoders.js +0 -1
- package/lib/esm/resources/gift_card_recipients.js +2 -3
- package/lib/esm/resources/gift_cards.js +2 -3
- package/lib/esm/resources/google_geocoders.js +2 -3
- package/lib/esm/resources/imports.js +1 -2
- package/lib/esm/resources/in_stock_subscriptions.js +2 -3
- package/lib/esm/resources/inventory_models.js +2 -3
- package/lib/esm/resources/inventory_return_locations.js +2 -3
- package/lib/esm/resources/inventory_stock_locations.js +2 -3
- package/lib/esm/resources/klarna_gateways.js +2 -3
- package/lib/esm/resources/klarna_payments.js +2 -3
- package/lib/esm/resources/line_item_options.js +2 -3
- package/lib/esm/resources/line_items.d.ts +2 -2
- package/lib/esm/resources/line_items.js +2 -3
- package/lib/esm/resources/manual_gateways.js +2 -3
- package/lib/esm/resources/manual_tax_calculators.js +2 -3
- package/lib/esm/resources/markets.js +2 -3
- package/lib/esm/resources/merchants.js +2 -3
- package/lib/esm/resources/order_amount_promotion_rules.js +2 -3
- package/lib/esm/resources/order_copies.js +1 -2
- package/lib/esm/resources/order_subscriptions.js +2 -3
- package/lib/esm/resources/order_validation_rules.js +0 -1
- package/lib/esm/resources/orders.d.ts +2 -2
- package/lib/esm/resources/orders.js +2 -3
- package/lib/esm/resources/organization.js +0 -1
- package/lib/esm/resources/packages.js +2 -3
- package/lib/esm/resources/parcel_line_items.js +2 -3
- package/lib/esm/resources/parcels.js +2 -3
- package/lib/esm/resources/payment_gateways.js +0 -1
- package/lib/esm/resources/payment_methods.js +2 -3
- package/lib/esm/resources/paypal_gateways.js +2 -3
- package/lib/esm/resources/paypal_payments.js +2 -3
- package/lib/esm/resources/percentage_discount_promotions.js +2 -3
- package/lib/esm/resources/price_lists.js +2 -3
- package/lib/esm/resources/price_tiers.js +0 -1
- package/lib/esm/resources/price_volume_tiers.js +2 -3
- package/lib/esm/resources/prices.js +2 -3
- package/lib/esm/resources/promotion_rules.js +0 -1
- package/lib/esm/resources/promotions.js +0 -1
- package/lib/esm/resources/refunds.js +0 -1
- package/lib/esm/resources/return_line_items.js +2 -3
- package/lib/esm/resources/returns.js +2 -3
- package/lib/esm/resources/satispay_gateways.js +2 -3
- package/lib/esm/resources/satispay_payments.js +2 -3
- package/lib/esm/resources/shipments.js +1 -2
- package/lib/esm/resources/shipping_categories.js +2 -3
- package/lib/esm/resources/shipping_method_tiers.js +0 -1
- package/lib/esm/resources/shipping_methods.js +2 -3
- package/lib/esm/resources/shipping_weight_tiers.js +2 -3
- package/lib/esm/resources/shipping_zones.js +2 -3
- package/lib/esm/resources/sku_list_items.js +2 -3
- package/lib/esm/resources/sku_list_promotion_rules.js +2 -3
- package/lib/esm/resources/sku_lists.js +2 -3
- package/lib/esm/resources/sku_options.js +2 -3
- package/lib/esm/resources/skus.js +2 -3
- package/lib/esm/resources/stock_items.js +2 -3
- package/lib/esm/resources/stock_line_items.js +0 -1
- package/lib/esm/resources/stock_locations.js +2 -3
- package/lib/esm/resources/stock_transfers.js +2 -3
- package/lib/esm/resources/stripe_gateways.js +2 -3
- package/lib/esm/resources/stripe_payments.js +2 -3
- package/lib/esm/resources/tax_calculators.js +0 -1
- package/lib/esm/resources/tax_categories.js +2 -3
- package/lib/esm/resources/tax_rules.js +2 -3
- package/lib/esm/resources/taxjar_accounts.js +2 -3
- package/lib/esm/resources/transactions.js +0 -1
- package/lib/esm/resources/voids.js +0 -1
- package/lib/esm/resources/webhooks.js +2 -3
- package/lib/esm/resources/wire_transfers.js +2 -3
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class LineItemOptions extends ApiResource {
|
3
|
-
// static readonly PATH = 'line_item_options'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: LineItemOptions.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: LineItemOptions.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: LineItemOptions.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: LineItemOptions.TYPE } : id, options);
|
@@ -77,7 +77,7 @@ interface LineItem extends Resource {
|
|
77
77
|
discount_breakdown?: object;
|
78
78
|
tax_rate?: number;
|
79
79
|
tax_breakdown?: object;
|
80
|
-
item_type?:
|
80
|
+
item_type?: 'sku' | 'bundle' | 'shipment' | 'payment_method' | 'adjustment' | 'gift_card' | 'percentage_discount_promotion' | 'free_shipping_promotion' | 'free_gift_promotion' | 'fixed_price_promotion' | 'external_promotion' | 'fixed_amount_promotion';
|
81
81
|
order?: Order;
|
82
82
|
item?: Adjustment | Bundle | ExternalPromotion | FixedAmountPromotion | FreeShippingPromotion | GiftCard | PaymentMethod | PercentageDiscountPromotion | Shipment | Sku;
|
83
83
|
line_item_options?: LineItemOption[];
|
@@ -97,7 +97,7 @@ interface LineItemCreate extends ResourceCreate {
|
|
97
97
|
unit_amount_cents?: number;
|
98
98
|
name?: string;
|
99
99
|
image_url?: string;
|
100
|
-
item_type?:
|
100
|
+
item_type?: 'sku' | 'bundle' | 'shipment' | 'payment_method' | 'adjustment' | 'gift_card' | 'percentage_discount_promotion' | 'free_shipping_promotion' | 'free_gift_promotion' | 'fixed_price_promotion' | 'external_promotion' | 'fixed_amount_promotion';
|
101
101
|
order: OrderRel;
|
102
102
|
item?: AdjustmentRel | BundleRel | ExternalPromotionRel | FixedAmountPromotionRel | FreeShippingPromotionRel | GiftCardRel | PaymentMethodRel | PercentageDiscountPromotionRel | ShipmentRel | SkuRel;
|
103
103
|
}
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class LineItems extends ApiResource {
|
3
|
-
// static readonly PATH = 'line_items'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: LineItems.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: LineItems.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: LineItems.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: LineItems.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ManualGateways extends ApiResource {
|
3
|
-
// static readonly PATH = 'manual_gateways'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: ManualGateways.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: ManualGateways.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: ManualGateways.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: ManualGateways.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ManualTaxCalculators extends ApiResource {
|
3
|
-
// static readonly PATH = 'manual_tax_calculators'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: ManualTaxCalculators.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: ManualTaxCalculators.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: ManualTaxCalculators.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: ManualTaxCalculators.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Markets extends ApiResource {
|
3
|
-
// static readonly PATH = 'markets'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: Markets.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: Markets.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: Markets.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: Markets.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Merchants extends ApiResource {
|
3
|
-
// static readonly PATH = 'merchants'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: Merchants.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: Merchants.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: Merchants.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: Merchants.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class OrderAmountPromotionRules extends ApiResource {
|
3
|
-
// static readonly PATH = 'order_amount_promotion_rules'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: OrderAmountPromotionRules.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: OrderAmountPromotionRules.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: OrderAmountPromotionRules.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: OrderAmountPromotionRules.TYPE } : id, options);
|
@@ -1,11 +1,10 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class OrderCopies extends ApiResource {
|
3
|
-
// static readonly PATH = 'order_copies'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: OrderCopies.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: OrderCopies.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async delete(id, options) {
|
11
10
|
await this.resources.delete((typeof id === 'string') ? { id, type: OrderCopies.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class OrderSubscriptions extends ApiResource {
|
3
|
-
// static readonly PATH = 'order_subscriptions'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: OrderSubscriptions.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: OrderSubscriptions.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: OrderSubscriptions.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: OrderSubscriptions.TYPE } : id, options);
|
@@ -79,8 +79,8 @@ interface Order extends Resource {
|
|
79
79
|
number?: number;
|
80
80
|
autorefresh?: boolean;
|
81
81
|
status?: 'draft' | 'pending' | 'placed' | 'approved' | 'cancelled';
|
82
|
-
payment_status?: 'unpaid' | 'authorized' | 'paid' | 'voided' | 'refunded';
|
83
|
-
fulfillment_status?: 'unfulfilled' | 'in_progress' | 'fulfilled';
|
82
|
+
payment_status?: 'unpaid' | 'authorized' | 'paid' | 'voided' | 'refunded' | 'free';
|
83
|
+
fulfillment_status?: 'unfulfilled' | 'in_progress' | 'fulfilled' | 'not_required';
|
84
84
|
guest?: boolean;
|
85
85
|
editable?: boolean;
|
86
86
|
customer_email?: string;
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Orders extends ApiResource {
|
3
|
-
// static readonly PATH = 'orders'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: Orders.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: Orders.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: Orders.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: Orders.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Packages extends ApiResource {
|
3
|
-
// static readonly PATH = 'packages'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: Packages.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: Packages.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: Packages.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: Packages.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ParcelLineItems extends ApiResource {
|
3
|
-
// static readonly PATH = 'parcel_line_items'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: ParcelLineItems.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: ParcelLineItems.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: ParcelLineItems.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: ParcelLineItems.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Parcels extends ApiResource {
|
3
|
-
// static readonly PATH = 'parcels'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: Parcels.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: Parcels.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: Parcels.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: Parcels.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PaymentMethods extends ApiResource {
|
3
|
-
// static readonly PATH = 'payment_methods'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: PaymentMethods.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: PaymentMethods.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: PaymentMethods.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: PaymentMethods.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PaypalGateways extends ApiResource {
|
3
|
-
// static readonly PATH = 'paypal_gateways'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: PaypalGateways.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: PaypalGateways.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: PaypalGateways.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: PaypalGateways.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PaypalPayments extends ApiResource {
|
3
|
-
// static readonly PATH = 'paypal_payments'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: PaypalPayments.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: PaypalPayments.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: PaypalPayments.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: PaypalPayments.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PercentageDiscountPromotions extends ApiResource {
|
3
|
-
// static readonly PATH = 'percentage_discount_promotions'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: PercentageDiscountPromotions.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: PercentageDiscountPromotions.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: PercentageDiscountPromotions.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: PercentageDiscountPromotions.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PriceLists extends ApiResource {
|
3
|
-
// static readonly PATH = 'price_lists'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: PriceLists.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: PriceLists.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: PriceLists.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: PriceLists.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PriceVolumeTiers extends ApiResource {
|
3
|
-
// static readonly PATH = 'price_volume_tiers'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: PriceVolumeTiers.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: PriceVolumeTiers.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: PriceVolumeTiers.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: PriceVolumeTiers.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Prices extends ApiResource {
|
3
|
-
// static readonly PATH = 'prices'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: Prices.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: Prices.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: Prices.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: Prices.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ReturnLineItems extends ApiResource {
|
3
|
-
// static readonly PATH = 'return_line_items'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: ReturnLineItems.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: ReturnLineItems.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: ReturnLineItems.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: ReturnLineItems.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Returns extends ApiResource {
|
3
|
-
// static readonly PATH = 'returns'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: Returns.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: Returns.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: Returns.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: Returns.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class SatispayGateways extends ApiResource {
|
3
|
-
// static readonly PATH = 'satispay_gateways'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: SatispayGateways.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: SatispayGateways.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: SatispayGateways.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: SatispayGateways.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class SatispayPayments extends ApiResource {
|
3
|
-
// static readonly PATH = 'satispay_payments'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: SatispayPayments.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: SatispayPayments.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: SatispayPayments.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: SatispayPayments.TYPE } : id, options);
|
@@ -1,11 +1,10 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Shipments extends ApiResource {
|
3
|
-
// static readonly PATH = 'shipments'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: Shipments.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async update(resource, params, options) {
|
8
|
-
return this.resources.update(
|
7
|
+
return this.resources.update({ ...resource, type: Shipments.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async order(shipmentId, params, options) {
|
11
10
|
const _shipmentId = shipmentId.id || shipmentId;
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ShippingCategories extends ApiResource {
|
3
|
-
// static readonly PATH = 'shipping_categories'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: ShippingCategories.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: ShippingCategories.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: ShippingCategories.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: ShippingCategories.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ShippingMethods extends ApiResource {
|
3
|
-
// static readonly PATH = 'shipping_methods'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: ShippingMethods.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: ShippingMethods.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: ShippingMethods.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: ShippingMethods.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ShippingWeightTiers extends ApiResource {
|
3
|
-
// static readonly PATH = 'shipping_weight_tiers'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: ShippingWeightTiers.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: ShippingWeightTiers.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: ShippingWeightTiers.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: ShippingWeightTiers.TYPE } : id, options);
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ShippingZones extends ApiResource {
|
3
|
-
// static readonly PATH = 'shipping_zones'
|
4
3
|
async list(params, options) {
|
5
4
|
return this.resources.list({ type: ShippingZones.TYPE }, params, options);
|
6
5
|
}
|
7
6
|
async create(resource, params, options) {
|
8
|
-
return this.resources.create(
|
7
|
+
return this.resources.create({ ...resource, type: ShippingZones.TYPE }, params, options);
|
9
8
|
}
|
10
9
|
async update(resource, params, options) {
|
11
|
-
return this.resources.update(
|
10
|
+
return this.resources.update({ ...resource, type: ShippingZones.TYPE }, params, options);
|
12
11
|
}
|
13
12
|
async delete(id, options) {
|
14
13
|
await this.resources.delete((typeof id === 'string') ? { id, type: ShippingZones.TYPE } : id, options);
|