@salesforce/b2c-dx-mcp 2.1.2 → 3.0.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 +20 -129
- package/content/guidance/b2c/b2c-business-manager-extensions/SKILL.md +361 -0
- package/content/guidance/b2c/b2c-business-manager-extensions/references/EXTENSIONS-XML.md +458 -0
- package/content/guidance/b2c/b2c-controllers/SKILL.md +301 -0
- package/content/guidance/b2c/b2c-controllers/references/CLASSIC-PATTERNS.md +335 -0
- package/content/guidance/b2c/b2c-controllers/references/SFRA-PATTERNS.md +400 -0
- package/content/guidance/b2c/b2c-custom-api-development/SKILL.md +281 -0
- package/content/guidance/b2c/b2c-custom-api-development/references/CONTRACT.md +142 -0
- package/content/guidance/b2c/b2c-custom-api-development/references/IMPLEMENTATION.md +153 -0
- package/content/guidance/b2c/b2c-custom-api-development/references/TESTING.md +118 -0
- package/content/guidance/b2c/b2c-custom-caches/SKILL.md +279 -0
- package/content/guidance/b2c/b2c-custom-job-steps/SKILL.md +520 -0
- package/content/guidance/b2c/b2c-custom-job-steps/references/CHUNK-ORIENTED.md +377 -0
- package/content/guidance/b2c/b2c-custom-job-steps/references/JOBS-XML.md +212 -0
- package/content/guidance/b2c/b2c-custom-job-steps/references/STEPTYPES-JSON.md +373 -0
- package/content/guidance/b2c/b2c-custom-job-steps/references/TASK-ORIENTED.md +344 -0
- package/content/guidance/b2c/b2c-custom-objects/SKILL.md +327 -0
- package/content/guidance/b2c/b2c-custom-objects/references/OCAPI-SEARCH.md +298 -0
- package/content/guidance/b2c/b2c-forms/SKILL.md +242 -0
- package/content/guidance/b2c/b2c-forms/references/FORM-XML.md +409 -0
- package/content/guidance/b2c/b2c-hooks/SKILL.md +500 -0
- package/content/guidance/b2c/b2c-hooks/references/OCAPI-SCAPI-HOOKS.md +403 -0
- package/content/guidance/b2c/b2c-hooks/references/ORDER-HOOK-LIFECYCLE.md +169 -0
- package/content/guidance/b2c/b2c-hooks/references/SYSTEM-HOOKS.md +433 -0
- package/content/guidance/b2c/b2c-isml/SKILL.md +320 -0
- package/content/guidance/b2c/b2c-isml/references/EXPRESSIONS.md +366 -0
- package/content/guidance/b2c/b2c-isml/references/TAGS.md +443 -0
- package/content/guidance/b2c/b2c-localization/SKILL.md +344 -0
- package/content/guidance/b2c/b2c-localization/references/PATTERNS.md +407 -0
- package/content/guidance/b2c/b2c-logging/SKILL.md +352 -0
- package/content/guidance/b2c/b2c-logging/references/LOG-FILES.md +282 -0
- package/content/guidance/b2c/b2c-metadata/SKILL.md +406 -0
- package/content/guidance/b2c/b2c-metadata/references/SYSTEM-OBJECTS.md +320 -0
- package/content/guidance/b2c/b2c-metadata/references/XML-EXAMPLES.md +366 -0
- package/content/guidance/b2c/b2c-onboarding/SKILL.md +154 -0
- package/content/guidance/b2c/b2c-ordering/SKILL.md +391 -0
- package/content/guidance/b2c/b2c-page-designer/SKILL.md +410 -0
- package/content/guidance/b2c/b2c-page-designer/references/ATTRIBUTE-TYPES.md +436 -0
- package/content/guidance/b2c/b2c-page-designer/references/META-DEFINITIONS.md +340 -0
- package/content/guidance/b2c/b2c-querying-data/SKILL.md +289 -0
- package/content/guidance/b2c/b2c-querying-data/references/PERFORMANCE-APIS.md +74 -0
- package/content/guidance/b2c/b2c-scapi-admin/SKILL.md +53 -0
- package/content/guidance/b2c/b2c-scapi-admin/references/CLIENT-EXAMPLES.md +440 -0
- package/content/guidance/b2c/b2c-scapi-admin/references/INTEGRATION-PATTERNS.md +518 -0
- package/content/guidance/b2c/b2c-scapi-admin/references/OAUTH-SCOPES.md +337 -0
- package/content/guidance/b2c/b2c-scapi-shopper/SKILL.md +56 -0
- package/content/guidance/b2c/b2c-scapi-shopper/references/CHECKOUT-FLOW.md +466 -0
- package/content/guidance/b2c/b2c-scapi-shopper/references/CLIENT-EXAMPLES.md +352 -0
- package/content/guidance/b2c/b2c-scapi-shopper/references/COMMON-PATTERNS.md +390 -0
- package/content/guidance/b2c/b2c-scapi-shopper/references/SCOPES.md +290 -0
- package/content/guidance/b2c/b2c-slas-auth-patterns/SKILL.md +420 -0
- package/content/guidance/b2c/b2c-slas-auth-patterns/references/PASSKEYS.md +126 -0
- package/content/guidance/b2c/b2c-slas-auth-patterns/references/SESSION-BRIDGE.md +267 -0
- package/content/guidance/b2c/b2c-slas-auth-patterns/references/TOKEN-LIFECYCLE.md +367 -0
- package/content/guidance/b2c/b2c-webservices/SKILL.md +318 -0
- package/content/guidance/b2c/b2c-webservices/references/FTP-SERVICES.md +524 -0
- package/content/guidance/b2c/b2c-webservices/references/HTTP-SERVICES.md +578 -0
- package/content/guidance/b2c/b2c-webservices/references/SERVICES-XML.md +351 -0
- package/content/guidance/b2c/b2c-webservices/references/SOAP-SERVICES.md +587 -0
- package/content/guidance/b2c-cli/b2c-am/SKILL.md +277 -0
- package/content/guidance/b2c-cli/b2c-bm-users-roles/SKILL.md +210 -0
- package/content/guidance/b2c-cli/b2c-cap/SKILL.md +131 -0
- package/content/guidance/b2c-cli/b2c-cip/SKILL.md +116 -0
- package/content/guidance/b2c-cli/b2c-cip/references/KNOWN_TABLES.md +105 -0
- package/content/guidance/b2c-cli/b2c-cip/references/SALES_ANALYSIS.md +50 -0
- package/content/guidance/b2c-cli/b2c-cip/references/STARTER_QUERIES.md +147 -0
- package/content/guidance/b2c-cli/b2c-code/SKILL.md +146 -0
- package/content/guidance/b2c-cli/b2c-config/SKILL.md +412 -0
- package/content/guidance/b2c-cli/b2c-content/SKILL.md +176 -0
- package/content/guidance/b2c-cli/b2c-debug/SKILL.md +138 -0
- package/content/guidance/b2c-cli/b2c-docs/SKILL.md +274 -0
- package/content/guidance/b2c-cli/b2c-ecdn/SKILL.md +135 -0
- package/content/guidance/b2c-cli/b2c-ecdn/references/ADVANCED.md +82 -0
- package/content/guidance/b2c-cli/b2c-ecdn/references/SECURITY.md +75 -0
- package/content/guidance/b2c-cli/b2c-import-set-migrations/SKILL.md +265 -0
- package/content/guidance/b2c-cli/b2c-job/SKILL.md +62 -0
- package/content/guidance/b2c-cli/b2c-job/references/EXPORT.md +115 -0
- package/content/guidance/b2c-cli/b2c-job/references/IMPORT.md +43 -0
- package/content/guidance/b2c-cli/b2c-job/references/RUN-AND-MONITOR.md +119 -0
- package/content/guidance/b2c-cli/b2c-logs/SKILL.md +249 -0
- package/content/guidance/b2c-cli/b2c-metrics/SKILL.md +315 -0
- package/content/guidance/b2c-cli/b2c-mrt/SKILL.md +206 -0
- package/content/guidance/b2c-cli/b2c-mrt/references/BUNDLE-COMMANDS.md +185 -0
- package/content/guidance/b2c-cli/b2c-mrt/references/ENVIRONMENT-COMMANDS.md +195 -0
- package/content/guidance/b2c-cli/b2c-mrt/references/PROJECT-COMMANDS.md +154 -0
- package/content/guidance/b2c-cli/b2c-sandbox/SKILL.md +112 -0
- package/content/guidance/b2c-cli/b2c-scapi-custom/SKILL.md +126 -0
- package/content/guidance/b2c-cli/b2c-scapi-schemas/SKILL.md +64 -0
- package/content/guidance/b2c-cli/b2c-scapi-schemas/references/CLI-EXAMPLES.md +108 -0
- package/content/guidance/b2c-cli/b2c-site-import-export/SKILL.md +57 -0
- package/content/guidance/b2c-cli/b2c-site-import-export/references/IMPORT-OPTIONS.md +118 -0
- package/content/guidance/b2c-cli/b2c-site-import-export/references/METADATA-XML.md +381 -0
- package/content/guidance/b2c-cli/b2c-site-import-export/references/WORKFLOWS.md +182 -0
- package/content/guidance/b2c-cli/b2c-sites/SKILL.md +112 -0
- package/content/guidance/b2c-cli/b2c-slas/SKILL.md +182 -0
- package/content/guidance/b2c-cli/b2c-webdav/SKILL.md +169 -0
- package/content/guidance/b2c-ops/b2c-checkout-triage/SKILL.md +68 -0
- package/content/guidance/b2c-ops/b2c-job-health/SKILL.md +75 -0
- package/content/guidance/b2c-ops/b2c-job-health/references/job-logs.md +21 -0
- package/content/guidance/b2c-ops/b2c-order-failure-triage/SKILL.md +66 -0
- package/content/guidance/b2c-ops/b2c-order-failure-triage/references/order-evidence.md +87 -0
- package/content/guidance/b2c-ops/b2c-production-triage/SKILL.md +87 -0
- package/content/guidance/b2c-ops/b2c-production-triage/references/escalation.md +57 -0
- package/content/guidance/index.json +1427 -0
- package/content/guidance/mcp/b2c-config/SKILL.md +86 -0
- package/content/guidance/mcp/cip/SKILL.md +86 -0
- package/content/guidance/mcp/debugger/SKILL.md +71 -0
- package/content/guidance/mcp/scapi/SKILL.md +153 -0
- package/content/guidance/mcp/scapi/references/custom-apis.md +51 -0
- package/content/guidance/mcp/scapi/references/custom-properties.md +43 -0
- package/content/guidance/mcp/scapi/references/jobs.md +30 -0
- package/content/guidance/mcp/scapi/references/products.md +37 -0
- package/content/guidance/mcp/scapi/references/promotions.md +19 -0
- package/content/guidance/mcp/scapi/references/saving.md +12 -0
- package/content/guidance/mcp/scapi/references/snippets.md +89 -0
- package/content/guidance/mcp/scapi/references/tokens.md +56 -0
- package/content/guidance/mcp/server/SKILL.md +99 -0
- package/content/guidance/mcp/server/references/files.md +37 -0
- package/content/guidance/storefront-next/sfnext-authentication/SKILL.md +120 -0
- package/content/guidance/storefront-next/sfnext-components/SKILL.md +191 -0
- package/content/guidance/storefront-next/sfnext-configuration/SKILL.md +160 -0
- package/content/guidance/storefront-next/sfnext-create-component/SKILL.md +195 -0
- package/content/guidance/storefront-next/sfnext-create-component/references/COMPONENT-AUTHORING.md +206 -0
- package/content/guidance/storefront-next/sfnext-create-component/references/PROJECT-STRUCTURE.md +43 -0
- package/content/guidance/storefront-next/sfnext-create-component/references/TOKEN-SYSTEM.md +130 -0
- package/content/guidance/storefront-next/sfnext-create-component/references/TROUBLESHOOTING.md +34 -0
- package/content/guidance/storefront-next/sfnext-create-vertical/SKILL.md +135 -0
- package/content/guidance/storefront-next/sfnext-create-vertical/references/COMPONENT-AUTHORING.md +206 -0
- package/content/guidance/storefront-next/sfnext-create-vertical/references/PROJECT-STRUCTURE.md +43 -0
- package/content/guidance/storefront-next/sfnext-create-vertical/references/TOKEN-SYSTEM.md +130 -0
- package/content/guidance/storefront-next/sfnext-create-vertical/references/TROUBLESHOOTING.md +34 -0
- package/content/guidance/storefront-next/sfnext-custom-apis/SKILL.md +221 -0
- package/content/guidance/storefront-next/sfnext-custom-apis/references/WORKFLOW-EXAMPLES.md +294 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/SKILL.md +190 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/references/LOADER-PATTERNS.md +102 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/references/SCAPI-FETCHER.md +93 -0
- package/content/guidance/storefront-next/sfnext-deployment/SKILL.md +141 -0
- package/content/guidance/storefront-next/sfnext-deployment/references/MRT-DEPLOYMENT.md +90 -0
- package/content/guidance/storefront-next/sfnext-extensions/SKILL.md +142 -0
- package/content/guidance/storefront-next/sfnext-extensions/references/BASE-AUDIT.md +65 -0
- package/content/guidance/storefront-next/sfnext-extensions/references/EXTENSION-EXAMPLES.md +116 -0
- package/content/guidance/storefront-next/sfnext-hybrid-storefronts/SKILL.md +148 -0
- package/content/guidance/storefront-next/sfnext-hybrid-storefronts/references/HYBRID-PROXY-CONFIG.md +123 -0
- package/content/guidance/storefront-next/sfnext-i18n/SKILL.md +187 -0
- package/content/guidance/storefront-next/sfnext-page-designer/SKILL.md +181 -0
- package/content/guidance/storefront-next/sfnext-page-designer/references/COMPONENT-REGISTRY.md +78 -0
- package/content/guidance/storefront-next/sfnext-page-designer/references/DECORATOR-PATTERNS.md +180 -0
- package/content/guidance/storefront-next/sfnext-performance/SKILL.md +132 -0
- package/content/guidance/storefront-next/sfnext-project-setup/SKILL.md +160 -0
- package/content/guidance/storefront-next/sfnext-project-setup/references/ENV-VARIABLES.md +82 -0
- package/content/guidance/storefront-next/sfnext-project-setup/references/PROJECT-STRUCTURE.md +99 -0
- package/content/guidance/storefront-next/sfnext-routing/SKILL.md +180 -0
- package/content/guidance/storefront-next/sfnext-routing/references/ROUTE-CONVENTIONS.md +65 -0
- package/content/guidance/storefront-next/sfnext-scapi-management/SKILL.md +203 -0
- package/content/guidance/storefront-next/sfnext-scapi-management/references/CLI-COMMANDS.md +122 -0
- package/content/guidance/storefront-next/sfnext-state-management/SKILL.md +123 -0
- package/content/guidance/storefront-next/sfnext-testing/SKILL.md +184 -0
- package/content/guidance/storefront-next/sfnext-testing/references/STORYBOOK-PATTERNS.md +118 -0
- package/dist/commands/mcp.d.ts +2 -3
- package/dist/commands/mcp.js +53 -48
- package/dist/guidance.d.ts +6 -0
- package/dist/guidance.js +157 -0
- package/dist/registry.d.ts +2 -1
- package/dist/registry.js +22 -170
- package/dist/server.d.ts +19 -5
- package/dist/server.js +65 -8
- package/dist/skill-references.d.ts +28 -0
- package/dist/skill-references.js +14 -0
- package/dist/tools/adapter.d.ts +8 -5
- package/dist/tools/adapter.js +19 -7
- package/dist/tools/cartridges/index.js +38 -15
- package/dist/tools/cartridges/selected-files.d.ts +11 -0
- package/dist/tools/cartridges/selected-files.js +61 -0
- package/dist/tools/cip/client.d.ts +9 -0
- package/dist/tools/cip/client.js +44 -0
- package/dist/tools/cip/index.d.ts +6 -0
- package/dist/tools/cip/index.js +209 -0
- package/dist/tools/diagnostics/config-inspect.js +8 -4
- package/dist/tools/diagnostics/debug-capture-at-breakpoint.js +37 -11
- package/dist/tools/diagnostics/{debug-step.d.ts → debug-control.d.ts} +1 -1
- package/dist/tools/diagnostics/debug-control.js +36 -0
- package/dist/tools/diagnostics/debug-end-session.js +6 -7
- package/dist/tools/diagnostics/debug-evaluate.js +8 -6
- package/dist/tools/diagnostics/{debug-continue.d.ts → debug-inspect.d.ts} +1 -1
- package/dist/tools/diagnostics/debug-inspect.js +70 -0
- package/dist/tools/diagnostics/debug-list-sessions.js +4 -2
- package/dist/tools/diagnostics/debug-set-breakpoints.js +16 -15
- package/dist/tools/diagnostics/debug-start-session.js +5 -2
- package/dist/tools/diagnostics/debug-wait-for-stop.js +5 -2
- package/dist/tools/diagnostics/index.d.ts +2 -2
- package/dist/tools/diagnostics/index.js +8 -20
- package/dist/tools/diagnostics/log-watch-registry.d.ts +1 -1
- package/dist/tools/diagnostics/log-watch-registry.js +2 -2
- package/dist/tools/diagnostics/logs-get-recent.js +4 -1
- package/dist/tools/diagnostics/logs-list-files.js +4 -2
- package/dist/tools/diagnostics/logs-watch-poll.js +7 -11
- package/dist/tools/diagnostics/{logs-watch-start.d.ts → logs-watch.d.ts} +1 -1
- package/dist/tools/diagnostics/{logs-watch-start.js → logs-watch.js} +45 -12
- package/dist/tools/diagnostics/mrt-log-watch-registry.js +2 -2
- package/dist/tools/diagnostics/mrt-logs-watch-poll.js +6 -8
- package/dist/tools/diagnostics/{mrt-logs-watch-start.d.ts → mrt-logs-watch.d.ts} +1 -1
- package/dist/tools/diagnostics/{mrt-logs-watch-start.js → mrt-logs-watch.js} +44 -11
- package/dist/tools/diagnostics/watch-lifecycle.d.ts +3 -0
- package/dist/tools/diagnostics/watch-lifecycle.js +47 -0
- package/dist/tools/docs/docs-list.js +12 -8
- package/dist/tools/docs/docs-read.js +8 -2
- package/dist/tools/docs/docs-schema-list.js +5 -1
- package/dist/tools/docs/docs-schema-read.js +5 -1
- package/dist/tools/docs/docs-schema-search.js +5 -1
- package/dist/tools/docs/docs-search.js +8 -7
- package/dist/tools/docs/storefront.d.ts +21 -1
- package/dist/tools/docs/storefront.js +25 -0
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js +2 -2
- package/dist/tools/mrt/index.js +3 -1
- package/dist/tools/project-context.d.ts +5 -3
- package/dist/tools/project-context.js +1 -1
- package/dist/tools/scapi/index.d.ts +1 -1
- package/dist/tools/scapi/index.js +2 -2
- package/dist/tools/scapi/metrics-get.js +3 -1
- package/dist/tools/scapi/scapi-code.d.ts +3 -0
- package/dist/tools/scapi/scapi-code.js +237 -0
- package/dist/tools/scapi/scapi-custom-apis-get-status.js +3 -1
- package/dist/tools/scapi/scapi-schemas-list.js +8 -1
- package/dist/tools/webdav/files.d.ts +14 -0
- package/dist/tools/webdav/files.js +118 -0
- package/dist/tools/webdav/index.d.ts +3 -0
- package/dist/tools/webdav/index.js +160 -0
- package/dist/utils/constants.d.ts +2 -2
- package/dist/utils/constants.js +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/tool-effects.d.ts +4 -0
- package/dist/utils/tool-effects.js +15 -0
- package/dist/utils/types.d.ts +17 -8
- package/dist/utils/types.js +0 -5
- package/node_modules/@modelcontextprotocol/core/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/core/README.md +40 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts +8501 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs +1678 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs +2899 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts +8501 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.cjs +175 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.mjs +3 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +201 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +99 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +99 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +3 -0
- package/node_modules/@modelcontextprotocol/core/package.json +85 -0
- package/node_modules/@modelcontextprotocol/server/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/server/README.md +30 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs +7514 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts +1071 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts +1071 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs +7531 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs +986 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts +74 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts +74 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs +981 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/chunk-Bnu9O96Y.cjs +60 -0
- package/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs +42 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts +4043 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts +4045 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs +46 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs +34 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.cjs +2055 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.cts +739 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.mts +739 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.mjs +1870 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs +2022 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs +1931 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs +23 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts +11 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts +11 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs +22 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.cjs +12 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.cts +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.mts +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs +4 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs +30 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts +10 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts +10 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs +29 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs +7606 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs +8104 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs +564 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts +107 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts +107 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs +562 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts +1099 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts +1099 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.cjs +5 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.mjs +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.cjs +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.mjs +3 -0
- package/node_modules/@modelcontextprotocol/server/package.json +160 -0
- package/node_modules/@salesforce/b2c-agent-plugins/CHANGELOG.md +351 -0
- package/node_modules/@salesforce/b2c-agent-plugins/README.md +84 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/.codex-plugin/plugin.json +40 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/README.md +42 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/assets/logo.svg +31 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/plugin.json +44 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-business-manager-extensions/SKILL.md +361 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-business-manager-extensions/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-business-manager-extensions/references/EXTENSIONS-XML.md +458 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-controllers/SKILL.md +301 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-controllers/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-controllers/references/CLASSIC-PATTERNS.md +335 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-controllers/references/SFRA-PATTERNS.md +400 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-custom-api-development/SKILL.md +281 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-custom-api-development/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-custom-api-development/references/CONTRACT.md +142 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-custom-api-development/references/IMPLEMENTATION.md +153 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-custom-api-development/references/TESTING.md +118 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-custom-caches/SKILL.md +279 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-custom-caches/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-custom-job-steps/SKILL.md +520 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-custom-job-steps/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-custom-job-steps/references/CHUNK-ORIENTED.md +377 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-custom-job-steps/references/JOBS-XML.md +212 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-custom-job-steps/references/STEPTYPES-JSON.md +373 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-custom-job-steps/references/TASK-ORIENTED.md +344 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-custom-objects/SKILL.md +327 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-custom-objects/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-custom-objects/references/OCAPI-SEARCH.md +298 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-forms/SKILL.md +242 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-forms/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-forms/references/FORM-XML.md +409 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-hooks/SKILL.md +500 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-hooks/evals/trigger-evals.json +14 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-hooks/references/OCAPI-SCAPI-HOOKS.md +403 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-hooks/references/ORDER-HOOK-LIFECYCLE.md +169 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-hooks/references/SYSTEM-HOOKS.md +433 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-isml/SKILL.md +320 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-isml/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-isml/references/EXPRESSIONS.md +366 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-isml/references/TAGS.md +443 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-localization/SKILL.md +344 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-localization/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-localization/references/PATTERNS.md +407 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-logging/SKILL.md +352 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-logging/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-logging/references/LOG-FILES.md +282 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-metadata/SKILL.md +406 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-metadata/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-metadata/references/SYSTEM-OBJECTS.md +320 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-metadata/references/XML-EXAMPLES.md +366 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-onboarding/SKILL.md +154 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-ordering/SKILL.md +391 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-ordering/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-page-designer/SKILL.md +410 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-page-designer/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-page-designer/references/ATTRIBUTE-TYPES.md +436 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-page-designer/references/META-DEFINITIONS.md +340 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-querying-data/SKILL.md +289 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-querying-data/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-querying-data/references/PERFORMANCE-APIS.md +74 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-admin/SKILL.md +53 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-admin/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-admin/references/CLIENT-EXAMPLES.md +440 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-admin/references/INTEGRATION-PATTERNS.md +518 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-admin/references/OAUTH-SCOPES.md +337 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/SKILL.md +56 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/references/CHECKOUT-FLOW.md +466 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/references/CLIENT-EXAMPLES.md +352 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/references/COMMON-PATTERNS.md +390 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/references/SCOPES.md +290 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-slas-auth-patterns/SKILL.md +420 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-slas-auth-patterns/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-slas-auth-patterns/references/PASSKEYS.md +126 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-slas-auth-patterns/references/SESSION-BRIDGE.md +267 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-slas-auth-patterns/references/TOKEN-LIFECYCLE.md +367 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-webservices/SKILL.md +318 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-webservices/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-webservices/references/FTP-SERVICES.md +524 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-webservices/references/HTTP-SERVICES.md +578 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-webservices/references/SERVICES-XML.md +351 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-webservices/references/SOAP-SERVICES.md +587 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/.codex-plugin/plugin.json +40 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/README.md +42 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/assets/logo.svg +31 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/plugin.json +44 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-am/SKILL.md +277 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-am/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-bm-users-roles/SKILL.md +210 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cap/SKILL.md +131 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cip/SKILL.md +116 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cip/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cip/references/KNOWN_TABLES.md +105 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cip/references/SALES_ANALYSIS.md +50 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cip/references/STARTER_QUERIES.md +147 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-code/SKILL.md +146 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-code/evals/trigger-evals.json +14 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-config/SKILL.md +412 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-config/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-content/SKILL.md +176 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-content/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-debug/SKILL.md +138 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-debug/evals/trigger-evals.json +16 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-docs/SKILL.md +274 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-docs/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-ecdn/SKILL.md +135 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-ecdn/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-ecdn/references/ADVANCED.md +82 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-ecdn/references/SECURITY.md +75 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-import-set-migrations/SKILL.md +265 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-import-set-migrations/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-job/SKILL.md +62 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-job/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-job/references/EXPORT.md +115 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-job/references/IMPORT.md +43 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-job/references/RUN-AND-MONITOR.md +119 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-logs/SKILL.md +249 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-logs/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-metrics/SKILL.md +315 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-mrt/SKILL.md +206 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-mrt/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-mrt/references/BUNDLE-COMMANDS.md +185 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-mrt/references/ENVIRONMENT-COMMANDS.md +195 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-mrt/references/PROJECT-COMMANDS.md +154 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-sandbox/SKILL.md +112 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-sandbox/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-custom/SKILL.md +126 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-custom/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-schemas/SKILL.md +64 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-schemas/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-schemas/references/CLI-EXAMPLES.md +108 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-site-import-export/SKILL.md +57 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-site-import-export/evals/trigger-evals.json +14 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-site-import-export/references/IMPORT-OPTIONS.md +118 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-site-import-export/references/METADATA-XML.md +381 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-site-import-export/references/WORKFLOWS.md +182 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-sites/SKILL.md +112 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-sites/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-slas/SKILL.md +182 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-slas/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-webdav/SKILL.md +169 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-webdav/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-experimental/skills/b2c-scaffold/SKILL.md +168 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-experimental/skills/b2c-scaffold/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/.codex-plugin/plugin.json +39 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/README.md +31 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/assets/logo.svg +31 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/plugin.json +43 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-checkout-triage/SKILL.md +68 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-job-health/SKILL.md +75 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-job-health/references/job-logs.md +21 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-order-failure-triage/SKILL.md +66 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-order-failure-triage/references/order-evidence.md +87 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-production-triage/SKILL.md +87 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-production-triage/references/escalation.md +57 -0
- package/node_modules/@salesforce/b2c-agent-plugins/eval/README.md +160 -0
- package/node_modules/@salesforce/b2c-agent-plugins/eval/eval_lib.py +705 -0
- package/node_modules/@salesforce/b2c-agent-plugins/eval/project/CLAUDE.md +10 -0
- package/node_modules/@salesforce/b2c-agent-plugins/eval/project/README.md +24 -0
- package/node_modules/@salesforce/b2c-agent-plugins/eval/project/cartridges/app_storefront_custom/cartridge/controllers/Loyalty.js +16 -0
- package/node_modules/@salesforce/b2c-agent-plugins/eval/project/cartridges/app_storefront_custom/cartridge/models/loyalty.js +13 -0
- package/node_modules/@salesforce/b2c-agent-plugins/eval/project/cartridges/app_storefront_custom/cartridge/templates/default/loyalty/dashboard.isml +22 -0
- package/node_modules/@salesforce/b2c-agent-plugins/eval/project/dw.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/eval/run_eval.py +187 -0
- package/node_modules/@salesforce/b2c-agent-plugins/eval/run_loop.py +467 -0
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/.codex-plugin/plugin.json +40 -0
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/README.md +55 -0
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/assets/logo.svg +31 -0
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/plugin.json +44 -0
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/SKILL.md +444 -0
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/references/PAGE-DESIGNER-SFN.md +120 -0
- package/node_modules/@salesforce/b2c-agent-plugins/package.json +6 -0
- package/node_modules/@salesforce/b2c-agent-plugins/plugins.json +23 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/.codex-plugin/plugin.json +39 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/README.md +56 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/assets/logo.svg +31 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/plugin.json +43 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/SKILL.md +120 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/SKILL.md +191 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/SKILL.md +160 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/SKILL.md +195 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/COMPONENT-AUTHORING.md +206 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/PROJECT-STRUCTURE.md +43 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/TOKEN-SYSTEM.md +130 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/TROUBLESHOOTING.md +34 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/SKILL.md +135 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/COMPONENT-AUTHORING.md +206 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/PROJECT-STRUCTURE.md +43 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/TOKEN-SYSTEM.md +130 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/TROUBLESHOOTING.md +34 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/SKILL.md +221 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/references/WORKFLOW-EXAMPLES.md +294 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/SKILL.md +190 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/LOADER-PATTERNS.md +102 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/SCAPI-FETCHER.md +93 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/SKILL.md +141 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/references/MRT-DEPLOYMENT.md +90 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/SKILL.md +142 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/BASE-AUDIT.md +65 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/EXTENSION-EXAMPLES.md +116 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/SKILL.md +148 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/references/HYBRID-PROXY-CONFIG.md +123 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/SKILL.md +187 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/SKILL.md +181 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/COMPONENT-REGISTRY.md +78 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/DECORATOR-PATTERNS.md +180 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/SKILL.md +132 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/SKILL.md +160 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/ENV-VARIABLES.md +82 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/PROJECT-STRUCTURE.md +99 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/SKILL.md +180 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/references/ROUTE-CONVENTIONS.md +65 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/SKILL.md +203 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/references/CLI-COMMANDS.md +122 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/SKILL.md +123 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/SKILL.md +184 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/STORYBOOK-PATTERNS.md +118 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next-figma/.codex-plugin/plugin.json +40 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next-figma/README.md +45 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next-figma/assets/logo.svg +31 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next-figma/plugin.json +44 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next-figma/skills/sfnext-create-figma-kit/SKILL.md +133 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next-figma/skills/sfnext-create-figma-kit/evals/trigger-evals.json +12 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next-figma/skills/sfnext-create-figma-kit/references/FIGMA-COMPONENT-EDITING.md +92 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next-figma/skills/sfnext-create-figma-kit/references/PROJECT-STRUCTURE.md +43 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next-figma/skills/sfnext-create-figma-kit/references/TOKEN-SYSTEM.md +130 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next-figma/skills/sfnext-create-figma-kit/references/TROUBLESHOOTING.md +34 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next-figma/skills/sfnext-create-figma-kit/references/VERTICAL-FIGMA-SYNC.md +45 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +218 -0
- package/node_modules/zod/compile.cjs +77 -0
- package/node_modules/zod/compile.d.cts +1 -0
- package/node_modules/zod/compile.d.ts +1 -0
- package/node_modules/zod/compile.js +52 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +3 -0
- package/node_modules/zod/index.d.ts +3 -0
- package/node_modules/zod/index.js +7 -0
- package/node_modules/zod/locales/index.cjs +17 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +7 -0
- package/node_modules/zod/mini/index.cjs +32 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +7 -0
- package/node_modules/zod/package.json +146 -0
- package/node_modules/zod/src/compile.ts +56 -0
- package/node_modules/zod/src/index.ts +7 -0
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -0
- package/node_modules/zod/src/v3/ZodError.ts +340 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +586 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +128 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +206 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +431 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +114 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +922 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5138 -0
- package/node_modules/zod/src/v4/classic/checks.ts +33 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +78 -0
- package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/node_modules/zod/src/v4/classic/errors.ts +97 -0
- package/node_modules/zod/src/v4/classic/external.ts +55 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +721 -0
- package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +20 -0
- package/node_modules/zod/src/v4/classic/parse.ts +88 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2862 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +86 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +351 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +83 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +604 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +572 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +704 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
- package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +720 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +92 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +316 -0
- package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
- package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +455 -0
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +221 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +836 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +296 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +917 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +979 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +1310 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +391 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +67 -0
- package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +958 -0
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +281 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +107 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +334 -0
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +183 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +262 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +128 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +342 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +362 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +950 -0
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +234 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +366 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +497 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +44 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +184 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +885 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +662 -0
- package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +693 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +190 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +1346 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +124 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +780 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +4537 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +511 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +310 -0
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1859 -0
- package/node_modules/zod/src/v4/core/checks.ts +1306 -0
- package/node_modules/zod/src/v4/core/compile.ts +2188 -0
- package/node_modules/zod/src/v4/core/core.ts +232 -0
- package/node_modules/zod/src/v4/core/doc.ts +48 -0
- package/node_modules/zod/src/v4/core/errors.ts +546 -0
- package/node_modules/zod/src/v4/core/index.ts +19 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +830 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +148 -0
- package/node_modules/zod/src/v4/core/memoizer.ts +284 -0
- package/node_modules/zod/src/v4/core/parse.ts +288 -0
- package/node_modules/zod/src/v4/core/regexes.ts +207 -0
- package/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/node_modules/zod/src/v4/core/schemas.ts +5028 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +969 -0
- package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
- package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
- package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +1639 -0
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +214 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +180 -0
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +31 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +855 -0
- package/node_modules/zod/src/v4/core/util.ts +1209 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/visit.ts +193 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +118 -0
- package/node_modules/zod/src/v4/locales/az.ts +114 -0
- package/node_modules/zod/src/v4/locales/be.ts +186 -0
- package/node_modules/zod/src/v4/locales/bg.ts +131 -0
- package/node_modules/zod/src/v4/locales/bn.ts +121 -0
- package/node_modules/zod/src/v4/locales/ca.ts +119 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +138 -0
- package/node_modules/zod/src/v4/locales/cs.ts +121 -0
- package/node_modules/zod/src/v4/locales/da.ts +126 -0
- package/node_modules/zod/src/v4/locales/de.ts +119 -0
- package/node_modules/zod/src/v4/locales/el.ts +122 -0
- package/node_modules/zod/src/v4/locales/en.ts +134 -0
- package/node_modules/zod/src/v4/locales/eo.ts +121 -0
- package/node_modules/zod/src/v4/locales/es.ts +143 -0
- package/node_modules/zod/src/v4/locales/fa.ts +129 -0
- package/node_modules/zod/src/v4/locales/fi.ts +124 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +119 -0
- package/node_modules/zod/src/v4/locales/fr.ts +137 -0
- package/node_modules/zod/src/v4/locales/gu.ts +121 -0
- package/node_modules/zod/src/v4/locales/he.ts +251 -0
- package/node_modules/zod/src/v4/locales/hi.ts +124 -0
- package/node_modules/zod/src/v4/locales/hr.ts +133 -0
- package/node_modules/zod/src/v4/locales/hu.ts +120 -0
- package/node_modules/zod/src/v4/locales/hy.ts +173 -0
- package/node_modules/zod/src/v4/locales/id.ts +118 -0
- package/node_modules/zod/src/v4/locales/index.ts +62 -0
- package/node_modules/zod/src/v4/locales/is.ts +122 -0
- package/node_modules/zod/src/v4/locales/it.ts +119 -0
- package/node_modules/zod/src/v4/locales/ja.ts +117 -0
- package/node_modules/zod/src/v4/locales/ka.ts +126 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +122 -0
- package/node_modules/zod/src/v4/locales/kn.ts +124 -0
- package/node_modules/zod/src/v4/locales/ko.ts +124 -0
- package/node_modules/zod/src/v4/locales/lt.ts +241 -0
- package/node_modules/zod/src/v4/locales/mk.ts +121 -0
- package/node_modules/zod/src/v4/locales/ms.ts +118 -0
- package/node_modules/zod/src/v4/locales/ne.ts +126 -0
- package/node_modules/zod/src/v4/locales/nl.ts +124 -0
- package/node_modules/zod/src/v4/locales/nn.ts +119 -0
- package/node_modules/zod/src/v4/locales/no.ts +119 -0
- package/node_modules/zod/src/v4/locales/ota.ts +120 -0
- package/node_modules/zod/src/v4/locales/pl.ts +121 -0
- package/node_modules/zod/src/v4/locales/ps.ts +129 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +159 -0
- package/node_modules/zod/src/v4/locales/pt.ts +157 -0
- package/node_modules/zod/src/v4/locales/ro.ts +130 -0
- package/node_modules/zod/src/v4/locales/ru.ts +186 -0
- package/node_modules/zod/src/v4/locales/sk.ts +121 -0
- package/node_modules/zod/src/v4/locales/sl.ts +121 -0
- package/node_modules/zod/src/v4/locales/sv.ts +122 -0
- package/node_modules/zod/src/v4/locales/ta.ts +121 -0
- package/node_modules/zod/src/v4/locales/th.ts +122 -0
- package/node_modules/zod/src/v4/locales/tk.ts +111 -0
- package/node_modules/zod/src/v4/locales/tr.ts +114 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +120 -0
- package/node_modules/zod/src/v4/locales/ur.ts +122 -0
- package/node_modules/zod/src/v4/locales/uz.ts +118 -0
- package/node_modules/zod/src/v4/locales/vi.ts +120 -0
- package/node_modules/zod/src/v4/locales/yo.ts +127 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +119 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +118 -0
- package/node_modules/zod/src/v4/mini/checks.ts +33 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/node_modules/zod/src/v4/mini/external.ts +50 -0
- package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/node_modules/zod/src/v4/mini/parse.ts +16 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +2026 -0
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +57 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +190 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +158 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +582 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
- package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +41 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +1060 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +109 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +292 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +325 -0
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +373 -0
- package/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/node_modules/zod/v3/ZodError.cjs +148 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +143 -0
- package/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +112 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/package.json +7 -0
- package/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3779 -0
- package/node_modules/zod/v3/types.d.cts +1034 -0
- package/node_modules/zod/v3/types.d.ts +1034 -0
- package/node_modules/zod/v3/types.js +3697 -0
- package/node_modules/zod/v4/classic/checks.cjs +34 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +61 -0
- package/node_modules/zod/v4/classic/compat.d.cts +48 -0
- package/node_modules/zod/v4/classic/compat.d.ts +48 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/deep-partial.cjs +39 -0
- package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/node_modules/zod/v4/classic/errors.cjs +83 -0
- package/node_modules/zod/v4/classic/errors.d.cts +29 -0
- package/node_modules/zod/v4/classic/errors.d.ts +29 -0
- package/node_modules/zod/v4/classic/errors.js +57 -0
- package/node_modules/zod/v4/classic/external.cjs +76 -0
- package/node_modules/zod/v4/classic/external.d.cts +19 -0
- package/node_modules/zod/v4/classic/external.d.ts +19 -0
- package/node_modules/zod/v4/classic/external.js +17 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +686 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +660 -0
- package/node_modules/zod/v4/classic/in-out.cjs +63 -0
- package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
- package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
- package/node_modules/zod/v4/classic/in-out.js +36 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +3 -0
- package/node_modules/zod/v4/classic/index.d.ts +3 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +49 -0
- package/node_modules/zod/v4/classic/iso.d.cts +7 -0
- package/node_modules/zod/v4/classic/iso.d.ts +7 -0
- package/node_modules/zod/v4/classic/iso.js +15 -0
- package/node_modules/zod/v4/classic/package.json +7 -0
- package/node_modules/zod/v4/classic/parse.cjs +44 -0
- package/node_modules/zod/v4/classic/parse.d.cts +44 -0
- package/node_modules/zod/v4/classic/parse.d.ts +44 -0
- package/node_modules/zod/v4/classic/parse.js +16 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1611 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +802 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +802 -0
- package/node_modules/zod/v4/classic/schemas.js +1491 -0
- package/node_modules/zod/v4/core/api.cjs +1246 -0
- package/node_modules/zod/v4/core/api.d.cts +329 -0
- package/node_modules/zod/v4/core/api.d.ts +329 -0
- package/node_modules/zod/v4/core/api.js +1104 -0
- package/node_modules/zod/v4/core/checks.cjs +607 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +581 -0
- package/node_modules/zod/v4/core/compile.cjs +1813 -0
- package/node_modules/zod/v4/core/compile.d.cts +51 -0
- package/node_modules/zod/v4/core/compile.d.ts +51 -0
- package/node_modules/zod/v4/core/compile.js +1783 -0
- package/node_modules/zod/v4/core/core.cjs +148 -0
- package/node_modules/zod/v4/core/core.d.cts +82 -0
- package/node_modules/zod/v4/core/core.d.ts +82 -0
- package/node_modules/zod/v4/core/core.js +141 -0
- package/node_modules/zod/v4/core/doc.cjs +37 -0
- package/node_modules/zod/v4/core/doc.d.cts +16 -0
- package/node_modules/zod/v4/core/doc.d.ts +16 -0
- package/node_modules/zod/v4/core/doc.js +33 -0
- package/node_modules/zod/v4/core/errors.cjs +301 -0
- package/node_modules/zod/v4/core/errors.d.cts +225 -0
- package/node_modules/zod/v4/core/errors.d.ts +225 -0
- package/node_modules/zod/v4/core/errors.js +270 -0
- package/node_modules/zod/v4/core/index.cjs +51 -0
- package/node_modules/zod/v4/core/index.d.cts +19 -0
- package/node_modules/zod/v4/core/index.d.ts +19 -0
- package/node_modules/zod/v4/core/index.js +19 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +103 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +99 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +813 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +747 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +89 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +89 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/memoizer.cjs +272 -0
- package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
- package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
- package/node_modules/zod/v4/core/memoizer.js +265 -0
- package/node_modules/zod/v4/core/package.json +7 -0
- package/node_modules/zod/v4/core/parse.cjs +193 -0
- package/node_modules/zod/v4/core/parse.d.cts +52 -0
- package/node_modules/zod/v4/core/parse.d.ts +52 -0
- package/node_modules/zod/v4/core/parse.js +154 -0
- package/node_modules/zod/v4/core/regexes.cjs +184 -0
- package/node_modules/zod/v4/core/regexes.d.cts +87 -0
- package/node_modules/zod/v4/core/regexes.d.ts +87 -0
- package/node_modules/zod/v4/core/regexes.js +150 -0
- package/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +2481 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1253 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1253 -0
- package/node_modules/zod/v4/core/schemas.js +2440 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +660 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +153 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +153 -0
- package/node_modules/zod/v4/core/to-json-schema.js +650 -0
- package/node_modules/zod/v4/core/util.cjs +915 -0
- package/node_modules/zod/v4/core/util.d.cts +257 -0
- package/node_modules/zod/v4/core/util.d.ts +257 -0
- package/node_modules/zod/v4/core/util.js +846 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/core/visit.cjs +195 -0
- package/node_modules/zod/v4/core/visit.d.cts +30 -0
- package/node_modules/zod/v4/core/visit.d.ts +30 -0
- package/node_modules/zod/v4/core/visit.js +169 -0
- package/node_modules/zod/v4/index.cjs +32 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +4 -0
- package/node_modules/zod/v4/locales/ar.cjs +136 -0
- package/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +109 -0
- package/node_modules/zod/v4/locales/az.cjs +135 -0
- package/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +108 -0
- package/node_modules/zod/v4/locales/be.cjs +193 -0
- package/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +166 -0
- package/node_modules/zod/v4/locales/bg.cjs +150 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/zod/v4/locales/bg.js +123 -0
- package/node_modules/zod/v4/locales/bn.cjs +138 -0
- package/node_modules/zod/v4/locales/bn.d.cts +5 -0
- package/node_modules/zod/v4/locales/bn.d.ts +4 -0
- package/node_modules/zod/v4/locales/bn.js +111 -0
- package/node_modules/zod/v4/locales/ca.cjs +137 -0
- package/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +110 -0
- package/node_modules/zod/v4/locales/ckb.cjs +158 -0
- package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
- package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
- package/node_modules/zod/v4/locales/ckb.js +131 -0
- package/node_modules/zod/v4/locales/cs.cjs +141 -0
- package/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +114 -0
- package/node_modules/zod/v4/locales/da.cjs +145 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/zod/v4/locales/da.js +118 -0
- package/node_modules/zod/v4/locales/de.cjs +138 -0
- package/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +111 -0
- package/node_modules/zod/v4/locales/el.cjs +137 -0
- package/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/zod/v4/locales/el.js +110 -0
- package/node_modules/zod/v4/locales/en.cjs +150 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/node_modules/zod/v4/locales/en.js +123 -0
- package/node_modules/zod/v4/locales/eo.cjs +139 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/node_modules/zod/v4/locales/eo.js +112 -0
- package/node_modules/zod/v4/locales/es.cjs +161 -0
- package/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +134 -0
- package/node_modules/zod/v4/locales/fa.cjs +144 -0
- package/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +117 -0
- package/node_modules/zod/v4/locales/fi.cjs +142 -0
- package/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +115 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +137 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +110 -0
- package/node_modules/zod/v4/locales/fr.cjs +154 -0
- package/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +127 -0
- package/node_modules/zod/v4/locales/gu.cjs +138 -0
- package/node_modules/zod/v4/locales/gu.d.cts +5 -0
- package/node_modules/zod/v4/locales/gu.d.ts +4 -0
- package/node_modules/zod/v4/locales/gu.js +111 -0
- package/node_modules/zod/v4/locales/he.cjs +246 -0
- package/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +219 -0
- package/node_modules/zod/v4/locales/hi.cjs +136 -0
- package/node_modules/zod/v4/locales/hi.d.cts +5 -0
- package/node_modules/zod/v4/locales/hi.d.ts +4 -0
- package/node_modules/zod/v4/locales/hi.js +109 -0
- package/node_modules/zod/v4/locales/hr.cjs +151 -0
- package/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/zod/v4/locales/hr.js +124 -0
- package/node_modules/zod/v4/locales/hu.cjs +138 -0
- package/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +111 -0
- package/node_modules/zod/v4/locales/hy.cjs +183 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/zod/v4/locales/hy.js +156 -0
- package/node_modules/zod/v4/locales/id.cjs +136 -0
- package/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +109 -0
- package/node_modules/zod/v4/locales/index.cjs +131 -0
- package/node_modules/zod/v4/locales/index.d.cts +62 -0
- package/node_modules/zod/v4/locales/index.d.ts +62 -0
- package/node_modules/zod/v4/locales/index.js +62 -0
- package/node_modules/zod/v4/locales/is.cjs +139 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/zod/v4/locales/is.js +112 -0
- package/node_modules/zod/v4/locales/it.cjs +138 -0
- package/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +111 -0
- package/node_modules/zod/v4/locales/ja.cjs +137 -0
- package/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +110 -0
- package/node_modules/zod/v4/locales/ka.cjs +142 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/zod/v4/locales/ka.js +115 -0
- package/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/node_modules/zod/v4/locales/kh.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +140 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/zod/v4/locales/km.js +113 -0
- package/node_modules/zod/v4/locales/kn.cjs +141 -0
- package/node_modules/zod/v4/locales/kn.d.cts +5 -0
- package/node_modules/zod/v4/locales/kn.d.ts +4 -0
- package/node_modules/zod/v4/locales/kn.js +114 -0
- package/node_modules/zod/v4/locales/ko.cjs +141 -0
- package/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +114 -0
- package/node_modules/zod/v4/locales/lt.cjs +232 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/zod/v4/locales/lt.js +205 -0
- package/node_modules/zod/v4/locales/mk.cjs +139 -0
- package/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +112 -0
- package/node_modules/zod/v4/locales/ms.cjs +137 -0
- package/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +110 -0
- package/node_modules/zod/v4/locales/ne.cjs +136 -0
- package/node_modules/zod/v4/locales/ne.d.cts +5 -0
- package/node_modules/zod/v4/locales/ne.d.ts +4 -0
- package/node_modules/zod/v4/locales/ne.js +109 -0
- package/node_modules/zod/v4/locales/nl.cjs +140 -0
- package/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +113 -0
- package/node_modules/zod/v4/locales/nn.cjs +138 -0
- package/node_modules/zod/v4/locales/nn.d.cts +5 -0
- package/node_modules/zod/v4/locales/nn.d.ts +4 -0
- package/node_modules/zod/v4/locales/nn.js +111 -0
- package/node_modules/zod/v4/locales/no.cjs +138 -0
- package/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +111 -0
- package/node_modules/zod/v4/locales/ota.cjs +139 -0
- package/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +112 -0
- package/node_modules/zod/v4/locales/package.json +7 -0
- package/node_modules/zod/v4/locales/pl.cjs +139 -0
- package/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +112 -0
- package/node_modules/zod/v4/locales/ps.cjs +144 -0
- package/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +117 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +168 -0
- package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt-BR.js +141 -0
- package/node_modules/zod/v4/locales/pt.cjs +167 -0
- package/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +140 -0
- package/node_modules/zod/v4/locales/ro.cjs +147 -0
- package/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/zod/v4/locales/ro.js +120 -0
- package/node_modules/zod/v4/locales/ru.cjs +193 -0
- package/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +166 -0
- package/node_modules/zod/v4/locales/sk.cjs +141 -0
- package/node_modules/zod/v4/locales/sk.d.cts +5 -0
- package/node_modules/zod/v4/locales/sk.d.ts +4 -0
- package/node_modules/zod/v4/locales/sk.js +114 -0
- package/node_modules/zod/v4/locales/sl.cjs +139 -0
- package/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +112 -0
- package/node_modules/zod/v4/locales/sv.cjs +140 -0
- package/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +113 -0
- package/node_modules/zod/v4/locales/ta.cjs +140 -0
- package/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +113 -0
- package/node_modules/zod/v4/locales/th.cjs +140 -0
- package/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +113 -0
- package/node_modules/zod/v4/locales/tk.cjs +132 -0
- package/node_modules/zod/v4/locales/tk.d.cts +5 -0
- package/node_modules/zod/v4/locales/tk.d.ts +4 -0
- package/node_modules/zod/v4/locales/tk.js +105 -0
- package/node_modules/zod/v4/locales/tr.cjs +135 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/node_modules/zod/v4/locales/tr.js +108 -0
- package/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/node_modules/zod/v4/locales/ua.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +138 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/zod/v4/locales/uk.js +111 -0
- package/node_modules/zod/v4/locales/ur.cjs +140 -0
- package/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +113 -0
- package/node_modules/zod/v4/locales/uz.cjs +138 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/zod/v4/locales/uz.js +111 -0
- package/node_modules/zod/v4/locales/vi.cjs +138 -0
- package/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +111 -0
- package/node_modules/zod/v4/locales/yo.cjs +137 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/zod/v4/locales/yo.js +110 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +139 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +112 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +137 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +110 -0
- package/node_modules/zod/v4/mini/checks.cjs +35 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +52 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +22 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +39 -0
- package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.js +13 -0
- package/node_modules/zod/v4/mini/external.cjs +74 -0
- package/node_modules/zod/v4/mini/external.d.cts +16 -0
- package/node_modules/zod/v4/mini/external.d.ts +16 -0
- package/node_modules/zod/v4/mini/external.js +16 -0
- package/node_modules/zod/v4/mini/in-out.cjs +63 -0
- package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
- package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
- package/node_modules/zod/v4/mini/in-out.js +36 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +64 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +34 -0
- package/node_modules/zod/v4/mini/package.json +7 -0
- package/node_modules/zod/v4/mini/parse.cjs +18 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +1111 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +475 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +475 -0
- package/node_modules/zod/v4/mini/schemas.js +987 -0
- package/node_modules/zod/v4/package.json +7 -0
- package/node_modules/zod/v4-mini/index.cjs +32 -0
- package/node_modules/zod/v4-mini/index.d.cts +3 -0
- package/node_modules/zod/v4-mini/index.d.ts +3 -0
- package/node_modules/zod/v4-mini/index.js +3 -0
- package/node_modules/zod/v4-mini/package.json +7 -0
- package/oclif.manifest.json +88 -62
- package/package.json +17 -9
- package/content/pwav3/components.md +0 -400
- package/content/pwav3/config.md +0 -124
- package/content/pwav3/data-fetching.md +0 -213
- package/content/pwav3/extensibility.md +0 -167
- package/content/pwav3/i18n.md +0 -214
- package/content/pwav3/quick-reference.md +0 -169
- package/content/pwav3/routing.md +0 -107
- package/content/pwav3/state-management.md +0 -193
- package/content/pwav3/styling.md +0 -248
- package/content/pwav3/testing.md +0 -124
- package/content/site-theming/theming-accessibility.md +0 -126
- package/content/site-theming/theming-questions.md +0 -208
- package/content/site-theming/theming-validation.md +0 -174
- package/dist/tools/diagnostics/debug-continue.js +0 -27
- package/dist/tools/diagnostics/debug-get-stack.d.ts +0 -4
- package/dist/tools/diagnostics/debug-get-stack.js +0 -31
- package/dist/tools/diagnostics/debug-get-variables.d.ts +0 -4
- package/dist/tools/diagnostics/debug-get-variables.js +0 -45
- package/dist/tools/diagnostics/debug-step.js +0 -38
- package/dist/tools/diagnostics/logs-watch-list.d.ts +0 -4
- package/dist/tools/diagnostics/logs-watch-list.js +0 -37
- package/dist/tools/diagnostics/logs-watch-stop.d.ts +0 -4
- package/dist/tools/diagnostics/logs-watch-stop.js +0 -36
- package/dist/tools/diagnostics/mrt-logs-watch-list.d.ts +0 -4
- package/dist/tools/diagnostics/mrt-logs-watch-list.js +0 -37
- package/dist/tools/diagnostics/mrt-logs-watch-stop.d.ts +0 -4
- package/dist/tools/diagnostics/mrt-logs-watch-stop.js +0 -37
- package/dist/tools/pwav3/index.d.ts +0 -22
- package/dist/tools/pwav3/index.js +0 -20
- package/dist/tools/pwav3/pwa-kit-development-guidelines.d.ts +0 -9
- package/dist/tools/pwav3/pwa-kit-development-guidelines.js +0 -111
- package/dist/tools/scapi/scapi-custom-api-generate-scaffold.d.ts +0 -67
- package/dist/tools/scapi/scapi-custom-api-generate-scaffold.js +0 -204
|
@@ -0,0 +1,2481 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.$ZodXor = exports.$ZodUnion = exports.$ZodObjectJIT = exports.$ZodObject = exports.$ZodArray = exports.$ZodDate = exports.$ZodVoid = exports.$ZodNever = exports.$ZodUnknown = exports.$ZodAny = exports.$ZodNull = exports.$ZodUndefined = exports.$ZodSymbol = exports.$ZodBigIntFormat = exports.$ZodBigInt = exports.$ZodBoolean = exports.$ZodNumberFormat = exports.$ZodNumber = exports.$ZodCustomStringFormat = exports.$ZodJWT = exports.$ZodCreditCard = exports.$ZodE164 = exports.$ZodBase64URL = exports.$ZodBase64 = exports.$ZodCIDRv6 = exports.$ZodCIDRv4 = exports.$ZodMAC = exports.$ZodIPv6 = exports.$ZodIPv4 = exports.$ZodISODuration = exports.$ZodISOTime = exports.$ZodISODate = exports.$ZodISODateTime = exports.$ZodKSUID = exports.$ZodXID = exports.$ZodULID = exports.$ZodCUID2 = exports.$ZodCUID = exports.$ZodNanoID = exports.$ZodEmoji = exports.$ZodURL = exports.URL_UNPARSEABLE = exports.URL_BAD_FORMAT = exports.$ZodEmail = exports.$ZodUUID = exports.$ZodGUID = exports.$ZodStringFormat = exports.$ZodString = exports.clone = exports.$ZodType = void 0;
|
|
27
|
+
exports.$ZodCustom = exports.$ZodLazy = exports.$ZodPromise = exports.$ZodFunction = exports.$ZodTemplateLiteral = exports.$ZodReadonly = exports.$ZodPreprocess = exports.$ZodCodec = exports.$ZodPipe = exports.$ZodNaN = exports.$ZodCatch = exports.$ZodSuccess = exports.$ZodNonOptional = exports.$ZodPrefault = exports.$ZodDefault = exports.$ZodNullable = exports.$ZodExactOptional = exports.$ZodOptional = exports.$ZodTransform = exports.$ZodFile = exports.$ZodLiteral = exports.$ZodEnum = exports.$ZodSet = exports.$ZodMap = exports.$ZodRecord = exports.$ZodTuple = exports.$ZodIntersection = exports.$ZodDiscriminatedUnion = void 0;
|
|
28
|
+
exports.standardProps = standardProps;
|
|
29
|
+
exports.parseURLObject = parseURLObject;
|
|
30
|
+
exports.stripTabAndNewline = stripTabAndNewline;
|
|
31
|
+
exports.urlHostnameOk = urlHostnameOk;
|
|
32
|
+
exports.urlProtocolOk = urlProtocolOk;
|
|
33
|
+
exports.isValidIPv6 = isValidIPv6;
|
|
34
|
+
exports.isValidCIDRv6 = isValidCIDRv6;
|
|
35
|
+
exports.isValidBase64 = isValidBase64;
|
|
36
|
+
exports.isValidBase64URL = isValidBase64URL;
|
|
37
|
+
exports.isValidCreditCard = isValidCreditCard;
|
|
38
|
+
exports.isValidJWT = isValidJWT;
|
|
39
|
+
exports.getDiscriminatedOption = getDiscriminatedOption;
|
|
40
|
+
exports.mergeValues = mergeValues;
|
|
41
|
+
const checks = __importStar(require("./checks.cjs"));
|
|
42
|
+
const core = __importStar(require("./core.cjs"));
|
|
43
|
+
const doc_js_1 = require("./doc.cjs");
|
|
44
|
+
const parse_js_1 = require("./parse.cjs");
|
|
45
|
+
const regexes = __importStar(require("./regexes.cjs"));
|
|
46
|
+
const util = __importStar(require("./util.cjs"));
|
|
47
|
+
const versions_js_1 = require("./versions.cjs");
|
|
48
|
+
exports.$ZodType = core.$constructor("$ZodType", (inst, def) => {
|
|
49
|
+
var _a;
|
|
50
|
+
inst ?? (inst = {});
|
|
51
|
+
inst._zod.def = def; // set _def property
|
|
52
|
+
inst._zod.bag = inst._zod.bag || {}; // initialize _bag object
|
|
53
|
+
inst._zod.version = versions_js_1.version;
|
|
54
|
+
const defChecks = inst._zod.def.checks;
|
|
55
|
+
// if inst is itself a checks.$ZodCheck, run it as a check
|
|
56
|
+
const checks = inst._zod.traits.has("$ZodCheck")
|
|
57
|
+
? [inst, ...(defChecks ?? [])]
|
|
58
|
+
: defChecks?.length
|
|
59
|
+
? [...defChecks]
|
|
60
|
+
: [];
|
|
61
|
+
for (const ch of checks) {
|
|
62
|
+
for (const fn of ch._zod.onattach) {
|
|
63
|
+
fn(inst);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (checks.length === 0) {
|
|
67
|
+
// deferred initializer inst._zod.parse is not yet defined
|
|
68
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
69
|
+
inst._zod.deferred?.push(() => {
|
|
70
|
+
inst._zod.run = inst._zod.parse;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
const runChecks = (payload, checks, ctx) => {
|
|
75
|
+
if (payload.memo)
|
|
76
|
+
return payload;
|
|
77
|
+
let isAborted = util.aborted(payload);
|
|
78
|
+
let asyncResult;
|
|
79
|
+
for (const ch of checks) {
|
|
80
|
+
if (ch._zod.def.when) {
|
|
81
|
+
if (util.explicitlyAborted(payload))
|
|
82
|
+
continue;
|
|
83
|
+
const shouldRun = ch._zod.def.when(payload);
|
|
84
|
+
if (!shouldRun)
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
else if (isAborted) {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
const currLen = payload.issues.length;
|
|
91
|
+
const _ = ch._zod.check(payload);
|
|
92
|
+
if (_ instanceof Promise && ctx?.async === false) {
|
|
93
|
+
throw new core.$ZodAsyncError();
|
|
94
|
+
}
|
|
95
|
+
if (asyncResult || _ instanceof Promise) {
|
|
96
|
+
asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
97
|
+
await _;
|
|
98
|
+
const nextLen = payload.issues.length;
|
|
99
|
+
if (nextLen === currLen)
|
|
100
|
+
return;
|
|
101
|
+
util.attachSchema(payload.issues, currLen, inst);
|
|
102
|
+
if (!isAborted)
|
|
103
|
+
isAborted = util.aborted(payload, currLen);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
const nextLen = payload.issues.length;
|
|
108
|
+
if (nextLen === currLen)
|
|
109
|
+
continue;
|
|
110
|
+
util.attachSchema(payload.issues, currLen, inst);
|
|
111
|
+
if (!isAborted)
|
|
112
|
+
isAborted = util.aborted(payload, currLen);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (asyncResult) {
|
|
116
|
+
return asyncResult.then(() => {
|
|
117
|
+
return payload;
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return payload;
|
|
121
|
+
};
|
|
122
|
+
const handleCanaryResult = (canary, payload, ctx) => {
|
|
123
|
+
// abort if the canary is aborted
|
|
124
|
+
if (util.aborted(canary)) {
|
|
125
|
+
canary.aborted = true;
|
|
126
|
+
return canary;
|
|
127
|
+
}
|
|
128
|
+
// run checks first, then
|
|
129
|
+
const checkResult = runChecks(payload, checks, ctx);
|
|
130
|
+
if (checkResult instanceof Promise) {
|
|
131
|
+
if (ctx.async === false)
|
|
132
|
+
throw new core.$ZodAsyncError();
|
|
133
|
+
return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));
|
|
134
|
+
}
|
|
135
|
+
return inst._zod.parse(checkResult, ctx);
|
|
136
|
+
};
|
|
137
|
+
inst._zod.run = (payload, ctx) => {
|
|
138
|
+
if (ctx.skipChecks) {
|
|
139
|
+
return inst._zod.parse(payload, ctx);
|
|
140
|
+
}
|
|
141
|
+
if (ctx.direction === "backward") {
|
|
142
|
+
// run canary initial pass (no checks)
|
|
143
|
+
const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
|
|
144
|
+
if (canary instanceof Promise) {
|
|
145
|
+
return canary.then((canary) => {
|
|
146
|
+
return handleCanaryResult(canary, payload, ctx);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
return handleCanaryResult(canary, payload, ctx);
|
|
150
|
+
}
|
|
151
|
+
// forward
|
|
152
|
+
const result = inst._zod.parse(payload, ctx);
|
|
153
|
+
if (result instanceof Promise) {
|
|
154
|
+
if (ctx.async === false)
|
|
155
|
+
throw new core.$ZodAsyncError();
|
|
156
|
+
return result.then((result) => runChecks(result, checks, ctx));
|
|
157
|
+
}
|
|
158
|
+
return runChecks(result, checks, ctx);
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}, {
|
|
162
|
+
// Wrappers extend this by installing a richer factory over it; reading it eagerly would defeat the laziness.
|
|
163
|
+
get "~standard"() {
|
|
164
|
+
return util.hide(this, "~standard", standardProps(this));
|
|
165
|
+
},
|
|
166
|
+
set "~standard"(value) {
|
|
167
|
+
util.own(this, "~standard", value);
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
/** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
|
|
171
|
+
const toStandardResult = (r) => r.success ? { value: r.data } : { issues: r.error?.issues };
|
|
172
|
+
function standardProps(inst) {
|
|
173
|
+
return {
|
|
174
|
+
validate: (value) => {
|
|
175
|
+
try {
|
|
176
|
+
return toStandardResult((0, parse_js_1.safeParse)(inst, value));
|
|
177
|
+
}
|
|
178
|
+
catch (_) {
|
|
179
|
+
return (0, parse_js_1.safeParseAsync)(inst, value).then(toStandardResult);
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
vendor: "zod",
|
|
183
|
+
version: 1,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
var util_js_1 = require("./util.cjs");
|
|
187
|
+
Object.defineProperty(exports, "clone", { enumerable: true, get: function () { return util_js_1.clone; } });
|
|
188
|
+
exports.$ZodString = core.$constructor("$ZodString", (inst, def) => {
|
|
189
|
+
exports.$ZodType.init(inst, def);
|
|
190
|
+
inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? regexes.string(inst._zod.bag);
|
|
191
|
+
inst._zod.parse = (payload, _) => {
|
|
192
|
+
if (def.coerce)
|
|
193
|
+
try {
|
|
194
|
+
payload.value = String(payload.value);
|
|
195
|
+
}
|
|
196
|
+
catch (_) { }
|
|
197
|
+
if (typeof payload.value === "string")
|
|
198
|
+
return payload;
|
|
199
|
+
payload.issues.push({
|
|
200
|
+
expected: "string",
|
|
201
|
+
code: "invalid_type",
|
|
202
|
+
input: payload.value,
|
|
203
|
+
inst,
|
|
204
|
+
});
|
|
205
|
+
return payload;
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
exports.$ZodStringFormat = core.$constructor("$ZodStringFormat", (inst, def) => {
|
|
209
|
+
// check initialization must come first
|
|
210
|
+
checks.$ZodCheckStringFormat.init(inst, def);
|
|
211
|
+
exports.$ZodString.init(inst, def);
|
|
212
|
+
});
|
|
213
|
+
exports.$ZodGUID = core.$constructor("$ZodGUID", (inst, def) => {
|
|
214
|
+
def.pattern ?? (def.pattern = regexes.guid);
|
|
215
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
216
|
+
});
|
|
217
|
+
exports.$ZodUUID = core.$constructor("$ZodUUID", (inst, def) => {
|
|
218
|
+
if (def.version) {
|
|
219
|
+
const versionMap = {
|
|
220
|
+
v1: 1,
|
|
221
|
+
v2: 2,
|
|
222
|
+
v3: 3,
|
|
223
|
+
v4: 4,
|
|
224
|
+
v5: 5,
|
|
225
|
+
v6: 6,
|
|
226
|
+
v7: 7,
|
|
227
|
+
v8: 8,
|
|
228
|
+
};
|
|
229
|
+
const v = versionMap[def.version];
|
|
230
|
+
if (v === undefined)
|
|
231
|
+
throw new Error(`Invalid UUID version: "${def.version}"`);
|
|
232
|
+
def.pattern ?? (def.pattern = regexes.uuid(v));
|
|
233
|
+
}
|
|
234
|
+
else
|
|
235
|
+
def.pattern ?? (def.pattern = regexes.uuid());
|
|
236
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
237
|
+
});
|
|
238
|
+
exports.$ZodEmail = core.$constructor("$ZodEmail", (inst, def) => {
|
|
239
|
+
def.pattern ?? (def.pattern = regexes.email);
|
|
240
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
241
|
+
});
|
|
242
|
+
/** The `://` guard rejected the input before the URL constructor saw it. */
|
|
243
|
+
exports.URL_BAD_FORMAT = 1;
|
|
244
|
+
/** The URL constructor rejected the input. */
|
|
245
|
+
exports.URL_UNPARSEABLE = 2;
|
|
246
|
+
/** Parses a URL for `$ZodURL`, applying the one guard the URL constructor cannot express. Returns the parsed URL, or a code naming the stage that rejected it — the runtime needs that distinction to pick an issue note, and compiled code only needs to know it is not a URL. */
|
|
247
|
+
function parseURLObject(trimmed, def) {
|
|
248
|
+
// When normalize is off, require :// for http/https URLs. This prevents strings like "http:example.com" or "https:/path" from being silently accepted
|
|
249
|
+
if (!def.normalize && def.protocol?.source === regexes.httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
|
|
250
|
+
return exports.URL_BAD_FORMAT;
|
|
251
|
+
}
|
|
252
|
+
try {
|
|
253
|
+
// @ts-ignore
|
|
254
|
+
return new URL(trimmed);
|
|
255
|
+
}
|
|
256
|
+
catch {
|
|
257
|
+
return exports.URL_UNPARSEABLE;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
const asciiTabOrNewline = /[\t\n\r]/g;
|
|
261
|
+
/** The URL parser deletes every ASCII tab, LF and CR from its input before it parses, so `new URL("https://exa\nmple.com")` reports on `example.com`. Applying the same deletion to the returned value closes the half of that divergence which can move the host; the parser's other rewrite, stripping C0 controls at the edges, cannot. */
|
|
262
|
+
function stripTabAndNewline(value) {
|
|
263
|
+
return value.replace(asciiTabOrNewline, "");
|
|
264
|
+
}
|
|
265
|
+
function urlHostnameOk(url, hostname) {
|
|
266
|
+
hostname.lastIndex = 0;
|
|
267
|
+
return hostname.test(url.hostname);
|
|
268
|
+
}
|
|
269
|
+
function urlProtocolOk(url, protocol) {
|
|
270
|
+
protocol.lastIndex = 0;
|
|
271
|
+
return protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol);
|
|
272
|
+
}
|
|
273
|
+
exports.$ZodURL = core.$constructor("$ZodURL", (inst, def) => {
|
|
274
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
275
|
+
inst._zod.check = (payload) => {
|
|
276
|
+
try {
|
|
277
|
+
// Trim whitespace from input
|
|
278
|
+
const trimmed = payload.value.trim();
|
|
279
|
+
const url = parseURLObject(trimmed, def);
|
|
280
|
+
if (url === exports.URL_BAD_FORMAT) {
|
|
281
|
+
payload.issues.push({
|
|
282
|
+
code: "invalid_format",
|
|
283
|
+
format: "url",
|
|
284
|
+
note: "Invalid URL format",
|
|
285
|
+
input: payload.value,
|
|
286
|
+
inst,
|
|
287
|
+
continue: !def.abort,
|
|
288
|
+
});
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
if (url === exports.URL_UNPARSEABLE) {
|
|
292
|
+
payload.issues.push({
|
|
293
|
+
code: "invalid_format",
|
|
294
|
+
format: "url",
|
|
295
|
+
input: payload.value,
|
|
296
|
+
inst,
|
|
297
|
+
continue: !def.abort,
|
|
298
|
+
});
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
if (def.hostname && !urlHostnameOk(url, def.hostname)) {
|
|
302
|
+
payload.issues.push({
|
|
303
|
+
code: "invalid_format",
|
|
304
|
+
format: "url",
|
|
305
|
+
note: "Invalid hostname",
|
|
306
|
+
pattern: def.hostname.source,
|
|
307
|
+
input: payload.value,
|
|
308
|
+
inst,
|
|
309
|
+
continue: !def.abort,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
if (def.protocol && !urlProtocolOk(url, def.protocol)) {
|
|
313
|
+
payload.issues.push({
|
|
314
|
+
code: "invalid_format",
|
|
315
|
+
format: "url",
|
|
316
|
+
note: "Invalid protocol",
|
|
317
|
+
pattern: def.protocol.source,
|
|
318
|
+
input: payload.value,
|
|
319
|
+
inst,
|
|
320
|
+
continue: !def.abort,
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
// Set the output value based on normalize flag
|
|
324
|
+
payload.value = def.normalize ? url.href : stripTabAndNewline(trimmed);
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
catch (_) {
|
|
328
|
+
payload.issues.push({
|
|
329
|
+
code: "invalid_format",
|
|
330
|
+
format: "url",
|
|
331
|
+
input: payload.value,
|
|
332
|
+
inst,
|
|
333
|
+
continue: !def.abort,
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
});
|
|
338
|
+
exports.$ZodEmoji = core.$constructor("$ZodEmoji", (inst, def) => {
|
|
339
|
+
def.pattern ?? (def.pattern = regexes.emoji());
|
|
340
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
341
|
+
});
|
|
342
|
+
exports.$ZodNanoID = core.$constructor("$ZodNanoID", (inst, def) => {
|
|
343
|
+
if (def.length !== undefined && (!Number.isInteger(def.length) || def.length < 1))
|
|
344
|
+
throw new Error(`Invalid nanoid length: ${def.length}`);
|
|
345
|
+
def.pattern ?? (def.pattern = def.length === undefined ? regexes.nanoid : regexes.nanoidOfLength(def.length));
|
|
346
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
347
|
+
});
|
|
348
|
+
/**
|
|
349
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
350
|
+
* (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
|
|
351
|
+
* See https://github.com/paralleldrive/cuid.
|
|
352
|
+
*/
|
|
353
|
+
exports.$ZodCUID = core.$constructor("$ZodCUID", (inst, def) => {
|
|
354
|
+
def.pattern ?? (def.pattern = regexes.cuid);
|
|
355
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
356
|
+
});
|
|
357
|
+
exports.$ZodCUID2 = core.$constructor("$ZodCUID2", (inst, def) => {
|
|
358
|
+
def.pattern ?? (def.pattern = regexes.cuid2);
|
|
359
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
360
|
+
});
|
|
361
|
+
exports.$ZodULID = core.$constructor("$ZodULID", (inst, def) => {
|
|
362
|
+
def.pattern ?? (def.pattern = regexes.ulid);
|
|
363
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
364
|
+
});
|
|
365
|
+
exports.$ZodXID = core.$constructor("$ZodXID", (inst, def) => {
|
|
366
|
+
def.pattern ?? (def.pattern = regexes.xid);
|
|
367
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
368
|
+
});
|
|
369
|
+
exports.$ZodKSUID = core.$constructor("$ZodKSUID", (inst, def) => {
|
|
370
|
+
def.pattern ?? (def.pattern = regexes.ksuid);
|
|
371
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
372
|
+
});
|
|
373
|
+
exports.$ZodISODateTime = core.$constructor("$ZodISODateTime", (inst, def) => {
|
|
374
|
+
def.pattern ?? (def.pattern = regexes.datetime(def));
|
|
375
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
376
|
+
// these two drop the offset or seconds `date-time` requires — on the bag not the def, since `z.string().check(...)` lands the format on a different schema
|
|
377
|
+
if (def.local || def.precision === -1) {
|
|
378
|
+
inst._zod.bag.laxFormat = true;
|
|
379
|
+
inst._zod.onattach.push((s) => {
|
|
380
|
+
s._zod.bag.laxFormat = true;
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
exports.$ZodISODate = core.$constructor("$ZodISODate", (inst, def) => {
|
|
385
|
+
def.pattern ?? (def.pattern = regexes.date);
|
|
386
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
387
|
+
});
|
|
388
|
+
exports.$ZodISOTime = core.$constructor("$ZodISOTime", (inst, def) => {
|
|
389
|
+
def.pattern ?? (def.pattern = regexes.time(def));
|
|
390
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
391
|
+
});
|
|
392
|
+
exports.$ZodISODuration = core.$constructor("$ZodISODuration", (inst, def) => {
|
|
393
|
+
def.pattern ?? (def.pattern = regexes.duration);
|
|
394
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
395
|
+
});
|
|
396
|
+
exports.$ZodIPv4 = core.$constructor("$ZodIPv4", (inst, def) => {
|
|
397
|
+
def.pattern ?? (def.pattern = regexes.ipv4);
|
|
398
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
399
|
+
inst._zod.bag.format = `ipv4`;
|
|
400
|
+
});
|
|
401
|
+
/** An IPv6 address is written with hex digits, colons and dots, and nothing else. The guard is what makes the check below an IPv6 check: `new URL("http://[...]")` parses an authority, not an address, so `@` and `\` re-delimit it and `"::@1\\"` validates against the host `0.0.0.1`. The URL parser also deletes ASCII tab, LF and CR rather than failing, which is how `"::1\n"` validated as `::1`. */
|
|
402
|
+
const ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
|
|
403
|
+
function isValidIPv6(value) {
|
|
404
|
+
if (!ipv6Alphabet.test(value))
|
|
405
|
+
return false;
|
|
406
|
+
try {
|
|
407
|
+
// @ts-ignore
|
|
408
|
+
new URL(`http://[${value}]`);
|
|
409
|
+
return true;
|
|
410
|
+
}
|
|
411
|
+
catch {
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
exports.$ZodIPv6 = core.$constructor("$ZodIPv6", (inst, def) => {
|
|
416
|
+
def.pattern ?? (def.pattern = regexes.ipv6);
|
|
417
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
418
|
+
inst._zod.bag.format = `ipv6`;
|
|
419
|
+
inst._zod.check = (payload) => {
|
|
420
|
+
if (!isValidIPv6(payload.value)) {
|
|
421
|
+
payload.issues.push({
|
|
422
|
+
code: "invalid_format",
|
|
423
|
+
format: "ipv6",
|
|
424
|
+
input: payload.value,
|
|
425
|
+
inst,
|
|
426
|
+
continue: !def.abort,
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
});
|
|
431
|
+
exports.$ZodMAC = core.$constructor("$ZodMAC", (inst, def) => {
|
|
432
|
+
def.pattern ?? (def.pattern = regexes.mac(def.delimiter));
|
|
433
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
434
|
+
inst._zod.bag.format = `mac`;
|
|
435
|
+
});
|
|
436
|
+
exports.$ZodCIDRv4 = core.$constructor("$ZodCIDRv4", (inst, def) => {
|
|
437
|
+
def.pattern ?? (def.pattern = regexes.cidrv4);
|
|
438
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
439
|
+
});
|
|
440
|
+
function isValidCIDRv6(value) {
|
|
441
|
+
const parts = value.split("/");
|
|
442
|
+
if (parts.length !== 2)
|
|
443
|
+
return false;
|
|
444
|
+
const [address, prefix] = parts;
|
|
445
|
+
if (!prefix)
|
|
446
|
+
return false;
|
|
447
|
+
const prefixNum = Number(prefix);
|
|
448
|
+
if (`${prefixNum}` !== prefix)
|
|
449
|
+
return false;
|
|
450
|
+
if (prefixNum < 0 || prefixNum > 128)
|
|
451
|
+
return false;
|
|
452
|
+
return isValidIPv6(address);
|
|
453
|
+
}
|
|
454
|
+
exports.$ZodCIDRv6 = core.$constructor("$ZodCIDRv6", (inst, def) => {
|
|
455
|
+
def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation
|
|
456
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
457
|
+
inst._zod.check = (payload) => {
|
|
458
|
+
if (!isValidCIDRv6(payload.value)) {
|
|
459
|
+
payload.issues.push({
|
|
460
|
+
code: "invalid_format",
|
|
461
|
+
format: "cidrv6",
|
|
462
|
+
input: payload.value,
|
|
463
|
+
inst,
|
|
464
|
+
continue: !def.abort,
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
});
|
|
469
|
+
////////////////////////////// ZodBase64 //////////////////////////////
|
|
470
|
+
function isValidBase64(data) {
|
|
471
|
+
if (data === "")
|
|
472
|
+
return true;
|
|
473
|
+
// atob ignores whitespace, so reject it up front.
|
|
474
|
+
if (/\s/.test(data))
|
|
475
|
+
return false;
|
|
476
|
+
if (data.length % 4 !== 0)
|
|
477
|
+
return false;
|
|
478
|
+
try {
|
|
479
|
+
// @ts-ignore
|
|
480
|
+
atob(data);
|
|
481
|
+
return true;
|
|
482
|
+
}
|
|
483
|
+
catch {
|
|
484
|
+
return false;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
exports.$ZodBase64 = core.$constructor("$ZodBase64", (inst, def) => {
|
|
488
|
+
def.pattern ?? (def.pattern = regexes.base64);
|
|
489
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
490
|
+
inst._zod.bag.contentEncoding = "base64";
|
|
491
|
+
inst._zod.check = (payload) => {
|
|
492
|
+
if (isValidBase64(payload.value))
|
|
493
|
+
return;
|
|
494
|
+
payload.issues.push({
|
|
495
|
+
code: "invalid_format",
|
|
496
|
+
format: "base64",
|
|
497
|
+
input: payload.value,
|
|
498
|
+
inst,
|
|
499
|
+
continue: !def.abort,
|
|
500
|
+
});
|
|
501
|
+
};
|
|
502
|
+
});
|
|
503
|
+
////////////////////////////// ZodBase64 //////////////////////////////
|
|
504
|
+
function isValidBase64URL(data) {
|
|
505
|
+
if (!regexes.base64url.test(data))
|
|
506
|
+
return false;
|
|
507
|
+
const base64 = data.replace(/[-_]/g, (c) => (c === "-" ? "+" : "/"));
|
|
508
|
+
const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
|
|
509
|
+
return isValidBase64(padded);
|
|
510
|
+
}
|
|
511
|
+
exports.$ZodBase64URL = core.$constructor("$ZodBase64URL", (inst, def) => {
|
|
512
|
+
def.pattern ?? (def.pattern = regexes.base64url);
|
|
513
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
514
|
+
inst._zod.bag.contentEncoding = "base64url";
|
|
515
|
+
inst._zod.check = (payload) => {
|
|
516
|
+
if (isValidBase64URL(payload.value))
|
|
517
|
+
return;
|
|
518
|
+
payload.issues.push({
|
|
519
|
+
code: "invalid_format",
|
|
520
|
+
format: "base64url",
|
|
521
|
+
input: payload.value,
|
|
522
|
+
inst,
|
|
523
|
+
continue: !def.abort,
|
|
524
|
+
});
|
|
525
|
+
};
|
|
526
|
+
});
|
|
527
|
+
exports.$ZodE164 = core.$constructor("$ZodE164", (inst, def) => {
|
|
528
|
+
def.pattern ?? (def.pattern = regexes.e164);
|
|
529
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
530
|
+
});
|
|
531
|
+
////////////////////////////// ZodCreditCard //////////////////////////////
|
|
532
|
+
const CC_SANITIZE = /[- ]/g;
|
|
533
|
+
/** Luhn checksum on a digit-only string. Adapted from valibot (MIT). */
|
|
534
|
+
function isLuhnAlgo(digits) {
|
|
535
|
+
let length = digits.length;
|
|
536
|
+
let bit = 1;
|
|
537
|
+
let sum = 0;
|
|
538
|
+
while (length) {
|
|
539
|
+
const value = +digits[--length];
|
|
540
|
+
bit ^= 1;
|
|
541
|
+
sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;
|
|
542
|
+
}
|
|
543
|
+
return sum % 10 === 0;
|
|
544
|
+
}
|
|
545
|
+
function isValidCreditCard(input) {
|
|
546
|
+
if (!regexes.creditCard.test(input))
|
|
547
|
+
return false;
|
|
548
|
+
return isLuhnAlgo(input.replace(CC_SANITIZE, ""));
|
|
549
|
+
}
|
|
550
|
+
exports.$ZodCreditCard = core.$constructor("$ZodCreditCard", (inst, def) => {
|
|
551
|
+
// Shape only — the Luhn check below is not expressible as a pattern, so consumers of `pattern` (JSON Schema, template literals) get the length and separator rules alone.
|
|
552
|
+
def.pattern ?? (def.pattern = regexes.creditCard);
|
|
553
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
554
|
+
inst._zod.check = (payload) => {
|
|
555
|
+
if (isValidCreditCard(payload.value))
|
|
556
|
+
return;
|
|
557
|
+
payload.issues.push({
|
|
558
|
+
code: "invalid_format",
|
|
559
|
+
format: "credit_card",
|
|
560
|
+
input: payload.value,
|
|
561
|
+
inst,
|
|
562
|
+
continue: !def.abort,
|
|
563
|
+
});
|
|
564
|
+
};
|
|
565
|
+
});
|
|
566
|
+
////////////////////////////// ZodJWT //////////////////////////////
|
|
567
|
+
function isValidJWT(token, algorithm = null) {
|
|
568
|
+
try {
|
|
569
|
+
const tokensParts = token.split(".");
|
|
570
|
+
if (tokensParts.length !== 3)
|
|
571
|
+
return false;
|
|
572
|
+
const [header] = tokensParts;
|
|
573
|
+
if (!header)
|
|
574
|
+
return false;
|
|
575
|
+
// @ts-ignore
|
|
576
|
+
const parsedHeader = JSON.parse(atob(header));
|
|
577
|
+
if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT")
|
|
578
|
+
return false;
|
|
579
|
+
if (!parsedHeader.alg)
|
|
580
|
+
return false;
|
|
581
|
+
if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm))
|
|
582
|
+
return false;
|
|
583
|
+
return true;
|
|
584
|
+
}
|
|
585
|
+
catch {
|
|
586
|
+
return false;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
exports.$ZodJWT = core.$constructor("$ZodJWT", (inst, def) => {
|
|
590
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
591
|
+
inst._zod.check = (payload) => {
|
|
592
|
+
if (isValidJWT(payload.value, def.alg))
|
|
593
|
+
return;
|
|
594
|
+
payload.issues.push({
|
|
595
|
+
code: "invalid_format",
|
|
596
|
+
format: "jwt",
|
|
597
|
+
input: payload.value,
|
|
598
|
+
inst,
|
|
599
|
+
continue: !def.abort,
|
|
600
|
+
});
|
|
601
|
+
};
|
|
602
|
+
});
|
|
603
|
+
exports.$ZodCustomStringFormat = core.$constructor("$ZodCustomStringFormat", (inst, def) => {
|
|
604
|
+
exports.$ZodStringFormat.init(inst, def);
|
|
605
|
+
inst._zod.check = (payload) => {
|
|
606
|
+
if (def.fn(payload.value))
|
|
607
|
+
return;
|
|
608
|
+
payload.issues.push({
|
|
609
|
+
code: "invalid_format",
|
|
610
|
+
format: def.format,
|
|
611
|
+
input: payload.value,
|
|
612
|
+
inst,
|
|
613
|
+
continue: !def.abort,
|
|
614
|
+
});
|
|
615
|
+
};
|
|
616
|
+
});
|
|
617
|
+
exports.$ZodNumber = core.$constructor("$ZodNumber", (inst, def) => {
|
|
618
|
+
exports.$ZodType.init(inst, def);
|
|
619
|
+
inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;
|
|
620
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
621
|
+
if (def.coerce)
|
|
622
|
+
try {
|
|
623
|
+
payload.value = Number(payload.value);
|
|
624
|
+
}
|
|
625
|
+
catch (_) { }
|
|
626
|
+
const input = payload.value;
|
|
627
|
+
if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
|
|
628
|
+
return payload;
|
|
629
|
+
}
|
|
630
|
+
const received = typeof input === "number"
|
|
631
|
+
? Number.isNaN(input)
|
|
632
|
+
? "NaN"
|
|
633
|
+
: !Number.isFinite(input)
|
|
634
|
+
? String(input)
|
|
635
|
+
: undefined
|
|
636
|
+
: undefined;
|
|
637
|
+
payload.issues.push({
|
|
638
|
+
expected: "number",
|
|
639
|
+
code: "invalid_type",
|
|
640
|
+
input,
|
|
641
|
+
inst,
|
|
642
|
+
...(received ? { received } : {}),
|
|
643
|
+
});
|
|
644
|
+
return payload;
|
|
645
|
+
};
|
|
646
|
+
});
|
|
647
|
+
exports.$ZodNumberFormat = core.$constructor("$ZodNumberFormat", (inst, def) => {
|
|
648
|
+
checks.$ZodCheckNumberFormat.init(inst, def);
|
|
649
|
+
exports.$ZodNumber.init(inst, def); // no format checks
|
|
650
|
+
});
|
|
651
|
+
exports.$ZodBoolean = core.$constructor("$ZodBoolean", (inst, def) => {
|
|
652
|
+
exports.$ZodType.init(inst, def);
|
|
653
|
+
inst._zod.pattern = regexes.boolean;
|
|
654
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
655
|
+
if (def.coerce)
|
|
656
|
+
try {
|
|
657
|
+
payload.value = Boolean(payload.value);
|
|
658
|
+
}
|
|
659
|
+
catch (_) { }
|
|
660
|
+
const input = payload.value;
|
|
661
|
+
if (typeof input === "boolean")
|
|
662
|
+
return payload;
|
|
663
|
+
payload.issues.push({
|
|
664
|
+
expected: "boolean",
|
|
665
|
+
code: "invalid_type",
|
|
666
|
+
input,
|
|
667
|
+
inst,
|
|
668
|
+
});
|
|
669
|
+
return payload;
|
|
670
|
+
};
|
|
671
|
+
});
|
|
672
|
+
exports.$ZodBigInt = core.$constructor("$ZodBigInt", (inst, def) => {
|
|
673
|
+
exports.$ZodType.init(inst, def);
|
|
674
|
+
inst._zod.pattern = regexes.bigint;
|
|
675
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
676
|
+
if (def.coerce)
|
|
677
|
+
try {
|
|
678
|
+
payload.value = BigInt(payload.value);
|
|
679
|
+
}
|
|
680
|
+
catch (_) { }
|
|
681
|
+
if (typeof payload.value === "bigint")
|
|
682
|
+
return payload;
|
|
683
|
+
payload.issues.push({
|
|
684
|
+
expected: "bigint",
|
|
685
|
+
code: "invalid_type",
|
|
686
|
+
input: payload.value,
|
|
687
|
+
inst,
|
|
688
|
+
});
|
|
689
|
+
return payload;
|
|
690
|
+
};
|
|
691
|
+
});
|
|
692
|
+
exports.$ZodBigIntFormat = core.$constructor("$ZodBigIntFormat", (inst, def) => {
|
|
693
|
+
checks.$ZodCheckBigIntFormat.init(inst, def);
|
|
694
|
+
exports.$ZodBigInt.init(inst, def); // no format checks
|
|
695
|
+
});
|
|
696
|
+
exports.$ZodSymbol = core.$constructor("$ZodSymbol", (inst, def) => {
|
|
697
|
+
exports.$ZodType.init(inst, def);
|
|
698
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
699
|
+
const input = payload.value;
|
|
700
|
+
if (typeof input === "symbol")
|
|
701
|
+
return payload;
|
|
702
|
+
payload.issues.push({
|
|
703
|
+
expected: "symbol",
|
|
704
|
+
code: "invalid_type",
|
|
705
|
+
input,
|
|
706
|
+
inst,
|
|
707
|
+
});
|
|
708
|
+
return payload;
|
|
709
|
+
};
|
|
710
|
+
});
|
|
711
|
+
exports.$ZodUndefined = core.$constructor("$ZodUndefined", (inst, def) => {
|
|
712
|
+
exports.$ZodType.init(inst, def);
|
|
713
|
+
inst._zod.pattern = regexes.undefined;
|
|
714
|
+
inst._zod.values = new Set([undefined]);
|
|
715
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
716
|
+
const input = payload.value;
|
|
717
|
+
if (typeof input === "undefined")
|
|
718
|
+
return payload;
|
|
719
|
+
payload.issues.push({
|
|
720
|
+
expected: "undefined",
|
|
721
|
+
code: "invalid_type",
|
|
722
|
+
input,
|
|
723
|
+
inst,
|
|
724
|
+
});
|
|
725
|
+
return payload;
|
|
726
|
+
};
|
|
727
|
+
});
|
|
728
|
+
exports.$ZodNull = core.$constructor("$ZodNull", (inst, def) => {
|
|
729
|
+
exports.$ZodType.init(inst, def);
|
|
730
|
+
inst._zod.pattern = regexes.null;
|
|
731
|
+
inst._zod.values = new Set([null]);
|
|
732
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
733
|
+
const input = payload.value;
|
|
734
|
+
if (input === null)
|
|
735
|
+
return payload;
|
|
736
|
+
payload.issues.push({
|
|
737
|
+
expected: "null",
|
|
738
|
+
code: "invalid_type",
|
|
739
|
+
input,
|
|
740
|
+
inst,
|
|
741
|
+
});
|
|
742
|
+
return payload;
|
|
743
|
+
};
|
|
744
|
+
});
|
|
745
|
+
exports.$ZodAny = core.$constructor("$ZodAny", (inst, def) => {
|
|
746
|
+
exports.$ZodType.init(inst, def);
|
|
747
|
+
inst._zod.parse = (payload) => payload;
|
|
748
|
+
});
|
|
749
|
+
exports.$ZodUnknown = core.$constructor("$ZodUnknown", (inst, def) => {
|
|
750
|
+
exports.$ZodType.init(inst, def);
|
|
751
|
+
inst._zod.parse = (payload) => payload;
|
|
752
|
+
});
|
|
753
|
+
exports.$ZodNever = core.$constructor("$ZodNever", (inst, def) => {
|
|
754
|
+
exports.$ZodType.init(inst, def);
|
|
755
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
756
|
+
payload.issues.push({
|
|
757
|
+
expected: "never",
|
|
758
|
+
code: "invalid_type",
|
|
759
|
+
input: payload.value,
|
|
760
|
+
inst,
|
|
761
|
+
});
|
|
762
|
+
return payload;
|
|
763
|
+
};
|
|
764
|
+
});
|
|
765
|
+
exports.$ZodVoid = core.$constructor("$ZodVoid", (inst, def) => {
|
|
766
|
+
exports.$ZodType.init(inst, def);
|
|
767
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
768
|
+
const input = payload.value;
|
|
769
|
+
if (typeof input === "undefined")
|
|
770
|
+
return payload;
|
|
771
|
+
payload.issues.push({
|
|
772
|
+
expected: "void",
|
|
773
|
+
code: "invalid_type",
|
|
774
|
+
input,
|
|
775
|
+
inst,
|
|
776
|
+
});
|
|
777
|
+
return payload;
|
|
778
|
+
};
|
|
779
|
+
});
|
|
780
|
+
exports.$ZodDate = core.$constructor("$ZodDate", (inst, def) => {
|
|
781
|
+
exports.$ZodType.init(inst, def);
|
|
782
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
783
|
+
if (def.coerce) {
|
|
784
|
+
try {
|
|
785
|
+
payload.value = new Date(payload.value);
|
|
786
|
+
}
|
|
787
|
+
catch (_err) { }
|
|
788
|
+
}
|
|
789
|
+
const input = payload.value;
|
|
790
|
+
const isDate = input instanceof Date;
|
|
791
|
+
const isValidDate = isDate && !Number.isNaN(input.getTime());
|
|
792
|
+
if (isValidDate)
|
|
793
|
+
return payload;
|
|
794
|
+
payload.issues.push({
|
|
795
|
+
expected: "date",
|
|
796
|
+
code: "invalid_type",
|
|
797
|
+
input,
|
|
798
|
+
...(isDate ? { received: "Invalid Date" } : {}),
|
|
799
|
+
inst,
|
|
800
|
+
});
|
|
801
|
+
return payload;
|
|
802
|
+
};
|
|
803
|
+
});
|
|
804
|
+
function handleArrayResult(result, final, index) {
|
|
805
|
+
if (result.issues.length) {
|
|
806
|
+
final.issues.push(...util.prefixIssues(index, result.issues));
|
|
807
|
+
}
|
|
808
|
+
final.value[index] = result.value;
|
|
809
|
+
}
|
|
810
|
+
exports.$ZodArray = core.$constructor("$ZodArray", (inst, def) => {
|
|
811
|
+
exports.$ZodType.init(inst, def);
|
|
812
|
+
const memo = core.globalConfig.memoizer;
|
|
813
|
+
memo?.attach(inst);
|
|
814
|
+
inst._zod.parse = (payload, ctx) => {
|
|
815
|
+
const input = payload.value;
|
|
816
|
+
if (!Array.isArray(input)) {
|
|
817
|
+
payload.issues.push({
|
|
818
|
+
expected: "array",
|
|
819
|
+
code: "invalid_type",
|
|
820
|
+
input,
|
|
821
|
+
inst,
|
|
822
|
+
});
|
|
823
|
+
return payload;
|
|
824
|
+
}
|
|
825
|
+
payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
|
|
826
|
+
const proms = [];
|
|
827
|
+
for (let i = 0; i < input.length; i++) {
|
|
828
|
+
const item = input[i];
|
|
829
|
+
const result = def.element._zod.run({
|
|
830
|
+
value: item,
|
|
831
|
+
issues: [],
|
|
832
|
+
}, ctx);
|
|
833
|
+
if (result instanceof Promise) {
|
|
834
|
+
proms.push(result.then((result) => handleArrayResult(result, payload, i)));
|
|
835
|
+
}
|
|
836
|
+
else {
|
|
837
|
+
handleArrayResult(result, payload, i);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
if (proms.length) {
|
|
841
|
+
return Promise.all(proms).then(() => payload);
|
|
842
|
+
}
|
|
843
|
+
return payload; //handleArrayResultsAsync(parseResults, final);
|
|
844
|
+
};
|
|
845
|
+
});
|
|
846
|
+
function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
847
|
+
const isPresent = key in input;
|
|
848
|
+
const isOptionalOut = optout === "optional";
|
|
849
|
+
// The middle rung means "absence permitted, nothing supplied in its place", so an absent key contributes nothing — whatever the schema made of `undefined` is invented, not substituted. Only `optional` reaches this with a value: `defaulted` substitutes, and a schema that isn't optional-out has to keep the key.
|
|
850
|
+
if (!isPresent && isOptionalOut && optin === "optional") {
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
if (result.issues.length) {
|
|
854
|
+
// For optional-in/out schemas, ignore errors on absent keys.
|
|
855
|
+
if (optin !== undefined && isOptionalOut && !isPresent) {
|
|
856
|
+
return;
|
|
857
|
+
}
|
|
858
|
+
final.issues.push(...util.prefixIssues(key, result.issues));
|
|
859
|
+
}
|
|
860
|
+
if (!isPresent && optin === undefined) {
|
|
861
|
+
if (!result.issues.length) {
|
|
862
|
+
final.issues.push({
|
|
863
|
+
code: "invalid_type",
|
|
864
|
+
expected: "nonoptional",
|
|
865
|
+
input: undefined,
|
|
866
|
+
path: [key],
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
return;
|
|
870
|
+
}
|
|
871
|
+
if (result.value === undefined) {
|
|
872
|
+
if (isPresent) {
|
|
873
|
+
final.value[key] = undefined;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
else {
|
|
877
|
+
final.value[key] = result.value;
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
// one shared instance; a fresh [] per schema cost 56 bytes retained
|
|
881
|
+
const NO_SYMBOL_KEYS = [];
|
|
882
|
+
function normalizeDef(def) {
|
|
883
|
+
const keys = Object.keys(def.shape);
|
|
884
|
+
const ownSymbols = Object.getOwnPropertySymbols(def.shape);
|
|
885
|
+
const symbolKeys = ownSymbols.length ? ownSymbols : NO_SYMBOL_KEYS;
|
|
886
|
+
// aliases `keys` when there are no symbols, so a string-only shape keeps one array
|
|
887
|
+
const allKeys = symbolKeys.length ? [...keys, ...symbolKeys] : keys;
|
|
888
|
+
for (const k of allKeys) {
|
|
889
|
+
if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
|
|
890
|
+
throw new Error(`Invalid element at key "${String(k)}": expected a Zod schema`);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
const okeys = util.optionalKeys(def.shape);
|
|
894
|
+
return {
|
|
895
|
+
...def,
|
|
896
|
+
allKeys,
|
|
897
|
+
symbolKeys,
|
|
898
|
+
// string-only: handleCatchall matches it against `for...in`, which never yields a symbol
|
|
899
|
+
keySet: new Set(keys),
|
|
900
|
+
numKeys: keys.length,
|
|
901
|
+
optionalKeys: new Set(okeys),
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
905
|
+
const unrecognized = [];
|
|
906
|
+
const keySet = def.keySet;
|
|
907
|
+
const _catchall = def.catchall._zod;
|
|
908
|
+
const t = _catchall.def.type;
|
|
909
|
+
const optin = _catchall.optin;
|
|
910
|
+
const optout = _catchall.optout;
|
|
911
|
+
for (const key in input) {
|
|
912
|
+
// Must precede the __proto__ branch: a declared key is not unrecognized, even though the shape loop deliberately strips __proto__ from the parsed output.
|
|
913
|
+
if (keySet.has(key))
|
|
914
|
+
continue;
|
|
915
|
+
// Don't copy an undeclared __proto__ into the result; assignment to a plain {} would replace the result prototype. But in strict mode it is still an unknown key, so report it before skipping.
|
|
916
|
+
if (key === "__proto__") {
|
|
917
|
+
if (t === "never")
|
|
918
|
+
unrecognized.push(key);
|
|
919
|
+
continue;
|
|
920
|
+
}
|
|
921
|
+
if (t === "never") {
|
|
922
|
+
unrecognized.push(key);
|
|
923
|
+
continue;
|
|
924
|
+
}
|
|
925
|
+
const r = _catchall.run({ value: input[key], issues: [] }, ctx);
|
|
926
|
+
if (r instanceof Promise) {
|
|
927
|
+
proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
|
|
928
|
+
}
|
|
929
|
+
else {
|
|
930
|
+
handlePropertyResult(r, payload, key, input, optin, optout);
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
if (unrecognized.length) {
|
|
934
|
+
payload.issues.push({
|
|
935
|
+
code: "unrecognized_keys",
|
|
936
|
+
keys: unrecognized,
|
|
937
|
+
input,
|
|
938
|
+
inst,
|
|
939
|
+
// Describes the shape of the input, not the validity of the parsed value, so it never aborts. The parse still fails; the schema's own checks just get to run first, and an enclosing intersection can reconcile the key against a sibling operand.
|
|
940
|
+
continue: true,
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
if (!proms.length)
|
|
944
|
+
return payload;
|
|
945
|
+
return Promise.all(proms).then(() => {
|
|
946
|
+
return payload;
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
// Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it. Keyed by def, so a def rebuilt by a builder is simply absent rather than inheriting the source's. Read its keys with `Object.keys`, which does not invoke them — that is what lets a discriminated union check its discriminator without resolving an option whose getters reference the union being constructed.
|
|
950
|
+
const propShapes = new WeakMap();
|
|
951
|
+
exports.$ZodObject = core.$constructor("$ZodObject", (inst, def) => {
|
|
952
|
+
// requires cast because technically $ZodObject doesn't extend
|
|
953
|
+
exports.$ZodType.init(inst, def);
|
|
954
|
+
// const sh = def.shape;
|
|
955
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
956
|
+
if (!desc?.get) {
|
|
957
|
+
const sh = def.shape;
|
|
958
|
+
propShapes.set(def, sh);
|
|
959
|
+
Object.defineProperty(def, "shape", {
|
|
960
|
+
get: () => {
|
|
961
|
+
const newSh = { ...sh };
|
|
962
|
+
Object.defineProperty(def, "shape", {
|
|
963
|
+
value: newSh,
|
|
964
|
+
});
|
|
965
|
+
propShapes.set(def, newSh);
|
|
966
|
+
return newSh;
|
|
967
|
+
},
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
const _normalized = util.cached(() => normalizeDef(def));
|
|
971
|
+
util.defineLazyInternal(inst, "propValues", (zod) => {
|
|
972
|
+
const shape = zod.def.shape;
|
|
973
|
+
const propValues = {};
|
|
974
|
+
for (const key in shape) {
|
|
975
|
+
const field = shape[key]._zod;
|
|
976
|
+
if (field.values) {
|
|
977
|
+
if (!Object.prototype.hasOwnProperty.call(propValues, key)) {
|
|
978
|
+
util.assignProp(propValues, key, new Set());
|
|
979
|
+
}
|
|
980
|
+
for (const v of field.values)
|
|
981
|
+
propValues[key].add(v);
|
|
982
|
+
// An omittable slot reads back as undefined at a discriminator lookup, so it has to claim undefined: two options that can both omit the key are not discriminable on it.
|
|
983
|
+
if (field.optin !== undefined)
|
|
984
|
+
propValues[key].add(undefined);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
return propValues;
|
|
988
|
+
});
|
|
989
|
+
const isObject = util.isObject;
|
|
990
|
+
const catchall = def.catchall;
|
|
991
|
+
let value;
|
|
992
|
+
const memo = core.globalConfig.memoizer;
|
|
993
|
+
memo?.attach(inst);
|
|
994
|
+
inst._zod.parse = (payload, ctx) => {
|
|
995
|
+
value ?? (value = _normalized.value);
|
|
996
|
+
const input = payload.value;
|
|
997
|
+
if (!isObject(input)) {
|
|
998
|
+
payload.issues.push({
|
|
999
|
+
expected: "object",
|
|
1000
|
+
code: "invalid_type",
|
|
1001
|
+
input,
|
|
1002
|
+
inst,
|
|
1003
|
+
});
|
|
1004
|
+
return payload;
|
|
1005
|
+
}
|
|
1006
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
1007
|
+
const proms = [];
|
|
1008
|
+
const shape = value.shape;
|
|
1009
|
+
for (const key of value.allKeys) {
|
|
1010
|
+
if (key === "__proto__")
|
|
1011
|
+
continue;
|
|
1012
|
+
const el = shape[key];
|
|
1013
|
+
const optin = el._zod.optin;
|
|
1014
|
+
const optout = el._zod.optout;
|
|
1015
|
+
const r = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1016
|
+
if (r instanceof Promise) {
|
|
1017
|
+
proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
|
|
1018
|
+
}
|
|
1019
|
+
else {
|
|
1020
|
+
handlePropertyResult(r, payload, key, input, optin, optout);
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
if (!catchall) {
|
|
1024
|
+
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
1025
|
+
}
|
|
1026
|
+
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
1027
|
+
};
|
|
1028
|
+
});
|
|
1029
|
+
exports.$ZodObjectJIT = core.$constructor("$ZodObjectJIT", (inst, def) => {
|
|
1030
|
+
// requires cast because technically $ZodObject doesn't extend
|
|
1031
|
+
exports.$ZodObject.init(inst, def);
|
|
1032
|
+
const superParse = inst._zod.parse;
|
|
1033
|
+
const _normalized = util.cached(() => normalizeDef(def));
|
|
1034
|
+
const memo = core.globalConfig.memoizer;
|
|
1035
|
+
const generateFastpass = (shape) => {
|
|
1036
|
+
const normalized = _normalized.value;
|
|
1037
|
+
const syms = normalized.symbolKeys;
|
|
1038
|
+
// a symbol has no source literal, so it is read as `syms[i]` off the closed-over scope
|
|
1039
|
+
const doc = new doc_js_1.Doc(["payload", "ctx"], { shape, inst, memo, syms });
|
|
1040
|
+
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
1041
|
+
// Prefixes in place, like util.prefixIssues does for every interpreted path.
|
|
1042
|
+
const prefixStr = (id, k) => `
|
|
1043
|
+
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
1044
|
+
const iss = ${id}.issues[i];
|
|
1045
|
+
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
1046
|
+
payload.issues.push(iss);
|
|
1047
|
+
}`;
|
|
1048
|
+
doc.write(`const input = payload.value;`);
|
|
1049
|
+
const ids = Object.create(null);
|
|
1050
|
+
let counter = 0;
|
|
1051
|
+
for (const key of normalized.allKeys) {
|
|
1052
|
+
ids[key] = `key_${counter++}`;
|
|
1053
|
+
}
|
|
1054
|
+
// A: preserve key order {
|
|
1055
|
+
doc.write(memo ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);
|
|
1056
|
+
for (const key of normalized.allKeys) {
|
|
1057
|
+
if (key === "__proto__")
|
|
1058
|
+
continue;
|
|
1059
|
+
const id = ids[key];
|
|
1060
|
+
const k = typeof key === "symbol" ? `syms[${syms.indexOf(key)}]` : util.esc(key);
|
|
1061
|
+
const isPresent = `${k} in input`;
|
|
1062
|
+
const schema = shape[key];
|
|
1063
|
+
const optin = schema?._zod?.optin;
|
|
1064
|
+
const isOptionalIn = optin !== undefined;
|
|
1065
|
+
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
1066
|
+
doc.write(`const ${id} = ${parseStr(k)};`);
|
|
1067
|
+
if (isOptionalIn && isOptionalOut) {
|
|
1068
|
+
// For optional-in/out schemas, ignore errors on absent keys — and, like the interpreted path, drop the value produced alongside them. The middle rung goes further: it permits absence without supplying anything in its place, so an absent key contributes nothing at all.
|
|
1069
|
+
const assign = optin === "optional" ? `${id}_present` : `${id}.value !== undefined || ${id}_present`;
|
|
1070
|
+
doc.write(`
|
|
1071
|
+
const ${id}_present = ${isPresent};
|
|
1072
|
+
if (!${id}.issues.length || ${id}_present) {
|
|
1073
|
+
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
if (${assign}) {
|
|
1077
|
+
newResult[${k}] = ${id}.value;
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
`);
|
|
1082
|
+
}
|
|
1083
|
+
else if (!isOptionalIn) {
|
|
1084
|
+
doc.write(`
|
|
1085
|
+
const ${id}_present = ${isPresent};
|
|
1086
|
+
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
1087
|
+
}
|
|
1088
|
+
if (!${id}_present && !${id}.issues.length) {
|
|
1089
|
+
payload.issues.push({
|
|
1090
|
+
code: "invalid_type",
|
|
1091
|
+
expected: "nonoptional",
|
|
1092
|
+
input: undefined,
|
|
1093
|
+
path: [${k}]
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
if (${id}_present) {
|
|
1098
|
+
newResult[${k}] = ${id}.value;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
`);
|
|
1102
|
+
}
|
|
1103
|
+
else {
|
|
1104
|
+
doc.write(`
|
|
1105
|
+
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
if (${id}.value === undefined) {
|
|
1109
|
+
if (${isPresent}) {
|
|
1110
|
+
newResult[${k}] = undefined;
|
|
1111
|
+
}
|
|
1112
|
+
} else {
|
|
1113
|
+
newResult[${k}] = ${id}.value;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
`);
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
doc.write(`payload.value = newResult;`);
|
|
1120
|
+
doc.write(`return payload;`);
|
|
1121
|
+
// closing `shape` in is what pays: turbofan specializes the parser against that one shape object, so every `shape[k]._zod.run` folds to a known callee. as a parameter it stays a generic load and measures 13% slower even with the forwarding frame gone
|
|
1122
|
+
return doc.compile();
|
|
1123
|
+
};
|
|
1124
|
+
let fastpass;
|
|
1125
|
+
const isObject = util.isObject;
|
|
1126
|
+
const jit = !core.globalConfig.jitless;
|
|
1127
|
+
const allowsEval = util.allowsEval;
|
|
1128
|
+
const fastEnabled = jit && allowsEval.value; // && !def.catchall;
|
|
1129
|
+
const catchall = def.catchall;
|
|
1130
|
+
let value;
|
|
1131
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1132
|
+
value ?? (value = _normalized.value);
|
|
1133
|
+
const input = payload.value;
|
|
1134
|
+
if (!isObject(input)) {
|
|
1135
|
+
payload.issues.push({
|
|
1136
|
+
expected: "object",
|
|
1137
|
+
code: "invalid_type",
|
|
1138
|
+
input,
|
|
1139
|
+
inst,
|
|
1140
|
+
});
|
|
1141
|
+
return payload;
|
|
1142
|
+
}
|
|
1143
|
+
if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
|
|
1144
|
+
// always synchronous
|
|
1145
|
+
if (!fastpass)
|
|
1146
|
+
fastpass = generateFastpass(def.shape);
|
|
1147
|
+
payload = fastpass(payload, ctx);
|
|
1148
|
+
if (!catchall)
|
|
1149
|
+
return payload;
|
|
1150
|
+
return handleCatchall([], input, payload, ctx, value, inst);
|
|
1151
|
+
}
|
|
1152
|
+
return superParse(payload, ctx);
|
|
1153
|
+
};
|
|
1154
|
+
});
|
|
1155
|
+
function handleUnionResults(results, final, inst, ctx) {
|
|
1156
|
+
for (const result of results) {
|
|
1157
|
+
if (result.issues.length === 0) {
|
|
1158
|
+
final.value = result.value;
|
|
1159
|
+
return final;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
const nonaborted = results.filter((r) => !util.aborted(r));
|
|
1163
|
+
if (nonaborted.length === 1) {
|
|
1164
|
+
final.value = nonaborted[0].value;
|
|
1165
|
+
return nonaborted[0];
|
|
1166
|
+
}
|
|
1167
|
+
final.issues.push({
|
|
1168
|
+
code: "invalid_union",
|
|
1169
|
+
input: final.value,
|
|
1170
|
+
inst,
|
|
1171
|
+
errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
|
|
1172
|
+
});
|
|
1173
|
+
return final;
|
|
1174
|
+
}
|
|
1175
|
+
exports.$ZodUnion = core.$constructor("$ZodUnion", (inst, def) => {
|
|
1176
|
+
exports.$ZodType.init(inst, def);
|
|
1177
|
+
util.defineLazyInternal(inst, "optin", (zod) => zod.def.options.some((o) => o._zod.optin === "defaulted")
|
|
1178
|
+
? "defaulted"
|
|
1179
|
+
: zod.def.options.some((o) => o._zod.optin !== undefined)
|
|
1180
|
+
? "optional"
|
|
1181
|
+
: undefined);
|
|
1182
|
+
util.defineLazyInternal(inst, "optout", (zod) => zod.def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
|
|
1183
|
+
util.defineLazyInternal(inst, "values", (zod) => {
|
|
1184
|
+
if (zod.def.options.every((o) => o._zod.values)) {
|
|
1185
|
+
return new Set(zod.def.options.flatMap((option) => Array.from(option._zod.values)));
|
|
1186
|
+
}
|
|
1187
|
+
return undefined;
|
|
1188
|
+
});
|
|
1189
|
+
util.defineLazyInternal(inst, "pattern", (zod) => {
|
|
1190
|
+
if (zod.def.options.every((o) => o._zod.pattern)) {
|
|
1191
|
+
const patterns = zod.def.options.map((o) => o._zod.pattern);
|
|
1192
|
+
return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join("|")})$`);
|
|
1193
|
+
}
|
|
1194
|
+
return undefined;
|
|
1195
|
+
});
|
|
1196
|
+
const first = def.options.length === 1 ? def.options[0]._zod.run : null;
|
|
1197
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1198
|
+
if (first) {
|
|
1199
|
+
return first(payload, ctx);
|
|
1200
|
+
}
|
|
1201
|
+
let async = false;
|
|
1202
|
+
const results = [];
|
|
1203
|
+
for (const option of def.options) {
|
|
1204
|
+
const result = option._zod.run({
|
|
1205
|
+
value: payload.value,
|
|
1206
|
+
issues: [],
|
|
1207
|
+
}, ctx);
|
|
1208
|
+
if (result instanceof Promise) {
|
|
1209
|
+
results.push(result);
|
|
1210
|
+
async = true;
|
|
1211
|
+
}
|
|
1212
|
+
else {
|
|
1213
|
+
if (result.issues.length === 0)
|
|
1214
|
+
return result;
|
|
1215
|
+
results.push(result);
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
if (!async)
|
|
1219
|
+
return handleUnionResults(results, payload, inst, ctx);
|
|
1220
|
+
return Promise.all(results).then((results) => {
|
|
1221
|
+
return handleUnionResults(results, payload, inst, ctx);
|
|
1222
|
+
});
|
|
1223
|
+
};
|
|
1224
|
+
});
|
|
1225
|
+
function handleExclusiveUnionResults(results, final, inst, ctx) {
|
|
1226
|
+
const matches = [];
|
|
1227
|
+
for (let i = 0; i < results.length; i++) {
|
|
1228
|
+
if (results[i].issues.length === 0)
|
|
1229
|
+
matches.push(i);
|
|
1230
|
+
}
|
|
1231
|
+
if (matches.length === 1) {
|
|
1232
|
+
final.value = results[matches[0]].value;
|
|
1233
|
+
return final;
|
|
1234
|
+
}
|
|
1235
|
+
if (matches.length === 0) {
|
|
1236
|
+
// No matches - same as regular union
|
|
1237
|
+
final.issues.push({
|
|
1238
|
+
code: "invalid_union",
|
|
1239
|
+
input: final.value,
|
|
1240
|
+
inst,
|
|
1241
|
+
errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
|
|
1242
|
+
});
|
|
1243
|
+
}
|
|
1244
|
+
else {
|
|
1245
|
+
// Multiple matches - exclusive union failure
|
|
1246
|
+
final.issues.push({
|
|
1247
|
+
code: "invalid_union",
|
|
1248
|
+
input: final.value,
|
|
1249
|
+
inst,
|
|
1250
|
+
errors: [],
|
|
1251
|
+
inclusive: false,
|
|
1252
|
+
matches,
|
|
1253
|
+
});
|
|
1254
|
+
}
|
|
1255
|
+
return final;
|
|
1256
|
+
}
|
|
1257
|
+
exports.$ZodXor = core.$constructor("$ZodXor", (inst, def) => {
|
|
1258
|
+
exports.$ZodUnion.init(inst, def);
|
|
1259
|
+
def.inclusive = false;
|
|
1260
|
+
const first = def.options.length === 1 ? def.options[0]._zod.run : null;
|
|
1261
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1262
|
+
if (first) {
|
|
1263
|
+
return first(payload, ctx);
|
|
1264
|
+
}
|
|
1265
|
+
let async = false;
|
|
1266
|
+
const results = [];
|
|
1267
|
+
for (const option of def.options) {
|
|
1268
|
+
const result = option._zod.run({
|
|
1269
|
+
value: payload.value,
|
|
1270
|
+
issues: [],
|
|
1271
|
+
}, ctx);
|
|
1272
|
+
if (result instanceof Promise) {
|
|
1273
|
+
results.push(result);
|
|
1274
|
+
async = true;
|
|
1275
|
+
}
|
|
1276
|
+
else {
|
|
1277
|
+
results.push(result);
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
if (!async)
|
|
1281
|
+
return handleExclusiveUnionResults(results, payload, inst, ctx);
|
|
1282
|
+
return Promise.all(results).then((results) => {
|
|
1283
|
+
return handleExclusiveUnionResults(results, payload, inst, ctx);
|
|
1284
|
+
});
|
|
1285
|
+
};
|
|
1286
|
+
});
|
|
1287
|
+
/** Returns the option of `union` whose discriminator claims `value`. */
|
|
1288
|
+
function getDiscriminatedOption(union, value) {
|
|
1289
|
+
const internals = union._zod;
|
|
1290
|
+
let map = internals.bag.optionsMap;
|
|
1291
|
+
if (!map) {
|
|
1292
|
+
map = new Map();
|
|
1293
|
+
const { options, discriminator } = internals.def;
|
|
1294
|
+
for (const option of options) {
|
|
1295
|
+
// First declaration wins, matching the order the parse path resolves a duplicate in.
|
|
1296
|
+
for (const v of option._zod.propValues?.[discriminator] ?? [])
|
|
1297
|
+
if (!map.has(v))
|
|
1298
|
+
map.set(v, option);
|
|
1299
|
+
}
|
|
1300
|
+
internals.bag.optionsMap = map;
|
|
1301
|
+
}
|
|
1302
|
+
return map.get(value);
|
|
1303
|
+
}
|
|
1304
|
+
exports.$ZodDiscriminatedUnion =
|
|
1305
|
+
/*@__PURE__*/
|
|
1306
|
+
core.$constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
1307
|
+
def.inclusive = false;
|
|
1308
|
+
exports.$ZodUnion.init(inst, def);
|
|
1309
|
+
const _super = inst._zod.parse;
|
|
1310
|
+
util.defineLazyInternal(inst, "propValues", (zod) => {
|
|
1311
|
+
const propValues = {};
|
|
1312
|
+
for (const option of zod.def.options) {
|
|
1313
|
+
const pv = option._zod.propValues;
|
|
1314
|
+
if (!pv || Object.keys(pv).length === 0)
|
|
1315
|
+
throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
|
|
1316
|
+
for (const [k, v] of Object.entries(pv)) {
|
|
1317
|
+
if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
|
|
1318
|
+
util.assignProp(propValues, k, new Set());
|
|
1319
|
+
}
|
|
1320
|
+
for (const val of v) {
|
|
1321
|
+
propValues[k].add(val);
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
return propValues;
|
|
1326
|
+
});
|
|
1327
|
+
// Checked now rather than in the lookup map below, so an option that lacks the discriminator fails at the `discriminatedUnion` call instead of on the first object parsed. Options whose shape cannot be enumerated without resolving it — pipes, lazies, and objects rebuilt by a builder such as `.extend()` — are left to the map.
|
|
1328
|
+
def.options.forEach((option, i) => {
|
|
1329
|
+
const propShape = propShapes.get(option._zod.def);
|
|
1330
|
+
if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
|
|
1331
|
+
throw new Error(`Invalid discriminated union option at index "${i}"`);
|
|
1332
|
+
}
|
|
1333
|
+
});
|
|
1334
|
+
const disc = util.cached(() => {
|
|
1335
|
+
const opts = def.options;
|
|
1336
|
+
const map = new Map();
|
|
1337
|
+
for (const o of opts) {
|
|
1338
|
+
const values = o._zod.propValues?.[def.discriminator];
|
|
1339
|
+
if (!values || values.size === 0)
|
|
1340
|
+
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
1341
|
+
for (const v of values) {
|
|
1342
|
+
if (map.has(v)) {
|
|
1343
|
+
throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
1344
|
+
}
|
|
1345
|
+
map.set(v, o);
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
return map;
|
|
1349
|
+
});
|
|
1350
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1351
|
+
const input = payload.value;
|
|
1352
|
+
if (!util.isObject(input)) {
|
|
1353
|
+
payload.issues.push({
|
|
1354
|
+
code: "invalid_type",
|
|
1355
|
+
expected: "object",
|
|
1356
|
+
input,
|
|
1357
|
+
inst,
|
|
1358
|
+
});
|
|
1359
|
+
return payload;
|
|
1360
|
+
}
|
|
1361
|
+
const opt = disc.value.get(input?.[def.discriminator]);
|
|
1362
|
+
if (opt) {
|
|
1363
|
+
return opt._zod.run(payload, ctx);
|
|
1364
|
+
}
|
|
1365
|
+
// Fall back to union matching when the fast discriminator path fails:
|
|
1366
|
+
// - explicitly enabled via unionFallback, or
|
|
1367
|
+
// - during backward direction (encode), since codec-based discriminators have different values in forward vs backward directions
|
|
1368
|
+
if (def.unionFallback || ctx.direction === "backward") {
|
|
1369
|
+
return _super(payload, ctx);
|
|
1370
|
+
}
|
|
1371
|
+
// no matching discriminator
|
|
1372
|
+
payload.issues.push({
|
|
1373
|
+
code: "invalid_union",
|
|
1374
|
+
errors: [],
|
|
1375
|
+
note: "No matching discriminator",
|
|
1376
|
+
discriminator: def.discriminator,
|
|
1377
|
+
options: Array.from(disc.value.keys()),
|
|
1378
|
+
input,
|
|
1379
|
+
path: [def.discriminator],
|
|
1380
|
+
inst,
|
|
1381
|
+
});
|
|
1382
|
+
return payload;
|
|
1383
|
+
};
|
|
1384
|
+
});
|
|
1385
|
+
exports.$ZodIntersection = core.$constructor("$ZodIntersection", (inst, def) => {
|
|
1386
|
+
exports.$ZodType.init(inst, def);
|
|
1387
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1388
|
+
const input = payload.value;
|
|
1389
|
+
const left = def.left._zod.run({ value: input, issues: [] }, ctx);
|
|
1390
|
+
const right = def.right._zod.run({ value: input, issues: [] }, ctx);
|
|
1391
|
+
const async = left instanceof Promise || right instanceof Promise;
|
|
1392
|
+
if (async) {
|
|
1393
|
+
return Promise.all([left, right]).then(([left, right]) => {
|
|
1394
|
+
return handleIntersectionResults(payload, left, right);
|
|
1395
|
+
});
|
|
1396
|
+
}
|
|
1397
|
+
return handleIntersectionResults(payload, left, right);
|
|
1398
|
+
};
|
|
1399
|
+
});
|
|
1400
|
+
function mergeValues(a, b) {
|
|
1401
|
+
// const aType = parse.t(a);
|
|
1402
|
+
// const bType = parse.t(b);
|
|
1403
|
+
if (a === b) {
|
|
1404
|
+
return { valid: true, data: a };
|
|
1405
|
+
}
|
|
1406
|
+
if (a instanceof Date && b instanceof Date && +a === +b) {
|
|
1407
|
+
return { valid: true, data: a };
|
|
1408
|
+
}
|
|
1409
|
+
if (util.isPlainObject(a) && util.isPlainObject(b)) {
|
|
1410
|
+
const bKeys = Object.keys(b);
|
|
1411
|
+
const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
|
|
1412
|
+
const newObj = { ...a, ...b };
|
|
1413
|
+
if (Object.prototype.hasOwnProperty.call(newObj, "__proto__"))
|
|
1414
|
+
delete newObj.__proto__;
|
|
1415
|
+
for (const key of sharedKeys) {
|
|
1416
|
+
if (key === "__proto__")
|
|
1417
|
+
continue;
|
|
1418
|
+
const sharedValue = mergeValues(a[key], b[key]);
|
|
1419
|
+
if (!sharedValue.valid) {
|
|
1420
|
+
return {
|
|
1421
|
+
valid: false,
|
|
1422
|
+
mergeErrorPath: [key, ...sharedValue.mergeErrorPath],
|
|
1423
|
+
};
|
|
1424
|
+
}
|
|
1425
|
+
newObj[key] = sharedValue.data;
|
|
1426
|
+
}
|
|
1427
|
+
return { valid: true, data: newObj };
|
|
1428
|
+
}
|
|
1429
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
1430
|
+
if (a.length !== b.length) {
|
|
1431
|
+
return { valid: false, mergeErrorPath: [] };
|
|
1432
|
+
}
|
|
1433
|
+
const newArray = [];
|
|
1434
|
+
for (let index = 0; index < a.length; index++) {
|
|
1435
|
+
const itemA = a[index];
|
|
1436
|
+
const itemB = b[index];
|
|
1437
|
+
const sharedValue = mergeValues(itemA, itemB);
|
|
1438
|
+
if (!sharedValue.valid) {
|
|
1439
|
+
return {
|
|
1440
|
+
valid: false,
|
|
1441
|
+
mergeErrorPath: [index, ...sharedValue.mergeErrorPath],
|
|
1442
|
+
};
|
|
1443
|
+
}
|
|
1444
|
+
newArray.push(sharedValue.data);
|
|
1445
|
+
}
|
|
1446
|
+
return { valid: true, data: newArray };
|
|
1447
|
+
}
|
|
1448
|
+
return { valid: false, mergeErrorPath: [] };
|
|
1449
|
+
}
|
|
1450
|
+
function handleIntersectionResults(result, left, right) {
|
|
1451
|
+
// Track which side(s) reject each key. A key rejection is reported only when BOTH sides reject it, so a key owned by one branch survives the other's key schema. strictObject reports these as unrecognized_keys; a record with an open key schema reports one invalid_key per key.
|
|
1452
|
+
const unrecKeys = new Map();
|
|
1453
|
+
let unrecIssue;
|
|
1454
|
+
const keyIssues = new Map();
|
|
1455
|
+
const collect = (iss, side) => {
|
|
1456
|
+
let keys;
|
|
1457
|
+
if (iss.code === "unrecognized_keys" && !iss.path?.length) {
|
|
1458
|
+
unrecIssue ?? (unrecIssue = iss);
|
|
1459
|
+
keys = iss.keys;
|
|
1460
|
+
}
|
|
1461
|
+
else if (iss.code === "invalid_key" && iss.origin === "record" && iss.path?.length === 1) {
|
|
1462
|
+
const k = String(iss.path[0]);
|
|
1463
|
+
if (!keyIssues.has(k))
|
|
1464
|
+
keyIssues.set(k, iss);
|
|
1465
|
+
keys = [k];
|
|
1466
|
+
}
|
|
1467
|
+
else {
|
|
1468
|
+
return false;
|
|
1469
|
+
}
|
|
1470
|
+
for (const k of keys) {
|
|
1471
|
+
if (!unrecKeys.has(k))
|
|
1472
|
+
unrecKeys.set(k, {});
|
|
1473
|
+
unrecKeys.get(k)[side] = true;
|
|
1474
|
+
}
|
|
1475
|
+
return true;
|
|
1476
|
+
};
|
|
1477
|
+
for (const iss of left.issues) {
|
|
1478
|
+
if (!collect(iss, "l"))
|
|
1479
|
+
result.issues.push(iss);
|
|
1480
|
+
}
|
|
1481
|
+
for (const iss of right.issues) {
|
|
1482
|
+
if (!collect(iss, "r"))
|
|
1483
|
+
result.issues.push(iss);
|
|
1484
|
+
}
|
|
1485
|
+
// Report only keys rejected by BOTH sides
|
|
1486
|
+
const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
|
|
1487
|
+
if (bothKeys.length) {
|
|
1488
|
+
const aggregated = unrecIssue ? bothKeys.filter((k) => unrecIssue.keys.includes(k)) : [];
|
|
1489
|
+
if (aggregated.length)
|
|
1490
|
+
result.issues.push({ ...unrecIssue, keys: aggregated });
|
|
1491
|
+
for (const k of bothKeys) {
|
|
1492
|
+
if (!aggregated.includes(k) && keyIssues.has(k))
|
|
1493
|
+
result.issues.push(keyIssues.get(k));
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
const merged = mergeValues(left.value, right.value);
|
|
1497
|
+
if (!merged.valid) {
|
|
1498
|
+
if (util.aborted(result))
|
|
1499
|
+
return result;
|
|
1500
|
+
throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);
|
|
1501
|
+
}
|
|
1502
|
+
result.value = merged.data;
|
|
1503
|
+
return result;
|
|
1504
|
+
}
|
|
1505
|
+
exports.$ZodTuple = core.$constructor("$ZodTuple", (inst, def) => {
|
|
1506
|
+
exports.$ZodType.init(inst, def);
|
|
1507
|
+
const items = def.items;
|
|
1508
|
+
const memo = core.globalConfig.memoizer;
|
|
1509
|
+
memo?.attach(inst);
|
|
1510
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1511
|
+
const input = payload.value;
|
|
1512
|
+
if (!Array.isArray(input)) {
|
|
1513
|
+
payload.issues.push({
|
|
1514
|
+
input,
|
|
1515
|
+
inst,
|
|
1516
|
+
expected: "tuple",
|
|
1517
|
+
code: "invalid_type",
|
|
1518
|
+
});
|
|
1519
|
+
return payload;
|
|
1520
|
+
}
|
|
1521
|
+
payload.value = memo ? memo.alloc(inst, payload, [], ctx) : [];
|
|
1522
|
+
const proms = [];
|
|
1523
|
+
const optinStart = getTupleOptStart(items, "optin");
|
|
1524
|
+
const optoutStart = getTupleOptStart(items, "optout");
|
|
1525
|
+
if (!def.rest) {
|
|
1526
|
+
if (input.length < optinStart) {
|
|
1527
|
+
payload.issues.push({
|
|
1528
|
+
code: "too_small",
|
|
1529
|
+
minimum: optinStart,
|
|
1530
|
+
inclusive: true,
|
|
1531
|
+
input,
|
|
1532
|
+
inst,
|
|
1533
|
+
origin: "array",
|
|
1534
|
+
});
|
|
1535
|
+
return payload;
|
|
1536
|
+
}
|
|
1537
|
+
if (input.length > items.length) {
|
|
1538
|
+
payload.issues.push({
|
|
1539
|
+
code: "too_big",
|
|
1540
|
+
maximum: items.length,
|
|
1541
|
+
inclusive: true,
|
|
1542
|
+
input,
|
|
1543
|
+
inst,
|
|
1544
|
+
origin: "array",
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
// Run every item in parallel, collecting results into an indexed array. The post-processing in `handleTupleResults` walks them in order so it can decide whether an absent optional-output error can truncate the tail or must be reported to preserve required output.
|
|
1549
|
+
const itemResults = new Array(items.length);
|
|
1550
|
+
for (let i = 0; i < items.length; i++) {
|
|
1551
|
+
const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);
|
|
1552
|
+
if (r instanceof Promise) {
|
|
1553
|
+
proms.push(r.then((rr) => {
|
|
1554
|
+
itemResults[i] = rr;
|
|
1555
|
+
}));
|
|
1556
|
+
}
|
|
1557
|
+
else {
|
|
1558
|
+
itemResults[i] = r;
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
if (def.rest) {
|
|
1562
|
+
let i = items.length - 1;
|
|
1563
|
+
const rest = input.slice(items.length);
|
|
1564
|
+
for (const el of rest) {
|
|
1565
|
+
i++;
|
|
1566
|
+
const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
|
|
1567
|
+
if (result instanceof Promise) {
|
|
1568
|
+
proms.push(result.then((r) => handleTupleResult(r, payload, i)));
|
|
1569
|
+
}
|
|
1570
|
+
else {
|
|
1571
|
+
handleTupleResult(result, payload, i);
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
if (proms.length) {
|
|
1576
|
+
return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));
|
|
1577
|
+
}
|
|
1578
|
+
return handleTupleResults(itemResults, payload, items, input, optoutStart);
|
|
1579
|
+
};
|
|
1580
|
+
});
|
|
1581
|
+
function getTupleOptStart(items, key) {
|
|
1582
|
+
for (let i = items.length - 1; i >= 0; i--) {
|
|
1583
|
+
// optin is a three-rung ladder so any rung above `undefined` permits an absent slot; optout stays two-valued.
|
|
1584
|
+
const omittable = key === "optin" ? items[i]._zod.optin !== undefined : items[i]._zod.optout === "optional";
|
|
1585
|
+
if (!omittable)
|
|
1586
|
+
return i + 1;
|
|
1587
|
+
}
|
|
1588
|
+
return 0;
|
|
1589
|
+
}
|
|
1590
|
+
function handleTupleResult(result, final, index) {
|
|
1591
|
+
if (result.issues.length) {
|
|
1592
|
+
final.issues.push(...util.prefixIssues(index, result.issues));
|
|
1593
|
+
}
|
|
1594
|
+
final.value[index] = result.value;
|
|
1595
|
+
}
|
|
1596
|
+
function handleTupleResults(itemResults, final, items, input, optoutStart) {
|
|
1597
|
+
// Walk results in order. Mirror $ZodObject's swallow-on-absent-optional rule, but only after `optoutStart`: the first index where the output tuple tail can be absent.
|
|
1598
|
+
for (let i = 0; i < items.length; i++) {
|
|
1599
|
+
const r = itemResults[i];
|
|
1600
|
+
const isPresent = i < input.length;
|
|
1601
|
+
// The array analog of `handlePropertyResult`'s absent-key early return: the middle rung permits absence without supplying anything in its place, so the tail truncates here instead of materializing whatever the item made of `undefined`.
|
|
1602
|
+
if (!isPresent && i >= optoutStart && items[i]._zod.optin === "optional") {
|
|
1603
|
+
final.value.length = i;
|
|
1604
|
+
break;
|
|
1605
|
+
}
|
|
1606
|
+
if (r.issues.length) {
|
|
1607
|
+
if (!isPresent && i >= optoutStart) {
|
|
1608
|
+
final.value.length = i;
|
|
1609
|
+
break;
|
|
1610
|
+
}
|
|
1611
|
+
final.issues.push(...util.prefixIssues(i, r.issues));
|
|
1612
|
+
}
|
|
1613
|
+
final.value[i] = r.value;
|
|
1614
|
+
}
|
|
1615
|
+
// Drop trailing slots that produced `undefined` for absent input
|
|
1616
|
+
// (the array analog of an absent optional key on an object). The
|
|
1617
|
+
// `i >= input.length` floor is critical: an explicit `undefined`
|
|
1618
|
+
// *inside* the input must be preserved even when the schema is
|
|
1619
|
+
// optional-out (e.g. `z.string().or(z.undefined())` accepting an
|
|
1620
|
+
// explicit undefined value).
|
|
1621
|
+
for (let i = final.value.length - 1; i >= input.length; i--) {
|
|
1622
|
+
if (items[i]._zod.optout === "optional" && final.value[i] === undefined) {
|
|
1623
|
+
final.value.length = i;
|
|
1624
|
+
}
|
|
1625
|
+
else {
|
|
1626
|
+
break;
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
return final;
|
|
1630
|
+
}
|
|
1631
|
+
exports.$ZodRecord = core.$constructor("$ZodRecord", (inst, def) => {
|
|
1632
|
+
exports.$ZodType.init(inst, def);
|
|
1633
|
+
const memo = core.globalConfig.memoizer;
|
|
1634
|
+
memo?.attach(inst);
|
|
1635
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1636
|
+
const input = payload.value;
|
|
1637
|
+
if (!util.isPlainObject(input)) {
|
|
1638
|
+
payload.issues.push({
|
|
1639
|
+
expected: "record",
|
|
1640
|
+
code: "invalid_type",
|
|
1641
|
+
input,
|
|
1642
|
+
inst,
|
|
1643
|
+
});
|
|
1644
|
+
return payload;
|
|
1645
|
+
}
|
|
1646
|
+
const proms = [];
|
|
1647
|
+
const values = def.keyType._zod.values;
|
|
1648
|
+
if (values && !def.partial) {
|
|
1649
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
1650
|
+
const recordKeys = new Set();
|
|
1651
|
+
for (const key of values) {
|
|
1652
|
+
if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
1653
|
+
recordKeys.add(typeof key === "number" ? key.toString() : key);
|
|
1654
|
+
// A declared __proto__ is stripped but is not an unrecognized key.
|
|
1655
|
+
if (key === "__proto__")
|
|
1656
|
+
continue;
|
|
1657
|
+
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
1658
|
+
if (keyResult instanceof Promise) {
|
|
1659
|
+
throw new Error("Async schemas not supported in object keys currently");
|
|
1660
|
+
}
|
|
1661
|
+
if (keyResult.issues.length) {
|
|
1662
|
+
payload.issues.push({
|
|
1663
|
+
code: "invalid_key",
|
|
1664
|
+
origin: "record",
|
|
1665
|
+
issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
|
|
1666
|
+
input: key,
|
|
1667
|
+
path: [key],
|
|
1668
|
+
inst,
|
|
1669
|
+
});
|
|
1670
|
+
continue;
|
|
1671
|
+
}
|
|
1672
|
+
const outKey = keyResult.value;
|
|
1673
|
+
if (outKey === "__proto__")
|
|
1674
|
+
continue;
|
|
1675
|
+
const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1676
|
+
if (result instanceof Promise) {
|
|
1677
|
+
proms.push(result.then((result) => {
|
|
1678
|
+
if (result.issues.length) {
|
|
1679
|
+
payload.issues.push(...util.prefixIssues(key, result.issues));
|
|
1680
|
+
}
|
|
1681
|
+
payload.value[outKey] = result.value;
|
|
1682
|
+
}));
|
|
1683
|
+
}
|
|
1684
|
+
else {
|
|
1685
|
+
if (result.issues.length) {
|
|
1686
|
+
payload.issues.push(...util.prefixIssues(key, result.issues));
|
|
1687
|
+
}
|
|
1688
|
+
payload.value[outKey] = result.value;
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
let unrecognized;
|
|
1693
|
+
for (const key in input) {
|
|
1694
|
+
if (!recordKeys.has(key)) {
|
|
1695
|
+
if (def.mode === "loose") {
|
|
1696
|
+
// skip __proto__ so it can't replace the result prototype via the assignment setter on the plain {} we build into
|
|
1697
|
+
if (key === "__proto__")
|
|
1698
|
+
continue;
|
|
1699
|
+
payload.value[key] = input[key];
|
|
1700
|
+
}
|
|
1701
|
+
else {
|
|
1702
|
+
unrecognized = unrecognized ?? [];
|
|
1703
|
+
unrecognized.push(key);
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
if (unrecognized && unrecognized.length > 0) {
|
|
1708
|
+
payload.issues.push({
|
|
1709
|
+
code: "unrecognized_keys",
|
|
1710
|
+
input,
|
|
1711
|
+
inst,
|
|
1712
|
+
keys: unrecognized,
|
|
1713
|
+
continue: true,
|
|
1714
|
+
});
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
else {
|
|
1718
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
1719
|
+
// An enumerable key schema declares which keys the record owns, so a key outside the set is unrecognized. A non-enumerable one (regex, refine) is a constraint every key must satisfy, so a failing key is invalid. Only the former is reconcilable against the other side of an intersection.
|
|
1720
|
+
let unrecognized;
|
|
1721
|
+
// Reflect.ownKeys for Symbol-key support; filter non-enumerable to match z.object()
|
|
1722
|
+
for (const key of Reflect.ownKeys(input)) {
|
|
1723
|
+
if (key === "__proto__")
|
|
1724
|
+
continue;
|
|
1725
|
+
if (!Object.prototype.propertyIsEnumerable.call(input, key))
|
|
1726
|
+
continue;
|
|
1727
|
+
let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
1728
|
+
if (keyResult instanceof Promise) {
|
|
1729
|
+
throw new Error("Async schemas not supported in object keys currently");
|
|
1730
|
+
}
|
|
1731
|
+
// Numeric string fallback: if key is a numeric string and failed, retry with Number(key). This handles z.number(), z.literal([1, 2, 3]), and unions containing numeric literals
|
|
1732
|
+
const checkNumericKey = typeof key === "string" && regexes.number.test(key) && keyResult.issues.length;
|
|
1733
|
+
if (checkNumericKey) {
|
|
1734
|
+
const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
|
|
1735
|
+
if (retryResult instanceof Promise) {
|
|
1736
|
+
throw new Error("Async schemas not supported in object keys currently");
|
|
1737
|
+
}
|
|
1738
|
+
if (retryResult.issues.length === 0) {
|
|
1739
|
+
keyResult = retryResult;
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
if (keyResult.issues.length) {
|
|
1743
|
+
if (def.mode === "loose") {
|
|
1744
|
+
// Pass through unchanged
|
|
1745
|
+
payload.value[key] = input[key];
|
|
1746
|
+
}
|
|
1747
|
+
else if (values) {
|
|
1748
|
+
unrecognized = unrecognized ?? [];
|
|
1749
|
+
unrecognized.push(key);
|
|
1750
|
+
}
|
|
1751
|
+
else {
|
|
1752
|
+
// Default "strict" behavior: error on invalid key
|
|
1753
|
+
payload.issues.push({
|
|
1754
|
+
code: "invalid_key",
|
|
1755
|
+
origin: "record",
|
|
1756
|
+
issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
|
|
1757
|
+
input: key,
|
|
1758
|
+
path: [key],
|
|
1759
|
+
inst,
|
|
1760
|
+
});
|
|
1761
|
+
}
|
|
1762
|
+
continue;
|
|
1763
|
+
}
|
|
1764
|
+
// the guard above tests the raw input key, but the key schema can normalize an ordinary key into __proto__; re-check the key we actually write under
|
|
1765
|
+
const outKey = keyResult.value;
|
|
1766
|
+
if (outKey === "__proto__")
|
|
1767
|
+
continue;
|
|
1768
|
+
const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1769
|
+
if (result instanceof Promise) {
|
|
1770
|
+
proms.push(result.then((result) => {
|
|
1771
|
+
if (result.issues.length) {
|
|
1772
|
+
payload.issues.push(...util.prefixIssues(key, result.issues));
|
|
1773
|
+
}
|
|
1774
|
+
payload.value[outKey] = result.value;
|
|
1775
|
+
}));
|
|
1776
|
+
}
|
|
1777
|
+
else {
|
|
1778
|
+
if (result.issues.length) {
|
|
1779
|
+
payload.issues.push(...util.prefixIssues(key, result.issues));
|
|
1780
|
+
}
|
|
1781
|
+
payload.value[outKey] = result.value;
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1784
|
+
if (unrecognized && unrecognized.length > 0) {
|
|
1785
|
+
payload.issues.push({
|
|
1786
|
+
code: "unrecognized_keys",
|
|
1787
|
+
input,
|
|
1788
|
+
inst,
|
|
1789
|
+
keys: unrecognized,
|
|
1790
|
+
continue: true,
|
|
1791
|
+
});
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
if (proms.length) {
|
|
1795
|
+
return Promise.all(proms).then(() => payload);
|
|
1796
|
+
}
|
|
1797
|
+
return payload;
|
|
1798
|
+
};
|
|
1799
|
+
});
|
|
1800
|
+
exports.$ZodMap = core.$constructor("$ZodMap", (inst, def) => {
|
|
1801
|
+
exports.$ZodType.init(inst, def);
|
|
1802
|
+
const memo = core.globalConfig.memoizer;
|
|
1803
|
+
memo?.attach(inst);
|
|
1804
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1805
|
+
const input = payload.value;
|
|
1806
|
+
if (!(input instanceof Map)) {
|
|
1807
|
+
payload.issues.push({
|
|
1808
|
+
expected: "map",
|
|
1809
|
+
code: "invalid_type",
|
|
1810
|
+
input,
|
|
1811
|
+
inst,
|
|
1812
|
+
});
|
|
1813
|
+
return payload;
|
|
1814
|
+
}
|
|
1815
|
+
const proms = [];
|
|
1816
|
+
payload.value = memo ? memo.alloc(inst, payload, new Map(), ctx) : new Map();
|
|
1817
|
+
for (const [key, value] of input) {
|
|
1818
|
+
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
1819
|
+
const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);
|
|
1820
|
+
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
1821
|
+
proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {
|
|
1822
|
+
handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
|
|
1823
|
+
}));
|
|
1824
|
+
}
|
|
1825
|
+
else {
|
|
1826
|
+
handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
if (proms.length)
|
|
1830
|
+
return Promise.all(proms).then(() => payload);
|
|
1831
|
+
return payload;
|
|
1832
|
+
};
|
|
1833
|
+
});
|
|
1834
|
+
function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
1835
|
+
if (keyResult.issues.length) {
|
|
1836
|
+
if (util.propertyKeyTypes.has(typeof key)) {
|
|
1837
|
+
final.issues.push(...util.prefixIssues(key, keyResult.issues));
|
|
1838
|
+
}
|
|
1839
|
+
else {
|
|
1840
|
+
final.issues.push({
|
|
1841
|
+
code: "invalid_key",
|
|
1842
|
+
origin: "map",
|
|
1843
|
+
input,
|
|
1844
|
+
inst,
|
|
1845
|
+
issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
|
|
1846
|
+
});
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
if (valueResult.issues.length) {
|
|
1850
|
+
if (util.propertyKeyTypes.has(typeof key)) {
|
|
1851
|
+
final.issues.push(...util.prefixIssues(key, valueResult.issues));
|
|
1852
|
+
}
|
|
1853
|
+
else {
|
|
1854
|
+
final.issues.push({
|
|
1855
|
+
origin: "map",
|
|
1856
|
+
code: "invalid_element",
|
|
1857
|
+
input,
|
|
1858
|
+
inst,
|
|
1859
|
+
key: key,
|
|
1860
|
+
issues: valueResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
|
|
1861
|
+
});
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
final.value.set(keyResult.value, valueResult.value);
|
|
1865
|
+
}
|
|
1866
|
+
exports.$ZodSet = core.$constructor("$ZodSet", (inst, def) => {
|
|
1867
|
+
exports.$ZodType.init(inst, def);
|
|
1868
|
+
const memo = core.globalConfig.memoizer;
|
|
1869
|
+
memo?.attach(inst);
|
|
1870
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1871
|
+
const input = payload.value;
|
|
1872
|
+
if (!(input instanceof Set)) {
|
|
1873
|
+
payload.issues.push({
|
|
1874
|
+
input,
|
|
1875
|
+
inst,
|
|
1876
|
+
expected: "set",
|
|
1877
|
+
code: "invalid_type",
|
|
1878
|
+
});
|
|
1879
|
+
return payload;
|
|
1880
|
+
}
|
|
1881
|
+
const proms = [];
|
|
1882
|
+
payload.value = memo ? memo.alloc(inst, payload, new Set(), ctx) : new Set();
|
|
1883
|
+
for (const item of input) {
|
|
1884
|
+
const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
|
|
1885
|
+
if (result instanceof Promise) {
|
|
1886
|
+
proms.push(result.then((result) => handleSetResult(result, payload)));
|
|
1887
|
+
}
|
|
1888
|
+
else
|
|
1889
|
+
handleSetResult(result, payload);
|
|
1890
|
+
}
|
|
1891
|
+
if (proms.length)
|
|
1892
|
+
return Promise.all(proms).then(() => payload);
|
|
1893
|
+
return payload;
|
|
1894
|
+
};
|
|
1895
|
+
});
|
|
1896
|
+
function handleSetResult(result, final) {
|
|
1897
|
+
if (result.issues.length) {
|
|
1898
|
+
final.issues.push(...result.issues);
|
|
1899
|
+
}
|
|
1900
|
+
final.value.add(result.value);
|
|
1901
|
+
}
|
|
1902
|
+
exports.$ZodEnum = core.$constructor("$ZodEnum", (inst, def) => {
|
|
1903
|
+
exports.$ZodType.init(inst, def);
|
|
1904
|
+
const values = util.getEnumValues(def.entries);
|
|
1905
|
+
const valuesSet = new Set(values);
|
|
1906
|
+
inst._zod.values = valuesSet;
|
|
1907
|
+
const patternValues = values.filter((k) => util.propertyKeyTypes.has(typeof k));
|
|
1908
|
+
// unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches ""
|
|
1909
|
+
inst._zod.pattern = new RegExp(patternValues.length ? `^(${patternValues.map((o) => util.escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
1910
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
1911
|
+
const input = payload.value;
|
|
1912
|
+
if (valuesSet.has(input)) {
|
|
1913
|
+
return payload;
|
|
1914
|
+
}
|
|
1915
|
+
payload.issues.push({
|
|
1916
|
+
code: "invalid_value",
|
|
1917
|
+
values,
|
|
1918
|
+
input,
|
|
1919
|
+
inst,
|
|
1920
|
+
});
|
|
1921
|
+
return payload;
|
|
1922
|
+
};
|
|
1923
|
+
});
|
|
1924
|
+
exports.$ZodLiteral = core.$constructor("$ZodLiteral", (inst, def) => {
|
|
1925
|
+
exports.$ZodType.init(inst, def);
|
|
1926
|
+
const values = new Set(def.values);
|
|
1927
|
+
inst._zod.values = values;
|
|
1928
|
+
// unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches ""
|
|
1929
|
+
inst._zod.pattern = new RegExp(def.values.length
|
|
1930
|
+
? `^(${def.values
|
|
1931
|
+
.map((o) => (typeof o === "string" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o)))
|
|
1932
|
+
.join("|")})$`
|
|
1933
|
+
: "^[^\\s\\S]$");
|
|
1934
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
1935
|
+
const input = payload.value;
|
|
1936
|
+
if (values.has(input)) {
|
|
1937
|
+
return payload;
|
|
1938
|
+
}
|
|
1939
|
+
payload.issues.push({
|
|
1940
|
+
code: "invalid_value",
|
|
1941
|
+
values: def.values,
|
|
1942
|
+
input,
|
|
1943
|
+
inst,
|
|
1944
|
+
});
|
|
1945
|
+
return payload;
|
|
1946
|
+
};
|
|
1947
|
+
});
|
|
1948
|
+
exports.$ZodFile = core.$constructor("$ZodFile", (inst, def) => {
|
|
1949
|
+
exports.$ZodType.init(inst, def);
|
|
1950
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
1951
|
+
const input = payload.value;
|
|
1952
|
+
// @ts-ignore
|
|
1953
|
+
if (input instanceof File)
|
|
1954
|
+
return payload;
|
|
1955
|
+
payload.issues.push({
|
|
1956
|
+
expected: "file",
|
|
1957
|
+
code: "invalid_type",
|
|
1958
|
+
input,
|
|
1959
|
+
inst,
|
|
1960
|
+
});
|
|
1961
|
+
return payload;
|
|
1962
|
+
};
|
|
1963
|
+
});
|
|
1964
|
+
exports.$ZodTransform = core.$constructor("$ZodTransform", (inst, def) => {
|
|
1965
|
+
exports.$ZodType.init(inst, def);
|
|
1966
|
+
inst._zod.optin = "optional";
|
|
1967
|
+
core.globalConfig.memoizer?.guard(inst);
|
|
1968
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1969
|
+
if (ctx.direction === "backward") {
|
|
1970
|
+
throw new core.$ZodEncodeError(inst.constructor.name);
|
|
1971
|
+
}
|
|
1972
|
+
const _out = def.transform(payload.value, payload);
|
|
1973
|
+
if (ctx.async) {
|
|
1974
|
+
const output = _out instanceof Promise ? _out : Promise.resolve(_out);
|
|
1975
|
+
return output.then((output) => {
|
|
1976
|
+
payload.value = output;
|
|
1977
|
+
return payload;
|
|
1978
|
+
});
|
|
1979
|
+
}
|
|
1980
|
+
if (_out instanceof Promise) {
|
|
1981
|
+
throw new core.$ZodAsyncError();
|
|
1982
|
+
}
|
|
1983
|
+
payload.value = _out;
|
|
1984
|
+
return payload;
|
|
1985
|
+
};
|
|
1986
|
+
});
|
|
1987
|
+
function handleOptionalResult(payload, result) {
|
|
1988
|
+
// A substituting schema that still failed has no usable answer; yield undefined. Its issues are simply dropped: it ran on a payload of its own, so there is no shared array to truncate and nothing of the caller's to lose with it.
|
|
1989
|
+
payload.value = result.issues.length ? undefined : result.value;
|
|
1990
|
+
return payload;
|
|
1991
|
+
}
|
|
1992
|
+
exports.$ZodOptional = core.$constructor("$ZodOptional", (inst, def) => {
|
|
1993
|
+
exports.$ZodType.init(inst, def);
|
|
1994
|
+
// .optional() propagates absence rather than substituting for it, so a defaulted inner keeps its rung.
|
|
1995
|
+
util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
|
|
1996
|
+
inst._zod.optout = "optional";
|
|
1997
|
+
util.defineLazyInternal(inst, "values", (zod) => {
|
|
1998
|
+
const values = zod.def.innerType._zod.values;
|
|
1999
|
+
return values ? new Set([...values, undefined]) : undefined;
|
|
2000
|
+
});
|
|
2001
|
+
util.defineLazyInternal(inst, "pattern", (zod) => {
|
|
2002
|
+
const pattern = zod.def.innerType._zod.pattern;
|
|
2003
|
+
return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;
|
|
2004
|
+
});
|
|
2005
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2006
|
+
if (payload.value === undefined) {
|
|
2007
|
+
// Only the top rung substitutes a value for absence; everything else leaves it intact, which is what .optional() means.
|
|
2008
|
+
if (def.innerType._zod.optin !== "defaulted")
|
|
2009
|
+
return payload;
|
|
2010
|
+
// Its own payload, for the same reason $ZodCatch gets one: a pipe forwards an unrecognized key through the caller's issues array, and this must not read that as the substituting schema failing and drop it.
|
|
2011
|
+
const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);
|
|
2012
|
+
if (result instanceof Promise)
|
|
2013
|
+
return result.then((result) => handleOptionalResult(payload, result));
|
|
2014
|
+
return handleOptionalResult(payload, result);
|
|
2015
|
+
}
|
|
2016
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2017
|
+
};
|
|
2018
|
+
});
|
|
2019
|
+
exports.$ZodExactOptional = core.$constructor("$ZodExactOptional", (inst, def) => {
|
|
2020
|
+
// Call parent init - inherits optin/optout = "optional"
|
|
2021
|
+
exports.$ZodOptional.init(inst, def);
|
|
2022
|
+
// Override values/pattern to NOT add undefined
|
|
2023
|
+
util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
2024
|
+
util.defineLazyInternal(inst, "pattern", (zod) => zod.def.innerType._zod.pattern);
|
|
2025
|
+
// Override parse to just delegate (no undefined handling)
|
|
2026
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2027
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2028
|
+
};
|
|
2029
|
+
});
|
|
2030
|
+
exports.$ZodNullable = core.$constructor("$ZodNullable", (inst, def) => {
|
|
2031
|
+
exports.$ZodType.init(inst, def);
|
|
2032
|
+
util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin);
|
|
2033
|
+
util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
|
|
2034
|
+
util.defineLazyInternal(inst, "pattern", (zod) => {
|
|
2035
|
+
const pattern = zod.def.innerType._zod.pattern;
|
|
2036
|
+
return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;
|
|
2037
|
+
});
|
|
2038
|
+
util.defineLazyInternal(inst, "values", (zod) => {
|
|
2039
|
+
return zod.def.innerType._zod.values ? new Set([...zod.def.innerType._zod.values, null]) : undefined;
|
|
2040
|
+
});
|
|
2041
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2042
|
+
// Forward direction (decode): allow null to pass through
|
|
2043
|
+
if (payload.value === null)
|
|
2044
|
+
return payload;
|
|
2045
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2046
|
+
};
|
|
2047
|
+
});
|
|
2048
|
+
exports.$ZodDefault = core.$constructor("$ZodDefault", (inst, def) => {
|
|
2049
|
+
exports.$ZodType.init(inst, def);
|
|
2050
|
+
// inst._zod.qin = "true";
|
|
2051
|
+
inst._zod.optin = "defaulted";
|
|
2052
|
+
util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
2053
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2054
|
+
if (ctx.direction === "backward") {
|
|
2055
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2056
|
+
}
|
|
2057
|
+
// Forward direction (decode): apply defaults for undefined input
|
|
2058
|
+
if (payload.value === undefined) {
|
|
2059
|
+
payload.value = def.defaultValue;
|
|
2060
|
+
/**
|
|
2061
|
+
* $ZodDefault returns the default value immediately in forward direction.
|
|
2062
|
+
* It doesn't pass the default value into the validator ("prefault"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a "prefault" for the pipe. */
|
|
2063
|
+
return payload;
|
|
2064
|
+
}
|
|
2065
|
+
// Forward direction: continue with default handling
|
|
2066
|
+
const result = def.innerType._zod.run(payload, ctx);
|
|
2067
|
+
if (result instanceof Promise) {
|
|
2068
|
+
return result.then((result) => handleDefaultResult(result, def));
|
|
2069
|
+
}
|
|
2070
|
+
return handleDefaultResult(result, def);
|
|
2071
|
+
};
|
|
2072
|
+
});
|
|
2073
|
+
function handleDefaultResult(payload, def) {
|
|
2074
|
+
if (payload.value === undefined) {
|
|
2075
|
+
payload.value = def.defaultValue;
|
|
2076
|
+
}
|
|
2077
|
+
return payload;
|
|
2078
|
+
}
|
|
2079
|
+
exports.$ZodPrefault = core.$constructor("$ZodPrefault", (inst, def) => {
|
|
2080
|
+
exports.$ZodType.init(inst, def);
|
|
2081
|
+
inst._zod.optin = "defaulted";
|
|
2082
|
+
util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
2083
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2084
|
+
if (ctx.direction === "backward") {
|
|
2085
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2086
|
+
}
|
|
2087
|
+
// Forward direction (decode): apply prefault for undefined input
|
|
2088
|
+
if (payload.value === undefined) {
|
|
2089
|
+
payload.value = def.defaultValue;
|
|
2090
|
+
}
|
|
2091
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2092
|
+
};
|
|
2093
|
+
});
|
|
2094
|
+
exports.$ZodNonOptional = core.$constructor("$ZodNonOptional", (inst, def) => {
|
|
2095
|
+
exports.$ZodType.init(inst, def);
|
|
2096
|
+
util.defineLazyInternal(inst, "values", (zod) => {
|
|
2097
|
+
const v = zod.def.innerType._zod.values;
|
|
2098
|
+
return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;
|
|
2099
|
+
});
|
|
2100
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2101
|
+
const result = def.innerType._zod.run(payload, ctx);
|
|
2102
|
+
if (result instanceof Promise) {
|
|
2103
|
+
return result.then((result) => handleNonOptionalResult(result, inst));
|
|
2104
|
+
}
|
|
2105
|
+
return handleNonOptionalResult(result, inst);
|
|
2106
|
+
};
|
|
2107
|
+
});
|
|
2108
|
+
function handleNonOptionalResult(payload, inst) {
|
|
2109
|
+
if (!payload.issues.length && payload.value === undefined) {
|
|
2110
|
+
payload.issues.push({
|
|
2111
|
+
code: "invalid_type",
|
|
2112
|
+
expected: "nonoptional",
|
|
2113
|
+
input: payload.value,
|
|
2114
|
+
inst,
|
|
2115
|
+
});
|
|
2116
|
+
}
|
|
2117
|
+
return payload;
|
|
2118
|
+
}
|
|
2119
|
+
exports.$ZodSuccess = core.$constructor("$ZodSuccess", (inst, def) => {
|
|
2120
|
+
exports.$ZodType.init(inst, def);
|
|
2121
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2122
|
+
if (ctx.direction === "backward") {
|
|
2123
|
+
throw new core.$ZodEncodeError("ZodSuccess");
|
|
2124
|
+
}
|
|
2125
|
+
const result = def.innerType._zod.run(payload, ctx);
|
|
2126
|
+
if (result instanceof Promise) {
|
|
2127
|
+
return result.then((result) => {
|
|
2128
|
+
payload.value = result.issues.length === 0;
|
|
2129
|
+
return payload;
|
|
2130
|
+
});
|
|
2131
|
+
}
|
|
2132
|
+
payload.value = result.issues.length === 0;
|
|
2133
|
+
return payload;
|
|
2134
|
+
};
|
|
2135
|
+
});
|
|
2136
|
+
function handleCatchResult(payload, result, def, ctx) {
|
|
2137
|
+
if (!result.issues.length) {
|
|
2138
|
+
payload.value = result.value;
|
|
2139
|
+
// The value carries up, so the flag describing it has to carry with it: a back-edge into a node still being parsed must not be frozen by an enclosing readonly, and its checks belong to the node itself. Guarded so the ordinary case adds no own property.
|
|
2140
|
+
if (result.memo)
|
|
2141
|
+
payload.memo = true;
|
|
2142
|
+
return payload;
|
|
2143
|
+
}
|
|
2144
|
+
// Spread the inner's own payload, not ours: `value` has to stay the input the catch was handed, and the inner ran on a payload of its own so its issues are already private to this call.
|
|
2145
|
+
payload.value = def.catchValue({
|
|
2146
|
+
...result,
|
|
2147
|
+
value: payload.value,
|
|
2148
|
+
error: {
|
|
2149
|
+
issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
|
|
2150
|
+
},
|
|
2151
|
+
input: payload.value,
|
|
2152
|
+
});
|
|
2153
|
+
return payload;
|
|
2154
|
+
}
|
|
2155
|
+
exports.$ZodCatch = core.$constructor("$ZodCatch", (inst, def) => {
|
|
2156
|
+
exports.$ZodType.init(inst, def);
|
|
2157
|
+
util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
|
|
2158
|
+
util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
|
|
2159
|
+
util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
2160
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2161
|
+
if (ctx.direction === "backward") {
|
|
2162
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2163
|
+
}
|
|
2164
|
+
// Forward direction (decode): apply catch logic
|
|
2165
|
+
const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);
|
|
2166
|
+
if (result instanceof Promise) {
|
|
2167
|
+
return result.then((result) => handleCatchResult(payload, result, def, ctx));
|
|
2168
|
+
}
|
|
2169
|
+
return handleCatchResult(payload, result, def, ctx);
|
|
2170
|
+
};
|
|
2171
|
+
});
|
|
2172
|
+
exports.$ZodNaN = core.$constructor("$ZodNaN", (inst, def) => {
|
|
2173
|
+
exports.$ZodType.init(inst, def);
|
|
2174
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
2175
|
+
if (typeof payload.value !== "number" || !Number.isNaN(payload.value)) {
|
|
2176
|
+
payload.issues.push({
|
|
2177
|
+
input: payload.value,
|
|
2178
|
+
inst,
|
|
2179
|
+
expected: "nan",
|
|
2180
|
+
code: "invalid_type",
|
|
2181
|
+
});
|
|
2182
|
+
return payload;
|
|
2183
|
+
}
|
|
2184
|
+
return payload;
|
|
2185
|
+
};
|
|
2186
|
+
});
|
|
2187
|
+
exports.$ZodPipe = core.$constructor("$ZodPipe", (inst, def) => {
|
|
2188
|
+
exports.$ZodType.init(inst, def);
|
|
2189
|
+
util.defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
|
|
2190
|
+
util.defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
|
|
2191
|
+
util.defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
|
|
2192
|
+
util.defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
|
|
2193
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2194
|
+
if (ctx.direction === "backward") {
|
|
2195
|
+
const right = def.out._zod.run(payload, ctx);
|
|
2196
|
+
if (right instanceof Promise) {
|
|
2197
|
+
return right.then((right) => handlePipeResult(right, def.in, ctx));
|
|
2198
|
+
}
|
|
2199
|
+
return handlePipeResult(right, def.in, ctx);
|
|
2200
|
+
}
|
|
2201
|
+
const left = def.in._zod.run(payload, ctx);
|
|
2202
|
+
if (left instanceof Promise) {
|
|
2203
|
+
return left.then((left) => handlePipeResult(left, def.out, ctx));
|
|
2204
|
+
}
|
|
2205
|
+
return handlePipeResult(left, def.out, ctx);
|
|
2206
|
+
};
|
|
2207
|
+
});
|
|
2208
|
+
function handlePipeResult(left, next, ctx) {
|
|
2209
|
+
// Any issue stops the pipe, so a failing refinement never feeds its transform. An unrecognized key is the exception: it describes the input's extra properties, not the value being piped, and an enclosing intersection may yet reconcile it.
|
|
2210
|
+
if (left.issues.some((iss) => iss.code !== "unrecognized_keys")) {
|
|
2211
|
+
// prevent further checks
|
|
2212
|
+
left.aborted = true;
|
|
2213
|
+
return left;
|
|
2214
|
+
}
|
|
2215
|
+
return next._zod.run({ value: left.value, issues: left.issues }, ctx);
|
|
2216
|
+
}
|
|
2217
|
+
exports.$ZodCodec = core.$constructor("$ZodCodec", (inst, def) => {
|
|
2218
|
+
exports.$ZodType.init(inst, def);
|
|
2219
|
+
util.defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
|
|
2220
|
+
util.defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
|
|
2221
|
+
util.defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
|
|
2222
|
+
util.defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
|
|
2223
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2224
|
+
const direction = ctx.direction || "forward";
|
|
2225
|
+
if (direction === "forward") {
|
|
2226
|
+
const left = def.in._zod.run(payload, ctx);
|
|
2227
|
+
if (left instanceof Promise) {
|
|
2228
|
+
return left.then((left) => handleCodecAResult(left, def, ctx));
|
|
2229
|
+
}
|
|
2230
|
+
return handleCodecAResult(left, def, ctx);
|
|
2231
|
+
}
|
|
2232
|
+
else {
|
|
2233
|
+
const right = def.out._zod.run(payload, ctx);
|
|
2234
|
+
if (right instanceof Promise) {
|
|
2235
|
+
return right.then((right) => handleCodecAResult(right, def, ctx));
|
|
2236
|
+
}
|
|
2237
|
+
return handleCodecAResult(right, def, ctx);
|
|
2238
|
+
}
|
|
2239
|
+
};
|
|
2240
|
+
});
|
|
2241
|
+
function handleCodecAResult(result, def, ctx) {
|
|
2242
|
+
if (result.issues.length) {
|
|
2243
|
+
// prevent further checks
|
|
2244
|
+
result.aborted = true;
|
|
2245
|
+
return result;
|
|
2246
|
+
}
|
|
2247
|
+
const direction = ctx.direction || "forward";
|
|
2248
|
+
if (direction === "forward") {
|
|
2249
|
+
const transformed = def.transform(result.value, result);
|
|
2250
|
+
if (transformed instanceof Promise) {
|
|
2251
|
+
return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));
|
|
2252
|
+
}
|
|
2253
|
+
return handleCodecTxResult(result, transformed, def.out, ctx);
|
|
2254
|
+
}
|
|
2255
|
+
else {
|
|
2256
|
+
const transformed = def.reverseTransform(result.value, result);
|
|
2257
|
+
if (transformed instanceof Promise) {
|
|
2258
|
+
return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));
|
|
2259
|
+
}
|
|
2260
|
+
return handleCodecTxResult(result, transformed, def.in, ctx);
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2263
|
+
function handleCodecTxResult(left, value, nextSchema, ctx) {
|
|
2264
|
+
// Check if transform added any issues
|
|
2265
|
+
if (left.issues.length) {
|
|
2266
|
+
left.aborted = true;
|
|
2267
|
+
return left;
|
|
2268
|
+
}
|
|
2269
|
+
return nextSchema._zod.run({ value, issues: left.issues }, ctx);
|
|
2270
|
+
}
|
|
2271
|
+
exports.$ZodPreprocess = core.$constructor("$ZodPreprocess", (inst, def) => {
|
|
2272
|
+
exports.$ZodPipe.init(inst, def);
|
|
2273
|
+
});
|
|
2274
|
+
exports.$ZodReadonly = core.$constructor("$ZodReadonly", (inst, def) => {
|
|
2275
|
+
exports.$ZodType.init(inst, def);
|
|
2276
|
+
util.defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues);
|
|
2277
|
+
util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
2278
|
+
util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType?._zod?.optin);
|
|
2279
|
+
util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType?._zod?.optout);
|
|
2280
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2281
|
+
if (ctx.direction === "backward") {
|
|
2282
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2283
|
+
}
|
|
2284
|
+
const result = def.innerType._zod.run(payload, ctx);
|
|
2285
|
+
if (result instanceof Promise) {
|
|
2286
|
+
return result.then(handleReadonlyResult);
|
|
2287
|
+
}
|
|
2288
|
+
return handleReadonlyResult(result);
|
|
2289
|
+
};
|
|
2290
|
+
});
|
|
2291
|
+
function handleReadonlyResult(payload) {
|
|
2292
|
+
// A repeat visit hands back a node that is still being built; freezing it here would make the rest of its keys fail to assign.
|
|
2293
|
+
if (!payload.memo)
|
|
2294
|
+
payload.value = Object.freeze(payload.value);
|
|
2295
|
+
return payload;
|
|
2296
|
+
}
|
|
2297
|
+
exports.$ZodTemplateLiteral = core.$constructor("$ZodTemplateLiteral", (inst, def) => {
|
|
2298
|
+
exports.$ZodType.init(inst, def);
|
|
2299
|
+
const regexParts = [];
|
|
2300
|
+
for (const part of def.parts) {
|
|
2301
|
+
if (typeof part === "object" && part !== null) {
|
|
2302
|
+
// is Zod schema
|
|
2303
|
+
if (!part._zod.pattern) {
|
|
2304
|
+
// if (!source)
|
|
2305
|
+
throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
|
|
2306
|
+
}
|
|
2307
|
+
const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;
|
|
2308
|
+
if (!source)
|
|
2309
|
+
throw new Error(`Invalid template literal part: ${part._zod.traits}`);
|
|
2310
|
+
const start = source.startsWith("^") ? 1 : 0;
|
|
2311
|
+
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
2312
|
+
regexParts.push(source.slice(start, end));
|
|
2313
|
+
}
|
|
2314
|
+
else if (part === null || util.primitiveTypes.has(typeof part)) {
|
|
2315
|
+
regexParts.push(util.escapeRegex(`${part}`));
|
|
2316
|
+
}
|
|
2317
|
+
else {
|
|
2318
|
+
throw new Error(`Invalid template literal part: ${part}`);
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
inst._zod.pattern = new RegExp(`^${regexParts.join("")}$`);
|
|
2322
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
2323
|
+
if (typeof payload.value !== "string") {
|
|
2324
|
+
payload.issues.push({
|
|
2325
|
+
input: payload.value,
|
|
2326
|
+
inst,
|
|
2327
|
+
expected: "string",
|
|
2328
|
+
code: "invalid_type",
|
|
2329
|
+
});
|
|
2330
|
+
return payload;
|
|
2331
|
+
}
|
|
2332
|
+
inst._zod.pattern.lastIndex = 0;
|
|
2333
|
+
if (!inst._zod.pattern.test(payload.value)) {
|
|
2334
|
+
payload.issues.push({
|
|
2335
|
+
input: payload.value,
|
|
2336
|
+
inst,
|
|
2337
|
+
code: "invalid_format",
|
|
2338
|
+
format: def.format ?? "template_literal",
|
|
2339
|
+
pattern: inst._zod.pattern.source,
|
|
2340
|
+
});
|
|
2341
|
+
return payload;
|
|
2342
|
+
}
|
|
2343
|
+
return payload;
|
|
2344
|
+
};
|
|
2345
|
+
});
|
|
2346
|
+
exports.$ZodFunction = core.$constructor("$ZodFunction", (inst, def) => {
|
|
2347
|
+
exports.$ZodType.init(inst, def);
|
|
2348
|
+
// Defined, not assigned: the classic prototype exposes `_def` as a getter with no setter.
|
|
2349
|
+
Object.defineProperty(inst, "_def", { value: def });
|
|
2350
|
+
inst._zod.def = def;
|
|
2351
|
+
inst.implement = (func) => {
|
|
2352
|
+
if (typeof func !== "function") {
|
|
2353
|
+
throw new Error("implement() must be called with a function");
|
|
2354
|
+
}
|
|
2355
|
+
// Defined inline so the closure stays anonymous: binding it to a `const` first names it, which costs 256 bytes per implemented function.
|
|
2356
|
+
return Object.defineProperty(function (...args) {
|
|
2357
|
+
const parsedArgs = inst._def.input ? (0, parse_js_1.parse)(inst._def.input, args) : args;
|
|
2358
|
+
const result = Reflect.apply(func, this, parsedArgs);
|
|
2359
|
+
if (inst._def.output) {
|
|
2360
|
+
return (0, parse_js_1.parse)(inst._def.output, result);
|
|
2361
|
+
}
|
|
2362
|
+
return result;
|
|
2363
|
+
}, "_zod", { value: inst._zod, enumerable: false });
|
|
2364
|
+
};
|
|
2365
|
+
inst.implementAsync = (func) => {
|
|
2366
|
+
if (typeof func !== "function") {
|
|
2367
|
+
throw new Error("implementAsync() must be called with a function");
|
|
2368
|
+
}
|
|
2369
|
+
return Object.defineProperty(async function (...args) {
|
|
2370
|
+
const parsedArgs = inst._def.input ? await (0, parse_js_1.parseAsync)(inst._def.input, args) : args;
|
|
2371
|
+
const result = await Reflect.apply(func, this, parsedArgs);
|
|
2372
|
+
if (inst._def.output) {
|
|
2373
|
+
return await (0, parse_js_1.parseAsync)(inst._def.output, result);
|
|
2374
|
+
}
|
|
2375
|
+
return result;
|
|
2376
|
+
}, "_zod", { value: inst._zod, enumerable: false });
|
|
2377
|
+
};
|
|
2378
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
2379
|
+
if (typeof payload.value !== "function") {
|
|
2380
|
+
payload.issues.push({
|
|
2381
|
+
code: "invalid_type",
|
|
2382
|
+
expected: "function",
|
|
2383
|
+
input: payload.value,
|
|
2384
|
+
inst,
|
|
2385
|
+
});
|
|
2386
|
+
return payload;
|
|
2387
|
+
}
|
|
2388
|
+
// Check if output is a promise type to determine if we should use async implementation
|
|
2389
|
+
const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === "promise";
|
|
2390
|
+
if (hasPromiseOutput) {
|
|
2391
|
+
payload.value = inst.implementAsync(payload.value);
|
|
2392
|
+
}
|
|
2393
|
+
else {
|
|
2394
|
+
payload.value = inst.implement(payload.value);
|
|
2395
|
+
}
|
|
2396
|
+
return payload;
|
|
2397
|
+
};
|
|
2398
|
+
inst.input = (...args) => {
|
|
2399
|
+
const F = inst.constructor;
|
|
2400
|
+
if (Array.isArray(args[0])) {
|
|
2401
|
+
return new F({
|
|
2402
|
+
type: "function",
|
|
2403
|
+
input: new exports.$ZodTuple({
|
|
2404
|
+
type: "tuple",
|
|
2405
|
+
items: args[0],
|
|
2406
|
+
rest: args[1],
|
|
2407
|
+
}),
|
|
2408
|
+
output: inst._def.output,
|
|
2409
|
+
});
|
|
2410
|
+
}
|
|
2411
|
+
return new F({
|
|
2412
|
+
type: "function",
|
|
2413
|
+
input: args[0],
|
|
2414
|
+
output: inst._def.output,
|
|
2415
|
+
});
|
|
2416
|
+
};
|
|
2417
|
+
inst.output = (output) => {
|
|
2418
|
+
const F = inst.constructor;
|
|
2419
|
+
return new F({
|
|
2420
|
+
type: "function",
|
|
2421
|
+
input: inst._def.input,
|
|
2422
|
+
output,
|
|
2423
|
+
});
|
|
2424
|
+
};
|
|
2425
|
+
return inst;
|
|
2426
|
+
});
|
|
2427
|
+
exports.$ZodPromise = core.$constructor("$ZodPromise", (inst, def) => {
|
|
2428
|
+
exports.$ZodType.init(inst, def);
|
|
2429
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2430
|
+
return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));
|
|
2431
|
+
};
|
|
2432
|
+
});
|
|
2433
|
+
exports.$ZodLazy = core.$constructor("$ZodLazy", (inst, def) => {
|
|
2434
|
+
exports.$ZodType.init(inst, def);
|
|
2435
|
+
// Cache the resolved inner type on the shared `def` so all clones of this lazy (e.g. via `.describe()`/`.meta()`) share the same inner instance, preserving identity for cycle detection on recursive schemas.
|
|
2436
|
+
util.defineLazy(inst._zod, "innerType", () => {
|
|
2437
|
+
const d = def;
|
|
2438
|
+
if (!d._cachedInner)
|
|
2439
|
+
d._cachedInner = def.getter();
|
|
2440
|
+
return d._cachedInner;
|
|
2441
|
+
});
|
|
2442
|
+
util.defineLazyInternal(inst, "pattern", (zod) => zod.innerType?._zod?.pattern);
|
|
2443
|
+
util.defineLazyInternal(inst, "propValues", (zod) => zod.innerType?._zod?.propValues);
|
|
2444
|
+
util.defineLazyInternal(inst, "optin", (zod) => zod.innerType?._zod?.optin ?? undefined);
|
|
2445
|
+
util.defineLazyInternal(inst, "optout", (zod) => zod.innerType?._zod?.optout ?? undefined);
|
|
2446
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2447
|
+
const inner = inst._zod.innerType;
|
|
2448
|
+
return inner._zod.run(payload, ctx);
|
|
2449
|
+
};
|
|
2450
|
+
});
|
|
2451
|
+
exports.$ZodCustom = core.$constructor("$ZodCustom", (inst, def) => {
|
|
2452
|
+
checks.$ZodCheck.init(inst, def);
|
|
2453
|
+
exports.$ZodType.init(inst, def);
|
|
2454
|
+
inst._zod.parse = (payload, _) => {
|
|
2455
|
+
return payload;
|
|
2456
|
+
};
|
|
2457
|
+
inst._zod.check = (payload) => {
|
|
2458
|
+
const input = payload.value;
|
|
2459
|
+
const r = def.fn(input);
|
|
2460
|
+
if (r instanceof Promise) {
|
|
2461
|
+
return r.then((r) => handleRefineResult(r, payload, input, inst));
|
|
2462
|
+
}
|
|
2463
|
+
handleRefineResult(r, payload, input, inst);
|
|
2464
|
+
return;
|
|
2465
|
+
};
|
|
2466
|
+
});
|
|
2467
|
+
function handleRefineResult(result, payload, input, inst) {
|
|
2468
|
+
if (!result) {
|
|
2469
|
+
const _iss = {
|
|
2470
|
+
code: "custom",
|
|
2471
|
+
input,
|
|
2472
|
+
inst, // incorporates params.error into issue reporting
|
|
2473
|
+
path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting
|
|
2474
|
+
continue: !inst._zod.def.abort,
|
|
2475
|
+
// params: inst._zod.def.params,
|
|
2476
|
+
};
|
|
2477
|
+
if (inst._zod.def.params)
|
|
2478
|
+
_iss.params = inst._zod.def.params;
|
|
2479
|
+
payload.issues.push(util.issue(_iss));
|
|
2480
|
+
}
|
|
2481
|
+
}
|