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