ibm-cloud-sdk-core 4.3.3 → 4.3.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/iamtest.env +3 -0
- package/package.json +2 -2
- package/sdk-test-utilities/node_modules/.package-lock.json +508 -0
- package/sdk-test-utilities/node_modules/@babel/code-frame/LICENSE +22 -0
- package/sdk-test-utilities/node_modules/@babel/code-frame/README.md +19 -0
- package/sdk-test-utilities/node_modules/@babel/code-frame/lib/index.js +156 -0
- package/sdk-test-utilities/node_modules/@babel/code-frame/lib/index.js.map +1 -0
- package/sdk-test-utilities/node_modules/@babel/code-frame/package.json +30 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/LICENSE +22 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/README.md +19 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/identifier.js +70 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +1 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/index.js +57 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/index.js.map +1 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/keyword.js +35 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map +1 -0
- package/sdk-test-utilities/node_modules/@babel/helper-validator-identifier/package.json +31 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/LICENSE +22 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/README.md +19 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/lib/index.js +119 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/lib/index.js.map +1 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/ansi-styles/index.js +165 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/ansi-styles/license +9 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/ansi-styles/package.json +56 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/ansi-styles/readme.md +147 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/index.js +228 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/index.js.flow +93 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/license +9 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/package.json +71 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/readme.md +314 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/templates.js +128 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/chalk/types/index.d.ts +97 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/CHANGELOG.md +54 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/README.md +68 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/conversions.js +868 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/index.js +78 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/package.json +46 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-convert/route.js +97 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/.eslintrc.json +43 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/LICENSE +8 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/README.md +11 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/index.js +152 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/package.json +25 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/color-name/test.js +7 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/escape-string-regexp/index.js +11 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/escape-string-regexp/license +21 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/escape-string-regexp/package.json +41 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/escape-string-regexp/readme.md +27 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/has-flag/index.js +8 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/has-flag/license +9 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/has-flag/package.json +44 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/has-flag/readme.md +70 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/supports-color/browser.js +5 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/supports-color/index.js +131 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/supports-color/license +9 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/supports-color/package.json +53 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/node_modules/supports-color/readme.md +66 -0
- package/sdk-test-utilities/node_modules/@babel/highlight/package.json +30 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/README.md +5 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/immutableUtils.js +66 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/index.d.ts +94 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/index.js +34 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/jasmineUtils.js +218 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/types.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/build/utils.js +462 -0
- package/sdk-test-utilities/node_modules/@jest/expect-utils/package.json +35 -0
- package/sdk-test-utilities/node_modules/@jest/schemas/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@jest/schemas/README.md +3 -0
- package/sdk-test-utilities/node_modules/@jest/schemas/build/index.d.ts +63 -0
- package/sdk-test-utilities/node_modules/@jest/schemas/build/index.js +60 -0
- package/sdk-test-utilities/node_modules/@jest/schemas/package.json +29 -0
- package/sdk-test-utilities/node_modules/@jest/types/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@jest/types/README.md +30 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/Circus.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/Config.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/Global.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/TestResult.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/index.d.ts +1204 -0
- package/sdk-test-utilities/node_modules/@jest/types/build/index.js +1 -0
- package/sdk-test-utilities/node_modules/@jest/types/package.json +38 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/compiler/compiler.d.ts +35 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/compiler/compiler.js +577 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/compiler/index.d.ts +2 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/compiler/index.js +47 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/errors/errors.d.ts +88 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/errors/errors.js +609 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/errors/index.d.ts +1 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/errors/index.js +44 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/license +23 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/package.json +47 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/readme.md +1424 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/system/index.d.ts +1 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/system/index.js +44 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/system/system.d.ts +26 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/system/system.js +90 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/typebox.d.ts +723 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/typebox.js +2220 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/cast.d.ts +30 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/cast.js +372 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/check.d.ts +12 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/check.js +484 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/clone.d.ts +3 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/clone.js +71 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/convert.d.ts +13 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/convert.js +372 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/create.d.ts +26 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/create.js +480 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/delta.d.ts +43 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/delta.js +204 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/equal.d.ts +3 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/equal.js +80 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/hash.d.ts +8 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/hash.js +208 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/index.d.ts +6 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/index.js +56 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/is.d.ts +11 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/is.js +53 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/mutate.d.ts +13 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/mutate.js +121 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/pointer.d.ts +24 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/pointer.js +142 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/value.d.ts +39 -0
- package/sdk-test-utilities/node_modules/@sinclair/typebox/value/value.js +99 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-coverage/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-coverage/README.md +15 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-coverage/index.d.ts +111 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-coverage/package.json +25 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-report/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-report/README.md +15 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-report/index.d.ts +184 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-lib-report/package.json +32 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-reports/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-reports/README.md +86 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-reports/index.d.ts +67 -0
- package/sdk-test-utilities/node_modules/@types/istanbul-reports/package.json +32 -0
- package/sdk-test-utilities/node_modules/@types/node/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/node/README.md +15 -0
- package/sdk-test-utilities/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/sdk-test-utilities/node_modules/@types/node/assert.d.ts +1040 -0
- package/sdk-test-utilities/node_modules/@types/node/async_hooks.d.ts +541 -0
- package/sdk-test-utilities/node_modules/@types/node/buffer.d.ts +2363 -0
- package/sdk-test-utilities/node_modules/@types/node/child_process.d.ts +1544 -0
- package/sdk-test-utilities/node_modules/@types/node/cluster.d.ts +578 -0
- package/sdk-test-utilities/node_modules/@types/node/console.d.ts +452 -0
- package/sdk-test-utilities/node_modules/@types/node/constants.d.ts +19 -0
- package/sdk-test-utilities/node_modules/@types/node/crypto.d.ts +4523 -0
- package/sdk-test-utilities/node_modules/@types/node/dgram.d.ts +596 -0
- package/sdk-test-utilities/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
- package/sdk-test-utilities/node_modules/@types/node/dns/promises.d.ts +474 -0
- package/sdk-test-utilities/node_modules/@types/node/dns.d.ts +864 -0
- package/sdk-test-utilities/node_modules/@types/node/dom-events.d.ts +124 -0
- package/sdk-test-utilities/node_modules/@types/node/domain.d.ts +170 -0
- package/sdk-test-utilities/node_modules/@types/node/events.d.ts +909 -0
- package/sdk-test-utilities/node_modules/@types/node/fs/promises.d.ts +1245 -0
- package/sdk-test-utilities/node_modules/@types/node/fs.d.ts +4317 -0
- package/sdk-test-utilities/node_modules/@types/node/globals.d.ts +411 -0
- package/sdk-test-utilities/node_modules/@types/node/globals.global.d.ts +1 -0
- package/sdk-test-utilities/node_modules/@types/node/http.d.ts +1908 -0
- package/sdk-test-utilities/node_modules/@types/node/http2.d.ts +2418 -0
- package/sdk-test-utilities/node_modules/@types/node/https.d.ts +550 -0
- package/sdk-test-utilities/node_modules/@types/node/index.d.ts +89 -0
- package/sdk-test-utilities/node_modules/@types/node/inspector.d.ts +2746 -0
- package/sdk-test-utilities/node_modules/@types/node/module.d.ts +315 -0
- package/sdk-test-utilities/node_modules/@types/node/net.d.ts +999 -0
- package/sdk-test-utilities/node_modules/@types/node/os.d.ts +495 -0
- package/sdk-test-utilities/node_modules/@types/node/package.json +217 -0
- package/sdk-test-utilities/node_modules/@types/node/path.d.ts +191 -0
- package/sdk-test-utilities/node_modules/@types/node/perf_hooks.d.ts +905 -0
- package/sdk-test-utilities/node_modules/@types/node/process.d.ts +1754 -0
- package/sdk-test-utilities/node_modules/@types/node/punycode.d.ts +117 -0
- package/sdk-test-utilities/node_modules/@types/node/querystring.d.ts +153 -0
- package/sdk-test-utilities/node_modules/@types/node/readline/promises.d.ts +150 -0
- package/sdk-test-utilities/node_modules/@types/node/readline.d.ts +540 -0
- package/sdk-test-utilities/node_modules/@types/node/repl.d.ts +430 -0
- package/sdk-test-utilities/node_modules/@types/node/sea.d.ts +153 -0
- package/sdk-test-utilities/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/sdk-test-utilities/node_modules/@types/node/stream/promises.d.ts +83 -0
- package/sdk-test-utilities/node_modules/@types/node/stream/web.d.ts +367 -0
- package/sdk-test-utilities/node_modules/@types/node/stream.d.ts +1707 -0
- package/sdk-test-utilities/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/sdk-test-utilities/node_modules/@types/node/test.d.ts +1718 -0
- package/sdk-test-utilities/node_modules/@types/node/timers/promises.d.ts +97 -0
- package/sdk-test-utilities/node_modules/@types/node/timers.d.ts +240 -0
- package/sdk-test-utilities/node_modules/@types/node/tls.d.ts +1217 -0
- package/sdk-test-utilities/node_modules/@types/node/trace_events.d.ts +197 -0
- package/sdk-test-utilities/node_modules/@types/node/tty.d.ts +208 -0
- package/sdk-test-utilities/node_modules/@types/node/url.d.ts +952 -0
- package/sdk-test-utilities/node_modules/@types/node/util.d.ts +2292 -0
- package/sdk-test-utilities/node_modules/@types/node/v8.d.ts +808 -0
- package/sdk-test-utilities/node_modules/@types/node/vm.d.ts +924 -0
- package/sdk-test-utilities/node_modules/@types/node/wasi.d.ts +181 -0
- package/sdk-test-utilities/node_modules/@types/node/worker_threads.d.ts +691 -0
- package/sdk-test-utilities/node_modules/@types/node/zlib.d.ts +530 -0
- package/sdk-test-utilities/node_modules/@types/stack-utils/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/stack-utils/README.md +78 -0
- package/sdk-test-utilities/node_modules/@types/stack-utils/index.d.ts +59 -0
- package/sdk-test-utilities/node_modules/@types/stack-utils/package.json +25 -0
- package/sdk-test-utilities/node_modules/@types/yargs/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/yargs/README.md +15 -0
- package/sdk-test-utilities/node_modules/@types/yargs/helpers.d.mts +1 -0
- package/sdk-test-utilities/node_modules/@types/yargs/helpers.d.ts +5 -0
- package/sdk-test-utilities/node_modules/@types/yargs/index.d.mts +46 -0
- package/sdk-test-utilities/node_modules/@types/yargs/index.d.ts +1031 -0
- package/sdk-test-utilities/node_modules/@types/yargs/package.json +87 -0
- package/sdk-test-utilities/node_modules/@types/yargs/yargs.d.ts +9 -0
- package/sdk-test-utilities/node_modules/@types/yargs-parser/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/@types/yargs-parser/README.md +15 -0
- package/sdk-test-utilities/node_modules/@types/yargs-parser/index.d.ts +112 -0
- package/sdk-test-utilities/node_modules/@types/yargs-parser/package.json +25 -0
- package/sdk-test-utilities/node_modules/ansi-styles/index.d.ts +345 -0
- package/sdk-test-utilities/node_modules/ansi-styles/index.js +163 -0
- package/sdk-test-utilities/node_modules/ansi-styles/license +9 -0
- package/sdk-test-utilities/node_modules/ansi-styles/package.json +56 -0
- package/sdk-test-utilities/node_modules/ansi-styles/readme.md +152 -0
- package/sdk-test-utilities/node_modules/braces/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/braces/README.md +586 -0
- package/sdk-test-utilities/node_modules/braces/index.js +170 -0
- package/sdk-test-utilities/node_modules/braces/lib/compile.js +60 -0
- package/sdk-test-utilities/node_modules/braces/lib/constants.js +57 -0
- package/sdk-test-utilities/node_modules/braces/lib/expand.js +113 -0
- package/sdk-test-utilities/node_modules/braces/lib/parse.js +331 -0
- package/sdk-test-utilities/node_modules/braces/lib/stringify.js +32 -0
- package/sdk-test-utilities/node_modules/braces/lib/utils.js +122 -0
- package/sdk-test-utilities/node_modules/braces/package.json +77 -0
- package/sdk-test-utilities/node_modules/chalk/index.d.ts +415 -0
- package/sdk-test-utilities/node_modules/chalk/license +9 -0
- package/sdk-test-utilities/node_modules/chalk/package.json +68 -0
- package/sdk-test-utilities/node_modules/chalk/readme.md +341 -0
- package/sdk-test-utilities/node_modules/chalk/source/index.js +229 -0
- package/sdk-test-utilities/node_modules/chalk/source/templates.js +134 -0
- package/sdk-test-utilities/node_modules/chalk/source/util.js +39 -0
- package/sdk-test-utilities/node_modules/ci-info/CHANGELOG.md +178 -0
- package/sdk-test-utilities/node_modules/ci-info/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/ci-info/README.md +135 -0
- package/sdk-test-utilities/node_modules/ci-info/index.d.ts +75 -0
- package/sdk-test-utilities/node_modules/ci-info/index.js +90 -0
- package/sdk-test-utilities/node_modules/ci-info/package.json +45 -0
- package/sdk-test-utilities/node_modules/ci-info/vendors.json +321 -0
- package/sdk-test-utilities/node_modules/color-convert/CHANGELOG.md +54 -0
- package/sdk-test-utilities/node_modules/color-convert/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/color-convert/README.md +68 -0
- package/sdk-test-utilities/node_modules/color-convert/conversions.js +839 -0
- package/sdk-test-utilities/node_modules/color-convert/index.js +81 -0
- package/sdk-test-utilities/node_modules/color-convert/package.json +48 -0
- package/sdk-test-utilities/node_modules/color-convert/route.js +97 -0
- package/sdk-test-utilities/node_modules/color-name/LICENSE +8 -0
- package/sdk-test-utilities/node_modules/color-name/README.md +11 -0
- package/sdk-test-utilities/node_modules/color-name/index.js +152 -0
- package/sdk-test-utilities/node_modules/color-name/package.json +28 -0
- package/sdk-test-utilities/node_modules/diff-sequences/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/diff-sequences/README.md +404 -0
- package/sdk-test-utilities/node_modules/diff-sequences/build/index.d.ts +38 -0
- package/sdk-test-utilities/node_modules/diff-sequences/build/index.js +798 -0
- package/sdk-test-utilities/node_modules/diff-sequences/package.json +39 -0
- package/sdk-test-utilities/node_modules/escape-string-regexp/index.d.ts +18 -0
- package/sdk-test-utilities/node_modules/escape-string-regexp/index.js +11 -0
- package/sdk-test-utilities/node_modules/escape-string-regexp/license +9 -0
- package/sdk-test-utilities/node_modules/escape-string-regexp/package.json +43 -0
- package/sdk-test-utilities/node_modules/escape-string-regexp/readme.md +29 -0
- package/sdk-test-utilities/node_modules/expect/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/expect/README.md +3 -0
- package/sdk-test-utilities/node_modules/expect/build/asymmetricMatchers.js +375 -0
- package/sdk-test-utilities/node_modules/expect/build/extractExpectedAssertionsErrors.js +86 -0
- package/sdk-test-utilities/node_modules/expect/build/index.d.ts +370 -0
- package/sdk-test-utilities/node_modules/expect/build/index.js +410 -0
- package/sdk-test-utilities/node_modules/expect/build/jestMatchersObject.js +123 -0
- package/sdk-test-utilities/node_modules/expect/build/matchers.js +1292 -0
- package/sdk-test-utilities/node_modules/expect/build/print.js +122 -0
- package/sdk-test-utilities/node_modules/expect/build/spyMatchers.js +1254 -0
- package/sdk-test-utilities/node_modules/expect/build/toThrowMatchers.js +481 -0
- package/sdk-test-utilities/node_modules/expect/build/types.js +3 -0
- package/sdk-test-utilities/node_modules/expect/package.json +43 -0
- package/sdk-test-utilities/node_modules/fill-range/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/fill-range/README.md +237 -0
- package/sdk-test-utilities/node_modules/fill-range/index.js +248 -0
- package/sdk-test-utilities/node_modules/fill-range/package.json +74 -0
- package/sdk-test-utilities/node_modules/graceful-fs/LICENSE +15 -0
- package/sdk-test-utilities/node_modules/graceful-fs/README.md +143 -0
- package/sdk-test-utilities/node_modules/graceful-fs/clone.js +23 -0
- package/sdk-test-utilities/node_modules/graceful-fs/graceful-fs.js +448 -0
- package/sdk-test-utilities/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/sdk-test-utilities/node_modules/graceful-fs/package.json +53 -0
- package/sdk-test-utilities/node_modules/graceful-fs/polyfills.js +355 -0
- package/sdk-test-utilities/node_modules/has-flag/index.d.ts +39 -0
- package/sdk-test-utilities/node_modules/has-flag/index.js +8 -0
- package/sdk-test-utilities/node_modules/has-flag/license +9 -0
- package/sdk-test-utilities/node_modules/has-flag/package.json +46 -0
- package/sdk-test-utilities/node_modules/has-flag/readme.md +89 -0
- package/sdk-test-utilities/node_modules/is-number/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/is-number/README.md +187 -0
- package/sdk-test-utilities/node_modules/is-number/index.js +18 -0
- package/sdk-test-utilities/node_modules/is-number/package.json +82 -0
- package/sdk-test-utilities/node_modules/jest-diff/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/jest-diff/README.md +671 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/cleanupSemantic.js +599 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/constants.js +19 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/diffLines.js +193 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/diffStrings.js +66 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/getAlignedDiffs.js +223 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/index.d.ts +93 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/index.js +232 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/joinAlignedDiffs.js +271 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/normalizeDiffOptions.js +59 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/printDiffs.js +79 -0
- package/sdk-test-utilities/node_modules/jest-diff/build/types.js +1 -0
- package/sdk-test-utilities/node_modules/jest-diff/package.json +36 -0
- package/sdk-test-utilities/node_modules/jest-get-type/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/jest-get-type/build/index.d.ts +27 -0
- package/sdk-test-utilities/node_modules/jest-get-type/build/index.js +53 -0
- package/sdk-test-utilities/node_modules/jest-get-type/package.json +27 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/README.md +24 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/build/Replaceable.js +64 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/build/deepCyclicCopyReplaceable.js +111 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/build/index.d.ts +138 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/build/index.js +542 -0
- package/sdk-test-utilities/node_modules/jest-matcher-utils/package.json +37 -0
- package/sdk-test-utilities/node_modules/jest-message-util/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/jest-message-util/build/index.d.ts +68 -0
- package/sdk-test-utilities/node_modules/jest-message-util/build/index.js +518 -0
- package/sdk-test-utilities/node_modules/jest-message-util/build/types.js +1 -0
- package/sdk-test-utilities/node_modules/jest-message-util/package.json +43 -0
- package/sdk-test-utilities/node_modules/jest-util/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/jest-util/Readme.md +87 -0
- package/sdk-test-utilities/node_modules/jest-util/build/ErrorWithStack.js +28 -0
- package/sdk-test-utilities/node_modules/jest-util/build/clearLine.js +18 -0
- package/sdk-test-utilities/node_modules/jest-util/build/convertDescriptorToString.js +30 -0
- package/sdk-test-utilities/node_modules/jest-util/build/createDirectory.js +71 -0
- package/sdk-test-utilities/node_modules/jest-util/build/createProcessObject.js +109 -0
- package/sdk-test-utilities/node_modules/jest-util/build/deepCyclicCopy.js +76 -0
- package/sdk-test-utilities/node_modules/jest-util/build/formatTime.js +24 -0
- package/sdk-test-utilities/node_modules/jest-util/build/globsToMatcher.js +98 -0
- package/sdk-test-utilities/node_modules/jest-util/build/index.d.ts +136 -0
- package/sdk-test-utilities/node_modules/jest-util/build/index.js +199 -0
- package/sdk-test-utilities/node_modules/jest-util/build/installCommonGlobals.js +115 -0
- package/sdk-test-utilities/node_modules/jest-util/build/interopRequireDefault.js +22 -0
- package/sdk-test-utilities/node_modules/jest-util/build/invariant.js +18 -0
- package/sdk-test-utilities/node_modules/jest-util/build/isInteractive.js +22 -0
- package/sdk-test-utilities/node_modules/jest-util/build/isNonNullable.js +16 -0
- package/sdk-test-utilities/node_modules/jest-util/build/isPromise.js +20 -0
- package/sdk-test-utilities/node_modules/jest-util/build/pluralize.js +16 -0
- package/sdk-test-utilities/node_modules/jest-util/build/preRunMessage.js +38 -0
- package/sdk-test-utilities/node_modules/jest-util/build/replacePathSepForGlob.js +16 -0
- package/sdk-test-utilities/node_modules/jest-util/build/requireOrImportModule.js +77 -0
- package/sdk-test-utilities/node_modules/jest-util/build/setGlobal.js +17 -0
- package/sdk-test-utilities/node_modules/jest-util/build/specialChars.js +25 -0
- package/sdk-test-utilities/node_modules/jest-util/build/testPathPatternToRegExp.js +19 -0
- package/sdk-test-utilities/node_modules/jest-util/build/tryRealpath.js +30 -0
- package/sdk-test-utilities/node_modules/jest-util/package.json +38 -0
- package/sdk-test-utilities/node_modules/js-tokens/CHANGELOG.md +151 -0
- package/sdk-test-utilities/node_modules/js-tokens/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/js-tokens/README.md +240 -0
- package/sdk-test-utilities/node_modules/js-tokens/index.js +23 -0
- package/sdk-test-utilities/node_modules/js-tokens/package.json +30 -0
- package/sdk-test-utilities/node_modules/micromatch/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/micromatch/README.md +1017 -0
- package/sdk-test-utilities/node_modules/micromatch/index.js +467 -0
- package/sdk-test-utilities/node_modules/micromatch/package.json +101 -0
- package/sdk-test-utilities/node_modules/picocolors/LICENSE +15 -0
- package/sdk-test-utilities/node_modules/picocolors/README.md +21 -0
- package/sdk-test-utilities/node_modules/picocolors/package.json +25 -0
- package/sdk-test-utilities/node_modules/picocolors/picocolors.browser.js +4 -0
- package/sdk-test-utilities/node_modules/picocolors/picocolors.d.ts +5 -0
- package/sdk-test-utilities/node_modules/picocolors/picocolors.js +65 -0
- package/sdk-test-utilities/node_modules/picomatch/CHANGELOG.md +136 -0
- package/sdk-test-utilities/node_modules/picomatch/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/picomatch/README.md +708 -0
- package/sdk-test-utilities/node_modules/picomatch/index.js +3 -0
- package/sdk-test-utilities/node_modules/picomatch/lib/constants.js +179 -0
- package/sdk-test-utilities/node_modules/picomatch/lib/parse.js +1091 -0
- package/sdk-test-utilities/node_modules/picomatch/lib/picomatch.js +342 -0
- package/sdk-test-utilities/node_modules/picomatch/lib/scan.js +391 -0
- package/sdk-test-utilities/node_modules/picomatch/lib/utils.js +64 -0
- package/sdk-test-utilities/node_modules/picomatch/package.json +81 -0
- package/sdk-test-utilities/node_modules/pretty-format/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/pretty-format/README.md +463 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/collections.js +180 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/index.d.ts +163 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/index.js +478 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/AsymmetricMatcher.js +89 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/DOMCollection.js +67 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/DOMElement.js +101 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/Immutable.js +217 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/ReactElement.js +143 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/ReactTestComponent.js +66 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/lib/escapeHTML.js +16 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/plugins/lib/markup.js +113 -0
- package/sdk-test-utilities/node_modules/pretty-format/build/types.js +1 -0
- package/sdk-test-utilities/node_modules/pretty-format/node_modules/ansi-styles/index.d.ts +167 -0
- package/sdk-test-utilities/node_modules/pretty-format/node_modules/ansi-styles/index.js +164 -0
- package/sdk-test-utilities/node_modules/pretty-format/node_modules/ansi-styles/license +9 -0
- package/sdk-test-utilities/node_modules/pretty-format/node_modules/ansi-styles/package.json +52 -0
- package/sdk-test-utilities/node_modules/pretty-format/node_modules/ansi-styles/readme.md +144 -0
- package/sdk-test-utilities/node_modules/pretty-format/package.json +43 -0
- package/sdk-test-utilities/node_modules/react-is/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/react-is/README.md +104 -0
- package/sdk-test-utilities/node_modules/react-is/cjs/react-is.development.js +221 -0
- package/sdk-test-utilities/node_modules/react-is/cjs/react-is.production.min.js +14 -0
- package/sdk-test-utilities/node_modules/react-is/index.js +7 -0
- package/sdk-test-utilities/node_modules/react-is/package.json +26 -0
- package/sdk-test-utilities/node_modules/react-is/umd/react-is.development.js +220 -0
- package/sdk-test-utilities/node_modules/react-is/umd/react-is.production.min.js +15 -0
- package/sdk-test-utilities/node_modules/slash/index.d.ts +25 -0
- package/sdk-test-utilities/node_modules/slash/index.js +11 -0
- package/sdk-test-utilities/node_modules/slash/license +9 -0
- package/sdk-test-utilities/node_modules/slash/package.json +35 -0
- package/sdk-test-utilities/node_modules/slash/readme.md +44 -0
- package/sdk-test-utilities/node_modules/stack-utils/LICENSE.md +21 -0
- package/sdk-test-utilities/node_modules/stack-utils/index.js +344 -0
- package/sdk-test-utilities/node_modules/stack-utils/package.json +39 -0
- package/sdk-test-utilities/node_modules/stack-utils/readme.md +143 -0
- package/sdk-test-utilities/node_modules/supports-color/browser.js +5 -0
- package/sdk-test-utilities/node_modules/supports-color/index.js +135 -0
- package/sdk-test-utilities/node_modules/supports-color/license +9 -0
- package/sdk-test-utilities/node_modules/supports-color/package.json +53 -0
- package/sdk-test-utilities/node_modules/supports-color/readme.md +76 -0
- package/sdk-test-utilities/node_modules/to-regex-range/LICENSE +21 -0
- package/sdk-test-utilities/node_modules/to-regex-range/README.md +305 -0
- package/sdk-test-utilities/node_modules/to-regex-range/index.js +288 -0
- package/sdk-test-utilities/node_modules/to-regex-range/package.json +88 -0
- package/sdk-test-utilities/node_modules/undici-types/README.md +6 -0
- package/sdk-test-utilities/node_modules/undici-types/agent.d.ts +31 -0
- package/sdk-test-utilities/node_modules/undici-types/api.d.ts +43 -0
- package/sdk-test-utilities/node_modules/undici-types/balanced-pool.d.ts +18 -0
- package/sdk-test-utilities/node_modules/undici-types/cache.d.ts +36 -0
- package/sdk-test-utilities/node_modules/undici-types/client.d.ts +97 -0
- package/sdk-test-utilities/node_modules/undici-types/connector.d.ts +34 -0
- package/sdk-test-utilities/node_modules/undici-types/content-type.d.ts +21 -0
- package/sdk-test-utilities/node_modules/undici-types/cookies.d.ts +28 -0
- package/sdk-test-utilities/node_modules/undici-types/diagnostics-channel.d.ts +67 -0
- package/sdk-test-utilities/node_modules/undici-types/dispatcher.d.ts +241 -0
- package/sdk-test-utilities/node_modules/undici-types/errors.d.ts +128 -0
- package/sdk-test-utilities/node_modules/undici-types/fetch.d.ts +209 -0
- package/sdk-test-utilities/node_modules/undici-types/file.d.ts +39 -0
- package/sdk-test-utilities/node_modules/undici-types/filereader.d.ts +54 -0
- package/sdk-test-utilities/node_modules/undici-types/formdata.d.ts +108 -0
- package/sdk-test-utilities/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/sdk-test-utilities/node_modules/undici-types/global-origin.d.ts +7 -0
- package/sdk-test-utilities/node_modules/undici-types/handlers.d.ts +9 -0
- package/sdk-test-utilities/node_modules/undici-types/header.d.ts +4 -0
- package/sdk-test-utilities/node_modules/undici-types/index.d.ts +63 -0
- package/sdk-test-utilities/node_modules/undici-types/interceptors.d.ts +5 -0
- package/sdk-test-utilities/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/sdk-test-utilities/node_modules/undici-types/mock-client.d.ts +25 -0
- package/sdk-test-utilities/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/sdk-test-utilities/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/sdk-test-utilities/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/sdk-test-utilities/node_modules/undici-types/package.json +55 -0
- package/sdk-test-utilities/node_modules/undici-types/patch.d.ts +71 -0
- package/sdk-test-utilities/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/sdk-test-utilities/node_modules/undici-types/pool.d.ts +28 -0
- package/sdk-test-utilities/node_modules/undici-types/proxy-agent.d.ts +30 -0
- package/sdk-test-utilities/node_modules/undici-types/readable.d.ts +61 -0
- package/sdk-test-utilities/node_modules/undici-types/webidl.d.ts +220 -0
- package/sdk-test-utilities/node_modules/undici-types/websocket.d.ts +131 -0
|
@@ -0,0 +1,609 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ValueErrors = exports.ValueErrorsDereferenceError = exports.ValueErrorsUnknownTypeError = exports.ValueErrorIterator = exports.ValueErrorType = void 0;
|
|
4
|
+
/*--------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
@sinclair/typebox/errors
|
|
7
|
+
|
|
8
|
+
The MIT License (MIT)
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2017-2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in
|
|
20
|
+
all copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
28
|
+
THE SOFTWARE.
|
|
29
|
+
|
|
30
|
+
---------------------------------------------------------------------------*/
|
|
31
|
+
const Types = require("../typebox");
|
|
32
|
+
const index_1 = require("../system/index");
|
|
33
|
+
const hash_1 = require("../value/hash");
|
|
34
|
+
// -------------------------------------------------------------------
|
|
35
|
+
// ValueErrorType
|
|
36
|
+
// -------------------------------------------------------------------
|
|
37
|
+
var ValueErrorType;
|
|
38
|
+
(function (ValueErrorType) {
|
|
39
|
+
ValueErrorType[ValueErrorType["Array"] = 0] = "Array";
|
|
40
|
+
ValueErrorType[ValueErrorType["ArrayMinItems"] = 1] = "ArrayMinItems";
|
|
41
|
+
ValueErrorType[ValueErrorType["ArrayMaxItems"] = 2] = "ArrayMaxItems";
|
|
42
|
+
ValueErrorType[ValueErrorType["ArrayUniqueItems"] = 3] = "ArrayUniqueItems";
|
|
43
|
+
ValueErrorType[ValueErrorType["BigInt"] = 4] = "BigInt";
|
|
44
|
+
ValueErrorType[ValueErrorType["BigIntMultipleOf"] = 5] = "BigIntMultipleOf";
|
|
45
|
+
ValueErrorType[ValueErrorType["BigIntExclusiveMinimum"] = 6] = "BigIntExclusiveMinimum";
|
|
46
|
+
ValueErrorType[ValueErrorType["BigIntExclusiveMaximum"] = 7] = "BigIntExclusiveMaximum";
|
|
47
|
+
ValueErrorType[ValueErrorType["BigIntMinimum"] = 8] = "BigIntMinimum";
|
|
48
|
+
ValueErrorType[ValueErrorType["BigIntMaximum"] = 9] = "BigIntMaximum";
|
|
49
|
+
ValueErrorType[ValueErrorType["Boolean"] = 10] = "Boolean";
|
|
50
|
+
ValueErrorType[ValueErrorType["Date"] = 11] = "Date";
|
|
51
|
+
ValueErrorType[ValueErrorType["DateExclusiveMinimumTimestamp"] = 12] = "DateExclusiveMinimumTimestamp";
|
|
52
|
+
ValueErrorType[ValueErrorType["DateExclusiveMaximumTimestamp"] = 13] = "DateExclusiveMaximumTimestamp";
|
|
53
|
+
ValueErrorType[ValueErrorType["DateMinimumTimestamp"] = 14] = "DateMinimumTimestamp";
|
|
54
|
+
ValueErrorType[ValueErrorType["DateMaximumTimestamp"] = 15] = "DateMaximumTimestamp";
|
|
55
|
+
ValueErrorType[ValueErrorType["Function"] = 16] = "Function";
|
|
56
|
+
ValueErrorType[ValueErrorType["Integer"] = 17] = "Integer";
|
|
57
|
+
ValueErrorType[ValueErrorType["IntegerMultipleOf"] = 18] = "IntegerMultipleOf";
|
|
58
|
+
ValueErrorType[ValueErrorType["IntegerExclusiveMinimum"] = 19] = "IntegerExclusiveMinimum";
|
|
59
|
+
ValueErrorType[ValueErrorType["IntegerExclusiveMaximum"] = 20] = "IntegerExclusiveMaximum";
|
|
60
|
+
ValueErrorType[ValueErrorType["IntegerMinimum"] = 21] = "IntegerMinimum";
|
|
61
|
+
ValueErrorType[ValueErrorType["IntegerMaximum"] = 22] = "IntegerMaximum";
|
|
62
|
+
ValueErrorType[ValueErrorType["Intersect"] = 23] = "Intersect";
|
|
63
|
+
ValueErrorType[ValueErrorType["IntersectUnevaluatedProperties"] = 24] = "IntersectUnevaluatedProperties";
|
|
64
|
+
ValueErrorType[ValueErrorType["Literal"] = 25] = "Literal";
|
|
65
|
+
ValueErrorType[ValueErrorType["Never"] = 26] = "Never";
|
|
66
|
+
ValueErrorType[ValueErrorType["Not"] = 27] = "Not";
|
|
67
|
+
ValueErrorType[ValueErrorType["Null"] = 28] = "Null";
|
|
68
|
+
ValueErrorType[ValueErrorType["Number"] = 29] = "Number";
|
|
69
|
+
ValueErrorType[ValueErrorType["NumberMultipleOf"] = 30] = "NumberMultipleOf";
|
|
70
|
+
ValueErrorType[ValueErrorType["NumberExclusiveMinimum"] = 31] = "NumberExclusiveMinimum";
|
|
71
|
+
ValueErrorType[ValueErrorType["NumberExclusiveMaximum"] = 32] = "NumberExclusiveMaximum";
|
|
72
|
+
ValueErrorType[ValueErrorType["NumberMinumum"] = 33] = "NumberMinumum";
|
|
73
|
+
ValueErrorType[ValueErrorType["NumberMaximum"] = 34] = "NumberMaximum";
|
|
74
|
+
ValueErrorType[ValueErrorType["Object"] = 35] = "Object";
|
|
75
|
+
ValueErrorType[ValueErrorType["ObjectMinProperties"] = 36] = "ObjectMinProperties";
|
|
76
|
+
ValueErrorType[ValueErrorType["ObjectMaxProperties"] = 37] = "ObjectMaxProperties";
|
|
77
|
+
ValueErrorType[ValueErrorType["ObjectAdditionalProperties"] = 38] = "ObjectAdditionalProperties";
|
|
78
|
+
ValueErrorType[ValueErrorType["ObjectRequiredProperties"] = 39] = "ObjectRequiredProperties";
|
|
79
|
+
ValueErrorType[ValueErrorType["Promise"] = 40] = "Promise";
|
|
80
|
+
ValueErrorType[ValueErrorType["RecordKeyNumeric"] = 41] = "RecordKeyNumeric";
|
|
81
|
+
ValueErrorType[ValueErrorType["RecordKeyString"] = 42] = "RecordKeyString";
|
|
82
|
+
ValueErrorType[ValueErrorType["String"] = 43] = "String";
|
|
83
|
+
ValueErrorType[ValueErrorType["StringMinLength"] = 44] = "StringMinLength";
|
|
84
|
+
ValueErrorType[ValueErrorType["StringMaxLength"] = 45] = "StringMaxLength";
|
|
85
|
+
ValueErrorType[ValueErrorType["StringPattern"] = 46] = "StringPattern";
|
|
86
|
+
ValueErrorType[ValueErrorType["StringFormatUnknown"] = 47] = "StringFormatUnknown";
|
|
87
|
+
ValueErrorType[ValueErrorType["StringFormat"] = 48] = "StringFormat";
|
|
88
|
+
ValueErrorType[ValueErrorType["Symbol"] = 49] = "Symbol";
|
|
89
|
+
ValueErrorType[ValueErrorType["TupleZeroLength"] = 50] = "TupleZeroLength";
|
|
90
|
+
ValueErrorType[ValueErrorType["TupleLength"] = 51] = "TupleLength";
|
|
91
|
+
ValueErrorType[ValueErrorType["Undefined"] = 52] = "Undefined";
|
|
92
|
+
ValueErrorType[ValueErrorType["Union"] = 53] = "Union";
|
|
93
|
+
ValueErrorType[ValueErrorType["Uint8Array"] = 54] = "Uint8Array";
|
|
94
|
+
ValueErrorType[ValueErrorType["Uint8ArrayMinByteLength"] = 55] = "Uint8ArrayMinByteLength";
|
|
95
|
+
ValueErrorType[ValueErrorType["Uint8ArrayMaxByteLength"] = 56] = "Uint8ArrayMaxByteLength";
|
|
96
|
+
ValueErrorType[ValueErrorType["Void"] = 57] = "Void";
|
|
97
|
+
ValueErrorType[ValueErrorType["Custom"] = 58] = "Custom";
|
|
98
|
+
})(ValueErrorType = exports.ValueErrorType || (exports.ValueErrorType = {}));
|
|
99
|
+
// -------------------------------------------------------------------
|
|
100
|
+
// ValueErrorIterator
|
|
101
|
+
// -------------------------------------------------------------------
|
|
102
|
+
class ValueErrorIterator {
|
|
103
|
+
constructor(iterator) {
|
|
104
|
+
this.iterator = iterator;
|
|
105
|
+
}
|
|
106
|
+
[Symbol.iterator]() {
|
|
107
|
+
return this.iterator;
|
|
108
|
+
}
|
|
109
|
+
/** Returns the first value error or undefined if no errors */
|
|
110
|
+
First() {
|
|
111
|
+
const next = this.iterator.next();
|
|
112
|
+
return next.done ? undefined : next.value;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
exports.ValueErrorIterator = ValueErrorIterator;
|
|
116
|
+
// -------------------------------------------------------------------
|
|
117
|
+
// ValueErrors
|
|
118
|
+
// -------------------------------------------------------------------
|
|
119
|
+
class ValueErrorsUnknownTypeError extends Error {
|
|
120
|
+
constructor(schema) {
|
|
121
|
+
super('ValueErrors: Unknown type');
|
|
122
|
+
this.schema = schema;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.ValueErrorsUnknownTypeError = ValueErrorsUnknownTypeError;
|
|
126
|
+
class ValueErrorsDereferenceError extends Error {
|
|
127
|
+
constructor(schema) {
|
|
128
|
+
super(`ValueErrors: Unable to dereference schema with $id '${schema.$ref}'`);
|
|
129
|
+
this.schema = schema;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
exports.ValueErrorsDereferenceError = ValueErrorsDereferenceError;
|
|
133
|
+
/** Provides functionality to generate a sequence of errors against a TypeBox type. */
|
|
134
|
+
var ValueErrors;
|
|
135
|
+
(function (ValueErrors) {
|
|
136
|
+
// ----------------------------------------------------------------------
|
|
137
|
+
// Guards
|
|
138
|
+
// ----------------------------------------------------------------------
|
|
139
|
+
function IsBigInt(value) {
|
|
140
|
+
return typeof value === 'bigint';
|
|
141
|
+
}
|
|
142
|
+
function IsInteger(value) {
|
|
143
|
+
return globalThis.Number.isInteger(value);
|
|
144
|
+
}
|
|
145
|
+
function IsString(value) {
|
|
146
|
+
return typeof value === 'string';
|
|
147
|
+
}
|
|
148
|
+
function IsDefined(value) {
|
|
149
|
+
return value !== undefined;
|
|
150
|
+
}
|
|
151
|
+
// ----------------------------------------------------------------------
|
|
152
|
+
// Policies
|
|
153
|
+
// ----------------------------------------------------------------------
|
|
154
|
+
function IsExactOptionalProperty(value, key) {
|
|
155
|
+
return index_1.TypeSystem.ExactOptionalPropertyTypes ? key in value : value[key] !== undefined;
|
|
156
|
+
}
|
|
157
|
+
function IsObject(value) {
|
|
158
|
+
const result = typeof value === 'object' && value !== null;
|
|
159
|
+
return index_1.TypeSystem.AllowArrayObjects ? result : result && !globalThis.Array.isArray(value);
|
|
160
|
+
}
|
|
161
|
+
function IsRecordObject(value) {
|
|
162
|
+
return IsObject(value) && !(value instanceof globalThis.Date) && !(value instanceof globalThis.Uint8Array);
|
|
163
|
+
}
|
|
164
|
+
function IsNumber(value) {
|
|
165
|
+
const result = typeof value === 'number';
|
|
166
|
+
return index_1.TypeSystem.AllowNaN ? result : result && globalThis.Number.isFinite(value);
|
|
167
|
+
}
|
|
168
|
+
function IsVoid(value) {
|
|
169
|
+
const result = value === undefined;
|
|
170
|
+
return index_1.TypeSystem.AllowVoidNull ? result || value === null : result;
|
|
171
|
+
}
|
|
172
|
+
// ----------------------------------------------------------------------
|
|
173
|
+
// Types
|
|
174
|
+
// ----------------------------------------------------------------------
|
|
175
|
+
function* Any(schema, references, path, value) { }
|
|
176
|
+
function* Array(schema, references, path, value) {
|
|
177
|
+
if (!globalThis.Array.isArray(value)) {
|
|
178
|
+
return yield { type: ValueErrorType.Array, schema, path, value, message: `Expected array` };
|
|
179
|
+
}
|
|
180
|
+
if (IsDefined(schema.minItems) && !(value.length >= schema.minItems)) {
|
|
181
|
+
yield { type: ValueErrorType.ArrayMinItems, schema, path, value, message: `Expected array length to be greater or equal to ${schema.minItems}` };
|
|
182
|
+
}
|
|
183
|
+
if (IsDefined(schema.maxItems) && !(value.length <= schema.maxItems)) {
|
|
184
|
+
yield { type: ValueErrorType.ArrayMinItems, schema, path, value, message: `Expected array length to be less or equal to ${schema.maxItems}` };
|
|
185
|
+
}
|
|
186
|
+
// prettier-ignore
|
|
187
|
+
if (schema.uniqueItems === true && !((function () { const set = new Set(); for (const element of value) {
|
|
188
|
+
const hashed = hash_1.ValueHash.Create(element);
|
|
189
|
+
if (set.has(hashed)) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
set.add(hashed);
|
|
194
|
+
}
|
|
195
|
+
} return true; })())) {
|
|
196
|
+
yield { type: ValueErrorType.ArrayUniqueItems, schema, path, value, message: `Expected array elements to be unique` };
|
|
197
|
+
}
|
|
198
|
+
for (let i = 0; i < value.length; i++) {
|
|
199
|
+
yield* Visit(schema.items, references, `${path}/${i}`, value[i]);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function* BigInt(schema, references, path, value) {
|
|
203
|
+
if (!IsBigInt(value)) {
|
|
204
|
+
return yield { type: ValueErrorType.BigInt, schema, path, value, message: `Expected bigint` };
|
|
205
|
+
}
|
|
206
|
+
if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === globalThis.BigInt(0))) {
|
|
207
|
+
yield { type: ValueErrorType.BigIntMultipleOf, schema, path, value, message: `Expected bigint to be a multiple of ${schema.multipleOf}` };
|
|
208
|
+
}
|
|
209
|
+
if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {
|
|
210
|
+
yield { type: ValueErrorType.BigIntExclusiveMinimum, schema, path, value, message: `Expected bigint to be greater than ${schema.exclusiveMinimum}` };
|
|
211
|
+
}
|
|
212
|
+
if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {
|
|
213
|
+
yield { type: ValueErrorType.BigIntExclusiveMaximum, schema, path, value, message: `Expected bigint to be less than ${schema.exclusiveMaximum}` };
|
|
214
|
+
}
|
|
215
|
+
if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {
|
|
216
|
+
yield { type: ValueErrorType.BigIntMinimum, schema, path, value, message: `Expected bigint to be greater or equal to ${schema.minimum}` };
|
|
217
|
+
}
|
|
218
|
+
if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {
|
|
219
|
+
yield { type: ValueErrorType.BigIntMaximum, schema, path, value, message: `Expected bigint to be less or equal to ${schema.maximum}` };
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
function* Boolean(schema, references, path, value) {
|
|
223
|
+
if (!(typeof value === 'boolean')) {
|
|
224
|
+
return yield { type: ValueErrorType.Boolean, schema, path, value, message: `Expected boolean` };
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
function* Constructor(schema, references, path, value) {
|
|
228
|
+
yield* Visit(schema.returns, references, path, value.prototype);
|
|
229
|
+
}
|
|
230
|
+
function* Date(schema, references, path, value) {
|
|
231
|
+
if (!(value instanceof globalThis.Date)) {
|
|
232
|
+
return yield { type: ValueErrorType.Date, schema, path, value, message: `Expected Date object` };
|
|
233
|
+
}
|
|
234
|
+
if (!globalThis.isFinite(value.getTime())) {
|
|
235
|
+
return yield { type: ValueErrorType.Date, schema, path, value, message: `Invalid Date` };
|
|
236
|
+
}
|
|
237
|
+
if (IsDefined(schema.exclusiveMinimumTimestamp) && !(value.getTime() > schema.exclusiveMinimumTimestamp)) {
|
|
238
|
+
yield { type: ValueErrorType.DateExclusiveMinimumTimestamp, schema, path, value, message: `Expected Date timestamp to be greater than ${schema.exclusiveMinimum}` };
|
|
239
|
+
}
|
|
240
|
+
if (IsDefined(schema.exclusiveMaximumTimestamp) && !(value.getTime() < schema.exclusiveMaximumTimestamp)) {
|
|
241
|
+
yield { type: ValueErrorType.DateExclusiveMaximumTimestamp, schema, path, value, message: `Expected Date timestamp to be less than ${schema.exclusiveMaximum}` };
|
|
242
|
+
}
|
|
243
|
+
if (IsDefined(schema.minimumTimestamp) && !(value.getTime() >= schema.minimumTimestamp)) {
|
|
244
|
+
yield { type: ValueErrorType.DateMinimumTimestamp, schema, path, value, message: `Expected Date timestamp to be greater or equal to ${schema.minimum}` };
|
|
245
|
+
}
|
|
246
|
+
if (IsDefined(schema.maximumTimestamp) && !(value.getTime() <= schema.maximumTimestamp)) {
|
|
247
|
+
yield { type: ValueErrorType.DateMaximumTimestamp, schema, path, value, message: `Expected Date timestamp to be less or equal to ${schema.maximum}` };
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
function* Function(schema, references, path, value) {
|
|
251
|
+
if (!(typeof value === 'function')) {
|
|
252
|
+
return yield { type: ValueErrorType.Function, schema, path, value, message: `Expected function` };
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
function* Integer(schema, references, path, value) {
|
|
256
|
+
if (!IsInteger(value)) {
|
|
257
|
+
return yield { type: ValueErrorType.Integer, schema, path, value, message: `Expected integer` };
|
|
258
|
+
}
|
|
259
|
+
if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) {
|
|
260
|
+
yield { type: ValueErrorType.IntegerMultipleOf, schema, path, value, message: `Expected integer to be a multiple of ${schema.multipleOf}` };
|
|
261
|
+
}
|
|
262
|
+
if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {
|
|
263
|
+
yield { type: ValueErrorType.IntegerExclusiveMinimum, schema, path, value, message: `Expected integer to be greater than ${schema.exclusiveMinimum}` };
|
|
264
|
+
}
|
|
265
|
+
if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {
|
|
266
|
+
yield { type: ValueErrorType.IntegerExclusiveMaximum, schema, path, value, message: `Expected integer to be less than ${schema.exclusiveMaximum}` };
|
|
267
|
+
}
|
|
268
|
+
if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {
|
|
269
|
+
yield { type: ValueErrorType.IntegerMinimum, schema, path, value, message: `Expected integer to be greater or equal to ${schema.minimum}` };
|
|
270
|
+
}
|
|
271
|
+
if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {
|
|
272
|
+
yield { type: ValueErrorType.IntegerMaximum, schema, path, value, message: `Expected integer to be less or equal to ${schema.maximum}` };
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
function* Intersect(schema, references, path, value) {
|
|
276
|
+
for (const subschema of schema.allOf) {
|
|
277
|
+
const next = Visit(subschema, references, path, value).next();
|
|
278
|
+
if (!next.done) {
|
|
279
|
+
yield next.value;
|
|
280
|
+
yield { type: ValueErrorType.Intersect, schema, path, value, message: `Expected all sub schemas to be valid` };
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
if (schema.unevaluatedProperties === false) {
|
|
285
|
+
const schemaKeys = Types.KeyResolver.Resolve(schema);
|
|
286
|
+
const valueKeys = globalThis.Object.getOwnPropertyNames(value);
|
|
287
|
+
for (const valueKey of valueKeys) {
|
|
288
|
+
if (!schemaKeys.includes(valueKey)) {
|
|
289
|
+
yield { type: ValueErrorType.IntersectUnevaluatedProperties, schema, path: `${path}/${valueKey}`, value, message: `Unexpected property` };
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
if (typeof schema.unevaluatedProperties === 'object') {
|
|
294
|
+
const schemaKeys = Types.KeyResolver.Resolve(schema);
|
|
295
|
+
const valueKeys = globalThis.Object.getOwnPropertyNames(value);
|
|
296
|
+
for (const valueKey of valueKeys) {
|
|
297
|
+
if (!schemaKeys.includes(valueKey)) {
|
|
298
|
+
const next = Visit(schema.unevaluatedProperties, references, `${path}/${valueKey}`, value[valueKey]).next();
|
|
299
|
+
if (!next.done) {
|
|
300
|
+
yield next.value;
|
|
301
|
+
yield { type: ValueErrorType.IntersectUnevaluatedProperties, schema, path: `${path}/${valueKey}`, value, message: `Invalid additional property` };
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
function* Literal(schema, references, path, value) {
|
|
309
|
+
if (!(value === schema.const)) {
|
|
310
|
+
const error = typeof schema.const === 'string' ? `'${schema.const}'` : schema.const;
|
|
311
|
+
return yield { type: ValueErrorType.Literal, schema, path, value, message: `Expected ${error}` };
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function* Never(schema, references, path, value) {
|
|
315
|
+
yield { type: ValueErrorType.Never, schema, path, value, message: `Value cannot be validated` };
|
|
316
|
+
}
|
|
317
|
+
function* Not(schema, references, path, value) {
|
|
318
|
+
if (Visit(schema.allOf[0].not, references, path, value).next().done === true) {
|
|
319
|
+
yield { type: ValueErrorType.Not, schema, path, value, message: `Value should not validate` };
|
|
320
|
+
}
|
|
321
|
+
yield* Visit(schema.allOf[1], references, path, value);
|
|
322
|
+
}
|
|
323
|
+
function* Null(schema, references, path, value) {
|
|
324
|
+
if (!(value === null)) {
|
|
325
|
+
return yield { type: ValueErrorType.Null, schema, path, value, message: `Expected null` };
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
function* Number(schema, references, path, value) {
|
|
329
|
+
if (!IsNumber(value)) {
|
|
330
|
+
return yield { type: ValueErrorType.Number, schema, path, value, message: `Expected number` };
|
|
331
|
+
}
|
|
332
|
+
if (IsDefined(schema.multipleOf) && !(value % schema.multipleOf === 0)) {
|
|
333
|
+
yield { type: ValueErrorType.NumberMultipleOf, schema, path, value, message: `Expected number to be a multiple of ${schema.multipleOf}` };
|
|
334
|
+
}
|
|
335
|
+
if (IsDefined(schema.exclusiveMinimum) && !(value > schema.exclusiveMinimum)) {
|
|
336
|
+
yield { type: ValueErrorType.NumberExclusiveMinimum, schema, path, value, message: `Expected number to be greater than ${schema.exclusiveMinimum}` };
|
|
337
|
+
}
|
|
338
|
+
if (IsDefined(schema.exclusiveMaximum) && !(value < schema.exclusiveMaximum)) {
|
|
339
|
+
yield { type: ValueErrorType.NumberExclusiveMaximum, schema, path, value, message: `Expected number to be less than ${schema.exclusiveMaximum}` };
|
|
340
|
+
}
|
|
341
|
+
if (IsDefined(schema.minimum) && !(value >= schema.minimum)) {
|
|
342
|
+
yield { type: ValueErrorType.NumberMaximum, schema, path, value, message: `Expected number to be greater or equal to ${schema.minimum}` };
|
|
343
|
+
}
|
|
344
|
+
if (IsDefined(schema.maximum) && !(value <= schema.maximum)) {
|
|
345
|
+
yield { type: ValueErrorType.NumberMinumum, schema, path, value, message: `Expected number to be less or equal to ${schema.maximum}` };
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
function* Object(schema, references, path, value) {
|
|
349
|
+
if (!IsObject(value)) {
|
|
350
|
+
return yield { type: ValueErrorType.Object, schema, path, value, message: `Expected object` };
|
|
351
|
+
}
|
|
352
|
+
if (IsDefined(schema.minProperties) && !(globalThis.Object.getOwnPropertyNames(value).length >= schema.minProperties)) {
|
|
353
|
+
yield { type: ValueErrorType.ObjectMinProperties, schema, path, value, message: `Expected object to have at least ${schema.minProperties} properties` };
|
|
354
|
+
}
|
|
355
|
+
if (IsDefined(schema.maxProperties) && !(globalThis.Object.getOwnPropertyNames(value).length <= schema.maxProperties)) {
|
|
356
|
+
yield { type: ValueErrorType.ObjectMaxProperties, schema, path, value, message: `Expected object to have less than ${schema.minProperties} properties` };
|
|
357
|
+
}
|
|
358
|
+
const requiredKeys = globalThis.Array.isArray(schema.required) ? schema.required : [];
|
|
359
|
+
const knownKeys = globalThis.Object.getOwnPropertyNames(schema.properties);
|
|
360
|
+
const unknownKeys = globalThis.Object.getOwnPropertyNames(value);
|
|
361
|
+
for (const knownKey of knownKeys) {
|
|
362
|
+
const property = schema.properties[knownKey];
|
|
363
|
+
if (schema.required && schema.required.includes(knownKey)) {
|
|
364
|
+
yield* Visit(property, references, `${path}/${knownKey}`, value[knownKey]);
|
|
365
|
+
if (Types.ExtendsUndefined.Check(schema) && !(knownKey in value)) {
|
|
366
|
+
yield { type: ValueErrorType.ObjectRequiredProperties, schema: property, path: `${path}/${knownKey}`, value: undefined, message: `Expected required property` };
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
if (IsExactOptionalProperty(value, knownKey)) {
|
|
371
|
+
yield* Visit(property, references, `${path}/${knownKey}`, value[knownKey]);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
for (const requiredKey of requiredKeys) {
|
|
376
|
+
if (unknownKeys.includes(requiredKey))
|
|
377
|
+
continue;
|
|
378
|
+
yield { type: ValueErrorType.ObjectRequiredProperties, schema: schema.properties[requiredKey], path: `${path}/${requiredKey}`, value: undefined, message: `Expected required property` };
|
|
379
|
+
}
|
|
380
|
+
if (schema.additionalProperties === false) {
|
|
381
|
+
for (const valueKey of unknownKeys) {
|
|
382
|
+
if (!knownKeys.includes(valueKey)) {
|
|
383
|
+
yield { type: ValueErrorType.ObjectAdditionalProperties, schema, path: `${path}/${valueKey}`, value: value[valueKey], message: `Unexpected property` };
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
if (typeof schema.additionalProperties === 'object') {
|
|
388
|
+
for (const valueKey of unknownKeys) {
|
|
389
|
+
if (knownKeys.includes(valueKey))
|
|
390
|
+
continue;
|
|
391
|
+
yield* Visit(schema.additionalProperties, references, `${path}/${valueKey}`, value[valueKey]);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
function* Promise(schema, references, path, value) {
|
|
396
|
+
if (!(typeof value === 'object' && typeof value.then === 'function')) {
|
|
397
|
+
yield { type: ValueErrorType.Promise, schema, path, value, message: `Expected Promise` };
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
function* Record(schema, references, path, value) {
|
|
401
|
+
if (!IsRecordObject(value)) {
|
|
402
|
+
return yield { type: ValueErrorType.Object, schema, path, value, message: `Expected record object` };
|
|
403
|
+
}
|
|
404
|
+
if (IsDefined(schema.minProperties) && !(globalThis.Object.getOwnPropertyNames(value).length >= schema.minProperties)) {
|
|
405
|
+
yield { type: ValueErrorType.ObjectMinProperties, schema, path, value, message: `Expected object to have at least ${schema.minProperties} properties` };
|
|
406
|
+
}
|
|
407
|
+
if (IsDefined(schema.maxProperties) && !(globalThis.Object.getOwnPropertyNames(value).length <= schema.maxProperties)) {
|
|
408
|
+
yield { type: ValueErrorType.ObjectMaxProperties, schema, path, value, message: `Expected object to have less than ${schema.minProperties} properties` };
|
|
409
|
+
}
|
|
410
|
+
const [keyPattern, valueSchema] = globalThis.Object.entries(schema.patternProperties)[0];
|
|
411
|
+
const regex = new RegExp(keyPattern);
|
|
412
|
+
if (!globalThis.Object.getOwnPropertyNames(value).every((key) => regex.test(key))) {
|
|
413
|
+
const numeric = keyPattern === Types.PatternNumberExact;
|
|
414
|
+
const type = numeric ? ValueErrorType.RecordKeyNumeric : ValueErrorType.RecordKeyString;
|
|
415
|
+
const message = numeric ? 'Expected all object property keys to be numeric' : 'Expected all object property keys to be strings';
|
|
416
|
+
return yield { type, schema, path, value, message };
|
|
417
|
+
}
|
|
418
|
+
for (const [propKey, propValue] of globalThis.Object.entries(value)) {
|
|
419
|
+
yield* Visit(valueSchema, references, `${path}/${propKey}`, propValue);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
function* Ref(schema, references, path, value) {
|
|
423
|
+
const index = references.findIndex((foreign) => foreign.$id === schema.$ref);
|
|
424
|
+
if (index === -1)
|
|
425
|
+
throw new ValueErrorsDereferenceError(schema);
|
|
426
|
+
const target = references[index];
|
|
427
|
+
yield* Visit(target, references, path, value);
|
|
428
|
+
}
|
|
429
|
+
function* String(schema, references, path, value) {
|
|
430
|
+
if (!IsString(value)) {
|
|
431
|
+
return yield { type: ValueErrorType.String, schema, path, value, message: 'Expected string' };
|
|
432
|
+
}
|
|
433
|
+
if (IsDefined(schema.minLength) && !(value.length >= schema.minLength)) {
|
|
434
|
+
yield { type: ValueErrorType.StringMinLength, schema, path, value, message: `Expected string length greater or equal to ${schema.minLength}` };
|
|
435
|
+
}
|
|
436
|
+
if (IsDefined(schema.maxLength) && !(value.length <= schema.maxLength)) {
|
|
437
|
+
yield { type: ValueErrorType.StringMaxLength, schema, path, value, message: `Expected string length less or equal to ${schema.maxLength}` };
|
|
438
|
+
}
|
|
439
|
+
if (schema.pattern !== undefined) {
|
|
440
|
+
const regex = new RegExp(schema.pattern);
|
|
441
|
+
if (!regex.test(value)) {
|
|
442
|
+
yield { type: ValueErrorType.StringPattern, schema, path, value, message: `Expected string to match pattern ${schema.pattern}` };
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
if (schema.format !== undefined) {
|
|
446
|
+
if (!Types.FormatRegistry.Has(schema.format)) {
|
|
447
|
+
yield { type: ValueErrorType.StringFormatUnknown, schema, path, value, message: `Unknown string format '${schema.format}'` };
|
|
448
|
+
}
|
|
449
|
+
else {
|
|
450
|
+
const format = Types.FormatRegistry.Get(schema.format);
|
|
451
|
+
if (!format(value)) {
|
|
452
|
+
yield { type: ValueErrorType.StringFormat, schema, path, value, message: `Expected string to match format '${schema.format}'` };
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
function* Symbol(schema, references, path, value) {
|
|
458
|
+
if (!(typeof value === 'symbol')) {
|
|
459
|
+
return yield { type: ValueErrorType.Symbol, schema, path, value, message: 'Expected symbol' };
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
function* TemplateLiteral(schema, references, path, value) {
|
|
463
|
+
if (!IsString(value)) {
|
|
464
|
+
return yield { type: ValueErrorType.String, schema, path, value, message: 'Expected string' };
|
|
465
|
+
}
|
|
466
|
+
const regex = new RegExp(schema.pattern);
|
|
467
|
+
if (!regex.test(value)) {
|
|
468
|
+
yield { type: ValueErrorType.StringPattern, schema, path, value, message: `Expected string to match pattern ${schema.pattern}` };
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
function* This(schema, references, path, value) {
|
|
472
|
+
const index = references.findIndex((foreign) => foreign.$id === schema.$ref);
|
|
473
|
+
if (index === -1)
|
|
474
|
+
throw new ValueErrorsDereferenceError(schema);
|
|
475
|
+
const target = references[index];
|
|
476
|
+
yield* Visit(target, references, path, value);
|
|
477
|
+
}
|
|
478
|
+
function* Tuple(schema, references, path, value) {
|
|
479
|
+
if (!globalThis.Array.isArray(value)) {
|
|
480
|
+
return yield { type: ValueErrorType.Array, schema, path, value, message: 'Expected Array' };
|
|
481
|
+
}
|
|
482
|
+
if (schema.items === undefined && !(value.length === 0)) {
|
|
483
|
+
return yield { type: ValueErrorType.TupleZeroLength, schema, path, value, message: 'Expected tuple to have 0 elements' };
|
|
484
|
+
}
|
|
485
|
+
if (!(value.length === schema.maxItems)) {
|
|
486
|
+
yield { type: ValueErrorType.TupleLength, schema, path, value, message: `Expected tuple to have ${schema.maxItems} elements` };
|
|
487
|
+
}
|
|
488
|
+
if (!schema.items) {
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
for (let i = 0; i < schema.items.length; i++) {
|
|
492
|
+
yield* Visit(schema.items[i], references, `${path}/${i}`, value[i]);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
function* Undefined(schema, references, path, value) {
|
|
496
|
+
if (!(value === undefined)) {
|
|
497
|
+
yield { type: ValueErrorType.Undefined, schema, path, value, message: `Expected undefined` };
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
function* Union(schema, references, path, value) {
|
|
501
|
+
const errors = [];
|
|
502
|
+
for (const inner of schema.anyOf) {
|
|
503
|
+
const variantErrors = [...Visit(inner, references, path, value)];
|
|
504
|
+
if (variantErrors.length === 0)
|
|
505
|
+
return;
|
|
506
|
+
errors.push(...variantErrors);
|
|
507
|
+
}
|
|
508
|
+
if (errors.length > 0) {
|
|
509
|
+
yield { type: ValueErrorType.Union, schema, path, value, message: 'Expected value of union' };
|
|
510
|
+
}
|
|
511
|
+
for (const error of errors) {
|
|
512
|
+
yield error;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
function* Uint8Array(schema, references, path, value) {
|
|
516
|
+
if (!(value instanceof globalThis.Uint8Array)) {
|
|
517
|
+
return yield { type: ValueErrorType.Uint8Array, schema, path, value, message: `Expected Uint8Array` };
|
|
518
|
+
}
|
|
519
|
+
if (IsDefined(schema.maxByteLength) && !(value.length <= schema.maxByteLength)) {
|
|
520
|
+
yield { type: ValueErrorType.Uint8ArrayMaxByteLength, schema, path, value, message: `Expected Uint8Array to have a byte length less or equal to ${schema.maxByteLength}` };
|
|
521
|
+
}
|
|
522
|
+
if (IsDefined(schema.minByteLength) && !(value.length >= schema.minByteLength)) {
|
|
523
|
+
yield { type: ValueErrorType.Uint8ArrayMinByteLength, schema, path, value, message: `Expected Uint8Array to have a byte length greater or equal to ${schema.maxByteLength}` };
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
function* Unknown(schema, references, path, value) { }
|
|
527
|
+
function* Void(schema, references, path, value) {
|
|
528
|
+
if (!IsVoid(value)) {
|
|
529
|
+
return yield { type: ValueErrorType.Void, schema, path, value, message: `Expected void` };
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
function* UserDefined(schema, references, path, value) {
|
|
533
|
+
const check = Types.TypeRegistry.Get(schema[Types.Kind]);
|
|
534
|
+
if (!check(schema, value)) {
|
|
535
|
+
return yield { type: ValueErrorType.Custom, schema, path, value, message: `Expected kind ${schema[Types.Kind]}` };
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
function* Visit(schema, references, path, value) {
|
|
539
|
+
const references_ = IsDefined(schema.$id) ? [...references, schema] : references;
|
|
540
|
+
const schema_ = schema;
|
|
541
|
+
switch (schema_[Types.Kind]) {
|
|
542
|
+
case 'Any':
|
|
543
|
+
return yield* Any(schema_, references_, path, value);
|
|
544
|
+
case 'Array':
|
|
545
|
+
return yield* Array(schema_, references_, path, value);
|
|
546
|
+
case 'BigInt':
|
|
547
|
+
return yield* BigInt(schema_, references_, path, value);
|
|
548
|
+
case 'Boolean':
|
|
549
|
+
return yield* Boolean(schema_, references_, path, value);
|
|
550
|
+
case 'Constructor':
|
|
551
|
+
return yield* Constructor(schema_, references_, path, value);
|
|
552
|
+
case 'Date':
|
|
553
|
+
return yield* Date(schema_, references_, path, value);
|
|
554
|
+
case 'Function':
|
|
555
|
+
return yield* Function(schema_, references_, path, value);
|
|
556
|
+
case 'Integer':
|
|
557
|
+
return yield* Integer(schema_, references_, path, value);
|
|
558
|
+
case 'Intersect':
|
|
559
|
+
return yield* Intersect(schema_, references_, path, value);
|
|
560
|
+
case 'Literal':
|
|
561
|
+
return yield* Literal(schema_, references_, path, value);
|
|
562
|
+
case 'Never':
|
|
563
|
+
return yield* Never(schema_, references_, path, value);
|
|
564
|
+
case 'Not':
|
|
565
|
+
return yield* Not(schema_, references_, path, value);
|
|
566
|
+
case 'Null':
|
|
567
|
+
return yield* Null(schema_, references_, path, value);
|
|
568
|
+
case 'Number':
|
|
569
|
+
return yield* Number(schema_, references_, path, value);
|
|
570
|
+
case 'Object':
|
|
571
|
+
return yield* Object(schema_, references_, path, value);
|
|
572
|
+
case 'Promise':
|
|
573
|
+
return yield* Promise(schema_, references_, path, value);
|
|
574
|
+
case 'Record':
|
|
575
|
+
return yield* Record(schema_, references_, path, value);
|
|
576
|
+
case 'Ref':
|
|
577
|
+
return yield* Ref(schema_, references_, path, value);
|
|
578
|
+
case 'String':
|
|
579
|
+
return yield* String(schema_, references_, path, value);
|
|
580
|
+
case 'Symbol':
|
|
581
|
+
return yield* Symbol(schema_, references_, path, value);
|
|
582
|
+
case 'TemplateLiteral':
|
|
583
|
+
return yield* TemplateLiteral(schema_, references_, path, value);
|
|
584
|
+
case 'This':
|
|
585
|
+
return yield* This(schema_, references_, path, value);
|
|
586
|
+
case 'Tuple':
|
|
587
|
+
return yield* Tuple(schema_, references_, path, value);
|
|
588
|
+
case 'Undefined':
|
|
589
|
+
return yield* Undefined(schema_, references_, path, value);
|
|
590
|
+
case 'Union':
|
|
591
|
+
return yield* Union(schema_, references_, path, value);
|
|
592
|
+
case 'Uint8Array':
|
|
593
|
+
return yield* Uint8Array(schema_, references_, path, value);
|
|
594
|
+
case 'Unknown':
|
|
595
|
+
return yield* Unknown(schema_, references_, path, value);
|
|
596
|
+
case 'Void':
|
|
597
|
+
return yield* Void(schema_, references_, path, value);
|
|
598
|
+
default:
|
|
599
|
+
if (!Types.TypeRegistry.Has(schema_[Types.Kind]))
|
|
600
|
+
throw new ValueErrorsUnknownTypeError(schema);
|
|
601
|
+
return yield* UserDefined(schema_, references_, path, value);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
function Errors(schema, references, value) {
|
|
605
|
+
const iterator = Visit(schema, references, '', value);
|
|
606
|
+
return new ValueErrorIterator(iterator);
|
|
607
|
+
}
|
|
608
|
+
ValueErrors.Errors = Errors;
|
|
609
|
+
})(ValueErrors = exports.ValueErrors || (exports.ValueErrors = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './errors';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*--------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
@sinclair/typebox/errors
|
|
5
|
+
|
|
6
|
+
The MIT License (MIT)
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2017-2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in
|
|
18
|
+
all copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
|
+
THE SOFTWARE.
|
|
27
|
+
|
|
28
|
+
---------------------------------------------------------------------------*/
|
|
29
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
30
|
+
if (k2 === undefined) k2 = k;
|
|
31
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
32
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
33
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
34
|
+
}
|
|
35
|
+
Object.defineProperty(o, k2, desc);
|
|
36
|
+
}) : (function(o, m, k, k2) {
|
|
37
|
+
if (k2 === undefined) k2 = k;
|
|
38
|
+
o[k2] = m[k];
|
|
39
|
+
}));
|
|
40
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
41
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
__exportStar(require("./errors"), exports);
|