@commercelayer/sdk 5.28.0 → 5.29.0-alfa.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 (211) hide show
  1. package/lib/cjs/api.d.ts +3 -2
  2. package/lib/cjs/api.js +5 -2
  3. package/lib/cjs/client.js +5 -5
  4. package/lib/cjs/commercelayer.d.ts +3 -2
  5. package/lib/cjs/commercelayer.js +5 -4
  6. package/lib/cjs/common.js +1 -1
  7. package/lib/cjs/error.js +1 -2
  8. package/lib/cjs/model.d.ts +1 -0
  9. package/lib/cjs/query.d.ts +1 -1
  10. package/lib/cjs/query.js +1 -1
  11. package/lib/cjs/resource.js +22 -25
  12. package/lib/cjs/resources/adjustments.d.ts +3 -0
  13. package/lib/cjs/resources/adyen_gateways.d.ts +2 -2
  14. package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +4 -14
  15. package/lib/cjs/resources/buy_x_pay_y_promotions.js +4 -4
  16. package/lib/cjs/resources/external_gateways.d.ts +5 -1
  17. package/lib/cjs/resources/external_gateways.js +3 -0
  18. package/lib/cjs/resources/external_promotions.d.ts +8 -14
  19. package/lib/cjs/resources/external_promotions.js +7 -4
  20. package/lib/cjs/resources/external_tax_calculators.d.ts +4 -0
  21. package/lib/cjs/resources/external_tax_calculators.js +3 -0
  22. package/lib/cjs/resources/fixed_amount_promotions.d.ts +4 -14
  23. package/lib/cjs/resources/fixed_amount_promotions.js +4 -4
  24. package/lib/cjs/resources/fixed_price_promotions.d.ts +4 -14
  25. package/lib/cjs/resources/fixed_price_promotions.js +4 -4
  26. package/lib/cjs/resources/free_gift_promotions.d.ts +4 -14
  27. package/lib/cjs/resources/free_gift_promotions.js +4 -4
  28. package/lib/cjs/resources/free_shipping_promotions.d.ts +9 -14
  29. package/lib/cjs/resources/free_shipping_promotions.js +4 -4
  30. package/lib/cjs/resources/gift_cards.d.ts +3 -0
  31. package/lib/cjs/resources/line_items.d.ts +12 -4
  32. package/lib/cjs/resources/line_items.js +3 -0
  33. package/lib/cjs/resources/markets.d.ts +1 -1
  34. package/lib/cjs/resources/order_subscriptions.d.ts +1 -4
  35. package/lib/cjs/resources/orders.d.ts +14 -1
  36. package/lib/cjs/resources/orders.js +10 -0
  37. package/lib/cjs/resources/parcel_line_items.d.ts +0 -8
  38. package/lib/cjs/resources/payment_methods.d.ts +8 -5
  39. package/lib/cjs/resources/percentage_discount_promotions.d.ts +4 -14
  40. package/lib/cjs/resources/percentage_discount_promotions.js +4 -4
  41. package/lib/cjs/resources/promotions.d.ts +3 -3
  42. package/lib/cjs/resources/promotions.js +4 -4
  43. package/lib/cjs/resources/resource_errors.d.ts +22 -0
  44. package/lib/cjs/resources/resource_errors.js +16 -0
  45. package/lib/cjs/resources/shipments.d.ts +0 -4
  46. package/lib/cjs/resources/shipping_methods.d.ts +9 -5
  47. package/lib/cjs/resources/shipping_methods.js +3 -0
  48. package/lib/cjs/resources/stock_transfers.d.ts +1 -1
  49. package/lib/cjs/resources/stripe_payments.d.ts +4 -1
  50. package/lib/cjs/resources/webhooks.d.ts +3 -3
  51. package/lib/cjs/resources/webhooks.js +3 -3
  52. package/lib/esm/api.d.ts +3 -2
  53. package/lib/esm/api.js +2 -0
  54. package/lib/esm/client.js +19 -30
  55. package/lib/esm/commercelayer.d.ts +3 -2
  56. package/lib/esm/commercelayer.js +261 -149
  57. package/lib/esm/common.js +1 -1
  58. package/lib/esm/error.js +10 -5
  59. package/lib/esm/model.d.ts +1 -0
  60. package/lib/esm/query.d.ts +1 -1
  61. package/lib/esm/query.js +1 -1
  62. package/lib/esm/resource.js +37 -50
  63. package/lib/esm/resources/addresses.js +1 -1
  64. package/lib/esm/resources/adjustments.d.ts +3 -0
  65. package/lib/esm/resources/adjustments.js +1 -1
  66. package/lib/esm/resources/adyen_gateways.d.ts +2 -2
  67. package/lib/esm/resources/adyen_gateways.js +1 -1
  68. package/lib/esm/resources/adyen_payments.js +1 -1
  69. package/lib/esm/resources/application.js +1 -1
  70. package/lib/esm/resources/attachments.js +1 -1
  71. package/lib/esm/resources/authorizations.js +1 -1
  72. package/lib/esm/resources/avalara_accounts.js +1 -1
  73. package/lib/esm/resources/axerve_gateways.js +1 -1
  74. package/lib/esm/resources/axerve_payments.js +1 -1
  75. package/lib/esm/resources/billing_info_validation_rules.js +1 -1
  76. package/lib/esm/resources/bing_geocoders.js +1 -1
  77. package/lib/esm/resources/braintree_gateways.js +1 -1
  78. package/lib/esm/resources/braintree_payments.js +1 -1
  79. package/lib/esm/resources/bundles.js +1 -1
  80. package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +4 -14
  81. package/lib/esm/resources/buy_x_pay_y_promotions.js +5 -5
  82. package/lib/esm/resources/captures.js +1 -1
  83. package/lib/esm/resources/carrier_accounts.js +1 -1
  84. package/lib/esm/resources/checkout_com_gateways.js +1 -1
  85. package/lib/esm/resources/checkout_com_payments.js +1 -1
  86. package/lib/esm/resources/cleanups.js +1 -1
  87. package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -1
  88. package/lib/esm/resources/coupon_recipients.js +1 -1
  89. package/lib/esm/resources/coupons.js +1 -1
  90. package/lib/esm/resources/custom_promotion_rules.js +1 -1
  91. package/lib/esm/resources/customer_addresses.js +1 -1
  92. package/lib/esm/resources/customer_groups.js +1 -1
  93. package/lib/esm/resources/customer_password_resets.js +1 -1
  94. package/lib/esm/resources/customer_payment_sources.js +1 -1
  95. package/lib/esm/resources/customer_subscriptions.js +1 -1
  96. package/lib/esm/resources/customers.js +1 -1
  97. package/lib/esm/resources/delivery_lead_times.js +1 -1
  98. package/lib/esm/resources/event_callbacks.js +1 -1
  99. package/lib/esm/resources/events.js +1 -1
  100. package/lib/esm/resources/exports.js +1 -1
  101. package/lib/esm/resources/external_gateways.d.ts +5 -1
  102. package/lib/esm/resources/external_gateways.js +4 -1
  103. package/lib/esm/resources/external_payments.js +1 -1
  104. package/lib/esm/resources/external_promotions.d.ts +8 -14
  105. package/lib/esm/resources/external_promotions.js +8 -5
  106. package/lib/esm/resources/external_tax_calculators.d.ts +4 -0
  107. package/lib/esm/resources/external_tax_calculators.js +4 -1
  108. package/lib/esm/resources/fixed_amount_promotions.d.ts +4 -14
  109. package/lib/esm/resources/fixed_amount_promotions.js +5 -5
  110. package/lib/esm/resources/fixed_price_promotions.d.ts +4 -14
  111. package/lib/esm/resources/fixed_price_promotions.js +5 -5
  112. package/lib/esm/resources/free_gift_promotions.d.ts +4 -14
  113. package/lib/esm/resources/free_gift_promotions.js +5 -5
  114. package/lib/esm/resources/free_shipping_promotions.d.ts +9 -14
  115. package/lib/esm/resources/free_shipping_promotions.js +5 -5
  116. package/lib/esm/resources/geocoders.js +1 -1
  117. package/lib/esm/resources/gift_card_recipients.js +1 -1
  118. package/lib/esm/resources/gift_cards.d.ts +3 -0
  119. package/lib/esm/resources/gift_cards.js +1 -1
  120. package/lib/esm/resources/google_geocoders.js +1 -1
  121. package/lib/esm/resources/imports.js +1 -1
  122. package/lib/esm/resources/in_stock_subscriptions.js +1 -1
  123. package/lib/esm/resources/inventory_models.js +1 -1
  124. package/lib/esm/resources/inventory_return_locations.js +1 -1
  125. package/lib/esm/resources/inventory_stock_locations.js +1 -1
  126. package/lib/esm/resources/klarna_gateways.js +1 -1
  127. package/lib/esm/resources/klarna_payments.js +1 -1
  128. package/lib/esm/resources/line_item_options.js +1 -1
  129. package/lib/esm/resources/line_items.d.ts +12 -4
  130. package/lib/esm/resources/line_items.js +4 -1
  131. package/lib/esm/resources/manual_gateways.js +1 -1
  132. package/lib/esm/resources/manual_tax_calculators.js +1 -1
  133. package/lib/esm/resources/markets.d.ts +1 -1
  134. package/lib/esm/resources/markets.js +1 -1
  135. package/lib/esm/resources/merchants.js +1 -1
  136. package/lib/esm/resources/order_amount_promotion_rules.js +1 -1
  137. package/lib/esm/resources/order_copies.js +1 -1
  138. package/lib/esm/resources/order_factories.js +1 -1
  139. package/lib/esm/resources/order_subscription_items.js +1 -1
  140. package/lib/esm/resources/order_subscriptions.d.ts +1 -4
  141. package/lib/esm/resources/order_subscriptions.js +1 -1
  142. package/lib/esm/resources/order_validation_rules.js +1 -1
  143. package/lib/esm/resources/orders.d.ts +14 -1
  144. package/lib/esm/resources/orders.js +11 -1
  145. package/lib/esm/resources/organization.js +1 -1
  146. package/lib/esm/resources/packages.js +1 -1
  147. package/lib/esm/resources/parcel_line_items.d.ts +0 -8
  148. package/lib/esm/resources/parcel_line_items.js +1 -1
  149. package/lib/esm/resources/parcels.js +1 -1
  150. package/lib/esm/resources/payment_gateways.js +1 -1
  151. package/lib/esm/resources/payment_methods.d.ts +8 -5
  152. package/lib/esm/resources/payment_methods.js +1 -1
  153. package/lib/esm/resources/payment_options.js +1 -1
  154. package/lib/esm/resources/paypal_gateways.js +1 -1
  155. package/lib/esm/resources/paypal_payments.js +1 -1
  156. package/lib/esm/resources/percentage_discount_promotions.d.ts +4 -14
  157. package/lib/esm/resources/percentage_discount_promotions.js +5 -5
  158. package/lib/esm/resources/price_frequency_tiers.js +1 -1
  159. package/lib/esm/resources/price_lists.js +1 -1
  160. package/lib/esm/resources/price_tiers.js +1 -1
  161. package/lib/esm/resources/price_volume_tiers.js +1 -1
  162. package/lib/esm/resources/prices.js +1 -1
  163. package/lib/esm/resources/promotion_rules.js +1 -1
  164. package/lib/esm/resources/promotions.d.ts +3 -3
  165. package/lib/esm/resources/promotions.js +5 -5
  166. package/lib/esm/resources/recurring_order_copies.js +1 -1
  167. package/lib/esm/resources/refunds.js +1 -1
  168. package/lib/esm/resources/reserved_stocks.js +1 -1
  169. package/lib/esm/resources/resource_errors.d.ts +22 -0
  170. package/lib/esm/resources/resource_errors.js +14 -0
  171. package/lib/esm/resources/return_line_items.js +1 -1
  172. package/lib/esm/resources/returns.js +1 -1
  173. package/lib/esm/resources/satispay_gateways.js +1 -1
  174. package/lib/esm/resources/satispay_payments.js +1 -1
  175. package/lib/esm/resources/shipments.d.ts +0 -4
  176. package/lib/esm/resources/shipments.js +1 -1
  177. package/lib/esm/resources/shipping_categories.js +1 -1
  178. package/lib/esm/resources/shipping_method_tiers.js +1 -1
  179. package/lib/esm/resources/shipping_methods.d.ts +9 -5
  180. package/lib/esm/resources/shipping_methods.js +4 -1
  181. package/lib/esm/resources/shipping_weight_tiers.js +1 -1
  182. package/lib/esm/resources/shipping_zones.js +1 -1
  183. package/lib/esm/resources/sku_list_items.js +1 -1
  184. package/lib/esm/resources/sku_list_promotion_rules.js +1 -1
  185. package/lib/esm/resources/sku_lists.js +1 -1
  186. package/lib/esm/resources/sku_options.js +1 -1
  187. package/lib/esm/resources/skus.js +1 -1
  188. package/lib/esm/resources/stock_items.js +1 -1
  189. package/lib/esm/resources/stock_line_items.js +1 -1
  190. package/lib/esm/resources/stock_locations.js +1 -1
  191. package/lib/esm/resources/stock_reservations.js +1 -1
  192. package/lib/esm/resources/stock_transfers.d.ts +1 -1
  193. package/lib/esm/resources/stock_transfers.js +1 -1
  194. package/lib/esm/resources/stripe_gateways.js +1 -1
  195. package/lib/esm/resources/stripe_payments.d.ts +4 -1
  196. package/lib/esm/resources/stripe_payments.js +1 -1
  197. package/lib/esm/resources/subscription_models.js +1 -1
  198. package/lib/esm/resources/tags.js +1 -1
  199. package/lib/esm/resources/tax_calculators.js +1 -1
  200. package/lib/esm/resources/tax_categories.js +1 -1
  201. package/lib/esm/resources/tax_rules.js +1 -1
  202. package/lib/esm/resources/taxjar_accounts.js +1 -1
  203. package/lib/esm/resources/transactions.js +1 -1
  204. package/lib/esm/resources/versions.js +1 -1
  205. package/lib/esm/resources/voids.js +1 -1
  206. package/lib/esm/resources/webhooks.d.ts +3 -3
  207. package/lib/esm/resources/webhooks.js +4 -4
  208. package/lib/esm/resources/wire_transfers.js +1 -1
  209. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  210. package/lib/tsconfig.tsbuildinfo +1 -1
  211. package/package.json +16 -16
@@ -31,14 +31,14 @@ class ExternalPromotions extends resource_1.ApiResource {
31
31
  const _externalPromotionId = externalPromotionId.id || externalPromotionId;
32
32
  return this.resources.fetch({ type: 'custom_promotion_rules' }, `external_promotions/${_externalPromotionId}/custom_promotion_rule`, params, options);
33
33
  }
34
- async coupons(externalPromotionId, params, options) {
35
- const _externalPromotionId = externalPromotionId.id || externalPromotionId;
36
- return this.resources.fetch({ type: 'coupons' }, `external_promotions/${_externalPromotionId}/coupons`, params, options);
37
- }
38
34
  async sku_list(externalPromotionId, params, options) {
39
35
  const _externalPromotionId = externalPromotionId.id || externalPromotionId;
40
36
  return this.resources.fetch({ type: 'sku_lists' }, `external_promotions/${_externalPromotionId}/sku_list`, params, options);
41
37
  }
38
+ async coupons(externalPromotionId, params, options) {
39
+ const _externalPromotionId = externalPromotionId.id || externalPromotionId;
40
+ return this.resources.fetch({ type: 'coupons' }, `external_promotions/${_externalPromotionId}/coupons`, params, options);
41
+ }
42
42
  async attachments(externalPromotionId, params, options) {
43
43
  const _externalPromotionId = externalPromotionId.id || externalPromotionId;
44
44
  return this.resources.fetch({ type: 'attachments' }, `external_promotions/${_externalPromotionId}/attachments`, params, options);
@@ -65,6 +65,9 @@ class ExternalPromotions extends resource_1.ApiResource {
65
65
  async _enable(id, params, options) {
66
66
  return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ExternalPromotions.TYPE, _enable: true }, params, options);
67
67
  }
68
+ async _reset_circuit(id, params, options) {
69
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ExternalPromotions.TYPE, _reset_circuit: true }, params, options);
70
+ }
68
71
  isExternalPromotion(resource) {
69
72
  return resource.type && (resource.type === ExternalPromotions.TYPE);
70
73
  }
@@ -12,6 +12,8 @@ interface ExternalTaxCalculator extends Resource {
12
12
  readonly type: ExternalTaxCalculatorType;
13
13
  name: string;
14
14
  tax_calculator_url: string;
15
+ circuit_state?: string | null;
16
+ circuit_failure_count?: number | null;
15
17
  shared_secret: string;
16
18
  markets?: Market[] | null;
17
19
  attachments?: Attachment[] | null;
@@ -24,6 +26,7 @@ interface ExternalTaxCalculatorCreate extends ResourceCreate {
24
26
  interface ExternalTaxCalculatorUpdate extends ResourceUpdate {
25
27
  name?: string | null;
26
28
  tax_calculator_url?: string | null;
29
+ _reset_circuit?: boolean | null;
27
30
  }
28
31
  declare class ExternalTaxCalculators extends ApiResource<ExternalTaxCalculator> {
29
32
  static readonly TYPE: ExternalTaxCalculatorType;
@@ -33,6 +36,7 @@ declare class ExternalTaxCalculators extends ApiResource<ExternalTaxCalculator>
33
36
  markets(externalTaxCalculatorId: string | ExternalTaxCalculator, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
34
37
  attachments(externalTaxCalculatorId: string | ExternalTaxCalculator, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
35
38
  versions(externalTaxCalculatorId: string | ExternalTaxCalculator, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
39
+ _reset_circuit(id: string | ExternalTaxCalculator, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalTaxCalculator>;
36
40
  isExternalTaxCalculator(resource: any): resource is ExternalTaxCalculator;
37
41
  relationship(id: string | ResourceId | null): ExternalTaxCalculatorRel;
38
42
  type(): ExternalTaxCalculatorType;
@@ -23,6 +23,9 @@ class ExternalTaxCalculators extends resource_1.ApiResource {
23
23
  const _externalTaxCalculatorId = externalTaxCalculatorId.id || externalTaxCalculatorId;
24
24
  return this.resources.fetch({ type: 'versions' }, `external_tax_calculators/${_externalTaxCalculatorId}/versions`, params, options);
25
25
  }
26
+ async _reset_circuit(id, params, options) {
27
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ExternalTaxCalculators.TYPE, _reset_circuit: true }, params, options);
28
+ }
26
29
  isExternalTaxCalculator(resource) {
27
30
  return resource.type && (resource.type === ExternalTaxCalculators.TYPE);
28
31
  }
@@ -2,13 +2,13 @@ import { ApiResource } from '../resource';
2
2
  import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Market, MarketType } from './markets';
5
- import type { PromotionRule, PromotionRuleType } from './promotion_rules';
5
+ import type { PromotionRule } 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
9
  import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
10
- import type { Coupon, CouponType } from './coupons';
11
10
  import type { SkuList, SkuListType } from './sku_lists';
11
+ import type { Coupon } from './coupons';
12
12
  import type { Attachment } from './attachments';
13
13
  import type { Event } from './events';
14
14
  import type { Tag, TagType } from './tags';
@@ -21,9 +21,6 @@ type FixedAmountPromotionRel = ResourceRel & {
21
21
  type MarketRel = ResourceRel & {
22
22
  type: MarketType;
23
23
  };
24
- type PromotionRuleRel = ResourceRel & {
25
- type: PromotionRuleType;
26
- };
27
24
  type OrderAmountPromotionRuleRel = ResourceRel & {
28
25
  type: OrderAmountPromotionRuleType;
29
26
  };
@@ -36,9 +33,6 @@ type CouponCodesPromotionRuleRel = ResourceRel & {
36
33
  type CustomPromotionRuleRel = ResourceRel & {
37
34
  type: CustomPromotionRuleType;
38
35
  };
39
- type CouponRel = ResourceRel & {
40
- type: CouponType;
41
- };
42
36
  type SkuListRel = ResourceRel & {
43
37
  type: SkuListType;
44
38
  };
@@ -66,8 +60,8 @@ interface FixedAmountPromotion extends Resource {
66
60
  sku_list_promotion_rule?: SkuListPromotionRule | null;
67
61
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
68
62
  custom_promotion_rule?: CustomPromotionRule | null;
69
- coupons?: Coupon[] | null;
70
63
  sku_list?: SkuList | null;
64
+ coupons?: Coupon[] | null;
71
65
  attachments?: Attachment[] | null;
72
66
  events?: Event[] | null;
73
67
  tags?: Tag[] | null;
@@ -86,12 +80,10 @@ interface FixedAmountPromotionCreate extends ResourceCreate {
86
80
  _enable?: boolean | null;
87
81
  fixed_amount_cents: number;
88
82
  market?: MarketRel | null;
89
- promotion_rules?: PromotionRuleRel[] | null;
90
83
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
91
84
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
92
85
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
93
86
  custom_promotion_rule?: CustomPromotionRuleRel | null;
94
- coupons?: CouponRel[] | null;
95
87
  sku_list?: SkuListRel | null;
96
88
  tags?: TagRel[] | null;
97
89
  }
@@ -107,12 +99,10 @@ interface FixedAmountPromotionUpdate extends ResourceUpdate {
107
99
  _enable?: boolean | null;
108
100
  fixed_amount_cents?: number | null;
109
101
  market?: MarketRel | null;
110
- promotion_rules?: PromotionRuleRel[] | null;
111
102
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
112
103
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
113
104
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
114
105
  custom_promotion_rule?: CustomPromotionRuleRel | null;
115
- coupons?: CouponRel[] | null;
116
106
  sku_list?: SkuListRel | null;
117
107
  tags?: TagRel[] | null;
118
108
  }
@@ -126,8 +116,8 @@ declare class FixedAmountPromotions extends ApiResource<FixedAmountPromotion> {
126
116
  sku_list_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
127
117
  coupon_codes_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
128
118
  custom_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
129
- coupons(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
130
119
  sku_list(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
120
+ coupons(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
131
121
  attachments(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
132
122
  events(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
133
123
  tags(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -31,14 +31,14 @@ class FixedAmountPromotions extends resource_1.ApiResource {
31
31
  const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
32
32
  return this.resources.fetch({ type: 'custom_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/custom_promotion_rule`, params, options);
33
33
  }
34
- async coupons(fixedAmountPromotionId, params, options) {
35
- const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
36
- return this.resources.fetch({ type: 'coupons' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupons`, params, options);
37
- }
38
34
  async sku_list(fixedAmountPromotionId, params, options) {
39
35
  const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
40
36
  return this.resources.fetch({ type: 'sku_lists' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/sku_list`, params, options);
41
37
  }
38
+ async coupons(fixedAmountPromotionId, params, options) {
39
+ const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
40
+ return this.resources.fetch({ type: 'coupons' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupons`, params, options);
41
+ }
42
42
  async attachments(fixedAmountPromotionId, params, options) {
43
43
  const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
44
44
  return this.resources.fetch({ type: 'attachments' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/attachments`, params, options);
@@ -2,13 +2,13 @@ import { ApiResource } from '../resource';
2
2
  import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Market, MarketType } from './markets';
5
- import type { PromotionRule, PromotionRuleType } from './promotion_rules';
5
+ import type { PromotionRule } 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
9
  import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
10
- import type { Coupon, CouponType } from './coupons';
11
10
  import type { SkuList, SkuListType } from './sku_lists';
11
+ import type { Coupon } from './coupons';
12
12
  import type { Attachment } from './attachments';
13
13
  import type { Event } from './events';
14
14
  import type { Tag, TagType } from './tags';
@@ -21,9 +21,6 @@ type FixedPricePromotionRel = ResourceRel & {
21
21
  type MarketRel = ResourceRel & {
22
22
  type: MarketType;
23
23
  };
24
- type PromotionRuleRel = ResourceRel & {
25
- type: PromotionRuleType;
26
- };
27
24
  type OrderAmountPromotionRuleRel = ResourceRel & {
28
25
  type: OrderAmountPromotionRuleType;
29
26
  };
@@ -36,9 +33,6 @@ type CouponCodesPromotionRuleRel = ResourceRel & {
36
33
  type CustomPromotionRuleRel = ResourceRel & {
37
34
  type: CustomPromotionRuleType;
38
35
  };
39
- type CouponRel = ResourceRel & {
40
- type: CouponType;
41
- };
42
36
  type SkuListRel = ResourceRel & {
43
37
  type: SkuListType;
44
38
  };
@@ -66,8 +60,8 @@ interface FixedPricePromotion extends Resource {
66
60
  sku_list_promotion_rule?: SkuListPromotionRule | null;
67
61
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
68
62
  custom_promotion_rule?: CustomPromotionRule | null;
69
- coupons?: Coupon[] | null;
70
63
  sku_list?: SkuList | null;
64
+ coupons?: Coupon[] | null;
71
65
  attachments?: Attachment[] | null;
72
66
  events?: Event[] | null;
73
67
  tags?: Tag[] | null;
@@ -86,12 +80,10 @@ interface FixedPricePromotionCreate extends ResourceCreate {
86
80
  _enable?: boolean | null;
87
81
  fixed_amount_cents: number;
88
82
  market?: MarketRel | null;
89
- promotion_rules?: PromotionRuleRel[] | null;
90
83
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
91
84
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
92
85
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
93
86
  custom_promotion_rule?: CustomPromotionRuleRel | null;
94
- coupons?: CouponRel[] | null;
95
87
  sku_list: SkuListRel;
96
88
  tags?: TagRel[] | null;
97
89
  }
@@ -107,12 +99,10 @@ interface FixedPricePromotionUpdate extends ResourceUpdate {
107
99
  _enable?: boolean | null;
108
100
  fixed_amount_cents?: number | null;
109
101
  market?: MarketRel | null;
110
- promotion_rules?: PromotionRuleRel[] | null;
111
102
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
112
103
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
113
104
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
114
105
  custom_promotion_rule?: CustomPromotionRuleRel | null;
115
- coupons?: CouponRel[] | null;
116
106
  sku_list?: SkuListRel | null;
117
107
  tags?: TagRel[] | null;
118
108
  }
@@ -126,8 +116,8 @@ declare class FixedPricePromotions extends ApiResource<FixedPricePromotion> {
126
116
  sku_list_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
127
117
  coupon_codes_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
128
118
  custom_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
129
- coupons(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
130
119
  sku_list(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
120
+ coupons(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
131
121
  attachments(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
132
122
  events(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
133
123
  tags(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -31,14 +31,14 @@ class FixedPricePromotions extends resource_1.ApiResource {
31
31
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
32
32
  return this.resources.fetch({ type: 'custom_promotion_rules' }, `fixed_price_promotions/${_fixedPricePromotionId}/custom_promotion_rule`, params, options);
33
33
  }
34
- async coupons(fixedPricePromotionId, params, options) {
35
- const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
36
- return this.resources.fetch({ type: 'coupons' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupons`, params, options);
37
- }
38
34
  async sku_list(fixedPricePromotionId, params, options) {
39
35
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
40
36
  return this.resources.fetch({ type: 'sku_lists' }, `fixed_price_promotions/${_fixedPricePromotionId}/sku_list`, params, options);
41
37
  }
38
+ async coupons(fixedPricePromotionId, params, options) {
39
+ const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
40
+ return this.resources.fetch({ type: 'coupons' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupons`, params, options);
41
+ }
42
42
  async attachments(fixedPricePromotionId, params, options) {
43
43
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
44
44
  return this.resources.fetch({ type: 'attachments' }, `fixed_price_promotions/${_fixedPricePromotionId}/attachments`, params, options);
@@ -2,13 +2,13 @@ import { ApiResource } from '../resource';
2
2
  import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Market, MarketType } from './markets';
5
- import type { PromotionRule, PromotionRuleType } from './promotion_rules';
5
+ import type { PromotionRule } 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
9
  import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
10
- import type { Coupon, CouponType } from './coupons';
11
10
  import type { SkuList, SkuListType } from './sku_lists';
11
+ import type { Coupon } from './coupons';
12
12
  import type { Attachment } from './attachments';
13
13
  import type { Event } from './events';
14
14
  import type { Tag, TagType } from './tags';
@@ -21,9 +21,6 @@ type FreeGiftPromotionRel = ResourceRel & {
21
21
  type MarketRel = ResourceRel & {
22
22
  type: MarketType;
23
23
  };
24
- type PromotionRuleRel = ResourceRel & {
25
- type: PromotionRuleType;
26
- };
27
24
  type OrderAmountPromotionRuleRel = ResourceRel & {
28
25
  type: OrderAmountPromotionRuleType;
29
26
  };
@@ -36,9 +33,6 @@ type CouponCodesPromotionRuleRel = ResourceRel & {
36
33
  type CustomPromotionRuleRel = ResourceRel & {
37
34
  type: CustomPromotionRuleType;
38
35
  };
39
- type CouponRel = ResourceRel & {
40
- type: CouponType;
41
- };
42
36
  type SkuListRel = ResourceRel & {
43
37
  type: SkuListType;
44
38
  };
@@ -64,8 +58,8 @@ interface FreeGiftPromotion extends Resource {
64
58
  sku_list_promotion_rule?: SkuListPromotionRule | null;
65
59
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
66
60
  custom_promotion_rule?: CustomPromotionRule | null;
67
- coupons?: Coupon[] | null;
68
61
  sku_list?: SkuList | null;
62
+ coupons?: Coupon[] | null;
69
63
  attachments?: Attachment[] | null;
70
64
  events?: Event[] | null;
71
65
  tags?: Tag[] | null;
@@ -84,12 +78,10 @@ interface FreeGiftPromotionCreate extends ResourceCreate {
84
78
  _enable?: boolean | null;
85
79
  max_quantity?: number | null;
86
80
  market?: MarketRel | null;
87
- promotion_rules?: PromotionRuleRel[] | null;
88
81
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
89
82
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
90
83
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
91
84
  custom_promotion_rule?: CustomPromotionRuleRel | null;
92
- coupons?: CouponRel[] | null;
93
85
  sku_list: SkuListRel;
94
86
  tags?: TagRel[] | null;
95
87
  }
@@ -105,12 +97,10 @@ interface FreeGiftPromotionUpdate extends ResourceUpdate {
105
97
  _enable?: boolean | null;
106
98
  max_quantity?: number | null;
107
99
  market?: MarketRel | null;
108
- promotion_rules?: PromotionRuleRel[] | null;
109
100
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
110
101
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
111
102
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
112
103
  custom_promotion_rule?: CustomPromotionRuleRel | null;
113
- coupons?: CouponRel[] | null;
114
104
  sku_list?: SkuListRel | null;
115
105
  tags?: TagRel[] | null;
116
106
  }
@@ -124,8 +114,8 @@ declare class FreeGiftPromotions extends ApiResource<FreeGiftPromotion> {
124
114
  sku_list_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
125
115
  coupon_codes_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
126
116
  custom_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
127
- coupons(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
128
117
  sku_list(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
118
+ coupons(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
129
119
  attachments(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
130
120
  events(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
131
121
  tags(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -31,14 +31,14 @@ class FreeGiftPromotions extends resource_1.ApiResource {
31
31
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
32
32
  return this.resources.fetch({ type: 'custom_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/custom_promotion_rule`, params, options);
33
33
  }
34
- async coupons(freeGiftPromotionId, params, options) {
35
- const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
36
- return this.resources.fetch({ type: 'coupons' }, `free_gift_promotions/${_freeGiftPromotionId}/coupons`, params, options);
37
- }
38
34
  async sku_list(freeGiftPromotionId, params, options) {
39
35
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
40
36
  return this.resources.fetch({ type: 'sku_lists' }, `free_gift_promotions/${_freeGiftPromotionId}/sku_list`, params, options);
41
37
  }
38
+ async coupons(freeGiftPromotionId, params, options) {
39
+ const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
40
+ return this.resources.fetch({ type: 'coupons' }, `free_gift_promotions/${_freeGiftPromotionId}/coupons`, params, options);
41
+ }
42
42
  async attachments(freeGiftPromotionId, params, options) {
43
43
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
44
44
  return this.resources.fetch({ type: 'attachments' }, `free_gift_promotions/${_freeGiftPromotionId}/attachments`, params, options);
@@ -2,13 +2,13 @@ import { ApiResource } from '../resource';
2
2
  import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Market, MarketType } from './markets';
5
- import type { PromotionRule, PromotionRuleType } from './promotion_rules';
5
+ import type { PromotionRule } 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
9
  import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
10
- import type { Coupon, CouponType } from './coupons';
11
- import type { SkuList } from './sku_lists';
10
+ import type { SkuList, SkuListType } from './sku_lists';
11
+ import type { Coupon } from './coupons';
12
12
  import type { Attachment } from './attachments';
13
13
  import type { Event } from './events';
14
14
  import type { Tag, TagType } from './tags';
@@ -20,9 +20,6 @@ type FreeShippingPromotionRel = ResourceRel & {
20
20
  type MarketRel = ResourceRel & {
21
21
  type: MarketType;
22
22
  };
23
- type PromotionRuleRel = ResourceRel & {
24
- type: PromotionRuleType;
25
- };
26
23
  type OrderAmountPromotionRuleRel = ResourceRel & {
27
24
  type: OrderAmountPromotionRuleType;
28
25
  };
@@ -35,8 +32,8 @@ type CouponCodesPromotionRuleRel = ResourceRel & {
35
32
  type CustomPromotionRuleRel = ResourceRel & {
36
33
  type: CustomPromotionRuleType;
37
34
  };
38
- type CouponRel = ResourceRel & {
39
- type: CouponType;
35
+ type SkuListRel = ResourceRel & {
36
+ type: SkuListType;
40
37
  };
41
38
  type TagRel = ResourceRel & {
42
39
  type: TagType;
@@ -59,8 +56,8 @@ interface FreeShippingPromotion extends Resource {
59
56
  sku_list_promotion_rule?: SkuListPromotionRule | null;
60
57
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
61
58
  custom_promotion_rule?: CustomPromotionRule | null;
62
- coupons?: Coupon[] | null;
63
59
  sku_list?: SkuList | null;
60
+ coupons?: Coupon[] | null;
64
61
  attachments?: Attachment[] | null;
65
62
  events?: Event[] | null;
66
63
  tags?: Tag[] | null;
@@ -77,12 +74,11 @@ interface FreeShippingPromotionCreate extends ResourceCreate {
77
74
  _disable?: boolean | null;
78
75
  _enable?: boolean | null;
79
76
  market?: MarketRel | null;
80
- promotion_rules?: PromotionRuleRel[] | null;
81
77
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
82
78
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
83
79
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
84
80
  custom_promotion_rule?: CustomPromotionRuleRel | null;
85
- coupons?: CouponRel[] | null;
81
+ sku_list?: SkuListRel | null;
86
82
  tags?: TagRel[] | null;
87
83
  }
88
84
  interface FreeShippingPromotionUpdate extends ResourceUpdate {
@@ -96,12 +92,11 @@ interface FreeShippingPromotionUpdate extends ResourceUpdate {
96
92
  _disable?: boolean | null;
97
93
  _enable?: boolean | null;
98
94
  market?: MarketRel | null;
99
- promotion_rules?: PromotionRuleRel[] | null;
100
95
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
101
96
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
102
97
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
103
98
  custom_promotion_rule?: CustomPromotionRuleRel | null;
104
- coupons?: CouponRel[] | null;
99
+ sku_list?: SkuListRel | null;
105
100
  tags?: TagRel[] | null;
106
101
  }
107
102
  declare class FreeShippingPromotions extends ApiResource<FreeShippingPromotion> {
@@ -114,8 +109,8 @@ declare class FreeShippingPromotions extends ApiResource<FreeShippingPromotion>
114
109
  sku_list_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
115
110
  coupon_codes_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
116
111
  custom_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
117
- coupons(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
118
112
  sku_list(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
113
+ coupons(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
119
114
  attachments(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
120
115
  events(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
121
116
  tags(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -31,14 +31,14 @@ class FreeShippingPromotions extends resource_1.ApiResource {
31
31
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
32
32
  return this.resources.fetch({ type: 'custom_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/custom_promotion_rule`, params, options);
33
33
  }
34
- async coupons(freeShippingPromotionId, params, options) {
35
- const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
36
- return this.resources.fetch({ type: 'coupons' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupons`, params, options);
37
- }
38
34
  async sku_list(freeShippingPromotionId, params, options) {
39
35
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
40
36
  return this.resources.fetch({ type: 'sku_lists' }, `free_shipping_promotions/${_freeShippingPromotionId}/sku_list`, params, options);
41
37
  }
38
+ async coupons(freeShippingPromotionId, params, options) {
39
+ const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
40
+ return this.resources.fetch({ type: 'coupons' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupons`, params, options);
41
+ }
42
42
  async attachments(freeShippingPromotionId, params, options) {
43
43
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
44
44
  return this.resources.fetch({ type: 'attachments' }, `free_shipping_promotions/${_freeShippingPromotionId}/attachments`, params, options);
@@ -37,6 +37,7 @@ interface GiftCard extends Resource {
37
37
  balance_log: Array<Record<string, any>>;
38
38
  single_use?: boolean | null;
39
39
  rechargeable?: boolean | null;
40
+ distribute_discount?: boolean | null;
40
41
  image_url?: string | null;
41
42
  expires_at?: string | null;
42
43
  recipient_email?: string | null;
@@ -54,6 +55,7 @@ interface GiftCardCreate extends ResourceCreate {
54
55
  balance_max_cents?: string | null;
55
56
  single_use?: boolean | null;
56
57
  rechargeable?: boolean | null;
58
+ distribute_discount?: boolean | null;
57
59
  image_url?: string | null;
58
60
  expires_at?: string | null;
59
61
  recipient_email?: string | null;
@@ -67,6 +69,7 @@ interface GiftCardUpdate extends ResourceUpdate {
67
69
  balance_max_cents?: string | null;
68
70
  single_use?: boolean | null;
69
71
  rechargeable?: boolean | null;
72
+ distribute_discount?: boolean | null;
70
73
  image_url?: string | null;
71
74
  expires_at?: string | null;
72
75
  recipient_email?: string | null;
@@ -92,16 +92,18 @@ interface LineItem extends Resource {
92
92
  item_type?: 'skus' | 'bundles' | 'shipments' | 'payment_methods' | 'adjustments' | 'gift_cards' | 'percentage_discount_promotions' | 'free_shipping_promotions' | 'free_gift_promotions' | 'fixed_price_promotions' | 'external_promotions' | 'fixed_amount_promotions' | null;
93
93
  frequency?: string | null;
94
94
  coupon_code?: string | null;
95
+ circuit_state?: string | null;
96
+ circuit_failure_count?: number | null;
95
97
  order?: Order | null;
96
98
  item?: Adjustment | Bundle | ExternalPromotion | FixedAmountPromotion | FreeShippingPromotion | GiftCard | PaymentMethod | PercentageDiscountPromotion | Shipment | Sku | null;
97
99
  sku?: Sku | null;
98
100
  bundle?: Bundle | null;
101
+ adjustment?: Adjustment | null;
102
+ gift_card?: GiftCard | null;
103
+ shipment?: Shipment | null;
104
+ payment_method?: PaymentMethod | null;
99
105
  line_item_options?: LineItemOption[] | null;
100
106
  return_line_items?: ReturnLineItem[] | null;
101
- /**
102
- * @deprecated This field should not be used as it may be removed in the future without notice
103
- */
104
- shipment_line_items?: object[];
105
107
  stock_reservations?: StockReservation[] | null;
106
108
  stock_line_items?: StockLineItem[] | null;
107
109
  stock_transfers?: StockTransfer[] | null;
@@ -125,6 +127,10 @@ interface LineItemCreate extends ResourceCreate {
125
127
  item?: AdjustmentRel | BundleRel | ExternalPromotionRel | FixedAmountPromotionRel | FreeShippingPromotionRel | GiftCardRel | PaymentMethodRel | PercentageDiscountPromotionRel | ShipmentRel | SkuRel | null;
126
128
  sku?: SkuRel | null;
127
129
  bundle?: BundleRel | null;
130
+ adjustment?: AdjustmentRel | null;
131
+ gift_card?: GiftCardRel | null;
132
+ shipment?: ShipmentRel | null;
133
+ payment_method?: PaymentMethodRel | null;
128
134
  tags?: TagRel[] | null;
129
135
  }
130
136
  interface LineItemUpdate extends ResourceUpdate {
@@ -137,6 +143,7 @@ interface LineItemUpdate extends ResourceUpdate {
137
143
  name?: string | null;
138
144
  image_url?: string | null;
139
145
  frequency?: string | null;
146
+ _reset_circuit?: boolean | null;
140
147
  tags?: TagRel[] | null;
141
148
  }
142
149
  declare class LineItems extends ApiResource<LineItem> {
@@ -154,6 +161,7 @@ declare class LineItems extends ApiResource<LineItem> {
154
161
  tags(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
155
162
  _external_price(id: string | LineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
156
163
  _reserve_stock(id: string | LineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
164
+ _reset_circuit(id: string | LineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
157
165
  isLineItem(resource: any): resource is LineItem;
158
166
  relationship(id: string | ResourceId | null): LineItemRel;
159
167
  type(): LineItemType;
@@ -49,6 +49,9 @@ class LineItems extends resource_1.ApiResource {
49
49
  async _reserve_stock(id, params, options) {
50
50
  return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: LineItems.TYPE, _reserve_stock: true }, params, options);
51
51
  }
52
+ async _reset_circuit(id, params, options) {
53
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: LineItems.TYPE, _reset_circuit: true }, params, options);
54
+ }
52
55
  isLineItem(resource) {
53
56
  return resource.type && (resource.type === LineItems.TYPE);
54
57
  }
@@ -40,9 +40,9 @@ interface Market extends Resource {
40
40
  checkout_url?: string | null;
41
41
  external_prices_url?: string | null;
42
42
  external_order_validation_url?: string | null;
43
- shared_secret: string;
44
43
  private?: boolean | null;
45
44
  disabled_at?: string | null;
45
+ shared_secret: string;
46
46
  merchant?: Merchant | null;
47
47
  price_list?: PriceList | null;
48
48
  inventory_model?: InventoryModel | null;
@@ -33,6 +33,7 @@ interface OrderSubscription extends Resource {
33
33
  customer_email?: string | null;
34
34
  starts_at?: string | null;
35
35
  expires_at?: string | null;
36
+ last_run_at?: string | null;
36
37
  next_run_at?: string | null;
37
38
  occurrencies?: number | null;
38
39
  errors_count?: number | null;
@@ -45,10 +46,6 @@ interface OrderSubscription extends Resource {
45
46
  customer_payment_source?: CustomerPaymentSource | null;
46
47
  order_subscription_items?: OrderSubscriptionItem[] | null;
47
48
  order_factories?: OrderFactory[] | null;
48
- /**
49
- * @deprecated This field should not be used as it may be removed in the future without notice
50
- */
51
- order_copies?: object[];
52
49
  recurring_order_copies?: RecurringOrderCopy[] | null;
53
50
  orders?: Order[] | null;
54
51
  events?: Event[] | null;