@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
package/lib/esm/client.js
CHANGED
@@ -26,8 +26,11 @@ const handleError = (error) => {
|
|
26
26
|
const apiError = new ApiError(sdkError);
|
27
27
|
apiError.type = ErrorType.RESPONSE;
|
28
28
|
apiError.status = error.response.status;
|
29
|
+
apiError.statusText = error.response.statusText;
|
29
30
|
apiError.code = String(apiError.status);
|
30
31
|
apiError.errors = error.response.data.errors;
|
32
|
+
if (!apiError.message && apiError.statusText)
|
33
|
+
apiError.message = apiError.statusText;
|
31
34
|
sdkError = apiError;
|
32
35
|
}
|
33
36
|
else if (error.request) {
|
@@ -66,13 +69,16 @@ class ApiClient {
|
|
66
69
|
httpAgent: options.httpAgent,
|
67
70
|
httpsAgent: options.httpsAgent,
|
68
71
|
};
|
72
|
+
// Set custom headers
|
73
|
+
const customHeaders = this.customHeaders(options.headers);
|
69
74
|
const axiosOptions = {
|
70
75
|
baseURL: this.baseUrl,
|
71
76
|
timeout: config.client.timeout,
|
72
77
|
headers: {
|
78
|
+
...customHeaders,
|
73
79
|
'Accept': 'application/vnd.api+json',
|
74
80
|
'Content-Type': 'application/vnd.api+json',
|
75
|
-
'Authorization': 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f")
|
81
|
+
'Authorization': 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f")
|
76
82
|
},
|
77
83
|
...axiosConfig
|
78
84
|
};
|
@@ -99,6 +105,8 @@ class ApiClient {
|
|
99
105
|
__classPrivateFieldSet(this, _ApiClient_accessToken, config.accessToken, "f");
|
100
106
|
def.headers.common.Authorization = 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f");
|
101
107
|
}
|
108
|
+
if (config.headers)
|
109
|
+
def.headers.common = this.customHeaders(config.headers);
|
102
110
|
}
|
103
111
|
async request(method, path, body, options) {
|
104
112
|
debug('request %s %s, %O, %O', method, path, body || {}, options || {});
|
@@ -107,8 +115,10 @@ class ApiClient {
|
|
107
115
|
// Runtime request parameters
|
108
116
|
const baseUrl = (options === null || options === void 0 ? void 0 : options.organization) ? baseURL(options.organization, options.domain) : undefined;
|
109
117
|
const accessToken = (options === null || options === void 0 ? void 0 : options.accessToken) || __classPrivateFieldGet(this, _ApiClient_accessToken, "f");
|
110
|
-
const headers =
|
111
|
-
|
118
|
+
const headers = this.customHeaders(options === null || options === void 0 ? void 0 : options.headers);
|
119
|
+
if (accessToken)
|
120
|
+
headers.Authorization = 'Bearer ' + accessToken;
|
121
|
+
const requestParams = { method, baseURL: baseUrl, url, data, ...options, headers };
|
112
122
|
debug('request params: %O', requestParams);
|
113
123
|
// const start = Date.now()
|
114
124
|
return __classPrivateFieldGet(this, _ApiClient_client, "f").request(requestParams)
|
@@ -116,6 +126,15 @@ class ApiClient {
|
|
116
126
|
.catch(error => handleError(error));
|
117
127
|
// .finally(() => console.log(`<<-- ${method} ${path} ${Date.now() - start}`))
|
118
128
|
}
|
129
|
+
customHeaders(headers) {
|
130
|
+
const customHeaders = {};
|
131
|
+
if (headers) {
|
132
|
+
for (const [name, value] of Object.entries(headers))
|
133
|
+
if (!['accept', 'content-type', 'authorization'].includes(name.toLowerCase()))
|
134
|
+
customHeaders[name] = value;
|
135
|
+
}
|
136
|
+
return customHeaders;
|
137
|
+
}
|
119
138
|
}
|
120
139
|
_ApiClient_accessToken = new WeakMap(), _ApiClient_client = new WeakMap();
|
121
140
|
export default ApiClient;
|
@@ -2,7 +2,7 @@ import * as api from './api';
|
|
2
2
|
import type { ApiError } from './error';
|
3
3
|
import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
|
4
4
|
import { type ResourcesInitConfig } from './resource';
|
5
|
-
declare const OPEN_API_SCHEMA_VERSION = "4.
|
5
|
+
declare const OPEN_API_SCHEMA_VERSION = "4.8.0";
|
6
6
|
export { OPEN_API_SCHEMA_VERSION };
|
7
7
|
type SdkConfig = Record<string, unknown>;
|
8
8
|
type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
@@ -10,7 +10,7 @@ type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
|
10
10
|
declare class CommerceLayerClient {
|
11
11
|
#private;
|
12
12
|
static get openApiSchemaVersion(): string;
|
13
|
-
readonly openApiSchemaVersion = "4.
|
13
|
+
readonly openApiSchemaVersion = "4.8.0";
|
14
14
|
addresses: api.Addresses;
|
15
15
|
adjustments: api.Adjustments;
|
16
16
|
adyen_gateways: api.AdyenGateways;
|
@@ -112,6 +112,7 @@ declare class CommerceLayerClient {
|
|
112
112
|
stock_items: api.StockItems;
|
113
113
|
stock_line_items: api.StockLineItems;
|
114
114
|
stock_locations: api.StockLocations;
|
115
|
+
stock_reservations: api.StockReservations;
|
115
116
|
stock_transfers: api.StockTransfers;
|
116
117
|
stripe_gateways: api.StripeGateways;
|
117
118
|
stripe_payments: api.StripePayments;
|
package/lib/esm/commercelayer.js
CHANGED
@@ -16,7 +16,7 @@ import ResourceAdapter from './resource';
|
|
16
16
|
import Debug from './debug';
|
17
17
|
const debug = Debug('commercelayer');
|
18
18
|
// Autogenerated schema version number, do not remove this line
|
19
|
-
const OPEN_API_SCHEMA_VERSION = '4.
|
19
|
+
const OPEN_API_SCHEMA_VERSION = '4.8.0';
|
20
20
|
export { OPEN_API_SCHEMA_VERSION };
|
21
21
|
class CommerceLayerClient {
|
22
22
|
static get openApiSchemaVersion() { return OPEN_API_SCHEMA_VERSION; }
|
@@ -131,6 +131,7 @@ class CommerceLayerClient {
|
|
131
131
|
this.stock_items = new api.StockItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
132
132
|
this.stock_line_items = new api.StockLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
133
133
|
this.stock_locations = new api.StockLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
134
|
+
this.stock_reservations = new api.StockReservations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
134
135
|
this.stock_transfers = new api.StockTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
135
136
|
this.stripe_gateways = new api.StripeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
136
137
|
this.stripe_payments = new api.StripePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
package/lib/esm/error.d.ts
CHANGED
package/lib/esm/interceptor.d.ts
CHANGED
@@ -7,7 +7,7 @@ type RequestObj = AxiosRequestConfig;
|
|
7
7
|
type RequestInterceptor = (request: RequestObj) => RequestObj | Promise<RequestObj>;
|
8
8
|
type ResponseObj = AxiosResponse;
|
9
9
|
type ResponseInterceptor = (response: ResponseObj) => ResponseObj;
|
10
|
-
type ApiHeadersList = 'x-ratelimit-limit' | 'x-ratelimit-count' | 'x-ratelimit-period';
|
10
|
+
type ApiHeadersList = 'x-ratelimit-limit' | 'x-ratelimit-count' | 'x-ratelimit-period' | 'x-ratelimit-interval' | 'x-ratelimit-remaining';
|
11
11
|
type ApiHeaders = {
|
12
12
|
[key in ApiHeadersList]: string | number | boolean;
|
13
13
|
};
|
package/lib/esm/jsonapi.js
CHANGED
@@ -57,7 +57,10 @@ const normalize = (resource) => {
|
|
57
57
|
if (['type', 'id'].includes(field))
|
58
58
|
continue;
|
59
59
|
const value = resource[field];
|
60
|
-
if (value && isResourceType(value) && value.id === null) {
|
60
|
+
if (Array.isArray(value) && (value.length === 1) && isResourceType(value[0]) && (value[0].id === null)) {
|
61
|
+
relationships[field] = { data: [] };
|
62
|
+
}
|
63
|
+
else if (value && isResourceType(value) && (value.id === null)) {
|
61
64
|
relationships[field] = { data: null };
|
62
65
|
}
|
63
66
|
else if (value && (isResourceId(value) || (Array.isArray(value) && isResourceId(value[0])))) {
|
package/lib/esm/model.d.ts
CHANGED
@@ -102,6 +102,7 @@ export type { Sku, SkuCreate, SkuUpdate } from './resources/skus';
|
|
102
102
|
export type { StockItem, StockItemCreate, StockItemUpdate } from './resources/stock_items';
|
103
103
|
export type { StockLineItem } from './resources/stock_line_items';
|
104
104
|
export type { StockLocation, StockLocationCreate, StockLocationUpdate } from './resources/stock_locations';
|
105
|
+
export type { StockReservation } from './resources/stock_reservations';
|
105
106
|
export type { StockTransfer, StockTransferCreate, StockTransferUpdate } from './resources/stock_transfers';
|
106
107
|
export type { StripeGateway, StripeGatewayCreate, StripeGatewayUpdate } from './resources/stripe_gateways';
|
107
108
|
export type { StripePayment, StripePaymentCreate, StripePaymentUpdate } from './resources/stripe_payments';
|
@@ -2,6 +2,7 @@ import { ApiResource } from '../resource';
|
|
2
2
|
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
4
|
import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
|
5
|
+
import type { CouponRecipient, CouponRecipientType } from './coupon_recipients';
|
5
6
|
import type { Event } from './events';
|
6
7
|
import type { Tag, TagType } from './tags';
|
7
8
|
type CouponType = 'coupons';
|
@@ -11,6 +12,9 @@ type CouponRel = ResourceRel & {
|
|
11
12
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
12
13
|
type: CouponCodesPromotionRuleType;
|
13
14
|
};
|
15
|
+
type CouponRecipientRel = ResourceRel & {
|
16
|
+
type: CouponRecipientType;
|
17
|
+
};
|
14
18
|
type TagRel = ResourceRel & {
|
15
19
|
type: TagType;
|
16
20
|
};
|
@@ -22,6 +26,7 @@ interface Coupon extends Resource {
|
|
22
26
|
usage_count?: number | null;
|
23
27
|
recipient_email?: string | null;
|
24
28
|
promotion_rule?: CouponCodesPromotionRule | null;
|
29
|
+
coupon_recipient?: CouponRecipient | null;
|
25
30
|
events?: Event[] | null;
|
26
31
|
tags?: Tag[] | null;
|
27
32
|
}
|
@@ -31,6 +36,7 @@ interface CouponCreate extends ResourceCreate {
|
|
31
36
|
usage_limit?: number | null;
|
32
37
|
recipient_email?: string | null;
|
33
38
|
promotion_rule: CouponCodesPromotionRuleRel;
|
39
|
+
coupon_recipient?: CouponRecipientRel | null;
|
34
40
|
tags?: TagRel[] | null;
|
35
41
|
}
|
36
42
|
interface CouponUpdate extends ResourceUpdate {
|
@@ -39,6 +45,7 @@ interface CouponUpdate extends ResourceUpdate {
|
|
39
45
|
usage_limit?: number | null;
|
40
46
|
recipient_email?: string | null;
|
41
47
|
promotion_rule?: CouponCodesPromotionRuleRel | null;
|
48
|
+
coupon_recipient?: CouponRecipientRel | null;
|
42
49
|
tags?: TagRel[] | null;
|
43
50
|
}
|
44
51
|
declare class Coupons extends ApiResource<Coupon> {
|
@@ -47,6 +54,7 @@ declare class Coupons extends ApiResource<Coupon> {
|
|
47
54
|
update(resource: CouponUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Coupon>;
|
48
55
|
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
49
56
|
promotion_rule(couponId: string | Coupon, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
57
|
+
coupon_recipient(couponId: string | Coupon, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponRecipient>;
|
50
58
|
events(couponId: string | Coupon, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
51
59
|
tags(couponId: string | Coupon, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
52
60
|
isCoupon(resource: any): resource is Coupon;
|
@@ -13,6 +13,10 @@ class Coupons extends ApiResource {
|
|
13
13
|
const _couponId = couponId.id || couponId;
|
14
14
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `coupons/${_couponId}/promotion_rule`, params, options);
|
15
15
|
}
|
16
|
+
async coupon_recipient(couponId, params, options) {
|
17
|
+
const _couponId = couponId.id || couponId;
|
18
|
+
return this.resources.fetch({ type: 'coupon_recipients' }, `coupons/${_couponId}/coupon_recipient`, params, options);
|
19
|
+
}
|
16
20
|
async events(couponId, params, options) {
|
17
21
|
const _couponId = couponId.id || couponId;
|
18
22
|
return this.resources.fetch({ type: 'events' }, `coupons/${_couponId}/events`, params, options);
|
@@ -27,6 +27,7 @@ interface Customer extends Resource {
|
|
27
27
|
email: string;
|
28
28
|
status: 'prospect' | 'acquired' | 'repeat';
|
29
29
|
has_password?: boolean | null;
|
30
|
+
total_orders_count?: number | null;
|
30
31
|
customer_group?: CustomerGroup | null;
|
31
32
|
customer_addresses?: CustomerAddress[] | null;
|
32
33
|
customer_payment_sources?: CustomerPaymentSource[] | 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 { 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';
|
@@ -47,6 +48,7 @@ interface ExternalPromotion extends Resource {
|
|
47
48
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
48
49
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
49
50
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
51
|
+
sku_list?: SkuList | null;
|
50
52
|
attachments?: Attachment[] | null;
|
51
53
|
events?: Event[] | null;
|
52
54
|
tags?: Tag[] | null;
|
@@ -88,6 +90,7 @@ declare class ExternalPromotions extends ApiResource<ExternalPromotion> {
|
|
88
90
|
order_amount_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
89
91
|
sku_list_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
90
92
|
coupon_codes_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
93
|
+
sku_list(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
91
94
|
attachments(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
92
95
|
events(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
93
96
|
tags(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
@@ -25,6 +25,10 @@ class ExternalPromotions extends ApiResource {
|
|
25
25
|
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
26
26
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `external_promotions/${_externalPromotionId}/coupon_codes_promotion_rule`, params, options);
|
27
27
|
}
|
28
|
+
async sku_list(externalPromotionId, params, options) {
|
29
|
+
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
30
|
+
return this.resources.fetch({ type: 'sku_lists' }, `external_promotions/${_externalPromotionId}/sku_list`, params, options);
|
31
|
+
}
|
28
32
|
async attachments(externalPromotionId, params, options) {
|
29
33
|
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
30
34
|
return this.resources.fetch({ type: 'attachments' }, `external_promotions/${_externalPromotionId}/attachments`, params, options);
|
@@ -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';
|
@@ -48,6 +49,7 @@ interface FixedAmountPromotion extends Resource {
|
|
48
49
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
49
50
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
50
51
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
52
|
+
sku_list?: SkuList | null;
|
51
53
|
attachments?: Attachment[] | null;
|
52
54
|
events?: Event[] | null;
|
53
55
|
tags?: Tag[] | null;
|
@@ -89,6 +91,7 @@ declare class FixedAmountPromotions extends ApiResource<FixedAmountPromotion> {
|
|
89
91
|
order_amount_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
90
92
|
sku_list_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
91
93
|
coupon_codes_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
94
|
+
sku_list(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
92
95
|
attachments(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
93
96
|
events(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
94
97
|
tags(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
@@ -25,6 +25,10 @@ class FixedAmountPromotions extends ApiResource {
|
|
25
25
|
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
26
26
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupon_codes_promotion_rule`, params, options);
|
27
27
|
}
|
28
|
+
async sku_list(fixedAmountPromotionId, params, options) {
|
29
|
+
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
30
|
+
return this.resources.fetch({ type: 'sku_lists' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/sku_list`, params, options);
|
31
|
+
}
|
28
32
|
async attachments(fixedAmountPromotionId, params, options) {
|
29
33
|
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
30
34
|
return this.resources.fetch({ type: 'attachments' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/attachments`, params, options);
|
@@ -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 FixedPricePromotionType = 'fixed_price_promotions';
|
15
15
|
type FixedPricePromotionRel = 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 FixedPricePromotion extends Resource {
|
40
40
|
readonly type: FixedPricePromotionType;
|
41
41
|
name: string;
|
@@ -53,10 +53,10 @@ interface FixedPricePromotion extends Resource {
|
|
53
53
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
54
54
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
55
55
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
56
|
+
sku_list?: SkuList | null;
|
56
57
|
attachments?: Attachment[] | null;
|
57
58
|
events?: Event[] | null;
|
58
59
|
tags?: Tag[] | null;
|
59
|
-
sku_list?: SkuList | null;
|
60
60
|
skus?: Sku[] | null;
|
61
61
|
}
|
62
62
|
interface FixedPricePromotionCreate extends ResourceCreate {
|
@@ -71,8 +71,8 @@ interface FixedPricePromotionCreate extends ResourceCreate {
|
|
71
71
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
72
72
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
73
73
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
74
|
-
tags?: TagRel[] | null;
|
75
74
|
sku_list: SkuListRel;
|
75
|
+
tags?: TagRel[] | null;
|
76
76
|
}
|
77
77
|
interface FixedPricePromotionUpdate extends ResourceUpdate {
|
78
78
|
name?: string | null;
|
@@ -86,8 +86,8 @@ interface FixedPricePromotionUpdate extends ResourceUpdate {
|
|
86
86
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
87
87
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
88
88
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
89
|
-
tags?: TagRel[] | null;
|
90
89
|
sku_list?: SkuListRel | null;
|
90
|
+
tags?: TagRel[] | null;
|
91
91
|
}
|
92
92
|
declare class FixedPricePromotions extends ApiResource<FixedPricePromotion> {
|
93
93
|
static readonly TYPE: FixedPricePromotionType;
|
@@ -98,10 +98,10 @@ declare class FixedPricePromotions extends ApiResource<FixedPricePromotion> {
|
|
98
98
|
order_amount_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
99
99
|
sku_list_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
100
100
|
coupon_codes_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
101
|
+
sku_list(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
101
102
|
attachments(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
102
103
|
events(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
103
104
|
tags(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
104
|
-
sku_list(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
105
105
|
skus(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
106
106
|
isFixedPricePromotion(resource: any): resource is FixedPricePromotion;
|
107
107
|
relationship(id: string | ResourceId | null): FixedPricePromotionRel;
|
@@ -25,6 +25,10 @@ class FixedPricePromotions extends ApiResource {
|
|
25
25
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
26
26
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupon_codes_promotion_rule`, params, options);
|
27
27
|
}
|
28
|
+
async sku_list(fixedPricePromotionId, params, options) {
|
29
|
+
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
30
|
+
return this.resources.fetch({ type: 'sku_lists' }, `fixed_price_promotions/${_fixedPricePromotionId}/sku_list`, params, options);
|
31
|
+
}
|
28
32
|
async attachments(fixedPricePromotionId, params, options) {
|
29
33
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
30
34
|
return this.resources.fetch({ type: 'attachments' }, `fixed_price_promotions/${_fixedPricePromotionId}/attachments`, params, options);
|
@@ -37,10 +41,6 @@ class FixedPricePromotions extends ApiResource {
|
|
37
41
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
38
42
|
return this.resources.fetch({ type: 'tags' }, `fixed_price_promotions/${_fixedPricePromotionId}/tags`, params, options);
|
39
43
|
}
|
40
|
-
async sku_list(fixedPricePromotionId, params, options) {
|
41
|
-
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
42
|
-
return this.resources.fetch({ type: 'sku_lists' }, `fixed_price_promotions/${_fixedPricePromotionId}/sku_list`, params, options);
|
43
|
-
}
|
44
44
|
async skus(fixedPricePromotionId, params, options) {
|
45
45
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
46
46
|
return this.resources.fetch({ type: 'skus' }, `fixed_price_promotions/${_fixedPricePromotionId}/skus`, params, options);
|
@@ -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 FreeGiftPromotionType = 'free_gift_promotions';
|
15
15
|
type FreeGiftPromotionRel = 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 FreeGiftPromotion extends Resource {
|
40
40
|
readonly type: FreeGiftPromotionType;
|
41
41
|
name: string;
|
@@ -51,10 +51,10 @@ interface FreeGiftPromotion 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 FreeGiftPromotionCreate extends ResourceCreate {
|
@@ -69,8 +69,8 @@ interface FreeGiftPromotionCreate 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;
|
73
|
+
tags?: TagRel[] | null;
|
74
74
|
}
|
75
75
|
interface FreeGiftPromotionUpdate extends ResourceUpdate {
|
76
76
|
name?: string | null;
|
@@ -84,8 +84,8 @@ interface FreeGiftPromotionUpdate 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 FreeGiftPromotions extends ApiResource<FreeGiftPromotion> {
|
91
91
|
static readonly TYPE: FreeGiftPromotionType;
|
@@ -96,10 +96,10 @@ declare class FreeGiftPromotions extends ApiResource<FreeGiftPromotion> {
|
|
96
96
|
order_amount_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
97
97
|
sku_list_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
98
98
|
coupon_codes_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
99
|
+
sku_list(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
99
100
|
attachments(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
100
101
|
events(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
101
102
|
tags(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
102
|
-
sku_list(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
103
103
|
skus(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
104
104
|
isFreeGiftPromotion(resource: any): resource is FreeGiftPromotion;
|
105
105
|
relationship(id: string | ResourceId | null): FreeGiftPromotionRel;
|
@@ -25,6 +25,10 @@ class FreeGiftPromotions extends ApiResource {
|
|
25
25
|
const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
|
26
26
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/coupon_codes_promotion_rule`, params, options);
|
27
27
|
}
|
28
|
+
async sku_list(freeGiftPromotionId, params, options) {
|
29
|
+
const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
|
30
|
+
return this.resources.fetch({ type: 'sku_lists' }, `free_gift_promotions/${_freeGiftPromotionId}/sku_list`, params, options);
|
31
|
+
}
|
28
32
|
async attachments(freeGiftPromotionId, params, options) {
|
29
33
|
const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
|
30
34
|
return this.resources.fetch({ type: 'attachments' }, `free_gift_promotions/${_freeGiftPromotionId}/attachments`, params, options);
|
@@ -37,10 +41,6 @@ class FreeGiftPromotions extends ApiResource {
|
|
37
41
|
const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
|
38
42
|
return this.resources.fetch({ type: 'tags' }, `free_gift_promotions/${_freeGiftPromotionId}/tags`, params, options);
|
39
43
|
}
|
40
|
-
async sku_list(freeGiftPromotionId, params, options) {
|
41
|
-
const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
|
42
|
-
return this.resources.fetch({ type: 'sku_lists' }, `free_gift_promotions/${_freeGiftPromotionId}/sku_list`, params, options);
|
43
|
-
}
|
44
44
|
async skus(freeGiftPromotionId, params, options) {
|
45
45
|
const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
|
46
46
|
return this.resources.fetch({ type: 'skus' }, `free_gift_promotions/${_freeGiftPromotionId}/skus`, params, options);
|
@@ -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>>;
|
@@ -25,6 +25,10 @@ class FreeShippingPromotions extends ApiResource {
|
|
25
25
|
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
26
26
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupon_codes_promotion_rule`, params, options);
|
27
27
|
}
|
28
|
+
async sku_list(freeShippingPromotionId, params, options) {
|
29
|
+
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
30
|
+
return this.resources.fetch({ type: 'sku_lists' }, `free_shipping_promotions/${_freeShippingPromotionId}/sku_list`, params, options);
|
31
|
+
}
|
28
32
|
async attachments(freeShippingPromotionId, params, options) {
|
29
33
|
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
30
34
|
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>>;
|
@@ -17,6 +17,10 @@ class LineItems extends ApiResource {
|
|
17
17
|
const _lineItemId = lineItemId.id || lineItemId;
|
18
18
|
return this.resources.fetch({ type: 'line_item_options' }, `line_items/${_lineItemId}/line_item_options`, params, options);
|
19
19
|
}
|
20
|
+
async stock_reservations(lineItemId, params, options) {
|
21
|
+
const _lineItemId = lineItemId.id || lineItemId;
|
22
|
+
return this.resources.fetch({ type: 'stock_reservations' }, `line_items/${_lineItemId}/stock_reservations`, params, options);
|
23
|
+
}
|
20
24
|
async stock_line_items(lineItemId, params, options) {
|
21
25
|
const _lineItemId = lineItemId.id || lineItemId;
|
22
26
|
return this.resources.fetch({ type: 'stock_line_items' }, `line_items/${_lineItemId}/stock_line_items`, params, options);
|