@commercelayer/sdk 5.12.4 → 5.13.0

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 (401) hide show
  1. package/lib/cjs/api.d.ts +11 -2
  2. package/lib/cjs/api.js +4 -1
  3. package/lib/cjs/commercelayer.d.ts +4 -3
  4. package/lib/cjs/commercelayer.js +6 -1
  5. package/lib/cjs/config.js +3 -1
  6. package/lib/cjs/model.d.ts +1 -0
  7. package/lib/cjs/resource.d.ts +1 -1
  8. package/lib/cjs/resource.js +6 -0
  9. package/lib/cjs/resources/addresses.d.ts +3 -0
  10. package/lib/cjs/resources/addresses.js +4 -0
  11. package/lib/cjs/resources/adjustments.d.ts +5 -2
  12. package/lib/cjs/resources/adjustments.js +4 -0
  13. package/lib/cjs/resources/adyen_gateways.d.ts +3 -0
  14. package/lib/cjs/resources/adyen_gateways.js +4 -0
  15. package/lib/cjs/resources/adyen_payments.d.ts +5 -2
  16. package/lib/cjs/resources/adyen_payments.js +4 -0
  17. package/lib/cjs/resources/authorizations.d.ts +3 -0
  18. package/lib/cjs/resources/authorizations.js +4 -0
  19. package/lib/cjs/resources/avalara_accounts.d.ts +3 -0
  20. package/lib/cjs/resources/avalara_accounts.js +4 -0
  21. package/lib/cjs/resources/axerve_gateways.d.ts +4 -0
  22. package/lib/cjs/resources/axerve_gateways.js +4 -0
  23. package/lib/cjs/resources/axerve_payments.d.ts +5 -2
  24. package/lib/cjs/resources/axerve_payments.js +4 -0
  25. package/lib/cjs/resources/billing_info_validation_rules.d.ts +3 -0
  26. package/lib/cjs/resources/billing_info_validation_rules.js +4 -0
  27. package/lib/cjs/resources/braintree_gateways.d.ts +3 -0
  28. package/lib/cjs/resources/braintree_gateways.js +4 -0
  29. package/lib/cjs/resources/braintree_payments.d.ts +5 -2
  30. package/lib/cjs/resources/braintree_payments.js +4 -0
  31. package/lib/cjs/resources/bundles.d.ts +3 -0
  32. package/lib/cjs/resources/bundles.js +4 -0
  33. package/lib/cjs/resources/captures.d.ts +3 -0
  34. package/lib/cjs/resources/captures.js +4 -0
  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 +5 -2
  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 +3 -0
  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 +3 -0
  48. package/lib/cjs/resources/coupons.js +4 -0
  49. package/lib/cjs/resources/customer_addresses.d.ts +3 -0
  50. package/lib/cjs/resources/customer_addresses.js +4 -0
  51. package/lib/cjs/resources/customer_groups.d.ts +3 -0
  52. package/lib/cjs/resources/customer_groups.js +4 -0
  53. package/lib/cjs/resources/customer_payment_sources.d.ts +8 -13
  54. package/lib/cjs/resources/customer_payment_sources.js +4 -0
  55. package/lib/cjs/resources/customer_subscriptions.d.ts +3 -0
  56. package/lib/cjs/resources/customer_subscriptions.js +4 -0
  57. package/lib/cjs/resources/delivery_lead_times.d.ts +3 -0
  58. package/lib/cjs/resources/delivery_lead_times.js +4 -0
  59. package/lib/cjs/resources/external_gateways.d.ts +3 -0
  60. package/lib/cjs/resources/external_gateways.js +4 -0
  61. package/lib/cjs/resources/external_payments.d.ts +5 -2
  62. package/lib/cjs/resources/external_payments.js +4 -0
  63. package/lib/cjs/resources/external_promotions.d.ts +3 -0
  64. package/lib/cjs/resources/external_promotions.js +4 -0
  65. package/lib/cjs/resources/external_tax_calculators.d.ts +3 -0
  66. package/lib/cjs/resources/external_tax_calculators.js +4 -0
  67. package/lib/cjs/resources/fixed_amount_promotions.d.ts +3 -0
  68. package/lib/cjs/resources/fixed_amount_promotions.js +4 -0
  69. package/lib/cjs/resources/fixed_price_promotions.d.ts +3 -0
  70. package/lib/cjs/resources/fixed_price_promotions.js +4 -0
  71. package/lib/cjs/resources/free_gift_promotions.d.ts +3 -0
  72. package/lib/cjs/resources/free_gift_promotions.js +4 -0
  73. package/lib/cjs/resources/free_shipping_promotions.d.ts +3 -0
  74. package/lib/cjs/resources/free_shipping_promotions.js +4 -0
  75. package/lib/cjs/resources/gift_card_recipients.d.ts +3 -0
  76. package/lib/cjs/resources/gift_card_recipients.js +4 -0
  77. package/lib/cjs/resources/gift_cards.d.ts +3 -0
  78. package/lib/cjs/resources/gift_cards.js +4 -0
  79. package/lib/cjs/resources/in_stock_subscriptions.d.ts +3 -0
  80. package/lib/cjs/resources/in_stock_subscriptions.js +4 -0
  81. package/lib/cjs/resources/inventory_models.d.ts +3 -0
  82. package/lib/cjs/resources/inventory_models.js +4 -0
  83. package/lib/cjs/resources/inventory_return_locations.d.ts +5 -2
  84. package/lib/cjs/resources/inventory_return_locations.js +4 -0
  85. package/lib/cjs/resources/inventory_stock_locations.d.ts +5 -2
  86. package/lib/cjs/resources/inventory_stock_locations.js +4 -0
  87. package/lib/cjs/resources/klarna_gateways.d.ts +3 -0
  88. package/lib/cjs/resources/klarna_gateways.js +4 -0
  89. package/lib/cjs/resources/klarna_payments.d.ts +5 -2
  90. package/lib/cjs/resources/klarna_payments.js +4 -0
  91. package/lib/cjs/resources/manual_gateways.d.ts +3 -0
  92. package/lib/cjs/resources/manual_gateways.js +4 -0
  93. package/lib/cjs/resources/manual_tax_calculators.d.ts +3 -0
  94. package/lib/cjs/resources/manual_tax_calculators.js +4 -0
  95. package/lib/cjs/resources/markets.d.ts +3 -0
  96. package/lib/cjs/resources/markets.js +4 -0
  97. package/lib/cjs/resources/merchants.d.ts +3 -0
  98. package/lib/cjs/resources/merchants.js +4 -0
  99. package/lib/cjs/resources/order_amount_promotion_rules.d.ts +5 -2
  100. package/lib/cjs/resources/order_amount_promotion_rules.js +4 -0
  101. package/lib/cjs/resources/order_subscription_items.d.ts +3 -0
  102. package/lib/cjs/resources/order_subscription_items.js +4 -0
  103. package/lib/cjs/resources/order_subscriptions.d.ts +3 -0
  104. package/lib/cjs/resources/order_subscriptions.js +4 -0
  105. package/lib/cjs/resources/order_validation_rules.d.ts +3 -0
  106. package/lib/cjs/resources/order_validation_rules.js +4 -0
  107. package/lib/cjs/resources/orders.d.ts +8 -2
  108. package/lib/cjs/resources/orders.js +4 -0
  109. package/lib/cjs/resources/packages.d.ts +3 -0
  110. package/lib/cjs/resources/packages.js +4 -0
  111. package/lib/cjs/resources/parcel_line_items.d.ts +5 -2
  112. package/lib/cjs/resources/parcel_line_items.js +4 -0
  113. package/lib/cjs/resources/parcels.d.ts +3 -0
  114. package/lib/cjs/resources/parcels.js +4 -0
  115. package/lib/cjs/resources/payment_gateways.d.ts +3 -0
  116. package/lib/cjs/resources/payment_gateways.js +4 -0
  117. package/lib/cjs/resources/payment_methods.d.ts +3 -0
  118. package/lib/cjs/resources/payment_methods.js +4 -0
  119. package/lib/cjs/resources/paypal_gateways.d.ts +3 -0
  120. package/lib/cjs/resources/paypal_gateways.js +4 -0
  121. package/lib/cjs/resources/paypal_payments.d.ts +5 -2
  122. package/lib/cjs/resources/paypal_payments.js +4 -0
  123. package/lib/cjs/resources/percentage_discount_promotions.d.ts +3 -0
  124. package/lib/cjs/resources/percentage_discount_promotions.js +4 -0
  125. package/lib/cjs/resources/price_frequency_tiers.d.ts +3 -0
  126. package/lib/cjs/resources/price_frequency_tiers.js +4 -0
  127. package/lib/cjs/resources/price_lists.d.ts +3 -0
  128. package/lib/cjs/resources/price_lists.js +4 -0
  129. package/lib/cjs/resources/price_tiers.d.ts +3 -0
  130. package/lib/cjs/resources/price_tiers.js +4 -0
  131. package/lib/cjs/resources/price_volume_tiers.d.ts +3 -0
  132. package/lib/cjs/resources/price_volume_tiers.js +4 -0
  133. package/lib/cjs/resources/prices.d.ts +3 -0
  134. package/lib/cjs/resources/prices.js +4 -0
  135. package/lib/cjs/resources/promotion_rules.d.ts +5 -1
  136. package/lib/cjs/resources/promotion_rules.js +4 -0
  137. package/lib/cjs/resources/promotions.d.ts +3 -0
  138. package/lib/cjs/resources/promotions.js +4 -0
  139. package/lib/cjs/resources/refunds.d.ts +3 -0
  140. package/lib/cjs/resources/refunds.js +4 -0
  141. package/lib/cjs/resources/returns.d.ts +3 -0
  142. package/lib/cjs/resources/returns.js +4 -0
  143. package/lib/cjs/resources/satispay_gateways.d.ts +3 -0
  144. package/lib/cjs/resources/satispay_gateways.js +4 -0
  145. package/lib/cjs/resources/satispay_payments.d.ts +6 -2
  146. package/lib/cjs/resources/satispay_payments.js +4 -0
  147. package/lib/cjs/resources/shipments.d.ts +3 -0
  148. package/lib/cjs/resources/shipments.js +4 -0
  149. package/lib/cjs/resources/shipping_categories.d.ts +3 -0
  150. package/lib/cjs/resources/shipping_categories.js +4 -0
  151. package/lib/cjs/resources/shipping_method_tiers.d.ts +3 -0
  152. package/lib/cjs/resources/shipping_method_tiers.js +4 -0
  153. package/lib/cjs/resources/shipping_methods.d.ts +3 -0
  154. package/lib/cjs/resources/shipping_methods.js +4 -0
  155. package/lib/cjs/resources/shipping_weight_tiers.d.ts +3 -0
  156. package/lib/cjs/resources/shipping_weight_tiers.js +4 -0
  157. package/lib/cjs/resources/shipping_zones.d.ts +3 -0
  158. package/lib/cjs/resources/shipping_zones.js +4 -0
  159. package/lib/cjs/resources/sku_list_items.d.ts +5 -2
  160. package/lib/cjs/resources/sku_list_items.js +4 -0
  161. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +3 -0
  162. package/lib/cjs/resources/sku_list_promotion_rules.js +4 -0
  163. package/lib/cjs/resources/sku_lists.d.ts +3 -0
  164. package/lib/cjs/resources/sku_lists.js +4 -0
  165. package/lib/cjs/resources/sku_options.d.ts +3 -0
  166. package/lib/cjs/resources/sku_options.js +4 -0
  167. package/lib/cjs/resources/skus.d.ts +3 -0
  168. package/lib/cjs/resources/skus.js +4 -0
  169. package/lib/cjs/resources/stock_items.d.ts +3 -0
  170. package/lib/cjs/resources/stock_items.js +4 -0
  171. package/lib/cjs/resources/stock_line_items.d.ts +5 -2
  172. package/lib/cjs/resources/stock_line_items.js +4 -0
  173. package/lib/cjs/resources/stock_locations.d.ts +3 -0
  174. package/lib/cjs/resources/stock_locations.js +4 -0
  175. package/lib/cjs/resources/stock_transfers.d.ts +3 -0
  176. package/lib/cjs/resources/stock_transfers.js +4 -0
  177. package/lib/cjs/resources/stripe_gateways.d.ts +3 -0
  178. package/lib/cjs/resources/stripe_gateways.js +4 -0
  179. package/lib/cjs/resources/stripe_payments.d.ts +8 -2
  180. package/lib/cjs/resources/stripe_payments.js +4 -0
  181. package/lib/cjs/resources/tax_calculators.d.ts +3 -0
  182. package/lib/cjs/resources/tax_calculators.js +4 -0
  183. package/lib/cjs/resources/tax_categories.d.ts +3 -0
  184. package/lib/cjs/resources/tax_categories.js +4 -0
  185. package/lib/cjs/resources/tax_rules.d.ts +5 -2
  186. package/lib/cjs/resources/tax_rules.js +4 -0
  187. package/lib/cjs/resources/taxjar_accounts.d.ts +3 -0
  188. package/lib/cjs/resources/taxjar_accounts.js +4 -0
  189. package/lib/cjs/resources/transactions.d.ts +3 -0
  190. package/lib/cjs/resources/transactions.js +4 -0
  191. package/lib/cjs/resources/versions.d.ts +22 -0
  192. package/lib/cjs/resources/versions.js +16 -0
  193. package/lib/cjs/resources/voids.d.ts +3 -0
  194. package/lib/cjs/resources/voids.js +4 -0
  195. package/lib/cjs/resources/webhooks.d.ts +3 -0
  196. package/lib/cjs/resources/webhooks.js +4 -0
  197. package/lib/cjs/resources/wire_transfers.d.ts +5 -2
  198. package/lib/cjs/resources/wire_transfers.js +4 -0
  199. package/lib/cjs/util.d.ts +1 -1
  200. package/lib/esm/api.d.ts +11 -2
  201. package/lib/esm/api.js +2 -0
  202. package/lib/esm/commercelayer.d.ts +4 -3
  203. package/lib/esm/commercelayer.js +6 -1
  204. package/lib/esm/config.js +3 -1
  205. package/lib/esm/model.d.ts +1 -0
  206. package/lib/esm/resource.d.ts +1 -1
  207. package/lib/esm/resource.js +6 -0
  208. package/lib/esm/resources/addresses.d.ts +3 -0
  209. package/lib/esm/resources/addresses.js +4 -0
  210. package/lib/esm/resources/adjustments.d.ts +5 -2
  211. package/lib/esm/resources/adjustments.js +4 -0
  212. package/lib/esm/resources/adyen_gateways.d.ts +3 -0
  213. package/lib/esm/resources/adyen_gateways.js +4 -0
  214. package/lib/esm/resources/adyen_payments.d.ts +5 -2
  215. package/lib/esm/resources/adyen_payments.js +4 -0
  216. package/lib/esm/resources/authorizations.d.ts +3 -0
  217. package/lib/esm/resources/authorizations.js +4 -0
  218. package/lib/esm/resources/avalara_accounts.d.ts +3 -0
  219. package/lib/esm/resources/avalara_accounts.js +4 -0
  220. package/lib/esm/resources/axerve_gateways.d.ts +4 -0
  221. package/lib/esm/resources/axerve_gateways.js +4 -0
  222. package/lib/esm/resources/axerve_payments.d.ts +5 -2
  223. package/lib/esm/resources/axerve_payments.js +4 -0
  224. package/lib/esm/resources/billing_info_validation_rules.d.ts +3 -0
  225. package/lib/esm/resources/billing_info_validation_rules.js +4 -0
  226. package/lib/esm/resources/braintree_gateways.d.ts +3 -0
  227. package/lib/esm/resources/braintree_gateways.js +4 -0
  228. package/lib/esm/resources/braintree_payments.d.ts +5 -2
  229. package/lib/esm/resources/braintree_payments.js +4 -0
  230. package/lib/esm/resources/bundles.d.ts +3 -0
  231. package/lib/esm/resources/bundles.js +4 -0
  232. package/lib/esm/resources/captures.d.ts +3 -0
  233. package/lib/esm/resources/captures.js +4 -0
  234. package/lib/esm/resources/carrier_accounts.d.ts +3 -0
  235. package/lib/esm/resources/carrier_accounts.js +4 -0
  236. package/lib/esm/resources/checkout_com_gateways.d.ts +3 -0
  237. package/lib/esm/resources/checkout_com_gateways.js +4 -0
  238. package/lib/esm/resources/checkout_com_payments.d.ts +5 -2
  239. package/lib/esm/resources/checkout_com_payments.js +4 -0
  240. package/lib/esm/resources/cleanups.d.ts +3 -0
  241. package/lib/esm/resources/cleanups.js +4 -0
  242. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +3 -0
  243. package/lib/esm/resources/coupon_codes_promotion_rules.js +4 -0
  244. package/lib/esm/resources/coupon_recipients.d.ts +3 -0
  245. package/lib/esm/resources/coupon_recipients.js +4 -0
  246. package/lib/esm/resources/coupons.d.ts +3 -0
  247. package/lib/esm/resources/coupons.js +4 -0
  248. package/lib/esm/resources/customer_addresses.d.ts +3 -0
  249. package/lib/esm/resources/customer_addresses.js +4 -0
  250. package/lib/esm/resources/customer_groups.d.ts +3 -0
  251. package/lib/esm/resources/customer_groups.js +4 -0
  252. package/lib/esm/resources/customer_payment_sources.d.ts +8 -13
  253. package/lib/esm/resources/customer_payment_sources.js +4 -0
  254. package/lib/esm/resources/customer_subscriptions.d.ts +3 -0
  255. package/lib/esm/resources/customer_subscriptions.js +4 -0
  256. package/lib/esm/resources/delivery_lead_times.d.ts +3 -0
  257. package/lib/esm/resources/delivery_lead_times.js +4 -0
  258. package/lib/esm/resources/external_gateways.d.ts +3 -0
  259. package/lib/esm/resources/external_gateways.js +4 -0
  260. package/lib/esm/resources/external_payments.d.ts +5 -2
  261. package/lib/esm/resources/external_payments.js +4 -0
  262. package/lib/esm/resources/external_promotions.d.ts +3 -0
  263. package/lib/esm/resources/external_promotions.js +4 -0
  264. package/lib/esm/resources/external_tax_calculators.d.ts +3 -0
  265. package/lib/esm/resources/external_tax_calculators.js +4 -0
  266. package/lib/esm/resources/fixed_amount_promotions.d.ts +3 -0
  267. package/lib/esm/resources/fixed_amount_promotions.js +4 -0
  268. package/lib/esm/resources/fixed_price_promotions.d.ts +3 -0
  269. package/lib/esm/resources/fixed_price_promotions.js +4 -0
  270. package/lib/esm/resources/free_gift_promotions.d.ts +3 -0
  271. package/lib/esm/resources/free_gift_promotions.js +4 -0
  272. package/lib/esm/resources/free_shipping_promotions.d.ts +3 -0
  273. package/lib/esm/resources/free_shipping_promotions.js +4 -0
  274. package/lib/esm/resources/gift_card_recipients.d.ts +3 -0
  275. package/lib/esm/resources/gift_card_recipients.js +4 -0
  276. package/lib/esm/resources/gift_cards.d.ts +3 -0
  277. package/lib/esm/resources/gift_cards.js +4 -0
  278. package/lib/esm/resources/in_stock_subscriptions.d.ts +3 -0
  279. package/lib/esm/resources/in_stock_subscriptions.js +4 -0
  280. package/lib/esm/resources/inventory_models.d.ts +3 -0
  281. package/lib/esm/resources/inventory_models.js +4 -0
  282. package/lib/esm/resources/inventory_return_locations.d.ts +5 -2
  283. package/lib/esm/resources/inventory_return_locations.js +4 -0
  284. package/lib/esm/resources/inventory_stock_locations.d.ts +5 -2
  285. package/lib/esm/resources/inventory_stock_locations.js +4 -0
  286. package/lib/esm/resources/klarna_gateways.d.ts +3 -0
  287. package/lib/esm/resources/klarna_gateways.js +4 -0
  288. package/lib/esm/resources/klarna_payments.d.ts +5 -2
  289. package/lib/esm/resources/klarna_payments.js +4 -0
  290. package/lib/esm/resources/manual_gateways.d.ts +3 -0
  291. package/lib/esm/resources/manual_gateways.js +4 -0
  292. package/lib/esm/resources/manual_tax_calculators.d.ts +3 -0
  293. package/lib/esm/resources/manual_tax_calculators.js +4 -0
  294. package/lib/esm/resources/markets.d.ts +3 -0
  295. package/lib/esm/resources/markets.js +4 -0
  296. package/lib/esm/resources/merchants.d.ts +3 -0
  297. package/lib/esm/resources/merchants.js +4 -0
  298. package/lib/esm/resources/order_amount_promotion_rules.d.ts +5 -2
  299. package/lib/esm/resources/order_amount_promotion_rules.js +4 -0
  300. package/lib/esm/resources/order_subscription_items.d.ts +3 -0
  301. package/lib/esm/resources/order_subscription_items.js +4 -0
  302. package/lib/esm/resources/order_subscriptions.d.ts +3 -0
  303. package/lib/esm/resources/order_subscriptions.js +4 -0
  304. package/lib/esm/resources/order_validation_rules.d.ts +3 -0
  305. package/lib/esm/resources/order_validation_rules.js +4 -0
  306. package/lib/esm/resources/orders.d.ts +8 -2
  307. package/lib/esm/resources/orders.js +4 -0
  308. package/lib/esm/resources/packages.d.ts +3 -0
  309. package/lib/esm/resources/packages.js +4 -0
  310. package/lib/esm/resources/parcel_line_items.d.ts +5 -2
  311. package/lib/esm/resources/parcel_line_items.js +4 -0
  312. package/lib/esm/resources/parcels.d.ts +3 -0
  313. package/lib/esm/resources/parcels.js +4 -0
  314. package/lib/esm/resources/payment_gateways.d.ts +3 -0
  315. package/lib/esm/resources/payment_gateways.js +4 -0
  316. package/lib/esm/resources/payment_methods.d.ts +3 -0
  317. package/lib/esm/resources/payment_methods.js +4 -0
  318. package/lib/esm/resources/paypal_gateways.d.ts +3 -0
  319. package/lib/esm/resources/paypal_gateways.js +4 -0
  320. package/lib/esm/resources/paypal_payments.d.ts +5 -2
  321. package/lib/esm/resources/paypal_payments.js +4 -0
  322. package/lib/esm/resources/percentage_discount_promotions.d.ts +3 -0
  323. package/lib/esm/resources/percentage_discount_promotions.js +4 -0
  324. package/lib/esm/resources/price_frequency_tiers.d.ts +3 -0
  325. package/lib/esm/resources/price_frequency_tiers.js +4 -0
  326. package/lib/esm/resources/price_lists.d.ts +3 -0
  327. package/lib/esm/resources/price_lists.js +4 -0
  328. package/lib/esm/resources/price_tiers.d.ts +3 -0
  329. package/lib/esm/resources/price_tiers.js +4 -0
  330. package/lib/esm/resources/price_volume_tiers.d.ts +3 -0
  331. package/lib/esm/resources/price_volume_tiers.js +4 -0
  332. package/lib/esm/resources/prices.d.ts +3 -0
  333. package/lib/esm/resources/prices.js +4 -0
  334. package/lib/esm/resources/promotion_rules.d.ts +5 -1
  335. package/lib/esm/resources/promotion_rules.js +4 -0
  336. package/lib/esm/resources/promotions.d.ts +3 -0
  337. package/lib/esm/resources/promotions.js +4 -0
  338. package/lib/esm/resources/refunds.d.ts +3 -0
  339. package/lib/esm/resources/refunds.js +4 -0
  340. package/lib/esm/resources/returns.d.ts +3 -0
  341. package/lib/esm/resources/returns.js +4 -0
  342. package/lib/esm/resources/satispay_gateways.d.ts +3 -0
  343. package/lib/esm/resources/satispay_gateways.js +4 -0
  344. package/lib/esm/resources/satispay_payments.d.ts +6 -2
  345. package/lib/esm/resources/satispay_payments.js +4 -0
  346. package/lib/esm/resources/shipments.d.ts +3 -0
  347. package/lib/esm/resources/shipments.js +4 -0
  348. package/lib/esm/resources/shipping_categories.d.ts +3 -0
  349. package/lib/esm/resources/shipping_categories.js +4 -0
  350. package/lib/esm/resources/shipping_method_tiers.d.ts +3 -0
  351. package/lib/esm/resources/shipping_method_tiers.js +4 -0
  352. package/lib/esm/resources/shipping_methods.d.ts +3 -0
  353. package/lib/esm/resources/shipping_methods.js +4 -0
  354. package/lib/esm/resources/shipping_weight_tiers.d.ts +3 -0
  355. package/lib/esm/resources/shipping_weight_tiers.js +4 -0
  356. package/lib/esm/resources/shipping_zones.d.ts +3 -0
  357. package/lib/esm/resources/shipping_zones.js +4 -0
  358. package/lib/esm/resources/sku_list_items.d.ts +5 -2
  359. package/lib/esm/resources/sku_list_items.js +4 -0
  360. package/lib/esm/resources/sku_list_promotion_rules.d.ts +3 -0
  361. package/lib/esm/resources/sku_list_promotion_rules.js +4 -0
  362. package/lib/esm/resources/sku_lists.d.ts +3 -0
  363. package/lib/esm/resources/sku_lists.js +4 -0
  364. package/lib/esm/resources/sku_options.d.ts +3 -0
  365. package/lib/esm/resources/sku_options.js +4 -0
  366. package/lib/esm/resources/skus.d.ts +3 -0
  367. package/lib/esm/resources/skus.js +4 -0
  368. package/lib/esm/resources/stock_items.d.ts +3 -0
  369. package/lib/esm/resources/stock_items.js +4 -0
  370. package/lib/esm/resources/stock_line_items.d.ts +5 -2
  371. package/lib/esm/resources/stock_line_items.js +4 -0
  372. package/lib/esm/resources/stock_locations.d.ts +3 -0
  373. package/lib/esm/resources/stock_locations.js +4 -0
  374. package/lib/esm/resources/stock_transfers.d.ts +3 -0
  375. package/lib/esm/resources/stock_transfers.js +4 -0
  376. package/lib/esm/resources/stripe_gateways.d.ts +3 -0
  377. package/lib/esm/resources/stripe_gateways.js +4 -0
  378. package/lib/esm/resources/stripe_payments.d.ts +8 -2
  379. package/lib/esm/resources/stripe_payments.js +4 -0
  380. package/lib/esm/resources/tax_calculators.d.ts +3 -0
  381. package/lib/esm/resources/tax_calculators.js +4 -0
  382. package/lib/esm/resources/tax_categories.d.ts +3 -0
  383. package/lib/esm/resources/tax_categories.js +4 -0
  384. package/lib/esm/resources/tax_rules.d.ts +5 -2
  385. package/lib/esm/resources/tax_rules.js +4 -0
  386. package/lib/esm/resources/taxjar_accounts.d.ts +3 -0
  387. package/lib/esm/resources/taxjar_accounts.js +4 -0
  388. package/lib/esm/resources/transactions.d.ts +3 -0
  389. package/lib/esm/resources/transactions.js +4 -0
  390. package/lib/esm/resources/versions.d.ts +22 -0
  391. package/lib/esm/resources/versions.js +14 -0
  392. package/lib/esm/resources/voids.d.ts +3 -0
  393. package/lib/esm/resources/voids.js +4 -0
  394. package/lib/esm/resources/webhooks.d.ts +3 -0
  395. package/lib/esm/resources/webhooks.js +4 -0
  396. package/lib/esm/resources/wire_transfers.d.ts +5 -2
  397. package/lib/esm/resources/wire_transfers.js +4 -0
  398. package/lib/esm/util.d.ts +1 -1
  399. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  400. package/lib/tsconfig.tsbuildinfo +1 -1
  401. package/package.json +10 -10
@@ -3,6 +3,7 @@ import type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse }
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Order } from './orders';
5
5
  import type { Attachment } from './attachments';
6
+ import type { Version } from './versions';
6
7
  type TransactionType = 'transactions';
7
8
  type TransactionRel = ResourceRel & {
8
9
  type: TransactionType;
@@ -22,11 +23,13 @@ interface Transaction extends Resource {
22
23
  gateway_transaction_id?: string | null;
23
24
  order?: Order | null;
24
25
  attachments?: Attachment[] | null;
26
+ versions?: Version[] | null;
25
27
  }
26
28
  declare class Transactions extends ApiResource<Transaction> {
27
29
  static readonly TYPE: TransactionType;
28
30
  order(transactionId: string | Transaction, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
29
31
  attachments(transactionId: string | Transaction, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
32
+ versions(transactionId: string | Transaction, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
30
33
  isTransaction(resource: any): resource is Transaction;
31
34
  relationship(id: string | ResourceId | null): TransactionRel;
32
35
  type(): TransactionType;
@@ -10,6 +10,10 @@ class Transactions extends resource_1.ApiResource {
10
10
  const _transactionId = transactionId.id || transactionId;
11
11
  return this.resources.fetch({ type: 'attachments' }, `transactions/${_transactionId}/attachments`, params, options);
12
12
  }
13
+ async versions(transactionId, params, options) {
14
+ const _transactionId = transactionId.id || transactionId;
15
+ return this.resources.fetch({ type: 'versions' }, `transactions/${_transactionId}/versions`, params, options);
16
+ }
13
17
  isTransaction(resource) {
14
18
  return resource.type && (resource.type === Transactions.TYPE);
15
19
  }
@@ -0,0 +1,22 @@
1
+ import { ApiResource } from '../resource';
2
+ import type { Resource, ResourceId, ResourceRel } from '../resource';
3
+ type VersionType = 'versions';
4
+ type VersionRel = ResourceRel & {
5
+ type: VersionType;
6
+ };
7
+ interface Version extends Resource {
8
+ readonly type: VersionType;
9
+ resource_type?: string | null;
10
+ resource_id?: string | null;
11
+ event?: string | null;
12
+ changes?: Record<string, any> | null;
13
+ who?: Record<string, any> | null;
14
+ }
15
+ declare class Versions extends ApiResource<Version> {
16
+ static readonly TYPE: VersionType;
17
+ isVersion(resource: any): resource is Version;
18
+ relationship(id: string | ResourceId | null): VersionRel;
19
+ type(): VersionType;
20
+ }
21
+ export default Versions;
22
+ export type { Version, VersionType };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const resource_1 = require("../resource");
4
+ class Versions extends resource_1.ApiResource {
5
+ isVersion(resource) {
6
+ return resource.type && (resource.type === Versions.TYPE);
7
+ }
8
+ relationship(id) {
9
+ return ((id === null) || (typeof id === 'string')) ? { id, type: Versions.TYPE } : { id: id.id, type: Versions.TYPE };
10
+ }
11
+ type() {
12
+ return Versions.TYPE;
13
+ }
14
+ }
15
+ Versions.TYPE = 'versions';
16
+ exports.default = Versions;
@@ -3,6 +3,7 @@ import type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse }
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Order } from './orders';
5
5
  import type { Attachment } from './attachments';
6
+ import type { Version } from './versions';
6
7
  import type { Authorization } from './authorizations';
7
8
  import type { Event } from './events';
8
9
  type VoidType = 'voids';
@@ -24,6 +25,7 @@ interface Void extends Resource {
24
25
  gateway_transaction_id?: string | null;
25
26
  order?: Order | null;
26
27
  attachments?: Attachment[] | null;
28
+ versions?: Version[] | null;
27
29
  reference_authorization?: Authorization | null;
28
30
  events?: Event[] | null;
29
31
  }
@@ -31,6 +33,7 @@ declare class Voids extends ApiResource<Void> {
31
33
  static readonly TYPE: VoidType;
32
34
  order(voidId: string | Void, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
33
35
  attachments(voidId: string | Void, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
36
+ versions(voidId: string | Void, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
34
37
  reference_authorization(voidId: string | Void, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
35
38
  events(voidId: string | Void, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
36
39
  isVoid(resource: any): resource is Void;
@@ -10,6 +10,10 @@ class Voids extends resource_1.ApiResource {
10
10
  const _voidId = voidId.id || voidId;
11
11
  return this.resources.fetch({ type: 'attachments' }, `voids/${_voidId}/attachments`, params, options);
12
12
  }
13
+ async versions(voidId, params, options) {
14
+ const _voidId = voidId.id || voidId;
15
+ return this.resources.fetch({ type: 'versions' }, `voids/${_voidId}/versions`, params, options);
16
+ }
13
17
  async reference_authorization(voidId, params, options) {
14
18
  const _voidId = voidId.id || voidId;
15
19
  return this.resources.fetch({ type: 'authorizations' }, `voids/${_voidId}/reference_authorization`, params, options);
@@ -2,6 +2,7 @@ import { ApiResource } from '../resource';
2
2
  import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { EventCallback } from './event_callbacks';
5
+ import type { Version } from './versions';
5
6
  type WebhookType = 'webhooks';
6
7
  type WebhookRel = ResourceRel & {
7
8
  type: WebhookType;
@@ -16,6 +17,7 @@ interface Webhook extends Resource {
16
17
  circuit_failure_count?: number | null;
17
18
  shared_secret: string;
18
19
  last_event_callbacks?: EventCallback[] | null;
20
+ versions?: Version[] | null;
19
21
  }
20
22
  interface WebhookCreate extends ResourceCreate {
21
23
  name?: string | null;
@@ -36,6 +38,7 @@ declare class Webhooks extends ApiResource<Webhook> {
36
38
  update(resource: WebhookUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
37
39
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
38
40
  last_event_callbacks(webhookId: string | Webhook, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<EventCallback>>;
41
+ versions(webhookId: string | Webhook, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
39
42
  _reset_circuit(id: string | Webhook, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
40
43
  isWebhook(resource: any): resource is Webhook;
41
44
  relationship(id: string | ResourceId | null): WebhookRel;
@@ -15,6 +15,10 @@ class Webhooks extends resource_1.ApiResource {
15
15
  const _webhookId = webhookId.id || webhookId;
16
16
  return this.resources.fetch({ type: 'event_callbacks' }, `webhooks/${_webhookId}/last_event_callbacks`, params, options);
17
17
  }
18
+ async versions(webhookId, params, options) {
19
+ const _webhookId = webhookId.id || webhookId;
20
+ return this.resources.fetch({ type: 'versions' }, `webhooks/${_webhookId}/versions`, params, options);
21
+ }
18
22
  async _reset_circuit(id, params, options) {
19
23
  return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Webhooks.TYPE, _reset_circuit: true }, params, options);
20
24
  }
@@ -1,7 +1,8 @@
1
1
  import { ApiResource } from '../resource';
2
- import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
3
- import type { QueryParamsRetrieve } from '../query';
2
+ import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
+ import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Order, OrderType } from './orders';
5
+ import type { Version } from './versions';
5
6
  type WireTransferType = 'wire_transfers';
6
7
  type WireTransferRel = ResourceRel & {
7
8
  type: WireTransferType;
@@ -13,6 +14,7 @@ interface WireTransfer extends Resource {
13
14
  readonly type: WireTransferType;
14
15
  payment_instrument?: Record<string, any> | null;
15
16
  order?: Order | null;
17
+ versions?: Version[] | null;
16
18
  }
17
19
  interface WireTransferCreate extends ResourceCreate {
18
20
  order: OrderRel;
@@ -26,6 +28,7 @@ declare class WireTransfers extends ApiResource<WireTransfer> {
26
28
  update(resource: WireTransferUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<WireTransfer>;
27
29
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
28
30
  order(wireTransferId: string | WireTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
31
+ versions(wireTransferId: string | WireTransfer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
29
32
  isWireTransfer(resource: any): resource is WireTransfer;
30
33
  relationship(id: string | ResourceId | null): WireTransferRel;
31
34
  type(): WireTransferType;
@@ -15,6 +15,10 @@ class WireTransfers extends resource_1.ApiResource {
15
15
  const _wireTransferId = wireTransferId.id || wireTransferId;
16
16
  return this.resources.fetch({ type: 'orders' }, `wire_transfers/${_wireTransferId}/order`, params, options);
17
17
  }
18
+ async versions(wireTransferId, params, options) {
19
+ const _wireTransferId = wireTransferId.id || wireTransferId;
20
+ return this.resources.fetch({ type: 'versions' }, `wire_transfers/${_wireTransferId}/versions`, params, options);
21
+ }
18
22
  isWireTransfer(resource) {
19
23
  return resource.type && (resource.type === WireTransfers.TYPE);
20
24
  }
package/lib/cjs/util.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  /// <reference types="node" />
4
4
  /// <reference types="node" />
5
5
  /// <reference types="node" />
6
- import type { ObjectType } from "./common";
6
+ import type { ObjectType } from "../src/common";
7
7
  declare const sleep: (ms: number) => Promise<NodeJS.Timeout>;
8
8
  declare const sortObjectFields: (obj: ObjectType) => ObjectType;
9
9
  export { sleep, sortObjectFields };
package/lib/esm/api.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { Resource, ResourceRel } from './resource';
2
2
  import type { TagType } from './resources/tags';
3
+ import type { VersionType } from './resources/versions';
3
4
  /**
4
5
  * ©2023 Commerce Layer Inc.
5
6
  **/
@@ -116,11 +117,12 @@ export { default as TaxCategories } from './resources/tax_categories';
116
117
  export { default as TaxRules } from './resources/tax_rules';
117
118
  export { default as TaxjarAccounts } from './resources/taxjar_accounts';
118
119
  export { default as Transactions } from './resources/transactions';
120
+ export { default as Versions } from './resources/versions';
119
121
  export { default as Voids } from './resources/voids';
120
122
  export { default as Webhooks } from './resources/webhooks';
121
123
  export { default as WireTransfers } from './resources/wire_transfers';
122
- export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'reserved_stocks' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
123
- export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "reserved_stocks", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
124
+ export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'reserved_stocks' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'versions' | 'voids' | 'webhooks' | 'wire_transfers';
125
+ export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "reserved_stocks", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "versions", "voids", "webhooks", "wire_transfers"];
124
126
  export type RetrievableResourceType = ResourceTypeLock;
125
127
  export type RetrievableResource = Resource & {
126
128
  type: RetrievableResourceType;
@@ -148,3 +150,10 @@ export type TaggableResource = Resource & {
148
150
  type: TagType;
149
151
  }> | null;
150
152
  };
153
+ export type VersionableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_payment_sources' | 'customer_subscriptions' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'refunds' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
154
+ export type VersionableResource = Resource & {
155
+ type: VersionableResourceType;
156
+ versions?: Array<ResourceRel & {
157
+ type: VersionType;
158
+ }> | null;
159
+ };
package/lib/esm/api.js CHANGED
@@ -116,6 +116,7 @@ export { default as TaxCategories } from './resources/tax_categories';
116
116
  export { default as TaxRules } from './resources/tax_rules';
117
117
  export { default as TaxjarAccounts } from './resources/taxjar_accounts';
118
118
  export { default as Transactions } from './resources/transactions';
119
+ export { default as Versions } from './resources/versions';
119
120
  export { default as Voids } from './resources/voids';
120
121
  export { default as Webhooks } from './resources/webhooks';
121
122
  export { default as WireTransfers } from './resources/wire_transfers';
@@ -235,6 +236,7 @@ export const resourceList = [
235
236
  'tax_rules',
236
237
  'taxjar_accounts',
237
238
  'transactions',
239
+ 'versions',
238
240
  'voids',
239
241
  'webhooks',
240
242
  'wire_transfers'
@@ -2,14 +2,14 @@ import * as api from './api';
2
2
  import type { ApiError } from './error';
3
3
  import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
4
4
  import { type ResourcesInitConfig } from './resource';
5
- declare const OPEN_API_SCHEMA_VERSION = "4.10.1";
5
+ declare const OPEN_API_SCHEMA_VERSION = "4.11.0";
6
6
  export { OPEN_API_SCHEMA_VERSION };
7
7
  type SdkConfig = {};
8
8
  type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
9
9
  type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
10
10
  declare class CommerceLayerClient {
11
11
  #private;
12
- readonly openApiSchemaVersion = "4.10.1";
12
+ readonly openApiSchemaVersion = "4.11.0";
13
13
  addresses: api.Addresses;
14
14
  adjustments: api.Adjustments;
15
15
  adyen_gateways: api.AdyenGateways;
@@ -123,13 +123,14 @@ declare class CommerceLayerClient {
123
123
  tax_rules: api.TaxRules;
124
124
  taxjar_accounts: api.TaxjarAccounts;
125
125
  transactions: api.Transactions;
126
+ versions: api.Versions;
126
127
  voids: api.Voids;
127
128
  webhooks: api.Webhooks;
128
129
  wire_transfers: api.WireTransfers;
129
130
  constructor(config: CommerceLayerInitConfig);
130
131
  get currentOrganization(): string;
131
132
  private localConfig;
132
- config(config: CommerceLayerConfig): void;
133
+ config(config: CommerceLayerConfig): CommerceLayerClient;
133
134
  resources(): readonly string[];
134
135
  isApiError(error: any): error is ApiError;
135
136
  addRequestInterceptor(onFulfilled?: RequestInterceptor, onRejected?: ErrorInterceptor): number;
@@ -16,7 +16,7 @@ import ResourceAdapter from './resource';
16
16
  import Debug from './debug';
17
17
  const debug = Debug('commercelayer');
18
18
  // Autogenerated schema version number, do not remove this line
19
- const OPEN_API_SCHEMA_VERSION = '4.10.1';
19
+ const OPEN_API_SCHEMA_VERSION = '4.11.0';
20
20
  export { OPEN_API_SCHEMA_VERSION };
21
21
  class CommerceLayerClient {
22
22
  // ##__CL_RESOURCES_DEF_STOP__##
@@ -28,6 +28,7 @@ class CommerceLayerClient {
28
28
  debug('new commercelayer instance %O', config);
29
29
  __classPrivateFieldSet(this, _CommerceLayerClient_adapter, new ResourceAdapter(config), "f");
30
30
  __classPrivateFieldSet(this, _CommerceLayerClient_organization, config.organization, "f");
31
+ // this.#environment = 'test'
31
32
  // ##__CL_RESOURCES_INIT_START__##
32
33
  // ##__CL_RESOURCES_INIT_TEMPLATE:: ##__TAB__####__TAB__##this.##__RESOURCE_TYPE__## = new api.##__RESOURCE_CLASS__##(this.#adapter)
33
34
  this.addresses = new api.Addresses(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
@@ -143,12 +144,15 @@ class CommerceLayerClient {
143
144
  this.tax_rules = new api.TaxRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
144
145
  this.taxjar_accounts = new api.TaxjarAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
145
146
  this.transactions = new api.Transactions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
147
+ this.versions = new api.Versions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
146
148
  this.voids = new api.Voids(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
147
149
  this.webhooks = new api.Webhooks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
148
150
  this.wire_transfers = new api.WireTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
149
151
  // ##__CL_RESOURCES_INIT_STOP__##
150
152
  }
151
153
  get currentOrganization() { return __classPrivateFieldGet(this, _CommerceLayerClient_organization, "f"); }
154
+ // get currentAccessToken(): string { return this.#adapter?.clientInstance?.currentAccessToken}
155
+ // get environment(): ApiMode { return this.#environment }
152
156
  localConfig(config) {
153
157
  if (config.organization)
154
158
  __classPrivateFieldSet(this, _CommerceLayerClient_organization, config.organization, "f");
@@ -162,6 +166,7 @@ class CommerceLayerClient {
162
166
  if (!config.organization)
163
167
  config.organization = this.currentOrganization;
164
168
  __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").config(config);
169
+ return this;
165
170
  }
166
171
  resources() {
167
172
  return CommerceLayerStatic.resources();
package/lib/esm/config.js CHANGED
@@ -1,12 +1,14 @@
1
+ // export type ApiMode = 'test' | 'live'
1
2
  const config = {
2
3
  default: {
4
+ // environment: 'test',
3
5
  domain: 'commercelayer.io',
4
6
  pageNumber: 1,
5
7
  pageSize: 10,
6
8
  },
7
9
  client: {
8
10
  timeout: 15000,
9
- requiredAttributes: ['organization', 'accessToken']
11
+ requiredAttributes: ['organization', 'accessToken'],
10
12
  }
11
13
  };
12
14
  export default config;
@@ -114,6 +114,7 @@ export type { TaxCategory, TaxCategoryCreate, TaxCategoryUpdate } from './resour
114
114
  export type { TaxRule, TaxRuleCreate, TaxRuleUpdate } from './resources/tax_rules';
115
115
  export type { TaxjarAccount, TaxjarAccountCreate, TaxjarAccountUpdate } from './resources/taxjar_accounts';
116
116
  export type { Transaction } from './resources/transactions';
117
+ export type { Version } from './resources/versions';
117
118
  export type { Void } from './resources/voids';
118
119
  export type { Webhook, WebhookCreate, WebhookUpdate } from './resources/webhooks';
119
120
  export type { WireTransfer, WireTransferCreate, WireTransferUpdate } from './resources/wire_transfers';
@@ -55,7 +55,7 @@ declare class ResourceAdapter {
55
55
  constructor(config: ResourcesInitConfig);
56
56
  get interceptors(): InterceptorManager;
57
57
  private localConfig;
58
- config(config: ResourcesConfig): void;
58
+ config(config: ResourcesConfig): ResourceAdapter;
59
59
  singleton<R extends Resource>(resource: ResourceType, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
60
60
  retrieve<R extends Resource>(resource: ResourceId, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
61
61
  list<R extends Resource>(resource: ResourceType, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<R>>;
@@ -49,7 +49,13 @@ class ResourceAdapter {
49
49
  this.localConfig(config);
50
50
  // Client config
51
51
  __classPrivateFieldGet(this, _ResourceAdapter_client, "f").config(config);
52
+ return this;
52
53
  }
54
+ /*
55
+ get clientInstance(): ApiClient {
56
+ return this.#client
57
+ }
58
+ */
53
59
  async singleton(resource, params, options) {
54
60
  debug('singleton: %o, %O, %O', resource, params || {}, options || {});
55
61
  const queryParams = generateQueryStringParams(params, resource);
@@ -4,6 +4,7 @@ import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Geocoder, GeocoderType } from './geocoders';
5
5
  import type { Event } from './events';
6
6
  import type { Tag, TagType } from './tags';
7
+ import type { Version } from './versions';
7
8
  type AddressType = 'addresses';
8
9
  type AddressRel = ResourceRel & {
9
10
  type: AddressType;
@@ -43,6 +44,7 @@ interface Address extends Resource {
43
44
  geocoder?: Geocoder | null;
44
45
  events?: Event[] | null;
45
46
  tags?: Tag[] | null;
47
+ versions?: Version[] | null;
46
48
  }
47
49
  interface AddressCreate extends ResourceCreate {
48
50
  business?: boolean | null;
@@ -92,6 +94,7 @@ declare class Addresses extends ApiResource<Address> {
92
94
  geocoder(addressId: string | Address, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Geocoder>;
93
95
  events(addressId: string | Address, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
94
96
  tags(addressId: string | Address, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
97
+ versions(addressId: string | Address, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
95
98
  isAddress(resource: any): resource is Address;
96
99
  relationship(id: string | ResourceId | null): AddressRel;
97
100
  type(): AddressType;
@@ -21,6 +21,10 @@ class Addresses extends ApiResource {
21
21
  const _addressId = addressId.id || addressId;
22
22
  return this.resources.fetch({ type: 'tags' }, `addresses/${_addressId}/tags`, params, options);
23
23
  }
24
+ async versions(addressId, params, options) {
25
+ const _addressId = addressId.id || addressId;
26
+ return this.resources.fetch({ type: 'versions' }, `addresses/${_addressId}/versions`, params, options);
27
+ }
24
28
  isAddress(resource) {
25
29
  return resource.type && (resource.type === Addresses.TYPE);
26
30
  }
@@ -1,6 +1,7 @@
1
1
  import { ApiResource } from '../resource';
2
- import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
3
- import type { QueryParamsRetrieve } from '../query';
2
+ import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
+ import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
+ import type { Version } from './versions';
4
5
  type AdjustmentType = 'adjustments';
5
6
  type AdjustmentRel = ResourceRel & {
6
7
  type: AdjustmentType;
@@ -12,6 +13,7 @@ interface Adjustment extends Resource {
12
13
  amount_cents: number;
13
14
  amount_float: number;
14
15
  formatted_amount: string;
16
+ versions?: Version[] | null;
15
17
  }
16
18
  interface AdjustmentCreate extends ResourceCreate {
17
19
  name: string;
@@ -28,6 +30,7 @@ declare class Adjustments extends ApiResource<Adjustment> {
28
30
  create(resource: AdjustmentCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Adjustment>;
29
31
  update(resource: AdjustmentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Adjustment>;
30
32
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
33
+ versions(adjustmentId: string | Adjustment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
31
34
  isAdjustment(resource: any): resource is Adjustment;
32
35
  relationship(id: string | ResourceId | null): AdjustmentRel;
33
36
  type(): AdjustmentType;
@@ -9,6 +9,10 @@ class Adjustments extends ApiResource {
9
9
  async delete(id, options) {
10
10
  await this.resources.delete((typeof id === 'string') ? { id, type: Adjustments.TYPE } : id, options);
11
11
  }
12
+ async versions(adjustmentId, params, options) {
13
+ const _adjustmentId = adjustmentId.id || adjustmentId;
14
+ return this.resources.fetch({ type: 'versions' }, `adjustments/${_adjustmentId}/versions`, params, options);
15
+ }
12
16
  isAdjustment(resource) {
13
17
  return resource.type && (resource.type === Adjustments.TYPE);
14
18
  }
@@ -2,6 +2,7 @@ import { ApiResource } from '../resource';
2
2
  import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { PaymentMethod } from './payment_methods';
5
+ import type { Version } from './versions';
5
6
  import type { AdyenPayment, AdyenPaymentType } from './adyen_payments';
6
7
  type AdyenGatewayType = 'adyen_gateways';
7
8
  type AdyenGatewayRel = ResourceRel & {
@@ -18,6 +19,7 @@ interface AdyenGateway extends Resource {
18
19
  webhook_endpoint_secret?: string | null;
19
20
  webhook_endpoint_url?: string | null;
20
21
  payment_methods?: PaymentMethod[] | null;
22
+ versions?: Version[] | null;
21
23
  adyen_payments?: AdyenPayment[] | null;
22
24
  }
23
25
  interface AdyenGatewayCreate extends ResourceCreate {
@@ -48,6 +50,7 @@ declare class AdyenGateways extends ApiResource<AdyenGateway> {
48
50
  update(resource: AdyenGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<AdyenGateway>;
49
51
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
50
52
  payment_methods(adyenGatewayId: string | AdyenGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
53
+ versions(adyenGatewayId: string | AdyenGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
51
54
  adyen_payments(adyenGatewayId: string | AdyenGateway, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<AdyenPayment>>;
52
55
  isAdyenGateway(resource: any): resource is AdyenGateway;
53
56
  relationship(id: string | ResourceId | null): AdyenGatewayRel;
@@ -13,6 +13,10 @@ class AdyenGateways extends ApiResource {
13
13
  const _adyenGatewayId = adyenGatewayId.id || adyenGatewayId;
14
14
  return this.resources.fetch({ type: 'payment_methods' }, `adyen_gateways/${_adyenGatewayId}/payment_methods`, params, options);
15
15
  }
16
+ async versions(adyenGatewayId, params, options) {
17
+ const _adyenGatewayId = adyenGatewayId.id || adyenGatewayId;
18
+ return this.resources.fetch({ type: 'versions' }, `adyen_gateways/${_adyenGatewayId}/versions`, params, options);
19
+ }
16
20
  async adyen_payments(adyenGatewayId, params, options) {
17
21
  const _adyenGatewayId = adyenGatewayId.id || adyenGatewayId;
18
22
  return this.resources.fetch({ type: 'adyen_payments' }, `adyen_gateways/${_adyenGatewayId}/adyen_payments`, params, options);
@@ -1,8 +1,9 @@
1
1
  import { ApiResource } from '../resource';
2
- import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
3
- import type { QueryParamsRetrieve } from '../query';
2
+ import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
+ import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Order, OrderType } from './orders';
5
5
  import type { PaymentGateway } from './payment_gateways';
6
+ import type { Version } from './versions';
6
7
  type AdyenPaymentType = 'adyen_payments';
7
8
  type AdyenPaymentRel = ResourceRel & {
8
9
  type: AdyenPaymentType;
@@ -21,6 +22,7 @@ interface AdyenPayment extends Resource {
21
22
  payment_instrument?: Record<string, any> | null;
22
23
  order?: Order | null;
23
24
  payment_gateway?: PaymentGateway | null;
25
+ versions?: Version[] | null;
24
26
  }
25
27
  interface AdyenPaymentCreate extends ResourceCreate {
26
28
  order: OrderRel;
@@ -39,6 +41,7 @@ declare class AdyenPayments extends ApiResource<AdyenPayment> {
39
41
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
40
42
  order(adyenPaymentId: string | AdyenPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
41
43
  payment_gateway(adyenPaymentId: string | AdyenPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
44
+ versions(adyenPaymentId: string | AdyenPayment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
42
45
  _details(id: string | AdyenPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<AdyenPayment>;
43
46
  isAdyenPayment(resource: any): resource is AdyenPayment;
44
47
  relationship(id: string | ResourceId | null): AdyenPaymentRel;
@@ -17,6 +17,10 @@ class AdyenPayments extends ApiResource {
17
17
  const _adyenPaymentId = adyenPaymentId.id || adyenPaymentId;
18
18
  return this.resources.fetch({ type: 'payment_gateways' }, `adyen_payments/${_adyenPaymentId}/payment_gateway`, params, options);
19
19
  }
20
+ async versions(adyenPaymentId, params, options) {
21
+ const _adyenPaymentId = adyenPaymentId.id || adyenPaymentId;
22
+ return this.resources.fetch({ type: 'versions' }, `adyen_payments/${_adyenPaymentId}/versions`, params, options);
23
+ }
20
24
  async _details(id, params, options) {
21
25
  return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: AdyenPayments.TYPE, _details: true }, params, options);
22
26
  }
@@ -3,6 +3,7 @@ import type { Resource, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Order } from './orders';
5
5
  import type { Attachment } from './attachments';
6
+ import type { Version } from './versions';
6
7
  import type { Capture } from './captures';
7
8
  import type { Void } from './voids';
8
9
  import type { Event } from './events';
@@ -39,6 +40,7 @@ interface Authorization extends Resource {
39
40
  formatted_void_balance?: string | null;
40
41
  order?: Order | null;
41
42
  attachments?: Attachment[] | null;
43
+ versions?: Version[] | null;
42
44
  captures?: Capture[] | null;
43
45
  voids?: Void[] | null;
44
46
  events?: Event[] | null;
@@ -53,6 +55,7 @@ declare class Authorizations extends ApiResource<Authorization> {
53
55
  update(resource: AuthorizationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
54
56
  order(authorizationId: string | Authorization, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
55
57
  attachments(authorizationId: string | Authorization, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
58
+ versions(authorizationId: string | Authorization, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
56
59
  captures(authorizationId: string | Authorization, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Capture>>;
57
60
  voids(authorizationId: string | Authorization, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Void>>;
58
61
  events(authorizationId: string | Authorization, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
@@ -11,6 +11,10 @@ class Authorizations extends ApiResource {
11
11
  const _authorizationId = authorizationId.id || authorizationId;
12
12
  return this.resources.fetch({ type: 'attachments' }, `authorizations/${_authorizationId}/attachments`, params, options);
13
13
  }
14
+ async versions(authorizationId, params, options) {
15
+ const _authorizationId = authorizationId.id || authorizationId;
16
+ return this.resources.fetch({ type: 'versions' }, `authorizations/${_authorizationId}/versions`, params, options);
17
+ }
14
18
  async captures(authorizationId, params, options) {
15
19
  const _authorizationId = authorizationId.id || authorizationId;
16
20
  return this.resources.fetch({ type: 'captures' }, `authorizations/${_authorizationId}/captures`, params, options);
@@ -3,6 +3,7 @@ import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesCon
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Market } from './markets';
5
5
  import type { Attachment } from './attachments';
6
+ import type { Version } from './versions';
6
7
  import type { TaxCategory, TaxCategoryType } from './tax_categories';
7
8
  type AvalaraAccountType = 'avalara_accounts';
8
9
  type AvalaraAccountRel = ResourceRel & {
@@ -20,6 +21,7 @@ interface AvalaraAccount extends Resource {
20
21
  ddp?: string | null;
21
22
  markets?: Market[] | null;
22
23
  attachments?: Attachment[] | null;
24
+ versions?: Version[] | null;
23
25
  tax_categories?: TaxCategory[] | null;
24
26
  }
25
27
  interface AvalaraAccountCreate extends ResourceCreate {
@@ -47,6 +49,7 @@ declare class AvalaraAccounts extends ApiResource<AvalaraAccount> {
47
49
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
48
50
  markets(avalaraAccountId: string | AvalaraAccount, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
49
51
  attachments(avalaraAccountId: string | AvalaraAccount, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
52
+ versions(avalaraAccountId: string | AvalaraAccount, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
50
53
  tax_categories(avalaraAccountId: string | AvalaraAccount, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<TaxCategory>>;
51
54
  isAvalaraAccount(resource: any): resource is AvalaraAccount;
52
55
  relationship(id: string | ResourceId | null): AvalaraAccountRel;