@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
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { serializeValueOrRef } from "../../core/wire/ref-serializer.js";
|
|
2
2
|
import { isExpr } from "../field/calc/runtime.js";
|
|
3
|
+
import { isRef } from "../shared/ref.js";
|
|
3
4
|
import { renderCalculationExpression, } from "./calculation-expression.js";
|
|
4
5
|
import { extractScriptBody, isScriptFile, readScriptFile, toPlatformScriptBody } from "./script-code.js";
|
|
5
6
|
function workflowFields(fields) {
|
|
6
|
-
return fields.map((f) => {
|
|
7
|
+
return fields.map((f, index) => {
|
|
8
|
+
if (typeof f.field !== "object" || f.field === null) {
|
|
9
|
+
// `app.fields.someKey` evaluates to undefined when the key is not in the
|
|
10
|
+
// bag (renamed or removed, e.g. by a re-pull, #1579).
|
|
11
|
+
throw new Error(`updateField: fields[${index}].field is ${String(f.field)}; the field key it reads does not exist on its app/element ` +
|
|
12
|
+
"(renamed or removed?). Check the app's fields bag for the current key.");
|
|
13
|
+
}
|
|
7
14
|
const updateMode = "updateMode" in f ? f.updateMode : undefined;
|
|
8
15
|
const fieldType = "fieldType" in f.field ? f.field.fieldType : undefined;
|
|
9
16
|
if (updateMode !== undefined && fieldType !== "MULTI_PICKLIST" && fieldType !== "MULTI_PICKLIST_ID") {
|
|
@@ -76,6 +83,24 @@ export function updateField(opts) {
|
|
|
76
83
|
...recordKindOf(opts.app),
|
|
77
84
|
};
|
|
78
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Update fields on every record matching a filter — a filter-scoped mass
|
|
88
|
+
* updateField. No single-record option: the filter selects the set.
|
|
89
|
+
*/
|
|
90
|
+
export function bulkUpdateFields(opts) {
|
|
91
|
+
if (opts.fields.length === 0)
|
|
92
|
+
throw new Error("bulkUpdateFields requires at least one field.");
|
|
93
|
+
return {
|
|
94
|
+
key: "bulkUpdateFields",
|
|
95
|
+
config: {
|
|
96
|
+
aspectId: opts.app,
|
|
97
|
+
filter: opts.filter,
|
|
98
|
+
workflowFields: workflowFields(opts.fields),
|
|
99
|
+
},
|
|
100
|
+
__recordApp: opts.app.refName,
|
|
101
|
+
...recordKindOf(opts.app),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
79
104
|
export function findRelatedRecords(opts) {
|
|
80
105
|
return {
|
|
81
106
|
key: "findRelatedRecords",
|
|
@@ -281,10 +306,15 @@ function outputSchema(outputs) {
|
|
|
281
306
|
}
|
|
282
307
|
const EXECUTE_SCRIPT_LIST_INPUT_MARKER = "__edkExecuteScriptListInput";
|
|
283
308
|
/**
|
|
284
|
-
* Wrap a
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
309
|
+
* Wrap a record-valued executeScript input with the field mappings the script
|
|
310
|
+
* can read - which fields, and under what alias. The value is a whole record
|
|
311
|
+
* or a list of records (a prior task's `.records`, read per item).
|
|
312
|
+
*
|
|
313
|
+
* Inside this wrapper these deploy the whole record: a record trigger's
|
|
314
|
+
* `ctx.trigger.record`, and the `.record` of `recordSearch`, `createRecord`
|
|
315
|
+
* and `updateField`. Elsewhere they are the record ID a `record:` slot takes.
|
|
316
|
+
* An on-demand record parameter and `findRelatedRecords`' `.record` expose
|
|
317
|
+
* only the record ID, so they stay the ID here too.
|
|
288
318
|
*/
|
|
289
319
|
export function withFieldMappings(value, fields) {
|
|
290
320
|
return { [EXECUTE_SCRIPT_LIST_INPUT_MARKER]: true, value, fields };
|
|
@@ -384,8 +414,12 @@ export function apiRequest(opts) {
|
|
|
384
414
|
oauth: {
|
|
385
415
|
requestType: opts.oauth.requestType,
|
|
386
416
|
...(opts.oauth.url !== undefined ? { url: serializeValueOrRef(opts.oauth.url) } : {}),
|
|
387
|
-
...(opts.oauth.clientId !== undefined
|
|
388
|
-
|
|
417
|
+
...(opts.oauth.clientId !== undefined
|
|
418
|
+
? { clientId: typeof opts.oauth.clientId === "string" ? opts.oauth.clientId : serializeValueOrRef(opts.oauth.clientId) }
|
|
419
|
+
: {}),
|
|
420
|
+
...(opts.oauth.clientSecret !== undefined
|
|
421
|
+
? { clientSecret: typeof opts.oauth.clientSecret === "string" ? opts.oauth.clientSecret : serializeValueOrRef(opts.oauth.clientSecret) }
|
|
422
|
+
: {}),
|
|
389
423
|
...(opts.oauth.headers !== undefined ? { headers: apiRequestHeaders(opts.oauth.headers) } : {}),
|
|
390
424
|
},
|
|
391
425
|
} : {}),
|
|
@@ -523,13 +557,6 @@ export function aiClassify(opts) {
|
|
|
523
557
|
};
|
|
524
558
|
}
|
|
525
559
|
export function notification(opts) {
|
|
526
|
-
if (!opts.userIds?.length &&
|
|
527
|
-
!opts.groupIds?.length &&
|
|
528
|
-
!opts.userRefs?.length &&
|
|
529
|
-
!opts.groupRefs?.length &&
|
|
530
|
-
!opts.notifyWatchers) {
|
|
531
|
-
throw new Error("notification requires at least one recipient (userIds, groupIds, userRefs, groupRefs, or notifyWatchers).");
|
|
532
|
-
}
|
|
533
560
|
return {
|
|
534
561
|
key: "notification",
|
|
535
562
|
config: {
|
|
@@ -814,10 +841,16 @@ export function approvalStatusUpdate(opts) {
|
|
|
814
841
|
export function runAutomation(opts) {
|
|
815
842
|
const inputs = opts.inputs ?? [];
|
|
816
843
|
const outputs = opts.outputs ?? [];
|
|
844
|
+
const dynamic = isRef(opts.automation);
|
|
845
|
+
if (dynamic && opts.synchronous !== true) {
|
|
846
|
+
throw new Error("runAutomation: a Dynamic Reference target requires synchronous: true");
|
|
847
|
+
}
|
|
817
848
|
return {
|
|
818
849
|
key: "runAutomation",
|
|
819
850
|
config: {
|
|
820
|
-
|
|
851
|
+
...(dynamic
|
|
852
|
+
? { targetAutomationRef: serializeValueOrRef(opts.automation) }
|
|
853
|
+
: { targetAutomationId: opts.automation }),
|
|
821
854
|
synchronous: opts.synchronous ?? false,
|
|
822
855
|
...(inputs.length > 0
|
|
823
856
|
? { inputMappings: inputs.map((input) => ({ name: input.name, value: serializeValueOrRef(input.value) })) }
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DeployableEntity } from "../../engine/entity.js";
|
|
2
|
-
import { type
|
|
2
|
+
import { type ValidationFailure } from "../../engine/validation.js";
|
|
3
|
+
import { type ChildResourceScope, type TfBlock, type TfExpr, type TfValue } from "../../engine/tf/index.js";
|
|
3
4
|
import { type OrgRefLookup, type WorkspaceAspect } from "../../engine/build/context.js";
|
|
4
5
|
import type { BuildFieldMetadata } from "../../graph/types.js";
|
|
5
6
|
import type { AppServiceAccount } from "../service-account/build.js";
|
|
@@ -8,6 +9,8 @@ export interface AutomationToTfContext {
|
|
|
8
9
|
readonly appRefName?: string;
|
|
9
10
|
/** The product owner kind; defaults to app for direct legacy callers. */
|
|
10
11
|
readonly parentScope?: "app" | "element";
|
|
12
|
+
/** Element handle. ei prefixes element automation labels with SanitizeName(handle). */
|
|
13
|
+
readonly ownerHandle?: string;
|
|
11
14
|
/** Element owners only: the element declares `systemFields.audit`. */
|
|
12
15
|
readonly ownerAuditFields?: boolean;
|
|
13
16
|
/** RefNames of the workspace's elements without `systemFields.audit`. */
|
|
@@ -66,11 +69,25 @@ export interface AutomationToTfContext {
|
|
|
66
69
|
*/
|
|
67
70
|
readonly localsAttrs?: Record<string, TfValue>;
|
|
68
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Terraform data label for a vault key. Keep this in lockstep with the
|
|
74
|
+
* exporter's VaultEntryLabel: readable for conventional uppercase keys and
|
|
75
|
+
* hash-suffixed whenever normalization could collide.
|
|
76
|
+
*/
|
|
77
|
+
export declare function vaultEntryLabel(key: string): string;
|
|
69
78
|
export interface AutomationToTfResult {
|
|
70
79
|
readonly blocks: readonly TfBlock[];
|
|
71
80
|
readonly address: string;
|
|
72
81
|
}
|
|
73
82
|
/** Run-automation targets reference publish for ACTIVE automations, automation for draft/inactive. */
|
|
74
|
-
export declare function automationRunTargetResourceAttr(appTfLabel: string, automationRefName: string, activeAutomationRefNames: ReadonlySet<string> | undefined): TfExpr;
|
|
75
|
-
/**
|
|
83
|
+
export declare function automationRunTargetResourceAttr(appTfLabel: string, automationRefName: string, activeAutomationRefNames: ReadonlySet<string> | undefined, scope?: ChildResourceScope, handle?: string): TfExpr;
|
|
84
|
+
/**
|
|
85
|
+
* edk#1499: script-input field mappings read fields off a whole record. A
|
|
86
|
+
* value that exposes only a record ID (an onDemand record parameter, or
|
|
87
|
+
* findRelatedRecords' `.record`) deploys refs["Record"] (ASPECT_RECORD_ID)
|
|
88
|
+
* plus field mappings, and the script receives `{}` at runtime. Record
|
|
89
|
+
* triggers' `ctx.trigger.record` and the `.record` of recordSearch,
|
|
90
|
+
* createRecord and updateField carry the whole record (#1284, #1489).
|
|
91
|
+
*/
|
|
92
|
+
export declare function recordIdFieldMappingFailures(entity: DeployableEntity, payload: object, address: string): ValidationFailure[];
|
|
76
93
|
export declare function automationToTf(entity: DeployableEntity, ctx: AutomationToTfContext): AutomationToTfResult;
|