@commercelayer/sdk 5.0.0 → 5.1.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 +6 -5
- package/lib/cjs/api.js +4 -1
- package/lib/cjs/commercelayer.d.ts +3 -2
- package/lib/cjs/commercelayer.js +2 -1
- package/lib/cjs/interceptor.d.ts +1 -1
- package/lib/cjs/model.d.ts +1 -0
- package/lib/cjs/resource.d.ts +1 -1
- package/lib/cjs/resources/addresses.d.ts +13 -2
- package/lib/cjs/resources/addresses.js +8 -0
- package/lib/cjs/resources/adyen_payments.d.ts +8 -8
- package/lib/cjs/resources/axerve_payments.d.ts +3 -3
- package/lib/cjs/resources/braintree_payments.d.ts +4 -4
- package/lib/cjs/resources/bundles.d.ts +11 -0
- package/lib/cjs/resources/bundles.js +8 -0
- package/lib/cjs/resources/checkout_com_payments.d.ts +2 -2
- package/lib/cjs/resources/cleanups.d.ts +3 -3
- package/lib/cjs/resources/coupons.d.ts +15 -4
- package/lib/cjs/resources/coupons.js +8 -0
- package/lib/cjs/resources/customers.d.ts +8 -0
- package/lib/cjs/resources/customers.js +4 -0
- package/lib/cjs/resources/event_callbacks.d.ts +1 -1
- package/lib/cjs/resources/exports.d.ts +2 -2
- package/lib/cjs/resources/external_payments.d.ts +4 -4
- package/lib/cjs/resources/external_promotions.d.ts +8 -0
- package/lib/cjs/resources/external_promotions.js +4 -0
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +8 -0
- package/lib/cjs/resources/fixed_amount_promotions.js +4 -0
- package/lib/cjs/resources/fixed_price_promotions.d.ts +8 -0
- package/lib/cjs/resources/fixed_price_promotions.js +4 -0
- package/lib/cjs/resources/free_gift_promotions.d.ts +8 -0
- package/lib/cjs/resources/free_gift_promotions.js +4 -0
- package/lib/cjs/resources/free_shipping_promotions.d.ts +8 -0
- package/lib/cjs/resources/free_shipping_promotions.js +4 -0
- package/lib/cjs/resources/gift_cards.d.ts +9 -1
- package/lib/cjs/resources/gift_cards.js +4 -0
- package/lib/cjs/resources/imports.d.ts +4 -4
- package/lib/cjs/resources/klarna_payments.d.ts +2 -2
- package/lib/cjs/resources/line_item_options.d.ts +16 -5
- package/lib/cjs/resources/line_item_options.js +8 -0
- package/lib/cjs/resources/line_items.d.ts +13 -2
- package/lib/cjs/resources/line_items.js +8 -0
- package/lib/cjs/resources/order_copies.d.ts +1 -1
- package/lib/cjs/resources/order_factories.d.ts +1 -1
- package/lib/cjs/resources/order_subscriptions.d.ts +2 -2
- package/lib/cjs/resources/orders.d.ts +9 -1
- package/lib/cjs/resources/orders.js +4 -0
- package/lib/cjs/resources/parcels.d.ts +3 -0
- package/lib/cjs/resources/paypal_payments.d.ts +1 -1
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +8 -0
- package/lib/cjs/resources/percentage_discount_promotions.js +4 -0
- package/lib/cjs/resources/promotions.d.ts +3 -0
- package/lib/cjs/resources/promotions.js +4 -0
- package/lib/cjs/resources/recurring_order_copies.d.ts +1 -1
- package/lib/cjs/resources/return_line_items.d.ts +3 -3
- package/lib/cjs/resources/returns.d.ts +8 -0
- package/lib/cjs/resources/returns.js +4 -0
- package/lib/cjs/resources/satispay_gateways.d.ts +3 -0
- package/lib/cjs/resources/satispay_payments.d.ts +0 -3
- package/lib/cjs/resources/shipments.d.ts +2 -2
- package/lib/cjs/resources/sku_options.d.ts +11 -0
- package/lib/cjs/resources/sku_options.js +8 -0
- package/lib/cjs/resources/skus.d.ts +12 -1
- package/lib/cjs/resources/skus.js +8 -0
- package/lib/cjs/resources/stripe_payments.d.ts +5 -5
- package/lib/cjs/resources/tags.d.ts +28 -0
- package/lib/cjs/resources/tags.js +25 -0
- package/lib/cjs/resources/tax_rules.d.ts +1 -1
- package/lib/cjs/resources/wire_transfers.d.ts +1 -1
- package/lib/esm/api.d.ts +6 -5
- package/lib/esm/api.js +2 -0
- package/lib/esm/commercelayer.d.ts +3 -2
- package/lib/esm/commercelayer.js +2 -1
- package/lib/esm/interceptor.d.ts +1 -1
- package/lib/esm/model.d.ts +1 -0
- package/lib/esm/resource.d.ts +1 -1
- package/lib/esm/resources/addresses.d.ts +13 -2
- package/lib/esm/resources/addresses.js +8 -0
- package/lib/esm/resources/adyen_payments.d.ts +8 -8
- package/lib/esm/resources/axerve_payments.d.ts +3 -3
- package/lib/esm/resources/braintree_payments.d.ts +4 -4
- package/lib/esm/resources/bundles.d.ts +11 -0
- package/lib/esm/resources/bundles.js +8 -0
- package/lib/esm/resources/checkout_com_payments.d.ts +2 -2
- package/lib/esm/resources/cleanups.d.ts +3 -3
- package/lib/esm/resources/coupons.d.ts +15 -4
- package/lib/esm/resources/coupons.js +8 -0
- package/lib/esm/resources/customers.d.ts +8 -0
- package/lib/esm/resources/customers.js +4 -0
- package/lib/esm/resources/event_callbacks.d.ts +1 -1
- package/lib/esm/resources/exports.d.ts +2 -2
- package/lib/esm/resources/external_payments.d.ts +4 -4
- package/lib/esm/resources/external_promotions.d.ts +8 -0
- package/lib/esm/resources/external_promotions.js +4 -0
- package/lib/esm/resources/fixed_amount_promotions.d.ts +8 -0
- package/lib/esm/resources/fixed_amount_promotions.js +4 -0
- package/lib/esm/resources/fixed_price_promotions.d.ts +8 -0
- package/lib/esm/resources/fixed_price_promotions.js +4 -0
- package/lib/esm/resources/free_gift_promotions.d.ts +8 -0
- package/lib/esm/resources/free_gift_promotions.js +4 -0
- package/lib/esm/resources/free_shipping_promotions.d.ts +8 -0
- package/lib/esm/resources/free_shipping_promotions.js +4 -0
- package/lib/esm/resources/gift_cards.d.ts +9 -1
- package/lib/esm/resources/gift_cards.js +4 -0
- package/lib/esm/resources/imports.d.ts +4 -4
- package/lib/esm/resources/klarna_payments.d.ts +2 -2
- package/lib/esm/resources/line_item_options.d.ts +16 -5
- package/lib/esm/resources/line_item_options.js +8 -0
- package/lib/esm/resources/line_items.d.ts +13 -2
- package/lib/esm/resources/line_items.js +8 -0
- package/lib/esm/resources/order_copies.d.ts +1 -1
- package/lib/esm/resources/order_factories.d.ts +1 -1
- package/lib/esm/resources/order_subscriptions.d.ts +2 -2
- package/lib/esm/resources/orders.d.ts +9 -1
- package/lib/esm/resources/orders.js +4 -0
- package/lib/esm/resources/parcels.d.ts +3 -0
- package/lib/esm/resources/paypal_payments.d.ts +1 -1
- package/lib/esm/resources/percentage_discount_promotions.d.ts +8 -0
- package/lib/esm/resources/percentage_discount_promotions.js +4 -0
- package/lib/esm/resources/promotions.d.ts +3 -0
- package/lib/esm/resources/promotions.js +4 -0
- package/lib/esm/resources/recurring_order_copies.d.ts +1 -1
- package/lib/esm/resources/return_line_items.d.ts +3 -3
- package/lib/esm/resources/returns.d.ts +8 -0
- package/lib/esm/resources/returns.js +4 -0
- package/lib/esm/resources/satispay_gateways.d.ts +3 -0
- package/lib/esm/resources/satispay_payments.d.ts +0 -3
- package/lib/esm/resources/shipments.d.ts +2 -2
- package/lib/esm/resources/sku_options.d.ts +11 -0
- package/lib/esm/resources/sku_options.js +8 -0
- package/lib/esm/resources/skus.d.ts +12 -1
- package/lib/esm/resources/skus.js +8 -0
- package/lib/esm/resources/stripe_payments.d.ts +5 -5
- package/lib/esm/resources/tags.d.ts +28 -0
- package/lib/esm/resources/tags.js +23 -0
- package/lib/esm/resources/tax_rules.d.ts +1 -1
- package/lib/esm/resources/wire_transfers.d.ts +1 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
@@ -31,6 +31,7 @@ import type { OrderCopy } from './order_copies';
|
|
31
31
|
import type { RecurringOrderCopy } from './recurring_order_copies';
|
32
32
|
import type { Attachment } from './attachments';
|
33
33
|
import type { Event } from './events';
|
34
|
+
import type { Tag, TagType } from './tags';
|
34
35
|
type OrderType = 'orders';
|
35
36
|
type OrderRel = ResourceRel & {
|
36
37
|
type: OrderType;
|
@@ -77,6 +78,9 @@ type StripePaymentRel = ResourceRel & {
|
|
77
78
|
type WireTransferRel = ResourceRel & {
|
78
79
|
type: WireTransferType;
|
79
80
|
};
|
81
|
+
type TagRel = ResourceRel & {
|
82
|
+
type: TagType;
|
83
|
+
};
|
80
84
|
interface Order extends Resource {
|
81
85
|
readonly type: OrderType;
|
82
86
|
number?: number | null;
|
@@ -162,7 +166,7 @@ interface Order extends Resource {
|
|
162
166
|
line_item_options_count?: number | null;
|
163
167
|
shipments_count?: number | null;
|
164
168
|
tax_calculations_count?: number | null;
|
165
|
-
payment_source_details?:
|
169
|
+
payment_source_details?: Record<string, any> | null;
|
166
170
|
token?: string | null;
|
167
171
|
cart_url?: string | null;
|
168
172
|
return_url?: string | null;
|
@@ -202,6 +206,7 @@ interface Order extends Resource {
|
|
202
206
|
recurring_order_copies?: RecurringOrderCopy[] | null;
|
203
207
|
attachments?: Attachment[] | null;
|
204
208
|
events?: Event[] | null;
|
209
|
+
tags?: Tag[] | null;
|
205
210
|
}
|
206
211
|
interface OrderCreate extends ResourceCreate {
|
207
212
|
autorefresh?: boolean | null;
|
@@ -223,6 +228,7 @@ interface OrderCreate extends ResourceCreate {
|
|
223
228
|
billing_address?: AddressRel | null;
|
224
229
|
payment_method?: PaymentMethodRel | null;
|
225
230
|
payment_source?: AdyenPaymentRel | AxervePaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | PaypalPaymentRel | SatispayPaymentRel | StripePaymentRel | WireTransferRel | null;
|
231
|
+
tags?: TagRel[] | null;
|
226
232
|
}
|
227
233
|
interface OrderUpdate extends ResourceUpdate {
|
228
234
|
autorefresh?: boolean | null;
|
@@ -269,6 +275,7 @@ interface OrderUpdate extends ResourceUpdate {
|
|
269
275
|
billing_address?: AddressRel | null;
|
270
276
|
payment_method?: PaymentMethodRel | null;
|
271
277
|
payment_source?: AdyenPaymentRel | AxervePaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | PaypalPaymentRel | SatispayPaymentRel | StripePaymentRel | WireTransferRel | null;
|
278
|
+
tags?: TagRel[] | null;
|
272
279
|
}
|
273
280
|
declare class Orders extends ApiResource<Order> {
|
274
281
|
static readonly TYPE: OrderType;
|
@@ -297,6 +304,7 @@ declare class Orders extends ApiResource<Order> {
|
|
297
304
|
recurring_order_copies(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<RecurringOrderCopy>>;
|
298
305
|
attachments(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
299
306
|
events(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
307
|
+
tags(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
300
308
|
isOrder(resource: any): resource is Order;
|
301
309
|
relationship(id: string | ResourceId | null): OrderRel;
|
302
310
|
type(): OrderType;
|
@@ -99,6 +99,10 @@ class Orders extends resource_1.ApiResource {
|
|
99
99
|
const _orderId = orderId.id || orderId;
|
100
100
|
return this.resources.fetch({ type: 'events' }, `orders/${_orderId}/events`, params, options);
|
101
101
|
}
|
102
|
+
async tags(orderId, params, options) {
|
103
|
+
const _orderId = orderId.id || orderId;
|
104
|
+
return this.resources.fetch({ type: 'tags' }, `orders/${_orderId}/tags`, params, options);
|
105
|
+
}
|
102
106
|
isOrder(resource) {
|
103
107
|
return resource.type && (resource.type === Orders.TYPE);
|
104
108
|
}
|
@@ -42,6 +42,7 @@ interface Parcel extends Resource {
|
|
42
42
|
carrier_weight_oz?: string | null;
|
43
43
|
signed_by?: string | null;
|
44
44
|
incoterm?: string | null;
|
45
|
+
delivery_confirmation?: string | null;
|
45
46
|
shipment?: Shipment | null;
|
46
47
|
package?: Package | null;
|
47
48
|
parcel_line_items?: ParcelLineItem[] | null;
|
@@ -72,6 +73,7 @@ interface ParcelCreate extends ResourceCreate {
|
|
72
73
|
carrier_weight_oz?: string | null;
|
73
74
|
signed_by?: string | null;
|
74
75
|
incoterm?: string | null;
|
76
|
+
delivery_confirmation?: string | null;
|
75
77
|
shipment: ShipmentRel;
|
76
78
|
package: PackageRel;
|
77
79
|
}
|
@@ -99,6 +101,7 @@ interface ParcelUpdate extends ResourceUpdate {
|
|
99
101
|
carrier_weight_oz?: string | null;
|
100
102
|
signed_by?: string | null;
|
101
103
|
incoterm?: string | null;
|
104
|
+
delivery_confirmation?: string | null;
|
102
105
|
shipment?: ShipmentRel | null;
|
103
106
|
package?: PackageRel | null;
|
104
107
|
}
|
@@ -24,7 +24,7 @@ interface PaypalPayment extends Resource {
|
|
24
24
|
intent_amount_cents: number;
|
25
25
|
intent_amount_float?: number | null;
|
26
26
|
formatted_intent_amount?: string | null;
|
27
|
-
payment_instrument?:
|
27
|
+
payment_instrument?: Record<string, any> | null;
|
28
28
|
order?: Order | null;
|
29
29
|
payment_gateway?: PaymentGateway | null;
|
30
30
|
}
|
@@ -8,6 +8,7 @@ import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_
|
|
8
8
|
import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
|
9
9
|
import type { Attachment } from './attachments';
|
10
10
|
import type { Event } from './events';
|
11
|
+
import type { Tag, TagType } from './tags';
|
11
12
|
import type { SkuList, SkuListType } from './sku_lists';
|
12
13
|
import type { Sku } from './skus';
|
13
14
|
type PercentageDiscountPromotionType = 'percentage_discount_promotions';
|
@@ -29,6 +30,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
|
|
29
30
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
30
31
|
type: CouponCodesPromotionRuleType;
|
31
32
|
};
|
33
|
+
type TagRel = ResourceRel & {
|
34
|
+
type: TagType;
|
35
|
+
};
|
32
36
|
type SkuListRel = ResourceRel & {
|
33
37
|
type: SkuListType;
|
34
38
|
};
|
@@ -49,6 +53,7 @@ interface PercentageDiscountPromotion extends Resource {
|
|
49
53
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
50
54
|
attachments?: Attachment[] | null;
|
51
55
|
events?: Event[] | null;
|
56
|
+
tags?: Tag[] | null;
|
52
57
|
sku_list?: SkuList | null;
|
53
58
|
skus?: Sku[] | null;
|
54
59
|
}
|
@@ -64,6 +69,7 @@ interface PercentageDiscountPromotionCreate extends ResourceCreate {
|
|
64
69
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
65
70
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
66
71
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
72
|
+
tags?: TagRel[] | null;
|
67
73
|
sku_list?: SkuListRel | null;
|
68
74
|
}
|
69
75
|
interface PercentageDiscountPromotionUpdate extends ResourceUpdate {
|
@@ -78,6 +84,7 @@ interface PercentageDiscountPromotionUpdate extends ResourceUpdate {
|
|
78
84
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
79
85
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
80
86
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
87
|
+
tags?: TagRel[] | null;
|
81
88
|
sku_list?: SkuListRel | null;
|
82
89
|
}
|
83
90
|
declare class PercentageDiscountPromotions extends ApiResource<PercentageDiscountPromotion> {
|
@@ -91,6 +98,7 @@ declare class PercentageDiscountPromotions extends ApiResource<PercentageDiscoun
|
|
91
98
|
coupon_codes_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
92
99
|
attachments(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
93
100
|
events(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
101
|
+
tags(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
94
102
|
sku_list(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
95
103
|
skus(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
96
104
|
isPercentageDiscountPromotion(resource: any): resource is PercentageDiscountPromotion;
|
@@ -35,6 +35,10 @@ class PercentageDiscountPromotions extends resource_1.ApiResource {
|
|
35
35
|
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
36
36
|
return this.resources.fetch({ type: 'events' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/events`, params, options);
|
37
37
|
}
|
38
|
+
async tags(percentageDiscountPromotionId, params, options) {
|
39
|
+
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
40
|
+
return this.resources.fetch({ type: 'tags' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/tags`, params, options);
|
41
|
+
}
|
38
42
|
async sku_list(percentageDiscountPromotionId, params, options) {
|
39
43
|
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
40
44
|
return this.resources.fetch({ type: 'sku_lists' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/sku_list`, params, options);
|
@@ -8,6 +8,7 @@ import type { SkuListPromotionRule } from './sku_list_promotion_rules';
|
|
8
8
|
import type { CouponCodesPromotionRule } from './coupon_codes_promotion_rules';
|
9
9
|
import type { Attachment } from './attachments';
|
10
10
|
import type { Event } from './events';
|
11
|
+
import type { Tag } from './tags';
|
11
12
|
type PromotionType = 'promotions';
|
12
13
|
type PromotionRel = ResourceRel & {
|
13
14
|
type: PromotionType;
|
@@ -28,6 +29,7 @@ interface Promotion extends Resource {
|
|
28
29
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
29
30
|
attachments?: Attachment[] | null;
|
30
31
|
events?: Event[] | null;
|
32
|
+
tags?: Tag[] | null;
|
31
33
|
}
|
32
34
|
declare class Promotions extends ApiResource<Promotion> {
|
33
35
|
static readonly TYPE: PromotionType;
|
@@ -37,6 +39,7 @@ declare class Promotions extends ApiResource<Promotion> {
|
|
37
39
|
coupon_codes_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
38
40
|
attachments(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
39
41
|
events(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
42
|
+
tags(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
40
43
|
isPromotion(resource: any): resource is Promotion;
|
41
44
|
relationship(id: string | ResourceId | null): PromotionRel;
|
42
45
|
type(): PromotionType;
|
@@ -26,6 +26,10 @@ class Promotions extends resource_1.ApiResource {
|
|
26
26
|
const _promotionId = promotionId.id || promotionId;
|
27
27
|
return this.resources.fetch({ type: 'events' }, `promotions/${_promotionId}/events`, params, options);
|
28
28
|
}
|
29
|
+
async tags(promotionId, params, options) {
|
30
|
+
const _promotionId = promotionId.id || promotionId;
|
31
|
+
return this.resources.fetch({ type: 'tags' }, `promotions/${_promotionId}/tags`, params, options);
|
32
|
+
}
|
29
33
|
isPromotion(resource) {
|
30
34
|
return resource.type && (resource.type === Promotions.TYPE);
|
31
35
|
}
|
@@ -20,7 +20,7 @@ interface RecurringOrderCopy extends Resource {
|
|
20
20
|
started_at?: string | null;
|
21
21
|
completed_at?: string | null;
|
22
22
|
failed_at?: string | null;
|
23
|
-
errors_log?:
|
23
|
+
errors_log?: Record<string, any> | null;
|
24
24
|
errors_count?: number | null;
|
25
25
|
place_target_order?: boolean | null;
|
26
26
|
reuse_wallet?: boolean | null;
|
@@ -19,21 +19,21 @@ interface ReturnLineItem extends Resource {
|
|
19
19
|
bundle_code?: string | null;
|
20
20
|
name?: string | null;
|
21
21
|
quantity: number;
|
22
|
-
return_reason?:
|
22
|
+
return_reason?: Record<string, any> | null;
|
23
23
|
restocked_at?: string | null;
|
24
24
|
return?: Return | null;
|
25
25
|
line_item?: LineItem | null;
|
26
26
|
}
|
27
27
|
interface ReturnLineItemCreate extends ResourceCreate {
|
28
28
|
quantity: number;
|
29
|
-
return_reason?:
|
29
|
+
return_reason?: Record<string, any> | null;
|
30
30
|
return: ReturnRel;
|
31
31
|
line_item: LineItemRel;
|
32
32
|
}
|
33
33
|
interface ReturnLineItemUpdate extends ResourceUpdate {
|
34
34
|
quantity?: number | null;
|
35
35
|
_restock?: boolean | null;
|
36
|
-
return_reason?:
|
36
|
+
return_reason?: Record<string, any> | null;
|
37
37
|
}
|
38
38
|
declare class ReturnLineItems extends ApiResource<ReturnLineItem> {
|
39
39
|
static readonly TYPE: ReturnLineItemType;
|
@@ -8,6 +8,7 @@ import type { Address } from './addresses';
|
|
8
8
|
import type { ReturnLineItem } from './return_line_items';
|
9
9
|
import type { Attachment } from './attachments';
|
10
10
|
import type { Event } from './events';
|
11
|
+
import type { Tag, TagType } from './tags';
|
11
12
|
type ReturnType = 'returns';
|
12
13
|
type ReturnRel = ResourceRel & {
|
13
14
|
type: ReturnType;
|
@@ -18,6 +19,9 @@ type OrderRel = ResourceRel & {
|
|
18
19
|
type StockLocationRel = ResourceRel & {
|
19
20
|
type: StockLocationType;
|
20
21
|
};
|
22
|
+
type TagRel = ResourceRel & {
|
23
|
+
type: TagType;
|
24
|
+
};
|
21
25
|
interface Return extends Resource {
|
22
26
|
readonly type: ReturnType;
|
23
27
|
number?: string | null;
|
@@ -38,10 +42,12 @@ interface Return extends Resource {
|
|
38
42
|
return_line_items?: ReturnLineItem[] | null;
|
39
43
|
attachments?: Attachment[] | null;
|
40
44
|
events?: Event[] | null;
|
45
|
+
tags?: Tag[] | null;
|
41
46
|
}
|
42
47
|
interface ReturnCreate extends ResourceCreate {
|
43
48
|
order: OrderRel;
|
44
49
|
stock_location?: StockLocationRel | null;
|
50
|
+
tags?: TagRel[] | null;
|
45
51
|
}
|
46
52
|
interface ReturnUpdate extends ResourceUpdate {
|
47
53
|
_request?: boolean | null;
|
@@ -54,6 +60,7 @@ interface ReturnUpdate extends ResourceUpdate {
|
|
54
60
|
_archive?: boolean | null;
|
55
61
|
_unarchive?: boolean | null;
|
56
62
|
stock_location?: StockLocationRel | null;
|
63
|
+
tags?: TagRel[] | null;
|
57
64
|
}
|
58
65
|
declare class Returns extends ApiResource<Return> {
|
59
66
|
static readonly TYPE: ReturnType;
|
@@ -68,6 +75,7 @@ declare class Returns extends ApiResource<Return> {
|
|
68
75
|
return_line_items(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>>;
|
69
76
|
attachments(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
70
77
|
events(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
78
|
+
tags(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
71
79
|
isReturn(resource: any): resource is Return;
|
72
80
|
relationship(id: string | ResourceId | null): ReturnRel;
|
73
81
|
type(): ReturnType;
|
@@ -43,6 +43,10 @@ class Returns extends resource_1.ApiResource {
|
|
43
43
|
const _returnId = returnId.id || returnId;
|
44
44
|
return this.resources.fetch({ type: 'events' }, `returns/${_returnId}/events`, params, options);
|
45
45
|
}
|
46
|
+
async tags(returnId, params, options) {
|
47
|
+
const _returnId = returnId.id || returnId;
|
48
|
+
return this.resources.fetch({ type: 'tags' }, `returns/${_returnId}/tags`, params, options);
|
49
|
+
}
|
46
50
|
isReturn(resource) {
|
47
51
|
return resource.type && (resource.type === Returns.TYPE);
|
48
52
|
}
|
@@ -13,12 +13,15 @@ type SatispayPaymentRel = ResourceRel & {
|
|
13
13
|
interface SatispayGateway extends Resource {
|
14
14
|
readonly type: SatispayGatewayType;
|
15
15
|
name: string;
|
16
|
+
token: string;
|
17
|
+
key_id: string;
|
16
18
|
webhook_endpoint_url?: string | null;
|
17
19
|
payment_methods?: PaymentMethod[] | null;
|
18
20
|
satispay_payments?: SatispayPayment[] | null;
|
19
21
|
}
|
20
22
|
interface SatispayGatewayCreate extends ResourceCreate {
|
21
23
|
name: string;
|
24
|
+
token: string;
|
22
25
|
satispay_payments?: SatispayPaymentRel[] | null;
|
23
26
|
}
|
24
27
|
interface SatispayGatewayUpdate extends ResourceUpdate {
|
@@ -12,15 +12,12 @@ type OrderRel = ResourceRel & {
|
|
12
12
|
};
|
13
13
|
interface SatispayPayment extends Resource {
|
14
14
|
readonly type: SatispayPaymentType;
|
15
|
-
token?: string | null;
|
16
|
-
key_id: string;
|
17
15
|
payment_id?: string | null;
|
18
16
|
redirect_url?: string | null;
|
19
17
|
order?: Order | null;
|
20
18
|
payment_gateway?: PaymentGateway | null;
|
21
19
|
}
|
22
20
|
interface SatispayPaymentCreate extends ResourceCreate {
|
23
|
-
token?: string | null;
|
24
21
|
redirect_url?: string | null;
|
25
22
|
order: OrderRel;
|
26
23
|
}
|
@@ -30,10 +30,10 @@ interface Shipment extends Resource {
|
|
30
30
|
formatted_cost_amount?: string | null;
|
31
31
|
skus_count?: number | null;
|
32
32
|
selected_rate_id?: string | null;
|
33
|
-
rates?:
|
33
|
+
rates?: Array<Record<string, any>> | null;
|
34
34
|
purchase_error_code?: string | null;
|
35
35
|
purchase_error_message?: string | null;
|
36
|
-
get_rates_errors?:
|
36
|
+
get_rates_errors?: Array<Record<string, any>> | null;
|
37
37
|
get_rates_started_at?: string | null;
|
38
38
|
get_rates_completed_at?: string | null;
|
39
39
|
purchase_started_at?: string | null;
|
@@ -3,6 +3,8 @@ import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesCon
|
|
3
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
4
|
import type { Market, MarketType } from './markets';
|
5
5
|
import type { Attachment } from './attachments';
|
6
|
+
import type { Event } from './events';
|
7
|
+
import type { Tag, TagType } from './tags';
|
6
8
|
type SkuOptionType = 'sku_options';
|
7
9
|
type SkuOptionRel = ResourceRel & {
|
8
10
|
type: SkuOptionType;
|
@@ -10,6 +12,9 @@ type SkuOptionRel = ResourceRel & {
|
|
10
12
|
type MarketRel = ResourceRel & {
|
11
13
|
type: MarketType;
|
12
14
|
};
|
15
|
+
type TagRel = ResourceRel & {
|
16
|
+
type: TagType;
|
17
|
+
};
|
13
18
|
interface SkuOption extends Resource {
|
14
19
|
readonly type: SkuOptionType;
|
15
20
|
name: string;
|
@@ -23,6 +28,8 @@ interface SkuOption extends Resource {
|
|
23
28
|
sku_code_regex?: string | null;
|
24
29
|
market?: Market | null;
|
25
30
|
attachments?: Attachment[] | null;
|
31
|
+
events?: Event[] | null;
|
32
|
+
tags?: Tag[] | null;
|
26
33
|
}
|
27
34
|
interface SkuOptionCreate extends ResourceCreate {
|
28
35
|
name: string;
|
@@ -32,6 +39,7 @@ interface SkuOptionCreate extends ResourceCreate {
|
|
32
39
|
delay_hours?: number | null;
|
33
40
|
sku_code_regex?: string | null;
|
34
41
|
market?: MarketRel | null;
|
42
|
+
tags?: TagRel[] | null;
|
35
43
|
}
|
36
44
|
interface SkuOptionUpdate extends ResourceUpdate {
|
37
45
|
name?: string | null;
|
@@ -41,6 +49,7 @@ interface SkuOptionUpdate extends ResourceUpdate {
|
|
41
49
|
delay_hours?: number | null;
|
42
50
|
sku_code_regex?: string | null;
|
43
51
|
market?: MarketRel | null;
|
52
|
+
tags?: TagRel[] | null;
|
44
53
|
}
|
45
54
|
declare class SkuOptions extends ApiResource<SkuOption> {
|
46
55
|
static readonly TYPE: SkuOptionType;
|
@@ -49,6 +58,8 @@ declare class SkuOptions extends ApiResource<SkuOption> {
|
|
49
58
|
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
50
59
|
market(skuOptionId: string | SkuOption, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
51
60
|
attachments(skuOptionId: string | SkuOption, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
61
|
+
events(skuOptionId: string | SkuOption, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
62
|
+
tags(skuOptionId: string | SkuOption, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
52
63
|
isSkuOption(resource: any): resource is SkuOption;
|
53
64
|
relationship(id: string | ResourceId | null): SkuOptionRel;
|
54
65
|
type(): SkuOptionType;
|
@@ -19,6 +19,14 @@ class SkuOptions extends resource_1.ApiResource {
|
|
19
19
|
const _skuOptionId = skuOptionId.id || skuOptionId;
|
20
20
|
return this.resources.fetch({ type: 'attachments' }, `sku_options/${_skuOptionId}/attachments`, params, options);
|
21
21
|
}
|
22
|
+
async events(skuOptionId, params, options) {
|
23
|
+
const _skuOptionId = skuOptionId.id || skuOptionId;
|
24
|
+
return this.resources.fetch({ type: 'events' }, `sku_options/${_skuOptionId}/events`, params, options);
|
25
|
+
}
|
26
|
+
async tags(skuOptionId, params, options) {
|
27
|
+
const _skuOptionId = skuOptionId.id || skuOptionId;
|
28
|
+
return this.resources.fetch({ type: 'tags' }, `sku_options/${_skuOptionId}/tags`, params, options);
|
29
|
+
}
|
22
30
|
isSkuOption(resource) {
|
23
31
|
return resource.type && (resource.type === SkuOptions.TYPE);
|
24
32
|
}
|
@@ -7,6 +7,8 @@ import type { StockItem } from './stock_items';
|
|
7
7
|
import type { DeliveryLeadTime } from './delivery_lead_times';
|
8
8
|
import type { SkuOption } from './sku_options';
|
9
9
|
import type { Attachment } from './attachments';
|
10
|
+
import type { Event } from './events';
|
11
|
+
import type { Tag, TagType } from './tags';
|
10
12
|
type SkuType = 'skus';
|
11
13
|
type SkuRel = ResourceRel & {
|
12
14
|
type: SkuType;
|
@@ -14,6 +16,9 @@ type SkuRel = ResourceRel & {
|
|
14
16
|
type ShippingCategoryRel = ResourceRel & {
|
15
17
|
type: ShippingCategoryType;
|
16
18
|
};
|
19
|
+
type TagRel = ResourceRel & {
|
20
|
+
type: TagType;
|
21
|
+
};
|
17
22
|
interface Sku extends Resource {
|
18
23
|
readonly type: SkuType;
|
19
24
|
code: string;
|
@@ -26,13 +31,15 @@ interface Sku extends Resource {
|
|
26
31
|
hs_tariff_number?: string | null;
|
27
32
|
do_not_ship?: boolean | null;
|
28
33
|
do_not_track?: boolean | null;
|
29
|
-
inventory?:
|
34
|
+
inventory?: Record<string, any> | null;
|
30
35
|
shipping_category?: ShippingCategory | null;
|
31
36
|
prices?: Price[] | null;
|
32
37
|
stock_items?: StockItem[] | null;
|
33
38
|
delivery_lead_times?: DeliveryLeadTime[] | null;
|
34
39
|
sku_options?: SkuOption[] | null;
|
35
40
|
attachments?: Attachment[] | null;
|
41
|
+
events?: Event[] | null;
|
42
|
+
tags?: Tag[] | null;
|
36
43
|
}
|
37
44
|
interface SkuCreate extends ResourceCreate {
|
38
45
|
code: string;
|
@@ -46,6 +53,7 @@ interface SkuCreate extends ResourceCreate {
|
|
46
53
|
do_not_ship?: boolean | null;
|
47
54
|
do_not_track?: boolean | null;
|
48
55
|
shipping_category: ShippingCategoryRel;
|
56
|
+
tags?: TagRel[] | null;
|
49
57
|
}
|
50
58
|
interface SkuUpdate extends ResourceUpdate {
|
51
59
|
code?: string | null;
|
@@ -59,6 +67,7 @@ interface SkuUpdate extends ResourceUpdate {
|
|
59
67
|
do_not_ship?: boolean | null;
|
60
68
|
do_not_track?: boolean | null;
|
61
69
|
shipping_category?: ShippingCategoryRel | null;
|
70
|
+
tags?: TagRel[] | null;
|
62
71
|
}
|
63
72
|
declare class Skus extends ApiResource<Sku> {
|
64
73
|
static readonly TYPE: SkuType;
|
@@ -71,6 +80,8 @@ declare class Skus extends ApiResource<Sku> {
|
|
71
80
|
delivery_lead_times(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<DeliveryLeadTime>>;
|
72
81
|
sku_options(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuOption>>;
|
73
82
|
attachments(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
83
|
+
events(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
84
|
+
tags(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
74
85
|
isSku(resource: any): resource is Sku;
|
75
86
|
relationship(id: string | ResourceId | null): SkuRel;
|
76
87
|
type(): SkuType;
|
@@ -35,6 +35,14 @@ class Skus extends resource_1.ApiResource {
|
|
35
35
|
const _skuId = skuId.id || skuId;
|
36
36
|
return this.resources.fetch({ type: 'attachments' }, `skus/${_skuId}/attachments`, params, options);
|
37
37
|
}
|
38
|
+
async events(skuId, params, options) {
|
39
|
+
const _skuId = skuId.id || skuId;
|
40
|
+
return this.resources.fetch({ type: 'events' }, `skus/${_skuId}/events`, params, options);
|
41
|
+
}
|
42
|
+
async tags(skuId, params, options) {
|
43
|
+
const _skuId = skuId.id || skuId;
|
44
|
+
return this.resources.fetch({ type: 'tags' }, `skus/${_skuId}/tags`, params, options);
|
45
|
+
}
|
38
46
|
isSku(resource) {
|
39
47
|
return resource.type && (resource.type === Skus.TYPE);
|
40
48
|
}
|
@@ -14,22 +14,22 @@ interface StripePayment extends Resource {
|
|
14
14
|
readonly type: StripePaymentType;
|
15
15
|
client_secret: string;
|
16
16
|
publishable_key?: string | null;
|
17
|
-
options?:
|
18
|
-
payment_method?:
|
17
|
+
options?: Record<string, any> | null;
|
18
|
+
payment_method?: Record<string, any> | null;
|
19
19
|
mismatched_amounts?: boolean | null;
|
20
20
|
intent_amount_cents: number;
|
21
21
|
intent_amount_float?: number | null;
|
22
22
|
formatted_intent_amount?: string | null;
|
23
|
-
payment_instrument?:
|
23
|
+
payment_instrument?: Record<string, any> | null;
|
24
24
|
order?: Order | null;
|
25
25
|
payment_gateway?: PaymentGateway | null;
|
26
26
|
}
|
27
27
|
interface StripePaymentCreate extends ResourceCreate {
|
28
|
-
options?:
|
28
|
+
options?: Record<string, any> | null;
|
29
29
|
order: OrderRel;
|
30
30
|
}
|
31
31
|
interface StripePaymentUpdate extends ResourceUpdate {
|
32
|
-
options?:
|
32
|
+
options?: Record<string, any> | null;
|
33
33
|
_refresh?: boolean | null;
|
34
34
|
order?: OrderRel | null;
|
35
35
|
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
|
3
|
+
import type { QueryParamsRetrieve } from '../query';
|
4
|
+
type TagType = 'tags';
|
5
|
+
type TagRel = ResourceRel & {
|
6
|
+
type: TagType;
|
7
|
+
};
|
8
|
+
interface Tag extends Resource {
|
9
|
+
readonly type: TagType;
|
10
|
+
name: string;
|
11
|
+
}
|
12
|
+
interface TagCreate extends ResourceCreate {
|
13
|
+
name: string;
|
14
|
+
}
|
15
|
+
interface TagUpdate extends ResourceUpdate {
|
16
|
+
name?: string | null;
|
17
|
+
}
|
18
|
+
declare class Tags extends ApiResource<Tag> {
|
19
|
+
static readonly TYPE: TagType;
|
20
|
+
create(resource: TagCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Tag>;
|
21
|
+
update(resource: TagUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Tag>;
|
22
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
23
|
+
isTag(resource: any): resource is Tag;
|
24
|
+
relationship(id: string | ResourceId | null): TagRel;
|
25
|
+
type(): TagType;
|
26
|
+
}
|
27
|
+
export default Tags;
|
28
|
+
export type { Tag, TagCreate, TagUpdate, TagType };
|
@@ -0,0 +1,25 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class Tags extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: Tags.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: Tags.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: Tags.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
isTag(resource) {
|
15
|
+
return resource.type && (resource.type === Tags.TYPE);
|
16
|
+
}
|
17
|
+
relationship(id) {
|
18
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Tags.TYPE } : { id: id.id, type: Tags.TYPE };
|
19
|
+
}
|
20
|
+
type() {
|
21
|
+
return Tags.TYPE;
|
22
|
+
}
|
23
|
+
}
|
24
|
+
Tags.TYPE = 'tags';
|
25
|
+
exports.default = Tags;
|
@@ -23,7 +23,7 @@ interface TaxRule extends Resource {
|
|
23
23
|
payment_method_taxable?: boolean | null;
|
24
24
|
gift_card_taxable?: boolean | null;
|
25
25
|
adjustment_taxable?: boolean | null;
|
26
|
-
breakdown?:
|
26
|
+
breakdown?: Record<string, any> | null;
|
27
27
|
manual_tax_calculator?: ManualTaxCalculator | null;
|
28
28
|
}
|
29
29
|
interface TaxRuleCreate extends ResourceCreate {
|
@@ -11,7 +11,7 @@ type OrderRel = ResourceRel & {
|
|
11
11
|
};
|
12
12
|
interface WireTransfer extends Resource {
|
13
13
|
readonly type: WireTransferType;
|
14
|
-
payment_instrument?:
|
14
|
+
payment_instrument?: Record<string, any> | null;
|
15
15
|
order?: Order | null;
|
16
16
|
}
|
17
17
|
interface WireTransferCreate extends ResourceCreate {
|