@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
@@ -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;
|
@@ -27,14 +27,18 @@ class ExternalPromotions extends resource_1.ApiResource {
|
|
27
27
|
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
28
28
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `external_promotions/${_externalPromotionId}/coupon_codes_promotion_rule`, params, options);
|
29
29
|
}
|
30
|
-
async
|
30
|
+
async custom_promotion_rule(externalPromotionId, params, options) {
|
31
31
|
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
32
|
-
return this.resources.fetch({ type: '
|
32
|
+
return this.resources.fetch({ type: 'custom_promotion_rules' }, `external_promotions/${_externalPromotionId}/custom_promotion_rule`, params, options);
|
33
33
|
}
|
34
34
|
async sku_list(externalPromotionId, params, options) {
|
35
35
|
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
36
36
|
return this.resources.fetch({ type: 'sku_lists' }, `external_promotions/${_externalPromotionId}/sku_list`, params, options);
|
37
37
|
}
|
38
|
+
async coupons(externalPromotionId, params, options) {
|
39
|
+
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
40
|
+
return this.resources.fetch({ type: 'coupons' }, `external_promotions/${_externalPromotionId}/coupons`, params, options);
|
41
|
+
}
|
38
42
|
async attachments(externalPromotionId, params, options) {
|
39
43
|
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
40
44
|
return this.resources.fetch({ type: 'attachments' }, `external_promotions/${_externalPromotionId}/attachments`, params, options);
|
@@ -61,6 +65,9 @@ class ExternalPromotions extends resource_1.ApiResource {
|
|
61
65
|
async _enable(id, params, options) {
|
62
66
|
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ExternalPromotions.TYPE, _enable: true }, params, options);
|
63
67
|
}
|
68
|
+
async _reset_circuit(id, params, options) {
|
69
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ExternalPromotions.TYPE, _reset_circuit: true }, params, options);
|
70
|
+
}
|
64
71
|
isExternalPromotion(resource) {
|
65
72
|
return resource.type && (resource.type === ExternalPromotions.TYPE);
|
66
73
|
}
|
@@ -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;
|
@@ -23,6 +23,9 @@ class ExternalTaxCalculators extends resource_1.ApiResource {
|
|
23
23
|
const _externalTaxCalculatorId = externalTaxCalculatorId.id || externalTaxCalculatorId;
|
24
24
|
return this.resources.fetch({ type: 'versions' }, `external_tax_calculators/${_externalTaxCalculatorId}/versions`, params, options);
|
25
25
|
}
|
26
|
+
async _reset_circuit(id, params, options) {
|
27
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ExternalTaxCalculators.TYPE, _reset_circuit: true }, params, options);
|
28
|
+
}
|
26
29
|
isExternalTaxCalculator(resource) {
|
27
30
|
return resource.type && (resource.type === ExternalTaxCalculators.TYPE);
|
28
31
|
}
|
@@ -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>>;
|
@@ -27,14 +27,18 @@ class FixedAmountPromotions extends resource_1.ApiResource {
|
|
27
27
|
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
28
28
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupon_codes_promotion_rule`, params, options);
|
29
29
|
}
|
30
|
-
async
|
30
|
+
async custom_promotion_rule(fixedAmountPromotionId, params, options) {
|
31
31
|
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
32
|
-
return this.resources.fetch({ type: '
|
32
|
+
return this.resources.fetch({ type: 'custom_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/custom_promotion_rule`, params, options);
|
33
33
|
}
|
34
34
|
async sku_list(fixedAmountPromotionId, params, options) {
|
35
35
|
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
36
36
|
return this.resources.fetch({ type: 'sku_lists' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/sku_list`, params, options);
|
37
37
|
}
|
38
|
+
async coupons(fixedAmountPromotionId, params, options) {
|
39
|
+
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
40
|
+
return this.resources.fetch({ type: 'coupons' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupons`, params, options);
|
41
|
+
}
|
38
42
|
async attachments(fixedAmountPromotionId, params, options) {
|
39
43
|
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
40
44
|
return this.resources.fetch({ type: 'attachments' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/attachments`, params, options);
|
@@ -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 FixedPricePromotionRel = 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 FixedPricePromotion 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 FixedPricePromotionCreate 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;
|
90
88
|
tags?: TagRel[] | null;
|
91
89
|
}
|
@@ -101,11 +99,10 @@ interface FixedPricePromotionUpdate 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 FixedPricePromotions extends ApiResource<FixedPricePromotion> {
|
|
118
115
|
order_amount_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
119
116
|
sku_list_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
120
117
|
coupon_codes_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
121
|
-
|
118
|
+
custom_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
|
122
119
|
sku_list(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
120
|
+
coupons(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
123
121
|
attachments(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
124
122
|
events(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
125
123
|
tags(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
@@ -27,14 +27,18 @@ class FixedPricePromotions extends resource_1.ApiResource {
|
|
27
27
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
28
28
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupon_codes_promotion_rule`, params, options);
|
29
29
|
}
|
30
|
-
async
|
30
|
+
async custom_promotion_rule(fixedPricePromotionId, params, options) {
|
31
31
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
32
|
-
return this.resources.fetch({ type: '
|
32
|
+
return this.resources.fetch({ type: 'custom_promotion_rules' }, `fixed_price_promotions/${_fixedPricePromotionId}/custom_promotion_rule`, params, options);
|
33
33
|
}
|
34
34
|
async sku_list(fixedPricePromotionId, params, options) {
|
35
35
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
36
36
|
return this.resources.fetch({ type: 'sku_lists' }, `fixed_price_promotions/${_fixedPricePromotionId}/sku_list`, params, options);
|
37
37
|
}
|
38
|
+
async coupons(fixedPricePromotionId, params, options) {
|
39
|
+
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
40
|
+
return this.resources.fetch({ type: 'coupons' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupons`, params, options);
|
41
|
+
}
|
38
42
|
async attachments(fixedPricePromotionId, params, options) {
|
39
43
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
40
44
|
return this.resources.fetch({ type: 'attachments' }, `fixed_price_promotions/${_fixedPricePromotionId}/attachments`, params, options);
|
@@ -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 FreeGiftPromotionRel = 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;
|
@@ -59,8 +57,9 @@ interface FreeGiftPromotion extends Resource {
|
|
59
57
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
60
58
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
61
59
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
62
|
-
|
60
|
+
custom_promotion_rule?: CustomPromotionRule | null;
|
63
61
|
sku_list?: SkuList | null;
|
62
|
+
coupons?: Coupon[] | null;
|
64
63
|
attachments?: Attachment[] | null;
|
65
64
|
events?: Event[] | null;
|
66
65
|
tags?: Tag[] | null;
|
@@ -79,11 +78,10 @@ interface FreeGiftPromotionCreate extends ResourceCreate {
|
|
79
78
|
_enable?: boolean | null;
|
80
79
|
max_quantity?: number | null;
|
81
80
|
market?: MarketRel | null;
|
82
|
-
promotion_rules?: PromotionRuleRel[] | null;
|
83
81
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
84
82
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
85
83
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
86
|
-
|
84
|
+
custom_promotion_rule?: CustomPromotionRuleRel | null;
|
87
85
|
sku_list: SkuListRel;
|
88
86
|
tags?: TagRel[] | null;
|
89
87
|
}
|
@@ -99,11 +97,10 @@ interface FreeGiftPromotionUpdate extends ResourceUpdate {
|
|
99
97
|
_enable?: boolean | null;
|
100
98
|
max_quantity?: number | null;
|
101
99
|
market?: MarketRel | null;
|
102
|
-
promotion_rules?: PromotionRuleRel[] | null;
|
103
100
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
104
101
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
105
102
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
106
|
-
|
103
|
+
custom_promotion_rule?: CustomPromotionRuleRel | null;
|
107
104
|
sku_list?: SkuListRel | null;
|
108
105
|
tags?: TagRel[] | null;
|
109
106
|
}
|
@@ -116,8 +113,9 @@ declare class FreeGiftPromotions extends ApiResource<FreeGiftPromotion> {
|
|
116
113
|
order_amount_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
117
114
|
sku_list_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
118
115
|
coupon_codes_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
119
|
-
|
116
|
+
custom_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
|
120
117
|
sku_list(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
118
|
+
coupons(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
121
119
|
attachments(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
122
120
|
events(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
123
121
|
tags(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
@@ -27,14 +27,18 @@ class FreeGiftPromotions extends resource_1.ApiResource {
|
|
27
27
|
const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
|
28
28
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/coupon_codes_promotion_rule`, params, options);
|
29
29
|
}
|
30
|
-
async
|
30
|
+
async custom_promotion_rule(freeGiftPromotionId, params, options) {
|
31
31
|
const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
|
32
|
-
return this.resources.fetch({ type: '
|
32
|
+
return this.resources.fetch({ type: 'custom_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/custom_promotion_rule`, params, options);
|
33
33
|
}
|
34
34
|
async sku_list(freeGiftPromotionId, params, options) {
|
35
35
|
const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
|
36
36
|
return this.resources.fetch({ type: 'sku_lists' }, `free_gift_promotions/${_freeGiftPromotionId}/sku_list`, params, options);
|
37
37
|
}
|
38
|
+
async coupons(freeGiftPromotionId, params, options) {
|
39
|
+
const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
|
40
|
+
return this.resources.fetch({ type: 'coupons' }, `free_gift_promotions/${_freeGiftPromotionId}/coupons`, params, options);
|
41
|
+
}
|
38
42
|
async attachments(freeGiftPromotionId, params, options) {
|
39
43
|
const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
|
40
44
|
return this.resources.fetch({ type: 'attachments' }, `free_gift_promotions/${_freeGiftPromotionId}/attachments`, params, options);
|
@@ -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 {
|
10
|
-
import type { SkuList } from './sku_lists';
|
9
|
+
import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
|
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';
|
@@ -19,9 +20,6 @@ type FreeShippingPromotionRel = ResourceRel & {
|
|
19
20
|
type MarketRel = ResourceRel & {
|
20
21
|
type: MarketType;
|
21
22
|
};
|
22
|
-
type PromotionRuleRel = ResourceRel & {
|
23
|
-
type: PromotionRuleType;
|
24
|
-
};
|
25
23
|
type OrderAmountPromotionRuleRel = ResourceRel & {
|
26
24
|
type: OrderAmountPromotionRuleType;
|
27
25
|
};
|
@@ -31,8 +29,11 @@ type SkuListPromotionRuleRel = ResourceRel & {
|
|
31
29
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
32
30
|
type: CouponCodesPromotionRuleType;
|
33
31
|
};
|
34
|
-
type
|
35
|
-
type:
|
32
|
+
type CustomPromotionRuleRel = ResourceRel & {
|
33
|
+
type: CustomPromotionRuleType;
|
34
|
+
};
|
35
|
+
type SkuListRel = ResourceRel & {
|
36
|
+
type: SkuListType;
|
36
37
|
};
|
37
38
|
type TagRel = ResourceRel & {
|
38
39
|
type: TagType;
|
@@ -54,8 +55,9 @@ interface FreeShippingPromotion extends Resource {
|
|
54
55
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
55
56
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
56
57
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
57
|
-
|
58
|
+
custom_promotion_rule?: CustomPromotionRule | null;
|
58
59
|
sku_list?: SkuList | null;
|
60
|
+
coupons?: Coupon[] | null;
|
59
61
|
attachments?: Attachment[] | null;
|
60
62
|
events?: Event[] | null;
|
61
63
|
tags?: Tag[] | null;
|
@@ -72,11 +74,11 @@ interface FreeShippingPromotionCreate extends ResourceCreate {
|
|
72
74
|
_disable?: boolean | null;
|
73
75
|
_enable?: boolean | null;
|
74
76
|
market?: MarketRel | null;
|
75
|
-
promotion_rules?: PromotionRuleRel[] | null;
|
76
77
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
77
78
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
78
79
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
79
|
-
|
80
|
+
custom_promotion_rule?: CustomPromotionRuleRel | null;
|
81
|
+
sku_list?: SkuListRel | null;
|
80
82
|
tags?: TagRel[] | null;
|
81
83
|
}
|
82
84
|
interface FreeShippingPromotionUpdate extends ResourceUpdate {
|
@@ -90,11 +92,11 @@ interface FreeShippingPromotionUpdate extends ResourceUpdate {
|
|
90
92
|
_disable?: boolean | null;
|
91
93
|
_enable?: boolean | null;
|
92
94
|
market?: MarketRel | null;
|
93
|
-
promotion_rules?: PromotionRuleRel[] | null;
|
94
95
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
95
96
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
96
97
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
97
|
-
|
98
|
+
custom_promotion_rule?: CustomPromotionRuleRel | null;
|
99
|
+
sku_list?: SkuListRel | null;
|
98
100
|
tags?: TagRel[] | null;
|
99
101
|
}
|
100
102
|
declare class FreeShippingPromotions extends ApiResource<FreeShippingPromotion> {
|
@@ -106,8 +108,9 @@ declare class FreeShippingPromotions extends ApiResource<FreeShippingPromotion>
|
|
106
108
|
order_amount_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
107
109
|
sku_list_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
108
110
|
coupon_codes_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
109
|
-
|
111
|
+
custom_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
|
110
112
|
sku_list(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
113
|
+
coupons(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
111
114
|
attachments(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
112
115
|
events(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
113
116
|
tags(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
@@ -27,14 +27,18 @@ class FreeShippingPromotions extends resource_1.ApiResource {
|
|
27
27
|
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
28
28
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupon_codes_promotion_rule`, params, options);
|
29
29
|
}
|
30
|
-
async
|
30
|
+
async custom_promotion_rule(freeShippingPromotionId, params, options) {
|
31
31
|
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
32
|
-
return this.resources.fetch({ type: '
|
32
|
+
return this.resources.fetch({ type: 'custom_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/custom_promotion_rule`, params, options);
|
33
33
|
}
|
34
34
|
async sku_list(freeShippingPromotionId, params, options) {
|
35
35
|
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
36
36
|
return this.resources.fetch({ type: 'sku_lists' }, `free_shipping_promotions/${_freeShippingPromotionId}/sku_list`, params, options);
|
37
37
|
}
|
38
|
+
async coupons(freeShippingPromotionId, params, options) {
|
39
|
+
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
40
|
+
return this.resources.fetch({ type: 'coupons' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupons`, params, options);
|
41
|
+
}
|
38
42
|
async attachments(freeShippingPromotionId, params, options) {
|
39
43
|
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
40
44
|
return this.resources.fetch({ type: 'attachments' }, `free_shipping_promotions/${_freeShippingPromotionId}/attachments`, params, options);
|
@@ -37,6 +37,7 @@ interface GiftCard extends Resource {
|
|
37
37
|
balance_log: Array<Record<string, any>>;
|
38
38
|
single_use?: boolean | null;
|
39
39
|
rechargeable?: boolean | null;
|
40
|
+
distribute_discount?: boolean | null;
|
40
41
|
image_url?: string | null;
|
41
42
|
expires_at?: string | null;
|
42
43
|
recipient_email?: string | null;
|
@@ -54,6 +55,7 @@ interface GiftCardCreate extends ResourceCreate {
|
|
54
55
|
balance_max_cents?: string | null;
|
55
56
|
single_use?: boolean | null;
|
56
57
|
rechargeable?: boolean | null;
|
58
|
+
distribute_discount?: boolean | null;
|
57
59
|
image_url?: string | null;
|
58
60
|
expires_at?: string | null;
|
59
61
|
recipient_email?: string | null;
|
@@ -67,6 +69,7 @@ interface GiftCardUpdate extends ResourceUpdate {
|
|
67
69
|
balance_max_cents?: string | null;
|
68
70
|
single_use?: boolean | null;
|
69
71
|
rechargeable?: boolean | null;
|
72
|
+
distribute_discount?: boolean | null;
|
70
73
|
image_url?: string | null;
|
71
74
|
expires_at?: string | null;
|
72
75
|
recipient_email?: string | null;
|