@skmtc/core 0.27.0 → 0.28.1
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.map +1 -1
- package/esm/context/CoreContext.js +4 -2
- package/esm/context/GenerateContext.d.ts +16 -2
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +94 -15
- package/esm/context/generateTypes.d.ts +33 -2
- package/esm/context/generateTypes.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.js +1 -2
- package/esm/dsl/model/toModelProjectionBase.d.ts +1 -1
- package/esm/dsl/model/toModelProjectionBase.d.ts.map +1 -1
- package/esm/dsl/model/toModelProjectionBase.js +9 -9
- package/esm/dsl/operation/gql/GqlOperationDriver.d.ts.map +1 -1
- package/esm/dsl/operation/gql/GqlOperationDriver.js +1 -3
- package/esm/dsl/operation/gql/toGqlOperationProjectionBase.d.ts +1 -1
- package/esm/dsl/operation/gql/toGqlOperationProjectionBase.d.ts.map +1 -1
- package/esm/dsl/operation/gql/toGqlOperationProjectionBase.js +9 -15
- package/esm/dsl/operation/oas/OasOperationDriver.d.ts.map +1 -1
- package/esm/dsl/operation/oas/OasOperationDriver.js +1 -3
- package/esm/dsl/operation/oas/toOasOperationProjectionBase.d.ts +1 -1
- package/esm/dsl/operation/oas/toOasOperationProjectionBase.d.ts.map +1 -1
- package/esm/dsl/operation/oas/toOasOperationProjectionBase.js +9 -15
- package/esm/dsl/webhook/WebhookDriver.d.ts.map +1 -1
- package/esm/dsl/webhook/WebhookDriver.js +1 -3
- package/esm/dsl/webhook/toWebhookProjectionBase.d.ts +1 -1
- package/esm/dsl/webhook/toWebhookProjectionBase.d.ts.map +1 -1
- package/esm/dsl/webhook/toWebhookProjectionBase.js +9 -15
- package/esm/enrichments/EnrichmentAudit.d.ts +79 -0
- package/esm/enrichments/EnrichmentAudit.d.ts.map +1 -0
- package/esm/enrichments/EnrichmentAudit.js +210 -0
- package/esm/enrichments/EnrichmentWarning.d.ts +72 -0
- package/esm/enrichments/EnrichmentWarning.d.ts.map +1 -0
- package/esm/enrichments/EnrichmentWarning.js +50 -0
- package/esm/enrichments/findUnknownKeys.d.ts +40 -0
- package/esm/enrichments/findUnknownKeys.d.ts.map +1 -0
- package/esm/enrichments/findUnknownKeys.js +80 -0
- package/esm/enrichments/parseEnrichmentUmbrella.d.ts +63 -0
- package/esm/enrichments/parseEnrichmentUmbrella.d.ts.map +1 -0
- package/esm/enrichments/parseEnrichmentUmbrella.js +66 -0
- package/esm/enrichments/toEnrichmentDescriptor.d.ts.map +1 -1
- package/esm/enrichments/toEnrichmentDescriptor.js +1 -20
- package/esm/enrichments/valibotShape.d.ts +51 -0
- package/esm/enrichments/valibotShape.d.ts.map +1 -0
- package/esm/enrichments/valibotShape.js +37 -0
- package/esm/helpers/nearestKey.d.ts +18 -0
- package/esm/helpers/nearestKey.d.ts.map +1 -0
- package/esm/helpers/nearestKey.js +60 -0
- package/esm/mod.d.ts +2 -0
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +2 -0
- package/esm/run/toArtifacts.d.ts.map +1 -1
- package/esm/run/toArtifacts.js +2 -1
- package/esm/types/Manifest.d.ts +9 -0
- package/esm/types/Manifest.d.ts.map +1 -1
- package/esm/types/Manifest.js +2 -0
- package/package.json +1 -1
- package/script/context/CoreContext.d.ts.map +1 -1
- package/script/context/CoreContext.js +4 -2
- package/script/context/GenerateContext.d.ts +16 -2
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +94 -15
- package/script/context/generateTypes.d.ts +33 -2
- package/script/context/generateTypes.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.js +1 -5
- package/script/dsl/model/toModelProjectionBase.d.ts +1 -1
- package/script/dsl/model/toModelProjectionBase.d.ts.map +1 -1
- package/script/dsl/model/toModelProjectionBase.js +9 -45
- package/script/dsl/operation/gql/GqlOperationDriver.d.ts.map +1 -1
- package/script/dsl/operation/gql/GqlOperationDriver.js +1 -6
- package/script/dsl/operation/gql/toGqlOperationProjectionBase.d.ts +1 -1
- package/script/dsl/operation/gql/toGqlOperationProjectionBase.d.ts.map +1 -1
- package/script/dsl/operation/gql/toGqlOperationProjectionBase.js +9 -51
- package/script/dsl/operation/oas/OasOperationDriver.d.ts.map +1 -1
- package/script/dsl/operation/oas/OasOperationDriver.js +1 -6
- package/script/dsl/operation/oas/toOasOperationProjectionBase.d.ts +1 -1
- package/script/dsl/operation/oas/toOasOperationProjectionBase.d.ts.map +1 -1
- package/script/dsl/operation/oas/toOasOperationProjectionBase.js +9 -51
- package/script/dsl/webhook/WebhookDriver.d.ts.map +1 -1
- package/script/dsl/webhook/WebhookDriver.js +1 -6
- package/script/dsl/webhook/toWebhookProjectionBase.d.ts +1 -1
- package/script/dsl/webhook/toWebhookProjectionBase.d.ts.map +1 -1
- package/script/dsl/webhook/toWebhookProjectionBase.js +9 -51
- package/script/enrichments/EnrichmentAudit.d.ts +79 -0
- package/script/enrichments/EnrichmentAudit.d.ts.map +1 -0
- package/script/enrichments/EnrichmentAudit.js +215 -0
- package/script/enrichments/EnrichmentWarning.d.ts +72 -0
- package/script/enrichments/EnrichmentWarning.d.ts.map +1 -0
- package/script/enrichments/EnrichmentWarning.js +87 -0
- package/script/enrichments/findUnknownKeys.d.ts +40 -0
- package/script/enrichments/findUnknownKeys.d.ts.map +1 -0
- package/script/enrichments/findUnknownKeys.js +84 -0
- package/script/enrichments/parseEnrichmentUmbrella.d.ts +63 -0
- package/script/enrichments/parseEnrichmentUmbrella.d.ts.map +1 -0
- package/script/enrichments/parseEnrichmentUmbrella.js +103 -0
- package/script/enrichments/toEnrichmentDescriptor.d.ts.map +1 -1
- package/script/enrichments/toEnrichmentDescriptor.js +10 -29
- package/script/enrichments/valibotShape.d.ts +51 -0
- package/script/enrichments/valibotShape.d.ts.map +1 -0
- package/script/enrichments/valibotShape.js +44 -0
- package/script/helpers/nearestKey.d.ts +18 -0
- package/script/helpers/nearestKey.d.ts.map +1 -0
- package/script/helpers/nearestKey.js +64 -0
- package/script/mod.d.ts +2 -0
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +2 -0
- package/script/run/toArtifacts.d.ts.map +1 -1
- package/script/run/toArtifacts.js +2 -1
- package/script/types/Manifest.d.ts +9 -0
- package/script/types/Manifest.d.ts.map +1 -1
- package/script/types/Manifest.js +2 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview The enrichment-warning surface — the manifest's record of
|
|
3
|
+
* enrichment config that did not do what the consumer intended.
|
|
4
|
+
*
|
|
5
|
+
* Three validation layers precede this one: structural validation at CLI
|
|
6
|
+
* load (`generatorEnrichments`), the per-leaf Valibot parse at generate
|
|
7
|
+
* time (a wrongly-typed value in a reached leaf throws), and the
|
|
8
|
+
* missing-`'main'` variant throw (`toVariantList`). All three are loud.
|
|
9
|
+
* What they cannot see is *addressing*: a typo'd generator id, path,
|
|
10
|
+
* method, or model name makes `get()` miss silently — defaults apply and
|
|
11
|
+
* the config entry is dead. Unknown leaf keys are equally silent:
|
|
12
|
+
* `v.object` strips them before the generator sees them.
|
|
13
|
+
*
|
|
14
|
+
* `EnrichmentWarning` is the shared shape for both detectors:
|
|
15
|
+
*
|
|
16
|
+
* - the **consumption audit** (`EnrichmentAudit`) — records every
|
|
17
|
+
* enrichment lookup the engine performs during the generate walk and,
|
|
18
|
+
* post-walk, flags configured entries no lookup ever touched;
|
|
19
|
+
* - **unknown-key detection** (`findUnknownKeys`, run inside
|
|
20
|
+
* `parseEnrichmentUmbrella`) — flags leaf keys the generator's schema
|
|
21
|
+
* does not declare.
|
|
22
|
+
*
|
|
23
|
+
* Both are warn-level and fail-open: generation output is never affected.
|
|
24
|
+
* The warnings ride the manifest (`manifest.enrichmentWarnings`) so
|
|
25
|
+
* post-run diagnostics can re-read them without re-running.
|
|
26
|
+
*
|
|
27
|
+
* @module EnrichmentWarning
|
|
28
|
+
*/
|
|
29
|
+
import * as v from 'valibot';
|
|
30
|
+
export const enrichmentWarningType = v.picklist([
|
|
31
|
+
'UNCONSUMED_ENRICHMENT',
|
|
32
|
+
'UNKNOWN_GENERATOR_ID',
|
|
33
|
+
'UNKNOWN_ENRICHMENT_KEY',
|
|
34
|
+
'SKIPPED_SUBJECT_ENRICHMENT',
|
|
35
|
+
'SKIPPED_GENERATOR_ENRICHMENT'
|
|
36
|
+
]);
|
|
37
|
+
export const enrichmentWarning = v.object({
|
|
38
|
+
level: v.picklist(['warning', 'info']),
|
|
39
|
+
type: enrichmentWarningType,
|
|
40
|
+
path: v.array(v.string()),
|
|
41
|
+
message: v.string(),
|
|
42
|
+
suggestion: v.optional(v.string())
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* Render a routing path for warning messages:
|
|
46
|
+
* `['@skmtc/gen-shadcn-form', '/pets', 'post']` →
|
|
47
|
+
* `'@skmtc/gen-shadcn-form → /pets → post'`. The arrow separator keeps
|
|
48
|
+
* segments visually distinct even when they contain dots or slashes.
|
|
49
|
+
*/
|
|
50
|
+
export const formatEnrichmentPath = (path) => path.join(' → ');
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Unknown-key detection for enrichment leaves.
|
|
3
|
+
*
|
|
4
|
+
* Valibot's `v.object` strips keys the schema does not declare — a
|
|
5
|
+
* misspelled optional key (`submitLabl` for `submitLabel`) parses cleanly
|
|
6
|
+
* and the generator silently sees the default. `findUnknownKeys` walks a
|
|
7
|
+
* value against its schema and reports every key the schema would drop,
|
|
8
|
+
* so `parseEnrichmentUmbrella` can surface them as
|
|
9
|
+
* `UNKNOWN_ENRICHMENT_KEY` warnings.
|
|
10
|
+
*
|
|
11
|
+
* Comparing against the *schema* (not the parsed output) keeps the check
|
|
12
|
+
* immune to `v.pipe` transforms that legitimately reshape output, and
|
|
13
|
+
* gives correct "did you mean …?" suggestions — the intended key is in
|
|
14
|
+
* the schema's entries even when it is optional and absent from the
|
|
15
|
+
* parsed value. This is deliberately a warning layer, not
|
|
16
|
+
* `v.strictObject`: a shared client.json paired with an older generator
|
|
17
|
+
* version stays survivable under version skew instead of hard-failing.
|
|
18
|
+
*
|
|
19
|
+
* The walk is fail-open: unions, intersections, loose objects, and any
|
|
20
|
+
* shape it cannot attribute keys to are left alone.
|
|
21
|
+
*
|
|
22
|
+
* @module findUnknownKeys
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* One key the schema would silently drop. `path` runs from the walked
|
|
26
|
+
* root down to the unknown key (array indices as strings); `suggestion`
|
|
27
|
+
* is the nearest declared key at the same level, when a plausible typo
|
|
28
|
+
* target exists.
|
|
29
|
+
*/
|
|
30
|
+
export type UnknownKey = {
|
|
31
|
+
path: string[];
|
|
32
|
+
suggestion?: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Every key in `value` that `schema` does not declare and `v.parse` would
|
|
36
|
+
* therefore drop. Wrong-typed values are not this function's concern —
|
|
37
|
+
* the subsequent `v.parse` throws on those as before.
|
|
38
|
+
*/
|
|
39
|
+
export declare const findUnknownKeys: (schema: unknown, value: unknown) => UnknownKey[];
|
|
40
|
+
//# sourceMappingURL=findUnknownKeys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findUnknownKeys.d.ts","sourceRoot":"","sources":["../../src/enrichments/findUnknownKeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAgDD;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,OAAO,EAAE,OAAO,OAAO,KAAG,UAAU,EAI3E,CAAA"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Unknown-key detection for enrichment leaves.
|
|
3
|
+
*
|
|
4
|
+
* Valibot's `v.object` strips keys the schema does not declare — a
|
|
5
|
+
* misspelled optional key (`submitLabl` for `submitLabel`) parses cleanly
|
|
6
|
+
* and the generator silently sees the default. `findUnknownKeys` walks a
|
|
7
|
+
* value against its schema and reports every key the schema would drop,
|
|
8
|
+
* so `parseEnrichmentUmbrella` can surface them as
|
|
9
|
+
* `UNKNOWN_ENRICHMENT_KEY` warnings.
|
|
10
|
+
*
|
|
11
|
+
* Comparing against the *schema* (not the parsed output) keeps the check
|
|
12
|
+
* immune to `v.pipe` transforms that legitimately reshape output, and
|
|
13
|
+
* gives correct "did you mean …?" suggestions — the intended key is in
|
|
14
|
+
* the schema's entries even when it is optional and absent from the
|
|
15
|
+
* parsed value. This is deliberately a warning layer, not
|
|
16
|
+
* `v.strictObject`: a shared client.json paired with an older generator
|
|
17
|
+
* version stays survivable under version skew instead of hard-failing.
|
|
18
|
+
*
|
|
19
|
+
* The walk is fail-open: unions, intersections, loose objects, and any
|
|
20
|
+
* shape it cannot attribute keys to are left alone.
|
|
21
|
+
*
|
|
22
|
+
* @module findUnknownKeys
|
|
23
|
+
*/
|
|
24
|
+
import { isEntriesRecord, isValibotSchema, unwrap } from './valibotShape.js';
|
|
25
|
+
import { nearestKey } from '../helpers/nearestKey.js';
|
|
26
|
+
const isRecord = (input) => typeof input === 'object' && input !== null && !Array.isArray(input);
|
|
27
|
+
const walk = (rawSchema, value, path, out) => {
|
|
28
|
+
if (value === undefined || value === null)
|
|
29
|
+
return;
|
|
30
|
+
if (!isValibotSchema(rawSchema))
|
|
31
|
+
return;
|
|
32
|
+
// A piped schema spreads its base, so `type` / `entries` / `item` are
|
|
33
|
+
// still visible here — no explicit pipe handling needed.
|
|
34
|
+
const { inner } = unwrap(rawSchema);
|
|
35
|
+
switch (inner.type) {
|
|
36
|
+
case 'object': {
|
|
37
|
+
if (!isRecord(value) || !isEntriesRecord(inner.entries))
|
|
38
|
+
return;
|
|
39
|
+
const entries = inner.entries;
|
|
40
|
+
const declared = Object.keys(entries);
|
|
41
|
+
for (const [key, member] of Object.entries(value)) {
|
|
42
|
+
if (key in entries) {
|
|
43
|
+
walk(entries[key], member, [...path, key], out);
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
const suggestion = nearestKey(key, declared);
|
|
47
|
+
out.push({ path: [...path, key], ...(suggestion !== undefined ? { suggestion } : {}) });
|
|
48
|
+
}
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
case 'record': {
|
|
52
|
+
if (!isRecord(value))
|
|
53
|
+
return;
|
|
54
|
+
for (const [key, member] of Object.entries(value)) {
|
|
55
|
+
walk(inner.value, member, [...path, key], out);
|
|
56
|
+
}
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
case 'array': {
|
|
60
|
+
if (!Array.isArray(value))
|
|
61
|
+
return;
|
|
62
|
+
value.forEach((member, index) => walk(inner.item, member, [...path, String(index)], out));
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
default:
|
|
66
|
+
// Leaves, unions, intersections, loose/strict objects: nothing to
|
|
67
|
+
// attribute, or Valibot itself errors loudly (strict). Fail open.
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Every key in `value` that `schema` does not declare and `v.parse` would
|
|
73
|
+
* therefore drop. Wrong-typed values are not this function's concern —
|
|
74
|
+
* the subsequent `v.parse` throws on those as before.
|
|
75
|
+
*/
|
|
76
|
+
export const findUnknownKeys = (schema, value) => {
|
|
77
|
+
const out = [];
|
|
78
|
+
walk(schema, value, [], out);
|
|
79
|
+
return out;
|
|
80
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview The shared umbrella-parse seam for the projection-base
|
|
3
|
+
* factories.
|
|
4
|
+
*
|
|
5
|
+
* Every `static toEnrichments` — OAS operation, webhook, GQL operation,
|
|
6
|
+
* model — assembles the same `{ subject, generator, stack }` umbrella
|
|
7
|
+
* from three storage spots and parses it through the generator's
|
|
8
|
+
* composite schema. This helper centralizes that assembly so both
|
|
9
|
+
* enrichment-validation mechanisms ride one seam:
|
|
10
|
+
*
|
|
11
|
+
* - the reads go through `context.readEnrichment` — the recording
|
|
12
|
+
* accessor feeding the consumption audit (`EnrichmentAudit`);
|
|
13
|
+
* - the raw values are diffed against the schema (`findUnknownKeys`)
|
|
14
|
+
* and dropped keys surface as `UNKNOWN_ENRICHMENT_KEY` warnings.
|
|
15
|
+
*
|
|
16
|
+
* The `stack` scope is exempt from unknown-key detection: it is a single
|
|
17
|
+
* bag shared by every generator in the composition, and each consumer
|
|
18
|
+
* declares only the fields it reads — keys other generators own are
|
|
19
|
+
* expected, not typos.
|
|
20
|
+
*
|
|
21
|
+
* A wrong-typed value still throws exactly as before — the `v.parse` at
|
|
22
|
+
* the end is unchanged, and unknown-key detection runs first so a
|
|
23
|
+
* throwing leaf doesn't hide a dropped key.
|
|
24
|
+
*
|
|
25
|
+
* @module parseEnrichmentUmbrella
|
|
26
|
+
*/
|
|
27
|
+
import * as v from 'valibot';
|
|
28
|
+
import { type EnrichmentWarning } from './EnrichmentWarning.js';
|
|
29
|
+
/**
|
|
30
|
+
* Minimal structural view of the context the parse needs. Any
|
|
31
|
+
* `GenerateContext` satisfies it; kept structural so the helper stays
|
|
32
|
+
* decoupled from the full context type and is trivially testable.
|
|
33
|
+
*/
|
|
34
|
+
type UmbrellaParseContext = {
|
|
35
|
+
readEnrichment: (segments: readonly string[]) => unknown;
|
|
36
|
+
reportEnrichmentWarning: (warning: EnrichmentWarning) => void;
|
|
37
|
+
};
|
|
38
|
+
type ParseEnrichmentUmbrellaArgs<EnrichmentType> = {
|
|
39
|
+
context: UmbrellaParseContext;
|
|
40
|
+
generatorId: string;
|
|
41
|
+
/**
|
|
42
|
+
* Subject routing segments under `[generatorId]`, including the
|
|
43
|
+
* variant — `[path, method, variant]` for OAS operations,
|
|
44
|
+
* `[name, method, variant]` for webhooks,
|
|
45
|
+
* `[rootKind, fieldName, variant]` for GQL operations,
|
|
46
|
+
* `[refName, variant]` for models.
|
|
47
|
+
*/
|
|
48
|
+
subjectSegments: readonly string[];
|
|
49
|
+
/** The generator's composite `{ subject, generator, stack }` schema. */
|
|
50
|
+
schema: v.GenericSchema<EnrichmentType>;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Assemble and parse one `{ subject, generator, stack }` enrichment
|
|
54
|
+
* umbrella, recording the reads for the consumption audit and reporting
|
|
55
|
+
* schema-dropped keys.
|
|
56
|
+
*
|
|
57
|
+
* @throws on a wrong-typed value, exactly like the raw `v.parse` this
|
|
58
|
+
* wraps — the generator's item is then recorded as `error` and the run
|
|
59
|
+
* continues (fail-open).
|
|
60
|
+
*/
|
|
61
|
+
export declare const parseEnrichmentUmbrella: <EnrichmentType>({ context, generatorId, subjectSegments, schema }: ParseEnrichmentUmbrellaArgs<EnrichmentType>) => EnrichmentType;
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=parseEnrichmentUmbrella.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseEnrichmentUmbrella.d.ts","sourceRoot":"","sources":["../../src/enrichments/parseEnrichmentUmbrella.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAG5B,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAErF;;;;GAIG;AACH,KAAK,oBAAoB,GAAG;IAC1B,cAAc,EAAE,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAA;IACxD,uBAAuB,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAA;CAC9D,CAAA;AAED,KAAK,2BAA2B,CAAC,cAAc,IAAI;IACjD,OAAO,EAAE,oBAAoB,CAAA;IAC7B,WAAW,EAAE,MAAM,CAAA;IACnB;;;;;;OAMG;IACH,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;IAClC,wEAAwE;IACxE,MAAM,EAAE,CAAC,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;CACxC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,GAAI,cAAc,EAAE,mDAKrD,2BAA2B,CAAC,cAAc,CAAC,KAAG,cAgChD,CAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview The shared umbrella-parse seam for the projection-base
|
|
3
|
+
* factories.
|
|
4
|
+
*
|
|
5
|
+
* Every `static toEnrichments` — OAS operation, webhook, GQL operation,
|
|
6
|
+
* model — assembles the same `{ subject, generator, stack }` umbrella
|
|
7
|
+
* from three storage spots and parses it through the generator's
|
|
8
|
+
* composite schema. This helper centralizes that assembly so both
|
|
9
|
+
* enrichment-validation mechanisms ride one seam:
|
|
10
|
+
*
|
|
11
|
+
* - the reads go through `context.readEnrichment` — the recording
|
|
12
|
+
* accessor feeding the consumption audit (`EnrichmentAudit`);
|
|
13
|
+
* - the raw values are diffed against the schema (`findUnknownKeys`)
|
|
14
|
+
* and dropped keys surface as `UNKNOWN_ENRICHMENT_KEY` warnings.
|
|
15
|
+
*
|
|
16
|
+
* The `stack` scope is exempt from unknown-key detection: it is a single
|
|
17
|
+
* bag shared by every generator in the composition, and each consumer
|
|
18
|
+
* declares only the fields it reads — keys other generators own are
|
|
19
|
+
* expected, not typos.
|
|
20
|
+
*
|
|
21
|
+
* A wrong-typed value still throws exactly as before — the `v.parse` at
|
|
22
|
+
* the end is unchanged, and unknown-key detection runs first so a
|
|
23
|
+
* throwing leaf doesn't hide a dropped key.
|
|
24
|
+
*
|
|
25
|
+
* @module parseEnrichmentUmbrella
|
|
26
|
+
*/
|
|
27
|
+
import * as v from 'valibot';
|
|
28
|
+
import { GENERATOR_ENRICHMENT_KEY, STACK_ENRICHMENT_KEY } from '../types/Enrichments.js';
|
|
29
|
+
import { findUnknownKeys } from './findUnknownKeys.js';
|
|
30
|
+
import { formatEnrichmentPath } from './EnrichmentWarning.js';
|
|
31
|
+
/**
|
|
32
|
+
* Assemble and parse one `{ subject, generator, stack }` enrichment
|
|
33
|
+
* umbrella, recording the reads for the consumption audit and reporting
|
|
34
|
+
* schema-dropped keys.
|
|
35
|
+
*
|
|
36
|
+
* @throws on a wrong-typed value, exactly like the raw `v.parse` this
|
|
37
|
+
* wraps — the generator's item is then recorded as `error` and the run
|
|
38
|
+
* continues (fail-open).
|
|
39
|
+
*/
|
|
40
|
+
export const parseEnrichmentUmbrella = ({ context, generatorId, subjectSegments, schema }) => {
|
|
41
|
+
const raw = {
|
|
42
|
+
subject: context.readEnrichment([generatorId, ...subjectSegments]),
|
|
43
|
+
generator: context.readEnrichment([generatorId, GENERATOR_ENRICHMENT_KEY]),
|
|
44
|
+
stack: context.readEnrichment([STACK_ENRICHMENT_KEY])
|
|
45
|
+
};
|
|
46
|
+
// Diff the generator-owned scopes against the schema (stack excluded —
|
|
47
|
+
// shared bag). Walking the umbrella keeps the scope schemas attributed
|
|
48
|
+
// without reaching into the composite's entries.
|
|
49
|
+
const unknownKeys = findUnknownKeys(schema, { subject: raw.subject, generator: raw.generator });
|
|
50
|
+
for (const { path, suggestion } of unknownKeys) {
|
|
51
|
+
const [scope, ...leafPath] = path;
|
|
52
|
+
const routingPath = scope === 'subject'
|
|
53
|
+
? [generatorId, ...subjectSegments, ...leafPath]
|
|
54
|
+
: [generatorId, GENERATOR_ENRICHMENT_KEY, ...leafPath];
|
|
55
|
+
context.reportEnrichmentWarning({
|
|
56
|
+
level: 'warning',
|
|
57
|
+
type: 'UNKNOWN_ENRICHMENT_KEY',
|
|
58
|
+
path: routingPath,
|
|
59
|
+
message: `unknown enrichment key '${routingPath[routingPath.length - 1]}' at ` +
|
|
60
|
+
`'${formatEnrichmentPath(routingPath.slice(0, -1))}' — ignored` +
|
|
61
|
+
(suggestion !== undefined ? ` (did you mean '${suggestion}'?)` : ''),
|
|
62
|
+
...(suggestion !== undefined ? { suggestion } : {})
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return v.parse(schema, raw);
|
|
66
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toEnrichmentDescriptor.d.ts","sourceRoot":"","sources":["../../src/enrichments/toEnrichmentDescriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,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;AAUjC;;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;IACE,IAAI,EAAE,QAAQ,CAAA;IACd,8BAA8B;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB,GACD;IACE,IAAI,EAAE,cAAc,CAAA;IACpB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAA;CACnB,GACD;IACE,IAAI,EAAE,OAAO,CAAA;IACb,0BAA0B;IAC1B,IAAI,EAAE,eAAe,CAAA;CACtB,GACD;IACE,IAAI,EAAE,QAAQ,CAAA;IACd,kCAAkC;IAClC,MAAM,EAAE,eAAe,EAAE,CAAA;CAC1B,CAAA;AAEL;;;;;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;AAwGD;;;;;;;;;;;;;;;;;;;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,25 +1,6 @@
|
|
|
1
1
|
import { moduleTypeOf } from '../types/ModuleSelect.js';
|
|
2
|
-
|
|
3
|
-
input !== null &&
|
|
4
|
-
'type' in input &&
|
|
5
|
-
typeof input.type === 'string';
|
|
6
|
-
const isEntriesRecord = (input) => typeof input === 'object' && input !== null;
|
|
2
|
+
import { baseOf, isEntriesRecord, isValibotSchema, unwrap } from './valibotShape.js';
|
|
7
3
|
const isOptionsArray = (input) => Array.isArray(input);
|
|
8
|
-
const WRAPPER_TYPES = new Set(['optional', 'nullable', 'nullish']);
|
|
9
|
-
const unwrap = (schema) => {
|
|
10
|
-
if (WRAPPER_TYPES.has(schema.type) && isValibotSchema(schema.wrapped)) {
|
|
11
|
-
return { inner: schema.wrapped, optional: true };
|
|
12
|
-
}
|
|
13
|
-
return { inner: schema, optional: false };
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* A `v.pipe(base, …actions)` schema spreads `base` and adds a `pipe` array
|
|
17
|
-
* whose first element IS the original base schema. The `moduleSelect`
|
|
18
|
-
* registry lookup must therefore also check the pipe's base, or piping a
|
|
19
|
-
* moduleSelect through metadata (`v.title(…)`) would silently demote it to
|
|
20
|
-
* a generic object widget.
|
|
21
|
-
*/
|
|
22
|
-
const baseOf = (schema) => Array.isArray(schema.pipe) && isValibotSchema(schema.pipe[0]) ? schema.pipe[0] : schema;
|
|
23
4
|
/** The `v.title(…)` metadata riding a piped schema, if any — the field label. */
|
|
24
5
|
const titleOf = (schema) => {
|
|
25
6
|
if (!Array.isArray(schema.pipe))
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Structural view of Valibot schemas as observed at runtime.
|
|
3
|
+
*
|
|
4
|
+
* Valibot's declared `GenericSchema` is opaque (intentionally a black box
|
|
5
|
+
* for parse calls) but the runtime objects expose tagged-union shape via
|
|
6
|
+
* `type` plus the wrapper / container properties below. The walkers that
|
|
7
|
+
* traverse generator enrichment schemas — `toEnrichmentDescriptor` (form
|
|
8
|
+
* projection) and `findUnknownKeys` (dropped-key detection) — narrow into
|
|
9
|
+
* this view once at each entry point and stay inside it.
|
|
10
|
+
*
|
|
11
|
+
* @module valibotShape
|
|
12
|
+
*/
|
|
13
|
+
import type * as v from 'valibot';
|
|
14
|
+
/**
|
|
15
|
+
* The runtime shape of a Valibot schema node. `wrapped` carries the inner
|
|
16
|
+
* schema of `optional` / `nullable` / `nullish` wrappers; `entries` the
|
|
17
|
+
* member schemas of an `object`; `item` an `array`'s element schema;
|
|
18
|
+
* `key` / `value` a `record`'s key and value schemas; `options` a
|
|
19
|
+
* `picklist` / union's choices; `pipe` a `v.pipe(...)`'s action chain
|
|
20
|
+
* (whose first element is the base schema).
|
|
21
|
+
*/
|
|
22
|
+
export type ValibotSchemaShape = {
|
|
23
|
+
readonly type: string;
|
|
24
|
+
readonly wrapped?: unknown;
|
|
25
|
+
readonly entries?: unknown;
|
|
26
|
+
readonly item?: unknown;
|
|
27
|
+
readonly key?: unknown;
|
|
28
|
+
readonly value?: unknown;
|
|
29
|
+
readonly options?: unknown;
|
|
30
|
+
readonly pipe?: unknown;
|
|
31
|
+
};
|
|
32
|
+
export declare const isValibotSchema: (input: unknown) => input is ValibotSchemaShape;
|
|
33
|
+
export declare const isEntriesRecord: (input: unknown) => input is Record<string, v.GenericSchema>;
|
|
34
|
+
/**
|
|
35
|
+
* Strip a single `optional` / `nullable` / `nullish` wrapper, reporting
|
|
36
|
+
* whether one was present. Wrappers don't nest in practice (a schema is
|
|
37
|
+
* declared optional once), so one level suffices.
|
|
38
|
+
*/
|
|
39
|
+
export declare const unwrap: (schema: ValibotSchemaShape) => {
|
|
40
|
+
inner: ValibotSchemaShape;
|
|
41
|
+
optional: boolean;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* A `v.pipe(base, …actions)` schema spreads `base` and adds a `pipe` array
|
|
45
|
+
* whose first element IS the original base schema. Lookups keyed on schema
|
|
46
|
+
* *identity* (e.g. the `moduleSelect` registry) must therefore also check
|
|
47
|
+
* the pipe's base, or piping a schema through metadata (`v.title(…)`)
|
|
48
|
+
* would silently break the lookup.
|
|
49
|
+
*/
|
|
50
|
+
export declare const baseOf: (schema: ValibotSchemaShape) => ValibotSchemaShape;
|
|
51
|
+
//# sourceMappingURL=valibotShape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valibotShape.d.ts","sourceRoot":"","sources":["../../src/enrichments/valibotShape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,KAAK,CAAC,MAAM,SAAS,CAAA;AAEjC;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,kBAIH,CAAA;AAEvD,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,aAAa,CAC3C,CAAA;AAI7C;;;;GAIG;AACH,eAAO,MAAM,MAAM,GACjB,QAAQ,kBAAkB,KACzB;IAAE,KAAK,EAAE,kBAAkB,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAKhD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,GAAI,QAAQ,kBAAkB,KAAG,kBACqC,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Structural view of Valibot schemas as observed at runtime.
|
|
3
|
+
*
|
|
4
|
+
* Valibot's declared `GenericSchema` is opaque (intentionally a black box
|
|
5
|
+
* for parse calls) but the runtime objects expose tagged-union shape via
|
|
6
|
+
* `type` plus the wrapper / container properties below. The walkers that
|
|
7
|
+
* traverse generator enrichment schemas — `toEnrichmentDescriptor` (form
|
|
8
|
+
* projection) and `findUnknownKeys` (dropped-key detection) — narrow into
|
|
9
|
+
* this view once at each entry point and stay inside it.
|
|
10
|
+
*
|
|
11
|
+
* @module valibotShape
|
|
12
|
+
*/
|
|
13
|
+
export const isValibotSchema = (input) => typeof input === 'object' &&
|
|
14
|
+
input !== null &&
|
|
15
|
+
'type' in input &&
|
|
16
|
+
typeof input.type === 'string';
|
|
17
|
+
export const isEntriesRecord = (input) => typeof input === 'object' && input !== null;
|
|
18
|
+
const WRAPPER_TYPES = new Set(['optional', 'nullable', 'nullish']);
|
|
19
|
+
/**
|
|
20
|
+
* Strip a single `optional` / `nullable` / `nullish` wrapper, reporting
|
|
21
|
+
* whether one was present. Wrappers don't nest in practice (a schema is
|
|
22
|
+
* declared optional once), so one level suffices.
|
|
23
|
+
*/
|
|
24
|
+
export const unwrap = (schema) => {
|
|
25
|
+
if (WRAPPER_TYPES.has(schema.type) && isValibotSchema(schema.wrapped)) {
|
|
26
|
+
return { inner: schema.wrapped, optional: true };
|
|
27
|
+
}
|
|
28
|
+
return { inner: schema, optional: false };
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* A `v.pipe(base, …actions)` schema spreads `base` and adds a `pipe` array
|
|
32
|
+
* whose first element IS the original base schema. Lookups keyed on schema
|
|
33
|
+
* *identity* (e.g. the `moduleSelect` registry) must therefore also check
|
|
34
|
+
* the pipe's base, or piping a schema through metadata (`v.title(…)`)
|
|
35
|
+
* would silently break the lookup.
|
|
36
|
+
*/
|
|
37
|
+
export const baseOf = (schema) => Array.isArray(schema.pipe) && isValibotSchema(schema.pipe[0]) ? schema.pipe[0] : schema;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Nearest-key suggestion for "did you mean …?" hints.
|
|
3
|
+
*
|
|
4
|
+
* Used by the enrichment validation surfaces (`EnrichmentAudit`,
|
|
5
|
+
* `findUnknownKeys`) to pair an unrecognized key with its closest known
|
|
6
|
+
* sibling. Pure string utility — no context, no schema awareness.
|
|
7
|
+
*
|
|
8
|
+
* @module nearestKey
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The candidate closest to `target`, or `undefined` when nothing is close
|
|
12
|
+
* enough to be a plausible typo. A case-only mismatch (`POST` for `post`)
|
|
13
|
+
* always wins; otherwise candidates compete within a small edit-distance
|
|
14
|
+
* budget (1 for short keys, 2 otherwise). An exact match returns
|
|
15
|
+
* `undefined` — a key that exists needs no suggestion.
|
|
16
|
+
*/
|
|
17
|
+
export declare const nearestKey: (target: string, candidates: Iterable<string>) => string | undefined;
|
|
18
|
+
//# sourceMappingURL=nearestKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nearestKey.d.ts","sourceRoot":"","sources":["../../src/helpers/nearestKey.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA+BH;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ,MAAM,EAAE,YAAY,QAAQ,CAAC,MAAM,CAAC,KAAG,MAAM,GAAG,SAmBlF,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Nearest-key suggestion for "did you mean …?" hints.
|
|
3
|
+
*
|
|
4
|
+
* Used by the enrichment validation surfaces (`EnrichmentAudit`,
|
|
5
|
+
* `findUnknownKeys`) to pair an unrecognized key with its closest known
|
|
6
|
+
* sibling. Pure string utility — no context, no schema awareness.
|
|
7
|
+
*
|
|
8
|
+
* @module nearestKey
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Levenshtein edit distance with an early-exit bound: returns
|
|
12
|
+
* `bound + 1` as soon as the distance provably exceeds `bound`, so
|
|
13
|
+
* candidate scans stay cheap on long, unrelated keys.
|
|
14
|
+
*/
|
|
15
|
+
const editDistance = (a, b, bound) => {
|
|
16
|
+
if (Math.abs(a.length - b.length) > bound)
|
|
17
|
+
return bound + 1;
|
|
18
|
+
if (a === b)
|
|
19
|
+
return 0;
|
|
20
|
+
let previous = Array.from({ length: b.length + 1 }, (_, index) => index);
|
|
21
|
+
for (let i = 1; i <= a.length; i++) {
|
|
22
|
+
const current = [i];
|
|
23
|
+
let rowMinimum = i;
|
|
24
|
+
for (let j = 1; j <= b.length; j++) {
|
|
25
|
+
const substitution = previous[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1);
|
|
26
|
+
const value = Math.min(previous[j] + 1, current[j - 1] + 1, substitution);
|
|
27
|
+
current.push(value);
|
|
28
|
+
rowMinimum = Math.min(rowMinimum, value);
|
|
29
|
+
}
|
|
30
|
+
if (rowMinimum > bound)
|
|
31
|
+
return bound + 1;
|
|
32
|
+
previous = current;
|
|
33
|
+
}
|
|
34
|
+
return previous[b.length];
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* The candidate closest to `target`, or `undefined` when nothing is close
|
|
38
|
+
* enough to be a plausible typo. A case-only mismatch (`POST` for `post`)
|
|
39
|
+
* always wins; otherwise candidates compete within a small edit-distance
|
|
40
|
+
* budget (1 for short keys, 2 otherwise). An exact match returns
|
|
41
|
+
* `undefined` — a key that exists needs no suggestion.
|
|
42
|
+
*/
|
|
43
|
+
export const nearestKey = (target, candidates) => {
|
|
44
|
+
const bound = target.length <= 4 ? 1 : 2;
|
|
45
|
+
const lowerTarget = target.toLowerCase();
|
|
46
|
+
let best;
|
|
47
|
+
let bestDistance = bound + 1;
|
|
48
|
+
for (const candidate of candidates) {
|
|
49
|
+
if (candidate === target)
|
|
50
|
+
return undefined;
|
|
51
|
+
if (candidate.toLowerCase() === lowerTarget)
|
|
52
|
+
return candidate;
|
|
53
|
+
const distance = editDistance(target, candidate, bound);
|
|
54
|
+
if (distance < bestDistance) {
|
|
55
|
+
best = candidate;
|
|
56
|
+
bestDistance = distance;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return best;
|
|
60
|
+
};
|
package/esm/mod.d.ts
CHANGED
|
@@ -201,6 +201,8 @@ export * from './types/SchemaPath.js';
|
|
|
201
201
|
export * from './enrichments/toEnrichmentDescriptor.js';
|
|
202
202
|
export * from './enrichments/validateConfig.js';
|
|
203
203
|
export * from './enrichments/readEnrichments.js';
|
|
204
|
+
export * from './enrichments/EnrichmentWarning.js';
|
|
205
|
+
export * from './enrichments/findUnknownKeys.js';
|
|
204
206
|
export * from './types/Preview.js';
|
|
205
207
|
export * from './types/RefName.js';
|
|
206
208
|
export * from './types/Results.js';
|
package/esm/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,OAAO,qBAAqB,CAAC;AAG7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,0BAA0B,CAAA;AACxC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA;AACjC,cAAc,4BAA4B,C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,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,yCAAyC,CAAA;AACvD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,yBAAyB,CAAA"}
|
package/esm/mod.js
CHANGED
|
@@ -199,6 +199,8 @@ export * from './types/SchemaPath.js';
|
|
|
199
199
|
export * from './enrichments/toEnrichmentDescriptor.js';
|
|
200
200
|
export * from './enrichments/validateConfig.js';
|
|
201
201
|
export * from './enrichments/readEnrichments.js';
|
|
202
|
+
export * from './enrichments/EnrichmentWarning.js';
|
|
203
|
+
export * from './enrichments/findUnknownKeys.js';
|
|
202
204
|
export * from './types/Preview.js';
|
|
203
205
|
export * from './types/RefName.js';
|
|
204
206
|
export * from './types/Results.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toArtifacts.d.ts","sourceRoot":"","sources":["../../src/run/toArtifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAErE;;;;;;;;;;;;;;;;;;GAkBG;AACH,KAAK,aAAa,GAAG;IACnB,qDAAqD;IACrD,OAAO,EAAE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C,aAAa,CAAC,EAAE,kBAAkB,EAAE,CAAA;IACpC,UAAU,CAAC,EAAE,OAAO,CAAA;CAuCrB,CAAA"}
|
package/esm/run/toArtifacts.js
CHANGED
|
@@ -69,7 +69,7 @@ import { CoreContext } from '../context/CoreContext.js';
|
|
|
69
69
|
*/
|
|
70
70
|
export const toArtifacts = ({ traceId, spanId, document, settings, toGeneratorConfigMap, logsPath, startAt, silent, stackTrail, attribution, inspect }) => {
|
|
71
71
|
const context = new CoreContext({ spanId, logsPath, silent });
|
|
72
|
-
const { artifacts, files, previews, results, parseIssues, sidecars, generationMap, inspection } = context.toArtifacts({
|
|
72
|
+
const { artifacts, files, previews, results, parseIssues, enrichmentWarnings, sidecars, generationMap, inspection } = context.toArtifacts({
|
|
73
73
|
settings,
|
|
74
74
|
toGeneratorConfigMap,
|
|
75
75
|
document,
|
|
@@ -85,6 +85,7 @@ export const toArtifacts = ({ traceId, spanId, document, settings, toGeneratorCo
|
|
|
85
85
|
spanId,
|
|
86
86
|
results,
|
|
87
87
|
parseIssues,
|
|
88
|
+
enrichmentWarnings,
|
|
88
89
|
deploymentId: Date.now().toString(),
|
|
89
90
|
region: undefined,
|
|
90
91
|
startAt,
|
package/esm/types/Manifest.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ import "../_dnt.polyfills.js";
|
|
|
74
74
|
import { type ResultsItem } from './Results.js';
|
|
75
75
|
import { type Preview } from './Preview.js';
|
|
76
76
|
import type { ParseIssue } from '../context/ParseIssue.js';
|
|
77
|
+
import { type EnrichmentWarning } from '../enrichments/EnrichmentWarning.js';
|
|
77
78
|
import * as v from 'valibot';
|
|
78
79
|
export type ManifestEntry = {
|
|
79
80
|
lines: number;
|
|
@@ -109,6 +110,14 @@ export type ManifestContent = {
|
|
|
109
110
|
* it from `.settings/manifest.json` without re-running.
|
|
110
111
|
*/
|
|
111
112
|
parseIssues: ParseIssue[];
|
|
113
|
+
/**
|
|
114
|
+
* Enrichment addressing / unknown-key warnings recorded during the
|
|
115
|
+
* generate phase — dead config the engine never consumed, keys the
|
|
116
|
+
* generator's schema dropped, and info lines for enrichments on
|
|
117
|
+
* skipped items. Empty for a clean run; optional so manifests written
|
|
118
|
+
* by older cores still parse.
|
|
119
|
+
*/
|
|
120
|
+
enrichmentWarnings?: EnrichmentWarning[];
|
|
112
121
|
startAt: number;
|
|
113
122
|
endAt: number;
|
|
114
123
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manifest.d.ts","sourceRoot":"","sources":["../../src/types/Manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"Manifest.d.ts","sourceRoot":"","sources":["../../src/types/Manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AAG/F,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AA4D5B,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,MAAM,CAAA;IACvB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,aAAa,CAAC,aAAa,CAKvD,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,CAAC,CAAC,aAAa,CAAC,WAAW,CAGnD,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IACpC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,OAAO,EAAE,WAAW,CAAA;IACpB;;;;;OAKG;IACH,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAA;IACxC,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,aAAa,CAAC,eAAe,CAY3D,CAAA"}
|
package/esm/types/Manifest.js
CHANGED
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
import "../_dnt.polyfills.js";
|
|
74
74
|
import { resultsItem } from './Results.js';
|
|
75
75
|
import { preview } from './Preview.js';
|
|
76
|
+
import { enrichmentWarning } from '../enrichments/EnrichmentWarning.js';
|
|
76
77
|
import { oasIssueType } from '../context/generateTypes.js';
|
|
77
78
|
import { gqlIssueType } from '../context/ParseIssue.js';
|
|
78
79
|
import * as v from 'valibot';
|
|
@@ -152,6 +153,7 @@ export const manifestContent = v.object({
|
|
|
152
153
|
previews: v.record(v.string(), preview),
|
|
153
154
|
results: resultsItem,
|
|
154
155
|
parseIssues: v.array(parseIssue),
|
|
156
|
+
enrichmentWarnings: v.optional(v.array(enrichmentWarning)),
|
|
155
157
|
startAt: v.number(),
|
|
156
158
|
endAt: v.number()
|
|
157
159
|
});
|