@elementumai/edk 0.9.6 → 0.9.9
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 +34 -3
- package/dist-sdk/src/catalog/factories.d.ts +26 -6
- package/dist-sdk/src/catalog/factories.js +41 -6
- package/dist-sdk/src/catalog/from-authoring.js +27 -33
- package/dist-sdk/src/catalog/index.d.ts +2 -2
- package/dist-sdk/src/catalog/index.js +2 -2
- package/dist-sdk/src/catalog/org.js +93 -42
- package/dist-sdk/src/catalog/token.js +10 -0
- package/dist-sdk/src/catalog/types.d.ts +42 -3
- package/dist-sdk/src/catalog/types.js +5 -0
- package/dist-sdk/src/core/index.d.ts +2 -2
- package/dist-sdk/src/core/index.js +1 -1
- package/dist-sdk/src/core/platform-id.d.ts +2 -0
- package/dist-sdk/src/core/platform-id.js +4 -0
- package/dist-sdk/src/core/system-fields.d.ts +18 -0
- package/dist-sdk/src/core/system-fields.js +21 -0
- package/dist-sdk/src/core/triggers/on-demand.d.ts +27 -24
- package/dist-sdk/src/core/triggers/on-demand.js +33 -12
- package/dist-sdk/src/core/types/app.d.ts +14 -9
- package/dist-sdk/src/core/types/aspect-category.d.ts +1 -0
- package/dist-sdk/src/core/types/aspect-category.js +1 -0
- package/dist-sdk/src/core/types/platform.d.ts +1 -1
- package/dist-sdk/src/engine/build/context.d.ts +24 -8
- package/dist-sdk/src/engine/build/source-context.d.ts +14 -17
- package/dist-sdk/src/engine/build/source-context.js +1 -1
- package/dist-sdk/src/engine/pull/context.d.ts +18 -0
- package/dist-sdk/src/engine/pull/org.d.ts +4 -0
- package/dist-sdk/src/engine/pull/org.js +17 -2
- package/dist-sdk/src/engine/pull/procedure-refs.d.ts +16 -0
- package/dist-sdk/src/engine/pull/procedure-refs.js +69 -0
- package/dist-sdk/src/engine/pull/ref-only.d.ts +14 -0
- package/dist-sdk/src/engine/pull/ref-only.js +35 -2
- package/dist-sdk/src/engine/tf/expr.js +1 -1
- package/dist-sdk/src/engine/workspace/authoring-layout.d.ts +15 -0
- package/dist-sdk/src/engine/workspace/authoring-layout.js +33 -1
- package/dist-sdk/src/engine/workspace/loader.d.ts +40 -0
- package/dist-sdk/src/engine/workspace/loader.js +328 -0
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +4 -0
- package/dist-sdk/src/entities/access-policy/from-tf.js +24 -4
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +7 -0
- package/dist-sdk/src/entities/access-policy/to-tf.js +11 -3
- package/dist-sdk/src/entities/agent/build.d.ts +54 -8
- package/dist-sdk/src/entities/agent/build.js +36 -1
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +144 -3
- package/dist-sdk/src/entities/agent/from-tf.d.ts +7 -6
- package/dist-sdk/src/entities/agent/from-tf.js +176 -5
- package/dist-sdk/src/entities/agent/index.d.ts +2 -2
- package/dist-sdk/src/entities/agent/index.js +1 -1
- package/dist-sdk/src/entities/agent/module.js +1 -0
- package/dist-sdk/src/entities/agent/to-tf.d.ts +5 -4
- package/dist-sdk/src/entities/agent/to-tf.js +186 -11
- package/dist-sdk/src/entities/agent/tools.d.ts +16 -5
- package/dist-sdk/src/entities/agent/tools.js +13 -1
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +16 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.js +39 -6
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +2 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.js +12 -12
- package/dist-sdk/src/entities/agent-tool/types.js +1 -0
- package/dist-sdk/src/entities/app/build.d.ts +44 -24
- package/dist-sdk/src/entities/app/build.js +18 -8
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +15 -0
- package/dist-sdk/src/entities/app/display-blocks-to-layout.d.ts +45 -0
- package/dist-sdk/src/entities/app/display-blocks-to-layout.js +98 -0
- package/dist-sdk/src/entities/app/display-blocks-to-record-create-form.d.ts +55 -0
- package/dist-sdk/src/entities/app/display-blocks-to-record-create-form.js +99 -0
- package/dist-sdk/src/entities/app/from-tf.js +79 -14
- package/dist-sdk/src/entities/app/index.d.ts +3 -2
- package/dist-sdk/src/entities/app/index.js +2 -1
- package/dist-sdk/src/entities/app/to-tf.js +30 -6
- package/dist-sdk/src/entities/automation/build.d.ts +37 -18
- package/dist-sdk/src/entities/automation/build.js +121 -12
- package/dist-sdk/src/entities/automation/catalog-render.js +5 -2
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +8 -10
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +2 -0
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +103 -20
- package/dist-sdk/src/entities/automation/from-tf.d.ts +10 -1
- package/dist-sdk/src/entities/automation/from-tf.js +1165 -91
- package/dist-sdk/src/entities/automation/index.d.ts +1 -1
- package/dist-sdk/src/entities/automation/module.js +15 -5
- package/dist-sdk/src/entities/automation/operators.d.ts +2 -2
- package/dist-sdk/src/entities/automation/operators.js +1 -0
- package/dist-sdk/src/entities/automation/output-field-types.d.ts +17 -0
- package/dist-sdk/src/entities/automation/output-field-types.js +45 -0
- package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +20 -4
- package/dist-sdk/src/entities/automation/output-key-wire-name.js +33 -6
- package/dist-sdk/src/entities/automation/script-code.d.ts +1 -1
- package/dist-sdk/src/entities/automation/script-code.js +168 -36
- package/dist-sdk/src/entities/automation/task-label.d.ts +2 -0
- package/dist-sdk/src/entities/automation/task-label.js +18 -0
- package/dist-sdk/src/entities/automation/tasks.d.ts +159 -45
- package/dist-sdk/src/entities/automation/tasks.js +60 -47
- package/dist-sdk/src/entities/automation/to-tf.d.ts +7 -1
- package/dist-sdk/src/entities/automation/to-tf.js +816 -87
- package/dist-sdk/src/entities/automation/triggers.d.ts +14 -5
- package/dist-sdk/src/entities/automation/triggers.js +1 -1
- package/dist-sdk/src/entities/automation/value-ref-tf.d.ts +78 -0
- package/dist-sdk/src/entities/automation/value-ref-tf.js +193 -0
- package/dist-sdk/src/entities/dashboard/from-tf.js +1 -1
- package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +1 -1
- package/dist-sdk/src/entities/element/build.d.ts +30 -7
- package/dist-sdk/src/entities/element/build.js +7 -3
- package/dist-sdk/src/entities/element/from-tf.js +7 -3
- package/dist-sdk/src/entities/element/index.d.ts +3 -2
- package/dist-sdk/src/entities/element/index.js +3 -2
- package/dist-sdk/src/entities/element/to-tf.js +49 -8
- package/dist-sdk/src/entities/field/build.d.ts +94 -3
- package/dist-sdk/src/entities/field/build.js +82 -3
- package/dist-sdk/src/entities/field/from-tf.d.ts +6 -0
- package/dist-sdk/src/entities/field/from-tf.js +104 -1
- package/dist-sdk/src/entities/field/locals.js +6 -7
- package/dist-sdk/src/entities/field/module.js +1 -0
- package/dist-sdk/src/entities/field/options.d.ts +2 -0
- package/dist-sdk/src/entities/field/options.js +12 -2
- package/dist-sdk/src/entities/field/record-shape.d.ts +12 -15
- package/dist-sdk/src/entities/field/to-tf.d.ts +13 -3
- package/dist-sdk/src/entities/field/to-tf.js +191 -56
- package/dist-sdk/src/entities/field/types.js +2 -0
- package/dist-sdk/src/entities/org/category-ref.d.ts +5 -0
- package/dist-sdk/src/entities/org/category-ref.js +12 -0
- package/dist-sdk/src/entities/record-create-form/from-tf.js +3 -3
- package/dist-sdk/src/entities/record-create-form/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/record-create-form/to-tf.js +18 -13
- package/dist-sdk/src/entities/relationship/from-tf.js +100 -7
- package/dist-sdk/src/entities/role/from-tf.js +10 -4
- package/dist-sdk/src/entities/search-table/build.d.ts +1 -1
- package/dist-sdk/src/entities/search-table/from-tf.d.ts +1 -0
- package/dist-sdk/src/entities/search-table/from-tf.js +6 -0
- package/dist-sdk/src/entities/search-table/printer.js +3 -1
- package/dist-sdk/src/entities/search-table/to-tf.js +3 -3
- package/dist-sdk/src/entities/search-table/types.js +1 -0
- package/dist-sdk/src/entities/service-account/from-tf.js +10 -4
- package/dist-sdk/src/entities/service-account/to-tf.d.ts +2 -1
- package/dist-sdk/src/entities/service-account/to-tf.js +7 -0
- package/dist-sdk/src/entities/shared/aspect-target-from-tf.d.ts +9 -0
- package/dist-sdk/src/entities/shared/aspect-target-from-tf.js +39 -0
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +24 -1
- package/dist-sdk/src/entities/shared/filters/ast.js +4 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +13 -2
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +14 -8
- package/dist-sdk/src/entities/shared/handle-description.d.ts +12 -0
- package/dist-sdk/src/entities/shared/handle-description.js +20 -0
- package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +5 -3
- package/dist-sdk/src/entities/shared/tool-field-ref.js +11 -16
- package/dist-sdk/src/entities/shared/types/common.d.ts +7 -5
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +6 -1
- package/dist-sdk/src/entities/shared/types/field-types.js +5 -8
- package/dist-sdk/src/entities/shared/types/platform.d.ts +15 -2
- package/dist-sdk/src/entities/skill/build.d.ts +51 -2
- package/dist-sdk/src/entities/skill/build.js +65 -8
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +1 -1
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +79 -18
- package/dist-sdk/src/entities/skill/from-tf.d.ts +11 -0
- package/dist-sdk/src/entities/skill/from-tf.js +47 -5
- package/dist-sdk/src/entities/skill/index.d.ts +1 -1
- package/dist-sdk/src/entities/skill/index.js +1 -1
- package/dist-sdk/src/entities/skill/input-coverage.d.ts +89 -0
- package/dist-sdk/src/entities/skill/input-coverage.js +327 -0
- package/dist-sdk/src/entities/skill/module.js +2 -0
- package/dist-sdk/src/entities/skill/to-tf.d.ts +9 -25
- package/dist-sdk/src/entities/skill/to-tf.js +29 -40
- package/dist-sdk/src/entities/skill/tools.d.ts +12 -2
- package/dist-sdk/src/entities/skill/tools.js +3 -6
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +19 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.js +50 -14
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +9 -7
- package/dist-sdk/src/entities/skill-tool/to-tf.js +29 -23
- package/dist-sdk/src/entities/table/to-tf.js +21 -5
- package/dist-sdk/src/entities/task/to-tf.js +3 -2
- package/dist-sdk/src/entities/view/from-tf.js +36 -10
- package/dist-sdk/src/entities/view/to-tf.d.ts +2 -0
- package/dist-sdk/src/entities/view/to-tf.js +49 -30
- package/dist-sdk/src/entities/visual-flow/from-tf.js +6 -2
- package/dist-sdk/src/entities/widget/from-tf.js +2 -2
- package/dist-sdk/src/entities/widget/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/widget/to-tf.js +52 -23
- package/dist-sdk/src/graph/index.d.ts +19 -1
- package/dist-sdk/src/graph/index.js +20 -0
- package/dist-sdk/src/graph/types.d.ts +22 -0
- package/package.json +11 -5
|
@@ -27,7 +27,7 @@ function appendViewSharingAttrs(attrs, view, where, ctx) {
|
|
|
27
27
|
}
|
|
28
28
|
/** `layouts`/`listViews`/`viewOrder` → their resource blocks, in ei's dialect. */
|
|
29
29
|
export function viewToTf(layouts, listViews, calendarViews, kanbanViews, dashboardViews, agentViews, viewOrder, opts) {
|
|
30
|
-
const { ownerRefName, ownerTfLabel, scope = "app", aspectName, objectId, diagnostics } = opts;
|
|
30
|
+
const { ownerRefName, ownerTfLabel, scope = "app", aspectName, objectId, diagnostics, fieldAddresses } = opts;
|
|
31
31
|
const principalCtx = { ...opts, scope, objectId };
|
|
32
32
|
const blocks = [];
|
|
33
33
|
for (const [stageKey, layout] of Object.entries(layouts ?? {})) {
|
|
@@ -40,7 +40,7 @@ export function viewToTf(layouts, listViews, calendarViews, kanbanViews, dashboa
|
|
|
40
40
|
diagnostics.push(`layouts.${stageKey} has no matching authored stage option; dropped`);
|
|
41
41
|
continue;
|
|
42
42
|
}
|
|
43
|
-
blocks.push(layoutToTf(stageKey, layout, ownerTfLabel, scope, objectId, diagnostics));
|
|
43
|
+
blocks.push(layoutToTf(stageKey, layout, ownerTfLabel, scope, objectId, diagnostics, fieldAddresses));
|
|
44
44
|
}
|
|
45
45
|
const viewAddressByKey = new Map();
|
|
46
46
|
for (const [viewKey, view] of Object.entries(listViews ?? {})) {
|
|
@@ -53,8 +53,12 @@ export function viewToTf(layouts, listViews, calendarViews, kanbanViews, dashboa
|
|
|
53
53
|
const attrs = {
|
|
54
54
|
aspect_id: objectId,
|
|
55
55
|
name: view.name ?? "",
|
|
56
|
+
// Prefer an explicit authoring value. When pull omitted the attr (ei used
|
|
57
|
+
// to skip `false`), leave the wire unset only if we never captured it —
|
|
58
|
+
// defaulting to `true` planned false→true against live views that
|
|
59
|
+
// disallow create. Platform default when unset on create is still true.
|
|
56
60
|
allow_record_creation: view.allowRecordCreation ?? true,
|
|
57
|
-
columns: resolveFieldRefs(view.columns ?? [], ownerTfLabel, scope, `${where}.columns`, diagnostics),
|
|
61
|
+
columns: resolveFieldRefs(view.columns ?? [], ownerTfLabel, scope, `${where}.columns`, diagnostics, fieldAddresses),
|
|
58
62
|
density: view.density ?? "STANDARD",
|
|
59
63
|
rows: view.rows ?? 25,
|
|
60
64
|
};
|
|
@@ -64,10 +68,12 @@ export function viewToTf(layouts, listViews, calendarViews, kanbanViews, dashboa
|
|
|
64
68
|
scope,
|
|
65
69
|
objectId,
|
|
66
70
|
diagnostics,
|
|
71
|
+
resolvePicklistLiterals: false,
|
|
72
|
+
fieldAddresses,
|
|
67
73
|
});
|
|
68
74
|
}
|
|
69
75
|
if (view.sort !== undefined)
|
|
70
|
-
attrs.sort = managedViewSortToTf(view.sort, ownerTfLabel, scope, `${where}.sort`, diagnostics);
|
|
76
|
+
attrs.sort = managedViewSortToTf(view.sort, ownerTfLabel, scope, `${where}.sort`, diagnostics, fieldAddresses);
|
|
71
77
|
appendViewSharingAttrs(attrs, view, where, principalCtx);
|
|
72
78
|
blocks.push({ kind: "resource", type: LIST_VIEW_RESOURCE_TYPE, label: tfLabel, attrs });
|
|
73
79
|
viewAddressByKey.set(viewKey, { type: LIST_VIEW_RESOURCE_TYPE, label: tfLabel });
|
|
@@ -91,23 +97,23 @@ export function viewToTf(layouts, listViews, calendarViews, kanbanViews, dashboa
|
|
|
91
97
|
aspect_id: objectId,
|
|
92
98
|
name: view.name ?? "",
|
|
93
99
|
allow_record_creation: view.allowRecordCreation ?? true,
|
|
94
|
-
columns: resolveFieldRefs(view.columns ?? [], ownerTfLabel, scope, `${where}.columns`, diagnostics),
|
|
100
|
+
columns: resolveFieldRefs(view.columns ?? [], ownerTfLabel, scope, `${where}.columns`, diagnostics, fieldAddresses),
|
|
95
101
|
};
|
|
96
102
|
if (view.displayByField !== undefined) {
|
|
97
|
-
const displayBy = fieldRefToTfValue(view.displayByField, ownerTfLabel, scope, `${where}.displayByField`, diagnostics);
|
|
103
|
+
const displayBy = fieldRefToTfValue(view.displayByField, ownerTfLabel, scope, `${where}.displayByField`, diagnostics, fieldAddresses);
|
|
98
104
|
if (displayBy !== undefined)
|
|
99
105
|
attrs["display_by_field"] = displayBy;
|
|
100
106
|
}
|
|
101
107
|
if (resourceType === KANBAN_VIEW_RESOURCE_TYPE) {
|
|
102
108
|
const allowed = view.allowedFilterFields;
|
|
103
109
|
if (allowed !== undefined) {
|
|
104
|
-
attrs["allowed_filter_fields"] = resolveFieldRefs(allowed, ownerTfLabel, scope, `${where}.allowedFilterFields`, diagnostics);
|
|
110
|
+
attrs["allowed_filter_fields"] = resolveFieldRefs(allowed, ownerTfLabel, scope, `${where}.allowedFilterFields`, diagnostics, fieldAddresses);
|
|
105
111
|
}
|
|
106
112
|
}
|
|
107
113
|
if (view.filter !== undefined)
|
|
108
|
-
attrs["filter"] = filterToTf(view.filter, `${where}.filter`, { ownerTfLabel, scope, objectId, diagnostics });
|
|
114
|
+
attrs["filter"] = filterToTf(view.filter, `${where}.filter`, { ownerTfLabel, scope, objectId, diagnostics, resolvePicklistLiterals: false, fieldAddresses });
|
|
109
115
|
if (view.sort !== undefined)
|
|
110
|
-
attrs["sort"] = managedViewSortToTf(view.sort, ownerTfLabel, scope, `${where}.sort`, diagnostics);
|
|
116
|
+
attrs["sort"] = managedViewSortToTf(view.sort, ownerTfLabel, scope, `${where}.sort`, diagnostics, fieldAddresses);
|
|
111
117
|
appendViewSharingAttrs(attrs, view, where, principalCtx);
|
|
112
118
|
blocks.push({ kind: "resource", type: resourceType, label: tfLabel, attrs });
|
|
113
119
|
viewAddressByKey.set(viewKey, { type: resourceType, label: tfLabel });
|
|
@@ -147,9 +153,9 @@ export function viewToTf(layouts, listViews, calendarViews, kanbanViews, dashboa
|
|
|
147
153
|
allow_record_creation: view.allowRecordCreation ?? true,
|
|
148
154
|
};
|
|
149
155
|
if (view.filter !== undefined)
|
|
150
|
-
attrs["filter"] = filterToTf(view.filter, `dashboardViews.${viewKey}.filter`, { ownerTfLabel, scope, objectId, diagnostics });
|
|
156
|
+
attrs["filter"] = filterToTf(view.filter, `dashboardViews.${viewKey}.filter`, { ownerTfLabel, scope, objectId, diagnostics, resolvePicklistLiterals: false, fieldAddresses });
|
|
151
157
|
if (view.sort !== undefined)
|
|
152
|
-
attrs["sort"] = managedViewSortToTf(view.sort, ownerTfLabel, scope, `dashboardViews.${viewKey}.sort`, diagnostics);
|
|
158
|
+
attrs["sort"] = managedViewSortToTf(view.sort, ownerTfLabel, scope, `dashboardViews.${viewKey}.sort`, diagnostics, fieldAddresses);
|
|
153
159
|
appendViewSharingAttrs(attrs, view, `dashboardViews.${viewKey}`, principalCtx);
|
|
154
160
|
blocks.push({ kind: "resource", type: DASHBOARD_VIEW_RESOURCE_TYPE, label: tfLabel, attrs });
|
|
155
161
|
viewAddressByKey.set(viewKey, { type: DASHBOARD_VIEW_RESOURCE_TYPE, label: tfLabel });
|
|
@@ -180,9 +186,9 @@ export function viewToTf(layouts, listViews, calendarViews, kanbanViews, dashboa
|
|
|
180
186
|
allow_record_creation: view.allowRecordCreation ?? true,
|
|
181
187
|
};
|
|
182
188
|
if (view.filter !== undefined)
|
|
183
|
-
attrs["filter"] = filterToTf(view.filter, `agentViews.${viewKey}.filter`, { ownerTfLabel, scope, objectId, diagnostics });
|
|
189
|
+
attrs["filter"] = filterToTf(view.filter, `agentViews.${viewKey}.filter`, { ownerTfLabel, scope, objectId, diagnostics, resolvePicklistLiterals: false, fieldAddresses });
|
|
184
190
|
if (view.sort !== undefined)
|
|
185
|
-
attrs["sort"] = managedViewSortToTf(view.sort, ownerTfLabel, scope, `agentViews.${viewKey}.sort`, diagnostics);
|
|
191
|
+
attrs["sort"] = managedViewSortToTf(view.sort, ownerTfLabel, scope, `agentViews.${viewKey}.sort`, diagnostics, fieldAddresses);
|
|
186
192
|
appendViewSharingAttrs(attrs, view, `agentViews.${viewKey}`, principalCtx);
|
|
187
193
|
if (view.displayOrder !== undefined)
|
|
188
194
|
attrs["display_order"] = view.displayOrder;
|
|
@@ -228,10 +234,10 @@ export function viewToTf(layouts, listViews, calendarViews, kanbanViews, dashboa
|
|
|
228
234
|
}
|
|
229
235
|
return { blocks };
|
|
230
236
|
}
|
|
231
|
-
function managedViewSortToTf(sort, ownerTfLabel, scope, where, diagnostics) {
|
|
237
|
+
function managedViewSortToTf(sort, ownerTfLabel, scope, where, diagnostics, fieldAddresses) {
|
|
232
238
|
const orders = [];
|
|
233
239
|
for (const [index, order] of sort.orders.entries()) {
|
|
234
|
-
const field = fieldRefToTfValue(order.field, ownerTfLabel, scope, `${where}.orders[${index}].field`, diagnostics);
|
|
240
|
+
const field = fieldRefToTfValue(order.field, ownerTfLabel, scope, `${where}.orders[${index}].field`, diagnostics, fieldAddresses);
|
|
235
241
|
if (field === undefined)
|
|
236
242
|
continue;
|
|
237
243
|
orders.push({
|
|
@@ -242,7 +248,7 @@ function managedViewSortToTf(sort, ownerTfLabel, scope, where, diagnostics) {
|
|
|
242
248
|
}
|
|
243
249
|
return expr.jsonencode({ orders });
|
|
244
250
|
}
|
|
245
|
-
function layoutToTf(stageKey, layout, ownerTfLabel, scope, objectId, diagnostics) {
|
|
251
|
+
function layoutToTf(stageKey, layout, ownerTfLabel, scope, objectId, diagnostics, fieldAddresses) {
|
|
246
252
|
const sections = [];
|
|
247
253
|
for (const section of layout.sections) {
|
|
248
254
|
const authoringType = section.type ?? "group";
|
|
@@ -279,7 +285,7 @@ function layoutToTf(stageKey, layout, ownerTfLabel, scope, objectId, diagnostics
|
|
|
279
285
|
}
|
|
280
286
|
return true;
|
|
281
287
|
});
|
|
282
|
-
sec.field_ids = resolveFieldRefs(fields, ownerTfLabel, scope, where, diagnostics);
|
|
288
|
+
sec.field_ids = resolveFieldRefs(fields, ownerTfLabel, scope, where, diagnostics, fieldAddresses);
|
|
283
289
|
}
|
|
284
290
|
else if (wireType === UPDATE_SECTION_WIRE_TYPE && section.name !== undefined) {
|
|
285
291
|
sec.name = section.name;
|
|
@@ -293,27 +299,33 @@ function layoutToTf(stageKey, layout, ownerTfLabel, scope, objectId, diagnostics
|
|
|
293
299
|
// address ei never produced) and index the map with a key that doesn't
|
|
294
300
|
// exist, breaking every plan.
|
|
295
301
|
const tfLabel = tsLabelToTfLabel(stageKey);
|
|
302
|
+
const attrs = { object_id: objectId, sections };
|
|
303
|
+
// Elements carry no `stages`/`stage_ids_by_key` at all (unlike apps) — they
|
|
304
|
+
// only ever have the platform's single auto-created Initiate stage.
|
|
305
|
+
// `elementum_layout.stage_id` is Optional+Computed; omitting it lets the
|
|
306
|
+
// provider's own Initiate-stage resolution (`fetchInitiateStageID`) fill it
|
|
307
|
+
// in, instead of referencing a `<ownerTfLabel>_stage_ids_by_key` local that
|
|
308
|
+
// `element/locals.ts` never defines.
|
|
309
|
+
if (scope !== "element") {
|
|
310
|
+
attrs["stage_id"] = expr.local(`${ownerTfLabel}_stage_ids_by_key`, [{ index: tfLabel }]);
|
|
311
|
+
}
|
|
296
312
|
return {
|
|
297
313
|
kind: "resource",
|
|
298
314
|
type: LAYOUT_RESOURCE_TYPE,
|
|
299
315
|
label: scopedResourceLabel(ownerTfLabel, tfLabel, scope),
|
|
300
|
-
attrs
|
|
301
|
-
object_id: objectId,
|
|
302
|
-
stage_id: expr.local(`${ownerTfLabel}_stage_ids_by_key`, [{ index: tfLabel }]),
|
|
303
|
-
sections,
|
|
304
|
-
},
|
|
316
|
+
attrs,
|
|
305
317
|
};
|
|
306
318
|
}
|
|
307
|
-
function resolveFieldRefs(refs, ownerTfLabel, scope, where, diagnostics) {
|
|
319
|
+
function resolveFieldRefs(refs, ownerTfLabel, scope, where, diagnostics, fieldAddresses) {
|
|
308
320
|
const out = [];
|
|
309
321
|
for (const ref of refs) {
|
|
310
|
-
const resolved = fieldRefToTfValue(ref, ownerTfLabel, scope, where, diagnostics);
|
|
322
|
+
const resolved = fieldRefToTfValue(ref, ownerTfLabel, scope, where, diagnostics, fieldAddresses);
|
|
311
323
|
if (resolved !== undefined)
|
|
312
324
|
out.push(resolved);
|
|
313
325
|
}
|
|
314
326
|
return out;
|
|
315
327
|
}
|
|
316
|
-
function fieldRefToTfValue(ref, ownerTfLabel, scope, where, diagnostics) {
|
|
328
|
+
function fieldRefToTfValue(ref, ownerTfLabel, scope, where, diagnostics, fieldAddresses) {
|
|
317
329
|
if (typeof ref === "object" && ref !== null && "__unsafe" in ref) {
|
|
318
330
|
if (ref.__unsafe === "platformId")
|
|
319
331
|
return ref.value;
|
|
@@ -337,13 +349,20 @@ function fieldRefToTfValue(ref, ownerTfLabel, scope, where, diagnostics) {
|
|
|
337
349
|
return undefined;
|
|
338
350
|
}
|
|
339
351
|
const refName = ref.refName ?? "";
|
|
340
|
-
if (!SUB_TYPE_BY_AUTHORING_TYPE.has(ref.fieldType ?? "")) {
|
|
341
|
-
diagnostics.push(`${where}: field "${refName}" (type ${ref.fieldType ?? "?"}) has no terraform field resource mapping; dropped`);
|
|
342
|
-
return undefined;
|
|
343
|
-
}
|
|
344
352
|
if (!isCanonicalTsLabel(refName)) {
|
|
345
353
|
diagnostics.push(`${where}: field bag key "${refName}" is not a canonical tsLabel; dropped`);
|
|
346
354
|
return undefined;
|
|
347
355
|
}
|
|
348
|
-
|
|
356
|
+
const knownAddress = fieldAddresses?.get(refName);
|
|
357
|
+
if (knownAddress !== undefined) {
|
|
358
|
+
const dotIndex = knownAddress.indexOf(".");
|
|
359
|
+
if (dotIndex !== -1) {
|
|
360
|
+
return expr.resourceAttr(knownAddress.slice(0, dotIndex), knownAddress.slice(dotIndex + 1), ["id"]);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (!SUB_TYPE_BY_AUTHORING_TYPE.has(ref.fieldType ?? "")) {
|
|
364
|
+
diagnostics.push(`${where}: field "${refName}" (type ${ref.fieldType ?? "?"}) has no terraform field resource mapping; dropped`);
|
|
365
|
+
return undefined;
|
|
366
|
+
}
|
|
367
|
+
return customFieldRefToTfValue(ref.fieldType, refName, ownerTfLabel, scope, fieldAddresses);
|
|
349
368
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EntityTfError } from "../../engine/entity.js";
|
|
2
2
|
import { plainObject, resourceRefLabel } from "../../engine/pull/context.js";
|
|
3
3
|
import { isTfExpr, scopedLabelToBagKey, tfLabelToTsLabel } from "../../engine/tf/index.js";
|
|
4
|
+
import { dataAspectDisplayName, dataAspectRefName } from "../shared/aspect-target-from-tf.js";
|
|
4
5
|
import { VISUAL_FLOW_RESOURCE_TYPE } from "./module.js";
|
|
5
6
|
const KNOWN = new Set(["id", "object_id", "stages"]);
|
|
6
7
|
const symbols = new Set(["SQUARE", "DIAMOND", "CIRCLE"]);
|
|
@@ -28,8 +29,11 @@ function objectRef(value, ctx, where) {
|
|
|
28
29
|
throw new EntityTfError(`${where}: expected an elementum_app or elementum_element reference`);
|
|
29
30
|
}
|
|
30
31
|
const kind = value.type === "elementum_element" ? "element" : "app";
|
|
31
|
-
const
|
|
32
|
-
|
|
32
|
+
const displayName = value.$expr === "data-attr" ? dataAspectDisplayName(ctx, kind, value.label) : undefined;
|
|
33
|
+
const refName = value.$expr === "data-attr"
|
|
34
|
+
? dataAspectRefName(ctx, kind, value.label, displayName) ?? tfLabelToTsLabel(value.label)
|
|
35
|
+
: tfLabelToTsLabel(value.label);
|
|
36
|
+
return { kind, refName, name: displayName ?? refName };
|
|
33
37
|
}
|
|
34
38
|
function actionFromTf(value, ownerLabel, scope, ctx, where) {
|
|
35
39
|
const action = requiredObject(value, where);
|
|
@@ -55,8 +55,8 @@ function widgetFromTf(block, owner, ctx) {
|
|
|
55
55
|
if (target === undefined)
|
|
56
56
|
return undefined;
|
|
57
57
|
const filterOwner = typeof target !== "string" && (target.kind === "app" || target.kind === "element")
|
|
58
|
-
? { type: `elementum_${target.kind}`, label: target.key, ownerRefName: target.key, ownerTfLabel: target.key, scope: target.kind }
|
|
59
|
-
: { type: owner.type, label: owner.label, ownerRefName: owner.ownerRefName, ownerTfLabel: owner.ownerTfLabel, scope: owner.scope };
|
|
58
|
+
? { type: `elementum_${target.kind}`, label: target.key, ownerRefName: target.key, ownerTfLabel: target.key, scope: target.kind, foreignFieldRefsById: ctx.foreignFieldRefsById }
|
|
59
|
+
: { type: owner.type, label: owner.label, ownerRefName: owner.ownerRefName, ownerTfLabel: owner.ownerTfLabel, scope: owner.scope, foreignFieldRefsById: ctx.foreignFieldRefsById };
|
|
60
60
|
const filter = body["filter"] === undefined
|
|
61
61
|
? undefined
|
|
62
62
|
: filterFromTf(body["filter"], filterOwner, `${where}.${variant}.filter`);
|
|
@@ -40,6 +40,7 @@ export interface WidgetsToTfOptions {
|
|
|
40
40
|
readonly orgRefs: OrgRefLookup;
|
|
41
41
|
readonly workspaceAspects?: ReadonlyMap<string, WorkspaceAspect>;
|
|
42
42
|
readonly diagnostics: string[];
|
|
43
|
+
readonly fieldAddresses?: ReadonlyMap<string, string>;
|
|
43
44
|
}
|
|
44
45
|
export declare function widgetsToTf(widgets: Readonly<Record<string, AppWidgetWire>> | undefined, opts: WidgetsToTfOptions): TfBlock[];
|
|
45
46
|
export {};
|
|
@@ -20,9 +20,10 @@ export function widgetsToTf(widgets, opts) {
|
|
|
20
20
|
if (target === undefined)
|
|
21
21
|
continue;
|
|
22
22
|
const body = { name: widget.name ?? "", object_id: target.value };
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
// Always emitted, even empty — the provider schema treats columns as
|
|
24
|
+
// always-present on related-object/related-link widgets, so omitting
|
|
25
|
+
// it when empty diffs against ei's own export (see hcl_widget.go).
|
|
26
|
+
body["columns"] = resolveColumns(widget.columns, target, `${where}.columns`, opts);
|
|
26
27
|
if (widget.rows !== undefined)
|
|
27
28
|
body["rows"] = widget.rows;
|
|
28
29
|
attrs["related_object"] = body;
|
|
@@ -34,9 +35,10 @@ export function widgetsToTf(widgets, opts) {
|
|
|
34
35
|
continue;
|
|
35
36
|
const body = buttonBody(widget);
|
|
36
37
|
body["object_id"] = target.value;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
// Always emitted, even empty — the provider schema treats columns as
|
|
39
|
+
// always-present on related-object/related-link widgets, so omitting
|
|
40
|
+
// it when empty diffs against ei's own export (see hcl_widget.go).
|
|
41
|
+
body["columns"] = resolveColumns(widget.columns, target, `${where}.columns`, opts);
|
|
40
42
|
if (widget.rows !== undefined)
|
|
41
43
|
body["rows"] = widget.rows;
|
|
42
44
|
if (widget.filter !== undefined)
|
|
@@ -65,22 +67,9 @@ export function widgetsToTf(widgets, opts) {
|
|
|
65
67
|
continue;
|
|
66
68
|
const body = buttonBody(widget);
|
|
67
69
|
body["automation_id"] = automationId;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (fieldId !== undefined && parameter.value !== undefined) {
|
|
72
|
-
opts.diagnostics.push(`${where}.parameters[${index}]: field and value are mutually exclusive; value dropped`);
|
|
73
|
-
}
|
|
74
|
-
return {
|
|
75
|
-
name: parameter.name ?? "",
|
|
76
|
-
field_type: parameter.fieldType ?? "TEXT",
|
|
77
|
-
multiple: parameter.multiple ?? false,
|
|
78
|
-
required: parameter.required ?? false,
|
|
79
|
-
field_id: fieldId ?? null,
|
|
80
|
-
value: fieldId === undefined ? parameter.value ?? null : null,
|
|
81
|
-
};
|
|
82
|
-
});
|
|
83
|
-
}
|
|
70
|
+
const parameters = runAutomationParameters(widget, where, opts);
|
|
71
|
+
if (parameters.length > 0)
|
|
72
|
+
body["parameters"] = parameters;
|
|
84
73
|
attrs["run_automation_action"] = body;
|
|
85
74
|
break;
|
|
86
75
|
}
|
|
@@ -175,6 +164,46 @@ function resolveColumns(columns, target, where, opts) {
|
|
|
175
164
|
}
|
|
176
165
|
return out;
|
|
177
166
|
}
|
|
167
|
+
function runAutomationParameters(widget, where, opts) {
|
|
168
|
+
const authored = (widget.parameters ?? []).map((parameter, index) => {
|
|
169
|
+
const fieldId = resolveOwnerField(parameter.field, `${where}.parameters[${index}].field`, opts);
|
|
170
|
+
if (fieldId !== undefined && parameter.value !== undefined) {
|
|
171
|
+
opts.diagnostics.push(`${where}.parameters[${index}]: field and value are mutually exclusive; value dropped`);
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
name: parameter.name ?? "",
|
|
175
|
+
field_type: parameter.fieldType ?? "TEXT",
|
|
176
|
+
multiple: parameter.multiple ?? false,
|
|
177
|
+
required: parameter.required ?? false,
|
|
178
|
+
field_id: fieldId ?? null,
|
|
179
|
+
value: fieldId === undefined ? parameter.value ?? null : null,
|
|
180
|
+
};
|
|
181
|
+
});
|
|
182
|
+
const recordParam = onDemandRecordParamForWidget(widget.automation, opts);
|
|
183
|
+
if (recordParam === undefined || authored.some((parameter) => parameter.name === recordParam)) {
|
|
184
|
+
return authored;
|
|
185
|
+
}
|
|
186
|
+
return [
|
|
187
|
+
...authored,
|
|
188
|
+
{
|
|
189
|
+
name: recordParam,
|
|
190
|
+
field_type: "ASPECT_RECORD",
|
|
191
|
+
multiple: false,
|
|
192
|
+
required: false,
|
|
193
|
+
field_id: null,
|
|
194
|
+
value: "CURRENT_RECORD",
|
|
195
|
+
},
|
|
196
|
+
];
|
|
197
|
+
}
|
|
198
|
+
function onDemandRecordParamForWidget(automation, opts) {
|
|
199
|
+
if (typeof automation === "string" || automation?.refName === undefined || automation.refName === "") {
|
|
200
|
+
return undefined;
|
|
201
|
+
}
|
|
202
|
+
return opts.workspaceAspects
|
|
203
|
+
?.get(workspaceAspectKey(opts.scope, opts.ownerRefName))
|
|
204
|
+
?.onDemandRecordParamByAutomationRefName
|
|
205
|
+
?.get(automation.refName);
|
|
206
|
+
}
|
|
178
207
|
function resolveAutomation(value, where, opts) {
|
|
179
208
|
if (typeof value === "string")
|
|
180
209
|
return value;
|
|
@@ -199,7 +228,7 @@ function resolveOwnerField(value, where, opts) {
|
|
|
199
228
|
opts.diagnostics.push(`${where}: field belongs to a different aspect; dropped`);
|
|
200
229
|
return undefined;
|
|
201
230
|
}
|
|
202
|
-
const resolved = fieldRefToTfValue(value.fieldType ?? "", refName, opts.ownerTfLabel, opts.scope);
|
|
231
|
+
const resolved = fieldRefToTfValue(value.fieldType ?? "", refName, opts.ownerTfLabel, opts.scope, opts.fieldAddresses);
|
|
203
232
|
if (resolved === undefined)
|
|
204
233
|
opts.diagnostics.push(`${where}: field ${JSON.stringify(refName)} has no Terraform mapping; dropped`);
|
|
205
234
|
return resolved;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Public graph barrel: KIND_MODULES + derived views for pull/build/canvas.
|
|
3
3
|
*/
|
|
4
4
|
import { type CatalogRenderArgs, type CatalogRenderResult, type EntityKindModule, type KindId, type ParentEdge, matchType } from "./types.js";
|
|
5
|
-
export type { AuthoringFacet, CanvasComponentId, CanvasFacet, CanvasView, CatalogAuthoringArgs, CatalogFacet, CatalogRenderArgs, CatalogRenderResult, CatalogRoot, DataFacet, DataFacetCatalogKind, EntityKindId, EntityKindModule, KindId, LifecycleFacet, OrgIdentityBag, ParentEdge, ParentageFacet, ResourceFacet, StreamFacet, StreamMatch, StreamPartition, StreamRootExtractResult, ToTfResult, } from "./types.js";
|
|
5
|
+
export type { AdoptionAddressAlias, AuthoringFacet, CanvasComponentId, CanvasFacet, CanvasView, CatalogAuthoringArgs, CatalogFacet, CatalogRenderArgs, CatalogRenderResult, CatalogRoot, DataFacet, DataFacetCatalogKind, EntityKindId, EntityKindModule, KindId, LifecycleFacet, OrgIdentityBag, ParentEdge, ParentageFacet, ResourceFacet, StreamFacet, StreamMatch, StreamPartition, StreamRootExtractResult, ToTfResult, } from "./types.js";
|
|
6
6
|
export type { ReferenceLookupStrategy } from "./types.js";
|
|
7
7
|
export { NO_CANVAS, NO_CATALOG, NO_DATA, NO_LIFECYCLE, defaultMatchResourceType, implementedResourceTypes, isResourceAdoptable, isTfLive, knownResourceTypes, matchType, singleResourceType, } from "./types.js";
|
|
8
8
|
export { KIND_MODULES } from "./modules.js";
|
|
@@ -62,6 +62,24 @@ export declare const ENTITY_KIND_BY_ID: ReadonlyMap<KindId, EntityKindModule>;
|
|
|
62
62
|
export declare const TYPE_TO_KIND: ReadonlyMap<string, EntityKindModule>;
|
|
63
63
|
/** Stream-root kinds (app, element, …). */
|
|
64
64
|
export declare const STREAM_ROOT_MODULES: readonly EntityKindModule[];
|
|
65
|
+
/**
|
|
66
|
+
* Every stream-root kind's own resource type (`elementum_app`,
|
|
67
|
+
* `elementum_element`, …) — lets engine code recognize "this is a stream
|
|
68
|
+
* root" generically, without hardcoding one kind's resource type (see
|
|
69
|
+
* `engine/pull/system-field-state.ts`'s state-backed system-field lookup,
|
|
70
|
+
* which the app path used to own alone before it generalized to cover
|
|
71
|
+
* element-owned system fields too).
|
|
72
|
+
*/
|
|
73
|
+
export declare const STREAM_ROOT_RESOURCE_TYPES: ReadonlySet<string>;
|
|
74
|
+
/**
|
|
75
|
+
* Terraform resource type → canonical public authoring type, for every
|
|
76
|
+
* subTyped kind that populates `SubTypeRow.authoringType` (today: field's
|
|
77
|
+
* "USER"/"GROUP"/… discriminant). Lets engine code (e.g.
|
|
78
|
+
* field-refs-registry.ts's `bootstrapFromState`) resolve a resource type to
|
|
79
|
+
* its authoring type generically, without naming the kind or importing
|
|
80
|
+
* entities/ directly.
|
|
81
|
+
*/
|
|
82
|
+
export declare const AUTHORING_TYPE_BY_RESOURCE_TYPE: ReadonlyMap<string, string>;
|
|
65
83
|
/** Own-file children of a parent kind (build discovery + pull print paths). */
|
|
66
84
|
export declare function ownFileChildrenOf(parent: KindId): readonly EntityKindModule[];
|
|
67
85
|
/**
|
|
@@ -78,6 +78,26 @@ export const TYPE_TO_KIND = (() => {
|
|
|
78
78
|
})();
|
|
79
79
|
/** Stream-root kinds (app, element, …). */
|
|
80
80
|
export const STREAM_ROOT_MODULES = KIND_MODULES.filter((m) => m.stream.role === "streamRoot");
|
|
81
|
+
/**
|
|
82
|
+
* Every stream-root kind's own resource type (`elementum_app`,
|
|
83
|
+
* `elementum_element`, …) — lets engine code recognize "this is a stream
|
|
84
|
+
* root" generically, without hardcoding one kind's resource type (see
|
|
85
|
+
* `engine/pull/system-field-state.ts`'s state-backed system-field lookup,
|
|
86
|
+
* which the app path used to own alone before it generalized to cover
|
|
87
|
+
* element-owned system fields too).
|
|
88
|
+
*/
|
|
89
|
+
export const STREAM_ROOT_RESOURCE_TYPES = new Set(STREAM_ROOT_MODULES.flatMap((m) => knownResourceTypes(m.resource)));
|
|
90
|
+
/**
|
|
91
|
+
* Terraform resource type → canonical public authoring type, for every
|
|
92
|
+
* subTyped kind that populates `SubTypeRow.authoringType` (today: field's
|
|
93
|
+
* "USER"/"GROUP"/… discriminant). Lets engine code (e.g.
|
|
94
|
+
* field-refs-registry.ts's `bootstrapFromState`) resolve a resource type to
|
|
95
|
+
* its authoring type generically, without naming the kind or importing
|
|
96
|
+
* entities/ directly.
|
|
97
|
+
*/
|
|
98
|
+
export const AUTHORING_TYPE_BY_RESOURCE_TYPE = new Map(KIND_MODULES.flatMap((m) => m.resource.shape === "subTypes"
|
|
99
|
+
? m.resource.rows.flatMap((row) => (row.authoringType === undefined ? [] : [[row.resourceType, row.authoringType]]))
|
|
100
|
+
: []));
|
|
81
101
|
/** Own-file children of a parent kind (build discovery + pull print paths). */
|
|
82
102
|
export function ownFileChildrenOf(parent) {
|
|
83
103
|
return KIND_MODULES.filter((m) => m.authoring.unit === "ownFile" &&
|
|
@@ -50,6 +50,15 @@ export interface SubTypeRow {
|
|
|
50
50
|
readonly label: string;
|
|
51
51
|
readonly glyph?: string;
|
|
52
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* Canonical public authoring type this resource type normalizes to (e.g.
|
|
55
|
+
* field's "USER"/"GROUP"). Optional — most subTyped kinds have no such
|
|
56
|
+
* discriminant; kinds that do (today: field) populate it so engine code
|
|
57
|
+
* can resolve a resource type to its authoring type generically, without
|
|
58
|
+
* naming the kind or importing entities/ (see field-refs-registry.ts's
|
|
59
|
+
* `bootstrapFromState`).
|
|
60
|
+
*/
|
|
61
|
+
readonly authoringType?: string;
|
|
53
62
|
}
|
|
54
63
|
export interface CompositeMember {
|
|
55
64
|
readonly role: string;
|
|
@@ -243,6 +252,12 @@ export interface OwnFileExtractResult {
|
|
|
243
252
|
readonly items: readonly unknown[];
|
|
244
253
|
readonly skipped: readonly string[];
|
|
245
254
|
readonly diagnostics: readonly string[];
|
|
255
|
+
/** Export address → canonical address rebuilt by the printed current API. */
|
|
256
|
+
readonly adoptionAddressAliases?: readonly AdoptionAddressAlias[];
|
|
257
|
+
}
|
|
258
|
+
export interface AdoptionAddressAlias {
|
|
259
|
+
readonly from: string;
|
|
260
|
+
readonly to: string;
|
|
246
261
|
}
|
|
247
262
|
export interface PrintedOwnFile {
|
|
248
263
|
readonly refName: string;
|
|
@@ -336,6 +351,7 @@ export interface BuildChildContext {
|
|
|
336
351
|
readonly parentScope?: ChildResourceScope | "table";
|
|
337
352
|
readonly orgRefs: unknown;
|
|
338
353
|
readonly diagnostics: string[];
|
|
354
|
+
readonly reports?: string[];
|
|
339
355
|
readonly fieldAddresses?: ReadonlyMap<string, string>;
|
|
340
356
|
readonly fieldNames?: ReadonlyMap<string, string>;
|
|
341
357
|
readonly fieldMetadata?: ReadonlyMap<string, BuildFieldMetadata>;
|
|
@@ -346,6 +362,8 @@ export interface BuildChildContext {
|
|
|
346
362
|
* catalog (#490).
|
|
347
363
|
*/
|
|
348
364
|
readonly fieldNamesByAppRefName?: ReadonlyMap<string, ReadonlyMap<string, string>>;
|
|
365
|
+
/** Pulled roots may retain picklist labels removed from the live field. */
|
|
366
|
+
readonly allowUnknownPicklistOptions?: boolean;
|
|
349
367
|
/** Every app/element/table stream root in this build, by refName (see `ToTfContext.workspaceAspects`). */
|
|
350
368
|
readonly workspaceAspects?: ReadonlyMap<string, {
|
|
351
369
|
readonly kind: ChildResourceScope | "table";
|
|
@@ -368,6 +386,8 @@ export interface BuildChildContext {
|
|
|
368
386
|
* cross-sibling disambiguation instead of emitting a colliding address.
|
|
369
387
|
*/
|
|
370
388
|
readonly siblingEntities?: readonly DeployableEntity[];
|
|
389
|
+
/** App-local automations whose workflow_publish block is emitted in this build. */
|
|
390
|
+
readonly activeAutomationRefNames?: ReadonlySet<string>;
|
|
371
391
|
/**
|
|
372
392
|
* The build's shared `locals.tf` attrs map, mutated in place — lets an
|
|
373
393
|
* own-file child (e.g. an automation referencing a foreign field) push a
|
|
@@ -426,6 +446,8 @@ export type LifecycleFacet = {
|
|
|
426
446
|
readonly extractOwnFile?: (ownBlocks: readonly TfBlock[], stream: StreamPartition, ctx: StreamExtractContext) => OwnFileExtractResult;
|
|
427
447
|
/** Print one extracted own-file instance to TypeScript source. */
|
|
428
448
|
readonly printOwnFile?: (item: unknown, opts: PrintOwnFileOptions) => PrintedOwnFile;
|
|
449
|
+
/** Re-pull: preserve author-owned values that the live export cannot represent. */
|
|
450
|
+
readonly mergePulledSource?: (freshSource: string, existingSource: string) => string;
|
|
429
451
|
/** Build: emit HCL for one discovered DeployableEntity. */
|
|
430
452
|
readonly toTf?: (entity: DeployableEntity, ctx: BuildChildContext) => ToTfResult;
|
|
431
453
|
/** Optional locals contribution after a root/own-file emit. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementumai/edk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.9",
|
|
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",
|
|
@@ -148,6 +148,8 @@
|
|
|
148
148
|
"scripts": {
|
|
149
149
|
"sync:version": "tsx src/scripts/sync-cli-version.ts",
|
|
150
150
|
"sync:skills": "tsx src/scripts/sync-skill-assets.ts",
|
|
151
|
+
"check:skills": "tsx src/scripts/sync-skill-assets.ts --check",
|
|
152
|
+
"clean:skills": "tsx src/scripts/sync-skill-assets.ts --clean",
|
|
151
153
|
"sync:compatibility": "tsx src/scripts/sync-compatibility.ts",
|
|
152
154
|
"check:release-context": "tsx src/scripts/release-context.ts v0.0.0 HEAD >/dev/null",
|
|
153
155
|
"fetch:schema": "make -C provider fetch-schema",
|
|
@@ -157,18 +159,20 @@
|
|
|
157
159
|
"build:sdk": "rm -rf dist-sdk && tsc -p tsconfig.sdk.json",
|
|
158
160
|
"build:cli": "npm run sync:version && npm run sync:skills && npm run sync:compatibility && rm -rf dist-cli && tsc -p tsconfig.cli.json",
|
|
159
161
|
"prebuild:provider": "npm run generate:graphql",
|
|
160
|
-
"build:provider": "go -C provider build
|
|
162
|
+
"build:provider": "go -C provider build .",
|
|
161
163
|
"prebuild:bridge": "npm run generate:graphql",
|
|
162
|
-
"build:bridge": "mkdir -p integration/.toolchain && go -C cmd/elementum build -
|
|
164
|
+
"build:bridge": "mkdir -p integration/.toolchain && go -C cmd/elementum build -o ../../integration/.toolchain/ei .",
|
|
163
165
|
"build:go": "npm run build:provider && npm run build:bridge",
|
|
164
166
|
"build:distribution": "npm --prefix distribution run build",
|
|
165
167
|
"version": "npm run sync:version && npm run sync:skills && git add src/cli/version.ts src/cli/skills-assets.ts skills/user/*/SKILL.md",
|
|
166
168
|
"build:binary:bun": "npm run build:cli && node dist-cli/src/scripts/build-bun-binary.js",
|
|
167
169
|
"build:binary:bun:all": "npm run build:cli && node dist-cli/src/scripts/build-bun-binary.js --all",
|
|
168
170
|
"local:setup": "bash integration/local-toolchain.sh",
|
|
171
|
+
"local:refresh": "npm run build:sdk && npm run build:binary:bun",
|
|
169
172
|
"elementum": "bash integration/tools/elementum-local.sh",
|
|
170
173
|
"local:clone": "bash integration/tools/clone-golden.sh",
|
|
171
174
|
"smoke:binary:bun": "node dist-cli/src/scripts/smoke-bun-binary.js",
|
|
175
|
+
"smoke:binary:workspace": "node dist-cli/src/scripts/smoke-bun-binary.js --workspace-only",
|
|
172
176
|
"prepare": "husky || true",
|
|
173
177
|
"prepack": "npm run build:sdk",
|
|
174
178
|
"pack:dry-run": "npm pack --dry-run",
|
|
@@ -179,7 +183,9 @@
|
|
|
179
183
|
"test:runtime": "vitest run",
|
|
180
184
|
"check:parity": "tsx src/scripts/check-provider-parity.ts",
|
|
181
185
|
"pretest:provider": "npm run generate:graphql",
|
|
182
|
-
"test:provider": "go -C provider test -
|
|
186
|
+
"test:provider": "go -C provider test -timeout=120s -parallel=10 ./internal/...",
|
|
187
|
+
"pretest:provider:cover": "npm run generate:graphql",
|
|
188
|
+
"test:provider:cover": "go -C provider test -v -cover -timeout=120s -parallel=10 ./internal/...",
|
|
183
189
|
"pretest:bridge": "npm run generate:graphql",
|
|
184
190
|
"test:bridge": "go -C cmd/elementum test -v -timeout=30s ./...",
|
|
185
191
|
"test:backend-lock": "vitest run __tests__/integration/http-backend-lock.test.ts __tests__/integration/http-state-backend.test.ts",
|
|
@@ -187,7 +193,7 @@
|
|
|
187
193
|
"test:distribution": "npm --prefix distribution test",
|
|
188
194
|
"test:watch": "vitest",
|
|
189
195
|
"test:cli": "vitest run __tests__/cli",
|
|
190
|
-
"test:binary": "npm run build:binary:bun && npm run smoke:binary:bun",
|
|
196
|
+
"test:binary": "npm run build:sdk && npm run build:binary:bun && npm run smoke:binary:bun",
|
|
191
197
|
"test:integration": "node integration/run.mjs",
|
|
192
198
|
"typecheck": "npm run typecheck:ci",
|
|
193
199
|
"typecheck:ci": "tsc --noEmit -p tsconfig.ci.json && tsc --noEmit -p tsconfig.examples-check.json",
|