@commercelayer/sdk 4.3.0 → 5.0.0-alpha.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 (551) hide show
  1. package/README.md +12 -10
  2. package/lib/{cjs/api.d.ts → api.d.ts} +0 -0
  3. package/lib/{esm/api.js → api.js} +0 -0
  4. package/lib/{cjs/client.d.ts → client.d.ts} +0 -0
  5. package/lib/client.js +1 -0
  6. package/lib/{cjs/commercelayer.d.ts → commercelayer.d.ts} +2 -2
  7. package/lib/{esm/commercelayer.js → commercelayer.js} +1 -1
  8. package/lib/{cjs/common.d.ts → common.d.ts} +0 -0
  9. package/lib/common.js +1 -0
  10. package/lib/{cjs/config.d.ts → config.d.ts} +0 -0
  11. package/lib/{esm/config.js → config.js} +0 -0
  12. package/lib/{cjs/debug.d.ts → debug.d.ts} +0 -0
  13. package/lib/{esm/debug.js → debug.js} +0 -0
  14. package/lib/{cjs/error.d.ts → error.d.ts} +0 -0
  15. package/lib/error.js +1 -0
  16. package/lib/{cjs/index.d.ts → index.d.ts} +0 -0
  17. package/lib/{esm/index.js → index.js} +0 -0
  18. package/lib/{cjs/interceptor.d.ts → interceptor.d.ts} +0 -0
  19. package/lib/{esm/interceptor.js → interceptor.js} +0 -0
  20. package/lib/{cjs/jsonapi.d.ts → jsonapi.d.ts} +0 -0
  21. package/lib/jsonapi.js +1 -0
  22. package/lib/{cjs/model.d.ts → model.d.ts} +0 -0
  23. package/lib/{esm/model.js → model.js} +0 -0
  24. package/lib/{cjs/query.d.ts → query.d.ts} +0 -0
  25. package/lib/{esm/query.js → query.js} +0 -0
  26. package/lib/{esm/resource.d.ts → resource.d.ts} +2 -0
  27. package/lib/resource.js +1 -0
  28. package/lib/{esm/resources → resources}/addresses.d.ts +1 -0
  29. package/lib/resources/addresses.js +1 -0
  30. package/lib/{cjs/resources → resources}/adjustments.d.ts +0 -0
  31. package/lib/resources/adjustments.js +1 -0
  32. package/lib/{esm/resources → resources}/adyen_gateways.d.ts +2 -0
  33. package/lib/resources/adyen_gateways.js +1 -0
  34. package/lib/{cjs/resources → resources}/adyen_payments.d.ts +2 -0
  35. package/lib/resources/adyen_payments.js +1 -0
  36. package/lib/{cjs/resources → resources}/application.d.ts +0 -0
  37. package/lib/{esm/resources → resources}/application.js +0 -0
  38. package/lib/{cjs/resources → resources}/attachments.d.ts +0 -0
  39. package/lib/resources/attachments.js +1 -0
  40. package/lib/{cjs/resources → resources}/authorizations.d.ts +3 -0
  41. package/lib/resources/authorizations.js +1 -0
  42. package/lib/{esm/resources → resources}/avalara_accounts.d.ts +3 -0
  43. package/lib/resources/avalara_accounts.js +1 -0
  44. package/lib/{cjs/resources → resources}/billing_info_validation_rules.d.ts +1 -0
  45. package/lib/resources/billing_info_validation_rules.js +1 -0
  46. package/lib/{esm/resources → resources}/bing_geocoders.d.ts +2 -0
  47. package/lib/resources/bing_geocoders.js +1 -0
  48. package/lib/{cjs/resources → resources}/braintree_gateways.d.ts +2 -0
  49. package/lib/resources/braintree_gateways.js +1 -0
  50. package/lib/{esm/resources → resources}/braintree_payments.d.ts +2 -0
  51. package/lib/resources/braintree_payments.js +1 -0
  52. package/lib/{esm/resources → resources}/bundles.d.ts +4 -0
  53. package/lib/resources/bundles.js +1 -0
  54. package/lib/{esm/resources → resources}/captures.d.ts +3 -0
  55. package/lib/resources/captures.js +1 -0
  56. package/lib/{esm/resources → resources}/carrier_accounts.d.ts +2 -0
  57. package/lib/resources/carrier_accounts.js +1 -0
  58. package/lib/{esm/resources → resources}/checkout_com_gateways.d.ts +2 -0
  59. package/lib/resources/checkout_com_gateways.js +1 -0
  60. package/lib/{esm/resources → resources}/checkout_com_payments.d.ts +2 -0
  61. package/lib/resources/checkout_com_payments.js +1 -0
  62. package/lib/{esm/resources → resources}/coupon_codes_promotion_rules.d.ts +1 -0
  63. package/lib/resources/coupon_codes_promotion_rules.js +1 -0
  64. package/lib/{cjs/resources → resources}/coupon_recipients.d.ts +2 -0
  65. package/lib/resources/coupon_recipients.js +1 -0
  66. package/lib/{cjs/resources → resources}/coupons.d.ts +1 -0
  67. package/lib/resources/coupons.js +1 -0
  68. package/lib/{esm/resources → resources}/customer_addresses.d.ts +2 -0
  69. package/lib/resources/customer_addresses.js +1 -0
  70. package/lib/{esm/resources → resources}/customer_groups.d.ts +3 -0
  71. package/lib/resources/customer_groups.js +1 -0
  72. package/lib/{esm/resources → resources}/customer_password_resets.d.ts +1 -0
  73. package/lib/resources/customer_password_resets.js +1 -0
  74. package/lib/{cjs/resources → resources}/customer_payment_sources.d.ts +1 -0
  75. package/lib/resources/customer_payment_sources.js +1 -0
  76. package/lib/{cjs/resources → resources}/customer_subscriptions.d.ts +1 -0
  77. package/lib/resources/customer_subscriptions.js +1 -0
  78. package/lib/{esm/resources → resources}/customers.d.ts +8 -0
  79. package/lib/resources/customers.js +1 -0
  80. package/lib/{esm/resources → resources}/delivery_lead_times.d.ts +3 -0
  81. package/lib/resources/delivery_lead_times.js +1 -0
  82. package/lib/{cjs/resources → resources}/event_callbacks.d.ts +1 -0
  83. package/lib/resources/event_callbacks.js +1 -0
  84. package/lib/{esm/resources → resources}/external_gateways.d.ts +2 -0
  85. package/lib/resources/external_gateways.js +1 -0
  86. package/lib/{esm/resources → resources}/external_payments.d.ts +3 -0
  87. package/lib/resources/external_payments.js +1 -0
  88. package/lib/{esm/resources → resources}/external_promotions.d.ts +5 -0
  89. package/lib/resources/external_promotions.js +1 -0
  90. package/lib/{cjs/resources → resources}/external_tax_calculators.d.ts +3 -0
  91. package/lib/resources/external_tax_calculators.js +1 -0
  92. package/lib/{esm/resources → resources}/fixed_amount_promotions.d.ts +5 -0
  93. package/lib/resources/fixed_amount_promotions.js +1 -0
  94. package/lib/{cjs/resources → resources}/fixed_price_promotions.d.ts +7 -0
  95. package/lib/resources/fixed_price_promotions.js +1 -0
  96. package/lib/{esm/resources → resources}/free_gift_promotions.d.ts +7 -0
  97. package/lib/resources/free_gift_promotions.js +1 -0
  98. package/lib/{cjs/resources → resources}/free_shipping_promotions.d.ts +5 -0
  99. package/lib/resources/free_shipping_promotions.js +1 -0
  100. package/lib/{esm/resources → resources}/geocoders.d.ts +2 -0
  101. package/lib/resources/geocoders.js +1 -0
  102. package/lib/{cjs/resources → resources}/gift_card_recipients.d.ts +2 -0
  103. package/lib/resources/gift_card_recipients.js +1 -0
  104. package/lib/{esm/resources → resources}/gift_cards.d.ts +3 -0
  105. package/lib/resources/gift_cards.js +1 -0
  106. package/lib/{cjs/resources → resources}/google_geocoders.d.ts +2 -0
  107. package/lib/resources/google_geocoders.js +1 -0
  108. package/lib/{cjs/resources → resources}/imports.d.ts +0 -0
  109. package/lib/resources/imports.js +1 -0
  110. package/lib/{esm/resources → resources}/in_stock_subscriptions.d.ts +3 -0
  111. package/lib/resources/in_stock_subscriptions.js +1 -0
  112. package/lib/{esm/resources → resources}/inventory_models.d.ts +3 -0
  113. package/lib/resources/inventory_models.js +1 -0
  114. package/lib/{esm/resources → resources}/inventory_return_locations.d.ts +2 -0
  115. package/lib/resources/inventory_return_locations.js +1 -0
  116. package/lib/{cjs/resources → resources}/inventory_stock_locations.d.ts +2 -0
  117. package/lib/resources/inventory_stock_locations.js +1 -0
  118. package/lib/{cjs/resources → resources}/klarna_gateways.d.ts +2 -0
  119. package/lib/resources/klarna_gateways.js +1 -0
  120. package/lib/{cjs/resources → resources}/klarna_payments.d.ts +2 -0
  121. package/lib/resources/klarna_payments.js +1 -0
  122. package/lib/{esm/resources → resources}/line_item_options.d.ts +2 -0
  123. package/lib/resources/line_item_options.js +1 -0
  124. package/lib/{esm/resources → resources}/line_items.d.ts +4 -0
  125. package/lib/resources/line_items.js +1 -0
  126. package/lib/{cjs/resources → resources}/manual_gateways.d.ts +1 -0
  127. package/lib/resources/manual_gateways.js +1 -0
  128. package/lib/{esm/resources → resources}/manual_tax_calculators.d.ts +4 -0
  129. package/lib/resources/manual_tax_calculators.js +1 -0
  130. package/lib/{esm/resources → resources}/markets.d.ts +6 -0
  131. package/lib/resources/markets.js +1 -0
  132. package/lib/{cjs/resources → resources}/merchants.d.ts +2 -0
  133. package/lib/resources/merchants.js +1 -0
  134. package/lib/{cjs/resources → resources}/order_amount_promotion_rules.d.ts +0 -0
  135. package/lib/resources/order_amount_promotion_rules.js +1 -0
  136. package/lib/{cjs/resources → resources}/order_copies.d.ts +3 -0
  137. package/lib/resources/order_copies.js +1 -0
  138. package/lib/{esm/resources → resources}/order_subscriptions.d.ts +5 -0
  139. package/lib/resources/order_subscriptions.js +1 -0
  140. package/lib/{esm/resources → resources}/order_validation_rules.d.ts +1 -0
  141. package/lib/resources/order_validation_rules.js +1 -0
  142. package/lib/{esm/resources → resources}/orders.d.ts +16 -0
  143. package/lib/resources/orders.js +1 -0
  144. package/lib/{cjs/resources → resources}/organization.d.ts +0 -0
  145. package/lib/{esm/resources → resources}/organization.js +0 -0
  146. package/lib/{esm/resources → resources}/packages.d.ts +3 -0
  147. package/lib/resources/packages.js +1 -0
  148. package/lib/{cjs/resources → resources}/parcel_line_items.d.ts +2 -0
  149. package/lib/resources/parcel_line_items.js +1 -0
  150. package/lib/{cjs/resources → resources}/parcels.d.ts +4 -0
  151. package/lib/resources/parcels.js +1 -0
  152. package/lib/{cjs/resources → resources}/payment_gateways.d.ts +1 -0
  153. package/lib/resources/payment_gateways.js +1 -0
  154. package/lib/{esm/resources → resources}/payment_methods.d.ts +3 -0
  155. package/lib/resources/payment_methods.js +1 -0
  156. package/lib/{esm/resources → resources}/paypal_gateways.d.ts +2 -0
  157. package/lib/resources/paypal_gateways.js +1 -0
  158. package/lib/{esm/resources → resources}/paypal_payments.d.ts +2 -0
  159. package/lib/resources/paypal_payments.js +1 -0
  160. package/lib/{esm/resources → resources}/percentage_discount_promotions.d.ts +7 -0
  161. package/lib/resources/percentage_discount_promotions.js +1 -0
  162. package/lib/{cjs/resources → resources}/price_lists.d.ts +2 -0
  163. package/lib/resources/price_lists.js +1 -0
  164. package/lib/{esm/resources → resources}/prices.d.ts +3 -0
  165. package/lib/resources/prices.js +1 -0
  166. package/lib/{cjs/resources → resources}/promotion_rules.d.ts +0 -0
  167. package/lib/{esm/resources → resources}/promotion_rules.js +0 -0
  168. package/lib/{esm/resources → resources}/promotions.d.ts +5 -0
  169. package/lib/resources/promotions.js +1 -0
  170. package/lib/{cjs/resources → resources}/refunds.d.ts +2 -0
  171. package/lib/resources/refunds.js +1 -0
  172. package/lib/{cjs/resources → resources}/return_line_items.d.ts +2 -0
  173. package/lib/resources/return_line_items.js +1 -0
  174. package/lib/{esm/resources → resources}/returns.d.ts +7 -0
  175. package/lib/resources/returns.js +1 -0
  176. package/lib/{cjs/resources → resources}/shipments.d.ts +13 -0
  177. package/lib/resources/shipments.js +1 -0
  178. package/lib/{cjs/resources → resources}/shipping_categories.d.ts +2 -0
  179. package/lib/resources/shipping_categories.js +1 -0
  180. package/lib/{cjs/resources → resources}/shipping_methods.d.ts +5 -0
  181. package/lib/resources/shipping_methods.js +1 -0
  182. package/lib/{esm/resources → resources}/shipping_zones.d.ts +1 -0
  183. package/lib/resources/shipping_zones.js +1 -0
  184. package/lib/{cjs/resources → resources}/sku_list_items.d.ts +2 -0
  185. package/lib/resources/sku_list_items.js +1 -0
  186. package/lib/{esm/resources → resources}/sku_list_promotion_rules.d.ts +2 -0
  187. package/lib/resources/sku_list_promotion_rules.js +1 -0
  188. package/lib/{esm/resources → resources}/sku_lists.d.ts +3 -0
  189. package/lib/resources/sku_lists.js +1 -0
  190. package/lib/{cjs/resources → resources}/sku_options.d.ts +2 -0
  191. package/lib/resources/sku_options.js +1 -0
  192. package/lib/{cjs/resources → resources}/skus.d.ts +6 -0
  193. package/lib/resources/skus.js +1 -0
  194. package/lib/{esm/resources → resources}/stock_items.d.ts +3 -0
  195. package/lib/resources/stock_items.js +1 -0
  196. package/lib/{esm/resources → resources}/stock_line_items.d.ts +3 -0
  197. package/lib/resources/stock_line_items.js +1 -0
  198. package/lib/{esm/resources → resources}/stock_locations.d.ts +6 -0
  199. package/lib/resources/stock_locations.js +1 -0
  200. package/lib/{cjs/resources → resources}/stock_transfers.d.ts +5 -0
  201. package/lib/resources/stock_transfers.js +1 -0
  202. package/lib/{cjs/resources → resources}/stripe_gateways.d.ts +2 -0
  203. package/lib/resources/stripe_gateways.js +1 -0
  204. package/lib/{cjs/resources → resources}/stripe_payments.d.ts +2 -0
  205. package/lib/resources/stripe_payments.js +1 -0
  206. package/lib/{esm/resources → resources}/tax_calculators.d.ts +3 -0
  207. package/lib/resources/tax_calculators.js +1 -0
  208. package/lib/{esm/resources → resources}/tax_categories.d.ts +2 -0
  209. package/lib/resources/tax_categories.js +1 -0
  210. package/lib/{esm/resources → resources}/tax_rules.d.ts +1 -0
  211. package/lib/resources/tax_rules.js +1 -0
  212. package/lib/{esm/resources → resources}/taxjar_accounts.d.ts +3 -0
  213. package/lib/resources/taxjar_accounts.js +1 -0
  214. package/lib/{esm/resources → resources}/transactions.d.ts +1 -0
  215. package/lib/resources/transactions.js +1 -0
  216. package/lib/{esm/resources → resources}/voids.d.ts +2 -0
  217. package/lib/resources/voids.js +1 -0
  218. package/lib/{cjs/resources → resources}/webhooks.d.ts +1 -0
  219. package/lib/resources/webhooks.js +1 -0
  220. package/lib/{cjs/resources → resources}/wire_transfers.d.ts +1 -0
  221. package/lib/resources/wire_transfers.js +1 -0
  222. package/lib/{cjs/static.d.ts → static.d.ts} +0 -0
  223. package/lib/{esm/static.js → static.js} +0 -0
  224. package/lib/{cjs/util.d.ts → util.d.ts} +0 -0
  225. package/lib/{esm/util.js → util.js} +0 -0
  226. package/package.json +11 -12
  227. package/lib/cjs/api.js +0 -1
  228. package/lib/cjs/client.js +0 -1
  229. package/lib/cjs/commercelayer.js +0 -1
  230. package/lib/cjs/common.js +0 -1
  231. package/lib/cjs/config.js +0 -1
  232. package/lib/cjs/debug.js +0 -1
  233. package/lib/cjs/error.js +0 -1
  234. package/lib/cjs/index.js +0 -1
  235. package/lib/cjs/interceptor.js +0 -1
  236. package/lib/cjs/jsonapi.js +0 -1
  237. package/lib/cjs/model.js +0 -1
  238. package/lib/cjs/query.js +0 -1
  239. package/lib/cjs/resource.d.ts +0 -74
  240. package/lib/cjs/resource.js +0 -1
  241. package/lib/cjs/resources/addresses.d.ts +0 -87
  242. package/lib/cjs/resources/addresses.js +0 -1
  243. package/lib/cjs/resources/adjustments.js +0 -1
  244. package/lib/cjs/resources/adyen_gateways.d.ts +0 -45
  245. package/lib/cjs/resources/adyen_gateways.js +0 -1
  246. package/lib/cjs/resources/adyen_payments.js +0 -1
  247. package/lib/cjs/resources/application.js +0 -1
  248. package/lib/cjs/resources/attachments.js +0 -1
  249. package/lib/cjs/resources/authorizations.js +0 -1
  250. package/lib/cjs/resources/avalara_accounts.d.ts +0 -49
  251. package/lib/cjs/resources/avalara_accounts.js +0 -1
  252. package/lib/cjs/resources/billing_info_validation_rules.js +0 -1
  253. package/lib/cjs/resources/bing_geocoders.d.ts +0 -33
  254. package/lib/cjs/resources/bing_geocoders.js +0 -1
  255. package/lib/cjs/resources/braintree_gateways.js +0 -1
  256. package/lib/cjs/resources/braintree_payments.d.ts +0 -45
  257. package/lib/cjs/resources/braintree_payments.js +0 -1
  258. package/lib/cjs/resources/bundles.d.ts +0 -70
  259. package/lib/cjs/resources/bundles.js +0 -1
  260. package/lib/cjs/resources/captures.d.ts +0 -45
  261. package/lib/cjs/resources/captures.js +0 -1
  262. package/lib/cjs/resources/carrier_accounts.d.ts +0 -24
  263. package/lib/cjs/resources/carrier_accounts.js +0 -1
  264. package/lib/cjs/resources/checkout_com_gateways.d.ts +0 -43
  265. package/lib/cjs/resources/checkout_com_gateways.js +0 -1
  266. package/lib/cjs/resources/checkout_com_payments.d.ts +0 -48
  267. package/lib/cjs/resources/checkout_com_payments.js +0 -1
  268. package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +0 -58
  269. package/lib/cjs/resources/coupon_codes_promotion_rules.js +0 -1
  270. package/lib/cjs/resources/coupon_recipients.js +0 -1
  271. package/lib/cjs/resources/coupons.js +0 -1
  272. package/lib/cjs/resources/customer_addresses.d.ts +0 -39
  273. package/lib/cjs/resources/customer_addresses.js +0 -1
  274. package/lib/cjs/resources/customer_groups.d.ts +0 -33
  275. package/lib/cjs/resources/customer_groups.js +0 -1
  276. package/lib/cjs/resources/customer_password_resets.d.ts +0 -32
  277. package/lib/cjs/resources/customer_password_resets.js +0 -1
  278. package/lib/cjs/resources/customer_payment_sources.js +0 -1
  279. package/lib/cjs/resources/customer_subscriptions.js +0 -1
  280. package/lib/cjs/resources/customers.d.ts +0 -52
  281. package/lib/cjs/resources/customers.js +0 -1
  282. package/lib/cjs/resources/delivery_lead_times.d.ts +0 -48
  283. package/lib/cjs/resources/delivery_lead_times.js +0 -1
  284. package/lib/cjs/resources/event_callbacks.js +0 -1
  285. package/lib/cjs/resources/external_gateways.d.ts +0 -47
  286. package/lib/cjs/resources/external_gateways.js +0 -1
  287. package/lib/cjs/resources/external_payments.d.ts +0 -40
  288. package/lib/cjs/resources/external_payments.js +0 -1
  289. package/lib/cjs/resources/external_promotions.d.ts +0 -81
  290. package/lib/cjs/resources/external_promotions.js +0 -1
  291. package/lib/cjs/resources/external_tax_calculators.js +0 -1
  292. package/lib/cjs/resources/fixed_amount_promotions.d.ts +0 -83
  293. package/lib/cjs/resources/fixed_amount_promotions.js +0 -1
  294. package/lib/cjs/resources/fixed_price_promotions.js +0 -1
  295. package/lib/cjs/resources/free_gift_promotions.d.ts +0 -90
  296. package/lib/cjs/resources/free_gift_promotions.js +0 -1
  297. package/lib/cjs/resources/free_shipping_promotions.js +0 -1
  298. package/lib/cjs/resources/geocoders.d.ts +0 -22
  299. package/lib/cjs/resources/geocoders.js +0 -1
  300. package/lib/cjs/resources/gift_card_recipients.js +0 -1
  301. package/lib/cjs/resources/gift_cards.d.ts +0 -79
  302. package/lib/cjs/resources/gift_cards.js +0 -1
  303. package/lib/cjs/resources/google_geocoders.js +0 -1
  304. package/lib/cjs/resources/imports.js +0 -1
  305. package/lib/cjs/resources/in_stock_subscriptions.d.ts +0 -56
  306. package/lib/cjs/resources/in_stock_subscriptions.js +0 -1
  307. package/lib/cjs/resources/inventory_models.d.ts +0 -39
  308. package/lib/cjs/resources/inventory_models.js +0 -1
  309. package/lib/cjs/resources/inventory_return_locations.d.ts +0 -41
  310. package/lib/cjs/resources/inventory_return_locations.js +0 -1
  311. package/lib/cjs/resources/inventory_stock_locations.js +0 -1
  312. package/lib/cjs/resources/klarna_gateways.js +0 -1
  313. package/lib/cjs/resources/klarna_payments.js +0 -1
  314. package/lib/cjs/resources/line_item_options.d.ts +0 -55
  315. package/lib/cjs/resources/line_item_options.js +0 -1
  316. package/lib/cjs/resources/line_items.d.ts +0 -121
  317. package/lib/cjs/resources/line_items.js +0 -1
  318. package/lib/cjs/resources/manual_gateways.js +0 -1
  319. package/lib/cjs/resources/manual_tax_calculators.d.ts +0 -45
  320. package/lib/cjs/resources/manual_tax_calculators.js +0 -1
  321. package/lib/cjs/resources/markets.d.ts +0 -75
  322. package/lib/cjs/resources/markets.js +0 -1
  323. package/lib/cjs/resources/merchants.js +0 -1
  324. package/lib/cjs/resources/order_amount_promotion_rules.js +0 -1
  325. package/lib/cjs/resources/order_copies.js +0 -1
  326. package/lib/cjs/resources/order_subscriptions.d.ts +0 -62
  327. package/lib/cjs/resources/order_subscriptions.js +0 -1
  328. package/lib/cjs/resources/order_validation_rules.d.ts +0 -19
  329. package/lib/cjs/resources/order_validation_rules.js +0 -1
  330. package/lib/cjs/resources/orders.d.ts +0 -255
  331. package/lib/cjs/resources/orders.js +0 -1
  332. package/lib/cjs/resources/organization.js +0 -1
  333. package/lib/cjs/resources/packages.d.ts +0 -53
  334. package/lib/cjs/resources/packages.js +0 -1
  335. package/lib/cjs/resources/parcel_line_items.js +0 -1
  336. package/lib/cjs/resources/parcels.js +0 -1
  337. package/lib/cjs/resources/payment_gateways.js +0 -1
  338. package/lib/cjs/resources/payment_methods.d.ts +0 -56
  339. package/lib/cjs/resources/payment_methods.js +0 -1
  340. package/lib/cjs/resources/paypal_gateways.d.ts +0 -37
  341. package/lib/cjs/resources/paypal_gateways.js +0 -1
  342. package/lib/cjs/resources/paypal_payments.d.ts +0 -45
  343. package/lib/cjs/resources/paypal_payments.js +0 -1
  344. package/lib/cjs/resources/percentage_discount_promotions.d.ts +0 -90
  345. package/lib/cjs/resources/percentage_discount_promotions.js +0 -1
  346. package/lib/cjs/resources/price_lists.js +0 -1
  347. package/lib/cjs/resources/prices.d.ts +0 -54
  348. package/lib/cjs/resources/prices.js +0 -1
  349. package/lib/cjs/resources/promotion_rules.js +0 -1
  350. package/lib/cjs/resources/promotions.d.ts +0 -36
  351. package/lib/cjs/resources/promotions.js +0 -1
  352. package/lib/cjs/resources/refunds.js +0 -1
  353. package/lib/cjs/resources/return_line_items.js +0 -1
  354. package/lib/cjs/resources/returns.d.ts +0 -65
  355. package/lib/cjs/resources/returns.js +0 -1
  356. package/lib/cjs/resources/shipments.js +0 -1
  357. package/lib/cjs/resources/shipping_categories.js +0 -1
  358. package/lib/cjs/resources/shipping_methods.js +0 -1
  359. package/lib/cjs/resources/shipping_zones.d.ts +0 -47
  360. package/lib/cjs/resources/shipping_zones.js +0 -1
  361. package/lib/cjs/resources/sku_list_items.js +0 -1
  362. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +0 -66
  363. package/lib/cjs/resources/sku_list_promotion_rules.js +0 -1
  364. package/lib/cjs/resources/sku_lists.d.ts +0 -46
  365. package/lib/cjs/resources/sku_lists.js +0 -1
  366. package/lib/cjs/resources/sku_options.js +0 -1
  367. package/lib/cjs/resources/skus.js +0 -1
  368. package/lib/cjs/resources/stock_items.d.ts +0 -46
  369. package/lib/cjs/resources/stock_items.js +0 -1
  370. package/lib/cjs/resources/stock_line_items.d.ts +0 -26
  371. package/lib/cjs/resources/stock_line_items.js +0 -1
  372. package/lib/cjs/resources/stock_locations.d.ts +0 -51
  373. package/lib/cjs/resources/stock_locations.js +0 -1
  374. package/lib/cjs/resources/stock_transfers.js +0 -1
  375. package/lib/cjs/resources/stripe_gateways.js +0 -1
  376. package/lib/cjs/resources/stripe_payments.js +0 -1
  377. package/lib/cjs/resources/tax_calculators.d.ts +0 -24
  378. package/lib/cjs/resources/tax_calculators.js +0 -1
  379. package/lib/cjs/resources/tax_categories.d.ts +0 -57
  380. package/lib/cjs/resources/tax_categories.js +0 -1
  381. package/lib/cjs/resources/tax_rules.d.ts +0 -68
  382. package/lib/cjs/resources/tax_rules.js +0 -1
  383. package/lib/cjs/resources/taxjar_accounts.d.ts +0 -40
  384. package/lib/cjs/resources/taxjar_accounts.js +0 -1
  385. package/lib/cjs/resources/transactions.d.ts +0 -30
  386. package/lib/cjs/resources/transactions.js +0 -1
  387. package/lib/cjs/resources/voids.d.ts +0 -32
  388. package/lib/cjs/resources/voids.js +0 -1
  389. package/lib/cjs/resources/webhooks.js +0 -1
  390. package/lib/cjs/resources/wire_transfers.js +0 -1
  391. package/lib/cjs/static.js +0 -1
  392. package/lib/cjs/util.js +0 -1
  393. package/lib/esm/api.d.ts +0 -103
  394. package/lib/esm/client.d.ts +0 -32
  395. package/lib/esm/client.js +0 -1
  396. package/lib/esm/commercelayer.d.ts +0 -122
  397. package/lib/esm/common.d.ts +0 -4
  398. package/lib/esm/common.js +0 -1
  399. package/lib/esm/config.d.ts +0 -11
  400. package/lib/esm/debug.d.ts +0 -3
  401. package/lib/esm/error.d.ts +0 -26
  402. package/lib/esm/error.js +0 -1
  403. package/lib/esm/index.d.ts +0 -7
  404. package/lib/esm/interceptor.d.ts +0 -19
  405. package/lib/esm/jsonapi.d.ts +0 -5
  406. package/lib/esm/jsonapi.js +0 -1
  407. package/lib/esm/model.d.ts +0 -101
  408. package/lib/esm/query.d.ts +0 -23
  409. package/lib/esm/resource.js +0 -1
  410. package/lib/esm/resources/addresses.js +0 -1
  411. package/lib/esm/resources/adjustments.d.ts +0 -35
  412. package/lib/esm/resources/adjustments.js +0 -1
  413. package/lib/esm/resources/adyen_gateways.js +0 -1
  414. package/lib/esm/resources/adyen_payments.d.ts +0 -42
  415. package/lib/esm/resources/adyen_payments.js +0 -1
  416. package/lib/esm/resources/application.d.ts +0 -21
  417. package/lib/esm/resources/attachments.d.ts +0 -156
  418. package/lib/esm/resources/attachments.js +0 -1
  419. package/lib/esm/resources/authorizations.d.ts +0 -54
  420. package/lib/esm/resources/authorizations.js +0 -1
  421. package/lib/esm/resources/avalara_accounts.js +0 -1
  422. package/lib/esm/resources/billing_info_validation_rules.d.ts +0 -31
  423. package/lib/esm/resources/billing_info_validation_rules.js +0 -1
  424. package/lib/esm/resources/bing_geocoders.js +0 -1
  425. package/lib/esm/resources/braintree_gateways.d.ts +0 -54
  426. package/lib/esm/resources/braintree_gateways.js +0 -1
  427. package/lib/esm/resources/braintree_payments.js +0 -1
  428. package/lib/esm/resources/bundles.js +0 -1
  429. package/lib/esm/resources/captures.js +0 -1
  430. package/lib/esm/resources/carrier_accounts.js +0 -1
  431. package/lib/esm/resources/checkout_com_gateways.js +0 -1
  432. package/lib/esm/resources/checkout_com_payments.js +0 -1
  433. package/lib/esm/resources/coupon_codes_promotion_rules.js +0 -1
  434. package/lib/esm/resources/coupon_recipients.d.ts +0 -42
  435. package/lib/esm/resources/coupon_recipients.js +0 -1
  436. package/lib/esm/resources/coupons.d.ts +0 -44
  437. package/lib/esm/resources/coupons.js +0 -1
  438. package/lib/esm/resources/customer_addresses.js +0 -1
  439. package/lib/esm/resources/customer_groups.js +0 -1
  440. package/lib/esm/resources/customer_password_resets.js +0 -1
  441. package/lib/esm/resources/customer_payment_sources.d.ts +0 -69
  442. package/lib/esm/resources/customer_payment_sources.js +0 -1
  443. package/lib/esm/resources/customer_subscriptions.d.ts +0 -27
  444. package/lib/esm/resources/customer_subscriptions.js +0 -1
  445. package/lib/esm/resources/customers.js +0 -1
  446. package/lib/esm/resources/delivery_lead_times.js +0 -1
  447. package/lib/esm/resources/event_callbacks.d.ts +0 -23
  448. package/lib/esm/resources/event_callbacks.js +0 -1
  449. package/lib/esm/resources/external_gateways.js +0 -1
  450. package/lib/esm/resources/external_payments.js +0 -1
  451. package/lib/esm/resources/external_promotions.js +0 -1
  452. package/lib/esm/resources/external_tax_calculators.d.ts +0 -41
  453. package/lib/esm/resources/external_tax_calculators.js +0 -1
  454. package/lib/esm/resources/fixed_amount_promotions.js +0 -1
  455. package/lib/esm/resources/fixed_price_promotions.d.ts +0 -92
  456. package/lib/esm/resources/fixed_price_promotions.js +0 -1
  457. package/lib/esm/resources/free_gift_promotions.js +0 -1
  458. package/lib/esm/resources/free_shipping_promotions.d.ts +0 -78
  459. package/lib/esm/resources/free_shipping_promotions.js +0 -1
  460. package/lib/esm/resources/geocoders.js +0 -1
  461. package/lib/esm/resources/gift_card_recipients.d.ts +0 -42
  462. package/lib/esm/resources/gift_card_recipients.js +0 -1
  463. package/lib/esm/resources/gift_cards.js +0 -1
  464. package/lib/esm/resources/google_geocoders.d.ts +0 -33
  465. package/lib/esm/resources/google_geocoders.js +0 -1
  466. package/lib/esm/resources/imports.d.ts +0 -40
  467. package/lib/esm/resources/imports.js +0 -1
  468. package/lib/esm/resources/in_stock_subscriptions.js +0 -1
  469. package/lib/esm/resources/inventory_models.js +0 -1
  470. package/lib/esm/resources/inventory_return_locations.js +0 -1
  471. package/lib/esm/resources/inventory_stock_locations.d.ts +0 -44
  472. package/lib/esm/resources/inventory_stock_locations.js +0 -1
  473. package/lib/esm/resources/klarna_gateways.d.ts +0 -42
  474. package/lib/esm/resources/klarna_gateways.js +0 -1
  475. package/lib/esm/resources/klarna_payments.d.ts +0 -39
  476. package/lib/esm/resources/klarna_payments.js +0 -1
  477. package/lib/esm/resources/line_item_options.js +0 -1
  478. package/lib/esm/resources/line_items.js +0 -1
  479. package/lib/esm/resources/manual_gateways.d.ts +0 -32
  480. package/lib/esm/resources/manual_gateways.js +0 -1
  481. package/lib/esm/resources/manual_tax_calculators.js +0 -1
  482. package/lib/esm/resources/markets.js +0 -1
  483. package/lib/esm/resources/merchants.d.ts +0 -36
  484. package/lib/esm/resources/merchants.js +0 -1
  485. package/lib/esm/resources/order_amount_promotion_rules.d.ts +0 -56
  486. package/lib/esm/resources/order_amount_promotion_rules.js +0 -1
  487. package/lib/esm/resources/order_copies.d.ts +0 -42
  488. package/lib/esm/resources/order_copies.js +0 -1
  489. package/lib/esm/resources/order_subscriptions.js +0 -1
  490. package/lib/esm/resources/order_validation_rules.js +0 -1
  491. package/lib/esm/resources/orders.js +0 -1
  492. package/lib/esm/resources/organization.d.ts +0 -32
  493. package/lib/esm/resources/packages.js +0 -1
  494. package/lib/esm/resources/parcel_line_items.d.ts +0 -47
  495. package/lib/esm/resources/parcel_line_items.js +0 -1
  496. package/lib/esm/resources/parcels.d.ts +0 -104
  497. package/lib/esm/resources/parcels.js +0 -1
  498. package/lib/esm/resources/payment_gateways.d.ts +0 -20
  499. package/lib/esm/resources/payment_gateways.js +0 -1
  500. package/lib/esm/resources/payment_methods.js +0 -1
  501. package/lib/esm/resources/paypal_gateways.js +0 -1
  502. package/lib/esm/resources/paypal_payments.js +0 -1
  503. package/lib/esm/resources/percentage_discount_promotions.js +0 -1
  504. package/lib/esm/resources/price_lists.d.ts +0 -37
  505. package/lib/esm/resources/price_lists.js +0 -1
  506. package/lib/esm/resources/prices.js +0 -1
  507. package/lib/esm/resources/promotion_rules.d.ts +0 -24
  508. package/lib/esm/resources/promotions.js +0 -1
  509. package/lib/esm/resources/refunds.d.ts +0 -32
  510. package/lib/esm/resources/refunds.js +0 -1
  511. package/lib/esm/resources/return_line_items.d.ts +0 -47
  512. package/lib/esm/resources/return_line_items.js +0 -1
  513. package/lib/esm/resources/returns.js +0 -1
  514. package/lib/esm/resources/shipments.d.ts +0 -76
  515. package/lib/esm/resources/shipments.js +0 -1
  516. package/lib/esm/resources/shipping_categories.d.ts +0 -31
  517. package/lib/esm/resources/shipping_categories.js +0 -1
  518. package/lib/esm/resources/shipping_methods.d.ts +0 -69
  519. package/lib/esm/resources/shipping_methods.js +0 -1
  520. package/lib/esm/resources/shipping_zones.js +0 -1
  521. package/lib/esm/resources/sku_list_items.d.ts +0 -45
  522. package/lib/esm/resources/sku_list_items.js +0 -1
  523. package/lib/esm/resources/sku_list_promotion_rules.js +0 -1
  524. package/lib/esm/resources/sku_lists.js +0 -1
  525. package/lib/esm/resources/sku_options.d.ts +0 -54
  526. package/lib/esm/resources/sku_options.js +0 -1
  527. package/lib/esm/resources/skus.d.ts +0 -72
  528. package/lib/esm/resources/skus.js +0 -1
  529. package/lib/esm/resources/stock_items.js +0 -1
  530. package/lib/esm/resources/stock_line_items.js +0 -1
  531. package/lib/esm/resources/stock_locations.js +0 -1
  532. package/lib/esm/resources/stock_transfers.d.ts +0 -66
  533. package/lib/esm/resources/stock_transfers.js +0 -1
  534. package/lib/esm/resources/stripe_gateways.d.ts +0 -36
  535. package/lib/esm/resources/stripe_gateways.js +0 -1
  536. package/lib/esm/resources/stripe_payments.d.ts +0 -40
  537. package/lib/esm/resources/stripe_payments.js +0 -1
  538. package/lib/esm/resources/tax_calculators.js +0 -1
  539. package/lib/esm/resources/tax_categories.js +0 -1
  540. package/lib/esm/resources/tax_rules.js +0 -1
  541. package/lib/esm/resources/taxjar_accounts.js +0 -1
  542. package/lib/esm/resources/transactions.js +0 -1
  543. package/lib/esm/resources/voids.js +0 -1
  544. package/lib/esm/resources/webhooks.d.ts +0 -41
  545. package/lib/esm/resources/webhooks.js +0 -1
  546. package/lib/esm/resources/wire_transfers.d.ts +0 -31
  547. package/lib/esm/resources/wire_transfers.js +0 -1
  548. package/lib/esm/static.d.ts +0 -6
  549. package/lib/esm/util.d.ts +0 -3
  550. package/lib/tsconfig.esm.tsbuildinfo +0 -1
  551. package/lib/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1 @@
1
+ import{ApiResource as a}from"../resource";class r extends a{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create({...e,type:r.TYPE},t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update({...e,type:r.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async sku(e,t,s){return this.resources.fetch({type:"skus"},`tax_categories/${e}/sku`,t,s)}async attachments(e,t,s){return this.resources.fetch({type:"attachments"},`tax_categories/${e}/attachments`,t,s)}isTaxCategory(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="tax_categories";export default r;
@@ -60,6 +60,7 @@ declare class TaxRules extends ApiResource {
60
60
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxRule>;
61
61
  update(resource: TaxRuleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxRule>;
62
62
  delete(id: string, options?: ResourcesConfig): Promise<void>;
63
+ manual_tax_calculator(taxRuleId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ManualTaxCalculator>;
63
64
  isTaxRule(resource: any): resource is TaxRule;
64
65
  relationship(id: string | ResourceId | null): TaxRuleRel;
65
66
  type(): string;
@@ -0,0 +1 @@
1
+ import{ApiResource as a}from"../resource";class r extends a{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create({...e,type:r.TYPE},t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update({...e,type:r.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async manual_tax_calculator(e,t,s){return this.resources.fetch({type:"manual_tax_calculators"},`tax_rules/${e}/manual_tax_calculator`,t,s)}isTaxRule(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="tax_rules";export default r;
@@ -32,6 +32,9 @@ declare class TaxjarAccounts extends ApiResource {
32
32
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxjarAccount>;
33
33
  update(resource: TaxjarAccountUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxjarAccount>;
34
34
  delete(id: string, options?: ResourcesConfig): Promise<void>;
35
+ tax_categories(taxjarAccountId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<TaxCategory>>;
36
+ markets(taxjarAccountId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
37
+ attachments(taxjarAccountId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
35
38
  isTaxjarAccount(resource: any): resource is TaxjarAccount;
36
39
  relationship(id: string | ResourceId | null): TaxjarAccountRel;
37
40
  type(): string;
@@ -0,0 +1 @@
1
+ import{ApiResource as s}from"../resource";class r extends s{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,a){return this.resources.create({...e,type:r.TYPE},t,a)}async retrieve(e,t,a){return this.resources.retrieve({type:r.TYPE,id:e},t,a)}async update(e,t,a){return this.resources.update({...e,type:r.TYPE},t,a)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async tax_categories(e,t,a){return this.resources.fetch({type:"tax_categories"},`taxjar_accounts/${e}/tax_categories`,t,a)}async markets(e,t,a){return this.resources.fetch({type:"markets"},`taxjar_accounts/${e}/markets`,t,a)}async attachments(e,t,a){return this.resources.fetch({type:"attachments"},`taxjar_accounts/${e}/attachments`,t,a)}isTaxjarAccount(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="taxjar_accounts";export default r;
@@ -22,6 +22,7 @@ declare class Transactions extends ApiResource {
22
22
  static readonly TYPE: 'transactions';
23
23
  list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Transaction>>;
24
24
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Transaction>;
25
+ order(transactionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
25
26
  isTransaction(resource: any): resource is Transaction;
26
27
  relationship(id: string | ResourceId | null): TransactionRel;
27
28
  type(): string;
@@ -0,0 +1 @@
1
+ import{ApiResource as i}from"../resource";class e extends i{async list(r,t){return this.resources.list({type:e.TYPE},r,t)}async retrieve(r,t,s){return this.resources.retrieve({type:e.TYPE,id:r},t,s)}async order(r,t,s){return this.resources.fetch({type:"orders"},`transactions/${r}/order`,t,s)}isTransaction(r){return r.type&&r.type===e.TYPE}relationship(r){return r===null||typeof r=="string"?{id:r,type:e.TYPE}:{id:r.id,type:e.TYPE}}type(){return e.TYPE}}e.TYPE="transactions";export default e;
@@ -24,6 +24,8 @@ declare class Voids extends ApiResource {
24
24
  static readonly TYPE: 'voids';
25
25
  list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Void>>;
26
26
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Void>;
27
+ order(voidId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
28
+ reference_authorization(voidId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
27
29
  isVoid(resource: any): resource is Void;
28
30
  relationship(id: string | ResourceId | null): VoidRel;
29
31
  type(): string;
@@ -0,0 +1 @@
1
+ import{ApiResource as i}from"../resource";class r extends i{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async order(e,t,s){return this.resources.fetch({type:"orders"},`voids/${e}/order`,t,s)}async reference_authorization(e,t,s){return this.resources.fetch({type:"authorizations"},`voids/${e}/reference_authorization`,t,s)}isVoid(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="voids";export default r;
@@ -33,6 +33,7 @@ declare class Webhooks extends ApiResource {
33
33
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
34
34
  update(resource: WebhookUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
35
35
  delete(id: string, options?: ResourcesConfig): Promise<void>;
36
+ last_event_callbacks(webhookId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<EventCallback>>;
36
37
  isWebhook(resource: any): resource is Webhook;
37
38
  relationship(id: string | ResourceId | null): WebhookRel;
38
39
  type(): string;
@@ -0,0 +1 @@
1
+ import{ApiResource as a}from"../resource";class t extends a{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create({...e,type:t.TYPE},r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update({...e,type:t.TYPE},r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}async last_event_callbacks(e,r,s){return this.resources.fetch({type:"event_callbacks"},`webhooks/${e}/last_event_callbacks`,r,s)}isWebhook(e){return e.type&&e.type===t.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="webhooks";export default t;
@@ -23,6 +23,7 @@ declare class WireTransfers extends ApiResource {
23
23
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<WireTransfer>;
24
24
  update(resource: WireTransferUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<WireTransfer>;
25
25
  delete(id: string, options?: ResourcesConfig): Promise<void>;
26
+ order(wireTransferId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
26
27
  isWireTransfer(resource: any): resource is WireTransfer;
27
28
  relationship(id: string | ResourceId | null): WireTransferRel;
28
29
  type(): string;
@@ -0,0 +1 @@
1
+ import{ApiResource as i}from"../resource";class r extends i{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create({...e,type:r.TYPE},t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update({...e,type:r.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async order(e,t,s){return this.resources.fetch({type:"orders"},`wire_transfers/${e}/order`,t,s)}isWireTransfer(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="wire_transfers";export default r;
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@commercelayer/sdk",
3
- "version": "4.3.0",
4
- "main": "lib/cjs/index.js",
5
- "types": "lib/cjs/index.d.ts",
6
- "module": "lib/esm/index.js",
3
+ "version": "5.0.0-alpha.2",
4
+ "types": "lib/index.d.ts",
5
+ "module": "lib/index.js",
7
6
  "scripts": {
8
7
  "lint": "eslint ./src --ext .ts",
9
8
  "lintspec": "eslint ./specs/resources/ --ext .spec.ts",
10
- "build": "tsc -b tsconfig.json tsconfig.esm.json --verbose",
9
+ "build": "tsc -b tsconfig.json --verbose",
11
10
  "start": "ts-node src/index.ts",
12
11
  "generate": "ts-node gen/generator.ts",
13
12
  "prepare": "npm run build",
@@ -40,22 +39,22 @@
40
39
  "node": ">=16"
41
40
  },
42
41
  "dependencies": {
43
- "axios": "^0.24.0"
42
+ "axios": "^0.25.0"
44
43
  },
45
44
  "devDependencies": {
46
- "@babel/preset-env": "^7.16.5",
47
- "@babel/preset-typescript": "^7.16.5",
48
- "@commercelayer/js-auth": "^2.2.7",
45
+ "@babel/preset-env": "^7.16.11",
46
+ "@babel/preset-typescript": "^7.16.7",
47
+ "@commercelayer/js-auth": "^2.2.9",
49
48
  "@semantic-release/changelog": "^6.0.1",
50
49
  "@semantic-release/git": "^10.0.1",
51
50
  "@size-limit/preset-small-lib": "^6.0.4",
52
51
  "@types/debug": "^4.1.7",
53
- "@types/jest": "^27.0.3",
52
+ "@types/jest": "^27.4.0",
54
53
  "@types/lodash": "^4.14.178",
55
- "@types/node": "^17.0.10",
54
+ "@types/node": "^17.0.17",
56
55
  "@typescript-eslint/eslint-plugin": "^5.7.0",
57
56
  "dotenv": "^10.0.0",
58
- "eslint": "^8.7.0",
57
+ "eslint": "^8.8.0",
59
58
  "husky": "^7.0.4",
60
59
  "inflector-js": "^1.0.1",
61
60
  "jest": "^27.4.7",
package/lib/cjs/api.js DELETED
@@ -1 +0,0 @@
1
- "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ManualGateways=exports.LineItems=exports.LineItemOptions=exports.KlarnaPayments=exports.KlarnaGateways=exports.InventoryStockLocations=exports.InventoryReturnLocations=exports.InventoryModels=exports.InStockSubscriptions=exports.Imports=exports.GoogleGeocoders=exports.GiftCards=exports.GiftCardRecipients=exports.Geocoders=exports.FreeShippingPromotions=exports.FreeGiftPromotions=exports.FixedPricePromotions=exports.FixedAmountPromotions=exports.ExternalTaxCalculators=exports.ExternalPromotions=exports.ExternalPayments=exports.ExternalGateways=exports.EventCallbacks=exports.DeliveryLeadTimes=exports.Customers=exports.CustomerSubscriptions=exports.CustomerPaymentSources=exports.CustomerPasswordResets=exports.CustomerGroups=exports.CustomerAddresses=exports.Coupons=exports.CouponRecipients=exports.CouponCodesPromotionRules=exports.CheckoutComPayments=exports.CheckoutComGateways=exports.CarrierAccounts=exports.Captures=exports.Bundles=exports.BraintreePayments=exports.BraintreeGateways=exports.BingGeocoders=exports.BillingInfoValidationRules=exports.AvalaraAccounts=exports.Authorizations=exports.Attachments=exports.Applications=exports.AdyenPayments=exports.AdyenGateways=exports.Adjustments=exports.Addresses=void 0,exports.resourceList=exports.WireTransfers=exports.Webhooks=exports.Voids=exports.Transactions=exports.TaxjarAccounts=exports.TaxRules=exports.TaxCategories=exports.TaxCalculators=exports.StripePayments=exports.StripeGateways=exports.StockTransfers=exports.StockLocations=exports.StockLineItems=exports.StockItems=exports.Skus=exports.SkuOptions=exports.SkuLists=exports.SkuListPromotionRules=exports.SkuListItems=exports.ShippingZones=exports.ShippingMethods=exports.ShippingCategories=exports.Shipments=exports.Returns=exports.ReturnLineItems=exports.Refunds=exports.Promotions=exports.PromotionRules=exports.Prices=exports.PriceLists=exports.PercentageDiscountPromotions=exports.PaypalPayments=exports.PaypalGateways=exports.PaymentMethods=exports.PaymentGateways=exports.Parcels=exports.ParcelLineItems=exports.Packages=exports.Organizations=exports.Orders=exports.OrderValidationRules=exports.OrderSubscriptions=exports.OrderCopies=exports.OrderAmountPromotionRules=exports.Merchants=exports.Markets=exports.ManualTaxCalculators=void 0;var addresses_1=require("./resources/addresses");Object.defineProperty(exports,"Addresses",{enumerable:!0,get:function(){return __importDefault(addresses_1).default}});var adjustments_1=require("./resources/adjustments");Object.defineProperty(exports,"Adjustments",{enumerable:!0,get:function(){return __importDefault(adjustments_1).default}});var adyen_gateways_1=require("./resources/adyen_gateways");Object.defineProperty(exports,"AdyenGateways",{enumerable:!0,get:function(){return __importDefault(adyen_gateways_1).default}});var adyen_payments_1=require("./resources/adyen_payments");Object.defineProperty(exports,"AdyenPayments",{enumerable:!0,get:function(){return __importDefault(adyen_payments_1).default}});var application_1=require("./resources/application");Object.defineProperty(exports,"Applications",{enumerable:!0,get:function(){return __importDefault(application_1).default}});var attachments_1=require("./resources/attachments");Object.defineProperty(exports,"Attachments",{enumerable:!0,get:function(){return __importDefault(attachments_1).default}});var authorizations_1=require("./resources/authorizations");Object.defineProperty(exports,"Authorizations",{enumerable:!0,get:function(){return __importDefault(authorizations_1).default}});var avalara_accounts_1=require("./resources/avalara_accounts");Object.defineProperty(exports,"AvalaraAccounts",{enumerable:!0,get:function(){return __importDefault(avalara_accounts_1).default}});var billing_info_validation_rules_1=require("./resources/billing_info_validation_rules");Object.defineProperty(exports,"BillingInfoValidationRules",{enumerable:!0,get:function(){return __importDefault(billing_info_validation_rules_1).default}});var bing_geocoders_1=require("./resources/bing_geocoders");Object.defineProperty(exports,"BingGeocoders",{enumerable:!0,get:function(){return __importDefault(bing_geocoders_1).default}});var braintree_gateways_1=require("./resources/braintree_gateways");Object.defineProperty(exports,"BraintreeGateways",{enumerable:!0,get:function(){return __importDefault(braintree_gateways_1).default}});var braintree_payments_1=require("./resources/braintree_payments");Object.defineProperty(exports,"BraintreePayments",{enumerable:!0,get:function(){return __importDefault(braintree_payments_1).default}});var bundles_1=require("./resources/bundles");Object.defineProperty(exports,"Bundles",{enumerable:!0,get:function(){return __importDefault(bundles_1).default}});var captures_1=require("./resources/captures");Object.defineProperty(exports,"Captures",{enumerable:!0,get:function(){return __importDefault(captures_1).default}});var carrier_accounts_1=require("./resources/carrier_accounts");Object.defineProperty(exports,"CarrierAccounts",{enumerable:!0,get:function(){return __importDefault(carrier_accounts_1).default}});var checkout_com_gateways_1=require("./resources/checkout_com_gateways");Object.defineProperty(exports,"CheckoutComGateways",{enumerable:!0,get:function(){return __importDefault(checkout_com_gateways_1).default}});var checkout_com_payments_1=require("./resources/checkout_com_payments");Object.defineProperty(exports,"CheckoutComPayments",{enumerable:!0,get:function(){return __importDefault(checkout_com_payments_1).default}});var coupon_codes_promotion_rules_1=require("./resources/coupon_codes_promotion_rules");Object.defineProperty(exports,"CouponCodesPromotionRules",{enumerable:!0,get:function(){return __importDefault(coupon_codes_promotion_rules_1).default}});var coupon_recipients_1=require("./resources/coupon_recipients");Object.defineProperty(exports,"CouponRecipients",{enumerable:!0,get:function(){return __importDefault(coupon_recipients_1).default}});var coupons_1=require("./resources/coupons");Object.defineProperty(exports,"Coupons",{enumerable:!0,get:function(){return __importDefault(coupons_1).default}});var customer_addresses_1=require("./resources/customer_addresses");Object.defineProperty(exports,"CustomerAddresses",{enumerable:!0,get:function(){return __importDefault(customer_addresses_1).default}});var customer_groups_1=require("./resources/customer_groups");Object.defineProperty(exports,"CustomerGroups",{enumerable:!0,get:function(){return __importDefault(customer_groups_1).default}});var customer_password_resets_1=require("./resources/customer_password_resets");Object.defineProperty(exports,"CustomerPasswordResets",{enumerable:!0,get:function(){return __importDefault(customer_password_resets_1).default}});var customer_payment_sources_1=require("./resources/customer_payment_sources");Object.defineProperty(exports,"CustomerPaymentSources",{enumerable:!0,get:function(){return __importDefault(customer_payment_sources_1).default}});var customer_subscriptions_1=require("./resources/customer_subscriptions");Object.defineProperty(exports,"CustomerSubscriptions",{enumerable:!0,get:function(){return __importDefault(customer_subscriptions_1).default}});var customers_1=require("./resources/customers");Object.defineProperty(exports,"Customers",{enumerable:!0,get:function(){return __importDefault(customers_1).default}});var delivery_lead_times_1=require("./resources/delivery_lead_times");Object.defineProperty(exports,"DeliveryLeadTimes",{enumerable:!0,get:function(){return __importDefault(delivery_lead_times_1).default}});var event_callbacks_1=require("./resources/event_callbacks");Object.defineProperty(exports,"EventCallbacks",{enumerable:!0,get:function(){return __importDefault(event_callbacks_1).default}});var external_gateways_1=require("./resources/external_gateways");Object.defineProperty(exports,"ExternalGateways",{enumerable:!0,get:function(){return __importDefault(external_gateways_1).default}});var external_payments_1=require("./resources/external_payments");Object.defineProperty(exports,"ExternalPayments",{enumerable:!0,get:function(){return __importDefault(external_payments_1).default}});var external_promotions_1=require("./resources/external_promotions");Object.defineProperty(exports,"ExternalPromotions",{enumerable:!0,get:function(){return __importDefault(external_promotions_1).default}});var external_tax_calculators_1=require("./resources/external_tax_calculators");Object.defineProperty(exports,"ExternalTaxCalculators",{enumerable:!0,get:function(){return __importDefault(external_tax_calculators_1).default}});var fixed_amount_promotions_1=require("./resources/fixed_amount_promotions");Object.defineProperty(exports,"FixedAmountPromotions",{enumerable:!0,get:function(){return __importDefault(fixed_amount_promotions_1).default}});var fixed_price_promotions_1=require("./resources/fixed_price_promotions");Object.defineProperty(exports,"FixedPricePromotions",{enumerable:!0,get:function(){return __importDefault(fixed_price_promotions_1).default}});var free_gift_promotions_1=require("./resources/free_gift_promotions");Object.defineProperty(exports,"FreeGiftPromotions",{enumerable:!0,get:function(){return __importDefault(free_gift_promotions_1).default}});var free_shipping_promotions_1=require("./resources/free_shipping_promotions");Object.defineProperty(exports,"FreeShippingPromotions",{enumerable:!0,get:function(){return __importDefault(free_shipping_promotions_1).default}});var geocoders_1=require("./resources/geocoders");Object.defineProperty(exports,"Geocoders",{enumerable:!0,get:function(){return __importDefault(geocoders_1).default}});var gift_card_recipients_1=require("./resources/gift_card_recipients");Object.defineProperty(exports,"GiftCardRecipients",{enumerable:!0,get:function(){return __importDefault(gift_card_recipients_1).default}});var gift_cards_1=require("./resources/gift_cards");Object.defineProperty(exports,"GiftCards",{enumerable:!0,get:function(){return __importDefault(gift_cards_1).default}});var google_geocoders_1=require("./resources/google_geocoders");Object.defineProperty(exports,"GoogleGeocoders",{enumerable:!0,get:function(){return __importDefault(google_geocoders_1).default}});var imports_1=require("./resources/imports");Object.defineProperty(exports,"Imports",{enumerable:!0,get:function(){return __importDefault(imports_1).default}});var in_stock_subscriptions_1=require("./resources/in_stock_subscriptions");Object.defineProperty(exports,"InStockSubscriptions",{enumerable:!0,get:function(){return __importDefault(in_stock_subscriptions_1).default}});var inventory_models_1=require("./resources/inventory_models");Object.defineProperty(exports,"InventoryModels",{enumerable:!0,get:function(){return __importDefault(inventory_models_1).default}});var inventory_return_locations_1=require("./resources/inventory_return_locations");Object.defineProperty(exports,"InventoryReturnLocations",{enumerable:!0,get:function(){return __importDefault(inventory_return_locations_1).default}});var inventory_stock_locations_1=require("./resources/inventory_stock_locations");Object.defineProperty(exports,"InventoryStockLocations",{enumerable:!0,get:function(){return __importDefault(inventory_stock_locations_1).default}});var klarna_gateways_1=require("./resources/klarna_gateways");Object.defineProperty(exports,"KlarnaGateways",{enumerable:!0,get:function(){return __importDefault(klarna_gateways_1).default}});var klarna_payments_1=require("./resources/klarna_payments");Object.defineProperty(exports,"KlarnaPayments",{enumerable:!0,get:function(){return __importDefault(klarna_payments_1).default}});var line_item_options_1=require("./resources/line_item_options");Object.defineProperty(exports,"LineItemOptions",{enumerable:!0,get:function(){return __importDefault(line_item_options_1).default}});var line_items_1=require("./resources/line_items");Object.defineProperty(exports,"LineItems",{enumerable:!0,get:function(){return __importDefault(line_items_1).default}});var manual_gateways_1=require("./resources/manual_gateways");Object.defineProperty(exports,"ManualGateways",{enumerable:!0,get:function(){return __importDefault(manual_gateways_1).default}});var manual_tax_calculators_1=require("./resources/manual_tax_calculators");Object.defineProperty(exports,"ManualTaxCalculators",{enumerable:!0,get:function(){return __importDefault(manual_tax_calculators_1).default}});var markets_1=require("./resources/markets");Object.defineProperty(exports,"Markets",{enumerable:!0,get:function(){return __importDefault(markets_1).default}});var merchants_1=require("./resources/merchants");Object.defineProperty(exports,"Merchants",{enumerable:!0,get:function(){return __importDefault(merchants_1).default}});var order_amount_promotion_rules_1=require("./resources/order_amount_promotion_rules");Object.defineProperty(exports,"OrderAmountPromotionRules",{enumerable:!0,get:function(){return __importDefault(order_amount_promotion_rules_1).default}});var order_copies_1=require("./resources/order_copies");Object.defineProperty(exports,"OrderCopies",{enumerable:!0,get:function(){return __importDefault(order_copies_1).default}});var order_subscriptions_1=require("./resources/order_subscriptions");Object.defineProperty(exports,"OrderSubscriptions",{enumerable:!0,get:function(){return __importDefault(order_subscriptions_1).default}});var order_validation_rules_1=require("./resources/order_validation_rules");Object.defineProperty(exports,"OrderValidationRules",{enumerable:!0,get:function(){return __importDefault(order_validation_rules_1).default}});var orders_1=require("./resources/orders");Object.defineProperty(exports,"Orders",{enumerable:!0,get:function(){return __importDefault(orders_1).default}});var organization_1=require("./resources/organization");Object.defineProperty(exports,"Organizations",{enumerable:!0,get:function(){return __importDefault(organization_1).default}});var packages_1=require("./resources/packages");Object.defineProperty(exports,"Packages",{enumerable:!0,get:function(){return __importDefault(packages_1).default}});var parcel_line_items_1=require("./resources/parcel_line_items");Object.defineProperty(exports,"ParcelLineItems",{enumerable:!0,get:function(){return __importDefault(parcel_line_items_1).default}});var parcels_1=require("./resources/parcels");Object.defineProperty(exports,"Parcels",{enumerable:!0,get:function(){return __importDefault(parcels_1).default}});var payment_gateways_1=require("./resources/payment_gateways");Object.defineProperty(exports,"PaymentGateways",{enumerable:!0,get:function(){return __importDefault(payment_gateways_1).default}});var payment_methods_1=require("./resources/payment_methods");Object.defineProperty(exports,"PaymentMethods",{enumerable:!0,get:function(){return __importDefault(payment_methods_1).default}});var paypal_gateways_1=require("./resources/paypal_gateways");Object.defineProperty(exports,"PaypalGateways",{enumerable:!0,get:function(){return __importDefault(paypal_gateways_1).default}});var paypal_payments_1=require("./resources/paypal_payments");Object.defineProperty(exports,"PaypalPayments",{enumerable:!0,get:function(){return __importDefault(paypal_payments_1).default}});var percentage_discount_promotions_1=require("./resources/percentage_discount_promotions");Object.defineProperty(exports,"PercentageDiscountPromotions",{enumerable:!0,get:function(){return __importDefault(percentage_discount_promotions_1).default}});var price_lists_1=require("./resources/price_lists");Object.defineProperty(exports,"PriceLists",{enumerable:!0,get:function(){return __importDefault(price_lists_1).default}});var prices_1=require("./resources/prices");Object.defineProperty(exports,"Prices",{enumerable:!0,get:function(){return __importDefault(prices_1).default}});var promotion_rules_1=require("./resources/promotion_rules");Object.defineProperty(exports,"PromotionRules",{enumerable:!0,get:function(){return __importDefault(promotion_rules_1).default}});var promotions_1=require("./resources/promotions");Object.defineProperty(exports,"Promotions",{enumerable:!0,get:function(){return __importDefault(promotions_1).default}});var refunds_1=require("./resources/refunds");Object.defineProperty(exports,"Refunds",{enumerable:!0,get:function(){return __importDefault(refunds_1).default}});var return_line_items_1=require("./resources/return_line_items");Object.defineProperty(exports,"ReturnLineItems",{enumerable:!0,get:function(){return __importDefault(return_line_items_1).default}});var returns_1=require("./resources/returns");Object.defineProperty(exports,"Returns",{enumerable:!0,get:function(){return __importDefault(returns_1).default}});var shipments_1=require("./resources/shipments");Object.defineProperty(exports,"Shipments",{enumerable:!0,get:function(){return __importDefault(shipments_1).default}});var shipping_categories_1=require("./resources/shipping_categories");Object.defineProperty(exports,"ShippingCategories",{enumerable:!0,get:function(){return __importDefault(shipping_categories_1).default}});var shipping_methods_1=require("./resources/shipping_methods");Object.defineProperty(exports,"ShippingMethods",{enumerable:!0,get:function(){return __importDefault(shipping_methods_1).default}});var shipping_zones_1=require("./resources/shipping_zones");Object.defineProperty(exports,"ShippingZones",{enumerable:!0,get:function(){return __importDefault(shipping_zones_1).default}});var sku_list_items_1=require("./resources/sku_list_items");Object.defineProperty(exports,"SkuListItems",{enumerable:!0,get:function(){return __importDefault(sku_list_items_1).default}});var sku_list_promotion_rules_1=require("./resources/sku_list_promotion_rules");Object.defineProperty(exports,"SkuListPromotionRules",{enumerable:!0,get:function(){return __importDefault(sku_list_promotion_rules_1).default}});var sku_lists_1=require("./resources/sku_lists");Object.defineProperty(exports,"SkuLists",{enumerable:!0,get:function(){return __importDefault(sku_lists_1).default}});var sku_options_1=require("./resources/sku_options");Object.defineProperty(exports,"SkuOptions",{enumerable:!0,get:function(){return __importDefault(sku_options_1).default}});var skus_1=require("./resources/skus");Object.defineProperty(exports,"Skus",{enumerable:!0,get:function(){return __importDefault(skus_1).default}});var stock_items_1=require("./resources/stock_items");Object.defineProperty(exports,"StockItems",{enumerable:!0,get:function(){return __importDefault(stock_items_1).default}});var stock_line_items_1=require("./resources/stock_line_items");Object.defineProperty(exports,"StockLineItems",{enumerable:!0,get:function(){return __importDefault(stock_line_items_1).default}});var stock_locations_1=require("./resources/stock_locations");Object.defineProperty(exports,"StockLocations",{enumerable:!0,get:function(){return __importDefault(stock_locations_1).default}});var stock_transfers_1=require("./resources/stock_transfers");Object.defineProperty(exports,"StockTransfers",{enumerable:!0,get:function(){return __importDefault(stock_transfers_1).default}});var stripe_gateways_1=require("./resources/stripe_gateways");Object.defineProperty(exports,"StripeGateways",{enumerable:!0,get:function(){return __importDefault(stripe_gateways_1).default}});var stripe_payments_1=require("./resources/stripe_payments");Object.defineProperty(exports,"StripePayments",{enumerable:!0,get:function(){return __importDefault(stripe_payments_1).default}});var tax_calculators_1=require("./resources/tax_calculators");Object.defineProperty(exports,"TaxCalculators",{enumerable:!0,get:function(){return __importDefault(tax_calculators_1).default}});var tax_categories_1=require("./resources/tax_categories");Object.defineProperty(exports,"TaxCategories",{enumerable:!0,get:function(){return __importDefault(tax_categories_1).default}});var tax_rules_1=require("./resources/tax_rules");Object.defineProperty(exports,"TaxRules",{enumerable:!0,get:function(){return __importDefault(tax_rules_1).default}});var taxjar_accounts_1=require("./resources/taxjar_accounts");Object.defineProperty(exports,"TaxjarAccounts",{enumerable:!0,get:function(){return __importDefault(taxjar_accounts_1).default}});var transactions_1=require("./resources/transactions");Object.defineProperty(exports,"Transactions",{enumerable:!0,get:function(){return __importDefault(transactions_1).default}});var voids_1=require("./resources/voids");Object.defineProperty(exports,"Voids",{enumerable:!0,get:function(){return __importDefault(voids_1).default}});var webhooks_1=require("./resources/webhooks");Object.defineProperty(exports,"Webhooks",{enumerable:!0,get:function(){return __importDefault(webhooks_1).default}});var wire_transfers_1=require("./resources/wire_transfers");Object.defineProperty(exports,"WireTransfers",{enumerable:!0,get:function(){return __importDefault(wire_transfers_1).default}}),exports.resourceList=["addresses","adjustments","adyen_gateways","adyen_payments","application","attachments","authorizations","avalara_accounts","billing_info_validation_rules","bing_geocoders","braintree_gateways","braintree_payments","bundles","captures","carrier_accounts","checkout_com_gateways","checkout_com_payments","coupon_codes_promotion_rules","coupon_recipients","coupons","customer_addresses","customer_groups","customer_password_resets","customer_payment_sources","customer_subscriptions","customers","delivery_lead_times","event_callbacks","external_gateways","external_payments","external_promotions","external_tax_calculators","fixed_amount_promotions","fixed_price_promotions","free_gift_promotions","free_shipping_promotions","geocoders","gift_card_recipients","gift_cards","google_geocoders","imports","in_stock_subscriptions","inventory_models","inventory_return_locations","inventory_stock_locations","klarna_gateways","klarna_payments","line_item_options","line_items","manual_gateways","manual_tax_calculators","markets","merchants","order_amount_promotion_rules","order_copies","order_subscriptions","order_validation_rules","orders","organization","packages","parcel_line_items","parcels","payment_gateways","payment_methods","paypal_gateways","paypal_payments","percentage_discount_promotions","price_lists","prices","promotion_rules","promotions","refunds","return_line_items","returns","shipments","shipping_categories","shipping_methods","shipping_zones","sku_list_items","sku_list_promotion_rules","sku_lists","sku_options","skus","stock_items","stock_line_items","stock_locations","stock_transfers","stripe_gateways","stripe_payments","tax_calculators","tax_categories","tax_rules","taxjar_accounts","transactions","voids","webhooks","wire_transfers"];
package/lib/cjs/client.js DELETED
@@ -1 +0,0 @@
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 +0,0 @@
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;
package/lib/cjs/common.js DELETED
@@ -1 +0,0 @@
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;
package/lib/cjs/config.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const config={default:{domain:"commercelayer.io",pageNumber:1,pageSize:10},client:{timeout:15e3}};exports.default=config;
package/lib/cjs/debug.js DELETED
@@ -1 +0,0 @@
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;
package/lib/cjs/error.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ErrorType=exports.ApiError=exports.SdkError=void 0;var ErrorType;(function(e){e.CLIENT="client",e.REQUEST="request",e.RESPONSE="response",e.GENERIC="generic",e.CANCEL="cancel"})(ErrorType||(ErrorType={})),exports.ErrorType=ErrorType;class SdkError extends Error{constructor(r){super(r.message);this.name=this.constructor.name,this.type=r.type||ErrorType.GENERIC}static isSdkError(r){return r&&["SdkError","ApiError"].includes(r.name)&&Object.values(ErrorType).includes(r.type)}}exports.SdkError=SdkError;class ApiError extends SdkError{constructor(r){super(Object.assign(Object.assign({},r),{type:ErrorType.RESPONSE}));this.errors=[],this.name=this.constructor.name}static isApiError(r){return SdkError.isSdkError(r)&&r.name==="ApiError"&&r.type===ErrorType.RESPONSE}first(){var r;return((r=this.errors)===null||r===void 0?void 0:r.length)>0?this.errors[0]:void 0}}exports.ApiError=ApiError;
package/lib/cjs/index.js DELETED
@@ -1 +0,0 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,i,t,r){r===void 0&&(r=t),Object.defineProperty(e,r,{enumerable:!0,get:function(){return i[t]}})}:function(e,i,t,r){r===void 0&&(r=t),e[r]=i[t]}),__exportStar=this&&this.__exportStar||function(e,i){for(var t in e)t!=="default"&&!Object.prototype.hasOwnProperty.call(i,t)&&__createBinding(i,e,t)},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommerceLayerStatic=exports.default=void 0;var commercelayer_1=require("./commercelayer");Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return __importDefault(commercelayer_1).default}});var static_1=require("./static");Object.defineProperty(exports,"CommerceLayerStatic",{enumerable:!0,get:function(){return static_1.CommerceLayerStatic}}),__exportStar(require("./model"),exports);
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1 +0,0 @@
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;
package/lib/cjs/model.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
package/lib/cjs/query.js DELETED
@@ -1 +0,0 @@
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,74 +0,0 @@
1
- import { ApiClientInitConfig } from './client';
2
- import { QueryParamsRetrieve, QueryParamsList } from './query';
3
- import { ResourceTypeLock } from './api';
4
- import { InterceptorManager } from './interceptor';
5
- declare type ResourceNull = {
6
- id: null;
7
- } & ResourceType;
8
- declare type ResourceRel = ResourceId | ResourceNull;
9
- declare type Metadata = {
10
- [key: string]: any;
11
- };
12
- interface ResourceType {
13
- readonly type: ResourceTypeLock;
14
- }
15
- interface ResourceId extends ResourceType {
16
- readonly id: string;
17
- }
18
- interface Resource extends ResourceId {
19
- reference?: string;
20
- reference_origin?: string;
21
- metadata?: Metadata;
22
- readonly created_at: string;
23
- readonly updated_at: string;
24
- }
25
- interface ResourceCreate {
26
- reference?: string;
27
- reference_origin?: string;
28
- metadata?: Metadata;
29
- }
30
- interface ResourceUpdate {
31
- readonly id: string;
32
- reference?: string;
33
- reference_origin?: string;
34
- metadata?: Metadata;
35
- }
36
- declare type ListMeta = {
37
- readonly pageCount: number;
38
- readonly recordCount: number;
39
- readonly currentPage: number;
40
- readonly recordsPerPage: number;
41
- };
42
- declare class ListResponse<R> extends Array<R> {
43
- readonly meta: ListMeta;
44
- constructor(meta: ListMeta, data: Array<R>);
45
- first(): R | undefined;
46
- last(): R | undefined;
47
- get(index: number): R | undefined;
48
- }
49
- export type { Metadata, ResourceType, ResourceId, Resource, ResourceCreate, ResourceUpdate, ListResponse, ResourceRel };
50
- declare type ResourceAdapterConfig = {};
51
- declare type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig;
52
- declare type ResourcesConfig = Partial<ResourcesInitConfig>;
53
- declare class ResourceAdapter {
54
- #private;
55
- constructor(config: ResourcesInitConfig);
56
- get interceptors(): InterceptorManager;
57
- private localConfig;
58
- config(config: ResourcesConfig): void;
59
- singleton<R extends Resource>(resource: ResourceType, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
60
- retrieve<R extends Resource>(resource: ResourceId, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
61
- list<R extends Resource>(resource: ResourceType, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<R>>;
62
- create<C extends ResourceCreate, R extends Resource>(resource: C & ResourceType, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
63
- update<U extends ResourceUpdate, R extends Resource>(resource: U & ResourceId, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
64
- delete(resource: ResourceId, options?: ResourcesConfig): Promise<void>;
65
- }
66
- declare abstract class ApiResource {
67
- static readonly TYPE: ResourceTypeLock;
68
- protected resources: ResourceAdapter;
69
- constructor(adapter: ResourceAdapter);
70
- abstract relationship(id: string | ResourceId | null): ResourceRel;
71
- abstract type(): string;
72
- }
73
- export default ResourceAdapter;
74
- export { ApiResource, ResourcesConfig, ResourcesInitConfig };
@@ -1 +0,0 @@
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,87 +0,0 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { Geocoder } from './geocoders';
4
- declare type AddressRel = ResourceRel & {
5
- type: typeof Addresses.TYPE;
6
- };
7
- declare type GeocoderRel = ResourceRel & {
8
- type: 'geocoders';
9
- };
10
- interface Address extends Resource {
11
- business?: boolean;
12
- first_name?: string;
13
- last_name?: string;
14
- company?: string;
15
- full_name?: string;
16
- line_1?: string;
17
- line_2?: string;
18
- city?: string;
19
- zip_code?: string;
20
- state_code?: string;
21
- country_code?: string;
22
- phone?: string;
23
- full_address?: string;
24
- name?: string;
25
- email?: string;
26
- notes?: string;
27
- lat?: number;
28
- lng?: number;
29
- is_localized?: boolean;
30
- is_geocoded?: boolean;
31
- provider_name?: string;
32
- map_url?: string;
33
- static_map_url?: string;
34
- billing_info?: string;
35
- geocoder?: Geocoder;
36
- }
37
- interface AddressCreate extends ResourceCreate {
38
- business?: boolean;
39
- first_name?: string;
40
- last_name?: string;
41
- company?: string;
42
- line_1: string;
43
- line_2?: string;
44
- city: string;
45
- zip_code?: string;
46
- state_code: string;
47
- country_code: string;
48
- phone: string;
49
- email?: string;
50
- notes?: string;
51
- lat?: number;
52
- lng?: number;
53
- billing_info?: string;
54
- geocoder?: GeocoderRel;
55
- }
56
- interface AddressUpdate extends ResourceUpdate {
57
- business?: boolean;
58
- first_name?: string;
59
- last_name?: string;
60
- company?: string;
61
- line_1?: string;
62
- line_2?: string;
63
- city?: string;
64
- zip_code?: string;
65
- state_code?: string;
66
- country_code?: string;
67
- phone?: string;
68
- email?: string;
69
- notes?: string;
70
- lat?: number;
71
- lng?: number;
72
- billing_info?: string;
73
- geocoder?: GeocoderRel;
74
- }
75
- declare class Addresses extends ApiResource {
76
- static readonly TYPE: 'addresses';
77
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Address>>;
78
- create(resource: AddressCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
79
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
80
- update(resource: AddressUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
81
- delete(id: string, options?: ResourcesConfig): Promise<void>;
82
- isAddress(resource: any): resource is Address;
83
- relationship(id: string | ResourceId | null): AddressRel;
84
- type(): string;
85
- }
86
- export default Addresses;
87
- export { Address, AddressCreate, AddressUpdate };
@@ -1 +0,0 @@
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 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Adjustments extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:Adjustments.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:Adjustments.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:Adjustments.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:Adjustments.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:Adjustments.TYPE,id:e},r)}isAdjustment(e){return e.type&&e.type===Adjustments.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Adjustments.TYPE}:{id:e.id,type:Adjustments.TYPE}}type(){return Adjustments.TYPE}}Adjustments.TYPE="adjustments",exports.default=Adjustments;
@@ -1,45 +0,0 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { PaymentMethod } from './payment_methods';
4
- import { AdyenPayment } from './adyen_payments';
5
- declare type AdyenGatewayRel = ResourceRel & {
6
- type: typeof AdyenGateways.TYPE;
7
- };
8
- declare type AdyenPaymentRel = ResourceRel & {
9
- type: 'adyen_payments';
10
- };
11
- interface AdyenGateway extends Resource {
12
- name?: string;
13
- live_url_prefix?: string;
14
- payment_methods?: PaymentMethod[];
15
- adyen_payments?: AdyenPayment[];
16
- }
17
- interface AdyenGatewayCreate extends ResourceCreate {
18
- name: string;
19
- merchant_account: string;
20
- api_key: string;
21
- public_key?: string;
22
- live_url_prefix: string;
23
- adyen_payments?: AdyenPaymentRel[];
24
- }
25
- interface AdyenGatewayUpdate extends ResourceUpdate {
26
- name?: string;
27
- merchant_account?: string;
28
- api_key?: string;
29
- public_key?: string;
30
- live_url_prefix?: string;
31
- adyen_payments?: AdyenPaymentRel[];
32
- }
33
- declare class AdyenGateways extends ApiResource {
34
- static readonly TYPE: 'adyen_gateways';
35
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<AdyenGateway>>;
36
- create(resource: AdyenGatewayCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<AdyenGateway>;
37
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<AdyenGateway>;
38
- update(resource: AdyenGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<AdyenGateway>;
39
- delete(id: string, options?: ResourcesConfig): Promise<void>;
40
- isAdyenGateway(resource: any): resource is AdyenGateway;
41
- relationship(id: string | ResourceId | null): AdyenGatewayRel;
42
- type(): string;
43
- }
44
- export default AdyenGateways;
45
- export { AdyenGateway, AdyenGatewayCreate, AdyenGatewayUpdate };
@@ -1 +0,0 @@
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 +0,0 @@
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 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Applications extends resource_1.ApiResource{async retrieve(e,r){return this.resources.singleton({type:Applications.TYPE},e,r)}isApplication(e){return e.type&&e.type===Applications.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Applications.TYPE}:{id:e.id,type:Applications.TYPE}}type(){return Applications.TYPE}}Applications.TYPE="application",exports.default=Applications;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Attachments extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:Attachments.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:Attachments.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:Attachments.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:Attachments.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:Attachments.TYPE,id:e},r)}isAttachment(e){return e.type&&e.type===Attachments.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Attachments.TYPE}:{id:e.id,type:Attachments.TYPE}}type(){return Attachments.TYPE}}Attachments.TYPE="attachments",exports.default=Attachments;
@@ -1 +0,0 @@
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,49 +0,0 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { TaxCategory } from './tax_categories';
4
- import { Market } from './markets';
5
- import { Attachment } from './attachments';
6
- declare type AvalaraAccountRel = ResourceRel & {
7
- type: typeof AvalaraAccounts.TYPE;
8
- };
9
- declare type TaxCategoryRel = ResourceRel & {
10
- type: 'tax_categories';
11
- };
12
- interface AvalaraAccount extends Resource {
13
- name?: string;
14
- username?: string;
15
- company_code?: string;
16
- ddp?: string;
17
- tax_categories?: TaxCategory[];
18
- markets?: Market[];
19
- attachments?: Attachment[];
20
- }
21
- interface AvalaraAccountCreate extends ResourceCreate {
22
- name: string;
23
- username: string;
24
- password: string;
25
- company_code: string;
26
- ddp?: string;
27
- tax_categories?: TaxCategoryRel[];
28
- }
29
- interface AvalaraAccountUpdate extends ResourceUpdate {
30
- name?: string;
31
- username?: string;
32
- password?: string;
33
- company_code?: string;
34
- ddp?: string;
35
- tax_categories?: TaxCategoryRel[];
36
- }
37
- declare class AvalaraAccounts extends ApiResource {
38
- static readonly TYPE: 'avalara_accounts';
39
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<AvalaraAccount>>;
40
- create(resource: AvalaraAccountCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<AvalaraAccount>;
41
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<AvalaraAccount>;
42
- update(resource: AvalaraAccountUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<AvalaraAccount>;
43
- delete(id: string, options?: ResourcesConfig): Promise<void>;
44
- isAvalaraAccount(resource: any): resource is AvalaraAccount;
45
- relationship(id: string | ResourceId | null): AvalaraAccountRel;
46
- type(): string;
47
- }
48
- export default AvalaraAccounts;
49
- export { AvalaraAccount, AvalaraAccountCreate, AvalaraAccountUpdate };
@@ -1 +0,0 @@
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;