@aestheticfunction/dspack-emit 0.3.2 → 0.4.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/README.md +29 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +34 -8
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/targets/a2ui/surface.js +7 -0
- package/dist/transform/profile-load.d.ts +19 -0
- package/dist/transform/profile-load.js +56 -0
- package/dist/transform/profile-schema.d.ts +8 -0
- package/dist/transform/profile-schema.js +382 -0
- package/dist/transform/scaffold.d.ts +40 -0
- package/dist/transform/scaffold.js +171 -0
- package/dist/validate/ajv.js +2 -4
- package/dist/validate/meta/catalog-meta.d.ts +10 -0
- package/dist/validate/meta/catalog-meta.js +157 -0
- package/package.json +5 -2
- package/src/browser-boundary.test.ts +47 -0
- package/src/cli.ts +35 -9
- package/src/index.ts +2 -0
- package/src/profile-load.test.ts +144 -0
- package/src/schema-mirrors.test.ts +30 -0
- package/src/targets/a2ui/surface.ts +10 -0
- package/src/transform/profile-load.ts +70 -0
- package/src/transform/profile-schema.ts +382 -0
- package/src/transform/profile.v1.schema.json +153 -0
- package/src/transform/scaffold.ts +229 -0
- package/src/validate/ajv.ts +2 -6
- package/src/validate/meta/catalog-meta.ts +167 -0
- package/dist/validate/meta/a2ui-catalog.meta.0_9_1.json +0 -39
- package/dist/validate/meta/a2ui-catalog.meta.1_0.json +0 -34
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Profile-as-data (PR: profile JSON schema + loadProfile + scaffoldProfile).
|
|
3
|
+
*
|
|
4
|
+
* The center-of-gravity contract for the catalog composer: a Profile expressed
|
|
5
|
+
* as JSON, validated at runtime against schema/profile.v1.schema.json, must
|
|
6
|
+
* drive the engine byte-identically to the same Profile expressed as the
|
|
7
|
+
* in-repo TypeScript object. Judgment stays with the author; the loader only
|
|
8
|
+
* gates shape.
|
|
9
|
+
*/
|
|
10
|
+
import { describe, expect, it } from "vitest";
|
|
11
|
+
import { readFileSync } from "node:fs";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
import { loadProfile, ProfileLoadError } from "./transform/profile-load.js";
|
|
14
|
+
import { scaffoldProfile } from "./transform/scaffold.js";
|
|
15
|
+
import { shadcnProfile } from "./transform/profiles.js";
|
|
16
|
+
import { transformFromJson } from "./transform/index.js";
|
|
17
|
+
import { emitSurface, EmitSurfaceError } from "./targets/a2ui/surface.js";
|
|
18
|
+
import type { DspackDoc, DspackSurface } from "./types.js";
|
|
19
|
+
|
|
20
|
+
const repo = (p: string) => fileURLToPath(new URL(`../${p}`, import.meta.url));
|
|
21
|
+
const load = (p: string) => JSON.parse(readFileSync(repo(p), "utf8"));
|
|
22
|
+
|
|
23
|
+
const shadcnDoc = load("input/shadcn-ui.dspack.json") as DspackDoc;
|
|
24
|
+
const astryxDoc = load("input/astryx.dspack.json") as DspackDoc;
|
|
25
|
+
|
|
26
|
+
/** The TS profile, round-tripped through JSON exactly as a user file would be. */
|
|
27
|
+
const shadcnProfileJson = () => ({ profileVersion: "1", ...structuredClone(shadcnProfile) });
|
|
28
|
+
|
|
29
|
+
describe("loadProfile", () => {
|
|
30
|
+
it("accepts the canonical shadcn profile expressed as JSON", () => {
|
|
31
|
+
const profile = loadProfile(shadcnProfileJson());
|
|
32
|
+
expect(profile.catalogTitle).toBe(shadcnProfile.catalogTitle);
|
|
33
|
+
// profileVersion is loader envelope, not engine input.
|
|
34
|
+
expect((profile as Record<string, unknown>).profileVersion).toBeUndefined();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("drives the engine byte-identically to the TypeScript profile", () => {
|
|
38
|
+
const fromTs = transformFromJson(shadcnDoc, { profile: shadcnProfile });
|
|
39
|
+
const fromJson = transformFromJson(shadcnDoc, { profile: loadProfile(shadcnProfileJson()) });
|
|
40
|
+
expect(JSON.stringify(fromJson.catalog)).toBe(JSON.stringify(fromTs.catalog));
|
|
41
|
+
expect(fromJson.validation.pass).toBe(true);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("rejects a malformed profile with typed, pathed findings", () => {
|
|
45
|
+
const bad = shadcnProfileJson() as any;
|
|
46
|
+
bad.components[0].propMap.variant.kind = "vibes";
|
|
47
|
+
expect(() => loadProfile(bad)).toThrowError(ProfileLoadError);
|
|
48
|
+
try {
|
|
49
|
+
loadProfile(bad);
|
|
50
|
+
} catch (e) {
|
|
51
|
+
const issues = (e as ProfileLoadError).issues;
|
|
52
|
+
expect(issues.length).toBeGreaterThan(0);
|
|
53
|
+
expect(issues.some((i) => i.path.includes("propMap"))).toBe(true);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("rejects a non-https catalogIdBase", () => {
|
|
58
|
+
const bad = shadcnProfileJson() as any;
|
|
59
|
+
bad.catalogIdBase = "http://insecure.example/catalog";
|
|
60
|
+
expect(() => loadProfile(bad)).toThrowError(ProfileLoadError);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("rejects a missing profileVersion", () => {
|
|
64
|
+
const { profileVersion: _dropped, ...bare } = shadcnProfileJson();
|
|
65
|
+
expect(() => loadProfile(bare)).toThrowError(ProfileLoadError);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("fails closed on unknown keys — x-* is the only extension surface (dspack convention)", () => {
|
|
69
|
+
const topLevel = shadcnProfileJson() as Record<string, unknown>;
|
|
70
|
+
topLevel.customBehavior = true;
|
|
71
|
+
expect(() => loadProfile(topLevel)).toThrowError(ProfileLoadError);
|
|
72
|
+
|
|
73
|
+
const inPlan = shadcnProfileJson() as any;
|
|
74
|
+
inPlan.components[0].renderHint = "fancy";
|
|
75
|
+
expect(() => loadProfile(inPlan)).toThrowError(ProfileLoadError);
|
|
76
|
+
|
|
77
|
+
// The sanctioned extension slot passes and is preserved for tools.
|
|
78
|
+
const extended = shadcnProfileJson() as Record<string, unknown>;
|
|
79
|
+
extended["x-composer"] = { note: "authored in the studio composer" };
|
|
80
|
+
const profile = loadProfile(extended) as unknown as Record<string, unknown>;
|
|
81
|
+
expect(profile["x-composer"]).toEqual({ note: "authored in the studio composer" });
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
describe("casualty refusal cites the authored reason", () => {
|
|
86
|
+
it("names the declared casualty and its reason when a surface uses it", () => {
|
|
87
|
+
const surface: DspackSurface = {
|
|
88
|
+
dspackSurface: "0.1",
|
|
89
|
+
system: shadcnDoc.name as string,
|
|
90
|
+
intent: "destructive-action",
|
|
91
|
+
root: { component: "dropdown-menu", props: {} },
|
|
92
|
+
} as DspackSurface;
|
|
93
|
+
try {
|
|
94
|
+
emitSurface(surface, shadcnDoc, { profile: shadcnProfile });
|
|
95
|
+
expect.unreachable("surface using a casualty component must refuse");
|
|
96
|
+
} catch (e) {
|
|
97
|
+
expect(e).toBeInstanceOf(EmitSurfaceError);
|
|
98
|
+
const msg = (e as EmitSurfaceError).message;
|
|
99
|
+
// The profile's authored reason, not just "unknown component".
|
|
100
|
+
expect(msg).toContain("declared casualty");
|
|
101
|
+
expect(msg).toContain("dropdown menu");
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
describe("scaffoldProfile", () => {
|
|
107
|
+
it("produces a loadProfile-valid profile from a bare contract", () => {
|
|
108
|
+
const { profile } = scaffoldProfile(astryxDoc, {
|
|
109
|
+
catalogIdBase: "https://example.test/catalogs/astryx-scaffold",
|
|
110
|
+
});
|
|
111
|
+
// The scaffold is itself a valid v1 profile document.
|
|
112
|
+
const loaded = loadProfile(profile);
|
|
113
|
+
expect(loaded.catalogIdBase).toBe("https://example.test/catalogs/astryx-scaffold");
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it("maps every contract component (full coverage, no judgment invented)", () => {
|
|
117
|
+
const { profile, notes } = scaffoldProfile(astryxDoc, {
|
|
118
|
+
catalogIdBase: "https://example.test/catalogs/astryx-scaffold",
|
|
119
|
+
});
|
|
120
|
+
const loaded = loadProfile(profile);
|
|
121
|
+
const out = transformFromJson(astryxDoc, { profile: loaded });
|
|
122
|
+
expect(out.validation.gates.find((g) => g.name === "schema-compile + no-external-ref")?.pass).toBe(true);
|
|
123
|
+
expect(out.validation.gates.find((g) => g.name === "catalog-shape")?.pass).toBe(true);
|
|
124
|
+
const unclassified = out.mapping.coverage.filter((c) => c.disposition === "unclassified");
|
|
125
|
+
expect(unclassified).toEqual([]);
|
|
126
|
+
// Mechanical means mechanical: no casualties invented, judgment flagged in notes.
|
|
127
|
+
expect(loaded.casualtyComponents).toEqual([]);
|
|
128
|
+
expect(notes.length).toBeGreaterThan(0);
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
it("seeds enum props verbatim (identity projection, no valueMap)", () => {
|
|
132
|
+
const { profile } = scaffoldProfile(shadcnDoc, {
|
|
133
|
+
catalogIdBase: "https://example.test/catalogs/shadcn-scaffold",
|
|
134
|
+
});
|
|
135
|
+
const loaded = loadProfile(profile);
|
|
136
|
+
const button = loaded.components.find((c) => c.dspackId === "button");
|
|
137
|
+
expect(button).toBeDefined();
|
|
138
|
+
const variant = button?.propMap?.variant;
|
|
139
|
+
expect(variant?.kind).toBe("enum");
|
|
140
|
+
// Verbatim contract vocabulary, not the hand-tuned lossy projection.
|
|
141
|
+
expect(variant?.targetEnum).toEqual(["default", "destructive", "outline", "secondary", "ghost", "link"]);
|
|
142
|
+
expect(variant?.valueMap).toBeUndefined();
|
|
143
|
+
});
|
|
144
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drift gate for the schema mirrors. The .json files are the reviewable
|
|
3
|
+
* schema documents (docs/PROFILES.md and the README link them); the TS
|
|
4
|
+
* mirror modules are what the runtime imports, because the library surface
|
|
5
|
+
* must bundle for the browser without filesystem access. Both are committed,
|
|
6
|
+
* so this test is what keeps them the same document: a failure here means
|
|
7
|
+
* one side was edited without the other.
|
|
8
|
+
*/
|
|
9
|
+
import { readFileSync } from "node:fs";
|
|
10
|
+
import { fileURLToPath } from "node:url";
|
|
11
|
+
import { describe, expect, it } from "vitest";
|
|
12
|
+
import { catalogMetaSchemas } from "./validate/meta/catalog-meta.js";
|
|
13
|
+
import { profileSchema } from "./transform/profile-schema.js";
|
|
14
|
+
|
|
15
|
+
const doc = (rel: string): unknown =>
|
|
16
|
+
JSON.parse(readFileSync(fileURLToPath(new URL(rel, import.meta.url)), "utf8"));
|
|
17
|
+
|
|
18
|
+
describe("schema mirrors", () => {
|
|
19
|
+
it("catalog-meta mirror (0.9.1) equals a2ui-catalog.meta.0_9_1.json", () => {
|
|
20
|
+
expect(catalogMetaSchemas["0.9.1"]).toStrictEqual(doc("./validate/meta/a2ui-catalog.meta.0_9_1.json"));
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("catalog-meta mirror (1.0) equals a2ui-catalog.meta.1_0.json", () => {
|
|
24
|
+
expect(catalogMetaSchemas["1.0"]).toStrictEqual(doc("./validate/meta/a2ui-catalog.meta.1_0.json"));
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("profile-schema mirror equals profile.v1.schema.json", () => {
|
|
28
|
+
expect(profileSchema).toStrictEqual(doc("./transform/profile.v1.schema.json"));
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -131,6 +131,16 @@ class SurfaceEmitter {
|
|
|
131
131
|
emitNode(node: SurfaceNode, path: string): string {
|
|
132
132
|
const plan = this.byDspackId.get(node.component);
|
|
133
133
|
if (!plan) {
|
|
134
|
+
// A declared casualty refuses with its authored reason — the refusal is
|
|
135
|
+
// the profile author's decision, and the message should say so.
|
|
136
|
+
const casualty = this.profile.casualtyComponents.find((c) => c.dspackId === node.component);
|
|
137
|
+
if (casualty) {
|
|
138
|
+
throw new EmitSurfaceError(
|
|
139
|
+
`component '${node.component}' is a declared casualty (${casualty.class}) of the ` +
|
|
140
|
+
`'${this.profile.catalogTitle}' profile: ${casualty.reason}`,
|
|
141
|
+
path,
|
|
142
|
+
);
|
|
143
|
+
}
|
|
134
144
|
throw new EmitSurfaceError(
|
|
135
145
|
`unknown component '${node.component}': not a mapped component of the '${this.profile.catalogTitle}' profile ` +
|
|
136
146
|
`(sub-components are consumed by their compound parent and cannot be emitted standalone)`,
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Profile-as-data: load a mapping Profile from JSON.
|
|
3
|
+
*
|
|
4
|
+
* The Profile has always been pure data (profiles.ts); this module makes it
|
|
5
|
+
* *reachable* as data. `loadProfile` validates an untrusted JSON value against
|
|
6
|
+
* schema `profile.v1.schema.json` (a one-to-one mirror of the TypeScript
|
|
7
|
+
* `Profile` interface plus a `profileVersion` envelope const) and returns the
|
|
8
|
+
* engine-ready `Profile`. Validation gates shape only — every judgment call
|
|
9
|
+
* (valueMaps, casualties, surface plans) stays with the profile's author.
|
|
10
|
+
*
|
|
11
|
+
* Toolchain: ajv draft 2020-12, `strict: false`, ajv-formats — the same
|
|
12
|
+
* convention as the catalog gates (src/validate/ajv.ts) and the dspack
|
|
13
|
+
* harness.
|
|
14
|
+
*/
|
|
15
|
+
import Ajv2020, { type ValidateFunction } from "ajv/dist/2020.js";
|
|
16
|
+
import addFormats from "ajv-formats";
|
|
17
|
+
import { profileSchema } from "./profile-schema.js";
|
|
18
|
+
import type { Profile } from "./profiles.js";
|
|
19
|
+
|
|
20
|
+
/** The profile schema, as shipped (also exported for hosts that surface it in UI). */
|
|
21
|
+
export { profileSchema } from "./profile-schema.js";
|
|
22
|
+
|
|
23
|
+
export interface ProfileLoadIssue {
|
|
24
|
+
/** JSON path into the offending document (ajv instancePath). */
|
|
25
|
+
path: string;
|
|
26
|
+
message: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export class ProfileLoadError extends Error {
|
|
30
|
+
constructor(readonly issues: ProfileLoadIssue[]) {
|
|
31
|
+
super(
|
|
32
|
+
`profile does not conform to profile.v1.schema.json (${issues.length} issue${issues.length === 1 ? "" : "s"}): ` +
|
|
33
|
+
issues
|
|
34
|
+
.slice(0, 3)
|
|
35
|
+
.map((i) => `${i.path || "$"}: ${i.message}`)
|
|
36
|
+
.join("; ") +
|
|
37
|
+
(issues.length > 3 ? "; …" : ""),
|
|
38
|
+
);
|
|
39
|
+
this.name = "ProfileLoadError";
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
let compiled: ValidateFunction | undefined;
|
|
44
|
+
|
|
45
|
+
function validator(): ValidateFunction {
|
|
46
|
+
if (!compiled) {
|
|
47
|
+
const ajv = new Ajv2020({ strict: false, allErrors: true, validateFormats: true });
|
|
48
|
+
addFormats(ajv);
|
|
49
|
+
compiled = ajv.compile(profileSchema);
|
|
50
|
+
}
|
|
51
|
+
return compiled;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Validate `json` as a v1 profile document and return the engine-ready
|
|
56
|
+
* `Profile`. The `profileVersion` envelope field is stripped — it belongs to
|
|
57
|
+
* the document format, not the engine. Top-level `x-` extension keys are
|
|
58
|
+
* preserved (the engine ignores them; provenance tools may not).
|
|
59
|
+
*/
|
|
60
|
+
export function loadProfile(json: unknown): Profile {
|
|
61
|
+
const validate = validator();
|
|
62
|
+
if (!validate(json)) {
|
|
63
|
+
const errors = (validate.errors ?? []) as Array<{ instancePath?: string; message?: string }>;
|
|
64
|
+
throw new ProfileLoadError(
|
|
65
|
+
errors.map((e) => ({ path: e.instancePath ?? "", message: e.message ?? "invalid" })),
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
const { profileVersion: _envelope, ...profile } = json as Record<string, unknown> & { profileVersion: string };
|
|
69
|
+
return profile as unknown as Profile;
|
|
70
|
+
}
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime mirror of profile.v1.schema.json. The .json file stays the
|
|
3
|
+
* reviewable schema document (docs/PROFILES.md links it); this constant
|
|
4
|
+
* exists because loadProfile must run in a browser bundle (dspack-studio
|
|
5
|
+
* composer), where readFileSync is not available. src/schema-mirrors.test.ts
|
|
6
|
+
* asserts mirror and JSON stay identical — edit both together.
|
|
7
|
+
*/
|
|
8
|
+
export const profileSchema: Record<string, unknown> = {
|
|
9
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
10
|
+
"$id": "https://aestheticfunction.github.io/dspack-emit/schema/profile.v1.schema.json",
|
|
11
|
+
"title": "dspack-emit a2ui Profile v1",
|
|
12
|
+
"description": "JSON form of the a2ui target's mapping Profile. Mirrors the TypeScript Profile interface in src/transform/profiles.ts one to one; loadProfile() validates against this schema before the engine runs.",
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"patternProperties": {
|
|
16
|
+
"^x-": {}
|
|
17
|
+
},
|
|
18
|
+
"required": [
|
|
19
|
+
"profileVersion",
|
|
20
|
+
"catalogTitle",
|
|
21
|
+
"catalogDescription",
|
|
22
|
+
"catalogIdBase",
|
|
23
|
+
"instructions",
|
|
24
|
+
"primaryColorToken",
|
|
25
|
+
"components",
|
|
26
|
+
"synthesized",
|
|
27
|
+
"casualtyComponents",
|
|
28
|
+
"surfaceSynthesis"
|
|
29
|
+
],
|
|
30
|
+
"properties": {
|
|
31
|
+
"profileVersion": {
|
|
32
|
+
"const": "1"
|
|
33
|
+
},
|
|
34
|
+
"catalogTitle": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"minLength": 1
|
|
37
|
+
},
|
|
38
|
+
"catalogDescription": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"minLength": 1
|
|
41
|
+
},
|
|
42
|
+
"catalogIdBase": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"format": "uri",
|
|
45
|
+
"pattern": "^https://"
|
|
46
|
+
},
|
|
47
|
+
"instructions": {
|
|
48
|
+
"type": "string"
|
|
49
|
+
},
|
|
50
|
+
"primaryColorToken": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"additionalProperties": false,
|
|
53
|
+
"required": [
|
|
54
|
+
"category",
|
|
55
|
+
"name"
|
|
56
|
+
],
|
|
57
|
+
"properties": {
|
|
58
|
+
"category": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"minLength": 1
|
|
61
|
+
},
|
|
62
|
+
"name": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"minLength": 1
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"components": {
|
|
69
|
+
"type": "array",
|
|
70
|
+
"items": {
|
|
71
|
+
"$ref": "#/$defs/componentPlan"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"synthesized": {
|
|
75
|
+
"type": "array",
|
|
76
|
+
"items": {
|
|
77
|
+
"$ref": "#/$defs/componentPlan"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"casualtyComponents": {
|
|
81
|
+
"type": "array",
|
|
82
|
+
"items": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"additionalProperties": false,
|
|
85
|
+
"patternProperties": {
|
|
86
|
+
"^x-": {}
|
|
87
|
+
},
|
|
88
|
+
"required": [
|
|
89
|
+
"dspackId",
|
|
90
|
+
"attempted",
|
|
91
|
+
"class",
|
|
92
|
+
"reason"
|
|
93
|
+
],
|
|
94
|
+
"properties": {
|
|
95
|
+
"dspackId": {
|
|
96
|
+
"$ref": "#/$defs/dspackId"
|
|
97
|
+
},
|
|
98
|
+
"attempted": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"minLength": 1
|
|
101
|
+
},
|
|
102
|
+
"class": {
|
|
103
|
+
"enum": [
|
|
104
|
+
"maps-cleanly",
|
|
105
|
+
"synthesis-defaults",
|
|
106
|
+
"lossy",
|
|
107
|
+
"cannot-represent"
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
"reason": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"minLength": 1
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"intentionallyOmitted": {
|
|
118
|
+
"type": "array",
|
|
119
|
+
"items": {
|
|
120
|
+
"$ref": "#/$defs/dspackId"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"surfaceSynthesis": {
|
|
124
|
+
"type": "object",
|
|
125
|
+
"additionalProperties": false,
|
|
126
|
+
"required": [
|
|
127
|
+
"textComponent",
|
|
128
|
+
"textProp",
|
|
129
|
+
"wrapComponent",
|
|
130
|
+
"wrapChildrenProp"
|
|
131
|
+
],
|
|
132
|
+
"properties": {
|
|
133
|
+
"textComponent": {
|
|
134
|
+
"$ref": "#/$defs/a2uiName"
|
|
135
|
+
},
|
|
136
|
+
"textProp": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"minLength": 1
|
|
139
|
+
},
|
|
140
|
+
"wrapComponent": {
|
|
141
|
+
"$ref": "#/$defs/a2uiName"
|
|
142
|
+
},
|
|
143
|
+
"wrapChildrenProp": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"minLength": 1
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"$defs": {
|
|
151
|
+
"dspackId": {
|
|
152
|
+
"type": "string",
|
|
153
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
154
|
+
},
|
|
155
|
+
"a2uiName": {
|
|
156
|
+
"type": "string",
|
|
157
|
+
"pattern": "^[A-Z][A-Za-z0-9]*$"
|
|
158
|
+
},
|
|
159
|
+
"componentPlan": {
|
|
160
|
+
"type": "object",
|
|
161
|
+
"additionalProperties": false,
|
|
162
|
+
"patternProperties": {
|
|
163
|
+
"^x-": {}
|
|
164
|
+
},
|
|
165
|
+
"required": [
|
|
166
|
+
"a2ui",
|
|
167
|
+
"commons",
|
|
168
|
+
"structural",
|
|
169
|
+
"required"
|
|
170
|
+
],
|
|
171
|
+
"properties": {
|
|
172
|
+
"a2ui": {
|
|
173
|
+
"$ref": "#/$defs/a2uiName"
|
|
174
|
+
},
|
|
175
|
+
"dspackId": {
|
|
176
|
+
"$ref": "#/$defs/dspackId"
|
|
177
|
+
},
|
|
178
|
+
"description": {
|
|
179
|
+
"type": "string"
|
|
180
|
+
},
|
|
181
|
+
"commons": {
|
|
182
|
+
"type": "array",
|
|
183
|
+
"items": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"minLength": 1
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"structural": {
|
|
189
|
+
"type": "object",
|
|
190
|
+
"additionalProperties": {
|
|
191
|
+
"type": "object",
|
|
192
|
+
"additionalProperties": false,
|
|
193
|
+
"required": [
|
|
194
|
+
"schema",
|
|
195
|
+
"description",
|
|
196
|
+
"synthNote"
|
|
197
|
+
],
|
|
198
|
+
"properties": {
|
|
199
|
+
"schema": {},
|
|
200
|
+
"description": {
|
|
201
|
+
"type": "string",
|
|
202
|
+
"minLength": 1
|
|
203
|
+
},
|
|
204
|
+
"synthNote": {
|
|
205
|
+
"type": "string",
|
|
206
|
+
"minLength": 1
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"propMap": {
|
|
212
|
+
"type": "object",
|
|
213
|
+
"additionalProperties": {
|
|
214
|
+
"type": "object",
|
|
215
|
+
"additionalProperties": false,
|
|
216
|
+
"required": [
|
|
217
|
+
"a2ui",
|
|
218
|
+
"kind"
|
|
219
|
+
],
|
|
220
|
+
"properties": {
|
|
221
|
+
"a2ui": {
|
|
222
|
+
"type": "string",
|
|
223
|
+
"minLength": 1
|
|
224
|
+
},
|
|
225
|
+
"kind": {
|
|
226
|
+
"enum": [
|
|
227
|
+
"enum",
|
|
228
|
+
"string",
|
|
229
|
+
"boolean",
|
|
230
|
+
"number"
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
"targetEnum": {
|
|
234
|
+
"type": "array",
|
|
235
|
+
"items": {
|
|
236
|
+
"type": "string"
|
|
237
|
+
},
|
|
238
|
+
"minItems": 1
|
|
239
|
+
},
|
|
240
|
+
"valueMap": {
|
|
241
|
+
"type": "object",
|
|
242
|
+
"additionalProperties": {
|
|
243
|
+
"type": "string"
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"default": {
|
|
247
|
+
"type": "string"
|
|
248
|
+
},
|
|
249
|
+
"description": {
|
|
250
|
+
"type": "string"
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"required": {
|
|
256
|
+
"type": "array",
|
|
257
|
+
"items": {
|
|
258
|
+
"type": "string"
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"surfacePlan": {
|
|
262
|
+
"type": "object",
|
|
263
|
+
"additionalProperties": false,
|
|
264
|
+
"properties": {
|
|
265
|
+
"subText": {
|
|
266
|
+
"type": "object",
|
|
267
|
+
"additionalProperties": {
|
|
268
|
+
"type": "string"
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"subButtonText": {
|
|
272
|
+
"type": "object",
|
|
273
|
+
"additionalProperties": {
|
|
274
|
+
"type": "string"
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
"actionProp": {
|
|
278
|
+
"type": "string"
|
|
279
|
+
},
|
|
280
|
+
"textChildProp": {
|
|
281
|
+
"type": "string"
|
|
282
|
+
},
|
|
283
|
+
"textProp": {
|
|
284
|
+
"type": "string"
|
|
285
|
+
},
|
|
286
|
+
"childProp": {
|
|
287
|
+
"type": "string"
|
|
288
|
+
},
|
|
289
|
+
"childrenProp": {
|
|
290
|
+
"type": "string"
|
|
291
|
+
},
|
|
292
|
+
"structuralPassthrough": {
|
|
293
|
+
"type": "array",
|
|
294
|
+
"items": {
|
|
295
|
+
"type": "string"
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
"subTable": {
|
|
299
|
+
"type": "object",
|
|
300
|
+
"additionalProperties": false,
|
|
301
|
+
"required": [
|
|
302
|
+
"caption",
|
|
303
|
+
"header",
|
|
304
|
+
"headerCell",
|
|
305
|
+
"body",
|
|
306
|
+
"row",
|
|
307
|
+
"cell",
|
|
308
|
+
"targetCaption",
|
|
309
|
+
"targetColumns",
|
|
310
|
+
"targetRows",
|
|
311
|
+
"drops"
|
|
312
|
+
],
|
|
313
|
+
"properties": {
|
|
314
|
+
"caption": {
|
|
315
|
+
"type": "string"
|
|
316
|
+
},
|
|
317
|
+
"header": {
|
|
318
|
+
"type": "string"
|
|
319
|
+
},
|
|
320
|
+
"headerCell": {
|
|
321
|
+
"type": "string"
|
|
322
|
+
},
|
|
323
|
+
"body": {
|
|
324
|
+
"type": "string"
|
|
325
|
+
},
|
|
326
|
+
"row": {
|
|
327
|
+
"type": "string"
|
|
328
|
+
},
|
|
329
|
+
"cell": {
|
|
330
|
+
"type": "string"
|
|
331
|
+
},
|
|
332
|
+
"targetCaption": {
|
|
333
|
+
"type": "string"
|
|
334
|
+
},
|
|
335
|
+
"targetColumns": {
|
|
336
|
+
"type": "string"
|
|
337
|
+
},
|
|
338
|
+
"targetRows": {
|
|
339
|
+
"type": "string"
|
|
340
|
+
},
|
|
341
|
+
"drops": {
|
|
342
|
+
"type": "object",
|
|
343
|
+
"additionalProperties": {
|
|
344
|
+
"type": "string"
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
"subFlatten": {
|
|
350
|
+
"type": "object",
|
|
351
|
+
"additionalProperties": false,
|
|
352
|
+
"required": [
|
|
353
|
+
"transparent",
|
|
354
|
+
"asText"
|
|
355
|
+
],
|
|
356
|
+
"properties": {
|
|
357
|
+
"transparent": {
|
|
358
|
+
"type": "array",
|
|
359
|
+
"items": {
|
|
360
|
+
"$ref": "#/$defs/dspackId"
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
"asText": {
|
|
364
|
+
"type": "object",
|
|
365
|
+
"additionalProperties": {
|
|
366
|
+
"type": "string"
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
"subCoverage": {
|
|
374
|
+
"type": "object",
|
|
375
|
+
"additionalProperties": {
|
|
376
|
+
"type": "string"
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
};
|