@elementumai/edk 0.9.2 → 0.9.6
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 -26
- package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +1 -1
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +1 -1
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +1 -1
- package/dist-sdk/pull/util.d.ts +1 -1
- package/dist-sdk/pull/util.js +3 -3
- package/dist-sdk/src/catalog/factories.d.ts +49 -10
- package/dist-sdk/src/catalog/factories.js +94 -13
- package/dist-sdk/src/catalog/from-authoring.d.ts +5 -5
- package/dist-sdk/src/catalog/from-authoring.js +7 -7
- package/dist-sdk/src/catalog/index.d.ts +2 -2
- package/dist-sdk/src/catalog/index.js +1 -1
- package/dist-sdk/src/catalog/org.js +62 -4
- package/dist-sdk/src/catalog/render-helpers.d.ts +1 -1
- package/dist-sdk/src/catalog/render-helpers.js +1 -1
- package/dist-sdk/src/catalog/render.d.ts +1 -0
- package/dist-sdk/src/catalog/render.js +2 -2
- package/dist-sdk/src/catalog/token.js +11 -4
- package/dist-sdk/src/catalog/types.d.ts +33 -4
- package/dist-sdk/src/catalog/types.js +5 -0
- package/dist-sdk/src/core/index.d.ts +10 -10
- package/dist-sdk/src/core/index.js +9 -9
- package/dist-sdk/src/core/render-tree.d.ts +1 -1
- package/dist-sdk/src/core/render-tree.js +1 -2
- package/dist-sdk/src/core/types/ai-provider.d.ts +1 -1
- package/dist-sdk/src/core/types/ai-provider.js +1 -1
- package/dist-sdk/src/core/types/app.d.ts +66 -30
- package/dist-sdk/src/core/types/app.js +2 -2
- package/dist-sdk/src/core/types/aspect-category.d.ts +4 -4
- package/dist-sdk/src/core/types/aspect-category.js +4 -4
- package/dist-sdk/src/core/types/cloud-link.d.ts +3 -3
- package/dist-sdk/src/core/types/cloud-link.js +3 -3
- package/dist-sdk/src/core/types/display-block.d.ts +2 -2
- package/dist-sdk/src/core/types/display-block.js +2 -2
- package/dist-sdk/src/core/types/group.d.ts +1 -1
- package/dist-sdk/src/core/types/group.js +1 -1
- package/dist-sdk/src/core/types/user.d.ts +1 -1
- package/dist-sdk/src/core/types/user.js +1 -1
- package/dist-sdk/src/core/wire/ref-serializer.js +3 -3
- package/dist-sdk/src/engine/build/context.d.ts +20 -13
- package/dist-sdk/src/engine/entity.d.ts +1 -1
- package/dist-sdk/src/engine/pull/context.d.ts +34 -0
- package/dist-sdk/src/engine/pull/context.js +14 -0
- package/dist-sdk/src/engine/pull/org.d.ts +9 -0
- package/dist-sdk/src/engine/pull/org.js +33 -0
- package/dist-sdk/src/engine/pull/ref-only.d.ts +37 -0
- package/dist-sdk/src/engine/pull/ref-only.js +204 -0
- package/dist-sdk/src/engine/tf/expr.d.ts +6 -2
- package/dist-sdk/src/engine/tf/expr.js +18 -13
- package/dist-sdk/src/engine/tf/index.d.ts +1 -1
- package/dist-sdk/src/engine/tf/index.js +1 -1
- package/dist-sdk/src/engine/tf/model.d.ts +8 -1
- package/dist-sdk/src/engine/tf/model.js +4 -0
- package/dist-sdk/src/engine/tf/parse.js +13 -2
- package/dist-sdk/src/engine/tf/render.js +4 -0
- package/dist-sdk/src/entities/access-policy/build.d.ts +4 -5
- package/dist-sdk/src/entities/access-policy/build.js +1 -1
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +4 -4
- package/dist-sdk/src/entities/access-policy/from-tf.js +12 -13
- package/dist-sdk/src/entities/access-policy/principal.d.ts +14 -4
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +14 -2
- package/dist-sdk/src/entities/access-policy/to-tf.js +36 -6
- package/dist-sdk/src/entities/agent/build.d.ts +3 -3
- package/dist-sdk/src/entities/agent/build.js +5 -5
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +6 -1
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +68 -18
- package/dist-sdk/src/entities/agent/from-tf.d.ts +3 -1
- package/dist-sdk/src/entities/agent/from-tf.js +12 -4
- 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 +2 -0
- package/dist-sdk/src/entities/agent/to-tf.d.ts +5 -2
- package/dist-sdk/src/entities/agent/to-tf.js +56 -8
- package/dist-sdk/src/entities/agent/tools.d.ts +38 -23
- package/dist-sdk/src/entities/agent/tools.js +21 -7
- package/dist-sdk/src/entities/agent-evaluation/build.d.ts +19 -0
- package/dist-sdk/src/entities/agent-evaluation/build.js +41 -0
- package/dist-sdk/src/entities/agent-evaluation/deserializer/print-agent-evaluation.d.ts +4 -0
- package/dist-sdk/src/entities/agent-evaluation/deserializer/print-agent-evaluation.js +30 -0
- package/dist-sdk/src/entities/agent-evaluation/from-tf.d.ts +12 -0
- package/dist-sdk/src/entities/agent-evaluation/from-tf.js +46 -0
- package/dist-sdk/src/entities/agent-evaluation/index.d.ts +1 -0
- package/dist-sdk/src/entities/agent-evaluation/index.js +1 -0
- package/dist-sdk/src/entities/agent-evaluation/module.d.ts +3 -0
- package/dist-sdk/src/entities/agent-evaluation/module.js +58 -0
- package/dist-sdk/src/entities/agent-evaluation/to-tf.d.ts +12 -0
- package/dist-sdk/src/entities/agent-evaluation/to-tf.js +35 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +8 -7
- package/dist-sdk/src/entities/agent-tool/from-tf.js +48 -6
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +10 -2
- package/dist-sdk/src/entities/agent-tool/to-tf.js +76 -28
- package/dist-sdk/src/entities/agent-tool/types.d.ts +0 -1
- package/dist-sdk/src/entities/agent-tool/types.js +10 -37
- package/dist-sdk/src/entities/app/build.d.ts +97 -42
- package/dist-sdk/src/entities/app/build.js +25 -14
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +32 -24
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.d.ts +1 -1
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.js +2 -0
- package/dist-sdk/src/entities/app/index.d.ts +11 -8
- package/dist-sdk/src/entities/app/index.js +10 -7
- package/dist-sdk/src/entities/app/module.js +2 -2
- package/dist-sdk/src/entities/app/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/app/to-tf.js +22 -6
- package/dist-sdk/src/entities/approval-chain/build.d.ts +1 -1
- package/dist-sdk/src/entities/approval-chain/build.js +5 -5
- package/dist-sdk/src/entities/approval-chain/index.d.ts +1 -1
- package/dist-sdk/src/entities/approval-chain/index.js +1 -1
- package/dist-sdk/src/entities/approval-chain/printer.js +2 -2
- package/dist-sdk/src/entities/automation/build.d.ts +172 -94
- package/dist-sdk/src/entities/automation/build.js +159 -68
- package/dist-sdk/src/entities/automation/calculation-expression.d.ts +191 -0
- package/dist-sdk/src/entities/automation/calculation-expression.js +57 -0
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +11 -4
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +18 -14
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +164 -198
- package/dist-sdk/src/entities/automation/from-tf.d.ts +26 -2
- package/dist-sdk/src/entities/automation/from-tf.js +510 -80
- package/dist-sdk/src/entities/automation/index.d.ts +9 -12
- package/dist-sdk/src/entities/automation/index.js +11 -13
- package/dist-sdk/src/entities/automation/module.js +74 -6
- package/dist-sdk/src/entities/automation/operators.d.ts +32 -48
- package/dist-sdk/src/entities/automation/operators.js +10 -37
- package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +1 -1
- package/dist-sdk/src/entities/automation/output-key-wire-name.js +1 -1
- package/dist-sdk/src/entities/automation/script-code.js +13 -22
- package/dist-sdk/src/entities/automation/serialize.js +1 -1
- package/dist-sdk/src/entities/automation/tasks.d.ts +153 -89
- package/dist-sdk/src/entities/automation/tasks.js +64 -11
- package/dist-sdk/src/entities/automation/to-tf.d.ts +10 -1
- package/dist-sdk/src/entities/automation/to-tf.js +342 -71
- package/dist-sdk/src/entities/automation/triggers.d.ts +17 -10
- package/dist-sdk/src/entities/automation/triggers.js +7 -1
- package/dist-sdk/src/entities/automation/types.d.ts +3 -2
- package/dist-sdk/src/entities/automation/types.js +3 -2
- package/dist-sdk/src/entities/chart/build.d.ts +95 -0
- package/dist-sdk/src/entities/chart/build.js +42 -0
- package/dist-sdk/src/entities/chart/from-tf.d.ts +55 -0
- package/dist-sdk/src/entities/chart/from-tf.js +269 -0
- package/dist-sdk/src/entities/chart/index.d.ts +4 -0
- package/dist-sdk/src/entities/chart/index.js +3 -0
- package/dist-sdk/src/entities/chart/module.d.ts +3 -0
- package/dist-sdk/src/entities/chart/module.js +61 -0
- package/dist-sdk/src/entities/chart/printer.d.ts +5 -0
- package/dist-sdk/src/entities/chart/printer.js +104 -0
- package/dist-sdk/src/entities/chart/to-tf.d.ts +15 -0
- package/dist-sdk/src/entities/chart/to-tf.js +150 -0
- package/dist-sdk/src/entities/chart/types.d.ts +53 -0
- package/dist-sdk/src/entities/chart/types.js +22 -0
- package/dist-sdk/src/entities/dashboard/build.d.ts +34 -7
- package/dist-sdk/src/entities/dashboard/build.js +16 -1
- package/dist-sdk/src/entities/dashboard/from-tf.js +22 -4
- package/dist-sdk/src/entities/dashboard/to-tf.d.ts +16 -3
- package/dist-sdk/src/entities/dashboard/to-tf.js +37 -10
- package/dist-sdk/src/entities/datamine/module.js +1 -1
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +4 -3
- package/dist-sdk/src/entities/dynamic-layout/build.js +1 -1
- package/dist-sdk/src/entities/dynamic-layout/dialect.d.ts +2 -0
- package/dist-sdk/src/entities/dynamic-layout/dialect.js +43 -5
- package/dist-sdk/src/entities/dynamic-layout/from-tf.js +12 -6
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +10 -10
- package/dist-sdk/src/entities/element/build.d.ts +25 -32
- package/dist-sdk/src/entities/element/build.js +15 -32
- package/dist-sdk/src/entities/element/index.d.ts +7 -5
- package/dist-sdk/src/entities/element/index.js +7 -4
- package/dist-sdk/src/entities/element/module.js +7 -3
- package/dist-sdk/src/entities/element/to-tf.d.ts +2 -1
- package/dist-sdk/src/entities/element/to-tf.js +7 -3
- package/dist-sdk/src/entities/field/build.d.ts +51 -24
- package/dist-sdk/src/entities/field/build.js +31 -6
- package/dist-sdk/src/entities/field/calc/aggregate.d.ts +52 -21
- package/dist-sdk/src/entities/field/calc/aggregate.js +59 -29
- package/dist-sdk/src/entities/field/calc/date.d.ts +78 -29
- package/dist-sdk/src/entities/field/calc/date.js +120 -29
- package/dist-sdk/src/entities/field/calc/index.d.ts +80 -85
- package/dist-sdk/src/entities/field/calc/index.js +82 -139
- package/dist-sdk/src/entities/field/calc/numeric.d.ts +8 -12
- package/dist-sdk/src/entities/field/calc/numeric.js +10 -27
- package/dist-sdk/src/entities/field/calc/runtime.d.ts +19 -2
- package/dist-sdk/src/entities/field/calc/runtime.js +79 -8
- package/dist-sdk/src/entities/field/calc/text.d.ts +32 -23
- package/dist-sdk/src/entities/field/calc/text.js +43 -31
- package/dist-sdk/src/entities/field/calc/types.d.ts +36 -81
- package/dist-sdk/src/entities/field/calc/types.js +1 -22
- package/dist-sdk/src/entities/field/calc.d.ts +71 -48
- package/dist-sdk/src/entities/field/calc.js +5 -15
- package/dist-sdk/src/entities/field/calculation-types.js +10 -3
- package/dist-sdk/src/entities/field/from-tf.js +156 -10
- package/dist-sdk/src/entities/field/locals.d.ts +11 -3
- package/dist-sdk/src/entities/field/locals.js +15 -2
- package/dist-sdk/src/entities/field/module.js +23 -6
- package/dist-sdk/src/entities/field/record-shape.d.ts +24 -10
- package/dist-sdk/src/entities/field/to-tf.d.ts +40 -1
- package/dist-sdk/src/entities/field/to-tf.js +293 -35
- package/dist-sdk/src/entities/field/types.d.ts +1 -1
- package/dist-sdk/src/entities/field/types.js +7 -1
- package/dist-sdk/src/entities/file-reader/build.d.ts +5 -0
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +1 -1
- package/dist-sdk/src/entities/org/cloud-link.js +4 -5
- package/dist-sdk/src/entities/org/email-alias.d.ts +2 -0
- package/dist-sdk/src/entities/org/email-alias.js +12 -0
- package/dist-sdk/src/entities/org/index.d.ts +1 -0
- package/dist-sdk/src/entities/org/index.js +1 -0
- package/dist-sdk/src/entities/org/phone-provider.js +4 -7
- package/dist-sdk/src/entities/organization/build.d.ts +214 -2
- package/dist-sdk/src/entities/organization/build.js +145 -4
- package/dist-sdk/src/entities/organization/index.d.ts +1 -1
- package/dist-sdk/src/entities/organization/index.js +1 -1
- package/dist-sdk/src/entities/organization/module.js +4 -1
- package/dist-sdk/src/entities/organization/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/organization/to-tf.js +118 -1
- package/dist-sdk/src/entities/phone-service/build.d.ts +1 -1
- package/dist-sdk/src/entities/phone-service/build.js +2 -2
- package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.js +5 -3
- package/dist-sdk/src/entities/phone-service/index.d.ts +1 -1
- package/dist-sdk/src/entities/phone-service/index.js +1 -1
- package/dist-sdk/src/entities/phone-service/types.js +1 -1
- package/dist-sdk/src/entities/record-create-form/to-tf.js +9 -1
- package/dist-sdk/src/entities/relationship/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/relationship/to-tf.js +5 -13
- package/dist-sdk/src/entities/search-table/build.d.ts +4 -4
- package/dist-sdk/src/entities/search-table/build.js +13 -13
- package/dist-sdk/src/entities/search-table/index.d.ts +2 -2
- package/dist-sdk/src/entities/search-table/index.js +2 -2
- package/dist-sdk/src/entities/search-table/printer.js +5 -5
- package/dist-sdk/src/entities/service-account/to-tf.d.ts +21 -0
- package/dist-sdk/src/entities/service-account/to-tf.js +32 -1
- package/dist-sdk/src/entities/shared/context.d.ts +25 -24
- package/dist-sdk/src/entities/shared/context.js +36 -35
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +10 -3
- package/dist-sdk/src/entities/shared/filters/ast.js +1 -0
- package/dist-sdk/src/entities/shared/filters/index.d.ts +2 -1
- package/dist-sdk/src/entities/shared/filters/index.js +11 -4
- package/dist-sdk/src/entities/shared/foreign-ref.d.ts +14 -0
- package/dist-sdk/src/entities/shared/foreign-ref.js +12 -0
- package/dist-sdk/src/entities/shared/ref.d.ts +26 -11
- package/dist-sdk/src/entities/shared/ref.js +8 -3
- package/dist-sdk/src/entities/shared/types/common.d.ts +2 -2
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +1 -1
- package/dist-sdk/src/entities/shared/types/field-types.js +1 -1
- package/dist-sdk/src/entities/skill/build.d.ts +2 -2
- package/dist-sdk/src/entities/skill/build.js +3 -3
- 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 +26 -7
- 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/module.js +2 -2
- package/dist-sdk/src/entities/skill/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/skill/to-tf.js +2 -2
- package/dist-sdk/src/entities/skill/tools.d.ts +4 -3
- package/dist-sdk/src/entities/skill/tools.js +4 -3
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +13 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.js +42 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.js +6 -6
- package/dist-sdk/src/entities/table/build.d.ts +1 -1
- package/dist-sdk/src/entities/table/build.js +9 -9
- package/dist-sdk/src/entities/table/catalog-render.js +9 -1
- package/dist-sdk/src/entities/table/deserializer/normalize.js +4 -4
- package/dist-sdk/src/entities/table/fields/types.d.ts +1 -1
- package/dist-sdk/src/entities/table/fields/types.js +1 -1
- package/dist-sdk/src/entities/table/index.d.ts +2 -2
- package/dist-sdk/src/entities/table/index.js +3 -3
- package/dist-sdk/src/entities/table/module.js +1 -1
- package/dist-sdk/src/entities/table/to-tf.js +22 -30
- package/dist-sdk/src/entities/task/build.d.ts +1 -1
- package/dist-sdk/src/entities/task/build.js +5 -5
- package/dist-sdk/src/entities/task/index.d.ts +1 -1
- package/dist-sdk/src/entities/task/index.js +1 -1
- package/dist-sdk/src/entities/view/build.d.ts +46 -0
- package/dist-sdk/src/entities/view/build.js +19 -0
- package/dist-sdk/src/entities/view/from-tf.js +68 -18
- package/dist-sdk/src/entities/view/module.d.ts +6 -13
- package/dist-sdk/src/entities/view/module.js +7 -14
- package/dist-sdk/src/entities/view/sharing.d.ts +10 -0
- package/dist-sdk/src/entities/view/sharing.js +6 -0
- package/dist-sdk/src/entities/view/to-tf.d.ts +21 -19
- package/dist-sdk/src/entities/view/to-tf.js +61 -26
- package/dist-sdk/src/entities/view/types.js +3 -0
- package/dist-sdk/src/entities/visual-flow/build.d.ts +1 -1
- package/dist-sdk/src/entities/visual-flow/build.js +8 -8
- package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -1
- package/dist-sdk/src/entities/visual-flow/index.js +1 -1
- package/dist-sdk/src/entities/visual-flow/module.js +1 -1
- package/dist-sdk/src/entities/visual-flow/printer.js +3 -3
- package/dist-sdk/src/entities/visual-flow/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.js +3 -7
- package/dist-sdk/src/entities/widget/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/widget/to-tf.js +9 -7
- package/dist-sdk/src/graph/index.d.ts +5 -1
- package/dist-sdk/src/graph/index.js +4 -1
- package/dist-sdk/src/graph/modules.js +6 -1
- package/dist-sdk/src/graph/types.d.ts +52 -1
- package/dist-sdk/src/internal/safe-identifier.d.ts +4 -0
- package/dist-sdk/src/internal/safe-identifier.js +13 -0
- package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
- package/dist-sdk/src/internal/sdk-package.js +1 -0
- package/package.json +12 -3
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AppOrElementRef, AutomationCatalogRef } from "../../catalog/index.js";
|
|
2
|
+
import { type DeployableEntity, type EntityDeployOptions, type RecordFieldContext } from "../../engine/entity.js";
|
|
3
|
+
import type { RecordShape } from "../field/record-shape.js";
|
|
2
4
|
import type { ServiceAccountRef } from "../service-account/ref.js";
|
|
3
|
-
import { type Context } from "../shared/context.js";
|
|
5
|
+
import { type Context, type ForEachItem } from "../shared/context.js";
|
|
4
6
|
import { type Ref, type Simplify, type ValueOrRef } from "../shared/ref.js";
|
|
5
|
-
import { type DeployableEntity, type EntityDeployOptions, type RecordFieldContext } from "../../engine/entity.js";
|
|
6
7
|
import type { Filter } from "./filter.js";
|
|
7
8
|
import { type ScriptInput } from "./script-code.js";
|
|
8
|
-
/** Structural empty object — neutral element for the
|
|
9
|
+
/** Structural empty object — neutral element for the accumulated action map. */
|
|
9
10
|
type EmptyObject = {
|
|
10
11
|
[K in never]: never;
|
|
11
12
|
};
|
|
@@ -27,10 +28,10 @@ export interface TriggerDef<TOutput> {
|
|
|
27
28
|
/** The owning app's refName, when this trigger's `record` output is app-field-typed. */
|
|
28
29
|
readonly __recordApp?: string;
|
|
29
30
|
}
|
|
30
|
-
/** A named
|
|
31
|
-
export interface
|
|
31
|
+
/** A named nested action entry inside an operator (forEach/switch/forkJoin) branch. */
|
|
32
|
+
export interface NestedActionEntry {
|
|
32
33
|
readonly name: string;
|
|
33
|
-
readonly def:
|
|
34
|
+
readonly def: ActionDef<unknown>;
|
|
34
35
|
/** Display name distinct from `refKey` (`name`), when adopting a platform-authored task. */
|
|
35
36
|
readonly displayName?: string;
|
|
36
37
|
readonly hclParent?: string;
|
|
@@ -43,7 +44,7 @@ export interface ChildTask {
|
|
|
43
44
|
export interface OperatorChild {
|
|
44
45
|
readonly label: string | null;
|
|
45
46
|
readonly filter?: Filter;
|
|
46
|
-
readonly tasks: readonly
|
|
47
|
+
readonly tasks: readonly NestedActionEntry[];
|
|
47
48
|
/**
|
|
48
49
|
* The switch default branch's actual display label, when it deviates from
|
|
49
50
|
* the platform's usual "Default" (e.g. a manually renamed "Default Path").
|
|
@@ -63,18 +64,17 @@ export interface OperatorChild {
|
|
|
63
64
|
readonly defaultFilterMode?: "isDefault" | "explicitTrueFilter";
|
|
64
65
|
}
|
|
65
66
|
/**
|
|
66
|
-
*
|
|
67
|
-
* platform
|
|
68
|
-
*
|
|
69
|
-
* mirroring v1, where the task name lives inside the body). The wire task becomes
|
|
67
|
+
* An action definition produced by an internal or nested-action factory. `key`
|
|
68
|
+
* is the platform one-of discriminator (e.g. `"recordSearch"`); `config` is
|
|
69
|
+
* the action's inner body. The wire task becomes
|
|
70
70
|
* `{ [key]: { name, ...config } }`. Operators additionally carry
|
|
71
71
|
* `operatorChildren`, emitted as the wire task's `children`.
|
|
72
72
|
*/
|
|
73
|
-
export interface
|
|
73
|
+
export interface ActionDef<TOutput> {
|
|
74
74
|
readonly key: string;
|
|
75
75
|
readonly config: Record<string, unknown>;
|
|
76
76
|
readonly operatorChildren?: readonly OperatorChild[];
|
|
77
|
-
/** Phantom — the typed shape exposed as `ctx.
|
|
77
|
+
/** Phantom — the typed shape exposed as `ctx.actions.<name>`. */
|
|
78
78
|
readonly __output?: TOutput;
|
|
79
79
|
/** The owning app's refName, when this task's `record`/`records` output is app-field-typed. */
|
|
80
80
|
readonly __recordApp?: string;
|
|
@@ -82,11 +82,11 @@ export interface TaskDef<TOutput> {
|
|
|
82
82
|
/** Placeholder `forEachTaskRefKey` the forEach item proxy emits; replaced with the real refKey. */
|
|
83
83
|
export declare const FOR_EACH_PLACEHOLDER = "__forEach__";
|
|
84
84
|
/**
|
|
85
|
-
* The finalized
|
|
86
|
-
* serialized task list, and
|
|
87
|
-
* {@link
|
|
85
|
+
* The finalized automation body `automation` embeds — the wire trigger,
|
|
86
|
+
* serialized platform task list, and optional output properties. Produced by
|
|
87
|
+
* {@link ActionChain.__finalize}; not authored by hand.
|
|
88
88
|
*/
|
|
89
|
-
export interface
|
|
89
|
+
export interface ActionSequenceDef {
|
|
90
90
|
readonly trigger: unknown;
|
|
91
91
|
readonly tasks: Record<string, unknown>[];
|
|
92
92
|
readonly outputProperties?: {
|
|
@@ -95,19 +95,19 @@ export interface WorkflowDef {
|
|
|
95
95
|
value: unknown;
|
|
96
96
|
}>;
|
|
97
97
|
};
|
|
98
|
-
/** See {@link RecordFieldContext}. Omitted when no trigger/
|
|
98
|
+
/** See {@link RecordFieldContext}. Omitted when no trigger/action in this automation is record-bearing. */
|
|
99
99
|
readonly recordFieldContext?: RecordFieldContext;
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
102
|
-
* The minimal contract `
|
|
103
|
-
* that can finalize itself to a {@link
|
|
104
|
-
* satisfies this once a trigger is set ({@link
|
|
105
|
-
* stage ({@link
|
|
102
|
+
* The minimal contract `automation`'s `actions:` field accepts: anything
|
|
103
|
+
* that can finalize itself to a {@link ActionSequenceDef}. A `actions()` chain
|
|
104
|
+
* satisfies this once a trigger is set ({@link ActionBuilder}). The pre-trigger
|
|
105
|
+
* stage ({@link ActionsStarted}) does not, so a triggerless automation is a
|
|
106
106
|
* compile error at the assignment.
|
|
107
107
|
*/
|
|
108
|
-
export interface
|
|
109
|
-
/** @internal — consumed by `
|
|
110
|
-
__finalize():
|
|
108
|
+
export interface ActionChain {
|
|
109
|
+
/** @internal — consumed by `automation`; not part of the authoring API. */
|
|
110
|
+
__finalize(): ActionSequenceDef;
|
|
111
111
|
/** @internal — onDemand parameter metadata; empty for non-onDemand triggers. */
|
|
112
112
|
__triggerParams(): readonly TriggerParamMeta[];
|
|
113
113
|
/** @internal — output property names declared via `.outputs()`; empty if none. */
|
|
@@ -119,38 +119,26 @@ type OutputValue = Ref<unknown> | string | number | boolean | null;
|
|
|
119
119
|
type ResolvedRefs<I> = {
|
|
120
120
|
[K in keyof I]: I[K] extends Ref<infer T> ? T : I[K];
|
|
121
121
|
};
|
|
122
|
+
/** Static options or options computed from the typed outputs available so far. */
|
|
123
|
+
export type ActionOptions<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TOptions> = TOptions | ((ctx: Context<TTrigger, TActions, TVars>) => TOptions);
|
|
124
|
+
/** One context object for nested actions; forEach bodies add the current item. */
|
|
125
|
+
export type NestedActionContext<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> = Context<TTrigger, TActions, TVars> & ([TItem] extends [never] ? Record<never, never> : {
|
|
126
|
+
readonly item: ForEachItem<TItem>;
|
|
127
|
+
});
|
|
128
|
+
type BuilderActionOptions<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem, TOptions> = TOptions | ((ctx: NestedActionContext<TTrigger, TActions, TVars, TItem>) => TOptions);
|
|
129
|
+
type BuilderMode = "root" | "nested";
|
|
130
|
+
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>;
|
|
122
131
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* v3 fluent surface: trigger factories return this builder directly
|
|
128
|
-
* (`onDemand({...}).executeScript(...)`), and the Phase-1 task kinds have
|
|
129
|
-
* dedicated methods whose options take ctx-lambdas. The generic `.task()` stays
|
|
130
|
-
* as the escape hatch for every other kind.
|
|
132
|
+
* An automation body with a trigger set. Every implemented platform action is
|
|
133
|
+
* exposed as a direct method; there is intentionally no generic escape hatch.
|
|
134
|
+
* Options may be passed directly or returned from a typed context callback.
|
|
131
135
|
*/
|
|
132
|
-
|
|
133
|
-
type NotExecuteScriptTask<D> = D extends {
|
|
134
|
-
readonly key: "executeScript";
|
|
135
|
-
} ? never : D;
|
|
136
|
-
export interface WorkflowBuilder<TTrigger, TTasks extends Record<string, unknown>, TVars extends Record<string, unknown> = EmptyObject> extends WorkflowChain {
|
|
136
|
+
interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown> = EmptyObject, TMode extends BuilderMode = "root", TItem = never> {
|
|
137
137
|
/**
|
|
138
|
-
*
|
|
139
|
-
* {@link WorkflowBuilder.executeScript} for scripts (function-form `code`).
|
|
140
|
-
*/
|
|
141
|
-
task<TName extends string, TOutput>(name: TName, fn: (ctx: Context<TTrigger, TTasks, TVars>) => NotExecuteScriptTask<TaskDef<TOutput>>,
|
|
142
|
-
/**
|
|
143
|
-
* Display name distinct from `refKey` — only needed when adopting a
|
|
144
|
-
* platform-authored task whose wire `name` differs from its `refKey`
|
|
145
|
-
* (e.g. a UI-built "For Each" task, whose slugged refKey is "For_Each").
|
|
146
|
-
* Omit for normally-authored tasks; the wire name defaults to `refKey`.
|
|
147
|
-
*/
|
|
148
|
-
displayName?: string, hclParent?: "trigger" | string): WorkflowBuilder<TTrigger, Simplify<TTasks & Record<TName, TOutput>>, TVars>;
|
|
149
|
-
/**
|
|
150
|
-
* Fluent executeScript (v3). `inputs` is a ctx-lambda mapping input names to
|
|
138
|
+
* `inputs` is a ctx-lambda mapping input names to
|
|
151
139
|
* refs/values; `code` is ALWAYS a FUNCTION — the TS contract is the
|
|
152
140
|
* authoring surface (typed `input.parameters` from `inputs`; the return
|
|
153
|
-
* type flows to `ctx.
|
|
141
|
+
* type flows to `ctx.actions.<name>.result.*` downstream; no raw-string
|
|
154
142
|
* alternative — #125). Under `elementum build`, the body ships byte-exact
|
|
155
143
|
* from the automation file's own untranspiled source (see
|
|
156
144
|
* `tryExtractFromCurrentSource` in `script-code.ts`) rather than from the
|
|
@@ -164,13 +152,13 @@ export interface WorkflowBuilder<TTrigger, TTasks extends Record<string, unknown
|
|
|
164
152
|
* text). Pass `outputs` only to override: a non-text property whose value
|
|
165
153
|
* isn't a literal, or a return the scan can't enumerate. Pass `outputs:
|
|
166
154
|
* null` (rather than omitting it) to explicitly suppress inference — the
|
|
167
|
-
* printer does this for pulled
|
|
155
|
+
* printer does this for pulled actions whose platform resource genuinely
|
|
168
156
|
* carries no `output_schema`, so a rebuild doesn't invent one and drift
|
|
169
157
|
* from state.
|
|
170
158
|
*/
|
|
171
|
-
executeScript<TName extends string, I extends Record<string, ValueOrRef<unknown
|
|
172
|
-
readonly inputs?: (ctx:
|
|
173
|
-
readonly code: (input: ScriptInput<ResolvedRefs<I
|
|
159
|
+
executeScript<TName extends string, I extends Record<string, ValueOrRef<unknown>>, R extends Record<string, unknown> = Record<string, unknown>>(name: TName, opts: {
|
|
160
|
+
readonly inputs?: (ctx: NestedActionContext<TTrigger, TActions, TVars, TItem>) => I;
|
|
161
|
+
readonly code: (input: ScriptInput<ResolvedRefs<NoInfer<I>>>) => R;
|
|
174
162
|
/**
|
|
175
163
|
* Override the inferred output schema: property name → `"text" |
|
|
176
164
|
* "integer" | "number" | "decimal" | "boolean"`. `null` explicitly
|
|
@@ -178,73 +166,163 @@ export interface WorkflowBuilder<TTrigger, TTasks extends Record<string, unknown
|
|
|
178
166
|
* infers from the code body.
|
|
179
167
|
*/
|
|
180
168
|
readonly outputs?: Record<string, string> | null;
|
|
181
|
-
}):
|
|
169
|
+
}, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
182
170
|
result: R;
|
|
183
171
|
textResult: string;
|
|
184
|
-
}
|
|
172
|
+
}>;
|
|
185
173
|
/**
|
|
186
|
-
* Fluent setVariable
|
|
174
|
+
* Fluent setVariable: one variable, named the same as its action — read
|
|
187
175
|
* it downstream as `ctx.variables.<name>`, the variable's typed ref
|
|
188
176
|
* (`Ref<string>` for the default TEXT type). (The variable name is
|
|
189
|
-
* platform-visible and must be
|
|
190
|
-
* variable refs by name per
|
|
177
|
+
* platform-visible and must be automation-unique — ei's export resolves
|
|
178
|
+
* variable refs by name per automation — so it mirrors the action name rather
|
|
191
179
|
* than a fixed "value".) `value` is a ctx-lambda returning a ref, template,
|
|
192
180
|
* or literal (`(ctx) => "static"` for constants — the lambda form keeps
|
|
193
181
|
* `ctx` fully typed; a bare `ValueOrRef<unknown>` union would collapse to
|
|
194
182
|
* `unknown` and erase it).
|
|
195
183
|
*/
|
|
196
184
|
setVariable<TName extends string, TType extends string = "TEXT">(name: TName, opts: {
|
|
197
|
-
readonly value: (ctx:
|
|
185
|
+
readonly value: (ctx: NestedActionContext<TTrigger, TActions, TVars, TItem>) => ValueOrRef<unknown>;
|
|
198
186
|
/** Platform variable type (default "TEXT"). */
|
|
199
187
|
readonly type?: TType;
|
|
200
|
-
}):
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
188
|
+
}, displayName?: string, hclParent?: "trigger" | string): FluentActionBuilder<TMode, TItem, TTrigger, Simplify<TActions & Record<TName, Record<string, never>>>, Simplify<TVars & Record<TName, VariableValueOf<TType>>>>;
|
|
189
|
+
setVariable<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SetVariableOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
190
|
+
recordSearch<TName extends string, A extends AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RecordSearchOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").RecordSearchOutput<A>>;
|
|
191
|
+
tableRecordsSearch<TName extends string, A extends AppOrElementRef = AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").TableRecordsSearchOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").TableRecordsSearchOutput<A>>;
|
|
192
|
+
createRecord<TName extends string, A extends AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").CreateRecordOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").CreateRecordOutput<A>>;
|
|
193
|
+
updateField<TName extends string, A extends AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UpdateFieldOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
194
|
+
record: RecordShape<A>;
|
|
195
|
+
}>;
|
|
196
|
+
findRelatedRecords<TName extends string, A extends AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").FindRelatedRecordsOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").RecordSearchOutput<A>>;
|
|
197
|
+
relateRecords<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RelateRecordsOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
198
|
+
sendEmail<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SendEmailOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
199
|
+
postComment<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").PostCommentOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
200
|
+
notification<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").NotificationOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
201
|
+
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?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").AiAgentOutput<S>>;
|
|
202
|
+
aiClassify<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiClassifyOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
203
|
+
output: unknown;
|
|
204
|
+
}>;
|
|
205
|
+
aiSummarize<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiSummarizeOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
206
|
+
output: unknown;
|
|
207
|
+
}>;
|
|
208
|
+
aiTransform<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiTransformOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
209
|
+
output: unknown;
|
|
210
|
+
}>;
|
|
211
|
+
aiSearchTable<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiSearchTableOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").AiSearchTableOutput>;
|
|
212
|
+
aiFileAnalysis<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiFileAnalysisOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
213
|
+
output: unknown;
|
|
214
|
+
}>;
|
|
215
|
+
apiRequest<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApiRequestOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
216
|
+
response: unknown;
|
|
217
|
+
}>;
|
|
218
|
+
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?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").CalculationValueOutputs<Values>>;
|
|
219
|
+
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?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").CalculationOutputs<Entries>>;
|
|
220
|
+
procedure<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ProcedureOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
221
|
+
output: unknown;
|
|
222
|
+
}>;
|
|
223
|
+
runAutomation<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RunAutomationOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
224
|
+
output: unknown;
|
|
225
|
+
}>;
|
|
226
|
+
readFile<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ReadFileOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
227
|
+
output: unknown;
|
|
228
|
+
}>;
|
|
229
|
+
approvalChain<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApprovalChainOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
230
|
+
approvalStatusUpdate<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApprovalStatusUpdateOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
231
|
+
addWatcher<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AddWatcherOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
232
|
+
saveAttachment<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SaveAttachmentOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
233
|
+
userSearch<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UserSearchOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").RecordSearchOutput>;
|
|
234
|
+
initiateCall<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").InitiateCallOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
235
|
+
recordFieldLocking<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RecordFieldLockingOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
236
|
+
forEach<TName extends string, TForEachItem>(name: TName, opts: ForEachConfig<TTrigger, TActions, TVars, TItem, TForEachItem>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
237
|
+
switch<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, SwitchConfig<TTrigger, TActions, TVars, TItem>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
238
|
+
forkJoin<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, ForkJoinConfig<TTrigger, TActions, TVars, TItem>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
239
|
+
}
|
|
240
|
+
/** Internal finalizer returned by every operator-body builder. */
|
|
241
|
+
export interface NestedActionChain {
|
|
242
|
+
/** @internal — consumed by the enclosing operator. */
|
|
243
|
+
__children(): readonly NestedActionEntry[];
|
|
244
|
+
}
|
|
245
|
+
type FluentActionBuilder<TMode extends BuilderMode, TItem, TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>> = TMode extends "root" ? ActionBuilder<TTrigger, TActions, TVars> : NestedActionBuilder<TTrigger, TActions, TVars, TItem>;
|
|
246
|
+
/** Top-level automation action chain. */
|
|
247
|
+
export type ActionBuilder<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown> = EmptyObject> = ActionMethods<TTrigger, TActions, TVars, "root", never> & ActionChain & {
|
|
248
|
+
outputs(fn: (ctx: Context<TTrigger, TActions, TVars>) => Record<string, OutputValue>): ActionBuilder<TTrigger, TActions, TVars>;
|
|
249
|
+
};
|
|
250
|
+
/** Fluent actions inside one operator body or branch. */
|
|
251
|
+
export type NestedActionBuilder<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown> = EmptyObject, TItem = never> = ActionMethods<TTrigger, TActions, TVars, "nested", TItem> & NestedActionChain;
|
|
252
|
+
/** A forEach body builder. Its action context adds `ctx.item`. */
|
|
253
|
+
export type ForEachBuilder<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem> = NestedActionBuilder<TTrigger, TActions, TVars, TItem>;
|
|
254
|
+
/** A switch-case/default body builder. */
|
|
255
|
+
export type SwitchCaseBuilder<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> = NestedActionBuilder<TTrigger, TActions, TVars, TItem>;
|
|
256
|
+
/** A forkJoin branch body builder. */
|
|
257
|
+
export type ForkJoinBranchBuilder<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> = NestedActionBuilder<TTrigger, TActions, TVars, TItem>;
|
|
258
|
+
export interface ForEachConfig<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TEnclosingItem, TItem> {
|
|
259
|
+
readonly collection: Ref<readonly TItem[]> | ((ctx: NestedActionContext<TTrigger, TActions, TVars, TEnclosingItem>) => Ref<readonly TItem[]>);
|
|
260
|
+
readonly actions: (actions: ForEachBuilder<TTrigger, TActions, TVars, NoInfer<TItem>>) => NestedActionChain;
|
|
261
|
+
}
|
|
262
|
+
export interface SwitchCase<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> {
|
|
263
|
+
readonly label: string;
|
|
264
|
+
readonly condition?: Filter;
|
|
265
|
+
readonly actions: (actions: SwitchCaseBuilder<TTrigger, TActions, TVars, TItem>) => NestedActionChain;
|
|
266
|
+
}
|
|
267
|
+
export interface SwitchConfig<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> {
|
|
268
|
+
readonly cases: readonly SwitchCase<TTrigger, TActions, TVars, TItem>[];
|
|
269
|
+
readonly defaultActions?: ((actions: SwitchCaseBuilder<TTrigger, TActions, TVars, TItem>) => NestedActionChain) | {
|
|
270
|
+
readonly label?: string;
|
|
271
|
+
readonly actions: (actions: SwitchCaseBuilder<TTrigger, TActions, TVars, TItem>) => NestedActionChain;
|
|
272
|
+
readonly defaultFilterMode?: "isDefault" | "explicitTrueFilter";
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
export interface ForkJoinBranch<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> {
|
|
276
|
+
readonly label: string;
|
|
277
|
+
readonly actions: (actions: ForkJoinBranchBuilder<TTrigger, TActions, TVars, TItem>) => NestedActionChain;
|
|
278
|
+
}
|
|
279
|
+
export interface ForkJoinConfig<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> {
|
|
280
|
+
readonly branches: readonly ForkJoinBranch<TTrigger, TActions, TVars, TItem>[];
|
|
208
281
|
}
|
|
209
282
|
/** Platform variable type → the TS value type its `ctx.variables.<name>` ref carries. */
|
|
210
283
|
type VariableValueOf<T extends string> = T extends "TEXT" ? string : T extends "NUMBER" | "DECIMAL" | "INTEGER" ? number : T extends "BOOLEAN" ? boolean : unknown;
|
|
211
|
-
/** The pre-trigger stage — a trigger must be set before
|
|
212
|
-
export interface
|
|
213
|
-
trigger<TOutput>(trigger: TriggerDef<TOutput>):
|
|
284
|
+
/** The pre-trigger stage — a trigger must be set before actions or outputs. */
|
|
285
|
+
export interface ActionsStarted {
|
|
286
|
+
trigger<TOutput>(trigger: TriggerDef<TOutput>): ActionBuilder<TOutput, EmptyObject>;
|
|
214
287
|
}
|
|
215
288
|
/**
|
|
216
|
-
* A trigger that is
|
|
217
|
-
*
|
|
218
|
-
* or keep the legacy `defineWorkflow().trigger(...)` form; both accept it.
|
|
289
|
+
* A trigger that is also the start of an action chain: assign it to `actions:`
|
|
290
|
+
* and chain methods directly, or use `actions().trigger(...)`.
|
|
219
291
|
*/
|
|
220
|
-
export type TriggerChain<TOutput> = TriggerDef<TOutput> &
|
|
292
|
+
export type TriggerChain<TOutput> = TriggerDef<TOutput> & ActionBuilder<TOutput, EmptyObject>;
|
|
221
293
|
/** Wrap a TriggerDef so it doubles as the chain start. Used by the trigger factories. */
|
|
222
294
|
export declare function chainableTrigger<TOutput>(trigger: TriggerDef<TOutput>): TriggerChain<TOutput>;
|
|
223
295
|
/**
|
|
224
|
-
* Begin
|
|
225
|
-
* with `.outputs(
|
|
226
|
-
* `workflow:` field — no terminal `.build()`.
|
|
296
|
+
* Begin an automation body. Set a trigger, chain direct action methods,
|
|
297
|
+
* optionally close with `.outputs()`, then assign it to `actions:`.
|
|
227
298
|
*/
|
|
228
|
-
export declare function
|
|
229
|
-
|
|
299
|
+
export declare function actions(): ActionsStarted;
|
|
300
|
+
/** User-authorable automation lifecycle states. */
|
|
301
|
+
export declare const automationStatus: {
|
|
302
|
+
readonly draft: "DRAFT";
|
|
303
|
+
readonly inactive: "INACTIVE";
|
|
304
|
+
readonly active: "ACTIVE";
|
|
305
|
+
};
|
|
306
|
+
export type AutomationStatus = (typeof automationStatus)[keyof typeof automationStatus];
|
|
307
|
+
export interface AutomationOptions extends EntityDeployOptions {
|
|
230
308
|
/** The automation's display name. Changing it updates the existing automation. */
|
|
231
309
|
readonly name: string;
|
|
232
|
-
/** Explicit SemVer publish gate. Bump only when this
|
|
233
|
-
readonly
|
|
310
|
+
/** Explicit SemVer publish gate. Bump only when this automation should become live. */
|
|
311
|
+
readonly revision: string;
|
|
234
312
|
/** Optional platform description, preserved by the Terraform authoring path. */
|
|
235
313
|
readonly description?: string;
|
|
236
|
-
/** Whether this
|
|
314
|
+
/** Whether this automation may trigger other automations. */
|
|
237
315
|
readonly triggersOtherAutomations?: boolean;
|
|
238
|
-
/** The app that owns this automation. */
|
|
239
|
-
readonly app:
|
|
240
|
-
readonly status?:
|
|
241
|
-
/** App-owned identity used to execute this
|
|
316
|
+
/** The app or element that owns this automation. */
|
|
317
|
+
readonly app: AppOrElementRef;
|
|
318
|
+
readonly status?: AutomationStatus;
|
|
319
|
+
/** App-owned identity used to execute this automation. */
|
|
242
320
|
readonly serviceAccount?: ServiceAccountRef;
|
|
243
|
-
/** The
|
|
244
|
-
readonly
|
|
321
|
+
/** The trigger plus fluent action chain. */
|
|
322
|
+
readonly actions: ActionChain;
|
|
245
323
|
}
|
|
246
324
|
/**
|
|
247
|
-
* The configured result of `
|
|
325
|
+
* The configured result of `automation` — its reference surface (`ref()`)
|
|
248
326
|
* and its deployable entity (`def()`). Both take `refName` as a **call-time
|
|
249
327
|
* argument** (the file's own name, never stored on the entity) — see
|
|
250
328
|
* `AppConfigured` in `src/aspects/build.ts` for the design rationale.
|
|
@@ -259,5 +337,5 @@ export interface AutomationConfigured {
|
|
|
259
337
|
* automation plans as an update rather than a create. Returns an
|
|
260
338
|
* `AutomationConfigured` with `ref(refName)` and `def(refName)`.
|
|
261
339
|
*/
|
|
262
|
-
export declare function
|
|
340
|
+
export declare function automation(opts: AutomationOptions): AutomationConfigured;
|
|
263
341
|
export {};
|