@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.
- package/lib/cjs/api.d.ts +1 -1
- package/lib/cjs/client.js +1 -1
- package/lib/cjs/commercelayer.js +1 -1
- package/lib/cjs/config.d.ts +1 -1
- package/lib/cjs/config.js +1 -1
- package/lib/cjs/error.d.ts +26 -1
- package/lib/cjs/error.js +1 -1
- package/lib/cjs/interceptor.d.ts +19 -1
- package/lib/cjs/model.d.ts +1 -1
- package/lib/cjs/resource.js +1 -1
- package/lib/cjs/resources/avalara_accounts.d.ts +3 -0
- package/lib/cjs/resources/bundles.d.ts +6 -0
- package/lib/cjs/resources/klarna_payments.d.ts +4 -0
- package/lib/cjs/resources/orders.d.ts +7 -0
- package/lib/cjs/util.d.ts +6 -1
- package/lib/esm/api.d.ts +1 -1
- package/lib/esm/client.js +1 -1
- package/lib/esm/commercelayer.js +1 -1
- package/lib/esm/config.d.ts +1 -1
- package/lib/esm/config.js +1 -1
- package/lib/esm/debug.js +1 -1
- package/lib/esm/error.d.ts +26 -1
- package/lib/esm/error.js +1 -1
- package/lib/esm/interceptor.d.ts +19 -1
- package/lib/esm/model.d.ts +1 -1
- package/lib/esm/resource.js +1 -1
- package/lib/esm/resources/avalara_accounts.d.ts +3 -0
- package/lib/esm/resources/bundles.d.ts +6 -0
- package/lib/esm/resources/klarna_payments.d.ts +4 -0
- package/lib/esm/resources/orders.d.ts +7 -0
- package/lib/esm/util.d.ts +6 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/lib/api.d.ts +0 -1
- package/lib/api.js +0 -1
- package/lib/client.d.ts +0 -2
- package/lib/client.js +0 -1
- package/lib/commercelayer.d.ts +0 -1
- package/lib/commercelayer.js +0 -1
- package/lib/common.d.ts +0 -1
- package/lib/common.js +0 -1
- package/lib/config.d.ts +0 -1
- package/lib/config.js +0 -1
- package/lib/debug.d.ts +0 -1
- package/lib/debug.js +0 -1
- package/lib/error.d.ts +0 -1
- package/lib/error.js +0 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/interceptor.d.ts +0 -1
- package/lib/interceptor.js +0 -1
- package/lib/jsonapi.d.ts +0 -1
- package/lib/jsonapi.js +0 -1
- package/lib/model.d.ts +0 -1
- package/lib/model.js +0 -1
- package/lib/query.d.ts +0 -1
- package/lib/query.js +0 -1
- package/lib/resource.d.ts +0 -1
- package/lib/resource.js +0 -1
- package/lib/resources/addresses.d.ts +0 -1
- package/lib/resources/addresses.js +0 -1
- package/lib/resources/adjustments.d.ts +0 -1
- package/lib/resources/adjustments.js +0 -1
- package/lib/resources/adyen_gateways.d.ts +0 -1
- package/lib/resources/adyen_gateways.js +0 -1
- package/lib/resources/adyen_payments.d.ts +0 -1
- package/lib/resources/adyen_payments.js +0 -1
- package/lib/resources/application.d.ts +0 -1
- package/lib/resources/application.js +0 -1
- package/lib/resources/attachments.d.ts +0 -1
- package/lib/resources/attachments.js +0 -1
- package/lib/resources/authorizations.d.ts +0 -1
- package/lib/resources/authorizations.js +0 -1
- package/lib/resources/avalara_accounts.d.ts +0 -1
- package/lib/resources/avalara_accounts.js +0 -1
- package/lib/resources/billing_info_validation_rules.d.ts +0 -1
- package/lib/resources/billing_info_validation_rules.js +0 -1
- package/lib/resources/bing_geocoders.d.ts +0 -1
- package/lib/resources/bing_geocoders.js +0 -1
- package/lib/resources/braintree_gateways.d.ts +0 -1
- package/lib/resources/braintree_gateways.js +0 -1
- package/lib/resources/braintree_payments.d.ts +0 -1
- package/lib/resources/braintree_payments.js +0 -1
- package/lib/resources/bundles.d.ts +0 -1
- package/lib/resources/bundles.js +0 -1
- package/lib/resources/captures.d.ts +0 -1
- package/lib/resources/captures.js +0 -1
- package/lib/resources/carrier_accounts.d.ts +0 -1
- package/lib/resources/carrier_accounts.js +0 -1
- package/lib/resources/checkout_com_gateways.d.ts +0 -1
- package/lib/resources/checkout_com_gateways.js +0 -1
- package/lib/resources/checkout_com_payments.d.ts +0 -1
- package/lib/resources/checkout_com_payments.js +0 -1
- package/lib/resources/coupon_codes_promotion_rules.d.ts +0 -1
- package/lib/resources/coupon_codes_promotion_rules.js +0 -1
- package/lib/resources/coupon_recipients.d.ts +0 -1
- package/lib/resources/coupon_recipients.js +0 -1
- package/lib/resources/coupons.d.ts +0 -1
- package/lib/resources/coupons.js +0 -1
- package/lib/resources/customer_addresses.d.ts +0 -1
- package/lib/resources/customer_addresses.js +0 -1
- package/lib/resources/customer_groups.d.ts +0 -1
- package/lib/resources/customer_groups.js +0 -1
- package/lib/resources/customer_password_resets.d.ts +0 -1
- package/lib/resources/customer_password_resets.js +0 -1
- package/lib/resources/customer_payment_sources.d.ts +0 -1
- package/lib/resources/customer_payment_sources.js +0 -1
- package/lib/resources/customer_subscriptions.d.ts +0 -1
- package/lib/resources/customer_subscriptions.js +0 -1
- package/lib/resources/customers.d.ts +0 -1
- package/lib/resources/customers.js +0 -1
- package/lib/resources/delivery_lead_times.d.ts +0 -1
- package/lib/resources/delivery_lead_times.js +0 -1
- package/lib/resources/event_callbacks.d.ts +0 -1
- package/lib/resources/event_callbacks.js +0 -1
- package/lib/resources/external_gateways.d.ts +0 -1
- package/lib/resources/external_gateways.js +0 -1
- package/lib/resources/external_payments.d.ts +0 -1
- package/lib/resources/external_payments.js +0 -1
- package/lib/resources/external_promotions.d.ts +0 -1
- package/lib/resources/external_promotions.js +0 -1
- package/lib/resources/external_tax_calculators.d.ts +0 -1
- package/lib/resources/external_tax_calculators.js +0 -1
- package/lib/resources/fixed_amount_promotions.d.ts +0 -1
- package/lib/resources/fixed_amount_promotions.js +0 -1
- package/lib/resources/fixed_price_promotions.d.ts +0 -1
- package/lib/resources/fixed_price_promotions.js +0 -1
- package/lib/resources/free_gift_promotions.d.ts +0 -1
- package/lib/resources/free_gift_promotions.js +0 -1
- package/lib/resources/free_shipping_promotions.d.ts +0 -1
- package/lib/resources/free_shipping_promotions.js +0 -1
- package/lib/resources/geocoders.d.ts +0 -1
- package/lib/resources/geocoders.js +0 -1
- package/lib/resources/gift_card_recipients.d.ts +0 -1
- package/lib/resources/gift_card_recipients.js +0 -1
- package/lib/resources/gift_cards.d.ts +0 -1
- package/lib/resources/gift_cards.js +0 -1
- package/lib/resources/google_geocoders.d.ts +0 -1
- package/lib/resources/google_geocoders.js +0 -1
- package/lib/resources/imports.d.ts +0 -1
- package/lib/resources/imports.js +0 -1
- package/lib/resources/in_stock_subscriptions.d.ts +0 -1
- package/lib/resources/in_stock_subscriptions.js +0 -1
- package/lib/resources/inventory_models.d.ts +0 -1
- package/lib/resources/inventory_models.js +0 -1
- package/lib/resources/inventory_return_locations.d.ts +0 -1
- package/lib/resources/inventory_return_locations.js +0 -1
- package/lib/resources/inventory_stock_locations.d.ts +0 -1
- package/lib/resources/inventory_stock_locations.js +0 -1
- package/lib/resources/klarna_gateways.d.ts +0 -1
- package/lib/resources/klarna_gateways.js +0 -1
- package/lib/resources/klarna_payments.d.ts +0 -1
- package/lib/resources/klarna_payments.js +0 -1
- package/lib/resources/line_item_options.d.ts +0 -1
- package/lib/resources/line_item_options.js +0 -1
- package/lib/resources/line_items.d.ts +0 -1
- package/lib/resources/line_items.js +0 -1
- package/lib/resources/manual_gateways.d.ts +0 -1
- package/lib/resources/manual_gateways.js +0 -1
- package/lib/resources/manual_tax_calculators.d.ts +0 -1
- package/lib/resources/manual_tax_calculators.js +0 -1
- package/lib/resources/markets.d.ts +0 -1
- package/lib/resources/markets.js +0 -1
- package/lib/resources/merchants.d.ts +0 -1
- package/lib/resources/merchants.js +0 -1
- package/lib/resources/order_amount_promotion_rules.d.ts +0 -1
- package/lib/resources/order_amount_promotion_rules.js +0 -1
- package/lib/resources/order_copies.d.ts +0 -1
- package/lib/resources/order_copies.js +0 -1
- package/lib/resources/order_subscriptions.d.ts +0 -1
- package/lib/resources/order_subscriptions.js +0 -1
- package/lib/resources/order_validation_rules.d.ts +0 -1
- package/lib/resources/order_validation_rules.js +0 -1
- package/lib/resources/orders.d.ts +0 -1
- package/lib/resources/orders.js +0 -1
- package/lib/resources/organization.d.ts +0 -1
- package/lib/resources/organization.js +0 -1
- package/lib/resources/packages.d.ts +0 -1
- package/lib/resources/packages.js +0 -1
- package/lib/resources/parcel_line_items.d.ts +0 -1
- package/lib/resources/parcel_line_items.js +0 -1
- package/lib/resources/parcels.d.ts +0 -1
- package/lib/resources/parcels.js +0 -1
- package/lib/resources/payment_gateways.d.ts +0 -1
- package/lib/resources/payment_gateways.js +0 -1
- package/lib/resources/payment_methods.d.ts +0 -1
- package/lib/resources/payment_methods.js +0 -1
- package/lib/resources/paypal_gateways.d.ts +0 -1
- package/lib/resources/paypal_gateways.js +0 -1
- package/lib/resources/paypal_payments.d.ts +0 -1
- package/lib/resources/paypal_payments.js +0 -1
- package/lib/resources/percentage_discount_promotions.d.ts +0 -1
- package/lib/resources/percentage_discount_promotions.js +0 -1
- package/lib/resources/price_lists.d.ts +0 -1
- package/lib/resources/price_lists.js +0 -1
- package/lib/resources/prices.d.ts +0 -1
- package/lib/resources/prices.js +0 -1
- package/lib/resources/promotion_rules.d.ts +0 -1
- package/lib/resources/promotion_rules.js +0 -1
- package/lib/resources/promotions.d.ts +0 -1
- package/lib/resources/promotions.js +0 -1
- package/lib/resources/refunds.d.ts +0 -1
- package/lib/resources/refunds.js +0 -1
- package/lib/resources/return_line_items.d.ts +0 -1
- package/lib/resources/return_line_items.js +0 -1
- package/lib/resources/returns.d.ts +0 -1
- package/lib/resources/returns.js +0 -1
- package/lib/resources/shipments.d.ts +0 -1
- package/lib/resources/shipments.js +0 -1
- package/lib/resources/shipping_categories.d.ts +0 -1
- package/lib/resources/shipping_categories.js +0 -1
- package/lib/resources/shipping_methods.d.ts +0 -1
- package/lib/resources/shipping_methods.js +0 -1
- package/lib/resources/shipping_zones.d.ts +0 -1
- package/lib/resources/shipping_zones.js +0 -1
- package/lib/resources/sku_list_items.d.ts +0 -1
- package/lib/resources/sku_list_items.js +0 -1
- package/lib/resources/sku_list_promotion_rules.d.ts +0 -1
- package/lib/resources/sku_list_promotion_rules.js +0 -1
- package/lib/resources/sku_lists.d.ts +0 -1
- package/lib/resources/sku_lists.js +0 -1
- package/lib/resources/sku_options.d.ts +0 -1
- package/lib/resources/sku_options.js +0 -1
- package/lib/resources/skus.d.ts +0 -1
- package/lib/resources/skus.js +0 -1
- package/lib/resources/stock_items.d.ts +0 -1
- package/lib/resources/stock_items.js +0 -1
- package/lib/resources/stock_line_items.d.ts +0 -1
- package/lib/resources/stock_line_items.js +0 -1
- package/lib/resources/stock_locations.d.ts +0 -1
- package/lib/resources/stock_locations.js +0 -1
- package/lib/resources/stock_transfers.d.ts +0 -1
- package/lib/resources/stock_transfers.js +0 -1
- package/lib/resources/stripe_gateways.d.ts +0 -1
- package/lib/resources/stripe_gateways.js +0 -1
- package/lib/resources/stripe_payments.d.ts +0 -1
- package/lib/resources/stripe_payments.js +0 -1
- package/lib/resources/tax_calculators.d.ts +0 -1
- package/lib/resources/tax_calculators.js +0 -1
- package/lib/resources/tax_categories.d.ts +0 -1
- package/lib/resources/tax_categories.js +0 -1
- package/lib/resources/tax_rules.d.ts +0 -1
- package/lib/resources/tax_rules.js +0 -1
- package/lib/resources/taxjar_accounts.d.ts +0 -1
- package/lib/resources/taxjar_accounts.js +0 -1
- package/lib/resources/transactions.d.ts +0 -1
- package/lib/resources/transactions.js +0 -1
- package/lib/resources/voids.d.ts +0 -1
- package/lib/resources/voids.js +0 -1
- package/lib/resources/webhooks.d.ts +0 -1
- package/lib/resources/webhooks.js +0 -1
- package/lib/resources/wire_transfers.d.ts +0 -1
- package/lib/resources/wire_transfers.js +0 -1
- package/lib/static.d.ts +0 -1
- package/lib/static.js +0 -1
- package/lib/util.d.ts +0 -2
- package/lib/util.js +0 -1
package/lib/cjs/api.d.ts
CHANGED
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(!
|
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;
|
package/lib/cjs/commercelayer.js
CHANGED
@@ -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;
|
package/lib/cjs/config.d.ts
CHANGED
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:
|
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;
|
package/lib/cjs/error.d.ts
CHANGED
@@ -1 +1,26 @@
|
|
1
|
-
declare enum 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)
|
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;
|
package/lib/cjs/interceptor.d.ts
CHANGED
@@ -1 +1,19 @@
|
|
1
|
-
import{AxiosError,AxiosInterceptorManager,AxiosRequestConfig,AxiosResponse}from"axios";
|
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 };
|
package/lib/cjs/model.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* ©2022 Commerce Layer Inc.
|
3
|
-
* OpenAPI schema, version 2.9.
|
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';
|
package/lib/cjs/resource.js
CHANGED
@@ -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||[])
|
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
|
-
|
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
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(!
|
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;
|
package/lib/esm/commercelayer.js
CHANGED
@@ -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
|
+
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;
|
package/lib/esm/config.d.ts
CHANGED
package/lib/esm/config.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
const e={default:{domain:"commercelayer.io",pageNumber:1,pageSize:10},client:{timeout:
|
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
|
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;
|
package/lib/esm/error.d.ts
CHANGED
@@ -1 +1,26 @@
|
|
1
|
-
declare enum 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
|
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};
|
package/lib/esm/interceptor.d.ts
CHANGED
@@ -1 +1,19 @@
|
|
1
|
-
import{AxiosError,AxiosInterceptorManager,AxiosRequestConfig,AxiosResponse}from"axios";
|
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 };
|
package/lib/esm/model.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* ©2022 Commerce Layer Inc.
|
3
|
-
* OpenAPI schema, version 2.9.
|
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';
|
package/lib/esm/resource.js
CHANGED
@@ -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||[])
|
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
|
-
|
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 };
|