@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,49 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Parcel } from './parcels';
|
4
|
-
import { StockLineItem } from './stock_line_items';
|
5
|
-
declare type ParcelLineItemRel = ResourceRel & {
|
6
|
-
type: typeof ParcelLineItems.TYPE;
|
7
|
-
};
|
8
|
-
declare type ParcelRel = ResourceRel & {
|
9
|
-
type: 'parcels';
|
10
|
-
};
|
11
|
-
declare type StockLineItemRel = ResourceRel & {
|
12
|
-
type: 'stock_line_items';
|
13
|
-
};
|
14
|
-
interface ParcelLineItem extends Resource {
|
15
|
-
sku_code?: string;
|
16
|
-
quantity?: number;
|
17
|
-
parcel?: Parcel;
|
18
|
-
stock_line_item?: StockLineItem;
|
19
|
-
/**
|
20
|
-
* @deprecated This field should not be used as it may be removed in the future without notice
|
21
|
-
*/
|
22
|
-
shipment_line_item?: object;
|
23
|
-
}
|
24
|
-
interface ParcelLineItemCreate extends ResourceCreate {
|
25
|
-
sku_code?: string;
|
26
|
-
quantity: number;
|
27
|
-
parcel: ParcelRel;
|
28
|
-
stock_line_item: StockLineItemRel;
|
29
|
-
/**
|
30
|
-
* @deprecated This field should not be used as it may be removed in the future without notice
|
31
|
-
*/
|
32
|
-
shipment_line_item?: object;
|
33
|
-
}
|
34
|
-
declare type ParcelLineItemUpdate = ResourceUpdate;
|
35
|
-
declare class ParcelLineItems extends ApiResource {
|
36
|
-
static readonly TYPE: 'parcel_line_items';
|
37
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ParcelLineItem>>;
|
38
|
-
create(resource: ParcelLineItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
|
39
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
|
40
|
-
update(resource: ParcelLineItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ParcelLineItem>;
|
41
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
42
|
-
parcel(parcelLineItemId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
43
|
-
stock_line_item(parcelLineItemId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
|
44
|
-
isParcelLineItem(resource: any): resource is ParcelLineItem;
|
45
|
-
relationship(id: string | ResourceId | null): ParcelLineItemRel;
|
46
|
-
type(): string;
|
47
|
-
}
|
48
|
-
export default ParcelLineItems;
|
49
|
-
export { ParcelLineItem, ParcelLineItemCreate, ParcelLineItemUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Parcel}from'./parcels';import type{StockLineItem}from'./stock_line_items';declare type ParcelLineItemRel=ResourceRel&{type:typeof ParcelLineItems.TYPE;};declare type ParcelRel=ResourceRel&{type:'parcels';};declare type StockLineItemRel=ResourceRel&{type:'stock_line_items';};interface ParcelLineItem extends Resource{sku_code?:string;quantity?:number;parcel?:Parcel;stock_line_item?:StockLineItem;shipment_line_item?:object;}interface ParcelLineItemCreate extends ResourceCreate{sku_code?:string;quantity:number;parcel:ParcelRel;stock_line_item:StockLineItemRel;shipment_line_item?:object;}declare type ParcelLineItemUpdate=ResourceUpdate;declare class ParcelLineItems extends ApiResource{static readonly TYPE:'parcel_line_items';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ParcelLineItem>>;create(resource:ParcelLineItemCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ParcelLineItem>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ParcelLineItem>;update(resource:ParcelLineItemUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ParcelLineItem>;delete(id:string,options?:ResourcesConfig):Promise<void>;parcel(parcelLineItemId:string|ParcelLineItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Parcel>;stock_line_item(parcelLineItemId:string|ParcelLineItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLineItem>;isParcelLineItem(resource:any):resource is ParcelLineItem;relationship(id:string|ResourceId|null):ParcelLineItemRel;type():string;}export default ParcelLineItems;export{ParcelLineItem,ParcelLineItemCreate,ParcelLineItemUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as c}from"../resource";class r extends c{static TYPE="parcel_line_items";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,i){return this.resources.create({...e,type:r.TYPE},t,i)}async retrieve(e,t,i){return this.resources.retrieve({type:r.TYPE,id:e},t,i)}async update(e,t,i){return this.resources.update({...e,type:r.TYPE},t,i)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async parcel(e,t,i){const s=e.id||e;return this.resources.fetch({type:"parcels"},`parcel_line_items/${s}/parcel`,t,i)}async stock_line_item(e,t,i){const s=e.id||e;return this.resources.fetch({type:"stock_line_items"},`parcel_line_items/${s}/stock_line_item`,t,i)}isParcelLineItem(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,108 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Shipment } from './shipments';
|
4
|
-
import { Package } from './packages';
|
5
|
-
import { ParcelLineItem } from './parcel_line_items';
|
6
|
-
import { Attachment } from './attachments';
|
7
|
-
declare type ParcelRel = ResourceRel & {
|
8
|
-
type: typeof Parcels.TYPE;
|
9
|
-
};
|
10
|
-
declare type ShipmentRel = ResourceRel & {
|
11
|
-
type: 'shipments';
|
12
|
-
};
|
13
|
-
declare type PackageRel = ResourceRel & {
|
14
|
-
type: 'packages';
|
15
|
-
};
|
16
|
-
interface Parcel extends Resource {
|
17
|
-
number?: string;
|
18
|
-
weight?: number;
|
19
|
-
unit_of_weight?: string;
|
20
|
-
eel_pfc?: string;
|
21
|
-
contents_type?: string;
|
22
|
-
contents_explanation?: string;
|
23
|
-
customs_certify?: boolean;
|
24
|
-
customs_signer?: string;
|
25
|
-
non_delivery_option?: string;
|
26
|
-
restriction_type?: string;
|
27
|
-
restriction_comments?: string;
|
28
|
-
customs_info_required?: boolean;
|
29
|
-
shipping_label_url?: string;
|
30
|
-
shipping_label_file_type?: string;
|
31
|
-
shipping_label_size?: string;
|
32
|
-
shipping_label_resolution?: string;
|
33
|
-
tracking_number?: string;
|
34
|
-
tracking_status?: string;
|
35
|
-
tracking_status_detail?: string;
|
36
|
-
tracking_status_updated_at?: string;
|
37
|
-
tracking_details?: string;
|
38
|
-
carrier_weight_oz?: string;
|
39
|
-
signed_by?: string;
|
40
|
-
incoterm?: string;
|
41
|
-
shipment?: Shipment;
|
42
|
-
package?: Package;
|
43
|
-
parcel_line_items?: ParcelLineItem[];
|
44
|
-
attachments?: Attachment[];
|
45
|
-
}
|
46
|
-
interface ParcelCreate extends ResourceCreate {
|
47
|
-
weight?: number;
|
48
|
-
unit_of_weight?: string;
|
49
|
-
eel_pfc?: string;
|
50
|
-
contents_type?: string;
|
51
|
-
contents_explanation?: string;
|
52
|
-
customs_certify?: boolean;
|
53
|
-
customs_signer?: string;
|
54
|
-
non_delivery_option?: string;
|
55
|
-
restriction_type?: string;
|
56
|
-
restriction_comments?: string;
|
57
|
-
customs_info_required?: boolean;
|
58
|
-
tracking_number?: string;
|
59
|
-
tracking_status?: string;
|
60
|
-
tracking_status_detail?: string;
|
61
|
-
tracking_status_updated_at?: string;
|
62
|
-
tracking_details?: string;
|
63
|
-
carrier_weight_oz?: string;
|
64
|
-
signed_by?: string;
|
65
|
-
incoterm?: string;
|
66
|
-
shipment: ShipmentRel;
|
67
|
-
package: PackageRel;
|
68
|
-
}
|
69
|
-
interface ParcelUpdate extends ResourceUpdate {
|
70
|
-
weight?: number;
|
71
|
-
unit_of_weight?: string;
|
72
|
-
eel_pfc?: string;
|
73
|
-
contents_type?: string;
|
74
|
-
contents_explanation?: string;
|
75
|
-
customs_certify?: boolean;
|
76
|
-
customs_signer?: string;
|
77
|
-
non_delivery_option?: string;
|
78
|
-
restriction_type?: string;
|
79
|
-
restriction_comments?: string;
|
80
|
-
customs_info_required?: boolean;
|
81
|
-
tracking_number?: string;
|
82
|
-
tracking_status?: string;
|
83
|
-
tracking_status_detail?: string;
|
84
|
-
tracking_status_updated_at?: string;
|
85
|
-
tracking_details?: string;
|
86
|
-
carrier_weight_oz?: string;
|
87
|
-
signed_by?: string;
|
88
|
-
incoterm?: string;
|
89
|
-
shipment?: ShipmentRel;
|
90
|
-
package?: PackageRel;
|
91
|
-
}
|
92
|
-
declare class Parcels extends ApiResource {
|
93
|
-
static readonly TYPE: 'parcels';
|
94
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
|
95
|
-
create(resource: ParcelCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
96
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
97
|
-
update(resource: ParcelUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Parcel>;
|
98
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
99
|
-
shipment(parcelId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
100
|
-
package(parcelId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Package>;
|
101
|
-
parcel_line_items(parcelId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ParcelLineItem>>;
|
102
|
-
attachments(parcelId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
103
|
-
isParcel(resource: any): resource is Parcel;
|
104
|
-
relationship(id: string | ResourceId | null): ParcelRel;
|
105
|
-
type(): string;
|
106
|
-
}
|
107
|
-
export default Parcels;
|
108
|
-
export { Parcel, ParcelCreate, ParcelUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Shipment}from'./shipments';import type{Package}from'./packages';import type{ParcelLineItem}from'./parcel_line_items';import type{Attachment}from'./attachments';declare type ParcelRel=ResourceRel&{type:typeof Parcels.TYPE;};declare type ShipmentRel=ResourceRel&{type:'shipments';};declare type PackageRel=ResourceRel&{type:'packages';};interface Parcel extends Resource{number?:string;weight?:number;unit_of_weight?:string;eel_pfc?:string;contents_type?:string;contents_explanation?:string;customs_certify?:boolean;customs_signer?:string;non_delivery_option?:string;restriction_type?:string;restriction_comments?:string;customs_info_required?:boolean;shipping_label_url?:string;shipping_label_file_type?:string;shipping_label_size?:string;shipping_label_resolution?:string;tracking_number?:string;tracking_status?:string;tracking_status_detail?:string;tracking_status_updated_at?:string;tracking_details?:string;carrier_weight_oz?:string;signed_by?:string;incoterm?:string;shipment?:Shipment;package?:Package;parcel_line_items?:ParcelLineItem[];attachments?:Attachment[];}interface ParcelCreate extends ResourceCreate{weight?:number;unit_of_weight?:string;eel_pfc?:string;contents_type?:string;contents_explanation?:string;customs_certify?:boolean;customs_signer?:string;non_delivery_option?:string;restriction_type?:string;restriction_comments?:string;customs_info_required?:boolean;tracking_number?:string;tracking_status?:string;tracking_status_detail?:string;tracking_status_updated_at?:string;tracking_details?:string;carrier_weight_oz?:string;signed_by?:string;incoterm?:string;shipment:ShipmentRel;package:PackageRel;}interface ParcelUpdate extends ResourceUpdate{weight?:number;unit_of_weight?:string;eel_pfc?:string;contents_type?:string;contents_explanation?:string;customs_certify?:boolean;customs_signer?:string;non_delivery_option?:string;restriction_type?:string;restriction_comments?:string;customs_info_required?:boolean;tracking_number?:string;tracking_status?:string;tracking_status_detail?:string;tracking_status_updated_at?:string;tracking_details?:string;carrier_weight_oz?:string;signed_by?:string;incoterm?:string;shipment?:ShipmentRel;package?:PackageRel;}declare class Parcels extends ApiResource{static readonly TYPE:'parcels';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Parcel>>;create(resource:ParcelCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Parcel>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Parcel>;update(resource:ParcelUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Parcel>;delete(id:string,options?:ResourcesConfig):Promise<void>;shipment(parcelId:string|Parcel,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Shipment>;package(parcelId:string|Parcel,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Package>;parcel_line_items(parcelId:string|Parcel,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ParcelLineItem>>;attachments(parcelId:string|Parcel,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isParcel(resource:any):resource is Parcel;relationship(id:string|ResourceId|null):ParcelRel;type():string;}export default Parcels;export{Parcel,ParcelCreate,ParcelUpdate};
|
package/lib/resources/parcels.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as a}from"../resource";class r extends a{static TYPE="parcels";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 shipment(e,t,s){const c=e.id||e;return this.resources.fetch({type:"shipments"},`parcels/${c}/shipment`,t,s)}async package(e,t,s){const c=e.id||e;return this.resources.fetch({type:"packages"},`parcels/${c}/package`,t,s)}async parcel_line_items(e,t,s){const c=e.id||e;return this.resources.fetch({type:"parcel_line_items"},`parcels/${c}/parcel_line_items`,t,s)}async attachments(e,t,s){const c=e.id||e;return this.resources.fetch({type:"attachments"},`parcels/${c}/attachments`,t,s)}isParcel(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,21 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { PaymentMethod } from './payment_methods';
|
4
|
-
declare type PaymentGatewayRel = ResourceRel & {
|
5
|
-
type: typeof PaymentGateways.TYPE;
|
6
|
-
};
|
7
|
-
interface PaymentGateway extends Resource {
|
8
|
-
name?: string;
|
9
|
-
payment_methods?: PaymentMethod[];
|
10
|
-
}
|
11
|
-
declare class PaymentGateways extends ApiResource {
|
12
|
-
static readonly TYPE: 'payment_gateways';
|
13
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentGateway>>;
|
14
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
|
15
|
-
payment_methods(paymentGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
16
|
-
isPaymentGateway(resource: any): resource is PaymentGateway;
|
17
|
-
relationship(id: string | ResourceId | null): PaymentGatewayRel;
|
18
|
-
type(): string;
|
19
|
-
}
|
20
|
-
export default PaymentGateways;
|
21
|
-
export { PaymentGateway };
|
1
|
+
import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{PaymentMethod}from'./payment_methods';declare type PaymentGatewayRel=ResourceRel&{type:typeof PaymentGateways.TYPE;};interface PaymentGateway extends Resource{name?:string;payment_methods?:PaymentMethod[];}declare class PaymentGateways extends ApiResource{static readonly TYPE:'payment_gateways';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PaymentGateway>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentGateway>;payment_methods(paymentGatewayId:string|PaymentGateway,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PaymentMethod>>;isPaymentGateway(resource:any):resource is PaymentGateway;relationship(id:string|ResourceId|null):PaymentGatewayRel;type():string;}export default PaymentGateways;export{PaymentGateway};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class t extends n{static TYPE="payment_gateways";async list(e,s){return this.resources.list({type:t.TYPE},e,s)}async retrieve(e,s,r){return this.resources.retrieve({type:t.TYPE,id:e},s,r)}async payment_methods(e,s,r){const y=e.id||e;return this.resources.fetch({type:"payment_methods"},`payment_gateways/${y}/payment_methods`,s,r)}isPaymentGateway(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,59 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Market } from './markets';
|
4
|
-
import { PaymentGateway } from './payment_gateways';
|
5
|
-
import { Attachment } from './attachments';
|
6
|
-
declare type PaymentMethodRel = ResourceRel & {
|
7
|
-
type: typeof PaymentMethods.TYPE;
|
8
|
-
};
|
9
|
-
declare type MarketRel = ResourceRel & {
|
10
|
-
type: 'markets';
|
11
|
-
};
|
12
|
-
declare type PaymentGatewayRel = ResourceRel & {
|
13
|
-
type: 'payment_gateways';
|
14
|
-
};
|
15
|
-
interface PaymentMethod extends Resource {
|
16
|
-
payment_source_type?: string;
|
17
|
-
name?: string;
|
18
|
-
currency_code?: string;
|
19
|
-
moto?: boolean;
|
20
|
-
disabled_at?: string;
|
21
|
-
price_amount_cents?: number;
|
22
|
-
price_amount_float?: number;
|
23
|
-
formatted_price_amount?: string;
|
24
|
-
market?: Market;
|
25
|
-
payment_gateway?: PaymentGateway;
|
26
|
-
attachments?: Attachment[];
|
27
|
-
}
|
28
|
-
interface PaymentMethodCreate extends ResourceCreate {
|
29
|
-
payment_source_type: string;
|
30
|
-
currency_code?: string;
|
31
|
-
moto?: boolean;
|
32
|
-
price_amount_cents: number;
|
33
|
-
market?: MarketRel;
|
34
|
-
payment_gateway: PaymentGatewayRel;
|
35
|
-
}
|
36
|
-
interface PaymentMethodUpdate extends ResourceUpdate {
|
37
|
-
payment_source_type?: string;
|
38
|
-
currency_code?: string;
|
39
|
-
moto?: boolean;
|
40
|
-
price_amount_cents?: number;
|
41
|
-
market?: MarketRel;
|
42
|
-
payment_gateway?: PaymentGatewayRel;
|
43
|
-
}
|
44
|
-
declare class PaymentMethods extends ApiResource {
|
45
|
-
static readonly TYPE: 'payment_methods';
|
46
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
47
|
-
create(resource: PaymentMethodCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentMethod>;
|
48
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentMethod>;
|
49
|
-
update(resource: PaymentMethodUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentMethod>;
|
50
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
51
|
-
market(paymentMethodId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
52
|
-
payment_gateway(paymentMethodId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
|
53
|
-
attachments(paymentMethodId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
54
|
-
isPaymentMethod(resource: any): resource is PaymentMethod;
|
55
|
-
relationship(id: string | ResourceId | null): PaymentMethodRel;
|
56
|
-
type(): string;
|
57
|
-
}
|
58
|
-
export default PaymentMethods;
|
59
|
-
export { PaymentMethod, PaymentMethodCreate, PaymentMethodUpdate };
|
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{PaymentGateway}from'./payment_gateways';import type{Attachment}from'./attachments';declare type PaymentMethodRel=ResourceRel&{type:typeof PaymentMethods.TYPE;};declare type MarketRel=ResourceRel&{type:'markets';};declare type PaymentGatewayRel=ResourceRel&{type:'payment_gateways';};interface PaymentMethod extends Resource{payment_source_type?:string;name?:string;currency_code?:string;moto?:boolean;disabled_at?:string;price_amount_cents?:number;price_amount_float?:number;formatted_price_amount?:string;market?:Market;payment_gateway?:PaymentGateway;attachments?:Attachment[];}interface PaymentMethodCreate extends ResourceCreate{payment_source_type:string;currency_code?:string;moto?:boolean;price_amount_cents:number;market?:MarketRel;payment_gateway:PaymentGatewayRel;}interface PaymentMethodUpdate extends ResourceUpdate{payment_source_type?:string;currency_code?:string;moto?:boolean;price_amount_cents?:number;market?:MarketRel;payment_gateway?:PaymentGatewayRel;}declare class PaymentMethods extends ApiResource{static readonly TYPE:'payment_methods';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PaymentMethod>>;create(resource:PaymentMethodCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentMethod>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentMethod>;update(resource:PaymentMethodUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentMethod>;delete(id:string,options?:ResourcesConfig):Promise<void>;market(paymentMethodId:string|PaymentMethod,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;payment_gateway(paymentMethodId:string|PaymentMethod,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentGateway>;attachments(paymentMethodId:string|PaymentMethod,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isPaymentMethod(resource:any):resource is PaymentMethod;relationship(id:string|ResourceId|null):PaymentMethodRel;type():string;}export default PaymentMethods;export{PaymentMethod,PaymentMethodCreate,PaymentMethodUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class s extends n{static TYPE="payment_methods";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 market(e,t,r){const a=e.id||e;return this.resources.fetch({type:"markets"},`payment_methods/${a}/market`,t,r)}async payment_gateway(e,t,r){const a=e.id||e;return this.resources.fetch({type:"payment_gateways"},`payment_methods/${a}/payment_gateway`,t,r)}async attachments(e,t,r){const a=e.id||e;return this.resources.fetch({type:"attachments"},`payment_methods/${a}/attachments`,t,r)}isPaymentMethod(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,39 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { PaymentMethod } from './payment_methods';
|
4
|
-
import { PaypalPayment } from './paypal_payments';
|
5
|
-
declare type PaypalGatewayRel = ResourceRel & {
|
6
|
-
type: typeof PaypalGateways.TYPE;
|
7
|
-
};
|
8
|
-
interface PaypalGateway extends Resource {
|
9
|
-
name?: string;
|
10
|
-
payment_methods?: PaymentMethod[];
|
11
|
-
paypal_payments?: PaypalPayment[];
|
12
|
-
}
|
13
|
-
interface PaypalGatewayCreate extends ResourceCreate {
|
14
|
-
name: string;
|
15
|
-
client_id: string;
|
16
|
-
client_secret: string;
|
17
|
-
mode: string;
|
18
|
-
}
|
19
|
-
interface PaypalGatewayUpdate extends ResourceUpdate {
|
20
|
-
name?: string;
|
21
|
-
client_id?: string;
|
22
|
-
client_secret?: string;
|
23
|
-
mode?: string;
|
24
|
-
}
|
25
|
-
declare class PaypalGateways extends ApiResource {
|
26
|
-
static readonly TYPE: 'paypal_gateways';
|
27
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaypalGateway>>;
|
28
|
-
create(resource: PaypalGatewayCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaypalGateway>;
|
29
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaypalGateway>;
|
30
|
-
update(resource: PaypalGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaypalGateway>;
|
31
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
32
|
-
payment_methods(paypalGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
|
33
|
-
paypal_payments(paypalGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaypalPayment>>;
|
34
|
-
isPaypalGateway(resource: any): resource is PaypalGateway;
|
35
|
-
relationship(id: string | ResourceId | null): PaypalGatewayRel;
|
36
|
-
type(): string;
|
37
|
-
}
|
38
|
-
export default PaypalGateways;
|
39
|
-
export { PaypalGateway, PaypalGatewayCreate, PaypalGatewayUpdate };
|
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{PaypalPayment}from'./paypal_payments';declare type PaypalGatewayRel=ResourceRel&{type:typeof PaypalGateways.TYPE;};interface PaypalGateway extends Resource{name?:string;payment_methods?:PaymentMethod[];paypal_payments?:PaypalPayment[];}interface PaypalGatewayCreate extends ResourceCreate{name:string;client_id:string;client_secret:string;}interface PaypalGatewayUpdate extends ResourceUpdate{name?:string;client_id?:string;client_secret?:string;}declare class PaypalGateways extends ApiResource{static readonly TYPE:'paypal_gateways';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PaypalGateway>>;create(resource:PaypalGatewayCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaypalGateway>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaypalGateway>;update(resource:PaypalGatewayUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaypalGateway>;delete(id:string,options?:ResourcesConfig):Promise<void>;payment_methods(paypalGatewayId:string|PaypalGateway,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PaymentMethod>>;paypal_payments(paypalGatewayId:string|PaypalGateway,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PaypalPayment>>;isPaypalGateway(resource:any):resource is PaypalGateway;relationship(id:string|ResourceId|null):PaypalGatewayRel;type():string;}export default PaypalGateways;export{PaypalGateway,PaypalGatewayCreate,PaypalGatewayUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as p}from"../resource";class a extends p{async list(e,t){return this.resources.list({type:a.TYPE},e,t)}async create(e,t,r){return this.resources.create({...e,type:a.TYPE},t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:a.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update({...e,type:a.TYPE},t,r)}async delete(e,t){await this.resources.delete({type:a.TYPE,id:e},t)}async payment_methods(e,t,r){return this.resources.fetch({type:"payment_methods"},`paypal_gateways/${
|
1
|
+
import{ApiResource as p}from"../resource";class a extends p{static TYPE="paypal_gateways";async list(e,t){return this.resources.list({type:a.TYPE},e,t)}async create(e,t,r){return this.resources.create({...e,type:a.TYPE},t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:a.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update({...e,type:a.TYPE},t,r)}async delete(e,t){await this.resources.delete({type:a.TYPE,id:e},t)}async payment_methods(e,t,r){const s=e.id||e;return this.resources.fetch({type:"payment_methods"},`paypal_gateways/${s}/payment_methods`,t,r)}async paypal_payments(e,t,r){const s=e.id||e;return this.resources.fetch({type:"paypal_payments"},`paypal_gateways/${s}/paypal_payments`,t,r)}isPaypalGateway(e){return e.type&&e.type===a.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:a.TYPE}:{id:e.id,type:a.TYPE}}type(){return a.TYPE}}export default a;
|
@@ -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 PaypalPaymentRel = ResourceRel & {
|
6
|
-
type: typeof PaypalPayments.TYPE;
|
7
|
-
};
|
8
|
-
declare type OrderRel = ResourceRel & {
|
9
|
-
type: 'orders';
|
10
|
-
};
|
11
|
-
interface PaypalPayment extends Resource {
|
12
|
-
return_url?: string;
|
13
|
-
cancel_url?: string;
|
14
|
-
note_to_payer?: string;
|
15
|
-
paypal_payer_id?: string;
|
16
|
-
name?: string;
|
17
|
-
paypal_id?: string;
|
18
|
-
status?: string;
|
19
|
-
approval_url?: string;
|
20
|
-
order?: Order;
|
21
|
-
payment_gateway?: PaymentGateway;
|
22
|
-
}
|
23
|
-
interface PaypalPaymentCreate extends ResourceCreate {
|
24
|
-
return_url: string;
|
25
|
-
cancel_url: string;
|
26
|
-
note_to_payer?: string;
|
27
|
-
order: OrderRel;
|
28
|
-
}
|
29
|
-
interface PaypalPaymentUpdate extends ResourceUpdate {
|
30
|
-
paypal_payer_id?: string;
|
31
|
-
order?: OrderRel;
|
32
|
-
}
|
33
|
-
declare class PaypalPayments extends ApiResource {
|
34
|
-
static readonly TYPE: 'paypal_payments';
|
35
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaypalPayment>>;
|
36
|
-
create(resource: PaypalPaymentCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaypalPayment>;
|
37
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaypalPayment>;
|
38
|
-
update(resource: PaypalPaymentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaypalPayment>;
|
39
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
40
|
-
order(paypalPaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
41
|
-
payment_gateway(paypalPaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
|
42
|
-
isPaypalPayment(resource: any): resource is PaypalPayment;
|
43
|
-
relationship(id: string | ResourceId | null): PaypalPaymentRel;
|
44
|
-
type(): string;
|
45
|
-
}
|
46
|
-
export default PaypalPayments;
|
47
|
-
export { PaypalPayment, PaypalPaymentCreate, PaypalPaymentUpdate };
|
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 PaypalPaymentRel=ResourceRel&{type:typeof PaypalPayments.TYPE;};declare type OrderRel=ResourceRel&{type:'orders';};interface PaypalPayment extends Resource{return_url?:string;cancel_url?:string;note_to_payer?:string;paypal_payer_id?:string;name?:string;paypal_id?:string;status?:string;approval_url?:string;mismatched_amounts?:boolean;intent_amount_cents?:number;intent_amount_float?:number;formatted_intent_amount?:string;order?:Order;payment_gateway?:PaymentGateway;}interface PaypalPaymentCreate extends ResourceCreate{return_url:string;cancel_url:string;note_to_payer?:string;order:OrderRel;}interface PaypalPaymentUpdate extends ResourceUpdate{paypal_payer_id?:string;order?:OrderRel;}declare class PaypalPayments extends ApiResource{static readonly TYPE:'paypal_payments';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PaypalPayment>>;create(resource:PaypalPaymentCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaypalPayment>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaypalPayment>;update(resource:PaypalPaymentUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaypalPayment>;delete(id:string,options?:ResourcesConfig):Promise<void>;order(paypalPaymentId:string|PaypalPayment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;payment_gateway(paypalPaymentId:string|PaypalPayment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentGateway>;isPaypalPayment(resource:any):resource is PaypalPayment;relationship(id:string|ResourceId|null):PaypalPaymentRel;type():string;}export default PaypalPayments;export{PaypalPayment,PaypalPaymentCreate,PaypalPaymentUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as y}from"../resource";class r extends y{static TYPE="paypal_payments";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,a){return this.resources.create({...e,type:r.TYPE},t,a)}async retrieve(e,t,a){return this.resources.retrieve({type:r.TYPE,id:e},t,a)}async update(e,t,a){return this.resources.update({...e,type:r.TYPE},t,a)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async order(e,t,a){const s=e.id||e;return this.resources.fetch({type:"orders"},`paypal_payments/${s}/order`,t,a)}async payment_gateway(e,t,a){const s=e.id||e;return this.resources.fetch({type:"payment_gateways"},`paypal_payments/${s}/payment_gateway`,t,a)}isPaypalPayment(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,97 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Market } from './markets';
|
4
|
-
import { PromotionRule } from './promotion_rules';
|
5
|
-
import { OrderAmountPromotionRule } from './order_amount_promotion_rules';
|
6
|
-
import { SkuListPromotionRule } from './sku_list_promotion_rules';
|
7
|
-
import { CouponCodesPromotionRule } from './coupon_codes_promotion_rules';
|
8
|
-
import { Attachment } from './attachments';
|
9
|
-
import { SkuList } from './sku_lists';
|
10
|
-
import { Sku } from './skus';
|
11
|
-
declare type PercentageDiscountPromotionRel = ResourceRel & {
|
12
|
-
type: typeof PercentageDiscountPromotions.TYPE;
|
13
|
-
};
|
14
|
-
declare type MarketRel = ResourceRel & {
|
15
|
-
type: 'markets';
|
16
|
-
};
|
17
|
-
declare type PromotionRuleRel = ResourceRel & {
|
18
|
-
type: 'promotion_rules';
|
19
|
-
};
|
20
|
-
declare type OrderAmountPromotionRuleRel = ResourceRel & {
|
21
|
-
type: 'order_amount_promotion_rules';
|
22
|
-
};
|
23
|
-
declare type SkuListPromotionRuleRel = ResourceRel & {
|
24
|
-
type: 'sku_list_promotion_rules';
|
25
|
-
};
|
26
|
-
declare type CouponCodesPromotionRuleRel = ResourceRel & {
|
27
|
-
type: 'coupon_codes_promotion_rules';
|
28
|
-
};
|
29
|
-
declare type SkuListRel = ResourceRel & {
|
30
|
-
type: 'sku_lists';
|
31
|
-
};
|
32
|
-
interface PercentageDiscountPromotion extends Resource {
|
33
|
-
name?: string;
|
34
|
-
currency_code?: string;
|
35
|
-
starts_at?: string;
|
36
|
-
expires_at?: string;
|
37
|
-
total_usage_limit?: number;
|
38
|
-
total_usage_count?: number;
|
39
|
-
active?: boolean;
|
40
|
-
percentage?: number;
|
41
|
-
market?: Market;
|
42
|
-
promotion_rules?: PromotionRule[];
|
43
|
-
order_amount_promotion_rule?: OrderAmountPromotionRule;
|
44
|
-
sku_list_promotion_rule?: SkuListPromotionRule;
|
45
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRule;
|
46
|
-
attachments?: Attachment[];
|
47
|
-
sku_list?: SkuList;
|
48
|
-
skus?: Sku[];
|
49
|
-
}
|
50
|
-
interface PercentageDiscountPromotionCreate extends ResourceCreate {
|
51
|
-
name: string;
|
52
|
-
currency_code?: string;
|
53
|
-
starts_at: string;
|
54
|
-
expires_at: string;
|
55
|
-
total_usage_limit: number;
|
56
|
-
percentage: number;
|
57
|
-
market?: MarketRel;
|
58
|
-
promotion_rules?: PromotionRuleRel[];
|
59
|
-
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
60
|
-
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
61
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
62
|
-
sku_list?: SkuListRel;
|
63
|
-
}
|
64
|
-
interface PercentageDiscountPromotionUpdate extends ResourceUpdate {
|
65
|
-
name?: string;
|
66
|
-
currency_code?: string;
|
67
|
-
starts_at?: string;
|
68
|
-
expires_at?: string;
|
69
|
-
total_usage_limit?: number;
|
70
|
-
percentage?: number;
|
71
|
-
market?: MarketRel;
|
72
|
-
promotion_rules?: PromotionRuleRel[];
|
73
|
-
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
74
|
-
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
75
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
76
|
-
sku_list?: SkuListRel;
|
77
|
-
}
|
78
|
-
declare class PercentageDiscountPromotions extends ApiResource {
|
79
|
-
static readonly TYPE: 'percentage_discount_promotions';
|
80
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PercentageDiscountPromotion>>;
|
81
|
-
create(resource: PercentageDiscountPromotionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PercentageDiscountPromotion>;
|
82
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PercentageDiscountPromotion>;
|
83
|
-
update(resource: PercentageDiscountPromotionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PercentageDiscountPromotion>;
|
84
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
85
|
-
market(percentageDiscountPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
86
|
-
order_amount_promotion_rule(percentageDiscountPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
87
|
-
sku_list_promotion_rule(percentageDiscountPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
88
|
-
coupon_codes_promotion_rule(percentageDiscountPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
89
|
-
attachments(percentageDiscountPromotionId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
90
|
-
sku_list(percentageDiscountPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
91
|
-
skus(percentageDiscountPromotionId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
92
|
-
isPercentageDiscountPromotion(resource: any): resource is PercentageDiscountPromotion;
|
93
|
-
relationship(id: string | ResourceId | null): PercentageDiscountPromotionRel;
|
94
|
-
type(): string;
|
95
|
-
}
|
96
|
-
export default PercentageDiscountPromotions;
|
97
|
-
export { PercentageDiscountPromotion, PercentageDiscountPromotionCreate, PercentageDiscountPromotionUpdate };
|
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{PromotionRule}from'./promotion_rules';import type{OrderAmountPromotionRule}from'./order_amount_promotion_rules';import type{SkuListPromotionRule}from'./sku_list_promotion_rules';import type{CouponCodesPromotionRule}from'./coupon_codes_promotion_rules';import type{Attachment}from'./attachments';import type{SkuList}from'./sku_lists';import type{Sku}from'./skus';declare type PercentageDiscountPromotionRel=ResourceRel&{type:typeof PercentageDiscountPromotions.TYPE;};declare type MarketRel=ResourceRel&{type:'markets';};declare type PromotionRuleRel=ResourceRel&{type:'promotion_rules';};declare type OrderAmountPromotionRuleRel=ResourceRel&{type:'order_amount_promotion_rules';};declare type SkuListPromotionRuleRel=ResourceRel&{type:'sku_list_promotion_rules';};declare type CouponCodesPromotionRuleRel=ResourceRel&{type:'coupon_codes_promotion_rules';};declare type SkuListRel=ResourceRel&{type:'sku_lists';};interface PercentageDiscountPromotion extends Resource{name?:string;currency_code?:string;starts_at?:string;expires_at?:string;total_usage_limit?:number;total_usage_count?:number;active?:boolean;percentage?:number;market?:Market;promotion_rules?:PromotionRule[];order_amount_promotion_rule?:OrderAmountPromotionRule;sku_list_promotion_rule?:SkuListPromotionRule;coupon_codes_promotion_rule?:CouponCodesPromotionRule;attachments?:Attachment[];sku_list?:SkuList;skus?:Sku[];}interface PercentageDiscountPromotionCreate extends ResourceCreate{name:string;currency_code?:string;starts_at:string;expires_at:string;total_usage_limit:number;percentage:number;market?:MarketRel;promotion_rules?:PromotionRuleRel[];order_amount_promotion_rule?:OrderAmountPromotionRuleRel;sku_list_promotion_rule?:SkuListPromotionRuleRel;coupon_codes_promotion_rule?:CouponCodesPromotionRuleRel;sku_list?:SkuListRel;}interface PercentageDiscountPromotionUpdate extends ResourceUpdate{name?:string;currency_code?:string;starts_at?:string;expires_at?:string;total_usage_limit?:number;percentage?:number;market?:MarketRel;promotion_rules?:PromotionRuleRel[];order_amount_promotion_rule?:OrderAmountPromotionRuleRel;sku_list_promotion_rule?:SkuListPromotionRuleRel;coupon_codes_promotion_rule?:CouponCodesPromotionRuleRel;sku_list?:SkuListRel;}declare class PercentageDiscountPromotions extends ApiResource{static readonly TYPE:'percentage_discount_promotions';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PercentageDiscountPromotion>>;create(resource:PercentageDiscountPromotionCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PercentageDiscountPromotion>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PercentageDiscountPromotion>;update(resource:PercentageDiscountPromotionUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PercentageDiscountPromotion>;delete(id:string,options?:ResourcesConfig):Promise<void>;market(percentageDiscountPromotionId:string|PercentageDiscountPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;order_amount_promotion_rule(percentageDiscountPromotionId:string|PercentageDiscountPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<OrderAmountPromotionRule>;sku_list_promotion_rule(percentageDiscountPromotionId:string|PercentageDiscountPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuListPromotionRule>;coupon_codes_promotion_rule(percentageDiscountPromotionId:string|PercentageDiscountPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CouponCodesPromotionRule>;attachments(percentageDiscountPromotionId:string|PercentageDiscountPromotion,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;sku_list(percentageDiscountPromotionId:string|PercentageDiscountPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuList>;skus(percentageDiscountPromotionId:string|PercentageDiscountPromotion,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Sku>>;isPercentageDiscountPromotion(resource:any):resource is PercentageDiscountPromotion;relationship(id:string|ResourceId|null):PercentageDiscountPromotionRel;type():string;}export default PercentageDiscountPromotions;export{PercentageDiscountPromotion,PercentageDiscountPromotionCreate,PercentageDiscountPromotionUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class o extends n{static TYPE="percentage_discount_promotions";async list(e,t){return this.resources.list({type:o.TYPE},e,t)}async create(e,t,s){return this.resources.create({...e,type:o.TYPE},t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:o.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update({...e,type:o.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:o.TYPE,id:e},t)}async market(e,t,s){const r=e.id||e;return this.resources.fetch({type:"markets"},`percentage_discount_promotions/${r}/market`,t,s)}async order_amount_promotion_rule(e,t,s){const r=e.id||e;return this.resources.fetch({type:"order_amount_promotion_rules"},`percentage_discount_promotions/${r}/order_amount_promotion_rule`,t,s)}async sku_list_promotion_rule(e,t,s){const r=e.id||e;return this.resources.fetch({type:"sku_list_promotion_rules"},`percentage_discount_promotions/${r}/sku_list_promotion_rule`,t,s)}async coupon_codes_promotion_rule(e,t,s){const r=e.id||e;return this.resources.fetch({type:"coupon_codes_promotion_rules"},`percentage_discount_promotions/${r}/coupon_codes_promotion_rule`,t,s)}async attachments(e,t,s){const r=e.id||e;return this.resources.fetch({type:"attachments"},`percentage_discount_promotions/${r}/attachments`,t,s)}async sku_list(e,t,s){const r=e.id||e;return this.resources.fetch({type:"sku_lists"},`percentage_discount_promotions/${r}/sku_list`,t,s)}async skus(e,t,s){const r=e.id||e;return this.resources.fetch({type:"skus"},`percentage_discount_promotions/${r}/skus`,t,s)}isPercentageDiscountPromotion(e){return e.type&&e.type===o.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:o.TYPE}:{id:e.id,type:o.TYPE}}type(){return o.TYPE}}export default o;
|
@@ -1,39 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Price } from './prices';
|
4
|
-
import { Attachment } from './attachments';
|
5
|
-
declare type PriceListRel = ResourceRel & {
|
6
|
-
type: typeof PriceLists.TYPE;
|
7
|
-
};
|
8
|
-
interface PriceList extends Resource {
|
9
|
-
name?: string;
|
10
|
-
currency_code?: string;
|
11
|
-
tax_included?: boolean;
|
12
|
-
prices?: Price[];
|
13
|
-
attachments?: Attachment[];
|
14
|
-
}
|
15
|
-
interface PriceListCreate extends ResourceCreate {
|
16
|
-
name: string;
|
17
|
-
currency_code: string;
|
18
|
-
tax_included?: boolean;
|
19
|
-
}
|
20
|
-
interface PriceListUpdate extends ResourceUpdate {
|
21
|
-
name?: string;
|
22
|
-
currency_code?: string;
|
23
|
-
tax_included?: boolean;
|
24
|
-
}
|
25
|
-
declare class PriceLists extends ApiResource {
|
26
|
-
static readonly TYPE: 'price_lists';
|
27
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PriceList>>;
|
28
|
-
create(resource: PriceListCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PriceList>;
|
29
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PriceList>;
|
30
|
-
update(resource: PriceListUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PriceList>;
|
31
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
32
|
-
prices(priceListId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Price>>;
|
33
|
-
attachments(priceListId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
34
|
-
isPriceList(resource: any): resource is PriceList;
|
35
|
-
relationship(id: string | ResourceId | null): PriceListRel;
|
36
|
-
type(): string;
|
37
|
-
}
|
38
|
-
export default PriceLists;
|
39
|
-
export { PriceList, PriceListCreate, PriceListUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Price}from'./prices';import type{Attachment}from'./attachments';declare type PriceListRel=ResourceRel&{type:typeof PriceLists.TYPE;};interface PriceList extends Resource{name?:string;currency_code?:string;tax_included?:boolean;prices?:Price[];attachments?:Attachment[];}interface PriceListCreate extends ResourceCreate{name:string;currency_code:string;tax_included?:boolean;}interface PriceListUpdate extends ResourceUpdate{name?:string;currency_code?:string;tax_included?:boolean;}declare class PriceLists extends ApiResource{static readonly TYPE:'price_lists';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PriceList>>;create(resource:PriceListCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PriceList>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PriceList>;update(resource:PriceListUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PriceList>;delete(id:string,options?:ResourcesConfig):Promise<void>;prices(priceListId:string|PriceList,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Price>>;attachments(priceListId:string|PriceList,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isPriceList(resource:any):resource is PriceList;relationship(id:string|ResourceId|null):PriceListRel;type():string;}export default PriceLists;export{PriceList,PriceListCreate,PriceListUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as c}from"../resource";class r extends c{static TYPE="price_lists";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 prices(e,t,s){const i=e.id||e;return this.resources.fetch({type:"prices"},`price_lists/${i}/prices`,t,s)}async attachments(e,t,s){const i=e.id||e;return this.resources.fetch({type:"attachments"},`price_lists/${i}/attachments`,t,s)}isPriceList(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;
|