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.
- package/dist/backend/adapters/express.js +16 -1
- package/dist/backend/adapters/express.mjs +6 -6
- package/dist/backend/adapters/fetch.js +16 -1
- package/dist/backend/adapters/fetch.mjs +6 -6
- package/dist/backend/adapters/hono.js +16 -1
- package/dist/backend/adapters/hono.mjs +6 -6
- package/dist/backend/adapters/index.js +16 -1
- package/dist/backend/adapters/index.mjs +9 -9
- package/dist/backend/adapters/next.js +16 -1
- package/dist/backend/adapters/next.mjs +6 -6
- package/dist/backend/{chunk-JMSAO3QS.mjs → chunk-5QIIBIZY.mjs} +2 -2
- package/dist/backend/{chunk-6BIFNQMZ.mjs → chunk-7MPQ5TCH.mjs} +2 -2
- package/dist/backend/{chunk-Z3FKN2NF.mjs → chunk-AYS6GLVO.mjs} +1 -1
- package/dist/backend/{chunk-QA6NTMCY.mjs → chunk-MXD3NPQK.mjs} +1 -1
- package/dist/backend/{chunk-NYLHQ6KR.mjs → chunk-NSAJNDTG.mjs} +1 -1
- package/dist/backend/{chunk-N72VCQNK.mjs → chunk-UYURZ75E.mjs} +1 -0
- package/dist/backend/{chunk-HF6Z42J6.mjs → chunk-W7MG3LB3.mjs} +1 -1
- package/dist/backend/{chunk-JD72L3WP.mjs → chunk-Z7WSDAEZ.mjs} +15 -1
- package/dist/backend/core/handlers/coreHandler.d.mts +1 -1
- package/dist/backend/core/handlers/coreHandler.d.ts +1 -1
- package/dist/backend/core/handlers/coreHandler.js +16 -1
- package/dist/backend/core/handlers/coreHandler.mjs +4 -4
- package/dist/backend/core/handlers/executeRoute.d.mts +1 -1
- package/dist/backend/core/handlers/executeRoute.d.ts +1 -1
- package/dist/backend/core/handlers/executeRoute.mjs +1 -1
- package/dist/backend/core/handlers/handleRouteByName.js +16 -1
- package/dist/backend/core/handlers/handleRouteByName.mjs +4 -4
- package/dist/backend/core/handlers/index.d.mts +1 -1
- package/dist/backend/core/handlers/index.d.ts +1 -1
- package/dist/backend/core/handlers/index.js +16 -1
- package/dist/backend/core/handlers/index.mjs +5 -5
- package/dist/backend/core/index.d.mts +1 -1
- package/dist/backend/core/index.d.ts +1 -1
- package/dist/backend/core/index.js +16 -1
- package/dist/backend/core/index.mjs +7 -7
- package/dist/backend/core/routes/index.d.mts +1 -1
- package/dist/backend/core/routes/index.d.ts +1 -1
- package/dist/backend/core/routes/index.js +1 -0
- package/dist/backend/core/routes/index.mjs +2 -2
- package/dist/backend/core/routes/routeBuilder.d.mts +1 -1
- package/dist/backend/core/routes/routeBuilder.d.ts +1 -1
- package/dist/backend/core/routes/routeConfigs.d.mts +1 -1
- package/dist/backend/core/routes/routeConfigs.d.ts +1 -1
- package/dist/backend/core/routes/routeConfigs.js +1 -0
- package/dist/backend/core/routes/routeConfigs.mjs +2 -2
- package/dist/backend/core/types/handlerTypes.d.mts +1 -1
- package/dist/backend/core/types/handlerTypes.d.ts +1 -1
- package/dist/backend/core/types/index.d.mts +1 -1
- package/dist/backend/core/types/index.d.ts +1 -1
- package/dist/backend/core/types/routeTypes.d.mts +1 -1
- package/dist/backend/core/types/routeTypes.d.ts +1 -1
- package/dist/backend/core/utils/index.mjs +3 -3
- package/dist/backend/index.d.mts +2 -2
- package/dist/backend/index.d.ts +2 -2
- package/dist/backend/index.js +16 -1
- package/dist/backend/index.mjs +7 -7
- package/dist/backend/{routeTypes-DVB8MoV9.d.ts → routeTypes-ChCnBnee.d.ts} +59 -1
- package/dist/backend/{routeTypes-DxmM-KwZ.d.mts → routeTypes-DmFnGvb2.d.mts} +59 -1
- package/dist/better-auth/{chunk-R3YUB555.mjs → chunk-56VTK4JS.mjs} +1 -1
- package/dist/better-auth/{chunk-633AUR7J.mjs → chunk-JBU3OM2O.mjs} +16 -2
- package/dist/better-auth/{chunk-UOQDNCD2.mjs → chunk-ZQA6B5RX.mjs} +1 -0
- package/dist/better-auth/index.js +16 -1
- package/dist/better-auth/index.mjs +3 -3
- package/dist/better-auth/utils/createAutumnEndpoint.js +1 -0
- package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
- package/dist/better-auth/utils/handleBetterAuthRoute.js +16 -1
- package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
- package/dist/better-auth/utils/index.js +16 -1
- package/dist/better-auth/utils/index.mjs +3 -3
- package/dist/react/AutumnContext.d.mts +3 -3
- package/dist/react/AutumnContext.d.ts +3 -3
- package/dist/react/client/AutumnClient.d.mts +3 -3
- package/dist/react/client/AutumnClient.d.ts +3 -3
- package/dist/react/client/IAutumnClient.d.mts +9 -3
- package/dist/react/client/IAutumnClient.d.ts +9 -3
- package/dist/react/client/index.d.mts +3 -3
- package/dist/react/client/index.d.ts +3 -3
- package/dist/react/{customer-DjiQ6w1e.d.mts → customer-B9DcViyn.d.mts} +1 -1
- package/dist/react/{customer-BbU458Gc.d.ts → customer-DbS31iZc.d.ts} +1 -1
- package/dist/react/hooks/index.d.mts +3 -3
- package/dist/react/hooks/index.d.ts +3 -3
- package/dist/react/hooks/internal/check/balanceToAllowed.d.mts +2 -2
- package/dist/react/hooks/internal/check/balanceToAllowed.d.ts +2 -2
- package/dist/react/hooks/internal/check/customerToFeatures.d.mts +2 -2
- package/dist/react/hooks/internal/check/customerToFeatures.d.ts +2 -2
- package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.mts +2 -2
- package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.ts +2 -2
- package/dist/react/hooks/internal/check/getCreditCost.d.mts +2 -2
- package/dist/react/hooks/internal/check/getCreditCost.d.ts +2 -2
- package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +3 -3
- package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +3 -3
- package/dist/react/hooks/internal/useCustomerActions.d.mts +3 -3
- package/dist/react/hooks/internal/useCustomerActions.d.ts +3 -3
- package/dist/react/hooks/useAggregateEvents.d.mts +2 -2
- package/dist/react/hooks/useAggregateEvents.d.ts +2 -2
- package/dist/react/hooks/useCustomer.d.mts +3 -3
- package/dist/react/hooks/useCustomer.d.ts +3 -3
- package/dist/react/hooks/useEntity.d.mts +2 -2
- package/dist/react/hooks/useEntity.d.ts +2 -2
- package/dist/react/hooks/useListEvents.d.mts +2 -2
- package/dist/react/hooks/useListEvents.d.ts +2 -2
- package/dist/react/hooks/useListPlans.d.mts +2 -2
- package/dist/react/hooks/useListPlans.d.ts +2 -2
- package/dist/react/hooks/useReferrals.d.mts +2 -2
- package/dist/react/hooks/useReferrals.d.ts +2 -2
- package/dist/react/index.d.mts +3 -3
- package/dist/react/index.d.ts +3 -3
- package/dist/react/{params-B-8mg8Ze.d.mts → params-B8-s4Q1n.d.ts} +1 -1
- package/dist/react/{params-Dqm7Np9G.d.ts → params-BquS51Ut.d.mts} +1 -1
- package/dist/react/{plan-2RG0aPsm.d.mts → plan-BKltGb1S.d.mts} +6 -0
- package/dist/react/{plan-2RG0aPsm.d.ts → plan-BKltGb1S.d.ts} +6 -0
- package/dist/sdk/index.d.mts +68 -1
- package/dist/sdk/index.d.ts +68 -1
- package/dist/sdk/index.js +15 -1
- package/dist/sdk/index.mjs +15 -1
- package/package.json +1 -1
|
@@ -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":
|
|
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,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
autumnHandler
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-AYS6GLVO.mjs";
|
|
4
4
|
import "../chunk-WYDGEDEU.mjs";
|
|
5
5
|
import "../chunk-VXND2UDT.mjs";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
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-
|
|
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
|
|
@@ -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":
|
|
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,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
autumnHandler
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-NSAJNDTG.mjs";
|
|
4
4
|
import "../chunk-WYDGEDEU.mjs";
|
|
5
5
|
import "../chunk-VXND2UDT.mjs";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
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-
|
|
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
|
|
@@ -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":
|
|
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,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
autumnHandler
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-W7MG3LB3.mjs";
|
|
4
4
|
import "../chunk-WYDGEDEU.mjs";
|
|
5
5
|
import "../chunk-VXND2UDT.mjs";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
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-
|
|
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
|
|
@@ -2222,6 +2222,7 @@ var RequestBody$outboundSchema = z12.pipe(
|
|
|
2222
2222
|
eventName: z12.optional(z12.string()),
|
|
2223
2223
|
value: z12.optional(z12.number()),
|
|
2224
2224
|
properties: z12.optional(z12.record(z12.string(), z12.any())),
|
|
2225
|
+
timestamp: z12.optional(z12.int()),
|
|
2225
2226
|
async: z12.optional(z12.boolean()),
|
|
2226
2227
|
lock: z12.optional(z12.lazy(() => BatchTrackLock$outboundSchema))
|
|
2227
2228
|
}),
|
|
@@ -4119,6 +4120,7 @@ var Plan$inboundSchema = z17.pipe(
|
|
|
4119
4120
|
archived: boolean2(),
|
|
4120
4121
|
base_variant_id: nullable(string4()),
|
|
4121
4122
|
config: z17.lazy(() => PlanConfig$inboundSchema),
|
|
4123
|
+
metadata: z17.record(z17.string(), z17.any()),
|
|
4122
4124
|
customer_eligibility: optional3(z17.lazy(
|
|
4123
4125
|
() => CustomerEligibility$inboundSchema
|
|
4124
4126
|
))
|
|
@@ -5005,6 +5007,7 @@ var CreatePlanParams$outboundSchema = z20.pipe(
|
|
|
5005
5007
|
items: z20.optional(z20.array(z20.lazy(() => CreatePlanPlanItem$outboundSchema))),
|
|
5006
5008
|
freeTrial: z20.optional(z20.lazy(() => FreeTrialRequest$outboundSchema)),
|
|
5007
5009
|
config: z20.optional(z20.lazy(() => CreatePlanConfigRequest$outboundSchema)),
|
|
5010
|
+
metadata: z20.optional(z20.record(z20.string(), z20.any())),
|
|
5008
5011
|
createInStripe: z20._default(z20.boolean(), true)
|
|
5009
5012
|
}),
|
|
5010
5013
|
z20.transform((v) => {
|
|
@@ -5244,6 +5247,7 @@ var CreatePlanResponse$inboundSchema = z20.pipe(
|
|
|
5244
5247
|
archived: boolean2(),
|
|
5245
5248
|
base_variant_id: nullable(string4()),
|
|
5246
5249
|
config: z20.lazy(() => CreatePlanConfigResponse$inboundSchema),
|
|
5250
|
+
metadata: z20.record(z20.string(), z20.any()),
|
|
5247
5251
|
customer_eligibility: optional3(
|
|
5248
5252
|
z20.lazy(() => CreatePlanCustomerEligibility$inboundSchema)
|
|
5249
5253
|
)
|
|
@@ -7980,6 +7984,7 @@ var GetPlanResponse$inboundSchema = z35.pipe(
|
|
|
7980
7984
|
archived: boolean2(),
|
|
7981
7985
|
base_variant_id: nullable(string4()),
|
|
7982
7986
|
config: z35.lazy(() => GetPlanConfig$inboundSchema),
|
|
7987
|
+
metadata: z35.record(z35.string(), z35.any()),
|
|
7983
7988
|
customer_eligibility: optional3(
|
|
7984
7989
|
z35.lazy(() => GetPlanCustomerEligibility$inboundSchema)
|
|
7985
7990
|
)
|
|
@@ -9400,6 +9405,7 @@ var ListPlansList$inboundSchema = z42.pipe(
|
|
|
9400
9405
|
archived: boolean2(),
|
|
9401
9406
|
base_variant_id: nullable(string4()),
|
|
9402
9407
|
config: z42.lazy(() => ListPlansConfig$inboundSchema),
|
|
9408
|
+
metadata: z42.record(z42.string(), z42.any()),
|
|
9403
9409
|
customer_eligibility: optional3(
|
|
9404
9410
|
z42.lazy(() => ListPlansCustomerEligibility$inboundSchema)
|
|
9405
9411
|
)
|
|
@@ -13007,6 +13013,7 @@ var TrackParams$outboundSchema = z55.pipe(
|
|
|
13007
13013
|
eventName: z55.optional(z55.string()),
|
|
13008
13014
|
value: z55.optional(z55.number()),
|
|
13009
13015
|
properties: z55.optional(z55.record(z55.string(), z55.any())),
|
|
13016
|
+
timestamp: z55.optional(z55.int()),
|
|
13010
13017
|
async: z55.optional(z55.boolean()),
|
|
13011
13018
|
lock: z55.optional(z55.lazy(() => TrackLock$outboundSchema))
|
|
13012
13019
|
}),
|
|
@@ -13168,6 +13175,7 @@ var TrackTokensParams$outboundSchema = z56.pipe(
|
|
|
13168
13175
|
audioOutputTokens: z56.optional(z56.int()),
|
|
13169
13176
|
reasoningTokens: z56.optional(z56.int()),
|
|
13170
13177
|
properties: z56.optional(z56.record(z56.string(), z56.any())),
|
|
13178
|
+
timestamp: z56.optional(z56.int()),
|
|
13171
13179
|
async: z56.optional(z56.boolean())
|
|
13172
13180
|
}),
|
|
13173
13181
|
z56.transform((v) => {
|
|
@@ -14788,6 +14796,7 @@ var UpdatePlanParams$outboundSchema = z61.pipe(
|
|
|
14788
14796
|
z61.nullable(z61.lazy(() => UpdatePlanFreeTrialParams$outboundSchema))
|
|
14789
14797
|
),
|
|
14790
14798
|
config: z61.optional(z61.lazy(() => UpdatePlanConfigRequest$outboundSchema)),
|
|
14799
|
+
metadata: z61.optional(z61.record(z61.string(), z61.any())),
|
|
14791
14800
|
createInStripe: z61._default(z61.boolean(), true),
|
|
14792
14801
|
version: z61.optional(z61.number()),
|
|
14793
14802
|
archived: z61._default(z61.boolean(), false),
|
|
@@ -15031,6 +15040,7 @@ var UpdatePlanResponse$inboundSchema = z61.pipe(
|
|
|
15031
15040
|
archived: boolean2(),
|
|
15032
15041
|
base_variant_id: nullable(string4()),
|
|
15033
15042
|
config: z61.lazy(() => UpdatePlanConfigResponse$inboundSchema),
|
|
15043
|
+
metadata: z61.record(z61.string(), z61.any()),
|
|
15034
15044
|
customer_eligibility: optional3(
|
|
15035
15045
|
z61.lazy(() => UpdatePlanCustomerEligibility$inboundSchema)
|
|
15036
15046
|
)
|
|
@@ -17121,7 +17131,7 @@ var Billing = class extends ClientSDK {
|
|
|
17121
17131
|
* @example
|
|
17122
17132
|
* ```typescript
|
|
17123
17133
|
* // Schedule a transition from a trial plan to a paid plan
|
|
17124
|
-
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":
|
|
17134
|
+
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1782402442343,"plans":[{"planId":"trial_plan"}]},{"startsAt":1783612042343,"plans":[{"planId":"pro_plan"}]}] });
|
|
17125
17135
|
* ```
|
|
17126
17136
|
*
|
|
17127
17137
|
* @param customerId - The ID of the customer to create the schedule for.
|
|
@@ -19822,6 +19832,7 @@ var Plans = class extends ClientSDK {
|
|
|
19822
19832
|
* @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
|
|
19823
19833
|
* @param freeTrial - Free trial configuration. Customers can try this plan before being charged. (optional)
|
|
19824
19834
|
* @param config - Miscellaneous plan-level configuration flags. (optional)
|
|
19835
|
+
* @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)
|
|
19825
19836
|
*
|
|
19826
19837
|
* @returns The created plan object.
|
|
19827
19838
|
*/
|
|
@@ -19928,6 +19939,7 @@ var Plans = class extends ClientSDK {
|
|
|
19928
19939
|
* @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
|
|
19929
19940
|
* @param freeTrial - The free trial of the plan. Set to null to remove the free trial. (optional)
|
|
19930
19941
|
* @param config - Miscellaneous plan-level configuration flags. (optional)
|
|
19942
|
+
* @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)
|
|
19931
19943
|
* @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)
|
|
19932
19944
|
*
|
|
19933
19945
|
* @returns The updated plan object.
|
|
@@ -20623,6 +20635,7 @@ var Autumn = class extends ClientSDK {
|
|
|
20623
20635
|
* @param eventName - Event name to track usage for. Use instead of feature_id when multiple features should be tracked from a single event. (optional)
|
|
20624
20636
|
* @param value - The amount of usage to record. Defaults to 1. Use negative values to credit balance (e.g., when removing a seat). (optional)
|
|
20625
20637
|
* @param properties - Additional properties to attach to this usage event. (optional)
|
|
20638
|
+
* @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
|
|
20626
20639
|
* @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
|
|
20627
20640
|
*
|
|
20628
20641
|
* @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.
|
|
@@ -20664,6 +20677,7 @@ var Autumn = class extends ClientSDK {
|
|
|
20664
20677
|
* @param audioOutputTokens - Number of audio output tokens generated. (optional)
|
|
20665
20678
|
* @param reasoningTokens - Number of reasoning tokens generated. (optional)
|
|
20666
20679
|
* @param properties - Additional properties to attach to this usage event. (optional)
|
|
20680
|
+
* @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
|
|
20667
20681
|
* @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
|
|
20668
20682
|
*
|
|
20669
20683
|
* @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.
|
|
@@ -21503,6 +21517,7 @@ var listPlansListSchema = import_v46.z.object({
|
|
|
21503
21517
|
archived: import_v46.z.boolean(),
|
|
21504
21518
|
baseVariantId: import_v46.z.string().nullable(),
|
|
21505
21519
|
config: listPlansConfigSchema,
|
|
21520
|
+
metadata: import_v46.z.record(import_v46.z.string(), import_v46.z.any()),
|
|
21506
21521
|
customerEligibility: import_v46.z.union([listPlansCustomerEligibilitySchema, import_v46.z.undefined()]).optional()
|
|
21507
21522
|
});
|
|
21508
21523
|
var listPlansResponseSchema = import_v46.z.object({
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
autumnHandler
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-AYS6GLVO.mjs";
|
|
4
4
|
import {
|
|
5
5
|
autumnHandler as autumnHandler2
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-NSAJNDTG.mjs";
|
|
7
7
|
import {
|
|
8
8
|
autumnHandler as autumnHandler3
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-W7MG3LB3.mjs";
|
|
10
10
|
import {
|
|
11
11
|
autumnHandler as autumnHandler4
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-MXD3NPQK.mjs";
|
|
13
13
|
import "../chunk-WYDGEDEU.mjs";
|
|
14
14
|
import "../chunk-VXND2UDT.mjs";
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-7MPQ5TCH.mjs";
|
|
16
|
+
import "../chunk-5QIIBIZY.mjs";
|
|
17
|
+
import "../chunk-Z7WSDAEZ.mjs";
|
|
18
18
|
import "../chunk-MOHYGUMA.mjs";
|
|
19
19
|
import "../chunk-TBQ27LIK.mjs";
|
|
20
20
|
import "../chunk-J44WR3QZ.mjs";
|
|
21
21
|
import "../chunk-TSF4YCUO.mjs";
|
|
22
22
|
import "../chunk-UAR3TMWI.mjs";
|
|
23
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-UYURZ75E.mjs";
|
|
24
24
|
import "../chunk-OTXV5FY7.mjs";
|
|
25
|
-
import "../chunk-I7CD6EB6.mjs";
|
|
26
25
|
import "../chunk-VZIMT7AO.mjs";
|
|
26
|
+
import "../chunk-I7CD6EB6.mjs";
|
|
27
27
|
import "../chunk-N7NFYY54.mjs";
|
|
28
28
|
export {
|
|
29
29
|
autumnHandler as expressAutumnHandler,
|