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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as CustomHandlerArgs, a as CustomHandlerFn, c as ROUTE_NAMES, R as RouteDefinition, b as RouteName } from '../../routeTypes-
|
|
1
|
+
export { C as CustomHandlerArgs, a as CustomHandlerFn, c as ROUTE_NAMES, R as RouteDefinition, b as RouteName } from '../../routeTypes-ChCnBnee.js';
|
|
2
2
|
import 'zod/v4';
|
|
3
3
|
import '../utils/sanitizeBody.js';
|
|
4
4
|
import '../../authTypes-Bx2brfr_.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "../../chunk-OTXV5FY7.mjs";
|
|
2
|
+
import {
|
|
3
|
+
secretKeyCheck
|
|
4
|
+
} from "../../chunk-VZIMT7AO.mjs";
|
|
2
5
|
import {
|
|
3
6
|
CUSTOMER_PROTECTED_BODY_FIELDS,
|
|
4
7
|
DEFAULT_PROTECTED_BODY_FIELDS,
|
|
5
8
|
sanitizeBody
|
|
6
9
|
} from "../../chunk-I7CD6EB6.mjs";
|
|
7
|
-
import {
|
|
8
|
-
secretKeyCheck
|
|
9
|
-
} from "../../chunk-VZIMT7AO.mjs";
|
|
10
10
|
import {
|
|
11
11
|
backendError,
|
|
12
12
|
backendSuccess,
|
package/dist/backend/index.d.mts
CHANGED
|
@@ -3,8 +3,8 @@ import { C as CustomerData } from './authTypes-Bx2brfr_.mjs';
|
|
|
3
3
|
export { A as AuthResult, a as CustomerId, R as ResolvedIdentity } from './authTypes-Bx2brfr_.mjs';
|
|
4
4
|
export { CoreHandlerOptions, UnifiedRequest, UnifiedResponse } from './core/types/handlerTypes.mjs';
|
|
5
5
|
export { BackendErrorBody, BackendResult } from './core/types/responseTypes.mjs';
|
|
6
|
-
import { R as RouteDefinition } from './routeTypes-
|
|
7
|
-
export { C as CustomHandlerArgs, a as CustomHandlerFn } from './routeTypes-
|
|
6
|
+
import { R as RouteDefinition } from './routeTypes-DmFnGvb2.mjs';
|
|
7
|
+
export { C as CustomHandlerArgs, a as CustomHandlerFn } from './routeTypes-DmFnGvb2.mjs';
|
|
8
8
|
export { buildRouter } from './core/routes/routeBuilder.mjs';
|
|
9
9
|
export { routeConfigs } from './core/routes/routeConfigs.mjs';
|
|
10
10
|
export { secretKeyCheck } from './core/utils/secretKeyCheck.mjs';
|
package/dist/backend/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { C as CustomerData } from './authTypes-Bx2brfr_.js';
|
|
|
3
3
|
export { A as AuthResult, a as CustomerId, R as ResolvedIdentity } from './authTypes-Bx2brfr_.js';
|
|
4
4
|
export { CoreHandlerOptions, UnifiedRequest, UnifiedResponse } from './core/types/handlerTypes.js';
|
|
5
5
|
export { BackendErrorBody, BackendResult } from './core/types/responseTypes.js';
|
|
6
|
-
import { R as RouteDefinition } from './routeTypes-
|
|
7
|
-
export { C as CustomHandlerArgs, a as CustomHandlerFn } from './routeTypes-
|
|
6
|
+
import { R as RouteDefinition } from './routeTypes-ChCnBnee.js';
|
|
7
|
+
export { C as CustomHandlerArgs, a as CustomHandlerFn } from './routeTypes-ChCnBnee.js';
|
|
8
8
|
export { buildRouter } from './core/routes/routeBuilder.js';
|
|
9
9
|
export { routeConfigs } from './core/routes/routeConfigs.js';
|
|
10
10
|
export { secretKeyCheck } from './core/utils/secretKeyCheck.js';
|
package/dist/backend/index.js
CHANGED
|
@@ -2227,6 +2227,7 @@ var RequestBody$outboundSchema = z12.pipe(
|
|
|
2227
2227
|
eventName: z12.optional(z12.string()),
|
|
2228
2228
|
value: z12.optional(z12.number()),
|
|
2229
2229
|
properties: z12.optional(z12.record(z12.string(), z12.any())),
|
|
2230
|
+
timestamp: z12.optional(z12.int()),
|
|
2230
2231
|
async: z12.optional(z12.boolean()),
|
|
2231
2232
|
lock: z12.optional(z12.lazy(() => BatchTrackLock$outboundSchema))
|
|
2232
2233
|
}),
|
|
@@ -4124,6 +4125,7 @@ var Plan$inboundSchema = z17.pipe(
|
|
|
4124
4125
|
archived: boolean2(),
|
|
4125
4126
|
base_variant_id: nullable(string4()),
|
|
4126
4127
|
config: z17.lazy(() => PlanConfig$inboundSchema),
|
|
4128
|
+
metadata: z17.record(z17.string(), z17.any()),
|
|
4127
4129
|
customer_eligibility: optional3(z17.lazy(
|
|
4128
4130
|
() => CustomerEligibility$inboundSchema
|
|
4129
4131
|
))
|
|
@@ -5010,6 +5012,7 @@ var CreatePlanParams$outboundSchema = z20.pipe(
|
|
|
5010
5012
|
items: z20.optional(z20.array(z20.lazy(() => CreatePlanPlanItem$outboundSchema))),
|
|
5011
5013
|
freeTrial: z20.optional(z20.lazy(() => FreeTrialRequest$outboundSchema)),
|
|
5012
5014
|
config: z20.optional(z20.lazy(() => CreatePlanConfigRequest$outboundSchema)),
|
|
5015
|
+
metadata: z20.optional(z20.record(z20.string(), z20.any())),
|
|
5013
5016
|
createInStripe: z20._default(z20.boolean(), true)
|
|
5014
5017
|
}),
|
|
5015
5018
|
z20.transform((v) => {
|
|
@@ -5249,6 +5252,7 @@ var CreatePlanResponse$inboundSchema = z20.pipe(
|
|
|
5249
5252
|
archived: boolean2(),
|
|
5250
5253
|
base_variant_id: nullable(string4()),
|
|
5251
5254
|
config: z20.lazy(() => CreatePlanConfigResponse$inboundSchema),
|
|
5255
|
+
metadata: z20.record(z20.string(), z20.any()),
|
|
5252
5256
|
customer_eligibility: optional3(
|
|
5253
5257
|
z20.lazy(() => CreatePlanCustomerEligibility$inboundSchema)
|
|
5254
5258
|
)
|
|
@@ -7985,6 +7989,7 @@ var GetPlanResponse$inboundSchema = z35.pipe(
|
|
|
7985
7989
|
archived: boolean2(),
|
|
7986
7990
|
base_variant_id: nullable(string4()),
|
|
7987
7991
|
config: z35.lazy(() => GetPlanConfig$inboundSchema),
|
|
7992
|
+
metadata: z35.record(z35.string(), z35.any()),
|
|
7988
7993
|
customer_eligibility: optional3(
|
|
7989
7994
|
z35.lazy(() => GetPlanCustomerEligibility$inboundSchema)
|
|
7990
7995
|
)
|
|
@@ -9405,6 +9410,7 @@ var ListPlansList$inboundSchema = z42.pipe(
|
|
|
9405
9410
|
archived: boolean2(),
|
|
9406
9411
|
base_variant_id: nullable(string4()),
|
|
9407
9412
|
config: z42.lazy(() => ListPlansConfig$inboundSchema),
|
|
9413
|
+
metadata: z42.record(z42.string(), z42.any()),
|
|
9408
9414
|
customer_eligibility: optional3(
|
|
9409
9415
|
z42.lazy(() => ListPlansCustomerEligibility$inboundSchema)
|
|
9410
9416
|
)
|
|
@@ -13012,6 +13018,7 @@ var TrackParams$outboundSchema = z55.pipe(
|
|
|
13012
13018
|
eventName: z55.optional(z55.string()),
|
|
13013
13019
|
value: z55.optional(z55.number()),
|
|
13014
13020
|
properties: z55.optional(z55.record(z55.string(), z55.any())),
|
|
13021
|
+
timestamp: z55.optional(z55.int()),
|
|
13015
13022
|
async: z55.optional(z55.boolean()),
|
|
13016
13023
|
lock: z55.optional(z55.lazy(() => TrackLock$outboundSchema))
|
|
13017
13024
|
}),
|
|
@@ -13173,6 +13180,7 @@ var TrackTokensParams$outboundSchema = z56.pipe(
|
|
|
13173
13180
|
audioOutputTokens: z56.optional(z56.int()),
|
|
13174
13181
|
reasoningTokens: z56.optional(z56.int()),
|
|
13175
13182
|
properties: z56.optional(z56.record(z56.string(), z56.any())),
|
|
13183
|
+
timestamp: z56.optional(z56.int()),
|
|
13176
13184
|
async: z56.optional(z56.boolean())
|
|
13177
13185
|
}),
|
|
13178
13186
|
z56.transform((v) => {
|
|
@@ -14793,6 +14801,7 @@ var UpdatePlanParams$outboundSchema = z61.pipe(
|
|
|
14793
14801
|
z61.nullable(z61.lazy(() => UpdatePlanFreeTrialParams$outboundSchema))
|
|
14794
14802
|
),
|
|
14795
14803
|
config: z61.optional(z61.lazy(() => UpdatePlanConfigRequest$outboundSchema)),
|
|
14804
|
+
metadata: z61.optional(z61.record(z61.string(), z61.any())),
|
|
14796
14805
|
createInStripe: z61._default(z61.boolean(), true),
|
|
14797
14806
|
version: z61.optional(z61.number()),
|
|
14798
14807
|
archived: z61._default(z61.boolean(), false),
|
|
@@ -15036,6 +15045,7 @@ var UpdatePlanResponse$inboundSchema = z61.pipe(
|
|
|
15036
15045
|
archived: boolean2(),
|
|
15037
15046
|
base_variant_id: nullable(string4()),
|
|
15038
15047
|
config: z61.lazy(() => UpdatePlanConfigResponse$inboundSchema),
|
|
15048
|
+
metadata: z61.record(z61.string(), z61.any()),
|
|
15039
15049
|
customer_eligibility: optional3(
|
|
15040
15050
|
z61.lazy(() => UpdatePlanCustomerEligibility$inboundSchema)
|
|
15041
15051
|
)
|
|
@@ -17126,7 +17136,7 @@ var Billing = class extends ClientSDK {
|
|
|
17126
17136
|
* @example
|
|
17127
17137
|
* ```typescript
|
|
17128
17138
|
* // Schedule a transition from a trial plan to a paid plan
|
|
17129
|
-
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":
|
|
17139
|
+
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1782402442343,"plans":[{"planId":"trial_plan"}]},{"startsAt":1783612042343,"plans":[{"planId":"pro_plan"}]}] });
|
|
17130
17140
|
* ```
|
|
17131
17141
|
*
|
|
17132
17142
|
* @param customerId - The ID of the customer to create the schedule for.
|
|
@@ -19827,6 +19837,7 @@ var Plans = class extends ClientSDK {
|
|
|
19827
19837
|
* @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
|
|
19828
19838
|
* @param freeTrial - Free trial configuration. Customers can try this plan before being charged. (optional)
|
|
19829
19839
|
* @param config - Miscellaneous plan-level configuration flags. (optional)
|
|
19840
|
+
* @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)
|
|
19830
19841
|
*
|
|
19831
19842
|
* @returns The created plan object.
|
|
19832
19843
|
*/
|
|
@@ -19933,6 +19944,7 @@ var Plans = class extends ClientSDK {
|
|
|
19933
19944
|
* @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
|
|
19934
19945
|
* @param freeTrial - The free trial of the plan. Set to null to remove the free trial. (optional)
|
|
19935
19946
|
* @param config - Miscellaneous plan-level configuration flags. (optional)
|
|
19947
|
+
* @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)
|
|
19936
19948
|
* @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)
|
|
19937
19949
|
*
|
|
19938
19950
|
* @returns The updated plan object.
|
|
@@ -20628,6 +20640,7 @@ var Autumn = class extends ClientSDK {
|
|
|
20628
20640
|
* @param eventName - Event name to track usage for. Use instead of feature_id when multiple features should be tracked from a single event. (optional)
|
|
20629
20641
|
* @param value - The amount of usage to record. Defaults to 1. Use negative values to credit balance (e.g., when removing a seat). (optional)
|
|
20630
20642
|
* @param properties - Additional properties to attach to this usage event. (optional)
|
|
20643
|
+
* @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
|
|
20631
20644
|
* @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
|
|
20632
20645
|
*
|
|
20633
20646
|
* @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.
|
|
@@ -20669,6 +20682,7 @@ var Autumn = class extends ClientSDK {
|
|
|
20669
20682
|
* @param audioOutputTokens - Number of audio output tokens generated. (optional)
|
|
20670
20683
|
* @param reasoningTokens - Number of reasoning tokens generated. (optional)
|
|
20671
20684
|
* @param properties - Additional properties to attach to this usage event. (optional)
|
|
20685
|
+
* @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
|
|
20672
20686
|
* @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
|
|
20673
20687
|
*
|
|
20674
20688
|
* @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.
|
|
@@ -21508,6 +21522,7 @@ var listPlansListSchema = import_v46.z.object({
|
|
|
21508
21522
|
archived: import_v46.z.boolean(),
|
|
21509
21523
|
baseVariantId: import_v46.z.string().nullable(),
|
|
21510
21524
|
config: listPlansConfigSchema,
|
|
21525
|
+
metadata: import_v46.z.record(import_v46.z.string(), import_v46.z.any()),
|
|
21511
21526
|
customerEligibility: import_v46.z.union([listPlansCustomerEligibilitySchema, import_v46.z.undefined()]).optional()
|
|
21512
21527
|
});
|
|
21513
21528
|
var listPlansResponseSchema = import_v46.z.object({
|
package/dist/backend/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./chunk-WYDGEDEU.mjs";
|
|
2
2
|
import "./chunk-VXND2UDT.mjs";
|
|
3
|
-
import "./chunk-
|
|
3
|
+
import "./chunk-7MPQ5TCH.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createCoreHandler
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-5QIIBIZY.mjs";
|
|
7
|
+
import "./chunk-Z7WSDAEZ.mjs";
|
|
8
8
|
import "./chunk-MOHYGUMA.mjs";
|
|
9
9
|
import "./chunk-TBQ27LIK.mjs";
|
|
10
10
|
import "./chunk-J44WR3QZ.mjs";
|
|
@@ -14,14 +14,14 @@ import {
|
|
|
14
14
|
} from "./chunk-UAR3TMWI.mjs";
|
|
15
15
|
import {
|
|
16
16
|
routeConfigs
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UYURZ75E.mjs";
|
|
18
18
|
import "./chunk-OTXV5FY7.mjs";
|
|
19
|
-
import {
|
|
20
|
-
sanitizeBody
|
|
21
|
-
} from "./chunk-I7CD6EB6.mjs";
|
|
22
19
|
import {
|
|
23
20
|
secretKeyCheck
|
|
24
21
|
} from "./chunk-VZIMT7AO.mjs";
|
|
22
|
+
import {
|
|
23
|
+
sanitizeBody
|
|
24
|
+
} from "./chunk-I7CD6EB6.mjs";
|
|
25
25
|
import {
|
|
26
26
|
backendError,
|
|
27
27
|
backendSuccess,
|
|
@@ -1443,6 +1443,10 @@ type RequestBody = {
|
|
|
1443
1443
|
properties?: {
|
|
1444
1444
|
[k: string]: any;
|
|
1445
1445
|
} | undefined;
|
|
1446
|
+
/**
|
|
1447
|
+
* Unix timestamp in milliseconds to use for the usage event. Defaults to the current time.
|
|
1448
|
+
*/
|
|
1449
|
+
timestamp?: number | undefined;
|
|
1446
1450
|
/**
|
|
1447
1451
|
* If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
|
|
1448
1452
|
*/
|
|
@@ -4079,6 +4083,12 @@ type Plan = {
|
|
|
4079
4083
|
* Miscellaneous plan-level configuration flags.
|
|
4080
4084
|
*/
|
|
4081
4085
|
config: PlanConfig;
|
|
4086
|
+
/**
|
|
4087
|
+
* Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
|
|
4088
|
+
*/
|
|
4089
|
+
metadata: {
|
|
4090
|
+
[k: string]: any;
|
|
4091
|
+
};
|
|
4082
4092
|
customerEligibility?: CustomerEligibility | undefined;
|
|
4083
4093
|
};
|
|
4084
4094
|
|
|
@@ -5167,6 +5177,12 @@ type CreatePlanParams = {
|
|
|
5167
5177
|
* Miscellaneous plan-level configuration flags.
|
|
5168
5178
|
*/
|
|
5169
5179
|
config?: CreatePlanConfigRequest | undefined;
|
|
5180
|
+
/**
|
|
5181
|
+
* 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.
|
|
5182
|
+
*/
|
|
5183
|
+
metadata?: {
|
|
5184
|
+
[k: string]: any;
|
|
5185
|
+
} | undefined;
|
|
5170
5186
|
createInStripe?: boolean | undefined;
|
|
5171
5187
|
};
|
|
5172
5188
|
/**
|
|
@@ -5622,6 +5638,12 @@ type CreatePlanResponse = {
|
|
|
5622
5638
|
* Miscellaneous plan-level configuration flags.
|
|
5623
5639
|
*/
|
|
5624
5640
|
config: CreatePlanConfigResponse;
|
|
5641
|
+
/**
|
|
5642
|
+
* Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
|
|
5643
|
+
*/
|
|
5644
|
+
metadata: {
|
|
5645
|
+
[k: string]: any;
|
|
5646
|
+
};
|
|
5625
5647
|
customerEligibility?: CreatePlanCustomerEligibility | undefined;
|
|
5626
5648
|
};
|
|
5627
5649
|
|
|
@@ -9205,6 +9227,12 @@ type GetPlanResponse = {
|
|
|
9205
9227
|
* Miscellaneous plan-level configuration flags.
|
|
9206
9228
|
*/
|
|
9207
9229
|
config: GetPlanConfig;
|
|
9230
|
+
/**
|
|
9231
|
+
* Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
|
|
9232
|
+
*/
|
|
9233
|
+
metadata: {
|
|
9234
|
+
[k: string]: any;
|
|
9235
|
+
};
|
|
9208
9236
|
customerEligibility?: GetPlanCustomerEligibility | undefined;
|
|
9209
9237
|
};
|
|
9210
9238
|
|
|
@@ -11165,6 +11193,12 @@ type ListPlansList = {
|
|
|
11165
11193
|
* Miscellaneous plan-level configuration flags.
|
|
11166
11194
|
*/
|
|
11167
11195
|
config: ListPlansConfig;
|
|
11196
|
+
/**
|
|
11197
|
+
* Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
|
|
11198
|
+
*/
|
|
11199
|
+
metadata: {
|
|
11200
|
+
[k: string]: any;
|
|
11201
|
+
};
|
|
11168
11202
|
customerEligibility?: ListPlansCustomerEligibility | undefined;
|
|
11169
11203
|
};
|
|
11170
11204
|
/**
|
|
@@ -15976,6 +16010,10 @@ type TrackParams = {
|
|
|
15976
16010
|
properties?: {
|
|
15977
16011
|
[k: string]: any;
|
|
15978
16012
|
} | undefined;
|
|
16013
|
+
/**
|
|
16014
|
+
* Unix timestamp in milliseconds to use for the usage event. Defaults to the current time.
|
|
16015
|
+
*/
|
|
16016
|
+
timestamp?: number | undefined;
|
|
15979
16017
|
/**
|
|
15980
16018
|
* If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
|
|
15981
16019
|
*/
|
|
@@ -16201,6 +16239,10 @@ type TrackTokensParams = {
|
|
|
16201
16239
|
properties?: {
|
|
16202
16240
|
[k: string]: any;
|
|
16203
16241
|
} | undefined;
|
|
16242
|
+
/**
|
|
16243
|
+
* Unix timestamp in milliseconds to use for the usage event. Defaults to the current time.
|
|
16244
|
+
*/
|
|
16245
|
+
timestamp?: number | undefined;
|
|
16204
16246
|
/**
|
|
16205
16247
|
* If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
|
|
16206
16248
|
*/
|
|
@@ -18314,6 +18356,12 @@ type UpdatePlanParams = {
|
|
|
18314
18356
|
* Miscellaneous plan-level configuration flags.
|
|
18315
18357
|
*/
|
|
18316
18358
|
config?: UpdatePlanConfigRequest | undefined;
|
|
18359
|
+
/**
|
|
18360
|
+
* 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.
|
|
18361
|
+
*/
|
|
18362
|
+
metadata?: {
|
|
18363
|
+
[k: string]: any;
|
|
18364
|
+
} | undefined;
|
|
18317
18365
|
createInStripe?: boolean | undefined;
|
|
18318
18366
|
version?: number | undefined;
|
|
18319
18367
|
archived?: boolean | undefined;
|
|
@@ -18776,6 +18824,12 @@ type UpdatePlanResponse = {
|
|
|
18776
18824
|
* Miscellaneous plan-level configuration flags.
|
|
18777
18825
|
*/
|
|
18778
18826
|
config: UpdatePlanConfigResponse;
|
|
18827
|
+
/**
|
|
18828
|
+
* Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
|
|
18829
|
+
*/
|
|
18830
|
+
metadata: {
|
|
18831
|
+
[k: string]: any;
|
|
18832
|
+
};
|
|
18779
18833
|
customerEligibility?: UpdatePlanCustomerEligibility | undefined;
|
|
18780
18834
|
};
|
|
18781
18835
|
|
|
@@ -19031,7 +19085,7 @@ declare class Billing extends ClientSDK {
|
|
|
19031
19085
|
* @example
|
|
19032
19086
|
* ```typescript
|
|
19033
19087
|
* // Schedule a transition from a trial plan to a paid plan
|
|
19034
|
-
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":
|
|
19088
|
+
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1782402442343,"plans":[{"planId":"trial_plan"}]},{"startsAt":1783612042343,"plans":[{"planId":"pro_plan"}]}] });
|
|
19035
19089
|
* ```
|
|
19036
19090
|
*
|
|
19037
19091
|
* @param customerId - The ID of the customer to create the schedule for.
|
|
@@ -19633,6 +19687,7 @@ declare class Plans extends ClientSDK {
|
|
|
19633
19687
|
* @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
|
|
19634
19688
|
* @param freeTrial - Free trial configuration. Customers can try this plan before being charged. (optional)
|
|
19635
19689
|
* @param config - Miscellaneous plan-level configuration flags. (optional)
|
|
19690
|
+
* @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)
|
|
19636
19691
|
*
|
|
19637
19692
|
* @returns The created plan object.
|
|
19638
19693
|
*/
|
|
@@ -19721,6 +19776,7 @@ declare class Plans extends ClientSDK {
|
|
|
19721
19776
|
* @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
|
|
19722
19777
|
* @param freeTrial - The free trial of the plan. Set to null to remove the free trial. (optional)
|
|
19723
19778
|
* @param config - Miscellaneous plan-level configuration flags. (optional)
|
|
19779
|
+
* @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)
|
|
19724
19780
|
* @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)
|
|
19725
19781
|
*
|
|
19726
19782
|
* @returns The updated plan object.
|
|
@@ -19868,6 +19924,7 @@ declare class Autumn extends ClientSDK {
|
|
|
19868
19924
|
* @param eventName - Event name to track usage for. Use instead of feature_id when multiple features should be tracked from a single event. (optional)
|
|
19869
19925
|
* @param value - The amount of usage to record. Defaults to 1. Use negative values to credit balance (e.g., when removing a seat). (optional)
|
|
19870
19926
|
* @param properties - Additional properties to attach to this usage event. (optional)
|
|
19927
|
+
* @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
|
|
19871
19928
|
* @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
|
|
19872
19929
|
*
|
|
19873
19930
|
* @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.
|
|
@@ -19903,6 +19960,7 @@ declare class Autumn extends ClientSDK {
|
|
|
19903
19960
|
* @param audioOutputTokens - Number of audio output tokens generated. (optional)
|
|
19904
19961
|
* @param reasoningTokens - Number of reasoning tokens generated. (optional)
|
|
19905
19962
|
* @param properties - Additional properties to attach to this usage event. (optional)
|
|
19963
|
+
* @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
|
|
19906
19964
|
* @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
|
|
19907
19965
|
*
|
|
19908
19966
|
* @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.
|
|
@@ -1443,6 +1443,10 @@ type RequestBody = {
|
|
|
1443
1443
|
properties?: {
|
|
1444
1444
|
[k: string]: any;
|
|
1445
1445
|
} | undefined;
|
|
1446
|
+
/**
|
|
1447
|
+
* Unix timestamp in milliseconds to use for the usage event. Defaults to the current time.
|
|
1448
|
+
*/
|
|
1449
|
+
timestamp?: number | undefined;
|
|
1446
1450
|
/**
|
|
1447
1451
|
* If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
|
|
1448
1452
|
*/
|
|
@@ -4079,6 +4083,12 @@ type Plan = {
|
|
|
4079
4083
|
* Miscellaneous plan-level configuration flags.
|
|
4080
4084
|
*/
|
|
4081
4085
|
config: PlanConfig;
|
|
4086
|
+
/**
|
|
4087
|
+
* Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
|
|
4088
|
+
*/
|
|
4089
|
+
metadata: {
|
|
4090
|
+
[k: string]: any;
|
|
4091
|
+
};
|
|
4082
4092
|
customerEligibility?: CustomerEligibility | undefined;
|
|
4083
4093
|
};
|
|
4084
4094
|
|
|
@@ -5167,6 +5177,12 @@ type CreatePlanParams = {
|
|
|
5167
5177
|
* Miscellaneous plan-level configuration flags.
|
|
5168
5178
|
*/
|
|
5169
5179
|
config?: CreatePlanConfigRequest | undefined;
|
|
5180
|
+
/**
|
|
5181
|
+
* 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.
|
|
5182
|
+
*/
|
|
5183
|
+
metadata?: {
|
|
5184
|
+
[k: string]: any;
|
|
5185
|
+
} | undefined;
|
|
5170
5186
|
createInStripe?: boolean | undefined;
|
|
5171
5187
|
};
|
|
5172
5188
|
/**
|
|
@@ -5622,6 +5638,12 @@ type CreatePlanResponse = {
|
|
|
5622
5638
|
* Miscellaneous plan-level configuration flags.
|
|
5623
5639
|
*/
|
|
5624
5640
|
config: CreatePlanConfigResponse;
|
|
5641
|
+
/**
|
|
5642
|
+
* Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
|
|
5643
|
+
*/
|
|
5644
|
+
metadata: {
|
|
5645
|
+
[k: string]: any;
|
|
5646
|
+
};
|
|
5625
5647
|
customerEligibility?: CreatePlanCustomerEligibility | undefined;
|
|
5626
5648
|
};
|
|
5627
5649
|
|
|
@@ -9205,6 +9227,12 @@ type GetPlanResponse = {
|
|
|
9205
9227
|
* Miscellaneous plan-level configuration flags.
|
|
9206
9228
|
*/
|
|
9207
9229
|
config: GetPlanConfig;
|
|
9230
|
+
/**
|
|
9231
|
+
* Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
|
|
9232
|
+
*/
|
|
9233
|
+
metadata: {
|
|
9234
|
+
[k: string]: any;
|
|
9235
|
+
};
|
|
9208
9236
|
customerEligibility?: GetPlanCustomerEligibility | undefined;
|
|
9209
9237
|
};
|
|
9210
9238
|
|
|
@@ -11165,6 +11193,12 @@ type ListPlansList = {
|
|
|
11165
11193
|
* Miscellaneous plan-level configuration flags.
|
|
11166
11194
|
*/
|
|
11167
11195
|
config: ListPlansConfig;
|
|
11196
|
+
/**
|
|
11197
|
+
* Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
|
|
11198
|
+
*/
|
|
11199
|
+
metadata: {
|
|
11200
|
+
[k: string]: any;
|
|
11201
|
+
};
|
|
11168
11202
|
customerEligibility?: ListPlansCustomerEligibility | undefined;
|
|
11169
11203
|
};
|
|
11170
11204
|
/**
|
|
@@ -15976,6 +16010,10 @@ type TrackParams = {
|
|
|
15976
16010
|
properties?: {
|
|
15977
16011
|
[k: string]: any;
|
|
15978
16012
|
} | undefined;
|
|
16013
|
+
/**
|
|
16014
|
+
* Unix timestamp in milliseconds to use for the usage event. Defaults to the current time.
|
|
16015
|
+
*/
|
|
16016
|
+
timestamp?: number | undefined;
|
|
15979
16017
|
/**
|
|
15980
16018
|
* If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
|
|
15981
16019
|
*/
|
|
@@ -16201,6 +16239,10 @@ type TrackTokensParams = {
|
|
|
16201
16239
|
properties?: {
|
|
16202
16240
|
[k: string]: any;
|
|
16203
16241
|
} | undefined;
|
|
16242
|
+
/**
|
|
16243
|
+
* Unix timestamp in milliseconds to use for the usage event. Defaults to the current time.
|
|
16244
|
+
*/
|
|
16245
|
+
timestamp?: number | undefined;
|
|
16204
16246
|
/**
|
|
16205
16247
|
* If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
|
|
16206
16248
|
*/
|
|
@@ -18314,6 +18356,12 @@ type UpdatePlanParams = {
|
|
|
18314
18356
|
* Miscellaneous plan-level configuration flags.
|
|
18315
18357
|
*/
|
|
18316
18358
|
config?: UpdatePlanConfigRequest | undefined;
|
|
18359
|
+
/**
|
|
18360
|
+
* 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.
|
|
18361
|
+
*/
|
|
18362
|
+
metadata?: {
|
|
18363
|
+
[k: string]: any;
|
|
18364
|
+
} | undefined;
|
|
18317
18365
|
createInStripe?: boolean | undefined;
|
|
18318
18366
|
version?: number | undefined;
|
|
18319
18367
|
archived?: boolean | undefined;
|
|
@@ -18776,6 +18824,12 @@ type UpdatePlanResponse = {
|
|
|
18776
18824
|
* Miscellaneous plan-level configuration flags.
|
|
18777
18825
|
*/
|
|
18778
18826
|
config: UpdatePlanConfigResponse;
|
|
18827
|
+
/**
|
|
18828
|
+
* Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
|
|
18829
|
+
*/
|
|
18830
|
+
metadata: {
|
|
18831
|
+
[k: string]: any;
|
|
18832
|
+
};
|
|
18779
18833
|
customerEligibility?: UpdatePlanCustomerEligibility | undefined;
|
|
18780
18834
|
};
|
|
18781
18835
|
|
|
@@ -19031,7 +19085,7 @@ declare class Billing extends ClientSDK {
|
|
|
19031
19085
|
* @example
|
|
19032
19086
|
* ```typescript
|
|
19033
19087
|
* // Schedule a transition from a trial plan to a paid plan
|
|
19034
|
-
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":
|
|
19088
|
+
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1782402442343,"plans":[{"planId":"trial_plan"}]},{"startsAt":1783612042343,"plans":[{"planId":"pro_plan"}]}] });
|
|
19035
19089
|
* ```
|
|
19036
19090
|
*
|
|
19037
19091
|
* @param customerId - The ID of the customer to create the schedule for.
|
|
@@ -19633,6 +19687,7 @@ declare class Plans extends ClientSDK {
|
|
|
19633
19687
|
* @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
|
|
19634
19688
|
* @param freeTrial - Free trial configuration. Customers can try this plan before being charged. (optional)
|
|
19635
19689
|
* @param config - Miscellaneous plan-level configuration flags. (optional)
|
|
19690
|
+
* @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)
|
|
19636
19691
|
*
|
|
19637
19692
|
* @returns The created plan object.
|
|
19638
19693
|
*/
|
|
@@ -19721,6 +19776,7 @@ declare class Plans extends ClientSDK {
|
|
|
19721
19776
|
* @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
|
|
19722
19777
|
* @param freeTrial - The free trial of the plan. Set to null to remove the free trial. (optional)
|
|
19723
19778
|
* @param config - Miscellaneous plan-level configuration flags. (optional)
|
|
19779
|
+
* @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)
|
|
19724
19780
|
* @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)
|
|
19725
19781
|
*
|
|
19726
19782
|
* @returns The updated plan object.
|
|
@@ -19868,6 +19924,7 @@ declare class Autumn extends ClientSDK {
|
|
|
19868
19924
|
* @param eventName - Event name to track usage for. Use instead of feature_id when multiple features should be tracked from a single event. (optional)
|
|
19869
19925
|
* @param value - The amount of usage to record. Defaults to 1. Use negative values to credit balance (e.g., when removing a seat). (optional)
|
|
19870
19926
|
* @param properties - Additional properties to attach to this usage event. (optional)
|
|
19927
|
+
* @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
|
|
19871
19928
|
* @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
|
|
19872
19929
|
*
|
|
19873
19930
|
* @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.
|
|
@@ -19903,6 +19960,7 @@ declare class Autumn extends ClientSDK {
|
|
|
19903
19960
|
* @param audioOutputTokens - Number of audio output tokens generated. (optional)
|
|
19904
19961
|
* @param reasoningTokens - Number of reasoning tokens generated. (optional)
|
|
19905
19962
|
* @param properties - Additional properties to attach to this usage event. (optional)
|
|
19963
|
+
* @param timestamp - Unix timestamp in milliseconds to use for the usage event. Defaults to the current time. (optional)
|
|
19906
19964
|
* @param async - If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information. (optional)
|
|
19907
19965
|
*
|
|
19908
19966
|
* @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.
|