@commercelayer/sdk 5.35.0 → 6.0.0-alfa.10

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 (535) hide show
  1. package/lib/cjs/api.d.ts +0 -3
  2. package/lib/cjs/api.js +0 -10
  3. package/lib/cjs/client.d.ts +6 -14
  4. package/lib/cjs/client.js +41 -75
  5. package/lib/cjs/commercelayer.d.ts +126 -125
  6. package/lib/cjs/commercelayer.js +267 -155
  7. package/lib/cjs/common.js +1 -12
  8. package/lib/cjs/config.js +0 -2
  9. package/lib/cjs/debug.js +0 -21
  10. package/lib/cjs/error.d.ts +6 -7
  11. package/lib/cjs/error.js +36 -35
  12. package/lib/cjs/fetch.d.ts +13 -0
  13. package/lib/cjs/fetch.js +67 -0
  14. package/lib/cjs/index.js +0 -2
  15. package/lib/cjs/interceptor.d.ts +22 -10
  16. package/lib/cjs/jsonapi.js +0 -2
  17. package/lib/cjs/model.d.ts +0 -3
  18. package/lib/cjs/model.js +0 -1
  19. package/lib/cjs/query.d.ts +2 -1
  20. package/lib/cjs/query.js +8 -7
  21. package/lib/cjs/resource.d.ts +2 -5
  22. package/lib/cjs/resource.js +32 -58
  23. package/lib/cjs/resources/addresses.d.ts +1 -0
  24. package/lib/cjs/resources/addresses.js +4 -1
  25. package/lib/cjs/resources/adjustments.d.ts +1 -0
  26. package/lib/cjs/resources/adjustments.js +4 -1
  27. package/lib/cjs/resources/adyen_gateways.d.ts +1 -0
  28. package/lib/cjs/resources/adyen_gateways.js +4 -1
  29. package/lib/cjs/resources/adyen_payments.d.ts +1 -0
  30. package/lib/cjs/resources/adyen_payments.js +4 -1
  31. package/lib/cjs/resources/application.d.ts +1 -0
  32. package/lib/cjs/resources/application.js +4 -1
  33. package/lib/cjs/resources/attachments.d.ts +1 -0
  34. package/lib/cjs/resources/attachments.js +4 -1
  35. package/lib/cjs/resources/authorizations.d.ts +1 -0
  36. package/lib/cjs/resources/authorizations.js +4 -1
  37. package/lib/cjs/resources/avalara_accounts.d.ts +1 -0
  38. package/lib/cjs/resources/avalara_accounts.js +4 -1
  39. package/lib/cjs/resources/axerve_gateways.d.ts +1 -0
  40. package/lib/cjs/resources/axerve_gateways.js +4 -1
  41. package/lib/cjs/resources/axerve_payments.d.ts +1 -0
  42. package/lib/cjs/resources/axerve_payments.js +4 -1
  43. package/lib/cjs/resources/billing_info_validation_rules.d.ts +1 -0
  44. package/lib/cjs/resources/billing_info_validation_rules.js +4 -1
  45. package/lib/cjs/resources/bing_geocoders.d.ts +1 -0
  46. package/lib/cjs/resources/bing_geocoders.js +4 -1
  47. package/lib/cjs/resources/braintree_gateways.d.ts +1 -0
  48. package/lib/cjs/resources/braintree_gateways.js +4 -1
  49. package/lib/cjs/resources/braintree_payments.d.ts +1 -0
  50. package/lib/cjs/resources/braintree_payments.js +4 -1
  51. package/lib/cjs/resources/bundles.d.ts +1 -0
  52. package/lib/cjs/resources/bundles.js +4 -1
  53. package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +1 -0
  54. package/lib/cjs/resources/buy_x_pay_y_promotions.js +4 -1
  55. package/lib/cjs/resources/captures.d.ts +1 -0
  56. package/lib/cjs/resources/captures.js +4 -1
  57. package/lib/cjs/resources/carrier_accounts.d.ts +1 -0
  58. package/lib/cjs/resources/carrier_accounts.js +4 -1
  59. package/lib/cjs/resources/checkout_com_gateways.d.ts +1 -0
  60. package/lib/cjs/resources/checkout_com_gateways.js +4 -1
  61. package/lib/cjs/resources/checkout_com_payments.d.ts +1 -0
  62. package/lib/cjs/resources/checkout_com_payments.js +4 -1
  63. package/lib/cjs/resources/cleanups.d.ts +1 -0
  64. package/lib/cjs/resources/cleanups.js +4 -1
  65. package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +1 -0
  66. package/lib/cjs/resources/coupon_codes_promotion_rules.js +4 -1
  67. package/lib/cjs/resources/coupon_recipients.d.ts +1 -0
  68. package/lib/cjs/resources/coupon_recipients.js +4 -1
  69. package/lib/cjs/resources/coupons.d.ts +1 -0
  70. package/lib/cjs/resources/coupons.js +4 -1
  71. package/lib/cjs/resources/custom_promotion_rules.d.ts +1 -0
  72. package/lib/cjs/resources/custom_promotion_rules.js +4 -1
  73. package/lib/cjs/resources/customer_addresses.d.ts +1 -0
  74. package/lib/cjs/resources/customer_addresses.js +4 -1
  75. package/lib/cjs/resources/customer_groups.d.ts +1 -0
  76. package/lib/cjs/resources/customer_groups.js +4 -1
  77. package/lib/cjs/resources/customer_password_resets.d.ts +1 -0
  78. package/lib/cjs/resources/customer_password_resets.js +4 -1
  79. package/lib/cjs/resources/customer_payment_sources.d.ts +1 -0
  80. package/lib/cjs/resources/customer_payment_sources.js +4 -1
  81. package/lib/cjs/resources/customer_subscriptions.d.ts +1 -0
  82. package/lib/cjs/resources/customer_subscriptions.js +4 -1
  83. package/lib/cjs/resources/customers.d.ts +1 -0
  84. package/lib/cjs/resources/customers.js +4 -1
  85. package/lib/cjs/resources/delivery_lead_times.d.ts +1 -0
  86. package/lib/cjs/resources/delivery_lead_times.js +4 -1
  87. package/lib/cjs/resources/event_callbacks.d.ts +1 -0
  88. package/lib/cjs/resources/event_callbacks.js +4 -1
  89. package/lib/cjs/resources/events.d.ts +1 -0
  90. package/lib/cjs/resources/events.js +4 -1
  91. package/lib/cjs/resources/exports.d.ts +1 -0
  92. package/lib/cjs/resources/exports.js +4 -1
  93. package/lib/cjs/resources/external_gateways.d.ts +1 -0
  94. package/lib/cjs/resources/external_gateways.js +4 -1
  95. package/lib/cjs/resources/external_payments.d.ts +1 -0
  96. package/lib/cjs/resources/external_payments.js +4 -1
  97. package/lib/cjs/resources/external_promotions.d.ts +1 -0
  98. package/lib/cjs/resources/external_promotions.js +4 -1
  99. package/lib/cjs/resources/external_tax_calculators.d.ts +1 -0
  100. package/lib/cjs/resources/external_tax_calculators.js +4 -1
  101. package/lib/cjs/resources/fixed_amount_promotions.d.ts +1 -0
  102. package/lib/cjs/resources/fixed_amount_promotions.js +4 -1
  103. package/lib/cjs/resources/fixed_price_promotions.d.ts +1 -0
  104. package/lib/cjs/resources/fixed_price_promotions.js +4 -1
  105. package/lib/cjs/resources/free_gift_promotions.d.ts +1 -0
  106. package/lib/cjs/resources/free_gift_promotions.js +4 -1
  107. package/lib/cjs/resources/free_shipping_promotions.d.ts +1 -0
  108. package/lib/cjs/resources/free_shipping_promotions.js +4 -1
  109. package/lib/cjs/resources/geocoders.d.ts +1 -0
  110. package/lib/cjs/resources/geocoders.js +4 -1
  111. package/lib/cjs/resources/gift_card_recipients.d.ts +1 -0
  112. package/lib/cjs/resources/gift_card_recipients.js +4 -1
  113. package/lib/cjs/resources/gift_cards.d.ts +1 -0
  114. package/lib/cjs/resources/gift_cards.js +4 -1
  115. package/lib/cjs/resources/google_geocoders.d.ts +1 -0
  116. package/lib/cjs/resources/google_geocoders.js +4 -1
  117. package/lib/cjs/resources/imports.d.ts +1 -0
  118. package/lib/cjs/resources/imports.js +4 -1
  119. package/lib/cjs/resources/in_stock_subscriptions.d.ts +1 -0
  120. package/lib/cjs/resources/in_stock_subscriptions.js +4 -1
  121. package/lib/cjs/resources/inventory_models.d.ts +1 -0
  122. package/lib/cjs/resources/inventory_models.js +4 -1
  123. package/lib/cjs/resources/inventory_return_locations.d.ts +1 -0
  124. package/lib/cjs/resources/inventory_return_locations.js +4 -1
  125. package/lib/cjs/resources/inventory_stock_locations.d.ts +1 -0
  126. package/lib/cjs/resources/inventory_stock_locations.js +4 -1
  127. package/lib/cjs/resources/klarna_gateways.d.ts +1 -0
  128. package/lib/cjs/resources/klarna_gateways.js +4 -1
  129. package/lib/cjs/resources/klarna_payments.d.ts +1 -0
  130. package/lib/cjs/resources/klarna_payments.js +4 -1
  131. package/lib/cjs/resources/line_item_options.d.ts +1 -0
  132. package/lib/cjs/resources/line_item_options.js +4 -1
  133. package/lib/cjs/resources/line_items.d.ts +1 -0
  134. package/lib/cjs/resources/line_items.js +4 -1
  135. package/lib/cjs/resources/manual_gateways.d.ts +1 -0
  136. package/lib/cjs/resources/manual_gateways.js +4 -1
  137. package/lib/cjs/resources/manual_tax_calculators.d.ts +1 -0
  138. package/lib/cjs/resources/manual_tax_calculators.js +4 -1
  139. package/lib/cjs/resources/markets.d.ts +1 -0
  140. package/lib/cjs/resources/markets.js +4 -1
  141. package/lib/cjs/resources/merchants.d.ts +1 -0
  142. package/lib/cjs/resources/merchants.js +4 -1
  143. package/lib/cjs/resources/order_amount_promotion_rules.d.ts +1 -0
  144. package/lib/cjs/resources/order_amount_promotion_rules.js +4 -1
  145. package/lib/cjs/resources/order_copies.d.ts +1 -0
  146. package/lib/cjs/resources/order_copies.js +4 -1
  147. package/lib/cjs/resources/order_factories.d.ts +1 -0
  148. package/lib/cjs/resources/order_factories.js +4 -1
  149. package/lib/cjs/resources/order_subscription_items.d.ts +1 -0
  150. package/lib/cjs/resources/order_subscription_items.js +4 -1
  151. package/lib/cjs/resources/order_subscriptions.d.ts +1 -0
  152. package/lib/cjs/resources/order_subscriptions.js +4 -1
  153. package/lib/cjs/resources/order_validation_rules.d.ts +1 -0
  154. package/lib/cjs/resources/order_validation_rules.js +4 -1
  155. package/lib/cjs/resources/orders.d.ts +1 -0
  156. package/lib/cjs/resources/orders.js +4 -1
  157. package/lib/cjs/resources/organization.d.ts +1 -0
  158. package/lib/cjs/resources/organization.js +4 -1
  159. package/lib/cjs/resources/packages.d.ts +1 -0
  160. package/lib/cjs/resources/packages.js +4 -1
  161. package/lib/cjs/resources/parcel_line_items.d.ts +1 -0
  162. package/lib/cjs/resources/parcel_line_items.js +4 -1
  163. package/lib/cjs/resources/parcels.d.ts +1 -0
  164. package/lib/cjs/resources/parcels.js +4 -1
  165. package/lib/cjs/resources/payment_gateways.d.ts +1 -0
  166. package/lib/cjs/resources/payment_gateways.js +4 -1
  167. package/lib/cjs/resources/payment_methods.d.ts +1 -0
  168. package/lib/cjs/resources/payment_methods.js +4 -1
  169. package/lib/cjs/resources/payment_options.d.ts +1 -0
  170. package/lib/cjs/resources/payment_options.js +4 -1
  171. package/lib/cjs/resources/paypal_gateways.d.ts +1 -0
  172. package/lib/cjs/resources/paypal_gateways.js +4 -1
  173. package/lib/cjs/resources/paypal_payments.d.ts +1 -0
  174. package/lib/cjs/resources/paypal_payments.js +4 -1
  175. package/lib/cjs/resources/percentage_discount_promotions.d.ts +1 -0
  176. package/lib/cjs/resources/percentage_discount_promotions.js +4 -1
  177. package/lib/cjs/resources/price_frequency_tiers.d.ts +1 -0
  178. package/lib/cjs/resources/price_frequency_tiers.js +4 -1
  179. package/lib/cjs/resources/price_lists.d.ts +1 -0
  180. package/lib/cjs/resources/price_lists.js +4 -1
  181. package/lib/cjs/resources/price_tiers.d.ts +1 -0
  182. package/lib/cjs/resources/price_tiers.js +4 -1
  183. package/lib/cjs/resources/price_volume_tiers.d.ts +1 -0
  184. package/lib/cjs/resources/price_volume_tiers.js +4 -1
  185. package/lib/cjs/resources/prices.d.ts +1 -0
  186. package/lib/cjs/resources/prices.js +4 -1
  187. package/lib/cjs/resources/promotion_rules.d.ts +1 -0
  188. package/lib/cjs/resources/promotion_rules.js +4 -1
  189. package/lib/cjs/resources/promotions.d.ts +1 -0
  190. package/lib/cjs/resources/promotions.js +4 -1
  191. package/lib/cjs/resources/recurring_order_copies.d.ts +1 -0
  192. package/lib/cjs/resources/recurring_order_copies.js +4 -1
  193. package/lib/cjs/resources/refunds.d.ts +1 -0
  194. package/lib/cjs/resources/refunds.js +4 -1
  195. package/lib/cjs/resources/reserved_stocks.d.ts +1 -0
  196. package/lib/cjs/resources/reserved_stocks.js +4 -1
  197. package/lib/cjs/resources/resource_errors.d.ts +1 -0
  198. package/lib/cjs/resources/resource_errors.js +4 -1
  199. package/lib/cjs/resources/return_line_items.d.ts +1 -0
  200. package/lib/cjs/resources/return_line_items.js +4 -1
  201. package/lib/cjs/resources/returns.d.ts +1 -0
  202. package/lib/cjs/resources/returns.js +4 -1
  203. package/lib/cjs/resources/satispay_gateways.d.ts +1 -0
  204. package/lib/cjs/resources/satispay_gateways.js +4 -1
  205. package/lib/cjs/resources/satispay_payments.d.ts +1 -0
  206. package/lib/cjs/resources/satispay_payments.js +4 -1
  207. package/lib/cjs/resources/shipments.d.ts +1 -0
  208. package/lib/cjs/resources/shipments.js +4 -1
  209. package/lib/cjs/resources/shipping_categories.d.ts +1 -0
  210. package/lib/cjs/resources/shipping_categories.js +4 -1
  211. package/lib/cjs/resources/shipping_method_tiers.d.ts +1 -0
  212. package/lib/cjs/resources/shipping_method_tiers.js +4 -1
  213. package/lib/cjs/resources/shipping_methods.d.ts +1 -0
  214. package/lib/cjs/resources/shipping_methods.js +4 -1
  215. package/lib/cjs/resources/shipping_weight_tiers.d.ts +1 -0
  216. package/lib/cjs/resources/shipping_weight_tiers.js +4 -1
  217. package/lib/cjs/resources/shipping_zones.d.ts +1 -0
  218. package/lib/cjs/resources/shipping_zones.js +4 -1
  219. package/lib/cjs/resources/sku_list_items.d.ts +1 -0
  220. package/lib/cjs/resources/sku_list_items.js +4 -1
  221. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +1 -0
  222. package/lib/cjs/resources/sku_list_promotion_rules.js +4 -1
  223. package/lib/cjs/resources/sku_lists.d.ts +1 -0
  224. package/lib/cjs/resources/sku_lists.js +4 -1
  225. package/lib/cjs/resources/sku_options.d.ts +1 -0
  226. package/lib/cjs/resources/sku_options.js +4 -1
  227. package/lib/cjs/resources/skus.d.ts +1 -0
  228. package/lib/cjs/resources/skus.js +4 -1
  229. package/lib/cjs/resources/stock_items.d.ts +1 -0
  230. package/lib/cjs/resources/stock_items.js +4 -1
  231. package/lib/cjs/resources/stock_line_items.d.ts +1 -0
  232. package/lib/cjs/resources/stock_line_items.js +4 -1
  233. package/lib/cjs/resources/stock_locations.d.ts +1 -0
  234. package/lib/cjs/resources/stock_locations.js +4 -1
  235. package/lib/cjs/resources/stock_reservations.d.ts +1 -0
  236. package/lib/cjs/resources/stock_reservations.js +4 -1
  237. package/lib/cjs/resources/stock_transfers.d.ts +1 -0
  238. package/lib/cjs/resources/stock_transfers.js +4 -1
  239. package/lib/cjs/resources/stripe_gateways.d.ts +1 -0
  240. package/lib/cjs/resources/stripe_gateways.js +4 -1
  241. package/lib/cjs/resources/stripe_payments.d.ts +1 -0
  242. package/lib/cjs/resources/stripe_payments.js +4 -1
  243. package/lib/cjs/resources/subscription_models.d.ts +1 -0
  244. package/lib/cjs/resources/subscription_models.js +4 -1
  245. package/lib/cjs/resources/tags.d.ts +1 -0
  246. package/lib/cjs/resources/tags.js +4 -1
  247. package/lib/cjs/resources/tax_calculators.d.ts +1 -0
  248. package/lib/cjs/resources/tax_calculators.js +4 -1
  249. package/lib/cjs/resources/tax_categories.d.ts +1 -0
  250. package/lib/cjs/resources/tax_categories.js +4 -1
  251. package/lib/cjs/resources/tax_rules.d.ts +1 -0
  252. package/lib/cjs/resources/tax_rules.js +4 -1
  253. package/lib/cjs/resources/taxjar_accounts.d.ts +1 -0
  254. package/lib/cjs/resources/taxjar_accounts.js +4 -1
  255. package/lib/cjs/resources/transactions.d.ts +1 -0
  256. package/lib/cjs/resources/transactions.js +4 -1
  257. package/lib/cjs/resources/versions.d.ts +1 -0
  258. package/lib/cjs/resources/versions.js +4 -1
  259. package/lib/cjs/resources/voids.d.ts +1 -0
  260. package/lib/cjs/resources/voids.js +4 -1
  261. package/lib/cjs/resources/webhooks.d.ts +1 -0
  262. package/lib/cjs/resources/webhooks.js +4 -1
  263. package/lib/cjs/resources/wire_transfers.d.ts +1 -0
  264. package/lib/cjs/resources/wire_transfers.js +4 -1
  265. package/lib/cjs/static.js +0 -1
  266. package/lib/cjs/util.js +0 -1
  267. package/lib/esm/api.d.ts +0 -3
  268. package/lib/esm/api.js +0 -10
  269. package/lib/esm/client.d.ts +6 -14
  270. package/lib/esm/client.js +43 -90
  271. package/lib/esm/commercelayer.d.ts +126 -125
  272. package/lib/esm/commercelayer.js +270 -171
  273. package/lib/esm/common.js +1 -12
  274. package/lib/esm/config.js +0 -2
  275. package/lib/esm/debug.js +0 -21
  276. package/lib/esm/error.d.ts +6 -7
  277. package/lib/esm/error.js +44 -35
  278. package/lib/esm/fetch.d.ts +13 -0
  279. package/lib/esm/fetch.js +46 -0
  280. package/lib/esm/index.js +0 -2
  281. package/lib/esm/interceptor.d.ts +22 -10
  282. package/lib/esm/jsonapi.js +0 -2
  283. package/lib/esm/model.d.ts +0 -3
  284. package/lib/esm/model.js +0 -1
  285. package/lib/esm/query.d.ts +2 -1
  286. package/lib/esm/query.js +7 -7
  287. package/lib/esm/resource.d.ts +2 -5
  288. package/lib/esm/resource.js +40 -76
  289. package/lib/esm/resources/addresses.d.ts +1 -0
  290. package/lib/esm/resources/addresses.js +5 -2
  291. package/lib/esm/resources/adjustments.d.ts +1 -0
  292. package/lib/esm/resources/adjustments.js +5 -2
  293. package/lib/esm/resources/adyen_gateways.d.ts +1 -0
  294. package/lib/esm/resources/adyen_gateways.js +5 -2
  295. package/lib/esm/resources/adyen_payments.d.ts +1 -0
  296. package/lib/esm/resources/adyen_payments.js +5 -2
  297. package/lib/esm/resources/application.d.ts +1 -0
  298. package/lib/esm/resources/application.js +5 -2
  299. package/lib/esm/resources/attachments.d.ts +1 -0
  300. package/lib/esm/resources/attachments.js +5 -2
  301. package/lib/esm/resources/authorizations.d.ts +1 -0
  302. package/lib/esm/resources/authorizations.js +5 -2
  303. package/lib/esm/resources/avalara_accounts.d.ts +1 -0
  304. package/lib/esm/resources/avalara_accounts.js +5 -2
  305. package/lib/esm/resources/axerve_gateways.d.ts +1 -0
  306. package/lib/esm/resources/axerve_gateways.js +5 -2
  307. package/lib/esm/resources/axerve_payments.d.ts +1 -0
  308. package/lib/esm/resources/axerve_payments.js +5 -2
  309. package/lib/esm/resources/billing_info_validation_rules.d.ts +1 -0
  310. package/lib/esm/resources/billing_info_validation_rules.js +5 -2
  311. package/lib/esm/resources/bing_geocoders.d.ts +1 -0
  312. package/lib/esm/resources/bing_geocoders.js +5 -2
  313. package/lib/esm/resources/braintree_gateways.d.ts +1 -0
  314. package/lib/esm/resources/braintree_gateways.js +5 -2
  315. package/lib/esm/resources/braintree_payments.d.ts +1 -0
  316. package/lib/esm/resources/braintree_payments.js +5 -2
  317. package/lib/esm/resources/bundles.d.ts +1 -0
  318. package/lib/esm/resources/bundles.js +5 -2
  319. package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +1 -0
  320. package/lib/esm/resources/buy_x_pay_y_promotions.js +5 -2
  321. package/lib/esm/resources/captures.d.ts +1 -0
  322. package/lib/esm/resources/captures.js +5 -2
  323. package/lib/esm/resources/carrier_accounts.d.ts +1 -0
  324. package/lib/esm/resources/carrier_accounts.js +5 -2
  325. package/lib/esm/resources/checkout_com_gateways.d.ts +1 -0
  326. package/lib/esm/resources/checkout_com_gateways.js +5 -2
  327. package/lib/esm/resources/checkout_com_payments.d.ts +1 -0
  328. package/lib/esm/resources/checkout_com_payments.js +5 -2
  329. package/lib/esm/resources/cleanups.d.ts +1 -0
  330. package/lib/esm/resources/cleanups.js +5 -2
  331. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +1 -0
  332. package/lib/esm/resources/coupon_codes_promotion_rules.js +5 -2
  333. package/lib/esm/resources/coupon_recipients.d.ts +1 -0
  334. package/lib/esm/resources/coupon_recipients.js +5 -2
  335. package/lib/esm/resources/coupons.d.ts +1 -0
  336. package/lib/esm/resources/coupons.js +5 -2
  337. package/lib/esm/resources/custom_promotion_rules.d.ts +1 -0
  338. package/lib/esm/resources/custom_promotion_rules.js +5 -2
  339. package/lib/esm/resources/customer_addresses.d.ts +1 -0
  340. package/lib/esm/resources/customer_addresses.js +5 -2
  341. package/lib/esm/resources/customer_groups.d.ts +1 -0
  342. package/lib/esm/resources/customer_groups.js +5 -2
  343. package/lib/esm/resources/customer_password_resets.d.ts +1 -0
  344. package/lib/esm/resources/customer_password_resets.js +5 -2
  345. package/lib/esm/resources/customer_payment_sources.d.ts +1 -0
  346. package/lib/esm/resources/customer_payment_sources.js +5 -2
  347. package/lib/esm/resources/customer_subscriptions.d.ts +1 -0
  348. package/lib/esm/resources/customer_subscriptions.js +5 -2
  349. package/lib/esm/resources/customers.d.ts +1 -0
  350. package/lib/esm/resources/customers.js +5 -2
  351. package/lib/esm/resources/delivery_lead_times.d.ts +1 -0
  352. package/lib/esm/resources/delivery_lead_times.js +5 -2
  353. package/lib/esm/resources/event_callbacks.d.ts +1 -0
  354. package/lib/esm/resources/event_callbacks.js +5 -2
  355. package/lib/esm/resources/events.d.ts +1 -0
  356. package/lib/esm/resources/events.js +5 -2
  357. package/lib/esm/resources/exports.d.ts +1 -0
  358. package/lib/esm/resources/exports.js +5 -2
  359. package/lib/esm/resources/external_gateways.d.ts +1 -0
  360. package/lib/esm/resources/external_gateways.js +5 -2
  361. package/lib/esm/resources/external_payments.d.ts +1 -0
  362. package/lib/esm/resources/external_payments.js +5 -2
  363. package/lib/esm/resources/external_promotions.d.ts +1 -0
  364. package/lib/esm/resources/external_promotions.js +5 -2
  365. package/lib/esm/resources/external_tax_calculators.d.ts +1 -0
  366. package/lib/esm/resources/external_tax_calculators.js +5 -2
  367. package/lib/esm/resources/fixed_amount_promotions.d.ts +1 -0
  368. package/lib/esm/resources/fixed_amount_promotions.js +5 -2
  369. package/lib/esm/resources/fixed_price_promotions.d.ts +1 -0
  370. package/lib/esm/resources/fixed_price_promotions.js +5 -2
  371. package/lib/esm/resources/free_gift_promotions.d.ts +1 -0
  372. package/lib/esm/resources/free_gift_promotions.js +5 -2
  373. package/lib/esm/resources/free_shipping_promotions.d.ts +1 -0
  374. package/lib/esm/resources/free_shipping_promotions.js +5 -2
  375. package/lib/esm/resources/geocoders.d.ts +1 -0
  376. package/lib/esm/resources/geocoders.js +5 -2
  377. package/lib/esm/resources/gift_card_recipients.d.ts +1 -0
  378. package/lib/esm/resources/gift_card_recipients.js +5 -2
  379. package/lib/esm/resources/gift_cards.d.ts +1 -0
  380. package/lib/esm/resources/gift_cards.js +5 -2
  381. package/lib/esm/resources/google_geocoders.d.ts +1 -0
  382. package/lib/esm/resources/google_geocoders.js +5 -2
  383. package/lib/esm/resources/imports.d.ts +1 -0
  384. package/lib/esm/resources/imports.js +5 -2
  385. package/lib/esm/resources/in_stock_subscriptions.d.ts +1 -0
  386. package/lib/esm/resources/in_stock_subscriptions.js +5 -2
  387. package/lib/esm/resources/inventory_models.d.ts +1 -0
  388. package/lib/esm/resources/inventory_models.js +5 -2
  389. package/lib/esm/resources/inventory_return_locations.d.ts +1 -0
  390. package/lib/esm/resources/inventory_return_locations.js +5 -2
  391. package/lib/esm/resources/inventory_stock_locations.d.ts +1 -0
  392. package/lib/esm/resources/inventory_stock_locations.js +5 -2
  393. package/lib/esm/resources/klarna_gateways.d.ts +1 -0
  394. package/lib/esm/resources/klarna_gateways.js +5 -2
  395. package/lib/esm/resources/klarna_payments.d.ts +1 -0
  396. package/lib/esm/resources/klarna_payments.js +5 -2
  397. package/lib/esm/resources/line_item_options.d.ts +1 -0
  398. package/lib/esm/resources/line_item_options.js +5 -2
  399. package/lib/esm/resources/line_items.d.ts +1 -0
  400. package/lib/esm/resources/line_items.js +5 -2
  401. package/lib/esm/resources/manual_gateways.d.ts +1 -0
  402. package/lib/esm/resources/manual_gateways.js +5 -2
  403. package/lib/esm/resources/manual_tax_calculators.d.ts +1 -0
  404. package/lib/esm/resources/manual_tax_calculators.js +5 -2
  405. package/lib/esm/resources/markets.d.ts +1 -0
  406. package/lib/esm/resources/markets.js +5 -2
  407. package/lib/esm/resources/merchants.d.ts +1 -0
  408. package/lib/esm/resources/merchants.js +5 -2
  409. package/lib/esm/resources/order_amount_promotion_rules.d.ts +1 -0
  410. package/lib/esm/resources/order_amount_promotion_rules.js +5 -2
  411. package/lib/esm/resources/order_copies.d.ts +1 -0
  412. package/lib/esm/resources/order_copies.js +5 -2
  413. package/lib/esm/resources/order_factories.d.ts +1 -0
  414. package/lib/esm/resources/order_factories.js +5 -2
  415. package/lib/esm/resources/order_subscription_items.d.ts +1 -0
  416. package/lib/esm/resources/order_subscription_items.js +5 -2
  417. package/lib/esm/resources/order_subscriptions.d.ts +1 -0
  418. package/lib/esm/resources/order_subscriptions.js +5 -2
  419. package/lib/esm/resources/order_validation_rules.d.ts +1 -0
  420. package/lib/esm/resources/order_validation_rules.js +5 -2
  421. package/lib/esm/resources/orders.d.ts +1 -0
  422. package/lib/esm/resources/orders.js +5 -2
  423. package/lib/esm/resources/organization.d.ts +1 -0
  424. package/lib/esm/resources/organization.js +5 -2
  425. package/lib/esm/resources/packages.d.ts +1 -0
  426. package/lib/esm/resources/packages.js +5 -2
  427. package/lib/esm/resources/parcel_line_items.d.ts +1 -0
  428. package/lib/esm/resources/parcel_line_items.js +5 -2
  429. package/lib/esm/resources/parcels.d.ts +1 -0
  430. package/lib/esm/resources/parcels.js +5 -2
  431. package/lib/esm/resources/payment_gateways.d.ts +1 -0
  432. package/lib/esm/resources/payment_gateways.js +5 -2
  433. package/lib/esm/resources/payment_methods.d.ts +1 -0
  434. package/lib/esm/resources/payment_methods.js +5 -2
  435. package/lib/esm/resources/payment_options.d.ts +1 -0
  436. package/lib/esm/resources/payment_options.js +5 -2
  437. package/lib/esm/resources/paypal_gateways.d.ts +1 -0
  438. package/lib/esm/resources/paypal_gateways.js +5 -2
  439. package/lib/esm/resources/paypal_payments.d.ts +1 -0
  440. package/lib/esm/resources/paypal_payments.js +5 -2
  441. package/lib/esm/resources/percentage_discount_promotions.d.ts +1 -0
  442. package/lib/esm/resources/percentage_discount_promotions.js +5 -2
  443. package/lib/esm/resources/price_frequency_tiers.d.ts +1 -0
  444. package/lib/esm/resources/price_frequency_tiers.js +5 -2
  445. package/lib/esm/resources/price_lists.d.ts +1 -0
  446. package/lib/esm/resources/price_lists.js +5 -2
  447. package/lib/esm/resources/price_tiers.d.ts +1 -0
  448. package/lib/esm/resources/price_tiers.js +5 -2
  449. package/lib/esm/resources/price_volume_tiers.d.ts +1 -0
  450. package/lib/esm/resources/price_volume_tiers.js +5 -2
  451. package/lib/esm/resources/prices.d.ts +1 -0
  452. package/lib/esm/resources/prices.js +5 -2
  453. package/lib/esm/resources/promotion_rules.d.ts +1 -0
  454. package/lib/esm/resources/promotion_rules.js +5 -2
  455. package/lib/esm/resources/promotions.d.ts +1 -0
  456. package/lib/esm/resources/promotions.js +5 -2
  457. package/lib/esm/resources/recurring_order_copies.d.ts +1 -0
  458. package/lib/esm/resources/recurring_order_copies.js +5 -2
  459. package/lib/esm/resources/refunds.d.ts +1 -0
  460. package/lib/esm/resources/refunds.js +5 -2
  461. package/lib/esm/resources/reserved_stocks.d.ts +1 -0
  462. package/lib/esm/resources/reserved_stocks.js +5 -2
  463. package/lib/esm/resources/resource_errors.d.ts +1 -0
  464. package/lib/esm/resources/resource_errors.js +5 -2
  465. package/lib/esm/resources/return_line_items.d.ts +1 -0
  466. package/lib/esm/resources/return_line_items.js +5 -2
  467. package/lib/esm/resources/returns.d.ts +1 -0
  468. package/lib/esm/resources/returns.js +5 -2
  469. package/lib/esm/resources/satispay_gateways.d.ts +1 -0
  470. package/lib/esm/resources/satispay_gateways.js +5 -2
  471. package/lib/esm/resources/satispay_payments.d.ts +1 -0
  472. package/lib/esm/resources/satispay_payments.js +5 -2
  473. package/lib/esm/resources/shipments.d.ts +1 -0
  474. package/lib/esm/resources/shipments.js +5 -2
  475. package/lib/esm/resources/shipping_categories.d.ts +1 -0
  476. package/lib/esm/resources/shipping_categories.js +5 -2
  477. package/lib/esm/resources/shipping_method_tiers.d.ts +1 -0
  478. package/lib/esm/resources/shipping_method_tiers.js +5 -2
  479. package/lib/esm/resources/shipping_methods.d.ts +1 -0
  480. package/lib/esm/resources/shipping_methods.js +5 -2
  481. package/lib/esm/resources/shipping_weight_tiers.d.ts +1 -0
  482. package/lib/esm/resources/shipping_weight_tiers.js +5 -2
  483. package/lib/esm/resources/shipping_zones.d.ts +1 -0
  484. package/lib/esm/resources/shipping_zones.js +5 -2
  485. package/lib/esm/resources/sku_list_items.d.ts +1 -0
  486. package/lib/esm/resources/sku_list_items.js +5 -2
  487. package/lib/esm/resources/sku_list_promotion_rules.d.ts +1 -0
  488. package/lib/esm/resources/sku_list_promotion_rules.js +5 -2
  489. package/lib/esm/resources/sku_lists.d.ts +1 -0
  490. package/lib/esm/resources/sku_lists.js +5 -2
  491. package/lib/esm/resources/sku_options.d.ts +1 -0
  492. package/lib/esm/resources/sku_options.js +5 -2
  493. package/lib/esm/resources/skus.d.ts +1 -0
  494. package/lib/esm/resources/skus.js +5 -2
  495. package/lib/esm/resources/stock_items.d.ts +1 -0
  496. package/lib/esm/resources/stock_items.js +5 -2
  497. package/lib/esm/resources/stock_line_items.d.ts +1 -0
  498. package/lib/esm/resources/stock_line_items.js +5 -2
  499. package/lib/esm/resources/stock_locations.d.ts +1 -0
  500. package/lib/esm/resources/stock_locations.js +5 -2
  501. package/lib/esm/resources/stock_reservations.d.ts +1 -0
  502. package/lib/esm/resources/stock_reservations.js +5 -2
  503. package/lib/esm/resources/stock_transfers.d.ts +1 -0
  504. package/lib/esm/resources/stock_transfers.js +5 -2
  505. package/lib/esm/resources/stripe_gateways.d.ts +1 -0
  506. package/lib/esm/resources/stripe_gateways.js +5 -2
  507. package/lib/esm/resources/stripe_payments.d.ts +1 -0
  508. package/lib/esm/resources/stripe_payments.js +5 -2
  509. package/lib/esm/resources/subscription_models.d.ts +1 -0
  510. package/lib/esm/resources/subscription_models.js +5 -2
  511. package/lib/esm/resources/tags.d.ts +1 -0
  512. package/lib/esm/resources/tags.js +5 -2
  513. package/lib/esm/resources/tax_calculators.d.ts +1 -0
  514. package/lib/esm/resources/tax_calculators.js +5 -2
  515. package/lib/esm/resources/tax_categories.d.ts +1 -0
  516. package/lib/esm/resources/tax_categories.js +5 -2
  517. package/lib/esm/resources/tax_rules.d.ts +1 -0
  518. package/lib/esm/resources/tax_rules.js +5 -2
  519. package/lib/esm/resources/taxjar_accounts.d.ts +1 -0
  520. package/lib/esm/resources/taxjar_accounts.js +5 -2
  521. package/lib/esm/resources/transactions.d.ts +1 -0
  522. package/lib/esm/resources/transactions.js +5 -2
  523. package/lib/esm/resources/versions.d.ts +1 -0
  524. package/lib/esm/resources/versions.js +5 -2
  525. package/lib/esm/resources/voids.d.ts +1 -0
  526. package/lib/esm/resources/voids.js +5 -2
  527. package/lib/esm/resources/webhooks.d.ts +1 -0
  528. package/lib/esm/resources/webhooks.js +5 -2
  529. package/lib/esm/resources/wire_transfers.d.ts +1 -0
  530. package/lib/esm/resources/wire_transfers.js +5 -2
  531. package/lib/esm/static.js +0 -1
  532. package/lib/esm/util.js +1 -27
  533. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  534. package/lib/tsconfig.tsbuildinfo +1 -1
  535. package/package.json +20 -17
@@ -1,175 +1,273 @@
1
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
- if (kind === "m") throw new TypeError("Private method is not writable");
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
- };
7
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
- };
12
- var _CommerceLayerClient_adapter, _CommerceLayerClient_organization;
13
1
  import * as api from './api';
14
2
  import { CommerceLayerStatic } from './static';
15
3
  import ResourceAdapter from './resource';
16
4
  import Debug from './debug';
17
5
  const debug = Debug('commercelayer');
18
- // Autogenerated schema version number, do not remove this line
19
6
  const OPEN_API_SCHEMA_VERSION = '5.1.0';
20
7
  export { OPEN_API_SCHEMA_VERSION };
21
8
  class CommerceLayerClient {
22
- // ##__CL_RESOURCES_DEF_STOP__##
9
+ openApiSchemaVersion = OPEN_API_SCHEMA_VERSION;
10
+ #adapter;
11
+ #slug;
12
+ #addresses;
13
+ #adjustments;
14
+ #adyen_gateways;
15
+ #adyen_payments;
16
+ #application;
17
+ #attachments;
18
+ #authorizations;
19
+ #avalara_accounts;
20
+ #axerve_gateways;
21
+ #axerve_payments;
22
+ #billing_info_validation_rules;
23
+ #bing_geocoders;
24
+ #braintree_gateways;
25
+ #braintree_payments;
26
+ #bundles;
27
+ #buy_x_pay_y_promotions;
28
+ #captures;
29
+ #carrier_accounts;
30
+ #checkout_com_gateways;
31
+ #checkout_com_payments;
32
+ #cleanups;
33
+ #coupon_codes_promotion_rules;
34
+ #coupon_recipients;
35
+ #coupons;
36
+ #custom_promotion_rules;
37
+ #customer_addresses;
38
+ #customer_groups;
39
+ #customer_password_resets;
40
+ #customer_payment_sources;
41
+ #customer_subscriptions;
42
+ #customers;
43
+ #delivery_lead_times;
44
+ #event_callbacks;
45
+ #events;
46
+ #exports;
47
+ #external_gateways;
48
+ #external_payments;
49
+ #external_promotions;
50
+ #external_tax_calculators;
51
+ #fixed_amount_promotions;
52
+ #fixed_price_promotions;
53
+ #free_gift_promotions;
54
+ #free_shipping_promotions;
55
+ #geocoders;
56
+ #gift_card_recipients;
57
+ #gift_cards;
58
+ #google_geocoders;
59
+ #imports;
60
+ #in_stock_subscriptions;
61
+ #inventory_models;
62
+ #inventory_return_locations;
63
+ #inventory_stock_locations;
64
+ #klarna_gateways;
65
+ #klarna_payments;
66
+ #line_item_options;
67
+ #line_items;
68
+ #manual_gateways;
69
+ #manual_tax_calculators;
70
+ #markets;
71
+ #merchants;
72
+ #order_amount_promotion_rules;
73
+ #order_copies;
74
+ #order_factories;
75
+ #order_subscription_items;
76
+ #order_subscriptions;
77
+ #order_validation_rules;
78
+ #orders;
79
+ #organization;
80
+ #packages;
81
+ #parcel_line_items;
82
+ #parcels;
83
+ #payment_gateways;
84
+ #payment_methods;
85
+ #payment_options;
86
+ #paypal_gateways;
87
+ #paypal_payments;
88
+ #percentage_discount_promotions;
89
+ #price_frequency_tiers;
90
+ #price_lists;
91
+ #price_tiers;
92
+ #price_volume_tiers;
93
+ #prices;
94
+ #promotion_rules;
95
+ #promotions;
96
+ #recurring_order_copies;
97
+ #refunds;
98
+ #reserved_stocks;
99
+ #resource_errors;
100
+ #return_line_items;
101
+ #returns;
102
+ #satispay_gateways;
103
+ #satispay_payments;
104
+ #shipments;
105
+ #shipping_categories;
106
+ #shipping_method_tiers;
107
+ #shipping_methods;
108
+ #shipping_weight_tiers;
109
+ #shipping_zones;
110
+ #sku_list_items;
111
+ #sku_list_promotion_rules;
112
+ #sku_lists;
113
+ #sku_options;
114
+ #skus;
115
+ #stock_items;
116
+ #stock_line_items;
117
+ #stock_locations;
118
+ #stock_reservations;
119
+ #stock_transfers;
120
+ #stripe_gateways;
121
+ #stripe_payments;
122
+ #subscription_models;
123
+ #tags;
124
+ #tax_calculators;
125
+ #tax_categories;
126
+ #tax_rules;
127
+ #taxjar_accounts;
128
+ #transactions;
129
+ #versions;
130
+ #voids;
131
+ #webhooks;
132
+ #wire_transfers;
23
133
  constructor(config) {
24
- // static get openApiSchemaVersion(): string { return OPEN_API_SCHEMA_VERSION }
25
- this.openApiSchemaVersion = OPEN_API_SCHEMA_VERSION;
26
- _CommerceLayerClient_adapter.set(this, void 0);
27
- _CommerceLayerClient_organization.set(this, void 0);
28
134
  debug('new commercelayer instance %O', config);
29
- __classPrivateFieldSet(this, _CommerceLayerClient_adapter, new ResourceAdapter(config), "f");
30
- __classPrivateFieldSet(this, _CommerceLayerClient_organization, config.organization, "f");
31
- // this.#environment = 'test'
32
- // ##__CL_RESOURCES_INIT_START__##
33
- // ##__CL_RESOURCES_INIT_TEMPLATE:: ##__TAB__####__TAB__##this.##__RESOURCE_TYPE__## = new api.##__RESOURCE_CLASS__##(this.#adapter)
34
- this.addresses = new api.Addresses(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
35
- this.adjustments = new api.Adjustments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
36
- this.adyen_gateways = new api.AdyenGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
37
- this.adyen_payments = new api.AdyenPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
38
- this.application = new api.Applications(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
39
- this.attachments = new api.Attachments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
40
- this.authorizations = new api.Authorizations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
41
- this.avalara_accounts = new api.AvalaraAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
42
- this.axerve_gateways = new api.AxerveGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
43
- this.axerve_payments = new api.AxervePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
44
- this.billing_info_validation_rules = new api.BillingInfoValidationRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
45
- this.bing_geocoders = new api.BingGeocoders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
46
- this.braintree_gateways = new api.BraintreeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
47
- this.braintree_payments = new api.BraintreePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
48
- this.bundles = new api.Bundles(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
49
- this.buy_x_pay_y_promotions = new api.BuyXPayYPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
50
- this.captures = new api.Captures(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
51
- this.carrier_accounts = new api.CarrierAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
52
- this.checkout_com_gateways = new api.CheckoutComGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
53
- this.checkout_com_payments = new api.CheckoutComPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
54
- this.cleanups = new api.Cleanups(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
55
- this.coupon_codes_promotion_rules = new api.CouponCodesPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
56
- this.coupon_recipients = new api.CouponRecipients(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
57
- this.coupons = new api.Coupons(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
58
- this.custom_promotion_rules = new api.CustomPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
59
- this.customer_addresses = new api.CustomerAddresses(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
60
- this.customer_groups = new api.CustomerGroups(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
61
- this.customer_password_resets = new api.CustomerPasswordResets(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
62
- this.customer_payment_sources = new api.CustomerPaymentSources(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
63
- this.customer_subscriptions = new api.CustomerSubscriptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
64
- this.customers = new api.Customers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
65
- this.delivery_lead_times = new api.DeliveryLeadTimes(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
66
- this.event_callbacks = new api.EventCallbacks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
67
- this.events = new api.Events(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
68
- this.exports = new api.Exports(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
69
- this.external_gateways = new api.ExternalGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
70
- this.external_payments = new api.ExternalPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
71
- this.external_promotions = new api.ExternalPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
72
- this.external_tax_calculators = new api.ExternalTaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
73
- this.fixed_amount_promotions = new api.FixedAmountPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
74
- this.fixed_price_promotions = new api.FixedPricePromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
75
- this.free_gift_promotions = new api.FreeGiftPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
76
- this.free_shipping_promotions = new api.FreeShippingPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
77
- this.geocoders = new api.Geocoders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
78
- this.gift_card_recipients = new api.GiftCardRecipients(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
79
- this.gift_cards = new api.GiftCards(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
80
- this.google_geocoders = new api.GoogleGeocoders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
81
- this.imports = new api.Imports(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
82
- this.in_stock_subscriptions = new api.InStockSubscriptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
83
- this.inventory_models = new api.InventoryModels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
84
- this.inventory_return_locations = new api.InventoryReturnLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
85
- this.inventory_stock_locations = new api.InventoryStockLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
86
- this.klarna_gateways = new api.KlarnaGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
87
- this.klarna_payments = new api.KlarnaPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
88
- this.line_item_options = new api.LineItemOptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
89
- this.line_items = new api.LineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
90
- this.manual_gateways = new api.ManualGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
91
- this.manual_tax_calculators = new api.ManualTaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
92
- this.markets = new api.Markets(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
93
- this.merchants = new api.Merchants(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
94
- this.order_amount_promotion_rules = new api.OrderAmountPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
95
- this.order_copies = new api.OrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
96
- this.order_factories = new api.OrderFactories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
97
- this.order_subscription_items = new api.OrderSubscriptionItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
98
- this.order_subscriptions = new api.OrderSubscriptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
99
- this.order_validation_rules = new api.OrderValidationRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
100
- this.orders = new api.Orders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
101
- this.organization = new api.Organizations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
102
- this.packages = new api.Packages(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
103
- this.parcel_line_items = new api.ParcelLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
104
- this.parcels = new api.Parcels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
105
- this.payment_gateways = new api.PaymentGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
106
- this.payment_methods = new api.PaymentMethods(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
107
- this.payment_options = new api.PaymentOptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
108
- this.paypal_gateways = new api.PaypalGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
109
- this.paypal_payments = new api.PaypalPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
110
- this.percentage_discount_promotions = new api.PercentageDiscountPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
111
- this.price_frequency_tiers = new api.PriceFrequencyTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
112
- this.price_lists = new api.PriceLists(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
113
- this.price_tiers = new api.PriceTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
114
- this.price_volume_tiers = new api.PriceVolumeTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
115
- this.prices = new api.Prices(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
116
- this.promotion_rules = new api.PromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
117
- this.promotions = new api.Promotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
118
- this.recurring_order_copies = new api.RecurringOrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
119
- this.refunds = new api.Refunds(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
120
- this.reserved_stocks = new api.ReservedStocks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
121
- this.resource_errors = new api.ResourceErrors(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
122
- this.return_line_items = new api.ReturnLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
123
- this.returns = new api.Returns(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
124
- this.satispay_gateways = new api.SatispayGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
125
- this.satispay_payments = new api.SatispayPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
126
- this.shipments = new api.Shipments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
127
- this.shipping_categories = new api.ShippingCategories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
128
- this.shipping_method_tiers = new api.ShippingMethodTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
129
- this.shipping_methods = new api.ShippingMethods(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
130
- this.shipping_weight_tiers = new api.ShippingWeightTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
131
- this.shipping_zones = new api.ShippingZones(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
132
- this.sku_list_items = new api.SkuListItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
133
- this.sku_list_promotion_rules = new api.SkuListPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
134
- this.sku_lists = new api.SkuLists(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
135
- this.sku_options = new api.SkuOptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
136
- this.skus = new api.Skus(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
137
- this.stock_items = new api.StockItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
138
- this.stock_line_items = new api.StockLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
139
- this.stock_locations = new api.StockLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
140
- this.stock_reservations = new api.StockReservations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
141
- this.stock_transfers = new api.StockTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
142
- this.stripe_gateways = new api.StripeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
143
- this.stripe_payments = new api.StripePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
144
- this.subscription_models = new api.SubscriptionModels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
145
- this.tags = new api.Tags(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
146
- this.tax_calculators = new api.TaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
147
- this.tax_categories = new api.TaxCategories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
148
- this.tax_rules = new api.TaxRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
149
- this.taxjar_accounts = new api.TaxjarAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
150
- this.transactions = new api.Transactions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
151
- this.versions = new api.Versions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
152
- this.voids = new api.Voids(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
153
- this.webhooks = new api.Webhooks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
154
- this.wire_transfers = new api.WireTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
155
- // ##__CL_RESOURCES_INIT_STOP__##
135
+ this.#adapter = new ResourceAdapter(config);
136
+ this.#slug = config.organization;
156
137
  }
157
- get currentOrganization() { return __classPrivateFieldGet(this, _CommerceLayerClient_organization, "f"); }
158
- // get currentAccessToken(): string { return this.#adapter?.clientInstance?.currentAccessToken}
159
- // get environment(): ApiMode { return this.#environment }
138
+ get addresses() { return this.#addresses || (this.#addresses = new api.Addresses(this.#adapter)); }
139
+ get adjustments() { return this.#adjustments || (this.#adjustments = new api.Adjustments(this.#adapter)); }
140
+ get adyen_gateways() { return this.#adyen_gateways || (this.#adyen_gateways = new api.AdyenGateways(this.#adapter)); }
141
+ get adyen_payments() { return this.#adyen_payments || (this.#adyen_payments = new api.AdyenPayments(this.#adapter)); }
142
+ get application() { return this.#application || (this.#application = new api.Applications(this.#adapter)); }
143
+ get attachments() { return this.#attachments || (this.#attachments = new api.Attachments(this.#adapter)); }
144
+ get authorizations() { return this.#authorizations || (this.#authorizations = new api.Authorizations(this.#adapter)); }
145
+ get avalara_accounts() { return this.#avalara_accounts || (this.#avalara_accounts = new api.AvalaraAccounts(this.#adapter)); }
146
+ get axerve_gateways() { return this.#axerve_gateways || (this.#axerve_gateways = new api.AxerveGateways(this.#adapter)); }
147
+ get axerve_payments() { return this.#axerve_payments || (this.#axerve_payments = new api.AxervePayments(this.#adapter)); }
148
+ get billing_info_validation_rules() { return this.#billing_info_validation_rules || (this.#billing_info_validation_rules = new api.BillingInfoValidationRules(this.#adapter)); }
149
+ get bing_geocoders() { return this.#bing_geocoders || (this.#bing_geocoders = new api.BingGeocoders(this.#adapter)); }
150
+ get braintree_gateways() { return this.#braintree_gateways || (this.#braintree_gateways = new api.BraintreeGateways(this.#adapter)); }
151
+ get braintree_payments() { return this.#braintree_payments || (this.#braintree_payments = new api.BraintreePayments(this.#adapter)); }
152
+ get bundles() { return this.#bundles || (this.#bundles = new api.Bundles(this.#adapter)); }
153
+ get buy_x_pay_y_promotions() { return this.#buy_x_pay_y_promotions || (this.#buy_x_pay_y_promotions = new api.BuyXPayYPromotions(this.#adapter)); }
154
+ get captures() { return this.#captures || (this.#captures = new api.Captures(this.#adapter)); }
155
+ get carrier_accounts() { return this.#carrier_accounts || (this.#carrier_accounts = new api.CarrierAccounts(this.#adapter)); }
156
+ get checkout_com_gateways() { return this.#checkout_com_gateways || (this.#checkout_com_gateways = new api.CheckoutComGateways(this.#adapter)); }
157
+ get checkout_com_payments() { return this.#checkout_com_payments || (this.#checkout_com_payments = new api.CheckoutComPayments(this.#adapter)); }
158
+ get cleanups() { return this.#cleanups || (this.#cleanups = new api.Cleanups(this.#adapter)); }
159
+ get coupon_codes_promotion_rules() { return this.#coupon_codes_promotion_rules || (this.#coupon_codes_promotion_rules = new api.CouponCodesPromotionRules(this.#adapter)); }
160
+ get coupon_recipients() { return this.#coupon_recipients || (this.#coupon_recipients = new api.CouponRecipients(this.#adapter)); }
161
+ get coupons() { return this.#coupons || (this.#coupons = new api.Coupons(this.#adapter)); }
162
+ get custom_promotion_rules() { return this.#custom_promotion_rules || (this.#custom_promotion_rules = new api.CustomPromotionRules(this.#adapter)); }
163
+ get customer_addresses() { return this.#customer_addresses || (this.#customer_addresses = new api.CustomerAddresses(this.#adapter)); }
164
+ get customer_groups() { return this.#customer_groups || (this.#customer_groups = new api.CustomerGroups(this.#adapter)); }
165
+ get customer_password_resets() { return this.#customer_password_resets || (this.#customer_password_resets = new api.CustomerPasswordResets(this.#adapter)); }
166
+ get customer_payment_sources() { return this.#customer_payment_sources || (this.#customer_payment_sources = new api.CustomerPaymentSources(this.#adapter)); }
167
+ get customer_subscriptions() { return this.#customer_subscriptions || (this.#customer_subscriptions = new api.CustomerSubscriptions(this.#adapter)); }
168
+ get customers() { return this.#customers || (this.#customers = new api.Customers(this.#adapter)); }
169
+ get delivery_lead_times() { return this.#delivery_lead_times || (this.#delivery_lead_times = new api.DeliveryLeadTimes(this.#adapter)); }
170
+ get event_callbacks() { return this.#event_callbacks || (this.#event_callbacks = new api.EventCallbacks(this.#adapter)); }
171
+ get events() { return this.#events || (this.#events = new api.Events(this.#adapter)); }
172
+ get exports() { return this.#exports || (this.#exports = new api.Exports(this.#adapter)); }
173
+ get external_gateways() { return this.#external_gateways || (this.#external_gateways = new api.ExternalGateways(this.#adapter)); }
174
+ get external_payments() { return this.#external_payments || (this.#external_payments = new api.ExternalPayments(this.#adapter)); }
175
+ get external_promotions() { return this.#external_promotions || (this.#external_promotions = new api.ExternalPromotions(this.#adapter)); }
176
+ get external_tax_calculators() { return this.#external_tax_calculators || (this.#external_tax_calculators = new api.ExternalTaxCalculators(this.#adapter)); }
177
+ get fixed_amount_promotions() { return this.#fixed_amount_promotions || (this.#fixed_amount_promotions = new api.FixedAmountPromotions(this.#adapter)); }
178
+ get fixed_price_promotions() { return this.#fixed_price_promotions || (this.#fixed_price_promotions = new api.FixedPricePromotions(this.#adapter)); }
179
+ get free_gift_promotions() { return this.#free_gift_promotions || (this.#free_gift_promotions = new api.FreeGiftPromotions(this.#adapter)); }
180
+ get free_shipping_promotions() { return this.#free_shipping_promotions || (this.#free_shipping_promotions = new api.FreeShippingPromotions(this.#adapter)); }
181
+ get geocoders() { return this.#geocoders || (this.#geocoders = new api.Geocoders(this.#adapter)); }
182
+ get gift_card_recipients() { return this.#gift_card_recipients || (this.#gift_card_recipients = new api.GiftCardRecipients(this.#adapter)); }
183
+ get gift_cards() { return this.#gift_cards || (this.#gift_cards = new api.GiftCards(this.#adapter)); }
184
+ get google_geocoders() { return this.#google_geocoders || (this.#google_geocoders = new api.GoogleGeocoders(this.#adapter)); }
185
+ get imports() { return this.#imports || (this.#imports = new api.Imports(this.#adapter)); }
186
+ get in_stock_subscriptions() { return this.#in_stock_subscriptions || (this.#in_stock_subscriptions = new api.InStockSubscriptions(this.#adapter)); }
187
+ get inventory_models() { return this.#inventory_models || (this.#inventory_models = new api.InventoryModels(this.#adapter)); }
188
+ get inventory_return_locations() { return this.#inventory_return_locations || (this.#inventory_return_locations = new api.InventoryReturnLocations(this.#adapter)); }
189
+ get inventory_stock_locations() { return this.#inventory_stock_locations || (this.#inventory_stock_locations = new api.InventoryStockLocations(this.#adapter)); }
190
+ get klarna_gateways() { return this.#klarna_gateways || (this.#klarna_gateways = new api.KlarnaGateways(this.#adapter)); }
191
+ get klarna_payments() { return this.#klarna_payments || (this.#klarna_payments = new api.KlarnaPayments(this.#adapter)); }
192
+ get line_item_options() { return this.#line_item_options || (this.#line_item_options = new api.LineItemOptions(this.#adapter)); }
193
+ get line_items() { return this.#line_items || (this.#line_items = new api.LineItems(this.#adapter)); }
194
+ get manual_gateways() { return this.#manual_gateways || (this.#manual_gateways = new api.ManualGateways(this.#adapter)); }
195
+ get manual_tax_calculators() { return this.#manual_tax_calculators || (this.#manual_tax_calculators = new api.ManualTaxCalculators(this.#adapter)); }
196
+ get markets() { return this.#markets || (this.#markets = new api.Markets(this.#adapter)); }
197
+ get merchants() { return this.#merchants || (this.#merchants = new api.Merchants(this.#adapter)); }
198
+ get order_amount_promotion_rules() { return this.#order_amount_promotion_rules || (this.#order_amount_promotion_rules = new api.OrderAmountPromotionRules(this.#adapter)); }
199
+ get order_copies() { return this.#order_copies || (this.#order_copies = new api.OrderCopies(this.#adapter)); }
200
+ get order_factories() { return this.#order_factories || (this.#order_factories = new api.OrderFactories(this.#adapter)); }
201
+ get order_subscription_items() { return this.#order_subscription_items || (this.#order_subscription_items = new api.OrderSubscriptionItems(this.#adapter)); }
202
+ get order_subscriptions() { return this.#order_subscriptions || (this.#order_subscriptions = new api.OrderSubscriptions(this.#adapter)); }
203
+ get order_validation_rules() { return this.#order_validation_rules || (this.#order_validation_rules = new api.OrderValidationRules(this.#adapter)); }
204
+ get orders() { return this.#orders || (this.#orders = new api.Orders(this.#adapter)); }
205
+ get organization() { return this.#organization || (this.#organization = new api.Organizations(this.#adapter)); }
206
+ get packages() { return this.#packages || (this.#packages = new api.Packages(this.#adapter)); }
207
+ get parcel_line_items() { return this.#parcel_line_items || (this.#parcel_line_items = new api.ParcelLineItems(this.#adapter)); }
208
+ get parcels() { return this.#parcels || (this.#parcels = new api.Parcels(this.#adapter)); }
209
+ get payment_gateways() { return this.#payment_gateways || (this.#payment_gateways = new api.PaymentGateways(this.#adapter)); }
210
+ get payment_methods() { return this.#payment_methods || (this.#payment_methods = new api.PaymentMethods(this.#adapter)); }
211
+ get payment_options() { return this.#payment_options || (this.#payment_options = new api.PaymentOptions(this.#adapter)); }
212
+ get paypal_gateways() { return this.#paypal_gateways || (this.#paypal_gateways = new api.PaypalGateways(this.#adapter)); }
213
+ get paypal_payments() { return this.#paypal_payments || (this.#paypal_payments = new api.PaypalPayments(this.#adapter)); }
214
+ get percentage_discount_promotions() { return this.#percentage_discount_promotions || (this.#percentage_discount_promotions = new api.PercentageDiscountPromotions(this.#adapter)); }
215
+ get price_frequency_tiers() { return this.#price_frequency_tiers || (this.#price_frequency_tiers = new api.PriceFrequencyTiers(this.#adapter)); }
216
+ get price_lists() { return this.#price_lists || (this.#price_lists = new api.PriceLists(this.#adapter)); }
217
+ get price_tiers() { return this.#price_tiers || (this.#price_tiers = new api.PriceTiers(this.#adapter)); }
218
+ get price_volume_tiers() { return this.#price_volume_tiers || (this.#price_volume_tiers = new api.PriceVolumeTiers(this.#adapter)); }
219
+ get prices() { return this.#prices || (this.#prices = new api.Prices(this.#adapter)); }
220
+ get promotion_rules() { return this.#promotion_rules || (this.#promotion_rules = new api.PromotionRules(this.#adapter)); }
221
+ get promotions() { return this.#promotions || (this.#promotions = new api.Promotions(this.#adapter)); }
222
+ get recurring_order_copies() { return this.#recurring_order_copies || (this.#recurring_order_copies = new api.RecurringOrderCopies(this.#adapter)); }
223
+ get refunds() { return this.#refunds || (this.#refunds = new api.Refunds(this.#adapter)); }
224
+ get reserved_stocks() { return this.#reserved_stocks || (this.#reserved_stocks = new api.ReservedStocks(this.#adapter)); }
225
+ get resource_errors() { return this.#resource_errors || (this.#resource_errors = new api.ResourceErrors(this.#adapter)); }
226
+ get return_line_items() { return this.#return_line_items || (this.#return_line_items = new api.ReturnLineItems(this.#adapter)); }
227
+ get returns() { return this.#returns || (this.#returns = new api.Returns(this.#adapter)); }
228
+ get satispay_gateways() { return this.#satispay_gateways || (this.#satispay_gateways = new api.SatispayGateways(this.#adapter)); }
229
+ get satispay_payments() { return this.#satispay_payments || (this.#satispay_payments = new api.SatispayPayments(this.#adapter)); }
230
+ get shipments() { return this.#shipments || (this.#shipments = new api.Shipments(this.#adapter)); }
231
+ get shipping_categories() { return this.#shipping_categories || (this.#shipping_categories = new api.ShippingCategories(this.#adapter)); }
232
+ get shipping_method_tiers() { return this.#shipping_method_tiers || (this.#shipping_method_tiers = new api.ShippingMethodTiers(this.#adapter)); }
233
+ get shipping_methods() { return this.#shipping_methods || (this.#shipping_methods = new api.ShippingMethods(this.#adapter)); }
234
+ get shipping_weight_tiers() { return this.#shipping_weight_tiers || (this.#shipping_weight_tiers = new api.ShippingWeightTiers(this.#adapter)); }
235
+ get shipping_zones() { return this.#shipping_zones || (this.#shipping_zones = new api.ShippingZones(this.#adapter)); }
236
+ get sku_list_items() { return this.#sku_list_items || (this.#sku_list_items = new api.SkuListItems(this.#adapter)); }
237
+ get sku_list_promotion_rules() { return this.#sku_list_promotion_rules || (this.#sku_list_promotion_rules = new api.SkuListPromotionRules(this.#adapter)); }
238
+ get sku_lists() { return this.#sku_lists || (this.#sku_lists = new api.SkuLists(this.#adapter)); }
239
+ get sku_options() { return this.#sku_options || (this.#sku_options = new api.SkuOptions(this.#adapter)); }
240
+ get skus() { return this.#skus || (this.#skus = new api.Skus(this.#adapter)); }
241
+ get stock_items() { return this.#stock_items || (this.#stock_items = new api.StockItems(this.#adapter)); }
242
+ get stock_line_items() { return this.#stock_line_items || (this.#stock_line_items = new api.StockLineItems(this.#adapter)); }
243
+ get stock_locations() { return this.#stock_locations || (this.#stock_locations = new api.StockLocations(this.#adapter)); }
244
+ get stock_reservations() { return this.#stock_reservations || (this.#stock_reservations = new api.StockReservations(this.#adapter)); }
245
+ get stock_transfers() { return this.#stock_transfers || (this.#stock_transfers = new api.StockTransfers(this.#adapter)); }
246
+ get stripe_gateways() { return this.#stripe_gateways || (this.#stripe_gateways = new api.StripeGateways(this.#adapter)); }
247
+ get stripe_payments() { return this.#stripe_payments || (this.#stripe_payments = new api.StripePayments(this.#adapter)); }
248
+ get subscription_models() { return this.#subscription_models || (this.#subscription_models = new api.SubscriptionModels(this.#adapter)); }
249
+ get tags() { return this.#tags || (this.#tags = new api.Tags(this.#adapter)); }
250
+ get tax_calculators() { return this.#tax_calculators || (this.#tax_calculators = new api.TaxCalculators(this.#adapter)); }
251
+ get tax_categories() { return this.#tax_categories || (this.#tax_categories = new api.TaxCategories(this.#adapter)); }
252
+ get tax_rules() { return this.#tax_rules || (this.#tax_rules = new api.TaxRules(this.#adapter)); }
253
+ get taxjar_accounts() { return this.#taxjar_accounts || (this.#taxjar_accounts = new api.TaxjarAccounts(this.#adapter)); }
254
+ get transactions() { return this.#transactions || (this.#transactions = new api.Transactions(this.#adapter)); }
255
+ get versions() { return this.#versions || (this.#versions = new api.Versions(this.#adapter)); }
256
+ get voids() { return this.#voids || (this.#voids = new api.Voids(this.#adapter)); }
257
+ get webhooks() { return this.#webhooks || (this.#webhooks = new api.Webhooks(this.#adapter)); }
258
+ get wire_transfers() { return this.#wire_transfers || (this.#wire_transfers = new api.WireTransfers(this.#adapter)); }
259
+ get currentOrganization() { return this.#slug; }
260
+ get interceptors() { return this.#adapter.client.interceptors; }
160
261
  localConfig(config) {
161
262
  if (config.organization)
162
- __classPrivateFieldSet(this, _CommerceLayerClient_organization, config.organization, "f");
263
+ this.#slug = config.organization;
163
264
  }
164
265
  config(config) {
165
266
  debug('config %o', config);
166
- // CommerceLayer config
167
267
  this.localConfig(config);
168
- // ResourceAdapter config
169
- // To rebuild baseUrl in client in case only the domain is defined
170
268
  if (!config.organization)
171
269
  config.organization = this.currentOrganization;
172
- __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").config(config);
270
+ this.#adapter.config(config);
173
271
  return this;
174
272
  }
175
273
  resources() {
@@ -181,42 +279,43 @@ class CommerceLayerClient {
181
279
  isSingleton(resource) {
182
280
  return CommerceLayerStatic.isSingleton(resource);
183
281
  }
184
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
185
282
  isApiError(error) {
186
283
  return CommerceLayerStatic.isApiError(error);
187
284
  }
188
- addRequestInterceptor(onFulfilled, onRejected) {
189
- return __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").interceptors.request.use(onFulfilled, onRejected);
285
+ addRequestInterceptor(onSuccess, onFailure) {
286
+ this.interceptors.request = { onSuccess, onFailure };
190
287
  }
191
- addResponseInterceptor(onFulfilled, onRejected) {
192
- return __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").interceptors.response.use(onFulfilled, onRejected);
288
+ addResponseInterceptor(onSuccess, onFailure) {
289
+ this.interceptors.response = { onSuccess, onFailure };
193
290
  }
194
- removeInterceptor(type, id) {
195
- __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").interceptors[type].eject(id);
291
+ removeInterceptor(type, id = 1) {
292
+ this.interceptors[type] = undefined;
196
293
  }
197
294
  addRawResponseReader(options) {
198
295
  const reader = {
199
296
  id: undefined,
200
297
  rawResponse: undefined,
201
298
  headers: undefined,
299
+ ok: true
202
300
  };
203
- function rawResponseInterceptor(response) {
204
- reader.rawResponse = response === null || response === void 0 ? void 0 : response.data;
205
- if (options === null || options === void 0 ? void 0 : options.headers)
206
- reader.headers = response.headers;
301
+ async function rawResponseInterceptor(response) {
302
+ reader.rawResponse = await response?.clone().json().catch(() => { });
303
+ reader.ok = response.ok;
304
+ if (options?.headers) {
305
+ const ho = {};
306
+ response.headers.forEach((value, key) => { ho[key] = value; });
307
+ reader.headers = ho;
308
+ }
207
309
  return response;
208
310
  }
209
- const interceptor = this.addResponseInterceptor(rawResponseInterceptor);
210
- reader.id = interceptor;
311
+ this.interceptors.rawReader = { onSuccess: rawResponseInterceptor, onFailure: rawResponseInterceptor };
312
+ reader.id = 1;
211
313
  return reader;
212
314
  }
213
- removeRawResponseReader(reader) {
214
- const id = (typeof reader === 'number') ? reader : reader === null || reader === void 0 ? void 0 : reader.id;
215
- if (id && (id >= 0))
216
- this.removeInterceptor('response', id);
315
+ removeRawResponseReader() {
316
+ this.interceptors.rawReader = undefined;
217
317
  }
218
318
  }
219
- _CommerceLayerClient_adapter = new WeakMap(), _CommerceLayerClient_organization = new WeakMap();
220
319
  const CommerceLayer = (config) => {
221
320
  return new CommerceLayerClient(config);
222
321
  };
package/lib/esm/common.js CHANGED
@@ -1,19 +1,8 @@
1
1
  import { resourceList } from './api';
2
2
  const isResourceId = (resource) => {
3
- return ((resource === null || resource === void 0 ? void 0 : resource.type) && resource.id) && resourceList.includes(resource.type);
3
+ return (resource?.type && resource.id) && resourceList.includes(resource.type);
4
4
  };
5
5
  const isResourceType = (resource) => {
6
6
  return resource && (typeof resource.type !== 'undefined') && resource.type && resourceList.includes(resource.type);
7
7
  };
8
8
  export { isResourceId, isResourceType };
9
- /*
10
- // Nullable types
11
- type StringNullable = string | null
12
- type NumberNullable = number | null
13
- type BooleanNullable = boolean | null
14
- type ResourceNullable<R extends Resource> = R | null
15
- type ResourceArrayNullable<R extends Resource> = R[] | null
16
-
17
-
18
- export type { StringNullable, NumberNullable, BooleanNullable, ResourceNullable, ResourceArrayNullable }
19
- */
package/lib/esm/config.js CHANGED
@@ -1,7 +1,5 @@
1
- // export type ApiMode = 'test' | 'live'
2
1
  const config = {
3
2
  default: {
4
- // environment: 'test',
5
3
  domain: 'commercelayer.io',
6
4
  pageNumber: 1,
7
5
  pageSize: 10,
package/lib/esm/debug.js CHANGED
@@ -1,35 +1,14 @@
1
- /* Nope debugger */
2
1
  const debuggerFunction = (_pattern, ..._args) => {
3
- // console.log(_pattern)
4
2
  };
5
3
  let debuggerFactory = (_namespace) => debuggerFunction;
6
- /* Try loading 'debug' module */
7
4
  try {
8
5
  const debugModule = require('debug');
9
6
  if (debugModule && (typeof debugModule === 'function'))
10
7
  debuggerFactory = debugModule;
11
8
  }
12
9
  catch (error) {
13
- //
14
10
  }
15
11
  const debugPrefix = 'clsdk';
16
- /* Retrieve the name of the caller 'module' */
17
- /*
18
- const caller = (): string => {
19
-
20
- const err = new Error()
21
-
22
- Error.prepareStackTrace = (_, stack) => stack
23
- const stack = err.stack as unknown as NodeJS.CallSite[]
24
- Error.prepareStackTrace = undefined
25
-
26
- const fileName = stack[2].getFileName() || '/'
27
-
28
- return fileName.replace(/^.*[\\/]/, '').replace('.ts', '')
29
-
30
- }
31
- */
32
- /* Return a debugger for the defined namespace */
33
12
  const debug = (namespace) => {
34
13
  return debuggerFactory(`${debugPrefix}:${namespace}`);
35
14
  };
@@ -1,10 +1,10 @@
1
1
  declare enum ErrorType {
2
- CLIENT = "client",// Error instantiating the client
3
- REQUEST = "request",// Error preparing API request
4
- RESPONSE = "response",// Error response from API
5
- CANCEL = "cancel",// Forced request abort using interceptor
6
- PARSE = "parse",// Error parsing API resource
7
- GENERIC = "generic"
2
+ CLIENT = "client",
3
+ REQUEST = "request",
4
+ RESPONSE = "response",
5
+ CANCEL = "cancel",
6
+ PARSE = "parse",
7
+ TIMEOUT = "timeout"
8
8
  }
9
9
  declare class SdkError extends Error {
10
10
  static NAME: string;
@@ -12,7 +12,6 @@ declare class SdkError extends Error {
12
12
  type: ErrorType;
13
13
  code?: string;
14
14
  source?: Error;
15
- request?: any;
16
15
  constructor(error: {
17
16
  message: string;
18
17
  type?: ErrorType;