@elementumai/edk 0.9.2 → 0.9.5
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,24 +1,21 @@
|
|
|
1
|
+
export { userRef, type RoleUserRef as AutomationUserRef } from "../role/build.js";
|
|
2
|
+
export { serviceAccountRef, type ServiceAccountRef } from "../service-account/ref.js";
|
|
3
|
+
export { calc, param as calculationParam, calculationParameterType, dateDifUnit, dateDiffUnit, dateTimeTruncPrecision, orderByDirection, predicateOp, weekdayMode, type CalculationBuilder, type CalculationParameterExprType, type CalculationParameterOptions, type CalculationValue, type ConcatExprType, type DateDifUnit, type DateDiffUnit, type DateTimePrecision, type DateTimeTruncPrecision, type ErgonomicOrderByDirection, type ErgonomicPredicate, type JsonValue, type OrderByDirection, type ParameterExprType, type Predicate, type PredicateInput, type PredicateOp, type StringAggOptions, type StringAggOrderBy, type WeekdayConvention, type WeekdayMode } from "./calculation-expression.js";
|
|
1
4
|
export { automationFromTf, type AutomationFromTfResult } from "./from-tf.js";
|
|
2
5
|
export { automationModule } from "./module.js";
|
|
3
|
-
export { AUTOMATION_RESOURCE_TYPES, AUTOMATION_TRIGGER_TYPES, AUTOMATION_TASK_TYPES } from "./types.js";
|
|
4
6
|
export { automationToTf, type AutomationToTfContext, type AutomationToTfResult } from "./to-tf.js";
|
|
5
|
-
export {
|
|
6
|
-
export { userRef, type RoleUserRef as AutomationUserRef } from "../role/build.js";
|
|
7
|
+
export { AUTOMATION_RESOURCE_TYPES, AUTOMATION_TASK_TYPES, AUTOMATION_TRIGGER_TYPES } from "./types.js";
|
|
7
8
|
/**
|
|
8
9
|
* v2 automation authoring — the typed, chainable builder (validation slice).
|
|
9
10
|
*
|
|
10
11
|
* The typed `ctx` engine is reused from `src/core` (`context` + `ref`); only the
|
|
11
|
-
* builder shell, trigger/
|
|
12
|
+
* builder shell, trigger/action factories, and the token-aware serializer are v2.
|
|
12
13
|
* References inside one automation flow through `ctx` (compile-time-safe);
|
|
13
14
|
* cross-entity references are `CatalogRef` tokens resolved at deploy. Standalone
|
|
14
15
|
* from v1's deploy-wired builder.
|
|
15
16
|
*/
|
|
16
|
-
export { chainableTrigger, defineAutomation, defineWorkflow, type AutomationConfigured, type AutomationV2Options, type ChildTask, type OperatorChild, type TaskDef, type TriggerChain, type TriggerDef, type WorkflowBuilder, type WorkflowChain, type WorkflowDef, type WorkflowStarted, type TriggerParamMeta, } from "./build.js";
|
|
17
|
-
export { ScriptCodeError, type ScriptCodeFn, type ScriptInput } from "./script-code.js";
|
|
18
|
-
export { childTask, forEach, forkJoin, switchTask, type ForEachConfig, type ForkJoinBranch, type ForkJoinConfig, type SwitchCase, type SwitchConfig, } from "./operators.js";
|
|
19
|
-
export { approvalProcessStatusUpdated, attachment, commentAdded, conversationEnd, dataMine, emailReceived, onDemand, recordCreated, recordUpdated, schedule, slackMessage, surveyResponseCreate, temporal, webHook, webhook, type AttachmentTriggerOptions, type AttachmentTriggerOutput, type approvalProcessStatusUpdatedStatus, type approvalProcessStatusUpdatedTriggerOptions, type CommentAddedTriggerOptions, type CommentAddedTriggerOutput, type ConversationEndConversationType, type ConversationEndTriggerOptions, type ConversationEndTriggerOutput, type DataMineTriggerOptions, type EmailReceivedTriggerOptions, type EmailReceivedTriggerOutput, type RecordTriggerOptions, type RecordTriggerOutput, type ScheduleFrequency, type Weekday, type ScheduleTriggerOptions, type ScheduleTriggerOutput, type SlackMessageTriggerOutput, type SurveyResponseCreateTriggerOptions, type SurveyResponseCreateTriggerOutput, type TemporalTriggerOptions, type TemporalUnit, type WebhookTriggerOptions, type WebhookTriggerOutput, } from "./triggers.js";
|
|
20
|
-
export { aiAgent, aiClassify, aiEmailAnalysis, aiFileAnalysis, aiSearchTable, aiSummarize, aiTransform, apiRequest, createRecord, executeScript, findRelatedRecords, postComment, recordSearch, relateRecords, sendEmail, setVariable, tableRecordsSearch, updateField, type AiAgentOptions, type AiAgentOutput, type AiAgentOutputField, type AiAgentOutputFieldType, type AiClassifyCategorySource, type AiClassifyOptions, type AiClassifyStaticCategory, type AiEmailAnalysisOptions, type AiFileAnalysisOptions, type AiSearchTableOptions, type AiSummarizeOptions, type AiTransformOptions, type ApiRequestHeader, type ApiRequestOptions, type CreateRecordOptions, type CreateRecordOutput, type EmailAttachment, type ExecuteScriptOptions, type FieldAssignment, type FindRelatedRecordsOptions, type PostCommentOptions, type RecordSearchOptions, type RecordSearchOutput, type RelateRecordsOptions, type SendEmailOptions, type SetVariableOptions, type TableRecordsSearchOptions, type TableRecordsSearchOutput, type UpdateFieldOptions, type VariableAssign, type VariableDecl, } from "./tasks.js";
|
|
21
|
-
export { addWatcher, approvalStatusUpdate, assignGroup, assignUser, assignmentEngine, calculation, filterTask, generateReport, initiateCall, notification, postTeamsMessage, procedure, recordFieldLocking, saveAttachment, unzip, userGroupSearch, userSearch, type AddWatcherOptions, type ApprovalStatusUpdateOptions, type AssignGroupOptions, type AssignUserOptions, type AssignmentEngineOptions, type CalculationEntry, type CalculationOptions, type FilterTaskOptions, type GenerateReportOptions, type InitiateCallOptions, type NotificationOptions, type PostTeamsMessageOptions, type ProcedureOptions, type RecordFieldLockingOptions, type SaveAttachmentOptions, type UnzipOptions, type UserSearchOptions, } from "./tasks.js";
|
|
22
|
-
export { approvalChainTemplate, approvalChain, bulkExcel, readFile, initiateEmailConversation, runAutomation, sendSurvey, type ApprovalChainOptions, type ApprovalChainTemplateOptions, type BulkExcelFieldMapping, type BulkExcelFieldSource, type BulkExcelOptions, type ReadFileDataSource, type ReadFileOptions, type InitiateEmailConversationOptions, type InitiateEmailFirstEmail, type RunAutomationInput, type RunAutomationOptions, type SendSurveyOptions, } from "./tasks.js";
|
|
23
17
|
export * as filter from "../shared/filters/index.js";
|
|
24
|
-
export { type
|
|
18
|
+
export { automationStatus, chainableTrigger, actions, automation, type ActionBuilder, type ActionChain, type ActionDef, type ActionOptions, type ActionSequenceDef, type ActionsStarted, type AutomationConfigured, type AutomationOptions, type AutomationStatus, type ForkJoinBranch, type ForkJoinBranchBuilder, type ForkJoinConfig, type ForEachBuilder, type ForEachConfig, type NestedActionBuilder, type NestedActionChain, type NestedActionContext, type OperatorChild, type SwitchCase, type SwitchCaseBuilder, type SwitchConfig, type TriggerChain, type TriggerDef, type TriggerParamMeta } from "./build.js";
|
|
19
|
+
export { ScriptCodeError, type ScriptCodeFn, type ScriptInput } from "./script-code.js";
|
|
20
|
+
export { addWatcher, aiAgent, aiClassify, aiEmailAnalysis, aiFileAnalysis, aiSearchTable, aiSummarize, aiTransform, apiRequest, approvalChain, approvalChainTemplate, approvalStatusUpdate, assignGroup, assignUser, assignmentEngine, bulkExcel, calculation, createRecord, executeScript, filterAction, findRelatedRecords, generateReport, initiateCall, initiateEmailConversation, notification, postComment, postTeamsMessage, procedure, readFile, recordFieldLocking, recordSearch, relateRecords, runAutomation, saveAttachment, sendEmail, sendSurvey, setVariable, tableRecordsSearch, unzip, updateField, userGroupSearch, userSearch, type AddWatcherOptions, type AiAgentOptions, type AiAgentOutput, type AiAgentOutputField, type AiAgentOutputFieldType, type AiClassifyCategorySource, type AiClassifyOptions, type AiClassifyStaticCategory, type AiEmailAnalysisOptions, type AiFileAnalysisOptions, type AiSearchTableOptions, type AiSearchTableOutput, type AiSummarizeOptions, type AiTransformOptions, type ApiRequestHeader, type ApiRequestOptions, type ApprovalChainOptions, type ApprovalChainTemplateOptions, type ApprovalStatusUpdateOptions, type AssignGroupOptions, type AssignUserOptions, type AssignmentEngineOptions, type BulkExcelFieldMapping, type BulkExcelFieldSource, type BulkExcelOptions, type CalculationEntry, type CalculationExpression, type CalculationInclude, type CalculationOptions, type CalculationOutputs, type CalculationValueInput, type CalculationValueOptions, type CalculationValueOutputs, type CalculationValues, type CreateRecordOptions, type CreateRecordOutput, type EmailAttachment, type ExecuteScriptOptions, type FieldAssignment, type FilterActionOptions, type FindRelatedRecordsOptions, type GenerateReportOptions, type InitiateCallOptions, type InitiateEmailConversationOptions, type InitiateEmailFirstEmail, type LegacyCalculationOptions, type NotificationOptions, type PostCommentOptions, type PostTeamsMessageOptions, type ProcedureOptions, type ReadFileDataSource, type ReadFileOptions, type RecordFieldLockingOptions, type RecordId, type RecordReference, type RecordSearchOptions, type RecordSearchOutput, type RelateRecordsOptions, type RunAutomationInput, type RunAutomationOptions, type SaveAttachmentOptions, type SendEmailOptions, type SendSurveyOptions, type SetVariableOptions, type TableRecordsSearchOptions, type TableRecordsSearchOutput, type UnzipOptions, type UpdateFieldOptions, type UserSearchOptions, type VariableAssign, type VariableDecl } from "./tasks.js";
|
|
21
|
+
export { approvalProcessStatusUpdated, attachment, commentAdded, conversationEnd, dataMine, emailReceived, onDemand, recordCreated, recordUpdated, schedule, slackMessage, surveyResponseCreate, temporal, webHook, webhook, type AttachmentTriggerOptions, type AttachmentTriggerOutput, type CommentAddedTriggerOptions, type CommentAddedTriggerOutput, type ConversationEndConversationType, type ConversationEndTriggerOptions, type ConversationEndTriggerOutput, type DataMineTriggerOptions, type EmailReceivedTriggerOptions, type EmailReceivedTriggerOutput, type RecordTriggerOptions, type RecordTriggerOutput, type ScheduleFrequency, type ScheduleTriggerOptions, type ScheduleTriggerOutput, type SlackMessageTriggerOutput, type SurveyResponseCreateTriggerOptions, type SurveyResponseCreateTriggerOutput, type TemporalTriggerOptions, type TemporalUnit, type WebhookTriggerOptions, type WebhookTriggerOutput, type Weekday, type approvalProcessStatusUpdatedStatus, type approvalProcessStatusUpdatedTriggerOptions } from "./triggers.js";
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
+
export { userRef } from "../role/build.js";
|
|
2
|
+
export { serviceAccountRef } from "../service-account/ref.js";
|
|
3
|
+
export { calc, param as calculationParam, calculationParameterType, dateDifUnit, dateDiffUnit, dateTimeTruncPrecision, orderByDirection, predicateOp, weekdayMode } from "./calculation-expression.js";
|
|
1
4
|
export { automationFromTf } from "./from-tf.js";
|
|
2
5
|
export { automationModule } from "./module.js";
|
|
3
|
-
export { AUTOMATION_RESOURCE_TYPES, AUTOMATION_TRIGGER_TYPES, AUTOMATION_TASK_TYPES } from "./types.js";
|
|
4
6
|
export { automationToTf } from "./to-tf.js";
|
|
5
|
-
export {
|
|
6
|
-
export { userRef } from "../role/build.js";
|
|
7
|
+
export { AUTOMATION_RESOURCE_TYPES, AUTOMATION_TASK_TYPES, AUTOMATION_TRIGGER_TYPES } from "./types.js";
|
|
7
8
|
/**
|
|
8
9
|
* v2 automation authoring — the typed, chainable builder (validation slice).
|
|
9
10
|
*
|
|
10
11
|
* The typed `ctx` engine is reused from `src/core` (`context` + `ref`); only the
|
|
11
|
-
* builder shell, trigger/
|
|
12
|
+
* builder shell, trigger/action factories, and the token-aware serializer are v2.
|
|
12
13
|
* References inside one automation flow through `ctx` (compile-time-safe);
|
|
13
14
|
* cross-entity references are `CatalogRef` tokens resolved at deploy. Standalone
|
|
14
15
|
* from v1's deploy-wired builder.
|
|
15
16
|
*/
|
|
16
|
-
export { chainableTrigger, defineAutomation, defineWorkflow, } from "./build.js";
|
|
17
|
-
export { ScriptCodeError } from "./script-code.js";
|
|
18
|
-
export { childTask, forEach, forkJoin, switchTask, } from "./operators.js";
|
|
19
|
-
export { approvalProcessStatusUpdated, attachment, commentAdded, conversationEnd, dataMine, emailReceived, onDemand, recordCreated, recordUpdated, schedule, slackMessage, surveyResponseCreate, temporal, webHook, webhook, } from "./triggers.js";
|
|
20
|
-
export { aiAgent, aiClassify, aiEmailAnalysis, aiFileAnalysis, aiSearchTable, aiSummarize, aiTransform, apiRequest, createRecord, executeScript, findRelatedRecords, postComment, recordSearch, relateRecords, sendEmail, setVariable, tableRecordsSearch, updateField, } from "./tasks.js";
|
|
21
|
-
export { addWatcher, approvalStatusUpdate, assignGroup, assignUser, assignmentEngine, calculation, filterTask, generateReport, initiateCall, notification, postTeamsMessage, procedure, recordFieldLocking, saveAttachment, unzip, userGroupSearch, userSearch, } from "./tasks.js";
|
|
22
|
-
export { approvalChainTemplate, approvalChain, bulkExcel, readFile, initiateEmailConversation, runAutomation, sendSurvey, } from "./tasks.js";
|
|
23
17
|
export * as filter from "../shared/filters/index.js";
|
|
24
|
-
|
|
18
|
+
export { automationStatus, chainableTrigger, actions, automation } from "./build.js";
|
|
19
|
+
export { ScriptCodeError } from "./script-code.js";
|
|
20
|
+
export { addWatcher, aiAgent, aiClassify, aiEmailAnalysis, aiFileAnalysis, aiSearchTable, aiSummarize, aiTransform, apiRequest, approvalChain, approvalChainTemplate, approvalStatusUpdate, assignGroup, assignUser, assignmentEngine, bulkExcel, calculation, createRecord, executeScript, filterAction, findRelatedRecords, generateReport, initiateCall, initiateEmailConversation, notification, postComment, postTeamsMessage, procedure, readFile, recordFieldLocking, recordSearch, relateRecords, runAutomation, saveAttachment, sendEmail, sendSurvey, setVariable, tableRecordsSearch, unzip, updateField, userGroupSearch, userSearch } from "./tasks.js";
|
|
21
|
+
export { approvalProcessStatusUpdated, attachment, commentAdded, conversationEnd, dataMine, emailReceived, onDemand, recordCreated, recordUpdated, schedule, slackMessage, surveyResponseCreate, temporal, webHook, webhook } from "./triggers.js";
|
|
22
|
+
// Pull a deployed automation back as editable v2 source. `automation`
|
|
25
23
|
// is a plain factory returning a builder-chain object (not an Object.assign-able
|
|
26
24
|
// callable), so `fromJSON` ships as a standalone named export rather than a
|
|
27
|
-
// `
|
|
25
|
+
// `automation.fromJSON` attachment.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** The automation entity's registry entry (see src/graph/). */
|
|
2
|
-
import { sanitizeName, tfLabelToTsLabel } from "../../engine/tf/index.js";
|
|
2
|
+
import { sanitizeName, tfLabelToTsLabel, isTfExpr } from "../../engine/tf/index.js";
|
|
3
3
|
import { renderAutomationCatalogEntry } from "./catalog-render.js";
|
|
4
4
|
import { printAutomationV2 } from "./deserializer/print-automation.js";
|
|
5
5
|
import { automationFromTf, automationOwnedAddresses } from "./from-tf.js";
|
|
@@ -58,15 +58,65 @@ function automationRefFromAuthoring(args) {
|
|
|
58
58
|
...(outputs !== undefined ? { outputs } : {}),
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Scan an automation's owned task blocks for foreign `object_id =
|
|
63
|
+
* data.elementum_app|element.<label>.id` targets and register their display
|
|
64
|
+
* names on `ctx.unresolvedForeignRefs` when they aren't already in this
|
|
65
|
+
* workspace's name maps.
|
|
66
|
+
*
|
|
67
|
+
* Must run *before* `automationFromTf`: a createRecord/updateField whose
|
|
68
|
+
* fields are bare UUIDs of a foreign aspect (ei apps export
|
|
69
|
+
* `--recursive=false` never includes that aspect's field resources) throws
|
|
70
|
+
* and never lands in `ownFileByKind`, so `collectForeignReferences` can't
|
|
71
|
+
* see the dependency. Without this pre-scan, `pull app --with-dependencies`
|
|
72
|
+
* never chases the foreign aspect and the automation stays permanently
|
|
73
|
+
* unextractable. Same feed as relation-field `resolveRelatedObject`.
|
|
74
|
+
*/
|
|
75
|
+
function registerForeignObjectIdDeps(doc, automationLabel, ctx) {
|
|
76
|
+
const unresolved = ctx.unresolvedForeignRefs;
|
|
77
|
+
if (unresolved === undefined)
|
|
78
|
+
return;
|
|
79
|
+
const owned = new Set(automationOwnedAddresses(doc, automationLabel));
|
|
80
|
+
for (const block of doc.blocks) {
|
|
81
|
+
if (block.kind !== "resource" || block.type === undefined || block.label === undefined)
|
|
82
|
+
continue;
|
|
83
|
+
if (!owned.has(`${block.type}.${block.label}`))
|
|
84
|
+
continue;
|
|
85
|
+
const objectId = block.attrs["object_id"];
|
|
86
|
+
if (!isTfExpr(objectId) || objectId.$expr !== "data-attr")
|
|
87
|
+
continue;
|
|
88
|
+
if (objectId.type === "elementum_app") {
|
|
89
|
+
const name = ctx.dataName("elementum_app", objectId.label);
|
|
90
|
+
if (name === undefined || ctx.foreignAppRefNames?.has(name))
|
|
91
|
+
continue;
|
|
92
|
+
unresolved.apps.add(name);
|
|
93
|
+
}
|
|
94
|
+
else if (objectId.type === "elementum_element") {
|
|
95
|
+
const name = ctx.dataName("elementum_element", objectId.label);
|
|
96
|
+
if (name === undefined || ctx.foreignElementRefNames?.has(name))
|
|
97
|
+
continue;
|
|
98
|
+
unresolved.elements.add(name);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
61
102
|
function extractAutomations(ownBlocks, stream, ctx) {
|
|
62
103
|
const items = [];
|
|
63
104
|
const skipped = [];
|
|
64
105
|
const diagnostics = [];
|
|
65
106
|
for (const autoBlock of ownBlocks) {
|
|
66
107
|
const autoLabel = autoBlock.label ?? "";
|
|
108
|
+
const doc = { blocks: [...stream.allBlocks] };
|
|
109
|
+
// Always — including when extract succeeds — so a partial decode that
|
|
110
|
+
// somehow omits the app RefExpr still feeds --with-dependencies. Cheap
|
|
111
|
+
// (one owned-address walk) relative to from-tf.
|
|
112
|
+
registerForeignObjectIdDeps(doc, autoLabel, ctx);
|
|
67
113
|
try {
|
|
68
|
-
const extracted = automationFromTf(
|
|
69
|
-
|
|
114
|
+
const extracted = automationFromTf(doc, autoLabel, ctx.appRefName, ctx.foreignFieldRefsById, ctx.foreignFieldRefsByDataAddress, ctx.foreignTableRefsById, ctx.picklistOptionLabelById, ctx.fieldNamesByOwnerRefName, ctx.foreignAppRefNames, ctx.foreignElementRefNames);
|
|
115
|
+
// Keep automationFromTf's label-derived refName — agent/skill tools store
|
|
116
|
+
// the same scopedLabelToBagKey as automationKey. Pushing bare AST (name
|
|
117
|
+
// only) made missing-automation diagnostics false-positive on every real
|
|
118
|
+
// extract (issue #395 / PR #417 review).
|
|
119
|
+
items.push({ ...extracted.ast, refName: extracted.refName });
|
|
70
120
|
}
|
|
71
121
|
catch (err) {
|
|
72
122
|
// Report the automation's FULL graph (trigger/tasks/branches/publish),
|
|
@@ -74,7 +124,7 @@ function extractAutomations(ownBlocks, stream, ctx) {
|
|
|
74
124
|
// resource TYPES get imported into state anyway, and build (which
|
|
75
125
|
// never wrote this automation to source) can't reproduce them, so
|
|
76
126
|
// `plan` shows them as destroy-on-apply. See automationOwnedAddresses.
|
|
77
|
-
skipped.push(...automationOwnedAddresses(
|
|
127
|
+
skipped.push(...automationOwnedAddresses(doc, autoLabel));
|
|
78
128
|
diagnostics.push(`${autoLabel}: ${err instanceof Error ? err.message : String(err)}`);
|
|
79
129
|
}
|
|
80
130
|
}
|
|
@@ -101,7 +151,16 @@ export const automationModule = {
|
|
|
101
151
|
})),
|
|
102
152
|
],
|
|
103
153
|
},
|
|
104
|
-
data: {
|
|
154
|
+
data: {
|
|
155
|
+
participates: true,
|
|
156
|
+
resourceType: AUTOMATION_RESOURCE_TYPE,
|
|
157
|
+
lookupAttr: "name",
|
|
158
|
+
referencedByBuild: false,
|
|
159
|
+
referenceLookups: [
|
|
160
|
+
{ strategy: "owned", ownerKinds: ["app", "element"], memberAttr: "name" },
|
|
161
|
+
{ strategy: "nameOnlyMetadata", ownerKind: "automation" },
|
|
162
|
+
],
|
|
163
|
+
},
|
|
105
164
|
canvas: {
|
|
106
165
|
participates: true,
|
|
107
166
|
label: "Automations",
|
|
@@ -117,22 +176,31 @@ export const automationModule = {
|
|
|
117
176
|
extractOwnFile: extractAutomations,
|
|
118
177
|
printOwnFile: (item, opts) => {
|
|
119
178
|
const automation = item;
|
|
120
|
-
|
|
179
|
+
// Prefer the extract-time bag key (matches tool automationKey). Fall
|
|
180
|
+
// back to the printer formula for any path that still has bare AST.
|
|
181
|
+
const refName = typeof automation.refName === "string" && automation.refName !== ""
|
|
182
|
+
? automation.refName
|
|
183
|
+
: tfLabelToTsLabel(sanitizeName(automation.name));
|
|
121
184
|
return {
|
|
122
185
|
refName,
|
|
123
186
|
source: printAutomationV2(automation, {
|
|
124
187
|
refName,
|
|
125
188
|
appRefName: opts.appRefName,
|
|
126
189
|
...(opts.foreignAppRefNames !== undefined && { foreignAppRefNames: opts.foreignAppRefNames }),
|
|
190
|
+
...(opts.foreignElementRefNames !== undefined && { foreignElementRefNames: opts.foreignElementRefNames }),
|
|
191
|
+
...(opts.unresolvedReferences !== undefined && { unresolvedReferences: opts.unresolvedReferences }),
|
|
127
192
|
}),
|
|
128
193
|
};
|
|
129
194
|
},
|
|
130
195
|
toTf: (entity, ctx) => automationToTf(entity, {
|
|
131
196
|
appRefName: ctx.appRefName,
|
|
132
197
|
appTfLabel: ctx.appTfLabel,
|
|
198
|
+
parentScope: ctx.parentScope === "element" ? "element" : "app",
|
|
199
|
+
diagnostics: ctx.diagnostics,
|
|
133
200
|
fieldAddresses: ctx.fieldAddresses ?? new Map(),
|
|
134
201
|
fieldNames: ctx.fieldNames ?? new Map(),
|
|
135
202
|
fieldMetadata: ctx.fieldMetadata ?? new Map(),
|
|
203
|
+
...(ctx.fieldNamesByAppRefName !== undefined ? { fieldNamesByAppRefName: ctx.fieldNamesByAppRefName } : {}),
|
|
136
204
|
orgRefs: ctx.orgRefs,
|
|
137
205
|
workspaceAspects: ctx.workspaceAspects,
|
|
138
206
|
localsAttrs: ctx.localsAttrs,
|
|
@@ -1,47 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* carry
|
|
4
|
-
*
|
|
5
|
-
* inner context) is reused from `core/context` — same as v1.
|
|
2
|
+
* Automation operators — `forEach` / `switch` / `forkJoin`. Unlike leaf actions,
|
|
3
|
+
* these carry nested child-action lists (`operatorChildren`), which serialize to
|
|
4
|
+
* the platform wire task's `children` property.
|
|
6
5
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* This module is the internal wire adapter. Public authoring uses fluent
|
|
7
|
+
* operator-body builders from `build.ts`; those builders materialize the
|
|
8
|
+
* `{ name, def }` entries consumed here.
|
|
10
9
|
*/
|
|
11
10
|
import type { Context, ForEachItem } from "../shared/context.js";
|
|
12
11
|
import type { Ref } from "../shared/ref.js";
|
|
13
|
-
import { type
|
|
12
|
+
import { type ActionDef, type NestedActionEntry } from "./build.js";
|
|
14
13
|
import type { Filter } from "./filter.js";
|
|
15
14
|
type Empty = Record<string, never>;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* whose slugged refKey is "For_Each"); omit it otherwise.
|
|
22
|
-
*
|
|
23
|
-
* For a nested `executeScript` (`childTask(name, executeScript({...}))`),
|
|
24
|
-
* `def.config.code` was already resolved by the time this runs — the
|
|
25
|
-
* low-level `executeScript()` factory has no way to know its own task name
|
|
26
|
-
* (only the enclosing `childTask()` call does), so it can't consult
|
|
27
|
-
* `tryExtractFromCurrentSource` itself. Here — where `name` finally IS known
|
|
28
|
-
* — swap in the byte-exact body from the tracked automation source when one
|
|
29
|
-
* is found, overriding whatever `extractScriptBody`'s `toString()` fallback
|
|
30
|
-
* already computed. See `script-code.ts` for why that fallback can reformat
|
|
31
|
-
* a pulled script's exact text.
|
|
32
|
-
*/
|
|
33
|
-
export declare function childTask(name: string, def: TaskDef<unknown>, displayName?: string): ChildTask;
|
|
34
|
-
export interface ForEachConfig<TTrigger, TTasks extends Record<string, unknown>, TItem> {
|
|
35
|
-
/** The collection to iterate (e.g. `ctx.tasks.find.records`). */
|
|
15
|
+
type NoVariables = {
|
|
16
|
+
[K in never]: never;
|
|
17
|
+
};
|
|
18
|
+
export interface ForEachConfig<TTrigger, TActions extends Record<string, unknown>, TItem, TVars extends Record<string, unknown> = NoVariables> {
|
|
19
|
+
/** The collection to iterate (e.g. `ctx.actions.find.records`). */
|
|
36
20
|
readonly collection: Ref<readonly TItem[]>;
|
|
37
21
|
/**
|
|
38
|
-
*
|
|
39
|
-
* field drilling
|
|
22
|
+
* Internal nested wire entries executed per item. `item` is a ref to the whole
|
|
23
|
+
* item with typed field drilling; `innerCtx` exposes trigger + outer actions.
|
|
40
24
|
*/
|
|
41
|
-
readonly
|
|
25
|
+
readonly actions: (item: ForEachItem<NoInfer<TItem>>, innerCtx: Context<TTrigger, TActions, TVars>) => readonly NestedActionEntry[];
|
|
42
26
|
}
|
|
43
|
-
export declare function forEach<TTrigger,
|
|
44
|
-
export interface SwitchCase<TTrigger,
|
|
27
|
+
export declare function forEach<TTrigger, TActions extends Record<string, unknown>, TItem, TVars extends Record<string, unknown> = NoVariables>(_ctx: Context<TTrigger, TActions, TVars>, config: ForEachConfig<TTrigger, TActions, TItem, TVars>): ActionDef<Empty>;
|
|
28
|
+
export interface SwitchCase<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown> = NoVariables> {
|
|
45
29
|
readonly label: string;
|
|
46
30
|
/**
|
|
47
31
|
* Condition for this case, built with the `filter.*` DSL
|
|
@@ -50,25 +34,25 @@ export interface SwitchCase<TTrigger, TTasks extends Record<string, unknown>> {
|
|
|
50
34
|
* no earlier case matches.
|
|
51
35
|
*
|
|
52
36
|
* Switch conditions have no row in scope, so every `filter.*` comparison
|
|
53
|
-
* (`eq`/`gt`/`like`/`isNull`/`between`/…) accepts
|
|
54
|
-
* place of a field — e.g. `filter.lt(ctx.
|
|
37
|
+
* (`eq`/`gt`/`like`/`isNull`/`between`/…) accepts an action/trigger `Ref` in
|
|
38
|
+
* place of a field — e.g. `filter.lt(ctx.actions.search.totalCount, 1)` —
|
|
55
39
|
* in addition to the usual `FieldRef` token.
|
|
56
40
|
*/
|
|
57
41
|
readonly condition?: Filter;
|
|
58
|
-
readonly
|
|
42
|
+
readonly actions: (innerCtx: Context<TTrigger, TActions, TVars>) => readonly NestedActionEntry[];
|
|
59
43
|
}
|
|
60
|
-
export interface SwitchConfig<TTrigger,
|
|
44
|
+
export interface SwitchConfig<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown> = NoVariables> {
|
|
61
45
|
/** Ordered cases — first match wins. */
|
|
62
|
-
readonly cases: readonly SwitchCase<TTrigger,
|
|
46
|
+
readonly cases: readonly SwitchCase<TTrigger, TActions, TVars>[];
|
|
63
47
|
/**
|
|
64
|
-
*
|
|
48
|
+
* Actions when no case matches (the default/else branch). Plain function form
|
|
65
49
|
* matches the platform's usual "Default" display label; pass `{ label,
|
|
66
|
-
*
|
|
50
|
+
* actions }` to preserve a manually renamed default branch (e.g. "Default
|
|
67
51
|
* Path") through a pull/build round trip.
|
|
68
52
|
*/
|
|
69
|
-
readonly
|
|
53
|
+
readonly defaultActions?: ((innerCtx: Context<TTrigger, TActions, TVars>) => readonly NestedActionEntry[]) | {
|
|
70
54
|
readonly label?: string;
|
|
71
|
-
readonly
|
|
55
|
+
readonly actions: (innerCtx: Context<TTrigger, TActions, TVars>) => readonly NestedActionEntry[];
|
|
72
56
|
/**
|
|
73
57
|
* Internal round-trip detail, set only by `edk pull`: which wire
|
|
74
58
|
* shape the platform is currently using to mark this branch as the
|
|
@@ -80,14 +64,14 @@ export interface SwitchConfig<TTrigger, TTasks extends Record<string, unknown>>
|
|
|
80
64
|
readonly defaultFilterMode?: "isDefault" | "explicitTrueFilter";
|
|
81
65
|
};
|
|
82
66
|
}
|
|
83
|
-
export declare function
|
|
84
|
-
export interface ForkJoinBranch<TTrigger,
|
|
67
|
+
export declare function switchAction<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown> = NoVariables>(_ctx: Context<TTrigger, TActions, TVars>, config: SwitchConfig<TTrigger, TActions, TVars>): ActionDef<Empty>;
|
|
68
|
+
export interface ForkJoinBranch<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown> = NoVariables> {
|
|
85
69
|
readonly label: string;
|
|
86
|
-
readonly
|
|
70
|
+
readonly actions: (innerCtx: Context<TTrigger, TActions, TVars>) => readonly NestedActionEntry[];
|
|
87
71
|
}
|
|
88
|
-
export interface ForkJoinConfig<TTrigger,
|
|
72
|
+
export interface ForkJoinConfig<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown> = NoVariables> {
|
|
89
73
|
/** Parallel branches, each executed concurrently. */
|
|
90
|
-
readonly branches: readonly ForkJoinBranch<TTrigger,
|
|
74
|
+
readonly branches: readonly ForkJoinBranch<TTrigger, TActions, TVars>[];
|
|
91
75
|
}
|
|
92
|
-
export declare function forkJoin<TTrigger,
|
|
76
|
+
export declare function forkJoin<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown> = NoVariables>(_ctx: Context<TTrigger, TActions, TVars>, config: ForkJoinConfig<TTrigger, TActions, TVars>): ActionDef<Empty>;
|
|
93
77
|
export {};
|
|
@@ -1,60 +1,33 @@
|
|
|
1
1
|
import { buildContext, createForEachItemProxy } from "../shared/context.js";
|
|
2
2
|
import { FOR_EACH_PLACEHOLDER } from "./build.js";
|
|
3
|
-
import { tryExtractFromCurrentSource } from "./script-code.js";
|
|
4
|
-
/**
|
|
5
|
-
* Convenience: name a child task. Equivalent to `{ name, def }`.
|
|
6
|
-
*
|
|
7
|
-
* `displayName` is only needed when adopting a platform-authored task whose
|
|
8
|
-
* wire `name` differs from its `refKey` (e.g. a UI-built "For Each" task,
|
|
9
|
-
* whose slugged refKey is "For_Each"); omit it otherwise.
|
|
10
|
-
*
|
|
11
|
-
* For a nested `executeScript` (`childTask(name, executeScript({...}))`),
|
|
12
|
-
* `def.config.code` was already resolved by the time this runs — the
|
|
13
|
-
* low-level `executeScript()` factory has no way to know its own task name
|
|
14
|
-
* (only the enclosing `childTask()` call does), so it can't consult
|
|
15
|
-
* `tryExtractFromCurrentSource` itself. Here — where `name` finally IS known
|
|
16
|
-
* — swap in the byte-exact body from the tracked automation source when one
|
|
17
|
-
* is found, overriding whatever `extractScriptBody`'s `toString()` fallback
|
|
18
|
-
* already computed. See `script-code.ts` for why that fallback can reformat
|
|
19
|
-
* a pulled script's exact text.
|
|
20
|
-
*/
|
|
21
|
-
export function childTask(name, def, displayName) {
|
|
22
|
-
if (def.key === "executeScript") {
|
|
23
|
-
const body = tryExtractFromCurrentSource(name);
|
|
24
|
-
if (body !== undefined && body !== def.config["code"]) {
|
|
25
|
-
return { name, def: { ...def, config: { ...def.config, code: body } }, displayName };
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return { name, def, displayName };
|
|
29
|
-
}
|
|
30
3
|
export function forEach(_ctx, config) {
|
|
31
4
|
const item = createForEachItemProxy(FOR_EACH_PLACEHOLDER);
|
|
32
5
|
const innerCtx = buildContext([]);
|
|
33
6
|
return {
|
|
34
7
|
key: "forEach",
|
|
35
8
|
config: { forEach: config.collection },
|
|
36
|
-
operatorChildren: [{ label: null, tasks: config.
|
|
9
|
+
operatorChildren: [{ label: null, tasks: config.actions(item, innerCtx) }],
|
|
37
10
|
};
|
|
38
11
|
}
|
|
39
|
-
export function
|
|
12
|
+
export function switchAction(_ctx, config) {
|
|
40
13
|
if (config.cases.length === 0)
|
|
41
14
|
throw new Error("switch requires at least one case");
|
|
42
15
|
const innerCtx = buildContext([]);
|
|
43
16
|
const operatorChildren = config.cases.map((c) => ({
|
|
44
17
|
label: c.label,
|
|
45
18
|
...(c.condition !== undefined ? { filter: c.condition } : {}),
|
|
46
|
-
tasks: c.
|
|
19
|
+
tasks: c.actions(innerCtx),
|
|
47
20
|
}));
|
|
48
|
-
if (config.
|
|
49
|
-
const isPlainFn = typeof config.
|
|
50
|
-
const
|
|
51
|
-
const defaultLabel = isPlainFn ? undefined : config.
|
|
52
|
-
const defaultFilterMode = isPlainFn ? undefined : config.
|
|
21
|
+
if (config.defaultActions) {
|
|
22
|
+
const isPlainFn = typeof config.defaultActions === "function";
|
|
23
|
+
const actionsFn = isPlainFn ? config.defaultActions : config.defaultActions.actions;
|
|
24
|
+
const defaultLabel = isPlainFn ? undefined : config.defaultActions.label;
|
|
25
|
+
const defaultFilterMode = isPlainFn ? undefined : config.defaultActions.defaultFilterMode;
|
|
53
26
|
operatorChildren.push({
|
|
54
27
|
label: null,
|
|
55
28
|
...(defaultLabel !== undefined ? { defaultLabel } : {}),
|
|
56
29
|
...(defaultFilterMode !== undefined ? { defaultFilterMode } : {}),
|
|
57
|
-
tasks:
|
|
30
|
+
tasks: actionsFn(innerCtx),
|
|
58
31
|
});
|
|
59
32
|
}
|
|
60
33
|
return { key: "switch", config: {}, operatorChildren };
|
|
@@ -64,6 +37,6 @@ export function forkJoin(_ctx, config) {
|
|
|
64
37
|
return {
|
|
65
38
|
key: "forkJoin",
|
|
66
39
|
config: {},
|
|
67
|
-
operatorChildren: config.branches.map((b) => ({ label: b.label, tasks: b.
|
|
40
|
+
operatorChildren: config.branches.map((b) => ({ label: b.label, tasks: b.actions(innerCtx) })),
|
|
68
41
|
};
|
|
69
42
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Single-scalar-output task kinds whose EDK factory exposes the result as
|
|
3
|
-
* `output` (`
|
|
3
|
+
* `output` (`ActionDef<{ output: unknown }>`), but whose platform wire name
|
|
4
4
|
* differs. aiSummarize/aiTransform were "confirmed against real pulled wire
|
|
5
5
|
* data" per the original note, naming their output `response`; documentModel
|
|
6
6
|
* (rawText data source) names it `text`. aiClassify's `Response` is confirmed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Single-scalar-output task kinds whose EDK factory exposes the result as
|
|
3
|
-
* `output` (`
|
|
3
|
+
* `output` (`ActionDef<{ output: unknown }>`), but whose platform wire name
|
|
4
4
|
* differs. aiSummarize/aiTransform were "confirmed against real pulled wire
|
|
5
5
|
* data" per the original note, naming their output `response`; documentModel
|
|
6
6
|
* (rawText data source) names it `text`. aiClassify's `Response` is confirmed
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
* file's jiti import with that file's own untranspiled text (engine-side,
|
|
32
32
|
* entity-agnostic — `source-context.ts`), and `tryExtractFromCurrentSource`
|
|
33
33
|
* here locates the matching `.executeScript("name", { code: (input) => {...}
|
|
34
|
-
* })`
|
|
34
|
+
* })` call at any fluent-chain depth by a
|
|
35
35
|
* lightweight source scan — the same string/comment-aware tokenizing already
|
|
36
36
|
* used by {@link inferOutputSchema} — and slices the body's ORIGINAL text directly out
|
|
37
37
|
* of the file, never touching the transpiled function. `extractScriptBody`
|
|
38
38
|
* (the `toString()` path) remains the fallback for contexts with no tracked
|
|
39
|
-
* source (tests constructing automations directly
|
|
39
|
+
* source (tests constructing automations directly).
|
|
40
40
|
*/
|
|
41
41
|
import { currentSourceText } from "../../engine/build/source-context.js";
|
|
42
42
|
/** Globals a script body may legitimately reference on the platform runtime. */
|
|
@@ -498,9 +498,8 @@ export function tryExtractFromCurrentSource(name) {
|
|
|
498
498
|
return bodies.get(name);
|
|
499
499
|
}
|
|
500
500
|
/**
|
|
501
|
-
* Scan raw (untranspiled) `.ts` source text for every
|
|
502
|
-
* `.executeScript("name", {...})` call
|
|
503
|
-
* `childTask("name", executeScript({...}))` call, extracting each one's
|
|
501
|
+
* Scan raw (untranspiled) `.ts` source text for every fluent
|
|
502
|
+
* `.executeScript("name", {...})` call, extracting each one's
|
|
504
503
|
* `code:` function body VERBATIM. Reuses this file's own comment/string-aware
|
|
505
504
|
* tokenizing ({@link skipNonCode}/{@link skipString}) rather than a full
|
|
506
505
|
* parser — the input is EDK's own printer output (a predictable shape) plus
|
|
@@ -535,22 +534,6 @@ function scanExecuteScriptBodies(src) {
|
|
|
535
534
|
}
|
|
536
535
|
}
|
|
537
536
|
}
|
|
538
|
-
if (isIdentifierBoundaryMatch(src, i, "childTask")) {
|
|
539
|
-
const openParen = skipWs(src, i + "childTask".length);
|
|
540
|
-
if (src[openParen] === "(") {
|
|
541
|
-
const call = scanCallArgs(src, openParen);
|
|
542
|
-
if (call !== undefined && call.args.length >= 2) {
|
|
543
|
-
const name = unquoteIfStringLiteral(call.args[0]);
|
|
544
|
-
const inner = call.args[1].trim();
|
|
545
|
-
const innerOpen = "executeScript".length;
|
|
546
|
-
if (name !== undefined && inner.startsWith("executeScript") && inner[innerOpen] === "(" && inner.endsWith(")")) {
|
|
547
|
-
const body = extractCodeBody(inner.slice(innerOpen + 1, -1));
|
|
548
|
-
if (body !== undefined)
|
|
549
|
-
result.set(name, dedent(body.replace(/^\n+/, "").replace(/\s+$/, "")));
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
537
|
i += 1;
|
|
555
538
|
}
|
|
556
539
|
return result;
|
|
@@ -677,7 +660,15 @@ function extractFunctionBlockBodyAt(text, start) {
|
|
|
677
660
|
}
|
|
678
661
|
if (text.startsWith("=>", i)) {
|
|
679
662
|
sawArrow = true;
|
|
680
|
-
i
|
|
663
|
+
const bodyStart = skipWs(text, i + 2);
|
|
664
|
+
// The byte-exact scanner intentionally handles block-bodied functions
|
|
665
|
+
// only. An expression body such as `() => ({ value: 1 })` must fall
|
|
666
|
+
// back to Function#toString extraction; continuing this scan would walk
|
|
667
|
+
// into later options and could mistake `outputs: { ... }` for the code
|
|
668
|
+
// body (live-confirmed on a nested executeScript in #152).
|
|
669
|
+
if (text[bodyStart] !== "{")
|
|
670
|
+
return undefined;
|
|
671
|
+
i = bodyStart;
|
|
681
672
|
continue;
|
|
682
673
|
}
|
|
683
674
|
if (c === "(" || c === "[") {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* authored task/trigger config into its handle-form wire shape.
|
|
4
4
|
*
|
|
5
5
|
* Two kinds of reference live in a config, and they're handled differently:
|
|
6
|
-
* - **Internal `Ref`s** (`ctx.trigger.x`, `ctx.
|
|
6
|
+
* - **Internal `Ref`s** (`ctx.trigger.x`, `ctx.actions.y`, `template(...)`) —
|
|
7
7
|
* data flow *inside* the automation. Converted here to the platform's
|
|
8
8
|
* `ValueReference` JSON via the shared, reference-model-agnostic
|
|
9
9
|
* `serializeRefData` (depends only on `core/ref`). This is the same code
|