@commercelayer/sdk 2.3.12 → 2.3.13
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/common.js +1 -1
- package/lib/cjs/error.js +1 -1
- package/lib/cjs/query.d.ts +35 -0
- package/lib/cjs/query.js +1 -1
- package/lib/esm/client.js +1 -1
- package/lib/esm/common.js +1 -1
- package/lib/esm/error.js +1 -1
- package/lib/esm/jsonapi.js +1 -1
- package/lib/esm/query.d.ts +35 -0
- package/lib/esm/query.js +1 -1
- package/lib/esm/resource.js +1 -1
- package/lib/esm/resources/adyen_gateways.js +1 -1
- package/lib/esm/resources/adyen_payments.js +1 -1
- package/lib/esm/resources/application.js +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.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.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_gateways.js +1 -1
- package/lib/esm/resources/checkout_com_payments.js +1 -1
- package/lib/esm/resources/coupon_recipients.js +1 -1
- package/lib/esm/resources/customer_groups.js +1 -1
- package/lib/esm/resources/delivery_lead_times.js +1 -1
- package/lib/esm/resources/external_gateways.js +1 -1
- package/lib/esm/resources/external_payments.js +1 -1
- package/lib/esm/resources/external_promotions.js +1 -1
- package/lib/esm/resources/external_tax_calculators.js +1 -1
- package/lib/esm/resources/fixed_amount_promotions.js +1 -1
- package/lib/esm/resources/free_gift_promotions.js +1 -1
- package/lib/esm/resources/geocoders.js +1 -1
- package/lib/esm/resources/gift_card_recipients.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.js +1 -1
- package/lib/esm/resources/inventory_models.js +1 -1
- package/lib/esm/resources/inventory_return_locations.js +1 -1
- package/lib/esm/resources/line_item_options.js +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.js +1 -1
- package/lib/esm/resources/merchants.js +1 -1
- package/lib/esm/resources/order_amount_promotion_rules.js +1 -1
- package/lib/esm/resources/order_validation_rules.js +1 -1
- package/lib/esm/resources/organization.js +1 -1
- package/lib/esm/resources/parcel_line_items.js +1 -1
- package/lib/esm/resources/parcels.js +1 -1
- package/lib/esm/resources/payment_gateways.js +1 -1
- package/lib/esm/resources/payment_methods.js +1 -1
- package/lib/esm/resources/paypal_gateways.js +1 -1
- package/lib/esm/resources/paypal_payments.js +1 -1
- package/lib/esm/resources/percentage_discount_promotions.js +1 -1
- package/lib/esm/resources/prices.js +1 -1
- package/lib/esm/resources/promotion_rules.js +1 -1
- package/lib/esm/resources/refunds.js +1 -1
- package/lib/esm/resources/return_line_items.js +1 -1
- package/lib/esm/resources/shipments.js +1 -1
- package/lib/esm/resources/shipping_methods.js +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.js +1 -1
- package/lib/esm/resources/stock_line_items.js +1 -1
- package/lib/esm/resources/stripe_gateways.js +1 -1
- package/lib/esm/resources/stripe_payments.js +1 -1
- package/lib/esm/resources/tax_categories.js +1 -1
- package/lib/esm/resources/taxjar_accounts.js +1 -1
- package/lib/esm/resources/transactions.js +1 -1
- package/lib/esm/static.js +1 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -7
package/lib/cjs/common.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isResourceType=exports.isResourceId=void 0;const
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isResourceType=exports.isResourceId=void 0;const isResourceId=e=>e&&e.type&&e.id;exports.isResourceId=isResourceId;const isResourceType=e=>e&&typeof e.type!="undefined"&&e.type;exports.isResourceType=isResourceType;
|
package/lib/cjs/error.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ErrorType=exports.ApiError=exports.SdkError=void 0;var ErrorType;(function(e){e.CLIENT="client",e.REQUEST="request",e.RESPONSE="response",e.GENERIC="generic",e.CANCEL="cancel"})(ErrorType||(ErrorType={})),exports.ErrorType=ErrorType;class SdkError extends Error{constructor(r){super(r.message);this.name=this.constructor.name,this.type=r.type||ErrorType.GENERIC}static isSdkError(r){return r&&["SdkError","ApiError"].includes(r.name)&&Object.values(ErrorType).includes(r.type)}}exports.SdkError=SdkError;class ApiError extends SdkError{constructor(r){super(Object.assign(Object.assign({},r),{type:ErrorType.RESPONSE}));this.errors=[],this.name=this.constructor.name}static isApiError(r){return SdkError.isSdkError(r)&&r.name==="ApiError"&&r.type===ErrorType.RESPONSE}first(){
|
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(){return this.errors.length>0?this.errors[0]:void 0}}exports.ApiError=ApiError;
|
package/lib/cjs/query.d.ts
CHANGED
@@ -16,6 +16,41 @@ interface QueryParamsList extends QueryParamsRetrieve {
|
|
16
16
|
}
|
17
17
|
declare type QueryParams = QueryParamsRetrieve | QueryParamsList;
|
18
18
|
export { QueryParamsRetrieve, QueryParamsList, QueryParams };
|
19
|
+
declare type FilterPredicate = 'blank' | 'cont' | 'cont_all' | 'cont_any' | 'does_not_match' | 'does_not_match_all' | 'does_not_match_any' | 'end' | 'end_all' | 'end_any' | 'eq' | 'false' | 'gt' | 'gt_all' | 'gt_any' | 'gteq' | 'gteq_all' | 'gteq_any' | 'in' | 'lt' | 'lt_all' | 'lt_any' | 'lteq' | 'lteq_all' | 'lteq_any' | 'matches' | 'matches_all' | 'matches_any' | 'not_cont' | 'not_cont_all' | 'not_end' | 'not_end_all' | 'not_end_any' | 'not_eq' | 'not_eq_all' | 'not_in' | 'not_null' | 'not_start' | 'not_start_all' | 'not_start_any' | 'null' | 'present' | 'start' | 'start_all' | 'start_any' | 'true';
|
20
|
+
declare class QueryBuilderRetrieve {
|
21
|
+
#private;
|
22
|
+
constructor(resource?: string);
|
23
|
+
include(...resources: string[]): QueryBuilderRetrieve;
|
24
|
+
field(field: string, resource?: string): QueryBuilderRetrieve;
|
25
|
+
fields(fields: string[], resource?: string): QueryBuilderRetrieve;
|
26
|
+
clear(): QueryBuilderRetrieve;
|
27
|
+
build(): QueryParams;
|
28
|
+
generate(): {
|
29
|
+
[key: string]: string;
|
30
|
+
};
|
31
|
+
}
|
32
|
+
declare class QueryBuilderList extends QueryBuilderRetrieve {
|
33
|
+
#private;
|
34
|
+
constructor(resource?: string);
|
35
|
+
include(...resources: string[]): QueryBuilderList;
|
36
|
+
field(field: string, resource?: string): QueryBuilderList;
|
37
|
+
fields(fields: string[], resource?: string): QueryBuilderList;
|
38
|
+
pageNumber(num: number): QueryBuilderList;
|
39
|
+
pageSize(size: number): QueryBuilderList;
|
40
|
+
page(num: number, size: number): QueryBuilderList;
|
41
|
+
sort(field: string, descending?: boolean): QueryBuilderList;
|
42
|
+
filter(field: string | string[], predicate: FilterPredicate, value: string | number | boolean | string[], resource?: string): QueryBuilderList;
|
43
|
+
clear(): QueryBuilderList;
|
44
|
+
build(): QueryParams;
|
45
|
+
generate(): {
|
46
|
+
[key: string]: string;
|
47
|
+
};
|
48
|
+
}
|
49
|
+
declare class QueryBuilder extends QueryBuilderList {
|
50
|
+
constructor(resource?: string);
|
51
|
+
}
|
52
|
+
export default QueryBuilder;
|
53
|
+
export { QueryBuilderRetrieve, QueryBuilderList };
|
19
54
|
declare const generateQueryStringParams: (params: QueryParamsRetrieve | QueryParamsList | undefined) => {
|
20
55
|
[key: string]: string;
|
21
56
|
};
|
package/lib/cjs/query.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.generateQueryStringParams=void 0;const isParamsList=r=>r.filters||r.pageNumber||r.pageSize||r.sort,generateQueryStringParams=r=>{const e={};return r&&(r.include&&(e.include=r.include.join(",")),r.fields&&Object.entries(r.fields).forEach(([t
|
1
|
+
"use strict";var __classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(r,e,i,t,s){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?s.call(r,i):s?s.value=i:e.set(r,i),i},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(r,e,i,t){if(i==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!t:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?t:i==="a"?t.call(r):t?t.value:e.get(r)},_QueryBuilderRetrieve_resource,_QueryBuilderRetrieve_include,_QueryBuilderRetrieve_fields,_QueryBuilderList_sort,_QueryBuilderList_filters,_QueryBuilderList_pageNumber,_QueryBuilderList_pageSize;Object.defineProperty(exports,"__esModule",{value:!0}),exports.generateQueryStringParams=exports.QueryBuilderList=exports.QueryBuilderRetrieve=void 0;const isParamsList=r=>r.filters||r.pageNumber||r.pageSize||r.sort;class QueryBuilderRetrieve{constructor(e){_QueryBuilderRetrieve_resource.set(this,void 0),_QueryBuilderRetrieve_include.set(this,void 0),_QueryBuilderRetrieve_fields.set(this,void 0),__classPrivateFieldSet(this,_QueryBuilderRetrieve_resource,e||"","f")}include(...e){return __classPrivateFieldGet(this,_QueryBuilderRetrieve_include,"f")||__classPrivateFieldSet(this,_QueryBuilderRetrieve_include,[],"f"),__classPrivateFieldGet(this,_QueryBuilderRetrieve_include,"f").push(...e),this}field(e,i){return __classPrivateFieldGet(this,_QueryBuilderRetrieve_fields,"f")||__classPrivateFieldSet(this,_QueryBuilderRetrieve_fields,{},"f"),i||(i=__classPrivateFieldGet(this,_QueryBuilderRetrieve_resource,"f")),__classPrivateFieldGet(this,_QueryBuilderRetrieve_fields,"f")[i]||(__classPrivateFieldGet(this,_QueryBuilderRetrieve_fields,"f")[i]=[]),__classPrivateFieldGet(this,_QueryBuilderRetrieve_fields,"f")[i].push(e),this}fields(e,i){return e.forEach(t=>{this.field(t,i)}),this}clear(){return __classPrivateFieldSet(this,_QueryBuilderRetrieve_include,void 0,"f"),__classPrivateFieldSet(this,_QueryBuilderRetrieve_fields,void 0,"f"),this}build(){return{include:__classPrivateFieldGet(this,_QueryBuilderRetrieve_include,"f"),fields:__classPrivateFieldGet(this,_QueryBuilderRetrieve_fields,"f")}}generate(){return generateQueryStringParams(this.build())}}exports.QueryBuilderRetrieve=QueryBuilderRetrieve,_QueryBuilderRetrieve_resource=new WeakMap,_QueryBuilderRetrieve_include=new WeakMap,_QueryBuilderRetrieve_fields=new WeakMap;class QueryBuilderList extends QueryBuilderRetrieve{constructor(e){super(e);_QueryBuilderList_sort.set(this,void 0),_QueryBuilderList_filters.set(this,void 0),_QueryBuilderList_pageNumber.set(this,void 0),_QueryBuilderList_pageSize.set(this,void 0)}include(...e){return super.include(...e)}field(e,i){return super.field(e,i)}fields(e,i){return super.fields(e,i)}pageNumber(e){return __classPrivateFieldSet(this,_QueryBuilderList_pageNumber,e,"f"),this}pageSize(e){return __classPrivateFieldSet(this,_QueryBuilderList_pageSize,e,"f"),this}page(e,i){return __classPrivateFieldSet(this,_QueryBuilderList_pageNumber,e,"f"),__classPrivateFieldSet(this,_QueryBuilderList_pageSize,i,"f"),this}sort(e,i){return __classPrivateFieldGet(this,_QueryBuilderList_sort,"f")||__classPrivateFieldSet(this,_QueryBuilderList_sort,[],"f"),__classPrivateFieldGet(this,_QueryBuilderList_sort,"f").push(`${i?"-":""}${e}`),this}filter(e,i,t,s){__classPrivateFieldGet(this,_QueryBuilderList_filters,"f")||__classPrivateFieldSet(this,_QueryBuilderList_filters,{},"f");const a=s?`${s}_`:"";return __classPrivateFieldGet(this,_QueryBuilderList_filters,"f")[`${Array.isArray(e)?e.map(u=>`${a}${u}`).join("_or_"):a+e}_${i}`]=Array.isArray(t)?t.join(","):t,this}clear(){return super.clear(),__classPrivateFieldSet(this,_QueryBuilderList_sort,void 0,"f"),__classPrivateFieldSet(this,_QueryBuilderList_filters,void 0,"f"),__classPrivateFieldSet(this,_QueryBuilderList_pageNumber,void 0,"f"),__classPrivateFieldSet(this,_QueryBuilderList_pageSize,void 0,"f"),this}build(){return Object.assign(super.build(),{sort:__classPrivateFieldGet(this,_QueryBuilderList_sort,"f"),filters:__classPrivateFieldGet(this,_QueryBuilderList_filters,"f"),pageNumber:__classPrivateFieldGet(this,_QueryBuilderList_pageNumber,"f"),pageSize:__classPrivateFieldGet(this,_QueryBuilderList_pageSize,"f")})}generate(){return generateQueryStringParams(this.build())}}exports.QueryBuilderList=QueryBuilderList,_QueryBuilderList_sort=new WeakMap,_QueryBuilderList_filters=new WeakMap,_QueryBuilderList_pageNumber=new WeakMap,_QueryBuilderList_pageSize=new WeakMap;class QueryBuilder extends QueryBuilderList{constructor(e){super(e)}}exports.default=QueryBuilder;const generateQueryStringParams=r=>{const e={};return r&&(r.include&&(e.include=r.include.join(",")),r.fields&&Object.entries(r.fields).forEach(([i,t])=>{e[`fields[${i}]`]=t.join(",")}),isParamsList(r)&&(r.sort&&(Array.isArray(r.sort)?e.sort=r.sort.join(","):e.sort=Object.entries(r.sort).map(([i,t])=>`${t==="desc"?"-":""}${i}`).join(",")),r.pageNumber&&(e["page[number]"]=String(r.pageNumber)),r.pageSize&&(e["page[size]"]=String(r.pageSize)),r.filters&&Object.entries(r.filters).forEach(([i,t])=>{e[`filter[q][${i}]`]=String(t)}))),e};exports.generateQueryStringParams=generateQueryStringParams;
|
package/lib/esm/client.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var h=this&&this.__classPrivateFieldSet||function(t,e,
|
1
|
+
var h=this&&this.__classPrivateFieldSet||function(t,e,r,i,a){if(i==="m")throw new TypeError("Private method is not writable");if(i==="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 i==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r},c=this&&this.__classPrivateFieldGet||function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},s,o;import u from"axios";import{SdkError as T,ApiError as g,ErrorType as n}from"./error";import l from"./config";const p=(t,e)=>`https://${t.toLowerCase()}.${e||l.default.domain}/api`,y=t=>{let e=new T({message:t.message,type:n.GENERIC});if(u.isAxiosError(t))if(t.response){const r=new g(e);r.type=n.RESPONSE,r.status=t.response.status,r.code=String(r.status),r.errors=t.response.data.errors,e=r}else t.request?(e.type=n.REQUEST,e.request=t.request):e.type=n.CLIENT;else u.isCancel(t)?e.type=n.CANCEL:e.source=t;throw e};class f{constructor(e){s.set(this,void 0),o.set(this,void 0),this.baseUrl=p(e.organization,e.domain),h(this,s,e.accessToken,"f");const r={timeout:e.timeout||l.client.timeout};h(this,o,u.create(Object.assign({baseURL:this.baseUrl,timeout:l.client.timeout,headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json",Authorization:"Bearer "+c(this,s,"f")}},r)),"f"),this.interceptors=c(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 f(e)}config(e){const r=c(this,o,"f").defaults;e.timeout&&(r.timeout=e.timeout),e.organization&&(this.baseUrl=p(e.organization,e.domain)),e.accessToken&&h(this,s,e.accessToken,"f")}async request(e,r,i,a){const m=i?{data:i}:void 0,w=r,v=(a==null?void 0:a.organization)?p(a.organization,a.domain):void 0,E=(a==null?void 0:a.accessToken)?{Authorization:"Bearer "+a.accessToken}:void 0;return c(this,o,"f").request(Object.assign({method:e,baseURL:v,url:w,data:m,headers:E},a)).then(d=>d.data).catch(d=>y(d))}}s=new WeakMap,o=new WeakMap;export default f;
|
package/lib/esm/common.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
const s=e=>e&&e.type&&e.id,p=e=>e&&typeof e.type!="undefined"&&e.type;export{s as isResourceId,p as isResourceType};
|
package/lib/esm/error.js
CHANGED
@@ -1 +1 @@
|
|
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
|
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 n 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(){return this.errors.length>0?this.errors[0]:void 0}}export{t as SdkError,n as ApiError,s as ErrorType};
|
package/lib/esm/jsonapi.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{isResourceId as
|
1
|
+
import{isResourceId as o}from"./common";const l=i=>{let e;i.links&&delete i.links;const s=i.data,a=i.included;return Array.isArray(s)?e=s.map(r=>t(r,a)):e=t(s,a),e},d=(i,e=[])=>e.find(s=>i.id===s.id&&i.type===s.type)||i,t=(i,e)=>{const s=Object.assign({id:i.id,type:i.type},i.attributes);return i.relationships&&Object.keys(i.relationships).forEach(a=>{const r=i.relationships[a].data;r?Array.isArray(r)?s[a]=r.map(n=>t(d(n,e),e)):s[a]=t(d(r,e),e):r===null&&(s[a]=null)}),s},c=i=>{const e={},s={};for(const r in i){if(["type","id"].includes(r))continue;const n=i[r];n&&(o(n)||Array.isArray(n)&&o(n[0]))?s[r]={data:n}:e[r]=n}const a={type:i.type,attributes:e,relationships:s};return o(i)&&(a.id=i.id),a};export{l as denormalize,c as normalize};
|
package/lib/esm/query.d.ts
CHANGED
@@ -16,6 +16,41 @@ interface QueryParamsList extends QueryParamsRetrieve {
|
|
16
16
|
}
|
17
17
|
declare type QueryParams = QueryParamsRetrieve | QueryParamsList;
|
18
18
|
export { QueryParamsRetrieve, QueryParamsList, QueryParams };
|
19
|
+
declare type FilterPredicate = 'blank' | 'cont' | 'cont_all' | 'cont_any' | 'does_not_match' | 'does_not_match_all' | 'does_not_match_any' | 'end' | 'end_all' | 'end_any' | 'eq' | 'false' | 'gt' | 'gt_all' | 'gt_any' | 'gteq' | 'gteq_all' | 'gteq_any' | 'in' | 'lt' | 'lt_all' | 'lt_any' | 'lteq' | 'lteq_all' | 'lteq_any' | 'matches' | 'matches_all' | 'matches_any' | 'not_cont' | 'not_cont_all' | 'not_end' | 'not_end_all' | 'not_end_any' | 'not_eq' | 'not_eq_all' | 'not_in' | 'not_null' | 'not_start' | 'not_start_all' | 'not_start_any' | 'null' | 'present' | 'start' | 'start_all' | 'start_any' | 'true';
|
20
|
+
declare class QueryBuilderRetrieve {
|
21
|
+
#private;
|
22
|
+
constructor(resource?: string);
|
23
|
+
include(...resources: string[]): QueryBuilderRetrieve;
|
24
|
+
field(field: string, resource?: string): QueryBuilderRetrieve;
|
25
|
+
fields(fields: string[], resource?: string): QueryBuilderRetrieve;
|
26
|
+
clear(): QueryBuilderRetrieve;
|
27
|
+
build(): QueryParams;
|
28
|
+
generate(): {
|
29
|
+
[key: string]: string;
|
30
|
+
};
|
31
|
+
}
|
32
|
+
declare class QueryBuilderList extends QueryBuilderRetrieve {
|
33
|
+
#private;
|
34
|
+
constructor(resource?: string);
|
35
|
+
include(...resources: string[]): QueryBuilderList;
|
36
|
+
field(field: string, resource?: string): QueryBuilderList;
|
37
|
+
fields(fields: string[], resource?: string): QueryBuilderList;
|
38
|
+
pageNumber(num: number): QueryBuilderList;
|
39
|
+
pageSize(size: number): QueryBuilderList;
|
40
|
+
page(num: number, size: number): QueryBuilderList;
|
41
|
+
sort(field: string, descending?: boolean): QueryBuilderList;
|
42
|
+
filter(field: string | string[], predicate: FilterPredicate, value: string | number | boolean | string[], resource?: string): QueryBuilderList;
|
43
|
+
clear(): QueryBuilderList;
|
44
|
+
build(): QueryParams;
|
45
|
+
generate(): {
|
46
|
+
[key: string]: string;
|
47
|
+
};
|
48
|
+
}
|
49
|
+
declare class QueryBuilder extends QueryBuilderList {
|
50
|
+
constructor(resource?: string);
|
51
|
+
}
|
52
|
+
export default QueryBuilder;
|
53
|
+
export { QueryBuilderRetrieve, QueryBuilderList };
|
19
54
|
declare const generateQueryStringParams: (params: QueryParamsRetrieve | QueryParamsList | undefined) => {
|
20
55
|
[key: string]: string;
|
21
56
|
};
|
package/lib/esm/query.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
var a=this&&this.__classPrivateFieldSet||function(t,e,s,r,o){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?o.call(t,s):o?o.value=s:e.set(t,s),s},i=this&&this.__classPrivateFieldGet||function(t,e,s,r){if(s==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?r:s==="a"?r.call(t):r?r.value:e.get(t)},c,h,n,f,u,d,l;const m=t=>t.filters||t.pageNumber||t.pageSize||t.sort;class v{constructor(e){c.set(this,void 0),h.set(this,void 0),n.set(this,void 0),a(this,c,e||"","f")}include(...e){return i(this,h,"f")||a(this,h,[],"f"),i(this,h,"f").push(...e),this}field(e,s){return i(this,n,"f")||a(this,n,{},"f"),s||(s=i(this,c,"f")),i(this,n,"f")[s]||(i(this,n,"f")[s]=[]),i(this,n,"f")[s].push(e),this}fields(e,s){return e.forEach(r=>{this.field(r,s)}),this}clear(){return a(this,h,void 0,"f"),a(this,n,void 0,"f"),this}build(){return{include:i(this,h,"f"),fields:i(this,n,"f")}}generate(){return p(this.build())}}c=new WeakMap,h=new WeakMap,n=new WeakMap;class g extends v{constructor(e){super(e);f.set(this,void 0),u.set(this,void 0),d.set(this,void 0),l.set(this,void 0)}include(...e){return super.include(...e)}field(e,s){return super.field(e,s)}fields(e,s){return super.fields(e,s)}pageNumber(e){return a(this,d,e,"f"),this}pageSize(e){return a(this,l,e,"f"),this}page(e,s){return a(this,d,e,"f"),a(this,l,s,"f"),this}sort(e,s){return i(this,f,"f")||a(this,f,[],"f"),i(this,f,"f").push(`${s?"-":""}${e}`),this}filter(e,s,r,o){i(this,u,"f")||a(this,u,{},"f");const w=o?`${o}_`:"";return i(this,u,"f")[`${Array.isArray(e)?e.map(b=>`${w}${b}`).join("_or_"):w+e}_${s}`]=Array.isArray(r)?r.join(","):r,this}clear(){return super.clear(),a(this,f,void 0,"f"),a(this,u,void 0,"f"),a(this,d,void 0,"f"),a(this,l,void 0,"f"),this}build(){return Object.assign(super.build(),{sort:i(this,f,"f"),filters:i(this,u,"f"),pageNumber:i(this,d,"f"),pageSize:i(this,l,"f")})}generate(){return p(this.build())}}f=new WeakMap,u=new WeakMap,d=new WeakMap,l=new WeakMap;class y extends g{constructor(e){super(e)}}export default y;export{v as QueryBuilderRetrieve,g as QueryBuilderList};const p=t=>{const e={};return t&&(t.include&&(e.include=t.include.join(",")),t.fields&&Object.entries(t.fields).forEach(([s,r])=>{e[`fields[${s}]`]=r.join(",")}),m(t)&&(t.sort&&(Array.isArray(t.sort)?e.sort=t.sort.join(","):e.sort=Object.entries(t.sort).map(([s,r])=>`${r==="desc"?"-":""}${s}`).join(",")),t.pageNumber&&(e["page[number]"]=String(t.pageNumber)),t.pageSize&&(e["page[size]"]=String(t.pageSize)),t.filters&&Object.entries(t.filters).forEach(([s,r])=>{e[`filter[q][${s}]`]=String(r)}))),e};export{p as generateQueryStringParams};
|
package/lib/esm/resource.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var f=this&&this.__classPrivateFieldSet||function(a,e,r,t,s){if(t==="m")throw new TypeError("Private method is not writable");if(t==="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 t==="a"?s.call(a,r):s?s.value=r:e.set(a,r),r},o=this&&this.__classPrivateFieldGet||function(a,e,r,t){if(r==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?a!==e||!t:!e.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?t:r==="a"?t.call(a):t?t.value:e.get(a)},n,p;import w from"./client";import{denormalize as l,normalize as h}from"./jsonapi";import{generateQueryStringParams as u}from"./query";import
|
1
|
+
var f=this&&this.__classPrivateFieldSet||function(a,e,r,t,s){if(t==="m")throw new TypeError("Private method is not writable");if(t==="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 t==="a"?s.call(a,r):s?s.value=r:e.set(a,r),r},o=this&&this.__classPrivateFieldGet||function(a,e,r,t){if(r==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?a!==e||!t:!e.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?t:r==="a"?t.call(a):t?t.value:e.get(a)},n,p;import w from"./client";import{denormalize as l,normalize as h}from"./jsonapi";import{generateQueryStringParams as u}from"./query";import m from"./config";class b extends Array{constructor(e,r){super(...r||[]);this.meta=e}first(){return this.length?this[0]:void 0}last(){return this.length?this[this.length-1]:void 0}get(e){return this.length&&e>=0?this[e]:void 0}}class y{constructor(e){n.set(this,void 0),p.set(this,{}),f(this,n,w.create(e),"f"),this.config(e)}get interceptors(){return o(this,n,"f").interceptors}config(e){!e||o(this,n,"f").config(e)}async singleton(e,r,t){const s=u(r);(t==null?void 0:t.params)&&Object.assign(s,t==null?void 0:t.params);const i=await o(this,n,"f").request("get",`${e.type}`,void 0,Object.assign(Object.assign({},t),{params:s}));return l(i)}async retrieve(e,r,t){const s=u(r);(t==null?void 0:t.params)&&Object.assign(s,t==null?void 0:t.params);const i=await o(this,n,"f").request("get",`${e.type}/${e.id}`,void 0,Object.assign(Object.assign({},t),{params:s}));return l(i)}async list(e,r,t){var s,i;const c=u(r);(t==null?void 0:t.params)&&Object.assign(c,t==null?void 0:t.params);const d=await o(this,n,"f").request("get",`${e.type}`,void 0,Object.assign(Object.assign({},t),{params:c})),g=l(d),v={pageCount:Number((s=d.meta)===null||s===void 0?void 0:s.page_count),recordCount:Number((i=d.meta)===null||i===void 0?void 0:i.record_count),currentPage:(r==null?void 0:r.pageNumber)||m.default.pageNumber,recordsPerPage:(r==null?void 0:r.pageSize)||m.default.pageSize};return new b(v,g)}async create(e,r,t){const s=u(r);(t==null?void 0:t.params)&&Object.assign(s,t==null?void 0:t.params);const i=h(e),c=await o(this,n,"f").request("post",e.type,i,Object.assign(Object.assign({},t),{params:s}));return l(c)}async update(e,r,t){const s=u(r);(t==null?void 0:t.params)&&Object.assign(s,t==null?void 0:t.params);const i=h(e),c=await o(this,n,"f").request("patch",`${e.type}/${e.id}`,i,Object.assign(Object.assign({},t),{params:s}));return l(c)}async delete(e,r){await o(this,n,"f").request("delete",`${e.type}/${e.id}`,void 0,r)}}n=new WeakMap,p=new WeakMap;class j{constructor(e){this.resources=e}}export default y;export{j as ApiResource};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class s extends i{async list(e,
|
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)}isAdyenGateway(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="adyen_gateways";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class s extends i{async list(e,
|
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)}isAdyenPayment(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="adyen_payments";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as i}from"../resource";class t extends i{async retrieve(e,r){return this.resources.singleton({type:t.TYPE},e,r)}isApplication(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="application";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class e extends i{async list(t,r){return this.resources.list({type:e.TYPE},t,r)}async retrieve(t,r,s){return this.resources.retrieve({type:e.TYPE,id:t},r,s)}async update(t,r,s){return this.resources.update(Object.assign(Object.assign({},t),{type:e.TYPE}),r,s)}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 s extends a{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)}isAvalaraAccount(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="avalara_accounts";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class s extends i{async list(e,
|
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)}isBillingInfoValidationRule(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="billing_info_validation_rules";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)}isBingGeocoder(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="bing_geocoders";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class r extends i{async list(e,
|
1
|
+
import{ApiResource as i}from"../resource";class r extends i{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}isBraintreeGateway(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="braintree_gateways";export default r;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class r extends i{async list(e,
|
1
|
+
import{ApiResource as i}from"../resource";class r extends i{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}isBraintreePayment(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="braintree_payments";export default r;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class r extends i{async list(e,
|
1
|
+
import{ApiResource as i}from"../resource";class r extends i{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}isCapture(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="captures";export default r;
|
@@ -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 retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}isCarrierAccount(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="carrier_accounts";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class t extends i{async list(e,
|
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)}isCheckoutComGateway(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="checkout_com_gateways";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class t extends i{async list(e,
|
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)}isCheckoutComPayment(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="checkout_com_payments";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class s extends i{async list(e,
|
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)}isCouponRecipient(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="coupon_recipients";export default s;
|
@@ -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)}isCustomerGroup(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="customer_groups";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class t extends i{async list(e,
|
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)}isDeliveryLeadTime(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="delivery_lead_times";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 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)}isExternalGateway(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="external_gateways";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 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)}isExternalPayment(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="external_payments";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class r extends i{async list(e,
|
1
|
+
import{ApiResource as i}from"../resource";class r extends i{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}isExternalPromotion(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="external_promotions";export default r;
|
@@ -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)}isExternalTaxCalculator(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="external_tax_calculators";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 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)}isFixedAmountPromotion(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="fixed_amount_promotions";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class r extends i{async list(e,
|
1
|
+
import{ApiResource as i}from"../resource";class r extends i{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}isFreeGiftPromotion(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="free_gift_promotions";export default r;
|
@@ -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)}isGeocoder(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="geocoders";export default r;
|
@@ -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)}isGiftCardRecipient(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="gift_card_recipients";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)}isGiftCard(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="gift_cards";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class t extends i{async list(e,
|
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)}isGoogleGeocoder(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="google_geocoders";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class r extends i{async list(e,
|
1
|
+
import{ApiResource as i}from"../resource";class r extends i{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}isImport(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="imports";export default r;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class s extends i{async list(e,
|
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)}isInStockSubscription(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="in_stock_subscriptions";export default s;
|
@@ -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)}isInventoryModel(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="inventory_models";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class t extends i{async list(e,
|
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)}isInventoryReturnLocation(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="inventory_return_locations";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class t extends i{async list(e,
|
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)}isLineItemOption(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="line_item_options";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class s extends i{async list(e,
|
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)}isLineItem(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="line_items";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as a}from"../resource";class s extends a{async list(e,
|
1
|
+
import{ApiResource as a}from"../resource";class s extends a{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)}isManualGateway(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="manual_gateways";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as a}from"../resource";class
|
1
|
+
import{ApiResource as a}from"../resource";class s extends a{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)}isManualTaxCalculator(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="manual_tax_calculators";export default s;
|
@@ -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)}isMarket(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="markets";export default s;
|
@@ -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)}isMerchant(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="merchants";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class r extends i{async list(e,
|
1
|
+
import{ApiResource as i}from"../resource";class r extends i{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update(Object.assign(Object.assign({},e),{type:r.TYPE}),t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}isOrderAmountPromotionRule(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="order_amount_promotion_rules";export default r;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class e extends i{async list(r,t){return this.resources.list({type:e.TYPE},r,t)}isOrderValidationRule(r){return r.type&&r.type===e.TYPE}relationship(r){return typeof r=="string"?{id:r,type:e.TYPE}:{id:r.id,type:e.TYPE}}type(){return e.TYPE}}e.TYPE="order_validation_rules";export default e;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class e extends i{async retrieve(r,t){return this.resources.singleton({type:e.TYPE},r,t)}isOrganization(r){return r.type&&r.type===e.TYPE}relationship(r){return typeof r=="string"?{id:r,type:e.TYPE}:{id:r.id,type:e.TYPE}}type(){return e.TYPE}}e.TYPE="organization";export default e;
|
@@ -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)}isParcelLineItem(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="parcel_line_items";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)}isParcel(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="parcels";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class t extends i{async list(e,
|
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)}isPaymentGateway(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="payment_gateways";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class t extends i{async list(e,
|
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)}isPaymentMethod(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="payment_methods";export default t;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as a}from"../resource";class s extends a{async list(e,
|
1
|
+
import{ApiResource as a}from"../resource";class s extends a{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)}isPaypalGateway(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="paypal_gateways";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class s extends i{async list(e,
|
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)}isPaypalPayment(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="paypal_payments";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)}isPercentageDiscountPromotion(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="percentage_discount_promotions";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)}isPrice(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="prices";export default s;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as s}from"../resource";class
|
1
|
+
import{ApiResource as s}from"../resource";class r extends s{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}isPromotionRule(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="promotion_rules";export default r;
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class r extends i{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}isRefund(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="refunds";export default r;
|
@@ -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)}isReturnLineItem(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="return_line_items";export default t;
|