@commercelayer/sdk 4.28.0 → 4.28.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 (533) hide show
  1. package/lib/cjs/api.d.ts +9 -23
  2. package/lib/cjs/api.js +35 -4
  3. package/lib/cjs/client.d.ts +5 -3
  4. package/lib/cjs/client.js +8 -11
  5. package/lib/cjs/commercelayer.d.ts +11 -5
  6. package/lib/cjs/commercelayer.js +9 -3
  7. package/lib/cjs/common.d.ts +0 -1
  8. package/lib/cjs/common.js +2 -11
  9. package/lib/cjs/config.d.ts +0 -1
  10. package/lib/cjs/config.js +0 -1
  11. package/lib/cjs/debug.js +4 -0
  12. package/lib/cjs/error.js +4 -1
  13. package/lib/cjs/index.d.ts +1 -1
  14. package/lib/cjs/index.js +16 -0
  15. package/lib/cjs/interceptor.d.ts +2 -6
  16. package/lib/cjs/jsonapi.js +1 -5
  17. package/lib/cjs/model.d.ts +9 -3
  18. package/lib/cjs/query.d.ts +15 -9
  19. package/lib/cjs/query.js +2 -3
  20. package/lib/cjs/resource.d.ts +19 -29
  21. package/lib/cjs/resource.js +9 -34
  22. package/lib/cjs/resources/addresses.d.ts +75 -73
  23. package/lib/cjs/resources/addresses.js +15 -3
  24. package/lib/cjs/resources/adjustments.d.ts +21 -19
  25. package/lib/cjs/resources/adjustments.js +15 -3
  26. package/lib/cjs/resources/adyen_gateways.d.ts +36 -34
  27. package/lib/cjs/resources/adyen_gateways.js +15 -3
  28. package/lib/cjs/resources/adyen_payments.d.ts +29 -27
  29. package/lib/cjs/resources/adyen_payments.js +15 -3
  30. package/lib/cjs/resources/application.d.ts +13 -14
  31. package/lib/cjs/resources/application.js +6 -1
  32. package/lib/cjs/resources/attachments.d.ts +80 -81
  33. package/lib/cjs/resources/attachments.js +11 -3
  34. package/lib/cjs/resources/authorizations.d.ts +49 -44
  35. package/lib/cjs/resources/authorizations.js +21 -5
  36. package/lib/cjs/resources/avalara_accounts.d.ts +33 -31
  37. package/lib/cjs/resources/avalara_accounts.js +15 -3
  38. package/lib/cjs/resources/axerve_gateways.d.ts +25 -22
  39. package/lib/cjs/resources/axerve_gateways.js +15 -3
  40. package/lib/cjs/resources/axerve_payments.d.ts +34 -26
  41. package/lib/cjs/resources/axerve_payments.js +15 -3
  42. package/lib/cjs/resources/billing_info_validation_rules.d.ts +18 -16
  43. package/lib/cjs/resources/billing_info_validation_rules.js +15 -3
  44. package/lib/cjs/resources/bing_geocoders.d.ts +15 -16
  45. package/lib/cjs/resources/bing_geocoders.js +11 -3
  46. package/lib/cjs/resources/braintree_gateways.d.ts +35 -33
  47. package/lib/cjs/resources/braintree_gateways.js +15 -3
  48. package/lib/cjs/resources/braintree_payments.d.ts +31 -29
  49. package/lib/cjs/resources/braintree_payments.js +15 -3
  50. package/lib/cjs/resources/bundles.d.ts +58 -56
  51. package/lib/cjs/resources/bundles.js +15 -3
  52. package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +134 -0
  53. package/lib/cjs/resources/buy_x_pay_y_promotions.js +81 -0
  54. package/lib/cjs/resources/captures.d.ts +40 -35
  55. package/lib/cjs/resources/captures.js +21 -5
  56. package/lib/cjs/resources/carrier_accounts.d.ts +17 -15
  57. package/lib/cjs/resources/carrier_accounts.js +12 -0
  58. package/lib/cjs/resources/checkout_com_gateways.d.ts +26 -24
  59. package/lib/cjs/resources/checkout_com_gateways.js +15 -3
  60. package/lib/cjs/resources/checkout_com_payments.d.ts +40 -38
  61. package/lib/cjs/resources/checkout_com_payments.js +15 -3
  62. package/lib/cjs/resources/cleanups.d.ts +25 -23
  63. package/lib/cjs/resources/cleanups.js +14 -2
  64. package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +37 -31
  65. package/lib/cjs/resources/coupon_codes_promotion_rules.js +15 -3
  66. package/lib/cjs/resources/coupon_recipients.d.ts +27 -25
  67. package/lib/cjs/resources/coupon_recipients.js +15 -3
  68. package/lib/cjs/resources/coupons.d.ts +46 -33
  69. package/lib/cjs/resources/coupons.js +19 -3
  70. package/lib/cjs/resources/custom_promotion_rules.d.ts +61 -0
  71. package/lib/cjs/resources/custom_promotion_rules.js +37 -0
  72. package/lib/cjs/resources/customer_addresses.d.ts +25 -21
  73. package/lib/cjs/resources/customer_addresses.js +15 -3
  74. package/lib/cjs/resources/customer_groups.d.ts +18 -16
  75. package/lib/cjs/resources/customer_groups.js +15 -3
  76. package/lib/cjs/resources/customer_password_resets.d.ts +17 -18
  77. package/lib/cjs/resources/customer_password_resets.js +11 -3
  78. package/lib/cjs/resources/customer_payment_sources.d.ts +51 -45
  79. package/lib/cjs/resources/customer_payment_sources.js +19 -3
  80. package/lib/cjs/resources/customer_subscriptions.d.ts +16 -14
  81. package/lib/cjs/resources/customer_subscriptions.js +15 -3
  82. package/lib/cjs/resources/customers.d.ts +36 -36
  83. package/lib/cjs/resources/customers.js +11 -3
  84. package/lib/cjs/resources/delivery_lead_times.d.ts +28 -26
  85. package/lib/cjs/resources/delivery_lead_times.js +15 -3
  86. package/lib/cjs/resources/event_callbacks.d.ts +14 -15
  87. package/lib/cjs/resources/event_callbacks.js +8 -0
  88. package/lib/cjs/resources/events.d.ts +12 -13
  89. package/lib/cjs/resources/events.js +8 -0
  90. package/lib/cjs/resources/exports.d.ts +26 -27
  91. package/lib/cjs/resources/exports.js +10 -2
  92. package/lib/cjs/resources/external_gateways.d.ts +33 -31
  93. package/lib/cjs/resources/external_gateways.js +15 -3
  94. package/lib/cjs/resources/external_payments.d.ts +24 -22
  95. package/lib/cjs/resources/external_payments.js +15 -3
  96. package/lib/cjs/resources/external_promotions.d.ts +92 -62
  97. package/lib/cjs/resources/external_promotions.js +31 -3
  98. package/lib/cjs/resources/external_tax_calculators.d.ts +20 -18
  99. package/lib/cjs/resources/external_tax_calculators.js +15 -3
  100. package/lib/cjs/resources/fixed_amount_promotions.d.ts +93 -63
  101. package/lib/cjs/resources/fixed_amount_promotions.js +31 -3
  102. package/lib/cjs/resources/fixed_price_promotions.d.ts +89 -70
  103. package/lib/cjs/resources/fixed_price_promotions.js +25 -5
  104. package/lib/cjs/resources/free_gift_promotions.d.ts +88 -69
  105. package/lib/cjs/resources/free_gift_promotions.js +25 -5
  106. package/lib/cjs/resources/free_shipping_promotions.d.ts +86 -59
  107. package/lib/cjs/resources/free_shipping_promotions.js +27 -3
  108. package/lib/cjs/resources/geocoders.d.ts +12 -13
  109. package/lib/cjs/resources/geocoders.js +8 -0
  110. package/lib/cjs/resources/gift_card_recipients.d.ts +27 -25
  111. package/lib/cjs/resources/gift_card_recipients.js +15 -3
  112. package/lib/cjs/resources/gift_cards.d.ts +68 -66
  113. package/lib/cjs/resources/gift_cards.js +15 -3
  114. package/lib/cjs/resources/google_geocoders.d.ts +15 -16
  115. package/lib/cjs/resources/google_geocoders.js +11 -3
  116. package/lib/cjs/resources/imports.d.ts +29 -32
  117. package/lib/cjs/resources/imports.js +10 -2
  118. package/lib/cjs/resources/in_stock_subscriptions.d.ts +37 -35
  119. package/lib/cjs/resources/in_stock_subscriptions.js +15 -3
  120. package/lib/cjs/resources/inventory_models.d.ts +33 -22
  121. package/lib/cjs/resources/inventory_models.js +15 -3
  122. package/lib/cjs/resources/inventory_return_locations.d.ts +23 -21
  123. package/lib/cjs/resources/inventory_return_locations.js +15 -3
  124. package/lib/cjs/resources/inventory_stock_locations.d.ts +26 -24
  125. package/lib/cjs/resources/inventory_stock_locations.js +15 -3
  126. package/lib/cjs/resources/klarna_gateways.d.ts +24 -22
  127. package/lib/cjs/resources/klarna_gateways.js +15 -3
  128. package/lib/cjs/resources/klarna_payments.d.ts +29 -27
  129. package/lib/cjs/resources/klarna_payments.js +15 -3
  130. package/lib/cjs/resources/line_item_options.d.ts +40 -41
  131. package/lib/cjs/resources/line_item_options.js +11 -3
  132. package/lib/cjs/resources/line_items.d.ts +105 -87
  133. package/lib/cjs/resources/line_items.js +19 -3
  134. package/lib/cjs/resources/manual_gateways.d.ts +16 -14
  135. package/lib/cjs/resources/manual_gateways.js +15 -3
  136. package/lib/cjs/resources/manual_tax_calculators.d.ts +22 -20
  137. package/lib/cjs/resources/manual_tax_calculators.js +15 -3
  138. package/lib/cjs/resources/markets.d.ts +66 -59
  139. package/lib/cjs/resources/markets.js +15 -3
  140. package/lib/cjs/resources/merchants.d.ts +20 -18
  141. package/lib/cjs/resources/merchants.js +15 -3
  142. package/lib/cjs/resources/order_amount_promotion_rules.d.ts +40 -31
  143. package/lib/cjs/resources/order_amount_promotion_rules.js +15 -3
  144. package/lib/cjs/resources/order_copies.d.ts +28 -29
  145. package/lib/cjs/resources/order_copies.js +11 -3
  146. package/lib/cjs/resources/order_factories.d.ts +20 -21
  147. package/lib/cjs/resources/order_factories.js +8 -0
  148. package/lib/cjs/resources/order_subscription_items.d.ts +41 -35
  149. package/lib/cjs/resources/order_subscription_items.js +15 -3
  150. package/lib/cjs/resources/order_subscriptions.d.ts +54 -51
  151. package/lib/cjs/resources/order_subscriptions.js +15 -3
  152. package/lib/cjs/resources/order_validation_rules.d.ts +14 -12
  153. package/lib/cjs/resources/order_validation_rules.js +12 -0
  154. package/lib/cjs/resources/orders.d.ts +266 -231
  155. package/lib/cjs/resources/orders.js +39 -3
  156. package/lib/cjs/resources/organization.d.ts +24 -25
  157. package/lib/cjs/resources/organization.js +6 -1
  158. package/lib/cjs/resources/packages.d.ts +32 -30
  159. package/lib/cjs/resources/packages.js +15 -3
  160. package/lib/cjs/resources/parcel_line_items.d.ts +24 -22
  161. package/lib/cjs/resources/parcel_line_items.js +15 -3
  162. package/lib/cjs/resources/parcels.d.ts +95 -93
  163. package/lib/cjs/resources/parcels.js +15 -3
  164. package/lib/cjs/resources/payment_gateways.d.ts +14 -12
  165. package/lib/cjs/resources/payment_gateways.js +12 -0
  166. package/lib/cjs/resources/payment_methods.d.ts +55 -48
  167. package/lib/cjs/resources/payment_methods.js +15 -3
  168. package/lib/cjs/resources/payment_options.d.ts +43 -0
  169. package/lib/cjs/resources/payment_options.js +41 -0
  170. package/lib/cjs/resources/paypal_gateways.d.ts +19 -17
  171. package/lib/cjs/resources/paypal_gateways.js +15 -3
  172. package/lib/cjs/resources/paypal_payments.d.ts +33 -31
  173. package/lib/cjs/resources/paypal_payments.js +15 -3
  174. package/lib/cjs/resources/percentage_discount_promotions.d.ts +88 -69
  175. package/lib/cjs/resources/percentage_discount_promotions.js +25 -5
  176. package/lib/cjs/resources/price_frequency_tiers.d.ts +28 -26
  177. package/lib/cjs/resources/price_frequency_tiers.js +15 -3
  178. package/lib/cjs/resources/price_lists.d.ts +25 -20
  179. package/lib/cjs/resources/price_lists.js +15 -3
  180. package/lib/cjs/resources/price_tiers.d.ts +19 -17
  181. package/lib/cjs/resources/price_tiers.js +12 -0
  182. package/lib/cjs/resources/price_volume_tiers.d.ts +28 -26
  183. package/lib/cjs/resources/price_volume_tiers.js +15 -3
  184. package/lib/cjs/resources/prices.d.ts +42 -40
  185. package/lib/cjs/resources/prices.js +15 -3
  186. package/lib/cjs/resources/promotion_rules.d.ts +14 -10
  187. package/lib/cjs/resources/promotion_rules.js +12 -0
  188. package/lib/cjs/resources/promotions.d.ts +39 -25
  189. package/lib/cjs/resources/promotions.js +24 -0
  190. package/lib/cjs/resources/recurring_order_copies.d.ts +28 -29
  191. package/lib/cjs/resources/recurring_order_copies.js +11 -3
  192. package/lib/cjs/resources/refunds.d.ts +31 -26
  193. package/lib/cjs/resources/refunds.js +18 -2
  194. package/lib/cjs/resources/reserved_stocks.d.ts +27 -0
  195. package/lib/cjs/resources/reserved_stocks.js +36 -0
  196. package/lib/cjs/resources/return_line_items.d.ts +27 -27
  197. package/lib/cjs/resources/return_line_items.js +11 -3
  198. package/lib/cjs/resources/returns.d.ts +51 -49
  199. package/lib/cjs/resources/returns.js +15 -3
  200. package/lib/cjs/resources/satispay_gateways.d.ts +24 -22
  201. package/lib/cjs/resources/satispay_gateways.js +15 -3
  202. package/lib/cjs/resources/satispay_payments.d.ts +31 -21
  203. package/lib/cjs/resources/satispay_payments.js +15 -3
  204. package/lib/cjs/resources/shipments.d.ts +98 -52
  205. package/lib/cjs/resources/shipments.js +27 -1
  206. package/lib/cjs/resources/shipping_categories.d.ts +20 -15
  207. package/lib/cjs/resources/shipping_categories.js +15 -3
  208. package/lib/cjs/resources/shipping_method_tiers.d.ts +19 -17
  209. package/lib/cjs/resources/shipping_method_tiers.js +12 -0
  210. package/lib/cjs/resources/shipping_methods.d.ts +81 -71
  211. package/lib/cjs/resources/shipping_methods.js +15 -3
  212. package/lib/cjs/resources/shipping_weight_tiers.d.ts +27 -25
  213. package/lib/cjs/resources/shipping_weight_tiers.js +15 -3
  214. package/lib/cjs/resources/shipping_zones.d.ts +34 -32
  215. package/lib/cjs/resources/shipping_zones.js +15 -3
  216. package/lib/cjs/resources/sku_list_items.d.ts +28 -26
  217. package/lib/cjs/resources/sku_list_items.js +15 -3
  218. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +44 -38
  219. package/lib/cjs/resources/sku_list_promotion_rules.js +15 -3
  220. package/lib/cjs/resources/sku_lists.d.ts +37 -35
  221. package/lib/cjs/resources/sku_lists.js +15 -3
  222. package/lib/cjs/resources/sku_options.d.ts +45 -43
  223. package/lib/cjs/resources/sku_options.js +15 -3
  224. package/lib/cjs/resources/skus.d.ts +60 -55
  225. package/lib/cjs/resources/skus.js +19 -3
  226. package/lib/cjs/resources/stock_items.d.ts +34 -26
  227. package/lib/cjs/resources/stock_items.js +23 -3
  228. package/lib/cjs/resources/stock_line_items.d.ts +54 -15
  229. package/lib/cjs/resources/stock_line_items.js +25 -0
  230. package/lib/cjs/resources/stock_locations.d.ts +34 -29
  231. package/lib/cjs/resources/stock_locations.js +15 -3
  232. package/lib/cjs/resources/stock_reservations.d.ts +49 -0
  233. package/lib/cjs/resources/stock_reservations.js +53 -0
  234. package/lib/cjs/resources/stock_transfers.d.ts +46 -42
  235. package/lib/cjs/resources/stock_transfers.js +15 -3
  236. package/lib/cjs/resources/stripe_gateways.d.ts +24 -22
  237. package/lib/cjs/resources/stripe_gateways.js +15 -3
  238. package/lib/cjs/resources/stripe_payments.d.ts +39 -28
  239. package/lib/cjs/resources/stripe_payments.js +15 -3
  240. package/lib/cjs/resources/subscription_models.d.ts +26 -27
  241. package/lib/cjs/resources/subscription_models.js +11 -3
  242. package/lib/cjs/resources/tags.d.ts +12 -13
  243. package/lib/cjs/resources/tags.js +11 -3
  244. package/lib/cjs/resources/tax_calculators.d.ts +15 -13
  245. package/lib/cjs/resources/tax_calculators.js +12 -0
  246. package/lib/cjs/resources/tax_categories.d.ts +32 -30
  247. package/lib/cjs/resources/tax_categories.js +15 -3
  248. package/lib/cjs/resources/tax_rules.d.ts +53 -51
  249. package/lib/cjs/resources/tax_rules.js +15 -3
  250. package/lib/cjs/resources/taxjar_accounts.d.ts +23 -21
  251. package/lib/cjs/resources/taxjar_accounts.js +15 -3
  252. package/lib/cjs/resources/transactions.d.ts +30 -22
  253. package/lib/cjs/resources/transactions.js +20 -0
  254. package/lib/cjs/resources/versions.d.ts +22 -0
  255. package/lib/cjs/resources/versions.js +24 -0
  256. package/lib/cjs/resources/voids.d.ts +31 -26
  257. package/lib/cjs/resources/voids.js +18 -2
  258. package/lib/cjs/resources/webhooks.d.ts +33 -26
  259. package/lib/cjs/resources/webhooks.js +15 -3
  260. package/lib/cjs/resources/wire_transfers.d.ts +18 -16
  261. package/lib/cjs/resources/wire_transfers.js +15 -3
  262. package/lib/cjs/static.d.ts +1 -1
  263. package/lib/cjs/util.d.ts +4 -1
  264. package/lib/esm/api.d.ts +9 -23
  265. package/lib/esm/api.js +26 -1
  266. package/lib/esm/client.d.ts +5 -3
  267. package/lib/esm/client.js +8 -11
  268. package/lib/esm/commercelayer.d.ts +11 -5
  269. package/lib/esm/commercelayer.js +9 -3
  270. package/lib/esm/common.d.ts +0 -1
  271. package/lib/esm/common.js +2 -11
  272. package/lib/esm/config.d.ts +0 -1
  273. package/lib/esm/config.js +0 -1
  274. package/lib/esm/debug.js +4 -0
  275. package/lib/esm/error.js +4 -1
  276. package/lib/esm/index.d.ts +1 -1
  277. package/lib/esm/index.js +2 -0
  278. package/lib/esm/interceptor.d.ts +2 -6
  279. package/lib/esm/jsonapi.js +1 -5
  280. package/lib/esm/model.d.ts +9 -3
  281. package/lib/esm/query.d.ts +15 -9
  282. package/lib/esm/query.js +2 -2
  283. package/lib/esm/resource.d.ts +19 -29
  284. package/lib/esm/resource.js +10 -34
  285. package/lib/esm/resources/addresses.d.ts +75 -73
  286. package/lib/esm/resources/addresses.js +15 -3
  287. package/lib/esm/resources/adjustments.d.ts +21 -19
  288. package/lib/esm/resources/adjustments.js +15 -3
  289. package/lib/esm/resources/adyen_gateways.d.ts +36 -34
  290. package/lib/esm/resources/adyen_gateways.js +15 -3
  291. package/lib/esm/resources/adyen_payments.d.ts +29 -27
  292. package/lib/esm/resources/adyen_payments.js +15 -3
  293. package/lib/esm/resources/application.d.ts +13 -14
  294. package/lib/esm/resources/application.js +7 -2
  295. package/lib/esm/resources/attachments.d.ts +80 -81
  296. package/lib/esm/resources/attachments.js +11 -3
  297. package/lib/esm/resources/authorizations.d.ts +49 -44
  298. package/lib/esm/resources/authorizations.js +21 -5
  299. package/lib/esm/resources/avalara_accounts.d.ts +33 -31
  300. package/lib/esm/resources/avalara_accounts.js +15 -3
  301. package/lib/esm/resources/axerve_gateways.d.ts +25 -22
  302. package/lib/esm/resources/axerve_gateways.js +15 -3
  303. package/lib/esm/resources/axerve_payments.d.ts +34 -26
  304. package/lib/esm/resources/axerve_payments.js +15 -3
  305. package/lib/esm/resources/billing_info_validation_rules.d.ts +18 -16
  306. package/lib/esm/resources/billing_info_validation_rules.js +15 -3
  307. package/lib/esm/resources/bing_geocoders.d.ts +15 -16
  308. package/lib/esm/resources/bing_geocoders.js +11 -3
  309. package/lib/esm/resources/braintree_gateways.d.ts +35 -33
  310. package/lib/esm/resources/braintree_gateways.js +15 -3
  311. package/lib/esm/resources/braintree_payments.d.ts +31 -29
  312. package/lib/esm/resources/braintree_payments.js +15 -3
  313. package/lib/esm/resources/bundles.d.ts +58 -56
  314. package/lib/esm/resources/bundles.js +15 -3
  315. package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +134 -0
  316. package/lib/esm/resources/buy_x_pay_y_promotions.js +79 -0
  317. package/lib/esm/resources/captures.d.ts +40 -35
  318. package/lib/esm/resources/captures.js +21 -5
  319. package/lib/esm/resources/carrier_accounts.d.ts +17 -15
  320. package/lib/esm/resources/carrier_accounts.js +12 -0
  321. package/lib/esm/resources/checkout_com_gateways.d.ts +26 -24
  322. package/lib/esm/resources/checkout_com_gateways.js +15 -3
  323. package/lib/esm/resources/checkout_com_payments.d.ts +40 -38
  324. package/lib/esm/resources/checkout_com_payments.js +15 -3
  325. package/lib/esm/resources/cleanups.d.ts +25 -23
  326. package/lib/esm/resources/cleanups.js +14 -2
  327. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +37 -31
  328. package/lib/esm/resources/coupon_codes_promotion_rules.js +15 -3
  329. package/lib/esm/resources/coupon_recipients.d.ts +27 -25
  330. package/lib/esm/resources/coupon_recipients.js +15 -3
  331. package/lib/esm/resources/coupons.d.ts +46 -33
  332. package/lib/esm/resources/coupons.js +19 -3
  333. package/lib/esm/resources/custom_promotion_rules.d.ts +61 -0
  334. package/lib/esm/resources/custom_promotion_rules.js +35 -0
  335. package/lib/esm/resources/customer_addresses.d.ts +25 -21
  336. package/lib/esm/resources/customer_addresses.js +15 -3
  337. package/lib/esm/resources/customer_groups.d.ts +18 -16
  338. package/lib/esm/resources/customer_groups.js +15 -3
  339. package/lib/esm/resources/customer_password_resets.d.ts +17 -18
  340. package/lib/esm/resources/customer_password_resets.js +11 -3
  341. package/lib/esm/resources/customer_payment_sources.d.ts +51 -45
  342. package/lib/esm/resources/customer_payment_sources.js +19 -3
  343. package/lib/esm/resources/customer_subscriptions.d.ts +16 -14
  344. package/lib/esm/resources/customer_subscriptions.js +15 -3
  345. package/lib/esm/resources/customers.d.ts +36 -36
  346. package/lib/esm/resources/customers.js +11 -3
  347. package/lib/esm/resources/delivery_lead_times.d.ts +28 -26
  348. package/lib/esm/resources/delivery_lead_times.js +15 -3
  349. package/lib/esm/resources/event_callbacks.d.ts +14 -15
  350. package/lib/esm/resources/event_callbacks.js +8 -0
  351. package/lib/esm/resources/events.d.ts +12 -13
  352. package/lib/esm/resources/events.js +8 -0
  353. package/lib/esm/resources/exports.d.ts +26 -27
  354. package/lib/esm/resources/exports.js +10 -2
  355. package/lib/esm/resources/external_gateways.d.ts +33 -31
  356. package/lib/esm/resources/external_gateways.js +15 -3
  357. package/lib/esm/resources/external_payments.d.ts +24 -22
  358. package/lib/esm/resources/external_payments.js +15 -3
  359. package/lib/esm/resources/external_promotions.d.ts +92 -62
  360. package/lib/esm/resources/external_promotions.js +31 -3
  361. package/lib/esm/resources/external_tax_calculators.d.ts +20 -18
  362. package/lib/esm/resources/external_tax_calculators.js +15 -3
  363. package/lib/esm/resources/fixed_amount_promotions.d.ts +93 -63
  364. package/lib/esm/resources/fixed_amount_promotions.js +31 -3
  365. package/lib/esm/resources/fixed_price_promotions.d.ts +89 -70
  366. package/lib/esm/resources/fixed_price_promotions.js +25 -5
  367. package/lib/esm/resources/free_gift_promotions.d.ts +88 -69
  368. package/lib/esm/resources/free_gift_promotions.js +25 -5
  369. package/lib/esm/resources/free_shipping_promotions.d.ts +86 -59
  370. package/lib/esm/resources/free_shipping_promotions.js +27 -3
  371. package/lib/esm/resources/geocoders.d.ts +12 -13
  372. package/lib/esm/resources/geocoders.js +8 -0
  373. package/lib/esm/resources/gift_card_recipients.d.ts +27 -25
  374. package/lib/esm/resources/gift_card_recipients.js +15 -3
  375. package/lib/esm/resources/gift_cards.d.ts +68 -66
  376. package/lib/esm/resources/gift_cards.js +15 -3
  377. package/lib/esm/resources/google_geocoders.d.ts +15 -16
  378. package/lib/esm/resources/google_geocoders.js +11 -3
  379. package/lib/esm/resources/imports.d.ts +29 -32
  380. package/lib/esm/resources/imports.js +10 -2
  381. package/lib/esm/resources/in_stock_subscriptions.d.ts +37 -35
  382. package/lib/esm/resources/in_stock_subscriptions.js +15 -3
  383. package/lib/esm/resources/inventory_models.d.ts +33 -22
  384. package/lib/esm/resources/inventory_models.js +15 -3
  385. package/lib/esm/resources/inventory_return_locations.d.ts +23 -21
  386. package/lib/esm/resources/inventory_return_locations.js +15 -3
  387. package/lib/esm/resources/inventory_stock_locations.d.ts +26 -24
  388. package/lib/esm/resources/inventory_stock_locations.js +15 -3
  389. package/lib/esm/resources/klarna_gateways.d.ts +24 -22
  390. package/lib/esm/resources/klarna_gateways.js +15 -3
  391. package/lib/esm/resources/klarna_payments.d.ts +29 -27
  392. package/lib/esm/resources/klarna_payments.js +15 -3
  393. package/lib/esm/resources/line_item_options.d.ts +40 -41
  394. package/lib/esm/resources/line_item_options.js +11 -3
  395. package/lib/esm/resources/line_items.d.ts +105 -87
  396. package/lib/esm/resources/line_items.js +19 -3
  397. package/lib/esm/resources/manual_gateways.d.ts +16 -14
  398. package/lib/esm/resources/manual_gateways.js +15 -3
  399. package/lib/esm/resources/manual_tax_calculators.d.ts +22 -20
  400. package/lib/esm/resources/manual_tax_calculators.js +15 -3
  401. package/lib/esm/resources/markets.d.ts +66 -59
  402. package/lib/esm/resources/markets.js +15 -3
  403. package/lib/esm/resources/merchants.d.ts +20 -18
  404. package/lib/esm/resources/merchants.js +15 -3
  405. package/lib/esm/resources/order_amount_promotion_rules.d.ts +40 -31
  406. package/lib/esm/resources/order_amount_promotion_rules.js +15 -3
  407. package/lib/esm/resources/order_copies.d.ts +28 -29
  408. package/lib/esm/resources/order_copies.js +11 -3
  409. package/lib/esm/resources/order_factories.d.ts +20 -21
  410. package/lib/esm/resources/order_factories.js +8 -0
  411. package/lib/esm/resources/order_subscription_items.d.ts +41 -35
  412. package/lib/esm/resources/order_subscription_items.js +15 -3
  413. package/lib/esm/resources/order_subscriptions.d.ts +54 -51
  414. package/lib/esm/resources/order_subscriptions.js +15 -3
  415. package/lib/esm/resources/order_validation_rules.d.ts +14 -12
  416. package/lib/esm/resources/order_validation_rules.js +12 -0
  417. package/lib/esm/resources/orders.d.ts +266 -231
  418. package/lib/esm/resources/orders.js +39 -3
  419. package/lib/esm/resources/organization.d.ts +24 -25
  420. package/lib/esm/resources/organization.js +7 -2
  421. package/lib/esm/resources/packages.d.ts +32 -30
  422. package/lib/esm/resources/packages.js +15 -3
  423. package/lib/esm/resources/parcel_line_items.d.ts +24 -22
  424. package/lib/esm/resources/parcel_line_items.js +15 -3
  425. package/lib/esm/resources/parcels.d.ts +95 -93
  426. package/lib/esm/resources/parcels.js +15 -3
  427. package/lib/esm/resources/payment_gateways.d.ts +14 -12
  428. package/lib/esm/resources/payment_gateways.js +12 -0
  429. package/lib/esm/resources/payment_methods.d.ts +55 -48
  430. package/lib/esm/resources/payment_methods.js +15 -3
  431. package/lib/esm/resources/payment_options.d.ts +43 -0
  432. package/lib/esm/resources/payment_options.js +39 -0
  433. package/lib/esm/resources/paypal_gateways.d.ts +19 -17
  434. package/lib/esm/resources/paypal_gateways.js +15 -3
  435. package/lib/esm/resources/paypal_payments.d.ts +33 -31
  436. package/lib/esm/resources/paypal_payments.js +15 -3
  437. package/lib/esm/resources/percentage_discount_promotions.d.ts +88 -69
  438. package/lib/esm/resources/percentage_discount_promotions.js +25 -5
  439. package/lib/esm/resources/price_frequency_tiers.d.ts +28 -26
  440. package/lib/esm/resources/price_frequency_tiers.js +15 -3
  441. package/lib/esm/resources/price_lists.d.ts +25 -20
  442. package/lib/esm/resources/price_lists.js +15 -3
  443. package/lib/esm/resources/price_tiers.d.ts +19 -17
  444. package/lib/esm/resources/price_tiers.js +12 -0
  445. package/lib/esm/resources/price_volume_tiers.d.ts +28 -26
  446. package/lib/esm/resources/price_volume_tiers.js +15 -3
  447. package/lib/esm/resources/prices.d.ts +42 -40
  448. package/lib/esm/resources/prices.js +15 -3
  449. package/lib/esm/resources/promotion_rules.d.ts +14 -10
  450. package/lib/esm/resources/promotion_rules.js +12 -0
  451. package/lib/esm/resources/promotions.d.ts +39 -25
  452. package/lib/esm/resources/promotions.js +24 -0
  453. package/lib/esm/resources/recurring_order_copies.d.ts +28 -29
  454. package/lib/esm/resources/recurring_order_copies.js +11 -3
  455. package/lib/esm/resources/refunds.d.ts +31 -26
  456. package/lib/esm/resources/refunds.js +18 -2
  457. package/lib/esm/resources/reserved_stocks.d.ts +27 -0
  458. package/lib/esm/resources/reserved_stocks.js +34 -0
  459. package/lib/esm/resources/return_line_items.d.ts +27 -27
  460. package/lib/esm/resources/return_line_items.js +11 -3
  461. package/lib/esm/resources/returns.d.ts +51 -49
  462. package/lib/esm/resources/returns.js +15 -3
  463. package/lib/esm/resources/satispay_gateways.d.ts +24 -22
  464. package/lib/esm/resources/satispay_gateways.js +15 -3
  465. package/lib/esm/resources/satispay_payments.d.ts +31 -21
  466. package/lib/esm/resources/satispay_payments.js +15 -3
  467. package/lib/esm/resources/shipments.d.ts +98 -52
  468. package/lib/esm/resources/shipments.js +27 -1
  469. package/lib/esm/resources/shipping_categories.d.ts +20 -15
  470. package/lib/esm/resources/shipping_categories.js +15 -3
  471. package/lib/esm/resources/shipping_method_tiers.d.ts +19 -17
  472. package/lib/esm/resources/shipping_method_tiers.js +12 -0
  473. package/lib/esm/resources/shipping_methods.d.ts +81 -71
  474. package/lib/esm/resources/shipping_methods.js +15 -3
  475. package/lib/esm/resources/shipping_weight_tiers.d.ts +27 -25
  476. package/lib/esm/resources/shipping_weight_tiers.js +15 -3
  477. package/lib/esm/resources/shipping_zones.d.ts +34 -32
  478. package/lib/esm/resources/shipping_zones.js +15 -3
  479. package/lib/esm/resources/sku_list_items.d.ts +28 -26
  480. package/lib/esm/resources/sku_list_items.js +15 -3
  481. package/lib/esm/resources/sku_list_promotion_rules.d.ts +44 -38
  482. package/lib/esm/resources/sku_list_promotion_rules.js +15 -3
  483. package/lib/esm/resources/sku_lists.d.ts +37 -35
  484. package/lib/esm/resources/sku_lists.js +15 -3
  485. package/lib/esm/resources/sku_options.d.ts +45 -43
  486. package/lib/esm/resources/sku_options.js +15 -3
  487. package/lib/esm/resources/skus.d.ts +60 -55
  488. package/lib/esm/resources/skus.js +19 -3
  489. package/lib/esm/resources/stock_items.d.ts +34 -26
  490. package/lib/esm/resources/stock_items.js +23 -3
  491. package/lib/esm/resources/stock_line_items.d.ts +54 -15
  492. package/lib/esm/resources/stock_line_items.js +25 -0
  493. package/lib/esm/resources/stock_locations.d.ts +34 -29
  494. package/lib/esm/resources/stock_locations.js +15 -3
  495. package/lib/esm/resources/stock_reservations.d.ts +49 -0
  496. package/lib/esm/resources/stock_reservations.js +51 -0
  497. package/lib/esm/resources/stock_transfers.d.ts +46 -42
  498. package/lib/esm/resources/stock_transfers.js +15 -3
  499. package/lib/esm/resources/stripe_gateways.d.ts +24 -22
  500. package/lib/esm/resources/stripe_gateways.js +15 -3
  501. package/lib/esm/resources/stripe_payments.d.ts +39 -28
  502. package/lib/esm/resources/stripe_payments.js +15 -3
  503. package/lib/esm/resources/subscription_models.d.ts +26 -27
  504. package/lib/esm/resources/subscription_models.js +11 -3
  505. package/lib/esm/resources/tags.d.ts +12 -13
  506. package/lib/esm/resources/tags.js +11 -3
  507. package/lib/esm/resources/tax_calculators.d.ts +15 -13
  508. package/lib/esm/resources/tax_calculators.js +12 -0
  509. package/lib/esm/resources/tax_categories.d.ts +32 -30
  510. package/lib/esm/resources/tax_categories.js +15 -3
  511. package/lib/esm/resources/tax_rules.d.ts +53 -51
  512. package/lib/esm/resources/tax_rules.js +15 -3
  513. package/lib/esm/resources/taxjar_accounts.d.ts +23 -21
  514. package/lib/esm/resources/taxjar_accounts.js +15 -3
  515. package/lib/esm/resources/transactions.d.ts +30 -22
  516. package/lib/esm/resources/transactions.js +20 -0
  517. package/lib/esm/resources/versions.d.ts +22 -0
  518. package/lib/esm/resources/versions.js +22 -0
  519. package/lib/esm/resources/voids.d.ts +31 -26
  520. package/lib/esm/resources/voids.js +18 -2
  521. package/lib/esm/resources/webhooks.d.ts +33 -26
  522. package/lib/esm/resources/webhooks.js +15 -3
  523. package/lib/esm/resources/wire_transfers.d.ts +18 -16
  524. package/lib/esm/resources/wire_transfers.js +15 -3
  525. package/lib/esm/static.d.ts +1 -1
  526. package/lib/esm/util.d.ts +4 -1
  527. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  528. package/lib/tsconfig.tsbuildinfo +1 -1
  529. package/package.json +25 -25
  530. package/lib/cjs/micro.d.ts +0 -4
  531. package/lib/cjs/micro.js +0 -13
  532. package/lib/esm/micro.d.ts +0 -4
  533. package/lib/esm/micro.js +0 -7
@@ -1,58 +1,63 @@
1
- import { ApiResource } from '../resource';
2
- import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
- import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
- import type { Address, AddressType } from './addresses';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import type { Address } from './addresses';
5
4
  import type { InventoryStockLocation } from './inventory_stock_locations';
6
5
  import type { InventoryReturnLocation } from './inventory_return_locations';
7
6
  import type { StockItem } from './stock_items';
8
7
  import type { StockTransfer } from './stock_transfers';
9
8
  import type { Attachment } from './attachments';
10
- type StockLocationType = 'stock_locations';
9
+ import type { Version } from './versions';
11
10
  type StockLocationRel = ResourceRel & {
12
- type: StockLocationType;
11
+ type: typeof StockLocations.TYPE;
13
12
  };
14
13
  type AddressRel = ResourceRel & {
15
- type: AddressType;
14
+ type: 'addresses';
16
15
  };
17
16
  interface StockLocation extends Resource {
18
- readonly type: StockLocationType;
19
- number?: number | null;
20
- name: string;
21
- label_format?: string | null;
22
- suppress_etd?: boolean | null;
23
- address?: Address | null;
24
- inventory_stock_locations?: InventoryStockLocation[] | null;
25
- inventory_return_locations?: InventoryReturnLocation[] | null;
26
- stock_items?: StockItem[] | null;
27
- stock_transfers?: StockTransfer[] | null;
28
- attachments?: Attachment[] | null;
17
+ number?: number;
18
+ name?: string;
19
+ code?: string;
20
+ label_format?: string;
21
+ suppress_etd?: boolean;
22
+ address?: Address;
23
+ inventory_stock_locations?: InventoryStockLocation[];
24
+ inventory_return_locations?: InventoryReturnLocation[];
25
+ stock_items?: StockItem[];
26
+ stock_transfers?: StockTransfer[];
27
+ attachments?: Attachment[];
28
+ versions?: Version[];
29
29
  }
30
30
  interface StockLocationCreate extends ResourceCreate {
31
31
  name: string;
32
- label_format?: string | null;
33
- suppress_etd?: boolean | null;
32
+ code?: string;
33
+ label_format?: string;
34
+ suppress_etd?: boolean;
34
35
  address: AddressRel;
35
36
  }
36
37
  interface StockLocationUpdate extends ResourceUpdate {
37
- name?: string | null;
38
- label_format?: string | null;
39
- suppress_etd?: boolean | null;
40
- address?: AddressRel | null;
38
+ name?: string;
39
+ code?: string;
40
+ label_format?: string;
41
+ suppress_etd?: boolean;
42
+ address?: AddressRel;
41
43
  }
42
- declare class StockLocations extends ApiResource<StockLocation> {
43
- static readonly TYPE: StockLocationType;
44
+ declare class StockLocations extends ApiResource {
45
+ static readonly TYPE: 'stock_locations';
46
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLocation>>;
44
47
  create(resource: StockLocationCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
48
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
45
49
  update(resource: StockLocationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
46
- delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
50
+ delete(id: string, options?: ResourcesConfig): Promise<void>;
47
51
  address(stockLocationId: string | StockLocation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
48
52
  inventory_stock_locations(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<InventoryStockLocation>>;
49
53
  inventory_return_locations(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<InventoryReturnLocation>>;
50
54
  stock_items(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockItem>>;
51
55
  stock_transfers(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
52
56
  attachments(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
57
+ versions(stockLocationId: string | StockLocation, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
53
58
  isStockLocation(resource: any): resource is StockLocation;
54
59
  relationship(id: string | ResourceId | null): StockLocationRel;
55
- type(): StockLocationType;
60
+ type(): string;
56
61
  }
57
62
  export default StockLocations;
58
- export type { StockLocation, StockLocationCreate, StockLocationUpdate, StockLocationType };
63
+ export { StockLocation, StockLocationCreate, StockLocationUpdate };
@@ -1,13 +1,20 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class StockLocations extends ApiResource {
3
+ // static readonly PATH = 'stock_locations'
4
+ async list(params, options) {
5
+ return this.resources.list({ type: StockLocations.TYPE }, params, options);
6
+ }
3
7
  async create(resource, params, options) {
4
- return this.resources.create({ ...resource, type: StockLocations.TYPE }, params, options);
8
+ return this.resources.create(Object.assign(Object.assign({}, resource), { type: StockLocations.TYPE }), params, options);
9
+ }
10
+ async retrieve(id, params, options) {
11
+ return this.resources.retrieve({ type: StockLocations.TYPE, id }, params, options);
5
12
  }
6
13
  async update(resource, params, options) {
7
- return this.resources.update({ ...resource, type: StockLocations.TYPE }, params, options);
14
+ return this.resources.update(Object.assign(Object.assign({}, resource), { type: StockLocations.TYPE }), params, options);
8
15
  }
9
16
  async delete(id, options) {
10
- await this.resources.delete((typeof id === 'string') ? { id, type: StockLocations.TYPE } : id, options);
17
+ await this.resources.delete({ type: StockLocations.TYPE, id }, options);
11
18
  }
12
19
  async address(stockLocationId, params, options) {
13
20
  const _stockLocationId = stockLocationId.id || stockLocationId;
@@ -33,6 +40,11 @@ class StockLocations extends ApiResource {
33
40
  const _stockLocationId = stockLocationId.id || stockLocationId;
34
41
  return this.resources.fetch({ type: 'attachments' }, `stock_locations/${_stockLocationId}/attachments`, params, options);
35
42
  }
43
+ async versions(stockLocationId, params, options) {
44
+ const _stockLocationId = stockLocationId.id || stockLocationId;
45
+ return this.resources.fetch({ type: 'versions' }, `stock_locations/${_stockLocationId}/versions`, params, options);
46
+ }
47
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
36
48
  isStockLocation(resource) {
37
49
  return resource.type && (resource.type === StockLocations.TYPE);
38
50
  }
@@ -0,0 +1,49 @@
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import type { LineItem } from './line_items';
4
+ import type { Order } from './orders';
5
+ import type { StockItem } from './stock_items';
6
+ import type { ReservedStock } from './reserved_stocks';
7
+ import type { Sku } from './skus';
8
+ type StockReservationRel = ResourceRel & {
9
+ type: typeof StockReservations.TYPE;
10
+ };
11
+ type StockItemRel = ResourceRel & {
12
+ type: 'stock_items';
13
+ };
14
+ interface StockReservation extends Resource {
15
+ status?: string;
16
+ quantity?: number;
17
+ expires_at?: string;
18
+ line_item?: LineItem;
19
+ order?: Order;
20
+ stock_item?: StockItem;
21
+ reserved_stock?: ReservedStock;
22
+ sku?: Sku;
23
+ }
24
+ interface StockReservationCreate extends ResourceCreate {
25
+ quantity: number;
26
+ stock_item: StockItemRel;
27
+ }
28
+ interface StockReservationUpdate extends ResourceUpdate {
29
+ quantity?: number;
30
+ _pending?: boolean;
31
+ }
32
+ declare class StockReservations extends ApiResource {
33
+ static readonly TYPE: 'stock_reservations';
34
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
35
+ create(resource: StockReservationCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
36
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
37
+ update(resource: StockReservationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
38
+ delete(id: string, options?: ResourcesConfig): Promise<void>;
39
+ line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
40
+ order(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
41
+ stock_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
42
+ reserved_stock(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReservedStock>;
43
+ sku(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
44
+ isStockReservation(resource: any): resource is StockReservation;
45
+ relationship(id: string | ResourceId | null): StockReservationRel;
46
+ type(): string;
47
+ }
48
+ export default StockReservations;
49
+ export { StockReservation, StockReservationCreate, StockReservationUpdate };
@@ -0,0 +1,51 @@
1
+ import { ApiResource } from '../resource';
2
+ class StockReservations extends ApiResource {
3
+ // static readonly PATH = 'stock_reservations'
4
+ async list(params, options) {
5
+ return this.resources.list({ type: StockReservations.TYPE }, params, options);
6
+ }
7
+ async create(resource, params, options) {
8
+ return this.resources.create(Object.assign(Object.assign({}, resource), { type: StockReservations.TYPE }), params, options);
9
+ }
10
+ async retrieve(id, params, options) {
11
+ return this.resources.retrieve({ type: StockReservations.TYPE, id }, params, options);
12
+ }
13
+ async update(resource, params, options) {
14
+ return this.resources.update(Object.assign(Object.assign({}, resource), { type: StockReservations.TYPE }), params, options);
15
+ }
16
+ async delete(id, options) {
17
+ await this.resources.delete({ type: StockReservations.TYPE, id }, options);
18
+ }
19
+ async line_item(stockReservationId, params, options) {
20
+ const _stockReservationId = stockReservationId.id || stockReservationId;
21
+ return this.resources.fetch({ type: 'line_items' }, `stock_reservations/${_stockReservationId}/line_item`, params, options);
22
+ }
23
+ async order(stockReservationId, params, options) {
24
+ const _stockReservationId = stockReservationId.id || stockReservationId;
25
+ return this.resources.fetch({ type: 'orders' }, `stock_reservations/${_stockReservationId}/order`, params, options);
26
+ }
27
+ async stock_item(stockReservationId, params, options) {
28
+ const _stockReservationId = stockReservationId.id || stockReservationId;
29
+ return this.resources.fetch({ type: 'stock_items' }, `stock_reservations/${_stockReservationId}/stock_item`, params, options);
30
+ }
31
+ async reserved_stock(stockReservationId, params, options) {
32
+ const _stockReservationId = stockReservationId.id || stockReservationId;
33
+ return this.resources.fetch({ type: 'reserved_stocks' }, `stock_reservations/${_stockReservationId}/reserved_stock`, params, options);
34
+ }
35
+ async sku(stockReservationId, params, options) {
36
+ const _stockReservationId = stockReservationId.id || stockReservationId;
37
+ return this.resources.fetch({ type: 'skus' }, `stock_reservations/${_stockReservationId}/sku`, params, options);
38
+ }
39
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
40
+ isStockReservation(resource) {
41
+ return resource.type && (resource.type === StockReservations.TYPE);
42
+ }
43
+ relationship(id) {
44
+ return ((id === null) || (typeof id === 'string')) ? { id, type: StockReservations.TYPE } : { id: id.id, type: StockReservations.TYPE };
45
+ }
46
+ type() {
47
+ return StockReservations.TYPE;
48
+ }
49
+ }
50
+ StockReservations.TYPE = 'stock_reservations';
51
+ export default StockReservations;
@@ -1,75 +1,79 @@
1
- import { ApiResource } from '../resource';
2
- import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
- import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
- import type { Sku, SkuType } from './skus';
5
- import type { StockLocation, StockLocationType } from './stock_locations';
6
- import type { Shipment, ShipmentType } from './shipments';
7
- import type { LineItem, LineItemType } from './line_items';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import type { Sku } from './skus';
4
+ import type { StockLocation } from './stock_locations';
5
+ import type { Shipment } from './shipments';
6
+ import type { LineItem } from './line_items';
8
7
  import type { Event } from './events';
9
- type StockTransferType = 'stock_transfers';
8
+ import type { Version } from './versions';
10
9
  type StockTransferRel = ResourceRel & {
11
- type: StockTransferType;
10
+ type: typeof StockTransfers.TYPE;
12
11
  };
13
12
  type SkuRel = ResourceRel & {
14
- type: SkuType;
13
+ type: 'skus';
15
14
  };
16
15
  type StockLocationRel = ResourceRel & {
17
- type: StockLocationType;
16
+ type: 'stock_locations';
18
17
  };
19
18
  type ShipmentRel = ResourceRel & {
20
- type: ShipmentType;
19
+ type: 'shipments';
21
20
  };
22
21
  type LineItemRel = ResourceRel & {
23
- type: LineItemType;
22
+ type: 'line_items';
24
23
  };
25
24
  interface StockTransfer extends Resource {
26
- readonly type: StockTransferType;
27
- sku_code?: string | null;
28
- status: 'draft' | 'upcoming' | 'picking' | 'in_transit' | 'completed' | 'cancelled';
29
- quantity: number;
30
- completed_at?: string | null;
31
- cancelled_at?: string | null;
32
- sku?: Sku | null;
33
- origin_stock_location?: StockLocation | null;
34
- destination_stock_location?: StockLocation | null;
35
- shipment?: Shipment | null;
36
- line_item?: LineItem | null;
37
- events?: Event[] | null;
25
+ number?: string;
26
+ sku_code?: string;
27
+ status?: string;
28
+ quantity?: number;
29
+ completed_at?: string;
30
+ cancelled_at?: string;
31
+ sku?: Sku;
32
+ origin_stock_location?: StockLocation;
33
+ destination_stock_location?: StockLocation;
34
+ shipment?: Shipment;
35
+ line_item?: LineItem;
36
+ events?: Event[];
37
+ versions?: Version[];
38
38
  }
39
39
  interface StockTransferCreate extends ResourceCreate {
40
- sku_code?: string | null;
40
+ sku_code?: string;
41
41
  quantity: number;
42
42
  sku: SkuRel;
43
43
  origin_stock_location: StockLocationRel;
44
44
  destination_stock_location: StockLocationRel;
45
- shipment?: ShipmentRel | null;
46
- line_item?: LineItemRel | null;
45
+ shipment?: ShipmentRel;
46
+ line_item?: LineItemRel;
47
47
  }
48
48
  interface StockTransferUpdate extends ResourceUpdate {
49
- sku_code?: string | null;
50
- _upcoming?: boolean | null;
51
- _picking?: boolean | null;
52
- _in_transit?: boolean | null;
53
- _complete?: boolean | null;
54
- _cancel?: boolean | null;
55
- sku?: SkuRel | null;
56
- origin_stock_location?: StockLocationRel | null;
57
- destination_stock_location?: StockLocationRel | null;
49
+ sku_code?: string;
50
+ _upcoming?: boolean;
51
+ _on_hold?: boolean;
52
+ _picking?: boolean;
53
+ _in_transit?: boolean;
54
+ _complete?: boolean;
55
+ _cancel?: boolean;
56
+ sku?: SkuRel;
57
+ origin_stock_location?: StockLocationRel;
58
+ destination_stock_location?: StockLocationRel;
58
59
  }
59
- declare class StockTransfers extends ApiResource<StockTransfer> {
60
- static readonly TYPE: StockTransferType;
60
+ declare class StockTransfers extends ApiResource {
61
+ static readonly TYPE: 'stock_transfers';
62
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
61
63
  create(resource: StockTransferCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
64
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
62
65
  update(resource: StockTransferUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
63
- delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
66
+ delete(id: string, options?: ResourcesConfig): Promise<void>;
64
67
  sku(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
65
68
  origin_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
66
69
  destination_stock_location(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
67
70
  shipment(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
68
71
  line_item(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
69
72
  events(stockTransferId: string | StockTransfer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
73
+ versions(stockTransferId: string | StockTransfer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
70
74
  isStockTransfer(resource: any): resource is StockTransfer;
71
75
  relationship(id: string | ResourceId | null): StockTransferRel;
72
- type(): StockTransferType;
76
+ type(): string;
73
77
  }
74
78
  export default StockTransfers;
75
- export type { StockTransfer, StockTransferCreate, StockTransferUpdate, StockTransferType };
79
+ export { StockTransfer, StockTransferCreate, StockTransferUpdate };
@@ -1,13 +1,20 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class StockTransfers extends ApiResource {
3
+ // static readonly PATH = 'stock_transfers'
4
+ async list(params, options) {
5
+ return this.resources.list({ type: StockTransfers.TYPE }, params, options);
6
+ }
3
7
  async create(resource, params, options) {
4
- return this.resources.create({ ...resource, type: StockTransfers.TYPE }, params, options);
8
+ return this.resources.create(Object.assign(Object.assign({}, resource), { type: StockTransfers.TYPE }), params, options);
9
+ }
10
+ async retrieve(id, params, options) {
11
+ return this.resources.retrieve({ type: StockTransfers.TYPE, id }, params, options);
5
12
  }
6
13
  async update(resource, params, options) {
7
- return this.resources.update({ ...resource, type: StockTransfers.TYPE }, params, options);
14
+ return this.resources.update(Object.assign(Object.assign({}, resource), { type: StockTransfers.TYPE }), params, options);
8
15
  }
9
16
  async delete(id, options) {
10
- await this.resources.delete((typeof id === 'string') ? { id, type: StockTransfers.TYPE } : id, options);
17
+ await this.resources.delete({ type: StockTransfers.TYPE, id }, options);
11
18
  }
12
19
  async sku(stockTransferId, params, options) {
13
20
  const _stockTransferId = stockTransferId.id || stockTransferId;
@@ -33,6 +40,11 @@ class StockTransfers extends ApiResource {
33
40
  const _stockTransferId = stockTransferId.id || stockTransferId;
34
41
  return this.resources.fetch({ type: 'events' }, `stock_transfers/${_stockTransferId}/events`, params, options);
35
42
  }
43
+ async versions(stockTransferId, params, options) {
44
+ const _stockTransferId = stockTransferId.id || stockTransferId;
45
+ return this.resources.fetch({ type: 'versions' }, `stock_transfers/${_stockTransferId}/versions`, params, options);
46
+ }
47
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
36
48
  isStockTransfer(resource) {
37
49
  return resource.type && (resource.type === StockTransfers.TYPE);
38
50
  }
@@ -1,42 +1,44 @@
1
- import { ApiResource } from '../resource';
2
- import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
- import type { QueryParamsRetrieve, QueryParamsList } from '../query';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
4
3
  import type { PaymentMethod } from './payment_methods';
4
+ import type { Version } from './versions';
5
5
  import type { StripePayment } from './stripe_payments';
6
- type StripeGatewayType = 'stripe_gateways';
7
6
  type StripeGatewayRel = ResourceRel & {
8
- type: StripeGatewayType;
7
+ type: typeof StripeGateways.TYPE;
9
8
  };
10
9
  interface StripeGateway extends Resource {
11
- readonly type: StripeGatewayType;
12
- name: string;
13
- auto_payments?: boolean | null;
14
- webhook_endpoint_id?: string | null;
15
- webhook_endpoint_secret?: string | null;
16
- webhook_endpoint_url?: string | null;
17
- payment_methods?: PaymentMethod[] | null;
18
- stripe_payments?: StripePayment[] | null;
10
+ name?: string;
11
+ auto_payments?: boolean;
12
+ webhook_endpoint_id?: string;
13
+ webhook_endpoint_secret?: string;
14
+ webhook_endpoint_url?: string;
15
+ payment_methods?: PaymentMethod[];
16
+ versions?: Version[];
17
+ stripe_payments?: StripePayment[];
19
18
  }
20
19
  interface StripeGatewayCreate extends ResourceCreate {
21
20
  name: string;
22
21
  login: string;
23
- publishable_key?: string | null;
24
- auto_payments?: boolean | null;
22
+ publishable_key?: string;
23
+ auto_payments?: boolean;
25
24
  }
26
25
  interface StripeGatewayUpdate extends ResourceUpdate {
27
- name?: string | null;
28
- auto_payments?: boolean | null;
26
+ name?: string;
27
+ auto_payments?: boolean;
29
28
  }
30
- declare class StripeGateways extends ApiResource<StripeGateway> {
31
- static readonly TYPE: StripeGatewayType;
29
+ declare class StripeGateways extends ApiResource {
30
+ static readonly TYPE: 'stripe_gateways';
31
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StripeGateway>>;
32
32
  create(resource: StripeGatewayCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripeGateway>;
33
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripeGateway>;
33
34
  update(resource: StripeGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripeGateway>;
34
- delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
35
+ delete(id: string, options?: ResourcesConfig): Promise<void>;
35
36
  payment_methods(stripeGatewayId: string | StripeGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
37
+ versions(stripeGatewayId: string | StripeGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
36
38
  stripe_payments(stripeGatewayId: string | StripeGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StripePayment>>;
37
39
  isStripeGateway(resource: any): resource is StripeGateway;
38
40
  relationship(id: string | ResourceId | null): StripeGatewayRel;
39
- type(): StripeGatewayType;
41
+ type(): string;
40
42
  }
41
43
  export default StripeGateways;
42
- export type { StripeGateway, StripeGatewayCreate, StripeGatewayUpdate, StripeGatewayType };
44
+ export { StripeGateway, StripeGatewayCreate, StripeGatewayUpdate };
@@ -1,22 +1,34 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class StripeGateways extends ApiResource {
3
+ // static readonly PATH = 'stripe_gateways'
4
+ async list(params, options) {
5
+ return this.resources.list({ type: StripeGateways.TYPE }, params, options);
6
+ }
3
7
  async create(resource, params, options) {
4
- return this.resources.create({ ...resource, type: StripeGateways.TYPE }, params, options);
8
+ return this.resources.create(Object.assign(Object.assign({}, resource), { type: StripeGateways.TYPE }), params, options);
9
+ }
10
+ async retrieve(id, params, options) {
11
+ return this.resources.retrieve({ type: StripeGateways.TYPE, id }, params, options);
5
12
  }
6
13
  async update(resource, params, options) {
7
- return this.resources.update({ ...resource, type: StripeGateways.TYPE }, params, options);
14
+ return this.resources.update(Object.assign(Object.assign({}, resource), { type: StripeGateways.TYPE }), params, options);
8
15
  }
9
16
  async delete(id, options) {
10
- await this.resources.delete((typeof id === 'string') ? { id, type: StripeGateways.TYPE } : id, options);
17
+ await this.resources.delete({ type: StripeGateways.TYPE, id }, options);
11
18
  }
12
19
  async payment_methods(stripeGatewayId, params, options) {
13
20
  const _stripeGatewayId = stripeGatewayId.id || stripeGatewayId;
14
21
  return this.resources.fetch({ type: 'payment_methods' }, `stripe_gateways/${_stripeGatewayId}/payment_methods`, params, options);
15
22
  }
23
+ async versions(stripeGatewayId, params, options) {
24
+ const _stripeGatewayId = stripeGatewayId.id || stripeGatewayId;
25
+ return this.resources.fetch({ type: 'versions' }, `stripe_gateways/${_stripeGatewayId}/versions`, params, options);
26
+ }
16
27
  async stripe_payments(stripeGatewayId, params, options) {
17
28
  const _stripeGatewayId = stripeGatewayId.id || stripeGatewayId;
18
29
  return this.resources.fetch({ type: 'stripe_payments' }, `stripe_gateways/${_stripeGatewayId}/stripe_payments`, params, options);
19
30
  }
31
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
20
32
  isStripeGateway(resource) {
21
33
  return resource.type && (resource.type === StripeGateways.TYPE);
22
34
  }
@@ -1,48 +1,59 @@
1
- import { ApiResource } from '../resource';
2
- import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
3
- import type { QueryParamsRetrieve } from '../query';
4
- import type { Order, OrderType } from './orders';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import type { Order } from './orders';
5
4
  import type { PaymentGateway } from './payment_gateways';
6
- type StripePaymentType = 'stripe_payments';
5
+ import type { Version } from './versions';
7
6
  type StripePaymentRel = ResourceRel & {
8
- type: StripePaymentType;
7
+ type: typeof StripePayments.TYPE;
9
8
  };
10
9
  type OrderRel = ResourceRel & {
11
- type: OrderType;
10
+ type: 'orders';
12
11
  };
13
12
  interface StripePayment extends Resource {
14
- readonly type: StripePaymentType;
15
- client_secret: string;
16
- publishable_key?: string | null;
17
- options?: Record<string, any> | null;
18
- payment_method?: Record<string, any> | null;
19
- mismatched_amounts?: boolean | null;
20
- intent_amount_cents: number;
21
- intent_amount_float?: number | null;
22
- formatted_intent_amount?: string | null;
23
- payment_instrument?: Record<string, any> | null;
24
- order?: Order | null;
25
- payment_gateway?: PaymentGateway | null;
13
+ stripe_id?: string;
14
+ client_secret?: string;
15
+ publishable_key?: string;
16
+ options?: object;
17
+ payment_method?: object;
18
+ mismatched_amounts?: boolean;
19
+ intent_amount_cents?: number;
20
+ intent_amount_float?: number;
21
+ formatted_intent_amount?: string;
22
+ return_url?: string;
23
+ receipt_email?: string;
24
+ payment_instrument?: object;
25
+ order?: Order;
26
+ payment_gateway?: PaymentGateway;
27
+ versions?: Version[];
26
28
  }
27
29
  interface StripePaymentCreate extends ResourceCreate {
28
- options?: Record<string, any> | null;
30
+ stripe_id?: string;
31
+ client_secret?: string;
32
+ options?: object;
33
+ return_url?: string;
34
+ receipt_email?: string;
29
35
  order: OrderRel;
30
36
  }
31
37
  interface StripePaymentUpdate extends ResourceUpdate {
32
- options?: Record<string, any> | null;
33
- _refresh?: boolean | null;
34
- order?: OrderRel | null;
38
+ options?: object;
39
+ return_url?: string;
40
+ _update?: boolean;
41
+ _refresh?: boolean;
42
+ order?: OrderRel;
35
43
  }
36
- declare class StripePayments extends ApiResource<StripePayment> {
37
- static readonly TYPE: StripePaymentType;
44
+ declare class StripePayments extends ApiResource {
45
+ static readonly TYPE: 'stripe_payments';
46
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StripePayment>>;
38
47
  create(resource: StripePaymentCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripePayment>;
48
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripePayment>;
39
49
  update(resource: StripePaymentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripePayment>;
40
- delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
50
+ delete(id: string, options?: ResourcesConfig): Promise<void>;
41
51
  order(stripePaymentId: string | StripePayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
42
52
  payment_gateway(stripePaymentId: string | StripePayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
53
+ versions(stripePaymentId: string | StripePayment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
43
54
  isStripePayment(resource: any): resource is StripePayment;
44
55
  relationship(id: string | ResourceId | null): StripePaymentRel;
45
- type(): StripePaymentType;
56
+ type(): string;
46
57
  }
47
58
  export default StripePayments;
48
- export type { StripePayment, StripePaymentCreate, StripePaymentUpdate, StripePaymentType };
59
+ export { StripePayment, StripePaymentCreate, StripePaymentUpdate };
@@ -1,13 +1,20 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class StripePayments extends ApiResource {
3
+ // static readonly PATH = 'stripe_payments'
4
+ async list(params, options) {
5
+ return this.resources.list({ type: StripePayments.TYPE }, params, options);
6
+ }
3
7
  async create(resource, params, options) {
4
- return this.resources.create({ ...resource, type: StripePayments.TYPE }, params, options);
8
+ return this.resources.create(Object.assign(Object.assign({}, resource), { type: StripePayments.TYPE }), params, options);
9
+ }
10
+ async retrieve(id, params, options) {
11
+ return this.resources.retrieve({ type: StripePayments.TYPE, id }, params, options);
5
12
  }
6
13
  async update(resource, params, options) {
7
- return this.resources.update({ ...resource, type: StripePayments.TYPE }, params, options);
14
+ return this.resources.update(Object.assign(Object.assign({}, resource), { type: StripePayments.TYPE }), params, options);
8
15
  }
9
16
  async delete(id, options) {
10
- await this.resources.delete((typeof id === 'string') ? { id, type: StripePayments.TYPE } : id, options);
17
+ await this.resources.delete({ type: StripePayments.TYPE, id }, options);
11
18
  }
12
19
  async order(stripePaymentId, params, options) {
13
20
  const _stripePaymentId = stripePaymentId.id || stripePaymentId;
@@ -17,6 +24,11 @@ class StripePayments extends ApiResource {
17
24
  const _stripePaymentId = stripePaymentId.id || stripePaymentId;
18
25
  return this.resources.fetch({ type: 'payment_gateways' }, `stripe_payments/${_stripePaymentId}/payment_gateway`, params, options);
19
26
  }
27
+ async versions(stripePaymentId, params, options) {
28
+ const _stripePaymentId = stripePaymentId.id || stripePaymentId;
29
+ return this.resources.fetch({ type: 'versions' }, `stripe_payments/${_stripePaymentId}/versions`, params, options);
30
+ }
31
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
20
32
  isStripePayment(resource) {
21
33
  return resource.type && (resource.type === StripePayments.TYPE);
22
34
  }