@commercelayer/sdk 4.40.0 → 4.42.0
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 +8 -2
- package/lib/cjs/client.d.ts +8 -9
- package/lib/cjs/client.js +42 -11
- package/lib/cjs/commercelayer.d.ts +4 -2
- package/lib/cjs/commercelayer.js +7 -1
- package/lib/cjs/error.d.ts +7 -7
- package/lib/cjs/jsonapi.d.ts +1 -0
- package/lib/cjs/jsonapi.js +1 -1
- package/lib/cjs/model.d.ts +1 -1
- package/lib/cjs/resource.d.ts +1 -1
- package/lib/cjs/resource.js +1 -2
- package/lib/cjs/resources/authorizations.d.ts +3 -3
- package/lib/cjs/resources/authorizations.js +4 -4
- package/lib/cjs/resources/avalara_accounts.d.ts +6 -6
- package/lib/cjs/resources/axerve_payments.d.ts +2 -0
- package/lib/cjs/resources/bundles.d.ts +8 -8
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +12 -2
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +4 -0
- package/lib/cjs/resources/captures.d.ts +3 -3
- package/lib/cjs/resources/captures.js +4 -4
- package/lib/cjs/resources/customer_payment_sources.d.ts +13 -1
- package/lib/cjs/resources/customer_payment_sources.js +4 -0
- package/lib/cjs/resources/external_promotions.d.ts +12 -2
- package/lib/cjs/resources/external_promotions.js +4 -0
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +12 -2
- package/lib/cjs/resources/fixed_amount_promotions.js +4 -0
- package/lib/cjs/resources/fixed_price_promotions.d.ts +12 -2
- package/lib/cjs/resources/fixed_price_promotions.js +4 -0
- package/lib/cjs/resources/free_gift_promotions.d.ts +12 -2
- package/lib/cjs/resources/free_gift_promotions.js +4 -0
- package/lib/cjs/resources/free_shipping_promotions.d.ts +12 -2
- package/lib/cjs/resources/free_shipping_promotions.js +4 -0
- package/lib/cjs/resources/imports.d.ts +0 -2
- package/lib/cjs/resources/inventory_models.d.ts +3 -0
- package/lib/cjs/resources/line_items.d.ts +9 -0
- package/lib/cjs/resources/line_items.js +4 -0
- package/lib/cjs/resources/markets.d.ts +5 -0
- package/lib/cjs/resources/orders.d.ts +5 -1
- package/lib/cjs/resources/orders.js +4 -0
- package/lib/cjs/resources/organization.d.ts +4 -4
- package/lib/cjs/resources/payment_methods.d.ts +2 -0
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +12 -2
- package/lib/cjs/resources/percentage_discount_promotions.js +4 -0
- package/lib/cjs/resources/price_lists.d.ts +3 -0
- package/lib/cjs/resources/prices.d.ts +6 -6
- package/lib/cjs/resources/promotions.d.ts +4 -1
- package/lib/cjs/resources/promotions.js +4 -0
- package/lib/cjs/resources/refunds.d.ts +3 -3
- package/lib/cjs/resources/refunds.js +4 -4
- package/lib/cjs/resources/shipments.d.ts +11 -1
- package/lib/cjs/resources/shipments.js +7 -0
- package/lib/cjs/resources/shipping_categories.d.ts +3 -0
- package/lib/cjs/resources/shipping_methods.d.ts +2 -0
- package/lib/cjs/resources/stock_line_items.d.ts +7 -0
- package/lib/cjs/resources/stock_line_items.js +9 -0
- package/lib/cjs/resources/stock_locations.d.ts +3 -0
- package/lib/cjs/resources/stock_reservations.d.ts +0 -1
- package/lib/cjs/resources/stock_transfers.d.ts +1 -0
- package/lib/cjs/resources/stripe_payments.d.ts +2 -0
- package/lib/cjs/resources/transactions.d.ts +3 -0
- package/lib/cjs/resources/transactions.js +4 -0
- package/lib/cjs/resources/voids.d.ts +3 -3
- package/lib/cjs/resources/voids.js +4 -4
- package/lib/cjs/resources/webhooks.d.ts +7 -0
- package/lib/cjs/resources/webhooks.js +6 -0
- package/lib/cjs/static.d.ts +4 -1
- package/lib/cjs/static.js +8 -2
- package/lib/cjs/util.d.ts +6 -1
- package/lib/cjs/util.js +1 -0
- package/lib/esm/api.d.ts +3 -2
- package/lib/esm/api.js +7 -1
- package/lib/esm/client.d.ts +8 -9
- package/lib/esm/client.js +42 -11
- package/lib/esm/commercelayer.d.ts +4 -2
- package/lib/esm/commercelayer.js +7 -1
- package/lib/esm/error.d.ts +7 -7
- package/lib/esm/jsonapi.d.ts +1 -0
- package/lib/esm/jsonapi.js +1 -1
- package/lib/esm/model.d.ts +1 -1
- package/lib/esm/resource.d.ts +1 -1
- package/lib/esm/resource.js +1 -2
- package/lib/esm/resources/authorizations.d.ts +3 -3
- package/lib/esm/resources/authorizations.js +4 -4
- package/lib/esm/resources/avalara_accounts.d.ts +6 -6
- package/lib/esm/resources/axerve_payments.d.ts +2 -0
- package/lib/esm/resources/bundles.d.ts +8 -8
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +12 -2
- package/lib/esm/resources/buy_x_pay_y_promotions.js +4 -0
- package/lib/esm/resources/captures.d.ts +3 -3
- package/lib/esm/resources/captures.js +4 -4
- package/lib/esm/resources/customer_payment_sources.d.ts +13 -1
- package/lib/esm/resources/customer_payment_sources.js +4 -0
- package/lib/esm/resources/external_promotions.d.ts +12 -2
- package/lib/esm/resources/external_promotions.js +4 -0
- package/lib/esm/resources/fixed_amount_promotions.d.ts +12 -2
- package/lib/esm/resources/fixed_amount_promotions.js +4 -0
- package/lib/esm/resources/fixed_price_promotions.d.ts +12 -2
- package/lib/esm/resources/fixed_price_promotions.js +4 -0
- package/lib/esm/resources/free_gift_promotions.d.ts +12 -2
- package/lib/esm/resources/free_gift_promotions.js +4 -0
- package/lib/esm/resources/free_shipping_promotions.d.ts +12 -2
- package/lib/esm/resources/free_shipping_promotions.js +4 -0
- package/lib/esm/resources/imports.d.ts +0 -2
- package/lib/esm/resources/inventory_models.d.ts +3 -0
- package/lib/esm/resources/line_items.d.ts +9 -0
- package/lib/esm/resources/line_items.js +4 -0
- package/lib/esm/resources/markets.d.ts +5 -0
- package/lib/esm/resources/orders.d.ts +5 -1
- package/lib/esm/resources/orders.js +4 -0
- package/lib/esm/resources/organization.d.ts +4 -4
- package/lib/esm/resources/payment_methods.d.ts +2 -0
- package/lib/esm/resources/percentage_discount_promotions.d.ts +12 -2
- package/lib/esm/resources/percentage_discount_promotions.js +4 -0
- package/lib/esm/resources/price_lists.d.ts +3 -0
- package/lib/esm/resources/prices.d.ts +6 -6
- package/lib/esm/resources/promotions.d.ts +4 -1
- package/lib/esm/resources/promotions.js +4 -0
- package/lib/esm/resources/refunds.d.ts +3 -3
- package/lib/esm/resources/refunds.js +4 -4
- package/lib/esm/resources/shipments.d.ts +11 -1
- package/lib/esm/resources/shipments.js +7 -0
- package/lib/esm/resources/shipping_categories.d.ts +3 -0
- package/lib/esm/resources/shipping_methods.d.ts +2 -0
- package/lib/esm/resources/stock_line_items.d.ts +7 -0
- package/lib/esm/resources/stock_line_items.js +9 -0
- package/lib/esm/resources/stock_locations.d.ts +3 -0
- package/lib/esm/resources/stock_reservations.d.ts +0 -1
- package/lib/esm/resources/stock_transfers.d.ts +1 -0
- package/lib/esm/resources/stripe_payments.d.ts +2 -0
- package/lib/esm/resources/transactions.d.ts +3 -0
- package/lib/esm/resources/transactions.js +4 -0
- package/lib/esm/resources/voids.d.ts +3 -3
- package/lib/esm/resources/voids.js +4 -4
- package/lib/esm/resources/webhooks.d.ts +7 -0
- package/lib/esm/resources/webhooks.js +6 -0
- package/lib/esm/static.d.ts +4 -1
- package/lib/esm/static.js +8 -2
- package/lib/esm/util.d.ts +6 -1
- package/lib/esm/util.js +27 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
@@ -89,7 +89,7 @@ type TagRel = ResourceRel & {
|
|
89
89
|
};
|
90
90
|
interface Order extends Resource {
|
91
91
|
readonly type: OrderType;
|
92
|
-
number?:
|
92
|
+
number?: string | null;
|
93
93
|
autorefresh?: boolean | null;
|
94
94
|
status: 'draft' | 'pending' | 'placed' | 'editing' | 'approved' | 'cancelled';
|
95
95
|
payment_status: 'unpaid' | 'authorized' | 'partially_authorized' | 'paid' | 'partially_paid' | 'voided' | 'partially_voided' | 'refunded' | 'partially_refunded' | 'free';
|
@@ -217,6 +217,7 @@ interface Order extends Resource {
|
|
217
217
|
voids?: Void[] | null;
|
218
218
|
refunds?: Refund[] | null;
|
219
219
|
returns?: Return[] | null;
|
220
|
+
order_subscription?: OrderSubscription | null;
|
220
221
|
order_subscriptions?: OrderSubscription[] | null;
|
221
222
|
order_factories?: OrderFactory[] | null;
|
222
223
|
order_copies?: OrderCopy[] | null;
|
@@ -227,6 +228,7 @@ interface Order extends Resource {
|
|
227
228
|
versions?: Version[] | null;
|
228
229
|
}
|
229
230
|
interface OrderCreate extends ResourceCreate {
|
231
|
+
number?: string | null;
|
230
232
|
autorefresh?: boolean | null;
|
231
233
|
guest?: boolean | null;
|
232
234
|
customer_email?: string | null;
|
@@ -252,6 +254,7 @@ interface OrderCreate extends ResourceCreate {
|
|
252
254
|
tags?: TagRel[] | null;
|
253
255
|
}
|
254
256
|
interface OrderUpdate extends ResourceUpdate {
|
257
|
+
number?: string | null;
|
255
258
|
autorefresh?: boolean | null;
|
256
259
|
guest?: boolean | null;
|
257
260
|
customer_email?: string | null;
|
@@ -329,6 +332,7 @@ declare class Orders extends ApiResource<Order> {
|
|
329
332
|
voids(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Void>>;
|
330
333
|
refunds(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Refund>>;
|
331
334
|
returns(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Return>>;
|
335
|
+
order_subscription(orderId: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderSubscription>;
|
332
336
|
order_subscriptions(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderSubscription>>;
|
333
337
|
order_factories(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderFactory>>;
|
334
338
|
order_copies(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderCopy>>;
|
@@ -93,6 +93,10 @@ class Orders extends ApiResource {
|
|
93
93
|
const _orderId = orderId.id || orderId;
|
94
94
|
return this.resources.fetch({ type: 'returns' }, `orders/${_orderId}/returns`, params, options);
|
95
95
|
}
|
96
|
+
async order_subscription(orderId, params, options) {
|
97
|
+
const _orderId = orderId.id || orderId;
|
98
|
+
return this.resources.fetch({ type: 'order_subscriptions' }, `orders/${_orderId}/order_subscription`, params, options);
|
99
|
+
}
|
96
100
|
async order_subscriptions(orderId, params, options) {
|
97
101
|
const _orderId = orderId.id || orderId;
|
98
102
|
return this.resources.fetch({ type: 'order_subscriptions' }, `orders/${_orderId}/order_subscriptions`, params, options);
|
@@ -14,14 +14,14 @@ interface Organization extends Resource {
|
|
14
14
|
logo_url?: string | null;
|
15
15
|
favicon_url?: string | null;
|
16
16
|
primary_color?: string | null;
|
17
|
-
contrast_color?: string | null;
|
18
17
|
gtm_id?: string | null;
|
19
18
|
gtm_id_test?: string | null;
|
20
|
-
discount_disabled?: boolean | null;
|
21
|
-
account_disabled?: boolean | null;
|
22
|
-
acceptance_disabled?: boolean | null;
|
23
19
|
max_concurrent_promotions?: number | null;
|
24
20
|
max_concurrent_imports?: number | null;
|
21
|
+
max_concurrent_exports?: number | null;
|
22
|
+
max_concurrent_cleanups?: number | null;
|
23
|
+
order_number_editable_test?: boolean | null;
|
24
|
+
order_number_editable_live?: boolean | null;
|
25
25
|
}
|
26
26
|
declare class Organizations extends ApiSingleton<Organization> {
|
27
27
|
static readonly TYPE: OrganizationType;
|
@@ -41,6 +41,8 @@ interface PaymentMethodCreate extends ResourceCreate {
|
|
41
41
|
moto?: boolean | null;
|
42
42
|
require_capture?: boolean | null;
|
43
43
|
auto_capture?: boolean | null;
|
44
|
+
_disable?: boolean | null;
|
45
|
+
_enable?: boolean | null;
|
44
46
|
price_amount_cents: number;
|
45
47
|
auto_capture_max_amount_cents?: number | null;
|
46
48
|
market?: MarketRel | null;
|
@@ -6,6 +6,7 @@ import type { PromotionRule, PromotionRuleType } 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 { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
|
9
10
|
import type { Coupon, CouponType } from './coupons';
|
10
11
|
import type { SkuList, SkuListType } from './sku_lists';
|
11
12
|
import type { Attachment } from './attachments';
|
@@ -32,6 +33,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
|
|
32
33
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
33
34
|
type: CouponCodesPromotionRuleType;
|
34
35
|
};
|
36
|
+
type CustomPromotionRuleRel = ResourceRel & {
|
37
|
+
type: CustomPromotionRuleType;
|
38
|
+
};
|
35
39
|
type CouponRel = ResourceRel & {
|
36
40
|
type: CouponType;
|
37
41
|
};
|
@@ -49,7 +53,7 @@ interface PercentageDiscountPromotion extends Resource {
|
|
49
53
|
priority?: number | null;
|
50
54
|
starts_at: string;
|
51
55
|
expires_at: string;
|
52
|
-
total_usage_limit
|
56
|
+
total_usage_limit?: number | null;
|
53
57
|
total_usage_count?: number | null;
|
54
58
|
active?: boolean | null;
|
55
59
|
disabled_at?: string | null;
|
@@ -59,6 +63,7 @@ interface PercentageDiscountPromotion extends Resource {
|
|
59
63
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
60
64
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
61
65
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
66
|
+
custom_promotion_rule?: CustomPromotionRule | null;
|
62
67
|
coupons?: Coupon[] | null;
|
63
68
|
sku_list?: SkuList | null;
|
64
69
|
attachments?: Attachment[] | null;
|
@@ -74,13 +79,16 @@ interface PercentageDiscountPromotionCreate extends ResourceCreate {
|
|
74
79
|
priority?: number | null;
|
75
80
|
starts_at: string;
|
76
81
|
expires_at: string;
|
77
|
-
total_usage_limit
|
82
|
+
total_usage_limit?: number | null;
|
83
|
+
_disable?: boolean | null;
|
84
|
+
_enable?: boolean | null;
|
78
85
|
percentage: number;
|
79
86
|
market?: MarketRel | null;
|
80
87
|
promotion_rules?: PromotionRuleRel[] | null;
|
81
88
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
82
89
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
83
90
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
91
|
+
custom_promotion_rule?: CustomPromotionRuleRel | null;
|
84
92
|
coupons?: CouponRel[] | null;
|
85
93
|
sku_list?: SkuListRel | null;
|
86
94
|
tags?: TagRel[] | null;
|
@@ -101,6 +109,7 @@ interface PercentageDiscountPromotionUpdate extends ResourceUpdate {
|
|
101
109
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
102
110
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
103
111
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
112
|
+
custom_promotion_rule?: CustomPromotionRuleRel | null;
|
104
113
|
coupons?: CouponRel[] | null;
|
105
114
|
sku_list?: SkuListRel | null;
|
106
115
|
tags?: TagRel[] | null;
|
@@ -114,6 +123,7 @@ declare class PercentageDiscountPromotions extends ApiResource<PercentageDiscoun
|
|
114
123
|
order_amount_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
115
124
|
sku_list_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
116
125
|
coupon_codes_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
126
|
+
custom_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
|
117
127
|
coupons(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
118
128
|
sku_list(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
119
129
|
attachments(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
@@ -25,6 +25,10 @@ class PercentageDiscountPromotions extends ApiResource {
|
|
25
25
|
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
26
26
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/coupon_codes_promotion_rule`, params, options);
|
27
27
|
}
|
28
|
+
async custom_promotion_rule(percentageDiscountPromotionId, params, options) {
|
29
|
+
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
30
|
+
return this.resources.fetch({ type: 'custom_promotion_rules' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/custom_promotion_rule`, params, options);
|
31
|
+
}
|
28
32
|
async coupons(percentageDiscountPromotionId, params, options) {
|
29
33
|
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
30
34
|
return this.resources.fetch({ type: 'coupons' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/coupons`, params, options);
|
@@ -11,6 +11,7 @@ type PriceListRel = ResourceRel & {
|
|
11
11
|
interface PriceList extends Resource {
|
12
12
|
readonly type: PriceListType;
|
13
13
|
name: string;
|
14
|
+
code?: string | null;
|
14
15
|
currency_code: string;
|
15
16
|
tax_included?: boolean | null;
|
16
17
|
prices?: Price[] | null;
|
@@ -19,11 +20,13 @@ interface PriceList extends Resource {
|
|
19
20
|
}
|
20
21
|
interface PriceListCreate extends ResourceCreate {
|
21
22
|
name: string;
|
23
|
+
code?: string | null;
|
22
24
|
currency_code: string;
|
23
25
|
tax_included?: boolean | null;
|
24
26
|
}
|
25
27
|
interface PriceListUpdate extends ResourceUpdate {
|
26
28
|
name?: string | null;
|
29
|
+
code?: string | null;
|
27
30
|
currency_code?: string | null;
|
28
31
|
tax_included?: boolean | null;
|
29
32
|
}
|
@@ -26,11 +26,11 @@ interface Price extends Resource {
|
|
26
26
|
currency_code?: string | null;
|
27
27
|
sku_code?: string | null;
|
28
28
|
amount_cents: number;
|
29
|
-
amount_float
|
30
|
-
formatted_amount
|
31
|
-
compare_at_amount_cents
|
32
|
-
compare_at_amount_float
|
33
|
-
formatted_compare_at_amount
|
29
|
+
amount_float?: number | null;
|
30
|
+
formatted_amount?: string | null;
|
31
|
+
compare_at_amount_cents?: number | null;
|
32
|
+
compare_at_amount_float?: number | null;
|
33
|
+
formatted_compare_at_amount?: string | null;
|
34
34
|
price_list?: PriceList | null;
|
35
35
|
sku?: Sku | null;
|
36
36
|
price_tiers?: PriceTier[] | null;
|
@@ -42,7 +42,7 @@ interface Price extends Resource {
|
|
42
42
|
interface PriceCreate extends ResourceCreate {
|
43
43
|
sku_code?: string | null;
|
44
44
|
amount_cents: number;
|
45
|
-
compare_at_amount_cents
|
45
|
+
compare_at_amount_cents?: number | null;
|
46
46
|
price_list: PriceListRel;
|
47
47
|
sku: SkuRel;
|
48
48
|
price_tiers?: PriceTierRel[] | null;
|
@@ -6,6 +6,7 @@ import type { PromotionRule } from './promotion_rules';
|
|
6
6
|
import type { OrderAmountPromotionRule } from './order_amount_promotion_rules';
|
7
7
|
import type { SkuListPromotionRule } from './sku_list_promotion_rules';
|
8
8
|
import type { CouponCodesPromotionRule } from './coupon_codes_promotion_rules';
|
9
|
+
import type { CustomPromotionRule } from './custom_promotion_rules';
|
9
10
|
import type { Coupon } from './coupons';
|
10
11
|
import type { SkuList } from './sku_lists';
|
11
12
|
import type { Attachment } from './attachments';
|
@@ -24,7 +25,7 @@ interface Promotion extends Resource {
|
|
24
25
|
priority?: number | null;
|
25
26
|
starts_at: string;
|
26
27
|
expires_at: string;
|
27
|
-
total_usage_limit
|
28
|
+
total_usage_limit?: number | null;
|
28
29
|
total_usage_count?: number | null;
|
29
30
|
active?: boolean | null;
|
30
31
|
disabled_at?: string | null;
|
@@ -33,6 +34,7 @@ interface Promotion extends Resource {
|
|
33
34
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
34
35
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
35
36
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
37
|
+
custom_promotion_rule?: CustomPromotionRule | null;
|
36
38
|
coupons?: Coupon[] | null;
|
37
39
|
sku_list?: SkuList | null;
|
38
40
|
attachments?: Attachment[] | null;
|
@@ -46,6 +48,7 @@ declare class Promotions extends ApiResource<Promotion> {
|
|
46
48
|
order_amount_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
47
49
|
sku_list_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
48
50
|
coupon_codes_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
51
|
+
custom_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
|
49
52
|
coupons(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
50
53
|
sku_list(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
51
54
|
attachments(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
@@ -16,6 +16,10 @@ class Promotions extends ApiResource {
|
|
16
16
|
const _promotionId = promotionId.id || promotionId;
|
17
17
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `promotions/${_promotionId}/coupon_codes_promotion_rule`, params, options);
|
18
18
|
}
|
19
|
+
async custom_promotion_rule(promotionId, params, options) {
|
20
|
+
const _promotionId = promotionId.id || promotionId;
|
21
|
+
return this.resources.fetch({ type: 'custom_promotion_rules' }, `promotions/${_promotionId}/custom_promotion_rule`, params, options);
|
22
|
+
}
|
19
23
|
async coupons(promotionId, params, options) {
|
20
24
|
const _promotionId = promotionId.id || promotionId;
|
21
25
|
return this.resources.fetch({ type: 'coupons' }, `promotions/${_promotionId}/coupons`, params, options);
|
@@ -3,9 +3,9 @@ import type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse }
|
|
3
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
4
|
import type { Order } from './orders';
|
5
5
|
import type { Attachment } from './attachments';
|
6
|
+
import type { Event } from './events';
|
6
7
|
import type { Version } from './versions';
|
7
8
|
import type { Capture } from './captures';
|
8
|
-
import type { Event } from './events';
|
9
9
|
type RefundType = 'refunds';
|
10
10
|
type RefundRel = ResourceRel & {
|
11
11
|
type: RefundType;
|
@@ -25,17 +25,17 @@ interface Refund extends Resource {
|
|
25
25
|
gateway_transaction_id?: string | null;
|
26
26
|
order?: Order | null;
|
27
27
|
attachments?: Attachment[] | null;
|
28
|
+
events?: Event[] | null;
|
28
29
|
versions?: Version[] | null;
|
29
30
|
reference_capture?: Capture | null;
|
30
|
-
events?: Event[] | null;
|
31
31
|
}
|
32
32
|
declare class Refunds extends ApiResource<Refund> {
|
33
33
|
static readonly TYPE: RefundType;
|
34
34
|
order(refundId: string | Refund, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
35
35
|
attachments(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
36
|
+
events(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
36
37
|
versions(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
37
38
|
reference_capture(refundId: string | Refund, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
|
38
|
-
events(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
39
39
|
isRefund(resource: any): resource is Refund;
|
40
40
|
relationship(id: string | ResourceId | null): RefundRel;
|
41
41
|
type(): RefundType;
|
@@ -8,6 +8,10 @@ class Refunds extends ApiResource {
|
|
8
8
|
const _refundId = refundId.id || refundId;
|
9
9
|
return this.resources.fetch({ type: 'attachments' }, `refunds/${_refundId}/attachments`, params, options);
|
10
10
|
}
|
11
|
+
async events(refundId, params, options) {
|
12
|
+
const _refundId = refundId.id || refundId;
|
13
|
+
return this.resources.fetch({ type: 'events' }, `refunds/${_refundId}/events`, params, options);
|
14
|
+
}
|
11
15
|
async versions(refundId, params, options) {
|
12
16
|
const _refundId = refundId.id || refundId;
|
13
17
|
return this.resources.fetch({ type: 'versions' }, `refunds/${_refundId}/versions`, params, options);
|
@@ -16,10 +20,6 @@ class Refunds extends ApiResource {
|
|
16
20
|
const _refundId = refundId.id || refundId;
|
17
21
|
return this.resources.fetch({ type: 'captures' }, `refunds/${_refundId}/reference_capture`, params, options);
|
18
22
|
}
|
19
|
-
async events(refundId, params, options) {
|
20
|
-
const _refundId = refundId.id || refundId;
|
21
|
-
return this.resources.fetch({ type: 'events' }, `refunds/${_refundId}/events`, params, options);
|
22
|
-
}
|
23
23
|
isRefund(resource) {
|
24
24
|
return resource.type && (resource.type === Refunds.TYPE);
|
25
25
|
}
|
@@ -14,6 +14,7 @@ import type { CarrierAccount } from './carrier_accounts';
|
|
14
14
|
import type { Parcel } from './parcels';
|
15
15
|
import type { Attachment } from './attachments';
|
16
16
|
import type { Event } from './events';
|
17
|
+
import type { Tag, TagType } from './tags';
|
17
18
|
import type { Version } from './versions';
|
18
19
|
type ShipmentType = 'shipments';
|
19
20
|
type ShipmentRel = ResourceRel & {
|
@@ -34,6 +35,9 @@ type AddressRel = ResourceRel & {
|
|
34
35
|
type ShippingMethodRel = ResourceRel & {
|
35
36
|
type: ShippingMethodType;
|
36
37
|
};
|
38
|
+
type TagRel = ResourceRel & {
|
39
|
+
type: TagType;
|
40
|
+
};
|
37
41
|
interface Shipment extends Resource {
|
38
42
|
readonly type: ShipmentType;
|
39
43
|
number?: string | null;
|
@@ -77,16 +81,19 @@ interface Shipment extends Resource {
|
|
77
81
|
parcels?: Parcel[] | null;
|
78
82
|
attachments?: Attachment[] | null;
|
79
83
|
events?: Event[] | null;
|
84
|
+
tags?: Tag[] | null;
|
80
85
|
versions?: Version[] | null;
|
81
86
|
}
|
82
87
|
interface ShipmentCreate extends ResourceCreate {
|
83
88
|
order: OrderRel;
|
84
89
|
shipping_category?: ShippingCategoryRel | null;
|
85
|
-
inventory_stock_location
|
90
|
+
inventory_stock_location: InventoryStockLocationRel;
|
86
91
|
shipping_address?: AddressRel | null;
|
87
92
|
shipping_method?: ShippingMethodRel | null;
|
93
|
+
tags?: TagRel[] | null;
|
88
94
|
}
|
89
95
|
interface ShipmentUpdate extends ResourceUpdate {
|
96
|
+
_upcoming?: boolean | null;
|
90
97
|
_on_hold?: boolean | null;
|
91
98
|
_picking?: boolean | null;
|
92
99
|
_packing?: boolean | null;
|
@@ -102,6 +109,7 @@ interface ShipmentUpdate extends ResourceUpdate {
|
|
102
109
|
inventory_stock_location?: InventoryStockLocationRel | null;
|
103
110
|
shipping_address?: AddressRel | null;
|
104
111
|
shipping_method?: ShippingMethodRel | null;
|
112
|
+
tags?: TagRel[] | null;
|
105
113
|
}
|
106
114
|
declare class Shipments extends ApiResource<Shipment> {
|
107
115
|
static readonly TYPE: ShipmentType;
|
@@ -123,7 +131,9 @@ declare class Shipments extends ApiResource<Shipment> {
|
|
123
131
|
parcels(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
|
124
132
|
attachments(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
125
133
|
events(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
134
|
+
tags(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
126
135
|
versions(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
136
|
+
_upcoming(id: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
127
137
|
_on_hold(id: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
128
138
|
_picking(id: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
129
139
|
_packing(id: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
@@ -69,10 +69,17 @@ class Shipments extends ApiResource {
|
|
69
69
|
const _shipmentId = shipmentId.id || shipmentId;
|
70
70
|
return this.resources.fetch({ type: 'events' }, `shipments/${_shipmentId}/events`, params, options);
|
71
71
|
}
|
72
|
+
async tags(shipmentId, params, options) {
|
73
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
74
|
+
return this.resources.fetch({ type: 'tags' }, `shipments/${_shipmentId}/tags`, params, options);
|
75
|
+
}
|
72
76
|
async versions(shipmentId, params, options) {
|
73
77
|
const _shipmentId = shipmentId.id || shipmentId;
|
74
78
|
return this.resources.fetch({ type: 'versions' }, `shipments/${_shipmentId}/versions`, params, options);
|
75
79
|
}
|
80
|
+
async _upcoming(id, params, options) {
|
81
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Shipments.TYPE, _upcoming: true }, params, options);
|
82
|
+
}
|
76
83
|
async _on_hold(id, params, options) {
|
77
84
|
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Shipments.TYPE, _on_hold: true }, params, options);
|
78
85
|
}
|
@@ -11,15 +11,18 @@ type ShippingCategoryRel = ResourceRel & {
|
|
11
11
|
interface ShippingCategory extends Resource {
|
12
12
|
readonly type: ShippingCategoryType;
|
13
13
|
name: string;
|
14
|
+
code?: string | null;
|
14
15
|
skus?: Sku[] | null;
|
15
16
|
attachments?: Attachment[] | null;
|
16
17
|
versions?: Version[] | null;
|
17
18
|
}
|
18
19
|
interface ShippingCategoryCreate extends ResourceCreate {
|
19
20
|
name: string;
|
21
|
+
code?: string | null;
|
20
22
|
}
|
21
23
|
interface ShippingCategoryUpdate extends ResourceUpdate {
|
22
24
|
name?: string | null;
|
25
|
+
code?: string | null;
|
23
26
|
}
|
24
27
|
declare class ShippingCategories extends ApiResource<ShippingCategory> {
|
25
28
|
static readonly TYPE: ShippingCategoryType;
|
@@ -64,6 +64,8 @@ interface ShippingMethodCreate extends ResourceCreate {
|
|
64
64
|
scheme?: string | null;
|
65
65
|
currency_code?: string | null;
|
66
66
|
external_prices_url?: string | null;
|
67
|
+
_disable?: boolean | null;
|
68
|
+
_enable?: boolean | null;
|
67
69
|
price_amount_cents: number;
|
68
70
|
free_over_amount_cents?: number | null;
|
69
71
|
use_subtotal?: boolean | null;
|
@@ -25,6 +25,7 @@ type SkuRel = ResourceRel & {
|
|
25
25
|
interface StockLineItem extends Resource {
|
26
26
|
readonly type: StockLineItemType;
|
27
27
|
sku_code?: string | null;
|
28
|
+
bundle_code?: string | null;
|
28
29
|
quantity: number;
|
29
30
|
shipment?: Shipment | null;
|
30
31
|
line_item?: LineItem | null;
|
@@ -43,6 +44,9 @@ interface StockLineItemCreate extends ResourceCreate {
|
|
43
44
|
interface StockLineItemUpdate extends ResourceUpdate {
|
44
45
|
sku_code?: string | null;
|
45
46
|
quantity?: number | null;
|
47
|
+
_reserve_stock?: boolean | null;
|
48
|
+
_release_stock?: boolean | null;
|
49
|
+
_decrement_stock?: boolean | null;
|
46
50
|
shipment?: ShipmentRel | null;
|
47
51
|
line_item?: LineItemRel | null;
|
48
52
|
stock_item?: StockItemRel | null;
|
@@ -58,6 +62,9 @@ declare class StockLineItems extends ApiResource<StockLineItem> {
|
|
58
62
|
stock_item(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
59
63
|
sku(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
60
64
|
versions(stockLineItemId: string | StockLineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
65
|
+
_reserve_stock(id: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
|
66
|
+
_release_stock(id: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
|
67
|
+
_decrement_stock(id: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
|
61
68
|
isStockLineItem(resource: any): resource is StockLineItem;
|
62
69
|
relationship(id: string | ResourceId | null): StockLineItemRel;
|
63
70
|
type(): StockLineItemType;
|
@@ -29,6 +29,15 @@ class StockLineItems extends ApiResource {
|
|
29
29
|
const _stockLineItemId = stockLineItemId.id || stockLineItemId;
|
30
30
|
return this.resources.fetch({ type: 'versions' }, `stock_line_items/${_stockLineItemId}/versions`, params, options);
|
31
31
|
}
|
32
|
+
async _reserve_stock(id, params, options) {
|
33
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockLineItems.TYPE, _reserve_stock: true }, params, options);
|
34
|
+
}
|
35
|
+
async _release_stock(id, params, options) {
|
36
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockLineItems.TYPE, _release_stock: true }, params, options);
|
37
|
+
}
|
38
|
+
async _decrement_stock(id, params, options) {
|
39
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockLineItems.TYPE, _decrement_stock: true }, params, options);
|
40
|
+
}
|
32
41
|
isStockLineItem(resource) {
|
33
42
|
return resource.type && (resource.type === StockLineItems.TYPE);
|
34
43
|
}
|
@@ -19,6 +19,7 @@ interface StockLocation extends Resource {
|
|
19
19
|
readonly type: StockLocationType;
|
20
20
|
number?: number | null;
|
21
21
|
name: string;
|
22
|
+
code?: string | null;
|
22
23
|
label_format?: string | null;
|
23
24
|
suppress_etd?: boolean | null;
|
24
25
|
address?: Address | null;
|
@@ -31,12 +32,14 @@ interface StockLocation extends Resource {
|
|
31
32
|
}
|
32
33
|
interface StockLocationCreate extends ResourceCreate {
|
33
34
|
name: string;
|
35
|
+
code?: string | null;
|
34
36
|
label_format?: string | null;
|
35
37
|
suppress_etd?: boolean | null;
|
36
38
|
address: AddressRel;
|
37
39
|
}
|
38
40
|
interface StockLocationUpdate extends ResourceUpdate {
|
39
41
|
name?: string | null;
|
42
|
+
code?: string | null;
|
40
43
|
label_format?: string | null;
|
41
44
|
suppress_etd?: boolean | null;
|
42
45
|
address?: AddressRel | null;
|
@@ -31,7 +31,6 @@ interface StockReservationCreate extends ResourceCreate {
|
|
31
31
|
interface StockReservationUpdate extends ResourceUpdate {
|
32
32
|
quantity?: number | null;
|
33
33
|
_pending?: boolean | null;
|
34
|
-
stock_item?: StockItemRel | null;
|
35
34
|
}
|
36
35
|
declare class StockReservations extends ApiResource<StockReservation> {
|
37
36
|
static readonly TYPE: StockReservationType;
|
@@ -25,6 +25,7 @@ type LineItemRel = ResourceRel & {
|
|
25
25
|
};
|
26
26
|
interface StockTransfer extends Resource {
|
27
27
|
readonly type: StockTransferType;
|
28
|
+
number?: number | null;
|
28
29
|
sku_code?: string | null;
|
29
30
|
status: 'draft' | 'upcoming' | 'on_hold' | 'picking' | 'in_transit' | 'completed' | 'cancelled';
|
30
31
|
quantity: number;
|
@@ -22,6 +22,7 @@ interface StripePayment extends Resource {
|
|
22
22
|
intent_amount_float?: number | null;
|
23
23
|
formatted_intent_amount?: string | null;
|
24
24
|
return_url?: string | null;
|
25
|
+
receipt_email?: string | null;
|
25
26
|
payment_instrument?: Record<string, any> | null;
|
26
27
|
order?: Order | null;
|
27
28
|
payment_gateway?: PaymentGateway | null;
|
@@ -30,6 +31,7 @@ interface StripePayment extends Resource {
|
|
30
31
|
interface StripePaymentCreate extends ResourceCreate {
|
31
32
|
options?: Record<string, any> | null;
|
32
33
|
return_url?: string | null;
|
34
|
+
receipt_email?: string | null;
|
33
35
|
order: OrderRel;
|
34
36
|
}
|
35
37
|
interface StripePaymentUpdate extends ResourceUpdate {
|
@@ -3,6 +3,7 @@ import type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse }
|
|
3
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
4
|
import type { Order } from './orders';
|
5
5
|
import type { Attachment } from './attachments';
|
6
|
+
import type { Event } from './events';
|
6
7
|
import type { Version } from './versions';
|
7
8
|
type TransactionType = 'transactions';
|
8
9
|
type TransactionRel = ResourceRel & {
|
@@ -23,12 +24,14 @@ interface Transaction extends Resource {
|
|
23
24
|
gateway_transaction_id?: string | null;
|
24
25
|
order?: Order | null;
|
25
26
|
attachments?: Attachment[] | null;
|
27
|
+
events?: Event[] | null;
|
26
28
|
versions?: Version[] | null;
|
27
29
|
}
|
28
30
|
declare class Transactions extends ApiResource<Transaction> {
|
29
31
|
static readonly TYPE: TransactionType;
|
30
32
|
order(transactionId: string | Transaction, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
31
33
|
attachments(transactionId: string | Transaction, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
34
|
+
events(transactionId: string | Transaction, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
32
35
|
versions(transactionId: string | Transaction, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
33
36
|
isTransaction(resource: any): resource is Transaction;
|
34
37
|
relationship(id: string | ResourceId | null): TransactionRel;
|
@@ -8,6 +8,10 @@ class Transactions extends ApiResource {
|
|
8
8
|
const _transactionId = transactionId.id || transactionId;
|
9
9
|
return this.resources.fetch({ type: 'attachments' }, `transactions/${_transactionId}/attachments`, params, options);
|
10
10
|
}
|
11
|
+
async events(transactionId, params, options) {
|
12
|
+
const _transactionId = transactionId.id || transactionId;
|
13
|
+
return this.resources.fetch({ type: 'events' }, `transactions/${_transactionId}/events`, params, options);
|
14
|
+
}
|
11
15
|
async versions(transactionId, params, options) {
|
12
16
|
const _transactionId = transactionId.id || transactionId;
|
13
17
|
return this.resources.fetch({ type: 'versions' }, `transactions/${_transactionId}/versions`, params, options);
|
@@ -3,9 +3,9 @@ import type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse }
|
|
3
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
4
|
import type { Order } from './orders';
|
5
5
|
import type { Attachment } from './attachments';
|
6
|
+
import type { Event } from './events';
|
6
7
|
import type { Version } from './versions';
|
7
8
|
import type { Authorization } from './authorizations';
|
8
|
-
import type { Event } from './events';
|
9
9
|
type VoidType = 'voids';
|
10
10
|
type VoidRel = ResourceRel & {
|
11
11
|
type: VoidType;
|
@@ -25,17 +25,17 @@ interface Void extends Resource {
|
|
25
25
|
gateway_transaction_id?: string | null;
|
26
26
|
order?: Order | null;
|
27
27
|
attachments?: Attachment[] | null;
|
28
|
+
events?: Event[] | null;
|
28
29
|
versions?: Version[] | null;
|
29
30
|
reference_authorization?: Authorization | null;
|
30
|
-
events?: Event[] | null;
|
31
31
|
}
|
32
32
|
declare class Voids extends ApiResource<Void> {
|
33
33
|
static readonly TYPE: VoidType;
|
34
34
|
order(voidId: string | Void, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
35
35
|
attachments(voidId: string | Void, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
36
|
+
events(voidId: string | Void, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
36
37
|
versions(voidId: string | Void, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
37
38
|
reference_authorization(voidId: string | Void, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
|
38
|
-
events(voidId: string | Void, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
39
39
|
isVoid(resource: any): resource is Void;
|
40
40
|
relationship(id: string | ResourceId | null): VoidRel;
|
41
41
|
type(): VoidType;
|
@@ -8,6 +8,10 @@ class Voids extends ApiResource {
|
|
8
8
|
const _voidId = voidId.id || voidId;
|
9
9
|
return this.resources.fetch({ type: 'attachments' }, `voids/${_voidId}/attachments`, params, options);
|
10
10
|
}
|
11
|
+
async events(voidId, params, options) {
|
12
|
+
const _voidId = voidId.id || voidId;
|
13
|
+
return this.resources.fetch({ type: 'events' }, `voids/${_voidId}/events`, params, options);
|
14
|
+
}
|
11
15
|
async versions(voidId, params, options) {
|
12
16
|
const _voidId = voidId.id || voidId;
|
13
17
|
return this.resources.fetch({ type: 'versions' }, `voids/${_voidId}/versions`, params, options);
|
@@ -16,10 +20,6 @@ class Voids extends ApiResource {
|
|
16
20
|
const _voidId = voidId.id || voidId;
|
17
21
|
return this.resources.fetch({ type: 'authorizations' }, `voids/${_voidId}/reference_authorization`, params, options);
|
18
22
|
}
|
19
|
-
async events(voidId, params, options) {
|
20
|
-
const _voidId = voidId.id || voidId;
|
21
|
-
return this.resources.fetch({ type: 'events' }, `voids/${_voidId}/events`, params, options);
|
22
|
-
}
|
23
23
|
isVoid(resource) {
|
24
24
|
return resource.type && (resource.type === Voids.TYPE);
|
25
25
|
}
|
@@ -16,6 +16,7 @@ interface Webhook extends Resource {
|
|
16
16
|
circuit_state?: string | null;
|
17
17
|
circuit_failure_count?: number | null;
|
18
18
|
shared_secret: string;
|
19
|
+
disabled_at?: string | null;
|
19
20
|
last_event_callbacks?: EventCallback[] | null;
|
20
21
|
versions?: Version[] | null;
|
21
22
|
}
|
@@ -24,6 +25,8 @@ interface WebhookCreate extends ResourceCreate {
|
|
24
25
|
topic: string;
|
25
26
|
callback_url: string;
|
26
27
|
include_resources?: string[] | null;
|
28
|
+
_disable?: boolean | null;
|
29
|
+
_enable?: boolean | null;
|
27
30
|
}
|
28
31
|
interface WebhookUpdate extends ResourceUpdate {
|
29
32
|
name?: string | null;
|
@@ -31,6 +34,8 @@ interface WebhookUpdate extends ResourceUpdate {
|
|
31
34
|
callback_url?: string | null;
|
32
35
|
include_resources?: string[] | null;
|
33
36
|
_reset_circuit?: boolean | null;
|
37
|
+
_disable?: boolean | null;
|
38
|
+
_enable?: boolean | null;
|
34
39
|
}
|
35
40
|
declare class Webhooks extends ApiResource<Webhook> {
|
36
41
|
static readonly TYPE: WebhookType;
|
@@ -40,6 +45,8 @@ declare class Webhooks extends ApiResource<Webhook> {
|
|
40
45
|
last_event_callbacks(webhookId: string | Webhook, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<EventCallback>>;
|
41
46
|
versions(webhookId: string | Webhook, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
42
47
|
_reset_circuit(id: string | Webhook, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
|
48
|
+
_disable(id: string | Webhook, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
|
49
|
+
_enable(id: string | Webhook, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
|
43
50
|
isWebhook(resource: any): resource is Webhook;
|
44
51
|
relationship(id: string | ResourceId | null): WebhookRel;
|
45
52
|
type(): WebhookType;
|