autumn-js 1.2.31 → 1.2.32

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 (116) hide show
  1. package/dist/backend/adapters/express.js +16 -1
  2. package/dist/backend/adapters/express.mjs +6 -6
  3. package/dist/backend/adapters/fetch.js +16 -1
  4. package/dist/backend/adapters/fetch.mjs +6 -6
  5. package/dist/backend/adapters/hono.js +16 -1
  6. package/dist/backend/adapters/hono.mjs +6 -6
  7. package/dist/backend/adapters/index.js +16 -1
  8. package/dist/backend/adapters/index.mjs +9 -9
  9. package/dist/backend/adapters/next.js +16 -1
  10. package/dist/backend/adapters/next.mjs +6 -6
  11. package/dist/backend/{chunk-JMSAO3QS.mjs → chunk-5QIIBIZY.mjs} +2 -2
  12. package/dist/backend/{chunk-6BIFNQMZ.mjs → chunk-7MPQ5TCH.mjs} +2 -2
  13. package/dist/backend/{chunk-Z3FKN2NF.mjs → chunk-AYS6GLVO.mjs} +1 -1
  14. package/dist/backend/{chunk-QA6NTMCY.mjs → chunk-MXD3NPQK.mjs} +1 -1
  15. package/dist/backend/{chunk-NYLHQ6KR.mjs → chunk-NSAJNDTG.mjs} +1 -1
  16. package/dist/backend/{chunk-N72VCQNK.mjs → chunk-UYURZ75E.mjs} +1 -0
  17. package/dist/backend/{chunk-HF6Z42J6.mjs → chunk-W7MG3LB3.mjs} +1 -1
  18. package/dist/backend/{chunk-JD72L3WP.mjs → chunk-Z7WSDAEZ.mjs} +15 -1
  19. package/dist/backend/core/handlers/coreHandler.d.mts +1 -1
  20. package/dist/backend/core/handlers/coreHandler.d.ts +1 -1
  21. package/dist/backend/core/handlers/coreHandler.js +16 -1
  22. package/dist/backend/core/handlers/coreHandler.mjs +4 -4
  23. package/dist/backend/core/handlers/executeRoute.d.mts +1 -1
  24. package/dist/backend/core/handlers/executeRoute.d.ts +1 -1
  25. package/dist/backend/core/handlers/executeRoute.mjs +1 -1
  26. package/dist/backend/core/handlers/handleRouteByName.js +16 -1
  27. package/dist/backend/core/handlers/handleRouteByName.mjs +4 -4
  28. package/dist/backend/core/handlers/index.d.mts +1 -1
  29. package/dist/backend/core/handlers/index.d.ts +1 -1
  30. package/dist/backend/core/handlers/index.js +16 -1
  31. package/dist/backend/core/handlers/index.mjs +5 -5
  32. package/dist/backend/core/index.d.mts +1 -1
  33. package/dist/backend/core/index.d.ts +1 -1
  34. package/dist/backend/core/index.js +16 -1
  35. package/dist/backend/core/index.mjs +7 -7
  36. package/dist/backend/core/routes/index.d.mts +1 -1
  37. package/dist/backend/core/routes/index.d.ts +1 -1
  38. package/dist/backend/core/routes/index.js +1 -0
  39. package/dist/backend/core/routes/index.mjs +2 -2
  40. package/dist/backend/core/routes/routeBuilder.d.mts +1 -1
  41. package/dist/backend/core/routes/routeBuilder.d.ts +1 -1
  42. package/dist/backend/core/routes/routeConfigs.d.mts +1 -1
  43. package/dist/backend/core/routes/routeConfigs.d.ts +1 -1
  44. package/dist/backend/core/routes/routeConfigs.js +1 -0
  45. package/dist/backend/core/routes/routeConfigs.mjs +2 -2
  46. package/dist/backend/core/types/handlerTypes.d.mts +1 -1
  47. package/dist/backend/core/types/handlerTypes.d.ts +1 -1
  48. package/dist/backend/core/types/index.d.mts +1 -1
  49. package/dist/backend/core/types/index.d.ts +1 -1
  50. package/dist/backend/core/types/routeTypes.d.mts +1 -1
  51. package/dist/backend/core/types/routeTypes.d.ts +1 -1
  52. package/dist/backend/core/utils/index.mjs +3 -3
  53. package/dist/backend/index.d.mts +2 -2
  54. package/dist/backend/index.d.ts +2 -2
  55. package/dist/backend/index.js +16 -1
  56. package/dist/backend/index.mjs +7 -7
  57. package/dist/backend/{routeTypes-DVB8MoV9.d.ts → routeTypes-ChCnBnee.d.ts} +59 -1
  58. package/dist/backend/{routeTypes-DxmM-KwZ.d.mts → routeTypes-DmFnGvb2.d.mts} +59 -1
  59. package/dist/better-auth/{chunk-R3YUB555.mjs → chunk-56VTK4JS.mjs} +1 -1
  60. package/dist/better-auth/{chunk-633AUR7J.mjs → chunk-JBU3OM2O.mjs} +16 -2
  61. package/dist/better-auth/{chunk-UOQDNCD2.mjs → chunk-ZQA6B5RX.mjs} +1 -0
  62. package/dist/better-auth/index.js +16 -1
  63. package/dist/better-auth/index.mjs +3 -3
  64. package/dist/better-auth/utils/createAutumnEndpoint.js +1 -0
  65. package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
  66. package/dist/better-auth/utils/handleBetterAuthRoute.js +16 -1
  67. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
  68. package/dist/better-auth/utils/index.js +16 -1
  69. package/dist/better-auth/utils/index.mjs +3 -3
  70. package/dist/react/AutumnContext.d.mts +3 -3
  71. package/dist/react/AutumnContext.d.ts +3 -3
  72. package/dist/react/client/AutumnClient.d.mts +3 -3
  73. package/dist/react/client/AutumnClient.d.ts +3 -3
  74. package/dist/react/client/IAutumnClient.d.mts +9 -3
  75. package/dist/react/client/IAutumnClient.d.ts +9 -3
  76. package/dist/react/client/index.d.mts +3 -3
  77. package/dist/react/client/index.d.ts +3 -3
  78. package/dist/react/{customer-DjiQ6w1e.d.mts → customer-B9DcViyn.d.mts} +1 -1
  79. package/dist/react/{customer-BbU458Gc.d.ts → customer-DbS31iZc.d.ts} +1 -1
  80. package/dist/react/hooks/index.d.mts +3 -3
  81. package/dist/react/hooks/index.d.ts +3 -3
  82. package/dist/react/hooks/internal/check/balanceToAllowed.d.mts +2 -2
  83. package/dist/react/hooks/internal/check/balanceToAllowed.d.ts +2 -2
  84. package/dist/react/hooks/internal/check/customerToFeatures.d.mts +2 -2
  85. package/dist/react/hooks/internal/check/customerToFeatures.d.ts +2 -2
  86. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.mts +2 -2
  87. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.ts +2 -2
  88. package/dist/react/hooks/internal/check/getCreditCost.d.mts +2 -2
  89. package/dist/react/hooks/internal/check/getCreditCost.d.ts +2 -2
  90. package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +3 -3
  91. package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +3 -3
  92. package/dist/react/hooks/internal/useCustomerActions.d.mts +3 -3
  93. package/dist/react/hooks/internal/useCustomerActions.d.ts +3 -3
  94. package/dist/react/hooks/useAggregateEvents.d.mts +2 -2
  95. package/dist/react/hooks/useAggregateEvents.d.ts +2 -2
  96. package/dist/react/hooks/useCustomer.d.mts +3 -3
  97. package/dist/react/hooks/useCustomer.d.ts +3 -3
  98. package/dist/react/hooks/useEntity.d.mts +2 -2
  99. package/dist/react/hooks/useEntity.d.ts +2 -2
  100. package/dist/react/hooks/useListEvents.d.mts +2 -2
  101. package/dist/react/hooks/useListEvents.d.ts +2 -2
  102. package/dist/react/hooks/useListPlans.d.mts +2 -2
  103. package/dist/react/hooks/useListPlans.d.ts +2 -2
  104. package/dist/react/hooks/useReferrals.d.mts +2 -2
  105. package/dist/react/hooks/useReferrals.d.ts +2 -2
  106. package/dist/react/index.d.mts +3 -3
  107. package/dist/react/index.d.ts +3 -3
  108. package/dist/react/{params-B-8mg8Ze.d.mts → params-B8-s4Q1n.d.ts} +1 -1
  109. package/dist/react/{params-Dqm7Np9G.d.ts → params-BquS51Ut.d.mts} +1 -1
  110. package/dist/react/{plan-2RG0aPsm.d.mts → plan-BKltGb1S.d.mts} +6 -0
  111. package/dist/react/{plan-2RG0aPsm.d.ts → plan-BKltGb1S.d.ts} +6 -0
  112. package/dist/sdk/index.d.mts +68 -1
  113. package/dist/sdk/index.d.ts +68 -1
  114. package/dist/sdk/index.js +15 -1
  115. package/dist/sdk/index.mjs +15 -1
  116. package/package.json +1 -1
@@ -2220,6 +2220,7 @@ var RequestBody$outboundSchema = z12.pipe(
2220
2220
  eventName: z12.optional(z12.string()),
2221
2221
  value: z12.optional(z12.number()),
2222
2222
  properties: z12.optional(z12.record(z12.string(), z12.any())),
2223
+ timestamp: z12.optional(z12.int()),
2223
2224
  async: z12.optional(z12.boolean()),
2224
2225
  lock: z12.optional(z12.lazy(() => BatchTrackLock$outboundSchema))
2225
2226
  }),
@@ -4117,6 +4118,7 @@ var Plan$inboundSchema = z17.pipe(
4117
4118
  archived: boolean2(),
4118
4119
  base_variant_id: nullable(string4()),
4119
4120
  config: z17.lazy(() => PlanConfig$inboundSchema),
4121
+ metadata: z17.record(z17.string(), z17.any()),
4120
4122
  customer_eligibility: optional3(z17.lazy(
4121
4123
  () => CustomerEligibility$inboundSchema
4122
4124
  ))
@@ -5003,6 +5005,7 @@ var CreatePlanParams$outboundSchema = z20.pipe(
5003
5005
  items: z20.optional(z20.array(z20.lazy(() => CreatePlanPlanItem$outboundSchema))),
5004
5006
  freeTrial: z20.optional(z20.lazy(() => FreeTrialRequest$outboundSchema)),
5005
5007
  config: z20.optional(z20.lazy(() => CreatePlanConfigRequest$outboundSchema)),
5008
+ metadata: z20.optional(z20.record(z20.string(), z20.any())),
5006
5009
  createInStripe: z20._default(z20.boolean(), true)
5007
5010
  }),
5008
5011
  z20.transform((v) => {
@@ -5242,6 +5245,7 @@ var CreatePlanResponse$inboundSchema = z20.pipe(
5242
5245
  archived: boolean2(),
5243
5246
  base_variant_id: nullable(string4()),
5244
5247
  config: z20.lazy(() => CreatePlanConfigResponse$inboundSchema),
5248
+ metadata: z20.record(z20.string(), z20.any()),
5245
5249
  customer_eligibility: optional3(
5246
5250
  z20.lazy(() => CreatePlanCustomerEligibility$inboundSchema)
5247
5251
  )
@@ -7978,6 +7982,7 @@ var GetPlanResponse$inboundSchema = z35.pipe(
7978
7982
  archived: boolean2(),
7979
7983
  base_variant_id: nullable(string4()),
7980
7984
  config: z35.lazy(() => GetPlanConfig$inboundSchema),
7985
+ metadata: z35.record(z35.string(), z35.any()),
7981
7986
  customer_eligibility: optional3(
7982
7987
  z35.lazy(() => GetPlanCustomerEligibility$inboundSchema)
7983
7988
  )
@@ -9398,6 +9403,7 @@ var ListPlansList$inboundSchema = z42.pipe(
9398
9403
  archived: boolean2(),
9399
9404
  base_variant_id: nullable(string4()),
9400
9405
  config: z42.lazy(() => ListPlansConfig$inboundSchema),
9406
+ metadata: z42.record(z42.string(), z42.any()),
9401
9407
  customer_eligibility: optional3(
9402
9408
  z42.lazy(() => ListPlansCustomerEligibility$inboundSchema)
9403
9409
  )
@@ -13005,6 +13011,7 @@ var TrackParams$outboundSchema = z55.pipe(
13005
13011
  eventName: z55.optional(z55.string()),
13006
13012
  value: z55.optional(z55.number()),
13007
13013
  properties: z55.optional(z55.record(z55.string(), z55.any())),
13014
+ timestamp: z55.optional(z55.int()),
13008
13015
  async: z55.optional(z55.boolean()),
13009
13016
  lock: z55.optional(z55.lazy(() => TrackLock$outboundSchema))
13010
13017
  }),
@@ -13166,6 +13173,7 @@ var TrackTokensParams$outboundSchema = z56.pipe(
13166
13173
  audioOutputTokens: z56.optional(z56.int()),
13167
13174
  reasoningTokens: z56.optional(z56.int()),
13168
13175
  properties: z56.optional(z56.record(z56.string(), z56.any())),
13176
+ timestamp: z56.optional(z56.int()),
13169
13177
  async: z56.optional(z56.boolean())
13170
13178
  }),
13171
13179
  z56.transform((v) => {
@@ -14786,6 +14794,7 @@ var UpdatePlanParams$outboundSchema = z61.pipe(
14786
14794
  z61.nullable(z61.lazy(() => UpdatePlanFreeTrialParams$outboundSchema))
14787
14795
  ),
14788
14796
  config: z61.optional(z61.lazy(() => UpdatePlanConfigRequest$outboundSchema)),
14797
+ metadata: z61.optional(z61.record(z61.string(), z61.any())),
14789
14798
  createInStripe: z61._default(z61.boolean(), true),
14790
14799
  version: z61.optional(z61.number()),
14791
14800
  archived: z61._default(z61.boolean(), false),
@@ -15029,6 +15038,7 @@ var UpdatePlanResponse$inboundSchema = z61.pipe(
15029
15038
  archived: boolean2(),
15030
15039
  base_variant_id: nullable(string4()),
15031
15040
  config: z61.lazy(() => UpdatePlanConfigResponse$inboundSchema),
15041
+ metadata: z61.record(z61.string(), z61.any()),
15032
15042
  customer_eligibility: optional3(
15033
15043
  z61.lazy(() => UpdatePlanCustomerEligibility$inboundSchema)
15034
15044
  )
@@ -17119,7 +17129,7 @@ var Billing = class extends ClientSDK {
17119
17129
  * @example
17120
17130
  * ```typescript
17121
17131
  * // Schedule a transition from a trial plan to a paid plan
17122
- * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1782152693121,"plans":[{"planId":"trial_plan"}]},{"startsAt":1783362293121,"plans":[{"planId":"pro_plan"}]}] });
17132
+ * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1782402442343,"plans":[{"planId":"trial_plan"}]},{"startsAt":1783612042343,"plans":[{"planId":"pro_plan"}]}] });
17123
17133
  * ```
17124
17134
  *
17125
17135
  * @param customerId - The ID of the customer to create the schedule for.
@@ -19820,6 +19830,7 @@ var Plans = class extends ClientSDK {
19820
19830
  * @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
19821
19831
  * @param freeTrial - Free trial configuration. Customers can try this plan before being charged. (optional)
19822
19832
  * @param config - Miscellaneous plan-level configuration flags. (optional)
19833
+ * @param metadata - Arbitrary key-value metadata defined by you for your own use (e.g. UI copy, feature highlights). Values can be any JSON-serializable value. Shared across all versions of the plan. (optional)
19823
19834
  *
19824
19835
  * @returns The created plan object.
19825
19836
  */
@@ -19926,6 +19937,7 @@ var Plans = class extends ClientSDK {
19926
19937
  * @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
19927
19938
  * @param freeTrial - The free trial of the plan. Set to null to remove the free trial. (optional)
19928
19939
  * @param config - Miscellaneous plan-level configuration flags. (optional)
19940
+ * @param metadata - Arbitrary key-value metadata defined by you for your own use (e.g. UI copy, feature highlights). Values can be any JSON-serializable value. Shared across all versions of the plan. (optional)
19929
19941
  * @param newPlanId - The new ID to use for the plan. Can only be updated if the plan has not been used by any customers. (optional)
19930
19942
  *
19931
19943
  * @returns The updated plan object.
@@ -20621,6 +20633,7 @@ var Autumn = class extends ClientSDK {
20621
20633
  * @param eventName - Event name to track usage for. Use instead of feature_id when multiple features should be tracked from a single event. (optional)
20622
20634
  * @param value - The amount of usage to record. Defaults to 1. Use negative values to credit balance (e.g., when removing a seat). (optional)
20623
20635
  * @param properties - Additional properties to attach to this usage event. (optional)
20636
+ * @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
20624
20637
  * @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
20625
20638
  *
20626
20639
  * @returns The usage value recorded, with either a single updated balance or a map of updated balances. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 after accepting the event for replay so it can be tracked as soon as the service is restored.
@@ -20662,6 +20675,7 @@ var Autumn = class extends ClientSDK {
20662
20675
  * @param audioOutputTokens - Number of audio output tokens generated. (optional)
20663
20676
  * @param reasoningTokens - Number of reasoning tokens generated. (optional)
20664
20677
  * @param properties - Additional properties to attach to this usage event. (optional)
20678
+ * @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
20665
20679
  * @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
20666
20680
  *
20667
20681
  * @returns The dollar value recorded and the updated AI credit system balance. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 after accepting the token usage event for replay so it can be tracked as soon as the service is restored.
@@ -21501,6 +21515,7 @@ var listPlansListSchema = import_v46.z.object({
21501
21515
  archived: import_v46.z.boolean(),
21502
21516
  baseVariantId: import_v46.z.string().nullable(),
21503
21517
  config: listPlansConfigSchema,
21518
+ metadata: import_v46.z.record(import_v46.z.string(), import_v46.z.any()),
21504
21519
  customerEligibility: import_v46.z.union([listPlansCustomerEligibilitySchema, import_v46.z.undefined()]).optional()
21505
21520
  });
21506
21521
  var listPlansResponseSchema = import_v46.z.object({
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  autumnHandler
3
- } from "../chunk-QA6NTMCY.mjs";
3
+ } from "../chunk-MXD3NPQK.mjs";
4
4
  import "../chunk-WYDGEDEU.mjs";
5
5
  import "../chunk-VXND2UDT.mjs";
6
- import "../chunk-6BIFNQMZ.mjs";
7
- import "../chunk-JMSAO3QS.mjs";
8
- import "../chunk-JD72L3WP.mjs";
6
+ import "../chunk-7MPQ5TCH.mjs";
7
+ import "../chunk-5QIIBIZY.mjs";
8
+ import "../chunk-Z7WSDAEZ.mjs";
9
9
  import "../chunk-MOHYGUMA.mjs";
10
10
  import "../chunk-TBQ27LIK.mjs";
11
11
  import "../chunk-J44WR3QZ.mjs";
12
12
  import "../chunk-TSF4YCUO.mjs";
13
13
  import "../chunk-UAR3TMWI.mjs";
14
- import "../chunk-N72VCQNK.mjs";
14
+ import "../chunk-UYURZ75E.mjs";
15
15
  import "../chunk-OTXV5FY7.mjs";
16
- import "../chunk-I7CD6EB6.mjs";
17
16
  import "../chunk-VZIMT7AO.mjs";
17
+ import "../chunk-I7CD6EB6.mjs";
18
18
  import "../chunk-N7NFYY54.mjs";
19
19
  export {
20
20
  autumnHandler
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Autumn
3
- } from "./chunk-JD72L3WP.mjs";
3
+ } from "./chunk-Z7WSDAEZ.mjs";
4
4
  import {
5
5
  executeRoute
6
6
  } from "./chunk-MOHYGUMA.mjs";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-UAR3TMWI.mjs";
10
10
  import {
11
11
  routeConfigs
12
- } from "./chunk-N72VCQNK.mjs";
12
+ } from "./chunk-UYURZ75E.mjs";
13
13
  import {
14
14
  secretKeyCheck
15
15
  } from "./chunk-VZIMT7AO.mjs";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  Autumn
3
- } from "./chunk-JD72L3WP.mjs";
3
+ } from "./chunk-Z7WSDAEZ.mjs";
4
4
  import {
5
5
  executeRoute
6
6
  } from "./chunk-MOHYGUMA.mjs";
7
7
  import {
8
8
  routeConfigs
9
- } from "./chunk-N72VCQNK.mjs";
9
+ } from "./chunk-UYURZ75E.mjs";
10
10
  import {
11
11
  secretKeyCheck
12
12
  } from "./chunk-VZIMT7AO.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCoreHandler
3
- } from "./chunk-JMSAO3QS.mjs";
3
+ } from "./chunk-5QIIBIZY.mjs";
4
4
 
5
5
  // src/backend/adapters/express.ts
6
6
  function autumnHandler(options) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCoreHandler
3
- } from "./chunk-JMSAO3QS.mjs";
3
+ } from "./chunk-5QIIBIZY.mjs";
4
4
 
5
5
  // src/backend/adapters/next.ts
6
6
  import { NextResponse } from "next/server";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCoreHandler
3
- } from "./chunk-JMSAO3QS.mjs";
3
+ } from "./chunk-5QIIBIZY.mjs";
4
4
 
5
5
  // src/backend/adapters/fetch.ts
6
6
  function autumnHandler(options) {
@@ -806,6 +806,7 @@ var listPlansListSchema = z6.object({
806
806
  archived: z6.boolean(),
807
807
  baseVariantId: z6.string().nullable(),
808
808
  config: listPlansConfigSchema,
809
+ metadata: z6.record(z6.string(), z6.any()),
809
810
  customerEligibility: z6.union([listPlansCustomerEligibilitySchema, z6.undefined()]).optional()
810
811
  });
811
812
  var listPlansResponseSchema = z6.object({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCoreHandler
3
- } from "./chunk-JMSAO3QS.mjs";
3
+ } from "./chunk-5QIIBIZY.mjs";
4
4
 
5
5
  // src/backend/adapters/hono.ts
6
6
  function autumnHandler(options) {
@@ -2136,6 +2136,7 @@ var RequestBody$outboundSchema = z12.pipe(
2136
2136
  eventName: z12.optional(z12.string()),
2137
2137
  value: z12.optional(z12.number()),
2138
2138
  properties: z12.optional(z12.record(z12.string(), z12.any())),
2139
+ timestamp: z12.optional(z12.int()),
2139
2140
  async: z12.optional(z12.boolean()),
2140
2141
  lock: z12.optional(z12.lazy(() => BatchTrackLock$outboundSchema))
2141
2142
  }),
@@ -4033,6 +4034,7 @@ var Plan$inboundSchema = z17.pipe(
4033
4034
  archived: boolean2(),
4034
4035
  base_variant_id: nullable(string4()),
4035
4036
  config: z17.lazy(() => PlanConfig$inboundSchema),
4037
+ metadata: z17.record(z17.string(), z17.any()),
4036
4038
  customer_eligibility: optional3(z17.lazy(
4037
4039
  () => CustomerEligibility$inboundSchema
4038
4040
  ))
@@ -4919,6 +4921,7 @@ var CreatePlanParams$outboundSchema = z20.pipe(
4919
4921
  items: z20.optional(z20.array(z20.lazy(() => CreatePlanPlanItem$outboundSchema))),
4920
4922
  freeTrial: z20.optional(z20.lazy(() => FreeTrialRequest$outboundSchema)),
4921
4923
  config: z20.optional(z20.lazy(() => CreatePlanConfigRequest$outboundSchema)),
4924
+ metadata: z20.optional(z20.record(z20.string(), z20.any())),
4922
4925
  createInStripe: z20._default(z20.boolean(), true)
4923
4926
  }),
4924
4927
  z20.transform((v) => {
@@ -5158,6 +5161,7 @@ var CreatePlanResponse$inboundSchema = z20.pipe(
5158
5161
  archived: boolean2(),
5159
5162
  base_variant_id: nullable(string4()),
5160
5163
  config: z20.lazy(() => CreatePlanConfigResponse$inboundSchema),
5164
+ metadata: z20.record(z20.string(), z20.any()),
5161
5165
  customer_eligibility: optional3(
5162
5166
  z20.lazy(() => CreatePlanCustomerEligibility$inboundSchema)
5163
5167
  )
@@ -7894,6 +7898,7 @@ var GetPlanResponse$inboundSchema = z35.pipe(
7894
7898
  archived: boolean2(),
7895
7899
  base_variant_id: nullable(string4()),
7896
7900
  config: z35.lazy(() => GetPlanConfig$inboundSchema),
7901
+ metadata: z35.record(z35.string(), z35.any()),
7897
7902
  customer_eligibility: optional3(
7898
7903
  z35.lazy(() => GetPlanCustomerEligibility$inboundSchema)
7899
7904
  )
@@ -9314,6 +9319,7 @@ var ListPlansList$inboundSchema = z42.pipe(
9314
9319
  archived: boolean2(),
9315
9320
  base_variant_id: nullable(string4()),
9316
9321
  config: z42.lazy(() => ListPlansConfig$inboundSchema),
9322
+ metadata: z42.record(z42.string(), z42.any()),
9317
9323
  customer_eligibility: optional3(
9318
9324
  z42.lazy(() => ListPlansCustomerEligibility$inboundSchema)
9319
9325
  )
@@ -12921,6 +12927,7 @@ var TrackParams$outboundSchema = z55.pipe(
12921
12927
  eventName: z55.optional(z55.string()),
12922
12928
  value: z55.optional(z55.number()),
12923
12929
  properties: z55.optional(z55.record(z55.string(), z55.any())),
12930
+ timestamp: z55.optional(z55.int()),
12924
12931
  async: z55.optional(z55.boolean()),
12925
12932
  lock: z55.optional(z55.lazy(() => TrackLock$outboundSchema))
12926
12933
  }),
@@ -13082,6 +13089,7 @@ var TrackTokensParams$outboundSchema = z56.pipe(
13082
13089
  audioOutputTokens: z56.optional(z56.int()),
13083
13090
  reasoningTokens: z56.optional(z56.int()),
13084
13091
  properties: z56.optional(z56.record(z56.string(), z56.any())),
13092
+ timestamp: z56.optional(z56.int()),
13085
13093
  async: z56.optional(z56.boolean())
13086
13094
  }),
13087
13095
  z56.transform((v) => {
@@ -14702,6 +14710,7 @@ var UpdatePlanParams$outboundSchema = z61.pipe(
14702
14710
  z61.nullable(z61.lazy(() => UpdatePlanFreeTrialParams$outboundSchema))
14703
14711
  ),
14704
14712
  config: z61.optional(z61.lazy(() => UpdatePlanConfigRequest$outboundSchema)),
14713
+ metadata: z61.optional(z61.record(z61.string(), z61.any())),
14705
14714
  createInStripe: z61._default(z61.boolean(), true),
14706
14715
  version: z61.optional(z61.number()),
14707
14716
  archived: z61._default(z61.boolean(), false),
@@ -14945,6 +14954,7 @@ var UpdatePlanResponse$inboundSchema = z61.pipe(
14945
14954
  archived: boolean2(),
14946
14955
  base_variant_id: nullable(string4()),
14947
14956
  config: z61.lazy(() => UpdatePlanConfigResponse$inboundSchema),
14957
+ metadata: z61.record(z61.string(), z61.any()),
14948
14958
  customer_eligibility: optional3(
14949
14959
  z61.lazy(() => UpdatePlanCustomerEligibility$inboundSchema)
14950
14960
  )
@@ -17063,7 +17073,7 @@ var Billing = class extends ClientSDK {
17063
17073
  * @example
17064
17074
  * ```typescript
17065
17075
  * // Schedule a transition from a trial plan to a paid plan
17066
- * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1782152693121,"plans":[{"planId":"trial_plan"}]},{"startsAt":1783362293121,"plans":[{"planId":"pro_plan"}]}] });
17076
+ * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1782402442343,"plans":[{"planId":"trial_plan"}]},{"startsAt":1783612042343,"plans":[{"planId":"pro_plan"}]}] });
17067
17077
  * ```
17068
17078
  *
17069
17079
  * @param customerId - The ID of the customer to create the schedule for.
@@ -19764,6 +19774,7 @@ var Plans = class extends ClientSDK {
19764
19774
  * @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
19765
19775
  * @param freeTrial - Free trial configuration. Customers can try this plan before being charged. (optional)
19766
19776
  * @param config - Miscellaneous plan-level configuration flags. (optional)
19777
+ * @param metadata - Arbitrary key-value metadata defined by you for your own use (e.g. UI copy, feature highlights). Values can be any JSON-serializable value. Shared across all versions of the plan. (optional)
19767
19778
  *
19768
19779
  * @returns The created plan object.
19769
19780
  */
@@ -19870,6 +19881,7 @@ var Plans = class extends ClientSDK {
19870
19881
  * @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
19871
19882
  * @param freeTrial - The free trial of the plan. Set to null to remove the free trial. (optional)
19872
19883
  * @param config - Miscellaneous plan-level configuration flags. (optional)
19884
+ * @param metadata - Arbitrary key-value metadata defined by you for your own use (e.g. UI copy, feature highlights). Values can be any JSON-serializable value. Shared across all versions of the plan. (optional)
19873
19885
  * @param newPlanId - The new ID to use for the plan. Can only be updated if the plan has not been used by any customers. (optional)
19874
19886
  *
19875
19887
  * @returns The updated plan object.
@@ -20565,6 +20577,7 @@ var Autumn = class extends ClientSDK {
20565
20577
  * @param eventName - Event name to track usage for. Use instead of feature_id when multiple features should be tracked from a single event. (optional)
20566
20578
  * @param value - The amount of usage to record. Defaults to 1. Use negative values to credit balance (e.g., when removing a seat). (optional)
20567
20579
  * @param properties - Additional properties to attach to this usage event. (optional)
20580
+ * @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
20568
20581
  * @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
20569
20582
  *
20570
20583
  * @returns The usage value recorded, with either a single updated balance or a map of updated balances. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 after accepting the event for replay so it can be tracked as soon as the service is restored.
@@ -20606,6 +20619,7 @@ var Autumn = class extends ClientSDK {
20606
20619
  * @param audioOutputTokens - Number of audio output tokens generated. (optional)
20607
20620
  * @param reasoningTokens - Number of reasoning tokens generated. (optional)
20608
20621
  * @param properties - Additional properties to attach to this usage event. (optional)
20622
+ * @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
20609
20623
  * @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
20610
20624
  *
20611
20625
  * @returns The dollar value recorded and the updated AI credit system balance. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 after accepting the token usage event for replay so it can be tracked as soon as the service is restored.
@@ -1,6 +1,6 @@
1
1
  import { CoreHandlerOptions, UnifiedRequest, UnifiedResponse } from '../types/handlerTypes.mjs';
2
2
  import '../../authTypes-Bx2brfr_.mjs';
3
- import '../../routeTypes-DxmM-KwZ.mjs';
3
+ import '../../routeTypes-DmFnGvb2.mjs';
4
4
  import 'zod/v4';
5
5
  import '../utils/sanitizeBody.mjs';
6
6
  import '../types/responseTypes.mjs';
@@ -1,6 +1,6 @@
1
1
  import { CoreHandlerOptions, UnifiedRequest, UnifiedResponse } from '../types/handlerTypes.js';
2
2
  import '../../authTypes-Bx2brfr_.js';
3
- import '../../routeTypes-DVB8MoV9.js';
3
+ import '../../routeTypes-ChCnBnee.js';
4
4
  import 'zod/v4';
5
5
  import '../utils/sanitizeBody.js';
6
6
  import '../types/responseTypes.js';
@@ -2219,6 +2219,7 @@ var RequestBody$outboundSchema = z12.pipe(
2219
2219
  eventName: z12.optional(z12.string()),
2220
2220
  value: z12.optional(z12.number()),
2221
2221
  properties: z12.optional(z12.record(z12.string(), z12.any())),
2222
+ timestamp: z12.optional(z12.int()),
2222
2223
  async: z12.optional(z12.boolean()),
2223
2224
  lock: z12.optional(z12.lazy(() => BatchTrackLock$outboundSchema))
2224
2225
  }),
@@ -4116,6 +4117,7 @@ var Plan$inboundSchema = z17.pipe(
4116
4117
  archived: boolean2(),
4117
4118
  base_variant_id: nullable(string4()),
4118
4119
  config: z17.lazy(() => PlanConfig$inboundSchema),
4120
+ metadata: z17.record(z17.string(), z17.any()),
4119
4121
  customer_eligibility: optional3(z17.lazy(
4120
4122
  () => CustomerEligibility$inboundSchema
4121
4123
  ))
@@ -5002,6 +5004,7 @@ var CreatePlanParams$outboundSchema = z20.pipe(
5002
5004
  items: z20.optional(z20.array(z20.lazy(() => CreatePlanPlanItem$outboundSchema))),
5003
5005
  freeTrial: z20.optional(z20.lazy(() => FreeTrialRequest$outboundSchema)),
5004
5006
  config: z20.optional(z20.lazy(() => CreatePlanConfigRequest$outboundSchema)),
5007
+ metadata: z20.optional(z20.record(z20.string(), z20.any())),
5005
5008
  createInStripe: z20._default(z20.boolean(), true)
5006
5009
  }),
5007
5010
  z20.transform((v) => {
@@ -5241,6 +5244,7 @@ var CreatePlanResponse$inboundSchema = z20.pipe(
5241
5244
  archived: boolean2(),
5242
5245
  base_variant_id: nullable(string4()),
5243
5246
  config: z20.lazy(() => CreatePlanConfigResponse$inboundSchema),
5247
+ metadata: z20.record(z20.string(), z20.any()),
5244
5248
  customer_eligibility: optional3(
5245
5249
  z20.lazy(() => CreatePlanCustomerEligibility$inboundSchema)
5246
5250
  )
@@ -7977,6 +7981,7 @@ var GetPlanResponse$inboundSchema = z35.pipe(
7977
7981
  archived: boolean2(),
7978
7982
  base_variant_id: nullable(string4()),
7979
7983
  config: z35.lazy(() => GetPlanConfig$inboundSchema),
7984
+ metadata: z35.record(z35.string(), z35.any()),
7980
7985
  customer_eligibility: optional3(
7981
7986
  z35.lazy(() => GetPlanCustomerEligibility$inboundSchema)
7982
7987
  )
@@ -9397,6 +9402,7 @@ var ListPlansList$inboundSchema = z42.pipe(
9397
9402
  archived: boolean2(),
9398
9403
  base_variant_id: nullable(string4()),
9399
9404
  config: z42.lazy(() => ListPlansConfig$inboundSchema),
9405
+ metadata: z42.record(z42.string(), z42.any()),
9400
9406
  customer_eligibility: optional3(
9401
9407
  z42.lazy(() => ListPlansCustomerEligibility$inboundSchema)
9402
9408
  )
@@ -13004,6 +13010,7 @@ var TrackParams$outboundSchema = z55.pipe(
13004
13010
  eventName: z55.optional(z55.string()),
13005
13011
  value: z55.optional(z55.number()),
13006
13012
  properties: z55.optional(z55.record(z55.string(), z55.any())),
13013
+ timestamp: z55.optional(z55.int()),
13007
13014
  async: z55.optional(z55.boolean()),
13008
13015
  lock: z55.optional(z55.lazy(() => TrackLock$outboundSchema))
13009
13016
  }),
@@ -13165,6 +13172,7 @@ var TrackTokensParams$outboundSchema = z56.pipe(
13165
13172
  audioOutputTokens: z56.optional(z56.int()),
13166
13173
  reasoningTokens: z56.optional(z56.int()),
13167
13174
  properties: z56.optional(z56.record(z56.string(), z56.any())),
13175
+ timestamp: z56.optional(z56.int()),
13168
13176
  async: z56.optional(z56.boolean())
13169
13177
  }),
13170
13178
  z56.transform((v) => {
@@ -14785,6 +14793,7 @@ var UpdatePlanParams$outboundSchema = z61.pipe(
14785
14793
  z61.nullable(z61.lazy(() => UpdatePlanFreeTrialParams$outboundSchema))
14786
14794
  ),
14787
14795
  config: z61.optional(z61.lazy(() => UpdatePlanConfigRequest$outboundSchema)),
14796
+ metadata: z61.optional(z61.record(z61.string(), z61.any())),
14788
14797
  createInStripe: z61._default(z61.boolean(), true),
14789
14798
  version: z61.optional(z61.number()),
14790
14799
  archived: z61._default(z61.boolean(), false),
@@ -15028,6 +15037,7 @@ var UpdatePlanResponse$inboundSchema = z61.pipe(
15028
15037
  archived: boolean2(),
15029
15038
  base_variant_id: nullable(string4()),
15030
15039
  config: z61.lazy(() => UpdatePlanConfigResponse$inboundSchema),
15040
+ metadata: z61.record(z61.string(), z61.any()),
15031
15041
  customer_eligibility: optional3(
15032
15042
  z61.lazy(() => UpdatePlanCustomerEligibility$inboundSchema)
15033
15043
  )
@@ -17118,7 +17128,7 @@ var Billing = class extends ClientSDK {
17118
17128
  * @example
17119
17129
  * ```typescript
17120
17130
  * // Schedule a transition from a trial plan to a paid plan
17121
- * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1782152693121,"plans":[{"planId":"trial_plan"}]},{"startsAt":1783362293121,"plans":[{"planId":"pro_plan"}]}] });
17131
+ * const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1782402442343,"plans":[{"planId":"trial_plan"}]},{"startsAt":1783612042343,"plans":[{"planId":"pro_plan"}]}] });
17122
17132
  * ```
17123
17133
  *
17124
17134
  * @param customerId - The ID of the customer to create the schedule for.
@@ -19819,6 +19829,7 @@ var Plans = class extends ClientSDK {
19819
19829
  * @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
19820
19830
  * @param freeTrial - Free trial configuration. Customers can try this plan before being charged. (optional)
19821
19831
  * @param config - Miscellaneous plan-level configuration flags. (optional)
19832
+ * @param metadata - Arbitrary key-value metadata defined by you for your own use (e.g. UI copy, feature highlights). Values can be any JSON-serializable value. Shared across all versions of the plan. (optional)
19822
19833
  *
19823
19834
  * @returns The created plan object.
19824
19835
  */
@@ -19925,6 +19936,7 @@ var Plans = class extends ClientSDK {
19925
19936
  * @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
19926
19937
  * @param freeTrial - The free trial of the plan. Set to null to remove the free trial. (optional)
19927
19938
  * @param config - Miscellaneous plan-level configuration flags. (optional)
19939
+ * @param metadata - Arbitrary key-value metadata defined by you for your own use (e.g. UI copy, feature highlights). Values can be any JSON-serializable value. Shared across all versions of the plan. (optional)
19928
19940
  * @param newPlanId - The new ID to use for the plan. Can only be updated if the plan has not been used by any customers. (optional)
19929
19941
  *
19930
19942
  * @returns The updated plan object.
@@ -20620,6 +20632,7 @@ var Autumn = class extends ClientSDK {
20620
20632
  * @param eventName - Event name to track usage for. Use instead of feature_id when multiple features should be tracked from a single event. (optional)
20621
20633
  * @param value - The amount of usage to record. Defaults to 1. Use negative values to credit balance (e.g., when removing a seat). (optional)
20622
20634
  * @param properties - Additional properties to attach to this usage event. (optional)
20635
+ * @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
20623
20636
  * @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
20624
20637
  *
20625
20638
  * @returns The usage value recorded, with either a single updated balance or a map of updated balances. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 after accepting the event for replay so it can be tracked as soon as the service is restored.
@@ -20661,6 +20674,7 @@ var Autumn = class extends ClientSDK {
20661
20674
  * @param audioOutputTokens - Number of audio output tokens generated. (optional)
20662
20675
  * @param reasoningTokens - Number of reasoning tokens generated. (optional)
20663
20676
  * @param properties - Additional properties to attach to this usage event. (optional)
20677
+ * @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
20664
20678
  * @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
20665
20679
  *
20666
20680
  * @returns The dollar value recorded and the updated AI credit system balance. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 after accepting the token usage event for replay so it can be tracked as soon as the service is restored.
@@ -21500,6 +21514,7 @@ var listPlansListSchema = import_v46.z.object({
21500
21514
  archived: import_v46.z.boolean(),
21501
21515
  baseVariantId: import_v46.z.string().nullable(),
21502
21516
  config: listPlansConfigSchema,
21517
+ metadata: import_v46.z.record(import_v46.z.string(), import_v46.z.any()),
21503
21518
  customerEligibility: import_v46.z.union([listPlansCustomerEligibilitySchema, import_v46.z.undefined()]).optional()
21504
21519
  });
21505
21520
  var listPlansResponseSchema = import_v46.z.object({
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  createCoreHandler
3
- } from "../../chunk-JMSAO3QS.mjs";
4
- import "../../chunk-JD72L3WP.mjs";
3
+ } from "../../chunk-5QIIBIZY.mjs";
4
+ import "../../chunk-Z7WSDAEZ.mjs";
5
5
  import "../../chunk-MOHYGUMA.mjs";
6
6
  import "../../chunk-TBQ27LIK.mjs";
7
7
  import "../../chunk-J44WR3QZ.mjs";
8
8
  import "../../chunk-TSF4YCUO.mjs";
9
9
  import "../../chunk-UAR3TMWI.mjs";
10
- import "../../chunk-N72VCQNK.mjs";
10
+ import "../../chunk-UYURZ75E.mjs";
11
11
  import "../../chunk-OTXV5FY7.mjs";
12
- import "../../chunk-I7CD6EB6.mjs";
13
12
  import "../../chunk-VZIMT7AO.mjs";
13
+ import "../../chunk-I7CD6EB6.mjs";
14
14
  import "../../chunk-N7NFYY54.mjs";
15
15
  export {
16
16
  createCoreHandler
@@ -1,4 +1,4 @@
1
- import { A as Autumn, R as RouteDefinition } from '../../routeTypes-DxmM-KwZ.mjs';
1
+ import { A as Autumn, R as RouteDefinition } from '../../routeTypes-DmFnGvb2.mjs';
2
2
  import { A as AuthResult } from '../../authTypes-Bx2brfr_.mjs';
3
3
  import { BackendResult } from '../types/responseTypes.mjs';
4
4
  import 'zod/v4';
@@ -1,4 +1,4 @@
1
- import { A as Autumn, R as RouteDefinition } from '../../routeTypes-DVB8MoV9.js';
1
+ import { A as Autumn, R as RouteDefinition } from '../../routeTypes-ChCnBnee.js';
2
2
  import { A as AuthResult } from '../../authTypes-Bx2brfr_.js';
3
3
  import { BackendResult } from '../types/responseTypes.js';
4
4
  import 'zod/v4';
@@ -4,8 +4,8 @@ import {
4
4
  import "../../chunk-TBQ27LIK.mjs";
5
5
  import "../../chunk-J44WR3QZ.mjs";
6
6
  import "../../chunk-OTXV5FY7.mjs";
7
- import "../../chunk-I7CD6EB6.mjs";
8
7
  import "../../chunk-VZIMT7AO.mjs";
8
+ import "../../chunk-I7CD6EB6.mjs";
9
9
  import "../../chunk-N7NFYY54.mjs";
10
10
  export {
11
11
  executeRoute