autumn-js 1.2.0 → 1.2.3

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 (137) hide show
  1. package/dist/backend/adapters/express.d.mts +1 -1
  2. package/dist/backend/adapters/express.d.ts +1 -1
  3. package/dist/backend/adapters/express.js +337 -29
  4. package/dist/backend/adapters/express.mjs +9 -9
  5. package/dist/backend/adapters/fetch.d.mts +1 -1
  6. package/dist/backend/adapters/fetch.d.ts +1 -1
  7. package/dist/backend/adapters/fetch.js +337 -29
  8. package/dist/backend/adapters/fetch.mjs +9 -9
  9. package/dist/backend/adapters/hono.d.mts +1 -1
  10. package/dist/backend/adapters/hono.d.ts +1 -1
  11. package/dist/backend/adapters/hono.js +337 -29
  12. package/dist/backend/adapters/hono.mjs +9 -9
  13. package/dist/backend/adapters/index.d.mts +1 -1
  14. package/dist/backend/adapters/index.d.ts +1 -1
  15. package/dist/backend/adapters/index.js +337 -29
  16. package/dist/backend/adapters/index.mjs +12 -12
  17. package/dist/backend/adapters/next.d.mts +1 -1
  18. package/dist/backend/adapters/next.d.ts +1 -1
  19. package/dist/backend/adapters/next.js +337 -29
  20. package/dist/backend/adapters/next.mjs +9 -9
  21. package/dist/backend/{authTypes-BCoyMOAj.d.mts → authTypes-B5VxPaMo.d.mts} +14 -0
  22. package/dist/backend/{authTypes-BCoyMOAj.d.ts → authTypes-B5VxPaMo.d.ts} +14 -0
  23. package/dist/backend/{chunk-6YVVHFAT.mjs → chunk-2YEMC57K.mjs} +1 -1
  24. package/dist/backend/{chunk-MJBKNDWD.mjs → chunk-CCEZMERA.mjs} +279 -24
  25. package/dist/backend/{chunk-VR35K2UZ.mjs → chunk-ETHQSA52.mjs} +7 -7
  26. package/dist/backend/{chunk-RYP3CVST.mjs → chunk-FRKRWJ5S.mjs} +1 -1
  27. package/dist/backend/{chunk-5TDPAYPN.mjs → chunk-IFFSWLXT.mjs} +1 -1
  28. package/dist/backend/{chunk-3YYODLUY.mjs → chunk-IUFWKMTJ.mjs} +1 -1
  29. package/dist/backend/{chunk-BSY23UM3.mjs → chunk-N62MDT7U.mjs} +58 -5
  30. package/dist/backend/{chunk-JDL37I7Y.mjs → chunk-OLHAIHAX.mjs} +5 -5
  31. package/dist/backend/core/handlers/coreHandler.d.mts +2 -2
  32. package/dist/backend/core/handlers/coreHandler.d.ts +2 -2
  33. package/dist/backend/core/handlers/coreHandler.js +337 -29
  34. package/dist/backend/core/handlers/coreHandler.mjs +7 -7
  35. package/dist/backend/core/handlers/executeRoute.d.mts +2 -2
  36. package/dist/backend/core/handlers/executeRoute.d.ts +2 -2
  37. package/dist/backend/core/handlers/executeRoute.mjs +4 -4
  38. package/dist/backend/core/handlers/handleRouteByName.d.mts +1 -1
  39. package/dist/backend/core/handlers/handleRouteByName.d.ts +1 -1
  40. package/dist/backend/core/handlers/handleRouteByName.js +337 -29
  41. package/dist/backend/core/handlers/handleRouteByName.mjs +7 -7
  42. package/dist/backend/core/handlers/index.d.mts +2 -2
  43. package/dist/backend/core/handlers/index.d.ts +2 -2
  44. package/dist/backend/core/handlers/index.js +337 -29
  45. package/dist/backend/core/handlers/index.mjs +10 -10
  46. package/dist/backend/core/handlers/resolveIdentity.d.mts +1 -1
  47. package/dist/backend/core/handlers/resolveIdentity.d.ts +1 -1
  48. package/dist/backend/core/index.d.mts +2 -2
  49. package/dist/backend/core/index.d.ts +2 -2
  50. package/dist/backend/core/index.js +337 -29
  51. package/dist/backend/core/index.mjs +10 -10
  52. package/dist/backend/core/routes/index.d.mts +2 -2
  53. package/dist/backend/core/routes/index.d.ts +2 -2
  54. package/dist/backend/core/routes/index.js +58 -5
  55. package/dist/backend/core/routes/index.mjs +2 -2
  56. package/dist/backend/core/routes/routeBuilder.d.mts +2 -2
  57. package/dist/backend/core/routes/routeBuilder.d.ts +2 -2
  58. package/dist/backend/core/routes/routeConfigs.d.mts +2 -2
  59. package/dist/backend/core/routes/routeConfigs.d.ts +2 -2
  60. package/dist/backend/core/routes/routeConfigs.js +58 -5
  61. package/dist/backend/core/routes/routeConfigs.mjs +2 -2
  62. package/dist/backend/core/types/authTypes.d.mts +1 -1
  63. package/dist/backend/core/types/authTypes.d.ts +1 -1
  64. package/dist/backend/core/types/handlerTypes.d.mts +2 -2
  65. package/dist/backend/core/types/handlerTypes.d.ts +2 -2
  66. package/dist/backend/core/types/index.d.mts +2 -2
  67. package/dist/backend/core/types/index.d.ts +2 -2
  68. package/dist/backend/core/types/routeTypes.d.mts +2 -2
  69. package/dist/backend/core/types/routeTypes.d.ts +2 -2
  70. package/dist/backend/core/utils/index.mjs +3 -3
  71. package/dist/backend/index.d.mts +4 -4
  72. package/dist/backend/index.d.ts +4 -4
  73. package/dist/backend/index.js +337 -29
  74. package/dist/backend/index.mjs +10 -10
  75. package/dist/backend/{routeTypes-B7YXq83l.d.ts → routeTypes-BkSHRiCI.d.ts} +233 -2
  76. package/dist/backend/{routeTypes-BglWygTb.d.mts → routeTypes-C1hUtfD8.d.mts} +233 -2
  77. package/dist/better-auth/{chunk-LHA6NFFS.mjs → chunk-2PRVJULJ.mjs} +58 -5
  78. package/dist/better-auth/{chunk-I4LI2AOX.mjs → chunk-6J74ZVNY.mjs} +280 -25
  79. package/dist/better-auth/{chunk-TDX4NREA.mjs → chunk-IY7FPOWF.mjs} +1 -1
  80. package/dist/better-auth/index.js +337 -29
  81. package/dist/better-auth/index.mjs +3 -3
  82. package/dist/better-auth/types.d.mts +14 -0
  83. package/dist/better-auth/types.d.ts +14 -0
  84. package/dist/better-auth/utils/createAutumnEndpoint.js +58 -5
  85. package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
  86. package/dist/better-auth/utils/handleBetterAuthRoute.js +337 -29
  87. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
  88. package/dist/better-auth/utils/index.js +337 -29
  89. package/dist/better-auth/utils/index.mjs +3 -3
  90. package/dist/react/AutumnContext.d.mts +3 -3
  91. package/dist/react/AutumnContext.d.ts +3 -3
  92. package/dist/react/client/AutumnClient.d.mts +3 -3
  93. package/dist/react/client/AutumnClient.d.ts +3 -3
  94. package/dist/react/client/IAutumnClient.d.mts +7 -3
  95. package/dist/react/client/IAutumnClient.d.ts +7 -3
  96. package/dist/react/client/index.d.mts +3 -3
  97. package/dist/react/client/index.d.ts +3 -3
  98. package/dist/react/{customer-CNvpHhpS.d.mts → customer-Bb7J-_p_.d.mts} +15 -1
  99. package/dist/react/{customer-CMAtwbJl.d.ts → customer-CJSDgQMF.d.ts} +15 -1
  100. package/dist/react/hooks/index.d.mts +3 -3
  101. package/dist/react/hooks/index.d.ts +3 -3
  102. package/dist/react/hooks/internal/check/balanceToAllowed.d.mts +2 -2
  103. package/dist/react/hooks/internal/check/balanceToAllowed.d.ts +2 -2
  104. package/dist/react/hooks/internal/check/customerToFeatures.d.mts +2 -2
  105. package/dist/react/hooks/internal/check/customerToFeatures.d.ts +2 -2
  106. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.mts +2 -2
  107. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.ts +2 -2
  108. package/dist/react/hooks/internal/check/getCreditCost.d.mts +2 -2
  109. package/dist/react/hooks/internal/check/getCreditCost.d.ts +2 -2
  110. package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +3 -3
  111. package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +3 -3
  112. package/dist/react/hooks/internal/useCustomerActions.d.mts +3 -3
  113. package/dist/react/hooks/internal/useCustomerActions.d.ts +3 -3
  114. package/dist/react/hooks/useAggregateEvents.d.mts +2 -2
  115. package/dist/react/hooks/useAggregateEvents.d.ts +2 -2
  116. package/dist/react/hooks/useCustomer.d.mts +3 -3
  117. package/dist/react/hooks/useCustomer.d.ts +3 -3
  118. package/dist/react/hooks/useEntity.d.mts +2 -2
  119. package/dist/react/hooks/useEntity.d.ts +2 -2
  120. package/dist/react/hooks/useListEvents.d.mts +2 -2
  121. package/dist/react/hooks/useListEvents.d.ts +2 -2
  122. package/dist/react/hooks/useListPlans.d.mts +2 -2
  123. package/dist/react/hooks/useListPlans.d.ts +2 -2
  124. package/dist/react/hooks/useReferrals.d.mts +2 -2
  125. package/dist/react/hooks/useReferrals.d.ts +2 -2
  126. package/dist/react/index.d.mts +3 -3
  127. package/dist/react/index.d.ts +3 -3
  128. package/dist/react/{params-BmtAnULw.d.mts → params-CheyAQ0-.d.mts} +93 -2
  129. package/dist/react/{params-CL0lZNfr.d.ts → params-yCtJ7lOA.d.ts} +93 -2
  130. package/dist/react/{plan-BoMslu_O.d.mts → plan-CqxFGNk2.d.mts} +4 -0
  131. package/dist/react/{plan-BoMslu_O.d.ts → plan-CqxFGNk2.d.ts} +4 -0
  132. package/dist/sdk/index.d.mts +342 -4
  133. package/dist/sdk/index.d.ts +342 -4
  134. package/dist/sdk/index.js +384 -24
  135. package/dist/sdk/index.mjs +359 -25
  136. package/package.json +1 -1
  137. package/dist/backend/{chunk-55C2WWXQ.mjs → chunk-S5HPMJ4U.mjs} +3 -3
@@ -89,6 +89,7 @@ var eventsAggregateParamsOutboundSchema = import_v4.z.object({
89
89
  range: import_v4.z.union([import_v4.z.string(), import_v4.z.undefined()]).optional(),
90
90
  bin_size: import_v4.z.string(),
91
91
  custom_range: import_v4.z.union([aggregateEventsCustomRangeOutboundSchema, import_v4.z.undefined()]).optional(),
92
+ filter_by: import_v4.z.union([import_v4.z.record(import_v4.z.string(), import_v4.z.string()), import_v4.z.undefined()]).optional(),
92
93
  max_groups: import_v4.z.union([import_v4.z.number(), import_v4.z.undefined()]).optional()
93
94
  });
94
95
  var closedEnumSchema = import_v4.z.any();
@@ -102,6 +103,7 @@ var eventsAggregateParamsSchema = import_v4.z.object({
102
103
  range: import_v4.z.union([rangeSchema, import_v4.z.undefined()]).optional(),
103
104
  binSize: import_v4.z.union([binSizeSchema, import_v4.z.undefined()]).optional(),
104
105
  customRange: import_v4.z.union([aggregateEventsCustomRangeSchema, import_v4.z.undefined()]).optional(),
106
+ filterBy: import_v4.z.union([import_v4.z.record(import_v4.z.string(), import_v4.z.string()), import_v4.z.undefined()]).optional(),
105
107
  maxGroups: import_v4.z.union([import_v4.z.number(), import_v4.z.undefined()]).optional()
106
108
  });
107
109
 
@@ -185,6 +187,7 @@ var attachProrationOutboundSchema = import_v42.z.object({
185
187
  });
186
188
  var attachRolloverOutboundSchema = import_v42.z.object({
187
189
  max: import_v42.z.union([import_v42.z.number(), import_v42.z.undefined()]).optional(),
190
+ max_percentage: import_v42.z.union([import_v42.z.number(), import_v42.z.undefined()]).optional(),
188
191
  expiry_duration_type: import_v42.z.string(),
189
192
  expiry_duration_length: import_v42.z.union([import_v42.z.number(), import_v42.z.undefined()]).optional()
190
193
  });
@@ -285,6 +288,7 @@ var attachProrationSchema = import_v42.z.object({
285
288
  var attachExpiryDurationTypeSchema = closedEnumSchema2;
286
289
  var attachRolloverSchema = import_v42.z.object({
287
290
  max: import_v42.z.union([import_v42.z.number(), import_v42.z.undefined()]).optional(),
291
+ maxPercentage: import_v42.z.union([import_v42.z.number(), import_v42.z.undefined()]).optional(),
288
292
  expiryDurationType: attachExpiryDurationTypeSchema,
289
293
  expiryDurationLength: import_v42.z.union([import_v42.z.number(), import_v42.z.undefined()]).optional()
290
294
  });
@@ -375,6 +379,10 @@ var getOrCreateCustomerSpendLimitSchema = import_v44.z.object({
375
379
  enabled: import_v44.z.union([import_v44.z.boolean(), import_v44.z.undefined()]).optional(),
376
380
  overageLimit: import_v44.z.union([import_v44.z.number(), import_v44.z.undefined()]).optional()
377
381
  });
382
+ var getOrCreateCustomerOverageAllowedSchema = import_v44.z.object({
383
+ featureId: import_v44.z.string(),
384
+ enabled: import_v44.z.union([import_v44.z.boolean(), import_v44.z.undefined()]).optional()
385
+ });
378
386
  var getOrCreateCustomerPurchaseLimitOutboundSchema = import_v44.z.object({
379
387
  interval: import_v44.z.string(),
380
388
  interval_count: import_v44.z.number(),
@@ -399,6 +407,10 @@ var getOrCreateCustomerUsageAlertOutboundSchema = import_v44.z.object({
399
407
  threshold_type: import_v44.z.string(),
400
408
  name: import_v44.z.union([import_v44.z.string(), import_v44.z.undefined()]).optional()
401
409
  });
410
+ var getOrCreateCustomerOverageAllowedOutboundSchema = import_v44.z.object({
411
+ feature_id: import_v44.z.string(),
412
+ enabled: import_v44.z.boolean()
413
+ });
402
414
  var getOrCreateCustomerBillingControlsOutboundSchema = import_v44.z.object({
403
415
  auto_topups: import_v44.z.union([import_v44.z.array(getOrCreateCustomerAutoTopupOutboundSchema), import_v44.z.undefined()]).optional(),
404
416
  spend_limits: import_v44.z.union([
@@ -408,6 +420,10 @@ var getOrCreateCustomerBillingControlsOutboundSchema = import_v44.z.object({
408
420
  usage_alerts: import_v44.z.union([
409
421
  import_v44.z.array(getOrCreateCustomerUsageAlertOutboundSchema),
410
422
  import_v44.z.undefined()
423
+ ]).optional(),
424
+ overage_allowed: import_v44.z.union([
425
+ import_v44.z.array(getOrCreateCustomerOverageAllowedOutboundSchema),
426
+ import_v44.z.undefined()
411
427
  ]).optional()
412
428
  });
413
429
  var getOrCreateCustomerParamsOutboundSchema = import_v44.z.object({
@@ -448,7 +464,8 @@ var getOrCreateCustomerUsageAlertSchema = import_v44.z.object({
448
464
  var getOrCreateCustomerBillingControlsSchema = import_v44.z.object({
449
465
  autoTopups: import_v44.z.union([import_v44.z.array(getOrCreateCustomerAutoTopupSchema), import_v44.z.undefined()]).optional(),
450
466
  spendLimits: import_v44.z.union([import_v44.z.array(getOrCreateCustomerSpendLimitSchema), import_v44.z.undefined()]).optional(),
451
- usageAlerts: import_v44.z.union([import_v44.z.array(getOrCreateCustomerUsageAlertSchema), import_v44.z.undefined()]).optional()
467
+ usageAlerts: import_v44.z.union([import_v44.z.array(getOrCreateCustomerUsageAlertSchema), import_v44.z.undefined()]).optional(),
468
+ overageAllowed: import_v44.z.union([import_v44.z.array(getOrCreateCustomerOverageAllowedSchema), import_v44.z.undefined()]).optional()
452
469
  });
453
470
  var getOrCreateCustomerParamsSchema = import_v44.z.object({
454
471
  customerId: import_v44.z.string().nullable(),
@@ -587,6 +604,7 @@ var listPlansItemPriceSchema = import_v46.z.object({
587
604
  var listPlansExpiryDurationTypeSchema = openEnumSchema2;
588
605
  var listPlansRolloverSchema = import_v46.z.object({
589
606
  max: import_v46.z.number().nullable(),
607
+ maxPercentage: import_v46.z.union([import_v46.z.number(), import_v46.z.undefined()]).optional().nullable(),
590
608
  expiryDurationType: listPlansExpiryDurationTypeSchema,
591
609
  expiryDurationLength: import_v46.z.union([import_v46.z.number(), import_v46.z.undefined()]).optional()
592
610
  });
@@ -667,6 +685,10 @@ var multiAttachSpendLimitSchema = import_v47.z.object({
667
685
  enabled: import_v47.z.union([import_v47.z.boolean(), import_v47.z.undefined()]).optional(),
668
686
  overageLimit: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional()
669
687
  });
688
+ var multiAttachOverageAllowedSchema = import_v47.z.object({
689
+ featureId: import_v47.z.string(),
690
+ enabled: import_v47.z.union([import_v47.z.boolean(), import_v47.z.undefined()]).optional()
691
+ });
670
692
  var multiAttachInvoiceSchema = import_v47.z.object({
671
693
  status: import_v47.z.string().nullable(),
672
694
  stripeId: import_v47.z.string(),
@@ -705,6 +727,7 @@ var multiAttachProrationOutboundSchema = import_v47.z.object({
705
727
  });
706
728
  var multiAttachRolloverOutboundSchema = import_v47.z.object({
707
729
  max: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional(),
730
+ max_percentage: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional(),
708
731
  expiry_duration_type: import_v47.z.string(),
709
732
  expiry_duration_length: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional()
710
733
  });
@@ -759,9 +782,14 @@ var multiAttachUsageAlertOutboundSchema = import_v47.z.object({
759
782
  threshold_type: import_v47.z.string(),
760
783
  name: import_v47.z.union([import_v47.z.string(), import_v47.z.undefined()]).optional()
761
784
  });
785
+ var multiAttachOverageAllowedOutboundSchema = import_v47.z.object({
786
+ feature_id: import_v47.z.string(),
787
+ enabled: import_v47.z.boolean()
788
+ });
762
789
  var multiAttachBillingControlsOutboundSchema = import_v47.z.object({
763
790
  spend_limits: import_v47.z.union([import_v47.z.array(multiAttachSpendLimitOutboundSchema), import_v47.z.undefined()]).optional(),
764
- usage_alerts: import_v47.z.union([import_v47.z.array(multiAttachUsageAlertOutboundSchema), import_v47.z.undefined()]).optional()
791
+ usage_alerts: import_v47.z.union([import_v47.z.array(multiAttachUsageAlertOutboundSchema), import_v47.z.undefined()]).optional(),
792
+ overage_allowed: import_v47.z.union([import_v47.z.array(multiAttachOverageAllowedOutboundSchema), import_v47.z.undefined()]).optional()
765
793
  });
766
794
  var multiAttachEntityDataOutboundSchema = import_v47.z.object({
767
795
  feature_id: import_v47.z.string(),
@@ -805,6 +833,7 @@ var multiAttachProrationSchema = import_v47.z.object({
805
833
  var multiAttachExpiryDurationTypeSchema = closedEnumSchema4;
806
834
  var multiAttachRolloverSchema = import_v47.z.object({
807
835
  max: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional(),
836
+ maxPercentage: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional(),
808
837
  expiryDurationType: multiAttachExpiryDurationTypeSchema,
809
838
  expiryDurationLength: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional()
810
839
  });
@@ -845,7 +874,8 @@ var multiAttachUsageAlertSchema = import_v47.z.object({
845
874
  });
846
875
  var multiAttachBillingControlsSchema = import_v47.z.object({
847
876
  spendLimits: import_v47.z.union([import_v47.z.array(multiAttachSpendLimitSchema), import_v47.z.undefined()]).optional(),
848
- usageAlerts: import_v47.z.union([import_v47.z.array(multiAttachUsageAlertSchema), import_v47.z.undefined()]).optional()
877
+ usageAlerts: import_v47.z.union([import_v47.z.array(multiAttachUsageAlertSchema), import_v47.z.undefined()]).optional(),
878
+ overageAllowed: import_v47.z.union([import_v47.z.array(multiAttachOverageAllowedSchema), import_v47.z.undefined()]).optional()
849
879
  });
850
880
  var multiAttachEntityDataSchema = import_v47.z.object({
851
881
  featureId: import_v47.z.string(),
@@ -1053,6 +1083,7 @@ var previewAttachProrationOutboundSchema = import_v49.z.object({
1053
1083
  });
1054
1084
  var previewAttachRolloverOutboundSchema = import_v49.z.object({
1055
1085
  max: import_v49.z.union([import_v49.z.number(), import_v49.z.undefined()]).optional(),
1086
+ max_percentage: import_v49.z.union([import_v49.z.number(), import_v49.z.undefined()]).optional(),
1056
1087
  expiry_duration_type: import_v49.z.string(),
1057
1088
  expiry_duration_length: import_v49.z.union([import_v49.z.number(), import_v49.z.undefined()]).optional()
1058
1089
  });
@@ -1157,6 +1188,7 @@ var previewAttachProrationSchema = import_v49.z.object({
1157
1188
  var previewAttachExpiryDurationTypeSchema = closedEnumSchema5;
1158
1189
  var previewAttachRolloverSchema = import_v49.z.object({
1159
1190
  max: import_v49.z.union([import_v49.z.number(), import_v49.z.undefined()]).optional(),
1191
+ maxPercentage: import_v49.z.union([import_v49.z.number(), import_v49.z.undefined()]).optional(),
1160
1192
  expiryDurationType: previewAttachExpiryDurationTypeSchema,
1161
1193
  expiryDurationLength: import_v49.z.union([import_v49.z.number(), import_v49.z.undefined()]).optional()
1162
1194
  });
@@ -1266,6 +1298,10 @@ var previewMultiAttachSpendLimitSchema = import_v410.z.object({
1266
1298
  enabled: import_v410.z.union([import_v410.z.boolean(), import_v410.z.undefined()]).optional(),
1267
1299
  overageLimit: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional()
1268
1300
  });
1301
+ var previewMultiAttachOverageAllowedSchema = import_v410.z.object({
1302
+ featureId: import_v410.z.string(),
1303
+ enabled: import_v410.z.union([import_v410.z.boolean(), import_v410.z.undefined()]).optional()
1304
+ });
1269
1305
  var previewMultiAttachDiscountSchema = import_v410.z.object({
1270
1306
  amountOff: import_v410.z.number(),
1271
1307
  percentOff: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional(),
@@ -1367,6 +1403,7 @@ var previewMultiAttachProrationOutboundSchema = import_v410.z.object({
1367
1403
  });
1368
1404
  var previewMultiAttachRolloverOutboundSchema = import_v410.z.object({
1369
1405
  max: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional(),
1406
+ max_percentage: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional(),
1370
1407
  expiry_duration_type: import_v410.z.string(),
1371
1408
  expiry_duration_length: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional()
1372
1409
  });
@@ -1424,9 +1461,17 @@ var previewMultiAttachUsageAlertOutboundSchema = import_v410.z.object({
1424
1461
  threshold_type: import_v410.z.string(),
1425
1462
  name: import_v410.z.union([import_v410.z.string(), import_v410.z.undefined()]).optional()
1426
1463
  });
1464
+ var previewMultiAttachOverageAllowedOutboundSchema = import_v410.z.object({
1465
+ feature_id: import_v410.z.string(),
1466
+ enabled: import_v410.z.boolean()
1467
+ });
1427
1468
  var previewMultiAttachBillingControlsOutboundSchema = import_v410.z.object({
1428
1469
  spend_limits: import_v410.z.union([import_v410.z.array(previewMultiAttachSpendLimitOutboundSchema), import_v410.z.undefined()]).optional(),
1429
- usage_alerts: import_v410.z.union([import_v410.z.array(previewMultiAttachUsageAlertOutboundSchema), import_v410.z.undefined()]).optional()
1470
+ usage_alerts: import_v410.z.union([import_v410.z.array(previewMultiAttachUsageAlertOutboundSchema), import_v410.z.undefined()]).optional(),
1471
+ overage_allowed: import_v410.z.union([
1472
+ import_v410.z.array(previewMultiAttachOverageAllowedOutboundSchema),
1473
+ import_v410.z.undefined()
1474
+ ]).optional()
1430
1475
  });
1431
1476
  var previewMultiAttachEntityDataOutboundSchema = import_v410.z.object({
1432
1477
  feature_id: import_v410.z.string(),
@@ -1471,6 +1516,7 @@ var previewMultiAttachProrationSchema = import_v410.z.object({
1471
1516
  var previewMultiAttachExpiryDurationTypeSchema = closedEnumSchema6;
1472
1517
  var previewMultiAttachRolloverSchema = import_v410.z.object({
1473
1518
  max: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional(),
1519
+ maxPercentage: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional(),
1474
1520
  expiryDurationType: previewMultiAttachExpiryDurationTypeSchema,
1475
1521
  expiryDurationLength: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional()
1476
1522
  });
@@ -1514,7 +1560,8 @@ var previewMultiAttachUsageAlertSchema = import_v410.z.object({
1514
1560
  });
1515
1561
  var previewMultiAttachBillingControlsSchema = import_v410.z.object({
1516
1562
  spendLimits: import_v410.z.union([import_v410.z.array(previewMultiAttachSpendLimitSchema), import_v410.z.undefined()]).optional(),
1517
- usageAlerts: import_v410.z.union([import_v410.z.array(previewMultiAttachUsageAlertSchema), import_v410.z.undefined()]).optional()
1563
+ usageAlerts: import_v410.z.union([import_v410.z.array(previewMultiAttachUsageAlertSchema), import_v410.z.undefined()]).optional(),
1564
+ overageAllowed: import_v410.z.union([import_v410.z.array(previewMultiAttachOverageAllowedSchema), import_v410.z.undefined()]).optional()
1518
1565
  });
1519
1566
  var previewMultiAttachEntityDataSchema = import_v410.z.object({
1520
1567
  featureId: import_v410.z.string(),
@@ -1710,6 +1757,7 @@ var previewUpdateProrationOutboundSchema = import_v411.z.object({
1710
1757
  });
1711
1758
  var previewUpdateRolloverOutboundSchema = import_v411.z.object({
1712
1759
  max: import_v411.z.union([import_v411.z.number(), import_v411.z.undefined()]).optional(),
1760
+ max_percentage: import_v411.z.union([import_v411.z.number(), import_v411.z.undefined()]).optional(),
1713
1761
  expiry_duration_type: import_v411.z.string(),
1714
1762
  expiry_duration_length: import_v411.z.union([import_v411.z.number(), import_v411.z.undefined()]).optional()
1715
1763
  });
@@ -1794,6 +1842,7 @@ var previewUpdateProrationSchema = import_v411.z.object({
1794
1842
  var previewUpdateExpiryDurationTypeSchema = closedEnumSchema7;
1795
1843
  var previewUpdateRolloverSchema = import_v411.z.object({
1796
1844
  max: import_v411.z.union([import_v411.z.number(), import_v411.z.undefined()]).optional(),
1845
+ maxPercentage: import_v411.z.union([import_v411.z.number(), import_v411.z.undefined()]).optional(),
1797
1846
  expiryDurationType: previewUpdateExpiryDurationTypeSchema,
1798
1847
  expiryDurationLength: import_v411.z.union([import_v411.z.number(), import_v411.z.undefined()]).optional()
1799
1848
  });
@@ -1957,6 +2006,7 @@ var setupPaymentProrationOutboundSchema = import_v413.z.object({
1957
2006
  });
1958
2007
  var setupPaymentRolloverOutboundSchema = import_v413.z.object({
1959
2008
  max: import_v413.z.union([import_v413.z.number(), import_v413.z.undefined()]).optional(),
2009
+ max_percentage: import_v413.z.union([import_v413.z.number(), import_v413.z.undefined()]).optional(),
1960
2010
  expiry_duration_type: import_v413.z.string(),
1961
2011
  expiry_duration_length: import_v413.z.union([import_v413.z.number(), import_v413.z.undefined()]).optional()
1962
2012
  });
@@ -2047,6 +2097,7 @@ var setupPaymentProrationSchema = import_v413.z.object({
2047
2097
  var setupPaymentExpiryDurationTypeSchema = closedEnumSchema8;
2048
2098
  var setupPaymentRolloverSchema = import_v413.z.object({
2049
2099
  max: import_v413.z.union([import_v413.z.number(), import_v413.z.undefined()]).optional(),
2100
+ maxPercentage: import_v413.z.union([import_v413.z.number(), import_v413.z.undefined()]).optional(),
2050
2101
  expiryDurationType: setupPaymentExpiryDurationTypeSchema,
2051
2102
  expiryDurationLength: import_v413.z.union([import_v413.z.number(), import_v413.z.undefined()]).optional()
2052
2103
  });
@@ -2157,6 +2208,7 @@ var billingUpdateProrationOutboundSchema = import_v414.z.object({
2157
2208
  });
2158
2209
  var billingUpdateRolloverOutboundSchema = import_v414.z.object({
2159
2210
  max: import_v414.z.union([import_v414.z.number(), import_v414.z.undefined()]).optional(),
2211
+ max_percentage: import_v414.z.union([import_v414.z.number(), import_v414.z.undefined()]).optional(),
2160
2212
  expiry_duration_type: import_v414.z.string(),
2161
2213
  expiry_duration_length: import_v414.z.union([import_v414.z.number(), import_v414.z.undefined()]).optional()
2162
2214
  });
@@ -2237,6 +2289,7 @@ var billingUpdateProrationSchema = import_v414.z.object({
2237
2289
  var billingUpdateExpiryDurationTypeSchema = closedEnumSchema9;
2238
2290
  var billingUpdateRolloverSchema = import_v414.z.object({
2239
2291
  max: import_v414.z.union([import_v414.z.number(), import_v414.z.undefined()]).optional(),
2292
+ maxPercentage: import_v414.z.union([import_v414.z.number(), import_v414.z.undefined()]).optional(),
2240
2293
  expiryDurationType: billingUpdateExpiryDurationTypeSchema,
2241
2294
  expiryDurationLength: import_v414.z.union([import_v414.z.number(), import_v414.z.undefined()]).optional()
2242
2295
  });
@@ -2576,8 +2629,8 @@ var SDK_METADATA = {
2576
2629
  language: "typescript",
2577
2630
  openapiDocVersion: "2.2.0",
2578
2631
  sdkVersion: "0.10.17",
2579
- genVersion: "2.869.25",
2580
- userAgent: "speakeasy-sdk/typescript 0.10.17 2.869.25 2.2.0 @useautumn/sdk"
2632
+ genVersion: "2.879.1",
2633
+ userAgent: "speakeasy-sdk/typescript 0.10.17 2.879.1 2.2.0 @useautumn/sdk"
2581
2634
  };
2582
2635
 
2583
2636
  // ../sdk/src/lib/http.ts
@@ -3499,8 +3552,8 @@ function applyBearer(state, spec) {
3499
3552
  state.headers[spec.fieldName] = value;
3500
3553
  }
3501
3554
  }
3502
- function resolveGlobalSecurity(security) {
3503
- return resolveSecurity(
3555
+ function resolveGlobalSecurity(security, allowedFields) {
3556
+ let inputs = [
3504
3557
  [
3505
3558
  {
3506
3559
  fieldName: "Authorization",
@@ -3508,7 +3561,16 @@ function resolveGlobalSecurity(security) {
3508
3561
  value: security?.secretKey ?? env().AUTUMN_SECRET_KEY
3509
3562
  }
3510
3563
  ]
3511
- );
3564
+ ];
3565
+ if (allowedFields) {
3566
+ inputs = allowedFields.map((i) => {
3567
+ if (i < 0 || i >= inputs.length) {
3568
+ throw new RangeError(`invalid allowedFields index ${i}`);
3569
+ }
3570
+ return inputs[i];
3571
+ });
3572
+ }
3573
+ return resolveSecurity(...inputs);
3512
3574
  }
3513
3575
  async function extractSecurity(sec) {
3514
3576
  if (sec == null) {
@@ -3835,6 +3897,7 @@ var EventsAggregateParams$outboundSchema = z24.pipe(
3835
3897
  customRange: z24.optional(
3836
3898
  z24.lazy(() => AggregateEventsCustomRange$outboundSchema)
3837
3899
  ),
3900
+ filterBy: z24.optional(z24.record(z24.string(), z24.string())),
3838
3901
  maxGroups: z24.optional(z24.int())
3839
3902
  }),
3840
3903
  z24.transform((v) => {
@@ -3845,6 +3908,7 @@ var EventsAggregateParams$outboundSchema = z24.pipe(
3845
3908
  groupBy: "group_by",
3846
3909
  binSize: "bin_size",
3847
3910
  customRange: "custom_range",
3911
+ filterBy: "filter_by",
3848
3912
  maxGroups: "max_groups"
3849
3913
  });
3850
3914
  })
@@ -4053,11 +4117,13 @@ var AttachExpiryDurationType$outboundSchema = z26.enum(AttachExpiryDurationType)
4053
4117
  var AttachRollover$outboundSchema = z26.pipe(
4054
4118
  z26.object({
4055
4119
  max: z26.optional(z26.number()),
4120
+ maxPercentage: z26.optional(z26.number()),
4056
4121
  expiryDurationType: AttachExpiryDurationType$outboundSchema,
4057
4122
  expiryDurationLength: z26.optional(z26.number())
4058
4123
  }),
4059
4124
  z26.transform((v) => {
4060
4125
  return remap(v, {
4126
+ maxPercentage: "max_percentage",
4061
4127
  expiryDurationType: "expiry_duration_type",
4062
4128
  expiryDurationLength: "expiry_duration_length"
4063
4129
  });
@@ -4582,11 +4648,13 @@ var BillingUpdateExpiryDurationType$outboundSchema = z28.enum(BillingUpdateExpir
4582
4648
  var BillingUpdateRollover$outboundSchema = z28.pipe(
4583
4649
  z28.object({
4584
4650
  max: z28.optional(z28.number()),
4651
+ maxPercentage: z28.optional(z28.number()),
4585
4652
  expiryDurationType: BillingUpdateExpiryDurationType$outboundSchema,
4586
4653
  expiryDurationLength: z28.optional(z28.number())
4587
4654
  }),
4588
4655
  z28.transform((v) => {
4589
4656
  return remap(v, {
4657
+ maxPercentage: "max_percentage",
4590
4658
  expiryDurationType: "expiry_duration_type",
4591
4659
  expiryDurationLength: "expiry_duration_length"
4592
4660
  });
@@ -4928,11 +4996,19 @@ var ProductDisplay$inboundSchema = z29.pipe(
4928
4996
  })
4929
4997
  );
4930
4998
  var RolloverDuration$inboundSchema = inboundSchema(RolloverDuration);
4931
- var CheckRollover$inboundSchema = z29.object({
4932
- max: nullable(number2()),
4933
- duration: z29._default(RolloverDuration$inboundSchema, "month"),
4934
- length: number2()
4935
- });
4999
+ var CheckRollover$inboundSchema = z29.pipe(
5000
+ z29.object({
5001
+ max: z29.optional(z29.nullable(number2())),
5002
+ max_percentage: z29.optional(z29.nullable(number2())),
5003
+ duration: z29._default(RolloverDuration$inboundSchema, "month"),
5004
+ length: number2()
5005
+ }),
5006
+ z29.transform((v) => {
5007
+ return remap(v, {
5008
+ "max_percentage": "maxPercentage"
5009
+ });
5010
+ })
5011
+ );
4936
5012
  var CheckOnIncrease$inboundSchema = inboundSchema(CheckOnIncrease);
4937
5013
  var CheckOnDecrease$inboundSchema = inboundSchema(CheckOnDecrease);
4938
5014
  var Config$inboundSchema = z29.pipe(
@@ -5209,6 +5285,17 @@ var CustomerDataUsageAlert$outboundSchema = z31.pipe(
5209
5285
  });
5210
5286
  })
5211
5287
  );
5288
+ var CustomerDataOverageAllowed$outboundSchema = z31.pipe(
5289
+ z31.object({
5290
+ featureId: z31.string(),
5291
+ enabled: z31._default(z31.boolean(), false)
5292
+ }),
5293
+ z31.transform((v) => {
5294
+ return remap(v, {
5295
+ featureId: "feature_id"
5296
+ });
5297
+ })
5298
+ );
5212
5299
  var CustomerDataBillingControls$outboundSchema = z31.pipe(
5213
5300
  z31.object({
5214
5301
  autoTopups: z31.optional(
@@ -5219,13 +5306,17 @@ var CustomerDataBillingControls$outboundSchema = z31.pipe(
5219
5306
  ),
5220
5307
  usageAlerts: z31.optional(
5221
5308
  z31.array(z31.lazy(() => CustomerDataUsageAlert$outboundSchema))
5309
+ ),
5310
+ overageAllowed: z31.optional(
5311
+ z31.array(z31.lazy(() => CustomerDataOverageAllowed$outboundSchema))
5222
5312
  )
5223
5313
  }),
5224
5314
  z31.transform((v) => {
5225
5315
  return remap(v, {
5226
5316
  autoTopups: "auto_topups",
5227
5317
  spendLimits: "spend_limits",
5228
- usageAlerts: "usage_alerts"
5318
+ usageAlerts: "usage_alerts",
5319
+ overageAllowed: "overage_allowed"
5229
5320
  });
5230
5321
  })
5231
5322
  );
@@ -5436,11 +5527,13 @@ var ExpiryDurationType$inboundSchema = inboundSchema(ExpiryDurationType);
5436
5527
  var PlanRollover$inboundSchema = z32.pipe(
5437
5528
  z32.object({
5438
5529
  max: nullable(number2()),
5530
+ max_percentage: z32.optional(z32.nullable(number2())),
5439
5531
  expiry_duration_type: ExpiryDurationType$inboundSchema,
5440
5532
  expiry_duration_length: optional2(number2())
5441
5533
  }),
5442
5534
  z32.transform((v) => {
5443
5535
  return remap(v, {
5536
+ "max_percentage": "maxPercentage",
5444
5537
  "expiry_duration_type": "expiryDurationType",
5445
5538
  "expiry_duration_length": "expiryDurationLength"
5446
5539
  });
@@ -5579,6 +5672,17 @@ var CreateEntityUsageAlertRequestBody$outboundSchema = z33.pipe(
5579
5672
  });
5580
5673
  })
5581
5674
  );
5675
+ var CreateEntityOverageAllowedRequest$outboundSchema = z33.pipe(
5676
+ z33.object({
5677
+ featureId: z33.string(),
5678
+ enabled: z33._default(z33.boolean(), false)
5679
+ }),
5680
+ z33.transform((v) => {
5681
+ return remap(v, {
5682
+ featureId: "feature_id"
5683
+ });
5684
+ })
5685
+ );
5582
5686
  var CreateEntityBillingControlsRequest$outboundSchema = z33.pipe(
5583
5687
  z33.object({
5584
5688
  spendLimits: z33.optional(
@@ -5586,12 +5690,16 @@ var CreateEntityBillingControlsRequest$outboundSchema = z33.pipe(
5586
5690
  ),
5587
5691
  usageAlerts: z33.optional(
5588
5692
  z33.array(z33.lazy(() => CreateEntityUsageAlertRequestBody$outboundSchema))
5693
+ ),
5694
+ overageAllowed: z33.optional(
5695
+ z33.array(z33.lazy(() => CreateEntityOverageAllowedRequest$outboundSchema))
5589
5696
  )
5590
5697
  }),
5591
5698
  z33.transform((v) => {
5592
5699
  return remap(v, {
5593
5700
  spendLimits: "spend_limits",
5594
- usageAlerts: "usage_alerts"
5701
+ usageAlerts: "usage_alerts",
5702
+ overageAllowed: "overage_allowed"
5595
5703
  });
5596
5704
  })
5597
5705
  );
@@ -5748,6 +5856,17 @@ var CreateEntityUsageAlertResponse$inboundSchema = z33.pipe(
5748
5856
  });
5749
5857
  })
5750
5858
  );
5859
+ var CreateEntityOverageAllowedResponse$inboundSchema = z33.pipe(
5860
+ z33.object({
5861
+ feature_id: string4(),
5862
+ enabled: z33._default(boolean2(), false)
5863
+ }),
5864
+ z33.transform((v) => {
5865
+ return remap(v, {
5866
+ "feature_id": "featureId"
5867
+ });
5868
+ })
5869
+ );
5751
5870
  var CreateEntityBillingControlsResponse$inboundSchema = z33.pipe(
5752
5871
  z33.object({
5753
5872
  spend_limits: optional2(
@@ -5755,12 +5874,16 @@ var CreateEntityBillingControlsResponse$inboundSchema = z33.pipe(
5755
5874
  ),
5756
5875
  usage_alerts: optional2(
5757
5876
  z33.array(z33.lazy(() => CreateEntityUsageAlertResponse$inboundSchema))
5877
+ ),
5878
+ overage_allowed: optional2(
5879
+ z33.array(z33.lazy(() => CreateEntityOverageAllowedResponse$inboundSchema))
5758
5880
  )
5759
5881
  }),
5760
5882
  z33.transform((v) => {
5761
5883
  return remap(v, {
5762
5884
  "spend_limits": "spendLimits",
5763
- "usage_alerts": "usageAlerts"
5885
+ "usage_alerts": "usageAlerts",
5886
+ "overage_allowed": "overageAllowed"
5764
5887
  });
5765
5888
  })
5766
5889
  );
@@ -6110,11 +6233,13 @@ var CreatePlanExpiryDurationTypeRequest$outboundSchema = z35.enum(CreatePlanExpi
6110
6233
  var CreatePlanRolloverRequest$outboundSchema = z35.pipe(
6111
6234
  z35.object({
6112
6235
  max: z35.optional(z35.number()),
6236
+ maxPercentage: z35.optional(z35.number()),
6113
6237
  expiryDurationType: CreatePlanExpiryDurationTypeRequest$outboundSchema,
6114
6238
  expiryDurationLength: z35.optional(z35.number())
6115
6239
  }),
6116
6240
  z35.transform((v) => {
6117
6241
  return remap(v, {
6242
+ maxPercentage: "max_percentage",
6118
6243
  expiryDurationType: "expiry_duration_type",
6119
6244
  expiryDurationLength: "expiry_duration_length"
6120
6245
  });
@@ -6291,11 +6416,13 @@ var CreatePlanExpiryDurationTypeResponse$inboundSchema = inboundSchema(CreatePla
6291
6416
  var CreatePlanRolloverResponse$inboundSchema = z35.pipe(
6292
6417
  z35.object({
6293
6418
  max: nullable(number2()),
6419
+ max_percentage: z35.optional(z35.nullable(number2())),
6294
6420
  expiry_duration_type: CreatePlanExpiryDurationTypeResponse$inboundSchema,
6295
6421
  expiry_duration_length: optional2(number2())
6296
6422
  }),
6297
6423
  z35.transform((v) => {
6298
6424
  return remap(v, {
6425
+ "max_percentage": "maxPercentage",
6299
6426
  "expiry_duration_type": "expiryDurationType",
6300
6427
  "expiry_duration_length": "expiryDurationLength"
6301
6428
  });
@@ -6517,6 +6644,17 @@ var CustomerUsageAlert$inboundSchema = z37.pipe(
6517
6644
  });
6518
6645
  })
6519
6646
  );
6647
+ var CustomerOverageAllowed$inboundSchema = z37.pipe(
6648
+ z37.object({
6649
+ feature_id: string4(),
6650
+ enabled: z37._default(boolean2(), false)
6651
+ }),
6652
+ z37.transform((v) => {
6653
+ return remap(v, {
6654
+ "feature_id": "featureId"
6655
+ });
6656
+ })
6657
+ );
6520
6658
  var CustomerBillingControls$inboundSchema = z37.pipe(
6521
6659
  z37.object({
6522
6660
  auto_topups: optional2(
@@ -6527,13 +6665,17 @@ var CustomerBillingControls$inboundSchema = z37.pipe(
6527
6665
  ),
6528
6666
  usage_alerts: optional2(
6529
6667
  z37.array(z37.lazy(() => CustomerUsageAlert$inboundSchema))
6668
+ ),
6669
+ overage_allowed: optional2(
6670
+ z37.array(z37.lazy(() => CustomerOverageAllowed$inboundSchema))
6530
6671
  )
6531
6672
  }),
6532
6673
  z37.transform((v) => {
6533
6674
  return remap(v, {
6534
6675
  "auto_topups": "autoTopups",
6535
6676
  "spend_limits": "spendLimits",
6536
- "usage_alerts": "usageAlerts"
6677
+ "usage_alerts": "usageAlerts",
6678
+ "overage_allowed": "overageAllowed"
6537
6679
  });
6538
6680
  })
6539
6681
  );
@@ -7072,6 +7214,17 @@ var GetEntityUsageAlert$inboundSchema = z44.pipe(
7072
7214
  });
7073
7215
  })
7074
7216
  );
7217
+ var GetEntityOverageAllowed$inboundSchema = z44.pipe(
7218
+ z44.object({
7219
+ feature_id: string4(),
7220
+ enabled: z44._default(boolean2(), false)
7221
+ }),
7222
+ z44.transform((v) => {
7223
+ return remap(v, {
7224
+ "feature_id": "featureId"
7225
+ });
7226
+ })
7227
+ );
7075
7228
  var GetEntityBillingControls$inboundSchema = z44.pipe(
7076
7229
  z44.object({
7077
7230
  spend_limits: optional2(
@@ -7079,12 +7232,16 @@ var GetEntityBillingControls$inboundSchema = z44.pipe(
7079
7232
  ),
7080
7233
  usage_alerts: optional2(
7081
7234
  z44.array(z44.lazy(() => GetEntityUsageAlert$inboundSchema))
7235
+ ),
7236
+ overage_allowed: optional2(
7237
+ z44.array(z44.lazy(() => GetEntityOverageAllowed$inboundSchema))
7082
7238
  )
7083
7239
  }),
7084
7240
  z44.transform((v) => {
7085
7241
  return remap(v, {
7086
7242
  "spend_limits": "spendLimits",
7087
- "usage_alerts": "usageAlerts"
7243
+ "usage_alerts": "usageAlerts",
7244
+ "overage_allowed": "overageAllowed"
7088
7245
  });
7089
7246
  })
7090
7247
  );
@@ -7262,6 +7419,17 @@ var GetOrCreateCustomerUsageAlert$outboundSchema = z46.pipe(
7262
7419
  });
7263
7420
  })
7264
7421
  );
7422
+ var GetOrCreateCustomerOverageAllowed$outboundSchema = z46.pipe(
7423
+ z46.object({
7424
+ featureId: z46.string(),
7425
+ enabled: z46._default(z46.boolean(), false)
7426
+ }),
7427
+ z46.transform((v) => {
7428
+ return remap(v, {
7429
+ featureId: "feature_id"
7430
+ });
7431
+ })
7432
+ );
7265
7433
  var GetOrCreateCustomerBillingControls$outboundSchema = z46.pipe(
7266
7434
  z46.object({
7267
7435
  autoTopups: z46.optional(
@@ -7272,13 +7440,17 @@ var GetOrCreateCustomerBillingControls$outboundSchema = z46.pipe(
7272
7440
  ),
7273
7441
  usageAlerts: z46.optional(
7274
7442
  z46.array(z46.lazy(() => GetOrCreateCustomerUsageAlert$outboundSchema))
7443
+ ),
7444
+ overageAllowed: z46.optional(
7445
+ z46.array(z46.lazy(() => GetOrCreateCustomerOverageAllowed$outboundSchema))
7275
7446
  )
7276
7447
  }),
7277
7448
  z46.transform((v) => {
7278
7449
  return remap(v, {
7279
7450
  autoTopups: "auto_topups",
7280
7451
  spendLimits: "spend_limits",
7281
- usageAlerts: "usage_alerts"
7452
+ usageAlerts: "usage_alerts",
7453
+ overageAllowed: "overage_allowed"
7282
7454
  });
7283
7455
  })
7284
7456
  );
@@ -7503,11 +7675,13 @@ var GetPlanExpiryDurationType$inboundSchema = inboundSchema(GetPlanExpiryDuratio
7503
7675
  var GetPlanRollover$inboundSchema = z47.pipe(
7504
7676
  z47.object({
7505
7677
  max: nullable(number2()),
7678
+ max_percentage: z47.optional(z47.nullable(number2())),
7506
7679
  expiry_duration_type: GetPlanExpiryDurationType$inboundSchema,
7507
7680
  expiry_duration_length: optional2(number2())
7508
7681
  }),
7509
7682
  z47.transform((v) => {
7510
7683
  return remap(v, {
7684
+ "max_percentage": "maxPercentage",
7511
7685
  "expiry_duration_type": "expiryDurationType",
7512
7686
  "expiry_duration_length": "expiryDurationLength"
7513
7687
  });
@@ -7735,6 +7909,17 @@ var ListCustomersUsageAlert$inboundSchema = z48.pipe(
7735
7909
  });
7736
7910
  })
7737
7911
  );
7912
+ var ListCustomersOverageAllowed$inboundSchema = z48.pipe(
7913
+ z48.object({
7914
+ feature_id: string4(),
7915
+ enabled: z48._default(boolean2(), false)
7916
+ }),
7917
+ z48.transform((v) => {
7918
+ return remap(v, {
7919
+ "feature_id": "featureId"
7920
+ });
7921
+ })
7922
+ );
7738
7923
  var ListCustomersBillingControls$inboundSchema = z48.pipe(
7739
7924
  z48.object({
7740
7925
  auto_topups: optional2(
@@ -7745,13 +7930,17 @@ var ListCustomersBillingControls$inboundSchema = z48.pipe(
7745
7930
  ),
7746
7931
  usage_alerts: optional2(
7747
7932
  z48.array(z48.lazy(() => ListCustomersUsageAlert$inboundSchema))
7933
+ ),
7934
+ overage_allowed: optional2(
7935
+ z48.array(z48.lazy(() => ListCustomersOverageAllowed$inboundSchema))
7748
7936
  )
7749
7937
  }),
7750
7938
  z48.transform((v) => {
7751
7939
  return remap(v, {
7752
7940
  "auto_topups": "autoTopups",
7753
7941
  "spend_limits": "spendLimits",
7754
- "usage_alerts": "usageAlerts"
7942
+ "usage_alerts": "usageAlerts",
7943
+ "overage_allowed": "overageAllowed"
7755
7944
  });
7756
7945
  })
7757
7946
  );
@@ -8206,11 +8395,13 @@ var ListPlansExpiryDurationType$inboundSchema = inboundSchema(ListPlansExpiryDur
8206
8395
  var ListPlansRollover$inboundSchema = z51.pipe(
8207
8396
  z51.object({
8208
8397
  max: nullable(number2()),
8398
+ max_percentage: z51.optional(z51.nullable(number2())),
8209
8399
  expiry_duration_type: ListPlansExpiryDurationType$inboundSchema,
8210
8400
  expiry_duration_length: optional2(number2())
8211
8401
  }),
8212
8402
  z51.transform((v) => {
8213
8403
  return remap(v, {
8404
+ "max_percentage": "maxPercentage",
8214
8405
  "expiry_duration_type": "expiryDurationType",
8215
8406
  "expiry_duration_length": "expiryDurationLength"
8216
8407
  });
@@ -8454,11 +8645,13 @@ var MultiAttachExpiryDurationType$outboundSchema = z52.enum(MultiAttachExpiryDur
8454
8645
  var MultiAttachRollover$outboundSchema = z52.pipe(
8455
8646
  z52.object({
8456
8647
  max: z52.optional(z52.number()),
8648
+ maxPercentage: z52.optional(z52.number()),
8457
8649
  expiryDurationType: MultiAttachExpiryDurationType$outboundSchema,
8458
8650
  expiryDurationLength: z52.optional(z52.number())
8459
8651
  }),
8460
8652
  z52.transform((v) => {
8461
8653
  return remap(v, {
8654
+ maxPercentage: "max_percentage",
8462
8655
  expiryDurationType: "expiry_duration_type",
8463
8656
  expiryDurationLength: "expiry_duration_length"
8464
8657
  });
@@ -8585,6 +8778,17 @@ var MultiAttachUsageAlert$outboundSchema = z52.pipe(
8585
8778
  });
8586
8779
  })
8587
8780
  );
8781
+ var MultiAttachOverageAllowed$outboundSchema = z52.pipe(
8782
+ z52.object({
8783
+ featureId: z52.string(),
8784
+ enabled: z52._default(z52.boolean(), false)
8785
+ }),
8786
+ z52.transform((v) => {
8787
+ return remap(v, {
8788
+ featureId: "feature_id"
8789
+ });
8790
+ })
8791
+ );
8588
8792
  var MultiAttachBillingControls$outboundSchema = z52.pipe(
8589
8793
  z52.object({
8590
8794
  spendLimits: z52.optional(
@@ -8592,12 +8796,16 @@ var MultiAttachBillingControls$outboundSchema = z52.pipe(
8592
8796
  ),
8593
8797
  usageAlerts: z52.optional(
8594
8798
  z52.array(z52.lazy(() => MultiAttachUsageAlert$outboundSchema))
8799
+ ),
8800
+ overageAllowed: z52.optional(
8801
+ z52.array(z52.lazy(() => MultiAttachOverageAllowed$outboundSchema))
8595
8802
  )
8596
8803
  }),
8597
8804
  z52.transform((v) => {
8598
8805
  return remap(v, {
8599
8806
  spendLimits: "spend_limits",
8600
- usageAlerts: "usage_alerts"
8807
+ usageAlerts: "usage_alerts",
8808
+ overageAllowed: "overage_allowed"
8601
8809
  });
8602
8810
  })
8603
8811
  );
@@ -8891,11 +9099,13 @@ var PreviewAttachExpiryDurationType$outboundSchema = z54.enum(PreviewAttachExpir
8891
9099
  var PreviewAttachRollover$outboundSchema = z54.pipe(
8892
9100
  z54.object({
8893
9101
  max: z54.optional(z54.number()),
9102
+ maxPercentage: z54.optional(z54.number()),
8894
9103
  expiryDurationType: PreviewAttachExpiryDurationType$outboundSchema,
8895
9104
  expiryDurationLength: z54.optional(z54.number())
8896
9105
  }),
8897
9106
  z54.transform((v) => {
8898
9107
  return remap(v, {
9108
+ maxPercentage: "max_percentage",
8899
9109
  expiryDurationType: "expiry_duration_type",
8900
9110
  expiryDurationLength: "expiry_duration_length"
8901
9111
  });
@@ -9439,11 +9649,13 @@ var PreviewMultiAttachExpiryDurationType$outboundSchema = z55.enum(PreviewMultiA
9439
9649
  var PreviewMultiAttachRollover$outboundSchema = z55.pipe(
9440
9650
  z55.object({
9441
9651
  max: z55.optional(z55.number()),
9652
+ maxPercentage: z55.optional(z55.number()),
9442
9653
  expiryDurationType: PreviewMultiAttachExpiryDurationType$outboundSchema,
9443
9654
  expiryDurationLength: z55.optional(z55.number())
9444
9655
  }),
9445
9656
  z55.transform((v) => {
9446
9657
  return remap(v, {
9658
+ maxPercentage: "max_percentage",
9447
9659
  expiryDurationType: "expiry_duration_type",
9448
9660
  expiryDurationLength: "expiry_duration_length"
9449
9661
  });
@@ -9583,6 +9795,17 @@ var PreviewMultiAttachUsageAlert$outboundSchema = z55.pipe(
9583
9795
  });
9584
9796
  })
9585
9797
  );
9798
+ var PreviewMultiAttachOverageAllowed$outboundSchema = z55.pipe(
9799
+ z55.object({
9800
+ featureId: z55.string(),
9801
+ enabled: z55._default(z55.boolean(), false)
9802
+ }),
9803
+ z55.transform((v) => {
9804
+ return remap(v, {
9805
+ featureId: "feature_id"
9806
+ });
9807
+ })
9808
+ );
9586
9809
  var PreviewMultiAttachBillingControls$outboundSchema = z55.pipe(
9587
9810
  z55.object({
9588
9811
  spendLimits: z55.optional(
@@ -9590,12 +9813,16 @@ var PreviewMultiAttachBillingControls$outboundSchema = z55.pipe(
9590
9813
  ),
9591
9814
  usageAlerts: z55.optional(
9592
9815
  z55.array(z55.lazy(() => PreviewMultiAttachUsageAlert$outboundSchema))
9816
+ ),
9817
+ overageAllowed: z55.optional(
9818
+ z55.array(z55.lazy(() => PreviewMultiAttachOverageAllowed$outboundSchema))
9593
9819
  )
9594
9820
  }),
9595
9821
  z55.transform((v) => {
9596
9822
  return remap(v, {
9597
9823
  spendLimits: "spend_limits",
9598
- usageAlerts: "usage_alerts"
9824
+ usageAlerts: "usage_alerts",
9825
+ overageAllowed: "overage_allowed"
9599
9826
  });
9600
9827
  })
9601
9828
  );
@@ -10051,11 +10278,13 @@ var PreviewUpdateExpiryDurationType$outboundSchema = z56.enum(PreviewUpdateExpir
10051
10278
  var PreviewUpdateRollover$outboundSchema = z56.pipe(
10052
10279
  z56.object({
10053
10280
  max: z56.optional(z56.number()),
10281
+ maxPercentage: z56.optional(z56.number()),
10054
10282
  expiryDurationType: PreviewUpdateExpiryDurationType$outboundSchema,
10055
10283
  expiryDurationLength: z56.optional(z56.number())
10056
10284
  }),
10057
10285
  z56.transform((v) => {
10058
10286
  return remap(v, {
10287
+ maxPercentage: "max_percentage",
10059
10288
  expiryDurationType: "expiry_duration_type",
10060
10289
  expiryDurationLength: "expiry_duration_length"
10061
10290
  });
@@ -10571,11 +10800,13 @@ var SetupPaymentExpiryDurationType$outboundSchema = z58.enum(SetupPaymentExpiryD
10571
10800
  var SetupPaymentRollover$outboundSchema = z58.pipe(
10572
10801
  z58.object({
10573
10802
  max: z58.optional(z58.number()),
10803
+ maxPercentage: z58.optional(z58.number()),
10574
10804
  expiryDurationType: SetupPaymentExpiryDurationType$outboundSchema,
10575
10805
  expiryDurationLength: z58.optional(z58.number())
10576
10806
  }),
10577
10807
  z58.transform((v) => {
10578
10808
  return remap(v, {
10809
+ maxPercentage: "max_percentage",
10579
10810
  expiryDurationType: "expiry_duration_type",
10580
10811
  expiryDurationLength: "expiry_duration_length"
10581
10812
  });
@@ -10920,6 +11151,17 @@ var UpdateCustomerUsageAlertRequestBody$outboundSchema = z61.pipe(
10920
11151
  });
10921
11152
  })
10922
11153
  );
11154
+ var UpdateCustomerOverageAllowedRequest$outboundSchema = z61.pipe(
11155
+ z61.object({
11156
+ featureId: z61.string(),
11157
+ enabled: z61._default(z61.boolean(), false)
11158
+ }),
11159
+ z61.transform((v) => {
11160
+ return remap(v, {
11161
+ featureId: "feature_id"
11162
+ });
11163
+ })
11164
+ );
10923
11165
  var UpdateCustomerBillingControlsRequest$outboundSchema = z61.pipe(
10924
11166
  z61.object({
10925
11167
  autoTopups: z61.optional(
@@ -10930,13 +11172,17 @@ var UpdateCustomerBillingControlsRequest$outboundSchema = z61.pipe(
10930
11172
  ),
10931
11173
  usageAlerts: z61.optional(
10932
11174
  z61.array(z61.lazy(() => UpdateCustomerUsageAlertRequestBody$outboundSchema))
11175
+ ),
11176
+ overageAllowed: z61.optional(
11177
+ z61.array(z61.lazy(() => UpdateCustomerOverageAllowedRequest$outboundSchema))
10933
11178
  )
10934
11179
  }),
10935
11180
  z61.transform((v) => {
10936
11181
  return remap(v, {
10937
11182
  autoTopups: "auto_topups",
10938
11183
  spendLimits: "spend_limits",
10939
- usageAlerts: "usage_alerts"
11184
+ usageAlerts: "usage_alerts",
11185
+ overageAllowed: "overage_allowed"
10940
11186
  });
10941
11187
  })
10942
11188
  );
@@ -11024,6 +11270,17 @@ var UpdateCustomerUsageAlertResponse$inboundSchema = z61.pipe(
11024
11270
  });
11025
11271
  })
11026
11272
  );
11273
+ var UpdateCustomerOverageAllowedResponse$inboundSchema = z61.pipe(
11274
+ z61.object({
11275
+ feature_id: string4(),
11276
+ enabled: z61._default(boolean2(), false)
11277
+ }),
11278
+ z61.transform((v) => {
11279
+ return remap(v, {
11280
+ "feature_id": "featureId"
11281
+ });
11282
+ })
11283
+ );
11027
11284
  var UpdateCustomerBillingControlsResponse$inboundSchema = z61.pipe(
11028
11285
  z61.object({
11029
11286
  auto_topups: optional2(
@@ -11034,13 +11291,17 @@ var UpdateCustomerBillingControlsResponse$inboundSchema = z61.pipe(
11034
11291
  ),
11035
11292
  usage_alerts: optional2(
11036
11293
  z61.array(z61.lazy(() => UpdateCustomerUsageAlertResponse$inboundSchema))
11294
+ ),
11295
+ overage_allowed: optional2(
11296
+ z61.array(z61.lazy(() => UpdateCustomerOverageAllowedResponse$inboundSchema))
11037
11297
  )
11038
11298
  }),
11039
11299
  z61.transform((v) => {
11040
11300
  return remap(v, {
11041
11301
  "auto_topups": "autoTopups",
11042
11302
  "spend_limits": "spendLimits",
11043
- "usage_alerts": "usageAlerts"
11303
+ "usage_alerts": "usageAlerts",
11304
+ "overage_allowed": "overageAllowed"
11044
11305
  });
11045
11306
  })
11046
11307
  );
@@ -11232,6 +11493,17 @@ var UpdateEntityUsageAlertRequestBody$outboundSchema = z62.pipe(
11232
11493
  });
11233
11494
  })
11234
11495
  );
11496
+ var UpdateEntityOverageAllowedRequest$outboundSchema = z62.pipe(
11497
+ z62.object({
11498
+ featureId: z62.string(),
11499
+ enabled: z62._default(z62.boolean(), false)
11500
+ }),
11501
+ z62.transform((v) => {
11502
+ return remap(v, {
11503
+ featureId: "feature_id"
11504
+ });
11505
+ })
11506
+ );
11235
11507
  var UpdateEntityBillingControlsRequest$outboundSchema = z62.pipe(
11236
11508
  z62.object({
11237
11509
  spendLimits: z62.optional(
@@ -11239,12 +11511,16 @@ var UpdateEntityBillingControlsRequest$outboundSchema = z62.pipe(
11239
11511
  ),
11240
11512
  usageAlerts: z62.optional(
11241
11513
  z62.array(z62.lazy(() => UpdateEntityUsageAlertRequestBody$outboundSchema))
11514
+ ),
11515
+ overageAllowed: z62.optional(
11516
+ z62.array(z62.lazy(() => UpdateEntityOverageAllowedRequest$outboundSchema))
11242
11517
  )
11243
11518
  }),
11244
11519
  z62.transform((v) => {
11245
11520
  return remap(v, {
11246
11521
  spendLimits: "spend_limits",
11247
- usageAlerts: "usage_alerts"
11522
+ usageAlerts: "usage_alerts",
11523
+ overageAllowed: "overage_allowed"
11248
11524
  });
11249
11525
  })
11250
11526
  );
@@ -11396,6 +11672,17 @@ var UpdateEntityUsageAlertResponse$inboundSchema = z62.pipe(
11396
11672
  });
11397
11673
  })
11398
11674
  );
11675
+ var UpdateEntityOverageAllowedResponse$inboundSchema = z62.pipe(
11676
+ z62.object({
11677
+ feature_id: string4(),
11678
+ enabled: z62._default(boolean2(), false)
11679
+ }),
11680
+ z62.transform((v) => {
11681
+ return remap(v, {
11682
+ "feature_id": "featureId"
11683
+ });
11684
+ })
11685
+ );
11399
11686
  var UpdateEntityBillingControlsResponse$inboundSchema = z62.pipe(
11400
11687
  z62.object({
11401
11688
  spend_limits: optional2(
@@ -11403,12 +11690,16 @@ var UpdateEntityBillingControlsResponse$inboundSchema = z62.pipe(
11403
11690
  ),
11404
11691
  usage_alerts: optional2(
11405
11692
  z62.array(z62.lazy(() => UpdateEntityUsageAlertResponse$inboundSchema))
11693
+ ),
11694
+ overage_allowed: optional2(
11695
+ z62.array(z62.lazy(() => UpdateEntityOverageAllowedResponse$inboundSchema))
11406
11696
  )
11407
11697
  }),
11408
11698
  z62.transform((v) => {
11409
11699
  return remap(v, {
11410
11700
  "spend_limits": "spendLimits",
11411
- "usage_alerts": "usageAlerts"
11701
+ "usage_alerts": "usageAlerts",
11702
+ "overage_allowed": "overageAllowed"
11412
11703
  });
11413
11704
  })
11414
11705
  );
@@ -11761,11 +12052,13 @@ var UpdatePlanExpiryDurationTypeRequest$outboundSchema = z64.enum(UpdatePlanExpi
11761
12052
  var UpdatePlanRolloverRequest$outboundSchema = z64.pipe(
11762
12053
  z64.object({
11763
12054
  max: z64.optional(z64.number()),
12055
+ maxPercentage: z64.optional(z64.number()),
11764
12056
  expiryDurationType: UpdatePlanExpiryDurationTypeRequest$outboundSchema,
11765
12057
  expiryDurationLength: z64.optional(z64.number())
11766
12058
  }),
11767
12059
  z64.transform((v) => {
11768
12060
  return remap(v, {
12061
+ maxPercentage: "max_percentage",
11769
12062
  expiryDurationType: "expiry_duration_type",
11770
12063
  expiryDurationLength: "expiry_duration_length"
11771
12064
  });
@@ -11950,11 +12243,13 @@ var UpdatePlanExpiryDurationTypeResponse$inboundSchema = inboundSchema(UpdatePla
11950
12243
  var UpdatePlanRolloverResponse$inboundSchema = z64.pipe(
11951
12244
  z64.object({
11952
12245
  max: nullable(number2()),
12246
+ max_percentage: z64.optional(z64.nullable(number2())),
11953
12247
  expiry_duration_type: UpdatePlanExpiryDurationTypeResponse$inboundSchema,
11954
12248
  expiry_duration_length: optional2(number2())
11955
12249
  }),
11956
12250
  z64.transform((v) => {
11957
12251
  return remap(v, {
12252
+ "max_percentage": "maxPercentage",
11958
12253
  "expiry_duration_type": "expiryDurationType",
11959
12254
  "expiry_duration_length": "expiryDurationLength"
11960
12255
  });
@@ -12231,7 +12526,8 @@ async function $do2(client, request, options) {
12231
12526
  var FAIL_OPEN_OPERATION_IDS = /* @__PURE__ */ new Set([
12232
12527
  "check",
12233
12528
  "track",
12234
- "getOrCreateCustomer"
12529
+ "getOrCreateCustomer",
12530
+ "getEntity"
12235
12531
  ]);
12236
12532
  var FAIL_OPEN_LOG_MESSAGE = "[Autumn] Request failed \u2014 failing open. Learn more: https://docs.useautumn.com/documentation/fail-open";
12237
12533
  var FAIL_OPEN_BODIES = {
@@ -12261,6 +12557,18 @@ var FAIL_OPEN_BODIES = {
12261
12557
  purchases: [],
12262
12558
  balances: {},
12263
12559
  flags: {}
12560
+ },
12561
+ getEntity: {
12562
+ id: null,
12563
+ name: null,
12564
+ customer_id: null,
12565
+ feature_id: null,
12566
+ created_at: 0,
12567
+ env: "live",
12568
+ subscriptions: [],
12569
+ purchases: [],
12570
+ balances: {},
12571
+ flags: {}
12264
12572
  }
12265
12573
  };
12266
12574
  var FailOpenHook = class {