@elementumai/edk 0.9.5 → 0.9.7
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 +31 -1
- package/dist-sdk/src/catalog/factories.d.ts +12 -3
- package/dist-sdk/src/catalog/factories.js +9 -6
- package/dist-sdk/src/catalog/org.js +26 -13
- package/dist-sdk/src/catalog/types.d.ts +22 -1
- package/dist-sdk/src/core/index.d.ts +1 -1
- package/dist-sdk/src/core/system-fields.d.ts +4 -0
- package/dist-sdk/src/core/system-fields.js +15 -0
- package/dist-sdk/src/core/types/app.d.ts +14 -9
- package/dist-sdk/src/core/types/platform.d.ts +1 -1
- package/dist-sdk/src/engine/build/context.d.ts +4 -0
- package/dist-sdk/src/engine/pull/context.d.ts +9 -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/entities/access-policy/from-tf.js +14 -2
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +6 -0
- package/dist-sdk/src/entities/access-policy/to-tf.js +4 -1
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +18 -1
- package/dist-sdk/src/entities/agent/module.js +1 -0
- package/dist-sdk/src/entities/agent/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/agent/to-tf.js +1 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +9 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.js +10 -2
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +2 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.js +2 -3
- package/dist-sdk/src/entities/app/build.d.ts +42 -22
- package/dist-sdk/src/entities/app/build.js +12 -5
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +10 -0
- package/dist-sdk/src/entities/app/from-tf.js +71 -8
- 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 +16 -0
- package/dist-sdk/src/entities/automation/build.d.ts +31 -19
- package/dist-sdk/src/entities/automation/build.js +85 -7
- package/dist-sdk/src/entities/automation/catalog-render.js +5 -2
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +5 -3
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +26 -12
- package/dist-sdk/src/entities/automation/from-tf.js +364 -31
- package/dist-sdk/src/entities/automation/index.d.ts +1 -1
- package/dist-sdk/src/entities/automation/module.js +2 -2
- 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 +8 -0
- package/dist-sdk/src/entities/automation/output-key-wire-name.js +16 -0
- package/dist-sdk/src/entities/automation/script-code.js +153 -25
- package/dist-sdk/src/entities/automation/tasks.d.ts +100 -37
- package/dist-sdk/src/entities/automation/tasks.js +44 -43
- package/dist-sdk/src/entities/automation/to-tf.d.ts +3 -1
- package/dist-sdk/src/entities/automation/to-tf.js +454 -58
- 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/element/build.js +1 -0
- package/dist-sdk/src/entities/element/index.d.ts +2 -1
- package/dist-sdk/src/entities/element/index.js +2 -1
- 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.js +92 -1
- package/dist-sdk/src/entities/field/locals.js +6 -7
- 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 +12 -2
- package/dist-sdk/src/entities/field/to-tf.js +172 -51
- package/dist-sdk/src/entities/field/types.js +2 -0
- package/dist-sdk/src/entities/record-create-form/to-tf.js +5 -8
- package/dist-sdk/src/entities/relationship/from-tf.js +91 -9
- 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 +18 -1
- package/dist-sdk/src/entities/shared/filters/ast.js +1 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +6 -1
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +6 -4
- 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/platform.d.ts +15 -2
- 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 +44 -15
- package/dist-sdk/src/entities/skill/from-tf.js +11 -1
- package/dist-sdk/src/entities/skill/input-coverage.d.ts +68 -0
- package/dist-sdk/src/entities/skill/input-coverage.js +184 -0
- package/dist-sdk/src/entities/skill/module.js +2 -0
- package/dist-sdk/src/entities/skill/to-tf.d.ts +3 -0
- package/dist-sdk/src/entities/skill/to-tf.js +7 -2
- package/dist-sdk/src/entities/skill/tools.d.ts +10 -1
- package/dist-sdk/src/entities/skill/tools.js +0 -5
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +19 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.js +40 -11
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +4 -2
- package/dist-sdk/src/entities/skill-tool/to-tf.js +24 -16
- package/dist-sdk/src/entities/table/to-tf.js +18 -1
- package/dist-sdk/src/entities/view/to-tf.js +8 -3
- package/dist-sdk/src/entities/visual-flow/from-tf.js +6 -2
- package/dist-sdk/src/graph/types.d.ts +3 -0
- package/package.json +2 -1
|
@@ -4,9 +4,16 @@ import { renderCalculationExpression, } from "./calculation-expression.js";
|
|
|
4
4
|
import { extractScriptBody } from "./script-code.js";
|
|
5
5
|
function workflowFields(fields) {
|
|
6
6
|
return fields.map((f) => {
|
|
7
|
+
const updateMode = "updateMode" in f ? f.updateMode : undefined;
|
|
8
|
+
const fieldType = "fieldType" in f.field ? f.field.fieldType : undefined;
|
|
9
|
+
if (updateMode !== undefined && fieldType !== "MULTI_PICKLIST" && fieldType !== "MULTI_PICKLIST_ID") {
|
|
10
|
+
const fieldName = "name" in f.field ? f.field.name : f.field.value;
|
|
11
|
+
throw new Error(`updateMode is only supported for Multi-Select fields; received ${fieldType ?? "unresolved"} field "${fieldName}".`);
|
|
12
|
+
}
|
|
7
13
|
return {
|
|
8
14
|
aspectFieldId: f.field, // token → field id at deploy
|
|
9
15
|
valueReference: serializeValueOrRef(f.value),
|
|
16
|
+
...(updateMode === "add" ? { operation: "ADD" } : {}),
|
|
10
17
|
};
|
|
11
18
|
});
|
|
12
19
|
}
|
|
@@ -171,10 +178,22 @@ export function setVariable(opts) {
|
|
|
171
178
|
},
|
|
172
179
|
};
|
|
173
180
|
}
|
|
174
|
-
|
|
175
|
-
|
|
181
|
+
/** Split the authored `outputs` option into the root name and the properties. */
|
|
182
|
+
function normalizeScriptOutputs(outputs) {
|
|
183
|
+
const properties = outputs.properties;
|
|
184
|
+
if (typeof properties !== "object" || properties === null || Array.isArray(properties)) {
|
|
185
|
+
return { properties: outputs };
|
|
186
|
+
}
|
|
187
|
+
const name = outputs.name;
|
|
188
|
+
return {
|
|
189
|
+
...(typeof name === "string" && name !== "" ? { name } : {}),
|
|
190
|
+
properties: properties,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
/** Map an output schema to the platform's tagged object shape. */
|
|
176
194
|
function outputSchema(outputs) {
|
|
177
|
-
const properties =
|
|
195
|
+
const { name: rootName, properties: declared } = normalizeScriptOutputs(outputs);
|
|
196
|
+
const properties = Object.entries(declared).map(([name, type]) => {
|
|
178
197
|
switch (type) {
|
|
179
198
|
case "integer":
|
|
180
199
|
return { integer: { name } };
|
|
@@ -183,14 +202,13 @@ function outputSchema(outputs) {
|
|
|
183
202
|
return { number: { name } };
|
|
184
203
|
case "boolean":
|
|
185
204
|
return { bool: { name } };
|
|
205
|
+
case "object":
|
|
206
|
+
return { object: { name } };
|
|
186
207
|
default:
|
|
187
208
|
return { string: { name } };
|
|
188
209
|
}
|
|
189
210
|
});
|
|
190
|
-
|
|
191
|
-
// import read-back both DROP empty names — emitting name:"" would diff
|
|
192
|
-
// against both (adoption zero-change gate + build-vs-export).
|
|
193
|
-
return { object: { properties } };
|
|
211
|
+
return { object: { ...(rootName !== undefined ? { name: rootName } : {}), properties } };
|
|
194
212
|
}
|
|
195
213
|
/**
|
|
196
214
|
* Build the executeScript `ActionDef` from an ALREADY-RESOLVED body string.
|
|
@@ -402,8 +420,8 @@ export function notification(opts) {
|
|
|
402
420
|
...(opts.description !== undefined ? { description: opts.description } : {}),
|
|
403
421
|
...(opts.userIds?.length ? { userIds: opts.userIds } : {}),
|
|
404
422
|
...(opts.groupIds?.length ? { groupIds: opts.groupIds } : {}),
|
|
405
|
-
...(opts.userRefs !== undefined ? {
|
|
406
|
-
...(opts.groupRefs !== undefined ? {
|
|
423
|
+
...(opts.userRefs !== undefined ? { users: refList(opts.userRefs) } : {}),
|
|
424
|
+
...(opts.groupRefs !== undefined ? { groups: refList(opts.groupRefs) } : {}),
|
|
407
425
|
...(opts.notifyWatchers !== undefined ? { notifyWatchers: opts.notifyWatchers } : {}),
|
|
408
426
|
},
|
|
409
427
|
};
|
|
@@ -418,16 +436,14 @@ export function assignGroup(opts) {
|
|
|
418
436
|
return { key: "assignGroup", config: { fieldId: opts.field, groupId: opts.groupId } };
|
|
419
437
|
}
|
|
420
438
|
export function addWatcher(opts) {
|
|
421
|
-
if (!opts.userIds?.length && !opts.groupIds?.length
|
|
422
|
-
throw new Error("addWatcher requires at least one of: userIds
|
|
439
|
+
if (!opts.userIds?.length && !opts.groupIds?.length) {
|
|
440
|
+
throw new Error("addWatcher requires at least one of: userIds or groupIds.");
|
|
423
441
|
}
|
|
424
442
|
return {
|
|
425
443
|
key: "addWatcher",
|
|
426
444
|
config: {
|
|
427
445
|
...(opts.userIds?.length ? { userIds: opts.userIds } : {}),
|
|
428
446
|
...(opts.groupIds?.length ? { groupIds: opts.groupIds } : {}),
|
|
429
|
-
...(opts.userRefs !== undefined ? { userValueReferences: refList(opts.userRefs) } : {}),
|
|
430
|
-
...(opts.groupRefs !== undefined ? { groupValueReferences: refList(opts.groupRefs) } : {}),
|
|
431
447
|
...(opts.record !== undefined ? { recordReference: serializeValueOrRef(opts.record) } : {}),
|
|
432
448
|
},
|
|
433
449
|
};
|
|
@@ -672,20 +688,18 @@ export function approvalStatusUpdate(opts) {
|
|
|
672
688
|
};
|
|
673
689
|
}
|
|
674
690
|
export function runAutomation(opts) {
|
|
675
|
-
const
|
|
676
|
-
const
|
|
677
|
-
synchronous: opts.synchronous ?? false,
|
|
678
|
-
inputMappings: [],
|
|
679
|
-
dynamicInputMappings: hasInputs
|
|
680
|
-
? opts.inputs.map((i) => ({ name: i.name, value: serializeValueOrRef(i.value) }))
|
|
681
|
-
: [],
|
|
682
|
-
outputMappings: (opts.outputs ?? []).map((name) => ({ name })),
|
|
683
|
-
};
|
|
691
|
+
const inputs = opts.inputs ?? [];
|
|
692
|
+
const outputs = opts.outputs ?? [];
|
|
684
693
|
return {
|
|
685
694
|
key: "runAutomation",
|
|
686
|
-
config:
|
|
687
|
-
|
|
688
|
-
:
|
|
695
|
+
config: {
|
|
696
|
+
targetAutomationId: opts.automation,
|
|
697
|
+
synchronous: opts.synchronous ?? false,
|
|
698
|
+
...(inputs.length > 0
|
|
699
|
+
? { inputMappings: inputs.map((input) => ({ name: input.name, value: serializeValueOrRef(input.value) })) }
|
|
700
|
+
: {}),
|
|
701
|
+
...(outputs.length > 0 ? { outputMappings: outputs.map((name) => ({ name })) } : {}),
|
|
702
|
+
},
|
|
689
703
|
};
|
|
690
704
|
}
|
|
691
705
|
export function readFile(opts) {
|
|
@@ -719,33 +733,20 @@ export function bulkExcel(opts) {
|
|
|
719
733
|
};
|
|
720
734
|
}
|
|
721
735
|
export function approvalChain(opts) {
|
|
722
|
-
if (!opts.approverIds?.length && !opts.approvers?.length) {
|
|
723
|
-
throw new Error("approvalChain requires at least one approverId or approver.");
|
|
724
|
-
}
|
|
725
736
|
return {
|
|
726
737
|
key: "approvalChain",
|
|
727
738
|
config: {
|
|
728
|
-
|
|
729
|
-
|
|
739
|
+
approvalProcessId: opts.approvalProcess,
|
|
740
|
+
recordReference: serializeValueOrRef(opts.record),
|
|
741
|
+
requesterReference: serializeValueOrRef(opts.requester),
|
|
742
|
+
...(opts.approvers !== undefined ? { approverReferences: opts.approvers.map((a) => serializeValueOrRef(a)) } : {}),
|
|
730
743
|
...(opts.reason !== undefined ? { reason: serializeValueOrRef(opts.reason) } : {}),
|
|
731
744
|
...(opts.summary !== undefined ? { summary: serializeValueOrRef(opts.summary) } : {}),
|
|
732
745
|
},
|
|
733
746
|
};
|
|
734
747
|
}
|
|
735
748
|
export function approvalChainTemplate(opts) {
|
|
736
|
-
return
|
|
737
|
-
key: "approvalChainTemplate",
|
|
738
|
-
config: {
|
|
739
|
-
approvalChainTemplateId: opts.approvalChainTemplateId,
|
|
740
|
-
requesterId: serializeValueOrRef(opts.requester),
|
|
741
|
-
recordId: serializeValueOrRef(opts.record),
|
|
742
|
-
...(opts.summary !== undefined ? { summary: serializeValueOrRef(opts.summary) } : {}),
|
|
743
|
-
...(opts.reason !== undefined ? { reason: serializeValueOrRef(opts.reason) } : {}),
|
|
744
|
-
...(opts.relatedRecord !== undefined ? { relatedRecordId: serializeValueOrRef(opts.relatedRecord) } : {}),
|
|
745
|
-
...(opts.tags !== undefined ? { tags: serializeValueOrRef(opts.tags) } : {}),
|
|
746
|
-
...(opts.dynamicApprovers !== undefined ? { dynamicApprovers: opts.dynamicApprovers } : {}),
|
|
747
|
-
},
|
|
748
|
-
};
|
|
749
|
+
return approvalChain(opts);
|
|
749
750
|
}
|
|
750
751
|
export function sendSurvey(opts) {
|
|
751
752
|
if (!opts.userIds?.length && !opts.groupIds?.length) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DeployableEntity } from "../../engine/entity.js";
|
|
2
|
-
import { type TfBlock, type TfValue } from "../../engine/tf/index.js";
|
|
2
|
+
import { type TfBlock, type TfExpr, type TfValue } from "../../engine/tf/index.js";
|
|
3
3
|
import { type OrgRefLookup, type WorkspaceAspect } from "../../engine/build/context.js";
|
|
4
4
|
import type { BuildFieldMetadata } from "../../graph/types.js";
|
|
5
5
|
import type { AppServiceAccount } from "../service-account/build.js";
|
|
@@ -56,5 +56,7 @@ export interface AutomationToTfResult {
|
|
|
56
56
|
readonly blocks: readonly TfBlock[];
|
|
57
57
|
readonly address: string;
|
|
58
58
|
}
|
|
59
|
+
/** Run-automation targets reference publish for ACTIVE automations, automation for draft/inactive. */
|
|
60
|
+
export declare function automationRunTargetResourceAttr(appTfLabel: string, automationRefName: string, activeAutomationRefNames: ReadonlySet<string> | undefined): TfExpr;
|
|
59
61
|
/** App- or element-owned `automation` entity → provider HCL blocks. */
|
|
60
62
|
export declare function automationToTf(entity: DeployableEntity, ctx: AutomationToTfContext): AutomationToTfResult;
|