@commercelayer/sdk 5.0.0-alpha.3 → 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 +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 +17 -21
@@ -1,57 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { PriceList } from './price_lists';
|
4
|
-
import { Sku } from './skus';
|
5
|
-
import { Attachment } from './attachments';
|
6
|
-
declare type PriceRel = ResourceRel & {
|
7
|
-
type: typeof Prices.TYPE;
|
8
|
-
};
|
9
|
-
declare type PriceListRel = ResourceRel & {
|
10
|
-
type: 'price_lists';
|
11
|
-
};
|
12
|
-
declare type SkuRel = ResourceRel & {
|
13
|
-
type: 'skus';
|
14
|
-
};
|
15
|
-
interface Price extends Resource {
|
16
|
-
currency_code?: string;
|
17
|
-
sku_code?: string;
|
18
|
-
amount_cents?: number;
|
19
|
-
amount_float?: number;
|
20
|
-
formatted_amount?: string;
|
21
|
-
compare_at_amount_cents?: number;
|
22
|
-
compare_at_amount_float?: number;
|
23
|
-
formatted_compare_at_amount?: string;
|
24
|
-
price_list?: PriceList;
|
25
|
-
sku?: Sku;
|
26
|
-
attachments?: Attachment[];
|
27
|
-
}
|
28
|
-
interface PriceCreate extends ResourceCreate {
|
29
|
-
sku_code?: string;
|
30
|
-
amount_cents: number;
|
31
|
-
compare_at_amount_cents: number;
|
32
|
-
price_list: PriceListRel;
|
33
|
-
sku?: SkuRel;
|
34
|
-
}
|
35
|
-
interface PriceUpdate extends ResourceUpdate {
|
36
|
-
sku_code?: string;
|
37
|
-
amount_cents?: number;
|
38
|
-
compare_at_amount_cents?: number;
|
39
|
-
price_list?: PriceListRel;
|
40
|
-
sku?: SkuRel;
|
41
|
-
}
|
42
|
-
declare class Prices extends ApiResource {
|
43
|
-
static readonly TYPE: 'prices';
|
44
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Price>>;
|
45
|
-
create(resource: PriceCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Price>;
|
46
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Price>;
|
47
|
-
update(resource: PriceUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Price>;
|
48
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
49
|
-
price_list(priceId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PriceList>;
|
50
|
-
sku(priceId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
51
|
-
attachments(priceId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
52
|
-
isPrice(resource: any): resource is Price;
|
53
|
-
relationship(id: string | ResourceId | null): PriceRel;
|
54
|
-
type(): string;
|
55
|
-
}
|
56
|
-
export default Prices;
|
57
|
-
export { Price, PriceCreate, PriceUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{PriceList}from'./price_lists';import type{Sku}from'./skus';import type{Attachment}from'./attachments';declare type PriceRel=ResourceRel&{type:typeof Prices.TYPE;};declare type PriceListRel=ResourceRel&{type:'price_lists';};declare type SkuRel=ResourceRel&{type:'skus';};interface Price extends Resource{currency_code?:string;sku_code?:string;amount_cents?:number;amount_float?:number;formatted_amount?:string;compare_at_amount_cents?:number;compare_at_amount_float?:number;formatted_compare_at_amount?:string;price_list?:PriceList;sku?:Sku;attachments?:Attachment[];}interface PriceCreate extends ResourceCreate{sku_code?:string;amount_cents:number;compare_at_amount_cents:number;price_list:PriceListRel;sku?:SkuRel;}interface PriceUpdate extends ResourceUpdate{sku_code?:string;amount_cents?:number;compare_at_amount_cents?:number;price_list?:PriceListRel;sku?:SkuRel;}declare class Prices extends ApiResource{static readonly TYPE:'prices';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Price>>;create(resource:PriceCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Price>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Price>;update(resource:PriceUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Price>;delete(id:string,options?:ResourcesConfig):Promise<void>;price_list(priceId:string|Price,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PriceList>;sku(priceId:string|Price,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Sku>;attachments(priceId:string|Price,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isPrice(resource:any):resource is Price;relationship(id:string|ResourceId|null):PriceRel;type():string;}export default Prices;export{Price,PriceCreate,PriceUpdate};
|
package/lib/resources/prices.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class r extends i{static TYPE="prices";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 price_list(e,t,s){const c=e.id||e;return this.resources.fetch({type:"price_lists"},`prices/${c}/price_list`,t,s)}async sku(e,t,s){const c=e.id||e;return this.resources.fetch({type:"skus"},`prices/${c}/sku`,t,s)}async attachments(e,t,s){const c=e.id||e;return this.resources.fetch({type:"attachments"},`prices/${c}/attachments`,t,s)}isPrice(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}export default r;
|
@@ -1,24 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { 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
|
-
declare type PromotionRuleRel = ResourceRel & {
|
10
|
-
type: typeof PromotionRules.TYPE;
|
11
|
-
};
|
12
|
-
interface PromotionRule extends Resource {
|
13
|
-
promotion?: PercentageDiscountPromotion | FreeShippingPromotion | FixedAmountPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion;
|
14
|
-
}
|
15
|
-
declare class PromotionRules extends ApiResource {
|
16
|
-
static readonly TYPE: 'promotion_rules';
|
17
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PromotionRule>>;
|
18
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PromotionRule>;
|
19
|
-
isPromotionRule(resource: any): resource is PromotionRule;
|
20
|
-
relationship(id: string | ResourceId | null): PromotionRuleRel;
|
21
|
-
type(): string;
|
22
|
-
}
|
23
|
-
export default PromotionRules;
|
24
|
-
export { PromotionRule };
|
1
|
+
import{ApiResource,Resource,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';declare type PromotionRuleRel=ResourceRel&{type:typeof PromotionRules.TYPE;};interface PromotionRule extends Resource{promotion?:PercentageDiscountPromotion|FreeShippingPromotion|FixedAmountPromotion|FreeGiftPromotion|FixedPricePromotion|ExternalPromotion;}declare class PromotionRules extends ApiResource{static readonly TYPE:'promotion_rules';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PromotionRule>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PromotionRule>;isPromotionRule(resource:any):resource is PromotionRule;relationship(id:string|ResourceId|null):PromotionRuleRel;type():string;}export default PromotionRules;export{PromotionRule};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as s}from"../resource";class
|
1
|
+
import{ApiResource as s}from"../resource";class e extends s{static TYPE="promotion_rules";async list(t,r){return this.resources.list({type:e.TYPE},t,r)}async retrieve(t,r,i){return this.resources.retrieve({type:e.TYPE,id:t},r,i)}isPromotionRule(t){return t.type&&t.type===e.TYPE}relationship(t){return t===null||typeof t=="string"?{id:t,type:e.TYPE}:{id:t.id,type:e.TYPE}}type(){return e.TYPE}}export default e;
|
@@ -1,41 +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
|
-
declare type PromotionRel = ResourceRel & {
|
10
|
-
type: typeof Promotions.TYPE;
|
11
|
-
};
|
12
|
-
interface Promotion extends Resource {
|
13
|
-
name?: string;
|
14
|
-
currency_code?: string;
|
15
|
-
starts_at?: string;
|
16
|
-
expires_at?: string;
|
17
|
-
total_usage_limit?: number;
|
18
|
-
total_usage_count?: number;
|
19
|
-
active?: boolean;
|
20
|
-
market?: Market;
|
21
|
-
promotion_rules?: PromotionRule[];
|
22
|
-
order_amount_promotion_rule?: OrderAmountPromotionRule;
|
23
|
-
sku_list_promotion_rule?: SkuListPromotionRule;
|
24
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRule;
|
25
|
-
attachments?: Attachment[];
|
26
|
-
}
|
27
|
-
declare class Promotions extends ApiResource {
|
28
|
-
static readonly TYPE: 'promotions';
|
29
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Promotion>>;
|
30
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Promotion>;
|
31
|
-
market(promotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
32
|
-
order_amount_promotion_rule(promotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
33
|
-
sku_list_promotion_rule(promotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
34
|
-
coupon_codes_promotion_rule(promotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
35
|
-
attachments(promotionId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
36
|
-
isPromotion(resource: any): resource is Promotion;
|
37
|
-
relationship(id: string | ResourceId | null): PromotionRel;
|
38
|
-
type(): string;
|
39
|
-
}
|
40
|
-
export default Promotions;
|
41
|
-
export { Promotion };
|
1
|
+
import{ApiResource,Resource,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';declare type PromotionRel=ResourceRel&{type:typeof Promotions.TYPE;};interface Promotion extends Resource{name?:string;currency_code?:string;starts_at?:string;expires_at?:string;total_usage_limit?:number;total_usage_count?:number;active?:boolean;market?:Market;promotion_rules?:PromotionRule[];order_amount_promotion_rule?:OrderAmountPromotionRule;sku_list_promotion_rule?:SkuListPromotionRule;coupon_codes_promotion_rule?:CouponCodesPromotionRule;attachments?:Attachment[];}declare class Promotions extends ApiResource{static readonly TYPE:'promotions';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Promotion>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Promotion>;market(promotionId:string|Promotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;order_amount_promotion_rule(promotionId:string|Promotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<OrderAmountPromotionRule>;sku_list_promotion_rule(promotionId:string|Promotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuListPromotionRule>;coupon_codes_promotion_rule(promotionId:string|Promotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CouponCodesPromotionRule>;attachments(promotionId:string|Promotion,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isPromotion(resource:any):resource is Promotion;relationship(id:string|ResourceId|null):PromotionRel;type():string;}export default Promotions;export{Promotion};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class s extends n{static TYPE="promotions";async list(t,e){return this.resources.list({type:s.TYPE},t,e)}async retrieve(t,e,r){return this.resources.retrieve({type:s.TYPE,id:t},e,r)}async market(t,e,r){const o=t.id||t;return this.resources.fetch({type:"markets"},`promotions/${o}/market`,e,r)}async order_amount_promotion_rule(t,e,r){const o=t.id||t;return this.resources.fetch({type:"order_amount_promotion_rules"},`promotions/${o}/order_amount_promotion_rule`,e,r)}async sku_list_promotion_rule(t,e,r){const o=t.id||t;return this.resources.fetch({type:"sku_list_promotion_rules"},`promotions/${o}/sku_list_promotion_rule`,e,r)}async coupon_codes_promotion_rule(t,e,r){const o=t.id||t;return this.resources.fetch({type:"coupon_codes_promotion_rules"},`promotions/${o}/coupon_codes_promotion_rule`,e,r)}async attachments(t,e,r){const o=t.id||t;return this.resources.fetch({type:"attachments"},`promotions/${o}/attachments`,e,r)}isPromotion(t){return t.type&&t.type===s.TYPE}relationship(t){return t===null||typeof t=="string"?{id:t,type:s.TYPE}:{id:t.id,type:s.TYPE}}type(){return s.TYPE}}export default s;
|
@@ -1,34 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Order } from './orders';
|
4
|
-
import { Capture } from './captures';
|
5
|
-
declare type RefundRel = ResourceRel & {
|
6
|
-
type: typeof Refunds.TYPE;
|
7
|
-
};
|
8
|
-
interface Refund extends Resource {
|
9
|
-
number?: string;
|
10
|
-
currency_code?: string;
|
11
|
-
amount_cents?: number;
|
12
|
-
amount_float?: number;
|
13
|
-
formatted_amount?: string;
|
14
|
-
succeeded?: boolean;
|
15
|
-
message?: string;
|
16
|
-
error_code?: string;
|
17
|
-
error_detail?: string;
|
18
|
-
token?: string;
|
19
|
-
gateway_transaction_id?: string;
|
20
|
-
order?: Order;
|
21
|
-
reference_capture?: Capture;
|
22
|
-
}
|
23
|
-
declare class Refunds extends ApiResource {
|
24
|
-
static readonly TYPE: 'refunds';
|
25
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Refund>>;
|
26
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Refund>;
|
27
|
-
order(refundId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
28
|
-
reference_capture(refundId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
|
29
|
-
isRefund(resource: any): resource is Refund;
|
30
|
-
relationship(id: string | ResourceId | null): RefundRel;
|
31
|
-
type(): string;
|
32
|
-
}
|
33
|
-
export default Refunds;
|
34
|
-
export { Refund };
|
1
|
+
import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Order}from'./orders';import type{Capture}from'./captures';declare type RefundRel=ResourceRel&{type:typeof Refunds.TYPE;};interface Refund 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;order?:Order;reference_capture?:Capture;}declare class Refunds extends ApiResource{static readonly TYPE:'refunds';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Refund>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Refund>;order(refundId:string|Refund,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;reference_capture(refundId:string|Refund,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Capture>;isRefund(resource:any):resource is Refund;relationship(id:string|ResourceId|null):RefundRel;type():string;}export default Refunds;export{Refund};
|
package/lib/resources/refunds.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as c}from"../resource";class r extends c{static TYPE="refunds";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async order(e,t,s){const n=e.id||e;return this.resources.fetch({type:"orders"},`refunds/${n}/order`,t,s)}async reference_capture(e,t,s){const n=e.id||e;return this.resources.fetch({type:"captures"},`refunds/${n}/reference_capture`,t,s)}isRefund(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,49 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Return } from './returns';
|
4
|
-
import { LineItem } from './line_items';
|
5
|
-
declare type ReturnLineItemRel = ResourceRel & {
|
6
|
-
type: typeof ReturnLineItems.TYPE;
|
7
|
-
};
|
8
|
-
declare type ReturnRel = ResourceRel & {
|
9
|
-
type: 'returns';
|
10
|
-
};
|
11
|
-
declare type LineItemRel = ResourceRel & {
|
12
|
-
type: 'line_items';
|
13
|
-
};
|
14
|
-
interface ReturnLineItem extends Resource {
|
15
|
-
sku_code?: string;
|
16
|
-
bundle_code?: string;
|
17
|
-
name?: string;
|
18
|
-
quantity?: number;
|
19
|
-
return_reason?: object;
|
20
|
-
restocked_at?: string;
|
21
|
-
return?: Return;
|
22
|
-
line_item?: LineItem;
|
23
|
-
}
|
24
|
-
interface ReturnLineItemCreate extends ResourceCreate {
|
25
|
-
quantity: number;
|
26
|
-
return_reason?: object;
|
27
|
-
return: ReturnRel;
|
28
|
-
line_item: LineItemRel;
|
29
|
-
}
|
30
|
-
interface ReturnLineItemUpdate extends ResourceUpdate {
|
31
|
-
quantity?: number;
|
32
|
-
_restock?: boolean;
|
33
|
-
return_reason?: object;
|
34
|
-
}
|
35
|
-
declare class ReturnLineItems extends ApiResource {
|
36
|
-
static readonly TYPE: 'return_line_items';
|
37
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>>;
|
38
|
-
create(resource: ReturnLineItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReturnLineItem>;
|
39
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReturnLineItem>;
|
40
|
-
update(resource: ReturnLineItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReturnLineItem>;
|
41
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
42
|
-
return(returnLineItemId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
|
43
|
-
line_item(returnLineItemId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
44
|
-
isReturnLineItem(resource: any): resource is ReturnLineItem;
|
45
|
-
relationship(id: string | ResourceId | null): ReturnLineItemRel;
|
46
|
-
type(): string;
|
47
|
-
}
|
48
|
-
export default ReturnLineItems;
|
49
|
-
export { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Return}from'./returns';import type{LineItem}from'./line_items';declare type ReturnLineItemRel=ResourceRel&{type:typeof ReturnLineItems.TYPE;};declare type ReturnRel=ResourceRel&{type:'returns';};declare type LineItemRel=ResourceRel&{type:'line_items';};interface ReturnLineItem extends Resource{sku_code?:string;bundle_code?:string;name?:string;quantity?:number;return_reason?:object;restocked_at?:string;return?:Return;line_item?:LineItem;}interface ReturnLineItemCreate extends ResourceCreate{quantity:number;return_reason?:object;return:ReturnRel;line_item:LineItemRel;}interface ReturnLineItemUpdate extends ResourceUpdate{quantity?:number;_restock?:boolean;return_reason?:object;}declare class ReturnLineItems extends ApiResource{static readonly TYPE:'return_line_items';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ReturnLineItem>>;create(resource:ReturnLineItemCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ReturnLineItem>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ReturnLineItem>;update(resource:ReturnLineItemUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ReturnLineItem>;delete(id:string,options?:ResourcesConfig):Promise<void>;return(returnLineItemId:string|ReturnLineItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Return>;line_item(returnLineItemId:string|ReturnLineItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<LineItem>;isReturnLineItem(resource:any):resource is ReturnLineItem;relationship(id:string|ResourceId|null):ReturnLineItemRel;type():string;}export default ReturnLineItems;export{ReturnLineItem,ReturnLineItemCreate,ReturnLineItemUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class r extends n{static TYPE="return_line_items";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 return(e,t,s){const i=e.id||e;return this.resources.fetch({type:"returns"},`return_line_items/${i}/return`,t,s)}async line_item(e,t,s){const i=e.id||e;return this.resources.fetch({type:"line_items"},`return_line_items/${i}/line_item`,t,s)}isReturnLineItem(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,72 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Order } from './orders';
|
4
|
-
import { Customer } from './customers';
|
5
|
-
import { StockLocation } from './stock_locations';
|
6
|
-
import { Address } from './addresses';
|
7
|
-
import { ReturnLineItem } from './return_line_items';
|
8
|
-
import { Attachment } from './attachments';
|
9
|
-
declare type ReturnRel = ResourceRel & {
|
10
|
-
type: typeof Returns.TYPE;
|
11
|
-
};
|
12
|
-
declare type OrderRel = ResourceRel & {
|
13
|
-
type: 'orders';
|
14
|
-
};
|
15
|
-
declare type StockLocationRel = ResourceRel & {
|
16
|
-
type: 'stock_locations';
|
17
|
-
};
|
18
|
-
interface Return extends Resource {
|
19
|
-
number?: string;
|
20
|
-
status?: string;
|
21
|
-
customer_email?: string;
|
22
|
-
skus_count?: number;
|
23
|
-
approved_at?: string;
|
24
|
-
cancelled_at?: string;
|
25
|
-
shipped_at?: string;
|
26
|
-
rejected_at?: string;
|
27
|
-
received_at?: string;
|
28
|
-
archived_at?: string;
|
29
|
-
order?: Order;
|
30
|
-
customer?: Customer;
|
31
|
-
stock_location?: StockLocation;
|
32
|
-
origin_address?: Address;
|
33
|
-
destination_address?: Address;
|
34
|
-
return_line_items?: ReturnLineItem[];
|
35
|
-
attachments?: Attachment[];
|
36
|
-
}
|
37
|
-
interface ReturnCreate extends ResourceCreate {
|
38
|
-
order: OrderRel;
|
39
|
-
stock_location?: StockLocationRel;
|
40
|
-
}
|
41
|
-
interface ReturnUpdate extends ResourceUpdate {
|
42
|
-
_request?: boolean;
|
43
|
-
_approve?: boolean;
|
44
|
-
_cancel?: boolean;
|
45
|
-
_ship?: boolean;
|
46
|
-
_reject?: boolean;
|
47
|
-
_receive?: boolean;
|
48
|
-
_restock?: boolean;
|
49
|
-
_archive?: boolean;
|
50
|
-
_unarchive?: boolean;
|
51
|
-
stock_location?: StockLocationRel;
|
52
|
-
}
|
53
|
-
declare class Returns extends ApiResource {
|
54
|
-
static readonly TYPE: 'returns';
|
55
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Return>>;
|
56
|
-
create(resource: ReturnCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
|
57
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
|
58
|
-
update(resource: ReturnUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
|
59
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
60
|
-
order(returnId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
61
|
-
customer(returnId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
|
62
|
-
stock_location(returnId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
63
|
-
origin_address(returnId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
64
|
-
destination_address(returnId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
65
|
-
return_line_items(returnId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>>;
|
66
|
-
attachments(returnId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
67
|
-
isReturn(resource: any): resource is Return;
|
68
|
-
relationship(id: string | ResourceId | null): ReturnRel;
|
69
|
-
type(): string;
|
70
|
-
}
|
71
|
-
export default Returns;
|
72
|
-
export { Return, ReturnCreate, ReturnUpdate };
|
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{Customer}from'./customers';import type{StockLocation}from'./stock_locations';import type{Address}from'./addresses';import type{ReturnLineItem}from'./return_line_items';import type{Attachment}from'./attachments';declare type ReturnRel=ResourceRel&{type:typeof Returns.TYPE;};declare type OrderRel=ResourceRel&{type:'orders';};declare type StockLocationRel=ResourceRel&{type:'stock_locations';};interface Return extends Resource{number?:string;status?:string;customer_email?:string;skus_count?:number;approved_at?:string;cancelled_at?:string;shipped_at?:string;rejected_at?:string;received_at?:string;archived_at?:string;order?:Order;customer?:Customer;stock_location?:StockLocation;origin_address?:Address;destination_address?:Address;return_line_items?:ReturnLineItem[];attachments?:Attachment[];}interface ReturnCreate extends ResourceCreate{order:OrderRel;stock_location?:StockLocationRel;}interface ReturnUpdate extends ResourceUpdate{_request?:boolean;_approve?:boolean;_cancel?:boolean;_ship?:boolean;_reject?:boolean;_receive?:boolean;_restock?:boolean;_archive?:boolean;_unarchive?:boolean;stock_location?:StockLocationRel;}declare class Returns extends ApiResource{static readonly TYPE:'returns';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Return>>;create(resource:ReturnCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Return>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Return>;update(resource:ReturnUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Return>;delete(id:string,options?:ResourcesConfig):Promise<void>;order(returnId:string|Return,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;customer(returnId:string|Return,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Customer>;stock_location(returnId:string|Return,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLocation>;origin_address(returnId:string|Return,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Address>;destination_address(returnId:string|Return,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Address>;return_line_items(returnId:string|Return,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ReturnLineItem>>;attachments(returnId:string|Return,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isReturn(resource:any):resource is Return;relationship(id:string|ResourceId|null):ReturnRel;type():string;}export default Returns;export{Return,ReturnCreate,ReturnUpdate};
|
package/lib/resources/returns.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as i}from"../resource";class n extends i{static TYPE="returns";async list(e,t){return this.resources.list({type:n.TYPE},e,t)}async create(e,t,s){return this.resources.create({...e,type:n.TYPE},t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:n.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update({...e,type:n.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:n.TYPE,id:e},t)}async order(e,t,s){const r=e.id||e;return this.resources.fetch({type:"orders"},`returns/${r}/order`,t,s)}async customer(e,t,s){const r=e.id||e;return this.resources.fetch({type:"customers"},`returns/${r}/customer`,t,s)}async stock_location(e,t,s){const r=e.id||e;return this.resources.fetch({type:"stock_locations"},`returns/${r}/stock_location`,t,s)}async origin_address(e,t,s){const r=e.id||e;return this.resources.fetch({type:"addresses"},`returns/${r}/origin_address`,t,s)}async destination_address(e,t,s){const r=e.id||e;return this.resources.fetch({type:"addresses"},`returns/${r}/destination_address`,t,s)}async return_line_items(e,t,s){const r=e.id||e;return this.resources.fetch({type:"return_line_items"},`returns/${r}/return_line_items`,t,s)}async attachments(e,t,s){const r=e.id||e;return this.resources.fetch({type:"attachments"},`returns/${r}/attachments`,t,s)}isReturn(e){return e.type&&e.type===n.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:n.TYPE}:{id:e.id,type:n.TYPE}}type(){return n.TYPE}}export default n;
|
@@ -1,89 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Order } from './orders';
|
4
|
-
import { ShippingCategory } from './shipping_categories';
|
5
|
-
import { StockLocation } from './stock_locations';
|
6
|
-
import { Address } from './addresses';
|
7
|
-
import { ShippingMethod } from './shipping_methods';
|
8
|
-
import { DeliveryLeadTime } from './delivery_lead_times';
|
9
|
-
import { StockLineItem } from './stock_line_items';
|
10
|
-
import { StockTransfer } from './stock_transfers';
|
11
|
-
import { CarrierAccount } from './carrier_accounts';
|
12
|
-
import { Parcel } from './parcels';
|
13
|
-
import { Attachment } from './attachments';
|
14
|
-
declare type ShipmentRel = ResourceRel & {
|
15
|
-
type: typeof Shipments.TYPE;
|
16
|
-
};
|
17
|
-
declare type ShippingMethodRel = ResourceRel & {
|
18
|
-
type: 'shipping_methods';
|
19
|
-
};
|
20
|
-
interface Shipment extends Resource {
|
21
|
-
number?: string;
|
22
|
-
status?: string;
|
23
|
-
currency_code?: string;
|
24
|
-
cost_amount_cents?: number;
|
25
|
-
cost_amount_float?: number;
|
26
|
-
formatted_cost_amount?: string;
|
27
|
-
skus_count?: number;
|
28
|
-
selected_rate_id?: string;
|
29
|
-
rates?: object[];
|
30
|
-
purchase_error_code?: string;
|
31
|
-
purchase_error_message?: string;
|
32
|
-
get_rates_started_at?: string;
|
33
|
-
get_rates_completed_at?: string;
|
34
|
-
purchase_started_at?: string;
|
35
|
-
purchase_completed_at?: string;
|
36
|
-
purchase_failed_at?: string;
|
37
|
-
order?: Order;
|
38
|
-
shipping_category?: ShippingCategory;
|
39
|
-
stock_location?: StockLocation;
|
40
|
-
origin_address?: Address;
|
41
|
-
shipping_address?: Address;
|
42
|
-
shipping_method?: ShippingMethod;
|
43
|
-
delivery_lead_time?: DeliveryLeadTime;
|
44
|
-
/**
|
45
|
-
* @deprecated This field should not be used as it may be removed in the future without notice
|
46
|
-
*/
|
47
|
-
shipment_line_items?: object[];
|
48
|
-
stock_line_items?: StockLineItem[];
|
49
|
-
stock_transfers?: StockTransfer[];
|
50
|
-
available_shipping_methods?: ShippingMethod[];
|
51
|
-
carrier_accounts?: CarrierAccount[];
|
52
|
-
parcels?: Parcel[];
|
53
|
-
attachments?: Attachment[];
|
54
|
-
}
|
55
|
-
interface ShipmentUpdate extends ResourceUpdate {
|
56
|
-
_on_hold?: boolean;
|
57
|
-
_picking?: boolean;
|
58
|
-
_packing?: boolean;
|
59
|
-
_ready_to_ship?: boolean;
|
60
|
-
_ship?: boolean;
|
61
|
-
_get_rates?: boolean;
|
62
|
-
selected_rate_id?: string;
|
63
|
-
_purchase?: boolean;
|
64
|
-
shipping_method?: ShippingMethodRel;
|
65
|
-
}
|
66
|
-
declare class Shipments extends ApiResource {
|
67
|
-
static readonly TYPE: 'shipments';
|
68
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Shipment>>;
|
69
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
70
|
-
update(resource: ShipmentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
71
|
-
order(shipmentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
72
|
-
shipping_category(shipmentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingCategory>;
|
73
|
-
stock_location(shipmentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
74
|
-
origin_address(shipmentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
75
|
-
shipping_address(shipmentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
76
|
-
shipping_method(shipmentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
|
77
|
-
delivery_lead_time(shipmentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<DeliveryLeadTime>;
|
78
|
-
stock_line_items(shipmentId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>>;
|
79
|
-
stock_transfers(shipmentId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
|
80
|
-
available_shipping_methods(shipmentId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingMethod>>;
|
81
|
-
carrier_accounts(shipmentId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CarrierAccount>>;
|
82
|
-
parcels(shipmentId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
|
83
|
-
attachments(shipmentId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
84
|
-
isShipment(resource: any): resource is Shipment;
|
85
|
-
relationship(id: string | ResourceId | null): ShipmentRel;
|
86
|
-
type(): string;
|
87
|
-
}
|
88
|
-
export default Shipments;
|
89
|
-
export { Shipment, ShipmentUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Order}from'./orders';import type{ShippingCategory}from'./shipping_categories';import type{StockLocation}from'./stock_locations';import type{Address}from'./addresses';import type{ShippingMethod}from'./shipping_methods';import type{DeliveryLeadTime}from'./delivery_lead_times';import type{StockLineItem}from'./stock_line_items';import type{StockTransfer}from'./stock_transfers';import type{CarrierAccount}from'./carrier_accounts';import type{Parcel}from'./parcels';import type{Attachment}from'./attachments';declare type ShipmentRel=ResourceRel&{type:typeof Shipments.TYPE;};declare type ShippingMethodRel=ResourceRel&{type:'shipping_methods';};interface Shipment extends Resource{number?:string;status?:string;currency_code?:string;cost_amount_cents?:number;cost_amount_float?:number;formatted_cost_amount?:string;skus_count?:number;selected_rate_id?:string;rates?:object[];purchase_error_code?:string;purchase_error_message?:string;get_rates_started_at?:string;get_rates_completed_at?:string;purchase_started_at?:string;purchase_completed_at?:string;purchase_failed_at?:string;order?:Order;shipping_category?:ShippingCategory;stock_location?:StockLocation;origin_address?:Address;shipping_address?:Address;shipping_method?:ShippingMethod;delivery_lead_time?:DeliveryLeadTime;shipment_line_items?:object[];stock_line_items?:StockLineItem[];stock_transfers?:StockTransfer[];available_shipping_methods?:ShippingMethod[];carrier_accounts?:CarrierAccount[];parcels?:Parcel[];attachments?:Attachment[];}interface ShipmentUpdate extends ResourceUpdate{_on_hold?:boolean;_picking?:boolean;_packing?:boolean;_ready_to_ship?:boolean;_ship?:boolean;_get_rates?:boolean;selected_rate_id?:string;_purchase?:boolean;shipping_method?:ShippingMethodRel;}declare class Shipments extends ApiResource{static readonly TYPE:'shipments';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Shipment>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Shipment>;update(resource:ShipmentUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Shipment>;order(shipmentId:string|Shipment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;shipping_category(shipmentId:string|Shipment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ShippingCategory>;stock_location(shipmentId:string|Shipment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLocation>;origin_address(shipmentId:string|Shipment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Address>;shipping_address(shipmentId:string|Shipment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Address>;shipping_method(shipmentId:string|Shipment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ShippingMethod>;delivery_lead_time(shipmentId:string|Shipment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<DeliveryLeadTime>;stock_line_items(shipmentId:string|Shipment,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StockLineItem>>;stock_transfers(shipmentId:string|Shipment,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StockTransfer>>;available_shipping_methods(shipmentId:string|Shipment,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ShippingMethod>>;carrier_accounts(shipmentId:string|Shipment,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<CarrierAccount>>;parcels(shipmentId:string|Shipment,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Parcel>>;attachments(shipmentId:string|Shipment,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isShipment(resource:any):resource is Shipment;relationship(id:string|ResourceId|null):ShipmentRel;type():string;}export default Shipments;export{Shipment,ShipmentUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class i extends n{static TYPE="shipments";async list(s,t){return this.resources.list({type:i.TYPE},s,t)}async retrieve(s,t,e){return this.resources.retrieve({type:i.TYPE,id:s},t,e)}async update(s,t,e){return this.resources.update({...s,type:i.TYPE},t,e)}async order(s,t,e){const r=s.id||s;return this.resources.fetch({type:"orders"},`shipments/${r}/order`,t,e)}async shipping_category(s,t,e){const r=s.id||s;return this.resources.fetch({type:"shipping_categories"},`shipments/${r}/shipping_category`,t,e)}async stock_location(s,t,e){const r=s.id||s;return this.resources.fetch({type:"stock_locations"},`shipments/${r}/stock_location`,t,e)}async origin_address(s,t,e){const r=s.id||s;return this.resources.fetch({type:"addresses"},`shipments/${r}/origin_address`,t,e)}async shipping_address(s,t,e){const r=s.id||s;return this.resources.fetch({type:"addresses"},`shipments/${r}/shipping_address`,t,e)}async shipping_method(s,t,e){const r=s.id||s;return this.resources.fetch({type:"shipping_methods"},`shipments/${r}/shipping_method`,t,e)}async delivery_lead_time(s,t,e){const r=s.id||s;return this.resources.fetch({type:"delivery_lead_times"},`shipments/${r}/delivery_lead_time`,t,e)}async stock_line_items(s,t,e){const r=s.id||s;return this.resources.fetch({type:"stock_line_items"},`shipments/${r}/stock_line_items`,t,e)}async stock_transfers(s,t,e){const r=s.id||s;return this.resources.fetch({type:"stock_transfers"},`shipments/${r}/stock_transfers`,t,e)}async available_shipping_methods(s,t,e){const r=s.id||s;return this.resources.fetch({type:"shipping_methods"},`shipments/${r}/available_shipping_methods`,t,e)}async carrier_accounts(s,t,e){const r=s.id||s;return this.resources.fetch({type:"carrier_accounts"},`shipments/${r}/carrier_accounts`,t,e)}async parcels(s,t,e){const r=s.id||s;return this.resources.fetch({type:"parcels"},`shipments/${r}/parcels`,t,e)}async attachments(s,t,e){const r=s.id||s;return this.resources.fetch({type:"attachments"},`shipments/${r}/attachments`,t,e)}isShipment(s){return s.type&&s.type===i.TYPE}relationship(s){return s===null||typeof s=="string"?{id:s,type:i.TYPE}:{id:s.id,type:i.TYPE}}type(){return i.TYPE}}export default i;
|
@@ -1,33 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Sku } from './skus';
|
4
|
-
import { Attachment } from './attachments';
|
5
|
-
declare type ShippingCategoryRel = ResourceRel & {
|
6
|
-
type: typeof ShippingCategories.TYPE;
|
7
|
-
};
|
8
|
-
interface ShippingCategory extends Resource {
|
9
|
-
name?: string;
|
10
|
-
skus?: Sku[];
|
11
|
-
attachments?: Attachment[];
|
12
|
-
}
|
13
|
-
interface ShippingCategoryCreate extends ResourceCreate {
|
14
|
-
name: string;
|
15
|
-
}
|
16
|
-
interface ShippingCategoryUpdate extends ResourceUpdate {
|
17
|
-
name?: string;
|
18
|
-
}
|
19
|
-
declare class ShippingCategories extends ApiResource {
|
20
|
-
static readonly TYPE: 'shipping_categories';
|
21
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingCategory>>;
|
22
|
-
create(resource: ShippingCategoryCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingCategory>;
|
23
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingCategory>;
|
24
|
-
update(resource: ShippingCategoryUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingCategory>;
|
25
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
26
|
-
skus(shippingCategoryId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
27
|
-
attachments(shippingCategoryId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
28
|
-
isShippingCategory(resource: any): resource is ShippingCategory;
|
29
|
-
relationship(id: string | ResourceId | null): ShippingCategoryRel;
|
30
|
-
type(): string;
|
31
|
-
}
|
32
|
-
export default ShippingCategories;
|
33
|
-
export { ShippingCategory, ShippingCategoryCreate, ShippingCategoryUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Sku}from'./skus';import type{Attachment}from'./attachments';declare type ShippingCategoryRel=ResourceRel&{type:typeof ShippingCategories.TYPE;};interface ShippingCategory extends Resource{name?:string;skus?:Sku[];attachments?:Attachment[];}interface ShippingCategoryCreate extends ResourceCreate{name:string;}interface ShippingCategoryUpdate extends ResourceUpdate{name?:string;}declare class ShippingCategories extends ApiResource{static readonly TYPE:'shipping_categories';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ShippingCategory>>;create(resource:ShippingCategoryCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ShippingCategory>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ShippingCategory>;update(resource:ShippingCategoryUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ShippingCategory>;delete(id:string,options?:ResourcesConfig):Promise<void>;skus(shippingCategoryId:string|ShippingCategory,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Sku>>;attachments(shippingCategoryId:string|ShippingCategory,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isShippingCategory(resource:any):resource is ShippingCategory;relationship(id:string|ResourceId|null):ShippingCategoryRel;type():string;}export default ShippingCategories;export{ShippingCategory,ShippingCategoryCreate,ShippingCategoryUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as c}from"../resource";class s extends c{static TYPE="shipping_categories";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 skus(e,t,r){const i=e.id||e;return this.resources.fetch({type:"skus"},`shipping_categories/${i}/skus`,t,r)}async attachments(e,t,r){const i=e.id||e;return this.resources.fetch({type:"attachments"},`shipping_categories/${i}/attachments`,t,r)}isShippingCategory(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,74 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Market } from './markets';
|
4
|
-
import { ShippingZone } from './shipping_zones';
|
5
|
-
import { ShippingCategory } from './shipping_categories';
|
6
|
-
import { DeliveryLeadTime } from './delivery_lead_times';
|
7
|
-
import { Attachment } from './attachments';
|
8
|
-
declare type ShippingMethodRel = ResourceRel & {
|
9
|
-
type: typeof ShippingMethods.TYPE;
|
10
|
-
};
|
11
|
-
declare type MarketRel = ResourceRel & {
|
12
|
-
type: 'markets';
|
13
|
-
};
|
14
|
-
declare type ShippingZoneRel = ResourceRel & {
|
15
|
-
type: 'shipping_zones';
|
16
|
-
};
|
17
|
-
declare type ShippingCategoryRel = ResourceRel & {
|
18
|
-
type: 'shipping_categories';
|
19
|
-
};
|
20
|
-
interface ShippingMethod extends Resource {
|
21
|
-
name?: string;
|
22
|
-
currency_code?: string;
|
23
|
-
disabled_at?: string;
|
24
|
-
price_amount_cents?: number;
|
25
|
-
price_amount_float?: number;
|
26
|
-
formatted_price_amount?: string;
|
27
|
-
free_over_amount_cents?: number;
|
28
|
-
free_over_amount_float?: number;
|
29
|
-
formatted_free_over_amount?: string;
|
30
|
-
price_amount_for_shipment_cents?: number;
|
31
|
-
price_amount_for_shipment_float?: number;
|
32
|
-
formatted_price_amount_for_shipment?: string;
|
33
|
-
market?: Market;
|
34
|
-
shipping_zone?: ShippingZone;
|
35
|
-
shipping_category?: ShippingCategory;
|
36
|
-
delivery_lead_time_for_shipment?: DeliveryLeadTime;
|
37
|
-
attachments?: Attachment[];
|
38
|
-
}
|
39
|
-
interface ShippingMethodCreate extends ResourceCreate {
|
40
|
-
name: string;
|
41
|
-
currency_code?: string;
|
42
|
-
price_amount_cents: number;
|
43
|
-
free_over_amount_cents?: number;
|
44
|
-
market?: MarketRel;
|
45
|
-
shipping_zone: ShippingZoneRel;
|
46
|
-
shipping_category: ShippingCategoryRel;
|
47
|
-
}
|
48
|
-
interface ShippingMethodUpdate extends ResourceUpdate {
|
49
|
-
name?: string;
|
50
|
-
currency_code?: string;
|
51
|
-
price_amount_cents?: number;
|
52
|
-
free_over_amount_cents?: number;
|
53
|
-
market?: MarketRel;
|
54
|
-
shipping_zone?: ShippingZoneRel;
|
55
|
-
shipping_category?: ShippingCategoryRel;
|
56
|
-
}
|
57
|
-
declare class ShippingMethods extends ApiResource {
|
58
|
-
static readonly TYPE: 'shipping_methods';
|
59
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingMethod>>;
|
60
|
-
create(resource: ShippingMethodCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
|
61
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
|
62
|
-
update(resource: ShippingMethodUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
|
63
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
64
|
-
market(shippingMethodId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
65
|
-
shipping_zone(shippingMethodId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingZone>;
|
66
|
-
shipping_category(shippingMethodId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingCategory>;
|
67
|
-
delivery_lead_time_for_shipment(shippingMethodId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<DeliveryLeadTime>;
|
68
|
-
attachments(shippingMethodId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
69
|
-
isShippingMethod(resource: any): resource is ShippingMethod;
|
70
|
-
relationship(id: string | ResourceId | null): ShippingMethodRel;
|
71
|
-
type(): string;
|
72
|
-
}
|
73
|
-
export default ShippingMethods;
|
74
|
-
export { ShippingMethod, ShippingMethodCreate, ShippingMethodUpdate };
|
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{ShippingZone}from'./shipping_zones';import type{ShippingCategory}from'./shipping_categories';import type{DeliveryLeadTime}from'./delivery_lead_times';import type{Attachment}from'./attachments';declare type ShippingMethodRel=ResourceRel&{type:typeof ShippingMethods.TYPE;};declare type MarketRel=ResourceRel&{type:'markets';};declare type ShippingZoneRel=ResourceRel&{type:'shipping_zones';};declare type ShippingCategoryRel=ResourceRel&{type:'shipping_categories';};interface ShippingMethod extends Resource{name?:string;currency_code?:string;disabled_at?:string;price_amount_cents?:number;price_amount_float?:number;formatted_price_amount?:string;free_over_amount_cents?:number;free_over_amount_float?:number;formatted_free_over_amount?:string;price_amount_for_shipment_cents?:number;price_amount_for_shipment_float?:number;formatted_price_amount_for_shipment?:string;market?:Market;shipping_zone?:ShippingZone;shipping_category?:ShippingCategory;delivery_lead_time_for_shipment?:DeliveryLeadTime;attachments?:Attachment[];}interface ShippingMethodCreate extends ResourceCreate{name:string;currency_code?:string;price_amount_cents:number;free_over_amount_cents?:number;market?:MarketRel;shipping_zone:ShippingZoneRel;shipping_category:ShippingCategoryRel;}interface ShippingMethodUpdate extends ResourceUpdate{name?:string;currency_code?:string;price_amount_cents?:number;free_over_amount_cents?:number;market?:MarketRel;shipping_zone?:ShippingZoneRel;shipping_category?:ShippingCategoryRel;}declare class ShippingMethods extends ApiResource{static readonly TYPE:'shipping_methods';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ShippingMethod>>;create(resource:ShippingMethodCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ShippingMethod>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ShippingMethod>;update(resource:ShippingMethodUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ShippingMethod>;delete(id:string,options?:ResourcesConfig):Promise<void>;market(shippingMethodId:string|ShippingMethod,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;shipping_zone(shippingMethodId:string|ShippingMethod,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ShippingZone>;shipping_category(shippingMethodId:string|ShippingMethod,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ShippingCategory>;delivery_lead_time_for_shipment(shippingMethodId:string|ShippingMethod,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<DeliveryLeadTime>;attachments(shippingMethodId:string|ShippingMethod,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isShippingMethod(resource:any):resource is ShippingMethod;relationship(id:string|ResourceId|null):ShippingMethodRel;type():string;}export default ShippingMethods;export{ShippingMethod,ShippingMethodCreate,ShippingMethodUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class r extends n{static TYPE="shipping_methods";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 i=e.id||e;return this.resources.fetch({type:"markets"},`shipping_methods/${i}/market`,t,s)}async shipping_zone(e,t,s){const i=e.id||e;return this.resources.fetch({type:"shipping_zones"},`shipping_methods/${i}/shipping_zone`,t,s)}async shipping_category(e,t,s){const i=e.id||e;return this.resources.fetch({type:"shipping_categories"},`shipping_methods/${i}/shipping_category`,t,s)}async delivery_lead_time_for_shipment(e,t,s){const i=e.id||e;return this.resources.fetch({type:"delivery_lead_times"},`shipping_methods/${i}/delivery_lead_time_for_shipment`,t,s)}async attachments(e,t,s){const i=e.id||e;return this.resources.fetch({type:"attachments"},`shipping_methods/${i}/attachments`,t,s)}isShippingMethod(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;
|