@elementumai/edk 0.13.3 → 0.14.0
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/dist-sdk/src/catalog/factories.d.ts +4 -2
- package/dist-sdk/src/catalog/factories.js +3 -1
- package/dist-sdk/src/catalog/from-authoring.d.ts +8 -3
- package/dist-sdk/src/catalog/from-authoring.js +21 -8
- package/dist-sdk/src/engine/build/context.d.ts +17 -0
- package/dist-sdk/src/engine/coverage-gaps.d.ts +13 -0
- package/dist-sdk/src/engine/coverage-gaps.js +21 -0
- package/dist-sdk/src/engine/pull/context.d.ts +57 -1
- package/dist-sdk/src/engine/pull/context.js +9 -1
- package/dist-sdk/src/engine/pull/pulled-roots.d.ts +14 -1
- package/dist-sdk/src/engine/pull/pulled-roots.js +23 -3
- package/dist-sdk/src/engine/pull/ref-only.d.ts +6 -1
- package/dist-sdk/src/engine/pull/ref-only.js +4 -1
- package/dist-sdk/src/engine/pull/stream-root.d.ts +17 -1
- package/dist-sdk/src/engine/pull/stream-root.js +57 -4
- package/dist-sdk/src/engine/tf/index.d.ts +1 -0
- package/dist-sdk/src/engine/tf/index.js +1 -0
- package/dist-sdk/src/engine/tf/jsonencode.d.ts +19 -0
- package/dist-sdk/src/engine/tf/jsonencode.js +49 -0
- package/dist-sdk/src/engine/validation.d.ts +36 -1
- package/dist-sdk/src/engine/validation.js +56 -2
- package/dist-sdk/src/engine/workspace/loader.d.ts +6 -0
- package/dist-sdk/src/engine/workspace/loader.js +87 -2
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +7 -0
- package/dist-sdk/src/entities/access-policy/from-tf.js +58 -17
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +3 -1
- package/dist-sdk/src/entities/access-policy/to-tf.js +1 -1
- package/dist-sdk/src/entities/agent/build.d.ts +15 -0
- package/dist-sdk/src/entities/agent/build.js +139 -16
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +3 -3
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +39 -25
- package/dist-sdk/src/entities/agent/module.js +95 -3
- package/dist-sdk/src/entities/agent/to-tf.js +6 -4
- package/dist-sdk/src/entities/agent-evaluation/from-tf.d.ts +7 -0
- package/dist-sdk/src/entities/agent-evaluation/from-tf.js +14 -5
- package/dist-sdk/src/entities/agent-evaluation/module.js +4 -2
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +11 -2
- package/dist-sdk/src/entities/agent-tool/from-tf.js +38 -40
- package/dist-sdk/src/entities/agent-tool/to-tf.js +12 -5
- package/dist-sdk/src/entities/app/build.d.ts +1 -1
- package/dist-sdk/src/entities/app/index.d.ts +1 -1
- package/dist-sdk/src/entities/automation/approval-trigger-refs.d.ts +20 -0
- package/dist-sdk/src/entities/automation/approval-trigger-refs.js +83 -0
- package/dist-sdk/src/entities/automation/build.d.ts +75 -42
- package/dist-sdk/src/entities/automation/build.js +18 -8
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +14 -2
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +9 -0
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +64 -12
- package/dist-sdk/src/entities/automation/from-tf.d.ts +53 -0
- package/dist-sdk/src/entities/automation/from-tf.js +579 -106
- package/dist-sdk/src/entities/automation/index.d.ts +2 -2
- package/dist-sdk/src/entities/automation/index.js +1 -1
- package/dist-sdk/src/entities/automation/lookup-owner.d.ts +23 -0
- package/dist-sdk/src/entities/automation/lookup-owner.js +27 -0
- package/dist-sdk/src/entities/automation/module.js +265 -26
- package/dist-sdk/src/entities/automation/operators.d.ts +6 -2
- package/dist-sdk/src/entities/automation/operators.js +0 -2
- package/dist-sdk/src/entities/automation/task-output-labels.d.ts +8 -0
- package/dist-sdk/src/entities/automation/task-output-labels.js +11 -0
- package/dist-sdk/src/entities/automation/tasks.d.ts +37 -2
- package/dist-sdk/src/entities/automation/tasks.js +38 -1
- package/dist-sdk/src/entities/automation/to-tf.d.ts +8 -0
- package/dist-sdk/src/entities/automation/to-tf.js +576 -52
- package/dist-sdk/src/entities/automation/triggers.d.ts +47 -1
- package/dist-sdk/src/entities/automation/unsafe-script-output.d.ts +10 -5
- package/dist-sdk/src/entities/automation/unsafe-script-output.js +10 -5
- package/dist-sdk/src/entities/chart/to-tf.js +18 -5
- package/dist-sdk/src/entities/dashboard/from-tf.js +45 -11
- package/dist-sdk/src/entities/dashboard-widget-order/order.d.ts +5 -3
- package/dist-sdk/src/entities/dashboard-widget-order/order.js +6 -4
- package/dist-sdk/src/entities/datamine/from-tf.js +10 -3
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +38 -11
- package/dist-sdk/src/entities/dynamic-layout/from-tf.js +35 -7
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +101 -9
- package/dist-sdk/src/entities/element/build.d.ts +4 -1
- package/dist-sdk/src/entities/element/build.js +3 -4
- package/dist-sdk/src/entities/element/index.d.ts +1 -1
- package/dist-sdk/src/entities/field/from-tf.js +8 -1
- package/dist-sdk/src/entities/field/to-tf.d.ts +29 -2
- package/dist-sdk/src/entities/field/to-tf.js +106 -7
- package/dist-sdk/src/entities/phone-service/from-tf.d.ts +7 -0
- package/dist-sdk/src/entities/phone-service/from-tf.js +15 -7
- package/dist-sdk/src/entities/phone-service/module.js +4 -2
- package/dist-sdk/src/entities/portal/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/portal/to-tf.js +61 -2
- package/dist-sdk/src/entities/record-create-form/from-tf.js +3 -1
- package/dist-sdk/src/entities/relationship/from-tf.js +34 -4
- package/dist-sdk/src/entities/relationship/to-tf.js +24 -6
- package/dist-sdk/src/entities/role/from-tf.js +3 -1
- package/dist-sdk/src/entities/search-table/from-tf.d.ts +3 -1
- package/dist-sdk/src/entities/search-table/from-tf.js +6 -3
- package/dist-sdk/src/entities/search-table/module.js +18 -2
- package/dist-sdk/src/entities/search-table/to-tf.js +10 -16
- package/dist-sdk/src/entities/shared/aspect-target-from-tf.js +6 -1
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +6 -0
- package/dist-sdk/src/entities/shared/filters/index.d.ts +21 -4
- package/dist-sdk/src/entities/shared/filters/index.js +27 -3
- package/dist-sdk/src/entities/shared/filters/print.js +23 -7
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +24 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +98 -3
- package/dist-sdk/src/entities/shared/filters/types.d.ts +8 -1
- package/dist-sdk/src/entities/shared/run-automation-requirement.d.ts +15 -0
- package/dist-sdk/src/entities/shared/run-automation-requirement.js +28 -0
- package/dist-sdk/src/entities/shared/search-table-address.d.ts +17 -0
- package/dist-sdk/src/entities/shared/search-table-address.js +24 -0
- package/dist-sdk/src/entities/shared/skip-release.d.ts +49 -0
- package/dist-sdk/src/entities/shared/skip-release.js +74 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +3 -3
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +11 -5
- package/dist-sdk/src/entities/skill/module.js +3 -25
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +4 -2
- package/dist-sdk/src/entities/skill-tool/from-tf.js +28 -27
- package/dist-sdk/src/entities/skill-tool/to-tf.js +12 -5
- package/dist-sdk/src/entities/skill-tool/types.d.ts +1 -0
- package/dist-sdk/src/entities/skill-tool/types.js +2 -1
- package/dist-sdk/src/entities/table/catalog.d.ts +16 -0
- package/dist-sdk/src/entities/table/catalog.js +44 -2
- package/dist-sdk/src/entities/table/from-tf.js +30 -4
- package/dist-sdk/src/entities/table/keys.d.ts +27 -0
- package/dist-sdk/src/entities/table/keys.js +46 -0
- package/dist-sdk/src/entities/table/to-tf.js +2 -2
- package/dist-sdk/src/entities/view/agent-view-layout-from-tf.d.ts +12 -1
- package/dist-sdk/src/entities/view/agent-view-layout-from-tf.js +9 -4
- package/dist-sdk/src/entities/view/agent-view-layout-to-tf.js +215 -10
- package/dist-sdk/src/entities/view/agent-view-layout.d.ts +10 -4
- package/dist-sdk/src/entities/view/custom-view-runtime-rules.d.ts +43 -0
- package/dist-sdk/src/entities/view/custom-view-runtime-rules.js +285 -0
- package/dist-sdk/src/entities/view/custom-view-validate.d.ts +3 -1
- package/dist-sdk/src/entities/view/custom-view-validate.js +24 -5
- package/dist-sdk/src/entities/view/from-tf.js +14 -1
- package/dist-sdk/src/entities/widget/from-tf.js +14 -7
- package/dist-sdk/src/entities/widget/to-tf.js +9 -6
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +4 -2
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
- package/dist-sdk/src/graph/index.d.ts +14 -1
- package/dist-sdk/src/graph/index.js +2 -0
- package/dist-sdk/src/graph/resource-types.d.ts +2 -0
- package/dist-sdk/src/graph/resource-types.js +3 -0
- package/dist-sdk/src/graph/types.d.ts +105 -0
- package/package.json +1 -1
|
@@ -36,7 +36,7 @@ export interface NestedActionEntry {
|
|
|
36
36
|
readonly name: string;
|
|
37
37
|
readonly def: ActionDef<unknown>;
|
|
38
38
|
/** Display name distinct from `refKey` (`name`), when adopting a platform-authored task. */
|
|
39
|
-
readonly displayName?: string;
|
|
39
|
+
readonly displayName?: string | null;
|
|
40
40
|
readonly hclParent?: string;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
@@ -191,10 +191,43 @@ export type NestedActionContext<TTrigger, TActions extends Record<string, unknow
|
|
|
191
191
|
type BuilderActionOptions<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem, TOptions> = TOptions | ((ctx: NestedActionContext<TTrigger, TActions, TVars, TItem>) => TOptions);
|
|
192
192
|
type BuilderMode = "root" | "nested";
|
|
193
193
|
type WithAction<TMode extends BuilderMode, TItem, TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TName extends string, TOutput> = FluentActionBuilder<TMode, TItem, TTrigger, Simplify<TActions & Record<TName, TOutput>>, TVars>;
|
|
194
|
+
/**
|
|
195
|
+
* The optional third argument of every step method: the step's name as the
|
|
196
|
+
* platform shows it, when it differs from the step's key (the first argument).
|
|
197
|
+
* Omit it and the step is named after its key.
|
|
198
|
+
*
|
|
199
|
+
* `null` is for steps pulled without a name: the platform holds a step with no
|
|
200
|
+
* name, and pull prints `null` so build leaves the name out and the plan after
|
|
201
|
+
* the pull stays clean (edk#3191). Don't use it for a new step. The platform
|
|
202
|
+
* names a new step itself (an If step "Conditional", a variable step
|
|
203
|
+
* "Variable Management"); every later plan then proposes clearing that name,
|
|
204
|
+
* which the platform ignores, and a new calculation step fails to apply
|
|
205
|
+
* (its create reads the step back and gets the platform's name). Pull the app
|
|
206
|
+
* again to take the platform's name.
|
|
207
|
+
*
|
|
208
|
+
* A step pulled with `null` is also a new step whenever the source creates it:
|
|
209
|
+
* when it is applied where the step doesn't exist yet (another org or
|
|
210
|
+
* environment, a copy of the app), or when the plan replaces it (a step is
|
|
211
|
+
* replaced when the step before it is created or replaced). Give it a name
|
|
212
|
+
* before applying it anywhere it doesn't exist yet.
|
|
213
|
+
*
|
|
214
|
+
* The platform can also name an If step that has none when one of its cases is
|
|
215
|
+
* added or changed (it took the case's label on a local stack); pull again to
|
|
216
|
+
* take that name.
|
|
217
|
+
*
|
|
218
|
+
* On `unimplementedTask`, `null` looks the unsupported step up by its key, not
|
|
219
|
+
* as a step without a name (pull never prints `null` for one).
|
|
220
|
+
*/
|
|
221
|
+
type StepDisplayName = string | null;
|
|
194
222
|
/**
|
|
195
223
|
* An automation body with a trigger set. Every implemented platform action is
|
|
196
224
|
* exposed as a direct method; there is intentionally no generic escape hatch.
|
|
197
225
|
* Options may be passed directly or returned from a typed context callback.
|
|
226
|
+
*
|
|
227
|
+
* Every step method takes `(key, options, displayName?, hclParent?)`. The key
|
|
228
|
+
* names the step in `ctx.actions` and is its name on the platform unless
|
|
229
|
+
* `displayName` says otherwise; see {@link StepDisplayName} for `null`, which
|
|
230
|
+
* marks a step pulled without a name.
|
|
198
231
|
*/
|
|
199
232
|
interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown> = EmptyObject, TMode extends BuilderMode = "root", TItem = never> {
|
|
200
233
|
/**
|
|
@@ -223,7 +256,7 @@ interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVar
|
|
|
223
256
|
readonly inputs?: (ctx: NestedActionContext<TTrigger, TActions, TVars, TItem>) => I;
|
|
224
257
|
readonly code: ScriptFile;
|
|
225
258
|
readonly outputs: O;
|
|
226
|
-
}, displayName?:
|
|
259
|
+
}, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
227
260
|
result: ExecuteScriptOutput<O>["result"];
|
|
228
261
|
textResult: string;
|
|
229
262
|
stringArrayResult: readonly string[];
|
|
@@ -239,7 +272,7 @@ interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVar
|
|
|
239
272
|
readonly inputs?: (ctx: NestedActionContext<TTrigger, TActions, TVars, TItem>) => I;
|
|
240
273
|
readonly code: ScriptFile;
|
|
241
274
|
readonly outputs?: ScriptOutputs | null;
|
|
242
|
-
}, displayName?:
|
|
275
|
+
}, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
243
276
|
result: Record<string, unknown>;
|
|
244
277
|
textResult: string;
|
|
245
278
|
stringArrayResult: readonly string[];
|
|
@@ -257,7 +290,7 @@ interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVar
|
|
|
257
290
|
* the option infers from the code body.
|
|
258
291
|
*/
|
|
259
292
|
readonly outputs?: ScriptOutputs | null;
|
|
260
|
-
}, displayName?:
|
|
293
|
+
}, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
261
294
|
result: R;
|
|
262
295
|
textResult: string;
|
|
263
296
|
stringArrayResult: readonly string[];
|
|
@@ -278,52 +311,52 @@ interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVar
|
|
|
278
311
|
readonly value: (ctx: NestedActionContext<TTrigger, TActions, TVars, TItem>) => ValueOrRef<unknown>;
|
|
279
312
|
/** Platform variable type (default "TEXT"). */
|
|
280
313
|
readonly type?: TType;
|
|
281
|
-
}, displayName?:
|
|
282
|
-
setVariable<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SetVariableOptions>, displayName?:
|
|
283
|
-
recordSearch<TName extends string, A extends AppOrElementOrTaskRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RecordSearchOptions<A>>, displayName?:
|
|
284
|
-
tableRecordsSearch<TName extends string, A extends AppOrElementRef = AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").TableRecordsSearchOptions<A>>, displayName?:
|
|
285
|
-
createRecord<TName extends string, A extends AppOrElementOrTaskRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").CreateRecordOptions<A>>, displayName?:
|
|
286
|
-
updateField<TName extends string, A extends AppOrElementOrTaskRef, const Fields extends readonly import("./tasks.js").FieldAssignment[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UpdateFieldOptions<A, Fields>>, displayName?:
|
|
314
|
+
}, displayName?: StepDisplayName, hclParent?: "trigger" | string): FluentActionBuilder<TMode, TItem, TTrigger, Simplify<TActions & Record<TName, Record<string, never>>>, Simplify<TVars & Record<TName, VariableValueOf<TType>>>>;
|
|
315
|
+
setVariable<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SetVariableOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
316
|
+
recordSearch<TName extends string, A extends AppOrElementOrTaskRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RecordSearchOptions<A>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").RecordSearchOutput<A>>;
|
|
317
|
+
tableRecordsSearch<TName extends string, A extends AppOrElementRef = AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").TableRecordsSearchOptions<A>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").TableRecordsSearchOutput<A>>;
|
|
318
|
+
createRecord<TName extends string, A extends AppOrElementOrTaskRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").CreateRecordOptions<A>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").CreateRecordOutput<A>>;
|
|
319
|
+
updateField<TName extends string, A extends AppOrElementOrTaskRef, const Fields extends readonly import("./tasks.js").FieldAssignment[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UpdateFieldOptions<A, Fields>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
287
320
|
record: RecordShape<A>;
|
|
288
321
|
}>;
|
|
289
|
-
bulkUpdateFields<TName extends string, A extends AppOrElementOrTaskRef, const Fields extends readonly import("./tasks.js").FieldAssignment[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").BulkUpdateFieldsOptions<A, Fields>>, displayName?:
|
|
290
|
-
findRelatedRecords<TName extends string, A extends AppOrElementOrTaskRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").FindRelatedRecordsOptions<A>>, displayName?:
|
|
291
|
-
relateRecords<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RelateRecordsOptions>, displayName?:
|
|
292
|
-
sendEmail<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SendEmailOptions>, displayName?:
|
|
293
|
-
postComment<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").PostCommentOptions>, displayName?:
|
|
294
|
-
notification<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").NotificationOptions>, displayName?:
|
|
295
|
-
aiAgent<TName extends string, const S extends Record<string, import("./tasks.js").AiAgentOutputField> | undefined = undefined>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiAgentOptions<S>>, displayName?:
|
|
296
|
-
aiClassify<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiClassifyOptions>, displayName?:
|
|
322
|
+
bulkUpdateFields<TName extends string, A extends AppOrElementOrTaskRef, const Fields extends readonly import("./tasks.js").FieldAssignment[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").BulkUpdateFieldsOptions<A, Fields>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").BulkUpdateFieldsOutput>;
|
|
323
|
+
findRelatedRecords<TName extends string, A extends AppOrElementOrTaskRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").FindRelatedRecordsOptions<A>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").FindRelatedRecordsOutput<A>>;
|
|
324
|
+
relateRecords<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RelateRecordsOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
325
|
+
sendEmail<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SendEmailOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
326
|
+
postComment<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").PostCommentOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
327
|
+
notification<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").NotificationOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
328
|
+
aiAgent<TName extends string, const S extends Record<string, import("./tasks.js").AiAgentOutputField> | undefined = undefined>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiAgentOptions<S>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").AiAgentOutput<S>>;
|
|
329
|
+
aiClassify<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiClassifyOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
297
330
|
output: unknown;
|
|
298
331
|
}>;
|
|
299
|
-
aiSummarize<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiSummarizeOptions>, displayName?:
|
|
332
|
+
aiSummarize<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiSummarizeOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
300
333
|
output: unknown;
|
|
301
334
|
}>;
|
|
302
|
-
aiTransform<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiTransformOptions>, displayName?:
|
|
303
|
-
aiSearchTable<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiSearchTableOptions>, displayName?:
|
|
304
|
-
aiFileAnalysis<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiFileAnalysisOptions>, displayName?:
|
|
335
|
+
aiTransform<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiTransformOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, Record<string, unknown>>;
|
|
336
|
+
aiSearchTable<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiSearchTableOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").AiSearchTableOutput>;
|
|
337
|
+
aiFileAnalysis<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiFileAnalysisOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
305
338
|
output: unknown;
|
|
306
339
|
}>;
|
|
307
|
-
apiRequest<TName extends string, R extends import("./tasks.js").ApiResponseType = "JSON">(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApiRequestOptions<R>>, displayName?:
|
|
308
|
-
calculation<TName extends string, const Values extends import("./tasks.js").CalculationValues>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").CalculationOptions<Values>>, displayName?:
|
|
309
|
-
calculation<TName extends string, const Entries extends readonly import("./tasks.js").CalculationEntry[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").LegacyCalculationOptions<Entries>>, displayName?:
|
|
310
|
-
procedure<TName extends string, const Parameters extends readonly import("../../catalog/types.js").ProcedureParameterType[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").TypedProcedureOptions<Parameters>>, displayName?:
|
|
311
|
-
procedure<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").LegacyProcedureOptions>, displayName?:
|
|
312
|
-
runAutomation<TName extends string, const O extends import("./tasks.js").RunAutomationStaticOptions<AutomationCatalogRef> | import("./tasks.js").RunAutomationDynamicReferenceOptions<readonly string[] | undefined>>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, O>, displayName?:
|
|
313
|
-
readFile<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ReadFileOptions>, displayName?:
|
|
314
|
-
approvalChain<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApprovalChainOptions>, displayName?:
|
|
315
|
-
approvalStatusUpdate<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApprovalStatusUpdateOptions>, displayName?:
|
|
316
|
-
addWatcher<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AddWatcherOptions>, displayName?:
|
|
317
|
-
saveAttachment<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SaveAttachmentOptions>, displayName?:
|
|
318
|
-
unzip<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UnzipOptions>, displayName?:
|
|
319
|
-
userSearch<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UserSearchOptions>, displayName?:
|
|
320
|
-
userGroupSearch<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UserGroupSearchOptions>, displayName?:
|
|
321
|
-
initiateCall<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").InitiateCallOptions>, displayName?:
|
|
322
|
-
recordFieldLocking<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RecordFieldLockingOptions>, displayName?:
|
|
323
|
-
unimplementedTask<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UnimplementedTaskOptions>, displayName?:
|
|
324
|
-
forEach<TName extends string, TForEachItem>(name: TName, opts: ForEachConfig<TTrigger, TActions, TVars, TItem, TForEachItem, TName>, displayName?:
|
|
325
|
-
switch<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, SwitchConfig<TTrigger, TActions, TVars, TItem>>, displayName?:
|
|
326
|
-
forkJoin<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, ForkJoinConfig<TTrigger, TActions, TVars, TItem>>, displayName?:
|
|
340
|
+
apiRequest<TName extends string, R extends import("./tasks.js").ApiResponseType = "JSON">(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApiRequestOptions<R>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").ApiRequestOutputs<R>>;
|
|
341
|
+
calculation<TName extends string, const Values extends import("./tasks.js").CalculationValues>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").CalculationOptions<Values>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").CalculationValueOutputs<Values>>;
|
|
342
|
+
calculation<TName extends string, const Entries extends readonly import("./tasks.js").CalculationEntry[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").LegacyCalculationOptions<Entries>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").CalculationOutputs<Entries>>;
|
|
343
|
+
procedure<TName extends string, const Parameters extends readonly import("../../catalog/types.js").ProcedureParameterType[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").TypedProcedureOptions<Parameters>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, Record<string, unknown>>;
|
|
344
|
+
procedure<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").LegacyProcedureOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, Record<string, unknown>>;
|
|
345
|
+
runAutomation<TName extends string, const O extends import("./tasks.js").RunAutomationStaticOptions<AutomationCatalogRef> | import("./tasks.js").RunAutomationDynamicReferenceOptions<readonly string[] | undefined>>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, O>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").RunAutomationStepResult<O>>;
|
|
346
|
+
readFile<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ReadFileOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, Record<string, unknown>>;
|
|
347
|
+
approvalChain<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApprovalChainOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
348
|
+
approvalStatusUpdate<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApprovalStatusUpdateOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
349
|
+
addWatcher<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AddWatcherOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
350
|
+
saveAttachment<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SaveAttachmentOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
351
|
+
unzip<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UnzipOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
352
|
+
userSearch<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UserSearchOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").UserSearchOutput>;
|
|
353
|
+
userGroupSearch<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UserGroupSearchOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").UserGroupSearchOutput>;
|
|
354
|
+
initiateCall<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").InitiateCallOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
355
|
+
recordFieldLocking<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RecordFieldLockingOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
356
|
+
unimplementedTask<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UnimplementedTaskOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
357
|
+
forEach<TName extends string, TForEachItem>(name: TName, opts: ForEachConfig<TTrigger, TActions, TVars, TItem, TForEachItem, TName>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, ForEachOutput>;
|
|
358
|
+
switch<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, SwitchConfig<TTrigger, TActions, TVars, TItem>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
359
|
+
forkJoin<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, ForkJoinConfig<TTrigger, TActions, TVars, TItem>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
327
360
|
}
|
|
328
361
|
/** Internal finalizer returned by every operator-body builder. */
|
|
329
362
|
export interface NestedActionChain {
|
|
@@ -40,7 +40,7 @@ import { serializeNode } from "./serialize.js";
|
|
|
40
40
|
// automations call the direct fluent methods declared on ActionBuilder.
|
|
41
41
|
import * as operatorFactories from "./operators.js";
|
|
42
42
|
import * as actionFactories from "./tasks.js";
|
|
43
|
-
import { AI_SEARCH_TABLE_OUTPUT_NAMES, TRIGGER_WHOLE_RECORD_MARKER, TRIGGER_WHOLE_RECORD_REF_NAME, USER_SEARCH_REF_WIRE_NAMES, WHOLE_RECORD_REF_WIRE_NAMES, } from "./task-output-labels.js";
|
|
43
|
+
import { AI_SEARCH_TABLE_OUTPUT_NAMES, TRIGGER_WHOLE_RECORD_MARKER, TRIGGER_WHOLE_RECORD_REF_NAME, USER_SEARCH_REF_WIRE_NAMES, WHOLE_RECORD_REF_WIRE_NAMES, ATTACHMENT_WHOLE_RECORD_REF_WIRE_NAMES, } from "./task-output-labels.js";
|
|
44
44
|
import { isWorkflowOutputDeclaration, workflowOutputFieldType, } from "./workflow-output.js";
|
|
45
45
|
/** Placeholder `forEachTaskRefKey` the forEach item proxy emits; replaced with the real refKey. */
|
|
46
46
|
export const FOR_EACH_PLACEHOLDER = "__forEach__";
|
|
@@ -49,14 +49,15 @@ export const FOR_EACH_PLACEHOLDER = "__forEach__";
|
|
|
49
49
|
* `{ refKey, task, children? }` shape. The task's human display name is
|
|
50
50
|
* injected into the body — `displayName` when given (an adopted task whose
|
|
51
51
|
* platform-side name differs from its `refKey`, e.g. "For Each" vs.
|
|
52
|
-
* "For_Each"), else `refKey` itself, matching prior behavior
|
|
53
|
-
*
|
|
54
|
-
*
|
|
52
|
+
* "For_Each"), else `refKey` itself, matching prior behavior. `null` (a step
|
|
53
|
+
* pulled with no name on the platform, edk#3191) leaves `name` out, which the
|
|
54
|
+
* provider reads as "no name". Operator children become `children`; a forEach
|
|
55
|
+
* task's `__forEach__` placeholder is swapped for its real refKey.
|
|
55
56
|
*/
|
|
56
57
|
function serializeTaskEntry(name, def, displayName, hclParent) {
|
|
57
58
|
const result = {
|
|
58
59
|
refKey: name,
|
|
59
|
-
task: serializeNode({ [def.key]: { name: displayName ?? name, ...def.config } }),
|
|
60
|
+
task: serializeNode({ [def.key]: { ...(displayName === null ? {} : { name: displayName ?? name }), ...def.config } }),
|
|
60
61
|
...(hclParent !== undefined ? { hclParent } : {}),
|
|
61
62
|
};
|
|
62
63
|
if (def.operatorChildren && def.operatorChildren.length > 0) {
|
|
@@ -338,7 +339,7 @@ function assertKnownScriptOutput(name, taskRefKey, schema, undeclared) {
|
|
|
338
339
|
(undeclared === "unsafeOnly"
|
|
339
340
|
? ` Read a declared output${reads.length > 0 ? ` (${reads.join(" or ")})` : ""}, add ${JSON.stringify(output)} to the script's outputs, ` +
|
|
340
341
|
`or keep a pulled reference the live schema doesn't declare with unsafeScriptOutput(${at}, ${JSON.stringify(output)}) ` +
|
|
341
|
-
`(the platform won't publish the automation while
|
|
342
|
+
`(the platform won't publish the automation while it reads an undeclared output).`
|
|
342
343
|
: ""));
|
|
343
344
|
}
|
|
344
345
|
// A bare name is not a `result.<prop>` read (an undeclared `result.<name>` is
|
|
@@ -518,11 +519,11 @@ export function rewriteCanonicalOutputRefName(taskKey, name, taskRefKey, schema,
|
|
|
518
519
|
return name;
|
|
519
520
|
}
|
|
520
521
|
/** Rename a task's `.record` reference to its whole-record output, in place. */
|
|
521
|
-
function useWholeTaskRecord(value, taskKindByRefKey) {
|
|
522
|
+
function useWholeTaskRecord(value, taskKindByRefKey, wholeRecordNames = WHOLE_RECORD_REF_WIRE_NAMES) {
|
|
522
523
|
const mapped = value?.taskReference;
|
|
523
524
|
if (typeof mapped?.taskRefKey !== "string" || mapped.name !== "record")
|
|
524
525
|
return;
|
|
525
|
-
const wholeRecord =
|
|
526
|
+
const wholeRecord = wholeRecordNames[taskKindByRefKey.get(mapped.taskRefKey) ?? ""];
|
|
526
527
|
if (wholeRecord !== undefined)
|
|
527
528
|
mapped.name = wholeRecord;
|
|
528
529
|
}
|
|
@@ -560,6 +561,15 @@ filterLeft = false) {
|
|
|
560
561
|
for (const input of scriptInputs)
|
|
561
562
|
useWholeTaskRecord(input?.value, taskKindByRefKey);
|
|
562
563
|
}
|
|
564
|
+
// A `record` attachment hands over every file on a record, which the platform
|
|
565
|
+
// reads from the whole record (its Attachments field); the record ID gives the
|
|
566
|
+
// AI agent no files and fails the email.
|
|
567
|
+
for (const attachments of [rec.aiAgent?.attachments, rec.sendEmail?.emailAttachments]) {
|
|
568
|
+
if (!Array.isArray(attachments))
|
|
569
|
+
continue;
|
|
570
|
+
for (const attachment of attachments)
|
|
571
|
+
useWholeTaskRecord(attachment?.record, taskKindByRefKey, ATTACHMENT_WHOLE_RECORD_REF_WIRE_NAMES);
|
|
572
|
+
}
|
|
563
573
|
if (Array.isArray(rec.field_mappings)) {
|
|
564
574
|
useWholeTaskRecord(rec.value, taskKindByRefKey);
|
|
565
575
|
// Field mappings read a trigger's whole record too, which shares its
|
|
@@ -29,8 +29,13 @@ export interface TaskCall {
|
|
|
29
29
|
readonly refKey: string;
|
|
30
30
|
readonly args: Record<string, unknown>;
|
|
31
31
|
readonly children?: readonly OperatorChildAst[];
|
|
32
|
-
/**
|
|
33
|
-
|
|
32
|
+
/**
|
|
33
|
+
* The task's real wire display name, when it differs from `refKey` (e.g. a
|
|
34
|
+
* platform-authored "For Each" vs. the slugged `refKey` "For_Each"). `null`
|
|
35
|
+
* when the platform step has no name: the printer passes `null` so build
|
|
36
|
+
* leaves `name` out (edk#3191).
|
|
37
|
+
*/
|
|
38
|
+
readonly displayName?: string | null;
|
|
34
39
|
/** Explicit provider graph parent (`trigger` or another task refKey). */
|
|
35
40
|
readonly hclParent?: string;
|
|
36
41
|
}
|
|
@@ -40,6 +45,13 @@ export interface PulledRawCalculationAst {
|
|
|
40
45
|
readonly text: string;
|
|
41
46
|
readonly resultType: "attachment" | "bool" | "date" | "datetime" | "decimal" | "group" | "handle" | "html" | "json" | "multiPicklist" | "number" | "picklist" | "text" | "user";
|
|
42
47
|
}
|
|
48
|
+
/** A group in an approvalChain dynamic approver slot: `groupApprover(group, { approvalsRequired, denialsRequired })` (edk#3163). */
|
|
49
|
+
export interface PulledGroupApproverAst {
|
|
50
|
+
readonly kind: "groupApprover";
|
|
51
|
+
readonly group: RefExpr | unknown;
|
|
52
|
+
readonly approvalsRequired: number;
|
|
53
|
+
readonly denialsRequired: number;
|
|
54
|
+
}
|
|
43
55
|
export interface OperatorChildAst {
|
|
44
56
|
readonly label?: string | null;
|
|
45
57
|
/** True only for a switch default branch; label absence is not a default discriminator. */
|
|
@@ -115,6 +115,15 @@ export interface PrintAutomationV2Options {
|
|
|
115
115
|
readonly foreignAppRefNamespaces?: ReadonlyMap<string, string>;
|
|
116
116
|
readonly foreignElementRefNamespaces?: ReadonlyMap<string, string>;
|
|
117
117
|
readonly foreignTaskRefNames?: ReadonlyMap<string, string>;
|
|
118
|
+
/**
|
|
119
|
+
* `JSON.stringify([element name, search-table lookup name])` → the catalog
|
|
120
|
+
* key the element's catalog gives that table, as the agent and skill tool
|
|
121
|
+
* printers read it (edk#3228).
|
|
122
|
+
*/
|
|
123
|
+
readonly foreignSearchTableRefsByName?: ReadonlyMap<string, {
|
|
124
|
+
readonly ownerRefName: string;
|
|
125
|
+
readonly tableKey: string;
|
|
126
|
+
}>;
|
|
118
127
|
/** Diagnostics emitted by the bridge for raw UUIDs retained in this pull. */
|
|
119
128
|
readonly unresolvedReferences?: readonly UnresolvedReferenceDiagnostic[];
|
|
120
129
|
}
|
|
@@ -42,6 +42,7 @@ import { UNRESOLVED_REFERENCE_MARKER } from "../filter.js";
|
|
|
42
42
|
import { INJECTED_TS_IGNORE, scriptFileText } from "../script-code.js";
|
|
43
43
|
import { isRequiredSecret } from "../tasks.js";
|
|
44
44
|
import { canonicalImportId } from "../../../engine/pull/authored-address.js";
|
|
45
|
+
import { catalogRefForFieldOwner } from "../../../engine/pull/catalog-ref.js";
|
|
45
46
|
import { unresolvedReferenceComment } from "../../../engine/pull/ref-only.js";
|
|
46
47
|
// ---------------------------------------------------------------------------
|
|
47
48
|
// Factory name mapping — decoded task `factory` → v2 factory function name.
|
|
@@ -536,6 +537,7 @@ function emptyImports() {
|
|
|
536
537
|
usesRefType: false,
|
|
537
538
|
usesTableSearchTableRef: false,
|
|
538
539
|
usesGroupRef: false,
|
|
540
|
+
usesAutomationRef: false,
|
|
539
541
|
};
|
|
540
542
|
}
|
|
541
543
|
/** Folder (inside the automations folder) that holds printed script files. */
|
|
@@ -649,6 +651,7 @@ function printAutomation(ast, opts, externalScripts) {
|
|
|
649
651
|
...(opts.foreignAppRefNamespaces !== undefined && { foreignAppRefNamespaces: opts.foreignAppRefNamespaces }),
|
|
650
652
|
...(opts.foreignElementRefNamespaces !== undefined && { foreignElementRefNamespaces: opts.foreignElementRefNamespaces }),
|
|
651
653
|
...(opts.foreignTaskRefNames !== undefined && { foreignTaskRefNames: opts.foreignTaskRefNames }),
|
|
654
|
+
...(opts.foreignSearchTableRefsByName !== undefined && { foreignSearchTableRefsByName: opts.foreignSearchTableRefsByName }),
|
|
652
655
|
};
|
|
653
656
|
const triggerCode = printTrigger(ast.trigger, state);
|
|
654
657
|
// The trigger/action/output chain lives on the `actions` field, nested one
|
|
@@ -779,6 +782,7 @@ function renderHeader(ast, imports, _opts) {
|
|
|
779
782
|
});
|
|
780
783
|
lines.push(`import { ${sortedSpecifiers.join(", ")} } from "${sdkPackageSpecifier("automations")}";`);
|
|
781
784
|
const catalogNamed = [
|
|
785
|
+
...(imports.usesAutomationRef ? ["automationRef"] : []),
|
|
782
786
|
...(imports.usesGroupRef ? ["groupRef"] : []),
|
|
783
787
|
...(imports.usesTableSearchTableRef ? ["tableSearchTableRef"] : []),
|
|
784
788
|
];
|
|
@@ -991,15 +995,19 @@ function recordTriggerBody(trigger, state) {
|
|
|
991
995
|
* Trailing `, "Display Name"` arg for direct action calls — only
|
|
992
996
|
* emitted when the task's real wire name differs from its `refKey` (adopting
|
|
993
997
|
* a platform-authored task, e.g. "For Each" vs. the slugged refKey
|
|
994
|
-
* "For_Each")
|
|
998
|
+
* "For_Each"), or as `null` for a step that has no name on the platform
|
|
999
|
+
* (edk#3191). Omitted otherwise so the common case stays two-arg.
|
|
995
1000
|
*/
|
|
996
1001
|
function displayNameArg(task) {
|
|
1002
|
+
if (task.displayName === null)
|
|
1003
|
+
return ", null";
|
|
997
1004
|
return task.displayName ? `, ${quote(task.displayName)}` : "";
|
|
998
1005
|
}
|
|
999
1006
|
function topLevelTaskTrailingArgs(task) {
|
|
1000
1007
|
if (task.hclParent === undefined)
|
|
1001
1008
|
return displayNameArg(task);
|
|
1002
|
-
|
|
1009
|
+
const displayName = task.displayName === null ? "null" : task.displayName ? quote(task.displayName) : "undefined";
|
|
1010
|
+
return `, ${displayName}, ${quote(task.hclParent)}`;
|
|
1003
1011
|
}
|
|
1004
1012
|
function printTask(task, state, indent, refCtx = DEFAULT_CTX) {
|
|
1005
1013
|
const pad = " ".repeat(indent);
|
|
@@ -1261,7 +1269,10 @@ function formatSwitch(task, state, indent, refCtx) {
|
|
|
1261
1269
|
const branchCtx = { ...refCtx, ctxName: "ctx" };
|
|
1262
1270
|
const caseLines = cases.map((ch) => formatSwitchCase(ch, state, indent + 2, branchCtx));
|
|
1263
1271
|
const configParts = [];
|
|
1264
|
-
|
|
1272
|
+
// An If task with no cases prints `cases: []` (#3105).
|
|
1273
|
+
configParts.push(caseLines.length === 0
|
|
1274
|
+
? `${configIndent}cases: []`
|
|
1275
|
+
: `${configIndent}cases: [\n${caseLines.join(",\n")}\n${configIndent}]`);
|
|
1265
1276
|
if (defaults.length > 0) {
|
|
1266
1277
|
const defaultBlock = formatDefaultActionsBlock(defaults, state, indent, configIndent, branchCtx);
|
|
1267
1278
|
configParts.push(`${configIndent}defaultActions: ${defaultBlock}`);
|
|
@@ -1491,9 +1502,11 @@ function taskPrimaryTarget(args, state) {
|
|
|
1491
1502
|
const v = args[k];
|
|
1492
1503
|
if (isRefExpr(v) && v.kind === "app") {
|
|
1493
1504
|
if (v.entityType === "task") {
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1505
|
+
// A task-type app has no catalog entry, pulled or not (#3148): its
|
|
1506
|
+
// fields always print as inline stubs, named by the pulled task's
|
|
1507
|
+
// refName when it is in the workspace.
|
|
1508
|
+
const refName = taskStubRefName(state, v.name, v.appHandle);
|
|
1509
|
+
return { kind: "task", refName, name: v.name ?? refName, inCatalog: false };
|
|
1497
1510
|
}
|
|
1498
1511
|
if (v.entityType === "element") {
|
|
1499
1512
|
const foreignRefName = workspaceAspectRefName(state, "element", v.name, v.namespace);
|
|
@@ -1527,6 +1540,14 @@ function taskPrimaryTarget(args, state) {
|
|
|
1527
1540
|
}
|
|
1528
1541
|
return undefined;
|
|
1529
1542
|
}
|
|
1543
|
+
/**
|
|
1544
|
+
* The refName a task-type app's inline stub carries: the pulled task's own
|
|
1545
|
+
* refName when it is in this workspace, so build binds the target to that
|
|
1546
|
+
* task, else the key the export gave it.
|
|
1547
|
+
*/
|
|
1548
|
+
function taskStubRefName(state, name, fallback) {
|
|
1549
|
+
return (name !== undefined ? state.foreignTaskRefNames?.get(name) : undefined) ?? fallback;
|
|
1550
|
+
}
|
|
1530
1551
|
/**
|
|
1531
1552
|
* The workspace catalog key for a foreign app/element ref: by namespace, then
|
|
1532
1553
|
* display name. A namespace-only data block's ref carries the namespace as
|
|
@@ -1594,6 +1615,11 @@ function printArgValue(name, value, state, indent, refCtx) {
|
|
|
1594
1615
|
const calc = trackFactory("calc", state);
|
|
1595
1616
|
return `${calc}.raw(${quote(value.text)}, ${quote(value.resultType)})`;
|
|
1596
1617
|
}
|
|
1618
|
+
if (isPulledGroupApprover(value)) {
|
|
1619
|
+
const fn = trackFactory("groupApprover", state);
|
|
1620
|
+
const group = printArgValue("group", value.group, state, indent, refCtx);
|
|
1621
|
+
return `${fn}(${group}, { approvalsRequired: ${value.approvalsRequired}, denialsRequired: ${value.denialsRequired} })`;
|
|
1622
|
+
}
|
|
1597
1623
|
if (isRequiredSecret(value)) {
|
|
1598
1624
|
const fn = trackFactory("requiredSecret", state);
|
|
1599
1625
|
return `${fn}(${quote(value.variable)})`;
|
|
@@ -1640,6 +1666,9 @@ function printArgValue(name, value, state, indent, refCtx) {
|
|
|
1640
1666
|
}
|
|
1641
1667
|
return literalJson(value);
|
|
1642
1668
|
}
|
|
1669
|
+
function isPulledGroupApprover(value) {
|
|
1670
|
+
return !!value && typeof value === "object" && value.kind === "groupApprover";
|
|
1671
|
+
}
|
|
1643
1672
|
function isPulledRawCalculation(value) {
|
|
1644
1673
|
return !!value && typeof value === "object" && value.kind === "calculationRaw";
|
|
1645
1674
|
}
|
|
@@ -1838,19 +1867,27 @@ function printRef(ref, state, refCtx) {
|
|
|
1838
1867
|
if (ref.entityType === undefined || ref.name === undefined) {
|
|
1839
1868
|
return `catalog.${catalogOwnerHandle(state, ref.appHandle)}`;
|
|
1840
1869
|
}
|
|
1841
|
-
const
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1870
|
+
const namespace = ref.namespace !== undefined ? `, namespace: ${quote(ref.namespace)}` : "";
|
|
1871
|
+
if (ref.entityType === "task") {
|
|
1872
|
+
// `generated/catalog.ts` has no entry for a task-type app, even after
|
|
1873
|
+
// `elementum pull task`, so `catalog.<task>` is undefined at load
|
|
1874
|
+
// (#3148). The stub names the pulled task's refName, which build
|
|
1875
|
+
// resolves to the task in this workspace, or the export's key.
|
|
1876
|
+
return `{ __kind: "task", refName: ${quote(taskStubRefName(state, ref.name, ref.appHandle))}, name: ${quote(ref.name)}${namespace} }`;
|
|
1877
|
+
}
|
|
1878
|
+
const foreignRefName = workspaceAspectRefName(state, ref.entityType, ref.name, ref.namespace);
|
|
1846
1879
|
if (foreignRefName !== undefined)
|
|
1847
1880
|
return `catalog.${foreignRefName}`;
|
|
1848
|
-
const namespace = ref.namespace !== undefined ? `, namespace: ${quote(ref.namespace)}` : "";
|
|
1849
1881
|
return `{ __kind: ${quote(ref.entityType)}, refName: ${quote(ref.appHandle)}, name: ${quote(ref.name)}${namespace} }`;
|
|
1850
1882
|
}
|
|
1851
1883
|
case "agent":
|
|
1852
1884
|
return `catalog.${catalogOwnerHandle(state, ref.appHandle)}.agents${safeMember(ref.agentKey)}`;
|
|
1853
1885
|
case "automation":
|
|
1886
|
+
if (ref.unmanagedName !== undefined) {
|
|
1887
|
+
// Not in source: no catalog entry exists, so name the live automation (#3047).
|
|
1888
|
+
state.imports.usesAutomationRef = true;
|
|
1889
|
+
return `automationRef({ refName: ${quote(ref.automationKey)}, name: ${quote(ref.unmanagedName)}, parent: ${quote(catalogOwnerHandle(state, ref.appHandle))} })`;
|
|
1890
|
+
}
|
|
1854
1891
|
return `catalog.${catalogOwnerHandle(state, ref.appHandle)}.automations${safeMember(ref.automationKey)}`;
|
|
1855
1892
|
case "phoneService":
|
|
1856
1893
|
return `catalog.${catalogOwnerHandle(state, ref.appHandle)}.phoneServices${safeMember(ref.phoneServiceKey)}`;
|
|
@@ -1875,6 +1912,21 @@ function printRef(ref, state, refCtx) {
|
|
|
1875
1912
|
parts.push(`id: ${quote(ref.id)}`);
|
|
1876
1913
|
return `tableSearchTableRef({ ${parts.join(", ")} })`;
|
|
1877
1914
|
}
|
|
1915
|
+
if (ref.ownerKind === "element" && ref.name !== undefined) {
|
|
1916
|
+
// A data lookup on an element's table prints what an agent or skill
|
|
1917
|
+
// tool on that table prints (edk#3228): the catalog key the
|
|
1918
|
+
// element's catalog declares for it, else the table literal, which
|
|
1919
|
+
// keeps a pinned id (a name the element's tables share).
|
|
1920
|
+
const typed = ref.parentName === undefined
|
|
1921
|
+
? undefined
|
|
1922
|
+
: state.foreignSearchTableRefsByName?.get(JSON.stringify([ref.parentName, ref.name]));
|
|
1923
|
+
if (typed !== undefined) {
|
|
1924
|
+
const owner = catalogRefForFieldOwner(typed.ownerRefName, state.foreignAppRefNamespaces, state.foreignElementRefNamespaces);
|
|
1925
|
+
return `catalog.${owner}.searchTables${safeMember(typed.tableKey)}`;
|
|
1926
|
+
}
|
|
1927
|
+
const pinnedId = ref.id !== undefined ? `, id: ${quote(ref.id)}` : "";
|
|
1928
|
+
return `{ __kind: "searchTable", refName: ${quote(ref.name)}, name: ${quote(ref.name)}, parent: ${quote(ref.appHandle)}${pinnedId} }`;
|
|
1929
|
+
}
|
|
1878
1930
|
// Search tables are element- or table-owned, never app-owned. Remapping
|
|
1879
1931
|
// the automation owner's export handle to its authored app refName
|
|
1880
1932
|
// would bind an unpulled same-handle foreign element's table onto the
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EntityTfError } from "../../engine/entity.js";
|
|
2
2
|
import { type FromTfContext } from "../../engine/pull/context.js";
|
|
3
3
|
import { type ChildResourceScope, type TfBlock, type TfDocument, type TfValue } from "../../engine/tf/index.js";
|
|
4
|
+
import type { TriggerReferenceRepair } from "../../graph/types.js";
|
|
4
5
|
import type { AutomationAst } from "./deserializer/ast.js";
|
|
5
6
|
export interface AutomationFromTfResult {
|
|
6
7
|
readonly refName: string;
|
|
@@ -22,6 +23,8 @@ export interface AutomationFromTfResult {
|
|
|
22
23
|
* other value.
|
|
23
24
|
*/
|
|
24
25
|
readonly stringifiedValueReferences?: boolean;
|
|
26
|
+
/** Live references to on-demand inputs spelled as declared, which the first plan rewrites (#3109). */
|
|
27
|
+
readonly triggerReferenceRepairs?: readonly TriggerReferenceRepair[];
|
|
25
28
|
}
|
|
26
29
|
interface DecodeContext {
|
|
27
30
|
readonly appRefName: string;
|
|
@@ -74,6 +77,8 @@ interface DecodeContext {
|
|
|
74
77
|
readonly tableRefName: string;
|
|
75
78
|
readonly name: string;
|
|
76
79
|
}>;
|
|
80
|
+
/** See `tableColumnKeysInDocument` (#3167). */
|
|
81
|
+
readonly tableColumnKeys?: ReadonlyMap<string, ReadonlyMap<string, string>>;
|
|
77
82
|
readonly foreignFileReaderRefsById?: FromTfContext["foreignFileReaderRefsById"];
|
|
78
83
|
readonly picklistOptionsByField?: ReadonlyMap<string, ReadonlyMap<string, string>>;
|
|
79
84
|
readonly fieldNamesByOwnerRefName?: ReadonlyMap<string, ReadonlyMap<string, string>>;
|
|
@@ -92,6 +97,8 @@ interface DecodeContext {
|
|
|
92
97
|
readonly stringifiedValueReferences?: {
|
|
93
98
|
unresolved: boolean;
|
|
94
99
|
};
|
|
100
|
+
/** Script task refKey → undeclared outputs a field assignment reads, for one pull warning (#3050). */
|
|
101
|
+
readonly undeclaredScriptOutputFieldReads?: Map<string, Set<string>>;
|
|
95
102
|
/** Names of static group recipients org.ts doesn't carry yet (edk#2241), for one pull diagnostic each. */
|
|
96
103
|
readonly groupsMissingFromOrg?: Set<string>;
|
|
97
104
|
/** Filter option ids that are not one of the compared field's current options (#2568), one pull warning each. */
|
|
@@ -100,6 +107,28 @@ interface DecodeContext {
|
|
|
100
107
|
readonly describeUnresolvedTask?: (taskId: string) => string;
|
|
101
108
|
/** This automation's platform id, from its import block. */
|
|
102
109
|
readonly automationId?: string;
|
|
110
|
+
/** On-demand input references live spells as declared, which build rewrites (#3109). */
|
|
111
|
+
readonly triggerReferenceRepairs?: TriggerReferenceRepairCollector;
|
|
112
|
+
}
|
|
113
|
+
/** Where a decoded value sits, for {@link TriggerReferenceRepairCollector}. */
|
|
114
|
+
interface RepairSite {
|
|
115
|
+
readonly task?: string;
|
|
116
|
+
readonly address: string;
|
|
117
|
+
readonly input: string;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Collects each reference to an on-demand input whose live name is the
|
|
121
|
+
* input's declared spelling ("ticket_number") where that differs from the
|
|
122
|
+
* normalized name ("ticketNumber"). Pulled source reads it as
|
|
123
|
+
* `ctx.trigger.ticket_number`, which build writes as the normalized name, so
|
|
124
|
+
* the first plan rewrites it (#3109). `site` is set only while decoding a
|
|
125
|
+
* position build writes that way, so nothing is collected elsewhere.
|
|
126
|
+
*/
|
|
127
|
+
interface TriggerReferenceRepairCollector {
|
|
128
|
+
site: RepairSite | undefined;
|
|
129
|
+
readonly found: (RepairSite & {
|
|
130
|
+
readonly declared: string;
|
|
131
|
+
})[];
|
|
103
132
|
}
|
|
104
133
|
/**
|
|
105
134
|
* The same outputs as seen from a CALCULATION formula, which addresses a
|
|
@@ -111,6 +140,30 @@ interface DecodeContext {
|
|
|
111
140
|
export declare const RECORD_SEARCH_CALCULATION_REF_NAME_TO_TS: Readonly<Record<string, readonly string[]>>;
|
|
112
141
|
export declare const AI_SEARCH_TABLE_TASK_REF_SEGMENT_TO_TS: Readonly<Record<string, string>>;
|
|
113
142
|
export declare const TABLE_RECORDS_SEARCH_TASK_REF_SEGMENT_TO_TS: Readonly<Record<string, string>>;
|
|
143
|
+
/**
|
|
144
|
+
* A Calculation task's output reference names a calculation the task doesn't have (deleted after the reference
|
|
145
|
+
* was made). Build would index `refs` by a key the provider doesn't publish, so plan fails with "Invalid index";
|
|
146
|
+
* the automation is left out instead (#3085).
|
|
147
|
+
*/
|
|
148
|
+
export declare class UnresolvedCalculationOutputError extends EntityTfError {
|
|
149
|
+
constructor(taskName: string, reference: string);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Another app's or element's automation that an export names through
|
|
153
|
+
* `data.elementum_automation.<label>` (`app_id` = the owner's data lookup,
|
|
154
|
+
* `name` = the automation's display name): its owner's catalog handle, its
|
|
155
|
+
* catalog key, its display name, and whether the owner is an app or element
|
|
156
|
+
* in this workspace (`mapped`; otherwise the handle comes from the owner
|
|
157
|
+
* lookup's label). Shared by the decoder and by extraction's check for a
|
|
158
|
+
* target the owner's source leaves out (#3064).
|
|
159
|
+
*/
|
|
160
|
+
export declare function foreignAutomationTarget(label: string, dataBlocks: ReadonlyMap<string, TfBlock>, foreignAppRefNames: ReadonlyMap<string, string> | undefined, foreignElementRefNames: ReadonlyMap<string, string> | undefined): {
|
|
161
|
+
readonly appHandle: string;
|
|
162
|
+
readonly automationKey: string;
|
|
163
|
+
readonly name?: string;
|
|
164
|
+
readonly ownerKind: "app" | "element";
|
|
165
|
+
readonly mapped: boolean;
|
|
166
|
+
};
|
|
114
167
|
/**
|
|
115
168
|
* Option ids `filterOptionLabel` prints as labels at every filter comparison
|
|
116
169
|
* that holds them. The export still holds the id. An id that any comparison
|