@commercelayer/sdk 3.2.1 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (647) hide show
  1. package/lib/api.d.ts +1 -0
  2. package/lib/api.js +1 -0
  3. package/lib/cjs/api.d.ts +1 -1
  4. package/lib/cjs/client.js +1 -1
  5. package/lib/cjs/commercelayer.js +1 -1
  6. package/lib/cjs/common.js +1 -1
  7. package/lib/cjs/debug.d.ts +1 -3
  8. package/lib/cjs/debug.js +1 -1
  9. package/lib/cjs/error.d.ts +1 -26
  10. package/lib/cjs/index.js +1 -1
  11. package/lib/cjs/interceptor.d.ts +1 -19
  12. package/lib/cjs/jsonapi.js +1 -1
  13. package/lib/cjs/model.d.ts +1 -1
  14. package/lib/cjs/query.js +1 -1
  15. package/lib/cjs/resource.d.ts +6 -2
  16. package/lib/cjs/resource.js +1 -1
  17. package/lib/cjs/resources/addresses.d.ts +5 -5
  18. package/lib/cjs/resources/addresses.js +1 -1
  19. package/lib/cjs/resources/adjustments.d.ts +4 -4
  20. package/lib/cjs/resources/adjustments.js +1 -1
  21. package/lib/cjs/resources/adyen_gateways.d.ts +5 -5
  22. package/lib/cjs/resources/adyen_gateways.js +1 -1
  23. package/lib/cjs/resources/adyen_payments.d.ts +6 -5
  24. package/lib/cjs/resources/adyen_payments.js +1 -1
  25. package/lib/cjs/resources/application.d.ts +4 -4
  26. package/lib/cjs/resources/application.js +1 -1
  27. package/lib/cjs/resources/attachments.d.ts +34 -34
  28. package/lib/cjs/resources/attachments.js +1 -1
  29. package/lib/cjs/resources/authorizations.d.ts +4 -4
  30. package/lib/cjs/resources/authorizations.js +1 -1
  31. package/lib/cjs/resources/avalara_accounts.d.ts +5 -5
  32. package/lib/cjs/resources/avalara_accounts.js +1 -1
  33. package/lib/cjs/resources/billing_info_validation_rules.d.ts +5 -5
  34. package/lib/cjs/resources/billing_info_validation_rules.js +1 -1
  35. package/lib/cjs/resources/bing_geocoders.d.ts +4 -4
  36. package/lib/cjs/resources/bing_geocoders.js +1 -1
  37. package/lib/cjs/resources/braintree_gateways.d.ts +5 -5
  38. package/lib/cjs/resources/braintree_gateways.js +1 -1
  39. package/lib/cjs/resources/braintree_payments.d.ts +5 -5
  40. package/lib/cjs/resources/braintree_payments.js +1 -1
  41. package/lib/cjs/resources/bundles.d.ts +11 -6
  42. package/lib/cjs/resources/bundles.js +1 -1
  43. package/lib/cjs/resources/captures.d.ts +4 -4
  44. package/lib/cjs/resources/captures.js +1 -1
  45. package/lib/cjs/resources/carrier_accounts.d.ts +4 -4
  46. package/lib/cjs/resources/carrier_accounts.js +1 -1
  47. package/lib/cjs/resources/checkout_com_gateways.d.ts +5 -5
  48. package/lib/cjs/resources/checkout_com_gateways.js +1 -1
  49. package/lib/cjs/resources/checkout_com_payments.d.ts +13 -5
  50. package/lib/cjs/resources/checkout_com_payments.js +1 -1
  51. package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +11 -11
  52. package/lib/cjs/resources/coupon_codes_promotion_rules.js +1 -1
  53. package/lib/cjs/resources/coupon_recipients.d.ts +5 -5
  54. package/lib/cjs/resources/coupon_recipients.js +1 -1
  55. package/lib/cjs/resources/coupons.d.ts +5 -5
  56. package/lib/cjs/resources/coupons.js +1 -1
  57. package/lib/cjs/resources/customer_addresses.d.ts +6 -6
  58. package/lib/cjs/resources/customer_addresses.js +1 -1
  59. package/lib/cjs/resources/customer_groups.d.ts +4 -4
  60. package/lib/cjs/resources/customer_groups.js +1 -1
  61. package/lib/cjs/resources/customer_password_resets.d.ts +4 -4
  62. package/lib/cjs/resources/customer_password_resets.js +1 -1
  63. package/lib/cjs/resources/customer_payment_sources.d.ts +13 -13
  64. package/lib/cjs/resources/customer_payment_sources.js +1 -1
  65. package/lib/cjs/resources/customer_subscriptions.d.ts +4 -4
  66. package/lib/cjs/resources/customer_subscriptions.js +1 -1
  67. package/lib/cjs/resources/customers.d.ts +5 -5
  68. package/lib/cjs/resources/customers.js +1 -1
  69. package/lib/cjs/resources/delivery_lead_times.d.ts +6 -6
  70. package/lib/cjs/resources/delivery_lead_times.js +1 -1
  71. package/lib/cjs/resources/event_callbacks.d.ts +4 -4
  72. package/lib/cjs/resources/event_callbacks.js +1 -1
  73. package/lib/cjs/resources/external_gateways.d.ts +4 -4
  74. package/lib/cjs/resources/external_gateways.js +1 -1
  75. package/lib/cjs/resources/external_payments.d.ts +5 -5
  76. package/lib/cjs/resources/external_payments.js +1 -1
  77. package/lib/cjs/resources/external_promotions.d.ts +12 -9
  78. package/lib/cjs/resources/external_promotions.js +1 -1
  79. package/lib/cjs/resources/external_tax_calculators.d.ts +5 -5
  80. package/lib/cjs/resources/external_tax_calculators.js +1 -1
  81. package/lib/cjs/resources/fixed_amount_promotions.d.ts +12 -9
  82. package/lib/cjs/resources/fixed_amount_promotions.js +1 -1
  83. package/lib/cjs/resources/fixed_price_promotions.d.ts +13 -10
  84. package/lib/cjs/resources/fixed_price_promotions.js +1 -1
  85. package/lib/cjs/resources/free_gift_promotions.d.ts +13 -10
  86. package/lib/cjs/resources/free_gift_promotions.js +1 -1
  87. package/lib/cjs/resources/free_shipping_promotions.d.ts +12 -9
  88. package/lib/cjs/resources/free_shipping_promotions.js +1 -1
  89. package/lib/cjs/resources/geocoders.d.ts +4 -4
  90. package/lib/cjs/resources/geocoders.js +1 -1
  91. package/lib/cjs/resources/gift_card_recipients.d.ts +5 -5
  92. package/lib/cjs/resources/gift_card_recipients.js +1 -1
  93. package/lib/cjs/resources/gift_cards.d.ts +7 -7
  94. package/lib/cjs/resources/gift_cards.js +1 -1
  95. package/lib/cjs/resources/google_geocoders.d.ts +4 -4
  96. package/lib/cjs/resources/google_geocoders.js +1 -1
  97. package/lib/cjs/resources/imports.d.ts +4 -4
  98. package/lib/cjs/resources/imports.js +1 -1
  99. package/lib/cjs/resources/in_stock_subscriptions.d.ts +7 -7
  100. package/lib/cjs/resources/in_stock_subscriptions.js +1 -1
  101. package/lib/cjs/resources/inventory_models.d.ts +4 -4
  102. package/lib/cjs/resources/inventory_models.js +1 -1
  103. package/lib/cjs/resources/inventory_return_locations.d.ts +6 -6
  104. package/lib/cjs/resources/inventory_return_locations.js +1 -1
  105. package/lib/cjs/resources/inventory_stock_locations.d.ts +6 -6
  106. package/lib/cjs/resources/inventory_stock_locations.js +1 -1
  107. package/lib/cjs/resources/klarna_gateways.d.ts +5 -5
  108. package/lib/cjs/resources/klarna_gateways.js +1 -1
  109. package/lib/cjs/resources/klarna_payments.d.ts +5 -5
  110. package/lib/cjs/resources/klarna_payments.js +1 -1
  111. package/lib/cjs/resources/line_item_options.d.ts +6 -6
  112. package/lib/cjs/resources/line_item_options.js +1 -1
  113. package/lib/cjs/resources/line_items.d.ts +15 -15
  114. package/lib/cjs/resources/line_items.js +1 -1
  115. package/lib/cjs/resources/manual_gateways.d.ts +4 -4
  116. package/lib/cjs/resources/manual_gateways.js +1 -1
  117. package/lib/cjs/resources/manual_tax_calculators.d.ts +6 -6
  118. package/lib/cjs/resources/manual_tax_calculators.js +1 -1
  119. package/lib/cjs/resources/markets.d.ts +9 -9
  120. package/lib/cjs/resources/markets.js +1 -1
  121. package/lib/cjs/resources/merchants.d.ts +5 -5
  122. package/lib/cjs/resources/merchants.js +1 -1
  123. package/lib/cjs/resources/order_amount_promotion_rules.d.ts +10 -10
  124. package/lib/cjs/resources/order_amount_promotion_rules.js +1 -1
  125. package/lib/cjs/resources/order_copies.d.ts +5 -5
  126. package/lib/cjs/resources/order_copies.js +1 -1
  127. package/lib/cjs/resources/order_subscriptions.d.ts +6 -6
  128. package/lib/cjs/resources/order_subscriptions.js +1 -1
  129. package/lib/cjs/resources/order_validation_rules.d.ts +4 -4
  130. package/lib/cjs/resources/order_validation_rules.js +1 -1
  131. package/lib/cjs/resources/orders.d.ts +16 -16
  132. package/lib/cjs/resources/orders.js +1 -1
  133. package/lib/cjs/resources/organization.d.ts +4 -4
  134. package/lib/cjs/resources/organization.js +1 -1
  135. package/lib/cjs/resources/packages.d.ts +5 -5
  136. package/lib/cjs/resources/packages.js +1 -1
  137. package/lib/cjs/resources/parcel_line_items.d.ts +6 -6
  138. package/lib/cjs/resources/parcel_line_items.js +1 -1
  139. package/lib/cjs/resources/parcels.d.ts +6 -6
  140. package/lib/cjs/resources/parcels.js +1 -1
  141. package/lib/cjs/resources/payment_gateways.d.ts +4 -4
  142. package/lib/cjs/resources/payment_gateways.js +1 -1
  143. package/lib/cjs/resources/payment_methods.d.ts +10 -7
  144. package/lib/cjs/resources/payment_methods.js +1 -1
  145. package/lib/cjs/resources/paypal_gateways.d.ts +4 -6
  146. package/lib/cjs/resources/paypal_gateways.js +1 -1
  147. package/lib/cjs/resources/paypal_payments.d.ts +9 -5
  148. package/lib/cjs/resources/paypal_payments.js +1 -1
  149. package/lib/cjs/resources/percentage_discount_promotions.d.ts +13 -10
  150. package/lib/cjs/resources/percentage_discount_promotions.js +1 -1
  151. package/lib/cjs/resources/price_lists.d.ts +4 -4
  152. package/lib/cjs/resources/price_lists.js +1 -1
  153. package/lib/cjs/resources/prices.d.ts +6 -6
  154. package/lib/cjs/resources/prices.js +1 -1
  155. package/lib/cjs/resources/promotion_rules.d.ts +4 -4
  156. package/lib/cjs/resources/promotion_rules.js +1 -1
  157. package/lib/cjs/resources/promotions.d.ts +5 -4
  158. package/lib/cjs/resources/promotions.js +1 -1
  159. package/lib/cjs/resources/refunds.d.ts +4 -4
  160. package/lib/cjs/resources/refunds.js +1 -1
  161. package/lib/cjs/resources/return_line_items.d.ts +6 -6
  162. package/lib/cjs/resources/return_line_items.js +1 -1
  163. package/lib/cjs/resources/returns.d.ts +6 -6
  164. package/lib/cjs/resources/returns.js +1 -1
  165. package/lib/cjs/resources/shipments.d.ts +5 -5
  166. package/lib/cjs/resources/shipments.js +1 -1
  167. package/lib/cjs/resources/shipping_categories.d.ts +4 -4
  168. package/lib/cjs/resources/shipping_categories.js +1 -1
  169. package/lib/cjs/resources/shipping_methods.d.ts +11 -9
  170. package/lib/cjs/resources/shipping_methods.js +1 -1
  171. package/lib/cjs/resources/shipping_zones.d.ts +4 -4
  172. package/lib/cjs/resources/shipping_zones.js +1 -1
  173. package/lib/cjs/resources/sku_list_items.d.ts +6 -6
  174. package/lib/cjs/resources/sku_list_items.js +1 -1
  175. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +11 -11
  176. package/lib/cjs/resources/sku_list_promotion_rules.js +1 -1
  177. package/lib/cjs/resources/sku_lists.d.ts +4 -4
  178. package/lib/cjs/resources/sku_lists.js +1 -1
  179. package/lib/cjs/resources/sku_options.d.ts +9 -6
  180. package/lib/cjs/resources/sku_options.js +1 -1
  181. package/lib/cjs/resources/skus.d.ts +5 -5
  182. package/lib/cjs/resources/skus.js +1 -1
  183. package/lib/cjs/resources/stock_items.d.ts +6 -6
  184. package/lib/cjs/resources/stock_items.js +1 -1
  185. package/lib/cjs/resources/stock_line_items.d.ts +4 -4
  186. package/lib/cjs/resources/stock_line_items.js +1 -1
  187. package/lib/cjs/resources/stock_locations.d.ts +5 -5
  188. package/lib/cjs/resources/stock_locations.js +1 -1
  189. package/lib/cjs/resources/stock_transfers.d.ts +8 -8
  190. package/lib/cjs/resources/stock_transfers.js +1 -1
  191. package/lib/cjs/resources/stripe_gateways.d.ts +4 -4
  192. package/lib/cjs/resources/stripe_gateways.js +1 -1
  193. package/lib/cjs/resources/stripe_payments.d.ts +9 -5
  194. package/lib/cjs/resources/stripe_payments.js +1 -1
  195. package/lib/cjs/resources/tax_calculators.d.ts +4 -4
  196. package/lib/cjs/resources/tax_calculators.js +1 -1
  197. package/lib/cjs/resources/tax_categories.d.ts +9 -9
  198. package/lib/cjs/resources/tax_categories.js +1 -1
  199. package/lib/cjs/resources/tax_rules.d.ts +5 -5
  200. package/lib/cjs/resources/tax_rules.js +1 -1
  201. package/lib/cjs/resources/taxjar_accounts.d.ts +5 -5
  202. package/lib/cjs/resources/taxjar_accounts.js +1 -1
  203. package/lib/cjs/resources/transactions.d.ts +4 -4
  204. package/lib/cjs/resources/transactions.js +1 -1
  205. package/lib/cjs/resources/voids.d.ts +4 -4
  206. package/lib/cjs/resources/voids.js +1 -1
  207. package/lib/cjs/resources/webhooks.d.ts +4 -4
  208. package/lib/cjs/resources/webhooks.js +1 -1
  209. package/lib/cjs/resources/wire_transfers.d.ts +5 -5
  210. package/lib/cjs/resources/wire_transfers.js +1 -1
  211. package/lib/cjs/static.js +1 -1
  212. package/lib/cjs/util.d.ts +1 -3
  213. package/lib/client.d.ts +2 -0
  214. package/lib/client.js +1 -0
  215. package/lib/commercelayer.d.ts +1 -0
  216. package/lib/commercelayer.js +1 -0
  217. package/lib/common.d.ts +1 -0
  218. package/lib/common.js +1 -0
  219. package/lib/config.d.ts +1 -0
  220. package/lib/config.js +1 -0
  221. package/lib/debug.d.ts +1 -0
  222. package/lib/debug.js +1 -0
  223. package/lib/error.d.ts +1 -0
  224. package/lib/error.js +1 -0
  225. package/lib/esm/api.d.ts +1 -1
  226. package/lib/esm/client.js +1 -1
  227. package/lib/esm/commercelayer.js +1 -1
  228. package/lib/esm/common.js +1 -1
  229. package/lib/esm/debug.d.ts +1 -3
  230. package/lib/esm/debug.js +1 -1
  231. package/lib/esm/error.d.ts +1 -26
  232. package/lib/esm/error.js +1 -1
  233. package/lib/esm/interceptor.d.ts +1 -19
  234. package/lib/esm/jsonapi.js +1 -1
  235. package/lib/esm/model.d.ts +1 -1
  236. package/lib/esm/query.js +1 -1
  237. package/lib/esm/resource.d.ts +6 -2
  238. package/lib/esm/resource.js +1 -1
  239. package/lib/esm/resources/addresses.d.ts +5 -5
  240. package/lib/esm/resources/addresses.js +1 -1
  241. package/lib/esm/resources/adjustments.d.ts +4 -4
  242. package/lib/esm/resources/adjustments.js +1 -1
  243. package/lib/esm/resources/adyen_gateways.d.ts +5 -5
  244. package/lib/esm/resources/adyen_gateways.js +1 -1
  245. package/lib/esm/resources/adyen_payments.d.ts +6 -5
  246. package/lib/esm/resources/adyen_payments.js +1 -1
  247. package/lib/esm/resources/application.d.ts +4 -4
  248. package/lib/esm/resources/application.js +1 -1
  249. package/lib/esm/resources/attachments.d.ts +34 -34
  250. package/lib/esm/resources/attachments.js +1 -1
  251. package/lib/esm/resources/authorizations.d.ts +4 -4
  252. package/lib/esm/resources/authorizations.js +1 -1
  253. package/lib/esm/resources/avalara_accounts.d.ts +5 -5
  254. package/lib/esm/resources/avalara_accounts.js +1 -1
  255. package/lib/esm/resources/billing_info_validation_rules.d.ts +5 -5
  256. package/lib/esm/resources/billing_info_validation_rules.js +1 -1
  257. package/lib/esm/resources/bing_geocoders.d.ts +4 -4
  258. package/lib/esm/resources/bing_geocoders.js +1 -1
  259. package/lib/esm/resources/braintree_gateways.d.ts +5 -5
  260. package/lib/esm/resources/braintree_gateways.js +1 -1
  261. package/lib/esm/resources/braintree_payments.d.ts +5 -5
  262. package/lib/esm/resources/braintree_payments.js +1 -1
  263. package/lib/esm/resources/bundles.d.ts +11 -6
  264. package/lib/esm/resources/bundles.js +1 -1
  265. package/lib/esm/resources/captures.d.ts +4 -4
  266. package/lib/esm/resources/captures.js +1 -1
  267. package/lib/esm/resources/carrier_accounts.d.ts +4 -4
  268. package/lib/esm/resources/carrier_accounts.js +1 -1
  269. package/lib/esm/resources/checkout_com_gateways.d.ts +5 -5
  270. package/lib/esm/resources/checkout_com_gateways.js +1 -1
  271. package/lib/esm/resources/checkout_com_payments.d.ts +13 -5
  272. package/lib/esm/resources/checkout_com_payments.js +1 -1
  273. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +11 -11
  274. package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -1
  275. package/lib/esm/resources/coupon_recipients.d.ts +5 -5
  276. package/lib/esm/resources/coupon_recipients.js +1 -1
  277. package/lib/esm/resources/coupons.d.ts +5 -5
  278. package/lib/esm/resources/coupons.js +1 -1
  279. package/lib/esm/resources/customer_addresses.d.ts +6 -6
  280. package/lib/esm/resources/customer_addresses.js +1 -1
  281. package/lib/esm/resources/customer_groups.d.ts +4 -4
  282. package/lib/esm/resources/customer_groups.js +1 -1
  283. package/lib/esm/resources/customer_password_resets.d.ts +4 -4
  284. package/lib/esm/resources/customer_password_resets.js +1 -1
  285. package/lib/esm/resources/customer_payment_sources.d.ts +13 -13
  286. package/lib/esm/resources/customer_payment_sources.js +1 -1
  287. package/lib/esm/resources/customer_subscriptions.d.ts +4 -4
  288. package/lib/esm/resources/customer_subscriptions.js +1 -1
  289. package/lib/esm/resources/customers.d.ts +5 -5
  290. package/lib/esm/resources/customers.js +1 -1
  291. package/lib/esm/resources/delivery_lead_times.d.ts +6 -6
  292. package/lib/esm/resources/delivery_lead_times.js +1 -1
  293. package/lib/esm/resources/event_callbacks.d.ts +4 -4
  294. package/lib/esm/resources/event_callbacks.js +1 -1
  295. package/lib/esm/resources/external_gateways.d.ts +4 -4
  296. package/lib/esm/resources/external_gateways.js +1 -1
  297. package/lib/esm/resources/external_payments.d.ts +5 -5
  298. package/lib/esm/resources/external_payments.js +1 -1
  299. package/lib/esm/resources/external_promotions.d.ts +12 -9
  300. package/lib/esm/resources/external_promotions.js +1 -1
  301. package/lib/esm/resources/external_tax_calculators.d.ts +5 -5
  302. package/lib/esm/resources/external_tax_calculators.js +1 -1
  303. package/lib/esm/resources/fixed_amount_promotions.d.ts +12 -9
  304. package/lib/esm/resources/fixed_amount_promotions.js +1 -1
  305. package/lib/esm/resources/fixed_price_promotions.d.ts +13 -10
  306. package/lib/esm/resources/fixed_price_promotions.js +1 -1
  307. package/lib/esm/resources/free_gift_promotions.d.ts +13 -10
  308. package/lib/esm/resources/free_gift_promotions.js +1 -1
  309. package/lib/esm/resources/free_shipping_promotions.d.ts +12 -9
  310. package/lib/esm/resources/free_shipping_promotions.js +1 -1
  311. package/lib/esm/resources/geocoders.d.ts +4 -4
  312. package/lib/esm/resources/geocoders.js +1 -1
  313. package/lib/esm/resources/gift_card_recipients.d.ts +5 -5
  314. package/lib/esm/resources/gift_card_recipients.js +1 -1
  315. package/lib/esm/resources/gift_cards.d.ts +7 -7
  316. package/lib/esm/resources/gift_cards.js +1 -1
  317. package/lib/esm/resources/google_geocoders.d.ts +4 -4
  318. package/lib/esm/resources/google_geocoders.js +1 -1
  319. package/lib/esm/resources/imports.d.ts +4 -4
  320. package/lib/esm/resources/imports.js +1 -1
  321. package/lib/esm/resources/in_stock_subscriptions.d.ts +7 -7
  322. package/lib/esm/resources/in_stock_subscriptions.js +1 -1
  323. package/lib/esm/resources/inventory_models.d.ts +4 -4
  324. package/lib/esm/resources/inventory_models.js +1 -1
  325. package/lib/esm/resources/inventory_return_locations.d.ts +6 -6
  326. package/lib/esm/resources/inventory_return_locations.js +1 -1
  327. package/lib/esm/resources/inventory_stock_locations.d.ts +6 -6
  328. package/lib/esm/resources/inventory_stock_locations.js +1 -1
  329. package/lib/esm/resources/klarna_gateways.d.ts +5 -5
  330. package/lib/esm/resources/klarna_gateways.js +1 -1
  331. package/lib/esm/resources/klarna_payments.d.ts +5 -5
  332. package/lib/esm/resources/klarna_payments.js +1 -1
  333. package/lib/esm/resources/line_item_options.d.ts +6 -6
  334. package/lib/esm/resources/line_item_options.js +1 -1
  335. package/lib/esm/resources/line_items.d.ts +15 -15
  336. package/lib/esm/resources/line_items.js +1 -1
  337. package/lib/esm/resources/manual_gateways.d.ts +4 -4
  338. package/lib/esm/resources/manual_gateways.js +1 -1
  339. package/lib/esm/resources/manual_tax_calculators.d.ts +6 -6
  340. package/lib/esm/resources/manual_tax_calculators.js +1 -1
  341. package/lib/esm/resources/markets.d.ts +9 -9
  342. package/lib/esm/resources/markets.js +1 -1
  343. package/lib/esm/resources/merchants.d.ts +5 -5
  344. package/lib/esm/resources/merchants.js +1 -1
  345. package/lib/esm/resources/order_amount_promotion_rules.d.ts +10 -10
  346. package/lib/esm/resources/order_amount_promotion_rules.js +1 -1
  347. package/lib/esm/resources/order_copies.d.ts +5 -5
  348. package/lib/esm/resources/order_copies.js +1 -1
  349. package/lib/esm/resources/order_subscriptions.d.ts +6 -6
  350. package/lib/esm/resources/order_subscriptions.js +1 -1
  351. package/lib/esm/resources/order_validation_rules.d.ts +4 -4
  352. package/lib/esm/resources/order_validation_rules.js +1 -1
  353. package/lib/esm/resources/orders.d.ts +16 -16
  354. package/lib/esm/resources/orders.js +1 -1
  355. package/lib/esm/resources/organization.d.ts +4 -4
  356. package/lib/esm/resources/organization.js +1 -1
  357. package/lib/esm/resources/packages.d.ts +5 -5
  358. package/lib/esm/resources/packages.js +1 -1
  359. package/lib/esm/resources/parcel_line_items.d.ts +6 -6
  360. package/lib/esm/resources/parcel_line_items.js +1 -1
  361. package/lib/esm/resources/parcels.d.ts +6 -6
  362. package/lib/esm/resources/parcels.js +1 -1
  363. package/lib/esm/resources/payment_gateways.d.ts +4 -4
  364. package/lib/esm/resources/payment_gateways.js +1 -1
  365. package/lib/esm/resources/payment_methods.d.ts +10 -7
  366. package/lib/esm/resources/payment_methods.js +1 -1
  367. package/lib/esm/resources/paypal_gateways.d.ts +4 -6
  368. package/lib/esm/resources/paypal_gateways.js +1 -1
  369. package/lib/esm/resources/paypal_payments.d.ts +9 -5
  370. package/lib/esm/resources/paypal_payments.js +1 -1
  371. package/lib/esm/resources/percentage_discount_promotions.d.ts +13 -10
  372. package/lib/esm/resources/percentage_discount_promotions.js +1 -1
  373. package/lib/esm/resources/price_lists.d.ts +4 -4
  374. package/lib/esm/resources/price_lists.js +1 -1
  375. package/lib/esm/resources/prices.d.ts +6 -6
  376. package/lib/esm/resources/prices.js +1 -1
  377. package/lib/esm/resources/promotion_rules.d.ts +4 -4
  378. package/lib/esm/resources/promotion_rules.js +1 -1
  379. package/lib/esm/resources/promotions.d.ts +5 -4
  380. package/lib/esm/resources/promotions.js +1 -1
  381. package/lib/esm/resources/refunds.d.ts +4 -4
  382. package/lib/esm/resources/refunds.js +1 -1
  383. package/lib/esm/resources/return_line_items.d.ts +6 -6
  384. package/lib/esm/resources/return_line_items.js +1 -1
  385. package/lib/esm/resources/returns.d.ts +6 -6
  386. package/lib/esm/resources/returns.js +1 -1
  387. package/lib/esm/resources/shipments.d.ts +5 -5
  388. package/lib/esm/resources/shipments.js +1 -1
  389. package/lib/esm/resources/shipping_categories.d.ts +4 -4
  390. package/lib/esm/resources/shipping_categories.js +1 -1
  391. package/lib/esm/resources/shipping_methods.d.ts +11 -9
  392. package/lib/esm/resources/shipping_methods.js +1 -1
  393. package/lib/esm/resources/shipping_zones.d.ts +4 -4
  394. package/lib/esm/resources/shipping_zones.js +1 -1
  395. package/lib/esm/resources/sku_list_items.d.ts +6 -6
  396. package/lib/esm/resources/sku_list_items.js +1 -1
  397. package/lib/esm/resources/sku_list_promotion_rules.d.ts +11 -11
  398. package/lib/esm/resources/sku_list_promotion_rules.js +1 -1
  399. package/lib/esm/resources/sku_lists.d.ts +4 -4
  400. package/lib/esm/resources/sku_lists.js +1 -1
  401. package/lib/esm/resources/sku_options.d.ts +9 -6
  402. package/lib/esm/resources/sku_options.js +1 -1
  403. package/lib/esm/resources/skus.d.ts +5 -5
  404. package/lib/esm/resources/skus.js +1 -1
  405. package/lib/esm/resources/stock_items.d.ts +6 -6
  406. package/lib/esm/resources/stock_items.js +1 -1
  407. package/lib/esm/resources/stock_line_items.d.ts +4 -4
  408. package/lib/esm/resources/stock_line_items.js +1 -1
  409. package/lib/esm/resources/stock_locations.d.ts +5 -5
  410. package/lib/esm/resources/stock_locations.js +1 -1
  411. package/lib/esm/resources/stock_transfers.d.ts +8 -8
  412. package/lib/esm/resources/stock_transfers.js +1 -1
  413. package/lib/esm/resources/stripe_gateways.d.ts +4 -4
  414. package/lib/esm/resources/stripe_gateways.js +1 -1
  415. package/lib/esm/resources/stripe_payments.d.ts +9 -5
  416. package/lib/esm/resources/stripe_payments.js +1 -1
  417. package/lib/esm/resources/tax_calculators.d.ts +4 -4
  418. package/lib/esm/resources/tax_calculators.js +1 -1
  419. package/lib/esm/resources/tax_categories.d.ts +9 -9
  420. package/lib/esm/resources/tax_categories.js +1 -1
  421. package/lib/esm/resources/tax_rules.d.ts +5 -5
  422. package/lib/esm/resources/tax_rules.js +1 -1
  423. package/lib/esm/resources/taxjar_accounts.d.ts +5 -5
  424. package/lib/esm/resources/taxjar_accounts.js +1 -1
  425. package/lib/esm/resources/transactions.d.ts +4 -4
  426. package/lib/esm/resources/transactions.js +1 -1
  427. package/lib/esm/resources/voids.d.ts +4 -4
  428. package/lib/esm/resources/voids.js +1 -1
  429. package/lib/esm/resources/webhooks.d.ts +4 -4
  430. package/lib/esm/resources/webhooks.js +1 -1
  431. package/lib/esm/resources/wire_transfers.d.ts +5 -5
  432. package/lib/esm/resources/wire_transfers.js +1 -1
  433. package/lib/esm/static.js +1 -1
  434. package/lib/esm/util.d.ts +1 -3
  435. package/lib/index.d.ts +1 -0
  436. package/lib/index.js +1 -0
  437. package/lib/interceptor.d.ts +1 -0
  438. package/lib/interceptor.js +1 -0
  439. package/lib/jsonapi.d.ts +1 -0
  440. package/lib/jsonapi.js +1 -0
  441. package/lib/model.d.ts +1 -0
  442. package/lib/model.js +1 -0
  443. package/lib/query.d.ts +1 -0
  444. package/lib/query.js +1 -0
  445. package/lib/resource.d.ts +1 -0
  446. package/lib/resource.js +1 -0
  447. package/lib/resources/addresses.d.ts +1 -0
  448. package/lib/resources/addresses.js +1 -0
  449. package/lib/resources/adjustments.d.ts +1 -0
  450. package/lib/resources/adjustments.js +1 -0
  451. package/lib/resources/adyen_gateways.d.ts +1 -0
  452. package/lib/resources/adyen_gateways.js +1 -0
  453. package/lib/resources/adyen_payments.d.ts +1 -0
  454. package/lib/resources/adyen_payments.js +1 -0
  455. package/lib/resources/application.d.ts +1 -0
  456. package/lib/resources/application.js +1 -0
  457. package/lib/resources/attachments.d.ts +1 -0
  458. package/lib/resources/attachments.js +1 -0
  459. package/lib/resources/authorizations.d.ts +1 -0
  460. package/lib/resources/authorizations.js +1 -0
  461. package/lib/resources/avalara_accounts.d.ts +1 -0
  462. package/lib/resources/avalara_accounts.js +1 -0
  463. package/lib/resources/billing_info_validation_rules.d.ts +1 -0
  464. package/lib/resources/billing_info_validation_rules.js +1 -0
  465. package/lib/resources/bing_geocoders.d.ts +1 -0
  466. package/lib/resources/bing_geocoders.js +1 -0
  467. package/lib/resources/braintree_gateways.d.ts +1 -0
  468. package/lib/resources/braintree_gateways.js +1 -0
  469. package/lib/resources/braintree_payments.d.ts +1 -0
  470. package/lib/resources/braintree_payments.js +1 -0
  471. package/lib/resources/bundles.d.ts +1 -0
  472. package/lib/resources/bundles.js +1 -0
  473. package/lib/resources/captures.d.ts +1 -0
  474. package/lib/resources/captures.js +1 -0
  475. package/lib/resources/carrier_accounts.d.ts +1 -0
  476. package/lib/resources/carrier_accounts.js +1 -0
  477. package/lib/resources/checkout_com_gateways.d.ts +1 -0
  478. package/lib/resources/checkout_com_gateways.js +1 -0
  479. package/lib/resources/checkout_com_payments.d.ts +1 -0
  480. package/lib/resources/checkout_com_payments.js +1 -0
  481. package/lib/resources/coupon_codes_promotion_rules.d.ts +1 -0
  482. package/lib/resources/coupon_codes_promotion_rules.js +1 -0
  483. package/lib/resources/coupon_recipients.d.ts +1 -0
  484. package/lib/resources/coupon_recipients.js +1 -0
  485. package/lib/resources/coupons.d.ts +1 -0
  486. package/lib/resources/coupons.js +1 -0
  487. package/lib/resources/customer_addresses.d.ts +1 -0
  488. package/lib/resources/customer_addresses.js +1 -0
  489. package/lib/resources/customer_groups.d.ts +1 -0
  490. package/lib/resources/customer_groups.js +1 -0
  491. package/lib/resources/customer_password_resets.d.ts +1 -0
  492. package/lib/resources/customer_password_resets.js +1 -0
  493. package/lib/resources/customer_payment_sources.d.ts +1 -0
  494. package/lib/resources/customer_payment_sources.js +1 -0
  495. package/lib/resources/customer_subscriptions.d.ts +1 -0
  496. package/lib/resources/customer_subscriptions.js +1 -0
  497. package/lib/resources/customers.d.ts +1 -0
  498. package/lib/resources/customers.js +1 -0
  499. package/lib/resources/delivery_lead_times.d.ts +1 -0
  500. package/lib/resources/delivery_lead_times.js +1 -0
  501. package/lib/resources/event_callbacks.d.ts +1 -0
  502. package/lib/resources/event_callbacks.js +1 -0
  503. package/lib/resources/external_gateways.d.ts +1 -0
  504. package/lib/resources/external_gateways.js +1 -0
  505. package/lib/resources/external_payments.d.ts +1 -0
  506. package/lib/resources/external_payments.js +1 -0
  507. package/lib/resources/external_promotions.d.ts +1 -0
  508. package/lib/resources/external_promotions.js +1 -0
  509. package/lib/resources/external_tax_calculators.d.ts +1 -0
  510. package/lib/resources/external_tax_calculators.js +1 -0
  511. package/lib/resources/fixed_amount_promotions.d.ts +1 -0
  512. package/lib/resources/fixed_amount_promotions.js +1 -0
  513. package/lib/resources/fixed_price_promotions.d.ts +1 -0
  514. package/lib/resources/fixed_price_promotions.js +1 -0
  515. package/lib/resources/free_gift_promotions.d.ts +1 -0
  516. package/lib/resources/free_gift_promotions.js +1 -0
  517. package/lib/resources/free_shipping_promotions.d.ts +1 -0
  518. package/lib/resources/free_shipping_promotions.js +1 -0
  519. package/lib/resources/geocoders.d.ts +1 -0
  520. package/lib/resources/geocoders.js +1 -0
  521. package/lib/resources/gift_card_recipients.d.ts +1 -0
  522. package/lib/resources/gift_card_recipients.js +1 -0
  523. package/lib/resources/gift_cards.d.ts +1 -0
  524. package/lib/resources/gift_cards.js +1 -0
  525. package/lib/resources/google_geocoders.d.ts +1 -0
  526. package/lib/resources/google_geocoders.js +1 -0
  527. package/lib/resources/imports.d.ts +1 -0
  528. package/lib/resources/imports.js +1 -0
  529. package/lib/resources/in_stock_subscriptions.d.ts +1 -0
  530. package/lib/resources/in_stock_subscriptions.js +1 -0
  531. package/lib/resources/inventory_models.d.ts +1 -0
  532. package/lib/resources/inventory_models.js +1 -0
  533. package/lib/resources/inventory_return_locations.d.ts +1 -0
  534. package/lib/resources/inventory_return_locations.js +1 -0
  535. package/lib/resources/inventory_stock_locations.d.ts +1 -0
  536. package/lib/resources/inventory_stock_locations.js +1 -0
  537. package/lib/resources/klarna_gateways.d.ts +1 -0
  538. package/lib/resources/klarna_gateways.js +1 -0
  539. package/lib/resources/klarna_payments.d.ts +1 -0
  540. package/lib/resources/klarna_payments.js +1 -0
  541. package/lib/resources/line_item_options.d.ts +1 -0
  542. package/lib/resources/line_item_options.js +1 -0
  543. package/lib/resources/line_items.d.ts +1 -0
  544. package/lib/resources/line_items.js +1 -0
  545. package/lib/resources/manual_gateways.d.ts +1 -0
  546. package/lib/resources/manual_gateways.js +1 -0
  547. package/lib/resources/manual_tax_calculators.d.ts +1 -0
  548. package/lib/resources/manual_tax_calculators.js +1 -0
  549. package/lib/resources/markets.d.ts +1 -0
  550. package/lib/resources/markets.js +1 -0
  551. package/lib/resources/merchants.d.ts +1 -0
  552. package/lib/resources/merchants.js +1 -0
  553. package/lib/resources/order_amount_promotion_rules.d.ts +1 -0
  554. package/lib/resources/order_amount_promotion_rules.js +1 -0
  555. package/lib/resources/order_copies.d.ts +1 -0
  556. package/lib/resources/order_copies.js +1 -0
  557. package/lib/resources/order_subscriptions.d.ts +1 -0
  558. package/lib/resources/order_subscriptions.js +1 -0
  559. package/lib/resources/order_validation_rules.d.ts +1 -0
  560. package/lib/resources/order_validation_rules.js +1 -0
  561. package/lib/resources/orders.d.ts +1 -0
  562. package/lib/resources/orders.js +1 -0
  563. package/lib/resources/organization.d.ts +1 -0
  564. package/lib/resources/organization.js +1 -0
  565. package/lib/resources/packages.d.ts +1 -0
  566. package/lib/resources/packages.js +1 -0
  567. package/lib/resources/parcel_line_items.d.ts +1 -0
  568. package/lib/resources/parcel_line_items.js +1 -0
  569. package/lib/resources/parcels.d.ts +1 -0
  570. package/lib/resources/parcels.js +1 -0
  571. package/lib/resources/payment_gateways.d.ts +1 -0
  572. package/lib/resources/payment_gateways.js +1 -0
  573. package/lib/resources/payment_methods.d.ts +1 -0
  574. package/lib/resources/payment_methods.js +1 -0
  575. package/lib/resources/paypal_gateways.d.ts +1 -0
  576. package/lib/resources/paypal_gateways.js +1 -0
  577. package/lib/resources/paypal_payments.d.ts +1 -0
  578. package/lib/resources/paypal_payments.js +1 -0
  579. package/lib/resources/percentage_discount_promotions.d.ts +1 -0
  580. package/lib/resources/percentage_discount_promotions.js +1 -0
  581. package/lib/resources/price_lists.d.ts +1 -0
  582. package/lib/resources/price_lists.js +1 -0
  583. package/lib/resources/prices.d.ts +1 -0
  584. package/lib/resources/prices.js +1 -0
  585. package/lib/resources/promotion_rules.d.ts +1 -0
  586. package/lib/resources/promotion_rules.js +1 -0
  587. package/lib/resources/promotions.d.ts +1 -0
  588. package/lib/resources/promotions.js +1 -0
  589. package/lib/resources/refunds.d.ts +1 -0
  590. package/lib/resources/refunds.js +1 -0
  591. package/lib/resources/return_line_items.d.ts +1 -0
  592. package/lib/resources/return_line_items.js +1 -0
  593. package/lib/resources/returns.d.ts +1 -0
  594. package/lib/resources/returns.js +1 -0
  595. package/lib/resources/shipments.d.ts +1 -0
  596. package/lib/resources/shipments.js +1 -0
  597. package/lib/resources/shipping_categories.d.ts +1 -0
  598. package/lib/resources/shipping_categories.js +1 -0
  599. package/lib/resources/shipping_methods.d.ts +1 -0
  600. package/lib/resources/shipping_methods.js +1 -0
  601. package/lib/resources/shipping_zones.d.ts +1 -0
  602. package/lib/resources/shipping_zones.js +1 -0
  603. package/lib/resources/sku_list_items.d.ts +1 -0
  604. package/lib/resources/sku_list_items.js +1 -0
  605. package/lib/resources/sku_list_promotion_rules.d.ts +1 -0
  606. package/lib/resources/sku_list_promotion_rules.js +1 -0
  607. package/lib/resources/sku_lists.d.ts +1 -0
  608. package/lib/resources/sku_lists.js +1 -0
  609. package/lib/resources/sku_options.d.ts +1 -0
  610. package/lib/resources/sku_options.js +1 -0
  611. package/lib/resources/skus.d.ts +1 -0
  612. package/lib/resources/skus.js +1 -0
  613. package/lib/resources/stock_items.d.ts +1 -0
  614. package/lib/resources/stock_items.js +1 -0
  615. package/lib/resources/stock_line_items.d.ts +1 -0
  616. package/lib/resources/stock_line_items.js +1 -0
  617. package/lib/resources/stock_locations.d.ts +1 -0
  618. package/lib/resources/stock_locations.js +1 -0
  619. package/lib/resources/stock_transfers.d.ts +1 -0
  620. package/lib/resources/stock_transfers.js +1 -0
  621. package/lib/resources/stripe_gateways.d.ts +1 -0
  622. package/lib/resources/stripe_gateways.js +1 -0
  623. package/lib/resources/stripe_payments.d.ts +1 -0
  624. package/lib/resources/stripe_payments.js +1 -0
  625. package/lib/resources/tax_calculators.d.ts +1 -0
  626. package/lib/resources/tax_calculators.js +1 -0
  627. package/lib/resources/tax_categories.d.ts +1 -0
  628. package/lib/resources/tax_categories.js +1 -0
  629. package/lib/resources/tax_rules.d.ts +1 -0
  630. package/lib/resources/tax_rules.js +1 -0
  631. package/lib/resources/taxjar_accounts.d.ts +1 -0
  632. package/lib/resources/taxjar_accounts.js +1 -0
  633. package/lib/resources/transactions.d.ts +1 -0
  634. package/lib/resources/transactions.js +1 -0
  635. package/lib/resources/voids.d.ts +1 -0
  636. package/lib/resources/voids.js +1 -0
  637. package/lib/resources/webhooks.d.ts +1 -0
  638. package/lib/resources/webhooks.js +1 -0
  639. package/lib/resources/wire_transfers.d.ts +1 -0
  640. package/lib/resources/wire_transfers.js +1 -0
  641. package/lib/static.d.ts +1 -0
  642. package/lib/static.js +1 -0
  643. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  644. package/lib/tsconfig.tsbuildinfo +1 -1
  645. package/lib/util.d.ts +2 -0
  646. package/lib/util.js +1 -0
  647. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class TaxCategories extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:TaxCategories.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:TaxCategories.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:TaxCategories.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:TaxCategories.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:TaxCategories.TYPE,id:e},t)}isTaxCategory(e){return e.type&&e.type===TaxCategories.TYPE}relationship(e){return typeof e=="string"?{id:e,type:TaxCategories.TYPE}:{id:e.id,type:TaxCategories.TYPE}}type(){return TaxCategories.TYPE}}TaxCategories.TYPE="tax_categories",exports.default=TaxCategories;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class TaxCategories extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:TaxCategories.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:TaxCategories.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:TaxCategories.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:TaxCategories.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:TaxCategories.TYPE,id:e},t)}isTaxCategory(e){return e.type&&e.type===TaxCategories.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:TaxCategories.TYPE}:{id:e.id,type:TaxCategories.TYPE}}type(){return TaxCategories.TYPE}}TaxCategories.TYPE="tax_categories",exports.default=TaxCategories;
@@ -1,10 +1,10 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { ManualTaxCalculator } from './manual_tax_calculators';
4
- declare type TaxRuleRel = ResourceId & {
4
+ declare type TaxRuleRel = ResourceRel & {
5
5
  type: typeof TaxRules.TYPE;
6
6
  };
7
- declare type ManualTaxCalculatorRel = ResourceId & {
7
+ declare type ManualTaxCalculatorRel = ResourceRel & {
8
8
  type: 'manual_tax_calculators';
9
9
  };
10
10
  interface TaxRule extends Resource {
@@ -61,7 +61,7 @@ declare class TaxRules extends ApiResource {
61
61
  update(resource: TaxRuleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxRule>;
62
62
  delete(id: string, options?: ResourcesConfig): Promise<void>;
63
63
  isTaxRule(resource: any): resource is TaxRule;
64
- relationship(id: string | ResourceId): TaxRuleRel;
64
+ relationship(id: string | ResourceId | null): TaxRuleRel;
65
65
  type(): string;
66
66
  }
67
67
  export default TaxRules;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class TaxRules extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:TaxRules.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:TaxRules.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:TaxRules.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:TaxRules.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:TaxRules.TYPE,id:e},t)}isTaxRule(e){return e.type&&e.type===TaxRules.TYPE}relationship(e){return typeof e=="string"?{id:e,type:TaxRules.TYPE}:{id:e.id,type:TaxRules.TYPE}}type(){return TaxRules.TYPE}}TaxRules.TYPE="tax_rules",exports.default=TaxRules;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class TaxRules extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:TaxRules.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:TaxRules.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:TaxRules.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:TaxRules.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:TaxRules.TYPE,id:e},t)}isTaxRule(e){return e.type&&e.type===TaxRules.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:TaxRules.TYPE}:{id:e.id,type:TaxRules.TYPE}}type(){return TaxRules.TYPE}}TaxRules.TYPE="tax_rules",exports.default=TaxRules;
@@ -1,12 +1,12 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { TaxCategory } from './tax_categories';
4
4
  import { Market } from './markets';
5
5
  import { Attachment } from './attachments';
6
- declare type TaxjarAccountRel = ResourceId & {
6
+ declare type TaxjarAccountRel = ResourceRel & {
7
7
  type: typeof TaxjarAccounts.TYPE;
8
8
  };
9
- declare type TaxCategoryRel = ResourceId & {
9
+ declare type TaxCategoryRel = ResourceRel & {
10
10
  type: 'tax_categories';
11
11
  };
12
12
  interface TaxjarAccount extends Resource {
@@ -33,7 +33,7 @@ declare class TaxjarAccounts extends ApiResource {
33
33
  update(resource: TaxjarAccountUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxjarAccount>;
34
34
  delete(id: string, options?: ResourcesConfig): Promise<void>;
35
35
  isTaxjarAccount(resource: any): resource is TaxjarAccount;
36
- relationship(id: string | ResourceId): TaxjarAccountRel;
36
+ relationship(id: string | ResourceId | null): TaxjarAccountRel;
37
37
  type(): string;
38
38
  }
39
39
  export default TaxjarAccounts;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class TaxjarAccounts extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:TaxjarAccounts.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:TaxjarAccounts.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:TaxjarAccounts.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:TaxjarAccounts.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:TaxjarAccounts.TYPE,id:e},t)}isTaxjarAccount(e){return e.type&&e.type===TaxjarAccounts.TYPE}relationship(e){return typeof e=="string"?{id:e,type:TaxjarAccounts.TYPE}:{id:e.id,type:TaxjarAccounts.TYPE}}type(){return TaxjarAccounts.TYPE}}TaxjarAccounts.TYPE="taxjar_accounts",exports.default=TaxjarAccounts;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class TaxjarAccounts extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:TaxjarAccounts.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:TaxjarAccounts.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:TaxjarAccounts.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:TaxjarAccounts.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:TaxjarAccounts.TYPE,id:e},t)}isTaxjarAccount(e){return e.type&&e.type===TaxjarAccounts.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:TaxjarAccounts.TYPE}:{id:e.id,type:TaxjarAccounts.TYPE}}type(){return TaxjarAccounts.TYPE}}TaxjarAccounts.TYPE="taxjar_accounts",exports.default=TaxjarAccounts;
@@ -1,7 +1,7 @@
1
- import { ApiResource, Resource, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Order } from './orders';
4
- declare type TransactionRel = ResourceId & {
4
+ declare type TransactionRel = ResourceRel & {
5
5
  type: typeof Transactions.TYPE;
6
6
  };
7
7
  interface Transaction extends Resource {
@@ -23,7 +23,7 @@ declare class Transactions extends ApiResource {
23
23
  list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Transaction>>;
24
24
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Transaction>;
25
25
  isTransaction(resource: any): resource is Transaction;
26
- relationship(id: string | ResourceId): TransactionRel;
26
+ relationship(id: string | ResourceId | null): TransactionRel;
27
27
  type(): string;
28
28
  }
29
29
  export default Transactions;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Transactions extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:Transactions.TYPE},e,r)}async retrieve(e,r,t){return this.resources.retrieve({type:Transactions.TYPE,id:e},r,t)}isTransaction(e){return e.type&&e.type===Transactions.TYPE}relationship(e){return typeof e=="string"?{id:e,type:Transactions.TYPE}:{id:e.id,type:Transactions.TYPE}}type(){return Transactions.TYPE}}Transactions.TYPE="transactions",exports.default=Transactions;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Transactions extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:Transactions.TYPE},e,t)}async retrieve(e,t,r){return this.resources.retrieve({type:Transactions.TYPE,id:e},t,r)}isTransaction(e){return e.type&&e.type===Transactions.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Transactions.TYPE}:{id:e.id,type:Transactions.TYPE}}type(){return Transactions.TYPE}}Transactions.TYPE="transactions",exports.default=Transactions;
@@ -1,8 +1,8 @@
1
- import { ApiResource, Resource, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Order } from './orders';
4
4
  import { Authorization } from './authorizations';
5
- declare type VoidRel = ResourceId & {
5
+ declare type VoidRel = ResourceRel & {
6
6
  type: typeof Voids.TYPE;
7
7
  };
8
8
  interface Void extends Resource {
@@ -25,7 +25,7 @@ declare class Voids extends ApiResource {
25
25
  list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Void>>;
26
26
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Void>;
27
27
  isVoid(resource: any): resource is Void;
28
- relationship(id: string | ResourceId): VoidRel;
28
+ relationship(id: string | ResourceId | null): VoidRel;
29
29
  type(): string;
30
30
  }
31
31
  export default Voids;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Voids extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:Voids.TYPE},e,r)}async retrieve(e,r,t){return this.resources.retrieve({type:Voids.TYPE,id:e},r,t)}isVoid(e){return e.type&&e.type===Voids.TYPE}relationship(e){return typeof e=="string"?{id:e,type:Voids.TYPE}:{id:e.id,type:Voids.TYPE}}type(){return Voids.TYPE}}Voids.TYPE="voids",exports.default=Voids;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Voids extends resource_1.ApiResource{async list(e,r){return this.resources.list({type:Voids.TYPE},e,r)}async retrieve(e,r,t){return this.resources.retrieve({type:Voids.TYPE,id:e},r,t)}isVoid(e){return e.type&&e.type===Voids.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Voids.TYPE}:{id:e.id,type:Voids.TYPE}}type(){return Voids.TYPE}}Voids.TYPE="voids",exports.default=Voids;
@@ -1,7 +1,7 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { EventCallback } from './event_callbacks';
4
- declare type WebhookRel = ResourceId & {
4
+ declare type WebhookRel = ResourceRel & {
5
5
  type: typeof Webhooks.TYPE;
6
6
  };
7
7
  interface Webhook extends Resource {
@@ -34,7 +34,7 @@ declare class Webhooks extends ApiResource {
34
34
  update(resource: WebhookUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
35
35
  delete(id: string, options?: ResourcesConfig): Promise<void>;
36
36
  isWebhook(resource: any): resource is Webhook;
37
- relationship(id: string | ResourceId): WebhookRel;
37
+ relationship(id: string | ResourceId | null): WebhookRel;
38
38
  type(): string;
39
39
  }
40
40
  export default Webhooks;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Webhooks extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:Webhooks.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:Webhooks.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:Webhooks.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:Webhooks.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:Webhooks.TYPE,id:e},t)}isWebhook(e){return e.type&&e.type===Webhooks.TYPE}relationship(e){return typeof e=="string"?{id:e,type:Webhooks.TYPE}:{id:e.id,type:Webhooks.TYPE}}type(){return Webhooks.TYPE}}Webhooks.TYPE="webhooks",exports.default=Webhooks;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class Webhooks extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:Webhooks.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:Webhooks.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:Webhooks.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:Webhooks.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:Webhooks.TYPE,id:e},t)}isWebhook(e){return e.type&&e.type===Webhooks.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:Webhooks.TYPE}:{id:e.id,type:Webhooks.TYPE}}type(){return Webhooks.TYPE}}Webhooks.TYPE="webhooks",exports.default=Webhooks;
@@ -1,10 +1,10 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Order } from './orders';
4
- declare type WireTransferRel = ResourceId & {
4
+ declare type WireTransferRel = ResourceRel & {
5
5
  type: typeof WireTransfers.TYPE;
6
6
  };
7
- declare type OrderRel = ResourceId & {
7
+ declare type OrderRel = ResourceRel & {
8
8
  type: 'orders';
9
9
  };
10
10
  interface WireTransfer extends Resource {
@@ -24,7 +24,7 @@ declare class WireTransfers extends ApiResource {
24
24
  update(resource: WireTransferUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<WireTransfer>;
25
25
  delete(id: string, options?: ResourcesConfig): Promise<void>;
26
26
  isWireTransfer(resource: any): resource is WireTransfer;
27
- relationship(id: string | ResourceId): WireTransferRel;
27
+ relationship(id: string | ResourceId | null): WireTransferRel;
28
28
  type(): string;
29
29
  }
30
30
  export default WireTransfers;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class WireTransfers extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:WireTransfers.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:WireTransfers.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:WireTransfers.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:WireTransfers.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:WireTransfers.TYPE,id:e},t)}isWireTransfer(e){return e.type&&e.type===WireTransfers.TYPE}relationship(e){return typeof e=="string"?{id:e,type:WireTransfers.TYPE}:{id:e.id,type:WireTransfers.TYPE}}type(){return WireTransfers.TYPE}}WireTransfers.TYPE="wire_transfers",exports.default=WireTransfers;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const resource_1=require("../resource");class WireTransfers extends resource_1.ApiResource{async list(e,t){return this.resources.list({type:WireTransfers.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:WireTransfers.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:WireTransfers.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:WireTransfers.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:WireTransfers.TYPE,id:e},t)}isWireTransfer(e){return e.type&&e.type===WireTransfers.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:WireTransfers.TYPE}:{id:e.id,type:WireTransfers.TYPE}}type(){return WireTransfers.TYPE}}WireTransfers.TYPE="wire_transfers",exports.default=WireTransfers;
package/lib/cjs/static.js CHANGED
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t),Object.defineProperty(r,i,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),__importStar=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&__createBinding(e,r,t);return __setModuleDefault(e,r),e};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommerceLayerStatic=void 0;const api=__importStar(require("./api")),error_1=require("./error");exports.CommerceLayerStatic={resources:()=>api.resourceList,isSdkError:r=>error_1.SdkError.isSdkError(r),isApiError:r=>error_1.ApiError.isApiError(r)};
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(r,t);(!n||("get"in n?!r.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,i,n)}:function(e,r,t,i){i===void 0&&(i=t),e[i]=r[t]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&__createBinding(r,e,t);return __setModuleDefault(r,e),r};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommerceLayerStatic=void 0;const api=__importStar(require("./api")),error_1=require("./error");exports.CommerceLayerStatic={resources:()=>api.resourceList,isSdkError:e=>error_1.SdkError.isSdkError(e),isApiError:e=>error_1.ApiError.isApiError(e)};
package/lib/cjs/util.d.ts CHANGED
@@ -1,3 +1 @@
1
- /// <reference types="node" />
2
- declare const sleep: (ms: number) => Promise<NodeJS.Timeout>;
3
- export { sleep };
1
+ declare const sleep:(ms:number)=>Promise<NodeJS.Timeout>;export{sleep};
@@ -0,0 +1,2 @@
1
+ /// <reference types="node" />
2
+ import{AxiosProxyConfig,Method}from'axios';import type{InterceptorManager}from'./interceptor';import type{Agent as HttpAgent}from'http';import type{Agent as HttpsAgent}from'https';declare type ProxyConfig=AxiosProxyConfig|false;declare type RequestConfig={timeout?:number;params?:{[key:string]:string|number|boolean;};httpAgent?:HttpAgent;httpsAgent?:HttpsAgent;proxy?:ProxyConfig;};declare type ApiClientInitConfig={organization:string;domain?:string;accessToken:string;}&RequestConfig;declare type ApiClientConfig=Partial<ApiClientInitConfig>;declare class ApiClient{#private;static create(options:ApiClientInitConfig):ApiClient;baseUrl:string;interceptors:InterceptorManager;private constructor();config(config:ApiClientConfig):void;request(method:Method,path:string,body?:any,options?:ApiClientConfig):Promise<any>;}export default ApiClient;export{ApiClientInitConfig,ApiClientConfig,RequestConfig};
package/lib/client.js ADDED
@@ -0,0 +1 @@
1
+ var d=this&&this.__classPrivateFieldSet||function(o,e,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?o!==e||!i:!e.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(o,t):i?i.value=t:e.set(o,t),t},a=this&&this.__classPrivateFieldGet||function(o,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?o!==e||!r:!e.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(o):r?r.value:e.get(o)},s,n;import u from"axios";import{SdkError as T,ApiError as b,ErrorType as c}from"./error";import f from"./config";import z from"./debug";const p=z(),m=(o,e)=>`https://${o.toLowerCase()}.${e||f.default.domain}/api`,C=o=>{let e=new T({message:o.message,type:c.GENERIC});if(u.isAxiosError(o))if(o.response){const t=new b(e);t.type=c.RESPONSE,t.status=o.response.status,t.code=String(t.status),t.errors=o.response.data.errors,e=t}else o.request?(e.type=c.REQUEST,e.request=o.request):e.type=c.CLIENT;else u.isCancel(o)?e.type=c.CANCEL:e.source=o;throw e};class l{constructor(e){s.set(this,void 0),n.set(this,void 0),p("new client instance %O",e),this.baseUrl=m(e.organization,e.domain),d(this,s,e.accessToken,"f");const t={timeout:e.timeout||f.client.timeout,proxy:e.proxy,httpAgent:e.httpAgent,httpsAgent:e.httpsAgent},r={baseURL:this.baseUrl,timeout:f.client.timeout,headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json",Authorization:"Bearer "+a(this,s,"f")},...t};p("axios options: %O",r),d(this,n,u.create(r),"f"),this.interceptors=a(this,n,"f").interceptors}static create(e){if(!e?.organization)throw new Error("Undefined 'organization' parameter");if(!e?.accessToken)throw new Error("Undefined 'accessToken' parameter");return new l(e)}config(e){p("config %o",e);const t=a(this,n,"f").defaults;e.timeout&&(t.timeout=e.timeout),e.proxy&&(t.proxy=e.proxy),e.httpAgent&&(t.httpAgent=e.httpAgent),e.httpsAgent&&(t.httpsAgent=e.httpsAgent),e.organization&&(this.baseUrl=m(e.organization,e.domain)),e.accessToken&&(d(this,s,e.accessToken,"f"),t.headers.common.Authorization="Bearer "+a(this,s,"f"))}async request(e,t,r,i){p("request %s %s, %O, %O",e,t,r||{},i||{});const y=r?{data:r}:void 0,E=t,v=i?.organization?m(i.organization,i.domain):void 0,w=i?.accessToken||a(this,s,"f"),A=w?{Authorization:"Bearer "+w}:void 0,g={method:e,baseURL:v,url:E,data:y,headers:A,...i};return p("request params: %O",g),a(this,n,"f").request(g).then(h=>h.data).catch(h=>C(h))}}s=new WeakMap,n=new WeakMap;export default l;
@@ -0,0 +1 @@
1
+ import*as api from'./api';import{ApiError}from'./error';import type{ErrorInterceptor,InterceptorType,RawResponseReader,RequestInterceptor,ResponseInterceptor}from'./interceptor';import{ResourcesInitConfig}from'./resource';declare type SdkConfig={};declare type CommerceLayerInitConfig=SdkConfig&ResourcesInitConfig;declare type CommerceLayerConfig=Partial<CommerceLayerInitConfig>;declare class CommerceLayerClient{#private;static get openApiSchemaVersion():string;addresses:api.Addresses;adjustments:api.Adjustments;adyen_gateways:api.AdyenGateways;adyen_payments:api.AdyenPayments;application:api.Applications;attachments:api.Attachments;authorizations:api.Authorizations;avalara_accounts:api.AvalaraAccounts;billing_info_validation_rules:api.BillingInfoValidationRules;bing_geocoders:api.BingGeocoders;braintree_gateways:api.BraintreeGateways;braintree_payments:api.BraintreePayments;bundles:api.Bundles;captures:api.Captures;carrier_accounts:api.CarrierAccounts;checkout_com_gateways:api.CheckoutComGateways;checkout_com_payments:api.CheckoutComPayments;coupon_codes_promotion_rules:api.CouponCodesPromotionRules;coupon_recipients:api.CouponRecipients;coupons:api.Coupons;customer_addresses:api.CustomerAddresses;customer_groups:api.CustomerGroups;customer_password_resets:api.CustomerPasswordResets;customer_payment_sources:api.CustomerPaymentSources;customer_subscriptions:api.CustomerSubscriptions;customers:api.Customers;delivery_lead_times:api.DeliveryLeadTimes;event_callbacks:api.EventCallbacks;external_gateways:api.ExternalGateways;external_payments:api.ExternalPayments;external_promotions:api.ExternalPromotions;external_tax_calculators:api.ExternalTaxCalculators;fixed_amount_promotions:api.FixedAmountPromotions;fixed_price_promotions:api.FixedPricePromotions;free_gift_promotions:api.FreeGiftPromotions;free_shipping_promotions:api.FreeShippingPromotions;geocoders:api.Geocoders;gift_card_recipients:api.GiftCardRecipients;gift_cards:api.GiftCards;google_geocoders:api.GoogleGeocoders;imports:api.Imports;in_stock_subscriptions:api.InStockSubscriptions;inventory_models:api.InventoryModels;inventory_return_locations:api.InventoryReturnLocations;inventory_stock_locations:api.InventoryStockLocations;klarna_gateways:api.KlarnaGateways;klarna_payments:api.KlarnaPayments;line_item_options:api.LineItemOptions;line_items:api.LineItems;manual_gateways:api.ManualGateways;manual_tax_calculators:api.ManualTaxCalculators;markets:api.Markets;merchants:api.Merchants;order_amount_promotion_rules:api.OrderAmountPromotionRules;order_copies:api.OrderCopies;order_subscriptions:api.OrderSubscriptions;order_validation_rules:api.OrderValidationRules;orders:api.Orders;organization:api.Organizations;packages:api.Packages;parcel_line_items:api.ParcelLineItems;parcels:api.Parcels;payment_gateways:api.PaymentGateways;payment_methods:api.PaymentMethods;paypal_gateways:api.PaypalGateways;paypal_payments:api.PaypalPayments;percentage_discount_promotions:api.PercentageDiscountPromotions;price_lists:api.PriceLists;prices:api.Prices;promotion_rules:api.PromotionRules;promotions:api.Promotions;refunds:api.Refunds;return_line_items:api.ReturnLineItems;returns:api.Returns;shipments:api.Shipments;shipping_categories:api.ShippingCategories;shipping_methods:api.ShippingMethods;shipping_zones:api.ShippingZones;sku_list_items:api.SkuListItems;sku_list_promotion_rules:api.SkuListPromotionRules;sku_lists:api.SkuLists;sku_options:api.SkuOptions;skus:api.Skus;stock_items:api.StockItems;stock_line_items:api.StockLineItems;stock_locations:api.StockLocations;stock_transfers:api.StockTransfers;stripe_gateways:api.StripeGateways;stripe_payments:api.StripePayments;tax_calculators:api.TaxCalculators;tax_categories:api.TaxCategories;tax_rules:api.TaxRules;taxjar_accounts:api.TaxjarAccounts;transactions:api.Transactions;voids:api.Voids;webhooks:api.Webhooks;wire_transfers:api.WireTransfers;constructor(config:CommerceLayerInitConfig);get currentOrganization():string;private localConfig;config(config:CommerceLayerConfig):void;resources():readonly string[];isApiError(error:any):error is ApiError;addRequestInterceptor(onFulfilled?:RequestInterceptor,onRejected?:ErrorInterceptor):number;addResponseInterceptor(onFulfilled?:ResponseInterceptor,onRejected?:ErrorInterceptor):number;removeInterceptor(type:InterceptorType,id:number):void;addRawResponseReader():RawResponseReader;removeRawResponseReader(reader:number|RawResponseReader):void;}declare const CommerceLayer:(config:CommerceLayerInitConfig)=>CommerceLayerClient;export default CommerceLayer;export type{CommerceLayerClient,CommerceLayerConfig,CommerceLayerInitConfig};
@@ -0,0 +1 @@
1
+ var c=this&&this.__classPrivateFieldSet||function(o,i,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?o!==i||!a:!i.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(o,n):a?a.value=n:i.set(o,n),n},s=this&&this.__classPrivateFieldGet||function(o,i,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?o!==i||!r:!i.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(o):r?r.value:i.get(o)},t,h;import*as e from"./api";import{CommerceLayerStatic as f}from"./static";import p from"./resource";import u from"./debug";const w=u(),m="2.8.1";class l{constructor(i){t.set(this,void 0),h.set(this,void 0),w("new commercelayer instance %O",i),c(this,t,new p(i),"f"),c(this,h,i.organization,"f"),this.addresses=new e.Addresses(s(this,t,"f")),this.adjustments=new e.Adjustments(s(this,t,"f")),this.adyen_gateways=new e.AdyenGateways(s(this,t,"f")),this.adyen_payments=new e.AdyenPayments(s(this,t,"f")),this.application=new e.Applications(s(this,t,"f")),this.attachments=new e.Attachments(s(this,t,"f")),this.authorizations=new e.Authorizations(s(this,t,"f")),this.avalara_accounts=new e.AvalaraAccounts(s(this,t,"f")),this.billing_info_validation_rules=new e.BillingInfoValidationRules(s(this,t,"f")),this.bing_geocoders=new e.BingGeocoders(s(this,t,"f")),this.braintree_gateways=new e.BraintreeGateways(s(this,t,"f")),this.braintree_payments=new e.BraintreePayments(s(this,t,"f")),this.bundles=new e.Bundles(s(this,t,"f")),this.captures=new e.Captures(s(this,t,"f")),this.carrier_accounts=new e.CarrierAccounts(s(this,t,"f")),this.checkout_com_gateways=new e.CheckoutComGateways(s(this,t,"f")),this.checkout_com_payments=new e.CheckoutComPayments(s(this,t,"f")),this.coupon_codes_promotion_rules=new e.CouponCodesPromotionRules(s(this,t,"f")),this.coupon_recipients=new e.CouponRecipients(s(this,t,"f")),this.coupons=new e.Coupons(s(this,t,"f")),this.customer_addresses=new e.CustomerAddresses(s(this,t,"f")),this.customer_groups=new e.CustomerGroups(s(this,t,"f")),this.customer_password_resets=new e.CustomerPasswordResets(s(this,t,"f")),this.customer_payment_sources=new e.CustomerPaymentSources(s(this,t,"f")),this.customer_subscriptions=new e.CustomerSubscriptions(s(this,t,"f")),this.customers=new e.Customers(s(this,t,"f")),this.delivery_lead_times=new e.DeliveryLeadTimes(s(this,t,"f")),this.event_callbacks=new e.EventCallbacks(s(this,t,"f")),this.external_gateways=new e.ExternalGateways(s(this,t,"f")),this.external_payments=new e.ExternalPayments(s(this,t,"f")),this.external_promotions=new e.ExternalPromotions(s(this,t,"f")),this.external_tax_calculators=new e.ExternalTaxCalculators(s(this,t,"f")),this.fixed_amount_promotions=new e.FixedAmountPromotions(s(this,t,"f")),this.fixed_price_promotions=new e.FixedPricePromotions(s(this,t,"f")),this.free_gift_promotions=new e.FreeGiftPromotions(s(this,t,"f")),this.free_shipping_promotions=new e.FreeShippingPromotions(s(this,t,"f")),this.geocoders=new e.Geocoders(s(this,t,"f")),this.gift_card_recipients=new e.GiftCardRecipients(s(this,t,"f")),this.gift_cards=new e.GiftCards(s(this,t,"f")),this.google_geocoders=new e.GoogleGeocoders(s(this,t,"f")),this.imports=new e.Imports(s(this,t,"f")),this.in_stock_subscriptions=new e.InStockSubscriptions(s(this,t,"f")),this.inventory_models=new e.InventoryModels(s(this,t,"f")),this.inventory_return_locations=new e.InventoryReturnLocations(s(this,t,"f")),this.inventory_stock_locations=new e.InventoryStockLocations(s(this,t,"f")),this.klarna_gateways=new e.KlarnaGateways(s(this,t,"f")),this.klarna_payments=new e.KlarnaPayments(s(this,t,"f")),this.line_item_options=new e.LineItemOptions(s(this,t,"f")),this.line_items=new e.LineItems(s(this,t,"f")),this.manual_gateways=new e.ManualGateways(s(this,t,"f")),this.manual_tax_calculators=new e.ManualTaxCalculators(s(this,t,"f")),this.markets=new e.Markets(s(this,t,"f")),this.merchants=new e.Merchants(s(this,t,"f")),this.order_amount_promotion_rules=new e.OrderAmountPromotionRules(s(this,t,"f")),this.order_copies=new e.OrderCopies(s(this,t,"f")),this.order_subscriptions=new e.OrderSubscriptions(s(this,t,"f")),this.order_validation_rules=new e.OrderValidationRules(s(this,t,"f")),this.orders=new e.Orders(s(this,t,"f")),this.organization=new e.Organizations(s(this,t,"f")),this.packages=new e.Packages(s(this,t,"f")),this.parcel_line_items=new e.ParcelLineItems(s(this,t,"f")),this.parcels=new e.Parcels(s(this,t,"f")),this.payment_gateways=new e.PaymentGateways(s(this,t,"f")),this.payment_methods=new e.PaymentMethods(s(this,t,"f")),this.paypal_gateways=new e.PaypalGateways(s(this,t,"f")),this.paypal_payments=new e.PaypalPayments(s(this,t,"f")),this.percentage_discount_promotions=new e.PercentageDiscountPromotions(s(this,t,"f")),this.price_lists=new e.PriceLists(s(this,t,"f")),this.prices=new e.Prices(s(this,t,"f")),this.promotion_rules=new e.PromotionRules(s(this,t,"f")),this.promotions=new e.Promotions(s(this,t,"f")),this.refunds=new e.Refunds(s(this,t,"f")),this.return_line_items=new e.ReturnLineItems(s(this,t,"f")),this.returns=new e.Returns(s(this,t,"f")),this.shipments=new e.Shipments(s(this,t,"f")),this.shipping_categories=new e.ShippingCategories(s(this,t,"f")),this.shipping_methods=new e.ShippingMethods(s(this,t,"f")),this.shipping_zones=new e.ShippingZones(s(this,t,"f")),this.sku_list_items=new e.SkuListItems(s(this,t,"f")),this.sku_list_promotion_rules=new e.SkuListPromotionRules(s(this,t,"f")),this.sku_lists=new e.SkuLists(s(this,t,"f")),this.sku_options=new e.SkuOptions(s(this,t,"f")),this.skus=new e.Skus(s(this,t,"f")),this.stock_items=new e.StockItems(s(this,t,"f")),this.stock_line_items=new e.StockLineItems(s(this,t,"f")),this.stock_locations=new e.StockLocations(s(this,t,"f")),this.stock_transfers=new e.StockTransfers(s(this,t,"f")),this.stripe_gateways=new e.StripeGateways(s(this,t,"f")),this.stripe_payments=new e.StripePayments(s(this,t,"f")),this.tax_calculators=new e.TaxCalculators(s(this,t,"f")),this.tax_categories=new e.TaxCategories(s(this,t,"f")),this.tax_rules=new e.TaxRules(s(this,t,"f")),this.taxjar_accounts=new e.TaxjarAccounts(s(this,t,"f")),this.transactions=new e.Transactions(s(this,t,"f")),this.voids=new e.Voids(s(this,t,"f")),this.webhooks=new e.Webhooks(s(this,t,"f")),this.wire_transfers=new e.WireTransfers(s(this,t,"f"))}static get openApiSchemaVersion(){return m}get currentOrganization(){return s(this,h,"f")}localConfig(i){i.organization&&c(this,h,i.organization,"f")}config(i){w("config %o",i),this.localConfig(i),s(this,t,"f").config(i)}resources(){return f.resources()}isApiError(i){return f.isApiError(i)}addRequestInterceptor(i,n){return s(this,t,"f").interceptors.request.use(i,n)}addResponseInterceptor(i,n){return s(this,t,"f").interceptors.response.use(i,n)}removeInterceptor(i,n){return s(this,t,"f").interceptors[i].eject(n)}addRawResponseReader(){const i={id:void 0,rawResponse:void 0};function n(a){return i.rawResponse=a?.data,a}const r=this.addResponseInterceptor(n);return i.id=r,i}removeRawResponseReader(i){const n=typeof i=="number"?i:i.id;if(n)return this.removeInterceptor("response",n)}}t=new WeakMap,h=new WeakMap;const _=o=>new l(o);export default _;
@@ -0,0 +1 @@
1
+ import type{ResourceId,ResourceType}from'./resource';declare const isResourceId:(resource:any)=>resource is ResourceId;declare const isResourceType:(resource:any)=>resource is ResourceType;export{isResourceId,isResourceType};
package/lib/common.js ADDED
@@ -0,0 +1 @@
1
+ import{resourceList as t}from"./api";const p=e=>e&&e.type&&e.id&&t.includes(e.type),o=e=>e&&typeof e.type<"u"&&e.type&&t.includes(e.type);export{p as isResourceId,o as isResourceType};
@@ -0,0 +1 @@
1
+ declare const config:{readonly default:{readonly domain:"commercelayer.io";readonly pageNumber:1;readonly pageSize:10;};readonly client:{readonly timeout:15000;};};export default config;
package/lib/config.js ADDED
@@ -0,0 +1 @@
1
+ const e={default:{domain:"commercelayer.io",pageNumber:1,pageSize:10},client:{timeout:15e3}};export default e;
package/lib/debug.d.ts ADDED
@@ -0,0 +1 @@
1
+ declare type Debugger=(pattern:string,...args:any[])=>void;declare const debug:(namespace?:string|undefined)=>Debugger;export default debug;
package/lib/debug.js ADDED
@@ -0,0 +1 @@
1
+ const a=(e,...r)=>{};let t=e=>a;try{const e=require("debug");e&&typeof e=="function"&&(t=e)}catch{}const o="clsdk",n=()=>{const e=new Error;Error.prepareStackTrace=(s,c)=>c;const r=e.stack;return Error.prepareStackTrace=void 0,(r[2].getFileName()||"/").replace(/^.*[\\/]/,"").replace(".ts","")},p=e=>t(`${o}:${e||n()}`);export default p;
package/lib/error.d.ts ADDED
@@ -0,0 +1 @@
1
+ declare enum ErrorType{CLIENT="client",REQUEST="request",RESPONSE="response",GENERIC="generic",CANCEL="cancel"}declare class SdkError extends Error{static isSdkError(error:any):error is ApiError;type:string;code?:string;source?:Error;request?:any;constructor(error:{message:string;type?:ErrorType;});}declare class ApiError extends SdkError{static isApiError(error:any):error is ApiError;errors:any[];status?:number;constructor(error:SdkError);first():any;}export{SdkError,ApiError,ErrorType};
package/lib/error.js ADDED
@@ -0,0 +1 @@
1
+ var t;(function(e){e.CLIENT="client",e.REQUEST="request",e.RESPONSE="response",e.GENERIC="generic",e.CANCEL="cancel"})(t||(t={}));class s extends Error{constructor(r){super(r.message);this.name=this.constructor.name,this.type=r.type||t.GENERIC}static isSdkError(r){return r&&["SdkError","ApiError"].includes(r.name)&&Object.values(t).includes(r.type)}}class n extends s{constructor(r){super({...r,type:t.RESPONSE});this.errors=[],this.name=this.constructor.name}static isApiError(r){return s.isSdkError(r)&&r.name==="ApiError"&&r.type===t.RESPONSE}first(){return this.errors?.length>0?this.errors[0]:void 0}}export{s as SdkError,n as ApiError,t as ErrorType};
package/lib/esm/api.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * ©2022 Commerce Layer Inc.
3
- * OpenAPI schema, version 2.8.0
3
+ * OpenAPI schema, version 2.9.1
4
4
  **/
5
5
  export { default as Addresses } from './resources/addresses';
6
6
  export { default as Adjustments } from './resources/adjustments';
package/lib/esm/client.js CHANGED
@@ -1 +1 @@
1
- var h=this&&this.__classPrivateFieldSet||function(o,t,e,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?o!==t||!i:!t.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(o,e):i?i.value=e:t.set(o,e),e},a=this&&this.__classPrivateFieldGet||function(o,t,e,r){if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?o!==t||!r:!t.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?r:e==="a"?r.call(o):r?r.value:t.get(o)},s,n;import u from"axios";import{SdkError as T,ApiError as g,ErrorType as c}from"./error";import l from"./config";const p=(o,t)=>`https://${o.toLowerCase()}.${t||l.default.domain}/api`,b=o=>{let t=new T({message:o.message,type:c.GENERIC});if(u.isAxiosError(o))if(o.response){const e=new g(t);e.type=c.RESPONSE,e.status=o.response.status,e.code=String(e.status),e.errors=o.response.data.errors,t=e}else o.request?(t.type=c.REQUEST,t.request=o.request):t.type=c.CLIENT;else u.isCancel(o)?t.type=c.CANCEL:t.source=o;throw t};class f{constructor(t){s.set(this,void 0),n.set(this,void 0),this.baseUrl=p(t.organization,t.domain),h(this,s,t.accessToken,"f");const e={timeout:t.timeout||l.client.timeout};h(this,n,u.create(Object.assign({baseURL:this.baseUrl,timeout:l.client.timeout,headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json",Authorization:"Bearer "+a(this,s,"f")}},e)),"f"),this.interceptors=a(this,n,"f").interceptors}static create(t){if(!(t==null?void 0:t.organization))throw new Error("Undefined 'organization' parameter");if(!(t==null?void 0:t.accessToken))throw new Error("Undefined 'accessToken' parameter");return new f(t)}config(t){const e=a(this,n,"f").defaults;t.timeout&&(e.timeout=t.timeout),t.organization&&(this.baseUrl=p(t.organization,t.domain)),t.accessToken&&(h(this,s,t.accessToken,"f"),e.headers.common.Authorization="Bearer "+a(this,s,"f"))}async request(t,e,r,i){const w=r?{data:r}:void 0,v=e,E=(i==null?void 0:i.organization)?p(i.organization,i.domain):void 0,m=(i==null?void 0:i.accessToken)||a(this,s,"f"),y=m?{Authorization:"Bearer "+m}:void 0;return a(this,n,"f").request(Object.assign({method:t,baseURL:E,url:v,data:w,headers:y},i)).then(d=>d.data).catch(d=>b(d))}}s=new WeakMap,n=new WeakMap;export default f;
1
+ var l=this&&this.__classPrivateFieldSet||function(a,e,t,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?a!==e||!s:!e.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(a,t):s?s.value=t:e.set(a,t),t},n=this&&this.__classPrivateFieldGet||function(a,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?a!==e||!r:!e.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(a):r?r.value:e.get(a)},i,o;import h from"axios";import{SdkError as y,ApiError as b,ErrorType as c}from"./error";import u from"./config";const f=(a,e)=>`https://${a.toLowerCase()}.${e||u.default.domain}/api`,C=a=>{let e=new y({message:a.message,type:c.GENERIC});if(h.isAxiosError(a))if(a.response){const t=new b(e);t.type=c.RESPONSE,t.status=a.response.status,t.code=String(t.status),t.errors=a.response.data.errors,e=t}else a.request?(e.type=c.REQUEST,e.request=a.request):e.type=c.CLIENT;else h.isCancel(a)?e.type=c.CANCEL:e.source=a;throw e};class m{constructor(e){i.set(this,void 0),o.set(this,void 0),this.baseUrl=f(e.organization,e.domain),l(this,i,e.accessToken,"f");const t={timeout:e.timeout||u.client.timeout};l(this,o,h.create(Object.assign({baseURL:this.baseUrl,timeout:u.client.timeout,headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json",Authorization:"Bearer "+n(this,i,"f")}},t)),"f"),this.interceptors=n(this,o,"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 m(e)}config(e){const t=n(this,o,"f").defaults;e.timeout&&(t.timeout=e.timeout),e.organization&&(this.baseUrl=f(e.organization,e.domain)),e.accessToken&&(l(this,i,e.accessToken,"f"),t.headers.common.Authorization="Bearer "+n(this,i,"f"))}async request(e,t,r,s){const p=r?{data:r}:void 0,E=t,v=(s==null?void 0:s.organization)?f(s.organization,s.domain):void 0,w=(s==null?void 0:s.accessToken)||n(this,i,"f"),T=w?{Authorization:"Bearer "+w}:void 0;return n(this,o,"f").request(Object.assign({method:e,baseURL:v,url:E,data:p,headers:T},s)).then(d=>d.data).catch(d=>C(d))}}i=new WeakMap,o=new WeakMap;export default m;
@@ -1 +1 @@
1
- var c=this&&this.__classPrivateFieldSet||function(o,i,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?o!==i||!a:!i.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(o,n):a?a.value=n:i.set(o,n),n},s=this&&this.__classPrivateFieldGet||function(o,i,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?o!==i||!r:!i.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(o):r?r.value:i.get(o)},t,h;import*as e from"./api";import{CommerceLayerStatic as f}from"./static";import w from"./resource";const u="2.8.0";class p{constructor(i){t.set(this,void 0),h.set(this,void 0),c(this,t,new w(i),"f"),c(this,h,i.organization,"f"),this.addresses=new e.Addresses(s(this,t,"f")),this.adjustments=new e.Adjustments(s(this,t,"f")),this.adyen_gateways=new e.AdyenGateways(s(this,t,"f")),this.adyen_payments=new e.AdyenPayments(s(this,t,"f")),this.application=new e.Applications(s(this,t,"f")),this.attachments=new e.Attachments(s(this,t,"f")),this.authorizations=new e.Authorizations(s(this,t,"f")),this.avalara_accounts=new e.AvalaraAccounts(s(this,t,"f")),this.billing_info_validation_rules=new e.BillingInfoValidationRules(s(this,t,"f")),this.bing_geocoders=new e.BingGeocoders(s(this,t,"f")),this.braintree_gateways=new e.BraintreeGateways(s(this,t,"f")),this.braintree_payments=new e.BraintreePayments(s(this,t,"f")),this.bundles=new e.Bundles(s(this,t,"f")),this.captures=new e.Captures(s(this,t,"f")),this.carrier_accounts=new e.CarrierAccounts(s(this,t,"f")),this.checkout_com_gateways=new e.CheckoutComGateways(s(this,t,"f")),this.checkout_com_payments=new e.CheckoutComPayments(s(this,t,"f")),this.coupon_codes_promotion_rules=new e.CouponCodesPromotionRules(s(this,t,"f")),this.coupon_recipients=new e.CouponRecipients(s(this,t,"f")),this.coupons=new e.Coupons(s(this,t,"f")),this.customer_addresses=new e.CustomerAddresses(s(this,t,"f")),this.customer_groups=new e.CustomerGroups(s(this,t,"f")),this.customer_password_resets=new e.CustomerPasswordResets(s(this,t,"f")),this.customer_payment_sources=new e.CustomerPaymentSources(s(this,t,"f")),this.customer_subscriptions=new e.CustomerSubscriptions(s(this,t,"f")),this.customers=new e.Customers(s(this,t,"f")),this.delivery_lead_times=new e.DeliveryLeadTimes(s(this,t,"f")),this.event_callbacks=new e.EventCallbacks(s(this,t,"f")),this.external_gateways=new e.ExternalGateways(s(this,t,"f")),this.external_payments=new e.ExternalPayments(s(this,t,"f")),this.external_promotions=new e.ExternalPromotions(s(this,t,"f")),this.external_tax_calculators=new e.ExternalTaxCalculators(s(this,t,"f")),this.fixed_amount_promotions=new e.FixedAmountPromotions(s(this,t,"f")),this.fixed_price_promotions=new e.FixedPricePromotions(s(this,t,"f")),this.free_gift_promotions=new e.FreeGiftPromotions(s(this,t,"f")),this.free_shipping_promotions=new e.FreeShippingPromotions(s(this,t,"f")),this.geocoders=new e.Geocoders(s(this,t,"f")),this.gift_card_recipients=new e.GiftCardRecipients(s(this,t,"f")),this.gift_cards=new e.GiftCards(s(this,t,"f")),this.google_geocoders=new e.GoogleGeocoders(s(this,t,"f")),this.imports=new e.Imports(s(this,t,"f")),this.in_stock_subscriptions=new e.InStockSubscriptions(s(this,t,"f")),this.inventory_models=new e.InventoryModels(s(this,t,"f")),this.inventory_return_locations=new e.InventoryReturnLocations(s(this,t,"f")),this.inventory_stock_locations=new e.InventoryStockLocations(s(this,t,"f")),this.klarna_gateways=new e.KlarnaGateways(s(this,t,"f")),this.klarna_payments=new e.KlarnaPayments(s(this,t,"f")),this.line_item_options=new e.LineItemOptions(s(this,t,"f")),this.line_items=new e.LineItems(s(this,t,"f")),this.manual_gateways=new e.ManualGateways(s(this,t,"f")),this.manual_tax_calculators=new e.ManualTaxCalculators(s(this,t,"f")),this.markets=new e.Markets(s(this,t,"f")),this.merchants=new e.Merchants(s(this,t,"f")),this.order_amount_promotion_rules=new e.OrderAmountPromotionRules(s(this,t,"f")),this.order_copies=new e.OrderCopies(s(this,t,"f")),this.order_subscriptions=new e.OrderSubscriptions(s(this,t,"f")),this.order_validation_rules=new e.OrderValidationRules(s(this,t,"f")),this.orders=new e.Orders(s(this,t,"f")),this.organization=new e.Organizations(s(this,t,"f")),this.packages=new e.Packages(s(this,t,"f")),this.parcel_line_items=new e.ParcelLineItems(s(this,t,"f")),this.parcels=new e.Parcels(s(this,t,"f")),this.payment_gateways=new e.PaymentGateways(s(this,t,"f")),this.payment_methods=new e.PaymentMethods(s(this,t,"f")),this.paypal_gateways=new e.PaypalGateways(s(this,t,"f")),this.paypal_payments=new e.PaypalPayments(s(this,t,"f")),this.percentage_discount_promotions=new e.PercentageDiscountPromotions(s(this,t,"f")),this.price_lists=new e.PriceLists(s(this,t,"f")),this.prices=new e.Prices(s(this,t,"f")),this.promotion_rules=new e.PromotionRules(s(this,t,"f")),this.promotions=new e.Promotions(s(this,t,"f")),this.refunds=new e.Refunds(s(this,t,"f")),this.return_line_items=new e.ReturnLineItems(s(this,t,"f")),this.returns=new e.Returns(s(this,t,"f")),this.shipments=new e.Shipments(s(this,t,"f")),this.shipping_categories=new e.ShippingCategories(s(this,t,"f")),this.shipping_methods=new e.ShippingMethods(s(this,t,"f")),this.shipping_zones=new e.ShippingZones(s(this,t,"f")),this.sku_list_items=new e.SkuListItems(s(this,t,"f")),this.sku_list_promotion_rules=new e.SkuListPromotionRules(s(this,t,"f")),this.sku_lists=new e.SkuLists(s(this,t,"f")),this.sku_options=new e.SkuOptions(s(this,t,"f")),this.skus=new e.Skus(s(this,t,"f")),this.stock_items=new e.StockItems(s(this,t,"f")),this.stock_line_items=new e.StockLineItems(s(this,t,"f")),this.stock_locations=new e.StockLocations(s(this,t,"f")),this.stock_transfers=new e.StockTransfers(s(this,t,"f")),this.stripe_gateways=new e.StripeGateways(s(this,t,"f")),this.stripe_payments=new e.StripePayments(s(this,t,"f")),this.tax_calculators=new e.TaxCalculators(s(this,t,"f")),this.tax_categories=new e.TaxCategories(s(this,t,"f")),this.tax_rules=new e.TaxRules(s(this,t,"f")),this.taxjar_accounts=new e.TaxjarAccounts(s(this,t,"f")),this.transactions=new e.Transactions(s(this,t,"f")),this.voids=new e.Voids(s(this,t,"f")),this.webhooks=new e.Webhooks(s(this,t,"f")),this.wire_transfers=new e.WireTransfers(s(this,t,"f"))}static get openApiSchemaVersion(){return u}get currentOrganization(){return s(this,h,"f")}config(i){i.organization&&c(this,h,i.organization,"f"),s(this,t,"f").config(i)}resources(){return f.resources()}isApiError(i){return f.isApiError(i)}addRequestInterceptor(i,n){return s(this,t,"f").interceptors.request.use(i,n)}addResponseInterceptor(i,n){return s(this,t,"f").interceptors.response.use(i,n)}removeInterceptor(i,n){return s(this,t,"f").interceptors[i].eject(n)}addRawResponseReader(){const i={id:void 0,rawResponse:void 0};function n(a){return i.rawResponse=a==null?void 0:a.data,a}const r=this.addResponseInterceptor(n);return i.id=r,i}removeRawResponseReader(i){const n=typeof i=="number"?i:i.id;if(n)return this.removeInterceptor("response",n)}}t=new WeakMap,h=new WeakMap;const m=o=>new p(o);export default m;
1
+ var c=this&&this.__classPrivateFieldSet||function(o,i,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?o!==i||!a:!i.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(o,n):a?a.value=n:i.set(o,n),n},s=this&&this.__classPrivateFieldGet||function(o,i,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?o!==i||!r:!i.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(o):r?r.value:i.get(o)},t,h;import*as e from"./api";import{CommerceLayerStatic as w}from"./static";import f from"./resource";const p="2.9.1";class u{constructor(i){t.set(this,void 0),h.set(this,void 0),c(this,t,new f(i),"f"),c(this,h,i.organization,"f"),this.addresses=new e.Addresses(s(this,t,"f")),this.adjustments=new e.Adjustments(s(this,t,"f")),this.adyen_gateways=new e.AdyenGateways(s(this,t,"f")),this.adyen_payments=new e.AdyenPayments(s(this,t,"f")),this.application=new e.Applications(s(this,t,"f")),this.attachments=new e.Attachments(s(this,t,"f")),this.authorizations=new e.Authorizations(s(this,t,"f")),this.avalara_accounts=new e.AvalaraAccounts(s(this,t,"f")),this.billing_info_validation_rules=new e.BillingInfoValidationRules(s(this,t,"f")),this.bing_geocoders=new e.BingGeocoders(s(this,t,"f")),this.braintree_gateways=new e.BraintreeGateways(s(this,t,"f")),this.braintree_payments=new e.BraintreePayments(s(this,t,"f")),this.bundles=new e.Bundles(s(this,t,"f")),this.captures=new e.Captures(s(this,t,"f")),this.carrier_accounts=new e.CarrierAccounts(s(this,t,"f")),this.checkout_com_gateways=new e.CheckoutComGateways(s(this,t,"f")),this.checkout_com_payments=new e.CheckoutComPayments(s(this,t,"f")),this.coupon_codes_promotion_rules=new e.CouponCodesPromotionRules(s(this,t,"f")),this.coupon_recipients=new e.CouponRecipients(s(this,t,"f")),this.coupons=new e.Coupons(s(this,t,"f")),this.customer_addresses=new e.CustomerAddresses(s(this,t,"f")),this.customer_groups=new e.CustomerGroups(s(this,t,"f")),this.customer_password_resets=new e.CustomerPasswordResets(s(this,t,"f")),this.customer_payment_sources=new e.CustomerPaymentSources(s(this,t,"f")),this.customer_subscriptions=new e.CustomerSubscriptions(s(this,t,"f")),this.customers=new e.Customers(s(this,t,"f")),this.delivery_lead_times=new e.DeliveryLeadTimes(s(this,t,"f")),this.event_callbacks=new e.EventCallbacks(s(this,t,"f")),this.external_gateways=new e.ExternalGateways(s(this,t,"f")),this.external_payments=new e.ExternalPayments(s(this,t,"f")),this.external_promotions=new e.ExternalPromotions(s(this,t,"f")),this.external_tax_calculators=new e.ExternalTaxCalculators(s(this,t,"f")),this.fixed_amount_promotions=new e.FixedAmountPromotions(s(this,t,"f")),this.fixed_price_promotions=new e.FixedPricePromotions(s(this,t,"f")),this.free_gift_promotions=new e.FreeGiftPromotions(s(this,t,"f")),this.free_shipping_promotions=new e.FreeShippingPromotions(s(this,t,"f")),this.geocoders=new e.Geocoders(s(this,t,"f")),this.gift_card_recipients=new e.GiftCardRecipients(s(this,t,"f")),this.gift_cards=new e.GiftCards(s(this,t,"f")),this.google_geocoders=new e.GoogleGeocoders(s(this,t,"f")),this.imports=new e.Imports(s(this,t,"f")),this.in_stock_subscriptions=new e.InStockSubscriptions(s(this,t,"f")),this.inventory_models=new e.InventoryModels(s(this,t,"f")),this.inventory_return_locations=new e.InventoryReturnLocations(s(this,t,"f")),this.inventory_stock_locations=new e.InventoryStockLocations(s(this,t,"f")),this.klarna_gateways=new e.KlarnaGateways(s(this,t,"f")),this.klarna_payments=new e.KlarnaPayments(s(this,t,"f")),this.line_item_options=new e.LineItemOptions(s(this,t,"f")),this.line_items=new e.LineItems(s(this,t,"f")),this.manual_gateways=new e.ManualGateways(s(this,t,"f")),this.manual_tax_calculators=new e.ManualTaxCalculators(s(this,t,"f")),this.markets=new e.Markets(s(this,t,"f")),this.merchants=new e.Merchants(s(this,t,"f")),this.order_amount_promotion_rules=new e.OrderAmountPromotionRules(s(this,t,"f")),this.order_copies=new e.OrderCopies(s(this,t,"f")),this.order_subscriptions=new e.OrderSubscriptions(s(this,t,"f")),this.order_validation_rules=new e.OrderValidationRules(s(this,t,"f")),this.orders=new e.Orders(s(this,t,"f")),this.organization=new e.Organizations(s(this,t,"f")),this.packages=new e.Packages(s(this,t,"f")),this.parcel_line_items=new e.ParcelLineItems(s(this,t,"f")),this.parcels=new e.Parcels(s(this,t,"f")),this.payment_gateways=new e.PaymentGateways(s(this,t,"f")),this.payment_methods=new e.PaymentMethods(s(this,t,"f")),this.paypal_gateways=new e.PaypalGateways(s(this,t,"f")),this.paypal_payments=new e.PaypalPayments(s(this,t,"f")),this.percentage_discount_promotions=new e.PercentageDiscountPromotions(s(this,t,"f")),this.price_lists=new e.PriceLists(s(this,t,"f")),this.prices=new e.Prices(s(this,t,"f")),this.promotion_rules=new e.PromotionRules(s(this,t,"f")),this.promotions=new e.Promotions(s(this,t,"f")),this.refunds=new e.Refunds(s(this,t,"f")),this.return_line_items=new e.ReturnLineItems(s(this,t,"f")),this.returns=new e.Returns(s(this,t,"f")),this.shipments=new e.Shipments(s(this,t,"f")),this.shipping_categories=new e.ShippingCategories(s(this,t,"f")),this.shipping_methods=new e.ShippingMethods(s(this,t,"f")),this.shipping_zones=new e.ShippingZones(s(this,t,"f")),this.sku_list_items=new e.SkuListItems(s(this,t,"f")),this.sku_list_promotion_rules=new e.SkuListPromotionRules(s(this,t,"f")),this.sku_lists=new e.SkuLists(s(this,t,"f")),this.sku_options=new e.SkuOptions(s(this,t,"f")),this.skus=new e.Skus(s(this,t,"f")),this.stock_items=new e.StockItems(s(this,t,"f")),this.stock_line_items=new e.StockLineItems(s(this,t,"f")),this.stock_locations=new e.StockLocations(s(this,t,"f")),this.stock_transfers=new e.StockTransfers(s(this,t,"f")),this.stripe_gateways=new e.StripeGateways(s(this,t,"f")),this.stripe_payments=new e.StripePayments(s(this,t,"f")),this.tax_calculators=new e.TaxCalculators(s(this,t,"f")),this.tax_categories=new e.TaxCategories(s(this,t,"f")),this.tax_rules=new e.TaxRules(s(this,t,"f")),this.taxjar_accounts=new e.TaxjarAccounts(s(this,t,"f")),this.transactions=new e.Transactions(s(this,t,"f")),this.voids=new e.Voids(s(this,t,"f")),this.webhooks=new e.Webhooks(s(this,t,"f")),this.wire_transfers=new e.WireTransfers(s(this,t,"f"))}static get openApiSchemaVersion(){return p}get currentOrganization(){return s(this,h,"f")}config(i){i.organization&&c(this,h,i.organization,"f"),s(this,t,"f").config(i)}resources(){return w.resources()}isApiError(i){return w.isApiError(i)}addRequestInterceptor(i,n){return s(this,t,"f").interceptors.request.use(i,n)}addResponseInterceptor(i,n){return s(this,t,"f").interceptors.response.use(i,n)}removeInterceptor(i,n){return s(this,t,"f").interceptors[i].eject(n)}addRawResponseReader(){const i={id:void 0,rawResponse:void 0};function n(a){return i.rawResponse=a==null?void 0:a.data,a}const r=this.addResponseInterceptor(n);return i.id=r,i}removeRawResponseReader(i){const n=typeof i=="number"?i:i.id;if(n)return this.removeInterceptor("response",n)}}t=new WeakMap,h=new WeakMap;const m=o=>new u(o);export default m;
package/lib/esm/common.js CHANGED
@@ -1 +1 @@
1
- import{resourceList as s}from"./api";const p=e=>e&&e.type&&e.id&&s.includes(e.type),i=e=>e&&typeof e.type!="undefined"&&e.type&&s.includes(e.type);export{p as isResourceId,i as isResourceType};
1
+ import{resourceList as p}from"./api";const e=t=>t&&t.type&&t.id&&p.includes(t.type),i=t=>t&&typeof t.type<"u"&&t.type&&p.includes(t.type);export{e as isResourceId,i as isResourceType};
@@ -1,3 +1 @@
1
- declare type Debugger = (pattern: string, ...args: any[]) => void;
2
- declare const debug: (namespace?: string | undefined) => Debugger;
3
- export default debug;
1
+ declare type Debugger=(pattern:string,...args:any[])=>void;declare const debug:(namespace:string)=>Debugger;export default debug;
package/lib/esm/debug.js CHANGED
@@ -1 +1 @@
1
- const a=(e,...r)=>{};let t=e=>a;try{const e=require("debug");e&&typeof e=="function"&&(t=e)}catch{}const o="clsdk",n=()=>{const e=new Error;Error.prepareStackTrace=(s,c)=>c;const r=e.stack;return Error.prepareStackTrace=void 0,(r[2].getFileName()||"/").replace(/^.*[\\/]/,"").replace(".ts","")},p=e=>t(`${o}:${e||n()}`);export default p;
1
+ const e=(t,...r)=>{};let c=t=>e;try{const t=require("debug");t&&typeof t=="function"&&(c=t)}catch{}const o="clsdk",n=t=>c(`${o}:${t}`);export default n;
@@ -1,26 +1 @@
1
- declare enum ErrorType {
2
- CLIENT = "client",
3
- REQUEST = "request",
4
- RESPONSE = "response",
5
- GENERIC = "generic",
6
- CANCEL = "cancel"
7
- }
8
- declare class SdkError extends Error {
9
- static isSdkError(error: any): error is ApiError;
10
- type: string;
11
- code?: string;
12
- source?: Error;
13
- request?: any;
14
- constructor(error: {
15
- message: string;
16
- type?: ErrorType;
17
- });
18
- }
19
- declare class ApiError extends SdkError {
20
- static isApiError(error: any): error is ApiError;
21
- errors: any[];
22
- status?: number;
23
- constructor(error: SdkError);
24
- first(): any;
25
- }
26
- export { SdkError, ApiError, ErrorType };
1
+ declare enum ErrorType{CLIENT="client",REQUEST="request",RESPONSE="response",GENERIC="generic",CANCEL="cancel"}declare class SdkError extends Error{static isSdkError(error:any):error is ApiError;type:string;code?:string;source?:Error;request?:any;constructor(error:{message:string;type?:ErrorType;});}declare class ApiError extends SdkError{static isApiError(error:any):error is ApiError;errors:any[];status?:number;constructor(error:SdkError);first():any;}export{SdkError,ApiError,ErrorType};
package/lib/esm/error.js CHANGED
@@ -1 +1 @@
1
- var s;(function(e){e.CLIENT="client",e.REQUEST="request",e.RESPONSE="response",e.GENERIC="generic",e.CANCEL="cancel"})(s||(s={}));class t extends Error{constructor(r){super(r.message);this.name=this.constructor.name,this.type=r.type||s.GENERIC}static isSdkError(r){return r&&["SdkError","ApiError"].includes(r.name)&&Object.values(s).includes(r.type)}}class i extends t{constructor(r){super(Object.assign(Object.assign({},r),{type:s.RESPONSE}));this.errors=[],this.name=this.constructor.name}static isApiError(r){return t.isSdkError(r)&&r.name==="ApiError"&&r.type===s.RESPONSE}first(){var r;return((r=this.errors)===null||r===void 0?void 0:r.length)>0?this.errors[0]:void 0}}export{t as SdkError,i as ApiError,s as ErrorType};
1
+ var t;(function(s){s.CLIENT="client",s.REQUEST="request",s.RESPONSE="response",s.GENERIC="generic",s.CANCEL="cancel"})(t||(t={}));class e extends Error{constructor(r){super(r.message);this.name=this.constructor.name,this.type=r.type||t.GENERIC}static isSdkError(r){return r&&["SdkError","ApiError"].includes(r.name)&&Object.values(t).includes(r.type)}}class i extends e{constructor(r){super(Object.assign(Object.assign({},r),{type:t.RESPONSE}));this.errors=[],this.name=this.constructor.name}static isApiError(r){return e.isSdkError(r)&&r.name==="ApiError"&&r.type===t.RESPONSE}first(){var r;return((r=this.errors)===null||r===void 0?void 0:r.length)>0?this.errors[0]:void 0}}export{e as SdkError,i as ApiError,t as ErrorType};
@@ -1,19 +1 @@
1
- import { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse } from "axios";
2
- declare type InterceptorManager = {
3
- request: AxiosInterceptorManager<AxiosRequestConfig>;
4
- response: AxiosInterceptorManager<any>;
5
- };
6
- declare type RequestObj = AxiosRequestConfig;
7
- declare type RequestInterceptor = (request: RequestObj) => RequestObj | Promise<RequestObj>;
8
- declare type ResponseObj = AxiosResponse;
9
- declare type ResponseInterceptor = (response: ResponseObj) => ResponseObj;
10
- declare type ErrorObj = AxiosError;
11
- declare type ErrorInterceptor = (error: ErrorObj) => ErrorObj;
12
- declare type InterceptorType = 'request' | 'response';
13
- export type { InterceptorManager, RequestInterceptor, ResponseInterceptor, ErrorInterceptor, InterceptorType };
14
- export type { RequestObj, ResponseObj, ErrorObj };
15
- declare type RawResponseReader = {
16
- id: number | undefined;
17
- rawResponse: ResponseObj | undefined;
18
- };
19
- export type { RawResponseReader };
1
+ import{AxiosError,AxiosInterceptorManager,AxiosRequestConfig,AxiosResponse}from"axios";declare type InterceptorManager={request:AxiosInterceptorManager<AxiosRequestConfig>;response:AxiosInterceptorManager<any>;};declare type RequestObj=AxiosRequestConfig;declare type RequestInterceptor=(request:RequestObj)=>RequestObj|Promise<RequestObj>;declare type ResponseObj=AxiosResponse;declare type ResponseInterceptor=(response:ResponseObj)=>ResponseObj;declare type ErrorObj=AxiosError;declare type ErrorInterceptor=(error:ErrorObj)=>ErrorObj;declare type InterceptorType='request'|'response';export type{InterceptorManager,RequestInterceptor,ResponseInterceptor,ErrorInterceptor,InterceptorType};export type{RequestObj,ResponseObj,ErrorObj};declare type RawResponseReader={id:number|undefined;rawResponse:ResponseObj|undefined;};export type{RawResponseReader};
@@ -1 +1 @@
1
- import{isResourceId as o}from"./common";const l=e=>{let s;e.links&&delete e.links;const r=e.data,a=e.included;return Array.isArray(r)?s=r.map(i=>t(i,a)):s=t(r,a),s},d=(e,s=[])=>s.find(r=>e.id===r.id&&e.type===r.type)||e,t=(e,s)=>{const r=Object.assign({id:e.id,type:e.type},e.attributes);return e.relationships&&Object.keys(e.relationships).forEach(a=>{const i=e.relationships[a].data;i?Array.isArray(i)?r[a]=i.map(n=>t(d(n,s),s)):r[a]=t(d(i,s),s):i===null&&(r[a]=null)}),r},c=e=>{const s={},r={};for(const i in e){if(["type","id"].includes(i))continue;const n=e[i];n&&(o(n)||Array.isArray(n)&&o(n[0]))?r[i]={data:n}:s[i]=n}const a={type:e.type,attributes:s,relationships:r};return o(e)&&(a.id=e.id),a};export{l as denormalize,c as normalize};
1
+ import{isResourceId as o,isResourceType as d}from"./common";const c=i=>{let t;i.links&&delete i.links;const n=i.data,e=i.included;return Array.isArray(n)?t=n.map(a=>l(a,e)):t=l(n,e),t},r=(i,t=[])=>t.find(e=>i.id===e.id&&i.type===e.type)||i,l=(i,t)=>{const n=Object.assign({id:i.id,type:i.type},i.attributes);return i.relationships&&Object.keys(i.relationships).forEach(e=>{const a=i.relationships[e].data;a?Array.isArray(a)?n[e]=a.map(s=>l(r(s,t),t)):n[e]=l(r(a,t),t):a===null&&(n[e]=null)}),n},f=i=>{const t={},n={};for(const a in i){if(["type","id"].includes(a))continue;const s=i[a];s&&d(s)&&s.id===null?n[a]={data:null}:s&&(o(s)||Array.isArray(s)&&o(s[0]))?n[a]={data:s}:t[a]=s}const e={type:i.type,attributes:t,relationships:n};return o(i)&&(e.id=i.id),e};export{c as denormalize,f as normalize};
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * ©2022 Commerce Layer Inc.
3
- * OpenAPI schema, version 2.8.0
3
+ * OpenAPI schema, version 2.9.1
4
4
  **/
5
5
  export type { Address, AddressCreate, AddressUpdate } from './resources/addresses';
6
6
  export type { Adjustment, AdjustmentCreate, AdjustmentUpdate } from './resources/adjustments';
package/lib/esm/query.js CHANGED
@@ -1 +1 @@
1
- const a=r=>r.filters||r.pageNumber||r.pageSize||r.sort,n=(r,e)=>{const i={};return r&&(r.include&&(i.include=r.include.join(",")),r.fields&&(Array.isArray(r.fields)&&(r.fields={[e.type]:r.fields}),Object.entries(r.fields).forEach(([s,t])=>{i[`fields[${s}]`]=t.join(",")})),a(r)&&(r.sort&&(Array.isArray(r.sort)?i.sort=r.sort.join(","):i.sort=Object.entries(r.sort).map(([s,t])=>`${t==="desc"?"-":""}${s}`).join(",")),r.pageNumber&&(i["page[number]"]=String(r.pageNumber)),r.pageSize&&(i["page[size]"]=String(r.pageSize)),r.filters&&Object.entries(r.filters).forEach(([s,t])=>{i[`filter[q][${s}]`]=String(t)}))),i};export{n as generateQueryStringParams};
1
+ const r=e=>e.filters||e.pageNumber||e.pageSize||e.sort,o=(e,n)=>{const i={};return e&&(e.include&&(i.include=e.include.join(",")),e.fields&&(Array.isArray(e.fields)&&(e.fields={[n.type]:e.fields}),Object.entries(e.fields).forEach(([t,f])=>{i[`fields[${t}]`]=f.join(",")})),r(e)&&(e.sort&&(Array.isArray(e.sort)?i.sort=e.sort.join(","):i.sort=Object.entries(e.sort).map(([t,f])=>`${f==="desc"?"-":""}${t}`).join(",")),e.pageNumber&&(i["page[number]"]=String(e.pageNumber)),e.pageSize&&(i["page[size]"]=String(e.pageSize)),e.filters&&Object.entries(e.filters).forEach(([t,f])=>{i[`filter[q][${t}]`]=String(f)}))),i};export{o as generateQueryStringParams};
@@ -3,6 +3,10 @@ import { QueryParamsRetrieve, QueryParamsList } from './query';
3
3
  import { ResourceTypeLock } from './api';
4
4
  import { InterceptorManager } from './interceptor';
5
5
  import { Value as JSONValue } from 'json-typescript';
6
+ declare type ResourceNull = {
7
+ id: null;
8
+ } & ResourceType;
9
+ declare type ResourceRel = ResourceId | ResourceNull;
6
10
  declare type Metadata = {
7
11
  [key: string]: JSONValue;
8
12
  };
@@ -43,7 +47,7 @@ declare class ListResponse<R> extends Array<R> {
43
47
  last(): R | undefined;
44
48
  get(index: number): R | undefined;
45
49
  }
46
- export type { Metadata, ResourceType, ResourceId, Resource, ResourceCreate, ResourceUpdate, ListResponse };
50
+ export type { Metadata, ResourceType, ResourceId, Resource, ResourceCreate, ResourceUpdate, ListResponse, ResourceRel };
47
51
  declare type ResourceAdapterConfig = {};
48
52
  declare type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig;
49
53
  declare type ResourcesConfig = ResourceAdapterConfig & ApiClientConfig;
@@ -63,7 +67,7 @@ declare abstract class ApiResource {
63
67
  static readonly TYPE: ResourceTypeLock;
64
68
  protected resources: ResourceAdapter;
65
69
  constructor(adapter: ResourceAdapter);
66
- abstract relationship(id: string | ResourceId): ResourceId;
70
+ abstract relationship(id: string | ResourceId | null): ResourceRel;
67
71
  }
68
72
  export default ResourceAdapter;
69
73
  export { ApiResource, ResourcesConfig, ResourcesInitConfig };
@@ -1 +1 @@
1
- var f=this&&this.__classPrivateFieldSet||function(a,t,s,e,r){if(e==="m")throw new TypeError("Private method is not writable");if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?a!==t||!r:!t.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e==="a"?r.call(a,s):r?r.value=s:t.set(a,s),s},o=this&&this.__classPrivateFieldGet||function(a,t,s,e){if(s==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?a!==t||!e:!t.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?e:s==="a"?e.call(a):e?e.value:t.get(a)},n,p;import w from"./client";import{denormalize as l,normalize as h}from"./jsonapi";import{generateQueryStringParams as u}from"./query";import m from"./config";class b extends Array{constructor(t,s){super(...s||[]);this.meta=t}first(){return this.length?this[0]:void 0}last(){return this.length?this[this.length-1]:void 0}get(t){return this.length&&t>=0?this[t]:void 0}}class y{constructor(t){n.set(this,void 0),p.set(this,{}),f(this,n,w.create(t),"f"),this.config(t)}get interceptors(){return o(this,n,"f").interceptors}config(t){o(this,n,"f").config(t)}async singleton(t,s,e){const r=u(s,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=await o(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:r}));return l(i)}async retrieve(t,s,e){const r=u(s,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=await o(this,n,"f").request("get",`${t.type}/${t.id}`,void 0,Object.assign(Object.assign({},e),{params:r}));return l(i)}async list(t,s,e){var r,i;const c=u(s,t);(e==null?void 0:e.params)&&Object.assign(c,e==null?void 0:e.params);const d=await o(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:c})),g=l(d),v={pageCount:Number((r=d.meta)===null||r===void 0?void 0:r.page_count),recordCount:Number((i=d.meta)===null||i===void 0?void 0:i.record_count),currentPage:(s==null?void 0:s.pageNumber)||m.default.pageNumber,recordsPerPage:(s==null?void 0:s.pageSize)||m.default.pageSize};return new b(v,g)}async create(t,s,e){const r=u(s,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=h(t),c=await o(this,n,"f").request("post",t.type,i,Object.assign(Object.assign({},e),{params:r}));return l(c)}async update(t,s,e){const r=u(s,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=h(t),c=await o(this,n,"f").request("patch",`${t.type}/${t.id}`,i,Object.assign(Object.assign({},e),{params:r}));return l(c)}async delete(t,s){await o(this,n,"f").request("delete",`${t.type}/${t.id}`,void 0,s)}}n=new WeakMap,p=new WeakMap;class j{constructor(t){this.resources=t}}export default y;export{j as ApiResource};
1
+ var w=this&&this.__classPrivateFieldSet||function(s,t,a,e,r){if(e==="m")throw new TypeError("Private method is not writable");if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?s!==t||!r:!t.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e==="a"?r.call(s,a):r?r.value=a:t.set(s,a),a},d=this&&this.__classPrivateFieldGet||function(s,t,a,e){if(a==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?s!==t||!e:!t.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?e:a==="a"?e.call(s):e?e.value:t.get(s)},n,h;import y from"./client";import{denormalize as u,normalize as g}from"./jsonapi";import{generateQueryStringParams as o}from"./query";import m from"./config";class b extends Array{constructor(t,a){super(...a||[]);this.meta=t}first(){return this.length?this[0]:void 0}last(){return this.length?this[this.length-1]:void 0}get(t){return this.length&&t>=0?this[t]:void 0}}class p{constructor(t){n.set(this,void 0),h.set(this,{}),w(this,n,y.create(t),"f"),this.config(t)}get interceptors(){return d(this,n,"f").interceptors}config(t){d(this,n,"f").config(t)}async singleton(t,a,e){const r=o(a,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=await d(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async retrieve(t,a,e){const r=o(a,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=await d(this,n,"f").request("get",`${t.type}/${t.id}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async list(t,a,e){var r,i;const c=o(a,t);(e==null?void 0:e.params)&&Object.assign(c,e==null?void 0:e.params);const l=await d(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:c})),f=u(l),v={pageCount:Number((r=l.meta)===null||r===void 0?void 0:r.page_count),recordCount:Number((i=l.meta)===null||i===void 0?void 0:i.record_count),currentPage:(a==null?void 0:a.pageNumber)||m.default.pageNumber,recordsPerPage:(a==null?void 0:a.pageSize)||m.default.pageSize};return new b(v,f)}async create(t,a,e){const r=o(a,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=g(t),c=await d(this,n,"f").request("post",t.type,i,Object.assign(Object.assign({},e),{params:r}));return u(c)}async update(t,a,e){const r=o(a,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=g(t),c=await d(this,n,"f").request("patch",`${t.type}/${t.id}`,i,Object.assign(Object.assign({},e),{params:r}));return u(c)}async delete(t,a){await d(this,n,"f").request("delete",`${t.type}/${t.id}`,void 0,a)}}n=new WeakMap,h=new WeakMap;class j{constructor(t){this.resources=t}}export default p;export{j as ApiResource};
@@ -1,10 +1,10 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import { Geocoder } from './geocoders';
4
- declare type AddressRel = ResourceId & {
4
+ declare type AddressRel = ResourceRel & {
5
5
  type: typeof Addresses.TYPE;
6
6
  };
7
- declare type GeocoderRel = ResourceId & {
7
+ declare type GeocoderRel = ResourceRel & {
8
8
  type: 'geocoders';
9
9
  };
10
10
  interface Address extends Resource {
@@ -80,7 +80,7 @@ declare class Addresses extends ApiResource {
80
80
  update(resource: AddressUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
81
81
  delete(id: string, options?: ResourcesConfig): Promise<void>;
82
82
  isAddress(resource: any): resource is Address;
83
- relationship(id: string | ResourceId): AddressRel;
83
+ relationship(id: string | ResourceId | null): AddressRel;
84
84
  type(): string;
85
85
  }
86
86
  export default Addresses;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class s extends i{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}isAddress(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="addresses";export default s;
1
+ import{ApiResource as a}from"../resource";class e extends a{async list(t,r){return this.resources.list({type:e.TYPE},t,r)}async create(t,r,n){return this.resources.create(Object.assign(Object.assign({},t),{type:e.TYPE}),r,n)}async retrieve(t,r,n){return this.resources.retrieve({type:e.TYPE,id:t},r,n)}async update(t,r,n){return this.resources.update(Object.assign(Object.assign({},t),{type:e.TYPE}),r,n)}async delete(t,r){await this.resources.delete({type:e.TYPE,id:t},r)}isAddress(t){return t.type&&t.type===e.TYPE}relationship(t){return t===null||typeof t=="string"?{id:t,type:e.TYPE}:{id:t.id,type:e.TYPE}}type(){return e.TYPE}}e.TYPE="addresses";export default e;
@@ -1,6 +1,6 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ListResponse } from '../resource';
2
- import { /* QueryBuilderRetrieve, QueryBuilderList, */ QueryParamsList, QueryParamsRetrieve } from '../query';
3
- declare type AdjustmentRel = ResourceId & {
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ declare type AdjustmentRel = ResourceRel & {
4
4
  type: typeof Adjustments.TYPE;
5
5
  };
6
6
  interface Adjustment extends Resource {
@@ -28,7 +28,7 @@ declare class Adjustments extends ApiResource {
28
28
  update(resource: AdjustmentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Adjustment>;
29
29
  delete(id: string, options?: ResourcesConfig): Promise<void>;
30
30
  isAdjustment(resource: any): resource is Adjustment;
31
- relationship(id: string | ResourceId): AdjustmentRel;
31
+ relationship(id: string | ResourceId | null): AdjustmentRel;
32
32
  type(): string;
33
33
  }
34
34
  export default Adjustments;
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class t extends i{async list(e,s){return this.resources.list({type:t.TYPE},e,s)}async create(e,s,r){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async retrieve(e,s,r){return this.resources.retrieve({type:t.TYPE,id:e},s,r)}async update(e,s,r){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async delete(e,s){await this.resources.delete({type:t.TYPE,id:e},s)}isAdjustment(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="adjustments";export default t;
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(Object.assign(Object.assign({},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(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}isAdjustment(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="adjustments";export default r;