@commercelayer/sdk 5.0.0-beta.10 → 5.0.0-beta.12
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/lib/cjs/api.d.ts +10 -5
- package/lib/cjs/api.js +17 -2
- package/lib/cjs/commercelayer.d.ts +7 -2
- package/lib/cjs/commercelayer.js +6 -1
- package/lib/cjs/common.js +11 -0
- package/lib/cjs/model.d.ts +6 -1
- package/lib/cjs/resource.d.ts +3 -4
- package/lib/cjs/resources/fixed_price_promotions.d.ts +3 -3
- package/lib/cjs/resources/fixed_price_promotions.js +4 -4
- package/lib/cjs/resources/free_gift_promotions.d.ts +3 -3
- package/lib/cjs/resources/free_gift_promotions.js +4 -4
- package/lib/cjs/resources/free_shipping_promotions.d.ts +3 -0
- package/lib/cjs/resources/free_shipping_promotions.js +4 -0
- package/lib/cjs/resources/line_items.d.ts +3 -0
- package/lib/cjs/resources/markets.d.ts +8 -0
- package/lib/cjs/resources/markets.js +4 -0
- package/lib/cjs/resources/order_copies.d.ts +11 -9
- package/lib/cjs/resources/order_copies.js +7 -4
- package/lib/cjs/resources/order_factories.d.ts +33 -0
- package/lib/cjs/resources/order_factories.js +28 -0
- package/lib/cjs/resources/order_subscription_items.d.ts +60 -0
- package/lib/cjs/resources/order_subscription_items.js +29 -0
- package/lib/cjs/resources/order_subscriptions.d.ts +25 -3
- package/lib/cjs/resources/order_subscriptions.js +18 -2
- package/lib/cjs/resources/orders.d.ts +9 -1
- package/lib/cjs/resources/orders.js +8 -0
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +3 -3
- package/lib/cjs/resources/percentage_discount_promotions.js +4 -4
- package/lib/cjs/resources/price_frequency_tiers.d.ts +49 -0
- package/lib/cjs/resources/price_frequency_tiers.js +37 -0
- package/lib/cjs/resources/price_volume_tiers.d.ts +3 -0
- package/lib/cjs/resources/price_volume_tiers.js +4 -0
- package/lib/cjs/resources/prices.d.ts +3 -0
- package/lib/cjs/resources/prices.js +4 -0
- package/lib/cjs/resources/promotions.d.ts +3 -0
- package/lib/cjs/resources/promotions.js +4 -0
- package/lib/cjs/resources/recurring_order_copies.d.ts +52 -0
- package/lib/cjs/resources/recurring_order_copies.js +41 -0
- package/lib/cjs/resources/subscription_models.d.ts +48 -0
- package/lib/cjs/resources/subscription_models.js +37 -0
- package/lib/esm/api.d.ts +10 -5
- package/lib/esm/api.js +10 -0
- package/lib/esm/commercelayer.d.ts +7 -2
- package/lib/esm/commercelayer.js +6 -1
- package/lib/esm/common.js +11 -0
- package/lib/esm/model.d.ts +6 -1
- package/lib/esm/resource.d.ts +3 -4
- package/lib/esm/resources/fixed_price_promotions.d.ts +3 -3
- package/lib/esm/resources/fixed_price_promotions.js +4 -4
- package/lib/esm/resources/free_gift_promotions.d.ts +3 -3
- package/lib/esm/resources/free_gift_promotions.js +4 -4
- package/lib/esm/resources/free_shipping_promotions.d.ts +3 -0
- package/lib/esm/resources/free_shipping_promotions.js +4 -0
- package/lib/esm/resources/line_items.d.ts +3 -0
- package/lib/esm/resources/markets.d.ts +8 -0
- package/lib/esm/resources/markets.js +4 -0
- package/lib/esm/resources/order_copies.d.ts +11 -9
- package/lib/esm/resources/order_copies.js +7 -4
- package/lib/esm/resources/order_factories.d.ts +33 -0
- package/lib/esm/resources/order_factories.js +26 -0
- package/lib/esm/resources/order_subscription_items.d.ts +60 -0
- package/lib/esm/resources/order_subscription_items.js +27 -0
- package/lib/esm/resources/order_subscriptions.d.ts +25 -3
- package/lib/esm/resources/order_subscriptions.js +18 -2
- package/lib/esm/resources/orders.d.ts +9 -1
- package/lib/esm/resources/orders.js +8 -0
- package/lib/esm/resources/percentage_discount_promotions.d.ts +3 -3
- package/lib/esm/resources/percentage_discount_promotions.js +4 -4
- package/lib/esm/resources/price_frequency_tiers.d.ts +49 -0
- package/lib/esm/resources/price_frequency_tiers.js +35 -0
- package/lib/esm/resources/price_volume_tiers.d.ts +3 -0
- package/lib/esm/resources/price_volume_tiers.js +4 -0
- package/lib/esm/resources/prices.d.ts +3 -0
- package/lib/esm/resources/prices.js +4 -0
- package/lib/esm/resources/promotions.d.ts +3 -0
- package/lib/esm/resources/promotions.js +4 -0
- package/lib/esm/resources/recurring_order_copies.d.ts +52 -0
- package/lib/esm/resources/recurring_order_copies.js +39 -0
- package/lib/esm/resources/subscription_models.d.ts +48 -0
- package/lib/esm/resources/subscription_models.js +35 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -6,6 +6,7 @@ import type { OrderAmountPromotionRule } from './order_amount_promotion_rules';
|
|
6
6
|
import type { SkuListPromotionRule } from './sku_list_promotion_rules';
|
7
7
|
import type { CouponCodesPromotionRule } from './coupon_codes_promotion_rules';
|
8
8
|
import type { Attachment } from './attachments';
|
9
|
+
import type { Event } from './events';
|
9
10
|
type PromotionType = 'promotions';
|
10
11
|
type PromotionRel = ResourceRel & {
|
11
12
|
type: PromotionType;
|
@@ -25,6 +26,7 @@ interface Promotion extends Resource {
|
|
25
26
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
26
27
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
27
28
|
attachments?: Attachment[] | null;
|
29
|
+
events?: Event[] | null;
|
28
30
|
}
|
29
31
|
declare class Promotions extends ApiResource<Promotion> {
|
30
32
|
static readonly TYPE: PromotionType;
|
@@ -33,6 +35,7 @@ declare class Promotions extends ApiResource<Promotion> {
|
|
33
35
|
sku_list_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
34
36
|
coupon_codes_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
35
37
|
attachments(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
38
|
+
events(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
36
39
|
isPromotion(resource: any): resource is Promotion;
|
37
40
|
relationship(id: string | ResourceId | null): PromotionRel;
|
38
41
|
type(): PromotionType;
|
@@ -22,6 +22,10 @@ class Promotions extends resource_1.ApiResource {
|
|
22
22
|
const _promotionId = promotionId.id || promotionId;
|
23
23
|
return this.resources.fetch({ type: 'attachments' }, `promotions/${_promotionId}/attachments`, params, options);
|
24
24
|
}
|
25
|
+
async events(promotionId, params, options) {
|
26
|
+
const _promotionId = promotionId.id || promotionId;
|
27
|
+
return this.resources.fetch({ type: 'events' }, `promotions/${_promotionId}/events`, params, options);
|
28
|
+
}
|
25
29
|
isPromotion(resource) {
|
26
30
|
return resource.type && (resource.type === Promotions.TYPE);
|
27
31
|
}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { Order, OrderType } from './orders';
|
4
|
+
import type { Event } from './events';
|
5
|
+
import type { OrderSubscription, OrderSubscriptionType } from './order_subscriptions';
|
6
|
+
type RecurringOrderCopyType = 'recurring_order_copies';
|
7
|
+
type RecurringOrderCopyRel = ResourceRel & {
|
8
|
+
type: RecurringOrderCopyType;
|
9
|
+
};
|
10
|
+
type OrderRel = ResourceRel & {
|
11
|
+
type: OrderType;
|
12
|
+
};
|
13
|
+
type OrderSubscriptionRel = ResourceRel & {
|
14
|
+
type: OrderSubscriptionType;
|
15
|
+
};
|
16
|
+
interface RecurringOrderCopy extends Resource {
|
17
|
+
readonly type: RecurringOrderCopyType;
|
18
|
+
status?: string | null;
|
19
|
+
started_at?: string | null;
|
20
|
+
completed_at?: string | null;
|
21
|
+
failed_at?: string | null;
|
22
|
+
errors_log?: object | null;
|
23
|
+
errors_count?: number | null;
|
24
|
+
place_target_order?: boolean | null;
|
25
|
+
reuse_wallet?: boolean | null;
|
26
|
+
source_order?: Order | null;
|
27
|
+
target_order?: Order | null;
|
28
|
+
events?: Event[] | null;
|
29
|
+
order_subscription?: OrderSubscription | null;
|
30
|
+
}
|
31
|
+
interface RecurringOrderCopyCreate extends ResourceCreate {
|
32
|
+
place_target_order?: boolean | null;
|
33
|
+
reuse_wallet?: boolean | null;
|
34
|
+
source_order: OrderRel;
|
35
|
+
order_subscription: OrderSubscriptionRel;
|
36
|
+
}
|
37
|
+
type RecurringOrderCopyUpdate = ResourceUpdate;
|
38
|
+
declare class RecurringOrderCopies extends ApiResource<RecurringOrderCopy> {
|
39
|
+
static readonly TYPE: RecurringOrderCopyType;
|
40
|
+
create(resource: RecurringOrderCopyCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<RecurringOrderCopy>;
|
41
|
+
update(resource: RecurringOrderCopyUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<RecurringOrderCopy>;
|
42
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
43
|
+
source_order(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
44
|
+
target_order(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
45
|
+
events(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
46
|
+
order_subscription(recurringOrderCopyId: string | RecurringOrderCopy, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderSubscription>;
|
47
|
+
isRecurringOrderCopy(resource: any): resource is RecurringOrderCopy;
|
48
|
+
relationship(id: string | ResourceId | null): RecurringOrderCopyRel;
|
49
|
+
type(): RecurringOrderCopyType;
|
50
|
+
}
|
51
|
+
export default RecurringOrderCopies;
|
52
|
+
export type { RecurringOrderCopy, RecurringOrderCopyCreate, RecurringOrderCopyUpdate, RecurringOrderCopyType };
|
@@ -0,0 +1,41 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class RecurringOrderCopies extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: RecurringOrderCopies.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: RecurringOrderCopies.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: RecurringOrderCopies.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async source_order(recurringOrderCopyId, params, options) {
|
15
|
+
const _recurringOrderCopyId = recurringOrderCopyId.id || recurringOrderCopyId;
|
16
|
+
return this.resources.fetch({ type: 'orders' }, `recurring_order_copies/${_recurringOrderCopyId}/source_order`, params, options);
|
17
|
+
}
|
18
|
+
async target_order(recurringOrderCopyId, params, options) {
|
19
|
+
const _recurringOrderCopyId = recurringOrderCopyId.id || recurringOrderCopyId;
|
20
|
+
return this.resources.fetch({ type: 'orders' }, `recurring_order_copies/${_recurringOrderCopyId}/target_order`, params, options);
|
21
|
+
}
|
22
|
+
async events(recurringOrderCopyId, params, options) {
|
23
|
+
const _recurringOrderCopyId = recurringOrderCopyId.id || recurringOrderCopyId;
|
24
|
+
return this.resources.fetch({ type: 'events' }, `recurring_order_copies/${_recurringOrderCopyId}/events`, params, options);
|
25
|
+
}
|
26
|
+
async order_subscription(recurringOrderCopyId, params, options) {
|
27
|
+
const _recurringOrderCopyId = recurringOrderCopyId.id || recurringOrderCopyId;
|
28
|
+
return this.resources.fetch({ type: 'order_subscriptions' }, `recurring_order_copies/${_recurringOrderCopyId}/order_subscription`, params, options);
|
29
|
+
}
|
30
|
+
isRecurringOrderCopy(resource) {
|
31
|
+
return resource.type && (resource.type === RecurringOrderCopies.TYPE);
|
32
|
+
}
|
33
|
+
relationship(id) {
|
34
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: RecurringOrderCopies.TYPE } : { id: id.id, type: RecurringOrderCopies.TYPE };
|
35
|
+
}
|
36
|
+
type() {
|
37
|
+
return RecurringOrderCopies.TYPE;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
RecurringOrderCopies.TYPE = 'recurring_order_copies';
|
41
|
+
exports.default = RecurringOrderCopies;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
3
|
+
import type { Market } from './markets';
|
4
|
+
import type { OrderSubscription } from './order_subscriptions';
|
5
|
+
import type { Attachment } from './attachments';
|
6
|
+
type SubscriptionModelType = 'subscription_models';
|
7
|
+
type SubscriptionModelRel = ResourceRel & {
|
8
|
+
type: SubscriptionModelType;
|
9
|
+
};
|
10
|
+
interface SubscriptionModel extends Resource {
|
11
|
+
readonly type: SubscriptionModelType;
|
12
|
+
name: string;
|
13
|
+
strategy?: string | null;
|
14
|
+
frequencies: string[];
|
15
|
+
auto_activate?: boolean | null;
|
16
|
+
auto_cancel?: boolean | null;
|
17
|
+
markets?: Market[] | null;
|
18
|
+
order_subscriptions?: OrderSubscription[] | null;
|
19
|
+
attachments?: Attachment[] | null;
|
20
|
+
}
|
21
|
+
interface SubscriptionModelCreate extends ResourceCreate {
|
22
|
+
name: string;
|
23
|
+
strategy?: string | null;
|
24
|
+
frequencies: string[];
|
25
|
+
auto_activate?: boolean | null;
|
26
|
+
auto_cancel?: boolean | null;
|
27
|
+
}
|
28
|
+
interface SubscriptionModelUpdate extends ResourceUpdate {
|
29
|
+
name?: string | null;
|
30
|
+
strategy?: string | null;
|
31
|
+
frequencies?: string[] | null;
|
32
|
+
auto_activate?: boolean | null;
|
33
|
+
auto_cancel?: boolean | null;
|
34
|
+
}
|
35
|
+
declare class SubscriptionModels extends ApiResource<SubscriptionModel> {
|
36
|
+
static readonly TYPE: SubscriptionModelType;
|
37
|
+
create(resource: SubscriptionModelCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SubscriptionModel>;
|
38
|
+
update(resource: SubscriptionModelUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SubscriptionModel>;
|
39
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
40
|
+
markets(subscriptionModelId: string | SubscriptionModel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
|
41
|
+
order_subscriptions(subscriptionModelId: string | SubscriptionModel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderSubscription>>;
|
42
|
+
attachments(subscriptionModelId: string | SubscriptionModel, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
43
|
+
isSubscriptionModel(resource: any): resource is SubscriptionModel;
|
44
|
+
relationship(id: string | ResourceId | null): SubscriptionModelRel;
|
45
|
+
type(): SubscriptionModelType;
|
46
|
+
}
|
47
|
+
export default SubscriptionModels;
|
48
|
+
export type { SubscriptionModel, SubscriptionModelCreate, SubscriptionModelUpdate, SubscriptionModelType };
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class SubscriptionModels extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: SubscriptionModels.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: SubscriptionModels.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: SubscriptionModels.TYPE } : id, options);
|
13
|
+
}
|
14
|
+
async markets(subscriptionModelId, params, options) {
|
15
|
+
const _subscriptionModelId = subscriptionModelId.id || subscriptionModelId;
|
16
|
+
return this.resources.fetch({ type: 'markets' }, `subscription_models/${_subscriptionModelId}/markets`, params, options);
|
17
|
+
}
|
18
|
+
async order_subscriptions(subscriptionModelId, params, options) {
|
19
|
+
const _subscriptionModelId = subscriptionModelId.id || subscriptionModelId;
|
20
|
+
return this.resources.fetch({ type: 'order_subscriptions' }, `subscription_models/${_subscriptionModelId}/order_subscriptions`, params, options);
|
21
|
+
}
|
22
|
+
async attachments(subscriptionModelId, params, options) {
|
23
|
+
const _subscriptionModelId = subscriptionModelId.id || subscriptionModelId;
|
24
|
+
return this.resources.fetch({ type: 'attachments' }, `subscription_models/${_subscriptionModelId}/attachments`, params, options);
|
25
|
+
}
|
26
|
+
isSubscriptionModel(resource) {
|
27
|
+
return resource.type && (resource.type === SubscriptionModels.TYPE);
|
28
|
+
}
|
29
|
+
relationship(id) {
|
30
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: SubscriptionModels.TYPE } : { id: id.id, type: SubscriptionModels.TYPE };
|
31
|
+
}
|
32
|
+
type() {
|
33
|
+
return SubscriptionModels.TYPE;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
SubscriptionModels.TYPE = 'subscription_models';
|
37
|
+
exports.default = SubscriptionModels;
|
package/lib/esm/api.d.ts
CHANGED
@@ -61,6 +61,8 @@ export { default as Markets } from './resources/markets';
|
|
61
61
|
export { default as Merchants } from './resources/merchants';
|
62
62
|
export { default as OrderAmountPromotionRules } from './resources/order_amount_promotion_rules';
|
63
63
|
export { default as OrderCopies } from './resources/order_copies';
|
64
|
+
export { default as OrderFactories } from './resources/order_factories';
|
65
|
+
export { default as OrderSubscriptionItems } from './resources/order_subscription_items';
|
64
66
|
export { default as OrderSubscriptions } from './resources/order_subscriptions';
|
65
67
|
export { default as OrderValidationRules } from './resources/order_validation_rules';
|
66
68
|
export { default as Orders } from './resources/orders';
|
@@ -73,12 +75,14 @@ export { default as PaymentMethods } from './resources/payment_methods';
|
|
73
75
|
export { default as PaypalGateways } from './resources/paypal_gateways';
|
74
76
|
export { default as PaypalPayments } from './resources/paypal_payments';
|
75
77
|
export { default as PercentageDiscountPromotions } from './resources/percentage_discount_promotions';
|
78
|
+
export { default as PriceFrequencyTiers } from './resources/price_frequency_tiers';
|
76
79
|
export { default as PriceLists } from './resources/price_lists';
|
77
80
|
export { default as PriceTiers } from './resources/price_tiers';
|
78
81
|
export { default as PriceVolumeTiers } from './resources/price_volume_tiers';
|
79
82
|
export { default as Prices } from './resources/prices';
|
80
83
|
export { default as PromotionRules } from './resources/promotion_rules';
|
81
84
|
export { default as Promotions } from './resources/promotions';
|
85
|
+
export { default as RecurringOrderCopies } from './resources/recurring_order_copies';
|
82
86
|
export { default as Refunds } from './resources/refunds';
|
83
87
|
export { default as ReturnLineItems } from './resources/return_line_items';
|
84
88
|
export { default as Returns } from './resources/returns';
|
@@ -101,6 +105,7 @@ export { default as StockLocations } from './resources/stock_locations';
|
|
101
105
|
export { default as StockTransfers } from './resources/stock_transfers';
|
102
106
|
export { default as StripeGateways } from './resources/stripe_gateways';
|
103
107
|
export { default as StripePayments } from './resources/stripe_payments';
|
108
|
+
export { default as SubscriptionModels } from './resources/subscription_models';
|
104
109
|
export { default as TaxCalculators } from './resources/tax_calculators';
|
105
110
|
export { default as TaxCategories } from './resources/tax_categories';
|
106
111
|
export { default as TaxRules } from './resources/tax_rules';
|
@@ -109,8 +114,8 @@ export { default as Transactions } from './resources/transactions';
|
|
109
114
|
export { default as Voids } from './resources/voids';
|
110
115
|
export { default as Webhooks } from './resources/webhooks';
|
111
116
|
export { default as WireTransfers } from './resources/wire_transfers';
|
112
|
-
export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'refunds' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
|
113
|
-
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "refunds", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_transfers", "stripe_gateways", "stripe_payments", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
|
117
|
+
export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
|
118
|
+
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
|
114
119
|
export type ResourceRetrievable = {
|
115
120
|
type: ResourceTypeLock;
|
116
121
|
};
|
@@ -118,11 +123,11 @@ export type ResourceListable = {
|
|
118
123
|
type: Exclude<ResourceTypeLock, 'application' | 'organization'>;
|
119
124
|
};
|
120
125
|
export type ResourceCreatable = {
|
121
|
-
type: 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
126
|
+
type: 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
122
127
|
};
|
123
128
|
export type ResourceUpdatable = {
|
124
|
-
type: 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'checkout_com_gateways' | 'checkout_com_payments' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
129
|
+
type: 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'checkout_com_gateways' | 'checkout_com_payments' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
125
130
|
};
|
126
131
|
export type ResourceDeletable = {
|
127
|
-
type: 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
132
|
+
type: 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
128
133
|
};
|
package/lib/esm/api.js
CHANGED
@@ -63,6 +63,8 @@ export { default as Markets } from './resources/markets';
|
|
63
63
|
export { default as Merchants } from './resources/merchants';
|
64
64
|
export { default as OrderAmountPromotionRules } from './resources/order_amount_promotion_rules';
|
65
65
|
export { default as OrderCopies } from './resources/order_copies';
|
66
|
+
export { default as OrderFactories } from './resources/order_factories';
|
67
|
+
export { default as OrderSubscriptionItems } from './resources/order_subscription_items';
|
66
68
|
export { default as OrderSubscriptions } from './resources/order_subscriptions';
|
67
69
|
export { default as OrderValidationRules } from './resources/order_validation_rules';
|
68
70
|
export { default as Orders } from './resources/orders';
|
@@ -75,12 +77,14 @@ export { default as PaymentMethods } from './resources/payment_methods';
|
|
75
77
|
export { default as PaypalGateways } from './resources/paypal_gateways';
|
76
78
|
export { default as PaypalPayments } from './resources/paypal_payments';
|
77
79
|
export { default as PercentageDiscountPromotions } from './resources/percentage_discount_promotions';
|
80
|
+
export { default as PriceFrequencyTiers } from './resources/price_frequency_tiers';
|
78
81
|
export { default as PriceLists } from './resources/price_lists';
|
79
82
|
export { default as PriceTiers } from './resources/price_tiers';
|
80
83
|
export { default as PriceVolumeTiers } from './resources/price_volume_tiers';
|
81
84
|
export { default as Prices } from './resources/prices';
|
82
85
|
export { default as PromotionRules } from './resources/promotion_rules';
|
83
86
|
export { default as Promotions } from './resources/promotions';
|
87
|
+
export { default as RecurringOrderCopies } from './resources/recurring_order_copies';
|
84
88
|
export { default as Refunds } from './resources/refunds';
|
85
89
|
export { default as ReturnLineItems } from './resources/return_line_items';
|
86
90
|
export { default as Returns } from './resources/returns';
|
@@ -103,6 +107,7 @@ export { default as StockLocations } from './resources/stock_locations';
|
|
103
107
|
export { default as StockTransfers } from './resources/stock_transfers';
|
104
108
|
export { default as StripeGateways } from './resources/stripe_gateways';
|
105
109
|
export { default as StripePayments } from './resources/stripe_payments';
|
110
|
+
export { default as SubscriptionModels } from './resources/subscription_models';
|
106
111
|
export { default as TaxCalculators } from './resources/tax_calculators';
|
107
112
|
export { default as TaxCategories } from './resources/tax_categories';
|
108
113
|
export { default as TaxRules } from './resources/tax_rules';
|
@@ -174,6 +179,8 @@ export const resourceList = [
|
|
174
179
|
'merchants',
|
175
180
|
'order_amount_promotion_rules',
|
176
181
|
'order_copies',
|
182
|
+
'order_factories',
|
183
|
+
'order_subscription_items',
|
177
184
|
'order_subscriptions',
|
178
185
|
'order_validation_rules',
|
179
186
|
'orders',
|
@@ -186,12 +193,14 @@ export const resourceList = [
|
|
186
193
|
'paypal_gateways',
|
187
194
|
'paypal_payments',
|
188
195
|
'percentage_discount_promotions',
|
196
|
+
'price_frequency_tiers',
|
189
197
|
'price_lists',
|
190
198
|
'price_tiers',
|
191
199
|
'price_volume_tiers',
|
192
200
|
'prices',
|
193
201
|
'promotion_rules',
|
194
202
|
'promotions',
|
203
|
+
'recurring_order_copies',
|
195
204
|
'refunds',
|
196
205
|
'return_line_items',
|
197
206
|
'returns',
|
@@ -214,6 +223,7 @@ export const resourceList = [
|
|
214
223
|
'stock_transfers',
|
215
224
|
'stripe_gateways',
|
216
225
|
'stripe_payments',
|
226
|
+
'subscription_models',
|
217
227
|
'tax_calculators',
|
218
228
|
'tax_categories',
|
219
229
|
'tax_rules',
|
@@ -2,7 +2,7 @@ import * as api from './api';
|
|
2
2
|
import type { ApiError } from './error';
|
3
3
|
import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
|
4
4
|
import type { ResourcesInitConfig } from './resource';
|
5
|
-
declare const OPEN_API_SCHEMA_VERSION = "4.
|
5
|
+
declare const OPEN_API_SCHEMA_VERSION = "4.1.1";
|
6
6
|
export { OPEN_API_SCHEMA_VERSION };
|
7
7
|
type SdkConfig = {};
|
8
8
|
type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
@@ -10,7 +10,7 @@ type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
|
10
10
|
declare class CommerceLayerClient {
|
11
11
|
#private;
|
12
12
|
static get openApiSchemaVersion(): string;
|
13
|
-
readonly openApiSchemaVersion = "4.
|
13
|
+
readonly openApiSchemaVersion = "4.1.1";
|
14
14
|
addresses: api.Addresses;
|
15
15
|
adjustments: api.Adjustments;
|
16
16
|
adyen_gateways: api.AdyenGateways;
|
@@ -71,6 +71,8 @@ declare class CommerceLayerClient {
|
|
71
71
|
merchants: api.Merchants;
|
72
72
|
order_amount_promotion_rules: api.OrderAmountPromotionRules;
|
73
73
|
order_copies: api.OrderCopies;
|
74
|
+
order_factories: api.OrderFactories;
|
75
|
+
order_subscription_items: api.OrderSubscriptionItems;
|
74
76
|
order_subscriptions: api.OrderSubscriptions;
|
75
77
|
order_validation_rules: api.OrderValidationRules;
|
76
78
|
orders: api.Orders;
|
@@ -83,12 +85,14 @@ declare class CommerceLayerClient {
|
|
83
85
|
paypal_gateways: api.PaypalGateways;
|
84
86
|
paypal_payments: api.PaypalPayments;
|
85
87
|
percentage_discount_promotions: api.PercentageDiscountPromotions;
|
88
|
+
price_frequency_tiers: api.PriceFrequencyTiers;
|
86
89
|
price_lists: api.PriceLists;
|
87
90
|
price_tiers: api.PriceTiers;
|
88
91
|
price_volume_tiers: api.PriceVolumeTiers;
|
89
92
|
prices: api.Prices;
|
90
93
|
promotion_rules: api.PromotionRules;
|
91
94
|
promotions: api.Promotions;
|
95
|
+
recurring_order_copies: api.RecurringOrderCopies;
|
92
96
|
refunds: api.Refunds;
|
93
97
|
return_line_items: api.ReturnLineItems;
|
94
98
|
returns: api.Returns;
|
@@ -111,6 +115,7 @@ declare class CommerceLayerClient {
|
|
111
115
|
stock_transfers: api.StockTransfers;
|
112
116
|
stripe_gateways: api.StripeGateways;
|
113
117
|
stripe_payments: api.StripePayments;
|
118
|
+
subscription_models: api.SubscriptionModels;
|
114
119
|
tax_calculators: api.TaxCalculators;
|
115
120
|
tax_categories: api.TaxCategories;
|
116
121
|
tax_rules: api.TaxRules;
|
package/lib/esm/commercelayer.js
CHANGED
@@ -16,7 +16,7 @@ import ResourceAdapter from './resource';
|
|
16
16
|
import Debug from './debug';
|
17
17
|
const debug = Debug('commercelayer');
|
18
18
|
// Autogenerated schema version number, do not remove this line
|
19
|
-
const OPEN_API_SCHEMA_VERSION = '4.
|
19
|
+
const OPEN_API_SCHEMA_VERSION = '4.1.1';
|
20
20
|
export { OPEN_API_SCHEMA_VERSION };
|
21
21
|
class CommerceLayerClient {
|
22
22
|
static get openApiSchemaVersion() { return OPEN_API_SCHEMA_VERSION; }
|
@@ -90,6 +90,8 @@ class CommerceLayerClient {
|
|
90
90
|
this.merchants = new api.Merchants(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
91
91
|
this.order_amount_promotion_rules = new api.OrderAmountPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
92
92
|
this.order_copies = new api.OrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
93
|
+
this.order_factories = new api.OrderFactories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
94
|
+
this.order_subscription_items = new api.OrderSubscriptionItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
93
95
|
this.order_subscriptions = new api.OrderSubscriptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
94
96
|
this.order_validation_rules = new api.OrderValidationRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
95
97
|
this.orders = new api.Orders(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
@@ -102,12 +104,14 @@ class CommerceLayerClient {
|
|
102
104
|
this.paypal_gateways = new api.PaypalGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
103
105
|
this.paypal_payments = new api.PaypalPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
104
106
|
this.percentage_discount_promotions = new api.PercentageDiscountPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
107
|
+
this.price_frequency_tiers = new api.PriceFrequencyTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
105
108
|
this.price_lists = new api.PriceLists(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
106
109
|
this.price_tiers = new api.PriceTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
107
110
|
this.price_volume_tiers = new api.PriceVolumeTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
108
111
|
this.prices = new api.Prices(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
109
112
|
this.promotion_rules = new api.PromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
110
113
|
this.promotions = new api.Promotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
114
|
+
this.recurring_order_copies = new api.RecurringOrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
111
115
|
this.refunds = new api.Refunds(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
112
116
|
this.return_line_items = new api.ReturnLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
113
117
|
this.returns = new api.Returns(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
@@ -130,6 +134,7 @@ class CommerceLayerClient {
|
|
130
134
|
this.stock_transfers = new api.StockTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
131
135
|
this.stripe_gateways = new api.StripeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
132
136
|
this.stripe_payments = new api.StripePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
137
|
+
this.subscription_models = new api.SubscriptionModels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
133
138
|
this.tax_calculators = new api.TaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
134
139
|
this.tax_categories = new api.TaxCategories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
135
140
|
this.tax_rules = new api.TaxRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
package/lib/esm/common.js
CHANGED
@@ -6,3 +6,14 @@ const isResourceType = (resource) => {
|
|
6
6
|
return resource && (typeof resource.type !== 'undefined') && resource.type && resourceList.includes(resource.type);
|
7
7
|
};
|
8
8
|
export { isResourceId, isResourceType };
|
9
|
+
/*
|
10
|
+
// Nullable types
|
11
|
+
type StringNullable = string | null
|
12
|
+
type NumberNullable = number | null
|
13
|
+
type BooleanNullable = boolean | null
|
14
|
+
type ResourceNullable<R extends Resource> = R | null
|
15
|
+
type ResourceArrayNullable<R extends Resource> = R[] | null
|
16
|
+
|
17
|
+
|
18
|
+
export type { StringNullable, NumberNullable, BooleanNullable, ResourceNullable, ResourceArrayNullable }
|
19
|
+
*/
|
package/lib/esm/model.d.ts
CHANGED
@@ -60,7 +60,9 @@ export type { ManualTaxCalculator, ManualTaxCalculatorCreate, ManualTaxCalculato
|
|
60
60
|
export type { Market, MarketCreate, MarketUpdate } from './resources/markets';
|
61
61
|
export type { Merchant, MerchantCreate, MerchantUpdate } from './resources/merchants';
|
62
62
|
export type { OrderAmountPromotionRule, OrderAmountPromotionRuleCreate, OrderAmountPromotionRuleUpdate } from './resources/order_amount_promotion_rules';
|
63
|
-
export type { OrderCopy, OrderCopyCreate } from './resources/order_copies';
|
63
|
+
export type { OrderCopy, OrderCopyCreate, OrderCopyUpdate } from './resources/order_copies';
|
64
|
+
export type { OrderFactory } from './resources/order_factories';
|
65
|
+
export type { OrderSubscriptionItem, OrderSubscriptionItemCreate, OrderSubscriptionItemUpdate } from './resources/order_subscription_items';
|
64
66
|
export type { OrderSubscription, OrderSubscriptionCreate, OrderSubscriptionUpdate } from './resources/order_subscriptions';
|
65
67
|
export type { OrderValidationRule } from './resources/order_validation_rules';
|
66
68
|
export type { Order, OrderCreate, OrderUpdate } from './resources/orders';
|
@@ -73,12 +75,14 @@ export type { PaymentMethod, PaymentMethodCreate, PaymentMethodUpdate } from './
|
|
73
75
|
export type { PaypalGateway, PaypalGatewayCreate, PaypalGatewayUpdate } from './resources/paypal_gateways';
|
74
76
|
export type { PaypalPayment, PaypalPaymentCreate, PaypalPaymentUpdate } from './resources/paypal_payments';
|
75
77
|
export type { PercentageDiscountPromotion, PercentageDiscountPromotionCreate, PercentageDiscountPromotionUpdate } from './resources/percentage_discount_promotions';
|
78
|
+
export type { PriceFrequencyTier, PriceFrequencyTierCreate, PriceFrequencyTierUpdate } from './resources/price_frequency_tiers';
|
76
79
|
export type { PriceList, PriceListCreate, PriceListUpdate } from './resources/price_lists';
|
77
80
|
export type { PriceTier } from './resources/price_tiers';
|
78
81
|
export type { PriceVolumeTier, PriceVolumeTierCreate, PriceVolumeTierUpdate } from './resources/price_volume_tiers';
|
79
82
|
export type { Price, PriceCreate, PriceUpdate } from './resources/prices';
|
80
83
|
export type { PromotionRule } from './resources/promotion_rules';
|
81
84
|
export type { Promotion } from './resources/promotions';
|
85
|
+
export type { RecurringOrderCopy, RecurringOrderCopyCreate, RecurringOrderCopyUpdate } from './resources/recurring_order_copies';
|
82
86
|
export type { Refund } from './resources/refunds';
|
83
87
|
export type { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate } from './resources/return_line_items';
|
84
88
|
export type { Return, ReturnCreate, ReturnUpdate } from './resources/returns';
|
@@ -101,6 +105,7 @@ export type { StockLocation, StockLocationCreate, StockLocationUpdate } from './
|
|
101
105
|
export type { StockTransfer, StockTransferCreate, StockTransferUpdate } from './resources/stock_transfers';
|
102
106
|
export type { StripeGateway, StripeGatewayCreate, StripeGatewayUpdate } from './resources/stripe_gateways';
|
103
107
|
export type { StripePayment, StripePaymentCreate, StripePaymentUpdate } from './resources/stripe_payments';
|
108
|
+
export type { SubscriptionModel, SubscriptionModelCreate, SubscriptionModelUpdate } from './resources/subscription_models';
|
104
109
|
export type { TaxCalculator } from './resources/tax_calculators';
|
105
110
|
export type { TaxCategory, TaxCategoryCreate, TaxCategoryUpdate } from './resources/tax_categories';
|
106
111
|
export type { TaxRule, TaxRuleCreate, TaxRuleUpdate } from './resources/tax_rules';
|
package/lib/esm/resource.d.ts
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
import type { ApiClientInitConfig } from './client';
|
2
|
-
import type { QueryParamsRetrieve, QueryParamsList, QueryFilter } from './query';
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList, QueryFilter, QueryParams } from './query';
|
3
3
|
import type { ResourceTypeLock } from './api';
|
4
4
|
import type { InterceptorManager } from './interceptor';
|
5
|
-
import { QueryParams } from '.';
|
6
5
|
type ResourceNull = {
|
7
6
|
id: null;
|
8
7
|
} & ResourceType;
|
@@ -17,8 +16,8 @@ interface ResourceId extends ResourceType {
|
|
17
16
|
readonly id: string;
|
18
17
|
}
|
19
18
|
interface ResourceBase {
|
20
|
-
reference?: string;
|
21
|
-
reference_origin?: string;
|
19
|
+
reference?: string | null;
|
20
|
+
reference_origin?: string | null;
|
22
21
|
metadata?: Metadata;
|
23
22
|
}
|
24
23
|
interface Resource extends ResourceBase, ResourceId {
|
@@ -6,9 +6,9 @@ import type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './o
|
|
6
6
|
import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules';
|
7
7
|
import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
|
8
8
|
import type { Attachment } from './attachments';
|
9
|
+
import type { Event } from './events';
|
9
10
|
import type { SkuList, SkuListType } from './sku_lists';
|
10
11
|
import type { Sku } from './skus';
|
11
|
-
import type { Event } from './events';
|
12
12
|
type FixedPricePromotionType = 'fixed_price_promotions';
|
13
13
|
type FixedPricePromotionRel = ResourceRel & {
|
14
14
|
type: FixedPricePromotionType;
|
@@ -49,9 +49,9 @@ interface FixedPricePromotion extends Resource {
|
|
49
49
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
50
50
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
51
51
|
attachments?: Attachment[] | null;
|
52
|
+
events?: Event[] | null;
|
52
53
|
sku_list?: SkuList | null;
|
53
54
|
skus?: Sku[] | null;
|
54
|
-
events?: Event[] | null;
|
55
55
|
}
|
56
56
|
interface FixedPricePromotionCreate extends ResourceCreate {
|
57
57
|
name: string;
|
@@ -91,9 +91,9 @@ declare class FixedPricePromotions extends ApiResource<FixedPricePromotion> {
|
|
91
91
|
sku_list_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
92
92
|
coupon_codes_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
93
93
|
attachments(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
94
|
+
events(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
94
95
|
sku_list(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
95
96
|
skus(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
|
96
|
-
events(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
97
97
|
isFixedPricePromotion(resource: any): resource is FixedPricePromotion;
|
98
98
|
relationship(id: string | ResourceId | null): FixedPricePromotionRel;
|
99
99
|
type(): FixedPricePromotionType;
|
@@ -29,6 +29,10 @@ class FixedPricePromotions extends ApiResource {
|
|
29
29
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
30
30
|
return this.resources.fetch({ type: 'attachments' }, `fixed_price_promotions/${_fixedPricePromotionId}/attachments`, params, options);
|
31
31
|
}
|
32
|
+
async events(fixedPricePromotionId, params, options) {
|
33
|
+
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
34
|
+
return this.resources.fetch({ type: 'events' }, `fixed_price_promotions/${_fixedPricePromotionId}/events`, params, options);
|
35
|
+
}
|
32
36
|
async sku_list(fixedPricePromotionId, params, options) {
|
33
37
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
34
38
|
return this.resources.fetch({ type: 'sku_lists' }, `fixed_price_promotions/${_fixedPricePromotionId}/sku_list`, params, options);
|
@@ -37,10 +41,6 @@ class FixedPricePromotions extends ApiResource {
|
|
37
41
|
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
38
42
|
return this.resources.fetch({ type: 'skus' }, `fixed_price_promotions/${_fixedPricePromotionId}/skus`, params, options);
|
39
43
|
}
|
40
|
-
async events(fixedPricePromotionId, params, options) {
|
41
|
-
const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
|
42
|
-
return this.resources.fetch({ type: 'events' }, `fixed_price_promotions/${_fixedPricePromotionId}/events`, params, options);
|
43
|
-
}
|
44
44
|
isFixedPricePromotion(resource) {
|
45
45
|
return resource.type && (resource.type === FixedPricePromotions.TYPE);
|
46
46
|
}
|