@commercelayer/sdk 4.26.0 → 4.27.0

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.
Files changed (79) hide show
  1. package/lib/cjs/api.d.ts +7 -2
  2. package/lib/cjs/api.js +17 -2
  3. package/lib/cjs/commercelayer.d.ts +7 -2
  4. package/lib/cjs/commercelayer.js +6 -1
  5. package/lib/cjs/model.d.ts +6 -1
  6. package/lib/cjs/resources/fixed_price_promotions.d.ts +3 -3
  7. package/lib/cjs/resources/fixed_price_promotions.js +4 -4
  8. package/lib/cjs/resources/free_gift_promotions.d.ts +3 -3
  9. package/lib/cjs/resources/free_gift_promotions.js +4 -4
  10. package/lib/cjs/resources/free_shipping_promotions.d.ts +3 -0
  11. package/lib/cjs/resources/free_shipping_promotions.js +4 -0
  12. package/lib/cjs/resources/line_items.d.ts +3 -0
  13. package/lib/cjs/resources/markets.d.ts +8 -0
  14. package/lib/cjs/resources/markets.js +4 -0
  15. package/lib/cjs/resources/order_copies.d.ts +11 -9
  16. package/lib/cjs/resources/order_copies.js +7 -4
  17. package/lib/cjs/resources/order_factories.d.ts +33 -0
  18. package/lib/cjs/resources/order_factories.js +36 -0
  19. package/lib/cjs/resources/order_subscription_items.d.ts +60 -0
  20. package/lib/cjs/resources/order_subscription_items.js +37 -0
  21. package/lib/cjs/resources/order_subscriptions.d.ts +25 -3
  22. package/lib/cjs/resources/order_subscriptions.js +18 -2
  23. package/lib/cjs/resources/orders.d.ts +8 -0
  24. package/lib/cjs/resources/orders.js +8 -0
  25. package/lib/cjs/resources/percentage_discount_promotions.d.ts +3 -3
  26. package/lib/cjs/resources/percentage_discount_promotions.js +4 -4
  27. package/lib/cjs/resources/price_frequency_tiers.d.ts +49 -0
  28. package/lib/cjs/resources/price_frequency_tiers.js +45 -0
  29. package/lib/cjs/resources/price_volume_tiers.d.ts +3 -0
  30. package/lib/cjs/resources/price_volume_tiers.js +4 -0
  31. package/lib/cjs/resources/prices.d.ts +3 -0
  32. package/lib/cjs/resources/prices.js +4 -0
  33. package/lib/cjs/resources/promotions.d.ts +3 -0
  34. package/lib/cjs/resources/promotions.js +4 -0
  35. package/lib/cjs/resources/recurring_order_copies.d.ts +52 -0
  36. package/lib/cjs/resources/recurring_order_copies.js +49 -0
  37. package/lib/cjs/resources/subscription_models.d.ts +48 -0
  38. package/lib/cjs/resources/subscription_models.js +45 -0
  39. package/lib/esm/api.d.ts +7 -2
  40. package/lib/esm/api.js +10 -0
  41. package/lib/esm/commercelayer.d.ts +7 -2
  42. package/lib/esm/commercelayer.js +6 -1
  43. package/lib/esm/model.d.ts +6 -1
  44. package/lib/esm/resources/fixed_price_promotions.d.ts +3 -3
  45. package/lib/esm/resources/fixed_price_promotions.js +4 -4
  46. package/lib/esm/resources/free_gift_promotions.d.ts +3 -3
  47. package/lib/esm/resources/free_gift_promotions.js +4 -4
  48. package/lib/esm/resources/free_shipping_promotions.d.ts +3 -0
  49. package/lib/esm/resources/free_shipping_promotions.js +4 -0
  50. package/lib/esm/resources/line_items.d.ts +3 -0
  51. package/lib/esm/resources/markets.d.ts +8 -0
  52. package/lib/esm/resources/markets.js +4 -0
  53. package/lib/esm/resources/order_copies.d.ts +11 -9
  54. package/lib/esm/resources/order_copies.js +7 -4
  55. package/lib/esm/resources/order_factories.d.ts +33 -0
  56. package/lib/esm/resources/order_factories.js +34 -0
  57. package/lib/esm/resources/order_subscription_items.d.ts +60 -0
  58. package/lib/esm/resources/order_subscription_items.js +35 -0
  59. package/lib/esm/resources/order_subscriptions.d.ts +25 -3
  60. package/lib/esm/resources/order_subscriptions.js +18 -2
  61. package/lib/esm/resources/orders.d.ts +8 -0
  62. package/lib/esm/resources/orders.js +8 -0
  63. package/lib/esm/resources/percentage_discount_promotions.d.ts +3 -3
  64. package/lib/esm/resources/percentage_discount_promotions.js +4 -4
  65. package/lib/esm/resources/price_frequency_tiers.d.ts +49 -0
  66. package/lib/esm/resources/price_frequency_tiers.js +43 -0
  67. package/lib/esm/resources/price_volume_tiers.d.ts +3 -0
  68. package/lib/esm/resources/price_volume_tiers.js +4 -0
  69. package/lib/esm/resources/prices.d.ts +3 -0
  70. package/lib/esm/resources/prices.js +4 -0
  71. package/lib/esm/resources/promotions.d.ts +3 -0
  72. package/lib/esm/resources/promotions.js +4 -0
  73. package/lib/esm/resources/recurring_order_copies.d.ts +52 -0
  74. package/lib/esm/resources/recurring_order_copies.js +47 -0
  75. package/lib/esm/resources/subscription_models.d.ts +48 -0
  76. package/lib/esm/resources/subscription_models.js +43 -0
  77. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  78. package/lib/tsconfig.tsbuildinfo +1 -1
  79. package/package.json +3 -3
@@ -0,0 +1,52 @@
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import type { Order } from './orders';
4
+ import type { Event } from './events';
5
+ import type { OrderSubscription } from './order_subscriptions';
6
+ type RecurringOrderCopyRel = ResourceRel & {
7
+ type: typeof RecurringOrderCopies.TYPE;
8
+ };
9
+ type OrderRel = ResourceRel & {
10
+ type: 'orders';
11
+ };
12
+ type OrderSubscriptionRel = ResourceRel & {
13
+ type: 'order_subscriptions';
14
+ };
15
+ interface RecurringOrderCopy extends Resource {
16
+ status?: string;
17
+ started_at?: string;
18
+ completed_at?: string;
19
+ failed_at?: string;
20
+ errors_log?: object;
21
+ errors_count?: number;
22
+ place_target_order?: boolean;
23
+ reuse_wallet?: boolean;
24
+ source_order?: Order;
25
+ target_order?: Order;
26
+ events?: Event[];
27
+ order_subscription?: OrderSubscription;
28
+ }
29
+ interface RecurringOrderCopyCreate extends ResourceCreate {
30
+ place_target_order?: boolean;
31
+ reuse_wallet?: boolean;
32
+ source_order: OrderRel;
33
+ order_subscription: OrderSubscriptionRel;
34
+ }
35
+ type RecurringOrderCopyUpdate = ResourceUpdate;
36
+ declare class RecurringOrderCopies extends ApiResource {
37
+ static readonly TYPE: 'recurring_order_copies';
38
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<RecurringOrderCopy>>;
39
+ create(resource: RecurringOrderCopyCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<RecurringOrderCopy>;
40
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<RecurringOrderCopy>;
41
+ update(resource: RecurringOrderCopyUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<RecurringOrderCopy>;
42
+ delete(id: string, 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(): string;
50
+ }
51
+ export default RecurringOrderCopies;
52
+ export { RecurringOrderCopy, RecurringOrderCopyCreate, RecurringOrderCopyUpdate };
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const resource_1 = require("../resource");
4
+ class RecurringOrderCopies extends resource_1.ApiResource {
5
+ // static readonly PATH = 'recurring_order_copies'
6
+ async list(params, options) {
7
+ return this.resources.list({ type: RecurringOrderCopies.TYPE }, params, options);
8
+ }
9
+ async create(resource, params, options) {
10
+ return this.resources.create(Object.assign(Object.assign({}, resource), { type: RecurringOrderCopies.TYPE }), params, options);
11
+ }
12
+ async retrieve(id, params, options) {
13
+ return this.resources.retrieve({ type: RecurringOrderCopies.TYPE, id }, params, options);
14
+ }
15
+ async update(resource, params, options) {
16
+ return this.resources.update(Object.assign(Object.assign({}, resource), { type: RecurringOrderCopies.TYPE }), params, options);
17
+ }
18
+ async delete(id, options) {
19
+ await this.resources.delete({ type: RecurringOrderCopies.TYPE, id }, options);
20
+ }
21
+ async source_order(recurringOrderCopyId, params, options) {
22
+ const _recurringOrderCopyId = recurringOrderCopyId.id || recurringOrderCopyId;
23
+ return this.resources.fetch({ type: 'orders' }, `recurring_order_copies/${_recurringOrderCopyId}/source_order`, params, options);
24
+ }
25
+ async target_order(recurringOrderCopyId, params, options) {
26
+ const _recurringOrderCopyId = recurringOrderCopyId.id || recurringOrderCopyId;
27
+ return this.resources.fetch({ type: 'orders' }, `recurring_order_copies/${_recurringOrderCopyId}/target_order`, params, options);
28
+ }
29
+ async events(recurringOrderCopyId, params, options) {
30
+ const _recurringOrderCopyId = recurringOrderCopyId.id || recurringOrderCopyId;
31
+ return this.resources.fetch({ type: 'events' }, `recurring_order_copies/${_recurringOrderCopyId}/events`, params, options);
32
+ }
33
+ async order_subscription(recurringOrderCopyId, params, options) {
34
+ const _recurringOrderCopyId = recurringOrderCopyId.id || recurringOrderCopyId;
35
+ return this.resources.fetch({ type: 'order_subscriptions' }, `recurring_order_copies/${_recurringOrderCopyId}/order_subscription`, params, options);
36
+ }
37
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
38
+ isRecurringOrderCopy(resource) {
39
+ return resource.type && (resource.type === RecurringOrderCopies.TYPE);
40
+ }
41
+ relationship(id) {
42
+ return ((id === null) || (typeof id === 'string')) ? { id, type: RecurringOrderCopies.TYPE } : { id: id.id, type: RecurringOrderCopies.TYPE };
43
+ }
44
+ type() {
45
+ return RecurringOrderCopies.TYPE;
46
+ }
47
+ }
48
+ RecurringOrderCopies.TYPE = 'recurring_order_copies';
49
+ exports.default = RecurringOrderCopies;
@@ -0,0 +1,48 @@
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import type { Market } from './markets';
4
+ import type { OrderSubscription } from './order_subscriptions';
5
+ import type { Attachment } from './attachments';
6
+ type SubscriptionModelRel = ResourceRel & {
7
+ type: typeof SubscriptionModels.TYPE;
8
+ };
9
+ interface SubscriptionModel extends Resource {
10
+ name?: string;
11
+ strategy?: string;
12
+ frequencies?: string[];
13
+ auto_activate?: boolean;
14
+ auto_cancel?: boolean;
15
+ markets?: Market[];
16
+ order_subscriptions?: OrderSubscription[];
17
+ attachments?: Attachment[];
18
+ }
19
+ interface SubscriptionModelCreate extends ResourceCreate {
20
+ name: string;
21
+ strategy?: string;
22
+ frequencies: string[];
23
+ auto_activate?: boolean;
24
+ auto_cancel?: boolean;
25
+ }
26
+ interface SubscriptionModelUpdate extends ResourceUpdate {
27
+ name?: string;
28
+ strategy?: string;
29
+ frequencies?: string[];
30
+ auto_activate?: boolean;
31
+ auto_cancel?: boolean;
32
+ }
33
+ declare class SubscriptionModels extends ApiResource {
34
+ static readonly TYPE: 'subscription_models';
35
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<SubscriptionModel>>;
36
+ create(resource: SubscriptionModelCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SubscriptionModel>;
37
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SubscriptionModel>;
38
+ update(resource: SubscriptionModelUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SubscriptionModel>;
39
+ delete(id: string, 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(): string;
46
+ }
47
+ export default SubscriptionModels;
48
+ export { SubscriptionModel, SubscriptionModelCreate, SubscriptionModelUpdate };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const resource_1 = require("../resource");
4
+ class SubscriptionModels extends resource_1.ApiResource {
5
+ // static readonly PATH = 'subscription_models'
6
+ async list(params, options) {
7
+ return this.resources.list({ type: SubscriptionModels.TYPE }, params, options);
8
+ }
9
+ async create(resource, params, options) {
10
+ return this.resources.create(Object.assign(Object.assign({}, resource), { type: SubscriptionModels.TYPE }), params, options);
11
+ }
12
+ async retrieve(id, params, options) {
13
+ return this.resources.retrieve({ type: SubscriptionModels.TYPE, id }, params, options);
14
+ }
15
+ async update(resource, params, options) {
16
+ return this.resources.update(Object.assign(Object.assign({}, resource), { type: SubscriptionModels.TYPE }), params, options);
17
+ }
18
+ async delete(id, options) {
19
+ await this.resources.delete({ type: SubscriptionModels.TYPE, id }, options);
20
+ }
21
+ async markets(subscriptionModelId, params, options) {
22
+ const _subscriptionModelId = subscriptionModelId.id || subscriptionModelId;
23
+ return this.resources.fetch({ type: 'markets' }, `subscription_models/${_subscriptionModelId}/markets`, params, options);
24
+ }
25
+ async order_subscriptions(subscriptionModelId, params, options) {
26
+ const _subscriptionModelId = subscriptionModelId.id || subscriptionModelId;
27
+ return this.resources.fetch({ type: 'order_subscriptions' }, `subscription_models/${_subscriptionModelId}/order_subscriptions`, params, options);
28
+ }
29
+ async attachments(subscriptionModelId, params, options) {
30
+ const _subscriptionModelId = subscriptionModelId.id || subscriptionModelId;
31
+ return this.resources.fetch({ type: 'attachments' }, `subscription_models/${_subscriptionModelId}/attachments`, params, options);
32
+ }
33
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
34
+ isSubscriptionModel(resource) {
35
+ return resource.type && (resource.type === SubscriptionModels.TYPE);
36
+ }
37
+ relationship(id) {
38
+ return ((id === null) || (typeof id === 'string')) ? { id, type: SubscriptionModels.TYPE } : { id: id.id, type: SubscriptionModels.TYPE };
39
+ }
40
+ type() {
41
+ return SubscriptionModels.TYPE;
42
+ }
43
+ }
44
+ SubscriptionModels.TYPE = 'subscription_models';
45
+ 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,5 +114,5 @@ 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"];
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 { ApiError } from './error';
3
3
  import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
4
4
  import { ResourcesInitConfig } from './resource';
5
- declare const OPEN_API_SCHEMA_VERSION = "4.0.1";
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.0.1";
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;
@@ -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.0.1';
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"));
@@ -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';
@@ -6,9 +6,9 @@ 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
  import type { SkuList } from './sku_lists';
10
11
  import type { Sku } from './skus';
11
- import type { Event } from './events';
12
12
  type FixedPricePromotionRel = ResourceRel & {
13
13
  type: typeof FixedPricePromotions.TYPE;
14
14
  };
@@ -47,9 +47,9 @@ interface FixedPricePromotion extends Resource {
47
47
  sku_list_promotion_rule?: SkuListPromotionRule;
48
48
  coupon_codes_promotion_rule?: CouponCodesPromotionRule;
49
49
  attachments?: Attachment[];
50
+ events?: Event[];
50
51
  sku_list?: SkuList;
51
52
  skus?: Sku[];
52
- events?: Event[];
53
53
  }
54
54
  interface FixedPricePromotionCreate extends ResourceCreate {
55
55
  name: string;
@@ -91,9 +91,9 @@ declare class FixedPricePromotions extends ApiResource {
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(): string;
@@ -36,6 +36,10 @@ class FixedPricePromotions extends ApiResource {
36
36
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
37
37
  return this.resources.fetch({ type: 'attachments' }, `fixed_price_promotions/${_fixedPricePromotionId}/attachments`, params, options);
38
38
  }
39
+ async events(fixedPricePromotionId, params, options) {
40
+ const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
41
+ return this.resources.fetch({ type: 'events' }, `fixed_price_promotions/${_fixedPricePromotionId}/events`, params, options);
42
+ }
39
43
  async sku_list(fixedPricePromotionId, params, options) {
40
44
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
41
45
  return this.resources.fetch({ type: 'sku_lists' }, `fixed_price_promotions/${_fixedPricePromotionId}/sku_list`, params, options);
@@ -44,10 +48,6 @@ class FixedPricePromotions extends ApiResource {
44
48
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
45
49
  return this.resources.fetch({ type: 'skus' }, `fixed_price_promotions/${_fixedPricePromotionId}/skus`, params, options);
46
50
  }
47
- async events(fixedPricePromotionId, params, options) {
48
- const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
49
- return this.resources.fetch({ type: 'events' }, `fixed_price_promotions/${_fixedPricePromotionId}/events`, params, options);
50
- }
51
51
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
52
52
  isFixedPricePromotion(resource) {
53
53
  return resource.type && (resource.type === FixedPricePromotions.TYPE);
@@ -6,9 +6,9 @@ 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
  import type { SkuList } from './sku_lists';
10
11
  import type { Sku } from './skus';
11
- import type { Event } from './events';
12
12
  type FreeGiftPromotionRel = ResourceRel & {
13
13
  type: typeof FreeGiftPromotions.TYPE;
14
14
  };
@@ -45,9 +45,9 @@ interface FreeGiftPromotion extends Resource {
45
45
  sku_list_promotion_rule?: SkuListPromotionRule;
46
46
  coupon_codes_promotion_rule?: CouponCodesPromotionRule;
47
47
  attachments?: Attachment[];
48
+ events?: Event[];
48
49
  sku_list?: SkuList;
49
50
  skus?: Sku[];
50
- events?: Event[];
51
51
  }
52
52
  interface FreeGiftPromotionCreate extends ResourceCreate {
53
53
  name: string;
@@ -89,9 +89,9 @@ declare class FreeGiftPromotions extends ApiResource {
89
89
  sku_list_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
90
90
  coupon_codes_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
91
91
  attachments(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
92
+ events(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
92
93
  sku_list(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
93
94
  skus(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
94
- events(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
95
95
  isFreeGiftPromotion(resource: any): resource is FreeGiftPromotion;
96
96
  relationship(id: string | ResourceId | null): FreeGiftPromotionRel;
97
97
  type(): string;
@@ -36,6 +36,10 @@ class FreeGiftPromotions extends ApiResource {
36
36
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
37
37
  return this.resources.fetch({ type: 'attachments' }, `free_gift_promotions/${_freeGiftPromotionId}/attachments`, params, options);
38
38
  }
39
+ async events(freeGiftPromotionId, params, options) {
40
+ const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
41
+ return this.resources.fetch({ type: 'events' }, `free_gift_promotions/${_freeGiftPromotionId}/events`, params, options);
42
+ }
39
43
  async sku_list(freeGiftPromotionId, params, options) {
40
44
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
41
45
  return this.resources.fetch({ type: 'sku_lists' }, `free_gift_promotions/${_freeGiftPromotionId}/sku_list`, params, options);
@@ -44,10 +48,6 @@ class FreeGiftPromotions extends ApiResource {
44
48
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
45
49
  return this.resources.fetch({ type: 'skus' }, `free_gift_promotions/${_freeGiftPromotionId}/skus`, params, options);
46
50
  }
47
- async events(freeGiftPromotionId, params, options) {
48
- const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
49
- return this.resources.fetch({ type: 'events' }, `free_gift_promotions/${_freeGiftPromotionId}/events`, params, options);
50
- }
51
51
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
52
52
  isFreeGiftPromotion(resource) {
53
53
  return resource.type && (resource.type === FreeGiftPromotions.TYPE);
@@ -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 FreeShippingPromotionRel = ResourceRel & {
10
11
  type: typeof FreeShippingPromotions.TYPE;
11
12
  };
@@ -38,6 +39,7 @@ interface FreeShippingPromotion extends Resource {
38
39
  sku_list_promotion_rule?: SkuListPromotionRule;
39
40
  coupon_codes_promotion_rule?: CouponCodesPromotionRule;
40
41
  attachments?: Attachment[];
42
+ events?: Event[];
41
43
  }
42
44
  interface FreeShippingPromotionCreate extends ResourceCreate {
43
45
  name: string;
@@ -75,6 +77,7 @@ declare class FreeShippingPromotions extends ApiResource {
75
77
  sku_list_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
76
78
  coupon_codes_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
77
79
  attachments(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
80
+ events(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
78
81
  isFreeShippingPromotion(resource: any): resource is FreeShippingPromotion;
79
82
  relationship(id: string | ResourceId | null): FreeShippingPromotionRel;
80
83
  type(): string;
@@ -36,6 +36,10 @@ class FreeShippingPromotions extends ApiResource {
36
36
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
37
37
  return this.resources.fetch({ type: 'attachments' }, `free_shipping_promotions/${_freeShippingPromotionId}/attachments`, params, options);
38
38
  }
39
+ async events(freeShippingPromotionId, params, options) {
40
+ const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
41
+ return this.resources.fetch({ type: 'events' }, `free_shipping_promotions/${_freeShippingPromotionId}/events`, params, options);
42
+ }
39
43
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
40
44
  isFreeShippingPromotion(resource) {
41
45
  return resource.type && (resource.type === FreeShippingPromotions.TYPE);
@@ -76,6 +76,7 @@ interface LineItem extends Resource {
76
76
  tax_rate?: number;
77
77
  tax_breakdown?: object;
78
78
  item_type?: string;
79
+ frequency?: string;
79
80
  order?: Order;
80
81
  item?: Adjustment | Bundle | ExternalPromotion | FixedAmountPromotion | FreeShippingPromotion | GiftCard | PaymentMethod | PercentageDiscountPromotion | Shipment | Sku;
81
82
  line_item_options?: LineItemOption[];
@@ -96,6 +97,7 @@ interface LineItemCreate extends ResourceCreate {
96
97
  name?: string;
97
98
  image_url?: string;
98
99
  item_type?: string;
100
+ frequency?: string;
99
101
  order: OrderRel;
100
102
  item?: AdjustmentRel | BundleRel | ExternalPromotionRel | FixedAmountPromotionRel | FreeShippingPromotionRel | GiftCardRel | PaymentMethodRel | PercentageDiscountPromotionRel | ShipmentRel | SkuRel;
101
103
  }
@@ -106,6 +108,7 @@ interface LineItemUpdate extends ResourceUpdate {
106
108
  _external_price?: boolean;
107
109
  name?: string;
108
110
  image_url?: string;
111
+ frequency?: string;
109
112
  }
110
113
  declare class LineItems extends ApiResource {
111
114
  static readonly TYPE: 'line_items';