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
@@ -8,7 +8,7 @@ import {
8
8
  routeConfigs,
9
9
  sanitizeBody,
10
10
  secretKeyCheck
11
- } from "./chunk-LHA6NFFS.mjs";
11
+ } from "./chunk-2PRVJULJ.mjs";
12
12
  import {
13
13
  getActiveOrganization
14
14
  } from "./chunk-BT3EAYVW.mjs";
@@ -60,8 +60,8 @@ var SDK_METADATA = {
60
60
  language: "typescript",
61
61
  openapiDocVersion: "2.2.0",
62
62
  sdkVersion: "0.10.17",
63
- genVersion: "2.869.25",
64
- userAgent: "speakeasy-sdk/typescript 0.10.17 2.869.25 2.2.0 @useautumn/sdk"
63
+ genVersion: "2.879.1",
64
+ userAgent: "speakeasy-sdk/typescript 0.10.17 2.879.1 2.2.0 @useautumn/sdk"
65
65
  };
66
66
 
67
67
  // ../sdk/src/lib/http.ts
@@ -983,8 +983,8 @@ function applyBearer(state, spec) {
983
983
  state.headers[spec.fieldName] = value;
984
984
  }
985
985
  }
986
- function resolveGlobalSecurity(security) {
987
- return resolveSecurity(
986
+ function resolveGlobalSecurity(security, allowedFields) {
987
+ let inputs = [
988
988
  [
989
989
  {
990
990
  fieldName: "Authorization",
@@ -992,7 +992,16 @@ function resolveGlobalSecurity(security) {
992
992
  value: security?.secretKey ?? env().AUTUMN_SECRET_KEY
993
993
  }
994
994
  ]
995
- );
995
+ ];
996
+ if (allowedFields) {
997
+ inputs = allowedFields.map((i) => {
998
+ if (i < 0 || i >= inputs.length) {
999
+ throw new RangeError(`invalid allowedFields index ${i}`);
1000
+ }
1001
+ return inputs[i];
1002
+ });
1003
+ }
1004
+ return resolveSecurity(...inputs);
996
1005
  }
997
1006
  async function extractSecurity(sec) {
998
1007
  if (sec == null) {
@@ -1319,6 +1328,7 @@ var EventsAggregateParams$outboundSchema = z8.pipe(
1319
1328
  customRange: z8.optional(
1320
1329
  z8.lazy(() => AggregateEventsCustomRange$outboundSchema)
1321
1330
  ),
1331
+ filterBy: z8.optional(z8.record(z8.string(), z8.string())),
1322
1332
  maxGroups: z8.optional(z8.int())
1323
1333
  }),
1324
1334
  z8.transform((v) => {
@@ -1329,6 +1339,7 @@ var EventsAggregateParams$outboundSchema = z8.pipe(
1329
1339
  groupBy: "group_by",
1330
1340
  binSize: "bin_size",
1331
1341
  customRange: "custom_range",
1342
+ filterBy: "filter_by",
1332
1343
  maxGroups: "max_groups"
1333
1344
  });
1334
1345
  })
@@ -1537,11 +1548,13 @@ var AttachExpiryDurationType$outboundSchema = z10.enum(AttachExpiryDurationType)
1537
1548
  var AttachRollover$outboundSchema = z10.pipe(
1538
1549
  z10.object({
1539
1550
  max: z10.optional(z10.number()),
1551
+ maxPercentage: z10.optional(z10.number()),
1540
1552
  expiryDurationType: AttachExpiryDurationType$outboundSchema,
1541
1553
  expiryDurationLength: z10.optional(z10.number())
1542
1554
  }),
1543
1555
  z10.transform((v) => {
1544
1556
  return remap(v, {
1557
+ maxPercentage: "max_percentage",
1545
1558
  expiryDurationType: "expiry_duration_type",
1546
1559
  expiryDurationLength: "expiry_duration_length"
1547
1560
  });
@@ -2066,11 +2079,13 @@ var BillingUpdateExpiryDurationType$outboundSchema = z12.enum(BillingUpdateExpir
2066
2079
  var BillingUpdateRollover$outboundSchema = z12.pipe(
2067
2080
  z12.object({
2068
2081
  max: z12.optional(z12.number()),
2082
+ maxPercentage: z12.optional(z12.number()),
2069
2083
  expiryDurationType: BillingUpdateExpiryDurationType$outboundSchema,
2070
2084
  expiryDurationLength: z12.optional(z12.number())
2071
2085
  }),
2072
2086
  z12.transform((v) => {
2073
2087
  return remap(v, {
2088
+ maxPercentage: "max_percentage",
2074
2089
  expiryDurationType: "expiry_duration_type",
2075
2090
  expiryDurationLength: "expiry_duration_length"
2076
2091
  });
@@ -2412,11 +2427,19 @@ var ProductDisplay$inboundSchema = z13.pipe(
2412
2427
  })
2413
2428
  );
2414
2429
  var RolloverDuration$inboundSchema = inboundSchema(RolloverDuration);
2415
- var CheckRollover$inboundSchema = z13.object({
2416
- max: nullable(number2()),
2417
- duration: z13._default(RolloverDuration$inboundSchema, "month"),
2418
- length: number2()
2419
- });
2430
+ var CheckRollover$inboundSchema = z13.pipe(
2431
+ z13.object({
2432
+ max: z13.optional(z13.nullable(number2())),
2433
+ max_percentage: z13.optional(z13.nullable(number2())),
2434
+ duration: z13._default(RolloverDuration$inboundSchema, "month"),
2435
+ length: number2()
2436
+ }),
2437
+ z13.transform((v) => {
2438
+ return remap(v, {
2439
+ "max_percentage": "maxPercentage"
2440
+ });
2441
+ })
2442
+ );
2420
2443
  var CheckOnIncrease$inboundSchema = inboundSchema(CheckOnIncrease);
2421
2444
  var CheckOnDecrease$inboundSchema = inboundSchema(CheckOnDecrease);
2422
2445
  var Config$inboundSchema = z13.pipe(
@@ -2693,6 +2716,17 @@ var CustomerDataUsageAlert$outboundSchema = z15.pipe(
2693
2716
  });
2694
2717
  })
2695
2718
  );
2719
+ var CustomerDataOverageAllowed$outboundSchema = z15.pipe(
2720
+ z15.object({
2721
+ featureId: z15.string(),
2722
+ enabled: z15._default(z15.boolean(), false)
2723
+ }),
2724
+ z15.transform((v) => {
2725
+ return remap(v, {
2726
+ featureId: "feature_id"
2727
+ });
2728
+ })
2729
+ );
2696
2730
  var CustomerDataBillingControls$outboundSchema = z15.pipe(
2697
2731
  z15.object({
2698
2732
  autoTopups: z15.optional(
@@ -2703,13 +2737,17 @@ var CustomerDataBillingControls$outboundSchema = z15.pipe(
2703
2737
  ),
2704
2738
  usageAlerts: z15.optional(
2705
2739
  z15.array(z15.lazy(() => CustomerDataUsageAlert$outboundSchema))
2740
+ ),
2741
+ overageAllowed: z15.optional(
2742
+ z15.array(z15.lazy(() => CustomerDataOverageAllowed$outboundSchema))
2706
2743
  )
2707
2744
  }),
2708
2745
  z15.transform((v) => {
2709
2746
  return remap(v, {
2710
2747
  autoTopups: "auto_topups",
2711
2748
  spendLimits: "spend_limits",
2712
- usageAlerts: "usage_alerts"
2749
+ usageAlerts: "usage_alerts",
2750
+ overageAllowed: "overage_allowed"
2713
2751
  });
2714
2752
  })
2715
2753
  );
@@ -2920,11 +2958,13 @@ var ExpiryDurationType$inboundSchema = inboundSchema(ExpiryDurationType);
2920
2958
  var PlanRollover$inboundSchema = z16.pipe(
2921
2959
  z16.object({
2922
2960
  max: nullable(number2()),
2961
+ max_percentage: z16.optional(z16.nullable(number2())),
2923
2962
  expiry_duration_type: ExpiryDurationType$inboundSchema,
2924
2963
  expiry_duration_length: optional2(number2())
2925
2964
  }),
2926
2965
  z16.transform((v) => {
2927
2966
  return remap(v, {
2967
+ "max_percentage": "maxPercentage",
2928
2968
  "expiry_duration_type": "expiryDurationType",
2929
2969
  "expiry_duration_length": "expiryDurationLength"
2930
2970
  });
@@ -3063,6 +3103,17 @@ var CreateEntityUsageAlertRequestBody$outboundSchema = z17.pipe(
3063
3103
  });
3064
3104
  })
3065
3105
  );
3106
+ var CreateEntityOverageAllowedRequest$outboundSchema = z17.pipe(
3107
+ z17.object({
3108
+ featureId: z17.string(),
3109
+ enabled: z17._default(z17.boolean(), false)
3110
+ }),
3111
+ z17.transform((v) => {
3112
+ return remap(v, {
3113
+ featureId: "feature_id"
3114
+ });
3115
+ })
3116
+ );
3066
3117
  var CreateEntityBillingControlsRequest$outboundSchema = z17.pipe(
3067
3118
  z17.object({
3068
3119
  spendLimits: z17.optional(
@@ -3070,12 +3121,16 @@ var CreateEntityBillingControlsRequest$outboundSchema = z17.pipe(
3070
3121
  ),
3071
3122
  usageAlerts: z17.optional(
3072
3123
  z17.array(z17.lazy(() => CreateEntityUsageAlertRequestBody$outboundSchema))
3124
+ ),
3125
+ overageAllowed: z17.optional(
3126
+ z17.array(z17.lazy(() => CreateEntityOverageAllowedRequest$outboundSchema))
3073
3127
  )
3074
3128
  }),
3075
3129
  z17.transform((v) => {
3076
3130
  return remap(v, {
3077
3131
  spendLimits: "spend_limits",
3078
- usageAlerts: "usage_alerts"
3132
+ usageAlerts: "usage_alerts",
3133
+ overageAllowed: "overage_allowed"
3079
3134
  });
3080
3135
  })
3081
3136
  );
@@ -3232,6 +3287,17 @@ var CreateEntityUsageAlertResponse$inboundSchema = z17.pipe(
3232
3287
  });
3233
3288
  })
3234
3289
  );
3290
+ var CreateEntityOverageAllowedResponse$inboundSchema = z17.pipe(
3291
+ z17.object({
3292
+ feature_id: string4(),
3293
+ enabled: z17._default(boolean2(), false)
3294
+ }),
3295
+ z17.transform((v) => {
3296
+ return remap(v, {
3297
+ "feature_id": "featureId"
3298
+ });
3299
+ })
3300
+ );
3235
3301
  var CreateEntityBillingControlsResponse$inboundSchema = z17.pipe(
3236
3302
  z17.object({
3237
3303
  spend_limits: optional2(
@@ -3239,12 +3305,16 @@ var CreateEntityBillingControlsResponse$inboundSchema = z17.pipe(
3239
3305
  ),
3240
3306
  usage_alerts: optional2(
3241
3307
  z17.array(z17.lazy(() => CreateEntityUsageAlertResponse$inboundSchema))
3308
+ ),
3309
+ overage_allowed: optional2(
3310
+ z17.array(z17.lazy(() => CreateEntityOverageAllowedResponse$inboundSchema))
3242
3311
  )
3243
3312
  }),
3244
3313
  z17.transform((v) => {
3245
3314
  return remap(v, {
3246
3315
  "spend_limits": "spendLimits",
3247
- "usage_alerts": "usageAlerts"
3316
+ "usage_alerts": "usageAlerts",
3317
+ "overage_allowed": "overageAllowed"
3248
3318
  });
3249
3319
  })
3250
3320
  );
@@ -3594,11 +3664,13 @@ var CreatePlanExpiryDurationTypeRequest$outboundSchema = z19.enum(CreatePlanExpi
3594
3664
  var CreatePlanRolloverRequest$outboundSchema = z19.pipe(
3595
3665
  z19.object({
3596
3666
  max: z19.optional(z19.number()),
3667
+ maxPercentage: z19.optional(z19.number()),
3597
3668
  expiryDurationType: CreatePlanExpiryDurationTypeRequest$outboundSchema,
3598
3669
  expiryDurationLength: z19.optional(z19.number())
3599
3670
  }),
3600
3671
  z19.transform((v) => {
3601
3672
  return remap(v, {
3673
+ maxPercentage: "max_percentage",
3602
3674
  expiryDurationType: "expiry_duration_type",
3603
3675
  expiryDurationLength: "expiry_duration_length"
3604
3676
  });
@@ -3775,11 +3847,13 @@ var CreatePlanExpiryDurationTypeResponse$inboundSchema = inboundSchema(CreatePla
3775
3847
  var CreatePlanRolloverResponse$inboundSchema = z19.pipe(
3776
3848
  z19.object({
3777
3849
  max: nullable(number2()),
3850
+ max_percentage: z19.optional(z19.nullable(number2())),
3778
3851
  expiry_duration_type: CreatePlanExpiryDurationTypeResponse$inboundSchema,
3779
3852
  expiry_duration_length: optional2(number2())
3780
3853
  }),
3781
3854
  z19.transform((v) => {
3782
3855
  return remap(v, {
3856
+ "max_percentage": "maxPercentage",
3783
3857
  "expiry_duration_type": "expiryDurationType",
3784
3858
  "expiry_duration_length": "expiryDurationLength"
3785
3859
  });
@@ -4001,6 +4075,17 @@ var CustomerUsageAlert$inboundSchema = z21.pipe(
4001
4075
  });
4002
4076
  })
4003
4077
  );
4078
+ var CustomerOverageAllowed$inboundSchema = z21.pipe(
4079
+ z21.object({
4080
+ feature_id: string4(),
4081
+ enabled: z21._default(boolean2(), false)
4082
+ }),
4083
+ z21.transform((v) => {
4084
+ return remap(v, {
4085
+ "feature_id": "featureId"
4086
+ });
4087
+ })
4088
+ );
4004
4089
  var CustomerBillingControls$inboundSchema = z21.pipe(
4005
4090
  z21.object({
4006
4091
  auto_topups: optional2(
@@ -4011,13 +4096,17 @@ var CustomerBillingControls$inboundSchema = z21.pipe(
4011
4096
  ),
4012
4097
  usage_alerts: optional2(
4013
4098
  z21.array(z21.lazy(() => CustomerUsageAlert$inboundSchema))
4099
+ ),
4100
+ overage_allowed: optional2(
4101
+ z21.array(z21.lazy(() => CustomerOverageAllowed$inboundSchema))
4014
4102
  )
4015
4103
  }),
4016
4104
  z21.transform((v) => {
4017
4105
  return remap(v, {
4018
4106
  "auto_topups": "autoTopups",
4019
4107
  "spend_limits": "spendLimits",
4020
- "usage_alerts": "usageAlerts"
4108
+ "usage_alerts": "usageAlerts",
4109
+ "overage_allowed": "overageAllowed"
4021
4110
  });
4022
4111
  })
4023
4112
  );
@@ -4556,6 +4645,17 @@ var GetEntityUsageAlert$inboundSchema = z28.pipe(
4556
4645
  });
4557
4646
  })
4558
4647
  );
4648
+ var GetEntityOverageAllowed$inboundSchema = z28.pipe(
4649
+ z28.object({
4650
+ feature_id: string4(),
4651
+ enabled: z28._default(boolean2(), false)
4652
+ }),
4653
+ z28.transform((v) => {
4654
+ return remap(v, {
4655
+ "feature_id": "featureId"
4656
+ });
4657
+ })
4658
+ );
4559
4659
  var GetEntityBillingControls$inboundSchema = z28.pipe(
4560
4660
  z28.object({
4561
4661
  spend_limits: optional2(
@@ -4563,12 +4663,16 @@ var GetEntityBillingControls$inboundSchema = z28.pipe(
4563
4663
  ),
4564
4664
  usage_alerts: optional2(
4565
4665
  z28.array(z28.lazy(() => GetEntityUsageAlert$inboundSchema))
4666
+ ),
4667
+ overage_allowed: optional2(
4668
+ z28.array(z28.lazy(() => GetEntityOverageAllowed$inboundSchema))
4566
4669
  )
4567
4670
  }),
4568
4671
  z28.transform((v) => {
4569
4672
  return remap(v, {
4570
4673
  "spend_limits": "spendLimits",
4571
- "usage_alerts": "usageAlerts"
4674
+ "usage_alerts": "usageAlerts",
4675
+ "overage_allowed": "overageAllowed"
4572
4676
  });
4573
4677
  })
4574
4678
  );
@@ -4746,6 +4850,17 @@ var GetOrCreateCustomerUsageAlert$outboundSchema = z30.pipe(
4746
4850
  });
4747
4851
  })
4748
4852
  );
4853
+ var GetOrCreateCustomerOverageAllowed$outboundSchema = z30.pipe(
4854
+ z30.object({
4855
+ featureId: z30.string(),
4856
+ enabled: z30._default(z30.boolean(), false)
4857
+ }),
4858
+ z30.transform((v) => {
4859
+ return remap(v, {
4860
+ featureId: "feature_id"
4861
+ });
4862
+ })
4863
+ );
4749
4864
  var GetOrCreateCustomerBillingControls$outboundSchema = z30.pipe(
4750
4865
  z30.object({
4751
4866
  autoTopups: z30.optional(
@@ -4756,13 +4871,17 @@ var GetOrCreateCustomerBillingControls$outboundSchema = z30.pipe(
4756
4871
  ),
4757
4872
  usageAlerts: z30.optional(
4758
4873
  z30.array(z30.lazy(() => GetOrCreateCustomerUsageAlert$outboundSchema))
4874
+ ),
4875
+ overageAllowed: z30.optional(
4876
+ z30.array(z30.lazy(() => GetOrCreateCustomerOverageAllowed$outboundSchema))
4759
4877
  )
4760
4878
  }),
4761
4879
  z30.transform((v) => {
4762
4880
  return remap(v, {
4763
4881
  autoTopups: "auto_topups",
4764
4882
  spendLimits: "spend_limits",
4765
- usageAlerts: "usage_alerts"
4883
+ usageAlerts: "usage_alerts",
4884
+ overageAllowed: "overage_allowed"
4766
4885
  });
4767
4886
  })
4768
4887
  );
@@ -4987,11 +5106,13 @@ var GetPlanExpiryDurationType$inboundSchema = inboundSchema(GetPlanExpiryDuratio
4987
5106
  var GetPlanRollover$inboundSchema = z31.pipe(
4988
5107
  z31.object({
4989
5108
  max: nullable(number2()),
5109
+ max_percentage: z31.optional(z31.nullable(number2())),
4990
5110
  expiry_duration_type: GetPlanExpiryDurationType$inboundSchema,
4991
5111
  expiry_duration_length: optional2(number2())
4992
5112
  }),
4993
5113
  z31.transform((v) => {
4994
5114
  return remap(v, {
5115
+ "max_percentage": "maxPercentage",
4995
5116
  "expiry_duration_type": "expiryDurationType",
4996
5117
  "expiry_duration_length": "expiryDurationLength"
4997
5118
  });
@@ -5219,6 +5340,17 @@ var ListCustomersUsageAlert$inboundSchema = z32.pipe(
5219
5340
  });
5220
5341
  })
5221
5342
  );
5343
+ var ListCustomersOverageAllowed$inboundSchema = z32.pipe(
5344
+ z32.object({
5345
+ feature_id: string4(),
5346
+ enabled: z32._default(boolean2(), false)
5347
+ }),
5348
+ z32.transform((v) => {
5349
+ return remap(v, {
5350
+ "feature_id": "featureId"
5351
+ });
5352
+ })
5353
+ );
5222
5354
  var ListCustomersBillingControls$inboundSchema = z32.pipe(
5223
5355
  z32.object({
5224
5356
  auto_topups: optional2(
@@ -5229,13 +5361,17 @@ var ListCustomersBillingControls$inboundSchema = z32.pipe(
5229
5361
  ),
5230
5362
  usage_alerts: optional2(
5231
5363
  z32.array(z32.lazy(() => ListCustomersUsageAlert$inboundSchema))
5364
+ ),
5365
+ overage_allowed: optional2(
5366
+ z32.array(z32.lazy(() => ListCustomersOverageAllowed$inboundSchema))
5232
5367
  )
5233
5368
  }),
5234
5369
  z32.transform((v) => {
5235
5370
  return remap(v, {
5236
5371
  "auto_topups": "autoTopups",
5237
5372
  "spend_limits": "spendLimits",
5238
- "usage_alerts": "usageAlerts"
5373
+ "usage_alerts": "usageAlerts",
5374
+ "overage_allowed": "overageAllowed"
5239
5375
  });
5240
5376
  })
5241
5377
  );
@@ -5690,11 +5826,13 @@ var ListPlansExpiryDurationType$inboundSchema = inboundSchema(ListPlansExpiryDur
5690
5826
  var ListPlansRollover$inboundSchema = z35.pipe(
5691
5827
  z35.object({
5692
5828
  max: nullable(number2()),
5829
+ max_percentage: z35.optional(z35.nullable(number2())),
5693
5830
  expiry_duration_type: ListPlansExpiryDurationType$inboundSchema,
5694
5831
  expiry_duration_length: optional2(number2())
5695
5832
  }),
5696
5833
  z35.transform((v) => {
5697
5834
  return remap(v, {
5835
+ "max_percentage": "maxPercentage",
5698
5836
  "expiry_duration_type": "expiryDurationType",
5699
5837
  "expiry_duration_length": "expiryDurationLength"
5700
5838
  });
@@ -5938,11 +6076,13 @@ var MultiAttachExpiryDurationType$outboundSchema = z36.enum(MultiAttachExpiryDur
5938
6076
  var MultiAttachRollover$outboundSchema = z36.pipe(
5939
6077
  z36.object({
5940
6078
  max: z36.optional(z36.number()),
6079
+ maxPercentage: z36.optional(z36.number()),
5941
6080
  expiryDurationType: MultiAttachExpiryDurationType$outboundSchema,
5942
6081
  expiryDurationLength: z36.optional(z36.number())
5943
6082
  }),
5944
6083
  z36.transform((v) => {
5945
6084
  return remap(v, {
6085
+ maxPercentage: "max_percentage",
5946
6086
  expiryDurationType: "expiry_duration_type",
5947
6087
  expiryDurationLength: "expiry_duration_length"
5948
6088
  });
@@ -6069,6 +6209,17 @@ var MultiAttachUsageAlert$outboundSchema = z36.pipe(
6069
6209
  });
6070
6210
  })
6071
6211
  );
6212
+ var MultiAttachOverageAllowed$outboundSchema = z36.pipe(
6213
+ z36.object({
6214
+ featureId: z36.string(),
6215
+ enabled: z36._default(z36.boolean(), false)
6216
+ }),
6217
+ z36.transform((v) => {
6218
+ return remap(v, {
6219
+ featureId: "feature_id"
6220
+ });
6221
+ })
6222
+ );
6072
6223
  var MultiAttachBillingControls$outboundSchema = z36.pipe(
6073
6224
  z36.object({
6074
6225
  spendLimits: z36.optional(
@@ -6076,12 +6227,16 @@ var MultiAttachBillingControls$outboundSchema = z36.pipe(
6076
6227
  ),
6077
6228
  usageAlerts: z36.optional(
6078
6229
  z36.array(z36.lazy(() => MultiAttachUsageAlert$outboundSchema))
6230
+ ),
6231
+ overageAllowed: z36.optional(
6232
+ z36.array(z36.lazy(() => MultiAttachOverageAllowed$outboundSchema))
6079
6233
  )
6080
6234
  }),
6081
6235
  z36.transform((v) => {
6082
6236
  return remap(v, {
6083
6237
  spendLimits: "spend_limits",
6084
- usageAlerts: "usage_alerts"
6238
+ usageAlerts: "usage_alerts",
6239
+ overageAllowed: "overage_allowed"
6085
6240
  });
6086
6241
  })
6087
6242
  );
@@ -6375,11 +6530,13 @@ var PreviewAttachExpiryDurationType$outboundSchema = z38.enum(PreviewAttachExpir
6375
6530
  var PreviewAttachRollover$outboundSchema = z38.pipe(
6376
6531
  z38.object({
6377
6532
  max: z38.optional(z38.number()),
6533
+ maxPercentage: z38.optional(z38.number()),
6378
6534
  expiryDurationType: PreviewAttachExpiryDurationType$outboundSchema,
6379
6535
  expiryDurationLength: z38.optional(z38.number())
6380
6536
  }),
6381
6537
  z38.transform((v) => {
6382
6538
  return remap(v, {
6539
+ maxPercentage: "max_percentage",
6383
6540
  expiryDurationType: "expiry_duration_type",
6384
6541
  expiryDurationLength: "expiry_duration_length"
6385
6542
  });
@@ -6923,11 +7080,13 @@ var PreviewMultiAttachExpiryDurationType$outboundSchema = z39.enum(PreviewMultiA
6923
7080
  var PreviewMultiAttachRollover$outboundSchema = z39.pipe(
6924
7081
  z39.object({
6925
7082
  max: z39.optional(z39.number()),
7083
+ maxPercentage: z39.optional(z39.number()),
6926
7084
  expiryDurationType: PreviewMultiAttachExpiryDurationType$outboundSchema,
6927
7085
  expiryDurationLength: z39.optional(z39.number())
6928
7086
  }),
6929
7087
  z39.transform((v) => {
6930
7088
  return remap(v, {
7089
+ maxPercentage: "max_percentage",
6931
7090
  expiryDurationType: "expiry_duration_type",
6932
7091
  expiryDurationLength: "expiry_duration_length"
6933
7092
  });
@@ -7067,6 +7226,17 @@ var PreviewMultiAttachUsageAlert$outboundSchema = z39.pipe(
7067
7226
  });
7068
7227
  })
7069
7228
  );
7229
+ var PreviewMultiAttachOverageAllowed$outboundSchema = z39.pipe(
7230
+ z39.object({
7231
+ featureId: z39.string(),
7232
+ enabled: z39._default(z39.boolean(), false)
7233
+ }),
7234
+ z39.transform((v) => {
7235
+ return remap(v, {
7236
+ featureId: "feature_id"
7237
+ });
7238
+ })
7239
+ );
7070
7240
  var PreviewMultiAttachBillingControls$outboundSchema = z39.pipe(
7071
7241
  z39.object({
7072
7242
  spendLimits: z39.optional(
@@ -7074,12 +7244,16 @@ var PreviewMultiAttachBillingControls$outboundSchema = z39.pipe(
7074
7244
  ),
7075
7245
  usageAlerts: z39.optional(
7076
7246
  z39.array(z39.lazy(() => PreviewMultiAttachUsageAlert$outboundSchema))
7247
+ ),
7248
+ overageAllowed: z39.optional(
7249
+ z39.array(z39.lazy(() => PreviewMultiAttachOverageAllowed$outboundSchema))
7077
7250
  )
7078
7251
  }),
7079
7252
  z39.transform((v) => {
7080
7253
  return remap(v, {
7081
7254
  spendLimits: "spend_limits",
7082
- usageAlerts: "usage_alerts"
7255
+ usageAlerts: "usage_alerts",
7256
+ overageAllowed: "overage_allowed"
7083
7257
  });
7084
7258
  })
7085
7259
  );
@@ -7535,11 +7709,13 @@ var PreviewUpdateExpiryDurationType$outboundSchema = z40.enum(PreviewUpdateExpir
7535
7709
  var PreviewUpdateRollover$outboundSchema = z40.pipe(
7536
7710
  z40.object({
7537
7711
  max: z40.optional(z40.number()),
7712
+ maxPercentage: z40.optional(z40.number()),
7538
7713
  expiryDurationType: PreviewUpdateExpiryDurationType$outboundSchema,
7539
7714
  expiryDurationLength: z40.optional(z40.number())
7540
7715
  }),
7541
7716
  z40.transform((v) => {
7542
7717
  return remap(v, {
7718
+ maxPercentage: "max_percentage",
7543
7719
  expiryDurationType: "expiry_duration_type",
7544
7720
  expiryDurationLength: "expiry_duration_length"
7545
7721
  });
@@ -8055,11 +8231,13 @@ var SetupPaymentExpiryDurationType$outboundSchema = z42.enum(SetupPaymentExpiryD
8055
8231
  var SetupPaymentRollover$outboundSchema = z42.pipe(
8056
8232
  z42.object({
8057
8233
  max: z42.optional(z42.number()),
8234
+ maxPercentage: z42.optional(z42.number()),
8058
8235
  expiryDurationType: SetupPaymentExpiryDurationType$outboundSchema,
8059
8236
  expiryDurationLength: z42.optional(z42.number())
8060
8237
  }),
8061
8238
  z42.transform((v) => {
8062
8239
  return remap(v, {
8240
+ maxPercentage: "max_percentage",
8063
8241
  expiryDurationType: "expiry_duration_type",
8064
8242
  expiryDurationLength: "expiry_duration_length"
8065
8243
  });
@@ -8404,6 +8582,17 @@ var UpdateCustomerUsageAlertRequestBody$outboundSchema = z45.pipe(
8404
8582
  });
8405
8583
  })
8406
8584
  );
8585
+ var UpdateCustomerOverageAllowedRequest$outboundSchema = z45.pipe(
8586
+ z45.object({
8587
+ featureId: z45.string(),
8588
+ enabled: z45._default(z45.boolean(), false)
8589
+ }),
8590
+ z45.transform((v) => {
8591
+ return remap(v, {
8592
+ featureId: "feature_id"
8593
+ });
8594
+ })
8595
+ );
8407
8596
  var UpdateCustomerBillingControlsRequest$outboundSchema = z45.pipe(
8408
8597
  z45.object({
8409
8598
  autoTopups: z45.optional(
@@ -8414,13 +8603,17 @@ var UpdateCustomerBillingControlsRequest$outboundSchema = z45.pipe(
8414
8603
  ),
8415
8604
  usageAlerts: z45.optional(
8416
8605
  z45.array(z45.lazy(() => UpdateCustomerUsageAlertRequestBody$outboundSchema))
8606
+ ),
8607
+ overageAllowed: z45.optional(
8608
+ z45.array(z45.lazy(() => UpdateCustomerOverageAllowedRequest$outboundSchema))
8417
8609
  )
8418
8610
  }),
8419
8611
  z45.transform((v) => {
8420
8612
  return remap(v, {
8421
8613
  autoTopups: "auto_topups",
8422
8614
  spendLimits: "spend_limits",
8423
- usageAlerts: "usage_alerts"
8615
+ usageAlerts: "usage_alerts",
8616
+ overageAllowed: "overage_allowed"
8424
8617
  });
8425
8618
  })
8426
8619
  );
@@ -8508,6 +8701,17 @@ var UpdateCustomerUsageAlertResponse$inboundSchema = z45.pipe(
8508
8701
  });
8509
8702
  })
8510
8703
  );
8704
+ var UpdateCustomerOverageAllowedResponse$inboundSchema = z45.pipe(
8705
+ z45.object({
8706
+ feature_id: string4(),
8707
+ enabled: z45._default(boolean2(), false)
8708
+ }),
8709
+ z45.transform((v) => {
8710
+ return remap(v, {
8711
+ "feature_id": "featureId"
8712
+ });
8713
+ })
8714
+ );
8511
8715
  var UpdateCustomerBillingControlsResponse$inboundSchema = z45.pipe(
8512
8716
  z45.object({
8513
8717
  auto_topups: optional2(
@@ -8518,13 +8722,17 @@ var UpdateCustomerBillingControlsResponse$inboundSchema = z45.pipe(
8518
8722
  ),
8519
8723
  usage_alerts: optional2(
8520
8724
  z45.array(z45.lazy(() => UpdateCustomerUsageAlertResponse$inboundSchema))
8725
+ ),
8726
+ overage_allowed: optional2(
8727
+ z45.array(z45.lazy(() => UpdateCustomerOverageAllowedResponse$inboundSchema))
8521
8728
  )
8522
8729
  }),
8523
8730
  z45.transform((v) => {
8524
8731
  return remap(v, {
8525
8732
  "auto_topups": "autoTopups",
8526
8733
  "spend_limits": "spendLimits",
8527
- "usage_alerts": "usageAlerts"
8734
+ "usage_alerts": "usageAlerts",
8735
+ "overage_allowed": "overageAllowed"
8528
8736
  });
8529
8737
  })
8530
8738
  );
@@ -8716,6 +8924,17 @@ var UpdateEntityUsageAlertRequestBody$outboundSchema = z46.pipe(
8716
8924
  });
8717
8925
  })
8718
8926
  );
8927
+ var UpdateEntityOverageAllowedRequest$outboundSchema = z46.pipe(
8928
+ z46.object({
8929
+ featureId: z46.string(),
8930
+ enabled: z46._default(z46.boolean(), false)
8931
+ }),
8932
+ z46.transform((v) => {
8933
+ return remap(v, {
8934
+ featureId: "feature_id"
8935
+ });
8936
+ })
8937
+ );
8719
8938
  var UpdateEntityBillingControlsRequest$outboundSchema = z46.pipe(
8720
8939
  z46.object({
8721
8940
  spendLimits: z46.optional(
@@ -8723,12 +8942,16 @@ var UpdateEntityBillingControlsRequest$outboundSchema = z46.pipe(
8723
8942
  ),
8724
8943
  usageAlerts: z46.optional(
8725
8944
  z46.array(z46.lazy(() => UpdateEntityUsageAlertRequestBody$outboundSchema))
8945
+ ),
8946
+ overageAllowed: z46.optional(
8947
+ z46.array(z46.lazy(() => UpdateEntityOverageAllowedRequest$outboundSchema))
8726
8948
  )
8727
8949
  }),
8728
8950
  z46.transform((v) => {
8729
8951
  return remap(v, {
8730
8952
  spendLimits: "spend_limits",
8731
- usageAlerts: "usage_alerts"
8953
+ usageAlerts: "usage_alerts",
8954
+ overageAllowed: "overage_allowed"
8732
8955
  });
8733
8956
  })
8734
8957
  );
@@ -8880,6 +9103,17 @@ var UpdateEntityUsageAlertResponse$inboundSchema = z46.pipe(
8880
9103
  });
8881
9104
  })
8882
9105
  );
9106
+ var UpdateEntityOverageAllowedResponse$inboundSchema = z46.pipe(
9107
+ z46.object({
9108
+ feature_id: string4(),
9109
+ enabled: z46._default(boolean2(), false)
9110
+ }),
9111
+ z46.transform((v) => {
9112
+ return remap(v, {
9113
+ "feature_id": "featureId"
9114
+ });
9115
+ })
9116
+ );
8883
9117
  var UpdateEntityBillingControlsResponse$inboundSchema = z46.pipe(
8884
9118
  z46.object({
8885
9119
  spend_limits: optional2(
@@ -8887,12 +9121,16 @@ var UpdateEntityBillingControlsResponse$inboundSchema = z46.pipe(
8887
9121
  ),
8888
9122
  usage_alerts: optional2(
8889
9123
  z46.array(z46.lazy(() => UpdateEntityUsageAlertResponse$inboundSchema))
9124
+ ),
9125
+ overage_allowed: optional2(
9126
+ z46.array(z46.lazy(() => UpdateEntityOverageAllowedResponse$inboundSchema))
8890
9127
  )
8891
9128
  }),
8892
9129
  z46.transform((v) => {
8893
9130
  return remap(v, {
8894
9131
  "spend_limits": "spendLimits",
8895
- "usage_alerts": "usageAlerts"
9132
+ "usage_alerts": "usageAlerts",
9133
+ "overage_allowed": "overageAllowed"
8896
9134
  });
8897
9135
  })
8898
9136
  );
@@ -9245,11 +9483,13 @@ var UpdatePlanExpiryDurationTypeRequest$outboundSchema = z48.enum(UpdatePlanExpi
9245
9483
  var UpdatePlanRolloverRequest$outboundSchema = z48.pipe(
9246
9484
  z48.object({
9247
9485
  max: z48.optional(z48.number()),
9486
+ maxPercentage: z48.optional(z48.number()),
9248
9487
  expiryDurationType: UpdatePlanExpiryDurationTypeRequest$outboundSchema,
9249
9488
  expiryDurationLength: z48.optional(z48.number())
9250
9489
  }),
9251
9490
  z48.transform((v) => {
9252
9491
  return remap(v, {
9492
+ maxPercentage: "max_percentage",
9253
9493
  expiryDurationType: "expiry_duration_type",
9254
9494
  expiryDurationLength: "expiry_duration_length"
9255
9495
  });
@@ -9434,11 +9674,13 @@ var UpdatePlanExpiryDurationTypeResponse$inboundSchema = inboundSchema(UpdatePla
9434
9674
  var UpdatePlanRolloverResponse$inboundSchema = z48.pipe(
9435
9675
  z48.object({
9436
9676
  max: nullable(number2()),
9677
+ max_percentage: z48.optional(z48.nullable(number2())),
9437
9678
  expiry_duration_type: UpdatePlanExpiryDurationTypeResponse$inboundSchema,
9438
9679
  expiry_duration_length: optional2(number2())
9439
9680
  }),
9440
9681
  z48.transform((v) => {
9441
9682
  return remap(v, {
9683
+ "max_percentage": "maxPercentage",
9442
9684
  "expiry_duration_type": "expiryDurationType",
9443
9685
  "expiry_duration_length": "expiryDurationLength"
9444
9686
  });
@@ -9715,7 +9957,8 @@ async function $do2(client, request, options) {
9715
9957
  var FAIL_OPEN_OPERATION_IDS = /* @__PURE__ */ new Set([
9716
9958
  "check",
9717
9959
  "track",
9718
- "getOrCreateCustomer"
9960
+ "getOrCreateCustomer",
9961
+ "getEntity"
9719
9962
  ]);
9720
9963
  var FAIL_OPEN_LOG_MESSAGE = "[Autumn] Request failed \u2014 failing open. Learn more: https://docs.useautumn.com/documentation/fail-open";
9721
9964
  var FAIL_OPEN_BODIES = {
@@ -9745,6 +9988,18 @@ var FAIL_OPEN_BODIES = {
9745
9988
  purchases: [],
9746
9989
  balances: {},
9747
9990
  flags: {}
9991
+ },
9992
+ getEntity: {
9993
+ id: null,
9994
+ name: null,
9995
+ customer_id: null,
9996
+ feature_id: null,
9997
+ created_at: 0,
9998
+ env: "live",
9999
+ subscriptions: [],
10000
+ purchases: [],
10001
+ balances: {},
10002
+ flags: {}
9748
10003
  }
9749
10004
  };
9750
10005
  var FailOpenHook = class {