@btc-embedded/cdk-extensions 0.10.0 → 0.10.3
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 +27 -25
- package/API.md +5 -0
- package/CHANGELOG.md +20 -0
- package/lib/constructs/EventPipe.d.ts +5 -0
- package/lib/constructs/EventPipe.js +3 -3
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/lib/extensions/SharedVolumeExtension.js +1 -1
- package/lib/extensions/TcpKeepAliveExtension.js +1 -1
- 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/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,122 @@
|
|
|
1
|
+
import * as util from "../core/util.js";
|
|
2
|
+
const error = () => {
|
|
3
|
+
const Sizable = {
|
|
4
|
+
string: { unit: "توکي", verb: "ولري" },
|
|
5
|
+
file: { unit: "بایټس", verb: "ولري" },
|
|
6
|
+
array: { unit: "توکي", verb: "ولري" },
|
|
7
|
+
set: { unit: "توکي", verb: "ولري" },
|
|
8
|
+
};
|
|
9
|
+
function getSizing(origin) {
|
|
10
|
+
return Sizable[origin] ?? null;
|
|
11
|
+
}
|
|
12
|
+
const parsedType = (data) => {
|
|
13
|
+
const t = typeof data;
|
|
14
|
+
switch (t) {
|
|
15
|
+
case "number": {
|
|
16
|
+
return Number.isNaN(data) ? "NaN" : "عدد";
|
|
17
|
+
}
|
|
18
|
+
case "object": {
|
|
19
|
+
if (Array.isArray(data)) {
|
|
20
|
+
return "ارې";
|
|
21
|
+
}
|
|
22
|
+
if (data === null) {
|
|
23
|
+
return "null";
|
|
24
|
+
}
|
|
25
|
+
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
|
26
|
+
return data.constructor.name;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
};
|
|
32
|
+
const Nouns = {
|
|
33
|
+
regex: "ورودي",
|
|
34
|
+
email: "بریښنالیک",
|
|
35
|
+
url: "یو آر ال",
|
|
36
|
+
emoji: "ایموجي",
|
|
37
|
+
uuid: "UUID",
|
|
38
|
+
uuidv4: "UUIDv4",
|
|
39
|
+
uuidv6: "UUIDv6",
|
|
40
|
+
nanoid: "nanoid",
|
|
41
|
+
guid: "GUID",
|
|
42
|
+
cuid: "cuid",
|
|
43
|
+
cuid2: "cuid2",
|
|
44
|
+
ulid: "ULID",
|
|
45
|
+
xid: "XID",
|
|
46
|
+
ksuid: "KSUID",
|
|
47
|
+
datetime: "نیټه او وخت",
|
|
48
|
+
date: "نېټه",
|
|
49
|
+
time: "وخت",
|
|
50
|
+
duration: "موده",
|
|
51
|
+
ipv4: "د IPv4 پته",
|
|
52
|
+
ipv6: "د IPv6 پته",
|
|
53
|
+
cidrv4: "د IPv4 ساحه",
|
|
54
|
+
cidrv6: "د IPv6 ساحه",
|
|
55
|
+
base64: "base64-encoded متن",
|
|
56
|
+
base64url: "base64url-encoded متن",
|
|
57
|
+
json_string: "JSON متن",
|
|
58
|
+
e164: "د E.164 شمېره",
|
|
59
|
+
jwt: "JWT",
|
|
60
|
+
template_literal: "ورودي",
|
|
61
|
+
};
|
|
62
|
+
return (issue) => {
|
|
63
|
+
switch (issue.code) {
|
|
64
|
+
case "invalid_type":
|
|
65
|
+
return `ناسم ورودي: باید ${issue.expected} وای, مګر ${parsedType(issue.input)} ترلاسه شو`;
|
|
66
|
+
case "invalid_value":
|
|
67
|
+
if (issue.values.length === 1) {
|
|
68
|
+
return `ناسم ورودي: باید ${util.stringifyPrimitive(issue.values[0])} وای`;
|
|
69
|
+
}
|
|
70
|
+
return `ناسم انتخاب: باید یو له ${util.joinValues(issue.values, "|")} څخه وای`;
|
|
71
|
+
case "too_big": {
|
|
72
|
+
const adj = issue.inclusive ? "<=" : "<";
|
|
73
|
+
const sizing = getSizing(issue.origin);
|
|
74
|
+
if (sizing) {
|
|
75
|
+
return `ډیر لوی: ${issue.origin ?? "ارزښت"} باید ${adj}${issue.maximum.toString()} ${sizing.unit ?? "عنصرونه"} ولري`;
|
|
76
|
+
}
|
|
77
|
+
return `ډیر لوی: ${issue.origin ?? "ارزښت"} باید ${adj}${issue.maximum.toString()} وي`;
|
|
78
|
+
}
|
|
79
|
+
case "too_small": {
|
|
80
|
+
const adj = issue.inclusive ? ">=" : ">";
|
|
81
|
+
const sizing = getSizing(issue.origin);
|
|
82
|
+
if (sizing) {
|
|
83
|
+
return `ډیر کوچنی: ${issue.origin} باید ${adj}${issue.minimum.toString()} ${sizing.unit} ولري`;
|
|
84
|
+
}
|
|
85
|
+
return `ډیر کوچنی: ${issue.origin} باید ${adj}${issue.minimum.toString()} وي`;
|
|
86
|
+
}
|
|
87
|
+
case "invalid_format": {
|
|
88
|
+
const _issue = issue;
|
|
89
|
+
if (_issue.format === "starts_with") {
|
|
90
|
+
return `ناسم متن: باید د "${_issue.prefix}" سره پیل شي`;
|
|
91
|
+
}
|
|
92
|
+
if (_issue.format === "ends_with") {
|
|
93
|
+
return `ناسم متن: باید د "${_issue.suffix}" سره پای ته ورسيږي`;
|
|
94
|
+
}
|
|
95
|
+
if (_issue.format === "includes") {
|
|
96
|
+
return `ناسم متن: باید "${_issue.includes}" ولري`;
|
|
97
|
+
}
|
|
98
|
+
if (_issue.format === "regex") {
|
|
99
|
+
return `ناسم متن: باید د ${_issue.pattern} سره مطابقت ولري`;
|
|
100
|
+
}
|
|
101
|
+
return `${Nouns[_issue.format] ?? issue.format} ناسم دی`;
|
|
102
|
+
}
|
|
103
|
+
case "not_multiple_of":
|
|
104
|
+
return `ناسم عدد: باید د ${issue.divisor} مضرب وي`;
|
|
105
|
+
case "unrecognized_keys":
|
|
106
|
+
return `ناسم ${issue.keys.length > 1 ? "کلیډونه" : "کلیډ"}: ${util.joinValues(issue.keys, ", ")}`;
|
|
107
|
+
case "invalid_key":
|
|
108
|
+
return `ناسم کلیډ په ${issue.origin} کې`;
|
|
109
|
+
case "invalid_union":
|
|
110
|
+
return `ناسمه ورودي`;
|
|
111
|
+
case "invalid_element":
|
|
112
|
+
return `ناسم عنصر په ${issue.origin} کې`;
|
|
113
|
+
default:
|
|
114
|
+
return `ناسمه ورودي`;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
export default function () {
|
|
119
|
+
return {
|
|
120
|
+
localeError: error(),
|
|
121
|
+
};
|
|
122
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as util from "../core/util.js";
|
|
2
|
+
const error = () => {
|
|
3
|
+
const Sizable = {
|
|
4
|
+
string: { unit: "caracteres", verb: "ter" },
|
|
5
|
+
file: { unit: "bytes", verb: "ter" },
|
|
6
|
+
array: { unit: "itens", verb: "ter" },
|
|
7
|
+
set: { unit: "itens", verb: "ter" },
|
|
8
|
+
};
|
|
9
|
+
function getSizing(origin) {
|
|
10
|
+
return Sizable[origin] ?? null;
|
|
11
|
+
}
|
|
12
|
+
const parsedType = (data) => {
|
|
13
|
+
const t = typeof data;
|
|
14
|
+
switch (t) {
|
|
15
|
+
case "number": {
|
|
16
|
+
return Number.isNaN(data) ? "NaN" : "número";
|
|
17
|
+
}
|
|
18
|
+
case "object": {
|
|
19
|
+
if (Array.isArray(data)) {
|
|
20
|
+
return "array";
|
|
21
|
+
}
|
|
22
|
+
if (data === null) {
|
|
23
|
+
return "nulo";
|
|
24
|
+
}
|
|
25
|
+
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
|
26
|
+
return data.constructor.name;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
};
|
|
32
|
+
const Nouns = {
|
|
33
|
+
regex: "padrão",
|
|
34
|
+
email: "endereço de e-mail",
|
|
35
|
+
url: "URL",
|
|
36
|
+
emoji: "emoji",
|
|
37
|
+
uuid: "UUID",
|
|
38
|
+
uuidv4: "UUIDv4",
|
|
39
|
+
uuidv6: "UUIDv6",
|
|
40
|
+
nanoid: "nanoid",
|
|
41
|
+
guid: "GUID",
|
|
42
|
+
cuid: "cuid",
|
|
43
|
+
cuid2: "cuid2",
|
|
44
|
+
ulid: "ULID",
|
|
45
|
+
xid: "XID",
|
|
46
|
+
ksuid: "KSUID",
|
|
47
|
+
datetime: "data e hora ISO",
|
|
48
|
+
date: "data ISO",
|
|
49
|
+
time: "hora ISO",
|
|
50
|
+
duration: "duração ISO",
|
|
51
|
+
ipv4: "endereço IPv4",
|
|
52
|
+
ipv6: "endereço IPv6",
|
|
53
|
+
cidrv4: "faixa de IPv4",
|
|
54
|
+
cidrv6: "faixa de IPv6",
|
|
55
|
+
base64: "texto codificado em base64",
|
|
56
|
+
base64url: "URL codificada em base64",
|
|
57
|
+
json_string: "texto JSON",
|
|
58
|
+
e164: "número E.164",
|
|
59
|
+
jwt: "JWT",
|
|
60
|
+
template_literal: "entrada",
|
|
61
|
+
};
|
|
62
|
+
return (issue) => {
|
|
63
|
+
switch (issue.code) {
|
|
64
|
+
case "invalid_type":
|
|
65
|
+
return `Tipo inválido: esperado ${issue.expected}, recebido ${parsedType(issue.input)}`;
|
|
66
|
+
case "invalid_value":
|
|
67
|
+
if (issue.values.length === 1)
|
|
68
|
+
return `Entrada inválida: esperado ${util.stringifyPrimitive(issue.values[0])}`;
|
|
69
|
+
return `Opção inválida: esperada uma das ${util.joinValues(issue.values, "|")}`;
|
|
70
|
+
case "too_big": {
|
|
71
|
+
const adj = issue.inclusive ? "<=" : "<";
|
|
72
|
+
const sizing = getSizing(issue.origin);
|
|
73
|
+
if (sizing)
|
|
74
|
+
return `Muito grande: esperado que ${issue.origin ?? "valor"} tivesse ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementos"}`;
|
|
75
|
+
return `Muito grande: esperado que ${issue.origin ?? "valor"} fosse ${adj}${issue.maximum.toString()}`;
|
|
76
|
+
}
|
|
77
|
+
case "too_small": {
|
|
78
|
+
const adj = issue.inclusive ? ">=" : ">";
|
|
79
|
+
const sizing = getSizing(issue.origin);
|
|
80
|
+
if (sizing) {
|
|
81
|
+
return `Muito pequeno: esperado que ${issue.origin} tivesse ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
|
82
|
+
}
|
|
83
|
+
return `Muito pequeno: esperado que ${issue.origin} fosse ${adj}${issue.minimum.toString()}`;
|
|
84
|
+
}
|
|
85
|
+
case "invalid_format": {
|
|
86
|
+
const _issue = issue;
|
|
87
|
+
if (_issue.format === "starts_with")
|
|
88
|
+
return `Texto inválido: deve começar com "${_issue.prefix}"`;
|
|
89
|
+
if (_issue.format === "ends_with")
|
|
90
|
+
return `Texto inválido: deve terminar com "${_issue.suffix}"`;
|
|
91
|
+
if (_issue.format === "includes")
|
|
92
|
+
return `Texto inválido: deve incluir "${_issue.includes}"`;
|
|
93
|
+
if (_issue.format === "regex")
|
|
94
|
+
return `Texto inválido: deve corresponder ao padrão ${_issue.pattern}`;
|
|
95
|
+
return `${Nouns[_issue.format] ?? issue.format} inválido`;
|
|
96
|
+
}
|
|
97
|
+
case "not_multiple_of":
|
|
98
|
+
return `Número inválido: deve ser múltiplo de ${issue.divisor}`;
|
|
99
|
+
case "unrecognized_keys":
|
|
100
|
+
return `Chave${issue.keys.length > 1 ? "s" : ""} desconhecida${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
|
101
|
+
case "invalid_key":
|
|
102
|
+
return `Chave inválida em ${issue.origin}`;
|
|
103
|
+
case "invalid_union":
|
|
104
|
+
return "Entrada inválida";
|
|
105
|
+
case "invalid_element":
|
|
106
|
+
return `Valor inválido em ${issue.origin}`;
|
|
107
|
+
default:
|
|
108
|
+
return `Campo inválido`;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
export default function () {
|
|
113
|
+
return {
|
|
114
|
+
localeError: error(),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import * as util from "../core/util.js";
|
|
2
|
+
function getRussianPlural(count, one, few, many) {
|
|
3
|
+
const absCount = Math.abs(count);
|
|
4
|
+
const lastDigit = absCount % 10;
|
|
5
|
+
const lastTwoDigits = absCount % 100;
|
|
6
|
+
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
|
7
|
+
return many;
|
|
8
|
+
}
|
|
9
|
+
if (lastDigit === 1) {
|
|
10
|
+
return one;
|
|
11
|
+
}
|
|
12
|
+
if (lastDigit >= 2 && lastDigit <= 4) {
|
|
13
|
+
return few;
|
|
14
|
+
}
|
|
15
|
+
return many;
|
|
16
|
+
}
|
|
17
|
+
const error = () => {
|
|
18
|
+
const Sizable = {
|
|
19
|
+
string: {
|
|
20
|
+
unit: {
|
|
21
|
+
one: "символ",
|
|
22
|
+
few: "символа",
|
|
23
|
+
many: "символов",
|
|
24
|
+
},
|
|
25
|
+
verb: "иметь",
|
|
26
|
+
},
|
|
27
|
+
file: {
|
|
28
|
+
unit: {
|
|
29
|
+
one: "байт",
|
|
30
|
+
few: "байта",
|
|
31
|
+
many: "байт",
|
|
32
|
+
},
|
|
33
|
+
verb: "иметь",
|
|
34
|
+
},
|
|
35
|
+
array: {
|
|
36
|
+
unit: {
|
|
37
|
+
one: "элемент",
|
|
38
|
+
few: "элемента",
|
|
39
|
+
many: "элементов",
|
|
40
|
+
},
|
|
41
|
+
verb: "иметь",
|
|
42
|
+
},
|
|
43
|
+
set: {
|
|
44
|
+
unit: {
|
|
45
|
+
one: "элемент",
|
|
46
|
+
few: "элемента",
|
|
47
|
+
many: "элементов",
|
|
48
|
+
},
|
|
49
|
+
verb: "иметь",
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
function getSizing(origin) {
|
|
53
|
+
return Sizable[origin] ?? null;
|
|
54
|
+
}
|
|
55
|
+
const parsedType = (data) => {
|
|
56
|
+
const t = typeof data;
|
|
57
|
+
switch (t) {
|
|
58
|
+
case "number": {
|
|
59
|
+
return Number.isNaN(data) ? "NaN" : "число";
|
|
60
|
+
}
|
|
61
|
+
case "object": {
|
|
62
|
+
if (Array.isArray(data)) {
|
|
63
|
+
return "массив";
|
|
64
|
+
}
|
|
65
|
+
if (data === null) {
|
|
66
|
+
return "null";
|
|
67
|
+
}
|
|
68
|
+
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
|
69
|
+
return data.constructor.name;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return t;
|
|
74
|
+
};
|
|
75
|
+
const Nouns = {
|
|
76
|
+
regex: "ввод",
|
|
77
|
+
email: "email адрес",
|
|
78
|
+
url: "URL",
|
|
79
|
+
emoji: "эмодзи",
|
|
80
|
+
uuid: "UUID",
|
|
81
|
+
uuidv4: "UUIDv4",
|
|
82
|
+
uuidv6: "UUIDv6",
|
|
83
|
+
nanoid: "nanoid",
|
|
84
|
+
guid: "GUID",
|
|
85
|
+
cuid: "cuid",
|
|
86
|
+
cuid2: "cuid2",
|
|
87
|
+
ulid: "ULID",
|
|
88
|
+
xid: "XID",
|
|
89
|
+
ksuid: "KSUID",
|
|
90
|
+
datetime: "ISO дата и время",
|
|
91
|
+
date: "ISO дата",
|
|
92
|
+
time: "ISO время",
|
|
93
|
+
duration: "ISO длительность",
|
|
94
|
+
ipv4: "IPv4 адрес",
|
|
95
|
+
ipv6: "IPv6 адрес",
|
|
96
|
+
cidrv4: "IPv4 диапазон",
|
|
97
|
+
cidrv6: "IPv6 диапазон",
|
|
98
|
+
base64: "строка в формате base64",
|
|
99
|
+
base64url: "строка в формате base64url",
|
|
100
|
+
json_string: "JSON строка",
|
|
101
|
+
e164: "номер E.164",
|
|
102
|
+
jwt: "JWT",
|
|
103
|
+
template_literal: "ввод",
|
|
104
|
+
};
|
|
105
|
+
return (issue) => {
|
|
106
|
+
switch (issue.code) {
|
|
107
|
+
case "invalid_type":
|
|
108
|
+
return `Неверный ввод: ожидалось ${issue.expected}, получено ${parsedType(issue.input)}`;
|
|
109
|
+
case "invalid_value":
|
|
110
|
+
if (issue.values.length === 1)
|
|
111
|
+
return `Неверный ввод: ожидалось ${util.stringifyPrimitive(issue.values[0])}`;
|
|
112
|
+
return `Неверный вариант: ожидалось одно из ${util.joinValues(issue.values, "|")}`;
|
|
113
|
+
case "too_big": {
|
|
114
|
+
const adj = issue.inclusive ? "<=" : "<";
|
|
115
|
+
const sizing = getSizing(issue.origin);
|
|
116
|
+
if (sizing) {
|
|
117
|
+
const maxValue = Number(issue.maximum);
|
|
118
|
+
const unit = getRussianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
|
|
119
|
+
return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет иметь ${adj}${issue.maximum.toString()} ${unit}`;
|
|
120
|
+
}
|
|
121
|
+
return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет ${adj}${issue.maximum.toString()}`;
|
|
122
|
+
}
|
|
123
|
+
case "too_small": {
|
|
124
|
+
const adj = issue.inclusive ? ">=" : ">";
|
|
125
|
+
const sizing = getSizing(issue.origin);
|
|
126
|
+
if (sizing) {
|
|
127
|
+
const minValue = Number(issue.minimum);
|
|
128
|
+
const unit = getRussianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
|
|
129
|
+
return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет иметь ${adj}${issue.minimum.toString()} ${unit}`;
|
|
130
|
+
}
|
|
131
|
+
return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет ${adj}${issue.minimum.toString()}`;
|
|
132
|
+
}
|
|
133
|
+
case "invalid_format": {
|
|
134
|
+
const _issue = issue;
|
|
135
|
+
if (_issue.format === "starts_with")
|
|
136
|
+
return `Неверная строка: должна начинаться с "${_issue.prefix}"`;
|
|
137
|
+
if (_issue.format === "ends_with")
|
|
138
|
+
return `Неверная строка: должна заканчиваться на "${_issue.suffix}"`;
|
|
139
|
+
if (_issue.format === "includes")
|
|
140
|
+
return `Неверная строка: должна содержать "${_issue.includes}"`;
|
|
141
|
+
if (_issue.format === "regex")
|
|
142
|
+
return `Неверная строка: должна соответствовать шаблону ${_issue.pattern}`;
|
|
143
|
+
return `Неверный ${Nouns[_issue.format] ?? issue.format}`;
|
|
144
|
+
}
|
|
145
|
+
case "not_multiple_of":
|
|
146
|
+
return `Неверное число: должно быть кратным ${issue.divisor}`;
|
|
147
|
+
case "unrecognized_keys":
|
|
148
|
+
return `Нераспознанн${issue.keys.length > 1 ? "ые" : "ый"} ключ${issue.keys.length > 1 ? "и" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
|
149
|
+
case "invalid_key":
|
|
150
|
+
return `Неверный ключ в ${issue.origin}`;
|
|
151
|
+
case "invalid_union":
|
|
152
|
+
return "Неверные входные данные";
|
|
153
|
+
case "invalid_element":
|
|
154
|
+
return `Неверное значение в ${issue.origin}`;
|
|
155
|
+
default:
|
|
156
|
+
return `Неверные входные данные`;
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
export default function () {
|
|
161
|
+
return {
|
|
162
|
+
localeError: error(),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import * as util from "../core/util.js";
|
|
2
|
+
const error = () => {
|
|
3
|
+
const Sizable = {
|
|
4
|
+
string: { unit: "znakov", verb: "imeti" },
|
|
5
|
+
file: { unit: "bajtov", verb: "imeti" },
|
|
6
|
+
array: { unit: "elementov", verb: "imeti" },
|
|
7
|
+
set: { unit: "elementov", verb: "imeti" },
|
|
8
|
+
};
|
|
9
|
+
function getSizing(origin) {
|
|
10
|
+
return Sizable[origin] ?? null;
|
|
11
|
+
}
|
|
12
|
+
const parsedType = (data) => {
|
|
13
|
+
const t = typeof data;
|
|
14
|
+
switch (t) {
|
|
15
|
+
case "number": {
|
|
16
|
+
return Number.isNaN(data) ? "NaN" : "število";
|
|
17
|
+
}
|
|
18
|
+
case "object": {
|
|
19
|
+
if (Array.isArray(data)) {
|
|
20
|
+
return "tabela";
|
|
21
|
+
}
|
|
22
|
+
if (data === null) {
|
|
23
|
+
return "null";
|
|
24
|
+
}
|
|
25
|
+
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
|
26
|
+
return data.constructor.name;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
};
|
|
32
|
+
const Nouns = {
|
|
33
|
+
regex: "vnos",
|
|
34
|
+
email: "e-poštni naslov",
|
|
35
|
+
url: "URL",
|
|
36
|
+
emoji: "emoji",
|
|
37
|
+
uuid: "UUID",
|
|
38
|
+
uuidv4: "UUIDv4",
|
|
39
|
+
uuidv6: "UUIDv6",
|
|
40
|
+
nanoid: "nanoid",
|
|
41
|
+
guid: "GUID",
|
|
42
|
+
cuid: "cuid",
|
|
43
|
+
cuid2: "cuid2",
|
|
44
|
+
ulid: "ULID",
|
|
45
|
+
xid: "XID",
|
|
46
|
+
ksuid: "KSUID",
|
|
47
|
+
datetime: "ISO datum in čas",
|
|
48
|
+
date: "ISO datum",
|
|
49
|
+
time: "ISO čas",
|
|
50
|
+
duration: "ISO trajanje",
|
|
51
|
+
ipv4: "IPv4 naslov",
|
|
52
|
+
ipv6: "IPv6 naslov",
|
|
53
|
+
cidrv4: "obseg IPv4",
|
|
54
|
+
cidrv6: "obseg IPv6",
|
|
55
|
+
base64: "base64 kodiran niz",
|
|
56
|
+
base64url: "base64url kodiran niz",
|
|
57
|
+
json_string: "JSON niz",
|
|
58
|
+
e164: "E.164 številka",
|
|
59
|
+
jwt: "JWT",
|
|
60
|
+
template_literal: "vnos",
|
|
61
|
+
};
|
|
62
|
+
return (issue) => {
|
|
63
|
+
switch (issue.code) {
|
|
64
|
+
case "invalid_type":
|
|
65
|
+
return `Neveljaven vnos: pričakovano ${issue.expected}, prejeto ${parsedType(issue.input)}`;
|
|
66
|
+
case "invalid_value":
|
|
67
|
+
if (issue.values.length === 1)
|
|
68
|
+
return `Neveljaven vnos: pričakovano ${util.stringifyPrimitive(issue.values[0])}`;
|
|
69
|
+
return `Neveljavna možnost: pričakovano eno izmed ${util.joinValues(issue.values, "|")}`;
|
|
70
|
+
case "too_big": {
|
|
71
|
+
const adj = issue.inclusive ? "<=" : "<";
|
|
72
|
+
const sizing = getSizing(issue.origin);
|
|
73
|
+
if (sizing)
|
|
74
|
+
return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} imelo ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementov"}`;
|
|
75
|
+
return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} ${adj}${issue.maximum.toString()}`;
|
|
76
|
+
}
|
|
77
|
+
case "too_small": {
|
|
78
|
+
const adj = issue.inclusive ? ">=" : ">";
|
|
79
|
+
const sizing = getSizing(issue.origin);
|
|
80
|
+
if (sizing) {
|
|
81
|
+
return `Premajhno: pričakovano, da bo ${issue.origin} imelo ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
|
82
|
+
}
|
|
83
|
+
return `Premajhno: pričakovano, da bo ${issue.origin} ${adj}${issue.minimum.toString()}`;
|
|
84
|
+
}
|
|
85
|
+
case "invalid_format": {
|
|
86
|
+
const _issue = issue;
|
|
87
|
+
if (_issue.format === "starts_with") {
|
|
88
|
+
return `Neveljaven niz: mora se začeti z "${_issue.prefix}"`;
|
|
89
|
+
}
|
|
90
|
+
if (_issue.format === "ends_with")
|
|
91
|
+
return `Neveljaven niz: mora se končati z "${_issue.suffix}"`;
|
|
92
|
+
if (_issue.format === "includes")
|
|
93
|
+
return `Neveljaven niz: mora vsebovati "${_issue.includes}"`;
|
|
94
|
+
if (_issue.format === "regex")
|
|
95
|
+
return `Neveljaven niz: mora ustrezati vzorcu ${_issue.pattern}`;
|
|
96
|
+
return `Neveljaven ${Nouns[_issue.format] ?? issue.format}`;
|
|
97
|
+
}
|
|
98
|
+
case "not_multiple_of":
|
|
99
|
+
return `Neveljavno število: mora biti večkratnik ${issue.divisor}`;
|
|
100
|
+
case "unrecognized_keys":
|
|
101
|
+
return `Neprepoznan${issue.keys.length > 1 ? "i ključi" : " ključ"}: ${util.joinValues(issue.keys, ", ")}`;
|
|
102
|
+
case "invalid_key":
|
|
103
|
+
return `Neveljaven ključ v ${issue.origin}`;
|
|
104
|
+
case "invalid_union":
|
|
105
|
+
return "Neveljaven vnos";
|
|
106
|
+
case "invalid_element":
|
|
107
|
+
return `Neveljavna vrednost v ${issue.origin}`;
|
|
108
|
+
default:
|
|
109
|
+
return "Neveljaven vnos";
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
export default function () {
|
|
114
|
+
return {
|
|
115
|
+
localeError: error(),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import * as util from "../core/util.js";
|
|
2
|
+
const error = () => {
|
|
3
|
+
const Sizable = {
|
|
4
|
+
string: { unit: "tecken", verb: "att ha" },
|
|
5
|
+
file: { unit: "bytes", verb: "att ha" },
|
|
6
|
+
array: { unit: "objekt", verb: "att innehålla" },
|
|
7
|
+
set: { unit: "objekt", verb: "att innehålla" },
|
|
8
|
+
};
|
|
9
|
+
function getSizing(origin) {
|
|
10
|
+
return Sizable[origin] ?? null;
|
|
11
|
+
}
|
|
12
|
+
const parsedType = (data) => {
|
|
13
|
+
const t = typeof data;
|
|
14
|
+
switch (t) {
|
|
15
|
+
case "number": {
|
|
16
|
+
return Number.isNaN(data) ? "NaN" : "antal";
|
|
17
|
+
}
|
|
18
|
+
case "object": {
|
|
19
|
+
if (Array.isArray(data)) {
|
|
20
|
+
return "lista";
|
|
21
|
+
}
|
|
22
|
+
if (data === null) {
|
|
23
|
+
return "null";
|
|
24
|
+
}
|
|
25
|
+
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
|
26
|
+
return data.constructor.name;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
};
|
|
32
|
+
const Nouns = {
|
|
33
|
+
regex: "reguljärt uttryck",
|
|
34
|
+
email: "e-postadress",
|
|
35
|
+
url: "URL",
|
|
36
|
+
emoji: "emoji",
|
|
37
|
+
uuid: "UUID",
|
|
38
|
+
uuidv4: "UUIDv4",
|
|
39
|
+
uuidv6: "UUIDv6",
|
|
40
|
+
nanoid: "nanoid",
|
|
41
|
+
guid: "GUID",
|
|
42
|
+
cuid: "cuid",
|
|
43
|
+
cuid2: "cuid2",
|
|
44
|
+
ulid: "ULID",
|
|
45
|
+
xid: "XID",
|
|
46
|
+
ksuid: "KSUID",
|
|
47
|
+
datetime: "ISO-datum och tid",
|
|
48
|
+
date: "ISO-datum",
|
|
49
|
+
time: "ISO-tid",
|
|
50
|
+
duration: "ISO-varaktighet",
|
|
51
|
+
ipv4: "IPv4-intervall",
|
|
52
|
+
ipv6: "IPv6-intervall",
|
|
53
|
+
cidrv4: "IPv4-spektrum",
|
|
54
|
+
cidrv6: "IPv6-spektrum",
|
|
55
|
+
base64: "base64-kodad sträng",
|
|
56
|
+
base64url: "base64url-kodad sträng",
|
|
57
|
+
json_string: "JSON-sträng",
|
|
58
|
+
e164: "E.164-nummer",
|
|
59
|
+
jwt: "JWT",
|
|
60
|
+
template_literal: "mall-literal",
|
|
61
|
+
};
|
|
62
|
+
return (issue) => {
|
|
63
|
+
switch (issue.code) {
|
|
64
|
+
case "invalid_type":
|
|
65
|
+
return `Ogiltig inmatning: förväntat ${issue.expected}, fick ${parsedType(issue.input)}`;
|
|
66
|
+
case "invalid_value":
|
|
67
|
+
if (issue.values.length === 1)
|
|
68
|
+
return `Ogiltig inmatning: förväntat ${util.stringifyPrimitive(issue.values[0])}`;
|
|
69
|
+
return `Ogiltigt val: förväntade en av ${util.joinValues(issue.values, "|")}`;
|
|
70
|
+
case "too_big": {
|
|
71
|
+
const adj = issue.inclusive ? "<=" : "<";
|
|
72
|
+
const sizing = getSizing(issue.origin);
|
|
73
|
+
if (sizing) {
|
|
74
|
+
return `För stor(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.maximum.toString()} ${sizing.unit ?? "element"}`;
|
|
75
|
+
}
|
|
76
|
+
return `För stor(t): förväntat ${issue.origin ?? "värdet"} att ha ${adj}${issue.maximum.toString()}`;
|
|
77
|
+
}
|
|
78
|
+
case "too_small": {
|
|
79
|
+
const adj = issue.inclusive ? ">=" : ">";
|
|
80
|
+
const sizing = getSizing(issue.origin);
|
|
81
|
+
if (sizing) {
|
|
82
|
+
return `För lite(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
|
83
|
+
}
|
|
84
|
+
return `För lite(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.minimum.toString()}`;
|
|
85
|
+
}
|
|
86
|
+
case "invalid_format": {
|
|
87
|
+
const _issue = issue;
|
|
88
|
+
if (_issue.format === "starts_with") {
|
|
89
|
+
return `Ogiltig sträng: måste börja med "${_issue.prefix}"`;
|
|
90
|
+
}
|
|
91
|
+
if (_issue.format === "ends_with")
|
|
92
|
+
return `Ogiltig sträng: måste sluta med "${_issue.suffix}"`;
|
|
93
|
+
if (_issue.format === "includes")
|
|
94
|
+
return `Ogiltig sträng: måste innehålla "${_issue.includes}"`;
|
|
95
|
+
if (_issue.format === "regex")
|
|
96
|
+
return `Ogiltig sträng: måste matcha mönstret "${_issue.pattern}"`;
|
|
97
|
+
return `Ogiltig(t) ${Nouns[_issue.format] ?? issue.format}`;
|
|
98
|
+
}
|
|
99
|
+
case "not_multiple_of":
|
|
100
|
+
return `Ogiltigt tal: måste vara en multipel av ${issue.divisor}`;
|
|
101
|
+
case "unrecognized_keys":
|
|
102
|
+
return `${issue.keys.length > 1 ? "Okända nycklar" : "Okänd nyckel"}: ${util.joinValues(issue.keys, ", ")}`;
|
|
103
|
+
case "invalid_key":
|
|
104
|
+
return `Ogiltig nyckel i ${issue.origin ?? "värdet"}`;
|
|
105
|
+
case "invalid_union":
|
|
106
|
+
return "Ogiltig input";
|
|
107
|
+
case "invalid_element":
|
|
108
|
+
return `Ogiltigt värde i ${issue.origin ?? "värdet"}`;
|
|
109
|
+
default:
|
|
110
|
+
return `Ogiltig input`;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
export default function () {
|
|
115
|
+
return {
|
|
116
|
+
localeError: error(),
|
|
117
|
+
};
|
|
118
|
+
}
|