@commercelayer/sdk 4.41.0 → 4.44.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/lib/cjs/commercelayer.d.ts +2 -2
  2. package/lib/cjs/commercelayer.js +1 -1
  3. package/lib/cjs/resources/adyen_gateways.d.ts +2 -2
  4. package/lib/cjs/resources/avalara_accounts.d.ts +6 -6
  5. package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +10 -12
  6. package/lib/cjs/resources/buy_x_pay_y_promotions.js +6 -2
  7. package/lib/cjs/resources/external_promotions.d.ts +10 -12
  8. package/lib/cjs/resources/external_promotions.js +6 -2
  9. package/lib/cjs/resources/fixed_amount_promotions.d.ts +10 -12
  10. package/lib/cjs/resources/fixed_amount_promotions.js +6 -2
  11. package/lib/cjs/resources/fixed_price_promotions.d.ts +10 -12
  12. package/lib/cjs/resources/fixed_price_promotions.js +6 -2
  13. package/lib/cjs/resources/free_gift_promotions.d.ts +10 -12
  14. package/lib/cjs/resources/free_gift_promotions.js +6 -2
  15. package/lib/cjs/resources/free_shipping_promotions.d.ts +15 -12
  16. package/lib/cjs/resources/free_shipping_promotions.js +6 -2
  17. package/lib/cjs/resources/inventory_models.d.ts +3 -0
  18. package/lib/cjs/resources/line_items.d.ts +3 -0
  19. package/lib/cjs/resources/line_items.js +4 -0
  20. package/lib/cjs/resources/order_subscriptions.d.ts +1 -0
  21. package/lib/cjs/resources/orders.d.ts +2 -0
  22. package/lib/cjs/resources/orders.js +4 -0
  23. package/lib/cjs/resources/payment_methods.d.ts +3 -0
  24. package/lib/cjs/resources/percentage_discount_promotions.d.ts +10 -12
  25. package/lib/cjs/resources/percentage_discount_promotions.js +6 -2
  26. package/lib/cjs/resources/promotions.d.ts +6 -3
  27. package/lib/cjs/resources/promotions.js +6 -2
  28. package/lib/cjs/resources/stock_line_items.d.ts +3 -0
  29. package/lib/cjs/resources/stock_reservations.d.ts +0 -1
  30. package/lib/cjs/resources/stock_transfers.d.ts +1 -1
  31. package/lib/cjs/resources/stripe_payments.d.ts +3 -0
  32. package/lib/esm/commercelayer.d.ts +2 -2
  33. package/lib/esm/commercelayer.js +1 -1
  34. package/lib/esm/resources/adyen_gateways.d.ts +2 -2
  35. package/lib/esm/resources/avalara_accounts.d.ts +6 -6
  36. package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +10 -12
  37. package/lib/esm/resources/buy_x_pay_y_promotions.js +6 -2
  38. package/lib/esm/resources/external_promotions.d.ts +10 -12
  39. package/lib/esm/resources/external_promotions.js +6 -2
  40. package/lib/esm/resources/fixed_amount_promotions.d.ts +10 -12
  41. package/lib/esm/resources/fixed_amount_promotions.js +6 -2
  42. package/lib/esm/resources/fixed_price_promotions.d.ts +10 -12
  43. package/lib/esm/resources/fixed_price_promotions.js +6 -2
  44. package/lib/esm/resources/free_gift_promotions.d.ts +10 -12
  45. package/lib/esm/resources/free_gift_promotions.js +6 -2
  46. package/lib/esm/resources/free_shipping_promotions.d.ts +15 -12
  47. package/lib/esm/resources/free_shipping_promotions.js +6 -2
  48. package/lib/esm/resources/inventory_models.d.ts +3 -0
  49. package/lib/esm/resources/line_items.d.ts +3 -0
  50. package/lib/esm/resources/line_items.js +4 -0
  51. package/lib/esm/resources/order_subscriptions.d.ts +1 -0
  52. package/lib/esm/resources/orders.d.ts +2 -0
  53. package/lib/esm/resources/orders.js +4 -0
  54. package/lib/esm/resources/payment_methods.d.ts +3 -0
  55. package/lib/esm/resources/percentage_discount_promotions.d.ts +10 -12
  56. package/lib/esm/resources/percentage_discount_promotions.js +6 -2
  57. package/lib/esm/resources/promotions.d.ts +6 -3
  58. package/lib/esm/resources/promotions.js +6 -2
  59. package/lib/esm/resources/stock_line_items.d.ts +3 -0
  60. package/lib/esm/resources/stock_reservations.d.ts +0 -1
  61. package/lib/esm/resources/stock_transfers.d.ts +1 -1
  62. package/lib/esm/resources/stripe_payments.d.ts +3 -0
  63. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  64. package/lib/tsconfig.tsbuildinfo +1 -1
  65. package/package.json +18 -18
@@ -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.23.0";
5
+ declare const OPEN_API_SCHEMA_VERSION = "4.26.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.23.0";
13
+ readonly openApiSchemaVersion = "4.26.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.23.0';
48
+ const OPEN_API_SCHEMA_VERSION = '4.26.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; }
@@ -25,7 +25,7 @@ interface AdyenGatewayCreate extends ResourceCreate {
25
25
  api_key: string;
26
26
  public_key?: string;
27
27
  live_url_prefix: string;
28
- api_version?: string;
28
+ api_version?: number;
29
29
  async_api?: boolean;
30
30
  webhook_endpoint_secret?: string;
31
31
  adyen_payments?: AdyenPaymentRel[];
@@ -36,7 +36,7 @@ interface AdyenGatewayUpdate extends ResourceUpdate {
36
36
  api_key?: string;
37
37
  public_key?: string;
38
38
  live_url_prefix?: string;
39
- api_version?: string;
39
+ api_version?: number;
40
40
  async_api?: boolean;
41
41
  webhook_endpoint_secret?: string;
42
42
  adyen_payments?: AdyenPaymentRel[];
@@ -14,8 +14,8 @@ interface AvalaraAccount extends Resource {
14
14
  name?: string;
15
15
  username?: string;
16
16
  company_code?: string;
17
- commit_invoice?: string;
18
- ddp?: string;
17
+ commit_invoice?: boolean;
18
+ ddp?: boolean;
19
19
  markets?: Market[];
20
20
  attachments?: Attachment[];
21
21
  versions?: Version[];
@@ -26,8 +26,8 @@ interface AvalaraAccountCreate extends ResourceCreate {
26
26
  username: string;
27
27
  password: string;
28
28
  company_code: string;
29
- commit_invoice?: string;
30
- ddp?: string;
29
+ commit_invoice?: boolean;
30
+ ddp?: boolean;
31
31
  tax_categories?: TaxCategoryRel[];
32
32
  }
33
33
  interface AvalaraAccountUpdate extends ResourceUpdate {
@@ -35,8 +35,8 @@ interface AvalaraAccountUpdate extends ResourceUpdate {
35
35
  username?: string;
36
36
  password?: string;
37
37
  company_code?: string;
38
- commit_invoice?: string;
39
- ddp?: string;
38
+ commit_invoice?: boolean;
39
+ ddp?: boolean;
40
40
  tax_categories?: TaxCategoryRel[];
41
41
  }
42
42
  declare class AvalaraAccounts extends ApiResource {
@@ -5,8 +5,9 @@ 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
+ import type { CustomPromotionRule } from './custom_promotion_rules';
9
9
  import type { SkuList } from './sku_lists';
10
+ import type { Coupon } from './coupons';
10
11
  import type { Attachment } from './attachments';
11
12
  import type { Event } from './events';
12
13
  import type { Tag } from './tags';
@@ -18,9 +19,6 @@ type BuyXPayYPromotionRel = ResourceRel & {
18
19
  type MarketRel = ResourceRel & {
19
20
  type: 'markets';
20
21
  };
21
- type PromotionRuleRel = ResourceRel & {
22
- type: 'promotion_rules';
23
- };
24
22
  type OrderAmountPromotionRuleRel = ResourceRel & {
25
23
  type: 'order_amount_promotion_rules';
26
24
  };
@@ -30,8 +28,8 @@ type SkuListPromotionRuleRel = ResourceRel & {
30
28
  type CouponCodesPromotionRuleRel = ResourceRel & {
31
29
  type: 'coupon_codes_promotion_rules';
32
30
  };
33
- type CouponRel = ResourceRel & {
34
- type: 'coupons';
31
+ type CustomPromotionRuleRel = ResourceRel & {
32
+ type: 'custom_promotion_rules';
35
33
  };
36
34
  type SkuListRel = ResourceRel & {
37
35
  type: 'sku_lists';
@@ -58,8 +56,9 @@ interface BuyXPayYPromotion extends Resource {
58
56
  order_amount_promotion_rule?: OrderAmountPromotionRule;
59
57
  sku_list_promotion_rule?: SkuListPromotionRule;
60
58
  coupon_codes_promotion_rule?: CouponCodesPromotionRule;
61
- coupons?: Coupon[];
59
+ custom_promotion_rule?: CustomPromotionRule;
62
60
  sku_list?: SkuList;
61
+ coupons?: Coupon[];
63
62
  attachments?: Attachment[];
64
63
  events?: Event[];
65
64
  tags?: Tag[];
@@ -80,11 +79,10 @@ interface BuyXPayYPromotionCreate extends ResourceCreate {
80
79
  y: number;
81
80
  cheapest_free?: boolean;
82
81
  market?: MarketRel;
83
- promotion_rules?: PromotionRuleRel[];
84
82
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
85
83
  sku_list_promotion_rule?: SkuListPromotionRuleRel;
86
84
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
87
- coupons?: CouponRel[];
85
+ custom_promotion_rule?: CustomPromotionRuleRel;
88
86
  sku_list: SkuListRel;
89
87
  tags?: TagRel[];
90
88
  }
@@ -102,11 +100,10 @@ interface BuyXPayYPromotionUpdate extends ResourceUpdate {
102
100
  y?: number;
103
101
  cheapest_free?: boolean;
104
102
  market?: MarketRel;
105
- promotion_rules?: PromotionRuleRel[];
106
103
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
107
104
  sku_list_promotion_rule?: SkuListPromotionRuleRel;
108
105
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
109
- coupons?: CouponRel[];
106
+ custom_promotion_rule?: CustomPromotionRuleRel;
110
107
  sku_list?: SkuListRel;
111
108
  tags?: TagRel[];
112
109
  }
@@ -121,8 +118,9 @@ declare class BuyXPayYPromotions extends ApiResource {
121
118
  order_amount_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
122
119
  sku_list_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
123
120
  coupon_codes_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
124
- coupons(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
121
+ custom_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
125
122
  sku_list(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
123
+ coupons(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
126
124
  attachments(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
127
125
  events(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
128
126
  tags(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -34,14 +34,18 @@ class BuyXPayYPromotions extends resource_1.ApiResource {
34
34
  const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
35
35
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/coupon_codes_promotion_rule`, params, options);
36
36
  }
37
- async coupons(buyXPayYPromotionId, params, options) {
37
+ async custom_promotion_rule(buyXPayYPromotionId, params, options) {
38
38
  const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
39
- return this.resources.fetch({ type: 'coupons' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/coupons`, params, options);
39
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/custom_promotion_rule`, params, options);
40
40
  }
41
41
  async sku_list(buyXPayYPromotionId, params, options) {
42
42
  const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
43
43
  return this.resources.fetch({ type: 'sku_lists' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/sku_list`, params, options);
44
44
  }
45
+ async coupons(buyXPayYPromotionId, params, options) {
46
+ const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
47
+ return this.resources.fetch({ type: 'coupons' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/coupons`, params, options);
48
+ }
45
49
  async attachments(buyXPayYPromotionId, params, options) {
46
50
  const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
47
51
  return this.resources.fetch({ type: 'attachments' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/attachments`, params, options);
@@ -5,8 +5,9 @@ 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
+ import type { CustomPromotionRule } from './custom_promotion_rules';
9
9
  import type { SkuList } from './sku_lists';
10
+ import type { Coupon } from './coupons';
10
11
  import type { Attachment } from './attachments';
11
12
  import type { Event } from './events';
12
13
  import type { Tag } from './tags';
@@ -18,9 +19,6 @@ type ExternalPromotionRel = ResourceRel & {
18
19
  type MarketRel = ResourceRel & {
19
20
  type: 'markets';
20
21
  };
21
- type PromotionRuleRel = ResourceRel & {
22
- type: 'promotion_rules';
23
- };
24
22
  type OrderAmountPromotionRuleRel = ResourceRel & {
25
23
  type: 'order_amount_promotion_rules';
26
24
  };
@@ -30,8 +28,8 @@ type SkuListPromotionRuleRel = ResourceRel & {
30
28
  type CouponCodesPromotionRuleRel = ResourceRel & {
31
29
  type: 'coupon_codes_promotion_rules';
32
30
  };
33
- type CouponRel = ResourceRel & {
34
- type: 'coupons';
31
+ type CustomPromotionRuleRel = ResourceRel & {
32
+ type: 'custom_promotion_rules';
35
33
  };
36
34
  type SkuListRel = ResourceRel & {
37
35
  type: 'sku_lists';
@@ -57,8 +55,9 @@ interface ExternalPromotion extends Resource {
57
55
  order_amount_promotion_rule?: OrderAmountPromotionRule;
58
56
  sku_list_promotion_rule?: SkuListPromotionRule;
59
57
  coupon_codes_promotion_rule?: CouponCodesPromotionRule;
60
- coupons?: Coupon[];
58
+ custom_promotion_rule?: CustomPromotionRule;
61
59
  sku_list?: SkuList;
60
+ coupons?: Coupon[];
62
61
  attachments?: Attachment[];
63
62
  events?: Event[];
64
63
  tags?: Tag[];
@@ -77,11 +76,10 @@ interface ExternalPromotionCreate extends ResourceCreate {
77
76
  _enable?: boolean;
78
77
  promotion_url: string;
79
78
  market?: MarketRel;
80
- promotion_rules?: PromotionRuleRel[];
81
79
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
82
80
  sku_list_promotion_rule?: SkuListPromotionRuleRel;
83
81
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
84
- coupons?: CouponRel[];
82
+ custom_promotion_rule?: CustomPromotionRuleRel;
85
83
  sku_list?: SkuListRel;
86
84
  tags?: TagRel[];
87
85
  }
@@ -97,11 +95,10 @@ interface ExternalPromotionUpdate extends ResourceUpdate {
97
95
  _enable?: boolean;
98
96
  promotion_url?: string;
99
97
  market?: MarketRel;
100
- promotion_rules?: PromotionRuleRel[];
101
98
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
102
99
  sku_list_promotion_rule?: SkuListPromotionRuleRel;
103
100
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
104
- coupons?: CouponRel[];
101
+ custom_promotion_rule?: CustomPromotionRuleRel;
105
102
  sku_list?: SkuListRel;
106
103
  tags?: TagRel[];
107
104
  }
@@ -116,8 +113,9 @@ declare class ExternalPromotions extends ApiResource {
116
113
  order_amount_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
117
114
  sku_list_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
118
115
  coupon_codes_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
119
- coupons(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
116
+ custom_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
120
117
  sku_list(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
118
+ coupons(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
121
119
  attachments(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
122
120
  events(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
123
121
  tags(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -34,14 +34,18 @@ 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) {
37
+ async custom_promotion_rule(externalPromotionId, params, options) {
38
38
  const _externalPromotionId = externalPromotionId.id || externalPromotionId;
39
- return this.resources.fetch({ type: 'coupons' }, `external_promotions/${_externalPromotionId}/coupons`, params, options);
39
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `external_promotions/${_externalPromotionId}/custom_promotion_rule`, params, options);
40
40
  }
41
41
  async sku_list(externalPromotionId, params, options) {
42
42
  const _externalPromotionId = externalPromotionId.id || externalPromotionId;
43
43
  return this.resources.fetch({ type: 'sku_lists' }, `external_promotions/${_externalPromotionId}/sku_list`, params, options);
44
44
  }
45
+ async coupons(externalPromotionId, params, options) {
46
+ const _externalPromotionId = externalPromotionId.id || externalPromotionId;
47
+ return this.resources.fetch({ type: 'coupons' }, `external_promotions/${_externalPromotionId}/coupons`, params, options);
48
+ }
45
49
  async attachments(externalPromotionId, params, options) {
46
50
  const _externalPromotionId = externalPromotionId.id || externalPromotionId;
47
51
  return this.resources.fetch({ type: 'attachments' }, `external_promotions/${_externalPromotionId}/attachments`, params, options);
@@ -5,8 +5,9 @@ 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
+ import type { CustomPromotionRule } from './custom_promotion_rules';
9
9
  import type { SkuList } from './sku_lists';
10
+ import type { Coupon } from './coupons';
10
11
  import type { Attachment } from './attachments';
11
12
  import type { Event } from './events';
12
13
  import type { Tag } from './tags';
@@ -18,9 +19,6 @@ type FixedAmountPromotionRel = ResourceRel & {
18
19
  type MarketRel = ResourceRel & {
19
20
  type: 'markets';
20
21
  };
21
- type PromotionRuleRel = ResourceRel & {
22
- type: 'promotion_rules';
23
- };
24
22
  type OrderAmountPromotionRuleRel = ResourceRel & {
25
23
  type: 'order_amount_promotion_rules';
26
24
  };
@@ -30,8 +28,8 @@ type SkuListPromotionRuleRel = ResourceRel & {
30
28
  type CouponCodesPromotionRuleRel = ResourceRel & {
31
29
  type: 'coupon_codes_promotion_rules';
32
30
  };
33
- type CouponRel = ResourceRel & {
34
- type: 'coupons';
31
+ type CustomPromotionRuleRel = ResourceRel & {
32
+ type: 'custom_promotion_rules';
35
33
  };
36
34
  type SkuListRel = ResourceRel & {
37
35
  type: 'sku_lists';
@@ -58,8 +56,9 @@ interface FixedAmountPromotion extends Resource {
58
56
  order_amount_promotion_rule?: OrderAmountPromotionRule;
59
57
  sku_list_promotion_rule?: SkuListPromotionRule;
60
58
  coupon_codes_promotion_rule?: CouponCodesPromotionRule;
61
- coupons?: Coupon[];
59
+ custom_promotion_rule?: CustomPromotionRule;
62
60
  sku_list?: SkuList;
61
+ coupons?: Coupon[];
63
62
  attachments?: Attachment[];
64
63
  events?: Event[];
65
64
  tags?: Tag[];
@@ -78,11 +77,10 @@ interface FixedAmountPromotionCreate extends ResourceCreate {
78
77
  _enable?: boolean;
79
78
  fixed_amount_cents: number;
80
79
  market?: MarketRel;
81
- promotion_rules?: PromotionRuleRel[];
82
80
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
83
81
  sku_list_promotion_rule?: SkuListPromotionRuleRel;
84
82
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
85
- coupons?: CouponRel[];
83
+ custom_promotion_rule?: CustomPromotionRuleRel;
86
84
  sku_list?: SkuListRel;
87
85
  tags?: TagRel[];
88
86
  }
@@ -98,11 +96,10 @@ interface FixedAmountPromotionUpdate extends ResourceUpdate {
98
96
  _enable?: boolean;
99
97
  fixed_amount_cents?: number;
100
98
  market?: MarketRel;
101
- promotion_rules?: PromotionRuleRel[];
102
99
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
103
100
  sku_list_promotion_rule?: SkuListPromotionRuleRel;
104
101
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
105
- coupons?: CouponRel[];
102
+ custom_promotion_rule?: CustomPromotionRuleRel;
106
103
  sku_list?: SkuListRel;
107
104
  tags?: TagRel[];
108
105
  }
@@ -117,8 +114,9 @@ declare class FixedAmountPromotions extends ApiResource {
117
114
  order_amount_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
118
115
  sku_list_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
119
116
  coupon_codes_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
120
- coupons(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
117
+ custom_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
121
118
  sku_list(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
119
+ coupons(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
122
120
  attachments(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
123
121
  events(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
124
122
  tags(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -34,14 +34,18 @@ 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) {
37
+ async custom_promotion_rule(fixedAmountPromotionId, params, options) {
38
38
  const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
39
- return this.resources.fetch({ type: 'coupons' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupons`, params, options);
39
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/custom_promotion_rule`, params, options);
40
40
  }
41
41
  async sku_list(fixedAmountPromotionId, params, options) {
42
42
  const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
43
43
  return this.resources.fetch({ type: 'sku_lists' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/sku_list`, params, options);
44
44
  }
45
+ async coupons(fixedAmountPromotionId, params, options) {
46
+ const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
47
+ return this.resources.fetch({ type: 'coupons' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupons`, params, options);
48
+ }
45
49
  async attachments(fixedAmountPromotionId, params, options) {
46
50
  const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
47
51
  return this.resources.fetch({ type: 'attachments' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/attachments`, params, options);
@@ -5,8 +5,9 @@ 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
+ import type { CustomPromotionRule } from './custom_promotion_rules';
9
9
  import type { SkuList } from './sku_lists';
10
+ import type { Coupon } from './coupons';
10
11
  import type { Attachment } from './attachments';
11
12
  import type { Event } from './events';
12
13
  import type { Tag } from './tags';
@@ -18,9 +19,6 @@ type FixedPricePromotionRel = ResourceRel & {
18
19
  type MarketRel = ResourceRel & {
19
20
  type: 'markets';
20
21
  };
21
- type PromotionRuleRel = ResourceRel & {
22
- type: 'promotion_rules';
23
- };
24
22
  type OrderAmountPromotionRuleRel = ResourceRel & {
25
23
  type: 'order_amount_promotion_rules';
26
24
  };
@@ -30,8 +28,8 @@ type SkuListPromotionRuleRel = ResourceRel & {
30
28
  type CouponCodesPromotionRuleRel = ResourceRel & {
31
29
  type: 'coupon_codes_promotion_rules';
32
30
  };
33
- type CouponRel = ResourceRel & {
34
- type: 'coupons';
31
+ type CustomPromotionRuleRel = ResourceRel & {
32
+ type: 'custom_promotion_rules';
35
33
  };
36
34
  type SkuListRel = ResourceRel & {
37
35
  type: 'sku_lists';
@@ -58,8 +56,9 @@ interface FixedPricePromotion extends Resource {
58
56
  order_amount_promotion_rule?: OrderAmountPromotionRule;
59
57
  sku_list_promotion_rule?: SkuListPromotionRule;
60
58
  coupon_codes_promotion_rule?: CouponCodesPromotionRule;
61
- coupons?: Coupon[];
59
+ custom_promotion_rule?: CustomPromotionRule;
62
60
  sku_list?: SkuList;
61
+ coupons?: Coupon[];
63
62
  attachments?: Attachment[];
64
63
  events?: Event[];
65
64
  tags?: Tag[];
@@ -78,11 +77,10 @@ interface FixedPricePromotionCreate extends ResourceCreate {
78
77
  _enable?: boolean;
79
78
  fixed_amount_cents: number;
80
79
  market?: MarketRel;
81
- promotion_rules?: PromotionRuleRel[];
82
80
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
83
81
  sku_list_promotion_rule?: SkuListPromotionRuleRel;
84
82
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
85
- coupons?: CouponRel[];
83
+ custom_promotion_rule?: CustomPromotionRuleRel;
86
84
  sku_list: SkuListRel;
87
85
  tags?: TagRel[];
88
86
  }
@@ -98,11 +96,10 @@ interface FixedPricePromotionUpdate extends ResourceUpdate {
98
96
  _enable?: boolean;
99
97
  fixed_amount_cents?: number;
100
98
  market?: MarketRel;
101
- promotion_rules?: PromotionRuleRel[];
102
99
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
103
100
  sku_list_promotion_rule?: SkuListPromotionRuleRel;
104
101
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
105
- coupons?: CouponRel[];
102
+ custom_promotion_rule?: CustomPromotionRuleRel;
106
103
  sku_list?: SkuListRel;
107
104
  tags?: TagRel[];
108
105
  }
@@ -117,8 +114,9 @@ declare class FixedPricePromotions extends ApiResource {
117
114
  order_amount_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
118
115
  sku_list_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
119
116
  coupon_codes_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
120
- coupons(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
117
+ custom_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
121
118
  sku_list(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
119
+ coupons(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
122
120
  attachments(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
123
121
  events(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
124
122
  tags(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -34,14 +34,18 @@ 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) {
37
+ async custom_promotion_rule(fixedPricePromotionId, params, options) {
38
38
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
39
- return this.resources.fetch({ type: 'coupons' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupons`, params, options);
39
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `fixed_price_promotions/${_fixedPricePromotionId}/custom_promotion_rule`, params, options);
40
40
  }
41
41
  async sku_list(fixedPricePromotionId, params, options) {
42
42
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
43
43
  return this.resources.fetch({ type: 'sku_lists' }, `fixed_price_promotions/${_fixedPricePromotionId}/sku_list`, params, options);
44
44
  }
45
+ async coupons(fixedPricePromotionId, params, options) {
46
+ const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
47
+ return this.resources.fetch({ type: 'coupons' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupons`, params, options);
48
+ }
45
49
  async attachments(fixedPricePromotionId, params, options) {
46
50
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
47
51
  return this.resources.fetch({ type: 'attachments' }, `fixed_price_promotions/${_fixedPricePromotionId}/attachments`, params, options);
@@ -5,8 +5,9 @@ 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
+ import type { CustomPromotionRule } from './custom_promotion_rules';
9
9
  import type { SkuList } from './sku_lists';
10
+ import type { Coupon } from './coupons';
10
11
  import type { Attachment } from './attachments';
11
12
  import type { Event } from './events';
12
13
  import type { Tag } from './tags';
@@ -18,9 +19,6 @@ type FreeGiftPromotionRel = ResourceRel & {
18
19
  type MarketRel = ResourceRel & {
19
20
  type: 'markets';
20
21
  };
21
- type PromotionRuleRel = ResourceRel & {
22
- type: 'promotion_rules';
23
- };
24
22
  type OrderAmountPromotionRuleRel = ResourceRel & {
25
23
  type: 'order_amount_promotion_rules';
26
24
  };
@@ -30,8 +28,8 @@ type SkuListPromotionRuleRel = ResourceRel & {
30
28
  type CouponCodesPromotionRuleRel = ResourceRel & {
31
29
  type: 'coupon_codes_promotion_rules';
32
30
  };
33
- type CouponRel = ResourceRel & {
34
- type: 'coupons';
31
+ type CustomPromotionRuleRel = ResourceRel & {
32
+ type: 'custom_promotion_rules';
35
33
  };
36
34
  type SkuListRel = ResourceRel & {
37
35
  type: 'sku_lists';
@@ -56,8 +54,9 @@ interface FreeGiftPromotion extends Resource {
56
54
  order_amount_promotion_rule?: OrderAmountPromotionRule;
57
55
  sku_list_promotion_rule?: SkuListPromotionRule;
58
56
  coupon_codes_promotion_rule?: CouponCodesPromotionRule;
59
- coupons?: Coupon[];
57
+ custom_promotion_rule?: CustomPromotionRule;
60
58
  sku_list?: SkuList;
59
+ coupons?: Coupon[];
61
60
  attachments?: Attachment[];
62
61
  events?: Event[];
63
62
  tags?: Tag[];
@@ -76,11 +75,10 @@ interface FreeGiftPromotionCreate extends ResourceCreate {
76
75
  _enable?: boolean;
77
76
  max_quantity?: number;
78
77
  market?: MarketRel;
79
- promotion_rules?: PromotionRuleRel[];
80
78
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
81
79
  sku_list_promotion_rule?: SkuListPromotionRuleRel;
82
80
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
83
- coupons?: CouponRel[];
81
+ custom_promotion_rule?: CustomPromotionRuleRel;
84
82
  sku_list: SkuListRel;
85
83
  tags?: TagRel[];
86
84
  }
@@ -96,11 +94,10 @@ interface FreeGiftPromotionUpdate extends ResourceUpdate {
96
94
  _enable?: boolean;
97
95
  max_quantity?: number;
98
96
  market?: MarketRel;
99
- promotion_rules?: PromotionRuleRel[];
100
97
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
101
98
  sku_list_promotion_rule?: SkuListPromotionRuleRel;
102
99
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
103
- coupons?: CouponRel[];
100
+ custom_promotion_rule?: CustomPromotionRuleRel;
104
101
  sku_list?: SkuListRel;
105
102
  tags?: TagRel[];
106
103
  }
@@ -115,8 +112,9 @@ declare class FreeGiftPromotions extends ApiResource {
115
112
  order_amount_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
116
113
  sku_list_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
117
114
  coupon_codes_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
118
- coupons(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
115
+ custom_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
119
116
  sku_list(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
117
+ coupons(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
120
118
  attachments(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
121
119
  events(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
122
120
  tags(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -34,14 +34,18 @@ 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) {
37
+ async custom_promotion_rule(freeGiftPromotionId, params, options) {
38
38
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
39
- return this.resources.fetch({ type: 'coupons' }, `free_gift_promotions/${_freeGiftPromotionId}/coupons`, params, options);
39
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/custom_promotion_rule`, params, options);
40
40
  }
41
41
  async sku_list(freeGiftPromotionId, params, options) {
42
42
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
43
43
  return this.resources.fetch({ type: 'sku_lists' }, `free_gift_promotions/${_freeGiftPromotionId}/sku_list`, params, options);
44
44
  }
45
+ async coupons(freeGiftPromotionId, params, options) {
46
+ const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
47
+ return this.resources.fetch({ type: 'coupons' }, `free_gift_promotions/${_freeGiftPromotionId}/coupons`, params, options);
48
+ }
45
49
  async attachments(freeGiftPromotionId, params, options) {
46
50
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
47
51
  return this.resources.fetch({ type: 'attachments' }, `free_gift_promotions/${_freeGiftPromotionId}/attachments`, params, options);