@skmtc/core 0.16.3 → 0.26.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/README.md +0 -1
- package/esm/anchors/buildSidecar.js +1 -1
- package/esm/anchors/postPass.d.ts +1 -1
- package/esm/anchors/postPass.js +1 -1
- package/esm/anchors/sidecar.d.ts +2 -2
- package/esm/anchors/sidecar.js +1 -1
- package/esm/context/CoreContext.d.ts +7 -1
- package/esm/context/CoreContext.d.ts.map +1 -1
- package/esm/context/CoreContext.js +17 -11
- package/esm/context/GenerateContext.d.ts +28 -7
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +164 -86
- package/esm/context/ParseContext.d.ts +16 -0
- package/esm/context/ParseContext.d.ts.map +1 -1
- package/esm/context/ParseContext.js +16 -0
- package/esm/context/ParseIssue.d.ts +1 -1
- package/esm/context/RenderContext.d.ts +2 -6
- package/esm/context/RenderContext.d.ts.map +1 -1
- package/esm/context/RenderContext.js +4 -14
- package/esm/context/generateTypes.d.ts +35 -8
- package/esm/context/generateTypes.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/fs/1.0.23 → esm/deps/jsr.io/@std/fs/1.0.24}/exists.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/1.0.14/_os.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.14/_os.js +14 -0
- package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/os.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/assert_path.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/assert_path.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/constants.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/constants.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/from_file_url.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/from_file_url.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/normalize.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/normalize.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/normalize_string.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/normalize_string.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/join.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/join.js +2 -2
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/normalize.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/normalize.js +2 -2
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/_util.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/_util.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/from_file_url.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/from_file_url.js +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.4 → esm/deps/jsr.io/@std/path/1.1.6}/posix/join.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/join.js +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.4 → esm/deps/jsr.io/@std/path/1.1.6}/posix/normalize.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/normalize.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/_util.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/_util.js +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.4 → esm/deps/jsr.io/@std/path/1.1.6}/windows/from_file_url.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/from_file_url.js +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.4 → esm/deps/jsr.io/@std/path/1.1.6}/windows/join.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/join.js +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.4 → esm/deps/jsr.io/@std/path/1.1.6}/windows/normalize.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/normalize.js +1 -1
- package/esm/dsl/CodeFileBase.d.ts +57 -24
- package/esm/dsl/CodeFileBase.d.ts.map +1 -1
- package/esm/dsl/CodeFileBase.js +35 -53
- package/esm/dsl/FileBase.d.ts +21 -25
- package/esm/dsl/FileBase.d.ts.map +1 -1
- package/esm/dsl/FileBase.js +20 -29
- package/esm/dsl/GeneratorKeys.d.ts +19 -19
- package/esm/dsl/GeneratorKeys.d.ts.map +1 -1
- package/esm/dsl/GeneratorKeys.js +6 -5
- package/esm/dsl/IdentifierBase.d.ts +19 -5
- package/esm/dsl/IdentifierBase.d.ts.map +1 -1
- package/esm/dsl/IdentifierBase.js +21 -5
- package/esm/dsl/IdentifierType.d.ts +8 -14
- package/esm/dsl/IdentifierType.d.ts.map +1 -1
- package/esm/dsl/Lang.d.ts +18 -38
- package/esm/dsl/Lang.d.ts.map +1 -1
- package/esm/dsl/MarkdownFile.d.ts +55 -0
- package/esm/dsl/MarkdownFile.d.ts.map +1 -0
- package/esm/dsl/MarkdownFile.js +58 -0
- package/esm/dsl/model/ModelDriver.d.ts +3 -1
- package/esm/dsl/model/ModelDriver.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.js +29 -2
- package/esm/dsl/model/toModelEntry.d.ts +24 -14
- package/esm/dsl/model/toModelEntry.d.ts.map +1 -1
- package/esm/dsl/model/toModelEntry.js +7 -3
- package/esm/dsl/model/toModelProjectionBase.d.ts +31 -18
- package/esm/dsl/model/toModelProjectionBase.d.ts.map +1 -1
- package/esm/dsl/model/toModelProjectionBase.js +3 -3
- package/esm/dsl/model/types.d.ts +23 -27
- package/esm/dsl/model/types.d.ts.map +1 -1
- package/esm/dsl/operation/gql/GqlOperationDriver.d.ts +3 -1
- package/esm/dsl/operation/gql/GqlOperationDriver.d.ts.map +1 -1
- package/esm/dsl/operation/gql/GqlOperationDriver.js +12 -9
- package/esm/dsl/operation/gql/toGqlOperationEntry.d.ts +20 -15
- package/esm/dsl/operation/gql/toGqlOperationEntry.d.ts.map +1 -1
- package/esm/dsl/operation/gql/toGqlOperationEntry.js +3 -25
- package/esm/dsl/operation/gql/toGqlOperationProjectionBase.d.ts +11 -10
- package/esm/dsl/operation/gql/toGqlOperationProjectionBase.d.ts.map +1 -1
- package/esm/dsl/operation/gql/types.d.ts +1 -28
- package/esm/dsl/operation/gql/types.d.ts.map +1 -1
- package/esm/dsl/operation/oas/OasOperationDriver.d.ts +3 -1
- package/esm/dsl/operation/oas/OasOperationDriver.d.ts.map +1 -1
- package/esm/dsl/operation/oas/OasOperationDriver.js +12 -9
- package/esm/dsl/operation/oas/toOasOperationEntry.d.ts +21 -17
- package/esm/dsl/operation/oas/toOasOperationEntry.d.ts.map +1 -1
- package/esm/dsl/operation/oas/toOasOperationEntry.js +3 -32
- package/esm/dsl/operation/oas/toOasOperationProjectionBase.d.ts +11 -10
- package/esm/dsl/operation/oas/toOasOperationProjectionBase.d.ts.map +1 -1
- package/esm/dsl/operation/oas/types.d.ts +1 -38
- package/esm/dsl/operation/oas/types.d.ts.map +1 -1
- package/esm/dsl/webhook/WebhookDriver.d.ts +3 -1
- package/esm/dsl/webhook/WebhookDriver.d.ts.map +1 -1
- package/esm/dsl/webhook/WebhookDriver.js +12 -9
- package/esm/dsl/webhook/toWebhookEntry.d.ts +21 -16
- package/esm/dsl/webhook/toWebhookEntry.d.ts.map +1 -1
- package/esm/dsl/webhook/toWebhookEntry.js +3 -32
- package/esm/dsl/webhook/toWebhookProjectionBase.d.ts +11 -10
- package/esm/dsl/webhook/toWebhookProjectionBase.d.ts.map +1 -1
- package/esm/dsl/webhook/types.d.ts +1 -36
- package/esm/dsl/webhook/types.d.ts.map +1 -1
- package/esm/enrichments/toEnrichmentDescriptor.d.ts +72 -27
- package/esm/enrichments/toEnrichmentDescriptor.d.ts.map +1 -1
- package/esm/enrichments/toEnrichmentDescriptor.js +57 -31
- package/esm/enrichments/validateConfig.d.ts +60 -0
- package/esm/enrichments/validateConfig.d.ts.map +1 -0
- package/esm/enrichments/validateConfig.js +176 -0
- package/esm/helpers/isImported.js +1 -1
- package/esm/helpers/toResolvedArtifactPath.js +1 -1
- package/esm/mod.d.ts +8 -1
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +8 -1
- package/esm/oas/array/Array.d.ts +2 -0
- package/esm/oas/array/Array.d.ts.map +1 -1
- package/esm/oas/array/Array.js +4 -0
- package/esm/oas/boolean/Boolean.d.ts +3 -1
- package/esm/oas/boolean/Boolean.d.ts.map +1 -1
- package/esm/oas/boolean/Boolean.js +4 -0
- package/esm/oas/components/Components.d.ts +5 -0
- package/esm/oas/components/Components.d.ts.map +1 -1
- package/esm/oas/components/Components.js +6 -1
- package/esm/oas/integer/Integer.d.ts +3 -1
- package/esm/oas/integer/Integer.d.ts.map +1 -1
- package/esm/oas/integer/Integer.js +4 -0
- package/esm/oas/link/Link.d.ts +68 -0
- package/esm/oas/link/Link.d.ts.map +1 -0
- package/esm/oas/link/Link.js +107 -0
- package/esm/oas/number/Number.d.ts +3 -1
- package/esm/oas/number/Number.d.ts.map +1 -1
- package/esm/oas/number/Number.js +4 -0
- package/esm/oas/object/Object.d.ts +9 -0
- package/esm/oas/object/Object.d.ts.map +1 -1
- package/esm/oas/object/Object.js +14 -0
- package/esm/oas/operation/Operation.d.ts +15 -0
- package/esm/oas/operation/Operation.d.ts.map +1 -1
- package/esm/oas/operation/Operation.js +33 -0
- package/esm/oas/ref/Ref.d.ts +23 -1
- package/esm/oas/ref/Ref.d.ts.map +1 -1
- package/esm/oas/ref/Ref.js +32 -0
- package/esm/oas/ref/ref-types.d.ts +18 -1
- package/esm/oas/ref/ref-types.d.ts.map +1 -1
- package/esm/oas/ref/ref-types.js +12 -1
- package/esm/oas/response/Response.d.ts +4 -0
- package/esm/oas/response/Response.d.ts.map +1 -1
- package/esm/oas/response/Response.js +7 -0
- package/esm/oas/schemaPath/traverseSchema.d.ts +31 -0
- package/esm/oas/schemaPath/traverseSchema.d.ts.map +1 -0
- package/esm/oas/schemaPath/traverseSchema.js +113 -0
- package/esm/oas/string/String.d.ts +3 -1
- package/esm/oas/string/String.d.ts.map +1 -1
- package/esm/oas/string/String.js +4 -0
- package/esm/oas/union/Union.d.ts +9 -0
- package/esm/oas/union/Union.d.ts.map +1 -1
- package/esm/oas/union/Union.js +14 -0
- package/esm/oas/unknown/Unknown.d.ts +3 -1
- package/esm/oas/unknown/Unknown.d.ts.map +1 -1
- package/esm/oas/unknown/Unknown.js +4 -0
- package/esm/parse/v3-0/_merge-all-of/decompose-union.d.ts.map +1 -1
- package/esm/parse/v3-0/_merge-all-of/decompose-union.js +8 -12
- package/esm/parse/v3-0/_merge-all-of/merge-union.d.ts.map +1 -1
- package/esm/parse/v3-0/_merge-all-of/merge-union.js +0 -8
- package/esm/parse/v3-0/components/toComponentsV3.d.ts.map +1 -1
- package/esm/parse/v3-0/components/toComponentsV3.js +3 -1
- package/esm/parse/v3-0/link/toLinksV3.d.ts +17 -0
- package/esm/parse/v3-0/link/toLinksV3.d.ts.map +1 -0
- package/esm/parse/v3-0/link/toLinksV3.js +40 -0
- package/esm/parse/v3-0/object/toObject.d.ts.map +1 -1
- package/esm/parse/v3-0/object/toObject.js +3 -1
- package/esm/parse/v3-0/response/toResponseV3.d.ts.map +1 -1
- package/esm/parse/v3-0/response/toResponseV3.js +4 -1
- package/esm/parse/v3-0/schema/toSchemasV3.d.ts.map +1 -1
- package/esm/parse/v3-0/schema/toSchemasV3.js +8 -0
- package/esm/parse/v3-0/union/toUnion.d.ts.map +1 -1
- package/esm/parse/v3-0/union/toUnion.js +3 -1
- package/esm/parse/v3-1/_merge-all-of/decompose-union.d.ts.map +1 -1
- package/esm/parse/v3-1/_merge-all-of/decompose-union.js +8 -12
- package/esm/parse/v3-1/_merge-all-of/merge-union.d.ts.map +1 -1
- package/esm/parse/v3-1/_merge-all-of/merge-union.js +0 -8
- package/esm/parse/v3-1/components/toComponentsV3.d.ts.map +1 -1
- package/esm/parse/v3-1/components/toComponentsV3.js +3 -1
- package/esm/parse/v3-1/link/toLinksV3.d.ts +17 -0
- package/esm/parse/v3-1/link/toLinksV3.d.ts.map +1 -0
- package/esm/parse/v3-1/link/toLinksV3.js +40 -0
- package/esm/parse/v3-1/object/toObject.d.ts.map +1 -1
- package/esm/parse/v3-1/object/toObject.js +3 -1
- package/esm/parse/v3-1/response/toResponseV3.d.ts.map +1 -1
- package/esm/parse/v3-1/response/toResponseV3.js +4 -1
- package/esm/parse/v3-1/schema/toSchemasV3.d.ts.map +1 -1
- package/esm/parse/v3-1/schema/toSchemasV3.js +8 -0
- package/esm/parse/v3-1/union/toUnion.d.ts.map +1 -1
- package/esm/parse/v3-1/union/toUnion.js +3 -1
- package/esm/run/toArtifacts.d.ts +8 -1
- package/esm/run/toArtifacts.d.ts.map +1 -1
- package/esm/run/toArtifacts.js +5 -5
- package/esm/run/toInspection.d.ts +8 -0
- package/esm/run/toInspection.d.ts.map +1 -0
- package/esm/run/toInspection.js +78 -0
- package/esm/types/Enrichments.d.ts +19 -8
- package/esm/types/Enrichments.d.ts.map +1 -1
- package/esm/types/Enrichments.js +4 -3
- package/esm/types/GeneratorType.d.ts +5 -5
- package/esm/types/GeneratorType.d.ts.map +1 -1
- package/esm/types/Manifest.d.ts +1 -2
- package/esm/types/Manifest.d.ts.map +1 -1
- package/esm/types/Manifest.js +1 -2
- package/esm/types/ModuleSelect.d.ts +81 -0
- package/esm/types/ModuleSelect.d.ts.map +1 -0
- package/esm/types/ModuleSelect.js +63 -0
- package/esm/types/Preview.d.ts +4 -27
- package/esm/types/Preview.d.ts.map +1 -1
- package/esm/types/Preview.js +4 -25
- package/esm/types/SchemaPath.d.ts +17 -0
- package/esm/types/SchemaPath.d.ts.map +1 -0
- package/esm/types/SchemaPath.js +9 -0
- package/esm/types/Settings.d.ts +24 -3
- package/esm/types/Settings.d.ts.map +1 -1
- package/esm/types/Settings.js +20 -13
- package/esm/types/SkmtcDocument.d.ts +1 -1
- package/esm/types/SupportedSubjects.d.ts +1 -1
- package/package.json +1 -1
- package/script/anchors/buildSidecar.js +1 -1
- package/script/anchors/postPass.d.ts +1 -1
- package/script/anchors/postPass.js +1 -1
- package/script/anchors/sidecar.d.ts +2 -2
- package/script/anchors/sidecar.js +1 -1
- package/script/context/CoreContext.d.ts +7 -1
- package/script/context/CoreContext.d.ts.map +1 -1
- package/script/context/CoreContext.js +17 -11
- package/script/context/GenerateContext.d.ts +28 -7
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +164 -86
- package/script/context/ParseContext.d.ts +16 -0
- package/script/context/ParseContext.d.ts.map +1 -1
- package/script/context/ParseContext.js +16 -0
- package/script/context/ParseIssue.d.ts +1 -1
- package/script/context/RenderContext.d.ts +2 -6
- package/script/context/RenderContext.d.ts.map +1 -1
- package/script/context/RenderContext.js +4 -14
- package/script/context/generateTypes.d.ts +35 -8
- package/script/context/generateTypes.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/fs/1.0.23 → script/deps/jsr.io/@std/fs/1.0.24}/exists.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/1.0.14/_os.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/_os.js +7 -5
- package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/os.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/assert_path.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/assert_path.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/constants.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/constants.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/from_file_url.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/from_file_url.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/normalize.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/normalize.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/normalize_string.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/normalize_string.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/join.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/join.js +2 -2
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/normalize.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/normalize.js +2 -2
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/_util.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/_util.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/from_file_url.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/from_file_url.js +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.4 → script/deps/jsr.io/@std/path/1.1.6}/posix/join.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/join.js +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.4 → script/deps/jsr.io/@std/path/1.1.6}/posix/normalize.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/normalize.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/_util.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/_util.js +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.4 → script/deps/jsr.io/@std/path/1.1.6}/windows/from_file_url.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/from_file_url.js +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.4 → script/deps/jsr.io/@std/path/1.1.6}/windows/join.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/join.js +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.4 → script/deps/jsr.io/@std/path/1.1.6}/windows/normalize.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/normalize.js +1 -1
- package/script/dsl/CodeFileBase.d.ts +57 -24
- package/script/dsl/CodeFileBase.d.ts.map +1 -1
- package/script/dsl/CodeFileBase.js +37 -54
- package/script/dsl/FileBase.d.ts +21 -25
- package/script/dsl/FileBase.d.ts.map +1 -1
- package/script/dsl/FileBase.js +20 -29
- package/script/dsl/GeneratorKeys.d.ts +19 -19
- package/script/dsl/GeneratorKeys.d.ts.map +1 -1
- package/script/dsl/GeneratorKeys.js +6 -5
- package/script/dsl/IdentifierBase.d.ts +19 -5
- package/script/dsl/IdentifierBase.d.ts.map +1 -1
- package/script/dsl/IdentifierBase.js +21 -5
- package/script/dsl/IdentifierType.d.ts +8 -14
- package/script/dsl/IdentifierType.d.ts.map +1 -1
- package/script/dsl/Lang.d.ts +18 -38
- package/script/dsl/Lang.d.ts.map +1 -1
- package/script/dsl/MarkdownFile.d.ts +55 -0
- package/script/dsl/MarkdownFile.d.ts.map +1 -0
- package/script/dsl/MarkdownFile.js +62 -0
- package/script/dsl/model/ModelDriver.d.ts +3 -1
- package/script/dsl/model/ModelDriver.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.js +29 -2
- package/script/dsl/model/toModelEntry.d.ts +24 -14
- package/script/dsl/model/toModelEntry.d.ts.map +1 -1
- package/script/dsl/model/toModelEntry.js +7 -3
- package/script/dsl/model/toModelProjectionBase.d.ts +31 -18
- package/script/dsl/model/toModelProjectionBase.d.ts.map +1 -1
- package/script/dsl/model/toModelProjectionBase.js +3 -3
- package/script/dsl/model/types.d.ts +23 -27
- package/script/dsl/model/types.d.ts.map +1 -1
- package/script/dsl/operation/gql/GqlOperationDriver.d.ts +3 -1
- package/script/dsl/operation/gql/GqlOperationDriver.d.ts.map +1 -1
- package/script/dsl/operation/gql/GqlOperationDriver.js +12 -9
- package/script/dsl/operation/gql/toGqlOperationEntry.d.ts +20 -15
- package/script/dsl/operation/gql/toGqlOperationEntry.d.ts.map +1 -1
- package/script/dsl/operation/gql/toGqlOperationEntry.js +3 -61
- package/script/dsl/operation/gql/toGqlOperationProjectionBase.d.ts +11 -10
- package/script/dsl/operation/gql/toGqlOperationProjectionBase.d.ts.map +1 -1
- package/script/dsl/operation/gql/types.d.ts +1 -28
- package/script/dsl/operation/gql/types.d.ts.map +1 -1
- package/script/dsl/operation/oas/OasOperationDriver.d.ts +3 -1
- package/script/dsl/operation/oas/OasOperationDriver.d.ts.map +1 -1
- package/script/dsl/operation/oas/OasOperationDriver.js +12 -9
- package/script/dsl/operation/oas/toOasOperationEntry.d.ts +21 -17
- package/script/dsl/operation/oas/toOasOperationEntry.d.ts.map +1 -1
- package/script/dsl/operation/oas/toOasOperationEntry.js +3 -68
- package/script/dsl/operation/oas/toOasOperationProjectionBase.d.ts +11 -10
- package/script/dsl/operation/oas/toOasOperationProjectionBase.d.ts.map +1 -1
- package/script/dsl/operation/oas/types.d.ts +1 -38
- package/script/dsl/operation/oas/types.d.ts.map +1 -1
- package/script/dsl/webhook/WebhookDriver.d.ts +3 -1
- package/script/dsl/webhook/WebhookDriver.d.ts.map +1 -1
- package/script/dsl/webhook/WebhookDriver.js +12 -9
- package/script/dsl/webhook/toWebhookEntry.d.ts +21 -16
- package/script/dsl/webhook/toWebhookEntry.d.ts.map +1 -1
- package/script/dsl/webhook/toWebhookEntry.js +3 -68
- package/script/dsl/webhook/toWebhookProjectionBase.d.ts +11 -10
- package/script/dsl/webhook/toWebhookProjectionBase.d.ts.map +1 -1
- package/script/dsl/webhook/types.d.ts +1 -36
- package/script/dsl/webhook/types.d.ts.map +1 -1
- package/script/enrichments/toEnrichmentDescriptor.d.ts +72 -27
- package/script/enrichments/toEnrichmentDescriptor.d.ts.map +1 -1
- package/script/enrichments/toEnrichmentDescriptor.js +57 -31
- package/script/enrichments/validateConfig.d.ts +60 -0
- package/script/enrichments/validateConfig.d.ts.map +1 -0
- package/script/enrichments/validateConfig.js +213 -0
- package/script/helpers/isImported.js +1 -1
- package/script/helpers/toResolvedArtifactPath.js +1 -1
- package/script/mod.d.ts +8 -1
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +8 -1
- package/script/oas/array/Array.d.ts +2 -0
- package/script/oas/array/Array.d.ts.map +1 -1
- package/script/oas/array/Array.js +4 -0
- package/script/oas/boolean/Boolean.d.ts +3 -1
- package/script/oas/boolean/Boolean.d.ts.map +1 -1
- package/script/oas/boolean/Boolean.js +4 -0
- package/script/oas/components/Components.d.ts +5 -0
- package/script/oas/components/Components.d.ts.map +1 -1
- package/script/oas/components/Components.js +6 -1
- package/script/oas/integer/Integer.d.ts +3 -1
- package/script/oas/integer/Integer.d.ts.map +1 -1
- package/script/oas/integer/Integer.js +4 -0
- package/script/oas/link/Link.d.ts +68 -0
- package/script/oas/link/Link.d.ts.map +1 -0
- package/script/oas/link/Link.js +111 -0
- package/script/oas/number/Number.d.ts +3 -1
- package/script/oas/number/Number.d.ts.map +1 -1
- package/script/oas/number/Number.js +4 -0
- package/script/oas/object/Object.d.ts +9 -0
- package/script/oas/object/Object.d.ts.map +1 -1
- package/script/oas/object/Object.js +14 -0
- package/script/oas/operation/Operation.d.ts +15 -0
- package/script/oas/operation/Operation.d.ts.map +1 -1
- package/script/oas/operation/Operation.js +33 -0
- package/script/oas/ref/Ref.d.ts +23 -1
- package/script/oas/ref/Ref.d.ts.map +1 -1
- package/script/oas/ref/Ref.js +32 -0
- package/script/oas/ref/ref-types.d.ts +18 -1
- package/script/oas/ref/ref-types.d.ts.map +1 -1
- package/script/oas/ref/ref-types.js +13 -2
- package/script/oas/response/Response.d.ts +4 -0
- package/script/oas/response/Response.d.ts.map +1 -1
- package/script/oas/response/Response.js +7 -0
- package/script/oas/schemaPath/traverseSchema.d.ts +31 -0
- package/script/oas/schemaPath/traverseSchema.d.ts.map +1 -0
- package/script/oas/schemaPath/traverseSchema.js +117 -0
- package/script/oas/string/String.d.ts +3 -1
- package/script/oas/string/String.d.ts.map +1 -1
- package/script/oas/string/String.js +4 -0
- package/script/oas/union/Union.d.ts +9 -0
- package/script/oas/union/Union.d.ts.map +1 -1
- package/script/oas/union/Union.js +14 -0
- package/script/oas/unknown/Unknown.d.ts +3 -1
- package/script/oas/unknown/Unknown.d.ts.map +1 -1
- package/script/oas/unknown/Unknown.js +4 -0
- package/script/parse/v3-0/_merge-all-of/decompose-union.d.ts.map +1 -1
- package/script/parse/v3-0/_merge-all-of/decompose-union.js +8 -12
- package/script/parse/v3-0/_merge-all-of/merge-union.d.ts.map +1 -1
- package/script/parse/v3-0/_merge-all-of/merge-union.js +0 -8
- package/script/parse/v3-0/components/toComponentsV3.d.ts.map +1 -1
- package/script/parse/v3-0/components/toComponentsV3.js +3 -1
- package/script/parse/v3-0/link/toLinksV3.d.ts +17 -0
- package/script/parse/v3-0/link/toLinksV3.d.ts.map +1 -0
- package/script/parse/v3-0/link/toLinksV3.js +44 -0
- package/script/parse/v3-0/object/toObject.d.ts.map +1 -1
- package/script/parse/v3-0/object/toObject.js +3 -1
- package/script/parse/v3-0/response/toResponseV3.d.ts.map +1 -1
- package/script/parse/v3-0/response/toResponseV3.js +4 -1
- package/script/parse/v3-0/schema/toSchemasV3.d.ts.map +1 -1
- package/script/parse/v3-0/schema/toSchemasV3.js +8 -0
- package/script/parse/v3-0/union/toUnion.d.ts.map +1 -1
- package/script/parse/v3-0/union/toUnion.js +3 -1
- package/script/parse/v3-1/_merge-all-of/decompose-union.d.ts.map +1 -1
- package/script/parse/v3-1/_merge-all-of/decompose-union.js +8 -12
- package/script/parse/v3-1/_merge-all-of/merge-union.d.ts.map +1 -1
- package/script/parse/v3-1/_merge-all-of/merge-union.js +0 -8
- package/script/parse/v3-1/components/toComponentsV3.d.ts.map +1 -1
- package/script/parse/v3-1/components/toComponentsV3.js +3 -1
- package/script/parse/v3-1/link/toLinksV3.d.ts +17 -0
- package/script/parse/v3-1/link/toLinksV3.d.ts.map +1 -0
- package/script/parse/v3-1/link/toLinksV3.js +44 -0
- package/script/parse/v3-1/object/toObject.d.ts.map +1 -1
- package/script/parse/v3-1/object/toObject.js +3 -1
- package/script/parse/v3-1/response/toResponseV3.d.ts.map +1 -1
- package/script/parse/v3-1/response/toResponseV3.js +4 -1
- package/script/parse/v3-1/schema/toSchemasV3.d.ts.map +1 -1
- package/script/parse/v3-1/schema/toSchemasV3.js +8 -0
- package/script/parse/v3-1/union/toUnion.d.ts.map +1 -1
- package/script/parse/v3-1/union/toUnion.js +3 -1
- package/script/run/toArtifacts.d.ts +8 -1
- package/script/run/toArtifacts.d.ts.map +1 -1
- package/script/run/toArtifacts.js +5 -5
- package/script/run/toInspection.d.ts +8 -0
- package/script/run/toInspection.d.ts.map +1 -0
- package/script/run/toInspection.js +82 -0
- package/script/types/Enrichments.d.ts +19 -8
- package/script/types/Enrichments.d.ts.map +1 -1
- package/script/types/Enrichments.js +5 -4
- package/script/types/GeneratorType.d.ts +5 -5
- package/script/types/GeneratorType.d.ts.map +1 -1
- package/script/types/Manifest.d.ts +1 -2
- package/script/types/Manifest.d.ts.map +1 -1
- package/script/types/Manifest.js +0 -1
- package/script/types/ModuleSelect.d.ts +81 -0
- package/script/types/ModuleSelect.d.ts.map +1 -0
- package/script/types/ModuleSelect.js +101 -0
- package/script/types/Preview.d.ts +4 -27
- package/script/types/Preview.d.ts.map +1 -1
- package/script/types/Preview.js +5 -26
- package/script/types/SchemaPath.d.ts +17 -0
- package/script/types/SchemaPath.d.ts.map +1 -0
- package/script/types/{AccessorPath.js → SchemaPath.js} +7 -7
- package/script/types/Settings.d.ts +24 -3
- package/script/types/Settings.d.ts.map +1 -1
- package/script/types/Settings.js +17 -10
- package/script/types/SkmtcDocument.d.ts +1 -1
- package/script/types/SupportedSubjects.d.ts +1 -1
- package/esm/deps/jsr.io/@std/internal/1.0.13/_os.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.13/_os.js +0 -12
- package/esm/types/AccessorPath.d.ts +0 -17
- package/esm/types/AccessorPath.d.ts.map +0 -1
- package/esm/types/AccessorPath.js +0 -9
- package/script/deps/jsr.io/@std/internal/1.0.13/_os.d.ts.map +0 -1
- package/script/types/AccessorPath.d.ts +0 -17
- package/script/types/AccessorPath.d.ts.map +0 -1
- /package/esm/deps/jsr.io/@std/fs/{1.0.23 → 1.0.24}/exists.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.23 → 1.0.24}/exists.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/_os.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/os.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/os.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/assert_path.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/constants.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/from_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/normalize.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/normalize_string.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/join.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/normalize.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/_util.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/from_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/join.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/normalize.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/_util.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/from_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/join.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/normalize.d.ts +0 -0
- /package/script/deps/jsr.io/@std/fs/{1.0.23 → 1.0.24}/exists.d.ts +0 -0
- /package/script/deps/jsr.io/@std/fs/{1.0.23 → 1.0.24}/exists.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/_os.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/os.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/os.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/assert_path.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/constants.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/from_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/normalize.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/_common/normalize_string.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/join.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/normalize.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/_util.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/from_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/join.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/posix/normalize.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/_util.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/from_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/join.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.6}/windows/normalize.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/dsl/webhook/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/dsl/webhook/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D;;;;;;;;;GASG;AACH,MAAM,MAAM,gCAAgC,CAAC,cAAc,GAAG,SAAS,IAAI;IACzE,OAAO,EAAE,mBAAmB,CAAA;IAC5B,QAAQ,EAAE,eAAe,CAAC,cAAc,CAAC,CAAA;IACzC,OAAO,EAAE,UAAU,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,mBAAmB,CAAA;IAC5B,OAAO,EAAE,UAAU,CAAA;IACnB;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,mBAAmB,CAAA;IAC5B,OAAO,EAAE,UAAU,CAAA;IACnB,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,UAAU,CAAA;IACnB,OAAO,EAAE,mBAAmB,CAAA;IAC5B,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,OAAO,EAAE,mBAAmB,CAAA;IAC5B,OAAO,EAAE,UAAU,CAAA;IACnB,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,mBAAmB,CAAA;IAC5B,OAAO,EAAE,UAAU,CAAA;IACnB,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,2BAA2B,CAAC,cAAc,GAAG,SAAS,IAAI;IACpE,OAAO,EAAE,UAAU,CAAA;IACnB,WAAW,EAAE,cAAc,CAAA;IAC3B,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,uBAAuB,CAAC,cAAc,GAAG,SAAS,IAAI;IAChE,OAAO,EAAE,UAAU,CAAA;IACnB,WAAW,EAAE,cAAc,CAAA;IAC3B,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,cAAc,EAAE,cAAc,GAAG,SAAS,IAAI;IACpF,SAAS,EAAE,CAAC,CAAA;CACb,GAAG;IACF,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,gCAAgC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAA;IACzF,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,SAAS,CAAA;IACf;;;;;OAKG;IACH,IAAI,EAAE,IAAI,CAAA;IACV,gCAAgC;IAChC,gBAAgB,EAAE,CAAC,IAAI,EAAE,2BAA2B,CAAC,cAAc,CAAC,KAAK,MAAM,CAAA;IAC/E;;;;;OAKG;IACH,gBAAgB,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,mBAAmB,KAAK,cAAc,CAAA;IACvF,YAAY,EAAE,CAAC,IAAI,EAAE,uBAAuB,CAAC,cAAc,CAAC,KAAK,MAAM,CAAA;IACvE,aAAa,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,wBAAwB,KAAK,cAAc,CAAA;IACjF;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,OAAO,CAAA;CAExD,GAAG,QAAQ,CAAA"}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import * as v from 'valibot';
|
|
1
|
+
import type * as v from 'valibot';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* enrichment-editor UI. Mirrors the `EnrichmentFieldKind` enum in the
|
|
5
|
-
* skmtc-hub TypeSpec contract.
|
|
3
|
+
* Properties shared by every enrichment-field variant.
|
|
6
4
|
*/
|
|
7
|
-
export type
|
|
8
|
-
/**
|
|
9
|
-
* One node of a serialised enrichment-schema descriptor — the
|
|
10
|
-
* form-renderable projection of a generator's enrichment schema.
|
|
11
|
-
*/
|
|
12
|
-
export type EnrichmentField = {
|
|
5
|
+
export type EnrichmentFieldBase = {
|
|
13
6
|
/** Key written into the enrichment values object. */
|
|
14
7
|
key: string;
|
|
15
8
|
/** Human label, derived from the key when no metadata is supplied. */
|
|
@@ -17,22 +10,58 @@ export type EnrichmentField = {
|
|
|
17
10
|
description?: string;
|
|
18
11
|
/** Whether the schema marks this field optional. */
|
|
19
12
|
optional: boolean;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The variant-specific part of one enrichment field — the widget `type`
|
|
16
|
+
* discriminant plus exactly the payload that widget carries. Mirrors the
|
|
17
|
+
* `EnrichmentField` union in the skmtc-hub TypeSpec contract.
|
|
18
|
+
*
|
|
19
|
+
* There are deliberately NO standalone `module` / `schemaPath` widget
|
|
20
|
+
* types: a component reference is only meaningful WITH the path that gives
|
|
21
|
+
* it a type, so the pair is declared as one `moduleSelect` field. A
|
|
22
|
+
* generator that uses the raw `moduleExport` / `schemaPath` schemas
|
|
23
|
+
* standalone degrades to the generic object/array widgets.
|
|
24
|
+
*/
|
|
25
|
+
export type EnrichmentFieldShape = {
|
|
26
|
+
type: 'text';
|
|
27
|
+
} | {
|
|
28
|
+
type: 'textarea';
|
|
29
|
+
} | {
|
|
30
|
+
type: 'toggle';
|
|
31
|
+
} | {
|
|
32
|
+
type: 'select';
|
|
33
|
+
/** The selectable choices. */
|
|
34
|
+
options: string[];
|
|
35
|
+
} | {
|
|
36
|
+
type: 'moduleSelect';
|
|
23
37
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
38
|
+
* The TS source of the contract a chosen module must satisfy for this
|
|
39
|
+
* field (a single `export type XModule<F> = …` the editor's matcher
|
|
40
|
+
* checks candidates against). Always present: the module type is
|
|
41
|
+
* explicit in the declaration (`lensInputModuleType` for the common
|
|
42
|
+
* lens/input case), never an editor-side default.
|
|
29
43
|
*/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
44
|
+
moduleType: string;
|
|
45
|
+
} | {
|
|
46
|
+
type: 'array';
|
|
47
|
+
/** Shape of each item. */
|
|
48
|
+
item: EnrichmentField;
|
|
49
|
+
} | {
|
|
50
|
+
type: 'object';
|
|
51
|
+
/** The nested object's fields. */
|
|
52
|
+
fields: EnrichmentField[];
|
|
33
53
|
};
|
|
34
|
-
/**
|
|
35
|
-
|
|
54
|
+
/**
|
|
55
|
+
* One node of a serialised enrichment-schema descriptor — the
|
|
56
|
+
* form-renderable projection of a generator's enrichment schema,
|
|
57
|
+
* discriminated on `type`. Recursive: `array` fields carry a single
|
|
58
|
+
* `item` shape, `object` fields carry nested `fields`.
|
|
59
|
+
*/
|
|
60
|
+
export type EnrichmentField = EnrichmentFieldBase & EnrichmentFieldShape;
|
|
61
|
+
/** The widget-type discriminant values of {@link EnrichmentField}. */
|
|
62
|
+
export type EnrichmentFieldType = EnrichmentField['type'];
|
|
63
|
+
/** Which subject type a generator enriches — operations, webhooks, or models. */
|
|
64
|
+
export type SubjectType = 'operation' | 'model' | 'webhook';
|
|
36
65
|
/**
|
|
37
66
|
* A generator's enrichment schema, projected for the CMS. The same
|
|
38
67
|
* descriptor is what an agent would drive — the form UI is one
|
|
@@ -40,7 +69,14 @@ export type TargetKind = 'operation' | 'model';
|
|
|
40
69
|
*/
|
|
41
70
|
export type EnrichmentDescriptor = {
|
|
42
71
|
generator: string;
|
|
43
|
-
|
|
72
|
+
subjectType: SubjectType;
|
|
73
|
+
/**
|
|
74
|
+
* Whether this generator's entry declares variant support
|
|
75
|
+
* (`supportsVariant: () => true`). The CMS reads it to decide whether to
|
|
76
|
+
* offer the per-subject variant axis (add / rename / delete variants) above
|
|
77
|
+
* the subject scope; `false` when the entry omits it.
|
|
78
|
+
*/
|
|
79
|
+
supportsVariant: boolean;
|
|
44
80
|
fields: EnrichmentField[];
|
|
45
81
|
};
|
|
46
82
|
/**
|
|
@@ -54,6 +90,14 @@ export type EnrichmentSource = {
|
|
|
54
90
|
readonly id: string;
|
|
55
91
|
readonly type: 'oasOperation' | 'gqlOperation' | 'model' | 'webhook';
|
|
56
92
|
readonly toEnrichmentSchema?: () => v.GenericSchema;
|
|
93
|
+
/**
|
|
94
|
+
* Whether the entry supports the variant axis. Required: every entry built by
|
|
95
|
+
* `toOasOperationEntry` / `toGqlOperationEntry` / `toModelEntry` has it,
|
|
96
|
+
* because the factory inserts a `() => false` default when the author omits
|
|
97
|
+
* it — so by the time an entry reaches the descriptor the function always
|
|
98
|
+
* exists.
|
|
99
|
+
*/
|
|
100
|
+
readonly supportsVariant: () => boolean;
|
|
57
101
|
};
|
|
58
102
|
/**
|
|
59
103
|
* Walk a Valibot object schema and return the projected list of
|
|
@@ -71,7 +115,7 @@ export type EnrichmentSource = {
|
|
|
71
115
|
* umbrella yields `[]`.
|
|
72
116
|
*
|
|
73
117
|
* Generally callers should prefer {@link toEnrichmentDescriptor}, which
|
|
74
|
-
* takes a generator entry and fills in `generator` / `
|
|
118
|
+
* takes a generator entry and fills in `generator` / `subjectType`
|
|
75
119
|
* automatically. This lower-level entry point is useful in tests and
|
|
76
120
|
* when only the field shape is needed.
|
|
77
121
|
*/
|
|
@@ -80,8 +124,9 @@ export declare const toEnrichmentFields: (schema: v.GenericSchema | undefined) =
|
|
|
80
124
|
* Project a generator entry's enrichment schema into a serialisable
|
|
81
125
|
* `EnrichmentDescriptor` the CMS can render as a form. The entry's
|
|
82
126
|
* `id` becomes `descriptor.generator`; its `type` discriminator maps
|
|
83
|
-
* to `
|
|
84
|
-
* `'model'` → `'model'`). If the entry has no
|
|
127
|
+
* to `subjectType` (`'oasOperation' | 'gqlOperation'` → `'operation'`;
|
|
128
|
+
* `'webhook'` → `'webhook'`; `'model'` → `'model'`). If the entry has no
|
|
129
|
+
* `toEnrichmentSchema`, or
|
|
85
130
|
* declares the empty umbrella, the descriptor has an empty `fields`
|
|
86
131
|
* array — the UI hides the section, matching the engine's "no
|
|
87
132
|
* enrichments" behaviour.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toEnrichmentDescriptor.d.ts","sourceRoot":"","sources":["../../src/enrichments/toEnrichmentDescriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"toEnrichmentDescriptor.d.ts","sourceRoot":"","sources":["../../src/enrichments/toEnrichmentDescriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,CAAC,MAAM,SAAS,CAAA;AAGjC;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,qDAAqD;IACrD,GAAG,EAAE,MAAM,CAAA;IACX,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oDAAoD;IACpD,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IACA,IAAI,EAAE,QAAQ,CAAA;IACd,8BAA8B;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB,GACC;IACA,IAAI,EAAE,cAAc,CAAA;IACpB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAA;CACnB,GACC;IACA,IAAI,EAAE,OAAO,CAAA;IACb,0BAA0B;IAC1B,IAAI,EAAE,eAAe,CAAA;CACtB,GACC;IACA,IAAI,EAAE,QAAQ,CAAA;IACd,kCAAkC;IAClC,MAAM,EAAE,eAAe,EAAE,CAAA;CAC1B,CAAA;AAEH;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,oBAAoB,CAAA;AAExE,sEAAsE;AACtE,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,MAAM,CAAC,CAAA;AAEzD,iFAAiF;AACjF,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,CAAA;AAE3D;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,WAAW,CAAA;IACxB;;;;;OAKG;IACH,eAAe,EAAE,OAAO,CAAA;IACxB,MAAM,EAAE,eAAe,EAAE,CAAA;CAC1B,CAAA;AAED;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,cAAc,GAAG,OAAO,GAAG,SAAS,CAAA;IACpE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC,CAAC,aAAa,CAAA;IACnD;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,OAAO,CAAA;CACxC,CAAA;AAqJD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,CAAC,CAAC,aAAa,GAAG,SAAS,KAAG,eAAe,EAKvF,CAAA;AAsBD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,sBAAsB,GAAI,OAAO,gBAAgB,KAAG,oBAK/D,CAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.toEnrichmentDescriptor = exports.toEnrichmentFields = void 0;
|
|
4
|
-
const
|
|
5
|
-
const AccessorPath_js_1 = require("../types/AccessorPath.js");
|
|
4
|
+
const ModuleSelect_js_1 = require("../types/ModuleSelect.js");
|
|
6
5
|
const isValibotSchema = (input) => typeof input === 'object' &&
|
|
7
6
|
input !== null &&
|
|
8
7
|
'type' in input &&
|
|
@@ -16,6 +15,30 @@ const unwrap = (schema) => {
|
|
|
16
15
|
}
|
|
17
16
|
return { inner: schema, optional: false };
|
|
18
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* A `v.pipe(base, …actions)` schema spreads `base` and adds a `pipe` array
|
|
20
|
+
* whose first element IS the original base schema. The `moduleSelect`
|
|
21
|
+
* registry lookup must therefore also check the pipe's base, or piping a
|
|
22
|
+
* moduleSelect through metadata (`v.title(…)`) would silently demote it to
|
|
23
|
+
* a generic object widget.
|
|
24
|
+
*/
|
|
25
|
+
const baseOf = (schema) => Array.isArray(schema.pipe) && isValibotSchema(schema.pipe[0]) ? schema.pipe[0] : schema;
|
|
26
|
+
/** The `v.title(…)` metadata riding a piped schema, if any — the field label. */
|
|
27
|
+
const titleOf = (schema) => {
|
|
28
|
+
if (!Array.isArray(schema.pipe))
|
|
29
|
+
return undefined;
|
|
30
|
+
for (const action of schema.pipe) {
|
|
31
|
+
if (typeof action === 'object' &&
|
|
32
|
+
action !== null &&
|
|
33
|
+
'type' in action &&
|
|
34
|
+
action.type === 'title' &&
|
|
35
|
+
'title' in action &&
|
|
36
|
+
typeof action.title === 'string') {
|
|
37
|
+
return action.title;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return undefined;
|
|
41
|
+
};
|
|
19
42
|
/**
|
|
20
43
|
* Whether an object member should be omitted from the descriptor. A member
|
|
21
44
|
* that unwraps to `v.undefined()` carries no payload — it is the canonical
|
|
@@ -33,48 +56,51 @@ const toLabel = (key) => {
|
|
|
33
56
|
const spaced = key.replace(/([a-z0-9])([A-Z])/g, '$1 $2').replace(/[_-]+/g, ' ');
|
|
34
57
|
return spaced.charAt(0).toUpperCase() + spaced.slice(1);
|
|
35
58
|
};
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (isValibotSchema(AccessorPath_js_1.accessorPath) && schema === AccessorPath_js_1.accessorPath) {
|
|
41
|
-
return { kind: 'accessorPath' };
|
|
59
|
+
const typeFor = (schema) => {
|
|
60
|
+
const moduleType = (0, ModuleSelect_js_1.moduleTypeOf)(schema) ?? (0, ModuleSelect_js_1.moduleTypeOf)(baseOf(schema));
|
|
61
|
+
if (moduleType !== undefined) {
|
|
62
|
+
return { type: 'moduleSelect', moduleType };
|
|
42
63
|
}
|
|
43
64
|
switch (schema.type) {
|
|
44
65
|
case 'string':
|
|
45
|
-
return {
|
|
66
|
+
return { type: 'text' };
|
|
46
67
|
case 'boolean':
|
|
47
|
-
return {
|
|
68
|
+
return { type: 'toggle' };
|
|
48
69
|
case 'number':
|
|
49
|
-
return {
|
|
70
|
+
return { type: 'text' };
|
|
50
71
|
case 'picklist': {
|
|
51
72
|
const opts = isOptionsArray(schema.options) ? schema.options.map(o => String(o)) : [];
|
|
52
|
-
return {
|
|
73
|
+
return { type: 'select', options: opts };
|
|
53
74
|
}
|
|
54
75
|
case 'object': {
|
|
55
76
|
const entries = isEntriesRecord(schema.entries) ? schema.entries : {};
|
|
56
77
|
return {
|
|
57
|
-
|
|
78
|
+
type: 'object',
|
|
58
79
|
fields: walkEntries(entries)
|
|
59
80
|
};
|
|
60
81
|
}
|
|
61
82
|
case 'array': {
|
|
62
83
|
if (isValibotSchema(schema.item)) {
|
|
63
|
-
return {
|
|
84
|
+
return { type: 'array', item: walkFromShape('', schema.item) };
|
|
64
85
|
}
|
|
65
|
-
|
|
86
|
+
// An unrecognisable item schema degrades to a text item — consistent
|
|
87
|
+
// with the walker's default posture for unknown leaves.
|
|
88
|
+
return { type: 'array', item: { key: '', label: '', optional: false, type: 'text' } };
|
|
66
89
|
}
|
|
67
90
|
default:
|
|
68
|
-
return {
|
|
91
|
+
return { type: 'text' };
|
|
69
92
|
}
|
|
70
93
|
};
|
|
71
94
|
const walkFromShape = (key, rawSchema) => {
|
|
72
95
|
const { inner, optional } = unwrap(rawSchema);
|
|
73
|
-
|
|
96
|
+
// A `v.title(…)` label wins over the key-derived one; the title may ride
|
|
97
|
+
// the schema itself or sit inside an optional wrapper.
|
|
98
|
+
const label = titleOf(inner) ?? titleOf(rawSchema) ?? toLabel(key);
|
|
99
|
+
return { key, label, optional, ...typeFor(inner) };
|
|
74
100
|
};
|
|
75
101
|
const walkField = (key, rawSchema) => {
|
|
76
102
|
if (!isValibotSchema(rawSchema)) {
|
|
77
|
-
return { key, label: toLabel(key), optional: false,
|
|
103
|
+
return { key, label: toLabel(key), optional: false, type: 'text' };
|
|
78
104
|
}
|
|
79
105
|
return walkFromShape(key, rawSchema);
|
|
80
106
|
};
|
|
@@ -82,7 +108,7 @@ const walkField = (key, rawSchema) => {
|
|
|
82
108
|
* Walk an object schema's `entries` into descriptor fields, omitting members
|
|
83
109
|
* that carry no payload (see {@link isOmittedMember}). The single iteration
|
|
84
110
|
* point shared by the top-level walk ({@link toEnrichmentFields}) and the
|
|
85
|
-
* nested-object case in {@link
|
|
111
|
+
* nested-object case in {@link typeFor}.
|
|
86
112
|
*/
|
|
87
113
|
const walkEntries = (entries) => Object.keys(entries)
|
|
88
114
|
.filter(key => !isOmittedMember(entries[key]))
|
|
@@ -103,7 +129,7 @@ const walkEntries = (entries) => Object.keys(entries)
|
|
|
103
129
|
* umbrella yields `[]`.
|
|
104
130
|
*
|
|
105
131
|
* Generally callers should prefer {@link toEnrichmentDescriptor}, which
|
|
106
|
-
* takes a generator entry and fills in `generator` / `
|
|
132
|
+
* takes a generator entry and fills in `generator` / `subjectType`
|
|
107
133
|
* automatically. This lower-level entry point is useful in tests and
|
|
108
134
|
* when only the field shape is needed.
|
|
109
135
|
*/
|
|
@@ -116,21 +142,19 @@ const toEnrichmentFields = (schema) => {
|
|
|
116
142
|
return walkEntries(inner.entries);
|
|
117
143
|
};
|
|
118
144
|
exports.toEnrichmentFields = toEnrichmentFields;
|
|
119
|
-
const
|
|
145
|
+
const toSubjectType = (entryType) => {
|
|
120
146
|
switch (entryType) {
|
|
121
147
|
case 'model':
|
|
122
148
|
return 'model';
|
|
123
149
|
case 'oasOperation':
|
|
124
150
|
case 'gqlOperation':
|
|
125
151
|
return 'operation';
|
|
126
|
-
//
|
|
127
|
-
//
|
|
128
|
-
//
|
|
129
|
-
//
|
|
130
|
-
// to a coordinated change. (Was an uncovered gap: WebhookConfig joined the
|
|
131
|
-
// GeneratorConfig union without a toAppliesTo arm.)
|
|
152
|
+
// A webhook resembles an operation (a path-item keyed by HTTP method) but
|
|
153
|
+
// is a DISTINCT subject: it is addressed by webhook name, not request path,
|
|
154
|
+
// and has no request URL. It is its own SubjectType so the editor and the
|
|
155
|
+
// hub treat it truthfully rather than conflating it with an operation.
|
|
132
156
|
case 'webhook':
|
|
133
|
-
return '
|
|
157
|
+
return 'webhook';
|
|
134
158
|
default: {
|
|
135
159
|
const _exhaustive = entryType;
|
|
136
160
|
throw new Error(`Unhandled generator entry type: ${String(_exhaustive)}`);
|
|
@@ -141,8 +165,9 @@ const toAppliesTo = (entryType) => {
|
|
|
141
165
|
* Project a generator entry's enrichment schema into a serialisable
|
|
142
166
|
* `EnrichmentDescriptor` the CMS can render as a form. The entry's
|
|
143
167
|
* `id` becomes `descriptor.generator`; its `type` discriminator maps
|
|
144
|
-
* to `
|
|
145
|
-
* `'model'` → `'model'`). If the entry has no
|
|
168
|
+
* to `subjectType` (`'oasOperation' | 'gqlOperation'` → `'operation'`;
|
|
169
|
+
* `'webhook'` → `'webhook'`; `'model'` → `'model'`). If the entry has no
|
|
170
|
+
* `toEnrichmentSchema`, or
|
|
146
171
|
* declares the empty umbrella, the descriptor has an empty `fields`
|
|
147
172
|
* array — the UI hides the section, matching the engine's "no
|
|
148
173
|
* enrichments" behaviour.
|
|
@@ -156,7 +181,8 @@ const toAppliesTo = (entryType) => {
|
|
|
156
181
|
*/
|
|
157
182
|
const toEnrichmentDescriptor = (entry) => ({
|
|
158
183
|
generator: entry.id,
|
|
159
|
-
|
|
184
|
+
subjectType: toSubjectType(entry.type),
|
|
185
|
+
supportsVariant: entry.supportsVariant(),
|
|
160
186
|
fields: (0, exports.toEnrichmentFields)(entry.toEnrichmentSchema?.())
|
|
161
187
|
});
|
|
162
188
|
exports.toEnrichmentDescriptor = toEnrichmentDescriptor;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type GeneratorEnrichments } from '../types/Enrichments.js';
|
|
2
|
+
import type { EnrichmentSource } from './toEnrichmentDescriptor.js';
|
|
3
|
+
/**
|
|
4
|
+
* Which of the three enrichment scopes a validation issue belongs to.
|
|
5
|
+
* Mirrors the `{ subject, generator, stack }` umbrella members.
|
|
6
|
+
*/
|
|
7
|
+
export type EnrichmentValidationScope = 'subject' | 'generator' | 'stack';
|
|
8
|
+
/**
|
|
9
|
+
* One enrichment value that fails its generator's Valibot enrichment
|
|
10
|
+
* schema — the authoritative validation verdict. Produced by
|
|
11
|
+
* {@link validateConfig}; the routing fields locate the offending leaf in
|
|
12
|
+
* `client.json#settings.enrichments`:
|
|
13
|
+
*
|
|
14
|
+
* - **operation subject** — `subject` = path, `method` = HTTP method
|
|
15
|
+
* - **model subject** — `subject` = refName (no `method`)
|
|
16
|
+
* - **gql operation subject** — `subject` = field name, `method` = root type
|
|
17
|
+
* - **generator** run-constant — `scope: 'generator'` (no subject routing)
|
|
18
|
+
* - **stack** run-constant — `scope: 'stack'` (no subject routing)
|
|
19
|
+
*
|
|
20
|
+
* `field` is the dotted path to the offending key *within* the leaf
|
|
21
|
+
* (absent when the whole leaf is the wrong shape).
|
|
22
|
+
*/
|
|
23
|
+
export type EnrichmentValidationIssue = {
|
|
24
|
+
generator: string;
|
|
25
|
+
scope: EnrichmentValidationScope;
|
|
26
|
+
subject?: string;
|
|
27
|
+
method?: string;
|
|
28
|
+
variant?: string;
|
|
29
|
+
field?: string;
|
|
30
|
+
message: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The single enrichment-validation authority. Validates every enrichment
|
|
34
|
+
* value in `enrichments` against its owning generator's Valibot enrichment
|
|
35
|
+
* schema (`toEnrichmentSchema`) — composed across the supplied generator
|
|
36
|
+
* `sources` — and returns the flat list of value errors. This is the same
|
|
37
|
+
* Valibot that the engine parses at generate time; `validateConfig` exposes
|
|
38
|
+
* it as a standalone, **documentless** check (no OpenAPI/SDL needed — only
|
|
39
|
+
* the values and the schemas), usable wherever a verdict is needed:
|
|
40
|
+
* pre-persist, CLI push, schema-drift migration, and the Publish gate.
|
|
41
|
+
*
|
|
42
|
+
* Scope of this check (value validity only):
|
|
43
|
+
* - **catches** wrong-typed / missing-required / failed-refinement values
|
|
44
|
+
* against the current schema, and a generator configured but absent from
|
|
45
|
+
* the stack (`scope: 'generator'`, "not present in the stack").
|
|
46
|
+
* - **does not** flag unknown *fields* — Valibot's `v.object` strips
|
|
47
|
+
* unknown keys rather than erroring. Field-level referential drift ("this
|
|
48
|
+
* key is no longer in the schema") is the descriptor referential check's
|
|
49
|
+
* job, not this one.
|
|
50
|
+
* - **does not** resolve subjects against a document — subject *existence*
|
|
51
|
+
* (does this path/refName exist) needs the schema document and is the
|
|
52
|
+
* caller's concern.
|
|
53
|
+
*
|
|
54
|
+
* `sources` mirrors {@link toEnrichmentDescriptor}'s input: pass
|
|
55
|
+
* `Object.values(toGeneratorConfigMap())`. The walk is decoupled from
|
|
56
|
+
* `GeneratorConfig` via {@link EnrichmentSource} so tests can pass plain
|
|
57
|
+
* entry-like objects.
|
|
58
|
+
*/
|
|
59
|
+
export declare const validateConfig: (enrichments: GeneratorEnrichments | undefined, sources: readonly EnrichmentSource[]) => EnrichmentValidationIssue[];
|
|
60
|
+
//# sourceMappingURL=validateConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateConfig.d.ts","sourceRoot":"","sources":["../../src/enrichments/validateConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAA;AAEzE;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,yBAAyB,CAAA;IAChC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAkID;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,cAAc,GACzB,aAAa,oBAAoB,GAAG,SAAS,EAC7C,SAAS,SAAS,gBAAgB,EAAE,KACnC,yBAAyB,EA6C3B,CAAA"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.validateConfig = void 0;
|
|
37
|
+
const v = __importStar(require("valibot"));
|
|
38
|
+
const Enrichments_js_1 = require("../types/Enrichments.js");
|
|
39
|
+
const isRecord = (input) => typeof input === 'object' && input !== null && !Array.isArray(input);
|
|
40
|
+
const firstKey = (path) => path && path.length > 0 && path[0].key !== undefined ? String(path[0].key) : undefined;
|
|
41
|
+
const fieldPath = (path) => path && path.length > 1
|
|
42
|
+
? path
|
|
43
|
+
.slice(1)
|
|
44
|
+
.map(segment => String(segment.key))
|
|
45
|
+
.join('.')
|
|
46
|
+
: undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Collect every `{ subject, method?, variant, values }` leaf from a
|
|
49
|
+
* generator's enrichment slot, walking the routing depth its **type**
|
|
50
|
+
* dictates — model (`refName → variant`), oas operation
|
|
51
|
+
* (`path → method → variant`), gql operation
|
|
52
|
+
* (`rootKind → fieldName → variant`). Because the type is read from the
|
|
53
|
+
* generator entry, operation-vs-model is known authoritatively — there is
|
|
54
|
+
* no `'main' in value` shape-guessing. Reserved keys (`_generator`) are
|
|
55
|
+
* skipped; malformed nodes are skipped (they surface elsewhere, never here
|
|
56
|
+
* as a value error).
|
|
57
|
+
*/
|
|
58
|
+
const collectSubjectLeaves = (type, slot) => {
|
|
59
|
+
const leaves = [];
|
|
60
|
+
for (const [subjectKey, subjectValue] of Object.entries(slot)) {
|
|
61
|
+
if ((0, Enrichments_js_1.isReservedEnrichmentKey)(subjectKey))
|
|
62
|
+
continue;
|
|
63
|
+
if (!isRecord(subjectValue))
|
|
64
|
+
continue;
|
|
65
|
+
switch (type) {
|
|
66
|
+
case 'model': {
|
|
67
|
+
// refName → { variant: values }
|
|
68
|
+
for (const [variant, values] of Object.entries(subjectValue)) {
|
|
69
|
+
leaves.push({ subject: subjectKey, variant, values });
|
|
70
|
+
}
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
case 'oasOperation': {
|
|
74
|
+
// path → { method: { variant: values } }
|
|
75
|
+
for (const [method, variants] of Object.entries(subjectValue)) {
|
|
76
|
+
if (!isRecord(variants))
|
|
77
|
+
continue;
|
|
78
|
+
for (const [variant, values] of Object.entries(variants)) {
|
|
79
|
+
leaves.push({ subject: subjectKey, method, variant, values });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
case 'webhook': {
|
|
85
|
+
// name → { method: { variant: values } }
|
|
86
|
+
for (const [method, variants] of Object.entries(subjectValue)) {
|
|
87
|
+
if (!isRecord(variants))
|
|
88
|
+
continue;
|
|
89
|
+
for (const [variant, values] of Object.entries(variants)) {
|
|
90
|
+
leaves.push({ subject: subjectKey, method, variant, values });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
case 'gqlOperation': {
|
|
96
|
+
// rootKind → { fieldName: { variant: values } }
|
|
97
|
+
for (const [fieldName, variants] of Object.entries(subjectValue)) {
|
|
98
|
+
if (!isRecord(variants))
|
|
99
|
+
continue;
|
|
100
|
+
for (const [variant, values] of Object.entries(variants)) {
|
|
101
|
+
leaves.push({ subject: fieldName, method: subjectKey, variant, values });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
default: {
|
|
107
|
+
const _exhaustive = type;
|
|
108
|
+
throw new Error(`Unhandled generator type: ${String(_exhaustive)}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return leaves;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Validate one scope's value against the generator's composite umbrella
|
|
116
|
+
* schema, reporting only issues that belong to that scope. The other two
|
|
117
|
+
* scopes are passed `undefined` and any issues they raise are filtered out,
|
|
118
|
+
* so each scope is validated in isolation without duplicating run-constant
|
|
119
|
+
* errors across every subject. Mirrors generate-time
|
|
120
|
+
* `v.parse(toEnrichmentSchema(), { subject, generator, stack })`, swapping
|
|
121
|
+
* `parse` for `safeParse` to collect rather than throw.
|
|
122
|
+
*/
|
|
123
|
+
const parseScope = (schema, scope, value, tag) => {
|
|
124
|
+
const raw = {
|
|
125
|
+
subject: undefined,
|
|
126
|
+
generator: undefined,
|
|
127
|
+
stack: undefined
|
|
128
|
+
};
|
|
129
|
+
raw[scope] = value;
|
|
130
|
+
const result = v.safeParse(schema, raw);
|
|
131
|
+
if (result.success)
|
|
132
|
+
return [];
|
|
133
|
+
return result.issues
|
|
134
|
+
.filter(issue => firstKey(issue.path) === scope)
|
|
135
|
+
.map(issue => {
|
|
136
|
+
const field = fieldPath(issue.path);
|
|
137
|
+
return {
|
|
138
|
+
...tag,
|
|
139
|
+
scope,
|
|
140
|
+
...(field !== undefined ? { field } : {}),
|
|
141
|
+
message: issue.message
|
|
142
|
+
};
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* The single enrichment-validation authority. Validates every enrichment
|
|
147
|
+
* value in `enrichments` against its owning generator's Valibot enrichment
|
|
148
|
+
* schema (`toEnrichmentSchema`) — composed across the supplied generator
|
|
149
|
+
* `sources` — and returns the flat list of value errors. This is the same
|
|
150
|
+
* Valibot that the engine parses at generate time; `validateConfig` exposes
|
|
151
|
+
* it as a standalone, **documentless** check (no OpenAPI/SDL needed — only
|
|
152
|
+
* the values and the schemas), usable wherever a verdict is needed:
|
|
153
|
+
* pre-persist, CLI push, schema-drift migration, and the Publish gate.
|
|
154
|
+
*
|
|
155
|
+
* Scope of this check (value validity only):
|
|
156
|
+
* - **catches** wrong-typed / missing-required / failed-refinement values
|
|
157
|
+
* against the current schema, and a generator configured but absent from
|
|
158
|
+
* the stack (`scope: 'generator'`, "not present in the stack").
|
|
159
|
+
* - **does not** flag unknown *fields* — Valibot's `v.object` strips
|
|
160
|
+
* unknown keys rather than erroring. Field-level referential drift ("this
|
|
161
|
+
* key is no longer in the schema") is the descriptor referential check's
|
|
162
|
+
* job, not this one.
|
|
163
|
+
* - **does not** resolve subjects against a document — subject *existence*
|
|
164
|
+
* (does this path/refName exist) needs the schema document and is the
|
|
165
|
+
* caller's concern.
|
|
166
|
+
*
|
|
167
|
+
* `sources` mirrors {@link toEnrichmentDescriptor}'s input: pass
|
|
168
|
+
* `Object.values(toGeneratorConfigMap())`. The walk is decoupled from
|
|
169
|
+
* `GeneratorConfig` via {@link EnrichmentSource} so tests can pass plain
|
|
170
|
+
* entry-like objects.
|
|
171
|
+
*/
|
|
172
|
+
const validateConfig = (enrichments, sources) => {
|
|
173
|
+
if (!isRecord(enrichments))
|
|
174
|
+
return [];
|
|
175
|
+
const sourceById = new Map(sources.map(source => [source.id, source]));
|
|
176
|
+
const stack = enrichments[Enrichments_js_1.STACK_ENRICHMENT_KEY];
|
|
177
|
+
const issues = [];
|
|
178
|
+
for (const [generatorId, slot] of Object.entries(enrichments)) {
|
|
179
|
+
if (generatorId === Enrichments_js_1.STACK_ENRICHMENT_KEY)
|
|
180
|
+
continue;
|
|
181
|
+
// Other `_`-prefixed top-level keys are reserved/unknown — the
|
|
182
|
+
// `generatorEnrichments` schema flags those structurally, not here.
|
|
183
|
+
if ((0, Enrichments_js_1.isReservedEnrichmentKey)(generatorId))
|
|
184
|
+
continue;
|
|
185
|
+
const source = sourceById.get(generatorId);
|
|
186
|
+
if (!source) {
|
|
187
|
+
issues.push({
|
|
188
|
+
generator: generatorId,
|
|
189
|
+
scope: 'generator',
|
|
190
|
+
message: `Generator '${generatorId}' has enrichments configured but is not present in the stack.`
|
|
191
|
+
});
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
const schema = source.toEnrichmentSchema?.();
|
|
195
|
+
if (!schema || !isRecord(slot))
|
|
196
|
+
continue;
|
|
197
|
+
// Run-constant scopes — validated once per generator (each generator's
|
|
198
|
+
// umbrella declares its own `generator` / `stack` member shape).
|
|
199
|
+
issues.push(...parseScope(schema, 'generator', slot[Enrichments_js_1.GENERATOR_ENRICHMENT_KEY], { generator: generatorId }));
|
|
200
|
+
issues.push(...parseScope(schema, 'stack', stack, { generator: generatorId }));
|
|
201
|
+
// Subject scope — one parse per (subject, variant) leaf.
|
|
202
|
+
for (const leaf of collectSubjectLeaves(source.type, slot)) {
|
|
203
|
+
issues.push(...parseScope(schema, 'subject', leaf.values, {
|
|
204
|
+
generator: generatorId,
|
|
205
|
+
subject: leaf.subject,
|
|
206
|
+
...(leaf.method !== undefined ? { method: leaf.method } : {}),
|
|
207
|
+
variant: leaf.variant
|
|
208
|
+
}));
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return issues;
|
|
212
|
+
};
|
|
213
|
+
exports.validateConfig = validateConfig;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isImported = void 0;
|
|
4
|
-
const normalize_js_1 = require("../deps/jsr.io/@std/path/1.1.
|
|
4
|
+
const normalize_js_1 = require("../deps/jsr.io/@std/path/1.1.6/normalize.js");
|
|
5
5
|
/**
|
|
6
6
|
* Determines whether two file paths represent different locations (import required).
|
|
7
7
|
*
|
|
@@ -63,7 +63,7 @@ exports.toResolvedArtifactPath = void 0;
|
|
|
63
63
|
* @module toResolvedArtifactPath
|
|
64
64
|
*/
|
|
65
65
|
require("../_dnt.polyfills.js");
|
|
66
|
-
const join_js_1 = require("../deps/jsr.io/@std/path/1.1.
|
|
66
|
+
const join_js_1 = require("../deps/jsr.io/@std/path/1.1.6/join.js");
|
|
67
67
|
/**
|
|
68
68
|
* Resolves artifact destination paths relative to a base directory.
|
|
69
69
|
*
|