@salesforce/b2c-dx-mcp 2.1.2 → 3.0.1
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 +3 -3
- package/dist/commands/mcp.js +60 -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 +95 -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,1639 @@
|
|
|
1
|
+
import { expect, test } from "vitest";
|
|
2
|
+
|
|
3
|
+
import * as z from "../../index.js";
|
|
4
|
+
import { ZodCompileAsyncError, ZodCompileUnsupportedError, compile } from "../compile.js";
|
|
5
|
+
|
|
6
|
+
// Differential helper: assert compiled schema matches the original on a value.
|
|
7
|
+
function expectMatch(schema: z.ZodType, value: unknown) {
|
|
8
|
+
const compiled = compile(schema);
|
|
9
|
+
const original = schema.safeParse(value);
|
|
10
|
+
const fast = compiled.safeParse(value);
|
|
11
|
+
|
|
12
|
+
expect(fast.success).toBe(original.success);
|
|
13
|
+
if (original.success && fast.success) {
|
|
14
|
+
expect(fast.data).toEqual(original.data);
|
|
15
|
+
} else if (!original.success && !fast.success) {
|
|
16
|
+
expect(fast.error.issues).toEqual(original.error.issues);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Parse and assert success; return the parsed data for further assertions.
|
|
21
|
+
function valid<T extends z.ZodType>(schema: T, value: unknown): z.output<T> {
|
|
22
|
+
const result = schema.safeParse(value);
|
|
23
|
+
if (!result.success) {
|
|
24
|
+
throw new Error(`expected success, got issues: ${JSON.stringify(result.error.issues)}`);
|
|
25
|
+
}
|
|
26
|
+
return result.data;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Parse and assert failure.
|
|
30
|
+
function invalid(schema: z.ZodType, value: unknown) {
|
|
31
|
+
const result = schema.safeParse(value);
|
|
32
|
+
expect(result.success).toBe(false);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// === Primitives ===
|
|
36
|
+
|
|
37
|
+
test("string", () => {
|
|
38
|
+
const aot = compile(z.string());
|
|
39
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
40
|
+
expect(valid(aot, "")).toBe("");
|
|
41
|
+
invalid(aot, 123);
|
|
42
|
+
invalid(aot, null);
|
|
43
|
+
invalid(aot, undefined);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test("number", () => {
|
|
47
|
+
const aot = compile(z.number());
|
|
48
|
+
expect(valid(aot, 123)).toBe(123);
|
|
49
|
+
expect(valid(aot, 0)).toBe(0);
|
|
50
|
+
expect(valid(aot, -5.5)).toBe(-5.5);
|
|
51
|
+
invalid(aot, Number.NaN); // z.number() rejects NaN
|
|
52
|
+
invalid(aot, Number.POSITIVE_INFINITY); // z.number() rejects Infinity
|
|
53
|
+
invalid(aot, Number.NEGATIVE_INFINITY);
|
|
54
|
+
invalid(aot, "123");
|
|
55
|
+
invalid(aot, null);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test("boolean", () => {
|
|
59
|
+
const aot = compile(z.boolean());
|
|
60
|
+
expect(valid(aot, true)).toBe(true);
|
|
61
|
+
expect(valid(aot, false)).toBe(false);
|
|
62
|
+
invalid(aot, 1);
|
|
63
|
+
invalid(aot, "true");
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test("bigint", () => {
|
|
67
|
+
const aot = compile(z.bigint());
|
|
68
|
+
expect(valid(aot, 123n)).toBe(123n);
|
|
69
|
+
expect(valid(aot, 0n)).toBe(0n);
|
|
70
|
+
invalid(aot, 123);
|
|
71
|
+
invalid(aot, "123");
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test("symbol", () => {
|
|
75
|
+
const aot = compile(z.symbol());
|
|
76
|
+
const sym = Symbol();
|
|
77
|
+
expect(valid(aot, sym)).toBe(sym);
|
|
78
|
+
const namedSym = Symbol.for("test");
|
|
79
|
+
expect(valid(aot, namedSym)).toBe(namedSym);
|
|
80
|
+
invalid(aot, "symbol");
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test("undefined", () => {
|
|
84
|
+
const aot = compile(z.undefined());
|
|
85
|
+
expect(valid(aot, undefined)).toBe(undefined);
|
|
86
|
+
invalid(aot, null);
|
|
87
|
+
invalid(aot, 0);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
test("null", () => {
|
|
91
|
+
const aot = compile(z.null());
|
|
92
|
+
expect(valid(aot, null)).toBe(null);
|
|
93
|
+
invalid(aot, undefined);
|
|
94
|
+
invalid(aot, 0);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
test("void", () => {
|
|
98
|
+
const aot = compile(z.void());
|
|
99
|
+
expect(valid(aot, undefined)).toBe(undefined);
|
|
100
|
+
invalid(aot, null);
|
|
101
|
+
invalid(aot, 0);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
test("nan", () => {
|
|
105
|
+
const aot = compile(z.nan());
|
|
106
|
+
expect(Number.isNaN(valid(aot, Number.NaN))).toBe(true);
|
|
107
|
+
expect(Number.isNaN(valid(aot, Number.NaN))).toBe(true);
|
|
108
|
+
invalid(aot, 0);
|
|
109
|
+
invalid(aot, Number.POSITIVE_INFINITY);
|
|
110
|
+
invalid(aot, "NaN");
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
test("date", () => {
|
|
114
|
+
const aot = compile(z.date());
|
|
115
|
+
const d1 = new Date();
|
|
116
|
+
expect(valid(aot, d1)).toBe(d1);
|
|
117
|
+
const d2 = new Date(0);
|
|
118
|
+
expect(valid(aot, d2)).toBe(d2);
|
|
119
|
+
invalid(aot, new Date("invalid")); // Invalid date
|
|
120
|
+
invalid(aot, "2024-01-01");
|
|
121
|
+
invalid(aot, Date.now());
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// === Special Types ===
|
|
125
|
+
|
|
126
|
+
test("any", () => {
|
|
127
|
+
const aot = compile(z.any());
|
|
128
|
+
expect(valid(aot, null)).toBe(null);
|
|
129
|
+
expect(valid(aot, undefined)).toBe(undefined);
|
|
130
|
+
expect(valid(aot, 123)).toBe(123);
|
|
131
|
+
expect(valid(aot, { nested: { deep: true } })).toEqual({ nested: { deep: true } });
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
test("unknown", () => {
|
|
135
|
+
const aot = compile(z.unknown());
|
|
136
|
+
expect(valid(aot, null)).toBe(null);
|
|
137
|
+
expect(valid(aot, undefined)).toBe(undefined);
|
|
138
|
+
expect(valid(aot, 123)).toBe(123);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
test("never", () => {
|
|
142
|
+
const aot = compile(z.never());
|
|
143
|
+
invalid(aot, null);
|
|
144
|
+
invalid(aot, undefined);
|
|
145
|
+
invalid(aot, 123);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
// === Literal ===
|
|
149
|
+
|
|
150
|
+
test("literal string", () => {
|
|
151
|
+
const aot = compile(z.literal("hello"));
|
|
152
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
153
|
+
invalid(aot, "Hello");
|
|
154
|
+
invalid(aot, "");
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
test("literal number", () => {
|
|
158
|
+
const aot = compile(z.literal(42));
|
|
159
|
+
expect(valid(aot, 42)).toBe(42);
|
|
160
|
+
invalid(aot, 43);
|
|
161
|
+
invalid(aot, "42");
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
test("literal boolean", () => {
|
|
165
|
+
const aot = compile(z.literal(true));
|
|
166
|
+
expect(valid(aot, true)).toBe(true);
|
|
167
|
+
invalid(aot, false);
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
test("literal null", () => {
|
|
171
|
+
const aot = compile(z.literal(null));
|
|
172
|
+
expect(valid(aot, null)).toBe(null);
|
|
173
|
+
invalid(aot, undefined);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
test("literal bigint", () => {
|
|
177
|
+
const aot = compile(z.literal(100n));
|
|
178
|
+
expect(valid(aot, 100n)).toBe(100n);
|
|
179
|
+
invalid(aot, 100);
|
|
180
|
+
invalid(aot, 101n);
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
// === Enum ===
|
|
184
|
+
|
|
185
|
+
test("enum", () => {
|
|
186
|
+
const aot = compile(z.enum(["a", "b", "c"]));
|
|
187
|
+
expect(valid(aot, "a")).toBe("a");
|
|
188
|
+
expect(valid(aot, "b")).toBe("b");
|
|
189
|
+
expect(valid(aot, "c")).toBe("c");
|
|
190
|
+
invalid(aot, "d");
|
|
191
|
+
invalid(aot, "A");
|
|
192
|
+
invalid(aot, 1);
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
// === Wrapper Types ===
|
|
196
|
+
|
|
197
|
+
test("readonly", () => {
|
|
198
|
+
const aot = compile(z.readonly(z.string()));
|
|
199
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
200
|
+
invalid(aot, 123);
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
test("default", () => {
|
|
204
|
+
const aot = compile(z.string().default("hello"));
|
|
205
|
+
expect(valid(aot, "world")).toBe("world");
|
|
206
|
+
expect(valid(aot, undefined)).toBe("hello"); // default applies
|
|
207
|
+
invalid(aot, 123);
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
test("prefault", () => {
|
|
211
|
+
const aot = compile(z.string().trim().prefault(" hello "));
|
|
212
|
+
expect(valid(aot, "world")).toBe("world");
|
|
213
|
+
expect(valid(aot, undefined)).toBe("hello");
|
|
214
|
+
invalid(aot, 123);
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
test("nonoptional", () => {
|
|
218
|
+
const aot = compile(z.string().optional().nonoptional());
|
|
219
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
220
|
+
invalid(aot, undefined); // nonoptional rejects undefined
|
|
221
|
+
invalid(aot, 123);
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
test("nonoptional judges the inner's output, not its input", () => {
|
|
225
|
+
// An inner catch turns a *defined* input into undefined, which must still be rejected; an inner default turns an absent input into a value, which must be accepted. Testing the input alone got both backwards.
|
|
226
|
+
const caught = z
|
|
227
|
+
.string()
|
|
228
|
+
.min(2)
|
|
229
|
+
.max(8)
|
|
230
|
+
.prefault("abc")
|
|
231
|
+
.catch(undefined as any)
|
|
232
|
+
.optional()
|
|
233
|
+
.nonoptional();
|
|
234
|
+
for (const input of ["abc", "abcdefghij", "a", undefined]) expectMatch(caught, input);
|
|
235
|
+
|
|
236
|
+
expectMatch(
|
|
237
|
+
z
|
|
238
|
+
.string()
|
|
239
|
+
.transform(() => undefined)
|
|
240
|
+
.nonoptional(),
|
|
241
|
+
"s"
|
|
242
|
+
);
|
|
243
|
+
for (const input of [undefined, "y", 1]) expectMatch(z.string().default("x").nonoptional(), input);
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
test("a nonoptional object key whose inner supplies a value still needs the key", () => {
|
|
247
|
+
// The runtime separates an absent key from an explicit undefined here: absent fails, explicit undefined takes the default. The fast path has to as well.
|
|
248
|
+
const prop = z
|
|
249
|
+
.literal("lit")
|
|
250
|
+
.default("other" as any)
|
|
251
|
+
.optional()
|
|
252
|
+
.nonoptional();
|
|
253
|
+
const schema = z.object({ k1: prop });
|
|
254
|
+
expectMatch(schema, {});
|
|
255
|
+
expectMatch(schema, { k1: undefined });
|
|
256
|
+
expectMatch(schema, { k1: "lit" });
|
|
257
|
+
expectMatch(prop, undefined);
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
test("success", () => {
|
|
261
|
+
const aot = compile(z.success(z.string()));
|
|
262
|
+
expect(valid(aot, "hello")).toBe(true);
|
|
263
|
+
invalid(aot, 123);
|
|
264
|
+
expectMatch(z.success(z.string()), "hello");
|
|
265
|
+
expectMatch(z.success(z.string()), 123);
|
|
266
|
+
expectMatch(z.object({ ok: z.success(z.number()) }), { ok: 5 });
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
// === Optional & Nullable ===
|
|
270
|
+
|
|
271
|
+
test("optional", () => {
|
|
272
|
+
const aot = compile(z.optional(z.string()));
|
|
273
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
274
|
+
expect(valid(aot, undefined)).toBe(undefined);
|
|
275
|
+
invalid(aot, null);
|
|
276
|
+
invalid(aot, 123);
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
test("nullable", () => {
|
|
280
|
+
const aot = compile(z.nullable(z.string()));
|
|
281
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
282
|
+
expect(valid(aot, null)).toBe(null);
|
|
283
|
+
invalid(aot, undefined);
|
|
284
|
+
invalid(aot, 123);
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
// === Array ===
|
|
288
|
+
|
|
289
|
+
test("array of strings", () => {
|
|
290
|
+
const aot = compile(z.array(z.string()));
|
|
291
|
+
expect(valid(aot, [])).toEqual([]);
|
|
292
|
+
expect(valid(aot, ["a", "b"])).toEqual(["a", "b"]);
|
|
293
|
+
invalid(aot, [1, 2]);
|
|
294
|
+
invalid(aot, ["a", 1]);
|
|
295
|
+
invalid(aot, "not array");
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
test("array of objects", () => {
|
|
299
|
+
const aot = compile(z.array(z.object({ id: z.number() })));
|
|
300
|
+
expect(valid(aot, [{ id: 1 }, { id: 2 }])).toEqual([{ id: 1 }, { id: 2 }]);
|
|
301
|
+
invalid(aot, [{ id: "1" }]);
|
|
302
|
+
invalid(aot, [{}]);
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
// === Object ===
|
|
306
|
+
|
|
307
|
+
test("simple object", () => {
|
|
308
|
+
const aot = compile(z.object({ name: z.string(), age: z.number() }));
|
|
309
|
+
expect(valid(aot, { name: "Alice", age: 30 })).toEqual({ name: "Alice", age: 30 });
|
|
310
|
+
expect(valid(aot, { name: "Bob", age: 25, extra: true })).toEqual({ name: "Bob", age: 25 }); // strip mode
|
|
311
|
+
invalid(aot, { name: "Charlie" });
|
|
312
|
+
invalid(aot, { name: 123, age: 30 });
|
|
313
|
+
invalid(aot, null);
|
|
314
|
+
invalid(aot, []);
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
test("nested object", () => {
|
|
318
|
+
const aot = compile(
|
|
319
|
+
z.object({
|
|
320
|
+
user: z.object({
|
|
321
|
+
name: z.string(),
|
|
322
|
+
address: z.object({
|
|
323
|
+
city: z.string(),
|
|
324
|
+
}),
|
|
325
|
+
}),
|
|
326
|
+
})
|
|
327
|
+
);
|
|
328
|
+
expect(valid(aot, { user: { name: "Alice", address: { city: "NYC" } } })).toEqual({
|
|
329
|
+
user: { name: "Alice", address: { city: "NYC" } },
|
|
330
|
+
});
|
|
331
|
+
invalid(aot, { user: { name: "Alice", address: {} } });
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
test("object with optional property", () => {
|
|
335
|
+
const aot = compile(z.object({ name: z.string(), age: z.optional(z.number()) }));
|
|
336
|
+
expect(valid(aot, { name: "Alice" })).toEqual({ name: "Alice" });
|
|
337
|
+
expect(valid(aot, { name: "Alice", age: 30 })).toEqual({ name: "Alice", age: 30 });
|
|
338
|
+
expect(valid(aot, { name: "Alice", age: undefined })).toEqual({ name: "Alice", age: undefined });
|
|
339
|
+
invalid(aot, { name: "Alice", age: "30" });
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
test("object required undefined-accepting properties distinguish absence", () => {
|
|
343
|
+
const cases = [
|
|
344
|
+
z.object({ value: z.undefined() }),
|
|
345
|
+
z.object({ value: z.union([z.string(), z.undefined()]) }),
|
|
346
|
+
z.object({ value: z.any() }),
|
|
347
|
+
z.object({ value: z.unknown() }),
|
|
348
|
+
];
|
|
349
|
+
|
|
350
|
+
for (const schema of cases) {
|
|
351
|
+
const aot = compile(schema);
|
|
352
|
+
invalid(aot, {});
|
|
353
|
+
expect(valid(aot, { value: undefined })).toEqual({ value: undefined });
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
test("strictObject", () => {
|
|
358
|
+
const aot = compile(z.strictObject({ name: z.string() }));
|
|
359
|
+
expect(valid(aot, { name: "Alice" })).toEqual({ name: "Alice" });
|
|
360
|
+
invalid(aot, { name: "Alice", extra: true });
|
|
361
|
+
invalid(aot, {});
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
test("strictObject with optional", () => {
|
|
365
|
+
const aot = compile(z.strictObject({ name: z.string(), age: z.optional(z.number()) }));
|
|
366
|
+
expect(valid(aot, { name: "Alice" })).toEqual({ name: "Alice" });
|
|
367
|
+
expect(valid(aot, { name: "Alice", age: 30 })).toEqual({ name: "Alice", age: 30 });
|
|
368
|
+
invalid(aot, { name: "Alice", extra: true });
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
test("looseObject", () => {
|
|
372
|
+
const aot = compile(z.looseObject({ name: z.string() }));
|
|
373
|
+
expect(valid(aot, { name: "Alice" })).toEqual({ name: "Alice" });
|
|
374
|
+
expect(valid(aot, { name: "Alice", extra: true })).toEqual({ name: "Alice", extra: true });
|
|
375
|
+
invalid(aot, {});
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
test("object with catchall", () => {
|
|
379
|
+
const aot = compile(z.object({ name: z.string() }).catchall(z.number()));
|
|
380
|
+
expect(valid(aot, { name: "Alice" })).toEqual({ name: "Alice" });
|
|
381
|
+
expect(valid(aot, { name: "Alice", age: 30 })).toEqual({ name: "Alice", age: 30 });
|
|
382
|
+
invalid(aot, { name: "Alice", age: "30" });
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
// === Matches Zod behavior ===
|
|
386
|
+
|
|
387
|
+
test("matches Zod: primitives", () => {
|
|
388
|
+
expectMatch(z.string(), "hello");
|
|
389
|
+
expectMatch(z.string(), 123);
|
|
390
|
+
expectMatch(z.number(), 123);
|
|
391
|
+
expectMatch(z.number(), Number.NaN);
|
|
392
|
+
expectMatch(z.boolean(), true);
|
|
393
|
+
expectMatch(z.boolean(), 1);
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
test("matches Zod: void/nan/date", () => {
|
|
397
|
+
expectMatch(z.void(), undefined);
|
|
398
|
+
expectMatch(z.void(), null);
|
|
399
|
+
expectMatch(z.nan(), Number.NaN);
|
|
400
|
+
expectMatch(z.nan(), 0);
|
|
401
|
+
expectMatch(z.date(), new Date());
|
|
402
|
+
expectMatch(z.date(), new Date("invalid"));
|
|
403
|
+
expectMatch(z.date(), "2024-01-01");
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
test("matches Zod: complex schema", () => {
|
|
407
|
+
const schema = z.strictObject({
|
|
408
|
+
id: z.number(),
|
|
409
|
+
name: z.string(),
|
|
410
|
+
tags: z.array(z.string()),
|
|
411
|
+
nested: z.object({
|
|
412
|
+
active: z.boolean(),
|
|
413
|
+
}),
|
|
414
|
+
});
|
|
415
|
+
|
|
416
|
+
expectMatch(schema, { id: 1, name: "test", tags: ["a"], nested: { active: true } });
|
|
417
|
+
expectMatch(schema, { id: 1, name: "test", tags: ["a"], nested: { active: true }, extra: "x" });
|
|
418
|
+
expectMatch(schema, { id: "1", name: "test", tags: ["a"], nested: { active: true } });
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
// === Checks ===
|
|
422
|
+
|
|
423
|
+
test("number min/max", () => {
|
|
424
|
+
const aot = compile(z.number().min(0).max(100));
|
|
425
|
+
expect(valid(aot, 50)).toBe(50);
|
|
426
|
+
expect(valid(aot, 0)).toBe(0);
|
|
427
|
+
expect(valid(aot, 100)).toBe(100);
|
|
428
|
+
invalid(aot, -1);
|
|
429
|
+
invalid(aot, 101);
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
test("number exclusive min/max", () => {
|
|
433
|
+
const aot = compile(z.number().gt(0).lt(100));
|
|
434
|
+
expect(valid(aot, 50)).toBe(50);
|
|
435
|
+
expect(valid(aot, 1)).toBe(1);
|
|
436
|
+
expect(valid(aot, 99)).toBe(99);
|
|
437
|
+
invalid(aot, 0);
|
|
438
|
+
invalid(aot, 100);
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
test("number int", () => {
|
|
442
|
+
const aot = compile(z.number().int());
|
|
443
|
+
expect(valid(aot, 5)).toBe(5);
|
|
444
|
+
expect(valid(aot, -10)).toBe(-10);
|
|
445
|
+
invalid(aot, 5.5);
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
test("number multipleOf", () => {
|
|
449
|
+
const aot = compile(z.number().multipleOf(5));
|
|
450
|
+
expect(valid(aot, 0)).toBe(0);
|
|
451
|
+
expect(valid(aot, 5)).toBe(5);
|
|
452
|
+
expect(valid(aot, 10)).toBe(10);
|
|
453
|
+
invalid(aot, 7);
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
test("string length checks", () => {
|
|
457
|
+
const aot = compile(z.string().min(3).max(10));
|
|
458
|
+
expect(valid(aot, "abc")).toBe("abc");
|
|
459
|
+
expect(valid(aot, "0123456789")).toBe("0123456789");
|
|
460
|
+
invalid(aot, "ab");
|
|
461
|
+
invalid(aot, "01234567890");
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
test("string exact length", () => {
|
|
465
|
+
const aot = compile(z.string().length(5));
|
|
466
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
467
|
+
invalid(aot, "hi");
|
|
468
|
+
invalid(aot, "toolong");
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
test("string regex", () => {
|
|
472
|
+
const aot = compile(z.string().regex(/^[a-z]+$/));
|
|
473
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
474
|
+
invalid(aot, "Hello");
|
|
475
|
+
invalid(aot, "hello123");
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
test("string startsWith/endsWith/includes", () => {
|
|
479
|
+
const aot = compile(z.string().startsWith("hello").endsWith("world").includes("beautiful"));
|
|
480
|
+
expect(valid(aot, "hello beautiful world")).toBe("hello beautiful world");
|
|
481
|
+
invalid(aot, "hello world");
|
|
482
|
+
invalid(aot, "beautiful world");
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
test("string lowercase/uppercase", () => {
|
|
486
|
+
const lower = compile(z.string().lowercase());
|
|
487
|
+
expect(valid(lower, "hello")).toBe("hello");
|
|
488
|
+
invalid(lower, "Hello");
|
|
489
|
+
|
|
490
|
+
const upper = compile(z.string().uppercase());
|
|
491
|
+
expect(valid(upper, "HELLO")).toBe("HELLO");
|
|
492
|
+
invalid(upper, "Hello");
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
test("array length checks", () => {
|
|
496
|
+
const aot = compile(z.array(z.number()).min(1).max(3));
|
|
497
|
+
expect(valid(aot, [1])).toEqual([1]);
|
|
498
|
+
expect(valid(aot, [1, 2, 3])).toEqual([1, 2, 3]);
|
|
499
|
+
invalid(aot, []);
|
|
500
|
+
invalid(aot, [1, 2, 3, 4]);
|
|
501
|
+
});
|
|
502
|
+
|
|
503
|
+
test("bigint min/max", () => {
|
|
504
|
+
const aot = compile(z.bigint().min(0n).max(100n));
|
|
505
|
+
expect(valid(aot, 50n)).toBe(50n);
|
|
506
|
+
expect(valid(aot, 0n)).toBe(0n);
|
|
507
|
+
invalid(aot, -1n);
|
|
508
|
+
invalid(aot, 101n);
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
test("matches Zod: checks", () => {
|
|
512
|
+
const schema = z
|
|
513
|
+
.string()
|
|
514
|
+
.min(3)
|
|
515
|
+
.max(10)
|
|
516
|
+
.regex(/^[a-z]+$/);
|
|
517
|
+
expectMatch(schema, "hello");
|
|
518
|
+
expectMatch(schema, "ab");
|
|
519
|
+
expectMatch(schema, "Hello");
|
|
520
|
+
expectMatch(schema, "toolongstring");
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
test("custom refine", () => {
|
|
524
|
+
const aot = compile(z.string().refine((x) => x.length > 3));
|
|
525
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
526
|
+
invalid(aot, "abc");
|
|
527
|
+
invalid(aot, "ab");
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
test("custom refine with object", () => {
|
|
531
|
+
const aot = compile(
|
|
532
|
+
z
|
|
533
|
+
.object({
|
|
534
|
+
password: z.string(),
|
|
535
|
+
confirm: z.string(),
|
|
536
|
+
})
|
|
537
|
+
.refine((data) => data.password === data.confirm)
|
|
538
|
+
);
|
|
539
|
+
expect(valid(aot, { password: "secret", confirm: "secret" })).toEqual({ password: "secret", confirm: "secret" });
|
|
540
|
+
invalid(aot, { password: "secret", confirm: "wrong" });
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
// === String Formats ===
|
|
544
|
+
|
|
545
|
+
test("email", () => {
|
|
546
|
+
const aot = compile(z.email());
|
|
547
|
+
expect(valid(aot, "test@example.com")).toBe("test@example.com");
|
|
548
|
+
expect(valid(aot, "user.name+tag@example.co.uk")).toBe("user.name+tag@example.co.uk");
|
|
549
|
+
invalid(aot, "invalid");
|
|
550
|
+
invalid(aot, "@example.com");
|
|
551
|
+
invalid(aot, 123);
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
test("uuid", () => {
|
|
555
|
+
const aot = compile(z.uuid());
|
|
556
|
+
expect(valid(aot, "550e8400-e29b-41d4-a716-446655440000")).toBe("550e8400-e29b-41d4-a716-446655440000");
|
|
557
|
+
expect(valid(aot, "00000000-0000-0000-0000-000000000000")).toBe("00000000-0000-0000-0000-000000000000");
|
|
558
|
+
invalid(aot, "not-a-uuid");
|
|
559
|
+
invalid(aot, "550e8400-e29b-41d4-a716");
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
test("url", () => {
|
|
563
|
+
const aot = compile(z.url());
|
|
564
|
+
expect(valid(aot, "https://example.com")).toBe("https://example.com");
|
|
565
|
+
expect(valid(aot, " https://example.com ")).toBe("https://example.com");
|
|
566
|
+
expect(valid(aot, "http://localhost:3000/path")).toBe("http://localhost:3000/path");
|
|
567
|
+
invalid(aot, "not a url");
|
|
568
|
+
invalid(aot, "example.com");
|
|
569
|
+
});
|
|
570
|
+
|
|
571
|
+
test("ipv4", () => {
|
|
572
|
+
const aot = compile(z.ipv4());
|
|
573
|
+
expect(valid(aot, "192.168.1.1")).toBe("192.168.1.1");
|
|
574
|
+
expect(valid(aot, "0.0.0.0")).toBe("0.0.0.0");
|
|
575
|
+
expect(valid(aot, "255.255.255.255")).toBe("255.255.255.255");
|
|
576
|
+
invalid(aot, "192.168.1");
|
|
577
|
+
invalid(aot, "256.0.0.0");
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
test("matches Zod: string formats", () => {
|
|
581
|
+
expectMatch(z.email(), "test@example.com");
|
|
582
|
+
expectMatch(z.email(), "invalid");
|
|
583
|
+
expectMatch(z.uuid(), "550e8400-e29b-41d4-a716-446655440000");
|
|
584
|
+
expectMatch(z.uuid(), "not-a-uuid");
|
|
585
|
+
// z.url() intentionally throws at compile time (see "url is unsupported").
|
|
586
|
+
});
|
|
587
|
+
|
|
588
|
+
// === Tuple ===
|
|
589
|
+
|
|
590
|
+
test("tuple basic", () => {
|
|
591
|
+
const aot = compile(z.tuple([z.string(), z.number()]));
|
|
592
|
+
expect(valid(aot, ["hello", 42])).toEqual(["hello", 42]);
|
|
593
|
+
invalid(aot, ["hello", "world"]);
|
|
594
|
+
invalid(aot, ["hello"]);
|
|
595
|
+
invalid(aot, ["hello", 42, "extra"]);
|
|
596
|
+
invalid(aot, {});
|
|
597
|
+
});
|
|
598
|
+
|
|
599
|
+
test("tuple with rest", () => {
|
|
600
|
+
const aot = compile(z.tuple([z.string(), z.number()]).rest(z.boolean()));
|
|
601
|
+
expect(valid(aot, ["hello", 42])).toEqual(["hello", 42]);
|
|
602
|
+
expect(valid(aot, ["hello", 42, true])).toEqual(["hello", 42, true]);
|
|
603
|
+
expect(valid(aot, ["hello", 42, true, false])).toEqual(["hello", 42, true, false]);
|
|
604
|
+
invalid(aot, ["hello", 42, "extra"]);
|
|
605
|
+
invalid(aot, ["hello"]);
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
test("tuple empty", () => {
|
|
609
|
+
const aot = compile(z.tuple([]));
|
|
610
|
+
expect(valid(aot, [])).toEqual([]);
|
|
611
|
+
invalid(aot, ["extra"]);
|
|
612
|
+
});
|
|
613
|
+
|
|
614
|
+
test("matches Zod: tuple", () => {
|
|
615
|
+
const schema = z.tuple([z.string(), z.number()]).rest(z.boolean());
|
|
616
|
+
expectMatch(schema, ["hello", 42]);
|
|
617
|
+
expectMatch(schema, ["hello", 42, true, false]);
|
|
618
|
+
expectMatch(schema, ["hello", 42, "not boolean"]);
|
|
619
|
+
expectMatch(schema, ["hello"]);
|
|
620
|
+
});
|
|
621
|
+
|
|
622
|
+
// === Union ===
|
|
623
|
+
|
|
624
|
+
test("union of primitives", () => {
|
|
625
|
+
const aot = compile(z.union([z.string(), z.number()]));
|
|
626
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
627
|
+
expect(valid(aot, 42)).toBe(42);
|
|
628
|
+
invalid(aot, true);
|
|
629
|
+
invalid(aot, null);
|
|
630
|
+
});
|
|
631
|
+
|
|
632
|
+
test("union of literals (Set optimization)", () => {
|
|
633
|
+
const aot = compile(z.union([z.literal("a"), z.literal("b"), z.literal("c")]));
|
|
634
|
+
expect(valid(aot, "a")).toBe("a");
|
|
635
|
+
expect(valid(aot, "b")).toBe("b");
|
|
636
|
+
expect(valid(aot, "c")).toBe("c");
|
|
637
|
+
invalid(aot, "d");
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
test("union single option", () => {
|
|
641
|
+
const aot = compile(z.union([z.string()]));
|
|
642
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
643
|
+
invalid(aot, 42);
|
|
644
|
+
});
|
|
645
|
+
|
|
646
|
+
test("union with objects", () => {
|
|
647
|
+
const aot = compile(
|
|
648
|
+
z.union([
|
|
649
|
+
z.object({ type: z.literal("a"), value: z.string() }),
|
|
650
|
+
z.object({ type: z.literal("b"), value: z.number() }),
|
|
651
|
+
])
|
|
652
|
+
);
|
|
653
|
+
expect(valid(aot, { type: "a", value: "hello" })).toEqual({ type: "a", value: "hello" });
|
|
654
|
+
expect(valid(aot, { type: "b", value: 42 })).toEqual({ type: "b", value: 42 });
|
|
655
|
+
invalid(aot, { type: "a", value: 42 });
|
|
656
|
+
invalid(aot, { type: "c", value: "hello" });
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
test("matches Zod: union", () => {
|
|
660
|
+
const schema = z.union([z.string(), z.number(), z.null()]);
|
|
661
|
+
expectMatch(schema, "hello");
|
|
662
|
+
expectMatch(schema, 42);
|
|
663
|
+
expectMatch(schema, null);
|
|
664
|
+
expectMatch(schema, true);
|
|
665
|
+
expectMatch(schema, undefined);
|
|
666
|
+
});
|
|
667
|
+
|
|
668
|
+
// === Intersection ===
|
|
669
|
+
|
|
670
|
+
test("intersection of objects", () => {
|
|
671
|
+
const aot = compile(z.intersection(z.object({ name: z.string() }), z.object({ age: z.number() })));
|
|
672
|
+
expect(valid(aot, { name: "Alice", age: 30 })).toEqual({ name: "Alice", age: 30 });
|
|
673
|
+
invalid(aot, { name: "Alice" });
|
|
674
|
+
invalid(aot, { age: 30 });
|
|
675
|
+
});
|
|
676
|
+
|
|
677
|
+
test("intersection deep merge", () => {
|
|
678
|
+
const aot = compile(
|
|
679
|
+
z.intersection(z.object({ nested: z.object({ a: z.string() }) }), z.object({ nested: z.object({ b: z.number() }) }))
|
|
680
|
+
);
|
|
681
|
+
expect(valid(aot, { nested: { a: "x", b: 1 } })).toEqual({ nested: { a: "x", b: 1 } });
|
|
682
|
+
});
|
|
683
|
+
|
|
684
|
+
// === Record ===
|
|
685
|
+
|
|
686
|
+
test("record basic", () => {
|
|
687
|
+
const aot = compile(z.record(z.string(), z.number()));
|
|
688
|
+
expect(valid(aot, {})).toEqual({});
|
|
689
|
+
expect(valid(aot, { a: 1, b: 2 })).toEqual({ a: 1, b: 2 });
|
|
690
|
+
invalid(aot, { a: "hello" });
|
|
691
|
+
invalid(aot, null);
|
|
692
|
+
invalid(aot, []);
|
|
693
|
+
});
|
|
694
|
+
|
|
695
|
+
test("record with enum keys", () => {
|
|
696
|
+
// Records with enum/literal keys have exhaustive semantics: every enum value must be present in the input. Compile currently forces fallback for this case (see compile.ts generateRecordCheck), so behavior matches the runtime by delegation.
|
|
697
|
+
const aot = compile(z.record(z.enum(["a", "b"]), z.number()));
|
|
698
|
+
expect(valid(aot, { a: 1, b: 2 })).toEqual({ a: 1, b: 2 });
|
|
699
|
+
invalid(aot, { a: 1 }); // missing required key b
|
|
700
|
+
invalid(aot, { c: 3 }); // unknown key
|
|
701
|
+
});
|
|
702
|
+
|
|
703
|
+
test("matches Zod: record", () => {
|
|
704
|
+
const schema = z.record(z.string(), z.number());
|
|
705
|
+
expectMatch(schema, {});
|
|
706
|
+
expectMatch(schema, { a: 1, b: 2 });
|
|
707
|
+
expectMatch(schema, { a: "hello" });
|
|
708
|
+
});
|
|
709
|
+
|
|
710
|
+
// === Map ===
|
|
711
|
+
|
|
712
|
+
test("map basic", () => {
|
|
713
|
+
const aot = compile(z.map(z.string(), z.number()));
|
|
714
|
+
expect(valid(aot, new Map())).toEqual(new Map());
|
|
715
|
+
expect(
|
|
716
|
+
valid(
|
|
717
|
+
aot,
|
|
718
|
+
new Map([
|
|
719
|
+
["a", 1],
|
|
720
|
+
["b", 2],
|
|
721
|
+
])
|
|
722
|
+
)
|
|
723
|
+
).toEqual(
|
|
724
|
+
new Map([
|
|
725
|
+
["a", 1],
|
|
726
|
+
["b", 2],
|
|
727
|
+
])
|
|
728
|
+
);
|
|
729
|
+
invalid(aot, new Map([["a", "hello"]]));
|
|
730
|
+
invalid(aot, new Map([[1, 1]]));
|
|
731
|
+
invalid(aot, {});
|
|
732
|
+
});
|
|
733
|
+
|
|
734
|
+
test("matches Zod: map", () => {
|
|
735
|
+
const schema = z.map(z.string(), z.number());
|
|
736
|
+
expectMatch(schema, new Map());
|
|
737
|
+
expectMatch(schema, new Map([["a", 1]]));
|
|
738
|
+
expectMatch(schema, new Map([["a", "hello"]]));
|
|
739
|
+
expectMatch(schema, {});
|
|
740
|
+
});
|
|
741
|
+
|
|
742
|
+
// === Set ===
|
|
743
|
+
|
|
744
|
+
test("set basic", () => {
|
|
745
|
+
const aot = compile(z.set(z.number()));
|
|
746
|
+
expect(valid(aot, new Set())).toEqual(new Set());
|
|
747
|
+
expect(valid(aot, new Set([1, 2, 3]))).toEqual(new Set([1, 2, 3]));
|
|
748
|
+
invalid(aot, new Set(["hello"]));
|
|
749
|
+
invalid(aot, []);
|
|
750
|
+
});
|
|
751
|
+
|
|
752
|
+
test("set size checks", () => {
|
|
753
|
+
const aot = compile(z.set(z.number()).min(1).max(3));
|
|
754
|
+
expect(valid(aot, new Set([1]))).toEqual(new Set([1]));
|
|
755
|
+
expect(valid(aot, new Set([1, 2, 3]))).toEqual(new Set([1, 2, 3]));
|
|
756
|
+
invalid(aot, new Set());
|
|
757
|
+
invalid(aot, new Set([1, 2, 3, 4]));
|
|
758
|
+
});
|
|
759
|
+
|
|
760
|
+
test("matches Zod: set", () => {
|
|
761
|
+
const schema = z.set(z.string());
|
|
762
|
+
expectMatch(schema, new Set());
|
|
763
|
+
expectMatch(schema, new Set(["a", "b"]));
|
|
764
|
+
expectMatch(schema, new Set([1, 2]));
|
|
765
|
+
expectMatch(schema, []);
|
|
766
|
+
});
|
|
767
|
+
|
|
768
|
+
// === Template Literal ===
|
|
769
|
+
|
|
770
|
+
test("template literal basic", () => {
|
|
771
|
+
const aot = compile(z.templateLiteral([z.literal("hello"), z.literal("-"), z.literal("world")]));
|
|
772
|
+
expect(valid(aot, "hello-world")).toBe("hello-world");
|
|
773
|
+
invalid(aot, "hello-world!");
|
|
774
|
+
invalid(aot, "helloworld");
|
|
775
|
+
invalid(aot, 123);
|
|
776
|
+
});
|
|
777
|
+
|
|
778
|
+
test("template literal with types", () => {
|
|
779
|
+
const aot = compile(z.templateLiteral(["user-", z.number()]));
|
|
780
|
+
expect(valid(aot, "user-123")).toBe("user-123");
|
|
781
|
+
expect(valid(aot, "user-0")).toBe("user-0");
|
|
782
|
+
invalid(aot, "user-abc");
|
|
783
|
+
invalid(aot, "admin-123");
|
|
784
|
+
});
|
|
785
|
+
|
|
786
|
+
test("matches Zod: template literal", () => {
|
|
787
|
+
const schema = z.templateLiteral(["id-", z.number()]);
|
|
788
|
+
expectMatch(schema, "id-123");
|
|
789
|
+
expectMatch(schema, "id-abc");
|
|
790
|
+
expectMatch(schema, "other-123");
|
|
791
|
+
});
|
|
792
|
+
|
|
793
|
+
// === Lazy ===
|
|
794
|
+
|
|
795
|
+
test("lazy basic", () => {
|
|
796
|
+
const aot = compile(z.lazy(() => z.string()));
|
|
797
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
798
|
+
invalid(aot, 123);
|
|
799
|
+
});
|
|
800
|
+
|
|
801
|
+
test("lazy recursive schemas are refused, and still parse through the runtime", () => {
|
|
802
|
+
interface Node {
|
|
803
|
+
value: string;
|
|
804
|
+
next?: Node | undefined;
|
|
805
|
+
}
|
|
806
|
+
const nodeSchema: z.ZodType<Node> = z.object({
|
|
807
|
+
value: z.string(),
|
|
808
|
+
next: z.lazy(() => nodeSchema).optional(),
|
|
809
|
+
});
|
|
810
|
+
|
|
811
|
+
// A recursive schema is re-entered by a single parse, which is how the runtime memoizer terminates input containing a reference cycle. That state is keyed on the parse context, and the fast path has none, so it declines the schema rather than following the cycle until the stack runs out.
|
|
812
|
+
expect(() => compile(nodeSchema, { strict: true })).toThrow(ZodCompileUnsupportedError);
|
|
813
|
+
|
|
814
|
+
expect(valid(nodeSchema, { value: "a" })).toEqual({ value: "a" });
|
|
815
|
+
expect(valid(nodeSchema, { value: "a", next: { value: "b" } })).toEqual({ value: "a", next: { value: "b" } });
|
|
816
|
+
invalid(nodeSchema, { value: "a", next: { value: 123 } });
|
|
817
|
+
invalid(nodeSchema, { value: 123 });
|
|
818
|
+
|
|
819
|
+
// The case the refusal exists for: cyclic input parses instead of crashing.
|
|
820
|
+
const cyclic: any = { value: "a" };
|
|
821
|
+
cyclic.next = cyclic;
|
|
822
|
+
expect(() => nodeSchema.parse(cyclic)).not.toThrow();
|
|
823
|
+
});
|
|
824
|
+
|
|
825
|
+
test("matches Zod: lazy", () => {
|
|
826
|
+
const schema = z.lazy(() => z.string());
|
|
827
|
+
expectMatch(schema, "hello");
|
|
828
|
+
expectMatch(schema, 123);
|
|
829
|
+
});
|
|
830
|
+
|
|
831
|
+
// === Pipe ===
|
|
832
|
+
|
|
833
|
+
test("pipe without transform", () => {
|
|
834
|
+
// Pipe with both schemas validating the same type
|
|
835
|
+
const aot = compile(z.string().pipe(z.string().min(3)));
|
|
836
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
837
|
+
invalid(aot, "ab");
|
|
838
|
+
invalid(aot, 123);
|
|
839
|
+
});
|
|
840
|
+
|
|
841
|
+
test("matches Zod: pipe without transform", () => {
|
|
842
|
+
const schema = z.string().pipe(z.string().min(3));
|
|
843
|
+
expectMatch(schema, "hello");
|
|
844
|
+
expectMatch(schema, "ab");
|
|
845
|
+
expectMatch(schema, 123);
|
|
846
|
+
});
|
|
847
|
+
|
|
848
|
+
// === Custom / Instanceof ===
|
|
849
|
+
|
|
850
|
+
test("instanceof", () => {
|
|
851
|
+
class MyClass {
|
|
852
|
+
value: number;
|
|
853
|
+
constructor(v: number) {
|
|
854
|
+
this.value = v;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
const aot = compile(z.instanceof(MyClass));
|
|
859
|
+
const instance = new MyClass(1);
|
|
860
|
+
expect(valid(aot, instance)).toBe(instance);
|
|
861
|
+
invalid(aot, { value: 1 });
|
|
862
|
+
invalid(aot, null);
|
|
863
|
+
});
|
|
864
|
+
|
|
865
|
+
test("instanceof Date", () => {
|
|
866
|
+
const aot = compile(z.instanceof(Date));
|
|
867
|
+
const d = new Date();
|
|
868
|
+
expect(valid(aot, d)).toBe(d);
|
|
869
|
+
invalid(aot, "2024-01-01");
|
|
870
|
+
invalid(aot, {});
|
|
871
|
+
});
|
|
872
|
+
|
|
873
|
+
test("matches Zod: instanceof", () => {
|
|
874
|
+
class Test {}
|
|
875
|
+
const schema = z.instanceof(Test);
|
|
876
|
+
expectMatch(schema, new Test());
|
|
877
|
+
expectMatch(schema, {});
|
|
878
|
+
expectMatch(schema, null);
|
|
879
|
+
});
|
|
880
|
+
|
|
881
|
+
// === Bigint Format Checks ===
|
|
882
|
+
|
|
883
|
+
test("bigint int64 format", () => {
|
|
884
|
+
const aot = compile(z.int64());
|
|
885
|
+
expect(valid(aot, 0n)).toBe(0n);
|
|
886
|
+
expect(valid(aot, 9223372036854775807n)).toBe(9223372036854775807n);
|
|
887
|
+
expect(valid(aot, -9223372036854775808n)).toBe(-9223372036854775808n);
|
|
888
|
+
invalid(aot, 9223372036854775808n); // too big
|
|
889
|
+
invalid(aot, -9223372036854775809n); // too small
|
|
890
|
+
});
|
|
891
|
+
|
|
892
|
+
test("bigint uint64 format", () => {
|
|
893
|
+
const aot = compile(z.uint64());
|
|
894
|
+
expect(valid(aot, 0n)).toBe(0n);
|
|
895
|
+
expect(valid(aot, 18446744073709551615n)).toBe(18446744073709551615n);
|
|
896
|
+
invalid(aot, -1n); // negative
|
|
897
|
+
invalid(aot, 18446744073709551616n); // too big
|
|
898
|
+
});
|
|
899
|
+
|
|
900
|
+
test("matches Zod: bigint format", () => {
|
|
901
|
+
const schema = z.int64();
|
|
902
|
+
expectMatch(schema, 0n);
|
|
903
|
+
expectMatch(schema, 9223372036854775807n);
|
|
904
|
+
expectMatch(schema, 9223372036854775808n);
|
|
905
|
+
});
|
|
906
|
+
|
|
907
|
+
// === Nullish (combines optional + nullable) ===
|
|
908
|
+
|
|
909
|
+
test("nullish", () => {
|
|
910
|
+
const aot = compile(z.string().nullish());
|
|
911
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
912
|
+
expect(valid(aot, null)).toBe(null);
|
|
913
|
+
expect(valid(aot, undefined)).toBe(undefined);
|
|
914
|
+
invalid(aot, 123);
|
|
915
|
+
});
|
|
916
|
+
|
|
917
|
+
test("matches Zod: nullish", () => {
|
|
918
|
+
const schema = z.string().nullish();
|
|
919
|
+
expectMatch(schema, "hello");
|
|
920
|
+
expectMatch(schema, null);
|
|
921
|
+
expectMatch(schema, undefined);
|
|
922
|
+
expectMatch(schema, 123);
|
|
923
|
+
});
|
|
924
|
+
|
|
925
|
+
// === Codec (extends pipe with transform) ===
|
|
926
|
+
// Note: Codecs involve transforms, so AOT validates input and executes transforms.
|
|
927
|
+
|
|
928
|
+
test("codec validates and transforms", () => {
|
|
929
|
+
// stringbool is a codec from string to boolean
|
|
930
|
+
const aot = compile(z.stringbool());
|
|
931
|
+
expect(valid(aot, "true")).toBe(true);
|
|
932
|
+
expect(valid(aot, "false")).toBe(false);
|
|
933
|
+
expect(valid(aot, "1")).toBe(true);
|
|
934
|
+
expect(valid(aot, "0")).toBe(false);
|
|
935
|
+
invalid(aot, 123); // Not a string
|
|
936
|
+
invalid(aot, null);
|
|
937
|
+
});
|
|
938
|
+
|
|
939
|
+
// === SuperRefine ===
|
|
940
|
+
|
|
941
|
+
test("superRefine basic", () => {
|
|
942
|
+
const schema = z.string().superRefine((val, ctx) => {
|
|
943
|
+
if (val.length < 3) {
|
|
944
|
+
ctx.addIssue({ code: "custom", message: "Too short" });
|
|
945
|
+
}
|
|
946
|
+
});
|
|
947
|
+
const aot = compile(schema);
|
|
948
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
949
|
+
invalid(aot, "ab");
|
|
950
|
+
invalid(aot, 123);
|
|
951
|
+
});
|
|
952
|
+
|
|
953
|
+
test("superRefine with multiple issues", () => {
|
|
954
|
+
const schema = z.number().superRefine((val, ctx) => {
|
|
955
|
+
if (val < 0) ctx.addIssue({ code: "custom", message: "Must be positive" });
|
|
956
|
+
if (val > 100) ctx.addIssue({ code: "custom", message: "Must be <= 100" });
|
|
957
|
+
});
|
|
958
|
+
const aot = compile(schema);
|
|
959
|
+
expect(valid(aot, 50)).toBe(50);
|
|
960
|
+
invalid(aot, -1);
|
|
961
|
+
invalid(aot, 101);
|
|
962
|
+
});
|
|
963
|
+
|
|
964
|
+
test("matches Zod: superRefine", () => {
|
|
965
|
+
const schema = z.string().superRefine((val, ctx) => {
|
|
966
|
+
if (!val.includes("@")) {
|
|
967
|
+
ctx.addIssue({ code: "custom", message: "Must contain @" });
|
|
968
|
+
}
|
|
969
|
+
});
|
|
970
|
+
expectMatch(schema, "test@example.com");
|
|
971
|
+
expectMatch(schema, "invalid");
|
|
972
|
+
expectMatch(schema, 123);
|
|
973
|
+
});
|
|
974
|
+
|
|
975
|
+
// === Transform ===
|
|
976
|
+
|
|
977
|
+
test("transform basic", () => {
|
|
978
|
+
const schema = z.string().transform((val) => val.toUpperCase());
|
|
979
|
+
const aot = compile(schema);
|
|
980
|
+
expect(valid(aot, "hello")).toBe("HELLO"); // Transform succeeds
|
|
981
|
+
invalid(aot, 123); // Not a string (fails before transform)
|
|
982
|
+
});
|
|
983
|
+
|
|
984
|
+
test("transform with validation", () => {
|
|
985
|
+
const schema = z.string().transform((val, ctx) => {
|
|
986
|
+
if (val.length === 0) {
|
|
987
|
+
ctx.addIssue({ code: "custom", message: "Empty string" });
|
|
988
|
+
return z.NEVER;
|
|
989
|
+
}
|
|
990
|
+
return val.length;
|
|
991
|
+
});
|
|
992
|
+
const aot = compile(schema);
|
|
993
|
+
expect(valid(aot, "hello")).toBe(5);
|
|
994
|
+
invalid(aot, ""); // Transform adds issue
|
|
995
|
+
});
|
|
996
|
+
|
|
997
|
+
test("matches Zod: transform", () => {
|
|
998
|
+
const schema = z.string().transform((val) => val.length);
|
|
999
|
+
expectMatch(schema, "hello");
|
|
1000
|
+
expectMatch(schema, 123);
|
|
1001
|
+
});
|
|
1002
|
+
|
|
1003
|
+
// === Overwrite Checks (trim, toLowerCase, toUpperCase) ===
|
|
1004
|
+
|
|
1005
|
+
test("trim", () => {
|
|
1006
|
+
const schema = z.string().trim();
|
|
1007
|
+
const aot = compile(schema);
|
|
1008
|
+
|
|
1009
|
+
// AOT validates the input type and applies trim transform
|
|
1010
|
+
expect(valid(aot, " hello ")).toBe("hello");
|
|
1011
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
1012
|
+
expect(valid(aot, "")).toBe("");
|
|
1013
|
+
invalid(aot, 123);
|
|
1014
|
+
});
|
|
1015
|
+
|
|
1016
|
+
test("toLowerCase", () => {
|
|
1017
|
+
const schema = z.string().toLowerCase();
|
|
1018
|
+
const aot = compile(schema);
|
|
1019
|
+
|
|
1020
|
+
// AOT validates the input type and applies toLowerCase transform
|
|
1021
|
+
expect(valid(aot, "HELLO")).toBe("hello");
|
|
1022
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
1023
|
+
expect(valid(aot, "")).toBe("");
|
|
1024
|
+
invalid(aot, 123);
|
|
1025
|
+
});
|
|
1026
|
+
|
|
1027
|
+
test("toUpperCase", () => {
|
|
1028
|
+
const schema = z.string().toUpperCase();
|
|
1029
|
+
const aot = compile(schema);
|
|
1030
|
+
|
|
1031
|
+
// AOT validates the input type and applies toUpperCase transform
|
|
1032
|
+
expect(valid(aot, "hello")).toBe("HELLO");
|
|
1033
|
+
expect(valid(aot, "HELLO")).toBe("HELLO");
|
|
1034
|
+
expect(valid(aot, "")).toBe("");
|
|
1035
|
+
invalid(aot, 123);
|
|
1036
|
+
});
|
|
1037
|
+
|
|
1038
|
+
test("chained overwrites", () => {
|
|
1039
|
+
const schema = z.string().trim().toLowerCase();
|
|
1040
|
+
const aot = compile(schema);
|
|
1041
|
+
|
|
1042
|
+
// AOT validates the input type and applies transforms in order
|
|
1043
|
+
expect(valid(aot, " HELLO ")).toBe("hello");
|
|
1044
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
1045
|
+
expect(valid(aot, "")).toBe("");
|
|
1046
|
+
invalid(aot, 123);
|
|
1047
|
+
});
|
|
1048
|
+
|
|
1049
|
+
test("overwrite with validation", () => {
|
|
1050
|
+
const schema = z.string().trim().min(3);
|
|
1051
|
+
const aot = compile(schema);
|
|
1052
|
+
|
|
1053
|
+
// After trim, check min length
|
|
1054
|
+
expect(valid(aot, " hello ")).toBe("hello"); // "hello" length 5 >= 3
|
|
1055
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
1056
|
+
invalid(aot, " ab "); // "ab" length 2 < 3
|
|
1057
|
+
expect(valid(aot, "abc")).toBe("abc");
|
|
1058
|
+
invalid(aot, 123);
|
|
1059
|
+
});
|
|
1060
|
+
|
|
1061
|
+
test("matches Zod: trim", () => {
|
|
1062
|
+
const schema = z.string().trim();
|
|
1063
|
+
expectMatch(schema, " hello ");
|
|
1064
|
+
expectMatch(schema, "hello");
|
|
1065
|
+
expectMatch(schema, 123);
|
|
1066
|
+
});
|
|
1067
|
+
|
|
1068
|
+
test("matches Zod: toLowerCase", () => {
|
|
1069
|
+
const schema = z.string().toLowerCase();
|
|
1070
|
+
expectMatch(schema, "HELLO");
|
|
1071
|
+
expectMatch(schema, "hello");
|
|
1072
|
+
expectMatch(schema, 123);
|
|
1073
|
+
});
|
|
1074
|
+
|
|
1075
|
+
test("matches Zod: toUpperCase", () => {
|
|
1076
|
+
const schema = z.string().toUpperCase();
|
|
1077
|
+
expectMatch(schema, "hello");
|
|
1078
|
+
expectMatch(schema, "HELLO");
|
|
1079
|
+
expectMatch(schema, 123);
|
|
1080
|
+
});
|
|
1081
|
+
|
|
1082
|
+
test("matches Zod: chained overwrites", () => {
|
|
1083
|
+
const schema = z.string().trim().toLowerCase();
|
|
1084
|
+
expectMatch(schema, " HELLO ");
|
|
1085
|
+
expectMatch(schema, "hello");
|
|
1086
|
+
expectMatch(schema, 123);
|
|
1087
|
+
});
|
|
1088
|
+
|
|
1089
|
+
test("matches Zod: overwrite with validation", () => {
|
|
1090
|
+
const schema = z.string().trim().min(3);
|
|
1091
|
+
expectMatch(schema, " hello ");
|
|
1092
|
+
expectMatch(schema, " ab ");
|
|
1093
|
+
expectMatch(schema, "abc");
|
|
1094
|
+
expectMatch(schema, 123);
|
|
1095
|
+
});
|
|
1096
|
+
|
|
1097
|
+
// === Regressions tracking main ===
|
|
1098
|
+
|
|
1099
|
+
test("object catchall ignores __proto__ key (#5898)", () => {
|
|
1100
|
+
// Passthrough variant
|
|
1101
|
+
const loose = compile(z.looseObject({ name: z.string() }));
|
|
1102
|
+
const polluted = JSON.parse('{"name":"ok","__proto__":{"polluted":true}}');
|
|
1103
|
+
const out = valid(loose, polluted) as Record<string, unknown>;
|
|
1104
|
+
expect(Object.getPrototypeOf(out)).toBe(Object.prototype);
|
|
1105
|
+
expect((out as { polluted?: unknown }).polluted).toBeUndefined();
|
|
1106
|
+
|
|
1107
|
+
// Schema-typed catchall
|
|
1108
|
+
const typed = compile(z.object({ name: z.string() }).catchall(z.number()));
|
|
1109
|
+
const out2 = valid(typed, JSON.parse('{"name":"ok","extra":1}')) as Record<string, unknown>;
|
|
1110
|
+
expect(Object.getPrototypeOf(out2)).toBe(Object.prototype);
|
|
1111
|
+
});
|
|
1112
|
+
|
|
1113
|
+
test("multipleOf with sub-integer step uses float tolerance (#5793)", () => {
|
|
1114
|
+
const aot = compile(z.number().multipleOf(1e-7));
|
|
1115
|
+
expect(valid(aot, 0)).toBe(0);
|
|
1116
|
+
expect(valid(aot, 1e-7)).toBe(1e-7);
|
|
1117
|
+
expect(valid(aot, 3e-7)).toBe(3e-7);
|
|
1118
|
+
invalid(aot, 2.5e-7);
|
|
1119
|
+
invalid(aot, 1.5e-7);
|
|
1120
|
+
});
|
|
1121
|
+
|
|
1122
|
+
test("tuple with trailing optionals accepts short input (#5661)", () => {
|
|
1123
|
+
const schema = z.tuple([z.string(), z.number().optional()]);
|
|
1124
|
+
const aot = compile(schema);
|
|
1125
|
+
expect(valid(aot, ["a"])).toEqual(["a"]);
|
|
1126
|
+
expect(valid(aot, ["a", 1])).toEqual(["a", 1]);
|
|
1127
|
+
invalid(aot, []);
|
|
1128
|
+
invalid(aot, ["a", "b"]);
|
|
1129
|
+
invalid(aot, ["a", 1, "extra"]);
|
|
1130
|
+
});
|
|
1131
|
+
|
|
1132
|
+
test("tuple exactOptional rejects explicit undefined but accepts absence", () => {
|
|
1133
|
+
const aot = compile(z.tuple([z.string().exactOptional()]));
|
|
1134
|
+
expect(valid(aot, [])).toEqual([]);
|
|
1135
|
+
expect(valid(aot, ["x"])).toEqual(["x"]);
|
|
1136
|
+
invalid(aot, [undefined]);
|
|
1137
|
+
invalid(aot, [1]);
|
|
1138
|
+
});
|
|
1139
|
+
|
|
1140
|
+
test("tuple mixed required and exactOptional", () => {
|
|
1141
|
+
const aot = compile(z.tuple([z.number(), z.string().exactOptional(), z.boolean().exactOptional()]));
|
|
1142
|
+
expect(valid(aot, [1])).toEqual([1]);
|
|
1143
|
+
expect(valid(aot, [1, "x"])).toEqual([1, "x"]);
|
|
1144
|
+
expect(valid(aot, [1, "x", true])).toEqual([1, "x", true]);
|
|
1145
|
+
invalid(aot, []);
|
|
1146
|
+
invalid(aot, [1, undefined]);
|
|
1147
|
+
invalid(aot, [1, "x", undefined]);
|
|
1148
|
+
invalid(aot, [1, "x", true, "extra"]);
|
|
1149
|
+
});
|
|
1150
|
+
|
|
1151
|
+
test("tuple optional vs exactOptional differ on explicit undefined", () => {
|
|
1152
|
+
const opt = compile(z.tuple([z.string().optional()]));
|
|
1153
|
+
expect(valid(opt, [])).toEqual([]);
|
|
1154
|
+
expect(valid(opt, [undefined])).toEqual([undefined]);
|
|
1155
|
+
|
|
1156
|
+
const exact = compile(z.tuple([z.string().exactOptional()]));
|
|
1157
|
+
expect(valid(exact, [])).toEqual([]);
|
|
1158
|
+
invalid(exact, [undefined]);
|
|
1159
|
+
});
|
|
1160
|
+
|
|
1161
|
+
test("default() shallow-clones Map/Set/array/object (#5855)", () => {
|
|
1162
|
+
const mapSchema = z.map(z.string(), z.number()).default(new Map([["a", 1]]));
|
|
1163
|
+
const mapFn = compile(mapSchema);
|
|
1164
|
+
const m1 = valid(mapFn, undefined) as Map<string, number>;
|
|
1165
|
+
const m2 = valid(mapFn, undefined) as Map<string, number>;
|
|
1166
|
+
expect(m1).not.toBe(m2);
|
|
1167
|
+
m1.set("b", 2);
|
|
1168
|
+
expect(m2.has("b")).toBe(false);
|
|
1169
|
+
|
|
1170
|
+
const setSchema = z.set(z.string()).default(new Set(["x"]));
|
|
1171
|
+
const setFn = compile(setSchema);
|
|
1172
|
+
const s1 = valid(setFn, undefined) as Set<string>;
|
|
1173
|
+
const s2 = valid(setFn, undefined) as Set<string>;
|
|
1174
|
+
expect(s1).not.toBe(s2);
|
|
1175
|
+
});
|
|
1176
|
+
|
|
1177
|
+
test("multi-value literal accepts each value", () => {
|
|
1178
|
+
const aot = compile(z.literal(["a", "b", 1]));
|
|
1179
|
+
expect(valid(aot, "a")).toBe("a");
|
|
1180
|
+
expect(valid(aot, "b")).toBe("b");
|
|
1181
|
+
expect(valid(aot, 1)).toBe(1);
|
|
1182
|
+
invalid(aot, "c");
|
|
1183
|
+
invalid(aot, 2);
|
|
1184
|
+
});
|
|
1185
|
+
|
|
1186
|
+
// === Phase 1: schema-clone + fallback contract ===
|
|
1187
|
+
|
|
1188
|
+
test("compile returns a fresh clone; original schema is untouched", () => {
|
|
1189
|
+
const original = z.object({ name: z.string() });
|
|
1190
|
+
const originalRun = original._zod.run;
|
|
1191
|
+
const compiled = compile(original);
|
|
1192
|
+
expect(compiled).not.toBe(original);
|
|
1193
|
+
expect(original._zod.run).toBe(originalRun);
|
|
1194
|
+
expect(compiled._zod.run).not.toBe(originalRun);
|
|
1195
|
+
// shape def is shared by reference; cloning is structural at the top
|
|
1196
|
+
expect(compiled._zod.def).toBe(original._zod.def);
|
|
1197
|
+
});
|
|
1198
|
+
|
|
1199
|
+
test("fallback produces ZodError identical to the original schema", () => {
|
|
1200
|
+
const schema = z.object({ name: z.string(), age: z.number().min(0) });
|
|
1201
|
+
const compiled = compile(schema);
|
|
1202
|
+
const cases: unknown[] = [
|
|
1203
|
+
{ name: 123, age: 30 },
|
|
1204
|
+
{ name: "ok", age: -5 },
|
|
1205
|
+
{ name: "ok", age: "thirty" },
|
|
1206
|
+
null,
|
|
1207
|
+
[],
|
|
1208
|
+
{ name: "ok" },
|
|
1209
|
+
];
|
|
1210
|
+
for (const value of cases) {
|
|
1211
|
+
const a = schema.safeParse(value);
|
|
1212
|
+
const b = compiled.safeParse(value);
|
|
1213
|
+
expect(b.success).toBe(a.success);
|
|
1214
|
+
if (!a.success && !b.success) {
|
|
1215
|
+
expect(b.error.issues).toEqual(a.error.issues);
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
});
|
|
1219
|
+
|
|
1220
|
+
test("fallback preserves instanceof class name in error message", () => {
|
|
1221
|
+
class User {}
|
|
1222
|
+
const schema = z.instanceof(User);
|
|
1223
|
+
const compiled = compile(schema);
|
|
1224
|
+
expect(compiled.safeParse(new User()).success).toBe(true);
|
|
1225
|
+
const bad = compiled.safeParse({});
|
|
1226
|
+
expect(bad.success).toBe(false);
|
|
1227
|
+
if (!bad.success) {
|
|
1228
|
+
// The error must come from the original schema's runtime, which captured `inst` referring to the original. Class name surfaces in the message.
|
|
1229
|
+
expect(bad.error.issues[0]?.message).toMatch(/User/);
|
|
1230
|
+
}
|
|
1231
|
+
});
|
|
1232
|
+
|
|
1233
|
+
test("compile bypasses fast path for backward direction (codec encode)", () => {
|
|
1234
|
+
const codec = z.stringbool();
|
|
1235
|
+
const compiled = compile(codec);
|
|
1236
|
+
expect(compiled.safeParse("true").data).toBe(true);
|
|
1237
|
+
expect(compiled.safeParse("false").data).toBe(false);
|
|
1238
|
+
expect(compiled.encode(true)).toBe("true");
|
|
1239
|
+
expect(compiled.encode(false)).toBe("false");
|
|
1240
|
+
});
|
|
1241
|
+
|
|
1242
|
+
test("compile bypasses fast path for safeParseAsync", async () => {
|
|
1243
|
+
const schema = z.string().min(3);
|
|
1244
|
+
const compiled = compile(schema);
|
|
1245
|
+
const r = await compiled.safeParseAsync("ok");
|
|
1246
|
+
expect(r.success).toBe(false);
|
|
1247
|
+
const ok = await compiled.safeParseAsync("hello");
|
|
1248
|
+
expect(ok.success).toBe(true);
|
|
1249
|
+
});
|
|
1250
|
+
|
|
1251
|
+
test("ZodCompileAsyncError thrown on async refinement", () => {
|
|
1252
|
+
const schema = z.string().refine(async () => true);
|
|
1253
|
+
expect(() => compile(schema, { strict: true })).toThrow(ZodCompileAsyncError);
|
|
1254
|
+
});
|
|
1255
|
+
|
|
1256
|
+
test("ZodCompileAsyncError thrown on async transform", () => {
|
|
1257
|
+
const schema = z.string().transform(async (s) => s.length);
|
|
1258
|
+
expect(() => compile(schema, { strict: true })).toThrow(ZodCompileAsyncError);
|
|
1259
|
+
});
|
|
1260
|
+
|
|
1261
|
+
test("compiled clone is composable inside another schema", () => {
|
|
1262
|
+
const inner = z.object({ name: z.string() });
|
|
1263
|
+
const compiledInner = compile(inner);
|
|
1264
|
+
const outer = z.object({ user: compiledInner, count: z.number() });
|
|
1265
|
+
const r = outer.safeParse({ user: { name: "ok" }, count: 1 });
|
|
1266
|
+
expect(r.success).toBe(true);
|
|
1267
|
+
if (r.success) expect(r.data).toEqual({ user: { name: "ok" }, count: 1 });
|
|
1268
|
+
const bad = outer.safeParse({ user: { name: 1 }, count: 1 });
|
|
1269
|
+
expect(bad.success).toBe(false);
|
|
1270
|
+
});
|
|
1271
|
+
|
|
1272
|
+
// === catch ===
|
|
1273
|
+
|
|
1274
|
+
test("catch over primitive", () => {
|
|
1275
|
+
const aot = compile(z.catch(z.string(), "fallback"));
|
|
1276
|
+
expect(valid(aot, "hello")).toBe("hello");
|
|
1277
|
+
expect(valid(aot, 123)).toBe("fallback");
|
|
1278
|
+
expect(valid(aot, undefined)).toBe("fallback");
|
|
1279
|
+
});
|
|
1280
|
+
|
|
1281
|
+
test("catch as object property", () => {
|
|
1282
|
+
const aot = compile(z.object({ name: z.catch(z.string(), "anon") }));
|
|
1283
|
+
expect(valid(aot, { name: "Alice" })).toEqual({ name: "Alice" });
|
|
1284
|
+
expect(valid(aot, { name: 123 })).toEqual({ name: "anon" });
|
|
1285
|
+
expect(valid(aot, {})).toEqual({ name: "anon" });
|
|
1286
|
+
});
|
|
1287
|
+
|
|
1288
|
+
test("a catch callback reading ctx is refused; a constant catch compiles", () => {
|
|
1289
|
+
// Finalizing the issues the callback sees depends on the caller's per-parse error map, which generated code never receives — the compiled path produced the default message where `.parse(input, { error })` produces the mapped one. Refuse it, so a union treats it as uncompilable rather than as a rejected branch.
|
|
1290
|
+
const reads = z.catch(z.string().min(5), (ctx) => `bad:${ctx.error.issues.length}`);
|
|
1291
|
+
expect(() => compile(reads, { strict: true })).toThrow(ZodCompileUnsupportedError);
|
|
1292
|
+
expect(reads.parse("hi")).toBe("bad:1");
|
|
1293
|
+
expect(reads.parse(42 as never)).toMatch(/^bad:\d+$/);
|
|
1294
|
+
|
|
1295
|
+
// A constant catch value needs no issues at all, so it keeps the fast path.
|
|
1296
|
+
const constant = compile(z.catch(z.string().min(5), "fb"));
|
|
1297
|
+
expect(valid(constant, "hello world")).toBe("hello world");
|
|
1298
|
+
expect(valid(constant, "hi")).toBe("fb");
|
|
1299
|
+
expect(valid(constant, 42)).toBe("fb");
|
|
1300
|
+
});
|
|
1301
|
+
|
|
1302
|
+
test("catch falls through unsupported inner via runtime island", () => {
|
|
1303
|
+
// Async refine in the inner makes the inner uncompilable, but catch should still compile by treating the whole catch as a runtime island.
|
|
1304
|
+
const aot = compile(z.catch(z.union([z.string(), z.number()]), "fb"));
|
|
1305
|
+
expect(valid(aot, "x")).toBe("x");
|
|
1306
|
+
expect(valid(aot, 1)).toBe(1);
|
|
1307
|
+
expect(valid(aot, true)).toBe("fb");
|
|
1308
|
+
});
|
|
1309
|
+
|
|
1310
|
+
// === IPv6 / CIDRv6 hoisted helpers ===
|
|
1311
|
+
|
|
1312
|
+
test("ipv6 compiled rejects regex-passing but URL-rejecting values", () => {
|
|
1313
|
+
const aot = compile(z.ipv6());
|
|
1314
|
+
expect(valid(aot, "::1")).toBe("::1");
|
|
1315
|
+
expect(valid(aot, "2001:db8::1")).toBe("2001:db8::1");
|
|
1316
|
+
// "0:0:0:0:0:0:0:1:1" matches the IPv6 regex but `new URL` rejects it.
|
|
1317
|
+
invalid(aot, "0:0:0:0:0:0:0:1:1");
|
|
1318
|
+
// Differential: confirm runtime and compiled agree on this fixture.
|
|
1319
|
+
expectMatch(z.ipv6(), "0:0:0:0:0:0:0:1:1");
|
|
1320
|
+
});
|
|
1321
|
+
|
|
1322
|
+
test("cidrv6 compiled validates prefix range and address", () => {
|
|
1323
|
+
const aot = compile(z.cidrv6());
|
|
1324
|
+
expect(valid(aot, "::1/128")).toBe("::1/128");
|
|
1325
|
+
invalid(aot, "::1/129");
|
|
1326
|
+
invalid(aot, "::1/-1");
|
|
1327
|
+
invalid(aot, "not-an-address/64");
|
|
1328
|
+
invalid(aot, "::1");
|
|
1329
|
+
expectMatch(z.cidrv6(), "::1/129");
|
|
1330
|
+
});
|
|
1331
|
+
|
|
1332
|
+
// === Runtime islands ===
|
|
1333
|
+
|
|
1334
|
+
test("runtime island falls through unsupported child inside object", () => {
|
|
1335
|
+
// z.xor (exclusive union) currently throws ZodCompileUnsupportedError. As an object property, the island should let the rest of the object compile.
|
|
1336
|
+
const aot = compile(
|
|
1337
|
+
z.object({
|
|
1338
|
+
label: z.string(),
|
|
1339
|
+
payload: z.xor([z.string(), z.number()]),
|
|
1340
|
+
})
|
|
1341
|
+
);
|
|
1342
|
+
expect(valid(aot, { label: "ok", payload: "x" })).toEqual({ label: "ok", payload: "x" });
|
|
1343
|
+
invalid(aot, { label: "ok", payload: true });
|
|
1344
|
+
invalid(aot, { label: 1, payload: "x" });
|
|
1345
|
+
});
|
|
1346
|
+
|
|
1347
|
+
test("runtime island inside array element", () => {
|
|
1348
|
+
const aot = compile(z.array(z.xor([z.string(), z.number()])));
|
|
1349
|
+
expect(valid(aot, ["a", 1, "b"])).toEqual(["a", 1, "b"]);
|
|
1350
|
+
invalid(aot, ["a", true]);
|
|
1351
|
+
});
|
|
1352
|
+
|
|
1353
|
+
test("url string-format check never assigns to its accessor", () => {
|
|
1354
|
+
// const accessor (array element): previously emitted `elem = normalized`,
|
|
1355
|
+
// a TypeError on valid input.
|
|
1356
|
+
const arr = compile(z.array(z.string().url()));
|
|
1357
|
+
expect(valid(arr, ["https://example.com"])).toEqual(["https://example.com"]);
|
|
1358
|
+
invalid(arr, ["not a url"]);
|
|
1359
|
+
|
|
1360
|
+
// property accessor: previously wrote the normalized value back into the caller's input object.
|
|
1361
|
+
const padded = " https://example.com ";
|
|
1362
|
+
const input = { u: padded };
|
|
1363
|
+
expectMatch(z.object({ u: z.string().url() }), input);
|
|
1364
|
+
expect(input.u).toBe(padded);
|
|
1365
|
+
});
|
|
1366
|
+
|
|
1367
|
+
test("lazy schemas with checked or defaulted descendants parse without crashing", () => {
|
|
1368
|
+
// Inner runtime run must receive a ctx — checks read ctx.skipChecks, default/transform read ctx.direction.
|
|
1369
|
+
const aot = compile(z.lazy(() => z.string().min(2)));
|
|
1370
|
+
expect(valid(aot, "abc")).toEqual("abc");
|
|
1371
|
+
invalid(aot, "a");
|
|
1372
|
+
|
|
1373
|
+
// Recursive, so the fast path declines it; the runtime still parses it.
|
|
1374
|
+
const tree: z.ZodType = z.lazy(() => z.object({ v: z.number().int(), kids: z.array(tree).default([]) }));
|
|
1375
|
+
expect(() => compile(tree, { strict: true })).toThrow(ZodCompileUnsupportedError);
|
|
1376
|
+
expect(valid(tree, { v: 1, kids: [{ v: 2 }] })).toEqual({ v: 1, kids: [{ v: 2, kids: [] }] });
|
|
1377
|
+
invalid(tree, { v: 1.5 });
|
|
1378
|
+
});
|
|
1379
|
+
|
|
1380
|
+
test("sync refine returning a Promise rejects like the runtime", () => {
|
|
1381
|
+
const schema = z.string().refine((() => Promise.resolve(true)) as unknown as (v: string) => boolean);
|
|
1382
|
+
const aot = compile(schema);
|
|
1383
|
+
let runtimeErr: string | undefined;
|
|
1384
|
+
let compiledErr: string | undefined;
|
|
1385
|
+
try {
|
|
1386
|
+
schema.parse("x");
|
|
1387
|
+
} catch (e) {
|
|
1388
|
+
runtimeErr = (e as Error).name;
|
|
1389
|
+
}
|
|
1390
|
+
try {
|
|
1391
|
+
aot.parse("x");
|
|
1392
|
+
} catch (e) {
|
|
1393
|
+
compiledErr = (e as Error).name;
|
|
1394
|
+
}
|
|
1395
|
+
expect(runtimeErr).toBeDefined();
|
|
1396
|
+
expect(compiledErr).toBe(runtimeErr);
|
|
1397
|
+
});
|
|
1398
|
+
|
|
1399
|
+
test("literal-union Set optimization respects checks and multi-value literals", () => {
|
|
1400
|
+
const withCheck = z.union([z.literal("a").refine(() => false), z.literal("b")]);
|
|
1401
|
+
expectMatch(withCheck, "a"); // runtime rejects via refine; compiled must too
|
|
1402
|
+
expectMatch(withCheck, "b");
|
|
1403
|
+
|
|
1404
|
+
const multi = z.union([z.literal(["a", "b"]), z.literal("c")]);
|
|
1405
|
+
for (const v of ["a", "b", "c", "d"]) expectMatch(multi, v);
|
|
1406
|
+
});
|
|
1407
|
+
|
|
1408
|
+
test("xor and custom when-gated checks force runtime fallback", () => {
|
|
1409
|
+
expect(() => compile(z.xor([z.string(), z.number()]), { strict: true })).toThrow(ZodCompileUnsupportedError);
|
|
1410
|
+
// Multi-match must reject — verified through the object island.
|
|
1411
|
+
expectMatch(z.object({ v: z.xor([z.number(), z.number().int()]) }), { v: 2 });
|
|
1412
|
+
expectMatch(z.object({ v: z.xor([z.number(), z.number().int()]) }), { v: 1.5 });
|
|
1413
|
+
|
|
1414
|
+
const gated = z.number().gt(5);
|
|
1415
|
+
(gated._zod.def.checks![0]!._zod.def as { when?: unknown }).when = () => false;
|
|
1416
|
+
expect(() => compile(gated, { strict: true })).toThrow(ZodCompileUnsupportedError);
|
|
1417
|
+
expectMatch(z.object({ n: gated }), { n: 3 }); // runtime skips the gated check
|
|
1418
|
+
});
|
|
1419
|
+
|
|
1420
|
+
test("strict objects reject inherited enumerable keys like the runtime", () => {
|
|
1421
|
+
const schema = z.strictObject({ a: z.string() });
|
|
1422
|
+
expectMatch(schema, Object.assign(Object.create({ extra: 1 }), { a: "x" }));
|
|
1423
|
+
expectMatch(schema, { a: "x" });
|
|
1424
|
+
// Own __proto__ keys are skipped by the runtime, not unrecognized.
|
|
1425
|
+
expectMatch(schema, JSON.parse('{"a":"x","__proto__":{"polluted":true}}'));
|
|
1426
|
+
|
|
1427
|
+
const withOptional = z.strictObject({ a: z.string(), b: z.string().optional() });
|
|
1428
|
+
expectMatch(withOptional, Object.assign(Object.create({ extra: 1 }), { a: "x" }));
|
|
1429
|
+
expectMatch(withOptional, JSON.parse('{"a":"x","__proto__":{}}'));
|
|
1430
|
+
});
|
|
1431
|
+
|
|
1432
|
+
test("object output parity: key order, undefined keys, inherited keys, getters", () => {
|
|
1433
|
+
// Loose object: shape keys precede unknown keys in the output.
|
|
1434
|
+
const loose = z.looseObject({ a: z.string() });
|
|
1435
|
+
const looseIn = { x: 1, a: "q", y: 2 };
|
|
1436
|
+
expect(Object.keys(compile(loose).parse(looseIn) as object)).toEqual(Object.keys(loose.parse(looseIn)));
|
|
1437
|
+
|
|
1438
|
+
const cat = z.object({ a: z.string() }).catchall(z.number());
|
|
1439
|
+
const catIn = { x: 1, a: "q" };
|
|
1440
|
+
expect(Object.keys(compile(cat).parse(catIn) as object)).toEqual(Object.keys(cat.parse(catIn)));
|
|
1441
|
+
|
|
1442
|
+
// optin-optional/optout-required prop: absent key omitted, explicit undefined preserved (runtime handlePropertyResult rule).
|
|
1443
|
+
const tf = z.object({
|
|
1444
|
+
a: z
|
|
1445
|
+
.string()
|
|
1446
|
+
.optional()
|
|
1447
|
+
.transform((v) => v),
|
|
1448
|
+
});
|
|
1449
|
+
expect("a" in (compile(tf).parse({}) as object)).toBe(false);
|
|
1450
|
+
expect("a" in tf.parse({})).toBe(false);
|
|
1451
|
+
const opt = z.object({ a: z.string().optional() });
|
|
1452
|
+
expect(Object.keys(compile(opt).parse({ a: undefined }) as object)).toEqual(["a"]);
|
|
1453
|
+
|
|
1454
|
+
// Empty-shape loose: inherited enumerable keys included, own __proto__ dropped.
|
|
1455
|
+
const empty = z.looseObject({});
|
|
1456
|
+
const inherited = Object.assign(Object.create({ extra: 1 }), { own: 2 });
|
|
1457
|
+
expect(compile(empty).parse(inherited)).toEqual({ own: 2, extra: 1 });
|
|
1458
|
+
expect(empty.parse(inherited)).toEqual({ own: 2, extra: 1 });
|
|
1459
|
+
const protoIn = JSON.parse('{"__proto__":{"polluted":1},"x":2}');
|
|
1460
|
+
expect(Object.keys(compile(empty).parse(protoIn) as object)).toEqual(Object.keys(empty.parse(protoIn)));
|
|
1461
|
+
|
|
1462
|
+
// Getters are read exactly once, like the runtime.
|
|
1463
|
+
let reads = 0;
|
|
1464
|
+
const getterIn = {
|
|
1465
|
+
get a() {
|
|
1466
|
+
reads++;
|
|
1467
|
+
return "v";
|
|
1468
|
+
},
|
|
1469
|
+
};
|
|
1470
|
+
expect(compile(z.object({ a: z.string().min(1) })).parse(getterIn)).toEqual({ a: "v" });
|
|
1471
|
+
expect(reads).toBe(1);
|
|
1472
|
+
});
|
|
1473
|
+
|
|
1474
|
+
// === Error taxonomy ===
|
|
1475
|
+
|
|
1476
|
+
test("unsupported features throw ZodCompileUnsupportedError, not raw errors", () => {
|
|
1477
|
+
// __proto__ shape key: output object literal would set the prototype.
|
|
1478
|
+
expect(() => compile(z.object({ ["__proto__"]: z.string() }), { strict: true })).toThrow(ZodCompileUnsupportedError);
|
|
1479
|
+
// Exclusive unions need every branch's failure to be a real runtime failure.
|
|
1480
|
+
expect(() => compile(z.xor([z.object({ a: z.string() }), z.object({ b: z.string() })]), { strict: true })).toThrow(
|
|
1481
|
+
ZodCompileUnsupportedError
|
|
1482
|
+
);
|
|
1483
|
+
// NaN comparison bounds can't compile to a faithful comparison.
|
|
1484
|
+
expect(() => compile(z.number().gt(Number.NaN), { strict: true })).toThrow(ZodCompileUnsupportedError);
|
|
1485
|
+
// A zero bigint divisor has no compiled form: `x % 0n` throws.
|
|
1486
|
+
expect(() => compile(z.bigint().multipleOf(BigInt(0)), { strict: true })).toThrow(ZodCompileUnsupportedError);
|
|
1487
|
+
// Unsupported children still island inside containers.
|
|
1488
|
+
const aot = compile(z.object({ a: z.string(), x: z.xor([z.literal("p"), z.literal("q")]) }));
|
|
1489
|
+
expect(valid(aot, { a: "x", x: "p" })).toEqual({ a: "x", x: "p" });
|
|
1490
|
+
invalid(aot, { a: "x", x: "z" });
|
|
1491
|
+
});
|
|
1492
|
+
|
|
1493
|
+
test("record key schemas compile: formats, checks, numbers, transforms", () => {
|
|
1494
|
+
// A string format lives on the def rather than in `checks`, so an email key schema reads as a bare `z.string()` unless the key path looks for it.
|
|
1495
|
+
for (const [schema, inputs] of [
|
|
1496
|
+
[z.record(z.email(), z.number()), [{ "a@b.com": 1 }, { nope: 1 }, {}]],
|
|
1497
|
+
[z.record(z.string().min(2), z.number()), [{ ab: 1 }, { a: 1 }]],
|
|
1498
|
+
[z.record(z.string().regex(/^k_/), z.number()), [{ k_a: 1 }, { x: 1 }]],
|
|
1499
|
+
// Numeric keys arrive stringified; the runtime retries them as numbers.
|
|
1500
|
+
[z.record(z.number(), z.string()), [{ 1: "a" }, { "1.5": "a" }, { x: "a" }]],
|
|
1501
|
+
[z.record(z.templateLiteral(["id_", z.string()]), z.number()), [{ id_a: 1 }, { b: 1 }]],
|
|
1502
|
+
// The key schema picks the output key, not the input key.
|
|
1503
|
+
[
|
|
1504
|
+
z.record(
|
|
1505
|
+
z
|
|
1506
|
+
.string()
|
|
1507
|
+
.min(1)
|
|
1508
|
+
.overwrite((s: string) => s.toUpperCase()),
|
|
1509
|
+
z.number()
|
|
1510
|
+
),
|
|
1511
|
+
[{ ab: 1 }, { "": 1 }],
|
|
1512
|
+
],
|
|
1513
|
+
] as [z.ZodType, unknown[]][]) {
|
|
1514
|
+
for (const input of inputs) expectMatch(schema, input);
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
// Own __proto__ is skipped rather than validated, matching the runtime.
|
|
1518
|
+
expectMatch(z.record(z.email(), z.number()), JSON.parse('{"__proto__":{"p":1},"a@b.com":1}'));
|
|
1519
|
+
|
|
1520
|
+
// Coercion is modelled nowhere, so a coercing key schema is refused outright rather than compiled to the bare type test it would otherwise become.
|
|
1521
|
+
expect(() => compile(z.record(z.coerce.string(), z.number()), { strict: true })).toThrow(ZodCompileUnsupportedError);
|
|
1522
|
+
|
|
1523
|
+
// A loose record keeps a rejected key verbatim, copying its value across unvalidated instead of failing.
|
|
1524
|
+
for (const input of [{ "a@b.com": 1 }, { nope: 1 }, { "a@b.com": 1, nope: "raw" }, { "a@b.com": "bad" }]) {
|
|
1525
|
+
expectMatch(z.looseRecord(z.email(), z.number()), input);
|
|
1526
|
+
}
|
|
1527
|
+
});
|
|
1528
|
+
|
|
1529
|
+
test("date min/max bounds compile with runtime parity", () => {
|
|
1530
|
+
const schema = z.date().min(new Date("2024-01-01")).max(new Date("2025-01-01"));
|
|
1531
|
+
const aot = compile(schema);
|
|
1532
|
+
const inputs = [new Date("2024-06-15"), new Date("2024-01-01"), new Date("2023-12-31"), new Date("2025-01-02")];
|
|
1533
|
+
for (const input of inputs) expectMatch(schema, input);
|
|
1534
|
+
expect(valid(aot, inputs[0])).toEqual(inputs[0]);
|
|
1535
|
+
invalid(aot, inputs[2]);
|
|
1536
|
+
});
|
|
1537
|
+
|
|
1538
|
+
test("the compiled fallback builds the same Error-shaped error as the runtime", () => {
|
|
1539
|
+
const schema = z.object({ a: z.string(), b: z.number() });
|
|
1540
|
+
const aot = compile(schema);
|
|
1541
|
+
|
|
1542
|
+
// both fast closures fall back to the runtime on rejection, so the error is the runtime's
|
|
1543
|
+
const err = aot.safeParse({ a: 1, b: "x" }).error!;
|
|
1544
|
+
expect(err).toBeInstanceOf(Error);
|
|
1545
|
+
expect(err).toBeInstanceOf(z.core.$ZodError);
|
|
1546
|
+
expect(err.issues).toEqual(schema.safeParse({ a: 1, b: "x" }).error!.issues);
|
|
1547
|
+
|
|
1548
|
+
function callSite() {
|
|
1549
|
+
aot.parse({ a: 1, b: "x" });
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
let thrown: unknown;
|
|
1553
|
+
try {
|
|
1554
|
+
callSite();
|
|
1555
|
+
} catch (err) {
|
|
1556
|
+
thrown = err;
|
|
1557
|
+
}
|
|
1558
|
+
expect(thrown).toBeInstanceOf(Error);
|
|
1559
|
+
expect((thrown as Error).stack).toContain("callSite");
|
|
1560
|
+
});
|
|
1561
|
+
|
|
1562
|
+
// === Never throws ===
|
|
1563
|
+
|
|
1564
|
+
// Snapshot a parse outcome structurally, so a refused compile can be shown not to have disturbed it.
|
|
1565
|
+
function snap(schema: z.ZodType, value: unknown) {
|
|
1566
|
+
const r = schema.safeParse(value);
|
|
1567
|
+
return r.success ? { ok: true, data: r.data } : { ok: false, issues: r.error.issues };
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
// Every shape the compiler refuses, with inputs that exercise the pass, fail and fallback branches of each.
|
|
1571
|
+
function refusedCases(): [string, z.ZodType, unknown[]][] {
|
|
1572
|
+
const gated = z.number().gt(5);
|
|
1573
|
+
(gated._zod.def.checks![0]!._zod.def as { when?: unknown }).when = () => false;
|
|
1574
|
+
const tree: z.ZodType = z.lazy(() => z.object({ v: z.number().int(), kids: z.array(tree).default([]) }));
|
|
1575
|
+
|
|
1576
|
+
return [
|
|
1577
|
+
["cycle", tree, [{ v: 1, kids: [{ v: 2 }] }, { v: 1.5 }, "nope"]],
|
|
1578
|
+
["async refine", z.string().refine(async () => true), ["a", 1]],
|
|
1579
|
+
["async transform", z.string().transform(async (s) => s.length), ["a", 1]],
|
|
1580
|
+
["async custom", z.custom(async () => true), ["a"]],
|
|
1581
|
+
["xor", z.xor([z.string(), z.number()]), ["a", 1, true]],
|
|
1582
|
+
["coerce", z.coerce.number(), ["5", 5, Symbol("x")]],
|
|
1583
|
+
["catch callback", z.catch(z.string().min(5), (c) => `bad:${c.error.issues.length}`), ["hello world", "hi", 42]],
|
|
1584
|
+
["when-gated check", gated, [3, 9, "x"]],
|
|
1585
|
+
["__proto__ key", z.object({ ["__proto__"]: z.string() }), [{}, { a: 1 }]],
|
|
1586
|
+
["NaN bound", z.number().gt(Number.NaN), [1, "x"]],
|
|
1587
|
+
["zero bigint divisor", z.bigint().multipleOf(BigInt(0)), [BigInt(4), "x"]],
|
|
1588
|
+
["coercing record key", z.record(z.coerce.string(), z.number()), [{ a: 1 }, { a: "x" }]],
|
|
1589
|
+
];
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
test("compile hands back the original schema instead of throwing", () => {
|
|
1593
|
+
for (const [name, schema] of refusedCases()) {
|
|
1594
|
+
expect(() => compile(schema, { strict: true }), name).toThrow();
|
|
1595
|
+
// No wrapper and no clone: the uncompilable schema is its own fallback, exactly as global mode leaves it.
|
|
1596
|
+
expect(compile(schema), name).toBe(schema);
|
|
1597
|
+
}
|
|
1598
|
+
});
|
|
1599
|
+
|
|
1600
|
+
test("a refused compile leaves the schema parsing identically", () => {
|
|
1601
|
+
for (const [name, schema, inputs] of refusedCases()) {
|
|
1602
|
+
// Async schemas throw $ZodAsyncError out of a sync parse; that path is covered separately.
|
|
1603
|
+
if (name.startsWith("async")) continue;
|
|
1604
|
+
const before = inputs.map((i) => snap(schema, i));
|
|
1605
|
+
compile(schema);
|
|
1606
|
+
expect(
|
|
1607
|
+
inputs.map((i) => snap(schema, i)),
|
|
1608
|
+
name
|
|
1609
|
+
).toEqual(before);
|
|
1610
|
+
}
|
|
1611
|
+
});
|
|
1612
|
+
|
|
1613
|
+
test("a refused compile keeps cyclic input parsing", () => {
|
|
1614
|
+
const nodeSchema: z.ZodType = z.object({ value: z.string(), next: z.lazy(() => nodeSchema).optional() });
|
|
1615
|
+
const cyclic: any = { value: "a" };
|
|
1616
|
+
cyclic.next = cyclic;
|
|
1617
|
+
expect(() => compile(nodeSchema).parse(cyclic)).not.toThrow();
|
|
1618
|
+
});
|
|
1619
|
+
|
|
1620
|
+
test("a refused async compile parses async and rejects sync like the runtime", async () => {
|
|
1621
|
+
const schema = z.string().refine(async (s) => s.length > 1);
|
|
1622
|
+
const aot = compile(schema);
|
|
1623
|
+
expect(aot).toBe(schema);
|
|
1624
|
+
|
|
1625
|
+
await expect(aot.parseAsync("ab")).resolves.toBe("ab");
|
|
1626
|
+
const bad = await aot.safeParseAsync("a");
|
|
1627
|
+
expect(bad.success).toBe(false);
|
|
1628
|
+
expect(bad.error!.issues).toEqual((await schema.safeParseAsync("a")).error!.issues);
|
|
1629
|
+
expect(() => aot.parse("ab")).toThrow(z.core.$ZodAsyncError);
|
|
1630
|
+
});
|
|
1631
|
+
|
|
1632
|
+
test("strict is per-call, so a supported schema compiles either way", () => {
|
|
1633
|
+
const schema = z.object({ a: z.string(), b: z.number() });
|
|
1634
|
+
for (const aot of [compile(schema), compile(schema, { strict: true }), compile(schema, { strict: false })]) {
|
|
1635
|
+
expect(aot).not.toBe(schema);
|
|
1636
|
+
expect(valid(aot, { a: "x", b: 1 })).toEqual({ a: "x", b: 1 });
|
|
1637
|
+
invalid(aot, { a: 1, b: 1 });
|
|
1638
|
+
}
|
|
1639
|
+
});
|