@commercelayer/sdk 4.22.0 → 4.24.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 (479) hide show
  1. package/lib/cjs/api.d.ts +109 -1
  2. package/lib/cjs/api.js +343 -1
  3. package/lib/cjs/client.d.ts +31 -1
  4. package/lib/cjs/client.js +123 -1
  5. package/lib/cjs/commercelayer.d.ts +135 -1
  6. package/lib/cjs/commercelayer.js +226 -1
  7. package/lib/cjs/common.d.ts +4 -1
  8. package/lib/cjs/common.js +14 -1
  9. package/lib/cjs/config.d.ts +11 -1
  10. package/lib/cjs/config.js +13 -1
  11. package/lib/cjs/debug.d.ts +3 -1
  12. package/lib/cjs/debug.js +42 -1
  13. package/lib/cjs/error.d.ts +28 -1
  14. package/lib/cjs/error.js +43 -1
  15. package/lib/cjs/index.d.ts +7 -1
  16. package/lib/cjs/index.js +29 -1
  17. package/lib/cjs/interceptor.d.ts +21 -1
  18. package/lib/cjs/interceptor.js +2 -1
  19. package/lib/cjs/jsonapi.d.ts +5 -1
  20. package/lib/cjs/jsonapi.js +82 -1
  21. package/lib/cjs/model.d.ts +107 -1
  22. package/lib/cjs/model.js +3 -1
  23. package/lib/cjs/query.d.ts +23 -1
  24. package/lib/cjs/query.js +51 -1
  25. package/lib/cjs/resource.d.ts +77 -1
  26. package/lib/cjs/resource.js +145 -1
  27. package/lib/cjs/resources/addresses.d.ts +88 -1
  28. package/lib/cjs/resources/addresses.js +37 -1
  29. package/lib/cjs/resources/adjustments.d.ts +35 -1
  30. package/lib/cjs/resources/adjustments.js +33 -1
  31. package/lib/cjs/resources/adyen_gateways.d.ts +56 -1
  32. package/lib/cjs/resources/adyen_gateways.js +41 -1
  33. package/lib/cjs/resources/adyen_payments.d.ts +46 -1
  34. package/lib/cjs/resources/adyen_payments.js +41 -1
  35. package/lib/cjs/resources/application.d.ts +21 -1
  36. package/lib/cjs/resources/application.js +21 -1
  37. package/lib/cjs/resources/attachments.d.ts +156 -1
  38. package/lib/cjs/resources/attachments.js +33 -1
  39. package/lib/cjs/resources/authorizations.d.ts +60 -1
  40. package/lib/cjs/resources/authorizations.js +43 -1
  41. package/lib/cjs/resources/avalara_accounts.d.ts +55 -1
  42. package/lib/cjs/resources/avalara_accounts.js +45 -1
  43. package/lib/cjs/resources/billing_info_validation_rules.d.ts +35 -1
  44. package/lib/cjs/resources/billing_info_validation_rules.js +41 -1
  45. package/lib/cjs/resources/bing_geocoders.d.ts +35 -1
  46. package/lib/cjs/resources/bing_geocoders.js +41 -1
  47. package/lib/cjs/resources/braintree_gateways.d.ts +56 -1
  48. package/lib/cjs/resources/braintree_gateways.js +41 -1
  49. package/lib/cjs/resources/braintree_payments.d.ts +48 -1
  50. package/lib/cjs/resources/braintree_payments.js +41 -1
  51. package/lib/cjs/resources/bundles.d.ts +76 -1
  52. package/lib/cjs/resources/bundles.js +49 -1
  53. package/lib/cjs/resources/captures.d.ts +51 -1
  54. package/lib/cjs/resources/captures.js +43 -1
  55. package/lib/cjs/resources/carrier_accounts.d.ts +26 -1
  56. package/lib/cjs/resources/carrier_accounts.js +32 -1
  57. package/lib/cjs/resources/checkout_com_gateways.d.ts +45 -1
  58. package/lib/cjs/resources/checkout_com_gateways.js +41 -1
  59. package/lib/cjs/resources/checkout_com_payments.d.ts +59 -1
  60. package/lib/cjs/resources/checkout_com_payments.js +41 -1
  61. package/lib/cjs/resources/cleanups.d.ts +36 -1
  62. package/lib/cjs/resources/cleanups.js +34 -1
  63. package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +59 -1
  64. package/lib/cjs/resources/coupon_codes_promotion_rules.js +37 -1
  65. package/lib/cjs/resources/coupon_recipients.d.ts +44 -1
  66. package/lib/cjs/resources/coupon_recipients.js +41 -1
  67. package/lib/cjs/resources/coupons.d.ts +45 -1
  68. package/lib/cjs/resources/coupons.js +37 -1
  69. package/lib/cjs/resources/customer_addresses.d.ts +44 -1
  70. package/lib/cjs/resources/customer_addresses.js +45 -1
  71. package/lib/cjs/resources/customer_groups.d.ts +36 -1
  72. package/lib/cjs/resources/customer_groups.js +45 -1
  73. package/lib/cjs/resources/customer_password_resets.d.ts +36 -1
  74. package/lib/cjs/resources/customer_password_resets.js +41 -1
  75. package/lib/cjs/resources/customer_payment_sources.d.ts +70 -1
  76. package/lib/cjs/resources/customer_payment_sources.js +37 -1
  77. package/lib/cjs/resources/customer_subscriptions.d.ts +31 -1
  78. package/lib/cjs/resources/customer_subscriptions.js +41 -1
  79. package/lib/cjs/resources/customers.d.ts +66 -1
  80. package/lib/cjs/resources/customers.js +73 -1
  81. package/lib/cjs/resources/delivery_lead_times.d.ts +51 -1
  82. package/lib/cjs/resources/delivery_lead_times.js +45 -1
  83. package/lib/cjs/resources/event_callbacks.d.ts +24 -1
  84. package/lib/cjs/resources/event_callbacks.js +28 -1
  85. package/lib/cjs/resources/events.d.ts +24 -1
  86. package/lib/cjs/resources/events.js +32 -1
  87. package/lib/cjs/resources/exports.d.ts +40 -1
  88. package/lib/cjs/resources/exports.js +34 -1
  89. package/lib/cjs/resources/external_gateways.d.ts +49 -1
  90. package/lib/cjs/resources/external_gateways.js +41 -1
  91. package/lib/cjs/resources/external_payments.d.ts +44 -1
  92. package/lib/cjs/resources/external_payments.js +45 -1
  93. package/lib/cjs/resources/external_promotions.d.ts +90 -1
  94. package/lib/cjs/resources/external_promotions.js +57 -1
  95. package/lib/cjs/resources/external_tax_calculators.d.ts +37 -1
  96. package/lib/cjs/resources/external_tax_calculators.js +41 -1
  97. package/lib/cjs/resources/fixed_amount_promotions.d.ts +91 -1
  98. package/lib/cjs/resources/fixed_amount_promotions.js +57 -1
  99. package/lib/cjs/resources/fixed_price_promotions.d.ts +102 -1
  100. package/lib/cjs/resources/fixed_price_promotions.js +65 -1
  101. package/lib/cjs/resources/free_gift_promotions.d.ts +100 -1
  102. package/lib/cjs/resources/free_gift_promotions.js +65 -1
  103. package/lib/cjs/resources/free_shipping_promotions.d.ts +83 -1
  104. package/lib/cjs/resources/free_shipping_promotions.js +53 -1
  105. package/lib/cjs/resources/geocoders.d.ts +24 -1
  106. package/lib/cjs/resources/geocoders.js +32 -1
  107. package/lib/cjs/resources/gift_card_recipients.d.ts +44 -1
  108. package/lib/cjs/resources/gift_card_recipients.js +41 -1
  109. package/lib/cjs/resources/gift_cards.d.ts +85 -1
  110. package/lib/cjs/resources/gift_cards.js +49 -1
  111. package/lib/cjs/resources/google_geocoders.d.ts +35 -1
  112. package/lib/cjs/resources/google_geocoders.js +41 -1
  113. package/lib/cjs/resources/imports.d.ts +45 -1
  114. package/lib/cjs/resources/imports.js +34 -1
  115. package/lib/cjs/resources/in_stock_subscriptions.d.ts +62 -1
  116. package/lib/cjs/resources/in_stock_subscriptions.js +49 -1
  117. package/lib/cjs/resources/inventory_models.d.ts +42 -1
  118. package/lib/cjs/resources/inventory_models.js +45 -1
  119. package/lib/cjs/resources/inventory_return_locations.d.ts +43 -1
  120. package/lib/cjs/resources/inventory_return_locations.js +41 -1
  121. package/lib/cjs/resources/inventory_stock_locations.d.ts +46 -1
  122. package/lib/cjs/resources/inventory_stock_locations.js +41 -1
  123. package/lib/cjs/resources/klarna_gateways.d.ts +44 -1
  124. package/lib/cjs/resources/klarna_gateways.js +41 -1
  125. package/lib/cjs/resources/klarna_payments.d.ts +46 -1
  126. package/lib/cjs/resources/klarna_payments.js +41 -1
  127. package/lib/cjs/resources/line_item_options.d.ts +57 -1
  128. package/lib/cjs/resources/line_item_options.js +41 -1
  129. package/lib/cjs/resources/line_items.d.ts +126 -1
  130. package/lib/cjs/resources/line_items.js +49 -1
  131. package/lib/cjs/resources/manual_gateways.d.ts +33 -1
  132. package/lib/cjs/resources/manual_gateways.js +37 -1
  133. package/lib/cjs/resources/manual_tax_calculators.d.ts +41 -1
  134. package/lib/cjs/resources/manual_tax_calculators.js +45 -1
  135. package/lib/cjs/resources/markets.d.ts +88 -1
  136. package/lib/cjs/resources/markets.js +57 -1
  137. package/lib/cjs/resources/merchants.d.ts +38 -1
  138. package/lib/cjs/resources/merchants.js +41 -1
  139. package/lib/cjs/resources/order_amount_promotion_rules.d.ts +56 -1
  140. package/lib/cjs/resources/order_amount_promotion_rules.js +33 -1
  141. package/lib/cjs/resources/order_copies.d.ts +48 -1
  142. package/lib/cjs/resources/order_copies.js +46 -1
  143. package/lib/cjs/resources/order_subscriptions.d.ts +70 -1
  144. package/lib/cjs/resources/order_subscriptions.js +57 -1
  145. package/lib/cjs/resources/order_validation_rules.d.ts +23 -1
  146. package/lib/cjs/resources/order_validation_rules.js +32 -1
  147. package/lib/cjs/resources/orders.d.ts +288 -1
  148. package/lib/cjs/resources/orders.js +113 -1
  149. package/lib/cjs/resources/organization.d.ts +32 -1
  150. package/lib/cjs/resources/organization.js +21 -1
  151. package/lib/cjs/resources/packages.d.ts +56 -1
  152. package/lib/cjs/resources/packages.js +45 -1
  153. package/lib/cjs/resources/parcel_line_items.d.ts +51 -1
  154. package/lib/cjs/resources/parcel_line_items.js +41 -1
  155. package/lib/cjs/resources/parcels.d.ts +119 -1
  156. package/lib/cjs/resources/parcels.js +53 -1
  157. package/lib/cjs/resources/payment_gateways.d.ts +21 -1
  158. package/lib/cjs/resources/payment_gateways.js +28 -1
  159. package/lib/cjs/resources/payment_methods.d.ts +61 -1
  160. package/lib/cjs/resources/payment_methods.js +45 -1
  161. package/lib/cjs/resources/paypal_gateways.d.ts +37 -1
  162. package/lib/cjs/resources/paypal_gateways.js +41 -1
  163. package/lib/cjs/resources/paypal_payments.d.ts +52 -1
  164. package/lib/cjs/resources/paypal_payments.js +41 -1
  165. package/lib/cjs/resources/percentage_discount_promotions.d.ts +100 -1
  166. package/lib/cjs/resources/percentage_discount_promotions.js +65 -1
  167. package/lib/cjs/resources/price_lists.d.ts +39 -1
  168. package/lib/cjs/resources/price_lists.js +41 -1
  169. package/lib/cjs/resources/price_tiers.d.ts +28 -1
  170. package/lib/cjs/resources/price_tiers.js +32 -1
  171. package/lib/cjs/resources/price_volume_tiers.d.ts +46 -1
  172. package/lib/cjs/resources/price_volume_tiers.js +41 -1
  173. package/lib/cjs/resources/prices.d.ts +68 -1
  174. package/lib/cjs/resources/prices.js +53 -1
  175. package/lib/cjs/resources/promotion_rules.d.ts +24 -1
  176. package/lib/cjs/resources/promotion_rules.js +24 -1
  177. package/lib/cjs/resources/promotions.d.ts +41 -1
  178. package/lib/cjs/resources/promotions.js +44 -1
  179. package/lib/cjs/resources/refunds.d.ts +37 -1
  180. package/lib/cjs/resources/refunds.js +36 -1
  181. package/lib/cjs/resources/return_line_items.d.ts +49 -1
  182. package/lib/cjs/resources/return_line_items.js +41 -1
  183. package/lib/cjs/resources/returns.d.ts +75 -1
  184. package/lib/cjs/resources/returns.js +65 -1
  185. package/lib/cjs/resources/shipments.d.ts +93 -1
  186. package/lib/cjs/resources/shipments.js +83 -1
  187. package/lib/cjs/resources/shipping_categories.d.ts +33 -1
  188. package/lib/cjs/resources/shipping_categories.js +41 -1
  189. package/lib/cjs/resources/shipping_method_tiers.d.ts +28 -1
  190. package/lib/cjs/resources/shipping_method_tiers.js +32 -1
  191. package/lib/cjs/resources/shipping_methods.d.ts +107 -1
  192. package/lib/cjs/resources/shipping_methods.js +65 -1
  193. package/lib/cjs/resources/shipping_weight_tiers.d.ts +46 -1
  194. package/lib/cjs/resources/shipping_weight_tiers.js +41 -1
  195. package/lib/cjs/resources/shipping_zones.d.ts +48 -1
  196. package/lib/cjs/resources/shipping_zones.js +37 -1
  197. package/lib/cjs/resources/sku_list_items.d.ts +47 -1
  198. package/lib/cjs/resources/sku_list_items.js +41 -1
  199. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +68 -1
  200. package/lib/cjs/resources/sku_list_promotion_rules.js +41 -1
  201. package/lib/cjs/resources/sku_lists.d.ts +60 -1
  202. package/lib/cjs/resources/sku_lists.js +53 -1
  203. package/lib/cjs/resources/sku_options.d.ts +56 -1
  204. package/lib/cjs/resources/sku_options.js +41 -1
  205. package/lib/cjs/resources/skus.d.ts +78 -1
  206. package/lib/cjs/resources/skus.js +57 -1
  207. package/lib/cjs/resources/stock_items.d.ts +49 -1
  208. package/lib/cjs/resources/stock_items.js +45 -1
  209. package/lib/cjs/resources/stock_line_items.d.ts +29 -1
  210. package/lib/cjs/resources/stock_line_items.js +36 -1
  211. package/lib/cjs/resources/stock_locations.d.ts +57 -1
  212. package/lib/cjs/resources/stock_locations.js +57 -1
  213. package/lib/cjs/resources/stock_transfers.d.ts +74 -1
  214. package/lib/cjs/resources/stock_transfers.js +57 -1
  215. package/lib/cjs/resources/stripe_gateways.d.ts +41 -1
  216. package/lib/cjs/resources/stripe_gateways.js +41 -1
  217. package/lib/cjs/resources/stripe_payments.d.ts +47 -1
  218. package/lib/cjs/resources/stripe_payments.js +41 -1
  219. package/lib/cjs/resources/tax_calculators.d.ts +24 -1
  220. package/lib/cjs/resources/tax_calculators.js +32 -1
  221. package/lib/cjs/resources/tax_categories.d.ts +59 -1
  222. package/lib/cjs/resources/tax_categories.js +41 -1
  223. package/lib/cjs/resources/tax_rules.d.ts +69 -1
  224. package/lib/cjs/resources/tax_rules.js +37 -1
  225. package/lib/cjs/resources/taxjar_accounts.d.ts +43 -1
  226. package/lib/cjs/resources/taxjar_accounts.js +45 -1
  227. package/lib/cjs/resources/transactions.d.ts +31 -1
  228. package/lib/cjs/resources/transactions.js +28 -1
  229. package/lib/cjs/resources/voids.d.ts +37 -1
  230. package/lib/cjs/resources/voids.js +36 -1
  231. package/lib/cjs/resources/webhooks.d.ts +43 -1
  232. package/lib/cjs/resources/webhooks.js +37 -1
  233. package/lib/cjs/resources/wire_transfers.d.ts +33 -1
  234. package/lib/cjs/resources/wire_transfers.js +37 -1
  235. package/lib/cjs/static.d.ts +9 -1
  236. package/lib/cjs/static.js +45 -1
  237. package/lib/cjs/util.d.ts +6 -1
  238. package/lib/cjs/util.js +15 -1
  239. package/lib/esm/api.d.ts +109 -1
  240. package/lib/esm/api.js +231 -1
  241. package/lib/esm/client.d.ts +31 -1
  242. package/lib/esm/client.js +118 -1
  243. package/lib/esm/commercelayer.d.ts +135 -1
  244. package/lib/esm/commercelayer.js +197 -1
  245. package/lib/esm/common.d.ts +4 -1
  246. package/lib/esm/common.js +10 -1
  247. package/lib/esm/config.d.ts +11 -1
  248. package/lib/esm/config.js +11 -1
  249. package/lib/esm/debug.d.ts +3 -1
  250. package/lib/esm/debug.js +40 -1
  251. package/lib/esm/error.d.ts +28 -1
  252. package/lib/esm/error.js +38 -1
  253. package/lib/esm/index.d.ts +7 -1
  254. package/lib/esm/index.js +6 -1
  255. package/lib/esm/interceptor.d.ts +21 -1
  256. package/lib/esm/interceptor.js +1 -1
  257. package/lib/esm/jsonapi.d.ts +5 -1
  258. package/lib/esm/jsonapi.js +75 -1
  259. package/lib/esm/model.d.ts +107 -1
  260. package/lib/esm/model.js +2 -1
  261. package/lib/esm/query.d.ts +23 -1
  262. package/lib/esm/query.js +45 -1
  263. package/lib/esm/resource.d.ts +77 -1
  264. package/lib/esm/resource.js +139 -1
  265. package/lib/esm/resources/addresses.d.ts +88 -1
  266. package/lib/esm/resources/addresses.js +35 -1
  267. package/lib/esm/resources/adjustments.d.ts +35 -1
  268. package/lib/esm/resources/adjustments.js +31 -1
  269. package/lib/esm/resources/adyen_gateways.d.ts +56 -1
  270. package/lib/esm/resources/adyen_gateways.js +39 -1
  271. package/lib/esm/resources/adyen_payments.d.ts +46 -1
  272. package/lib/esm/resources/adyen_payments.js +39 -1
  273. package/lib/esm/resources/application.d.ts +21 -1
  274. package/lib/esm/resources/application.js +19 -1
  275. package/lib/esm/resources/attachments.d.ts +156 -1
  276. package/lib/esm/resources/attachments.js +31 -1
  277. package/lib/esm/resources/authorizations.d.ts +60 -1
  278. package/lib/esm/resources/authorizations.js +41 -1
  279. package/lib/esm/resources/avalara_accounts.d.ts +55 -1
  280. package/lib/esm/resources/avalara_accounts.js +43 -1
  281. package/lib/esm/resources/billing_info_validation_rules.d.ts +35 -1
  282. package/lib/esm/resources/billing_info_validation_rules.js +39 -1
  283. package/lib/esm/resources/bing_geocoders.d.ts +35 -1
  284. package/lib/esm/resources/bing_geocoders.js +39 -1
  285. package/lib/esm/resources/braintree_gateways.d.ts +56 -1
  286. package/lib/esm/resources/braintree_gateways.js +39 -1
  287. package/lib/esm/resources/braintree_payments.d.ts +48 -1
  288. package/lib/esm/resources/braintree_payments.js +39 -1
  289. package/lib/esm/resources/bundles.d.ts +76 -1
  290. package/lib/esm/resources/bundles.js +47 -1
  291. package/lib/esm/resources/captures.d.ts +51 -1
  292. package/lib/esm/resources/captures.js +41 -1
  293. package/lib/esm/resources/carrier_accounts.d.ts +26 -1
  294. package/lib/esm/resources/carrier_accounts.js +30 -1
  295. package/lib/esm/resources/checkout_com_gateways.d.ts +45 -1
  296. package/lib/esm/resources/checkout_com_gateways.js +39 -1
  297. package/lib/esm/resources/checkout_com_payments.d.ts +59 -1
  298. package/lib/esm/resources/checkout_com_payments.js +39 -1
  299. package/lib/esm/resources/cleanups.d.ts +36 -1
  300. package/lib/esm/resources/cleanups.js +32 -1
  301. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +59 -1
  302. package/lib/esm/resources/coupon_codes_promotion_rules.js +35 -1
  303. package/lib/esm/resources/coupon_recipients.d.ts +44 -1
  304. package/lib/esm/resources/coupon_recipients.js +39 -1
  305. package/lib/esm/resources/coupons.d.ts +45 -1
  306. package/lib/esm/resources/coupons.js +35 -1
  307. package/lib/esm/resources/customer_addresses.d.ts +44 -1
  308. package/lib/esm/resources/customer_addresses.js +43 -1
  309. package/lib/esm/resources/customer_groups.d.ts +36 -1
  310. package/lib/esm/resources/customer_groups.js +43 -1
  311. package/lib/esm/resources/customer_password_resets.d.ts +36 -1
  312. package/lib/esm/resources/customer_password_resets.js +39 -1
  313. package/lib/esm/resources/customer_payment_sources.d.ts +70 -1
  314. package/lib/esm/resources/customer_payment_sources.js +35 -1
  315. package/lib/esm/resources/customer_subscriptions.d.ts +31 -1
  316. package/lib/esm/resources/customer_subscriptions.js +39 -1
  317. package/lib/esm/resources/customers.d.ts +66 -1
  318. package/lib/esm/resources/customers.js +71 -1
  319. package/lib/esm/resources/delivery_lead_times.d.ts +51 -1
  320. package/lib/esm/resources/delivery_lead_times.js +43 -1
  321. package/lib/esm/resources/event_callbacks.d.ts +24 -1
  322. package/lib/esm/resources/event_callbacks.js +26 -1
  323. package/lib/esm/resources/events.d.ts +24 -1
  324. package/lib/esm/resources/events.js +30 -1
  325. package/lib/esm/resources/exports.d.ts +40 -1
  326. package/lib/esm/resources/exports.js +32 -1
  327. package/lib/esm/resources/external_gateways.d.ts +49 -1
  328. package/lib/esm/resources/external_gateways.js +39 -1
  329. package/lib/esm/resources/external_payments.d.ts +44 -1
  330. package/lib/esm/resources/external_payments.js +43 -1
  331. package/lib/esm/resources/external_promotions.d.ts +90 -1
  332. package/lib/esm/resources/external_promotions.js +55 -1
  333. package/lib/esm/resources/external_tax_calculators.d.ts +37 -1
  334. package/lib/esm/resources/external_tax_calculators.js +39 -1
  335. package/lib/esm/resources/fixed_amount_promotions.d.ts +91 -1
  336. package/lib/esm/resources/fixed_amount_promotions.js +55 -1
  337. package/lib/esm/resources/fixed_price_promotions.d.ts +102 -1
  338. package/lib/esm/resources/fixed_price_promotions.js +63 -1
  339. package/lib/esm/resources/free_gift_promotions.d.ts +100 -1
  340. package/lib/esm/resources/free_gift_promotions.js +63 -1
  341. package/lib/esm/resources/free_shipping_promotions.d.ts +83 -1
  342. package/lib/esm/resources/free_shipping_promotions.js +51 -1
  343. package/lib/esm/resources/geocoders.d.ts +24 -1
  344. package/lib/esm/resources/geocoders.js +30 -1
  345. package/lib/esm/resources/gift_card_recipients.d.ts +44 -1
  346. package/lib/esm/resources/gift_card_recipients.js +39 -1
  347. package/lib/esm/resources/gift_cards.d.ts +85 -1
  348. package/lib/esm/resources/gift_cards.js +47 -1
  349. package/lib/esm/resources/google_geocoders.d.ts +35 -1
  350. package/lib/esm/resources/google_geocoders.js +39 -1
  351. package/lib/esm/resources/imports.d.ts +45 -1
  352. package/lib/esm/resources/imports.js +32 -1
  353. package/lib/esm/resources/in_stock_subscriptions.d.ts +62 -1
  354. package/lib/esm/resources/in_stock_subscriptions.js +47 -1
  355. package/lib/esm/resources/inventory_models.d.ts +42 -1
  356. package/lib/esm/resources/inventory_models.js +43 -1
  357. package/lib/esm/resources/inventory_return_locations.d.ts +43 -1
  358. package/lib/esm/resources/inventory_return_locations.js +39 -1
  359. package/lib/esm/resources/inventory_stock_locations.d.ts +46 -1
  360. package/lib/esm/resources/inventory_stock_locations.js +39 -1
  361. package/lib/esm/resources/klarna_gateways.d.ts +44 -1
  362. package/lib/esm/resources/klarna_gateways.js +39 -1
  363. package/lib/esm/resources/klarna_payments.d.ts +46 -1
  364. package/lib/esm/resources/klarna_payments.js +39 -1
  365. package/lib/esm/resources/line_item_options.d.ts +57 -1
  366. package/lib/esm/resources/line_item_options.js +39 -1
  367. package/lib/esm/resources/line_items.d.ts +126 -1
  368. package/lib/esm/resources/line_items.js +47 -1
  369. package/lib/esm/resources/manual_gateways.d.ts +33 -1
  370. package/lib/esm/resources/manual_gateways.js +35 -1
  371. package/lib/esm/resources/manual_tax_calculators.d.ts +41 -1
  372. package/lib/esm/resources/manual_tax_calculators.js +43 -1
  373. package/lib/esm/resources/markets.d.ts +88 -1
  374. package/lib/esm/resources/markets.js +55 -1
  375. package/lib/esm/resources/merchants.d.ts +38 -1
  376. package/lib/esm/resources/merchants.js +39 -1
  377. package/lib/esm/resources/order_amount_promotion_rules.d.ts +56 -1
  378. package/lib/esm/resources/order_amount_promotion_rules.js +31 -1
  379. package/lib/esm/resources/order_copies.d.ts +48 -1
  380. package/lib/esm/resources/order_copies.js +44 -1
  381. package/lib/esm/resources/order_subscriptions.d.ts +70 -1
  382. package/lib/esm/resources/order_subscriptions.js +55 -1
  383. package/lib/esm/resources/order_validation_rules.d.ts +23 -1
  384. package/lib/esm/resources/order_validation_rules.js +30 -1
  385. package/lib/esm/resources/orders.d.ts +288 -1
  386. package/lib/esm/resources/orders.js +111 -1
  387. package/lib/esm/resources/organization.d.ts +32 -1
  388. package/lib/esm/resources/organization.js +19 -1
  389. package/lib/esm/resources/packages.d.ts +56 -1
  390. package/lib/esm/resources/packages.js +43 -1
  391. package/lib/esm/resources/parcel_line_items.d.ts +51 -1
  392. package/lib/esm/resources/parcel_line_items.js +39 -1
  393. package/lib/esm/resources/parcels.d.ts +119 -1
  394. package/lib/esm/resources/parcels.js +51 -1
  395. package/lib/esm/resources/payment_gateways.d.ts +21 -1
  396. package/lib/esm/resources/payment_gateways.js +26 -1
  397. package/lib/esm/resources/payment_methods.d.ts +61 -1
  398. package/lib/esm/resources/payment_methods.js +43 -1
  399. package/lib/esm/resources/paypal_gateways.d.ts +37 -1
  400. package/lib/esm/resources/paypal_gateways.js +39 -1
  401. package/lib/esm/resources/paypal_payments.d.ts +52 -1
  402. package/lib/esm/resources/paypal_payments.js +39 -1
  403. package/lib/esm/resources/percentage_discount_promotions.d.ts +100 -1
  404. package/lib/esm/resources/percentage_discount_promotions.js +63 -1
  405. package/lib/esm/resources/price_lists.d.ts +39 -1
  406. package/lib/esm/resources/price_lists.js +39 -1
  407. package/lib/esm/resources/price_tiers.d.ts +28 -1
  408. package/lib/esm/resources/price_tiers.js +30 -1
  409. package/lib/esm/resources/price_volume_tiers.d.ts +46 -1
  410. package/lib/esm/resources/price_volume_tiers.js +39 -1
  411. package/lib/esm/resources/prices.d.ts +68 -1
  412. package/lib/esm/resources/prices.js +51 -1
  413. package/lib/esm/resources/promotion_rules.d.ts +24 -1
  414. package/lib/esm/resources/promotion_rules.js +22 -1
  415. package/lib/esm/resources/promotions.d.ts +41 -1
  416. package/lib/esm/resources/promotions.js +42 -1
  417. package/lib/esm/resources/refunds.d.ts +37 -1
  418. package/lib/esm/resources/refunds.js +34 -1
  419. package/lib/esm/resources/return_line_items.d.ts +49 -1
  420. package/lib/esm/resources/return_line_items.js +39 -1
  421. package/lib/esm/resources/returns.d.ts +75 -1
  422. package/lib/esm/resources/returns.js +63 -1
  423. package/lib/esm/resources/shipments.d.ts +93 -1
  424. package/lib/esm/resources/shipments.js +81 -1
  425. package/lib/esm/resources/shipping_categories.d.ts +33 -1
  426. package/lib/esm/resources/shipping_categories.js +39 -1
  427. package/lib/esm/resources/shipping_method_tiers.d.ts +28 -1
  428. package/lib/esm/resources/shipping_method_tiers.js +30 -1
  429. package/lib/esm/resources/shipping_methods.d.ts +107 -1
  430. package/lib/esm/resources/shipping_methods.js +63 -1
  431. package/lib/esm/resources/shipping_weight_tiers.d.ts +46 -1
  432. package/lib/esm/resources/shipping_weight_tiers.js +39 -1
  433. package/lib/esm/resources/shipping_zones.d.ts +48 -1
  434. package/lib/esm/resources/shipping_zones.js +35 -1
  435. package/lib/esm/resources/sku_list_items.d.ts +47 -1
  436. package/lib/esm/resources/sku_list_items.js +39 -1
  437. package/lib/esm/resources/sku_list_promotion_rules.d.ts +68 -1
  438. package/lib/esm/resources/sku_list_promotion_rules.js +39 -1
  439. package/lib/esm/resources/sku_lists.d.ts +60 -1
  440. package/lib/esm/resources/sku_lists.js +51 -1
  441. package/lib/esm/resources/sku_options.d.ts +56 -1
  442. package/lib/esm/resources/sku_options.js +39 -1
  443. package/lib/esm/resources/skus.d.ts +78 -1
  444. package/lib/esm/resources/skus.js +55 -1
  445. package/lib/esm/resources/stock_items.d.ts +49 -1
  446. package/lib/esm/resources/stock_items.js +43 -1
  447. package/lib/esm/resources/stock_line_items.d.ts +29 -1
  448. package/lib/esm/resources/stock_line_items.js +34 -1
  449. package/lib/esm/resources/stock_locations.d.ts +57 -1
  450. package/lib/esm/resources/stock_locations.js +55 -1
  451. package/lib/esm/resources/stock_transfers.d.ts +74 -1
  452. package/lib/esm/resources/stock_transfers.js +55 -1
  453. package/lib/esm/resources/stripe_gateways.d.ts +41 -1
  454. package/lib/esm/resources/stripe_gateways.js +39 -1
  455. package/lib/esm/resources/stripe_payments.d.ts +47 -1
  456. package/lib/esm/resources/stripe_payments.js +39 -1
  457. package/lib/esm/resources/tax_calculators.d.ts +24 -1
  458. package/lib/esm/resources/tax_calculators.js +30 -1
  459. package/lib/esm/resources/tax_categories.d.ts +59 -1
  460. package/lib/esm/resources/tax_categories.js +39 -1
  461. package/lib/esm/resources/tax_rules.d.ts +69 -1
  462. package/lib/esm/resources/tax_rules.js +35 -1
  463. package/lib/esm/resources/taxjar_accounts.d.ts +43 -1
  464. package/lib/esm/resources/taxjar_accounts.js +43 -1
  465. package/lib/esm/resources/transactions.d.ts +31 -1
  466. package/lib/esm/resources/transactions.js +26 -1
  467. package/lib/esm/resources/voids.d.ts +37 -1
  468. package/lib/esm/resources/voids.js +34 -1
  469. package/lib/esm/resources/webhooks.d.ts +43 -1
  470. package/lib/esm/resources/webhooks.js +35 -1
  471. package/lib/esm/resources/wire_transfers.d.ts +33 -1
  472. package/lib/esm/resources/wire_transfers.js +35 -1
  473. package/lib/esm/static.d.ts +9 -1
  474. package/lib/esm/static.js +19 -1
  475. package/lib/esm/util.d.ts +6 -1
  476. package/lib/esm/util.js +11 -1
  477. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  478. package/lib/tsconfig.tsbuildinfo +1 -1
  479. package/package.json +13 -15
package/lib/cjs/client.js CHANGED
@@ -1 +1,123 @@
1
- "use strict";var __classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(t,e,r,s,a){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(t,e,r,s){if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?s:r==="a"?s.call(t):s?s.value:e.get(t)},__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},_ApiClient_accessToken,_ApiClient_client;Object.defineProperty(exports,"__esModule",{value:!0});const axios_1=__importDefault(require("axios")),error_1=require("./error"),config_1=__importDefault(require("./config")),debug_1=__importDefault(require("./debug")),debug=(0,debug_1.default)("client"),baseURL=(t,e)=>`https://${t.toLowerCase()}.${e||config_1.default.default.domain}/api`,handleError=t=>{let e=new error_1.SdkError({message:t.message});if(axios_1.default.isAxiosError(t))if(t.response){const r=new error_1.ApiError(e);r.type=error_1.ErrorType.RESPONSE,r.status=t.response.status,r.code=String(r.status),r.errors=t.response.data.errors,e=r}else t.request?(e.type=error_1.ErrorType.REQUEST,e.request=t.request):e.type=error_1.ErrorType.CLIENT;else axios_1.default.isCancel(t)?e.type=error_1.ErrorType.CANCEL:e.source=t;throw e};class ApiClient{static create(e){if(!e?.organization)throw new Error("Undefined 'organization' parameter");if(!e?.accessToken)throw new Error("Undefined 'accessToken' 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 r={timeout:e.timeout||config_1.default.client.timeout,proxy:e.proxy,httpAgent:e.httpAgent,httpsAgent:e.httpsAgent},s=Object.assign({baseURL:this.baseUrl,timeout:config_1.default.client.timeout,headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json",Authorization:"Bearer "+__classPrivateFieldGet(this,_ApiClient_accessToken,"f")}},r);debug("axios options: %O",s),__classPrivateFieldSet(this,_ApiClient_client,axios_1.default.create(s),"f"),this.interceptors=__classPrivateFieldGet(this,_ApiClient_client,"f").interceptors}config(e){debug("config %o",e);const r=__classPrivateFieldGet(this,_ApiClient_client,"f").defaults;e.timeout&&(r.timeout=e.timeout),e.proxy&&(r.proxy=e.proxy),e.httpAgent&&(r.httpAgent=e.httpAgent),e.httpsAgent&&(r.httpsAgent=e.httpsAgent),e.organization&&(this.baseUrl=baseURL(e.organization,e.domain)),e.accessToken&&(__classPrivateFieldSet(this,_ApiClient_accessToken,e.accessToken,"f"),r.headers.common.Authorization="Bearer "+__classPrivateFieldGet(this,_ApiClient_accessToken,"f"))}async request(e,r,s,a){debug("request %s %s, %O, %O",e,r,s||{},a||{});const c=s?{data:s}:void 0,u=r,p=a?.organization?baseURL(a.organization,a.domain):void 0,i=a?.accessToken||__classPrivateFieldGet(this,_ApiClient_accessToken,"f"),d=i?{Authorization:"Bearer "+i}:void 0,n=Object.assign({method:e,baseURL:p,url:u,data:c,headers:d},a);return debug("request params: %O",n),__classPrivateFieldGet(this,_ApiClient_client,"f").request(n).then(o=>o.data).catch(o=>handleError(o))}}_ApiClient_accessToken=new WeakMap,_ApiClient_client=new WeakMap,exports.default=ApiClient;
1
+ "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
+ /* eslint-disable @typescript-eslint/no-explicit-any */
19
+ const axios_1 = __importDefault(require("axios"));
20
+ const error_1 = require("./error");
21
+ const config_1 = __importDefault(require("./config"));
22
+ const debug_1 = __importDefault(require("./debug"));
23
+ const debug = (0, debug_1.default)('client');
24
+ const baseURL = (organization, domain) => {
25
+ return `https://${organization.toLowerCase()}.${domain || config_1.default.default.domain}/api`;
26
+ };
27
+ const handleError = (error) => {
28
+ let sdkError = new error_1.SdkError({ message: error.message });
29
+ if (axios_1.default.isAxiosError(error)) {
30
+ if (error.response) {
31
+ // The request was made and the server responded with a status code that falls out of the range of 2xx
32
+ const apiError = new error_1.ApiError(sdkError);
33
+ apiError.type = error_1.ErrorType.RESPONSE;
34
+ apiError.status = error.response.status;
35
+ apiError.code = String(apiError.status);
36
+ apiError.errors = error.response.data.errors;
37
+ sdkError = apiError;
38
+ }
39
+ else if (error.request) {
40
+ // The request was made but no response was received
41
+ // `error.request` is an instance of XMLHttpRequest in the browser and an instance of http.ClientRequest in node.js
42
+ sdkError.type = error_1.ErrorType.REQUEST;
43
+ sdkError.request = error.request;
44
+ }
45
+ else {
46
+ // Something happened in setting up the request that triggered an Error
47
+ sdkError.type = error_1.ErrorType.CLIENT;
48
+ }
49
+ }
50
+ else if (axios_1.default.isCancel(error))
51
+ sdkError.type = error_1.ErrorType.CANCEL;
52
+ else
53
+ sdkError.source = error;
54
+ throw sdkError;
55
+ };
56
+ class ApiClient {
57
+ static create(options) {
58
+ if (!(options === null || options === void 0 ? void 0 : options.organization))
59
+ throw new Error("Undefined 'organization' parameter");
60
+ if (!(options === null || options === void 0 ? void 0 : options.accessToken))
61
+ throw new Error("Undefined 'accessToken' parameter");
62
+ return new ApiClient(options);
63
+ }
64
+ constructor(options) {
65
+ _ApiClient_accessToken.set(this, void 0);
66
+ _ApiClient_client.set(this, void 0);
67
+ debug('new client instance %O', options);
68
+ this.baseUrl = baseURL(options.organization, options.domain);
69
+ __classPrivateFieldSet(this, _ApiClient_accessToken, options.accessToken, "f");
70
+ const axiosConfig = {
71
+ timeout: options.timeout || config_1.default.client.timeout,
72
+ proxy: options.proxy,
73
+ httpAgent: options.httpAgent,
74
+ httpsAgent: options.httpsAgent,
75
+ };
76
+ const axiosOptions = Object.assign({ baseURL: this.baseUrl, timeout: config_1.default.client.timeout, headers: {
77
+ 'Accept': 'application/vnd.api+json',
78
+ 'Content-Type': 'application/vnd.api+json',
79
+ 'Authorization': 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f"),
80
+ } }, axiosConfig);
81
+ debug('axios options: %O', axiosOptions);
82
+ __classPrivateFieldSet(this, _ApiClient_client, axios_1.default.create(axiosOptions), "f");
83
+ this.interceptors = __classPrivateFieldGet(this, _ApiClient_client, "f").interceptors;
84
+ }
85
+ config(config) {
86
+ debug('config %o', config);
87
+ const def = __classPrivateFieldGet(this, _ApiClient_client, "f").defaults;
88
+ // Axios config
89
+ if (config.timeout)
90
+ def.timeout = config.timeout;
91
+ if (config.proxy)
92
+ def.proxy = config.proxy;
93
+ if (config.httpAgent)
94
+ def.httpAgent = config.httpAgent;
95
+ if (config.httpsAgent)
96
+ def.httpsAgent = config.httpsAgent;
97
+ // API Client config
98
+ if (config.organization)
99
+ this.baseUrl = baseURL(config.organization, config.domain);
100
+ if (config.accessToken) {
101
+ __classPrivateFieldSet(this, _ApiClient_accessToken, config.accessToken, "f");
102
+ def.headers.common.Authorization = 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f");
103
+ }
104
+ }
105
+ async request(method, path, body, options) {
106
+ debug('request %s %s, %O, %O', method, path, body || {}, options || {});
107
+ const data = body ? { data: body } : undefined;
108
+ const url = path;
109
+ // Runtime request parameters
110
+ const baseUrl = (options === null || options === void 0 ? void 0 : options.organization) ? baseURL(options.organization, options.domain) : undefined;
111
+ const accessToken = (options === null || options === void 0 ? void 0 : options.accessToken) || __classPrivateFieldGet(this, _ApiClient_accessToken, "f");
112
+ const headers = accessToken ? { 'Authorization': 'Bearer ' + accessToken } : undefined;
113
+ const requestParams = Object.assign({ method, baseURL: baseUrl, url, data, headers }, options);
114
+ debug('request params: %O', requestParams);
115
+ // const start = Date.now()
116
+ return __classPrivateFieldGet(this, _ApiClient_client, "f").request(requestParams)
117
+ .then(response => response.data)
118
+ .catch(error => handleError(error));
119
+ // .finally(() => console.log(`<<-- ${method} ${path} ${Date.now() - start}`))
120
+ }
121
+ }
122
+ _ApiClient_accessToken = new WeakMap(), _ApiClient_client = new WeakMap();
123
+ exports.default = ApiClient;
@@ -1 +1,135 @@
1
- import*as api from'./api';import{ApiError}from'./error';import type{ErrorInterceptor,InterceptorType,RawResponseReader,RequestInterceptor,ResponseInterceptor}from'./interceptor';import{ResourcesInitConfig}from'./resource';type SdkConfig={};type CommerceLayerInitConfig=SdkConfig&ResourcesInitConfig;type CommerceLayerConfig=Partial<CommerceLayerInitConfig>;declare class CommerceLayerClient{#private;static get openApiSchemaVersion():string;readonly openApiSchemaVersion="3.0.4";addresses:api.Addresses;adjustments:api.Adjustments;adyen_gateways:api.AdyenGateways;adyen_payments:api.AdyenPayments;application:api.Applications;attachments:api.Attachments;authorizations:api.Authorizations;avalara_accounts:api.AvalaraAccounts;billing_info_validation_rules:api.BillingInfoValidationRules;bing_geocoders:api.BingGeocoders;braintree_gateways:api.BraintreeGateways;braintree_payments:api.BraintreePayments;bundles:api.Bundles;captures:api.Captures;carrier_accounts:api.CarrierAccounts;checkout_com_gateways:api.CheckoutComGateways;checkout_com_payments:api.CheckoutComPayments;cleanups:api.Cleanups;coupon_codes_promotion_rules:api.CouponCodesPromotionRules;coupon_recipients:api.CouponRecipients;coupons:api.Coupons;customer_addresses:api.CustomerAddresses;customer_groups:api.CustomerGroups;customer_password_resets:api.CustomerPasswordResets;customer_payment_sources:api.CustomerPaymentSources;customer_subscriptions:api.CustomerSubscriptions;customers:api.Customers;delivery_lead_times:api.DeliveryLeadTimes;event_callbacks:api.EventCallbacks;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_subscriptions:api.OrderSubscriptions;order_validation_rules:api.OrderValidationRules;orders:api.Orders;organization:api.Organizations;packages:api.Packages;parcel_line_items:api.ParcelLineItems;parcels:api.Parcels;payment_gateways:api.PaymentGateways;payment_methods:api.PaymentMethods;paypal_gateways:api.PaypalGateways;paypal_payments:api.PaypalPayments;percentage_discount_promotions:api.PercentageDiscountPromotions;price_lists:api.PriceLists;price_tiers:api.PriceTiers;price_volume_tiers:api.PriceVolumeTiers;prices:api.Prices;promotion_rules:api.PromotionRules;promotions:api.Promotions;refunds:api.Refunds;return_line_items:api.ReturnLineItems;returns:api.Returns;shipments:api.Shipments;shipping_categories:api.ShippingCategories;shipping_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_transfers:api.StockTransfers;stripe_gateways:api.StripeGateways;stripe_payments:api.StripePayments;tax_calculators:api.TaxCalculators;tax_categories:api.TaxCategories;tax_rules:api.TaxRules;taxjar_accounts:api.TaxjarAccounts;transactions:api.Transactions;voids:api.Voids;webhooks:api.Webhooks;wire_transfers:api.WireTransfers;constructor(config:CommerceLayerInitConfig);get currentOrganization():string;private localConfig;config(config:CommerceLayerConfig):void;resources():readonly string[];isApiError(error:any):error is ApiError;addRequestInterceptor(onFulfilled?:RequestInterceptor,onRejected?:ErrorInterceptor):number;addResponseInterceptor(onFulfilled?:ResponseInterceptor,onRejected?:ErrorInterceptor):number;removeInterceptor(type:InterceptorType,id:number):void;addRawResponseReader(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
+ import * as api from './api';
2
+ import { ApiError } from './error';
3
+ import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
4
+ import { ResourcesInitConfig } from './resource';
5
+ declare const OPEN_API_SCHEMA_VERSION = "3.5.0";
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
+ static get openApiSchemaVersion(): string;
13
+ readonly openApiSchemaVersion = "3.5.0";
14
+ addresses: api.Addresses;
15
+ adjustments: api.Adjustments;
16
+ adyen_gateways: api.AdyenGateways;
17
+ adyen_payments: api.AdyenPayments;
18
+ application: api.Applications;
19
+ attachments: api.Attachments;
20
+ authorizations: api.Authorizations;
21
+ avalara_accounts: api.AvalaraAccounts;
22
+ billing_info_validation_rules: api.BillingInfoValidationRules;
23
+ bing_geocoders: api.BingGeocoders;
24
+ braintree_gateways: api.BraintreeGateways;
25
+ braintree_payments: api.BraintreePayments;
26
+ bundles: api.Bundles;
27
+ captures: api.Captures;
28
+ carrier_accounts: api.CarrierAccounts;
29
+ checkout_com_gateways: api.CheckoutComGateways;
30
+ checkout_com_payments: api.CheckoutComPayments;
31
+ cleanups: api.Cleanups;
32
+ coupon_codes_promotion_rules: api.CouponCodesPromotionRules;
33
+ coupon_recipients: api.CouponRecipients;
34
+ coupons: api.Coupons;
35
+ customer_addresses: api.CustomerAddresses;
36
+ customer_groups: api.CustomerGroups;
37
+ customer_password_resets: api.CustomerPasswordResets;
38
+ customer_payment_sources: api.CustomerPaymentSources;
39
+ customer_subscriptions: api.CustomerSubscriptions;
40
+ customers: api.Customers;
41
+ delivery_lead_times: api.DeliveryLeadTimes;
42
+ event_callbacks: api.EventCallbacks;
43
+ events: api.Events;
44
+ exports: api.Exports;
45
+ external_gateways: api.ExternalGateways;
46
+ external_payments: api.ExternalPayments;
47
+ external_promotions: api.ExternalPromotions;
48
+ external_tax_calculators: api.ExternalTaxCalculators;
49
+ fixed_amount_promotions: api.FixedAmountPromotions;
50
+ fixed_price_promotions: api.FixedPricePromotions;
51
+ free_gift_promotions: api.FreeGiftPromotions;
52
+ free_shipping_promotions: api.FreeShippingPromotions;
53
+ geocoders: api.Geocoders;
54
+ gift_card_recipients: api.GiftCardRecipients;
55
+ gift_cards: api.GiftCards;
56
+ google_geocoders: api.GoogleGeocoders;
57
+ imports: api.Imports;
58
+ in_stock_subscriptions: api.InStockSubscriptions;
59
+ inventory_models: api.InventoryModels;
60
+ inventory_return_locations: api.InventoryReturnLocations;
61
+ inventory_stock_locations: api.InventoryStockLocations;
62
+ klarna_gateways: api.KlarnaGateways;
63
+ klarna_payments: api.KlarnaPayments;
64
+ line_item_options: api.LineItemOptions;
65
+ line_items: api.LineItems;
66
+ manual_gateways: api.ManualGateways;
67
+ manual_tax_calculators: api.ManualTaxCalculators;
68
+ markets: api.Markets;
69
+ merchants: api.Merchants;
70
+ order_amount_promotion_rules: api.OrderAmountPromotionRules;
71
+ order_copies: api.OrderCopies;
72
+ order_subscriptions: api.OrderSubscriptions;
73
+ order_validation_rules: api.OrderValidationRules;
74
+ orders: api.Orders;
75
+ organization: api.Organizations;
76
+ packages: api.Packages;
77
+ parcel_line_items: api.ParcelLineItems;
78
+ parcels: api.Parcels;
79
+ payment_gateways: api.PaymentGateways;
80
+ payment_methods: api.PaymentMethods;
81
+ paypal_gateways: api.PaypalGateways;
82
+ paypal_payments: api.PaypalPayments;
83
+ percentage_discount_promotions: api.PercentageDiscountPromotions;
84
+ price_lists: api.PriceLists;
85
+ price_tiers: api.PriceTiers;
86
+ price_volume_tiers: api.PriceVolumeTiers;
87
+ prices: api.Prices;
88
+ promotion_rules: api.PromotionRules;
89
+ promotions: api.Promotions;
90
+ refunds: api.Refunds;
91
+ return_line_items: api.ReturnLineItems;
92
+ returns: api.Returns;
93
+ shipments: api.Shipments;
94
+ shipping_categories: api.ShippingCategories;
95
+ shipping_method_tiers: api.ShippingMethodTiers;
96
+ shipping_methods: api.ShippingMethods;
97
+ shipping_weight_tiers: api.ShippingWeightTiers;
98
+ shipping_zones: api.ShippingZones;
99
+ sku_list_items: api.SkuListItems;
100
+ sku_list_promotion_rules: api.SkuListPromotionRules;
101
+ sku_lists: api.SkuLists;
102
+ sku_options: api.SkuOptions;
103
+ skus: api.Skus;
104
+ stock_items: api.StockItems;
105
+ stock_line_items: api.StockLineItems;
106
+ stock_locations: api.StockLocations;
107
+ stock_transfers: api.StockTransfers;
108
+ stripe_gateways: api.StripeGateways;
109
+ stripe_payments: api.StripePayments;
110
+ tax_calculators: api.TaxCalculators;
111
+ tax_categories: api.TaxCategories;
112
+ tax_rules: api.TaxRules;
113
+ taxjar_accounts: api.TaxjarAccounts;
114
+ transactions: api.Transactions;
115
+ voids: api.Voids;
116
+ webhooks: api.Webhooks;
117
+ wire_transfers: api.WireTransfers;
118
+ constructor(config: CommerceLayerInitConfig);
119
+ get currentOrganization(): string;
120
+ private localConfig;
121
+ config(config: CommerceLayerConfig): void;
122
+ resources(): readonly string[];
123
+ isApiError(error: any): error is ApiError;
124
+ addRequestInterceptor(onFulfilled?: RequestInterceptor, onRejected?: ErrorInterceptor): number;
125
+ addResponseInterceptor(onFulfilled?: ResponseInterceptor, onRejected?: ErrorInterceptor): number;
126
+ removeInterceptor(type: InterceptorType, id: number): void;
127
+ addRawResponseReader(options?: {
128
+ headers: boolean;
129
+ }): RawResponseReader;
130
+ removeRawResponseReader(reader: number | RawResponseReader): void;
131
+ }
132
+ declare const CommerceLayer: (config: CommerceLayerInitConfig) => CommerceLayerClient;
133
+ export default CommerceLayer;
134
+ export { CommerceLayer };
135
+ export type { CommerceLayerClient, CommerceLayerConfig, CommerceLayerInitConfig };
@@ -1 +1,226 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(t,e,s,i){i===void 0&&(i=s);var n=Object.getOwnPropertyDescriptor(e,s);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[s]}}),Object.defineProperty(t,i,n)}:function(t,e,s,i){i===void 0&&(i=s),t[i]=e[s]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),__importStar=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var s in t)s!=="default"&&Object.prototype.hasOwnProperty.call(t,s)&&__createBinding(e,t,s);return __setModuleDefault(e,t),e},__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(t,e,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 e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,s):n?n.value=s:e.set(t,s),s},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(t,e,s,i){if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?i:s==="a"?i.call(t):i?i.value:e.get(t)},__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},_CommerceLayerClient_adapter,_CommerceLayerClient_organization;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommerceLayer=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="3.0.4";class CommerceLayerClient{static get openApiSchemaVersion(){return OPEN_API_SCHEMA_VERSION}constructor(e){this.openApiSchemaVersion=OPEN_API_SCHEMA_VERSION,_CommerceLayerClient_adapter.set(this,void 0),_CommerceLayerClient_organization.set(this,void 0),debug("new commercelayer instance %O",e),__classPrivateFieldSet(this,_CommerceLayerClient_adapter,new resource_1.default(e),"f"),__classPrivateFieldSet(this,_CommerceLayerClient_organization,e.organization,"f"),this.addresses=new api.Addresses(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.adjustments=new api.Adjustments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.adyen_gateways=new api.AdyenGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.adyen_payments=new api.AdyenPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.application=new api.Applications(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.attachments=new api.Attachments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.authorizations=new api.Authorizations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.avalara_accounts=new api.AvalaraAccounts(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.billing_info_validation_rules=new api.BillingInfoValidationRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.bing_geocoders=new api.BingGeocoders(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.braintree_gateways=new api.BraintreeGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.braintree_payments=new api.BraintreePayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.bundles=new api.Bundles(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.captures=new api.Captures(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.carrier_accounts=new api.CarrierAccounts(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.checkout_com_gateways=new api.CheckoutComGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.checkout_com_payments=new api.CheckoutComPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.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.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_subscriptions=new api.OrderSubscriptions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.order_validation_rules=new api.OrderValidationRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.orders=new api.Orders(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.organization=new api.Organizations(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.packages=new api.Packages(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.parcel_line_items=new api.ParcelLineItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.parcels=new api.Parcels(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.payment_gateways=new api.PaymentGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.payment_methods=new api.PaymentMethods(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.paypal_gateways=new api.PaypalGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.paypal_payments=new api.PaypalPayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.percentage_discount_promotions=new api.PercentageDiscountPromotions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.price_lists=new api.PriceLists(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.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.refunds=new api.Refunds(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.return_line_items=new api.ReturnLineItems(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.returns=new api.Returns(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.shipments=new api.Shipments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.shipping_categories=new api.ShippingCategories(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.shipping_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_transfers=new api.StockTransfers(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stripe_gateways=new api.StripeGateways(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.stripe_payments=new api.StripePayments(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.tax_calculators=new api.TaxCalculators(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.tax_categories=new api.TaxCategories(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.tax_rules=new api.TaxRules(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.taxjar_accounts=new api.TaxjarAccounts(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.transactions=new api.Transactions(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.voids=new api.Voids(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.webhooks=new api.Webhooks(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f")),this.wire_transfers=new api.WireTransfers(__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f"))}get currentOrganization(){return __classPrivateFieldGet(this,_CommerceLayerClient_organization,"f")}localConfig(e){e.organization&&__classPrivateFieldSet(this,_CommerceLayerClient_organization,e.organization,"f")}config(e){debug("config %o",e),this.localConfig(e),e.organization||(e.organization=this.currentOrganization),__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").config(e)}resources(){return static_1.CommerceLayerStatic.resources()}isApiError(e){return static_1.CommerceLayerStatic.isApiError(e)}addRequestInterceptor(e,s){return __classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").interceptors.request.use(e,s)}addResponseInterceptor(e,s){return __classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").interceptors.response.use(e,s)}removeInterceptor(e,s){return __classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").interceptors[e].eject(s)}addRawResponseReader(e){const s={id:void 0,rawResponse:void 0,headers:void 0};function i(r){return s.rawResponse=r?.data,e?.headers&&(s.headers=r.headers),r}const n=this.addResponseInterceptor(i);return s.id=n,s}removeRawResponseReader(e){const s=typeof e=="number"?e:e?.id;if(s&&s>=0)return this.removeInterceptor("response",s)}}_CommerceLayerClient_adapter=new WeakMap,_CommerceLayerClient_organization=new WeakMap;const CommerceLayer=t=>new CommerceLayerClient(t);exports.CommerceLayer=CommerceLayer,exports.default=CommerceLayer;
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 = '3.5.0';
49
+ exports.OPEN_API_SCHEMA_VERSION = OPEN_API_SCHEMA_VERSION;
50
+ class CommerceLayerClient {
51
+ static get openApiSchemaVersion() { return OPEN_API_SCHEMA_VERSION; }
52
+ // ##__CL_RESOURCES_DEF_STOP__##
53
+ constructor(config) {
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
+ // ##__CL_RESOURCES_INIT_START__##
61
+ // ##__CL_RESOURCES_INIT_TEMPLATE:: ##__TAB__####__TAB__##this.##__RESOURCE_TYPE__## = new api.##__RESOURCE_CLASS__##(this.#adapter)
62
+ this.addresses = new api.Addresses(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
63
+ this.adjustments = new api.Adjustments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
64
+ this.adyen_gateways = new api.AdyenGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
65
+ this.adyen_payments = new api.AdyenPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
66
+ this.application = new api.Applications(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
67
+ this.attachments = new api.Attachments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
68
+ this.authorizations = new api.Authorizations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
69
+ this.avalara_accounts = new api.AvalaraAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
70
+ this.billing_info_validation_rules = new api.BillingInfoValidationRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
71
+ this.bing_geocoders = new api.BingGeocoders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
72
+ this.braintree_gateways = new api.BraintreeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
73
+ this.braintree_payments = new api.BraintreePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
74
+ this.bundles = new api.Bundles(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
75
+ this.captures = new api.Captures(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
76
+ this.carrier_accounts = new api.CarrierAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
77
+ this.checkout_com_gateways = new api.CheckoutComGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
78
+ this.checkout_com_payments = new api.CheckoutComPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
79
+ this.cleanups = new api.Cleanups(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
80
+ this.coupon_codes_promotion_rules = new api.CouponCodesPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
81
+ this.coupon_recipients = new api.CouponRecipients(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
82
+ this.coupons = new api.Coupons(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
83
+ this.customer_addresses = new api.CustomerAddresses(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
84
+ this.customer_groups = new api.CustomerGroups(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
85
+ this.customer_password_resets = new api.CustomerPasswordResets(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
86
+ this.customer_payment_sources = new api.CustomerPaymentSources(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
87
+ this.customer_subscriptions = new api.CustomerSubscriptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
88
+ this.customers = new api.Customers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
89
+ this.delivery_lead_times = new api.DeliveryLeadTimes(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
90
+ this.event_callbacks = new api.EventCallbacks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
91
+ this.events = new api.Events(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
92
+ this.exports = new api.Exports(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
93
+ this.external_gateways = new api.ExternalGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
94
+ this.external_payments = new api.ExternalPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
95
+ this.external_promotions = new api.ExternalPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
96
+ this.external_tax_calculators = new api.ExternalTaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
97
+ this.fixed_amount_promotions = new api.FixedAmountPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
98
+ this.fixed_price_promotions = new api.FixedPricePromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
99
+ this.free_gift_promotions = new api.FreeGiftPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
100
+ this.free_shipping_promotions = new api.FreeShippingPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
101
+ this.geocoders = new api.Geocoders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
102
+ this.gift_card_recipients = new api.GiftCardRecipients(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
103
+ this.gift_cards = new api.GiftCards(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
104
+ this.google_geocoders = new api.GoogleGeocoders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
105
+ this.imports = new api.Imports(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
106
+ this.in_stock_subscriptions = new api.InStockSubscriptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
107
+ this.inventory_models = new api.InventoryModels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
108
+ this.inventory_return_locations = new api.InventoryReturnLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
109
+ this.inventory_stock_locations = new api.InventoryStockLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
110
+ this.klarna_gateways = new api.KlarnaGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
111
+ this.klarna_payments = new api.KlarnaPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
112
+ this.line_item_options = new api.LineItemOptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
113
+ this.line_items = new api.LineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
114
+ this.manual_gateways = new api.ManualGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
115
+ this.manual_tax_calculators = new api.ManualTaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
116
+ this.markets = new api.Markets(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
117
+ this.merchants = new api.Merchants(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
118
+ this.order_amount_promotion_rules = new api.OrderAmountPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
119
+ this.order_copies = new api.OrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
120
+ this.order_subscriptions = new api.OrderSubscriptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
121
+ this.order_validation_rules = new api.OrderValidationRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
122
+ this.orders = new api.Orders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
123
+ this.organization = new api.Organizations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
124
+ this.packages = new api.Packages(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
125
+ this.parcel_line_items = new api.ParcelLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
126
+ this.parcels = new api.Parcels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
127
+ this.payment_gateways = new api.PaymentGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
128
+ this.payment_methods = new api.PaymentMethods(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
129
+ this.paypal_gateways = new api.PaypalGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
130
+ this.paypal_payments = new api.PaypalPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
131
+ this.percentage_discount_promotions = new api.PercentageDiscountPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
132
+ this.price_lists = new api.PriceLists(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
133
+ this.price_tiers = new api.PriceTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
134
+ this.price_volume_tiers = new api.PriceVolumeTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
135
+ this.prices = new api.Prices(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
136
+ this.promotion_rules = new api.PromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
137
+ this.promotions = new api.Promotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
138
+ this.refunds = new api.Refunds(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
139
+ this.return_line_items = new api.ReturnLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
140
+ this.returns = new api.Returns(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
141
+ this.shipments = new api.Shipments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
142
+ this.shipping_categories = new api.ShippingCategories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
143
+ this.shipping_method_tiers = new api.ShippingMethodTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
144
+ this.shipping_methods = new api.ShippingMethods(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
145
+ this.shipping_weight_tiers = new api.ShippingWeightTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
146
+ this.shipping_zones = new api.ShippingZones(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
147
+ this.sku_list_items = new api.SkuListItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
148
+ this.sku_list_promotion_rules = new api.SkuListPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
149
+ this.sku_lists = new api.SkuLists(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
150
+ this.sku_options = new api.SkuOptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
151
+ this.skus = new api.Skus(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
152
+ this.stock_items = new api.StockItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
153
+ this.stock_line_items = new api.StockLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
154
+ this.stock_locations = new api.StockLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
155
+ this.stock_transfers = new api.StockTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
156
+ this.stripe_gateways = new api.StripeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
157
+ this.stripe_payments = new api.StripePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
158
+ this.tax_calculators = new api.TaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
159
+ this.tax_categories = new api.TaxCategories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
160
+ this.tax_rules = new api.TaxRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
161
+ this.taxjar_accounts = new api.TaxjarAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
162
+ this.transactions = new api.Transactions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
163
+ this.voids = new api.Voids(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
164
+ this.webhooks = new api.Webhooks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
165
+ this.wire_transfers = new api.WireTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
166
+ // ##__CL_RESOURCES_INIT_STOP__##
167
+ }
168
+ get currentOrganization() { return __classPrivateFieldGet(this, _CommerceLayerClient_organization, "f"); }
169
+ localConfig(config) {
170
+ if (config.organization)
171
+ __classPrivateFieldSet(this, _CommerceLayerClient_organization, config.organization, "f");
172
+ }
173
+ config(config) {
174
+ debug('config %o', config);
175
+ // CommerceLayer config
176
+ this.localConfig(config);
177
+ // ResourceAdapter config
178
+ // To rebuild baseUrl in client in case only the domain is defined
179
+ if (!config.organization)
180
+ config.organization = this.currentOrganization;
181
+ __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").config(config);
182
+ }
183
+ resources() {
184
+ return static_1.CommerceLayerStatic.resources();
185
+ }
186
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
187
+ isApiError(error) {
188
+ return static_1.CommerceLayerStatic.isApiError(error);
189
+ }
190
+ addRequestInterceptor(onFulfilled, onRejected) {
191
+ return __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").interceptors.request.use(onFulfilled, onRejected);
192
+ }
193
+ addResponseInterceptor(onFulfilled, onRejected) {
194
+ return __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").interceptors.response.use(onFulfilled, onRejected);
195
+ }
196
+ removeInterceptor(type, id) {
197
+ return __classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f").interceptors[type].eject(id);
198
+ }
199
+ addRawResponseReader(options) {
200
+ const reader = {
201
+ id: undefined,
202
+ rawResponse: undefined,
203
+ headers: undefined,
204
+ };
205
+ function rawResponseInterceptor(response) {
206
+ reader.rawResponse = response === null || response === void 0 ? void 0 : response.data;
207
+ if (options === null || options === void 0 ? void 0 : options.headers)
208
+ reader.headers = response.headers;
209
+ return response;
210
+ }
211
+ const interceptor = this.addResponseInterceptor(rawResponseInterceptor);
212
+ reader.id = interceptor;
213
+ return reader;
214
+ }
215
+ removeRawResponseReader(reader) {
216
+ const id = (typeof reader === 'number') ? reader : reader === null || reader === void 0 ? void 0 : reader.id;
217
+ if (id && (id >= 0))
218
+ return this.removeInterceptor('response', id);
219
+ }
220
+ }
221
+ _CommerceLayerClient_adapter = new WeakMap(), _CommerceLayerClient_organization = new WeakMap();
222
+ const CommerceLayer = (config) => {
223
+ return new CommerceLayerClient(config);
224
+ };
225
+ exports.CommerceLayer = CommerceLayer;
226
+ exports.default = CommerceLayer;
@@ -1 +1,4 @@
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};
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 };
package/lib/cjs/common.js CHANGED
@@ -1 +1,14 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isResourceType=exports.isResourceId=void 0;const api_1=require("./api"),isResourceId=e=>e?.type&&e.id&&api_1.resourceList.includes(e.type);exports.isResourceId=isResourceId;const isResourceType=e=>e&&typeof e.type<"u"&&e.type&&api_1.resourceList.includes(e.type);exports.isResourceType=isResourceType;
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.isResourceType = exports.isResourceId = void 0;
6
+ const api_1 = require("./api");
7
+ const isResourceId = (resource) => {
8
+ return ((resource === null || resource === void 0 ? void 0 : resource.type) && resource.id) && api_1.resourceList.includes(resource.type);
9
+ };
10
+ exports.isResourceId = isResourceId;
11
+ const isResourceType = (resource) => {
12
+ return resource && (typeof resource.type !== 'undefined') && resource.type && api_1.resourceList.includes(resource.type);
13
+ };
14
+ exports.isResourceType = isResourceType;
@@ -1 +1,11 @@
1
- declare const config:{readonly default:{readonly domain:"commercelayer.io";readonly pageNumber:1;readonly pageSize:10;};readonly client:{readonly timeout:15000;};};export default config;
1
+ declare const config: {
2
+ readonly default: {
3
+ readonly domain: "commercelayer.io";
4
+ readonly pageNumber: 1;
5
+ readonly pageSize: 10;
6
+ };
7
+ readonly client: {
8
+ readonly timeout: 15000;
9
+ };
10
+ };
11
+ export default config;
package/lib/cjs/config.js CHANGED
@@ -1 +1,13 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const config={default:{domain:"commercelayer.io",pageNumber:1,pageSize:10},client:{timeout:15e3}};exports.default=config;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config = {
4
+ default: {
5
+ domain: 'commercelayer.io',
6
+ pageNumber: 1,
7
+ pageSize: 10,
8
+ },
9
+ client: {
10
+ timeout: 15000,
11
+ }
12
+ };
13
+ exports.default = config;
@@ -1 +1,3 @@
1
- type Debugger=(pattern:string,...args:any[])=>void;declare const debug:(namespace:string)=>Debugger;export default debug;
1
+ type Debugger = (pattern: string, ...args: any[]) => void;
2
+ declare const debug: (namespace: string) => Debugger;
3
+ export default debug;