@versionzero/schema 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +177 -0
- package/README.md +246 -0
- package/package.json +84 -0
- package/src/compilation/handler-compilation.js +28 -0
- package/src/compilation/metadata-compilation.js +35 -0
- package/src/compilation/schema-compilation.js +142 -0
- package/src/compilation/selection-compilation.js +84 -0
- package/src/compilation/union-compilation.js +510 -0
- package/src/compilation/values-compilation.js +35 -0
- package/src/compiled-schema.js +1709 -0
- package/src/constants.js +1 -0
- package/src/core-library/index.js +32 -0
- package/src/core-library/processors/aggregation-operators.js +75 -0
- package/src/core-library/processors/alpha-constraint.js +20 -0
- package/src/core-library/processors/alphanum-constraint.js +20 -0
- package/src/core-library/processors/array-operator.js +51 -0
- package/src/core-library/processors/assert-constraint.js +75 -0
- package/src/core-library/processors/base64-constraint.js +26 -0
- package/src/core-library/processors/camel-case-operator.js +24 -0
- package/src/core-library/processors/capitalize-operator.js +16 -0
- package/src/core-library/processors/cardnum-constraint.js +193 -0
- package/src/core-library/processors/ceil-operator.js +44 -0
- package/src/core-library/processors/collapse-operator.js +29 -0
- package/src/core-library/processors/compact-operator.js +34 -0
- package/src/core-library/processors/compile-operator.js +65 -0
- package/src/core-library/processors/concat-operator.js +51 -0
- package/src/core-library/processors/conditional-operators.js +301 -0
- package/src/core-library/processors/constant-case-operator.js +16 -0
- package/src/core-library/processors/data-size-operator.js +86 -0
- package/src/core-library/processors/date-object-operator.js +54 -0
- package/src/core-library/processors/date-operator.js +67 -0
- package/src/core-library/processors/date-range-constraint.js +76 -0
- package/src/core-library/processors/defined-constraint.js +30 -0
- package/src/core-library/processors/each-operator.js +57 -0
- package/src/core-library/processors/email-constraint.js +112 -0
- package/src/core-library/processors/entries-operator.js +25 -0
- package/src/core-library/processors/eq-constraint.js +37 -0
- package/src/core-library/processors/filter-operator.js +74 -0
- package/src/core-library/processors/find-schema-operator.js +45 -0
- package/src/core-library/processors/flatten-operator.js +40 -0
- package/src/core-library/processors/floor-operator.js +47 -0
- package/src/core-library/processors/get-operator.js +44 -0
- package/src/core-library/processors/group-by-operator.js +84 -0
- package/src/core-library/processors/has-prefix-constraint.js +37 -0
- package/src/core-library/processors/has-suffix-constraint.js +35 -0
- package/src/core-library/processors/hex-constraint.js +20 -0
- package/src/core-library/processors/hostname-constraint.js +22 -0
- package/src/core-library/processors/http-url-constraint.js +27 -0
- package/src/core-library/processors/in-constraint.js +66 -0
- package/src/core-library/processors/index-by-operator.js +98 -0
- package/src/core-library/processors/index.js +131 -0
- package/src/core-library/processors/input-operator.js +23 -0
- package/src/core-library/processors/instanceof-constraint.js +38 -0
- package/src/core-library/processors/integer-constraint.js +22 -0
- package/src/core-library/processors/invoke-operator.js +33 -0
- package/src/core-library/processors/ipv4-constraint.js +188 -0
- package/src/core-library/processors/ipv6-constraint.js +205 -0
- package/src/core-library/processors/is-array-constraint.js +21 -0
- package/src/core-library/processors/is-date-constraint.js +22 -0
- package/src/core-library/processors/is-number-constraint.js +21 -0
- package/src/core-library/processors/is-object-constraint.js +21 -0
- package/src/core-library/processors/is-string-constraint.js +21 -0
- package/src/core-library/processors/join-operator.js +41 -0
- package/src/core-library/processors/json-constraint.js +22 -0
- package/src/core-library/processors/json-decode-operator.js +25 -0
- package/src/core-library/processors/json-encode-operator.js +35 -0
- package/src/core-library/processors/kebab-case-operator.js +23 -0
- package/src/core-library/processors/keys-operator.js +20 -0
- package/src/core-library/processors/length-constraint.js +85 -0
- package/src/core-library/processors/lookup-operator.js +84 -0
- package/src/core-library/processors/lowercase-operator.js +14 -0
- package/src/core-library/processors/map-operator.js +84 -0
- package/src/core-library/processors/match-operator.js +64 -0
- package/src/core-library/processors/matches-constraint.js +54 -0
- package/src/core-library/processors/math-operators.js +151 -0
- package/src/core-library/processors/merge-deep-operator.js +61 -0
- package/src/core-library/processors/merge-operator.js +54 -0
- package/src/core-library/processors/metadata-operator.js +100 -0
- package/src/core-library/processors/negative-constraint.js +23 -0
- package/src/core-library/processors/never-constraint.js +69 -0
- package/src/core-library/processors/non-empty-constraint.js +59 -0
- package/src/core-library/processors/not-constraint.js +71 -0
- package/src/core-library/processors/number-operator.js +24 -0
- package/src/core-library/processors/numeric-constraint.js +22 -0
- package/src/core-library/processors/object-operator.js +38 -0
- package/src/core-library/processors/omit-operator.js +57 -0
- package/src/core-library/processors/parallel-operator.js +64 -0
- package/src/core-library/processors/pascal-case-operator.js +16 -0
- package/src/core-library/processors/phone-constraint.js +235 -0
- package/src/core-library/processors/pick-operator.js +62 -0
- package/src/core-library/processors/pipeline-operator.js +63 -0
- package/src/core-library/processors/port-constraint.js +22 -0
- package/src/core-library/processors/positive-constraint.js +23 -0
- package/src/core-library/processors/process-operator.js +55 -0
- package/src/core-library/processors/property-operator.js +49 -0
- package/src/core-library/processors/range-constraint.js +72 -0
- package/src/core-library/processors/reference-operator.js +79 -0
- package/src/core-library/processors/require-constraint.js +74 -0
- package/src/core-library/processors/reverse-operator.js +20 -0
- package/src/core-library/processors/round-operator.js +53 -0
- package/src/core-library/processors/schema-handler-operators.js +54 -0
- package/src/core-library/processors/semver-constraint.js +282 -0
- package/src/core-library/processors/sequence-processors.js +406 -0
- package/src/core-library/processors/sort-operator.js +52 -0
- package/src/core-library/processors/split-operator.js +43 -0
- package/src/core-library/processors/string-extra-operators.js +141 -0
- package/src/core-library/processors/string-operator.js +34 -0
- package/src/core-library/processors/target-operator.js +30 -0
- package/src/core-library/processors/template-operator.js +60 -0
- package/src/core-library/processors/title-case-operator.js +17 -0
- package/src/core-library/processors/trim-operator.js +14 -0
- package/src/core-library/processors/truthy-constraint.js +35 -0
- package/src/core-library/processors/type-operator.js +24 -0
- package/src/core-library/processors/unique-operator.js +21 -0
- package/src/core-library/processors/uppercase-operator.js +14 -0
- package/src/core-library/processors/url-constraint.js +31 -0
- package/src/core-library/processors/url-decode-operator.js +50 -0
- package/src/core-library/processors/url-encode-operator.js +44 -0
- package/src/core-library/processors/uuid-constraint.js +31 -0
- package/src/core-library/processors/values-operator.js +20 -0
- package/src/core-library/schemas/any-schema.js +23 -0
- package/src/core-library/schemas/array-schema.js +8 -0
- package/src/core-library/schemas/boolean-schema.js +10 -0
- package/src/core-library/schemas/date-schema.js +12 -0
- package/src/core-library/schemas/function-schema.js +40 -0
- package/src/core-library/schemas/number-schema.js +9 -0
- package/src/core-library/schemas/object-schema.js +10 -0
- package/src/core-library/schemas/root-schema.js +21 -0
- package/src/core-library/schemas/string-schema.js +9 -0
- package/src/core-library-node/index.js +47 -0
- package/src/core-library-node/processors/base64-decode-operator.js +20 -0
- package/src/core-library-node/processors/base64-encode-operator.js +20 -0
- package/src/core-library-node/processors/buffer-operator.js +39 -0
- package/src/core-library-node/processors/directory-constraint.js +35 -0
- package/src/core-library-node/processors/executable-constraint.js +34 -0
- package/src/core-library-node/processors/file-constraint.js +34 -0
- package/src/core-library-node/processors/file-size-constraint.js +94 -0
- package/src/core-library-node/processors/is-buffer-constraint.js +21 -0
- package/src/core-library-node/processors/reachable-constraint.js +28 -0
- package/src/core-library-node/processors/readable-constraint.js +34 -0
- package/src/core-library-node/processors/writable-constraint.js +59 -0
- package/src/core-library-node/schemas/buffer-schema.js +10 -0
- package/src/errors.js +209 -0
- package/src/executor/array-executor.js +78 -0
- package/src/executor/conditional-executor.js +134 -0
- package/src/executor/each-executor.js +68 -0
- package/src/executor/executor.js +123 -0
- package/src/executor/object-executor.js +98 -0
- package/src/executor/parallel-executor.js +43 -0
- package/src/executor/pipeline-executor.js +65 -0
- package/src/executor/sequence-executor.js +206 -0
- package/src/executor/serial-executor.js +24 -0
- package/src/executor/step-executor.js +68 -0
- package/src/helpers/case.js +124 -0
- package/src/helpers/data-size.js +144 -0
- package/src/helpers/debug-sink.js +15 -0
- package/src/helpers/deep.js +280 -0
- package/src/helpers/format.js +121 -0
- package/src/helpers/has-string-properties.js +30 -0
- package/src/helpers/index.js +16 -0
- package/src/helpers/object.js +115 -0
- package/src/helpers/parse-date.js +75 -0
- package/src/helpers/path.js +28 -0
- package/src/helpers/regex.js +18 -0
- package/src/helpers/stringify.js +309 -0
- package/src/helpers/to-data.js +64 -0
- package/src/helpers/truthy.js +55 -0
- package/src/index.js +29 -0
- package/src/schema-compiler.js +531 -0
- package/src/schema-location.js +200 -0
- package/src/schema-resolver.js +546 -0
- package/src/schema.js +1182 -0
- package/src/traversal/executors/check-condition.js +42 -0
- package/src/traversal/executors/check-input.js +27 -0
- package/src/traversal/executors/check-required.js +19 -0
- package/src/traversal/executors/check-schema.js +45 -0
- package/src/traversal/executors/defaults.js +21 -0
- package/src/traversal/executors/enter-existing.js +25 -0
- package/src/traversal/executors/enter-input.js +25 -0
- package/src/traversal/executors/enter.js +37 -0
- package/src/traversal/executors/exit.js +74 -0
- package/src/traversal/executors/finalize.js +64 -0
- package/src/traversal/executors/index.js +42 -0
- package/src/traversal/executors/normalize.js +38 -0
- package/src/traversal/executors/prepare-existing.js +27 -0
- package/src/traversal/executors/prepare-pending.js +54 -0
- package/src/traversal/executors/resolve-union.js +50 -0
- package/src/traversal/executors/serialize.js +48 -0
- package/src/traversal/executors/transform-early.js +51 -0
- package/src/traversal/executors/transform.js +68 -0
- package/src/traversal/executors/traversal-state-executor.js +46 -0
- package/src/traversal/executors/validate.js +63 -0
- package/src/traversal/traversal-context.js +231 -0
- package/src/traversal/traversal-state.js +809 -0
- package/src/types.js +102 -0
- package/src/value-processor/composed-value-processor.js +43 -0
- package/src/value-processor/defined-value-processor.js +72 -0
- package/src/value-processor/function-value-processor.js +68 -0
- package/src/value-processor/parameterized-value-processor.js +45 -0
- package/src/value-processor/parameters-value-processor.js +178 -0
- package/src/value-processor/spec.js +89 -0
- package/src/value-processor/value-processor.js +105 -0
- package/types/compilation/handler-compilation.d.ts +13 -0
- package/types/compilation/metadata-compilation.d.ts +6 -0
- package/types/compilation/schema-compilation.d.ts +32 -0
- package/types/compilation/selection-compilation.d.ts +9 -0
- package/types/compilation/union-compilation.d.ts +42 -0
- package/types/compilation/values-compilation.d.ts +12 -0
- package/types/compiled-schema.d.ts +883 -0
- package/types/constants.d.ts +1 -0
- package/types/core-library/index.d.ts +7 -0
- package/types/core-library/processors/aggregation-operators.d.ts +24 -0
- package/types/core-library/processors/alpha-constraint.d.ts +9 -0
- package/types/core-library/processors/alphanum-constraint.d.ts +9 -0
- package/types/core-library/processors/array-operator.d.ts +12 -0
- package/types/core-library/processors/assert-constraint.d.ts +30 -0
- package/types/core-library/processors/base64-constraint.d.ts +11 -0
- package/types/core-library/processors/camel-case-operator.d.ts +17 -0
- package/types/core-library/processors/capitalize-operator.d.ts +11 -0
- package/types/core-library/processors/cardnum-constraint.d.ts +51 -0
- package/types/core-library/processors/ceil-operator.d.ts +30 -0
- package/types/core-library/processors/collapse-operator.d.ts +24 -0
- package/types/core-library/processors/compact-operator.d.ts +29 -0
- package/types/core-library/processors/compile-operator.d.ts +34 -0
- package/types/core-library/processors/concat-operator.d.ts +23 -0
- package/types/core-library/processors/conditional-operators.d.ts +219 -0
- package/types/core-library/processors/constant-case-operator.d.ts +9 -0
- package/types/core-library/processors/data-size-operator.d.ts +31 -0
- package/types/core-library/processors/date-object-operator.d.ts +16 -0
- package/types/core-library/processors/date-operator.d.ts +21 -0
- package/types/core-library/processors/date-range-constraint.d.ts +26 -0
- package/types/core-library/processors/defined-constraint.d.ts +20 -0
- package/types/core-library/processors/each-operator.d.ts +34 -0
- package/types/core-library/processors/email-constraint.d.ts +54 -0
- package/types/core-library/processors/entries-operator.d.ts +13 -0
- package/types/core-library/processors/eq-constraint.d.ts +20 -0
- package/types/core-library/processors/filter-operator.d.ts +35 -0
- package/types/core-library/processors/find-schema-operator.d.ts +28 -0
- package/types/core-library/processors/flatten-operator.d.ts +26 -0
- package/types/core-library/processors/floor-operator.d.ts +33 -0
- package/types/core-library/processors/get-operator.d.ts +31 -0
- package/types/core-library/processors/group-by-operator.d.ts +36 -0
- package/types/core-library/processors/has-prefix-constraint.d.ts +22 -0
- package/types/core-library/processors/has-suffix-constraint.d.ts +20 -0
- package/types/core-library/processors/hex-constraint.d.ts +9 -0
- package/types/core-library/processors/hostname-constraint.d.ts +11 -0
- package/types/core-library/processors/http-url-constraint.d.ts +9 -0
- package/types/core-library/processors/in-constraint.d.ts +27 -0
- package/types/core-library/processors/index-by-operator.d.ts +26 -0
- package/types/core-library/processors/index.d.ts +8 -0
- package/types/core-library/processors/input-operator.d.ts +20 -0
- package/types/core-library/processors/instanceof-constraint.d.ts +23 -0
- package/types/core-library/processors/integer-constraint.d.ts +9 -0
- package/types/core-library/processors/invoke-operator.d.ts +12 -0
- package/types/core-library/processors/ipv4-constraint.d.ts +37 -0
- package/types/core-library/processors/ipv6-constraint.d.ts +34 -0
- package/types/core-library/processors/is-array-constraint.d.ts +10 -0
- package/types/core-library/processors/is-date-constraint.d.ts +10 -0
- package/types/core-library/processors/is-number-constraint.d.ts +10 -0
- package/types/core-library/processors/is-object-constraint.d.ts +10 -0
- package/types/core-library/processors/is-string-constraint.d.ts +10 -0
- package/types/core-library/processors/join-operator.d.ts +29 -0
- package/types/core-library/processors/json-constraint.d.ts +10 -0
- package/types/core-library/processors/json-decode-operator.d.ts +9 -0
- package/types/core-library/processors/json-encode-operator.d.ts +27 -0
- package/types/core-library/processors/kebab-case-operator.d.ts +16 -0
- package/types/core-library/processors/keys-operator.d.ts +9 -0
- package/types/core-library/processors/length-constraint.d.ts +34 -0
- package/types/core-library/processors/lookup-operator.d.ts +36 -0
- package/types/core-library/processors/lowercase-operator.d.ts +9 -0
- package/types/core-library/processors/map-operator.d.ts +38 -0
- package/types/core-library/processors/match-operator.d.ts +34 -0
- package/types/core-library/processors/matches-constraint.d.ts +29 -0
- package/types/core-library/processors/math-operators.d.ts +91 -0
- package/types/core-library/processors/merge-deep-operator.d.ts +32 -0
- package/types/core-library/processors/merge-operator.d.ts +26 -0
- package/types/core-library/processors/metadata-operator.d.ts +56 -0
- package/types/core-library/processors/negative-constraint.d.ts +13 -0
- package/types/core-library/processors/never-constraint.d.ts +26 -0
- package/types/core-library/processors/non-empty-constraint.d.ts +28 -0
- package/types/core-library/processors/not-constraint.d.ts +28 -0
- package/types/core-library/processors/number-operator.d.ts +9 -0
- package/types/core-library/processors/numeric-constraint.d.ts +10 -0
- package/types/core-library/processors/object-operator.d.ts +10 -0
- package/types/core-library/processors/omit-operator.d.ts +24 -0
- package/types/core-library/processors/parallel-operator.d.ts +41 -0
- package/types/core-library/processors/pascal-case-operator.d.ts +9 -0
- package/types/core-library/processors/phone-constraint.d.ts +65 -0
- package/types/core-library/processors/pick-operator.d.ts +27 -0
- package/types/core-library/processors/pipeline-operator.d.ts +40 -0
- package/types/core-library/processors/port-constraint.d.ts +11 -0
- package/types/core-library/processors/positive-constraint.d.ts +13 -0
- package/types/core-library/processors/process-operator.d.ts +37 -0
- package/types/core-library/processors/property-operator.d.ts +34 -0
- package/types/core-library/processors/range-constraint.d.ts +30 -0
- package/types/core-library/processors/reference-operator.d.ts +38 -0
- package/types/core-library/processors/require-constraint.d.ts +29 -0
- package/types/core-library/processors/reverse-operator.d.ts +9 -0
- package/types/core-library/processors/round-operator.d.ts +34 -0
- package/types/core-library/processors/schema-handler-operators.d.ts +28 -0
- package/types/core-library/processors/semver-constraint.d.ts +43 -0
- package/types/core-library/processors/sequence-processors.d.ts +213 -0
- package/types/core-library/processors/sort-operator.d.ts +31 -0
- package/types/core-library/processors/split-operator.d.ts +33 -0
- package/types/core-library/processors/string-extra-operators.d.ts +83 -0
- package/types/core-library/processors/string-operator.d.ts +10 -0
- package/types/core-library/processors/target-operator.d.ts +27 -0
- package/types/core-library/processors/template-operator.d.ts +31 -0
- package/types/core-library/processors/title-case-operator.d.ts +12 -0
- package/types/core-library/processors/trim-operator.d.ts +9 -0
- package/types/core-library/processors/truthy-constraint.d.ts +23 -0
- package/types/core-library/processors/type-operator.d.ts +11 -0
- package/types/core-library/processors/unique-operator.d.ts +10 -0
- package/types/core-library/processors/uppercase-operator.d.ts +9 -0
- package/types/core-library/processors/url-constraint.d.ts +20 -0
- package/types/core-library/processors/url-decode-operator.d.ts +31 -0
- package/types/core-library/processors/url-encode-operator.d.ts +36 -0
- package/types/core-library/processors/uuid-constraint.d.ts +20 -0
- package/types/core-library/processors/values-operator.d.ts +9 -0
- package/types/core-library/schemas/any-schema.d.ts +2 -0
- package/types/core-library/schemas/array-schema.d.ts +2 -0
- package/types/core-library/schemas/boolean-schema.d.ts +2 -0
- package/types/core-library/schemas/date-schema.d.ts +2 -0
- package/types/core-library/schemas/function-schema.d.ts +2 -0
- package/types/core-library/schemas/number-schema.d.ts +2 -0
- package/types/core-library/schemas/object-schema.d.ts +2 -0
- package/types/core-library/schemas/root-schema.d.ts +2 -0
- package/types/core-library/schemas/string-schema.d.ts +2 -0
- package/types/core-library-node/index.d.ts +12 -0
- package/types/core-library-node/processors/base64-decode-operator.d.ts +9 -0
- package/types/core-library-node/processors/base64-encode-operator.d.ts +9 -0
- package/types/core-library-node/processors/buffer-operator.d.ts +15 -0
- package/types/core-library-node/processors/directory-constraint.d.ts +14 -0
- package/types/core-library-node/processors/executable-constraint.d.ts +17 -0
- package/types/core-library-node/processors/file-constraint.d.ts +13 -0
- package/types/core-library-node/processors/file-size-constraint.d.ts +43 -0
- package/types/core-library-node/processors/is-buffer-constraint.d.ts +10 -0
- package/types/core-library-node/processors/reachable-constraint.d.ts +13 -0
- package/types/core-library-node/processors/readable-constraint.d.ts +17 -0
- package/types/core-library-node/processors/writable-constraint.d.ts +18 -0
- package/types/core-library-node/schemas/buffer-schema.d.ts +2 -0
- package/types/errors.d.ts +58 -0
- package/types/executor/array-executor.d.ts +17 -0
- package/types/executor/conditional-executor.d.ts +45 -0
- package/types/executor/each-executor.d.ts +15 -0
- package/types/executor/executor.d.ts +84 -0
- package/types/executor/object-executor.d.ts +14 -0
- package/types/executor/parallel-executor.d.ts +27 -0
- package/types/executor/pipeline-executor.d.ts +11 -0
- package/types/executor/sequence-executor.d.ts +32 -0
- package/types/executor/serial-executor.d.ts +16 -0
- package/types/executor/step-executor.d.ts +14 -0
- package/types/helpers/case.d.ts +30 -0
- package/types/helpers/data-size.d.ts +25 -0
- package/types/helpers/debug-sink.d.ts +9 -0
- package/types/helpers/deep.d.ts +33 -0
- package/types/helpers/format.d.ts +14 -0
- package/types/helpers/has-string-properties.d.ts +5 -0
- package/types/helpers/index.d.ts +13 -0
- package/types/helpers/object.d.ts +46 -0
- package/types/helpers/parse-date.d.ts +6 -0
- package/types/helpers/path.d.ts +13 -0
- package/types/helpers/regex.d.ts +7 -0
- package/types/helpers/stringify.d.ts +33 -0
- package/types/helpers/to-data.d.ts +13 -0
- package/types/helpers/truthy.d.ts +26 -0
- package/types/index.d.ts +6 -0
- package/types/schema-compiler.d.ts +49 -0
- package/types/schema-location.d.ts +64 -0
- package/types/schema-resolver.d.ts +145 -0
- package/types/schema.d.ts +586 -0
- package/types/traversal/executors/check-condition.d.ts +8 -0
- package/types/traversal/executors/check-input.d.ts +6 -0
- package/types/traversal/executors/check-required.d.ts +6 -0
- package/types/traversal/executors/check-schema.d.ts +7 -0
- package/types/traversal/executors/defaults.d.ts +8 -0
- package/types/traversal/executors/enter-existing.d.ts +6 -0
- package/types/traversal/executors/enter-input.d.ts +8 -0
- package/types/traversal/executors/enter.d.ts +7 -0
- package/types/traversal/executors/exit.d.ts +6 -0
- package/types/traversal/executors/finalize.d.ts +6 -0
- package/types/traversal/executors/index.d.ts +15 -0
- package/types/traversal/executors/normalize.d.ts +7 -0
- package/types/traversal/executors/prepare-existing.d.ts +6 -0
- package/types/traversal/executors/prepare-pending.d.ts +6 -0
- package/types/traversal/executors/resolve-union.d.ts +6 -0
- package/types/traversal/executors/serialize.d.ts +11 -0
- package/types/traversal/executors/transform-early.d.ts +6 -0
- package/types/traversal/executors/transform.d.ts +6 -0
- package/types/traversal/executors/traversal-state-executor.d.ts +19 -0
- package/types/traversal/executors/validate.d.ts +6 -0
- package/types/traversal/traversal-context.d.ts +67 -0
- package/types/traversal/traversal-state.d.ts +97 -0
- package/types/types.d.ts +218 -0
- package/types/value-processor/composed-value-processor.d.ts +17 -0
- package/types/value-processor/defined-value-processor.d.ts +16 -0
- package/types/value-processor/function-value-processor.d.ts +15 -0
- package/types/value-processor/parameterized-value-processor.d.ts +14 -0
- package/types/value-processor/parameters-value-processor.d.ts +28 -0
- package/types/value-processor/spec.d.ts +22 -0
- package/types/value-processor/value-processor.d.ts +92 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {object} target
|
|
3
|
+
* @param {...object} sources
|
|
4
|
+
* @returns {object}
|
|
5
|
+
*/
|
|
6
|
+
export function deepMerge(target: object, ...sources: object[]): object;
|
|
7
|
+
/**
|
|
8
|
+
* deep comparison
|
|
9
|
+
* @param {any} a
|
|
10
|
+
* @param {any} b
|
|
11
|
+
* @returns {boolean}
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export function deepEquals(a: any, b: any): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @param {object|undefined}target
|
|
17
|
+
* @param {string} path
|
|
18
|
+
* @param {any} value
|
|
19
|
+
* @returns {object}
|
|
20
|
+
*/
|
|
21
|
+
export function deepAssign(target: object | undefined, path: string, value: any): object;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param {object} object
|
|
25
|
+
* @param {string} path
|
|
26
|
+
* @returns {undefined|any}
|
|
27
|
+
*/
|
|
28
|
+
export function deepValue(object: object, path: string): undefined | any;
|
|
29
|
+
/**
|
|
30
|
+
* @param {any} value
|
|
31
|
+
* @returns {any}
|
|
32
|
+
*/
|
|
33
|
+
export function deepPrune(value: any): any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {CompiledSchema} schema
|
|
4
|
+
* @returns {string}
|
|
5
|
+
* @package
|
|
6
|
+
*/
|
|
7
|
+
export function formatArgumentType(schema: CompiledSchema): string;
|
|
8
|
+
/**
|
|
9
|
+
* @param {any} value
|
|
10
|
+
* @param {object} [options]
|
|
11
|
+
* @returns {string}
|
|
12
|
+
*/
|
|
13
|
+
export function formatValue(value: any, options?: object): string;
|
|
14
|
+
import { CompiledSchema } from "../compiled-schema.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { debug } from "./debug-sink.js";
|
|
2
|
+
export { hasStringProperties } from "./has-string-properties.js";
|
|
3
|
+
export { parseDate } from "./parse-date.js";
|
|
4
|
+
export { parseRegExp } from "./regex.js";
|
|
5
|
+
export { toData } from "./to-data.js";
|
|
6
|
+
export { toCamelCase, toPascalCase, toConstantCase, toKebabCase, toCapitalize, toTitleCase } from "./case.js";
|
|
7
|
+
export { deepMerge, deepEquals, deepAssign, deepValue, deepPrune } from "./deep.js";
|
|
8
|
+
export { formatArgumentType, formatValue } from "./format.js";
|
|
9
|
+
export { isPlainObject, isObject, isEmpty, isPrimitive, isConstructor, isConstructible, isNativeClass, map } from "./object.js";
|
|
10
|
+
export { behead, propertyName } from "./path.js";
|
|
11
|
+
export { stringify, parse } from "./stringify.js";
|
|
12
|
+
export { isTruthyKeyword, isFalseyKeyword, isTruthy, isFalsey } from "./truthy.js";
|
|
13
|
+
export { parseDataSize, formatDataSize } from "./data-size.js";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {any} obj
|
|
3
|
+
* @returns {boolean}
|
|
4
|
+
*/
|
|
5
|
+
export function isPlainObject(obj: any): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* @param {any} item
|
|
8
|
+
* @returns {boolean}
|
|
9
|
+
*/
|
|
10
|
+
export function isObject(item: any): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* @param {any} value
|
|
13
|
+
* @returns {boolean}
|
|
14
|
+
*/
|
|
15
|
+
export function isEmpty(value: any): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @param {any} item
|
|
18
|
+
* @returns {boolean}
|
|
19
|
+
*/
|
|
20
|
+
export function isPrimitive(item: any): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* @param {any} f
|
|
23
|
+
* @returns {boolean}
|
|
24
|
+
* @deprecated - usually want isConstructible instead
|
|
25
|
+
*/
|
|
26
|
+
export function isConstructor(f: any): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @param {any} f
|
|
29
|
+
* @returns {boolean}
|
|
30
|
+
*/
|
|
31
|
+
export function isConstructible(f: any): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Returns true for ES class syntax (`class Foo {}`) and native builtin
|
|
34
|
+
* constructors (`Map`, `Set`, `Error`, etc.) — i.e. functions that are
|
|
35
|
+
* meant to be used with `new` and should not be invoked as plain callbacks.
|
|
36
|
+
* @param {any} f
|
|
37
|
+
* @returns {boolean}
|
|
38
|
+
*/
|
|
39
|
+
export function isNativeClass(f: any): boolean;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @param {object|any[]|any} collection
|
|
43
|
+
* @param {(value:any) => any} callback
|
|
44
|
+
* @returns {object|any[]}
|
|
45
|
+
*/
|
|
46
|
+
export function map(collection: object | any[] | any, callback: (value: any) => any): object | any[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split off the first section of a path
|
|
3
|
+
*
|
|
4
|
+
* @param {string} path
|
|
5
|
+
* @returns {[string,string|undefined]}
|
|
6
|
+
*/
|
|
7
|
+
export function behead(path: string): [string, string | undefined];
|
|
8
|
+
/**
|
|
9
|
+
* Extract the last part of the path
|
|
10
|
+
* @param {string} path
|
|
11
|
+
* @returns {string}
|
|
12
|
+
*/
|
|
13
|
+
export function propertyName(path: string): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic stringifier with support for extended types and deserialization.
|
|
3
|
+
* @package
|
|
4
|
+
* @param {any} value - Value to stringify
|
|
5
|
+
* @param {object} [options] - Stringification options
|
|
6
|
+
* @param {number} [options.space] - Indentation for pretty printing (default: 0)
|
|
7
|
+
* @param {number} [options.maxDepth] - Maximum recursion depth (default: 100)
|
|
8
|
+
* @param {boolean} [options.useDelimiters] - Use <<Type>> markers for extended types (default: true)
|
|
9
|
+
* @param {string} [options.delimiterOpen] - Opening delimiter for type markers (default: '<<')
|
|
10
|
+
* @param {string} [options.delimiterClose] - Closing delimiter for type markers (default: '>>')
|
|
11
|
+
* @returns {string} Deterministic JSON string with optional type markers
|
|
12
|
+
*/
|
|
13
|
+
export function stringify(value: any, options?: {
|
|
14
|
+
space?: number | undefined;
|
|
15
|
+
maxDepth?: number | undefined;
|
|
16
|
+
useDelimiters?: boolean | undefined;
|
|
17
|
+
delimiterOpen?: string | undefined;
|
|
18
|
+
delimiterClose?: string | undefined;
|
|
19
|
+
}): string;
|
|
20
|
+
/**
|
|
21
|
+
* Parse a string created by stringify() back into an object.
|
|
22
|
+
* Handles both plain JSON and extended format with type markers.
|
|
23
|
+
* @package
|
|
24
|
+
* @param {string} text - JSON string to parse
|
|
25
|
+
* @param {object} [options] - Parse options
|
|
26
|
+
* @param {string} [options.delimiterOpen] - Opening delimiter for type markers (default '<<')
|
|
27
|
+
* @param {string} [options.delimiterClose] - Closing delimiter for type markers (default '>>')
|
|
28
|
+
* @returns {any} Parsed value with extended types and circular references restored
|
|
29
|
+
*/
|
|
30
|
+
export function parse(text: string, options?: {
|
|
31
|
+
delimiterOpen?: string | undefined;
|
|
32
|
+
delimiterClose?: string | undefined;
|
|
33
|
+
}): any;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @import {SchemaData} from '../types.js' */
|
|
2
|
+
/**
|
|
3
|
+
* Common implementation shared by both Schema and CompiledSchema
|
|
4
|
+
* (which only share a "fake" jsdoc interface to define their shape)
|
|
5
|
+
* @package
|
|
6
|
+
* @param {Schema|CompiledSchema|SchemaData} schema
|
|
7
|
+
* @param {WeakMap<object,object>} [seen] - cycle-detection map; shared across recursive calls
|
|
8
|
+
* @returns {SchemaData}
|
|
9
|
+
*/
|
|
10
|
+
export function toData(schema: Schema | CompiledSchema | SchemaData, seen?: WeakMap<object, object>): SchemaData;
|
|
11
|
+
import { Schema } from '../schema.js';
|
|
12
|
+
import { CompiledSchema } from '../compiled-schema.js';
|
|
13
|
+
import type { SchemaData } from '../types.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return true if the provided value is one of the magic truthy keywords
|
|
3
|
+
* @param {string} value
|
|
4
|
+
* @returns {boolean}
|
|
5
|
+
*/
|
|
6
|
+
export function isTruthyKeyword(value: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Return true if the provided value is one of the magic falsey keywords
|
|
9
|
+
* @param {string} value
|
|
10
|
+
* @returns {boolean}
|
|
11
|
+
*/
|
|
12
|
+
export function isFalseyKeyword(value: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* This library has a slightly extended notion of truthiness that includes human-friendly string representations
|
|
15
|
+
*
|
|
16
|
+
* @param {any} value
|
|
17
|
+
* @returns {boolean}
|
|
18
|
+
*/
|
|
19
|
+
export function isTruthy(value: any): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* This library has a slightly extended notion of truthiness that includes human-friendly string representations
|
|
22
|
+
*
|
|
23
|
+
* @param {any} value
|
|
24
|
+
* @returns {boolean}
|
|
25
|
+
*/
|
|
26
|
+
export function isFalsey(value: any): boolean;
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { CompiledSchema } from "./compiled-schema.js";
|
|
2
|
+
export { SchemaError } from "./errors.js";
|
|
3
|
+
export { SchemaResolver } from "./schema-resolver.js";
|
|
4
|
+
export { SchemaLocation } from "./schema-location.js";
|
|
5
|
+
export { EMPTY } from "./constants.js";
|
|
6
|
+
export { Schema, SchemaPolicy } from "./schema.js";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** @typedef {(inputSchema:CompiledSchema|Schema, targetSchema:CompiledSchema, location:SchemaLocation, options?:object) => Promise<Schema|CompiledSchema|import("./types.js").SchemaData|undefined>} InputSchemaProcessor */
|
|
2
|
+
/** @typedef {(inputSchema:CompiledSchema, targetSchema:CompiledSchema, location:SchemaLocation, options?:object) => Promise<CompiledSchema|undefined>} OutputSchemaProcessor */
|
|
3
|
+
/**
|
|
4
|
+
* This is a marker class for type safety that is replaced before the schema is used.
|
|
5
|
+
*/
|
|
6
|
+
export class CachedSchemaReference extends CompiledSchema {
|
|
7
|
+
/**
|
|
8
|
+
* @param {Schema} schema
|
|
9
|
+
*/
|
|
10
|
+
constructor(schema: Schema);
|
|
11
|
+
schema: Schema;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Top-level "Schema Schema" - takes a Schema as input, emits a CompiledSchema as output
|
|
15
|
+
*/
|
|
16
|
+
export class SchemaCompiler extends CompiledSchema {
|
|
17
|
+
/**
|
|
18
|
+
* @param {SchemaResolver} resolver
|
|
19
|
+
*/
|
|
20
|
+
constructor(resolver: SchemaResolver);
|
|
21
|
+
resolver: SchemaResolver;
|
|
22
|
+
normalizeCache: Map<any, any>;
|
|
23
|
+
compileSeen: Map<any, any>;
|
|
24
|
+
compileCache: Map<any, any>;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param {CompiledSchema} cs
|
|
28
|
+
* @param {string} [path]
|
|
29
|
+
* @param {Set<CompiledSchema>} [seen]
|
|
30
|
+
* @private
|
|
31
|
+
*/
|
|
32
|
+
private _replaceCachedReferences;
|
|
33
|
+
/**
|
|
34
|
+
* Compile a Schema to a CompiledSchema
|
|
35
|
+
*
|
|
36
|
+
* Schemas are compiled using a schema that defines schemas! This method is a convenience facade over the regular
|
|
37
|
+
* "process" flow.
|
|
38
|
+
*
|
|
39
|
+
* @param {Schema|CompiledSchema|import("./types.js").SchemaData} inputSchema
|
|
40
|
+
* @returns {CompiledSchema}
|
|
41
|
+
*/
|
|
42
|
+
compile(inputSchema: Schema | CompiledSchema | import("./types.js").SchemaData): CompiledSchema;
|
|
43
|
+
}
|
|
44
|
+
export type InputSchemaProcessor = (inputSchema: CompiledSchema | Schema, targetSchema: CompiledSchema, location: SchemaLocation, options?: object) => Promise<Schema | CompiledSchema | import("./types.js").SchemaData | undefined>;
|
|
45
|
+
export type OutputSchemaProcessor = (inputSchema: CompiledSchema, targetSchema: CompiledSchema, location: SchemaLocation, options?: object) => Promise<CompiledSchema | undefined>;
|
|
46
|
+
import { CompiledSchema } from './compiled-schema.js';
|
|
47
|
+
import { Schema } from './schema.js';
|
|
48
|
+
import { SchemaResolver } from './schema-resolver.js';
|
|
49
|
+
import { SchemaLocation } from "./schema-location.js";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The SchemaLocation tracks the schema and parent/child relationships for a given traversal path.
|
|
3
|
+
*
|
|
4
|
+
* Schemas can be linked into a hierarchy in multiple positions, so they have no static "parent".
|
|
5
|
+
* However, traversal builds an implicit hierarchy of locations that each then refer to a schema (if known),
|
|
6
|
+
* enabling access to any schema within the location hierarchy, including the parent.
|
|
7
|
+
*
|
|
8
|
+
* The current location is passed to value processors, effectively acting as a sort of "cursor".
|
|
9
|
+
*/
|
|
10
|
+
export class SchemaLocation {
|
|
11
|
+
/**
|
|
12
|
+
* @param {CompiledSchema} schema
|
|
13
|
+
* @param {SchemaLocation} [parent]
|
|
14
|
+
* @param {string} [propertyName]
|
|
15
|
+
*/
|
|
16
|
+
constructor(schema: CompiledSchema, parent?: SchemaLocation, propertyName?: string);
|
|
17
|
+
/** @type {string} */
|
|
18
|
+
get path(): string;
|
|
19
|
+
toString(): string;
|
|
20
|
+
/** @type {string} */
|
|
21
|
+
get name(): string;
|
|
22
|
+
set schema(schema: CompiledSchema);
|
|
23
|
+
/** @type {CompiledSchema} */
|
|
24
|
+
get schema(): CompiledSchema;
|
|
25
|
+
/** @type {SchemaLocation|undefined} */
|
|
26
|
+
get parent(): SchemaLocation | undefined;
|
|
27
|
+
/** @type {SchemaLocation} */
|
|
28
|
+
get root(): SchemaLocation;
|
|
29
|
+
/**
|
|
30
|
+
* Return the location of the path relative to the current location.
|
|
31
|
+
*
|
|
32
|
+
* @param {string} path
|
|
33
|
+
* @returns {SchemaLocation|undefined}
|
|
34
|
+
*/
|
|
35
|
+
relative(path: string): SchemaLocation | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Return the location of the path relative to the root of the known location hierarchy.
|
|
38
|
+
*
|
|
39
|
+
* @param {string} path
|
|
40
|
+
* @returns {SchemaLocation|undefined}
|
|
41
|
+
*/
|
|
42
|
+
absolute(path: string): SchemaLocation | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Return the location of a sibling with the relative path.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} path
|
|
47
|
+
* @returns {SchemaLocation|undefined}
|
|
48
|
+
*/
|
|
49
|
+
sibling(path: string): SchemaLocation | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Return a temporary location corresponding to one of our not-yet-resolved union members.
|
|
52
|
+
*
|
|
53
|
+
* @param {CompiledSchema} unionSchema
|
|
54
|
+
* @returns {undefined|SchemaLocation}
|
|
55
|
+
*/
|
|
56
|
+
union(unionSchema: CompiledSchema): undefined | SchemaLocation;
|
|
57
|
+
/**
|
|
58
|
+
* @param {(location:SchemaLocation) => any} predicate
|
|
59
|
+
* @returns {SchemaLocation|undefined}
|
|
60
|
+
*/
|
|
61
|
+
findPropertyLocation(predicate: (location: SchemaLocation) => any): SchemaLocation | undefined;
|
|
62
|
+
#private;
|
|
63
|
+
}
|
|
64
|
+
import { CompiledSchema } from './compiled-schema.js';
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Register a core library function to be loaded into every new SchemaResolver.
|
|
3
|
+
* Called by the package entry point; not part of the public API.
|
|
4
|
+
*
|
|
5
|
+
* @param {(resolver: SchemaResolver, options: object) => void} libraryFn
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export function registerCoreLibrary(libraryFn: (resolver: SchemaResolver, options: object) => void): void;
|
|
9
|
+
/** @typedef {{name:string, [key:string]:any}} SchemaResolverLibraryOptions */
|
|
10
|
+
/** @import { SchemaData } from './types.js' */
|
|
11
|
+
/** @import { ValueProcessorDefinition, ValueProcessorSpec, ValueProcessorBuilder, ValueProcessorFunction, ValueProcessorArgs, ValueProcessorParameter, KeywordValueProcessorSpec } from './value-processor/value-processor.js' */
|
|
12
|
+
/**
|
|
13
|
+
* The SchemaResolver uses its internal registries of named schemas and value processor keywords to
|
|
14
|
+
* convert Schemas containing unresolved references into resolved Schemas that are fully self-contained.
|
|
15
|
+
*/
|
|
16
|
+
export class SchemaResolver {
|
|
17
|
+
/**
|
|
18
|
+
* add a schema to the registry
|
|
19
|
+
* @param {string} name
|
|
20
|
+
* @param {Schema} schema
|
|
21
|
+
* @returns {SchemaResolver}
|
|
22
|
+
*/
|
|
23
|
+
registerSchema(name: string, schema: Schema): SchemaResolver;
|
|
24
|
+
/**
|
|
25
|
+
* return the registered schema with a given name
|
|
26
|
+
* @param {string} name
|
|
27
|
+
* @returns {Schema}
|
|
28
|
+
*/
|
|
29
|
+
getSchema(name: string): Schema;
|
|
30
|
+
/**
|
|
31
|
+
* return true if there exists a registered schema with a given name
|
|
32
|
+
* @param {string} name
|
|
33
|
+
* @returns {boolean}
|
|
34
|
+
*/
|
|
35
|
+
hasSchema(name: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Register a value processor definition
|
|
38
|
+
* @param {ValueProcessorDefinition} definition
|
|
39
|
+
* @returns {SchemaResolver}
|
|
40
|
+
*/
|
|
41
|
+
registerValueProcessorDefinition(definition: ValueProcessorDefinition): SchemaResolver;
|
|
42
|
+
/**
|
|
43
|
+
* register a named "simple" ValueProcessor
|
|
44
|
+
* @param {string} keyword
|
|
45
|
+
* @param {ValueProcessorFunction} process
|
|
46
|
+
* @param {string} [description]
|
|
47
|
+
* @returns {SchemaResolver}
|
|
48
|
+
*/
|
|
49
|
+
registerValueProcessor(keyword: string, process: ValueProcessorFunction, description?: string): SchemaResolver;
|
|
50
|
+
/**
|
|
51
|
+
* register a complex ValueProcessor that needs to be built based on schema processor spec
|
|
52
|
+
* @param {string} keyword
|
|
53
|
+
* @param {ValueProcessorBuilder} build
|
|
54
|
+
* @returns {SchemaResolver}
|
|
55
|
+
*/
|
|
56
|
+
registerValueProcessorBuilder(keyword: string, build: ValueProcessorBuilder): SchemaResolver;
|
|
57
|
+
/**
|
|
58
|
+
* Load a library of schemas and/or value processors.
|
|
59
|
+
*
|
|
60
|
+
* Expects a (potentially async) library function accepting a SchemaResolver. Options passed to `use`
|
|
61
|
+
* will be propagated to the library function.
|
|
62
|
+
*
|
|
63
|
+
* The `name` option is used for error messages.
|
|
64
|
+
* The `sync` option is used internally to enforce the core library does not get loaded asynchronously.
|
|
65
|
+
*
|
|
66
|
+
* @param {(resolver:SchemaResolver, options:object) => Promise<void>|void} libraryFunction
|
|
67
|
+
* @param {object} [options]
|
|
68
|
+
* @returns {Promise<void>}
|
|
69
|
+
*/
|
|
70
|
+
use(libraryFunction: (resolver: SchemaResolver, options: object) => Promise<void> | void, options?: object): Promise<void>;
|
|
71
|
+
_constantKeywords: {
|
|
72
|
+
$null: ConstantExecutor;
|
|
73
|
+
$undefined: ConstantExecutor;
|
|
74
|
+
$true: ConstantExecutor;
|
|
75
|
+
$false: ConstantExecutor;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* @param {SchemaCompiler} compiler
|
|
79
|
+
* @param {KeywordValueProcessorSpec} spec
|
|
80
|
+
* @param {boolean} [recursive]
|
|
81
|
+
* @returns {ValueProcessor}
|
|
82
|
+
*/
|
|
83
|
+
compileKeywordValueProcessorSpec(compiler: SchemaCompiler, spec: KeywordValueProcessorSpec, recursive?: boolean): ValueProcessor;
|
|
84
|
+
compileSchemaValueProcessorSpec(compiler: any, spec: any): ComposedValueProcessor;
|
|
85
|
+
/**
|
|
86
|
+
* Convert a processor specification into an executor
|
|
87
|
+
* @param {SchemaCompiler} compiler
|
|
88
|
+
* @param {ValueProcessorSpec} spec - The processor specification
|
|
89
|
+
* @param {boolean} [recursive]
|
|
90
|
+
* @returns {ValueProcessor}
|
|
91
|
+
*/
|
|
92
|
+
compileValueProcessorSpecObject(compiler: SchemaCompiler, spec: ValueProcessorSpec, recursive?: boolean): ValueProcessor;
|
|
93
|
+
/**
|
|
94
|
+
* Convert a processor specification into an executor
|
|
95
|
+
* @param {SchemaCompiler} compiler
|
|
96
|
+
* @param {ValueProcessorSpec} spec - The processor specification
|
|
97
|
+
* @param {boolean} [recursive]
|
|
98
|
+
* @returns {ValueProcessor}
|
|
99
|
+
*/
|
|
100
|
+
compileValueProcessorSpecArray(compiler: SchemaCompiler, spec: ValueProcessorSpec, recursive?: boolean): ValueProcessor;
|
|
101
|
+
/**
|
|
102
|
+
* Convert a value processor specification into a value processor executor
|
|
103
|
+
*
|
|
104
|
+
* @param {SchemaCompiler} compiler
|
|
105
|
+
* @param {ValueProcessorSpec} spec - The processor specification
|
|
106
|
+
* @param {boolean} [recursive]
|
|
107
|
+
* @returns {ValueProcessor}
|
|
108
|
+
*/
|
|
109
|
+
compileValueProcessorSpec(compiler: SchemaCompiler, spec: ValueProcessorSpec, recursive?: boolean): ValueProcessor;
|
|
110
|
+
compiler(): SchemaCompiler;
|
|
111
|
+
/**
|
|
112
|
+
* Build a compiled schema from the schema definition.
|
|
113
|
+
* @param {Schema|CompiledSchema|SchemaData} inputSchema
|
|
114
|
+
* @returns {CompiledSchema}
|
|
115
|
+
*/
|
|
116
|
+
compile(inputSchema: Schema | CompiledSchema | SchemaData): CompiledSchema;
|
|
117
|
+
/**
|
|
118
|
+
* Create a new Schema that contains the flattened hierarchy of all resolved base schemas.
|
|
119
|
+
*
|
|
120
|
+
* This can be useful if you need to make changes to the full schema, e.g. prepending processors
|
|
121
|
+
* before the base class handlers.
|
|
122
|
+
*
|
|
123
|
+
* @param {Schema|CompiledSchema|SchemaData|string} inputSchema
|
|
124
|
+
* @param {boolean} [recursive]
|
|
125
|
+
* @returns {Schema|CompiledSchema}
|
|
126
|
+
*/
|
|
127
|
+
resolve(inputSchema: Schema | CompiledSchema | SchemaData | string, recursive?: boolean): Schema | CompiledSchema;
|
|
128
|
+
#private;
|
|
129
|
+
}
|
|
130
|
+
export type SchemaResolverLibraryOptions = {
|
|
131
|
+
name: string;
|
|
132
|
+
[key: string]: any;
|
|
133
|
+
};
|
|
134
|
+
import { Schema } from './schema.js';
|
|
135
|
+
import type { ValueProcessorDefinition } from './value-processor/value-processor.js';
|
|
136
|
+
import type { ValueProcessorFunction } from './value-processor/value-processor.js';
|
|
137
|
+
import type { ValueProcessorBuilder } from './value-processor/value-processor.js';
|
|
138
|
+
import { ConstantExecutor } from './executor/executor.js';
|
|
139
|
+
import { SchemaCompiler } from './schema-compiler.js';
|
|
140
|
+
import type { KeywordValueProcessorSpec } from './value-processor/value-processor.js';
|
|
141
|
+
import { ValueProcessor } from './value-processor/value-processor.js';
|
|
142
|
+
import { ComposedValueProcessor } from './value-processor/composed-value-processor.js';
|
|
143
|
+
import type { ValueProcessorSpec } from './value-processor/value-processor.js';
|
|
144
|
+
import { CompiledSchema } from './compiled-schema.js';
|
|
145
|
+
import type { SchemaData } from './types.js';
|