@commercelayer/sdk 3.0.0 → 4.0.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/client.d.ts +1 -5
- package/lib/cjs/client.js +1 -1
- package/lib/cjs/commercelayer.d.ts +1 -0
- 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/debug.d.ts +3 -0
- package/lib/cjs/debug.js +1 -0
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/jsonapi.js +1 -1
- package/lib/cjs/query.js +1 -1
- package/lib/cjs/resource.d.ts +4 -2
- package/lib/cjs/resource.js +1 -1
- package/lib/cjs/resources/adyen_payments.d.ts +1 -1
- package/lib/cjs/resources/attachments.d.ts +1 -1
- package/lib/cjs/resources/billing_info_validation_rules.d.ts +1 -1
- package/lib/cjs/resources/braintree_payments.d.ts +1 -1
- package/lib/cjs/resources/bundles.d.ts +1 -1
- package/lib/cjs/resources/checkout_com_payments.d.ts +1 -1
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +1 -1
- package/lib/cjs/resources/coupons.d.ts +1 -1
- package/lib/cjs/resources/customer_addresses.d.ts +2 -2
- package/lib/cjs/resources/customer_payment_sources.d.ts +2 -2
- package/lib/cjs/resources/delivery_lead_times.d.ts +2 -2
- package/lib/cjs/resources/delivery_lead_times.js +1 -1
- package/lib/cjs/resources/external_payments.d.ts +1 -1
- package/lib/cjs/resources/fixed_price_promotions.d.ts +1 -1
- package/lib/cjs/resources/free_gift_promotions.d.ts +1 -1
- package/lib/cjs/resources/in_stock_subscriptions.d.ts +3 -3
- package/lib/cjs/resources/inventory_return_locations.d.ts +2 -2
- package/lib/cjs/resources/inventory_stock_locations.d.ts +2 -2
- package/lib/cjs/resources/line_item_options.d.ts +2 -2
- package/lib/cjs/resources/line_items.d.ts +1 -1
- package/lib/cjs/resources/markets.d.ts +3 -3
- package/lib/cjs/resources/merchants.d.ts +1 -1
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +1 -1
- package/lib/cjs/resources/order_copies.d.ts +1 -1
- package/lib/cjs/resources/order_subscriptions.d.ts +1 -1
- package/lib/cjs/resources/packages.d.ts +1 -1
- package/lib/cjs/resources/parcel_line_items.d.ts +2 -2
- package/lib/cjs/resources/parcels.d.ts +2 -2
- package/lib/cjs/resources/payment_methods.d.ts +2 -2
- package/lib/cjs/resources/paypal_payments.d.ts +1 -1
- package/lib/cjs/resources/prices.d.ts +1 -1
- package/lib/cjs/resources/return_line_items.d.ts +2 -2
- package/lib/cjs/resources/returns.d.ts +1 -1
- package/lib/cjs/resources/shipping_methods.d.ts +3 -3
- package/lib/cjs/resources/sku_list_items.d.ts +2 -2
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +1 -1
- package/lib/cjs/resources/sku_options.d.ts +1 -1
- package/lib/cjs/resources/skus.d.ts +1 -1
- package/lib/cjs/resources/stock_items.d.ts +1 -1
- package/lib/cjs/resources/stock_locations.d.ts +1 -1
- package/lib/cjs/resources/stock_transfers.d.ts +3 -3
- package/lib/cjs/resources/stripe_payments.d.ts +1 -1
- package/lib/cjs/resources/tax_categories.d.ts +2 -2
- package/lib/cjs/resources/tax_rules.d.ts +1 -1
- package/lib/cjs/resources/wire_transfers.d.ts +1 -1
- package/lib/cjs/static.js +1 -1
- package/lib/esm/client.d.ts +1 -5
- package/lib/esm/client.js +1 -1
- package/lib/esm/commercelayer.d.ts +1 -0
- package/lib/esm/commercelayer.js +1 -1
- package/lib/esm/common.js +1 -1
- package/lib/esm/config.d.ts +1 -1
- package/lib/esm/config.js +1 -1
- package/lib/esm/debug.d.ts +3 -0
- package/lib/esm/debug.js +1 -0
- package/lib/esm/error.js +1 -1
- package/lib/esm/jsonapi.js +1 -1
- package/lib/esm/query.js +1 -1
- package/lib/esm/resource.d.ts +4 -2
- package/lib/esm/resource.js +1 -1
- package/lib/esm/resources/addresses.js +1 -1
- package/lib/esm/resources/adjustments.js +1 -1
- package/lib/esm/resources/adyen_gateways.js +1 -1
- package/lib/esm/resources/adyen_payments.d.ts +1 -1
- package/lib/esm/resources/adyen_payments.js +1 -1
- package/lib/esm/resources/application.js +1 -1
- package/lib/esm/resources/attachments.d.ts +1 -1
- package/lib/esm/resources/authorizations.js +1 -1
- package/lib/esm/resources/avalara_accounts.js +1 -1
- package/lib/esm/resources/billing_info_validation_rules.d.ts +1 -1
- package/lib/esm/resources/billing_info_validation_rules.js +1 -1
- package/lib/esm/resources/bing_geocoders.js +1 -1
- package/lib/esm/resources/braintree_gateways.js +1 -1
- package/lib/esm/resources/braintree_payments.d.ts +1 -1
- package/lib/esm/resources/braintree_payments.js +1 -1
- package/lib/esm/resources/bundles.d.ts +1 -1
- package/lib/esm/resources/bundles.js +1 -1
- package/lib/esm/resources/captures.js +1 -1
- package/lib/esm/resources/carrier_accounts.js +1 -1
- package/lib/esm/resources/checkout_com_payments.d.ts +1 -1
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +1 -1
- package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -1
- package/lib/esm/resources/coupon_recipients.js +1 -1
- package/lib/esm/resources/coupons.d.ts +1 -1
- package/lib/esm/resources/coupons.js +1 -1
- package/lib/esm/resources/customer_addresses.d.ts +2 -2
- package/lib/esm/resources/customer_addresses.js +1 -1
- package/lib/esm/resources/customer_groups.js +1 -1
- package/lib/esm/resources/customer_password_resets.js +1 -1
- package/lib/esm/resources/customer_payment_sources.d.ts +2 -2
- package/lib/esm/resources/customer_payment_sources.js +1 -1
- package/lib/esm/resources/customer_subscriptions.js +1 -1
- package/lib/esm/resources/customers.js +1 -1
- package/lib/esm/resources/delivery_lead_times.d.ts +2 -2
- package/lib/esm/resources/delivery_lead_times.js +1 -1
- package/lib/esm/resources/event_callbacks.js +1 -1
- package/lib/esm/resources/external_payments.d.ts +1 -1
- package/lib/esm/resources/external_promotions.js +1 -1
- package/lib/esm/resources/fixed_price_promotions.d.ts +1 -1
- package/lib/esm/resources/fixed_price_promotions.js +1 -1
- package/lib/esm/resources/free_gift_promotions.d.ts +1 -1
- package/lib/esm/resources/free_gift_promotions.js +1 -1
- package/lib/esm/resources/free_shipping_promotions.js +1 -1
- package/lib/esm/resources/geocoders.js +1 -1
- package/lib/esm/resources/gift_cards.js +1 -1
- package/lib/esm/resources/google_geocoders.js +1 -1
- package/lib/esm/resources/imports.js +1 -1
- package/lib/esm/resources/in_stock_subscriptions.d.ts +3 -3
- package/lib/esm/resources/in_stock_subscriptions.js +1 -1
- package/lib/esm/resources/inventory_models.js +1 -1
- package/lib/esm/resources/inventory_return_locations.d.ts +2 -2
- package/lib/esm/resources/inventory_stock_locations.d.ts +2 -2
- package/lib/esm/resources/inventory_stock_locations.js +1 -1
- package/lib/esm/resources/line_item_options.d.ts +2 -2
- package/lib/esm/resources/line_item_options.js +1 -1
- package/lib/esm/resources/line_items.d.ts +1 -1
- package/lib/esm/resources/line_items.js +1 -1
- package/lib/esm/resources/manual_gateways.js +1 -1
- package/lib/esm/resources/manual_tax_calculators.js +1 -1
- package/lib/esm/resources/markets.d.ts +3 -3
- package/lib/esm/resources/markets.js +1 -1
- package/lib/esm/resources/merchants.d.ts +1 -1
- package/lib/esm/resources/merchants.js +1 -1
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +1 -1
- package/lib/esm/resources/order_amount_promotion_rules.js +1 -1
- package/lib/esm/resources/order_copies.d.ts +1 -1
- package/lib/esm/resources/order_copies.js +1 -1
- package/lib/esm/resources/order_subscriptions.d.ts +1 -1
- package/lib/esm/resources/order_subscriptions.js +1 -1
- package/lib/esm/resources/order_validation_rules.js +1 -1
- package/lib/esm/resources/orders.js +1 -1
- package/lib/esm/resources/organization.js +1 -1
- package/lib/esm/resources/packages.d.ts +1 -1
- package/lib/esm/resources/packages.js +1 -1
- package/lib/esm/resources/parcel_line_items.d.ts +2 -2
- package/lib/esm/resources/parcel_line_items.js +1 -1
- package/lib/esm/resources/parcels.d.ts +2 -2
- package/lib/esm/resources/parcels.js +1 -1
- package/lib/esm/resources/payment_gateways.js +1 -1
- package/lib/esm/resources/payment_methods.d.ts +2 -2
- package/lib/esm/resources/paypal_gateways.js +1 -1
- package/lib/esm/resources/paypal_payments.d.ts +1 -1
- package/lib/esm/resources/paypal_payments.js +1 -1
- package/lib/esm/resources/price_lists.js +1 -1
- package/lib/esm/resources/prices.d.ts +1 -1
- package/lib/esm/resources/prices.js +1 -1
- package/lib/esm/resources/promotion_rules.js +1 -1
- package/lib/esm/resources/promotions.js +1 -1
- package/lib/esm/resources/refunds.js +1 -1
- package/lib/esm/resources/return_line_items.d.ts +2 -2
- package/lib/esm/resources/returns.d.ts +1 -1
- package/lib/esm/resources/returns.js +1 -1
- package/lib/esm/resources/shipments.js +1 -1
- package/lib/esm/resources/shipping_categories.js +1 -1
- package/lib/esm/resources/shipping_methods.d.ts +3 -3
- package/lib/esm/resources/shipping_methods.js +1 -1
- package/lib/esm/resources/shipping_zones.js +1 -1
- package/lib/esm/resources/sku_list_items.d.ts +2 -2
- package/lib/esm/resources/sku_list_items.js +1 -1
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +1 -1
- package/lib/esm/resources/sku_list_promotion_rules.js +1 -1
- package/lib/esm/resources/sku_lists.js +1 -1
- package/lib/esm/resources/sku_options.d.ts +1 -1
- package/lib/esm/resources/sku_options.js +1 -1
- package/lib/esm/resources/skus.d.ts +1 -1
- package/lib/esm/resources/skus.js +1 -1
- package/lib/esm/resources/stock_items.d.ts +1 -1
- package/lib/esm/resources/stock_items.js +1 -1
- package/lib/esm/resources/stock_line_items.js +1 -1
- package/lib/esm/resources/stock_locations.d.ts +1 -1
- package/lib/esm/resources/stock_locations.js +1 -1
- package/lib/esm/resources/stock_transfers.d.ts +3 -3
- package/lib/esm/resources/stock_transfers.js +1 -1
- package/lib/esm/resources/stripe_gateways.js +1 -1
- package/lib/esm/resources/stripe_payments.d.ts +1 -1
- package/lib/esm/resources/stripe_payments.js +1 -1
- package/lib/esm/resources/tax_calculators.js +1 -1
- package/lib/esm/resources/tax_categories.d.ts +2 -2
- package/lib/esm/resources/tax_categories.js +1 -1
- package/lib/esm/resources/tax_rules.d.ts +1 -1
- package/lib/esm/resources/tax_rules.js +1 -1
- package/lib/esm/resources/taxjar_accounts.js +1 -1
- package/lib/esm/resources/transactions.js +1 -1
- package/lib/esm/resources/voids.js +1 -1
- package/lib/esm/resources/webhooks.js +1 -1
- package/lib/esm/resources/wire_transfers.d.ts +1 -1
- package/lib/esm/resources/wire_transfers.js +1 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
@@ -22,8 +22,8 @@ interface SkuListItemCreate extends ResourceCreate {
|
|
22
22
|
position?: number;
|
23
23
|
sku_code?: string;
|
24
24
|
quantity?: number;
|
25
|
-
sku_list
|
26
|
-
sku
|
25
|
+
sku_list: SkuListRel;
|
26
|
+
sku: SkuRel;
|
27
27
|
}
|
28
28
|
interface SkuListItemUpdate extends ResourceUpdate {
|
29
29
|
position?: number;
|
@@ -42,7 +42,7 @@ interface SkuListPromotionRule extends Resource {
|
|
42
42
|
interface SkuListPromotionRuleCreate extends ResourceCreate {
|
43
43
|
all_skus?: boolean;
|
44
44
|
min_quantity?: number;
|
45
|
-
promotion
|
45
|
+
promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FixedAmountPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel;
|
46
46
|
sku_list?: SkuListRel;
|
47
47
|
}
|
48
48
|
interface SkuListPromotionRuleUpdate extends ResourceUpdate {
|
@@ -42,7 +42,7 @@ interface SkuCreate extends ResourceCreate {
|
|
42
42
|
hs_tariff_number?: string;
|
43
43
|
do_not_ship?: boolean;
|
44
44
|
do_not_track?: boolean;
|
45
|
-
shipping_category
|
45
|
+
shipping_category: ShippingCategoryRel;
|
46
46
|
}
|
47
47
|
interface SkuUpdate extends ResourceUpdate {
|
48
48
|
code?: string;
|
@@ -22,7 +22,7 @@ interface StockItem extends Resource {
|
|
22
22
|
interface StockItemCreate extends ResourceCreate {
|
23
23
|
sku_code?: string;
|
24
24
|
quantity: number;
|
25
|
-
stock_location
|
25
|
+
stock_location: StockLocationRel;
|
26
26
|
sku?: SkuRel;
|
27
27
|
}
|
28
28
|
interface StockItemUpdate extends ResourceUpdate {
|
@@ -34,9 +34,9 @@ interface StockTransfer extends Resource {
|
|
34
34
|
interface StockTransferCreate extends ResourceCreate {
|
35
35
|
sku_code?: string;
|
36
36
|
quantity: number;
|
37
|
-
sku
|
38
|
-
origin_stock_location
|
39
|
-
destination_stock_location
|
37
|
+
sku: SkuRel;
|
38
|
+
origin_stock_location: StockLocationRel;
|
39
|
+
destination_stock_location: StockLocationRel;
|
40
40
|
shipment?: ShipmentRel;
|
41
41
|
line_item?: LineItemRel;
|
42
42
|
}
|
@@ -34,8 +34,8 @@ interface TaxCategory extends Resource {
|
|
34
34
|
interface TaxCategoryCreate extends ResourceCreate {
|
35
35
|
code: string;
|
36
36
|
sku_code?: string;
|
37
|
-
sku
|
38
|
-
tax_calculator
|
37
|
+
sku: SkuRel;
|
38
|
+
tax_calculator: AvalaraAccountRel | TaxjarAccountRel | ManualTaxCalculatorRel | ExternalTaxCalculatorRel;
|
39
39
|
}
|
40
40
|
interface TaxCategoryUpdate extends ResourceUpdate {
|
41
41
|
code?: string;
|
@@ -36,7 +36,7 @@ interface TaxRuleCreate extends ResourceCreate {
|
|
36
36
|
payment_method_taxable?: boolean;
|
37
37
|
gift_card_taxable?: boolean;
|
38
38
|
adjustment_taxable?: boolean;
|
39
|
-
manual_tax_calculator
|
39
|
+
manual_tax_calculator: ManualTaxCalculatorRel;
|
40
40
|
}
|
41
41
|
interface TaxRuleUpdate extends ResourceUpdate {
|
42
42
|
name?: string;
|
package/lib/cjs/static.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(r,
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,i){i===void 0&&(i=t),Object.defineProperty(e,i,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,i){i===void 0&&(i=t),e[i]=r[t]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&__createBinding(r,e,t);return __setModuleDefault(r,e),r};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommerceLayerStatic=void 0;const api=__importStar(require("./api")),error_1=require("./error");exports.CommerceLayerStatic={resources:()=>api.resourceList,isSdkError:e=>error_1.SdkError.isSdkError(e),isApiError:e=>error_1.ApiError.isApiError(e)};
|
package/lib/esm/client.d.ts
CHANGED
@@ -12,11 +12,7 @@ declare type ApiClientInitConfig = {
|
|
12
12
|
domain?: string;
|
13
13
|
accessToken: string;
|
14
14
|
} & RequestConfig;
|
15
|
-
declare type ApiClientConfig =
|
16
|
-
organization?: string;
|
17
|
-
domain?: string;
|
18
|
-
accessToken?: string;
|
19
|
-
} & RequestConfig;
|
15
|
+
declare type ApiClientConfig = Partial<ApiClientInitConfig>;
|
20
16
|
declare class ApiClient {
|
21
17
|
#private;
|
22
18
|
static create(options: ApiClientInitConfig): ApiClient;
|
package/lib/esm/client.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var
|
1
|
+
var u=this&&this.__classPrivateFieldSet||function(a,e,t,s,r){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?a!==e||!r:!e.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?r.call(a,t):r?r.value=t:e.set(a,t),t},n=this&&this.__classPrivateFieldGet||function(a,e,t,s){if(t==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?a!==e||!s:!e.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?s:t==="a"?s.call(a):s?s.value:e.get(a)},i,o;import h from"axios";import{SdkError as y,ApiError as C,ErrorType as c}from"./error";import m from"./config";import _ from"./debug";const d=_(),f=(a,e)=>`https://${a.toLowerCase()}.${e||m.default.domain}/api`,z=a=>{let e=new y({message:a.message,type:c.GENERIC});if(h.isAxiosError(a))if(a.response){const t=new C(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 w{constructor(e){i.set(this,void 0),o.set(this,void 0),d("new client instance %O",e),this.baseUrl=f(e.organization,e.domain),u(this,i,e.accessToken,"f");const t={timeout:e.timeout||m.client.timeout},s=Object.assign({baseURL:this.baseUrl,timeout:m.client.timeout,headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json",Authorization:"Bearer "+n(this,i,"f")}},t);d("axios options: %O",s),u(this,o,h.create(s),"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 w(e)}config(e){d("config %o",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&&(u(this,i,e.accessToken,"f"),t.headers.common.Authorization="Bearer "+n(this,i,"f"))}async request(e,t,s,r){d("request %s %s, %O, %O",e,t,s||{},r||{});const v=s?{data:s}:void 0,T=t,b=(r==null?void 0:r.organization)?f(r.organization,r.domain):void 0,p=(r==null?void 0:r.accessToken)||n(this,i,"f"),g=p?{Authorization:"Bearer "+p}:void 0,E=Object.assign({method:e,baseURL:b,url:T,data:v,headers:g},r);return d("request params: %O",E),n(this,o,"f").request(E).then(l=>l.data).catch(l=>z(l))}}i=new WeakMap,o=new WeakMap;export default w;
|
@@ -105,6 +105,7 @@ declare class CommerceLayerClient {
|
|
105
105
|
wire_transfers: api.WireTransfers;
|
106
106
|
constructor(config: CommerceLayerInitConfig);
|
107
107
|
get currentOrganization(): string;
|
108
|
+
private localConfig;
|
108
109
|
config(config: CommerceLayerConfig): void;
|
109
110
|
resources(): readonly string[];
|
110
111
|
isApiError(error: any): error is ApiError;
|
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 f}from"./static";import
|
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 f}from"./static";import u from"./resource";import p from"./debug";const w=p(),m="2.7.6";class l{constructor(i){t.set(this,void 0),h.set(this,void 0),w("new commercelayer instance %O",i),c(this,t,new u(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.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 m}get currentOrganization(){return s(this,h,"f")}localConfig(i){i.organization&&c(this,h,i.organization,"f")}config(i){w("config %o",i),this.localConfig(i),s(this,t,"f").config(i)}resources(){return f.resources()}isApiError(i){return f.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 _=o=>new l(o);export default _;
|
package/lib/esm/common.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{resourceList as
|
1
|
+
import{resourceList as e}from"./api";const p=s=>s&&s.type&&s.id&&e.includes(s.type),t=s=>s&&typeof s.type!="undefined"&&s.type&&e.includes(s.type);export{p as isResourceId,t as isResourceType};
|
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
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
const a=(e,...r)=>{};let t=e=>a;try{const e=require("debug");e&&typeof e=="function"&&(t=e)}catch{}const n="clsdk",o=()=>{const e=new Error;Error.prepareStackTrace=(d,c)=>c;const r=e.stack;return Error.prepareStackTrace=void 0,(r[2].getFileName()||"/").replace(/^.*[\\/]/,"").replace(".ts","")},s=e=>t(`${n}:${e||o()}`);export default s;
|
package/lib/esm/error.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var
|
1
|
+
var s;(function(e){e.CLIENT="client",e.REQUEST="request",e.RESPONSE="response",e.GENERIC="generic",e.CANCEL="cancel"})(s||(s={}));class t extends Error{constructor(r){super(r.message);this.name=this.constructor.name,this.type=r.type||s.GENERIC}static isSdkError(r){return r&&["SdkError","ApiError"].includes(r.name)&&Object.values(s).includes(r.type)}}class i extends t{constructor(r){super(Object.assign(Object.assign({},r),{type:s.RESPONSE}));this.errors=[],this.name=this.constructor.name}static isApiError(r){return t.isSdkError(r)&&r.name==="ApiError"&&r.type===s.RESPONSE}first(){var r;return((r=this.errors)===null||r===void 0?void 0:r.length)>0?this.errors[0]:void 0}}export{t as SdkError,i as ApiError,s as ErrorType};
|
package/lib/esm/jsonapi.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{isResourceId as
|
1
|
+
import{isResourceId as i}from"./common";import c from"./debug";const a=c(),p=r=>{let s;r.links&&delete r.links;const e=r.data,n=r.included;return Array.isArray(e)?s=e.map(t=>d(t,n)):s=d(e,n),s},l=(r,s=[])=>s.find(e=>r.id===e.id&&r.type===e.type)||r,d=(r,s)=>{a("denormalize resource: %O, %o",r,s||{});const e=Object.assign({id:r.id,type:r.type},r.attributes);return r.relationships&&Object.keys(r.relationships).forEach(n=>{const t=r.relationships[n].data;t?Array.isArray(t)?e[n]=t.map(o=>d(l(o,s),s)):e[n]=d(l(t,s),s):t===null&&(e[n]=null)}),a("denormalized resource: %O",e),e},u=r=>{a("normalize resource: %O",r);const s={},e={};for(const t in r){if(["type","id"].includes(t))continue;const o=r[t];o&&(i(o)||Array.isArray(o)&&i(o[0]))?e[t]={data:o}:s[t]=o}const n={type:r.type,attributes:s,relationships:e};return i(r)&&(n.id=r.id),a("normalized resource: %O",n),n};export{p as denormalize,u as normalize};
|
package/lib/esm/query.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
const r
|
1
|
+
import n from"./debug";const a=n(),o=r=>r.filters||r.pageNumber||r.pageSize||r.sort,g=(r,e)=>{a("generate query string params: %O, %O",r,e);const i={};return r&&(r.include&&(i.include=r.include.join(",")),r.fields&&(Array.isArray(r.fields)&&(r.fields={[e.type]:r.fields}),Object.entries(r.fields).forEach(([s,t])=>{i[`fields[${s}]`]=t.join(",")})),o(r)&&(r.sort&&(Array.isArray(r.sort)?i.sort=r.sort.join(","):i.sort=Object.entries(r.sort).map(([s,t])=>`${t==="desc"?"-":""}${s}`).join(",")),r.pageNumber&&(i["page[number]"]=String(r.pageNumber)),r.pageSize&&(i["page[size]"]=String(r.pageSize)),r.filters&&Object.entries(r.filters).forEach(([s,t])=>{i[`filter[q][${s}]`]=String(t)})),a("query string params: %O",i)),i};export{g as generateQueryStringParams};
|
package/lib/esm/resource.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { ApiClientInitConfig } from './client';
|
2
2
|
import { QueryParamsRetrieve, QueryParamsList } from './query';
|
3
3
|
import { ResourceTypeLock } from './api';
|
4
4
|
import { InterceptorManager } from './interceptor';
|
@@ -46,11 +46,12 @@ declare class ListResponse<R> extends Array<R> {
|
|
46
46
|
export type { Metadata, ResourceType, ResourceId, Resource, ResourceCreate, ResourceUpdate, ListResponse };
|
47
47
|
declare type ResourceAdapterConfig = {};
|
48
48
|
declare type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig;
|
49
|
-
declare type ResourcesConfig =
|
49
|
+
declare type ResourcesConfig = Partial<ResourcesInitConfig>;
|
50
50
|
declare class ResourceAdapter {
|
51
51
|
#private;
|
52
52
|
constructor(config: ResourcesInitConfig);
|
53
53
|
get interceptors(): InterceptorManager;
|
54
|
+
private localConfig;
|
54
55
|
config(config: ResourcesConfig): void;
|
55
56
|
singleton<R extends Resource>(resource: ResourceType, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
|
56
57
|
retrieve<R extends Resource>(resource: ResourceId, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
|
@@ -64,6 +65,7 @@ declare abstract class ApiResource {
|
|
64
65
|
protected resources: ResourceAdapter;
|
65
66
|
constructor(adapter: ResourceAdapter);
|
66
67
|
abstract relationship(id: string | ResourceId): ResourceId;
|
68
|
+
abstract type(): string;
|
67
69
|
}
|
68
70
|
export default ResourceAdapter;
|
69
71
|
export { ApiResource, ResourcesConfig, ResourcesInitConfig };
|
package/lib/esm/resource.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var
|
1
|
+
var w=this&&this.__classPrivateFieldSet||function(a,t,s,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"?a!==t||!r:!t.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e==="a"?r.call(a,s):r?r.value=s:t.set(a,s),s},n=this&&this.__classPrivateFieldGet||function(a,t,s,e){if(s==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?a!==t||!e:!t.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?e:s==="a"?e.call(a):e?e.value:t.get(a)},o,g;import O from"./client";import{denormalize as u,normalize as h}from"./jsonapi";import{generateQueryStringParams as d}from"./query";import m from"./config";import b from"./debug";const c=b();class y extends Array{constructor(t,s){super(...s||[]);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 j{constructor(t){o.set(this,void 0),g.set(this,{}),w(this,o,O.create(t),"f"),this.localConfig(t)}get interceptors(){return n(this,o,"f").interceptors}localConfig(t){}config(t){c("config %o",t),this.localConfig(t),n(this,o,"f").config(t)}async singleton(t,s,e){c("singleton: %o, %O, %O",t,s||{},e||{});const r=d(s,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=await n(this,o,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async retrieve(t,s,e){c("retrieve: %o, %O, %O",t,s||{},e||{});const r=d(s,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=await n(this,o,"f").request("get",`${t.type}/${t.id}`,void 0,Object.assign(Object.assign({},e),{params:r}));return u(i)}async list(t,s,e){var r,i;c("list: %o, %O, %O",t,s||{},e||{});const l=d(s,t);(e==null?void 0:e.params)&&Object.assign(l,e==null?void 0:e.params);const p=await n(this,o,"f").request("get",`${t.type}`,void 0,Object.assign(Object.assign({},e),{params:l})),f=u(p),v={pageCount:Number((r=p.meta)===null||r===void 0?void 0:r.page_count),recordCount:Number((i=p.meta)===null||i===void 0?void 0:i.record_count),currentPage:(s==null?void 0:s.pageNumber)||m.default.pageNumber,recordsPerPage:(s==null?void 0:s.pageSize)||m.default.pageSize};return new y(v,f)}async create(t,s,e){c("create: %o, %O, %O",t,s||{},e||{});const r=d(s,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=h(t),l=await n(this,o,"f").request("post",t.type,i,Object.assign(Object.assign({},e),{params:r}));return u(l)}async update(t,s,e){c("update: %o, %O, %O",t,s||{},e||{});const r=d(s,t);(e==null?void 0:e.params)&&Object.assign(r,e==null?void 0:e.params);const i=h(t),l=await n(this,o,"f").request("patch",`${t.type}/${t.id}`,i,Object.assign(Object.assign({},e),{params:r}));return u(l)}async delete(t,s){c("delete: %o, %O",t,s||{}),await n(this,o,"f").request("delete",`${t.type}/${t.id}`,void 0,s)}}o=new WeakMap,g=new WeakMap;class P{constructor(t){c("new resource instance: %s",this.type()),this.resources=t}}export default j;export{P as ApiResource};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isAddress(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="addresses";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class s extends i{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}isAdjustment(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="adjustments";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isAdyenGateway(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="adyen_gateways";export default t;
|
@@ -18,7 +18,7 @@ interface AdyenPayment extends Resource {
|
|
18
18
|
payment_gateway?: PaymentGateway;
|
19
19
|
}
|
20
20
|
interface AdyenPaymentCreate extends ResourceCreate {
|
21
|
-
order
|
21
|
+
order: OrderRel;
|
22
22
|
}
|
23
23
|
interface AdyenPaymentUpdate extends ResourceUpdate {
|
24
24
|
payment_request_data?: object;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isAdyenPayment(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="adyen_payments";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as p}from"../resource";class e extends p{async retrieve(t,i){return this.resources.singleton({type:e.TYPE},t,i)}isApplication(t){return t.type&&t.type===e.TYPE}relationship(t){return typeof t=="string"?{id:t,type:e.TYPE}:{id:t.id,type:e.TYPE}}type(){return e.TYPE}}e.TYPE="application";export default e;
|
@@ -133,7 +133,7 @@ interface AttachmentCreate extends ResourceCreate {
|
|
133
133
|
name: string;
|
134
134
|
description?: string;
|
135
135
|
url?: string;
|
136
|
-
attachable
|
136
|
+
attachable: BundleRel | CarrierAccountRel | CustomerGroupRel | CustomerRel | DeliveryLeadTimeRel | GeocoderRel | GiftCardRecipientRel | GiftCardRel | InventoryModelRel | MarketRel | MerchantRel | BillingInfoValidationRuleRel | OrderRel | PackageRel | ParcelRel | PaymentMethodRel | PriceListRel | PriceRel | PromotionRel | ReturnRel | ShipmentRel | ShippingCategoryRel | ShippingMethodRel | ShippingZoneRel | SkuOptionRel | SkuRel | StockItemRel | StockLocationRel | TaxCalculatorRel | TaxCategoryRel;
|
137
137
|
}
|
138
138
|
interface AttachmentUpdate extends ResourceUpdate {
|
139
139
|
name?: string;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as r}from"../resource";class e extends r{async list(t,s){return this.resources.list({type:e.TYPE},t,s)}async retrieve(t,s,i){return this.resources.retrieve({type:e.TYPE,id:t},s,i)}async update(t,s,i){return this.resources.update(Object.assign(Object.assign({},t),{type:e.TYPE}),s,i)}isAuthorization(t){return t.type&&t.type===e.TYPE}relationship(t){return typeof t=="string"?{id:t,type:e.TYPE}:{id:t.id,type:e.TYPE}}type(){return e.TYPE}}e.TYPE="authorizations";export default e;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as a}from"../resource";class
|
1
|
+
import{ApiResource as a}from"../resource";class t extends a{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isAvalaraAccount(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="avalara_accounts";export default t;
|
@@ -11,7 +11,7 @@ interface BillingInfoValidationRule extends Resource {
|
|
11
11
|
market?: Market;
|
12
12
|
}
|
13
13
|
interface BillingInfoValidationRuleCreate extends ResourceCreate {
|
14
|
-
market
|
14
|
+
market: MarketRel;
|
15
15
|
}
|
16
16
|
interface BillingInfoValidationRuleUpdate extends ResourceUpdate {
|
17
17
|
market?: MarketRel;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as s}from"../resource";class t extends s{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,i){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,i)}async retrieve(e,r,i){return this.resources.retrieve({type:t.TYPE,id:e},r,i)}async update(e,r,i){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,i)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isBillingInfoValidationRule(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="billing_info_validation_rules";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class s extends i{async list(e,r){return this.resources.list({type:s.TYPE},e,r)}async create(e,r,t){return this.resources.create(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async retrieve(e,r,t){return this.resources.retrieve({type:s.TYPE,id:e},r,t)}async update(e,r,t){return this.resources.update(Object.assign(Object.assign({},e),{type:s.TYPE}),r,t)}async delete(e,r){await this.resources.delete({type:s.TYPE,id:e},r)}isBingGeocoder(e){return e.type&&e.type===s.TYPE}relationship(e){return typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="bing_geocoders";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class t extends i{async list(e,s){return this.resources.list({type:t.TYPE},e,s)}async create(e,s,r){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async retrieve(e,s,r){return this.resources.retrieve({type:t.TYPE,id:e},s,r)}async update(e,s,r){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async delete(e,s){await this.resources.delete({type:t.TYPE,id:e},s)}isBraintreeGateway(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="braintree_gateways";export default t;
|
@@ -21,7 +21,7 @@ interface BraintreePaymentCreate extends ResourceCreate {
|
|
21
21
|
payment_id?: string;
|
22
22
|
local?: boolean;
|
23
23
|
options?: object;
|
24
|
-
order
|
24
|
+
order: OrderRel;
|
25
25
|
}
|
26
26
|
interface BraintreePaymentUpdate extends ResourceUpdate {
|
27
27
|
payment_method_nonce?: string;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class t extends i{async list(e,s){return this.resources.list({type:t.TYPE},e,s)}async create(e,s,r){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async retrieve(e,s,r){return this.resources.retrieve({type:t.TYPE,id:e},s,r)}async update(e,s,r){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}async delete(e,s){await this.resources.delete({type:t.TYPE,id:e},s)}isBraintreePayment(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="braintree_payments";export default t;
|
@@ -39,7 +39,7 @@ interface BundleCreate extends ResourceCreate {
|
|
39
39
|
compare_at_amount_cents: number;
|
40
40
|
_compute_compare_at_amount?: boolean;
|
41
41
|
market?: MarketRel;
|
42
|
-
sku_list
|
42
|
+
sku_list: SkuListRel;
|
43
43
|
}
|
44
44
|
interface BundleUpdate extends ResourceUpdate {
|
45
45
|
code?: string;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isBundle(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="bundles";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class t extends i{async list(e,s){return this.resources.list({type:t.TYPE},e,s)}async retrieve(e,s,r){return this.resources.retrieve({type:t.TYPE,id:e},s,r)}async update(e,s,r){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),s,r)}isCapture(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="captures";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as s}from"../resource";class r extends s{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async retrieve(e,t,i){return this.resources.retrieve({type:r.TYPE,id:e},t,i)}isCarrierAccount(e){return e.type&&e.type===r.TYPE}relationship(e){return typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="carrier_accounts";export default r;
|
@@ -23,7 +23,7 @@ interface CheckoutComPaymentCreate extends ResourceCreate {
|
|
23
23
|
payment_type: string;
|
24
24
|
token: string;
|
25
25
|
session_id?: string;
|
26
|
-
order
|
26
|
+
order: OrderRel;
|
27
27
|
}
|
28
28
|
interface CheckoutComPaymentUpdate extends ResourceUpdate {
|
29
29
|
payment_type?: string;
|
@@ -36,7 +36,7 @@ interface CouponCodesPromotionRule extends Resource {
|
|
36
36
|
coupons?: Coupon[];
|
37
37
|
}
|
38
38
|
interface CouponCodesPromotionRuleCreate extends ResourceCreate {
|
39
|
-
promotion
|
39
|
+
promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FixedAmountPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel;
|
40
40
|
coupons?: CouponRel[];
|
41
41
|
}
|
42
42
|
interface CouponCodesPromotionRuleUpdate extends ResourceUpdate {
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isCouponCodesPromotionRule(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="coupon_codes_promotion_rules";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isCouponRecipient(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="coupon_recipients";export default t;
|
@@ -20,7 +20,7 @@ interface CouponCreate extends ResourceCreate {
|
|
20
20
|
customer_single_use?: boolean;
|
21
21
|
usage_limit: number;
|
22
22
|
recipient_email?: string;
|
23
|
-
promotion_rule
|
23
|
+
promotion_rule: CouponCodesPromotionRuleRel;
|
24
24
|
}
|
25
25
|
interface CouponUpdate extends ResourceUpdate {
|
26
26
|
code?: string;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isCoupon(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="coupons";export default t;
|
@@ -17,8 +17,8 @@ interface CustomerAddress extends Resource {
|
|
17
17
|
address?: Address;
|
18
18
|
}
|
19
19
|
interface CustomerAddressCreate extends ResourceCreate {
|
20
|
-
customer
|
21
|
-
address
|
20
|
+
customer: CustomerRel;
|
21
|
+
address: AddressRel;
|
22
22
|
}
|
23
23
|
interface CustomerAddressUpdate extends ResourceUpdate {
|
24
24
|
customer?: CustomerRel;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isCustomerAddress(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="customer_addresses";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isCustomerGroup(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="customer_groups";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update(Object.assign(Object.assign({},e),{type:t.TYPE}),r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isCustomerPasswordReset(e){return e.type&&e.type===t.TYPE}relationship(e){return typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="customer_password_resets";export default t;
|
@@ -43,8 +43,8 @@ interface CustomerPaymentSource extends Resource {
|
|
43
43
|
payment_source?: AdyenPayment | BraintreePayment | CheckoutComPayment | ExternalPayment | PaypalPayment | StripePayment | WireTransfer;
|
44
44
|
}
|
45
45
|
interface CustomerPaymentSourceCreate extends ResourceCreate {
|
46
|
-
customer
|
47
|
-
payment_source
|
46
|
+
customer: CustomerRel;
|
47
|
+
payment_source: AdyenPaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | PaypalPaymentRel | StripePaymentRel | WireTransferRel;
|
48
48
|
}
|
49
49
|
interface CustomerPaymentSourceUpdate extends ResourceUpdate {
|
50
50
|
customer?: CustomerRel;
|