@btc-embedded/cdk-extensions 0.10.1 → 0.10.4
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/.jsii +40 -40
- package/CHANGELOG.md +11 -0
- package/lib/constructs/EventPipe.js +1 -1
- package/lib/constructs/S3Bucket.js +1 -1
- package/lib/constructs/SecureRestApi.js +1 -1
- package/lib/constructs/SecureRestApiV2.js +1 -1
- package/lib/extensions/ApiGatewayExtension.js +1 -1
- package/lib/extensions/ApplicationLoadBalancerExtension.js +1 -1
- package/lib/extensions/ApplicationLoadBalancerExtensionV2.js +1 -1
- package/lib/extensions/CloudMapExtension.js +1 -1
- package/lib/extensions/DeactivatableServiceExtension.js +1 -1
- package/lib/extensions/DocumentDbAccessExtension.js +3 -6
- package/lib/extensions/DomainEventMessagingExtension.js +1 -1
- package/lib/extensions/ExtraContainerExtension.js +1 -1
- package/lib/extensions/HTTPApiExtension.js +1 -1
- package/lib/extensions/LogExtension.js +3 -4
- package/lib/extensions/ModifyContainerDefinitionExtension.js +1 -1
- package/lib/extensions/ModifyTaskDefinitionExtension.js +1 -1
- package/lib/extensions/OpenTelemetryExtension.js +1 -1
- package/lib/extensions/PostgresDbAccessExtension.js +3 -6
- package/lib/extensions/SharedVolumeExtension.js +5 -4
- package/lib/extensions/TcpKeepAliveExtension.js +3 -6
- package/lib/platform/ApiGateway.js +1 -1
- package/lib/platform/ApiGatewayV2.js +2 -2
- package/lib/platform/ApplicationLoadBalancer.js +1 -1
- package/lib/platform/ApplicationLoadBalancerV2.js +2 -2
- package/lib/platform/CognitoUserPool.js +2 -2
- package/lib/platform/DefaultUserPoolClients.js +1 -1
- package/lib/platform/DocumentDB.js +2 -2
- package/lib/platform/PrivateDnsNamespace.js +1 -1
- package/lib/platform/ResourceServer.js +1 -1
- package/lib/platform/Vpc.js +1 -1
- package/lib/utils/StackParameter.js +1 -1
- package/lib/utils/functions.d.ts +12 -2
- package/lib/utils/functions.js +23 -6
- package/node_modules/yaml/README.md +2 -0
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +2 -2
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +2 -4
- package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +1 -2
- package/node_modules/yaml/browser/dist/doc/anchors.js +1 -2
- package/node_modules/yaml/browser/dist/doc/createNode.js +1 -2
- package/node_modules/yaml/browser/dist/nodes/Alias.js +24 -11
- package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +1 -1
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +1 -0
- package/node_modules/yaml/browser/dist/parse/parser.js +14 -1
- package/node_modules/yaml/browser/dist/schema/tags.js +3 -3
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +3 -2
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +1 -1
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +1 -1
- package/node_modules/yaml/browser/dist/stringify/stringify.js +3 -4
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +3 -4
- package/node_modules/yaml/dist/cli.d.ts +1 -1
- package/node_modules/yaml/dist/cli.mjs +5 -3
- package/node_modules/yaml/dist/compose/compose-collection.js +2 -2
- package/node_modules/yaml/dist/compose/composer.js +1 -1
- package/node_modules/yaml/dist/compose/resolve-props.js +2 -4
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +1 -2
- package/node_modules/yaml/dist/doc/anchors.js +1 -2
- package/node_modules/yaml/dist/doc/createNode.js +1 -2
- package/node_modules/yaml/dist/log.js +1 -1
- package/node_modules/yaml/dist/nodes/Alias.d.ts +1 -1
- package/node_modules/yaml/dist/nodes/Alias.js +23 -10
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +1 -0
- package/node_modules/yaml/dist/nodes/toJS.d.ts +2 -0
- package/node_modules/yaml/dist/parse/parser.js +15 -2
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +4 -3
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +1 -1
- package/node_modules/yaml/dist/stringify/stringify.js +3 -4
- package/node_modules/yaml/dist/stringify/stringifyString.js +2 -3
- package/node_modules/yaml/package.json +2 -2
- package/node_modules/zod/LICENSE +1 -1
- package/node_modules/zod/README.md +105 -2971
- package/node_modules/zod/{lib/external.js → dist/cjs/index.js} +6 -6
- package/node_modules/zod/dist/cjs/package.json +3 -0
- package/node_modules/zod/{lib → dist/cjs/v3}/ZodError.js +3 -3
- package/node_modules/zod/{lib → dist/cjs/v3}/benchmarks/datetime.js +1 -1
- package/node_modules/zod/{lib → dist/cjs/v3}/benchmarks/discriminatedUnion.js +15 -15
- package/node_modules/zod/dist/cjs/v3/benchmarks/index.js +59 -0
- package/node_modules/zod/{lib → dist/cjs/v3}/benchmarks/object.js +11 -11
- package/node_modules/zod/{lib → dist/cjs/v3}/benchmarks/primitives.js +22 -33
- package/node_modules/zod/{lib → dist/cjs/v3}/benchmarks/realworld.js +12 -12
- package/node_modules/zod/{lib → dist/cjs/v3}/benchmarks/string.js +5 -5
- package/node_modules/zod/{lib → dist/cjs/v3}/benchmarks/union.js +15 -15
- package/node_modules/zod/{lib → dist/cjs/v3}/errors.js +6 -6
- package/node_modules/zod/dist/cjs/v3/external.js +22 -0
- package/node_modules/zod/{lib → dist/cjs/v3}/helpers/errorUtil.js +2 -1
- package/node_modules/zod/{lib → dist/cjs/v3}/helpers/parseUtil.js +7 -8
- package/node_modules/zod/{lib → dist/cjs/v3}/helpers/util.js +5 -10
- package/node_modules/zod/{lib → dist/cjs/v3}/index.js +2 -2
- package/node_modules/zod/{lib → dist/cjs/v3}/locales/en.js +30 -50
- package/node_modules/zod/{lib → dist/cjs/v3}/types.js +466 -539
- package/node_modules/zod/dist/cjs/v4/classic/checks.js +32 -0
- package/node_modules/zod/dist/cjs/v4/classic/coerce.js +47 -0
- package/node_modules/zod/dist/cjs/v4/classic/compat.js +63 -0
- package/node_modules/zod/dist/cjs/v4/classic/errors.js +67 -0
- package/node_modules/zod/dist/cjs/v4/classic/external.js +69 -0
- package/node_modules/zod/dist/cjs/v4/classic/index.js +33 -0
- package/node_modules/zod/dist/cjs/v4/classic/iso.js +60 -0
- package/node_modules/zod/dist/cjs/v4/classic/parse.js +32 -0
- package/node_modules/zod/dist/cjs/v4/classic/schemas.js +1100 -0
- package/node_modules/zod/dist/cjs/v4/core/api.js +1021 -0
- package/node_modules/zod/dist/cjs/v4/core/checks.js +580 -0
- package/node_modules/zod/dist/cjs/v4/core/config.js +10 -0
- package/node_modules/zod/dist/cjs/v4/core/core.js +63 -0
- package/node_modules/zod/dist/cjs/v4/core/doc.js +39 -0
- package/node_modules/zod/dist/cjs/v4/core/errors.js +222 -0
- package/node_modules/zod/dist/cjs/v4/core/function.js +102 -0
- package/node_modules/zod/dist/cjs/v4/core/index.js +44 -0
- package/node_modules/zod/dist/cjs/v4/core/json-schema.js +2 -0
- package/node_modules/zod/dist/cjs/v4/core/parse.js +87 -0
- package/node_modules/zod/dist/cjs/v4/core/regexes.js +103 -0
- package/node_modules/zod/dist/cjs/v4/core/registries.js +47 -0
- package/node_modules/zod/dist/cjs/v4/core/schemas.js +1719 -0
- package/node_modules/zod/dist/cjs/v4/core/standard-schema.js +2 -0
- package/node_modules/zod/dist/cjs/v4/core/to-json-schema.js +833 -0
- package/node_modules/zod/dist/cjs/v4/core/util.js +537 -0
- package/node_modules/zod/dist/cjs/v4/core/versions.js +8 -0
- package/node_modules/zod/dist/cjs/v4/core/zsf.js +172 -0
- package/node_modules/zod/dist/cjs/v4/index.js +22 -0
- package/node_modules/zod/dist/cjs/v4/locales/ar.js +142 -0
- package/node_modules/zod/dist/cjs/v4/locales/az.js +141 -0
- package/node_modules/zod/dist/cjs/v4/locales/be.js +190 -0
- package/node_modules/zod/dist/cjs/v4/locales/ca.js +144 -0
- package/node_modules/zod/dist/cjs/v4/locales/cs.js +161 -0
- package/node_modules/zod/dist/cjs/v4/locales/de.js +142 -0
- package/node_modules/zod/dist/cjs/v4/locales/en.js +145 -0
- package/node_modules/zod/dist/cjs/v4/locales/es.js +143 -0
- package/node_modules/zod/dist/cjs/v4/locales/fa.js +148 -0
- package/node_modules/zod/dist/cjs/v4/locales/fi.js +148 -0
- package/node_modules/zod/dist/cjs/v4/locales/fr-CA.js +143 -0
- package/node_modules/zod/dist/cjs/v4/locales/fr.js +142 -0
- package/node_modules/zod/dist/cjs/v4/locales/he.js +143 -0
- package/node_modules/zod/dist/cjs/v4/locales/hu.js +143 -0
- package/node_modules/zod/dist/cjs/v4/locales/id.js +142 -0
- package/node_modules/zod/dist/cjs/v4/locales/index.js +82 -0
- package/node_modules/zod/dist/cjs/v4/locales/it.js +143 -0
- package/node_modules/zod/dist/cjs/v4/locales/ja.js +141 -0
- package/node_modules/zod/dist/cjs/v4/locales/kh.js +143 -0
- package/node_modules/zod/dist/cjs/v4/locales/ko.js +147 -0
- package/node_modules/zod/dist/cjs/v4/locales/mk.js +144 -0
- package/node_modules/zod/dist/cjs/v4/locales/ms.js +142 -0
- package/node_modules/zod/dist/cjs/v4/locales/nl.js +143 -0
- package/node_modules/zod/dist/cjs/v4/locales/no.js +142 -0
- package/node_modules/zod/dist/cjs/v4/locales/ota.js +143 -0
- package/node_modules/zod/dist/cjs/v4/locales/pl.js +143 -0
- package/node_modules/zod/dist/cjs/v4/locales/ps.js +148 -0
- package/node_modules/zod/dist/cjs/v4/locales/pt.js +142 -0
- package/node_modules/zod/dist/cjs/v4/locales/ru.js +190 -0
- package/node_modules/zod/dist/cjs/v4/locales/sl.js +143 -0
- package/node_modules/zod/dist/cjs/v4/locales/sv.js +144 -0
- package/node_modules/zod/dist/cjs/v4/locales/ta.js +143 -0
- package/node_modules/zod/dist/cjs/v4/locales/th.js +143 -0
- package/node_modules/zod/dist/cjs/v4/locales/tr.js +143 -0
- package/node_modules/zod/dist/cjs/v4/locales/ua.js +143 -0
- package/node_modules/zod/dist/cjs/v4/locales/ur.js +143 -0
- package/node_modules/zod/dist/cjs/v4/locales/vi.js +142 -0
- package/node_modules/zod/dist/cjs/v4/locales/zh-CN.js +142 -0
- package/node_modules/zod/dist/cjs/v4/locales/zh-TW.js +143 -0
- package/node_modules/zod/dist/cjs/v4/mini/checks.js +34 -0
- package/node_modules/zod/dist/cjs/v4/mini/coerce.js +47 -0
- package/node_modules/zod/dist/cjs/v4/mini/external.js +61 -0
- package/node_modules/zod/dist/cjs/v4/mini/index.js +32 -0
- package/node_modules/zod/dist/cjs/v4/mini/iso.js +60 -0
- package/node_modules/zod/dist/cjs/v4/mini/parse.js +8 -0
- package/node_modules/zod/dist/cjs/v4/mini/schemas.js +831 -0
- package/node_modules/zod/dist/esm/index.js +3 -0
- package/node_modules/zod/dist/esm/package.json +3 -0
- package/node_modules/zod/dist/esm/v3/ZodError.js +132 -0
- package/node_modules/zod/dist/esm/v3/benchmarks/datetime.js +49 -0
- package/node_modules/zod/dist/esm/v3/benchmarks/discriminatedUnion.js +74 -0
- package/node_modules/zod/dist/esm/v3/benchmarks/index.js +54 -0
- package/node_modules/zod/dist/esm/v3/benchmarks/ipv4.js +49 -0
- package/node_modules/zod/dist/esm/v3/benchmarks/object.js +65 -0
- package/node_modules/zod/dist/esm/v3/benchmarks/primitives.js +154 -0
- package/node_modules/zod/dist/esm/v3/benchmarks/realworld.js +51 -0
- package/node_modules/zod/dist/esm/v3/benchmarks/string.js +50 -0
- package/node_modules/zod/dist/esm/v3/benchmarks/union.js +74 -0
- package/node_modules/zod/dist/esm/v3/errors.js +9 -0
- package/node_modules/zod/dist/esm/v3/external.js +6 -0
- package/node_modules/zod/dist/esm/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/dist/esm/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/dist/esm/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/dist/esm/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/dist/esm/v3/helpers/util.js +133 -0
- package/node_modules/zod/dist/esm/v3/index.js +4 -0
- package/node_modules/zod/dist/esm/v3/locales/en.js +107 -0
- package/node_modules/zod/dist/esm/v3/standard-schema.js +1 -0
- package/node_modules/zod/dist/esm/v3/tests/Mocker.js +53 -0
- package/node_modules/zod/{lib/index.mjs → dist/esm/v3/types.js} +148 -862
- package/node_modules/zod/dist/esm/v4/classic/checks.js +1 -0
- package/node_modules/zod/dist/esm/v4/classic/coerce.js +17 -0
- package/node_modules/zod/dist/esm/v4/classic/compat.js +33 -0
- package/node_modules/zod/dist/esm/v4/classic/errors.js +41 -0
- package/node_modules/zod/dist/esm/v4/classic/external.js +18 -0
- package/node_modules/zod/dist/esm/v4/classic/index.js +4 -0
- package/node_modules/zod/dist/esm/v4/classic/iso.js +30 -0
- package/node_modules/zod/dist/esm/v4/classic/parse.js +6 -0
- package/node_modules/zod/dist/esm/v4/classic/schemas.js +998 -0
- package/node_modules/zod/dist/esm/v4/core/api.js +889 -0
- package/node_modules/zod/dist/esm/v4/core/checks.js +554 -0
- package/node_modules/zod/dist/esm/v4/core/config.js +6 -0
- package/node_modules/zod/dist/esm/v4/core/core.js +57 -0
- package/node_modules/zod/dist/esm/v4/core/doc.js +35 -0
- package/node_modules/zod/dist/esm/v4/core/errors.js +191 -0
- package/node_modules/zod/dist/esm/v4/core/function.js +75 -0
- package/node_modules/zod/dist/esm/v4/core/index.js +15 -0
- package/node_modules/zod/dist/esm/v4/core/json-schema.js +1 -0
- package/node_modules/zod/dist/esm/v4/core/parse.js +57 -0
- package/node_modules/zod/dist/esm/v4/core/regexes.js +95 -0
- package/node_modules/zod/dist/esm/v4/core/registries.js +42 -0
- package/node_modules/zod/dist/esm/v4/core/schemas.js +1688 -0
- package/node_modules/zod/dist/esm/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/dist/esm/v4/core/to-json-schema.js +828 -0
- package/node_modules/zod/dist/esm/v4/core/util.js +491 -0
- package/node_modules/zod/dist/esm/v4/core/versions.js +5 -0
- package/node_modules/zod/dist/esm/v4/core/zsf.js +171 -0
- package/node_modules/zod/dist/esm/v4/index.js +3 -0
- package/node_modules/zod/dist/esm/v4/locales/ar.js +116 -0
- package/node_modules/zod/dist/esm/v4/locales/az.js +115 -0
- package/node_modules/zod/dist/esm/v4/locales/be.js +164 -0
- package/node_modules/zod/dist/esm/v4/locales/ca.js +118 -0
- package/node_modules/zod/dist/esm/v4/locales/cs.js +135 -0
- package/node_modules/zod/dist/esm/v4/locales/de.js +116 -0
- package/node_modules/zod/dist/esm/v4/locales/en.js +117 -0
- package/node_modules/zod/dist/esm/v4/locales/es.js +117 -0
- package/node_modules/zod/dist/esm/v4/locales/fa.js +122 -0
- package/node_modules/zod/dist/esm/v4/locales/fi.js +122 -0
- package/node_modules/zod/dist/esm/v4/locales/fr-CA.js +117 -0
- package/node_modules/zod/dist/esm/v4/locales/fr.js +116 -0
- package/node_modules/zod/dist/esm/v4/locales/he.js +117 -0
- package/node_modules/zod/dist/esm/v4/locales/hu.js +117 -0
- package/node_modules/zod/dist/esm/v4/locales/id.js +116 -0
- package/node_modules/zod/dist/esm/v4/locales/index.js +38 -0
- package/node_modules/zod/dist/esm/v4/locales/it.js +117 -0
- package/node_modules/zod/dist/esm/v4/locales/ja.js +115 -0
- package/node_modules/zod/dist/esm/v4/locales/kh.js +117 -0
- package/node_modules/zod/dist/esm/v4/locales/ko.js +121 -0
- package/node_modules/zod/dist/esm/v4/locales/mk.js +118 -0
- package/node_modules/zod/dist/esm/v4/locales/ms.js +116 -0
- package/node_modules/zod/dist/esm/v4/locales/nl.js +117 -0
- package/node_modules/zod/dist/esm/v4/locales/no.js +116 -0
- package/node_modules/zod/dist/esm/v4/locales/ota.js +117 -0
- package/node_modules/zod/dist/esm/v4/locales/pl.js +117 -0
- package/node_modules/zod/dist/esm/v4/locales/ps.js +122 -0
- package/node_modules/zod/dist/esm/v4/locales/pt.js +116 -0
- package/node_modules/zod/dist/esm/v4/locales/ru.js +164 -0
- package/node_modules/zod/dist/esm/v4/locales/sl.js +117 -0
- package/node_modules/zod/dist/esm/v4/locales/sv.js +118 -0
- package/node_modules/zod/dist/esm/v4/locales/ta.js +117 -0
- package/node_modules/zod/dist/esm/v4/locales/th.js +117 -0
- package/node_modules/zod/dist/esm/v4/locales/tr.js +115 -0
- package/node_modules/zod/dist/esm/v4/locales/ua.js +117 -0
- package/node_modules/zod/dist/esm/v4/locales/ur.js +117 -0
- package/node_modules/zod/dist/esm/v4/locales/vi.js +116 -0
- package/node_modules/zod/dist/esm/v4/locales/zh-CN.js +116 -0
- package/node_modules/zod/dist/esm/v4/locales/zh-TW.js +117 -0
- package/node_modules/zod/dist/esm/v4/mini/checks.js +1 -0
- package/node_modules/zod/dist/esm/v4/mini/coerce.js +17 -0
- package/node_modules/zod/dist/esm/v4/mini/external.js +13 -0
- package/node_modules/zod/dist/esm/v4/mini/index.js +3 -0
- package/node_modules/zod/dist/esm/v4/mini/iso.js +30 -0
- package/node_modules/zod/dist/esm/v4/mini/parse.js +1 -0
- package/node_modules/zod/dist/esm/v4/mini/schemas.js +725 -0
- package/node_modules/zod/dist/types/index.d.ts +3 -0
- package/node_modules/zod/dist/types/package.json +3 -0
- package/node_modules/zod/{lib → dist/types/v3}/ZodError.d.ts +7 -7
- package/node_modules/zod/dist/types/v3/benchmarks/index.d.ts +1 -0
- package/node_modules/zod/{lib → dist/types/v3}/errors.d.ts +2 -2
- package/node_modules/zod/dist/types/v3/external.d.ts +6 -0
- package/node_modules/zod/{lib → dist/types/v3}/helpers/errorUtil.d.ts +1 -1
- package/node_modules/zod/{lib → dist/types/v3}/helpers/parseUtil.d.ts +4 -4
- package/node_modules/zod/{lib → dist/types/v3}/helpers/partialUtil.d.ts +1 -1
- package/node_modules/zod/{lib → dist/types/v3}/helpers/util.d.ts +14 -11
- package/node_modules/zod/dist/types/v3/index.d.ts +4 -0
- package/node_modules/zod/{lib → dist/types/v3}/locales/en.d.ts +1 -1
- package/node_modules/zod/{lib/__tests__ → dist/types/v3/tests}/Mocker.d.ts +6 -6
- package/node_modules/zod/{lib → dist/types/v3}/types.d.ts +120 -151
- package/node_modules/zod/dist/types/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/dist/types/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/dist/types/v4/classic/compat.d.ts +48 -0
- package/node_modules/zod/dist/types/v4/classic/errors.d.ts +30 -0
- package/node_modules/zod/dist/types/v4/classic/external.d.ts +13 -0
- package/node_modules/zod/dist/types/v4/classic/index.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/classic/iso.d.ts +22 -0
- package/node_modules/zod/dist/types/v4/classic/parse.d.ts +23 -0
- package/node_modules/zod/dist/types/v4/classic/schemas.d.ts +624 -0
- package/node_modules/zod/dist/types/v4/core/api.d.ts +281 -0
- package/node_modules/zod/dist/types/v4/core/checks.d.ts +277 -0
- package/node_modules/zod/dist/types/v4/core/config.d.ts +9 -0
- package/node_modules/zod/dist/types/v4/core/core.d.ts +47 -0
- package/node_modules/zod/dist/types/v4/core/doc.d.ts +14 -0
- package/node_modules/zod/dist/types/v4/core/errors.d.ts +204 -0
- package/node_modules/zod/dist/types/v4/core/function.d.ts +52 -0
- package/node_modules/zod/dist/types/v4/core/index.d.ts +15 -0
- package/node_modules/zod/dist/types/v4/core/json-schema.d.ts +87 -0
- package/node_modules/zod/dist/types/v4/core/parse.d.ts +25 -0
- package/node_modules/zod/dist/types/v4/core/regexes.d.ts +62 -0
- package/node_modules/zod/dist/types/v4/core/registries.d.ts +39 -0
- package/node_modules/zod/dist/types/v4/core/schemas.d.ts +1005 -0
- package/node_modules/zod/dist/types/v4/core/standard-schema.d.ts +55 -0
- package/node_modules/zod/dist/types/v4/core/to-json-schema.d.ts +84 -0
- package/node_modules/zod/dist/types/v4/core/util.d.ts +183 -0
- package/node_modules/zod/dist/types/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/dist/types/v4/core/zsf.d.ts +91 -0
- package/node_modules/zod/dist/types/v4/index.d.ts +3 -0
- package/node_modules/zod/dist/types/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/en.d.ts +5 -0
- package/node_modules/zod/dist/types/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/index.d.ts +38 -0
- package/node_modules/zod/dist/types/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/kh.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/tr.d.ts +5 -0
- package/node_modules/zod/dist/types/v4/locales/ua.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/dist/types/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/dist/types/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/dist/types/v4/mini/external.d.ts +11 -0
- package/node_modules/zod/dist/types/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/dist/types/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/dist/types/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/dist/types/v4/mini/schemas.d.ts +351 -0
- package/node_modules/zod/package.json +105 -107
- package/node_modules/zod/v3/index.d.ts +3 -0
- package/node_modules/zod/v3/index.js +1 -0
- package/node_modules/zod/v4/core/index.d.ts +1 -0
- package/node_modules/zod/v4/core/index.js +1 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +1 -0
- package/node_modules/zod/v4/locales/en.d.ts +2 -0
- package/node_modules/zod/v4/locales/en.js +2 -0
- package/node_modules/zod/v4/locales/index.d.ts +1 -0
- package/node_modules/zod/v4/locales/index.js +1 -0
- package/node_modules/zod/v4-mini/index.d.ts +1 -0
- package/node_modules/zod/v4-mini/index.js +1 -0
- package/package.json +16 -16
- package/node_modules/zod/index.d.ts +0 -2
- package/node_modules/zod/lib/benchmarks/index.js +0 -59
- package/node_modules/zod/lib/external.d.ts +0 -6
- package/node_modules/zod/lib/index.d.ts +0 -4
- package/node_modules/zod/lib/index.umd.js +0 -4520
- /package/node_modules/zod/{lib → dist/cjs/v3}/benchmarks/ipv4.js +0 -0
- /package/node_modules/zod/{lib → dist/cjs/v3}/helpers/enumUtil.js +0 -0
- /package/node_modules/zod/{lib → dist/cjs/v3}/helpers/partialUtil.js +0 -0
- /package/node_modules/zod/{lib → dist/cjs/v3}/helpers/typeAliases.js +0 -0
- /package/node_modules/zod/{lib → dist/cjs/v3}/standard-schema.js +0 -0
- /package/node_modules/zod/{lib/__tests__ → dist/cjs/v3/tests}/Mocker.js +0 -0
- /package/node_modules/zod/{lib/benchmarks/index.d.ts → dist/esm/v3/helpers/enumUtil.js} +0 -0
- /package/node_modules/zod/{lib → dist/types/v3}/benchmarks/datetime.d.ts +0 -0
- /package/node_modules/zod/{lib → dist/types/v3}/benchmarks/discriminatedUnion.d.ts +0 -0
- /package/node_modules/zod/{lib → dist/types/v3}/benchmarks/ipv4.d.ts +0 -0
- /package/node_modules/zod/{lib → dist/types/v3}/benchmarks/object.d.ts +0 -0
- /package/node_modules/zod/{lib → dist/types/v3}/benchmarks/primitives.d.ts +0 -0
- /package/node_modules/zod/{lib → dist/types/v3}/benchmarks/realworld.d.ts +0 -0
- /package/node_modules/zod/{lib → dist/types/v3}/benchmarks/string.d.ts +0 -0
- /package/node_modules/zod/{lib → dist/types/v3}/benchmarks/union.d.ts +0 -0
- /package/node_modules/zod/{lib → dist/types/v3}/helpers/enumUtil.d.ts +0 -0
- /package/node_modules/zod/{lib → dist/types/v3}/helpers/typeAliases.d.ts +0 -0
- /package/node_modules/zod/{lib → dist/types/v3}/standard-schema.d.ts +0 -0
|
@@ -0,0 +1,554 @@
|
|
|
1
|
+
// import { $ZodType } from "./schemas.js";
|
|
2
|
+
import * as core from "./core.js";
|
|
3
|
+
import * as regexes from "./regexes.js";
|
|
4
|
+
import * as util from "./util.js";
|
|
5
|
+
export const $ZodCheck = /*@__PURE__*/ core.$constructor("$ZodCheck", (inst, def) => {
|
|
6
|
+
var _a;
|
|
7
|
+
inst._zod ?? (inst._zod = {});
|
|
8
|
+
inst._zod.def = def;
|
|
9
|
+
(_a = inst._zod).onattach ?? (_a.onattach = []);
|
|
10
|
+
});
|
|
11
|
+
const numericOriginMap = {
|
|
12
|
+
number: "number",
|
|
13
|
+
bigint: "bigint",
|
|
14
|
+
object: "date",
|
|
15
|
+
};
|
|
16
|
+
export const $ZodCheckLessThan = /*@__PURE__*/ core.$constructor("$ZodCheckLessThan", (inst, def) => {
|
|
17
|
+
$ZodCheck.init(inst, def);
|
|
18
|
+
const origin = numericOriginMap[typeof def.value];
|
|
19
|
+
inst._zod.onattach.push((inst) => {
|
|
20
|
+
const bag = inst._zod.bag;
|
|
21
|
+
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
22
|
+
if (def.value < curr) {
|
|
23
|
+
if (def.inclusive)
|
|
24
|
+
bag.maximum = def.value;
|
|
25
|
+
else
|
|
26
|
+
bag.exclusiveMaximum = def.value;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
inst._zod.check = (payload) => {
|
|
30
|
+
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
payload.issues.push({
|
|
34
|
+
origin,
|
|
35
|
+
code: "too_big",
|
|
36
|
+
maximum: def.value,
|
|
37
|
+
input: payload.value,
|
|
38
|
+
inclusive: def.inclusive,
|
|
39
|
+
inst,
|
|
40
|
+
continue: !def.abort,
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
export const $ZodCheckGreaterThan = /*@__PURE__*/ core.$constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
45
|
+
$ZodCheck.init(inst, def);
|
|
46
|
+
const origin = numericOriginMap[typeof def.value];
|
|
47
|
+
inst._zod.onattach.push((inst) => {
|
|
48
|
+
const bag = inst._zod.bag;
|
|
49
|
+
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
50
|
+
if (def.value > curr) {
|
|
51
|
+
if (def.inclusive)
|
|
52
|
+
bag.minimum = def.value;
|
|
53
|
+
else
|
|
54
|
+
bag.exclusiveMinimum = def.value;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
inst._zod.check = (payload) => {
|
|
58
|
+
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
payload.issues.push({
|
|
62
|
+
origin: origin,
|
|
63
|
+
code: "too_small",
|
|
64
|
+
minimum: def.value,
|
|
65
|
+
input: payload.value,
|
|
66
|
+
inclusive: def.inclusive,
|
|
67
|
+
inst,
|
|
68
|
+
continue: !def.abort,
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
export const $ZodCheckMultipleOf =
|
|
73
|
+
/*@__PURE__*/ core.$constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
74
|
+
$ZodCheck.init(inst, def);
|
|
75
|
+
inst._zod.onattach.push((inst) => {
|
|
76
|
+
var _a;
|
|
77
|
+
(_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
|
|
78
|
+
});
|
|
79
|
+
inst._zod.check = (payload) => {
|
|
80
|
+
if (typeof payload.value !== typeof def.value)
|
|
81
|
+
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
82
|
+
const isMultiple = typeof payload.value === "bigint"
|
|
83
|
+
? payload.value % def.value === BigInt(0)
|
|
84
|
+
: util.floatSafeRemainder(payload.value, def.value) === 0;
|
|
85
|
+
if (isMultiple)
|
|
86
|
+
return;
|
|
87
|
+
payload.issues.push({
|
|
88
|
+
origin: typeof payload.value,
|
|
89
|
+
code: "not_multiple_of",
|
|
90
|
+
divisor: def.value,
|
|
91
|
+
input: payload.value,
|
|
92
|
+
inst,
|
|
93
|
+
continue: !def.abort,
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
export const $ZodCheckNumberFormat = /*@__PURE__*/ core.$constructor("$ZodCheckNumberFormat", (inst, def) => {
|
|
98
|
+
$ZodCheck.init(inst, def); // no format checks
|
|
99
|
+
def.format = def.format || "float64";
|
|
100
|
+
const isInt = def.format?.includes("int");
|
|
101
|
+
const origin = isInt ? "int" : "number";
|
|
102
|
+
const [minimum, maximum] = util.NUMBER_FORMAT_RANGES[def.format];
|
|
103
|
+
inst._zod.onattach.push((inst) => {
|
|
104
|
+
const bag = inst._zod.bag;
|
|
105
|
+
bag.format = def.format;
|
|
106
|
+
bag.minimum = minimum;
|
|
107
|
+
bag.maximum = maximum;
|
|
108
|
+
if (isInt)
|
|
109
|
+
bag.pattern = regexes.integer;
|
|
110
|
+
});
|
|
111
|
+
inst._zod.check = (payload) => {
|
|
112
|
+
const input = payload.value;
|
|
113
|
+
if (isInt) {
|
|
114
|
+
if (!Number.isInteger(input)) {
|
|
115
|
+
// invalid_format issue
|
|
116
|
+
// payload.issues.push({
|
|
117
|
+
// expected: def.format,
|
|
118
|
+
// format: def.format,
|
|
119
|
+
// code: "invalid_format",
|
|
120
|
+
// input,
|
|
121
|
+
// inst,
|
|
122
|
+
// });
|
|
123
|
+
// invalid_type issue
|
|
124
|
+
payload.issues.push({
|
|
125
|
+
expected: origin,
|
|
126
|
+
format: def.format,
|
|
127
|
+
code: "invalid_type",
|
|
128
|
+
input,
|
|
129
|
+
inst,
|
|
130
|
+
});
|
|
131
|
+
return;
|
|
132
|
+
// not_multiple_of issue
|
|
133
|
+
// payload.issues.push({
|
|
134
|
+
// code: "not_multiple_of",
|
|
135
|
+
// origin: "number",
|
|
136
|
+
// input,
|
|
137
|
+
// inst,
|
|
138
|
+
// divisor: 1,
|
|
139
|
+
// });
|
|
140
|
+
}
|
|
141
|
+
if (!Number.isSafeInteger(input)) {
|
|
142
|
+
if (input > 0) {
|
|
143
|
+
// too_big
|
|
144
|
+
payload.issues.push({
|
|
145
|
+
input,
|
|
146
|
+
code: "too_big",
|
|
147
|
+
maximum: Number.MAX_SAFE_INTEGER,
|
|
148
|
+
note: "Integers must be within the safe integer range.",
|
|
149
|
+
inst,
|
|
150
|
+
origin,
|
|
151
|
+
continue: !def.abort,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
// too_small
|
|
156
|
+
payload.issues.push({
|
|
157
|
+
input,
|
|
158
|
+
code: "too_small",
|
|
159
|
+
minimum: Number.MIN_SAFE_INTEGER,
|
|
160
|
+
note: "Integers must be within the safe integer range.",
|
|
161
|
+
inst,
|
|
162
|
+
origin,
|
|
163
|
+
continue: !def.abort,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (input < minimum) {
|
|
170
|
+
payload.issues.push({
|
|
171
|
+
origin: "number",
|
|
172
|
+
input,
|
|
173
|
+
code: "too_small",
|
|
174
|
+
minimum,
|
|
175
|
+
inclusive: true,
|
|
176
|
+
inst,
|
|
177
|
+
continue: !def.abort,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
if (input > maximum) {
|
|
181
|
+
payload.issues.push({
|
|
182
|
+
origin: "number",
|
|
183
|
+
input,
|
|
184
|
+
code: "too_big",
|
|
185
|
+
maximum,
|
|
186
|
+
inst,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
});
|
|
191
|
+
export const $ZodCheckBigIntFormat = /*@__PURE__*/ core.$constructor("$ZodCheckBigIntFormat", (inst, def) => {
|
|
192
|
+
$ZodCheck.init(inst, def); // no format checks
|
|
193
|
+
const [minimum, maximum] = util.BIGINT_FORMAT_RANGES[def.format];
|
|
194
|
+
inst._zod.onattach.push((inst) => {
|
|
195
|
+
const bag = inst._zod.bag;
|
|
196
|
+
bag.format = def.format;
|
|
197
|
+
bag.minimum = minimum;
|
|
198
|
+
bag.maximum = maximum;
|
|
199
|
+
});
|
|
200
|
+
inst._zod.check = (payload) => {
|
|
201
|
+
const input = payload.value;
|
|
202
|
+
if (input < minimum) {
|
|
203
|
+
payload.issues.push({
|
|
204
|
+
origin: "bigint",
|
|
205
|
+
input,
|
|
206
|
+
code: "too_small",
|
|
207
|
+
minimum: minimum,
|
|
208
|
+
inclusive: true,
|
|
209
|
+
inst,
|
|
210
|
+
continue: !def.abort,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
if (input > maximum) {
|
|
214
|
+
payload.issues.push({
|
|
215
|
+
origin: "bigint",
|
|
216
|
+
input,
|
|
217
|
+
code: "too_big",
|
|
218
|
+
maximum,
|
|
219
|
+
inst,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
});
|
|
224
|
+
export const $ZodCheckMaxSize = /*@__PURE__*/ core.$constructor("$ZodCheckMaxSize", (inst, def) => {
|
|
225
|
+
$ZodCheck.init(inst, def);
|
|
226
|
+
inst._zod.when = (payload) => {
|
|
227
|
+
const val = payload.value;
|
|
228
|
+
return !util.nullish(val) && val.size !== undefined;
|
|
229
|
+
};
|
|
230
|
+
inst._zod.onattach.push((inst) => {
|
|
231
|
+
const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);
|
|
232
|
+
if (def.maximum < curr)
|
|
233
|
+
inst._zod.bag.maximum = def.maximum;
|
|
234
|
+
});
|
|
235
|
+
inst._zod.check = (payload) => {
|
|
236
|
+
const input = payload.value;
|
|
237
|
+
const size = input.size;
|
|
238
|
+
if (size <= def.maximum)
|
|
239
|
+
return;
|
|
240
|
+
payload.issues.push({
|
|
241
|
+
origin: util.getSizableOrigin(input),
|
|
242
|
+
code: "too_big",
|
|
243
|
+
maximum: def.maximum,
|
|
244
|
+
input,
|
|
245
|
+
inst,
|
|
246
|
+
continue: !def.abort,
|
|
247
|
+
});
|
|
248
|
+
};
|
|
249
|
+
});
|
|
250
|
+
export const $ZodCheckMinSize = /*@__PURE__*/ core.$constructor("$ZodCheckMinSize", (inst, def) => {
|
|
251
|
+
$ZodCheck.init(inst, def);
|
|
252
|
+
inst._zod.when = (payload) => {
|
|
253
|
+
const val = payload.value;
|
|
254
|
+
return !util.nullish(val) && val.size !== undefined;
|
|
255
|
+
};
|
|
256
|
+
inst._zod.onattach.push((inst) => {
|
|
257
|
+
const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);
|
|
258
|
+
if (def.minimum > curr)
|
|
259
|
+
inst._zod.bag.minimum = def.minimum;
|
|
260
|
+
});
|
|
261
|
+
inst._zod.check = (payload) => {
|
|
262
|
+
const input = payload.value;
|
|
263
|
+
const size = input.size;
|
|
264
|
+
if (size >= def.minimum)
|
|
265
|
+
return;
|
|
266
|
+
payload.issues.push({
|
|
267
|
+
origin: util.getSizableOrigin(input),
|
|
268
|
+
code: "too_small",
|
|
269
|
+
minimum: def.minimum,
|
|
270
|
+
input,
|
|
271
|
+
inst,
|
|
272
|
+
continue: !def.abort,
|
|
273
|
+
});
|
|
274
|
+
};
|
|
275
|
+
});
|
|
276
|
+
export const $ZodCheckSizeEquals = /*@__PURE__*/ core.$constructor("$ZodCheckSizeEquals", (inst, def) => {
|
|
277
|
+
$ZodCheck.init(inst, def);
|
|
278
|
+
inst._zod.when = (payload) => {
|
|
279
|
+
const val = payload.value;
|
|
280
|
+
return !util.nullish(val) && val.size !== undefined;
|
|
281
|
+
};
|
|
282
|
+
inst._zod.onattach.push((inst) => {
|
|
283
|
+
const bag = inst._zod.bag;
|
|
284
|
+
bag.minimum = def.size;
|
|
285
|
+
bag.maximum = def.size;
|
|
286
|
+
bag.size = def.size;
|
|
287
|
+
});
|
|
288
|
+
inst._zod.check = (payload) => {
|
|
289
|
+
const input = payload.value;
|
|
290
|
+
const size = input.size;
|
|
291
|
+
if (size === def.size)
|
|
292
|
+
return;
|
|
293
|
+
const tooBig = size > def.size;
|
|
294
|
+
payload.issues.push({
|
|
295
|
+
origin: util.getSizableOrigin(input),
|
|
296
|
+
...(tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size }),
|
|
297
|
+
input: payload.value,
|
|
298
|
+
inst,
|
|
299
|
+
continue: !def.abort,
|
|
300
|
+
});
|
|
301
|
+
};
|
|
302
|
+
});
|
|
303
|
+
export const $ZodCheckMaxLength = /*@__PURE__*/ core.$constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
304
|
+
$ZodCheck.init(inst, def);
|
|
305
|
+
inst._zod.when = (payload) => {
|
|
306
|
+
const val = payload.value;
|
|
307
|
+
return !util.nullish(val) && val.length !== undefined;
|
|
308
|
+
};
|
|
309
|
+
inst._zod.onattach.push((inst) => {
|
|
310
|
+
const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);
|
|
311
|
+
if (def.maximum < curr)
|
|
312
|
+
inst._zod.bag.maximum = def.maximum;
|
|
313
|
+
});
|
|
314
|
+
inst._zod.check = (payload) => {
|
|
315
|
+
const input = payload.value;
|
|
316
|
+
const length = input.length;
|
|
317
|
+
if (length <= def.maximum)
|
|
318
|
+
return;
|
|
319
|
+
const origin = util.getLengthableOrigin(input);
|
|
320
|
+
payload.issues.push({
|
|
321
|
+
origin,
|
|
322
|
+
code: "too_big",
|
|
323
|
+
maximum: def.maximum,
|
|
324
|
+
inclusive: true,
|
|
325
|
+
input,
|
|
326
|
+
inst,
|
|
327
|
+
continue: !def.abort,
|
|
328
|
+
});
|
|
329
|
+
};
|
|
330
|
+
});
|
|
331
|
+
export const $ZodCheckMinLength = /*@__PURE__*/ core.$constructor("$ZodCheckMinLength", (inst, def) => {
|
|
332
|
+
$ZodCheck.init(inst, def);
|
|
333
|
+
inst._zod.when = (payload) => {
|
|
334
|
+
const val = payload.value;
|
|
335
|
+
return !util.nullish(val) && val.length !== undefined;
|
|
336
|
+
};
|
|
337
|
+
inst._zod.onattach.push((inst) => {
|
|
338
|
+
const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);
|
|
339
|
+
if (def.minimum > curr)
|
|
340
|
+
inst._zod.bag.minimum = def.minimum;
|
|
341
|
+
});
|
|
342
|
+
inst._zod.check = (payload) => {
|
|
343
|
+
const input = payload.value;
|
|
344
|
+
const length = input.length;
|
|
345
|
+
if (length >= def.minimum)
|
|
346
|
+
return;
|
|
347
|
+
const origin = util.getLengthableOrigin(input);
|
|
348
|
+
payload.issues.push({
|
|
349
|
+
origin,
|
|
350
|
+
code: "too_small",
|
|
351
|
+
minimum: def.minimum,
|
|
352
|
+
inclusive: true,
|
|
353
|
+
input,
|
|
354
|
+
inst,
|
|
355
|
+
continue: !def.abort,
|
|
356
|
+
});
|
|
357
|
+
};
|
|
358
|
+
});
|
|
359
|
+
export const $ZodCheckLengthEquals = /*@__PURE__*/ core.$constructor("$ZodCheckLengthEquals", (inst, def) => {
|
|
360
|
+
$ZodCheck.init(inst, def);
|
|
361
|
+
inst._zod.when = (payload) => {
|
|
362
|
+
const val = payload.value;
|
|
363
|
+
return !util.nullish(val) && val.length !== undefined;
|
|
364
|
+
};
|
|
365
|
+
inst._zod.onattach.push((inst) => {
|
|
366
|
+
const bag = inst._zod.bag;
|
|
367
|
+
bag.minimum = def.length;
|
|
368
|
+
bag.maximum = def.length;
|
|
369
|
+
bag.length = def.length;
|
|
370
|
+
});
|
|
371
|
+
inst._zod.check = (payload) => {
|
|
372
|
+
const input = payload.value;
|
|
373
|
+
const length = input.length;
|
|
374
|
+
if (length === def.length)
|
|
375
|
+
return;
|
|
376
|
+
const origin = util.getLengthableOrigin(input);
|
|
377
|
+
const tooBig = length > def.length;
|
|
378
|
+
payload.issues.push({
|
|
379
|
+
origin,
|
|
380
|
+
...(tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length }),
|
|
381
|
+
input: payload.value,
|
|
382
|
+
inst,
|
|
383
|
+
continue: !def.abort,
|
|
384
|
+
});
|
|
385
|
+
};
|
|
386
|
+
});
|
|
387
|
+
export const $ZodCheckStringFormat = /*@__PURE__*/ core.$constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
388
|
+
var _a;
|
|
389
|
+
$ZodCheck.init(inst, def);
|
|
390
|
+
inst._zod.onattach.push((inst) => {
|
|
391
|
+
const bag = inst._zod.bag;
|
|
392
|
+
bag.format = def.format;
|
|
393
|
+
if (def.pattern) {
|
|
394
|
+
bag.patterns ?? (bag.patterns = new Set());
|
|
395
|
+
bag.patterns.add(def.pattern);
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
(_a = inst._zod).check ?? (_a.check = (payload) => {
|
|
399
|
+
if (!def.pattern)
|
|
400
|
+
throw new Error("Not implemented.");
|
|
401
|
+
def.pattern.lastIndex = 0;
|
|
402
|
+
if (def.pattern.test(payload.value))
|
|
403
|
+
return;
|
|
404
|
+
payload.issues.push({
|
|
405
|
+
origin: "string",
|
|
406
|
+
code: "invalid_format",
|
|
407
|
+
format: def.format,
|
|
408
|
+
input: payload.value,
|
|
409
|
+
...(def.pattern ? { pattern: def.pattern.toString() } : {}),
|
|
410
|
+
inst,
|
|
411
|
+
continue: !def.abort,
|
|
412
|
+
});
|
|
413
|
+
});
|
|
414
|
+
});
|
|
415
|
+
export const $ZodCheckRegex = /*@__PURE__*/ core.$constructor("$ZodCheckRegex", (inst, def) => {
|
|
416
|
+
$ZodCheckStringFormat.init(inst, def);
|
|
417
|
+
inst._zod.check = (payload) => {
|
|
418
|
+
def.pattern.lastIndex = 0;
|
|
419
|
+
if (def.pattern.test(payload.value))
|
|
420
|
+
return;
|
|
421
|
+
payload.issues.push({
|
|
422
|
+
origin: "string",
|
|
423
|
+
code: "invalid_format",
|
|
424
|
+
format: "regex",
|
|
425
|
+
input: payload.value,
|
|
426
|
+
pattern: def.pattern.toString(),
|
|
427
|
+
inst,
|
|
428
|
+
continue: !def.abort,
|
|
429
|
+
});
|
|
430
|
+
};
|
|
431
|
+
});
|
|
432
|
+
export const $ZodCheckLowerCase = /*@__PURE__*/ core.$constructor("$ZodCheckLowerCase", (inst, def) => {
|
|
433
|
+
def.pattern ?? (def.pattern = regexes.lowercase);
|
|
434
|
+
$ZodCheckStringFormat.init(inst, def);
|
|
435
|
+
});
|
|
436
|
+
export const $ZodCheckUpperCase = /*@__PURE__*/ core.$constructor("$ZodCheckUpperCase", (inst, def) => {
|
|
437
|
+
def.pattern ?? (def.pattern = regexes.uppercase);
|
|
438
|
+
$ZodCheckStringFormat.init(inst, def);
|
|
439
|
+
});
|
|
440
|
+
export const $ZodCheckIncludes = /*@__PURE__*/ core.$constructor("$ZodCheckIncludes", (inst, def) => {
|
|
441
|
+
$ZodCheck.init(inst, def);
|
|
442
|
+
const escapedRegex = util.escapeRegex(def.includes);
|
|
443
|
+
const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
|
|
444
|
+
def.pattern = pattern;
|
|
445
|
+
inst._zod.onattach.push((inst) => {
|
|
446
|
+
const bag = inst._zod.bag;
|
|
447
|
+
bag.patterns ?? (bag.patterns = new Set());
|
|
448
|
+
bag.patterns.add(pattern);
|
|
449
|
+
});
|
|
450
|
+
inst._zod.check = (payload) => {
|
|
451
|
+
if (payload.value.includes(def.includes, def.position))
|
|
452
|
+
return;
|
|
453
|
+
payload.issues.push({
|
|
454
|
+
origin: "string",
|
|
455
|
+
code: "invalid_format",
|
|
456
|
+
format: "includes",
|
|
457
|
+
includes: def.includes,
|
|
458
|
+
input: payload.value,
|
|
459
|
+
inst,
|
|
460
|
+
continue: !def.abort,
|
|
461
|
+
});
|
|
462
|
+
};
|
|
463
|
+
});
|
|
464
|
+
export const $ZodCheckStartsWith = /*@__PURE__*/ core.$constructor("$ZodCheckStartsWith", (inst, def) => {
|
|
465
|
+
$ZodCheck.init(inst, def);
|
|
466
|
+
const pattern = new RegExp(`^${util.escapeRegex(def.prefix)}.*`);
|
|
467
|
+
def.pattern ?? (def.pattern = pattern);
|
|
468
|
+
inst._zod.onattach.push((inst) => {
|
|
469
|
+
const bag = inst._zod.bag;
|
|
470
|
+
bag.patterns ?? (bag.patterns = new Set());
|
|
471
|
+
bag.patterns.add(pattern);
|
|
472
|
+
});
|
|
473
|
+
inst._zod.check = (payload) => {
|
|
474
|
+
if (payload.value.startsWith(def.prefix))
|
|
475
|
+
return;
|
|
476
|
+
payload.issues.push({
|
|
477
|
+
origin: "string",
|
|
478
|
+
code: "invalid_format",
|
|
479
|
+
format: "starts_with",
|
|
480
|
+
prefix: def.prefix,
|
|
481
|
+
input: payload.value,
|
|
482
|
+
inst,
|
|
483
|
+
continue: !def.abort,
|
|
484
|
+
});
|
|
485
|
+
};
|
|
486
|
+
});
|
|
487
|
+
export const $ZodCheckEndsWith = /*@__PURE__*/ core.$constructor("$ZodCheckEndsWith", (inst, def) => {
|
|
488
|
+
$ZodCheck.init(inst, def);
|
|
489
|
+
const pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);
|
|
490
|
+
def.pattern ?? (def.pattern = pattern);
|
|
491
|
+
inst._zod.onattach.push((inst) => {
|
|
492
|
+
const bag = inst._zod.bag;
|
|
493
|
+
bag.patterns ?? (bag.patterns = new Set());
|
|
494
|
+
bag.patterns.add(pattern);
|
|
495
|
+
});
|
|
496
|
+
inst._zod.check = (payload) => {
|
|
497
|
+
if (payload.value.endsWith(def.suffix))
|
|
498
|
+
return;
|
|
499
|
+
payload.issues.push({
|
|
500
|
+
origin: "string",
|
|
501
|
+
code: "invalid_format",
|
|
502
|
+
format: "ends_with",
|
|
503
|
+
suffix: def.suffix,
|
|
504
|
+
input: payload.value,
|
|
505
|
+
inst,
|
|
506
|
+
continue: !def.abort,
|
|
507
|
+
});
|
|
508
|
+
};
|
|
509
|
+
});
|
|
510
|
+
///////////////////////////////////
|
|
511
|
+
///// $ZodCheckProperty /////
|
|
512
|
+
///////////////////////////////////
|
|
513
|
+
function handleCheckPropertyResult(result, payload, property) {
|
|
514
|
+
if (result.issues.length) {
|
|
515
|
+
payload.issues.push(...util.prefixIssues(property, result.issues));
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
export const $ZodCheckProperty = /*@__PURE__*/ core.$constructor("$ZodCheckProperty", (inst, def) => {
|
|
519
|
+
$ZodCheck.init(inst, def);
|
|
520
|
+
inst._zod.check = (payload) => {
|
|
521
|
+
const result = def.schema._zod.run({
|
|
522
|
+
value: payload.value[def.property],
|
|
523
|
+
issues: [],
|
|
524
|
+
}, {});
|
|
525
|
+
if (result instanceof Promise) {
|
|
526
|
+
return result.then((result) => handleCheckPropertyResult(result, payload, def.property));
|
|
527
|
+
}
|
|
528
|
+
handleCheckPropertyResult(result, payload, def.property);
|
|
529
|
+
return;
|
|
530
|
+
};
|
|
531
|
+
});
|
|
532
|
+
export const $ZodCheckMimeType = /*@__PURE__*/ core.$constructor("$ZodCheckMimeType", (inst, def) => {
|
|
533
|
+
$ZodCheck.init(inst, def);
|
|
534
|
+
const mimeSet = new Set(def.mime);
|
|
535
|
+
inst._zod.onattach.push((inst) => {
|
|
536
|
+
inst._zod.bag.mime = def.mime;
|
|
537
|
+
});
|
|
538
|
+
inst._zod.check = (payload) => {
|
|
539
|
+
if (mimeSet.has(payload.value.type))
|
|
540
|
+
return;
|
|
541
|
+
payload.issues.push({
|
|
542
|
+
code: "invalid_value",
|
|
543
|
+
values: def.mime,
|
|
544
|
+
input: payload.value.type,
|
|
545
|
+
inst,
|
|
546
|
+
});
|
|
547
|
+
};
|
|
548
|
+
});
|
|
549
|
+
export const $ZodCheckOverwrite = /*@__PURE__*/ core.$constructor("$ZodCheckOverwrite", (inst, def) => {
|
|
550
|
+
$ZodCheck.init(inst, def);
|
|
551
|
+
inst._zod.check = (payload) => {
|
|
552
|
+
payload.value = def.tx(payload.value);
|
|
553
|
+
};
|
|
554
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer, params) {
|
|
2
|
+
function init(inst, def) {
|
|
3
|
+
var _a;
|
|
4
|
+
Object.defineProperty(inst, "_zod", {
|
|
5
|
+
value: inst._zod ?? {},
|
|
6
|
+
enumerable: false,
|
|
7
|
+
});
|
|
8
|
+
(_a = inst._zod).traits ?? (_a.traits = new Set());
|
|
9
|
+
inst._zod.traits.add(name);
|
|
10
|
+
initializer(inst, def);
|
|
11
|
+
// support prototype modifications
|
|
12
|
+
for (const k in _.prototype) {
|
|
13
|
+
if (!(k in inst))
|
|
14
|
+
Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) });
|
|
15
|
+
}
|
|
16
|
+
inst._zod.constr = _;
|
|
17
|
+
inst._zod.def = def;
|
|
18
|
+
}
|
|
19
|
+
// doesn't work if Parent has a constructor with arguments
|
|
20
|
+
const Parent = params?.Parent ?? Object;
|
|
21
|
+
class Definition extends Parent {
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(Definition, "name", { value: name });
|
|
24
|
+
function _(def) {
|
|
25
|
+
var _a;
|
|
26
|
+
const inst = params?.Parent ? new Definition() : this;
|
|
27
|
+
init(inst, def);
|
|
28
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
29
|
+
for (const fn of inst._zod.deferred) {
|
|
30
|
+
fn();
|
|
31
|
+
}
|
|
32
|
+
return inst;
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(_, "init", { value: init });
|
|
35
|
+
Object.defineProperty(_, Symbol.hasInstance, {
|
|
36
|
+
value: (inst) => {
|
|
37
|
+
if (params?.Parent && inst instanceof params.Parent)
|
|
38
|
+
return true;
|
|
39
|
+
return inst?._zod?.traits?.has(name);
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(_, "name", { value: name });
|
|
43
|
+
return _;
|
|
44
|
+
}
|
|
45
|
+
////////////////////////////// UTILITIES ///////////////////////////////////////
|
|
46
|
+
export const $brand = Symbol("zod_brand");
|
|
47
|
+
export class $ZodAsyncError extends Error {
|
|
48
|
+
constructor() {
|
|
49
|
+
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export const globalConfig = {};
|
|
53
|
+
export function config(newConfig) {
|
|
54
|
+
if (newConfig)
|
|
55
|
+
Object.assign(globalConfig, newConfig);
|
|
56
|
+
return globalConfig;
|
|
57
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export class Doc {
|
|
2
|
+
constructor(args = []) {
|
|
3
|
+
this.content = [];
|
|
4
|
+
this.indent = 0;
|
|
5
|
+
if (this)
|
|
6
|
+
this.args = args;
|
|
7
|
+
}
|
|
8
|
+
indented(fn) {
|
|
9
|
+
this.indent += 1;
|
|
10
|
+
fn(this);
|
|
11
|
+
this.indent -= 1;
|
|
12
|
+
}
|
|
13
|
+
write(arg) {
|
|
14
|
+
if (typeof arg === "function") {
|
|
15
|
+
arg(this, { execution: "sync" });
|
|
16
|
+
arg(this, { execution: "async" });
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const content = arg;
|
|
20
|
+
const lines = content.split("\n").filter((x) => x);
|
|
21
|
+
const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
|
|
22
|
+
const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
|
|
23
|
+
for (const line of dedented) {
|
|
24
|
+
this.content.push(line);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
compile() {
|
|
28
|
+
const F = Function;
|
|
29
|
+
const args = this?.args;
|
|
30
|
+
const content = this?.content ?? [``];
|
|
31
|
+
const lines = [...content.map((x) => ` ${x}`)];
|
|
32
|
+
// console.log(lines.join("\n"));
|
|
33
|
+
return new F(...args, lines.join("\n"));
|
|
34
|
+
}
|
|
35
|
+
}
|