chargebee 3.13.0 → 3.15.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 (57) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/README.md +24 -0
  3. package/cjs/RequestWrapper.js +12 -8
  4. package/cjs/chargebee.cjs.js +1 -5
  5. package/cjs/coreCommon.js +5 -5
  6. package/cjs/createChargebee.js +2 -1
  7. package/cjs/environment.js +1 -1
  8. package/cjs/net/ClientInterface.js +2 -21
  9. package/cjs/net/FetchClient.js +9 -39
  10. package/cjs/resources/api_endpoints.js +66 -0
  11. package/esm/RequestWrapper.js +12 -8
  12. package/esm/chargebee.esm.js +1 -5
  13. package/esm/coreCommon.js +5 -5
  14. package/esm/createChargebee.js +2 -1
  15. package/esm/environment.js +1 -1
  16. package/esm/net/ClientInterface.js +1 -19
  17. package/esm/net/FetchClient.js +9 -38
  18. package/esm/resources/api_endpoints.js +66 -0
  19. package/package.json +1 -1
  20. package/types/core.d.ts +10 -1
  21. package/types/index.d.ts +79 -63
  22. package/types/resources/Comment.d.ts +0 -9
  23. package/types/resources/Content.d.ts +4 -0
  24. package/types/resources/CreditNote.d.ts +5 -1
  25. package/types/resources/CreditNoteEstimate.d.ts +32 -31
  26. package/types/resources/Currency.d.ts +11 -5
  27. package/types/resources/Customer.d.ts +2 -1
  28. package/types/resources/Entitlement.d.ts +1 -1
  29. package/types/resources/EntitlementOverride.d.ts +1 -1
  30. package/types/resources/Estimate.d.ts +2 -0
  31. package/types/resources/Event.d.ts +3 -0
  32. package/types/resources/GatewayErrorDetail.d.ts +1 -0
  33. package/types/resources/HostedPage.d.ts +2 -0
  34. package/types/resources/Invoice.d.ts +29 -1
  35. package/types/resources/InvoiceEstimate.d.ts +43 -42
  36. package/types/resources/OfferEvent.d.ts +25 -0
  37. package/types/resources/OfferFulfillment.d.ts +77 -0
  38. package/types/resources/OmnichannelOneTimeOrder.d.ts +1 -13
  39. package/types/resources/OmnichannelSubscription.d.ts +13 -12
  40. package/types/resources/OmnichannelSubscriptionItem.d.ts +1 -0
  41. package/types/resources/OmnichannelSubscriptionItemOffer.d.ts +22 -0
  42. package/types/resources/OmnichannelTransaction.d.ts +13 -0
  43. package/types/resources/Order.d.ts +0 -1
  44. package/types/resources/PaymentIntent.d.ts +42 -0
  45. package/types/resources/PersonalizedOffer.d.ts +64 -0
  46. package/types/resources/Quote.d.ts +35 -33
  47. package/types/resources/QuoteLineGroup.d.ts +22 -21
  48. package/types/resources/Ramp.d.ts +46 -0
  49. package/types/resources/SalesOrder.d.ts +2 -2
  50. package/types/resources/Subscription.d.ts +1 -1
  51. package/types/resources/SubscriptionEntitlement.d.ts +1 -1
  52. package/types/resources/SubscriptionEstimate.d.ts +0 -1
  53. package/types/resources/Transaction.d.ts +5 -1
  54. package/types/resources/UsageFile.d.ts +2 -0
  55. package/types/resources/WebhookEvent.d.ts +17 -0
  56. package/cjs/net/NodeClient.js +0 -61
  57. package/esm/net/NodeClient.js +0 -56
@@ -42,11 +42,11 @@ declare module 'chargebee' {
42
42
  updated_at?: number;
43
43
  vat_number_prefix?: string;
44
44
  line_items?: Quote.LineItem[];
45
- discounts?: Quote.Discount[];
45
+ line_item_tiers?: Quote.LineItemTier[];
46
46
  line_item_discounts?: Quote.LineItemDiscount[];
47
- taxes?: Quote.Tax[];
48
47
  line_item_taxes?: Quote.LineItemTax[];
49
- line_item_tiers?: Quote.LineItemTier[];
48
+ discounts?: Quote.Discount[];
49
+ taxes?: Quote.Tax[];
50
50
  tax_category?: string;
51
51
  currency_code: string;
52
52
  notes?: any;
@@ -351,19 +351,18 @@ declare module 'chargebee' {
351
351
  entity_id?: string;
352
352
  customer_id?: string;
353
353
  }
354
- export interface Discount {
355
- amount: number;
356
- description?: string;
357
- entity_type:
358
- | 'item_level_coupon'
359
- | 'document_level_coupon'
360
- | 'promotional_credits'
361
- | 'prorated_credits'
362
- | 'item_level_discount'
363
- | 'document_level_discount';
364
- discount_type?: 'fixed_amount' | 'percentage';
365
- entity_id?: string;
366
- coupon_set_code?: string;
354
+ export interface LineItemTier {
355
+ line_item_id?: string;
356
+ starting_unit: number;
357
+ ending_unit?: number;
358
+ quantity_used: number;
359
+ unit_amount: number;
360
+ starting_unit_in_decimal?: string;
361
+ ending_unit_in_decimal?: string;
362
+ quantity_used_in_decimal?: string;
363
+ unit_amount_in_decimal?: string;
364
+ pricing_type?: 'per_unit' | 'flat_fee' | 'package';
365
+ package_size?: number;
367
366
  }
368
367
  export interface LineItemDiscount {
369
368
  line_item_id: string;
@@ -378,11 +377,6 @@ declare module 'chargebee' {
378
377
  entity_id?: string;
379
378
  discount_amount: number;
380
379
  }
381
- export interface Tax {
382
- name: string;
383
- amount: number;
384
- description?: string;
385
- }
386
380
  export interface LineItemTax {
387
381
  line_item_id?: string;
388
382
  tax_name: string;
@@ -408,18 +402,25 @@ declare module 'chargebee' {
408
402
  tax_amount_in_local_currency?: number;
409
403
  local_currency_code?: string;
410
404
  }
411
- export interface LineItemTier {
405
+ export interface Discount {
406
+ amount: number;
407
+ description?: string;
412
408
  line_item_id?: string;
413
- starting_unit: number;
414
- ending_unit?: number;
415
- quantity_used: number;
416
- unit_amount: number;
417
- starting_unit_in_decimal?: string;
418
- ending_unit_in_decimal?: string;
419
- quantity_used_in_decimal?: string;
420
- unit_amount_in_decimal?: string;
421
- pricing_type?: 'per_unit' | 'flat_fee' | 'package';
422
- package_size?: number;
409
+ entity_type:
410
+ | 'item_level_coupon'
411
+ | 'document_level_coupon'
412
+ | 'promotional_credits'
413
+ | 'prorated_credits'
414
+ | 'item_level_discount'
415
+ | 'document_level_discount';
416
+ discount_type?: 'fixed_amount' | 'percentage';
417
+ entity_id?: string;
418
+ coupon_set_code?: string;
419
+ }
420
+ export interface Tax {
421
+ name: string;
422
+ amount: number;
423
+ description?: string;
423
424
  }
424
425
  export interface ShippingAddress {
425
426
  first_name?: string;
@@ -436,7 +437,6 @@ declare module 'chargebee' {
436
437
  country?: string;
437
438
  zip?: string;
438
439
  validation_status?: ValidationStatusEnum;
439
- index: number;
440
440
  }
441
441
  export interface BillingAddress {
442
442
  first_name?: string;
@@ -1118,6 +1118,7 @@ declare module 'chargebee' {
1118
1118
  */
1119
1119
  setup_fee?: number;
1120
1120
  start_date?: number;
1121
+ offline_payment_method?: OfflinePaymentMethodEnum;
1121
1122
  contract_term_billing_cycle_on_renewal?: number;
1122
1123
  }
1123
1124
 
@@ -1216,6 +1217,7 @@ declare module 'chargebee' {
1216
1217
  */
1217
1218
  setup_fee?: number;
1218
1219
  start_date?: number;
1220
+ offline_payment_method?: OfflinePaymentMethodEnum;
1219
1221
  contract_term_billing_cycle_on_renewal?: number;
1220
1222
  }
1221
1223
 
@@ -19,10 +19,10 @@ declare module 'chargebee' {
19
19
  | 'subscription_cancel';
20
20
  billing_cycle_number?: number;
21
21
  line_items?: QuoteLineGroup.LineItem[];
22
- discounts?: QuoteLineGroup.Discount[];
23
22
  line_item_discounts?: QuoteLineGroup.LineItemDiscount[];
24
- taxes?: QuoteLineGroup.Tax[];
25
23
  line_item_taxes?: QuoteLineGroup.LineItemTax[];
24
+ discounts?: QuoteLineGroup.Discount[];
25
+ taxes?: QuoteLineGroup.Tax[];
26
26
  }
27
27
 
28
28
  export namespace QuoteLineGroup {
@@ -75,20 +75,6 @@ declare module 'chargebee' {
75
75
  entity_id?: string;
76
76
  customer_id?: string;
77
77
  }
78
- export interface Discount {
79
- amount: number;
80
- description?: string;
81
- entity_type:
82
- | 'item_level_coupon'
83
- | 'document_level_coupon'
84
- | 'promotional_credits'
85
- | 'prorated_credits'
86
- | 'item_level_discount'
87
- | 'document_level_discount';
88
- discount_type?: 'fixed_amount' | 'percentage';
89
- entity_id?: string;
90
- coupon_set_code?: string;
91
- }
92
78
  export interface LineItemDiscount {
93
79
  line_item_id: string;
94
80
  discount_type:
@@ -102,11 +88,6 @@ declare module 'chargebee' {
102
88
  entity_id?: string;
103
89
  discount_amount: number;
104
90
  }
105
- export interface Tax {
106
- name: string;
107
- amount: number;
108
- description?: string;
109
- }
110
91
  export interface LineItemTax {
111
92
  line_item_id?: string;
112
93
  tax_name: string;
@@ -132,6 +113,26 @@ declare module 'chargebee' {
132
113
  tax_amount_in_local_currency?: number;
133
114
  local_currency_code?: string;
134
115
  }
116
+ export interface Discount {
117
+ amount: number;
118
+ description?: string;
119
+ line_item_id?: string;
120
+ entity_type:
121
+ | 'item_level_coupon'
122
+ | 'document_level_coupon'
123
+ | 'promotional_credits'
124
+ | 'prorated_credits'
125
+ | 'item_level_discount'
126
+ | 'document_level_discount';
127
+ discount_type?: 'fixed_amount' | 'percentage';
128
+ entity_id?: string;
129
+ coupon_set_code?: string;
130
+ }
131
+ export interface Tax {
132
+ name: string;
133
+ amount: number;
134
+ description?: string;
135
+ }
135
136
  // REQUEST PARAMS
136
137
  //---------------
137
138
  }
@@ -19,6 +19,7 @@ declare module 'chargebee' {
19
19
  items_to_remove?: string[];
20
20
  coupons_to_remove?: string[];
21
21
  discounts_to_remove?: string[];
22
+ contract_term?: Ramp.ContractTerm;
22
23
  deleted: boolean;
23
24
  status_transition_reason?: Ramp.StatusTransitionReason;
24
25
  }
@@ -88,6 +89,13 @@ declare module 'chargebee' {
88
89
  billing_cycles?: number;
89
90
  service_period_days?: number;
90
91
  metered_quantity?: string;
92
+ charge_once?: boolean;
93
+ charge_on_option?: 'immediately' | 'on_event';
94
+ charge_on_event?:
95
+ | 'subscription_trial_start'
96
+ | 'plan_activation'
97
+ | 'subscription_activation'
98
+ | 'contract_termination';
91
99
  }
92
100
  export interface ItemsToUpdate {
93
101
  item_price_id: string;
@@ -103,6 +111,13 @@ declare module 'chargebee' {
103
111
  billing_cycles?: number;
104
112
  service_period_days?: number;
105
113
  metered_quantity?: string;
114
+ charge_once?: boolean;
115
+ charge_on_option?: 'immediately' | 'on_event';
116
+ charge_on_event?:
117
+ | 'subscription_trial_start'
118
+ | 'plan_activation'
119
+ | 'subscription_activation'
120
+ | 'contract_termination';
106
121
  }
107
122
  export interface CouponsToAdd {
108
123
  coupon_id: string;
@@ -134,6 +149,11 @@ declare module 'chargebee' {
134
149
  package_size?: number;
135
150
  index: number;
136
151
  }
152
+ export interface ContractTerm {
153
+ cancellation_cutoff_period?: number;
154
+ renewal_billing_cycles?: number;
155
+ action_at_term_end: 'renew' | 'evergreen' | 'cancel' | 'renew_once';
156
+ }
137
157
  export interface StatusTransitionReason {
138
158
  code?: string;
139
159
  message?: string;
@@ -147,6 +167,7 @@ declare module 'chargebee' {
147
167
  coupons_to_remove?: string[];
148
168
  discounts_to_remove?: string[];
149
169
  items_to_remove?: string[];
170
+ contract_term?: ContractTermCreateForSubscriptionInputParam;
150
171
  items_to_add?: ItemsToAddCreateForSubscriptionInputParam[];
151
172
  items_to_update?: ItemsToUpdateCreateForSubscriptionInputParam[];
152
173
  item_tiers?: ItemTiersCreateForSubscriptionInputParam[];
@@ -159,6 +180,7 @@ declare module 'chargebee' {
159
180
  coupons_to_remove?: string[];
160
181
  discounts_to_remove?: string[];
161
182
  items_to_remove?: string[];
183
+ contract_term?: ContractTermUpdateInputParam;
162
184
  items_to_add?: ItemsToAddUpdateInputParam[];
163
185
  items_to_update?: ItemsToUpdateUpdateInputParam[];
164
186
  item_tiers?: ItemTiersUpdateInputParam[];
@@ -176,6 +198,12 @@ declare module 'chargebee' {
176
198
  'sort_by[asc]'?: string;
177
199
  'sort_by[desc]'?: string;
178
200
  }
201
+ export interface ContractTermCreateForSubscriptionInputParam {
202
+ action_at_term_end?: 'renew' | 'evergreen' | 'cancel' | 'renew_once';
203
+ cancellation_cutoff_period?: number;
204
+ renewal_billing_cycles?: number;
205
+ }
206
+
179
207
  export interface ItemsToAddCreateForSubscriptionInputParam {
180
208
  item_price_id: string;
181
209
  quantity?: number;
@@ -184,6 +212,9 @@ declare module 'chargebee' {
184
212
  unit_price_in_decimal?: string;
185
213
  billing_cycles?: number;
186
214
  service_period_days?: number;
215
+ charge_on_event?: ChargeOnEventEnum;
216
+ charge_once?: boolean;
217
+ charge_on_option?: ChargeOnOptionEnum;
187
218
  }
188
219
  export interface CouponsToAddCreateForSubscriptionInputParam {
189
220
  coupon_id?: string;
@@ -208,6 +239,9 @@ declare module 'chargebee' {
208
239
  unit_price_in_decimal?: string;
209
240
  billing_cycles?: number;
210
241
  service_period_days?: number;
242
+ charge_on_event?: ChargeOnEventEnum;
243
+ charge_once?: boolean;
244
+ charge_on_option?: ChargeOnOptionEnum;
211
245
  }
212
246
  export interface DiscountsToAddCreateForSubscriptionInputParam {
213
247
  apply_on: ApplyOnEnum;
@@ -219,6 +253,12 @@ declare module 'chargebee' {
219
253
  included_in_mrr?: boolean;
220
254
  item_price_id?: string;
221
255
  }
256
+ export interface ContractTermUpdateInputParam {
257
+ action_at_term_end?: 'renew' | 'evergreen' | 'cancel' | 'renew_once';
258
+ cancellation_cutoff_period?: number;
259
+ renewal_billing_cycles?: number;
260
+ }
261
+
222
262
  export interface ItemsToAddUpdateInputParam {
223
263
  item_price_id: string;
224
264
  quantity?: number;
@@ -227,6 +267,9 @@ declare module 'chargebee' {
227
267
  unit_price_in_decimal?: string;
228
268
  billing_cycles?: number;
229
269
  service_period_days?: number;
270
+ charge_on_event?: ChargeOnEventEnum;
271
+ charge_once?: boolean;
272
+ charge_on_option?: ChargeOnOptionEnum;
230
273
  }
231
274
  export interface CouponsToAddUpdateInputParam {
232
275
  coupon_id?: string;
@@ -251,6 +294,9 @@ declare module 'chargebee' {
251
294
  unit_price_in_decimal?: string;
252
295
  billing_cycles?: number;
253
296
  service_period_days?: number;
297
+ charge_on_event?: ChargeOnEventEnum;
298
+ charge_once?: boolean;
299
+ charge_on_option?: ChargeOnOptionEnum;
254
300
  }
255
301
  export interface DiscountsToAddUpdateInputParam {
256
302
  apply_on: ApplyOnEnum;
@@ -15,6 +15,7 @@ declare module 'chargebee' {
15
15
  end_date?: number;
16
16
  business_entity_id?: string;
17
17
  customer_id: string;
18
+ subscription_id: string;
18
19
  currency_code: string;
19
20
  line_items?: SalesOrder.LineItem[];
20
21
  billing_addresses?: SalesOrder.BillingAddress[];
@@ -75,7 +76,7 @@ declare module 'chargebee' {
75
76
  export interface Discount {
76
77
  id: string;
77
78
  invoice_name?: string;
78
- type: 'fixed_amount' | 'percentage';
79
+ type: 'fixed_amount' | 'percentage' | 'offer_quantity';
79
80
  apply_on: 'invoice_amount' | 'specific_item_price';
80
81
  duration_type: 'one_time' | 'forever' | 'limited_period';
81
82
  percentage?: number;
@@ -106,7 +107,6 @@ declare module 'chargebee' {
106
107
  | 'valid'
107
108
  | 'partially_valid'
108
109
  | 'invalid';
109
- index: number;
110
110
  }
111
111
  export interface LineItemTier {
112
112
  starting_unit: string;
@@ -650,7 +650,6 @@ declare module 'chargebee' {
650
650
  country?: string;
651
651
  zip?: string;
652
652
  validation_status?: ValidationStatusEnum;
653
- index: number;
654
653
  }
655
654
  export interface ReferralInfo {
656
655
  referral_code?: string;
@@ -825,6 +824,7 @@ declare module 'chargebee' {
825
824
  auto_collection?: AutoCollectionEnum;
826
825
  terms_to_charge?: number;
827
826
  billing_alignment_mode?: BillingAlignmentModeEnum;
827
+ offline_payment_method?: OfflinePaymentMethodEnum;
828
828
  po_number?: string;
829
829
  coupon_ids?: string[];
830
830
  payment_source_id?: string;
@@ -43,7 +43,7 @@ declare module 'chargebee' {
43
43
  }
44
44
 
45
45
  export interface SetSubscriptionEntitlementAvailabilityResponse {
46
- subscription_entitlement: SubscriptionEntitlement;
46
+ list: { subscription_entitlement: SubscriptionEntitlement }[];
47
47
  }
48
48
 
49
49
  export interface Component {
@@ -37,7 +37,6 @@ declare module 'chargebee' {
37
37
  country?: string;
38
38
  zip?: string;
39
39
  validation_status?: ValidationStatusEnum;
40
- index: number;
41
40
  }
42
41
  export interface ContractTerm {
43
42
  id: string;
@@ -29,7 +29,10 @@ declare module 'chargebee' {
29
29
  fraud_flag?: 'safe' | 'suspicious' | 'fraudulent';
30
30
  initiator_type?: 'customer' | 'merchant';
31
31
  three_d_secure?: boolean;
32
- authorization_reason?: 'blocking_funds' | 'verification';
32
+ authorization_reason?:
33
+ | 'blocking_funds'
34
+ | 'verification'
35
+ | 'scheduled_capture';
33
36
  error_code?: string;
34
37
  error_text?: string;
35
38
  voided_at?: number;
@@ -249,6 +252,7 @@ declare module 'chargebee' {
249
252
  processor_error_code?: string;
250
253
  processor_error_message?: string;
251
254
  error_cause_id?: string;
255
+ processor_advice_code?: string;
252
256
  }
253
257
  // REQUEST PARAMS
254
258
  //---------------
@@ -17,6 +17,8 @@ declare module 'chargebee' {
17
17
  processing_completed_at?: number;
18
18
  uploaded_by?: string;
19
19
  uploaded_at?: number;
20
+ error_file_path?: string;
21
+ error_file_url?: string;
20
22
  upload_details?: UsageFile.UploadDetail;
21
23
  }
22
24
 
@@ -31,6 +31,7 @@ declare module 'chargebee' {
31
31
  CustomerDeleted = 'customer_deleted',
32
32
  RefundInitiated = 'refund_initiated',
33
33
  InvoiceGeneratedWithBackdating = 'invoice_generated_with_backdating',
34
+ OmnichannelTransactionCreated = 'omnichannel_transaction_created',
34
35
  AddUsagesReminder = 'add_usages_reminder',
35
36
  VoucherCreated = 'voucher_created',
36
37
  RuleUpdated = 'rule_updated',
@@ -57,6 +58,7 @@ declare module 'chargebee' {
57
58
  SubscriptionAdvanceInvoiceScheduleUpdated = 'subscription_advance_invoice_schedule_updated',
58
59
  ItemDeleted = 'item_deleted',
59
60
  SubscriptionRampDrafted = 'subscription_ramp_drafted',
61
+ DunningUpdated = 'dunning_updated',
60
62
  ItemEntitlementsUpdated = 'item_entitlements_updated',
61
63
  TokenConsumed = 'token_consumed',
62
64
  HierarchyDeleted = 'hierarchy_deleted',
@@ -150,6 +152,7 @@ declare module 'chargebee' {
150
152
  SubscriptionScheduledCancellationRemoved = 'subscription_scheduled_cancellation_removed',
151
153
  PaymentRefunded = 'payment_refunded',
152
154
  UsageFileIngested = 'usage_file_ingested',
155
+ OmnichannelSubscriptionMovedIn = 'omnichannel_subscription_moved_in',
153
156
  DifferentialPriceCreated = 'differential_price_created',
154
157
  TransactionCreated = 'transaction_created',
155
158
  PaymentSucceeded = 'payment_succeeded',
@@ -240,6 +243,7 @@ declare module 'chargebee' {
240
243
  [WebhookContentType.CustomerDeleted]: CustomerDeletedContent;
241
244
  [WebhookContentType.RefundInitiated]: RefundInitiatedContent;
242
245
  [WebhookContentType.InvoiceGeneratedWithBackdating]: InvoiceGeneratedWithBackdatingContent;
246
+ [WebhookContentType.OmnichannelTransactionCreated]: OmnichannelTransactionCreatedContent;
243
247
  [WebhookContentType.AddUsagesReminder]: AddUsagesReminderContent;
244
248
  [WebhookContentType.VoucherCreated]: VoucherCreatedContent;
245
249
  [WebhookContentType.RuleUpdated]: RuleUpdatedContent;
@@ -266,6 +270,7 @@ declare module 'chargebee' {
266
270
  [WebhookContentType.SubscriptionAdvanceInvoiceScheduleUpdated]: SubscriptionAdvanceInvoiceScheduleUpdatedContent;
267
271
  [WebhookContentType.ItemDeleted]: ItemDeletedContent;
268
272
  [WebhookContentType.SubscriptionRampDrafted]: SubscriptionRampDraftedContent;
273
+ [WebhookContentType.DunningUpdated]: DunningUpdatedContent;
269
274
  [WebhookContentType.ItemEntitlementsUpdated]: ItemEntitlementsUpdatedContent;
270
275
  [WebhookContentType.TokenConsumed]: TokenConsumedContent;
271
276
  [WebhookContentType.HierarchyDeleted]: HierarchyDeletedContent;
@@ -359,6 +364,7 @@ declare module 'chargebee' {
359
364
  [WebhookContentType.SubscriptionScheduledCancellationRemoved]: SubscriptionScheduledCancellationRemovedContent;
360
365
  [WebhookContentType.PaymentRefunded]: PaymentRefundedContent;
361
366
  [WebhookContentType.UsageFileIngested]: UsageFileIngestedContent;
367
+ [WebhookContentType.OmnichannelSubscriptionMovedIn]: OmnichannelSubscriptionMovedInContent;
362
368
  [WebhookContentType.DifferentialPriceCreated]: DifferentialPriceCreatedContent;
363
369
  [WebhookContentType.TransactionCreated]: TransactionCreatedContent;
364
370
  [WebhookContentType.PaymentSucceeded]: PaymentSucceededContent;
@@ -629,6 +635,9 @@ declare module 'chargebee' {
629
635
  export type InvoiceGeneratedWithBackdatingContent = {
630
636
  invoice: Invoice;
631
637
  };
638
+ export type OmnichannelTransactionCreatedContent = {
639
+ omnichannel_transaction: OmnichannelTransaction;
640
+ };
632
641
  export type AddUsagesReminderContent = {
633
642
  subscription: Subscription;
634
643
 
@@ -753,6 +762,9 @@ declare module 'chargebee' {
753
762
  export type SubscriptionRampDraftedContent = {
754
763
  ramp: Ramp;
755
764
  };
765
+ export type DunningUpdatedContent = {
766
+ invoice: Invoice;
767
+ };
756
768
  export type ItemEntitlementsUpdatedContent = {
757
769
  feature: Feature;
758
770
 
@@ -1288,6 +1300,11 @@ declare module 'chargebee' {
1288
1300
  export type UsageFileIngestedContent = {
1289
1301
  usage_file: UsageFile;
1290
1302
  };
1303
+ export type OmnichannelSubscriptionMovedInContent = {
1304
+ omnichannel_subscription: OmnichannelSubscription;
1305
+
1306
+ customer: Customer;
1307
+ };
1291
1308
  export type DifferentialPriceCreatedContent = {
1292
1309
  differential_price: DifferentialPrice;
1293
1310
  };
@@ -1,61 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NodeHttpClientResponse = exports.NodeHttpClient = void 0;
4
- const ClientInterface_js_1 = require("./ClientInterface.js");
5
- const http = require("http");
6
- const https = require("https");
7
- class NodeHttpClient extends ClientInterface_js_1.HttpClient {
8
- async makeApiRequest(props) {
9
- const protocol = props.protocol === 'http' ? http : https;
10
- const requestPromise = new Promise((resolve, reject) => {
11
- const req = protocol.request({
12
- hostname: props.host,
13
- path: props.path,
14
- method: props.method,
15
- port: props.port,
16
- headers: props.headers,
17
- });
18
- req.setTimeout(props.timeout, () => {
19
- throw ClientInterface_js_1.HttpClient.timeOutError();
20
- });
21
- req.on('response', (res) => {
22
- resolve(new NodeHttpClientResponse(res));
23
- });
24
- req.on('error', (error) => {
25
- reject(error);
26
- });
27
- req.write(props.data);
28
- req.end();
29
- });
30
- return requestPromise;
31
- }
32
- }
33
- exports.NodeHttpClient = NodeHttpClient;
34
- class NodeHttpClientResponse extends ClientInterface_js_1.HttpClientResponse {
35
- constructor(res) {
36
- //@ts-ignore
37
- super(res.statusCode, res.headers);
38
- this._res = res;
39
- }
40
- getRawResponse() {
41
- return this._res;
42
- }
43
- toJson() {
44
- return new Promise((resolve, reject) => {
45
- let response = '';
46
- this._res.setEncoding('utf8');
47
- this._res.on('data', (chunk) => {
48
- response += chunk;
49
- });
50
- this._res.once('end', () => {
51
- try {
52
- resolve(JSON.parse(response));
53
- }
54
- catch (e) {
55
- reject(e);
56
- }
57
- });
58
- });
59
- }
60
- }
61
- exports.NodeHttpClientResponse = NodeHttpClientResponse;
@@ -1,56 +0,0 @@
1
- import { HttpClient, HttpClientResponse, } from './ClientInterface.js';
2
- import * as http from 'http';
3
- import * as https from 'https';
4
- export class NodeHttpClient extends HttpClient {
5
- async makeApiRequest(props) {
6
- const protocol = props.protocol === 'http' ? http : https;
7
- const requestPromise = new Promise((resolve, reject) => {
8
- const req = protocol.request({
9
- hostname: props.host,
10
- path: props.path,
11
- method: props.method,
12
- port: props.port,
13
- headers: props.headers,
14
- });
15
- req.setTimeout(props.timeout, () => {
16
- throw HttpClient.timeOutError();
17
- });
18
- req.on('response', (res) => {
19
- resolve(new NodeHttpClientResponse(res));
20
- });
21
- req.on('error', (error) => {
22
- reject(error);
23
- });
24
- req.write(props.data);
25
- req.end();
26
- });
27
- return requestPromise;
28
- }
29
- }
30
- export class NodeHttpClientResponse extends HttpClientResponse {
31
- constructor(res) {
32
- //@ts-ignore
33
- super(res.statusCode, res.headers);
34
- this._res = res;
35
- }
36
- getRawResponse() {
37
- return this._res;
38
- }
39
- toJson() {
40
- return new Promise((resolve, reject) => {
41
- let response = '';
42
- this._res.setEncoding('utf8');
43
- this._res.on('data', (chunk) => {
44
- response += chunk;
45
- });
46
- this._res.once('end', () => {
47
- try {
48
- resolve(JSON.parse(response));
49
- }
50
- catch (e) {
51
- reject(e);
52
- }
53
- });
54
- });
55
- }
56
- }