@commercelayer/sdk 5.0.0-alpha.1 → 5.0.0-alpha.4
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 +69 -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 +19 -22
@@ -1,47 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Order } from './orders';
|
4
|
-
import { PaymentGateway } from './payment_gateways';
|
5
|
-
declare type BraintreePaymentRel = ResourceRel & {
|
6
|
-
type: typeof BraintreePayments.TYPE;
|
7
|
-
};
|
8
|
-
declare type OrderRel = ResourceRel & {
|
9
|
-
type: 'orders';
|
10
|
-
};
|
11
|
-
interface BraintreePayment extends Resource {
|
12
|
-
client_token?: string;
|
13
|
-
payment_method_nonce?: string;
|
14
|
-
payment_id?: string;
|
15
|
-
local?: boolean;
|
16
|
-
options?: object;
|
17
|
-
order?: Order;
|
18
|
-
payment_gateway?: PaymentGateway;
|
19
|
-
}
|
20
|
-
interface BraintreePaymentCreate extends ResourceCreate {
|
21
|
-
payment_id?: string;
|
22
|
-
local?: boolean;
|
23
|
-
options?: object;
|
24
|
-
order: OrderRel;
|
25
|
-
}
|
26
|
-
interface BraintreePaymentUpdate extends ResourceUpdate {
|
27
|
-
payment_method_nonce?: string;
|
28
|
-
payment_id?: string;
|
29
|
-
local?: boolean;
|
30
|
-
options?: object;
|
31
|
-
order?: OrderRel;
|
32
|
-
}
|
33
|
-
declare class BraintreePayments extends ApiResource {
|
34
|
-
static readonly TYPE: 'braintree_payments';
|
35
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<BraintreePayment>>;
|
36
|
-
create(resource: BraintreePaymentCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BraintreePayment>;
|
37
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BraintreePayment>;
|
38
|
-
update(resource: BraintreePaymentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<BraintreePayment>;
|
39
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
40
|
-
order(braintreePaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
41
|
-
payment_gateway(braintreePaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
|
42
|
-
isBraintreePayment(resource: any): resource is BraintreePayment;
|
43
|
-
relationship(id: string | ResourceId | null): BraintreePaymentRel;
|
44
|
-
type(): string;
|
45
|
-
}
|
46
|
-
export default BraintreePayments;
|
47
|
-
export { BraintreePayment, BraintreePaymentCreate, BraintreePaymentUpdate };
|
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';declare type BraintreePaymentRel=ResourceRel&{type:typeof BraintreePayments.TYPE;};declare type OrderRel=ResourceRel&{type:'orders';};interface BraintreePayment extends Resource{client_token?:string;payment_method_nonce?:string;payment_id?:string;local?:boolean;options?:object;order?:Order;payment_gateway?:PaymentGateway;}interface BraintreePaymentCreate extends ResourceCreate{payment_id?:string;local?:boolean;options?:object;order:OrderRel;}interface BraintreePaymentUpdate extends ResourceUpdate{payment_method_nonce?:string;payment_id?:string;local?:boolean;options?:object;order?:OrderRel;}declare class BraintreePayments extends ApiResource{static readonly TYPE:'braintree_payments';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<BraintreePayment>>;create(resource:BraintreePaymentCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<BraintreePayment>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<BraintreePayment>;update(resource:BraintreePaymentUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<BraintreePayment>;delete(id:string,options?:ResourcesConfig):Promise<void>;order(braintreePaymentId:string|BraintreePayment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;payment_gateway(braintreePaymentId:string|BraintreePayment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentGateway>;isBraintreePayment(resource:any):resource is BraintreePayment;relationship(id:string|ResourceId|null):BraintreePaymentRel;type():string;}export default BraintreePayments;export{BraintreePayment,BraintreePaymentCreate,BraintreePaymentUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class r extends n{static TYPE="braintree_payments";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 order(e,t,s){const a=e.id||e;return this.resources.fetch({type:"orders"},`braintree_payments/${a}/order`,t,s)}async payment_gateway(e,t,s){const a=e.id||e;return this.resources.fetch({type:"payment_gateways"},`braintree_payments/${a}/payment_gateway`,t,s)}isBraintreePayment(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,74 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Market } from './markets';
|
4
|
-
import { SkuList } from './sku_lists';
|
5
|
-
import { Sku } from './skus';
|
6
|
-
import { Attachment } from './attachments';
|
7
|
-
declare type BundleRel = ResourceRel & {
|
8
|
-
type: typeof Bundles.TYPE;
|
9
|
-
};
|
10
|
-
declare type MarketRel = ResourceRel & {
|
11
|
-
type: 'markets';
|
12
|
-
};
|
13
|
-
declare type SkuListRel = ResourceRel & {
|
14
|
-
type: 'sku_lists';
|
15
|
-
};
|
16
|
-
interface Bundle extends Resource {
|
17
|
-
code?: string;
|
18
|
-
name?: string;
|
19
|
-
currency_code?: string;
|
20
|
-
description?: string;
|
21
|
-
image_url?: string;
|
22
|
-
price_amount_cents?: number;
|
23
|
-
price_amount_float?: number;
|
24
|
-
formatted_price_amount?: string;
|
25
|
-
compare_at_amount_cents?: number;
|
26
|
-
compare_at_amount_float?: number;
|
27
|
-
formatted_compare_at_amount?: string;
|
28
|
-
skus_count?: number;
|
29
|
-
market?: Market;
|
30
|
-
sku_list?: SkuList;
|
31
|
-
skus?: Sku[];
|
32
|
-
attachments?: Attachment[];
|
33
|
-
}
|
34
|
-
interface BundleCreate extends ResourceCreate {
|
35
|
-
code: string;
|
36
|
-
name: string;
|
37
|
-
currency_code?: string;
|
38
|
-
description?: string;
|
39
|
-
image_url?: string;
|
40
|
-
price_amount_cents: number;
|
41
|
-
compare_at_amount_cents: number;
|
42
|
-
_compute_price_amount?: boolean;
|
43
|
-
_compute_compare_at_amount?: boolean;
|
44
|
-
market?: MarketRel;
|
45
|
-
sku_list: SkuListRel;
|
46
|
-
}
|
47
|
-
interface BundleUpdate extends ResourceUpdate {
|
48
|
-
code?: string;
|
49
|
-
name?: string;
|
50
|
-
currency_code?: string;
|
51
|
-
description?: string;
|
52
|
-
image_url?: string;
|
53
|
-
price_amount_cents?: number;
|
54
|
-
compare_at_amount_cents?: number;
|
55
|
-
_compute_price_amount?: boolean;
|
56
|
-
_compute_compare_at_amount?: boolean;
|
57
|
-
}
|
58
|
-
declare class Bundles extends ApiResource {
|
59
|
-
static readonly TYPE: 'bundles';
|
60
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Bundle>>;
|
61
|
-
create(resource: BundleCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Bundle>;
|
62
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Bundle>;
|
63
|
-
update(resource: BundleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Bundle>;
|
64
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
65
|
-
market(bundleId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
66
|
-
sku_list(bundleId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
67
|
-
skus(bundleId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
68
|
-
attachments(bundleId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
69
|
-
isBundle(resource: any): resource is Bundle;
|
70
|
-
relationship(id: string | ResourceId | null): BundleRel;
|
71
|
-
type(): string;
|
72
|
-
}
|
73
|
-
export default Bundles;
|
74
|
-
export { Bundle, BundleCreate, BundleUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Market}from'./markets';import type{SkuList}from'./sku_lists';import type{Sku}from'./skus';import type{Attachment}from'./attachments';declare type BundleRel=ResourceRel&{type:typeof Bundles.TYPE;};declare type MarketRel=ResourceRel&{type:'markets';};declare type SkuListRel=ResourceRel&{type:'sku_lists';};interface Bundle extends Resource{code?:string;name?:string;currency_code?:string;description?:string;image_url?:string;price_amount_cents?:number;price_amount_float?:number;formatted_price_amount?:string;compare_at_amount_cents?:number;compare_at_amount_float?:number;formatted_compare_at_amount?:string;skus_count?:number;market?:Market;sku_list?:SkuList;skus?:Sku[];attachments?:Attachment[];}interface BundleCreate extends ResourceCreate{code:string;name:string;currency_code?:string;description?:string;image_url?:string;price_amount_cents:number;compare_at_amount_cents:number;_compute_price_amount?:boolean;_compute_compare_at_amount?:boolean;market?:MarketRel;sku_list:SkuListRel;}interface BundleUpdate extends ResourceUpdate{code?:string;name?:string;currency_code?:string;description?:string;image_url?:string;price_amount_cents?:number;compare_at_amount_cents?:number;_compute_price_amount?:boolean;_compute_compare_at_amount?:boolean;}declare class Bundles extends ApiResource{static readonly TYPE:'bundles';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Bundle>>;create(resource:BundleCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Bundle>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Bundle>;update(resource:BundleUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Bundle>;delete(id:string,options?:ResourcesConfig):Promise<void>;market(bundleId:string|Bundle,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;sku_list(bundleId:string|Bundle,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuList>;skus(bundleId:string|Bundle,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Sku>>;attachments(bundleId:string|Bundle,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isBundle(resource:any):resource is Bundle;relationship(id:string|ResourceId|null):BundleRel;type():string;}export default Bundles;export{Bundle,BundleCreate,BundleUpdate};
|
package/lib/resources/bundles.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class r extends n{static TYPE="bundles";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 market(e,t,s){const c=e.id||e;return this.resources.fetch({type:"markets"},`bundles/${c}/market`,t,s)}async sku_list(e,t,s){const c=e.id||e;return this.resources.fetch({type:"sku_lists"},`bundles/${c}/sku_list`,t,s)}async skus(e,t,s){const c=e.id||e;return this.resources.fetch({type:"skus"},`bundles/${c}/skus`,t,s)}async attachments(e,t,s){const c=e.id||e;return this.resources.fetch({type:"attachments"},`bundles/${c}/attachments`,t,s)}isBundle(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,48 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Order } from './orders';
|
4
|
-
import { Authorization } from './authorizations';
|
5
|
-
import { Refund } from './refunds';
|
6
|
-
declare type CaptureRel = ResourceRel & {
|
7
|
-
type: typeof Captures.TYPE;
|
8
|
-
};
|
9
|
-
interface Capture extends Resource {
|
10
|
-
number?: string;
|
11
|
-
currency_code?: string;
|
12
|
-
amount_cents?: number;
|
13
|
-
amount_float?: number;
|
14
|
-
formatted_amount?: string;
|
15
|
-
succeeded?: boolean;
|
16
|
-
message?: string;
|
17
|
-
error_code?: string;
|
18
|
-
error_detail?: string;
|
19
|
-
token?: string;
|
20
|
-
gateway_transaction_id?: string;
|
21
|
-
refund_amount_cents?: number;
|
22
|
-
refund_amount_float?: number;
|
23
|
-
formatted_refund_amount?: string;
|
24
|
-
refund_balance_cents?: number;
|
25
|
-
refund_balance_float?: number;
|
26
|
-
formatted_refund_balance?: string;
|
27
|
-
order?: Order;
|
28
|
-
reference_authorization?: Authorization;
|
29
|
-
refunds?: Refund[];
|
30
|
-
}
|
31
|
-
interface CaptureUpdate extends ResourceUpdate {
|
32
|
-
_refund?: boolean;
|
33
|
-
_refund_amount_cents?: number;
|
34
|
-
}
|
35
|
-
declare class Captures extends ApiResource {
|
36
|
-
static readonly TYPE: 'captures';
|
37
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Capture>>;
|
38
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
|
39
|
-
update(resource: CaptureUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
|
40
|
-
order(captureId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
41
|
-
reference_authorization(captureId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
|
42
|
-
refunds(captureId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Refund>>;
|
43
|
-
isCapture(resource: any): resource is Capture;
|
44
|
-
relationship(id: string | ResourceId | null): CaptureRel;
|
45
|
-
type(): string;
|
46
|
-
}
|
47
|
-
export default Captures;
|
48
|
-
export { Capture, CaptureUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Order}from'./orders';import type{Authorization}from'./authorizations';import type{Refund}from'./refunds';declare type CaptureRel=ResourceRel&{type:typeof Captures.TYPE;};interface Capture extends Resource{number?:string;currency_code?:string;amount_cents?:number;amount_float?:number;formatted_amount?:string;succeeded?:boolean;message?:string;error_code?:string;error_detail?:string;token?:string;gateway_transaction_id?:string;refund_amount_cents?:number;refund_amount_float?:number;formatted_refund_amount?:string;refund_balance_cents?:number;refund_balance_float?:number;formatted_refund_balance?:string;order?:Order;reference_authorization?:Authorization;refunds?:Refund[];}interface CaptureUpdate extends ResourceUpdate{_refund?:boolean;_refund_amount_cents?:number;}declare class Captures extends ApiResource{static readonly TYPE:'captures';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Capture>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Capture>;update(resource:CaptureUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Capture>;order(captureId:string|Capture,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;reference_authorization(captureId:string|Capture,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Authorization>;refunds(captureId:string|Capture,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Refund>>;isCapture(resource:any):resource is Capture;relationship(id:string|ResourceId|null):CaptureRel;type():string;}export default Captures;export{Capture,CaptureUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as u}from"../resource";class
|
1
|
+
import{ApiResource as u}from"../resource";class s extends u{static TYPE="captures";async list(e,r){return this.resources.list({type:s.TYPE},e,r)}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({...e,type:s.TYPE},r,t)}async order(e,r,t){const n=e.id||e;return this.resources.fetch({type:"orders"},`captures/${n}/order`,r,t)}async reference_authorization(e,r,t){const n=e.id||e;return this.resources.fetch({type:"authorizations"},`captures/${n}/reference_authorization`,r,t)}async refunds(e,r,t){const n=e.id||e;return this.resources.fetch({type:"refunds"},`captures/${n}/refunds`,r,t)}isCapture(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;
|
@@ -1,26 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Market } from './markets';
|
4
|
-
import { Attachment } from './attachments';
|
5
|
-
declare type CarrierAccountRel = ResourceRel & {
|
6
|
-
type: typeof CarrierAccounts.TYPE;
|
7
|
-
};
|
8
|
-
interface CarrierAccount extends Resource {
|
9
|
-
name?: string;
|
10
|
-
easypost_type?: string;
|
11
|
-
easypost_id?: string;
|
12
|
-
market?: Market;
|
13
|
-
attachments?: Attachment[];
|
14
|
-
}
|
15
|
-
declare class CarrierAccounts extends ApiResource {
|
16
|
-
static readonly TYPE: 'carrier_accounts';
|
17
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CarrierAccount>>;
|
18
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CarrierAccount>;
|
19
|
-
market(carrierAccountId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
20
|
-
attachments(carrierAccountId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
21
|
-
isCarrierAccount(resource: any): resource is CarrierAccount;
|
22
|
-
relationship(id: string | ResourceId | null): CarrierAccountRel;
|
23
|
-
type(): string;
|
24
|
-
}
|
25
|
-
export default CarrierAccounts;
|
26
|
-
export { CarrierAccount };
|
1
|
+
import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Market}from'./markets';import type{Attachment}from'./attachments';declare type CarrierAccountRel=ResourceRel&{type:typeof CarrierAccounts.TYPE;};interface CarrierAccount extends Resource{name?:string;easypost_type?:string;easypost_id?:string;market?:Market;attachments?:Attachment[];}declare class CarrierAccounts extends ApiResource{static readonly TYPE:'carrier_accounts';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<CarrierAccount>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CarrierAccount>;market(carrierAccountId:string|CarrierAccount,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;attachments(carrierAccountId:string|CarrierAccount,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isCarrierAccount(resource:any):resource is CarrierAccount;relationship(id:string|ResourceId|null):CarrierAccountRel;type():string;}export default CarrierAccounts;export{CarrierAccount};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as a}from"../resource";class t extends a{static TYPE="carrier_accounts";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 market(e,r,s){const c=e.id||e;return this.resources.fetch({type:"markets"},`carrier_accounts/${c}/market`,r,s)}async attachments(e,r,s){const c=e.id||e;return this.resources.fetch({type:"attachments"},`carrier_accounts/${c}/attachments`,r,s)}isCarrierAccount(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,45 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { PaymentMethod } from './payment_methods';
|
4
|
-
import { CheckoutComPayment } from './checkout_com_payments';
|
5
|
-
declare type CheckoutComGatewayRel = ResourceRel & {
|
6
|
-
type: typeof CheckoutComGateways.TYPE;
|
7
|
-
};
|
8
|
-
declare type CheckoutComPaymentRel = ResourceRel & {
|
9
|
-
type: 'checkout_com_payments';
|
10
|
-
};
|
11
|
-
interface CheckoutComGateway extends Resource {
|
12
|
-
name?: string;
|
13
|
-
webhook_endpoint_id?: string;
|
14
|
-
webhook_endpoint_secret?: string;
|
15
|
-
webhook_endpoint_url?: string;
|
16
|
-
payment_methods?: PaymentMethod[];
|
17
|
-
checkout_com_payments?: CheckoutComPayment[];
|
18
|
-
}
|
19
|
-
interface CheckoutComGatewayCreate extends ResourceCreate {
|
20
|
-
name: string;
|
21
|
-
secret_key: string;
|
22
|
-
public_key: string;
|
23
|
-
checkout_com_payments?: CheckoutComPaymentRel[];
|
24
|
-
}
|
25
|
-
interface CheckoutComGatewayUpdate extends ResourceUpdate {
|
26
|
-
name?: string;
|
27
|
-
secret_key?: string;
|
28
|
-
public_key?: string;
|
29
|
-
checkout_com_payments?: CheckoutComPaymentRel[];
|
30
|
-
}
|
31
|
-
declare class CheckoutComGateways extends ApiResource {
|
32
|
-
static readonly TYPE: 'checkout_com_gateways';
|
33
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CheckoutComGateway>>;
|
34
|
-
create(resource: CheckoutComGatewayCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CheckoutComGateway>;
|
35
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CheckoutComGateway>;
|
36
|
-
update(resource: CheckoutComGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CheckoutComGateway>;
|
37
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
38
|
-
payment_methods(checkoutComGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
39
|
-
checkout_com_payments(checkoutComGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CheckoutComPayment>>;
|
40
|
-
isCheckoutComGateway(resource: any): resource is CheckoutComGateway;
|
41
|
-
relationship(id: string | ResourceId | null): CheckoutComGatewayRel;
|
42
|
-
type(): string;
|
43
|
-
}
|
44
|
-
export default CheckoutComGateways;
|
45
|
-
export { CheckoutComGateway, CheckoutComGatewayCreate, CheckoutComGatewayUpdate };
|
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{CheckoutComPayment}from'./checkout_com_payments';declare type CheckoutComGatewayRel=ResourceRel&{type:typeof CheckoutComGateways.TYPE;};declare type CheckoutComPaymentRel=ResourceRel&{type:'checkout_com_payments';};interface CheckoutComGateway extends Resource{name?:string;webhook_endpoint_id?:string;webhook_endpoint_secret?:string;webhook_endpoint_url?:string;payment_methods?:PaymentMethod[];checkout_com_payments?:CheckoutComPayment[];}interface CheckoutComGatewayCreate extends ResourceCreate{name:string;secret_key:string;public_key:string;checkout_com_payments?:CheckoutComPaymentRel[];}interface CheckoutComGatewayUpdate extends ResourceUpdate{name?:string;secret_key?:string;public_key?:string;checkout_com_payments?:CheckoutComPaymentRel[];}declare class CheckoutComGateways extends ApiResource{static readonly TYPE:'checkout_com_gateways';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<CheckoutComGateway>>;create(resource:CheckoutComGatewayCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CheckoutComGateway>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CheckoutComGateway>;update(resource:CheckoutComGatewayUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CheckoutComGateway>;delete(id:string,options?:ResourcesConfig):Promise<void>;payment_methods(checkoutComGatewayId:string|CheckoutComGateway,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PaymentMethod>>;checkout_com_payments(checkoutComGatewayId:string|CheckoutComGateway,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<CheckoutComPayment>>;isCheckoutComGateway(resource:any):resource is CheckoutComGateway;relationship(id:string|ResourceId|null):CheckoutComGatewayRel;type():string;}export default CheckoutComGateways;export{CheckoutComGateway,CheckoutComGatewayCreate,CheckoutComGatewayUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as a}from"../resource";class r extends a{static TYPE="checkout_com_gateways";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,c){return this.resources.create({...e,type:r.TYPE},t,c)}async retrieve(e,t,c){return this.resources.retrieve({type:r.TYPE,id:e},t,c)}async update(e,t,c){return this.resources.update({...e,type:r.TYPE},t,c)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async payment_methods(e,t,c){const s=e.id||e;return this.resources.fetch({type:"payment_methods"},`checkout_com_gateways/${s}/payment_methods`,t,c)}async checkout_com_payments(e,t,c){const s=e.id||e;return this.resources.fetch({type:"checkout_com_payments"},`checkout_com_gateways/${s}/checkout_com_payments`,t,c)}isCheckoutComGateway(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,50 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Order } from './orders';
|
4
|
-
import { PaymentGateway } from './payment_gateways';
|
5
|
-
declare type CheckoutComPaymentRel = ResourceRel & {
|
6
|
-
type: typeof CheckoutComPayments.TYPE;
|
7
|
-
};
|
8
|
-
declare type OrderRel = ResourceRel & {
|
9
|
-
type: 'orders';
|
10
|
-
};
|
11
|
-
interface CheckoutComPayment extends Resource {
|
12
|
-
payment_type?: string;
|
13
|
-
token?: string;
|
14
|
-
session_id?: string;
|
15
|
-
source_id?: string;
|
16
|
-
customer_token?: string;
|
17
|
-
redirect_uri?: string;
|
18
|
-
payment_response?: object;
|
19
|
-
order?: Order;
|
20
|
-
payment_gateway?: PaymentGateway;
|
21
|
-
}
|
22
|
-
interface CheckoutComPaymentCreate extends ResourceCreate {
|
23
|
-
payment_type: string;
|
24
|
-
token: string;
|
25
|
-
session_id?: string;
|
26
|
-
order: OrderRel;
|
27
|
-
}
|
28
|
-
interface CheckoutComPaymentUpdate extends ResourceUpdate {
|
29
|
-
payment_type?: string;
|
30
|
-
token?: string;
|
31
|
-
session_id?: string;
|
32
|
-
_details?: boolean;
|
33
|
-
_refresh?: boolean;
|
34
|
-
order?: OrderRel;
|
35
|
-
}
|
36
|
-
declare class CheckoutComPayments extends ApiResource {
|
37
|
-
static readonly TYPE: 'checkout_com_payments';
|
38
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CheckoutComPayment>>;
|
39
|
-
create(resource: CheckoutComPaymentCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CheckoutComPayment>;
|
40
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CheckoutComPayment>;
|
41
|
-
update(resource: CheckoutComPaymentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CheckoutComPayment>;
|
42
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
43
|
-
order(checkoutComPaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
44
|
-
payment_gateway(checkoutComPaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
|
45
|
-
isCheckoutComPayment(resource: any): resource is CheckoutComPayment;
|
46
|
-
relationship(id: string | ResourceId | null): CheckoutComPaymentRel;
|
47
|
-
type(): string;
|
48
|
-
}
|
49
|
-
export default CheckoutComPayments;
|
50
|
-
export { CheckoutComPayment, CheckoutComPaymentCreate, CheckoutComPaymentUpdate };
|
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';declare type CheckoutComPaymentRel=ResourceRel&{type:typeof CheckoutComPayments.TYPE;};declare type OrderRel=ResourceRel&{type:'orders';};interface CheckoutComPayment extends Resource{public_key?:string;payment_type?:string;token?:string;session_id?:string;success_url?:string;failure_url?:string;source_id?:string;customer_token?:string;redirect_uri?:string;payment_response?:object;mismatched_amounts?:boolean;order?:Order;payment_gateway?:PaymentGateway;}interface CheckoutComPaymentCreate extends ResourceCreate{payment_type:string;token:string;session_id?:string;success_url?:string;failure_url?:string;order:OrderRel;}interface CheckoutComPaymentUpdate extends ResourceUpdate{payment_type?:string;token?:string;session_id?:string;success_url?:string;failure_url?:string;_details?:boolean;_refresh?:boolean;order?:OrderRel;}declare class CheckoutComPayments extends ApiResource{static readonly TYPE:'checkout_com_payments';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<CheckoutComPayment>>;create(resource:CheckoutComPaymentCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CheckoutComPayment>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CheckoutComPayment>;update(resource:CheckoutComPaymentUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CheckoutComPayment>;delete(id:string,options?:ResourcesConfig):Promise<void>;order(checkoutComPaymentId:string|CheckoutComPayment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;payment_gateway(checkoutComPaymentId:string|CheckoutComPayment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentGateway>;isCheckoutComPayment(resource:any):resource is CheckoutComPayment;relationship(id:string|ResourceId|null):CheckoutComPaymentRel;type():string;}export default CheckoutComPayments;export{CheckoutComPayment,CheckoutComPaymentCreate,CheckoutComPaymentUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as a}from"../resource";class
|
1
|
+
import{ApiResource as a}from"../resource";class r extends a{static TYPE="checkout_com_payments";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 order(e,t,s){const c=e.id||e;return this.resources.fetch({type:"orders"},`checkout_com_payments/${c}/order`,t,s)}async payment_gateway(e,t,s){const c=e.id||e;return this.resources.fetch({type:"payment_gateways"},`checkout_com_payments/${c}/payment_gateway`,t,s)}isCheckoutComPayment(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,59 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { PercentageDiscountPromotion } from './percentage_discount_promotions';
|
4
|
-
import { FreeShippingPromotion } from './free_shipping_promotions';
|
5
|
-
import { FixedAmountPromotion } from './fixed_amount_promotions';
|
6
|
-
import { FreeGiftPromotion } from './free_gift_promotions';
|
7
|
-
import { FixedPricePromotion } from './fixed_price_promotions';
|
8
|
-
import { ExternalPromotion } from './external_promotions';
|
9
|
-
import { Coupon } from './coupons';
|
10
|
-
declare type CouponCodesPromotionRuleRel = ResourceRel & {
|
11
|
-
type: typeof CouponCodesPromotionRules.TYPE;
|
12
|
-
};
|
13
|
-
declare type PercentageDiscountPromotionRel = ResourceRel & {
|
14
|
-
type: 'percentage_discount_promotions';
|
15
|
-
};
|
16
|
-
declare type FreeShippingPromotionRel = ResourceRel & {
|
17
|
-
type: 'free_shipping_promotions';
|
18
|
-
};
|
19
|
-
declare type FixedAmountPromotionRel = ResourceRel & {
|
20
|
-
type: 'fixed_amount_promotions';
|
21
|
-
};
|
22
|
-
declare type FreeGiftPromotionRel = ResourceRel & {
|
23
|
-
type: 'free_gift_promotions';
|
24
|
-
};
|
25
|
-
declare type FixedPricePromotionRel = ResourceRel & {
|
26
|
-
type: 'fixed_price_promotions';
|
27
|
-
};
|
28
|
-
declare type ExternalPromotionRel = ResourceRel & {
|
29
|
-
type: 'external_promotions';
|
30
|
-
};
|
31
|
-
declare type CouponRel = ResourceRel & {
|
32
|
-
type: 'coupons';
|
33
|
-
};
|
34
|
-
interface CouponCodesPromotionRule extends Resource {
|
35
|
-
promotion?: PercentageDiscountPromotion | FreeShippingPromotion | FixedAmountPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion;
|
36
|
-
coupons?: Coupon[];
|
37
|
-
}
|
38
|
-
interface CouponCodesPromotionRuleCreate extends ResourceCreate {
|
39
|
-
promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FixedAmountPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel;
|
40
|
-
coupons?: CouponRel[];
|
41
|
-
}
|
42
|
-
interface CouponCodesPromotionRuleUpdate extends ResourceUpdate {
|
43
|
-
promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FixedAmountPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel;
|
44
|
-
coupons?: CouponRel[];
|
45
|
-
}
|
46
|
-
declare class CouponCodesPromotionRules extends ApiResource {
|
47
|
-
static readonly TYPE: 'coupon_codes_promotion_rules';
|
48
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CouponCodesPromotionRule>>;
|
49
|
-
create(resource: CouponCodesPromotionRuleCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
50
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
51
|
-
update(resource: CouponCodesPromotionRuleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
52
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
53
|
-
coupons(couponCodesPromotionRuleId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
54
|
-
isCouponCodesPromotionRule(resource: any): resource is CouponCodesPromotionRule;
|
55
|
-
relationship(id: string | ResourceId | null): CouponCodesPromotionRuleRel;
|
56
|
-
type(): string;
|
57
|
-
}
|
58
|
-
export default CouponCodesPromotionRules;
|
59
|
-
export { CouponCodesPromotionRule, CouponCodesPromotionRuleCreate, CouponCodesPromotionRuleUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{PercentageDiscountPromotion}from'./percentage_discount_promotions';import type{FreeShippingPromotion}from'./free_shipping_promotions';import type{FixedAmountPromotion}from'./fixed_amount_promotions';import type{FreeGiftPromotion}from'./free_gift_promotions';import type{FixedPricePromotion}from'./fixed_price_promotions';import type{ExternalPromotion}from'./external_promotions';import type{Coupon}from'./coupons';declare type CouponCodesPromotionRuleRel=ResourceRel&{type:typeof CouponCodesPromotionRules.TYPE;};declare type PercentageDiscountPromotionRel=ResourceRel&{type:'percentage_discount_promotions';};declare type FreeShippingPromotionRel=ResourceRel&{type:'free_shipping_promotions';};declare type FixedAmountPromotionRel=ResourceRel&{type:'fixed_amount_promotions';};declare type FreeGiftPromotionRel=ResourceRel&{type:'free_gift_promotions';};declare type FixedPricePromotionRel=ResourceRel&{type:'fixed_price_promotions';};declare type ExternalPromotionRel=ResourceRel&{type:'external_promotions';};declare type CouponRel=ResourceRel&{type:'coupons';};interface CouponCodesPromotionRule extends Resource{promotion?:PercentageDiscountPromotion|FreeShippingPromotion|FixedAmountPromotion|FreeGiftPromotion|FixedPricePromotion|ExternalPromotion;coupons?:Coupon[];}interface CouponCodesPromotionRuleCreate extends ResourceCreate{promotion:PercentageDiscountPromotionRel|FreeShippingPromotionRel|FixedAmountPromotionRel|FreeGiftPromotionRel|FixedPricePromotionRel|ExternalPromotionRel;coupons?:CouponRel[];}interface CouponCodesPromotionRuleUpdate extends ResourceUpdate{promotion?:PercentageDiscountPromotionRel|FreeShippingPromotionRel|FixedAmountPromotionRel|FreeGiftPromotionRel|FixedPricePromotionRel|ExternalPromotionRel;coupons?:CouponRel[];}declare class CouponCodesPromotionRules extends ApiResource{static readonly TYPE:'coupon_codes_promotion_rules';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<CouponCodesPromotionRule>>;create(resource:CouponCodesPromotionRuleCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CouponCodesPromotionRule>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CouponCodesPromotionRule>;update(resource:CouponCodesPromotionRuleUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CouponCodesPromotionRule>;delete(id:string,options?:ResourcesConfig):Promise<void>;coupons(couponCodesPromotionRuleId:string|CouponCodesPromotionRule,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Coupon>>;isCouponCodesPromotionRule(resource:any):resource is CouponCodesPromotionRule;relationship(id:string|ResourceId|null):CouponCodesPromotionRuleRel;type():string;}export default CouponCodesPromotionRules;export{CouponCodesPromotionRule,CouponCodesPromotionRuleCreate,CouponCodesPromotionRuleUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class r extends n{static TYPE="coupon_codes_promotion_rules";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,o){return this.resources.create({...e,type:r.TYPE},t,o)}async retrieve(e,t,o){return this.resources.retrieve({type:r.TYPE,id:e},t,o)}async update(e,t,o){return this.resources.update({...e,type:r.TYPE},t,o)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async coupons(e,t,o){const s=e.id||e;return this.resources.fetch({type:"coupons"},`coupon_codes_promotion_rules/${s}/coupons`,t,o)}isCouponCodesPromotionRule(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,44 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Customer } from './customers';
|
4
|
-
import { Attachment } from './attachments';
|
5
|
-
declare type CouponRecipientRel = ResourceRel & {
|
6
|
-
type: typeof CouponRecipients.TYPE;
|
7
|
-
};
|
8
|
-
declare type CustomerRel = ResourceRel & {
|
9
|
-
type: 'customers';
|
10
|
-
};
|
11
|
-
interface CouponRecipient extends Resource {
|
12
|
-
email?: string;
|
13
|
-
first_name?: string;
|
14
|
-
last_name?: string;
|
15
|
-
customer?: Customer;
|
16
|
-
attachments?: Attachment[];
|
17
|
-
}
|
18
|
-
interface CouponRecipientCreate extends ResourceCreate {
|
19
|
-
email: string;
|
20
|
-
first_name?: string;
|
21
|
-
last_name?: string;
|
22
|
-
customer?: CustomerRel;
|
23
|
-
}
|
24
|
-
interface CouponRecipientUpdate extends ResourceUpdate {
|
25
|
-
email?: string;
|
26
|
-
first_name?: string;
|
27
|
-
last_name?: string;
|
28
|
-
customer?: CustomerRel;
|
29
|
-
}
|
30
|
-
declare class CouponRecipients extends ApiResource {
|
31
|
-
static readonly TYPE: 'coupon_recipients';
|
32
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CouponRecipient>>;
|
33
|
-
create(resource: CouponRecipientCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponRecipient>;
|
34
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponRecipient>;
|
35
|
-
update(resource: CouponRecipientUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponRecipient>;
|
36
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
37
|
-
customer(couponRecipientId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
38
|
-
attachments(couponRecipientId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
39
|
-
isCouponRecipient(resource: any): resource is CouponRecipient;
|
40
|
-
relationship(id: string | ResourceId | null): CouponRecipientRel;
|
41
|
-
type(): string;
|
42
|
-
}
|
43
|
-
export default CouponRecipients;
|
44
|
-
export { CouponRecipient, CouponRecipientCreate, CouponRecipientUpdate };
|
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{Attachment}from'./attachments';declare type CouponRecipientRel=ResourceRel&{type:typeof CouponRecipients.TYPE;};declare type CustomerRel=ResourceRel&{type:'customers';};interface CouponRecipient extends Resource{email?:string;first_name?:string;last_name?:string;customer?:Customer;attachments?:Attachment[];}interface CouponRecipientCreate extends ResourceCreate{email:string;first_name?:string;last_name?:string;customer?:CustomerRel;}interface CouponRecipientUpdate extends ResourceUpdate{email?:string;first_name?:string;last_name?:string;customer?:CustomerRel;}declare class CouponRecipients extends ApiResource{static readonly TYPE:'coupon_recipients';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<CouponRecipient>>;create(resource:CouponRecipientCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CouponRecipient>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CouponRecipient>;update(resource:CouponRecipientUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CouponRecipient>;delete(id:string,options?:ResourcesConfig):Promise<void>;customer(couponRecipientId:string|CouponRecipient,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Customer>;attachments(couponRecipientId:string|CouponRecipient,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isCouponRecipient(resource:any):resource is CouponRecipient;relationship(id:string|ResourceId|null):CouponRecipientRel;type():string;}export default CouponRecipients;export{CouponRecipient,CouponRecipientCreate,CouponRecipientUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as i}from"../resource";class r extends i{static TYPE="coupon_recipients";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 c=e.id||e;return this.resources.fetch({type:"customers"},`coupon_recipients/${c}/customer`,t,s)}async attachments(e,t,s){const c=e.id||e;return this.resources.fetch({type:"attachments"},`coupon_recipients/${c}/attachments`,t,s)}isCouponRecipient(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,45 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { CouponCodesPromotionRule } from './coupon_codes_promotion_rules';
|
4
|
-
declare type CouponRel = ResourceRel & {
|
5
|
-
type: typeof Coupons.TYPE;
|
6
|
-
};
|
7
|
-
declare type CouponCodesPromotionRuleRel = ResourceRel & {
|
8
|
-
type: 'coupon_codes_promotion_rules';
|
9
|
-
};
|
10
|
-
interface Coupon extends Resource {
|
11
|
-
code?: string;
|
12
|
-
customer_single_use?: boolean;
|
13
|
-
usage_limit?: number;
|
14
|
-
usage_count?: number;
|
15
|
-
recipient_email?: string;
|
16
|
-
promotion_rule?: CouponCodesPromotionRule;
|
17
|
-
}
|
18
|
-
interface CouponCreate extends ResourceCreate {
|
19
|
-
code: string;
|
20
|
-
customer_single_use?: boolean;
|
21
|
-
usage_limit: number;
|
22
|
-
recipient_email?: string;
|
23
|
-
promotion_rule: CouponCodesPromotionRuleRel;
|
24
|
-
}
|
25
|
-
interface CouponUpdate extends ResourceUpdate {
|
26
|
-
code?: string;
|
27
|
-
customer_single_use?: boolean;
|
28
|
-
usage_limit?: number;
|
29
|
-
recipient_email?: string;
|
30
|
-
promotion_rule?: CouponCodesPromotionRuleRel;
|
31
|
-
}
|
32
|
-
declare class Coupons extends ApiResource {
|
33
|
-
static readonly TYPE: 'coupons';
|
34
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
35
|
-
create(resource: CouponCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Coupon>;
|
36
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Coupon>;
|
37
|
-
update(resource: CouponUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Coupon>;
|
38
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
39
|
-
promotion_rule(couponId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
40
|
-
isCoupon(resource: any): resource is Coupon;
|
41
|
-
relationship(id: string | ResourceId | null): CouponRel;
|
42
|
-
type(): string;
|
43
|
-
}
|
44
|
-
export default Coupons;
|
45
|
-
export { Coupon, CouponCreate, CouponUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{CouponCodesPromotionRule}from'./coupon_codes_promotion_rules';declare type CouponRel=ResourceRel&{type:typeof Coupons.TYPE;};declare type CouponCodesPromotionRuleRel=ResourceRel&{type:'coupon_codes_promotion_rules';};interface Coupon extends Resource{code?:string;customer_single_use?:boolean;usage_limit?:number;usage_count?:number;recipient_email?:string;promotion_rule?:CouponCodesPromotionRule;}interface CouponCreate extends ResourceCreate{code:string;customer_single_use?:boolean;usage_limit:number;recipient_email?:string;promotion_rule:CouponCodesPromotionRuleRel;}interface CouponUpdate extends ResourceUpdate{code?:string;customer_single_use?:boolean;usage_limit?:number;recipient_email?:string;promotion_rule?:CouponCodesPromotionRuleRel;}declare class Coupons extends ApiResource{static readonly TYPE:'coupons';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Coupon>>;create(resource:CouponCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Coupon>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Coupon>;update(resource:CouponUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Coupon>;delete(id:string,options?:ResourcesConfig):Promise<void>;promotion_rule(couponId:string|Coupon,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CouponCodesPromotionRule>;isCoupon(resource:any):resource is Coupon;relationship(id:string|ResourceId|null):CouponRel;type():string;}export default Coupons;export{Coupon,CouponCreate,CouponUpdate};
|
package/lib/resources/coupons.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as i}from"../resource";class r extends i{static TYPE="coupons";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,o){return this.resources.create({...e,type:r.TYPE},t,o)}async retrieve(e,t,o){return this.resources.retrieve({type:r.TYPE,id:e},t,o)}async update(e,t,o){return this.resources.update({...e,type:r.TYPE},t,o)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async promotion_rule(e,t,o){const s=e.id||e;return this.resources.fetch({type:"coupon_codes_promotion_rules"},`coupons/${s}/promotion_rule`,t,o)}isCoupon(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,41 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Customer } from './customers';
|
4
|
-
import { Address } from './addresses';
|
5
|
-
declare type CustomerAddressRel = ResourceRel & {
|
6
|
-
type: typeof CustomerAddresses.TYPE;
|
7
|
-
};
|
8
|
-
declare type CustomerRel = ResourceRel & {
|
9
|
-
type: 'customers';
|
10
|
-
};
|
11
|
-
declare type AddressRel = ResourceRel & {
|
12
|
-
type: 'addresses';
|
13
|
-
};
|
14
|
-
interface CustomerAddress extends Resource {
|
15
|
-
name?: string;
|
16
|
-
customer?: Customer;
|
17
|
-
address?: Address;
|
18
|
-
}
|
19
|
-
interface CustomerAddressCreate extends ResourceCreate {
|
20
|
-
customer: CustomerRel;
|
21
|
-
address: AddressRel;
|
22
|
-
}
|
23
|
-
interface CustomerAddressUpdate extends ResourceUpdate {
|
24
|
-
customer?: CustomerRel;
|
25
|
-
address?: AddressRel;
|
26
|
-
}
|
27
|
-
declare class CustomerAddresses extends ApiResource {
|
28
|
-
static readonly TYPE: 'customer_addresses';
|
29
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CustomerAddress>>;
|
30
|
-
create(resource: CustomerAddressCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerAddress>;
|
31
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerAddress>;
|
32
|
-
update(resource: CustomerAddressUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerAddress>;
|
33
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
34
|
-
customer(customerAddressId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
35
|
-
address(customerAddressId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
36
|
-
isCustomerAddress(resource: any): resource is CustomerAddress;
|
37
|
-
relationship(id: string | ResourceId | null): CustomerAddressRel;
|
38
|
-
type(): string;
|
39
|
-
}
|
40
|
-
export default CustomerAddresses;
|
41
|
-
export { CustomerAddress, CustomerAddressCreate, CustomerAddressUpdate };
|
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{Address}from'./addresses';declare type CustomerAddressRel=ResourceRel&{type:typeof CustomerAddresses.TYPE;};declare type CustomerRel=ResourceRel&{type:'customers';};declare type AddressRel=ResourceRel&{type:'addresses';};interface CustomerAddress extends Resource{name?:string;customer?:Customer;address?:Address;}interface CustomerAddressCreate extends ResourceCreate{customer:CustomerRel;address:AddressRel;}interface CustomerAddressUpdate extends ResourceUpdate{customer?:CustomerRel;address?:AddressRel;}declare class CustomerAddresses extends ApiResource{static readonly TYPE:'customer_addresses';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<CustomerAddress>>;create(resource:CustomerAddressCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerAddress>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerAddress>;update(resource:CustomerAddressUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerAddress>;delete(id:string,options?:ResourcesConfig):Promise<void>;customer(customerAddressId:string|CustomerAddress,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Customer>;address(customerAddressId:string|CustomerAddress,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Address>;isCustomerAddress(resource:any):resource is CustomerAddress;relationship(id:string|ResourceId|null):CustomerAddressRel;type():string;}export default CustomerAddresses;export{CustomerAddress,CustomerAddressCreate,CustomerAddressUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as u}from"../resource";class r extends u{async list(e,s){return this.resources.list({type:r.TYPE},e,s)}async create(e,s,t){return this.resources.create({...e,type:r.TYPE},s,t)}async retrieve(e,s,t){return this.resources.retrieve({type:r.TYPE,id:e},s,t)}async update(e,s,t){return this.resources.update({...e,type:r.TYPE},s,t)}async delete(e,s){await this.resources.delete({type:r.TYPE,id:e},s)}async customer(e,s,t){return this.resources.fetch({type:"customers"},`customer_addresses/${
|
1
|
+
import{ApiResource as u}from"../resource";class r extends u{static TYPE="customer_addresses";async list(e,s){return this.resources.list({type:r.TYPE},e,s)}async create(e,s,t){return this.resources.create({...e,type:r.TYPE},s,t)}async retrieve(e,s,t){return this.resources.retrieve({type:r.TYPE,id:e},s,t)}async update(e,s,t){return this.resources.update({...e,type:r.TYPE},s,t)}async delete(e,s){await this.resources.delete({type:r.TYPE,id:e},s)}async customer(e,s,t){const c=e.id||e;return this.resources.fetch({type:"customers"},`customer_addresses/${c}/customer`,s,t)}async address(e,s,t){const c=e.id||e;return this.resources.fetch({type:"addresses"},`customer_addresses/${c}/address`,s,t)}isCustomerAddress(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;
|