@elementumai/edk 0.0.0-oidc-bootstrap → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +462 -3
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.d.ts +188 -0
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.js +20 -0
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent.d.ts +245 -0
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent.js +30 -0
- package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.d.ts +18 -0
- package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.js +8 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.d.ts +718 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.js +52 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.d.ts +23 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.js +1 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.d.ts +148 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.js +12 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/format.d.ts +63 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/format.js +17 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/index.d.ts +39 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/index.js +35 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.d.ts +116 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.js +11 -0
- package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +178 -0
- package/dist-sdk/elementum-entity-client/clients/automation/models/automation.js +18 -0
- package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.d.ts +200 -0
- package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.js +1 -0
- package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.d.ts +1 -0
- package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.js +1 -0
- package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.d.ts +141 -0
- package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.js +22 -0
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +123 -0
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.js +14 -0
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +78 -0
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +23 -0
- package/dist-sdk/elementum-entity-client/clients/tables/models/index.d.ts +1 -0
- package/dist-sdk/elementum-entity-client/clients/tables/models/index.js +1 -0
- package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.d.ts +265 -0
- package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.js +15 -0
- package/dist-sdk/elementum-entity-client/errors.d.ts +90 -0
- package/dist-sdk/elementum-entity-client/errors.js +111 -0
- package/dist-sdk/elementum-entity-client/models/connection.d.ts +30 -0
- package/dist-sdk/elementum-entity-client/models/connection.js +16 -0
- package/dist-sdk/elementum-entity-client/types.d.ts +71 -0
- package/dist-sdk/elementum-entity-client/types.js +1 -0
- package/dist-sdk/fs/entity.d.ts +104 -0
- package/dist-sdk/fs/entity.js +52 -0
- package/dist-sdk/pull/util.d.ts +130 -0
- package/dist-sdk/pull/util.js +204 -0
- package/dist-sdk/src/catalog/ai-provider-models.d.ts +30 -0
- package/dist-sdk/src/catalog/ai-provider-models.js +63 -0
- package/dist-sdk/src/catalog/factories.d.ts +242 -0
- package/dist-sdk/src/catalog/factories.js +265 -0
- package/dist-sdk/src/catalog/from-authoring.d.ts +103 -0
- package/dist-sdk/src/catalog/from-authoring.js +467 -0
- package/dist-sdk/src/catalog/index.d.ts +12 -0
- package/dist-sdk/src/catalog/index.js +12 -0
- package/dist-sdk/src/catalog/org.d.ts +11 -0
- package/dist-sdk/src/catalog/org.js +288 -0
- package/dist-sdk/src/catalog/render-helpers.d.ts +35 -0
- package/dist-sdk/src/catalog/render-helpers.js +82 -0
- package/dist-sdk/src/catalog/render.d.ts +48 -0
- package/dist-sdk/src/catalog/render.js +193 -0
- package/dist-sdk/src/catalog/token.d.ts +10 -0
- package/dist-sdk/src/catalog/token.js +76 -0
- package/dist-sdk/src/catalog/types.d.ts +215 -0
- package/dist-sdk/src/catalog/types.js +86 -0
- package/dist-sdk/src/catalog/write.d.ts +43 -0
- package/dist-sdk/src/catalog/write.js +109 -0
- package/dist-sdk/src/core/app-to-ui.d.ts +22 -0
- package/dist-sdk/src/core/app-to-ui.js +75 -0
- package/dist-sdk/src/core/index.d.ts +10 -0
- package/dist-sdk/src/core/index.js +9 -0
- package/dist-sdk/src/core/system-fields.d.ts +95 -0
- package/dist-sdk/src/core/system-fields.js +153 -0
- package/dist-sdk/src/core/triggers/on-demand.d.ts +144 -0
- package/dist-sdk/src/core/triggers/on-demand.js +112 -0
- package/dist-sdk/src/core/types/ai-provider.d.ts +23 -0
- package/dist-sdk/src/core/types/ai-provider.js +8 -0
- package/dist-sdk/src/core/types/app.d.ts +857 -0
- package/dist-sdk/src/core/types/app.js +210 -0
- package/dist-sdk/src/core/types/aspect-category.d.ts +35 -0
- package/dist-sdk/src/core/types/aspect-category.js +33 -0
- package/dist-sdk/src/core/types/cloud-link.d.ts +34 -0
- package/dist-sdk/src/core/types/cloud-link.js +32 -0
- package/dist-sdk/src/core/types/display-block.d.ts +149 -0
- package/dist-sdk/src/core/types/display-block.js +61 -0
- package/dist-sdk/src/core/types/group.d.ts +13 -0
- package/dist-sdk/src/core/types/group.js +6 -0
- package/dist-sdk/src/core/types/platform.d.ts +2 -0
- package/dist-sdk/src/core/types/platform.js +1 -0
- package/dist-sdk/src/core/types/user.d.ts +20 -0
- package/dist-sdk/src/core/types/user.js +8 -0
- package/dist-sdk/src/core/wire/ref-serializer.d.ts +45 -0
- package/dist-sdk/src/core/wire/ref-serializer.js +89 -0
- package/dist-sdk/src/engine/build/context.d.ts +67 -0
- package/dist-sdk/src/engine/build/context.js +6 -0
- package/dist-sdk/src/engine/build/source-context.d.ts +45 -0
- package/dist-sdk/src/engine/build/source-context.js +23 -0
- package/dist-sdk/src/engine/entity.d.ts +44 -0
- package/dist-sdk/src/engine/entity.js +15 -0
- package/dist-sdk/src/engine/pull/context.d.ts +38 -0
- package/dist-sdk/src/engine/pull/context.js +44 -0
- package/dist-sdk/src/engine/pull/org.d.ts +54 -0
- package/dist-sdk/src/engine/pull/org.js +134 -0
- package/dist-sdk/src/engine/tf/escape.d.ts +22 -0
- package/dist-sdk/src/engine/tf/escape.js +28 -0
- package/dist-sdk/src/engine/tf/expr.d.ts +25 -0
- package/dist-sdk/src/engine/tf/expr.js +405 -0
- package/dist-sdk/src/engine/tf/index.d.ts +12 -0
- package/dist-sdk/src/engine/tf/index.js +11 -0
- package/dist-sdk/src/engine/tf/labels.d.ts +76 -0
- package/dist-sdk/src/engine/tf/labels.js +196 -0
- package/dist-sdk/src/engine/tf/model.d.ts +84 -0
- package/dist-sdk/src/engine/tf/model.js +49 -0
- package/dist-sdk/src/engine/tf/parse.d.ts +41 -0
- package/dist-sdk/src/engine/tf/parse.js +189 -0
- package/dist-sdk/src/engine/tf/render.d.ts +13 -0
- package/dist-sdk/src/engine/tf/render.js +102 -0
- package/dist-sdk/src/engine/workspace/authoring-layout.d.ts +43 -0
- package/dist-sdk/src/engine/workspace/authoring-layout.js +201 -0
- package/dist-sdk/src/entities/access-policy/build.d.ts +26 -0
- package/dist-sdk/src/entities/access-policy/build.js +7 -0
- package/dist-sdk/src/entities/access-policy/filter.d.ts +61 -0
- package/dist-sdk/src/entities/access-policy/filter.js +83 -0
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +48 -0
- package/dist-sdk/src/entities/access-policy/from-tf.js +189 -0
- package/dist-sdk/src/entities/access-policy/module.d.ts +3 -0
- package/dist-sdk/src/entities/access-policy/module.js +17 -0
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +36 -0
- package/dist-sdk/src/entities/access-policy/to-tf.js +149 -0
- package/dist-sdk/src/entities/access-policy/types.d.ts +4 -0
- package/dist-sdk/src/entities/access-policy/types.js +10 -0
- package/dist-sdk/src/entities/agent/build.d.ts +108 -0
- package/dist-sdk/src/entities/agent/build.js +148 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +53 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +344 -0
- package/dist-sdk/src/entities/agent/from-tf.d.ts +65 -0
- package/dist-sdk/src/entities/agent/from-tf.js +289 -0
- package/dist-sdk/src/entities/agent/index.d.ts +7 -0
- package/dist-sdk/src/entities/agent/index.js +7 -0
- package/dist-sdk/src/entities/agent/module.d.ts +4 -0
- package/dist-sdk/src/entities/agent/module.js +122 -0
- package/dist-sdk/src/entities/agent/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/agent/to-tf.js +188 -0
- package/dist-sdk/src/entities/agent/tools.d.ts +284 -0
- package/dist-sdk/src/entities/agent/tools.js +238 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +110 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.js +265 -0
- package/dist-sdk/src/entities/agent-tool/module.d.ts +3 -0
- package/dist-sdk/src/entities/agent-tool/module.js +32 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +40 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.js +250 -0
- package/dist-sdk/src/entities/agent-tool/types.d.ts +43 -0
- package/dist-sdk/src/entities/agent-tool/types.js +102 -0
- package/dist-sdk/src/entities/app/build.d.ts +368 -0
- package/dist-sdk/src/entities/app/build.js +372 -0
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +168 -0
- package/dist-sdk/src/entities/app/deserializer/normalize.js +12 -0
- package/dist-sdk/src/entities/app/display-blocks.d.ts +26 -0
- package/dist-sdk/src/entities/app/display-blocks.js +34 -0
- package/dist-sdk/src/entities/app/from-tf.d.ts +23 -0
- package/dist-sdk/src/entities/app/from-tf.js +197 -0
- package/dist-sdk/src/entities/app/index.d.ts +14 -0
- package/dist-sdk/src/entities/app/index.js +11 -0
- package/dist-sdk/src/entities/app/locals.d.ts +11 -0
- package/dist-sdk/src/entities/app/locals.js +31 -0
- package/dist-sdk/src/entities/app/module.d.ts +4 -0
- package/dist-sdk/src/entities/app/module.js +66 -0
- package/dist-sdk/src/entities/app/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/app/to-tf.js +212 -0
- package/dist-sdk/src/entities/approval-chain/build.d.ts +24 -0
- package/dist-sdk/src/entities/approval-chain/build.js +56 -0
- package/dist-sdk/src/entities/approval-chain/index.d.ts +6 -0
- package/dist-sdk/src/entities/approval-chain/index.js +6 -0
- package/dist-sdk/src/entities/approval-chain/steps.d.ts +24 -0
- package/dist-sdk/src/entities/approval-chain/steps.js +20 -0
- package/dist-sdk/src/entities/automation/build.d.ts +259 -0
- package/dist-sdk/src/entities/automation/build.js +436 -0
- package/dist-sdk/src/entities/automation/catalog-render.d.ts +5 -0
- package/dist-sdk/src/entities/automation/catalog-render.js +35 -0
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +152 -0
- package/dist-sdk/src/entities/automation/deserializer/ast.js +13 -0
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +55 -0
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +1176 -0
- package/dist-sdk/src/entities/automation/filter.d.ts +93 -0
- package/dist-sdk/src/entities/automation/filter.js +156 -0
- package/dist-sdk/src/entities/automation/from-tf.d.ts +35 -0
- package/dist-sdk/src/entities/automation/from-tf.js +1258 -0
- package/dist-sdk/src/entities/automation/index.d.ts +22 -0
- package/dist-sdk/src/entities/automation/index.js +25 -0
- package/dist-sdk/src/entities/automation/module.d.ts +3 -0
- package/dist-sdk/src/entities/automation/module.js +150 -0
- package/dist-sdk/src/entities/automation/operators.d.ts +93 -0
- package/dist-sdk/src/entities/automation/operators.js +69 -0
- package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +19 -0
- package/dist-sdk/src/entities/automation/output-key-wire-name.js +24 -0
- package/dist-sdk/src/entities/automation/script-code.d.ts +51 -0
- package/dist-sdk/src/entities/automation/script-code.js +633 -0
- package/dist-sdk/src/entities/automation/serialize.d.ts +6 -0
- package/dist-sdk/src/entities/automation/serialize.js +41 -0
- package/dist-sdk/src/entities/automation/tasks.d.ts +641 -0
- package/dist-sdk/src/entities/automation/tasks.js +765 -0
- package/dist-sdk/src/entities/automation/to-tf.d.ts +19 -0
- package/dist-sdk/src/entities/automation/to-tf.js +1169 -0
- package/dist-sdk/src/entities/automation/triggers.d.ts +205 -0
- package/dist-sdk/src/entities/automation/triggers.js +202 -0
- package/dist-sdk/src/entities/automation/types.d.ts +78 -0
- package/dist-sdk/src/entities/automation/types.js +131 -0
- package/dist-sdk/src/entities/element/build.d.ts +121 -0
- package/dist-sdk/src/entities/element/build.js +110 -0
- package/dist-sdk/src/entities/element/from-tf.d.ts +19 -0
- package/dist-sdk/src/entities/element/from-tf.js +170 -0
- package/dist-sdk/src/entities/element/index.d.ts +12 -0
- package/dist-sdk/src/entities/element/index.js +10 -0
- package/dist-sdk/src/entities/element/locals.d.ts +7 -0
- package/dist-sdk/src/entities/element/locals.js +12 -0
- package/dist-sdk/src/entities/element/module.d.ts +8 -0
- package/dist-sdk/src/entities/element/module.js +65 -0
- package/dist-sdk/src/entities/element/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/element/to-tf.js +169 -0
- package/dist-sdk/src/entities/field/build.d.ts +112 -0
- package/dist-sdk/src/entities/field/build.js +84 -0
- package/dist-sdk/src/entities/field/calc/aggregate.d.ts +60 -0
- package/dist-sdk/src/entities/field/calc/aggregate.js +71 -0
- package/dist-sdk/src/entities/field/calc/date.d.ts +73 -0
- package/dist-sdk/src/entities/field/calc/date.js +109 -0
- package/dist-sdk/src/entities/field/calc/index.d.ts +229 -0
- package/dist-sdk/src/entities/field/calc/index.js +433 -0
- package/dist-sdk/src/entities/field/calc/numeric.d.ts +22 -0
- package/dist-sdk/src/entities/field/calc/numeric.js +67 -0
- package/dist-sdk/src/entities/field/calc/runtime.d.ts +61 -0
- package/dist-sdk/src/entities/field/calc/runtime.js +174 -0
- package/dist-sdk/src/entities/field/calc/text.d.ts +100 -0
- package/dist-sdk/src/entities/field/calc/text.js +208 -0
- package/dist-sdk/src/entities/field/calc/types.d.ts +86 -0
- package/dist-sdk/src/entities/field/calc/types.js +23 -0
- package/dist-sdk/src/entities/field/calc.d.ts +108 -0
- package/dist-sdk/src/entities/field/calc.js +54 -0
- package/dist-sdk/src/entities/field/from-tf.d.ts +31 -0
- package/dist-sdk/src/entities/field/from-tf.js +184 -0
- package/dist-sdk/src/entities/field/locals.d.ts +8 -0
- package/dist-sdk/src/entities/field/locals.js +24 -0
- package/dist-sdk/src/entities/field/module.d.ts +3 -0
- package/dist-sdk/src/entities/field/module.js +50 -0
- package/dist-sdk/src/entities/field/options.d.ts +27 -0
- package/dist-sdk/src/entities/field/options.js +76 -0
- package/dist-sdk/src/entities/field/record-shape.d.ts +57 -0
- package/dist-sdk/src/entities/field/record-shape.js +1 -0
- package/dist-sdk/src/entities/field/to-tf.d.ts +73 -0
- package/dist-sdk/src/entities/field/to-tf.js +142 -0
- package/dist-sdk/src/entities/field/types.d.ts +53 -0
- package/dist-sdk/src/entities/field/types.js +68 -0
- package/dist-sdk/src/entities/file-reader/build.d.ts +182 -0
- package/dist-sdk/src/entities/file-reader/build.js +105 -0
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.d.ts +6 -0
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +109 -0
- package/dist-sdk/src/entities/file-reader/from-tf.d.ts +13 -0
- package/dist-sdk/src/entities/file-reader/from-tf.js +172 -0
- package/dist-sdk/src/entities/file-reader/index.d.ts +10 -0
- package/dist-sdk/src/entities/file-reader/index.js +10 -0
- package/dist-sdk/src/entities/file-reader/module.d.ts +3 -0
- package/dist-sdk/src/entities/file-reader/module.js +115 -0
- package/dist-sdk/src/entities/file-reader/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/file-reader/to-tf.js +84 -0
- package/dist-sdk/src/entities/file-reader/types.d.ts +32 -0
- package/dist-sdk/src/entities/file-reader/types.js +30 -0
- package/dist-sdk/src/entities/flow/activities/agent.d.ts +15 -0
- package/dist-sdk/src/entities/flow/activities/agent.js +29 -0
- package/dist-sdk/src/entities/flow/activities/approval.d.ts +9 -0
- package/dist-sdk/src/entities/flow/activities/approval.js +18 -0
- package/dist-sdk/src/entities/flow/activities/automation.d.ts +12 -0
- package/dist-sdk/src/entities/flow/activities/automation.js +22 -0
- package/dist-sdk/src/entities/flow/activities/ctx.d.ts +34 -0
- package/dist-sdk/src/entities/flow/activities/ctx.js +38 -0
- package/dist-sdk/src/entities/flow/activities/form.d.ts +22 -0
- package/dist-sdk/src/entities/flow/activities/form.js +36 -0
- package/dist-sdk/src/entities/flow/activities/index.d.ts +14 -0
- package/dist-sdk/src/entities/flow/activities/index.js +13 -0
- package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +39 -0
- package/dist-sdk/src/entities/flow/activities/input-refs.js +19 -0
- package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +13 -0
- package/dist-sdk/src/entities/flow/activities/prompt-template.js +34 -0
- package/dist-sdk/src/entities/flow/activities/render-catalog.d.ts +140 -0
- package/dist-sdk/src/entities/flow/activities/render-catalog.js +174 -0
- package/dist-sdk/src/entities/flow/activities/types.d.ts +33 -0
- package/dist-sdk/src/entities/flow/activities/types.js +1 -0
- package/dist-sdk/src/entities/flow/build.d.ts +38 -0
- package/dist-sdk/src/entities/flow/build.js +115 -0
- package/dist-sdk/src/entities/flow/index.d.ts +8 -0
- package/dist-sdk/src/entities/flow/index.js +7 -0
- package/dist-sdk/src/entities/flow/serialize.d.ts +51 -0
- package/dist-sdk/src/entities/flow/serialize.js +94 -0
- package/dist-sdk/src/entities/flow/util.d.ts +27 -0
- package/dist-sdk/src/entities/flow/util.js +38 -0
- package/dist-sdk/src/entities/org/ai-provider.d.ts +13 -0
- package/dist-sdk/src/entities/org/ai-provider.js +46 -0
- package/dist-sdk/src/entities/org/category.d.ts +5 -0
- package/dist-sdk/src/entities/org/category.js +33 -0
- package/dist-sdk/src/entities/org/cloud-link.d.ts +5 -0
- package/dist-sdk/src/entities/org/cloud-link.js +33 -0
- package/dist-sdk/src/entities/org/connector.d.ts +12 -0
- package/dist-sdk/src/entities/org/connector.js +35 -0
- package/dist-sdk/src/entities/org/group.d.ts +5 -0
- package/dist-sdk/src/entities/org/group.js +40 -0
- package/dist-sdk/src/entities/org/index.d.ts +11 -0
- package/dist-sdk/src/entities/org/index.js +11 -0
- package/dist-sdk/src/entities/org/role.d.ts +7 -0
- package/dist-sdk/src/entities/org/role.js +21 -0
- package/dist-sdk/src/entities/org/user.d.ts +7 -0
- package/dist-sdk/src/entities/org/user.js +30 -0
- package/dist-sdk/src/entities/search-table/build.d.ts +41 -0
- package/dist-sdk/src/entities/search-table/build.js +79 -0
- package/dist-sdk/src/entities/search-table/index.d.ts +5 -0
- package/dist-sdk/src/entities/search-table/index.js +5 -0
- package/dist-sdk/src/entities/search-table/module.d.ts +6 -0
- package/dist-sdk/src/entities/search-table/module.js +64 -0
- package/dist-sdk/src/entities/shared/context.d.ts +93 -0
- package/dist-sdk/src/entities/shared/context.js +156 -0
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +277 -0
- package/dist-sdk/src/entities/shared/filters/ast.js +65 -0
- package/dist-sdk/src/entities/shared/filters/index.d.ts +211 -0
- package/dist-sdk/src/entities/shared/filters/index.js +372 -0
- package/dist-sdk/src/entities/shared/filters/types.d.ts +170 -0
- package/dist-sdk/src/entities/shared/filters/types.js +7 -0
- package/dist-sdk/src/entities/shared/ref.d.ts +160 -0
- package/dist-sdk/src/entities/shared/ref.js +119 -0
- package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +17 -0
- package/dist-sdk/src/entities/shared/tool-field-ref.js +31 -0
- package/dist-sdk/src/entities/shared/types/common.d.ts +106 -0
- package/dist-sdk/src/entities/shared/types/common.js +64 -0
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +58 -0
- package/dist-sdk/src/entities/shared/types/field-types.js +57 -0
- package/dist-sdk/src/entities/shared/types/platform.d.ts +46 -0
- package/dist-sdk/src/entities/shared/types/platform.js +10 -0
- package/dist-sdk/src/entities/skill/build.d.ts +25 -0
- package/dist-sdk/src/entities/skill/build.js +50 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +39 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +124 -0
- package/dist-sdk/src/entities/skill/from-tf.d.ts +33 -0
- package/dist-sdk/src/entities/skill/from-tf.js +96 -0
- package/dist-sdk/src/entities/skill/index.d.ts +7 -0
- package/dist-sdk/src/entities/skill/index.js +7 -0
- package/dist-sdk/src/entities/skill/module.d.ts +4 -0
- package/dist-sdk/src/entities/skill/module.js +111 -0
- package/dist-sdk/src/entities/skill/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/skill/to-tf.js +59 -0
- package/dist-sdk/src/entities/skill/tools.d.ts +93 -0
- package/dist-sdk/src/entities/skill/tools.js +105 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +60 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.js +142 -0
- package/dist-sdk/src/entities/skill-tool/module.d.ts +3 -0
- package/dist-sdk/src/entities/skill-tool/module.js +21 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +34 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.js +130 -0
- package/dist-sdk/src/entities/skill-tool/types.d.ts +40 -0
- package/dist-sdk/src/entities/skill-tool/types.js +67 -0
- package/dist-sdk/src/entities/table/build.d.ts +74 -0
- package/dist-sdk/src/entities/table/build.js +339 -0
- package/dist-sdk/src/entities/table/catalog-render.d.ts +5 -0
- package/dist-sdk/src/entities/table/catalog-render.js +39 -0
- package/dist-sdk/src/entities/table/fields.d.ts +81 -0
- package/dist-sdk/src/entities/table/fields.js +70 -0
- package/dist-sdk/src/entities/table/filter.d.ts +41 -0
- package/dist-sdk/src/entities/table/filter.js +89 -0
- package/dist-sdk/src/entities/table/index.d.ts +8 -0
- package/dist-sdk/src/entities/table/index.js +12 -0
- package/dist-sdk/src/entities/table/joins.d.ts +26 -0
- package/dist-sdk/src/entities/table/joins.js +31 -0
- package/dist-sdk/src/entities/table/keys.d.ts +11 -0
- package/dist-sdk/src/entities/table/keys.js +25 -0
- package/dist-sdk/src/entities/table/module.d.ts +5 -0
- package/dist-sdk/src/entities/table/module.js +25 -0
- package/dist-sdk/src/entities/table/state.d.ts +39 -0
- package/dist-sdk/src/entities/table/state.js +43 -0
- package/dist-sdk/src/entities/view/from-tf.d.ts +29 -0
- package/dist-sdk/src/entities/view/from-tf.js +235 -0
- package/dist-sdk/src/entities/view/module.d.ts +24 -0
- package/dist-sdk/src/entities/view/module.js +61 -0
- package/dist-sdk/src/entities/view/to-tf.d.ts +65 -0
- package/dist-sdk/src/entities/view/to-tf.js +171 -0
- package/dist-sdk/src/entities/view/types.d.ts +58 -0
- package/dist-sdk/src/entities/view/types.js +89 -0
- package/dist-sdk/src/graph/deferred-catalog-render.d.ts +9 -0
- package/dist-sdk/src/graph/deferred-catalog-render.js +18 -0
- package/dist-sdk/src/graph/index.d.ts +91 -0
- package/dist-sdk/src/graph/index.js +211 -0
- package/dist-sdk/src/graph/modules.d.ts +7 -0
- package/dist-sdk/src/graph/modules.js +42 -0
- package/dist-sdk/src/graph/types.d.ts +375 -0
- package/dist-sdk/src/graph/types.js +102 -0
- package/dist-sdk/src/internal/sdk-package.d.ts +7 -0
- package/dist-sdk/src/internal/sdk-package.js +23 -0
- package/package.json +201 -8
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 approval-chain authoring — `defineApprovalChain`. Parallel to v1
|
|
3
|
+
* `src/approvalChains/`, but standalone: produces a `DeployableEntity` of kind
|
|
4
|
+
* `approvalChain` (app-owned) whose `lockedFields` and `relatedApp` are catalog
|
|
5
|
+
* tokens resolved at deploy. Approval chains support PUT, so a changed one
|
|
6
|
+
* updates in place.
|
|
7
|
+
*
|
|
8
|
+
* `stageId` is carried raw — stages are app config, not a managed v2 entity (no
|
|
9
|
+
* token to resolve); same for step user/group ids (org-directory entities).
|
|
10
|
+
*/
|
|
11
|
+
import { EdkValidationError } from "../../../elementum-entity-client/errors.js";
|
|
12
|
+
import { slimTokens } from "../../catalog/index.js";
|
|
13
|
+
function serializeStep(step) {
|
|
14
|
+
if (step.kind === "user") {
|
|
15
|
+
return { ...(step.id != null ? { id: step.id } : {}), user: { userId: step.ref.id } };
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
...(step.id != null ? { id: step.id } : {}),
|
|
19
|
+
group: {
|
|
20
|
+
groupId: step.ref.id,
|
|
21
|
+
numberOfApprovalsRequired: step.approvalsRequired,
|
|
22
|
+
numberOfDenialsRequired: step.denialsRequired,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/** Build a v2 approval-chain entity (app-owned; PUT-updatable). */
|
|
27
|
+
export function defineApprovalChain(opts) {
|
|
28
|
+
const ref = { __kind: "approvalChain", refName: opts.handle ?? "", name: opts.name, parent: opts.parent ?? "" };
|
|
29
|
+
if (opts.steps.length === 0) {
|
|
30
|
+
throw new EdkValidationError(`defineApprovalChain "${opts.name}": at least one step is required.`);
|
|
31
|
+
}
|
|
32
|
+
const payload = {
|
|
33
|
+
...(opts.relatedApp !== undefined
|
|
34
|
+
? { relatedAspectOwnerId: opts.relatedApp, relatedAspectOwnerType: "AspectApp" } // token → id
|
|
35
|
+
: {}),
|
|
36
|
+
name: opts.name,
|
|
37
|
+
stageId: opts.stageId,
|
|
38
|
+
...(opts.defaultReason != null ? { defaultReason: opts.defaultReason } : {}),
|
|
39
|
+
...(opts.summary != null ? { summary: opts.summary } : {}),
|
|
40
|
+
...(opts.approveButton != null ? { approveButton: opts.approveButton } : {}),
|
|
41
|
+
...(opts.denyButton != null ? { denyButton: opts.denyButton } : {}),
|
|
42
|
+
...(opts.exceptionButton != null ? { exceptionButton: opts.exceptionButton } : {}),
|
|
43
|
+
...(opts.lockedFields != null && opts.lockedFields.length > 0
|
|
44
|
+
? { lockedAspectFieldIds: opts.lockedFields } // FieldRef tokens → ids at deploy
|
|
45
|
+
: {}),
|
|
46
|
+
approvalTemplates: opts.steps.map(serializeStep),
|
|
47
|
+
};
|
|
48
|
+
return {
|
|
49
|
+
ref,
|
|
50
|
+
kind: "approvalChain",
|
|
51
|
+
parent: opts.parent ?? "",
|
|
52
|
+
refName: opts.handle ?? "",
|
|
53
|
+
payload: slimTokens(payload),
|
|
54
|
+
...(opts.enabled !== undefined ? { enabled: opts.enabled } : {}),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 approval-chain authoring — `defineApprovalChain`. App-owned; PUT-updatable.
|
|
3
|
+
* Standalone from v1's `src/approvalChains`.
|
|
4
|
+
*/
|
|
5
|
+
export { defineApprovalChain, type DefineApprovalChainV2Options } from "./build.js";
|
|
6
|
+
export { groupStep, userStep, type ApprovalGroupStep, type ApprovalStep, type ApprovalUserStep, } from "./steps.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { GroupRef } from "../../core/types/group.js";
|
|
2
|
+
import type { UserRef } from "../../core/types/user.js";
|
|
3
|
+
export interface ApprovalUserStep {
|
|
4
|
+
readonly kind: "user";
|
|
5
|
+
readonly ref: UserRef;
|
|
6
|
+
/** Server step id — present only on pulled chains; round-trips on update. */
|
|
7
|
+
readonly id?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ApprovalGroupStep {
|
|
10
|
+
readonly kind: "group";
|
|
11
|
+
readonly ref: GroupRef;
|
|
12
|
+
readonly approvalsRequired: number;
|
|
13
|
+
readonly denialsRequired: number;
|
|
14
|
+
readonly id?: string;
|
|
15
|
+
}
|
|
16
|
+
export type ApprovalStep = ApprovalUserStep | ApprovalGroupStep;
|
|
17
|
+
export declare function userStep(user: UserRef, options?: {
|
|
18
|
+
id?: string;
|
|
19
|
+
}): ApprovalUserStep;
|
|
20
|
+
export declare function groupStep(group: GroupRef, options: {
|
|
21
|
+
approvalsRequired: number;
|
|
22
|
+
denialsRequired: number;
|
|
23
|
+
id?: string;
|
|
24
|
+
}): ApprovalGroupStep;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 approval-chain steps. Parallel to v1 `src/approvalChains/steps.ts`. A step
|
|
3
|
+
* targets a user or group by **raw id** (`UserRef`/`GroupRef`) — users and
|
|
4
|
+
* groups are org-directory entities the EDK never manages and that don't live
|
|
5
|
+
* in v2 state, so they're id-by-value, not catalog tokens.
|
|
6
|
+
*/
|
|
7
|
+
import { EdkValidationError } from "../../../elementum-entity-client/errors.js";
|
|
8
|
+
export function userStep(user, options) {
|
|
9
|
+
return { kind: "user", ref: user, ...(options?.id != null ? { id: options.id } : {}) };
|
|
10
|
+
}
|
|
11
|
+
export function groupStep(group, options) {
|
|
12
|
+
const { approvalsRequired, denialsRequired, id } = options;
|
|
13
|
+
if (approvalsRequired < 0 || denialsRequired < 0) {
|
|
14
|
+
throw new EdkValidationError(`groupStep: approvalsRequired and denialsRequired must be >= 0 (got ${approvalsRequired}, ${denialsRequired}).`);
|
|
15
|
+
}
|
|
16
|
+
if (approvalsRequired === 0 && denialsRequired === 0) {
|
|
17
|
+
throw new EdkValidationError("groupStep: at least one of approvalsRequired or denialsRequired must be > 0.");
|
|
18
|
+
}
|
|
19
|
+
return { kind: "group", ref: group, approvalsRequired, denialsRequired, ...(id != null ? { id } : {}) };
|
|
20
|
+
}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import type { AutomationCatalogRef } from "../../catalog/index.js";
|
|
2
|
+
import { type Context } from "../shared/context.js";
|
|
3
|
+
import { type Ref, type Simplify, type ValueOrRef } from "../shared/ref.js";
|
|
4
|
+
import { type DeployableEntity, type EntityDeployOptions, type RecordFieldContext } from "../../engine/entity.js";
|
|
5
|
+
import { type ScriptInput } from "./script-code.js";
|
|
6
|
+
/** Structural empty object — neutral element for the `&`-accumulated task map. */
|
|
7
|
+
type EmptyObject = {
|
|
8
|
+
[K in never]: never;
|
|
9
|
+
};
|
|
10
|
+
/** One onDemand trigger parameter's authoring metadata, surfaced to the catalog. */
|
|
11
|
+
export interface TriggerParamMeta {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly required: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A trigger definition: the full wire trigger envelope (discriminated by kind,
|
|
17
|
+
* e.g. `{ createRecord: {...} }`) and the typed `ctx.trigger` shape.
|
|
18
|
+
*/
|
|
19
|
+
export interface TriggerDef<TOutput> {
|
|
20
|
+
readonly wire: Record<string, unknown>;
|
|
21
|
+
/** Phantom — the typed shape exposed as `ctx.trigger`. */
|
|
22
|
+
readonly __output?: TOutput;
|
|
23
|
+
/** onDemand parameter metadata (declaration order) — used by `ref()` to populate the catalog's trigger bag. */
|
|
24
|
+
readonly __params?: readonly TriggerParamMeta[];
|
|
25
|
+
/** The owning app's refName, when this trigger's `record` output is app-field-typed. */
|
|
26
|
+
readonly __recordApp?: string;
|
|
27
|
+
}
|
|
28
|
+
/** A named child task inside an operator (forEach/switch/forkJoin) branch. */
|
|
29
|
+
export interface ChildTask {
|
|
30
|
+
readonly name: string;
|
|
31
|
+
readonly def: TaskDef<unknown>;
|
|
32
|
+
/** Display name distinct from `refKey` (`name`), when adopting a platform-authored task. */
|
|
33
|
+
readonly displayName?: string;
|
|
34
|
+
readonly hclParent?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* One branch of an operator: a label (case name, or `null` for forEach body /
|
|
38
|
+
* switch default), an optional filter (switch case condition), and its tasks.
|
|
39
|
+
* Maps to the wire `children` entry `{ label, filter?, tasks }`.
|
|
40
|
+
*/
|
|
41
|
+
export interface OperatorChild {
|
|
42
|
+
readonly label: string | null;
|
|
43
|
+
readonly filter?: Record<string, unknown>;
|
|
44
|
+
readonly tasks: readonly ChildTask[];
|
|
45
|
+
/**
|
|
46
|
+
* The switch default branch's actual display label, when it deviates from
|
|
47
|
+
* the platform's usual "Default" (e.g. a manually renamed "Default Path").
|
|
48
|
+
* Only meaningful when `label` is `null`; `label` itself stays `null` so
|
|
49
|
+
* `to-tf.ts`/the printer can keep using it as the case-vs-default
|
|
50
|
+
* discriminator.
|
|
51
|
+
*/
|
|
52
|
+
readonly defaultLabel?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Which wire shape to-tf.ts should emit for this switch default branch —
|
|
55
|
+
* `"explicitTrueFilter"` for the older `filter = {type:"true"}` form,
|
|
56
|
+
* unset/`"isDefault"` for the newer `is_default = true` form. Only
|
|
57
|
+
* meaningful when `label` is `null`. Round-trip metadata: `edk pull`
|
|
58
|
+
* records whichever shape a case's export actually has (see #157); a
|
|
59
|
+
* hand-authored default branch should leave this unset.
|
|
60
|
+
*/
|
|
61
|
+
readonly defaultFilterMode?: "isDefault" | "explicitTrueFilter";
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A task definition produced by a factory. `key` is the one-of discriminator the
|
|
65
|
+
* platform expects (e.g. `"recordSearch"`); `config` is that task's inner body
|
|
66
|
+
* (minus `name`, which the builder injects from the `.task(name, …)` call —
|
|
67
|
+
* mirroring v1, where the task name lives inside the body). The wire task becomes
|
|
68
|
+
* `{ [key]: { name, ...config } }`. Operators additionally carry
|
|
69
|
+
* `operatorChildren`, emitted as the wire task's `children`.
|
|
70
|
+
*/
|
|
71
|
+
export interface TaskDef<TOutput> {
|
|
72
|
+
readonly key: string;
|
|
73
|
+
readonly config: Record<string, unknown>;
|
|
74
|
+
readonly operatorChildren?: readonly OperatorChild[];
|
|
75
|
+
/** Phantom — the typed shape exposed as `ctx.tasks.<name>`. */
|
|
76
|
+
readonly __output?: TOutput;
|
|
77
|
+
/** The owning app's refName, when this task's `record`/`records` output is app-field-typed. */
|
|
78
|
+
readonly __recordApp?: string;
|
|
79
|
+
}
|
|
80
|
+
/** Placeholder `forEachTaskRefKey` the forEach item proxy emits; replaced with the real refKey. */
|
|
81
|
+
export declare const FOR_EACH_PLACEHOLDER = "__forEach__";
|
|
82
|
+
/**
|
|
83
|
+
* The finalized workflow body `defineAutomation` embeds — the wire trigger, the
|
|
84
|
+
* serialized task list, and the optional output properties. Produced by
|
|
85
|
+
* {@link WorkflowChain.__finalize}; not authored by hand.
|
|
86
|
+
*/
|
|
87
|
+
export interface WorkflowDef {
|
|
88
|
+
readonly trigger: unknown;
|
|
89
|
+
readonly tasks: Record<string, unknown>[];
|
|
90
|
+
readonly outputProperties?: {
|
|
91
|
+
outputs: Array<{
|
|
92
|
+
name: string;
|
|
93
|
+
value: unknown;
|
|
94
|
+
}>;
|
|
95
|
+
};
|
|
96
|
+
/** See {@link RecordFieldContext}. Omitted when no trigger/task in this workflow is record-bearing. */
|
|
97
|
+
readonly recordFieldContext?: RecordFieldContext;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The minimal contract `defineAutomation`'s `workflow:` field accepts: anything
|
|
101
|
+
* that can finalize itself to a {@link WorkflowDef}. A `defineWorkflow()` chain
|
|
102
|
+
* satisfies this once a trigger is set ({@link WorkflowBuilder}). The pre-trigger
|
|
103
|
+
* stage ({@link WorkflowStarted}) does not, so a triggerless workflow is a
|
|
104
|
+
* compile error at the assignment.
|
|
105
|
+
*/
|
|
106
|
+
export interface WorkflowChain {
|
|
107
|
+
/** @internal — consumed by `defineAutomation`; not part of the authoring API. */
|
|
108
|
+
__finalize(): WorkflowDef;
|
|
109
|
+
/** @internal — onDemand parameter metadata; empty for non-onDemand triggers. */
|
|
110
|
+
__triggerParams(): readonly TriggerParamMeta[];
|
|
111
|
+
/** @internal — output property names declared via `.outputs()`; empty if none. */
|
|
112
|
+
__outputNames(): readonly string[];
|
|
113
|
+
}
|
|
114
|
+
/** A value an output property can carry: a typed ctx ref, or a literal. */
|
|
115
|
+
type OutputValue = Ref<unknown> | string | number | boolean | null;
|
|
116
|
+
/** `Ref<T>` values resolve to `T` by the time the platform hands them to a script. */
|
|
117
|
+
type ResolvedRefs<I> = {
|
|
118
|
+
[K in keyof I]: I[K] extends Ref<infer T> ? T : I[K];
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* A workflow with a trigger set. `.task()` accumulates typed task outputs;
|
|
122
|
+
* `.outputs()` declares the automation-level output properties (optional).
|
|
123
|
+
* Assign the chain straight to `defineAutomation`'s `workflow:` field.
|
|
124
|
+
*
|
|
125
|
+
* v3 fluent surface: trigger factories return this builder directly
|
|
126
|
+
* (`onDemand({...}).executeScript(...)`), and the Phase-1 task kinds have
|
|
127
|
+
* dedicated methods whose options take ctx-lambdas. The generic `.task()` stays
|
|
128
|
+
* as the escape hatch for every other kind.
|
|
129
|
+
*/
|
|
130
|
+
/** Reject `executeScript` TaskDefs through generic `.task()` — use fluent `.executeScript`. */
|
|
131
|
+
type NotExecuteScriptTask<D> = D extends {
|
|
132
|
+
readonly key: "executeScript";
|
|
133
|
+
} ? never : D;
|
|
134
|
+
export interface WorkflowBuilder<TTrigger, TTasks extends Record<string, unknown>, TVars extends Record<string, unknown> = EmptyObject> extends WorkflowChain {
|
|
135
|
+
/**
|
|
136
|
+
* Generic task escape hatch for every kind except `executeScript` — use
|
|
137
|
+
* {@link WorkflowBuilder.executeScript} for scripts (function-form `code`).
|
|
138
|
+
*/
|
|
139
|
+
task<TName extends string, TOutput>(name: TName, fn: (ctx: Context<TTrigger, TTasks, TVars>) => NotExecuteScriptTask<TaskDef<TOutput>>,
|
|
140
|
+
/**
|
|
141
|
+
* Display name distinct from `refKey` — only needed when adopting a
|
|
142
|
+
* platform-authored task whose wire `name` differs from its `refKey`
|
|
143
|
+
* (e.g. a UI-built "For Each" task, whose slugged refKey is "For_Each").
|
|
144
|
+
* Omit for normally-authored tasks; the wire name defaults to `refKey`.
|
|
145
|
+
*/
|
|
146
|
+
displayName?: string, hclParent?: "trigger" | string): WorkflowBuilder<TTrigger, Simplify<TTasks & Record<TName, TOutput>>, TVars>;
|
|
147
|
+
/**
|
|
148
|
+
* Fluent executeScript (v3). `inputs` is a ctx-lambda mapping input names to
|
|
149
|
+
* refs/values; `code` is ALWAYS a FUNCTION — the TS contract is the
|
|
150
|
+
* authoring surface (typed `input.parameters` from `inputs`; the return
|
|
151
|
+
* type flows to `ctx.tasks.<name>.result.*` downstream; no raw-string
|
|
152
|
+
* alternative — #125). Under `elementum build`, the body ships byte-exact
|
|
153
|
+
* from the automation file's own untranspiled source (see
|
|
154
|
+
* `tryExtractFromCurrentSource` in `script-code.ts`) rather than from the
|
|
155
|
+
* transpiled function's `toString()`, which would otherwise reformat a
|
|
156
|
+
* pulled script's exact text on every rebuild. Outside `elementum build`
|
|
157
|
+
* (e.g. constructing an automation directly in a test), the body falls
|
|
158
|
+
* back to `extractScriptBody`'s `toString()` extraction.
|
|
159
|
+
*
|
|
160
|
+
* The output schema is INFERRED from the code's `return {...}` literals —
|
|
161
|
+
* property names statically, property types from literal values (default
|
|
162
|
+
* text). Pass `outputs` only to override: a non-text property whose value
|
|
163
|
+
* isn't a literal, or a return the scan can't enumerate. Pass `outputs:
|
|
164
|
+
* null` (rather than omitting it) to explicitly suppress inference — the
|
|
165
|
+
* printer does this for pulled tasks whose platform resource genuinely
|
|
166
|
+
* carries no `output_schema`, so a rebuild doesn't invent one and drift
|
|
167
|
+
* from state.
|
|
168
|
+
*/
|
|
169
|
+
executeScript<TName extends string, I extends Record<string, ValueOrRef<unknown>> = Record<string, never>, R extends Record<string, unknown> = Record<string, unknown>>(name: TName, opts: {
|
|
170
|
+
readonly inputs?: (ctx: Context<TTrigger, TTasks, TVars>) => I;
|
|
171
|
+
readonly code: (input: ScriptInput<ResolvedRefs<I>>) => R;
|
|
172
|
+
/**
|
|
173
|
+
* Override the inferred output schema: property name → `"text" |
|
|
174
|
+
* "integer" | "number" | "decimal" | "boolean"`. `null` explicitly
|
|
175
|
+
* means "no schema" and suppresses inference; omitting the option
|
|
176
|
+
* infers from the code body.
|
|
177
|
+
*/
|
|
178
|
+
readonly outputs?: Record<string, string> | null;
|
|
179
|
+
}): WorkflowBuilder<TTrigger, Simplify<TTasks & Record<TName, {
|
|
180
|
+
result: R;
|
|
181
|
+
textResult: string;
|
|
182
|
+
}>>, TVars>;
|
|
183
|
+
/**
|
|
184
|
+
* Fluent setVariable (v3): one variable, NAMED THE SAME as its task — read
|
|
185
|
+
* it downstream as `ctx.variables.<name>`, the variable's typed ref
|
|
186
|
+
* (`Ref<string>` for the default TEXT type). (The variable name is
|
|
187
|
+
* platform-visible and must be workflow-unique — ei's export resolves
|
|
188
|
+
* variable refs by name per workflow — so it mirrors the task name rather
|
|
189
|
+
* than a fixed "value".) `value` is a ctx-lambda returning a ref, template,
|
|
190
|
+
* or literal (`(ctx) => "static"` for constants — the lambda form keeps
|
|
191
|
+
* `ctx` fully typed; a bare `ValueOrRef<unknown>` union would collapse to
|
|
192
|
+
* `unknown` and erase it).
|
|
193
|
+
*/
|
|
194
|
+
setVariable<TName extends string, TType extends string = "TEXT">(name: TName, opts: {
|
|
195
|
+
readonly value: (ctx: Context<TTrigger, TTasks, TVars>) => ValueOrRef<unknown>;
|
|
196
|
+
/** Platform variable type (default "TEXT"). */
|
|
197
|
+
readonly type?: TType;
|
|
198
|
+
}): WorkflowBuilder<TTrigger, Simplify<TTasks & Record<TName, Record<string, never>>>, Simplify<TVars & Record<TName, VariableValueOf<TType>>>>;
|
|
199
|
+
/**
|
|
200
|
+
* Declare the workflow's output properties — a map of output name → value,
|
|
201
|
+
* where each value is a typed ctx ref (`ctx.tasks.x.y`, `ctx.trigger.z`) or a
|
|
202
|
+
* literal. The ctx sees the trigger and every task, since outputs are read
|
|
203
|
+
* after the workflow runs.
|
|
204
|
+
*/
|
|
205
|
+
outputs(fn: (ctx: Context<TTrigger, TTasks, TVars>) => Record<string, OutputValue>): WorkflowBuilder<TTrigger, TTasks, TVars>;
|
|
206
|
+
}
|
|
207
|
+
/** Platform variable type → the TS value type its `ctx.variables.<name>` ref carries. */
|
|
208
|
+
type VariableValueOf<T extends string> = T extends "TEXT" ? string : T extends "NUMBER" | "DECIMAL" | "INTEGER" ? number : T extends "BOOLEAN" ? boolean : unknown;
|
|
209
|
+
/** The pre-trigger stage — a trigger must be set before tasks or outputs. */
|
|
210
|
+
export interface WorkflowStarted {
|
|
211
|
+
trigger<TOutput>(trigger: TriggerDef<TOutput>): WorkflowBuilder<TOutput, EmptyObject>;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* A trigger that is ALSO the start of a workflow chain (v3): assign it to
|
|
215
|
+
* `workflow:` and chain tasks directly — `onDemand({}).executeScript(...)` —
|
|
216
|
+
* or keep the legacy `defineWorkflow().trigger(...)` form; both accept it.
|
|
217
|
+
*/
|
|
218
|
+
export type TriggerChain<TOutput> = TriggerDef<TOutput> & WorkflowBuilder<TOutput, EmptyObject>;
|
|
219
|
+
/** Wrap a TriggerDef so it doubles as the chain start. Used by the trigger factories. */
|
|
220
|
+
export declare function chainableTrigger<TOutput>(trigger: TriggerDef<TOutput>): TriggerChain<TOutput>;
|
|
221
|
+
/**
|
|
222
|
+
* Begin a workflow body. Set a trigger, chain `.task(...)`, optionally close
|
|
223
|
+
* with `.outputs(...)`, then assign the result to `defineAutomation`'s
|
|
224
|
+
* `workflow:` field — no terminal `.build()`.
|
|
225
|
+
*/
|
|
226
|
+
export declare function defineWorkflow(): WorkflowStarted;
|
|
227
|
+
export interface AutomationV2Options extends EntityDeployOptions {
|
|
228
|
+
/** The automation's display name. Changing it updates the existing automation. */
|
|
229
|
+
readonly name: string;
|
|
230
|
+
/** Explicit SemVer publish gate. Bump only when this workflow should become live. */
|
|
231
|
+
readonly workflowRevision: string;
|
|
232
|
+
/** Optional platform description, preserved by the Terraform authoring path. */
|
|
233
|
+
readonly description?: string;
|
|
234
|
+
/** Whether this workflow may trigger other automations. */
|
|
235
|
+
readonly triggersOtherAutomations?: boolean;
|
|
236
|
+
/** The owning app's ref name (e.g. `"incidents"`). */
|
|
237
|
+
readonly parent: string;
|
|
238
|
+
readonly status?: "DRAFT" | "ACTIVE";
|
|
239
|
+
/** The workflow body — a `defineWorkflow()` chain with a trigger set. */
|
|
240
|
+
readonly workflow: WorkflowChain;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* The configured result of `defineAutomation` — its reference surface (`ref()`)
|
|
244
|
+
* and its deployable entity (`def()`). Both take `refName` as a **call-time
|
|
245
|
+
* argument** (the file's own name, never stored on the entity) — see
|
|
246
|
+
* `AppConfigured` in `src/aspects/build.ts` for the design rationale.
|
|
247
|
+
*/
|
|
248
|
+
export interface AutomationConfigured {
|
|
249
|
+
ref(refName: string): AutomationCatalogRef;
|
|
250
|
+
def(refName: string): DeployableEntity;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Define a v2 automation. Identity comes from the authoring file's `refName`
|
|
254
|
+
* plus `parent`; the display `name` lives only in the payload, so renaming an
|
|
255
|
+
* automation plans as an update rather than a create. Returns an
|
|
256
|
+
* `AutomationConfigured` with `ref(refName)` and `def(refName)`.
|
|
257
|
+
*/
|
|
258
|
+
export declare function defineAutomation(opts: AutomationV2Options): AutomationConfigured;
|
|
259
|
+
export {};
|