@athenaintel/react 0.23.3 → 0.24.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 +6 -0
- package/dist/assets/AssetPanel.cjs +1 -1
- package/dist/assets/AssetPanel.cjs.map +1 -1
- package/dist/assets/AssetPanel.js +1 -1
- package/dist/assets/AssetPanel.js.map +1 -1
- package/dist/assets/AthenaAssetEmbed.cjs +1 -1
- package/dist/assets/AthenaAssetEmbed.cjs.map +1 -1
- package/dist/assets/AthenaAssetEmbed.js +1 -1
- package/dist/assets/AthenaAssetEmbed.js.map +1 -1
- package/dist/chat/AthenaChat.cjs +15 -23
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.d.ts +9 -4
- package/dist/chat/AthenaChat.js +15 -23
- package/dist/chat/AthenaChat.js.map +1 -1
- package/dist/chat/StatewireApprovalCard.cjs +3 -18
- package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
- package/dist/chat/StatewireApprovalCard.js +3 -18
- package/dist/chat/StatewireApprovalCard.js.map +1 -1
- package/dist/chat/StatewireClientToolBridge.cjs +2 -16
- package/dist/chat/StatewireClientToolBridge.cjs.map +1 -1
- package/dist/chat/StatewireClientToolBridge.js +2 -16
- package/dist/chat/StatewireClientToolBridge.js.map +1 -1
- package/dist/chat/StatewireQueuedMessages.cjs +5 -16
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.js +5 -16
- package/dist/chat/StatewireQueuedMessages.js.map +1 -1
- package/dist/chat/WaitingOnYouBanner.cjs +3 -18
- package/dist/chat/WaitingOnYouBanner.cjs.map +1 -1
- package/dist/chat/WaitingOnYouBanner.js +3 -18
- package/dist/chat/WaitingOnYouBanner.js.map +1 -1
- package/dist/chat/run-activity.cjs +0 -16
- package/dist/chat/run-activity.cjs.map +1 -1
- package/dist/chat/run-activity.js +0 -16
- package/dist/chat/run-activity.js.map +1 -1
- package/dist/chat/statewire-client-tools.cjs +1 -17
- package/dist/chat/statewire-client-tools.cjs.map +1 -1
- package/dist/chat/statewire-client-tools.js +1 -17
- package/dist/chat/statewire-client-tools.js.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.cjs +0 -16
- package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.js +0 -16
- package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
- package/dist/chat/tiptap-text.cjs +1 -17
- package/dist/chat/tiptap-text.cjs.map +1 -1
- package/dist/chat/tiptap-text.js +1 -17
- package/dist/chat/tiptap-text.js.map +1 -1
- package/dist/chat/use-athena-run-live.cjs +0 -15
- package/dist/chat/use-athena-run-live.cjs.map +1 -1
- package/dist/chat/use-athena-run-live.js +0 -15
- package/dist/chat/use-athena-run-live.js.map +1 -1
- package/dist/chat/use-statewire-approval-request.cjs +4 -16
- package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
- package/dist/chat/use-statewire-approval-request.d.ts +2 -0
- package/dist/chat/use-statewire-approval-request.js +4 -16
- package/dist/chat/use-statewire-approval-request.js.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.cjs +1 -16
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.js +1 -16
- package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
- package/dist/chat-ui/index.cjs +0 -16
- package/dist/chat-ui/index.cjs.map +1 -1
- package/dist/chat-ui/index.js +0 -16
- package/dist/chat-ui/index.js.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs +1 -16
- package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.js +1 -16
- package/dist/chat-ui/mentions/mention-chip.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.cjs +4 -6
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.js +4 -6
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +2 -9
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js +2 -9
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js.map +1 -1
- package/dist/chat-ui/messages/message-components.cjs +5 -19
- package/dist/chat-ui/messages/message-components.cjs.map +1 -1
- package/dist/chat-ui/messages/message-components.js +5 -19
- package/dist/chat-ui/messages/message-components.js.map +1 -1
- package/dist/chat-ui/messages/runtime-message.cjs +1 -16
- package/dist/chat-ui/messages/runtime-message.cjs.map +1 -1
- package/dist/chat-ui/messages/runtime-message.js +1 -16
- package/dist/chat-ui/messages/runtime-message.js.map +1 -1
- package/dist/chat-ui/messages/statewire-continue-run.cjs +3 -15
- package/dist/chat-ui/messages/statewire-continue-run.cjs.map +1 -1
- package/dist/chat-ui/messages/statewire-continue-run.js +3 -15
- package/dist/chat-ui/messages/statewire-continue-run.js.map +1 -1
- package/dist/chat-ui/messages/user-edit-composer.cjs +0 -16
- package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -1
- package/dist/chat-ui/messages/user-edit-composer.js +0 -16
- package/dist/chat-ui/messages/user-edit-composer.js.map +1 -1
- package/dist/chat-ui/messages/wake-marker.cjs +1 -16
- package/dist/chat-ui/messages/wake-marker.cjs.map +1 -1
- package/dist/chat-ui/messages/wake-marker.js +1 -16
- package/dist/chat-ui/messages/wake-marker.js.map +1 -1
- package/dist/chat-ui/statewire.cjs +0 -16
- package/dist/chat-ui/statewire.cjs.map +1 -1
- package/dist/chat-ui/statewire.js +0 -16
- package/dist/chat-ui/statewire.js.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.cjs +2 -17
- package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.js +2 -17
- package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -1
- package/dist/dictation/DictationStrip.cjs +2 -1
- package/dist/dictation/DictationStrip.cjs.map +1 -1
- package/dist/dictation/DictationStrip.d.ts +2 -0
- package/dist/dictation/DictationStrip.js +2 -1
- package/dist/dictation/DictationStrip.js.map +1 -1
- package/dist/dictation/dictation-engine.cjs.map +1 -1
- package/dist/dictation/dictation-engine.d.ts +8 -0
- package/dist/dictation/dictation-engine.js.map +1 -1
- package/dist/dictation/recorded-dictation-engine.cjs +153 -0
- package/dist/dictation/recorded-dictation-engine.cjs.map +1 -0
- package/dist/dictation/recorded-dictation-engine.d.ts +66 -0
- package/dist/dictation/recorded-dictation-engine.js +153 -0
- package/dist/dictation/recorded-dictation-engine.js.map +1 -0
- package/dist/dictation/use-athena-dictation-engine.cjs +64 -0
- package/dist/dictation/use-athena-dictation-engine.cjs.map +1 -0
- package/dist/dictation/use-athena-dictation-engine.d.ts +25 -0
- package/dist/dictation/use-athena-dictation-engine.js +64 -0
- package/dist/dictation/use-athena-dictation-engine.js.map +1 -0
- package/dist/dictation/use-dictation.cjs +17 -6
- package/dist/dictation/use-dictation.cjs.map +1 -1
- package/dist/dictation/use-dictation.d.ts +20 -4
- package/dist/dictation/use-dictation.js +17 -6
- package/dist/dictation/use-dictation.js.map +1 -1
- package/dist/index.cjs +28 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +10 -21
- package/dist/index.js.map +1 -1
- package/dist/packages/agent-runtime/src/edit-command.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/edit-command.js.map +1 -1
- package/dist/packages/agent-runtime/src/errors.cjs +18 -0
- package/dist/packages/agent-runtime/src/errors.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/errors.js +19 -1
- package/dist/packages/agent-runtime/src/errors.js.map +1 -1
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs +1 -0
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.js +1 -0
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
- package/dist/packages/agent-runtime/src/interrupts.cjs +61 -12
- package/dist/packages/agent-runtime/src/interrupts.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/interrupts.js +61 -12
- package/dist/packages/agent-runtime/src/interrupts.js.map +1 -1
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.cjs +49 -0
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.js +49 -0
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -1
- package/dist/packages/agent-runtime/src/thread-status.js +1 -1
- package/dist/packages/agent-runtime/src/tool-metadata.cjs +1 -37
- package/dist/packages/agent-runtime/src/tool-metadata.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/tool-metadata.js +1 -37
- package/dist/packages/agent-runtime/src/tool-metadata.js.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-config.cjs +0 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-config.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-config.js +0 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-config.js.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
- package/dist/packages/react/package.json.cjs +1 -1
- package/dist/packages/react/package.json.js +1 -1
- package/dist/provider/AthenaProvider.cjs +3 -17
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.js +3 -17
- package/dist/provider/AthenaProvider.js.map +1 -1
- package/dist/runtime/statewire-lifecycle.cjs +0 -16
- package/dist/runtime/statewire-lifecycle.cjs.map +1 -1
- package/dist/runtime/statewire-lifecycle.js +0 -16
- package/dist/runtime/statewire-lifecycle.js.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.cjs +3 -17
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.js +3 -17
- package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
- package/dist/threads/statewire-thread-list.cjs +4 -17
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.js +4 -17
- package/dist/threads/statewire-thread-list.js.map +1 -1
- package/dist/threads/use-rest-conversation-history.cjs +2 -16
- package/dist/threads/use-rest-conversation-history.cjs.map +1 -1
- package/dist/threads/use-rest-conversation-history.js +2 -16
- package/dist/threads/use-rest-conversation-history.js.map +1 -1
- package/dist/threads/use-statewire-conversation-history.cjs +2 -16
- package/dist/threads/use-statewire-conversation-history.cjs.map +1 -1
- package/dist/threads/use-statewire-conversation-history.js +2 -16
- package/dist/threads/use-statewire-conversation-history.js.map +1 -1
- package/dist/toolkits/index.cjs +0 -7
- package/dist/toolkits/index.cjs.map +1 -1
- package/dist/toolkits/index.d.ts +0 -2
- package/dist/toolkits/index.js +0 -7
- package/dist/toolkits/index.js.map +1 -1
- package/dist/tools/index.cjs +4 -20
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.js +1 -17
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/misc-tool-uis.cjs +2 -17
- package/dist/tools/misc-tool-uis.cjs.map +1 -1
- package/dist/tools/misc-tool-uis.js +2 -17
- package/dist/tools/misc-tool-uis.js.map +1 -1
- package/dist/tools/primitives.cjs +1 -16
- package/dist/tools/primitives.cjs.map +1 -1
- package/dist/tools/primitives.js +1 -16
- package/dist/tools/primitives.js.map +1 -1
- package/dist/tools/tool-fallback.cjs +2 -17
- package/dist/tools/tool-fallback.cjs.map +1 -1
- package/dist/tools/tool-fallback.js +2 -17
- package/dist/tools/tool-fallback.js.map +1 -1
- package/dist/tools/voice-update-tool-ui.cjs +1 -17
- package/dist/tools/voice-update-tool-ui.cjs.map +1 -1
- package/dist/tools/voice-update-tool-ui.js +1 -17
- package/dist/tools/voice-update-tool-ui.js.map +1 -1
- package/package.json +1 -1
- package/dist/node_modules/qrcode-generator/dist/qrcode.cjs +0 -32
- package/dist/node_modules/qrcode-generator/dist/qrcode.cjs.map +0 -1
- package/dist/node_modules/qrcode-generator/dist/qrcode.js +0 -31
- package/dist/node_modules/qrcode-generator/dist/qrcode.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/errors.cjs +0 -44
- package/dist/node_modules/zod/v4/classic/errors.cjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/errors.js +0 -44
- package/dist/node_modules/zod/v4/classic/errors.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/iso.cjs +0 -43
- package/dist/node_modules/zod/v4/classic/iso.cjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/iso.js +0 -43
- package/dist/node_modules/zod/v4/classic/iso.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/parse.cjs +0 -29
- package/dist/node_modules/zod/v4/classic/parse.cjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/parse.js +0 -29
- package/dist/node_modules/zod/v4/classic/parse.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/schemas.cjs +0 -871
- package/dist/node_modules/zod/v4/classic/schemas.cjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/schemas.js +0 -871
- package/dist/node_modules/zod/v4/classic/schemas.js.map +0 -1
- package/dist/node_modules/zod/v4/core/api.cjs +0 -570
- package/dist/node_modules/zod/v4/core/api.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/api.js +0 -570
- package/dist/node_modules/zod/v4/core/api.js.map +0 -1
- package/dist/node_modules/zod/v4/core/checks.cjs +0 -411
- package/dist/node_modules/zod/v4/core/checks.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/checks.js +0 -411
- package/dist/node_modules/zod/v4/core/checks.js.map +0 -1
- package/dist/node_modules/zod/v4/core/core.cjs +0 -77
- package/dist/node_modules/zod/v4/core/core.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/core.js +0 -77
- package/dist/node_modules/zod/v4/core/core.js.map +0 -1
- package/dist/node_modules/zod/v4/core/doc.cjs +0 -38
- package/dist/node_modules/zod/v4/core/doc.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/doc.js +0 -38
- package/dist/node_modules/zod/v4/core/doc.js.map +0 -1
- package/dist/node_modules/zod/v4/core/errors.cjs +0 -76
- package/dist/node_modules/zod/v4/core/errors.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/errors.js +0 -76
- package/dist/node_modules/zod/v4/core/errors.js.map +0 -1
- package/dist/node_modules/zod/v4/core/json-schema-processors.cjs +0 -312
- package/dist/node_modules/zod/v4/core/json-schema-processors.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/json-schema-processors.js +0 -312
- package/dist/node_modules/zod/v4/core/json-schema-processors.js.map +0 -1
- package/dist/node_modules/zod/v4/core/parse.cjs +0 -96
- package/dist/node_modules/zod/v4/core/parse.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/parse.js +0 -96
- package/dist/node_modules/zod/v4/core/parse.js.map +0 -1
- package/dist/node_modules/zod/v4/core/regexes.cjs +0 -86
- package/dist/node_modules/zod/v4/core/regexes.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/regexes.js +0 -86
- package/dist/node_modules/zod/v4/core/regexes.js.map +0 -1
- package/dist/node_modules/zod/v4/core/registries.cjs +0 -52
- package/dist/node_modules/zod/v4/core/registries.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/registries.js +0 -52
- package/dist/node_modules/zod/v4/core/registries.js.map +0 -1
- package/dist/node_modules/zod/v4/core/schemas.cjs +0 -1412
- package/dist/node_modules/zod/v4/core/schemas.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/schemas.js +0 -1413
- package/dist/node_modules/zod/v4/core/schemas.js.map +0 -1
- package/dist/node_modules/zod/v4/core/to-json-schema.cjs +0 -370
- package/dist/node_modules/zod/v4/core/to-json-schema.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -370
- package/dist/node_modules/zod/v4/core/to-json-schema.js.map +0 -1
- package/dist/node_modules/zod/v4/core/util.cjs +0 -444
- package/dist/node_modules/zod/v4/core/util.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/util.js +0 -444
- package/dist/node_modules/zod/v4/core/util.js.map +0 -1
- package/dist/node_modules/zod/v4/core/versions.cjs +0 -9
- package/dist/node_modules/zod/v4/core/versions.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/versions.js +0 -9
- package/dist/node_modules/zod/v4/core/versions.js.map +0 -1
- package/dist/packages/agent-runtime/src/thread-handoff.cjs +0 -85
- package/dist/packages/agent-runtime/src/thread-handoff.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/thread-handoff.js +0 -85
- package/dist/packages/agent-runtime/src/thread-handoff.js.map +0 -1
|
@@ -1,871 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsonSchemaProcessors = require("../core/json-schema-processors.cjs");
|
|
4
|
-
const toJsonSchema = require("../core/to-json-schema.cjs");
|
|
5
|
-
const iso = require("./iso.cjs");
|
|
6
|
-
const parse = require("./parse.cjs");
|
|
7
|
-
const util = require("../core/util.cjs");
|
|
8
|
-
const api = require("../core/api.cjs");
|
|
9
|
-
const core = require("../core/core.cjs");
|
|
10
|
-
const schemas = require("../core/schemas.cjs");
|
|
11
|
-
const registries = require("../core/registries.cjs");
|
|
12
|
-
const _installedGroups = /* @__PURE__ */ new WeakMap();
|
|
13
|
-
function _installLazyMethods(inst, group, methods) {
|
|
14
|
-
const proto = Object.getPrototypeOf(inst);
|
|
15
|
-
let installed = _installedGroups.get(proto);
|
|
16
|
-
if (!installed) {
|
|
17
|
-
installed = /* @__PURE__ */ new Set();
|
|
18
|
-
_installedGroups.set(proto, installed);
|
|
19
|
-
}
|
|
20
|
-
if (installed.has(group))
|
|
21
|
-
return;
|
|
22
|
-
installed.add(group);
|
|
23
|
-
for (const key in methods) {
|
|
24
|
-
const fn = methods[key];
|
|
25
|
-
Object.defineProperty(proto, key, {
|
|
26
|
-
configurable: true,
|
|
27
|
-
enumerable: false,
|
|
28
|
-
get() {
|
|
29
|
-
const bound = fn.bind(this);
|
|
30
|
-
Object.defineProperty(this, key, {
|
|
31
|
-
configurable: true,
|
|
32
|
-
writable: true,
|
|
33
|
-
enumerable: true,
|
|
34
|
-
value: bound
|
|
35
|
-
});
|
|
36
|
-
return bound;
|
|
37
|
-
},
|
|
38
|
-
set(v) {
|
|
39
|
-
Object.defineProperty(this, key, {
|
|
40
|
-
configurable: true,
|
|
41
|
-
writable: true,
|
|
42
|
-
enumerable: true,
|
|
43
|
-
value: v
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
const ZodType = /* @__PURE__ */ core.$constructor("ZodType", (inst, def) => {
|
|
50
|
-
schemas.$ZodType.init(inst, def);
|
|
51
|
-
Object.assign(inst["~standard"], {
|
|
52
|
-
jsonSchema: {
|
|
53
|
-
input: toJsonSchema.createStandardJSONSchemaMethod(inst, "input"),
|
|
54
|
-
output: toJsonSchema.createStandardJSONSchemaMethod(inst, "output")
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
inst.toJSONSchema = toJsonSchema.createToJSONSchemaMethod(inst, {});
|
|
58
|
-
inst.def = def;
|
|
59
|
-
inst.type = def.type;
|
|
60
|
-
Object.defineProperty(inst, "_def", { value: def });
|
|
61
|
-
inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });
|
|
62
|
-
inst.safeParse = (data, params) => parse.safeParse(inst, data, params);
|
|
63
|
-
inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });
|
|
64
|
-
inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);
|
|
65
|
-
inst.spa = inst.safeParseAsync;
|
|
66
|
-
inst.encode = (data, params) => parse.encode(inst, data, params);
|
|
67
|
-
inst.decode = (data, params) => parse.decode(inst, data, params);
|
|
68
|
-
inst.encodeAsync = async (data, params) => parse.encodeAsync(inst, data, params);
|
|
69
|
-
inst.decodeAsync = async (data, params) => parse.decodeAsync(inst, data, params);
|
|
70
|
-
inst.safeEncode = (data, params) => parse.safeEncode(inst, data, params);
|
|
71
|
-
inst.safeDecode = (data, params) => parse.safeDecode(inst, data, params);
|
|
72
|
-
inst.safeEncodeAsync = async (data, params) => parse.safeEncodeAsync(inst, data, params);
|
|
73
|
-
inst.safeDecodeAsync = async (data, params) => parse.safeDecodeAsync(inst, data, params);
|
|
74
|
-
_installLazyMethods(inst, "ZodType", {
|
|
75
|
-
check(...chks) {
|
|
76
|
-
const def2 = this.def;
|
|
77
|
-
return this.clone(util.mergeDefs(def2, {
|
|
78
|
-
checks: [
|
|
79
|
-
...def2.checks ?? [],
|
|
80
|
-
...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
|
|
81
|
-
]
|
|
82
|
-
}), { parent: true });
|
|
83
|
-
},
|
|
84
|
-
with(...chks) {
|
|
85
|
-
return this.check(...chks);
|
|
86
|
-
},
|
|
87
|
-
clone(def2, params) {
|
|
88
|
-
return util.clone(this, def2, params);
|
|
89
|
-
},
|
|
90
|
-
brand() {
|
|
91
|
-
return this;
|
|
92
|
-
},
|
|
93
|
-
register(reg, meta) {
|
|
94
|
-
reg.add(this, meta);
|
|
95
|
-
return this;
|
|
96
|
-
},
|
|
97
|
-
refine(check, params) {
|
|
98
|
-
return this.check(refine(check, params));
|
|
99
|
-
},
|
|
100
|
-
superRefine(refinement, params) {
|
|
101
|
-
return this.check(superRefine(refinement, params));
|
|
102
|
-
},
|
|
103
|
-
overwrite(fn) {
|
|
104
|
-
return this.check(api._overwrite(fn));
|
|
105
|
-
},
|
|
106
|
-
optional() {
|
|
107
|
-
return optional(this);
|
|
108
|
-
},
|
|
109
|
-
exactOptional() {
|
|
110
|
-
return exactOptional(this);
|
|
111
|
-
},
|
|
112
|
-
nullable() {
|
|
113
|
-
return nullable(this);
|
|
114
|
-
},
|
|
115
|
-
nullish() {
|
|
116
|
-
return optional(nullable(this));
|
|
117
|
-
},
|
|
118
|
-
nonoptional(params) {
|
|
119
|
-
return nonoptional(this, params);
|
|
120
|
-
},
|
|
121
|
-
array() {
|
|
122
|
-
return array(this);
|
|
123
|
-
},
|
|
124
|
-
or(arg) {
|
|
125
|
-
return union([this, arg]);
|
|
126
|
-
},
|
|
127
|
-
and(arg) {
|
|
128
|
-
return intersection(this, arg);
|
|
129
|
-
},
|
|
130
|
-
transform(tx) {
|
|
131
|
-
return pipe(this, transform(tx));
|
|
132
|
-
},
|
|
133
|
-
default(d) {
|
|
134
|
-
return _default(this, d);
|
|
135
|
-
},
|
|
136
|
-
prefault(d) {
|
|
137
|
-
return prefault(this, d);
|
|
138
|
-
},
|
|
139
|
-
catch(params) {
|
|
140
|
-
return _catch(this, params);
|
|
141
|
-
},
|
|
142
|
-
pipe(target) {
|
|
143
|
-
return pipe(this, target);
|
|
144
|
-
},
|
|
145
|
-
readonly() {
|
|
146
|
-
return readonly(this);
|
|
147
|
-
},
|
|
148
|
-
describe(description) {
|
|
149
|
-
const cl = this.clone();
|
|
150
|
-
registries.globalRegistry.add(cl, { description });
|
|
151
|
-
return cl;
|
|
152
|
-
},
|
|
153
|
-
meta(...args) {
|
|
154
|
-
if (args.length === 0)
|
|
155
|
-
return registries.globalRegistry.get(this);
|
|
156
|
-
const cl = this.clone();
|
|
157
|
-
registries.globalRegistry.add(cl, args[0]);
|
|
158
|
-
return cl;
|
|
159
|
-
},
|
|
160
|
-
isOptional() {
|
|
161
|
-
return this.safeParse(void 0).success;
|
|
162
|
-
},
|
|
163
|
-
isNullable() {
|
|
164
|
-
return this.safeParse(null).success;
|
|
165
|
-
},
|
|
166
|
-
apply(fn) {
|
|
167
|
-
return fn(this);
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
Object.defineProperty(inst, "description", {
|
|
171
|
-
get() {
|
|
172
|
-
var _a;
|
|
173
|
-
return (_a = registries.globalRegistry.get(inst)) == null ? void 0 : _a.description;
|
|
174
|
-
},
|
|
175
|
-
configurable: true
|
|
176
|
-
});
|
|
177
|
-
return inst;
|
|
178
|
-
});
|
|
179
|
-
const _ZodString = /* @__PURE__ */ core.$constructor("_ZodString", (inst, def) => {
|
|
180
|
-
schemas.$ZodString.init(inst, def);
|
|
181
|
-
ZodType.init(inst, def);
|
|
182
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.stringProcessor(inst, ctx, json);
|
|
183
|
-
const bag = inst._zod.bag;
|
|
184
|
-
inst.format = bag.format ?? null;
|
|
185
|
-
inst.minLength = bag.minimum ?? null;
|
|
186
|
-
inst.maxLength = bag.maximum ?? null;
|
|
187
|
-
_installLazyMethods(inst, "_ZodString", {
|
|
188
|
-
regex(...args) {
|
|
189
|
-
return this.check(api._regex(...args));
|
|
190
|
-
},
|
|
191
|
-
includes(...args) {
|
|
192
|
-
return this.check(api._includes(...args));
|
|
193
|
-
},
|
|
194
|
-
startsWith(...args) {
|
|
195
|
-
return this.check(api._startsWith(...args));
|
|
196
|
-
},
|
|
197
|
-
endsWith(...args) {
|
|
198
|
-
return this.check(api._endsWith(...args));
|
|
199
|
-
},
|
|
200
|
-
min(...args) {
|
|
201
|
-
return this.check(api._minLength(...args));
|
|
202
|
-
},
|
|
203
|
-
max(...args) {
|
|
204
|
-
return this.check(api._maxLength(...args));
|
|
205
|
-
},
|
|
206
|
-
length(...args) {
|
|
207
|
-
return this.check(api._length(...args));
|
|
208
|
-
},
|
|
209
|
-
nonempty(...args) {
|
|
210
|
-
return this.check(api._minLength(1, ...args));
|
|
211
|
-
},
|
|
212
|
-
lowercase(params) {
|
|
213
|
-
return this.check(api._lowercase(params));
|
|
214
|
-
},
|
|
215
|
-
uppercase(params) {
|
|
216
|
-
return this.check(api._uppercase(params));
|
|
217
|
-
},
|
|
218
|
-
trim() {
|
|
219
|
-
return this.check(api._trim());
|
|
220
|
-
},
|
|
221
|
-
normalize(...args) {
|
|
222
|
-
return this.check(api._normalize(...args));
|
|
223
|
-
},
|
|
224
|
-
toLowerCase() {
|
|
225
|
-
return this.check(api._toLowerCase());
|
|
226
|
-
},
|
|
227
|
-
toUpperCase() {
|
|
228
|
-
return this.check(api._toUpperCase());
|
|
229
|
-
},
|
|
230
|
-
slugify() {
|
|
231
|
-
return this.check(api._slugify());
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
});
|
|
235
|
-
const ZodString = /* @__PURE__ */ core.$constructor("ZodString", (inst, def) => {
|
|
236
|
-
schemas.$ZodString.init(inst, def);
|
|
237
|
-
_ZodString.init(inst, def);
|
|
238
|
-
inst.email = (params) => inst.check(api._email(ZodEmail, params));
|
|
239
|
-
inst.url = (params) => inst.check(api._url(ZodURL, params));
|
|
240
|
-
inst.jwt = (params) => inst.check(api._jwt(ZodJWT, params));
|
|
241
|
-
inst.emoji = (params) => inst.check(api._emoji(ZodEmoji, params));
|
|
242
|
-
inst.guid = (params) => inst.check(api._guid(ZodGUID, params));
|
|
243
|
-
inst.uuid = (params) => inst.check(api._uuid(ZodUUID, params));
|
|
244
|
-
inst.uuidv4 = (params) => inst.check(api._uuidv4(ZodUUID, params));
|
|
245
|
-
inst.uuidv6 = (params) => inst.check(api._uuidv6(ZodUUID, params));
|
|
246
|
-
inst.uuidv7 = (params) => inst.check(api._uuidv7(ZodUUID, params));
|
|
247
|
-
inst.nanoid = (params) => inst.check(api._nanoid(ZodNanoID, params));
|
|
248
|
-
inst.guid = (params) => inst.check(api._guid(ZodGUID, params));
|
|
249
|
-
inst.cuid = (params) => inst.check(api._cuid(ZodCUID, params));
|
|
250
|
-
inst.cuid2 = (params) => inst.check(api._cuid2(ZodCUID2, params));
|
|
251
|
-
inst.ulid = (params) => inst.check(api._ulid(ZodULID, params));
|
|
252
|
-
inst.base64 = (params) => inst.check(api._base64(ZodBase64, params));
|
|
253
|
-
inst.base64url = (params) => inst.check(api._base64url(ZodBase64URL, params));
|
|
254
|
-
inst.xid = (params) => inst.check(api._xid(ZodXID, params));
|
|
255
|
-
inst.ksuid = (params) => inst.check(api._ksuid(ZodKSUID, params));
|
|
256
|
-
inst.ipv4 = (params) => inst.check(api._ipv4(ZodIPv4, params));
|
|
257
|
-
inst.ipv6 = (params) => inst.check(api._ipv6(ZodIPv6, params));
|
|
258
|
-
inst.cidrv4 = (params) => inst.check(api._cidrv4(ZodCIDRv4, params));
|
|
259
|
-
inst.cidrv6 = (params) => inst.check(api._cidrv6(ZodCIDRv6, params));
|
|
260
|
-
inst.e164 = (params) => inst.check(api._e164(ZodE164, params));
|
|
261
|
-
inst.datetime = (params) => inst.check(iso.datetime(params));
|
|
262
|
-
inst.date = (params) => inst.check(iso.date(params));
|
|
263
|
-
inst.time = (params) => inst.check(iso.time(params));
|
|
264
|
-
inst.duration = (params) => inst.check(iso.duration(params));
|
|
265
|
-
});
|
|
266
|
-
function string(params) {
|
|
267
|
-
return api._string(ZodString, params);
|
|
268
|
-
}
|
|
269
|
-
const ZodStringFormat = /* @__PURE__ */ core.$constructor("ZodStringFormat", (inst, def) => {
|
|
270
|
-
schemas.$ZodStringFormat.init(inst, def);
|
|
271
|
-
_ZodString.init(inst, def);
|
|
272
|
-
});
|
|
273
|
-
const ZodEmail = /* @__PURE__ */ core.$constructor("ZodEmail", (inst, def) => {
|
|
274
|
-
schemas.$ZodEmail.init(inst, def);
|
|
275
|
-
ZodStringFormat.init(inst, def);
|
|
276
|
-
});
|
|
277
|
-
const ZodGUID = /* @__PURE__ */ core.$constructor("ZodGUID", (inst, def) => {
|
|
278
|
-
schemas.$ZodGUID.init(inst, def);
|
|
279
|
-
ZodStringFormat.init(inst, def);
|
|
280
|
-
});
|
|
281
|
-
const ZodUUID = /* @__PURE__ */ core.$constructor("ZodUUID", (inst, def) => {
|
|
282
|
-
schemas.$ZodUUID.init(inst, def);
|
|
283
|
-
ZodStringFormat.init(inst, def);
|
|
284
|
-
});
|
|
285
|
-
const ZodURL = /* @__PURE__ */ core.$constructor("ZodURL", (inst, def) => {
|
|
286
|
-
schemas.$ZodURL.init(inst, def);
|
|
287
|
-
ZodStringFormat.init(inst, def);
|
|
288
|
-
});
|
|
289
|
-
const ZodEmoji = /* @__PURE__ */ core.$constructor("ZodEmoji", (inst, def) => {
|
|
290
|
-
schemas.$ZodEmoji.init(inst, def);
|
|
291
|
-
ZodStringFormat.init(inst, def);
|
|
292
|
-
});
|
|
293
|
-
const ZodNanoID = /* @__PURE__ */ core.$constructor("ZodNanoID", (inst, def) => {
|
|
294
|
-
schemas.$ZodNanoID.init(inst, def);
|
|
295
|
-
ZodStringFormat.init(inst, def);
|
|
296
|
-
});
|
|
297
|
-
const ZodCUID = /* @__PURE__ */ core.$constructor("ZodCUID", (inst, def) => {
|
|
298
|
-
schemas.$ZodCUID.init(inst, def);
|
|
299
|
-
ZodStringFormat.init(inst, def);
|
|
300
|
-
});
|
|
301
|
-
const ZodCUID2 = /* @__PURE__ */ core.$constructor("ZodCUID2", (inst, def) => {
|
|
302
|
-
schemas.$ZodCUID2.init(inst, def);
|
|
303
|
-
ZodStringFormat.init(inst, def);
|
|
304
|
-
});
|
|
305
|
-
const ZodULID = /* @__PURE__ */ core.$constructor("ZodULID", (inst, def) => {
|
|
306
|
-
schemas.$ZodULID.init(inst, def);
|
|
307
|
-
ZodStringFormat.init(inst, def);
|
|
308
|
-
});
|
|
309
|
-
const ZodXID = /* @__PURE__ */ core.$constructor("ZodXID", (inst, def) => {
|
|
310
|
-
schemas.$ZodXID.init(inst, def);
|
|
311
|
-
ZodStringFormat.init(inst, def);
|
|
312
|
-
});
|
|
313
|
-
const ZodKSUID = /* @__PURE__ */ core.$constructor("ZodKSUID", (inst, def) => {
|
|
314
|
-
schemas.$ZodKSUID.init(inst, def);
|
|
315
|
-
ZodStringFormat.init(inst, def);
|
|
316
|
-
});
|
|
317
|
-
const ZodIPv4 = /* @__PURE__ */ core.$constructor("ZodIPv4", (inst, def) => {
|
|
318
|
-
schemas.$ZodIPv4.init(inst, def);
|
|
319
|
-
ZodStringFormat.init(inst, def);
|
|
320
|
-
});
|
|
321
|
-
const ZodIPv6 = /* @__PURE__ */ core.$constructor("ZodIPv6", (inst, def) => {
|
|
322
|
-
schemas.$ZodIPv6.init(inst, def);
|
|
323
|
-
ZodStringFormat.init(inst, def);
|
|
324
|
-
});
|
|
325
|
-
const ZodCIDRv4 = /* @__PURE__ */ core.$constructor("ZodCIDRv4", (inst, def) => {
|
|
326
|
-
schemas.$ZodCIDRv4.init(inst, def);
|
|
327
|
-
ZodStringFormat.init(inst, def);
|
|
328
|
-
});
|
|
329
|
-
const ZodCIDRv6 = /* @__PURE__ */ core.$constructor("ZodCIDRv6", (inst, def) => {
|
|
330
|
-
schemas.$ZodCIDRv6.init(inst, def);
|
|
331
|
-
ZodStringFormat.init(inst, def);
|
|
332
|
-
});
|
|
333
|
-
const ZodBase64 = /* @__PURE__ */ core.$constructor("ZodBase64", (inst, def) => {
|
|
334
|
-
schemas.$ZodBase64.init(inst, def);
|
|
335
|
-
ZodStringFormat.init(inst, def);
|
|
336
|
-
});
|
|
337
|
-
const ZodBase64URL = /* @__PURE__ */ core.$constructor("ZodBase64URL", (inst, def) => {
|
|
338
|
-
schemas.$ZodBase64URL.init(inst, def);
|
|
339
|
-
ZodStringFormat.init(inst, def);
|
|
340
|
-
});
|
|
341
|
-
const ZodE164 = /* @__PURE__ */ core.$constructor("ZodE164", (inst, def) => {
|
|
342
|
-
schemas.$ZodE164.init(inst, def);
|
|
343
|
-
ZodStringFormat.init(inst, def);
|
|
344
|
-
});
|
|
345
|
-
const ZodJWT = /* @__PURE__ */ core.$constructor("ZodJWT", (inst, def) => {
|
|
346
|
-
schemas.$ZodJWT.init(inst, def);
|
|
347
|
-
ZodStringFormat.init(inst, def);
|
|
348
|
-
});
|
|
349
|
-
const ZodNumber = /* @__PURE__ */ core.$constructor("ZodNumber", (inst, def) => {
|
|
350
|
-
schemas.$ZodNumber.init(inst, def);
|
|
351
|
-
ZodType.init(inst, def);
|
|
352
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.numberProcessor(inst, ctx, json);
|
|
353
|
-
_installLazyMethods(inst, "ZodNumber", {
|
|
354
|
-
gt(value, params) {
|
|
355
|
-
return this.check(api._gt(value, params));
|
|
356
|
-
},
|
|
357
|
-
gte(value, params) {
|
|
358
|
-
return this.check(api._gte(value, params));
|
|
359
|
-
},
|
|
360
|
-
min(value, params) {
|
|
361
|
-
return this.check(api._gte(value, params));
|
|
362
|
-
},
|
|
363
|
-
lt(value, params) {
|
|
364
|
-
return this.check(api._lt(value, params));
|
|
365
|
-
},
|
|
366
|
-
lte(value, params) {
|
|
367
|
-
return this.check(api._lte(value, params));
|
|
368
|
-
},
|
|
369
|
-
max(value, params) {
|
|
370
|
-
return this.check(api._lte(value, params));
|
|
371
|
-
},
|
|
372
|
-
int(params) {
|
|
373
|
-
return this.check(int(params));
|
|
374
|
-
},
|
|
375
|
-
safe(params) {
|
|
376
|
-
return this.check(int(params));
|
|
377
|
-
},
|
|
378
|
-
positive(params) {
|
|
379
|
-
return this.check(api._gt(0, params));
|
|
380
|
-
},
|
|
381
|
-
nonnegative(params) {
|
|
382
|
-
return this.check(api._gte(0, params));
|
|
383
|
-
},
|
|
384
|
-
negative(params) {
|
|
385
|
-
return this.check(api._lt(0, params));
|
|
386
|
-
},
|
|
387
|
-
nonpositive(params) {
|
|
388
|
-
return this.check(api._lte(0, params));
|
|
389
|
-
},
|
|
390
|
-
multipleOf(value, params) {
|
|
391
|
-
return this.check(api._multipleOf(value, params));
|
|
392
|
-
},
|
|
393
|
-
step(value, params) {
|
|
394
|
-
return this.check(api._multipleOf(value, params));
|
|
395
|
-
},
|
|
396
|
-
finite() {
|
|
397
|
-
return this;
|
|
398
|
-
}
|
|
399
|
-
});
|
|
400
|
-
const bag = inst._zod.bag;
|
|
401
|
-
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
402
|
-
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
403
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
|
|
404
|
-
inst.isFinite = true;
|
|
405
|
-
inst.format = bag.format ?? null;
|
|
406
|
-
});
|
|
407
|
-
function number(params) {
|
|
408
|
-
return api._number(ZodNumber, params);
|
|
409
|
-
}
|
|
410
|
-
const ZodNumberFormat = /* @__PURE__ */ core.$constructor("ZodNumberFormat", (inst, def) => {
|
|
411
|
-
schemas.$ZodNumberFormat.init(inst, def);
|
|
412
|
-
ZodNumber.init(inst, def);
|
|
413
|
-
});
|
|
414
|
-
function int(params) {
|
|
415
|
-
return api._int(ZodNumberFormat, params);
|
|
416
|
-
}
|
|
417
|
-
const ZodBoolean = /* @__PURE__ */ core.$constructor("ZodBoolean", (inst, def) => {
|
|
418
|
-
schemas.$ZodBoolean.init(inst, def);
|
|
419
|
-
ZodType.init(inst, def);
|
|
420
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.booleanProcessor(inst, ctx, json);
|
|
421
|
-
});
|
|
422
|
-
function boolean(params) {
|
|
423
|
-
return api._boolean(ZodBoolean, params);
|
|
424
|
-
}
|
|
425
|
-
const ZodUnknown = /* @__PURE__ */ core.$constructor("ZodUnknown", (inst, def) => {
|
|
426
|
-
schemas.$ZodUnknown.init(inst, def);
|
|
427
|
-
ZodType.init(inst, def);
|
|
428
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.unknownProcessor();
|
|
429
|
-
});
|
|
430
|
-
function unknown() {
|
|
431
|
-
return api._unknown(ZodUnknown);
|
|
432
|
-
}
|
|
433
|
-
const ZodNever = /* @__PURE__ */ core.$constructor("ZodNever", (inst, def) => {
|
|
434
|
-
schemas.$ZodNever.init(inst, def);
|
|
435
|
-
ZodType.init(inst, def);
|
|
436
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.neverProcessor(inst, ctx, json);
|
|
437
|
-
});
|
|
438
|
-
function never(params) {
|
|
439
|
-
return api._never(ZodNever, params);
|
|
440
|
-
}
|
|
441
|
-
const ZodArray = /* @__PURE__ */ core.$constructor("ZodArray", (inst, def) => {
|
|
442
|
-
schemas.$ZodArray.init(inst, def);
|
|
443
|
-
ZodType.init(inst, def);
|
|
444
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.arrayProcessor(inst, ctx, json, params);
|
|
445
|
-
inst.element = def.element;
|
|
446
|
-
_installLazyMethods(inst, "ZodArray", {
|
|
447
|
-
min(n, params) {
|
|
448
|
-
return this.check(api._minLength(n, params));
|
|
449
|
-
},
|
|
450
|
-
nonempty(params) {
|
|
451
|
-
return this.check(api._minLength(1, params));
|
|
452
|
-
},
|
|
453
|
-
max(n, params) {
|
|
454
|
-
return this.check(api._maxLength(n, params));
|
|
455
|
-
},
|
|
456
|
-
length(n, params) {
|
|
457
|
-
return this.check(api._length(n, params));
|
|
458
|
-
},
|
|
459
|
-
unwrap() {
|
|
460
|
-
return this.element;
|
|
461
|
-
}
|
|
462
|
-
});
|
|
463
|
-
});
|
|
464
|
-
function array(element, params) {
|
|
465
|
-
return api._array(ZodArray, element, params);
|
|
466
|
-
}
|
|
467
|
-
const ZodObject = /* @__PURE__ */ core.$constructor("ZodObject", (inst, def) => {
|
|
468
|
-
schemas.$ZodObjectJIT.init(inst, def);
|
|
469
|
-
ZodType.init(inst, def);
|
|
470
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.objectProcessor(inst, ctx, json, params);
|
|
471
|
-
util.defineLazy(inst, "shape", () => {
|
|
472
|
-
return def.shape;
|
|
473
|
-
});
|
|
474
|
-
_installLazyMethods(inst, "ZodObject", {
|
|
475
|
-
keyof() {
|
|
476
|
-
return _enum(Object.keys(this._zod.def.shape));
|
|
477
|
-
},
|
|
478
|
-
catchall(catchall) {
|
|
479
|
-
return this.clone({ ...this._zod.def, catchall });
|
|
480
|
-
},
|
|
481
|
-
passthrough() {
|
|
482
|
-
return this.clone({ ...this._zod.def, catchall: unknown() });
|
|
483
|
-
},
|
|
484
|
-
loose() {
|
|
485
|
-
return this.clone({ ...this._zod.def, catchall: unknown() });
|
|
486
|
-
},
|
|
487
|
-
strict() {
|
|
488
|
-
return this.clone({ ...this._zod.def, catchall: never() });
|
|
489
|
-
},
|
|
490
|
-
strip() {
|
|
491
|
-
return this.clone({ ...this._zod.def, catchall: void 0 });
|
|
492
|
-
},
|
|
493
|
-
extend(incoming) {
|
|
494
|
-
return util.extend(this, incoming);
|
|
495
|
-
},
|
|
496
|
-
safeExtend(incoming) {
|
|
497
|
-
return util.safeExtend(this, incoming);
|
|
498
|
-
},
|
|
499
|
-
merge(other) {
|
|
500
|
-
return util.merge(this, other);
|
|
501
|
-
},
|
|
502
|
-
pick(mask) {
|
|
503
|
-
return util.pick(this, mask);
|
|
504
|
-
},
|
|
505
|
-
omit(mask) {
|
|
506
|
-
return util.omit(this, mask);
|
|
507
|
-
},
|
|
508
|
-
partial(...args) {
|
|
509
|
-
return util.partial(ZodOptional, this, args[0]);
|
|
510
|
-
},
|
|
511
|
-
required(...args) {
|
|
512
|
-
return util.required(ZodNonOptional, this, args[0]);
|
|
513
|
-
}
|
|
514
|
-
});
|
|
515
|
-
});
|
|
516
|
-
function object(shape, params) {
|
|
517
|
-
const def = {
|
|
518
|
-
type: "object",
|
|
519
|
-
shape: shape ?? {},
|
|
520
|
-
...util.normalizeParams(params)
|
|
521
|
-
};
|
|
522
|
-
return new ZodObject(def);
|
|
523
|
-
}
|
|
524
|
-
const ZodUnion = /* @__PURE__ */ core.$constructor("ZodUnion", (inst, def) => {
|
|
525
|
-
schemas.$ZodUnion.init(inst, def);
|
|
526
|
-
ZodType.init(inst, def);
|
|
527
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.unionProcessor(inst, ctx, json, params);
|
|
528
|
-
inst.options = def.options;
|
|
529
|
-
});
|
|
530
|
-
function union(options, params) {
|
|
531
|
-
return new ZodUnion({
|
|
532
|
-
type: "union",
|
|
533
|
-
options,
|
|
534
|
-
...util.normalizeParams(params)
|
|
535
|
-
});
|
|
536
|
-
}
|
|
537
|
-
const ZodDiscriminatedUnion = /* @__PURE__ */ core.$constructor("ZodDiscriminatedUnion", (inst, def) => {
|
|
538
|
-
ZodUnion.init(inst, def);
|
|
539
|
-
schemas.$ZodDiscriminatedUnion.init(inst, def);
|
|
540
|
-
});
|
|
541
|
-
function discriminatedUnion(discriminator, options, params) {
|
|
542
|
-
return new ZodDiscriminatedUnion({
|
|
543
|
-
type: "union",
|
|
544
|
-
options,
|
|
545
|
-
discriminator,
|
|
546
|
-
...util.normalizeParams(params)
|
|
547
|
-
});
|
|
548
|
-
}
|
|
549
|
-
const ZodIntersection = /* @__PURE__ */ core.$constructor("ZodIntersection", (inst, def) => {
|
|
550
|
-
schemas.$ZodIntersection.init(inst, def);
|
|
551
|
-
ZodType.init(inst, def);
|
|
552
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.intersectionProcessor(inst, ctx, json, params);
|
|
553
|
-
});
|
|
554
|
-
function intersection(left, right) {
|
|
555
|
-
return new ZodIntersection({
|
|
556
|
-
type: "intersection",
|
|
557
|
-
left,
|
|
558
|
-
right
|
|
559
|
-
});
|
|
560
|
-
}
|
|
561
|
-
const ZodEnum = /* @__PURE__ */ core.$constructor("ZodEnum", (inst, def) => {
|
|
562
|
-
schemas.$ZodEnum.init(inst, def);
|
|
563
|
-
ZodType.init(inst, def);
|
|
564
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.enumProcessor(inst, ctx, json);
|
|
565
|
-
inst.enum = def.entries;
|
|
566
|
-
inst.options = Object.values(def.entries);
|
|
567
|
-
const keys = new Set(Object.keys(def.entries));
|
|
568
|
-
inst.extract = (values, params) => {
|
|
569
|
-
const newEntries = {};
|
|
570
|
-
for (const value of values) {
|
|
571
|
-
if (keys.has(value)) {
|
|
572
|
-
newEntries[value] = def.entries[value];
|
|
573
|
-
} else
|
|
574
|
-
throw new Error(`Key ${value} not found in enum`);
|
|
575
|
-
}
|
|
576
|
-
return new ZodEnum({
|
|
577
|
-
...def,
|
|
578
|
-
checks: [],
|
|
579
|
-
...util.normalizeParams(params),
|
|
580
|
-
entries: newEntries
|
|
581
|
-
});
|
|
582
|
-
};
|
|
583
|
-
inst.exclude = (values, params) => {
|
|
584
|
-
const newEntries = { ...def.entries };
|
|
585
|
-
for (const value of values) {
|
|
586
|
-
if (keys.has(value)) {
|
|
587
|
-
delete newEntries[value];
|
|
588
|
-
} else
|
|
589
|
-
throw new Error(`Key ${value} not found in enum`);
|
|
590
|
-
}
|
|
591
|
-
return new ZodEnum({
|
|
592
|
-
...def,
|
|
593
|
-
checks: [],
|
|
594
|
-
...util.normalizeParams(params),
|
|
595
|
-
entries: newEntries
|
|
596
|
-
});
|
|
597
|
-
};
|
|
598
|
-
});
|
|
599
|
-
function _enum(values, params) {
|
|
600
|
-
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
601
|
-
return new ZodEnum({
|
|
602
|
-
type: "enum",
|
|
603
|
-
entries,
|
|
604
|
-
...util.normalizeParams(params)
|
|
605
|
-
});
|
|
606
|
-
}
|
|
607
|
-
const ZodLiteral = /* @__PURE__ */ core.$constructor("ZodLiteral", (inst, def) => {
|
|
608
|
-
schemas.$ZodLiteral.init(inst, def);
|
|
609
|
-
ZodType.init(inst, def);
|
|
610
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.literalProcessor(inst, ctx, json);
|
|
611
|
-
inst.values = new Set(def.values);
|
|
612
|
-
Object.defineProperty(inst, "value", {
|
|
613
|
-
get() {
|
|
614
|
-
if (def.values.length > 1) {
|
|
615
|
-
throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
616
|
-
}
|
|
617
|
-
return def.values[0];
|
|
618
|
-
}
|
|
619
|
-
});
|
|
620
|
-
});
|
|
621
|
-
function literal(value, params) {
|
|
622
|
-
return new ZodLiteral({
|
|
623
|
-
type: "literal",
|
|
624
|
-
values: Array.isArray(value) ? value : [value],
|
|
625
|
-
...util.normalizeParams(params)
|
|
626
|
-
});
|
|
627
|
-
}
|
|
628
|
-
const ZodTransform = /* @__PURE__ */ core.$constructor("ZodTransform", (inst, def) => {
|
|
629
|
-
schemas.$ZodTransform.init(inst, def);
|
|
630
|
-
ZodType.init(inst, def);
|
|
631
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.transformProcessor(inst, ctx);
|
|
632
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
633
|
-
if (_ctx.direction === "backward") {
|
|
634
|
-
throw new core.$ZodEncodeError(inst.constructor.name);
|
|
635
|
-
}
|
|
636
|
-
payload.addIssue = (issue) => {
|
|
637
|
-
if (typeof issue === "string") {
|
|
638
|
-
payload.issues.push(util.issue(issue, payload.value, def));
|
|
639
|
-
} else {
|
|
640
|
-
const _issue = issue;
|
|
641
|
-
if (_issue.fatal)
|
|
642
|
-
_issue.continue = false;
|
|
643
|
-
_issue.code ?? (_issue.code = "custom");
|
|
644
|
-
_issue.input ?? (_issue.input = payload.value);
|
|
645
|
-
_issue.inst ?? (_issue.inst = inst);
|
|
646
|
-
payload.issues.push(util.issue(_issue));
|
|
647
|
-
}
|
|
648
|
-
};
|
|
649
|
-
const output = def.transform(payload.value, payload);
|
|
650
|
-
if (output instanceof Promise) {
|
|
651
|
-
return output.then((output2) => {
|
|
652
|
-
payload.value = output2;
|
|
653
|
-
payload.fallback = true;
|
|
654
|
-
return payload;
|
|
655
|
-
});
|
|
656
|
-
}
|
|
657
|
-
payload.value = output;
|
|
658
|
-
payload.fallback = true;
|
|
659
|
-
return payload;
|
|
660
|
-
};
|
|
661
|
-
});
|
|
662
|
-
function transform(fn) {
|
|
663
|
-
return new ZodTransform({
|
|
664
|
-
type: "transform",
|
|
665
|
-
transform: fn
|
|
666
|
-
});
|
|
667
|
-
}
|
|
668
|
-
const ZodOptional = /* @__PURE__ */ core.$constructor("ZodOptional", (inst, def) => {
|
|
669
|
-
schemas.$ZodOptional.init(inst, def);
|
|
670
|
-
ZodType.init(inst, def);
|
|
671
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.optionalProcessor(inst, ctx, json, params);
|
|
672
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
673
|
-
});
|
|
674
|
-
function optional(innerType) {
|
|
675
|
-
return new ZodOptional({
|
|
676
|
-
type: "optional",
|
|
677
|
-
innerType
|
|
678
|
-
});
|
|
679
|
-
}
|
|
680
|
-
const ZodExactOptional = /* @__PURE__ */ core.$constructor("ZodExactOptional", (inst, def) => {
|
|
681
|
-
schemas.$ZodExactOptional.init(inst, def);
|
|
682
|
-
ZodType.init(inst, def);
|
|
683
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.optionalProcessor(inst, ctx, json, params);
|
|
684
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
685
|
-
});
|
|
686
|
-
function exactOptional(innerType) {
|
|
687
|
-
return new ZodExactOptional({
|
|
688
|
-
type: "optional",
|
|
689
|
-
innerType
|
|
690
|
-
});
|
|
691
|
-
}
|
|
692
|
-
const ZodNullable = /* @__PURE__ */ core.$constructor("ZodNullable", (inst, def) => {
|
|
693
|
-
schemas.$ZodNullable.init(inst, def);
|
|
694
|
-
ZodType.init(inst, def);
|
|
695
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.nullableProcessor(inst, ctx, json, params);
|
|
696
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
697
|
-
});
|
|
698
|
-
function nullable(innerType) {
|
|
699
|
-
return new ZodNullable({
|
|
700
|
-
type: "nullable",
|
|
701
|
-
innerType
|
|
702
|
-
});
|
|
703
|
-
}
|
|
704
|
-
const ZodDefault = /* @__PURE__ */ core.$constructor("ZodDefault", (inst, def) => {
|
|
705
|
-
schemas.$ZodDefault.init(inst, def);
|
|
706
|
-
ZodType.init(inst, def);
|
|
707
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.defaultProcessor(inst, ctx, json, params);
|
|
708
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
709
|
-
inst.removeDefault = inst.unwrap;
|
|
710
|
-
});
|
|
711
|
-
function _default(innerType, defaultValue) {
|
|
712
|
-
return new ZodDefault({
|
|
713
|
-
type: "default",
|
|
714
|
-
innerType,
|
|
715
|
-
get defaultValue() {
|
|
716
|
-
return typeof defaultValue === "function" ? defaultValue() : util.shallowClone(defaultValue);
|
|
717
|
-
}
|
|
718
|
-
});
|
|
719
|
-
}
|
|
720
|
-
const ZodPrefault = /* @__PURE__ */ core.$constructor("ZodPrefault", (inst, def) => {
|
|
721
|
-
schemas.$ZodPrefault.init(inst, def);
|
|
722
|
-
ZodType.init(inst, def);
|
|
723
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.prefaultProcessor(inst, ctx, json, params);
|
|
724
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
725
|
-
});
|
|
726
|
-
function prefault(innerType, defaultValue) {
|
|
727
|
-
return new ZodPrefault({
|
|
728
|
-
type: "prefault",
|
|
729
|
-
innerType,
|
|
730
|
-
get defaultValue() {
|
|
731
|
-
return typeof defaultValue === "function" ? defaultValue() : util.shallowClone(defaultValue);
|
|
732
|
-
}
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
const ZodNonOptional = /* @__PURE__ */ core.$constructor("ZodNonOptional", (inst, def) => {
|
|
736
|
-
schemas.$ZodNonOptional.init(inst, def);
|
|
737
|
-
ZodType.init(inst, def);
|
|
738
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.nonoptionalProcessor(inst, ctx, json, params);
|
|
739
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
740
|
-
});
|
|
741
|
-
function nonoptional(innerType, params) {
|
|
742
|
-
return new ZodNonOptional({
|
|
743
|
-
type: "nonoptional",
|
|
744
|
-
innerType,
|
|
745
|
-
...util.normalizeParams(params)
|
|
746
|
-
});
|
|
747
|
-
}
|
|
748
|
-
const ZodCatch = /* @__PURE__ */ core.$constructor("ZodCatch", (inst, def) => {
|
|
749
|
-
schemas.$ZodCatch.init(inst, def);
|
|
750
|
-
ZodType.init(inst, def);
|
|
751
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.catchProcessor(inst, ctx, json, params);
|
|
752
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
753
|
-
inst.removeCatch = inst.unwrap;
|
|
754
|
-
});
|
|
755
|
-
function _catch(innerType, catchValue) {
|
|
756
|
-
return new ZodCatch({
|
|
757
|
-
type: "catch",
|
|
758
|
-
innerType,
|
|
759
|
-
catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
|
|
760
|
-
});
|
|
761
|
-
}
|
|
762
|
-
const ZodPipe = /* @__PURE__ */ core.$constructor("ZodPipe", (inst, def) => {
|
|
763
|
-
schemas.$ZodPipe.init(inst, def);
|
|
764
|
-
ZodType.init(inst, def);
|
|
765
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.pipeProcessor(inst, ctx, json, params);
|
|
766
|
-
inst.in = def.in;
|
|
767
|
-
inst.out = def.out;
|
|
768
|
-
});
|
|
769
|
-
function pipe(in_, out) {
|
|
770
|
-
return new ZodPipe({
|
|
771
|
-
type: "pipe",
|
|
772
|
-
in: in_,
|
|
773
|
-
out
|
|
774
|
-
// ...util.normalizeParams(params),
|
|
775
|
-
});
|
|
776
|
-
}
|
|
777
|
-
const ZodReadonly = /* @__PURE__ */ core.$constructor("ZodReadonly", (inst, def) => {
|
|
778
|
-
schemas.$ZodReadonly.init(inst, def);
|
|
779
|
-
ZodType.init(inst, def);
|
|
780
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.readonlyProcessor(inst, ctx, json, params);
|
|
781
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
782
|
-
});
|
|
783
|
-
function readonly(innerType) {
|
|
784
|
-
return new ZodReadonly({
|
|
785
|
-
type: "readonly",
|
|
786
|
-
innerType
|
|
787
|
-
});
|
|
788
|
-
}
|
|
789
|
-
const ZodCustom = /* @__PURE__ */ core.$constructor("ZodCustom", (inst, def) => {
|
|
790
|
-
schemas.$ZodCustom.init(inst, def);
|
|
791
|
-
ZodType.init(inst, def);
|
|
792
|
-
inst._zod.processJSONSchema = (ctx, json, params) => jsonSchemaProcessors.customProcessor(inst, ctx);
|
|
793
|
-
});
|
|
794
|
-
function refine(fn, _params = {}) {
|
|
795
|
-
return api._refine(ZodCustom, fn, _params);
|
|
796
|
-
}
|
|
797
|
-
function superRefine(fn, params) {
|
|
798
|
-
return api._superRefine(fn, params);
|
|
799
|
-
}
|
|
800
|
-
exports.ZodArray = ZodArray;
|
|
801
|
-
exports.ZodBase64 = ZodBase64;
|
|
802
|
-
exports.ZodBase64URL = ZodBase64URL;
|
|
803
|
-
exports.ZodBoolean = ZodBoolean;
|
|
804
|
-
exports.ZodCIDRv4 = ZodCIDRv4;
|
|
805
|
-
exports.ZodCIDRv6 = ZodCIDRv6;
|
|
806
|
-
exports.ZodCUID = ZodCUID;
|
|
807
|
-
exports.ZodCUID2 = ZodCUID2;
|
|
808
|
-
exports.ZodCatch = ZodCatch;
|
|
809
|
-
exports.ZodCustom = ZodCustom;
|
|
810
|
-
exports.ZodDefault = ZodDefault;
|
|
811
|
-
exports.ZodDiscriminatedUnion = ZodDiscriminatedUnion;
|
|
812
|
-
exports.ZodE164 = ZodE164;
|
|
813
|
-
exports.ZodEmail = ZodEmail;
|
|
814
|
-
exports.ZodEmoji = ZodEmoji;
|
|
815
|
-
exports.ZodEnum = ZodEnum;
|
|
816
|
-
exports.ZodExactOptional = ZodExactOptional;
|
|
817
|
-
exports.ZodGUID = ZodGUID;
|
|
818
|
-
exports.ZodIPv4 = ZodIPv4;
|
|
819
|
-
exports.ZodIPv6 = ZodIPv6;
|
|
820
|
-
exports.ZodIntersection = ZodIntersection;
|
|
821
|
-
exports.ZodJWT = ZodJWT;
|
|
822
|
-
exports.ZodKSUID = ZodKSUID;
|
|
823
|
-
exports.ZodLiteral = ZodLiteral;
|
|
824
|
-
exports.ZodNanoID = ZodNanoID;
|
|
825
|
-
exports.ZodNever = ZodNever;
|
|
826
|
-
exports.ZodNonOptional = ZodNonOptional;
|
|
827
|
-
exports.ZodNullable = ZodNullable;
|
|
828
|
-
exports.ZodNumber = ZodNumber;
|
|
829
|
-
exports.ZodNumberFormat = ZodNumberFormat;
|
|
830
|
-
exports.ZodObject = ZodObject;
|
|
831
|
-
exports.ZodOptional = ZodOptional;
|
|
832
|
-
exports.ZodPipe = ZodPipe;
|
|
833
|
-
exports.ZodPrefault = ZodPrefault;
|
|
834
|
-
exports.ZodReadonly = ZodReadonly;
|
|
835
|
-
exports.ZodString = ZodString;
|
|
836
|
-
exports.ZodStringFormat = ZodStringFormat;
|
|
837
|
-
exports.ZodTransform = ZodTransform;
|
|
838
|
-
exports.ZodType = ZodType;
|
|
839
|
-
exports.ZodULID = ZodULID;
|
|
840
|
-
exports.ZodURL = ZodURL;
|
|
841
|
-
exports.ZodUUID = ZodUUID;
|
|
842
|
-
exports.ZodUnion = ZodUnion;
|
|
843
|
-
exports.ZodUnknown = ZodUnknown;
|
|
844
|
-
exports.ZodXID = ZodXID;
|
|
845
|
-
exports._ZodString = _ZodString;
|
|
846
|
-
exports._default = _default;
|
|
847
|
-
exports.array = array;
|
|
848
|
-
exports.boolean = boolean;
|
|
849
|
-
exports.catch = _catch;
|
|
850
|
-
exports.discriminatedUnion = discriminatedUnion;
|
|
851
|
-
exports.enum = _enum;
|
|
852
|
-
exports.exactOptional = exactOptional;
|
|
853
|
-
exports.int = int;
|
|
854
|
-
exports.intersection = intersection;
|
|
855
|
-
exports.literal = literal;
|
|
856
|
-
exports.never = never;
|
|
857
|
-
exports.nonoptional = nonoptional;
|
|
858
|
-
exports.nullable = nullable;
|
|
859
|
-
exports.number = number;
|
|
860
|
-
exports.object = object;
|
|
861
|
-
exports.optional = optional;
|
|
862
|
-
exports.pipe = pipe;
|
|
863
|
-
exports.prefault = prefault;
|
|
864
|
-
exports.readonly = readonly;
|
|
865
|
-
exports.refine = refine;
|
|
866
|
-
exports.string = string;
|
|
867
|
-
exports.superRefine = superRefine;
|
|
868
|
-
exports.transform = transform;
|
|
869
|
-
exports.union = union;
|
|
870
|
-
exports.unknown = unknown;
|
|
871
|
-
//# sourceMappingURL=schemas.cjs.map
|