@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
|
@@ -11,12 +11,13 @@
|
|
|
11
11
|
* accept a literal or a `ctx` `Ref` and are pre-serialized to the platform's
|
|
12
12
|
* `ValueReference` JSON via the shared, agnostic `serializeValueOrRef`.
|
|
13
13
|
*/
|
|
14
|
-
import type { AgentRef, AppOrElementRef,
|
|
14
|
+
import type { AgentRef, AppOrElementRef, ApprovalProcessRef, AutomationCatalogRef, CloudLinkRef, ConnectorRef, DocumentModelFieldRef, FieldRef, FileReaderCatalogRef, OutputPropertyRef, PhoneServiceRef, ProcedureParameterType, ProcedureRef, SearchTableRef, TableRef } from "../../catalog/index.js";
|
|
15
15
|
import type { UnsafePlatformId } from "../../core/platform-id.js";
|
|
16
16
|
import type { CalculationInclude, Expr, ExprCardinality, ExprContext, ExprType } from "../field/calc/types.js";
|
|
17
17
|
import type { RecordId, RecordShape } from "../field/record-shape.js";
|
|
18
18
|
import type { RoleUserRef } from "../role/build.js";
|
|
19
19
|
import type { Ref, ValueOrRef } from "../shared/ref.js";
|
|
20
|
+
import type { DropdownValue } from "../shared/types/platform.js";
|
|
20
21
|
import type { ActionDef } from "./build.js";
|
|
21
22
|
import { type CalculationValue } from "./calculation-expression.js";
|
|
22
23
|
import type { Filter } from "./filter.js";
|
|
@@ -30,11 +31,32 @@ export type { RecordId };
|
|
|
30
31
|
*/
|
|
31
32
|
export type RecordReference<A extends AppOrElementRef = AppOrElementRef> = Ref<RecordShape<A>> | ValueOrRef<RecordId> | UnsafePlatformId;
|
|
32
33
|
/** A field assignment: which field, and the value (literal or `ctx` ref). */
|
|
33
|
-
export interface FieldAssignment {
|
|
34
|
+
export interface FieldAssignment<F extends FieldRef | UnsafePlatformId = FieldRef | UnsafePlatformId> {
|
|
34
35
|
/** Prefer a typed catalog field; pulled source uses an explicit escape hatch when a non-recursive export only exposes the platform id. */
|
|
35
|
-
readonly field:
|
|
36
|
+
readonly field: F;
|
|
36
37
|
readonly value: ValueOrRef<unknown>;
|
|
37
38
|
}
|
|
39
|
+
/** How an updateField assignment changes an existing Multi-Select value. */
|
|
40
|
+
export type MultiSelectUpdateMode = "replace" | "add";
|
|
41
|
+
type MultiSelectFieldRef = FieldRef<string, string, "MULTI_PICKLIST" | "MULTI_PICKLIST_ID">;
|
|
42
|
+
type IsAny<T> = 0 extends (1 & T) ? true : false;
|
|
43
|
+
type UpdateModeForField<F extends FieldRef | UnsafePlatformId> = [F] extends [MultiSelectFieldRef] ? {
|
|
44
|
+
readonly updateMode?: MultiSelectUpdateMode;
|
|
45
|
+
} : {
|
|
46
|
+
readonly updateMode?: never;
|
|
47
|
+
};
|
|
48
|
+
type UpdateValueForField<F extends FieldRef | UnsafePlatformId> = IsAny<F> extends true ? {
|
|
49
|
+
readonly value: ValueOrRef<unknown>;
|
|
50
|
+
} : [F] extends [MultiSelectFieldRef] ? {
|
|
51
|
+
readonly value: readonly string[] | Ref<readonly DropdownValue[], string>;
|
|
52
|
+
} : {
|
|
53
|
+
readonly value: ValueOrRef<unknown>;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* A field assignment accepted by updateField. Multi-Select assignments can
|
|
57
|
+
* choose replace/add behavior; every other field rejects updateMode.
|
|
58
|
+
*/
|
|
59
|
+
export type UpdateFieldAssignment<F extends FieldRef | UnsafePlatformId = FieldRef | UnsafePlatformId> = Omit<FieldAssignment<F>, "value"> & UpdateValueForField<F> & UpdateModeForField<F>;
|
|
38
60
|
export interface RecordSearchOutput<A extends AppOrElementRef = AppOrElementRef> {
|
|
39
61
|
readonly records: readonly RecordShape<A>[];
|
|
40
62
|
readonly record: RecordShape<A>;
|
|
@@ -85,13 +107,16 @@ export interface CreateRecordOptions<A extends AppOrElementRef = AppOrElementRef
|
|
|
85
107
|
readonly record?: RecordReference<A>;
|
|
86
108
|
}
|
|
87
109
|
export declare function createRecord<A extends AppOrElementRef>(opts: CreateRecordOptions<A>): ActionDef<CreateRecordOutput<A>>;
|
|
88
|
-
|
|
110
|
+
type ValidatedUpdateFieldAssignments<Fields extends readonly FieldAssignment[]> = {
|
|
111
|
+
readonly [Index in keyof Fields]: Fields[Index] extends FieldAssignment<infer F> ? Fields[Index] & UpdateValueForField<F> & UpdateModeForField<F> : never;
|
|
112
|
+
};
|
|
113
|
+
export interface UpdateFieldOptions<A extends AppOrElementRef = AppOrElementRef, Fields extends readonly FieldAssignment[] = readonly FieldAssignment[]> {
|
|
89
114
|
readonly app: A;
|
|
90
115
|
/** The record to update (e.g. `ctx.trigger.record` or `.record.recordId`). */
|
|
91
116
|
readonly record: RecordReference<A>;
|
|
92
|
-
readonly fields:
|
|
117
|
+
readonly fields: Fields & ValidatedUpdateFieldAssignments<NoInfer<Fields>>;
|
|
93
118
|
}
|
|
94
|
-
export declare function updateField<A extends AppOrElementRef>(opts: UpdateFieldOptions<A>): ActionDef<{
|
|
119
|
+
export declare function updateField<A extends AppOrElementRef, const Fields extends readonly FieldAssignment[]>(opts: UpdateFieldOptions<A, Fields>): ActionDef<{
|
|
95
120
|
record: RecordShape<A>;
|
|
96
121
|
}>;
|
|
97
122
|
export interface FindRelatedRecordsOptions<A extends AppOrElementRef = AppOrElementRef> {
|
|
@@ -142,6 +167,7 @@ export type AiAgentOutputFieldType = "text" | "number" | "decimal" | "boolean" |
|
|
|
142
167
|
export interface AiAgentOutputField {
|
|
143
168
|
readonly type: AiAgentOutputFieldType;
|
|
144
169
|
readonly description?: string;
|
|
170
|
+
readonly required?: boolean;
|
|
145
171
|
}
|
|
146
172
|
/** TS type a structured-output field of the given declared type resolves to. */
|
|
147
173
|
type AiAgentFieldTs<T extends AiAgentOutputFieldType> = T extends "number" | "decimal" ? number : T extends "boolean" ? boolean : string;
|
|
@@ -186,13 +212,39 @@ export interface SetVariableOptions {
|
|
|
186
212
|
readonly update?: readonly VariableAssign[];
|
|
187
213
|
}
|
|
188
214
|
export declare function setVariable(opts: SetVariableOptions): ActionDef<Record<string, never>>;
|
|
189
|
-
|
|
190
|
-
type
|
|
191
|
-
|
|
192
|
-
|
|
215
|
+
/** An output schema's properties: output name → type. */
|
|
216
|
+
export type ScriptOutputProperties = Record<string, string>;
|
|
217
|
+
/**
|
|
218
|
+
* A script's declared outputs — either the properties alone, or those
|
|
219
|
+
* properties plus the root object's own `name`.
|
|
220
|
+
*
|
|
221
|
+
* The platform's schema node carries an optional `name` on every node,
|
|
222
|
+
* including the root. On a PROPERTY that name is the output's key (and so is
|
|
223
|
+
* the map key here); on the ROOT it is inert — refs are keyed `result.<prop>`
|
|
224
|
+
* whether or not it is set, and the GraphQL input documents the root as
|
|
225
|
+
* nameless. It is nonetheless real stored data on some tasks, so the schema
|
|
226
|
+
* a pull reads back has to survive a rebuild unchanged; a task whose root
|
|
227
|
+
* carries a name prints the second form.
|
|
228
|
+
*
|
|
229
|
+
* The two forms are distinguished by `properties` holding an object — every
|
|
230
|
+
* value in the flat form is a type string, so an output actually named
|
|
231
|
+
* `properties` or `name` stays unambiguous.
|
|
232
|
+
*/
|
|
233
|
+
export type ScriptOutputs = ScriptOutputProperties | {
|
|
234
|
+
readonly name?: string;
|
|
235
|
+
readonly properties: ScriptOutputProperties;
|
|
236
|
+
};
|
|
237
|
+
type ExecuteScriptFieldValue<T extends string> = Uppercase<T> extends "INTEGER" | "NUMBER" | "DECIMAL" ? number : Uppercase<T> extends "BOOLEAN" ? boolean : Uppercase<T> extends "OBJECT" ? Record<string, unknown> : string;
|
|
238
|
+
/** The properties of an authored `outputs` option, in either accepted form. */
|
|
239
|
+
type ScriptOutputPropertiesOf<O> = O extends {
|
|
240
|
+
readonly properties: Record<string, string>;
|
|
241
|
+
} ? O["properties"] : O extends Record<string, string> ? O : undefined;
|
|
242
|
+
type ExecuteScriptOutput<O extends ScriptOutputs | undefined> = {
|
|
243
|
+
readonly result: ScriptOutputPropertiesOf<O> extends Record<string, string> ? {
|
|
244
|
+
readonly [K in keyof ScriptOutputPropertiesOf<O>]: ExecuteScriptFieldValue<Extract<ScriptOutputPropertiesOf<O>[K], string>>;
|
|
193
245
|
} : Record<string, unknown>;
|
|
194
246
|
};
|
|
195
|
-
export interface ExecuteScriptOptions<O extends
|
|
247
|
+
export interface ExecuteScriptOptions<O extends ScriptOutputs | undefined = undefined> {
|
|
196
248
|
/**
|
|
197
249
|
* A FUNCTION whose body ships as the platform script (v3):
|
|
198
250
|
* `(input) => { const { X } = input.parameters; return { OUT: X }; }`.
|
|
@@ -206,7 +258,11 @@ export interface ExecuteScriptOptions<O extends Record<string, string> | undefin
|
|
|
206
258
|
*/
|
|
207
259
|
readonly code: ScriptCodeFn<Record<string, unknown>, Record<string, unknown>>;
|
|
208
260
|
readonly inputs?: Record<string, ValueOrRef<unknown>>;
|
|
209
|
-
/**
|
|
261
|
+
/**
|
|
262
|
+
* Output schema: property name → `"text" | "integer" | "number" |
|
|
263
|
+
* "decimal" | "boolean" | "object"`, or `{ name, properties }` when the
|
|
264
|
+
* platform's root object carries a name (see {@link ScriptOutputs}).
|
|
265
|
+
*/
|
|
210
266
|
readonly outputs?: O;
|
|
211
267
|
}
|
|
212
268
|
/**
|
|
@@ -218,10 +274,10 @@ export interface ExecuteScriptOptions<O extends Record<string, string> | undefin
|
|
|
218
274
|
* falling back to `extractScriptBody` only when there's no tracked source) —
|
|
219
275
|
* so the body is computed exactly once, not re-derived by each layer.
|
|
220
276
|
*/
|
|
221
|
-
export declare function executeScriptActionDefWithBody<O extends
|
|
277
|
+
export declare function executeScriptActionDefWithBody<O extends ScriptOutputs | undefined = undefined>(body: string, opts: Pick<ExecuteScriptOptions<O>, "inputs" | "outputs">): ActionDef<ExecuteScriptOutput<O>> & {
|
|
222
278
|
readonly key: "executeScript";
|
|
223
279
|
};
|
|
224
|
-
export declare function executeScript<const O extends
|
|
280
|
+
export declare function executeScript<const O extends ScriptOutputs | undefined = undefined>(opts: ExecuteScriptOptions<O>): ActionDef<ExecuteScriptOutput<O>> & {
|
|
225
281
|
readonly key: "executeScript";
|
|
226
282
|
};
|
|
227
283
|
export interface ApiRequestHeader {
|
|
@@ -315,9 +371,12 @@ export interface ApiRequestOptions {
|
|
|
315
371
|
}
|
|
316
372
|
export declare function apiRequest(opts: ApiRequestOptions): ActionDef<{
|
|
317
373
|
response: unknown;
|
|
374
|
+
file?: unknown;
|
|
375
|
+
statusCode?: unknown;
|
|
376
|
+
textResponse?: unknown;
|
|
318
377
|
}>;
|
|
319
378
|
export interface AiSearchTableOptions {
|
|
320
|
-
readonly table: SearchTableRef;
|
|
379
|
+
readonly table: SearchTableRef | UnsafePlatformId;
|
|
321
380
|
readonly query: ValueOrRef<unknown>;
|
|
322
381
|
readonly filter?: Filter;
|
|
323
382
|
readonly limit?: number;
|
|
@@ -432,8 +491,6 @@ export declare function assignGroup(opts: AssignGroupOptions): ActionDef<Empty>;
|
|
|
432
491
|
export interface AddWatcherOptions {
|
|
433
492
|
readonly userIds?: readonly string[];
|
|
434
493
|
readonly groupIds?: readonly string[];
|
|
435
|
-
readonly userRefs?: readonly ValueOrRef<unknown>[];
|
|
436
|
-
readonly groupRefs?: readonly ValueOrRef<unknown>[];
|
|
437
494
|
readonly record?: ValueOrRef<unknown>;
|
|
438
495
|
}
|
|
439
496
|
export declare function addWatcher(opts: AddWatcherOptions): ActionDef<Empty>;
|
|
@@ -461,6 +518,29 @@ export interface UnzipOptions {
|
|
|
461
518
|
readonly file: ValueOrRef<unknown>;
|
|
462
519
|
}
|
|
463
520
|
export declare function unzip(opts: UnzipOptions): ActionDef<Empty>;
|
|
521
|
+
/**
|
|
522
|
+
* Placeholder for a platform task type EDK's automation module doesn't
|
|
523
|
+
* implement yet (e.g. a report-generation task). The platform exports it as a
|
|
524
|
+
* read-only `elementum_unmanaged_task_reference` data source rather than a
|
|
525
|
+
* real resource — this builder preserves that reference (and, critically,
|
|
526
|
+
* its real position in the task tree) in authored/pulled source instead of
|
|
527
|
+
* silently dropping it or hoisting whatever chains off it out of its real
|
|
528
|
+
* switch case / forkJoin branch (edk#821). It carries no CRUD: the
|
|
529
|
+
* referenced task's own configuration is not authorable, only its identity
|
|
530
|
+
* and position.
|
|
531
|
+
*
|
|
532
|
+
* `id` requires the `unsafePlatformId` wrapper rather than a bare string —
|
|
533
|
+
* deliberately awkward to hand-author, since this task has no CRUD and
|
|
534
|
+
* requires a `workflow_id` that doesn't exist pre-publish; in practice this
|
|
535
|
+
* builder is reconstructed by `edk pull`, not hand-written.
|
|
536
|
+
*/
|
|
537
|
+
export interface UnimplementedTaskOptions {
|
|
538
|
+
/** The unsupported task's raw platform id. */
|
|
539
|
+
readonly id: UnsafePlatformId;
|
|
540
|
+
/** The unsupported task's platform GraphQL typename, e.g. "WorkflowGenerateAspectAppReportTask". */
|
|
541
|
+
readonly taskType: string;
|
|
542
|
+
}
|
|
543
|
+
export declare function unimplementedTask(opts: UnimplementedTaskOptions): ActionDef<Record<string, never>>;
|
|
464
544
|
export interface GenerateReportOptions {
|
|
465
545
|
readonly record: ValueOrRef<unknown>;
|
|
466
546
|
readonly reportId: string;
|
|
@@ -481,14 +561,33 @@ export interface AssignmentEngineOptions {
|
|
|
481
561
|
readonly record: ValueOrRef<unknown>;
|
|
482
562
|
}
|
|
483
563
|
export declare function assignmentEngine(opts: AssignmentEngineOptions): ActionDef<Empty>;
|
|
484
|
-
export interface
|
|
564
|
+
export interface LegacyProcedureOptions {
|
|
485
565
|
readonly procedureId: string;
|
|
486
566
|
/** A raw cloud link id, or a `catalog.cloudLinks.<handle>` reference. */
|
|
487
567
|
readonly cloudLinkId: string | CloudLinkRef;
|
|
568
|
+
readonly procedure?: never;
|
|
488
569
|
/** Positional arguments (index == position). */
|
|
489
570
|
readonly parameters?: readonly ValueOrRef<unknown>[];
|
|
490
571
|
}
|
|
491
|
-
|
|
572
|
+
type ProcedureParameterValues<Parameters extends readonly ProcedureParameterType[]> = {
|
|
573
|
+
readonly [Index in keyof Parameters]: ValueOrRef<unknown>;
|
|
574
|
+
};
|
|
575
|
+
export type TypedProcedureOptions<Parameters extends readonly ProcedureParameterType[]> = {
|
|
576
|
+
readonly procedure: ProcedureRef<Parameters>;
|
|
577
|
+
readonly procedureId?: never;
|
|
578
|
+
readonly cloudLinkId?: never;
|
|
579
|
+
} & (number extends Parameters["length"] ? {
|
|
580
|
+
readonly parameters?: readonly ValueOrRef<unknown>[];
|
|
581
|
+
} : Parameters extends readonly [] ? {
|
|
582
|
+
readonly parameters?: readonly [];
|
|
583
|
+
} : {
|
|
584
|
+
readonly parameters: ProcedureParameterValues<Parameters>;
|
|
585
|
+
});
|
|
586
|
+
export type ProcedureOptions = LegacyProcedureOptions | TypedProcedureOptions<readonly ProcedureParameterType[]>;
|
|
587
|
+
export declare function procedure<const Parameters extends readonly ProcedureParameterType[]>(opts: TypedProcedureOptions<Parameters>): ActionDef<{
|
|
588
|
+
output: unknown;
|
|
589
|
+
}>;
|
|
590
|
+
export declare function procedure(opts: LegacyProcedureOptions): ActionDef<{
|
|
492
591
|
output: unknown;
|
|
493
592
|
}>;
|
|
494
593
|
export interface InitiateCallOptions {
|
|
@@ -570,12 +669,13 @@ export type CalculationOptions<Values extends CalculationValues = CalculationVal
|
|
|
570
669
|
export declare function calculation<const Values extends CalculationValues>(opts: CalculationOptions<Values>): ActionDef<CalculationValueOutputs<Values>>;
|
|
571
670
|
/** @deprecated Prefer `calculation({ values: { name: expression } })`. */
|
|
572
671
|
export declare function calculation<const Entries extends readonly CalculationEntry[]>(opts: LegacyCalculationOptions<Entries>): ActionDef<CalculationOutputs<Entries>>;
|
|
672
|
+
/** The status to set on the referenced approval. Mirrors the provider's `status` validator. */
|
|
673
|
+
export type ApprovalStatusUpdateStatus = "APPROVED" | "DENIED" | "EXCEPTION";
|
|
573
674
|
export interface ApprovalStatusUpdateOptions {
|
|
574
|
-
|
|
575
|
-
readonly
|
|
576
|
-
readonly status:
|
|
675
|
+
/** Value reference to the approval to update (typically an `approvalChain` task's output). */
|
|
676
|
+
readonly approvalReference: ValueOrRef<unknown>;
|
|
677
|
+
readonly status: ApprovalStatusUpdateStatus;
|
|
577
678
|
readonly reason?: ValueOrRef<unknown>;
|
|
578
|
-
readonly tags?: ValueOrRef<unknown>;
|
|
579
679
|
}
|
|
580
680
|
export declare function approvalStatusUpdate(opts: ApprovalStatusUpdateOptions): ActionDef<Empty>;
|
|
581
681
|
export interface RunAutomationInput {
|
|
@@ -583,21 +683,40 @@ export interface RunAutomationInput {
|
|
|
583
683
|
readonly name: string;
|
|
584
684
|
readonly value: ValueOrRef<unknown>;
|
|
585
685
|
}
|
|
586
|
-
|
|
587
|
-
|
|
686
|
+
/**
|
|
687
|
+
* A workflow output's declared value type (the same domain
|
|
688
|
+
* `outputFieldTypesFromScriptSchema` computes for the wire) mapped to the
|
|
689
|
+
* real TS type it deserializes to. An unresolved/unknown `valueType` (the
|
|
690
|
+
* output's source wasn't a typed executeScript result) stays `unknown` —
|
|
691
|
+
* an honest "we don't know", never a wrong guess.
|
|
692
|
+
*/
|
|
693
|
+
type WorkflowOutputValue<T extends string | undefined> = T extends "BOOLEAN" ? boolean : T extends "NUMBER" | "DECIMAL" ? number : T extends "TEXT" ? string : unknown;
|
|
694
|
+
/**
|
|
695
|
+
* A `runAutomation` step's result: flat, one property per key the target
|
|
696
|
+
* automation's `AutomationCatalogRef.outputs` declares — matches the real
|
|
697
|
+
* platform behavior (`refs["<output_name>"]` on the run_automation_task,
|
|
698
|
+
* confirmed live), not a nested `.output` wrapper.
|
|
699
|
+
*/
|
|
700
|
+
export type RunAutomationOutput<A extends AutomationCatalogRef> = A["outputs"] extends Record<string, OutputPropertyRef> ? {
|
|
701
|
+
readonly [K in keyof A["outputs"]]: WorkflowOutputValue<A["outputs"][K]["valueType"]>;
|
|
702
|
+
} : Record<string, unknown>;
|
|
703
|
+
export interface RunAutomationOptions<A extends AutomationCatalogRef = AutomationCatalogRef> {
|
|
704
|
+
readonly automation: A;
|
|
588
705
|
readonly synchronous?: boolean;
|
|
589
706
|
/**
|
|
590
|
-
* Input mappings by parameter **name**.
|
|
591
|
-
*
|
|
592
|
-
*
|
|
707
|
+
* Input mappings by parameter **name**. Build resolves each name through the
|
|
708
|
+
* target on-demand trigger's computed `parameter_ids` map, so authored source
|
|
709
|
+
* never carries a platform UUID.
|
|
593
710
|
*/
|
|
594
711
|
readonly inputs?: readonly RunAutomationInput[];
|
|
595
|
-
/**
|
|
712
|
+
/**
|
|
713
|
+
* Published output property names to expose on the typed action result.
|
|
714
|
+
* Static targets surface those refs automatically; the Terraform compiler
|
|
715
|
+
* does not send a redundant `output_mappings` payload to the backend.
|
|
716
|
+
*/
|
|
596
717
|
readonly outputs?: readonly string[];
|
|
597
718
|
}
|
|
598
|
-
export declare function runAutomation(opts: RunAutomationOptions): ActionDef<
|
|
599
|
-
output: unknown;
|
|
600
|
-
}>;
|
|
719
|
+
export declare function runAutomation<const A extends AutomationCatalogRef>(opts: RunAutomationOptions<A>): ActionDef<RunAutomationOutput<A>>;
|
|
601
720
|
export type ReadFileDataSource = {
|
|
602
721
|
readonly type: "attachmentId";
|
|
603
722
|
readonly value: ValueOrRef<unknown>;
|
|
@@ -642,24 +761,19 @@ export declare function bulkExcel(opts: BulkExcelOptions): ActionDef<{
|
|
|
642
761
|
output: unknown;
|
|
643
762
|
}>;
|
|
644
763
|
export interface ApprovalChainOptions {
|
|
645
|
-
|
|
764
|
+
/** App-owned approval process to start. */
|
|
765
|
+
readonly approvalProcess: ApprovalProcessRef;
|
|
766
|
+
/** Record being submitted for approval. */
|
|
767
|
+
readonly record: RecordReference;
|
|
768
|
+
/** User requesting the approval. Use a USER_ID value reference. */
|
|
769
|
+
readonly requester: ValueOrRef<unknown>;
|
|
770
|
+
/** Optional dynamic approvers. Each entry must resolve to a USER_ID. */
|
|
646
771
|
readonly approvers?: readonly ValueOrRef<unknown>[];
|
|
647
772
|
readonly reason?: ValueOrRef<unknown>;
|
|
648
773
|
readonly summary?: ValueOrRef<unknown>;
|
|
649
774
|
}
|
|
650
775
|
export declare function approvalChain(opts: ApprovalChainOptions): ActionDef<Empty>;
|
|
651
|
-
export
|
|
652
|
-
/** Approval-chain template id (approval chains aren't catalog-modeled yet). */
|
|
653
|
-
readonly approvalChainTemplateId: string;
|
|
654
|
-
readonly requester: ValueOrRef<unknown>;
|
|
655
|
-
readonly record: ValueOrRef<unknown>;
|
|
656
|
-
readonly summary?: ValueOrRef<unknown>;
|
|
657
|
-
readonly reason?: ValueOrRef<unknown>;
|
|
658
|
-
readonly relatedRecord?: ValueOrRef<unknown>;
|
|
659
|
-
readonly tags?: ValueOrRef<unknown>;
|
|
660
|
-
/** Pre-built wire dynamic-approver entries. */
|
|
661
|
-
readonly dynamicApprovers?: readonly Record<string, unknown>[];
|
|
662
|
-
}
|
|
776
|
+
export type ApprovalChainTemplateOptions = ApprovalChainOptions;
|
|
663
777
|
export declare function approvalChainTemplate(opts: ApprovalChainTemplateOptions): ActionDef<Empty>;
|
|
664
778
|
export interface SendSurveyOptions {
|
|
665
779
|
readonly record: ValueOrRef<unknown>;
|
|
@@ -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
|
}
|
|
@@ -142,6 +149,7 @@ export function aiAgent(opts) {
|
|
|
142
149
|
name,
|
|
143
150
|
type: def.type.toUpperCase(),
|
|
144
151
|
...(def.description !== undefined ? { description: def.description } : {}),
|
|
152
|
+
...(def.required !== undefined ? { required: def.required } : {}),
|
|
145
153
|
})),
|
|
146
154
|
}
|
|
147
155
|
: {}),
|
|
@@ -171,10 +179,22 @@ export function setVariable(opts) {
|
|
|
171
179
|
},
|
|
172
180
|
};
|
|
173
181
|
}
|
|
174
|
-
|
|
175
|
-
|
|
182
|
+
/** Split the authored `outputs` option into the root name and the properties. */
|
|
183
|
+
function normalizeScriptOutputs(outputs) {
|
|
184
|
+
const properties = outputs.properties;
|
|
185
|
+
if (typeof properties !== "object" || properties === null || Array.isArray(properties)) {
|
|
186
|
+
return { properties: outputs };
|
|
187
|
+
}
|
|
188
|
+
const name = outputs.name;
|
|
189
|
+
return {
|
|
190
|
+
...(typeof name === "string" && name !== "" ? { name } : {}),
|
|
191
|
+
properties: properties,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
/** Map an output schema to the platform's tagged object shape. */
|
|
176
195
|
function outputSchema(outputs) {
|
|
177
|
-
const properties =
|
|
196
|
+
const { name: rootName, properties: declared } = normalizeScriptOutputs(outputs);
|
|
197
|
+
const properties = Object.entries(declared).map(([name, type]) => {
|
|
178
198
|
switch (type) {
|
|
179
199
|
case "integer":
|
|
180
200
|
return { integer: { name } };
|
|
@@ -183,14 +203,13 @@ function outputSchema(outputs) {
|
|
|
183
203
|
return { number: { name } };
|
|
184
204
|
case "boolean":
|
|
185
205
|
return { bool: { name } };
|
|
206
|
+
case "object":
|
|
207
|
+
return { object: { name } };
|
|
186
208
|
default:
|
|
187
209
|
return { string: { name } };
|
|
188
210
|
}
|
|
189
211
|
});
|
|
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 } };
|
|
212
|
+
return { object: { ...(rootName !== undefined ? { name: rootName } : {}), properties } };
|
|
194
213
|
}
|
|
195
214
|
/**
|
|
196
215
|
* Build the executeScript `ActionDef` from an ALREADY-RESOLVED body string.
|
|
@@ -402,8 +421,8 @@ export function notification(opts) {
|
|
|
402
421
|
...(opts.description !== undefined ? { description: opts.description } : {}),
|
|
403
422
|
...(opts.userIds?.length ? { userIds: opts.userIds } : {}),
|
|
404
423
|
...(opts.groupIds?.length ? { groupIds: opts.groupIds } : {}),
|
|
405
|
-
...(opts.userRefs !== undefined ? {
|
|
406
|
-
...(opts.groupRefs !== undefined ? {
|
|
424
|
+
...(opts.userRefs !== undefined ? { users: refList(opts.userRefs) } : {}),
|
|
425
|
+
...(opts.groupRefs !== undefined ? { groups: refList(opts.groupRefs) } : {}),
|
|
407
426
|
...(opts.notifyWatchers !== undefined ? { notifyWatchers: opts.notifyWatchers } : {}),
|
|
408
427
|
},
|
|
409
428
|
};
|
|
@@ -418,16 +437,14 @@ export function assignGroup(opts) {
|
|
|
418
437
|
return { key: "assignGroup", config: { fieldId: opts.field, groupId: opts.groupId } };
|
|
419
438
|
}
|
|
420
439
|
export function addWatcher(opts) {
|
|
421
|
-
if (!opts.userIds?.length && !opts.groupIds?.length
|
|
422
|
-
throw new Error("addWatcher requires at least one of: userIds
|
|
440
|
+
if (!opts.userIds?.length && !opts.groupIds?.length) {
|
|
441
|
+
throw new Error("addWatcher requires at least one of: userIds or groupIds.");
|
|
423
442
|
}
|
|
424
443
|
return {
|
|
425
444
|
key: "addWatcher",
|
|
426
445
|
config: {
|
|
427
446
|
...(opts.userIds?.length ? { userIds: opts.userIds } : {}),
|
|
428
447
|
...(opts.groupIds?.length ? { groupIds: opts.groupIds } : {}),
|
|
429
|
-
...(opts.userRefs !== undefined ? { userValueReferences: refList(opts.userRefs) } : {}),
|
|
430
|
-
...(opts.groupRefs !== undefined ? { groupValueReferences: refList(opts.groupRefs) } : {}),
|
|
431
448
|
...(opts.record !== undefined ? { recordReference: serializeValueOrRef(opts.record) } : {}),
|
|
432
449
|
},
|
|
433
450
|
};
|
|
@@ -466,6 +483,9 @@ export function saveAttachment(opts) {
|
|
|
466
483
|
export function unzip(opts) {
|
|
467
484
|
return { key: "unzip", config: { file: serializeValueOrRef(opts.file) } };
|
|
468
485
|
}
|
|
486
|
+
export function unimplementedTask(opts) {
|
|
487
|
+
return { key: "unimplementedTask", config: { id: opts.id, taskType: opts.taskType } };
|
|
488
|
+
}
|
|
469
489
|
export function generateReport(opts) {
|
|
470
490
|
return {
|
|
471
491
|
key: "aspectAppReportGeneration",
|
|
@@ -501,12 +521,22 @@ export function assignmentEngine(opts) {
|
|
|
501
521
|
};
|
|
502
522
|
}
|
|
503
523
|
export function procedure(opts) {
|
|
524
|
+
const parameters = (opts.parameters ?? []).map((v, index) => ({ index, value: serializeValueOrRef(v) }));
|
|
525
|
+
if ("procedure" in opts && opts.procedure !== undefined) {
|
|
526
|
+
return {
|
|
527
|
+
key: "procedure",
|
|
528
|
+
config: {
|
|
529
|
+
procedure: opts.procedure,
|
|
530
|
+
parameters,
|
|
531
|
+
},
|
|
532
|
+
};
|
|
533
|
+
}
|
|
504
534
|
return {
|
|
505
535
|
key: "procedure",
|
|
506
536
|
config: {
|
|
507
537
|
procedureId: opts.procedureId,
|
|
508
538
|
cloudLinkId: opts.cloudLinkId,
|
|
509
|
-
parameters
|
|
539
|
+
parameters,
|
|
510
540
|
},
|
|
511
541
|
};
|
|
512
542
|
}
|
|
@@ -663,29 +693,25 @@ export function approvalStatusUpdate(opts) {
|
|
|
663
693
|
return {
|
|
664
694
|
key: "approvalStatusUpdate",
|
|
665
695
|
config: {
|
|
666
|
-
|
|
667
|
-
recordId: serializeValueOrRef(opts.record),
|
|
696
|
+
approvalReference: serializeValueOrRef(opts.approvalReference),
|
|
668
697
|
status: opts.status,
|
|
669
698
|
...(opts.reason !== undefined ? { reason: serializeValueOrRef(opts.reason) } : {}),
|
|
670
|
-
...(opts.tags !== undefined ? { tags: serializeValueOrRef(opts.tags) } : {}),
|
|
671
699
|
},
|
|
672
700
|
};
|
|
673
701
|
}
|
|
674
702
|
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
|
-
};
|
|
703
|
+
const inputs = opts.inputs ?? [];
|
|
704
|
+
const outputs = opts.outputs ?? [];
|
|
684
705
|
return {
|
|
685
706
|
key: "runAutomation",
|
|
686
|
-
config:
|
|
687
|
-
|
|
688
|
-
:
|
|
707
|
+
config: {
|
|
708
|
+
targetAutomationId: opts.automation,
|
|
709
|
+
synchronous: opts.synchronous ?? false,
|
|
710
|
+
...(inputs.length > 0
|
|
711
|
+
? { inputMappings: inputs.map((input) => ({ name: input.name, value: serializeValueOrRef(input.value) })) }
|
|
712
|
+
: {}),
|
|
713
|
+
...(outputs.length > 0 ? { outputMappings: outputs.map((name) => ({ name })) } : {}),
|
|
714
|
+
},
|
|
689
715
|
};
|
|
690
716
|
}
|
|
691
717
|
export function readFile(opts) {
|
|
@@ -719,33 +745,20 @@ export function bulkExcel(opts) {
|
|
|
719
745
|
};
|
|
720
746
|
}
|
|
721
747
|
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
748
|
return {
|
|
726
749
|
key: "approvalChain",
|
|
727
750
|
config: {
|
|
728
|
-
|
|
729
|
-
|
|
751
|
+
approvalProcessId: opts.approvalProcess,
|
|
752
|
+
recordReference: serializeValueOrRef(opts.record),
|
|
753
|
+
requesterReference: serializeValueOrRef(opts.requester),
|
|
754
|
+
...(opts.approvers !== undefined ? { approverReferences: opts.approvers.map((a) => serializeValueOrRef(a)) } : {}),
|
|
730
755
|
...(opts.reason !== undefined ? { reason: serializeValueOrRef(opts.reason) } : {}),
|
|
731
756
|
...(opts.summary !== undefined ? { summary: serializeValueOrRef(opts.summary) } : {}),
|
|
732
757
|
},
|
|
733
758
|
};
|
|
734
759
|
}
|
|
735
760
|
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
|
-
};
|
|
761
|
+
return approvalChain(opts);
|
|
749
762
|
}
|
|
750
763
|
export function sendSurvey(opts) {
|
|
751
764
|
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";
|
|
@@ -18,11 +18,15 @@ export interface AutomationToTfContext {
|
|
|
18
18
|
* typed against a DIFFERENT aspect resolve cross-app refs (#490).
|
|
19
19
|
*/
|
|
20
20
|
readonly fieldNamesByAppRefName?: ReadonlyMap<string, ReadonlyMap<string, string>>;
|
|
21
|
+
/** Build-time tolerance for stale labels retained by pulled automations. */
|
|
22
|
+
readonly allowUnknownPicklistOptions?: boolean;
|
|
21
23
|
readonly orgRefs?: OrgRefLookup;
|
|
22
24
|
readonly diagnostics?: string[];
|
|
23
25
|
readonly serviceAccounts?: Readonly<Record<string, AppServiceAccount>>;
|
|
24
26
|
/** App-local automations whose publish resource will be emitted in this build. */
|
|
25
27
|
readonly activeAutomationRefNames?: ReadonlySet<string>;
|
|
28
|
+
/** Display names for app-local authored automations, keyed by source refName. */
|
|
29
|
+
readonly automationNamesByRefName?: ReadonlyMap<string, string>;
|
|
26
30
|
/**
|
|
27
31
|
* Every app/element stream root discovered in this same build, keyed by
|
|
28
32
|
* `workspaceAspectKey` — lets a cross-aspect token (an app/element ref, or
|
|
@@ -56,5 +60,7 @@ export interface AutomationToTfResult {
|
|
|
56
60
|
readonly blocks: readonly TfBlock[];
|
|
57
61
|
readonly address: string;
|
|
58
62
|
}
|
|
63
|
+
/** Run-automation targets reference publish for ACTIVE automations, automation for draft/inactive. */
|
|
64
|
+
export declare function automationRunTargetResourceAttr(appTfLabel: string, automationRefName: string, activeAutomationRefNames: ReadonlySet<string> | undefined): TfExpr;
|
|
59
65
|
/** App- or element-owned `automation` entity → provider HCL blocks. */
|
|
60
66
|
export declare function automationToTf(entity: DeployableEntity, ctx: AutomationToTfContext): AutomationToTfResult;
|