@elementumai/edk 0.9.20 → 0.10.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 +19 -7
- package/dist-sdk/src/catalog/factories.d.ts +10 -2
- package/dist-sdk/src/catalog/factories.js +10 -1
- package/dist-sdk/src/catalog/index.d.ts +2 -2
- package/dist-sdk/src/catalog/index.js +1 -1
- package/dist-sdk/src/catalog/token.js +4 -0
- package/dist-sdk/src/catalog/types.d.ts +7 -1
- package/dist-sdk/src/catalog/types.js +1 -0
- package/dist-sdk/src/core/triggers/on-demand.d.ts +2 -2
- package/dist-sdk/src/core/triggers/on-demand.js +7 -0
- package/dist-sdk/src/core/types/app.d.ts +2 -2
- package/dist-sdk/src/engine/coverage-gaps.d.ts +86 -0
- package/dist-sdk/src/engine/coverage-gaps.js +156 -0
- package/dist-sdk/src/engine/ei/run.d.ts +21 -1
- package/dist-sdk/src/engine/ei/run.js +89 -2
- package/dist-sdk/src/engine/pull/catalog-ref.d.ts +16 -0
- package/dist-sdk/src/engine/pull/catalog-ref.js +24 -0
- package/dist-sdk/src/engine/pull/context.d.ts +68 -6
- package/dist-sdk/src/engine/pull/context.js +40 -1
- package/dist-sdk/src/engine/pull/procedure-refs.d.ts +8 -0
- package/dist-sdk/src/engine/pull/procedure-refs.js +28 -0
- package/dist-sdk/src/engine/pull/result-output.js +27 -1
- package/dist-sdk/src/engine/tf/index.d.ts +1 -1
- package/dist-sdk/src/engine/tf/index.js +1 -1
- package/dist-sdk/src/engine/tf/labels.d.ts +22 -5
- package/dist-sdk/src/engine/tf/labels.js +45 -3
- package/dist-sdk/src/engine/tf/parse.js +3 -2
- package/dist-sdk/src/engine/validation.d.ts +5 -0
- package/dist-sdk/src/engine/validation.js +12 -2
- package/dist-sdk/src/entities/access-policy/from-tf.js +38 -1
- package/dist-sdk/src/entities/access-policy/principal.d.ts +2 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +3 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +42 -19
- package/dist-sdk/src/entities/agent/from-tf.js +11 -3
- package/dist-sdk/src/entities/agent/module.js +2 -0
- package/dist-sdk/src/entities/agent/to-tf.js +14 -3
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +8 -1
- package/dist-sdk/src/entities/agent-tool/from-tf.js +11 -5
- package/dist-sdk/src/entities/agent-tool/module.js +3 -0
- package/dist-sdk/src/entities/app/auto-share.d.ts +38 -0
- package/dist-sdk/src/entities/app/auto-share.js +49 -0
- package/dist-sdk/src/entities/app/build.d.ts +17 -3
- package/dist-sdk/src/entities/app/build.js +56 -4
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +6 -1
- package/dist-sdk/src/entities/app/from-tf.js +4 -0
- package/dist-sdk/src/entities/app/index.d.ts +2 -1
- package/dist-sdk/src/entities/app/index.js +1 -8
- package/dist-sdk/src/entities/app/to-tf.d.ts +6 -0
- package/dist-sdk/src/entities/app/to-tf.js +21 -2
- package/dist-sdk/src/entities/automation/build.d.ts +10 -2
- package/dist-sdk/src/entities/automation/build.js +104 -17
- package/dist-sdk/src/entities/automation/calculation-expression.d.ts +7 -7
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +17 -4
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +156 -19
- package/dist-sdk/src/entities/automation/from-tf.d.ts +9 -2
- package/dist-sdk/src/entities/automation/from-tf.js +366 -86
- package/dist-sdk/src/entities/automation/index.d.ts +1 -1
- package/dist-sdk/src/entities/automation/index.js +1 -1
- package/dist-sdk/src/entities/automation/module.d.ts +3 -0
- package/dist-sdk/src/entities/automation/module.js +70 -7
- package/dist-sdk/src/entities/automation/script-code.d.ts +5 -2
- package/dist-sdk/src/entities/automation/script-code.js +23 -5
- package/dist-sdk/src/entities/automation/task-output-labels.d.ts +37 -0
- package/dist-sdk/src/entities/automation/task-output-labels.js +76 -0
- package/dist-sdk/src/entities/automation/tasks.d.ts +92 -20
- package/dist-sdk/src/entities/automation/tasks.js +48 -15
- package/dist-sdk/src/entities/automation/to-tf.d.ts +20 -3
- package/dist-sdk/src/entities/automation/to-tf.js +606 -62
- package/dist-sdk/src/entities/automation/triggers.d.ts +8 -4
- package/dist-sdk/src/entities/automation/types.d.ts +9 -0
- package/dist-sdk/src/entities/automation/types.js +19 -0
- package/dist-sdk/src/entities/automation/value-ref-tf.d.ts +1 -1
- package/dist-sdk/src/entities/automation/value-ref-tf.js +1 -1
- package/dist-sdk/src/entities/chart/from-tf.js +9 -1
- package/dist-sdk/src/entities/data-lookup/module.js +2 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +7 -5
- package/dist-sdk/src/entities/element/build.d.ts +3 -0
- package/dist-sdk/src/entities/element/build.js +1 -0
- package/dist-sdk/src/entities/element/from-tf.js +4 -0
- package/dist-sdk/src/entities/element/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/element/to-tf.js +8 -14
- package/dist-sdk/src/entities/field/build.d.ts +3 -2
- package/dist-sdk/src/entities/field/calc.d.ts +7 -7
- package/dist-sdk/src/entities/field/from-tf.d.ts +4 -4
- package/dist-sdk/src/entities/field/from-tf.js +205 -48
- package/dist-sdk/src/entities/field/module.js +1 -0
- package/dist-sdk/src/entities/field/options.js +6 -1
- package/dist-sdk/src/entities/field/to-tf.d.ts +4 -4
- package/dist-sdk/src/entities/field/to-tf.js +7 -1
- package/dist-sdk/src/entities/field/types.d.ts +2 -0
- package/dist-sdk/src/entities/field/types.js +27 -0
- package/dist-sdk/src/entities/role/from-tf.js +3 -3
- package/dist-sdk/src/entities/role/to-tf.d.ts +2 -0
- package/dist-sdk/src/entities/role/to-tf.js +12 -4
- package/dist-sdk/src/entities/service-account/from-tf.js +3 -3
- package/dist-sdk/src/entities/service-account/workspace-owner.d.ts +16 -0
- package/dist-sdk/src/entities/service-account/workspace-owner.js +22 -0
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +15 -1
- package/dist-sdk/src/entities/shared/filters/ast.js +2 -0
- package/dist-sdk/src/entities/shared/filters/index.d.ts +5 -0
- package/dist-sdk/src/entities/shared/filters/index.js +5 -0
- package/dist-sdk/src/entities/shared/filters/print.js +7 -2
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +5 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +42 -7
- package/dist-sdk/src/entities/shared/filters/types.d.ts +8 -3
- package/dist-sdk/src/entities/shared/ref.d.ts +5 -7
- package/dist-sdk/src/entities/shared/ref.js +5 -7
- package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +9 -0
- package/dist-sdk/src/entities/shared/tool-field-ref.js +35 -2
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +10 -0
- package/dist-sdk/src/entities/shared/types/field-types.js +4 -0
- package/dist-sdk/src/entities/skill/access-policy.js +3 -3
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +3 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +12 -5
- package/dist-sdk/src/entities/skill/from-tf.js +4 -2
- package/dist-sdk/src/entities/skill/module.js +2 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.js +41 -8
- package/dist-sdk/src/entities/skill-tool/module.js +3 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +0 -6
- package/dist-sdk/src/entities/skill-tool/to-tf.js +22 -9
- package/dist-sdk/src/entities/task/build.d.ts +8 -0
- package/dist-sdk/src/entities/task/build.js +10 -1
- package/dist-sdk/src/entities/task/from-tf.d.ts +4 -2
- package/dist-sdk/src/entities/task/from-tf.js +7 -2
- package/dist-sdk/src/entities/task/module.js +2 -2
- package/dist-sdk/src/entities/task/to-tf.d.ts +8 -4
- package/dist-sdk/src/entities/task/to-tf.js +28 -1
- package/dist-sdk/src/entities/view/from-tf.js +9 -1
- package/dist-sdk/src/entities/view/to-tf.d.ts +6 -7
- package/dist-sdk/src/entities/view/to-tf.js +19 -8
- package/dist-sdk/src/entities/visual-flow/build.d.ts +16 -1
- package/dist-sdk/src/entities/visual-flow/build.js +9 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.d.ts +14 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.js +51 -3
- package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -1
- package/dist-sdk/src/entities/visual-flow/index.js +1 -1
- package/dist-sdk/src/entities/visual-flow/printer.js +19 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.js +87 -3
- package/dist-sdk/src/entities/widget/from-tf.js +3 -3
- package/dist-sdk/src/entities/widget/to-tf.d.ts +2 -0
- package/dist-sdk/src/entities/widget/to-tf.js +7 -6
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +133 -9
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
- package/dist-sdk/src/graph/index.d.ts +1 -0
- package/dist-sdk/src/graph/types.d.ts +29 -3
- package/package.json +7 -3
|
@@ -4,6 +4,9 @@ import { EntityTfError } from "../../engine/entity.js";
|
|
|
4
4
|
import { appScopedResourceLabel, expr, tsLabelToTfLabel } from "../../engine/tf/index.js";
|
|
5
5
|
import { APP_RESOURCE_TYPE } from "../app/module.js";
|
|
6
6
|
import { ELEMENT_RESOURCE_TYPE } from "../element/module.js";
|
|
7
|
+
import { DATAMINE_RESOURCE_TYPE } from "../datamine/module.js";
|
|
8
|
+
import { RELATIONSHIP_RESOURCE_TYPE } from "../relationship/module.js";
|
|
9
|
+
import { TABLE_RESOURCE_TYPE } from "../table/module.js";
|
|
7
10
|
import { VISUAL_FLOW_RESOURCE_TYPE } from "./module.js";
|
|
8
11
|
function ownedResourceRef(ref, expected, ctx) {
|
|
9
12
|
if (ref.__kind !== expected || !ref.refName || ref.parent !== ctx.appRefName) {
|
|
@@ -27,7 +30,7 @@ function objectRef(ref, ctx) {
|
|
|
27
30
|
const name = ref.name ?? ref.refName;
|
|
28
31
|
return resolveForeignRef(kind, { name, namespace: ref.namespace }, ctx.orgRefs, ctx.diagnostics, "visual flow object").value;
|
|
29
32
|
}
|
|
30
|
-
function actionToTf(action, ctx) {
|
|
33
|
+
function actionToTf(action, ctx, dataBlocks) {
|
|
31
34
|
switch (action.kind) {
|
|
32
35
|
case "agent": {
|
|
33
36
|
const ref = action.agent;
|
|
@@ -55,10 +58,90 @@ function actionToTf(action, ctx) {
|
|
|
55
58
|
throw new EntityTfError("visual flow object action is missing its object reference");
|
|
56
59
|
return { object: { object_id: objectRef(ref, ctx), ...(action.name !== undefined && action.name !== "" ? { name: action.name } : {}) } };
|
|
57
60
|
}
|
|
61
|
+
case "datamine": {
|
|
62
|
+
const ref = action.datamine;
|
|
63
|
+
if (ref === undefined)
|
|
64
|
+
throw new EntityTfError("visual flow datamine action is missing its datamine reference");
|
|
65
|
+
return { datamine: { datamine_id: datamineRefToTf(ref, ctx, dataBlocks), ...(action.name !== undefined && action.name !== "" ? { name: action.name } : {}) } };
|
|
66
|
+
}
|
|
67
|
+
case "table": {
|
|
68
|
+
const ref = action.table;
|
|
69
|
+
if (ref === undefined)
|
|
70
|
+
throw new EntityTfError("visual flow table action is missing its table reference");
|
|
71
|
+
return { table: { table_id: tableRefToTf(ref, ctx, dataBlocks), ...(action.name !== undefined && action.name !== "" ? { name: action.name } : {}) } };
|
|
72
|
+
}
|
|
73
|
+
case "relationship": {
|
|
74
|
+
const ref = action.relationship;
|
|
75
|
+
if (ref === undefined)
|
|
76
|
+
throw new EntityTfError("visual flow relationship action is missing its relationship reference");
|
|
77
|
+
if (ref.__kind !== "relationship" || !ref.refName || ref.parent !== ctx.appRefName) {
|
|
78
|
+
throw new EntityTfError(`visual flow relationship must be a typed reference owned by ${ctx.appRefName}`);
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
relationship: {
|
|
82
|
+
relationship_id: expr.resourceAttr(RELATIONSHIP_RESOURCE_TYPE, appScopedResourceLabel(ctx.appTfLabel, tsLabelToTfLabel(ref.refName)), ["id"]),
|
|
83
|
+
...(action.name !== undefined && action.name !== "" ? { name: action.name } : {}),
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
58
87
|
default:
|
|
59
88
|
throw new EntityTfError("visual flow action must come from a public action factory");
|
|
60
89
|
}
|
|
61
90
|
}
|
|
91
|
+
function tableRefToTf(ref, ctx, dataBlocks) {
|
|
92
|
+
if (ref.__kind !== "table" || !ref.refName) {
|
|
93
|
+
throw new EntityTfError("visual flow table must be a typed table reference");
|
|
94
|
+
}
|
|
95
|
+
const local = ctx.workspaceAspects?.get(workspaceAspectKey("table", ref.refName));
|
|
96
|
+
if (local !== undefined)
|
|
97
|
+
return expr.resourceAttr(TABLE_RESOURCE_TYPE, local.tfLabel, ["id"]);
|
|
98
|
+
const name = ref.name ?? ref.refName;
|
|
99
|
+
const label = tsLabelToTfLabel(ref.refName);
|
|
100
|
+
ctx.orgRefs.rawLookup(TABLE_RESOURCE_TYPE, label, name);
|
|
101
|
+
dataBlocks.set(`${TABLE_RESOURCE_TYPE}.${label}`, {
|
|
102
|
+
kind: "data",
|
|
103
|
+
type: TABLE_RESOURCE_TYPE,
|
|
104
|
+
label,
|
|
105
|
+
attrs: { name },
|
|
106
|
+
});
|
|
107
|
+
return expr.dataAttr(TABLE_RESOURCE_TYPE, label, ["id"]);
|
|
108
|
+
}
|
|
109
|
+
function datamineRefToTf(ref, ctx, dataBlocks) {
|
|
110
|
+
if (ref.__kind !== "datamine" || !ref.refName) {
|
|
111
|
+
throw new EntityTfError("visual flow datamine must be a typed datamine reference");
|
|
112
|
+
}
|
|
113
|
+
if (ref.parent === undefined || ref.parent === "") {
|
|
114
|
+
throw new EntityTfError(`visual flow datamine ${JSON.stringify(ref.refName)} is missing its owning table`);
|
|
115
|
+
}
|
|
116
|
+
const label = `${tsLabelToTfLabel(ref.parent)}_${tsLabelToTfLabel(ref.refName)}`;
|
|
117
|
+
const tableSibling = ctx.workspaceAspects?.get(workspaceAspectKey("table", ref.parent));
|
|
118
|
+
if (tableSibling !== undefined && tableSibling.managedDatamineLabels?.has(label) === true) {
|
|
119
|
+
return expr.resourceAttr(DATAMINE_RESOURCE_TYPE, label, ["id"]);
|
|
120
|
+
}
|
|
121
|
+
let tableId;
|
|
122
|
+
if (tableSibling !== undefined) {
|
|
123
|
+
tableId = expr.resourceAttr(TABLE_RESOURCE_TYPE, tableSibling.tfLabel, ["id"]);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
const tableLabel = tsLabelToTfLabel(ref.parent);
|
|
127
|
+
const tableName = typeof ref.parentName === "string" && ref.parentName !== "" ? ref.parentName : ref.parent;
|
|
128
|
+
ctx.orgRefs.rawLookup(TABLE_RESOURCE_TYPE, tableLabel, tableName);
|
|
129
|
+
dataBlocks.set(`${TABLE_RESOURCE_TYPE}.${tableLabel}`, {
|
|
130
|
+
kind: "data",
|
|
131
|
+
type: TABLE_RESOURCE_TYPE,
|
|
132
|
+
label: tableLabel,
|
|
133
|
+
attrs: { name: tableName },
|
|
134
|
+
});
|
|
135
|
+
tableId = expr.dataAttr(TABLE_RESOURCE_TYPE, tableLabel, ["id"]);
|
|
136
|
+
}
|
|
137
|
+
dataBlocks.set(`${DATAMINE_RESOURCE_TYPE}.${label}`, {
|
|
138
|
+
kind: "data",
|
|
139
|
+
type: DATAMINE_RESOURCE_TYPE,
|
|
140
|
+
label,
|
|
141
|
+
attrs: { table_id: tableId, name: ref.name ?? ref.refName },
|
|
142
|
+
});
|
|
143
|
+
return expr.dataAttr(DATAMINE_RESOURCE_TYPE, label, ["id"]);
|
|
144
|
+
}
|
|
62
145
|
export function visualFlowToTf(entity, ctx) {
|
|
63
146
|
if (entity.kind !== "visual-flow")
|
|
64
147
|
throw new EntityTfError(`visualFlowToTf expects visual-flow; got ${entity.kind}`);
|
|
@@ -73,6 +156,7 @@ export function visualFlowToTf(entity, ctx) {
|
|
|
73
156
|
throw new EntityTfError(`visual flow ${entity.refName} has no payload`);
|
|
74
157
|
const ownerType = APP_RESOURCE_TYPE;
|
|
75
158
|
const label = appScopedResourceLabel(ctx.appTfLabel, tsLabelToTfLabel(entity.refName));
|
|
159
|
+
const dataBlocks = new Map();
|
|
76
160
|
const stages = (payload.stages ?? []).map((stage) => {
|
|
77
161
|
if (!stage.stage)
|
|
78
162
|
throw new EntityTfError(`visual flow ${entity.refName}: every stage requires a stable key`);
|
|
@@ -87,11 +171,11 @@ export function visualFlowToTf(entity, ctx) {
|
|
|
87
171
|
x: node.x ?? 0,
|
|
88
172
|
y: node.y ?? 0,
|
|
89
173
|
connects_to: (node.connectsTo ?? []).map((connection) => typeof connection === "string" ? { target: connection } : { target: connection.target ?? "", ...(connection.label !== undefined && { label: connection.label }) }),
|
|
90
|
-
...(node.action !== undefined && { action: actionToTf(node.action, ctx) }),
|
|
174
|
+
...(node.action !== undefined && { action: actionToTf(node.action, ctx, dataBlocks) }),
|
|
91
175
|
...(node.target?.object !== undefined && { target: { object: { object_id: objectRef(node.target.object, ctx), name: node.target.name ?? node.target.object.name ?? node.target.object.refName ?? "Object" } } }),
|
|
92
176
|
})),
|
|
93
177
|
};
|
|
94
178
|
});
|
|
95
179
|
const block = { kind: "resource", type: VISUAL_FLOW_RESOURCE_TYPE, label, attrs: { object_id: expr.resourceAttr(ownerType, ctx.appTfLabel, ["id"]), stages } };
|
|
96
|
-
return { blocks: [block], address: `${VISUAL_FLOW_RESOURCE_TYPE}.${label}` };
|
|
180
|
+
return { blocks: [...dataBlocks.values(), block], address: `${VISUAL_FLOW_RESOURCE_TYPE}.${label}` };
|
|
97
181
|
}
|
|
@@ -119,8 +119,8 @@ function widgetFromTf(block, owner, ctx, dynamicLayoutCompanionLabels) {
|
|
|
119
119
|
...(typeof rec["value"] === "string" && { value: rec["value"] }),
|
|
120
120
|
}];
|
|
121
121
|
})
|
|
122
|
-
:
|
|
123
|
-
if (parametersRaw !== undefined && !Array.isArray(parametersRaw)) {
|
|
122
|
+
: [];
|
|
123
|
+
if (parametersRaw !== undefined && parametersRaw !== null && !Array.isArray(parametersRaw)) {
|
|
124
124
|
ctx.diagnostics.push(`${where}.run_automation_action.parameters: expected a list; dropped`);
|
|
125
125
|
}
|
|
126
126
|
return {
|
|
@@ -129,7 +129,7 @@ function widgetFromTf(block, owner, ctx, dynamicLayoutCompanionLabels) {
|
|
|
129
129
|
name,
|
|
130
130
|
automation,
|
|
131
131
|
...buttonStyle(body, where, ctx),
|
|
132
|
-
|
|
132
|
+
parameters,
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
135
|
function buttonStyle(attrs, where, ctx) {
|
|
@@ -45,6 +45,8 @@ export declare function relationshipTargetsFromBag(relationships: Readonly<Recor
|
|
|
45
45
|
export interface WidgetsToTfOptions {
|
|
46
46
|
readonly ownerRefName: string;
|
|
47
47
|
readonly ownerTfLabel: string;
|
|
48
|
+
/** Element handle, used to prefix element automation resource labels. */
|
|
49
|
+
readonly ownerHandle?: string;
|
|
48
50
|
readonly ownerType: "elementum_app" | "elementum_element";
|
|
49
51
|
readonly scope: ChildResourceScope;
|
|
50
52
|
readonly objectId: TfValue;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { workspaceAspectKey } from "../../engine/build/context.js";
|
|
2
2
|
import { foreignFieldDataLabel, resolveForeignRef } from "../shared/foreign-ref.js";
|
|
3
|
-
import {
|
|
4
|
-
import { AUTOMATION_RESOURCE_TYPE } from "../automation/types.js";
|
|
3
|
+
import { expr, isCanonicalTsLabel, sanitizeName, scopedResourceLabel, tfLabelToTsLabel, tsLabelToTfLabel, } from "../../engine/tf/index.js";
|
|
4
|
+
import { AUTOMATION_RESOURCE_TYPE, automationResourceLabel } from "../automation/types.js";
|
|
5
5
|
import { fieldMetadataFromEntries } from "../field/metadata.js";
|
|
6
6
|
import { authoredFieldKeysFromPayload, fieldRefToTfValue, } from "../field/to-tf.js";
|
|
7
7
|
import { runAutomationParameterValue } from "./build.js";
|
|
@@ -274,6 +274,10 @@ function runAutomationParameters(widget, where, opts) {
|
|
|
274
274
|
value,
|
|
275
275
|
};
|
|
276
276
|
});
|
|
277
|
+
// An authored list, including an empty one, is the live parameter set.
|
|
278
|
+
// CURRENT_RECORD is injected only when the author omitted parameters.
|
|
279
|
+
if (widget.parameters !== undefined)
|
|
280
|
+
return authored;
|
|
277
281
|
const recordParam = onDemandRecordParamForWidget(widget.automation, opts);
|
|
278
282
|
if (recordParam === undefined || authored.some((parameter) => parameter.name === recordParam)) {
|
|
279
283
|
return authored;
|
|
@@ -311,10 +315,7 @@ function resolveAutomation(value, where, opts) {
|
|
|
311
315
|
opts.diagnostics.push(`${where}: foreign automation references require a provider data lookup with app_id; use a raw id until that data-source tranche lands`);
|
|
312
316
|
return undefined;
|
|
313
317
|
}
|
|
314
|
-
|
|
315
|
-
// when the owner is an element. `scopedResourceLabel(..., opts.scope)` would
|
|
316
|
-
// mint `elements_…` here and plan an undeclared resource.
|
|
317
|
-
return expr.resourceAttr(AUTOMATION_RESOURCE_TYPE, appScopedResourceLabel(opts.ownerTfLabel, tsLabelToTfLabel(refName)), ["id"]);
|
|
318
|
+
return expr.resourceAttr(AUTOMATION_RESOURCE_TYPE, automationResourceLabel(opts.ownerTfLabel, refName, opts.scope, opts.scope === "element" ? opts.ownerHandle : undefined), ["id"]);
|
|
318
319
|
}
|
|
319
320
|
function resolveManagedColumn(value, refName, target, opts) {
|
|
320
321
|
const meta = siblingFieldMetadata(target, opts);
|
|
@@ -102,7 +102,7 @@ export type PanesBlockProps = {
|
|
|
102
102
|
/**
|
|
103
103
|
* Customer-facing name: List controls
|
|
104
104
|
* Customer-facing description: Search, filters, grouping, and sort controls that sit above a list.
|
|
105
|
-
* Internal authoring guidance: Toolbar of search,
|
|
105
|
+
* Internal authoring guidance: Toolbar of search, quick filters, filter popover, group-by, and sort. Prefer a `kind: "filters"` list. `kind: "statusGroups"` is legacyStatusGroups: Open/Closed only, with no All chip. If a spec already has legacyStatusGroups or filterPreset and the user is changing filters, rewrite them into one `kind: "filters"` list. Put a preset filter on the chips that should include it. Do not leave filterPreset beside that list. Bind quickFilterValue to $bindState: "/query/statusGroup". Bind filterJson to $bindState: "/query/filter". When a view has more than one App, bind every App to /query/filter/<aspectId> and /query/statusGroup/<aspectId>. A view with one App keeps the shared paths. filterJson is the menu filter the list uses, besides the managed filter. A kind: "filters" chip writes its filter there. legacyStatusGroups writes the preset and Open/Closed there together. A preset alone fills the menu when there is no chip list. The All chip and a cleared filter menu do not return to this preset. The block applies the managed filter at query time and does not store it in filterJson. This block writes that JSON; self-fetching siblings on the same App bound to the same path refetch from it. Looks like list chrome above a collection, not the results themselves. `field` is the aspect field id, not the display name. A picklist value is { "type": "TEXT", "value": "<id>" }. Do not use `UUID` for that id. A dynamic id is the related record id `aspectId:handle`, still `TEXT`. `AspectPicklistField` uses `EQUALS`. `AspectMultiPicklistField` uses `CONTAINS` with one `TEXT` value. Open/Closed chips are statusGroup with filter omitted: { id, label, statusGroup: "open" | "closed" }. The toolbar builds that clause from the STATUS field and every CLOSED picklist tag and writes it into filterJson. Open is status not in those values. Closed is status in those values. Do not author that tree, do not use the STAGE field, and do not use the words "open" or "closed" as values. A specific status such as Pending is a normal chip filter: STATUS field id, value id from findPicklistValue, EQUALS, TEXT value. All is filter null and no statusGroup, only when the admin asks. Mix All, statusGroup chips, and named chips in one `kind: "filters"` list. A chip that already has `filter` uses that tree. Put the admin default on sortPreset as a Sort document with aspect field ids in orders[].field. Bind sortJson to $bindState: "/query/sort". ListControls writes the live sort and /query/sortAspectId from filterAspectId. Keep sort out of filterJson. The menu offers system fields by semantic tag. Restore copies sortPreset back into sortJson during the visit.
|
|
106
106
|
*/
|
|
107
107
|
export type ListControlsBlockElement = {
|
|
108
108
|
readonly type: "ListControlsBlock";
|
|
@@ -129,13 +129,36 @@ export type ListControlsBlockProps = {
|
|
|
129
129
|
readonly sortByValue?: ((string) | (PropExpression)) | (null);
|
|
130
130
|
readonly sortByDirection?: ("ASC" | "DESC") | (PropExpression);
|
|
131
131
|
readonly sortByOptions?: (ReadonlyArray<ListControlsOption>) | (PropExpression);
|
|
132
|
+
readonly sortJson?: (((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
|
|
133
|
+
readonly [key: string]: OpaqueJson;
|
|
134
|
+
}))) | (PropExpression)) | (null);
|
|
135
|
+
readonly sortPreset?: ({
|
|
136
|
+
readonly orders: (ReadonlyArray<{
|
|
137
|
+
readonly field: string;
|
|
138
|
+
readonly direction: "ASC" | "DESC";
|
|
139
|
+
}>) | (PropExpression);
|
|
140
|
+
}) | (PropExpression);
|
|
132
141
|
};
|
|
133
142
|
export type JsonSafeState = OpaqueJson;
|
|
134
|
-
export type ListControlsQuickFilters = {
|
|
143
|
+
export type ListControlsQuickFilters = ({
|
|
144
|
+
readonly kind: ("filters") | (PropExpression);
|
|
145
|
+
readonly chips: (ReadonlyArray<{
|
|
146
|
+
readonly id: string;
|
|
147
|
+
readonly label: string;
|
|
148
|
+
readonly filter?: ((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
|
|
149
|
+
readonly [key: string]: OpaqueJson;
|
|
150
|
+
}))) | (null);
|
|
151
|
+
/**
|
|
152
|
+
* Set "open" or "closed" and omit filter. Runtime uses the STATUS field and every CLOSED picklist tag. Open is status not in those values. Closed is status in those values. Ignored when filter is set.
|
|
153
|
+
*/
|
|
154
|
+
readonly statusGroup?: "open" | "closed";
|
|
155
|
+
}>) | (PropExpression);
|
|
156
|
+
readonly defaultValue?: (string) | (PropExpression);
|
|
157
|
+
}) | ({
|
|
135
158
|
readonly kind?: ("statusGroups") | (PropExpression);
|
|
136
159
|
readonly groups?: (ReadonlyArray<"open" | "closed">) | (PropExpression);
|
|
137
160
|
readonly defaultValue?: ("open" | "closed") | (PropExpression);
|
|
138
|
-
};
|
|
161
|
+
});
|
|
139
162
|
export type ListControlsOption = {
|
|
140
163
|
readonly value: string;
|
|
141
164
|
readonly label: string;
|
|
@@ -144,7 +167,7 @@ export type ListControlsOption = {
|
|
|
144
167
|
/**
|
|
145
168
|
* Customer-facing name: Record list
|
|
146
169
|
* Customer-facing description: A compact stacked list of records with titles and status pills. Use it for queues and pickers.
|
|
147
|
-
* Internal authoring guidance: Dual presentational/self-fetching selectable stacked list with title, identifier, pills, and optional collapsible groups. Place every ListCollectionBlock under a root PanesBlock so clicks can support secondary/detail panes. Use items for authored content, or aspectId/search/filter props for live records; self-fetching falls back to the runtime default aspect. To share a ListControls filter, bind filterJson and use the same filterPreset on this list; state changes refetch it. Use filterPreset without that binding only for an independent list seed. Looks like a ticket queue, not a spreadsheet. Prefer DataTableBlock for dense columns.
|
|
170
|
+
* Internal authoring guidance: Dual presentational/self-fetching selectable stacked list with title, identifier, pills, and optional collapsible groups. Place every ListCollectionBlock under a root PanesBlock so clicks can support secondary/detail panes. Use items for authored content, or aspectId/search/filter props for live records; self-fetching falls back to the runtime default aspect. To share a ListControls filter, bind filterJson and use the same filterPreset on this list; state changes refetch it. When a view has more than one App, bind every App to /query/filter/<aspectId> and /query/statusGroup/<aspectId>. A view with one App keeps the shared paths. Use filterPreset without that binding only for an independent list seed. Looks like a ticket queue, not a spreadsheet. Prefer DataTableBlock for dense columns.
|
|
148
171
|
*/
|
|
149
172
|
export type ListCollectionBlockElement = {
|
|
150
173
|
readonly type: "ListCollectionBlock";
|
|
@@ -207,6 +230,15 @@ export type ListCollectionBlockSelfFetchingProps = {
|
|
|
207
230
|
readonly [key: string]: OpaqueJson;
|
|
208
231
|
}))) | (PropExpression)) | (null);
|
|
209
232
|
readonly filterPreset?: ((("createdByCurrentUser" | "createdInLast24Hours" | "createdInLast7Days" | "createdInLast30Days" | "createdInLast90Days" | "createdInLastYear" | "closedInLast24Hours" | "closedInLast7Days" | "closedInLast30Days" | "closedInLast90Days" | "closedInLastYear" | "assignedToCurrentUser" | "unassigned") | (PropExpression)) | ((ReadonlyArray<"createdByCurrentUser" | "createdInLast24Hours" | "createdInLast7Days" | "createdInLast30Days" | "createdInLast90Days" | "createdInLastYear" | "closedInLast24Hours" | "closedInLast7Days" | "closedInLast30Days" | "closedInLast90Days" | "closedInLastYear" | "assignedToCurrentUser" | "unassigned">) | (PropExpression))) | (PropExpression);
|
|
233
|
+
readonly sortJson?: (((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
|
|
234
|
+
readonly [key: string]: OpaqueJson;
|
|
235
|
+
}))) | (PropExpression)) | (null);
|
|
236
|
+
readonly sortPreset?: ({
|
|
237
|
+
readonly orders: (ReadonlyArray<{
|
|
238
|
+
readonly field: string;
|
|
239
|
+
readonly direction: "ASC" | "DESC";
|
|
240
|
+
}>) | (PropExpression);
|
|
241
|
+
}) | (PropExpression);
|
|
210
242
|
readonly quickFilterValue?: ((string) | (PropExpression)) | (null);
|
|
211
243
|
};
|
|
212
244
|
/**
|
|
@@ -383,7 +415,7 @@ export type CardBlockProps = {
|
|
|
383
415
|
/**
|
|
384
416
|
* Customer-facing name: Data table
|
|
385
417
|
* Customer-facing description: A spreadsheet-style table with typed columns for structured rows.
|
|
386
|
-
* Internal authoring guidance: Dual presentational/self-fetching data table with typed columns, row selection, optional nested children, and loading/empty/error states. Use rows or object columns for authored data, or aspectId/record columns for live records; self-fetching falls back to the runtime default aspect. Presentational rows may set href (absolute https:// opens a new tab, "/path" navigates inside Elementum) so the primary title cell renders as a link; same rules as ActionCardBlock. Per-cell links use a cell-hint object with href. To share a ListControls filter, bind filterJson and use the same filterPreset on this table; state changes refetch it. Use filterPreset without that binding only for an independent table seed. Looks like a spreadsheet-style grid; wrap in CardBlock with padding "none". Prefer ListCollectionBlock for compact record queues.
|
|
418
|
+
* Internal authoring guidance: Dual presentational/self-fetching data table with typed columns, row selection, optional nested children, and loading/empty/error states. Use rows or object columns for authored data, or aspectId/record columns for live records; self-fetching falls back to the runtime default aspect. Presentational rows may set href (absolute https:// opens a new tab, "/path" navigates inside Elementum) so the primary title cell renders as a link; same rules as ActionCardBlock. Per-cell links use a cell-hint object with href. To share a ListControls filter, bind filterJson and use the same filterPreset on this table; state changes refetch it. When a view has more than one App, bind every App to /query/filter/<aspectId> and /query/statusGroup/<aspectId>. A view with one App keeps the shared paths. Use filterPreset without that binding only for an independent table seed. Looks like a spreadsheet-style grid; wrap in CardBlock with padding "none". Prefer ListCollectionBlock for compact record queues.
|
|
387
419
|
*/
|
|
388
420
|
export type DataTableBlockElement = {
|
|
389
421
|
readonly type: "DataTableBlock";
|
|
@@ -452,6 +484,15 @@ export type DataTableBlockSelfFetchingProps = {
|
|
|
452
484
|
readonly [key: string]: OpaqueJson;
|
|
453
485
|
}))) | (PropExpression)) | (null);
|
|
454
486
|
readonly filterPreset?: ((("createdByCurrentUser" | "createdInLast24Hours" | "createdInLast7Days" | "createdInLast30Days" | "createdInLast90Days" | "createdInLastYear" | "closedInLast24Hours" | "closedInLast7Days" | "closedInLast30Days" | "closedInLast90Days" | "closedInLastYear" | "assignedToCurrentUser" | "unassigned") | (PropExpression)) | ((ReadonlyArray<"createdByCurrentUser" | "createdInLast24Hours" | "createdInLast7Days" | "createdInLast30Days" | "createdInLast90Days" | "createdInLastYear" | "closedInLast24Hours" | "closedInLast7Days" | "closedInLast30Days" | "closedInLast90Days" | "closedInLastYear" | "assignedToCurrentUser" | "unassigned">) | (PropExpression))) | (PropExpression);
|
|
487
|
+
readonly sortJson?: (((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
|
|
488
|
+
readonly [key: string]: OpaqueJson;
|
|
489
|
+
}))) | (PropExpression)) | (null);
|
|
490
|
+
readonly sortPreset?: ({
|
|
491
|
+
readonly orders: (ReadonlyArray<{
|
|
492
|
+
readonly field: string;
|
|
493
|
+
readonly direction: "ASC" | "DESC";
|
|
494
|
+
}>) | (PropExpression);
|
|
495
|
+
}) | (PropExpression);
|
|
455
496
|
readonly quickFilterValue?: ((string) | (PropExpression)) | (null);
|
|
456
497
|
readonly selectedAspectId?: ((string) | (PropExpression)) | (null);
|
|
457
498
|
readonly selectedHandle?: ((string) | (PropExpression)) | (null);
|
|
@@ -637,7 +678,7 @@ export type MetricsRowSelfFetchProps = {
|
|
|
637
678
|
/**
|
|
638
679
|
* Customer-facing name: Page header
|
|
639
680
|
* Customer-facing description: A compact heading with a short description and actions at the top of a page.
|
|
640
|
-
* Internal authoring guidance: Compact page-level heading with supporting description, icon badge, and primary or outline actions. Best used once at the top of a page or managed view as a child of a StackBlock. Give an action an href to navigate (absolute https:// opens a new tab, "/path" navigates inside Elementum)
|
|
681
|
+
* Internal authoring guidance: Compact page-level heading with supporting description, icon badge, and primary or outline actions. Best used once at the top of a page or managed view as a child of a StackBlock. Each action is a link (href) or an action (onPress); never set both. Give an action an href to navigate (absolute https:// opens a new tab, "/path" navigates inside Elementum). A createRecord onPress opens the host create-record dialog for that App. A triggerAutomation onPress runs one on-demand automation from a literal automationId. Prefer recordId { "$state": "/selection/recordId" } for the selected row; a literal recordId must be {aspectUuid}:{handle}, never a handle alone or a fake prefix. Omit recordId to let the user pick. copy goes inside params, never beside action. Shape: params: { automationId, recordId?, copy?: { confirm?, pending?, success?, failure? } }. Omit copy to use the defaults Save / Saving… / Saved / Save failed. Do not invent these strings. Use DataTableBlock or ListCollectionBlock for collection content and HeaderBlock or BodyBlock for headings inside a detail section.
|
|
641
682
|
*/
|
|
642
683
|
export type PageHeaderBlockElement = {
|
|
643
684
|
readonly type: "PageHeaderBlock";
|
|
@@ -656,7 +697,8 @@ export type PageHeaderBlockProps = {
|
|
|
656
697
|
readonly actions?: ((ReadonlyArray<PageHeaderAction>) | (PropExpression)) | (null);
|
|
657
698
|
readonly selectedActionId?: ((string) | (PropExpression)) | (null);
|
|
658
699
|
};
|
|
659
|
-
export type PageHeaderAction =
|
|
700
|
+
export type PageHeaderAction = (PageHeaderLinkAction) | (PageHeaderPressAction) | (PageHeaderLegacyAction);
|
|
701
|
+
export type PageHeaderLinkAction = {
|
|
660
702
|
readonly id: string;
|
|
661
703
|
readonly label: string;
|
|
662
704
|
readonly variant?: "primary" | "outline";
|
|
@@ -664,12 +706,94 @@ export type PageHeaderAction = {
|
|
|
664
706
|
/**
|
|
665
707
|
* Navigation target. Use an absolute http(s) URL or a root-relative /path. Same rules as ActionCardBlock card href.
|
|
666
708
|
*/
|
|
667
|
-
readonly href
|
|
709
|
+
readonly href: string;
|
|
710
|
+
};
|
|
711
|
+
export type PageHeaderPressAction = {
|
|
712
|
+
readonly id: string;
|
|
713
|
+
readonly label: string;
|
|
714
|
+
readonly variant?: "primary" | "outline";
|
|
715
|
+
readonly disabled?: boolean;
|
|
716
|
+
/**
|
|
717
|
+
* Non-navigation action, such as createRecord with an aspectId parameter or triggerAutomation with an automationId, optional recordId ({aspectUuid}:{handle}, or omit to pick), and optional copy inside params (never beside action): copy?: { confirm?, pending?, success?, failure? }. Omit copy for Save / Saving… / Saved / Save failed. Do not set href on the same action.
|
|
718
|
+
*/
|
|
719
|
+
readonly onPress: {
|
|
720
|
+
readonly action: string;
|
|
721
|
+
readonly params?: {
|
|
722
|
+
readonly copy?: {
|
|
723
|
+
readonly confirm?: string;
|
|
724
|
+
readonly pending?: string;
|
|
725
|
+
readonly success?: string;
|
|
726
|
+
readonly failure?: string;
|
|
727
|
+
};
|
|
728
|
+
} & {
|
|
729
|
+
readonly [key: string]: (string) | (number) | (boolean) | (null) | ({
|
|
730
|
+
readonly $state: string;
|
|
731
|
+
} & {
|
|
732
|
+
readonly [key: string]: unknown;
|
|
733
|
+
});
|
|
734
|
+
};
|
|
735
|
+
readonly confirm?: {
|
|
736
|
+
readonly title: string;
|
|
737
|
+
readonly message: string;
|
|
738
|
+
readonly confirmLabel?: string;
|
|
739
|
+
readonly cancelLabel?: string;
|
|
740
|
+
readonly variant?: "default" | "danger";
|
|
741
|
+
} & {
|
|
742
|
+
readonly [key: string]: unknown;
|
|
743
|
+
};
|
|
744
|
+
readonly onSuccess?: ({
|
|
745
|
+
readonly navigate: string;
|
|
746
|
+
} & {
|
|
747
|
+
readonly [key: string]: unknown;
|
|
748
|
+
}) | ({
|
|
749
|
+
readonly set: {
|
|
750
|
+
readonly [key: string]: unknown;
|
|
751
|
+
};
|
|
752
|
+
} & {
|
|
753
|
+
readonly [key: string]: unknown;
|
|
754
|
+
}) | ({
|
|
755
|
+
readonly action: string;
|
|
756
|
+
readonly params?: {
|
|
757
|
+
readonly [key: string]: (string) | (number) | (boolean) | (null) | ({
|
|
758
|
+
readonly $state: string;
|
|
759
|
+
} & {
|
|
760
|
+
readonly [key: string]: unknown;
|
|
761
|
+
});
|
|
762
|
+
};
|
|
763
|
+
} & {
|
|
764
|
+
readonly [key: string]: unknown;
|
|
765
|
+
});
|
|
766
|
+
readonly onError?: ({
|
|
767
|
+
readonly set: {
|
|
768
|
+
readonly [key: string]: unknown;
|
|
769
|
+
};
|
|
770
|
+
} & {
|
|
771
|
+
readonly [key: string]: unknown;
|
|
772
|
+
}) | ({
|
|
773
|
+
readonly action: string;
|
|
774
|
+
readonly params?: {
|
|
775
|
+
readonly [key: string]: (string) | (number) | (boolean) | (null) | ({
|
|
776
|
+
readonly $state: string;
|
|
777
|
+
} & {
|
|
778
|
+
readonly [key: string]: unknown;
|
|
779
|
+
});
|
|
780
|
+
};
|
|
781
|
+
} & {
|
|
782
|
+
readonly [key: string]: unknown;
|
|
783
|
+
});
|
|
784
|
+
readonly preventDefault?: boolean;
|
|
785
|
+
};
|
|
786
|
+
};
|
|
787
|
+
export type PageHeaderLegacyAction = {
|
|
788
|
+
readonly id: string;
|
|
789
|
+
readonly label: string;
|
|
790
|
+
readonly variant?: "primary" | "outline";
|
|
791
|
+
readonly disabled?: boolean;
|
|
668
792
|
};
|
|
669
793
|
/**
|
|
670
794
|
* Customer-facing name: Buttons
|
|
671
795
|
* Customer-facing description: A row of buttons that link to pages or run actions.
|
|
672
|
-
* Internal authoring guidance: A responsive row of buttons. Each item is a link (href, optional viewId), an action (onPress), or a static button (neither); never set both href and onPress. Omitted emphasis defaults to primary for onPress buttons and secondary for links. Set it explicitly for tertiary alternates or destructive actions. A createRecord onPress opens the host create-record dialog for that App. A triggerAutomation onPress runs one on-demand automation from a literal automationId. Prefer recordId { "$state": "/selection/recordId" } for the selected row; a literal recordId must be {aspectUuid}:{handle}, never a handle alone or a fake prefix. Omit recordId to let the user pick. copy goes inside params, never beside action. Shape: params: { automationId, recordId?, copy?: { confirm?, pending?, success?, failure? } }. Omit copy to use the defaults Save / Saving… / Saved / Save failed. Do not invent these strings. Host actions such as createRecord and triggerAutomation also work on PageHeaderBlock via
|
|
796
|
+
* Internal authoring guidance: A responsive row of buttons. Each item is a link (href, optional viewId), an action (onPress), or a static button (neither); never set both href and onPress. Omitted emphasis defaults to primary for onPress buttons and secondary for links. Set it explicitly for tertiary alternates or destructive actions. A createRecord onPress opens the host create-record dialog for that App. A triggerAutomation onPress runs one on-demand automation from a literal automationId. Prefer recordId { "$state": "/selection/recordId" } for the selected row; a literal recordId must be {aspectUuid}:{handle}, never a handle alone or a fake prefix. Omit recordId to let the user pick. copy goes inside params, never beside action. Shape: params: { automationId, recordId?, copy?: { confirm?, pending?, success?, failure? } }. Omit copy to use the defaults Save / Saving… / Saved / Save failed. Do not invent these strings. Host actions such as createRecord and triggerAutomation also work on PageHeaderBlock via onPress. The row stacks in narrow panes. Use PageHeaderBlock actions for page-level heading buttons.
|
|
673
797
|
*/
|
|
674
798
|
export type ButtonBlockElement = {
|
|
675
799
|
readonly type: "ButtonBlock";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by `npm run generate:ragnarok` — do not edit. Refresh with `npm run refresh:ragnarok`.
|
|
2
|
-
// Source: urn:elementum:elementum-blocks:spec:v1 version 1.
|
|
3
|
-
// Schema sha256:
|
|
2
|
+
// Source: urn:elementum:elementum-blocks:spec:v1 version 1.38.0
|
|
3
|
+
// Schema sha256: 6d96d9f9edee222052989a1c5eecf75d0da751ed102c8c3fb1a5e5229502990b
|
|
4
4
|
// Generator revision: 2
|
|
5
5
|
export {};
|
|
@@ -92,6 +92,7 @@ export declare const BUILD_VS_EXPORT_ATTRIBUTE_LOCALS: {
|
|
|
92
92
|
readonly resourceType: string;
|
|
93
93
|
readonly attribute: string;
|
|
94
94
|
readonly localPrefix: string;
|
|
95
|
+
readonly listField?: string;
|
|
95
96
|
}[];
|
|
96
97
|
export declare const BUILD_VS_EXPORT_TASK_OUTPUT_REFERENCE_NAMES: ReadonlyMap<string, ReadonlyMap<string, string>>;
|
|
97
98
|
/** Kind id → module. */
|
|
@@ -10,7 +10,7 @@ import type { DeployableEntity } from "../engine/entity.js";
|
|
|
10
10
|
import type { FromTfContext } from "../engine/pull/context.js";
|
|
11
11
|
import type { ChildResourceScope, TfBlock, TfValue } from "../engine/tf/index.js";
|
|
12
12
|
import type { ValidationFailure } from "../engine/validation.js";
|
|
13
|
-
export type KindId = "org" | "app" | "element" | "field" | "access-policy" | "agent" | "agent-evaluation" | "chart" | "agent-tool" | "agent-a2a-skill" | "automation" | "approval-chain" | "file-reader" | "visual-flow" | "skill" | "skill-tool" | "view" | "managed-view-order" | "record-create-form" | "dynamic-layout" | "dashboard" | "dashboard-widget" | "datamine" | "automation-value-references" | "organization" | "permission-template" | "service-account" | "stored-function" | "task" | "portal" | "widget" | "relationship" | "search-table" | "table" | "cloud-link" | "email-alias" | "category" | "connector" | "ai-provider-anthropic" | "ai-provider-bedrock" | "ai-provider-custom" | "ai-provider-deepgram" | "ai-provider-elevenlab" | "ai-provider-gemini" | "ai-provider-openai" | "ai-provider-snowflake" | "ai-provider-xai" | "ai-provider-managed" | "group" | "phone-provider" | "phone-service" | "role" | "user";
|
|
13
|
+
export type KindId = "org" | "app" | "element" | "field" | "access-policy" | "agent" | "agent-evaluation" | "chart" | "agent-tool" | "agent-a2a-skill" | "automation" | "approval-chain" | "file-reader" | "visual-flow" | "skill" | "skill-tool" | "view" | "managed-view-order" | "record-create-form" | "dynamic-layout" | "dashboard" | "dashboard-widget" | "datamine" | "automation-value-references" | "organization" | "permission-template" | "service-account" | "stored-function" | "vault-entry" | "task" | "portal" | "widget" | "relationship" | "search-table" | "table" | "cloud-link" | "email-alias" | "category" | "connector" | "ai-provider-anthropic" | "ai-provider-bedrock" | "ai-provider-custom" | "ai-provider-deepgram" | "ai-provider-elevenlab" | "ai-provider-gemini" | "ai-provider-openai" | "ai-provider-snowflake" | "ai-provider-xai" | "ai-provider-managed" | "group" | "phone-provider" | "phone-service" | "role" | "user";
|
|
14
14
|
/** @deprecated Use {@link KindId}. */
|
|
15
15
|
export type EntityKindId = KindId;
|
|
16
16
|
export type StreamFacet = {
|
|
@@ -97,6 +97,12 @@ export type ResourceFacet = {
|
|
|
97
97
|
readonly shape: "composite";
|
|
98
98
|
readonly members: readonly CompositeMember[];
|
|
99
99
|
readonly adoptable: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Skeleton label for a child of this kind, when it differs from
|
|
102
|
+
* `scopedResourceLabel`. `childTfLabel` is the child's ref name in
|
|
103
|
+
* terraform form.
|
|
104
|
+
*/
|
|
105
|
+
readonly childLabel?: (ownerTfLabel: string, childTfLabel: string, scope: ChildResourceScope) => string;
|
|
100
106
|
} | {
|
|
101
107
|
/** Authoring/parentage graph node with no distinct terraform resource types yet. */
|
|
102
108
|
readonly shape: "none";
|
|
@@ -317,6 +323,18 @@ export interface UnresolvedReferenceDiagnostic {
|
|
|
317
323
|
readonly reason: string;
|
|
318
324
|
readonly portability: "source-org-only";
|
|
319
325
|
}
|
|
326
|
+
/** Workspace facts a re-pull merge may consult (#1590). */
|
|
327
|
+
export interface MergePulledSourceContext {
|
|
328
|
+
/** Platform id of the pulled child. */
|
|
329
|
+
readonly platformId?: string;
|
|
330
|
+
/** Workspace state read at write time; undefined when it could not be read. */
|
|
331
|
+
readonly stateResources?: readonly {
|
|
332
|
+
readonly type?: string;
|
|
333
|
+
readonly instances?: readonly {
|
|
334
|
+
readonly attributes?: Record<string, unknown>;
|
|
335
|
+
}[];
|
|
336
|
+
}[];
|
|
337
|
+
}
|
|
320
338
|
export interface PrintOwnFileOptions {
|
|
321
339
|
/** Directory refName → actual flat barrel key, including app/element collisions. */
|
|
322
340
|
readonly elementCatalogKeys?: ReadonlyMap<string, string>;
|
|
@@ -368,6 +386,9 @@ export interface PrintOwnFileOptions {
|
|
|
368
386
|
* prints `catalog.<refName>` instead of the literal stub.
|
|
369
387
|
*/
|
|
370
388
|
readonly foreignElementRefNames?: ReadonlyMap<string, string>;
|
|
389
|
+
/** Namespace → refName for apps/elements on disk, for owners ei exports with only a `namespace`. */
|
|
390
|
+
readonly foreignAppRefNamespaces?: ReadonlyMap<string, string>;
|
|
391
|
+
readonly foreignElementRefNamespaces?: ReadonlyMap<string, string>;
|
|
371
392
|
/**
|
|
372
393
|
* Same as {@link foreignAppRefNames}, keyed for tasks (#1011) — a
|
|
373
394
|
* task target whose name is a key here prints `catalog.<refName>` instead
|
|
@@ -533,7 +554,7 @@ export type LifecycleFacet = {
|
|
|
533
554
|
/** Print one extracted own-file instance to TypeScript source. */
|
|
534
555
|
readonly printOwnFile?: (item: unknown, opts: PrintOwnFileOptions) => PrintedOwnFile;
|
|
535
556
|
/** Re-pull: preserve author-owned values that the live export cannot represent. */
|
|
536
|
-
readonly mergePulledSource?: (freshSource: string, existingSource: string) => string;
|
|
557
|
+
readonly mergePulledSource?: (freshSource: string, existingSource: string, context?: MergePulledSourceContext) => string;
|
|
537
558
|
/**
|
|
538
559
|
* Re-pull: true when an existing source file is earlier printer output
|
|
539
560
|
* that can never build (it carries a placeholder the printer emits for a
|
|
@@ -673,11 +694,16 @@ export interface EntityKindModule {
|
|
|
673
694
|
readonly attribute: string;
|
|
674
695
|
readonly defaults: Readonly<Record<string, TfValue>>;
|
|
675
696
|
}[];
|
|
676
|
-
/**
|
|
697
|
+
/**
|
|
698
|
+
* Server-assigned attributes the export records as a `<localPrefix><label>` local.
|
|
699
|
+
* With `listField`, the attribute is a list and the local lists each entry's
|
|
700
|
+
* `listField` in order (`<attribute>[i].<listField>` = local[i]).
|
|
701
|
+
*/
|
|
677
702
|
readonly exportedAttributeLocals?: readonly {
|
|
678
703
|
readonly resourceType: string;
|
|
679
704
|
readonly attribute: string;
|
|
680
705
|
readonly localPrefix: string;
|
|
706
|
+
readonly listField?: string;
|
|
681
707
|
}[];
|
|
682
708
|
};
|
|
683
709
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementumai/edk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "Elementum Development Kit — statically typed SDK for building Elementum apps, automations, and agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
"release:local-sdk": "bash release/verify-local-sdk-prepare.sh",
|
|
193
193
|
"release:notes": "tsx src/scripts/release-notes.ts",
|
|
194
194
|
"test": "tsx src/scripts/test.ts",
|
|
195
|
-
"test:unit": "
|
|
195
|
+
"test:unit": "vitest run",
|
|
196
196
|
"test:runtime": "vitest run",
|
|
197
197
|
"check:parity": "tsx src/scripts/check-provider-parity.ts",
|
|
198
198
|
"pretest:provider": "npm run generate:graphql",
|
|
@@ -211,7 +211,11 @@
|
|
|
211
211
|
"reap:orphans": "node integration/tools/reap-orphaned-test-entities.mjs",
|
|
212
212
|
"typecheck": "npm run typecheck:ci",
|
|
213
213
|
"pretypecheck:ci": "npm run generate:ragnarok",
|
|
214
|
-
"typecheck:ci": "
|
|
214
|
+
"typecheck:ci": "npm run typecheck:ci:project --ignore-scripts && npm run typecheck:ci:examples --ignore-scripts",
|
|
215
|
+
"pretypecheck:ci:project": "npm run generate:ragnarok",
|
|
216
|
+
"typecheck:ci:project": "tsc --noEmit -p tsconfig.ci.json --incremental --tsBuildInfoFile node_modules/.cache/edk-tsc/ci.tsbuildinfo",
|
|
217
|
+
"pretypecheck:ci:examples": "npm run generate:ragnarok",
|
|
218
|
+
"typecheck:ci:examples": "tsc --noEmit -p tsconfig.examples-check.json --incremental --tsBuildInfoFile node_modules/.cache/edk-tsc/examples.tsbuildinfo",
|
|
215
219
|
"pretypecheck:src": "npm run generate:ragnarok",
|
|
216
220
|
"typecheck:src": "tsc --noEmit",
|
|
217
221
|
"pretypecheck:examples": "npm run generate:ragnarok",
|