@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
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class CheckoutComGateways extends ApiResource {
3
+ static TYPE = 'checkout_com_gateways';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: CheckoutComGateways.TYPE }, params, options);
5
6
  }
@@ -31,5 +32,4 @@ class CheckoutComGateways extends ApiResource {
31
32
  return CheckoutComGateways.TYPE;
32
33
  }
33
34
  }
34
- CheckoutComGateways.TYPE = 'checkout_com_gateways';
35
35
  export default CheckoutComGateways;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class CheckoutComPayments extends ApiResource {
3
+ static TYPE = 'checkout_com_payments';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: CheckoutComPayments.TYPE }, params, options);
5
6
  }
@@ -37,5 +38,4 @@ class CheckoutComPayments extends ApiResource {
37
38
  return CheckoutComPayments.TYPE;
38
39
  }
39
40
  }
40
- CheckoutComPayments.TYPE = 'checkout_com_payments';
41
41
  export default CheckoutComPayments;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class Cleanups extends ApiResource {
3
+ static TYPE = 'cleanups';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: Cleanups.TYPE }, params, options);
5
6
  }
@@ -24,5 +25,4 @@ class Cleanups extends ApiResource {
24
25
  return Cleanups.TYPE;
25
26
  }
26
27
  }
27
- Cleanups.TYPE = 'cleanups';
28
28
  export default Cleanups;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class CouponCodesPromotionRules extends ApiResource {
3
+ static TYPE = 'coupon_codes_promotion_rules';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: CouponCodesPromotionRules.TYPE }, params, options);
5
6
  }
@@ -27,5 +28,4 @@ class CouponCodesPromotionRules extends ApiResource {
27
28
  return CouponCodesPromotionRules.TYPE;
28
29
  }
29
30
  }
30
- CouponCodesPromotionRules.TYPE = 'coupon_codes_promotion_rules';
31
31
  export default CouponCodesPromotionRules;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class CouponRecipients extends ApiResource {
3
+ static TYPE = 'coupon_recipients';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: CouponRecipients.TYPE }, params, options);
5
6
  }
@@ -31,5 +32,4 @@ class CouponRecipients extends ApiResource {
31
32
  return CouponRecipients.TYPE;
32
33
  }
33
34
  }
34
- CouponRecipients.TYPE = 'coupon_recipients';
35
35
  export default CouponRecipients;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class Coupons extends ApiResource {
3
+ static TYPE = 'coupons';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: Coupons.TYPE }, params, options);
5
6
  }
@@ -39,5 +40,4 @@ class Coupons extends ApiResource {
39
40
  return Coupons.TYPE;
40
41
  }
41
42
  }
42
- Coupons.TYPE = 'coupons';
43
43
  export default Coupons;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class CustomPromotionRules extends ApiResource {
3
+ static TYPE = 'custom_promotion_rules';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: CustomPromotionRules.TYPE }, params, options);
5
6
  }
@@ -23,5 +24,4 @@ class CustomPromotionRules extends ApiResource {
23
24
  return CustomPromotionRules.TYPE;
24
25
  }
25
26
  }
26
- CustomPromotionRules.TYPE = 'custom_promotion_rules';
27
27
  export default CustomPromotionRules;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class CustomerAddresses extends ApiResource {
3
+ static TYPE = 'customer_addresses';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: CustomerAddresses.TYPE }, params, options);
5
6
  }
@@ -35,5 +36,4 @@ class CustomerAddresses extends ApiResource {
35
36
  return CustomerAddresses.TYPE;
36
37
  }
37
38
  }
38
- CustomerAddresses.TYPE = 'customer_addresses';
39
39
  export default CustomerAddresses;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class CustomerGroups extends ApiResource {
3
+ static TYPE = 'customer_groups';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: CustomerGroups.TYPE }, params, options);
5
6
  }
@@ -35,5 +36,4 @@ class CustomerGroups extends ApiResource {
35
36
  return CustomerGroups.TYPE;
36
37
  }
37
38
  }
38
- CustomerGroups.TYPE = 'customer_groups';
39
39
  export default CustomerGroups;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class CustomerPasswordResets extends ApiResource {
3
+ static TYPE = 'customer_password_resets';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: CustomerPasswordResets.TYPE }, params, options);
5
6
  }
@@ -30,5 +31,4 @@ class CustomerPasswordResets extends ApiResource {
30
31
  return CustomerPasswordResets.TYPE;
31
32
  }
32
33
  }
33
- CustomerPasswordResets.TYPE = 'customer_password_resets';
34
34
  export default CustomerPasswordResets;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class CustomerPaymentSources extends ApiResource {
3
+ static TYPE = 'customer_payment_sources';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: CustomerPaymentSources.TYPE }, params, options);
5
6
  }
@@ -31,5 +32,4 @@ class CustomerPaymentSources extends ApiResource {
31
32
  return CustomerPaymentSources.TYPE;
32
33
  }
33
34
  }
34
- CustomerPaymentSources.TYPE = 'customer_payment_sources';
35
35
  export default CustomerPaymentSources;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class CustomerSubscriptions extends ApiResource {
3
+ static TYPE = 'customer_subscriptions';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: CustomerSubscriptions.TYPE }, params, options);
5
6
  }
@@ -31,5 +32,4 @@ class CustomerSubscriptions extends ApiResource {
31
32
  return CustomerSubscriptions.TYPE;
32
33
  }
33
34
  }
34
- CustomerSubscriptions.TYPE = 'customer_subscriptions';
35
35
  export default CustomerSubscriptions;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class Customers extends ApiResource {
3
+ static TYPE = 'customers';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: Customers.TYPE }, params, options);
5
6
  }
@@ -63,5 +64,4 @@ class Customers extends ApiResource {
63
64
  return Customers.TYPE;
64
65
  }
65
66
  }
66
- Customers.TYPE = 'customers';
67
67
  export default Customers;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class DeliveryLeadTimes extends ApiResource {
3
+ static TYPE = 'delivery_lead_times';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: DeliveryLeadTimes.TYPE }, params, options);
5
6
  }
@@ -35,5 +36,4 @@ class DeliveryLeadTimes extends ApiResource {
35
36
  return DeliveryLeadTimes.TYPE;
36
37
  }
37
38
  }
38
- DeliveryLeadTimes.TYPE = 'delivery_lead_times';
39
39
  export default DeliveryLeadTimes;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class EventCallbacks extends ApiResource {
3
+ static TYPE = 'event_callbacks';
3
4
  async webhook(eventCallbackId, params, options) {
4
5
  const _eventCallbackId = eventCallbackId.id || eventCallbackId;
5
6
  return this.resources.fetch({ type: 'webhooks' }, `event_callbacks/${_eventCallbackId}/webhook`, params, options);
@@ -14,5 +15,4 @@ class EventCallbacks extends ApiResource {
14
15
  return EventCallbacks.TYPE;
15
16
  }
16
17
  }
17
- EventCallbacks.TYPE = 'event_callbacks';
18
18
  export default EventCallbacks;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class Events extends ApiResource {
3
+ static TYPE = 'events';
3
4
  async last_event_callbacks(eventId, params, options) {
4
5
  const _eventId = eventId.id || eventId;
5
6
  return this.resources.fetch({ type: 'event_callbacks' }, `events/${_eventId}/last_event_callbacks`, params, options);
@@ -18,5 +19,4 @@ class Events extends ApiResource {
18
19
  return Events.TYPE;
19
20
  }
20
21
  }
21
- Events.TYPE = 'events';
22
22
  export default Events;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class Exports extends ApiResource {
3
+ static TYPE = 'exports';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: Exports.TYPE }, params, options);
5
6
  }
@@ -20,5 +21,4 @@ class Exports extends ApiResource {
20
21
  return Exports.TYPE;
21
22
  }
22
23
  }
23
- Exports.TYPE = 'exports';
24
24
  export default Exports;
@@ -11,12 +11,14 @@ type ExternalGatewayRel = ResourceRel & {
11
11
  interface ExternalGateway extends Resource {
12
12
  readonly type: ExternalGatewayType;
13
13
  name: string;
14
- shared_secret: string;
15
14
  authorize_url?: string | null;
16
15
  capture_url?: string | null;
17
16
  void_url?: string | null;
18
17
  refund_url?: string | null;
19
18
  token_url?: string | null;
19
+ circuit_state?: string | null;
20
+ circuit_failure_count?: number | null;
21
+ shared_secret: string;
20
22
  payment_methods?: PaymentMethod[] | null;
21
23
  versions?: Version[] | null;
22
24
  external_payments?: ExternalPayment[] | null;
@@ -36,6 +38,7 @@ interface ExternalGatewayUpdate extends ResourceUpdate {
36
38
  void_url?: string | null;
37
39
  refund_url?: string | null;
38
40
  token_url?: string | null;
41
+ _reset_circuit?: boolean | null;
39
42
  }
40
43
  declare class ExternalGateways extends ApiResource<ExternalGateway> {
41
44
  static readonly TYPE: ExternalGatewayType;
@@ -45,6 +48,7 @@ declare class ExternalGateways extends ApiResource<ExternalGateway> {
45
48
  payment_methods(externalGatewayId: string | ExternalGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
46
49
  versions(externalGatewayId: string | ExternalGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
47
50
  external_payments(externalGatewayId: string | ExternalGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ExternalPayment>>;
51
+ _reset_circuit(id: string | ExternalGateway, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalGateway>;
48
52
  isExternalGateway(resource: any): resource is ExternalGateway;
49
53
  relationship(id: string | ResourceId | null): ExternalGatewayRel;
50
54
  type(): ExternalGatewayType;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class ExternalGateways extends ApiResource {
3
+ static TYPE = 'external_gateways';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: ExternalGateways.TYPE }, params, options);
5
6
  }
@@ -21,6 +22,9 @@ class ExternalGateways extends ApiResource {
21
22
  const _externalGatewayId = externalGatewayId.id || externalGatewayId;
22
23
  return this.resources.fetch({ type: 'external_payments' }, `external_gateways/${_externalGatewayId}/external_payments`, params, options);
23
24
  }
25
+ async _reset_circuit(id, params, options) {
26
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ExternalGateways.TYPE, _reset_circuit: true }, params, options);
27
+ }
24
28
  isExternalGateway(resource) {
25
29
  return resource.type && (resource.type === ExternalGateways.TYPE);
26
30
  }
@@ -31,5 +35,4 @@ class ExternalGateways extends ApiResource {
31
35
  return ExternalGateways.TYPE;
32
36
  }
33
37
  }
34
- ExternalGateways.TYPE = 'external_gateways';
35
38
  export default ExternalGateways;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class ExternalPayments extends ApiResource {
3
+ static TYPE = 'external_payments';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: ExternalPayments.TYPE }, params, options);
5
6
  }
@@ -35,5 +36,4 @@ class ExternalPayments extends ApiResource {
35
36
  return ExternalPayments.TYPE;
36
37
  }
37
38
  }
38
- ExternalPayments.TYPE = 'external_payments';
39
39
  export default ExternalPayments;
@@ -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 ExternalPromotionRel = 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
  };
@@ -58,6 +52,8 @@ interface ExternalPromotion extends Resource {
58
52
  active?: boolean | null;
59
53
  disabled_at?: string | null;
60
54
  promotion_url: string;
55
+ circuit_state?: string | null;
56
+ circuit_failure_count?: number | null;
61
57
  shared_secret: string;
62
58
  market?: Market | null;
63
59
  promotion_rules?: PromotionRule[] | null;
@@ -65,8 +61,8 @@ interface ExternalPromotion extends Resource {
65
61
  sku_list_promotion_rule?: SkuListPromotionRule | null;
66
62
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
67
63
  custom_promotion_rule?: CustomPromotionRule | null;
68
- coupons?: Coupon[] | null;
69
64
  sku_list?: SkuList | null;
65
+ coupons?: Coupon[] | null;
70
66
  attachments?: Attachment[] | null;
71
67
  events?: Event[] | null;
72
68
  tags?: Tag[] | null;
@@ -85,12 +81,10 @@ interface ExternalPromotionCreate extends ResourceCreate {
85
81
  _enable?: boolean | null;
86
82
  promotion_url: string;
87
83
  market?: MarketRel | null;
88
- promotion_rules?: PromotionRuleRel[] | null;
89
84
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
90
85
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
91
86
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
92
87
  custom_promotion_rule?: CustomPromotionRuleRel | null;
93
- coupons?: CouponRel[] | null;
94
88
  sku_list?: SkuListRel | null;
95
89
  tags?: TagRel[] | null;
96
90
  }
@@ -105,13 +99,12 @@ interface ExternalPromotionUpdate extends ResourceUpdate {
105
99
  _disable?: boolean | null;
106
100
  _enable?: boolean | null;
107
101
  promotion_url?: string | null;
102
+ _reset_circuit?: boolean | null;
108
103
  market?: MarketRel | null;
109
- promotion_rules?: PromotionRuleRel[] | null;
110
104
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
111
105
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
112
106
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
113
107
  custom_promotion_rule?: CustomPromotionRuleRel | null;
114
- coupons?: CouponRel[] | null;
115
108
  sku_list?: SkuListRel | null;
116
109
  tags?: TagRel[] | null;
117
110
  }
@@ -125,8 +118,8 @@ declare class ExternalPromotions extends ApiResource<ExternalPromotion> {
125
118
  sku_list_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
126
119
  coupon_codes_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
127
120
  custom_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
128
- coupons(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
129
121
  sku_list(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
122
+ coupons(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
130
123
  attachments(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
131
124
  events(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
132
125
  tags(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -134,6 +127,7 @@ declare class ExternalPromotions extends ApiResource<ExternalPromotion> {
134
127
  skus(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
135
128
  _disable(id: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalPromotion>;
136
129
  _enable(id: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalPromotion>;
130
+ _reset_circuit(id: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalPromotion>;
137
131
  isExternalPromotion(resource: any): resource is ExternalPromotion;
138
132
  relationship(id: string | ResourceId | null): ExternalPromotionRel;
139
133
  type(): ExternalPromotionType;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class ExternalPromotions extends ApiResource {
3
+ static TYPE = 'external_promotions';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: ExternalPromotions.TYPE }, params, options);
5
6
  }
@@ -29,14 +30,14 @@ class ExternalPromotions extends ApiResource {
29
30
  const _externalPromotionId = externalPromotionId.id || externalPromotionId;
30
31
  return this.resources.fetch({ type: 'custom_promotion_rules' }, `external_promotions/${_externalPromotionId}/custom_promotion_rule`, params, options);
31
32
  }
32
- async coupons(externalPromotionId, params, options) {
33
- const _externalPromotionId = externalPromotionId.id || externalPromotionId;
34
- return this.resources.fetch({ type: 'coupons' }, `external_promotions/${_externalPromotionId}/coupons`, params, options);
35
- }
36
33
  async sku_list(externalPromotionId, params, options) {
37
34
  const _externalPromotionId = externalPromotionId.id || externalPromotionId;
38
35
  return this.resources.fetch({ type: 'sku_lists' }, `external_promotions/${_externalPromotionId}/sku_list`, params, options);
39
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
+ }
40
41
  async attachments(externalPromotionId, params, options) {
41
42
  const _externalPromotionId = externalPromotionId.id || externalPromotionId;
42
43
  return this.resources.fetch({ type: 'attachments' }, `external_promotions/${_externalPromotionId}/attachments`, params, options);
@@ -63,6 +64,9 @@ class ExternalPromotions extends ApiResource {
63
64
  async _enable(id, params, options) {
64
65
  return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ExternalPromotions.TYPE, _enable: true }, params, options);
65
66
  }
67
+ async _reset_circuit(id, params, options) {
68
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ExternalPromotions.TYPE, _reset_circuit: true }, params, options);
69
+ }
66
70
  isExternalPromotion(resource) {
67
71
  return resource.type && (resource.type === ExternalPromotions.TYPE);
68
72
  }
@@ -73,5 +77,4 @@ class ExternalPromotions extends ApiResource {
73
77
  return ExternalPromotions.TYPE;
74
78
  }
75
79
  }
76
- ExternalPromotions.TYPE = 'external_promotions';
77
80
  export default ExternalPromotions;
@@ -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;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class ExternalTaxCalculators extends ApiResource {
3
+ static TYPE = 'external_tax_calculators';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: ExternalTaxCalculators.TYPE }, params, options);
5
6
  }
@@ -21,6 +22,9 @@ class ExternalTaxCalculators extends ApiResource {
21
22
  const _externalTaxCalculatorId = externalTaxCalculatorId.id || externalTaxCalculatorId;
22
23
  return this.resources.fetch({ type: 'versions' }, `external_tax_calculators/${_externalTaxCalculatorId}/versions`, params, options);
23
24
  }
25
+ async _reset_circuit(id, params, options) {
26
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ExternalTaxCalculators.TYPE, _reset_circuit: true }, params, options);
27
+ }
24
28
  isExternalTaxCalculator(resource) {
25
29
  return resource.type && (resource.type === ExternalTaxCalculators.TYPE);
26
30
  }
@@ -31,5 +35,4 @@ class ExternalTaxCalculators extends ApiResource {
31
35
  return ExternalTaxCalculators.TYPE;
32
36
  }
33
37
  }
34
- ExternalTaxCalculators.TYPE = 'external_tax_calculators';
35
38
  export default ExternalTaxCalculators;
@@ -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>>;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class FixedAmountPromotions extends ApiResource {
3
+ static TYPE = 'fixed_amount_promotions';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: FixedAmountPromotions.TYPE }, params, options);
5
6
  }
@@ -29,14 +30,14 @@ class FixedAmountPromotions extends ApiResource {
29
30
  const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
30
31
  return this.resources.fetch({ type: 'custom_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/custom_promotion_rule`, params, options);
31
32
  }
32
- async coupons(fixedAmountPromotionId, params, options) {
33
- const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
34
- return this.resources.fetch({ type: 'coupons' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupons`, params, options);
35
- }
36
33
  async sku_list(fixedAmountPromotionId, params, options) {
37
34
  const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
38
35
  return this.resources.fetch({ type: 'sku_lists' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/sku_list`, params, options);
39
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
+ }
40
41
  async attachments(fixedAmountPromotionId, params, options) {
41
42
  const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
42
43
  return this.resources.fetch({ type: 'attachments' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/attachments`, params, options);
@@ -73,5 +74,4 @@ class FixedAmountPromotions extends ApiResource {
73
74
  return FixedAmountPromotions.TYPE;
74
75
  }
75
76
  }
76
- FixedAmountPromotions.TYPE = 'fixed_amount_promotions';
77
77
  export default FixedAmountPromotions;