@commercelayer/sdk 5.0.0-alpha.2 → 5.0.0-alpha.5
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/README.md +67 -33
- package/lib/api.d.ts +1 -103
- package/lib/client.d.ts +1 -31
- package/lib/client.js +1 -1
- package/lib/commercelayer.d.ts +1 -122
- package/lib/commercelayer.js +1 -1
- package/lib/common.d.ts +1 -4
- package/lib/config.d.ts +1 -11
- package/lib/debug.d.ts +1 -3
- package/lib/debug.js +1 -1
- package/lib/error.d.ts +1 -26
- package/lib/error.js +1 -1
- package/lib/index.d.ts +1 -7
- package/lib/interceptor.d.ts +1 -19
- package/lib/jsonapi.d.ts +1 -5
- package/lib/jsonapi.js +1 -1
- package/lib/model.d.ts +1 -101
- package/lib/query.d.ts +1 -23
- package/lib/query.js +1 -1
- package/lib/resource.d.ts +1 -76
- package/lib/resource.js +1 -1
- package/lib/resources/addresses.d.ts +1 -88
- package/lib/resources/addresses.js +1 -1
- package/lib/resources/adjustments.d.ts +1 -35
- package/lib/resources/adjustments.js +1 -1
- package/lib/resources/adyen_gateways.d.ts +1 -47
- package/lib/resources/adyen_gateways.js +1 -1
- package/lib/resources/adyen_payments.d.ts +1 -44
- package/lib/resources/adyen_payments.js +1 -1
- package/lib/resources/application.d.ts +1 -21
- package/lib/resources/application.js +1 -1
- package/lib/resources/attachments.d.ts +1 -156
- package/lib/resources/attachments.js +1 -1
- package/lib/resources/authorizations.d.ts +1 -57
- package/lib/resources/authorizations.js +1 -1
- package/lib/resources/avalara_accounts.d.ts +1 -52
- package/lib/resources/avalara_accounts.js +1 -1
- package/lib/resources/billing_info_validation_rules.d.ts +1 -32
- package/lib/resources/billing_info_validation_rules.js +1 -1
- package/lib/resources/bing_geocoders.d.ts +1 -35
- package/lib/resources/bing_geocoders.js +1 -1
- package/lib/resources/braintree_gateways.d.ts +1 -56
- package/lib/resources/braintree_gateways.js +1 -1
- package/lib/resources/braintree_payments.d.ts +1 -47
- package/lib/resources/braintree_payments.js +1 -1
- package/lib/resources/bundles.d.ts +1 -74
- package/lib/resources/bundles.js +1 -1
- package/lib/resources/captures.d.ts +1 -48
- package/lib/resources/captures.js +1 -1
- package/lib/resources/carrier_accounts.d.ts +1 -26
- package/lib/resources/carrier_accounts.js +1 -1
- package/lib/resources/checkout_com_gateways.d.ts +1 -45
- package/lib/resources/checkout_com_gateways.js +1 -1
- package/lib/resources/checkout_com_payments.d.ts +1 -50
- package/lib/resources/checkout_com_payments.js +1 -1
- package/lib/resources/coupon_codes_promotion_rules.d.ts +1 -59
- package/lib/resources/coupon_codes_promotion_rules.js +1 -1
- package/lib/resources/coupon_recipients.d.ts +1 -44
- package/lib/resources/coupon_recipients.js +1 -1
- package/lib/resources/coupons.d.ts +1 -45
- package/lib/resources/coupons.js +1 -1
- package/lib/resources/customer_addresses.d.ts +1 -41
- package/lib/resources/customer_addresses.js +1 -1
- package/lib/resources/customer_groups.d.ts +1 -36
- package/lib/resources/customer_groups.js +1 -1
- package/lib/resources/customer_password_resets.d.ts +1 -33
- package/lib/resources/customer_password_resets.js +1 -1
- package/lib/resources/customer_payment_sources.d.ts +1 -70
- package/lib/resources/customer_payment_sources.js +1 -1
- package/lib/resources/customer_subscriptions.d.ts +1 -28
- package/lib/resources/customer_subscriptions.js +1 -1
- package/lib/resources/customers.d.ts +1 -60
- package/lib/resources/customers.js +1 -1
- package/lib/resources/delivery_lead_times.d.ts +1 -51
- package/lib/resources/delivery_lead_times.js +1 -1
- package/lib/resources/event_callbacks.d.ts +1 -24
- package/lib/resources/event_callbacks.js +1 -1
- package/lib/resources/external_gateways.d.ts +1 -49
- package/lib/resources/external_gateways.js +1 -1
- package/lib/resources/external_payments.d.ts +1 -43
- package/lib/resources/external_payments.js +1 -1
- package/lib/resources/external_promotions.d.ts +1 -86
- package/lib/resources/external_promotions.js +1 -1
- package/lib/resources/external_tax_calculators.d.ts +1 -44
- package/lib/resources/external_tax_calculators.js +1 -1
- package/lib/resources/fixed_amount_promotions.d.ts +1 -88
- package/lib/resources/fixed_amount_promotions.js +1 -1
- package/lib/resources/fixed_price_promotions.d.ts +1 -99
- package/lib/resources/fixed_price_promotions.js +1 -1
- package/lib/resources/free_gift_promotions.d.ts +1 -97
- package/lib/resources/free_gift_promotions.js +1 -1
- package/lib/resources/free_shipping_promotions.d.ts +1 -83
- package/lib/resources/free_shipping_promotions.js +1 -1
- package/lib/resources/geocoders.d.ts +1 -24
- package/lib/resources/geocoders.js +1 -1
- package/lib/resources/gift_card_recipients.d.ts +1 -44
- package/lib/resources/gift_card_recipients.js +1 -1
- package/lib/resources/gift_cards.d.ts +1 -82
- package/lib/resources/gift_cards.js +1 -1
- package/lib/resources/google_geocoders.d.ts +1 -35
- package/lib/resources/google_geocoders.js +1 -1
- package/lib/resources/imports.d.ts +1 -40
- package/lib/resources/imports.js +1 -1
- package/lib/resources/in_stock_subscriptions.d.ts +1 -59
- package/lib/resources/in_stock_subscriptions.js +1 -1
- package/lib/resources/inventory_models.d.ts +1 -42
- package/lib/resources/inventory_models.js +1 -1
- package/lib/resources/inventory_return_locations.d.ts +1 -43
- package/lib/resources/inventory_return_locations.js +1 -1
- package/lib/resources/inventory_stock_locations.d.ts +1 -46
- package/lib/resources/inventory_stock_locations.js +1 -1
- package/lib/resources/klarna_gateways.d.ts +1 -44
- package/lib/resources/klarna_gateways.js +1 -1
- package/lib/resources/klarna_payments.d.ts +1 -41
- package/lib/resources/klarna_payments.js +1 -1
- package/lib/resources/line_item_options.d.ts +1 -57
- package/lib/resources/line_item_options.js +1 -1
- package/lib/resources/line_items.d.ts +1 -125
- package/lib/resources/line_items.js +1 -1
- package/lib/resources/manual_gateways.d.ts +1 -33
- package/lib/resources/manual_gateways.js +1 -1
- package/lib/resources/manual_tax_calculators.d.ts +1 -49
- package/lib/resources/manual_tax_calculators.js +1 -1
- package/lib/resources/markets.d.ts +1 -81
- package/lib/resources/markets.js +1 -1
- package/lib/resources/merchants.d.ts +1 -38
- package/lib/resources/merchants.js +1 -1
- package/lib/resources/order_amount_promotion_rules.d.ts +1 -56
- package/lib/resources/order_amount_promotion_rules.js +1 -1
- package/lib/resources/order_copies.d.ts +1 -45
- package/lib/resources/order_copies.js +1 -1
- package/lib/resources/order_subscriptions.d.ts +1 -67
- package/lib/resources/order_subscriptions.js +1 -1
- package/lib/resources/order_validation_rules.d.ts +1 -20
- package/lib/resources/order_validation_rules.js +1 -1
- package/lib/resources/orders.d.ts +1 -271
- package/lib/resources/orders.js +1 -1
- package/lib/resources/organization.d.ts +1 -32
- package/lib/resources/organization.js +1 -1
- package/lib/resources/packages.d.ts +1 -56
- package/lib/resources/packages.js +1 -1
- package/lib/resources/parcel_line_items.d.ts +1 -49
- package/lib/resources/parcel_line_items.js +1 -1
- package/lib/resources/parcels.d.ts +1 -108
- package/lib/resources/parcels.js +1 -1
- package/lib/resources/payment_gateways.d.ts +1 -21
- package/lib/resources/payment_gateways.js +1 -1
- package/lib/resources/payment_methods.d.ts +1 -59
- package/lib/resources/payment_methods.js +1 -1
- package/lib/resources/paypal_gateways.d.ts +1 -39
- package/lib/resources/paypal_gateways.js +1 -1
- package/lib/resources/paypal_payments.d.ts +1 -47
- package/lib/resources/paypal_payments.js +1 -1
- package/lib/resources/percentage_discount_promotions.d.ts +1 -97
- package/lib/resources/percentage_discount_promotions.js +1 -1
- package/lib/resources/price_lists.d.ts +1 -39
- package/lib/resources/price_lists.js +1 -1
- package/lib/resources/prices.d.ts +1 -57
- package/lib/resources/prices.js +1 -1
- package/lib/resources/promotion_rules.d.ts +1 -24
- package/lib/resources/promotion_rules.js +1 -1
- package/lib/resources/promotions.d.ts +1 -41
- package/lib/resources/promotions.js +1 -1
- package/lib/resources/refunds.d.ts +1 -34
- package/lib/resources/refunds.js +1 -1
- package/lib/resources/return_line_items.d.ts +1 -49
- package/lib/resources/return_line_items.js +1 -1
- package/lib/resources/returns.d.ts +1 -72
- package/lib/resources/returns.js +1 -1
- package/lib/resources/shipments.d.ts +1 -89
- package/lib/resources/shipments.js +1 -1
- package/lib/resources/shipping_categories.d.ts +1 -33
- package/lib/resources/shipping_categories.js +1 -1
- package/lib/resources/shipping_methods.d.ts +1 -74
- package/lib/resources/shipping_methods.js +1 -1
- package/lib/resources/shipping_zones.d.ts +1 -48
- package/lib/resources/shipping_zones.js +1 -1
- package/lib/resources/sku_list_items.d.ts +1 -47
- package/lib/resources/sku_list_items.js +1 -1
- package/lib/resources/sku_list_promotion_rules.d.ts +1 -68
- package/lib/resources/sku_list_promotion_rules.js +1 -1
- package/lib/resources/sku_lists.d.ts +1 -49
- package/lib/resources/sku_lists.js +1 -1
- package/lib/resources/sku_options.d.ts +1 -56
- package/lib/resources/sku_options.js +1 -1
- package/lib/resources/skus.d.ts +1 -78
- package/lib/resources/skus.js +1 -1
- package/lib/resources/stock_items.d.ts +1 -49
- package/lib/resources/stock_items.js +1 -1
- package/lib/resources/stock_line_items.d.ts +1 -29
- package/lib/resources/stock_line_items.js +1 -1
- package/lib/resources/stock_locations.d.ts +1 -57
- package/lib/resources/stock_locations.js +1 -1
- package/lib/resources/stock_transfers.d.ts +1 -71
- package/lib/resources/stock_transfers.js +1 -1
- package/lib/resources/stripe_gateways.d.ts +1 -38
- package/lib/resources/stripe_gateways.js +1 -1
- package/lib/resources/stripe_payments.d.ts +1 -42
- package/lib/resources/stripe_payments.js +1 -1
- package/lib/resources/tax_calculators.d.ts +1 -27
- package/lib/resources/tax_calculators.js +1 -1
- package/lib/resources/tax_categories.d.ts +1 -59
- package/lib/resources/tax_categories.js +1 -1
- package/lib/resources/tax_rules.d.ts +1 -69
- package/lib/resources/tax_rules.js +1 -1
- package/lib/resources/taxjar_accounts.d.ts +1 -43
- package/lib/resources/taxjar_accounts.js +1 -1
- package/lib/resources/transactions.d.ts +1 -31
- package/lib/resources/transactions.js +1 -1
- package/lib/resources/voids.d.ts +1 -34
- package/lib/resources/voids.js +1 -1
- package/lib/resources/webhooks.d.ts +1 -42
- package/lib/resources/webhooks.js +1 -1
- package/lib/resources/wire_transfers.d.ts +1 -32
- package/lib/resources/wire_transfers.js +1 -1
- package/lib/static.d.ts +1 -6
- package/lib/static.js +1 -1
- package/lib/util.d.ts +1 -2
- package/package.json +25 -28
@@ -1,36 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Customer } from './customers';
|
4
|
-
import { Market } from './markets';
|
5
|
-
import { Attachment } from './attachments';
|
6
|
-
declare type CustomerGroupRel = ResourceRel & {
|
7
|
-
type: typeof CustomerGroups.TYPE;
|
8
|
-
};
|
9
|
-
interface CustomerGroup extends Resource {
|
10
|
-
name?: string;
|
11
|
-
customers?: Customer[];
|
12
|
-
markets?: Market[];
|
13
|
-
attachments?: Attachment[];
|
14
|
-
}
|
15
|
-
interface CustomerGroupCreate extends ResourceCreate {
|
16
|
-
name: string;
|
17
|
-
}
|
18
|
-
interface CustomerGroupUpdate extends ResourceUpdate {
|
19
|
-
name?: string;
|
20
|
-
}
|
21
|
-
declare class CustomerGroups extends ApiResource {
|
22
|
-
static readonly TYPE: 'customer_groups';
|
23
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CustomerGroup>>;
|
24
|
-
create(resource: CustomerGroupCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerGroup>;
|
25
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerGroup>;
|
26
|
-
update(resource: CustomerGroupUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerGroup>;
|
27
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
28
|
-
customers(customerGroupId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Customer>>;
|
29
|
-
markets(customerGroupId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
|
30
|
-
attachments(customerGroupId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
31
|
-
isCustomerGroup(resource: any): resource is CustomerGroup;
|
32
|
-
relationship(id: string | ResourceId | null): CustomerGroupRel;
|
33
|
-
type(): string;
|
34
|
-
}
|
35
|
-
export default CustomerGroups;
|
36
|
-
export { CustomerGroup, CustomerGroupCreate, CustomerGroupUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Customer}from'./customers';import type{Market}from'./markets';import type{Attachment}from'./attachments';declare type CustomerGroupRel=ResourceRel&{type:typeof CustomerGroups.TYPE;};interface CustomerGroup extends Resource{name?:string;customers?:Customer[];markets?:Market[];attachments?:Attachment[];}interface CustomerGroupCreate extends ResourceCreate{name:string;}interface CustomerGroupUpdate extends ResourceUpdate{name?:string;}declare class CustomerGroups extends ApiResource{static readonly TYPE:'customer_groups';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<CustomerGroup>>;create(resource:CustomerGroupCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerGroup>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerGroup>;update(resource:CustomerGroupUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerGroup>;delete(id:string,options?:ResourcesConfig):Promise<void>;customers(customerGroupId:string|CustomerGroup,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Customer>>;markets(customerGroupId:string|CustomerGroup,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Market>>;attachments(customerGroupId:string|CustomerGroup,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isCustomerGroup(resource:any):resource is CustomerGroup;relationship(id:string|ResourceId|null):CustomerGroupRel;type():string;}export default CustomerGroups;export{CustomerGroup,CustomerGroupCreate,CustomerGroupUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as u}from"../resource";class r extends u{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create({...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({...e,type:r.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async customers(e,t,s){return this.resources.fetch({type:"customers"},`customer_groups/${
|
1
|
+
import{ApiResource as u}from"../resource";class r extends u{static TYPE="customer_groups";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create({...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({...e,type:r.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async customers(e,t,s){const c=e.id||e;return this.resources.fetch({type:"customers"},`customer_groups/${c}/customers`,t,s)}async markets(e,t,s){const c=e.id||e;return this.resources.fetch({type:"markets"},`customer_groups/${c}/markets`,t,s)}async attachments(e,t,s){const c=e.id||e;return this.resources.fetch({type:"attachments"},`customer_groups/${c}/attachments`,t,s)}isCustomerGroup(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}export default r;
|
@@ -1,33 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Customer } from './customers';
|
4
|
-
declare type CustomerPasswordResetRel = ResourceRel & {
|
5
|
-
type: typeof CustomerPasswordResets.TYPE;
|
6
|
-
};
|
7
|
-
interface CustomerPasswordReset extends Resource {
|
8
|
-
customer_email?: string;
|
9
|
-
reset_password_token?: string;
|
10
|
-
reset_password_at?: string;
|
11
|
-
customer?: Customer;
|
12
|
-
}
|
13
|
-
interface CustomerPasswordResetCreate extends ResourceCreate {
|
14
|
-
customer_email: string;
|
15
|
-
}
|
16
|
-
interface CustomerPasswordResetUpdate extends ResourceUpdate {
|
17
|
-
customer_password?: string;
|
18
|
-
_reset_password_token?: string;
|
19
|
-
}
|
20
|
-
declare class CustomerPasswordResets extends ApiResource {
|
21
|
-
static readonly TYPE: 'customer_password_resets';
|
22
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CustomerPasswordReset>>;
|
23
|
-
create(resource: CustomerPasswordResetCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerPasswordReset>;
|
24
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerPasswordReset>;
|
25
|
-
update(resource: CustomerPasswordResetUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerPasswordReset>;
|
26
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
27
|
-
customer(customerPasswordResetId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
28
|
-
isCustomerPasswordReset(resource: any): resource is CustomerPasswordReset;
|
29
|
-
relationship(id: string | ResourceId | null): CustomerPasswordResetRel;
|
30
|
-
type(): string;
|
31
|
-
}
|
32
|
-
export default CustomerPasswordResets;
|
33
|
-
export { CustomerPasswordReset, CustomerPasswordResetCreate, CustomerPasswordResetUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Customer}from'./customers';declare type CustomerPasswordResetRel=ResourceRel&{type:typeof CustomerPasswordResets.TYPE;};interface CustomerPasswordReset extends Resource{customer_email?:string;reset_password_token?:string;reset_password_at?:string;customer?:Customer;}interface CustomerPasswordResetCreate extends ResourceCreate{customer_email:string;}interface CustomerPasswordResetUpdate extends ResourceUpdate{customer_password?:string;_reset_password_token?:string;}declare class CustomerPasswordResets extends ApiResource{static readonly TYPE:'customer_password_resets';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<CustomerPasswordReset>>;create(resource:CustomerPasswordResetCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerPasswordReset>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerPasswordReset>;update(resource:CustomerPasswordResetUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerPasswordReset>;delete(id:string,options?:ResourcesConfig):Promise<void>;customer(customerPasswordResetId:string|CustomerPasswordReset,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Customer>;isCustomerPasswordReset(resource:any):resource is CustomerPasswordReset;relationship(id:string|ResourceId|null):CustomerPasswordResetRel;type():string;}export default CustomerPasswordResets;export{CustomerPasswordReset,CustomerPasswordResetCreate,CustomerPasswordResetUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as c}from"../resource";class r extends c{static TYPE="customer_password_resets";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create({...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({...e,type:r.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async customer(e,t,s){const u=e.id||e;return this.resources.fetch({type:"customers"},`customer_password_resets/${u}/customer`,t,s)}isCustomerPasswordReset(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}export default r;
|
@@ -1,70 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Customer } from './customers';
|
4
|
-
import { AdyenPayment } from './adyen_payments';
|
5
|
-
import { BraintreePayment } from './braintree_payments';
|
6
|
-
import { CheckoutComPayment } from './checkout_com_payments';
|
7
|
-
import { ExternalPayment } from './external_payments';
|
8
|
-
import { KlarnaPayment } from './klarna_payments';
|
9
|
-
import { PaypalPayment } from './paypal_payments';
|
10
|
-
import { StripePayment } from './stripe_payments';
|
11
|
-
import { WireTransfer } from './wire_transfers';
|
12
|
-
declare type CustomerPaymentSourceRel = ResourceRel & {
|
13
|
-
type: typeof CustomerPaymentSources.TYPE;
|
14
|
-
};
|
15
|
-
declare type CustomerRel = ResourceRel & {
|
16
|
-
type: 'customers';
|
17
|
-
};
|
18
|
-
declare type AdyenPaymentRel = ResourceRel & {
|
19
|
-
type: 'adyen_payments';
|
20
|
-
};
|
21
|
-
declare type BraintreePaymentRel = ResourceRel & {
|
22
|
-
type: 'braintree_payments';
|
23
|
-
};
|
24
|
-
declare type CheckoutComPaymentRel = ResourceRel & {
|
25
|
-
type: 'checkout_com_payments';
|
26
|
-
};
|
27
|
-
declare type ExternalPaymentRel = ResourceRel & {
|
28
|
-
type: 'external_payments';
|
29
|
-
};
|
30
|
-
declare type KlarnaPaymentRel = ResourceRel & {
|
31
|
-
type: 'klarna_payments';
|
32
|
-
};
|
33
|
-
declare type PaypalPaymentRel = ResourceRel & {
|
34
|
-
type: 'paypal_payments';
|
35
|
-
};
|
36
|
-
declare type StripePaymentRel = ResourceRel & {
|
37
|
-
type: 'stripe_payments';
|
38
|
-
};
|
39
|
-
declare type WireTransferRel = ResourceRel & {
|
40
|
-
type: 'wire_transfers';
|
41
|
-
};
|
42
|
-
interface CustomerPaymentSource extends Resource {
|
43
|
-
name?: string;
|
44
|
-
customer_token?: string;
|
45
|
-
payment_source_token?: string;
|
46
|
-
customer?: Customer;
|
47
|
-
payment_source?: AdyenPayment | BraintreePayment | CheckoutComPayment | ExternalPayment | KlarnaPayment | PaypalPayment | StripePayment | WireTransfer;
|
48
|
-
}
|
49
|
-
interface CustomerPaymentSourceCreate extends ResourceCreate {
|
50
|
-
customer: CustomerRel;
|
51
|
-
payment_source: AdyenPaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | PaypalPaymentRel | StripePaymentRel | WireTransferRel;
|
52
|
-
}
|
53
|
-
interface CustomerPaymentSourceUpdate extends ResourceUpdate {
|
54
|
-
customer?: CustomerRel;
|
55
|
-
payment_source?: AdyenPaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | PaypalPaymentRel | StripePaymentRel | WireTransferRel;
|
56
|
-
}
|
57
|
-
declare class CustomerPaymentSources extends ApiResource {
|
58
|
-
static readonly TYPE: 'customer_payment_sources';
|
59
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CustomerPaymentSource>>;
|
60
|
-
create(resource: CustomerPaymentSourceCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerPaymentSource>;
|
61
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerPaymentSource>;
|
62
|
-
update(resource: CustomerPaymentSourceUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerPaymentSource>;
|
63
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
64
|
-
customer(customerPaymentSourceId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
65
|
-
isCustomerPaymentSource(resource: any): resource is CustomerPaymentSource;
|
66
|
-
relationship(id: string | ResourceId | null): CustomerPaymentSourceRel;
|
67
|
-
type(): string;
|
68
|
-
}
|
69
|
-
export default CustomerPaymentSources;
|
70
|
-
export { CustomerPaymentSource, CustomerPaymentSourceCreate, CustomerPaymentSourceUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Customer}from'./customers';import type{AdyenPayment}from'./adyen_payments';import type{BraintreePayment}from'./braintree_payments';import type{CheckoutComPayment}from'./checkout_com_payments';import type{ExternalPayment}from'./external_payments';import type{KlarnaPayment}from'./klarna_payments';import type{PaypalPayment}from'./paypal_payments';import type{StripePayment}from'./stripe_payments';import type{WireTransfer}from'./wire_transfers';declare type CustomerPaymentSourceRel=ResourceRel&{type:typeof CustomerPaymentSources.TYPE;};declare type CustomerRel=ResourceRel&{type:'customers';};declare type AdyenPaymentRel=ResourceRel&{type:'adyen_payments';};declare type BraintreePaymentRel=ResourceRel&{type:'braintree_payments';};declare type CheckoutComPaymentRel=ResourceRel&{type:'checkout_com_payments';};declare type ExternalPaymentRel=ResourceRel&{type:'external_payments';};declare type KlarnaPaymentRel=ResourceRel&{type:'klarna_payments';};declare type PaypalPaymentRel=ResourceRel&{type:'paypal_payments';};declare type StripePaymentRel=ResourceRel&{type:'stripe_payments';};declare type WireTransferRel=ResourceRel&{type:'wire_transfers';};interface CustomerPaymentSource extends Resource{name?:string;customer_token?:string;payment_source_token?:string;customer?:Customer;payment_source?:AdyenPayment|BraintreePayment|CheckoutComPayment|ExternalPayment|KlarnaPayment|PaypalPayment|StripePayment|WireTransfer;}interface CustomerPaymentSourceCreate extends ResourceCreate{customer:CustomerRel;payment_source:AdyenPaymentRel|BraintreePaymentRel|CheckoutComPaymentRel|ExternalPaymentRel|KlarnaPaymentRel|PaypalPaymentRel|StripePaymentRel|WireTransferRel;}interface CustomerPaymentSourceUpdate extends ResourceUpdate{customer?:CustomerRel;payment_source?:AdyenPaymentRel|BraintreePaymentRel|CheckoutComPaymentRel|ExternalPaymentRel|KlarnaPaymentRel|PaypalPaymentRel|StripePaymentRel|WireTransferRel;}declare class CustomerPaymentSources extends ApiResource{static readonly TYPE:'customer_payment_sources';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<CustomerPaymentSource>>;create(resource:CustomerPaymentSourceCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerPaymentSource>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerPaymentSource>;update(resource:CustomerPaymentSourceUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerPaymentSource>;delete(id:string,options?:ResourcesConfig):Promise<void>;customer(customerPaymentSourceId:string|CustomerPaymentSource,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Customer>;isCustomerPaymentSource(resource:any):resource is CustomerPaymentSource;relationship(id:string|ResourceId|null):CustomerPaymentSourceRel;type():string;}export default CustomerPaymentSources;export{CustomerPaymentSource,CustomerPaymentSourceCreate,CustomerPaymentSourceUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as c}from"../resource";class r extends c{static TYPE="customer_payment_sources";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create({...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({...e,type:r.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async customer(e,t,s){const u=e.id||e;return this.resources.fetch({type:"customers"},`customer_payment_sources/${u}/customer`,t,s)}isCustomerPaymentSource(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}export default r;
|
@@ -1,28 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Customer } from './customers';
|
4
|
-
declare type CustomerSubscriptionRel = ResourceRel & {
|
5
|
-
type: typeof CustomerSubscriptions.TYPE;
|
6
|
-
};
|
7
|
-
interface CustomerSubscription extends Resource {
|
8
|
-
customer_email?: string;
|
9
|
-
customer?: Customer;
|
10
|
-
}
|
11
|
-
interface CustomerSubscriptionCreate extends ResourceCreate {
|
12
|
-
customer_email: string;
|
13
|
-
}
|
14
|
-
declare type CustomerSubscriptionUpdate = ResourceUpdate;
|
15
|
-
declare class CustomerSubscriptions extends ApiResource {
|
16
|
-
static readonly TYPE: 'customer_subscriptions';
|
17
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CustomerSubscription>>;
|
18
|
-
create(resource: CustomerSubscriptionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerSubscription>;
|
19
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerSubscription>;
|
20
|
-
update(resource: CustomerSubscriptionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerSubscription>;
|
21
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
22
|
-
customer(customerSubscriptionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
23
|
-
isCustomerSubscription(resource: any): resource is CustomerSubscription;
|
24
|
-
relationship(id: string | ResourceId | null): CustomerSubscriptionRel;
|
25
|
-
type(): string;
|
26
|
-
}
|
27
|
-
export default CustomerSubscriptions;
|
28
|
-
export { CustomerSubscription, CustomerSubscriptionCreate, CustomerSubscriptionUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Customer}from'./customers';declare type CustomerSubscriptionRel=ResourceRel&{type:typeof CustomerSubscriptions.TYPE;};interface CustomerSubscription extends Resource{customer_email?:string;customer?:Customer;}interface CustomerSubscriptionCreate extends ResourceCreate{customer_email:string;}declare type CustomerSubscriptionUpdate=ResourceUpdate;declare class CustomerSubscriptions extends ApiResource{static readonly TYPE:'customer_subscriptions';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<CustomerSubscription>>;create(resource:CustomerSubscriptionCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerSubscription>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerSubscription>;update(resource:CustomerSubscriptionUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerSubscription>;delete(id:string,options?:ResourcesConfig):Promise<void>;customer(customerSubscriptionId:string|CustomerSubscription,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Customer>;isCustomerSubscription(resource:any):resource is CustomerSubscription;relationship(id:string|ResourceId|null):CustomerSubscriptionRel;type():string;}export default CustomerSubscriptions;export{CustomerSubscription,CustomerSubscriptionCreate,CustomerSubscriptionUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as c}from"../resource";class r extends c{static TYPE="customer_subscriptions";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create({...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({...e,type:r.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async customer(e,t,s){const i=e.id||e;return this.resources.fetch({type:"customers"},`customer_subscriptions/${i}/customer`,t,s)}isCustomerSubscription(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}export default r;
|
@@ -1,60 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { CustomerGroup } from './customer_groups';
|
4
|
-
import { CustomerAddress } from './customer_addresses';
|
5
|
-
import { CustomerPaymentSource } from './customer_payment_sources';
|
6
|
-
import { CustomerSubscription } from './customer_subscriptions';
|
7
|
-
import { Order } from './orders';
|
8
|
-
import { OrderSubscription } from './order_subscriptions';
|
9
|
-
import { Return } from './returns';
|
10
|
-
import { Attachment } from './attachments';
|
11
|
-
declare type CustomerRel = ResourceRel & {
|
12
|
-
type: typeof Customers.TYPE;
|
13
|
-
};
|
14
|
-
declare type CustomerGroupRel = ResourceRel & {
|
15
|
-
type: 'customer_groups';
|
16
|
-
};
|
17
|
-
interface Customer extends Resource {
|
18
|
-
email?: string;
|
19
|
-
status?: string;
|
20
|
-
has_password?: boolean;
|
21
|
-
customer_group?: CustomerGroup;
|
22
|
-
customer_addresses?: CustomerAddress[];
|
23
|
-
customer_payment_sources?: CustomerPaymentSource[];
|
24
|
-
customer_subscriptions?: CustomerSubscription[];
|
25
|
-
orders?: Order[];
|
26
|
-
order_subscriptions?: OrderSubscription[];
|
27
|
-
returns?: Return[];
|
28
|
-
attachments?: Attachment[];
|
29
|
-
}
|
30
|
-
interface CustomerCreate extends ResourceCreate {
|
31
|
-
email: string;
|
32
|
-
password?: string;
|
33
|
-
customer_group?: CustomerGroupRel;
|
34
|
-
}
|
35
|
-
interface CustomerUpdate extends ResourceUpdate {
|
36
|
-
email?: string;
|
37
|
-
password?: string;
|
38
|
-
customer_group?: CustomerGroupRel;
|
39
|
-
}
|
40
|
-
declare class Customers extends ApiResource {
|
41
|
-
static readonly TYPE: 'customers';
|
42
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Customer>>;
|
43
|
-
create(resource: CustomerCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
44
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
45
|
-
update(resource: CustomerUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
46
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
47
|
-
customer_group(customerId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerGroup>;
|
48
|
-
customer_addresses(customerId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CustomerAddress>>;
|
49
|
-
customer_payment_sources(customerId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CustomerPaymentSource>>;
|
50
|
-
customer_subscriptions(customerId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CustomerSubscription>>;
|
51
|
-
orders(customerId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Order>>;
|
52
|
-
order_subscriptions(customerId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderSubscription>>;
|
53
|
-
returns(customerId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Return>>;
|
54
|
-
attachments(customerId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
55
|
-
isCustomer(resource: any): resource is Customer;
|
56
|
-
relationship(id: string | ResourceId | null): CustomerRel;
|
57
|
-
type(): string;
|
58
|
-
}
|
59
|
-
export default Customers;
|
60
|
-
export { Customer, CustomerCreate, CustomerUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{CustomerGroup}from'./customer_groups';import type{CustomerAddress}from'./customer_addresses';import type{CustomerPaymentSource}from'./customer_payment_sources';import type{CustomerSubscription}from'./customer_subscriptions';import type{Order}from'./orders';import type{OrderSubscription}from'./order_subscriptions';import type{Return}from'./returns';import type{Attachment}from'./attachments';declare type CustomerRel=ResourceRel&{type:typeof Customers.TYPE;};declare type CustomerGroupRel=ResourceRel&{type:'customer_groups';};interface Customer extends Resource{email?:string;status?:string;has_password?:boolean;customer_group?:CustomerGroup;customer_addresses?:CustomerAddress[];customer_payment_sources?:CustomerPaymentSource[];customer_subscriptions?:CustomerSubscription[];orders?:Order[];order_subscriptions?:OrderSubscription[];returns?:Return[];attachments?:Attachment[];}interface CustomerCreate extends ResourceCreate{email:string;password?:string;customer_group?:CustomerGroupRel;}interface CustomerUpdate extends ResourceUpdate{email?:string;password?:string;customer_group?:CustomerGroupRel;}declare class Customers extends ApiResource{static readonly TYPE:'customers';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Customer>>;create(resource:CustomerCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Customer>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Customer>;update(resource:CustomerUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Customer>;delete(id:string,options?:ResourcesConfig):Promise<void>;customer_group(customerId:string|Customer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerGroup>;customer_addresses(customerId:string|Customer,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<CustomerAddress>>;customer_payment_sources(customerId:string|Customer,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<CustomerPaymentSource>>;customer_subscriptions(customerId:string|Customer,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<CustomerSubscription>>;orders(customerId:string|Customer,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Order>>;order_subscriptions(customerId:string|Customer,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<OrderSubscription>>;returns(customerId:string|Customer,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Return>>;attachments(customerId:string|Customer,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isCustomer(resource:any):resource is Customer;relationship(id:string|ResourceId|null):CustomerRel;type():string;}export default Customers;export{Customer,CustomerCreate,CustomerUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as u}from"../resource";class c extends u{static TYPE="customers";async list(e,s){return this.resources.list({type:c.TYPE},e,s)}async create(e,s,t){return this.resources.create({...e,type:c.TYPE},s,t)}async retrieve(e,s,t){return this.resources.retrieve({type:c.TYPE,id:e},s,t)}async update(e,s,t){return this.resources.update({...e,type:c.TYPE},s,t)}async delete(e,s){await this.resources.delete({type:c.TYPE,id:e},s)}async customer_group(e,s,t){const r=e.id||e;return this.resources.fetch({type:"customer_groups"},`customers/${r}/customer_group`,s,t)}async customer_addresses(e,s,t){const r=e.id||e;return this.resources.fetch({type:"customer_addresses"},`customers/${r}/customer_addresses`,s,t)}async customer_payment_sources(e,s,t){const r=e.id||e;return this.resources.fetch({type:"customer_payment_sources"},`customers/${r}/customer_payment_sources`,s,t)}async customer_subscriptions(e,s,t){const r=e.id||e;return this.resources.fetch({type:"customer_subscriptions"},`customers/${r}/customer_subscriptions`,s,t)}async orders(e,s,t){const r=e.id||e;return this.resources.fetch({type:"orders"},`customers/${r}/orders`,s,t)}async order_subscriptions(e,s,t){const r=e.id||e;return this.resources.fetch({type:"order_subscriptions"},`customers/${r}/order_subscriptions`,s,t)}async returns(e,s,t){const r=e.id||e;return this.resources.fetch({type:"returns"},`customers/${r}/returns`,s,t)}async attachments(e,s,t){const r=e.id||e;return this.resources.fetch({type:"attachments"},`customers/${r}/attachments`,s,t)}isCustomer(e){return e.type&&e.type===c.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:c.TYPE}:{id:e.id,type:c.TYPE}}type(){return c.TYPE}}export default c;
|
@@ -1,51 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { StockLocation } from './stock_locations';
|
4
|
-
import { ShippingMethod } from './shipping_methods';
|
5
|
-
import { Attachment } from './attachments';
|
6
|
-
declare type DeliveryLeadTimeRel = ResourceRel & {
|
7
|
-
type: typeof DeliveryLeadTimes.TYPE;
|
8
|
-
};
|
9
|
-
declare type StockLocationRel = ResourceRel & {
|
10
|
-
type: 'stock_locations';
|
11
|
-
};
|
12
|
-
declare type ShippingMethodRel = ResourceRel & {
|
13
|
-
type: 'shipping_methods';
|
14
|
-
};
|
15
|
-
interface DeliveryLeadTime extends Resource {
|
16
|
-
min_hours?: number;
|
17
|
-
max_hours?: number;
|
18
|
-
min_days?: number;
|
19
|
-
max_days?: number;
|
20
|
-
stock_location?: StockLocation;
|
21
|
-
shipping_method?: ShippingMethod;
|
22
|
-
attachments?: Attachment[];
|
23
|
-
}
|
24
|
-
interface DeliveryLeadTimeCreate extends ResourceCreate {
|
25
|
-
min_hours: number;
|
26
|
-
max_hours: number;
|
27
|
-
stock_location: StockLocationRel;
|
28
|
-
shipping_method: ShippingMethodRel;
|
29
|
-
}
|
30
|
-
interface DeliveryLeadTimeUpdate extends ResourceUpdate {
|
31
|
-
min_hours?: number;
|
32
|
-
max_hours?: number;
|
33
|
-
stock_location?: StockLocationRel;
|
34
|
-
shipping_method?: ShippingMethodRel;
|
35
|
-
}
|
36
|
-
declare class DeliveryLeadTimes extends ApiResource {
|
37
|
-
static readonly TYPE: 'delivery_lead_times';
|
38
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<DeliveryLeadTime>>;
|
39
|
-
create(resource: DeliveryLeadTimeCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<DeliveryLeadTime>;
|
40
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<DeliveryLeadTime>;
|
41
|
-
update(resource: DeliveryLeadTimeUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<DeliveryLeadTime>;
|
42
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
43
|
-
stock_location(deliveryLeadTimeId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
44
|
-
shipping_method(deliveryLeadTimeId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
|
45
|
-
attachments(deliveryLeadTimeId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
46
|
-
isDeliveryLeadTime(resource: any): resource is DeliveryLeadTime;
|
47
|
-
relationship(id: string | ResourceId | null): DeliveryLeadTimeRel;
|
48
|
-
type(): string;
|
49
|
-
}
|
50
|
-
export default DeliveryLeadTimes;
|
51
|
-
export { DeliveryLeadTime, DeliveryLeadTimeCreate, DeliveryLeadTimeUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{StockLocation}from'./stock_locations';import type{ShippingMethod}from'./shipping_methods';import type{Attachment}from'./attachments';declare type DeliveryLeadTimeRel=ResourceRel&{type:typeof DeliveryLeadTimes.TYPE;};declare type StockLocationRel=ResourceRel&{type:'stock_locations';};declare type ShippingMethodRel=ResourceRel&{type:'shipping_methods';};interface DeliveryLeadTime extends Resource{min_hours?:number;max_hours?:number;min_days?:number;max_days?:number;stock_location?:StockLocation;shipping_method?:ShippingMethod;attachments?:Attachment[];}interface DeliveryLeadTimeCreate extends ResourceCreate{min_hours:number;max_hours:number;stock_location:StockLocationRel;shipping_method:ShippingMethodRel;}interface DeliveryLeadTimeUpdate extends ResourceUpdate{min_hours?:number;max_hours?:number;stock_location?:StockLocationRel;shipping_method?:ShippingMethodRel;}declare class DeliveryLeadTimes extends ApiResource{static readonly TYPE:'delivery_lead_times';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<DeliveryLeadTime>>;create(resource:DeliveryLeadTimeCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<DeliveryLeadTime>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<DeliveryLeadTime>;update(resource:DeliveryLeadTimeUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<DeliveryLeadTime>;delete(id:string,options?:ResourcesConfig):Promise<void>;stock_location(deliveryLeadTimeId:string|DeliveryLeadTime,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLocation>;shipping_method(deliveryLeadTimeId:string|DeliveryLeadTime,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ShippingMethod>;attachments(deliveryLeadTimeId:string|DeliveryLeadTime,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isDeliveryLeadTime(resource:any):resource is DeliveryLeadTime;relationship(id:string|ResourceId|null):DeliveryLeadTimeRel;type():string;}export default DeliveryLeadTimes;export{DeliveryLeadTime,DeliveryLeadTimeCreate,DeliveryLeadTimeUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as c}from"../resource";class r extends c{static TYPE="delivery_lead_times";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create({...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({...e,type:r.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async stock_location(e,t,s){const i=e.id||e;return this.resources.fetch({type:"stock_locations"},`delivery_lead_times/${i}/stock_location`,t,s)}async shipping_method(e,t,s){const i=e.id||e;return this.resources.fetch({type:"shipping_methods"},`delivery_lead_times/${i}/shipping_method`,t,s)}async attachments(e,t,s){const i=e.id||e;return this.resources.fetch({type:"attachments"},`delivery_lead_times/${i}/attachments`,t,s)}isDeliveryLeadTime(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}export default r;
|
@@ -1,24 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Webhook } from './webhooks';
|
4
|
-
declare type EventCallbackRel = ResourceRel & {
|
5
|
-
type: typeof EventCallbacks.TYPE;
|
6
|
-
};
|
7
|
-
interface EventCallback extends Resource {
|
8
|
-
callback_url?: string;
|
9
|
-
payload?: object;
|
10
|
-
response_code?: string;
|
11
|
-
response_message?: string;
|
12
|
-
webhook?: Webhook;
|
13
|
-
}
|
14
|
-
declare class EventCallbacks extends ApiResource {
|
15
|
-
static readonly TYPE: 'event_callbacks';
|
16
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<EventCallback>>;
|
17
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<EventCallback>;
|
18
|
-
webhook(eventCallbackId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
|
19
|
-
isEventCallback(resource: any): resource is EventCallback;
|
20
|
-
relationship(id: string | ResourceId | null): EventCallbackRel;
|
21
|
-
type(): string;
|
22
|
-
}
|
23
|
-
export default EventCallbacks;
|
24
|
-
export { EventCallback };
|
1
|
+
import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Webhook}from'./webhooks';declare type EventCallbackRel=ResourceRel&{type:typeof EventCallbacks.TYPE;};interface EventCallback extends Resource{callback_url?:string;payload?:object;response_code?:string;response_message?:string;webhook?:Webhook;}declare class EventCallbacks extends ApiResource{static readonly TYPE:'event_callbacks';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<EventCallback>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<EventCallback>;webhook(eventCallbackId:string|EventCallback,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Webhook>;isEventCallback(resource:any):resource is EventCallback;relationship(id:string|ResourceId|null):EventCallbackRel;type():string;}export default EventCallbacks;export{EventCallback};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class t extends n{static TYPE="event_callbacks";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)}async webhook(e,r,s){const i=e.id||e;return this.resources.fetch({type:"webhooks"},`event_callbacks/${i}/webhook`,r,s)}isEventCallback(e){return e.type&&e.type===t.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}export default t;
|
@@ -1,49 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { PaymentMethod } from './payment_methods';
|
4
|
-
import { ExternalPayment } from './external_payments';
|
5
|
-
declare type ExternalGatewayRel = ResourceRel & {
|
6
|
-
type: typeof ExternalGateways.TYPE;
|
7
|
-
};
|
8
|
-
interface ExternalGateway extends Resource {
|
9
|
-
name?: string;
|
10
|
-
shared_secret?: string;
|
11
|
-
authorize_url?: string;
|
12
|
-
capture_url?: string;
|
13
|
-
void_url?: string;
|
14
|
-
refund_url?: string;
|
15
|
-
token_url?: string;
|
16
|
-
payment_methods?: PaymentMethod[];
|
17
|
-
external_payments?: ExternalPayment[];
|
18
|
-
}
|
19
|
-
interface ExternalGatewayCreate extends ResourceCreate {
|
20
|
-
name: string;
|
21
|
-
authorize_url?: string;
|
22
|
-
capture_url?: string;
|
23
|
-
void_url?: string;
|
24
|
-
refund_url?: string;
|
25
|
-
token_url?: string;
|
26
|
-
}
|
27
|
-
interface ExternalGatewayUpdate extends ResourceUpdate {
|
28
|
-
name?: string;
|
29
|
-
authorize_url?: string;
|
30
|
-
capture_url?: string;
|
31
|
-
void_url?: string;
|
32
|
-
refund_url?: string;
|
33
|
-
token_url?: string;
|
34
|
-
}
|
35
|
-
declare class ExternalGateways extends ApiResource {
|
36
|
-
static readonly TYPE: 'external_gateways';
|
37
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ExternalGateway>>;
|
38
|
-
create(resource: ExternalGatewayCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalGateway>;
|
39
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalGateway>;
|
40
|
-
update(resource: ExternalGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalGateway>;
|
41
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
42
|
-
payment_methods(externalGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
43
|
-
external_payments(externalGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ExternalPayment>>;
|
44
|
-
isExternalGateway(resource: any): resource is ExternalGateway;
|
45
|
-
relationship(id: string | ResourceId | null): ExternalGatewayRel;
|
46
|
-
type(): string;
|
47
|
-
}
|
48
|
-
export default ExternalGateways;
|
49
|
-
export { ExternalGateway, ExternalGatewayCreate, ExternalGatewayUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{PaymentMethod}from'./payment_methods';import type{ExternalPayment}from'./external_payments';declare type ExternalGatewayRel=ResourceRel&{type:typeof ExternalGateways.TYPE;};interface ExternalGateway extends Resource{name?:string;shared_secret?:string;authorize_url?:string;capture_url?:string;void_url?:string;refund_url?:string;token_url?:string;payment_methods?:PaymentMethod[];external_payments?:ExternalPayment[];}interface ExternalGatewayCreate extends ResourceCreate{name:string;authorize_url?:string;capture_url?:string;void_url?:string;refund_url?:string;token_url?:string;}interface ExternalGatewayUpdate extends ResourceUpdate{name?:string;authorize_url?:string;capture_url?:string;void_url?:string;refund_url?:string;token_url?:string;}declare class ExternalGateways extends ApiResource{static readonly TYPE:'external_gateways';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ExternalGateway>>;create(resource:ExternalGatewayCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ExternalGateway>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ExternalGateway>;update(resource:ExternalGatewayUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ExternalGateway>;delete(id:string,options?:ResourcesConfig):Promise<void>;payment_methods(externalGatewayId:string|ExternalGateway,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PaymentMethod>>;external_payments(externalGatewayId:string|ExternalGateway,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ExternalPayment>>;isExternalGateway(resource:any):resource is ExternalGateway;relationship(id:string|ResourceId|null):ExternalGatewayRel;type():string;}export default ExternalGateways;export{ExternalGateway,ExternalGatewayCreate,ExternalGatewayUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class r extends n{static TYPE="external_gateways";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create({...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({...e,type:r.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async payment_methods(e,t,s){const a=e.id||e;return this.resources.fetch({type:"payment_methods"},`external_gateways/${a}/payment_methods`,t,s)}async external_payments(e,t,s){const a=e.id||e;return this.resources.fetch({type:"external_payments"},`external_gateways/${a}/external_payments`,t,s)}isExternalGateway(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}export default r;
|
@@ -1,43 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Order } from './orders';
|
4
|
-
import { PaymentGateway } from './payment_gateways';
|
5
|
-
import { CustomerPaymentSource } from './customer_payment_sources';
|
6
|
-
declare type ExternalPaymentRel = ResourceRel & {
|
7
|
-
type: typeof ExternalPayments.TYPE;
|
8
|
-
};
|
9
|
-
declare type OrderRel = ResourceRel & {
|
10
|
-
type: 'orders';
|
11
|
-
};
|
12
|
-
interface ExternalPayment extends Resource {
|
13
|
-
payment_source_token?: string;
|
14
|
-
options?: object;
|
15
|
-
order?: Order;
|
16
|
-
payment_gateway?: PaymentGateway;
|
17
|
-
wallet?: CustomerPaymentSource;
|
18
|
-
}
|
19
|
-
interface ExternalPaymentCreate extends ResourceCreate {
|
20
|
-
payment_source_token: string;
|
21
|
-
options?: object;
|
22
|
-
order: OrderRel;
|
23
|
-
}
|
24
|
-
interface ExternalPaymentUpdate extends ResourceUpdate {
|
25
|
-
options?: object;
|
26
|
-
order?: OrderRel;
|
27
|
-
}
|
28
|
-
declare class ExternalPayments extends ApiResource {
|
29
|
-
static readonly TYPE: 'external_payments';
|
30
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ExternalPayment>>;
|
31
|
-
create(resource: ExternalPaymentCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalPayment>;
|
32
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalPayment>;
|
33
|
-
update(resource: ExternalPaymentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalPayment>;
|
34
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
35
|
-
order(externalPaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
36
|
-
payment_gateway(externalPaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
|
37
|
-
wallet(externalPaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerPaymentSource>;
|
38
|
-
isExternalPayment(resource: any): resource is ExternalPayment;
|
39
|
-
relationship(id: string | ResourceId | null): ExternalPaymentRel;
|
40
|
-
type(): string;
|
41
|
-
}
|
42
|
-
export default ExternalPayments;
|
43
|
-
export { ExternalPayment, ExternalPaymentCreate, ExternalPaymentUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Order}from'./orders';import type{PaymentGateway}from'./payment_gateways';import type{CustomerPaymentSource}from'./customer_payment_sources';declare type ExternalPaymentRel=ResourceRel&{type:typeof ExternalPayments.TYPE;};declare type OrderRel=ResourceRel&{type:'orders';};interface ExternalPayment extends Resource{payment_source_token?:string;options?:object;order?:Order;payment_gateway?:PaymentGateway;wallet?:CustomerPaymentSource;}interface ExternalPaymentCreate extends ResourceCreate{payment_source_token:string;options?:object;order:OrderRel;}interface ExternalPaymentUpdate extends ResourceUpdate{options?:object;order?:OrderRel;}declare class ExternalPayments extends ApiResource{static readonly TYPE:'external_payments';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ExternalPayment>>;create(resource:ExternalPaymentCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ExternalPayment>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ExternalPayment>;update(resource:ExternalPaymentUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ExternalPayment>;delete(id:string,options?:ResourcesConfig):Promise<void>;order(externalPaymentId:string|ExternalPayment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;payment_gateway(externalPaymentId:string|ExternalPayment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentGateway>;wallet(externalPaymentId:string|ExternalPayment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerPaymentSource>;isExternalPayment(resource:any):resource is ExternalPayment;relationship(id:string|ResourceId|null):ExternalPaymentRel;type():string;}export default ExternalPayments;export{ExternalPayment,ExternalPaymentCreate,ExternalPaymentUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class s extends n{static TYPE="external_payments";async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create({...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({...e,type:s.TYPE},t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}async order(e,t,r){const a=e.id||e;return this.resources.fetch({type:"orders"},`external_payments/${a}/order`,t,r)}async payment_gateway(e,t,r){const a=e.id||e;return this.resources.fetch({type:"payment_gateways"},`external_payments/${a}/payment_gateway`,t,r)}async wallet(e,t,r){const a=e.id||e;return this.resources.fetch({type:"customer_payment_sources"},`external_payments/${a}/wallet`,t,r)}isExternalPayment(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}export default s;
|