@commercelayer/sdk 4.25.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 (91) hide show
  1. package/lib/cjs/api.d.ts +9 -2
  2. package/lib/cjs/api.js +23 -2
  3. package/lib/cjs/commercelayer.d.ts +9 -2
  4. package/lib/cjs/commercelayer.js +8 -1
  5. package/lib/cjs/model.d.ts +8 -1
  6. package/lib/cjs/resources/axerve_payments.d.ts +1 -0
  7. package/lib/cjs/resources/customer_payment_sources.d.ts +7 -3
  8. package/lib/cjs/resources/fixed_price_promotions.d.ts +3 -3
  9. package/lib/cjs/resources/fixed_price_promotions.js +4 -4
  10. package/lib/cjs/resources/free_gift_promotions.d.ts +3 -3
  11. package/lib/cjs/resources/free_gift_promotions.js +4 -4
  12. package/lib/cjs/resources/free_shipping_promotions.d.ts +3 -0
  13. package/lib/cjs/resources/free_shipping_promotions.js +4 -0
  14. package/lib/cjs/resources/line_items.d.ts +3 -0
  15. package/lib/cjs/resources/markets.d.ts +8 -0
  16. package/lib/cjs/resources/markets.js +4 -0
  17. package/lib/cjs/resources/order_copies.d.ts +11 -9
  18. package/lib/cjs/resources/order_copies.js +7 -4
  19. package/lib/cjs/resources/order_factories.d.ts +33 -0
  20. package/lib/cjs/resources/order_factories.js +36 -0
  21. package/lib/cjs/resources/order_subscription_items.d.ts +60 -0
  22. package/lib/cjs/resources/order_subscription_items.js +37 -0
  23. package/lib/cjs/resources/order_subscriptions.d.ts +25 -3
  24. package/lib/cjs/resources/order_subscriptions.js +18 -2
  25. package/lib/cjs/resources/orders.d.ts +15 -3
  26. package/lib/cjs/resources/orders.js +8 -0
  27. package/lib/cjs/resources/percentage_discount_promotions.d.ts +3 -3
  28. package/lib/cjs/resources/percentage_discount_promotions.js +4 -4
  29. package/lib/cjs/resources/price_frequency_tiers.d.ts +49 -0
  30. package/lib/cjs/resources/price_frequency_tiers.js +45 -0
  31. package/lib/cjs/resources/price_volume_tiers.d.ts +3 -0
  32. package/lib/cjs/resources/price_volume_tiers.js +4 -0
  33. package/lib/cjs/resources/prices.d.ts +3 -0
  34. package/lib/cjs/resources/prices.js +4 -0
  35. package/lib/cjs/resources/promotions.d.ts +3 -0
  36. package/lib/cjs/resources/promotions.js +4 -0
  37. package/lib/cjs/resources/recurring_order_copies.d.ts +52 -0
  38. package/lib/cjs/resources/recurring_order_copies.js +49 -0
  39. package/lib/cjs/resources/satispay_gateways.d.ts +39 -0
  40. package/lib/cjs/resources/satispay_gateways.js +41 -0
  41. package/lib/cjs/resources/satispay_payments.d.ts +43 -0
  42. package/lib/cjs/resources/satispay_payments.js +41 -0
  43. package/lib/cjs/resources/subscription_models.d.ts +48 -0
  44. package/lib/cjs/resources/subscription_models.js +45 -0
  45. package/lib/esm/api.d.ts +9 -2
  46. package/lib/esm/api.js +14 -0
  47. package/lib/esm/commercelayer.d.ts +9 -2
  48. package/lib/esm/commercelayer.js +8 -1
  49. package/lib/esm/model.d.ts +8 -1
  50. package/lib/esm/resources/axerve_payments.d.ts +1 -0
  51. package/lib/esm/resources/customer_payment_sources.d.ts +7 -3
  52. package/lib/esm/resources/fixed_price_promotions.d.ts +3 -3
  53. package/lib/esm/resources/fixed_price_promotions.js +4 -4
  54. package/lib/esm/resources/free_gift_promotions.d.ts +3 -3
  55. package/lib/esm/resources/free_gift_promotions.js +4 -4
  56. package/lib/esm/resources/free_shipping_promotions.d.ts +3 -0
  57. package/lib/esm/resources/free_shipping_promotions.js +4 -0
  58. package/lib/esm/resources/line_items.d.ts +3 -0
  59. package/lib/esm/resources/markets.d.ts +8 -0
  60. package/lib/esm/resources/markets.js +4 -0
  61. package/lib/esm/resources/order_copies.d.ts +11 -9
  62. package/lib/esm/resources/order_copies.js +7 -4
  63. package/lib/esm/resources/order_factories.d.ts +33 -0
  64. package/lib/esm/resources/order_factories.js +34 -0
  65. package/lib/esm/resources/order_subscription_items.d.ts +60 -0
  66. package/lib/esm/resources/order_subscription_items.js +35 -0
  67. package/lib/esm/resources/order_subscriptions.d.ts +25 -3
  68. package/lib/esm/resources/order_subscriptions.js +18 -2
  69. package/lib/esm/resources/orders.d.ts +15 -3
  70. package/lib/esm/resources/orders.js +8 -0
  71. package/lib/esm/resources/percentage_discount_promotions.d.ts +3 -3
  72. package/lib/esm/resources/percentage_discount_promotions.js +4 -4
  73. package/lib/esm/resources/price_frequency_tiers.d.ts +49 -0
  74. package/lib/esm/resources/price_frequency_tiers.js +43 -0
  75. package/lib/esm/resources/price_volume_tiers.d.ts +3 -0
  76. package/lib/esm/resources/price_volume_tiers.js +4 -0
  77. package/lib/esm/resources/prices.d.ts +3 -0
  78. package/lib/esm/resources/prices.js +4 -0
  79. package/lib/esm/resources/promotions.d.ts +3 -0
  80. package/lib/esm/resources/promotions.js +4 -0
  81. package/lib/esm/resources/recurring_order_copies.d.ts +52 -0
  82. package/lib/esm/resources/recurring_order_copies.js +47 -0
  83. package/lib/esm/resources/satispay_gateways.d.ts +39 -0
  84. package/lib/esm/resources/satispay_gateways.js +39 -0
  85. package/lib/esm/resources/satispay_payments.d.ts +43 -0
  86. package/lib/esm/resources/satispay_payments.js +39 -0
  87. package/lib/esm/resources/subscription_models.d.ts +48 -0
  88. package/lib/esm/resources/subscription_models.js +43 -0
  89. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  90. package/lib/tsconfig.tsbuildinfo +1 -1
  91. package/package.json +7 -7
@@ -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 = "3.6.0";
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 = "3.6.0";
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,15 +85,19 @@ 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;
99
+ satispay_gateways: api.SatispayGateways;
100
+ satispay_payments: api.SatispayPayments;
95
101
  shipments: api.Shipments;
96
102
  shipping_categories: api.ShippingCategories;
97
103
  shipping_method_tiers: api.ShippingMethodTiers;
@@ -109,6 +115,7 @@ declare class CommerceLayerClient {
109
115
  stock_transfers: api.StockTransfers;
110
116
  stripe_gateways: api.StripeGateways;
111
117
  stripe_payments: api.StripePayments;
118
+ subscription_models: api.SubscriptionModels;
112
119
  tax_calculators: api.TaxCalculators;
113
120
  tax_categories: api.TaxCategories;
114
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 = '3.6.0';
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,15 +104,19 @@ 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"));
118
+ this.satispay_gateways = new api.SatispayGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
119
+ this.satispay_payments = new api.SatispayPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
114
120
  this.shipments = new api.Shipments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
115
121
  this.shipping_categories = new api.ShippingCategories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
116
122
  this.shipping_method_tiers = new api.ShippingMethodTiers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
@@ -128,6 +134,7 @@ class CommerceLayerClient {
128
134
  this.stock_transfers = new api.StockTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
129
135
  this.stripe_gateways = new api.StripeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
130
136
  this.stripe_payments = new api.StripePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
137
+ this.subscription_models = new api.SubscriptionModels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
131
138
  this.tax_calculators = new api.TaxCalculators(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
132
139
  this.tax_categories = new api.TaxCategories(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
133
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,15 +75,19 @@ 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';
89
+ export type { SatispayGateway, SatispayGatewayCreate, SatispayGatewayUpdate } from './resources/satispay_gateways';
90
+ export type { SatispayPayment, SatispayPaymentCreate, SatispayPaymentUpdate } from './resources/satispay_payments';
85
91
  export type { Shipment, ShipmentUpdate } from './resources/shipments';
86
92
  export type { ShippingCategory, ShippingCategoryCreate, ShippingCategoryUpdate } from './resources/shipping_categories';
87
93
  export type { ShippingMethodTier } from './resources/shipping_method_tiers';
@@ -99,6 +105,7 @@ export type { StockLocation, StockLocationCreate, StockLocationUpdate } from './
99
105
  export type { StockTransfer, StockTransferCreate, StockTransferUpdate } from './resources/stock_transfers';
100
106
  export type { StripeGateway, StripeGatewayCreate, StripeGatewayUpdate } from './resources/stripe_gateways';
101
107
  export type { StripePayment, StripePaymentCreate, StripePaymentUpdate } from './resources/stripe_payments';
108
+ export type { SubscriptionModel, SubscriptionModelCreate, SubscriptionModelUpdate } from './resources/subscription_models';
102
109
  export type { TaxCalculator } from './resources/tax_calculators';
103
110
  export type { TaxCategory, TaxCategoryCreate, TaxCategoryUpdate } from './resources/tax_categories';
104
111
  export type { TaxRule, TaxRuleCreate, TaxRuleUpdate } from './resources/tax_rules';
@@ -9,6 +9,7 @@ type OrderRel = ResourceRel & {
9
9
  type: 'orders';
10
10
  };
11
11
  interface AxervePayment extends Resource {
12
+ login?: string;
12
13
  return_url?: string;
13
14
  payment_request_data?: object;
14
15
  mismatched_amounts?: boolean;
@@ -8,6 +8,7 @@ import type { CheckoutComPayment } from './checkout_com_payments';
8
8
  import type { ExternalPayment } from './external_payments';
9
9
  import type { KlarnaPayment } from './klarna_payments';
10
10
  import type { PaypalPayment } from './paypal_payments';
11
+ import type { SatispayPayment } from './satispay_payments';
11
12
  import type { StripePayment } from './stripe_payments';
12
13
  import type { WireTransfer } from './wire_transfers';
13
14
  type CustomerPaymentSourceRel = ResourceRel & {
@@ -37,6 +38,9 @@ type KlarnaPaymentRel = ResourceRel & {
37
38
  type PaypalPaymentRel = ResourceRel & {
38
39
  type: 'paypal_payments';
39
40
  };
41
+ type SatispayPaymentRel = ResourceRel & {
42
+ type: 'satispay_payments';
43
+ };
40
44
  type StripePaymentRel = ResourceRel & {
41
45
  type: 'stripe_payments';
42
46
  };
@@ -48,15 +52,15 @@ interface CustomerPaymentSource extends Resource {
48
52
  customer_token?: string;
49
53
  payment_source_token?: string;
50
54
  customer?: Customer;
51
- payment_source?: AdyenPayment | AxervePayment | BraintreePayment | CheckoutComPayment | ExternalPayment | KlarnaPayment | PaypalPayment | StripePayment | WireTransfer;
55
+ payment_source?: AdyenPayment | AxervePayment | BraintreePayment | CheckoutComPayment | ExternalPayment | KlarnaPayment | PaypalPayment | SatispayPayment | StripePayment | WireTransfer;
52
56
  }
53
57
  interface CustomerPaymentSourceCreate extends ResourceCreate {
54
58
  customer: CustomerRel;
55
- payment_source: AdyenPaymentRel | AxervePaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | PaypalPaymentRel | StripePaymentRel | WireTransferRel;
59
+ payment_source: AdyenPaymentRel | AxervePaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | PaypalPaymentRel | SatispayPaymentRel | StripePaymentRel | WireTransferRel;
56
60
  }
57
61
  interface CustomerPaymentSourceUpdate extends ResourceUpdate {
58
62
  customer?: CustomerRel;
59
- payment_source?: AdyenPaymentRel | AxervePaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | PaypalPaymentRel | StripePaymentRel | WireTransferRel;
63
+ payment_source?: AdyenPaymentRel | AxervePaymentRel | BraintreePaymentRel | CheckoutComPaymentRel | ExternalPaymentRel | KlarnaPaymentRel | PaypalPaymentRel | SatispayPaymentRel | StripePaymentRel | WireTransferRel;
60
64
  }
61
65
  declare class CustomerPaymentSources extends ApiResource {
62
66
  static readonly TYPE: 'customer_payment_sources';
@@ -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';
@@ -3,6 +3,7 @@ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import type { Merchant } from './merchants';
4
4
  import type { PriceList } from './price_lists';
5
5
  import type { InventoryModel } from './inventory_models';
6
+ import type { SubscriptionModel } from './subscription_models';
6
7
  import type { TaxCalculator } from './tax_calculators';
7
8
  import type { CustomerGroup } from './customer_groups';
8
9
  import type { Attachment } from './attachments';
@@ -18,6 +19,9 @@ type PriceListRel = ResourceRel & {
18
19
  type InventoryModelRel = ResourceRel & {
19
20
  type: 'inventory_models';
20
21
  };
22
+ type SubscriptionModelRel = ResourceRel & {
23
+ type: 'subscription_models';
24
+ };
21
25
  type TaxCalculatorRel = ResourceRel & {
22
26
  type: 'tax_calculators';
23
27
  };
@@ -37,6 +41,7 @@ interface Market extends Resource {
37
41
  merchant?: Merchant;
38
42
  price_list?: PriceList;
39
43
  inventory_model?: InventoryModel;
44
+ subscription_model?: SubscriptionModel;
40
45
  tax_calculator?: TaxCalculator;
41
46
  customer_group?: CustomerGroup;
42
47
  attachments?: Attachment[];
@@ -50,6 +55,7 @@ interface MarketCreate extends ResourceCreate {
50
55
  merchant: MerchantRel;
51
56
  price_list: PriceListRel;
52
57
  inventory_model: InventoryModelRel;
58
+ subscription_model?: SubscriptionModelRel;
53
59
  tax_calculator?: TaxCalculatorRel;
54
60
  customer_group?: CustomerGroupRel;
55
61
  }
@@ -64,6 +70,7 @@ interface MarketUpdate extends ResourceUpdate {
64
70
  merchant?: MerchantRel;
65
71
  price_list?: PriceListRel;
66
72
  inventory_model?: InventoryModelRel;
73
+ subscription_model?: SubscriptionModelRel;
67
74
  tax_calculator?: TaxCalculatorRel;
68
75
  customer_group?: CustomerGroupRel;
69
76
  }
@@ -77,6 +84,7 @@ declare class Markets extends ApiResource {
77
84
  merchant(marketId: string | Market, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Merchant>;
78
85
  price_list(marketId: string | Market, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PriceList>;
79
86
  inventory_model(marketId: string | Market, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InventoryModel>;
87
+ subscription_model(marketId: string | Market, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SubscriptionModel>;
80
88
  tax_calculator(marketId: string | Market, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxCalculator>;
81
89
  customer_group(marketId: string | Market, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerGroup>;
82
90
  attachments(marketId: string | Market, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
@@ -28,6 +28,10 @@ class Markets extends ApiResource {
28
28
  const _marketId = marketId.id || marketId;
29
29
  return this.resources.fetch({ type: 'inventory_models' }, `markets/${_marketId}/inventory_model`, params, options);
30
30
  }
31
+ async subscription_model(marketId, params, options) {
32
+ const _marketId = marketId.id || marketId;
33
+ return this.resources.fetch({ type: 'subscription_models' }, `markets/${_marketId}/subscription_model`, params, options);
34
+ }
31
35
  async tax_calculator(marketId, params, options) {
32
36
  const _marketId = marketId.id || marketId;
33
37
  return this.resources.fetch({ type: 'tax_calculators' }, `markets/${_marketId}/tax_calculator`, params, options);
@@ -1,8 +1,8 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
2
  import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
3
  import type { Order } from './orders';
4
- import type { OrderSubscription } from './order_subscriptions';
5
4
  import type { Event } from './events';
5
+ import type { OrderSubscription } from './order_subscriptions';
6
6
  type OrderCopyRel = ResourceRel & {
7
7
  type: typeof OrderCopies.TYPE;
8
8
  };
@@ -14,35 +14,37 @@ interface OrderCopy extends Resource {
14
14
  started_at?: string;
15
15
  completed_at?: string;
16
16
  failed_at?: string;
17
- place_target_order?: boolean;
18
- cancel_source_order?: boolean;
19
- reuse_wallet?: boolean;
20
17
  errors_log?: object;
21
18
  errors_count?: number;
19
+ place_target_order?: boolean;
20
+ reuse_wallet?: boolean;
21
+ cancel_source_order?: boolean;
22
22
  source_order?: Order;
23
23
  target_order?: Order;
24
- order_subscription?: OrderSubscription;
25
24
  events?: Event[];
25
+ order_subscription?: OrderSubscription;
26
26
  }
27
27
  interface OrderCopyCreate extends ResourceCreate {
28
28
  place_target_order?: boolean;
29
- cancel_source_order?: boolean;
30
29
  reuse_wallet?: boolean;
30
+ cancel_source_order?: boolean;
31
31
  source_order: OrderRel;
32
32
  }
33
+ type OrderCopyUpdate = ResourceUpdate;
33
34
  declare class OrderCopies extends ApiResource {
34
35
  static readonly TYPE: 'order_copies';
35
36
  list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderCopy>>;
36
37
  create(resource: OrderCopyCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderCopy>;
37
38
  retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderCopy>;
39
+ update(resource: OrderCopyUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderCopy>;
38
40
  delete(id: string, options?: ResourcesConfig): Promise<void>;
39
41
  source_order(orderCopyId: string | OrderCopy, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
40
42
  target_order(orderCopyId: string | OrderCopy, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
41
- order_subscription(orderCopyId: string | OrderCopy, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderSubscription>;
42
43
  events(orderCopyId: string | OrderCopy, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
44
+ order_subscription(orderCopyId: string | OrderCopy, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderSubscription>;
43
45
  isOrderCopy(resource: any): resource is OrderCopy;
44
46
  relationship(id: string | ResourceId | null): OrderCopyRel;
45
47
  type(): string;
46
48
  }
47
49
  export default OrderCopies;
48
- export { OrderCopy, OrderCopyCreate };
50
+ export { OrderCopy, OrderCopyCreate, OrderCopyUpdate };
@@ -10,6 +10,9 @@ class OrderCopies extends ApiResource {
10
10
  async retrieve(id, params, options) {
11
11
  return this.resources.retrieve({ type: OrderCopies.TYPE, id }, params, options);
12
12
  }
13
+ async update(resource, params, options) {
14
+ return this.resources.update(Object.assign(Object.assign({}, resource), { type: OrderCopies.TYPE }), params, options);
15
+ }
13
16
  async delete(id, options) {
14
17
  await this.resources.delete({ type: OrderCopies.TYPE, id }, options);
15
18
  }
@@ -21,14 +24,14 @@ class OrderCopies extends ApiResource {
21
24
  const _orderCopyId = orderCopyId.id || orderCopyId;
22
25
  return this.resources.fetch({ type: 'orders' }, `order_copies/${_orderCopyId}/target_order`, params, options);
23
26
  }
24
- async order_subscription(orderCopyId, params, options) {
25
- const _orderCopyId = orderCopyId.id || orderCopyId;
26
- return this.resources.fetch({ type: 'order_subscriptions' }, `order_copies/${_orderCopyId}/order_subscription`, params, options);
27
- }
28
27
  async events(orderCopyId, params, options) {
29
28
  const _orderCopyId = orderCopyId.id || orderCopyId;
30
29
  return this.resources.fetch({ type: 'events' }, `order_copies/${_orderCopyId}/events`, params, options);
31
30
  }
31
+ async order_subscription(orderCopyId, params, options) {
32
+ const _orderCopyId = orderCopyId.id || orderCopyId;
33
+ return this.resources.fetch({ type: 'order_subscriptions' }, `order_copies/${_orderCopyId}/order_subscription`, params, options);
34
+ }
32
35
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
33
36
  isOrderCopy(resource) {
34
37
  return resource.type && (resource.type === OrderCopies.TYPE);
@@ -0,0 +1,33 @@
1
+ import { ApiResource, Resource, 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
+ type OrderFactoryRel = ResourceRel & {
6
+ type: typeof OrderFactories.TYPE;
7
+ };
8
+ interface OrderFactory extends Resource {
9
+ status?: string;
10
+ started_at?: string;
11
+ completed_at?: string;
12
+ failed_at?: string;
13
+ errors_log?: object;
14
+ errors_count?: number;
15
+ place_target_order?: boolean;
16
+ reuse_wallet?: boolean;
17
+ source_order?: Order;
18
+ target_order?: Order;
19
+ events?: Event[];
20
+ }
21
+ declare class OrderFactories extends ApiResource {
22
+ static readonly TYPE: 'order_factories';
23
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderFactory>>;
24
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderFactory>;
25
+ source_order(orderFactoryId: string | OrderFactory, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
26
+ target_order(orderFactoryId: string | OrderFactory, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
27
+ events(orderFactoryId: string | OrderFactory, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
28
+ isOrderFactory(resource: any): resource is OrderFactory;
29
+ relationship(id: string | ResourceId | null): OrderFactoryRel;
30
+ type(): string;
31
+ }
32
+ export default OrderFactories;
33
+ export { OrderFactory };
@@ -0,0 +1,34 @@
1
+ import { ApiResource } from '../resource';
2
+ class OrderFactories extends ApiResource {
3
+ // static readonly PATH = 'order_factories'
4
+ async list(params, options) {
5
+ return this.resources.list({ type: OrderFactories.TYPE }, params, options);
6
+ }
7
+ async retrieve(id, params, options) {
8
+ return this.resources.retrieve({ type: OrderFactories.TYPE, id }, params, options);
9
+ }
10
+ async source_order(orderFactoryId, params, options) {
11
+ const _orderFactoryId = orderFactoryId.id || orderFactoryId;
12
+ return this.resources.fetch({ type: 'orders' }, `order_factories/${_orderFactoryId}/source_order`, params, options);
13
+ }
14
+ async target_order(orderFactoryId, params, options) {
15
+ const _orderFactoryId = orderFactoryId.id || orderFactoryId;
16
+ return this.resources.fetch({ type: 'orders' }, `order_factories/${_orderFactoryId}/target_order`, params, options);
17
+ }
18
+ async events(orderFactoryId, params, options) {
19
+ const _orderFactoryId = orderFactoryId.id || orderFactoryId;
20
+ return this.resources.fetch({ type: 'events' }, `order_factories/${_orderFactoryId}/events`, params, options);
21
+ }
22
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
23
+ isOrderFactory(resource) {
24
+ return resource.type && (resource.type === OrderFactories.TYPE);
25
+ }
26
+ relationship(id) {
27
+ return ((id === null) || (typeof id === 'string')) ? { id, type: OrderFactories.TYPE } : { id: id.id, type: OrderFactories.TYPE };
28
+ }
29
+ type() {
30
+ return OrderFactories.TYPE;
31
+ }
32
+ }
33
+ OrderFactories.TYPE = 'order_factories';
34
+ export default OrderFactories;
@@ -0,0 +1,60 @@
1
+ import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
+ import type { QueryParamsList, QueryParamsRetrieve } from '../query';
3
+ import type { OrderSubscription } from './order_subscriptions';
4
+ import type { Adjustment } from './adjustments';
5
+ import type { Bundle } from './bundles';
6
+ import type { Sku } from './skus';
7
+ type OrderSubscriptionItemRel = ResourceRel & {
8
+ type: typeof OrderSubscriptionItems.TYPE;
9
+ };
10
+ type OrderSubscriptionRel = ResourceRel & {
11
+ type: 'order_subscriptions';
12
+ };
13
+ type AdjustmentRel = ResourceRel & {
14
+ type: 'adjustments';
15
+ };
16
+ type BundleRel = ResourceRel & {
17
+ type: 'bundles';
18
+ };
19
+ type SkuRel = ResourceRel & {
20
+ type: 'skus';
21
+ };
22
+ interface OrderSubscriptionItem extends Resource {
23
+ quantity?: number;
24
+ unit_amount_cents?: number;
25
+ unit_amount_float?: number;
26
+ formatted_unit_amount?: string;
27
+ total_amount_cents?: number;
28
+ total_amount_float?: number;
29
+ formatted_total_amount?: string;
30
+ order_subscription?: OrderSubscription;
31
+ item?: Adjustment | Bundle | Sku;
32
+ }
33
+ interface OrderSubscriptionItemCreate extends ResourceCreate {
34
+ sku_code?: string;
35
+ bundle_code?: string;
36
+ quantity: number;
37
+ unit_amount_cents?: number;
38
+ order_subscription: OrderSubscriptionRel;
39
+ item: AdjustmentRel | BundleRel | SkuRel;
40
+ }
41
+ interface OrderSubscriptionItemUpdate extends ResourceUpdate {
42
+ sku_code?: string;
43
+ bundle_code?: string;
44
+ quantity?: number;
45
+ unit_amount_cents?: number;
46
+ }
47
+ declare class OrderSubscriptionItems extends ApiResource {
48
+ static readonly TYPE: 'order_subscription_items';
49
+ list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderSubscriptionItem>>;
50
+ create(resource: OrderSubscriptionItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderSubscriptionItem>;
51
+ retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderSubscriptionItem>;
52
+ update(resource: OrderSubscriptionItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderSubscriptionItem>;
53
+ delete(id: string, options?: ResourcesConfig): Promise<void>;
54
+ order_subscription(orderSubscriptionItemId: string | OrderSubscriptionItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderSubscription>;
55
+ isOrderSubscriptionItem(resource: any): resource is OrderSubscriptionItem;
56
+ relationship(id: string | ResourceId | null): OrderSubscriptionItemRel;
57
+ type(): string;
58
+ }
59
+ export default OrderSubscriptionItems;
60
+ export { OrderSubscriptionItem, OrderSubscriptionItemCreate, OrderSubscriptionItemUpdate };