@commercelayer/sdk 5.0.0-alpha.2 → 5.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -33
- package/lib/api.d.ts +1 -103
- package/lib/client.d.ts +1 -31
- package/lib/client.js +1 -1
- package/lib/commercelayer.d.ts +1 -122
- package/lib/commercelayer.js +1 -1
- package/lib/common.d.ts +1 -4
- package/lib/config.d.ts +1 -11
- package/lib/debug.d.ts +1 -3
- package/lib/debug.js +1 -1
- package/lib/error.d.ts +1 -26
- package/lib/error.js +1 -1
- package/lib/index.d.ts +1 -7
- package/lib/interceptor.d.ts +1 -19
- package/lib/jsonapi.d.ts +1 -5
- package/lib/jsonapi.js +1 -1
- package/lib/model.d.ts +1 -101
- package/lib/query.d.ts +1 -23
- package/lib/query.js +1 -1
- package/lib/resource.d.ts +1 -76
- package/lib/resource.js +1 -1
- package/lib/resources/addresses.d.ts +1 -88
- package/lib/resources/addresses.js +1 -1
- package/lib/resources/adjustments.d.ts +1 -35
- package/lib/resources/adjustments.js +1 -1
- package/lib/resources/adyen_gateways.d.ts +1 -47
- package/lib/resources/adyen_gateways.js +1 -1
- package/lib/resources/adyen_payments.d.ts +1 -44
- package/lib/resources/adyen_payments.js +1 -1
- package/lib/resources/application.d.ts +1 -21
- package/lib/resources/application.js +1 -1
- package/lib/resources/attachments.d.ts +1 -156
- package/lib/resources/attachments.js +1 -1
- package/lib/resources/authorizations.d.ts +1 -57
- package/lib/resources/authorizations.js +1 -1
- package/lib/resources/avalara_accounts.d.ts +1 -52
- package/lib/resources/avalara_accounts.js +1 -1
- package/lib/resources/billing_info_validation_rules.d.ts +1 -32
- package/lib/resources/billing_info_validation_rules.js +1 -1
- package/lib/resources/bing_geocoders.d.ts +1 -35
- package/lib/resources/bing_geocoders.js +1 -1
- package/lib/resources/braintree_gateways.d.ts +1 -56
- package/lib/resources/braintree_gateways.js +1 -1
- package/lib/resources/braintree_payments.d.ts +1 -47
- package/lib/resources/braintree_payments.js +1 -1
- package/lib/resources/bundles.d.ts +1 -74
- package/lib/resources/bundles.js +1 -1
- package/lib/resources/captures.d.ts +1 -48
- package/lib/resources/captures.js +1 -1
- package/lib/resources/carrier_accounts.d.ts +1 -26
- package/lib/resources/carrier_accounts.js +1 -1
- package/lib/resources/checkout_com_gateways.d.ts +1 -45
- package/lib/resources/checkout_com_gateways.js +1 -1
- package/lib/resources/checkout_com_payments.d.ts +1 -50
- package/lib/resources/checkout_com_payments.js +1 -1
- package/lib/resources/coupon_codes_promotion_rules.d.ts +1 -59
- package/lib/resources/coupon_codes_promotion_rules.js +1 -1
- package/lib/resources/coupon_recipients.d.ts +1 -44
- package/lib/resources/coupon_recipients.js +1 -1
- package/lib/resources/coupons.d.ts +1 -45
- package/lib/resources/coupons.js +1 -1
- package/lib/resources/customer_addresses.d.ts +1 -41
- package/lib/resources/customer_addresses.js +1 -1
- package/lib/resources/customer_groups.d.ts +1 -36
- package/lib/resources/customer_groups.js +1 -1
- package/lib/resources/customer_password_resets.d.ts +1 -33
- package/lib/resources/customer_password_resets.js +1 -1
- package/lib/resources/customer_payment_sources.d.ts +1 -70
- package/lib/resources/customer_payment_sources.js +1 -1
- package/lib/resources/customer_subscriptions.d.ts +1 -28
- package/lib/resources/customer_subscriptions.js +1 -1
- package/lib/resources/customers.d.ts +1 -60
- package/lib/resources/customers.js +1 -1
- package/lib/resources/delivery_lead_times.d.ts +1 -51
- package/lib/resources/delivery_lead_times.js +1 -1
- package/lib/resources/event_callbacks.d.ts +1 -24
- package/lib/resources/event_callbacks.js +1 -1
- package/lib/resources/external_gateways.d.ts +1 -49
- package/lib/resources/external_gateways.js +1 -1
- package/lib/resources/external_payments.d.ts +1 -43
- package/lib/resources/external_payments.js +1 -1
- package/lib/resources/external_promotions.d.ts +1 -86
- package/lib/resources/external_promotions.js +1 -1
- package/lib/resources/external_tax_calculators.d.ts +1 -44
- package/lib/resources/external_tax_calculators.js +1 -1
- package/lib/resources/fixed_amount_promotions.d.ts +1 -88
- package/lib/resources/fixed_amount_promotions.js +1 -1
- package/lib/resources/fixed_price_promotions.d.ts +1 -99
- package/lib/resources/fixed_price_promotions.js +1 -1
- package/lib/resources/free_gift_promotions.d.ts +1 -97
- package/lib/resources/free_gift_promotions.js +1 -1
- package/lib/resources/free_shipping_promotions.d.ts +1 -83
- package/lib/resources/free_shipping_promotions.js +1 -1
- package/lib/resources/geocoders.d.ts +1 -24
- package/lib/resources/geocoders.js +1 -1
- package/lib/resources/gift_card_recipients.d.ts +1 -44
- package/lib/resources/gift_card_recipients.js +1 -1
- package/lib/resources/gift_cards.d.ts +1 -82
- package/lib/resources/gift_cards.js +1 -1
- package/lib/resources/google_geocoders.d.ts +1 -35
- package/lib/resources/google_geocoders.js +1 -1
- package/lib/resources/imports.d.ts +1 -40
- package/lib/resources/imports.js +1 -1
- package/lib/resources/in_stock_subscriptions.d.ts +1 -59
- package/lib/resources/in_stock_subscriptions.js +1 -1
- package/lib/resources/inventory_models.d.ts +1 -42
- package/lib/resources/inventory_models.js +1 -1
- package/lib/resources/inventory_return_locations.d.ts +1 -43
- package/lib/resources/inventory_return_locations.js +1 -1
- package/lib/resources/inventory_stock_locations.d.ts +1 -46
- package/lib/resources/inventory_stock_locations.js +1 -1
- package/lib/resources/klarna_gateways.d.ts +1 -44
- package/lib/resources/klarna_gateways.js +1 -1
- package/lib/resources/klarna_payments.d.ts +1 -41
- package/lib/resources/klarna_payments.js +1 -1
- package/lib/resources/line_item_options.d.ts +1 -57
- package/lib/resources/line_item_options.js +1 -1
- package/lib/resources/line_items.d.ts +1 -125
- package/lib/resources/line_items.js +1 -1
- package/lib/resources/manual_gateways.d.ts +1 -33
- package/lib/resources/manual_gateways.js +1 -1
- package/lib/resources/manual_tax_calculators.d.ts +1 -49
- package/lib/resources/manual_tax_calculators.js +1 -1
- package/lib/resources/markets.d.ts +1 -81
- package/lib/resources/markets.js +1 -1
- package/lib/resources/merchants.d.ts +1 -38
- package/lib/resources/merchants.js +1 -1
- package/lib/resources/order_amount_promotion_rules.d.ts +1 -56
- package/lib/resources/order_amount_promotion_rules.js +1 -1
- package/lib/resources/order_copies.d.ts +1 -45
- package/lib/resources/order_copies.js +1 -1
- package/lib/resources/order_subscriptions.d.ts +1 -67
- package/lib/resources/order_subscriptions.js +1 -1
- package/lib/resources/order_validation_rules.d.ts +1 -20
- package/lib/resources/order_validation_rules.js +1 -1
- package/lib/resources/orders.d.ts +1 -271
- package/lib/resources/orders.js +1 -1
- package/lib/resources/organization.d.ts +1 -32
- package/lib/resources/organization.js +1 -1
- package/lib/resources/packages.d.ts +1 -56
- package/lib/resources/packages.js +1 -1
- package/lib/resources/parcel_line_items.d.ts +1 -49
- package/lib/resources/parcel_line_items.js +1 -1
- package/lib/resources/parcels.d.ts +1 -108
- package/lib/resources/parcels.js +1 -1
- package/lib/resources/payment_gateways.d.ts +1 -21
- package/lib/resources/payment_gateways.js +1 -1
- package/lib/resources/payment_methods.d.ts +1 -59
- package/lib/resources/payment_methods.js +1 -1
- package/lib/resources/paypal_gateways.d.ts +1 -39
- package/lib/resources/paypal_gateways.js +1 -1
- package/lib/resources/paypal_payments.d.ts +1 -47
- package/lib/resources/paypal_payments.js +1 -1
- package/lib/resources/percentage_discount_promotions.d.ts +1 -97
- package/lib/resources/percentage_discount_promotions.js +1 -1
- package/lib/resources/price_lists.d.ts +1 -39
- package/lib/resources/price_lists.js +1 -1
- package/lib/resources/prices.d.ts +1 -57
- package/lib/resources/prices.js +1 -1
- package/lib/resources/promotion_rules.d.ts +1 -24
- package/lib/resources/promotion_rules.js +1 -1
- package/lib/resources/promotions.d.ts +1 -41
- package/lib/resources/promotions.js +1 -1
- package/lib/resources/refunds.d.ts +1 -34
- package/lib/resources/refunds.js +1 -1
- package/lib/resources/return_line_items.d.ts +1 -49
- package/lib/resources/return_line_items.js +1 -1
- package/lib/resources/returns.d.ts +1 -72
- package/lib/resources/returns.js +1 -1
- package/lib/resources/shipments.d.ts +1 -89
- package/lib/resources/shipments.js +1 -1
- package/lib/resources/shipping_categories.d.ts +1 -33
- package/lib/resources/shipping_categories.js +1 -1
- package/lib/resources/shipping_methods.d.ts +1 -74
- package/lib/resources/shipping_methods.js +1 -1
- package/lib/resources/shipping_zones.d.ts +1 -48
- package/lib/resources/shipping_zones.js +1 -1
- package/lib/resources/sku_list_items.d.ts +1 -47
- package/lib/resources/sku_list_items.js +1 -1
- package/lib/resources/sku_list_promotion_rules.d.ts +1 -68
- package/lib/resources/sku_list_promotion_rules.js +1 -1
- package/lib/resources/sku_lists.d.ts +1 -49
- package/lib/resources/sku_lists.js +1 -1
- package/lib/resources/sku_options.d.ts +1 -56
- package/lib/resources/sku_options.js +1 -1
- package/lib/resources/skus.d.ts +1 -78
- package/lib/resources/skus.js +1 -1
- package/lib/resources/stock_items.d.ts +1 -49
- package/lib/resources/stock_items.js +1 -1
- package/lib/resources/stock_line_items.d.ts +1 -29
- package/lib/resources/stock_line_items.js +1 -1
- package/lib/resources/stock_locations.d.ts +1 -57
- package/lib/resources/stock_locations.js +1 -1
- package/lib/resources/stock_transfers.d.ts +1 -71
- package/lib/resources/stock_transfers.js +1 -1
- package/lib/resources/stripe_gateways.d.ts +1 -38
- package/lib/resources/stripe_gateways.js +1 -1
- package/lib/resources/stripe_payments.d.ts +1 -42
- package/lib/resources/stripe_payments.js +1 -1
- package/lib/resources/tax_calculators.d.ts +1 -27
- package/lib/resources/tax_calculators.js +1 -1
- package/lib/resources/tax_categories.d.ts +1 -59
- package/lib/resources/tax_categories.js +1 -1
- package/lib/resources/tax_rules.d.ts +1 -69
- package/lib/resources/tax_rules.js +1 -1
- package/lib/resources/taxjar_accounts.d.ts +1 -43
- package/lib/resources/taxjar_accounts.js +1 -1
- package/lib/resources/transactions.d.ts +1 -31
- package/lib/resources/transactions.js +1 -1
- package/lib/resources/voids.d.ts +1 -34
- package/lib/resources/voids.js +1 -1
- package/lib/resources/webhooks.d.ts +1 -42
- package/lib/resources/webhooks.js +1 -1
- package/lib/resources/wire_transfers.d.ts +1 -32
- package/lib/resources/wire_transfers.js +1 -1
- package/lib/static.d.ts +1 -6
- package/lib/static.js +1 -1
- package/lib/util.d.ts +1 -2
- package/package.json +25 -28
@@ -1,48 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Attachment } from './attachments';
|
4
|
-
declare type ShippingZoneRel = ResourceRel & {
|
5
|
-
type: typeof ShippingZones.TYPE;
|
6
|
-
};
|
7
|
-
interface ShippingZone extends Resource {
|
8
|
-
name?: string;
|
9
|
-
country_code_regex?: string;
|
10
|
-
not_country_code_regex?: string;
|
11
|
-
state_code_regex?: string;
|
12
|
-
not_state_code_regex?: string;
|
13
|
-
zip_code_regex?: string;
|
14
|
-
not_zip_code_regex?: string;
|
15
|
-
attachments?: Attachment[];
|
16
|
-
}
|
17
|
-
interface ShippingZoneCreate extends ResourceCreate {
|
18
|
-
name: string;
|
19
|
-
country_code_regex?: string;
|
20
|
-
not_country_code_regex?: string;
|
21
|
-
state_code_regex?: string;
|
22
|
-
not_state_code_regex?: string;
|
23
|
-
zip_code_regex?: string;
|
24
|
-
not_zip_code_regex?: string;
|
25
|
-
}
|
26
|
-
interface ShippingZoneUpdate extends ResourceUpdate {
|
27
|
-
name?: string;
|
28
|
-
country_code_regex?: string;
|
29
|
-
not_country_code_regex?: string;
|
30
|
-
state_code_regex?: string;
|
31
|
-
not_state_code_regex?: string;
|
32
|
-
zip_code_regex?: string;
|
33
|
-
not_zip_code_regex?: string;
|
34
|
-
}
|
35
|
-
declare class ShippingZones extends ApiResource {
|
36
|
-
static readonly TYPE: 'shipping_zones';
|
37
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingZone>>;
|
38
|
-
create(resource: ShippingZoneCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingZone>;
|
39
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingZone>;
|
40
|
-
update(resource: ShippingZoneUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingZone>;
|
41
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
42
|
-
attachments(shippingZoneId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
43
|
-
isShippingZone(resource: any): resource is ShippingZone;
|
44
|
-
relationship(id: string | ResourceId | null): ShippingZoneRel;
|
45
|
-
type(): string;
|
46
|
-
}
|
47
|
-
export default ShippingZones;
|
48
|
-
export { ShippingZone, ShippingZoneCreate, ShippingZoneUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Attachment}from'./attachments';declare type ShippingZoneRel=ResourceRel&{type:typeof ShippingZones.TYPE;};interface ShippingZone extends Resource{name?:string;country_code_regex?:string;not_country_code_regex?:string;state_code_regex?:string;not_state_code_regex?:string;zip_code_regex?:string;not_zip_code_regex?:string;attachments?:Attachment[];}interface ShippingZoneCreate extends ResourceCreate{name:string;country_code_regex?:string;not_country_code_regex?:string;state_code_regex?:string;not_state_code_regex?:string;zip_code_regex?:string;not_zip_code_regex?:string;}interface ShippingZoneUpdate extends ResourceUpdate{name?:string;country_code_regex?:string;not_country_code_regex?:string;state_code_regex?:string;not_state_code_regex?:string;zip_code_regex?:string;not_zip_code_regex?:string;}declare class ShippingZones extends ApiResource{static readonly TYPE:'shipping_zones';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ShippingZone>>;create(resource:ShippingZoneCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ShippingZone>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ShippingZone>;update(resource:ShippingZoneUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ShippingZone>;delete(id:string,options?:ResourcesConfig):Promise<void>;attachments(shippingZoneId:string|ShippingZone,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isShippingZone(resource:any):resource is ShippingZone;relationship(id:string|ResourceId|null):ShippingZoneRel;type():string;}export default ShippingZones;export{ShippingZone,ShippingZoneCreate,ShippingZoneUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class r extends n{static TYPE="shipping_zones";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 attachments(e,t,s){const i=e.id||e;return this.resources.fetch({type:"attachments"},`shipping_zones/${i}/attachments`,t,s)}isShippingZone(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,47 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { SkuList } from './sku_lists';
|
4
|
-
import { Sku } from './skus';
|
5
|
-
declare type SkuListItemRel = ResourceRel & {
|
6
|
-
type: typeof SkuListItems.TYPE;
|
7
|
-
};
|
8
|
-
declare type SkuListRel = ResourceRel & {
|
9
|
-
type: 'sku_lists';
|
10
|
-
};
|
11
|
-
declare type SkuRel = ResourceRel & {
|
12
|
-
type: 'skus';
|
13
|
-
};
|
14
|
-
interface SkuListItem extends Resource {
|
15
|
-
position?: number;
|
16
|
-
sku_code?: string;
|
17
|
-
quantity?: number;
|
18
|
-
sku_list?: SkuList;
|
19
|
-
sku?: Sku;
|
20
|
-
}
|
21
|
-
interface SkuListItemCreate extends ResourceCreate {
|
22
|
-
position?: number;
|
23
|
-
sku_code?: string;
|
24
|
-
quantity?: number;
|
25
|
-
sku_list: SkuListRel;
|
26
|
-
sku: SkuRel;
|
27
|
-
}
|
28
|
-
interface SkuListItemUpdate extends ResourceUpdate {
|
29
|
-
position?: number;
|
30
|
-
sku_code?: string;
|
31
|
-
quantity?: number;
|
32
|
-
}
|
33
|
-
declare class SkuListItems extends ApiResource {
|
34
|
-
static readonly TYPE: 'sku_list_items';
|
35
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuListItem>>;
|
36
|
-
create(resource: SkuListItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListItem>;
|
37
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListItem>;
|
38
|
-
update(resource: SkuListItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListItem>;
|
39
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
40
|
-
sku_list(skuListItemId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
41
|
-
sku(skuListItemId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
42
|
-
isSkuListItem(resource: any): resource is SkuListItem;
|
43
|
-
relationship(id: string | ResourceId | null): SkuListItemRel;
|
44
|
-
type(): string;
|
45
|
-
}
|
46
|
-
export default SkuListItems;
|
47
|
-
export { SkuListItem, SkuListItemCreate, SkuListItemUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{SkuList}from'./sku_lists';import type{Sku}from'./skus';declare type SkuListItemRel=ResourceRel&{type:typeof SkuListItems.TYPE;};declare type SkuListRel=ResourceRel&{type:'sku_lists';};declare type SkuRel=ResourceRel&{type:'skus';};interface SkuListItem extends Resource{position?:number;sku_code?:string;quantity?:number;sku_list?:SkuList;sku?:Sku;}interface SkuListItemCreate extends ResourceCreate{position?:number;sku_code?:string;quantity?:number;sku_list:SkuListRel;sku:SkuRel;}interface SkuListItemUpdate extends ResourceUpdate{position?:number;sku_code?:string;quantity?:number;}declare class SkuListItems extends ApiResource{static readonly TYPE:'sku_list_items';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<SkuListItem>>;create(resource:SkuListItemCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuListItem>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuListItem>;update(resource:SkuListItemUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuListItem>;delete(id:string,options?:ResourcesConfig):Promise<void>;sku_list(skuListItemId:string|SkuListItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuList>;sku(skuListItemId:string|SkuListItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Sku>;isSkuListItem(resource:any):resource is SkuListItem;relationship(id:string|ResourceId|null):SkuListItemRel;type():string;}export default SkuListItems;export{SkuListItem,SkuListItemCreate,SkuListItemUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as u}from"../resource";class s extends u{static TYPE="sku_list_items";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 sku_list(e,t,r){const i=e.id||e;return this.resources.fetch({type:"sku_lists"},`sku_list_items/${i}/sku_list`,t,r)}async sku(e,t,r){const i=e.id||e;return this.resources.fetch({type:"skus"},`sku_list_items/${i}/sku`,t,r)}isSkuListItem(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,68 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { PercentageDiscountPromotion } from './percentage_discount_promotions';
|
4
|
-
import { FreeShippingPromotion } from './free_shipping_promotions';
|
5
|
-
import { FixedAmountPromotion } from './fixed_amount_promotions';
|
6
|
-
import { FreeGiftPromotion } from './free_gift_promotions';
|
7
|
-
import { FixedPricePromotion } from './fixed_price_promotions';
|
8
|
-
import { ExternalPromotion } from './external_promotions';
|
9
|
-
import { SkuList } from './sku_lists';
|
10
|
-
import { Sku } from './skus';
|
11
|
-
declare type SkuListPromotionRuleRel = ResourceRel & {
|
12
|
-
type: typeof SkuListPromotionRules.TYPE;
|
13
|
-
};
|
14
|
-
declare type PercentageDiscountPromotionRel = ResourceRel & {
|
15
|
-
type: 'percentage_discount_promotions';
|
16
|
-
};
|
17
|
-
declare type FreeShippingPromotionRel = ResourceRel & {
|
18
|
-
type: 'free_shipping_promotions';
|
19
|
-
};
|
20
|
-
declare type FixedAmountPromotionRel = ResourceRel & {
|
21
|
-
type: 'fixed_amount_promotions';
|
22
|
-
};
|
23
|
-
declare type FreeGiftPromotionRel = ResourceRel & {
|
24
|
-
type: 'free_gift_promotions';
|
25
|
-
};
|
26
|
-
declare type FixedPricePromotionRel = ResourceRel & {
|
27
|
-
type: 'fixed_price_promotions';
|
28
|
-
};
|
29
|
-
declare type ExternalPromotionRel = ResourceRel & {
|
30
|
-
type: 'external_promotions';
|
31
|
-
};
|
32
|
-
declare type SkuListRel = ResourceRel & {
|
33
|
-
type: 'sku_lists';
|
34
|
-
};
|
35
|
-
interface SkuListPromotionRule extends Resource {
|
36
|
-
all_skus?: boolean;
|
37
|
-
min_quantity?: number;
|
38
|
-
promotion?: PercentageDiscountPromotion | FreeShippingPromotion | FixedAmountPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion;
|
39
|
-
sku_list?: SkuList;
|
40
|
-
skus?: Sku[];
|
41
|
-
}
|
42
|
-
interface SkuListPromotionRuleCreate extends ResourceCreate {
|
43
|
-
all_skus?: boolean;
|
44
|
-
min_quantity?: number;
|
45
|
-
promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FixedAmountPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel;
|
46
|
-
sku_list?: SkuListRel;
|
47
|
-
}
|
48
|
-
interface SkuListPromotionRuleUpdate extends ResourceUpdate {
|
49
|
-
all_skus?: boolean;
|
50
|
-
min_quantity?: number;
|
51
|
-
promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FixedAmountPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel;
|
52
|
-
sku_list?: SkuListRel;
|
53
|
-
}
|
54
|
-
declare class SkuListPromotionRules extends ApiResource {
|
55
|
-
static readonly TYPE: 'sku_list_promotion_rules';
|
56
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuListPromotionRule>>;
|
57
|
-
create(resource: SkuListPromotionRuleCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
58
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
59
|
-
update(resource: SkuListPromotionRuleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
60
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
61
|
-
sku_list(skuListPromotionRuleId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
62
|
-
skus(skuListPromotionRuleId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
63
|
-
isSkuListPromotionRule(resource: any): resource is SkuListPromotionRule;
|
64
|
-
relationship(id: string | ResourceId | null): SkuListPromotionRuleRel;
|
65
|
-
type(): string;
|
66
|
-
}
|
67
|
-
export default SkuListPromotionRules;
|
68
|
-
export { SkuListPromotionRule, SkuListPromotionRuleCreate, SkuListPromotionRuleUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{PercentageDiscountPromotion}from'./percentage_discount_promotions';import type{FreeShippingPromotion}from'./free_shipping_promotions';import type{FixedAmountPromotion}from'./fixed_amount_promotions';import type{FreeGiftPromotion}from'./free_gift_promotions';import type{FixedPricePromotion}from'./fixed_price_promotions';import type{ExternalPromotion}from'./external_promotions';import type{SkuList}from'./sku_lists';import type{Sku}from'./skus';declare type SkuListPromotionRuleRel=ResourceRel&{type:typeof SkuListPromotionRules.TYPE;};declare type PercentageDiscountPromotionRel=ResourceRel&{type:'percentage_discount_promotions';};declare type FreeShippingPromotionRel=ResourceRel&{type:'free_shipping_promotions';};declare type FixedAmountPromotionRel=ResourceRel&{type:'fixed_amount_promotions';};declare type FreeGiftPromotionRel=ResourceRel&{type:'free_gift_promotions';};declare type FixedPricePromotionRel=ResourceRel&{type:'fixed_price_promotions';};declare type ExternalPromotionRel=ResourceRel&{type:'external_promotions';};declare type SkuListRel=ResourceRel&{type:'sku_lists';};interface SkuListPromotionRule extends Resource{all_skus?:boolean;min_quantity?:number;promotion?:PercentageDiscountPromotion|FreeShippingPromotion|FixedAmountPromotion|FreeGiftPromotion|FixedPricePromotion|ExternalPromotion;sku_list?:SkuList;skus?:Sku[];}interface SkuListPromotionRuleCreate extends ResourceCreate{all_skus?:boolean;min_quantity?:number;promotion:PercentageDiscountPromotionRel|FreeShippingPromotionRel|FixedAmountPromotionRel|FreeGiftPromotionRel|FixedPricePromotionRel|ExternalPromotionRel;sku_list?:SkuListRel;}interface SkuListPromotionRuleUpdate extends ResourceUpdate{all_skus?:boolean;min_quantity?:number;promotion?:PercentageDiscountPromotionRel|FreeShippingPromotionRel|FixedAmountPromotionRel|FreeGiftPromotionRel|FixedPricePromotionRel|ExternalPromotionRel;sku_list?:SkuListRel;}declare class SkuListPromotionRules extends ApiResource{static readonly TYPE:'sku_list_promotion_rules';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<SkuListPromotionRule>>;create(resource:SkuListPromotionRuleCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuListPromotionRule>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuListPromotionRule>;update(resource:SkuListPromotionRuleUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuListPromotionRule>;delete(id:string,options?:ResourcesConfig):Promise<void>;sku_list(skuListPromotionRuleId:string|SkuListPromotionRule,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuList>;skus(skuListPromotionRuleId:string|SkuListPromotionRule,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Sku>>;isSkuListPromotionRule(resource:any):resource is SkuListPromotionRule;relationship(id:string|ResourceId|null):SkuListPromotionRuleRel;type():string;}export default SkuListPromotionRules;export{SkuListPromotionRule,SkuListPromotionRuleCreate,SkuListPromotionRuleUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as u}from"../resource";class
|
1
|
+
import{ApiResource as u}from"../resource";class s extends u{static TYPE="sku_list_promotion_rules";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 sku_list(e,t,r){const i=e.id||e;return this.resources.fetch({type:"sku_lists"},`sku_list_promotion_rules/${i}/sku_list`,t,r)}async skus(e,t,r){const i=e.id||e;return this.resources.fetch({type:"skus"},`sku_list_promotion_rules/${i}/skus`,t,r)}isSkuListPromotionRule(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,49 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Sku } from './skus';
|
4
|
-
import { SkuListItem } from './sku_list_items';
|
5
|
-
import { Bundle } from './bundles';
|
6
|
-
declare type SkuListRel = ResourceRel & {
|
7
|
-
type: typeof SkuLists.TYPE;
|
8
|
-
};
|
9
|
-
interface SkuList extends Resource {
|
10
|
-
name?: string;
|
11
|
-
slug?: string;
|
12
|
-
description?: string;
|
13
|
-
image_url?: string;
|
14
|
-
manual?: boolean;
|
15
|
-
sku_code_regex?: string;
|
16
|
-
skus?: Sku[];
|
17
|
-
sku_list_items?: SkuListItem[];
|
18
|
-
bundles?: Bundle[];
|
19
|
-
}
|
20
|
-
interface SkuListCreate extends ResourceCreate {
|
21
|
-
name: string;
|
22
|
-
description?: string;
|
23
|
-
image_url?: string;
|
24
|
-
manual?: boolean;
|
25
|
-
sku_code_regex?: string;
|
26
|
-
}
|
27
|
-
interface SkuListUpdate extends ResourceUpdate {
|
28
|
-
name?: string;
|
29
|
-
description?: string;
|
30
|
-
image_url?: string;
|
31
|
-
manual?: boolean;
|
32
|
-
sku_code_regex?: string;
|
33
|
-
}
|
34
|
-
declare class SkuLists extends ApiResource {
|
35
|
-
static readonly TYPE: 'sku_lists';
|
36
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuList>>;
|
37
|
-
create(resource: SkuListCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
38
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
39
|
-
update(resource: SkuListUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
40
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
41
|
-
skus(skuListId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
42
|
-
sku_list_items(skuListId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuListItem>>;
|
43
|
-
bundles(skuListId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Bundle>>;
|
44
|
-
isSkuList(resource: any): resource is SkuList;
|
45
|
-
relationship(id: string | ResourceId | null): SkuListRel;
|
46
|
-
type(): string;
|
47
|
-
}
|
48
|
-
export default SkuLists;
|
49
|
-
export { SkuList, SkuListCreate, SkuListUpdate };
|
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{SkuListItem}from'./sku_list_items';import type{Bundle}from'./bundles';declare type SkuListRel=ResourceRel&{type:typeof SkuLists.TYPE;};interface SkuList extends Resource{name?:string;slug?:string;description?:string;image_url?:string;manual?:boolean;sku_code_regex?:string;skus?:Sku[];sku_list_items?:SkuListItem[];bundles?:Bundle[];}interface SkuListCreate extends ResourceCreate{name:string;description?:string;image_url?:string;manual?:boolean;sku_code_regex?:string;}interface SkuListUpdate extends ResourceUpdate{name?:string;description?:string;image_url?:string;manual?:boolean;sku_code_regex?:string;}declare class SkuLists extends ApiResource{static readonly TYPE:'sku_lists';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<SkuList>>;create(resource:SkuListCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuList>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuList>;update(resource:SkuListUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuList>;delete(id:string,options?:ResourcesConfig):Promise<void>;skus(skuListId:string|SkuList,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Sku>>;sku_list_items(skuListId:string|SkuList,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<SkuListItem>>;bundles(skuListId:string|SkuList,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Bundle>>;isSkuList(resource:any):resource is SkuList;relationship(id:string|ResourceId|null):SkuListRel;type():string;}export default SkuLists;export{SkuList,SkuListCreate,SkuListUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as u}from"../resource";class
|
1
|
+
import{ApiResource as u}from"../resource";class i extends u{static TYPE="sku_lists";async list(e,s){return this.resources.list({type:i.TYPE},e,s)}async create(e,s,t){return this.resources.create({...e,type:i.TYPE},s,t)}async retrieve(e,s,t){return this.resources.retrieve({type:i.TYPE,id:e},s,t)}async update(e,s,t){return this.resources.update({...e,type:i.TYPE},s,t)}async delete(e,s){await this.resources.delete({type:i.TYPE,id:e},s)}async skus(e,s,t){const r=e.id||e;return this.resources.fetch({type:"skus"},`sku_lists/${r}/skus`,s,t)}async sku_list_items(e,s,t){const r=e.id||e;return this.resources.fetch({type:"sku_list_items"},`sku_lists/${r}/sku_list_items`,s,t)}async bundles(e,s,t){const r=e.id||e;return this.resources.fetch({type:"bundles"},`sku_lists/${r}/bundles`,s,t)}isSkuList(e){return e.type&&e.type===i.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:i.TYPE}:{id:e.id,type:i.TYPE}}type(){return i.TYPE}}export default i;
|
@@ -1,56 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Market } from './markets';
|
4
|
-
import { Attachment } from './attachments';
|
5
|
-
declare type SkuOptionRel = ResourceRel & {
|
6
|
-
type: typeof SkuOptions.TYPE;
|
7
|
-
};
|
8
|
-
declare type MarketRel = ResourceRel & {
|
9
|
-
type: 'markets';
|
10
|
-
};
|
11
|
-
interface SkuOption extends Resource {
|
12
|
-
name?: string;
|
13
|
-
currency_code?: string;
|
14
|
-
description?: string;
|
15
|
-
price_amount_cents?: number;
|
16
|
-
price_amount_float?: number;
|
17
|
-
formatted_price_amount?: string;
|
18
|
-
delay_hours?: number;
|
19
|
-
delay_days?: number;
|
20
|
-
sku_code_regex?: string;
|
21
|
-
market?: Market;
|
22
|
-
attachments?: Attachment[];
|
23
|
-
}
|
24
|
-
interface SkuOptionCreate extends ResourceCreate {
|
25
|
-
name: string;
|
26
|
-
currency_code?: string;
|
27
|
-
description?: string;
|
28
|
-
price_amount_cents?: number;
|
29
|
-
delay_hours?: number;
|
30
|
-
sku_code_regex?: string;
|
31
|
-
market: MarketRel;
|
32
|
-
}
|
33
|
-
interface SkuOptionUpdate extends ResourceUpdate {
|
34
|
-
name?: string;
|
35
|
-
currency_code?: string;
|
36
|
-
description?: string;
|
37
|
-
price_amount_cents?: number;
|
38
|
-
delay_hours?: number;
|
39
|
-
sku_code_regex?: string;
|
40
|
-
market?: MarketRel;
|
41
|
-
}
|
42
|
-
declare class SkuOptions extends ApiResource {
|
43
|
-
static readonly TYPE: 'sku_options';
|
44
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuOption>>;
|
45
|
-
create(resource: SkuOptionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuOption>;
|
46
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuOption>;
|
47
|
-
update(resource: SkuOptionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuOption>;
|
48
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
49
|
-
market(skuOptionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
|
50
|
-
attachments(skuOptionId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
51
|
-
isSkuOption(resource: any): resource is SkuOption;
|
52
|
-
relationship(id: string | ResourceId | null): SkuOptionRel;
|
53
|
-
type(): string;
|
54
|
-
}
|
55
|
-
export default SkuOptions;
|
56
|
-
export { SkuOption, SkuOptionCreate, SkuOptionUpdate };
|
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{Attachment}from'./attachments';declare type SkuOptionRel=ResourceRel&{type:typeof SkuOptions.TYPE;};declare type MarketRel=ResourceRel&{type:'markets';};interface SkuOption extends Resource{name?:string;currency_code?:string;description?:string;price_amount_cents?:number;price_amount_float?:number;formatted_price_amount?:string;delay_hours?:number;delay_days?:number;sku_code_regex?:string;market?:Market;attachments?:Attachment[];}interface SkuOptionCreate extends ResourceCreate{name:string;currency_code?:string;description?:string;price_amount_cents?:number;delay_hours?:number;sku_code_regex?:string;market?:MarketRel;}interface SkuOptionUpdate extends ResourceUpdate{name?:string;currency_code?:string;description?:string;price_amount_cents?:number;delay_hours?:number;sku_code_regex?:string;market?:MarketRel;}declare class SkuOptions extends ApiResource{static readonly TYPE:'sku_options';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<SkuOption>>;create(resource:SkuOptionCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuOption>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuOption>;update(resource:SkuOptionUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuOption>;delete(id:string,options?:ResourcesConfig):Promise<void>;market(skuOptionId:string|SkuOption,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;attachments(skuOptionId:string|SkuOption,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isSkuOption(resource:any):resource is SkuOption;relationship(id:string|ResourceId|null):SkuOptionRel;type():string;}export default SkuOptions;export{SkuOption,SkuOptionCreate,SkuOptionUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class r extends n{static TYPE="sku_options";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"},`sku_options/${i}/market`,t,s)}async attachments(e,t,s){const i=e.id||e;return this.resources.fetch({type:"attachments"},`sku_options/${i}/attachments`,t,s)}isSkuOption(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;
|
package/lib/resources/skus.d.ts
CHANGED
@@ -1,78 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { ShippingCategory } from './shipping_categories';
|
4
|
-
import { Price } from './prices';
|
5
|
-
import { StockItem } from './stock_items';
|
6
|
-
import { DeliveryLeadTime } from './delivery_lead_times';
|
7
|
-
import { SkuOption } from './sku_options';
|
8
|
-
import { Attachment } from './attachments';
|
9
|
-
declare type SkuRel = ResourceRel & {
|
10
|
-
type: typeof Skus.TYPE;
|
11
|
-
};
|
12
|
-
declare type ShippingCategoryRel = ResourceRel & {
|
13
|
-
type: 'shipping_categories';
|
14
|
-
};
|
15
|
-
interface Sku extends Resource {
|
16
|
-
code?: string;
|
17
|
-
name?: string;
|
18
|
-
description?: string;
|
19
|
-
image_url?: string;
|
20
|
-
pieces_per_pack?: number;
|
21
|
-
weight?: number;
|
22
|
-
unit_of_weight?: string;
|
23
|
-
hs_tariff_number?: string;
|
24
|
-
do_not_ship?: boolean;
|
25
|
-
do_not_track?: boolean;
|
26
|
-
inventory?: object;
|
27
|
-
shipping_category?: ShippingCategory;
|
28
|
-
prices?: Price[];
|
29
|
-
stock_items?: StockItem[];
|
30
|
-
delivery_lead_times?: DeliveryLeadTime[];
|
31
|
-
sku_options?: SkuOption[];
|
32
|
-
attachments?: Attachment[];
|
33
|
-
}
|
34
|
-
interface SkuCreate extends ResourceCreate {
|
35
|
-
code: string;
|
36
|
-
name: string;
|
37
|
-
description?: string;
|
38
|
-
image_url?: string;
|
39
|
-
pieces_per_pack?: number;
|
40
|
-
weight?: number;
|
41
|
-
unit_of_weight?: string;
|
42
|
-
hs_tariff_number?: string;
|
43
|
-
do_not_ship?: boolean;
|
44
|
-
do_not_track?: boolean;
|
45
|
-
shipping_category: ShippingCategoryRel;
|
46
|
-
}
|
47
|
-
interface SkuUpdate extends ResourceUpdate {
|
48
|
-
code?: string;
|
49
|
-
name?: string;
|
50
|
-
description?: string;
|
51
|
-
image_url?: string;
|
52
|
-
pieces_per_pack?: number;
|
53
|
-
weight?: number;
|
54
|
-
unit_of_weight?: string;
|
55
|
-
hs_tariff_number?: string;
|
56
|
-
do_not_ship?: boolean;
|
57
|
-
do_not_track?: boolean;
|
58
|
-
shipping_category?: ShippingCategoryRel;
|
59
|
-
}
|
60
|
-
declare class Skus extends ApiResource {
|
61
|
-
static readonly TYPE: 'skus';
|
62
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
63
|
-
create(resource: SkuCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
64
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
65
|
-
update(resource: SkuUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
66
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
67
|
-
shipping_category(skuId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingCategory>;
|
68
|
-
prices(skuId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Price>>;
|
69
|
-
stock_items(skuId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockItem>>;
|
70
|
-
delivery_lead_times(skuId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<DeliveryLeadTime>>;
|
71
|
-
sku_options(skuId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SkuOption>>;
|
72
|
-
attachments(skuId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
73
|
-
isSku(resource: any): resource is Sku;
|
74
|
-
relationship(id: string | ResourceId | null): SkuRel;
|
75
|
-
type(): string;
|
76
|
-
}
|
77
|
-
export default Skus;
|
78
|
-
export { Sku, SkuCreate, SkuUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{ShippingCategory}from'./shipping_categories';import type{Price}from'./prices';import type{StockItem}from'./stock_items';import type{DeliveryLeadTime}from'./delivery_lead_times';import type{SkuOption}from'./sku_options';import type{Attachment}from'./attachments';declare type SkuRel=ResourceRel&{type:typeof Skus.TYPE;};declare type ShippingCategoryRel=ResourceRel&{type:'shipping_categories';};interface Sku extends Resource{code?:string;name?:string;description?:string;image_url?:string;pieces_per_pack?:number;weight?:number;unit_of_weight?:string;hs_tariff_number?:string;do_not_ship?:boolean;do_not_track?:boolean;inventory?:object;shipping_category?:ShippingCategory;prices?:Price[];stock_items?:StockItem[];delivery_lead_times?:DeliveryLeadTime[];sku_options?:SkuOption[];attachments?:Attachment[];}interface SkuCreate extends ResourceCreate{code:string;name:string;description?:string;image_url?:string;pieces_per_pack?:number;weight?:number;unit_of_weight?:string;hs_tariff_number?:string;do_not_ship?:boolean;do_not_track?:boolean;shipping_category:ShippingCategoryRel;}interface SkuUpdate extends ResourceUpdate{code?:string;name?:string;description?:string;image_url?:string;pieces_per_pack?:number;weight?:number;unit_of_weight?:string;hs_tariff_number?:string;do_not_ship?:boolean;do_not_track?:boolean;shipping_category?:ShippingCategoryRel;}declare class Skus extends ApiResource{static readonly TYPE:'skus';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Sku>>;create(resource:SkuCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Sku>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Sku>;update(resource:SkuUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Sku>;delete(id:string,options?:ResourcesConfig):Promise<void>;shipping_category(skuId:string|Sku,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ShippingCategory>;prices(skuId:string|Sku,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Price>>;stock_items(skuId:string|Sku,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StockItem>>;delivery_lead_times(skuId:string|Sku,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<DeliveryLeadTime>>;sku_options(skuId:string|Sku,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<SkuOption>>;attachments(skuId:string|Sku,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isSku(resource:any):resource is Sku;relationship(id:string|ResourceId|null):SkuRel;type():string;}export default Skus;export{Sku,SkuCreate,SkuUpdate};
|
package/lib/resources/skus.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as i}from"../resource";class
|
1
|
+
import{ApiResource as i}from"../resource";class c extends i{static TYPE="skus";async list(e,t){return this.resources.list({type:c.TYPE},e,t)}async create(e,t,s){return this.resources.create({...e,type:c.TYPE},t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:c.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update({...e,type:c.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:c.TYPE,id:e},t)}async shipping_category(e,t,s){const r=e.id||e;return this.resources.fetch({type:"shipping_categories"},`skus/${r}/shipping_category`,t,s)}async prices(e,t,s){const r=e.id||e;return this.resources.fetch({type:"prices"},`skus/${r}/prices`,t,s)}async stock_items(e,t,s){const r=e.id||e;return this.resources.fetch({type:"stock_items"},`skus/${r}/stock_items`,t,s)}async delivery_lead_times(e,t,s){const r=e.id||e;return this.resources.fetch({type:"delivery_lead_times"},`skus/${r}/delivery_lead_times`,t,s)}async sku_options(e,t,s){const r=e.id||e;return this.resources.fetch({type:"sku_options"},`skus/${r}/sku_options`,t,s)}async attachments(e,t,s){const r=e.id||e;return this.resources.fetch({type:"attachments"},`skus/${r}/attachments`,t,s)}isSku(e){return e.type&&e.type===c.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:c.TYPE}:{id:e.id,type:c.TYPE}}type(){return c.TYPE}}export default c;
|
@@ -1,49 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { StockLocation } from './stock_locations';
|
4
|
-
import { Sku } from './skus';
|
5
|
-
import { Attachment } from './attachments';
|
6
|
-
declare type StockItemRel = ResourceRel & {
|
7
|
-
type: typeof StockItems.TYPE;
|
8
|
-
};
|
9
|
-
declare type StockLocationRel = ResourceRel & {
|
10
|
-
type: 'stock_locations';
|
11
|
-
};
|
12
|
-
declare type SkuRel = ResourceRel & {
|
13
|
-
type: 'skus';
|
14
|
-
};
|
15
|
-
interface StockItem extends Resource {
|
16
|
-
sku_code?: string;
|
17
|
-
quantity?: number;
|
18
|
-
stock_location?: StockLocation;
|
19
|
-
sku?: Sku;
|
20
|
-
attachments?: Attachment[];
|
21
|
-
}
|
22
|
-
interface StockItemCreate extends ResourceCreate {
|
23
|
-
sku_code?: string;
|
24
|
-
quantity: number;
|
25
|
-
stock_location: StockLocationRel;
|
26
|
-
sku?: SkuRel;
|
27
|
-
}
|
28
|
-
interface StockItemUpdate extends ResourceUpdate {
|
29
|
-
sku_code?: string;
|
30
|
-
quantity?: number;
|
31
|
-
stock_location?: StockLocationRel;
|
32
|
-
sku?: SkuRel;
|
33
|
-
}
|
34
|
-
declare class StockItems extends ApiResource {
|
35
|
-
static readonly TYPE: 'stock_items';
|
36
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockItem>>;
|
37
|
-
create(resource: StockItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
38
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
39
|
-
update(resource: StockItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
40
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
41
|
-
stock_location(stockItemId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
42
|
-
sku(stockItemId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
43
|
-
attachments(stockItemId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
44
|
-
isStockItem(resource: any): resource is StockItem;
|
45
|
-
relationship(id: string | ResourceId | null): StockItemRel;
|
46
|
-
type(): string;
|
47
|
-
}
|
48
|
-
export default StockItems;
|
49
|
-
export { StockItem, StockItemCreate, StockItemUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{StockLocation}from'./stock_locations';import type{Sku}from'./skus';import type{Attachment}from'./attachments';declare type StockItemRel=ResourceRel&{type:typeof StockItems.TYPE;};declare type StockLocationRel=ResourceRel&{type:'stock_locations';};declare type SkuRel=ResourceRel&{type:'skus';};interface StockItem extends Resource{sku_code?:string;quantity?:number;stock_location?:StockLocation;sku?:Sku;attachments?:Attachment[];}interface StockItemCreate extends ResourceCreate{sku_code?:string;quantity:number;stock_location:StockLocationRel;sku?:SkuRel;}interface StockItemUpdate extends ResourceUpdate{sku_code?:string;quantity?:number;stock_location?:StockLocationRel;sku?:SkuRel;}declare class StockItems extends ApiResource{static readonly TYPE:'stock_items';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StockItem>>;create(resource:StockItemCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockItem>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockItem>;update(resource:StockItemUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockItem>;delete(id:string,options?:ResourcesConfig):Promise<void>;stock_location(stockItemId:string|StockItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLocation>;sku(stockItemId:string|StockItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Sku>;attachments(stockItemId:string|StockItem,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isStockItem(resource:any):resource is StockItem;relationship(id:string|ResourceId|null):StockItemRel;type():string;}export default StockItems;export{StockItem,StockItemCreate,StockItemUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as c}from"../resource";class
|
1
|
+
import{ApiResource as c}from"../resource";class r extends c{static TYPE="stock_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 stock_location(e,t,s){const i=e.id||e;return this.resources.fetch({type:"stock_locations"},`stock_items/${i}/stock_location`,t,s)}async sku(e,t,s){const i=e.id||e;return this.resources.fetch({type:"skus"},`stock_items/${i}/sku`,t,s)}async attachments(e,t,s){const i=e.id||e;return this.resources.fetch({type:"attachments"},`stock_items/${i}/attachments`,t,s)}isStockItem(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,29 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Shipment } from './shipments';
|
4
|
-
import { LineItem } from './line_items';
|
5
|
-
import { StockItem } from './stock_items';
|
6
|
-
declare type StockLineItemRel = ResourceRel & {
|
7
|
-
type: typeof StockLineItems.TYPE;
|
8
|
-
};
|
9
|
-
interface StockLineItem extends Resource {
|
10
|
-
sku_code?: string;
|
11
|
-
bundle_code?: string;
|
12
|
-
quantity?: number;
|
13
|
-
shipment?: Shipment;
|
14
|
-
line_item?: LineItem;
|
15
|
-
stock_item?: StockItem;
|
16
|
-
}
|
17
|
-
declare class StockLineItems extends ApiResource {
|
18
|
-
static readonly TYPE: 'stock_line_items';
|
19
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>>;
|
20
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
|
21
|
-
shipment(stockLineItemId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
|
22
|
-
line_item(stockLineItemId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
23
|
-
stock_item(stockLineItemId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
24
|
-
isStockLineItem(resource: any): resource is StockLineItem;
|
25
|
-
relationship(id: string | ResourceId | null): StockLineItemRel;
|
26
|
-
type(): string;
|
27
|
-
}
|
28
|
-
export default StockLineItems;
|
29
|
-
export { StockLineItem };
|
1
|
+
import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Shipment}from'./shipments';import type{LineItem}from'./line_items';import type{StockItem}from'./stock_items';declare type StockLineItemRel=ResourceRel&{type:typeof StockLineItems.TYPE;};interface StockLineItem extends Resource{sku_code?:string;bundle_code?:string;quantity?:number;shipment?:Shipment;line_item?:LineItem;stock_item?:StockItem;}declare class StockLineItems extends ApiResource{static readonly TYPE:'stock_line_items';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StockLineItem>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLineItem>;shipment(stockLineItemId:string|StockLineItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Shipment>;line_item(stockLineItemId:string|StockLineItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<LineItem>;stock_item(stockLineItemId:string|StockLineItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockItem>;isStockLineItem(resource:any):resource is StockLineItem;relationship(id:string|ResourceId|null):StockLineItemRel;type():string;}export default StockLineItems;export{StockLineItem};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class s extends n{static TYPE="stock_line_items";async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async retrieve(e,t,i){return this.resources.retrieve({type:s.TYPE,id:e},t,i)}async shipment(e,t,i){const r=e.id||e;return this.resources.fetch({type:"shipments"},`stock_line_items/${r}/shipment`,t,i)}async line_item(e,t,i){const r=e.id||e;return this.resources.fetch({type:"line_items"},`stock_line_items/${r}/line_item`,t,i)}async stock_item(e,t,i){const r=e.id||e;return this.resources.fetch({type:"stock_items"},`stock_line_items/${r}/stock_item`,t,i)}isStockLineItem(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,57 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Address } from './addresses';
|
4
|
-
import { InventoryStockLocation } from './inventory_stock_locations';
|
5
|
-
import { InventoryReturnLocation } from './inventory_return_locations';
|
6
|
-
import { StockItem } from './stock_items';
|
7
|
-
import { StockTransfer } from './stock_transfers';
|
8
|
-
import { Attachment } from './attachments';
|
9
|
-
declare type StockLocationRel = ResourceRel & {
|
10
|
-
type: typeof StockLocations.TYPE;
|
11
|
-
};
|
12
|
-
declare type AddressRel = ResourceRel & {
|
13
|
-
type: 'addresses';
|
14
|
-
};
|
15
|
-
interface StockLocation extends Resource {
|
16
|
-
number?: number;
|
17
|
-
name?: string;
|
18
|
-
label_format?: string;
|
19
|
-
suppress_etd?: boolean;
|
20
|
-
address?: Address;
|
21
|
-
inventory_stock_locations?: InventoryStockLocation[];
|
22
|
-
inventory_return_locations?: InventoryReturnLocation[];
|
23
|
-
stock_items?: StockItem[];
|
24
|
-
stock_transfers?: StockTransfer[];
|
25
|
-
attachments?: Attachment[];
|
26
|
-
}
|
27
|
-
interface StockLocationCreate extends ResourceCreate {
|
28
|
-
name: string;
|
29
|
-
label_format?: string;
|
30
|
-
suppress_etd?: boolean;
|
31
|
-
address: AddressRel;
|
32
|
-
}
|
33
|
-
interface StockLocationUpdate extends ResourceUpdate {
|
34
|
-
name?: string;
|
35
|
-
label_format?: string;
|
36
|
-
suppress_etd?: boolean;
|
37
|
-
address?: AddressRel;
|
38
|
-
}
|
39
|
-
declare class StockLocations extends ApiResource {
|
40
|
-
static readonly TYPE: 'stock_locations';
|
41
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLocation>>;
|
42
|
-
create(resource: StockLocationCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
43
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
44
|
-
update(resource: StockLocationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
45
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
46
|
-
address(stockLocationId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
|
47
|
-
inventory_stock_locations(stockLocationId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<InventoryStockLocation>>;
|
48
|
-
inventory_return_locations(stockLocationId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<InventoryReturnLocation>>;
|
49
|
-
stock_items(stockLocationId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockItem>>;
|
50
|
-
stock_transfers(stockLocationId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
|
51
|
-
attachments(stockLocationId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
52
|
-
isStockLocation(resource: any): resource is StockLocation;
|
53
|
-
relationship(id: string | ResourceId | null): StockLocationRel;
|
54
|
-
type(): string;
|
55
|
-
}
|
56
|
-
export default StockLocations;
|
57
|
-
export { StockLocation, StockLocationCreate, StockLocationUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Address}from'./addresses';import type{InventoryStockLocation}from'./inventory_stock_locations';import type{InventoryReturnLocation}from'./inventory_return_locations';import type{StockItem}from'./stock_items';import type{StockTransfer}from'./stock_transfers';import type{Attachment}from'./attachments';declare type StockLocationRel=ResourceRel&{type:typeof StockLocations.TYPE;};declare type AddressRel=ResourceRel&{type:'addresses';};interface StockLocation extends Resource{number?:number;name?:string;label_format?:string;suppress_etd?:boolean;address?:Address;inventory_stock_locations?:InventoryStockLocation[];inventory_return_locations?:InventoryReturnLocation[];stock_items?:StockItem[];stock_transfers?:StockTransfer[];attachments?:Attachment[];}interface StockLocationCreate extends ResourceCreate{name:string;label_format?:string;suppress_etd?:boolean;address:AddressRel;}interface StockLocationUpdate extends ResourceUpdate{name?:string;label_format?:string;suppress_etd?:boolean;address?:AddressRel;}declare class StockLocations extends ApiResource{static readonly TYPE:'stock_locations';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StockLocation>>;create(resource:StockLocationCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLocation>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLocation>;update(resource:StockLocationUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLocation>;delete(id:string,options?:ResourcesConfig):Promise<void>;address(stockLocationId:string|StockLocation,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Address>;inventory_stock_locations(stockLocationId:string|StockLocation,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<InventoryStockLocation>>;inventory_return_locations(stockLocationId:string|StockLocation,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<InventoryReturnLocation>>;stock_items(stockLocationId:string|StockLocation,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StockItem>>;stock_transfers(stockLocationId:string|StockLocation,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StockTransfer>>;attachments(stockLocationId:string|StockLocation,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isStockLocation(resource:any):resource is StockLocation;relationship(id:string|ResourceId|null):StockLocationRel;type():string;}export default StockLocations;export{StockLocation,StockLocationCreate,StockLocationUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class o extends n{static TYPE="stock_locations";async list(t,s){return this.resources.list({type:o.TYPE},t,s)}async create(t,s,e){return this.resources.create({...t,type:o.TYPE},s,e)}async retrieve(t,s,e){return this.resources.retrieve({type:o.TYPE,id:t},s,e)}async update(t,s,e){return this.resources.update({...t,type:o.TYPE},s,e)}async delete(t,s){await this.resources.delete({type:o.TYPE,id:t},s)}async address(t,s,e){const r=t.id||t;return this.resources.fetch({type:"addresses"},`stock_locations/${r}/address`,s,e)}async inventory_stock_locations(t,s,e){const r=t.id||t;return this.resources.fetch({type:"inventory_stock_locations"},`stock_locations/${r}/inventory_stock_locations`,s,e)}async inventory_return_locations(t,s,e){const r=t.id||t;return this.resources.fetch({type:"inventory_return_locations"},`stock_locations/${r}/inventory_return_locations`,s,e)}async stock_items(t,s,e){const r=t.id||t;return this.resources.fetch({type:"stock_items"},`stock_locations/${r}/stock_items`,s,e)}async stock_transfers(t,s,e){const r=t.id||t;return this.resources.fetch({type:"stock_transfers"},`stock_locations/${r}/stock_transfers`,s,e)}async attachments(t,s,e){const r=t.id||t;return this.resources.fetch({type:"attachments"},`stock_locations/${r}/attachments`,s,e)}isStockLocation(t){return t.type&&t.type===o.TYPE}relationship(t){return t===null||typeof t=="string"?{id:t,type:o.TYPE}:{id:t.id,type:o.TYPE}}type(){return o.TYPE}}export default o;
|