@mastra/voice-aws-nova-sonic 0.2.2 → 0.2.3
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/_types/@internal_voice/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +371 -29
- package/dist/_types/@internal_voice/dist/_types/@internal_core/dist/request-context/index.d.ts +35 -1
- package/dist/_types/@internal_voice/dist/_types/zod/v3/ZodError.d.ts +1 -1
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/checks.d.ts +1 -1
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/compat.d.ts +9 -11
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/deep-partial.d.ts +14 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/errors.d.ts +3 -4
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/external.d.ts +5 -2
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/in-out.d.ts +8 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/index.d.ts +1 -2
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/iso.d.ts +2 -17
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/parse.d.ts +17 -4
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/schemas.d.ts +68 -19
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/api.d.ts +22 -12
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/checks.d.ts +29 -13
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/compile.d.ts +65 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/core.d.ts +16 -4
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/doc.d.ts +3 -1
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/errors.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/index.d.ts +3 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/json-schema-generator.d.ts +2 -2
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/json-schema-processors.d.ts +16 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/json-schema.d.ts +2 -1
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/memoizer.d.ts +15 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/parse.d.ts +14 -11
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/regexes.d.ts +5 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/schemas.d.ts +123 -34
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/to-json-schema.d.ts +45 -5
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/util.d.ts +79 -1
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/versions.d.ts +1 -1
- package/dist/_types/@internal_voice/dist/_types/zod/v4/index.d.cts +2 -2
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/bn.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ckb.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/gu.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/hi.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/index.d.ts +11 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/kn.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ne.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/nn.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/pt-BR.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/sk.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/tg.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/tk.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/index.d.ts +2 -2
- package/dist/_types/@internal_voice/dist/voice/aisdk/speech.d.ts +1 -1
- package/dist/_types/@internal_voice/dist/voice/aisdk/transcription.d.ts +1 -1
- package/dist/_types/@internal_voice/dist/voice/composite-voice.d.ts +2 -2
- package/dist/_types/@internal_voice/dist/voice/voice.d.ts +2 -2
- package/dist/_types/@internal_voice/package.json +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-voice-overview.md +25 -0
- package/dist/index.cjs +4 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/dist/_types/@internal_voice/dist/_types/zod/v3/index.d.cts +0 -4
package/dist/_types/@internal_voice/dist/_types/@internal_core/dist/request-context/index.d.ts
CHANGED
|
@@ -55,6 +55,19 @@ declare const MASTRA_AUTH_TOKEN_KEY = "mastra__authToken";
|
|
|
55
55
|
* nested delegated runs. Internal to delegation — do not set it yourself.
|
|
56
56
|
*/
|
|
57
57
|
declare const MASTRA_INHERITED_MEMORY_KEY = "mastra__inheritedMemory";
|
|
58
|
+
/**
|
|
59
|
+
* Reserved key naming who sent a user message: `{ id, name?, avatarUrl? }`.
|
|
60
|
+
* Set by the host that authenticated the request; the agent-controller copies
|
|
61
|
+
* it onto the sent message as `providerMetadata.mastra.author` so a shared
|
|
62
|
+
* thread can show who wrote what.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* // In your auth middleware:
|
|
67
|
+
* requestContext.setRaw(MASTRA_MESSAGE_AUTHOR_KEY, { id: user.id, name: user.name, avatarUrl: user.avatarUrl });
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
declare const MASTRA_MESSAGE_AUTHOR_KEY = "mastra__messageAuthor";
|
|
58
71
|
type VersionSelector = {
|
|
59
72
|
versionId: string;
|
|
60
73
|
} | {
|
|
@@ -66,6 +79,27 @@ type VersionOverrides = {
|
|
|
66
79
|
defaultStatus?: 'draft' | 'published';
|
|
67
80
|
};
|
|
68
81
|
declare function mergeVersionOverrides(base?: VersionOverrides, overrides?: VersionOverrides): VersionOverrides | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Carries typed, request-specific values through agents, tools, and workflows.
|
|
84
|
+
* Pass the instance as `requestContext` when starting an operation.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* import { RequestContext } from '@mastra/core/request-context';
|
|
89
|
+
*
|
|
90
|
+
* const requestContext = new RequestContext<{ locale: string }>([
|
|
91
|
+
* ['locale', 'en'],
|
|
92
|
+
* ]);
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* @see For documentation bundled with your installed package, locate
|
|
96
|
+
* `@mastra/core/package.json` with your project's resolver or package-manager
|
|
97
|
+
* tooling, then read `dist/docs/SKILL.md` from that package root and follow its
|
|
98
|
+
* reference links. Use package-manager tools for virtual or archived packages.
|
|
99
|
+
*
|
|
100
|
+
* @see [Request context documentation](https://mastra.ai/docs/server/request-context)
|
|
101
|
+
* if packaged docs are unavailable.
|
|
102
|
+
*/
|
|
69
103
|
declare class RequestContext<Values extends Record<string, any> | unknown = unknown> {
|
|
70
104
|
private registry;
|
|
71
105
|
constructor(iterable?: Values extends Record<string, any> ? RecordToTuple<Partial<Values>> : Iterable<readonly [string, unknown]>);
|
|
@@ -215,5 +249,5 @@ declare class RequestContext<Values extends Record<string, any> | unknown = unkn
|
|
|
215
249
|
get all(): Values extends Record<string, any> ? Values : Record<string, any>;
|
|
216
250
|
}
|
|
217
251
|
//#endregion
|
|
218
|
-
export { MASTRA_AUTH_TOKEN_KEY, MASTRA_INHERITED_MEMORY_KEY, MASTRA_RESOURCE_ID_KEY, MASTRA_THREAD_ID_KEY, MASTRA_VERSIONS_KEY, RequestContext, VersionOverrides, VersionSelector, mergeVersionOverrides };
|
|
252
|
+
export { MASTRA_AUTH_TOKEN_KEY, MASTRA_INHERITED_MEMORY_KEY, MASTRA_MESSAGE_AUTHOR_KEY, MASTRA_RESOURCE_ID_KEY, MASTRA_THREAD_ID_KEY, MASTRA_VERSIONS_KEY, RequestContext, VersionOverrides, VersionSelector, mergeVersionOverrides };
|
|
219
253
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -10,13 +10,13 @@ export type typeToFlattenedError<T, U = string> = {
|
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
export declare const ZodIssueCode: {
|
|
13
|
-
custom: "custom";
|
|
14
13
|
invalid_type: "invalid_type";
|
|
15
14
|
too_big: "too_big";
|
|
16
15
|
too_small: "too_small";
|
|
17
16
|
not_multiple_of: "not_multiple_of";
|
|
18
17
|
unrecognized_keys: "unrecognized_keys";
|
|
19
18
|
invalid_union: "invalid_union";
|
|
19
|
+
custom: "custom";
|
|
20
20
|
invalid_literal: "invalid_literal";
|
|
21
21
|
invalid_union_discriminator: "invalid_union_discriminator";
|
|
22
22
|
invalid_enum_value: "invalid_enum_value";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, _slugify as slugify, type $RefinementCtx as RefinementCtx, } from "../core/index.js";
|
|
1
|
+
export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _properties as properties, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, _slugify as slugify, type $RefinementCtx as RefinementCtx, } from "../core/index.js";
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as core from "../core/index.js";
|
|
2
2
|
import type { ZodType } from "./schemas.js";
|
|
3
|
-
export type {
|
|
4
3
|
/** @deprecated Use `z.output<T>` instead. */
|
|
5
|
-
|
|
4
|
+
export type TypeOf<T> = core.output<T>;
|
|
6
5
|
/** @deprecated Use `z.output<T>` instead. */
|
|
7
|
-
|
|
8
|
-
/** @deprecated Use `z.core
|
|
9
|
-
|
|
6
|
+
export type Infer<T> = core.output<T>;
|
|
7
|
+
/** @deprecated Use `z.core.$ZodTypes` instead */
|
|
8
|
+
export type ZodFirstPartySchemaTypes = core.$ZodTypes;
|
|
10
9
|
/** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
|
|
11
10
|
export declare const ZodIssueCode: {
|
|
12
11
|
readonly invalid_type: "invalid_type";
|
|
@@ -21,9 +20,9 @@ export declare const ZodIssueCode: {
|
|
|
21
20
|
readonly invalid_value: "invalid_value";
|
|
22
21
|
readonly custom: "custom";
|
|
23
22
|
};
|
|
24
|
-
/** @deprecated Use `z.$ZodFlattenedError
|
|
23
|
+
/** @deprecated Use `z.core.$ZodFlattenedError<z.output<T>>` instead; it takes an inferred type, not a schema. */
|
|
25
24
|
export type inferFlattenedErrors<T extends core.$ZodType, U = string> = core.$ZodFlattenedError<core.output<T>, U>;
|
|
26
|
-
/** @deprecated Use `z.$ZodFormattedError
|
|
25
|
+
/** @deprecated Use `z.core.$ZodFormattedError<z.output<T>>` instead; it takes an inferred type, not a schema. */
|
|
27
26
|
export type inferFormattedError<T extends core.$ZodType<any, any>, U = string> = core.$ZodFormattedError<core.output<T>, U>;
|
|
28
27
|
/** Use `z.$brand` instead */
|
|
29
28
|
export type BRAND<T extends string | number | symbol = string | number | symbol> = {
|
|
@@ -36,13 +35,12 @@ export { $brand, config } from "../core/index.js";
|
|
|
36
35
|
export declare function setErrorMap(map: core.$ZodErrorMap): void;
|
|
37
36
|
/** @deprecated Use `z.config()` instead. */
|
|
38
37
|
export declare function getErrorMap(): core.$ZodErrorMap<core.$ZodIssue> | undefined;
|
|
39
|
-
export type {
|
|
40
38
|
/** @deprecated Use z.ZodType (without generics) instead. */
|
|
41
|
-
|
|
39
|
+
export type ZodTypeAny<Output = unknown, Input = unknown, Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> = ZodType<Output, Input, Internals>;
|
|
42
40
|
/** @deprecated Use `z.ZodType` */
|
|
43
|
-
|
|
41
|
+
export type ZodSchema<Output = unknown, Input = unknown, Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> = ZodType<Output, Input, Internals>;
|
|
44
42
|
/** @deprecated Use `z.ZodType` */
|
|
45
|
-
|
|
43
|
+
export type Schema<Output = unknown, Input = unknown, Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> = ZodType<Output, Input, Internals>;
|
|
46
44
|
/** Included for Zod 3 compatibility */
|
|
47
45
|
export type ZodRawShape = core.$ZodShape;
|
|
48
46
|
/** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as core from "../core/index.js";
|
|
2
|
+
import * as schemas from "./schemas.js";
|
|
3
|
+
/** Distributes `.partial()` through every object in a schema type, preserving the wrappers around them. */
|
|
4
|
+
export type DeepPartial<T extends core.SomeType> = T extends schemas.ZodObject<infer Shape, infer Config> ? schemas.ZodObject<{
|
|
5
|
+
-readonly [K in keyof Shape]: schemas.ZodOptional<DeepPartial<Shape[K]>>;
|
|
6
|
+
}, Config> : T extends schemas.ZodDiscriminatedUnion<infer Options, any> ? schemas.ZodUnion<{
|
|
7
|
+
-readonly [I in keyof Options]: Options[I] extends core.SomeType ? DeepPartial<Options[I]> : Options[I];
|
|
8
|
+
}> : T extends schemas.ZodUnion<infer Options> ? schemas.ZodUnion<{
|
|
9
|
+
-readonly [I in keyof Options]: Options[I] extends core.SomeType ? DeepPartial<Options[I]> : Options[I];
|
|
10
|
+
}> : T extends schemas.ZodArray<infer El> ? schemas.ZodArray<DeepPartial<El>> : T extends schemas.ZodTuple<infer Items, infer Rest> ? schemas.ZodTuple<{
|
|
11
|
+
-readonly [K in keyof Items]: Items[K] extends core.SomeType ? DeepPartial<Items[K]> : Items[K];
|
|
12
|
+
}, Rest extends core.SomeType ? DeepPartial<Rest> : Rest> : T extends schemas.ZodIntersection<infer A, infer B> ? schemas.ZodIntersection<DeepPartial<A>, DeepPartial<B>> : T extends schemas.ZodRecord<infer K, infer V> ? schemas.ZodRecord<K, DeepPartial<V>> : T extends schemas.ZodMap<infer K, infer V> ? schemas.ZodMap<K, DeepPartial<V>> : T extends schemas.ZodSet<infer El> ? schemas.ZodSet<DeepPartial<El>> : T extends schemas.ZodOptional<infer Inner> ? schemas.ZodOptional<DeepPartial<Inner>> : T extends schemas.ZodNullable<infer Inner> ? schemas.ZodNullable<DeepPartial<Inner>> : T extends schemas.ZodDefault<infer Inner> ? schemas.ZodDefault<DeepPartial<Inner>> : T extends schemas.ZodPrefault<infer Inner> ? schemas.ZodPrefault<DeepPartial<Inner>> : T extends schemas.ZodNonOptional<infer Inner> ? schemas.ZodNonOptional<DeepPartial<Inner>> : T extends schemas.ZodCatch<infer Inner> ? schemas.ZodCatch<DeepPartial<Inner>> : T extends schemas.ZodReadonly<infer Inner> ? schemas.ZodReadonly<DeepPartial<Inner>> : T extends schemas.ZodSuccess<infer Inner> ? schemas.ZodSuccess<DeepPartial<Inner>> : T extends schemas.ZodPromise<infer Inner> ? schemas.ZodPromise<DeepPartial<Inner>> : T extends schemas.ZodCodec<infer A, infer B> ? schemas.ZodCodec<DeepPartial<A>, DeepPartial<B>> : T extends schemas.ZodPreprocess<infer B> ? schemas.ZodPreprocess<DeepPartial<B>> : T extends schemas.ZodPipe<infer A, infer B> ? schemas.ZodPipe<DeepPartial<A>, DeepPartial<B>> : T extends schemas.ZodLazy<infer Inner> ? schemas.ZodLazy<DeepPartial<Inner>> : T;
|
|
13
|
+
/** Returns a copy of the schema with every nested object's properties made optional. */
|
|
14
|
+
export declare function deepPartial<T extends core.SomeType>(schema: T): DeepPartial<T>;
|
|
@@ -19,12 +19,11 @@ export interface ZodError<T = unknown> extends $ZodError<T> {
|
|
|
19
19
|
}
|
|
20
20
|
export declare const ZodError: core.$constructor<ZodError>;
|
|
21
21
|
export declare const ZodRealError: core.$constructor<ZodError>;
|
|
22
|
-
export type {
|
|
23
22
|
/** @deprecated Use `z.core.$ZodFlattenedError` instead. */
|
|
24
|
-
|
|
23
|
+
export type ZodFlattenedError<T, U = string> = core.$ZodFlattenedError<T, U>;
|
|
25
24
|
/** @deprecated Use `z.core.$ZodFormattedError` instead. */
|
|
26
|
-
|
|
25
|
+
export type ZodFormattedError<T, U = string> = core.$ZodFormattedError<T, U>;
|
|
27
26
|
/** @deprecated Use `z.core.$ZodErrorMap` instead. */
|
|
28
|
-
|
|
27
|
+
export type ZodErrorMap<T extends core.$ZodIssueBase = core.$ZodIssue> = core.$ZodErrorMap<T>;
|
|
29
28
|
/** @deprecated Use `z.core.$ZodRawIssue` instead. */
|
|
30
29
|
export type IssueData = core.$ZodRawIssue;
|
|
@@ -4,11 +4,14 @@ export * from "./checks.js";
|
|
|
4
4
|
export * from "./errors.js";
|
|
5
5
|
export * from "./parse.js";
|
|
6
6
|
export * from "./compat.js";
|
|
7
|
-
export type { infer
|
|
7
|
+
export type { infer } from "../core/index.js";
|
|
8
8
|
export type { JSONType } from "../core/util.js";
|
|
9
|
-
export
|
|
9
|
+
export type { CompileOptions } from "../core/index.js";
|
|
10
|
+
export { globalRegistry, type GlobalMeta, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, INVALID, toZod, compile, withParser, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.js";
|
|
10
11
|
export { toJSONSchema } from "../core/json-schema-processors.js";
|
|
11
12
|
export { fromJSONSchema } from "./from-json-schema.js";
|
|
13
|
+
export { deepPartial } from "./deep-partial.js";
|
|
14
|
+
export { input, output } from "./in-out.js";
|
|
12
15
|
export * as locales from "../locales/index.js";
|
|
13
16
|
export { ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration } from "./iso.js";
|
|
14
17
|
export * as iso from "./iso.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as core from "../core/index.js";
|
|
2
|
+
import * as schemas from "./schemas.js";
|
|
3
|
+
export type input<T> = core.input<T>;
|
|
4
|
+
export type output<T> = core.output<T>;
|
|
5
|
+
/** Returns a copy of the schema with every pipe replaced by its input side. A codec's checks are dropped: they constrain the decoded value the input side never produces. */
|
|
6
|
+
export declare function input<T extends core.$ZodType>(schema: T): schemas.ZodType<core.input<T>, core.input<T>>;
|
|
7
|
+
/** Returns a copy of the schema with every pipe replaced by its output side, carrying over the pipe's own checks. */
|
|
8
|
+
export declare function output<T extends core.$ZodType>(schema: T): schemas.ZodType<core.output<T>, core.output<T>>;
|
|
@@ -1,22 +1,7 @@
|
|
|
1
1
|
import * as core from "../core/index.js";
|
|
2
|
-
import
|
|
3
|
-
export
|
|
4
|
-
_zod: core.$ZodISODateTimeInternals;
|
|
5
|
-
}
|
|
6
|
-
export declare const ZodISODateTime: core.$constructor<ZodISODateTime>;
|
|
2
|
+
import { ZodISODate, ZodISODateTime, ZodISODuration, ZodISOTime } from "./schemas.js";
|
|
3
|
+
export { ZodISODate, ZodISODateTime, ZodISODuration, ZodISOTime } from "./schemas.js";
|
|
7
4
|
export declare function datetime(params?: string | core.$ZodISODateTimeParams): ZodISODateTime;
|
|
8
|
-
export interface ZodISODate extends schemas.ZodStringFormat {
|
|
9
|
-
_zod: core.$ZodISODateInternals;
|
|
10
|
-
}
|
|
11
|
-
export declare const ZodISODate: core.$constructor<ZodISODate>;
|
|
12
5
|
export declare function date(params?: string | core.$ZodISODateParams): ZodISODate;
|
|
13
|
-
export interface ZodISOTime extends schemas.ZodStringFormat {
|
|
14
|
-
_zod: core.$ZodISOTimeInternals;
|
|
15
|
-
}
|
|
16
|
-
export declare const ZodISOTime: core.$constructor<ZodISOTime>;
|
|
17
6
|
export declare function time(params?: string | core.$ZodISOTimeParams): ZodISOTime;
|
|
18
|
-
export interface ZodISODuration extends schemas.ZodStringFormat {
|
|
19
|
-
_zod: core.$ZodISODurationInternals;
|
|
20
|
-
}
|
|
21
|
-
export declare const ZodISODuration: core.$constructor<ZodISODuration>;
|
|
22
7
|
export declare function duration(params?: string | core.$ZodISODurationParams): ZodISODuration;
|
|
@@ -21,10 +21,23 @@ export declare const parseAsync: <T extends core.$ZodType>(schema: T, value: unk
|
|
|
21
21
|
}) => Promise<core.output<T>>;
|
|
22
22
|
export declare const safeParse: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>) => ZodSafeParseResult<core.output<T>>;
|
|
23
23
|
export declare const safeParseAsync: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<ZodSafeParseResult<core.output<T>>>;
|
|
24
|
-
export
|
|
25
|
-
export declare const
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
export { validate, validateAsync } from "../core/index.js";
|
|
25
|
+
export declare const encode: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: core.ParseContext<core.$ZodIssue>, _params?: {
|
|
26
|
+
callee?: core.util.AnyFunc;
|
|
27
|
+
Err?: core.$ZodErrorClass;
|
|
28
|
+
}) => core.input<T>;
|
|
29
|
+
export declare const decode: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: core.ParseContext<core.$ZodIssue>, _params?: {
|
|
30
|
+
callee?: core.util.AnyFunc;
|
|
31
|
+
Err?: core.$ZodErrorClass;
|
|
32
|
+
}) => core.output<T>;
|
|
33
|
+
export declare const encodeAsync: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: core.ParseContext<core.$ZodIssue>, _params?: {
|
|
34
|
+
callee?: core.util.AnyFunc;
|
|
35
|
+
Err?: core.$ZodErrorClass;
|
|
36
|
+
}) => Promise<core.input<T>>;
|
|
37
|
+
export declare const decodeAsync: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: core.ParseContext<core.$ZodIssue>, _params?: {
|
|
38
|
+
callee?: core.util.AnyFunc;
|
|
39
|
+
Err?: core.$ZodErrorClass;
|
|
40
|
+
}) => Promise<core.output<T>>;
|
|
28
41
|
export declare const safeEncode: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => ZodSafeParseResult<core.input<T>>;
|
|
29
42
|
export declare const safeDecode: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => ZodSafeParseResult<core.output<T>>;
|
|
30
43
|
export declare const safeEncodeAsync: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<ZodSafeParseResult<core.input<T>>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { $ZodBigIntFormats } from "../core/checks.js";
|
|
1
2
|
import * as core from "../core/index.js";
|
|
2
|
-
import { util } from "../core/index.js";
|
|
3
|
+
import { util, type $ZodNumberFormats } from "../core/index.js";
|
|
3
4
|
import type { StandardSchemaWithJSONProps } from "../core/standard-schema.js";
|
|
4
5
|
import * as parse from "./parse.js";
|
|
5
6
|
export type ZodStandardSchemaWithJSON<T> = StandardSchemaWithJSONProps<core.input<T>, core.output<T>>;
|
|
@@ -27,6 +28,8 @@ export interface ZodType<out Output = unknown, out Input = unknown, out Internal
|
|
|
27
28
|
parseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
|
|
28
29
|
safeParseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<parse.ZodSafeParseResult<core.output<this>>>;
|
|
29
30
|
spa: (data: unknown, params?: core.ParseContext<core.$ZodIssue>) => Promise<parse.ZodSafeParseResult<core.output<this>>>;
|
|
31
|
+
validate(data: unknown, params?: core.ParseContext<core.$ZodIssue>): data is core.input<this>;
|
|
32
|
+
validateAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<boolean>;
|
|
30
33
|
encode(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): core.input<this>;
|
|
31
34
|
decode(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
|
|
32
35
|
encodeAsync(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<core.input<this>>;
|
|
@@ -79,7 +82,7 @@ export interface ZodType<out Output = unknown, out Input = unknown, out Internal
|
|
|
79
82
|
* ```
|
|
80
83
|
*/
|
|
81
84
|
isNullable(): boolean;
|
|
82
|
-
apply<T>(fn: (schema: this) => T): T;
|
|
85
|
+
apply<T, TArgs extends unknown[] = []>(fn: (schema: this, ...args: TArgs) => T, ...args: TArgs): T;
|
|
83
86
|
}
|
|
84
87
|
export interface _ZodType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals> extends ZodType<any, any, Internals> {
|
|
85
88
|
}
|
|
@@ -172,6 +175,22 @@ export declare function string<T extends string>(params?: string | core.$ZodStri
|
|
|
172
175
|
export interface ZodStringFormat<Format extends string = string> extends _ZodString<core.$ZodStringFormatInternals<Format>> {
|
|
173
176
|
}
|
|
174
177
|
export declare const ZodStringFormat: core.$constructor<ZodStringFormat>;
|
|
178
|
+
export interface ZodISODateTime extends ZodStringFormat {
|
|
179
|
+
_zod: core.$ZodISODateTimeInternals;
|
|
180
|
+
}
|
|
181
|
+
export declare const ZodISODateTime: core.$constructor<ZodISODateTime>;
|
|
182
|
+
export interface ZodISODate extends ZodStringFormat {
|
|
183
|
+
_zod: core.$ZodISODateInternals;
|
|
184
|
+
}
|
|
185
|
+
export declare const ZodISODate: core.$constructor<ZodISODate>;
|
|
186
|
+
export interface ZodISOTime extends ZodStringFormat {
|
|
187
|
+
_zod: core.$ZodISOTimeInternals;
|
|
188
|
+
}
|
|
189
|
+
export declare const ZodISOTime: core.$constructor<ZodISOTime>;
|
|
190
|
+
export interface ZodISODuration extends ZodStringFormat {
|
|
191
|
+
_zod: core.$ZodISODurationInternals;
|
|
192
|
+
}
|
|
193
|
+
export declare const ZodISODuration: core.$constructor<ZodISODuration>;
|
|
175
194
|
export interface ZodEmail extends ZodStringFormat<"email"> {
|
|
176
195
|
_zod: core.$ZodEmailInternals;
|
|
177
196
|
}
|
|
@@ -288,6 +307,16 @@ export interface ZodE164 extends ZodStringFormat<"e164"> {
|
|
|
288
307
|
}
|
|
289
308
|
export declare const ZodE164: core.$constructor<ZodE164>;
|
|
290
309
|
export declare function e164(params?: string | core.$ZodE164Params): ZodE164;
|
|
310
|
+
export interface ZodCreditCard extends ZodStringFormat<"credit_card"> {
|
|
311
|
+
_zod: core.$ZodCreditCardInternals;
|
|
312
|
+
}
|
|
313
|
+
export declare const ZodCreditCard: core.$constructor<ZodCreditCard>;
|
|
314
|
+
export declare function creditCard(params?: string | core.$ZodCreditCardParams): ZodCreditCard;
|
|
315
|
+
export interface ZodIBAN extends ZodStringFormat<"iban"> {
|
|
316
|
+
_zod: core.$ZodIBANInternals;
|
|
317
|
+
}
|
|
318
|
+
export declare const ZodIBAN: core.$constructor<ZodIBAN>;
|
|
319
|
+
export declare function iban(params?: string | core.$ZodIBANParams): ZodIBAN;
|
|
291
320
|
export interface ZodJWT extends ZodStringFormat<"jwt"> {
|
|
292
321
|
_zod: core.$ZodJWTInternals;
|
|
293
322
|
}
|
|
@@ -301,6 +330,7 @@ export declare const ZodCustomStringFormat: core.$constructor<ZodCustomStringFor
|
|
|
301
330
|
export declare function stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp, _params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<Format>;
|
|
302
331
|
export declare function hostname(_params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<"hostname">;
|
|
303
332
|
export declare function hex(_params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<"hex">;
|
|
333
|
+
export declare function currencyCode(_params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<"currency_code">;
|
|
304
334
|
export declare function hash<Alg extends util.HashAlgorithm, Enc extends util.HashEncoding = "hex">(alg: Alg, params?: {
|
|
305
335
|
enc?: Enc;
|
|
306
336
|
} & core.$ZodStringFormatParams): ZodCustomStringFormat<`${Alg}_${Enc}`>;
|
|
@@ -338,23 +368,23 @@ export interface ZodNumber extends _ZodNumber<core.$ZodNumberInternals<number>>
|
|
|
338
368
|
}
|
|
339
369
|
export declare const ZodNumber: core.$constructor<ZodNumber>;
|
|
340
370
|
export declare function number(params?: string | core.$ZodNumberParams): ZodNumber;
|
|
341
|
-
export interface ZodNumberFormat extends ZodNumber {
|
|
342
|
-
_zod: core.$ZodNumberFormatInternals
|
|
371
|
+
export interface ZodNumberFormat<Format extends $ZodNumberFormats = $ZodNumberFormats> extends ZodNumber {
|
|
372
|
+
_zod: core.$ZodNumberFormatInternals<Format>;
|
|
343
373
|
}
|
|
344
374
|
export declare const ZodNumberFormat: core.$constructor<ZodNumberFormat>;
|
|
345
|
-
export interface ZodInt extends ZodNumberFormat {
|
|
375
|
+
export interface ZodInt extends ZodNumberFormat<"safeint"> {
|
|
346
376
|
}
|
|
347
377
|
export declare function int(params?: string | core.$ZodCheckNumberFormatParams): ZodInt;
|
|
348
|
-
export interface ZodFloat32 extends ZodNumberFormat {
|
|
378
|
+
export interface ZodFloat32 extends ZodNumberFormat<"float32"> {
|
|
349
379
|
}
|
|
350
380
|
export declare function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat32;
|
|
351
|
-
export interface ZodFloat64 extends ZodNumberFormat {
|
|
381
|
+
export interface ZodFloat64 extends ZodNumberFormat<"float64"> {
|
|
352
382
|
}
|
|
353
383
|
export declare function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat64;
|
|
354
|
-
export interface ZodInt32 extends ZodNumberFormat {
|
|
384
|
+
export interface ZodInt32 extends ZodNumberFormat<"int32"> {
|
|
355
385
|
}
|
|
356
386
|
export declare function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodInt32;
|
|
357
|
-
export interface ZodUInt32 extends ZodNumberFormat {
|
|
387
|
+
export interface ZodUInt32 extends ZodNumberFormat<"uint32"> {
|
|
358
388
|
}
|
|
359
389
|
export declare function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodUInt32;
|
|
360
390
|
export interface _ZodBoolean<T extends core.$ZodBooleanInternals = core.$ZodBooleanInternals> extends _ZodType<T> {
|
|
@@ -385,12 +415,16 @@ export interface ZodBigInt extends _ZodBigInt<core.$ZodBigIntInternals<bigint>>
|
|
|
385
415
|
}
|
|
386
416
|
export declare const ZodBigInt: core.$constructor<ZodBigInt>;
|
|
387
417
|
export declare function bigint(params?: string | core.$ZodBigIntParams): ZodBigInt;
|
|
388
|
-
export interface ZodBigIntFormat extends ZodBigInt {
|
|
389
|
-
_zod: core.$ZodBigIntFormatInternals
|
|
418
|
+
export interface ZodBigIntFormat<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends ZodBigInt {
|
|
419
|
+
_zod: core.$ZodBigIntFormatInternals<Format>;
|
|
390
420
|
}
|
|
391
421
|
export declare const ZodBigIntFormat: core.$constructor<ZodBigIntFormat>;
|
|
392
|
-
export
|
|
393
|
-
|
|
422
|
+
export interface ZodInt64 extends ZodBigIntFormat<"int64"> {
|
|
423
|
+
}
|
|
424
|
+
export declare function int64(params?: string | core.$ZodBigIntFormatParams): ZodInt64;
|
|
425
|
+
export interface ZodUInt64 extends ZodBigIntFormat<"uint64"> {
|
|
426
|
+
}
|
|
427
|
+
export declare function uint64(params?: string | core.$ZodBigIntFormatParams): ZodUInt64;
|
|
394
428
|
export interface ZodSymbol extends _ZodType<core.$ZodSymbolInternals> {
|
|
395
429
|
}
|
|
396
430
|
export declare const ZodSymbol: core.$constructor<ZodSymbol>;
|
|
@@ -479,6 +513,12 @@ out Shape extends core.$ZodShape = core.$ZodLooseShape, out Config extends core.
|
|
|
479
513
|
partial<M extends util.Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{
|
|
480
514
|
-readonly [k in keyof Shape]: k extends keyof M ? ZodOptional<Shape[k]> : Shape[k];
|
|
481
515
|
}, Config>;
|
|
516
|
+
exactPartial(): ZodObject<{
|
|
517
|
+
-readonly [k in keyof Shape]: ZodExactOptional<Shape[k]>;
|
|
518
|
+
}, Config>;
|
|
519
|
+
exactPartial<M extends util.Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{
|
|
520
|
+
-readonly [k in keyof Shape]: k extends keyof M ? ZodExactOptional<Shape[k]> : Shape[k];
|
|
521
|
+
}, Config>;
|
|
482
522
|
required(): ZodObject<{
|
|
483
523
|
-readonly [k in keyof Shape]: ZodNonOptional<Shape[k]>;
|
|
484
524
|
}, Config>;
|
|
@@ -511,7 +551,7 @@ export interface ZodDiscriminatedUnion<Options extends readonly core.SomeType[]
|
|
|
511
551
|
def: core.$ZodDiscriminatedUnionDef<Options, Disc>;
|
|
512
552
|
}
|
|
513
553
|
export declare const ZodDiscriminatedUnion: core.$constructor<ZodDiscriminatedUnion>;
|
|
514
|
-
export declare function discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable
|
|
554
|
+
export declare function discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]], Disc extends string>(discriminator: Disc, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): ZodDiscriminatedUnion<Types, Disc>;
|
|
515
555
|
export interface ZodIntersection<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodIntersectionInternals<A, B>>, core.$ZodIntersection<A, B> {
|
|
516
556
|
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
517
557
|
}
|
|
@@ -520,6 +560,9 @@ export declare function intersection<T extends core.SomeType, U extends core.Som
|
|
|
520
560
|
export interface ZodTuple<T extends util.TupleItems = readonly core.$ZodType[], Rest extends core.SomeType | null = core.$ZodType | null> extends _ZodType<core.$ZodTupleInternals<T, Rest>>, core.$ZodTuple<T, Rest> {
|
|
521
561
|
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
522
562
|
rest<Rest extends core.SomeType = core.$ZodType>(rest: Rest): ZodTuple<T, Rest>;
|
|
563
|
+
partial(): ZodTuple<{
|
|
564
|
+
-readonly [k in keyof T]: ZodOptional<T[k]>;
|
|
565
|
+
}, Rest>;
|
|
523
566
|
}
|
|
524
567
|
export declare const ZodTuple: core.$constructor<ZodTuple>;
|
|
525
568
|
export declare function tuple<T extends readonly [core.SomeType, ...core.SomeType[]]>(items: T, params?: string | core.$ZodTupleParams): ZodTuple<T, null>;
|
|
@@ -674,10 +717,10 @@ export declare function codec<const A extends core.SomeType, B extends core.Some
|
|
|
674
717
|
encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
|
|
675
718
|
}): ZodCodec<A, B>;
|
|
676
719
|
export declare function invertCodec<A extends core.SomeType, B extends core.SomeType>(codec: ZodCodec<A, B>): ZodCodec<B, A>;
|
|
677
|
-
export interface ZodPreprocess<B extends core.SomeType = core.$ZodType> extends ZodPipe<core.$ZodTransform, B>, core.$ZodPreprocess<B> {
|
|
720
|
+
export interface ZodPreprocess<B extends core.SomeType = core.$ZodType, I = unknown> extends ZodPipe<core.$ZodTransform<unknown, I>, B>, core.$ZodPreprocess<B, I> {
|
|
678
721
|
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
679
|
-
_zod: core.$ZodPreprocessInternals<B>;
|
|
680
|
-
def: core.$ZodPreprocessDef<B>;
|
|
722
|
+
_zod: core.$ZodPreprocessInternals<B, I>;
|
|
723
|
+
def: core.$ZodPreprocessDef<B, I>;
|
|
681
724
|
}
|
|
682
725
|
export declare const ZodPreprocess: core.$constructor<ZodPreprocess>;
|
|
683
726
|
export interface ZodReadonly<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodReadonlyInternals<T>>, core.$ZodReadonly<T> {
|
|
@@ -744,7 +787,13 @@ export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx
|
|
|
744
787
|
export declare const describe: typeof core.describe;
|
|
745
788
|
export declare const meta: typeof core.meta;
|
|
746
789
|
type ZodInstanceOfParams = core.Params<ZodCustom, core.$ZodIssueCustom, "type" | "check" | "checks" | "fn" | "abort" | "error" | "params" | "path">;
|
|
747
|
-
|
|
790
|
+
export interface ZodInstanceOf<T = unknown> extends ZodCustom<T, T> {
|
|
791
|
+
properties<Shape extends {
|
|
792
|
+
[k in keyof T as T[k] extends Function ? never : k]?: core.$ZodType<unknown, T[k]>;
|
|
793
|
+
}>(shape: Shape, params?: string | core.$ZodCheckPropertiesParams): ZodInstanceOf<T & core.$InferObjectInput<Shape, {}>>;
|
|
794
|
+
}
|
|
795
|
+
export declare const ZodInstanceOf: core.$constructor<ZodInstanceOf>;
|
|
796
|
+
declare function _instanceof<T extends typeof util.Class>(cls: T, params?: ZodInstanceOfParams): ZodInstanceOf<InstanceType<T>>;
|
|
748
797
|
export { _instanceof as instanceof };
|
|
749
798
|
export declare const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodCodec<ZodString, ZodBoolean>;
|
|
750
799
|
type _ZodJSONSchema = ZodUnion<[
|
|
@@ -764,4 +813,4 @@ export interface ZodJSONSchema extends _ZodJSONSchema {
|
|
|
764
813
|
_zod: ZodJSONSchemaInternals;
|
|
765
814
|
}
|
|
766
815
|
export declare function json(params?: string | core.$ZodCustomParams): ZodJSONSchema;
|
|
767
|
-
export declare function preprocess<A, U extends core.SomeType, B = unknown>(fn: (arg: B, ctx: core.$RefinementCtx) => A, schema: U): ZodPreprocess<U>;
|
|
816
|
+
export declare function preprocess<A, U extends core.SomeType, B = unknown>(fn: (arg: B, ctx: core.$RefinementCtx) => A, schema: U): ZodPreprocess<U, B>;
|
|
@@ -17,7 +17,9 @@ AlsoOmit extends Exclude<keyof T["_zod"]["def"], "check" | "error"> = never> = P
|
|
|
17
17
|
export type StringFormatParams<T extends schemas.$ZodStringFormat = schemas.$ZodStringFormat, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "coerce" | "checks" | "error" | "check" | "format"> = never> = Params<T, NonNullable<T["_zod"]["isst"] | T["_zod"]["issc"]>, "type" | "coerce" | "checks" | "error" | "check" | "format" | AlsoOmit>;
|
|
18
18
|
export type CheckStringFormatParams<T extends schemas.$ZodStringFormat = schemas.$ZodStringFormat, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "coerce" | "checks" | "error" | "check" | "format"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "type" | "coerce" | "checks" | "error" | "check" | "format" | AlsoOmit>;
|
|
19
19
|
export type CheckTypeParams<T extends schemas.$ZodType & checks.$ZodCheck = schemas.$ZodType & checks.$ZodCheck, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error" | "check"> = never> = Params<T, NonNullable<T["_zod"]["isst"] | T["_zod"]["issc"]>, "type" | "checks" | "error" | "check" | AlsoOmit>;
|
|
20
|
-
export type $ZodStringParams = TypeParams<schemas.$ZodString<string>, "coerce"
|
|
20
|
+
export type $ZodStringParams = TypeParams<schemas.$ZodString<string>, "coerce"> & {
|
|
21
|
+
checks?: readonly checks.$ZodCheck<string>[];
|
|
22
|
+
};
|
|
21
23
|
export declare function _string<T extends schemas.$ZodString>(Class: util.SchemaClass<T>, params?: string | $ZodStringParams): T;
|
|
22
24
|
export declare function _coercedString<T extends schemas.$ZodString>(Class: util.SchemaClass<T>, params?: string | $ZodStringParams): T;
|
|
23
25
|
export type $ZodStringFormatParams = CheckTypeParams<schemas.$ZodStringFormat, "format" | "coerce" | "when" | "pattern">;
|
|
@@ -46,8 +48,8 @@ export declare function _url<T extends schemas.$ZodURL>(Class: util.SchemaClass<
|
|
|
46
48
|
export type $ZodEmojiParams = StringFormatParams<schemas.$ZodEmoji, "when">;
|
|
47
49
|
export type $ZodCheckEmojiParams = CheckStringFormatParams<schemas.$ZodEmoji, "when">;
|
|
48
50
|
export declare function _emoji<T extends schemas.$ZodEmoji>(Class: util.SchemaClass<T>, params?: string | $ZodEmojiParams | $ZodCheckEmojiParams): T;
|
|
49
|
-
export type $ZodNanoIDParams = StringFormatParams<schemas.$ZodNanoID, "when">;
|
|
50
|
-
export type $ZodCheckNanoIDParams = CheckStringFormatParams<schemas.$ZodNanoID, "when">;
|
|
51
|
+
export type $ZodNanoIDParams = StringFormatParams<schemas.$ZodNanoID, "when" | "pattern">;
|
|
52
|
+
export type $ZodCheckNanoIDParams = CheckStringFormatParams<schemas.$ZodNanoID, "when" | "pattern">;
|
|
51
53
|
export declare function _nanoid<T extends schemas.$ZodNanoID>(Class: util.SchemaClass<T>, params?: string | $ZodNanoIDParams | $ZodCheckNanoIDParams): T;
|
|
52
54
|
/**
|
|
53
55
|
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
@@ -103,6 +105,12 @@ export declare function _base64url<T extends schemas.$ZodBase64URL>(Class: util.
|
|
|
103
105
|
export type $ZodE164Params = StringFormatParams<schemas.$ZodE164, "when">;
|
|
104
106
|
export type $ZodCheckE164Params = CheckStringFormatParams<schemas.$ZodE164, "when">;
|
|
105
107
|
export declare function _e164<T extends schemas.$ZodE164>(Class: util.SchemaClass<T>, params?: string | $ZodE164Params | $ZodCheckE164Params): T;
|
|
108
|
+
export type $ZodCreditCardParams = StringFormatParams<schemas.$ZodCreditCard, "pattern" | "when">;
|
|
109
|
+
export type $ZodCheckCreditCardParams = CheckStringFormatParams<schemas.$ZodCreditCard, "pattern" | "when">;
|
|
110
|
+
export declare function _creditCard<T extends schemas.$ZodCreditCard>(Class: util.SchemaClass<T>, params?: string | $ZodCreditCardParams | $ZodCheckCreditCardParams): T;
|
|
111
|
+
export type $ZodIBANParams = StringFormatParams<schemas.$ZodIBAN, "pattern" | "when">;
|
|
112
|
+
export type $ZodCheckIBANParams = CheckStringFormatParams<schemas.$ZodIBAN, "pattern" | "when">;
|
|
113
|
+
export declare function _iban<T extends schemas.$ZodIBAN>(Class: util.SchemaClass<T>, params?: string | $ZodIBANParams | $ZodCheckIBANParams): T;
|
|
106
114
|
export type $ZodJWTParams = StringFormatParams<schemas.$ZodJWT, "pattern" | "when">;
|
|
107
115
|
export type $ZodCheckJWTParams = CheckStringFormatParams<schemas.$ZodJWT, "pattern" | "when">;
|
|
108
116
|
export declare function _jwt<T extends schemas.$ZodJWT>(Class: util.SchemaClass<T>, params?: string | $ZodJWTParams | $ZodCheckJWTParams): T;
|
|
@@ -125,7 +133,9 @@ export declare function _isoTime<T extends schemas.$ZodISOTime>(Class: util.Sche
|
|
|
125
133
|
export type $ZodISODurationParams = StringFormatParams<schemas.$ZodISODuration, "when">;
|
|
126
134
|
export type $ZodCheckISODurationParams = CheckStringFormatParams<schemas.$ZodISODuration, "when">;
|
|
127
135
|
export declare function _isoDuration<T extends schemas.$ZodISODuration>(Class: util.SchemaClass<T>, params?: string | $ZodISODurationParams | $ZodCheckISODurationParams): T;
|
|
128
|
-
export type $ZodNumberParams = TypeParams<schemas.$ZodNumber<number>, "coerce"
|
|
136
|
+
export type $ZodNumberParams = TypeParams<schemas.$ZodNumber<number>, "coerce"> & {
|
|
137
|
+
checks?: readonly checks.$ZodCheck<number>[];
|
|
138
|
+
};
|
|
129
139
|
export type $ZodNumberFormatParams = CheckTypeParams<schemas.$ZodNumberFormat, "format" | "coerce">;
|
|
130
140
|
export type $ZodCheckNumberFormatParams = CheckParams<checks.$ZodCheckNumberFormat, "format" | "when">;
|
|
131
141
|
export declare function _number<T extends schemas.$ZodNumber>(Class: util.SchemaClass<T>, params?: string | $ZodNumberParams): T;
|
|
@@ -208,8 +218,10 @@ export type $ZodCheckEndsWithParams = CheckParams<checks.$ZodCheckEndsWith, "suf
|
|
|
208
218
|
export declare function _endsWith(suffix: string, params?: string | $ZodCheckEndsWithParams): checks.$ZodCheckEndsWith;
|
|
209
219
|
export type $ZodCheckPropertyParams = CheckParams<checks.$ZodCheckProperty, "property" | "schema" | "when">;
|
|
210
220
|
export declare function _property<K extends string, T extends schemas.$ZodType>(property: K, schema: T, params?: string | $ZodCheckPropertyParams): checks.$ZodCheckProperty<{
|
|
211
|
-
[k in K]: core.
|
|
221
|
+
[k in K]: util.Widen<core.input<T>>;
|
|
212
222
|
}>;
|
|
223
|
+
export type $ZodCheckPropertiesParams = CheckParams<checks.$ZodCheckProperties, "shape" | "when">;
|
|
224
|
+
export declare function _properties<Shape extends schemas.$ZodShape>(shape: Shape, params?: string | $ZodCheckPropertiesParams): checks.$ZodCheckProperties<Shape>;
|
|
213
225
|
export type $ZodCheckMimeTypeParams = CheckParams<checks.$ZodCheckMimeType, "mime" | "when">;
|
|
214
226
|
export declare function _mime(types: util.MimeTypes[], params?: string | $ZodCheckMimeTypeParams): checks.$ZodCheckMimeType;
|
|
215
227
|
export declare function _overwrite<T>(tx: (input: T) => T): checks.$ZodCheckOverwrite<T>;
|
|
@@ -225,22 +237,20 @@ export type $ZodUnionParams = TypeParams<schemas.$ZodUnion, "options">;
|
|
|
225
237
|
export declare function _union<const T extends readonly schemas.$ZodObject[]>(Class: util.SchemaClass<schemas.$ZodUnion>, options: T, params?: string | $ZodUnionParams): schemas.$ZodUnion<T>;
|
|
226
238
|
export type $ZodXorParams = TypeParams<schemas.$ZodXor, "options">;
|
|
227
239
|
export declare function _xor<const T extends readonly schemas.$ZodObject[]>(Class: util.SchemaClass<schemas.$ZodXor>, options: T, params?: string | $ZodXorParams): schemas.$ZodXor<T>;
|
|
228
|
-
export interface $ZodTypeDiscriminableInternals<
|
|
229
|
-
[K in Disc]?: unknown;
|
|
230
|
-
}> {
|
|
240
|
+
export interface $ZodTypeDiscriminableInternals<_Disc extends string = string> extends schemas._$ZodTypeInternals {
|
|
231
241
|
propValues: util.PropValues;
|
|
232
242
|
}
|
|
233
|
-
export interface $ZodTypeDiscriminable<
|
|
234
|
-
_zod: $ZodTypeDiscriminableInternals
|
|
243
|
+
export interface $ZodTypeDiscriminable<_Disc extends string = string> extends schemas.SomeType {
|
|
244
|
+
_zod: $ZodTypeDiscriminableInternals;
|
|
235
245
|
}
|
|
236
246
|
export type $ZodDiscriminatedUnionParams = TypeParams<schemas.$ZodDiscriminatedUnion, "options" | "discriminator">;
|
|
237
|
-
export declare function _discriminatedUnion<Types extends [$ZodTypeDiscriminable
|
|
247
|
+
export declare function _discriminatedUnion<Types extends [$ZodTypeDiscriminable, ...$ZodTypeDiscriminable[]], Disc extends string>(Class: util.SchemaClass<schemas.$ZodDiscriminatedUnion>, discriminator: Disc, options: Types, params?: string | $ZodDiscriminatedUnionParams): schemas.$ZodDiscriminatedUnion<Types, Disc>;
|
|
238
248
|
export type $ZodIntersectionParams = TypeParams<schemas.$ZodIntersection, "left" | "right">;
|
|
239
249
|
export declare function _intersection<T extends schemas.$ZodObject, U extends schemas.$ZodObject>(Class: util.SchemaClass<schemas.$ZodIntersection>, left: T, right: U): schemas.$ZodIntersection<T, U>;
|
|
240
250
|
export type $ZodTupleParams = TypeParams<schemas.$ZodTuple, "items" | "rest">;
|
|
241
251
|
export declare function _tuple<T extends readonly [schemas.$ZodType, ...schemas.$ZodType[]]>(Class: util.SchemaClass<schemas.$ZodTuple>, items: T, params?: string | $ZodTupleParams): schemas.$ZodTuple<T, null>;
|
|
242
252
|
export declare function _tuple<T extends readonly [schemas.$ZodType, ...schemas.$ZodType[]], Rest extends schemas.$ZodType>(Class: util.SchemaClass<schemas.$ZodTuple>, items: T, rest: Rest, params?: string | $ZodTupleParams): schemas.$ZodTuple<T, Rest>;
|
|
243
|
-
export type $ZodRecordParams = TypeParams<schemas.$ZodRecord, "keyType" | "valueType">;
|
|
253
|
+
export type $ZodRecordParams = TypeParams<schemas.$ZodRecord, "keyType" | "valueType" | "partial">;
|
|
244
254
|
export declare function _record<Key extends schemas.$ZodRecordKey, Value extends schemas.$ZodObject>(Class: util.SchemaClass<schemas.$ZodRecord>, keyType: Key, valueType: Value, params?: string | $ZodRecordParams): schemas.$ZodRecord<Key, Value>;
|
|
245
255
|
export type $ZodMapParams = TypeParams<schemas.$ZodMap, "keyType" | "valueType">;
|
|
246
256
|
export declare function _map<Key extends schemas.$ZodObject, Value extends schemas.$ZodObject>(Class: util.SchemaClass<schemas.$ZodMap>, keyType: Key, valueType: Value, params?: string | $ZodMapParams): schemas.$ZodMap<Key, Value>;
|
|
@@ -60,29 +60,29 @@ export interface $ZodCheckMultipleOf<T extends number | bigint = number | bigint
|
|
|
60
60
|
}
|
|
61
61
|
export declare const $ZodCheckMultipleOf: core.$constructor<$ZodCheckMultipleOf<number | bigint>>;
|
|
62
62
|
export type $ZodNumberFormats = "int32" | "uint32" | "float32" | "float64" | "safeint";
|
|
63
|
-
export interface $ZodCheckNumberFormatDef extends $ZodCheckDef {
|
|
63
|
+
export interface $ZodCheckNumberFormatDef<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodCheckDef {
|
|
64
64
|
check: "number_format";
|
|
65
|
-
format:
|
|
65
|
+
format: Format;
|
|
66
66
|
}
|
|
67
|
-
export interface $ZodCheckNumberFormatInternals extends $ZodCheckInternals<number> {
|
|
68
|
-
def: $ZodCheckNumberFormatDef
|
|
67
|
+
export interface $ZodCheckNumberFormatInternals<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodCheckInternals<number> {
|
|
68
|
+
def: $ZodCheckNumberFormatDef<Format>;
|
|
69
69
|
issc: errors.$ZodIssueInvalidType | errors.$ZodIssueTooBig<"number"> | errors.$ZodIssueTooSmall<"number">;
|
|
70
70
|
}
|
|
71
|
-
export interface $ZodCheckNumberFormat extends $ZodCheck<number> {
|
|
72
|
-
_zod: $ZodCheckNumberFormatInternals
|
|
71
|
+
export interface $ZodCheckNumberFormat<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodCheck<number> {
|
|
72
|
+
_zod: $ZodCheckNumberFormatInternals<Format>;
|
|
73
73
|
}
|
|
74
74
|
export declare const $ZodCheckNumberFormat: core.$constructor<$ZodCheckNumberFormat>;
|
|
75
75
|
export type $ZodBigIntFormats = "int64" | "uint64";
|
|
76
|
-
export interface $ZodCheckBigIntFormatDef extends $ZodCheckDef {
|
|
76
|
+
export interface $ZodCheckBigIntFormatDef<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends $ZodCheckDef {
|
|
77
77
|
check: "bigint_format";
|
|
78
|
-
format:
|
|
78
|
+
format: Format;
|
|
79
79
|
}
|
|
80
|
-
export interface $ZodCheckBigIntFormatInternals extends $ZodCheckInternals<bigint> {
|
|
81
|
-
def: $ZodCheckBigIntFormatDef
|
|
80
|
+
export interface $ZodCheckBigIntFormatInternals<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends $ZodCheckInternals<bigint> {
|
|
81
|
+
def: $ZodCheckBigIntFormatDef<Format>;
|
|
82
82
|
issc: errors.$ZodIssueTooBig<"bigint"> | errors.$ZodIssueTooSmall<"bigint">;
|
|
83
83
|
}
|
|
84
|
-
export interface $ZodCheckBigIntFormat extends $ZodCheck<bigint> {
|
|
85
|
-
_zod: $ZodCheckBigIntFormatInternals
|
|
84
|
+
export interface $ZodCheckBigIntFormat<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends $ZodCheck<bigint> {
|
|
85
|
+
_zod: $ZodCheckBigIntFormatInternals<Format>;
|
|
86
86
|
}
|
|
87
87
|
export declare const $ZodCheckBigIntFormat: core.$constructor<$ZodCheckBigIntFormat>;
|
|
88
88
|
export interface $ZodCheckMaxSizeDef extends $ZodCheckDef {
|
|
@@ -157,7 +157,7 @@ export interface $ZodCheckLengthEquals<T extends util.HasLength = util.HasLength
|
|
|
157
157
|
_zod: $ZodCheckLengthEqualsInternals<T>;
|
|
158
158
|
}
|
|
159
159
|
export declare const $ZodCheckLengthEquals: core.$constructor<$ZodCheckLengthEquals>;
|
|
160
|
-
export type $ZodStringFormats = "email" | "url" | "emoji" | "uuid" | "guid" | "nanoid" | "cuid" | "cuid2" | "ulid" | "xid" | "ksuid" | "datetime" | "date" | "time" | "duration" | "ipv4" | "ipv6" | "cidrv4" | "cidrv6" | "base64" | "base64url" | "json_string" | "e164" | "lowercase" | "uppercase" | "regex" | "jwt" | "starts_with" | "ends_with" | "includes";
|
|
160
|
+
export type $ZodStringFormats = "email" | "url" | "emoji" | "uuid" | "guid" | "nanoid" | "cuid" | "cuid2" | "ulid" | "xid" | "ksuid" | "datetime" | "date" | "time" | "duration" | "ipv4" | "ipv6" | "cidrv4" | "cidrv6" | "base64" | "base64url" | "json_string" | "e164" | "credit_card" | "iban" | "lowercase" | "uppercase" | "regex" | "jwt" | "starts_with" | "ends_with" | "includes";
|
|
161
161
|
export interface $ZodCheckStringFormatDef<Format extends string = string> extends $ZodCheckDef {
|
|
162
162
|
check: "string_format";
|
|
163
163
|
format: Format;
|
|
@@ -250,6 +250,22 @@ export interface $ZodCheckProperty<T extends object = object> extends $ZodCheck<
|
|
|
250
250
|
_zod: $ZodCheckPropertyInternals<T>;
|
|
251
251
|
}
|
|
252
252
|
export declare const $ZodCheckProperty: core.$constructor<$ZodCheckProperty>;
|
|
253
|
+
export interface $ZodCheckPropertiesDef<Shape extends schemas.$ZodShape = schemas.$ZodShape> extends $ZodCheckDef {
|
|
254
|
+
check: "properties";
|
|
255
|
+
shape: Shape;
|
|
256
|
+
}
|
|
257
|
+
export type $ZodCheckPropertiesInput<Shape extends schemas.$ZodShape = schemas.$ZodShape> = {
|
|
258
|
+
-readonly [k in keyof Shape]: util.Widen<core.input<Shape[k]>>;
|
|
259
|
+
};
|
|
260
|
+
export interface $ZodCheckPropertiesInternals<Shape extends schemas.$ZodShape = schemas.$ZodShape> extends $ZodCheckInternals<$ZodCheckPropertiesInput<Shape>> {
|
|
261
|
+
def: $ZodCheckPropertiesDef<Shape>;
|
|
262
|
+
issc: errors.$ZodIssue;
|
|
263
|
+
}
|
|
264
|
+
export interface $ZodCheckProperties<Shape extends schemas.$ZodShape = schemas.$ZodShape> extends $ZodCheck<$ZodCheckPropertiesInput<Shape>> {
|
|
265
|
+
_zod: $ZodCheckPropertiesInternals<Shape>;
|
|
266
|
+
[Symbol.iterator](): Iterator<this>;
|
|
267
|
+
}
|
|
268
|
+
export declare const $ZodCheckProperties: core.$constructor<$ZodCheckProperties>;
|
|
253
269
|
export interface $ZodCheckMimeTypeDef extends $ZodCheckDef {
|
|
254
270
|
check: "mime_type";
|
|
255
271
|
mime: util.MimeTypes[];
|