@commercelayer/sdk 3.6.0 → 3.8.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 (258) hide show
  1. package/lib/cjs/api.d.ts +1 -1
  2. package/lib/cjs/client.js +1 -1
  3. package/lib/cjs/commercelayer.js +1 -1
  4. package/lib/cjs/config.d.ts +1 -1
  5. package/lib/cjs/config.js +1 -1
  6. package/lib/cjs/error.d.ts +26 -1
  7. package/lib/cjs/error.js +1 -1
  8. package/lib/cjs/interceptor.d.ts +19 -1
  9. package/lib/cjs/model.d.ts +1 -1
  10. package/lib/cjs/resource.js +1 -1
  11. package/lib/cjs/resources/avalara_accounts.d.ts +3 -0
  12. package/lib/cjs/resources/bundles.d.ts +6 -0
  13. package/lib/cjs/resources/klarna_payments.d.ts +4 -0
  14. package/lib/cjs/resources/orders.d.ts +7 -0
  15. package/lib/cjs/util.d.ts +6 -1
  16. package/lib/esm/api.d.ts +1 -1
  17. package/lib/esm/client.js +1 -1
  18. package/lib/esm/commercelayer.js +1 -1
  19. package/lib/esm/config.d.ts +1 -1
  20. package/lib/esm/config.js +1 -1
  21. package/lib/esm/debug.js +1 -1
  22. package/lib/esm/error.d.ts +26 -1
  23. package/lib/esm/error.js +1 -1
  24. package/lib/esm/interceptor.d.ts +19 -1
  25. package/lib/esm/model.d.ts +1 -1
  26. package/lib/esm/resource.js +1 -1
  27. package/lib/esm/resources/avalara_accounts.d.ts +3 -0
  28. package/lib/esm/resources/bundles.d.ts +6 -0
  29. package/lib/esm/resources/klarna_payments.d.ts +4 -0
  30. package/lib/esm/resources/orders.d.ts +7 -0
  31. package/lib/esm/util.d.ts +6 -1
  32. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  33. package/lib/tsconfig.tsbuildinfo +1 -1
  34. package/package.json +1 -1
  35. package/lib/api.d.ts +0 -1
  36. package/lib/api.js +0 -1
  37. package/lib/client.d.ts +0 -2
  38. package/lib/client.js +0 -1
  39. package/lib/commercelayer.d.ts +0 -1
  40. package/lib/commercelayer.js +0 -1
  41. package/lib/common.d.ts +0 -1
  42. package/lib/common.js +0 -1
  43. package/lib/config.d.ts +0 -1
  44. package/lib/config.js +0 -1
  45. package/lib/debug.d.ts +0 -1
  46. package/lib/debug.js +0 -1
  47. package/lib/error.d.ts +0 -1
  48. package/lib/error.js +0 -1
  49. package/lib/index.d.ts +0 -1
  50. package/lib/index.js +0 -1
  51. package/lib/interceptor.d.ts +0 -1
  52. package/lib/interceptor.js +0 -1
  53. package/lib/jsonapi.d.ts +0 -1
  54. package/lib/jsonapi.js +0 -1
  55. package/lib/model.d.ts +0 -1
  56. package/lib/model.js +0 -1
  57. package/lib/query.d.ts +0 -1
  58. package/lib/query.js +0 -1
  59. package/lib/resource.d.ts +0 -1
  60. package/lib/resource.js +0 -1
  61. package/lib/resources/addresses.d.ts +0 -1
  62. package/lib/resources/addresses.js +0 -1
  63. package/lib/resources/adjustments.d.ts +0 -1
  64. package/lib/resources/adjustments.js +0 -1
  65. package/lib/resources/adyen_gateways.d.ts +0 -1
  66. package/lib/resources/adyen_gateways.js +0 -1
  67. package/lib/resources/adyen_payments.d.ts +0 -1
  68. package/lib/resources/adyen_payments.js +0 -1
  69. package/lib/resources/application.d.ts +0 -1
  70. package/lib/resources/application.js +0 -1
  71. package/lib/resources/attachments.d.ts +0 -1
  72. package/lib/resources/attachments.js +0 -1
  73. package/lib/resources/authorizations.d.ts +0 -1
  74. package/lib/resources/authorizations.js +0 -1
  75. package/lib/resources/avalara_accounts.d.ts +0 -1
  76. package/lib/resources/avalara_accounts.js +0 -1
  77. package/lib/resources/billing_info_validation_rules.d.ts +0 -1
  78. package/lib/resources/billing_info_validation_rules.js +0 -1
  79. package/lib/resources/bing_geocoders.d.ts +0 -1
  80. package/lib/resources/bing_geocoders.js +0 -1
  81. package/lib/resources/braintree_gateways.d.ts +0 -1
  82. package/lib/resources/braintree_gateways.js +0 -1
  83. package/lib/resources/braintree_payments.d.ts +0 -1
  84. package/lib/resources/braintree_payments.js +0 -1
  85. package/lib/resources/bundles.d.ts +0 -1
  86. package/lib/resources/bundles.js +0 -1
  87. package/lib/resources/captures.d.ts +0 -1
  88. package/lib/resources/captures.js +0 -1
  89. package/lib/resources/carrier_accounts.d.ts +0 -1
  90. package/lib/resources/carrier_accounts.js +0 -1
  91. package/lib/resources/checkout_com_gateways.d.ts +0 -1
  92. package/lib/resources/checkout_com_gateways.js +0 -1
  93. package/lib/resources/checkout_com_payments.d.ts +0 -1
  94. package/lib/resources/checkout_com_payments.js +0 -1
  95. package/lib/resources/coupon_codes_promotion_rules.d.ts +0 -1
  96. package/lib/resources/coupon_codes_promotion_rules.js +0 -1
  97. package/lib/resources/coupon_recipients.d.ts +0 -1
  98. package/lib/resources/coupon_recipients.js +0 -1
  99. package/lib/resources/coupons.d.ts +0 -1
  100. package/lib/resources/coupons.js +0 -1
  101. package/lib/resources/customer_addresses.d.ts +0 -1
  102. package/lib/resources/customer_addresses.js +0 -1
  103. package/lib/resources/customer_groups.d.ts +0 -1
  104. package/lib/resources/customer_groups.js +0 -1
  105. package/lib/resources/customer_password_resets.d.ts +0 -1
  106. package/lib/resources/customer_password_resets.js +0 -1
  107. package/lib/resources/customer_payment_sources.d.ts +0 -1
  108. package/lib/resources/customer_payment_sources.js +0 -1
  109. package/lib/resources/customer_subscriptions.d.ts +0 -1
  110. package/lib/resources/customer_subscriptions.js +0 -1
  111. package/lib/resources/customers.d.ts +0 -1
  112. package/lib/resources/customers.js +0 -1
  113. package/lib/resources/delivery_lead_times.d.ts +0 -1
  114. package/lib/resources/delivery_lead_times.js +0 -1
  115. package/lib/resources/event_callbacks.d.ts +0 -1
  116. package/lib/resources/event_callbacks.js +0 -1
  117. package/lib/resources/external_gateways.d.ts +0 -1
  118. package/lib/resources/external_gateways.js +0 -1
  119. package/lib/resources/external_payments.d.ts +0 -1
  120. package/lib/resources/external_payments.js +0 -1
  121. package/lib/resources/external_promotions.d.ts +0 -1
  122. package/lib/resources/external_promotions.js +0 -1
  123. package/lib/resources/external_tax_calculators.d.ts +0 -1
  124. package/lib/resources/external_tax_calculators.js +0 -1
  125. package/lib/resources/fixed_amount_promotions.d.ts +0 -1
  126. package/lib/resources/fixed_amount_promotions.js +0 -1
  127. package/lib/resources/fixed_price_promotions.d.ts +0 -1
  128. package/lib/resources/fixed_price_promotions.js +0 -1
  129. package/lib/resources/free_gift_promotions.d.ts +0 -1
  130. package/lib/resources/free_gift_promotions.js +0 -1
  131. package/lib/resources/free_shipping_promotions.d.ts +0 -1
  132. package/lib/resources/free_shipping_promotions.js +0 -1
  133. package/lib/resources/geocoders.d.ts +0 -1
  134. package/lib/resources/geocoders.js +0 -1
  135. package/lib/resources/gift_card_recipients.d.ts +0 -1
  136. package/lib/resources/gift_card_recipients.js +0 -1
  137. package/lib/resources/gift_cards.d.ts +0 -1
  138. package/lib/resources/gift_cards.js +0 -1
  139. package/lib/resources/google_geocoders.d.ts +0 -1
  140. package/lib/resources/google_geocoders.js +0 -1
  141. package/lib/resources/imports.d.ts +0 -1
  142. package/lib/resources/imports.js +0 -1
  143. package/lib/resources/in_stock_subscriptions.d.ts +0 -1
  144. package/lib/resources/in_stock_subscriptions.js +0 -1
  145. package/lib/resources/inventory_models.d.ts +0 -1
  146. package/lib/resources/inventory_models.js +0 -1
  147. package/lib/resources/inventory_return_locations.d.ts +0 -1
  148. package/lib/resources/inventory_return_locations.js +0 -1
  149. package/lib/resources/inventory_stock_locations.d.ts +0 -1
  150. package/lib/resources/inventory_stock_locations.js +0 -1
  151. package/lib/resources/klarna_gateways.d.ts +0 -1
  152. package/lib/resources/klarna_gateways.js +0 -1
  153. package/lib/resources/klarna_payments.d.ts +0 -1
  154. package/lib/resources/klarna_payments.js +0 -1
  155. package/lib/resources/line_item_options.d.ts +0 -1
  156. package/lib/resources/line_item_options.js +0 -1
  157. package/lib/resources/line_items.d.ts +0 -1
  158. package/lib/resources/line_items.js +0 -1
  159. package/lib/resources/manual_gateways.d.ts +0 -1
  160. package/lib/resources/manual_gateways.js +0 -1
  161. package/lib/resources/manual_tax_calculators.d.ts +0 -1
  162. package/lib/resources/manual_tax_calculators.js +0 -1
  163. package/lib/resources/markets.d.ts +0 -1
  164. package/lib/resources/markets.js +0 -1
  165. package/lib/resources/merchants.d.ts +0 -1
  166. package/lib/resources/merchants.js +0 -1
  167. package/lib/resources/order_amount_promotion_rules.d.ts +0 -1
  168. package/lib/resources/order_amount_promotion_rules.js +0 -1
  169. package/lib/resources/order_copies.d.ts +0 -1
  170. package/lib/resources/order_copies.js +0 -1
  171. package/lib/resources/order_subscriptions.d.ts +0 -1
  172. package/lib/resources/order_subscriptions.js +0 -1
  173. package/lib/resources/order_validation_rules.d.ts +0 -1
  174. package/lib/resources/order_validation_rules.js +0 -1
  175. package/lib/resources/orders.d.ts +0 -1
  176. package/lib/resources/orders.js +0 -1
  177. package/lib/resources/organization.d.ts +0 -1
  178. package/lib/resources/organization.js +0 -1
  179. package/lib/resources/packages.d.ts +0 -1
  180. package/lib/resources/packages.js +0 -1
  181. package/lib/resources/parcel_line_items.d.ts +0 -1
  182. package/lib/resources/parcel_line_items.js +0 -1
  183. package/lib/resources/parcels.d.ts +0 -1
  184. package/lib/resources/parcels.js +0 -1
  185. package/lib/resources/payment_gateways.d.ts +0 -1
  186. package/lib/resources/payment_gateways.js +0 -1
  187. package/lib/resources/payment_methods.d.ts +0 -1
  188. package/lib/resources/payment_methods.js +0 -1
  189. package/lib/resources/paypal_gateways.d.ts +0 -1
  190. package/lib/resources/paypal_gateways.js +0 -1
  191. package/lib/resources/paypal_payments.d.ts +0 -1
  192. package/lib/resources/paypal_payments.js +0 -1
  193. package/lib/resources/percentage_discount_promotions.d.ts +0 -1
  194. package/lib/resources/percentage_discount_promotions.js +0 -1
  195. package/lib/resources/price_lists.d.ts +0 -1
  196. package/lib/resources/price_lists.js +0 -1
  197. package/lib/resources/prices.d.ts +0 -1
  198. package/lib/resources/prices.js +0 -1
  199. package/lib/resources/promotion_rules.d.ts +0 -1
  200. package/lib/resources/promotion_rules.js +0 -1
  201. package/lib/resources/promotions.d.ts +0 -1
  202. package/lib/resources/promotions.js +0 -1
  203. package/lib/resources/refunds.d.ts +0 -1
  204. package/lib/resources/refunds.js +0 -1
  205. package/lib/resources/return_line_items.d.ts +0 -1
  206. package/lib/resources/return_line_items.js +0 -1
  207. package/lib/resources/returns.d.ts +0 -1
  208. package/lib/resources/returns.js +0 -1
  209. package/lib/resources/shipments.d.ts +0 -1
  210. package/lib/resources/shipments.js +0 -1
  211. package/lib/resources/shipping_categories.d.ts +0 -1
  212. package/lib/resources/shipping_categories.js +0 -1
  213. package/lib/resources/shipping_methods.d.ts +0 -1
  214. package/lib/resources/shipping_methods.js +0 -1
  215. package/lib/resources/shipping_zones.d.ts +0 -1
  216. package/lib/resources/shipping_zones.js +0 -1
  217. package/lib/resources/sku_list_items.d.ts +0 -1
  218. package/lib/resources/sku_list_items.js +0 -1
  219. package/lib/resources/sku_list_promotion_rules.d.ts +0 -1
  220. package/lib/resources/sku_list_promotion_rules.js +0 -1
  221. package/lib/resources/sku_lists.d.ts +0 -1
  222. package/lib/resources/sku_lists.js +0 -1
  223. package/lib/resources/sku_options.d.ts +0 -1
  224. package/lib/resources/sku_options.js +0 -1
  225. package/lib/resources/skus.d.ts +0 -1
  226. package/lib/resources/skus.js +0 -1
  227. package/lib/resources/stock_items.d.ts +0 -1
  228. package/lib/resources/stock_items.js +0 -1
  229. package/lib/resources/stock_line_items.d.ts +0 -1
  230. package/lib/resources/stock_line_items.js +0 -1
  231. package/lib/resources/stock_locations.d.ts +0 -1
  232. package/lib/resources/stock_locations.js +0 -1
  233. package/lib/resources/stock_transfers.d.ts +0 -1
  234. package/lib/resources/stock_transfers.js +0 -1
  235. package/lib/resources/stripe_gateways.d.ts +0 -1
  236. package/lib/resources/stripe_gateways.js +0 -1
  237. package/lib/resources/stripe_payments.d.ts +0 -1
  238. package/lib/resources/stripe_payments.js +0 -1
  239. package/lib/resources/tax_calculators.d.ts +0 -1
  240. package/lib/resources/tax_calculators.js +0 -1
  241. package/lib/resources/tax_categories.d.ts +0 -1
  242. package/lib/resources/tax_categories.js +0 -1
  243. package/lib/resources/tax_rules.d.ts +0 -1
  244. package/lib/resources/tax_rules.js +0 -1
  245. package/lib/resources/taxjar_accounts.d.ts +0 -1
  246. package/lib/resources/taxjar_accounts.js +0 -1
  247. package/lib/resources/transactions.d.ts +0 -1
  248. package/lib/resources/transactions.js +0 -1
  249. package/lib/resources/voids.d.ts +0 -1
  250. package/lib/resources/voids.js +0 -1
  251. package/lib/resources/webhooks.d.ts +0 -1
  252. package/lib/resources/webhooks.js +0 -1
  253. package/lib/resources/wire_transfers.d.ts +0 -1
  254. package/lib/resources/wire_transfers.js +0 -1
  255. package/lib/static.d.ts +0 -1
  256. package/lib/static.js +0 -1
  257. package/lib/util.d.ts +0 -2
  258. package/lib/util.js +0 -1
package/lib/cjs/api.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * ©2022 Commerce Layer Inc.
3
- * OpenAPI schema, version 2.9.1
3
+ * OpenAPI schema, version 2.9.4
4
4
  **/
5
5
  export { default as Addresses } from './resources/addresses';
6
6
  export { default as Adjustments } from './resources/adjustments';
package/lib/cjs/client.js CHANGED
@@ -1 +1 @@
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")),baseURL=(t,e)=>`https://${t.toLowerCase()}.${e||config_1.default.default.domain}/api`,handleError=t=>{let e=new error_1.SdkError({message:t.message,type:error_1.ErrorType.GENERIC});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{constructor(e){_ApiClient_accessToken.set(this,void 0),_ApiClient_client.set(this,void 0),this.baseUrl=baseURL(e.organization,e.domain),__classPrivateFieldSet(this,_ApiClient_accessToken,e.accessToken,"f");const r={timeout:e.timeout||config_1.default.client.timeout};__classPrivateFieldSet(this,_ApiClient_client,axios_1.default.create(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)),"f"),this.interceptors=__classPrivateFieldGet(this,_ApiClient_client,"f").interceptors}static create(e){if(!(e==null?void 0:e.organization))throw new Error("Undefined 'organization' parameter");if(!(e==null?void 0:e.accessToken))throw new Error("Undefined 'accessToken' parameter");return new ApiClient(e)}config(e){const r=__classPrivateFieldGet(this,_ApiClient_client,"f").defaults;e.timeout&&(r.timeout=e.timeout),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){const o=s?{data:s}:void 0,c=r,u=(a==null?void 0:a.organization)?baseURL(a.organization,a.domain):void 0,n=(a==null?void 0:a.accessToken)||__classPrivateFieldGet(this,_ApiClient_accessToken,"f"),l=n?{Authorization:"Bearer "+n}:void 0;return __classPrivateFieldGet(this,_ApiClient_client,"f").request(Object.assign({method:e,baseURL:u,url:c,data:o,headers:l},a)).then(i=>i.data).catch(i=>handleError(i))}}_ApiClient_accessToken=new WeakMap,_ApiClient_client=new WeakMap,exports.default=ApiClient;
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")),baseURL=(t,e)=>`https://${t.toLowerCase()}.${e||config_1.default.default.domain}/api`,handleError=t=>{let e=new error_1.SdkError({message:t.message,type:error_1.ErrorType.GENERIC});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{constructor(e){_ApiClient_accessToken.set(this,void 0),_ApiClient_client.set(this,void 0),this.baseUrl=baseURL(e.organization,e.domain),__classPrivateFieldSet(this,_ApiClient_accessToken,e.accessToken,"f");const r={timeout:e.timeout||config_1.default.client.timeout};__classPrivateFieldSet(this,_ApiClient_client,axios_1.default.create(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)),"f"),this.interceptors=__classPrivateFieldGet(this,_ApiClient_client,"f").interceptors}static create(e){if(!e?.organization)throw new Error("Undefined 'organization' parameter");if(!e?.accessToken)throw new Error("Undefined 'accessToken' parameter");return new ApiClient(e)}config(e){const r=__classPrivateFieldGet(this,_ApiClient_client,"f").defaults;e.timeout&&(r.timeout=e.timeout),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){const o=s?{data:s}:void 0,c=r,u=a?.organization?baseURL(a.organization,a.domain):void 0,n=a?.accessToken||__classPrivateFieldGet(this,_ApiClient_accessToken,"f"),l=n?{Authorization:"Bearer "+n}:void 0;return __classPrivateFieldGet(this,_ApiClient_client,"f").request(Object.assign({method:e,baseURL:u,url:c,data:o,headers:l},a)).then(i=>i.data).catch(i=>handleError(i))}}_ApiClient_accessToken=new WeakMap,_ApiClient_client=new WeakMap,exports.default=ApiClient;
@@ -1 +1 @@
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});const api=__importStar(require("./api")),static_1=require("./static"),resource_1=__importDefault(require("./resource")),OPEN_API_SCHEMA_VERSION="2.9.1";class CommerceLayerClient{constructor(t){_CommerceLayerClient_adapter.set(this,void 0),_CommerceLayerClient_organization.set(this,void 0),__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.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.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.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.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_methods=new api.ShippingMethods(__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"))}static get openApiSchemaVersion(){return OPEN_API_SCHEMA_VERSION}get currentOrganization(){return __classPrivateFieldGet(this,_CommerceLayerClient_organization,"f")}config(t){t.organization&&__classPrivateFieldSet(this,_CommerceLayerClient_organization,t.organization,"f"),__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").config(t)}resources(){return static_1.CommerceLayerStatic.resources()}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){return __classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").interceptors[t].eject(s)}addRawResponseReader(){const t={id:void 0,rawResponse:void 0};function s(n){return t.rawResponse=n==null?void 0:n.data,n}const i=this.addResponseInterceptor(s);return t.id=i,t}removeRawResponseReader(t){const s=typeof t=="number"?t:t.id;if(s)return this.removeInterceptor("response",s)}}_CommerceLayerClient_adapter=new WeakMap,_CommerceLayerClient_organization=new WeakMap;const CommerceLayer=e=>new CommerceLayerClient(e);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});const api=__importStar(require("./api")),static_1=require("./static"),resource_1=__importDefault(require("./resource")),OPEN_API_SCHEMA_VERSION="2.9.4";class CommerceLayerClient{constructor(t){_CommerceLayerClient_adapter.set(this,void 0),_CommerceLayerClient_organization.set(this,void 0),__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.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.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.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.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_methods=new api.ShippingMethods(__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"))}static get openApiSchemaVersion(){return OPEN_API_SCHEMA_VERSION}get currentOrganization(){return __classPrivateFieldGet(this,_CommerceLayerClient_organization,"f")}config(t){t.organization&&__classPrivateFieldSet(this,_CommerceLayerClient_organization,t.organization,"f"),__classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").config(t)}resources(){return static_1.CommerceLayerStatic.resources()}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){return __classPrivateFieldGet(this,_CommerceLayerClient_adapter,"f").interceptors[t].eject(s)}addRawResponseReader(){const t={id:void 0,rawResponse:void 0};function s(n){return t.rawResponse=n?.data,n}const i=this.addResponseInterceptor(s);return t.id=i,t}removeRawResponseReader(t){const s=typeof t=="number"?t:t.id;if(s)return this.removeInterceptor("response",s)}}_CommerceLayerClient_adapter=new WeakMap,_CommerceLayerClient_organization=new WeakMap;const CommerceLayer=e=>new CommerceLayerClient(e);exports.default=CommerceLayer;
@@ -5,7 +5,7 @@ declare const config: {
5
5
  readonly pageSize: 10;
6
6
  };
7
7
  readonly client: {
8
- readonly timeout: 3000;
8
+ readonly timeout: 15000;
9
9
  };
10
10
  };
11
11
  export default config;
package/lib/cjs/config.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const config={default:{domain:"commercelayer.io",pageNumber:1,pageSize:10},client:{timeout:3e3}};exports.default=config;
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 +1,26 @@
1
- declare enum ErrorType{CLIENT="client",REQUEST="request",RESPONSE="response",GENERIC="generic",CANCEL="cancel"}declare class SdkError extends Error{static isSdkError(error:any):error is ApiError;type:string;code?:string;source?:Error;request?:any;constructor(error:{message:string;type?:ErrorType;});}declare class ApiError extends SdkError{static isApiError(error:any):error is ApiError;errors:any[];status?:number;constructor(error:SdkError);first():any;}export{SdkError,ApiError,ErrorType};
1
+ declare enum ErrorType {
2
+ CLIENT = "client",
3
+ REQUEST = "request",
4
+ RESPONSE = "response",
5
+ GENERIC = "generic",
6
+ CANCEL = "cancel"
7
+ }
8
+ declare class SdkError extends Error {
9
+ static isSdkError(error: any): error is ApiError;
10
+ type: string;
11
+ code?: string;
12
+ source?: Error;
13
+ request?: any;
14
+ constructor(error: {
15
+ message: string;
16
+ type?: ErrorType;
17
+ });
18
+ }
19
+ declare class ApiError extends SdkError {
20
+ static isApiError(error: any): error is ApiError;
21
+ errors: any[];
22
+ status?: number;
23
+ constructor(error: SdkError);
24
+ first(): any;
25
+ }
26
+ export { SdkError, ApiError, ErrorType };
package/lib/cjs/error.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ErrorType=exports.ApiError=exports.SdkError=void 0;var ErrorType;(function(e){e.CLIENT="client",e.REQUEST="request",e.RESPONSE="response",e.GENERIC="generic",e.CANCEL="cancel"})(ErrorType||(ErrorType={})),exports.ErrorType=ErrorType;class SdkError extends Error{constructor(r){super(r.message);this.name=this.constructor.name,this.type=r.type||ErrorType.GENERIC}static isSdkError(r){return r&&["SdkError","ApiError"].includes(r.name)&&Object.values(ErrorType).includes(r.type)}}exports.SdkError=SdkError;class ApiError extends SdkError{constructor(r){super(Object.assign(Object.assign({},r),{type:ErrorType.RESPONSE}));this.errors=[],this.name=this.constructor.name}static isApiError(r){return SdkError.isSdkError(r)&&r.name==="ApiError"&&r.type===ErrorType.RESPONSE}first(){var r;return((r=this.errors)===null||r===void 0?void 0:r.length)>0?this.errors[0]:void 0}}exports.ApiError=ApiError;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ErrorType=exports.ApiError=exports.SdkError=void 0;var ErrorType;(function(e){e.CLIENT="client",e.REQUEST="request",e.RESPONSE="response",e.GENERIC="generic",e.CANCEL="cancel"})(ErrorType||(ErrorType={})),exports.ErrorType=ErrorType;class SdkError extends Error{constructor(r){super(r.message),this.name=this.constructor.name,this.type=r.type||ErrorType.GENERIC}static isSdkError(r){return r&&["SdkError","ApiError"].includes(r.name)&&Object.values(ErrorType).includes(r.type)}}exports.SdkError=SdkError;class ApiError extends SdkError{constructor(r){super(Object.assign(Object.assign({},r),{type:ErrorType.RESPONSE})),this.errors=[],this.name=this.constructor.name}static isApiError(r){return SdkError.isSdkError(r)&&r.name==="ApiError"&&r.type===ErrorType.RESPONSE}first(){var r;return((r=this.errors)===null||r===void 0?void 0:r.length)>0?this.errors[0]:void 0}}exports.ApiError=ApiError;
@@ -1 +1,19 @@
1
- import{AxiosError,AxiosInterceptorManager,AxiosRequestConfig,AxiosResponse}from"axios";declare type InterceptorManager={request:AxiosInterceptorManager<AxiosRequestConfig>;response:AxiosInterceptorManager<any>;};declare type RequestObj=AxiosRequestConfig;declare type RequestInterceptor=(request:RequestObj)=>RequestObj|Promise<RequestObj>;declare type ResponseObj=AxiosResponse;declare type ResponseInterceptor=(response:ResponseObj)=>ResponseObj;declare type ErrorObj=AxiosError;declare type ErrorInterceptor=(error:ErrorObj)=>ErrorObj;declare type InterceptorType='request'|'response';export type{InterceptorManager,RequestInterceptor,ResponseInterceptor,ErrorInterceptor,InterceptorType};export type{RequestObj,ResponseObj,ErrorObj};declare type RawResponseReader={id:number|undefined;rawResponse:ResponseObj|undefined;};export type{RawResponseReader};
1
+ import { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse } from "axios";
2
+ declare type InterceptorManager = {
3
+ request: AxiosInterceptorManager<AxiosRequestConfig>;
4
+ response: AxiosInterceptorManager<any>;
5
+ };
6
+ declare type RequestObj = AxiosRequestConfig;
7
+ declare type RequestInterceptor = (request: RequestObj) => RequestObj | Promise<RequestObj>;
8
+ declare type ResponseObj = AxiosResponse;
9
+ declare type ResponseInterceptor = (response: ResponseObj) => ResponseObj;
10
+ declare type ErrorObj = AxiosError;
11
+ declare type ErrorInterceptor = (error: ErrorObj) => ErrorObj;
12
+ declare type InterceptorType = 'request' | 'response';
13
+ export type { InterceptorManager, RequestInterceptor, ResponseInterceptor, ErrorInterceptor, InterceptorType };
14
+ export type { RequestObj, ResponseObj, ErrorObj };
15
+ declare type RawResponseReader = {
16
+ id: number | undefined;
17
+ rawResponse: ResponseObj | undefined;
18
+ };
19
+ export type { RawResponseReader };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * ©2022 Commerce Layer Inc.
3
- * OpenAPI schema, version 2.9.1
3
+ * OpenAPI schema, version 2.9.4
4
4
  **/
5
5
  export type { Address, AddressCreate, AddressUpdate } from './resources/addresses';
6
6
  export type { Adjustment, AdjustmentCreate, AdjustmentUpdate } from './resources/adjustments';
@@ -1 +1 @@
1
- "use strict";var __classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(s,t,r,e,a){if(e==="m")throw new TypeError("Private method is not writable");if(e==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?s!==t||!a:!t.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e==="a"?a.call(s,r):a?a.value=r:t.set(s,r),r},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(s,t,r,e){if(r==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?s!==t||!e:!t.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?e:r==="a"?e.call(s):e?e.value:t.get(s)},__importDefault=this&&this.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},_ResourceAdapter_client,_ResourceAdapter_config;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ApiResource=void 0;const client_1=__importDefault(require("./client")),jsonapi_1=require("./jsonapi"),query_1=require("./query"),config_1=__importDefault(require("./config"));class ListResponse extends Array{constructor(t,r){super(...r||[]);this.meta=t}first(){return this.length?this[0]:void 0}last(){return this.length?this[this.length-1]:void 0}get(t){return this.length&&t>=0?this[t]:void 0}}class ResourceAdapter{constructor(t){_ResourceAdapter_client.set(this,void 0),_ResourceAdapter_config.set(this,{}),__classPrivateFieldSet(this,_ResourceAdapter_client,client_1.default.create(t),"f"),this.config(t)}get interceptors(){return __classPrivateFieldGet(this,_ResourceAdapter_client,"f").interceptors}config(t){__classPrivateFieldGet(this,_ResourceAdapter_client,"f").config(t)}async singleton(t,r,e){const a=(0,query_1.generateQueryStringParams)(r,t);(e==null?void 0:e.params)&&Object.assign(a,e==null?void 0:e.params);const i=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:a}));return(0,jsonapi_1.denormalize)(i)}async retrieve(t,r,e){const a=(0,query_1.generateQueryStringParams)(r,t);(e==null?void 0:e.params)&&Object.assign(a,e==null?void 0:e.params);const i=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("get",`${t.type}/${t.id}`,void 0,Object.assign(Object.assign({},e),{params:a}));return(0,jsonapi_1.denormalize)(i)}async list(t,r,e){var a,i;const n=(0,query_1.generateQueryStringParams)(r,t);(e==null?void 0:e.params)&&Object.assign(n,e==null?void 0:e.params);const u=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:n})),c=(0,jsonapi_1.denormalize)(u),d={pageCount:Number((a=u.meta)===null||a===void 0?void 0:a.page_count),recordCount:Number((i=u.meta)===null||i===void 0?void 0:i.record_count),currentPage:(r==null?void 0:r.pageNumber)||config_1.default.default.pageNumber,recordsPerPage:(r==null?void 0:r.pageSize)||config_1.default.default.pageSize};return new ListResponse(d,c)}async create(t,r,e){const a=(0,query_1.generateQueryStringParams)(r,t);(e==null?void 0:e.params)&&Object.assign(a,e==null?void 0:e.params);const i=(0,jsonapi_1.normalize)(t),n=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("post",t.type,i,Object.assign(Object.assign({},e),{params:a}));return(0,jsonapi_1.denormalize)(n)}async update(t,r,e){const a=(0,query_1.generateQueryStringParams)(r,t);(e==null?void 0:e.params)&&Object.assign(a,e==null?void 0:e.params);const i=(0,jsonapi_1.normalize)(t),n=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("patch",`${t.type}/${t.id}`,i,Object.assign(Object.assign({},e),{params:a}));return(0,jsonapi_1.denormalize)(n)}async delete(t,r){await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("delete",`${t.type}/${t.id}`,void 0,r)}}_ResourceAdapter_client=new WeakMap,_ResourceAdapter_config=new WeakMap;class ApiResource{constructor(t){this.resources=t}}exports.ApiResource=ApiResource,exports.default=ResourceAdapter;
1
+ "use strict";var __classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(s,t,r,e,a){if(e==="m")throw new TypeError("Private method is not writable");if(e==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?s!==t||!a:!t.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e==="a"?a.call(s,r):a?a.value=r:t.set(s,r),r},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(s,t,r,e){if(r==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?s!==t||!e:!t.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?e:r==="a"?e.call(s):e?e.value:t.get(s)},__importDefault=this&&this.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},_ResourceAdapter_client,_ResourceAdapter_config;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ApiResource=void 0;const client_1=__importDefault(require("./client")),jsonapi_1=require("./jsonapi"),query_1=require("./query"),config_1=__importDefault(require("./config"));class ListResponse extends Array{constructor(t,r){super(...r||[]),this.meta=t}first(){return this.length?this[0]:void 0}last(){return this.length?this[this.length-1]:void 0}get(t){return this.length&&t>=0?this[t]:void 0}}class ResourceAdapter{constructor(t){_ResourceAdapter_client.set(this,void 0),_ResourceAdapter_config.set(this,{}),__classPrivateFieldSet(this,_ResourceAdapter_client,client_1.default.create(t),"f"),this.config(t)}get interceptors(){return __classPrivateFieldGet(this,_ResourceAdapter_client,"f").interceptors}config(t){__classPrivateFieldGet(this,_ResourceAdapter_client,"f").config(t)}async singleton(t,r,e){const a=(0,query_1.generateQueryStringParams)(r,t);e?.params&&Object.assign(a,e?.params);const i=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:a}));return(0,jsonapi_1.denormalize)(i)}async retrieve(t,r,e){const a=(0,query_1.generateQueryStringParams)(r,t);e?.params&&Object.assign(a,e?.params);const i=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("get",`${t.type}/${t.id}`,void 0,Object.assign(Object.assign({},e),{params:a}));return(0,jsonapi_1.denormalize)(i)}async list(t,r,e){var a,i;const n=(0,query_1.generateQueryStringParams)(r,t);e?.params&&Object.assign(n,e?.params);const u=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:n})),c=(0,jsonapi_1.denormalize)(u),d={pageCount:Number((a=u.meta)===null||a===void 0?void 0:a.page_count),recordCount:Number((i=u.meta)===null||i===void 0?void 0:i.record_count),currentPage:r?.pageNumber||config_1.default.default.pageNumber,recordsPerPage:r?.pageSize||config_1.default.default.pageSize};return new ListResponse(d,c)}async create(t,r,e){const a=(0,query_1.generateQueryStringParams)(r,t);e?.params&&Object.assign(a,e?.params);const i=(0,jsonapi_1.normalize)(t),n=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("post",t.type,i,Object.assign(Object.assign({},e),{params:a}));return(0,jsonapi_1.denormalize)(n)}async update(t,r,e){const a=(0,query_1.generateQueryStringParams)(r,t);e?.params&&Object.assign(a,e?.params);const i=(0,jsonapi_1.normalize)(t),n=await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("patch",`${t.type}/${t.id}`,i,Object.assign(Object.assign({},e),{params:a}));return(0,jsonapi_1.denormalize)(n)}async delete(t,r){await __classPrivateFieldGet(this,_ResourceAdapter_client,"f").request("delete",`${t.type}/${t.id}`,void 0,r)}}_ResourceAdapter_client=new WeakMap,_ResourceAdapter_config=new WeakMap;class ApiResource{constructor(t){this.resources=t}}exports.ApiResource=ApiResource,exports.default=ResourceAdapter;
@@ -13,6 +13,7 @@ interface AvalaraAccount extends Resource {
13
13
  name?: string;
14
14
  username?: string;
15
15
  company_code?: string;
16
+ commit_invoice?: string;
16
17
  ddp?: string;
17
18
  tax_categories?: TaxCategory[];
18
19
  markets?: Market[];
@@ -23,6 +24,7 @@ interface AvalaraAccountCreate extends ResourceCreate {
23
24
  username: string;
24
25
  password: string;
25
26
  company_code: string;
27
+ commit_invoice?: string;
26
28
  ddp?: string;
27
29
  tax_categories?: TaxCategoryRel[];
28
30
  }
@@ -31,6 +33,7 @@ interface AvalaraAccountUpdate extends ResourceUpdate {
31
33
  username?: string;
32
34
  password?: string;
33
35
  company_code?: string;
36
+ commit_invoice?: string;
34
37
  ddp?: string;
35
38
  tax_categories?: TaxCategoryRel[];
36
39
  }
@@ -19,6 +19,8 @@ interface Bundle extends Resource {
19
19
  currency_code?: string;
20
20
  description?: string;
21
21
  image_url?: string;
22
+ do_not_ship?: boolean;
23
+ do_not_track?: boolean;
22
24
  price_amount_cents?: number;
23
25
  price_amount_float?: number;
24
26
  formatted_price_amount?: string;
@@ -37,6 +39,8 @@ interface BundleCreate extends ResourceCreate {
37
39
  currency_code?: string;
38
40
  description?: string;
39
41
  image_url?: string;
42
+ do_not_ship?: boolean;
43
+ do_not_track?: boolean;
40
44
  price_amount_cents: number;
41
45
  compare_at_amount_cents: number;
42
46
  _compute_price_amount?: boolean;
@@ -50,6 +54,8 @@ interface BundleUpdate extends ResourceUpdate {
50
54
  currency_code?: string;
51
55
  description?: string;
52
56
  image_url?: string;
57
+ do_not_ship?: boolean;
58
+ do_not_track?: boolean;
53
59
  price_amount_cents?: number;
54
60
  compare_at_amount_cents?: number;
55
61
  _compute_price_amount?: boolean;
@@ -13,6 +13,10 @@ interface KlarnaPayment extends Resource {
13
13
  client_token?: string;
14
14
  payment_methods?: object[];
15
15
  auth_token?: string;
16
+ mismatched_amounts?: boolean;
17
+ intent_amount_cents?: number;
18
+ intent_amount_float?: number;
19
+ formatted_intent_amount?: string;
16
20
  order?: Order;
17
21
  payment_gateway?: PaymentGateway;
18
22
  }
@@ -5,6 +5,8 @@ import { Customer } from './customers';
5
5
  import { Address } from './addresses';
6
6
  import { PaymentMethod } from './payment_methods';
7
7
  import { CustomerPaymentSource } from './customer_payment_sources';
8
+ import { Sku } from './skus';
9
+ import { Bundle } from './bundles';
8
10
  import { AdyenPayment } from './adyen_payments';
9
11
  import { BraintreePayment } from './braintree_payments';
10
12
  import { CheckoutComPayment } from './checkout_com_payments';
@@ -165,6 +167,8 @@ interface Order extends Resource {
165
167
  billing_address?: Address;
166
168
  available_payment_methods?: PaymentMethod[];
167
169
  available_customer_payment_sources?: CustomerPaymentSource[];
170
+ available_free_skus?: Sku[];
171
+ available_free_bundles?: Bundle[];
168
172
  payment_method?: PaymentMethod;
169
173
  payment_source?: AdyenPayment | BraintreePayment | CheckoutComPayment | ExternalPayment | KlarnaPayment | PaypalPayment | StripePayment | WireTransfer;
170
174
  line_items?: LineItem[];
@@ -224,11 +228,14 @@ interface OrderUpdate extends ResourceUpdate {
224
228
  _capture?: boolean;
225
229
  _refund?: boolean;
226
230
  _update_taxes?: boolean;
231
+ _nullify_payment_source?: boolean;
227
232
  _billing_address_clone_id?: string;
228
233
  _shipping_address_clone_id?: string;
229
234
  _customer_payment_source_id?: string;
230
235
  _shipping_address_same_as_billing?: boolean;
231
236
  _billing_address_same_as_shipping?: boolean;
237
+ _commit_invoice?: boolean;
238
+ _refund_invoice?: boolean;
232
239
  _save_payment_source_to_customer_wallet?: boolean;
233
240
  _save_shipping_address_to_customer_address_book?: boolean;
234
241
  _save_billing_address_to_customer_address_book?: boolean;
package/lib/cjs/util.d.ts CHANGED
@@ -1 +1,6 @@
1
- declare const sleep:(ms:number)=>Promise<NodeJS.Timeout>;export{sleep};
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /// <reference types="node" />
4
+ /// <reference types="node" />
5
+ declare const sleep: (ms: number) => Promise<NodeJS.Timeout>;
6
+ export { sleep };
package/lib/esm/api.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * ©2022 Commerce Layer Inc.
3
- * OpenAPI schema, version 2.9.1
3
+ * OpenAPI schema, version 2.9.4
4
4
  **/
5
5
  export { default as Addresses } from './resources/addresses';
6
6
  export { default as Adjustments } from './resources/adjustments';
package/lib/esm/client.js CHANGED
@@ -1 +1 @@
1
- var l=this&&this.__classPrivateFieldSet||function(a,e,t,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?a!==e||!s:!e.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(a,t):s?s.value=t:e.set(a,t),t},n=this&&this.__classPrivateFieldGet||function(a,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?a!==e||!r:!e.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(a):r?r.value:e.get(a)},i,o;import h from"axios";import{SdkError as y,ApiError as b,ErrorType as c}from"./error";import u from"./config";const f=(a,e)=>`https://${a.toLowerCase()}.${e||u.default.domain}/api`,C=a=>{let e=new y({message:a.message,type:c.GENERIC});if(h.isAxiosError(a))if(a.response){const t=new b(e);t.type=c.RESPONSE,t.status=a.response.status,t.code=String(t.status),t.errors=a.response.data.errors,e=t}else a.request?(e.type=c.REQUEST,e.request=a.request):e.type=c.CLIENT;else h.isCancel(a)?e.type=c.CANCEL:e.source=a;throw e};class m{constructor(e){i.set(this,void 0),o.set(this,void 0),this.baseUrl=f(e.organization,e.domain),l(this,i,e.accessToken,"f");const t={timeout:e.timeout||u.client.timeout};l(this,o,h.create(Object.assign({baseURL:this.baseUrl,timeout:u.client.timeout,headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json",Authorization:"Bearer "+n(this,i,"f")}},t)),"f"),this.interceptors=n(this,o,"f").interceptors}static create(e){if(!(e==null?void 0:e.organization))throw new Error("Undefined 'organization' parameter");if(!(e==null?void 0:e.accessToken))throw new Error("Undefined 'accessToken' parameter");return new m(e)}config(e){const t=n(this,o,"f").defaults;e.timeout&&(t.timeout=e.timeout),e.organization&&(this.baseUrl=f(e.organization,e.domain)),e.accessToken&&(l(this,i,e.accessToken,"f"),t.headers.common.Authorization="Bearer "+n(this,i,"f"))}async request(e,t,r,s){const p=r?{data:r}:void 0,E=t,v=(s==null?void 0:s.organization)?f(s.organization,s.domain):void 0,w=(s==null?void 0:s.accessToken)||n(this,i,"f"),T=w?{Authorization:"Bearer "+w}:void 0;return n(this,o,"f").request(Object.assign({method:e,baseURL:v,url:E,data:p,headers:T},s)).then(d=>d.data).catch(d=>C(d))}}i=new WeakMap,o=new WeakMap;export default m;
1
+ var l=this&&this.__classPrivateFieldSet||function(a,e,t,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?a!==e||!s:!e.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(a,t):s?s.value=t:e.set(a,t),t},n=this&&this.__classPrivateFieldGet||function(a,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?a!==e||!r:!e.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(a):r?r.value:e.get(a)},i,o;import h from"axios";import{SdkError as y,ApiError as b,ErrorType as c}from"./error";import u from"./config";const f=(a,e)=>`https://${a.toLowerCase()}.${e||u.default.domain}/api`,C=a=>{let e=new y({message:a.message,type:c.GENERIC});if(h.isAxiosError(a))if(a.response){const t=new b(e);t.type=c.RESPONSE,t.status=a.response.status,t.code=String(t.status),t.errors=a.response.data.errors,e=t}else a.request?(e.type=c.REQUEST,e.request=a.request):e.type=c.CLIENT;else h.isCancel(a)?e.type=c.CANCEL:e.source=a;throw e};class m{constructor(e){i.set(this,void 0),o.set(this,void 0),this.baseUrl=f(e.organization,e.domain),l(this,i,e.accessToken,"f");const t={timeout:e.timeout||u.client.timeout};l(this,o,h.create(Object.assign({baseURL:this.baseUrl,timeout:u.client.timeout,headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json",Authorization:"Bearer "+n(this,i,"f")}},t)),"f"),this.interceptors=n(this,o,"f").interceptors}static create(e){if(!e?.organization)throw new Error("Undefined 'organization' parameter");if(!e?.accessToken)throw new Error("Undefined 'accessToken' parameter");return new m(e)}config(e){const t=n(this,o,"f").defaults;e.timeout&&(t.timeout=e.timeout),e.organization&&(this.baseUrl=f(e.organization,e.domain)),e.accessToken&&(l(this,i,e.accessToken,"f"),t.headers.common.Authorization="Bearer "+n(this,i,"f"))}async request(e,t,r,s){const p=r?{data:r}:void 0,E=t,v=s?.organization?f(s.organization,s.domain):void 0,w=s?.accessToken||n(this,i,"f"),T=w?{Authorization:"Bearer "+w}:void 0;return n(this,o,"f").request(Object.assign({method:e,baseURL:v,url:E,data:p,headers:T},s)).then(d=>d.data).catch(d=>C(d))}}i=new WeakMap,o=new WeakMap;export default m;
@@ -1 +1 @@
1
- var c=this&&this.__classPrivateFieldSet||function(o,i,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?o!==i||!a:!i.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(o,n):a?a.value=n:i.set(o,n),n},s=this&&this.__classPrivateFieldGet||function(o,i,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?o!==i||!r:!i.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(o):r?r.value:i.get(o)},t,h;import*as e from"./api";import{CommerceLayerStatic as w}from"./static";import f from"./resource";const p="2.9.1";class u{constructor(i){t.set(this,void 0),h.set(this,void 0),c(this,t,new f(i),"f"),c(this,h,i.organization,"f"),this.addresses=new e.Addresses(s(this,t,"f")),this.adjustments=new e.Adjustments(s(this,t,"f")),this.adyen_gateways=new e.AdyenGateways(s(this,t,"f")),this.adyen_payments=new e.AdyenPayments(s(this,t,"f")),this.application=new e.Applications(s(this,t,"f")),this.attachments=new e.Attachments(s(this,t,"f")),this.authorizations=new e.Authorizations(s(this,t,"f")),this.avalara_accounts=new e.AvalaraAccounts(s(this,t,"f")),this.billing_info_validation_rules=new e.BillingInfoValidationRules(s(this,t,"f")),this.bing_geocoders=new e.BingGeocoders(s(this,t,"f")),this.braintree_gateways=new e.BraintreeGateways(s(this,t,"f")),this.braintree_payments=new e.BraintreePayments(s(this,t,"f")),this.bundles=new e.Bundles(s(this,t,"f")),this.captures=new e.Captures(s(this,t,"f")),this.carrier_accounts=new e.CarrierAccounts(s(this,t,"f")),this.checkout_com_gateways=new e.CheckoutComGateways(s(this,t,"f")),this.checkout_com_payments=new e.CheckoutComPayments(s(this,t,"f")),this.coupon_codes_promotion_rules=new e.CouponCodesPromotionRules(s(this,t,"f")),this.coupon_recipients=new e.CouponRecipients(s(this,t,"f")),this.coupons=new e.Coupons(s(this,t,"f")),this.customer_addresses=new e.CustomerAddresses(s(this,t,"f")),this.customer_groups=new e.CustomerGroups(s(this,t,"f")),this.customer_password_resets=new e.CustomerPasswordResets(s(this,t,"f")),this.customer_payment_sources=new e.CustomerPaymentSources(s(this,t,"f")),this.customer_subscriptions=new e.CustomerSubscriptions(s(this,t,"f")),this.customers=new e.Customers(s(this,t,"f")),this.delivery_lead_times=new e.DeliveryLeadTimes(s(this,t,"f")),this.event_callbacks=new e.EventCallbacks(s(this,t,"f")),this.external_gateways=new e.ExternalGateways(s(this,t,"f")),this.external_payments=new e.ExternalPayments(s(this,t,"f")),this.external_promotions=new e.ExternalPromotions(s(this,t,"f")),this.external_tax_calculators=new e.ExternalTaxCalculators(s(this,t,"f")),this.fixed_amount_promotions=new e.FixedAmountPromotions(s(this,t,"f")),this.fixed_price_promotions=new e.FixedPricePromotions(s(this,t,"f")),this.free_gift_promotions=new e.FreeGiftPromotions(s(this,t,"f")),this.free_shipping_promotions=new e.FreeShippingPromotions(s(this,t,"f")),this.geocoders=new e.Geocoders(s(this,t,"f")),this.gift_card_recipients=new e.GiftCardRecipients(s(this,t,"f")),this.gift_cards=new e.GiftCards(s(this,t,"f")),this.google_geocoders=new e.GoogleGeocoders(s(this,t,"f")),this.imports=new e.Imports(s(this,t,"f")),this.in_stock_subscriptions=new e.InStockSubscriptions(s(this,t,"f")),this.inventory_models=new e.InventoryModels(s(this,t,"f")),this.inventory_return_locations=new e.InventoryReturnLocations(s(this,t,"f")),this.inventory_stock_locations=new e.InventoryStockLocations(s(this,t,"f")),this.klarna_gateways=new e.KlarnaGateways(s(this,t,"f")),this.klarna_payments=new e.KlarnaPayments(s(this,t,"f")),this.line_item_options=new e.LineItemOptions(s(this,t,"f")),this.line_items=new e.LineItems(s(this,t,"f")),this.manual_gateways=new e.ManualGateways(s(this,t,"f")),this.manual_tax_calculators=new e.ManualTaxCalculators(s(this,t,"f")),this.markets=new e.Markets(s(this,t,"f")),this.merchants=new e.Merchants(s(this,t,"f")),this.order_amount_promotion_rules=new e.OrderAmountPromotionRules(s(this,t,"f")),this.order_copies=new e.OrderCopies(s(this,t,"f")),this.order_subscriptions=new e.OrderSubscriptions(s(this,t,"f")),this.order_validation_rules=new e.OrderValidationRules(s(this,t,"f")),this.orders=new e.Orders(s(this,t,"f")),this.organization=new e.Organizations(s(this,t,"f")),this.packages=new e.Packages(s(this,t,"f")),this.parcel_line_items=new e.ParcelLineItems(s(this,t,"f")),this.parcels=new e.Parcels(s(this,t,"f")),this.payment_gateways=new e.PaymentGateways(s(this,t,"f")),this.payment_methods=new e.PaymentMethods(s(this,t,"f")),this.paypal_gateways=new e.PaypalGateways(s(this,t,"f")),this.paypal_payments=new e.PaypalPayments(s(this,t,"f")),this.percentage_discount_promotions=new e.PercentageDiscountPromotions(s(this,t,"f")),this.price_lists=new e.PriceLists(s(this,t,"f")),this.prices=new e.Prices(s(this,t,"f")),this.promotion_rules=new e.PromotionRules(s(this,t,"f")),this.promotions=new e.Promotions(s(this,t,"f")),this.refunds=new e.Refunds(s(this,t,"f")),this.return_line_items=new e.ReturnLineItems(s(this,t,"f")),this.returns=new e.Returns(s(this,t,"f")),this.shipments=new e.Shipments(s(this,t,"f")),this.shipping_categories=new e.ShippingCategories(s(this,t,"f")),this.shipping_methods=new e.ShippingMethods(s(this,t,"f")),this.shipping_zones=new e.ShippingZones(s(this,t,"f")),this.sku_list_items=new e.SkuListItems(s(this,t,"f")),this.sku_list_promotion_rules=new e.SkuListPromotionRules(s(this,t,"f")),this.sku_lists=new e.SkuLists(s(this,t,"f")),this.sku_options=new e.SkuOptions(s(this,t,"f")),this.skus=new e.Skus(s(this,t,"f")),this.stock_items=new e.StockItems(s(this,t,"f")),this.stock_line_items=new e.StockLineItems(s(this,t,"f")),this.stock_locations=new e.StockLocations(s(this,t,"f")),this.stock_transfers=new e.StockTransfers(s(this,t,"f")),this.stripe_gateways=new e.StripeGateways(s(this,t,"f")),this.stripe_payments=new e.StripePayments(s(this,t,"f")),this.tax_calculators=new e.TaxCalculators(s(this,t,"f")),this.tax_categories=new e.TaxCategories(s(this,t,"f")),this.tax_rules=new e.TaxRules(s(this,t,"f")),this.taxjar_accounts=new e.TaxjarAccounts(s(this,t,"f")),this.transactions=new e.Transactions(s(this,t,"f")),this.voids=new e.Voids(s(this,t,"f")),this.webhooks=new e.Webhooks(s(this,t,"f")),this.wire_transfers=new e.WireTransfers(s(this,t,"f"))}static get openApiSchemaVersion(){return p}get currentOrganization(){return s(this,h,"f")}config(i){i.organization&&c(this,h,i.organization,"f"),s(this,t,"f").config(i)}resources(){return w.resources()}isApiError(i){return w.isApiError(i)}addRequestInterceptor(i,n){return s(this,t,"f").interceptors.request.use(i,n)}addResponseInterceptor(i,n){return s(this,t,"f").interceptors.response.use(i,n)}removeInterceptor(i,n){return s(this,t,"f").interceptors[i].eject(n)}addRawResponseReader(){const i={id:void 0,rawResponse:void 0};function n(a){return i.rawResponse=a==null?void 0:a.data,a}const r=this.addResponseInterceptor(n);return i.id=r,i}removeRawResponseReader(i){const n=typeof i=="number"?i:i.id;if(n)return this.removeInterceptor("response",n)}}t=new WeakMap,h=new WeakMap;const m=o=>new u(o);export default m;
1
+ var c=this&&this.__classPrivateFieldSet||function(o,i,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?o!==i||!a:!i.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(o,n):a?a.value=n:i.set(o,n),n},s=this&&this.__classPrivateFieldGet||function(o,i,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?o!==i||!r:!i.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(o):r?r.value:i.get(o)},t,h;import*as e from"./api";import{CommerceLayerStatic as w}from"./static";import f from"./resource";const p="2.9.4";class u{constructor(i){t.set(this,void 0),h.set(this,void 0),c(this,t,new f(i),"f"),c(this,h,i.organization,"f"),this.addresses=new e.Addresses(s(this,t,"f")),this.adjustments=new e.Adjustments(s(this,t,"f")),this.adyen_gateways=new e.AdyenGateways(s(this,t,"f")),this.adyen_payments=new e.AdyenPayments(s(this,t,"f")),this.application=new e.Applications(s(this,t,"f")),this.attachments=new e.Attachments(s(this,t,"f")),this.authorizations=new e.Authorizations(s(this,t,"f")),this.avalara_accounts=new e.AvalaraAccounts(s(this,t,"f")),this.billing_info_validation_rules=new e.BillingInfoValidationRules(s(this,t,"f")),this.bing_geocoders=new e.BingGeocoders(s(this,t,"f")),this.braintree_gateways=new e.BraintreeGateways(s(this,t,"f")),this.braintree_payments=new e.BraintreePayments(s(this,t,"f")),this.bundles=new e.Bundles(s(this,t,"f")),this.captures=new e.Captures(s(this,t,"f")),this.carrier_accounts=new e.CarrierAccounts(s(this,t,"f")),this.checkout_com_gateways=new e.CheckoutComGateways(s(this,t,"f")),this.checkout_com_payments=new e.CheckoutComPayments(s(this,t,"f")),this.coupon_codes_promotion_rules=new e.CouponCodesPromotionRules(s(this,t,"f")),this.coupon_recipients=new e.CouponRecipients(s(this,t,"f")),this.coupons=new e.Coupons(s(this,t,"f")),this.customer_addresses=new e.CustomerAddresses(s(this,t,"f")),this.customer_groups=new e.CustomerGroups(s(this,t,"f")),this.customer_password_resets=new e.CustomerPasswordResets(s(this,t,"f")),this.customer_payment_sources=new e.CustomerPaymentSources(s(this,t,"f")),this.customer_subscriptions=new e.CustomerSubscriptions(s(this,t,"f")),this.customers=new e.Customers(s(this,t,"f")),this.delivery_lead_times=new e.DeliveryLeadTimes(s(this,t,"f")),this.event_callbacks=new e.EventCallbacks(s(this,t,"f")),this.external_gateways=new e.ExternalGateways(s(this,t,"f")),this.external_payments=new e.ExternalPayments(s(this,t,"f")),this.external_promotions=new e.ExternalPromotions(s(this,t,"f")),this.external_tax_calculators=new e.ExternalTaxCalculators(s(this,t,"f")),this.fixed_amount_promotions=new e.FixedAmountPromotions(s(this,t,"f")),this.fixed_price_promotions=new e.FixedPricePromotions(s(this,t,"f")),this.free_gift_promotions=new e.FreeGiftPromotions(s(this,t,"f")),this.free_shipping_promotions=new e.FreeShippingPromotions(s(this,t,"f")),this.geocoders=new e.Geocoders(s(this,t,"f")),this.gift_card_recipients=new e.GiftCardRecipients(s(this,t,"f")),this.gift_cards=new e.GiftCards(s(this,t,"f")),this.google_geocoders=new e.GoogleGeocoders(s(this,t,"f")),this.imports=new e.Imports(s(this,t,"f")),this.in_stock_subscriptions=new e.InStockSubscriptions(s(this,t,"f")),this.inventory_models=new e.InventoryModels(s(this,t,"f")),this.inventory_return_locations=new e.InventoryReturnLocations(s(this,t,"f")),this.inventory_stock_locations=new e.InventoryStockLocations(s(this,t,"f")),this.klarna_gateways=new e.KlarnaGateways(s(this,t,"f")),this.klarna_payments=new e.KlarnaPayments(s(this,t,"f")),this.line_item_options=new e.LineItemOptions(s(this,t,"f")),this.line_items=new e.LineItems(s(this,t,"f")),this.manual_gateways=new e.ManualGateways(s(this,t,"f")),this.manual_tax_calculators=new e.ManualTaxCalculators(s(this,t,"f")),this.markets=new e.Markets(s(this,t,"f")),this.merchants=new e.Merchants(s(this,t,"f")),this.order_amount_promotion_rules=new e.OrderAmountPromotionRules(s(this,t,"f")),this.order_copies=new e.OrderCopies(s(this,t,"f")),this.order_subscriptions=new e.OrderSubscriptions(s(this,t,"f")),this.order_validation_rules=new e.OrderValidationRules(s(this,t,"f")),this.orders=new e.Orders(s(this,t,"f")),this.organization=new e.Organizations(s(this,t,"f")),this.packages=new e.Packages(s(this,t,"f")),this.parcel_line_items=new e.ParcelLineItems(s(this,t,"f")),this.parcels=new e.Parcels(s(this,t,"f")),this.payment_gateways=new e.PaymentGateways(s(this,t,"f")),this.payment_methods=new e.PaymentMethods(s(this,t,"f")),this.paypal_gateways=new e.PaypalGateways(s(this,t,"f")),this.paypal_payments=new e.PaypalPayments(s(this,t,"f")),this.percentage_discount_promotions=new e.PercentageDiscountPromotions(s(this,t,"f")),this.price_lists=new e.PriceLists(s(this,t,"f")),this.prices=new e.Prices(s(this,t,"f")),this.promotion_rules=new e.PromotionRules(s(this,t,"f")),this.promotions=new e.Promotions(s(this,t,"f")),this.refunds=new e.Refunds(s(this,t,"f")),this.return_line_items=new e.ReturnLineItems(s(this,t,"f")),this.returns=new e.Returns(s(this,t,"f")),this.shipments=new e.Shipments(s(this,t,"f")),this.shipping_categories=new e.ShippingCategories(s(this,t,"f")),this.shipping_methods=new e.ShippingMethods(s(this,t,"f")),this.shipping_zones=new e.ShippingZones(s(this,t,"f")),this.sku_list_items=new e.SkuListItems(s(this,t,"f")),this.sku_list_promotion_rules=new e.SkuListPromotionRules(s(this,t,"f")),this.sku_lists=new e.SkuLists(s(this,t,"f")),this.sku_options=new e.SkuOptions(s(this,t,"f")),this.skus=new e.Skus(s(this,t,"f")),this.stock_items=new e.StockItems(s(this,t,"f")),this.stock_line_items=new e.StockLineItems(s(this,t,"f")),this.stock_locations=new e.StockLocations(s(this,t,"f")),this.stock_transfers=new e.StockTransfers(s(this,t,"f")),this.stripe_gateways=new e.StripeGateways(s(this,t,"f")),this.stripe_payments=new e.StripePayments(s(this,t,"f")),this.tax_calculators=new e.TaxCalculators(s(this,t,"f")),this.tax_categories=new e.TaxCategories(s(this,t,"f")),this.tax_rules=new e.TaxRules(s(this,t,"f")),this.taxjar_accounts=new e.TaxjarAccounts(s(this,t,"f")),this.transactions=new e.Transactions(s(this,t,"f")),this.voids=new e.Voids(s(this,t,"f")),this.webhooks=new e.Webhooks(s(this,t,"f")),this.wire_transfers=new e.WireTransfers(s(this,t,"f"))}static get openApiSchemaVersion(){return p}get currentOrganization(){return s(this,h,"f")}config(i){i.organization&&c(this,h,i.organization,"f"),s(this,t,"f").config(i)}resources(){return w.resources()}isApiError(i){return w.isApiError(i)}addRequestInterceptor(i,n){return s(this,t,"f").interceptors.request.use(i,n)}addResponseInterceptor(i,n){return s(this,t,"f").interceptors.response.use(i,n)}removeInterceptor(i,n){return s(this,t,"f").interceptors[i].eject(n)}addRawResponseReader(){const i={id:void 0,rawResponse:void 0};function n(a){return i.rawResponse=a?.data,a}const r=this.addResponseInterceptor(n);return i.id=r,i}removeRawResponseReader(i){const n=typeof i=="number"?i:i.id;if(n)return this.removeInterceptor("response",n)}}t=new WeakMap,h=new WeakMap;const m=o=>new u(o);export default m;
@@ -5,7 +5,7 @@ declare const config: {
5
5
  readonly pageSize: 10;
6
6
  };
7
7
  readonly client: {
8
- readonly timeout: 3000;
8
+ readonly timeout: 15000;
9
9
  };
10
10
  };
11
11
  export default config;
package/lib/esm/config.js CHANGED
@@ -1 +1 @@
1
- const e={default:{domain:"commercelayer.io",pageNumber:1,pageSize:10},client:{timeout:3e3}};export default e;
1
+ const e={default:{domain:"commercelayer.io",pageNumber:1,pageSize:10},client:{timeout:15e3}};export default e;
package/lib/esm/debug.js CHANGED
@@ -1 +1 @@
1
- const e=(t,...r)=>{};let c=t=>e;try{const t=require("debug");t&&typeof t=="function"&&(c=t)}catch{}const o="clsdk",n=t=>c(`${o}:${t}`);export default n;
1
+ const c=(t,...r)=>{};let e=t=>c;try{const t=require("debug");t&&typeof t=="function"&&(e=t)}catch{}const n="clsdk",o=t=>e(`${n}:${t}`);export default o;
@@ -1 +1,26 @@
1
- declare enum ErrorType{CLIENT="client",REQUEST="request",RESPONSE="response",GENERIC="generic",CANCEL="cancel"}declare class SdkError extends Error{static isSdkError(error:any):error is ApiError;type:string;code?:string;source?:Error;request?:any;constructor(error:{message:string;type?:ErrorType;});}declare class ApiError extends SdkError{static isApiError(error:any):error is ApiError;errors:any[];status?:number;constructor(error:SdkError);first():any;}export{SdkError,ApiError,ErrorType};
1
+ declare enum ErrorType {
2
+ CLIENT = "client",
3
+ REQUEST = "request",
4
+ RESPONSE = "response",
5
+ GENERIC = "generic",
6
+ CANCEL = "cancel"
7
+ }
8
+ declare class SdkError extends Error {
9
+ static isSdkError(error: any): error is ApiError;
10
+ type: string;
11
+ code?: string;
12
+ source?: Error;
13
+ request?: any;
14
+ constructor(error: {
15
+ message: string;
16
+ type?: ErrorType;
17
+ });
18
+ }
19
+ declare class ApiError extends SdkError {
20
+ static isApiError(error: any): error is ApiError;
21
+ errors: any[];
22
+ status?: number;
23
+ constructor(error: SdkError);
24
+ first(): any;
25
+ }
26
+ export { SdkError, ApiError, ErrorType };
package/lib/esm/error.js CHANGED
@@ -1 +1 @@
1
- var t;(function(s){s.CLIENT="client",s.REQUEST="request",s.RESPONSE="response",s.GENERIC="generic",s.CANCEL="cancel"})(t||(t={}));class e extends Error{constructor(r){super(r.message);this.name=this.constructor.name,this.type=r.type||t.GENERIC}static isSdkError(r){return r&&["SdkError","ApiError"].includes(r.name)&&Object.values(t).includes(r.type)}}class i extends e{constructor(r){super(Object.assign(Object.assign({},r),{type:t.RESPONSE}));this.errors=[],this.name=this.constructor.name}static isApiError(r){return e.isSdkError(r)&&r.name==="ApiError"&&r.type===t.RESPONSE}first(){var r;return((r=this.errors)===null||r===void 0?void 0:r.length)>0?this.errors[0]:void 0}}export{e as SdkError,i as ApiError,t as ErrorType};
1
+ var e;(function(t){t.CLIENT="client",t.REQUEST="request",t.RESPONSE="response",t.GENERIC="generic",t.CANCEL="cancel"})(e||(e={}));class r extends Error{constructor(s){super(s.message),this.name=this.constructor.name,this.type=s.type||e.GENERIC}static isSdkError(s){return s&&["SdkError","ApiError"].includes(s.name)&&Object.values(e).includes(s.type)}}class n extends r{constructor(s){super(Object.assign(Object.assign({},s),{type:e.RESPONSE})),this.errors=[],this.name=this.constructor.name}static isApiError(s){return r.isSdkError(s)&&s.name==="ApiError"&&s.type===e.RESPONSE}first(){var s;return((s=this.errors)===null||s===void 0?void 0:s.length)>0?this.errors[0]:void 0}}export{r as SdkError,n as ApiError,e as ErrorType};
@@ -1 +1,19 @@
1
- import{AxiosError,AxiosInterceptorManager,AxiosRequestConfig,AxiosResponse}from"axios";declare type InterceptorManager={request:AxiosInterceptorManager<AxiosRequestConfig>;response:AxiosInterceptorManager<any>;};declare type RequestObj=AxiosRequestConfig;declare type RequestInterceptor=(request:RequestObj)=>RequestObj|Promise<RequestObj>;declare type ResponseObj=AxiosResponse;declare type ResponseInterceptor=(response:ResponseObj)=>ResponseObj;declare type ErrorObj=AxiosError;declare type ErrorInterceptor=(error:ErrorObj)=>ErrorObj;declare type InterceptorType='request'|'response';export type{InterceptorManager,RequestInterceptor,ResponseInterceptor,ErrorInterceptor,InterceptorType};export type{RequestObj,ResponseObj,ErrorObj};declare type RawResponseReader={id:number|undefined;rawResponse:ResponseObj|undefined;};export type{RawResponseReader};
1
+ import { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse } from "axios";
2
+ declare type InterceptorManager = {
3
+ request: AxiosInterceptorManager<AxiosRequestConfig>;
4
+ response: AxiosInterceptorManager<any>;
5
+ };
6
+ declare type RequestObj = AxiosRequestConfig;
7
+ declare type RequestInterceptor = (request: RequestObj) => RequestObj | Promise<RequestObj>;
8
+ declare type ResponseObj = AxiosResponse;
9
+ declare type ResponseInterceptor = (response: ResponseObj) => ResponseObj;
10
+ declare type ErrorObj = AxiosError;
11
+ declare type ErrorInterceptor = (error: ErrorObj) => ErrorObj;
12
+ declare type InterceptorType = 'request' | 'response';
13
+ export type { InterceptorManager, RequestInterceptor, ResponseInterceptor, ErrorInterceptor, InterceptorType };
14
+ export type { RequestObj, ResponseObj, ErrorObj };
15
+ declare type RawResponseReader = {
16
+ id: number | undefined;
17
+ rawResponse: ResponseObj | undefined;
18
+ };
19
+ export type { RawResponseReader };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * ©2022 Commerce Layer Inc.
3
- * OpenAPI schema, version 2.9.1
3
+ * OpenAPI schema, version 2.9.4
4
4
  **/
5
5
  export type { Address, AddressCreate, AddressUpdate } from './resources/addresses';
6
6
  export type { Adjustment, AdjustmentCreate, AdjustmentUpdate } from './resources/adjustments';
@@ -1 +1 @@
1
- var w=this&&this.__classPrivateFieldSet||function(s,t,a,e,r){if(e==="m")throw new TypeError("Private method is not writable");if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?s!==t||!r:!t.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e==="a"?r.call(s,a):r?r.value=a:t.set(s,a),a},d=this&&this.__classPrivateFieldGet||function(s,t,a,e){if(a==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?s!==t||!e:!t.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?e:a==="a"?e.call(s):e?e.value:t.get(s)},n,h;import y from"./client";import{denormalize as u,normalize as g}from"./jsonapi";import{generateQueryStringParams as o}from"./query";import m from"./config";class b extends Array{constructor(t,a){super(...a||[]);this.meta=t}first(){return this.length?this[0]:void 0}last(){return this.length?this[this.length-1]:void 0}get(t){return this.length&&t>=0?this[t]:void 0}}class p{constructor(t){n.set(this,void 0),h.set(this,{}),w(this,n,y.create(t),"f"),this.config(t)}get interceptors(){return d(this,n,"f").interceptors}config(t){d(this,n,"f").config(t)}async singleton(t,a,e){const r=o(a,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=await d(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async retrieve(t,a,e){const r=o(a,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=await d(this,n,"f").request("get",`${t.type}/${t.id}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async list(t,a,e){var r,i;const c=o(a,t);(e==null?void 0:e.params)&&Object.assign(c,e==null?void 0:e.params);const l=await d(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:c})),f=u(l),v={pageCount:Number((r=l.meta)===null||r===void 0?void 0:r.page_count),recordCount:Number((i=l.meta)===null||i===void 0?void 0:i.record_count),currentPage:(a==null?void 0:a.pageNumber)||m.default.pageNumber,recordsPerPage:(a==null?void 0:a.pageSize)||m.default.pageSize};return new b(v,f)}async create(t,a,e){const r=o(a,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=g(t),c=await d(this,n,"f").request("post",t.type,i,Object.assign(Object.assign({},e),{params:r}));return u(c)}async update(t,a,e){const r=o(a,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=g(t),c=await d(this,n,"f").request("patch",`${t.type}/${t.id}`,i,Object.assign(Object.assign({},e),{params:r}));return u(c)}async delete(t,a){await d(this,n,"f").request("delete",`${t.type}/${t.id}`,void 0,a)}}n=new WeakMap,h=new WeakMap;class j{constructor(t){this.resources=t}}export default p;export{j as ApiResource};
1
+ var w=this&&this.__classPrivateFieldSet||function(s,t,a,e,r){if(e==="m")throw new TypeError("Private method is not writable");if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?s!==t||!r:!t.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e==="a"?r.call(s,a):r?r.value=a:t.set(s,a),a},d=this&&this.__classPrivateFieldGet||function(s,t,a,e){if(a==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?s!==t||!e:!t.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?e:a==="a"?e.call(s):e?e.value:t.get(s)},n,h;import y from"./client";import{denormalize as u,normalize as g}from"./jsonapi";import{generateQueryStringParams as o}from"./query";import m from"./config";class b extends Array{constructor(t,a){super(...a||[]),this.meta=t}first(){return this.length?this[0]:void 0}last(){return this.length?this[this.length-1]:void 0}get(t){return this.length&&t>=0?this[t]:void 0}}class p{constructor(t){n.set(this,void 0),h.set(this,{}),w(this,n,y.create(t),"f"),this.config(t)}get interceptors(){return d(this,n,"f").interceptors}config(t){d(this,n,"f").config(t)}async singleton(t,a,e){const r=o(a,t);e?.params&&Object.assign(r,e?.params);const i=await d(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async retrieve(t,a,e){const r=o(a,t);e?.params&&Object.assign(r,e?.params);const i=await d(this,n,"f").request("get",`${t.type}/${t.id}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async list(t,a,e){var r,i;const c=o(a,t);e?.params&&Object.assign(c,e?.params);const l=await d(this,n,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:c})),f=u(l),v={pageCount:Number((r=l.meta)===null||r===void 0?void 0:r.page_count),recordCount:Number((i=l.meta)===null||i===void 0?void 0:i.record_count),currentPage:a?.pageNumber||m.default.pageNumber,recordsPerPage:a?.pageSize||m.default.pageSize};return new b(v,f)}async create(t,a,e){const r=o(a,t);e?.params&&Object.assign(r,e?.params);const i=g(t),c=await d(this,n,"f").request("post",t.type,i,Object.assign(Object.assign({},e),{params:r}));return u(c)}async update(t,a,e){const r=o(a,t);e?.params&&Object.assign(r,e?.params);const i=g(t),c=await d(this,n,"f").request("patch",`${t.type}/${t.id}`,i,Object.assign(Object.assign({},e),{params:r}));return u(c)}async delete(t,a){await d(this,n,"f").request("delete",`${t.type}/${t.id}`,void 0,a)}}n=new WeakMap,h=new WeakMap;class j{constructor(t){this.resources=t}}export default p;export{j as ApiResource};
@@ -13,6 +13,7 @@ interface AvalaraAccount extends Resource {
13
13
  name?: string;
14
14
  username?: string;
15
15
  company_code?: string;
16
+ commit_invoice?: string;
16
17
  ddp?: string;
17
18
  tax_categories?: TaxCategory[];
18
19
  markets?: Market[];
@@ -23,6 +24,7 @@ interface AvalaraAccountCreate extends ResourceCreate {
23
24
  username: string;
24
25
  password: string;
25
26
  company_code: string;
27
+ commit_invoice?: string;
26
28
  ddp?: string;
27
29
  tax_categories?: TaxCategoryRel[];
28
30
  }
@@ -31,6 +33,7 @@ interface AvalaraAccountUpdate extends ResourceUpdate {
31
33
  username?: string;
32
34
  password?: string;
33
35
  company_code?: string;
36
+ commit_invoice?: string;
34
37
  ddp?: string;
35
38
  tax_categories?: TaxCategoryRel[];
36
39
  }
@@ -19,6 +19,8 @@ interface Bundle extends Resource {
19
19
  currency_code?: string;
20
20
  description?: string;
21
21
  image_url?: string;
22
+ do_not_ship?: boolean;
23
+ do_not_track?: boolean;
22
24
  price_amount_cents?: number;
23
25
  price_amount_float?: number;
24
26
  formatted_price_amount?: string;
@@ -37,6 +39,8 @@ interface BundleCreate extends ResourceCreate {
37
39
  currency_code?: string;
38
40
  description?: string;
39
41
  image_url?: string;
42
+ do_not_ship?: boolean;
43
+ do_not_track?: boolean;
40
44
  price_amount_cents: number;
41
45
  compare_at_amount_cents: number;
42
46
  _compute_price_amount?: boolean;
@@ -50,6 +54,8 @@ interface BundleUpdate extends ResourceUpdate {
50
54
  currency_code?: string;
51
55
  description?: string;
52
56
  image_url?: string;
57
+ do_not_ship?: boolean;
58
+ do_not_track?: boolean;
53
59
  price_amount_cents?: number;
54
60
  compare_at_amount_cents?: number;
55
61
  _compute_price_amount?: boolean;
@@ -13,6 +13,10 @@ interface KlarnaPayment extends Resource {
13
13
  client_token?: string;
14
14
  payment_methods?: object[];
15
15
  auth_token?: string;
16
+ mismatched_amounts?: boolean;
17
+ intent_amount_cents?: number;
18
+ intent_amount_float?: number;
19
+ formatted_intent_amount?: string;
16
20
  order?: Order;
17
21
  payment_gateway?: PaymentGateway;
18
22
  }
@@ -5,6 +5,8 @@ import { Customer } from './customers';
5
5
  import { Address } from './addresses';
6
6
  import { PaymentMethod } from './payment_methods';
7
7
  import { CustomerPaymentSource } from './customer_payment_sources';
8
+ import { Sku } from './skus';
9
+ import { Bundle } from './bundles';
8
10
  import { AdyenPayment } from './adyen_payments';
9
11
  import { BraintreePayment } from './braintree_payments';
10
12
  import { CheckoutComPayment } from './checkout_com_payments';
@@ -165,6 +167,8 @@ interface Order extends Resource {
165
167
  billing_address?: Address;
166
168
  available_payment_methods?: PaymentMethod[];
167
169
  available_customer_payment_sources?: CustomerPaymentSource[];
170
+ available_free_skus?: Sku[];
171
+ available_free_bundles?: Bundle[];
168
172
  payment_method?: PaymentMethod;
169
173
  payment_source?: AdyenPayment | BraintreePayment | CheckoutComPayment | ExternalPayment | KlarnaPayment | PaypalPayment | StripePayment | WireTransfer;
170
174
  line_items?: LineItem[];
@@ -224,11 +228,14 @@ interface OrderUpdate extends ResourceUpdate {
224
228
  _capture?: boolean;
225
229
  _refund?: boolean;
226
230
  _update_taxes?: boolean;
231
+ _nullify_payment_source?: boolean;
227
232
  _billing_address_clone_id?: string;
228
233
  _shipping_address_clone_id?: string;
229
234
  _customer_payment_source_id?: string;
230
235
  _shipping_address_same_as_billing?: boolean;
231
236
  _billing_address_same_as_shipping?: boolean;
237
+ _commit_invoice?: boolean;
238
+ _refund_invoice?: boolean;
232
239
  _save_payment_source_to_customer_wallet?: boolean;
233
240
  _save_shipping_address_to_customer_address_book?: boolean;
234
241
  _save_billing_address_to_customer_address_book?: boolean;
package/lib/esm/util.d.ts CHANGED
@@ -1 +1,6 @@
1
- declare const sleep:(ms:number)=>Promise<NodeJS.Timeout>;export{sleep};
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /// <reference types="node" />
4
+ /// <reference types="node" />
5
+ declare const sleep: (ms: number) => Promise<NodeJS.Timeout>;
6
+ export { sleep };