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