@x-otto/install 0.0.1-alpha.0
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/README.md +78 -0
- package/dist/index.d.ts +2428 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/package.json +39 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2428 @@
|
|
|
1
|
+
import { SkillDefinition } from "@x-otto/skill";
|
|
2
|
+
import { PluginManifest } from "@x-otto/plugin";
|
|
3
|
+
import { McpServerConfig } from "@x-otto/mcp";
|
|
4
|
+
|
|
5
|
+
//#region src/types.d.ts
|
|
6
|
+
/** postinstall 钩子执行结果(定义在 install 层,调用方注入 executor)。 */
|
|
7
|
+
interface PostInstallResult {
|
|
8
|
+
success: boolean;
|
|
9
|
+
error?: string;
|
|
10
|
+
exitCode?: number | null;
|
|
11
|
+
timeout?: boolean;
|
|
12
|
+
/** 执行的命令(供 CLI 日志)。 */
|
|
13
|
+
command?: string;
|
|
14
|
+
/** stderr 输出(供 CLI 日志)。 */
|
|
15
|
+
stderr?: string;
|
|
16
|
+
/** stdout/stderr 超 4KB 上限被截断。 */
|
|
17
|
+
truncated?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/** postinstall 钩子执行上下文。 */
|
|
20
|
+
interface PostInstallContext {
|
|
21
|
+
pluginDir: string;
|
|
22
|
+
pluginId: string;
|
|
23
|
+
workspaceDir?: string;
|
|
24
|
+
}
|
|
25
|
+
type ContentType = 'skill' | 'plugin' | 'mcp';
|
|
26
|
+
type SourceType = 'file' | 'url' | 'git' | 'npm';
|
|
27
|
+
/** 来源解析结果(RFC-131:+sourceUrl +sourceType +commit) */
|
|
28
|
+
interface ResolvedSource {
|
|
29
|
+
tempDir: string;
|
|
30
|
+
/** 来源 URL(已剥离认证信息,R8)。git→sanitized URL, url→sanitized HTTP, file→文件名, npm→npm:spec */
|
|
31
|
+
sourceUrl: string;
|
|
32
|
+
sourceType: SourceType;
|
|
33
|
+
/** Git commit hash (only for git source) */
|
|
34
|
+
commit?: string;
|
|
35
|
+
}
|
|
36
|
+
/** 安装来源元数据,写入 .otto-install.json */
|
|
37
|
+
interface InstallSourceMetadata {
|
|
38
|
+
sourceType: SourceType;
|
|
39
|
+
sourceUrl: string;
|
|
40
|
+
commit?: string;
|
|
41
|
+
/** 仓库内子路径(monorepo skill;repo root skill 为 undefined) */
|
|
42
|
+
subPath?: string;
|
|
43
|
+
installedAt: string;
|
|
44
|
+
/** 安装来源:'user'(手动CLI)/ 'auto'(自动化) */
|
|
45
|
+
installedBy?: string;
|
|
46
|
+
/** otto 版本号,用于调试兼容性问题 */
|
|
47
|
+
installerVersion?: string;
|
|
48
|
+
}
|
|
49
|
+
/** 安装进度阶段 */
|
|
50
|
+
type ProgressPhase = 'resolving' | 'detecting' | 'installing' | 'refreshing';
|
|
51
|
+
/** 安装进度回调参数 */
|
|
52
|
+
interface InstallProgress {
|
|
53
|
+
phase: ProgressPhase;
|
|
54
|
+
/** 人读摘要 */
|
|
55
|
+
message: string;
|
|
56
|
+
/** 当前步骤(1-based)——多 skill 场景的"第几个"计数语义 */
|
|
57
|
+
current?: number;
|
|
58
|
+
/** 总步骤数——多 skill 场景的"共几个"计数语义 */
|
|
59
|
+
total?: number;
|
|
60
|
+
/**
|
|
61
|
+
* 已下载字节数(RFC-224 D2;仅 url 来源下载阶段填充)。
|
|
62
|
+
* 与 `current`/`total` 语义互斥——两者不应在同一次 `onProgress` 调用中同时具备
|
|
63
|
+
* 冲突含义(`current`/`total` = 多 skill 计数,`bytesDownloaded`/`bytesTotal` =
|
|
64
|
+
* 单文件字节下载进度)。类型层面为 runtime covenant,非编译期强制。
|
|
65
|
+
*/
|
|
66
|
+
bytesDownloaded?: number;
|
|
67
|
+
/** 总字节数(`Content-Length` 缺失时为 `undefined`,消费方须降级为纯字节计数展示,
|
|
68
|
+
* 不得编造总数,见 RFC-224 R4)。 */
|
|
69
|
+
bytesTotal?: number;
|
|
70
|
+
}
|
|
71
|
+
interface InstallResult {
|
|
72
|
+
success: boolean;
|
|
73
|
+
/** 安装的名称 */
|
|
74
|
+
name?: string;
|
|
75
|
+
/** 安装目标路径 */
|
|
76
|
+
targetPath?: string;
|
|
77
|
+
/** 错误信息 */
|
|
78
|
+
error?: string;
|
|
79
|
+
/**
|
|
80
|
+
* 失败原因的**结构化分类**(RFC-290 D2)。
|
|
81
|
+
*
|
|
82
|
+
* `error` 是给人读的本地化文案,**不可**被消费方用子串匹配来判断失败类型——
|
|
83
|
+
* 文案会随 locale 与措辞变化,嗅探必然脆断。需要按失败类型分支(如 UI 层决定
|
|
84
|
+
* 是否提示 `--force`)时一律读本字段。
|
|
85
|
+
*
|
|
86
|
+
* `conflict` = 目标已存在且未加 `--force`。缺省表示未分类(消费方不得臆测)。
|
|
87
|
+
*/
|
|
88
|
+
failureKind?: 'conflict';
|
|
89
|
+
/** dry-run 时的预览计划,多行 */
|
|
90
|
+
plan?: string[];
|
|
91
|
+
/** skill 安装时的 SkillDefinition */
|
|
92
|
+
definition?: SkillDefinition;
|
|
93
|
+
/** plugin 安装时的 PluginManifest */
|
|
94
|
+
manifest?: PluginManifest;
|
|
95
|
+
/** mcp 安装时写入的 McpServerConfig */
|
|
96
|
+
mcpConfig?: McpServerConfig;
|
|
97
|
+
/** postinstall 钩子执行结果(RFC-080:仅当 manifest.scripts.postinstall 存在时) */
|
|
98
|
+
postinstall?: PostInstallResult;
|
|
99
|
+
/**
|
|
100
|
+
* plugin 安装时,manifest 声明但尚未被显式授予的高危能力(`HIGH_RISK_CAPABILITIES` 子集,
|
|
101
|
+
* 终局 review 2026-07-10 P0-1):`otto install <archive|url|git|npm>` 路径此前对高危能力
|
|
102
|
+
* 完全零感知——静默 `trustPlugin()` 却从不检查/展示/授予 provider/tools/tui.renderer/network
|
|
103
|
+
* 这类本质风险,与 `otto extension install` 的 `confirmHighRiskInstall`+`applyHighRiskGrant`
|
|
104
|
+
* 审计路径不对称。本字段只做「计算 + 呈现」,不自动授予(fail-closed 不变)——调用方
|
|
105
|
+
* (CLI handler)据此提示用户显式走 `/trust plugin <id>` 完成授权,装载侧 `pendingCapabilities`
|
|
106
|
+
* 门禁(RFC-140 D3)在授权前继续拦截这些能力的实际生效。
|
|
107
|
+
*/
|
|
108
|
+
pendingCapabilities?: string[];
|
|
109
|
+
/** 安装过程中的非致命警告(如信任持久化失败、postinstall 失败等) */
|
|
110
|
+
warnings?: string[];
|
|
111
|
+
/** 多 skill 安装时的子结果列表(RFC-130:--as skill 多结果时填充;单结果时为 undefined) */
|
|
112
|
+
results?: InstallResult[];
|
|
113
|
+
}
|
|
114
|
+
interface InstallOptions {
|
|
115
|
+
/** 项目工作目录(项目级安装时需要) */
|
|
116
|
+
workspaceDir?: string;
|
|
117
|
+
/** 安装到全局,默认项目级 */
|
|
118
|
+
global?: boolean;
|
|
119
|
+
/** 覆盖已有同名 */
|
|
120
|
+
force?: boolean;
|
|
121
|
+
/** 仅检测 + 预览 */
|
|
122
|
+
dryRun?: boolean;
|
|
123
|
+
/** 强制指定内容类型 */
|
|
124
|
+
as?: ContentType;
|
|
125
|
+
/** 强制指定来源类型 */
|
|
126
|
+
type?: SourceType;
|
|
127
|
+
/**
|
|
128
|
+
* 来源内子路径(RFC-201 D0/M0):git/归档来源解析后,把内容检测根从 tempDir 切到
|
|
129
|
+
* `tempDir/subPath`——monorepo 子目录插件(如本仓 extensions/plugin-weather)的安装
|
|
130
|
+
* 前提。路径必须是相对路径且解析后不得越出 tempDir(traversal 防御在 installer 执行)。
|
|
131
|
+
*/
|
|
132
|
+
subPath?: string;
|
|
133
|
+
/**
|
|
134
|
+
* git 来源的 tag 或 branch 名(RFC-221 D2/T221-2):仅 `type==='git'` 时生效,其余
|
|
135
|
+
* 来源类型忽略此字段。**不支持 commit hash**——spike 已验证主流 git 托管方默认拒绝
|
|
136
|
+
* fetch 任意 commit(只允许 ref tip)。缺省时行为不变(clone 默认分支 HEAD)。
|
|
137
|
+
*/
|
|
138
|
+
ref?: string;
|
|
139
|
+
/** MCP 环境变量 */
|
|
140
|
+
env?: Record<string, string>;
|
|
141
|
+
/** postinstall 钩子执行器(调用方注入,解耦 plugin-hooks 依赖)。
|
|
142
|
+
* 返回 PostInstallResult 或 Promise<PostInstallResult>(允许异步 spawn)。 */
|
|
143
|
+
postInstallExecutor?: (ctx: PostInstallContext, command: string) => PostInstallResult | Promise<PostInstallResult>;
|
|
144
|
+
/** 来源元数据(RFC-131:resolver 产出,installSkill/installPlugin 消费来写 .otto-install.json) */
|
|
145
|
+
sourceMetadata?: {
|
|
146
|
+
sourceType: SourceType;
|
|
147
|
+
sourceUrl: string;
|
|
148
|
+
commit?: string;
|
|
149
|
+
subPath?: string;
|
|
150
|
+
};
|
|
151
|
+
/** 安装进度回调(RFC-131;dry-run 时不触发) */
|
|
152
|
+
onProgress?: (p: InstallProgress) => void;
|
|
153
|
+
}
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region src/installer.d.ts
|
|
156
|
+
/**
|
|
157
|
+
* InstallManager — 安装编排器。
|
|
158
|
+
*
|
|
159
|
+
* 支持四种来源 × 三种内容类型。
|
|
160
|
+
* 来源:file(本地归档)、url(HTTP 下载)、git(浅克隆)、npm(npm pack)
|
|
161
|
+
* 内容:skill、plugin、mcp
|
|
162
|
+
*
|
|
163
|
+
* **阶段归属(RFC-286 D4)**:本类只负责 resolve / detect / write 三段,只 fire
|
|
164
|
+
* `resolving` / `detecting` / `installing`。**不再 fire `refreshing`**——该阶段语义是
|
|
165
|
+
* 「能力热重载」,真实动作 `App.reloadCapabilities()` 由 CLI 侧持有,install 包无 App
|
|
166
|
+
* 句柄(引入会造成 install → coding 反向依赖)。此前本类在真实 reload 之前自行 fire
|
|
167
|
+
* `refreshing`,是不拥有真实动作却展示真实阶段的「伪进度」,会让失败面板看起来仍在
|
|
168
|
+
* 刷新。谁执行谁上报:`refreshing` 现由 `handlers/install.ts` 在调用真实 reload 前 fire。
|
|
169
|
+
* `ProgressPhase` 类型保留 `'refreshing'` 取值供 CLI 使用。
|
|
170
|
+
*/
|
|
171
|
+
declare class InstallManager {
|
|
172
|
+
/**
|
|
173
|
+
* 通用安装入口:自动检测来源类型和内容类型。
|
|
174
|
+
*/
|
|
175
|
+
install(source: string, options: InstallOptions, getMcpSettings?: () => Record<string, unknown> | undefined, persistMcpSettings?: (servers: Record<string, unknown>) => Promise<void>): Promise<InstallResult>;
|
|
176
|
+
/**
|
|
177
|
+
* 安装 skill 包(兼容旧 API)。
|
|
178
|
+
*/
|
|
179
|
+
installSkill(source: string, options: InstallOptions): Promise<InstallResult>;
|
|
180
|
+
}
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/uninstaller.d.ts
|
|
183
|
+
type UninstallTarget = 'skill' | 'plugin' | 'mcp';
|
|
184
|
+
type InstallScope = 'global' | 'project' | 'repository';
|
|
185
|
+
interface UninstallResult {
|
|
186
|
+
success: boolean;
|
|
187
|
+
/** 卸载的扩展名称 */
|
|
188
|
+
name?: string;
|
|
189
|
+
/** 卸载的类型 */
|
|
190
|
+
type?: UninstallTarget;
|
|
191
|
+
/** 错误信息 */
|
|
192
|
+
error?: string;
|
|
193
|
+
/** dry-run 预览 */
|
|
194
|
+
plan?: string[];
|
|
195
|
+
}
|
|
196
|
+
interface InstalledItem {
|
|
197
|
+
name: string;
|
|
198
|
+
type: UninstallTarget;
|
|
199
|
+
scope: InstallScope;
|
|
200
|
+
/** mcp 详情(仅 type==='mcp') */
|
|
201
|
+
detail?: string;
|
|
202
|
+
}
|
|
203
|
+
interface ListInstalledOptions {
|
|
204
|
+
workspaceDir?: string;
|
|
205
|
+
/** 仓库根目录(含 pnpm-workspace.yaml),用于 repository scope 扫描。 */
|
|
206
|
+
workspaceRoot?: string;
|
|
207
|
+
/** 过滤:不传列出所有(global + project + repository),传 'global' 仅全局,传 'project' 仅项目,传 'repository' 仅仓库 */
|
|
208
|
+
scope?: InstallScope;
|
|
209
|
+
}
|
|
210
|
+
interface UninstallOptions {
|
|
211
|
+
workspaceDir?: string;
|
|
212
|
+
/** 仓库根目录(含 pnpm-workspace.yaml),用于 repository scope 卸载。 */
|
|
213
|
+
workspaceRoot?: string;
|
|
214
|
+
global?: boolean;
|
|
215
|
+
dryRun?: boolean;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* 检测给定名称的扩展类型。
|
|
219
|
+
* 按顺序检查:skill > plugin > mcp(skills/ 目录优先)。
|
|
220
|
+
*/
|
|
221
|
+
declare function detectUninstallTarget(name: string, options: UninstallOptions, mcpServers?: Record<string, unknown>): UninstallTarget | null;
|
|
222
|
+
/**
|
|
223
|
+
* 列出已安装的可卸载扩展(skill/plugin/mcp),支持按 scope 过滤。
|
|
224
|
+
* 不传 scope 时合并 global + project 列表。
|
|
225
|
+
*
|
|
226
|
+
* @param options workspaceDir + scope 过滤
|
|
227
|
+
* @param mcpServers 项目级 mcp_servers 配置(仅 project scope 时检查)
|
|
228
|
+
*/
|
|
229
|
+
declare function listInstalledItems(options: ListInstalledOptions, mcpServers?: Record<string, unknown>): InstalledItem[];
|
|
230
|
+
/**
|
|
231
|
+
* 卸载已安装的扩展。
|
|
232
|
+
*
|
|
233
|
+
* @param name 扩展名称
|
|
234
|
+
* @param type 扩展类型(由 detectUninstallTarget 提供)
|
|
235
|
+
* @param options 卸载选项
|
|
236
|
+
* @param mcpServers 当前 mcp_servers 配置(仅 mcp 类型需要)
|
|
237
|
+
* @param persistSettings 持久化 settings(仅 mcp 类型需要)
|
|
238
|
+
*/
|
|
239
|
+
declare function uninstall(name: string, type: UninstallTarget, options: UninstallOptions, getMcpServers?: () => Record<string, unknown> | undefined, persistSettings?: (servers: Record<string, unknown>) => Promise<void>): Promise<UninstallResult>;
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region src/upgrade-checker.d.ts
|
|
242
|
+
interface VersionInfo {
|
|
243
|
+
/** 扩展名称 */
|
|
244
|
+
name: string;
|
|
245
|
+
/** 扩展类型 */
|
|
246
|
+
type: 'skill' | 'plugin';
|
|
247
|
+
/** 已安装版本 */
|
|
248
|
+
installed: string;
|
|
249
|
+
/** 安装路径 */
|
|
250
|
+
path: string;
|
|
251
|
+
}
|
|
252
|
+
interface UpgradeCheckResult {
|
|
253
|
+
name: string;
|
|
254
|
+
type: 'skill' | 'plugin';
|
|
255
|
+
installed: string;
|
|
256
|
+
/** npm 最新版本(仅 npm 来源有效) */
|
|
257
|
+
latest?: string;
|
|
258
|
+
/** 是否有更新 */
|
|
259
|
+
newer?: boolean;
|
|
260
|
+
/** 错误(无法检查时) */
|
|
261
|
+
error?: string;
|
|
262
|
+
}
|
|
263
|
+
interface UpgradeCheckOptions {
|
|
264
|
+
workspaceDir?: string;
|
|
265
|
+
/** 仓库根目录(含 pnpm-workspace.yaml),用于 repository scope 扫描(RFC-130)。 */
|
|
266
|
+
workspaceRoot?: string;
|
|
267
|
+
/** 扫描范围:'all' | 'project' | 'repository' | 'global' */
|
|
268
|
+
scope?: 'all' | 'project' | 'repository' | 'global';
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* 扫描已安装的扩展,收集版本信息。
|
|
272
|
+
* 仅扫描有 version 字段的 skill/plugin,MCP 不适用。
|
|
273
|
+
*/
|
|
274
|
+
declare function scanInstalledVersions(options: UpgradeCheckOptions): VersionInfo[];
|
|
275
|
+
/**
|
|
276
|
+
* 对已安装扩展执行版本更新检查(通过 npm registry 或 git remote)。
|
|
277
|
+
*
|
|
278
|
+
* 路由依据(终局架构 review 2026-07-21):优先读安装时落盘的 `.otto-install.json`
|
|
279
|
+
* 真实 `sourceType`(RFC-131),而非用包名字符串形状猜测来源——名称启发式对
|
|
280
|
+
* "npm 包名恰好含 `.git`/`://`"等边缘场景会误判,且当来源元数据本就存在时完全
|
|
281
|
+
* 没必要重新猜测。仅当 `.otto-install.json` 缺失(如 RFC-131 之前的旧安装、或
|
|
282
|
+
* 手工放置的目录)才回退到 npm-first 的名称启发式(`isNpmPackageName`)。
|
|
283
|
+
*/
|
|
284
|
+
declare function checkUpgrades(installed: VersionInfo[]): Promise<UpgradeCheckResult[]>;
|
|
285
|
+
/** git 来源升级检查结果 */
|
|
286
|
+
interface GitUpgradeCheckResult {
|
|
287
|
+
name: string;
|
|
288
|
+
type: 'skill' | 'plugin';
|
|
289
|
+
sourceUrl: string;
|
|
290
|
+
installedCommit: string;
|
|
291
|
+
remoteCommit?: string;
|
|
292
|
+
newer?: boolean;
|
|
293
|
+
error?: string;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* 检查 git 来源 skill/plugin 是否有更新。
|
|
297
|
+
* 扫描 baseDir 下所有子目录的 .otto-install.json → git ls-remote → 比较 hash。
|
|
298
|
+
*/
|
|
299
|
+
declare function checkGitUpgrades(baseDir: string, type: 'skill' | 'plugin'): GitUpgradeCheckResult[];
|
|
300
|
+
//#endregion
|
|
301
|
+
//#region src/archive-utils.d.ts
|
|
302
|
+
/**
|
|
303
|
+
* 解压归档到目标目录。
|
|
304
|
+
* 异步执行(不阻塞事件循环),带 60s 超时。
|
|
305
|
+
*/
|
|
306
|
+
declare function extractArchive(archivePath: string, extractDir: string): Promise<void>;
|
|
307
|
+
/**
|
|
308
|
+
* 打包目录为 `.tar.gz` 归档(RFC-219 M4:`otto migrate export` 复用)。
|
|
309
|
+
*
|
|
310
|
+
* 与 `extractArchive` 对称——同样走系统 `tar`(不引入 node tar 依赖),异步执行 + 60s 超时。
|
|
311
|
+
* `sourceDir` 内的相对结构原样保留(`tar czf <out> -C <sourceDir> .`)。
|
|
312
|
+
*/
|
|
313
|
+
declare function createArchive(sourceDir: string, outputPath: string): Promise<void>;
|
|
314
|
+
/**
|
|
315
|
+
* 验证解压后的所有文件都在 extractDir 内,防止路径穿越攻击。
|
|
316
|
+
* 同时检查文件数量和总大小。
|
|
317
|
+
*
|
|
318
|
+
* 符号链接通过 realpathSync 解析真实路径后再做越界检查。
|
|
319
|
+
*
|
|
320
|
+
* @returns 解压后的总字节数(供归档炸弹检测使用)
|
|
321
|
+
*/
|
|
322
|
+
declare function validateExtractedPaths(extractDir: string): {
|
|
323
|
+
totalBytes: number;
|
|
324
|
+
};
|
|
325
|
+
/**
|
|
326
|
+
* 归档炸弹检测:比较归档文件压缩前/后的体积比。
|
|
327
|
+
* 解压后总大小 / 归档文件大小 > MAX_COMPRESSION_RATIO → 拒绝。
|
|
328
|
+
*/
|
|
329
|
+
declare function checkArchiveBomb(archivePath: string, totalExtractedBytes: number): void;
|
|
330
|
+
declare function createTempDir(): string;
|
|
331
|
+
declare function cleanTempDir(dir: string): void;
|
|
332
|
+
/**
|
|
333
|
+
* 剥离 URL 中的认证信息(user:password@),防止写入 .otto-install.json。
|
|
334
|
+
* RFC-131 R8:覆盖 git 和 url 来源。
|
|
335
|
+
*/
|
|
336
|
+
declare function sanitizeSourceUrl(raw: string): string;
|
|
337
|
+
//#endregion
|
|
338
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.cts
|
|
339
|
+
type _JSONSchema = boolean | JSONSchema;
|
|
340
|
+
type JSONSchema = {
|
|
341
|
+
[k: string]: unknown;
|
|
342
|
+
$schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
|
|
343
|
+
$id?: string;
|
|
344
|
+
$anchor?: string;
|
|
345
|
+
$ref?: string;
|
|
346
|
+
$dynamicRef?: string;
|
|
347
|
+
$dynamicAnchor?: string;
|
|
348
|
+
$vocabulary?: Record<string, boolean>;
|
|
349
|
+
$comment?: string;
|
|
350
|
+
$defs?: Record<string, JSONSchema>;
|
|
351
|
+
type?: "object" | "array" | "string" | "number" | "boolean" | "null" | "integer";
|
|
352
|
+
additionalItems?: _JSONSchema;
|
|
353
|
+
unevaluatedItems?: _JSONSchema;
|
|
354
|
+
prefixItems?: _JSONSchema[];
|
|
355
|
+
items?: _JSONSchema | _JSONSchema[];
|
|
356
|
+
contains?: _JSONSchema;
|
|
357
|
+
additionalProperties?: _JSONSchema;
|
|
358
|
+
unevaluatedProperties?: _JSONSchema;
|
|
359
|
+
properties?: Record<string, _JSONSchema>;
|
|
360
|
+
patternProperties?: Record<string, _JSONSchema>;
|
|
361
|
+
dependentSchemas?: Record<string, _JSONSchema>;
|
|
362
|
+
propertyNames?: _JSONSchema;
|
|
363
|
+
if?: _JSONSchema;
|
|
364
|
+
then?: _JSONSchema;
|
|
365
|
+
else?: _JSONSchema;
|
|
366
|
+
allOf?: JSONSchema[];
|
|
367
|
+
anyOf?: JSONSchema[];
|
|
368
|
+
oneOf?: JSONSchema[];
|
|
369
|
+
not?: _JSONSchema;
|
|
370
|
+
multipleOf?: number;
|
|
371
|
+
maximum?: number;
|
|
372
|
+
exclusiveMaximum?: number | boolean;
|
|
373
|
+
minimum?: number;
|
|
374
|
+
exclusiveMinimum?: number | boolean;
|
|
375
|
+
maxLength?: number;
|
|
376
|
+
minLength?: number;
|
|
377
|
+
pattern?: string;
|
|
378
|
+
maxItems?: number;
|
|
379
|
+
minItems?: number;
|
|
380
|
+
uniqueItems?: boolean;
|
|
381
|
+
maxContains?: number;
|
|
382
|
+
minContains?: number;
|
|
383
|
+
maxProperties?: number;
|
|
384
|
+
minProperties?: number;
|
|
385
|
+
required?: string[];
|
|
386
|
+
dependentRequired?: Record<string, string[]>;
|
|
387
|
+
enum?: Array<string | number | boolean | null>;
|
|
388
|
+
const?: string | number | boolean | null;
|
|
389
|
+
id?: string;
|
|
390
|
+
title?: string;
|
|
391
|
+
description?: string;
|
|
392
|
+
default?: unknown;
|
|
393
|
+
deprecated?: boolean;
|
|
394
|
+
readOnly?: boolean;
|
|
395
|
+
writeOnly?: boolean;
|
|
396
|
+
nullable?: boolean;
|
|
397
|
+
examples?: unknown[];
|
|
398
|
+
format?: string;
|
|
399
|
+
contentMediaType?: string;
|
|
400
|
+
contentEncoding?: string;
|
|
401
|
+
contentSchema?: JSONSchema;
|
|
402
|
+
_prefault?: unknown;
|
|
403
|
+
};
|
|
404
|
+
type BaseSchema = JSONSchema;
|
|
405
|
+
//#endregion
|
|
406
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.cts
|
|
407
|
+
/** The Standard interface. */
|
|
408
|
+
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
409
|
+
/** The Standard properties. */
|
|
410
|
+
readonly "~standard": StandardTypedV1.Props<Input, Output>;
|
|
411
|
+
}
|
|
412
|
+
declare namespace StandardTypedV1 {
|
|
413
|
+
/** The Standard properties interface. */
|
|
414
|
+
interface Props<Input = unknown, Output = Input> {
|
|
415
|
+
/** The version number of the standard. */
|
|
416
|
+
readonly version: 1;
|
|
417
|
+
/** The vendor name of the schema library. */
|
|
418
|
+
readonly vendor: string;
|
|
419
|
+
/** Inferred types associated with the schema. */
|
|
420
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
421
|
+
}
|
|
422
|
+
/** The Standard types interface. */
|
|
423
|
+
interface Types<Input = unknown, Output = Input> {
|
|
424
|
+
/** The input type of the schema. */
|
|
425
|
+
readonly input: Input;
|
|
426
|
+
/** The output type of the schema. */
|
|
427
|
+
readonly output: Output;
|
|
428
|
+
}
|
|
429
|
+
/** Infers the input type of a Standard. */
|
|
430
|
+
type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
431
|
+
/** Infers the output type of a Standard. */
|
|
432
|
+
type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
433
|
+
}
|
|
434
|
+
/** The Standard Schema interface. */
|
|
435
|
+
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
436
|
+
/** The Standard Schema properties. */
|
|
437
|
+
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
438
|
+
}
|
|
439
|
+
declare namespace StandardSchemaV1 {
|
|
440
|
+
/** The Standard Schema properties interface. */
|
|
441
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
442
|
+
/** Validates unknown input values. */
|
|
443
|
+
readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
|
|
444
|
+
}
|
|
445
|
+
/** The result interface of the validate function. */
|
|
446
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
447
|
+
/** The result interface if validation succeeds. */
|
|
448
|
+
interface SuccessResult<Output> {
|
|
449
|
+
/** The typed output value. */
|
|
450
|
+
readonly value: Output;
|
|
451
|
+
/** The absence of issues indicates success. */
|
|
452
|
+
readonly issues?: undefined;
|
|
453
|
+
}
|
|
454
|
+
interface Options {
|
|
455
|
+
/** Implicit support for additional vendor-specific parameters, if needed. */
|
|
456
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
457
|
+
}
|
|
458
|
+
/** The result interface if validation fails. */
|
|
459
|
+
interface FailureResult {
|
|
460
|
+
/** The issues of failed validation. */
|
|
461
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
462
|
+
}
|
|
463
|
+
/** The issue interface of the failure output. */
|
|
464
|
+
interface Issue {
|
|
465
|
+
/** The error message of the issue. */
|
|
466
|
+
readonly message: string;
|
|
467
|
+
/** The path of the issue, if any. */
|
|
468
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
469
|
+
}
|
|
470
|
+
/** The path segment interface of the issue. */
|
|
471
|
+
interface PathSegment {
|
|
472
|
+
/** The key representing a path segment. */
|
|
473
|
+
readonly key: PropertyKey;
|
|
474
|
+
}
|
|
475
|
+
/** The Standard types interface. */
|
|
476
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
|
|
477
|
+
/** Infers the input type of a Standard. */
|
|
478
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
479
|
+
/** Infers the output type of a Standard. */
|
|
480
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
481
|
+
}
|
|
482
|
+
/** The Standard JSON Schema interface. */
|
|
483
|
+
interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
|
|
484
|
+
/** The Standard JSON Schema properties. */
|
|
485
|
+
readonly "~standard": StandardJSONSchemaV1.Props<Input, Output>;
|
|
486
|
+
}
|
|
487
|
+
declare namespace StandardJSONSchemaV1 {
|
|
488
|
+
/** The Standard JSON Schema properties interface. */
|
|
489
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
490
|
+
/** Methods for generating the input/output JSON Schema. */
|
|
491
|
+
readonly jsonSchema: Converter;
|
|
492
|
+
}
|
|
493
|
+
/** The Standard JSON Schema converter interface. */
|
|
494
|
+
interface Converter {
|
|
495
|
+
/** Converts the input type to JSON Schema. May throw if conversion is not supported. */
|
|
496
|
+
readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
|
|
497
|
+
/** Converts the output type to JSON Schema. May throw if conversion is not supported. */
|
|
498
|
+
readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
|
|
499
|
+
}
|
|
500
|
+
/** The target version of the generated JSON Schema.
|
|
501
|
+
*
|
|
502
|
+
* It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use.
|
|
503
|
+
*
|
|
504
|
+
* The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`.
|
|
505
|
+
*
|
|
506
|
+
* All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.
|
|
507
|
+
*/
|
|
508
|
+
type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string);
|
|
509
|
+
/** The options for the input/output methods. */
|
|
510
|
+
interface Options {
|
|
511
|
+
/** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */
|
|
512
|
+
readonly target: Target;
|
|
513
|
+
/** Implicit support for additional vendor-specific parameters, if needed. */
|
|
514
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
515
|
+
}
|
|
516
|
+
/** The Standard types interface. */
|
|
517
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
|
|
518
|
+
/** Infers the input type of a Standard. */
|
|
519
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
520
|
+
/** Infers the output type of a Standard. */
|
|
521
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
522
|
+
}
|
|
523
|
+
interface StandardSchemaWithJSONProps<Input = unknown, Output = Input> extends StandardSchemaV1.Props<Input, Output>, StandardJSONSchemaV1.Props<Input, Output> {}
|
|
524
|
+
//#endregion
|
|
525
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.cts
|
|
526
|
+
declare const $output: unique symbol;
|
|
527
|
+
type $output = typeof $output;
|
|
528
|
+
declare const $input: unique symbol;
|
|
529
|
+
type $input = typeof $input;
|
|
530
|
+
type $replace<Meta, S extends $ZodType> = Meta extends $output ? output<S> : Meta extends $input ? input<S> : Meta extends (infer M)[] ? $replace<M, S>[] : Meta extends ((...args: infer P) => infer R) ? (...args: { [K in keyof P]: $replace<P[K], S> }) => $replace<R, S> : Meta extends object ? { [K in keyof Meta]: $replace<Meta[K], S> } : Meta;
|
|
531
|
+
type MetadataType = object | undefined;
|
|
532
|
+
declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {
|
|
533
|
+
_meta: Meta;
|
|
534
|
+
_schema: Schema;
|
|
535
|
+
_map: WeakMap<Schema, $replace<Meta, Schema>>;
|
|
536
|
+
_idmap: Map<string, Schema>;
|
|
537
|
+
add<S extends Schema>(schema: S, ..._meta: undefined extends Meta ? [$replace<Meta, S>?] : [$replace<Meta, S>]): this;
|
|
538
|
+
clear(): this;
|
|
539
|
+
remove(schema: Schema): this;
|
|
540
|
+
get<S extends Schema>(schema: S): $replace<Meta, S> | undefined;
|
|
541
|
+
has(schema: Schema): boolean;
|
|
542
|
+
}
|
|
543
|
+
interface JSONSchemaMeta {
|
|
544
|
+
id?: string | undefined;
|
|
545
|
+
title?: string | undefined;
|
|
546
|
+
description?: string | undefined;
|
|
547
|
+
deprecated?: boolean | undefined;
|
|
548
|
+
[k: string]: unknown;
|
|
549
|
+
}
|
|
550
|
+
interface GlobalMeta extends JSONSchemaMeta {}
|
|
551
|
+
//#endregion
|
|
552
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.cts
|
|
553
|
+
type Processor<T extends $ZodType = $ZodType> = (schema: T, ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void;
|
|
554
|
+
interface JSONSchemaGeneratorParams {
|
|
555
|
+
processors: Record<string, Processor>;
|
|
556
|
+
/** A registry used to look up metadata for each schema. Any schema with an `id` property will be extracted as a $def.
|
|
557
|
+
* @default globalRegistry */
|
|
558
|
+
metadata?: $ZodRegistry<Record<string, any>>;
|
|
559
|
+
/** The JSON Schema version to target.
|
|
560
|
+
* - `"draft-2020-12"` — Default. JSON Schema Draft 2020-12
|
|
561
|
+
* - `"draft-07"` — JSON Schema Draft 7
|
|
562
|
+
* - `"draft-04"` — JSON Schema Draft 4
|
|
563
|
+
* - `"openapi-3.0"` — OpenAPI 3.0 Schema Object */
|
|
564
|
+
target?: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string) | undefined;
|
|
565
|
+
/** How to handle unrepresentable types.
|
|
566
|
+
* - `"throw"` — Default. Unrepresentable types throw an error
|
|
567
|
+
* - `"any"` — Unrepresentable types become `{}` */
|
|
568
|
+
unrepresentable?: "throw" | "any";
|
|
569
|
+
/** Arbitrary custom logic that can be used to modify the generated JSON Schema. */
|
|
570
|
+
override?: (ctx: {
|
|
571
|
+
zodSchema: $ZodTypes;
|
|
572
|
+
jsonSchema: BaseSchema;
|
|
573
|
+
path: (string | number)[];
|
|
574
|
+
}) => void;
|
|
575
|
+
/** Whether to extract the `"input"` or `"output"` type. Relevant to transforms, defaults, coerced primitives, etc.
|
|
576
|
+
* - `"output"` — Default. Convert the output schema.
|
|
577
|
+
* - `"input"` — Convert the input schema. */
|
|
578
|
+
io?: "input" | "output";
|
|
579
|
+
cycles?: "ref" | "throw";
|
|
580
|
+
reused?: "ref" | "inline";
|
|
581
|
+
external?: {
|
|
582
|
+
registry: $ZodRegistry<{
|
|
583
|
+
id?: string | undefined;
|
|
584
|
+
}>;
|
|
585
|
+
uri?: ((id: string) => string) | undefined;
|
|
586
|
+
defs: Record<string, BaseSchema>;
|
|
587
|
+
} | undefined;
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Parameters for the toJSONSchema function.
|
|
591
|
+
*/
|
|
592
|
+
type ToJSONSchemaParams = Omit<JSONSchemaGeneratorParams, "processors" | "external">;
|
|
593
|
+
interface ProcessParams {
|
|
594
|
+
schemaPath: $ZodType[];
|
|
595
|
+
path: (string | number)[];
|
|
596
|
+
}
|
|
597
|
+
interface Seen {
|
|
598
|
+
/** JSON Schema result for this Zod schema */
|
|
599
|
+
schema: BaseSchema;
|
|
600
|
+
/** A cached version of the schema that doesn't get overwritten during ref resolution */
|
|
601
|
+
def?: BaseSchema;
|
|
602
|
+
defId?: string | undefined;
|
|
603
|
+
/** Number of times this schema was encountered during traversal */
|
|
604
|
+
count: number;
|
|
605
|
+
/** Cycle path */
|
|
606
|
+
cycle?: (string | number)[] | undefined;
|
|
607
|
+
isParent?: boolean | undefined;
|
|
608
|
+
/** Schema to inherit JSON Schema properties from (set by processor for wrappers) */
|
|
609
|
+
ref?: $ZodType | null;
|
|
610
|
+
/** JSON Schema property path for this schema */
|
|
611
|
+
path?: (string | number)[] | undefined;
|
|
612
|
+
}
|
|
613
|
+
interface ToJSONSchemaContext {
|
|
614
|
+
processors: Record<string, Processor>;
|
|
615
|
+
metadataRegistry: $ZodRegistry<Record<string, any>>;
|
|
616
|
+
target: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string);
|
|
617
|
+
unrepresentable: "throw" | "any";
|
|
618
|
+
override: (ctx: {
|
|
619
|
+
zodSchema: $ZodType;
|
|
620
|
+
jsonSchema: BaseSchema;
|
|
621
|
+
path: (string | number)[];
|
|
622
|
+
}) => void;
|
|
623
|
+
io: "input" | "output";
|
|
624
|
+
counter: number;
|
|
625
|
+
seen: Map<$ZodType, Seen>;
|
|
626
|
+
cycles: "ref" | "throw";
|
|
627
|
+
reused: "ref" | "inline";
|
|
628
|
+
external?: {
|
|
629
|
+
registry: $ZodRegistry<{
|
|
630
|
+
id?: string | undefined;
|
|
631
|
+
}>;
|
|
632
|
+
uri?: ((id: string) => string) | undefined;
|
|
633
|
+
defs: Record<string, BaseSchema>;
|
|
634
|
+
} | undefined;
|
|
635
|
+
}
|
|
636
|
+
type ZodStandardSchemaWithJSON$1<T> = StandardSchemaWithJSONProps<input<T>, output<T>>;
|
|
637
|
+
interface ZodStandardJSONSchemaPayload<T> extends BaseSchema {
|
|
638
|
+
"~standard": ZodStandardSchemaWithJSON$1<T>;
|
|
639
|
+
}
|
|
640
|
+
//#endregion
|
|
641
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.cts
|
|
642
|
+
type JWTAlgorithm = "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "EdDSA" | (string & {});
|
|
643
|
+
type MimeTypes = "application/json" | "application/xml" | "application/x-www-form-urlencoded" | "application/javascript" | "application/pdf" | "application/zip" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/octet-stream" | "application/graphql" | "text/html" | "text/plain" | "text/css" | "text/javascript" | "text/csv" | "image/png" | "image/jpeg" | "image/gif" | "image/svg+xml" | "image/webp" | "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "video/mp4" | "video/webm" | "video/ogg" | "font/woff" | "font/woff2" | "font/ttf" | "font/otf" | "multipart/form-data" | (string & {});
|
|
644
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
645
|
+
type Omit$1<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
646
|
+
type MakePartial<T, K extends keyof T> = Omit$1<T, K> & InexactPartial<Pick<T, K>>;
|
|
647
|
+
type NoUndefined<T> = T extends undefined ? never : T;
|
|
648
|
+
type LoosePartial<T extends object> = InexactPartial<T> & {
|
|
649
|
+
[k: string]: unknown;
|
|
650
|
+
};
|
|
651
|
+
type Mask<Keys extends PropertyKey> = { [K in Keys]?: true };
|
|
652
|
+
type InexactPartial<T> = { [P in keyof T]?: T[P] | undefined };
|
|
653
|
+
type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
|
|
654
|
+
readonly [Symbol.toStringTag]: string;
|
|
655
|
+
} | Date | Error | Generator | Promise<unknown> | RegExp;
|
|
656
|
+
type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
|
|
657
|
+
type SomeObject = Record<PropertyKey, any>;
|
|
658
|
+
type Identity<T> = T;
|
|
659
|
+
type Flatten<T> = Identity<{ [k in keyof T]: T[k] }>;
|
|
660
|
+
type Prettify<T> = { [K in keyof T]: T[K] } & {};
|
|
661
|
+
type Extend<A extends SomeObject, B extends SomeObject> = Flatten<keyof A & keyof B extends never ? A & B : { [K in keyof A as K extends keyof B ? never : K]: A[K] } & { [K in keyof B]: B[K] }>;
|
|
662
|
+
type TupleItems = ReadonlyArray<SomeType>;
|
|
663
|
+
type AnyFunc = (...args: any[]) => any;
|
|
664
|
+
type MaybeAsync<T> = T | Promise<T>;
|
|
665
|
+
type EnumValue = string | number;
|
|
666
|
+
type EnumLike = Readonly<Record<string, EnumValue>>;
|
|
667
|
+
type ToEnum<T extends EnumValue> = Flatten<{ [k in T]: k }>;
|
|
668
|
+
type Literal = string | number | bigint | boolean | null | undefined;
|
|
669
|
+
type Primitive = string | number | symbol | bigint | boolean | null | undefined;
|
|
670
|
+
type HasLength = {
|
|
671
|
+
length: number;
|
|
672
|
+
};
|
|
673
|
+
type PropValues = Record<string, Set<Primitive>>;
|
|
674
|
+
type PrimitiveSet = Set<Primitive>;
|
|
675
|
+
type EmptyToNever<T> = keyof T extends never ? never : T;
|
|
676
|
+
declare abstract class Class {
|
|
677
|
+
constructor(..._args: any[]);
|
|
678
|
+
}
|
|
679
|
+
//#endregion
|
|
680
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.cts
|
|
681
|
+
declare const version: {
|
|
682
|
+
readonly major: 4;
|
|
683
|
+
readonly minor: 3;
|
|
684
|
+
readonly patch: number;
|
|
685
|
+
};
|
|
686
|
+
//#endregion
|
|
687
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.cts
|
|
688
|
+
interface ParseContext<T extends $ZodIssueBase = never> {
|
|
689
|
+
/** Customize error messages. */
|
|
690
|
+
readonly error?: $ZodErrorMap<T>;
|
|
691
|
+
/** Include the `input` field in issue objects. Default `false`. */
|
|
692
|
+
readonly reportInput?: boolean;
|
|
693
|
+
/** Skip eval-based fast path. Default `false`. */
|
|
694
|
+
readonly jitless?: boolean;
|
|
695
|
+
}
|
|
696
|
+
/** @internal */
|
|
697
|
+
interface ParseContextInternal<T extends $ZodIssueBase = never> extends ParseContext<T> {
|
|
698
|
+
readonly async?: boolean | undefined;
|
|
699
|
+
readonly direction?: "forward" | "backward";
|
|
700
|
+
readonly skipChecks?: boolean;
|
|
701
|
+
}
|
|
702
|
+
interface ParsePayload<T = unknown> {
|
|
703
|
+
value: T;
|
|
704
|
+
issues: $ZodRawIssue[];
|
|
705
|
+
/** A may to mark a whole payload as aborted. Used in codecs/pipes. */
|
|
706
|
+
aborted?: boolean;
|
|
707
|
+
}
|
|
708
|
+
type CheckFn<T> = (input: ParsePayload<T>) => MaybeAsync<void>;
|
|
709
|
+
interface $ZodTypeDef {
|
|
710
|
+
type: "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "null" | "undefined" | "void" | "never" | "any" | "unknown" | "date" | "object" | "record" | "file" | "array" | "tuple" | "union" | "intersection" | "map" | "set" | "enum" | "literal" | "nullable" | "optional" | "nonoptional" | "success" | "transform" | "default" | "prefault" | "catch" | "nan" | "pipe" | "readonly" | "template_literal" | "promise" | "lazy" | "function" | "custom";
|
|
711
|
+
error?: $ZodErrorMap<never> | undefined;
|
|
712
|
+
checks?: $ZodCheck<never>[];
|
|
713
|
+
}
|
|
714
|
+
interface _$ZodTypeInternals {
|
|
715
|
+
/** The `@zod/core` version of this schema */
|
|
716
|
+
version: typeof version;
|
|
717
|
+
/** Schema definition. */
|
|
718
|
+
def: $ZodTypeDef;
|
|
719
|
+
/** @internal Randomly generated ID for this schema. */
|
|
720
|
+
/** @internal List of deferred initializers. */
|
|
721
|
+
deferred: AnyFunc[] | undefined;
|
|
722
|
+
/** @internal Parses input and runs all checks (refinements). */
|
|
723
|
+
run(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
|
|
724
|
+
/** @internal Parses input, doesn't run checks. */
|
|
725
|
+
parse(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
|
|
726
|
+
/** @internal Stores identifiers for the set of traits implemented by this schema. */
|
|
727
|
+
traits: Set<string>;
|
|
728
|
+
/** @internal Indicates that a schema output type should be considered optional inside objects.
|
|
729
|
+
* @default Required
|
|
730
|
+
*/
|
|
731
|
+
/** @internal */
|
|
732
|
+
optin?: "optional" | undefined;
|
|
733
|
+
/** @internal */
|
|
734
|
+
optout?: "optional" | undefined;
|
|
735
|
+
/** @internal The set of literal values that will pass validation. Must be an exhaustive set. Used to determine optionality in z.record().
|
|
736
|
+
*
|
|
737
|
+
* Defined on: enum, const, literal, null, undefined
|
|
738
|
+
* Passthrough: optional, nullable, branded, default, catch, pipe
|
|
739
|
+
* Todo: unions?
|
|
740
|
+
*/
|
|
741
|
+
values?: PrimitiveSet | undefined;
|
|
742
|
+
/** Default value bubbled up from */
|
|
743
|
+
/** @internal A set of literal discriminators used for the fast path in discriminated unions. */
|
|
744
|
+
propValues?: PropValues | undefined;
|
|
745
|
+
/** @internal This flag indicates that a schema validation can be represented with a regular expression. Used to determine allowable schemas in z.templateLiteral(). */
|
|
746
|
+
pattern: RegExp | undefined;
|
|
747
|
+
/** @internal The constructor function of this schema. */
|
|
748
|
+
constr: new (def: any) => $ZodType;
|
|
749
|
+
/** @internal A catchall object for bag metadata related to this schema. Commonly modified by checks using `onattach`. */
|
|
750
|
+
bag: Record<string, unknown>;
|
|
751
|
+
/** @internal The set of issues this schema might throw during type checking. */
|
|
752
|
+
isst: $ZodIssueBase;
|
|
753
|
+
/** @internal Subject to change, not a public API. */
|
|
754
|
+
processJSONSchema?: ((ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void) | undefined;
|
|
755
|
+
/** An optional method used to override `toJSONSchema` logic. */
|
|
756
|
+
toJSONSchema?: () => unknown;
|
|
757
|
+
/** @internal The parent of this schema. Only set during certain clone operations. */
|
|
758
|
+
parent?: $ZodType | undefined;
|
|
759
|
+
}
|
|
760
|
+
/** @internal */
|
|
761
|
+
interface $ZodTypeInternals<out O = unknown, out I = unknown> extends _$ZodTypeInternals {
|
|
762
|
+
/** @internal The inferred output type */
|
|
763
|
+
output: O;
|
|
764
|
+
/** @internal The inferred input type */
|
|
765
|
+
input: I;
|
|
766
|
+
}
|
|
767
|
+
type $ZodStandardSchema<T> = StandardSchemaV1.Props<input<T>, output<T>>;
|
|
768
|
+
type SomeType = {
|
|
769
|
+
_zod: _$ZodTypeInternals;
|
|
770
|
+
};
|
|
771
|
+
interface $ZodType<O = unknown, I = unknown, Internals extends $ZodTypeInternals<O, I> = $ZodTypeInternals<O, I>> {
|
|
772
|
+
_zod: Internals;
|
|
773
|
+
"~standard": $ZodStandardSchema<this>;
|
|
774
|
+
}
|
|
775
|
+
interface _$ZodType<T extends $ZodTypeInternals = $ZodTypeInternals> extends $ZodType<T["output"], T["input"], T> {}
|
|
776
|
+
declare const $ZodType: $constructor<$ZodType>;
|
|
777
|
+
interface $ZodStringDef extends $ZodTypeDef {
|
|
778
|
+
type: "string";
|
|
779
|
+
coerce?: boolean;
|
|
780
|
+
checks?: $ZodCheck<string>[];
|
|
781
|
+
}
|
|
782
|
+
interface $ZodStringInternals<Input> extends $ZodTypeInternals<string, Input> {
|
|
783
|
+
def: $ZodStringDef;
|
|
784
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
785
|
+
pattern: RegExp;
|
|
786
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
787
|
+
isst: $ZodIssueInvalidType;
|
|
788
|
+
bag: LoosePartial<{
|
|
789
|
+
minimum: number;
|
|
790
|
+
maximum: number;
|
|
791
|
+
patterns: Set<RegExp>;
|
|
792
|
+
format: string;
|
|
793
|
+
contentEncoding: string;
|
|
794
|
+
}>;
|
|
795
|
+
}
|
|
796
|
+
interface $ZodString<Input = unknown> extends _$ZodType<$ZodStringInternals<Input>> {}
|
|
797
|
+
declare const $ZodString: $constructor<$ZodString>;
|
|
798
|
+
interface $ZodStringFormatDef<Format extends string = string> extends $ZodStringDef, $ZodCheckStringFormatDef<Format> {}
|
|
799
|
+
interface $ZodStringFormatInternals<Format extends string = string> extends $ZodStringInternals<string>, $ZodCheckStringFormatInternals {
|
|
800
|
+
def: $ZodStringFormatDef<Format>;
|
|
801
|
+
}
|
|
802
|
+
interface $ZodStringFormat<Format extends string = string> extends $ZodType {
|
|
803
|
+
_zod: $ZodStringFormatInternals<Format>;
|
|
804
|
+
}
|
|
805
|
+
declare const $ZodStringFormat: $constructor<$ZodStringFormat>;
|
|
806
|
+
interface $ZodGUIDInternals extends $ZodStringFormatInternals<"guid"> {}
|
|
807
|
+
interface $ZodGUID extends $ZodType {
|
|
808
|
+
_zod: $ZodGUIDInternals;
|
|
809
|
+
}
|
|
810
|
+
declare const $ZodGUID: $constructor<$ZodGUID>;
|
|
811
|
+
interface $ZodUUIDDef extends $ZodStringFormatDef<"uuid"> {
|
|
812
|
+
version?: "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7" | "v8";
|
|
813
|
+
}
|
|
814
|
+
interface $ZodUUIDInternals extends $ZodStringFormatInternals<"uuid"> {
|
|
815
|
+
def: $ZodUUIDDef;
|
|
816
|
+
}
|
|
817
|
+
interface $ZodUUID extends $ZodType {
|
|
818
|
+
_zod: $ZodUUIDInternals;
|
|
819
|
+
}
|
|
820
|
+
declare const $ZodUUID: $constructor<$ZodUUID>;
|
|
821
|
+
interface $ZodEmailInternals extends $ZodStringFormatInternals<"email"> {}
|
|
822
|
+
interface $ZodEmail extends $ZodType {
|
|
823
|
+
_zod: $ZodEmailInternals;
|
|
824
|
+
}
|
|
825
|
+
declare const $ZodEmail: $constructor<$ZodEmail>;
|
|
826
|
+
interface $ZodURLDef extends $ZodStringFormatDef<"url"> {
|
|
827
|
+
hostname?: RegExp | undefined;
|
|
828
|
+
protocol?: RegExp | undefined;
|
|
829
|
+
normalize?: boolean | undefined;
|
|
830
|
+
}
|
|
831
|
+
interface $ZodURLInternals extends $ZodStringFormatInternals<"url"> {
|
|
832
|
+
def: $ZodURLDef;
|
|
833
|
+
}
|
|
834
|
+
interface $ZodURL extends $ZodType {
|
|
835
|
+
_zod: $ZodURLInternals;
|
|
836
|
+
}
|
|
837
|
+
declare const $ZodURL: $constructor<$ZodURL>;
|
|
838
|
+
interface $ZodEmojiInternals extends $ZodStringFormatInternals<"emoji"> {}
|
|
839
|
+
interface $ZodEmoji extends $ZodType {
|
|
840
|
+
_zod: $ZodEmojiInternals;
|
|
841
|
+
}
|
|
842
|
+
declare const $ZodEmoji: $constructor<$ZodEmoji>;
|
|
843
|
+
interface $ZodNanoIDInternals extends $ZodStringFormatInternals<"nanoid"> {}
|
|
844
|
+
interface $ZodNanoID extends $ZodType {
|
|
845
|
+
_zod: $ZodNanoIDInternals;
|
|
846
|
+
}
|
|
847
|
+
declare const $ZodNanoID: $constructor<$ZodNanoID>;
|
|
848
|
+
interface $ZodCUIDInternals extends $ZodStringFormatInternals<"cuid"> {}
|
|
849
|
+
interface $ZodCUID extends $ZodType {
|
|
850
|
+
_zod: $ZodCUIDInternals;
|
|
851
|
+
}
|
|
852
|
+
declare const $ZodCUID: $constructor<$ZodCUID>;
|
|
853
|
+
interface $ZodCUID2Internals extends $ZodStringFormatInternals<"cuid2"> {}
|
|
854
|
+
interface $ZodCUID2 extends $ZodType {
|
|
855
|
+
_zod: $ZodCUID2Internals;
|
|
856
|
+
}
|
|
857
|
+
declare const $ZodCUID2: $constructor<$ZodCUID2>;
|
|
858
|
+
interface $ZodULIDInternals extends $ZodStringFormatInternals<"ulid"> {}
|
|
859
|
+
interface $ZodULID extends $ZodType {
|
|
860
|
+
_zod: $ZodULIDInternals;
|
|
861
|
+
}
|
|
862
|
+
declare const $ZodULID: $constructor<$ZodULID>;
|
|
863
|
+
interface $ZodXIDInternals extends $ZodStringFormatInternals<"xid"> {}
|
|
864
|
+
interface $ZodXID extends $ZodType {
|
|
865
|
+
_zod: $ZodXIDInternals;
|
|
866
|
+
}
|
|
867
|
+
declare const $ZodXID: $constructor<$ZodXID>;
|
|
868
|
+
interface $ZodKSUIDInternals extends $ZodStringFormatInternals<"ksuid"> {}
|
|
869
|
+
interface $ZodKSUID extends $ZodType {
|
|
870
|
+
_zod: $ZodKSUIDInternals;
|
|
871
|
+
}
|
|
872
|
+
declare const $ZodKSUID: $constructor<$ZodKSUID>;
|
|
873
|
+
interface $ZodISODateTimeDef extends $ZodStringFormatDef<"datetime"> {
|
|
874
|
+
precision: number | null;
|
|
875
|
+
offset: boolean;
|
|
876
|
+
local: boolean;
|
|
877
|
+
}
|
|
878
|
+
interface $ZodISODateTimeInternals extends $ZodStringFormatInternals {
|
|
879
|
+
def: $ZodISODateTimeDef;
|
|
880
|
+
}
|
|
881
|
+
interface $ZodISODateTime extends $ZodType {
|
|
882
|
+
_zod: $ZodISODateTimeInternals;
|
|
883
|
+
}
|
|
884
|
+
declare const $ZodISODateTime: $constructor<$ZodISODateTime>;
|
|
885
|
+
interface $ZodISODateInternals extends $ZodStringFormatInternals<"date"> {}
|
|
886
|
+
interface $ZodISODate extends $ZodType {
|
|
887
|
+
_zod: $ZodISODateInternals;
|
|
888
|
+
}
|
|
889
|
+
declare const $ZodISODate: $constructor<$ZodISODate>;
|
|
890
|
+
interface $ZodISOTimeDef extends $ZodStringFormatDef<"time"> {
|
|
891
|
+
precision?: number | null;
|
|
892
|
+
}
|
|
893
|
+
interface $ZodISOTimeInternals extends $ZodStringFormatInternals<"time"> {
|
|
894
|
+
def: $ZodISOTimeDef;
|
|
895
|
+
}
|
|
896
|
+
interface $ZodISOTime extends $ZodType {
|
|
897
|
+
_zod: $ZodISOTimeInternals;
|
|
898
|
+
}
|
|
899
|
+
declare const $ZodISOTime: $constructor<$ZodISOTime>;
|
|
900
|
+
interface $ZodISODurationInternals extends $ZodStringFormatInternals<"duration"> {}
|
|
901
|
+
interface $ZodISODuration extends $ZodType {
|
|
902
|
+
_zod: $ZodISODurationInternals;
|
|
903
|
+
}
|
|
904
|
+
declare const $ZodISODuration: $constructor<$ZodISODuration>;
|
|
905
|
+
interface $ZodIPv4Def extends $ZodStringFormatDef<"ipv4"> {
|
|
906
|
+
version?: "v4";
|
|
907
|
+
}
|
|
908
|
+
interface $ZodIPv4Internals extends $ZodStringFormatInternals<"ipv4"> {
|
|
909
|
+
def: $ZodIPv4Def;
|
|
910
|
+
}
|
|
911
|
+
interface $ZodIPv4 extends $ZodType {
|
|
912
|
+
_zod: $ZodIPv4Internals;
|
|
913
|
+
}
|
|
914
|
+
declare const $ZodIPv4: $constructor<$ZodIPv4>;
|
|
915
|
+
interface $ZodIPv6Def extends $ZodStringFormatDef<"ipv6"> {
|
|
916
|
+
version?: "v6";
|
|
917
|
+
}
|
|
918
|
+
interface $ZodIPv6Internals extends $ZodStringFormatInternals<"ipv6"> {
|
|
919
|
+
def: $ZodIPv6Def;
|
|
920
|
+
}
|
|
921
|
+
interface $ZodIPv6 extends $ZodType {
|
|
922
|
+
_zod: $ZodIPv6Internals;
|
|
923
|
+
}
|
|
924
|
+
declare const $ZodIPv6: $constructor<$ZodIPv6>;
|
|
925
|
+
interface $ZodCIDRv4Def extends $ZodStringFormatDef<"cidrv4"> {
|
|
926
|
+
version?: "v4";
|
|
927
|
+
}
|
|
928
|
+
interface $ZodCIDRv4Internals extends $ZodStringFormatInternals<"cidrv4"> {
|
|
929
|
+
def: $ZodCIDRv4Def;
|
|
930
|
+
}
|
|
931
|
+
interface $ZodCIDRv4 extends $ZodType {
|
|
932
|
+
_zod: $ZodCIDRv4Internals;
|
|
933
|
+
}
|
|
934
|
+
declare const $ZodCIDRv4: $constructor<$ZodCIDRv4>;
|
|
935
|
+
interface $ZodCIDRv6Def extends $ZodStringFormatDef<"cidrv6"> {
|
|
936
|
+
version?: "v6";
|
|
937
|
+
}
|
|
938
|
+
interface $ZodCIDRv6Internals extends $ZodStringFormatInternals<"cidrv6"> {
|
|
939
|
+
def: $ZodCIDRv6Def;
|
|
940
|
+
}
|
|
941
|
+
interface $ZodCIDRv6 extends $ZodType {
|
|
942
|
+
_zod: $ZodCIDRv6Internals;
|
|
943
|
+
}
|
|
944
|
+
declare const $ZodCIDRv6: $constructor<$ZodCIDRv6>;
|
|
945
|
+
interface $ZodBase64Internals extends $ZodStringFormatInternals<"base64"> {}
|
|
946
|
+
interface $ZodBase64 extends $ZodType {
|
|
947
|
+
_zod: $ZodBase64Internals;
|
|
948
|
+
}
|
|
949
|
+
declare const $ZodBase64: $constructor<$ZodBase64>;
|
|
950
|
+
interface $ZodBase64URLInternals extends $ZodStringFormatInternals<"base64url"> {}
|
|
951
|
+
interface $ZodBase64URL extends $ZodType {
|
|
952
|
+
_zod: $ZodBase64URLInternals;
|
|
953
|
+
}
|
|
954
|
+
declare const $ZodBase64URL: $constructor<$ZodBase64URL>;
|
|
955
|
+
interface $ZodE164Internals extends $ZodStringFormatInternals<"e164"> {}
|
|
956
|
+
interface $ZodE164 extends $ZodType {
|
|
957
|
+
_zod: $ZodE164Internals;
|
|
958
|
+
}
|
|
959
|
+
declare const $ZodE164: $constructor<$ZodE164>;
|
|
960
|
+
interface $ZodJWTDef extends $ZodStringFormatDef<"jwt"> {
|
|
961
|
+
alg?: JWTAlgorithm | undefined;
|
|
962
|
+
}
|
|
963
|
+
interface $ZodJWTInternals extends $ZodStringFormatInternals<"jwt"> {
|
|
964
|
+
def: $ZodJWTDef;
|
|
965
|
+
}
|
|
966
|
+
interface $ZodJWT extends $ZodType {
|
|
967
|
+
_zod: $ZodJWTInternals;
|
|
968
|
+
}
|
|
969
|
+
declare const $ZodJWT: $constructor<$ZodJWT>;
|
|
970
|
+
interface $ZodNumberDef extends $ZodTypeDef {
|
|
971
|
+
type: "number";
|
|
972
|
+
coerce?: boolean;
|
|
973
|
+
}
|
|
974
|
+
interface $ZodNumberInternals<Input = unknown> extends $ZodTypeInternals<number, Input> {
|
|
975
|
+
def: $ZodNumberDef;
|
|
976
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
977
|
+
pattern: RegExp;
|
|
978
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
979
|
+
isst: $ZodIssueInvalidType;
|
|
980
|
+
bag: LoosePartial<{
|
|
981
|
+
minimum: number;
|
|
982
|
+
maximum: number;
|
|
983
|
+
exclusiveMinimum: number;
|
|
984
|
+
exclusiveMaximum: number;
|
|
985
|
+
format: string;
|
|
986
|
+
pattern: RegExp;
|
|
987
|
+
}>;
|
|
988
|
+
}
|
|
989
|
+
interface $ZodNumber<Input = unknown> extends $ZodType {
|
|
990
|
+
_zod: $ZodNumberInternals<Input>;
|
|
991
|
+
}
|
|
992
|
+
declare const $ZodNumber: $constructor<$ZodNumber>;
|
|
993
|
+
interface $ZodBooleanDef extends $ZodTypeDef {
|
|
994
|
+
type: "boolean";
|
|
995
|
+
coerce?: boolean;
|
|
996
|
+
checks?: $ZodCheck<boolean>[];
|
|
997
|
+
}
|
|
998
|
+
interface $ZodBooleanInternals<T = unknown> extends $ZodTypeInternals<boolean, T> {
|
|
999
|
+
pattern: RegExp;
|
|
1000
|
+
def: $ZodBooleanDef;
|
|
1001
|
+
isst: $ZodIssueInvalidType;
|
|
1002
|
+
}
|
|
1003
|
+
interface $ZodBoolean<T = unknown> extends $ZodType {
|
|
1004
|
+
_zod: $ZodBooleanInternals<T>;
|
|
1005
|
+
}
|
|
1006
|
+
declare const $ZodBoolean: $constructor<$ZodBoolean>;
|
|
1007
|
+
interface $ZodBigIntDef extends $ZodTypeDef {
|
|
1008
|
+
type: "bigint";
|
|
1009
|
+
coerce?: boolean;
|
|
1010
|
+
}
|
|
1011
|
+
interface $ZodBigIntInternals<T = unknown> extends $ZodTypeInternals<bigint, T> {
|
|
1012
|
+
pattern: RegExp;
|
|
1013
|
+
/** @internal Internal API, use with caution */
|
|
1014
|
+
def: $ZodBigIntDef;
|
|
1015
|
+
isst: $ZodIssueInvalidType;
|
|
1016
|
+
bag: LoosePartial<{
|
|
1017
|
+
minimum: bigint;
|
|
1018
|
+
maximum: bigint;
|
|
1019
|
+
format: string;
|
|
1020
|
+
}>;
|
|
1021
|
+
}
|
|
1022
|
+
interface $ZodBigInt<T = unknown> extends $ZodType {
|
|
1023
|
+
_zod: $ZodBigIntInternals<T>;
|
|
1024
|
+
}
|
|
1025
|
+
declare const $ZodBigInt: $constructor<$ZodBigInt>;
|
|
1026
|
+
interface $ZodSymbolDef extends $ZodTypeDef {
|
|
1027
|
+
type: "symbol";
|
|
1028
|
+
}
|
|
1029
|
+
interface $ZodSymbolInternals extends $ZodTypeInternals<symbol, symbol> {
|
|
1030
|
+
def: $ZodSymbolDef;
|
|
1031
|
+
isst: $ZodIssueInvalidType;
|
|
1032
|
+
}
|
|
1033
|
+
interface $ZodSymbol extends $ZodType {
|
|
1034
|
+
_zod: $ZodSymbolInternals;
|
|
1035
|
+
}
|
|
1036
|
+
declare const $ZodSymbol: $constructor<$ZodSymbol>;
|
|
1037
|
+
interface $ZodUndefinedDef extends $ZodTypeDef {
|
|
1038
|
+
type: "undefined";
|
|
1039
|
+
}
|
|
1040
|
+
interface $ZodUndefinedInternals extends $ZodTypeInternals<undefined, undefined> {
|
|
1041
|
+
pattern: RegExp;
|
|
1042
|
+
def: $ZodUndefinedDef;
|
|
1043
|
+
values: PrimitiveSet;
|
|
1044
|
+
isst: $ZodIssueInvalidType;
|
|
1045
|
+
}
|
|
1046
|
+
interface $ZodUndefined extends $ZodType {
|
|
1047
|
+
_zod: $ZodUndefinedInternals;
|
|
1048
|
+
}
|
|
1049
|
+
declare const $ZodUndefined: $constructor<$ZodUndefined>;
|
|
1050
|
+
interface $ZodNullDef extends $ZodTypeDef {
|
|
1051
|
+
type: "null";
|
|
1052
|
+
}
|
|
1053
|
+
interface $ZodNullInternals extends $ZodTypeInternals<null, null> {
|
|
1054
|
+
pattern: RegExp;
|
|
1055
|
+
def: $ZodNullDef;
|
|
1056
|
+
values: PrimitiveSet;
|
|
1057
|
+
isst: $ZodIssueInvalidType;
|
|
1058
|
+
}
|
|
1059
|
+
interface $ZodNull extends $ZodType {
|
|
1060
|
+
_zod: $ZodNullInternals;
|
|
1061
|
+
}
|
|
1062
|
+
declare const $ZodNull: $constructor<$ZodNull>;
|
|
1063
|
+
interface $ZodAnyDef extends $ZodTypeDef {
|
|
1064
|
+
type: "any";
|
|
1065
|
+
}
|
|
1066
|
+
interface $ZodAnyInternals extends $ZodTypeInternals<any, any> {
|
|
1067
|
+
def: $ZodAnyDef;
|
|
1068
|
+
isst: never;
|
|
1069
|
+
}
|
|
1070
|
+
interface $ZodAny extends $ZodType {
|
|
1071
|
+
_zod: $ZodAnyInternals;
|
|
1072
|
+
}
|
|
1073
|
+
declare const $ZodAny: $constructor<$ZodAny>;
|
|
1074
|
+
interface $ZodUnknownDef extends $ZodTypeDef {
|
|
1075
|
+
type: "unknown";
|
|
1076
|
+
}
|
|
1077
|
+
interface $ZodUnknownInternals extends $ZodTypeInternals<unknown, unknown> {
|
|
1078
|
+
def: $ZodUnknownDef;
|
|
1079
|
+
isst: never;
|
|
1080
|
+
}
|
|
1081
|
+
interface $ZodUnknown extends $ZodType {
|
|
1082
|
+
_zod: $ZodUnknownInternals;
|
|
1083
|
+
}
|
|
1084
|
+
declare const $ZodUnknown: $constructor<$ZodUnknown>;
|
|
1085
|
+
interface $ZodNeverDef extends $ZodTypeDef {
|
|
1086
|
+
type: "never";
|
|
1087
|
+
}
|
|
1088
|
+
interface $ZodNeverInternals extends $ZodTypeInternals<never, never> {
|
|
1089
|
+
def: $ZodNeverDef;
|
|
1090
|
+
isst: $ZodIssueInvalidType;
|
|
1091
|
+
}
|
|
1092
|
+
interface $ZodNever extends $ZodType {
|
|
1093
|
+
_zod: $ZodNeverInternals;
|
|
1094
|
+
}
|
|
1095
|
+
declare const $ZodNever: $constructor<$ZodNever>;
|
|
1096
|
+
interface $ZodVoidDef extends $ZodTypeDef {
|
|
1097
|
+
type: "void";
|
|
1098
|
+
}
|
|
1099
|
+
interface $ZodVoidInternals extends $ZodTypeInternals<void, void> {
|
|
1100
|
+
def: $ZodVoidDef;
|
|
1101
|
+
isst: $ZodIssueInvalidType;
|
|
1102
|
+
}
|
|
1103
|
+
interface $ZodVoid extends $ZodType {
|
|
1104
|
+
_zod: $ZodVoidInternals;
|
|
1105
|
+
}
|
|
1106
|
+
declare const $ZodVoid: $constructor<$ZodVoid>;
|
|
1107
|
+
interface $ZodDateDef extends $ZodTypeDef {
|
|
1108
|
+
type: "date";
|
|
1109
|
+
coerce?: boolean;
|
|
1110
|
+
}
|
|
1111
|
+
interface $ZodDateInternals<T = unknown> extends $ZodTypeInternals<Date, T> {
|
|
1112
|
+
def: $ZodDateDef;
|
|
1113
|
+
isst: $ZodIssueInvalidType;
|
|
1114
|
+
bag: LoosePartial<{
|
|
1115
|
+
minimum: Date;
|
|
1116
|
+
maximum: Date;
|
|
1117
|
+
format: string;
|
|
1118
|
+
}>;
|
|
1119
|
+
}
|
|
1120
|
+
interface $ZodDate<T = unknown> extends $ZodType {
|
|
1121
|
+
_zod: $ZodDateInternals<T>;
|
|
1122
|
+
}
|
|
1123
|
+
declare const $ZodDate: $constructor<$ZodDate>;
|
|
1124
|
+
interface $ZodArrayDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1125
|
+
type: "array";
|
|
1126
|
+
element: T;
|
|
1127
|
+
}
|
|
1128
|
+
interface $ZodArrayInternals<T extends SomeType = $ZodType> extends _$ZodTypeInternals {
|
|
1129
|
+
def: $ZodArrayDef<T>;
|
|
1130
|
+
isst: $ZodIssueInvalidType;
|
|
1131
|
+
output: output<T>[];
|
|
1132
|
+
input: input<T>[];
|
|
1133
|
+
}
|
|
1134
|
+
interface $ZodArray<T extends SomeType = $ZodType> extends $ZodType<any, any, $ZodArrayInternals<T>> {}
|
|
1135
|
+
declare const $ZodArray: $constructor<$ZodArray>;
|
|
1136
|
+
type OptionalOutSchema = {
|
|
1137
|
+
_zod: {
|
|
1138
|
+
optout: "optional";
|
|
1139
|
+
};
|
|
1140
|
+
};
|
|
1141
|
+
type OptionalInSchema = {
|
|
1142
|
+
_zod: {
|
|
1143
|
+
optin: "optional";
|
|
1144
|
+
};
|
|
1145
|
+
};
|
|
1146
|
+
type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, output<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{ -readonly [k in keyof T as T[k] extends OptionalOutSchema ? never : k]: T[k]["_zod"]["output"] } & { -readonly [k in keyof T as T[k] extends OptionalOutSchema ? k : never]?: T[k]["_zod"]["output"] } & Extra>;
|
|
1147
|
+
type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, input<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{ -readonly [k in keyof T as T[k] extends OptionalInSchema ? never : k]: T[k]["_zod"]["input"] } & { -readonly [k in keyof T as T[k] extends OptionalInSchema ? k : never]?: T[k]["_zod"]["input"] } & Extra>;
|
|
1148
|
+
type $ZodObjectConfig = {
|
|
1149
|
+
out: Record<string, unknown>;
|
|
1150
|
+
in: Record<string, unknown>;
|
|
1151
|
+
};
|
|
1152
|
+
type $loose = {
|
|
1153
|
+
out: Record<string, unknown>;
|
|
1154
|
+
in: Record<string, unknown>;
|
|
1155
|
+
};
|
|
1156
|
+
type $strict = {
|
|
1157
|
+
out: {};
|
|
1158
|
+
in: {};
|
|
1159
|
+
};
|
|
1160
|
+
type $strip = {
|
|
1161
|
+
out: {};
|
|
1162
|
+
in: {};
|
|
1163
|
+
};
|
|
1164
|
+
type $catchall<T extends SomeType> = {
|
|
1165
|
+
out: {
|
|
1166
|
+
[k: string]: output<T>;
|
|
1167
|
+
};
|
|
1168
|
+
in: {
|
|
1169
|
+
[k: string]: input<T>;
|
|
1170
|
+
};
|
|
1171
|
+
};
|
|
1172
|
+
type $ZodShape = Readonly<{
|
|
1173
|
+
[k: string]: $ZodType;
|
|
1174
|
+
}>;
|
|
1175
|
+
interface $ZodObjectDef<Shape extends $ZodShape = $ZodShape> extends $ZodTypeDef {
|
|
1176
|
+
type: "object";
|
|
1177
|
+
shape: Shape;
|
|
1178
|
+
catchall?: $ZodType | undefined;
|
|
1179
|
+
}
|
|
1180
|
+
interface $ZodObjectInternals< /** @ts-ignore Cast variance */out Shape extends $ZodShape = $ZodShape, out Config extends $ZodObjectConfig = $ZodObjectConfig> extends _$ZodTypeInternals {
|
|
1181
|
+
def: $ZodObjectDef<Shape>;
|
|
1182
|
+
config: Config;
|
|
1183
|
+
isst: $ZodIssueInvalidType | $ZodIssueUnrecognizedKeys;
|
|
1184
|
+
propValues: PropValues;
|
|
1185
|
+
output: $InferObjectOutput<Shape, Config["out"]>;
|
|
1186
|
+
input: $InferObjectInput<Shape, Config["in"]>;
|
|
1187
|
+
optin?: "optional" | undefined;
|
|
1188
|
+
optout?: "optional" | undefined;
|
|
1189
|
+
}
|
|
1190
|
+
type $ZodLooseShape = Record<string, any>;
|
|
1191
|
+
interface $ZodObject< /** @ts-ignore Cast variance */out Shape extends Readonly<$ZodShape> = Readonly<$ZodShape>, out Params extends $ZodObjectConfig = $ZodObjectConfig> extends $ZodType<any, any, $ZodObjectInternals<Shape, Params>> {}
|
|
1192
|
+
declare const $ZodObject: $constructor<$ZodObject>;
|
|
1193
|
+
type $InferUnionOutput<T extends SomeType> = T extends any ? output<T> : never;
|
|
1194
|
+
type $InferUnionInput<T extends SomeType> = T extends any ? input<T> : never;
|
|
1195
|
+
interface $ZodUnionDef<Options extends readonly SomeType[] = readonly $ZodType[]> extends $ZodTypeDef {
|
|
1196
|
+
type: "union";
|
|
1197
|
+
options: Options;
|
|
1198
|
+
inclusive?: boolean;
|
|
1199
|
+
}
|
|
1200
|
+
type IsOptionalIn<T extends SomeType> = T extends OptionalInSchema ? true : false;
|
|
1201
|
+
type IsOptionalOut<T extends SomeType> = T extends OptionalOutSchema ? true : false;
|
|
1202
|
+
interface $ZodUnionInternals<T extends readonly SomeType[] = readonly $ZodType[]> extends _$ZodTypeInternals {
|
|
1203
|
+
def: $ZodUnionDef<T>;
|
|
1204
|
+
isst: $ZodIssueInvalidUnion;
|
|
1205
|
+
pattern: T[number]["_zod"]["pattern"];
|
|
1206
|
+
values: T[number]["_zod"]["values"];
|
|
1207
|
+
output: $InferUnionOutput<T[number]>;
|
|
1208
|
+
input: $InferUnionInput<T[number]>;
|
|
1209
|
+
optin: IsOptionalIn<T[number]> extends false ? "optional" | undefined : "optional";
|
|
1210
|
+
optout: IsOptionalOut<T[number]> extends false ? "optional" | undefined : "optional";
|
|
1211
|
+
}
|
|
1212
|
+
interface $ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends $ZodType<any, any, $ZodUnionInternals<T>> {
|
|
1213
|
+
_zod: $ZodUnionInternals<T>;
|
|
1214
|
+
}
|
|
1215
|
+
declare const $ZodUnion: $constructor<$ZodUnion>;
|
|
1216
|
+
interface $ZodIntersectionDef<Left extends SomeType = $ZodType, Right extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1217
|
+
type: "intersection";
|
|
1218
|
+
left: Left;
|
|
1219
|
+
right: Right;
|
|
1220
|
+
}
|
|
1221
|
+
interface $ZodIntersectionInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _$ZodTypeInternals {
|
|
1222
|
+
def: $ZodIntersectionDef<A, B>;
|
|
1223
|
+
isst: never;
|
|
1224
|
+
optin: A["_zod"]["optin"] | B["_zod"]["optin"];
|
|
1225
|
+
optout: A["_zod"]["optout"] | B["_zod"]["optout"];
|
|
1226
|
+
output: output<A> & output<B>;
|
|
1227
|
+
input: input<A> & input<B>;
|
|
1228
|
+
}
|
|
1229
|
+
interface $ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
|
|
1230
|
+
_zod: $ZodIntersectionInternals<A, B>;
|
|
1231
|
+
}
|
|
1232
|
+
declare const $ZodIntersection: $constructor<$ZodIntersection>;
|
|
1233
|
+
interface $ZodTupleDef<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends $ZodTypeDef {
|
|
1234
|
+
type: "tuple";
|
|
1235
|
+
items: T;
|
|
1236
|
+
rest: Rest;
|
|
1237
|
+
}
|
|
1238
|
+
type $InferTupleInputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleInputTypeWithOptionals<T>, ...(Rest extends SomeType ? input<Rest>[] : [])];
|
|
1239
|
+
type TupleInputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: input<T[k]> };
|
|
1240
|
+
type TupleInputTypeWithOptionals<T extends TupleItems> = T extends readonly [...infer Prefix extends SomeType[], infer Tail extends SomeType] ? Tail["_zod"]["optin"] extends "optional" ? [...TupleInputTypeWithOptionals<Prefix>, input<Tail>?] : TupleInputTypeNoOptionals<T> : [];
|
|
1241
|
+
type $InferTupleOutputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleOutputTypeWithOptionals<T>, ...(Rest extends SomeType ? output<Rest>[] : [])];
|
|
1242
|
+
type TupleOutputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: output<T[k]> };
|
|
1243
|
+
type TupleOutputTypeWithOptionals<T extends TupleItems> = T extends readonly [...infer Prefix extends SomeType[], infer Tail extends SomeType] ? Tail["_zod"]["optout"] extends "optional" ? [...TupleOutputTypeWithOptionals<Prefix>, output<Tail>?] : TupleOutputTypeNoOptionals<T> : [];
|
|
1244
|
+
interface $ZodTupleInternals<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends _$ZodTypeInternals {
|
|
1245
|
+
def: $ZodTupleDef<T, Rest>;
|
|
1246
|
+
isst: $ZodIssueInvalidType | $ZodIssueTooBig<unknown[]> | $ZodIssueTooSmall<unknown[]>;
|
|
1247
|
+
output: $InferTupleOutputType<T, Rest>;
|
|
1248
|
+
input: $InferTupleInputType<T, Rest>;
|
|
1249
|
+
}
|
|
1250
|
+
interface $ZodTuple<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends $ZodType {
|
|
1251
|
+
_zod: $ZodTupleInternals<T, Rest>;
|
|
1252
|
+
}
|
|
1253
|
+
declare const $ZodTuple: $constructor<$ZodTuple>;
|
|
1254
|
+
type $ZodRecordKey = $ZodType<string | number | symbol, unknown>;
|
|
1255
|
+
interface $ZodRecordDef<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1256
|
+
type: "record";
|
|
1257
|
+
keyType: Key;
|
|
1258
|
+
valueType: Value;
|
|
1259
|
+
/** @default "strict" - errors on keys not matching keyType. "loose" passes through non-matching keys unchanged. */
|
|
1260
|
+
mode?: "strict" | "loose";
|
|
1261
|
+
}
|
|
1262
|
+
type $InferZodRecordOutput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<output<Key>, output<Value>>> : Record<output<Key>, output<Value>>;
|
|
1263
|
+
type $InferZodRecordInput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<input<Key> & PropertyKey, input<Value>>> : Record<input<Key> & PropertyKey, input<Value>>;
|
|
1264
|
+
interface $ZodRecordInternals<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeInternals<$InferZodRecordOutput<Key, Value>, $InferZodRecordInput<Key, Value>> {
|
|
1265
|
+
def: $ZodRecordDef<Key, Value>;
|
|
1266
|
+
isst: $ZodIssueInvalidType | $ZodIssueInvalidKey<Record<PropertyKey, unknown>>;
|
|
1267
|
+
optin?: "optional" | undefined;
|
|
1268
|
+
optout?: "optional" | undefined;
|
|
1269
|
+
}
|
|
1270
|
+
type $partial = {
|
|
1271
|
+
"~~partial": true;
|
|
1272
|
+
};
|
|
1273
|
+
interface $ZodRecord<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodType {
|
|
1274
|
+
_zod: $ZodRecordInternals<Key, Value>;
|
|
1275
|
+
}
|
|
1276
|
+
declare const $ZodRecord: $constructor<$ZodRecord>;
|
|
1277
|
+
interface $ZodMapDef<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1278
|
+
type: "map";
|
|
1279
|
+
keyType: Key;
|
|
1280
|
+
valueType: Value;
|
|
1281
|
+
}
|
|
1282
|
+
interface $ZodMapInternals<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeInternals<Map<output<Key>, output<Value>>, Map<input<Key>, input<Value>>> {
|
|
1283
|
+
def: $ZodMapDef<Key, Value>;
|
|
1284
|
+
isst: $ZodIssueInvalidType | $ZodIssueInvalidKey | $ZodIssueInvalidElement<unknown>;
|
|
1285
|
+
optin?: "optional" | undefined;
|
|
1286
|
+
optout?: "optional" | undefined;
|
|
1287
|
+
}
|
|
1288
|
+
interface $ZodMap<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodType {
|
|
1289
|
+
_zod: $ZodMapInternals<Key, Value>;
|
|
1290
|
+
}
|
|
1291
|
+
declare const $ZodMap: $constructor<$ZodMap>;
|
|
1292
|
+
interface $ZodSetDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1293
|
+
type: "set";
|
|
1294
|
+
valueType: T;
|
|
1295
|
+
}
|
|
1296
|
+
interface $ZodSetInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Set<output<T>>, Set<input<T>>> {
|
|
1297
|
+
def: $ZodSetDef<T>;
|
|
1298
|
+
isst: $ZodIssueInvalidType;
|
|
1299
|
+
optin?: "optional" | undefined;
|
|
1300
|
+
optout?: "optional" | undefined;
|
|
1301
|
+
}
|
|
1302
|
+
interface $ZodSet<T extends SomeType = $ZodType> extends $ZodType {
|
|
1303
|
+
_zod: $ZodSetInternals<T>;
|
|
1304
|
+
}
|
|
1305
|
+
declare const $ZodSet: $constructor<$ZodSet>;
|
|
1306
|
+
type $InferEnumOutput<T extends EnumLike> = T[keyof T] & {};
|
|
1307
|
+
type $InferEnumInput<T extends EnumLike> = T[keyof T] & {};
|
|
1308
|
+
interface $ZodEnumDef<T extends EnumLike = EnumLike> extends $ZodTypeDef {
|
|
1309
|
+
type: "enum";
|
|
1310
|
+
entries: T;
|
|
1311
|
+
}
|
|
1312
|
+
interface $ZodEnumInternals< /** @ts-ignore Cast variance */out T extends EnumLike = EnumLike> extends $ZodTypeInternals<$InferEnumOutput<T>, $InferEnumInput<T>> {
|
|
1313
|
+
def: $ZodEnumDef<T>;
|
|
1314
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
1315
|
+
values: PrimitiveSet;
|
|
1316
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
1317
|
+
pattern: RegExp;
|
|
1318
|
+
isst: $ZodIssueInvalidValue;
|
|
1319
|
+
}
|
|
1320
|
+
interface $ZodEnum<T extends EnumLike = EnumLike> extends $ZodType {
|
|
1321
|
+
_zod: $ZodEnumInternals<T>;
|
|
1322
|
+
}
|
|
1323
|
+
declare const $ZodEnum: $constructor<$ZodEnum>;
|
|
1324
|
+
interface $ZodLiteralDef<T extends Literal> extends $ZodTypeDef {
|
|
1325
|
+
type: "literal";
|
|
1326
|
+
values: T[];
|
|
1327
|
+
}
|
|
1328
|
+
interface $ZodLiteralInternals<T extends Literal = Literal> extends $ZodTypeInternals<T, T> {
|
|
1329
|
+
def: $ZodLiteralDef<T>;
|
|
1330
|
+
values: Set<T>;
|
|
1331
|
+
pattern: RegExp;
|
|
1332
|
+
isst: $ZodIssueInvalidValue;
|
|
1333
|
+
}
|
|
1334
|
+
interface $ZodLiteral<T extends Literal = Literal> extends $ZodType {
|
|
1335
|
+
_zod: $ZodLiteralInternals<T>;
|
|
1336
|
+
}
|
|
1337
|
+
declare const $ZodLiteral: $constructor<$ZodLiteral>;
|
|
1338
|
+
type _File = typeof globalThis extends {
|
|
1339
|
+
File: infer F extends new (...args: any[]) => any;
|
|
1340
|
+
} ? InstanceType<F> : {};
|
|
1341
|
+
/** Do not reference this directly. */
|
|
1342
|
+
interface File extends _File {
|
|
1343
|
+
readonly type: string;
|
|
1344
|
+
readonly size: number;
|
|
1345
|
+
}
|
|
1346
|
+
interface $ZodFileDef extends $ZodTypeDef {
|
|
1347
|
+
type: "file";
|
|
1348
|
+
}
|
|
1349
|
+
interface $ZodFileInternals extends $ZodTypeInternals<File, File> {
|
|
1350
|
+
def: $ZodFileDef;
|
|
1351
|
+
isst: $ZodIssueInvalidType;
|
|
1352
|
+
bag: LoosePartial<{
|
|
1353
|
+
minimum: number;
|
|
1354
|
+
maximum: number;
|
|
1355
|
+
mime: MimeTypes[];
|
|
1356
|
+
}>;
|
|
1357
|
+
}
|
|
1358
|
+
interface $ZodFile extends $ZodType {
|
|
1359
|
+
_zod: $ZodFileInternals;
|
|
1360
|
+
}
|
|
1361
|
+
declare const $ZodFile: $constructor<$ZodFile>;
|
|
1362
|
+
interface $ZodTransformDef extends $ZodTypeDef {
|
|
1363
|
+
type: "transform";
|
|
1364
|
+
transform: (input: unknown, payload: ParsePayload<unknown>) => MaybeAsync<unknown>;
|
|
1365
|
+
}
|
|
1366
|
+
interface $ZodTransformInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I> {
|
|
1367
|
+
def: $ZodTransformDef;
|
|
1368
|
+
isst: never;
|
|
1369
|
+
}
|
|
1370
|
+
interface $ZodTransform<O = unknown, I = unknown> extends $ZodType {
|
|
1371
|
+
_zod: $ZodTransformInternals<O, I>;
|
|
1372
|
+
}
|
|
1373
|
+
declare const $ZodTransform: $constructor<$ZodTransform>;
|
|
1374
|
+
interface $ZodOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1375
|
+
type: "optional";
|
|
1376
|
+
innerType: T;
|
|
1377
|
+
}
|
|
1378
|
+
interface $ZodOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | undefined, input<T> | undefined> {
|
|
1379
|
+
def: $ZodOptionalDef<T>;
|
|
1380
|
+
optin: "optional";
|
|
1381
|
+
optout: "optional";
|
|
1382
|
+
isst: never;
|
|
1383
|
+
values: T["_zod"]["values"];
|
|
1384
|
+
pattern: T["_zod"]["pattern"];
|
|
1385
|
+
}
|
|
1386
|
+
interface $ZodOptional<T extends SomeType = $ZodType> extends $ZodType {
|
|
1387
|
+
_zod: $ZodOptionalInternals<T>;
|
|
1388
|
+
}
|
|
1389
|
+
declare const $ZodOptional: $constructor<$ZodOptional>;
|
|
1390
|
+
interface $ZodExactOptionalDef<T extends SomeType = $ZodType> extends $ZodOptionalDef<T> {}
|
|
1391
|
+
interface $ZodExactOptionalInternals<T extends SomeType = $ZodType> extends $ZodOptionalInternals<T> {
|
|
1392
|
+
def: $ZodExactOptionalDef<T>;
|
|
1393
|
+
output: output<T>;
|
|
1394
|
+
input: input<T>;
|
|
1395
|
+
}
|
|
1396
|
+
interface $ZodExactOptional<T extends SomeType = $ZodType> extends $ZodType {
|
|
1397
|
+
_zod: $ZodExactOptionalInternals<T>;
|
|
1398
|
+
}
|
|
1399
|
+
declare const $ZodExactOptional: $constructor<$ZodExactOptional>;
|
|
1400
|
+
interface $ZodNullableDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1401
|
+
type: "nullable";
|
|
1402
|
+
innerType: T;
|
|
1403
|
+
}
|
|
1404
|
+
interface $ZodNullableInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | null, input<T> | null> {
|
|
1405
|
+
def: $ZodNullableDef<T>;
|
|
1406
|
+
optin: T["_zod"]["optin"];
|
|
1407
|
+
optout: T["_zod"]["optout"];
|
|
1408
|
+
isst: never;
|
|
1409
|
+
values: T["_zod"]["values"];
|
|
1410
|
+
pattern: T["_zod"]["pattern"];
|
|
1411
|
+
}
|
|
1412
|
+
interface $ZodNullable<T extends SomeType = $ZodType> extends $ZodType {
|
|
1413
|
+
_zod: $ZodNullableInternals<T>;
|
|
1414
|
+
}
|
|
1415
|
+
declare const $ZodNullable: $constructor<$ZodNullable>;
|
|
1416
|
+
interface $ZodDefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1417
|
+
type: "default";
|
|
1418
|
+
innerType: T;
|
|
1419
|
+
/** The default value. May be a getter. */
|
|
1420
|
+
defaultValue: NoUndefined<output<T>>;
|
|
1421
|
+
}
|
|
1422
|
+
interface $ZodDefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input<T> | undefined> {
|
|
1423
|
+
def: $ZodDefaultDef<T>;
|
|
1424
|
+
optin: "optional";
|
|
1425
|
+
optout?: "optional" | undefined;
|
|
1426
|
+
isst: never;
|
|
1427
|
+
values: T["_zod"]["values"];
|
|
1428
|
+
}
|
|
1429
|
+
interface $ZodDefault<T extends SomeType = $ZodType> extends $ZodType {
|
|
1430
|
+
_zod: $ZodDefaultInternals<T>;
|
|
1431
|
+
}
|
|
1432
|
+
declare const $ZodDefault: $constructor<$ZodDefault>;
|
|
1433
|
+
interface $ZodPrefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1434
|
+
type: "prefault";
|
|
1435
|
+
innerType: T;
|
|
1436
|
+
/** The default value. May be a getter. */
|
|
1437
|
+
defaultValue: input<T>;
|
|
1438
|
+
}
|
|
1439
|
+
interface $ZodPrefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input<T> | undefined> {
|
|
1440
|
+
def: $ZodPrefaultDef<T>;
|
|
1441
|
+
optin: "optional";
|
|
1442
|
+
optout?: "optional" | undefined;
|
|
1443
|
+
isst: never;
|
|
1444
|
+
values: T["_zod"]["values"];
|
|
1445
|
+
}
|
|
1446
|
+
interface $ZodPrefault<T extends SomeType = $ZodType> extends $ZodType {
|
|
1447
|
+
_zod: $ZodPrefaultInternals<T>;
|
|
1448
|
+
}
|
|
1449
|
+
declare const $ZodPrefault: $constructor<$ZodPrefault>;
|
|
1450
|
+
interface $ZodNonOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1451
|
+
type: "nonoptional";
|
|
1452
|
+
innerType: T;
|
|
1453
|
+
}
|
|
1454
|
+
interface $ZodNonOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, NoUndefined<input<T>>> {
|
|
1455
|
+
def: $ZodNonOptionalDef<T>;
|
|
1456
|
+
isst: $ZodIssueInvalidType;
|
|
1457
|
+
values: T["_zod"]["values"];
|
|
1458
|
+
optin: "optional" | undefined;
|
|
1459
|
+
optout: "optional" | undefined;
|
|
1460
|
+
}
|
|
1461
|
+
interface $ZodNonOptional<T extends SomeType = $ZodType> extends $ZodType {
|
|
1462
|
+
_zod: $ZodNonOptionalInternals<T>;
|
|
1463
|
+
}
|
|
1464
|
+
declare const $ZodNonOptional: $constructor<$ZodNonOptional>;
|
|
1465
|
+
interface $ZodSuccessDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1466
|
+
type: "success";
|
|
1467
|
+
innerType: T;
|
|
1468
|
+
}
|
|
1469
|
+
interface $ZodSuccessInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<boolean, input<T>> {
|
|
1470
|
+
def: $ZodSuccessDef<T>;
|
|
1471
|
+
isst: never;
|
|
1472
|
+
optin: T["_zod"]["optin"];
|
|
1473
|
+
optout: "optional" | undefined;
|
|
1474
|
+
}
|
|
1475
|
+
interface $ZodSuccess<T extends SomeType = $ZodType> extends $ZodType {
|
|
1476
|
+
_zod: $ZodSuccessInternals<T>;
|
|
1477
|
+
}
|
|
1478
|
+
declare const $ZodSuccess: $constructor<$ZodSuccess>;
|
|
1479
|
+
interface $ZodCatchCtx extends ParsePayload {
|
|
1480
|
+
/** @deprecated Use `ctx.issues` */
|
|
1481
|
+
error: {
|
|
1482
|
+
issues: $ZodIssue[];
|
|
1483
|
+
};
|
|
1484
|
+
/** @deprecated Use `ctx.value` */
|
|
1485
|
+
input: unknown;
|
|
1486
|
+
}
|
|
1487
|
+
interface $ZodCatchDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1488
|
+
type: "catch";
|
|
1489
|
+
innerType: T;
|
|
1490
|
+
catchValue: (ctx: $ZodCatchCtx) => unknown;
|
|
1491
|
+
}
|
|
1492
|
+
interface $ZodCatchInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input<T>> {
|
|
1493
|
+
def: $ZodCatchDef<T>;
|
|
1494
|
+
optin: T["_zod"]["optin"];
|
|
1495
|
+
optout: T["_zod"]["optout"];
|
|
1496
|
+
isst: never;
|
|
1497
|
+
values: T["_zod"]["values"];
|
|
1498
|
+
}
|
|
1499
|
+
interface $ZodCatch<T extends SomeType = $ZodType> extends $ZodType {
|
|
1500
|
+
_zod: $ZodCatchInternals<T>;
|
|
1501
|
+
}
|
|
1502
|
+
declare const $ZodCatch: $constructor<$ZodCatch>;
|
|
1503
|
+
interface $ZodNaNDef extends $ZodTypeDef {
|
|
1504
|
+
type: "nan";
|
|
1505
|
+
}
|
|
1506
|
+
interface $ZodNaNInternals extends $ZodTypeInternals<number, number> {
|
|
1507
|
+
def: $ZodNaNDef;
|
|
1508
|
+
isst: $ZodIssueInvalidType;
|
|
1509
|
+
}
|
|
1510
|
+
interface $ZodNaN extends $ZodType {
|
|
1511
|
+
_zod: $ZodNaNInternals;
|
|
1512
|
+
}
|
|
1513
|
+
declare const $ZodNaN: $constructor<$ZodNaN>;
|
|
1514
|
+
interface $ZodPipeDef<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1515
|
+
type: "pipe";
|
|
1516
|
+
in: A;
|
|
1517
|
+
out: B;
|
|
1518
|
+
/** Only defined inside $ZodCodec instances. */
|
|
1519
|
+
transform?: (value: output<A>, payload: ParsePayload<output<A>>) => MaybeAsync<input<B>>;
|
|
1520
|
+
/** Only defined inside $ZodCodec instances. */
|
|
1521
|
+
reverseTransform?: (value: input<B>, payload: ParsePayload<input<B>>) => MaybeAsync<output<A>>;
|
|
1522
|
+
}
|
|
1523
|
+
interface $ZodPipeInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeInternals<output<B>, input<A>> {
|
|
1524
|
+
def: $ZodPipeDef<A, B>;
|
|
1525
|
+
isst: never;
|
|
1526
|
+
values: A["_zod"]["values"];
|
|
1527
|
+
optin: A["_zod"]["optin"];
|
|
1528
|
+
optout: B["_zod"]["optout"];
|
|
1529
|
+
propValues: A["_zod"]["propValues"];
|
|
1530
|
+
}
|
|
1531
|
+
interface $ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
|
|
1532
|
+
_zod: $ZodPipeInternals<A, B>;
|
|
1533
|
+
}
|
|
1534
|
+
declare const $ZodPipe: $constructor<$ZodPipe>;
|
|
1535
|
+
interface $ZodReadonlyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1536
|
+
type: "readonly";
|
|
1537
|
+
innerType: T;
|
|
1538
|
+
}
|
|
1539
|
+
interface $ZodReadonlyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<MakeReadonly<output<T>>, MakeReadonly<input<T>>> {
|
|
1540
|
+
def: $ZodReadonlyDef<T>;
|
|
1541
|
+
optin: T["_zod"]["optin"];
|
|
1542
|
+
optout: T["_zod"]["optout"];
|
|
1543
|
+
isst: never;
|
|
1544
|
+
propValues: T["_zod"]["propValues"];
|
|
1545
|
+
values: T["_zod"]["values"];
|
|
1546
|
+
}
|
|
1547
|
+
interface $ZodReadonly<T extends SomeType = $ZodType> extends $ZodType {
|
|
1548
|
+
_zod: $ZodReadonlyInternals<T>;
|
|
1549
|
+
}
|
|
1550
|
+
declare const $ZodReadonly: $constructor<$ZodReadonly>;
|
|
1551
|
+
interface $ZodTemplateLiteralDef extends $ZodTypeDef {
|
|
1552
|
+
type: "template_literal";
|
|
1553
|
+
parts: $ZodTemplateLiteralPart[];
|
|
1554
|
+
format?: string | undefined;
|
|
1555
|
+
}
|
|
1556
|
+
interface $ZodTemplateLiteralInternals<Template extends string = string> extends $ZodTypeInternals<Template, Template> {
|
|
1557
|
+
pattern: RegExp;
|
|
1558
|
+
def: $ZodTemplateLiteralDef;
|
|
1559
|
+
isst: $ZodIssueInvalidType;
|
|
1560
|
+
}
|
|
1561
|
+
interface $ZodTemplateLiteral<Template extends string = string> extends $ZodType {
|
|
1562
|
+
_zod: $ZodTemplateLiteralInternals<Template>;
|
|
1563
|
+
}
|
|
1564
|
+
type LiteralPart = Exclude<Literal, symbol>;
|
|
1565
|
+
interface SchemaPartInternals extends $ZodTypeInternals<LiteralPart, LiteralPart> {
|
|
1566
|
+
pattern: RegExp;
|
|
1567
|
+
}
|
|
1568
|
+
interface SchemaPart extends $ZodType {
|
|
1569
|
+
_zod: SchemaPartInternals;
|
|
1570
|
+
}
|
|
1571
|
+
type $ZodTemplateLiteralPart = LiteralPart | SchemaPart;
|
|
1572
|
+
declare const $ZodTemplateLiteral: $constructor<$ZodTemplateLiteral>;
|
|
1573
|
+
type $ZodFunctionArgs = $ZodType<unknown[], unknown[]>;
|
|
1574
|
+
type $ZodFunctionIn = $ZodFunctionArgs;
|
|
1575
|
+
type $ZodFunctionOut = $ZodType;
|
|
1576
|
+
type $InferInnerFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output<Args>) => input<Returns>;
|
|
1577
|
+
type $InferInnerFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output<Args>) => MaybeAsync<input<Returns>>;
|
|
1578
|
+
type $InferOuterFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input<Args>) => output<Returns>;
|
|
1579
|
+
type $InferOuterFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input<Args>) => Promise<output<Returns>>;
|
|
1580
|
+
interface $ZodFunctionDef<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends $ZodFunctionOut = $ZodFunctionOut> extends $ZodTypeDef {
|
|
1581
|
+
type: "function";
|
|
1582
|
+
input: In;
|
|
1583
|
+
output: Out;
|
|
1584
|
+
}
|
|
1585
|
+
interface $ZodFunctionInternals<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> extends $ZodTypeInternals<$InferOuterFunctionType<Args, Returns>, $InferInnerFunctionType<Args, Returns>> {
|
|
1586
|
+
def: $ZodFunctionDef<Args, Returns>;
|
|
1587
|
+
isst: $ZodIssueInvalidType;
|
|
1588
|
+
}
|
|
1589
|
+
interface $ZodFunction<Args extends $ZodFunctionIn = $ZodFunctionIn, Returns extends $ZodFunctionOut = $ZodFunctionOut> extends $ZodType<any, any, $ZodFunctionInternals<Args, Returns>> {
|
|
1590
|
+
/** @deprecated */
|
|
1591
|
+
_def: $ZodFunctionDef<Args, Returns>;
|
|
1592
|
+
_input: $InferInnerFunctionType<Args, Returns>;
|
|
1593
|
+
_output: $InferOuterFunctionType<Args, Returns>;
|
|
1594
|
+
implement<F extends $InferInnerFunctionType<Args, Returns>>(func: F): (...args: Parameters<this["_output"]>) => ReturnType<F> extends ReturnType<this["_output"]> ? ReturnType<F> : ReturnType<this["_output"]>;
|
|
1595
|
+
implementAsync<F extends $InferInnerFunctionTypeAsync<Args, Returns>>(func: F): F extends $InferOuterFunctionTypeAsync<Args, Returns> ? F : $InferOuterFunctionTypeAsync<Args, Returns>;
|
|
1596
|
+
input<const Items extends TupleItems, const Rest extends $ZodFunctionOut = $ZodFunctionOut>(args: Items, rest?: Rest): $ZodFunction<$ZodTuple<Items, Rest>, Returns>;
|
|
1597
|
+
input<NewArgs extends $ZodFunctionIn>(args: NewArgs): $ZodFunction<NewArgs, Returns>;
|
|
1598
|
+
input(...args: any[]): $ZodFunction<any, Returns>;
|
|
1599
|
+
output<NewReturns extends $ZodType>(output: NewReturns): $ZodFunction<Args, NewReturns>;
|
|
1600
|
+
}
|
|
1601
|
+
declare const $ZodFunction: $constructor<$ZodFunction>;
|
|
1602
|
+
interface $ZodPromiseDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1603
|
+
type: "promise";
|
|
1604
|
+
innerType: T;
|
|
1605
|
+
}
|
|
1606
|
+
interface $ZodPromiseInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Promise<output<T>>, MaybeAsync<input<T>>> {
|
|
1607
|
+
def: $ZodPromiseDef<T>;
|
|
1608
|
+
isst: never;
|
|
1609
|
+
}
|
|
1610
|
+
interface $ZodPromise<T extends SomeType = $ZodType> extends $ZodType {
|
|
1611
|
+
_zod: $ZodPromiseInternals<T>;
|
|
1612
|
+
}
|
|
1613
|
+
declare const $ZodPromise: $constructor<$ZodPromise>;
|
|
1614
|
+
interface $ZodLazyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1615
|
+
type: "lazy";
|
|
1616
|
+
getter: () => T;
|
|
1617
|
+
}
|
|
1618
|
+
interface $ZodLazyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input<T>> {
|
|
1619
|
+
def: $ZodLazyDef<T>;
|
|
1620
|
+
isst: never;
|
|
1621
|
+
/** Auto-cached way to retrieve the inner schema */
|
|
1622
|
+
innerType: T;
|
|
1623
|
+
pattern: T["_zod"]["pattern"];
|
|
1624
|
+
propValues: T["_zod"]["propValues"];
|
|
1625
|
+
optin: T["_zod"]["optin"];
|
|
1626
|
+
optout: T["_zod"]["optout"];
|
|
1627
|
+
}
|
|
1628
|
+
interface $ZodLazy<T extends SomeType = $ZodType> extends $ZodType {
|
|
1629
|
+
_zod: $ZodLazyInternals<T>;
|
|
1630
|
+
}
|
|
1631
|
+
declare const $ZodLazy: $constructor<$ZodLazy>;
|
|
1632
|
+
interface $ZodCustomDef<O = unknown> extends $ZodTypeDef, $ZodCheckDef {
|
|
1633
|
+
type: "custom";
|
|
1634
|
+
check: "custom";
|
|
1635
|
+
path?: PropertyKey[] | undefined;
|
|
1636
|
+
error?: $ZodErrorMap | undefined;
|
|
1637
|
+
params?: Record<string, any> | undefined;
|
|
1638
|
+
fn: (arg: O) => unknown;
|
|
1639
|
+
}
|
|
1640
|
+
interface $ZodCustomInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I>, $ZodCheckInternals<O> {
|
|
1641
|
+
def: $ZodCustomDef;
|
|
1642
|
+
issc: $ZodIssue;
|
|
1643
|
+
isst: never;
|
|
1644
|
+
bag: LoosePartial<{
|
|
1645
|
+
Class: typeof Class;
|
|
1646
|
+
}>;
|
|
1647
|
+
}
|
|
1648
|
+
interface $ZodCustom<O = unknown, I = unknown> extends $ZodType {
|
|
1649
|
+
_zod: $ZodCustomInternals<O, I>;
|
|
1650
|
+
}
|
|
1651
|
+
declare const $ZodCustom: $constructor<$ZodCustom>;
|
|
1652
|
+
type $ZodTypes = $ZodString | $ZodNumber | $ZodBigInt | $ZodBoolean | $ZodDate | $ZodSymbol | $ZodUndefined | $ZodNullable | $ZodNull | $ZodAny | $ZodUnknown | $ZodNever | $ZodVoid | $ZodArray | $ZodObject | $ZodUnion | $ZodIntersection | $ZodTuple | $ZodRecord | $ZodMap | $ZodSet | $ZodLiteral | $ZodEnum | $ZodFunction | $ZodPromise | $ZodLazy | $ZodOptional | $ZodDefault | $ZodPrefault | $ZodTemplateLiteral | $ZodCustom | $ZodTransform | $ZodNonOptional | $ZodReadonly | $ZodNaN | $ZodPipe | $ZodSuccess | $ZodCatch | $ZodFile;
|
|
1653
|
+
//#endregion
|
|
1654
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.cts
|
|
1655
|
+
interface $ZodCheckDef {
|
|
1656
|
+
check: string;
|
|
1657
|
+
error?: $ZodErrorMap<never> | undefined;
|
|
1658
|
+
/** If true, no later checks will be executed if this check fails. Default `false`. */
|
|
1659
|
+
abort?: boolean | undefined;
|
|
1660
|
+
/** If provided, this check will only be executed if the function returns `true`. Defaults to `payload => z.util.isAborted(payload)`. */
|
|
1661
|
+
when?: ((payload: ParsePayload) => boolean) | undefined;
|
|
1662
|
+
}
|
|
1663
|
+
interface $ZodCheckInternals<T> {
|
|
1664
|
+
def: $ZodCheckDef;
|
|
1665
|
+
/** The set of issues this check might throw. */
|
|
1666
|
+
issc?: $ZodIssueBase;
|
|
1667
|
+
check(payload: ParsePayload<T>): MaybeAsync<void>;
|
|
1668
|
+
onattach: ((schema: $ZodType) => void)[];
|
|
1669
|
+
}
|
|
1670
|
+
interface $ZodCheck<in T = never> {
|
|
1671
|
+
_zod: $ZodCheckInternals<T>;
|
|
1672
|
+
}
|
|
1673
|
+
declare const $ZodCheck: $constructor<$ZodCheck<any>>;
|
|
1674
|
+
interface $ZodCheckMaxLengthDef extends $ZodCheckDef {
|
|
1675
|
+
check: "max_length";
|
|
1676
|
+
maximum: number;
|
|
1677
|
+
}
|
|
1678
|
+
interface $ZodCheckMaxLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
|
|
1679
|
+
def: $ZodCheckMaxLengthDef;
|
|
1680
|
+
issc: $ZodIssueTooBig<T>;
|
|
1681
|
+
}
|
|
1682
|
+
interface $ZodCheckMaxLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
|
|
1683
|
+
_zod: $ZodCheckMaxLengthInternals<T>;
|
|
1684
|
+
}
|
|
1685
|
+
declare const $ZodCheckMaxLength: $constructor<$ZodCheckMaxLength>;
|
|
1686
|
+
interface $ZodCheckMinLengthDef extends $ZodCheckDef {
|
|
1687
|
+
check: "min_length";
|
|
1688
|
+
minimum: number;
|
|
1689
|
+
}
|
|
1690
|
+
interface $ZodCheckMinLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
|
|
1691
|
+
def: $ZodCheckMinLengthDef;
|
|
1692
|
+
issc: $ZodIssueTooSmall<T>;
|
|
1693
|
+
}
|
|
1694
|
+
interface $ZodCheckMinLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
|
|
1695
|
+
_zod: $ZodCheckMinLengthInternals<T>;
|
|
1696
|
+
}
|
|
1697
|
+
declare const $ZodCheckMinLength: $constructor<$ZodCheckMinLength>;
|
|
1698
|
+
interface $ZodCheckLengthEqualsDef extends $ZodCheckDef {
|
|
1699
|
+
check: "length_equals";
|
|
1700
|
+
length: number;
|
|
1701
|
+
}
|
|
1702
|
+
interface $ZodCheckLengthEqualsInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
|
|
1703
|
+
def: $ZodCheckLengthEqualsDef;
|
|
1704
|
+
issc: $ZodIssueTooBig<T> | $ZodIssueTooSmall<T>;
|
|
1705
|
+
}
|
|
1706
|
+
interface $ZodCheckLengthEquals<T extends HasLength = HasLength> extends $ZodCheck<T> {
|
|
1707
|
+
_zod: $ZodCheckLengthEqualsInternals<T>;
|
|
1708
|
+
}
|
|
1709
|
+
declare const $ZodCheckLengthEquals: $constructor<$ZodCheckLengthEquals>;
|
|
1710
|
+
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";
|
|
1711
|
+
interface $ZodCheckStringFormatDef<Format extends string = string> extends $ZodCheckDef {
|
|
1712
|
+
check: "string_format";
|
|
1713
|
+
format: Format;
|
|
1714
|
+
pattern?: RegExp | undefined;
|
|
1715
|
+
}
|
|
1716
|
+
interface $ZodCheckStringFormatInternals extends $ZodCheckInternals<string> {
|
|
1717
|
+
def: $ZodCheckStringFormatDef;
|
|
1718
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
1719
|
+
}
|
|
1720
|
+
interface $ZodCheckRegexDef extends $ZodCheckStringFormatDef {
|
|
1721
|
+
format: "regex";
|
|
1722
|
+
pattern: RegExp;
|
|
1723
|
+
}
|
|
1724
|
+
interface $ZodCheckRegexInternals extends $ZodCheckInternals<string> {
|
|
1725
|
+
def: $ZodCheckRegexDef;
|
|
1726
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
1727
|
+
}
|
|
1728
|
+
interface $ZodCheckRegex extends $ZodCheck<string> {
|
|
1729
|
+
_zod: $ZodCheckRegexInternals;
|
|
1730
|
+
}
|
|
1731
|
+
declare const $ZodCheckRegex: $constructor<$ZodCheckRegex>;
|
|
1732
|
+
interface $ZodCheckLowerCaseDef extends $ZodCheckStringFormatDef<"lowercase"> {}
|
|
1733
|
+
interface $ZodCheckLowerCaseInternals extends $ZodCheckInternals<string> {
|
|
1734
|
+
def: $ZodCheckLowerCaseDef;
|
|
1735
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
1736
|
+
}
|
|
1737
|
+
interface $ZodCheckLowerCase extends $ZodCheck<string> {
|
|
1738
|
+
_zod: $ZodCheckLowerCaseInternals;
|
|
1739
|
+
}
|
|
1740
|
+
declare const $ZodCheckLowerCase: $constructor<$ZodCheckLowerCase>;
|
|
1741
|
+
interface $ZodCheckUpperCaseDef extends $ZodCheckStringFormatDef<"uppercase"> {}
|
|
1742
|
+
interface $ZodCheckUpperCaseInternals extends $ZodCheckInternals<string> {
|
|
1743
|
+
def: $ZodCheckUpperCaseDef;
|
|
1744
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
1745
|
+
}
|
|
1746
|
+
interface $ZodCheckUpperCase extends $ZodCheck<string> {
|
|
1747
|
+
_zod: $ZodCheckUpperCaseInternals;
|
|
1748
|
+
}
|
|
1749
|
+
declare const $ZodCheckUpperCase: $constructor<$ZodCheckUpperCase>;
|
|
1750
|
+
interface $ZodCheckIncludesDef extends $ZodCheckStringFormatDef<"includes"> {
|
|
1751
|
+
includes: string;
|
|
1752
|
+
position?: number | undefined;
|
|
1753
|
+
}
|
|
1754
|
+
interface $ZodCheckIncludesInternals extends $ZodCheckInternals<string> {
|
|
1755
|
+
def: $ZodCheckIncludesDef;
|
|
1756
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
1757
|
+
}
|
|
1758
|
+
interface $ZodCheckIncludes extends $ZodCheck<string> {
|
|
1759
|
+
_zod: $ZodCheckIncludesInternals;
|
|
1760
|
+
}
|
|
1761
|
+
declare const $ZodCheckIncludes: $constructor<$ZodCheckIncludes>;
|
|
1762
|
+
interface $ZodCheckStartsWithDef extends $ZodCheckStringFormatDef<"starts_with"> {
|
|
1763
|
+
prefix: string;
|
|
1764
|
+
}
|
|
1765
|
+
interface $ZodCheckStartsWithInternals extends $ZodCheckInternals<string> {
|
|
1766
|
+
def: $ZodCheckStartsWithDef;
|
|
1767
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
1768
|
+
}
|
|
1769
|
+
interface $ZodCheckStartsWith extends $ZodCheck<string> {
|
|
1770
|
+
_zod: $ZodCheckStartsWithInternals;
|
|
1771
|
+
}
|
|
1772
|
+
declare const $ZodCheckStartsWith: $constructor<$ZodCheckStartsWith>;
|
|
1773
|
+
interface $ZodCheckEndsWithDef extends $ZodCheckStringFormatDef<"ends_with"> {
|
|
1774
|
+
suffix: string;
|
|
1775
|
+
}
|
|
1776
|
+
interface $ZodCheckEndsWithInternals extends $ZodCheckInternals<string> {
|
|
1777
|
+
def: $ZodCheckEndsWithDef;
|
|
1778
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
1779
|
+
}
|
|
1780
|
+
interface $ZodCheckEndsWith extends $ZodCheckInternals<string> {
|
|
1781
|
+
_zod: $ZodCheckEndsWithInternals;
|
|
1782
|
+
}
|
|
1783
|
+
declare const $ZodCheckEndsWith: $constructor<$ZodCheckEndsWith>;
|
|
1784
|
+
//#endregion
|
|
1785
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.cts
|
|
1786
|
+
interface $ZodIssueBase {
|
|
1787
|
+
readonly code?: string;
|
|
1788
|
+
readonly input?: unknown;
|
|
1789
|
+
readonly path: PropertyKey[];
|
|
1790
|
+
readonly message: string;
|
|
1791
|
+
}
|
|
1792
|
+
type $ZodInvalidTypeExpected = "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "undefined" | "null" | "never" | "void" | "date" | "array" | "object" | "tuple" | "record" | "map" | "set" | "file" | "nonoptional" | "nan" | "function" | (string & {});
|
|
1793
|
+
interface $ZodIssueInvalidType<Input = unknown> extends $ZodIssueBase {
|
|
1794
|
+
readonly code: "invalid_type";
|
|
1795
|
+
readonly expected: $ZodInvalidTypeExpected;
|
|
1796
|
+
readonly input?: Input;
|
|
1797
|
+
}
|
|
1798
|
+
interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {
|
|
1799
|
+
readonly code: "too_big";
|
|
1800
|
+
readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
|
|
1801
|
+
readonly maximum: number | bigint;
|
|
1802
|
+
readonly inclusive?: boolean;
|
|
1803
|
+
readonly exact?: boolean;
|
|
1804
|
+
readonly input?: Input;
|
|
1805
|
+
}
|
|
1806
|
+
interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {
|
|
1807
|
+
readonly code: "too_small";
|
|
1808
|
+
readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
|
|
1809
|
+
readonly minimum: number | bigint;
|
|
1810
|
+
/** True if the allowable range includes the minimum */
|
|
1811
|
+
readonly inclusive?: boolean;
|
|
1812
|
+
/** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */
|
|
1813
|
+
readonly exact?: boolean;
|
|
1814
|
+
readonly input?: Input;
|
|
1815
|
+
}
|
|
1816
|
+
interface $ZodIssueInvalidStringFormat extends $ZodIssueBase {
|
|
1817
|
+
readonly code: "invalid_format";
|
|
1818
|
+
readonly format: $ZodStringFormats | (string & {});
|
|
1819
|
+
readonly pattern?: string;
|
|
1820
|
+
readonly input?: string;
|
|
1821
|
+
}
|
|
1822
|
+
interface $ZodIssueNotMultipleOf<Input extends number | bigint = number | bigint> extends $ZodIssueBase {
|
|
1823
|
+
readonly code: "not_multiple_of";
|
|
1824
|
+
readonly divisor: number;
|
|
1825
|
+
readonly input?: Input;
|
|
1826
|
+
}
|
|
1827
|
+
interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase {
|
|
1828
|
+
readonly code: "unrecognized_keys";
|
|
1829
|
+
readonly keys: string[];
|
|
1830
|
+
readonly input?: Record<string, unknown>;
|
|
1831
|
+
}
|
|
1832
|
+
interface $ZodIssueInvalidUnionNoMatch extends $ZodIssueBase {
|
|
1833
|
+
readonly code: "invalid_union";
|
|
1834
|
+
readonly errors: $ZodIssue[][];
|
|
1835
|
+
readonly input?: unknown;
|
|
1836
|
+
readonly discriminator?: string | undefined;
|
|
1837
|
+
readonly inclusive?: true;
|
|
1838
|
+
}
|
|
1839
|
+
interface $ZodIssueInvalidUnionMultipleMatch extends $ZodIssueBase {
|
|
1840
|
+
readonly code: "invalid_union";
|
|
1841
|
+
readonly errors: [];
|
|
1842
|
+
readonly input?: unknown;
|
|
1843
|
+
readonly discriminator?: string | undefined;
|
|
1844
|
+
readonly inclusive: false;
|
|
1845
|
+
}
|
|
1846
|
+
type $ZodIssueInvalidUnion = $ZodIssueInvalidUnionNoMatch | $ZodIssueInvalidUnionMultipleMatch;
|
|
1847
|
+
interface $ZodIssueInvalidKey<Input = unknown> extends $ZodIssueBase {
|
|
1848
|
+
readonly code: "invalid_key";
|
|
1849
|
+
readonly origin: "map" | "record";
|
|
1850
|
+
readonly issues: $ZodIssue[];
|
|
1851
|
+
readonly input?: Input;
|
|
1852
|
+
}
|
|
1853
|
+
interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase {
|
|
1854
|
+
readonly code: "invalid_element";
|
|
1855
|
+
readonly origin: "map" | "set";
|
|
1856
|
+
readonly key: unknown;
|
|
1857
|
+
readonly issues: $ZodIssue[];
|
|
1858
|
+
readonly input?: Input;
|
|
1859
|
+
}
|
|
1860
|
+
interface $ZodIssueInvalidValue<Input = unknown> extends $ZodIssueBase {
|
|
1861
|
+
readonly code: "invalid_value";
|
|
1862
|
+
readonly values: Primitive[];
|
|
1863
|
+
readonly input?: Input;
|
|
1864
|
+
}
|
|
1865
|
+
interface $ZodIssueCustom extends $ZodIssueBase {
|
|
1866
|
+
readonly code: "custom";
|
|
1867
|
+
readonly params?: Record<string, any> | undefined;
|
|
1868
|
+
readonly input?: unknown;
|
|
1869
|
+
}
|
|
1870
|
+
type $ZodIssue = $ZodIssueInvalidType | $ZodIssueTooBig | $ZodIssueTooSmall | $ZodIssueInvalidStringFormat | $ZodIssueNotMultipleOf | $ZodIssueUnrecognizedKeys | $ZodIssueInvalidUnion | $ZodIssueInvalidKey | $ZodIssueInvalidElement | $ZodIssueInvalidValue | $ZodIssueCustom;
|
|
1871
|
+
type $ZodInternalIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue$1<T> : never;
|
|
1872
|
+
type RawIssue$1<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
|
|
1873
|
+
/** The input data */readonly input: unknown; /** The schema or check that originated this issue. */
|
|
1874
|
+
readonly inst?: $ZodType | $ZodCheck; /** If `true`, Zod will continue executing checks/refinements after this issue. */
|
|
1875
|
+
readonly continue?: boolean | undefined;
|
|
1876
|
+
} & Record<string, unknown>> : never;
|
|
1877
|
+
type $ZodRawIssue<T extends $ZodIssueBase = $ZodIssue> = $ZodInternalIssue<T>;
|
|
1878
|
+
interface $ZodErrorMap<T extends $ZodIssueBase = $ZodIssue> {
|
|
1879
|
+
(issue: $ZodRawIssue<T>): {
|
|
1880
|
+
message: string;
|
|
1881
|
+
} | string | undefined | null;
|
|
1882
|
+
}
|
|
1883
|
+
interface $ZodError<T = unknown> extends Error {
|
|
1884
|
+
type: T;
|
|
1885
|
+
issues: $ZodIssue[];
|
|
1886
|
+
_zod: {
|
|
1887
|
+
output: T;
|
|
1888
|
+
def: $ZodIssue[];
|
|
1889
|
+
};
|
|
1890
|
+
stack?: string;
|
|
1891
|
+
name: string;
|
|
1892
|
+
}
|
|
1893
|
+
declare const $ZodError: $constructor<$ZodError>;
|
|
1894
|
+
type $ZodFlattenedError<T, U = string> = _FlattenedError<T, U>;
|
|
1895
|
+
type _FlattenedError<T, U = string> = {
|
|
1896
|
+
formErrors: U[];
|
|
1897
|
+
fieldErrors: { [P in keyof T]?: U[] };
|
|
1898
|
+
};
|
|
1899
|
+
type _ZodFormattedError<T, U = string> = T extends [any, ...any[]] ? { [K in keyof T]?: $ZodFormattedError<T[K], U> } : T extends any[] ? {
|
|
1900
|
+
[k: number]: $ZodFormattedError<T[number], U>;
|
|
1901
|
+
} : T extends object ? Flatten<{ [K in keyof T]?: $ZodFormattedError<T[K], U> }> : any;
|
|
1902
|
+
type $ZodFormattedError<T, U = string> = {
|
|
1903
|
+
_errors: U[];
|
|
1904
|
+
} & Flatten<_ZodFormattedError<T, U>>;
|
|
1905
|
+
//#endregion
|
|
1906
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.cts
|
|
1907
|
+
type ZodTrait = {
|
|
1908
|
+
_zod: {
|
|
1909
|
+
def: any;
|
|
1910
|
+
[k: string]: any;
|
|
1911
|
+
};
|
|
1912
|
+
};
|
|
1913
|
+
interface $constructor<T extends ZodTrait, D = T["_zod"]["def"]> {
|
|
1914
|
+
new (def: D): T;
|
|
1915
|
+
init(inst: T, def: D): asserts inst is T;
|
|
1916
|
+
}
|
|
1917
|
+
declare function $constructor<T extends ZodTrait, D = T["_zod"]["def"]>(name: string, initializer: (inst: T, def: D) => void, params?: {
|
|
1918
|
+
Parent?: typeof Class;
|
|
1919
|
+
}): $constructor<T, D>;
|
|
1920
|
+
declare const $brand: unique symbol;
|
|
1921
|
+
type $brand<T extends string | number | symbol = string | number | symbol> = {
|
|
1922
|
+
[$brand]: { [k in T]: true };
|
|
1923
|
+
};
|
|
1924
|
+
type $ZodBranded<T extends SomeType, Brand extends string | number | symbol, Dir extends "in" | "out" | "inout" = "out"> = T & (Dir extends "inout" ? {
|
|
1925
|
+
_zod: {
|
|
1926
|
+
input: input<T> & $brand<Brand>;
|
|
1927
|
+
output: output<T> & $brand<Brand>;
|
|
1928
|
+
};
|
|
1929
|
+
} : Dir extends "in" ? {
|
|
1930
|
+
_zod: {
|
|
1931
|
+
input: input<T> & $brand<Brand>;
|
|
1932
|
+
};
|
|
1933
|
+
} : {
|
|
1934
|
+
_zod: {
|
|
1935
|
+
output: output<T> & $brand<Brand>;
|
|
1936
|
+
};
|
|
1937
|
+
});
|
|
1938
|
+
type input<T> = T extends {
|
|
1939
|
+
_zod: {
|
|
1940
|
+
input: any;
|
|
1941
|
+
};
|
|
1942
|
+
} ? T["_zod"]["input"] : unknown;
|
|
1943
|
+
type output<T> = T extends {
|
|
1944
|
+
_zod: {
|
|
1945
|
+
output: any;
|
|
1946
|
+
};
|
|
1947
|
+
} ? T["_zod"]["output"] : unknown;
|
|
1948
|
+
//#endregion
|
|
1949
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.d.cts
|
|
1950
|
+
type Params<T extends $ZodType | $ZodCheck, IssueTypes extends $ZodIssueBase, OmitKeys extends keyof T["_zod"]["def"] = never> = Flatten<Partial<EmptyToNever<Omit<T["_zod"]["def"], OmitKeys> & ([IssueTypes] extends [never] ? {} : {
|
|
1951
|
+
error?: string | $ZodErrorMap<IssueTypes> | undefined; /** @deprecated This parameter is deprecated. Use `error` instead. */
|
|
1952
|
+
message?: string | undefined;
|
|
1953
|
+
})>>>;
|
|
1954
|
+
type TypeParams<T extends $ZodType = $ZodType & {
|
|
1955
|
+
_isst: never;
|
|
1956
|
+
}, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error"> = never> = Params<T, NonNullable<T["_zod"]["isst"]>, "type" | "checks" | "error" | AlsoOmit>;
|
|
1957
|
+
type CheckParams<T extends $ZodCheck = $ZodCheck, // & { _issc: never },
|
|
1958
|
+
AlsoOmit extends Exclude<keyof T["_zod"]["def"], "check" | "error"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "check" | "error" | AlsoOmit>;
|
|
1959
|
+
type CheckStringFormatParams<T extends $ZodStringFormat = $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>;
|
|
1960
|
+
type CheckTypeParams<T extends $ZodType & $ZodCheck = $ZodType & $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>;
|
|
1961
|
+
type $ZodCheckEmailParams = CheckStringFormatParams<$ZodEmail, "when">;
|
|
1962
|
+
type $ZodCheckGUIDParams = CheckStringFormatParams<$ZodGUID, "pattern" | "when">;
|
|
1963
|
+
type $ZodCheckUUIDParams = CheckStringFormatParams<$ZodUUID, "pattern" | "when">;
|
|
1964
|
+
type $ZodCheckURLParams = CheckStringFormatParams<$ZodURL, "when">;
|
|
1965
|
+
type $ZodCheckEmojiParams = CheckStringFormatParams<$ZodEmoji, "when">;
|
|
1966
|
+
type $ZodCheckNanoIDParams = CheckStringFormatParams<$ZodNanoID, "when">;
|
|
1967
|
+
type $ZodCheckCUIDParams = CheckStringFormatParams<$ZodCUID, "when">;
|
|
1968
|
+
type $ZodCheckCUID2Params = CheckStringFormatParams<$ZodCUID2, "when">;
|
|
1969
|
+
type $ZodCheckULIDParams = CheckStringFormatParams<$ZodULID, "when">;
|
|
1970
|
+
type $ZodCheckXIDParams = CheckStringFormatParams<$ZodXID, "when">;
|
|
1971
|
+
type $ZodCheckKSUIDParams = CheckStringFormatParams<$ZodKSUID, "when">;
|
|
1972
|
+
type $ZodCheckIPv4Params = CheckStringFormatParams<$ZodIPv4, "pattern" | "when" | "version">;
|
|
1973
|
+
type $ZodCheckIPv6Params = CheckStringFormatParams<$ZodIPv6, "pattern" | "when" | "version">;
|
|
1974
|
+
type $ZodCheckCIDRv4Params = CheckStringFormatParams<$ZodCIDRv4, "pattern" | "when">;
|
|
1975
|
+
type $ZodCheckCIDRv6Params = CheckStringFormatParams<$ZodCIDRv6, "pattern" | "when">;
|
|
1976
|
+
type $ZodCheckBase64Params = CheckStringFormatParams<$ZodBase64, "pattern" | "when">;
|
|
1977
|
+
type $ZodCheckBase64URLParams = CheckStringFormatParams<$ZodBase64URL, "pattern" | "when">;
|
|
1978
|
+
type $ZodCheckE164Params = CheckStringFormatParams<$ZodE164, "when">;
|
|
1979
|
+
type $ZodCheckJWTParams = CheckStringFormatParams<$ZodJWT, "pattern" | "when">;
|
|
1980
|
+
type $ZodCheckISODateTimeParams = CheckStringFormatParams<$ZodISODateTime, "pattern" | "when">;
|
|
1981
|
+
type $ZodCheckISODateParams = CheckStringFormatParams<$ZodISODate, "pattern" | "when">;
|
|
1982
|
+
type $ZodCheckISOTimeParams = CheckStringFormatParams<$ZodISOTime, "pattern" | "when">;
|
|
1983
|
+
type $ZodCheckISODurationParams = CheckStringFormatParams<$ZodISODuration, "when">;
|
|
1984
|
+
type $ZodCheckMaxLengthParams = CheckParams<$ZodCheckMaxLength, "maximum" | "when">;
|
|
1985
|
+
type $ZodCheckMinLengthParams = CheckParams<$ZodCheckMinLength, "minimum" | "when">;
|
|
1986
|
+
type $ZodCheckLengthEqualsParams = CheckParams<$ZodCheckLengthEquals, "length" | "when">;
|
|
1987
|
+
type $ZodCheckRegexParams = CheckParams<$ZodCheckRegex, "format" | "pattern" | "when">;
|
|
1988
|
+
type $ZodCheckLowerCaseParams = CheckParams<$ZodCheckLowerCase, "format" | "when">;
|
|
1989
|
+
type $ZodCheckUpperCaseParams = CheckParams<$ZodCheckUpperCase, "format" | "when">;
|
|
1990
|
+
type $ZodCheckIncludesParams = CheckParams<$ZodCheckIncludes, "includes" | "format" | "when" | "pattern">;
|
|
1991
|
+
type $ZodCheckStartsWithParams = CheckParams<$ZodCheckStartsWith, "prefix" | "format" | "when" | "pattern">;
|
|
1992
|
+
type $ZodCheckEndsWithParams = CheckParams<$ZodCheckEndsWith, "suffix" | "format" | "pattern" | "when">;
|
|
1993
|
+
type $ZodEnumParams = TypeParams<$ZodEnum, "entries">;
|
|
1994
|
+
type $ZodNonOptionalParams = TypeParams<$ZodNonOptional, "innerType">;
|
|
1995
|
+
type $ZodCustomParams = CheckTypeParams<$ZodCustom, "fn">;
|
|
1996
|
+
type $ZodSuperRefineIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;
|
|
1997
|
+
type RawIssue<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
|
|
1998
|
+
/** The schema or check that originated this issue. */readonly inst?: $ZodType | $ZodCheck; /** If `true`, Zod will execute subsequent checks/refinements instead of immediately aborting */
|
|
1999
|
+
readonly continue?: boolean | undefined;
|
|
2000
|
+
} & Record<string, unknown>> : never;
|
|
2001
|
+
interface $RefinementCtx<T = unknown> extends ParsePayload<T> {
|
|
2002
|
+
addIssue(arg: string | $ZodSuperRefineIssue): void;
|
|
2003
|
+
}
|
|
2004
|
+
//#endregion
|
|
2005
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.d.cts
|
|
2006
|
+
/** An Error-like class used to store Zod validation issues. */
|
|
2007
|
+
interface ZodError<T = unknown> extends $ZodError<T> {
|
|
2008
|
+
/** @deprecated Use the `z.treeifyError(err)` function instead. */
|
|
2009
|
+
format(): $ZodFormattedError<T>;
|
|
2010
|
+
format<U>(mapper: (issue: $ZodIssue) => U): $ZodFormattedError<T, U>;
|
|
2011
|
+
/** @deprecated Use the `z.treeifyError(err)` function instead. */
|
|
2012
|
+
flatten(): $ZodFlattenedError<T>;
|
|
2013
|
+
flatten<U>(mapper: (issue: $ZodIssue) => U): $ZodFlattenedError<T, U>;
|
|
2014
|
+
/** @deprecated Push directly to `.issues` instead. */
|
|
2015
|
+
addIssue(issue: $ZodIssue): void;
|
|
2016
|
+
/** @deprecated Push directly to `.issues` instead. */
|
|
2017
|
+
addIssues(issues: $ZodIssue[]): void;
|
|
2018
|
+
/** @deprecated Check `err.issues.length === 0` instead. */
|
|
2019
|
+
isEmpty: boolean;
|
|
2020
|
+
}
|
|
2021
|
+
declare const ZodError: $constructor<ZodError>;
|
|
2022
|
+
//#endregion
|
|
2023
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.d.cts
|
|
2024
|
+
type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;
|
|
2025
|
+
type ZodSafeParseSuccess<T> = {
|
|
2026
|
+
success: true;
|
|
2027
|
+
data: T;
|
|
2028
|
+
error?: never;
|
|
2029
|
+
};
|
|
2030
|
+
type ZodSafeParseError<T> = {
|
|
2031
|
+
success: false;
|
|
2032
|
+
data?: never;
|
|
2033
|
+
error: ZodError<T>;
|
|
2034
|
+
};
|
|
2035
|
+
//#endregion
|
|
2036
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.d.cts
|
|
2037
|
+
type ZodStandardSchemaWithJSON<T> = StandardSchemaWithJSONProps<input<T>, output<T>>;
|
|
2038
|
+
interface ZodType<out Output = unknown, out Input = unknown, out Internals extends $ZodTypeInternals<Output, Input> = $ZodTypeInternals<Output, Input>> extends $ZodType<Output, Input, Internals> {
|
|
2039
|
+
def: Internals["def"];
|
|
2040
|
+
type: Internals["def"]["type"];
|
|
2041
|
+
/** @deprecated Use `.def` instead. */
|
|
2042
|
+
_def: Internals["def"];
|
|
2043
|
+
/** @deprecated Use `z.output<typeof schema>` instead. */
|
|
2044
|
+
_output: Internals["output"];
|
|
2045
|
+
/** @deprecated Use `z.input<typeof schema>` instead. */
|
|
2046
|
+
_input: Internals["input"];
|
|
2047
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2048
|
+
/** Converts this schema to a JSON Schema representation. */
|
|
2049
|
+
toJSONSchema(params?: ToJSONSchemaParams): ZodStandardJSONSchemaPayload<this>;
|
|
2050
|
+
check(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
|
|
2051
|
+
with(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
|
|
2052
|
+
clone(def?: Internals["def"], params?: {
|
|
2053
|
+
parent: boolean;
|
|
2054
|
+
}): this;
|
|
2055
|
+
register<R extends $ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [$replace<R["_meta"], this>?] : [$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
|
|
2056
|
+
brand<T extends PropertyKey = PropertyKey, Dir extends "in" | "out" | "inout" = "out">(value?: T): PropertyKey extends T ? this : $ZodBranded<this, T, Dir>;
|
|
2057
|
+
parse(data: unknown, params?: ParseContext<$ZodIssue>): output<this>;
|
|
2058
|
+
safeParse(data: unknown, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output<this>>;
|
|
2059
|
+
parseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
|
|
2060
|
+
safeParseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
|
|
2061
|
+
spa: (data: unknown, params?: ParseContext<$ZodIssue>) => Promise<ZodSafeParseResult<output<this>>>;
|
|
2062
|
+
encode(data: output<this>, params?: ParseContext<$ZodIssue>): input<this>;
|
|
2063
|
+
decode(data: input<this>, params?: ParseContext<$ZodIssue>): output<this>;
|
|
2064
|
+
encodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<input<this>>;
|
|
2065
|
+
decodeAsync(data: input<this>, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
|
|
2066
|
+
safeEncode(data: output<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<input<this>>;
|
|
2067
|
+
safeDecode(data: input<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output<this>>;
|
|
2068
|
+
safeEncodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<input<this>>>;
|
|
2069
|
+
safeDecodeAsync(data: input<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
|
|
2070
|
+
refine<Ch extends (arg: output<this>) => unknown | Promise<unknown>>(check: Ch, params?: string | $ZodCustomParams): Ch extends ((arg: any) => arg is infer R) ? this & ZodType<R, input<this>> : this;
|
|
2071
|
+
superRefine(refinement: (arg: output<this>, ctx: $RefinementCtx<output<this>>) => void | Promise<void>): this;
|
|
2072
|
+
overwrite(fn: (x: output<this>) => output<this>): this;
|
|
2073
|
+
optional(): ZodOptional<this>;
|
|
2074
|
+
exactOptional(): ZodExactOptional<this>;
|
|
2075
|
+
nonoptional(params?: string | $ZodNonOptionalParams): ZodNonOptional<this>;
|
|
2076
|
+
nullable(): ZodNullable<this>;
|
|
2077
|
+
nullish(): ZodOptional<ZodNullable<this>>;
|
|
2078
|
+
default(def: NoUndefined<output<this>>): ZodDefault<this>;
|
|
2079
|
+
default(def: () => NoUndefined<output<this>>): ZodDefault<this>;
|
|
2080
|
+
prefault(def: () => input<this>): ZodPrefault<this>;
|
|
2081
|
+
prefault(def: input<this>): ZodPrefault<this>;
|
|
2082
|
+
array(): ZodArray<this>;
|
|
2083
|
+
or<T extends SomeType>(option: T): ZodUnion<[this, T]>;
|
|
2084
|
+
and<T extends SomeType>(incoming: T): ZodIntersection<this, T>;
|
|
2085
|
+
transform<NewOut>(transform: (arg: output<this>, ctx: $RefinementCtx<output<this>>) => NewOut | Promise<NewOut>): ZodPipe<this, ZodTransform<Awaited<NewOut>, output<this>>>;
|
|
2086
|
+
catch(def: output<this>): ZodCatch<this>;
|
|
2087
|
+
catch(def: (ctx: $ZodCatchCtx) => output<this>): ZodCatch<this>;
|
|
2088
|
+
pipe<T extends $ZodType<any, output<this>>>(target: T | $ZodType<any, output<this>>): ZodPipe<this, T>;
|
|
2089
|
+
readonly(): ZodReadonly<this>;
|
|
2090
|
+
/** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
|
|
2091
|
+
describe(description: string): this;
|
|
2092
|
+
description?: string;
|
|
2093
|
+
/** Returns the metadata associated with this instance in `z.globalRegistry` */
|
|
2094
|
+
meta(): $replace<GlobalMeta, this> | undefined;
|
|
2095
|
+
/** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
|
|
2096
|
+
meta(data: $replace<GlobalMeta, this>): this;
|
|
2097
|
+
/** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally):
|
|
2098
|
+
*
|
|
2099
|
+
* ```ts
|
|
2100
|
+
* const schema = z.string().optional();
|
|
2101
|
+
* const isOptional = schema.safeParse(undefined).success; // true
|
|
2102
|
+
* ```
|
|
2103
|
+
*/
|
|
2104
|
+
isOptional(): boolean;
|
|
2105
|
+
/**
|
|
2106
|
+
* @deprecated Try safe-parsing `null` (this is what `isNullable` does internally):
|
|
2107
|
+
*
|
|
2108
|
+
* ```ts
|
|
2109
|
+
* const schema = z.string().nullable();
|
|
2110
|
+
* const isNullable = schema.safeParse(null).success; // true
|
|
2111
|
+
* ```
|
|
2112
|
+
*/
|
|
2113
|
+
isNullable(): boolean;
|
|
2114
|
+
apply<T>(fn: (schema: this) => T): T;
|
|
2115
|
+
}
|
|
2116
|
+
interface _ZodType<out Internals extends $ZodTypeInternals = $ZodTypeInternals> extends ZodType<any, any, Internals> {}
|
|
2117
|
+
declare const ZodType: $constructor<ZodType>;
|
|
2118
|
+
interface _ZodString<T extends $ZodStringInternals<unknown> = $ZodStringInternals<unknown>> extends _ZodType<T> {
|
|
2119
|
+
format: string | null;
|
|
2120
|
+
minLength: number | null;
|
|
2121
|
+
maxLength: number | null;
|
|
2122
|
+
regex(regex: RegExp, params?: string | $ZodCheckRegexParams): this;
|
|
2123
|
+
includes(value: string, params?: string | $ZodCheckIncludesParams): this;
|
|
2124
|
+
startsWith(value: string, params?: string | $ZodCheckStartsWithParams): this;
|
|
2125
|
+
endsWith(value: string, params?: string | $ZodCheckEndsWithParams): this;
|
|
2126
|
+
min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
|
|
2127
|
+
max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
|
|
2128
|
+
length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
|
|
2129
|
+
nonempty(params?: string | $ZodCheckMinLengthParams): this;
|
|
2130
|
+
lowercase(params?: string | $ZodCheckLowerCaseParams): this;
|
|
2131
|
+
uppercase(params?: string | $ZodCheckUpperCaseParams): this;
|
|
2132
|
+
trim(): this;
|
|
2133
|
+
normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this;
|
|
2134
|
+
toLowerCase(): this;
|
|
2135
|
+
toUpperCase(): this;
|
|
2136
|
+
slugify(): this;
|
|
2137
|
+
}
|
|
2138
|
+
/** @internal */
|
|
2139
|
+
declare const _ZodString: $constructor<_ZodString>;
|
|
2140
|
+
interface ZodString extends _ZodString<$ZodStringInternals<string>> {
|
|
2141
|
+
/** @deprecated Use `z.email()` instead. */
|
|
2142
|
+
email(params?: string | $ZodCheckEmailParams): this;
|
|
2143
|
+
/** @deprecated Use `z.url()` instead. */
|
|
2144
|
+
url(params?: string | $ZodCheckURLParams): this;
|
|
2145
|
+
/** @deprecated Use `z.jwt()` instead. */
|
|
2146
|
+
jwt(params?: string | $ZodCheckJWTParams): this;
|
|
2147
|
+
/** @deprecated Use `z.emoji()` instead. */
|
|
2148
|
+
emoji(params?: string | $ZodCheckEmojiParams): this;
|
|
2149
|
+
/** @deprecated Use `z.guid()` instead. */
|
|
2150
|
+
guid(params?: string | $ZodCheckGUIDParams): this;
|
|
2151
|
+
/** @deprecated Use `z.uuid()` instead. */
|
|
2152
|
+
uuid(params?: string | $ZodCheckUUIDParams): this;
|
|
2153
|
+
/** @deprecated Use `z.uuid()` instead. */
|
|
2154
|
+
uuidv4(params?: string | $ZodCheckUUIDParams): this;
|
|
2155
|
+
/** @deprecated Use `z.uuid()` instead. */
|
|
2156
|
+
uuidv6(params?: string | $ZodCheckUUIDParams): this;
|
|
2157
|
+
/** @deprecated Use `z.uuid()` instead. */
|
|
2158
|
+
uuidv7(params?: string | $ZodCheckUUIDParams): this;
|
|
2159
|
+
/** @deprecated Use `z.nanoid()` instead. */
|
|
2160
|
+
nanoid(params?: string | $ZodCheckNanoIDParams): this;
|
|
2161
|
+
/** @deprecated Use `z.guid()` instead. */
|
|
2162
|
+
guid(params?: string | $ZodCheckGUIDParams): this;
|
|
2163
|
+
/** @deprecated Use `z.cuid()` instead. */
|
|
2164
|
+
cuid(params?: string | $ZodCheckCUIDParams): this;
|
|
2165
|
+
/** @deprecated Use `z.cuid2()` instead. */
|
|
2166
|
+
cuid2(params?: string | $ZodCheckCUID2Params): this;
|
|
2167
|
+
/** @deprecated Use `z.ulid()` instead. */
|
|
2168
|
+
ulid(params?: string | $ZodCheckULIDParams): this;
|
|
2169
|
+
/** @deprecated Use `z.base64()` instead. */
|
|
2170
|
+
base64(params?: string | $ZodCheckBase64Params): this;
|
|
2171
|
+
/** @deprecated Use `z.base64url()` instead. */
|
|
2172
|
+
base64url(params?: string | $ZodCheckBase64URLParams): this;
|
|
2173
|
+
/** @deprecated Use `z.xid()` instead. */
|
|
2174
|
+
xid(params?: string | $ZodCheckXIDParams): this;
|
|
2175
|
+
/** @deprecated Use `z.ksuid()` instead. */
|
|
2176
|
+
ksuid(params?: string | $ZodCheckKSUIDParams): this;
|
|
2177
|
+
/** @deprecated Use `z.ipv4()` instead. */
|
|
2178
|
+
ipv4(params?: string | $ZodCheckIPv4Params): this;
|
|
2179
|
+
/** @deprecated Use `z.ipv6()` instead. */
|
|
2180
|
+
ipv6(params?: string | $ZodCheckIPv6Params): this;
|
|
2181
|
+
/** @deprecated Use `z.cidrv4()` instead. */
|
|
2182
|
+
cidrv4(params?: string | $ZodCheckCIDRv4Params): this;
|
|
2183
|
+
/** @deprecated Use `z.cidrv6()` instead. */
|
|
2184
|
+
cidrv6(params?: string | $ZodCheckCIDRv6Params): this;
|
|
2185
|
+
/** @deprecated Use `z.e164()` instead. */
|
|
2186
|
+
e164(params?: string | $ZodCheckE164Params): this;
|
|
2187
|
+
/** @deprecated Use `z.iso.datetime()` instead. */
|
|
2188
|
+
datetime(params?: string | $ZodCheckISODateTimeParams): this;
|
|
2189
|
+
/** @deprecated Use `z.iso.date()` instead. */
|
|
2190
|
+
date(params?: string | $ZodCheckISODateParams): this;
|
|
2191
|
+
/** @deprecated Use `z.iso.time()` instead. */
|
|
2192
|
+
time(params?: string | $ZodCheckISOTimeParams): this;
|
|
2193
|
+
/** @deprecated Use `z.iso.duration()` instead. */
|
|
2194
|
+
duration(params?: string | $ZodCheckISODurationParams): this;
|
|
2195
|
+
}
|
|
2196
|
+
declare const ZodString: $constructor<ZodString>;
|
|
2197
|
+
interface _ZodBoolean<T extends $ZodBooleanInternals = $ZodBooleanInternals> extends _ZodType<T> {}
|
|
2198
|
+
interface ZodBoolean extends _ZodBoolean<$ZodBooleanInternals<boolean>> {}
|
|
2199
|
+
declare const ZodBoolean: $constructor<ZodBoolean>;
|
|
2200
|
+
interface ZodUnknown extends _ZodType<$ZodUnknownInternals> {}
|
|
2201
|
+
declare const ZodUnknown: $constructor<ZodUnknown>;
|
|
2202
|
+
interface ZodArray<T extends SomeType = $ZodType> extends _ZodType<$ZodArrayInternals<T>>, $ZodArray<T> {
|
|
2203
|
+
element: T;
|
|
2204
|
+
min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
|
|
2205
|
+
nonempty(params?: string | $ZodCheckMinLengthParams): this;
|
|
2206
|
+
max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
|
|
2207
|
+
length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
|
|
2208
|
+
unwrap(): T;
|
|
2209
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2210
|
+
}
|
|
2211
|
+
declare const ZodArray: $constructor<ZodArray>;
|
|
2212
|
+
type SafeExtendShape<Base extends $ZodShape, Ext extends $ZodLooseShape> = { [K in keyof Ext]: K extends keyof Base ? output<Ext[K]> extends output<Base[K]> ? input<Ext[K]> extends input<Base[K]> ? Ext[K] : never : never : Ext[K] };
|
|
2213
|
+
interface ZodObject< /** @ts-ignore Cast variance */out Shape extends $ZodShape = $ZodLooseShape, out Config extends $ZodObjectConfig = $strip> extends _ZodType<$ZodObjectInternals<Shape, Config>>, $ZodObject<Shape, Config> {
|
|
2214
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2215
|
+
shape: Shape;
|
|
2216
|
+
keyof(): ZodEnum<ToEnum<keyof Shape & string>>;
|
|
2217
|
+
/** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
|
|
2218
|
+
catchall<T extends SomeType>(schema: T): ZodObject<Shape, $catchall<T>>;
|
|
2219
|
+
/** @deprecated Use `z.looseObject()` or `.loose()` instead. */
|
|
2220
|
+
passthrough(): ZodObject<Shape, $loose>;
|
|
2221
|
+
/** Consider `z.looseObject(A.shape)` instead */
|
|
2222
|
+
loose(): ZodObject<Shape, $loose>;
|
|
2223
|
+
/** Consider `z.strictObject(A.shape)` instead */
|
|
2224
|
+
strict(): ZodObject<Shape, $strict>;
|
|
2225
|
+
/** This is the default behavior. This method call is likely unnecessary. */
|
|
2226
|
+
strip(): ZodObject<Shape, $strip>;
|
|
2227
|
+
extend<U extends $ZodLooseShape>(shape: U): ZodObject<Extend<Shape, U>, Config>;
|
|
2228
|
+
safeExtend<U extends $ZodLooseShape>(shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, SomeType>>): ZodObject<Extend<Shape, U>, Config>;
|
|
2229
|
+
/**
|
|
2230
|
+
* @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
|
|
2231
|
+
*/
|
|
2232
|
+
merge<U extends ZodObject>(other: U): ZodObject<Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
|
|
2233
|
+
pick<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
|
|
2234
|
+
omit<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config>;
|
|
2235
|
+
partial(): ZodObject<{ [k in keyof Shape]: ZodOptional<Shape[k]> }, Config>;
|
|
2236
|
+
partial<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{ [k in keyof Shape]: k extends keyof M ? ZodOptional<Shape[k]> : Shape[k] }, Config>;
|
|
2237
|
+
required(): ZodObject<{ [k in keyof Shape]: ZodNonOptional<Shape[k]> }, Config>;
|
|
2238
|
+
required<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{ [k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k] }, Config>;
|
|
2239
|
+
}
|
|
2240
|
+
declare const ZodObject: $constructor<ZodObject>;
|
|
2241
|
+
interface ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends _ZodType<$ZodUnionInternals<T>>, $ZodUnion<T> {
|
|
2242
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2243
|
+
options: T;
|
|
2244
|
+
}
|
|
2245
|
+
declare const ZodUnion: $constructor<ZodUnion>;
|
|
2246
|
+
interface ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodIntersectionInternals<A, B>>, $ZodIntersection<A, B> {
|
|
2247
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2248
|
+
}
|
|
2249
|
+
declare const ZodIntersection: $constructor<ZodIntersection>;
|
|
2250
|
+
interface ZodEnum< /** @ts-ignore Cast variance */out T extends EnumLike = EnumLike> extends _ZodType<$ZodEnumInternals<T>>, $ZodEnum<T> {
|
|
2251
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2252
|
+
enum: T;
|
|
2253
|
+
options: Array<T[keyof T]>;
|
|
2254
|
+
extract<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Pick<T, U[number]>>>;
|
|
2255
|
+
exclude<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Omit<T, U[number]>>>;
|
|
2256
|
+
}
|
|
2257
|
+
declare const ZodEnum: $constructor<ZodEnum>;
|
|
2258
|
+
interface ZodLiteral<T extends Literal = Literal> extends _ZodType<$ZodLiteralInternals<T>>, $ZodLiteral<T> {
|
|
2259
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2260
|
+
values: Set<T>;
|
|
2261
|
+
/** @legacy Use `.values` instead. Accessing this property will throw an error if the literal accepts multiple values. */
|
|
2262
|
+
value: T;
|
|
2263
|
+
}
|
|
2264
|
+
declare const ZodLiteral: $constructor<ZodLiteral>;
|
|
2265
|
+
interface ZodTransform<O = unknown, I = unknown> extends _ZodType<$ZodTransformInternals<O, I>>, $ZodTransform<O, I> {
|
|
2266
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2267
|
+
}
|
|
2268
|
+
declare const ZodTransform: $constructor<ZodTransform>;
|
|
2269
|
+
interface ZodOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodOptionalInternals<T>>, $ZodOptional<T> {
|
|
2270
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2271
|
+
unwrap(): T;
|
|
2272
|
+
}
|
|
2273
|
+
declare const ZodOptional: $constructor<ZodOptional>;
|
|
2274
|
+
interface ZodExactOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodExactOptionalInternals<T>>, $ZodExactOptional<T> {
|
|
2275
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2276
|
+
unwrap(): T;
|
|
2277
|
+
}
|
|
2278
|
+
declare const ZodExactOptional: $constructor<ZodExactOptional>;
|
|
2279
|
+
interface ZodNullable<T extends SomeType = $ZodType> extends _ZodType<$ZodNullableInternals<T>>, $ZodNullable<T> {
|
|
2280
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2281
|
+
unwrap(): T;
|
|
2282
|
+
}
|
|
2283
|
+
declare const ZodNullable: $constructor<ZodNullable>;
|
|
2284
|
+
interface ZodDefault<T extends SomeType = $ZodType> extends _ZodType<$ZodDefaultInternals<T>>, $ZodDefault<T> {
|
|
2285
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2286
|
+
unwrap(): T;
|
|
2287
|
+
/** @deprecated Use `.unwrap()` instead. */
|
|
2288
|
+
removeDefault(): T;
|
|
2289
|
+
}
|
|
2290
|
+
declare const ZodDefault: $constructor<ZodDefault>;
|
|
2291
|
+
interface ZodPrefault<T extends SomeType = $ZodType> extends _ZodType<$ZodPrefaultInternals<T>>, $ZodPrefault<T> {
|
|
2292
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2293
|
+
unwrap(): T;
|
|
2294
|
+
}
|
|
2295
|
+
declare const ZodPrefault: $constructor<ZodPrefault>;
|
|
2296
|
+
interface ZodNonOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodNonOptionalInternals<T>>, $ZodNonOptional<T> {
|
|
2297
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2298
|
+
unwrap(): T;
|
|
2299
|
+
}
|
|
2300
|
+
declare const ZodNonOptional: $constructor<ZodNonOptional>;
|
|
2301
|
+
interface ZodCatch<T extends SomeType = $ZodType> extends _ZodType<$ZodCatchInternals<T>>, $ZodCatch<T> {
|
|
2302
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2303
|
+
unwrap(): T;
|
|
2304
|
+
/** @deprecated Use `.unwrap()` instead. */
|
|
2305
|
+
removeCatch(): T;
|
|
2306
|
+
}
|
|
2307
|
+
declare const ZodCatch: $constructor<ZodCatch>;
|
|
2308
|
+
interface ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodPipeInternals<A, B>>, $ZodPipe<A, B> {
|
|
2309
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2310
|
+
in: A;
|
|
2311
|
+
out: B;
|
|
2312
|
+
}
|
|
2313
|
+
declare const ZodPipe: $constructor<ZodPipe>;
|
|
2314
|
+
interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadonlyInternals<T>>, $ZodReadonly<T> {
|
|
2315
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2316
|
+
unwrap(): T;
|
|
2317
|
+
}
|
|
2318
|
+
declare const ZodReadonly: $constructor<ZodReadonly>;
|
|
2319
|
+
//#endregion
|
|
2320
|
+
//#region src/registry/registry-schema.d.ts
|
|
2321
|
+
/** 条目类型——对齐 install 管道的三种 ContentType。 */
|
|
2322
|
+
declare const registryEntryTypeSchema: ZodEnum<{
|
|
2323
|
+
plugin: "plugin";
|
|
2324
|
+
skill: "skill";
|
|
2325
|
+
mcp: "mcp";
|
|
2326
|
+
}>;
|
|
2327
|
+
declare const registryEntrySchema: ZodObject<{
|
|
2328
|
+
id: ZodString;
|
|
2329
|
+
type: ZodEnum<{
|
|
2330
|
+
plugin: "plugin";
|
|
2331
|
+
skill: "skill";
|
|
2332
|
+
mcp: "mcp";
|
|
2333
|
+
}>;
|
|
2334
|
+
description: ZodString;
|
|
2335
|
+
source: ZodString;
|
|
2336
|
+
subPath: ZodOptional<ZodString>;
|
|
2337
|
+
capabilities: ZodOptional<ZodArray<ZodString>>;
|
|
2338
|
+
keywords: ZodOptional<ZodArray<ZodString>>;
|
|
2339
|
+
author: ZodOptional<ZodString>;
|
|
2340
|
+
homepage: ZodOptional<ZodString>;
|
|
2341
|
+
versionPolicy: ZodOptional<ZodEnum<{
|
|
2342
|
+
"latest-tag": "latest-tag";
|
|
2343
|
+
"latest-release": "latest-release";
|
|
2344
|
+
}>>;
|
|
2345
|
+
deprecated: ZodOptional<ZodUnion<readonly [ZodBoolean, ZodObject<{
|
|
2346
|
+
reason: ZodString;
|
|
2347
|
+
alternative: ZodOptional<ZodString>;
|
|
2348
|
+
}, $strip>]>>;
|
|
2349
|
+
}, $strip>;
|
|
2350
|
+
declare const registrySchema: ZodObject<{
|
|
2351
|
+
version: ZodLiteral<1>;
|
|
2352
|
+
name: ZodString;
|
|
2353
|
+
entries: ZodArray<ZodUnknown>;
|
|
2354
|
+
}, $strip>;
|
|
2355
|
+
type RegistryEntryType = output<typeof registryEntryTypeSchema>;
|
|
2356
|
+
type RegistryEntry = output<typeof registryEntrySchema>;
|
|
2357
|
+
interface ParsedRegistry {
|
|
2358
|
+
name: string;
|
|
2359
|
+
version: 1;
|
|
2360
|
+
entries: RegistryEntry[];
|
|
2361
|
+
/** 宽容解析中被跳过的坏条目(index + 原因)——单条目坏不拖垮整表。 */
|
|
2362
|
+
rejected: Array<{
|
|
2363
|
+
index: number;
|
|
2364
|
+
reason: string;
|
|
2365
|
+
}>;
|
|
2366
|
+
}
|
|
2367
|
+
/**
|
|
2368
|
+
* 宽容解析(对齐 manifest 解析纪律):外层结构(version/name)硬校验,
|
|
2369
|
+
* entries 逐条 failSoft——坏条目记入 rejected 并跳过,不拖垮整表。
|
|
2370
|
+
*/
|
|
2371
|
+
declare function parseRegistry(raw: unknown): ParsedRegistry;
|
|
2372
|
+
//#endregion
|
|
2373
|
+
//#region src/registry/registry-client.d.ts
|
|
2374
|
+
interface RegistrySourceConfig {
|
|
2375
|
+
/** 源名(唯一键;官方源恒为 'otto-official')。 */
|
|
2376
|
+
name: string;
|
|
2377
|
+
/** http(s) URL 或 file: 路径或裸本地路径。 */
|
|
2378
|
+
url: string;
|
|
2379
|
+
/** 内置官方源不可 remove,只可 disable。 */
|
|
2380
|
+
builtin?: boolean;
|
|
2381
|
+
disabled?: boolean;
|
|
2382
|
+
}
|
|
2383
|
+
interface RegistriesFile {
|
|
2384
|
+
version: 1;
|
|
2385
|
+
sources: RegistrySourceConfig[];
|
|
2386
|
+
}
|
|
2387
|
+
interface LoadedRegistry extends ParsedRegistry {
|
|
2388
|
+
sourceName: string;
|
|
2389
|
+
sourceUrl: string;
|
|
2390
|
+
/** true = fetch 失败降级到过期缓存(结果仍可用但可能陈旧)。 */
|
|
2391
|
+
stale: boolean;
|
|
2392
|
+
}
|
|
2393
|
+
/** 官方源缺省条目(url 由调用方装配注入——发布形态未定期间指向仓内文件)。 */
|
|
2394
|
+
declare function builtinOfficialSource(url: string): RegistrySourceConfig;
|
|
2395
|
+
declare class RegistryClient {
|
|
2396
|
+
private readonly options;
|
|
2397
|
+
constructor(options: {
|
|
2398
|
+
/** 用户配置目录(~/.config/otto)。 */configDir: string; /** 缓存目录父级(OTTO_HOME)。 */
|
|
2399
|
+
ottoHome: string; /** 内置官方源(装配注入;测试可替换)。 */
|
|
2400
|
+
officialSource: RegistrySourceConfig;
|
|
2401
|
+
fetchImpl?: typeof fetch;
|
|
2402
|
+
});
|
|
2403
|
+
private get registriesPath();
|
|
2404
|
+
private get cacheDir();
|
|
2405
|
+
/** 读源清单(官方源恒在首位;用户文件坏/缺时退化为仅官方源)。 */
|
|
2406
|
+
listSources(): RegistrySourceConfig[];
|
|
2407
|
+
addSource(name: string, url: string): void;
|
|
2408
|
+
removeSource(name: string): void;
|
|
2409
|
+
/**
|
|
2410
|
+
* 启用/禁用某个 registry 源。
|
|
2411
|
+
* - 官方源:仅写 disabled 标记进用户配置(保留 builtin/url 等元信息不变)。
|
|
2412
|
+
* - 第三方源:改写用户配置中该条目的 disabled 字段;条目不存在则抛错。
|
|
2413
|
+
*/
|
|
2414
|
+
setSourceEnabled(name: string, enabled: boolean): void;
|
|
2415
|
+
/** 拉取全部启用源(缓存优先 → fetch → 陈旧缓存降级)。坏源跳过并记 warning。 */
|
|
2416
|
+
loadAll(): Promise<{
|
|
2417
|
+
registries: LoadedRegistry[];
|
|
2418
|
+
warnings: string[];
|
|
2419
|
+
}>;
|
|
2420
|
+
private loadOne;
|
|
2421
|
+
private readUserSources;
|
|
2422
|
+
private writeUserSources;
|
|
2423
|
+
private readCache;
|
|
2424
|
+
private writeCache;
|
|
2425
|
+
}
|
|
2426
|
+
//#endregion
|
|
2427
|
+
export { type ContentType, type GitUpgradeCheckResult, InstallManager, type InstallOptions, type InstallProgress, type InstallResult, type InstallScope, type InstallSourceMetadata, type InstalledItem, type ListInstalledOptions, type LoadedRegistry, type ParsedRegistry, type PostInstallContext, type PostInstallResult, type ProgressPhase, type RegistriesFile, RegistryClient, type RegistryEntry, type RegistryEntryType, type RegistrySourceConfig, type ResolvedSource, type SourceType, type UninstallOptions, type UninstallResult, type UninstallTarget, type UpgradeCheckOptions, type UpgradeCheckResult, type VersionInfo, builtinOfficialSource, checkArchiveBomb, checkGitUpgrades, checkUpgrades, cleanTempDir, createArchive, createTempDir, detectUninstallTarget, extractArchive, listInstalledItems, parseRegistry, registryEntrySchema, registryEntryTypeSchema, registrySchema, sanitizeSourceUrl, scanInstalledVersions, uninstall, validateExtractedPaths };
|
|
2428
|
+
//# sourceMappingURL=index.d.ts.map
|