@commercelayer/sdk 5.37.0 → 5.38.0

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