@commercelayer/sdk 5.0.0-alpha.1 → 5.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -33
- package/lib/api.d.ts +1 -103
- package/lib/client.d.ts +1 -31
- package/lib/client.js +1 -1
- package/lib/commercelayer.d.ts +1 -122
- package/lib/commercelayer.js +1 -1
- package/lib/common.d.ts +1 -4
- package/lib/config.d.ts +1 -11
- package/lib/debug.d.ts +1 -3
- package/lib/debug.js +1 -1
- package/lib/error.d.ts +1 -26
- package/lib/error.js +1 -1
- package/lib/index.d.ts +1 -7
- package/lib/interceptor.d.ts +1 -19
- package/lib/jsonapi.d.ts +1 -5
- package/lib/jsonapi.js +1 -1
- package/lib/model.d.ts +1 -101
- package/lib/query.d.ts +1 -23
- package/lib/query.js +1 -1
- package/lib/resource.d.ts +1 -76
- package/lib/resource.js +1 -1
- package/lib/resources/addresses.d.ts +1 -88
- package/lib/resources/addresses.js +1 -1
- package/lib/resources/adjustments.d.ts +1 -35
- package/lib/resources/adjustments.js +1 -1
- package/lib/resources/adyen_gateways.d.ts +1 -47
- package/lib/resources/adyen_gateways.js +1 -1
- package/lib/resources/adyen_payments.d.ts +1 -44
- package/lib/resources/adyen_payments.js +1 -1
- package/lib/resources/application.d.ts +1 -21
- package/lib/resources/application.js +1 -1
- package/lib/resources/attachments.d.ts +1 -156
- package/lib/resources/attachments.js +1 -1
- package/lib/resources/authorizations.d.ts +1 -57
- package/lib/resources/authorizations.js +1 -1
- package/lib/resources/avalara_accounts.d.ts +1 -52
- package/lib/resources/avalara_accounts.js +1 -1
- package/lib/resources/billing_info_validation_rules.d.ts +1 -32
- package/lib/resources/billing_info_validation_rules.js +1 -1
- package/lib/resources/bing_geocoders.d.ts +1 -35
- package/lib/resources/bing_geocoders.js +1 -1
- package/lib/resources/braintree_gateways.d.ts +1 -56
- package/lib/resources/braintree_gateways.js +1 -1
- package/lib/resources/braintree_payments.d.ts +1 -47
- package/lib/resources/braintree_payments.js +1 -1
- package/lib/resources/bundles.d.ts +1 -74
- package/lib/resources/bundles.js +1 -1
- package/lib/resources/captures.d.ts +1 -48
- package/lib/resources/captures.js +1 -1
- package/lib/resources/carrier_accounts.d.ts +1 -26
- package/lib/resources/carrier_accounts.js +1 -1
- package/lib/resources/checkout_com_gateways.d.ts +1 -45
- package/lib/resources/checkout_com_gateways.js +1 -1
- package/lib/resources/checkout_com_payments.d.ts +1 -50
- package/lib/resources/checkout_com_payments.js +1 -1
- package/lib/resources/coupon_codes_promotion_rules.d.ts +1 -59
- package/lib/resources/coupon_codes_promotion_rules.js +1 -1
- package/lib/resources/coupon_recipients.d.ts +1 -44
- package/lib/resources/coupon_recipients.js +1 -1
- package/lib/resources/coupons.d.ts +1 -45
- package/lib/resources/coupons.js +1 -1
- package/lib/resources/customer_addresses.d.ts +1 -41
- package/lib/resources/customer_addresses.js +1 -1
- package/lib/resources/customer_groups.d.ts +1 -36
- package/lib/resources/customer_groups.js +1 -1
- package/lib/resources/customer_password_resets.d.ts +1 -33
- package/lib/resources/customer_password_resets.js +1 -1
- package/lib/resources/customer_payment_sources.d.ts +1 -70
- package/lib/resources/customer_payment_sources.js +1 -1
- package/lib/resources/customer_subscriptions.d.ts +1 -28
- package/lib/resources/customer_subscriptions.js +1 -1
- package/lib/resources/customers.d.ts +1 -60
- package/lib/resources/customers.js +1 -1
- package/lib/resources/delivery_lead_times.d.ts +1 -51
- package/lib/resources/delivery_lead_times.js +1 -1
- package/lib/resources/event_callbacks.d.ts +1 -24
- package/lib/resources/event_callbacks.js +1 -1
- package/lib/resources/external_gateways.d.ts +1 -49
- package/lib/resources/external_gateways.js +1 -1
- package/lib/resources/external_payments.d.ts +1 -43
- package/lib/resources/external_payments.js +1 -1
- package/lib/resources/external_promotions.d.ts +1 -86
- package/lib/resources/external_promotions.js +1 -1
- package/lib/resources/external_tax_calculators.d.ts +1 -44
- package/lib/resources/external_tax_calculators.js +1 -1
- package/lib/resources/fixed_amount_promotions.d.ts +1 -88
- package/lib/resources/fixed_amount_promotions.js +1 -1
- package/lib/resources/fixed_price_promotions.d.ts +1 -99
- package/lib/resources/fixed_price_promotions.js +1 -1
- package/lib/resources/free_gift_promotions.d.ts +1 -97
- package/lib/resources/free_gift_promotions.js +1 -1
- package/lib/resources/free_shipping_promotions.d.ts +1 -83
- package/lib/resources/free_shipping_promotions.js +1 -1
- package/lib/resources/geocoders.d.ts +1 -24
- package/lib/resources/geocoders.js +1 -1
- package/lib/resources/gift_card_recipients.d.ts +1 -44
- package/lib/resources/gift_card_recipients.js +1 -1
- package/lib/resources/gift_cards.d.ts +1 -82
- package/lib/resources/gift_cards.js +1 -1
- package/lib/resources/google_geocoders.d.ts +1 -35
- package/lib/resources/google_geocoders.js +1 -1
- package/lib/resources/imports.d.ts +1 -40
- package/lib/resources/imports.js +1 -1
- package/lib/resources/in_stock_subscriptions.d.ts +1 -59
- package/lib/resources/in_stock_subscriptions.js +1 -1
- package/lib/resources/inventory_models.d.ts +1 -42
- package/lib/resources/inventory_models.js +1 -1
- package/lib/resources/inventory_return_locations.d.ts +1 -43
- package/lib/resources/inventory_return_locations.js +1 -1
- package/lib/resources/inventory_stock_locations.d.ts +1 -46
- package/lib/resources/inventory_stock_locations.js +1 -1
- package/lib/resources/klarna_gateways.d.ts +1 -44
- package/lib/resources/klarna_gateways.js +1 -1
- package/lib/resources/klarna_payments.d.ts +1 -41
- package/lib/resources/klarna_payments.js +1 -1
- package/lib/resources/line_item_options.d.ts +1 -57
- package/lib/resources/line_item_options.js +1 -1
- package/lib/resources/line_items.d.ts +1 -125
- package/lib/resources/line_items.js +1 -1
- package/lib/resources/manual_gateways.d.ts +1 -33
- package/lib/resources/manual_gateways.js +1 -1
- package/lib/resources/manual_tax_calculators.d.ts +1 -49
- package/lib/resources/manual_tax_calculators.js +1 -1
- package/lib/resources/markets.d.ts +1 -81
- package/lib/resources/markets.js +1 -1
- package/lib/resources/merchants.d.ts +1 -38
- package/lib/resources/merchants.js +1 -1
- package/lib/resources/order_amount_promotion_rules.d.ts +1 -56
- package/lib/resources/order_amount_promotion_rules.js +1 -1
- package/lib/resources/order_copies.d.ts +1 -45
- package/lib/resources/order_copies.js +1 -1
- package/lib/resources/order_subscriptions.d.ts +1 -67
- package/lib/resources/order_subscriptions.js +1 -1
- package/lib/resources/order_validation_rules.d.ts +1 -20
- package/lib/resources/order_validation_rules.js +1 -1
- package/lib/resources/orders.d.ts +1 -271
- package/lib/resources/orders.js +1 -1
- package/lib/resources/organization.d.ts +1 -32
- package/lib/resources/organization.js +1 -1
- package/lib/resources/packages.d.ts +1 -56
- package/lib/resources/packages.js +1 -1
- package/lib/resources/parcel_line_items.d.ts +1 -49
- package/lib/resources/parcel_line_items.js +1 -1
- package/lib/resources/parcels.d.ts +1 -108
- package/lib/resources/parcels.js +1 -1
- package/lib/resources/payment_gateways.d.ts +1 -21
- package/lib/resources/payment_gateways.js +1 -1
- package/lib/resources/payment_methods.d.ts +1 -59
- package/lib/resources/payment_methods.js +1 -1
- package/lib/resources/paypal_gateways.d.ts +1 -39
- package/lib/resources/paypal_gateways.js +1 -1
- package/lib/resources/paypal_payments.d.ts +1 -47
- package/lib/resources/paypal_payments.js +1 -1
- package/lib/resources/percentage_discount_promotions.d.ts +1 -97
- package/lib/resources/percentage_discount_promotions.js +1 -1
- package/lib/resources/price_lists.d.ts +1 -39
- package/lib/resources/price_lists.js +1 -1
- package/lib/resources/prices.d.ts +1 -57
- package/lib/resources/prices.js +1 -1
- package/lib/resources/promotion_rules.d.ts +1 -24
- package/lib/resources/promotion_rules.js +1 -1
- package/lib/resources/promotions.d.ts +1 -41
- package/lib/resources/promotions.js +1 -1
- package/lib/resources/refunds.d.ts +1 -34
- package/lib/resources/refunds.js +1 -1
- package/lib/resources/return_line_items.d.ts +1 -49
- package/lib/resources/return_line_items.js +1 -1
- package/lib/resources/returns.d.ts +1 -72
- package/lib/resources/returns.js +1 -1
- package/lib/resources/shipments.d.ts +1 -89
- package/lib/resources/shipments.js +1 -1
- package/lib/resources/shipping_categories.d.ts +1 -33
- package/lib/resources/shipping_categories.js +1 -1
- package/lib/resources/shipping_methods.d.ts +1 -74
- package/lib/resources/shipping_methods.js +1 -1
- package/lib/resources/shipping_zones.d.ts +1 -48
- package/lib/resources/shipping_zones.js +1 -1
- package/lib/resources/sku_list_items.d.ts +1 -47
- package/lib/resources/sku_list_items.js +1 -1
- package/lib/resources/sku_list_promotion_rules.d.ts +1 -68
- package/lib/resources/sku_list_promotion_rules.js +1 -1
- package/lib/resources/sku_lists.d.ts +1 -49
- package/lib/resources/sku_lists.js +1 -1
- package/lib/resources/sku_options.d.ts +1 -56
- package/lib/resources/sku_options.js +1 -1
- package/lib/resources/skus.d.ts +1 -78
- package/lib/resources/skus.js +1 -1
- package/lib/resources/stock_items.d.ts +1 -49
- package/lib/resources/stock_items.js +1 -1
- package/lib/resources/stock_line_items.d.ts +1 -29
- package/lib/resources/stock_line_items.js +1 -1
- package/lib/resources/stock_locations.d.ts +1 -57
- package/lib/resources/stock_locations.js +1 -1
- package/lib/resources/stock_transfers.d.ts +1 -71
- package/lib/resources/stock_transfers.js +1 -1
- package/lib/resources/stripe_gateways.d.ts +1 -38
- package/lib/resources/stripe_gateways.js +1 -1
- package/lib/resources/stripe_payments.d.ts +1 -42
- package/lib/resources/stripe_payments.js +1 -1
- package/lib/resources/tax_calculators.d.ts +1 -27
- package/lib/resources/tax_calculators.js +1 -1
- package/lib/resources/tax_categories.d.ts +1 -59
- package/lib/resources/tax_categories.js +1 -1
- package/lib/resources/tax_rules.d.ts +1 -69
- package/lib/resources/tax_rules.js +1 -1
- package/lib/resources/taxjar_accounts.d.ts +1 -43
- package/lib/resources/taxjar_accounts.js +1 -1
- package/lib/resources/transactions.d.ts +1 -31
- package/lib/resources/transactions.js +1 -1
- package/lib/resources/voids.d.ts +1 -34
- package/lib/resources/voids.js +1 -1
- package/lib/resources/webhooks.d.ts +1 -42
- package/lib/resources/webhooks.js +1 -1
- package/lib/resources/wire_transfers.d.ts +1 -32
- package/lib/resources/wire_transfers.js +1 -1
- package/lib/static.d.ts +1 -6
- package/lib/static.js +1 -1
- package/lib/util.d.ts +1 -2
- package/package.json +19 -22
@@ -1,86 +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 ExternalPromotionRel = ResourceRel & {
|
10
|
-
type: typeof ExternalPromotions.TYPE;
|
11
|
-
};
|
12
|
-
declare type MarketRel = ResourceRel & {
|
13
|
-
type: 'markets';
|
14
|
-
};
|
15
|
-
declare type PromotionRuleRel = ResourceRel & {
|
16
|
-
type: 'promotion_rules';
|
17
|
-
};
|
18
|
-
declare type OrderAmountPromotionRuleRel = ResourceRel & {
|
19
|
-
type: 'order_amount_promotion_rules';
|
20
|
-
};
|
21
|
-
declare type SkuListPromotionRuleRel = ResourceRel & {
|
22
|
-
type: 'sku_list_promotion_rules';
|
23
|
-
};
|
24
|
-
declare type CouponCodesPromotionRuleRel = ResourceRel & {
|
25
|
-
type: 'coupon_codes_promotion_rules';
|
26
|
-
};
|
27
|
-
interface ExternalPromotion extends Resource {
|
28
|
-
name?: string;
|
29
|
-
currency_code?: string;
|
30
|
-
starts_at?: string;
|
31
|
-
expires_at?: string;
|
32
|
-
total_usage_limit?: number;
|
33
|
-
total_usage_count?: number;
|
34
|
-
active?: boolean;
|
35
|
-
promotion_url?: string;
|
36
|
-
market?: Market;
|
37
|
-
promotion_rules?: PromotionRule[];
|
38
|
-
order_amount_promotion_rule?: OrderAmountPromotionRule;
|
39
|
-
sku_list_promotion_rule?: SkuListPromotionRule;
|
40
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRule;
|
41
|
-
attachments?: Attachment[];
|
42
|
-
}
|
43
|
-
interface ExternalPromotionCreate extends ResourceCreate {
|
44
|
-
name: string;
|
45
|
-
currency_code?: string;
|
46
|
-
starts_at: string;
|
47
|
-
expires_at: string;
|
48
|
-
total_usage_limit: number;
|
49
|
-
promotion_url: string;
|
50
|
-
market?: MarketRel;
|
51
|
-
promotion_rules?: PromotionRuleRel[];
|
52
|
-
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
53
|
-
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
54
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
55
|
-
}
|
56
|
-
interface ExternalPromotionUpdate extends ResourceUpdate {
|
57
|
-
name?: string;
|
58
|
-
currency_code?: string;
|
59
|
-
starts_at?: string;
|
60
|
-
expires_at?: string;
|
61
|
-
total_usage_limit?: number;
|
62
|
-
promotion_url?: string;
|
63
|
-
market?: MarketRel;
|
64
|
-
promotion_rules?: PromotionRuleRel[];
|
65
|
-
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
66
|
-
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
67
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
68
|
-
}
|
69
|
-
declare class ExternalPromotions extends ApiResource {
|
70
|
-
static readonly TYPE: 'external_promotions';
|
71
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ExternalPromotion>>;
|
72
|
-
create(resource: ExternalPromotionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalPromotion>;
|
73
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalPromotion>;
|
74
|
-
update(resource: ExternalPromotionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalPromotion>;
|
75
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
76
|
-
market(externalPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
77
|
-
order_amount_promotion_rule(externalPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
78
|
-
sku_list_promotion_rule(externalPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
79
|
-
coupon_codes_promotion_rule(externalPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
80
|
-
attachments(externalPromotionId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
81
|
-
isExternalPromotion(resource: any): resource is ExternalPromotion;
|
82
|
-
relationship(id: string | ResourceId | null): ExternalPromotionRel;
|
83
|
-
type(): string;
|
84
|
-
}
|
85
|
-
export default ExternalPromotions;
|
86
|
-
export { ExternalPromotion, ExternalPromotionCreate, ExternalPromotionUpdate };
|
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';declare type ExternalPromotionRel=ResourceRel&{type:typeof ExternalPromotions.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';};interface ExternalPromotion extends Resource{name?:string;currency_code?:string;starts_at?:string;expires_at?:string;total_usage_limit?:number;total_usage_count?:number;active?:boolean;promotion_url?:string;market?:Market;promotion_rules?:PromotionRule[];order_amount_promotion_rule?:OrderAmountPromotionRule;sku_list_promotion_rule?:SkuListPromotionRule;coupon_codes_promotion_rule?:CouponCodesPromotionRule;attachments?:Attachment[];}interface ExternalPromotionCreate extends ResourceCreate{name:string;currency_code?:string;starts_at:string;expires_at:string;total_usage_limit:number;promotion_url:string;market?:MarketRel;promotion_rules?:PromotionRuleRel[];order_amount_promotion_rule?:OrderAmountPromotionRuleRel;sku_list_promotion_rule?:SkuListPromotionRuleRel;coupon_codes_promotion_rule?:CouponCodesPromotionRuleRel;}interface ExternalPromotionUpdate extends ResourceUpdate{name?:string;currency_code?:string;starts_at?:string;expires_at?:string;total_usage_limit?:number;promotion_url?:string;market?:MarketRel;promotion_rules?:PromotionRuleRel[];order_amount_promotion_rule?:OrderAmountPromotionRuleRel;sku_list_promotion_rule?:SkuListPromotionRuleRel;coupon_codes_promotion_rule?:CouponCodesPromotionRuleRel;}declare class ExternalPromotions extends ApiResource{static readonly TYPE:'external_promotions';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ExternalPromotion>>;create(resource:ExternalPromotionCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ExternalPromotion>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ExternalPromotion>;update(resource:ExternalPromotionUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ExternalPromotion>;delete(id:string,options?:ResourcesConfig):Promise<void>;market(externalPromotionId:string|ExternalPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;order_amount_promotion_rule(externalPromotionId:string|ExternalPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<OrderAmountPromotionRule>;sku_list_promotion_rule(externalPromotionId:string|ExternalPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuListPromotionRule>;coupon_codes_promotion_rule(externalPromotionId:string|ExternalPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CouponCodesPromotionRule>;attachments(externalPromotionId:string|ExternalPromotion,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isExternalPromotion(resource:any):resource is ExternalPromotion;relationship(id:string|ResourceId|null):ExternalPromotionRel;type():string;}export default ExternalPromotions;export{ExternalPromotion,ExternalPromotionCreate,ExternalPromotionUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class s extends n{static TYPE="external_promotions";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 o=e.id||e;return this.resources.fetch({type:"markets"},`external_promotions/${o}/market`,t,r)}async order_amount_promotion_rule(e,t,r){const o=e.id||e;return this.resources.fetch({type:"order_amount_promotion_rules"},`external_promotions/${o}/order_amount_promotion_rule`,t,r)}async sku_list_promotion_rule(e,t,r){const o=e.id||e;return this.resources.fetch({type:"sku_list_promotion_rules"},`external_promotions/${o}/sku_list_promotion_rule`,t,r)}async coupon_codes_promotion_rule(e,t,r){const o=e.id||e;return this.resources.fetch({type:"coupon_codes_promotion_rules"},`external_promotions/${o}/coupon_codes_promotion_rule`,t,r)}async attachments(e,t,r){const o=e.id||e;return this.resources.fetch({type:"attachments"},`external_promotions/${o}/attachments`,t,r)}isExternalPromotion(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,44 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { TaxCategory } from './tax_categories';
|
4
|
-
import { Market } from './markets';
|
5
|
-
import { Attachment } from './attachments';
|
6
|
-
declare type ExternalTaxCalculatorRel = ResourceRel & {
|
7
|
-
type: typeof ExternalTaxCalculators.TYPE;
|
8
|
-
};
|
9
|
-
declare type TaxCategoryRel = ResourceRel & {
|
10
|
-
type: 'tax_categories';
|
11
|
-
};
|
12
|
-
interface ExternalTaxCalculator extends Resource {
|
13
|
-
name?: string;
|
14
|
-
tax_calculator_url?: string;
|
15
|
-
tax_categories?: TaxCategory[];
|
16
|
-
markets?: Market[];
|
17
|
-
attachments?: Attachment[];
|
18
|
-
}
|
19
|
-
interface ExternalTaxCalculatorCreate extends ResourceCreate {
|
20
|
-
name: string;
|
21
|
-
tax_calculator_url: string;
|
22
|
-
tax_categories?: TaxCategoryRel[];
|
23
|
-
}
|
24
|
-
interface ExternalTaxCalculatorUpdate extends ResourceUpdate {
|
25
|
-
name?: string;
|
26
|
-
tax_calculator_url?: string;
|
27
|
-
tax_categories?: TaxCategoryRel[];
|
28
|
-
}
|
29
|
-
declare class ExternalTaxCalculators extends ApiResource {
|
30
|
-
static readonly TYPE: 'external_tax_calculators';
|
31
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ExternalTaxCalculator>>;
|
32
|
-
create(resource: ExternalTaxCalculatorCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalTaxCalculator>;
|
33
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalTaxCalculator>;
|
34
|
-
update(resource: ExternalTaxCalculatorUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ExternalTaxCalculator>;
|
35
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
36
|
-
tax_categories(externalTaxCalculatorId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<TaxCategory>>;
|
37
|
-
markets(externalTaxCalculatorId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
|
38
|
-
attachments(externalTaxCalculatorId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
39
|
-
isExternalTaxCalculator(resource: any): resource is ExternalTaxCalculator;
|
40
|
-
relationship(id: string | ResourceId | null): ExternalTaxCalculatorRel;
|
41
|
-
type(): string;
|
42
|
-
}
|
43
|
-
export default ExternalTaxCalculators;
|
44
|
-
export { ExternalTaxCalculator, ExternalTaxCalculatorCreate, ExternalTaxCalculatorUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{TaxCategory}from'./tax_categories';import type{Market}from'./markets';import type{Attachment}from'./attachments';declare type ExternalTaxCalculatorRel=ResourceRel&{type:typeof ExternalTaxCalculators.TYPE;};declare type TaxCategoryRel=ResourceRel&{type:'tax_categories';};interface ExternalTaxCalculator extends Resource{name?:string;tax_calculator_url?:string;tax_categories?:TaxCategory[];markets?:Market[];attachments?:Attachment[];}interface ExternalTaxCalculatorCreate extends ResourceCreate{name:string;tax_calculator_url:string;tax_categories?:TaxCategoryRel[];}interface ExternalTaxCalculatorUpdate extends ResourceUpdate{name?:string;tax_calculator_url?:string;tax_categories?:TaxCategoryRel[];}declare class ExternalTaxCalculators extends ApiResource{static readonly TYPE:'external_tax_calculators';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ExternalTaxCalculator>>;create(resource:ExternalTaxCalculatorCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ExternalTaxCalculator>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ExternalTaxCalculator>;update(resource:ExternalTaxCalculatorUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ExternalTaxCalculator>;delete(id:string,options?:ResourcesConfig):Promise<void>;tax_categories(externalTaxCalculatorId:string|ExternalTaxCalculator,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<TaxCategory>>;markets(externalTaxCalculatorId:string|ExternalTaxCalculator,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Market>>;attachments(externalTaxCalculatorId:string|ExternalTaxCalculator,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isExternalTaxCalculator(resource:any):resource is ExternalTaxCalculator;relationship(id:string|ResourceId|null):ExternalTaxCalculatorRel;type():string;}export default ExternalTaxCalculators;export{ExternalTaxCalculator,ExternalTaxCalculatorCreate,ExternalTaxCalculatorUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as c}from"../resource";class a extends c{static TYPE="external_tax_calculators";async list(e,t){return this.resources.list({type:a.TYPE},e,t)}async create(e,t,s){return this.resources.create({...e,type:a.TYPE},t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:a.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update({...e,type:a.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:a.TYPE,id:e},t)}async tax_categories(e,t,s){const r=e.id||e;return this.resources.fetch({type:"tax_categories"},`external_tax_calculators/${r}/tax_categories`,t,s)}async markets(e,t,s){const r=e.id||e;return this.resources.fetch({type:"markets"},`external_tax_calculators/${r}/markets`,t,s)}async attachments(e,t,s){const r=e.id||e;return this.resources.fetch({type:"attachments"},`external_tax_calculators/${r}/attachments`,t,s)}isExternalTaxCalculator(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,88 +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 FixedAmountPromotionRel = ResourceRel & {
|
10
|
-
type: typeof FixedAmountPromotions.TYPE;
|
11
|
-
};
|
12
|
-
declare type MarketRel = ResourceRel & {
|
13
|
-
type: 'markets';
|
14
|
-
};
|
15
|
-
declare type PromotionRuleRel = ResourceRel & {
|
16
|
-
type: 'promotion_rules';
|
17
|
-
};
|
18
|
-
declare type OrderAmountPromotionRuleRel = ResourceRel & {
|
19
|
-
type: 'order_amount_promotion_rules';
|
20
|
-
};
|
21
|
-
declare type SkuListPromotionRuleRel = ResourceRel & {
|
22
|
-
type: 'sku_list_promotion_rules';
|
23
|
-
};
|
24
|
-
declare type CouponCodesPromotionRuleRel = ResourceRel & {
|
25
|
-
type: 'coupon_codes_promotion_rules';
|
26
|
-
};
|
27
|
-
interface FixedAmountPromotion extends Resource {
|
28
|
-
name?: string;
|
29
|
-
currency_code?: string;
|
30
|
-
starts_at?: string;
|
31
|
-
expires_at?: string;
|
32
|
-
total_usage_limit?: number;
|
33
|
-
total_usage_count?: number;
|
34
|
-
active?: boolean;
|
35
|
-
fixed_amount_cents?: number;
|
36
|
-
fixed_amount_float?: number;
|
37
|
-
formatted_fixed_amount?: string;
|
38
|
-
market?: Market;
|
39
|
-
promotion_rules?: PromotionRule[];
|
40
|
-
order_amount_promotion_rule?: OrderAmountPromotionRule;
|
41
|
-
sku_list_promotion_rule?: SkuListPromotionRule;
|
42
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRule;
|
43
|
-
attachments?: Attachment[];
|
44
|
-
}
|
45
|
-
interface FixedAmountPromotionCreate extends ResourceCreate {
|
46
|
-
name: string;
|
47
|
-
currency_code?: string;
|
48
|
-
starts_at: string;
|
49
|
-
expires_at: string;
|
50
|
-
total_usage_limit: number;
|
51
|
-
fixed_amount_cents: number;
|
52
|
-
market?: MarketRel;
|
53
|
-
promotion_rules?: PromotionRuleRel[];
|
54
|
-
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
55
|
-
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
56
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
57
|
-
}
|
58
|
-
interface FixedAmountPromotionUpdate extends ResourceUpdate {
|
59
|
-
name?: string;
|
60
|
-
currency_code?: string;
|
61
|
-
starts_at?: string;
|
62
|
-
expires_at?: string;
|
63
|
-
total_usage_limit?: number;
|
64
|
-
fixed_amount_cents?: number;
|
65
|
-
market?: MarketRel;
|
66
|
-
promotion_rules?: PromotionRuleRel[];
|
67
|
-
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
68
|
-
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
69
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
70
|
-
}
|
71
|
-
declare class FixedAmountPromotions extends ApiResource {
|
72
|
-
static readonly TYPE: 'fixed_amount_promotions';
|
73
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<FixedAmountPromotion>>;
|
74
|
-
create(resource: FixedAmountPromotionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FixedAmountPromotion>;
|
75
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FixedAmountPromotion>;
|
76
|
-
update(resource: FixedAmountPromotionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FixedAmountPromotion>;
|
77
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
78
|
-
market(fixedAmountPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
79
|
-
order_amount_promotion_rule(fixedAmountPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
80
|
-
sku_list_promotion_rule(fixedAmountPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
81
|
-
coupon_codes_promotion_rule(fixedAmountPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
82
|
-
attachments(fixedAmountPromotionId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
83
|
-
isFixedAmountPromotion(resource: any): resource is FixedAmountPromotion;
|
84
|
-
relationship(id: string | ResourceId | null): FixedAmountPromotionRel;
|
85
|
-
type(): string;
|
86
|
-
}
|
87
|
-
export default FixedAmountPromotions;
|
88
|
-
export { FixedAmountPromotion, FixedAmountPromotionCreate, FixedAmountPromotionUpdate };
|
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';declare type FixedAmountPromotionRel=ResourceRel&{type:typeof FixedAmountPromotions.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';};interface FixedAmountPromotion extends Resource{name?:string;currency_code?:string;starts_at?:string;expires_at?:string;total_usage_limit?:number;total_usage_count?:number;active?:boolean;fixed_amount_cents?:number;fixed_amount_float?:number;formatted_fixed_amount?:string;market?:Market;promotion_rules?:PromotionRule[];order_amount_promotion_rule?:OrderAmountPromotionRule;sku_list_promotion_rule?:SkuListPromotionRule;coupon_codes_promotion_rule?:CouponCodesPromotionRule;attachments?:Attachment[];}interface FixedAmountPromotionCreate extends ResourceCreate{name:string;currency_code?:string;starts_at:string;expires_at:string;total_usage_limit:number;fixed_amount_cents:number;market?:MarketRel;promotion_rules?:PromotionRuleRel[];order_amount_promotion_rule?:OrderAmountPromotionRuleRel;sku_list_promotion_rule?:SkuListPromotionRuleRel;coupon_codes_promotion_rule?:CouponCodesPromotionRuleRel;}interface FixedAmountPromotionUpdate extends ResourceUpdate{name?:string;currency_code?:string;starts_at?:string;expires_at?:string;total_usage_limit?:number;fixed_amount_cents?:number;market?:MarketRel;promotion_rules?:PromotionRuleRel[];order_amount_promotion_rule?:OrderAmountPromotionRuleRel;sku_list_promotion_rule?:SkuListPromotionRuleRel;coupon_codes_promotion_rule?:CouponCodesPromotionRuleRel;}declare class FixedAmountPromotions extends ApiResource{static readonly TYPE:'fixed_amount_promotions';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<FixedAmountPromotion>>;create(resource:FixedAmountPromotionCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<FixedAmountPromotion>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<FixedAmountPromotion>;update(resource:FixedAmountPromotionUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<FixedAmountPromotion>;delete(id:string,options?:ResourcesConfig):Promise<void>;market(fixedAmountPromotionId:string|FixedAmountPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;order_amount_promotion_rule(fixedAmountPromotionId:string|FixedAmountPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<OrderAmountPromotionRule>;sku_list_promotion_rule(fixedAmountPromotionId:string|FixedAmountPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuListPromotionRule>;coupon_codes_promotion_rule(fixedAmountPromotionId:string|FixedAmountPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CouponCodesPromotionRule>;attachments(fixedAmountPromotionId:string|FixedAmountPromotion,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isFixedAmountPromotion(resource:any):resource is FixedAmountPromotion;relationship(id:string|ResourceId|null):FixedAmountPromotionRel;type():string;}export default FixedAmountPromotions;export{FixedAmountPromotion,FixedAmountPromotionCreate,FixedAmountPromotionUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class s extends n{static TYPE="fixed_amount_promotions";async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,o){return this.resources.create({...e,type:s.TYPE},t,o)}async retrieve(e,t,o){return this.resources.retrieve({type:s.TYPE,id:e},t,o)}async update(e,t,o){return this.resources.update({...e,type:s.TYPE},t,o)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}async market(e,t,o){const r=e.id||e;return this.resources.fetch({type:"markets"},`fixed_amount_promotions/${r}/market`,t,o)}async order_amount_promotion_rule(e,t,o){const r=e.id||e;return this.resources.fetch({type:"order_amount_promotion_rules"},`fixed_amount_promotions/${r}/order_amount_promotion_rule`,t,o)}async sku_list_promotion_rule(e,t,o){const r=e.id||e;return this.resources.fetch({type:"sku_list_promotion_rules"},`fixed_amount_promotions/${r}/sku_list_promotion_rule`,t,o)}async coupon_codes_promotion_rule(e,t,o){const r=e.id||e;return this.resources.fetch({type:"coupon_codes_promotion_rules"},`fixed_amount_promotions/${r}/coupon_codes_promotion_rule`,t,o)}async attachments(e,t,o){const r=e.id||e;return this.resources.fetch({type:"attachments"},`fixed_amount_promotions/${r}/attachments`,t,o)}isFixedAmountPromotion(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,99 +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 FixedPricePromotionRel = ResourceRel & {
|
12
|
-
type: typeof FixedPricePromotions.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 FixedPricePromotion 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
|
-
fixed_amount_cents?: number;
|
41
|
-
fixed_amount_float?: number;
|
42
|
-
formatted_fixed_amount?: string;
|
43
|
-
market?: Market;
|
44
|
-
promotion_rules?: PromotionRule[];
|
45
|
-
order_amount_promotion_rule?: OrderAmountPromotionRule;
|
46
|
-
sku_list_promotion_rule?: SkuListPromotionRule;
|
47
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRule;
|
48
|
-
attachments?: Attachment[];
|
49
|
-
sku_list?: SkuList;
|
50
|
-
skus?: Sku[];
|
51
|
-
}
|
52
|
-
interface FixedPricePromotionCreate extends ResourceCreate {
|
53
|
-
name: string;
|
54
|
-
currency_code?: string;
|
55
|
-
starts_at: string;
|
56
|
-
expires_at: string;
|
57
|
-
total_usage_limit: number;
|
58
|
-
fixed_amount_cents: number;
|
59
|
-
market?: MarketRel;
|
60
|
-
promotion_rules?: PromotionRuleRel[];
|
61
|
-
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
62
|
-
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
63
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
64
|
-
sku_list: SkuListRel;
|
65
|
-
}
|
66
|
-
interface FixedPricePromotionUpdate extends ResourceUpdate {
|
67
|
-
name?: string;
|
68
|
-
currency_code?: string;
|
69
|
-
starts_at?: string;
|
70
|
-
expires_at?: string;
|
71
|
-
total_usage_limit?: number;
|
72
|
-
fixed_amount_cents?: number;
|
73
|
-
market?: MarketRel;
|
74
|
-
promotion_rules?: PromotionRuleRel[];
|
75
|
-
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
76
|
-
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
77
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
78
|
-
sku_list?: SkuListRel;
|
79
|
-
}
|
80
|
-
declare class FixedPricePromotions extends ApiResource {
|
81
|
-
static readonly TYPE: 'fixed_price_promotions';
|
82
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<FixedPricePromotion>>;
|
83
|
-
create(resource: FixedPricePromotionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FixedPricePromotion>;
|
84
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FixedPricePromotion>;
|
85
|
-
update(resource: FixedPricePromotionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FixedPricePromotion>;
|
86
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
87
|
-
market(fixedPricePromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
88
|
-
order_amount_promotion_rule(fixedPricePromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
89
|
-
sku_list_promotion_rule(fixedPricePromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
90
|
-
coupon_codes_promotion_rule(fixedPricePromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
91
|
-
attachments(fixedPricePromotionId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
92
|
-
sku_list(fixedPricePromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
93
|
-
skus(fixedPricePromotionId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
94
|
-
isFixedPricePromotion(resource: any): resource is FixedPricePromotion;
|
95
|
-
relationship(id: string | ResourceId | null): FixedPricePromotionRel;
|
96
|
-
type(): string;
|
97
|
-
}
|
98
|
-
export default FixedPricePromotions;
|
99
|
-
export { FixedPricePromotion, FixedPricePromotionCreate, FixedPricePromotionUpdate };
|
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 FixedPricePromotionRel=ResourceRel&{type:typeof FixedPricePromotions.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 FixedPricePromotion extends Resource{name?:string;currency_code?:string;starts_at?:string;expires_at?:string;total_usage_limit?:number;total_usage_count?:number;active?:boolean;fixed_amount_cents?:number;fixed_amount_float?:number;formatted_fixed_amount?:string;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 FixedPricePromotionCreate extends ResourceCreate{name:string;currency_code?:string;starts_at:string;expires_at:string;total_usage_limit:number;fixed_amount_cents: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 FixedPricePromotionUpdate extends ResourceUpdate{name?:string;currency_code?:string;starts_at?:string;expires_at?:string;total_usage_limit?:number;fixed_amount_cents?: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 FixedPricePromotions extends ApiResource{static readonly TYPE:'fixed_price_promotions';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<FixedPricePromotion>>;create(resource:FixedPricePromotionCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<FixedPricePromotion>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<FixedPricePromotion>;update(resource:FixedPricePromotionUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<FixedPricePromotion>;delete(id:string,options?:ResourcesConfig):Promise<void>;market(fixedPricePromotionId:string|FixedPricePromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;order_amount_promotion_rule(fixedPricePromotionId:string|FixedPricePromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<OrderAmountPromotionRule>;sku_list_promotion_rule(fixedPricePromotionId:string|FixedPricePromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuListPromotionRule>;coupon_codes_promotion_rule(fixedPricePromotionId:string|FixedPricePromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CouponCodesPromotionRule>;attachments(fixedPricePromotionId:string|FixedPricePromotion,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;sku_list(fixedPricePromotionId:string|FixedPricePromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuList>;skus(fixedPricePromotionId:string|FixedPricePromotion,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Sku>>;isFixedPricePromotion(resource:any):resource is FixedPricePromotion;relationship(id:string|ResourceId|null):FixedPricePromotionRel;type():string;}export default FixedPricePromotions;export{FixedPricePromotion,FixedPricePromotionCreate,FixedPricePromotionUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as i}from"../resource";class o extends i{static TYPE="fixed_price_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"},`fixed_price_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"},`fixed_price_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"},`fixed_price_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"},`fixed_price_promotions/${r}/coupon_codes_promotion_rule`,t,s)}async attachments(e,t,s){const r=e.id||e;return this.resources.fetch({type:"attachments"},`fixed_price_promotions/${r}/attachments`,t,s)}async sku_list(e,t,s){const r=e.id||e;return this.resources.fetch({type:"sku_lists"},`fixed_price_promotions/${r}/sku_list`,t,s)}async skus(e,t,s){const r=e.id||e;return this.resources.fetch({type:"skus"},`fixed_price_promotions/${r}/skus`,t,s)}isFixedPricePromotion(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,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 FreeGiftPromotionRel = ResourceRel & {
|
12
|
-
type: typeof FreeGiftPromotions.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 FreeGiftPromotion 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
|
-
max_quantity?: 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 FreeGiftPromotionCreate extends ResourceCreate {
|
51
|
-
name: string;
|
52
|
-
currency_code?: string;
|
53
|
-
starts_at: string;
|
54
|
-
expires_at: string;
|
55
|
-
total_usage_limit: number;
|
56
|
-
max_quantity?: 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 FreeGiftPromotionUpdate extends ResourceUpdate {
|
65
|
-
name?: string;
|
66
|
-
currency_code?: string;
|
67
|
-
starts_at?: string;
|
68
|
-
expires_at?: string;
|
69
|
-
total_usage_limit?: number;
|
70
|
-
max_quantity?: 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 FreeGiftPromotions extends ApiResource {
|
79
|
-
static readonly TYPE: 'free_gift_promotions';
|
80
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<FreeGiftPromotion>>;
|
81
|
-
create(resource: FreeGiftPromotionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FreeGiftPromotion>;
|
82
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FreeGiftPromotion>;
|
83
|
-
update(resource: FreeGiftPromotionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FreeGiftPromotion>;
|
84
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
85
|
-
market(freeGiftPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
86
|
-
order_amount_promotion_rule(freeGiftPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
87
|
-
sku_list_promotion_rule(freeGiftPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
88
|
-
coupon_codes_promotion_rule(freeGiftPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
89
|
-
attachments(freeGiftPromotionId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
90
|
-
sku_list(freeGiftPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
91
|
-
skus(freeGiftPromotionId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
92
|
-
isFreeGiftPromotion(resource: any): resource is FreeGiftPromotion;
|
93
|
-
relationship(id: string | ResourceId | null): FreeGiftPromotionRel;
|
94
|
-
type(): string;
|
95
|
-
}
|
96
|
-
export default FreeGiftPromotions;
|
97
|
-
export { FreeGiftPromotion, FreeGiftPromotionCreate, FreeGiftPromotionUpdate };
|
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 FreeGiftPromotionRel=ResourceRel&{type:typeof FreeGiftPromotions.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 FreeGiftPromotion extends Resource{name?:string;currency_code?:string;starts_at?:string;expires_at?:string;total_usage_limit?:number;total_usage_count?:number;active?:boolean;max_quantity?: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 FreeGiftPromotionCreate extends ResourceCreate{name:string;currency_code?:string;starts_at:string;expires_at:string;total_usage_limit:number;max_quantity?: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 FreeGiftPromotionUpdate extends ResourceUpdate{name?:string;currency_code?:string;starts_at?:string;expires_at?:string;total_usage_limit?:number;max_quantity?: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 FreeGiftPromotions extends ApiResource{static readonly TYPE:'free_gift_promotions';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<FreeGiftPromotion>>;create(resource:FreeGiftPromotionCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<FreeGiftPromotion>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<FreeGiftPromotion>;update(resource:FreeGiftPromotionUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<FreeGiftPromotion>;delete(id:string,options?:ResourcesConfig):Promise<void>;market(freeGiftPromotionId:string|FreeGiftPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;order_amount_promotion_rule(freeGiftPromotionId:string|FreeGiftPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<OrderAmountPromotionRule>;sku_list_promotion_rule(freeGiftPromotionId:string|FreeGiftPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuListPromotionRule>;coupon_codes_promotion_rule(freeGiftPromotionId:string|FreeGiftPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CouponCodesPromotionRule>;attachments(freeGiftPromotionId:string|FreeGiftPromotion,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;sku_list(freeGiftPromotionId:string|FreeGiftPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuList>;skus(freeGiftPromotionId:string|FreeGiftPromotion,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Sku>>;isFreeGiftPromotion(resource:any):resource is FreeGiftPromotion;relationship(id:string|ResourceId|null):FreeGiftPromotionRel;type():string;}export default FreeGiftPromotions;export{FreeGiftPromotion,FreeGiftPromotionCreate,FreeGiftPromotionUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as i}from"../resource";class o extends i{static TYPE="free_gift_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"},`free_gift_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"},`free_gift_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"},`free_gift_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"},`free_gift_promotions/${r}/coupon_codes_promotion_rule`,t,s)}async attachments(e,t,s){const r=e.id||e;return this.resources.fetch({type:"attachments"},`free_gift_promotions/${r}/attachments`,t,s)}async sku_list(e,t,s){const r=e.id||e;return this.resources.fetch({type:"sku_lists"},`free_gift_promotions/${r}/sku_list`,t,s)}async skus(e,t,s){const r=e.id||e;return this.resources.fetch({type:"skus"},`free_gift_promotions/${r}/skus`,t,s)}isFreeGiftPromotion(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,83 +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 FreeShippingPromotionRel = ResourceRel & {
|
10
|
-
type: typeof FreeShippingPromotions.TYPE;
|
11
|
-
};
|
12
|
-
declare type MarketRel = ResourceRel & {
|
13
|
-
type: 'markets';
|
14
|
-
};
|
15
|
-
declare type PromotionRuleRel = ResourceRel & {
|
16
|
-
type: 'promotion_rules';
|
17
|
-
};
|
18
|
-
declare type OrderAmountPromotionRuleRel = ResourceRel & {
|
19
|
-
type: 'order_amount_promotion_rules';
|
20
|
-
};
|
21
|
-
declare type SkuListPromotionRuleRel = ResourceRel & {
|
22
|
-
type: 'sku_list_promotion_rules';
|
23
|
-
};
|
24
|
-
declare type CouponCodesPromotionRuleRel = ResourceRel & {
|
25
|
-
type: 'coupon_codes_promotion_rules';
|
26
|
-
};
|
27
|
-
interface FreeShippingPromotion extends Resource {
|
28
|
-
name?: string;
|
29
|
-
currency_code?: string;
|
30
|
-
starts_at?: string;
|
31
|
-
expires_at?: string;
|
32
|
-
total_usage_limit?: number;
|
33
|
-
total_usage_count?: number;
|
34
|
-
active?: boolean;
|
35
|
-
market?: Market;
|
36
|
-
promotion_rules?: PromotionRule[];
|
37
|
-
order_amount_promotion_rule?: OrderAmountPromotionRule;
|
38
|
-
sku_list_promotion_rule?: SkuListPromotionRule;
|
39
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRule;
|
40
|
-
attachments?: Attachment[];
|
41
|
-
}
|
42
|
-
interface FreeShippingPromotionCreate extends ResourceCreate {
|
43
|
-
name: string;
|
44
|
-
currency_code?: string;
|
45
|
-
starts_at: string;
|
46
|
-
expires_at: string;
|
47
|
-
total_usage_limit: number;
|
48
|
-
market?: MarketRel;
|
49
|
-
promotion_rules?: PromotionRuleRel[];
|
50
|
-
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
51
|
-
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
52
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
53
|
-
}
|
54
|
-
interface FreeShippingPromotionUpdate extends ResourceUpdate {
|
55
|
-
name?: string;
|
56
|
-
currency_code?: string;
|
57
|
-
starts_at?: string;
|
58
|
-
expires_at?: string;
|
59
|
-
total_usage_limit?: number;
|
60
|
-
market?: MarketRel;
|
61
|
-
promotion_rules?: PromotionRuleRel[];
|
62
|
-
order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
|
63
|
-
sku_list_promotion_rule?: SkuListPromotionRuleRel;
|
64
|
-
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
|
65
|
-
}
|
66
|
-
declare class FreeShippingPromotions extends ApiResource {
|
67
|
-
static readonly TYPE: 'free_shipping_promotions';
|
68
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<FreeShippingPromotion>>;
|
69
|
-
create(resource: FreeShippingPromotionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FreeShippingPromotion>;
|
70
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FreeShippingPromotion>;
|
71
|
-
update(resource: FreeShippingPromotionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<FreeShippingPromotion>;
|
72
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
73
|
-
market(freeShippingPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
74
|
-
order_amount_promotion_rule(freeShippingPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
|
75
|
-
sku_list_promotion_rule(freeShippingPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
76
|
-
coupon_codes_promotion_rule(freeShippingPromotionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
77
|
-
attachments(freeShippingPromotionId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
78
|
-
isFreeShippingPromotion(resource: any): resource is FreeShippingPromotion;
|
79
|
-
relationship(id: string | ResourceId | null): FreeShippingPromotionRel;
|
80
|
-
type(): string;
|
81
|
-
}
|
82
|
-
export default FreeShippingPromotions;
|
83
|
-
export { FreeShippingPromotion, FreeShippingPromotionCreate, FreeShippingPromotionUpdate };
|
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';declare type FreeShippingPromotionRel=ResourceRel&{type:typeof FreeShippingPromotions.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';};interface FreeShippingPromotion 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[];}interface FreeShippingPromotionCreate extends ResourceCreate{name:string;currency_code?:string;starts_at:string;expires_at:string;total_usage_limit:number;market?:MarketRel;promotion_rules?:PromotionRuleRel[];order_amount_promotion_rule?:OrderAmountPromotionRuleRel;sku_list_promotion_rule?:SkuListPromotionRuleRel;coupon_codes_promotion_rule?:CouponCodesPromotionRuleRel;}interface FreeShippingPromotionUpdate extends ResourceUpdate{name?:string;currency_code?:string;starts_at?:string;expires_at?:string;total_usage_limit?:number;market?:MarketRel;promotion_rules?:PromotionRuleRel[];order_amount_promotion_rule?:OrderAmountPromotionRuleRel;sku_list_promotion_rule?:SkuListPromotionRuleRel;coupon_codes_promotion_rule?:CouponCodesPromotionRuleRel;}declare class FreeShippingPromotions extends ApiResource{static readonly TYPE:'free_shipping_promotions';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<FreeShippingPromotion>>;create(resource:FreeShippingPromotionCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<FreeShippingPromotion>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<FreeShippingPromotion>;update(resource:FreeShippingPromotionUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<FreeShippingPromotion>;delete(id:string,options?:ResourcesConfig):Promise<void>;market(freeShippingPromotionId:string|FreeShippingPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;order_amount_promotion_rule(freeShippingPromotionId:string|FreeShippingPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<OrderAmountPromotionRule>;sku_list_promotion_rule(freeShippingPromotionId:string|FreeShippingPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuListPromotionRule>;coupon_codes_promotion_rule(freeShippingPromotionId:string|FreeShippingPromotion,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CouponCodesPromotionRule>;attachments(freeShippingPromotionId:string|FreeShippingPromotion,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isFreeShippingPromotion(resource:any):resource is FreeShippingPromotion;relationship(id:string|ResourceId|null):FreeShippingPromotionRel;type():string;}export default FreeShippingPromotions;export{FreeShippingPromotion,FreeShippingPromotionCreate,FreeShippingPromotionUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as i}from"../resource";class s extends i{static TYPE="free_shipping_promotions";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 o=e.id||e;return this.resources.fetch({type:"markets"},`free_shipping_promotions/${o}/market`,t,r)}async order_amount_promotion_rule(e,t,r){const o=e.id||e;return this.resources.fetch({type:"order_amount_promotion_rules"},`free_shipping_promotions/${o}/order_amount_promotion_rule`,t,r)}async sku_list_promotion_rule(e,t,r){const o=e.id||e;return this.resources.fetch({type:"sku_list_promotion_rules"},`free_shipping_promotions/${o}/sku_list_promotion_rule`,t,r)}async coupon_codes_promotion_rule(e,t,r){const o=e.id||e;return this.resources.fetch({type:"coupon_codes_promotion_rules"},`free_shipping_promotions/${o}/coupon_codes_promotion_rule`,t,r)}async attachments(e,t,r){const o=e.id||e;return this.resources.fetch({type:"attachments"},`free_shipping_promotions/${o}/attachments`,t,r)}isFreeShippingPromotion(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;
|