@temporary-name/server 0.0.1-alpha.0cb08cf84b740850e7d8dcd1d8b87f78af26071b

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 (37) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -0
  3. package/dist/adapters/aws-lambda/index.d.mts +26 -0
  4. package/dist/adapters/aws-lambda/index.d.ts +26 -0
  5. package/dist/adapters/aws-lambda/index.mjs +30 -0
  6. package/dist/adapters/fastify/index.d.mts +23 -0
  7. package/dist/adapters/fastify/index.d.ts +23 -0
  8. package/dist/adapters/fastify/index.mjs +30 -0
  9. package/dist/adapters/fetch/index.d.mts +28 -0
  10. package/dist/adapters/fetch/index.d.ts +28 -0
  11. package/dist/adapters/fetch/index.mjs +32 -0
  12. package/dist/adapters/node/index.d.mts +26 -0
  13. package/dist/adapters/node/index.d.ts +26 -0
  14. package/dist/adapters/node/index.mjs +30 -0
  15. package/dist/handler/index.d.mts +22 -0
  16. package/dist/handler/index.d.ts +22 -0
  17. package/dist/handler/index.mjs +8 -0
  18. package/dist/helpers/index.d.mts +149 -0
  19. package/dist/helpers/index.d.ts +149 -0
  20. package/dist/helpers/index.mjs +142 -0
  21. package/dist/index.d.mts +395 -0
  22. package/dist/index.d.ts +395 -0
  23. package/dist/index.mjs +831 -0
  24. package/dist/openapi/index.d.mts +167 -0
  25. package/dist/openapi/index.d.ts +167 -0
  26. package/dist/openapi/index.mjs +15 -0
  27. package/dist/shared/server.BOkueCuE.d.ts +39 -0
  28. package/dist/shared/server.BTVDgKdb.d.mts +9552 -0
  29. package/dist/shared/server.BTVDgKdb.d.ts +9552 -0
  30. package/dist/shared/server.C1RJffw4.mjs +30 -0
  31. package/dist/shared/server.CWiZN27E.d.mts +39 -0
  32. package/dist/shared/server.CjPiuQYH.d.mts +51 -0
  33. package/dist/shared/server.CjPiuQYH.d.ts +51 -0
  34. package/dist/shared/server.D7jtfDRy.mjs +288 -0
  35. package/dist/shared/server.JwVIEHL6.mjs +386 -0
  36. package/dist/shared/server.RQr7F4gX.mjs +1292 -0
  37. package/package.json +87 -0
@@ -0,0 +1,395 @@
1
+ import { C as Context, M as Meta, c as MethodHandlerOptions, B as BaseDef, d as CompatibleContext, e as MergedContext, S as Schemable, E as Empty, f as MiddlewareOptionsOrHandler, g as Middleware, h as EndpointSchema, i as Schemas, W as WrapShapes, j as ContractOpts, k as MethodHandler, l as Method, A as AnySchema, m as AnyShape, D as DecoratedContract, n as ErrorMap, V as ValidatedAuthContext, o as AuthConfig, p as BuildContextWithAuth, q as Schema, r as InferMethodClientInputs, s as InferSchemaOutput, t as MiddlewareHandlerOptions, u as MiddlewareHandler, v as SchemaIssue, w as StainlessConfig$1, R as Resource } from './shared/server.BTVDgKdb.mjs';
2
+ export { ai as AnyContractDef, aj as AnyMethod, aq as AnyMiddleware, U as ApiError, T as ApiErrorStatic, y as ApiResource, x as ApiResourceConfig, aa as BadGatewayError, X as BadRequestError, a2 as ConflictError, a4 as ContentTooLargeError, b as Contract, ah as ContractDef, Z as ForbiddenError, ac as GatewayTimeoutError, z as ImplementedApiResource, I as ImplementedResource, az as InferHandlerInputs, a as InferResourceContext, ax as InferSchemaInput, ay as InferSchemableOutput, aB as InputSchemas, a8 as InternalServerError, L as LazyResource, ar as MapInputMiddleware, al as MethodConfig, $ as MethodNotAllowedError, as as MiddlewareDef, ao as MiddlewareNextFn, at as MiddlewareOptions, ap as MiddlewareRespondFn, an as MiddlewareResult, a0 as NotAcceptableError, _ as NotFoundError, a9 as NotImplementedError, ak as PathSchemaIfPlaceholders, a3 as PreconditionFailedError, a1 as RequestTimeoutError, ab as ServiceUnavailableError, a7 as TooManyRequestsError, aA as TypeRest, Y as UnauthorizedError, av as UnionToIntersection, a6 as UnprocessableContentError, a5 as UnsupportedMediaTypeError, Q as ValidationError, P as ValidationErrorOptions, aC as WrapInputShapes, aw as WrapShape, F as apiResource, au as defaultMiddlewareSchemas, af as encodeError, am as getEndpointId, ad as isApiErrorStatus, H as isLazyResource, G as lazyResource, O as mergeContext, ag as mergeMeta, ae as toApiError, J as unlazyResources, K as validateLazyLoadedResource, aD as wrapShape, aE as zEmptyObject } from './shared/server.BTVDgKdb.mjs';
3
+ import { Promisable, HTTPPath, HTTPEndpoint, AsyncIteratorClass, ClientRest, StandardBody, SetOptional, OmitStrict, HTTPMethod } from '@temporary-name/shared';
4
+ export { AsyncIteratorClass, ClientContext, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, HTTPMethod, HTTPPath, asyncIteratorToStream as eventIteratorToStream, streamToAsyncIteratorClass as streamToEventIterator } from '@temporary-name/shared';
5
+ import * as z from '@temporary-name/zod';
6
+ export { F as FriendlyStandardHandleOptions, S as StandardHandleOptions, a as StandardHandleResult, b as StandardHandler, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from './shared/server.CWiZN27E.mjs';
7
+ export { StandardMatchResult, StandardOpenAPIMatcher, decode, encode } from './handler/index.mjs';
8
+ import * as Draft07 from '@temporary-name/interop/json-schema-typed/draft-07';
9
+ import * as Draft2019 from '@temporary-name/interop/json-schema-typed/draft-2019-09';
10
+ import * as Draft2020 from '@temporary-name/interop/json-schema-typed/draft-2020-12';
11
+ export { a as ZodToJsonSchemaConverter, Z as ZodToJsonSchemaConverterOptions } from './shared/server.CjPiuQYH.mjs';
12
+ import * as zod_v4_core from 'zod/v4/core';
13
+ import { $input, $output } from 'zod/v4/core';
14
+ import { JSONSchema } from '@temporary-name/server/openapi';
15
+ export { getEventMeta, withEventMeta } from '@temporary-name/standard-server';
16
+ import '@temporary-name/server';
17
+
18
+ type VersioningConfig<TVersioningContext, TCurrentContext extends Context, TMeta extends Meta> = {
19
+ headerName?: string;
20
+ versions?: string[];
21
+ } | {
22
+ headerName?: string;
23
+ validate?: (version: string, options: MethodHandlerOptions<TCurrentContext, TMeta>) => Promisable<TVersioningContext>;
24
+ };
25
+
26
+ interface BuilderDef<TMeta extends Meta> extends BaseDef<TMeta> {
27
+ prefix?: HTTPPath;
28
+ }
29
+ declare class Builder<TInitialContext extends Context, TCurrentContext extends Context, TMeta extends Meta, TGateName extends string> {
30
+ #private;
31
+ z: z.SchemaClass<TGateName>;
32
+ constructor(def: BuilderDef<TMeta>);
33
+ /**
34
+ * Adds context fields to the builder that will be passed to middleware and the handler. These fields
35
+ * (unless already provided by earlier middleware) are passed in when calling `handle` on the server adapter
36
+ * (e.g. `NodeHttpHandler`).
37
+ *
38
+ * When calling `use` with a middleware that has required context, the builder must already have that
39
+ * context, either by calling `requireContext` or by using another middleware that provides it.
40
+ */
41
+ requireContext<U extends CompatibleContext<U, TCurrentContext> = {}>(): Builder<MergedContext<TInitialContext, U>, MergedContext<U, TCurrentContext>, TMeta, TGateName>;
42
+ /**
43
+ * Creates a middleware.
44
+ */
45
+ middleware<UOutContext extends Context, TPath extends Schemable = Empty, TQuery extends Schemable = Empty, THeaders extends Schemable = Empty, TBody extends Schemable = Empty>(options: MiddlewareOptionsOrHandler<TCurrentContext, UOutContext, TMeta, TPath, TQuery, THeaders, TBody>): Middleware<TCurrentContext, UOutContext, TMeta, TPath, TQuery, THeaders, TBody>;
46
+ /**
47
+ * Sets or updates the metadata for the contract.
48
+ * The provided metadata is spared-merged with any existing metadata in the contract.
49
+ */
50
+ meta(meta: TMeta): Builder<TInitialContext, TCurrentContext, TMeta, TGateName>;
51
+ /**
52
+ * Returns a builder that adds the given prefix to all methods.
53
+ * The prefix is post-appended to any existing prefix.
54
+ */
55
+ prefix(prefix: HTTPPath): Builder<TInitialContext, TCurrentContext, TMeta, TGateName>;
56
+ method<TEndpoint extends HTTPEndpoint, TPath extends EndpointSchema<TEndpoint, TPath> = Empty, TQuery extends Schemable = Empty, THeaders extends Schemable = Empty, TBody extends Schemable = Empty, TResponse extends Schemable = Empty, TSchemas extends Schemas = WrapShapes<TPath, TQuery, THeaders, TBody, TResponse>>(endpoint: TEndpoint, options: ContractOpts<TEndpoint, TPath, TQuery, THeaders, TBody, TResponse> & {
57
+ handler: NoInfer<MethodHandler<TCurrentContext, TSchemas, TMeta>>;
58
+ }): Method<TInitialContext, TCurrentContext, TSchemas, TMeta>;
59
+ contract<TEndpoint extends HTTPEndpoint, TPath extends EndpointSchema<TEndpoint, TPath>, TQuery extends AnySchema | AnyShape = Empty, THeaders extends AnySchema | AnyShape = Empty, TBody extends AnySchema | AnyShape = Empty, TResponse extends AnySchema | AnyShape = Empty, TSchemas extends Schemas = WrapShapes<TPath, TQuery, THeaders, TBody, TResponse>>(endpoint: TEndpoint, options: ContractOpts<TEndpoint, TPath, TQuery, THeaders, TBody, TResponse>): DecoratedContract<TSchemas, TMeta, TInitialContext, TCurrentContext>;
60
+ /**
61
+ * Adds a middleware to the pipeline. This builder's current context must satisfy the middleware's required
62
+ * context. If it doesn't, you can call `requireContext` on the builder to add it, or call `use` with
63
+ * another middleware that provides it.
64
+ */
65
+ use<UOutContext extends Context, TPath extends Schemable = Empty, TQuery extends Schemable = Empty, THeaders extends Schemable = Empty, TBody extends Schemable = Empty>(middleware: MiddlewareOptionsOrHandler<TCurrentContext, UOutContext, TMeta, TPath, TQuery, THeaders, TBody>): Builder<TInitialContext, MergedContext<TCurrentContext, UOutContext>, TMeta, TGateName>;
66
+ useErrors(errorMap: ErrorMap): Builder<TInitialContext, TCurrentContext, TMeta, TGateName>;
67
+ useAuth<TAuthContext extends ValidatedAuthContext = false>(config: AuthConfig<TAuthContext, TCurrentContext, TMeta>): Builder<TInitialContext, BuildContextWithAuth<TCurrentContext, TAuthContext>, TMeta, TGateName>;
68
+ useVersioning<TVersioningContext = string>(config?: VersioningConfig<TVersioningContext, TCurrentContext, TMeta>): Builder<TInitialContext, MergedContext<TCurrentContext, {
69
+ version: TVersioningContext;
70
+ }>, TMeta, TGateName>;
71
+ useGating<const TInferredGateName extends string>(gates: TInferredGateName[], isGateEnabled: (gate: TInferredGateName, ctx: TCurrentContext) => boolean): Builder<TInitialContext, MergedContext<TCurrentContext, {
72
+ isGateEnabled: typeof isGateEnabled;
73
+ }>, TMeta, TInferredGateName>;
74
+ }
75
+ declare const baseApi: Builder<{}, {}, Record<never, never>, never>;
76
+
77
+ interface EventIteratorSchemaDetails {
78
+ yields: AnySchema;
79
+ returns?: AnySchema;
80
+ }
81
+ /**
82
+ * Define schema for an event iterator.
83
+ */
84
+ declare function eventIterator<TYieldIn, TYieldOut, TReturnIn = unknown, TReturnOut = unknown>(yields: Schema<TYieldIn, TYieldOut>, returns?: Schema<TReturnIn, TReturnOut>): Schema<AsyncIteratorObject<TYieldIn, TReturnIn, void>, AsyncIteratorClass<TYieldOut, TReturnOut, void>>;
85
+ declare function getEventIteratorSchemaDetails(schema: AnySchema | undefined): undefined | EventIteratorSchemaDetails;
86
+
87
+ type JsonSchema = Draft2020.JSONSchema | Draft2019.JSONSchema | Draft07.JSONSchema;
88
+ declare enum JsonSchemaXNativeType {
89
+ BigInt = "bigint",
90
+ RegExp = "regexp",
91
+ Date = "date",
92
+ Url = "url",
93
+ Set = "set",
94
+ Map = "map"
95
+ }
96
+
97
+ interface experimental_JsonSchemaCoerceOptions {
98
+ components?: Record<string, JsonSchema>;
99
+ }
100
+ declare class experimental_JsonSchemaCoercer {
101
+ #private;
102
+ coerce(schema: JsonSchema, value: unknown, options?: experimental_JsonSchemaCoerceOptions): unknown;
103
+ }
104
+
105
+ /**
106
+ * Zod registry for customizing generated JSON schema, can use both for .input and .output
107
+ *
108
+ * @example
109
+ * ```ts
110
+ * import { JSON_SCHEMA_REGISTRY } from '@temporary-name/zod/zod4'
111
+ *
112
+ * const user = z.object({
113
+ * name: z.string(),
114
+ * age: z.number(),
115
+ * })
116
+ *
117
+ * JSON_SCHEMA_REGISTRY.add(user, {
118
+ * examples: [{ name: 'John', age: 20 }],
119
+ * })
120
+ * ```
121
+ */
122
+ declare const JSON_SCHEMA_REGISTRY: zod_v4_core.$ZodRegistry<{
123
+ $anchor?: string;
124
+ $comment?: string;
125
+ $defs?: Record<string, JSONSchema>;
126
+ $dynamicAnchor?: string;
127
+ $dynamicRef?: string;
128
+ $id?: string;
129
+ $ref?: string;
130
+ $schema?: string;
131
+ $vocabulary?: Record<string, string>;
132
+ additionalItems?: JSONSchema;
133
+ additionalProperties?: JSONSchema;
134
+ allOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
135
+ anyOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
136
+ const?: typeof $input | typeof $output | undefined;
137
+ contains?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
138
+ contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
139
+ contentMediaType?: string;
140
+ contentSchema?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
141
+ default?: typeof $input | typeof $output | undefined;
142
+ definitions?: Record<string, JSONSchema>;
143
+ dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
144
+ dependentRequired?: Record<string, string[] | readonly string[]>;
145
+ dependentSchemas?: Record<string, JSONSchema>;
146
+ deprecated?: boolean;
147
+ description?: string;
148
+ else?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
149
+ enum?: ((typeof $input | typeof $output)[] | readonly (typeof $input | typeof $output)[]) | undefined;
150
+ examples?: ((typeof $input | typeof $output)[] | readonly (typeof $input | typeof $output)[]) | undefined;
151
+ exclusiveMaximum?: number;
152
+ exclusiveMinimum?: number;
153
+ format?: string;
154
+ if?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
155
+ items?: JSONSchema;
156
+ maxContains?: number;
157
+ maximum?: number;
158
+ maxItems?: number;
159
+ maxLength?: number;
160
+ maxProperties?: number;
161
+ minContains?: number;
162
+ minimum?: number;
163
+ minItems?: number;
164
+ minLength?: number;
165
+ minProperties?: number;
166
+ multipleOf?: number;
167
+ not?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
168
+ oneOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
169
+ pattern?: string;
170
+ patternProperties?: Record<string, JSONSchema>;
171
+ prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
172
+ properties?: Record<string, JSONSchema>;
173
+ propertyNames?: JSONSchema;
174
+ readOnly?: boolean;
175
+ required?: string[] | readonly string[];
176
+ then?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
177
+ title?: string;
178
+ type?: JSONSchema.TypeValue | undefined;
179
+ unevaluatedItems?: JSONSchema;
180
+ unevaluatedProperties?: JSONSchema;
181
+ uniqueItems?: boolean;
182
+ writeOnly?: boolean;
183
+ }, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
184
+ /**
185
+ * Zod registry for customizing generated JSON schema, only useful for .input
186
+ *
187
+ * @example
188
+ * ```ts
189
+ * import { JSON_SCHEMA_INPUT_REGISTRY } from '@temporary-name/zod/zod4'
190
+ *
191
+ * const user = z.object({
192
+ * name: z.string(),
193
+ * age: z.string().transform(v => Number(v)),
194
+ * })
195
+ *
196
+ * JSON_SCHEMA_REGISTRY.add(user, {
197
+ * examples: [{ name: 'John', age: "20" }],
198
+ * })
199
+ * ```
200
+ */
201
+ declare const JSON_SCHEMA_INPUT_REGISTRY: zod_v4_core.$ZodRegistry<{
202
+ $anchor?: string;
203
+ $comment?: string;
204
+ $defs?: Record<string, JSONSchema>;
205
+ $dynamicAnchor?: string;
206
+ $dynamicRef?: string;
207
+ $id?: string;
208
+ $ref?: string;
209
+ $schema?: string;
210
+ $vocabulary?: Record<string, string>;
211
+ additionalItems?: JSONSchema;
212
+ additionalProperties?: JSONSchema;
213
+ allOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
214
+ anyOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
215
+ const?: typeof $input | undefined;
216
+ contains?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
217
+ contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
218
+ contentMediaType?: string;
219
+ contentSchema?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
220
+ default?: typeof $input | undefined;
221
+ definitions?: Record<string, JSONSchema>;
222
+ dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
223
+ dependentRequired?: Record<string, string[] | readonly string[]>;
224
+ dependentSchemas?: Record<string, JSONSchema>;
225
+ deprecated?: boolean;
226
+ description?: string;
227
+ else?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
228
+ enum?: ((typeof $input)[] | readonly (typeof $input)[]) | undefined;
229
+ examples?: ((typeof $input)[] | readonly (typeof $input)[]) | undefined;
230
+ exclusiveMaximum?: number;
231
+ exclusiveMinimum?: number;
232
+ format?: string;
233
+ if?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
234
+ items?: JSONSchema;
235
+ maxContains?: number;
236
+ maximum?: number;
237
+ maxItems?: number;
238
+ maxLength?: number;
239
+ maxProperties?: number;
240
+ minContains?: number;
241
+ minimum?: number;
242
+ minItems?: number;
243
+ minLength?: number;
244
+ minProperties?: number;
245
+ multipleOf?: number;
246
+ not?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
247
+ oneOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
248
+ pattern?: string;
249
+ patternProperties?: Record<string, JSONSchema>;
250
+ prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
251
+ properties?: Record<string, JSONSchema>;
252
+ propertyNames?: JSONSchema;
253
+ readOnly?: boolean;
254
+ required?: string[] | readonly string[];
255
+ then?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
256
+ title?: string;
257
+ type?: JSONSchema.TypeValue | undefined;
258
+ unevaluatedItems?: JSONSchema;
259
+ unevaluatedProperties?: JSONSchema;
260
+ uniqueItems?: boolean;
261
+ writeOnly?: boolean;
262
+ }, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
263
+ /**
264
+ * Zod registry for customizing generated JSON schema, only useful for .input
265
+ *
266
+ * @example
267
+ * ```ts
268
+ * import { JSON_SCHEMA_OUTPUT_REGISTRY } from '@temporary-name/zod/zod4'
269
+ *
270
+ * const user = z.object({
271
+ * name: z.string(),
272
+ * age: z.string().transform(v => Number(v)),
273
+ * })
274
+ *
275
+ * JSON_SCHEMA_OUTPUT_REGISTRY.add(user, {
276
+ * examples: [{ name: 'John', age: 20 }],
277
+ * })
278
+ * ```
279
+ */
280
+ declare const JSON_SCHEMA_OUTPUT_REGISTRY: zod_v4_core.$ZodRegistry<{
281
+ $anchor?: string;
282
+ $comment?: string;
283
+ $defs?: Record<string, JSONSchema>;
284
+ $dynamicAnchor?: string;
285
+ $dynamicRef?: string;
286
+ $id?: string;
287
+ $ref?: string;
288
+ $schema?: string;
289
+ $vocabulary?: Record<string, string>;
290
+ additionalItems?: JSONSchema;
291
+ additionalProperties?: JSONSchema;
292
+ allOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
293
+ anyOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
294
+ const?: typeof $output | undefined;
295
+ contains?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
296
+ contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
297
+ contentMediaType?: string;
298
+ contentSchema?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
299
+ default?: typeof $output | undefined;
300
+ definitions?: Record<string, JSONSchema>;
301
+ dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
302
+ dependentRequired?: Record<string, string[] | readonly string[]>;
303
+ dependentSchemas?: Record<string, JSONSchema>;
304
+ deprecated?: boolean;
305
+ description?: string;
306
+ else?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
307
+ enum?: ((typeof $output)[] | readonly (typeof $output)[]) | undefined;
308
+ examples?: ((typeof $output)[] | readonly (typeof $output)[]) | undefined;
309
+ exclusiveMaximum?: number;
310
+ exclusiveMinimum?: number;
311
+ format?: string;
312
+ if?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
313
+ items?: JSONSchema;
314
+ maxContains?: number;
315
+ maximum?: number;
316
+ maxItems?: number;
317
+ maxLength?: number;
318
+ maxProperties?: number;
319
+ minContains?: number;
320
+ minimum?: number;
321
+ minItems?: number;
322
+ minLength?: number;
323
+ minProperties?: number;
324
+ multipleOf?: number;
325
+ not?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
326
+ oneOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
327
+ pattern?: string;
328
+ patternProperties?: Record<string, JSONSchema>;
329
+ prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
330
+ properties?: Record<string, JSONSchema>;
331
+ propertyNames?: JSONSchema;
332
+ readOnly?: boolean;
333
+ required?: string[] | readonly string[];
334
+ then?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
335
+ title?: string;
336
+ type?: JSONSchema.TypeValue | undefined;
337
+ unevaluatedItems?: JSONSchema;
338
+ unevaluatedProperties?: JSONSchema;
339
+ uniqueItems?: boolean;
340
+ writeOnly?: boolean;
341
+ }, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
342
+
343
+ /**
344
+ * Call a method directly on the server.
345
+ */
346
+ declare function callMethod<TInitialContext extends Context, TSchemas extends Schemas, TMeta extends Meta>(method: Method<TInitialContext, any, TSchemas, TMeta>, ...[input, options]: ClientRest<TInitialContext, InferMethodClientInputs<TSchemas>>): Promise<InferSchemaOutput<TSchemas['responseSchema']>>;
347
+ type ParsedQs = {
348
+ [key: string]: undefined | string | string[] | ParsedQs | ParsedQs[];
349
+ };
350
+ interface Input {
351
+ path: Record<string, string>;
352
+ query: ParsedQs;
353
+ headers: Headers;
354
+ body: StandardBody;
355
+ }
356
+
357
+ declare function onStart<TInContext extends Context, TMeta extends Meta>(callback: NoInfer<(options: MiddlewareHandlerOptions<TInContext, TMeta>) => Promisable<void>>): MiddlewareHandler<TInContext, {}, TMeta>;
358
+ declare function onSuccess<TInContext extends Context, TMeta extends Meta>(callback: NoInfer<(result: unknown, options: MiddlewareHandlerOptions<TInContext, TMeta>) => Promisable<void>>): MiddlewareHandler<TInContext, {}, TMeta>;
359
+ declare function onError<TInContext extends Context, TMeta extends Meta>(callback: NoInfer<(error: unknown, options: MiddlewareHandlerOptions<TInContext, TMeta>) => Promisable<void>>): MiddlewareHandler<TInContext, {}, TMeta>;
360
+ type OnFinishState = [error: unknown, response: undefined, succeeded: false] | [error: undefined, response: unknown, succeeded: true];
361
+ declare function onFinish<TInContext extends Context, TMeta extends Meta>(callback: NoInfer<(state: OnFinishState, options: MiddlewareHandlerOptions<TInContext, TMeta>) => Promisable<void>>): MiddlewareHandler<TInContext, {}, TMeta>;
362
+
363
+ declare function isSchemaIssue(issue: unknown): issue is SchemaIssue;
364
+
365
+ type StainlessConfig = SetOptional<StainlessConfig$1, 'readme'>;
366
+ type StainlessConfigInput = OmitStrict<StainlessConfig, 'resources'>;
367
+ declare function generateStainlessConfig(resources: Resource[], baseConfig: StainlessConfigInput): Promise<StainlessConfig>;
368
+
369
+ declare const endpointRegex: RegExp;
370
+ /**
371
+ * @internal
372
+ */
373
+ declare function isDevelopment(): boolean;
374
+ /**
375
+ * @internal
376
+ */
377
+ declare function standardizeHTTPPath(path: HTTPPath): HTTPPath;
378
+ /**
379
+ * @internal
380
+ */
381
+ declare function getDynamicParams(path: HTTPPath | undefined): {
382
+ raw: string;
383
+ name: string;
384
+ }[] | undefined;
385
+ /**
386
+ * @internal
387
+ */
388
+ declare function parseEndpointDefinition(endpoint: HTTPEndpoint, schema: AnySchema | AnyShape | undefined): {
389
+ method: HTTPMethod;
390
+ path: HTTPPath;
391
+ pathSchema: AnySchema;
392
+ };
393
+
394
+ export { AnySchema, AnyShape, BaseDef, BuildContextWithAuth, Builder, CompatibleContext, Context, ContractOpts, DecoratedContract, Empty, EndpointSchema, ErrorMap, InferMethodClientInputs, InferSchemaOutput, JSON_SCHEMA_INPUT_REGISTRY, JSON_SCHEMA_OUTPUT_REGISTRY, JSON_SCHEMA_REGISTRY, JsonSchemaXNativeType, MergedContext, Meta, Method, MethodHandler, MethodHandlerOptions, Middleware, MiddlewareHandler, MiddlewareHandlerOptions, MiddlewareOptionsOrHandler, Resource, Schema, SchemaIssue, Schemable, Schemas, WrapShapes, baseApi, callMethod, endpointRegex, eventIterator, experimental_JsonSchemaCoercer, generateStainlessConfig, getDynamicParams, getEventIteratorSchemaDetails, isDevelopment, isSchemaIssue, onError, onFinish, onStart, onSuccess, parseEndpointDefinition, standardizeHTTPPath };
395
+ export type { BuilderDef, EventIteratorSchemaDetails, Input, JsonSchema, OnFinishState, ParsedQs, StainlessConfig, StainlessConfigInput, experimental_JsonSchemaCoerceOptions };