@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
package/lib/cjs/api.d.ts CHANGED
@@ -91,6 +91,7 @@ export { default as Promotions } from './resources/promotions';
91
91
  export { default as RecurringOrderCopies } from './resources/recurring_order_copies';
92
92
  export { default as Refunds } from './resources/refunds';
93
93
  export { default as ReservedStocks } from './resources/reserved_stocks';
94
+ export { default as ResourceErrors } from './resources/resource_errors';
94
95
  export { default as ReturnLineItems } from './resources/return_line_items';
95
96
  export { default as Returns } from './resources/returns';
96
97
  export { default as SatispayGateways } from './resources/satispay_gateways';
@@ -124,8 +125,8 @@ export { default as Versions } from './resources/versions';
124
125
  export { default as Voids } from './resources/voids';
125
126
  export { default as Webhooks } from './resources/webhooks';
126
127
  export { default as WireTransfers } from './resources/wire_transfers';
127
- export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'payment_options' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'reserved_stocks' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'versions' | 'voids' | 'webhooks' | 'wire_transfers';
128
- export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "buy_x_pay_y_promotions", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "custom_promotion_rules", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "payment_options", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "reserved_stocks", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "versions", "voids", "webhooks", "wire_transfers"];
128
+ export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'payment_options' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'reserved_stocks' | 'resource_errors' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'versions' | 'voids' | 'webhooks' | 'wire_transfers';
129
+ export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "buy_x_pay_y_promotions", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "custom_promotion_rules", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "payment_options", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "reserved_stocks", "resource_errors", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "versions", "voids", "webhooks", "wire_transfers"];
129
130
  export declare const singletonList: readonly ["application", "organization"];
130
131
  export type RetrievableResourceType = ResourceTypeLock;
131
132
  export type RetrievableResource = Resource & {
package/lib/cjs/api.js CHANGED
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.InventoryModels = exports.InStockSubscriptions = exports.Imports = exports.GoogleGeocoders = exports.GiftCards = exports.GiftCardRecipients = exports.Geocoders = exports.FreeShippingPromotions = exports.FreeGiftPromotions = exports.FixedPricePromotions = exports.FixedAmountPromotions = exports.ExternalTaxCalculators = exports.ExternalPromotions = exports.ExternalPayments = exports.ExternalGateways = exports.Exports = exports.Events = exports.EventCallbacks = exports.DeliveryLeadTimes = exports.Customers = exports.CustomerSubscriptions = exports.CustomerPaymentSources = exports.CustomerPasswordResets = exports.CustomerGroups = exports.CustomerAddresses = exports.CustomPromotionRules = exports.Coupons = exports.CouponRecipients = exports.CouponCodesPromotionRules = exports.Cleanups = exports.CheckoutComPayments = exports.CheckoutComGateways = exports.CarrierAccounts = exports.Captures = exports.BuyXPayYPromotions = exports.Bundles = exports.BraintreePayments = exports.BraintreeGateways = exports.BingGeocoders = exports.BillingInfoValidationRules = exports.AxervePayments = exports.AxerveGateways = exports.AvalaraAccounts = exports.Authorizations = exports.Attachments = exports.Applications = exports.AdyenPayments = exports.AdyenGateways = exports.Adjustments = exports.Addresses = void 0;
7
- exports.SkuLists = exports.SkuListPromotionRules = exports.SkuListItems = exports.ShippingZones = exports.ShippingWeightTiers = exports.ShippingMethods = exports.ShippingMethodTiers = exports.ShippingCategories = exports.Shipments = exports.SatispayPayments = exports.SatispayGateways = exports.Returns = exports.ReturnLineItems = exports.ReservedStocks = exports.Refunds = exports.RecurringOrderCopies = exports.Promotions = exports.PromotionRules = exports.Prices = exports.PriceVolumeTiers = exports.PriceTiers = exports.PriceLists = exports.PriceFrequencyTiers = exports.PercentageDiscountPromotions = exports.PaypalPayments = exports.PaypalGateways = exports.PaymentOptions = exports.PaymentMethods = exports.PaymentGateways = exports.Parcels = exports.ParcelLineItems = exports.Packages = exports.Organizations = exports.Orders = exports.OrderValidationRules = exports.OrderSubscriptions = exports.OrderSubscriptionItems = exports.OrderFactories = exports.OrderCopies = exports.OrderAmountPromotionRules = exports.Merchants = exports.Markets = exports.ManualTaxCalculators = exports.ManualGateways = exports.LineItems = exports.LineItemOptions = exports.KlarnaPayments = exports.KlarnaGateways = exports.InventoryStockLocations = exports.InventoryReturnLocations = void 0;
8
- exports.singletonList = exports.resourceList = exports.WireTransfers = exports.Webhooks = exports.Voids = exports.Versions = exports.Transactions = exports.TaxjarAccounts = exports.TaxRules = exports.TaxCategories = exports.TaxCalculators = exports.Tags = exports.SubscriptionModels = exports.StripePayments = exports.StripeGateways = exports.StockTransfers = exports.StockReservations = exports.StockLocations = exports.StockLineItems = exports.StockItems = exports.Skus = exports.SkuOptions = void 0;
7
+ exports.SkuListPromotionRules = exports.SkuListItems = exports.ShippingZones = exports.ShippingWeightTiers = exports.ShippingMethods = exports.ShippingMethodTiers = exports.ShippingCategories = exports.Shipments = exports.SatispayPayments = exports.SatispayGateways = exports.Returns = exports.ReturnLineItems = exports.ResourceErrors = exports.ReservedStocks = exports.Refunds = exports.RecurringOrderCopies = exports.Promotions = exports.PromotionRules = exports.Prices = exports.PriceVolumeTiers = exports.PriceTiers = exports.PriceLists = exports.PriceFrequencyTiers = exports.PercentageDiscountPromotions = exports.PaypalPayments = exports.PaypalGateways = exports.PaymentOptions = exports.PaymentMethods = exports.PaymentGateways = exports.Parcels = exports.ParcelLineItems = exports.Packages = exports.Organizations = exports.Orders = exports.OrderValidationRules = exports.OrderSubscriptions = exports.OrderSubscriptionItems = exports.OrderFactories = exports.OrderCopies = exports.OrderAmountPromotionRules = exports.Merchants = exports.Markets = exports.ManualTaxCalculators = exports.ManualGateways = exports.LineItems = exports.LineItemOptions = exports.KlarnaPayments = exports.KlarnaGateways = exports.InventoryStockLocations = exports.InventoryReturnLocations = void 0;
8
+ exports.singletonList = exports.resourceList = exports.WireTransfers = exports.Webhooks = exports.Voids = exports.Versions = exports.Transactions = exports.TaxjarAccounts = exports.TaxRules = exports.TaxCategories = exports.TaxCalculators = exports.Tags = exports.SubscriptionModels = exports.StripePayments = exports.StripeGateways = exports.StockTransfers = exports.StockReservations = exports.StockLocations = exports.StockLineItems = exports.StockItems = exports.Skus = exports.SkuOptions = exports.SkuLists = void 0;
9
9
  // ##__API_RESOURCES_START__##
10
10
  // ##__API_RESOURCES_TEMPLATE:: export { default as ##__RESOURCE_CLASS__## } from './resources/##__RESOURCE_TYPE__##'
11
11
  /**
@@ -185,6 +185,8 @@ var refunds_1 = require("./resources/refunds");
185
185
  Object.defineProperty(exports, "Refunds", { enumerable: true, get: function () { return __importDefault(refunds_1).default; } });
186
186
  var reserved_stocks_1 = require("./resources/reserved_stocks");
187
187
  Object.defineProperty(exports, "ReservedStocks", { enumerable: true, get: function () { return __importDefault(reserved_stocks_1).default; } });
188
+ var resource_errors_1 = require("./resources/resource_errors");
189
+ Object.defineProperty(exports, "ResourceErrors", { enumerable: true, get: function () { return __importDefault(resource_errors_1).default; } });
188
190
  var return_line_items_1 = require("./resources/return_line_items");
189
191
  Object.defineProperty(exports, "ReturnLineItems", { enumerable: true, get: function () { return __importDefault(return_line_items_1).default; } });
190
192
  var returns_1 = require("./resources/returns");
@@ -341,6 +343,7 @@ exports.resourceList = [
341
343
  'recurring_order_copies',
342
344
  'refunds',
343
345
  'reserved_stocks',
346
+ 'resource_errors',
344
347
  'return_line_items',
345
348
  'returns',
346
349
  'satispay_gateways',
package/lib/cjs/client.js CHANGED
@@ -120,16 +120,16 @@ class ApiClient {
120
120
  async request(method, path, body, options) {
121
121
  debug('request %s %s, %O, %O', method, path, body || {}, options || {});
122
122
  // Ignored params alerts (in debug mode)
123
- if (options === null || options === void 0 ? void 0 : options.adapter)
123
+ if (options?.adapter)
124
124
  debug('Adapter ignored in request config');
125
- if (options === null || options === void 0 ? void 0 : options.userAgent)
125
+ if (options?.userAgent)
126
126
  debug('User-Agent header ignored in request config');
127
127
  const data = body ? { data: body } : undefined;
128
128
  const url = path;
129
129
  // Runtime request parameters
130
- const baseUrl = (options === null || options === void 0 ? void 0 : options.organization) ? baseURL(options.organization, options.domain) : undefined;
131
- const accessToken = (options === null || options === void 0 ? void 0 : options.accessToken) || __classPrivateFieldGet(this, _ApiClient_accessToken, "f");
132
- const headers = this.customHeaders(options === null || options === void 0 ? void 0 : options.headers);
130
+ const baseUrl = options?.organization ? baseURL(options.organization, options.domain) : undefined;
131
+ const accessToken = options?.accessToken || __classPrivateFieldGet(this, _ApiClient_accessToken, "f");
132
+ const headers = this.customHeaders(options?.headers);
133
133
  if (accessToken)
134
134
  headers.Authorization = 'Bearer ' + accessToken;
135
135
  const requestParams = { method, baseURL: baseUrl, url, data, ...options, headers };
@@ -2,14 +2,14 @@ import * as api from './api';
2
2
  import type { ApiError } from './error';
3
3
  import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
4
4
  import { type ResourcesInitConfig } from './resource';
5
- declare const OPEN_API_SCHEMA_VERSION = "4.24.0";
5
+ declare const OPEN_API_SCHEMA_VERSION = "5.0.0";
6
6
  export { OPEN_API_SCHEMA_VERSION };
7
7
  type SdkConfig = {};
8
8
  type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
9
9
  type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
10
10
  declare class CommerceLayerClient {
11
11
  #private;
12
- readonly openApiSchemaVersion = "4.24.0";
12
+ readonly openApiSchemaVersion = "5.0.0";
13
13
  addresses: api.Addresses;
14
14
  adjustments: api.Adjustments;
15
15
  adyen_gateways: api.AdyenGateways;
@@ -97,6 +97,7 @@ declare class CommerceLayerClient {
97
97
  recurring_order_copies: api.RecurringOrderCopies;
98
98
  refunds: api.Refunds;
99
99
  reserved_stocks: api.ReservedStocks;
100
+ resource_errors: api.ResourceErrors;
100
101
  return_line_items: api.ReturnLineItems;
101
102
  returns: api.Returns;
102
103
  satispay_gateways: api.SatispayGateways;
@@ -45,7 +45,7 @@ const resource_1 = __importDefault(require("./resource"));
45
45
  const debug_1 = __importDefault(require("./debug"));
46
46
  const debug = (0, debug_1.default)('commercelayer');
47
47
  // Autogenerated schema version number, do not remove this line
48
- const OPEN_API_SCHEMA_VERSION = '4.24.0';
48
+ const OPEN_API_SCHEMA_VERSION = '5.0.0';
49
49
  exports.OPEN_API_SCHEMA_VERSION = OPEN_API_SCHEMA_VERSION;
50
50
  class CommerceLayerClient {
51
51
  // ##__CL_RESOURCES_DEF_STOP__##
@@ -147,6 +147,7 @@ class CommerceLayerClient {
147
147
  this.recurring_order_copies = new api.RecurringOrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
148
148
  this.refunds = new api.Refunds(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
149
149
  this.reserved_stocks = new api.ReservedStocks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
150
+ this.resource_errors = new api.ResourceErrors(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
150
151
  this.return_line_items = new api.ReturnLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
151
152
  this.returns = new api.Returns(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
152
153
  this.satispay_gateways = new api.SatispayGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
@@ -229,8 +230,8 @@ class CommerceLayerClient {
229
230
  headers: undefined,
230
231
  };
231
232
  function rawResponseInterceptor(response) {
232
- reader.rawResponse = response === null || response === void 0 ? void 0 : response.data;
233
- if (options === null || options === void 0 ? void 0 : options.headers)
233
+ reader.rawResponse = response?.data;
234
+ if (options?.headers)
234
235
  reader.headers = response.headers;
235
236
  return response;
236
237
  }
@@ -239,7 +240,7 @@ class CommerceLayerClient {
239
240
  return reader;
240
241
  }
241
242
  removeRawResponseReader(reader) {
242
- const id = (typeof reader === 'number') ? reader : reader === null || reader === void 0 ? void 0 : reader.id;
243
+ const id = (typeof reader === 'number') ? reader : reader?.id;
243
244
  if (id && (id >= 0))
244
245
  this.removeInterceptor('response', id);
245
246
  }
package/lib/cjs/common.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isResourceType = exports.isResourceId = void 0;
4
4
  const api_1 = require("./api");
5
5
  const isResourceId = (resource) => {
6
- return ((resource === null || resource === void 0 ? void 0 : resource.type) && resource.id) && api_1.resourceList.includes(resource.type);
6
+ return (resource?.type && resource.id) && api_1.resourceList.includes(resource.type);
7
7
  };
8
8
  exports.isResourceId = isResourceId;
9
9
  const isResourceType = (resource) => {
package/lib/cjs/error.js CHANGED
@@ -36,8 +36,7 @@ class ApiError extends SdkError {
36
36
  this.name = ApiError.NAME; // this.constructor.name
37
37
  }
38
38
  first() {
39
- var _a;
40
- return (((_a = this.errors) === null || _a === void 0 ? void 0 : _a.length) > 0) ? this.errors[0] : undefined;
39
+ return (this.errors?.length > 0) ? this.errors[0] : undefined;
41
40
  }
42
41
  }
43
42
  exports.ApiError = ApiError;
@@ -88,6 +88,7 @@ export type { Promotion } from './resources/promotions';
88
88
  export type { RecurringOrderCopy, RecurringOrderCopyCreate, RecurringOrderCopyUpdate } from './resources/recurring_order_copies';
89
89
  export type { Refund } from './resources/refunds';
90
90
  export type { ReservedStock } from './resources/reserved_stocks';
91
+ export type { ResourceError } from './resources/resource_errors';
91
92
  export type { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate } from './resources/return_line_items';
92
93
  export type { Return, ReturnCreate, ReturnUpdate } from './resources/returns';
93
94
  export type { SatispayGateway, SatispayGatewayCreate, SatispayGatewayUpdate } from './resources/satispay_gateways';
@@ -1,5 +1,5 @@
1
1
  import type { ResourceType } from "./resource";
2
- type QueryFilter = Record<string, string | number | boolean>;
2
+ type QueryFilter = Record<string, string | number | boolean | object>;
3
3
  interface QueryParamsRetrieve {
4
4
  include?: string[];
5
5
  fields?: string[] | Record<string, string[]>;
package/lib/cjs/query.js CHANGED
@@ -42,7 +42,7 @@ const generateQueryStringParams = (params, res) => {
42
42
  // Filters
43
43
  if (params.filters) {
44
44
  Object.entries(params.filters).forEach(([p, v]) => {
45
- qp[`filter[q][${p}]`] = String(v);
45
+ qp[`filter[q][${p}]`] = (typeof v === 'object') ? JSON.stringify(v) : String(v);
46
46
  });
47
47
  }
48
48
  }
@@ -65,8 +65,8 @@ class ResourceAdapter {
65
65
  async singleton(resource, params, options) {
66
66
  debug('singleton: %o, %O, %O', resource, params || {}, options || {});
67
67
  const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
68
- if (options === null || options === void 0 ? void 0 : options.params)
69
- Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
68
+ if (options?.params)
69
+ Object.assign(queryParams, options?.params);
70
70
  const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}`, undefined, { ...options, params: queryParams });
71
71
  const r = (0, jsonapi_1.denormalize)(res);
72
72
  return r;
@@ -74,33 +74,32 @@ class ResourceAdapter {
74
74
  async retrieve(resource, params, options) {
75
75
  debug('retrieve: %o, %O, %O', resource, params || {}, options || {});
76
76
  const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
77
- if (options === null || options === void 0 ? void 0 : options.params)
78
- Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
77
+ if (options?.params)
78
+ Object.assign(queryParams, options?.params);
79
79
  const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}/${resource.id}`, undefined, { ...options, params: queryParams });
80
80
  const r = (0, jsonapi_1.denormalize)(res);
81
81
  return r;
82
82
  }
83
83
  async list(resource, params, options) {
84
- var _a, _b;
85
84
  debug('list: %o, %O, %O', resource, params || {}, options || {});
86
85
  const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
87
- if (options === null || options === void 0 ? void 0 : options.params)
88
- Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
86
+ if (options?.params)
87
+ Object.assign(queryParams, options?.params);
89
88
  const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}`, undefined, { ...options, params: queryParams });
90
89
  const r = (0, jsonapi_1.denormalize)(res);
91
90
  const meta = {
92
- pageCount: Number((_a = res.meta) === null || _a === void 0 ? void 0 : _a.page_count),
93
- recordCount: Number((_b = res.meta) === null || _b === void 0 ? void 0 : _b.record_count),
94
- currentPage: (params === null || params === void 0 ? void 0 : params.pageNumber) || config_1.default.default.pageNumber,
95
- recordsPerPage: (params === null || params === void 0 ? void 0 : params.pageSize) || config_1.default.default.pageSize
91
+ pageCount: Number(res.meta?.page_count),
92
+ recordCount: Number(res.meta?.record_count),
93
+ currentPage: params?.pageNumber || config_1.default.default.pageNumber,
94
+ recordsPerPage: params?.pageSize || config_1.default.default.pageSize
96
95
  };
97
96
  return new ListResponse(meta, r);
98
97
  }
99
98
  async create(resource, params, options) {
100
99
  debug('create: %o, %O, %O', resource, params || {}, options || {});
101
100
  const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
102
- if (options === null || options === void 0 ? void 0 : options.params)
103
- Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
101
+ if (options?.params)
102
+ Object.assign(queryParams, options?.params);
104
103
  const data = (0, jsonapi_1.normalize)(resource);
105
104
  const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('post', resource.type, data, { ...options, params: queryParams });
106
105
  const r = (0, jsonapi_1.denormalize)(res);
@@ -109,8 +108,8 @@ class ResourceAdapter {
109
108
  async update(resource, params, options) {
110
109
  debug('update: %o, %O, %O', resource, params || {}, options || {});
111
110
  const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
112
- if (options === null || options === void 0 ? void 0 : options.params)
113
- Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
111
+ if (options?.params)
112
+ Object.assign(queryParams, options?.params);
114
113
  const data = (0, jsonapi_1.normalize)(resource);
115
114
  const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('patch', `${resource.type}/${resource.id}`, data, { ...options, params: queryParams });
116
115
  const r = (0, jsonapi_1.denormalize)(res);
@@ -121,20 +120,19 @@ class ResourceAdapter {
121
120
  await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('delete', `${resource.type}/${resource.id}`, undefined, options);
122
121
  }
123
122
  async fetch(resource, path, params, options) {
124
- var _a, _b;
125
123
  debug('fetch: %o, %O, %O', path, params || {}, options || {});
126
124
  const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
127
- if (options === null || options === void 0 ? void 0 : options.params)
128
- Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
125
+ if (options?.params)
126
+ Object.assign(queryParams, options?.params);
129
127
  const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', path, undefined, { ...options, params: queryParams });
130
128
  const r = (0, jsonapi_1.denormalize)(res);
131
129
  if (Array.isArray(r)) {
132
130
  const p = params;
133
131
  const meta = {
134
- pageCount: Number((_a = res.meta) === null || _a === void 0 ? void 0 : _a.page_count),
135
- recordCount: Number((_b = res.meta) === null || _b === void 0 ? void 0 : _b.record_count),
136
- currentPage: (p === null || p === void 0 ? void 0 : p.pageNumber) || config_1.default.default.pageNumber,
137
- recordsPerPage: (p === null || p === void 0 ? void 0 : p.pageSize) || config_1.default.default.pageSize
132
+ pageCount: Number(res.meta?.page_count),
133
+ recordCount: Number(res.meta?.record_count),
134
+ currentPage: p?.pageNumber || config_1.default.default.pageNumber,
135
+ recordsPerPage: p?.pageSize || config_1.default.default.pageSize
138
136
  };
139
137
  return new ListResponse(meta, r);
140
138
  }
@@ -149,11 +147,10 @@ class ApiResourceBase {
149
147
  this.resources = adapter;
150
148
  }
151
149
  parse(resource) {
152
- var _a, _b;
153
150
  try {
154
151
  const res = JSON.parse(resource);
155
- if (((_a = res.data) === null || _a === void 0 ? void 0 : _a.type) !== this.type())
156
- throw new error_1.SdkError({ message: `Invalid resource type [${(_b = res.data) === null || _b === void 0 ? void 0 : _b.type}]`, type: error_1.ErrorType.PARSE });
152
+ if (res.data?.type !== this.type())
153
+ throw new error_1.SdkError({ message: `Invalid resource type [${res.data?.type}]`, type: error_1.ErrorType.PARSE });
157
154
  return (0, jsonapi_1.denormalize)(res);
158
155
  }
159
156
  catch (error) {
@@ -13,17 +13,20 @@ interface Adjustment extends Resource {
13
13
  amount_cents: number;
14
14
  amount_float: number;
15
15
  formatted_amount: string;
16
+ distribute_discount?: boolean | null;
16
17
  versions?: Version[] | null;
17
18
  }
18
19
  interface AdjustmentCreate extends ResourceCreate {
19
20
  name: string;
20
21
  currency_code: string;
21
22
  amount_cents: number;
23
+ distribute_discount?: boolean | null;
22
24
  }
23
25
  interface AdjustmentUpdate extends ResourceUpdate {
24
26
  name?: string | null;
25
27
  currency_code?: string | null;
26
28
  amount_cents?: number | null;
29
+ distribute_discount?: boolean | null;
27
30
  }
28
31
  declare class Adjustments extends ApiResource<Adjustment> {
29
32
  static readonly TYPE: AdjustmentType;
@@ -28,7 +28,7 @@ interface AdyenGatewayCreate extends ResourceCreate {
28
28
  api_key: string;
29
29
  public_key?: string | null;
30
30
  live_url_prefix: string;
31
- api_version?: string | null;
31
+ api_version?: number | null;
32
32
  async_api?: boolean | null;
33
33
  webhook_endpoint_secret?: string | null;
34
34
  adyen_payments?: AdyenPaymentRel[] | null;
@@ -39,7 +39,7 @@ interface AdyenGatewayUpdate extends ResourceUpdate {
39
39
  api_key?: string | null;
40
40
  public_key?: string | null;
41
41
  live_url_prefix?: string | null;
42
- api_version?: string | null;
42
+ api_version?: number | null;
43
43
  async_api?: boolean | null;
44
44
  webhook_endpoint_secret?: string | null;
45
45
  adyen_payments?: AdyenPaymentRel[] | null;
@@ -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 BuyXPayYPromotionRel = 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 BuyXPayYPromotion 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;
@@ -88,12 +82,10 @@ interface BuyXPayYPromotionCreate extends ResourceCreate {
88
82
  y: number;
89
83
  cheapest_free?: boolean | null;
90
84
  market?: MarketRel | null;
91
- promotion_rules?: PromotionRuleRel[] | null;
92
85
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
93
86
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
94
87
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
95
88
  custom_promotion_rule?: CustomPromotionRuleRel | null;
96
- coupons?: CouponRel[] | null;
97
89
  sku_list: SkuListRel;
98
90
  tags?: TagRel[] | null;
99
91
  }
@@ -111,12 +103,10 @@ interface BuyXPayYPromotionUpdate extends ResourceUpdate {
111
103
  y?: number | null;
112
104
  cheapest_free?: boolean | null;
113
105
  market?: MarketRel | null;
114
- promotion_rules?: PromotionRuleRel[] | null;
115
106
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
116
107
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
117
108
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
118
109
  custom_promotion_rule?: CustomPromotionRuleRel | null;
119
- coupons?: CouponRel[] | null;
120
110
  sku_list?: SkuListRel | null;
121
111
  tags?: TagRel[] | null;
122
112
  }
@@ -130,8 +120,8 @@ declare class BuyXPayYPromotions extends ApiResource<BuyXPayYPromotion> {
130
120
  sku_list_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
131
121
  coupon_codes_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
132
122
  custom_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
133
- coupons(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
134
123
  sku_list(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
124
+ coupons(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
135
125
  attachments(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
136
126
  events(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
137
127
  tags(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -31,14 +31,14 @@ class BuyXPayYPromotions extends resource_1.ApiResource {
31
31
  const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
32
32
  return this.resources.fetch({ type: 'custom_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/custom_promotion_rule`, params, options);
33
33
  }
34
- async coupons(buyXPayYPromotionId, params, options) {
35
- const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
36
- return this.resources.fetch({ type: 'coupons' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/coupons`, params, options);
37
- }
38
34
  async sku_list(buyXPayYPromotionId, params, options) {
39
35
  const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
40
36
  return this.resources.fetch({ type: 'sku_lists' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/sku_list`, params, options);
41
37
  }
38
+ async coupons(buyXPayYPromotionId, params, options) {
39
+ const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
40
+ return this.resources.fetch({ type: 'coupons' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/coupons`, params, options);
41
+ }
42
42
  async attachments(buyXPayYPromotionId, params, options) {
43
43
  const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
44
44
  return this.resources.fetch({ type: 'attachments' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/attachments`, params, options);
@@ -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;
@@ -23,6 +23,9 @@ class ExternalGateways extends resource_1.ApiResource {
23
23
  const _externalGatewayId = externalGatewayId.id || externalGatewayId;
24
24
  return this.resources.fetch({ type: 'external_payments' }, `external_gateways/${_externalGatewayId}/external_payments`, params, options);
25
25
  }
26
+ async _reset_circuit(id, params, options) {
27
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ExternalGateways.TYPE, _reset_circuit: true }, params, options);
28
+ }
26
29
  isExternalGateway(resource) {
27
30
  return resource.type && (resource.type === ExternalGateways.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 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;