@temporary-name/server 1.9.3-alpha.fb7b7d19964e1b2def7056f4345b63d6fcacce10 → 1.9.3-alpha.fb7e3a67f82deaeffad5063e136b2f3c03c4b5b3
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/adapters/aws-lambda/index.d.mts +4 -4
- package/dist/adapters/aws-lambda/index.d.ts +4 -4
- package/dist/adapters/aws-lambda/index.mjs +5 -6
- package/dist/adapters/fetch/index.d.mts +4 -4
- package/dist/adapters/fetch/index.d.ts +4 -4
- package/dist/adapters/fetch/index.mjs +5 -6
- package/dist/adapters/node/index.d.mts +5 -5
- package/dist/adapters/node/index.d.ts +5 -5
- package/dist/adapters/node/index.mjs +5 -6
- package/dist/{adapters/standard → handler}/index.d.mts +4 -5
- package/dist/{adapters/standard → handler}/index.d.ts +4 -5
- package/dist/handler/index.mjs +8 -0
- package/dist/index.d.mts +273 -34
- package/dist/index.d.ts +273 -34
- package/dist/index.mjs +347 -35
- package/dist/openapi/index.d.mts +3 -2
- package/dist/openapi/index.d.ts +3 -2
- package/dist/openapi/index.mjs +64 -13
- package/dist/shared/server.-tR-4rQ5.mjs +523 -0
- package/dist/shared/{server.DXPMDozZ.d.mts → server.BwcJq6aP.d.mts} +462 -42
- package/dist/shared/{server.DXPMDozZ.d.ts → server.BwcJq6aP.d.ts} +462 -42
- package/dist/shared/server.CjPiuQYH.d.mts +51 -0
- package/dist/shared/server.CjPiuQYH.d.ts +51 -0
- package/dist/shared/{server.Cza0RB3u.mjs → server.D2NXNHIf.mjs} +5 -9
- package/dist/shared/{server.B0LJ_wu-.d.ts → server.Deg5phAY.d.ts} +4 -6
- package/dist/shared/{server.ChOv1yG3.mjs → server.DvgWQUGK.mjs} +189 -12
- package/dist/shared/{server.BQZMQrPe.d.mts → server.hAH-LVh_.d.mts} +4 -6
- package/dist/shared/{server.CYa9puL2.mjs → server.n1y5fcVQ.mjs} +24 -112
- package/package.json +11 -12
- package/dist/adapters/standard/index.mjs +0 -9
- package/dist/shared/server.CQIFwyhc.mjs +0 -40
- package/dist/shared/server.YUvuxHty.mjs +0 -48
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import * as z from '@temporary-name/zod';
|
|
2
2
|
import { SchemaClass, core } from '@temporary-name/zod';
|
|
3
|
+
export { z as baseZ };
|
|
3
4
|
import * as zod_v4_core from 'zod/v4/core';
|
|
5
|
+
import { $input, $output } from 'zod/v4/core';
|
|
4
6
|
import { ClientContext, Value, Promisable, Client, MaybeOptionalOptions, HTTPEndpoint as HTTPEndpoint$1, IntersectPick, HTTPPath, AsyncIteratorClass, ClientOptions, HTTPMethod } from '@temporary-name/shared';
|
|
5
|
-
export { AsyncIteratorClass, ClientContext, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, HTTPMethod, HTTPPath, IntersectPick,
|
|
6
|
-
import { C as Context, S as Schemas, I as InferProcedureClientInputs, a as InferSchemaOutput, M as Meta, L as Lazyable, P as Procedure, b as Contract, A as AnyShape, c as MergedSchemas, W as WrapShape, U as UnionToIntersection, d as AnySchema, R as Route, e as Middleware, f as MergedCurrentContext, g as MergedInitialContext, V as ValidatedAuthContext, h as AuthConfig, B as BuildContextWithAuth, i as ProcedureHandler, j as InferHandlerInputs, k as InferSchemaInput,
|
|
7
|
-
export {
|
|
7
|
+
export { AsyncIteratorClass, ClientContext, EventPublisher, EventPublisherOptions, EventPublisherSubscribeIteratorOptions, HTTPMethod, HTTPPath, IntersectPick, asyncIteratorToStream as eventIteratorToStream, onError, onFinish, onStart, onSuccess, streamToAsyncIteratorClass as streamToEventIterator } from '@temporary-name/shared';
|
|
8
|
+
import { C as Context, S as Schemas, I as InferProcedureClientInputs, a as InferSchemaOutput, M as Meta, L as Lazyable, P as Procedure, b as Contract, A as AnyShape, c as MergedSchemas, W as WrapShape, U as UnionToIntersection, d as AnySchema, R as Route, e as Middleware, f as MergedCurrentContext, g as MergedInitialContext, E as ErrorMap, V as ValidatedAuthContext, h as AuthConfig, B as BuildContextWithAuth, i as ProcedureHandler, j as InferHandlerInputs, k as InferSchemaInput, l as EnhanceRouterOptions, m as Router, n as EnhancedRouter, o as MapInputMiddleware, p as ContractDef, q as Schema, r as AnyMiddleware, s as Lazy, t as AnyProcedure, u as SchemaIssue } from './shared/server.BwcJq6aP.js';
|
|
9
|
+
export { D as APIError, y as APIErrorConstructor, ak as AccessibleLazyRouter, a9 as AnyContractDef, ad as AnyRouter, F as BadRequestError, ap as ContractProcedureCallbackOptions, ac as ContractRouter, z as CustomAPIErrorConstructor, H as ForbiddenError, ag as InferRouterCurrentContexts, ae as InferRouterInitialContext, af as InferRouterInitialContexts, ah as InferRouterInputs, ai as InferRouterOutputs, ax as InitialSchemas, J as InternalServerError, X as LAZY_SYMBOL, Y as LazyMeta, aq as LazyTraverseContractProceduresOptions, a4 as MiddlewareNextFn, a6 as MiddlewareOptions, a5 as MiddlewareOutputFn, a3 as MiddlewareResult, N as NotFoundError, aa as ProcedureDef, a8 as ProcedureHandlerOptions, ao as TraverseContractProcedureCallbackOptions, an as TraverseContractProceduresOptions, av as TypeRest, G as UnauthorizedError, at as UnlaziedRouter, x as ValidationError, w as ValidationErrorOptions, al as createAccessibleLazyRouter, T as encodeError, am as enhanceRouter, a0 as getLazyMeta, aj as getRouter, aw as initialSchemas, O as isAPIErrorStatus, $ as isLazy, ab as isProcedure, _ as lazy, Z as lazyInternal, K as makeErrors, v as mergeCurrentContext, a2 as mergeMeta, a7 as middlewareOutputFn, as as resolveContractProcedures, Q as toAPIError, ar as traverseContractProcedures, a1 as unlazy, au as unlazyRouter } from './shared/server.BwcJq6aP.js';
|
|
10
|
+
import * as Draft07 from '@temporary-name/interop/json-schema-typed/draft-07';
|
|
11
|
+
import * as Draft2019 from '@temporary-name/interop/json-schema-typed/draft-2019-09';
|
|
12
|
+
import * as Draft2020 from '@temporary-name/interop/json-schema-typed/draft-2020-12';
|
|
13
|
+
export { a as ZodToJsonSchemaConverter, Z as ZodToJsonSchemaConverterOptions } from './shared/server.CjPiuQYH.js';
|
|
14
|
+
import { JSONSchema } from '@temporary-name/server/openapi';
|
|
8
15
|
export { getEventMeta, withEventMeta } from '@temporary-name/standard-server';
|
|
9
16
|
|
|
10
17
|
type ProcedureClient<TClientContext extends ClientContext, TSchemas extends Schemas> = Client<TClientContext, InferProcedureClientInputs<TSchemas>, InferSchemaOutput<TSchemas['outputSchema']>>;
|
|
@@ -82,6 +89,7 @@ declare class ProcedureBuilder<TInitialContext extends Context, TCurrentContext
|
|
|
82
89
|
*/
|
|
83
90
|
use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>>(middleware: Middleware<TCurrentContext, UOutContext, unknown, unknown, TMeta>): ProcedureBuilder<TInitialContext, MergedCurrentContext<TCurrentContext, UOutContext>, TSchemas, TMeta, TGateName>;
|
|
84
91
|
use<UOutContext extends IntersectPick<TCurrentContext, UOutContext>, UInContext extends Context = TCurrentContext>(middleware: Middleware<UInContext, UOutContext, unknown, unknown, TMeta>): ProcedureBuilder<MergedInitialContext<TInitialContext, UInContext, TCurrentContext>, MergedCurrentContext<TCurrentContext, UOutContext>, TSchemas, TMeta, TGateName>;
|
|
92
|
+
useErrors(errorMap: ErrorMap): ProcedureBuilder<TInitialContext, TCurrentContext, TSchemas, TMeta, TGateName>;
|
|
85
93
|
useAuth<TAuthContext extends ValidatedAuthContext = false>(config: AuthConfig<TAuthContext, TCurrentContext, TMeta>): ProcedureBuilder<TInitialContext, BuildContextWithAuth<TCurrentContext, TAuthContext>, TSchemas, TMeta, TGateName>;
|
|
86
94
|
useGating<const TInferredGateName extends string>(gates: TInferredGateName[], isGateEnabled: (gate: TInferredGateName, ctx: TCurrentContext) => boolean): BuilderWithMiddlewares<MergedInitialContext<TInitialContext, Context, TCurrentContext>, MergedCurrentContext<TCurrentContext, {
|
|
87
95
|
isGateEnabled: typeof isGateEnabled;
|
|
@@ -156,25 +164,6 @@ declare const baseApi: Builder<{}, {}, {
|
|
|
156
164
|
outputSchema: z.KrustyUnknown<z.KrustyInternals<string>>;
|
|
157
165
|
}, Record<never, never>, never>;
|
|
158
166
|
|
|
159
|
-
interface ValidationErrorOptions extends ErrorOptions {
|
|
160
|
-
message: string;
|
|
161
|
-
issues: readonly SchemaIssue[];
|
|
162
|
-
/**
|
|
163
|
-
* @todo require this field in v2
|
|
164
|
-
*/
|
|
165
|
-
data?: unknown;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* This errors usually used for ORPCError.cause when the error is a validation error.
|
|
169
|
-
*
|
|
170
|
-
* @see {@link https://orpc.unnoq.com/docs/advanced/validation-errors Validation Errors Docs}
|
|
171
|
-
*/
|
|
172
|
-
declare class ValidationError extends Error {
|
|
173
|
-
readonly issues: readonly SchemaIssue[];
|
|
174
|
-
readonly data: unknown;
|
|
175
|
-
constructor(options: ValidationErrorOptions);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
167
|
interface EventIteratorSchemaDetails {
|
|
179
168
|
yields: AnySchema;
|
|
180
169
|
returns?: AnySchema;
|
|
@@ -187,6 +176,262 @@ interface EventIteratorSchemaDetails {
|
|
|
187
176
|
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>>;
|
|
188
177
|
declare function getEventIteratorSchemaDetails(schema: AnySchema | undefined): undefined | EventIteratorSchemaDetails;
|
|
189
178
|
|
|
179
|
+
type JsonSchema = Draft2020.JSONSchema | Draft2019.JSONSchema | Draft07.JSONSchema;
|
|
180
|
+
declare enum JsonSchemaXNativeType {
|
|
181
|
+
BigInt = "bigint",
|
|
182
|
+
RegExp = "regexp",
|
|
183
|
+
Date = "date",
|
|
184
|
+
Url = "url",
|
|
185
|
+
Set = "set",
|
|
186
|
+
Map = "map"
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
interface experimental_JsonSchemaCoerceOptions {
|
|
190
|
+
components?: Record<string, JsonSchema>;
|
|
191
|
+
}
|
|
192
|
+
declare class experimental_JsonSchemaCoercer {
|
|
193
|
+
#private;
|
|
194
|
+
coerce(schema: JsonSchema, value: unknown, options?: experimental_JsonSchemaCoerceOptions): unknown;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Zod registry for customizing generated JSON schema, can use both for .input and .output
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```ts
|
|
202
|
+
* import { JSON_SCHEMA_REGISTRY } from '@temporary-name/zod/zod4'
|
|
203
|
+
*
|
|
204
|
+
* const user = z.object({
|
|
205
|
+
* name: z.string(),
|
|
206
|
+
* age: z.number(),
|
|
207
|
+
* })
|
|
208
|
+
*
|
|
209
|
+
* JSON_SCHEMA_REGISTRY.add(user, {
|
|
210
|
+
* examples: [{ name: 'John', age: 20 }],
|
|
211
|
+
* })
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
declare const JSON_SCHEMA_REGISTRY: zod_v4_core.$ZodRegistry<{
|
|
215
|
+
$anchor?: string;
|
|
216
|
+
$comment?: string;
|
|
217
|
+
$defs?: Record<string, JSONSchema>;
|
|
218
|
+
$dynamicAnchor?: string;
|
|
219
|
+
$dynamicRef?: string;
|
|
220
|
+
$id?: string;
|
|
221
|
+
$ref?: string;
|
|
222
|
+
$schema?: string;
|
|
223
|
+
$vocabulary?: Record<string, string>;
|
|
224
|
+
additionalItems?: JSONSchema;
|
|
225
|
+
additionalProperties?: JSONSchema;
|
|
226
|
+
allOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
|
|
227
|
+
anyOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
|
|
228
|
+
const?: typeof $input | typeof $output | undefined;
|
|
229
|
+
contains?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
|
|
230
|
+
contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
|
|
231
|
+
contentMediaType?: string;
|
|
232
|
+
contentSchema?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
|
|
233
|
+
default?: typeof $input | typeof $output | undefined;
|
|
234
|
+
definitions?: Record<string, JSONSchema>;
|
|
235
|
+
dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
|
|
236
|
+
dependentRequired?: Record<string, string[] | readonly string[]>;
|
|
237
|
+
dependentSchemas?: Record<string, JSONSchema>;
|
|
238
|
+
deprecated?: boolean;
|
|
239
|
+
description?: string;
|
|
240
|
+
else?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
|
|
241
|
+
enum?: ((typeof $input | typeof $output)[] | readonly (typeof $input | typeof $output)[]) | undefined;
|
|
242
|
+
examples?: ((typeof $input | typeof $output)[] | readonly (typeof $input | typeof $output)[]) | undefined;
|
|
243
|
+
exclusiveMaximum?: number;
|
|
244
|
+
exclusiveMinimum?: number;
|
|
245
|
+
format?: string;
|
|
246
|
+
if?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
|
|
247
|
+
items?: JSONSchema;
|
|
248
|
+
maxContains?: number;
|
|
249
|
+
maximum?: number;
|
|
250
|
+
maxItems?: number;
|
|
251
|
+
maxLength?: number;
|
|
252
|
+
maxProperties?: number;
|
|
253
|
+
minContains?: number;
|
|
254
|
+
minimum?: number;
|
|
255
|
+
minItems?: number;
|
|
256
|
+
minLength?: number;
|
|
257
|
+
minProperties?: number;
|
|
258
|
+
multipleOf?: number;
|
|
259
|
+
not?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
|
|
260
|
+
oneOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
|
|
261
|
+
pattern?: string;
|
|
262
|
+
patternProperties?: Record<string, JSONSchema>;
|
|
263
|
+
prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
|
|
264
|
+
properties?: Record<string, JSONSchema>;
|
|
265
|
+
propertyNames?: JSONSchema;
|
|
266
|
+
readOnly?: boolean;
|
|
267
|
+
required?: string[] | readonly string[];
|
|
268
|
+
then?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
|
|
269
|
+
title?: string;
|
|
270
|
+
type?: JSONSchema.TypeValue | undefined;
|
|
271
|
+
unevaluatedItems?: JSONSchema;
|
|
272
|
+
unevaluatedProperties?: JSONSchema;
|
|
273
|
+
uniqueItems?: boolean;
|
|
274
|
+
writeOnly?: boolean;
|
|
275
|
+
}, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
|
|
276
|
+
/**
|
|
277
|
+
* Zod registry for customizing generated JSON schema, only useful for .input
|
|
278
|
+
*
|
|
279
|
+
* @example
|
|
280
|
+
* ```ts
|
|
281
|
+
* import { JSON_SCHEMA_INPUT_REGISTRY } from '@temporary-name/zod/zod4'
|
|
282
|
+
*
|
|
283
|
+
* const user = z.object({
|
|
284
|
+
* name: z.string(),
|
|
285
|
+
* age: z.string().transform(v => Number(v)),
|
|
286
|
+
* })
|
|
287
|
+
*
|
|
288
|
+
* JSON_SCHEMA_REGISTRY.add(user, {
|
|
289
|
+
* examples: [{ name: 'John', age: "20" }],
|
|
290
|
+
* })
|
|
291
|
+
* ```
|
|
292
|
+
*/
|
|
293
|
+
declare const JSON_SCHEMA_INPUT_REGISTRY: zod_v4_core.$ZodRegistry<{
|
|
294
|
+
$anchor?: string;
|
|
295
|
+
$comment?: string;
|
|
296
|
+
$defs?: Record<string, JSONSchema>;
|
|
297
|
+
$dynamicAnchor?: string;
|
|
298
|
+
$dynamicRef?: string;
|
|
299
|
+
$id?: string;
|
|
300
|
+
$ref?: string;
|
|
301
|
+
$schema?: string;
|
|
302
|
+
$vocabulary?: Record<string, string>;
|
|
303
|
+
additionalItems?: JSONSchema;
|
|
304
|
+
additionalProperties?: JSONSchema;
|
|
305
|
+
allOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
|
|
306
|
+
anyOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
|
|
307
|
+
const?: typeof $input | undefined;
|
|
308
|
+
contains?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
|
|
309
|
+
contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
|
|
310
|
+
contentMediaType?: string;
|
|
311
|
+
contentSchema?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
|
|
312
|
+
default?: typeof $input | undefined;
|
|
313
|
+
definitions?: Record<string, JSONSchema>;
|
|
314
|
+
dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
|
|
315
|
+
dependentRequired?: Record<string, string[] | readonly string[]>;
|
|
316
|
+
dependentSchemas?: Record<string, JSONSchema>;
|
|
317
|
+
deprecated?: boolean;
|
|
318
|
+
description?: string;
|
|
319
|
+
else?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
|
|
320
|
+
enum?: ((typeof $input)[] | readonly (typeof $input)[]) | undefined;
|
|
321
|
+
examples?: ((typeof $input)[] | readonly (typeof $input)[]) | undefined;
|
|
322
|
+
exclusiveMaximum?: number;
|
|
323
|
+
exclusiveMinimum?: number;
|
|
324
|
+
format?: string;
|
|
325
|
+
if?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
|
|
326
|
+
items?: JSONSchema;
|
|
327
|
+
maxContains?: number;
|
|
328
|
+
maximum?: number;
|
|
329
|
+
maxItems?: number;
|
|
330
|
+
maxLength?: number;
|
|
331
|
+
maxProperties?: number;
|
|
332
|
+
minContains?: number;
|
|
333
|
+
minimum?: number;
|
|
334
|
+
minItems?: number;
|
|
335
|
+
minLength?: number;
|
|
336
|
+
minProperties?: number;
|
|
337
|
+
multipleOf?: number;
|
|
338
|
+
not?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
|
|
339
|
+
oneOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
|
|
340
|
+
pattern?: string;
|
|
341
|
+
patternProperties?: Record<string, JSONSchema>;
|
|
342
|
+
prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
|
|
343
|
+
properties?: Record<string, JSONSchema>;
|
|
344
|
+
propertyNames?: JSONSchema;
|
|
345
|
+
readOnly?: boolean;
|
|
346
|
+
required?: string[] | readonly string[];
|
|
347
|
+
then?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
|
|
348
|
+
title?: string;
|
|
349
|
+
type?: JSONSchema.TypeValue | undefined;
|
|
350
|
+
unevaluatedItems?: JSONSchema;
|
|
351
|
+
unevaluatedProperties?: JSONSchema;
|
|
352
|
+
uniqueItems?: boolean;
|
|
353
|
+
writeOnly?: boolean;
|
|
354
|
+
}, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
|
|
355
|
+
/**
|
|
356
|
+
* Zod registry for customizing generated JSON schema, only useful for .input
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
* ```ts
|
|
360
|
+
* import { JSON_SCHEMA_OUTPUT_REGISTRY } from '@temporary-name/zod/zod4'
|
|
361
|
+
*
|
|
362
|
+
* const user = z.object({
|
|
363
|
+
* name: z.string(),
|
|
364
|
+
* age: z.string().transform(v => Number(v)),
|
|
365
|
+
* })
|
|
366
|
+
*
|
|
367
|
+
* JSON_SCHEMA_OUTPUT_REGISTRY.add(user, {
|
|
368
|
+
* examples: [{ name: 'John', age: 20 }],
|
|
369
|
+
* })
|
|
370
|
+
* ```
|
|
371
|
+
*/
|
|
372
|
+
declare const JSON_SCHEMA_OUTPUT_REGISTRY: zod_v4_core.$ZodRegistry<{
|
|
373
|
+
$anchor?: string;
|
|
374
|
+
$comment?: string;
|
|
375
|
+
$defs?: Record<string, JSONSchema>;
|
|
376
|
+
$dynamicAnchor?: string;
|
|
377
|
+
$dynamicRef?: string;
|
|
378
|
+
$id?: string;
|
|
379
|
+
$ref?: string;
|
|
380
|
+
$schema?: string;
|
|
381
|
+
$vocabulary?: Record<string, string>;
|
|
382
|
+
additionalItems?: JSONSchema;
|
|
383
|
+
additionalProperties?: JSONSchema;
|
|
384
|
+
allOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
|
|
385
|
+
anyOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
|
|
386
|
+
const?: typeof $output | undefined;
|
|
387
|
+
contains?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
|
|
388
|
+
contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
|
|
389
|
+
contentMediaType?: string;
|
|
390
|
+
contentSchema?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
|
|
391
|
+
default?: typeof $output | undefined;
|
|
392
|
+
definitions?: Record<string, JSONSchema>;
|
|
393
|
+
dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
|
|
394
|
+
dependentRequired?: Record<string, string[] | readonly string[]>;
|
|
395
|
+
dependentSchemas?: Record<string, JSONSchema>;
|
|
396
|
+
deprecated?: boolean;
|
|
397
|
+
description?: string;
|
|
398
|
+
else?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
|
|
399
|
+
enum?: ((typeof $output)[] | readonly (typeof $output)[]) | undefined;
|
|
400
|
+
examples?: ((typeof $output)[] | readonly (typeof $output)[]) | undefined;
|
|
401
|
+
exclusiveMaximum?: number;
|
|
402
|
+
exclusiveMinimum?: number;
|
|
403
|
+
format?: string;
|
|
404
|
+
if?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
|
|
405
|
+
items?: JSONSchema;
|
|
406
|
+
maxContains?: number;
|
|
407
|
+
maximum?: number;
|
|
408
|
+
maxItems?: number;
|
|
409
|
+
maxLength?: number;
|
|
410
|
+
maxProperties?: number;
|
|
411
|
+
minContains?: number;
|
|
412
|
+
minimum?: number;
|
|
413
|
+
minItems?: number;
|
|
414
|
+
minLength?: number;
|
|
415
|
+
minProperties?: number;
|
|
416
|
+
multipleOf?: number;
|
|
417
|
+
not?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
|
|
418
|
+
oneOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
|
|
419
|
+
pattern?: string;
|
|
420
|
+
patternProperties?: Record<string, JSONSchema>;
|
|
421
|
+
prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
|
|
422
|
+
properties?: Record<string, JSONSchema>;
|
|
423
|
+
propertyNames?: JSONSchema;
|
|
424
|
+
readOnly?: boolean;
|
|
425
|
+
required?: string[] | readonly string[];
|
|
426
|
+
then?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
|
|
427
|
+
title?: string;
|
|
428
|
+
type?: JSONSchema.TypeValue | undefined;
|
|
429
|
+
unevaluatedItems?: JSONSchema;
|
|
430
|
+
unevaluatedProperties?: JSONSchema;
|
|
431
|
+
uniqueItems?: boolean;
|
|
432
|
+
writeOnly?: boolean;
|
|
433
|
+
}, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
|
|
434
|
+
|
|
190
435
|
declare function isStartWithMiddlewares(middlewares: readonly AnyMiddleware[], compare: readonly AnyMiddleware[]): boolean;
|
|
191
436
|
declare function mergeMiddlewares(first: readonly AnyMiddleware[], second: readonly AnyMiddleware[], options: {
|
|
192
437
|
dedupeLeading: boolean;
|
|
@@ -206,20 +451,14 @@ declare function createAssertedLazyProcedure(lazied: Lazy<any>): Lazy<AnyProcedu
|
|
|
206
451
|
*/
|
|
207
452
|
declare function call<TInitialContext extends Context, TSchemas extends Schemas, TMeta extends Meta>(procedure: Lazyable<Procedure<TInitialContext, any, TSchemas, TMeta>>, input: InferProcedureClientInputs<TSchemas>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<TInitialContext, {}> & Omit<ClientOptions<{}>, 'context'>>): Promise<InferSchemaOutput<TSchemas['outputSchema']>>;
|
|
208
453
|
|
|
209
|
-
type RouterClient<TRouter extends AnyRouter, TClientContext extends ClientContext = {}> = TRouter extends Procedure<any, any, infer USchemas, any> ? ProcedureClient<TClientContext, USchemas> : {
|
|
210
|
-
[K in keyof TRouter]: TRouter[K] extends Lazyable<infer U extends AnyRouter> ? RouterClient<U, TClientContext> : never;
|
|
211
|
-
};
|
|
212
|
-
/**
|
|
213
|
-
* Create Server-side client from a router.
|
|
214
|
-
*
|
|
215
|
-
* @see {@link https://orpc.unnoq.com/docs/client/server-side Server-side Client Docs}
|
|
216
|
-
*/
|
|
217
|
-
declare function createRouterClient<T extends AnyRouter, TClientContext extends ClientContext>(router: Lazyable<T | undefined>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<InferRouterInitialContext<T>, TClientContext>>): RouterClient<T, TClientContext>;
|
|
218
|
-
|
|
219
454
|
declare function isSchemaIssue(issue: unknown): issue is SchemaIssue;
|
|
220
455
|
|
|
221
456
|
type HTTPEndpoint = `${HTTPMethod} ${HTTPPath}`;
|
|
222
457
|
declare const endpointRegex: RegExp;
|
|
458
|
+
/**
|
|
459
|
+
* @internal
|
|
460
|
+
*/
|
|
461
|
+
declare function isDevelopment(): boolean;
|
|
223
462
|
/**
|
|
224
463
|
* @internal
|
|
225
464
|
*/
|
|
@@ -240,5 +479,5 @@ declare function parseEndpointDefinition(stringsOrEndpoint: TemplateStringsArray
|
|
|
240
479
|
pathSchema: AnySchema;
|
|
241
480
|
};
|
|
242
481
|
|
|
243
|
-
export { AnyMiddleware, AnyProcedure,
|
|
244
|
-
export type { BuilderDef, CreateProcedureClientOptions, DecoratedMiddleware, EventIteratorSchemaDetails, HTTPEndpoint, ProcedureClient, RouterBuilder,
|
|
482
|
+
export { AnyMiddleware, AnyProcedure, AnySchema, AnyShape, BuildContextWithAuth, Builder, BuilderWithMiddlewares, Context, Contract, ContractDef, DecoratedProcedure, EnhanceRouterOptions, EnhancedRouter, ErrorMap, InferHandlerInputs, InferProcedureClientInputs, InferSchemaInput, InferSchemaOutput, JSON_SCHEMA_INPUT_REGISTRY, JSON_SCHEMA_OUTPUT_REGISTRY, JSON_SCHEMA_REGISTRY, JsonSchemaXNativeType, Lazy, Lazyable, MapInputMiddleware, MergedCurrentContext, MergedInitialContext, MergedSchemas, Meta, Middleware, Procedure, ProcedureBuilder, ProcedureHandler, Router, Schema, SchemaIssue, Schemas, UnionToIntersection, WrapShape, addMiddleware, baseApi, call, createAssertedLazyProcedure, createProcedureClient, decorateMiddleware, endpointRegex, eventIterator, experimental_JsonSchemaCoercer, getDynamicParams, getEventIteratorSchemaDetails, isDevelopment, isSchemaIssue, isStartWithMiddlewares, mergeMiddlewares, parseEndpointDefinition, standardizeHTTPPath };
|
|
483
|
+
export type { BuilderDef, CreateProcedureClientOptions, DecoratedMiddleware, EventIteratorSchemaDetails, HTTPEndpoint, JsonSchema, ProcedureClient, RouterBuilder, experimental_JsonSchemaCoerceOptions };
|