@commercelayer/sdk 7.0.0-rc.2 → 7.0.0-rc.3

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 (299) hide show
  1. package/lib/api.d.cts +1 -1
  2. package/lib/api.d.ts +1 -1
  3. package/lib/client.d.cts +1 -1
  4. package/lib/client.d.ts +1 -1
  5. package/lib/commercelayer.cjs.map +1 -1
  6. package/lib/commercelayer.d.cts +1 -2
  7. package/lib/commercelayer.d.ts +1 -2
  8. package/lib/commercelayer.js.map +1 -1
  9. package/lib/config.d.cts +1 -1
  10. package/lib/config.d.ts +1 -1
  11. package/lib/enum.d.cts +1 -1
  12. package/lib/enum.d.ts +1 -1
  13. package/lib/error.cjs.map +1 -1
  14. package/lib/error.js.map +1 -1
  15. package/lib/fetch.cjs +2 -0
  16. package/lib/fetch.cjs.map +1 -1
  17. package/lib/fetch.d.cts +1 -1
  18. package/lib/fetch.d.ts +1 -1
  19. package/lib/fetch.js +2 -0
  20. package/lib/fetch.js.map +1 -1
  21. package/lib/index.d.cts +1 -1
  22. package/lib/index.d.ts +1 -1
  23. package/lib/{interceptor-5MISI1yn.d.cts → interceptor-k15jXzf0.d.cts} +3 -2
  24. package/lib/{interceptor-5MISI1yn.d.ts → interceptor-k15jXzf0.d.ts} +3 -2
  25. package/lib/interceptor.d.cts +1 -1
  26. package/lib/interceptor.d.ts +1 -1
  27. package/lib/jsonapi.d.cts +1 -1
  28. package/lib/jsonapi.d.ts +1 -1
  29. package/lib/model.d.cts +1 -1
  30. package/lib/model.d.ts +1 -1
  31. package/lib/query.d.cts +1 -1
  32. package/lib/query.d.ts +1 -1
  33. package/lib/resource.d.cts +1 -1
  34. package/lib/resource.d.ts +1 -1
  35. package/lib/resources/addresses.d.cts +1 -1
  36. package/lib/resources/addresses.d.ts +1 -1
  37. package/lib/resources/adjustments.d.cts +1 -1
  38. package/lib/resources/adjustments.d.ts +1 -1
  39. package/lib/resources/adyen_gateways.d.cts +1 -1
  40. package/lib/resources/adyen_gateways.d.ts +1 -1
  41. package/lib/resources/adyen_payments.d.cts +1 -1
  42. package/lib/resources/adyen_payments.d.ts +1 -1
  43. package/lib/resources/applications.d.cts +1 -1
  44. package/lib/resources/applications.d.ts +1 -1
  45. package/lib/resources/attachments.d.cts +1 -1
  46. package/lib/resources/attachments.d.ts +1 -1
  47. package/lib/resources/authorizations.d.cts +1 -1
  48. package/lib/resources/authorizations.d.ts +1 -1
  49. package/lib/resources/avalara_accounts.d.cts +1 -1
  50. package/lib/resources/avalara_accounts.d.ts +1 -1
  51. package/lib/resources/axerve_gateways.d.cts +1 -1
  52. package/lib/resources/axerve_gateways.d.ts +1 -1
  53. package/lib/resources/axerve_payments.d.cts +1 -1
  54. package/lib/resources/axerve_payments.d.ts +1 -1
  55. package/lib/resources/bing_geocoders.d.cts +1 -1
  56. package/lib/resources/bing_geocoders.d.ts +1 -1
  57. package/lib/resources/braintree_gateways.d.cts +1 -1
  58. package/lib/resources/braintree_gateways.d.ts +1 -1
  59. package/lib/resources/braintree_payments.d.cts +1 -1
  60. package/lib/resources/braintree_payments.d.ts +1 -1
  61. package/lib/resources/bundles.d.cts +1 -1
  62. package/lib/resources/bundles.d.ts +1 -1
  63. package/lib/resources/buy_x_pay_y_promotions.d.cts +1 -1
  64. package/lib/resources/buy_x_pay_y_promotions.d.ts +1 -1
  65. package/lib/resources/captures.d.cts +1 -1
  66. package/lib/resources/captures.d.ts +1 -1
  67. package/lib/resources/carrier_accounts.d.cts +1 -1
  68. package/lib/resources/carrier_accounts.d.ts +1 -1
  69. package/lib/resources/checkout_com_gateways.d.cts +1 -1
  70. package/lib/resources/checkout_com_gateways.d.ts +1 -1
  71. package/lib/resources/checkout_com_payments.d.cts +1 -1
  72. package/lib/resources/checkout_com_payments.d.ts +1 -1
  73. package/lib/resources/cleanups.d.cts +1 -1
  74. package/lib/resources/cleanups.d.ts +1 -1
  75. package/lib/resources/coupon_codes_promotion_rules.d.cts +1 -1
  76. package/lib/resources/coupon_codes_promotion_rules.d.ts +1 -1
  77. package/lib/resources/coupon_recipients.d.cts +1 -1
  78. package/lib/resources/coupon_recipients.d.ts +1 -1
  79. package/lib/resources/coupons.d.cts +1 -1
  80. package/lib/resources/coupons.d.ts +1 -1
  81. package/lib/resources/custom_promotion_rules.d.cts +1 -1
  82. package/lib/resources/custom_promotion_rules.d.ts +1 -1
  83. package/lib/resources/customer_addresses.d.cts +1 -1
  84. package/lib/resources/customer_addresses.d.ts +1 -1
  85. package/lib/resources/customer_groups.d.cts +1 -1
  86. package/lib/resources/customer_groups.d.ts +1 -1
  87. package/lib/resources/customer_password_resets.d.cts +1 -1
  88. package/lib/resources/customer_password_resets.d.ts +1 -1
  89. package/lib/resources/customer_payment_sources.d.cts +1 -1
  90. package/lib/resources/customer_payment_sources.d.ts +1 -1
  91. package/lib/resources/customer_subscriptions.d.cts +1 -1
  92. package/lib/resources/customer_subscriptions.d.ts +1 -1
  93. package/lib/resources/customers.d.cts +1 -1
  94. package/lib/resources/customers.d.ts +1 -1
  95. package/lib/resources/delivery_lead_times.d.cts +1 -1
  96. package/lib/resources/delivery_lead_times.d.ts +1 -1
  97. package/lib/resources/discount_engine_items.d.cts +1 -1
  98. package/lib/resources/discount_engine_items.d.ts +1 -1
  99. package/lib/resources/discount_engines.d.cts +1 -1
  100. package/lib/resources/discount_engines.d.ts +1 -1
  101. package/lib/resources/easypost_pickups.d.cts +1 -1
  102. package/lib/resources/easypost_pickups.d.ts +1 -1
  103. package/lib/resources/event_callbacks.d.cts +1 -1
  104. package/lib/resources/event_callbacks.d.ts +1 -1
  105. package/lib/resources/events.d.cts +1 -1
  106. package/lib/resources/events.d.ts +1 -1
  107. package/lib/resources/exports.d.cts +1 -1
  108. package/lib/resources/exports.d.ts +1 -1
  109. package/lib/resources/external_gateways.d.cts +1 -1
  110. package/lib/resources/external_gateways.d.ts +1 -1
  111. package/lib/resources/external_payments.d.cts +1 -1
  112. package/lib/resources/external_payments.d.ts +1 -1
  113. package/lib/resources/external_promotions.d.cts +1 -1
  114. package/lib/resources/external_promotions.d.ts +1 -1
  115. package/lib/resources/external_tax_calculators.d.cts +1 -1
  116. package/lib/resources/external_tax_calculators.d.ts +1 -1
  117. package/lib/resources/fixed_amount_promotions.d.cts +1 -1
  118. package/lib/resources/fixed_amount_promotions.d.ts +1 -1
  119. package/lib/resources/fixed_price_promotions.d.cts +1 -1
  120. package/lib/resources/fixed_price_promotions.d.ts +1 -1
  121. package/lib/resources/flex_promotions.d.cts +1 -1
  122. package/lib/resources/flex_promotions.d.ts +1 -1
  123. package/lib/resources/free_gift_promotions.d.cts +1 -1
  124. package/lib/resources/free_gift_promotions.d.ts +1 -1
  125. package/lib/resources/free_shipping_promotions.d.cts +1 -1
  126. package/lib/resources/free_shipping_promotions.d.ts +1 -1
  127. package/lib/resources/geocoders.d.cts +1 -1
  128. package/lib/resources/geocoders.d.ts +1 -1
  129. package/lib/resources/gift_card_recipients.d.cts +1 -1
  130. package/lib/resources/gift_card_recipients.d.ts +1 -1
  131. package/lib/resources/gift_cards.d.cts +1 -1
  132. package/lib/resources/gift_cards.d.ts +1 -1
  133. package/lib/resources/google_geocoders.d.cts +1 -1
  134. package/lib/resources/google_geocoders.d.ts +1 -1
  135. package/lib/resources/imports.d.cts +1 -1
  136. package/lib/resources/imports.d.ts +1 -1
  137. package/lib/resources/in_stock_subscriptions.d.cts +1 -1
  138. package/lib/resources/in_stock_subscriptions.d.ts +1 -1
  139. package/lib/resources/inventory_models.d.cts +1 -1
  140. package/lib/resources/inventory_models.d.ts +1 -1
  141. package/lib/resources/inventory_return_locations.d.cts +1 -1
  142. package/lib/resources/inventory_return_locations.d.ts +1 -1
  143. package/lib/resources/inventory_stock_locations.d.cts +1 -1
  144. package/lib/resources/inventory_stock_locations.d.ts +1 -1
  145. package/lib/resources/klarna_gateways.d.cts +1 -1
  146. package/lib/resources/klarna_gateways.d.ts +1 -1
  147. package/lib/resources/klarna_payments.d.cts +1 -1
  148. package/lib/resources/klarna_payments.d.ts +1 -1
  149. package/lib/resources/line_item_options.d.cts +1 -1
  150. package/lib/resources/line_item_options.d.ts +1 -1
  151. package/lib/resources/line_items.d.cts +1 -1
  152. package/lib/resources/line_items.d.ts +1 -1
  153. package/lib/resources/links.d.cts +1 -1
  154. package/lib/resources/links.d.ts +1 -1
  155. package/lib/resources/manual_gateways.d.cts +1 -1
  156. package/lib/resources/manual_gateways.d.ts +1 -1
  157. package/lib/resources/manual_tax_calculators.d.cts +1 -1
  158. package/lib/resources/manual_tax_calculators.d.ts +1 -1
  159. package/lib/resources/markets.d.cts +1 -1
  160. package/lib/resources/markets.d.ts +1 -1
  161. package/lib/resources/merchants.d.cts +1 -1
  162. package/lib/resources/merchants.d.ts +1 -1
  163. package/lib/resources/notifications.d.cts +1 -1
  164. package/lib/resources/notifications.d.ts +1 -1
  165. package/lib/resources/order_amount_promotion_rules.d.cts +1 -1
  166. package/lib/resources/order_amount_promotion_rules.d.ts +1 -1
  167. package/lib/resources/order_copies.d.cts +1 -1
  168. package/lib/resources/order_copies.d.ts +1 -1
  169. package/lib/resources/order_factories.d.cts +1 -1
  170. package/lib/resources/order_factories.d.ts +1 -1
  171. package/lib/resources/order_subscription_items.d.cts +1 -1
  172. package/lib/resources/order_subscription_items.d.ts +1 -1
  173. package/lib/resources/order_subscriptions.d.cts +1 -1
  174. package/lib/resources/order_subscriptions.d.ts +1 -1
  175. package/lib/resources/orders.d.cts +1 -1
  176. package/lib/resources/orders.d.ts +1 -1
  177. package/lib/resources/organizations.d.cts +1 -1
  178. package/lib/resources/organizations.d.ts +1 -1
  179. package/lib/resources/packages.d.cts +1 -1
  180. package/lib/resources/packages.d.ts +1 -1
  181. package/lib/resources/parcel_line_items.d.cts +1 -1
  182. package/lib/resources/parcel_line_items.d.ts +1 -1
  183. package/lib/resources/parcels.d.cts +1 -1
  184. package/lib/resources/parcels.d.ts +1 -1
  185. package/lib/resources/payment_gateways.d.cts +1 -1
  186. package/lib/resources/payment_gateways.d.ts +1 -1
  187. package/lib/resources/payment_methods.d.cts +1 -1
  188. package/lib/resources/payment_methods.d.ts +1 -1
  189. package/lib/resources/payment_options.d.cts +1 -1
  190. package/lib/resources/payment_options.d.ts +1 -1
  191. package/lib/resources/paypal_gateways.d.cts +1 -1
  192. package/lib/resources/paypal_gateways.d.ts +1 -1
  193. package/lib/resources/paypal_payments.d.cts +1 -1
  194. package/lib/resources/paypal_payments.d.ts +1 -1
  195. package/lib/resources/percentage_discount_promotions.d.cts +1 -1
  196. package/lib/resources/percentage_discount_promotions.d.ts +1 -1
  197. package/lib/resources/pickups.d.cts +1 -1
  198. package/lib/resources/pickups.d.ts +1 -1
  199. package/lib/resources/price_frequency_tiers.d.cts +1 -1
  200. package/lib/resources/price_frequency_tiers.d.ts +1 -1
  201. package/lib/resources/price_list_schedulers.d.cts +1 -1
  202. package/lib/resources/price_list_schedulers.d.ts +1 -1
  203. package/lib/resources/price_lists.d.cts +1 -1
  204. package/lib/resources/price_lists.d.ts +1 -1
  205. package/lib/resources/price_tiers.d.cts +1 -1
  206. package/lib/resources/price_tiers.d.ts +1 -1
  207. package/lib/resources/price_volume_tiers.d.cts +1 -1
  208. package/lib/resources/price_volume_tiers.d.ts +1 -1
  209. package/lib/resources/prices.d.cts +1 -1
  210. package/lib/resources/prices.d.ts +1 -1
  211. package/lib/resources/promotion_rules.d.cts +1 -1
  212. package/lib/resources/promotion_rules.d.ts +1 -1
  213. package/lib/resources/promotions.d.cts +1 -1
  214. package/lib/resources/promotions.d.ts +1 -1
  215. package/lib/resources/recurring_order_copies.d.cts +1 -1
  216. package/lib/resources/recurring_order_copies.d.ts +1 -1
  217. package/lib/resources/refunds.d.cts +1 -1
  218. package/lib/resources/refunds.d.ts +1 -1
  219. package/lib/resources/reserved_stocks.d.cts +1 -1
  220. package/lib/resources/reserved_stocks.d.ts +1 -1
  221. package/lib/resources/resource_errors.d.cts +1 -1
  222. package/lib/resources/resource_errors.d.ts +1 -1
  223. package/lib/resources/return_line_items.d.cts +1 -1
  224. package/lib/resources/return_line_items.d.ts +1 -1
  225. package/lib/resources/returns.d.cts +1 -1
  226. package/lib/resources/returns.d.ts +1 -1
  227. package/lib/resources/satispay_gateways.d.cts +1 -1
  228. package/lib/resources/satispay_gateways.d.ts +1 -1
  229. package/lib/resources/satispay_payments.d.cts +1 -1
  230. package/lib/resources/satispay_payments.d.ts +1 -1
  231. package/lib/resources/shipments.d.cts +1 -1
  232. package/lib/resources/shipments.d.ts +1 -1
  233. package/lib/resources/shipping_categories.d.cts +1 -1
  234. package/lib/resources/shipping_categories.d.ts +1 -1
  235. package/lib/resources/shipping_method_tiers.d.cts +1 -1
  236. package/lib/resources/shipping_method_tiers.d.ts +1 -1
  237. package/lib/resources/shipping_methods.d.cts +1 -1
  238. package/lib/resources/shipping_methods.d.ts +1 -1
  239. package/lib/resources/shipping_weight_tiers.d.cts +1 -1
  240. package/lib/resources/shipping_weight_tiers.d.ts +1 -1
  241. package/lib/resources/shipping_zones.d.cts +1 -1
  242. package/lib/resources/shipping_zones.d.ts +1 -1
  243. package/lib/resources/sku_list_items.d.cts +1 -1
  244. package/lib/resources/sku_list_items.d.ts +1 -1
  245. package/lib/resources/sku_list_promotion_rules.d.cts +1 -1
  246. package/lib/resources/sku_list_promotion_rules.d.ts +1 -1
  247. package/lib/resources/sku_lists.d.cts +1 -1
  248. package/lib/resources/sku_lists.d.ts +1 -1
  249. package/lib/resources/sku_options.d.cts +1 -1
  250. package/lib/resources/sku_options.d.ts +1 -1
  251. package/lib/resources/skus.d.cts +1 -1
  252. package/lib/resources/skus.d.ts +1 -1
  253. package/lib/resources/stock_items.d.cts +1 -1
  254. package/lib/resources/stock_items.d.ts +1 -1
  255. package/lib/resources/stock_line_items.d.cts +1 -1
  256. package/lib/resources/stock_line_items.d.ts +1 -1
  257. package/lib/resources/stock_locations.d.cts +1 -1
  258. package/lib/resources/stock_locations.d.ts +1 -1
  259. package/lib/resources/stock_reservations.d.cts +1 -1
  260. package/lib/resources/stock_reservations.d.ts +1 -1
  261. package/lib/resources/stock_transfers.d.cts +1 -1
  262. package/lib/resources/stock_transfers.d.ts +1 -1
  263. package/lib/resources/stores.d.cts +1 -1
  264. package/lib/resources/stores.d.ts +1 -1
  265. package/lib/resources/stripe_gateways.d.cts +1 -1
  266. package/lib/resources/stripe_gateways.d.ts +1 -1
  267. package/lib/resources/stripe_payments.d.cts +1 -1
  268. package/lib/resources/stripe_payments.d.ts +1 -1
  269. package/lib/resources/stripe_tax_accounts.d.cts +1 -1
  270. package/lib/resources/stripe_tax_accounts.d.ts +1 -1
  271. package/lib/resources/subscription_models.d.cts +1 -1
  272. package/lib/resources/subscription_models.d.ts +1 -1
  273. package/lib/resources/tags.d.cts +1 -1
  274. package/lib/resources/tags.d.ts +1 -1
  275. package/lib/resources/talon_one_accounts.d.cts +1 -1
  276. package/lib/resources/talon_one_accounts.d.ts +1 -1
  277. package/lib/resources/tax_calculators.d.cts +1 -1
  278. package/lib/resources/tax_calculators.d.ts +1 -1
  279. package/lib/resources/tax_categories.d.cts +1 -1
  280. package/lib/resources/tax_categories.d.ts +1 -1
  281. package/lib/resources/tax_rules.d.cts +1 -1
  282. package/lib/resources/tax_rules.d.ts +1 -1
  283. package/lib/resources/taxjar_accounts.d.cts +1 -1
  284. package/lib/resources/taxjar_accounts.d.ts +1 -1
  285. package/lib/resources/transactions.d.cts +1 -1
  286. package/lib/resources/transactions.d.ts +1 -1
  287. package/lib/resources/versions.d.cts +1 -1
  288. package/lib/resources/versions.d.ts +1 -1
  289. package/lib/resources/vertex_accounts.d.cts +1 -1
  290. package/lib/resources/vertex_accounts.d.ts +1 -1
  291. package/lib/resources/voids.d.cts +1 -1
  292. package/lib/resources/voids.d.ts +1 -1
  293. package/lib/resources/webhooks.d.cts +1 -1
  294. package/lib/resources/webhooks.d.ts +1 -1
  295. package/lib/resources/wire_transfers.d.cts +1 -1
  296. package/lib/resources/wire_transfers.d.ts +1 -1
  297. package/lib/static.d.cts +1 -1
  298. package/lib/static.d.ts +1 -1
  299. package/package.json +2 -2
package/lib/api.d.cts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { E as addresses, F as adjustments, G as adyen_gateways, H as adyen_payments, I as application, J as attachments, K as authorizations, N as avalara_accounts, O as axerve_gateways, P as axerve_payments, S as bing_geocoders, W as braintree_gateways, X as braintree_payments, Y as bundles, Z as buy_x_pay_y_promotions, _ as captures, $ as carrier_accounts, a0 as checkout_com_gateways, a1 as checkout_com_payments, a2 as cleanups, a3 as coupon_codes_promotion_rules, a4 as coupon_recipients, a5 as coupons, a6 as custom_promotion_rules, a7 as customer_addresses, a8 as customer_groups, a9 as customer_password_resets, aa as customer_payment_sources, ab as customer_subscriptions, ac as customers, ad as delivery_lead_times, ae as discount_engine_items, af as discount_engines, ag as easypost_pickups, ah as event_callbacks, ai as events, aj as exports, ak as external_gateways, al as external_payments, am as external_promotions, an as external_tax_calculators, ao as fixed_amount_promotions, ap as fixed_price_promotions, aq as flex_promotions, ar as free_gift_promotions, as as free_shipping_promotions, at as geocoders, au as gift_card_recipients, av as gift_cards, aw as google_geocoders, ax as imports, ay as in_stock_subscriptions, az as inventory_models, aA as inventory_return_locations, aB as inventory_stock_locations, aC as klarna_gateways, aD as klarna_payments, aE as line_item_options, aF as line_items, aG as links, aH as manual_gateways, aI as manual_tax_calculators, aJ as markets, aK as merchants, aL as notifications, aM as order_amount_promotion_rules, aN as order_copies, aO as order_factories, aP as order_subscription_items, aQ as order_subscriptions, aR as orders, aS as organization, aT as packages, aU as parcel_line_items, aV as parcels, aW as payment_gateways, aX as payment_methods, aY as payment_options, aZ as paypal_gateways, a_ as paypal_payments, a$ as percentage_discount_promotions, b0 as pickups, b1 as price_frequency_tiers, b2 as price_list_schedulers, b3 as price_lists, b4 as price_tiers, b5 as price_volume_tiers, b6 as prices, b7 as promotion_rules, b8 as promotions, b9 as recurring_order_copies, ba as refunds, bb as reserved_stocks, bc as resource_errors, bd as return_line_items, be as returns, bf as satispay_gateways, bg as satispay_payments, bh as shipments, bi as shipping_categories, bj as shipping_method_tiers, bk as shipping_methods, bl as shipping_weight_tiers, bm as shipping_zones, bn as sku_list_items, bo as sku_list_promotion_rules, bp as sku_lists, bq as sku_options, br as skus, bs as stock_items, bt as stock_line_items, bu as stock_locations, bv as stock_reservations, bw as stock_transfers, bx as stores, by as stripe_gateways, bz as stripe_payments, bA as stripe_tax_accounts, bB as subscription_models, bC as tags, bD as talon_one_accounts, bE as tax_calculators, bF as tax_categories, bG as tax_rules, bH as taxjar_accounts, bI as transactions, bJ as versions, bK as vertex_accounts, bL as voids, bM as webhooks, bN as wire_transfers } from './api-DmIZO_Np.cjs';
2
2
  import './client.cjs';
3
- import './interceptor-5MISI1yn.cjs';
3
+ import './interceptor-k15jXzf0.cjs';
4
4
  import './types.cjs';
package/lib/api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { E as addresses, F as adjustments, G as adyen_gateways, H as adyen_payments, I as application, J as attachments, K as authorizations, N as avalara_accounts, O as axerve_gateways, P as axerve_payments, S as bing_geocoders, W as braintree_gateways, X as braintree_payments, Y as bundles, Z as buy_x_pay_y_promotions, _ as captures, $ as carrier_accounts, a0 as checkout_com_gateways, a1 as checkout_com_payments, a2 as cleanups, a3 as coupon_codes_promotion_rules, a4 as coupon_recipients, a5 as coupons, a6 as custom_promotion_rules, a7 as customer_addresses, a8 as customer_groups, a9 as customer_password_resets, aa as customer_payment_sources, ab as customer_subscriptions, ac as customers, ad as delivery_lead_times, ae as discount_engine_items, af as discount_engines, ag as easypost_pickups, ah as event_callbacks, ai as events, aj as exports, ak as external_gateways, al as external_payments, am as external_promotions, an as external_tax_calculators, ao as fixed_amount_promotions, ap as fixed_price_promotions, aq as flex_promotions, ar as free_gift_promotions, as as free_shipping_promotions, at as geocoders, au as gift_card_recipients, av as gift_cards, aw as google_geocoders, ax as imports, ay as in_stock_subscriptions, az as inventory_models, aA as inventory_return_locations, aB as inventory_stock_locations, aC as klarna_gateways, aD as klarna_payments, aE as line_item_options, aF as line_items, aG as links, aH as manual_gateways, aI as manual_tax_calculators, aJ as markets, aK as merchants, aL as notifications, aM as order_amount_promotion_rules, aN as order_copies, aO as order_factories, aP as order_subscription_items, aQ as order_subscriptions, aR as orders, aS as organization, aT as packages, aU as parcel_line_items, aV as parcels, aW as payment_gateways, aX as payment_methods, aY as payment_options, aZ as paypal_gateways, a_ as paypal_payments, a$ as percentage_discount_promotions, b0 as pickups, b1 as price_frequency_tiers, b2 as price_list_schedulers, b3 as price_lists, b4 as price_tiers, b5 as price_volume_tiers, b6 as prices, b7 as promotion_rules, b8 as promotions, b9 as recurring_order_copies, ba as refunds, bb as reserved_stocks, bc as resource_errors, bd as return_line_items, be as returns, bf as satispay_gateways, bg as satispay_payments, bh as shipments, bi as shipping_categories, bj as shipping_method_tiers, bk as shipping_methods, bl as shipping_weight_tiers, bm as shipping_zones, bn as sku_list_items, bo as sku_list_promotion_rules, bp as sku_lists, bq as sku_options, br as skus, bs as stock_items, bt as stock_line_items, bu as stock_locations, bv as stock_reservations, bw as stock_transfers, bx as stores, by as stripe_gateways, bz as stripe_payments, bA as stripe_tax_accounts, bB as subscription_models, bC as tags, bD as talon_one_accounts, bE as tax_calculators, bF as tax_categories, bG as tax_rules, bH as taxjar_accounts, bI as transactions, bJ as versions, bK as vertex_accounts, bL as voids, bM as webhooks, bN as wire_transfers } from './api-DDgIE2i8.js';
2
2
  import './client.js';
3
- import './interceptor-5MISI1yn.js';
3
+ import './interceptor-k15jXzf0.js';
4
4
  import './types.js';
package/lib/client.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { F as Fetch, f as InterceptorManager, g as FetchResponse } from './interceptor-5MISI1yn.cjs';
1
+ import { F as Fetch, f as InterceptorManager, g as FetchResponse } from './interceptor-k15jXzf0.cjs';
2
2
 
3
3
  type RequestParams = Record<string, string | number | boolean>;
4
4
  type RequestHeaders = Record<string, string>;
package/lib/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { F as Fetch, f as InterceptorManager, g as FetchResponse } from './interceptor-5MISI1yn.js';
1
+ import { F as Fetch, f as InterceptorManager, g as FetchResponse } from './interceptor-k15jXzf0.js';
2
2
 
3
3
  type RequestParams = Record<string, string | number | boolean>;
4
4
  type RequestHeaders = Record<string, string>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/commercelayer.ts"],"names":["Debug","ApiResourceAdapter","getResources","error","isApiError"],"mappings":";;;;;;;;;;;;;AASA,MAAM,KAAA,GAAQA,uBAAM,eAAe,CAAA;AAInC,MAAM,uBAA0B,GAAA;AAchC,MAAM,mBAAoB,CAAA;AAAA,EAEzB,WAAW,oBAA+B,GAAA;AAAE,IAAO,OAAA,uBAAA;AAAA;AAAwB,EAClE,oBAAuB,GAAA,uBAAA;AAAA,EAEhC,OAAe,EAAA;AAAA;AAAA;AAAA;AAAA,EAOf,OAAO,IAAK,MAAuD,EAAA;AAClE,IAAA,IAAI,QAAgB,OAAA,mBAAA,CAAoB,EAAK,GAAA,IAAI,oBAAoB,MAAM,CAAA;AAAA,SAAA,IAEvE,CAAC,mBAAoB,CAAA,EAAA,EAAU,MAAA,IAAI,MAAM,sCAAsC,CAAA;AACnF,IAAA,OAAO,mBAAoB,CAAA,EAAA;AAAA;AAC5B,EAGQ,YAAY,MAAiC,EAAA;AAEpD,IAAA,KAAA,CAAM,iCAAiC,MAAM,CAAA;AAE7C,IAAAC,2BAAA,CAAmB,KAAK,MAAM,CAAA;AAAA;AAM/B;AAAA;AAAA;AAAA;AAAA,EAOA,IAAI,mBAA8B,GAAA;AAAE,IAAO,OAAAA,2BAAA,CAAmB,GAAI,EAAA,CAAE,MAAQ,EAAA,mBAAA;AAAA;AAAoB,EAChG,IAAI,kBAA6B,GAAA;AAAE,IAAO,OAAAA,2BAAA,CAAmB,GAAI,EAAA,CAAE,MAAQ,EAAA,kBAAA;AAAA;AAAmB,EAC9F,IAAY,YAAmC,GAAA;AAAE,IAAO,OAAAA,2BAAA,CAAmB,GAAI,EAAA,CAAE,MAAQ,EAAA,YAAA;AAA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MAAO,MAAA,CAAA,WAAA,GAAc,MAAM,QAAU,EAAA,KAAA,GAAQ,IAAK,EAAA,CAAE,MAAM,MAAM;AAAA,OAAE,CAAA;AAClE,MAAA,MAAA,CAAO,KAAK,QAAS,CAAA,EAAA;AACrB,MAAA,IAAI,SAAS,OAAS,EAAA;AACrB,QAAA,MAAM,KAAiB,EAAC;AACxB,QAAA,QAAA,CAAS,OAAQ,CAAA,OAAA,CAAQ,CAAC,KAAA,EAAO,GAAQ,KAAA;AAAE,UAAA,EAAA,CAAG,GAAG,CAAI,GAAA,KAAA;AAAA,SAAO,CAAA;AAC5D,QAAA,MAAA,CAAO,OAAU,GAAA,EAAA;AAAA;AAElB,MAAO,OAAA,QAAA;AAAA;AAGiB,IAAA,IAAA,CAAK,aAAa,SAAY,GAAA,EAAE,SAAW,EAAA,sBAAA,EAAwB,WAAW,sBAAuB,EAAA;AAC9H,IAAA,MAAA,CAAO,EAAK,GAAA,CAAA;AAEZ,IAAO,OAAA,MAAA;AAAA;AAER,EAEA,uBAAwE,GAAA;AAKvE,IAAA,IAAA,CAAK,aAAa,SAAY,GAAA,MAAA;AAAA;AAGhC;AAIM,MAAA,aAAA,GAAgB,CAAC,MAAyD,KAAA;AAC/E,EAAO,OAAA,mBAAA,CAAoB,IAAI,MAAM,CAAA;AACtC;AAGA,IAAO,qBAAQ,GAAA","file":"commercelayer.cjs","sourcesContent":["\n// import * as api from './api'\nimport { getResources } from './enum'\nimport { isApiError, type ApiError } from './error'\nimport type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor, ResponseObj, HeadersObj, InterceptorManager } from './interceptor'\nimport { ApiResourceAdapter, type ResourcesInitConfig } from './resource'\n\n\nimport Debug from './debug'\nconst debug = Debug('commercelayer')\n\n\n// Autogenerated schema version number, do not remove this line\nconst OPEN_API_SCHEMA_VERSION = '7.8.3'\nexport { OPEN_API_SCHEMA_VERSION }\n\n\n// SDK local configuration\ntype SdkConfig = {\n\t// abc?: string\n}\n\ntype CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig\ntype CommerceLayerConfig = Partial<CommerceLayerInitConfig>\n\n\n\nclass CommerceLayerClient {\n\n\tstatic get openApiSchemaVersion(): string { return OPEN_API_SCHEMA_VERSION }\n\treadonly openApiSchemaVersion = OPEN_API_SCHEMA_VERSION\n\n\tprivate static cl: CommerceLayerClient\n\n\t// ##__CL_RESOURCES_DEF_START__##\n\t// ##__CL_RESOURCES_DEF_TEMPLATE:: ##__TAB__#####__RESOURCE_TYPE__##?: api.##__RESOURCE_CLASS__##\n\t// ##__CL_RESOURCES_DEF_STOP__##\n\n\n\tstatic get (config?: CommerceLayerInitConfig): CommerceLayerClient {\n\t\tif (config) return (CommerceLayerClient.cl = new CommerceLayerClient(config))\n\t\telse\n\t\tif (!CommerceLayerClient.cl) throw new Error('CommerceLayer client not initialized')\n\t\treturn CommerceLayerClient.cl\n\t}\n\n\n\tprivate constructor(config: CommerceLayerInitConfig) {\n\n\t\tdebug('new commercelayer instance %O', config)\n\n\t\tApiResourceAdapter.init(config)\n\n\t\t// ##__CL_RESOURCES_INIT_START__##\n\t\t// ##__CL_RESOURCES_INIT_TEMPLATE:: ##__TAB__####__TAB__##this.##__RESOURCE_TYPE__## = new api.##__RESOURCE_CLASS__##(this.#adapter)\n\t\t// ##__CL_RESOURCES_INIT_STOP__##\n\n\t}\n\n\t// ##__CL_RESOURCES_LEAZY_LOADING_START__##\n\t// ##__CL_RESOURCES_LEAZY_LOADING_TEMPLATE:: ##__TAB__##get ##__RESOURCE_TYPE__##(): api.##__RESOURCE_CLASS__## { return this.###__RESOURCE_TYPE__## || (this.###__RESOURCE_TYPE__## = new api.##__RESOURCE_CLASS__##(this.#adapter)) }\n\t// ##__CL_RESOURCES_LEAZY_LOADING_STOP__##\n\n\t// private get adapter(): ResourceAdapter { return ApiResourceAdapter.get() }\n\tget currentOrganization(): string { return ApiResourceAdapter.get().client?.currentOrganization }\n\tget currentAccessToken(): string { return ApiResourceAdapter.get().client?.currentAccessToken }\n\tprivate get interceptors(): InterceptorManager { return ApiResourceAdapter.get().client?.interceptors }\n\n\n\tprivate localConfig(config: Partial<SdkConfig>): void {\n\t\t// if (config.abc) this.abc = config.abc\n\t}\n\n\n\tconfig(config: CommerceLayerConfig): this {\n\n\t\tdebug('config %o', config)\n\n\t\t// CommerceLayer config\n\t\tthis.localConfig(config)\n\t\t// ResourceAdapter config\n\t\tApiResourceAdapter.config(config)\n\n\t\treturn this\n\n\t}\n\n\t\n\tresources(sort?: boolean): readonly string[] {\n\t\treturn getResources(sort)\n\t}\n\n\tisApiError(error: any): error is ApiError {\n\t\treturn isApiError(error)\n\t}\n\n\n\taddRequestInterceptor(onSuccess?: RequestInterceptor, onFailure?: ErrorInterceptor): number {\n\t\tthis.interceptors.request = { onSuccess, onFailure }\n\t\treturn 1\n\t}\n\n\taddResponseInterceptor(onSuccess?: ResponseInterceptor, onFailure?: ErrorInterceptor): number {\n\t\tthis.interceptors.response = { onSuccess, onFailure }\n\t\treturn 1\n\t}\n\n\tremoveInterceptor(type: InterceptorType, id: number = 1): void {\n\t\tthis.interceptors[type] = undefined\n\t}\n\n\tremoveInterceptors(): void {\n\t\tthis.removeInterceptor('request')\n\t\tthis.removeInterceptor('response')\n\t\tthis.removeRawResponseReader()\n\t}\n\n\taddRawResponseReader(options?: { headers: boolean }): RawResponseReader {\n\n\t\tconst reader: RawResponseReader = {\n\t\t\tid: 0,\n\t\t\trawResponse: undefined,\n\t\t\theaders: undefined,\n\t\t\tok: true\n\t\t}\n\n\t\tasync function rawResponseInterceptor(response: ResponseObj): Promise<ResponseObj> {\n\t\t\treader.rawResponse = await response?.clone().json().catch(() => {})\n\t\t\treader.ok = response.ok\n\t\t\tif (options?.headers) {\n\t\t\t\tconst ho: HeadersObj = {}\n\t\t\t\tresponse.headers.forEach((value, key) => { ho[key] = value })\n\t\t\t\treader.headers = ho\n\t\t\t}\n\t\t\treturn response\n\t\t}\n\t\t\n\t\t/* const interceptor = */this.interceptors.rawReader = { onSuccess: rawResponseInterceptor, onFailure: rawResponseInterceptor }\n\t\treader.id = 1 // interceptor\n\n\t\treturn reader\n\n\t}\n\n\tremoveRawResponseReader(/* reader: number | RawResponseReader */): void {\n\t\t/*\n\t\tconst id = (typeof reader === 'number') ? reader : reader?.id\n\t\tif (id && (id >= 0)) this.removeInterceptor('response', id)\n\t\t*/\n\t\tthis.interceptors.rawReader = undefined\n\t}\n\n}\n\n\n\nconst CommerceLayer = (config: CommerceLayerInitConfig): CommerceLayerClient => {\n\treturn CommerceLayerClient.get(config)\n}\n\n\nexport default CommerceLayer\nexport { CommerceLayer }\n\nexport type { CommerceLayerClient, CommerceLayerConfig, CommerceLayerInitConfig }\n"]}
1
+ {"version":3,"sources":["../src/commercelayer.ts"],"names":["Debug","ApiResourceAdapter","getResources","error","isApiError"],"mappings":";;;;;;;;;;;;;AASA,MAAM,KAAA,GAAQA,uBAAM,eAAe,CAAA;AAI5B,MAAM,uBAA0B,GAAA;AAavC,MAAM,mBAAoB,CAAA;AAAA,EAEzB,WAAW,oBAA+B,GAAA;AAAE,IAAO,OAAA,uBAAA;AAAA;AAAwB,EAClE,oBAAuB,GAAA,uBAAA;AAAA,EAEhC,OAAe,EAAA;AAAA;AAAA;AAAA;AAAA,EAOf,OAAO,IAAK,MAAuD,EAAA;AAClE,IAAA,IAAI,QAAgB,OAAA,mBAAA,CAAoB,EAAK,GAAA,IAAI,oBAAoB,MAAM,CAAA;AAAA,SAAA,IAEvE,CAAC,mBAAoB,CAAA,EAAA,EAAU,MAAA,IAAI,MAAM,sCAAsC,CAAA;AACnF,IAAA,OAAO,mBAAoB,CAAA,EAAA;AAAA;AAC5B,EAGQ,YAAY,MAAiC,EAAA;AAEpD,IAAA,KAAA,CAAM,iCAAiC,MAAM,CAAA;AAE7C,IAAAC,2BAAA,CAAmB,KAAK,MAAM,CAAA;AAAA;AAM/B;AAAA;AAAA;AAAA;AAAA,EAOA,IAAI,mBAA8B,GAAA;AAAE,IAAO,O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AAA;AACjC,IAAA,IAAA,CAAK,uBAAwB,EAAA;AAAA;AAC9B,EAEA,qBAAqB,OAAmD,EAAA;AAEvE,IAAA,MAAM,MAA4B,GAAA;AAAA,MACjC,EAAI,EAAA,CAAA;AAAA,MACJ,WAAa,EAAA,MAAA;AAAA,MACb,OAAS,EAAA,MAAA;AAAA,MACT,EAAI,EAAA;AAAA,KACL;AAEA,IAAA,eAAe,uBAAuB,QAA6C,EAAA;AAClF,MAAO,MAAA,CAAA,WAAA,GAAc,MAAM,QAAU,EAAA,KAAA,GAAQ,IAAK,EAAA,CAAE,MAAM,MAAM;AAAA,OAAE,CAAA;AAClE,MAAA,MAAA,CAAO,KAAK,QAAS,CAAA,EAAA;AACrB,MAAA,IAAI,SAAS,OAAS,EAAA;AACrB,QAAA,MAAM,KAAiB,EAAC;AACxB,QAAA,QAAA,CAAS,OAAQ,CAAA,OAAA,CAAQ,CAAC,KAAA,EAAO,GAAQ,KAAA;AAAE,UAAA,EAAA,CAAG,GAAG,CAAI,GAAA,KAAA;AAAA,SAAO,CAAA;AAC5D,QAAA,MAAA,CAAO,OAAU,GAAA,EAAA;AAAA;AAElB,MAAO,OAAA,QAAA;AAAA;AAGiB,IAAA,IAAA,CAAK,aAAa,SAAY,GAAA,EAAE,SAAW,EAAA,sBAAA,EAAwB,WAAW,sBAAuB,EAAA;AAC9H,IAAA,MAAA,CAAO,EAAK,GAAA,CAAA;AAEZ,IAAO,OAAA,MAAA;AAAA;AAER,EAEA,uBAAwE,GAAA;AAKvE,IAAA,IAAA,CAAK,aAAa,SAAY,GAAA,MAAA;AAAA;AAGhC;AAIM,MAAA,aAAA,GAAgB,CAAC,MAAyD,KAAA;AAC/E,EAAO,OAAA,mBAAA,CAAoB,IAAI,MAAM,CAAA;AACtC;AAGA,IAAO,qBAAQ,GAAA","file":"commercelayer.cjs","sourcesContent":["\n// import * as api from './api'\nimport { getResources } from './enum'\nimport { isApiError, type ApiError } from './error'\nimport type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor, ResponseObj, HeadersObj, InterceptorManager } from './interceptor'\nimport { ApiResourceAdapter, type ResourcesInitConfig } from './resource'\n\n\nimport Debug from './debug'\nconst debug = Debug('commercelayer')\n\n\n// Autogenerated schema version number, do not remove this line\nexport const OPEN_API_SCHEMA_VERSION = '7.8.3'\n\n\n// SDK local configuration\ntype SdkConfig = {\n\t// abc?: string\n}\n\ntype CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig\ntype CommerceLayerConfig = Partial<CommerceLayerInitConfig>\n\n\n\nclass CommerceLayerClient {\n\n\tstatic get openApiSchemaVersion(): string { return OPEN_API_SCHEMA_VERSION }\n\treadonly openApiSchemaVersion = OPEN_API_SCHEMA_VERSION\n\n\tprivate static cl: CommerceLayerClient\n\n\t// ##__CL_RESOURCES_DEF_START__##\n\t// ##__CL_RESOURCES_DEF_TEMPLATE:: ##__TAB__#####__RESOURCE_TYPE__##?: api.##__RESOURCE_CLASS__##\n\t// ##__CL_RESOURCES_DEF_STOP__##\n\n\n\tstatic get (config?: CommerceLayerInitConfig): CommerceLayerClient {\n\t\tif (config) return (CommerceLayerClient.cl = new CommerceLayerClient(config))\n\t\telse\n\t\tif (!CommerceLayerClient.cl) throw new Error('CommerceLayer client not initialized')\n\t\treturn CommerceLayerClient.cl\n\t}\n\n\n\tprivate constructor(config: CommerceLayerInitConfig) {\n\n\t\tdebug('new commercelayer instance %O', config)\n\n\t\tApiResourceAdapter.init(config)\n\n\t\t// ##__CL_RESOURCES_INIT_START__##\n\t\t// ##__CL_RESOURCES_INIT_TEMPLATE:: ##__TAB__####__TAB__##this.##__RESOURCE_TYPE__## = new api.##__RESOURCE_CLASS__##(this.#adapter)\n\t\t// ##__CL_RESOURCES_INIT_STOP__##\n\n\t}\n\n\t// ##__CL_RESOURCES_LEAZY_LOADING_START__##\n\t// ##__CL_RESOURCES_LEAZY_LOADING_TEMPLATE:: ##__TAB__##get ##__RESOURCE_TYPE__##(): api.##__RESOURCE_CLASS__## { return this.###__RESOURCE_TYPE__## || (this.###__RESOURCE_TYPE__## = new api.##__RESOURCE_CLASS__##(this.#adapter)) }\n\t// ##__CL_RESOURCES_LEAZY_LOADING_STOP__##\n\n\t// private get adapter(): ResourceAdapter { return ApiResourceAdapter.get() }\n\tget currentOrganization(): string { return ApiResourceAdapter.get().client?.currentOrganization }\n\tget currentAccessToken(): string { return ApiResourceAdapter.get().client?.currentAccessToken }\n\tprivate get interceptors(): InterceptorManager { return ApiResourceAdapter.get().client?.interceptors }\n\n\n\tprivate localConfig(config: Partial<SdkConfig>): void {\n\t\t// if (config.abc) this.abc = config.abc\n\t}\n\n\n\tconfig(config: CommerceLayerConfig): this {\n\n\t\tdebug('config %o', config)\n\n\t\t// CommerceLayer config\n\t\tthis.localConfig(config)\n\t\t// ResourceAdapter config\n\t\tApiResourceAdapter.config(config)\n\n\t\treturn this\n\n\t}\n\n\t\n\tresources(sort?: boolean): readonly string[] {\n\t\treturn getResources(sort)\n\t}\n\n\tisApiError(error: any): error is ApiError {\n\t\treturn isApiError(error)\n\t}\n\n\n\taddRequestInterceptor(onSuccess?: RequestInterceptor, onFailure?: ErrorInterceptor): number {\n\t\tthis.interceptors.request = { onSuccess, onFailure }\n\t\treturn 1\n\t}\n\n\taddResponseInterceptor(onSuccess?: ResponseInterceptor, onFailure?: ErrorInterceptor): number {\n\t\tthis.interceptors.response = { onSuccess, onFailure }\n\t\treturn 1\n\t}\n\n\tremoveInterceptor(type: InterceptorType, id: number = 1): void {\n\t\tthis.interceptors[type] = undefined\n\t}\n\n\tremoveInterceptors(): void {\n\t\tthis.removeInterceptor('request')\n\t\tthis.removeInterceptor('response')\n\t\tthis.removeRawResponseReader()\n\t}\n\n\taddRawResponseReader(options?: { headers: boolean }): RawResponseReader {\n\n\t\tconst reader: RawResponseReader = {\n\t\t\tid: 0,\n\t\t\trawResponse: undefined,\n\t\t\theaders: undefined,\n\t\t\tok: true\n\t\t}\n\n\t\tasync function rawResponseInterceptor(response: ResponseObj): Promise<ResponseObj> {\n\t\t\treader.rawResponse = await response?.clone().json().catch(() => {})\n\t\t\treader.ok = response.ok\n\t\t\tif (options?.headers) {\n\t\t\t\tconst ho: HeadersObj = {}\n\t\t\t\tresponse.headers.forEach((value, key) => { ho[key] = value })\n\t\t\t\treader.headers = ho\n\t\t\t}\n\t\t\treturn response\n\t\t}\n\t\t\n\t\t/* const interceptor = */this.interceptors.rawReader = { onSuccess: rawResponseInterceptor, onFailure: rawResponseInterceptor }\n\t\treader.id = 1 // interceptor\n\n\t\treturn reader\n\n\t}\n\n\tremoveRawResponseReader(/* reader: number | RawResponseReader */): void {\n\t\t/*\n\t\tconst id = (typeof reader === 'number') ? reader : reader?.id\n\t\tif (id && (id >= 0)) this.removeInterceptor('response', id)\n\t\t*/\n\t\tthis.interceptors.rawReader = undefined\n\t}\n\n}\n\n\n\nconst CommerceLayer = (config: CommerceLayerInitConfig): CommerceLayerClient => {\n\treturn CommerceLayerClient.get(config)\n}\n\n\nexport default CommerceLayer\nexport { CommerceLayer }\n\nexport type { CommerceLayerClient, CommerceLayerConfig, CommerceLayerInitConfig }\n"]}
@@ -1,11 +1,10 @@
1
1
  import { ApiError } from './error.cjs';
2
- import { b as RequestInterceptor, c as ErrorInterceptor, d as ResponseInterceptor, I as InterceptorType, e as RawResponseReader } from './interceptor-5MISI1yn.cjs';
2
+ import { b as RequestInterceptor, c as ErrorInterceptor, d as ResponseInterceptor, I as InterceptorType, e as RawResponseReader } from './interceptor-k15jXzf0.cjs';
3
3
  import { r as ResourcesInitConfig } from './api-DmIZO_Np.cjs';
4
4
  import './client.cjs';
5
5
  import './types.cjs';
6
6
 
7
7
  declare const OPEN_API_SCHEMA_VERSION = "7.8.3";
8
-
9
8
  type SdkConfig = {};
10
9
  type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
11
10
  type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
@@ -1,11 +1,10 @@
1
1
  import { ApiError } from './error.js';
2
- import { b as RequestInterceptor, c as ErrorInterceptor, d as ResponseInterceptor, I as InterceptorType, e as RawResponseReader } from './interceptor-5MISI1yn.js';
2
+ import { b as RequestInterceptor, c as ErrorInterceptor, d as ResponseInterceptor, I as InterceptorType, e as RawResponseReader } from './interceptor-k15jXzf0.js';
3
3
  import { r as ResourcesInitConfig } from './api-DDgIE2i8.js';
4
4
  import './client.js';
5
5
  import './types.js';
6
6
 
7
7
  declare const OPEN_API_SCHEMA_VERSION = "7.8.3";
8
-
9
8
  type SdkConfig = {};
10
9
  type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
11
10
  type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/commercelayer.ts"],"names":[],"mappings":";;;;;AASA,MAAM,KAAA,GAAQ,MAAM,eAAe,CAAA;AAInC,MAAM,uBAA0B,GAAA;AAchC,MAAM,mBAAoB,CAAA;AAAA,EAEzB,WAAW,oBAA+B,GAAA;AAAE,IAAO,OAAA,uBAAA;AAAA;AAAwB,EAClE,oBAAuB,GAAA,uBAAA;AAAA,EAEhC,OAAe,EAAA;AAAA;AAAA;AAAA;AAAA,EAOf,OAAO,IAAK,MAAuD,EAAA;AAClE,IAAA,IAAI,QAAgB,OAAA,mBAAA,CAAoB,EAAK,GAAA,IAAI,oBAAoB,MAAM,CAAA;AAAA,SAAA,IAEvE,CAAC,mBAAoB,CAAA,EAAA,EAAU,MAAA,IAAI,MAAM,sCAAsC,CAAA;AACnF,IAAA,OAAO,mBAAoB,CAAA,EAAA;AAAA;AAC5B,EAGQ,YAAY,MAAiC,EAAA;AAEpD,IAAA,KAAA,CAAM,iCAAiC,MAAM,CAAA;AAE7C,IAAA,kBAAA,CAAmB,KAAK,MAAM,CAAA;AAAA;AAM/B;AAAA;AAAA;AAAA;AAAA,EAOA,IAAI,mBAA8B,GAAA;AAAE,IAAO,OAAA,kBAAA,CAAmB,GAAI,EAAA,CAAE,MAAQ,EAAA,mBAAA;AAAA;A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,EAAA;AAEvE,IAAA,MAAM,MAA4B,GAAA;AAAA,MACjC,EAAI,EAAA,CAAA;AAAA,MACJ,WAAa,EAAA,MAAA;AAAA,MACb,OAAS,EAAA,MAAA;AAAA,MACT,EAAI,EAAA;AAAA,KACL;AAEA,IAAA,eAAe,uBAAuB,QAA6C,EAAA;AAClF,MAAO,MAAA,CAAA,WAAA,GAAc,MAAM,QAAU,EAAA,KAAA,GAAQ,IAAK,EAAA,CAAE,MAAM,MAAM;AAAA,OAAE,CAAA;AAClE,MAAA,MAAA,CAAO,KAAK,QAAS,CAAA,EAAA;AACrB,MAAA,IAAI,SAAS,OAAS,EAAA;AACrB,QAAA,MAAM,KAAiB,EAAC;AACxB,QAAA,QAAA,CAAS,OAAQ,CAAA,OAAA,CAAQ,CAAC,KAAA,EAAO,GAAQ,KAAA;AAAE,UAAA,EAAA,CAAG,GAAG,CAAI,GAAA,KAAA;AAAA,SAAO,CAAA;AAC5D,QAAA,MAAA,CAAO,OAAU,GAAA,EAAA;AAAA;AAElB,MAAO,OAAA,QAAA;AAAA;AAGiB,IAAA,IAAA,CAAK,aAAa,SAAY,GAAA,EAAE,SAAW,EAAA,sBAAA,EAAwB,WAAW,sBAAuB,EAAA;AAC9H,IAAA,MAAA,CAAO,EAAK,GAAA,CAAA;AAEZ,IAAO,OAAA,MAAA;AAAA;AAER,EAEA,uBAAwE,GAAA;AAKvE,IAAA,IAAA,CAAK,aAAa,SAAY,GAAA,MAAA;AAAA;AAGhC;AAIM,MAAA,aAAA,GAAgB,CAAC,MAAyD,KAAA;AAC/E,EAAO,OAAA,mBAAA,CAAoB,IAAI,MAAM,CAAA;AACtC;AAGA,IAAO,qBAAQ,GAAA","file":"commercelayer.js","sourcesContent":["\n// import * as api from './api'\nimport { getResources } from './enum'\nimport { isApiError, type ApiError } from './error'\nimport type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor, ResponseObj, HeadersObj, InterceptorManager } from './interceptor'\nimport { ApiResourceAdapter, type ResourcesInitConfig } from './resource'\n\n\nimport Debug from './debug'\nconst debug = Debug('commercelayer')\n\n\n// Autogenerated schema version number, do not remove this line\nconst OPEN_API_SCHEMA_VERSION = '7.8.3'\nexport { OPEN_API_SCHEMA_VERSION }\n\n\n// SDK local configuration\ntype SdkConfig = {\n\t// abc?: string\n}\n\ntype CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig\ntype CommerceLayerConfig = Partial<CommerceLayerInitConfig>\n\n\n\nclass CommerceLayerClient {\n\n\tstatic get openApiSchemaVersion(): string { return OPEN_API_SCHEMA_VERSION }\n\treadonly openApiSchemaVersion = OPEN_API_SCHEMA_VERSION\n\n\tprivate static cl: CommerceLayerClient\n\n\t// ##__CL_RESOURCES_DEF_START__##\n\t// ##__CL_RESOURCES_DEF_TEMPLATE:: ##__TAB__#####__RESOURCE_TYPE__##?: api.##__RESOURCE_CLASS__##\n\t// ##__CL_RESOURCES_DEF_STOP__##\n\n\n\tstatic get (config?: CommerceLayerInitConfig): CommerceLayerClient {\n\t\tif (config) return (CommerceLayerClient.cl = new CommerceLayerClient(config))\n\t\telse\n\t\tif (!CommerceLayerClient.cl) throw new Error('CommerceLayer client not initialized')\n\t\treturn CommerceLayerClient.cl\n\t}\n\n\n\tprivate constructor(config: CommerceLayerInitConfig) {\n\n\t\tdebug('new commercelayer instance %O', config)\n\n\t\tApiResourceAdapter.init(config)\n\n\t\t// ##__CL_RESOURCES_INIT_START__##\n\t\t// ##__CL_RESOURCES_INIT_TEMPLATE:: ##__TAB__####__TAB__##this.##__RESOURCE_TYPE__## = new api.##__RESOURCE_CLASS__##(this.#adapter)\n\t\t// ##__CL_RESOURCES_INIT_STOP__##\n\n\t}\n\n\t// ##__CL_RESOURCES_LEAZY_LOADING_START__##\n\t// ##__CL_RESOURCES_LEAZY_LOADING_TEMPLATE:: ##__TAB__##get ##__RESOURCE_TYPE__##(): api.##__RESOURCE_CLASS__## { return this.###__RESOURCE_TYPE__## || (this.###__RESOURCE_TYPE__## = new api.##__RESOURCE_CLASS__##(this.#adapter)) }\n\t// ##__CL_RESOURCES_LEAZY_LOADING_STOP__##\n\n\t// private get adapter(): ResourceAdapter { return ApiResourceAdapter.get() }\n\tget currentOrganization(): string { return ApiResourceAdapter.get().client?.currentOrganization }\n\tget currentAccessToken(): string { return ApiResourceAdapter.get().client?.currentAccessToken }\n\tprivate get interceptors(): InterceptorManager { return ApiResourceAdapter.get().client?.interceptors }\n\n\n\tprivate localConfig(config: Partial<SdkConfig>): void {\n\t\t// if (config.abc) this.abc = config.abc\n\t}\n\n\n\tconfig(config: CommerceLayerConfig): this {\n\n\t\tdebug('config %o', config)\n\n\t\t// CommerceLayer config\n\t\tthis.localConfig(config)\n\t\t// ResourceAdapter config\n\t\tApiResourceAdapter.config(config)\n\n\t\treturn this\n\n\t}\n\n\t\n\tresources(sort?: boolean): readonly string[] {\n\t\treturn getResources(sort)\n\t}\n\n\tisApiError(error: any): error is ApiError {\n\t\treturn isApiError(error)\n\t}\n\n\n\taddRequestInterceptor(onSuccess?: RequestInterceptor, onFailure?: ErrorInterceptor): number {\n\t\tthis.interceptors.request = { onSuccess, onFailure }\n\t\treturn 1\n\t}\n\n\taddResponseInterceptor(onSuccess?: ResponseInterceptor, onFailure?: ErrorInterceptor): number {\n\t\tthis.interceptors.response = { onSuccess, onFailure }\n\t\treturn 1\n\t}\n\n\tremoveInterceptor(type: InterceptorType, id: number = 1): void {\n\t\tthis.interceptors[type] = undefined\n\t}\n\n\tremoveInterceptors(): void {\n\t\tthis.removeInterceptor('request')\n\t\tthis.removeInterceptor('response')\n\t\tthis.removeRawResponseReader()\n\t}\n\n\taddRawResponseReader(options?: { headers: boolean }): RawResponseReader {\n\n\t\tconst reader: RawResponseReader = {\n\t\t\tid: 0,\n\t\t\trawResponse: undefined,\n\t\t\theaders: undefined,\n\t\t\tok: true\n\t\t}\n\n\t\tasync function rawResponseInterceptor(response: ResponseObj): Promise<ResponseObj> {\n\t\t\treader.rawResponse = await response?.clone().json().catch(() => {})\n\t\t\treader.ok = response.ok\n\t\t\tif (options?.headers) {\n\t\t\t\tconst ho: HeadersObj = {}\n\t\t\t\tresponse.headers.forEach((value, key) => { ho[key] = value })\n\t\t\t\treader.headers = ho\n\t\t\t}\n\t\t\treturn response\n\t\t}\n\t\t\n\t\t/* const interceptor = */this.interceptors.rawReader = { onSuccess: rawResponseInterceptor, onFailure: rawResponseInterceptor }\n\t\treader.id = 1 // interceptor\n\n\t\treturn reader\n\n\t}\n\n\tremoveRawResponseReader(/* reader: number | RawResponseReader */): void {\n\t\t/*\n\t\tconst id = (typeof reader === 'number') ? reader : reader?.id\n\t\tif (id && (id >= 0)) this.removeInterceptor('response', id)\n\t\t*/\n\t\tthis.interceptors.rawReader = undefined\n\t}\n\n}\n\n\n\nconst CommerceLayer = (config: CommerceLayerInitConfig): CommerceLayerClient => {\n\treturn CommerceLayerClient.get(config)\n}\n\n\nexport default CommerceLayer\nexport { CommerceLayer }\n\nexport type { CommerceLayerClient, CommerceLayerConfig, CommerceLayerInitConfig }\n"]}
1
+ {"version":3,"sources":["../src/commercelayer.ts"],"names":[],"mappings":";;;;;AASA,MAAM,KAAA,GAAQ,MAAM,eAAe,CAAA;AAI5B,MAAM,uBAA0B,GAAA;AAavC,MAAM,mBAAoB,CAAA;AAAA,EAEzB,WAAW,oBAA+B,GAAA;AAAE,IAAO,OAAA,uBAAA;AAAA;AAAwB,EAClE,oBAAuB,GAAA,uBAAA;AAAA,EAEhC,OAAe,EAAA;AAAA;AAAA;AAAA;AAAA,EAOf,OAAO,IAAK,MAAuD,EAAA;AAClE,IAAA,IAAI,QAAgB,OAAA,mBAAA,CAAoB,EAAK,GAAA,IAAI,oBAAoB,MAAM,CAAA;AAAA,SAAA,IAEvE,CAAC,mBAAoB,CAAA,EAAA,EAAU,MAAA,IAAI,MAAM,sCAAsC,CAAA;AACnF,IAAA,OAAO,mBAAoB,CAAA,EAAA;AAAA;AAC5B,EAGQ,YAAY,MAAiC,EAAA;AAEpD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AAM,CAAA;AACtC;AAGA,IAAO,qBAAQ,GAAA","file":"commercelayer.js","sourcesContent":["\n// import * as api from './api'\nimport { getResources } from './enum'\nimport { isApiError, type ApiError } from './error'\nimport type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor, ResponseObj, HeadersObj, InterceptorManager } from './interceptor'\nimport { ApiResourceAdapter, type ResourcesInitConfig } from './resource'\n\n\nimport Debug from './debug'\nconst debug = Debug('commercelayer')\n\n\n// Autogenerated schema version number, do not remove this line\nexport const OPEN_API_SCHEMA_VERSION = '7.8.3'\n\n\n// SDK local configuration\ntype SdkConfig = {\n\t// abc?: string\n}\n\ntype CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig\ntype CommerceLayerConfig = Partial<CommerceLayerInitConfig>\n\n\n\nclass CommerceLayerClient {\n\n\tstatic get openApiSchemaVersion(): string { return OPEN_API_SCHEMA_VERSION }\n\treadonly openApiSchemaVersion = OPEN_API_SCHEMA_VERSION\n\n\tprivate static cl: CommerceLayerClient\n\n\t// ##__CL_RESOURCES_DEF_START__##\n\t// ##__CL_RESOURCES_DEF_TEMPLATE:: ##__TAB__#####__RESOURCE_TYPE__##?: api.##__RESOURCE_CLASS__##\n\t// ##__CL_RESOURCES_DEF_STOP__##\n\n\n\tstatic get (config?: CommerceLayerInitConfig): CommerceLayerClient {\n\t\tif (config) return (CommerceLayerClient.cl = new CommerceLayerClient(config))\n\t\telse\n\t\tif (!CommerceLayerClient.cl) throw new Error('CommerceLayer client not initialized')\n\t\treturn CommerceLayerClient.cl\n\t}\n\n\n\tprivate constructor(config: CommerceLayerInitConfig) {\n\n\t\tdebug('new commercelayer instance %O', config)\n\n\t\tApiResourceAdapter.init(config)\n\n\t\t// ##__CL_RESOURCES_INIT_START__##\n\t\t// ##__CL_RESOURCES_INIT_TEMPLATE:: ##__TAB__####__TAB__##this.##__RESOURCE_TYPE__## = new api.##__RESOURCE_CLASS__##(this.#adapter)\n\t\t// ##__CL_RESOURCES_INIT_STOP__##\n\n\t}\n\n\t// ##__CL_RESOURCES_LEAZY_LOADING_START__##\n\t// ##__CL_RESOURCES_LEAZY_LOADING_TEMPLATE:: ##__TAB__##get ##__RESOURCE_TYPE__##(): api.##__RESOURCE_CLASS__## { return this.###__RESOURCE_TYPE__## || (this.###__RESOURCE_TYPE__## = new api.##__RESOURCE_CLASS__##(this.#adapter)) }\n\t// ##__CL_RESOURCES_LEAZY_LOADING_STOP__##\n\n\t// private get adapter(): ResourceAdapter { return ApiResourceAdapter.get() }\n\tget currentOrganization(): string { return ApiResourceAdapter.get().client?.currentOrganization }\n\tget currentAccessToken(): string { return ApiResourceAdapter.get().client?.currentAccessToken }\n\tprivate get interceptors(): InterceptorManager { return ApiResourceAdapter.get().client?.interceptors }\n\n\n\tprivate localConfig(config: Partial<SdkConfig>): void {\n\t\t// if (config.abc) this.abc = config.abc\n\t}\n\n\n\tconfig(config: CommerceLayerConfig): this {\n\n\t\tdebug('config %o', config)\n\n\t\t// CommerceLayer config\n\t\tthis.localConfig(config)\n\t\t// ResourceAdapter config\n\t\tApiResourceAdapter.config(config)\n\n\t\treturn this\n\n\t}\n\n\t\n\tresources(sort?: boolean): readonly string[] {\n\t\treturn getResources(sort)\n\t}\n\n\tisApiError(error: any): error is ApiError {\n\t\treturn isApiError(error)\n\t}\n\n\n\taddRequestInterceptor(onSuccess?: RequestInterceptor, onFailure?: ErrorInterceptor): number {\n\t\tthis.interceptors.request = { onSuccess, onFailure }\n\t\treturn 1\n\t}\n\n\taddResponseInterceptor(onSuccess?: ResponseInterceptor, onFailure?: ErrorInterceptor): number {\n\t\tthis.interceptors.response = { onSuccess, onFailure }\n\t\treturn 1\n\t}\n\n\tremoveInterceptor(type: InterceptorType, id: number = 1): void {\n\t\tthis.interceptors[type] = undefined\n\t}\n\n\tremoveInterceptors(): void {\n\t\tthis.removeInterceptor('request')\n\t\tthis.removeInterceptor('response')\n\t\tthis.removeRawResponseReader()\n\t}\n\n\taddRawResponseReader(options?: { headers: boolean }): RawResponseReader {\n\n\t\tconst reader: RawResponseReader = {\n\t\t\tid: 0,\n\t\t\trawResponse: undefined,\n\t\t\theaders: undefined,\n\t\t\tok: true\n\t\t}\n\n\t\tasync function rawResponseInterceptor(response: ResponseObj): Promise<ResponseObj> {\n\t\t\treader.rawResponse = await response?.clone().json().catch(() => {})\n\t\t\treader.ok = response.ok\n\t\t\tif (options?.headers) {\n\t\t\t\tconst ho: HeadersObj = {}\n\t\t\t\tresponse.headers.forEach((value, key) => { ho[key] = value })\n\t\t\t\treader.headers = ho\n\t\t\t}\n\t\t\treturn response\n\t\t}\n\t\t\n\t\t/* const interceptor = */this.interceptors.rawReader = { onSuccess: rawResponseInterceptor, onFailure: rawResponseInterceptor }\n\t\treader.id = 1 // interceptor\n\n\t\treturn reader\n\n\t}\n\n\tremoveRawResponseReader(/* reader: number | RawResponseReader */): void {\n\t\t/*\n\t\tconst id = (typeof reader === 'number') ? reader : reader?.id\n\t\tif (id && (id >= 0)) this.removeInterceptor('response', id)\n\t\t*/\n\t\tthis.interceptors.rawReader = undefined\n\t}\n\n}\n\n\n\nconst CommerceLayer = (config: CommerceLayerInitConfig): CommerceLayerClient => {\n\treturn CommerceLayerClient.get(config)\n}\n\n\nexport default CommerceLayer\nexport { CommerceLayer }\n\nexport type { CommerceLayerClient, CommerceLayerConfig, CommerceLayerInitConfig }\n"]}
package/lib/config.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ApiClientInitConfig } from './client.cjs';
2
- import './interceptor-5MISI1yn.cjs';
2
+ import './interceptor-k15jXzf0.cjs';
3
3
 
4
4
  declare const config: {
5
5
  readonly default: {
package/lib/config.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ApiClientInitConfig } from './client.js';
2
- import './interceptor-5MISI1yn.js';
2
+ import './interceptor-k15jXzf0.js';
3
3
 
4
4
  declare const config: {
5
5
  readonly default: {
package/lib/enum.d.cts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { x as CreatableResource, C as CreatableResourceType, z as DeletableResource, D as DeletableResourceType, w as ListableResource, v as ListableResourceType, lF as ResourceFields, lG as ResourceSortFields, s as ResourceTypeLock, u as RetrievableResource, t as RetrievableResourceType, A as TaggableResource, T as TaggableResourceType, y as UpdatableResource, U as UpdatableResourceType, B as VersionableResource, V as VersionableResourceType, ls as creatableResources, lu as deletableResources, lx as getResources, ly as getSingletons, lA as isCreatable, lC as isDeletable, lz as isSingleton, lD as isTaggable, lB as isUpdatable, lE as isVersionable, lq as resourceList, lr as singletonList, lv as taggableResources, lt as updatableResources, lw as versionableResources } from './api-DmIZO_Np.cjs';
2
2
  import './client.cjs';
3
- import './interceptor-5MISI1yn.cjs';
3
+ import './interceptor-k15jXzf0.cjs';
4
4
  import './types.cjs';
package/lib/enum.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { x as CreatableResource, C as CreatableResourceType, z as DeletableResource, D as DeletableResourceType, w as ListableResource, v as ListableResourceType, lF as ResourceFields, lG as ResourceSortFields, s as ResourceTypeLock, u as RetrievableResource, t as RetrievableResourceType, A as TaggableResource, T as TaggableResourceType, y as UpdatableResource, U as UpdatableResourceType, B as VersionableResource, V as VersionableResourceType, ls as creatableResources, lu as deletableResources, lx as getResources, ly as getSingletons, lA as isCreatable, lC as isDeletable, lz as isSingleton, lD as isTaggable, lB as isUpdatable, lE as isVersionable, lq as resourceList, lr as singletonList, lv as taggableResources, lt as updatableResources, lw as versionableResources } from './api-DDgIE2i8.js';
2
2
  import './client.js';
3
- import './interceptor-5MISI1yn.js';
3
+ import './interceptor-k15jXzf0.js';
4
4
  import './types.js';
package/lib/error.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/error.ts"],"names":["ErrorType","FetchError"],"mappings":";;;;AAGK,IAAA,SAAA,qBAAAA,UAAL,KAAA;AACC,EAAAA,WAAA,QAAS,CAAA,GAAA,QAAA;AACT,EAAAA,WAAA,SAAU,CAAA,GAAA,SAAA;AACV,EAAAA,WAAA,UAAW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\t \t\t\t\t// Generic Client error\n\tREQUEST = 'request',\t\t\t\t\t\t// Error preparing API request\n\tRESPONSE = 'response',\t\t\t\t\t// Error response from API\n\tCANCEL = 'cancel',\t\t \t\t\t\t// Forced request abort using interceptor\n\tPARSE = 'parse',\t\t \t\t\t\t// Error parsing API resource\n TIMEOUT = 'timeout', \t\t\t\t// Timeout error\n\tTOKEN_REFRESH = 'token-refresh'\t// Error calling refresh token function\n}\n\n\nclass SdkError extends Error {\n\n\tstatic NAME = 'SdkError'\n\n\tstatic isSdkError(error: any): error is SdkError {\n\t\treturn error && [SdkError.NAME, ApiError.NAME].includes(error.name as string) && Object.values(ErrorType).includes(error.type as ErrorType)\n\t}\n\n\ttype: ErrorType\n\tcode?: string\n\tsource?: Error\n\n\tconstructor(error: { message: string, type?: ErrorType }) {\n\t\tsuper(error.message)\n\t\tthis.name = SdkError.NAME\n\t\tthis.type = error.type || ErrorType.CLIENT\n\t}\n\n}\n\nclass ApiError extends SdkError {\n\n\tstatic NAME = 'ApiError'\n\n\tstatic isApiError(error: any): error is ApiError {\n\t\treturn SdkError.isSdkError(error) && (error.name === ApiError.NAME) && (error.type === ErrorType.RESPONSE)\n\t}\n\n\terrors: any[] = []\n\tstatus?: number\n\tstatusText?: string\n\n\t// constructor(error: SdkError)\n\tconstructor(error: { message: string }) {\n\t\tsuper({ ...error, type: ErrorType.RESPONSE })\n\t\tthis.name = ApiError.NAME\n\t}\n\n\tfirst(): any {\n\t\treturn (this.errors?.length > 0) ? this.errors[0] : undefined\n\t}\n\n}\n\n\nconst isRequestError = (error: any): error is TypeError => {\n\treturn (error instanceof TypeError) && (error.message !== 'fetch failed')\n}\n\nconst isCancelError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'AbortError')\n}\n\nconst isTimeoutError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'TimeoutError')\n}\n\nconst isExpiredTokenError = (error: any): boolean => {\n\tconst invalidTokenCodes = ['INVALID_TOKEN'/*, 'UNAUTHORIZED' */]\n\treturn (ApiError.isApiError(error) && (error.status === 401) && (\n\t\tinvalidTokenCodes.includes(error.code || '') ||\n\t\t(error.errors && (error.errors.length > 0) && invalidTokenCodes.includes(error.errors[0].code as string))\n\t))\n}\n\n\nconst handleError = (error: Error): never => {\n\n\tif (SdkError.isSdkError(error) || ApiError.isApiError(error)) throw error\n\n\tlet sdkError = new SdkError({ message: error.message })\n\n\tif (FetchError.isFetchError(error)) {\n\t\t// console.log('Fetch Error')\n\t\tconst apiError = new ApiError(sdkError)\n\t\tapiError.type = ErrorType.RESPONSE\n\t\tapiError.status = error.status\n\t\tapiError.statusText = error.statusText\n\t\tapiError.code = String(apiError.status)\n\t\tapiError.errors = error.errors || []\n\t\tif (!apiError.message && apiError.statusText) apiError.message = apiError.statusText\n\t\tsdkError = apiError\n\t}\n\telse if (isRequestError(error)) {\n\t\t// console.log('Request Error')\n sdkError.type = ErrorType.REQUEST\n }\n\telse if (isCancelError(error)) {\n\t\t// console.log('Cancel Error')\n sdkError.type = ErrorType.CANCEL\n }\n else if (isTimeoutError(error)) {\n\t\t// console.log('Timeout Error')\n sdkError.type = ErrorType.TIMEOUT\n }\n\telse {\n\t\t// console.log('Generic Error')\n\t\tsdkError.type = ErrorType.CLIENT\n\t\tsdkError.source = error\n\t}\n\n\tthrow sdkError\n\n}\n\n\nexport { SdkError, ApiError, ErrorType, handleError, isExpiredTokenError }\n\n\nexport function isSdkError(error: unknown): error is SdkError {\n\treturn SdkError.isSdkError(error)\n}\n\nexport function isApiError(error: unknown): error is ApiError {\n\treturn ApiError.isApiError(error)\n}\n"]}
1
+ {"version":3,"sources":["../src/error.ts"],"names":["ErrorType","FetchError"],"mappings":";;;;AAGK,IAAA,SAAA,qBAAAA,UAAL,KAAA;AACC,EAAAA,WAAA,QAAS,CAAA,GAAA,QAAA;AACT,EAAAA,WAAA,SAAU,CAAA,GAAA,SAAA;AACV,EAAAA,WAAA,UAAW,CAAA,GAAA,UAAA;AACX,EAAA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EST = 'request',\t\t\t\t\t\t// Error preparing API request\n\tRESPONSE = 'response',\t\t\t\t\t// Error response from API\n\tCANCEL = 'cancel',\t\t \t\t\t\t// Forced request abort using interceptor\n\tPARSE = 'parse',\t\t \t\t\t\t// Error parsing API resource\n TIMEOUT = 'timeout', \t\t\t\t// Timeout error\n\tTOKEN_REFRESH = 'token-refresh'\t// Error calling refresh token function\n}\n\n\nclass SdkError extends Error {\n\n\tstatic NAME = 'SdkError'\n\n\tstatic isSdkError(error: any): error is SdkError {\n\t\treturn error && [SdkError.NAME, ApiError.NAME].includes(error.name as string) && Object.values(ErrorType).includes(error.type as ErrorType)\n\t}\n\n\ttype: ErrorType\n\tcode?: string\n\tsource?: Error\n\n\tconstructor(error: { message: string, type?: ErrorType }) {\n\t\tsuper(error.message)\n\t\tthis.name = SdkError.NAME\n\t\tthis.type = error.type || ErrorType.CLIENT\n\t}\n\n}\n\n\nclass ApiError extends SdkError {\n\n\tstatic NAME = 'ApiError'\n\n\tstatic isApiError(error: any): error is ApiError {\n\t\treturn SdkError.isSdkError(error) && (error.name === ApiError.NAME) && (error.type === ErrorType.RESPONSE)\n\t}\n\n\terrors: any[] = []\n\tstatus?: number\n\tstatusText?: string\n\n\t// constructor(error: SdkError)\n\tconstructor(error: { message: string }) {\n\t\tsuper({ ...error, type: ErrorType.RESPONSE })\n\t\tthis.name = ApiError.NAME\n\t}\n\n\tfirst(): any {\n\t\treturn (this.errors?.length > 0) ? this.errors[0] : undefined\n\t}\n\n}\n\n\nconst isRequestError = (error: any): error is TypeError => {\n\treturn (error instanceof TypeError) && (error.message !== 'fetch failed')\n}\n\nconst isCancelError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'AbortError')\n}\n\nconst isTimeoutError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'TimeoutError')\n}\n\nconst isExpiredTokenError = (error: any): boolean => {\n\tconst invalidTokenCodes = ['INVALID_TOKEN'/*, 'UNAUTHORIZED' */]\n\treturn (ApiError.isApiError(error) && (error.status === 401) && (\n\t\tinvalidTokenCodes.includes(error.code || '') ||\n\t\t(error.errors && (error.errors.length > 0) && invalidTokenCodes.includes(error.errors[0].code as string))\n\t))\n}\n\n\nconst handleError = (error: Error): never => {\n\n\tif (SdkError.isSdkError(error) || ApiError.isApiError(error)) throw error\n\n\tlet sdkError = new SdkError({ message: error.message })\n\n\tif (FetchError.isFetchError(error)) {\n\t\t// console.log('Fetch Error')\n\t\tconst apiError = new ApiError(sdkError)\n\t\tapiError.type = ErrorType.RESPONSE\n\t\tapiError.status = error.status\n\t\tapiError.statusText = error.statusText\n\t\tapiError.code = String(apiError.status)\n\t\tapiError.errors = error.errors || []\n\t\tif (!apiError.message && apiError.statusText) apiError.message = apiError.statusText\n\t\tsdkError = apiError\n\t}\n\telse if (isRequestError(error)) {\n\t\t// console.log('Request Error')\n sdkError.type = ErrorType.REQUEST\n }\n\telse if (isCancelError(error)) {\n\t\t// console.log('Cancel Error')\n sdkError.type = ErrorType.CANCEL\n }\n else if (isTimeoutError(error)) {\n\t\t// console.log('Timeout Error')\n sdkError.type = ErrorType.TIMEOUT\n }\n\telse {\n\t\t// console.log('Generic Error')\n\t\tsdkError.type = ErrorType.CLIENT\n\t\tsdkError.source = error\n\t}\n\n\tthrow sdkError\n\n}\n\n\nexport { SdkError, ApiError, ErrorType, handleError, isExpiredTokenError }\n\n\nexport function isSdkError(error: unknown): error is SdkError {\n\treturn SdkError.isSdkError(error)\n}\n\nexport function isApiError(error: unknown): error is ApiError {\n\treturn ApiError.isApiError(error)\n}\n"]}
package/lib/error.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/error.ts"],"names":["ErrorType"],"mappings":";;AAGK,IAAA,SAAA,qBAAAA,UAAL,KAAA;AACC,EAAAA,WAAA,QAAS,CAAA,GAAA,QAAA;AACT,EAAAA,WAAA,SAAU,CAAA,GAAA,SAAA;AACV,EAAAA,WAAA,UAAW,CAAA,GAAA,UAAA;AACX,EAAAA,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',\t\t\t\t\t\t// Error preparing API request\n\tRESPONSE = 'response',\t\t\t\t\t// Error response from API\n\tCANCEL = 'cancel',\t\t \t\t\t\t// Forced request abort using interceptor\n\tPARSE = 'parse',\t\t \t\t\t\t// Error parsing API resource\n TIMEOUT = 'timeout', \t\t\t\t// Timeout error\n\tTOKEN_REFRESH = 'token-refresh'\t// Error calling refresh token function\n}\n\n\nclass SdkError extends Error {\n\n\tstatic NAME = 'SdkError'\n\n\tstatic isSdkError(error: any): error is SdkError {\n\t\treturn error && [SdkError.NAME, ApiError.NAME].includes(error.name as string) && Object.values(ErrorType).includes(error.type as ErrorType)\n\t}\n\n\ttype: ErrorType\n\tcode?: string\n\tsource?: Error\n\n\tconstructor(error: { message: string, type?: ErrorType }) {\n\t\tsuper(error.message)\n\t\tthis.name = SdkError.NAME\n\t\tthis.type = error.type || ErrorType.CLIENT\n\t}\n\n}\n\nclass ApiError extends SdkError {\n\n\tstatic NAME = 'ApiError'\n\n\tstatic isApiError(error: any): error is ApiError {\n\t\treturn SdkError.isSdkError(error) && (error.name === ApiError.NAME) && (error.type === ErrorType.RESPONSE)\n\t}\n\n\terrors: any[] = []\n\tstatus?: number\n\tstatusText?: string\n\n\t// constructor(error: SdkError)\n\tconstructor(error: { message: string }) {\n\t\tsuper({ ...error, type: ErrorType.RESPONSE })\n\t\tthis.name = ApiError.NAME\n\t}\n\n\tfirst(): any {\n\t\treturn (this.errors?.length > 0) ? this.errors[0] : undefined\n\t}\n\n}\n\n\nconst isRequestError = (error: any): error is TypeError => {\n\treturn (error instanceof TypeError) && (error.message !== 'fetch failed')\n}\n\nconst isCancelError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'AbortError')\n}\n\nconst isTimeoutError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'TimeoutError')\n}\n\nconst isExpiredTokenError = (error: any): boolean => {\n\tconst invalidTokenCodes = ['INVALID_TOKEN'/*, 'UNAUTHORIZED' */]\n\treturn (ApiError.isApiError(error) && (error.status === 401) && (\n\t\tinvalidTokenCodes.includes(error.code || '') ||\n\t\t(error.errors && (error.errors.length > 0) && invalidTokenCodes.includes(error.errors[0].code as string))\n\t))\n}\n\n\nconst handleError = (error: Error): never => {\n\n\tif (SdkError.isSdkError(error) || ApiError.isApiError(error)) throw error\n\n\tlet sdkError = new SdkError({ message: error.message })\n\n\tif (FetchError.isFetchError(error)) {\n\t\t// console.log('Fetch Error')\n\t\tconst apiError = new ApiError(sdkError)\n\t\tapiError.type = ErrorType.RESPONSE\n\t\tapiError.status = error.status\n\t\tapiError.statusText = error.statusText\n\t\tapiError.code = String(apiError.status)\n\t\tapiError.errors = error.errors || []\n\t\tif (!apiError.message && apiError.statusText) apiError.message = apiError.statusText\n\t\tsdkError = apiError\n\t}\n\telse if (isRequestError(error)) {\n\t\t// console.log('Request Error')\n sdkError.type = ErrorType.REQUEST\n }\n\telse if (isCancelError(error)) {\n\t\t// console.log('Cancel Error')\n sdkError.type = ErrorType.CANCEL\n }\n else if (isTimeoutError(error)) {\n\t\t// console.log('Timeout Error')\n sdkError.type = ErrorType.TIMEOUT\n }\n\telse {\n\t\t// console.log('Generic Error')\n\t\tsdkError.type = ErrorType.CLIENT\n\t\tsdkError.source = error\n\t}\n\n\tthrow sdkError\n\n}\n\n\nexport { SdkError, ApiError, ErrorType, handleError, isExpiredTokenError }\n\n\nexport function isSdkError(error: unknown): error is SdkError {\n\treturn SdkError.isSdkError(error)\n}\n\nexport function isApiError(error: unknown): error is ApiError {\n\treturn ApiError.isApiError(error)\n}\n"]}
1
+ {"version":3,"sources":["../src/error.ts"],"names":["ErrorType"],"mappings":";;AAGK,IAAA,SAAA,qBAAAA,UAAL,KAAA;AACC,EAAAA,WAAA,QAAS,CAAA,GAAA,QAAA;AACT,EAAAA,WAAA,SAAU,CAAA,GAAA,SAAA;AACV,EAAAA,WAAA,UAAW,CAAA,GAAA,UAAA;AACX,EAAAA,WAAA,QAAS,CAAA,GAAA,QAAA;AACT,EAAAA,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EAAA;AAEnC,IAAM,MAAA,QAAA,GAAW,IAAI,QAAA,CAAS,QAAQ,CAAA;AACtC,IAAA,QAAA,CAAS,IAAO,GAAA,UAAA;AAChB,IAAA,QAAA,CAAS,SAAS,KAAM,CAAA,MAAA;AACxB,IAAA,QAAA,CAAS,aAAa,KAAM,CAAA,UAAA;AAC5B,IAAS,QAAA,CAAA,IAAA,GAAO,MAAO,CAAA,QAAA,CAAS,MAAM,CAAA;AACtC,IAAS,QAAA,CAAA,MAAA,GAAS,KAAM,CAAA,MAAA,IAAU,EAAC;AACnC,IAAA,IAAI,CAAC,QAAS,CAAA,OAAA,IAAW,SAAS,UAAY,EAAA,QAAA,CAAS,UAAU,QAAS,CAAA,UAAA;AAC1E,IAAW,QAAA,GAAA,QAAA;AAAA,GACZ,MAAA,IACS,cAAe,CAAA,KAAK,CAAG,EAAA;AAE7B,IAAA,QAAA,CAAS,IAAO,GAAA,SAAA;AAAA,GAClB,MAAA,IACQ,aAAc,CAAA,KAAK,CAAG,EAAA;AAE5B,IAAA,QAAA,CAAS,IAAO,GAAA,QAAA;AAAA,GAClB,MAAA,IACS,cAAe,CAAA,KAAK,CAAG,EAAA;AAE9B,IAAA,QAAA,CAAS,IAAO,GAAA,SAAA;AAAA,GAEd,MAAA;AAEJ,IAAA,QAAA,CAAS,IAAO,GAAA,QAAA;AAChB,IAAA,QAAA,CAAS,MAAS,GAAA,KAAA;AAAA;AAGnB,EAAM,MAAA,QAAA;AAEP;AAMO,SAAS,WAAW,KAAmC,EAAA;AAC7D,EAAO,OAAA,QAAA,CAAS,WAAW,KAAK,CAAA;AACjC;AAEO,SAAS,WAAW,KAAmC,EAAA;AAC7D,EAAO,OAAA,QAAA,CAAS,WAAW,KAAK,CAAA;AACjC","file":"error.js","sourcesContent":["import { FetchError } from './fetch'\n\n\nenum ErrorType {\n\tCLIENT = 'client',\t\t \t\t\t\t// Generic Client error\n\tREQUEST = 'request',\t\t\t\t\t\t// Error preparing API request\n\tRESPONSE = 'response',\t\t\t\t\t// Error response from API\n\tCANCEL = 'cancel',\t\t \t\t\t\t// Forced request abort using interceptor\n\tPARSE = 'parse',\t\t \t\t\t\t// Error parsing API resource\n TIMEOUT = 'timeout', \t\t\t\t// Timeout error\n\tTOKEN_REFRESH = 'token-refresh'\t// Error calling refresh token function\n}\n\n\nclass SdkError extends Error {\n\n\tstatic NAME = 'SdkError'\n\n\tstatic isSdkError(error: any): error is SdkError {\n\t\treturn error && [SdkError.NAME, ApiError.NAME].includes(error.name as string) && Object.values(ErrorType).includes(error.type as ErrorType)\n\t}\n\n\ttype: ErrorType\n\tcode?: string\n\tsource?: Error\n\n\tconstructor(error: { message: string, type?: ErrorType }) {\n\t\tsuper(error.message)\n\t\tthis.name = SdkError.NAME\n\t\tthis.type = error.type || ErrorType.CLIENT\n\t}\n\n}\n\n\nclass ApiError extends SdkError {\n\n\tstatic NAME = 'ApiError'\n\n\tstatic isApiError(error: any): error is ApiError {\n\t\treturn SdkError.isSdkError(error) && (error.name === ApiError.NAME) && (error.type === ErrorType.RESPONSE)\n\t}\n\n\terrors: any[] = []\n\tstatus?: number\n\tstatusText?: string\n\n\t// constructor(error: SdkError)\n\tconstructor(error: { message: string }) {\n\t\tsuper({ ...error, type: ErrorType.RESPONSE })\n\t\tthis.name = ApiError.NAME\n\t}\n\n\tfirst(): any {\n\t\treturn (this.errors?.length > 0) ? this.errors[0] : undefined\n\t}\n\n}\n\n\nconst isRequestError = (error: any): error is TypeError => {\n\treturn (error instanceof TypeError) && (error.message !== 'fetch failed')\n}\n\nconst isCancelError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'AbortError')\n}\n\nconst isTimeoutError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'TimeoutError')\n}\n\nconst isExpiredTokenError = (error: any): boolean => {\n\tconst invalidTokenCodes = ['INVALID_TOKEN'/*, 'UNAUTHORIZED' */]\n\treturn (ApiError.isApiError(error) && (error.status === 401) && (\n\t\tinvalidTokenCodes.includes(error.code || '') ||\n\t\t(error.errors && (error.errors.length > 0) && invalidTokenCodes.includes(error.errors[0].code as string))\n\t))\n}\n\n\nconst handleError = (error: Error): never => {\n\n\tif (SdkError.isSdkError(error) || ApiError.isApiError(error)) throw error\n\n\tlet sdkError = new SdkError({ message: error.message })\n\n\tif (FetchError.isFetchError(error)) {\n\t\t// console.log('Fetch Error')\n\t\tconst apiError = new ApiError(sdkError)\n\t\tapiError.type = ErrorType.RESPONSE\n\t\tapiError.status = error.status\n\t\tapiError.statusText = error.statusText\n\t\tapiError.code = String(apiError.status)\n\t\tapiError.errors = error.errors || []\n\t\tif (!apiError.message && apiError.statusText) apiError.message = apiError.statusText\n\t\tsdkError = apiError\n\t}\n\telse if (isRequestError(error)) {\n\t\t// console.log('Request Error')\n sdkError.type = ErrorType.REQUEST\n }\n\telse if (isCancelError(error)) {\n\t\t// console.log('Cancel Error')\n sdkError.type = ErrorType.CANCEL\n }\n else if (isTimeoutError(error)) {\n\t\t// console.log('Timeout Error')\n sdkError.type = ErrorType.TIMEOUT\n }\n\telse {\n\t\t// console.log('Generic Error')\n\t\tsdkError.type = ErrorType.CLIENT\n\t\tsdkError.source = error\n\t}\n\n\tthrow sdkError\n\n}\n\n\nexport { SdkError, ApiError, ErrorType, handleError, isExpiredTokenError }\n\n\nexport function isSdkError(error: unknown): error is SdkError {\n\treturn SdkError.isSdkError(error)\n}\n\nexport function isApiError(error: unknown): error is ApiError {\n\treturn ApiError.isApiError(error)\n}\n"]}
package/lib/fetch.cjs CHANGED
@@ -9,6 +9,7 @@ var Debug__default = /*#__PURE__*/_interopDefault(Debug);
9
9
 
10
10
  const debug = Debug__default.default("fetch");
11
11
  class FetchError extends Error {
12
+ static NAME = "FetchError";
12
13
  static isFetchError = (error) => {
13
14
  return error instanceof FetchError;
14
15
  };
@@ -22,6 +23,7 @@ class FetchError extends Error {
22
23
  this.#statusText = statusText;
23
24
  if (body) this.#errors = body.errors;
24
25
  if (request) this.#request = request;
26
+ this.name = FetchError.NAME;
25
27
  }
26
28
  get errors() {
27
29
  return this.#errors;
package/lib/fetch.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/fetch.ts"],"names":["Debug","SdkError","ErrorType"],"mappings":";;;;;;;;;AAMA,MAAM,KAAA,GAAQA,uBAAM,OAAO,CAAA;AAapB,MAAM,mBAAmB,KAAM,CAAA;AAAA,EAEpC,OAAO,YAAe,GAAA,CAAC,KAAoC,KAAA;AACzD,IAAA,OAAO,KAAiB,YAAA,UAAA;AAAA,GAC1B;AAAA,EAES,OAAA;AAAA,EACA,OAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EAET,WAAY,CAAA,MAAA,EAAgB,UAAoB,EAAA,IAAA,EAAY,OAA+B,EAAA;AACzF,IAAA,KAAA,CAAM,UAAU,CAAA;AAChB,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA;AACf,IAAA,IAAA,CAAK,WAAc,GAAA,UAAA;AACnB,IAAI,IAAA,IAAA,EAAW,IAAA,CAAA,OAAA,GAAU,IAAK,CAAA,MAAA;AAC9B,IAAI,IAAA,OAAA,OAAc,QAAW,GAAA,OAAA;AAAA;AAC/B,EAGA,IAAI,MAA4B,GAAA;AAAE,IAAA,OAAO,IAAK,CAAA,OAAA;AAAA;AAAQ,EAEtD,IAAI,MAAiB,GAAA;AAAE,IAAA,OAAO,IAAK,CAAA,OAAA;AAAA;AAAQ,EAE3C,IAAI,UAAqB,GAAA;AAAE,IAAA,OAAO,IAAK,CAAA,WAAA;AAAA;AAAY,EAEnD,IAAI,OAAoD,GAAA;AAAE,IAAA,OAAO,IAAK,CAAA,QAAA;AAAA;AAExE;AAIO,MAAM,QAAW,GAAA,OAAO,GAAU,EAAA,cAAA,EAAqC,aAA+D,KAAA;AAE3I,EAAM,KAAA,CAAA,2BAAA,EAA6B,KAAK,cAAkB,IAAA,IAAK,aAAe,EAAA,KAAA,GAAO,OAAO,KAAM,CAAA;AAElG,EAAA,MAAM,eAAe,aA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AAA;AAChB,IAAI,IAAA,KAAA,GAAQ,IAAI,UAAW,CAAA,QAAA,CAAS,QAAQ,QAAS,CAAA,UAAA,EAAY,cAAc,cAAc,CAAA;AAC7F,IAAI,IAAA,YAAA,EAAc,UAAU,SAAW,EAAA,KAAA,GAAQ,MAAM,YAAa,CAAA,QAAA,CAAS,UAAU,KAAK,CAAA;AAC1F,IAAA,IAAI,OAAa,MAAA,KAAA;AAAA;AAGnB,EAAO,OAAA,YAAA;AAET","file":"fetch.cjs","sourcesContent":["\nimport type { InterceptorManager } from './interceptor'\nimport { ErrorType, SdkError } from './error'\n\n\nimport Debug from './debug'\nconst debug = Debug('fetch')\n\n\nexport type Fetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>\n\nexport type FetchResponse = any\nexport type FetchRequestOptions = RequestInit\nexport type FetchClientOptions = {\n interceptors?: InterceptorManager,\n fetch?: Fetch\n}\n\n\nexport class FetchError extends Error {\n\n static isFetchError = (error: any): error is FetchError => {\n return error instanceof FetchError\n }\n\n readonly #errors?: any[]\n readonly #status: number\n readonly #statusText: string\n readonly #request?: Partial<FetchRequestOptions>\n\n constructor(status: number, statusText: string, body?: any, request?: FetchRequestOptions) {\n super(statusText)\n this.#status = status\n this.#statusText = statusText\n if (body) this.#errors = body.errors\n if (request) this.#request = request\n }\n\n\n get errors(): any[] | undefined { return this.#errors }\n\n get status(): number { return this.#status }\n\n get statusText(): string { return this.#statusText }\n\n get request(): Partial<FetchRequestOptions> | undefined { return this.#request }\n\n}\n\n\n\nexport const fetchURL = async (url: URL, requestOptions: FetchRequestOptions, clientOptions?: FetchClientOptions): Promise<FetchResponse> => {\n\n debug('fetch: %s, %O, native[%s]', url, requestOptions || {}, (clientOptions?.fetch? 'no' : 'yes'))\n\n const interceptors = clientOptions?.interceptors\n\n if (interceptors?.request?.onSuccess) ( { url, options: requestOptions } = await interceptors.request.onSuccess({ url, options: requestOptions }) )\n\n // const request: Request = new Request(url, requestOptions) // not supported by all fetch implementations\n\n const fetchClient = clientOptions?.fetch || fetch\n\n let response = await fetchClient(url, requestOptions)\n\n if (response.ok) {\n if (interceptors?.rawReader?.onSuccess) await interceptors.rawReader.onSuccess(response)\n if (interceptors?.response?.onSuccess) response = await interceptors.response.onSuccess(response)\n } else {\n if (interceptors?.rawReader?.onFailure) await interceptors.rawReader.onFailure(response)\n }\n\n const responseBody = (response.body && (response.status !== 204)) ? await response.json()\n .then(json => { debug('response: %O', json); return json })\n .catch((err: Error) => {\n debug('error: %s', err.message)\n if (response.ok) throw new SdkError({ message: 'Error parsing API response body', type: ErrorType.PARSE })\n })\n : undefined\n \n if (!response.ok) {\n let error = new FetchError(response.status, response.statusText, responseBody, requestOptions)\n if (interceptors?.response?.onFailure) error = await interceptors.response.onFailure(error)\n if (error) throw error\n }\n\n return responseBody\n\n}"]}
1
+ {"version":3,"sources":["../src/fetch.ts"],"names":["Debug","SdkError","ErrorType"],"mappings":";;;;;;;;;AAMA,MAAM,KAAA,GAAQA,uBAAM,OAAO,CAAA;AAapB,MAAM,mBAAmB,KAAM,CAAA;AAAA,EAEpC,OAAO,IAAO,GAAA,YAAA;AAAA,EAEd,OAAO,YAAe,GAAA,CAAC,KAAoC,KAAA;AACzD,IAAA,OAAO,KAAiB,YAAA,UAAA;AAAA,GAC1B;AAAA,EAES,OAAA;AAAA,EACA,OAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EAET,WAAY,CAAA,MAAA,EAAgB,UAAoB,EAAA,IAAA,EAAY,OAA+B,EAAA;AACzF,IAAA,KAAA,CAAM,UAAU,CAAA;AAChB,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA;AACf,IAAA,IAAA,CAAK,WAAc,GAAA,UAAA;AACnB,IAAI,IAAA,IAAA,EAAW,IAAA,CAAA,OAAA,GAAU,IAAK,CAAA,MAAA;AAC9B,IAAI,IAAA,OAAA,OAAc,QAAW,GAAA,OAAA;AAC7B,IAAA,IAAA,CAAK,OAAO,UAAW,CAAA,IAAA;AAAA;AAC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AAA,IAAS,QAAS,CAAA,MAAA,KAAW,GAAQ,GAAA,MAAM,QAAS,CAAA,IAAA,EAChF,CAAA,IAAA,CAAK,CAAQ,IAAA,KAAA;AAAE,IAAA,KAAA,CAAM,gBAAgB,IAAI,CAAA;AAAG,IAAO,OAAA,IAAA;AAAA,GAAM,CAAA,CACzD,KAAM,CAAA,CAAC,GAAe,KAAA;AACrB,IAAM,KAAA,CAAA,WAAA,EAAa,IAAI,OAAO,CAAA;AAC9B,IAAI,IAAA,QAAA,CAAS,EAAI,EAAA,MAAM,IAAIC,cAAA,CAAS,EAAE,OAAA,EAAS,iCAAmC,EAAA,IAAA,EAAMC,eAAU,CAAA,KAAA,EAAO,CAAA;AAAA,GAC1G,CACC,GAAA,MAAA;AAEJ,EAAI,IAAA,CAAC,SAAS,EAAI,EAAA;AAChB,IAAI,IAAA,KAAA,GAAQ,IAAI,UAAW,CAAA,QAAA,CAAS,QAAQ,QAAS,CAAA,UAAA,EAAY,cAAc,cAAc,CAAA;AAC7F,IAAI,IAAA,YAAA,EAAc,UAAU,SAAW,EAAA,KAAA,GAAQ,MAAM,YAAa,CAAA,QAAA,CAAS,UAAU,KAAK,CAAA;AAC1F,IAAA,IAAI,OAAa,MAAA,KAAA;AAAA;AAGnB,EAAO,OAAA,YAAA;AAET","file":"fetch.cjs","sourcesContent":["\nimport type { InterceptorManager } from './interceptor'\nimport { ErrorType, SdkError } from './error'\n\n\nimport Debug from './debug'\nconst debug = Debug('fetch')\n\n\nexport type Fetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>\n\nexport type FetchResponse = any\nexport type FetchRequestOptions = RequestInit\nexport type FetchClientOptions = {\n interceptors?: InterceptorManager,\n fetch?: Fetch\n}\n\n\nexport class FetchError extends Error {\n\n static NAME = 'FetchError'\n\n static isFetchError = (error: any): error is FetchError => {\n return error instanceof FetchError\n }\n\n readonly #errors?: any[]\n readonly #status: number\n readonly #statusText: string\n readonly #request?: Partial<FetchRequestOptions>\n\n constructor(status: number, statusText: string, body?: any, request?: FetchRequestOptions) {\n super(statusText)\n this.#status = status\n this.#statusText = statusText\n if (body) this.#errors = body.errors\n if (request) this.#request = request\n this.name = FetchError.NAME\n }\n\n\n get errors(): any[] | undefined { return this.#errors }\n\n get status(): number { return this.#status }\n\n get statusText(): string { return this.#statusText }\n\n get request(): Partial<FetchRequestOptions> | undefined { return this.#request }\n\n}\n\n\n\nexport const fetchURL = async (url: URL, requestOptions: FetchRequestOptions, clientOptions?: FetchClientOptions): Promise<FetchResponse> => {\n\n debug('fetch: %s, %O, native[%s]', url, requestOptions || {}, (clientOptions?.fetch? 'no' : 'yes'))\n\n const interceptors = clientOptions?.interceptors\n\n if (interceptors?.request?.onSuccess) ( { url, options: requestOptions } = await interceptors.request.onSuccess({ url, options: requestOptions }) )\n\n // const request: Request = new Request(url, requestOptions) // not supported by all fetch implementations\n\n const fetchClient = clientOptions?.fetch || fetch\n\n let response = await fetchClient(url, requestOptions)\n\n if (response.ok) {\n if (interceptors?.rawReader?.onSuccess) await interceptors.rawReader.onSuccess(response)\n if (interceptors?.response?.onSuccess) response = await interceptors.response.onSuccess(response)\n } else {\n if (interceptors?.rawReader?.onFailure) await interceptors.rawReader.onFailure(response)\n }\n\n const responseBody = (response.body && (response.status !== 204)) ? await response.json()\n .then(json => { debug('response: %O', json); return json })\n .catch((err: Error) => {\n debug('error: %s', err.message)\n if (response.ok) throw new SdkError({ message: 'Error parsing API response body', type: ErrorType.PARSE })\n })\n : undefined\n \n if (!response.ok) {\n let error = new FetchError(response.status, response.statusText, responseBody, requestOptions)\n if (interceptors?.response?.onFailure) error = await interceptors.response.onFailure(error)\n if (error) throw error\n }\n\n return responseBody\n\n}\n"]}
package/lib/fetch.d.cts CHANGED
@@ -1 +1 @@
1
- export { F as Fetch, i as FetchClientOptions, j as FetchError, h as FetchRequestOptions, g as FetchResponse, k as fetchURL } from './interceptor-5MISI1yn.cjs';
1
+ export { F as Fetch, i as FetchClientOptions, j as FetchError, h as FetchRequestOptions, g as FetchResponse, k as fetchURL } from './interceptor-k15jXzf0.cjs';
package/lib/fetch.d.ts CHANGED
@@ -1 +1 @@
1
- export { F as Fetch, i as FetchClientOptions, j as FetchError, h as FetchRequestOptions, g as FetchResponse, k as fetchURL } from './interceptor-5MISI1yn.js';
1
+ export { F as Fetch, i as FetchClientOptions, j as FetchError, h as FetchRequestOptions, g as FetchResponse, k as fetchURL } from './interceptor-k15jXzf0.js';
package/lib/fetch.js CHANGED
@@ -3,6 +3,7 @@ import Debug from './debug';
3
3
 
4
4
  const debug = Debug("fetch");
5
5
  class FetchError extends Error {
6
+ static NAME = "FetchError";
6
7
  static isFetchError = (error) => {
7
8
  return error instanceof FetchError;
8
9
  };
@@ -16,6 +17,7 @@ class FetchError extends Error {
16
17
  this.#statusText = statusText;
17
18
  if (body) this.#errors = body.errors;
18
19
  if (request) this.#request = request;
20
+ this.name = FetchError.NAME;
19
21
  }
20
22
  get errors() {
21
23
  return this.#errors;
package/lib/fetch.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/fetch.ts"],"names":[],"mappings":";;;AAMA,MAAM,KAAA,GAAQ,MAAM,OAAO,CAAA;AAapB,MAAM,mBAAmB,KAAM,CAAA;AAAA,EAEpC,OAAO,YAAe,GAAA,CAAC,KAAoC,KAAA;AACzD,IAAA,OAAO,KAAiB,YAAA,UAAA;AAAA,GAC1B;AAAA,EAES,OAAA;AAAA,EACA,OAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EAET,WAAY,CAAA,MAAA,EAAgB,UAAoB,EAAA,IAAA,EAAY,OAA+B,EAAA;AACzF,IAAA,KAAA,CAAM,UAAU,CAAA;AAChB,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA;AACf,IAAA,IAAA,CAAK,WAAc,GAAA,UAAA;AACnB,IAAI,IAAA,IAAA,EAAW,IAAA,CAAA,OAAA,GAAU,IAAK,CAAA,MAAA;AAC9B,IAAI,IAAA,OAAA,OAAc,QAAW,GAAA,O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,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,MAAA,KAAW,GAAQ,GAAA,MAAM,QAAS,CAAA,IAAA,EAChF,CAAA,IAAA,CAAK,CAAQ,IAAA,KAAA;AAAE,IAAA,KAAA,CAAM,gBAAgB,IAAI,CAAA;AAAG,IAAO,OAAA,IAAA;AAAA,GAAM,CAAA,CACzD,KAAM,CAAA,CAAC,GAAe,KAAA;AACrB,IAAM,KAAA,CAAA,WAAA,EAAa,IAAI,OAAO,CAAA;AAC9B,IAAI,IAAA,QAAA,CAAS,EAAI,EAAA,MAAM,IAAI,QAAA,CAAS,EAAE,OAAA,EAAS,iCAAmC,EAAA,IAAA,EAAM,SAAU,CAAA,KAAA,EAAO,CAAA;AAAA,GAC1G,CACC,GAAA,MAAA;AAEJ,EAAI,IAAA,CAAC,SAAS,EAAI,EAAA;AAChB,IAAI,IAAA,KAAA,GAAQ,IAAI,UAAW,CAAA,QAAA,CAAS,QAAQ,QAAS,CAAA,UAAA,EAAY,cAAc,cAAc,CAAA;AAC7F,IAAI,IAAA,YAAA,EAAc,UAAU,SAAW,EAAA,KAAA,GAAQ,MAAM,YAAa,CAAA,QAAA,CAAS,UAAU,KAAK,CAAA;AAC1F,IAAA,IAAI,OAAa,MAAA,KAAA;AAAA;AAGnB,EAAO,OAAA,YAAA;AAET","file":"fetch.js","sourcesContent":["\nimport type { InterceptorManager } from './interceptor'\nimport { ErrorType, SdkError } from './error'\n\n\nimport Debug from './debug'\nconst debug = Debug('fetch')\n\n\nexport type Fetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>\n\nexport type FetchResponse = any\nexport type FetchRequestOptions = RequestInit\nexport type FetchClientOptions = {\n interceptors?: InterceptorManager,\n fetch?: Fetch\n}\n\n\nexport class FetchError extends Error {\n\n static isFetchError = (error: any): error is FetchError => {\n return error instanceof FetchError\n }\n\n readonly #errors?: any[]\n readonly #status: number\n readonly #statusText: string\n readonly #request?: Partial<FetchRequestOptions>\n\n constructor(status: number, statusText: string, body?: any, request?: FetchRequestOptions) {\n super(statusText)\n this.#status = status\n this.#statusText = statusText\n if (body) this.#errors = body.errors\n if (request) this.#request = request\n }\n\n\n get errors(): any[] | undefined { return this.#errors }\n\n get status(): number { return this.#status }\n\n get statusText(): string { return this.#statusText }\n\n get request(): Partial<FetchRequestOptions> | undefined { return this.#request }\n\n}\n\n\n\nexport const fetchURL = async (url: URL, requestOptions: FetchRequestOptions, clientOptions?: FetchClientOptions): Promise<FetchResponse> => {\n\n debug('fetch: %s, %O, native[%s]', url, requestOptions || {}, (clientOptions?.fetch? 'no' : 'yes'))\n\n const interceptors = clientOptions?.interceptors\n\n if (interceptors?.request?.onSuccess) ( { url, options: requestOptions } = await interceptors.request.onSuccess({ url, options: requestOptions }) )\n\n // const request: Request = new Request(url, requestOptions) // not supported by all fetch implementations\n\n const fetchClient = clientOptions?.fetch || fetch\n\n let response = await fetchClient(url, requestOptions)\n\n if (response.ok) {\n if (interceptors?.rawReader?.onSuccess) await interceptors.rawReader.onSuccess(response)\n if (interceptors?.response?.onSuccess) response = await interceptors.response.onSuccess(response)\n } else {\n if (interceptors?.rawReader?.onFailure) await interceptors.rawReader.onFailure(response)\n }\n\n const responseBody = (response.body && (response.status !== 204)) ? await response.json()\n .then(json => { debug('response: %O', json); return json })\n .catch((err: Error) => {\n debug('error: %s', err.message)\n if (response.ok) throw new SdkError({ message: 'Error parsing API response body', type: ErrorType.PARSE })\n })\n : undefined\n \n if (!response.ok) {\n let error = new FetchError(response.status, response.statusText, responseBody, requestOptions)\n if (interceptors?.response?.onFailure) error = await interceptors.response.onFailure(error)\n if (error) throw error\n }\n\n return responseBody\n\n}"]}
1
+ {"version":3,"sources":["../src/fetch.ts"],"names":[],"mappings":";;;AAMA,MAAM,KAAA,GAAQ,MAAM,OAAO,CAAA;AAapB,MAAM,mBAAmB,KAAM,CAAA;AAAA,EAEpC,OAAO,IAAO,GAAA,YAAA;AAAA,EAEd,OAAO,YAAe,GAAA,CAAC,KAAoC,KAAA;AAC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AAI,OAAa,MAAA,KAAA;AAAA;AAGnB,EAAO,OAAA,YAAA;AAET","file":"fetch.js","sourcesContent":["\nimport type { InterceptorManager } from './interceptor'\nimport { ErrorType, SdkError } from './error'\n\n\nimport Debug from './debug'\nconst debug = Debug('fetch')\n\n\nexport type Fetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>\n\nexport type FetchResponse = any\nexport type FetchRequestOptions = RequestInit\nexport type FetchClientOptions = {\n interceptors?: InterceptorManager,\n fetch?: Fetch\n}\n\n\nexport class FetchError extends Error {\n\n static NAME = 'FetchError'\n\n static isFetchError = (error: any): error is FetchError => {\n return error instanceof FetchError\n }\n\n readonly #errors?: any[]\n readonly #status: number\n readonly #statusText: string\n readonly #request?: Partial<FetchRequestOptions>\n\n constructor(status: number, statusText: string, body?: any, request?: FetchRequestOptions) {\n super(statusText)\n this.#status = status\n this.#statusText = statusText\n if (body) this.#errors = body.errors\n if (request) this.#request = request\n this.name = FetchError.NAME\n }\n\n\n get errors(): any[] | undefined { return this.#errors }\n\n get status(): number { return this.#status }\n\n get statusText(): string { return this.#statusText }\n\n get request(): Partial<FetchRequestOptions> | undefined { return this.#request }\n\n}\n\n\n\nexport const fetchURL = async (url: URL, requestOptions: FetchRequestOptions, clientOptions?: FetchClientOptions): Promise<FetchResponse> => {\n\n debug('fetch: %s, %O, native[%s]', url, requestOptions || {}, (clientOptions?.fetch? 'no' : 'yes'))\n\n const interceptors = clientOptions?.interceptors\n\n if (interceptors?.request?.onSuccess) ( { url, options: requestOptions } = await interceptors.request.onSuccess({ url, options: requestOptions }) )\n\n // const request: Request = new Request(url, requestOptions) // not supported by all fetch implementations\n\n const fetchClient = clientOptions?.fetch || fetch\n\n let response = await fetchClient(url, requestOptions)\n\n if (response.ok) {\n if (interceptors?.rawReader?.onSuccess) await interceptors.rawReader.onSuccess(response)\n if (interceptors?.response?.onSuccess) response = await interceptors.response.onSuccess(response)\n } else {\n if (interceptors?.rawReader?.onFailure) await interceptors.rawReader.onFailure(response)\n }\n\n const responseBody = (response.body && (response.status !== 204)) ? await response.json()\n .then(json => { debug('response: %O', json); return json })\n .catch((err: Error) => {\n debug('error: %s', err.message)\n if (response.ok) throw new SdkError({ message: 'Error parsing API response body', type: ErrorType.PARSE })\n })\n : undefined\n \n if (!response.ok) {\n let error = new FetchError(response.status, response.statusText, responseBody, requestOptions)\n if (interceptors?.response?.onFailure) error = await interceptors.response.onFailure(error)\n if (error) throw error\n }\n\n return responseBody\n\n}\n"]}
package/lib/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { default as CommerceLayer, CommerceLayerClient, CommerceLayerConfig, CommerceLayerInitConfig, default } from './commercelayer.cjs';
2
2
  export { bO as Address, bP as AddressCreate, bR as AddressSort, bQ as AddressUpdate, bS as Adjustment, bT as AdjustmentCreate, bV as AdjustmentSort, bU as AdjustmentUpdate, bW as AdyenGateway, bX as AdyenGatewayCreate, bZ as AdyenGatewaySort, bY as AdyenGatewayUpdate, b_ as AdyenPayment, b$ as AdyenPaymentCreate, c1 as AdyenPaymentSort, c0 as AdyenPaymentUpdate, c2 as Application, c3 as ApplicationSort, c4 as Attachment, c5 as AttachmentCreate, c7 as AttachmentSort, c6 as AttachmentUpdate, c8 as Authorization, ca as AuthorizationSort, c9 as AuthorizationUpdate, cb as AvalaraAccount, cc as AvalaraAccountCreate, ce as AvalaraAccountSort, cd as AvalaraAccountUpdate, cf as AxerveGateway, cg as AxerveGatewayCreate, ci as AxerveGatewaySort, ch as AxerveGatewayUpdate, cj as AxervePayment, ck as AxervePaymentCreate, cm as AxervePaymentSort, cl as AxervePaymentUpdate, cn as BingGeocoder, co as BingGeocoderCreate, cq as BingGeocoderSort, cp as BingGeocoderUpdate, cr as BraintreeGateway, cs as BraintreeGatewayCreate, cu as BraintreeGatewaySort, ct as BraintreeGatewayUpdate, cv as BraintreePayment, cw as BraintreePaymentCreate, cy as BraintreePaymentSort, cx as BraintreePaymentUpdate, cz as Bundle, cA as BundleCreate, cC as BundleSort, cB as BundleUpdate, cD as BuyXPayYPromotion, cE as BuyXPayYPromotionCreate, cG as BuyXPayYPromotionSort, cF as BuyXPayYPromotionUpdate, cH as Capture, cJ as CaptureSort, cI as CaptureUpdate, cK as CarrierAccount, cL as CarrierAccountCreate, cN as CarrierAccountSort, cM as CarrierAccountUpdate, cO as CheckoutComGateway, cP as CheckoutComGatewayCreate, cR as CheckoutComGatewaySort, cQ as CheckoutComGatewayUpdate, cS as CheckoutComPayment, cT as CheckoutComPaymentCreate, cV as CheckoutComPaymentSort, cU as CheckoutComPaymentUpdate, cW as Cleanup, cX as CleanupCreate, cZ as CleanupSort, cY as CleanupUpdate, d6 as Coupon, c_ as CouponCodesPromotionRule, c$ as CouponCodesPromotionRuleCreate, d1 as CouponCodesPromotionRuleSort, d0 as CouponCodesPromotionRuleUpdate, d7 as CouponCreate, d2 as CouponRecipient, d3 as CouponRecipientCreate, d5 as CouponRecipientSort, d4 as CouponRecipientUpdate, d9 as CouponSort, d8 as CouponUpdate, x as CreatableResource, C as CreatableResourceType, da as CustomPromotionRule, db as CustomPromotionRuleCreate, dd as CustomPromotionRuleSort, dc as CustomPromotionRuleUpdate, dz as Customer, de as CustomerAddress, df as CustomerAddressCreate, dh as CustomerAddressSort, dg as CustomerAddressUpdate, dA as CustomerCreate, di as CustomerGroup, dj as CustomerGroupCreate, dl as CustomerGroupSort, dk as CustomerGroupUpdate, dm as CustomerPasswordReset, dn as CustomerPasswordResetCreate, dq as CustomerPasswordResetSort, dp as CustomerPasswordResetUpdate, dr as CustomerPaymentSource, ds as CustomerPaymentSourceCreate, du as CustomerPaymentSourceSort, dt as CustomerPaymentSourceUpdate, dC as CustomerSort, dv as CustomerSubscription, dw as CustomerSubscriptionCreate, dy as CustomerSubscriptionSort, dx as CustomerSubscriptionUpdate, dB as CustomerUpdate, z as DeletableResource, D as DeletableResourceType, dD as DeliveryLeadTime, dE as DeliveryLeadTimeCreate, dG as DeliveryLeadTimeSort, dF as DeliveryLeadTimeUpdate, dJ as DiscountEngine, dH as DiscountEngineItem, dI as DiscountEngineItemSort, dK as DiscountEngineSort, dL as EasypostPickup, dM as EasypostPickupCreate, dO as EasypostPickupSort, dN as EasypostPickupUpdate, dR as Event, dP as EventCallback, dQ as EventCallbackSort, dT as EventSort, dS as EventUpdate, dU as Export, dV as ExportCreate, dX as ExportSort, dW as ExportUpdate, dY as ExternalGateway, dZ as ExternalGatewayCreate, d$ as ExternalGatewaySort, d_ as ExternalGatewayUpdate, e0 as ExternalPayment, e1 as ExternalPaymentCreate, e3 as ExternalPaymentSort, e2 as ExternalPaymentUpdate, e4 as ExternalPromotion, e5 as ExternalPromotionCreate, e7 as ExternalPromotionSort, e6 as ExternalPromotionUpdate, e8 as ExternalTaxCalculator, e9 as ExternalTaxCalculatorCreate, eb as ExternalTaxCalculatorSort, ea as ExternalTaxCalculatorUpdate, ec as FixedAmountPromotion, ed as FixedAmountPromotionCreate, ef as FixedAmountPromotionSort, ee as FixedAmountPromotionUpdate, eg as FixedPricePromotion, eh as FixedPricePromotionCreate, ej as FixedPricePromotionSort, ei as FixedPricePromotionUpdate, ek as FlexPromotion, el as FlexPromotionCreate, en as FlexPromotionSort, em as FlexPromotionUpdate, eo as FreeGiftPromotion, ep as FreeGiftPromotionCreate, er as FreeGiftPromotionSort, eq as FreeGiftPromotionUpdate, es as FreeShippingPromotion, et as FreeShippingPromotionCreate, ev as FreeShippingPromotionSort, eu as FreeShippingPromotionUpdate, ew as Geocoder, ex as GeocoderSort, eC as GiftCard, eD as GiftCardCreate, ey as GiftCardRecipient, ez as GiftCardRecipientCreate, eB as GiftCardRecipientSort, eA as GiftCardRecipientUpdate, eF as GiftCardSort, eE as GiftCardUpdate, eG as GoogleGeocoder, eH as GoogleGeocoderCreate, eJ as GoogleGeocoderSort, eI as GoogleGeocoderUpdate, eK as Import, eL as ImportCreate, eN as ImportSort, eM as ImportUpdate, eO as InStockSubscription, eP as InStockSubscriptionCreate, eR as InStockSubscriptionSort, eQ as InStockSubscriptionUpdate, eS as InventoryModel, eT as InventoryModelCreate, eV as InventoryModelSort, eU as InventoryModelUpdate, eW as InventoryReturnLocation, eX as InventoryReturnLocationCreate, eZ as InventoryReturnLocationSort, eY as InventoryReturnLocationUpdate, e_ as InventoryStockLocation, e$ as InventoryStockLocationCreate, f1 as InventoryStockLocationSort, f0 as InventoryStockLocationUpdate, f2 as KlarnaGateway, f3 as KlarnaGatewayCreate, f5 as KlarnaGatewaySort, f4 as KlarnaGatewayUpdate, f6 as KlarnaPayment, f7 as KlarnaPaymentCreate, f9 as KlarnaPaymentSort, f8 as KlarnaPaymentUpdate, fe as LineItem, ff as LineItemCreate, fa as LineItemOption, fb as LineItemOptionCreate, fd as LineItemOptionSort, fc as LineItemOptionUpdate, fh as LineItemSort, fg as LineItemUpdate, fi as Link, fj as LinkCreate, fl as LinkSort, fk as LinkUpdate, m as ListMeta, L as ListResponse, w as ListableResource, v as ListableResourceType, fm as ManualGateway, fn as ManualGatewayCreate, fp as ManualGatewaySort, fo as ManualGatewayUpdate, fq as ManualTaxCalculator, fr as ManualTaxCalculatorCreate, ft as ManualTaxCalculatorSort, fs as ManualTaxCalculatorUpdate, fu as Market, fv as MarketCreate, fx as MarketSort, fw as MarketUpdate, fy as Merchant, fz as MerchantCreate, fB as MerchantSort, fA as MerchantUpdate, M as Metadata, fC as Notification, fD as NotificationCreate, fF as NotificationSort, fE as NotificationUpdate, fY as Order, fG as OrderAmountPromotionRule, fH as OrderAmountPromotionRuleCreate, fJ as OrderAmountPromotionRuleSort, fI as OrderAmountPromotionRuleUpdate, fK as OrderCopy, fL as OrderCopyCreate, fN as OrderCopySort, fM as OrderCopyUpdate, fZ as OrderCreate, fO as OrderFactory, fP as OrderFactorySort, f$ as OrderSort, fU as OrderSubscription, fV as OrderSubscriptionCreate, fQ as OrderSubscriptionItem, fR as OrderSubscriptionItemCreate, fT as OrderSubscriptionItemSort, fS as OrderSubscriptionItemUpdate, fX as OrderSubscriptionSort, fW as OrderSubscriptionUpdate, f_ as OrderUpdate, g0 as Organization, g1 as OrganizationSort, g2 as Package, g3 as PackageCreate, g5 as PackageSort, g4 as PackageUpdate, ga as Parcel, gb as ParcelCreate, g6 as ParcelLineItem, g7 as ParcelLineItemCreate, g9 as ParcelLineItemSort, g8 as ParcelLineItemUpdate, gd as ParcelSort, gc as ParcelUpdate, ge as PaymentGateway, gf as PaymentGatewaySort, gg as PaymentMethod, gh as PaymentMethodCreate, gj as PaymentMethodSort, gi as PaymentMethodUpdate, gk as PaymentOption, gl as PaymentOptionCreate, gn as PaymentOptionSort, gm as PaymentOptionUpdate, go as PaypalGateway, gp as PaypalGatewayCreate, gr as PaypalGatewaySort, gq as PaypalGatewayUpdate, gs as PaypalPayment, gt as PaypalPaymentCreate, gv as PaypalPaymentSort, gu as PaypalPaymentUpdate, gw as PercentageDiscountPromotion, gx as PercentageDiscountPromotionCreate, gz as PercentageDiscountPromotionSort, gy as PercentageDiscountPromotionUpdate, gA as Pickup, gB as PickupSort, gU as Price, gV as PriceCreate, gC as PriceFrequencyTier, gD as PriceFrequencyTierCreate, gF as PriceFrequencyTierSort, gE as PriceFrequencyTierUpdate, gK as PriceList, gL as PriceListCreate, gG as PriceListScheduler, gH as PriceListSchedulerCreate, gJ as PriceListSchedulerSort, gI as PriceListSchedulerUpdate, gN as PriceListSort, gM as PriceListUpdate, gX as PriceSort, gO as PriceTier, gP as PriceTierSort, gW as PriceUpdate, gQ as PriceVolumeTier, gR as PriceVolumeTierCreate, gT as PriceVolumeTierSort, gS as PriceVolumeTierUpdate, g_ as Promotion, gY as PromotionRule, gZ as PromotionRuleSort, g$ as PromotionSort, a as QueryFields, h as QueryFilter, Q as QueryInclude, e as QueryPageNumber, f as QueryPageSize, d as QueryParams, c as QueryParamsList, b as QueryParamsRetrieve, g as QuerySort, h0 as RecurringOrderCopy, h1 as RecurringOrderCopyCreate, h3 as RecurringOrderCopySort, h2 as RecurringOrderCopyUpdate, h4 as Refund, h6 as RefundSort, h5 as RefundUpdate, h7 as ReservedStock, h8 as ReservedStockSort, j as Resource, k as ResourceCreate, h9 as ResourceError, ha as ResourceErrorSort, p as ResourceFilter, i as ResourceId, n as ResourceRel, o as ResourceSort, R as ResourceType, s as ResourceTypeLock, l as ResourceUpdate, q as ResourcesConfig, r as ResourcesInitConfig, u as RetrievableResource, t as RetrievableResourceType, hf as Return, hg as ReturnCreate, hb as ReturnLineItem, hc as ReturnLineItemCreate, he as ReturnLineItemSort, hd as ReturnLineItemUpdate, hi as ReturnSort, hh as ReturnUpdate, hj as SatispayGateway, hk as SatispayGatewayCreate, hm as SatispayGatewaySort, hl as SatispayGatewayUpdate, hn as SatispayPayment, ho as SatispayPaymentCreate, hq as SatispayPaymentSort, hp as SatispayPaymentUpdate, hr as Shipment, hs as ShipmentCreate, hu as ShipmentSort, ht as ShipmentUpdate, hv as ShippingCategory, hw as ShippingCategoryCreate, hy as ShippingCategorySort, hx as ShippingCategoryUpdate, hB as ShippingMethod, hC as ShippingMethodCreate, hE as ShippingMethodSort, hz as ShippingMethodTier, hA as ShippingMethodTierSort, hD as ShippingMethodUpdate, hF as ShippingWeightTier, hG as ShippingWeightTierCreate, hI as ShippingWeightTierSort, hH as ShippingWeightTierUpdate, hJ as ShippingZone, hK as ShippingZoneCreate, hM as ShippingZoneSort, hL as ShippingZoneUpdate, i1 as Sku, i2 as SkuCreate, hV as SkuList, hW as SkuListCreate, hN as SkuListItem, hO as SkuListItemCreate, hQ as SkuListItemSort, hP as SkuListItemUpdate, hR as SkuListPromotionRule, hS as SkuListPromotionRuleCreate, hU as SkuListPromotionRuleSort, hT as SkuListPromotionRuleUpdate, hY as SkuListSort, hX as SkuListUpdate, hZ as SkuOption, h_ as SkuOptionCreate, i0 as SkuOptionSort, h$ as SkuOptionUpdate, i4 as SkuSort, i3 as SkuUpdate, i5 as StockItem, i6 as StockItemCreate, i8 as StockItemSort, i7 as StockItemUpdate, i9 as StockLineItem, ia as StockLineItemCreate, ic as StockLineItemSort, ib as StockLineItemUpdate, id as StockLocation, ie as StockLocationCreate, ih as StockLocationSort, ig as StockLocationUpdate, ii as StockReservation, ij as StockReservationCreate, il as StockReservationSort, ik as StockReservationUpdate, im as StockTransfer, io as StockTransferCreate, iq as StockTransferSort, ip as StockTransferUpdate, ir as Store, is as StoreCreate, iu as StoreSort, it as StoreUpdate, iv as StripeGateway, iw as StripeGatewayCreate, iy as StripeGatewaySort, ix as StripeGatewayUpdate, iz as StripePayment, iA as StripePaymentCreate, iC as StripePaymentSort, iB as StripePaymentUpdate, iD as StripeTaxAccount, iE as StripeTaxAccountCreate, iG as StripeTaxAccountSort, iF as StripeTaxAccountUpdate, iH as SubscriptionModel, iI as SubscriptionModelCreate, iK as SubscriptionModelSort, iJ as SubscriptionModelUpdate, iL as Tag, iM as TagCreate, iO as TagSort, iN as TagUpdate, A as TaggableResource, T as TaggableResourceType, iP as TalonOneAccount, iQ as TalonOneAccountCreate, iS as TalonOneAccountSort, iR as TalonOneAccountUpdate, iT as TaxCalculator, iU as TaxCalculatorSort, iV as TaxCategory, iW as TaxCategoryCreate, iY as TaxCategorySort, iX as TaxCategoryUpdate, iZ as TaxRule, i_ as TaxRuleCreate, j0 as TaxRuleSort, i$ as TaxRuleUpdate, j1 as TaxjarAccount, j2 as TaxjarAccountCreate, j4 as TaxjarAccountSort, j3 as TaxjarAccountUpdate, j5 as Transaction, j6 as TransactionSort, y as UpdatableResource, U as UpdatableResourceType, j7 as Version, j8 as VersionSort, B as VersionableResource, V as VersionableResourceType, j9 as VertexAccount, ja as VertexAccountCreate, jc as VertexAccountSort, jb as VertexAccountUpdate, jd as Void, jf as VoidSort, je as VoidUpdate, jg as Webhook, jh as WebhookCreate, jj as WebhookSort, ji as WebhookUpdate, jk as WireTransfer, jl as WireTransferCreate, jn as WireTransferSort, jm as WireTransferUpdate, E as addresses, F as adjustments, G as adyen_gateways, H as adyen_payments, I as application, J as attachments, K as authorizations, N as avalara_accounts, O as axerve_gateways, P as axerve_payments, S as bing_geocoders, W as braintree_gateways, X as braintree_payments, Y as bundles, Z as buy_x_pay_y_promotions, _ as captures, $ as carrier_accounts, a0 as checkout_com_gateways, a1 as checkout_com_payments, a2 as cleanups, a3 as coupon_codes_promotion_rules, a4 as coupon_recipients, a5 as coupons, a6 as custom_promotion_rules, a7 as customer_addresses, a8 as customer_groups, a9 as customer_password_resets, aa as customer_payment_sources, ab as customer_subscriptions, ac as customers, ad as delivery_lead_times, ae as discount_engine_items, af as discount_engines, ag as easypost_pickups, ah as event_callbacks, ai as events, aj as exports, ak as external_gateways, al as external_payments, am as external_promotions, an as external_tax_calculators, ao as fixed_amount_promotions, ap as fixed_price_promotions, aq as flex_promotions, ar as free_gift_promotions, as as free_shipping_promotions, at as geocoders, au as gift_card_recipients, av as gift_cards, aw as google_geocoders, ax as imports, ay as in_stock_subscriptions, az as inventory_models, aA as inventory_return_locations, aB as inventory_stock_locations, aC as klarna_gateways, aD as klarna_payments, aE as line_item_options, aF as line_items, aG as links, aH as manual_gateways, aI as manual_tax_calculators, aJ as markets, aK as merchants, aL as notifications, aM as order_amount_promotion_rules, aN as order_copies, aO as order_factories, aP as order_subscription_items, aQ as order_subscriptions, aR as orders, aS as organization, aT as packages, aU as parcel_line_items, aV as parcels, aW as payment_gateways, aX as payment_methods, aY as payment_options, aZ as paypal_gateways, a_ as paypal_payments, a$ as percentage_discount_promotions, b0 as pickups, b1 as price_frequency_tiers, b2 as price_list_schedulers, b3 as price_lists, b4 as price_tiers, b5 as price_volume_tiers, b6 as prices, b7 as promotion_rules, b8 as promotions, b9 as recurring_order_copies, ba as refunds, bb as reserved_stocks, bc as resource_errors, bd as return_line_items, be as returns, bf as satispay_gateways, bg as satispay_payments, bh as shipments, bi as shipping_categories, bj as shipping_method_tiers, bk as shipping_methods, bl as shipping_weight_tiers, bm as shipping_zones, bn as sku_list_items, bo as sku_list_promotion_rules, bp as sku_lists, bq as sku_options, br as skus, bs as stock_items, bt as stock_line_items, bu as stock_locations, bv as stock_reservations, bw as stock_transfers, bx as stores, by as stripe_gateways, bz as stripe_payments, bA as stripe_tax_accounts, bB as subscription_models, bC as tags, bD as talon_one_accounts, bE as tax_calculators, bF as tax_categories, bG as tax_rules, bH as taxjar_accounts, bI as transactions, bJ as versions, bK as vertex_accounts, bL as voids, bM as webhooks, bN as wire_transfers } from './api-DmIZO_Np.cjs';
3
3
  export { CommerceLayerStatic } from './static.cjs';
4
- export { E as ErrorObj, H as HeadersObj, R as RequestObj, a as ResponseObj } from './interceptor-5MISI1yn.cjs';
4
+ export { E as ErrorObj, H as HeadersObj, R as RequestObj, a as ResponseObj } from './interceptor-k15jXzf0.cjs';
5
5
  export { ApiError, SdkError } from './error.cjs';
6
6
  import './client.cjs';
7
7
  import './types.cjs';
package/lib/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { default as CommerceLayer, CommerceLayerClient, CommerceLayerConfig, CommerceLayerInitConfig, default } from './commercelayer.js';
2
2
  export { bO as Address, bP as AddressCreate, bR as AddressSort, bQ as AddressUpdate, bS as Adjustment, bT as AdjustmentCreate, bV as AdjustmentSort, bU as AdjustmentUpdate, bW as AdyenGateway, bX as AdyenGatewayCreate, bZ as AdyenGatewaySort, bY as AdyenGatewayUpdate, b_ as AdyenPayment, b$ as AdyenPaymentCreate, c1 as AdyenPaymentSort, c0 as AdyenPaymentUpdate, c2 as Application, c3 as ApplicationSort, c4 as Attachment, c5 as AttachmentCreate, c7 as AttachmentSort, c6 as AttachmentUpdate, c8 as Authorization, ca as AuthorizationSort, c9 as AuthorizationUpdate, cb as AvalaraAccount, cc as AvalaraAccountCreate, ce as AvalaraAccountSort, cd as AvalaraAccountUpdate, cf as AxerveGateway, cg as AxerveGatewayCreate, ci as AxerveGatewaySort, ch as AxerveGatewayUpdate, cj as AxervePayment, ck as AxervePaymentCreate, cm as AxervePaymentSort, cl as AxervePaymentUpdate, cn as BingGeocoder, co as BingGeocoderCreate, cq as BingGeocoderSort, cp as BingGeocoderUpdate, cr as BraintreeGateway, cs as BraintreeGatewayCreate, cu as BraintreeGatewaySort, ct as BraintreeGatewayUpdate, cv as BraintreePayment, cw as BraintreePaymentCreate, cy as BraintreePaymentSort, cx as BraintreePaymentUpdate, cz as Bundle, cA as BundleCreate, cC as BundleSort, cB as BundleUpdate, cD as BuyXPayYPromotion, cE as BuyXPayYPromotionCreate, cG as BuyXPayYPromotionSort, cF as BuyXPayYPromotionUpdate, cH as Capture, cJ as CaptureSort, cI as CaptureUpdate, cK as CarrierAccount, cL as CarrierAccountCreate, cN as CarrierAccountSort, cM as CarrierAccountUpdate, cO as CheckoutComGateway, cP as CheckoutComGatewayCreate, cR as CheckoutComGatewaySort, cQ as CheckoutComGatewayUpdate, cS as CheckoutComPayment, cT as CheckoutComPaymentCreate, cV as CheckoutComPaymentSort, cU as CheckoutComPaymentUpdate, cW as Cleanup, cX as CleanupCreate, cZ as CleanupSort, cY as CleanupUpdate, d6 as Coupon, c_ as CouponCodesPromotionRule, c$ as CouponCodesPromotionRuleCreate, d1 as CouponCodesPromotionRuleSort, d0 as CouponCodesPromotionRuleUpdate, d7 as CouponCreate, d2 as CouponRecipient, d3 as CouponRecipientCreate, d5 as CouponRecipientSort, d4 as CouponRecipientUpdate, d9 as CouponSort, d8 as CouponUpdate, x as CreatableResource, C as CreatableResourceType, da as CustomPromotionRule, db as CustomPromotionRuleCreate, dd as CustomPromotionRuleSort, dc as CustomPromotionRuleUpdate, dz as Customer, de as CustomerAddress, df as CustomerAddressCreate, dh as CustomerAddressSort, dg as CustomerAddressUpdate, dA as CustomerCreate, di as CustomerGroup, dj as CustomerGroupCreate, dl as CustomerGroupSort, dk as CustomerGroupUpdate, dm as CustomerPasswordReset, dn as CustomerPasswordResetCreate, dq as CustomerPasswordResetSort, dp as CustomerPasswordResetUpdate, dr as CustomerPaymentSource, ds as CustomerPaymentSourceCreate, du as CustomerPaymentSourceSort, dt as CustomerPaymentSourceUpdate, dC as CustomerSort, dv as CustomerSubscription, dw as CustomerSubscriptionCreate, dy as CustomerSubscriptionSort, dx as CustomerSubscriptionUpdate, dB as CustomerUpdate, z as DeletableResource, D as DeletableResourceType, dD as DeliveryLeadTime, dE as DeliveryLeadTimeCreate, dG as DeliveryLeadTimeSort, dF as DeliveryLeadTimeUpdate, dJ as DiscountEngine, dH as DiscountEngineItem, dI as DiscountEngineItemSort, dK as DiscountEngineSort, dL as EasypostPickup, dM as EasypostPickupCreate, dO as EasypostPickupSort, dN as EasypostPickupUpdate, dR as Event, dP as EventCallback, dQ as EventCallbackSort, dT as EventSort, dS as EventUpdate, dU as Export, dV as ExportCreate, dX as ExportSort, dW as ExportUpdate, dY as ExternalGateway, dZ as ExternalGatewayCreate, d$ as ExternalGatewaySort, d_ as ExternalGatewayUpdate, e0 as ExternalPayment, e1 as ExternalPaymentCreate, e3 as ExternalPaymentSort, e2 as ExternalPaymentUpdate, e4 as ExternalPromotion, e5 as ExternalPromotionCreate, e7 as ExternalPromotionSort, e6 as ExternalPromotionUpdate, e8 as ExternalTaxCalculator, e9 as ExternalTaxCalculatorCreate, eb as ExternalTaxCalculatorSort, ea as ExternalTaxCalculatorUpdate, ec as FixedAmountPromotion, ed as FixedAmountPromotionCreate, ef as FixedAmountPromotionSort, ee as FixedAmountPromotionUpdate, eg as FixedPricePromotion, eh as FixedPricePromotionCreate, ej as FixedPricePromotionSort, ei as FixedPricePromotionUpdate, ek as FlexPromotion, el as FlexPromotionCreate, en as FlexPromotionSort, em as FlexPromotionUpdate, eo as FreeGiftPromotion, ep as FreeGiftPromotionCreate, er as FreeGiftPromotionSort, eq as FreeGiftPromotionUpdate, es as FreeShippingPromotion, et as FreeShippingPromotionCreate, ev as FreeShippingPromotionSort, eu as FreeShippingPromotionUpdate, ew as Geocoder, ex as GeocoderSort, eC as GiftCard, eD as GiftCardCreate, ey as GiftCardRecipient, ez as GiftCardRecipientCreate, eB as GiftCardRecipientSort, eA as GiftCardRecipientUpdate, eF as GiftCardSort, eE as GiftCardUpdate, eG as GoogleGeocoder, eH as GoogleGeocoderCreate, eJ as GoogleGeocoderSort, eI as GoogleGeocoderUpdate, eK as Import, eL as ImportCreate, eN as ImportSort, eM as ImportUpdate, eO as InStockSubscription, eP as InStockSubscriptionCreate, eR as InStockSubscriptionSort, eQ as InStockSubscriptionUpdate, eS as InventoryModel, eT as InventoryModelCreate, eV as InventoryModelSort, eU as InventoryModelUpdate, eW as InventoryReturnLocation, eX as InventoryReturnLocationCreate, eZ as InventoryReturnLocationSort, eY as InventoryReturnLocationUpdate, e_ as InventoryStockLocation, e$ as InventoryStockLocationCreate, f1 as InventoryStockLocationSort, f0 as InventoryStockLocationUpdate, f2 as KlarnaGateway, f3 as KlarnaGatewayCreate, f5 as KlarnaGatewaySort, f4 as KlarnaGatewayUpdate, f6 as KlarnaPayment, f7 as KlarnaPaymentCreate, f9 as KlarnaPaymentSort, f8 as KlarnaPaymentUpdate, fe as LineItem, ff as LineItemCreate, fa as LineItemOption, fb as LineItemOptionCreate, fd as LineItemOptionSort, fc as LineItemOptionUpdate, fh as LineItemSort, fg as LineItemUpdate, fi as Link, fj as LinkCreate, fl as LinkSort, fk as LinkUpdate, m as ListMeta, L as ListResponse, w as ListableResource, v as ListableResourceType, fm as ManualGateway, fn as ManualGatewayCreate, fp as ManualGatewaySort, fo as ManualGatewayUpdate, fq as ManualTaxCalculator, fr as ManualTaxCalculatorCreate, ft as ManualTaxCalculatorSort, fs as ManualTaxCalculatorUpdate, fu as Market, fv as MarketCreate, fx as MarketSort, fw as MarketUpdate, fy as Merchant, fz as MerchantCreate, fB as MerchantSort, fA as MerchantUpdate, M as Metadata, fC as Notification, fD as NotificationCreate, fF as NotificationSort, fE as NotificationUpdate, fY as Order, fG as OrderAmountPromotionRule, fH as OrderAmountPromotionRuleCreate, fJ as OrderAmountPromotionRuleSort, fI as OrderAmountPromotionRuleUpdate, fK as OrderCopy, fL as OrderCopyCreate, fN as OrderCopySort, fM as OrderCopyUpdate, fZ as OrderCreate, fO as OrderFactory, fP as OrderFactorySort, f$ as OrderSort, fU as OrderSubscription, fV as OrderSubscriptionCreate, fQ as OrderSubscriptionItem, fR as OrderSubscriptionItemCreate, fT as OrderSubscriptionItemSort, fS as OrderSubscriptionItemUpdate, fX as OrderSubscriptionSort, fW as OrderSubscriptionUpdate, f_ as OrderUpdate, g0 as Organization, g1 as OrganizationSort, g2 as Package, g3 as PackageCreate, g5 as PackageSort, g4 as PackageUpdate, ga as Parcel, gb as ParcelCreate, g6 as ParcelLineItem, g7 as ParcelLineItemCreate, g9 as ParcelLineItemSort, g8 as ParcelLineItemUpdate, gd as ParcelSort, gc as ParcelUpdate, ge as PaymentGateway, gf as PaymentGatewaySort, gg as PaymentMethod, gh as PaymentMethodCreate, gj as PaymentMethodSort, gi as PaymentMethodUpdate, gk as PaymentOption, gl as PaymentOptionCreate, gn as PaymentOptionSort, gm as PaymentOptionUpdate, go as PaypalGateway, gp as PaypalGatewayCreate, gr as PaypalGatewaySort, gq as PaypalGatewayUpdate, gs as PaypalPayment, gt as PaypalPaymentCreate, gv as PaypalPaymentSort, gu as PaypalPaymentUpdate, gw as PercentageDiscountPromotion, gx as PercentageDiscountPromotionCreate, gz as PercentageDiscountPromotionSort, gy as PercentageDiscountPromotionUpdate, gA as Pickup, gB as PickupSort, gU as Price, gV as PriceCreate, gC as PriceFrequencyTier, gD as PriceFrequencyTierCreate, gF as PriceFrequencyTierSort, gE as PriceFrequencyTierUpdate, gK as PriceList, gL as PriceListCreate, gG as PriceListScheduler, gH as PriceListSchedulerCreate, gJ as PriceListSchedulerSort, gI as PriceListSchedulerUpdate, gN as PriceListSort, gM as PriceListUpdate, gX as PriceSort, gO as PriceTier, gP as PriceTierSort, gW as PriceUpdate, gQ as PriceVolumeTier, gR as PriceVolumeTierCreate, gT as PriceVolumeTierSort, gS as PriceVolumeTierUpdate, g_ as Promotion, gY as PromotionRule, gZ as PromotionRuleSort, g$ as PromotionSort, a as QueryFields, h as QueryFilter, Q as QueryInclude, e as QueryPageNumber, f as QueryPageSize, d as QueryParams, c as QueryParamsList, b as QueryParamsRetrieve, g as QuerySort, h0 as RecurringOrderCopy, h1 as RecurringOrderCopyCreate, h3 as RecurringOrderCopySort, h2 as RecurringOrderCopyUpdate, h4 as Refund, h6 as RefundSort, h5 as RefundUpdate, h7 as ReservedStock, h8 as ReservedStockSort, j as Resource, k as ResourceCreate, h9 as ResourceError, ha as ResourceErrorSort, p as ResourceFilter, i as ResourceId, n as ResourceRel, o as ResourceSort, R as ResourceType, s as ResourceTypeLock, l as ResourceUpdate, q as ResourcesConfig, r as ResourcesInitConfig, u as RetrievableResource, t as RetrievableResourceType, hf as Return, hg as ReturnCreate, hb as ReturnLineItem, hc as ReturnLineItemCreate, he as ReturnLineItemSort, hd as ReturnLineItemUpdate, hi as ReturnSort, hh as ReturnUpdate, hj as SatispayGateway, hk as SatispayGatewayCreate, hm as SatispayGatewaySort, hl as SatispayGatewayUpdate, hn as SatispayPayment, ho as SatispayPaymentCreate, hq as SatispayPaymentSort, hp as SatispayPaymentUpdate, hr as Shipment, hs as ShipmentCreate, hu as ShipmentSort, ht as ShipmentUpdate, hv as ShippingCategory, hw as ShippingCategoryCreate, hy as ShippingCategorySort, hx as ShippingCategoryUpdate, hB as ShippingMethod, hC as ShippingMethodCreate, hE as ShippingMethodSort, hz as ShippingMethodTier, hA as ShippingMethodTierSort, hD as ShippingMethodUpdate, hF as ShippingWeightTier, hG as ShippingWeightTierCreate, hI as ShippingWeightTierSort, hH as ShippingWeightTierUpdate, hJ as ShippingZone, hK as ShippingZoneCreate, hM as ShippingZoneSort, hL as ShippingZoneUpdate, i1 as Sku, i2 as SkuCreate, hV as SkuList, hW as SkuListCreate, hN as SkuListItem, hO as SkuListItemCreate, hQ as SkuListItemSort, hP as SkuListItemUpdate, hR as SkuListPromotionRule, hS as SkuListPromotionRuleCreate, hU as SkuListPromotionRuleSort, hT as SkuListPromotionRuleUpdate, hY as SkuListSort, hX as SkuListUpdate, hZ as SkuOption, h_ as SkuOptionCreate, i0 as SkuOptionSort, h$ as SkuOptionUpdate, i4 as SkuSort, i3 as SkuUpdate, i5 as StockItem, i6 as StockItemCreate, i8 as StockItemSort, i7 as StockItemUpdate, i9 as StockLineItem, ia as StockLineItemCreate, ic as StockLineItemSort, ib as StockLineItemUpdate, id as StockLocation, ie as StockLocationCreate, ih as StockLocationSort, ig as StockLocationUpdate, ii as StockReservation, ij as StockReservationCreate, il as StockReservationSort, ik as StockReservationUpdate, im as StockTransfer, io as StockTransferCreate, iq as StockTransferSort, ip as StockTransferUpdate, ir as Store, is as StoreCreate, iu as StoreSort, it as StoreUpdate, iv as StripeGateway, iw as StripeGatewayCreate, iy as StripeGatewaySort, ix as StripeGatewayUpdate, iz as StripePayment, iA as StripePaymentCreate, iC as StripePaymentSort, iB as StripePaymentUpdate, iD as StripeTaxAccount, iE as StripeTaxAccountCreate, iG as StripeTaxAccountSort, iF as StripeTaxAccountUpdate, iH as SubscriptionModel, iI as SubscriptionModelCreate, iK as SubscriptionModelSort, iJ as SubscriptionModelUpdate, iL as Tag, iM as TagCreate, iO as TagSort, iN as TagUpdate, A as TaggableResource, T as TaggableResourceType, iP as TalonOneAccount, iQ as TalonOneAccountCreate, iS as TalonOneAccountSort, iR as TalonOneAccountUpdate, iT as TaxCalculator, iU as TaxCalculatorSort, iV as TaxCategory, iW as TaxCategoryCreate, iY as TaxCategorySort, iX as TaxCategoryUpdate, iZ as TaxRule, i_ as TaxRuleCreate, j0 as TaxRuleSort, i$ as TaxRuleUpdate, j1 as TaxjarAccount, j2 as TaxjarAccountCreate, j4 as TaxjarAccountSort, j3 as TaxjarAccountUpdate, j5 as Transaction, j6 as TransactionSort, y as UpdatableResource, U as UpdatableResourceType, j7 as Version, j8 as VersionSort, B as VersionableResource, V as VersionableResourceType, j9 as VertexAccount, ja as VertexAccountCreate, jc as VertexAccountSort, jb as VertexAccountUpdate, jd as Void, jf as VoidSort, je as VoidUpdate, jg as Webhook, jh as WebhookCreate, jj as WebhookSort, ji as WebhookUpdate, jk as WireTransfer, jl as WireTransferCreate, jn as WireTransferSort, jm as WireTransferUpdate, E as addresses, F as adjustments, G as adyen_gateways, H as adyen_payments, I as application, J as attachments, K as authorizations, N as avalara_accounts, O as axerve_gateways, P as axerve_payments, S as bing_geocoders, W as braintree_gateways, X as braintree_payments, Y as bundles, Z as buy_x_pay_y_promotions, _ as captures, $ as carrier_accounts, a0 as checkout_com_gateways, a1 as checkout_com_payments, a2 as cleanups, a3 as coupon_codes_promotion_rules, a4 as coupon_recipients, a5 as coupons, a6 as custom_promotion_rules, a7 as customer_addresses, a8 as customer_groups, a9 as customer_password_resets, aa as customer_payment_sources, ab as customer_subscriptions, ac as customers, ad as delivery_lead_times, ae as discount_engine_items, af as discount_engines, ag as easypost_pickups, ah as event_callbacks, ai as events, aj as exports, ak as external_gateways, al as external_payments, am as external_promotions, an as external_tax_calculators, ao as fixed_amount_promotions, ap as fixed_price_promotions, aq as flex_promotions, ar as free_gift_promotions, as as free_shipping_promotions, at as geocoders, au as gift_card_recipients, av as gift_cards, aw as google_geocoders, ax as imports, ay as in_stock_subscriptions, az as inventory_models, aA as inventory_return_locations, aB as inventory_stock_locations, aC as klarna_gateways, aD as klarna_payments, aE as line_item_options, aF as line_items, aG as links, aH as manual_gateways, aI as manual_tax_calculators, aJ as markets, aK as merchants, aL as notifications, aM as order_amount_promotion_rules, aN as order_copies, aO as order_factories, aP as order_subscription_items, aQ as order_subscriptions, aR as orders, aS as organization, aT as packages, aU as parcel_line_items, aV as parcels, aW as payment_gateways, aX as payment_methods, aY as payment_options, aZ as paypal_gateways, a_ as paypal_payments, a$ as percentage_discount_promotions, b0 as pickups, b1 as price_frequency_tiers, b2 as price_list_schedulers, b3 as price_lists, b4 as price_tiers, b5 as price_volume_tiers, b6 as prices, b7 as promotion_rules, b8 as promotions, b9 as recurring_order_copies, ba as refunds, bb as reserved_stocks, bc as resource_errors, bd as return_line_items, be as returns, bf as satispay_gateways, bg as satispay_payments, bh as shipments, bi as shipping_categories, bj as shipping_method_tiers, bk as shipping_methods, bl as shipping_weight_tiers, bm as shipping_zones, bn as sku_list_items, bo as sku_list_promotion_rules, bp as sku_lists, bq as sku_options, br as skus, bs as stock_items, bt as stock_line_items, bu as stock_locations, bv as stock_reservations, bw as stock_transfers, bx as stores, by as stripe_gateways, bz as stripe_payments, bA as stripe_tax_accounts, bB as subscription_models, bC as tags, bD as talon_one_accounts, bE as tax_calculators, bF as tax_categories, bG as tax_rules, bH as taxjar_accounts, bI as transactions, bJ as versions, bK as vertex_accounts, bL as voids, bM as webhooks, bN as wire_transfers } from './api-DDgIE2i8.js';
3
3
  export { CommerceLayerStatic } from './static.js';
4
- export { E as ErrorObj, H as HeadersObj, R as RequestObj, a as ResponseObj } from './interceptor-5MISI1yn.js';
4
+ export { E as ErrorObj, H as HeadersObj, R as RequestObj, a as ResponseObj } from './interceptor-k15jXzf0.js';
5
5
  export { ApiError, SdkError } from './error.js';
6
6
  import './client.js';
7
7
  import './types.js';
@@ -7,6 +7,7 @@ type FetchClientOptions = {
7
7
  };
8
8
  declare class FetchError extends Error {
9
9
  #private;
10
+ static NAME: string;
10
11
  static isFetchError: (error: any) => error is FetchError;
11
12
  constructor(status: number, statusText: string, body?: any, request?: FetchRequestOptions);
12
13
  get errors(): any[] | undefined;
@@ -35,9 +36,9 @@ type RequestObj = {
35
36
  type RequestInterceptor = (request: RequestObj) => RequestObj | Promise<RequestObj>;
36
37
  type ResponseObj = Response;
37
38
  type ResponseInterceptor = (response: ResponseObj) => ResponseObj | Promise<ResponseObj>;
38
- type ApiHeadersList = 'x-ratelimit-limit' | 'x-ratelimit-interval' | 'x-ratelimit-remaining';
39
+ type ApiHeadersLock = 'x-ratelimit-limit' | 'x-ratelimit-interval' | 'x-ratelimit-remaining';
39
40
  type ApiHeaders = {
40
- [key in ApiHeadersList]: string | number | boolean;
41
+ [key in ApiHeadersLock]: string | number | boolean;
41
42
  };
42
43
  type HeadersObj = Record<string, string> | ApiHeaders;
43
44
  type ErrorObj = FetchError;
@@ -7,6 +7,7 @@ type FetchClientOptions = {
7
7
  };
8
8
  declare class FetchError extends Error {
9
9
  #private;
10
+ static NAME: string;
10
11
  static isFetchError: (error: any) => error is FetchError;
11
12
  constructor(status: number, statusText: string, body?: any, request?: FetchRequestOptions);
12
13
  get errors(): any[] | undefined;
@@ -35,9 +36,9 @@ type RequestObj = {
35
36
  type RequestInterceptor = (request: RequestObj) => RequestObj | Promise<RequestObj>;
36
37
  type ResponseObj = Response;
37
38
  type ResponseInterceptor = (response: ResponseObj) => ResponseObj | Promise<ResponseObj>;
38
- type ApiHeadersList = 'x-ratelimit-limit' | 'x-ratelimit-interval' | 'x-ratelimit-remaining';
39
+ type ApiHeadersLock = 'x-ratelimit-limit' | 'x-ratelimit-interval' | 'x-ratelimit-remaining';
39
40
  type ApiHeaders = {
40
- [key in ApiHeadersList]: string | number | boolean;
41
+ [key in ApiHeadersLock]: string | number | boolean;
41
42
  };
42
43
  type HeadersObj = Record<string, string> | ApiHeaders;
43
44
  type ErrorObj = FetchError;
@@ -1 +1 @@
1
- export { c as ErrorInterceptor, E as ErrorObj, H as HeadersObj, f as InterceptorManager, I as InterceptorType, e as RawResponseReader, b as RequestInterceptor, R as RequestObj, d as ResponseInterceptor, a as ResponseObj } from './interceptor-5MISI1yn.cjs';
1
+ export { c as ErrorInterceptor, E as ErrorObj, H as HeadersObj, f as InterceptorManager, I as InterceptorType, e as RawResponseReader, b as RequestInterceptor, R as RequestObj, d as ResponseInterceptor, a as ResponseObj } from './interceptor-k15jXzf0.cjs';
@@ -1 +1 @@
1
- export { c as ErrorInterceptor, E as ErrorObj, H as HeadersObj, f as InterceptorManager, I as InterceptorType, e as RawResponseReader, b as RequestInterceptor, R as RequestObj, d as ResponseInterceptor, a as ResponseObj } from './interceptor-5MISI1yn.js';
1
+ export { c as ErrorInterceptor, E as ErrorObj, H as HeadersObj, f as InterceptorManager, I as InterceptorType, e as RawResponseReader, b as RequestInterceptor, R as RequestObj, d as ResponseInterceptor, a as ResponseObj } from './interceptor-k15jXzf0.js';
package/lib/jsonapi.d.cts CHANGED
@@ -2,7 +2,7 @@ import { DocWithData, ResourceObject } from 'jsonapi-typescript';
2
2
  export { DocWithData } from 'jsonapi-typescript';
3
3
  import { j as Resource, k as ResourceCreate, R as ResourceType, l as ResourceUpdate, i as ResourceId } from './api-DmIZO_Np.cjs';
4
4
  import './client.cjs';
5
- import './interceptor-5MISI1yn.cjs';
5
+ import './interceptor-k15jXzf0.cjs';
6
6
  import './types.cjs';
7
7
 
8
8
  declare const denormalize: <R extends Resource>(response: DocWithData) => R | R[];
package/lib/jsonapi.d.ts CHANGED
@@ -2,7 +2,7 @@ import { DocWithData, ResourceObject } from 'jsonapi-typescript';
2
2
  export { DocWithData } from 'jsonapi-typescript';
3
3
  import { j as Resource, k as ResourceCreate, R as ResourceType, l as ResourceUpdate, i as ResourceId } from './api-DDgIE2i8.js';
4
4
  import './client.js';
5
- import './interceptor-5MISI1yn.js';
5
+ import './interceptor-k15jXzf0.js';
6
6
  import './types.js';
7
7
 
8
8
  declare const denormalize: <R extends Resource>(response: DocWithData) => R | R[];
package/lib/model.d.cts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { bO as Address, bP as AddressCreate, bR as AddressSort, bQ as AddressUpdate, bS as Adjustment, bT as AdjustmentCreate, bV as AdjustmentSort, bU as AdjustmentUpdate, bW as AdyenGateway, bX as AdyenGatewayCreate, bZ as AdyenGatewaySort, bY as AdyenGatewayUpdate, b_ as AdyenPayment, b$ as AdyenPaymentCreate, c1 as AdyenPaymentSort, c0 as AdyenPaymentUpdate, c2 as Application, c3 as ApplicationSort, c4 as Attachment, c5 as AttachmentCreate, c7 as AttachmentSort, c6 as AttachmentUpdate, c8 as Authorization, ca as AuthorizationSort, c9 as AuthorizationUpdate, cb as AvalaraAccount, cc as AvalaraAccountCreate, ce as AvalaraAccountSort, cd as AvalaraAccountUpdate, cf as AxerveGateway, cg as AxerveGatewayCreate, ci as AxerveGatewaySort, ch as AxerveGatewayUpdate, cj as AxervePayment, ck as AxervePaymentCreate, cm as AxervePaymentSort, cl as AxervePaymentUpdate, cn as BingGeocoder, co as BingGeocoderCreate, cq as BingGeocoderSort, cp as BingGeocoderUpdate, cr as BraintreeGateway, cs as BraintreeGatewayCreate, cu as BraintreeGatewaySort, ct as BraintreeGatewayUpdate, cv as BraintreePayment, cw as BraintreePaymentCreate, cy as BraintreePaymentSort, cx as BraintreePaymentUpdate, cz as Bundle, cA as BundleCreate, cC as BundleSort, cB as BundleUpdate, cD as BuyXPayYPromotion, cE as BuyXPayYPromotionCreate, cG as BuyXPayYPromotionSort, cF as BuyXPayYPromotionUpdate, cH as Capture, cJ as CaptureSort, cI as CaptureUpdate, cK as CarrierAccount, cL as CarrierAccountCreate, cN as CarrierAccountSort, cM as CarrierAccountUpdate, cO as CheckoutComGateway, cP as CheckoutComGatewayCreate, cR as CheckoutComGatewaySort, cQ as CheckoutComGatewayUpdate, cS as CheckoutComPayment, cT as CheckoutComPaymentCreate, cV as CheckoutComPaymentSort, cU as CheckoutComPaymentUpdate, cW as Cleanup, cX as CleanupCreate, cZ as CleanupSort, cY as CleanupUpdate, d6 as Coupon, c_ as CouponCodesPromotionRule, c$ as CouponCodesPromotionRuleCreate, d1 as CouponCodesPromotionRuleSort, d0 as CouponCodesPromotionRuleUpdate, d7 as CouponCreate, d2 as CouponRecipient, d3 as CouponRecipientCreate, d5 as CouponRecipientSort, d4 as CouponRecipientUpdate, d9 as CouponSort, d8 as CouponUpdate, da as CustomPromotionRule, db as CustomPromotionRuleCreate, dd as CustomPromotionRuleSort, dc as CustomPromotionRuleUpdate, dz as Customer, de as CustomerAddress, df as CustomerAddressCreate, dh as CustomerAddressSort, dg as CustomerAddressUpdate, dA as CustomerCreate, di as CustomerGroup, dj as CustomerGroupCreate, dl as CustomerGroupSort, dk as CustomerGroupUpdate, dm as CustomerPasswordReset, dn as CustomerPasswordResetCreate, dq as CustomerPasswordResetSort, dp as CustomerPasswordResetUpdate, dr as CustomerPaymentSource, ds as CustomerPaymentSourceCreate, du as CustomerPaymentSourceSort, dt as CustomerPaymentSourceUpdate, dC as CustomerSort, dv as CustomerSubscription, dw as CustomerSubscriptionCreate, dy as CustomerSubscriptionSort, dx as CustomerSubscriptionUpdate, dB as CustomerUpdate, dD as DeliveryLeadTime, dE as DeliveryLeadTimeCreate, dG as DeliveryLeadTimeSort, dF as DeliveryLeadTimeUpdate, dJ as DiscountEngine, dH as DiscountEngineItem, dI as DiscountEngineItemSort, dK as DiscountEngineSort, dL as EasypostPickup, dM as EasypostPickupCreate, dO as EasypostPickupSort, dN as EasypostPickupUpdate, dR as Event, dP as EventCallback, dQ as EventCallbackSort, dT as EventSort, dS as EventUpdate, dU as Export, dV as ExportCreate, dX as ExportSort, dW as ExportUpdate, dY as ExternalGateway, dZ as ExternalGatewayCreate, d$ as ExternalGatewaySort, d_ as ExternalGatewayUpdate, e0 as ExternalPayment, e1 as ExternalPaymentCreate, e3 as ExternalPaymentSort, e2 as ExternalPaymentUpdate, e4 as ExternalPromotion, e5 as ExternalPromotionCreate, e7 as ExternalPromotionSort, e6 as ExternalPromotionUpdate, e8 as ExternalTaxCalculator, e9 as ExternalTaxCalculatorCreate, eb as ExternalTaxCalculatorSort, ea as ExternalTaxCalculatorUpdate, ec as FixedAmountPromotion, ed as FixedAmountPromotionCreate, ef as FixedAmountPromotionSort, ee as FixedAmountPromotionUpdate, eg as FixedPricePromotion, eh as FixedPricePromotionCreate, ej as FixedPricePromotionSort, ei as FixedPricePromotionUpdate, ek as FlexPromotion, el as FlexPromotionCreate, en as FlexPromotionSort, em as FlexPromotionUpdate, eo as FreeGiftPromotion, ep as FreeGiftPromotionCreate, er as FreeGiftPromotionSort, eq as FreeGiftPromotionUpdate, es as FreeShippingPromotion, et as FreeShippingPromotionCreate, ev as FreeShippingPromotionSort, eu as FreeShippingPromotionUpdate, ew as Geocoder, ex as GeocoderSort, eC as GiftCard, eD as GiftCardCreate, ey as GiftCardRecipient, ez as GiftCardRecipientCreate, eB as GiftCardRecipientSort, eA as GiftCardRecipientUpdate, eF as GiftCardSort, eE as GiftCardUpdate, eG as GoogleGeocoder, eH as GoogleGeocoderCreate, eJ as GoogleGeocoderSort, eI as GoogleGeocoderUpdate, eK as Import, eL as ImportCreate, eN as ImportSort, eM as ImportUpdate, eO as InStockSubscription, eP as InStockSubscriptionCreate, eR as InStockSubscriptionSort, eQ as InStockSubscriptionUpdate, eS as InventoryModel, eT as InventoryModelCreate, eV as InventoryModelSort, eU as InventoryModelUpdate, eW as InventoryReturnLocation, eX as InventoryReturnLocationCreate, eZ as InventoryReturnLocationSort, eY as InventoryReturnLocationUpdate, e_ as InventoryStockLocation, e$ as InventoryStockLocationCreate, f1 as InventoryStockLocationSort, f0 as InventoryStockLocationUpdate, f2 as KlarnaGateway, f3 as KlarnaGatewayCreate, f5 as KlarnaGatewaySort, f4 as KlarnaGatewayUpdate, f6 as KlarnaPayment, f7 as KlarnaPaymentCreate, f9 as KlarnaPaymentSort, f8 as KlarnaPaymentUpdate, fe as LineItem, ff as LineItemCreate, fa as LineItemOption, fb as LineItemOptionCreate, fd as LineItemOptionSort, fc as LineItemOptionUpdate, fh as LineItemSort, fg as LineItemUpdate, fi as Link, fj as LinkCreate, fl as LinkSort, fk as LinkUpdate, fm as ManualGateway, fn as ManualGatewayCreate, fp as ManualGatewaySort, fo as ManualGatewayUpdate, fq as ManualTaxCalculator, fr as ManualTaxCalculatorCreate, ft as ManualTaxCalculatorSort, fs as ManualTaxCalculatorUpdate, fu as Market, fv as MarketCreate, fx as MarketSort, fw as MarketUpdate, fy as Merchant, fz as MerchantCreate, fB as MerchantSort, fA as MerchantUpdate, fC as Notification, fD as NotificationCreate, fF as NotificationSort, fE as NotificationUpdate, fY as Order, fG as OrderAmountPromotionRule, fH as OrderAmountPromotionRuleCreate, fJ as OrderAmountPromotionRuleSort, fI as OrderAmountPromotionRuleUpdate, fK as OrderCopy, fL as OrderCopyCreate, fN as OrderCopySort, fM as OrderCopyUpdate, fZ as OrderCreate, fO as OrderFactory, fP as OrderFactorySort, f$ as OrderSort, fU as OrderSubscription, fV as OrderSubscriptionCreate, fQ as OrderSubscriptionItem, fR as OrderSubscriptionItemCreate, fT as OrderSubscriptionItemSort, fS as OrderSubscriptionItemUpdate, fX as OrderSubscriptionSort, fW as OrderSubscriptionUpdate, f_ as OrderUpdate, g0 as Organization, g1 as OrganizationSort, g2 as Package, g3 as PackageCreate, g5 as PackageSort, g4 as PackageUpdate, ga as Parcel, gb as ParcelCreate, g6 as ParcelLineItem, g7 as ParcelLineItemCreate, g9 as ParcelLineItemSort, g8 as ParcelLineItemUpdate, gd as ParcelSort, gc as ParcelUpdate, ge as PaymentGateway, gf as PaymentGatewaySort, gg as PaymentMethod, gh as PaymentMethodCreate, gj as PaymentMethodSort, gi as PaymentMethodUpdate, gk as PaymentOption, gl as PaymentOptionCreate, gn as PaymentOptionSort, gm as PaymentOptionUpdate, go as PaypalGateway, gp as PaypalGatewayCreate, gr as PaypalGatewaySort, gq as PaypalGatewayUpdate, gs as PaypalPayment, gt as PaypalPaymentCreate, gv as PaypalPaymentSort, gu as PaypalPaymentUpdate, gw as PercentageDiscountPromotion, gx as PercentageDiscountPromotionCreate, gz as PercentageDiscountPromotionSort, gy as PercentageDiscountPromotionUpdate, gA as Pickup, gB as PickupSort, gU as Price, gV as PriceCreate, gC as PriceFrequencyTier, gD as PriceFrequencyTierCreate, gF as PriceFrequencyTierSort, gE as PriceFrequencyTierUpdate, gK as PriceList, gL as PriceListCreate, gG as PriceListScheduler, gH as PriceListSchedulerCreate, gJ as PriceListSchedulerSort, gI as PriceListSchedulerUpdate, gN as PriceListSort, gM as PriceListUpdate, gX as PriceSort, gO as PriceTier, gP as PriceTierSort, gW as PriceUpdate, gQ as PriceVolumeTier, gR as PriceVolumeTierCreate, gT as PriceVolumeTierSort, gS as PriceVolumeTierUpdate, g_ as Promotion, gY as PromotionRule, gZ as PromotionRuleSort, g$ as PromotionSort, h0 as RecurringOrderCopy, h1 as RecurringOrderCopyCreate, h3 as RecurringOrderCopySort, h2 as RecurringOrderCopyUpdate, h4 as Refund, h6 as RefundSort, h5 as RefundUpdate, h7 as ReservedStock, h8 as ReservedStockSort, h9 as ResourceError, ha as ResourceErrorSort, hf as Return, hg as ReturnCreate, hb as ReturnLineItem, hc as ReturnLineItemCreate, he as ReturnLineItemSort, hd as ReturnLineItemUpdate, hi as ReturnSort, hh as ReturnUpdate, hj as SatispayGateway, hk as SatispayGatewayCreate, hm as SatispayGatewaySort, hl as SatispayGatewayUpdate, hn as SatispayPayment, ho as SatispayPaymentCreate, hq as SatispayPaymentSort, hp as SatispayPaymentUpdate, hr as Shipment, hs as ShipmentCreate, hu as ShipmentSort, ht as ShipmentUpdate, hv as ShippingCategory, hw as ShippingCategoryCreate, hy as ShippingCategorySort, hx as ShippingCategoryUpdate, hB as ShippingMethod, hC as ShippingMethodCreate, hE as ShippingMethodSort, hz as ShippingMethodTier, hA as ShippingMethodTierSort, hD as ShippingMethodUpdate, hF as ShippingWeightTier, hG as ShippingWeightTierCreate, hI as ShippingWeightTierSort, hH as ShippingWeightTierUpdate, hJ as ShippingZone, hK as ShippingZoneCreate, hM as ShippingZoneSort, hL as ShippingZoneUpdate, i1 as Sku, i2 as SkuCreate, hV as SkuList, hW as SkuListCreate, hN as SkuListItem, hO as SkuListItemCreate, hQ as SkuListItemSort, hP as SkuListItemUpdate, hR as SkuListPromotionRule, hS as SkuListPromotionRuleCreate, hU as SkuListPromotionRuleSort, hT as SkuListPromotionRuleUpdate, hY as SkuListSort, hX as SkuListUpdate, hZ as SkuOption, h_ as SkuOptionCreate, i0 as SkuOptionSort, h$ as SkuOptionUpdate, i4 as SkuSort, i3 as SkuUpdate, i5 as StockItem, i6 as StockItemCreate, i8 as StockItemSort, i7 as StockItemUpdate, i9 as StockLineItem, ia as StockLineItemCreate, ic as StockLineItemSort, ib as StockLineItemUpdate, id as StockLocation, ie as StockLocationCreate, ih as StockLocationSort, ig as StockLocationUpdate, ii as StockReservation, ij as StockReservationCreate, il as StockReservationSort, ik as StockReservationUpdate, im as StockTransfer, io as StockTransferCreate, iq as StockTransferSort, ip as StockTransferUpdate, ir as Store, is as StoreCreate, iu as StoreSort, it as StoreUpdate, iv as StripeGateway, iw as StripeGatewayCreate, iy as StripeGatewaySort, ix as StripeGatewayUpdate, iz as StripePayment, iA as StripePaymentCreate, iC as StripePaymentSort, iB as StripePaymentUpdate, iD as StripeTaxAccount, iE as StripeTaxAccountCreate, iG as StripeTaxAccountSort, iF as StripeTaxAccountUpdate, iH as SubscriptionModel, iI as SubscriptionModelCreate, iK as SubscriptionModelSort, iJ as SubscriptionModelUpdate, iL as Tag, iM as TagCreate, iO as TagSort, iN as TagUpdate, iP as TalonOneAccount, iQ as TalonOneAccountCreate, iS as TalonOneAccountSort, iR as TalonOneAccountUpdate, iT as TaxCalculator, iU as TaxCalculatorSort, iV as TaxCategory, iW as TaxCategoryCreate, iY as TaxCategorySort, iX as TaxCategoryUpdate, iZ as TaxRule, i_ as TaxRuleCreate, j0 as TaxRuleSort, i$ as TaxRuleUpdate, j1 as TaxjarAccount, j2 as TaxjarAccountCreate, j4 as TaxjarAccountSort, j3 as TaxjarAccountUpdate, j5 as Transaction, j6 as TransactionSort, j7 as Version, j8 as VersionSort, j9 as VertexAccount, ja as VertexAccountCreate, jc as VertexAccountSort, jb as VertexAccountUpdate, jd as Void, jf as VoidSort, je as VoidUpdate, jg as Webhook, jh as WebhookCreate, jj as WebhookSort, ji as WebhookUpdate, jk as WireTransfer, jl as WireTransferCreate, jn as WireTransferSort, jm as WireTransferUpdate } from './api-DmIZO_Np.cjs';
2
2
  import './client.cjs';
3
- import './interceptor-5MISI1yn.cjs';
3
+ import './interceptor-k15jXzf0.cjs';
4
4
  import './types.cjs';