@commercelayer/sdk 4.29.0 → 4.31.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 +4 -1
- package/lib/cjs/client.d.ts +5 -1
- package/lib/cjs/client.js +22 -3
- package/lib/cjs/commercelayer.d.ts +3 -2
- package/lib/cjs/commercelayer.js +2 -1
- package/lib/cjs/error.d.ts +1 -0
- package/lib/cjs/error.js +1 -2
- package/lib/cjs/interceptor.d.ts +1 -1
- package/lib/cjs/jsonapi.js +4 -1
- package/lib/cjs/model.d.ts +1 -0
- package/lib/cjs/resources/coupons.d.ts +8 -0
- package/lib/cjs/resources/coupons.js +4 -0
- package/lib/cjs/resources/customers.d.ts +1 -0
- package/lib/cjs/resources/external_promotions.d.ts +3 -0
- package/lib/cjs/resources/external_promotions.js +4 -0
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +3 -0
- package/lib/cjs/resources/fixed_amount_promotions.js +4 -0
- package/lib/cjs/resources/fixed_price_promotions.d.ts +8 -8
- package/lib/cjs/resources/fixed_price_promotions.js +4 -4
- package/lib/cjs/resources/free_gift_promotions.d.ts +8 -8
- package/lib/cjs/resources/free_gift_promotions.js +4 -4
- package/lib/cjs/resources/free_shipping_promotions.d.ts +3 -0
- package/lib/cjs/resources/free_shipping_promotions.js +4 -0
- package/lib/cjs/resources/imports.d.ts +0 -3
- package/lib/cjs/resources/inventory_models.d.ts +3 -0
- package/lib/cjs/resources/line_items.d.ts +5 -0
- package/lib/cjs/resources/line_items.js +4 -0
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +3 -0
- package/lib/cjs/resources/orders.d.ts +1 -0
- package/lib/cjs/resources/parcels.d.ts +3 -3
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +8 -8
- package/lib/cjs/resources/percentage_discount_promotions.js +4 -4
- package/lib/cjs/resources/promotions.d.ts +3 -0
- package/lib/cjs/resources/promotions.js +4 -0
- package/lib/cjs/resources/satispay_payments.d.ts +4 -0
- package/lib/cjs/resources/shipping_methods.d.ts +6 -0
- package/lib/cjs/resources/skus.d.ts +3 -0
- package/lib/cjs/resources/skus.js +4 -0
- package/lib/cjs/resources/stock_items.d.ts +3 -0
- package/lib/cjs/resources/stock_items.js +4 -0
- package/lib/cjs/resources/stock_reservations.d.ts +33 -0
- package/lib/cjs/resources/stock_reservations.js +32 -0
- package/lib/cjs/resources/stripe_payments.d.ts +1 -0
- package/lib/cjs/util.d.ts +1 -0
- package/lib/esm/api.d.ts +3 -2
- package/lib/esm/api.js +2 -0
- package/lib/esm/client.d.ts +5 -1
- package/lib/esm/client.js +22 -3
- package/lib/esm/commercelayer.d.ts +3 -2
- package/lib/esm/commercelayer.js +2 -1
- package/lib/esm/error.d.ts +1 -0
- package/lib/esm/interceptor.d.ts +1 -1
- package/lib/esm/jsonapi.js +4 -1
- package/lib/esm/model.d.ts +1 -0
- package/lib/esm/resources/coupons.d.ts +8 -0
- package/lib/esm/resources/coupons.js +4 -0
- package/lib/esm/resources/customers.d.ts +1 -0
- package/lib/esm/resources/external_promotions.d.ts +3 -0
- package/lib/esm/resources/external_promotions.js +4 -0
- package/lib/esm/resources/fixed_amount_promotions.d.ts +3 -0
- package/lib/esm/resources/fixed_amount_promotions.js +4 -0
- package/lib/esm/resources/fixed_price_promotions.d.ts +8 -8
- package/lib/esm/resources/fixed_price_promotions.js +4 -4
- package/lib/esm/resources/free_gift_promotions.d.ts +8 -8
- package/lib/esm/resources/free_gift_promotions.js +4 -4
- package/lib/esm/resources/free_shipping_promotions.d.ts +3 -0
- package/lib/esm/resources/free_shipping_promotions.js +4 -0
- package/lib/esm/resources/imports.d.ts +0 -3
- package/lib/esm/resources/inventory_models.d.ts +3 -0
- package/lib/esm/resources/line_items.d.ts +5 -0
- package/lib/esm/resources/line_items.js +4 -0
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +3 -0
- package/lib/esm/resources/orders.d.ts +1 -0
- package/lib/esm/resources/parcels.d.ts +3 -3
- package/lib/esm/resources/percentage_discount_promotions.d.ts +8 -8
- package/lib/esm/resources/percentage_discount_promotions.js +4 -4
- package/lib/esm/resources/promotions.d.ts +3 -0
- package/lib/esm/resources/promotions.js +4 -0
- package/lib/esm/resources/satispay_payments.d.ts +4 -0
- package/lib/esm/resources/shipping_methods.d.ts +6 -0
- package/lib/esm/resources/skus.d.ts +3 -0
- package/lib/esm/resources/skus.js +4 -0
- package/lib/esm/resources/stock_items.d.ts +3 -0
- package/lib/esm/resources/stock_items.js +4 -0
- package/lib/esm/resources/stock_reservations.d.ts +33 -0
- package/lib/esm/resources/stock_reservations.js +30 -0
- package/lib/esm/resources/stripe_payments.d.ts +1 -0
- package/lib/esm/util.d.ts +1 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
@@ -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 { SkuList } from './sku_lists';
|
9
10
|
import type { Attachment } from './attachments';
|
10
11
|
import type { Event } from './events';
|
11
12
|
import type { Tag, TagType } from './tags';
|
@@ -45,6 +46,7 @@ interface FreeShippingPromotion extends Resource {
|
|
45
46
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
46
47
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
47
48
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
49
|
+
sku_list?: SkuList | null;
|
48
50
|
attachments?: Attachment[] | null;
|
49
51
|
events?: Event[] | null;
|
50
52
|
tags?: Tag[] | null;
|
@@ -84,6 +86,7 @@ declare class FreeShippingPromotions extends ApiResource<FreeShippingPromotion>
|
|
84
86
|
order_amount_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
85
87
|
sku_list_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
86
88
|
coupon_codes_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
89
|
+
sku_list(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
87
90
|
attachments(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
88
91
|
events(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
89
92
|
tags(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
@@ -27,6 +27,10 @@ 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 sku_list(freeShippingPromotionId, params, options) {
|
31
|
+
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
32
|
+
return this.resources.fetch({ type: 'sku_lists' }, `free_shipping_promotions/${_freeShippingPromotionId}/sku_list`, params, options);
|
33
|
+
}
|
30
34
|
async attachments(freeShippingPromotionId, params, options) {
|
31
35
|
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
32
36
|
return this.resources.fetch({ type: 'attachments' }, `free_shipping_promotions/${_freeShippingPromotionId}/attachments`, params, options);
|
@@ -18,11 +18,9 @@ interface Import extends Resource {
|
|
18
18
|
inputs_size?: number | null;
|
19
19
|
errors_count?: number | null;
|
20
20
|
warnings_count?: number | null;
|
21
|
-
destroyed_count?: number | null;
|
22
21
|
processed_count?: number | null;
|
23
22
|
errors_log?: Record<string, any> | null;
|
24
23
|
warnings_log?: Record<string, any> | null;
|
25
|
-
cleanup_records?: boolean | null;
|
26
24
|
attachment_url?: string | null;
|
27
25
|
events?: Event[] | null;
|
28
26
|
}
|
@@ -31,7 +29,6 @@ interface ImportCreate extends ResourceCreate {
|
|
31
29
|
format?: string | null;
|
32
30
|
parent_resource_id?: string | null;
|
33
31
|
inputs: Array<Record<string, any>>;
|
34
|
-
cleanup_records?: boolean | null;
|
35
32
|
}
|
36
33
|
declare class Imports extends ApiResource<Import> {
|
37
34
|
static readonly TYPE: ImportType;
|
@@ -13,6 +13,7 @@ interface InventoryModel extends Resource {
|
|
13
13
|
name: string;
|
14
14
|
strategy?: string | null;
|
15
15
|
stock_locations_cutoff?: number | null;
|
16
|
+
stock_reservation_cutoff?: number | null;
|
16
17
|
inventory_stock_locations?: InventoryStockLocation[] | null;
|
17
18
|
inventory_return_locations?: InventoryReturnLocation[] | null;
|
18
19
|
attachments?: Attachment[] | null;
|
@@ -21,11 +22,13 @@ interface InventoryModelCreate extends ResourceCreate {
|
|
21
22
|
name: string;
|
22
23
|
strategy?: string | null;
|
23
24
|
stock_locations_cutoff?: number | null;
|
25
|
+
stock_reservation_cutoff?: number | null;
|
24
26
|
}
|
25
27
|
interface InventoryModelUpdate extends ResourceUpdate {
|
26
28
|
name?: string | null;
|
27
29
|
strategy?: string | null;
|
28
30
|
stock_locations_cutoff?: number | null;
|
31
|
+
stock_reservation_cutoff?: number | null;
|
29
32
|
}
|
30
33
|
declare class InventoryModels extends ApiResource<InventoryModel> {
|
31
34
|
static readonly TYPE: InventoryModelType;
|
@@ -13,6 +13,7 @@ import type { PercentageDiscountPromotion, PercentageDiscountPromotionType } fro
|
|
13
13
|
import type { Shipment, ShipmentType } from './shipments';
|
14
14
|
import type { Sku, SkuType } from './skus';
|
15
15
|
import type { LineItemOption } from './line_item_options';
|
16
|
+
import type { StockReservation } from './stock_reservations';
|
16
17
|
import type { StockLineItem } from './stock_line_items';
|
17
18
|
import type { StockTransfer } from './stock_transfers';
|
18
19
|
import type { Event } from './events';
|
@@ -92,6 +93,7 @@ interface LineItem extends Resource {
|
|
92
93
|
* @deprecated This field should not be used as it may be removed in the future without notice
|
93
94
|
*/
|
94
95
|
shipment_line_items?: object[];
|
96
|
+
stock_reservations?: StockReservation[] | null;
|
95
97
|
stock_line_items?: StockLineItem[] | null;
|
96
98
|
stock_transfers?: StockTransfer[] | null;
|
97
99
|
events?: Event[] | null;
|
@@ -103,6 +105,7 @@ interface LineItemCreate extends ResourceCreate {
|
|
103
105
|
quantity: number;
|
104
106
|
_external_price?: boolean | null;
|
105
107
|
_update_quantity?: boolean | null;
|
108
|
+
_reserve_stock?: boolean | null;
|
106
109
|
unit_amount_cents?: number | null;
|
107
110
|
name?: string | null;
|
108
111
|
image_url?: string | null;
|
@@ -117,6 +120,7 @@ interface LineItemUpdate extends ResourceUpdate {
|
|
117
120
|
bundle_code?: string | null;
|
118
121
|
quantity?: number | null;
|
119
122
|
_external_price?: boolean | null;
|
123
|
+
_reserve_stock?: boolean | null;
|
120
124
|
name?: string | null;
|
121
125
|
image_url?: string | null;
|
122
126
|
frequency?: string | null;
|
@@ -129,6 +133,7 @@ declare class LineItems extends ApiResource<LineItem> {
|
|
129
133
|
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
130
134
|
order(lineItemId: string | LineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
131
135
|
line_item_options(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<LineItemOption>>;
|
136
|
+
stock_reservations(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
|
132
137
|
stock_line_items(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>>;
|
133
138
|
stock_transfers(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
|
134
139
|
events(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
@@ -19,6 +19,10 @@ class LineItems extends resource_1.ApiResource {
|
|
19
19
|
const _lineItemId = lineItemId.id || lineItemId;
|
20
20
|
return this.resources.fetch({ type: 'line_item_options' }, `line_items/${_lineItemId}/line_item_options`, params, options);
|
21
21
|
}
|
22
|
+
async stock_reservations(lineItemId, params, options) {
|
23
|
+
const _lineItemId = lineItemId.id || lineItemId;
|
24
|
+
return this.resources.fetch({ type: 'stock_reservations' }, `line_items/${_lineItemId}/stock_reservations`, params, options);
|
25
|
+
}
|
22
26
|
async stock_line_items(lineItemId, params, options) {
|
23
27
|
const _lineItemId = lineItemId.id || lineItemId;
|
24
28
|
return this.resources.fetch({ type: 'stock_line_items' }, `line_items/${_lineItemId}/stock_line_items`, params, options);
|
@@ -34,14 +34,17 @@ interface OrderAmountPromotionRule extends Resource {
|
|
34
34
|
order_amount_cents?: number | null;
|
35
35
|
order_amount_float?: number | null;
|
36
36
|
formatted_order_amount?: string | null;
|
37
|
+
use_subtotal?: boolean | null;
|
37
38
|
promotion?: PercentageDiscountPromotion | FreeShippingPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | null;
|
38
39
|
}
|
39
40
|
interface OrderAmountPromotionRuleCreate extends ResourceCreate {
|
40
41
|
order_amount_cents?: number | null;
|
42
|
+
use_subtotal?: boolean | null;
|
41
43
|
promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
|
42
44
|
}
|
43
45
|
interface OrderAmountPromotionRuleUpdate extends ResourceUpdate {
|
44
46
|
order_amount_cents?: number | null;
|
47
|
+
use_subtotal?: boolean | null;
|
45
48
|
promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel | null;
|
46
49
|
}
|
47
50
|
declare class OrderAmountPromotionRules extends ApiResource<OrderAmountPromotionRule> {
|
@@ -166,6 +166,7 @@ interface Order extends Resource {
|
|
166
166
|
line_item_options_count?: number | null;
|
167
167
|
shipments_count?: number | null;
|
168
168
|
tax_calculations_count?: number | null;
|
169
|
+
validations_count?: number | null;
|
169
170
|
payment_source_details?: Record<string, any> | null;
|
170
171
|
token?: string | null;
|
171
172
|
cart_url?: string | null;
|
@@ -38,7 +38,7 @@ interface Parcel extends Resource {
|
|
38
38
|
tracking_status?: string | null;
|
39
39
|
tracking_status_detail?: string | null;
|
40
40
|
tracking_status_updated_at?: string | null;
|
41
|
-
tracking_details?: string | null;
|
41
|
+
tracking_details?: Record<string, any> | null;
|
42
42
|
carrier_weight_oz?: string | null;
|
43
43
|
signed_by?: string | null;
|
44
44
|
incoterm?: string | null;
|
@@ -69,7 +69,7 @@ interface ParcelCreate extends ResourceCreate {
|
|
69
69
|
tracking_status?: string | null;
|
70
70
|
tracking_status_detail?: string | null;
|
71
71
|
tracking_status_updated_at?: string | null;
|
72
|
-
tracking_details?: string | null;
|
72
|
+
tracking_details?: Record<string, any> | null;
|
73
73
|
carrier_weight_oz?: string | null;
|
74
74
|
signed_by?: string | null;
|
75
75
|
incoterm?: string | null;
|
@@ -97,7 +97,7 @@ interface ParcelUpdate extends ResourceUpdate {
|
|
97
97
|
tracking_status?: string | null;
|
98
98
|
tracking_status_detail?: string | null;
|
99
99
|
tracking_status_updated_at?: string | null;
|
100
|
-
tracking_details?: string | null;
|
100
|
+
tracking_details?: Record<string, any> | null;
|
101
101
|
carrier_weight_oz?: string | null;
|
102
102
|
signed_by?: string | null;
|
103
103
|
incoterm?: string | null;
|
@@ -6,10 +6,10 @@ 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 { SkuList, SkuListType } from './sku_lists';
|
9
10
|
import type { Attachment } from './attachments';
|
10
11
|
import type { Event } from './events';
|
11
12
|
import type { Tag, TagType } from './tags';
|
12
|
-
import type { SkuList, SkuListType } from './sku_lists';
|
13
13
|
import type { Sku } from './skus';
|
14
14
|
type PercentageDiscountPromotionType = 'percentage_discount_promotions';
|
15
15
|
type PercentageDiscountPromotionRel = ResourceRel & {
|
@@ -30,12 +30,12 @@ type SkuListPromotionRuleRel = ResourceRel & {
|
|
30
30
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
31
31
|
type: CouponCodesPromotionRuleType;
|
32
32
|
};
|
33
|
-
type TagRel = ResourceRel & {
|
34
|
-
type: TagType;
|
35
|
-
};
|
36
33
|
type SkuListRel = ResourceRel & {
|
37
34
|
type: SkuListType;
|
38
35
|
};
|
36
|
+
type TagRel = ResourceRel & {
|
37
|
+
type: TagType;
|
38
|
+
};
|
39
39
|
interface PercentageDiscountPromotion extends Resource {
|
40
40
|
readonly type: PercentageDiscountPromotionType;
|
41
41
|
name: string;
|
@@ -51,10 +51,10 @@ interface PercentageDiscountPromotion extends Resource {
|
|
51
51
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
52
52
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
53
53
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
54
|
+
sku_list?: SkuList | null;
|
54
55
|
attachments?: Attachment[] | null;
|
55
56
|
events?: Event[] | null;
|
56
57
|
tags?: Tag[] | null;
|
57
|
-
sku_list?: SkuList | null;
|
58
58
|
skus?: Sku[] | null;
|
59
59
|
}
|
60
60
|
interface PercentageDiscountPromotionCreate extends ResourceCreate {
|
@@ -69,8 +69,8 @@ interface PercentageDiscountPromotionCreate extends ResourceCreate {
|
|
69
69
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
70
70
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
71
71
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
72
|
-
tags?: TagRel[] | null;
|
73
72
|
sku_list?: SkuListRel | null;
|
73
|
+
tags?: TagRel[] | null;
|
74
74
|
}
|
75
75
|
interface PercentageDiscountPromotionUpdate extends ResourceUpdate {
|
76
76
|
name?: string | null;
|
@@ -84,8 +84,8 @@ interface PercentageDiscountPromotionUpdate extends ResourceUpdate {
|
|
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
|
-
tags?: TagRel[] | null;
|
88
87
|
sku_list?: SkuListRel | null;
|
88
|
+
tags?: TagRel[] | null;
|
89
89
|
}
|
90
90
|
declare class PercentageDiscountPromotions extends ApiResource<PercentageDiscountPromotion> {
|
91
91
|
static readonly TYPE: PercentageDiscountPromotionType;
|
@@ -96,10 +96,10 @@ declare class PercentageDiscountPromotions extends ApiResource<PercentageDiscoun
|
|
96
96
|
order_amount_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
97
97
|
sku_list_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
98
98
|
coupon_codes_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
99
|
+
sku_list(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
99
100
|
attachments(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
100
101
|
events(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
101
102
|
tags(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
102
|
-
sku_list(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
103
103
|
skus(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
104
104
|
isPercentageDiscountPromotion(resource: any): resource is PercentageDiscountPromotion;
|
105
105
|
relationship(id: string | ResourceId | null): PercentageDiscountPromotionRel;
|
@@ -27,6 +27,10 @@ class PercentageDiscountPromotions extends resource_1.ApiResource {
|
|
27
27
|
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
28
28
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/coupon_codes_promotion_rule`, params, options);
|
29
29
|
}
|
30
|
+
async sku_list(percentageDiscountPromotionId, params, options) {
|
31
|
+
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
32
|
+
return this.resources.fetch({ type: 'sku_lists' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/sku_list`, params, options);
|
33
|
+
}
|
30
34
|
async attachments(percentageDiscountPromotionId, params, options) {
|
31
35
|
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
32
36
|
return this.resources.fetch({ type: 'attachments' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/attachments`, params, options);
|
@@ -39,10 +43,6 @@ class PercentageDiscountPromotions extends resource_1.ApiResource {
|
|
39
43
|
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
40
44
|
return this.resources.fetch({ type: 'tags' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/tags`, params, options);
|
41
45
|
}
|
42
|
-
async sku_list(percentageDiscountPromotionId, params, options) {
|
43
|
-
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
44
|
-
return this.resources.fetch({ type: 'sku_lists' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/sku_list`, params, options);
|
45
|
-
}
|
46
46
|
async skus(percentageDiscountPromotionId, params, options) {
|
47
47
|
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
48
48
|
return this.resources.fetch({ type: 'skus' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/skus`, params, options);
|
@@ -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 { SkuList } from './sku_lists';
|
9
10
|
import type { Attachment } from './attachments';
|
10
11
|
import type { Event } from './events';
|
11
12
|
import type { Tag } from './tags';
|
@@ -27,6 +28,7 @@ interface Promotion extends Resource {
|
|
27
28
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
28
29
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
29
30
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
31
|
+
sku_list?: SkuList | null;
|
30
32
|
attachments?: Attachment[] | null;
|
31
33
|
events?: Event[] | null;
|
32
34
|
tags?: Tag[] | null;
|
@@ -37,6 +39,7 @@ declare class Promotions extends ApiResource<Promotion> {
|
|
37
39
|
order_amount_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
38
40
|
sku_list_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
39
41
|
coupon_codes_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
42
|
+
sku_list(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
40
43
|
attachments(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
41
44
|
events(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
42
45
|
tags(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
@@ -18,6 +18,10 @@ class Promotions extends resource_1.ApiResource {
|
|
18
18
|
const _promotionId = promotionId.id || promotionId;
|
19
19
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `promotions/${_promotionId}/coupon_codes_promotion_rule`, params, options);
|
20
20
|
}
|
21
|
+
async sku_list(promotionId, params, options) {
|
22
|
+
const _promotionId = promotionId.id || promotionId;
|
23
|
+
return this.resources.fetch({ type: 'sku_lists' }, `promotions/${_promotionId}/sku_list`, params, options);
|
24
|
+
}
|
21
25
|
async attachments(promotionId, params, options) {
|
22
26
|
const _promotionId = promotionId.id || promotionId;
|
23
27
|
return this.resources.fetch({ type: 'attachments' }, `promotions/${_promotionId}/attachments`, params, options);
|
@@ -13,11 +13,15 @@ type OrderRel = ResourceRel & {
|
|
13
13
|
interface SatispayPayment extends Resource {
|
14
14
|
readonly type: SatispayPaymentType;
|
15
15
|
payment_id?: string | null;
|
16
|
+
flow?: string | null;
|
16
17
|
redirect_url?: string | null;
|
18
|
+
payment_url?: string | null;
|
19
|
+
payment_response?: Record<string, any> | null;
|
17
20
|
order?: Order | null;
|
18
21
|
payment_gateway?: PaymentGateway | null;
|
19
22
|
}
|
20
23
|
interface SatispayPaymentCreate extends ResourceCreate {
|
24
|
+
flow?: string | null;
|
21
25
|
redirect_url?: string | null;
|
22
26
|
order: OrderRel;
|
23
27
|
}
|
@@ -33,6 +33,7 @@ interface ShippingMethod extends Resource {
|
|
33
33
|
name: string;
|
34
34
|
scheme?: string | null;
|
35
35
|
currency_code?: string | null;
|
36
|
+
external_prices_url?: string | null;
|
36
37
|
disabled_at?: string | null;
|
37
38
|
price_amount_cents: number;
|
38
39
|
price_amount_float?: number | null;
|
@@ -40,6 +41,7 @@ interface ShippingMethod extends Resource {
|
|
40
41
|
free_over_amount_cents?: number | null;
|
41
42
|
free_over_amount_float?: number | null;
|
42
43
|
formatted_free_over_amount?: string | null;
|
44
|
+
use_subtotal?: boolean | null;
|
43
45
|
price_amount_for_shipment_cents?: number | null;
|
44
46
|
price_amount_for_shipment_float?: number | null;
|
45
47
|
formatted_price_amount_for_shipment?: string | null;
|
@@ -59,8 +61,10 @@ interface ShippingMethodCreate extends ResourceCreate {
|
|
59
61
|
name: string;
|
60
62
|
scheme?: string | null;
|
61
63
|
currency_code?: string | null;
|
64
|
+
external_prices_url?: string | null;
|
62
65
|
price_amount_cents: number;
|
63
66
|
free_over_amount_cents?: number | null;
|
67
|
+
use_subtotal?: boolean | null;
|
64
68
|
min_weight?: number | null;
|
65
69
|
max_weight?: number | null;
|
66
70
|
unit_of_weight?: string | null;
|
@@ -74,10 +78,12 @@ interface ShippingMethodUpdate extends ResourceUpdate {
|
|
74
78
|
name?: string | null;
|
75
79
|
scheme?: string | null;
|
76
80
|
currency_code?: string | null;
|
81
|
+
external_prices_url?: string | null;
|
77
82
|
_disable?: boolean | null;
|
78
83
|
_enable?: boolean | null;
|
79
84
|
price_amount_cents?: number | null;
|
80
85
|
free_over_amount_cents?: number | null;
|
86
|
+
use_subtotal?: boolean | null;
|
81
87
|
min_weight?: number | null;
|
82
88
|
max_weight?: number | null;
|
83
89
|
unit_of_weight?: string | null;
|
@@ -4,6 +4,7 @@ import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
|
4
4
|
import type { ShippingCategory, ShippingCategoryType } from './shipping_categories';
|
5
5
|
import type { Price } from './prices';
|
6
6
|
import type { StockItem } from './stock_items';
|
7
|
+
import type { StockReservation } from './stock_reservations';
|
7
8
|
import type { DeliveryLeadTime } from './delivery_lead_times';
|
8
9
|
import type { SkuOption } from './sku_options';
|
9
10
|
import type { Attachment } from './attachments';
|
@@ -35,6 +36,7 @@ interface Sku extends Resource {
|
|
35
36
|
shipping_category?: ShippingCategory | null;
|
36
37
|
prices?: Price[] | null;
|
37
38
|
stock_items?: StockItem[] | null;
|
39
|
+
stock_reservations?: StockReservation[] | null;
|
38
40
|
delivery_lead_times?: DeliveryLeadTime[] | null;
|
39
41
|
sku_options?: SkuOption[] | null;
|
40
42
|
attachments?: Attachment[] | null;
|
@@ -77,6 +79,7 @@ declare class Skus extends ApiResource<Sku> {
|
|
77
79
|
shipping_category(skuId: string | Sku, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingCategory>;
|
78
80
|
prices(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Price>>;
|
79
81
|
stock_items(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockItem>>;
|
82
|
+
stock_reservations(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
|
80
83
|
delivery_lead_times(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<DeliveryLeadTime>>;
|
81
84
|
sku_options(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuOption>>;
|
82
85
|
attachments(skuId: string | Sku, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
@@ -23,6 +23,10 @@ class Skus extends resource_1.ApiResource {
|
|
23
23
|
const _skuId = skuId.id || skuId;
|
24
24
|
return this.resources.fetch({ type: 'stock_items' }, `skus/${_skuId}/stock_items`, params, options);
|
25
25
|
}
|
26
|
+
async stock_reservations(skuId, params, options) {
|
27
|
+
const _skuId = skuId.id || skuId;
|
28
|
+
return this.resources.fetch({ type: 'stock_reservations' }, `skus/${_skuId}/stock_reservations`, params, options);
|
29
|
+
}
|
26
30
|
async delivery_lead_times(skuId, params, options) {
|
27
31
|
const _skuId = skuId.id || skuId;
|
28
32
|
return this.resources.fetch({ type: 'delivery_lead_times' }, `skus/${_skuId}/delivery_lead_times`, params, options);
|
@@ -3,6 +3,7 @@ import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesCon
|
|
3
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
4
|
import type { StockLocation, StockLocationType } from './stock_locations';
|
5
5
|
import type { Sku, SkuType } from './skus';
|
6
|
+
import type { StockReservation } from './stock_reservations';
|
6
7
|
import type { Attachment } from './attachments';
|
7
8
|
type StockItemType = 'stock_items';
|
8
9
|
type StockItemRel = ResourceRel & {
|
@@ -20,6 +21,7 @@ interface StockItem extends Resource {
|
|
20
21
|
quantity: number;
|
21
22
|
stock_location?: StockLocation | null;
|
22
23
|
sku?: Sku | null;
|
24
|
+
stock_reservations?: StockReservation[] | null;
|
23
25
|
attachments?: Attachment[] | null;
|
24
26
|
}
|
25
27
|
interface StockItemCreate extends ResourceCreate {
|
@@ -41,6 +43,7 @@ declare class StockItems extends ApiResource<StockItem> {
|
|
41
43
|
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
42
44
|
stock_location(stockItemId: string | StockItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
43
45
|
sku(stockItemId: string | StockItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
46
|
+
stock_reservations(stockItemId: string | StockItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
|
44
47
|
attachments(stockItemId: string | StockItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
45
48
|
isStockItem(resource: any): resource is StockItem;
|
46
49
|
relationship(id: string | ResourceId | null): StockItemRel;
|
@@ -19,6 +19,10 @@ class StockItems extends resource_1.ApiResource {
|
|
19
19
|
const _stockItemId = stockItemId.id || stockItemId;
|
20
20
|
return this.resources.fetch({ type: 'skus' }, `stock_items/${_stockItemId}/sku`, params, options);
|
21
21
|
}
|
22
|
+
async stock_reservations(stockItemId, params, options) {
|
23
|
+
const _stockItemId = stockItemId.id || stockItemId;
|
24
|
+
return this.resources.fetch({ type: 'stock_reservations' }, `stock_items/${_stockItemId}/stock_reservations`, params, options);
|
25
|
+
}
|
22
26
|
async attachments(stockItemId, params, options) {
|
23
27
|
const _stockItemId = stockItemId.id || stockItemId;
|
24
28
|
return this.resources.fetch({ type: 'attachments' }, `stock_items/${_stockItemId}/attachments`, params, options);
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
|
3
|
+
import type { QueryParamsRetrieve } from '../query';
|
4
|
+
import type { LineItem } from './line_items';
|
5
|
+
import type { Order } from './orders';
|
6
|
+
import type { StockItem } from './stock_items';
|
7
|
+
import type { Sku } from './skus';
|
8
|
+
type StockReservationType = 'stock_reservations';
|
9
|
+
type StockReservationRel = ResourceRel & {
|
10
|
+
type: StockReservationType;
|
11
|
+
};
|
12
|
+
interface StockReservation extends Resource {
|
13
|
+
readonly type: StockReservationType;
|
14
|
+
status: 'draft' | 'pending';
|
15
|
+
quantity: number;
|
16
|
+
expires_at: string;
|
17
|
+
line_item?: LineItem | null;
|
18
|
+
order?: Order | null;
|
19
|
+
stock_item?: StockItem | null;
|
20
|
+
sku?: Sku | null;
|
21
|
+
}
|
22
|
+
declare class StockReservations extends ApiResource<StockReservation> {
|
23
|
+
static readonly TYPE: StockReservationType;
|
24
|
+
line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
25
|
+
order(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
26
|
+
stock_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
27
|
+
sku(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
28
|
+
isStockReservation(resource: any): resource is StockReservation;
|
29
|
+
relationship(id: string | ResourceId | null): StockReservationRel;
|
30
|
+
type(): StockReservationType;
|
31
|
+
}
|
32
|
+
export default StockReservations;
|
33
|
+
export type { StockReservation, StockReservationType };
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class StockReservations extends resource_1.ApiResource {
|
5
|
+
async line_item(stockReservationId, params, options) {
|
6
|
+
const _stockReservationId = stockReservationId.id || stockReservationId;
|
7
|
+
return this.resources.fetch({ type: 'line_items' }, `stock_reservations/${_stockReservationId}/line_item`, params, options);
|
8
|
+
}
|
9
|
+
async order(stockReservationId, params, options) {
|
10
|
+
const _stockReservationId = stockReservationId.id || stockReservationId;
|
11
|
+
return this.resources.fetch({ type: 'orders' }, `stock_reservations/${_stockReservationId}/order`, params, options);
|
12
|
+
}
|
13
|
+
async stock_item(stockReservationId, params, options) {
|
14
|
+
const _stockReservationId = stockReservationId.id || stockReservationId;
|
15
|
+
return this.resources.fetch({ type: 'stock_items' }, `stock_reservations/${_stockReservationId}/stock_item`, params, options);
|
16
|
+
}
|
17
|
+
async sku(stockReservationId, params, options) {
|
18
|
+
const _stockReservationId = stockReservationId.id || stockReservationId;
|
19
|
+
return this.resources.fetch({ type: 'skus' }, `stock_reservations/${_stockReservationId}/sku`, params, options);
|
20
|
+
}
|
21
|
+
isStockReservation(resource) {
|
22
|
+
return resource.type && (resource.type === StockReservations.TYPE);
|
23
|
+
}
|
24
|
+
relationship(id) {
|
25
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: StockReservations.TYPE } : { id: id.id, type: StockReservations.TYPE };
|
26
|
+
}
|
27
|
+
type() {
|
28
|
+
return StockReservations.TYPE;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
StockReservations.TYPE = 'stock_reservations';
|
32
|
+
exports.default = StockReservations;
|
package/lib/cjs/util.d.ts
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
/// <reference types="node" />
|
3
3
|
/// <reference types="node" />
|
4
4
|
/// <reference types="node" />
|
5
|
+
/// <reference types="node" />
|
5
6
|
import type { ObjectType } from "./common";
|
6
7
|
declare const sleep: (ms: number) => Promise<NodeJS.Timeout>;
|
7
8
|
declare const sortObjectFields: (obj: ObjectType) => ObjectType;
|
package/lib/esm/api.d.ts
CHANGED
@@ -102,6 +102,7 @@ export { default as Skus } from './resources/skus';
|
|
102
102
|
export { default as StockItems } from './resources/stock_items';
|
103
103
|
export { default as StockLineItems } from './resources/stock_line_items';
|
104
104
|
export { default as StockLocations } from './resources/stock_locations';
|
105
|
+
export { default as StockReservations } from './resources/stock_reservations';
|
105
106
|
export { default as StockTransfers } from './resources/stock_transfers';
|
106
107
|
export { default as StripeGateways } from './resources/stripe_gateways';
|
107
108
|
export { default as StripePayments } from './resources/stripe_payments';
|
@@ -115,8 +116,8 @@ export { default as Transactions } from './resources/transactions';
|
|
115
116
|
export { default as Voids } from './resources/voids';
|
116
117
|
export { default as Webhooks } from './resources/webhooks';
|
117
118
|
export { default as WireTransfers } from './resources/wire_transfers';
|
118
|
-
export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
|
119
|
-
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
|
119
|
+
export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
|
120
|
+
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
|
120
121
|
export type RetrievableResourceType = ResourceTypeLock;
|
121
122
|
export type RetrievableResource = {
|
122
123
|
type: RetrievableResourceType;
|
package/lib/esm/api.js
CHANGED
@@ -104,6 +104,7 @@ export { default as Skus } from './resources/skus';
|
|
104
104
|
export { default as StockItems } from './resources/stock_items';
|
105
105
|
export { default as StockLineItems } from './resources/stock_line_items';
|
106
106
|
export { default as StockLocations } from './resources/stock_locations';
|
107
|
+
export { default as StockReservations } from './resources/stock_reservations';
|
107
108
|
export { default as StockTransfers } from './resources/stock_transfers';
|
108
109
|
export { default as StripeGateways } from './resources/stripe_gateways';
|
109
110
|
export { default as StripePayments } from './resources/stripe_payments';
|
@@ -221,6 +222,7 @@ export const resourceList = [
|
|
221
222
|
'stock_items',
|
222
223
|
'stock_line_items',
|
223
224
|
'stock_locations',
|
225
|
+
'stock_reservations',
|
224
226
|
'stock_transfers',
|
225
227
|
'stripe_gateways',
|
226
228
|
'stripe_payments',
|
package/lib/esm/client.d.ts
CHANGED
@@ -5,12 +5,15 @@ import type { InterceptorManager } from './interceptor';
|
|
5
5
|
import type { Agent as HttpAgent } from 'http';
|
6
6
|
import type { Agent as HttpsAgent } from 'https';
|
7
7
|
type ProxyConfig = AxiosProxyConfig | false;
|
8
|
+
type RequestParams = Record<string, string | number | boolean>;
|
9
|
+
type RequestHeaders = Record<string, string>;
|
8
10
|
type RequestConfig = {
|
9
11
|
timeout?: number;
|
10
|
-
params?:
|
12
|
+
params?: RequestParams;
|
11
13
|
httpAgent?: HttpAgent;
|
12
14
|
httpsAgent?: HttpsAgent;
|
13
15
|
proxy?: ProxyConfig;
|
16
|
+
headers?: RequestHeaders;
|
14
17
|
};
|
15
18
|
type ApiClientInitConfig = {
|
16
19
|
organization: string;
|
@@ -26,6 +29,7 @@ declare class ApiClient {
|
|
26
29
|
private constructor();
|
27
30
|
config(config: ApiClientConfig): void;
|
28
31
|
request(method: Method, path: string, body?: any, options?: ApiClientConfig): Promise<any>;
|
32
|
+
private customHeaders;
|
29
33
|
}
|
30
34
|
export default ApiClient;
|
31
35
|
export type { ApiClientInitConfig, ApiClientConfig, RequestConfig };
|