@commercelayer/sdk 5.27.3 → 5.29.0-alfa.1
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/api.d.ts +3 -2
- package/lib/cjs/api.js +5 -2
- package/lib/cjs/client.js +5 -5
- package/lib/cjs/commercelayer.d.ts +3 -2
- package/lib/cjs/commercelayer.js +5 -4
- package/lib/cjs/common.js +1 -1
- package/lib/cjs/error.js +1 -2
- package/lib/cjs/model.d.ts +1 -0
- package/lib/cjs/query.d.ts +1 -1
- package/lib/cjs/query.js +1 -1
- package/lib/cjs/resource.js +22 -25
- package/lib/cjs/resources/adjustments.d.ts +3 -0
- package/lib/cjs/resources/adyen_gateways.d.ts +2 -2
- package/lib/cjs/resources/avalara_accounts.d.ts +6 -6
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +11 -13
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +6 -2
- package/lib/cjs/resources/external_gateways.d.ts +5 -1
- package/lib/cjs/resources/external_gateways.js +3 -0
- package/lib/cjs/resources/external_promotions.d.ts +15 -13
- package/lib/cjs/resources/external_promotions.js +9 -2
- package/lib/cjs/resources/external_tax_calculators.d.ts +4 -0
- package/lib/cjs/resources/external_tax_calculators.js +3 -0
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +11 -13
- package/lib/cjs/resources/fixed_amount_promotions.js +6 -2
- package/lib/cjs/resources/fixed_price_promotions.d.ts +11 -13
- package/lib/cjs/resources/fixed_price_promotions.js +6 -2
- package/lib/cjs/resources/free_gift_promotions.d.ts +11 -13
- package/lib/cjs/resources/free_gift_promotions.js +6 -2
- package/lib/cjs/resources/free_shipping_promotions.d.ts +17 -14
- package/lib/cjs/resources/free_shipping_promotions.js +6 -2
- package/lib/cjs/resources/gift_cards.d.ts +3 -0
- package/lib/cjs/resources/inventory_models.d.ts +3 -0
- package/lib/cjs/resources/line_items.d.ts +15 -4
- package/lib/cjs/resources/line_items.js +7 -0
- package/lib/cjs/resources/markets.d.ts +1 -1
- package/lib/cjs/resources/order_subscriptions.d.ts +1 -4
- package/lib/cjs/resources/orders.d.ts +16 -1
- package/lib/cjs/resources/orders.js +14 -0
- package/lib/cjs/resources/parcel_line_items.d.ts +0 -8
- package/lib/cjs/resources/payment_methods.d.ts +8 -5
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +11 -13
- package/lib/cjs/resources/percentage_discount_promotions.js +6 -2
- package/lib/cjs/resources/promotions.d.ts +6 -3
- package/lib/cjs/resources/promotions.js +6 -2
- package/lib/cjs/resources/resource_errors.d.ts +22 -0
- package/lib/cjs/resources/resource_errors.js +16 -0
- package/lib/cjs/resources/shipments.d.ts +0 -4
- package/lib/cjs/resources/shipping_methods.d.ts +9 -5
- package/lib/cjs/resources/shipping_methods.js +3 -0
- package/lib/cjs/resources/stock_line_items.d.ts +6 -0
- package/lib/cjs/resources/stock_line_items.js +9 -0
- package/lib/cjs/resources/stock_reservations.d.ts +0 -1
- package/lib/cjs/resources/stock_transfers.d.ts +1 -1
- package/lib/cjs/resources/stripe_payments.d.ts +4 -1
- package/lib/cjs/resources/webhooks.d.ts +3 -3
- package/lib/cjs/resources/webhooks.js +3 -3
- package/lib/esm/api.d.ts +3 -2
- package/lib/esm/api.js +2 -0
- package/lib/esm/client.js +19 -30
- package/lib/esm/commercelayer.d.ts +3 -2
- package/lib/esm/commercelayer.js +261 -149
- package/lib/esm/common.js +1 -1
- package/lib/esm/error.js +10 -5
- package/lib/esm/model.d.ts +1 -0
- package/lib/esm/query.d.ts +1 -1
- package/lib/esm/query.js +1 -1
- package/lib/esm/resource.js +37 -50
- package/lib/esm/resources/addresses.js +1 -1
- package/lib/esm/resources/adjustments.d.ts +3 -0
- package/lib/esm/resources/adjustments.js +1 -1
- package/lib/esm/resources/adyen_gateways.d.ts +2 -2
- package/lib/esm/resources/adyen_gateways.js +1 -1
- package/lib/esm/resources/adyen_payments.js +1 -1
- package/lib/esm/resources/application.js +1 -1
- package/lib/esm/resources/attachments.js +1 -1
- package/lib/esm/resources/authorizations.js +1 -1
- package/lib/esm/resources/avalara_accounts.d.ts +6 -6
- package/lib/esm/resources/avalara_accounts.js +1 -1
- package/lib/esm/resources/axerve_gateways.js +1 -1
- package/lib/esm/resources/axerve_payments.js +1 -1
- package/lib/esm/resources/billing_info_validation_rules.js +1 -1
- package/lib/esm/resources/bing_geocoders.js +1 -1
- package/lib/esm/resources/braintree_gateways.js +1 -1
- package/lib/esm/resources/braintree_payments.js +1 -1
- package/lib/esm/resources/bundles.js +1 -1
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +11 -13
- package/lib/esm/resources/buy_x_pay_y_promotions.js +7 -3
- package/lib/esm/resources/captures.js +1 -1
- package/lib/esm/resources/carrier_accounts.js +1 -1
- package/lib/esm/resources/checkout_com_gateways.js +1 -1
- package/lib/esm/resources/checkout_com_payments.js +1 -1
- package/lib/esm/resources/cleanups.js +1 -1
- package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -1
- package/lib/esm/resources/coupon_recipients.js +1 -1
- package/lib/esm/resources/coupons.js +1 -1
- package/lib/esm/resources/custom_promotion_rules.js +1 -1
- package/lib/esm/resources/customer_addresses.js +1 -1
- package/lib/esm/resources/customer_groups.js +1 -1
- package/lib/esm/resources/customer_password_resets.js +1 -1
- package/lib/esm/resources/customer_payment_sources.js +1 -1
- package/lib/esm/resources/customer_subscriptions.js +1 -1
- package/lib/esm/resources/customers.js +1 -1
- package/lib/esm/resources/delivery_lead_times.js +1 -1
- package/lib/esm/resources/event_callbacks.js +1 -1
- package/lib/esm/resources/events.js +1 -1
- package/lib/esm/resources/exports.js +1 -1
- package/lib/esm/resources/external_gateways.d.ts +5 -1
- package/lib/esm/resources/external_gateways.js +4 -1
- package/lib/esm/resources/external_payments.js +1 -1
- package/lib/esm/resources/external_promotions.d.ts +15 -13
- package/lib/esm/resources/external_promotions.js +10 -3
- package/lib/esm/resources/external_tax_calculators.d.ts +4 -0
- package/lib/esm/resources/external_tax_calculators.js +4 -1
- package/lib/esm/resources/fixed_amount_promotions.d.ts +11 -13
- package/lib/esm/resources/fixed_amount_promotions.js +7 -3
- package/lib/esm/resources/fixed_price_promotions.d.ts +11 -13
- package/lib/esm/resources/fixed_price_promotions.js +7 -3
- package/lib/esm/resources/free_gift_promotions.d.ts +11 -13
- package/lib/esm/resources/free_gift_promotions.js +7 -3
- package/lib/esm/resources/free_shipping_promotions.d.ts +17 -14
- package/lib/esm/resources/free_shipping_promotions.js +7 -3
- package/lib/esm/resources/geocoders.js +1 -1
- package/lib/esm/resources/gift_card_recipients.js +1 -1
- package/lib/esm/resources/gift_cards.d.ts +3 -0
- package/lib/esm/resources/gift_cards.js +1 -1
- package/lib/esm/resources/google_geocoders.js +1 -1
- package/lib/esm/resources/imports.js +1 -1
- package/lib/esm/resources/in_stock_subscriptions.js +1 -1
- package/lib/esm/resources/inventory_models.d.ts +3 -0
- package/lib/esm/resources/inventory_models.js +1 -1
- package/lib/esm/resources/inventory_return_locations.js +1 -1
- package/lib/esm/resources/inventory_stock_locations.js +1 -1
- package/lib/esm/resources/klarna_gateways.js +1 -1
- package/lib/esm/resources/klarna_payments.js +1 -1
- package/lib/esm/resources/line_item_options.js +1 -1
- package/lib/esm/resources/line_items.d.ts +15 -4
- package/lib/esm/resources/line_items.js +8 -1
- package/lib/esm/resources/manual_gateways.js +1 -1
- package/lib/esm/resources/manual_tax_calculators.js +1 -1
- package/lib/esm/resources/markets.d.ts +1 -1
- package/lib/esm/resources/markets.js +1 -1
- package/lib/esm/resources/merchants.js +1 -1
- package/lib/esm/resources/order_amount_promotion_rules.js +1 -1
- package/lib/esm/resources/order_copies.js +1 -1
- package/lib/esm/resources/order_factories.js +1 -1
- package/lib/esm/resources/order_subscription_items.js +1 -1
- package/lib/esm/resources/order_subscriptions.d.ts +1 -4
- package/lib/esm/resources/order_subscriptions.js +1 -1
- package/lib/esm/resources/order_validation_rules.js +1 -1
- package/lib/esm/resources/orders.d.ts +16 -1
- package/lib/esm/resources/orders.js +15 -1
- package/lib/esm/resources/organization.js +1 -1
- package/lib/esm/resources/packages.js +1 -1
- package/lib/esm/resources/parcel_line_items.d.ts +0 -8
- package/lib/esm/resources/parcel_line_items.js +1 -1
- package/lib/esm/resources/parcels.js +1 -1
- package/lib/esm/resources/payment_gateways.js +1 -1
- package/lib/esm/resources/payment_methods.d.ts +8 -5
- package/lib/esm/resources/payment_methods.js +1 -1
- package/lib/esm/resources/payment_options.js +1 -1
- package/lib/esm/resources/paypal_gateways.js +1 -1
- package/lib/esm/resources/paypal_payments.js +1 -1
- package/lib/esm/resources/percentage_discount_promotions.d.ts +11 -13
- package/lib/esm/resources/percentage_discount_promotions.js +7 -3
- package/lib/esm/resources/price_frequency_tiers.js +1 -1
- package/lib/esm/resources/price_lists.js +1 -1
- package/lib/esm/resources/price_tiers.js +1 -1
- package/lib/esm/resources/price_volume_tiers.js +1 -1
- package/lib/esm/resources/prices.js +1 -1
- package/lib/esm/resources/promotion_rules.js +1 -1
- package/lib/esm/resources/promotions.d.ts +6 -3
- package/lib/esm/resources/promotions.js +7 -3
- package/lib/esm/resources/recurring_order_copies.js +1 -1
- package/lib/esm/resources/refunds.js +1 -1
- package/lib/esm/resources/reserved_stocks.js +1 -1
- package/lib/esm/resources/resource_errors.d.ts +22 -0
- package/lib/esm/resources/resource_errors.js +14 -0
- package/lib/esm/resources/return_line_items.js +1 -1
- package/lib/esm/resources/returns.js +1 -1
- package/lib/esm/resources/satispay_gateways.js +1 -1
- package/lib/esm/resources/satispay_payments.js +1 -1
- package/lib/esm/resources/shipments.d.ts +0 -4
- package/lib/esm/resources/shipments.js +1 -1
- package/lib/esm/resources/shipping_categories.js +1 -1
- package/lib/esm/resources/shipping_method_tiers.js +1 -1
- package/lib/esm/resources/shipping_methods.d.ts +9 -5
- package/lib/esm/resources/shipping_methods.js +4 -1
- package/lib/esm/resources/shipping_weight_tiers.js +1 -1
- package/lib/esm/resources/shipping_zones.js +1 -1
- package/lib/esm/resources/sku_list_items.js +1 -1
- package/lib/esm/resources/sku_list_promotion_rules.js +1 -1
- package/lib/esm/resources/sku_lists.js +1 -1
- package/lib/esm/resources/sku_options.js +1 -1
- package/lib/esm/resources/skus.js +1 -1
- package/lib/esm/resources/stock_items.js +1 -1
- package/lib/esm/resources/stock_line_items.d.ts +6 -0
- package/lib/esm/resources/stock_line_items.js +10 -1
- package/lib/esm/resources/stock_locations.js +1 -1
- package/lib/esm/resources/stock_reservations.d.ts +0 -1
- package/lib/esm/resources/stock_reservations.js +1 -1
- package/lib/esm/resources/stock_transfers.d.ts +1 -1
- package/lib/esm/resources/stock_transfers.js +1 -1
- package/lib/esm/resources/stripe_gateways.js +1 -1
- package/lib/esm/resources/stripe_payments.d.ts +4 -1
- package/lib/esm/resources/stripe_payments.js +1 -1
- package/lib/esm/resources/subscription_models.js +1 -1
- package/lib/esm/resources/tags.js +1 -1
- package/lib/esm/resources/tax_calculators.js +1 -1
- package/lib/esm/resources/tax_categories.js +1 -1
- package/lib/esm/resources/tax_rules.js +1 -1
- package/lib/esm/resources/taxjar_accounts.js +1 -1
- package/lib/esm/resources/transactions.js +1 -1
- package/lib/esm/resources/versions.js +1 -1
- package/lib/esm/resources/voids.js +1 -1
- package/lib/esm/resources/webhooks.d.ts +3 -3
- package/lib/esm/resources/webhooks.js +4 -4
- package/lib/esm/resources/wire_transfers.js +1 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -16
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class CouponCodesPromotionRules extends ApiResource {
|
3
|
+
static TYPE = 'coupon_codes_promotion_rules';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: CouponCodesPromotionRules.TYPE }, params, options);
|
5
6
|
}
|
@@ -27,5 +28,4 @@ class CouponCodesPromotionRules extends ApiResource {
|
|
27
28
|
return CouponCodesPromotionRules.TYPE;
|
28
29
|
}
|
29
30
|
}
|
30
|
-
CouponCodesPromotionRules.TYPE = 'coupon_codes_promotion_rules';
|
31
31
|
export default CouponCodesPromotionRules;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class CouponRecipients extends ApiResource {
|
3
|
+
static TYPE = 'coupon_recipients';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: CouponRecipients.TYPE }, params, options);
|
5
6
|
}
|
@@ -31,5 +32,4 @@ class CouponRecipients extends ApiResource {
|
|
31
32
|
return CouponRecipients.TYPE;
|
32
33
|
}
|
33
34
|
}
|
34
|
-
CouponRecipients.TYPE = 'coupon_recipients';
|
35
35
|
export default CouponRecipients;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Coupons extends ApiResource {
|
3
|
+
static TYPE = 'coupons';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: Coupons.TYPE }, params, options);
|
5
6
|
}
|
@@ -39,5 +40,4 @@ class Coupons extends ApiResource {
|
|
39
40
|
return Coupons.TYPE;
|
40
41
|
}
|
41
42
|
}
|
42
|
-
Coupons.TYPE = 'coupons';
|
43
43
|
export default Coupons;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class CustomPromotionRules extends ApiResource {
|
3
|
+
static TYPE = 'custom_promotion_rules';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: CustomPromotionRules.TYPE }, params, options);
|
5
6
|
}
|
@@ -23,5 +24,4 @@ class CustomPromotionRules extends ApiResource {
|
|
23
24
|
return CustomPromotionRules.TYPE;
|
24
25
|
}
|
25
26
|
}
|
26
|
-
CustomPromotionRules.TYPE = 'custom_promotion_rules';
|
27
27
|
export default CustomPromotionRules;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class CustomerAddresses extends ApiResource {
|
3
|
+
static TYPE = 'customer_addresses';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: CustomerAddresses.TYPE }, params, options);
|
5
6
|
}
|
@@ -35,5 +36,4 @@ class CustomerAddresses extends ApiResource {
|
|
35
36
|
return CustomerAddresses.TYPE;
|
36
37
|
}
|
37
38
|
}
|
38
|
-
CustomerAddresses.TYPE = 'customer_addresses';
|
39
39
|
export default CustomerAddresses;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class CustomerGroups extends ApiResource {
|
3
|
+
static TYPE = 'customer_groups';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: CustomerGroups.TYPE }, params, options);
|
5
6
|
}
|
@@ -35,5 +36,4 @@ class CustomerGroups extends ApiResource {
|
|
35
36
|
return CustomerGroups.TYPE;
|
36
37
|
}
|
37
38
|
}
|
38
|
-
CustomerGroups.TYPE = 'customer_groups';
|
39
39
|
export default CustomerGroups;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class CustomerPasswordResets extends ApiResource {
|
3
|
+
static TYPE = 'customer_password_resets';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: CustomerPasswordResets.TYPE }, params, options);
|
5
6
|
}
|
@@ -30,5 +31,4 @@ class CustomerPasswordResets extends ApiResource {
|
|
30
31
|
return CustomerPasswordResets.TYPE;
|
31
32
|
}
|
32
33
|
}
|
33
|
-
CustomerPasswordResets.TYPE = 'customer_password_resets';
|
34
34
|
export default CustomerPasswordResets;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class CustomerPaymentSources extends ApiResource {
|
3
|
+
static TYPE = 'customer_payment_sources';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: CustomerPaymentSources.TYPE }, params, options);
|
5
6
|
}
|
@@ -31,5 +32,4 @@ class CustomerPaymentSources extends ApiResource {
|
|
31
32
|
return CustomerPaymentSources.TYPE;
|
32
33
|
}
|
33
34
|
}
|
34
|
-
CustomerPaymentSources.TYPE = 'customer_payment_sources';
|
35
35
|
export default CustomerPaymentSources;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class CustomerSubscriptions extends ApiResource {
|
3
|
+
static TYPE = 'customer_subscriptions';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: CustomerSubscriptions.TYPE }, params, options);
|
5
6
|
}
|
@@ -31,5 +32,4 @@ class CustomerSubscriptions extends ApiResource {
|
|
31
32
|
return CustomerSubscriptions.TYPE;
|
32
33
|
}
|
33
34
|
}
|
34
|
-
CustomerSubscriptions.TYPE = 'customer_subscriptions';
|
35
35
|
export default CustomerSubscriptions;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Customers extends ApiResource {
|
3
|
+
static TYPE = 'customers';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: Customers.TYPE }, params, options);
|
5
6
|
}
|
@@ -63,5 +64,4 @@ class Customers extends ApiResource {
|
|
63
64
|
return Customers.TYPE;
|
64
65
|
}
|
65
66
|
}
|
66
|
-
Customers.TYPE = 'customers';
|
67
67
|
export default Customers;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class DeliveryLeadTimes extends ApiResource {
|
3
|
+
static TYPE = 'delivery_lead_times';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: DeliveryLeadTimes.TYPE }, params, options);
|
5
6
|
}
|
@@ -35,5 +36,4 @@ class DeliveryLeadTimes extends ApiResource {
|
|
35
36
|
return DeliveryLeadTimes.TYPE;
|
36
37
|
}
|
37
38
|
}
|
38
|
-
DeliveryLeadTimes.TYPE = 'delivery_lead_times';
|
39
39
|
export default DeliveryLeadTimes;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class EventCallbacks extends ApiResource {
|
3
|
+
static TYPE = 'event_callbacks';
|
3
4
|
async webhook(eventCallbackId, params, options) {
|
4
5
|
const _eventCallbackId = eventCallbackId.id || eventCallbackId;
|
5
6
|
return this.resources.fetch({ type: 'webhooks' }, `event_callbacks/${_eventCallbackId}/webhook`, params, options);
|
@@ -14,5 +15,4 @@ class EventCallbacks extends ApiResource {
|
|
14
15
|
return EventCallbacks.TYPE;
|
15
16
|
}
|
16
17
|
}
|
17
|
-
EventCallbacks.TYPE = 'event_callbacks';
|
18
18
|
export default EventCallbacks;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Events extends ApiResource {
|
3
|
+
static TYPE = 'events';
|
3
4
|
async last_event_callbacks(eventId, params, options) {
|
4
5
|
const _eventId = eventId.id || eventId;
|
5
6
|
return this.resources.fetch({ type: 'event_callbacks' }, `events/${_eventId}/last_event_callbacks`, params, options);
|
@@ -18,5 +19,4 @@ class Events extends ApiResource {
|
|
18
19
|
return Events.TYPE;
|
19
20
|
}
|
20
21
|
}
|
21
|
-
Events.TYPE = 'events';
|
22
22
|
export default Events;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Exports extends ApiResource {
|
3
|
+
static TYPE = 'exports';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: Exports.TYPE }, params, options);
|
5
6
|
}
|
@@ -20,5 +21,4 @@ class Exports extends ApiResource {
|
|
20
21
|
return Exports.TYPE;
|
21
22
|
}
|
22
23
|
}
|
23
|
-
Exports.TYPE = 'exports';
|
24
24
|
export default Exports;
|
@@ -11,12 +11,14 @@ type ExternalGatewayRel = ResourceRel & {
|
|
11
11
|
interface ExternalGateway extends Resource {
|
12
12
|
readonly type: ExternalGatewayType;
|
13
13
|
name: string;
|
14
|
-
shared_secret: string;
|
15
14
|
authorize_url?: string | null;
|
16
15
|
capture_url?: string | null;
|
17
16
|
void_url?: string | null;
|
18
17
|
refund_url?: string | null;
|
19
18
|
token_url?: string | null;
|
19
|
+
circuit_state?: string | null;
|
20
|
+
circuit_failure_count?: number | null;
|
21
|
+
shared_secret: string;
|
20
22
|
payment_methods?: PaymentMethod[] | null;
|
21
23
|
versions?: Version[] | null;
|
22
24
|
external_payments?: ExternalPayment[] | null;
|
@@ -36,6 +38,7 @@ interface ExternalGatewayUpdate extends ResourceUpdate {
|
|
36
38
|
void_url?: string | null;
|
37
39
|
refund_url?: string | null;
|
38
40
|
token_url?: string | null;
|
41
|
+
_reset_circuit?: boolean | null;
|
39
42
|
}
|
40
43
|
declare class ExternalGateways extends ApiResource<ExternalGateway> {
|
41
44
|
static readonly TYPE: ExternalGatewayType;
|
@@ -45,6 +48,7 @@ declare class ExternalGateways extends ApiResource<ExternalGateway> {
|
|
45
48
|
payment_methods(externalGatewayId: string | ExternalGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
46
49
|
versions(externalGatewayId: string | ExternalGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
47
50
|
external_payments(externalGatewayId: string | ExternalGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ExternalPayment>>;
|
51
|
+
_reset_circuit(id: string | ExternalGateway, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalGateway>;
|
48
52
|
isExternalGateway(resource: any): resource is ExternalGateway;
|
49
53
|
relationship(id: string | ResourceId | null): ExternalGatewayRel;
|
50
54
|
type(): ExternalGatewayType;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ExternalGateways extends ApiResource {
|
3
|
+
static TYPE = 'external_gateways';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: ExternalGateways.TYPE }, params, options);
|
5
6
|
}
|
@@ -21,6 +22,9 @@ class ExternalGateways extends ApiResource {
|
|
21
22
|
const _externalGatewayId = externalGatewayId.id || externalGatewayId;
|
22
23
|
return this.resources.fetch({ type: 'external_payments' }, `external_gateways/${_externalGatewayId}/external_payments`, params, options);
|
23
24
|
}
|
25
|
+
async _reset_circuit(id, params, options) {
|
26
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ExternalGateways.TYPE, _reset_circuit: true }, params, options);
|
27
|
+
}
|
24
28
|
isExternalGateway(resource) {
|
25
29
|
return resource.type && (resource.type === ExternalGateways.TYPE);
|
26
30
|
}
|
@@ -31,5 +35,4 @@ class ExternalGateways extends ApiResource {
|
|
31
35
|
return ExternalGateways.TYPE;
|
32
36
|
}
|
33
37
|
}
|
34
|
-
ExternalGateways.TYPE = 'external_gateways';
|
35
38
|
export default ExternalGateways;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ExternalPayments extends ApiResource {
|
3
|
+
static TYPE = 'external_payments';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: ExternalPayments.TYPE }, params, options);
|
5
6
|
}
|
@@ -35,5 +36,4 @@ class ExternalPayments extends ApiResource {
|
|
35
36
|
return ExternalPayments.TYPE;
|
36
37
|
}
|
37
38
|
}
|
38
|
-
ExternalPayments.TYPE = 'external_payments';
|
39
39
|
export default ExternalPayments;
|
@@ -2,12 +2,13 @@ import { ApiResource } from '../resource';
|
|
2
2
|
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
4
|
import type { Market, MarketType } from './markets';
|
5
|
-
import type { PromotionRule
|
5
|
+
import type { PromotionRule } from './promotion_rules';
|
6
6
|
import type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules';
|
7
7
|
import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules';
|
8
8
|
import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
|
9
|
-
import type {
|
9
|
+
import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
|
10
10
|
import type { SkuList, SkuListType } from './sku_lists';
|
11
|
+
import type { Coupon } from './coupons';
|
11
12
|
import type { Attachment } from './attachments';
|
12
13
|
import type { Event } from './events';
|
13
14
|
import type { Tag, TagType } from './tags';
|
@@ -20,9 +21,6 @@ type ExternalPromotionRel = ResourceRel & {
|
|
20
21
|
type MarketRel = ResourceRel & {
|
21
22
|
type: MarketType;
|
22
23
|
};
|
23
|
-
type PromotionRuleRel = ResourceRel & {
|
24
|
-
type: PromotionRuleType;
|
25
|
-
};
|
26
24
|
type OrderAmountPromotionRuleRel = ResourceRel & {
|
27
25
|
type: OrderAmountPromotionRuleType;
|
28
26
|
};
|
@@ -32,8 +30,8 @@ type SkuListPromotionRuleRel = ResourceRel & {
|
|
32
30
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
33
31
|
type: CouponCodesPromotionRuleType;
|
34
32
|
};
|
35
|
-
type
|
36
|
-
type:
|
33
|
+
type CustomPromotionRuleRel = ResourceRel & {
|
34
|
+
type: CustomPromotionRuleType;
|
37
35
|
};
|
38
36
|
type SkuListRel = ResourceRel & {
|
39
37
|
type: SkuListType;
|
@@ -54,14 +52,17 @@ interface ExternalPromotion extends Resource {
|
|
54
52
|
active?: boolean | null;
|
55
53
|
disabled_at?: string | null;
|
56
54
|
promotion_url: string;
|
55
|
+
circuit_state?: string | null;
|
56
|
+
circuit_failure_count?: number | null;
|
57
57
|
shared_secret: string;
|
58
58
|
market?: Market | null;
|
59
59
|
promotion_rules?: PromotionRule[] | null;
|
60
60
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
61
61
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
62
62
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
63
|
-
|
63
|
+
custom_promotion_rule?: CustomPromotionRule | null;
|
64
64
|
sku_list?: SkuList | null;
|
65
|
+
coupons?: Coupon[] | null;
|
65
66
|
attachments?: Attachment[] | null;
|
66
67
|
events?: Event[] | null;
|
67
68
|
tags?: Tag[] | null;
|
@@ -80,11 +81,10 @@ interface ExternalPromotionCreate extends ResourceCreate {
|
|
80
81
|
_enable?: boolean | null;
|
81
82
|
promotion_url: string;
|
82
83
|
market?: MarketRel | null;
|
83
|
-
promotion_rules?: PromotionRuleRel[] | null;
|
84
84
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
85
85
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
86
86
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
87
|
-
|
87
|
+
custom_promotion_rule?: CustomPromotionRuleRel | null;
|
88
88
|
sku_list?: SkuListRel | null;
|
89
89
|
tags?: TagRel[] | null;
|
90
90
|
}
|
@@ -99,12 +99,12 @@ interface ExternalPromotionUpdate extends ResourceUpdate {
|
|
99
99
|
_disable?: boolean | null;
|
100
100
|
_enable?: boolean | null;
|
101
101
|
promotion_url?: string | null;
|
102
|
+
_reset_circuit?: boolean | null;
|
102
103
|
market?: MarketRel | null;
|
103
|
-
promotion_rules?: PromotionRuleRel[] | null;
|
104
104
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
105
105
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
106
106
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
107
|
-
|
107
|
+
custom_promotion_rule?: CustomPromotionRuleRel | null;
|
108
108
|
sku_list?: SkuListRel | null;
|
109
109
|
tags?: TagRel[] | null;
|
110
110
|
}
|
@@ -117,8 +117,9 @@ declare class ExternalPromotions extends ApiResource<ExternalPromotion> {
|
|
117
117
|
order_amount_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
118
118
|
sku_list_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
119
119
|
coupon_codes_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
120
|
-
|
120
|
+
custom_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
|
121
121
|
sku_list(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
122
|
+
coupons(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
122
123
|
attachments(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
123
124
|
events(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
124
125
|
tags(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
@@ -126,6 +127,7 @@ declare class ExternalPromotions extends ApiResource<ExternalPromotion> {
|
|
126
127
|
skus(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
127
128
|
_disable(id: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalPromotion>;
|
128
129
|
_enable(id: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalPromotion>;
|
130
|
+
_reset_circuit(id: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalPromotion>;
|
129
131
|
isExternalPromotion(resource: any): resource is ExternalPromotion;
|
130
132
|
relationship(id: string | ResourceId | null): ExternalPromotionRel;
|
131
133
|
type(): ExternalPromotionType;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ExternalPromotions extends ApiResource {
|
3
|
+
static TYPE = 'external_promotions';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: ExternalPromotions.TYPE }, params, options);
|
5
6
|
}
|
@@ -25,14 +26,18 @@ class ExternalPromotions extends ApiResource {
|
|
25
26
|
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
26
27
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `external_promotions/${_externalPromotionId}/coupon_codes_promotion_rule`, params, options);
|
27
28
|
}
|
28
|
-
async
|
29
|
+
async custom_promotion_rule(externalPromotionId, params, options) {
|
29
30
|
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
30
|
-
return this.resources.fetch({ type: '
|
31
|
+
return this.resources.fetch({ type: 'custom_promotion_rules' }, `external_promotions/${_externalPromotionId}/custom_promotion_rule`, params, options);
|
31
32
|
}
|
32
33
|
async sku_list(externalPromotionId, params, options) {
|
33
34
|
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
34
35
|
return this.resources.fetch({ type: 'sku_lists' }, `external_promotions/${_externalPromotionId}/sku_list`, params, options);
|
35
36
|
}
|
37
|
+
async coupons(externalPromotionId, params, options) {
|
38
|
+
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
39
|
+
return this.resources.fetch({ type: 'coupons' }, `external_promotions/${_externalPromotionId}/coupons`, params, options);
|
40
|
+
}
|
36
41
|
async attachments(externalPromotionId, params, options) {
|
37
42
|
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
38
43
|
return this.resources.fetch({ type: 'attachments' }, `external_promotions/${_externalPromotionId}/attachments`, params, options);
|
@@ -59,6 +64,9 @@ class ExternalPromotions extends ApiResource {
|
|
59
64
|
async _enable(id, params, options) {
|
60
65
|
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ExternalPromotions.TYPE, _enable: true }, params, options);
|
61
66
|
}
|
67
|
+
async _reset_circuit(id, params, options) {
|
68
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ExternalPromotions.TYPE, _reset_circuit: true }, params, options);
|
69
|
+
}
|
62
70
|
isExternalPromotion(resource) {
|
63
71
|
return resource.type && (resource.type === ExternalPromotions.TYPE);
|
64
72
|
}
|
@@ -69,5 +77,4 @@ class ExternalPromotions extends ApiResource {
|
|
69
77
|
return ExternalPromotions.TYPE;
|
70
78
|
}
|
71
79
|
}
|
72
|
-
ExternalPromotions.TYPE = 'external_promotions';
|
73
80
|
export default ExternalPromotions;
|
@@ -12,6 +12,8 @@ interface ExternalTaxCalculator extends Resource {
|
|
12
12
|
readonly type: ExternalTaxCalculatorType;
|
13
13
|
name: string;
|
14
14
|
tax_calculator_url: string;
|
15
|
+
circuit_state?: string | null;
|
16
|
+
circuit_failure_count?: number | null;
|
15
17
|
shared_secret: string;
|
16
18
|
markets?: Market[] | null;
|
17
19
|
attachments?: Attachment[] | null;
|
@@ -24,6 +26,7 @@ interface ExternalTaxCalculatorCreate extends ResourceCreate {
|
|
24
26
|
interface ExternalTaxCalculatorUpdate extends ResourceUpdate {
|
25
27
|
name?: string | null;
|
26
28
|
tax_calculator_url?: string | null;
|
29
|
+
_reset_circuit?: boolean | null;
|
27
30
|
}
|
28
31
|
declare class ExternalTaxCalculators extends ApiResource<ExternalTaxCalculator> {
|
29
32
|
static readonly TYPE: ExternalTaxCalculatorType;
|
@@ -33,6 +36,7 @@ declare class ExternalTaxCalculators extends ApiResource<ExternalTaxCalculator>
|
|
33
36
|
markets(externalTaxCalculatorId: string | ExternalTaxCalculator, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
|
34
37
|
attachments(externalTaxCalculatorId: string | ExternalTaxCalculator, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
35
38
|
versions(externalTaxCalculatorId: string | ExternalTaxCalculator, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
39
|
+
_reset_circuit(id: string | ExternalTaxCalculator, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalTaxCalculator>;
|
36
40
|
isExternalTaxCalculator(resource: any): resource is ExternalTaxCalculator;
|
37
41
|
relationship(id: string | ResourceId | null): ExternalTaxCalculatorRel;
|
38
42
|
type(): ExternalTaxCalculatorType;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ExternalTaxCalculators extends ApiResource {
|
3
|
+
static TYPE = 'external_tax_calculators';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: ExternalTaxCalculators.TYPE }, params, options);
|
5
6
|
}
|
@@ -21,6 +22,9 @@ class ExternalTaxCalculators extends ApiResource {
|
|
21
22
|
const _externalTaxCalculatorId = externalTaxCalculatorId.id || externalTaxCalculatorId;
|
22
23
|
return this.resources.fetch({ type: 'versions' }, `external_tax_calculators/${_externalTaxCalculatorId}/versions`, params, options);
|
23
24
|
}
|
25
|
+
async _reset_circuit(id, params, options) {
|
26
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ExternalTaxCalculators.TYPE, _reset_circuit: true }, params, options);
|
27
|
+
}
|
24
28
|
isExternalTaxCalculator(resource) {
|
25
29
|
return resource.type && (resource.type === ExternalTaxCalculators.TYPE);
|
26
30
|
}
|
@@ -31,5 +35,4 @@ class ExternalTaxCalculators extends ApiResource {
|
|
31
35
|
return ExternalTaxCalculators.TYPE;
|
32
36
|
}
|
33
37
|
}
|
34
|
-
ExternalTaxCalculators.TYPE = 'external_tax_calculators';
|
35
38
|
export default ExternalTaxCalculators;
|
@@ -2,12 +2,13 @@ import { ApiResource } from '../resource';
|
|
2
2
|
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
4
|
import type { Market, MarketType } from './markets';
|
5
|
-
import type { PromotionRule
|
5
|
+
import type { PromotionRule } from './promotion_rules';
|
6
6
|
import type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules';
|
7
7
|
import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules';
|
8
8
|
import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
|
9
|
-
import type {
|
9
|
+
import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
|
10
10
|
import type { SkuList, SkuListType } from './sku_lists';
|
11
|
+
import type { Coupon } from './coupons';
|
11
12
|
import type { Attachment } from './attachments';
|
12
13
|
import type { Event } from './events';
|
13
14
|
import type { Tag, TagType } from './tags';
|
@@ -20,9 +21,6 @@ type FixedAmountPromotionRel = ResourceRel & {
|
|
20
21
|
type MarketRel = ResourceRel & {
|
21
22
|
type: MarketType;
|
22
23
|
};
|
23
|
-
type PromotionRuleRel = ResourceRel & {
|
24
|
-
type: PromotionRuleType;
|
25
|
-
};
|
26
24
|
type OrderAmountPromotionRuleRel = ResourceRel & {
|
27
25
|
type: OrderAmountPromotionRuleType;
|
28
26
|
};
|
@@ -32,8 +30,8 @@ type SkuListPromotionRuleRel = ResourceRel & {
|
|
32
30
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
33
31
|
type: CouponCodesPromotionRuleType;
|
34
32
|
};
|
35
|
-
type
|
36
|
-
type:
|
33
|
+
type CustomPromotionRuleRel = ResourceRel & {
|
34
|
+
type: CustomPromotionRuleType;
|
37
35
|
};
|
38
36
|
type SkuListRel = ResourceRel & {
|
39
37
|
type: SkuListType;
|
@@ -61,8 +59,9 @@ interface FixedAmountPromotion extends Resource {
|
|
61
59
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
62
60
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
63
61
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
64
|
-
|
62
|
+
custom_promotion_rule?: CustomPromotionRule | null;
|
65
63
|
sku_list?: SkuList | null;
|
64
|
+
coupons?: Coupon[] | null;
|
66
65
|
attachments?: Attachment[] | null;
|
67
66
|
events?: Event[] | null;
|
68
67
|
tags?: Tag[] | null;
|
@@ -81,11 +80,10 @@ interface FixedAmountPromotionCreate extends ResourceCreate {
|
|
81
80
|
_enable?: boolean | null;
|
82
81
|
fixed_amount_cents: number;
|
83
82
|
market?: MarketRel | null;
|
84
|
-
promotion_rules?: PromotionRuleRel[] | null;
|
85
83
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
86
84
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
87
85
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
88
|
-
|
86
|
+
custom_promotion_rule?: CustomPromotionRuleRel | null;
|
89
87
|
sku_list?: SkuListRel | null;
|
90
88
|
tags?: TagRel[] | null;
|
91
89
|
}
|
@@ -101,11 +99,10 @@ interface FixedAmountPromotionUpdate extends ResourceUpdate {
|
|
101
99
|
_enable?: boolean | null;
|
102
100
|
fixed_amount_cents?: number | null;
|
103
101
|
market?: MarketRel | null;
|
104
|
-
promotion_rules?: PromotionRuleRel[] | null;
|
105
102
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
106
103
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
107
104
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
108
|
-
|
105
|
+
custom_promotion_rule?: CustomPromotionRuleRel | null;
|
109
106
|
sku_list?: SkuListRel | null;
|
110
107
|
tags?: TagRel[] | null;
|
111
108
|
}
|
@@ -118,8 +115,9 @@ declare class FixedAmountPromotions extends ApiResource<FixedAmountPromotion> {
|
|
118
115
|
order_amount_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
119
116
|
sku_list_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
120
117
|
coupon_codes_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
121
|
-
|
118
|
+
custom_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
|
122
119
|
sku_list(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
120
|
+
coupons(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
123
121
|
attachments(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
124
122
|
events(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
125
123
|
tags(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class FixedAmountPromotions extends ApiResource {
|
3
|
+
static TYPE = 'fixed_amount_promotions';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: FixedAmountPromotions.TYPE }, params, options);
|
5
6
|
}
|
@@ -25,14 +26,18 @@ class FixedAmountPromotions extends ApiResource {
|
|
25
26
|
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
26
27
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupon_codes_promotion_rule`, params, options);
|
27
28
|
}
|
28
|
-
async
|
29
|
+
async custom_promotion_rule(fixedAmountPromotionId, params, options) {
|
29
30
|
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
30
|
-
return this.resources.fetch({ type: '
|
31
|
+
return this.resources.fetch({ type: 'custom_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/custom_promotion_rule`, params, options);
|
31
32
|
}
|
32
33
|
async sku_list(fixedAmountPromotionId, params, options) {
|
33
34
|
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
34
35
|
return this.resources.fetch({ type: 'sku_lists' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/sku_list`, params, options);
|
35
36
|
}
|
37
|
+
async coupons(fixedAmountPromotionId, params, options) {
|
38
|
+
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
39
|
+
return this.resources.fetch({ type: 'coupons' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupons`, params, options);
|
40
|
+
}
|
36
41
|
async attachments(fixedAmountPromotionId, params, options) {
|
37
42
|
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
38
43
|
return this.resources.fetch({ type: 'attachments' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/attachments`, params, options);
|
@@ -69,5 +74,4 @@ class FixedAmountPromotions extends ApiResource {
|
|
69
74
|
return FixedAmountPromotions.TYPE;
|
70
75
|
}
|
71
76
|
}
|
72
|
-
FixedAmountPromotions.TYPE = 'fixed_amount_promotions';
|
73
77
|
export default FixedAmountPromotions;
|