@skmtc/core 0.48.0 → 0.49.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/esm/context/CoreContext.d.ts +1 -1
- package/esm/context/CoreContext.js +6 -2
- package/esm/context/GenerateContext.d.ts +1 -1
- package/esm/context/GenerateContext.js +1 -1
- package/esm/context/ParseContext.d.ts +4 -4
- package/esm/context/ParseContext.js +6 -6
- package/esm/context/generateTypes.d.ts +4 -4
- package/esm/context/tryParseAt.d.ts +1 -1
- package/esm/context/tryParseAt.js +1 -1
- package/esm/enrichments/EnrichmentAudit.d.ts +1 -1
- package/esm/enrichments/EnrichmentWarning.d.ts +1 -1
- package/esm/enrichments/findUnknownKeys.d.ts +1 -1
- package/esm/enrichments/findUnknownKeys.js +1 -1
- package/esm/enrichments/parseEnrichmentUmbrella.d.ts +1 -1
- package/esm/enrichments/parseEnrichmentUmbrella.js +1 -1
- package/esm/enrichments/parseEnrichmentValue.d.ts +2 -2
- package/esm/enrichments/parseEnrichmentValue.js +2 -2
- package/esm/enrichments/readEnrichments.d.ts +4 -4
- package/esm/enrichments/readEnrichments.js +4 -4
- package/esm/enrichments/validateConfig.d.ts +1 -1
- package/esm/helpers/applyGeneratedSuffix.d.ts +1 -1
- package/esm/helpers/applyGeneratedSuffix.js +1 -1
- package/esm/helpers/normalizeWorkspacePath.d.ts +1 -1
- package/esm/helpers/normalizeWorkspacePath.js +1 -1
- package/esm/oas/array/Array.d.ts +2 -2
- package/esm/oas/array/Array.js +2 -2
- package/esm/oas/boolean/Boolean.d.ts +2 -2
- package/esm/oas/boolean/Boolean.js +2 -2
- package/esm/oas/integer/Integer.d.ts +2 -2
- package/esm/oas/integer/Integer.js +2 -2
- package/esm/oas/intersection/Intersection.d.ts +3 -3
- package/esm/oas/intersection/Intersection.js +3 -3
- package/esm/oas/number/Number.d.ts +2 -2
- package/esm/oas/number/Number.js +2 -2
- package/esm/oas/object/Object.d.ts +2 -2
- package/esm/oas/object/Object.js +2 -2
- package/esm/oas/operation/Operation.d.ts +1 -1
- package/esm/oas/operation/Operation.js +1 -1
- package/esm/oas/operation/toEffectiveParameters.d.ts +2 -2
- package/esm/oas/operation/toEffectiveParameters.js +2 -2
- package/esm/oas/ref/DanglingRefError.d.ts +1 -1
- package/esm/oas/ref/DanglingRefError.js +1 -1
- package/esm/oas/ref/Ref.d.ts +2 -2
- package/esm/oas/ref/Ref.js +2 -2
- package/esm/oas/string/String.d.ts +2 -2
- package/esm/oas/string/String.js +2 -2
- package/esm/oas/union/Union.d.ts +3 -3
- package/esm/oas/union/Union.js +3 -3
- package/esm/oas/unknown/Unknown.d.ts +2 -2
- package/esm/oas/unknown/Unknown.js +2 -2
- package/esm/parse/allOfSystem.d.ts +4 -4
- package/esm/parse/allOfSystem.js +2 -2
- package/esm/parse/anyOfSystem.d.ts +5 -5
- package/esm/parse/anyOfSystem.js +4 -4
- package/esm/parse/keptRefs.d.ts +2 -2
- package/esm/parse/v3-0/_merge-all-of/merge-union.d.ts +1 -1
- package/esm/parse/v3-0/_merge-all-of/merge-union.js +3 -3
- package/esm/parse/v3-0/_merge-all-of/merge.js +2 -2
- package/esm/parse/v3-0/_merge-all-of/types.d.ts +4 -4
- package/esm/parse/v3-0/ref/toRefV31.js +1 -1
- package/esm/parse/v3-0/schema/toSchemasV3.js +3 -3
- package/esm/parse/v3-1/_merge-all-of/merge-union.d.ts +1 -1
- package/esm/parse/v3-1/_merge-all-of/merge-union.js +3 -3
- package/esm/parse/v3-1/_merge-all-of/merge.js +2 -2
- package/esm/parse/v3-1/_merge-all-of/types.d.ts +4 -4
- package/esm/parse/v3-1/ref/toRefV31.js +1 -1
- package/esm/parse/v3-1/schema/toSchemasV3.js +3 -3
- package/esm/parse/v3-2/_merge-all-of/merge-union.d.ts +1 -1
- package/esm/parse/v3-2/_merge-all-of/merge-union.js +3 -3
- package/esm/parse/v3-2/_merge-all-of/merge.js +2 -2
- package/esm/parse/v3-2/_merge-all-of/types.d.ts +4 -4
- package/esm/parse/v3-2/ref/toRefV31.js +1 -1
- package/esm/parse/v3-2/schema/toSchemasV3.js +3 -3
- package/esm/run/toEnrichmentDefaults.d.ts +1 -1
- package/esm/run/toEnrichmentDefaults.js +1 -1
- package/esm/types/EnrichmentDefaults.d.ts +1 -1
- package/esm/types/EnrichmentDefaults.js +1 -1
- package/esm/types/Enrichments.d.ts +1 -1
- package/esm/types/Manifest.d.ts +1 -1
- package/esm/types/ModuleSelect.d.ts +1 -1
- package/esm/types/Settings.d.ts +29 -11
- package/esm/types/Settings.js +13 -6
- package/esm/types/Variant.d.ts +3 -3
- package/esm/types/Variant.js +3 -3
- package/package.json +1 -1
- package/script/context/CoreContext.d.ts +1 -1
- package/script/context/CoreContext.js +6 -2
- package/script/context/GenerateContext.d.ts +1 -1
- package/script/context/GenerateContext.js +1 -1
- package/script/context/ParseContext.d.ts +4 -4
- package/script/context/ParseContext.js +6 -6
- package/script/context/generateTypes.d.ts +4 -4
- package/script/context/tryParseAt.d.ts +1 -1
- package/script/context/tryParseAt.js +1 -1
- package/script/enrichments/EnrichmentAudit.d.ts +1 -1
- package/script/enrichments/EnrichmentWarning.d.ts +1 -1
- package/script/enrichments/findUnknownKeys.d.ts +1 -1
- package/script/enrichments/findUnknownKeys.js +1 -1
- package/script/enrichments/parseEnrichmentUmbrella.d.ts +1 -1
- package/script/enrichments/parseEnrichmentUmbrella.js +1 -1
- package/script/enrichments/parseEnrichmentValue.d.ts +2 -2
- package/script/enrichments/parseEnrichmentValue.js +2 -2
- package/script/enrichments/readEnrichments.d.ts +4 -4
- package/script/enrichments/readEnrichments.js +4 -4
- package/script/enrichments/validateConfig.d.ts +1 -1
- package/script/helpers/applyGeneratedSuffix.d.ts +1 -1
- package/script/helpers/applyGeneratedSuffix.js +1 -1
- package/script/helpers/normalizeWorkspacePath.d.ts +1 -1
- package/script/helpers/normalizeWorkspacePath.js +1 -1
- package/script/oas/array/Array.d.ts +2 -2
- package/script/oas/array/Array.js +2 -2
- package/script/oas/boolean/Boolean.d.ts +2 -2
- package/script/oas/boolean/Boolean.js +2 -2
- package/script/oas/integer/Integer.d.ts +2 -2
- package/script/oas/integer/Integer.js +2 -2
- package/script/oas/intersection/Intersection.d.ts +3 -3
- package/script/oas/intersection/Intersection.js +3 -3
- package/script/oas/number/Number.d.ts +2 -2
- package/script/oas/number/Number.js +2 -2
- package/script/oas/object/Object.d.ts +2 -2
- package/script/oas/object/Object.js +2 -2
- package/script/oas/operation/Operation.d.ts +1 -1
- package/script/oas/operation/Operation.js +1 -1
- package/script/oas/operation/toEffectiveParameters.d.ts +2 -2
- package/script/oas/operation/toEffectiveParameters.js +2 -2
- package/script/oas/ref/DanglingRefError.d.ts +1 -1
- package/script/oas/ref/DanglingRefError.js +1 -1
- package/script/oas/ref/Ref.d.ts +2 -2
- package/script/oas/ref/Ref.js +2 -2
- package/script/oas/string/String.d.ts +2 -2
- package/script/oas/string/String.js +2 -2
- package/script/oas/union/Union.d.ts +3 -3
- package/script/oas/union/Union.js +3 -3
- package/script/oas/unknown/Unknown.d.ts +2 -2
- package/script/oas/unknown/Unknown.js +2 -2
- package/script/parse/allOfSystem.d.ts +4 -4
- package/script/parse/allOfSystem.js +2 -2
- package/script/parse/anyOfSystem.d.ts +5 -5
- package/script/parse/anyOfSystem.js +4 -4
- package/script/parse/keptRefs.d.ts +2 -2
- package/script/parse/v3-0/_merge-all-of/merge-union.d.ts +1 -1
- package/script/parse/v3-0/_merge-all-of/merge-union.js +3 -3
- package/script/parse/v3-0/_merge-all-of/merge.js +2 -2
- package/script/parse/v3-0/_merge-all-of/types.d.ts +4 -4
- package/script/parse/v3-0/ref/toRefV31.js +1 -1
- package/script/parse/v3-0/schema/toSchemasV3.js +3 -3
- package/script/parse/v3-1/_merge-all-of/merge-union.d.ts +1 -1
- package/script/parse/v3-1/_merge-all-of/merge-union.js +3 -3
- package/script/parse/v3-1/_merge-all-of/merge.js +2 -2
- package/script/parse/v3-1/_merge-all-of/types.d.ts +4 -4
- package/script/parse/v3-1/ref/toRefV31.js +1 -1
- package/script/parse/v3-1/schema/toSchemasV3.js +3 -3
- package/script/parse/v3-2/_merge-all-of/merge-union.d.ts +1 -1
- package/script/parse/v3-2/_merge-all-of/merge-union.js +3 -3
- package/script/parse/v3-2/_merge-all-of/merge.js +2 -2
- package/script/parse/v3-2/_merge-all-of/types.d.ts +4 -4
- package/script/parse/v3-2/ref/toRefV31.js +1 -1
- package/script/parse/v3-2/schema/toSchemasV3.js +3 -3
- package/script/run/toEnrichmentDefaults.d.ts +1 -1
- package/script/run/toEnrichmentDefaults.js +1 -1
- package/script/types/EnrichmentDefaults.d.ts +1 -1
- package/script/types/EnrichmentDefaults.js +1 -1
- package/script/types/Enrichments.d.ts +1 -1
- package/script/types/Manifest.d.ts +1 -1
- package/script/types/ModuleSelect.d.ts +1 -1
- package/script/types/Settings.d.ts +29 -11
- package/script/types/Settings.js +14 -7
- package/script/types/Variant.d.ts +3 -3
- package/script/types/Variant.js +3 -3
|
@@ -9,7 +9,7 @@ export type GetRefFn = (ref: OpenAPIV3.ReferenceObject) => OpenAPIV3.SchemaObjec
|
|
|
9
9
|
*/
|
|
10
10
|
export type NormalizeFn = (schema: OpenAPIV3.SchemaObject) => OpenAPIV3.SchemaObject;
|
|
11
11
|
/**
|
|
12
|
-
* The `system` settings as the merge reads them (`
|
|
12
|
+
* The `system` settings as the merge reads them (`skmtc.config.json#settings.parse`),
|
|
13
13
|
* and the keywords a later `allOf` member replaced under `latestWins`, so
|
|
14
14
|
* the parser can name them in one warning for the schema.
|
|
15
15
|
*/
|
|
@@ -19,7 +19,7 @@ export type MergeSystem = {
|
|
|
19
19
|
/** `unknown`: a member with `not` merges, its `not` carried as written. Left out: `strict`, which refuses it. */
|
|
20
20
|
not?: 'strict' | 'unknown';
|
|
21
21
|
/**
|
|
22
|
-
* `
|
|
22
|
+
* `skmtc.config.json` `parse.allOf`, kept while the first pass over a cross
|
|
23
23
|
* product's pairs sets `allOf` to `strict`. A member's own `allOf` merges
|
|
24
24
|
* under this setting in every pass. Left out: `allOf` is the setting.
|
|
25
25
|
*/
|
|
@@ -27,9 +27,9 @@ export type MergeSystem = {
|
|
|
27
27
|
replaced: Set<string>;
|
|
28
28
|
/** `unknown`: an `anyOf` of two or more members is any value, so it adds nothing to the merge. Left out: `union`. */
|
|
29
29
|
anyOf?: 'union' | 'unknown';
|
|
30
|
-
/** The keywords the merge read as any value: `anyOf` under `
|
|
30
|
+
/** The keywords the merge read as any value: `anyOf` under `parse.anyOf: unknown`. */
|
|
31
31
|
unknown?: Set<string>;
|
|
32
|
-
/** The refs that stay refs (`
|
|
32
|
+
/** The refs that stay refs (`parse.intersections`). Left out: every ref is followed. */
|
|
33
33
|
keptRefs?: KeptRefs;
|
|
34
34
|
};
|
|
35
35
|
export type OneOfObject = {
|
|
@@ -7,7 +7,7 @@ export const toRefV31 = ({ ref, refType, stackTrail, context, nullable, readOnly
|
|
|
7
7
|
}
|
|
8
8
|
const oasRef = context.withStackTrail(stackTrail, () => new OasRef({ ...siblings, refType, $ref, nullable, readOnly, writeOnly }, context));
|
|
9
9
|
// The parse context checks each ref once the document is parsed, and
|
|
10
|
-
// removes what holds a ref that names nothing (`
|
|
10
|
+
// removes what holds a ref that names nothing (`parse.danglingRefs`).
|
|
11
11
|
context.registerOasRef(stackTrail.clone(), oasRef);
|
|
12
12
|
return oasRef;
|
|
13
13
|
};
|
|
@@ -141,12 +141,12 @@ export const toSchemaV3 = ({ schema, stackTrail, context }) => {
|
|
|
141
141
|
}
|
|
142
142
|
// OpenAPI `not` has no faithful TypeScript representation: a generated type
|
|
143
143
|
// that ignored it would *widen* the contract (accepting shapes the schema
|
|
144
|
-
// forbids). Under `
|
|
144
|
+
// forbids). Under `skmtc.config.json` `parse.not: strict` (the default) the schema
|
|
145
145
|
// is refused rather than emit a type that lies. The throw is isolated by
|
|
146
146
|
// `tryParseAt` into an `INVALID_SCHEMA` issue, and consumers of this schema
|
|
147
147
|
// are pruned via `removeErroredItems` (INVALID_DEPENDENCY_REF).
|
|
148
148
|
//
|
|
149
|
-
// Under `
|
|
149
|
+
// Under `parse.not: unknown` the schema parses with its other keywords, and
|
|
150
150
|
// its `not` is kept as an `OasUnknown` that core does not read: a generator
|
|
151
151
|
// can see that the document says "not something".
|
|
152
152
|
if ('not' in schema) {
|
|
@@ -326,7 +326,7 @@ export const toSchemaV3 = ({ schema, stackTrail, context }) => {
|
|
|
326
326
|
stackTrail,
|
|
327
327
|
context
|
|
328
328
|
});
|
|
329
|
-
// Under `
|
|
329
|
+
// Under `parse.anyOf: unknown`, as Cloudflare's `cf` reads it, an `anyOf`
|
|
330
330
|
// of two or more members is any value: the schema parses with its other
|
|
331
331
|
// keywords, so the properties next to it stay, without the members.
|
|
332
332
|
if (isUnknownAnyOf({ members: wrapper.anyOf ?? [], setting: context.system?.anyOf, getRef: toGetRef(context.documentObject) })) {
|
|
@@ -37,7 +37,7 @@ type EnrichmentDefaultsArgs = {
|
|
|
37
37
|
* Runs Parse + a values pass: every generator that advertises
|
|
38
38
|
* `toEnrichmentDefaults` is called over the subjects it supports, with no
|
|
39
39
|
* transform and no render. The result mirrors the
|
|
40
|
-
* `
|
|
40
|
+
* `skmtc.config.json#settings.enrichments` subtree (subject scope only) so a host can
|
|
41
41
|
* fold it straight into settings.
|
|
42
42
|
*
|
|
43
43
|
* Like {@link toSupportedSubjects} it fails open: a bad schema surfaces as a
|
|
@@ -7,7 +7,7 @@ import { CoreContext } from '../context/CoreContext.js';
|
|
|
7
7
|
* Runs Parse + a values pass: every generator that advertises
|
|
8
8
|
* `toEnrichmentDefaults` is called over the subjects it supports, with no
|
|
9
9
|
* transform and no render. The result mirrors the
|
|
10
|
-
* `
|
|
10
|
+
* `skmtc.config.json#settings.enrichments` subtree (subject scope only) so a host can
|
|
11
11
|
* fold it straight into settings.
|
|
12
12
|
*
|
|
13
13
|
* Like {@link toSupportedSubjects} it fails open: a bad schema surfaces as a
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* the capability set: only generators that advertise `toEnrichmentDefaults`
|
|
10
10
|
* appear, and only the subjects for which a non-`undefined` default is computed.
|
|
11
11
|
*
|
|
12
|
-
* The shape mirrors the `
|
|
12
|
+
* The shape mirrors the `skmtc.config.json#settings.enrichments` subtree so a host
|
|
13
13
|
* can fold it straight into settings (subject scope only — the run-constant
|
|
14
14
|
* `_generator` / `_stack` scopes are out of scope for seeding):
|
|
15
15
|
* - operation generator: `[id][path][method][variant] = values`
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* the capability set: only generators that advertise `toEnrichmentDefaults`
|
|
10
10
|
* appear, and only the subjects for which a non-`undefined` default is computed.
|
|
11
11
|
*
|
|
12
|
-
* The shape mirrors the `
|
|
12
|
+
* The shape mirrors the `skmtc.config.json#settings.enrichments` subtree so a host
|
|
13
13
|
* can fold it straight into settings (subject scope only — the run-constant
|
|
14
14
|
* `_generator` / `_stack` scopes are out of scope for seeding):
|
|
15
15
|
* - operation generator: `[id][path][method][variant] = values`
|
|
@@ -152,7 +152,7 @@ export type EnrichmentScopes = {
|
|
|
152
152
|
/**
|
|
153
153
|
* The `{ subject, generator, stack }` umbrella carried on
|
|
154
154
|
* `ContentSettings.enrichments`. Each member is the generator-owned leaf for
|
|
155
|
-
* that scope at a different key-depth in `
|
|
155
|
+
* that scope at a different key-depth in `skmtc.config.json#settings.enrichments`:
|
|
156
156
|
*
|
|
157
157
|
* - **subject** — `[id][subject][variant]`, resolved per item (the original
|
|
158
158
|
* per-subject enrichment).
|
package/esm/types/Manifest.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export type ManifestEntry = {
|
|
|
81
81
|
characters: number;
|
|
82
82
|
destinationPath: string;
|
|
83
83
|
/**
|
|
84
|
-
* True when the file is ejected (`
|
|
84
|
+
* True when the file is ejected (`skmtc.config.json#settings.ejected`) —
|
|
85
85
|
* the user owns it. The item still generated in memory (its content
|
|
86
86
|
* is drift detection's input) but the CLI did not write it to disk
|
|
87
87
|
* and will never delete it. Annotated by the CLI writer, not the
|
|
@@ -12,7 +12,7 @@ import { type SchemaPath } from './SchemaPath.js';
|
|
|
12
12
|
* schema-seeded fields start out, and how label/order overrides are
|
|
13
13
|
* expressed for fields that need no custom input.
|
|
14
14
|
*
|
|
15
|
-
* Stored in `
|
|
15
|
+
* Stored in `skmtc.config.json` under the literal key `moduleSelect`:
|
|
16
16
|
*
|
|
17
17
|
* ```jsonc
|
|
18
18
|
* {
|
package/esm/types/Settings.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ import { type Method } from './Method.js';
|
|
|
55
55
|
/**
|
|
56
56
|
* Valibot schema for {@link ModulePackage}.
|
|
57
57
|
*
|
|
58
|
-
* `rootPath` must be a **forward** path: `
|
|
58
|
+
* `rootPath` must be a **forward** path: `skmtc.config.json` `basePath` is
|
|
59
59
|
* the common on-disk anchor, so every package sits forward from it.
|
|
60
60
|
* A `..` segment means `basePath` was placed too deep — a misconfig
|
|
61
61
|
* that otherwise misplaces every artifact silently.
|
|
@@ -163,16 +163,22 @@ export declare const includeModels: v.GenericSchema<IncludeModels>;
|
|
|
163
163
|
*/
|
|
164
164
|
export declare const anchorsSettings: v.GenericSchema<AnchorsSettings>;
|
|
165
165
|
/**
|
|
166
|
-
* What `
|
|
166
|
+
* What `skmtc.config.json#settings.parse.danglingRefs` can list: each kind of
|
|
167
167
|
* `$ref`, and `allOfMember`, a `$ref` that core merges at parse: a member of
|
|
168
168
|
* an `allOf`, also one inside a `oneOf` or `anyOf` member, or a `oneOf` or
|
|
169
169
|
* `anyOf` member merged with the keywords beside the union.
|
|
170
170
|
*/
|
|
171
171
|
export declare const danglingRefKinds: readonly ["schema", "parameter", "requestBody", "response", "header", "securityScheme", "example", "link", "allOfMember"];
|
|
172
|
-
/** A kind of `$ref` that `
|
|
172
|
+
/** A kind of `$ref` that `parse.danglingRefs` can let name nothing. */
|
|
173
173
|
export type DanglingRefKind = (typeof danglingRefKinds)[number];
|
|
174
|
-
/** Valibot schema for {@link
|
|
175
|
-
export declare const
|
|
174
|
+
/** Valibot schema for {@link ParseSettings}: `skmtc.config.json#settings.parse`. */
|
|
175
|
+
export declare const parseSettings: v.GenericSchema<ParseSettings>;
|
|
176
|
+
/**
|
|
177
|
+
* The old name of {@link parseSettings}.
|
|
178
|
+
*
|
|
179
|
+
* @deprecated Use `parseSettings`.
|
|
180
|
+
*/
|
|
181
|
+
export declare const systemSettings: v.GenericSchema<ParseSettings>;
|
|
176
182
|
export declare const clientSettings: v.GenericSchema<ClientSettings>;
|
|
177
183
|
/**
|
|
178
184
|
* Configuration for skipping specific HTTP methods + variants on API paths.
|
|
@@ -408,7 +414,7 @@ export type Include = IncludeOperations | IncludeModels | string;
|
|
|
408
414
|
*/
|
|
409
415
|
/**
|
|
410
416
|
* Per-project gen-maps (`anchors`) configuration. Lives at
|
|
411
|
-
* `
|
|
417
|
+
* `skmtc.config.json#settings.anchors`.
|
|
412
418
|
*
|
|
413
419
|
* v1 honours the two fields below. Future fields (parser choice,
|
|
414
420
|
* gzip compression, map toggle) will land additively as the
|
|
@@ -431,11 +437,11 @@ export type AnchorsSettings = {
|
|
|
431
437
|
};
|
|
432
438
|
/**
|
|
433
439
|
* How the OpenAPI parser treats what it cannot read faithfully, or reads
|
|
434
|
-
* another way (`
|
|
440
|
+
* another way (`skmtc.config.json#settings.parse`). Each setting's default parses
|
|
435
441
|
* as core always did: `strict` fails the schema, and `removeErroredItems`
|
|
436
442
|
* removes each item that uses it.
|
|
437
443
|
*/
|
|
438
|
-
export type
|
|
444
|
+
export type ParseSettings = {
|
|
439
445
|
/**
|
|
440
446
|
* `latestWins`: where `allOf` members contradict, the later member's
|
|
441
447
|
* keyword wins, with one warning for each schema where it happens.
|
|
@@ -480,6 +486,12 @@ export type SystemSettings = {
|
|
|
480
486
|
*/
|
|
481
487
|
intersections?: 'merge' | 'cycles' | 'all';
|
|
482
488
|
};
|
|
489
|
+
/**
|
|
490
|
+
* The old name of {@link ParseSettings}.
|
|
491
|
+
*
|
|
492
|
+
* @deprecated Use `ParseSettings`.
|
|
493
|
+
*/
|
|
494
|
+
export type SystemSettings = ParseSettings;
|
|
483
495
|
export type ClientSettings = {
|
|
484
496
|
/** Base output path for generated files */
|
|
485
497
|
basePath?: string;
|
|
@@ -503,12 +515,18 @@ export type ClientSettings = {
|
|
|
503
515
|
* in v1. See {@link AnchorsSettings}.
|
|
504
516
|
*/
|
|
505
517
|
anchors?: AnchorsSettings;
|
|
506
|
-
/** How the OpenAPI parser treats what it cannot read faithfully. See {@link
|
|
507
|
-
|
|
518
|
+
/** How the OpenAPI parser treats what it cannot read faithfully. See {@link ParseSettings}. */
|
|
519
|
+
parse?: ParseSettings;
|
|
520
|
+
/**
|
|
521
|
+
* The old name of {@link parse}. Read only when `parse` is not set.
|
|
522
|
+
*
|
|
523
|
+
* @deprecated Use `parse`. `skmtc migrate config <project>` moves it.
|
|
524
|
+
*/
|
|
525
|
+
system?: ParseSettings;
|
|
508
526
|
/**
|
|
509
527
|
* Preview input-matcher discovery directories (project-root relative, e.g.
|
|
510
528
|
* `src/fields`, `src/inputs`). A preview/hub concern: the generation engine
|
|
511
|
-
* ignores it. Declared here so the CLI preserves it when reading `
|
|
529
|
+
* ignores it. Declared here so the CLI preserves it when reading `skmtc.config.json`
|
|
512
530
|
* and carries it through `skmtc push` to the hub.
|
|
513
531
|
*/
|
|
514
532
|
inputDirs?: string[];
|
package/esm/types/Settings.js
CHANGED
|
@@ -57,14 +57,14 @@ import { toWorkspacePath } from '../helpers/toWorkspacePath.js';
|
|
|
57
57
|
/**
|
|
58
58
|
* Valibot schema for {@link ModulePackage}.
|
|
59
59
|
*
|
|
60
|
-
* `rootPath` must be a **forward** path: `
|
|
60
|
+
* `rootPath` must be a **forward** path: `skmtc.config.json` `basePath` is
|
|
61
61
|
* the common on-disk anchor, so every package sits forward from it.
|
|
62
62
|
* A `..` segment means `basePath` was placed too deep — a misconfig
|
|
63
63
|
* that otherwise misplaces every artifact silently.
|
|
64
64
|
*/
|
|
65
65
|
export const modulePackage = v.object({
|
|
66
66
|
rootPath: v.pipe(v.string(), v.check(rootPath => !hasParentSegment(rootPath), 'package rootPath must be a forward path with no ".." segments — ' +
|
|
67
|
-
'set
|
|
67
|
+
'set skmtc.config.json basePath to a common ancestor of every package ' +
|
|
68
68
|
'so each rootPath is written forward from it')),
|
|
69
69
|
moduleName: v.optional(v.string())
|
|
70
70
|
});
|
|
@@ -170,7 +170,7 @@ export const anchorsSettings = v.object({
|
|
|
170
170
|
out: v.optional(v.string())
|
|
171
171
|
});
|
|
172
172
|
/**
|
|
173
|
-
* What `
|
|
173
|
+
* What `skmtc.config.json#settings.parse.danglingRefs` can list: each kind of
|
|
174
174
|
* `$ref`, and `allOfMember`, a `$ref` that core merges at parse: a member of
|
|
175
175
|
* an `allOf`, also one inside a `oneOf` or `anyOf` member, or a `oneOf` or
|
|
176
176
|
* `anyOf` member merged with the keywords beside the union.
|
|
@@ -186,8 +186,8 @@ export const danglingRefKinds = [
|
|
|
186
186
|
'link',
|
|
187
187
|
'allOfMember'
|
|
188
188
|
];
|
|
189
|
-
/** Valibot schema for {@link
|
|
190
|
-
export const
|
|
189
|
+
/** Valibot schema for {@link ParseSettings}: `skmtc.config.json#settings.parse`. */
|
|
190
|
+
export const parseSettings = v.object({
|
|
191
191
|
allOf: v.optional(v.picklist(['strict', 'latestWins'])),
|
|
192
192
|
responseContradictions: v.optional(v.picklist(['strict', 'unknown'])),
|
|
193
193
|
not: v.optional(v.picklist(['strict', 'unknown'])),
|
|
@@ -195,6 +195,12 @@ export const systemSettings = v.object({
|
|
|
195
195
|
danglingRefs: v.optional(v.array(v.picklist(danglingRefKinds))),
|
|
196
196
|
intersections: v.optional(v.picklist(['merge', 'cycles', 'all']))
|
|
197
197
|
});
|
|
198
|
+
/**
|
|
199
|
+
* The old name of {@link parseSettings}.
|
|
200
|
+
*
|
|
201
|
+
* @deprecated Use `parseSettings`.
|
|
202
|
+
*/
|
|
203
|
+
export const systemSettings = parseSettings;
|
|
198
204
|
export const clientSettings = v.object({
|
|
199
205
|
basePath: v.optional(v.pipe(v.string(), v.check(basePath => !isAbsolutePath(basePath), 'basePath must be relative to the SKMTC root (the directory containing .skmtc/); ' +
|
|
200
206
|
'absolute paths are not supported because generated output is always written under it'), v.check(basePath => !hasParentSegment(basePath), 'basePath must be a forward path with no ".." segments — it is the on-disk anchor ' +
|
|
@@ -205,7 +211,8 @@ export const clientSettings = v.object({
|
|
|
205
211
|
include: v.optional(v.array(include)),
|
|
206
212
|
skip: v.optional(v.array(skip)),
|
|
207
213
|
anchors: v.optional(anchorsSettings),
|
|
208
|
-
|
|
214
|
+
parse: v.optional(parseSettings),
|
|
215
|
+
system: v.optional(parseSettings),
|
|
209
216
|
inputDirs: v.optional(v.array(v.string())),
|
|
210
217
|
formatter: v.optional(v.string()),
|
|
211
218
|
generatedSuffix: v.optional(v.string()),
|
package/esm/types/Variant.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* A **variant** is a named axis below `[path][method]` (OAS) or
|
|
5
5
|
* `[rootKind][fieldName]` (GraphQL) inside
|
|
6
|
-
* `
|
|
6
|
+
* `skmtc.config.json#settings.enrichments`. It lets a single operation produce
|
|
7
7
|
* N Definitions instead of one — e.g. a single broad `PATCH` endpoint
|
|
8
8
|
* driving several section-edit forms, each scoped to a subset of fields.
|
|
9
9
|
*
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
* enrichment block. The variant name `'main'` is the canonical default
|
|
12
12
|
* and is guaranteed to be present:
|
|
13
13
|
*
|
|
14
|
-
* - When a consumer's `
|
|
14
|
+
* - When a consumer's `skmtc.config.json` writes no enrichments at all for a
|
|
15
15
|
* `(generatorId, path, method)`, the engine still dispatches once with
|
|
16
16
|
* `variant: 'main'` and `enrichments: undefined`.
|
|
17
|
-
* - When a consumer's `
|
|
17
|
+
* - When a consumer's `skmtc.config.json` writes any variants for a
|
|
18
18
|
* `(generatorId, path, method)`, `'main'` must be among them — Valibot
|
|
19
19
|
* rejects at parse time, and the engine also throws at runtime.
|
|
20
20
|
*
|
package/esm/types/Variant.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* A **variant** is a named axis below `[path][method]` (OAS) or
|
|
5
5
|
* `[rootKind][fieldName]` (GraphQL) inside
|
|
6
|
-
* `
|
|
6
|
+
* `skmtc.config.json#settings.enrichments`. It lets a single operation produce
|
|
7
7
|
* N Definitions instead of one — e.g. a single broad `PATCH` endpoint
|
|
8
8
|
* driving several section-edit forms, each scoped to a subset of fields.
|
|
9
9
|
*
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
* enrichment block. The variant name `'main'` is the canonical default
|
|
12
12
|
* and is guaranteed to be present:
|
|
13
13
|
*
|
|
14
|
-
* - When a consumer's `
|
|
14
|
+
* - When a consumer's `skmtc.config.json` writes no enrichments at all for a
|
|
15
15
|
* `(generatorId, path, method)`, the engine still dispatches once with
|
|
16
16
|
* `variant: 'main'` and `enrichments: undefined`.
|
|
17
|
-
* - When a consumer's `
|
|
17
|
+
* - When a consumer's `skmtc.config.json` writes any variants for a
|
|
18
18
|
* `(generatorId, path, method)`, `'main'` must be among them — Valibot
|
|
19
19
|
* rejects at parse time, and the engine also throws at runtime.
|
|
20
20
|
*
|
package/package.json
CHANGED
|
@@ -304,7 +304,7 @@ export declare class CoreContext {
|
|
|
304
304
|
* Seed-values sibling of {@link toSupportedSubjects}: parse the document, then
|
|
305
305
|
* call each generator's `toEnrichmentDefaults` over its supported subjects —
|
|
306
306
|
* no transform, no render. Returns the default enrichment values keyed by the
|
|
307
|
-
* `
|
|
307
|
+
* `skmtc.config.json#settings.enrichments` routing, plus parse issues. Fails open
|
|
308
308
|
* like {@link toArtifacts}: a bad schema surfaces as a `parseIssue` and the
|
|
309
309
|
* defaults map is returned empty.
|
|
310
310
|
*/
|
|
@@ -464,7 +464,7 @@ class CoreContext {
|
|
|
464
464
|
* Seed-values sibling of {@link toSupportedSubjects}: parse the document, then
|
|
465
465
|
* call each generator's `toEnrichmentDefaults` over its supported subjects —
|
|
466
466
|
* no transform, no render. Returns the default enrichment values keyed by the
|
|
467
|
-
* `
|
|
467
|
+
* `skmtc.config.json#settings.enrichments` routing, plus parse issues. Fails open
|
|
468
468
|
* like {@link toArtifacts}: a bad schema surfaces as a `parseIssue` and the
|
|
469
469
|
* defaults map is returned empty.
|
|
470
470
|
*/
|
|
@@ -575,11 +575,15 @@ _CoreContext_phase = new WeakMap(), _CoreContext_results = new WeakMap(), _CoreC
|
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
577
|
}, _CoreContext_setupParsePhase = function _CoreContext_setupParsePhase(input, settings) {
|
|
578
|
+
if (settings?.parse && settings.system) {
|
|
579
|
+
this.logger.warn('settings.parse and settings.system are both set: settings.parse is used and settings.system is ignored. ' +
|
|
580
|
+
'settings.system is the deprecated name of settings.parse; remove it.');
|
|
581
|
+
}
|
|
578
582
|
const parseContext = new ParseContext_js_1.ParseContext({
|
|
579
583
|
input,
|
|
580
584
|
logger: this.logger,
|
|
581
585
|
silent: this.silent,
|
|
582
|
-
system: settings?.system
|
|
586
|
+
system: settings?.parse ?? settings?.system
|
|
583
587
|
});
|
|
584
588
|
return { type: 'parse', context: parseContext };
|
|
585
589
|
}, _CoreContext_setupGeneratePhase = function _CoreContext_setupGeneratePhase({ document, settings, toGeneratorConfigMap, captureChannel }) {
|
|
@@ -202,7 +202,7 @@ export declare class GenerateContext implements GenerateContextType {
|
|
|
202
202
|
* document — the *values* counterpart of {@link toSupportedSubjects}. For
|
|
203
203
|
* every generator that advertises `toEnrichmentDefaults`, calls it over the
|
|
204
204
|
* subjects the generator supports and keeps the non-`undefined` subject-scope
|
|
205
|
-
* leaves, keyed by the `
|
|
205
|
+
* leaves, keyed by the `skmtc.config.json#settings.enrichments` routing:
|
|
206
206
|
* `[id][path][method]['main']` for operations, `[id][refName]['main']` for
|
|
207
207
|
* models. Seeding targets the `'main'` variant; a generator that advertises
|
|
208
208
|
* no defaults (or whose every subject returns `undefined`) is omitted.
|
|
@@ -388,7 +388,7 @@ class GenerateContext {
|
|
|
388
388
|
* document — the *values* counterpart of {@link toSupportedSubjects}. For
|
|
389
389
|
* every generator that advertises `toEnrichmentDefaults`, calls it over the
|
|
390
390
|
* subjects the generator supports and keeps the non-`undefined` subject-scope
|
|
391
|
-
* leaves, keyed by the `
|
|
391
|
+
* leaves, keyed by the `skmtc.config.json#settings.enrichments` routing:
|
|
392
392
|
* `[id][path][method]['main']` for operations, `[id][refName]['main']` for
|
|
393
393
|
* models. Seeding targets the `'main'` variant; a generator that advertises
|
|
394
394
|
* no defaults (or whose every subject returns `undefined`) is omitted.
|
|
@@ -72,7 +72,7 @@ type ConstructorArgs = {
|
|
|
72
72
|
options?: {
|
|
73
73
|
gql?: GqlParseOptions;
|
|
74
74
|
};
|
|
75
|
-
/** `
|
|
75
|
+
/** `skmtc.config.json#settings.parse`: how the OpenAPI parsers treat what they cannot read faithfully. */
|
|
76
76
|
system?: SystemSettings;
|
|
77
77
|
};
|
|
78
78
|
export declare class ParseContext {
|
|
@@ -90,7 +90,7 @@ export declare class ParseContext {
|
|
|
90
90
|
currentStackTrail: StackTrail | undefined;
|
|
91
91
|
/**
|
|
92
92
|
* How the OpenAPI parsers treat what they cannot read faithfully
|
|
93
|
-
* (`
|
|
93
|
+
* (`skmtc.config.json#settings.parse`). Each setting left out is `strict`.
|
|
94
94
|
*/
|
|
95
95
|
system: SystemSettings;
|
|
96
96
|
constructor({ input, logger, silent, options, system }: ConstructorArgs);
|
|
@@ -102,7 +102,7 @@ export declare class ParseContext {
|
|
|
102
102
|
get oasDocument(): OasDocument;
|
|
103
103
|
/** OAS-only accessor; symmetric reason to {@link oasDocument}. */
|
|
104
104
|
get documentObject(): OpenAPIV3.Document;
|
|
105
|
-
/** The refs of the document that a merge keeps as refs (`
|
|
105
|
+
/** The refs of the document that a merge keeps as refs (`parse.intersections`); `undefined` under `merge`. */
|
|
106
106
|
get keptRefs(): KeptRefs | undefined;
|
|
107
107
|
/** GQL-only accessor; throws if called on an OAS context. */
|
|
108
108
|
get schema(): GraphQLSchema;
|
|
@@ -180,7 +180,7 @@ export declare class ParseContext {
|
|
|
180
180
|
* What a merge reads in place of a `$ref` that names nothing: an `allOf`
|
|
181
181
|
* member, or in a `oneOf` or `anyOf`, a member's own `allOf` member or a
|
|
182
182
|
* member merged with the keywords beside the union. When
|
|
183
|
-
* `
|
|
183
|
+
* `parse.danglingRefs` lists `allOfMember`, it is `{}`, which
|
|
184
184
|
* adds nothing to the merge (`A & unknown` is `A`), and a `DANGLING_REF`
|
|
185
185
|
* warning at `stackTrail`: the model has no properties from that member.
|
|
186
186
|
* Otherwise it throws `DanglingRefError`, and what holds the `allOf` is
|
|
@@ -150,7 +150,7 @@ class ParseContext {
|
|
|
150
150
|
});
|
|
151
151
|
/**
|
|
152
152
|
* How the OpenAPI parsers treat what they cannot read faithfully
|
|
153
|
-
* (`
|
|
153
|
+
* (`skmtc.config.json#settings.parse`). Each setting left out is `strict`.
|
|
154
154
|
*/
|
|
155
155
|
Object.defineProperty(this, "system", {
|
|
156
156
|
enumerable: true,
|
|
@@ -242,7 +242,7 @@ class ParseContext {
|
|
|
242
242
|
}
|
|
243
243
|
return this.protocol.documentObject;
|
|
244
244
|
}
|
|
245
|
-
/** The refs of the document that a merge keeps as refs (`
|
|
245
|
+
/** The refs of the document that a merge keeps as refs (`parse.intersections`); `undefined` under `merge`. */
|
|
246
246
|
get keptRefs() {
|
|
247
247
|
__classPrivateFieldSet(this, _ParseContext_keptRefs, __classPrivateFieldGet(this, _ParseContext_keptRefs, "f") ?? {
|
|
248
248
|
value: (0, keptRefs_js_1.toKeptRefs)({ documentObject: this.documentObject, setting: this.system.intersections })
|
|
@@ -461,7 +461,7 @@ class ParseContext {
|
|
|
461
461
|
* What a merge reads in place of a `$ref` that names nothing: an `allOf`
|
|
462
462
|
* member, or in a `oneOf` or `anyOf`, a member's own `allOf` member or a
|
|
463
463
|
* member merged with the keywords beside the union. When
|
|
464
|
-
* `
|
|
464
|
+
* `parse.danglingRefs` lists `allOfMember`, it is `{}`, which
|
|
465
465
|
* adds nothing to the merge (`A & unknown` is `A`), and a `DANGLING_REF`
|
|
466
466
|
* warning at `stackTrail`: the model has no properties from that member.
|
|
467
467
|
* Otherwise it throws `DanglingRefError`, and what holds the `allOf` is
|
|
@@ -474,7 +474,7 @@ class ParseContext {
|
|
|
474
474
|
}
|
|
475
475
|
this.logIssueNoKey({
|
|
476
476
|
level: 'warning',
|
|
477
|
-
message: `${error.message}. It is left out of the allOf merge (
|
|
477
|
+
message: `${error.message}. It is left out of the allOf merge (parse.danglingRefs lists 'allOfMember').`,
|
|
478
478
|
parent: { $ref: error.ref },
|
|
479
479
|
stackTrail,
|
|
480
480
|
type: 'DANGLING_REF'
|
|
@@ -831,7 +831,7 @@ _ParseContext_refConsumers = new WeakMap(), _ParseContext_refErrors = new WeakMa
|
|
|
831
831
|
else if (this.system.danglingRefs?.includes(ref.refType)) {
|
|
832
832
|
this.logIssueNoKey({
|
|
833
833
|
level: 'warning',
|
|
834
|
-
message: `${error.message}. It is kept (
|
|
834
|
+
message: `${error.message}. It is kept (parse.danglingRefs lists '${ref.refType}'), and resolving it throws DanglingRefError.`,
|
|
835
835
|
parent: { $ref: ref.$ref },
|
|
836
836
|
stackTrail: consumer,
|
|
837
837
|
type: 'DANGLING_REF'
|
|
@@ -844,7 +844,7 @@ _ParseContext_refConsumers = new WeakMap(), _ParseContext_refErrors = new WeakMa
|
|
|
844
844
|
refTarget,
|
|
845
845
|
error,
|
|
846
846
|
type: 'DANGLING_REF',
|
|
847
|
-
message: `${error.message}, so what holds it is removed. To keep it, list '${ref.refType}' in
|
|
847
|
+
message: `${error.message}, so what holds it is removed. To keep it, list '${ref.refType}' in parse.danglingRefs.`
|
|
848
848
|
});
|
|
849
849
|
}
|
|
850
850
|
}
|
|
@@ -179,16 +179,16 @@ export type AnyOasDocument = OpenAPIV2.Document | OpenAPIV3.Document | OpenAPIV3
|
|
|
179
179
|
* non-JSON types (`multipart/form-data`, `text/plain`) logs nothing.
|
|
180
180
|
*
|
|
181
181
|
* `ALLOF_CONTRADICTION` (`warning`) — `allOf` members contradict, and
|
|
182
|
-
* `
|
|
182
|
+
* `parse.allOf: latestWins` kept the later member's keywords. One for each
|
|
183
183
|
* schema; the message names the keywords.
|
|
184
184
|
*
|
|
185
|
-
* `ANYOF_AS_UNKNOWN` (`warning`) — `
|
|
185
|
+
* `ANYOF_AS_UNKNOWN` (`warning`) — `parse.anyOf: unknown` read an `anyOf`
|
|
186
186
|
* of two or more members as any value. The schema keeps its other keywords.
|
|
187
187
|
* One for each schema.
|
|
188
188
|
*
|
|
189
189
|
* `DANGLING_REF` — a `$ref` names nothing in the document: no component has
|
|
190
190
|
* its name, or it is part of a loop of `$ref`s (`A` is a `$ref` to `B`, and
|
|
191
|
-
* `B` to `A`). One for each place the `$ref` is written. A `warning` when `
|
|
191
|
+
* `B` to `A`). One for each place the `$ref` is written. A `warning` when `parse.danglingRefs` lists
|
|
192
192
|
* the `$ref`'s kind: the ref stays, and resolving it throws
|
|
193
193
|
* `DanglingRefError`; with `allOfMember` listed, a `$ref` that core merges
|
|
194
194
|
* (in an `allOf`, or in a `oneOf` or `anyOf` member) is left out of the
|
|
@@ -199,7 +199,7 @@ export type AnyOasDocument = OpenAPIV2.Document | OpenAPIV3.Document | OpenAPIV3
|
|
|
199
199
|
* `REF_TYPE_MISMATCH` (`error`) — a `$ref` names a component of the wrong
|
|
200
200
|
* kind, such as a request body that is a `$ref` to
|
|
201
201
|
* `#/components/schemas/Pet`. One for each place the `$ref` is written. What
|
|
202
|
-
* holds the ref is removed; `
|
|
202
|
+
* holds the ref is removed; `parse.danglingRefs` does not apply.
|
|
203
203
|
*
|
|
204
204
|
* `RUN_FAILED` (`error`) — the run itself failed outside the per-item
|
|
205
205
|
* catches. Its `location` names the entry and phase, for example
|
|
@@ -63,7 +63,7 @@ export type TryParseAtArgs<T> = {
|
|
|
63
63
|
* given `type` and the thrown value as `cause`. A `DanglingRefError`
|
|
64
64
|
* is logged as `DANGLING_REF`: core resolved a ref while it parsed (one
|
|
65
65
|
* it merges, in an `allOf` or a `oneOf` or `anyOf` member, when
|
|
66
|
-
* `
|
|
66
|
+
* `parse.danglingRefs` does not list `allOfMember`)
|
|
67
67
|
* - registers a ref error if `refKey` is provided
|
|
68
68
|
* - returns `undefined`
|
|
69
69
|
*
|
|
@@ -30,7 +30,7 @@ const DanglingRefError_js_1 = require("../oas/ref/DanglingRefError.js");
|
|
|
30
30
|
* given `type` and the thrown value as `cause`. A `DanglingRefError`
|
|
31
31
|
* is logged as `DANGLING_REF`: core resolved a ref while it parsed (one
|
|
32
32
|
* it merges, in an `allOf` or a `oneOf` or `anyOf` member, when
|
|
33
|
-
* `
|
|
33
|
+
* `parse.danglingRefs` does not list `allOfMember`)
|
|
34
34
|
* - registers a ref error if `refKey` is provided
|
|
35
35
|
* - returns `undefined`
|
|
36
36
|
*
|
|
@@ -37,7 +37,7 @@ export type AuditGenerator = {
|
|
|
37
37
|
readonly type: 'oasOperation' | 'gqlOperation' | 'model' | 'webhook';
|
|
38
38
|
};
|
|
39
39
|
type FinalizeArgs = {
|
|
40
|
-
/** The consumer's `
|
|
40
|
+
/** The consumer's `skmtc.config.json#settings.enrichments` record. */
|
|
41
41
|
enrichments: GeneratorEnrichments | undefined;
|
|
42
42
|
/** The generators configured for this run. */
|
|
43
43
|
generators: readonly AuditGenerator[];
|
|
@@ -48,7 +48,7 @@ export type EnrichmentWarningType = 'UNCONSUMED_ENRICHMENT' | 'UNKNOWN_GENERATOR
|
|
|
48
48
|
export declare const enrichmentWarningType: v.GenericSchema<EnrichmentWarningType>;
|
|
49
49
|
/**
|
|
50
50
|
* One enrichment-config warning. `path` is the routing key sequence under
|
|
51
|
-
* `
|
|
51
|
+
* `skmtc.config.json#settings.enrichments` locating the offending entry —
|
|
52
52
|
* `[generatorId, ...subjectSegments]` for addressing warnings, extended
|
|
53
53
|
* down to the leaf key for `UNKNOWN_ENRICHMENT_KEY`. `suggestion` carries
|
|
54
54
|
* the nearest known key when a close match exists (`submitLabl` →
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* gives correct "did you mean …?" suggestions — the intended key is in
|
|
14
14
|
* the schema's entries even when it is optional and absent from the
|
|
15
15
|
* parsed value. This is deliberately a warning layer, not
|
|
16
|
-
* `v.strictObject`: a shared
|
|
16
|
+
* `v.strictObject`: a shared skmtc.config.json paired with an older generator
|
|
17
17
|
* version stays survivable under version skew instead of hard-failing.
|
|
18
18
|
*
|
|
19
19
|
* The walk is fail-open: unions, intersections, loose objects, and any
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* gives correct "did you mean …?" suggestions — the intended key is in
|
|
15
15
|
* the schema's entries even when it is optional and absent from the
|
|
16
16
|
* parsed value. This is deliberately a warning layer, not
|
|
17
|
-
* `v.strictObject`: a shared
|
|
17
|
+
* `v.strictObject`: a shared skmtc.config.json paired with an older generator
|
|
18
18
|
* version stays survivable under version skew instead of hard-failing.
|
|
19
19
|
*
|
|
20
20
|
* The walk is fail-open: unions, intersections, loose objects, and any
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* expected, not typos.
|
|
20
20
|
*
|
|
21
21
|
* A wrong-typed value throws ({@link parseEnrichmentValue}), naming each
|
|
22
|
-
* wrong value's place in `
|
|
22
|
+
* wrong value's place in `skmtc.config.json`. Unknown-key detection runs first,
|
|
23
23
|
* so a throwing leaf doesn't hide a dropped key.
|
|
24
24
|
*
|
|
25
25
|
* @module parseEnrichmentUmbrella
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* expected, not typos.
|
|
21
21
|
*
|
|
22
22
|
* A wrong-typed value throws ({@link parseEnrichmentValue}), naming each
|
|
23
|
-
* wrong value's place in `
|
|
23
|
+
* wrong value's place in `skmtc.config.json`. Unknown-key detection runs first,
|
|
24
24
|
* so a throwing leaf doesn't hide a dropped key.
|
|
25
25
|
*
|
|
26
26
|
* @module parseEnrichmentUmbrella
|
|
@@ -4,14 +4,14 @@ type ParseEnrichmentValueArgs<EnrichmentType> = {
|
|
|
4
4
|
value: unknown;
|
|
5
5
|
/** The generator whose schema reads `value`; `undefined` for the shared `_stack` bag. */
|
|
6
6
|
generatorId: string | undefined;
|
|
7
|
-
/** The `
|
|
7
|
+
/** The `skmtc.config.json#settings.enrichments` routing path of the value at `path` inside `value`. */
|
|
8
8
|
toRoutingPath: (path: readonly string[]) => string[];
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* `value` parsed through a generator's enrichment schema. Enrichments are
|
|
12
12
|
* typed configuration, so a value that does not match throws, and the run
|
|
13
13
|
* fails. The message lists every value that does not match, at its place in
|
|
14
|
-
* `
|
|
14
|
+
* `skmtc.config.json`, so the user can fix them all in one pass.
|
|
15
15
|
*/
|
|
16
16
|
export declare const parseEnrichmentValue: <EnrichmentType>({ schema, value, generatorId, toRoutingPath }: ParseEnrichmentValueArgs<EnrichmentType>) => EnrichmentType;
|
|
17
17
|
export {};
|