@commercelayer/sdk 4.27.1 → 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 (443) hide show
  1. package/lib/cjs/api.d.ts +10 -3
  2. package/lib/cjs/api.js +25 -4
  3. package/lib/cjs/commercelayer.d.ts +9 -2
  4. package/lib/cjs/commercelayer.js +8 -1
  5. package/lib/cjs/model.d.ts +10 -3
  6. package/lib/cjs/resource.d.ts +7 -9
  7. package/lib/cjs/resources/addresses.d.ts +14 -0
  8. package/lib/cjs/resources/addresses.js +12 -0
  9. package/lib/cjs/resources/adjustments.d.ts +3 -0
  10. package/lib/cjs/resources/adjustments.js +4 -0
  11. package/lib/cjs/resources/adyen_gateways.d.ts +5 -2
  12. package/lib/cjs/resources/adyen_gateways.js +4 -0
  13. package/lib/cjs/resources/adyen_payments.d.ts +3 -0
  14. package/lib/cjs/resources/adyen_payments.js +4 -0
  15. package/lib/cjs/resources/authorizations.d.ts +9 -3
  16. package/lib/cjs/resources/authorizations.js +12 -4
  17. package/lib/cjs/resources/avalara_accounts.d.ts +9 -6
  18. package/lib/cjs/resources/avalara_accounts.js +4 -0
  19. package/lib/cjs/resources/axerve_gateways.d.ts +4 -0
  20. package/lib/cjs/resources/axerve_gateways.js +4 -0
  21. package/lib/cjs/resources/axerve_payments.d.ts +9 -0
  22. package/lib/cjs/resources/axerve_payments.js +4 -0
  23. package/lib/cjs/resources/billing_info_validation_rules.d.ts +3 -0
  24. package/lib/cjs/resources/billing_info_validation_rules.js +4 -0
  25. package/lib/cjs/resources/braintree_gateways.d.ts +3 -0
  26. package/lib/cjs/resources/braintree_gateways.js +4 -0
  27. package/lib/cjs/resources/braintree_payments.d.ts +3 -0
  28. package/lib/cjs/resources/braintree_payments.js +4 -0
  29. package/lib/cjs/resources/bundles.d.ts +16 -2
  30. package/lib/cjs/resources/bundles.js +12 -0
  31. package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +134 -0
  32. package/lib/cjs/resources/buy_x_pay_y_promotions.js +81 -0
  33. package/lib/cjs/resources/captures.d.ts +9 -3
  34. package/lib/cjs/resources/captures.js +12 -4
  35. package/lib/cjs/resources/carrier_accounts.d.ts +3 -0
  36. package/lib/cjs/resources/carrier_accounts.js +4 -0
  37. package/lib/cjs/resources/checkout_com_gateways.d.ts +3 -0
  38. package/lib/cjs/resources/checkout_com_gateways.js +4 -0
  39. package/lib/cjs/resources/checkout_com_payments.d.ts +3 -0
  40. package/lib/cjs/resources/checkout_com_payments.js +4 -0
  41. package/lib/cjs/resources/cleanups.d.ts +3 -0
  42. package/lib/cjs/resources/cleanups.js +4 -0
  43. package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +10 -3
  44. package/lib/cjs/resources/coupon_codes_promotion_rules.js +4 -0
  45. package/lib/cjs/resources/coupon_recipients.d.ts +3 -0
  46. package/lib/cjs/resources/coupon_recipients.js +4 -0
  47. package/lib/cjs/resources/coupons.d.ts +26 -1
  48. package/lib/cjs/resources/coupons.js +16 -0
  49. package/lib/cjs/resources/custom_promotion_rules.d.ts +61 -0
  50. package/lib/cjs/resources/custom_promotion_rules.js +37 -0
  51. package/lib/cjs/resources/customer_addresses.d.ts +5 -0
  52. package/lib/cjs/resources/customer_addresses.js +4 -0
  53. package/lib/cjs/resources/customer_groups.d.ts +3 -0
  54. package/lib/cjs/resources/customer_groups.js +4 -0
  55. package/lib/cjs/resources/customer_payment_sources.d.ts +18 -11
  56. package/lib/cjs/resources/customer_payment_sources.js +8 -0
  57. package/lib/cjs/resources/customer_subscriptions.d.ts +3 -0
  58. package/lib/cjs/resources/customer_subscriptions.js +4 -0
  59. package/lib/cjs/resources/customers.d.ts +9 -0
  60. package/lib/cjs/resources/customers.js +4 -0
  61. package/lib/cjs/resources/delivery_lead_times.d.ts +3 -0
  62. package/lib/cjs/resources/delivery_lead_times.js +4 -0
  63. package/lib/cjs/resources/external_gateways.d.ts +3 -0
  64. package/lib/cjs/resources/external_gateways.js +4 -0
  65. package/lib/cjs/resources/external_payments.d.ts +3 -0
  66. package/lib/cjs/resources/external_payments.js +4 -0
  67. package/lib/cjs/resources/external_promotions.d.ts +45 -6
  68. package/lib/cjs/resources/external_promotions.js +24 -0
  69. package/lib/cjs/resources/external_tax_calculators.d.ts +3 -0
  70. package/lib/cjs/resources/external_tax_calculators.js +4 -0
  71. package/lib/cjs/resources/fixed_amount_promotions.d.ts +45 -6
  72. package/lib/cjs/resources/fixed_amount_promotions.js +24 -0
  73. package/lib/cjs/resources/fixed_price_promotions.d.ts +37 -9
  74. package/lib/cjs/resources/fixed_price_promotions.js +18 -2
  75. package/lib/cjs/resources/free_gift_promotions.d.ts +37 -9
  76. package/lib/cjs/resources/free_gift_promotions.js +18 -2
  77. package/lib/cjs/resources/free_shipping_promotions.d.ts +42 -6
  78. package/lib/cjs/resources/free_shipping_promotions.js +20 -0
  79. package/lib/cjs/resources/gift_card_recipients.d.ts +3 -0
  80. package/lib/cjs/resources/gift_card_recipients.js +4 -0
  81. package/lib/cjs/resources/gift_cards.d.ts +11 -0
  82. package/lib/cjs/resources/gift_cards.js +8 -0
  83. package/lib/cjs/resources/imports.d.ts +1 -3
  84. package/lib/cjs/resources/in_stock_subscriptions.d.ts +3 -0
  85. package/lib/cjs/resources/in_stock_subscriptions.js +4 -0
  86. package/lib/cjs/resources/inventory_models.d.ts +12 -0
  87. package/lib/cjs/resources/inventory_models.js +4 -0
  88. package/lib/cjs/resources/inventory_return_locations.d.ts +3 -0
  89. package/lib/cjs/resources/inventory_return_locations.js +4 -0
  90. package/lib/cjs/resources/inventory_stock_locations.d.ts +3 -0
  91. package/lib/cjs/resources/inventory_stock_locations.js +4 -0
  92. package/lib/cjs/resources/klarna_gateways.d.ts +3 -0
  93. package/lib/cjs/resources/klarna_gateways.js +4 -0
  94. package/lib/cjs/resources/klarna_payments.d.ts +3 -0
  95. package/lib/cjs/resources/klarna_payments.js +4 -0
  96. package/lib/cjs/resources/line_item_options.d.ts +11 -0
  97. package/lib/cjs/resources/line_item_options.js +8 -0
  98. package/lib/cjs/resources/line_items.d.ts +30 -0
  99. package/lib/cjs/resources/line_items.js +16 -0
  100. package/lib/cjs/resources/manual_gateways.d.ts +3 -0
  101. package/lib/cjs/resources/manual_gateways.js +4 -0
  102. package/lib/cjs/resources/manual_tax_calculators.d.ts +3 -0
  103. package/lib/cjs/resources/manual_tax_calculators.js +4 -0
  104. package/lib/cjs/resources/markets.d.ts +8 -0
  105. package/lib/cjs/resources/markets.js +4 -0
  106. package/lib/cjs/resources/merchants.d.ts +3 -0
  107. package/lib/cjs/resources/merchants.js +4 -0
  108. package/lib/cjs/resources/order_amount_promotion_rules.d.ts +13 -3
  109. package/lib/cjs/resources/order_amount_promotion_rules.js +4 -0
  110. package/lib/cjs/resources/order_subscription_items.d.ts +7 -0
  111. package/lib/cjs/resources/order_subscription_items.js +4 -0
  112. package/lib/cjs/resources/order_subscriptions.d.ts +4 -0
  113. package/lib/cjs/resources/order_subscriptions.js +4 -0
  114. package/lib/cjs/resources/order_validation_rules.d.ts +3 -0
  115. package/lib/cjs/resources/order_validation_rules.js +4 -0
  116. package/lib/cjs/resources/orders.d.ts +50 -6
  117. package/lib/cjs/resources/orders.js +32 -0
  118. package/lib/cjs/resources/organization.d.ts +4 -4
  119. package/lib/cjs/resources/packages.d.ts +3 -0
  120. package/lib/cjs/resources/packages.js +4 -0
  121. package/lib/cjs/resources/parcel_line_items.d.ts +4 -1
  122. package/lib/cjs/resources/parcel_line_items.js +4 -0
  123. package/lib/cjs/resources/parcels.d.ts +9 -3
  124. package/lib/cjs/resources/parcels.js +4 -0
  125. package/lib/cjs/resources/payment_gateways.d.ts +3 -0
  126. package/lib/cjs/resources/payment_gateways.js +4 -0
  127. package/lib/cjs/resources/payment_methods.d.ts +9 -1
  128. package/lib/cjs/resources/payment_methods.js +4 -0
  129. package/lib/cjs/resources/payment_options.d.ts +43 -0
  130. package/lib/cjs/resources/payment_options.js +41 -0
  131. package/lib/cjs/resources/paypal_gateways.d.ts +3 -0
  132. package/lib/cjs/resources/paypal_gateways.js +4 -0
  133. package/lib/cjs/resources/paypal_payments.d.ts +3 -0
  134. package/lib/cjs/resources/paypal_payments.js +4 -0
  135. package/lib/cjs/resources/percentage_discount_promotions.d.ts +37 -9
  136. package/lib/cjs/resources/percentage_discount_promotions.js +18 -2
  137. package/lib/cjs/resources/price_frequency_tiers.d.ts +3 -0
  138. package/lib/cjs/resources/price_frequency_tiers.js +4 -0
  139. package/lib/cjs/resources/price_lists.d.ts +6 -0
  140. package/lib/cjs/resources/price_lists.js +4 -0
  141. package/lib/cjs/resources/price_tiers.d.ts +3 -0
  142. package/lib/cjs/resources/price_tiers.js +4 -0
  143. package/lib/cjs/resources/price_volume_tiers.d.ts +3 -0
  144. package/lib/cjs/resources/price_volume_tiers.js +4 -0
  145. package/lib/cjs/resources/prices.d.ts +4 -1
  146. package/lib/cjs/resources/prices.js +4 -0
  147. package/lib/cjs/resources/promotion_rules.d.ts +5 -1
  148. package/lib/cjs/resources/promotion_rules.js +4 -0
  149. package/lib/cjs/resources/promotions.d.ts +18 -0
  150. package/lib/cjs/resources/promotions.js +20 -0
  151. package/lib/cjs/resources/refunds.d.ts +9 -3
  152. package/lib/cjs/resources/refunds.js +10 -2
  153. package/lib/cjs/resources/reserved_stocks.d.ts +27 -0
  154. package/lib/cjs/resources/reserved_stocks.js +36 -0
  155. package/lib/cjs/resources/return_line_items.d.ts +2 -1
  156. package/lib/cjs/resources/returns.d.ts +11 -0
  157. package/lib/cjs/resources/returns.js +8 -0
  158. package/lib/cjs/resources/satispay_gateways.d.ts +6 -0
  159. package/lib/cjs/resources/satispay_gateways.js +4 -0
  160. package/lib/cjs/resources/satispay_payments.d.ts +11 -3
  161. package/lib/cjs/resources/satispay_payments.js +4 -0
  162. package/lib/cjs/resources/shipments.d.ts +49 -2
  163. package/lib/cjs/resources/shipments.js +18 -0
  164. package/lib/cjs/resources/shipping_categories.d.ts +6 -0
  165. package/lib/cjs/resources/shipping_categories.js +4 -0
  166. package/lib/cjs/resources/shipping_method_tiers.d.ts +3 -0
  167. package/lib/cjs/resources/shipping_method_tiers.js +4 -0
  168. package/lib/cjs/resources/shipping_methods.d.ts +11 -0
  169. package/lib/cjs/resources/shipping_methods.js +4 -0
  170. package/lib/cjs/resources/shipping_weight_tiers.d.ts +3 -0
  171. package/lib/cjs/resources/shipping_weight_tiers.js +4 -0
  172. package/lib/cjs/resources/shipping_zones.d.ts +3 -0
  173. package/lib/cjs/resources/shipping_zones.js +4 -0
  174. package/lib/cjs/resources/sku_list_items.d.ts +3 -0
  175. package/lib/cjs/resources/sku_list_items.js +4 -0
  176. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +10 -3
  177. package/lib/cjs/resources/sku_list_promotion_rules.js +4 -0
  178. package/lib/cjs/resources/sku_lists.d.ts +3 -0
  179. package/lib/cjs/resources/sku_lists.js +4 -0
  180. package/lib/cjs/resources/sku_options.d.ts +14 -0
  181. package/lib/cjs/resources/sku_options.js +12 -0
  182. package/lib/cjs/resources/skus.d.ts +17 -0
  183. package/lib/cjs/resources/skus.js +16 -0
  184. package/lib/cjs/resources/stock_items.d.ts +9 -0
  185. package/lib/cjs/resources/stock_items.js +12 -0
  186. package/lib/cjs/resources/stock_line_items.d.ts +42 -2
  187. package/lib/cjs/resources/stock_line_items.js +17 -0
  188. package/lib/cjs/resources/stock_locations.d.ts +6 -0
  189. package/lib/cjs/resources/stock_locations.js +4 -0
  190. package/lib/cjs/resources/stock_reservations.d.ts +49 -0
  191. package/lib/cjs/resources/stock_reservations.js +53 -0
  192. package/lib/cjs/resources/stock_transfers.d.ts +5 -0
  193. package/lib/cjs/resources/stock_transfers.js +4 -0
  194. package/lib/cjs/resources/stripe_gateways.d.ts +3 -0
  195. package/lib/cjs/resources/stripe_gateways.js +4 -0
  196. package/lib/cjs/resources/stripe_payments.d.ts +12 -0
  197. package/lib/cjs/resources/stripe_payments.js +4 -0
  198. package/lib/cjs/resources/tags.d.ts +27 -0
  199. package/lib/cjs/resources/tags.js +33 -0
  200. package/lib/cjs/resources/tax_calculators.d.ts +3 -0
  201. package/lib/cjs/resources/tax_calculators.js +4 -0
  202. package/lib/cjs/resources/tax_categories.d.ts +3 -0
  203. package/lib/cjs/resources/tax_categories.js +4 -0
  204. package/lib/cjs/resources/tax_rules.d.ts +3 -0
  205. package/lib/cjs/resources/tax_rules.js +4 -0
  206. package/lib/cjs/resources/taxjar_accounts.d.ts +3 -0
  207. package/lib/cjs/resources/taxjar_accounts.js +4 -0
  208. package/lib/cjs/resources/transactions.d.ts +9 -0
  209. package/lib/cjs/resources/transactions.js +12 -0
  210. package/lib/cjs/resources/versions.d.ts +22 -0
  211. package/lib/cjs/resources/versions.js +24 -0
  212. package/lib/cjs/resources/voids.d.ts +9 -3
  213. package/lib/cjs/resources/voids.js +10 -2
  214. package/lib/cjs/resources/webhooks.d.ts +8 -0
  215. package/lib/cjs/resources/webhooks.js +4 -0
  216. package/lib/cjs/resources/wire_transfers.d.ts +3 -0
  217. package/lib/cjs/resources/wire_transfers.js +4 -0
  218. package/lib/cjs/util.d.ts +1 -0
  219. package/lib/esm/api.d.ts +10 -3
  220. package/lib/esm/api.js +15 -1
  221. package/lib/esm/commercelayer.d.ts +9 -2
  222. package/lib/esm/commercelayer.js +8 -1
  223. package/lib/esm/model.d.ts +10 -3
  224. package/lib/esm/resource.d.ts +7 -9
  225. package/lib/esm/resources/addresses.d.ts +14 -0
  226. package/lib/esm/resources/addresses.js +12 -0
  227. package/lib/esm/resources/adjustments.d.ts +3 -0
  228. package/lib/esm/resources/adjustments.js +4 -0
  229. package/lib/esm/resources/adyen_gateways.d.ts +5 -2
  230. package/lib/esm/resources/adyen_gateways.js +4 -0
  231. package/lib/esm/resources/adyen_payments.d.ts +3 -0
  232. package/lib/esm/resources/adyen_payments.js +4 -0
  233. package/lib/esm/resources/authorizations.d.ts +9 -3
  234. package/lib/esm/resources/authorizations.js +12 -4
  235. package/lib/esm/resources/avalara_accounts.d.ts +9 -6
  236. package/lib/esm/resources/avalara_accounts.js +4 -0
  237. package/lib/esm/resources/axerve_gateways.d.ts +4 -0
  238. package/lib/esm/resources/axerve_gateways.js +4 -0
  239. package/lib/esm/resources/axerve_payments.d.ts +9 -0
  240. package/lib/esm/resources/axerve_payments.js +4 -0
  241. package/lib/esm/resources/billing_info_validation_rules.d.ts +3 -0
  242. package/lib/esm/resources/billing_info_validation_rules.js +4 -0
  243. package/lib/esm/resources/braintree_gateways.d.ts +3 -0
  244. package/lib/esm/resources/braintree_gateways.js +4 -0
  245. package/lib/esm/resources/braintree_payments.d.ts +3 -0
  246. package/lib/esm/resources/braintree_payments.js +4 -0
  247. package/lib/esm/resources/bundles.d.ts +16 -2
  248. package/lib/esm/resources/bundles.js +12 -0
  249. package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +134 -0
  250. package/lib/esm/resources/buy_x_pay_y_promotions.js +79 -0
  251. package/lib/esm/resources/captures.d.ts +9 -3
  252. package/lib/esm/resources/captures.js +12 -4
  253. package/lib/esm/resources/carrier_accounts.d.ts +3 -0
  254. package/lib/esm/resources/carrier_accounts.js +4 -0
  255. package/lib/esm/resources/checkout_com_gateways.d.ts +3 -0
  256. package/lib/esm/resources/checkout_com_gateways.js +4 -0
  257. package/lib/esm/resources/checkout_com_payments.d.ts +3 -0
  258. package/lib/esm/resources/checkout_com_payments.js +4 -0
  259. package/lib/esm/resources/cleanups.d.ts +3 -0
  260. package/lib/esm/resources/cleanups.js +4 -0
  261. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +10 -3
  262. package/lib/esm/resources/coupon_codes_promotion_rules.js +4 -0
  263. package/lib/esm/resources/coupon_recipients.d.ts +3 -0
  264. package/lib/esm/resources/coupon_recipients.js +4 -0
  265. package/lib/esm/resources/coupons.d.ts +26 -1
  266. package/lib/esm/resources/coupons.js +16 -0
  267. package/lib/esm/resources/custom_promotion_rules.d.ts +61 -0
  268. package/lib/esm/resources/custom_promotion_rules.js +35 -0
  269. package/lib/esm/resources/customer_addresses.d.ts +5 -0
  270. package/lib/esm/resources/customer_addresses.js +4 -0
  271. package/lib/esm/resources/customer_groups.d.ts +3 -0
  272. package/lib/esm/resources/customer_groups.js +4 -0
  273. package/lib/esm/resources/customer_payment_sources.d.ts +18 -11
  274. package/lib/esm/resources/customer_payment_sources.js +8 -0
  275. package/lib/esm/resources/customer_subscriptions.d.ts +3 -0
  276. package/lib/esm/resources/customer_subscriptions.js +4 -0
  277. package/lib/esm/resources/customers.d.ts +9 -0
  278. package/lib/esm/resources/customers.js +4 -0
  279. package/lib/esm/resources/delivery_lead_times.d.ts +3 -0
  280. package/lib/esm/resources/delivery_lead_times.js +4 -0
  281. package/lib/esm/resources/external_gateways.d.ts +3 -0
  282. package/lib/esm/resources/external_gateways.js +4 -0
  283. package/lib/esm/resources/external_payments.d.ts +3 -0
  284. package/lib/esm/resources/external_payments.js +4 -0
  285. package/lib/esm/resources/external_promotions.d.ts +45 -6
  286. package/lib/esm/resources/external_promotions.js +24 -0
  287. package/lib/esm/resources/external_tax_calculators.d.ts +3 -0
  288. package/lib/esm/resources/external_tax_calculators.js +4 -0
  289. package/lib/esm/resources/fixed_amount_promotions.d.ts +45 -6
  290. package/lib/esm/resources/fixed_amount_promotions.js +24 -0
  291. package/lib/esm/resources/fixed_price_promotions.d.ts +37 -9
  292. package/lib/esm/resources/fixed_price_promotions.js +18 -2
  293. package/lib/esm/resources/free_gift_promotions.d.ts +37 -9
  294. package/lib/esm/resources/free_gift_promotions.js +18 -2
  295. package/lib/esm/resources/free_shipping_promotions.d.ts +42 -6
  296. package/lib/esm/resources/free_shipping_promotions.js +20 -0
  297. package/lib/esm/resources/gift_card_recipients.d.ts +3 -0
  298. package/lib/esm/resources/gift_card_recipients.js +4 -0
  299. package/lib/esm/resources/gift_cards.d.ts +11 -0
  300. package/lib/esm/resources/gift_cards.js +8 -0
  301. package/lib/esm/resources/imports.d.ts +1 -3
  302. package/lib/esm/resources/in_stock_subscriptions.d.ts +3 -0
  303. package/lib/esm/resources/in_stock_subscriptions.js +4 -0
  304. package/lib/esm/resources/inventory_models.d.ts +12 -0
  305. package/lib/esm/resources/inventory_models.js +4 -0
  306. package/lib/esm/resources/inventory_return_locations.d.ts +3 -0
  307. package/lib/esm/resources/inventory_return_locations.js +4 -0
  308. package/lib/esm/resources/inventory_stock_locations.d.ts +3 -0
  309. package/lib/esm/resources/inventory_stock_locations.js +4 -0
  310. package/lib/esm/resources/klarna_gateways.d.ts +3 -0
  311. package/lib/esm/resources/klarna_gateways.js +4 -0
  312. package/lib/esm/resources/klarna_payments.d.ts +3 -0
  313. package/lib/esm/resources/klarna_payments.js +4 -0
  314. package/lib/esm/resources/line_item_options.d.ts +11 -0
  315. package/lib/esm/resources/line_item_options.js +8 -0
  316. package/lib/esm/resources/line_items.d.ts +30 -0
  317. package/lib/esm/resources/line_items.js +16 -0
  318. package/lib/esm/resources/manual_gateways.d.ts +3 -0
  319. package/lib/esm/resources/manual_gateways.js +4 -0
  320. package/lib/esm/resources/manual_tax_calculators.d.ts +3 -0
  321. package/lib/esm/resources/manual_tax_calculators.js +4 -0
  322. package/lib/esm/resources/markets.d.ts +8 -0
  323. package/lib/esm/resources/markets.js +4 -0
  324. package/lib/esm/resources/merchants.d.ts +3 -0
  325. package/lib/esm/resources/merchants.js +4 -0
  326. package/lib/esm/resources/order_amount_promotion_rules.d.ts +13 -3
  327. package/lib/esm/resources/order_amount_promotion_rules.js +4 -0
  328. package/lib/esm/resources/order_subscription_items.d.ts +7 -0
  329. package/lib/esm/resources/order_subscription_items.js +4 -0
  330. package/lib/esm/resources/order_subscriptions.d.ts +4 -0
  331. package/lib/esm/resources/order_subscriptions.js +4 -0
  332. package/lib/esm/resources/order_validation_rules.d.ts +3 -0
  333. package/lib/esm/resources/order_validation_rules.js +4 -0
  334. package/lib/esm/resources/orders.d.ts +50 -6
  335. package/lib/esm/resources/orders.js +32 -0
  336. package/lib/esm/resources/organization.d.ts +4 -4
  337. package/lib/esm/resources/packages.d.ts +3 -0
  338. package/lib/esm/resources/packages.js +4 -0
  339. package/lib/esm/resources/parcel_line_items.d.ts +4 -1
  340. package/lib/esm/resources/parcel_line_items.js +4 -0
  341. package/lib/esm/resources/parcels.d.ts +9 -3
  342. package/lib/esm/resources/parcels.js +4 -0
  343. package/lib/esm/resources/payment_gateways.d.ts +3 -0
  344. package/lib/esm/resources/payment_gateways.js +4 -0
  345. package/lib/esm/resources/payment_methods.d.ts +9 -1
  346. package/lib/esm/resources/payment_methods.js +4 -0
  347. package/lib/esm/resources/payment_options.d.ts +43 -0
  348. package/lib/esm/resources/payment_options.js +39 -0
  349. package/lib/esm/resources/paypal_gateways.d.ts +3 -0
  350. package/lib/esm/resources/paypal_gateways.js +4 -0
  351. package/lib/esm/resources/paypal_payments.d.ts +3 -0
  352. package/lib/esm/resources/paypal_payments.js +4 -0
  353. package/lib/esm/resources/percentage_discount_promotions.d.ts +37 -9
  354. package/lib/esm/resources/percentage_discount_promotions.js +18 -2
  355. package/lib/esm/resources/price_frequency_tiers.d.ts +3 -0
  356. package/lib/esm/resources/price_frequency_tiers.js +4 -0
  357. package/lib/esm/resources/price_lists.d.ts +6 -0
  358. package/lib/esm/resources/price_lists.js +4 -0
  359. package/lib/esm/resources/price_tiers.d.ts +3 -0
  360. package/lib/esm/resources/price_tiers.js +4 -0
  361. package/lib/esm/resources/price_volume_tiers.d.ts +3 -0
  362. package/lib/esm/resources/price_volume_tiers.js +4 -0
  363. package/lib/esm/resources/prices.d.ts +4 -1
  364. package/lib/esm/resources/prices.js +4 -0
  365. package/lib/esm/resources/promotion_rules.d.ts +5 -1
  366. package/lib/esm/resources/promotion_rules.js +4 -0
  367. package/lib/esm/resources/promotions.d.ts +18 -0
  368. package/lib/esm/resources/promotions.js +20 -0
  369. package/lib/esm/resources/refunds.d.ts +9 -3
  370. package/lib/esm/resources/refunds.js +10 -2
  371. package/lib/esm/resources/reserved_stocks.d.ts +27 -0
  372. package/lib/esm/resources/reserved_stocks.js +34 -0
  373. package/lib/esm/resources/return_line_items.d.ts +2 -1
  374. package/lib/esm/resources/returns.d.ts +11 -0
  375. package/lib/esm/resources/returns.js +8 -0
  376. package/lib/esm/resources/satispay_gateways.d.ts +6 -0
  377. package/lib/esm/resources/satispay_gateways.js +4 -0
  378. package/lib/esm/resources/satispay_payments.d.ts +11 -3
  379. package/lib/esm/resources/satispay_payments.js +4 -0
  380. package/lib/esm/resources/shipments.d.ts +49 -2
  381. package/lib/esm/resources/shipments.js +18 -0
  382. package/lib/esm/resources/shipping_categories.d.ts +6 -0
  383. package/lib/esm/resources/shipping_categories.js +4 -0
  384. package/lib/esm/resources/shipping_method_tiers.d.ts +3 -0
  385. package/lib/esm/resources/shipping_method_tiers.js +4 -0
  386. package/lib/esm/resources/shipping_methods.d.ts +11 -0
  387. package/lib/esm/resources/shipping_methods.js +4 -0
  388. package/lib/esm/resources/shipping_weight_tiers.d.ts +3 -0
  389. package/lib/esm/resources/shipping_weight_tiers.js +4 -0
  390. package/lib/esm/resources/shipping_zones.d.ts +3 -0
  391. package/lib/esm/resources/shipping_zones.js +4 -0
  392. package/lib/esm/resources/sku_list_items.d.ts +3 -0
  393. package/lib/esm/resources/sku_list_items.js +4 -0
  394. package/lib/esm/resources/sku_list_promotion_rules.d.ts +10 -3
  395. package/lib/esm/resources/sku_list_promotion_rules.js +4 -0
  396. package/lib/esm/resources/sku_lists.d.ts +3 -0
  397. package/lib/esm/resources/sku_lists.js +4 -0
  398. package/lib/esm/resources/sku_options.d.ts +14 -0
  399. package/lib/esm/resources/sku_options.js +12 -0
  400. package/lib/esm/resources/skus.d.ts +17 -0
  401. package/lib/esm/resources/skus.js +16 -0
  402. package/lib/esm/resources/stock_items.d.ts +9 -0
  403. package/lib/esm/resources/stock_items.js +12 -0
  404. package/lib/esm/resources/stock_line_items.d.ts +42 -2
  405. package/lib/esm/resources/stock_line_items.js +17 -0
  406. package/lib/esm/resources/stock_locations.d.ts +6 -0
  407. package/lib/esm/resources/stock_locations.js +4 -0
  408. package/lib/esm/resources/stock_reservations.d.ts +49 -0
  409. package/lib/esm/resources/stock_reservations.js +51 -0
  410. package/lib/esm/resources/stock_transfers.d.ts +5 -0
  411. package/lib/esm/resources/stock_transfers.js +4 -0
  412. package/lib/esm/resources/stripe_gateways.d.ts +3 -0
  413. package/lib/esm/resources/stripe_gateways.js +4 -0
  414. package/lib/esm/resources/stripe_payments.d.ts +12 -0
  415. package/lib/esm/resources/stripe_payments.js +4 -0
  416. package/lib/esm/resources/tags.d.ts +27 -0
  417. package/lib/esm/resources/tags.js +31 -0
  418. package/lib/esm/resources/tax_calculators.d.ts +3 -0
  419. package/lib/esm/resources/tax_calculators.js +4 -0
  420. package/lib/esm/resources/tax_categories.d.ts +3 -0
  421. package/lib/esm/resources/tax_categories.js +4 -0
  422. package/lib/esm/resources/tax_rules.d.ts +3 -0
  423. package/lib/esm/resources/tax_rules.js +4 -0
  424. package/lib/esm/resources/taxjar_accounts.d.ts +3 -0
  425. package/lib/esm/resources/taxjar_accounts.js +4 -0
  426. package/lib/esm/resources/transactions.d.ts +9 -0
  427. package/lib/esm/resources/transactions.js +12 -0
  428. package/lib/esm/resources/versions.d.ts +22 -0
  429. package/lib/esm/resources/versions.js +22 -0
  430. package/lib/esm/resources/voids.d.ts +9 -3
  431. package/lib/esm/resources/voids.js +10 -2
  432. package/lib/esm/resources/webhooks.d.ts +8 -0
  433. package/lib/esm/resources/webhooks.js +4 -0
  434. package/lib/esm/resources/wire_transfers.d.ts +3 -0
  435. package/lib/esm/resources/wire_transfers.js +4 -0
  436. package/lib/esm/util.d.ts +1 -0
  437. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  438. package/lib/tsconfig.tsbuildinfo +1 -1
  439. package/package.json +25 -25
  440. package/lib/cjs/micro.d.ts +0 -4
  441. package/lib/cjs/micro.js +0 -13
  442. package/lib/esm/micro.d.ts +0 -4
  443. package/lib/esm/micro.js +0 -7
@@ -26,6 +26,10 @@ class PriceVolumeTiers extends resource_1.ApiResource {
26
26
  const _priceVolumeTierId = priceVolumeTierId.id || priceVolumeTierId;
27
27
  return this.resources.fetch({ type: 'attachments' }, `price_volume_tiers/${_priceVolumeTierId}/attachments`, params, options);
28
28
  }
29
+ async versions(priceVolumeTierId, params, options) {
30
+ const _priceVolumeTierId = priceVolumeTierId.id || priceVolumeTierId;
31
+ return this.resources.fetch({ type: 'versions' }, `price_volume_tiers/${_priceVolumeTierId}/versions`, params, options);
32
+ }
29
33
  async events(priceVolumeTierId, params, options) {
30
34
  const _priceVolumeTierId = priceVolumeTierId.id || priceVolumeTierId;
31
35
  return this.resources.fetch({ type: 'events' }, `price_volume_tiers/${_priceVolumeTierId}/events`, params, options);
@@ -6,6 +6,7 @@ import type { PriceTier } from './price_tiers';
6
6
  import type { PriceVolumeTier } from './price_volume_tiers';
7
7
  import type { PriceFrequencyTier } from './price_frequency_tiers';
8
8
  import type { Attachment } from './attachments';
9
+ import type { Version } from './versions';
9
10
  type PriceRel = ResourceRel & {
10
11
  type: typeof Prices.TYPE;
11
12
  };
@@ -33,11 +34,12 @@ interface Price extends Resource {
33
34
  price_volume_tiers?: PriceVolumeTier[];
34
35
  price_frequency_tiers?: PriceFrequencyTier[];
35
36
  attachments?: Attachment[];
37
+ versions?: Version[];
36
38
  }
37
39
  interface PriceCreate extends ResourceCreate {
38
40
  sku_code?: string;
39
41
  amount_cents: number;
40
- compare_at_amount_cents: number;
42
+ compare_at_amount_cents?: number;
41
43
  price_list: PriceListRel;
42
44
  sku: SkuRel;
43
45
  price_tiers?: PriceTierRel[];
@@ -63,6 +65,7 @@ declare class Prices extends ApiResource {
63
65
  price_volume_tiers(priceId: string | Price, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PriceVolumeTier>>;
64
66
  price_frequency_tiers(priceId: string | Price, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PriceFrequencyTier>>;
65
67
  attachments(priceId: string | Price, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
68
+ versions(priceId: string | Price, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
66
69
  isPrice(resource: any): resource is Price;
67
70
  relationship(id: string | ResourceId | null): PriceRel;
68
71
  type(): string;
@@ -42,6 +42,10 @@ class Prices extends resource_1.ApiResource {
42
42
  const _priceId = priceId.id || priceId;
43
43
  return this.resources.fetch({ type: 'attachments' }, `prices/${_priceId}/attachments`, params, options);
44
44
  }
45
+ async versions(priceId, params, options) {
46
+ const _priceId = priceId.id || priceId;
47
+ return this.resources.fetch({ type: 'versions' }, `prices/${_priceId}/versions`, params, options);
48
+ }
45
49
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
46
50
  isPrice(resource) {
47
51
  return resource.type && (resource.type === Prices.TYPE);
@@ -2,20 +2,24 @@ import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListRe
2
2
  import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import type { PercentageDiscountPromotion } from './percentage_discount_promotions';
4
4
  import type { FreeShippingPromotion } from './free_shipping_promotions';
5
+ import type { BuyXPayYPromotion } from './buy_x_pay_y_promotions';
5
6
  import type { FreeGiftPromotion } from './free_gift_promotions';
6
7
  import type { FixedPricePromotion } from './fixed_price_promotions';
7
8
  import type { ExternalPromotion } from './external_promotions';
8
9
  import type { FixedAmountPromotion } from './fixed_amount_promotions';
10
+ import type { Version } from './versions';
9
11
  type PromotionRuleRel = ResourceRel & {
10
12
  type: typeof PromotionRules.TYPE;
11
13
  };
12
14
  interface PromotionRule extends Resource {
13
- promotion?: PercentageDiscountPromotion | FreeShippingPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion;
15
+ promotion?: PercentageDiscountPromotion | FreeShippingPromotion | BuyXPayYPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion;
16
+ versions?: Version[];
14
17
  }
15
18
  declare class PromotionRules extends ApiResource {
16
19
  static readonly TYPE: 'promotion_rules';
17
20
  list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PromotionRule>>;
18
21
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PromotionRule>;
22
+ versions(promotionRuleId: string | PromotionRule, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
19
23
  isPromotionRule(resource: any): resource is PromotionRule;
20
24
  relationship(id: string | ResourceId | null): PromotionRuleRel;
21
25
  type(): string;
@@ -9,6 +9,10 @@ class PromotionRules extends resource_1.ApiResource {
9
9
  async retrieve(id, params, options) {
10
10
  return this.resources.retrieve({ type: PromotionRules.TYPE, id }, params, options);
11
11
  }
12
+ async versions(promotionRuleId, params, options) {
13
+ const _promotionRuleId = promotionRuleId.id || promotionRuleId;
14
+ return this.resources.fetch({ type: 'versions' }, `promotion_rules/${_promotionRuleId}/versions`, params, options);
15
+ }
12
16
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
13
17
  isPromotionRule(resource) {
14
18
  return resource.type && (resource.type === PromotionRules.TYPE);
@@ -5,26 +5,39 @@ import type { PromotionRule } from './promotion_rules';
5
5
  import type { OrderAmountPromotionRule } from './order_amount_promotion_rules';
6
6
  import type { SkuListPromotionRule } from './sku_list_promotion_rules';
7
7
  import type { CouponCodesPromotionRule } from './coupon_codes_promotion_rules';
8
+ import type { CustomPromotionRule } from './custom_promotion_rules';
9
+ import type { SkuList } from './sku_lists';
10
+ import type { Coupon } from './coupons';
8
11
  import type { Attachment } from './attachments';
9
12
  import type { Event } from './events';
13
+ import type { Tag } from './tags';
14
+ import type { Version } from './versions';
10
15
  type PromotionRel = ResourceRel & {
11
16
  type: typeof Promotions.TYPE;
12
17
  };
13
18
  interface Promotion extends Resource {
14
19
  name?: string;
15
20
  currency_code?: string;
21
+ exclusive?: boolean;
22
+ priority?: number;
16
23
  starts_at?: string;
17
24
  expires_at?: string;
18
25
  total_usage_limit?: number;
19
26
  total_usage_count?: number;
20
27
  active?: boolean;
28
+ disabled_at?: string;
21
29
  market?: Market;
22
30
  promotion_rules?: PromotionRule[];
23
31
  order_amount_promotion_rule?: OrderAmountPromotionRule;
24
32
  sku_list_promotion_rule?: SkuListPromotionRule;
25
33
  coupon_codes_promotion_rule?: CouponCodesPromotionRule;
34
+ custom_promotion_rule?: CustomPromotionRule;
35
+ sku_list?: SkuList;
36
+ coupons?: Coupon[];
26
37
  attachments?: Attachment[];
27
38
  events?: Event[];
39
+ tags?: Tag[];
40
+ versions?: Version[];
28
41
  }
29
42
  declare class Promotions extends ApiResource {
30
43
  static readonly TYPE: 'promotions';
@@ -34,8 +47,13 @@ declare class Promotions extends ApiResource {
34
47
  order_amount_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
35
48
  sku_list_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
36
49
  coupon_codes_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
50
+ custom_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
51
+ sku_list(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
52
+ coupons(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
37
53
  attachments(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
38
54
  events(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
55
+ tags(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
56
+ versions(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
39
57
  isPromotion(resource: any): resource is Promotion;
40
58
  relationship(id: string | ResourceId | null): PromotionRel;
41
59
  type(): string;
@@ -25,6 +25,18 @@ class Promotions extends resource_1.ApiResource {
25
25
  const _promotionId = promotionId.id || promotionId;
26
26
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `promotions/${_promotionId}/coupon_codes_promotion_rule`, params, options);
27
27
  }
28
+ async custom_promotion_rule(promotionId, params, options) {
29
+ const _promotionId = promotionId.id || promotionId;
30
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `promotions/${_promotionId}/custom_promotion_rule`, params, options);
31
+ }
32
+ async sku_list(promotionId, params, options) {
33
+ const _promotionId = promotionId.id || promotionId;
34
+ return this.resources.fetch({ type: 'sku_lists' }, `promotions/${_promotionId}/sku_list`, params, options);
35
+ }
36
+ async coupons(promotionId, params, options) {
37
+ const _promotionId = promotionId.id || promotionId;
38
+ return this.resources.fetch({ type: 'coupons' }, `promotions/${_promotionId}/coupons`, params, options);
39
+ }
28
40
  async attachments(promotionId, params, options) {
29
41
  const _promotionId = promotionId.id || promotionId;
30
42
  return this.resources.fetch({ type: 'attachments' }, `promotions/${_promotionId}/attachments`, params, options);
@@ -33,6 +45,14 @@ class Promotions extends resource_1.ApiResource {
33
45
  const _promotionId = promotionId.id || promotionId;
34
46
  return this.resources.fetch({ type: 'events' }, `promotions/${_promotionId}/events`, params, options);
35
47
  }
48
+ async tags(promotionId, params, options) {
49
+ const _promotionId = promotionId.id || promotionId;
50
+ return this.resources.fetch({ type: 'tags' }, `promotions/${_promotionId}/tags`, params, options);
51
+ }
52
+ async versions(promotionId, params, options) {
53
+ const _promotionId = promotionId.id || promotionId;
54
+ return this.resources.fetch({ type: 'versions' }, `promotions/${_promotionId}/versions`, params, options);
55
+ }
36
56
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
37
57
  isPromotion(resource) {
38
58
  return resource.type && (resource.type === Promotions.TYPE);
@@ -1,8 +1,10 @@
1
1
  import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
2
  import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import type { Order } from './orders';
4
- import type { Capture } from './captures';
4
+ import type { Attachment } from './attachments';
5
5
  import type { Event } from './events';
6
+ import type { Version } from './versions';
7
+ import type { Capture } from './captures';
6
8
  type RefundRel = ResourceRel & {
7
9
  type: typeof Refunds.TYPE;
8
10
  };
@@ -19,16 +21,20 @@ interface Refund extends Resource {
19
21
  token?: string;
20
22
  gateway_transaction_id?: string;
21
23
  order?: Order;
22
- reference_capture?: Capture;
24
+ attachments?: Attachment[];
23
25
  events?: Event[];
26
+ versions?: Version[];
27
+ reference_capture?: Capture;
24
28
  }
25
29
  declare class Refunds extends ApiResource {
26
30
  static readonly TYPE: 'refunds';
27
31
  list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Refund>>;
28
32
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Refund>;
29
33
  order(refundId: string | Refund, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
30
- reference_capture(refundId: string | Refund, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
34
+ attachments(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
31
35
  events(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
36
+ versions(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
37
+ reference_capture(refundId: string | Refund, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
32
38
  isRefund(resource: any): resource is Refund;
33
39
  relationship(id: string | ResourceId | null): RefundRel;
34
40
  type(): string;
@@ -13,14 +13,22 @@ class Refunds extends resource_1.ApiResource {
13
13
  const _refundId = refundId.id || refundId;
14
14
  return this.resources.fetch({ type: 'orders' }, `refunds/${_refundId}/order`, params, options);
15
15
  }
16
- async reference_capture(refundId, params, options) {
16
+ async attachments(refundId, params, options) {
17
17
  const _refundId = refundId.id || refundId;
18
- return this.resources.fetch({ type: 'captures' }, `refunds/${_refundId}/reference_capture`, params, options);
18
+ return this.resources.fetch({ type: 'attachments' }, `refunds/${_refundId}/attachments`, params, options);
19
19
  }
20
20
  async events(refundId, params, options) {
21
21
  const _refundId = refundId.id || refundId;
22
22
  return this.resources.fetch({ type: 'events' }, `refunds/${_refundId}/events`, params, options);
23
23
  }
24
+ async versions(refundId, params, options) {
25
+ const _refundId = refundId.id || refundId;
26
+ return this.resources.fetch({ type: 'versions' }, `refunds/${_refundId}/versions`, params, options);
27
+ }
28
+ async reference_capture(refundId, params, options) {
29
+ const _refundId = refundId.id || refundId;
30
+ return this.resources.fetch({ type: 'captures' }, `refunds/${_refundId}/reference_capture`, params, options);
31
+ }
24
32
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
25
33
  isRefund(resource) {
26
34
  return resource.type && (resource.type === Refunds.TYPE);
@@ -0,0 +1,27 @@
1
+ import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import type { StockItem } from './stock_items';
4
+ import type { Sku } from './skus';
5
+ import type { StockReservation } from './stock_reservations';
6
+ type ReservedStockRel = ResourceRel & {
7
+ type: typeof ReservedStocks.TYPE;
8
+ };
9
+ interface ReservedStock extends Resource {
10
+ quantity?: number;
11
+ stock_item?: StockItem;
12
+ sku?: Sku;
13
+ stock_reservations?: StockReservation[];
14
+ }
15
+ declare class ReservedStocks extends ApiResource {
16
+ static readonly TYPE: 'reserved_stocks';
17
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ReservedStock>>;
18
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReservedStock>;
19
+ stock_item(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
20
+ sku(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
21
+ stock_reservations(reservedStockId: string | ReservedStock, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
22
+ isReservedStock(resource: any): resource is ReservedStock;
23
+ relationship(id: string | ResourceId | null): ReservedStockRel;
24
+ type(): string;
25
+ }
26
+ export default ReservedStocks;
27
+ export { ReservedStock };
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const resource_1 = require("../resource");
4
+ class ReservedStocks extends resource_1.ApiResource {
5
+ // static readonly PATH = 'reserved_stocks'
6
+ async list(params, options) {
7
+ return this.resources.list({ type: ReservedStocks.TYPE }, params, options);
8
+ }
9
+ async retrieve(id, params, options) {
10
+ return this.resources.retrieve({ type: ReservedStocks.TYPE, id }, params, options);
11
+ }
12
+ async stock_item(reservedStockId, params, options) {
13
+ const _reservedStockId = reservedStockId.id || reservedStockId;
14
+ return this.resources.fetch({ type: 'stock_items' }, `reserved_stocks/${_reservedStockId}/stock_item`, params, options);
15
+ }
16
+ async sku(reservedStockId, params, options) {
17
+ const _reservedStockId = reservedStockId.id || reservedStockId;
18
+ return this.resources.fetch({ type: 'skus' }, `reserved_stocks/${_reservedStockId}/sku`, params, options);
19
+ }
20
+ async stock_reservations(reservedStockId, params, options) {
21
+ const _reservedStockId = reservedStockId.id || reservedStockId;
22
+ return this.resources.fetch({ type: 'stock_reservations' }, `reserved_stocks/${_reservedStockId}/stock_reservations`, params, options);
23
+ }
24
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
25
+ isReservedStock(resource) {
26
+ return resource.type && (resource.type === ReservedStocks.TYPE);
27
+ }
28
+ relationship(id) {
29
+ return ((id === null) || (typeof id === 'string')) ? { id, type: ReservedStocks.TYPE } : { id: id.id, type: ReservedStocks.TYPE };
30
+ }
31
+ type() {
32
+ return ReservedStocks.TYPE;
33
+ }
34
+ }
35
+ ReservedStocks.TYPE = 'reserved_stocks';
36
+ exports.default = ReservedStocks;
@@ -14,8 +14,9 @@ type LineItemRel = ResourceRel & {
14
14
  interface ReturnLineItem extends Resource {
15
15
  sku_code?: string;
16
16
  bundle_code?: string;
17
- name?: string;
18
17
  quantity?: number;
18
+ name?: string;
19
+ image_url?: string;
19
20
  return_reason?: object;
20
21
  restocked_at?: string;
21
22
  return?: Return;
@@ -7,6 +7,8 @@ import type { Address } from './addresses';
7
7
  import type { ReturnLineItem } from './return_line_items';
8
8
  import type { Attachment } from './attachments';
9
9
  import type { Event } from './events';
10
+ import type { Tag } from './tags';
11
+ import type { Version } from './versions';
10
12
  type ReturnRel = ResourceRel & {
11
13
  type: typeof Returns.TYPE;
12
14
  };
@@ -16,6 +18,9 @@ type OrderRel = ResourceRel & {
16
18
  type StockLocationRel = ResourceRel & {
17
19
  type: 'stock_locations';
18
20
  };
21
+ type TagRel = ResourceRel & {
22
+ type: 'tags';
23
+ };
19
24
  interface Return extends Resource {
20
25
  number?: string;
21
26
  status?: string;
@@ -35,10 +40,13 @@ interface Return extends Resource {
35
40
  return_line_items?: ReturnLineItem[];
36
41
  attachments?: Attachment[];
37
42
  events?: Event[];
43
+ tags?: Tag[];
44
+ versions?: Version[];
38
45
  }
39
46
  interface ReturnCreate extends ResourceCreate {
40
47
  order: OrderRel;
41
48
  stock_location?: StockLocationRel;
49
+ tags?: TagRel[];
42
50
  }
43
51
  interface ReturnUpdate extends ResourceUpdate {
44
52
  _request?: boolean;
@@ -51,6 +59,7 @@ interface ReturnUpdate extends ResourceUpdate {
51
59
  _archive?: boolean;
52
60
  _unarchive?: boolean;
53
61
  stock_location?: StockLocationRel;
62
+ tags?: TagRel[];
54
63
  }
55
64
  declare class Returns extends ApiResource {
56
65
  static readonly TYPE: 'returns';
@@ -67,6 +76,8 @@ declare class Returns extends ApiResource {
67
76
  return_line_items(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>>;
68
77
  attachments(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
69
78
  events(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
79
+ tags(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
80
+ versions(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
70
81
  isReturn(resource: any): resource is Return;
71
82
  relationship(id: string | ResourceId | null): ReturnRel;
72
83
  type(): string;
@@ -50,6 +50,14 @@ class Returns extends resource_1.ApiResource {
50
50
  const _returnId = returnId.id || returnId;
51
51
  return this.resources.fetch({ type: 'events' }, `returns/${_returnId}/events`, params, options);
52
52
  }
53
+ async tags(returnId, params, options) {
54
+ const _returnId = returnId.id || returnId;
55
+ return this.resources.fetch({ type: 'tags' }, `returns/${_returnId}/tags`, params, options);
56
+ }
57
+ async versions(returnId, params, options) {
58
+ const _returnId = returnId.id || returnId;
59
+ return this.resources.fetch({ type: 'versions' }, `returns/${_returnId}/versions`, params, options);
60
+ }
53
61
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
54
62
  isReturn(resource) {
55
63
  return resource.type && (resource.type === Returns.TYPE);
@@ -1,6 +1,7 @@
1
1
  import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
2
  import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import type { PaymentMethod } from './payment_methods';
4
+ import type { Version } from './versions';
4
5
  import type { SatispayPayment } from './satispay_payments';
5
6
  type SatispayGatewayRel = ResourceRel & {
6
7
  type: typeof SatispayGateways.TYPE;
@@ -10,12 +11,16 @@ type SatispayPaymentRel = ResourceRel & {
10
11
  };
11
12
  interface SatispayGateway extends Resource {
12
13
  name?: string;
14
+ token?: string;
15
+ key_id?: string;
13
16
  webhook_endpoint_url?: string;
14
17
  payment_methods?: PaymentMethod[];
18
+ versions?: Version[];
15
19
  satispay_payments?: SatispayPayment[];
16
20
  }
17
21
  interface SatispayGatewayCreate extends ResourceCreate {
18
22
  name: string;
23
+ token: string;
19
24
  satispay_payments?: SatispayPaymentRel[];
20
25
  }
21
26
  interface SatispayGatewayUpdate extends ResourceUpdate {
@@ -30,6 +35,7 @@ declare class SatispayGateways extends ApiResource {
30
35
  update(resource: SatispayGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SatispayGateway>;
31
36
  delete(id: string, options?: ResourcesConfig): Promise<void>;
32
37
  payment_methods(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
38
+ versions(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
33
39
  satispay_payments(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SatispayPayment>>;
34
40
  isSatispayGateway(resource: any): resource is SatispayGateway;
35
41
  relationship(id: string | ResourceId | null): SatispayGatewayRel;
@@ -22,6 +22,10 @@ class SatispayGateways extends resource_1.ApiResource {
22
22
  const _satispayGatewayId = satispayGatewayId.id || satispayGatewayId;
23
23
  return this.resources.fetch({ type: 'payment_methods' }, `satispay_gateways/${_satispayGatewayId}/payment_methods`, params, options);
24
24
  }
25
+ async versions(satispayGatewayId, params, options) {
26
+ const _satispayGatewayId = satispayGatewayId.id || satispayGatewayId;
27
+ return this.resources.fetch({ type: 'versions' }, `satispay_gateways/${_satispayGatewayId}/versions`, params, options);
28
+ }
25
29
  async satispay_payments(satispayGatewayId, params, options) {
26
30
  const _satispayGatewayId = satispayGatewayId.id || satispayGatewayId;
27
31
  return this.resources.fetch({ type: 'satispay_payments' }, `satispay_gateways/${_satispayGatewayId}/satispay_payments`, params, options);
@@ -2,6 +2,7 @@ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig,
2
2
  import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import type { Order } from './orders';
4
4
  import type { PaymentGateway } from './payment_gateways';
5
+ import type { Version } from './versions';
5
6
  type SatispayPaymentRel = ResourceRel & {
6
7
  type: typeof SatispayPayments.TYPE;
7
8
  };
@@ -9,15 +10,21 @@ type OrderRel = ResourceRel & {
9
10
  type: 'orders';
10
11
  };
11
12
  interface SatispayPayment extends Resource {
12
- token?: string;
13
- key_id?: string;
14
13
  payment_id?: string;
14
+ flow?: string;
15
+ status?: string;
15
16
  redirect_url?: string;
17
+ payment_url?: string;
18
+ intent_amount_cents?: number;
19
+ intent_amount_float?: number;
20
+ formatted_intent_amount?: string;
21
+ payment_response?: object;
16
22
  order?: Order;
17
23
  payment_gateway?: PaymentGateway;
24
+ versions?: Version[];
18
25
  }
19
26
  interface SatispayPaymentCreate extends ResourceCreate {
20
- token?: string;
27
+ flow?: string;
21
28
  redirect_url?: string;
22
29
  order: OrderRel;
23
30
  }
@@ -35,6 +42,7 @@ declare class SatispayPayments extends ApiResource {
35
42
  delete(id: string, options?: ResourcesConfig): Promise<void>;
36
43
  order(satispayPaymentId: string | SatispayPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
37
44
  payment_gateway(satispayPaymentId: string | SatispayPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
45
+ versions(satispayPaymentId: string | SatispayPayment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
38
46
  isSatispayPayment(resource: any): resource is SatispayPayment;
39
47
  relationship(id: string | ResourceId | null): SatispayPaymentRel;
40
48
  type(): string;
@@ -26,6 +26,10 @@ class SatispayPayments extends resource_1.ApiResource {
26
26
  const _satispayPaymentId = satispayPaymentId.id || satispayPaymentId;
27
27
  return this.resources.fetch({ type: 'payment_gateways' }, `satispay_payments/${_satispayPaymentId}/payment_gateway`, params, options);
28
28
  }
29
+ async versions(satispayPaymentId, params, options) {
30
+ const _satispayPaymentId = satispayPaymentId.id || satispayPaymentId;
31
+ return this.resources.fetch({ type: 'versions' }, `satispay_payments/${_satispayPaymentId}/versions`, params, options);
32
+ }
29
33
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
30
34
  isSatispayPayment(resource) {
31
35
  return resource.type && (resource.type === SatispayPayments.TYPE);
@@ -1,7 +1,8 @@
1
- import { ApiResource, Resource, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
2
  import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import type { Order } from './orders';
4
4
  import type { ShippingCategory } from './shipping_categories';
5
+ import type { InventoryStockLocation } from './inventory_stock_locations';
5
6
  import type { StockLocation } from './stock_locations';
6
7
  import type { Address } from './addresses';
7
8
  import type { ShippingMethod } from './shipping_methods';
@@ -12,12 +13,29 @@ import type { CarrierAccount } from './carrier_accounts';
12
13
  import type { Parcel } from './parcels';
13
14
  import type { Attachment } from './attachments';
14
15
  import type { Event } from './events';
16
+ import type { Tag } from './tags';
17
+ import type { Version } from './versions';
15
18
  type ShipmentRel = ResourceRel & {
16
19
  type: typeof Shipments.TYPE;
17
20
  };
21
+ type OrderRel = ResourceRel & {
22
+ type: 'orders';
23
+ };
24
+ type ShippingCategoryRel = ResourceRel & {
25
+ type: 'shipping_categories';
26
+ };
27
+ type InventoryStockLocationRel = ResourceRel & {
28
+ type: 'inventory_stock_locations';
29
+ };
30
+ type AddressRel = ResourceRel & {
31
+ type: 'addresses';
32
+ };
18
33
  type ShippingMethodRel = ResourceRel & {
19
34
  type: 'shipping_methods';
20
35
  };
36
+ type TagRel = ResourceRel & {
37
+ type: 'tags';
38
+ };
21
39
  interface Shipment extends Resource {
22
40
  number?: string;
23
41
  status?: string;
@@ -36,8 +54,14 @@ interface Shipment extends Resource {
36
54
  purchase_started_at?: string;
37
55
  purchase_completed_at?: string;
38
56
  purchase_failed_at?: string;
57
+ on_hold_at?: string;
58
+ picking_at?: string;
59
+ packing_at?: string;
60
+ ready_to_ship_at?: string;
61
+ shipped_at?: string;
39
62
  order?: Order;
40
63
  shipping_category?: ShippingCategory;
64
+ inventory_stock_location?: InventoryStockLocation;
41
65
  stock_location?: StockLocation;
42
66
  origin_address?: Address;
43
67
  shipping_address?: Address;
@@ -54,25 +78,46 @@ interface Shipment extends Resource {
54
78
  parcels?: Parcel[];
55
79
  attachments?: Attachment[];
56
80
  events?: Event[];
81
+ tags?: Tag[];
82
+ versions?: Version[];
83
+ }
84
+ interface ShipmentCreate extends ResourceCreate {
85
+ order: OrderRel;
86
+ shipping_category?: ShippingCategoryRel;
87
+ inventory_stock_location: InventoryStockLocationRel;
88
+ shipping_address?: AddressRel;
89
+ shipping_method?: ShippingMethodRel;
90
+ tags?: TagRel[];
57
91
  }
58
92
  interface ShipmentUpdate extends ResourceUpdate {
93
+ _upcoming?: boolean;
59
94
  _on_hold?: boolean;
60
95
  _picking?: boolean;
61
96
  _packing?: boolean;
62
97
  _ready_to_ship?: boolean;
63
98
  _ship?: boolean;
99
+ _reserve_stock?: boolean;
100
+ _release_stock?: boolean;
101
+ _decrement_stock?: boolean;
64
102
  _get_rates?: boolean;
65
103
  selected_rate_id?: string;
66
104
  _purchase?: boolean;
105
+ shipping_category?: ShippingCategoryRel;
106
+ inventory_stock_location?: InventoryStockLocationRel;
107
+ shipping_address?: AddressRel;
67
108
  shipping_method?: ShippingMethodRel;
109
+ tags?: TagRel[];
68
110
  }
69
111
  declare class Shipments extends ApiResource {
70
112
  static readonly TYPE: 'shipments';
71
113
  list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Shipment>>;
114
+ create(resource: ShipmentCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
72
115
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
73
116
  update(resource: ShipmentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
117
+ delete(id: string, options?: ResourcesConfig): Promise<void>;
74
118
  order(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
75
119
  shipping_category(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingCategory>;
120
+ inventory_stock_location(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InventoryStockLocation>;
76
121
  stock_location(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
77
122
  origin_address(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
78
123
  shipping_address(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
@@ -85,9 +130,11 @@ declare class Shipments extends ApiResource {
85
130
  parcels(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
86
131
  attachments(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
87
132
  events(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
133
+ tags(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
134
+ versions(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
88
135
  isShipment(resource: any): resource is Shipment;
89
136
  relationship(id: string | ResourceId | null): ShipmentRel;
90
137
  type(): string;
91
138
  }
92
139
  export default Shipments;
93
- export { Shipment, ShipmentUpdate };
140
+ export { Shipment, ShipmentCreate, ShipmentUpdate };
@@ -6,12 +6,18 @@ class Shipments extends resource_1.ApiResource {
6
6
  async list(params, options) {
7
7
  return this.resources.list({ type: Shipments.TYPE }, params, options);
8
8
  }
9
+ async create(resource, params, options) {
10
+ return this.resources.create(Object.assign(Object.assign({}, resource), { type: Shipments.TYPE }), params, options);
11
+ }
9
12
  async retrieve(id, params, options) {
10
13
  return this.resources.retrieve({ type: Shipments.TYPE, id }, params, options);
11
14
  }
12
15
  async update(resource, params, options) {
13
16
  return this.resources.update(Object.assign(Object.assign({}, resource), { type: Shipments.TYPE }), params, options);
14
17
  }
18
+ async delete(id, options) {
19
+ await this.resources.delete({ type: Shipments.TYPE, id }, options);
20
+ }
15
21
  async order(shipmentId, params, options) {
16
22
  const _shipmentId = shipmentId.id || shipmentId;
17
23
  return this.resources.fetch({ type: 'orders' }, `shipments/${_shipmentId}/order`, params, options);
@@ -20,6 +26,10 @@ class Shipments extends resource_1.ApiResource {
20
26
  const _shipmentId = shipmentId.id || shipmentId;
21
27
  return this.resources.fetch({ type: 'shipping_categories' }, `shipments/${_shipmentId}/shipping_category`, params, options);
22
28
  }
29
+ async inventory_stock_location(shipmentId, params, options) {
30
+ const _shipmentId = shipmentId.id || shipmentId;
31
+ return this.resources.fetch({ type: 'inventory_stock_locations' }, `shipments/${_shipmentId}/inventory_stock_location`, params, options);
32
+ }
23
33
  async stock_location(shipmentId, params, options) {
24
34
  const _shipmentId = shipmentId.id || shipmentId;
25
35
  return this.resources.fetch({ type: 'stock_locations' }, `shipments/${_shipmentId}/stock_location`, params, options);
@@ -68,6 +78,14 @@ class Shipments extends resource_1.ApiResource {
68
78
  const _shipmentId = shipmentId.id || shipmentId;
69
79
  return this.resources.fetch({ type: 'events' }, `shipments/${_shipmentId}/events`, params, options);
70
80
  }
81
+ async tags(shipmentId, params, options) {
82
+ const _shipmentId = shipmentId.id || shipmentId;
83
+ return this.resources.fetch({ type: 'tags' }, `shipments/${_shipmentId}/tags`, params, options);
84
+ }
85
+ async versions(shipmentId, params, options) {
86
+ const _shipmentId = shipmentId.id || shipmentId;
87
+ return this.resources.fetch({ type: 'versions' }, `shipments/${_shipmentId}/versions`, params, options);
88
+ }
71
89
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
72
90
  isShipment(resource) {
73
91
  return resource.type && (resource.type === Shipments.TYPE);