@commercelayer/sdk 4.3.0 → 4.5.0-beta.2

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 (384) hide show
  1. package/README.md +24 -13
  2. package/lib/cjs/client.js +1 -1
  3. package/lib/cjs/commercelayer.d.ts +2 -2
  4. package/lib/cjs/commercelayer.js +1 -1
  5. package/lib/cjs/common.js +1 -1
  6. package/lib/cjs/debug.d.ts +1 -1
  7. package/lib/cjs/debug.js +1 -1
  8. package/lib/cjs/jsonapi.js +1 -1
  9. package/lib/cjs/query.js +1 -1
  10. package/lib/cjs/resource.d.ts +2 -0
  11. package/lib/cjs/resource.js +1 -1
  12. package/lib/cjs/resources/addresses.d.ts +1 -0
  13. package/lib/cjs/resources/addresses.js +1 -1
  14. package/lib/cjs/resources/adyen_gateways.d.ts +2 -0
  15. package/lib/cjs/resources/adyen_gateways.js +1 -1
  16. package/lib/cjs/resources/adyen_payments.d.ts +2 -0
  17. package/lib/cjs/resources/adyen_payments.js +1 -1
  18. package/lib/cjs/resources/authorizations.d.ts +3 -0
  19. package/lib/cjs/resources/authorizations.js +1 -1
  20. package/lib/cjs/resources/avalara_accounts.d.ts +3 -0
  21. package/lib/cjs/resources/avalara_accounts.js +1 -1
  22. package/lib/cjs/resources/billing_info_validation_rules.d.ts +1 -0
  23. package/lib/cjs/resources/billing_info_validation_rules.js +1 -1
  24. package/lib/cjs/resources/bing_geocoders.d.ts +2 -0
  25. package/lib/cjs/resources/bing_geocoders.js +1 -1
  26. package/lib/cjs/resources/braintree_gateways.d.ts +2 -0
  27. package/lib/cjs/resources/braintree_gateways.js +1 -1
  28. package/lib/cjs/resources/braintree_payments.d.ts +2 -0
  29. package/lib/cjs/resources/braintree_payments.js +1 -1
  30. package/lib/cjs/resources/bundles.d.ts +4 -0
  31. package/lib/cjs/resources/bundles.js +1 -1
  32. package/lib/cjs/resources/captures.d.ts +3 -0
  33. package/lib/cjs/resources/captures.js +1 -1
  34. package/lib/cjs/resources/carrier_accounts.d.ts +2 -0
  35. package/lib/cjs/resources/carrier_accounts.js +1 -1
  36. package/lib/cjs/resources/checkout_com_gateways.d.ts +2 -0
  37. package/lib/cjs/resources/checkout_com_gateways.js +1 -1
  38. package/lib/cjs/resources/checkout_com_payments.d.ts +2 -0
  39. package/lib/cjs/resources/checkout_com_payments.js +1 -1
  40. package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +1 -0
  41. package/lib/cjs/resources/coupon_codes_promotion_rules.js +1 -1
  42. package/lib/cjs/resources/coupon_recipients.d.ts +2 -0
  43. package/lib/cjs/resources/coupon_recipients.js +1 -1
  44. package/lib/cjs/resources/coupons.d.ts +1 -0
  45. package/lib/cjs/resources/coupons.js +1 -1
  46. package/lib/cjs/resources/customer_addresses.d.ts +2 -0
  47. package/lib/cjs/resources/customer_addresses.js +1 -1
  48. package/lib/cjs/resources/customer_groups.d.ts +3 -0
  49. package/lib/cjs/resources/customer_groups.js +1 -1
  50. package/lib/cjs/resources/customer_password_resets.d.ts +1 -0
  51. package/lib/cjs/resources/customer_password_resets.js +1 -1
  52. package/lib/cjs/resources/customer_payment_sources.d.ts +1 -0
  53. package/lib/cjs/resources/customer_payment_sources.js +1 -1
  54. package/lib/cjs/resources/customer_subscriptions.d.ts +1 -0
  55. package/lib/cjs/resources/customer_subscriptions.js +1 -1
  56. package/lib/cjs/resources/customers.d.ts +8 -0
  57. package/lib/cjs/resources/customers.js +1 -1
  58. package/lib/cjs/resources/delivery_lead_times.d.ts +3 -0
  59. package/lib/cjs/resources/delivery_lead_times.js +1 -1
  60. package/lib/cjs/resources/event_callbacks.d.ts +1 -0
  61. package/lib/cjs/resources/event_callbacks.js +1 -1
  62. package/lib/cjs/resources/external_gateways.d.ts +2 -0
  63. package/lib/cjs/resources/external_gateways.js +1 -1
  64. package/lib/cjs/resources/external_payments.d.ts +3 -0
  65. package/lib/cjs/resources/external_payments.js +1 -1
  66. package/lib/cjs/resources/external_promotions.d.ts +5 -0
  67. package/lib/cjs/resources/external_promotions.js +1 -1
  68. package/lib/cjs/resources/external_tax_calculators.d.ts +3 -0
  69. package/lib/cjs/resources/external_tax_calculators.js +1 -1
  70. package/lib/cjs/resources/fixed_amount_promotions.d.ts +5 -0
  71. package/lib/cjs/resources/fixed_amount_promotions.js +1 -1
  72. package/lib/cjs/resources/fixed_price_promotions.d.ts +7 -0
  73. package/lib/cjs/resources/fixed_price_promotions.js +1 -1
  74. package/lib/cjs/resources/free_gift_promotions.d.ts +7 -0
  75. package/lib/cjs/resources/free_gift_promotions.js +1 -1
  76. package/lib/cjs/resources/free_shipping_promotions.d.ts +5 -0
  77. package/lib/cjs/resources/free_shipping_promotions.js +1 -1
  78. package/lib/cjs/resources/geocoders.d.ts +2 -0
  79. package/lib/cjs/resources/geocoders.js +1 -1
  80. package/lib/cjs/resources/gift_card_recipients.d.ts +2 -0
  81. package/lib/cjs/resources/gift_card_recipients.js +1 -1
  82. package/lib/cjs/resources/gift_cards.d.ts +3 -0
  83. package/lib/cjs/resources/gift_cards.js +1 -1
  84. package/lib/cjs/resources/google_geocoders.d.ts +2 -0
  85. package/lib/cjs/resources/google_geocoders.js +1 -1
  86. package/lib/cjs/resources/in_stock_subscriptions.d.ts +3 -0
  87. package/lib/cjs/resources/in_stock_subscriptions.js +1 -1
  88. package/lib/cjs/resources/inventory_models.d.ts +3 -0
  89. package/lib/cjs/resources/inventory_models.js +1 -1
  90. package/lib/cjs/resources/inventory_return_locations.d.ts +2 -0
  91. package/lib/cjs/resources/inventory_return_locations.js +1 -1
  92. package/lib/cjs/resources/inventory_stock_locations.d.ts +2 -0
  93. package/lib/cjs/resources/inventory_stock_locations.js +1 -1
  94. package/lib/cjs/resources/klarna_gateways.d.ts +2 -0
  95. package/lib/cjs/resources/klarna_gateways.js +1 -1
  96. package/lib/cjs/resources/klarna_payments.d.ts +2 -0
  97. package/lib/cjs/resources/klarna_payments.js +1 -1
  98. package/lib/cjs/resources/line_item_options.d.ts +2 -0
  99. package/lib/cjs/resources/line_item_options.js +1 -1
  100. package/lib/cjs/resources/line_items.d.ts +4 -0
  101. package/lib/cjs/resources/line_items.js +1 -1
  102. package/lib/cjs/resources/manual_gateways.d.ts +1 -0
  103. package/lib/cjs/resources/manual_gateways.js +1 -1
  104. package/lib/cjs/resources/manual_tax_calculators.d.ts +4 -0
  105. package/lib/cjs/resources/manual_tax_calculators.js +1 -1
  106. package/lib/cjs/resources/markets.d.ts +6 -0
  107. package/lib/cjs/resources/markets.js +1 -1
  108. package/lib/cjs/resources/merchants.d.ts +2 -0
  109. package/lib/cjs/resources/merchants.js +1 -1
  110. package/lib/cjs/resources/order_copies.d.ts +3 -0
  111. package/lib/cjs/resources/order_copies.js +1 -1
  112. package/lib/cjs/resources/order_subscriptions.d.ts +5 -0
  113. package/lib/cjs/resources/order_subscriptions.js +1 -1
  114. package/lib/cjs/resources/order_validation_rules.d.ts +1 -0
  115. package/lib/cjs/resources/order_validation_rules.js +1 -1
  116. package/lib/cjs/resources/orders.d.ts +16 -0
  117. package/lib/cjs/resources/orders.js +1 -1
  118. package/lib/cjs/resources/packages.d.ts +3 -0
  119. package/lib/cjs/resources/packages.js +1 -1
  120. package/lib/cjs/resources/parcel_line_items.d.ts +2 -0
  121. package/lib/cjs/resources/parcel_line_items.js +1 -1
  122. package/lib/cjs/resources/parcels.d.ts +4 -0
  123. package/lib/cjs/resources/parcels.js +1 -1
  124. package/lib/cjs/resources/payment_gateways.d.ts +1 -0
  125. package/lib/cjs/resources/payment_gateways.js +1 -1
  126. package/lib/cjs/resources/payment_methods.d.ts +3 -0
  127. package/lib/cjs/resources/payment_methods.js +1 -1
  128. package/lib/cjs/resources/paypal_gateways.d.ts +2 -0
  129. package/lib/cjs/resources/paypal_gateways.js +1 -1
  130. package/lib/cjs/resources/paypal_payments.d.ts +2 -0
  131. package/lib/cjs/resources/paypal_payments.js +1 -1
  132. package/lib/cjs/resources/percentage_discount_promotions.d.ts +7 -0
  133. package/lib/cjs/resources/percentage_discount_promotions.js +1 -1
  134. package/lib/cjs/resources/price_lists.d.ts +2 -0
  135. package/lib/cjs/resources/price_lists.js +1 -1
  136. package/lib/cjs/resources/prices.d.ts +3 -0
  137. package/lib/cjs/resources/prices.js +1 -1
  138. package/lib/cjs/resources/promotions.d.ts +5 -0
  139. package/lib/cjs/resources/promotions.js +1 -1
  140. package/lib/cjs/resources/refunds.d.ts +2 -0
  141. package/lib/cjs/resources/refunds.js +1 -1
  142. package/lib/cjs/resources/return_line_items.d.ts +2 -0
  143. package/lib/cjs/resources/return_line_items.js +1 -1
  144. package/lib/cjs/resources/returns.d.ts +7 -0
  145. package/lib/cjs/resources/returns.js +1 -1
  146. package/lib/cjs/resources/shipments.d.ts +13 -0
  147. package/lib/cjs/resources/shipments.js +1 -1
  148. package/lib/cjs/resources/shipping_categories.d.ts +2 -0
  149. package/lib/cjs/resources/shipping_categories.js +1 -1
  150. package/lib/cjs/resources/shipping_methods.d.ts +5 -0
  151. package/lib/cjs/resources/shipping_methods.js +1 -1
  152. package/lib/cjs/resources/shipping_zones.d.ts +1 -0
  153. package/lib/cjs/resources/shipping_zones.js +1 -1
  154. package/lib/cjs/resources/sku_list_items.d.ts +2 -0
  155. package/lib/cjs/resources/sku_list_items.js +1 -1
  156. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +2 -0
  157. package/lib/cjs/resources/sku_list_promotion_rules.js +1 -1
  158. package/lib/cjs/resources/sku_lists.d.ts +3 -0
  159. package/lib/cjs/resources/sku_lists.js +1 -1
  160. package/lib/cjs/resources/sku_options.d.ts +2 -0
  161. package/lib/cjs/resources/sku_options.js +1 -1
  162. package/lib/cjs/resources/skus.d.ts +6 -0
  163. package/lib/cjs/resources/skus.js +1 -1
  164. package/lib/cjs/resources/stock_items.d.ts +3 -0
  165. package/lib/cjs/resources/stock_items.js +1 -1
  166. package/lib/cjs/resources/stock_line_items.d.ts +3 -0
  167. package/lib/cjs/resources/stock_line_items.js +1 -1
  168. package/lib/cjs/resources/stock_locations.d.ts +6 -0
  169. package/lib/cjs/resources/stock_locations.js +1 -1
  170. package/lib/cjs/resources/stock_transfers.d.ts +5 -0
  171. package/lib/cjs/resources/stock_transfers.js +1 -1
  172. package/lib/cjs/resources/stripe_gateways.d.ts +2 -0
  173. package/lib/cjs/resources/stripe_gateways.js +1 -1
  174. package/lib/cjs/resources/stripe_payments.d.ts +2 -0
  175. package/lib/cjs/resources/stripe_payments.js +1 -1
  176. package/lib/cjs/resources/tax_calculators.d.ts +3 -0
  177. package/lib/cjs/resources/tax_calculators.js +1 -1
  178. package/lib/cjs/resources/tax_categories.d.ts +2 -0
  179. package/lib/cjs/resources/tax_categories.js +1 -1
  180. package/lib/cjs/resources/tax_rules.d.ts +1 -0
  181. package/lib/cjs/resources/tax_rules.js +1 -1
  182. package/lib/cjs/resources/taxjar_accounts.d.ts +3 -0
  183. package/lib/cjs/resources/taxjar_accounts.js +1 -1
  184. package/lib/cjs/resources/transactions.d.ts +1 -0
  185. package/lib/cjs/resources/transactions.js +1 -1
  186. package/lib/cjs/resources/voids.d.ts +2 -0
  187. package/lib/cjs/resources/voids.js +1 -1
  188. package/lib/cjs/resources/webhooks.d.ts +1 -0
  189. package/lib/cjs/resources/webhooks.js +1 -1
  190. package/lib/cjs/resources/wire_transfers.d.ts +1 -0
  191. package/lib/cjs/resources/wire_transfers.js +1 -1
  192. package/lib/esm/client.js +1 -1
  193. package/lib/esm/commercelayer.d.ts +2 -2
  194. package/lib/esm/commercelayer.js +1 -1
  195. package/lib/esm/common.js +1 -1
  196. package/lib/esm/debug.d.ts +1 -1
  197. package/lib/esm/debug.js +1 -1
  198. package/lib/esm/jsonapi.js +1 -1
  199. package/lib/esm/query.js +1 -1
  200. package/lib/esm/resource.d.ts +2 -0
  201. package/lib/esm/resource.js +1 -1
  202. package/lib/esm/resources/addresses.d.ts +1 -0
  203. package/lib/esm/resources/addresses.js +1 -1
  204. package/lib/esm/resources/adyen_gateways.d.ts +2 -0
  205. package/lib/esm/resources/adyen_gateways.js +1 -1
  206. package/lib/esm/resources/adyen_payments.d.ts +2 -0
  207. package/lib/esm/resources/adyen_payments.js +1 -1
  208. package/lib/esm/resources/authorizations.d.ts +3 -0
  209. package/lib/esm/resources/authorizations.js +1 -1
  210. package/lib/esm/resources/avalara_accounts.d.ts +3 -0
  211. package/lib/esm/resources/avalara_accounts.js +1 -1
  212. package/lib/esm/resources/billing_info_validation_rules.d.ts +1 -0
  213. package/lib/esm/resources/billing_info_validation_rules.js +1 -1
  214. package/lib/esm/resources/bing_geocoders.d.ts +2 -0
  215. package/lib/esm/resources/bing_geocoders.js +1 -1
  216. package/lib/esm/resources/braintree_gateways.d.ts +2 -0
  217. package/lib/esm/resources/braintree_gateways.js +1 -1
  218. package/lib/esm/resources/braintree_payments.d.ts +2 -0
  219. package/lib/esm/resources/braintree_payments.js +1 -1
  220. package/lib/esm/resources/bundles.d.ts +4 -0
  221. package/lib/esm/resources/bundles.js +1 -1
  222. package/lib/esm/resources/captures.d.ts +3 -0
  223. package/lib/esm/resources/captures.js +1 -1
  224. package/lib/esm/resources/carrier_accounts.d.ts +2 -0
  225. package/lib/esm/resources/carrier_accounts.js +1 -1
  226. package/lib/esm/resources/checkout_com_gateways.d.ts +2 -0
  227. package/lib/esm/resources/checkout_com_gateways.js +1 -1
  228. package/lib/esm/resources/checkout_com_payments.d.ts +2 -0
  229. package/lib/esm/resources/checkout_com_payments.js +1 -1
  230. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +1 -0
  231. package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -1
  232. package/lib/esm/resources/coupon_recipients.d.ts +2 -0
  233. package/lib/esm/resources/coupon_recipients.js +1 -1
  234. package/lib/esm/resources/coupons.d.ts +1 -0
  235. package/lib/esm/resources/coupons.js +1 -1
  236. package/lib/esm/resources/customer_addresses.d.ts +2 -0
  237. package/lib/esm/resources/customer_addresses.js +1 -1
  238. package/lib/esm/resources/customer_groups.d.ts +3 -0
  239. package/lib/esm/resources/customer_groups.js +1 -1
  240. package/lib/esm/resources/customer_password_resets.d.ts +1 -0
  241. package/lib/esm/resources/customer_password_resets.js +1 -1
  242. package/lib/esm/resources/customer_payment_sources.d.ts +1 -0
  243. package/lib/esm/resources/customer_payment_sources.js +1 -1
  244. package/lib/esm/resources/customer_subscriptions.d.ts +1 -0
  245. package/lib/esm/resources/customer_subscriptions.js +1 -1
  246. package/lib/esm/resources/customers.d.ts +8 -0
  247. package/lib/esm/resources/customers.js +1 -1
  248. package/lib/esm/resources/delivery_lead_times.d.ts +3 -0
  249. package/lib/esm/resources/delivery_lead_times.js +1 -1
  250. package/lib/esm/resources/event_callbacks.d.ts +1 -0
  251. package/lib/esm/resources/event_callbacks.js +1 -1
  252. package/lib/esm/resources/external_gateways.d.ts +2 -0
  253. package/lib/esm/resources/external_gateways.js +1 -1
  254. package/lib/esm/resources/external_payments.d.ts +3 -0
  255. package/lib/esm/resources/external_payments.js +1 -1
  256. package/lib/esm/resources/external_promotions.d.ts +5 -0
  257. package/lib/esm/resources/external_promotions.js +1 -1
  258. package/lib/esm/resources/external_tax_calculators.d.ts +3 -0
  259. package/lib/esm/resources/external_tax_calculators.js +1 -1
  260. package/lib/esm/resources/fixed_amount_promotions.d.ts +5 -0
  261. package/lib/esm/resources/fixed_amount_promotions.js +1 -1
  262. package/lib/esm/resources/fixed_price_promotions.d.ts +7 -0
  263. package/lib/esm/resources/fixed_price_promotions.js +1 -1
  264. package/lib/esm/resources/free_gift_promotions.d.ts +7 -0
  265. package/lib/esm/resources/free_gift_promotions.js +1 -1
  266. package/lib/esm/resources/free_shipping_promotions.d.ts +5 -0
  267. package/lib/esm/resources/free_shipping_promotions.js +1 -1
  268. package/lib/esm/resources/geocoders.d.ts +2 -0
  269. package/lib/esm/resources/geocoders.js +1 -1
  270. package/lib/esm/resources/gift_card_recipients.d.ts +2 -0
  271. package/lib/esm/resources/gift_card_recipients.js +1 -1
  272. package/lib/esm/resources/gift_cards.d.ts +3 -0
  273. package/lib/esm/resources/gift_cards.js +1 -1
  274. package/lib/esm/resources/google_geocoders.d.ts +2 -0
  275. package/lib/esm/resources/google_geocoders.js +1 -1
  276. package/lib/esm/resources/in_stock_subscriptions.d.ts +3 -0
  277. package/lib/esm/resources/in_stock_subscriptions.js +1 -1
  278. package/lib/esm/resources/inventory_models.d.ts +3 -0
  279. package/lib/esm/resources/inventory_models.js +1 -1
  280. package/lib/esm/resources/inventory_return_locations.d.ts +2 -0
  281. package/lib/esm/resources/inventory_return_locations.js +1 -1
  282. package/lib/esm/resources/inventory_stock_locations.d.ts +2 -0
  283. package/lib/esm/resources/inventory_stock_locations.js +1 -1
  284. package/lib/esm/resources/klarna_gateways.d.ts +2 -0
  285. package/lib/esm/resources/klarna_gateways.js +1 -1
  286. package/lib/esm/resources/klarna_payments.d.ts +2 -0
  287. package/lib/esm/resources/klarna_payments.js +1 -1
  288. package/lib/esm/resources/line_item_options.d.ts +2 -0
  289. package/lib/esm/resources/line_item_options.js +1 -1
  290. package/lib/esm/resources/line_items.d.ts +4 -0
  291. package/lib/esm/resources/line_items.js +1 -1
  292. package/lib/esm/resources/manual_gateways.d.ts +1 -0
  293. package/lib/esm/resources/manual_gateways.js +1 -1
  294. package/lib/esm/resources/manual_tax_calculators.d.ts +4 -0
  295. package/lib/esm/resources/manual_tax_calculators.js +1 -1
  296. package/lib/esm/resources/markets.d.ts +6 -0
  297. package/lib/esm/resources/markets.js +1 -1
  298. package/lib/esm/resources/merchants.d.ts +2 -0
  299. package/lib/esm/resources/merchants.js +1 -1
  300. package/lib/esm/resources/order_copies.d.ts +3 -0
  301. package/lib/esm/resources/order_copies.js +1 -1
  302. package/lib/esm/resources/order_subscriptions.d.ts +5 -0
  303. package/lib/esm/resources/order_subscriptions.js +1 -1
  304. package/lib/esm/resources/order_validation_rules.d.ts +1 -0
  305. package/lib/esm/resources/order_validation_rules.js +1 -1
  306. package/lib/esm/resources/orders.d.ts +16 -0
  307. package/lib/esm/resources/orders.js +1 -1
  308. package/lib/esm/resources/packages.d.ts +3 -0
  309. package/lib/esm/resources/packages.js +1 -1
  310. package/lib/esm/resources/parcel_line_items.d.ts +2 -0
  311. package/lib/esm/resources/parcel_line_items.js +1 -1
  312. package/lib/esm/resources/parcels.d.ts +4 -0
  313. package/lib/esm/resources/parcels.js +1 -1
  314. package/lib/esm/resources/payment_gateways.d.ts +1 -0
  315. package/lib/esm/resources/payment_gateways.js +1 -1
  316. package/lib/esm/resources/payment_methods.d.ts +3 -0
  317. package/lib/esm/resources/payment_methods.js +1 -1
  318. package/lib/esm/resources/paypal_gateways.d.ts +2 -0
  319. package/lib/esm/resources/paypal_gateways.js +1 -1
  320. package/lib/esm/resources/paypal_payments.d.ts +2 -0
  321. package/lib/esm/resources/paypal_payments.js +1 -1
  322. package/lib/esm/resources/percentage_discount_promotions.d.ts +7 -0
  323. package/lib/esm/resources/percentage_discount_promotions.js +1 -1
  324. package/lib/esm/resources/price_lists.d.ts +2 -0
  325. package/lib/esm/resources/price_lists.js +1 -1
  326. package/lib/esm/resources/prices.d.ts +3 -0
  327. package/lib/esm/resources/prices.js +1 -1
  328. package/lib/esm/resources/promotions.d.ts +5 -0
  329. package/lib/esm/resources/promotions.js +1 -1
  330. package/lib/esm/resources/refunds.d.ts +2 -0
  331. package/lib/esm/resources/refunds.js +1 -1
  332. package/lib/esm/resources/return_line_items.d.ts +2 -0
  333. package/lib/esm/resources/return_line_items.js +1 -1
  334. package/lib/esm/resources/returns.d.ts +7 -0
  335. package/lib/esm/resources/returns.js +1 -1
  336. package/lib/esm/resources/shipments.d.ts +13 -0
  337. package/lib/esm/resources/shipments.js +1 -1
  338. package/lib/esm/resources/shipping_categories.d.ts +2 -0
  339. package/lib/esm/resources/shipping_categories.js +1 -1
  340. package/lib/esm/resources/shipping_methods.d.ts +5 -0
  341. package/lib/esm/resources/shipping_methods.js +1 -1
  342. package/lib/esm/resources/shipping_zones.d.ts +1 -0
  343. package/lib/esm/resources/shipping_zones.js +1 -1
  344. package/lib/esm/resources/sku_list_items.d.ts +2 -0
  345. package/lib/esm/resources/sku_list_items.js +1 -1
  346. package/lib/esm/resources/sku_list_promotion_rules.d.ts +2 -0
  347. package/lib/esm/resources/sku_list_promotion_rules.js +1 -1
  348. package/lib/esm/resources/sku_lists.d.ts +3 -0
  349. package/lib/esm/resources/sku_lists.js +1 -1
  350. package/lib/esm/resources/sku_options.d.ts +2 -0
  351. package/lib/esm/resources/sku_options.js +1 -1
  352. package/lib/esm/resources/skus.d.ts +6 -0
  353. package/lib/esm/resources/skus.js +1 -1
  354. package/lib/esm/resources/stock_items.d.ts +3 -0
  355. package/lib/esm/resources/stock_items.js +1 -1
  356. package/lib/esm/resources/stock_line_items.d.ts +3 -0
  357. package/lib/esm/resources/stock_line_items.js +1 -1
  358. package/lib/esm/resources/stock_locations.d.ts +6 -0
  359. package/lib/esm/resources/stock_locations.js +1 -1
  360. package/lib/esm/resources/stock_transfers.d.ts +5 -0
  361. package/lib/esm/resources/stock_transfers.js +1 -1
  362. package/lib/esm/resources/stripe_gateways.d.ts +2 -0
  363. package/lib/esm/resources/stripe_gateways.js +1 -1
  364. package/lib/esm/resources/stripe_payments.d.ts +2 -0
  365. package/lib/esm/resources/stripe_payments.js +1 -1
  366. package/lib/esm/resources/tax_calculators.d.ts +3 -0
  367. package/lib/esm/resources/tax_calculators.js +1 -1
  368. package/lib/esm/resources/tax_categories.d.ts +2 -0
  369. package/lib/esm/resources/tax_categories.js +1 -1
  370. package/lib/esm/resources/tax_rules.d.ts +1 -0
  371. package/lib/esm/resources/tax_rules.js +1 -1
  372. package/lib/esm/resources/taxjar_accounts.d.ts +3 -0
  373. package/lib/esm/resources/taxjar_accounts.js +1 -1
  374. package/lib/esm/resources/transactions.d.ts +1 -0
  375. package/lib/esm/resources/transactions.js +1 -1
  376. package/lib/esm/resources/voids.d.ts +2 -0
  377. package/lib/esm/resources/voids.js +1 -1
  378. package/lib/esm/resources/webhooks.d.ts +1 -0
  379. package/lib/esm/resources/webhooks.js +1 -1
  380. package/lib/esm/resources/wire_transfers.d.ts +1 -0
  381. package/lib/esm/resources/wire_transfers.js +1 -1
  382. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  383. package/lib/tsconfig.tsbuildinfo +1 -1
  384. package/package.json +8 -8
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Commerce Layer JS SDK
2
2
 
3
- A JavaScript Library wrapper that makes it quick and easy to interact with the [Commerce Layer API](https://docs.commercelayer.io/developers/).
3
+ [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
4
+
5
+ A JavaScript Library wrapper that makes it quick and easy to interact with the [Commerce Layer API](https://docs.commercelayer.io/api/).
4
6
 
5
7
  ### What is Commerce Layer?
6
8
 
@@ -28,7 +30,7 @@ yarn add @commercelayer/sdk
28
30
 
29
31
  ## Authentication
30
32
 
31
- All requests to Commerce Layer API must be authenticated with an [OAuth2](https://oauth.net/2/) bearer token. Hence, before starting to use this SDK you need to get a valid access token. Check [our documentation](https://docs.commercelayer.io/developers/authentication) for more information about the available authorization flows.
33
+ All requests to Commerce Layer API must be authenticated with an [OAuth2](https://oauth.net/2/) bearer token. Hence, before starting to use this SDK you need to get a valid access token. Check [our documentation](https://docs.commercelayer.io/api/authentication) for more information about the available authorization flows.
32
34
 
33
35
  > Feel free to use [Commerce Layer JS Auth](https://github.com/commercelayer/commercelayer-js-auth), a JavaScript library that helps you wrap our authentication API.
34
36
 
@@ -45,7 +47,7 @@ const cl = CommerceLayer({
45
47
  })
46
48
  ```
47
49
 
48
- > In the following examples, we will use only the the specific resources we're going to access (SKUs and shipping categories). Check our [API reference](https://docs.commercelayer.io/developers/v/api-reference/) for the complete list of available resources and their attributes.
50
+ > In the following examples, we will use only the the specific resources we're going to access (SKUs and shipping categories). Check our [API reference](https://docs.commercelayer.io/api/) for the complete list of available resources and their attributes.
49
51
 
50
52
  # Usage
51
53
 
@@ -53,12 +55,13 @@ The code snippets below show how to use the Commerce Layer JS SDK when performin
53
55
 
54
56
  - ### Create
55
57
  - [How to create an SKU](#how-to-create-an-sku)
56
- - ### Retrieve
58
+ - ### Retrieve / List
57
59
  - [How to fetch a single SKU](#how-to-fetch-a-single-sku)
58
60
  - [How to fetch a collection of SKUs](#how-to-fetch-a-collection-of-skus)
59
61
  - [How to paginate a collection of SKUs](#how-to-paginate-a-collection-of-skus)
60
62
  - [How to iterate through a collection of SKUs](#how-to-iterate-through-a-collection-of-skus)
61
- - [How to build complex queries](#how-to-build-complex-queries)
63
+ <!-- - [How to build complex queries](#how-to-build-complex-queries) -->
64
+ - [How to fetch resource relationships](#how-to-fetch-resource-relationships)
62
65
  - ### Update
63
66
  - [How to update an existing SKU](#how-to-update-an-existing-sku)
64
67
  - ### Delete
@@ -81,9 +84,9 @@ The code snippets below show how to use the Commerce Layer JS SDK when performin
81
84
  const newSku = await cl.skus.create(attributes)
82
85
  ```
83
86
 
84
- Check our API reference for more information on how to [create an SKU](https://docs.commercelayer.io/developers/v/api-reference/skus/create).
87
+ Check our API reference for more information on how to [create an SKU](https://docs.commercelayer.io/api/resources/skus/create_sku).
85
88
 
86
- ## Retrieve
89
+ ## Retrieve / List
87
90
 
88
91
  ### How to fetch a single SKU
89
92
 
@@ -101,7 +104,7 @@ Check our API reference for more information on how to [create an SKU](https://d
101
104
  const sku = (await cl.skus.list()).last()
102
105
  ```
103
106
 
104
- Check our API reference for more information on how to [retrieve an SKU](https://docs.commercelayer.io/developers/v/api-reference/skus/retrieve).
107
+ Check our API reference for more information on how to [retrieve an SKU](https://docs.commercelayer.io/api/resources/skus/retrieve_sku).
105
108
 
106
109
  ### How to fetch a collection of SKUs
107
110
 
@@ -160,7 +163,7 @@ When fetching a collection of resources you can leverage the `meta` attribute to
160
163
  const meta = skus.meta
161
164
  ```
162
165
 
163
- Check our API reference for more information on how to [list all SKUs](https://docs.commercelayer.io/developers/v/api-reference/skus/list), [sort the results](https://docs.commercelayer.io/developers/sorting-results), use [sparse fieldsets](https://docs.commercelayer.io/developers/sparse-fieldsets), [include associations](https://docs.commercelayer.io/developers/including-associations), and [filter data](https://docs.commercelayer.io/developers/filtering-data).
166
+ Check our API reference for more information on how to [list all SKUs](https://docs.commercelayer.io/api/resources/skus/list_skus), [sort the results](https://docs.commercelayer.io/api/sorting-results), use [sparse fieldsets](https://docs.commercelayer.io/api/sparse-fieldsets), [include associations](https://docs.commercelayer.io/api/including-associations), and [filter data](https://docs.commercelayer.io/api/filtering-data).
164
167
 
165
168
  ### How to paginate a collection of SKUs
166
169
 
@@ -179,7 +182,7 @@ When you fetch a collection of resources, you get paginated results:
179
182
 
180
183
  > The default page number is **1**. The default page size is **10**. The maximum page size allowed is **25**.
181
184
 
182
- Check our API reference for more information on how [pagination](https://docs.commercelayer.io/developers/pagination) works.
185
+ Check our API reference for more information on how [pagination](https://docs.commercelayer.io/api/pagination) works.
183
186
 
184
187
  ### How to iterate through a collection of SKUs
185
188
 
@@ -191,6 +194,14 @@ To execute a function for every item of a collection, use the `map()` method:
191
194
  skus.map(p => console.log('Product: ' + p.name + ' - Code: ' + p.code))
192
195
  ```
193
196
 
197
+
198
+ ### How to fetch resource relationships
199
+
200
+ xxxxxxx
201
+ ```
202
+ code
203
+ ```
204
+
194
205
  ## Update
195
206
 
196
207
  ### How to update an existing SKU
@@ -205,7 +216,7 @@ To execute a function for every item of a collection, use the `map()` method:
205
216
  cl.skus.update(sku) // updates the SKU on the server
206
217
  ```
207
218
 
208
- Check our API reference for more information on how to [update an SKU](https://docs.commercelayer.io/developers/v/api-reference/skus/update).
219
+ Check our API reference for more information on how to [update an SKU](https://docs.commercelayer.io/api/resources/skus/update_sku).
209
220
 
210
221
  ## Delete
211
222
 
@@ -215,7 +226,7 @@ Check our API reference for more information on how to [update an SKU](https://d
215
226
  cl.skus.delete('xYZkjABcde') // persisted deletion
216
227
  ```
217
228
 
218
- Check our API reference for more information on how to [delete an SKU](https://docs.commercelayer.io/developers/v/api-reference/skus/delete).
229
+ Check our API reference for more information on how to [delete an SKU](https://docs.commercelayer.io/api/resources/skus/delete_sku).
219
230
 
220
231
  # Overriding credentials
221
232
 
@@ -274,7 +285,7 @@ Commerce Layer API returns specific errors (with extra information) on each attr
274
285
 
275
286
  ```
276
287
 
277
- Check our API reference for more information about the [errors](https://docs.commercelayer.io/developers/handling-errors) returned by the API.
288
+ Check our API reference for more information about the [errors](https://docs.commercelayer.io/api/handling-errors) returned by the API.
278
289
 
279
290
  ---
280
291
 
package/lib/cjs/client.js CHANGED
@@ -1 +1 @@
1
- "use strict";var __classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(t,e,r,s,a){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(t,e,r,s){if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?s:r==="a"?s.call(t):s?s.value:e.get(t)},__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},_ApiClient_accessToken,_ApiClient_client;Object.defineProperty(exports,"__esModule",{value:!0});const axios_1=__importDefault(require("axios")),error_1=require("./error"),config_1=__importDefault(require("./config")),debug_1=__importDefault(require("./debug")),debug=(0,debug_1.default)(),baseURL=(t,e)=>`https://${t.toLowerCase()}.${e||config_1.default.default.domain}/api`,handleError=t=>{let e=new error_1.SdkError({message:t.message,type:error_1.ErrorType.GENERIC});if(axios_1.default.isAxiosError(t))if(t.response){const r=new error_1.ApiError(e);r.type=error_1.ErrorType.RESPONSE,r.status=t.response.status,r.code=String(r.status),r.errors=t.response.data.errors,e=r}else t.request?(e.type=error_1.ErrorType.REQUEST,e.request=t.request):e.type=error_1.ErrorType.CLIENT;else axios_1.default.isCancel(t)?e.type=error_1.ErrorType.CANCEL:e.source=t;throw e};class ApiClient{constructor(e){_ApiClient_accessToken.set(this,void 0),_ApiClient_client.set(this,void 0),debug("new client instance %O",e),this.baseUrl=baseURL(e.organization,e.domain),__classPrivateFieldSet(this,_ApiClient_accessToken,e.accessToken,"f");const r={timeout:e.timeout||config_1.default.client.timeout,proxy:e.proxy,httpAgent:e.httpAgent,httpsAgent:e.httpsAgent},s=Object.assign({baseURL:this.baseUrl,timeout:config_1.default.client.timeout,headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json",Authorization:"Bearer "+__classPrivateFieldGet(this,_ApiClient_accessToken,"f")}},r);debug("axios options: %O",s),__classPrivateFieldSet(this,_ApiClient_client,axios_1.default.create(s),"f"),this.interceptors=__classPrivateFieldGet(this,_ApiClient_client,"f").interceptors}static create(e){if(!(e==null?void 0:e.organization))throw new Error("Undefined 'organization' parameter");if(!(e==null?void 0:e.accessToken))throw new Error("Undefined 'accessToken' parameter");return new ApiClient(e)}config(e){debug("config %o",e);const r=__classPrivateFieldGet(this,_ApiClient_client,"f").defaults;e.timeout&&(r.timeout=e.timeout),e.proxy&&(r.proxy=e.proxy),e.httpAgent&&(r.httpAgent=e.httpAgent),e.httpsAgent&&(r.httpsAgent=e.httpsAgent),e.organization&&(this.baseUrl=baseURL(e.organization,e.domain)),e.accessToken&&(__classPrivateFieldSet(this,_ApiClient_accessToken,e.accessToken,"f"),r.headers.common.Authorization="Bearer "+__classPrivateFieldGet(this,_ApiClient_accessToken,"f"))}async request(e,r,s,a){debug("request %s %s, %O, %O",e,r,s||{},a||{});const c=s?{data:s}:void 0,u=r,d=(a==null?void 0:a.organization)?baseURL(a.organization,a.domain):void 0,i=(a==null?void 0:a.accessToken)||__classPrivateFieldGet(this,_ApiClient_accessToken,"f"),p=i?{Authorization:"Bearer "+i}:void 0,n=Object.assign({method:e,baseURL:d,url:u,data:c,headers:p},a);return debug("request params: %O",n),__classPrivateFieldGet(this,_ApiClient_client,"f").request(n).then(o=>o.data).catch(o=>handleError(o))}}_ApiClient_accessToken=new WeakMap,_ApiClient_client=new WeakMap,exports.default=ApiClient;
1
+ "use strict";var __classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(t,e,r,s,a){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(t,e,r,s){if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?s:r==="a"?s.call(t):s?s.value:e.get(t)},__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},_ApiClient_accessToken,_ApiClient_client;Object.defineProperty(exports,"__esModule",{value:!0});const axios_1=__importDefault(require("axios")),error_1=require("./error"),config_1=__importDefault(require("./config")),debug_1=__importDefault(require("./debug")),debug=(0,debug_1.default)("client"),baseURL=(t,e)=>`https://${t.toLowerCase()}.${e||config_1.default.default.domain}/api`,handleError=t=>{let e=new error_1.SdkError({message:t.message,type:error_1.ErrorType.GENERIC});if(axios_1.default.isAxiosError(t))if(t.response){const r=new error_1.ApiError(e);r.type=error_1.ErrorType.RESPONSE,r.status=t.response.status,r.code=String(r.status),r.errors=t.response.data.errors,e=r}else t.request?(e.type=error_1.ErrorType.REQUEST,e.request=t.request):e.type=error_1.ErrorType.CLIENT;else axios_1.default.isCancel(t)?e.type=error_1.ErrorType.CANCEL:e.source=t;throw e};class ApiClient{constructor(e){_ApiClient_accessToken.set(this,void 0),_ApiClient_client.set(this,void 0),debug("new client instance %O",e),this.baseUrl=baseURL(e.organization,e.domain),__classPrivateFieldSet(this,_ApiClient_accessToken,e.accessToken,"f");const r={timeout:e.timeout||config_1.default.client.timeout,proxy:e.proxy,httpAgent:e.httpAgent,httpsAgent:e.httpsAgent},s=Object.assign({baseURL:this.baseUrl,timeout:config_1.default.client.timeout,headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json",Authorization:"Bearer "+__classPrivateFieldGet(this,_ApiClient_accessToken,"f")}},r);debug("axios options: %O",s),__classPrivateFieldSet(this,_ApiClient_client,axios_1.default.create(s),"f"),this.interceptors=__classPrivateFieldGet(this,_ApiClient_client,"f").interceptors}static create(e){if(!(e==null?void 0:e.organization))throw new Error("Undefined 'organization' parameter");if(!(e==null?void 0:e.accessToken))throw new Error("Undefined 'accessToken' parameter");return new ApiClient(e)}config(e){debug("config %o",e);const r=__classPrivateFieldGet(this,_ApiClient_client,"f").defaults;e.timeout&&(r.timeout=e.timeout),e.proxy&&(r.proxy=e.proxy),e.httpAgent&&(r.httpAgent=e.httpAgent),e.httpsAgent&&(r.httpsAgent=e.httpsAgent),e.organization&&(this.baseUrl=baseURL(e.organization,e.domain)),e.accessToken&&(__classPrivateFieldSet(this,_ApiClient_accessToken,e.accessToken,"f"),r.headers.common.Authorization="Bearer "+__classPrivateFieldGet(this,_ApiClient_accessToken,"f"))}async request(e,r,s,a){debug("request %s %s, %O, %O",e,r,s||{},a||{});const c=s?{data:s}:void 0,u=r,d=(a==null?void 0:a.organization)?baseURL(a.organization,a.domain):void 0,i=(a==null?void 0:a.accessToken)||__classPrivateFieldGet(this,_ApiClient_accessToken,"f"),l=i?{Authorization:"Bearer "+i}:void 0,n=Object.assign({method:e,baseURL:d,url:u,data:c,headers:l},a);return debug("request params: %O",n),__classPrivateFieldGet(this,_ApiClient_client,"f").request(n).then(o=>o.data).catch(o=>handleError(o))}}_ApiClient_accessToken=new WeakMap,_ApiClient_client=new WeakMap,exports.default=ApiClient;
@@ -1,10 +1,10 @@
1
1
  import * as api from './api';
2
2
  import { ApiError } from './error';
3
3
  import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
4
- import { ResourcesConfig, ResourcesInitConfig } from './resource';
4
+ import { ResourcesInitConfig } from './resource';
5
5
  declare type SdkConfig = {};
6
6
  declare type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
7
- declare type CommerceLayerConfig = SdkConfig & ResourcesConfig;
7
+ declare type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
8
8
  declare class CommerceLayerClient {
9
9
  #private;
10
10
  static get openApiSchemaVersion(): string;
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,s,i){i===void 0&&(i=s),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,i){i===void 0&&(i=s),e[i]=t[s]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var s in e)s!=="default"&&Object.prototype.hasOwnProperty.call(e,s)&&__createBinding(t,e,s);return __setModuleDefault(t,e),t},__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(e,t,s,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(e,s):n?n.value=s:t.set(e,s),s},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(e,t,s,i){if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?i:s==="a"?i.call(e):i?i.value:t.get(e)},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},_CommerceLayerClient_adapter,_CommerceLayerClient_organization;Object.defineProperty(exports,"__esModule",{value:!0});const api=__importStar(require("./api")),static_1=require("./static"),resource_1=__importDefault(require("./resource")),debug_1=__importDefault(require("./debug")),debug=(0,debug_1.default)(),OPEN_API_SCHEMA_VERSION="2.8.1";class CommerceLayerClient{constructor(t){_CommerceLayerClient_adapter.set(this,void 0),_CommerceLayerClient_organization.set(this,void 0),debug("new commercelayer instance %O",t),__classPrivateFieldSet(this,_CommerceLayerClient_adapter,new resource_1.default(t),"f"),__classPrivateFieldSet(this,_CommerceLayerClient_organization,t.organization,"f"),this.addresses=new api.Addresses(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.adjustments=new api.Adjustments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.adyen_gateways=new api.AdyenGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.adyen_payments=new api.AdyenPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.application=new api.Applications(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.attachments=new api.Attachments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.authorizations=new api.Authorizations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.avalara_accounts=new api.AvalaraAccounts(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.billing_info_validation_rules=new api.BillingInfoValidationRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.bing_geocoders=new api.BingGeocoders(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.braintree_gateways=new api.BraintreeGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.braintree_payments=new api.BraintreePayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.bundles=new api.Bundles(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.captures=new api.Captures(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.carrier_accounts=new api.CarrierAccounts(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.checkout_com_gateways=new api.CheckoutComGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.checkout_com_payments=new api.CheckoutComPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.coupon_codes_promotion_rules=new api.CouponCodesPromotionRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.coupon_recipients=new api.CouponRecipients(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.coupons=new api.Coupons(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customer_addresses=new api.CustomerAddresses(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customer_groups=new api.CustomerGroups(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customer_password_resets=new api.CustomerPasswordResets(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customer_payment_sources=new api.CustomerPaymentSources(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customer_subscriptions=new api.CustomerSubscriptions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customers=new api.Customers(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.delivery_lead_times=new api.DeliveryLeadTimes(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.event_callbacks=new api.EventCallbacks(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.external_gateways=new api.ExternalGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.external_payments=new api.ExternalPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.external_promotions=new api.ExternalPromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.external_tax_calculators=new api.ExternalTaxCalculators(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.fixed_amount_promotions=new api.FixedAmountPromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.fixed_price_promotions=new api.FixedPricePromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.free_gift_promotions=new api.FreeGiftPromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.free_shipping_promotions=new api.FreeShippingPromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.geocoders=new api.Geocoders(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.gift_card_recipients=new api.GiftCardRecipients(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.gift_cards=new api.GiftCards(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.google_geocoders=new api.GoogleGeocoders(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.imports=new api.Imports(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.in_stock_subscriptions=new api.InStockSubscriptions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.inventory_models=new api.InventoryModels(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.inventory_return_locations=new api.InventoryReturnLocations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.inventory_stock_locations=new api.InventoryStockLocations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.klarna_gateways=new api.KlarnaGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.klarna_payments=new api.KlarnaPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.line_item_options=new api.LineItemOptions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.line_items=new api.LineItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.manual_gateways=new api.ManualGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.manual_tax_calculators=new api.ManualTaxCalculators(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.markets=new api.Markets(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.merchants=new api.Merchants(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.order_amount_promotion_rules=new api.OrderAmountPromotionRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.order_copies=new api.OrderCopies(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.order_subscriptions=new api.OrderSubscriptions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.order_validation_rules=new api.OrderValidationRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.orders=new api.Orders(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.organization=new api.Organizations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.packages=new api.Packages(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.parcel_line_items=new api.ParcelLineItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.parcels=new api.Parcels(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.payment_gateways=new api.PaymentGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.payment_methods=new api.PaymentMethods(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.paypal_gateways=new api.PaypalGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.paypal_payments=new api.PaypalPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.percentage_discount_promotions=new api.PercentageDiscountPromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.price_lists=new api.PriceLists(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.prices=new api.Prices(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.promotion_rules=new api.PromotionRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.promotions=new api.Promotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.refunds=new api.Refunds(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.return_line_items=new api.ReturnLineItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.returns=new api.Returns(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.shipments=new api.Shipments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.shipping_categories=new api.ShippingCategories(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.shipping_methods=new api.ShippingMethods(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.shipping_zones=new api.ShippingZones(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.sku_list_items=new api.SkuListItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.sku_list_promotion_rules=new api.SkuListPromotionRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.sku_lists=new api.SkuLists(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.sku_options=new api.SkuOptions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.skus=new api.Skus(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stock_items=new api.StockItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stock_line_items=new api.StockLineItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stock_locations=new api.StockLocations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stock_transfers=new api.StockTransfers(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stripe_gateways=new api.StripeGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stripe_payments=new api.StripePayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.tax_calculators=new api.TaxCalculators(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.tax_categories=new api.TaxCategories(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.tax_rules=new api.TaxRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.taxjar_accounts=new api.TaxjarAccounts(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.transactions=new api.Transactions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.voids=new api.Voids(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.webhooks=new api.Webhooks(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.wire_transfers=new api.WireTransfers(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f"))}static get openApiSchemaVersion(){return OPEN_API_SCHEMA_VERSION}get currentOrganization(){return __classPrivateFieldGet(this,_CommerceLayerClient_organization,"f")}localConfig(t){t.organization&&__classPrivateFieldSet(this,_CommerceLayerClient_organization,t.organization,"f")}config(t){debug("config %o",t),this.localConfig(t),__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").config(t)}resources(){return static_1.CommerceLayerStatic.resources()}isApiError(t){return static_1.CommerceLayerStatic.isApiError(t)}addRequestInterceptor(t,s){return __classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").interceptors.request.use(t,s)}addResponseInterceptor(t,s){return __classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").interceptors.response.use(t,s)}removeInterceptor(t,s){return __classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").interceptors[t].eject(s)}addRawResponseReader(){const t={id:void 0,rawResponse:void 0};function s(n){return t.rawResponse=n==null?void 0:n.data,n}const i=this.addResponseInterceptor(s);return t.id=i,t}removeRawResponseReader(t){const s=typeof t=="number"?t:t.id;if(s)return this.removeInterceptor("response",s)}}_CommerceLayerClient_adapter=new WeakMap,_CommerceLayerClient_organization=new WeakMap;const CommerceLayer=e=>new CommerceLayerClient(e);exports.default=CommerceLayer;
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,s,i){i===void 0&&(i=s),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,i){i===void 0&&(i=s),e[i]=t[s]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var s in e)s!=="default"&&Object.prototype.hasOwnProperty.call(e,s)&&__createBinding(t,e,s);return __setModuleDefault(t,e),t},__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(e,t,s,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(e,s):n?n.value=s:t.set(e,s),s},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(e,t,s,i){if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?i:s==="a"?i.call(e):i?i.value:t.get(e)},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},_CommerceLayerClient_adapter,_CommerceLayerClient_organization;Object.defineProperty(exports,"__esModule",{value:!0});const api=__importStar(require("./api")),static_1=require("./static"),resource_1=__importDefault(require("./resource")),debug_1=__importDefault(require("./debug")),debug=(0,debug_1.default)("commercelayer"),OPEN_API_SCHEMA_VERSION="2.8.1";class CommerceLayerClient{constructor(t){_CommerceLayerClient_adapter.set(this,void 0),_CommerceLayerClient_organization.set(this,void 0),debug("new commercelayer instance %O",t),__classPrivateFieldSet(this,_CommerceLayerClient_adapter,new resource_1.default(t),"f"),__classPrivateFieldSet(this,_CommerceLayerClient_organization,t.organization,"f"),this.addresses=new api.Addresses(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.adjustments=new api.Adjustments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.adyen_gateways=new api.AdyenGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.adyen_payments=new api.AdyenPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.application=new api.Applications(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.attachments=new api.Attachments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.authorizations=new api.Authorizations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.avalara_accounts=new api.AvalaraAccounts(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.billing_info_validation_rules=new api.BillingInfoValidationRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.bing_geocoders=new api.BingGeocoders(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.braintree_gateways=new api.BraintreeGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.braintree_payments=new api.BraintreePayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.bundles=new api.Bundles(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.captures=new api.Captures(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.carrier_accounts=new api.CarrierAccounts(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.checkout_com_gateways=new api.CheckoutComGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.checkout_com_payments=new api.CheckoutComPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.coupon_codes_promotion_rules=new api.CouponCodesPromotionRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.coupon_recipients=new api.CouponRecipients(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.coupons=new api.Coupons(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customer_addresses=new api.CustomerAddresses(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customer_groups=new api.CustomerGroups(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customer_password_resets=new api.CustomerPasswordResets(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customer_payment_sources=new api.CustomerPaymentSources(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customer_subscriptions=new api.CustomerSubscriptions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.customers=new api.Customers(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.delivery_lead_times=new api.DeliveryLeadTimes(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.event_callbacks=new api.EventCallbacks(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.external_gateways=new api.ExternalGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.external_payments=new api.ExternalPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.external_promotions=new api.ExternalPromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.external_tax_calculators=new api.ExternalTaxCalculators(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.fixed_amount_promotions=new api.FixedAmountPromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.fixed_price_promotions=new api.FixedPricePromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.free_gift_promotions=new api.FreeGiftPromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.free_shipping_promotions=new api.FreeShippingPromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.geocoders=new api.Geocoders(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.gift_card_recipients=new api.GiftCardRecipients(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.gift_cards=new api.GiftCards(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.google_geocoders=new api.GoogleGeocoders(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.imports=new api.Imports(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.in_stock_subscriptions=new api.InStockSubscriptions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.inventory_models=new api.InventoryModels(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.inventory_return_locations=new api.InventoryReturnLocations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.inventory_stock_locations=new api.InventoryStockLocations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.klarna_gateways=new api.KlarnaGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.klarna_payments=new api.KlarnaPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.line_item_options=new api.LineItemOptions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.line_items=new api.LineItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.manual_gateways=new api.ManualGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.manual_tax_calculators=new api.ManualTaxCalculators(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.markets=new api.Markets(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.merchants=new api.Merchants(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.order_amount_promotion_rules=new api.OrderAmountPromotionRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.order_copies=new api.OrderCopies(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.order_subscriptions=new api.OrderSubscriptions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.order_validation_rules=new api.OrderValidationRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.orders=new api.Orders(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.organization=new api.Organizations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.packages=new api.Packages(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.parcel_line_items=new api.ParcelLineItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.parcels=new api.Parcels(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.payment_gateways=new api.PaymentGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.payment_methods=new api.PaymentMethods(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.paypal_gateways=new api.PaypalGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.paypal_payments=new api.PaypalPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.percentage_discount_promotions=new api.PercentageDiscountPromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.price_lists=new api.PriceLists(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.prices=new api.Prices(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.promotion_rules=new api.PromotionRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.promotions=new api.Promotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.refunds=new api.Refunds(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.return_line_items=new api.ReturnLineItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.returns=new api.Returns(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.shipments=new api.Shipments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.shipping_categories=new api.ShippingCategories(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.shipping_methods=new api.ShippingMethods(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.shipping_zones=new api.ShippingZones(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.sku_list_items=new api.SkuListItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.sku_list_promotion_rules=new api.SkuListPromotionRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.sku_lists=new api.SkuLists(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.sku_options=new api.SkuOptions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.skus=new api.Skus(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stock_items=new api.StockItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stock_line_items=new api.StockLineItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stock_locations=new api.StockLocations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stock_transfers=new api.StockTransfers(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stripe_gateways=new api.StripeGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stripe_payments=new api.StripePayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.tax_calculators=new api.TaxCalculators(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.tax_categories=new api.TaxCategories(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.tax_rules=new api.TaxRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.taxjar_accounts=new api.TaxjarAccounts(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.transactions=new api.Transactions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.voids=new api.Voids(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.webhooks=new api.Webhooks(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.wire_transfers=new api.WireTransfers(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f"))}static get openApiSchemaVersion(){return OPEN_API_SCHEMA_VERSION}get currentOrganization(){return __classPrivateFieldGet(this,_CommerceLayerClient_organization,"f")}localConfig(t){t.organization&&__classPrivateFieldSet(this,_CommerceLayerClient_organization,t.organization,"f")}config(t){debug("config %o",t),this.localConfig(t),__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").config(t)}resources(){return static_1.CommerceLayerStatic.resources()}isApiError(t){return static_1.CommerceLayerStatic.isApiError(t)}addRequestInterceptor(t,s){return __classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").interceptors.request.use(t,s)}addResponseInterceptor(t,s){return __classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").interceptors.response.use(t,s)}removeInterceptor(t,s){return __classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").interceptors[t].eject(s)}addRawResponseReader(){const t={id:void 0,rawResponse:void 0};function s(n){return t.rawResponse=n==null?void 0:n.data,n}const i=this.addResponseInterceptor(s);return t.id=i,t}removeRawResponseReader(t){const s=typeof t=="number"?t:t.id;if(s)return this.removeInterceptor("response",s)}}_CommerceLayerClient_adapter=new WeakMap,_CommerceLayerClient_organization=new WeakMap;const CommerceLayer=e=>new CommerceLayerClient(e);exports.default=CommerceLayer;
package/lib/cjs/common.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isResourceType=exports.isResourceId=void 0;const api_1=require("./api"),isResourceId=e=>e&&e.type&&e.id&&api_1.resourceList.includes(e.type);exports.isResourceId=isResourceId;const isResourceType=e=>e&&typeof e.type!="undefined"&&e.type&&api_1.resourceList.includes(e.type);exports.isResourceType=isResourceType;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isResourceType=exports.isResourceId=void 0;const api_1=require("./api"),isResourceId=e=>e&&e.type&&e.id&&api_1.resourceList.includes(e.type);exports.isResourceId=isResourceId;const isResourceType=e=>e&&typeof e.type<"u"&&e.type&&api_1.resourceList.includes(e.type);exports.isResourceType=isResourceType;
@@ -1,3 +1,3 @@
1
1
  declare type Debugger = (pattern: string, ...args: any[]) => void;
2
- declare const debug: (namespace?: string | undefined) => Debugger;
2
+ declare const debug: (namespace: string) => Debugger;
3
3
  export default debug;
package/lib/cjs/debug.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const debuggerFunction=(e,...r)=>{};let debuggerFactory=e=>debuggerFunction;try{const e=require("debug");e&&typeof e=="function"&&(debuggerFactory=e)}catch{}const debugPrefix="clsdk",caller=()=>{const e=new Error;Error.prepareStackTrace=(c,t)=>t;const r=e.stack;return Error.prepareStackTrace=void 0,(r[2].getFileName()||"/").replace(/^.*[\\/]/,"").replace(".ts","")},debug=e=>debuggerFactory(`${debugPrefix}:${e||caller()}`);exports.default=debug;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const debuggerFunction=(e,...t)=>{};let debuggerFactory=e=>debuggerFunction;try{const e=require("debug");e&&typeof e=="function"&&(debuggerFactory=e)}catch{}const debugPrefix="clsdk",debug=e=>debuggerFactory(`${debugPrefix}:${e}`);exports.default=debug;
@@ -1 +1 @@
1
- "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.normalize=exports.denormalize=void 0;const common_1=require("./common"),debug_1=__importDefault(require("./debug")),debug=(0,debug_1.default)(),denormalize=e=>{let t;e.links&&delete e.links;const r=e.data,s=e.included;return Array.isArray(r)?t=r.map(i=>denormalizeResource(i,s)):t=denormalizeResource(r,s),t};exports.denormalize=denormalize;const findIncluded=(e,t=[])=>t.find(r=>e.id===r.id&&e.type===r.type)||e,denormalizeResource=(e,t)=>{debug("denormalize resource: %O, %o",e,t||{});const r=Object.assign({id:e.id,type:e.type},e.attributes);return e.relationships&&Object.keys(e.relationships).forEach(s=>{const i=e.relationships[s].data;i?Array.isArray(i)?r[s]=i.map(o=>denormalizeResource(findIncluded(o,t),t)):r[s]=denormalizeResource(findIncluded(i,t),t):i===null&&(r[s]=null)}),debug("denormalized resource: %O",r),r},normalize=e=>{debug("normalize resource: %O",e);const t={},r={};for(const i in e){if(["type","id"].includes(i))continue;const o=e[i];o&&(0,common_1.isResourceType)(o)&&o.id===null?r[i]={data:null}:o&&((0,common_1.isResourceId)(o)||Array.isArray(o)&&(0,common_1.isResourceId)(o[0]))?r[i]={data:o}:t[i]=o}const s={type:e.type,attributes:t,relationships:r};return(0,common_1.isResourceId)(e)&&(s.id=e.id),debug("normalized resource: %O",s),s};exports.normalize=normalize;
1
+ "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.normalize=exports.denormalize=void 0;const common_1=require("./common"),debug_1=__importDefault(require("./debug")),debug=(0,debug_1.default)("jsonapi"),denormalize=e=>{let o;e.links&&delete e.links;const r=e.data,i=e.included;return Array.isArray(r)?o=r.map(t=>denormalizeResource(t,i)):o=denormalizeResource(r,i),o};exports.denormalize=denormalize;const findIncluded=(e,o=[])=>o.find(r=>e.id===r.id&&e.type===r.type)||e,denormalizeResource=(e,o)=>{debug("denormalize resource: %O, %o",e,o||{});const r=Object.assign({id:e.id,type:e.type},e.attributes);return e.relationships&&Object.keys(e.relationships).forEach(i=>{const t=e.relationships[i].data;t?Array.isArray(t)?r[i]=t.map(s=>denormalizeResource(findIncluded(s,o),o)):r[i]=denormalizeResource(findIncluded(t,o),o):t===null&&(r[i]=null)}),debug("denormalized resource: %O",r),r},normalize=e=>{debug("normalize resource: %O",e);const o={},r={};for(const t in e){if(["type","id"].includes(t))continue;const s=e[t];s&&(0,common_1.isResourceType)(s)&&s.id===null?r[t]={data:null}:s&&((0,common_1.isResourceId)(s)||Array.isArray(s)&&(0,common_1.isResourceId)(s[0]))?r[t]={data:s}:o[t]=s}const i={type:e.type,attributes:o,relationships:r};return(0,common_1.isResourceId)(e)&&(i.id=e.id),debug("normalized resource: %O",i),i};exports.normalize=normalize;
package/lib/cjs/query.js CHANGED
@@ -1 +1 @@
1
- "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.generateQueryStringParams=void 0;const debug_1=__importDefault(require("./debug")),debug=(0,debug_1.default)(),isParamsList=e=>e.filters||e.pageNumber||e.pageSize||e.sort,generateQueryStringParams=(e,r)=>{debug("generate query string params: %O, %O",e,r);const t={};return e&&(e.include&&(t.include=e.include.join(",")),e.fields&&(Array.isArray(e.fields)&&(e.fields={[r.type]:e.fields}),Object.entries(e.fields).forEach(([i,s])=>{t[`fields[${i}]`]=s.join(",")})),isParamsList(e)&&(e.sort&&(Array.isArray(e.sort)?t.sort=e.sort.join(","):t.sort=Object.entries(e.sort).map(([i,s])=>`${s==="desc"?"-":""}${i}`).join(",")),e.pageNumber&&(t["page[number]"]=String(e.pageNumber)),e.pageSize&&(t["page[size]"]=String(e.pageSize)),e.filters&&Object.entries(e.filters).forEach(([i,s])=>{t[`filter[q][${i}]`]=String(s)})),debug("query string params: %O",t)),t};exports.generateQueryStringParams=generateQueryStringParams;
1
+ "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.generateQueryStringParams=void 0;const debug_1=__importDefault(require("./debug")),debug=(0,debug_1.default)("query"),isParamsList=e=>e.filters||e.pageNumber||e.pageSize||e.sort,generateQueryStringParams=(e,r)=>{debug("generate query string params: %O, %O",e,r);const t={};return e&&(e.include&&(t.include=e.include.join(",")),e.fields&&(Array.isArray(e.fields)&&(e.fields={[r.type]:e.fields}),Object.entries(e.fields).forEach(([i,s])=>{t[`fields[${i}]`]=s.join(",")})),isParamsList(e)&&(e.sort&&(Array.isArray(e.sort)?t.sort=e.sort.join(","):t.sort=Object.entries(e.sort).map(([i,s])=>`${s==="desc"?"-":""}${i}`).join(",")),e.pageNumber&&(t["page[number]"]=String(e.pageNumber)),e.pageSize&&(t["page[size]"]=String(e.pageSize)),e.filters&&Object.entries(e.filters).forEach(([i,s])=>{t[`filter[q][${i}]`]=String(s)})),debug("query string params: %O",t)),t};exports.generateQueryStringParams=generateQueryStringParams;
@@ -2,6 +2,7 @@ import { ApiClientInitConfig } from './client';
2
2
  import { QueryParamsRetrieve, QueryParamsList } from './query';
3
3
  import { ResourceTypeLock } from './api';
4
4
  import { InterceptorManager } from './interceptor';
5
+ import { QueryParams } from '.';
5
6
  declare type ResourceNull = {
6
7
  id: null;
7
8
  } & ResourceType;
@@ -62,6 +63,7 @@ declare class ResourceAdapter {
62
63
  create<C extends ResourceCreate, R extends Resource>(resource: C & ResourceType, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
63
64
  update<U extends ResourceUpdate, R extends Resource>(resource: U & ResourceId, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
64
65
  delete(resource: ResourceId, options?: ResourcesConfig): Promise<void>;
66
+ fetch<R extends Resource>(resource: ResourceType, path: string, params?: QueryParams, options?: ResourcesConfig): Promise<R | ListResponse<R>>;
65
67
  }
66
68
  declare abstract class ApiResource {
67
69
  static readonly TYPE: ResourceTypeLock;
@@ -1 +1 @@
1
- "use strict";var __classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(r,e,s,t,i){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?i.call(r,s):i?i.value=s:e.set(r,s),s},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(r,e,s,t){if(s==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!t:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?t:s==="a"?t.call(r):t?t.value:e.get(r)},__importDefault=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},_ResourceAdapter_client,_ResourceAdapter_config;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ApiResource=void 0;const client_1=__importDefault(require("./client")),jsonapi_1=require("./jsonapi"),query_1=require("./query"),config_1=__importDefault(require("./config")),debug_1=__importDefault(require("./debug")),debug=(0,debug_1.default)();class ListResponse extends Array{constructor(e,s){super(...s||[]);this.meta=e}first(){return this.length?this[0]:void 0}last(){return this.length?this[this.length-1]:void 0}get(e){return this.length&&e>=0?this[e]:void 0}}class ResourceAdapter{constructor(e){_ResourceAdapter_client.set(this,void 0),_ResourceAdapter_config.set(this,{}),__classPrivateFieldSet(this,_ResourceAdapter_client,client_1.default.create(e),"f"),this.localConfig(e)}get interceptors(){return __classPrivateFieldGet(this,_ResourceAdapter_client,"f").interceptors}localConfig(e){}config(e){debug("config %o",e),this.localConfig(e),__classPrivateFieldGet(this,_ResourceAdapter_client,"f").config(e)}async singleton(e,s,t){debug("singleton: %o, %O, %O",e,s||{},t||{});const i=(0,query_1.generateQueryStringParams)(s,e);(t==null?void 0:t.params)&&Object.assign(i,t==null?void 0:t.params);const a=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("get",`${e.type}`,void 0,Object.assign(Object.assign({},t),{params:i}));return(0,jsonapi_1.denormalize)(a)}async retrieve(e,s,t){debug("retrieve: %o, %O, %O",e,s||{},t||{});const i=(0,query_1.generateQueryStringParams)(s,e);(t==null?void 0:t.params)&&Object.assign(i,t==null?void 0:t.params);const a=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("get",`${e.type}/${e.id}`,void 0,Object.assign(Object.assign({},t),{params:i}));return(0,jsonapi_1.denormalize)(a)}async list(e,s,t){var i,a;debug("list: %o, %O, %O",e,s||{},t||{});const n=(0,query_1.generateQueryStringParams)(s,e);(t==null?void 0:t.params)&&Object.assign(n,t==null?void 0:t.params);const o=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("get",`${e.type}`,void 0,Object.assign(Object.assign({},t),{params:n})),c=(0,jsonapi_1.denormalize)(o),u={pageCount:Number((i=o.meta)===null||i===void 0?void 0:i.page_count),recordCount:Number((a=o.meta)===null||a===void 0?void 0:a.record_count),currentPage:(s==null?void 0:s.pageNumber)||config_1.default.default.pageNumber,recordsPerPage:(s==null?void 0:s.pageSize)||config_1.default.default.pageSize};return new ListResponse(u,c)}async create(e,s,t){debug("create: %o, %O, %O",e,s||{},t||{});const i=(0,query_1.generateQueryStringParams)(s,e);(t==null?void 0:t.params)&&Object.assign(i,t==null?void 0:t.params);const a=(0,jsonapi_1.normalize)(e),n=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("post",e.type,a,Object.assign(Object.assign({},t),{params:i}));return(0,jsonapi_1.denormalize)(n)}async update(e,s,t){debug("update: %o, %O, %O",e,s||{},t||{});const i=(0,query_1.generateQueryStringParams)(s,e);(t==null?void 0:t.params)&&Object.assign(i,t==null?void 0:t.params);const a=(0,jsonapi_1.normalize)(e),n=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("patch",`${e.type}/${e.id}`,a,Object.assign(Object.assign({},t),{params:i}));return(0,jsonapi_1.denormalize)(n)}async delete(e,s){debug("delete: %o, %O",e,s||{}),await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("delete",`${e.type}/${e.id}`,void 0,s)}}_ResourceAdapter_client=new WeakMap,_ResourceAdapter_config=new WeakMap;class ApiResource{constructor(e){debug("new resource instance: %s",this.type()),this.resources=e}}exports.ApiResource=ApiResource,exports.default=ResourceAdapter;
1
+ "use strict";var __classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(s,e,r,t,a){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?s!==e||!a:!e.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?a.call(s,r):a?a.value=r:e.set(s,r),r},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(s,e,r,t){if(r==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?s!==e||!t:!e.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?t:r==="a"?t.call(s):t?t.value:e.get(s)},__importDefault=this&&this.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},_ResourceAdapter_client,_ResourceAdapter_config;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ApiResource=void 0;const client_1=__importDefault(require("./client")),jsonapi_1=require("./jsonapi"),query_1=require("./query"),config_1=__importDefault(require("./config")),debug_1=__importDefault(require("./debug")),debug=(0,debug_1.default)("resource");class ListResponse extends Array{constructor(e,r){super(...r||[]);this.meta=e}first(){return this.length?this[0]:void 0}last(){return this.length?this[this.length-1]:void 0}get(e){return this.length&&e>=0?this[e]:void 0}}class ResourceAdapter{constructor(e){_ResourceAdapter_client.set(this,void 0),_ResourceAdapter_config.set(this,{}),__classPrivateFieldSet(this,_ResourceAdapter_client,client_1.default.create(e),"f"),this.localConfig(e)}get interceptors(){return __classPrivateFieldGet(this,_ResourceAdapter_client,"f").interceptors}localConfig(e){}config(e){debug("config %o",e),this.localConfig(e),__classPrivateFieldGet(this,_ResourceAdapter_client,"f").config(e)}async singleton(e,r,t){debug("singleton: %o, %O, %O",e,r||{},t||{});const a=(0,query_1.generateQueryStringParams)(r,e);(t==null?void 0:t.params)&&Object.assign(a,t==null?void 0:t.params);const i=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("get",`${e.type}`,void 0,Object.assign(Object.assign({},t),{params:a}));return(0,jsonapi_1.denormalize)(i)}async retrieve(e,r,t){debug("retrieve: %o, %O, %O",e,r||{},t||{});const a=(0,query_1.generateQueryStringParams)(r,e);(t==null?void 0:t.params)&&Object.assign(a,t==null?void 0:t.params);const i=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("get",`${e.type}/${e.id}`,void 0,Object.assign(Object.assign({},t),{params:a}));return(0,jsonapi_1.denormalize)(i)}async list(e,r,t){var a,i;debug("list: %o, %O, %O",e,r||{},t||{});const n=(0,query_1.generateQueryStringParams)(r,e);(t==null?void 0:t.params)&&Object.assign(n,t==null?void 0:t.params);const o=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("get",`${e.type}`,void 0,Object.assign(Object.assign({},t),{params:n})),u=(0,jsonapi_1.denormalize)(o),c={pageCount:Number((a=o.meta)===null||a===void 0?void 0:a.page_count),recordCount:Number((i=o.meta)===null||i===void 0?void 0:i.record_count),currentPage:(r==null?void 0:r.pageNumber)||config_1.default.default.pageNumber,recordsPerPage:(r==null?void 0:r.pageSize)||config_1.default.default.pageSize};return new ListResponse(c,u)}async create(e,r,t){debug("create: %o, %O, %O",e,r||{},t||{});const a=(0,query_1.generateQueryStringParams)(r,e);(t==null?void 0:t.params)&&Object.assign(a,t==null?void 0:t.params);const i=(0,jsonapi_1.normalize)(e),n=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("post",e.type,i,Object.assign(Object.assign({},t),{params:a}));return(0,jsonapi_1.denormalize)(n)}async update(e,r,t){debug("update: %o, %O, %O",e,r||{},t||{});const a=(0,query_1.generateQueryStringParams)(r,e);(t==null?void 0:t.params)&&Object.assign(a,t==null?void 0:t.params);const i=(0,jsonapi_1.normalize)(e),n=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("patch",`${e.type}/${e.id}`,i,Object.assign(Object.assign({},t),{params:a}));return(0,jsonapi_1.denormalize)(n)}async delete(e,r){debug("delete: %o, %O",e,r||{}),await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("delete",`${e.type}/${e.id}`,void 0,r)}async fetch(e,r,t,a){var i,n;debug("fetch: %o, %O, %O",r,t||{},a||{});const o=(0,query_1.generateQueryStringParams)(t,e);(a==null?void 0:a.params)&&Object.assign(o,a==null?void 0:a.params);const u=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("get",r,void 0,Object.assign(Object.assign({},a),{params:o})),c=(0,jsonapi_1.denormalize)(u);if(Array.isArray(c)){const l=t,d={pageCount:Number((i=u.meta)===null||i===void 0?void 0:i.page_count),recordCount:Number((n=u.meta)===null||n===void 0?void 0:n.record_count),currentPage:(l==null?void 0:l.pageNumber)||config_1.default.default.pageNumber,recordsPerPage:(l==null?void 0:l.pageSize)||config_1.default.default.pageSize};return new ListResponse(d,c)}else return c}}_ResourceAdapter_client=new WeakMap,_ResourceAdapter_config=new WeakMap;class ApiResource{constructor(e){debug("new resource instance: %s",this.type()),this.resources=e}}exports.ApiResource=ApiResource,exports.default=ResourceAdapter;
@@ -79,6 +79,7 @@ declare class Addresses extends ApiResource {
79
79
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
80
80
  update(resource: AddressUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
81
81
  delete(id: string, options?: ResourcesConfig): Promise<void>;
82
+ geocoder(addressId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Geocoder>;
82
83
  isAddress(resource: any): resource is Address;
83
84
  relationship(id: string | ResourceId | null): AddressRel;
84
85
  type(): string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Addresses extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:Addresses.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:Addresses.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:Addresses.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:Addresses.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:Addresses.TYPE,id:e},t)}isAddress(e){return e.type&&e.type===Addresses.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Addresses.TYPE}:{id:e.id,type:Addresses.TYPE}}type(){return Addresses.TYPE}}Addresses.TYPE="addresses",exports.default=Addresses;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Addresses extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:Addresses.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:Addresses.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:Addresses.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:Addresses.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:Addresses.TYPE,id:e},t)}async geocoder(e,t,r){return this.resources.fetch({type:"geocoders"},`addresses/${e}/geocoder`,t,r)}isAddress(e){return e.type&&e.type===Addresses.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Addresses.TYPE}:{id:e.id,type:Addresses.TYPE}}type(){return Addresses.TYPE}}Addresses.TYPE="addresses",exports.default=Addresses;
@@ -37,6 +37,8 @@ declare class AdyenGateways extends ApiResource {
37
37
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<AdyenGateway>;
38
38
  update(resource: AdyenGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<AdyenGateway>;
39
39
  delete(id: string, options?: ResourcesConfig): Promise<void>;
40
+ payment_methods(adyenGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
41
+ adyen_payments(adyenGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<AdyenPayment>>;
40
42
  isAdyenGateway(resource: any): resource is AdyenGateway;
41
43
  relationship(id: string | ResourceId | null): AdyenGatewayRel;
42
44
  type(): string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class AdyenGateways extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:AdyenGateways.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:AdyenGateways.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:AdyenGateways.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:AdyenGateways.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:AdyenGateways.TYPE,id:e},r)}isAdyenGateway(e){return e.type&&e.type===AdyenGateways.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:AdyenGateways.TYPE}:{id:e.id,type:AdyenGateways.TYPE}}type(){return AdyenGateways.TYPE}}AdyenGateways.TYPE="adyen_gateways",exports.default=AdyenGateways;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class AdyenGateways extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:AdyenGateways.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:AdyenGateways.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:AdyenGateways.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:AdyenGateways.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:AdyenGateways.TYPE,id:e},t)}async payment_methods(e,t,s){return this.resources.fetch({type:"payment_methods"},`adyen_gateways/${e}/payment_methods`,t,s)}async adyen_payments(e,t,s){return this.resources.fetch({type:"adyen_payments"},`adyen_gateways/${e}/adyen_payments`,t,s)}isAdyenGateway(e){return e.type&&e.type===AdyenGateways.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:AdyenGateways.TYPE}:{id:e.id,type:AdyenGateways.TYPE}}type(){return AdyenGateways.TYPE}}AdyenGateways.TYPE="adyen_gateways",exports.default=AdyenGateways;
@@ -34,6 +34,8 @@ declare class AdyenPayments extends ApiResource {
34
34
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<AdyenPayment>;
35
35
  update(resource: AdyenPaymentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<AdyenPayment>;
36
36
  delete(id: string, options?: ResourcesConfig): Promise<void>;
37
+ order(adyenPaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
38
+ payment_gateway(adyenPaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
37
39
  isAdyenPayment(resource: any): resource is AdyenPayment;
38
40
  relationship(id: string | ResourceId | null): AdyenPaymentRel;
39
41
  type(): string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class AdyenPayments extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:AdyenPayments.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:AdyenPayments.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:AdyenPayments.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:AdyenPayments.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:AdyenPayments.TYPE,id:e},r)}isAdyenPayment(e){return e.type&&e.type===AdyenPayments.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:AdyenPayments.TYPE}:{id:e.id,type:AdyenPayments.TYPE}}type(){return AdyenPayments.TYPE}}AdyenPayments.TYPE="adyen_payments",exports.default=AdyenPayments;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class AdyenPayments extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:AdyenPayments.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:AdyenPayments.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:AdyenPayments.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:AdyenPayments.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:AdyenPayments.TYPE,id:e},t)}async order(e,t,r){return this.resources.fetch({type:"orders"},`adyen_payments/${e}/order`,t,r)}async payment_gateway(e,t,r){return this.resources.fetch({type:"payment_gateways"},`adyen_payments/${e}/payment_gateway`,t,r)}isAdyenPayment(e){return e.type&&e.type===AdyenPayments.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:AdyenPayments.TYPE}:{id:e.id,type:AdyenPayments.TYPE}}type(){return AdyenPayments.TYPE}}AdyenPayments.TYPE="adyen_payments",exports.default=AdyenPayments;
@@ -46,6 +46,9 @@ declare class Authorizations extends ApiResource {
46
46
  list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Authorization>>;
47
47
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
48
48
  update(resource: AuthorizationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
49
+ order(authorizationId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
50
+ captures(authorizationId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Capture>>;
51
+ voids(authorizationId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Void>>;
49
52
  isAuthorization(resource: any): resource is Authorization;
50
53
  relationship(id: string | ResourceId | null): AuthorizationRel;
51
54
  type(): string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Authorizations extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:Authorizations.TYPE},e,r)}async retrieve(e,r,t){return this.resources.retrieve({type:Authorizations.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:Authorizations.TYPE}),r,t)}isAuthorization(e){return e.type&&e.type===Authorizations.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Authorizations.TYPE}:{id:e.id,type:Authorizations.TYPE}}type(){return Authorizations.TYPE}}Authorizations.TYPE="authorizations",exports.default=Authorizations;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Authorizations extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:Authorizations.TYPE},e,r)}async retrieve(e,r,s){return this.resources.retrieve({type:Authorizations.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:Authorizations.TYPE}),r,s)}async order(e,r,s){return this.resources.fetch({type:"orders"},`authorizations/${e}/order`,r,s)}async captures(e,r,s){return this.resources.fetch({type:"captures"},`authorizations/${e}/captures`,r,s)}async voids(e,r,s){return this.resources.fetch({type:"voids"},`authorizations/${e}/voids`,r,s)}isAuthorization(e){return e.type&&e.type===Authorizations.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Authorizations.TYPE}:{id:e.id,type:Authorizations.TYPE}}type(){return Authorizations.TYPE}}Authorizations.TYPE="authorizations",exports.default=Authorizations;
@@ -41,6 +41,9 @@ declare class AvalaraAccounts extends ApiResource {
41
41
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<AvalaraAccount>;
42
42
  update(resource: AvalaraAccountUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<AvalaraAccount>;
43
43
  delete(id: string, options?: ResourcesConfig): Promise<void>;
44
+ tax_categories(avalaraAccountId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<TaxCategory>>;
45
+ markets(avalaraAccountId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
46
+ attachments(avalaraAccountId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
44
47
  isAvalaraAccount(resource: any): resource is AvalaraAccount;
45
48
  relationship(id: string | ResourceId | null): AvalaraAccountRel;
46
49
  type(): string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class AvalaraAccounts extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:AvalaraAccounts.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:AvalaraAccounts.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:AvalaraAccounts.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:AvalaraAccounts.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:AvalaraAccounts.TYPE,id:e},t)}isAvalaraAccount(e){return e.type&&e.type===AvalaraAccounts.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:AvalaraAccounts.TYPE}:{id:e.id,type:AvalaraAccounts.TYPE}}type(){return AvalaraAccounts.TYPE}}AvalaraAccounts.TYPE="avalara_accounts",exports.default=AvalaraAccounts;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class AvalaraAccounts extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:AvalaraAccounts.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:AvalaraAccounts.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:AvalaraAccounts.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:AvalaraAccounts.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:AvalaraAccounts.TYPE,id:e},t)}async tax_categories(e,t,s){return this.resources.fetch({type:"tax_categories"},`avalara_accounts/${e}/tax_categories`,t,s)}async markets(e,t,s){return this.resources.fetch({type:"markets"},`avalara_accounts/${e}/markets`,t,s)}async attachments(e,t,s){return this.resources.fetch({type:"attachments"},`avalara_accounts/${e}/attachments`,t,s)}isAvalaraAccount(e){return e.type&&e.type===AvalaraAccounts.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:AvalaraAccounts.TYPE}:{id:e.id,type:AvalaraAccounts.TYPE}}type(){return AvalaraAccounts.TYPE}}AvalaraAccounts.TYPE="avalara_accounts",exports.default=AvalaraAccounts;
@@ -23,6 +23,7 @@ declare class BillingInfoValidationRules extends ApiResource {
23
23
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BillingInfoValidationRule>;
24
24
  update(resource: BillingInfoValidationRuleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BillingInfoValidationRule>;
25
25
  delete(id: string, options?: ResourcesConfig): Promise<void>;
26
+ market(billingInfoValidationRuleId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
26
27
  isBillingInfoValidationRule(resource: any): resource is BillingInfoValidationRule;
27
28
  relationship(id: string | ResourceId | null): BillingInfoValidationRuleRel;
28
29
  type(): string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class BillingInfoValidationRules extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:BillingInfoValidationRules.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:BillingInfoValidationRules.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:BillingInfoValidationRules.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:BillingInfoValidationRules.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:BillingInfoValidationRules.TYPE,id:e},r)}isBillingInfoValidationRule(e){return e.type&&e.type===BillingInfoValidationRules.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:BillingInfoValidationRules.TYPE}:{id:e.id,type:BillingInfoValidationRules.TYPE}}type(){return BillingInfoValidationRules.TYPE}}BillingInfoValidationRules.TYPE="billing_info_validation_rules",exports.default=BillingInfoValidationRules;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class BillingInfoValidationRules extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:BillingInfoValidationRules.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:BillingInfoValidationRules.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:BillingInfoValidationRules.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:BillingInfoValidationRules.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:BillingInfoValidationRules.TYPE,id:e},r)}async market(e,r,t){return this.resources.fetch({type:"markets"},`billing_info_validation_rules/${e}/market`,r,t)}isBillingInfoValidationRule(e){return e.type&&e.type===BillingInfoValidationRules.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:BillingInfoValidationRules.TYPE}:{id:e.id,type:BillingInfoValidationRules.TYPE}}type(){return BillingInfoValidationRules.TYPE}}BillingInfoValidationRules.TYPE="billing_info_validation_rules",exports.default=BillingInfoValidationRules;
@@ -25,6 +25,8 @@ declare class BingGeocoders extends ApiResource {
25
25
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BingGeocoder>;
26
26
  update(resource: BingGeocoderUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BingGeocoder>;
27
27
  delete(id: string, options?: ResourcesConfig): Promise<void>;
28
+ addresses(bingGeocoderId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Address>>;
29
+ attachments(bingGeocoderId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
28
30
  isBingGeocoder(resource: any): resource is BingGeocoder;
29
31
  relationship(id: string | ResourceId | null): BingGeocoderRel;
30
32
  type(): string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class BingGeocoders extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:BingGeocoders.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:BingGeocoders.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:BingGeocoders.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:BingGeocoders.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:BingGeocoders.TYPE,id:e},t)}isBingGeocoder(e){return e.type&&e.type===BingGeocoders.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:BingGeocoders.TYPE}:{id:e.id,type:BingGeocoders.TYPE}}type(){return BingGeocoders.TYPE}}BingGeocoders.TYPE="bing_geocoders",exports.default=BingGeocoders;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class BingGeocoders extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:BingGeocoders.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:BingGeocoders.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:BingGeocoders.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:BingGeocoders.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:BingGeocoders.TYPE,id:e},t)}async addresses(e,t,s){return this.resources.fetch({type:"addresses"},`bing_geocoders/${e}/addresses`,t,s)}async attachments(e,t,s){return this.resources.fetch({type:"attachments"},`bing_geocoders/${e}/attachments`,t,s)}isBingGeocoder(e){return e.type&&e.type===BingGeocoders.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:BingGeocoders.TYPE}:{id:e.id,type:BingGeocoders.TYPE}}type(){return BingGeocoders.TYPE}}BingGeocoders.TYPE="bing_geocoders",exports.default=BingGeocoders;
@@ -46,6 +46,8 @@ declare class BraintreeGateways extends ApiResource {
46
46
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BraintreeGateway>;
47
47
  update(resource: BraintreeGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BraintreeGateway>;
48
48
  delete(id: string, options?: ResourcesConfig): Promise<void>;
49
+ payment_methods(braintreeGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
50
+ braintree_payments(braintreeGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<BraintreePayment>>;
49
51
  isBraintreeGateway(resource: any): resource is BraintreeGateway;
50
52
  relationship(id: string | ResourceId | null): BraintreeGatewayRel;
51
53
  type(): string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class BraintreeGateways extends resource_1.ApiResource{async list(e,s){return this.resources.list({type:BraintreeGateways.TYPE},e,s)}async create(e,s,t){return this.resources.create(Object.assign(Object.assign({},e),{type:BraintreeGateways.TYPE}),s,t)}async retrieve(e,s,t){return this.resources.retrieve({type:BraintreeGateways.TYPE,id:e},s,t)}async update(e,s,t){return this.resources.update(Object.assign(Object.assign({},e),{type:BraintreeGateways.TYPE}),s,t)}async delete(e,s){await this.resources.delete({type:BraintreeGateways.TYPE,id:e},s)}isBraintreeGateway(e){return e.type&&e.type===BraintreeGateways.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:BraintreeGateways.TYPE}:{id:e.id,type:BraintreeGateways.TYPE}}type(){return BraintreeGateways.TYPE}}BraintreeGateways.TYPE="braintree_gateways",exports.default=BraintreeGateways;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class BraintreeGateways extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:BraintreeGateways.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:BraintreeGateways.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:BraintreeGateways.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:BraintreeGateways.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:BraintreeGateways.TYPE,id:e},t)}async payment_methods(e,t,s){return this.resources.fetch({type:"payment_methods"},`braintree_gateways/${e}/payment_methods`,t,s)}async braintree_payments(e,t,s){return this.resources.fetch({type:"braintree_payments"},`braintree_gateways/${e}/braintree_payments`,t,s)}isBraintreeGateway(e){return e.type&&e.type===BraintreeGateways.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:BraintreeGateways.TYPE}:{id:e.id,type:BraintreeGateways.TYPE}}type(){return BraintreeGateways.TYPE}}BraintreeGateways.TYPE="braintree_gateways",exports.default=BraintreeGateways;
@@ -37,6 +37,8 @@ declare class BraintreePayments extends ApiResource {
37
37
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BraintreePayment>;
38
38
  update(resource: BraintreePaymentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BraintreePayment>;
39
39
  delete(id: string, options?: ResourcesConfig): Promise<void>;
40
+ order(braintreePaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
41
+ payment_gateway(braintreePaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
40
42
  isBraintreePayment(resource: any): resource is BraintreePayment;
41
43
  relationship(id: string | ResourceId | null): BraintreePaymentRel;
42
44
  type(): string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class BraintreePayments extends resource_1.ApiResource{async list(e,s){return this.resources.list({type:BraintreePayments.TYPE},e,s)}async create(e,s,t){return this.resources.create(Object.assign(Object.assign({},e),{type:BraintreePayments.TYPE}),s,t)}async retrieve(e,s,t){return this.resources.retrieve({type:BraintreePayments.TYPE,id:e},s,t)}async update(e,s,t){return this.resources.update(Object.assign(Object.assign({},e),{type:BraintreePayments.TYPE}),s,t)}async delete(e,s){await this.resources.delete({type:BraintreePayments.TYPE,id:e},s)}isBraintreePayment(e){return e.type&&e.type===BraintreePayments.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:BraintreePayments.TYPE}:{id:e.id,type:BraintreePayments.TYPE}}type(){return BraintreePayments.TYPE}}BraintreePayments.TYPE="braintree_payments",exports.default=BraintreePayments;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class BraintreePayments extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:BraintreePayments.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:BraintreePayments.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:BraintreePayments.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:BraintreePayments.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:BraintreePayments.TYPE,id:e},t)}async order(e,t,r){return this.resources.fetch({type:"orders"},`braintree_payments/${e}/order`,t,r)}async payment_gateway(e,t,r){return this.resources.fetch({type:"payment_gateways"},`braintree_payments/${e}/payment_gateway`,t,r)}isBraintreePayment(e){return e.type&&e.type===BraintreePayments.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:BraintreePayments.TYPE}:{id:e.id,type:BraintreePayments.TYPE}}type(){return BraintreePayments.TYPE}}BraintreePayments.TYPE="braintree_payments",exports.default=BraintreePayments;
@@ -62,6 +62,10 @@ declare class Bundles extends ApiResource {
62
62
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Bundle>;
63
63
  update(resource: BundleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Bundle>;
64
64
  delete(id: string, options?: ResourcesConfig): Promise<void>;
65
+ market(bundleId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
66
+ sku_list(bundleId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
67
+ skus(bundleId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
68
+ attachments(bundleId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
65
69
  isBundle(resource: any): resource is Bundle;
66
70
  relationship(id: string | ResourceId | null): BundleRel;
67
71
  type(): string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Bundles extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:Bundles.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:Bundles.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:Bundles.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:Bundles.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:Bundles.TYPE,id:e},t)}isBundle(e){return e.type&&e.type===Bundles.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Bundles.TYPE}:{id:e.id,type:Bundles.TYPE}}type(){return Bundles.TYPE}}Bundles.TYPE="bundles",exports.default=Bundles;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Bundles extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:Bundles.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:Bundles.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:Bundles.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:Bundles.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:Bundles.TYPE,id:e},t)}async market(e,t,s){return this.resources.fetch({type:"markets"},`bundles/${e}/market`,t,s)}async sku_list(e,t,s){return this.resources.fetch({type:"sku_lists"},`bundles/${e}/sku_list`,t,s)}async skus(e,t,s){return this.resources.fetch({type:"skus"},`bundles/${e}/skus`,t,s)}async attachments(e,t,s){return this.resources.fetch({type:"attachments"},`bundles/${e}/attachments`,t,s)}isBundle(e){return e.type&&e.type===Bundles.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Bundles.TYPE}:{id:e.id,type:Bundles.TYPE}}type(){return Bundles.TYPE}}Bundles.TYPE="bundles",exports.default=Bundles;
@@ -37,6 +37,9 @@ declare class Captures extends ApiResource {
37
37
  list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Capture>>;
38
38
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
39
39
  update(resource: CaptureUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
40
+ order(captureId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
41
+ reference_authorization(captureId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
42
+ refunds(captureId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Refund>>;
40
43
  isCapture(resource: any): resource is Capture;
41
44
  relationship(id: string | ResourceId | null): CaptureRel;
42
45
  type(): string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Captures extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:Captures.TYPE},e,t)}async retrieve(e,t,r){return this.resources.retrieve({type:Captures.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:Captures.TYPE}),t,r)}isCapture(e){return e.type&&e.type===Captures.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Captures.TYPE}:{id:e.id,type:Captures.TYPE}}type(){return Captures.TYPE}}Captures.TYPE="captures",exports.default=Captures;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Captures extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:Captures.TYPE},e,r)}async retrieve(e,r,t){return this.resources.retrieve({type:Captures.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:Captures.TYPE}),r,t)}async order(e,r,t){return this.resources.fetch({type:"orders"},`captures/${e}/order`,r,t)}async reference_authorization(e,r,t){return this.resources.fetch({type:"authorizations"},`captures/${e}/reference_authorization`,r,t)}async refunds(e,r,t){return this.resources.fetch({type:"refunds"},`captures/${e}/refunds`,r,t)}isCapture(e){return e.type&&e.type===Captures.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Captures.TYPE}:{id:e.id,type:Captures.TYPE}}type(){return Captures.TYPE}}Captures.TYPE="captures",exports.default=Captures;
@@ -16,6 +16,8 @@ declare class CarrierAccounts extends ApiResource {
16
16
  static readonly TYPE: 'carrier_accounts';
17
17
  list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CarrierAccount>>;
18
18
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CarrierAccount>;
19
+ market(carrierAccountId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
20
+ attachments(carrierAccountId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
19
21
  isCarrierAccount(resource: any): resource is CarrierAccount;
20
22
  relationship(id: string | ResourceId | null): CarrierAccountRel;
21
23
  type(): string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class CarrierAccounts extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:CarrierAccounts.TYPE},e,t)}async retrieve(e,t,r){return this.resources.retrieve({type:CarrierAccounts.TYPE,id:e},t,r)}isCarrierAccount(e){return e.type&&e.type===CarrierAccounts.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:CarrierAccounts.TYPE}:{id:e.id,type:CarrierAccounts.TYPE}}type(){return CarrierAccounts.TYPE}}CarrierAccounts.TYPE="carrier_accounts",exports.default=CarrierAccounts;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class CarrierAccounts extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:CarrierAccounts.TYPE},e,t)}async retrieve(e,t,r){return this.resources.retrieve({type:CarrierAccounts.TYPE,id:e},t,r)}async market(e,t,r){return this.resources.fetch({type:"markets"},`carrier_accounts/${e}/market`,t,r)}async attachments(e,t,r){return this.resources.fetch({type:"attachments"},`carrier_accounts/${e}/attachments`,t,r)}isCarrierAccount(e){return e.type&&e.type===CarrierAccounts.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:CarrierAccounts.TYPE}:{id:e.id,type:CarrierAccounts.TYPE}}type(){return CarrierAccounts.TYPE}}CarrierAccounts.TYPE="carrier_accounts",exports.default=CarrierAccounts;
@@ -35,6 +35,8 @@ declare class CheckoutComGateways extends ApiResource {
35
35
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CheckoutComGateway>;
36
36
  update(resource: CheckoutComGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CheckoutComGateway>;
37
37
  delete(id: string, options?: ResourcesConfig): Promise<void>;
38
+ payment_methods(checkoutComGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
39
+ checkout_com_payments(checkoutComGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CheckoutComPayment>>;
38
40
  isCheckoutComGateway(resource: any): resource is CheckoutComGateway;
39
41
  relationship(id: string | ResourceId | null): CheckoutComGatewayRel;
40
42
  type(): string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class CheckoutComGateways extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:CheckoutComGateways.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:CheckoutComGateways.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:CheckoutComGateways.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:CheckoutComGateways.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:CheckoutComGateways.TYPE,id:e},r)}isCheckoutComGateway(e){return e.type&&e.type===CheckoutComGateways.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:CheckoutComGateways.TYPE}:{id:e.id,type:CheckoutComGateways.TYPE}}type(){return CheckoutComGateways.TYPE}}CheckoutComGateways.TYPE="checkout_com_gateways",exports.default=CheckoutComGateways;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class CheckoutComGateways extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:CheckoutComGateways.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:CheckoutComGateways.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:CheckoutComGateways.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:CheckoutComGateways.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:CheckoutComGateways.TYPE,id:e},t)}async payment_methods(e,t,s){return this.resources.fetch({type:"payment_methods"},`checkout_com_gateways/${e}/payment_methods`,t,s)}async checkout_com_payments(e,t,s){return this.resources.fetch({type:"checkout_com_payments"},`checkout_com_gateways/${e}/checkout_com_payments`,t,s)}isCheckoutComGateway(e){return e.type&&e.type===CheckoutComGateways.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:CheckoutComGateways.TYPE}:{id:e.id,type:CheckoutComGateways.TYPE}}type(){return CheckoutComGateways.TYPE}}CheckoutComGateways.TYPE="checkout_com_gateways",exports.default=CheckoutComGateways;
@@ -40,6 +40,8 @@ declare class CheckoutComPayments extends ApiResource {
40
40
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CheckoutComPayment>;
41
41
  update(resource: CheckoutComPaymentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CheckoutComPayment>;
42
42
  delete(id: string, options?: ResourcesConfig): Promise<void>;
43
+ order(checkoutComPaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
44
+ payment_gateway(checkoutComPaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
43
45
  isCheckoutComPayment(resource: any): resource is CheckoutComPayment;
44
46
  relationship(id: string | ResourceId | null): CheckoutComPaymentRel;
45
47
  type(): string;