chargebee 3.29.0 → 3.30.1

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 (82) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/cjs/environment.js +1 -1
  3. package/cjs/resources/api_endpoints.js +69 -0
  4. package/cjs/resources/webhook/eventType.js +4 -0
  5. package/cjs/schema/alert.schema.js +8 -3
  6. package/cjs/schema/coupon.schema.js +1 -1
  7. package/cjs/schema/credit_note.schema.js +8 -0
  8. package/cjs/schema/credit_unit.schema.js +38 -0
  9. package/cjs/schema/customer.schema.js +24 -0
  10. package/cjs/schema/entitlement.schema.js +4 -4
  11. package/cjs/schema/estimate.schema.js +9 -0
  12. package/cjs/schema/event.schema.js +16 -0
  13. package/cjs/schema/export.schema.js +21 -5
  14. package/cjs/schema/gift.schema.js +8 -0
  15. package/cjs/schema/grant_block.schema.js +4 -0
  16. package/cjs/schema/index.js +1 -0
  17. package/cjs/schema/invoice.schema.js +30 -2
  18. package/cjs/schema/item.schema.js +1 -1
  19. package/cjs/schema/item_family.schema.js +1 -1
  20. package/cjs/schema/item_price.schema.js +1 -1
  21. package/cjs/schema/ledger_operation.schema.js +14 -4
  22. package/cjs/schema/meter.schema.js +1 -1
  23. package/cjs/schema/payment_intent.schema.js +8 -0
  24. package/cjs/schema/payment_source.schema.js +28 -0
  25. package/cjs/schema/price_variant.schema.js +1 -1
  26. package/cjs/schema/purchase.schema.js +4 -0
  27. package/cjs/schema/ramp.schema.js +2 -2
  28. package/cjs/schema/subscription.schema.js +57 -0
  29. package/cjs/schema/transaction.schema.js +20 -0
  30. package/cjs/schema/webhook_endpoint.schema.js +8 -0
  31. package/cjs/util.js +12 -2
  32. package/esm/environment.js +1 -1
  33. package/esm/resources/api_endpoints.js +69 -0
  34. package/esm/resources/webhook/eventType.js +4 -0
  35. package/esm/schema/alert.schema.js +8 -3
  36. package/esm/schema/coupon.schema.js +1 -1
  37. package/esm/schema/credit_note.schema.js +8 -0
  38. package/esm/schema/credit_unit.schema.js +35 -0
  39. package/esm/schema/customer.schema.js +24 -0
  40. package/esm/schema/entitlement.schema.js +4 -4
  41. package/esm/schema/estimate.schema.js +9 -0
  42. package/esm/schema/event.schema.js +16 -0
  43. package/esm/schema/export.schema.js +21 -5
  44. package/esm/schema/gift.schema.js +8 -0
  45. package/esm/schema/grant_block.schema.js +4 -0
  46. package/esm/schema/index.js +1 -0
  47. package/esm/schema/invoice.schema.js +30 -2
  48. package/esm/schema/item.schema.js +1 -1
  49. package/esm/schema/item_family.schema.js +1 -1
  50. package/esm/schema/item_price.schema.js +1 -1
  51. package/esm/schema/ledger_operation.schema.js +13 -3
  52. package/esm/schema/meter.schema.js +1 -1
  53. package/esm/schema/payment_intent.schema.js +8 -0
  54. package/esm/schema/payment_source.schema.js +28 -0
  55. package/esm/schema/price_variant.schema.js +1 -1
  56. package/esm/schema/purchase.schema.js +4 -0
  57. package/esm/schema/ramp.schema.js +2 -2
  58. package/esm/schema/subscription.schema.js +57 -0
  59. package/esm/schema/transaction.schema.js +20 -0
  60. package/esm/schema/webhook_endpoint.schema.js +8 -0
  61. package/esm/util.js +12 -2
  62. package/package.json +1 -1
  63. package/types/core.d.ts +27 -2
  64. package/types/index.d.ts +3 -0
  65. package/types/resources/Alert.d.ts +4 -2
  66. package/types/resources/AttachedItem.d.ts +2 -2
  67. package/types/resources/Content.d.ts +2 -0
  68. package/types/resources/CreditUnit.d.ts +90 -0
  69. package/types/resources/Customer.d.ts +10 -2
  70. package/types/resources/Estimate.d.ts +11 -2
  71. package/types/resources/Event.d.ts +4 -0
  72. package/types/resources/Gift.d.ts +10 -2
  73. package/types/resources/GrantBlock.d.ts +11 -5
  74. package/types/resources/Invoice.d.ts +10 -2
  75. package/types/resources/LedgerAccountBalance.d.ts +3 -1
  76. package/types/resources/LedgerEntry.d.ts +22 -0
  77. package/types/resources/LedgerOperation.d.ts +33 -6
  78. package/types/resources/PaymentIntent.d.ts +25 -5
  79. package/types/resources/PaymentSource.d.ts +5 -1
  80. package/types/resources/Purchase.d.ts +5 -1
  81. package/types/resources/Subscription.d.ts +36 -7
  82. package/types/resources/WebhookEvent.d.ts +26 -0
@@ -188,6 +188,10 @@ const CreateInvoicePaymentMethodSchema = zod_1.z.object({
188
188
  'paynow',
189
189
  'bizum',
190
190
  'promptpay',
191
+ 'dana',
192
+ 'touch_n_go',
193
+ 'tamara',
194
+ 'qpay',
191
195
  ])
192
196
  .optional(),
193
197
  gateway: zod_1.z
@@ -313,6 +317,10 @@ const CreateInvoicePaymentIntentSchema = zod_1.z.object({
313
317
  'paynow',
314
318
  'bizum',
315
319
  'promptpay',
320
+ 'dana',
321
+ 'touch_n_go',
322
+ 'tamara',
323
+ 'qpay',
316
324
  ])
317
325
  .optional(),
318
326
  reference_id: zod_1.z.string().max(65000).optional(),
@@ -570,6 +578,10 @@ const CreateForChargeItemsAndChargesInvoicePaymentMethodSchema = zod_1.z.object(
570
578
  'paynow',
571
579
  'bizum',
572
580
  'promptpay',
581
+ 'dana',
582
+ 'touch_n_go',
583
+ 'tamara',
584
+ 'qpay',
573
585
  ])
574
586
  .optional(),
575
587
  gateway: zod_1.z
@@ -695,6 +707,10 @@ const CreateForChargeItemsAndChargesInvoicePaymentIntentSchema = zod_1.z.object(
695
707
  'paynow',
696
708
  'bizum',
697
709
  'promptpay',
710
+ 'dana',
711
+ 'touch_n_go',
712
+ 'tamara',
713
+ 'qpay',
698
714
  ])
699
715
  .optional(),
700
716
  reference_id: zod_1.z.string().max(65000).optional(),
@@ -1071,6 +1087,10 @@ const ImportInvoiceInvoicePaymentsSchema = zod_1.z.object({
1071
1087
  'app_store',
1072
1088
  'play_store',
1073
1089
  'custom',
1090
+ 'dana',
1091
+ 'touch_n_go',
1092
+ 'tamara',
1093
+ 'qpay',
1074
1094
  ])
1075
1095
  .optional()),
1076
1096
  date: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
@@ -1404,12 +1424,12 @@ const PdfInvoiceBodySchema = zod_1.z.looseObject({
1404
1424
  exports.PdfInvoiceBodySchema = PdfInvoiceBodySchema;
1405
1425
  //Invoice.listPaymentReferenceNumbers
1406
1426
  const ListPaymentReferenceNumbersInvoiceIdSchema = zod_1.z.object({
1407
- is: zod_1.z.string().min(1).optional(),
1408
1427
  in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1428
+ is: zod_1.z.string().min(1).optional(),
1409
1429
  });
1410
1430
  const ListPaymentReferenceNumbersInvoiceNumberSchema = zod_1.z.object({
1411
- is: zod_1.z.string().min(1).optional(),
1412
1431
  in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1432
+ is: zod_1.z.string().min(1).optional(),
1413
1433
  });
1414
1434
  const ListPaymentReferenceNumbersInvoicePaymentReferenceNumberItemSchema = zod_1.z.object({
1415
1435
  number: ListPaymentReferenceNumbersInvoiceNumberSchema.optional(),
@@ -1535,6 +1555,10 @@ const RecordPaymentInvoiceTransactionSchema = zod_1.z.object({
1535
1555
  'app_store',
1536
1556
  'play_store',
1537
1557
  'custom',
1558
+ 'dana',
1559
+ 'touch_n_go',
1560
+ 'tamara',
1561
+ 'qpay',
1538
1562
  ]),
1539
1563
  reference_number: zod_1.z.string().max(100).optional(),
1540
1564
  custom_payment_method_id: zod_1.z.string().max(50).optional(),
@@ -1601,6 +1625,10 @@ const RecordRefundInvoiceTransactionSchema = zod_1.z.object({
1601
1625
  'app_store',
1602
1626
  'play_store',
1603
1627
  'custom',
1628
+ 'dana',
1629
+ 'touch_n_go',
1630
+ 'tamara',
1631
+ 'qpay',
1604
1632
  ]),
1605
1633
  reference_number: zod_1.z.string().max(100).optional(),
1606
1634
  custom_payment_method_id: zod_1.z.string().max(50).optional(),
@@ -158,8 +158,8 @@ const ListItemChannelSchema = zod_1.z.object({
158
158
  not_in: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
159
159
  });
160
160
  const ListItemBusinessEntityIdSchema = zod_1.z.object({
161
- is_present: zod_1.z.enum(['true', 'false']).optional(),
162
161
  is: zod_1.z.string().min(1).optional(),
162
+ is_present: zod_1.z.enum(['true', 'false']).optional(),
163
163
  });
164
164
  const ListItemIncludeSiteLevelResourcesSchema = zod_1.z.object({
165
165
  is: zod_1.z.enum(['true', 'false']).optional(),
@@ -33,8 +33,8 @@ const ListItemFamilyUpdatedAtSchema = zod_1.z.object({
33
33
  between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
34
34
  });
35
35
  const ListItemFamilyBusinessEntityIdSchema = zod_1.z.object({
36
- is_present: zod_1.z.enum(['true', 'false']).optional(),
37
36
  is: zod_1.z.string().min(1).optional(),
37
+ is_present: zod_1.z.enum(['true', 'false']).optional(),
38
38
  });
39
39
  const ListItemFamilyIncludeSiteLevelResourcesSchema = zod_1.z.object({
40
40
  is: zod_1.z.enum(['true', 'false']).optional(),
@@ -256,8 +256,8 @@ const ListItemPriceUpdatedAtSchema = zod_1.z.object({
256
256
  between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
257
257
  });
258
258
  const ListItemPriceBusinessEntityIdSchema = zod_1.z.object({
259
- is_present: zod_1.z.enum(['true', 'false']).optional(),
260
259
  is: zod_1.z.string().min(1).optional(),
260
+ is_present: zod_1.z.enum(['true', 'false']).optional(),
261
261
  });
262
262
  const ListItemPriceIncludeSiteLevelResourcesSchema = zod_1.z.object({
263
263
  is: zod_1.z.enum(['true', 'false']).optional(),
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  // Generated Zod schemas: LedgerOperation
3
- // Actions: listLedgerOperations, capture, authorize, captureAuthorization, releaseAuthorization
3
+ // Actions: listLedgerOperations, capture, authorize, captureAuthorization, releaseAuthorization, allocate
4
4
  // Do not edit manually – regenerate via sdk-generator
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ReleaseAuthorizationLedgerOperationBodySchema = exports.CaptureAuthorizationLedgerOperationBodySchema = exports.AuthorizeLedgerOperationBodySchema = exports.CaptureLedgerOperationBodySchema = exports.ListLedgerOperationsLedgerOperationBodySchema = void 0;
6
+ exports.AllocateLedgerOperationBodySchema = exports.ReleaseAuthorizationLedgerOperationBodySchema = exports.CaptureAuthorizationLedgerOperationBodySchema = exports.AuthorizeLedgerOperationBodySchema = exports.CaptureLedgerOperationBodySchema = exports.ListLedgerOperationsLedgerOperationBodySchema = void 0;
7
7
  const zod_1 = require("zod");
8
8
  //LedgerOperation.listLedgerOperations
9
9
  const ListLedgerOperationsLedgerOperationSubscriptionIdSchema = zod_1.z.object({
@@ -19,7 +19,7 @@ const ListLedgerOperationsLedgerOperationCreatedAtSchema = zod_1.z.object({
19
19
  between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
20
20
  });
21
21
  const ListLedgerOperationsLedgerOperationTypeSchema = zod_1.z.object({
22
- is: zod_1.z
22
+ in: zod_1.z
23
23
  .enum([
24
24
  'allocation',
25
25
  'capture',
@@ -32,7 +32,7 @@ const ListLedgerOperationsLedgerOperationTypeSchema = zod_1.z.object({
32
32
  'adjustment',
33
33
  ])
34
34
  .optional(),
35
- in: zod_1.z
35
+ is: zod_1.z
36
36
  .enum([
37
37
  'allocation',
38
38
  'capture',
@@ -102,3 +102,13 @@ const ReleaseAuthorizationLedgerOperationBodySchema = zod_1.z.looseObject({
102
102
  metadata: ReleaseAuthorizationLedgerOperationMetadataSchema.optional(),
103
103
  });
104
104
  exports.ReleaseAuthorizationLedgerOperationBodySchema = ReleaseAuthorizationLedgerOperationBodySchema;
105
+ //LedgerOperation.allocate
106
+ const AllocateLedgerOperationMetadataSchema = zod_1.z.looseObject({});
107
+ const AllocateLedgerOperationBodySchema = zod_1.z.looseObject({
108
+ subscription_id: zod_1.z.string().max(50),
109
+ unit_id: zod_1.z.string().max(50),
110
+ amount: zod_1.z.string().max(36),
111
+ expires_at: zod_1.z.number().int(),
112
+ metadata: AllocateLedgerOperationMetadataSchema.optional(),
113
+ });
114
+ exports.AllocateLedgerOperationBodySchema = AllocateLedgerOperationBodySchema;
@@ -7,8 +7,8 @@ exports.ListMeterBodySchema = void 0;
7
7
  const zod_1 = require("zod");
8
8
  //Meter.list
9
9
  const ListMeterNameSchema = zod_1.z.object({
10
- is: zod_1.z.string().min(1).optional(),
11
10
  starts_with: zod_1.z.string().min(1).optional(),
11
+ is: zod_1.z.string().min(1).optional(),
12
12
  });
13
13
  const ListMeterSortBySchema = zod_1.z.looseObject({
14
14
  asc: zod_1.z.enum(['id', 'name', 'created_at', 'updated_at']).optional(),
@@ -64,6 +64,10 @@ const CreatePaymentIntentBodySchema = zod_1.z.looseObject({
64
64
  'paynow',
65
65
  'bizum',
66
66
  'promptpay',
67
+ 'dana',
68
+ 'touch_n_go',
69
+ 'tamara',
70
+ 'qpay',
67
71
  ])
68
72
  .optional(),
69
73
  success_url: zod_1.z.string().max(250).optional(),
@@ -125,6 +129,10 @@ const UpdatePaymentIntentBodySchema = zod_1.z.looseObject({
125
129
  'paynow',
126
130
  'bizum',
127
131
  'promptpay',
132
+ 'dana',
133
+ 'touch_n_go',
134
+ 'tamara',
135
+ 'qpay',
128
136
  ])
129
137
  .optional(),
130
138
  success_url: zod_1.z.string().max(250).optional(),
@@ -61,6 +61,10 @@ const CreateUsingTempTokenPaymentSourceBodySchema = zod_1.z.looseObject({
61
61
  'paynow',
62
62
  'bizum',
63
63
  'promptpay',
64
+ 'dana',
65
+ 'touch_n_go',
66
+ 'tamara',
67
+ 'qpay',
64
68
  ]),
65
69
  tmp_token: zod_1.z.string().max(65000),
66
70
  issuing_country: zod_1.z.string().max(50).optional(),
@@ -169,6 +173,10 @@ const CreateUsingPermanentTokenPaymentSourceBodySchema = zod_1.z.looseObject({
169
173
  'paynow',
170
174
  'bizum',
171
175
  'promptpay',
176
+ 'dana',
177
+ 'touch_n_go',
178
+ 'tamara',
179
+ 'qpay',
172
180
  ]),
173
181
  gateway_account_id: zod_1.z.string().max(50).optional(),
174
182
  reference_id: zod_1.z.string().max(200).optional(),
@@ -248,6 +256,10 @@ const CreateUsingPaymentIntentPaymentSourcePaymentIntentSchema = zod_1.z.object(
248
256
  'paynow',
249
257
  'bizum',
250
258
  'promptpay',
259
+ 'dana',
260
+ 'touch_n_go',
261
+ 'tamara',
262
+ 'qpay',
251
263
  ])
252
264
  .optional(),
253
265
  reference_id: zod_1.z.string().max(65000).optional(),
@@ -431,6 +443,10 @@ const ListPaymentSourceTypeSchema = zod_1.z.object({
431
443
  'paynow',
432
444
  'bizum',
433
445
  'promptpay',
446
+ 'dana',
447
+ 'touch_n_go',
448
+ 'tamara',
449
+ 'qpay',
434
450
  ])
435
451
  .optional(),
436
452
  is_not: zod_1.z
@@ -485,6 +501,10 @@ const ListPaymentSourceTypeSchema = zod_1.z.object({
485
501
  'paynow',
486
502
  'bizum',
487
503
  'promptpay',
504
+ 'dana',
505
+ 'touch_n_go',
506
+ 'tamara',
507
+ 'qpay',
488
508
  ])
489
509
  .optional(),
490
510
  in: zod_1.z
@@ -539,6 +559,10 @@ const ListPaymentSourceTypeSchema = zod_1.z.object({
539
559
  'paynow',
540
560
  'bizum',
541
561
  'promptpay',
562
+ 'dana',
563
+ 'touch_n_go',
564
+ 'tamara',
565
+ 'qpay',
542
566
  ])
543
567
  .optional(),
544
568
  not_in: zod_1.z
@@ -593,6 +617,10 @@ const ListPaymentSourceTypeSchema = zod_1.z.object({
593
617
  'paynow',
594
618
  'bizum',
595
619
  'promptpay',
620
+ 'dana',
621
+ 'touch_n_go',
622
+ 'tamara',
623
+ 'qpay',
596
624
  ])
597
625
  .optional(),
598
626
  });
@@ -68,8 +68,8 @@ const ListPriceVariantCreatedAtSchema = zod_1.z.object({
68
68
  between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
69
69
  });
70
70
  const ListPriceVariantBusinessEntityIdSchema = zod_1.z.object({
71
- is_present: zod_1.z.enum(['true', 'false']).optional(),
72
71
  is: zod_1.z.string().min(1).optional(),
72
+ is_present: zod_1.z.enum(['true', 'false']).optional(),
73
73
  });
74
74
  const ListPriceVariantIncludeSiteLevelResourcesSchema = zod_1.z.object({
75
75
  is: zod_1.z.enum(['true', 'false']).optional(),
@@ -72,6 +72,10 @@ const CreatePurchasePaymentIntentSchema = zod_1.z.object({
72
72
  'paynow',
73
73
  'bizum',
74
74
  'promptpay',
75
+ 'dana',
76
+ 'touch_n_go',
77
+ 'tamara',
78
+ 'qpay',
75
79
  ])
76
80
  .optional(),
77
81
  reference_id: zod_1.z.string().max(65000).optional(),
@@ -211,12 +211,12 @@ const UpdateRampBodySchema = zod_1.z.looseObject({
211
211
  exports.UpdateRampBodySchema = UpdateRampBodySchema;
212
212
  //Ramp.list
213
213
  const ListRampStatusSchema = zod_1.z.object({
214
- is: zod_1.z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional(),
215
214
  in: zod_1.z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional(),
215
+ is: zod_1.z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional(),
216
216
  });
217
217
  const ListRampSubscriptionIdSchema = zod_1.z.object({
218
- is: zod_1.z.string().min(1).optional(),
219
218
  in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
219
+ is: zod_1.z.string().min(1).optional(),
220
220
  });
221
221
  const ListRampEffectiveFromSchema = zod_1.z.object({
222
222
  after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
@@ -238,6 +238,10 @@ const CreateSubscriptionPaymentMethodSchema = zod_1.z.object({
238
238
  'paynow',
239
239
  'bizum',
240
240
  'promptpay',
241
+ 'dana',
242
+ 'touch_n_go',
243
+ 'tamara',
244
+ 'qpay',
241
245
  ])
242
246
  .optional(),
243
247
  gateway: zod_1.z
@@ -363,6 +367,10 @@ const CreateSubscriptionPaymentIntentSchema = zod_1.z.object({
363
367
  'paynow',
364
368
  'bizum',
365
369
  'promptpay',
370
+ 'dana',
371
+ 'touch_n_go',
372
+ 'tamara',
373
+ 'qpay',
366
374
  ])
367
375
  .optional(),
368
376
  reference_id: zod_1.z.string().max(65000).optional(),
@@ -597,6 +605,10 @@ const CreateForCustomerSubscriptionPaymentIntentSchema = zod_1.z.object({
597
605
  'paynow',
598
606
  'bizum',
599
607
  'promptpay',
608
+ 'dana',
609
+ 'touch_n_go',
610
+ 'tamara',
611
+ 'qpay',
600
612
  ])
601
613
  .optional(),
602
614
  reference_id: zod_1.z.string().max(65000).optional(),
@@ -791,6 +803,10 @@ const CreateWithItemsSubscriptionPaymentIntentSchema = zod_1.z.object({
791
803
  'paynow',
792
804
  'bizum',
793
805
  'promptpay',
806
+ 'dana',
807
+ 'touch_n_go',
808
+ 'tamara',
809
+ 'qpay',
794
810
  ])
795
811
  .optional(),
796
812
  reference_id: zod_1.z.string().max(65000).optional(),
@@ -1424,6 +1440,10 @@ const UpdateSubscriptionPaymentMethodSchema = zod_1.z.object({
1424
1440
  'paynow',
1425
1441
  'bizum',
1426
1442
  'promptpay',
1443
+ 'dana',
1444
+ 'touch_n_go',
1445
+ 'tamara',
1446
+ 'qpay',
1427
1447
  ])
1428
1448
  .optional(),
1429
1449
  gateway: zod_1.z
@@ -1549,6 +1569,10 @@ const UpdateSubscriptionPaymentIntentSchema = zod_1.z.object({
1549
1569
  'paynow',
1550
1570
  'bizum',
1551
1571
  'promptpay',
1572
+ 'dana',
1573
+ 'touch_n_go',
1574
+ 'tamara',
1575
+ 'qpay',
1552
1576
  ])
1553
1577
  .optional(),
1554
1578
  reference_id: zod_1.z.string().max(65000).optional(),
@@ -1872,6 +1896,10 @@ const UpdateForItemsSubscriptionPaymentMethodSchema = zod_1.z.object({
1872
1896
  'paynow',
1873
1897
  'bizum',
1874
1898
  'promptpay',
1899
+ 'dana',
1900
+ 'touch_n_go',
1901
+ 'tamara',
1902
+ 'qpay',
1875
1903
  ])
1876
1904
  .optional(),
1877
1905
  gateway: zod_1.z
@@ -1997,6 +2025,10 @@ const UpdateForItemsSubscriptionPaymentIntentSchema = zod_1.z.object({
1997
2025
  'paynow',
1998
2026
  'bizum',
1999
2027
  'promptpay',
2028
+ 'dana',
2029
+ 'touch_n_go',
2030
+ 'tamara',
2031
+ 'qpay',
2000
2032
  ])
2001
2033
  .optional(),
2002
2034
  reference_id: zod_1.z.string().max(65000).optional(),
@@ -2283,6 +2315,10 @@ const ReactivateSubscriptionPaymentIntentSchema = zod_1.z.object({
2283
2315
  'paynow',
2284
2316
  'bizum',
2285
2317
  'promptpay',
2318
+ 'dana',
2319
+ 'touch_n_go',
2320
+ 'tamara',
2321
+ 'qpay',
2286
2322
  ])
2287
2323
  .optional(),
2288
2324
  reference_id: zod_1.z.string().max(65000).optional(),
@@ -2592,6 +2628,10 @@ const ImportSubscriptionSubscriptionPaymentMethodSchema = zod_1.z.object({
2592
2628
  'paynow',
2593
2629
  'bizum',
2594
2630
  'promptpay',
2631
+ 'dana',
2632
+ 'touch_n_go',
2633
+ 'tamara',
2634
+ 'qpay',
2595
2635
  ])
2596
2636
  .optional(),
2597
2637
  gateway: zod_1.z
@@ -2709,6 +2749,10 @@ const ImportSubscriptionSubscriptionTransactionSchema = zod_1.z.object({
2709
2749
  'app_store',
2710
2750
  'play_store',
2711
2751
  'custom',
2752
+ 'dana',
2753
+ 'touch_n_go',
2754
+ 'tamara',
2755
+ 'qpay',
2712
2756
  ])
2713
2757
  .optional(),
2714
2758
  reference_number: zod_1.z.string().max(100).optional(),
@@ -2832,6 +2876,10 @@ const ImportForCustomerSubscriptionTransactionSchema = zod_1.z.object({
2832
2876
  'app_store',
2833
2877
  'play_store',
2834
2878
  'custom',
2879
+ 'dana',
2880
+ 'touch_n_go',
2881
+ 'tamara',
2882
+ 'qpay',
2835
2883
  ])
2836
2884
  .optional(),
2837
2885
  reference_number: zod_1.z.string().max(100).optional(),
@@ -3056,6 +3104,10 @@ const ImportForItemsSubscriptionTransactionSchema = zod_1.z.object({
3056
3104
  'app_store',
3057
3105
  'play_store',
3058
3106
  'custom',
3107
+ 'dana',
3108
+ 'touch_n_go',
3109
+ 'tamara',
3110
+ 'qpay',
3059
3111
  ])
3060
3112
  .optional(),
3061
3113
  reference_number: zod_1.z.string().max(100).optional(),
@@ -3293,6 +3345,7 @@ const CancelForItemsSubscriptionBodySchema = zod_1.z.looseObject({
3293
3345
  ])
3294
3346
  .optional(),
3295
3347
  invoice_date: zod_1.z.number().int().optional(),
3348
+ include_cancellation_day_in_billing: zod_1.z.boolean().optional(),
3296
3349
  cancel_reason_code: zod_1.z.string().max(100).optional(),
3297
3350
  decommissioned: zod_1.z.boolean().default(false).optional(),
3298
3351
  subscription_items: CancelForItemsSubscriptionSubscriptionItemsSchema.optional(),
@@ -3354,6 +3407,10 @@ const ResumeSubscriptionPaymentIntentSchema = zod_1.z.object({
3354
3407
  'paynow',
3355
3408
  'bizum',
3356
3409
  'promptpay',
3410
+ 'dana',
3411
+ 'touch_n_go',
3412
+ 'tamara',
3413
+ 'qpay',
3357
3414
  ])
3358
3415
  .optional(),
3359
3416
  reference_id: zod_1.z.string().max(65000).optional(),
@@ -25,6 +25,10 @@ const RecordRefundTransactionBodySchema = zod_1.z.looseObject({
25
25
  'app_store',
26
26
  'play_store',
27
27
  'custom',
28
+ 'dana',
29
+ 'touch_n_go',
30
+ 'tamara',
31
+ 'qpay',
28
32
  ]),
29
33
  date: zod_1.z.number().int(),
30
34
  reference_number: zod_1.z.string().max(100).optional(),
@@ -140,6 +144,10 @@ const ListTransactionPaymentMethodSchema = zod_1.z.object({
140
144
  'paynow',
141
145
  'bizum',
142
146
  'promptpay',
147
+ 'dana',
148
+ 'touch_n_go',
149
+ 'tamara',
150
+ 'qpay',
143
151
  ])
144
152
  .optional(),
145
153
  is_not: zod_1.z
@@ -204,6 +212,10 @@ const ListTransactionPaymentMethodSchema = zod_1.z.object({
204
212
  'paynow',
205
213
  'bizum',
206
214
  'promptpay',
215
+ 'dana',
216
+ 'touch_n_go',
217
+ 'tamara',
218
+ 'qpay',
207
219
  ])
208
220
  .optional(),
209
221
  in: zod_1.z
@@ -268,6 +280,10 @@ const ListTransactionPaymentMethodSchema = zod_1.z.object({
268
280
  'paynow',
269
281
  'bizum',
270
282
  'promptpay',
283
+ 'dana',
284
+ 'touch_n_go',
285
+ 'tamara',
286
+ 'qpay',
271
287
  ])
272
288
  .optional(),
273
289
  not_in: zod_1.z
@@ -332,6 +348,10 @@ const ListTransactionPaymentMethodSchema = zod_1.z.object({
332
348
  'paynow',
333
349
  'bizum',
334
350
  'promptpay',
351
+ 'dana',
352
+ 'touch_n_go',
353
+ 'tamara',
354
+ 'qpay',
335
355
  ])
336
356
  .optional(),
337
357
  });
@@ -244,6 +244,10 @@ const CreateWebhookEndpointBodySchema = zod_1.z.looseObject({
244
244
  'alert_status_changed',
245
245
  'omnichannel_subscription_item_updated',
246
246
  'omnichannel_subscription_item_recovered',
247
+ 'ledger_account_balance_updated',
248
+ 'grant_blocks_created',
249
+ 'grant_blocks_updated',
250
+ 'ledger_updated',
247
251
  'plan_created',
248
252
  'plan_updated',
249
253
  'plan_deleted',
@@ -491,6 +495,10 @@ const UpdateWebhookEndpointBodySchema = zod_1.z.looseObject({
491
495
  'alert_status_changed',
492
496
  'omnichannel_subscription_item_updated',
493
497
  'omnichannel_subscription_item_recovered',
498
+ 'ledger_account_balance_updated',
499
+ 'grant_blocks_created',
500
+ 'grant_blocks_updated',
501
+ 'ledger_updated',
494
502
  'plan_created',
495
503
  'plan_updated',
496
504
  'plan_deleted',
package/cjs/util.js CHANGED
@@ -124,9 +124,11 @@ function getApiURL(env, urlPrefix, urlSuffix, urlIdParam) {
124
124
  : '') +
125
125
  (urlSuffix !== null ? urlSuffix : ''));
126
126
  }
127
+ // Filter operators whose value is the whole array, sent as a single field
128
+ // (e.g. updated_at[between]=[1704067200,1717199999]).
129
+ const arrayOperators = ['in', 'not_in', 'between'];
127
130
  function serialize(paramObj) {
128
131
  let key, value;
129
- let array_ops = ['in', 'not_in', 'between'];
130
132
  for (key in paramObj) {
131
133
  value = paramObj[key];
132
134
  if (typeof value === 'object' && (0, exports.isObject)(value)) {
@@ -135,7 +137,7 @@ function serialize(paramObj) {
135
137
  for (child_key in value) {
136
138
  key = key + '[' + child_key + ']';
137
139
  paramObj[key] = value[child_key];
138
- if (array_ops.includes(child_key)) {
140
+ if (arrayOperators.includes(child_key)) {
139
141
  paramObj[key] = JSON.stringify(value[child_key]);
140
142
  }
141
143
  }
@@ -190,6 +192,14 @@ function encodeParams(paramObj, serialized, scope, index, jsonKeys, level = 0) {
190
192
  }
191
193
  serialized.push(encodeURIComponent(key) + '=' + attrVal);
192
194
  }
195
+ else if ((0, exports.isArray)(value) && arrayOperators.includes(originalKey)) {
196
+ // An empty filter is not a filter, so leave it out of the request.
197
+ if (value.length > 0) {
198
+ serialized.push(encodeURIComponent(key) +
199
+ '=' +
200
+ encodeURIComponent(JSON.stringify(value)));
201
+ }
202
+ }
193
203
  else if ((0, exports.isArray)(value) &&
194
204
  !(jsonKeys && jsonKeys[originalKey] === level)) {
195
205
  for (let arrIdx = 0; arrIdx < value.length; arrIdx++) {
@@ -8,7 +8,7 @@ export const Environment = {
8
8
  hostSuffix: '.chargebee.com',
9
9
  apiPath: '/api/v2',
10
10
  timeout: DEFAULT_TIME_OUT,
11
- clientVersion: 'v3.29.0',
11
+ clientVersion: 'v3.30.1',
12
12
  port: DEFAULT_PORT,
13
13
  timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
14
14
  exportWaitInMillis: DEFAULT_EXPORT_WAIT,
@@ -4229,6 +4229,61 @@ export const Endpoints = {
4229
4229
  impactedItem: [],
4230
4230
  impactedItemPrice: [],
4231
4231
  metadata: [],
4232
+ creditUnit: [
4233
+ ['list', 'GET', '/credit_units', null, false, null, false, {}, {}],
4234
+ [
4235
+ 'create',
4236
+ 'POST',
4237
+ '/credit_units',
4238
+ null,
4239
+ false,
4240
+ null,
4241
+ false,
4242
+ {},
4243
+ {
4244
+ isIdempotent: true,
4245
+ },
4246
+ ],
4247
+ [
4248
+ 'update',
4249
+ 'POST',
4250
+ '/credit_units',
4251
+ null,
4252
+ true,
4253
+ null,
4254
+ false,
4255
+ {},
4256
+ {
4257
+ isIdempotent: true,
4258
+ },
4259
+ ],
4260
+ [
4261
+ 'archive',
4262
+ 'POST',
4263
+ '/credit_units',
4264
+ '/archive_command',
4265
+ true,
4266
+ null,
4267
+ false,
4268
+ {},
4269
+ {
4270
+ isIdempotent: true,
4271
+ },
4272
+ ],
4273
+ [
4274
+ 'reactivate',
4275
+ 'POST',
4276
+ '/credit_units',
4277
+ '/reactivate_command',
4278
+ true,
4279
+ null,
4280
+ false,
4281
+ {},
4282
+ {
4283
+ isIdempotent: true,
4284
+ },
4285
+ ],
4286
+ ],
4232
4287
  subscriptionEntitlement: [
4233
4288
  [
4234
4289
  'subscriptionEntitlementsForSubscription',
@@ -5196,6 +5251,19 @@ export const Endpoints = {
5196
5251
  },
5197
5252
  {},
5198
5253
  ],
5254
+ [
5255
+ 'allocate',
5256
+ 'POST',
5257
+ '/ledger_operations',
5258
+ '/allocate',
5259
+ false,
5260
+ null,
5261
+ true,
5262
+ {
5263
+ metadata: 0,
5264
+ },
5265
+ {},
5266
+ ],
5199
5267
  ],
5200
5268
  grantBlock: [
5201
5269
  [
@@ -5210,6 +5278,7 @@ export const Endpoints = {
5210
5278
  {},
5211
5279
  ],
5212
5280
  ],
5281
+ ledgerEntry: [],
5213
5282
  promotionalGrant: [
5214
5283
  [
5215
5284
  'promotionalGrants',