feat(gate): buildSchemaLinkingRequest descriptor builder
This commit is contained in:
@@ -156,6 +156,24 @@ function buildFreetextRequest({ id, phase, title }) {
|
||||
};
|
||||
}
|
||||
|
||||
// Build a `schema-linking` ui_request: table rows (promote/exclude) each carrying
|
||||
// their full catalog columns; the frontend renders rows + a per-table columns
|
||||
// modal (suggested pre-selected). `tables` is validated shallowly here.
|
||||
function buildSchemaLinkingRequest({ id, phase, title, tables }) {
|
||||
requireString(title, "title", "schema-linking");
|
||||
const tabs = requireArray(tables, "tables", "schema-linking");
|
||||
return {
|
||||
type: "ui_request",
|
||||
id,
|
||||
phase,
|
||||
schema_version: SCHEMA_VERSION,
|
||||
widget: "schema-linking",
|
||||
title,
|
||||
tables: [...tabs],
|
||||
reserved: RESERVED,
|
||||
};
|
||||
}
|
||||
|
||||
// Attach a child-widget spec to an option (linkage, §4.2). Returns the option.
|
||||
function withChildLinkage(option, widgetSpec) {
|
||||
option.opens = widgetSpec;
|
||||
@@ -168,6 +186,7 @@ module.exports = {
|
||||
buildArtifactGate,
|
||||
buildInfoRequest,
|
||||
buildFreetextRequest,
|
||||
buildSchemaLinkingRequest,
|
||||
withChildLinkage,
|
||||
SCHEMA_VERSION,
|
||||
RESERVED,
|
||||
|
||||
Reference in New Issue
Block a user