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
@@ -85,6 +85,7 @@ var eventsAggregateParamsOutboundSchema = import_v4.z.object({
85
85
  range: import_v4.z.union([import_v4.z.string(), import_v4.z.undefined()]).optional(),
86
86
  bin_size: import_v4.z.string(),
87
87
  custom_range: import_v4.z.union([aggregateEventsCustomRangeOutboundSchema, import_v4.z.undefined()]).optional(),
88
+ filter_by: import_v4.z.union([import_v4.z.record(import_v4.z.string(), import_v4.z.string()), import_v4.z.undefined()]).optional(),
88
89
  max_groups: import_v4.z.union([import_v4.z.number(), import_v4.z.undefined()]).optional()
89
90
  });
90
91
  var closedEnumSchema = import_v4.z.any();
@@ -98,6 +99,7 @@ var eventsAggregateParamsSchema = import_v4.z.object({
98
99
  range: import_v4.z.union([rangeSchema, import_v4.z.undefined()]).optional(),
99
100
  binSize: import_v4.z.union([binSizeSchema, import_v4.z.undefined()]).optional(),
100
101
  customRange: import_v4.z.union([aggregateEventsCustomRangeSchema, import_v4.z.undefined()]).optional(),
102
+ filterBy: import_v4.z.union([import_v4.z.record(import_v4.z.string(), import_v4.z.string()), import_v4.z.undefined()]).optional(),
101
103
  maxGroups: import_v4.z.union([import_v4.z.number(), import_v4.z.undefined()]).optional()
102
104
  });
103
105
 
@@ -181,6 +183,7 @@ var attachProrationOutboundSchema = import_v42.z.object({
181
183
  });
182
184
  var attachRolloverOutboundSchema = import_v42.z.object({
183
185
  max: import_v42.z.union([import_v42.z.number(), import_v42.z.undefined()]).optional(),
186
+ max_percentage: import_v42.z.union([import_v42.z.number(), import_v42.z.undefined()]).optional(),
184
187
  expiry_duration_type: import_v42.z.string(),
185
188
  expiry_duration_length: import_v42.z.union([import_v42.z.number(), import_v42.z.undefined()]).optional()
186
189
  });
@@ -281,6 +284,7 @@ var attachProrationSchema = import_v42.z.object({
281
284
  var attachExpiryDurationTypeSchema = closedEnumSchema2;
282
285
  var attachRolloverSchema = import_v42.z.object({
283
286
  max: import_v42.z.union([import_v42.z.number(), import_v42.z.undefined()]).optional(),
287
+ maxPercentage: import_v42.z.union([import_v42.z.number(), import_v42.z.undefined()]).optional(),
284
288
  expiryDurationType: attachExpiryDurationTypeSchema,
285
289
  expiryDurationLength: import_v42.z.union([import_v42.z.number(), import_v42.z.undefined()]).optional()
286
290
  });
@@ -371,6 +375,10 @@ var getOrCreateCustomerSpendLimitSchema = import_v44.z.object({
371
375
  enabled: import_v44.z.union([import_v44.z.boolean(), import_v44.z.undefined()]).optional(),
372
376
  overageLimit: import_v44.z.union([import_v44.z.number(), import_v44.z.undefined()]).optional()
373
377
  });
378
+ var getOrCreateCustomerOverageAllowedSchema = import_v44.z.object({
379
+ featureId: import_v44.z.string(),
380
+ enabled: import_v44.z.union([import_v44.z.boolean(), import_v44.z.undefined()]).optional()
381
+ });
374
382
  var getOrCreateCustomerPurchaseLimitOutboundSchema = import_v44.z.object({
375
383
  interval: import_v44.z.string(),
376
384
  interval_count: import_v44.z.number(),
@@ -395,6 +403,10 @@ var getOrCreateCustomerUsageAlertOutboundSchema = import_v44.z.object({
395
403
  threshold_type: import_v44.z.string(),
396
404
  name: import_v44.z.union([import_v44.z.string(), import_v44.z.undefined()]).optional()
397
405
  });
406
+ var getOrCreateCustomerOverageAllowedOutboundSchema = import_v44.z.object({
407
+ feature_id: import_v44.z.string(),
408
+ enabled: import_v44.z.boolean()
409
+ });
398
410
  var getOrCreateCustomerBillingControlsOutboundSchema = import_v44.z.object({
399
411
  auto_topups: import_v44.z.union([import_v44.z.array(getOrCreateCustomerAutoTopupOutboundSchema), import_v44.z.undefined()]).optional(),
400
412
  spend_limits: import_v44.z.union([
@@ -404,6 +416,10 @@ var getOrCreateCustomerBillingControlsOutboundSchema = import_v44.z.object({
404
416
  usage_alerts: import_v44.z.union([
405
417
  import_v44.z.array(getOrCreateCustomerUsageAlertOutboundSchema),
406
418
  import_v44.z.undefined()
419
+ ]).optional(),
420
+ overage_allowed: import_v44.z.union([
421
+ import_v44.z.array(getOrCreateCustomerOverageAllowedOutboundSchema),
422
+ import_v44.z.undefined()
407
423
  ]).optional()
408
424
  });
409
425
  var getOrCreateCustomerParamsOutboundSchema = import_v44.z.object({
@@ -444,7 +460,8 @@ var getOrCreateCustomerUsageAlertSchema = import_v44.z.object({
444
460
  var getOrCreateCustomerBillingControlsSchema = import_v44.z.object({
445
461
  autoTopups: import_v44.z.union([import_v44.z.array(getOrCreateCustomerAutoTopupSchema), import_v44.z.undefined()]).optional(),
446
462
  spendLimits: import_v44.z.union([import_v44.z.array(getOrCreateCustomerSpendLimitSchema), import_v44.z.undefined()]).optional(),
447
- usageAlerts: import_v44.z.union([import_v44.z.array(getOrCreateCustomerUsageAlertSchema), import_v44.z.undefined()]).optional()
463
+ usageAlerts: import_v44.z.union([import_v44.z.array(getOrCreateCustomerUsageAlertSchema), import_v44.z.undefined()]).optional(),
464
+ overageAllowed: import_v44.z.union([import_v44.z.array(getOrCreateCustomerOverageAllowedSchema), import_v44.z.undefined()]).optional()
448
465
  });
449
466
  var getOrCreateCustomerParamsSchema = import_v44.z.object({
450
467
  customerId: import_v44.z.string().nullable(),
@@ -583,6 +600,7 @@ var listPlansItemPriceSchema = import_v46.z.object({
583
600
  var listPlansExpiryDurationTypeSchema = openEnumSchema2;
584
601
  var listPlansRolloverSchema = import_v46.z.object({
585
602
  max: import_v46.z.number().nullable(),
603
+ maxPercentage: import_v46.z.union([import_v46.z.number(), import_v46.z.undefined()]).optional().nullable(),
586
604
  expiryDurationType: listPlansExpiryDurationTypeSchema,
587
605
  expiryDurationLength: import_v46.z.union([import_v46.z.number(), import_v46.z.undefined()]).optional()
588
606
  });
@@ -663,6 +681,10 @@ var multiAttachSpendLimitSchema = import_v47.z.object({
663
681
  enabled: import_v47.z.union([import_v47.z.boolean(), import_v47.z.undefined()]).optional(),
664
682
  overageLimit: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional()
665
683
  });
684
+ var multiAttachOverageAllowedSchema = import_v47.z.object({
685
+ featureId: import_v47.z.string(),
686
+ enabled: import_v47.z.union([import_v47.z.boolean(), import_v47.z.undefined()]).optional()
687
+ });
666
688
  var multiAttachInvoiceSchema = import_v47.z.object({
667
689
  status: import_v47.z.string().nullable(),
668
690
  stripeId: import_v47.z.string(),
@@ -701,6 +723,7 @@ var multiAttachProrationOutboundSchema = import_v47.z.object({
701
723
  });
702
724
  var multiAttachRolloverOutboundSchema = import_v47.z.object({
703
725
  max: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional(),
726
+ max_percentage: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional(),
704
727
  expiry_duration_type: import_v47.z.string(),
705
728
  expiry_duration_length: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional()
706
729
  });
@@ -755,9 +778,14 @@ var multiAttachUsageAlertOutboundSchema = import_v47.z.object({
755
778
  threshold_type: import_v47.z.string(),
756
779
  name: import_v47.z.union([import_v47.z.string(), import_v47.z.undefined()]).optional()
757
780
  });
781
+ var multiAttachOverageAllowedOutboundSchema = import_v47.z.object({
782
+ feature_id: import_v47.z.string(),
783
+ enabled: import_v47.z.boolean()
784
+ });
758
785
  var multiAttachBillingControlsOutboundSchema = import_v47.z.object({
759
786
  spend_limits: import_v47.z.union([import_v47.z.array(multiAttachSpendLimitOutboundSchema), import_v47.z.undefined()]).optional(),
760
- usage_alerts: import_v47.z.union([import_v47.z.array(multiAttachUsageAlertOutboundSchema), import_v47.z.undefined()]).optional()
787
+ usage_alerts: import_v47.z.union([import_v47.z.array(multiAttachUsageAlertOutboundSchema), import_v47.z.undefined()]).optional(),
788
+ overage_allowed: import_v47.z.union([import_v47.z.array(multiAttachOverageAllowedOutboundSchema), import_v47.z.undefined()]).optional()
761
789
  });
762
790
  var multiAttachEntityDataOutboundSchema = import_v47.z.object({
763
791
  feature_id: import_v47.z.string(),
@@ -801,6 +829,7 @@ var multiAttachProrationSchema = import_v47.z.object({
801
829
  var multiAttachExpiryDurationTypeSchema = closedEnumSchema4;
802
830
  var multiAttachRolloverSchema = import_v47.z.object({
803
831
  max: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional(),
832
+ maxPercentage: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional(),
804
833
  expiryDurationType: multiAttachExpiryDurationTypeSchema,
805
834
  expiryDurationLength: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional()
806
835
  });
@@ -841,7 +870,8 @@ var multiAttachUsageAlertSchema = import_v47.z.object({
841
870
  });
842
871
  var multiAttachBillingControlsSchema = import_v47.z.object({
843
872
  spendLimits: import_v47.z.union([import_v47.z.array(multiAttachSpendLimitSchema), import_v47.z.undefined()]).optional(),
844
- usageAlerts: import_v47.z.union([import_v47.z.array(multiAttachUsageAlertSchema), import_v47.z.undefined()]).optional()
873
+ usageAlerts: import_v47.z.union([import_v47.z.array(multiAttachUsageAlertSchema), import_v47.z.undefined()]).optional(),
874
+ overageAllowed: import_v47.z.union([import_v47.z.array(multiAttachOverageAllowedSchema), import_v47.z.undefined()]).optional()
845
875
  });
846
876
  var multiAttachEntityDataSchema = import_v47.z.object({
847
877
  featureId: import_v47.z.string(),
@@ -1049,6 +1079,7 @@ var previewAttachProrationOutboundSchema = import_v49.z.object({
1049
1079
  });
1050
1080
  var previewAttachRolloverOutboundSchema = import_v49.z.object({
1051
1081
  max: import_v49.z.union([import_v49.z.number(), import_v49.z.undefined()]).optional(),
1082
+ max_percentage: import_v49.z.union([import_v49.z.number(), import_v49.z.undefined()]).optional(),
1052
1083
  expiry_duration_type: import_v49.z.string(),
1053
1084
  expiry_duration_length: import_v49.z.union([import_v49.z.number(), import_v49.z.undefined()]).optional()
1054
1085
  });
@@ -1153,6 +1184,7 @@ var previewAttachProrationSchema = import_v49.z.object({
1153
1184
  var previewAttachExpiryDurationTypeSchema = closedEnumSchema5;
1154
1185
  var previewAttachRolloverSchema = import_v49.z.object({
1155
1186
  max: import_v49.z.union([import_v49.z.number(), import_v49.z.undefined()]).optional(),
1187
+ maxPercentage: import_v49.z.union([import_v49.z.number(), import_v49.z.undefined()]).optional(),
1156
1188
  expiryDurationType: previewAttachExpiryDurationTypeSchema,
1157
1189
  expiryDurationLength: import_v49.z.union([import_v49.z.number(), import_v49.z.undefined()]).optional()
1158
1190
  });
@@ -1262,6 +1294,10 @@ var previewMultiAttachSpendLimitSchema = import_v410.z.object({
1262
1294
  enabled: import_v410.z.union([import_v410.z.boolean(), import_v410.z.undefined()]).optional(),
1263
1295
  overageLimit: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional()
1264
1296
  });
1297
+ var previewMultiAttachOverageAllowedSchema = import_v410.z.object({
1298
+ featureId: import_v410.z.string(),
1299
+ enabled: import_v410.z.union([import_v410.z.boolean(), import_v410.z.undefined()]).optional()
1300
+ });
1265
1301
  var previewMultiAttachDiscountSchema = import_v410.z.object({
1266
1302
  amountOff: import_v410.z.number(),
1267
1303
  percentOff: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional(),
@@ -1363,6 +1399,7 @@ var previewMultiAttachProrationOutboundSchema = import_v410.z.object({
1363
1399
  });
1364
1400
  var previewMultiAttachRolloverOutboundSchema = import_v410.z.object({
1365
1401
  max: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional(),
1402
+ max_percentage: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional(),
1366
1403
  expiry_duration_type: import_v410.z.string(),
1367
1404
  expiry_duration_length: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional()
1368
1405
  });
@@ -1420,9 +1457,17 @@ var previewMultiAttachUsageAlertOutboundSchema = import_v410.z.object({
1420
1457
  threshold_type: import_v410.z.string(),
1421
1458
  name: import_v410.z.union([import_v410.z.string(), import_v410.z.undefined()]).optional()
1422
1459
  });
1460
+ var previewMultiAttachOverageAllowedOutboundSchema = import_v410.z.object({
1461
+ feature_id: import_v410.z.string(),
1462
+ enabled: import_v410.z.boolean()
1463
+ });
1423
1464
  var previewMultiAttachBillingControlsOutboundSchema = import_v410.z.object({
1424
1465
  spend_limits: import_v410.z.union([import_v410.z.array(previewMultiAttachSpendLimitOutboundSchema), import_v410.z.undefined()]).optional(),
1425
- usage_alerts: import_v410.z.union([import_v410.z.array(previewMultiAttachUsageAlertOutboundSchema), import_v410.z.undefined()]).optional()
1466
+ usage_alerts: import_v410.z.union([import_v410.z.array(previewMultiAttachUsageAlertOutboundSchema), import_v410.z.undefined()]).optional(),
1467
+ overage_allowed: import_v410.z.union([
1468
+ import_v410.z.array(previewMultiAttachOverageAllowedOutboundSchema),
1469
+ import_v410.z.undefined()
1470
+ ]).optional()
1426
1471
  });
1427
1472
  var previewMultiAttachEntityDataOutboundSchema = import_v410.z.object({
1428
1473
  feature_id: import_v410.z.string(),
@@ -1467,6 +1512,7 @@ var previewMultiAttachProrationSchema = import_v410.z.object({
1467
1512
  var previewMultiAttachExpiryDurationTypeSchema = closedEnumSchema6;
1468
1513
  var previewMultiAttachRolloverSchema = import_v410.z.object({
1469
1514
  max: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional(),
1515
+ maxPercentage: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional(),
1470
1516
  expiryDurationType: previewMultiAttachExpiryDurationTypeSchema,
1471
1517
  expiryDurationLength: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional()
1472
1518
  });
@@ -1510,7 +1556,8 @@ var previewMultiAttachUsageAlertSchema = import_v410.z.object({
1510
1556
  });
1511
1557
  var previewMultiAttachBillingControlsSchema = import_v410.z.object({
1512
1558
  spendLimits: import_v410.z.union([import_v410.z.array(previewMultiAttachSpendLimitSchema), import_v410.z.undefined()]).optional(),
1513
- usageAlerts: import_v410.z.union([import_v410.z.array(previewMultiAttachUsageAlertSchema), import_v410.z.undefined()]).optional()
1559
+ usageAlerts: import_v410.z.union([import_v410.z.array(previewMultiAttachUsageAlertSchema), import_v410.z.undefined()]).optional(),
1560
+ overageAllowed: import_v410.z.union([import_v410.z.array(previewMultiAttachOverageAllowedSchema), import_v410.z.undefined()]).optional()
1514
1561
  });
1515
1562
  var previewMultiAttachEntityDataSchema = import_v410.z.object({
1516
1563
  featureId: import_v410.z.string(),
@@ -1706,6 +1753,7 @@ var previewUpdateProrationOutboundSchema = import_v411.z.object({
1706
1753
  });
1707
1754
  var previewUpdateRolloverOutboundSchema = import_v411.z.object({
1708
1755
  max: import_v411.z.union([import_v411.z.number(), import_v411.z.undefined()]).optional(),
1756
+ max_percentage: import_v411.z.union([import_v411.z.number(), import_v411.z.undefined()]).optional(),
1709
1757
  expiry_duration_type: import_v411.z.string(),
1710
1758
  expiry_duration_length: import_v411.z.union([import_v411.z.number(), import_v411.z.undefined()]).optional()
1711
1759
  });
@@ -1790,6 +1838,7 @@ var previewUpdateProrationSchema = import_v411.z.object({
1790
1838
  var previewUpdateExpiryDurationTypeSchema = closedEnumSchema7;
1791
1839
  var previewUpdateRolloverSchema = import_v411.z.object({
1792
1840
  max: import_v411.z.union([import_v411.z.number(), import_v411.z.undefined()]).optional(),
1841
+ maxPercentage: import_v411.z.union([import_v411.z.number(), import_v411.z.undefined()]).optional(),
1793
1842
  expiryDurationType: previewUpdateExpiryDurationTypeSchema,
1794
1843
  expiryDurationLength: import_v411.z.union([import_v411.z.number(), import_v411.z.undefined()]).optional()
1795
1844
  });
@@ -1953,6 +2002,7 @@ var setupPaymentProrationOutboundSchema = import_v413.z.object({
1953
2002
  });
1954
2003
  var setupPaymentRolloverOutboundSchema = import_v413.z.object({
1955
2004
  max: import_v413.z.union([import_v413.z.number(), import_v413.z.undefined()]).optional(),
2005
+ max_percentage: import_v413.z.union([import_v413.z.number(), import_v413.z.undefined()]).optional(),
1956
2006
  expiry_duration_type: import_v413.z.string(),
1957
2007
  expiry_duration_length: import_v413.z.union([import_v413.z.number(), import_v413.z.undefined()]).optional()
1958
2008
  });
@@ -2043,6 +2093,7 @@ var setupPaymentProrationSchema = import_v413.z.object({
2043
2093
  var setupPaymentExpiryDurationTypeSchema = closedEnumSchema8;
2044
2094
  var setupPaymentRolloverSchema = import_v413.z.object({
2045
2095
  max: import_v413.z.union([import_v413.z.number(), import_v413.z.undefined()]).optional(),
2096
+ maxPercentage: import_v413.z.union([import_v413.z.number(), import_v413.z.undefined()]).optional(),
2046
2097
  expiryDurationType: setupPaymentExpiryDurationTypeSchema,
2047
2098
  expiryDurationLength: import_v413.z.union([import_v413.z.number(), import_v413.z.undefined()]).optional()
2048
2099
  });
@@ -2153,6 +2204,7 @@ var billingUpdateProrationOutboundSchema = import_v414.z.object({
2153
2204
  });
2154
2205
  var billingUpdateRolloverOutboundSchema = import_v414.z.object({
2155
2206
  max: import_v414.z.union([import_v414.z.number(), import_v414.z.undefined()]).optional(),
2207
+ max_percentage: import_v414.z.union([import_v414.z.number(), import_v414.z.undefined()]).optional(),
2156
2208
  expiry_duration_type: import_v414.z.string(),
2157
2209
  expiry_duration_length: import_v414.z.union([import_v414.z.number(), import_v414.z.undefined()]).optional()
2158
2210
  });
@@ -2233,6 +2285,7 @@ var billingUpdateProrationSchema = import_v414.z.object({
2233
2285
  var billingUpdateExpiryDurationTypeSchema = closedEnumSchema9;
2234
2286
  var billingUpdateRolloverSchema = import_v414.z.object({
2235
2287
  max: import_v414.z.union([import_v414.z.number(), import_v414.z.undefined()]).optional(),
2288
+ maxPercentage: import_v414.z.union([import_v414.z.number(), import_v414.z.undefined()]).optional(),
2236
2289
  expiryDurationType: billingUpdateExpiryDurationTypeSchema,
2237
2290
  expiryDurationLength: import_v414.z.union([import_v414.z.number(), import_v414.z.undefined()]).optional()
2238
2291
  });
@@ -2572,8 +2625,8 @@ var SDK_METADATA = {
2572
2625
  language: "typescript",
2573
2626
  openapiDocVersion: "2.2.0",
2574
2627
  sdkVersion: "0.10.17",
2575
- genVersion: "2.869.25",
2576
- userAgent: "speakeasy-sdk/typescript 0.10.17 2.869.25 2.2.0 @useautumn/sdk"
2628
+ genVersion: "2.879.1",
2629
+ userAgent: "speakeasy-sdk/typescript 0.10.17 2.879.1 2.2.0 @useautumn/sdk"
2577
2630
  };
2578
2631
 
2579
2632
  // ../sdk/src/lib/http.ts
@@ -3495,8 +3548,8 @@ function applyBearer(state, spec) {
3495
3548
  state.headers[spec.fieldName] = value;
3496
3549
  }
3497
3550
  }
3498
- function resolveGlobalSecurity(security) {
3499
- return resolveSecurity(
3551
+ function resolveGlobalSecurity(security, allowedFields) {
3552
+ let inputs = [
3500
3553
  [
3501
3554
  {
3502
3555
  fieldName: "Authorization",
@@ -3504,7 +3557,16 @@ function resolveGlobalSecurity(security) {
3504
3557
  value: security?.secretKey ?? env().AUTUMN_SECRET_KEY
3505
3558
  }
3506
3559
  ]
3507
- );
3560
+ ];
3561
+ if (allowedFields) {
3562
+ inputs = allowedFields.map((i) => {
3563
+ if (i < 0 || i >= inputs.length) {
3564
+ throw new RangeError(`invalid allowedFields index ${i}`);
3565
+ }
3566
+ return inputs[i];
3567
+ });
3568
+ }
3569
+ return resolveSecurity(...inputs);
3508
3570
  }
3509
3571
  async function extractSecurity(sec) {
3510
3572
  if (sec == null) {
@@ -3831,6 +3893,7 @@ var EventsAggregateParams$outboundSchema = z24.pipe(
3831
3893
  customRange: z24.optional(
3832
3894
  z24.lazy(() => AggregateEventsCustomRange$outboundSchema)
3833
3895
  ),
3896
+ filterBy: z24.optional(z24.record(z24.string(), z24.string())),
3834
3897
  maxGroups: z24.optional(z24.int())
3835
3898
  }),
3836
3899
  z24.transform((v) => {
@@ -3841,6 +3904,7 @@ var EventsAggregateParams$outboundSchema = z24.pipe(
3841
3904
  groupBy: "group_by",
3842
3905
  binSize: "bin_size",
3843
3906
  customRange: "custom_range",
3907
+ filterBy: "filter_by",
3844
3908
  maxGroups: "max_groups"
3845
3909
  });
3846
3910
  })
@@ -4049,11 +4113,13 @@ var AttachExpiryDurationType$outboundSchema = z26.enum(AttachExpiryDurationType)
4049
4113
  var AttachRollover$outboundSchema = z26.pipe(
4050
4114
  z26.object({
4051
4115
  max: z26.optional(z26.number()),
4116
+ maxPercentage: z26.optional(z26.number()),
4052
4117
  expiryDurationType: AttachExpiryDurationType$outboundSchema,
4053
4118
  expiryDurationLength: z26.optional(z26.number())
4054
4119
  }),
4055
4120
  z26.transform((v) => {
4056
4121
  return remap(v, {
4122
+ maxPercentage: "max_percentage",
4057
4123
  expiryDurationType: "expiry_duration_type",
4058
4124
  expiryDurationLength: "expiry_duration_length"
4059
4125
  });
@@ -4578,11 +4644,13 @@ var BillingUpdateExpiryDurationType$outboundSchema = z28.enum(BillingUpdateExpir
4578
4644
  var BillingUpdateRollover$outboundSchema = z28.pipe(
4579
4645
  z28.object({
4580
4646
  max: z28.optional(z28.number()),
4647
+ maxPercentage: z28.optional(z28.number()),
4581
4648
  expiryDurationType: BillingUpdateExpiryDurationType$outboundSchema,
4582
4649
  expiryDurationLength: z28.optional(z28.number())
4583
4650
  }),
4584
4651
  z28.transform((v) => {
4585
4652
  return remap(v, {
4653
+ maxPercentage: "max_percentage",
4586
4654
  expiryDurationType: "expiry_duration_type",
4587
4655
  expiryDurationLength: "expiry_duration_length"
4588
4656
  });
@@ -4924,11 +4992,19 @@ var ProductDisplay$inboundSchema = z29.pipe(
4924
4992
  })
4925
4993
  );
4926
4994
  var RolloverDuration$inboundSchema = inboundSchema(RolloverDuration);
4927
- var CheckRollover$inboundSchema = z29.object({
4928
- max: nullable(number2()),
4929
- duration: z29._default(RolloverDuration$inboundSchema, "month"),
4930
- length: number2()
4931
- });
4995
+ var CheckRollover$inboundSchema = z29.pipe(
4996
+ z29.object({
4997
+ max: z29.optional(z29.nullable(number2())),
4998
+ max_percentage: z29.optional(z29.nullable(number2())),
4999
+ duration: z29._default(RolloverDuration$inboundSchema, "month"),
5000
+ length: number2()
5001
+ }),
5002
+ z29.transform((v) => {
5003
+ return remap(v, {
5004
+ "max_percentage": "maxPercentage"
5005
+ });
5006
+ })
5007
+ );
4932
5008
  var CheckOnIncrease$inboundSchema = inboundSchema(CheckOnIncrease);
4933
5009
  var CheckOnDecrease$inboundSchema = inboundSchema(CheckOnDecrease);
4934
5010
  var Config$inboundSchema = z29.pipe(
@@ -5205,6 +5281,17 @@ var CustomerDataUsageAlert$outboundSchema = z31.pipe(
5205
5281
  });
5206
5282
  })
5207
5283
  );
5284
+ var CustomerDataOverageAllowed$outboundSchema = z31.pipe(
5285
+ z31.object({
5286
+ featureId: z31.string(),
5287
+ enabled: z31._default(z31.boolean(), false)
5288
+ }),
5289
+ z31.transform((v) => {
5290
+ return remap(v, {
5291
+ featureId: "feature_id"
5292
+ });
5293
+ })
5294
+ );
5208
5295
  var CustomerDataBillingControls$outboundSchema = z31.pipe(
5209
5296
  z31.object({
5210
5297
  autoTopups: z31.optional(
@@ -5215,13 +5302,17 @@ var CustomerDataBillingControls$outboundSchema = z31.pipe(
5215
5302
  ),
5216
5303
  usageAlerts: z31.optional(
5217
5304
  z31.array(z31.lazy(() => CustomerDataUsageAlert$outboundSchema))
5305
+ ),
5306
+ overageAllowed: z31.optional(
5307
+ z31.array(z31.lazy(() => CustomerDataOverageAllowed$outboundSchema))
5218
5308
  )
5219
5309
  }),
5220
5310
  z31.transform((v) => {
5221
5311
  return remap(v, {
5222
5312
  autoTopups: "auto_topups",
5223
5313
  spendLimits: "spend_limits",
5224
- usageAlerts: "usage_alerts"
5314
+ usageAlerts: "usage_alerts",
5315
+ overageAllowed: "overage_allowed"
5225
5316
  });
5226
5317
  })
5227
5318
  );
@@ -5432,11 +5523,13 @@ var ExpiryDurationType$inboundSchema = inboundSchema(ExpiryDurationType);
5432
5523
  var PlanRollover$inboundSchema = z32.pipe(
5433
5524
  z32.object({
5434
5525
  max: nullable(number2()),
5526
+ max_percentage: z32.optional(z32.nullable(number2())),
5435
5527
  expiry_duration_type: ExpiryDurationType$inboundSchema,
5436
5528
  expiry_duration_length: optional2(number2())
5437
5529
  }),
5438
5530
  z32.transform((v) => {
5439
5531
  return remap(v, {
5532
+ "max_percentage": "maxPercentage",
5440
5533
  "expiry_duration_type": "expiryDurationType",
5441
5534
  "expiry_duration_length": "expiryDurationLength"
5442
5535
  });
@@ -5575,6 +5668,17 @@ var CreateEntityUsageAlertRequestBody$outboundSchema = z33.pipe(
5575
5668
  });
5576
5669
  })
5577
5670
  );
5671
+ var CreateEntityOverageAllowedRequest$outboundSchema = z33.pipe(
5672
+ z33.object({
5673
+ featureId: z33.string(),
5674
+ enabled: z33._default(z33.boolean(), false)
5675
+ }),
5676
+ z33.transform((v) => {
5677
+ return remap(v, {
5678
+ featureId: "feature_id"
5679
+ });
5680
+ })
5681
+ );
5578
5682
  var CreateEntityBillingControlsRequest$outboundSchema = z33.pipe(
5579
5683
  z33.object({
5580
5684
  spendLimits: z33.optional(
@@ -5582,12 +5686,16 @@ var CreateEntityBillingControlsRequest$outboundSchema = z33.pipe(
5582
5686
  ),
5583
5687
  usageAlerts: z33.optional(
5584
5688
  z33.array(z33.lazy(() => CreateEntityUsageAlertRequestBody$outboundSchema))
5689
+ ),
5690
+ overageAllowed: z33.optional(
5691
+ z33.array(z33.lazy(() => CreateEntityOverageAllowedRequest$outboundSchema))
5585
5692
  )
5586
5693
  }),
5587
5694
  z33.transform((v) => {
5588
5695
  return remap(v, {
5589
5696
  spendLimits: "spend_limits",
5590
- usageAlerts: "usage_alerts"
5697
+ usageAlerts: "usage_alerts",
5698
+ overageAllowed: "overage_allowed"
5591
5699
  });
5592
5700
  })
5593
5701
  );
@@ -5744,6 +5852,17 @@ var CreateEntityUsageAlertResponse$inboundSchema = z33.pipe(
5744
5852
  });
5745
5853
  })
5746
5854
  );
5855
+ var CreateEntityOverageAllowedResponse$inboundSchema = z33.pipe(
5856
+ z33.object({
5857
+ feature_id: string4(),
5858
+ enabled: z33._default(boolean2(), false)
5859
+ }),
5860
+ z33.transform((v) => {
5861
+ return remap(v, {
5862
+ "feature_id": "featureId"
5863
+ });
5864
+ })
5865
+ );
5747
5866
  var CreateEntityBillingControlsResponse$inboundSchema = z33.pipe(
5748
5867
  z33.object({
5749
5868
  spend_limits: optional2(
@@ -5751,12 +5870,16 @@ var CreateEntityBillingControlsResponse$inboundSchema = z33.pipe(
5751
5870
  ),
5752
5871
  usage_alerts: optional2(
5753
5872
  z33.array(z33.lazy(() => CreateEntityUsageAlertResponse$inboundSchema))
5873
+ ),
5874
+ overage_allowed: optional2(
5875
+ z33.array(z33.lazy(() => CreateEntityOverageAllowedResponse$inboundSchema))
5754
5876
  )
5755
5877
  }),
5756
5878
  z33.transform((v) => {
5757
5879
  return remap(v, {
5758
5880
  "spend_limits": "spendLimits",
5759
- "usage_alerts": "usageAlerts"
5881
+ "usage_alerts": "usageAlerts",
5882
+ "overage_allowed": "overageAllowed"
5760
5883
  });
5761
5884
  })
5762
5885
  );
@@ -6106,11 +6229,13 @@ var CreatePlanExpiryDurationTypeRequest$outboundSchema = z35.enum(CreatePlanExpi
6106
6229
  var CreatePlanRolloverRequest$outboundSchema = z35.pipe(
6107
6230
  z35.object({
6108
6231
  max: z35.optional(z35.number()),
6232
+ maxPercentage: z35.optional(z35.number()),
6109
6233
  expiryDurationType: CreatePlanExpiryDurationTypeRequest$outboundSchema,
6110
6234
  expiryDurationLength: z35.optional(z35.number())
6111
6235
  }),
6112
6236
  z35.transform((v) => {
6113
6237
  return remap(v, {
6238
+ maxPercentage: "max_percentage",
6114
6239
  expiryDurationType: "expiry_duration_type",
6115
6240
  expiryDurationLength: "expiry_duration_length"
6116
6241
  });
@@ -6287,11 +6412,13 @@ var CreatePlanExpiryDurationTypeResponse$inboundSchema = inboundSchema(CreatePla
6287
6412
  var CreatePlanRolloverResponse$inboundSchema = z35.pipe(
6288
6413
  z35.object({
6289
6414
  max: nullable(number2()),
6415
+ max_percentage: z35.optional(z35.nullable(number2())),
6290
6416
  expiry_duration_type: CreatePlanExpiryDurationTypeResponse$inboundSchema,
6291
6417
  expiry_duration_length: optional2(number2())
6292
6418
  }),
6293
6419
  z35.transform((v) => {
6294
6420
  return remap(v, {
6421
+ "max_percentage": "maxPercentage",
6295
6422
  "expiry_duration_type": "expiryDurationType",
6296
6423
  "expiry_duration_length": "expiryDurationLength"
6297
6424
  });
@@ -6513,6 +6640,17 @@ var CustomerUsageAlert$inboundSchema = z37.pipe(
6513
6640
  });
6514
6641
  })
6515
6642
  );
6643
+ var CustomerOverageAllowed$inboundSchema = z37.pipe(
6644
+ z37.object({
6645
+ feature_id: string4(),
6646
+ enabled: z37._default(boolean2(), false)
6647
+ }),
6648
+ z37.transform((v) => {
6649
+ return remap(v, {
6650
+ "feature_id": "featureId"
6651
+ });
6652
+ })
6653
+ );
6516
6654
  var CustomerBillingControls$inboundSchema = z37.pipe(
6517
6655
  z37.object({
6518
6656
  auto_topups: optional2(
@@ -6523,13 +6661,17 @@ var CustomerBillingControls$inboundSchema = z37.pipe(
6523
6661
  ),
6524
6662
  usage_alerts: optional2(
6525
6663
  z37.array(z37.lazy(() => CustomerUsageAlert$inboundSchema))
6664
+ ),
6665
+ overage_allowed: optional2(
6666
+ z37.array(z37.lazy(() => CustomerOverageAllowed$inboundSchema))
6526
6667
  )
6527
6668
  }),
6528
6669
  z37.transform((v) => {
6529
6670
  return remap(v, {
6530
6671
  "auto_topups": "autoTopups",
6531
6672
  "spend_limits": "spendLimits",
6532
- "usage_alerts": "usageAlerts"
6673
+ "usage_alerts": "usageAlerts",
6674
+ "overage_allowed": "overageAllowed"
6533
6675
  });
6534
6676
  })
6535
6677
  );
@@ -7068,6 +7210,17 @@ var GetEntityUsageAlert$inboundSchema = z44.pipe(
7068
7210
  });
7069
7211
  })
7070
7212
  );
7213
+ var GetEntityOverageAllowed$inboundSchema = z44.pipe(
7214
+ z44.object({
7215
+ feature_id: string4(),
7216
+ enabled: z44._default(boolean2(), false)
7217
+ }),
7218
+ z44.transform((v) => {
7219
+ return remap(v, {
7220
+ "feature_id": "featureId"
7221
+ });
7222
+ })
7223
+ );
7071
7224
  var GetEntityBillingControls$inboundSchema = z44.pipe(
7072
7225
  z44.object({
7073
7226
  spend_limits: optional2(
@@ -7075,12 +7228,16 @@ var GetEntityBillingControls$inboundSchema = z44.pipe(
7075
7228
  ),
7076
7229
  usage_alerts: optional2(
7077
7230
  z44.array(z44.lazy(() => GetEntityUsageAlert$inboundSchema))
7231
+ ),
7232
+ overage_allowed: optional2(
7233
+ z44.array(z44.lazy(() => GetEntityOverageAllowed$inboundSchema))
7078
7234
  )
7079
7235
  }),
7080
7236
  z44.transform((v) => {
7081
7237
  return remap(v, {
7082
7238
  "spend_limits": "spendLimits",
7083
- "usage_alerts": "usageAlerts"
7239
+ "usage_alerts": "usageAlerts",
7240
+ "overage_allowed": "overageAllowed"
7084
7241
  });
7085
7242
  })
7086
7243
  );
@@ -7258,6 +7415,17 @@ var GetOrCreateCustomerUsageAlert$outboundSchema = z46.pipe(
7258
7415
  });
7259
7416
  })
7260
7417
  );
7418
+ var GetOrCreateCustomerOverageAllowed$outboundSchema = z46.pipe(
7419
+ z46.object({
7420
+ featureId: z46.string(),
7421
+ enabled: z46._default(z46.boolean(), false)
7422
+ }),
7423
+ z46.transform((v) => {
7424
+ return remap(v, {
7425
+ featureId: "feature_id"
7426
+ });
7427
+ })
7428
+ );
7261
7429
  var GetOrCreateCustomerBillingControls$outboundSchema = z46.pipe(
7262
7430
  z46.object({
7263
7431
  autoTopups: z46.optional(
@@ -7268,13 +7436,17 @@ var GetOrCreateCustomerBillingControls$outboundSchema = z46.pipe(
7268
7436
  ),
7269
7437
  usageAlerts: z46.optional(
7270
7438
  z46.array(z46.lazy(() => GetOrCreateCustomerUsageAlert$outboundSchema))
7439
+ ),
7440
+ overageAllowed: z46.optional(
7441
+ z46.array(z46.lazy(() => GetOrCreateCustomerOverageAllowed$outboundSchema))
7271
7442
  )
7272
7443
  }),
7273
7444
  z46.transform((v) => {
7274
7445
  return remap(v, {
7275
7446
  autoTopups: "auto_topups",
7276
7447
  spendLimits: "spend_limits",
7277
- usageAlerts: "usage_alerts"
7448
+ usageAlerts: "usage_alerts",
7449
+ overageAllowed: "overage_allowed"
7278
7450
  });
7279
7451
  })
7280
7452
  );
@@ -7499,11 +7671,13 @@ var GetPlanExpiryDurationType$inboundSchema = inboundSchema(GetPlanExpiryDuratio
7499
7671
  var GetPlanRollover$inboundSchema = z47.pipe(
7500
7672
  z47.object({
7501
7673
  max: nullable(number2()),
7674
+ max_percentage: z47.optional(z47.nullable(number2())),
7502
7675
  expiry_duration_type: GetPlanExpiryDurationType$inboundSchema,
7503
7676
  expiry_duration_length: optional2(number2())
7504
7677
  }),
7505
7678
  z47.transform((v) => {
7506
7679
  return remap(v, {
7680
+ "max_percentage": "maxPercentage",
7507
7681
  "expiry_duration_type": "expiryDurationType",
7508
7682
  "expiry_duration_length": "expiryDurationLength"
7509
7683
  });
@@ -7731,6 +7905,17 @@ var ListCustomersUsageAlert$inboundSchema = z48.pipe(
7731
7905
  });
7732
7906
  })
7733
7907
  );
7908
+ var ListCustomersOverageAllowed$inboundSchema = z48.pipe(
7909
+ z48.object({
7910
+ feature_id: string4(),
7911
+ enabled: z48._default(boolean2(), false)
7912
+ }),
7913
+ z48.transform((v) => {
7914
+ return remap(v, {
7915
+ "feature_id": "featureId"
7916
+ });
7917
+ })
7918
+ );
7734
7919
  var ListCustomersBillingControls$inboundSchema = z48.pipe(
7735
7920
  z48.object({
7736
7921
  auto_topups: optional2(
@@ -7741,13 +7926,17 @@ var ListCustomersBillingControls$inboundSchema = z48.pipe(
7741
7926
  ),
7742
7927
  usage_alerts: optional2(
7743
7928
  z48.array(z48.lazy(() => ListCustomersUsageAlert$inboundSchema))
7929
+ ),
7930
+ overage_allowed: optional2(
7931
+ z48.array(z48.lazy(() => ListCustomersOverageAllowed$inboundSchema))
7744
7932
  )
7745
7933
  }),
7746
7934
  z48.transform((v) => {
7747
7935
  return remap(v, {
7748
7936
  "auto_topups": "autoTopups",
7749
7937
  "spend_limits": "spendLimits",
7750
- "usage_alerts": "usageAlerts"
7938
+ "usage_alerts": "usageAlerts",
7939
+ "overage_allowed": "overageAllowed"
7751
7940
  });
7752
7941
  })
7753
7942
  );
@@ -8202,11 +8391,13 @@ var ListPlansExpiryDurationType$inboundSchema = inboundSchema(ListPlansExpiryDur
8202
8391
  var ListPlansRollover$inboundSchema = z51.pipe(
8203
8392
  z51.object({
8204
8393
  max: nullable(number2()),
8394
+ max_percentage: z51.optional(z51.nullable(number2())),
8205
8395
  expiry_duration_type: ListPlansExpiryDurationType$inboundSchema,
8206
8396
  expiry_duration_length: optional2(number2())
8207
8397
  }),
8208
8398
  z51.transform((v) => {
8209
8399
  return remap(v, {
8400
+ "max_percentage": "maxPercentage",
8210
8401
  "expiry_duration_type": "expiryDurationType",
8211
8402
  "expiry_duration_length": "expiryDurationLength"
8212
8403
  });
@@ -8450,11 +8641,13 @@ var MultiAttachExpiryDurationType$outboundSchema = z52.enum(MultiAttachExpiryDur
8450
8641
  var MultiAttachRollover$outboundSchema = z52.pipe(
8451
8642
  z52.object({
8452
8643
  max: z52.optional(z52.number()),
8644
+ maxPercentage: z52.optional(z52.number()),
8453
8645
  expiryDurationType: MultiAttachExpiryDurationType$outboundSchema,
8454
8646
  expiryDurationLength: z52.optional(z52.number())
8455
8647
  }),
8456
8648
  z52.transform((v) => {
8457
8649
  return remap(v, {
8650
+ maxPercentage: "max_percentage",
8458
8651
  expiryDurationType: "expiry_duration_type",
8459
8652
  expiryDurationLength: "expiry_duration_length"
8460
8653
  });
@@ -8581,6 +8774,17 @@ var MultiAttachUsageAlert$outboundSchema = z52.pipe(
8581
8774
  });
8582
8775
  })
8583
8776
  );
8777
+ var MultiAttachOverageAllowed$outboundSchema = z52.pipe(
8778
+ z52.object({
8779
+ featureId: z52.string(),
8780
+ enabled: z52._default(z52.boolean(), false)
8781
+ }),
8782
+ z52.transform((v) => {
8783
+ return remap(v, {
8784
+ featureId: "feature_id"
8785
+ });
8786
+ })
8787
+ );
8584
8788
  var MultiAttachBillingControls$outboundSchema = z52.pipe(
8585
8789
  z52.object({
8586
8790
  spendLimits: z52.optional(
@@ -8588,12 +8792,16 @@ var MultiAttachBillingControls$outboundSchema = z52.pipe(
8588
8792
  ),
8589
8793
  usageAlerts: z52.optional(
8590
8794
  z52.array(z52.lazy(() => MultiAttachUsageAlert$outboundSchema))
8795
+ ),
8796
+ overageAllowed: z52.optional(
8797
+ z52.array(z52.lazy(() => MultiAttachOverageAllowed$outboundSchema))
8591
8798
  )
8592
8799
  }),
8593
8800
  z52.transform((v) => {
8594
8801
  return remap(v, {
8595
8802
  spendLimits: "spend_limits",
8596
- usageAlerts: "usage_alerts"
8803
+ usageAlerts: "usage_alerts",
8804
+ overageAllowed: "overage_allowed"
8597
8805
  });
8598
8806
  })
8599
8807
  );
@@ -8887,11 +9095,13 @@ var PreviewAttachExpiryDurationType$outboundSchema = z54.enum(PreviewAttachExpir
8887
9095
  var PreviewAttachRollover$outboundSchema = z54.pipe(
8888
9096
  z54.object({
8889
9097
  max: z54.optional(z54.number()),
9098
+ maxPercentage: z54.optional(z54.number()),
8890
9099
  expiryDurationType: PreviewAttachExpiryDurationType$outboundSchema,
8891
9100
  expiryDurationLength: z54.optional(z54.number())
8892
9101
  }),
8893
9102
  z54.transform((v) => {
8894
9103
  return remap(v, {
9104
+ maxPercentage: "max_percentage",
8895
9105
  expiryDurationType: "expiry_duration_type",
8896
9106
  expiryDurationLength: "expiry_duration_length"
8897
9107
  });
@@ -9435,11 +9645,13 @@ var PreviewMultiAttachExpiryDurationType$outboundSchema = z55.enum(PreviewMultiA
9435
9645
  var PreviewMultiAttachRollover$outboundSchema = z55.pipe(
9436
9646
  z55.object({
9437
9647
  max: z55.optional(z55.number()),
9648
+ maxPercentage: z55.optional(z55.number()),
9438
9649
  expiryDurationType: PreviewMultiAttachExpiryDurationType$outboundSchema,
9439
9650
  expiryDurationLength: z55.optional(z55.number())
9440
9651
  }),
9441
9652
  z55.transform((v) => {
9442
9653
  return remap(v, {
9654
+ maxPercentage: "max_percentage",
9443
9655
  expiryDurationType: "expiry_duration_type",
9444
9656
  expiryDurationLength: "expiry_duration_length"
9445
9657
  });
@@ -9579,6 +9791,17 @@ var PreviewMultiAttachUsageAlert$outboundSchema = z55.pipe(
9579
9791
  });
9580
9792
  })
9581
9793
  );
9794
+ var PreviewMultiAttachOverageAllowed$outboundSchema = z55.pipe(
9795
+ z55.object({
9796
+ featureId: z55.string(),
9797
+ enabled: z55._default(z55.boolean(), false)
9798
+ }),
9799
+ z55.transform((v) => {
9800
+ return remap(v, {
9801
+ featureId: "feature_id"
9802
+ });
9803
+ })
9804
+ );
9582
9805
  var PreviewMultiAttachBillingControls$outboundSchema = z55.pipe(
9583
9806
  z55.object({
9584
9807
  spendLimits: z55.optional(
@@ -9586,12 +9809,16 @@ var PreviewMultiAttachBillingControls$outboundSchema = z55.pipe(
9586
9809
  ),
9587
9810
  usageAlerts: z55.optional(
9588
9811
  z55.array(z55.lazy(() => PreviewMultiAttachUsageAlert$outboundSchema))
9812
+ ),
9813
+ overageAllowed: z55.optional(
9814
+ z55.array(z55.lazy(() => PreviewMultiAttachOverageAllowed$outboundSchema))
9589
9815
  )
9590
9816
  }),
9591
9817
  z55.transform((v) => {
9592
9818
  return remap(v, {
9593
9819
  spendLimits: "spend_limits",
9594
- usageAlerts: "usage_alerts"
9820
+ usageAlerts: "usage_alerts",
9821
+ overageAllowed: "overage_allowed"
9595
9822
  });
9596
9823
  })
9597
9824
  );
@@ -10047,11 +10274,13 @@ var PreviewUpdateExpiryDurationType$outboundSchema = z56.enum(PreviewUpdateExpir
10047
10274
  var PreviewUpdateRollover$outboundSchema = z56.pipe(
10048
10275
  z56.object({
10049
10276
  max: z56.optional(z56.number()),
10277
+ maxPercentage: z56.optional(z56.number()),
10050
10278
  expiryDurationType: PreviewUpdateExpiryDurationType$outboundSchema,
10051
10279
  expiryDurationLength: z56.optional(z56.number())
10052
10280
  }),
10053
10281
  z56.transform((v) => {
10054
10282
  return remap(v, {
10283
+ maxPercentage: "max_percentage",
10055
10284
  expiryDurationType: "expiry_duration_type",
10056
10285
  expiryDurationLength: "expiry_duration_length"
10057
10286
  });
@@ -10567,11 +10796,13 @@ var SetupPaymentExpiryDurationType$outboundSchema = z58.enum(SetupPaymentExpiryD
10567
10796
  var SetupPaymentRollover$outboundSchema = z58.pipe(
10568
10797
  z58.object({
10569
10798
  max: z58.optional(z58.number()),
10799
+ maxPercentage: z58.optional(z58.number()),
10570
10800
  expiryDurationType: SetupPaymentExpiryDurationType$outboundSchema,
10571
10801
  expiryDurationLength: z58.optional(z58.number())
10572
10802
  }),
10573
10803
  z58.transform((v) => {
10574
10804
  return remap(v, {
10805
+ maxPercentage: "max_percentage",
10575
10806
  expiryDurationType: "expiry_duration_type",
10576
10807
  expiryDurationLength: "expiry_duration_length"
10577
10808
  });
@@ -10916,6 +11147,17 @@ var UpdateCustomerUsageAlertRequestBody$outboundSchema = z61.pipe(
10916
11147
  });
10917
11148
  })
10918
11149
  );
11150
+ var UpdateCustomerOverageAllowedRequest$outboundSchema = z61.pipe(
11151
+ z61.object({
11152
+ featureId: z61.string(),
11153
+ enabled: z61._default(z61.boolean(), false)
11154
+ }),
11155
+ z61.transform((v) => {
11156
+ return remap(v, {
11157
+ featureId: "feature_id"
11158
+ });
11159
+ })
11160
+ );
10919
11161
  var UpdateCustomerBillingControlsRequest$outboundSchema = z61.pipe(
10920
11162
  z61.object({
10921
11163
  autoTopups: z61.optional(
@@ -10926,13 +11168,17 @@ var UpdateCustomerBillingControlsRequest$outboundSchema = z61.pipe(
10926
11168
  ),
10927
11169
  usageAlerts: z61.optional(
10928
11170
  z61.array(z61.lazy(() => UpdateCustomerUsageAlertRequestBody$outboundSchema))
11171
+ ),
11172
+ overageAllowed: z61.optional(
11173
+ z61.array(z61.lazy(() => UpdateCustomerOverageAllowedRequest$outboundSchema))
10929
11174
  )
10930
11175
  }),
10931
11176
  z61.transform((v) => {
10932
11177
  return remap(v, {
10933
11178
  autoTopups: "auto_topups",
10934
11179
  spendLimits: "spend_limits",
10935
- usageAlerts: "usage_alerts"
11180
+ usageAlerts: "usage_alerts",
11181
+ overageAllowed: "overage_allowed"
10936
11182
  });
10937
11183
  })
10938
11184
  );
@@ -11020,6 +11266,17 @@ var UpdateCustomerUsageAlertResponse$inboundSchema = z61.pipe(
11020
11266
  });
11021
11267
  })
11022
11268
  );
11269
+ var UpdateCustomerOverageAllowedResponse$inboundSchema = z61.pipe(
11270
+ z61.object({
11271
+ feature_id: string4(),
11272
+ enabled: z61._default(boolean2(), false)
11273
+ }),
11274
+ z61.transform((v) => {
11275
+ return remap(v, {
11276
+ "feature_id": "featureId"
11277
+ });
11278
+ })
11279
+ );
11023
11280
  var UpdateCustomerBillingControlsResponse$inboundSchema = z61.pipe(
11024
11281
  z61.object({
11025
11282
  auto_topups: optional2(
@@ -11030,13 +11287,17 @@ var UpdateCustomerBillingControlsResponse$inboundSchema = z61.pipe(
11030
11287
  ),
11031
11288
  usage_alerts: optional2(
11032
11289
  z61.array(z61.lazy(() => UpdateCustomerUsageAlertResponse$inboundSchema))
11290
+ ),
11291
+ overage_allowed: optional2(
11292
+ z61.array(z61.lazy(() => UpdateCustomerOverageAllowedResponse$inboundSchema))
11033
11293
  )
11034
11294
  }),
11035
11295
  z61.transform((v) => {
11036
11296
  return remap(v, {
11037
11297
  "auto_topups": "autoTopups",
11038
11298
  "spend_limits": "spendLimits",
11039
- "usage_alerts": "usageAlerts"
11299
+ "usage_alerts": "usageAlerts",
11300
+ "overage_allowed": "overageAllowed"
11040
11301
  });
11041
11302
  })
11042
11303
  );
@@ -11228,6 +11489,17 @@ var UpdateEntityUsageAlertRequestBody$outboundSchema = z62.pipe(
11228
11489
  });
11229
11490
  })
11230
11491
  );
11492
+ var UpdateEntityOverageAllowedRequest$outboundSchema = z62.pipe(
11493
+ z62.object({
11494
+ featureId: z62.string(),
11495
+ enabled: z62._default(z62.boolean(), false)
11496
+ }),
11497
+ z62.transform((v) => {
11498
+ return remap(v, {
11499
+ featureId: "feature_id"
11500
+ });
11501
+ })
11502
+ );
11231
11503
  var UpdateEntityBillingControlsRequest$outboundSchema = z62.pipe(
11232
11504
  z62.object({
11233
11505
  spendLimits: z62.optional(
@@ -11235,12 +11507,16 @@ var UpdateEntityBillingControlsRequest$outboundSchema = z62.pipe(
11235
11507
  ),
11236
11508
  usageAlerts: z62.optional(
11237
11509
  z62.array(z62.lazy(() => UpdateEntityUsageAlertRequestBody$outboundSchema))
11510
+ ),
11511
+ overageAllowed: z62.optional(
11512
+ z62.array(z62.lazy(() => UpdateEntityOverageAllowedRequest$outboundSchema))
11238
11513
  )
11239
11514
  }),
11240
11515
  z62.transform((v) => {
11241
11516
  return remap(v, {
11242
11517
  spendLimits: "spend_limits",
11243
- usageAlerts: "usage_alerts"
11518
+ usageAlerts: "usage_alerts",
11519
+ overageAllowed: "overage_allowed"
11244
11520
  });
11245
11521
  })
11246
11522
  );
@@ -11392,6 +11668,17 @@ var UpdateEntityUsageAlertResponse$inboundSchema = z62.pipe(
11392
11668
  });
11393
11669
  })
11394
11670
  );
11671
+ var UpdateEntityOverageAllowedResponse$inboundSchema = z62.pipe(
11672
+ z62.object({
11673
+ feature_id: string4(),
11674
+ enabled: z62._default(boolean2(), false)
11675
+ }),
11676
+ z62.transform((v) => {
11677
+ return remap(v, {
11678
+ "feature_id": "featureId"
11679
+ });
11680
+ })
11681
+ );
11395
11682
  var UpdateEntityBillingControlsResponse$inboundSchema = z62.pipe(
11396
11683
  z62.object({
11397
11684
  spend_limits: optional2(
@@ -11399,12 +11686,16 @@ var UpdateEntityBillingControlsResponse$inboundSchema = z62.pipe(
11399
11686
  ),
11400
11687
  usage_alerts: optional2(
11401
11688
  z62.array(z62.lazy(() => UpdateEntityUsageAlertResponse$inboundSchema))
11689
+ ),
11690
+ overage_allowed: optional2(
11691
+ z62.array(z62.lazy(() => UpdateEntityOverageAllowedResponse$inboundSchema))
11402
11692
  )
11403
11693
  }),
11404
11694
  z62.transform((v) => {
11405
11695
  return remap(v, {
11406
11696
  "spend_limits": "spendLimits",
11407
- "usage_alerts": "usageAlerts"
11697
+ "usage_alerts": "usageAlerts",
11698
+ "overage_allowed": "overageAllowed"
11408
11699
  });
11409
11700
  })
11410
11701
  );
@@ -11757,11 +12048,13 @@ var UpdatePlanExpiryDurationTypeRequest$outboundSchema = z64.enum(UpdatePlanExpi
11757
12048
  var UpdatePlanRolloverRequest$outboundSchema = z64.pipe(
11758
12049
  z64.object({
11759
12050
  max: z64.optional(z64.number()),
12051
+ maxPercentage: z64.optional(z64.number()),
11760
12052
  expiryDurationType: UpdatePlanExpiryDurationTypeRequest$outboundSchema,
11761
12053
  expiryDurationLength: z64.optional(z64.number())
11762
12054
  }),
11763
12055
  z64.transform((v) => {
11764
12056
  return remap(v, {
12057
+ maxPercentage: "max_percentage",
11765
12058
  expiryDurationType: "expiry_duration_type",
11766
12059
  expiryDurationLength: "expiry_duration_length"
11767
12060
  });
@@ -11946,11 +12239,13 @@ var UpdatePlanExpiryDurationTypeResponse$inboundSchema = inboundSchema(UpdatePla
11946
12239
  var UpdatePlanRolloverResponse$inboundSchema = z64.pipe(
11947
12240
  z64.object({
11948
12241
  max: nullable(number2()),
12242
+ max_percentage: z64.optional(z64.nullable(number2())),
11949
12243
  expiry_duration_type: UpdatePlanExpiryDurationTypeResponse$inboundSchema,
11950
12244
  expiry_duration_length: optional2(number2())
11951
12245
  }),
11952
12246
  z64.transform((v) => {
11953
12247
  return remap(v, {
12248
+ "max_percentage": "maxPercentage",
11954
12249
  "expiry_duration_type": "expiryDurationType",
11955
12250
  "expiry_duration_length": "expiryDurationLength"
11956
12251
  });
@@ -12227,7 +12522,8 @@ async function $do2(client, request, options) {
12227
12522
  var FAIL_OPEN_OPERATION_IDS = /* @__PURE__ */ new Set([
12228
12523
  "check",
12229
12524
  "track",
12230
- "getOrCreateCustomer"
12525
+ "getOrCreateCustomer",
12526
+ "getEntity"
12231
12527
  ]);
12232
12528
  var FAIL_OPEN_LOG_MESSAGE = "[Autumn] Request failed \u2014 failing open. Learn more: https://docs.useautumn.com/documentation/fail-open";
12233
12529
  var FAIL_OPEN_BODIES = {
@@ -12257,6 +12553,18 @@ var FAIL_OPEN_BODIES = {
12257
12553
  purchases: [],
12258
12554
  balances: {},
12259
12555
  flags: {}
12556
+ },
12557
+ getEntity: {
12558
+ id: null,
12559
+ name: null,
12560
+ customer_id: null,
12561
+ feature_id: null,
12562
+ created_at: 0,
12563
+ env: "live",
12564
+ subscriptions: [],
12565
+ purchases: [],
12566
+ balances: {},
12567
+ flags: {}
12260
12568
  }
12261
12569
  };
12262
12570
  var FailOpenHook = class {