@commercelayer/sdk 5.13.1 → 5.14.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/commercelayer.d.ts +2 -2
- package/lib/cjs/commercelayer.js +1 -1
- package/lib/cjs/resources/external_promotions.d.ts +8 -0
- package/lib/cjs/resources/external_promotions.js +4 -0
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +8 -0
- package/lib/cjs/resources/fixed_amount_promotions.js +4 -0
- package/lib/cjs/resources/fixed_price_promotions.d.ts +8 -0
- package/lib/cjs/resources/fixed_price_promotions.js +4 -0
- package/lib/cjs/resources/free_gift_promotions.d.ts +8 -0
- package/lib/cjs/resources/free_gift_promotions.js +4 -0
- package/lib/cjs/resources/free_shipping_promotions.d.ts +8 -0
- package/lib/cjs/resources/free_shipping_promotions.js +4 -0
- package/lib/cjs/resources/imports.d.ts +3 -0
- package/lib/cjs/resources/line_items.d.ts +4 -0
- package/lib/cjs/resources/order_subscription_items.d.ts +4 -0
- package/lib/cjs/resources/orders.d.ts +2 -0
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +8 -0
- package/lib/cjs/resources/percentage_discount_promotions.js +4 -0
- package/lib/cjs/resources/promotions.d.ts +3 -0
- package/lib/cjs/resources/promotions.js +4 -0
- package/lib/esm/commercelayer.d.ts +2 -2
- package/lib/esm/commercelayer.js +1 -1
- package/lib/esm/resources/external_promotions.d.ts +8 -0
- package/lib/esm/resources/external_promotions.js +4 -0
- package/lib/esm/resources/fixed_amount_promotions.d.ts +8 -0
- package/lib/esm/resources/fixed_amount_promotions.js +4 -0
- package/lib/esm/resources/fixed_price_promotions.d.ts +8 -0
- package/lib/esm/resources/fixed_price_promotions.js +4 -0
- package/lib/esm/resources/free_gift_promotions.d.ts +8 -0
- package/lib/esm/resources/free_gift_promotions.js +4 -0
- package/lib/esm/resources/free_shipping_promotions.d.ts +8 -0
- package/lib/esm/resources/free_shipping_promotions.js +4 -0
- package/lib/esm/resources/imports.d.ts +3 -0
- package/lib/esm/resources/line_items.d.ts +4 -0
- package/lib/esm/resources/order_subscription_items.d.ts +4 -0
- package/lib/esm/resources/orders.d.ts +2 -0
- package/lib/esm/resources/percentage_discount_promotions.d.ts +8 -0
- package/lib/esm/resources/percentage_discount_promotions.js +4 -0
- package/lib/esm/resources/promotions.d.ts +3 -0
- package/lib/esm/resources/promotions.js +4 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
@@ -2,14 +2,14 @@ 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.12.0";
|
6
6
|
export { OPEN_API_SCHEMA_VERSION };
|
7
7
|
type SdkConfig = {};
|
8
8
|
type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
9
9
|
type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
10
10
|
declare class CommerceLayerClient {
|
11
11
|
#private;
|
12
|
-
readonly openApiSchemaVersion = "4.
|
12
|
+
readonly openApiSchemaVersion = "4.12.0";
|
13
13
|
addresses: api.Addresses;
|
14
14
|
adjustments: api.Adjustments;
|
15
15
|
adyen_gateways: api.AdyenGateways;
|
package/lib/cjs/commercelayer.js
CHANGED
@@ -45,7 +45,7 @@ const resource_1 = __importDefault(require("./resource"));
|
|
45
45
|
const debug_1 = __importDefault(require("./debug"));
|
46
46
|
const debug = (0, debug_1.default)('commercelayer');
|
47
47
|
// Autogenerated schema version number, do not remove this line
|
48
|
-
const OPEN_API_SCHEMA_VERSION = '4.
|
48
|
+
const OPEN_API_SCHEMA_VERSION = '4.12.0';
|
49
49
|
exports.OPEN_API_SCHEMA_VERSION = OPEN_API_SCHEMA_VERSION;
|
50
50
|
class CommerceLayerClient {
|
51
51
|
// ##__CL_RESOURCES_DEF_STOP__##
|
@@ -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 { Coupon, CouponType } from './coupons';
|
9
10
|
import type { SkuList } from './sku_lists';
|
10
11
|
import type { Attachment } from './attachments';
|
11
12
|
import type { Event } from './events';
|
@@ -30,6 +31,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
|
|
30
31
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
31
32
|
type: CouponCodesPromotionRuleType;
|
32
33
|
};
|
34
|
+
type CouponRel = ResourceRel & {
|
35
|
+
type: CouponType;
|
36
|
+
};
|
33
37
|
type TagRel = ResourceRel & {
|
34
38
|
type: TagType;
|
35
39
|
};
|
@@ -49,6 +53,7 @@ interface ExternalPromotion extends Resource {
|
|
49
53
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
50
54
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
51
55
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
56
|
+
coupons?: Coupon[] | null;
|
52
57
|
sku_list?: SkuList | null;
|
53
58
|
attachments?: Attachment[] | null;
|
54
59
|
events?: Event[] | null;
|
@@ -67,6 +72,7 @@ interface ExternalPromotionCreate extends ResourceCreate {
|
|
67
72
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
68
73
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
69
74
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
75
|
+
coupons?: CouponRel[] | null;
|
70
76
|
tags?: TagRel[] | null;
|
71
77
|
}
|
72
78
|
interface ExternalPromotionUpdate extends ResourceUpdate {
|
@@ -81,6 +87,7 @@ interface ExternalPromotionUpdate extends ResourceUpdate {
|
|
81
87
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
82
88
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
83
89
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
90
|
+
coupons?: CouponRel[] | null;
|
84
91
|
tags?: TagRel[] | null;
|
85
92
|
}
|
86
93
|
declare class ExternalPromotions extends ApiResource<ExternalPromotion> {
|
@@ -92,6 +99,7 @@ declare class ExternalPromotions extends ApiResource<ExternalPromotion> {
|
|
92
99
|
order_amount_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
93
100
|
sku_list_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
94
101
|
coupon_codes_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
102
|
+
coupons(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
95
103
|
sku_list(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
96
104
|
attachments(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
97
105
|
events(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
@@ -27,6 +27,10 @@ class ExternalPromotions extends resource_1.ApiResource {
|
|
27
27
|
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
28
28
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `external_promotions/${_externalPromotionId}/coupon_codes_promotion_rule`, params, options);
|
29
29
|
}
|
30
|
+
async coupons(externalPromotionId, params, options) {
|
31
|
+
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
32
|
+
return this.resources.fetch({ type: 'coupons' }, `external_promotions/${_externalPromotionId}/coupons`, params, options);
|
33
|
+
}
|
30
34
|
async sku_list(externalPromotionId, params, options) {
|
31
35
|
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
32
36
|
return this.resources.fetch({ type: 'sku_lists' }, `external_promotions/${_externalPromotionId}/sku_list`, 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 { Coupon, CouponType } from './coupons';
|
9
10
|
import type { SkuList } from './sku_lists';
|
10
11
|
import type { Attachment } from './attachments';
|
11
12
|
import type { Event } from './events';
|
@@ -30,6 +31,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
|
|
30
31
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
31
32
|
type: CouponCodesPromotionRuleType;
|
32
33
|
};
|
34
|
+
type CouponRel = ResourceRel & {
|
35
|
+
type: CouponType;
|
36
|
+
};
|
33
37
|
type TagRel = ResourceRel & {
|
34
38
|
type: TagType;
|
35
39
|
};
|
@@ -50,6 +54,7 @@ interface FixedAmountPromotion extends Resource {
|
|
50
54
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
51
55
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
52
56
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
57
|
+
coupons?: Coupon[] | null;
|
53
58
|
sku_list?: SkuList | null;
|
54
59
|
attachments?: Attachment[] | null;
|
55
60
|
events?: Event[] | null;
|
@@ -68,6 +73,7 @@ interface FixedAmountPromotionCreate extends ResourceCreate {
|
|
68
73
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
69
74
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
70
75
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
76
|
+
coupons?: CouponRel[] | null;
|
71
77
|
tags?: TagRel[] | null;
|
72
78
|
}
|
73
79
|
interface FixedAmountPromotionUpdate extends ResourceUpdate {
|
@@ -82,6 +88,7 @@ interface FixedAmountPromotionUpdate extends ResourceUpdate {
|
|
82
88
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
83
89
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
84
90
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
91
|
+
coupons?: CouponRel[] | null;
|
85
92
|
tags?: TagRel[] | null;
|
86
93
|
}
|
87
94
|
declare class FixedAmountPromotions extends ApiResource<FixedAmountPromotion> {
|
@@ -93,6 +100,7 @@ declare class FixedAmountPromotions extends ApiResource<FixedAmountPromotion> {
|
|
93
100
|
order_amount_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
94
101
|
sku_list_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
95
102
|
coupon_codes_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
103
|
+
coupons(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
96
104
|
sku_list(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
97
105
|
attachments(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
98
106
|
events(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
@@ -27,6 +27,10 @@ class FixedAmountPromotions extends resource_1.ApiResource {
|
|
27
27
|
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
28
28
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupon_codes_promotion_rule`, params, options);
|
29
29
|
}
|
30
|
+
async coupons(fixedAmountPromotionId, params, options) {
|
31
|
+
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
32
|
+
return this.resources.fetch({ type: 'coupons' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupons`, params, options);
|
33
|
+
}
|
30
34
|
async sku_list(fixedAmountPromotionId, params, options) {
|
31
35
|
const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
|
32
36
|
return this.resources.fetch({ type: 'sku_lists' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/sku_list`, 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 { Coupon, CouponType } from './coupons';
|
9
10
|
import type { SkuList, SkuListType } from './sku_lists';
|
10
11
|
import type { Attachment } from './attachments';
|
11
12
|
import type { Event } from './events';
|
@@ -31,6 +32,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
|
|
31
32
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
32
33
|
type: CouponCodesPromotionRuleType;
|
33
34
|
};
|
35
|
+
type CouponRel = ResourceRel & {
|
36
|
+
type: CouponType;
|
37
|
+
};
|
34
38
|
type SkuListRel = ResourceRel & {
|
35
39
|
type: SkuListType;
|
36
40
|
};
|
@@ -54,6 +58,7 @@ interface FixedPricePromotion extends Resource {
|
|
54
58
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
55
59
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
56
60
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
61
|
+
coupons?: Coupon[] | null;
|
57
62
|
sku_list?: SkuList | null;
|
58
63
|
attachments?: Attachment[] | null;
|
59
64
|
events?: Event[] | null;
|
@@ -73,6 +78,7 @@ interface FixedPricePromotionCreate extends ResourceCreate {
|
|
73
78
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
74
79
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
75
80
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
81
|
+
coupons?: CouponRel[] | null;
|
76
82
|
sku_list: SkuListRel;
|
77
83
|
tags?: TagRel[] | null;
|
78
84
|
}
|
@@ -88,6 +94,7 @@ interface FixedPricePromotionUpdate extends ResourceUpdate {
|
|
88
94
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
89
95
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
90
96
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
97
|
+
coupons?: CouponRel[] | null;
|
91
98
|
sku_list?: SkuListRel | null;
|
92
99
|
tags?: TagRel[] | null;
|
93
100
|
}
|
@@ -100,6 +107,7 @@ declare class FixedPricePromotions extends ApiResource<FixedPricePromotion> {
|
|
100
107
|
order_amount_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
101
108
|
sku_list_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
102
109
|
coupon_codes_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
110
|
+
coupons(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
103
111
|
sku_list(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
104
112
|
attachments(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
105
113
|
events(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
@@ -27,6 +27,10 @@ class FixedPricePromotions extends resource_1.ApiResource {
|
|
27
27
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
28
28
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupon_codes_promotion_rule`, params, options);
|
29
29
|
}
|
30
|
+
async coupons(fixedPricePromotionId, params, options) {
|
31
|
+
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
32
|
+
return this.resources.fetch({ type: 'coupons' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupons`, params, options);
|
33
|
+
}
|
30
34
|
async sku_list(fixedPricePromotionId, params, options) {
|
31
35
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
32
36
|
return this.resources.fetch({ type: 'sku_lists' }, `fixed_price_promotions/${_fixedPricePromotionId}/sku_list`, 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 { Coupon, CouponType } from './coupons';
|
9
10
|
import type { SkuList, SkuListType } from './sku_lists';
|
10
11
|
import type { Attachment } from './attachments';
|
11
12
|
import type { Event } from './events';
|
@@ -31,6 +32,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
|
|
31
32
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
32
33
|
type: CouponCodesPromotionRuleType;
|
33
34
|
};
|
35
|
+
type CouponRel = ResourceRel & {
|
36
|
+
type: CouponType;
|
37
|
+
};
|
34
38
|
type SkuListRel = ResourceRel & {
|
35
39
|
type: SkuListType;
|
36
40
|
};
|
@@ -52,6 +56,7 @@ interface FreeGiftPromotion extends Resource {
|
|
52
56
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
53
57
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
54
58
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
59
|
+
coupons?: Coupon[] | null;
|
55
60
|
sku_list?: SkuList | null;
|
56
61
|
attachments?: Attachment[] | null;
|
57
62
|
events?: Event[] | null;
|
@@ -71,6 +76,7 @@ interface FreeGiftPromotionCreate extends ResourceCreate {
|
|
71
76
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
72
77
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
73
78
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
79
|
+
coupons?: CouponRel[] | null;
|
74
80
|
sku_list: SkuListRel;
|
75
81
|
tags?: TagRel[] | null;
|
76
82
|
}
|
@@ -86,6 +92,7 @@ interface FreeGiftPromotionUpdate extends ResourceUpdate {
|
|
86
92
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
87
93
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
88
94
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
95
|
+
coupons?: CouponRel[] | null;
|
89
96
|
sku_list?: SkuListRel | null;
|
90
97
|
tags?: TagRel[] | null;
|
91
98
|
}
|
@@ -98,6 +105,7 @@ declare class FreeGiftPromotions extends ApiResource<FreeGiftPromotion> {
|
|
98
105
|
order_amount_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
99
106
|
sku_list_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
100
107
|
coupon_codes_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
108
|
+
coupons(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
101
109
|
sku_list(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
102
110
|
attachments(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
103
111
|
events(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
@@ -27,6 +27,10 @@ class FreeGiftPromotions extends resource_1.ApiResource {
|
|
27
27
|
const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
|
28
28
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/coupon_codes_promotion_rule`, params, options);
|
29
29
|
}
|
30
|
+
async coupons(freeGiftPromotionId, params, options) {
|
31
|
+
const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
|
32
|
+
return this.resources.fetch({ type: 'coupons' }, `free_gift_promotions/${_freeGiftPromotionId}/coupons`, params, options);
|
33
|
+
}
|
30
34
|
async sku_list(freeGiftPromotionId, params, options) {
|
31
35
|
const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
|
32
36
|
return this.resources.fetch({ type: 'sku_lists' }, `free_gift_promotions/${_freeGiftPromotionId}/sku_list`, 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 { Coupon, CouponType } from './coupons';
|
9
10
|
import type { SkuList } from './sku_lists';
|
10
11
|
import type { Attachment } from './attachments';
|
11
12
|
import type { Event } from './events';
|
@@ -30,6 +31,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
|
|
30
31
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
31
32
|
type: CouponCodesPromotionRuleType;
|
32
33
|
};
|
34
|
+
type CouponRel = ResourceRel & {
|
35
|
+
type: CouponType;
|
36
|
+
};
|
33
37
|
type TagRel = ResourceRel & {
|
34
38
|
type: TagType;
|
35
39
|
};
|
@@ -47,6 +51,7 @@ interface FreeShippingPromotion extends Resource {
|
|
47
51
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
48
52
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
49
53
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
54
|
+
coupons?: Coupon[] | null;
|
50
55
|
sku_list?: SkuList | null;
|
51
56
|
attachments?: Attachment[] | null;
|
52
57
|
events?: Event[] | null;
|
@@ -64,6 +69,7 @@ interface FreeShippingPromotionCreate extends ResourceCreate {
|
|
64
69
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
65
70
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
66
71
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
72
|
+
coupons?: CouponRel[] | null;
|
67
73
|
tags?: TagRel[] | null;
|
68
74
|
}
|
69
75
|
interface FreeShippingPromotionUpdate extends ResourceUpdate {
|
@@ -77,6 +83,7 @@ interface FreeShippingPromotionUpdate extends ResourceUpdate {
|
|
77
83
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
78
84
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
79
85
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
86
|
+
coupons?: CouponRel[] | null;
|
80
87
|
tags?: TagRel[] | null;
|
81
88
|
}
|
82
89
|
declare class FreeShippingPromotions extends ApiResource<FreeShippingPromotion> {
|
@@ -88,6 +95,7 @@ declare class FreeShippingPromotions extends ApiResource<FreeShippingPromotion>
|
|
88
95
|
order_amount_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
89
96
|
sku_list_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
90
97
|
coupon_codes_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
98
|
+
coupons(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
91
99
|
sku_list(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
92
100
|
attachments(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
93
101
|
events(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
@@ -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 coupons(freeShippingPromotionId, params, options) {
|
31
|
+
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
32
|
+
return this.resources.fetch({ type: 'coupons' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupons`, params, options);
|
33
|
+
}
|
30
34
|
async sku_list(freeShippingPromotionId, params, options) {
|
31
35
|
const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
|
32
36
|
return this.resources.fetch({ type: 'sku_lists' }, `free_shipping_promotions/${_freeShippingPromotionId}/sku_list`, params, options);
|
@@ -9,6 +9,7 @@ type ImportRel = ResourceRel & {
|
|
9
9
|
interface Import extends Resource {
|
10
10
|
readonly type: ImportType;
|
11
11
|
resource_type: string;
|
12
|
+
format?: string | null;
|
12
13
|
parent_resource_id?: string | null;
|
13
14
|
status: 'pending' | 'in_progress' | 'interrupted' | 'completed';
|
14
15
|
started_at?: string | null;
|
@@ -21,6 +22,7 @@ interface Import extends Resource {
|
|
21
22
|
processed_count?: number | null;
|
22
23
|
errors_log?: Record<string, any> | null;
|
23
24
|
warnings_log?: Record<string, any> | null;
|
25
|
+
cleanup_records?: boolean | null;
|
24
26
|
attachment_url?: string | null;
|
25
27
|
events?: Event[] | null;
|
26
28
|
}
|
@@ -29,6 +31,7 @@ interface ImportCreate extends ResourceCreate {
|
|
29
31
|
format?: string | null;
|
30
32
|
parent_resource_id?: string | null;
|
31
33
|
inputs: Array<Record<string, any>>;
|
34
|
+
cleanup_records?: boolean | null;
|
32
35
|
}
|
33
36
|
declare class Imports extends ApiResource<Import> {
|
34
37
|
static readonly TYPE: ImportType;
|
@@ -88,6 +88,8 @@ interface LineItem extends Resource {
|
|
88
88
|
frequency?: string | null;
|
89
89
|
order?: Order | null;
|
90
90
|
item?: Adjustment | Bundle | ExternalPromotion | FixedAmountPromotion | FreeShippingPromotion | GiftCard | PaymentMethod | PercentageDiscountPromotion | Shipment | Sku | null;
|
91
|
+
sku?: Sku | null;
|
92
|
+
bundle?: Bundle | null;
|
91
93
|
line_item_options?: LineItemOption[] | null;
|
92
94
|
/**
|
93
95
|
* @deprecated This field should not be used as it may be removed in the future without notice
|
@@ -113,6 +115,8 @@ interface LineItemCreate extends ResourceCreate {
|
|
113
115
|
frequency?: string | null;
|
114
116
|
order: OrderRel;
|
115
117
|
item?: AdjustmentRel | BundleRel | ExternalPromotionRel | FixedAmountPromotionRel | FreeShippingPromotionRel | GiftCardRel | PaymentMethodRel | PercentageDiscountPromotionRel | ShipmentRel | SkuRel | null;
|
118
|
+
sku?: SkuRel | null;
|
119
|
+
bundle?: BundleRel | null;
|
116
120
|
tags?: TagRel[] | null;
|
117
121
|
}
|
118
122
|
interface LineItemUpdate extends ResourceUpdate {
|
@@ -33,6 +33,8 @@ interface OrderSubscriptionItem extends Resource {
|
|
33
33
|
formatted_total_amount?: string | null;
|
34
34
|
order_subscription?: OrderSubscription | null;
|
35
35
|
item?: Adjustment | Bundle | Sku | null;
|
36
|
+
sku?: Sku | null;
|
37
|
+
bundle?: Bundle | null;
|
36
38
|
source_line_item?: LineItem | null;
|
37
39
|
}
|
38
40
|
interface OrderSubscriptionItemCreate extends ResourceCreate {
|
@@ -42,6 +44,8 @@ interface OrderSubscriptionItemCreate extends ResourceCreate {
|
|
42
44
|
unit_amount_cents?: number | null;
|
43
45
|
order_subscription: OrderSubscriptionRel;
|
44
46
|
item: AdjustmentRel | BundleRel | SkuRel;
|
47
|
+
sku?: SkuRel | null;
|
48
|
+
bundle?: BundleRel | null;
|
45
49
|
}
|
46
50
|
interface OrderSubscriptionItemUpdate extends ResourceUpdate {
|
47
51
|
sku_code?: string | null;
|
@@ -219,6 +219,7 @@ interface OrderCreate extends ResourceCreate {
|
|
219
219
|
customer_email?: string | null;
|
220
220
|
customer_password?: string | null;
|
221
221
|
language_code?: string | null;
|
222
|
+
freight_taxable?: boolean | null;
|
222
223
|
shipping_country_code_lock?: string | null;
|
223
224
|
coupon_code?: string | null;
|
224
225
|
gift_card_code?: string | null;
|
@@ -240,6 +241,7 @@ interface OrderUpdate extends ResourceUpdate {
|
|
240
241
|
customer_email?: string | null;
|
241
242
|
customer_password?: string | null;
|
242
243
|
language_code?: string | null;
|
244
|
+
freight_taxable?: boolean | null;
|
243
245
|
shipping_country_code_lock?: string | null;
|
244
246
|
coupon_code?: string | null;
|
245
247
|
gift_card_code?: string | 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 { Coupon, CouponType } from './coupons';
|
9
10
|
import type { SkuList, SkuListType } from './sku_lists';
|
10
11
|
import type { Attachment } from './attachments';
|
11
12
|
import type { Event } from './events';
|
@@ -31,6 +32,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
|
|
31
32
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
32
33
|
type: CouponCodesPromotionRuleType;
|
33
34
|
};
|
35
|
+
type CouponRel = ResourceRel & {
|
36
|
+
type: CouponType;
|
37
|
+
};
|
34
38
|
type SkuListRel = ResourceRel & {
|
35
39
|
type: SkuListType;
|
36
40
|
};
|
@@ -52,6 +56,7 @@ interface PercentageDiscountPromotion extends Resource {
|
|
52
56
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
53
57
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
54
58
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
59
|
+
coupons?: Coupon[] | null;
|
55
60
|
sku_list?: SkuList | null;
|
56
61
|
attachments?: Attachment[] | null;
|
57
62
|
events?: Event[] | null;
|
@@ -71,6 +76,7 @@ interface PercentageDiscountPromotionCreate extends ResourceCreate {
|
|
71
76
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
72
77
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
73
78
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
79
|
+
coupons?: CouponRel[] | null;
|
74
80
|
sku_list?: SkuListRel | null;
|
75
81
|
tags?: TagRel[] | null;
|
76
82
|
}
|
@@ -86,6 +92,7 @@ interface PercentageDiscountPromotionUpdate extends ResourceUpdate {
|
|
86
92
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
87
93
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
88
94
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
95
|
+
coupons?: CouponRel[] | null;
|
89
96
|
sku_list?: SkuListRel | null;
|
90
97
|
tags?: TagRel[] | null;
|
91
98
|
}
|
@@ -98,6 +105,7 @@ declare class PercentageDiscountPromotions extends ApiResource<PercentageDiscoun
|
|
98
105
|
order_amount_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
99
106
|
sku_list_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
100
107
|
coupon_codes_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
108
|
+
coupons(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
101
109
|
sku_list(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
102
110
|
attachments(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
103
111
|
events(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
@@ -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 coupons(percentageDiscountPromotionId, params, options) {
|
31
|
+
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
32
|
+
return this.resources.fetch({ type: 'coupons' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/coupons`, params, options);
|
33
|
+
}
|
30
34
|
async sku_list(percentageDiscountPromotionId, params, options) {
|
31
35
|
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
32
36
|
return this.resources.fetch({ type: 'sku_lists' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/sku_list`, 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 { Coupon } from './coupons';
|
9
10
|
import type { SkuList } from './sku_lists';
|
10
11
|
import type { Attachment } from './attachments';
|
11
12
|
import type { Event } from './events';
|
@@ -29,6 +30,7 @@ interface Promotion extends Resource {
|
|
29
30
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
30
31
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
31
32
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
33
|
+
coupons?: Coupon[] | null;
|
32
34
|
sku_list?: SkuList | null;
|
33
35
|
attachments?: Attachment[] | null;
|
34
36
|
events?: Event[] | null;
|
@@ -41,6 +43,7 @@ declare class Promotions extends ApiResource<Promotion> {
|
|
41
43
|
order_amount_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
42
44
|
sku_list_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
43
45
|
coupon_codes_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
46
|
+
coupons(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
44
47
|
sku_list(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
45
48
|
attachments(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
46
49
|
events(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
@@ -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 coupons(promotionId, params, options) {
|
22
|
+
const _promotionId = promotionId.id || promotionId;
|
23
|
+
return this.resources.fetch({ type: 'coupons' }, `promotions/${_promotionId}/coupons`, params, options);
|
24
|
+
}
|
21
25
|
async sku_list(promotionId, params, options) {
|
22
26
|
const _promotionId = promotionId.id || promotionId;
|
23
27
|
return this.resources.fetch({ type: 'sku_lists' }, `promotions/${_promotionId}/sku_list`, params, options);
|
@@ -2,14 +2,14 @@ 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.12.0";
|
6
6
|
export { OPEN_API_SCHEMA_VERSION };
|
7
7
|
type SdkConfig = {};
|
8
8
|
type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
9
9
|
type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
10
10
|
declare class CommerceLayerClient {
|
11
11
|
#private;
|
12
|
-
readonly openApiSchemaVersion = "4.
|
12
|
+
readonly openApiSchemaVersion = "4.12.0";
|
13
13
|
addresses: api.Addresses;
|
14
14
|
adjustments: api.Adjustments;
|
15
15
|
adyen_gateways: api.AdyenGateways;
|
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.12.0';
|
20
20
|
export { OPEN_API_SCHEMA_VERSION };
|
21
21
|
class CommerceLayerClient {
|
22
22
|
// ##__CL_RESOURCES_DEF_STOP__##
|
@@ -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 { Coupon, CouponType } from './coupons';
|
9
10
|
import type { SkuList } from './sku_lists';
|
10
11
|
import type { Attachment } from './attachments';
|
11
12
|
import type { Event } from './events';
|
@@ -30,6 +31,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
|
|
30
31
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
31
32
|
type: CouponCodesPromotionRuleType;
|
32
33
|
};
|
34
|
+
type CouponRel = ResourceRel & {
|
35
|
+
type: CouponType;
|
36
|
+
};
|
33
37
|
type TagRel = ResourceRel & {
|
34
38
|
type: TagType;
|
35
39
|
};
|
@@ -49,6 +53,7 @@ interface ExternalPromotion extends Resource {
|
|
49
53
|
order_amount_promotion_rule?: OrderAmountPromotionRule | null;
|
50
54
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
51
55
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
56
|
+
coupons?: Coupon[] | null;
|
52
57
|
sku_list?: SkuList | null;
|
53
58
|
attachments?: Attachment[] | null;
|
54
59
|
events?: Event[] | null;
|
@@ -67,6 +72,7 @@ interface ExternalPromotionCreate extends ResourceCreate {
|
|
67
72
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
68
73
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
69
74
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
75
|
+
coupons?: CouponRel[] | null;
|
70
76
|
tags?: TagRel[] | null;
|
71
77
|
}
|
72
78
|
interface ExternalPromotionUpdate extends ResourceUpdate {
|
@@ -81,6 +87,7 @@ interface ExternalPromotionUpdate extends ResourceUpdate {
|
|
81
87
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
82
88
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
83
89
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
90
|
+
coupons?: CouponRel[] | null;
|
84
91
|
tags?: TagRel[] | null;
|
85
92
|
}
|
86
93
|
declare class ExternalPromotions extends ApiResource<ExternalPromotion> {
|
@@ -92,6 +99,7 @@ declare class ExternalPromotions extends ApiResource<ExternalPromotion> {
|
|
92
99
|
order_amount_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
93
100
|
sku_list_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
94
101
|
coupon_codes_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
102
|
+
coupons(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
95
103
|
sku_list(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
96
104
|
attachments(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
97
105
|
events(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
@@ -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 coupons(externalPromotionId, params, options) {
|
29
|
+
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
30
|
+
return this.resources.fetch({ type: 'coupons' }, `external_promotions/${_externalPromotionId}/coupons`, params, options);
|
31
|
+
}
|
28
32
|
async sku_list(externalPromotionId, params, options) {
|
29
33
|
const _externalPromotionId = externalPromotionId.id || externalPromotionId;
|
30
34
|
return this.resources.fetch({ type: 'sku_lists' }, `external_promotions/${_externalPromotionId}/sku_list`, params, options);
|