@orpc/zod 0.0.0-next.f99e554 → 0.0.0-next.fcb9d5a

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.
@@ -1,6 +0,0 @@
1
- import type { Schema } from '@orpc/contract';
2
- import type { SchemaCoercer } from '@orpc/openapi/fetch';
3
- export declare class ZodCoercer implements SchemaCoercer {
4
- coerce(schema: Schema, value: unknown): unknown;
5
- }
6
- //# sourceMappingURL=coercer.d.ts.map
@@ -1,50 +0,0 @@
1
- import type { Schema } from '@orpc/contract';
2
- import type { JSONSchema, SchemaConverter, SchemaConvertOptions } from '@orpc/openapi';
3
- import type { StandardSchemaV1 } from '@standard-schema/spec';
4
- export declare const NON_LOGIC_KEYWORDS: ("$anchor" | "$comment" | "$defs" | "$dynamicAnchor" | "$dynamicRef" | "$id" | "$schema" | "$vocabulary" | "contentEncoding" | "contentMediaType" | "default" | "definitions" | "deprecated" | "description" | "examples" | "format" | "readOnly" | "title" | "writeOnly")[];
5
- export declare const UNSUPPORTED_JSON_SCHEMA: {
6
- not: {};
7
- };
8
- export declare const UNDEFINED_JSON_SCHEMA: {
9
- const: string;
10
- };
11
- export interface ZodToJsonSchemaOptions {
12
- /**
13
- * Max depth of lazy type, if it exceeds.
14
- *
15
- * Used `{}` when reach max depth
16
- *
17
- * @default 5
18
- */
19
- maxLazyDepth?: number;
20
- /**
21
- * The length used to track the depth of lazy type
22
- *
23
- * @internal
24
- */
25
- lazyDepth?: number;
26
- /**
27
- * The expected json schema for input or output zod schema
28
- *
29
- * @default input
30
- */
31
- mode?: 'input' | 'output';
32
- /**
33
- * Track if current level schema is handled custom json schema to prevent recursive
34
- *
35
- * @internal
36
- */
37
- isHandledCustomJSONSchema?: boolean;
38
- /**
39
- * Track if current level schema is handled zod description to prevent recursive
40
- *
41
- * @internal
42
- */
43
- isHandledZodDescription?: boolean;
44
- }
45
- export declare function zodToJsonSchema(schema: StandardSchemaV1, options?: ZodToJsonSchemaOptions): Exclude<JSONSchema.JSONSchema, boolean>;
46
- export declare class ZodToJsonSchemaConverter implements SchemaConverter {
47
- condition(schema: Schema): boolean;
48
- convert(schema: Schema, options: SchemaConvertOptions): JSONSchema.JSONSchema;
49
- }
50
- //# sourceMappingURL=converter.d.ts.map
@@ -1,4 +0,0 @@
1
- export * from './coercer';
2
- export * from './converter';
3
- export * from './schemas';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,31 +0,0 @@
1
- import type { JSONSchema } from 'json-schema-typed/draft-2020-12';
2
- import { type CustomErrorParams, type input, type output, type ZodEffects, type ZodType, type ZodTypeAny, type ZodTypeDef } from 'zod';
3
- export type CustomZodType = 'File' | 'Blob' | 'Invalid Date' | 'RegExp' | 'URL';
4
- type CustomParams = CustomErrorParams & {
5
- fatal?: boolean;
6
- };
7
- export declare function getCustomZodType(def: ZodTypeDef): CustomZodType | undefined;
8
- export declare function getCustomZodFileMimeType(def: ZodTypeDef): string | undefined;
9
- export declare function getCustomJSONSchema(def: ZodTypeDef, options?: {
10
- mode?: 'input' | 'output';
11
- }): Exclude<JSONSchema, boolean> | undefined;
12
- export declare function file(params?: string | CustomParams | ((input: unknown) => CustomParams)): ZodType<InstanceType<typeof File>, ZodTypeDef, InstanceType<typeof File>> & {
13
- type: (mimeType: string, params?: string | CustomParams | ((input: unknown) => CustomParams)) => ZodEffects<ZodType<InstanceType<typeof File>, ZodTypeDef, InstanceType<typeof File>>, InstanceType<typeof File>, InstanceType<typeof File>>;
14
- };
15
- export declare function blob(params?: string | CustomParams | ((input: unknown) => CustomParams)): ZodType<InstanceType<typeof Blob>, ZodTypeDef, InstanceType<typeof Blob>>;
16
- export declare function invalidDate(params?: string | CustomParams | ((input: unknown) => CustomParams)): ZodType<Date, ZodTypeDef, Date>;
17
- export declare function regexp(options?: CustomParams): ZodType<RegExp, ZodTypeDef, RegExp>;
18
- export declare function url(options?: CustomParams): ZodType<URL, ZodTypeDef, URL>;
19
- export declare function openapi<T extends ZodTypeAny, TMode extends 'input' | 'output' | 'both' = 'both'>(schema: T, custom: Exclude<JSONSchema<TMode extends 'input' ? input<T> : TMode extends 'output' ? output<T> : input<T> & output<T>>, boolean>, options?: {
20
- mode: TMode;
21
- }): ReturnType<T['refine']>;
22
- export declare const oz: {
23
- openapi: typeof openapi;
24
- file: typeof file;
25
- blob: typeof blob;
26
- invalidDate: typeof invalidDate;
27
- regexp: typeof regexp;
28
- url: typeof url;
29
- };
30
- export {};
31
- //# sourceMappingURL=schemas.d.ts.map