@elementumai/edk 0.8.2-alpha.6 → 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 +49 -37
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.d.ts +3 -3
- package/dist-sdk/elementum-entity-client/clients/aspects/models/index.d.ts +1 -1
- package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.d.ts +3 -11
- package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +3 -11
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.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/fs/entity.d.ts +2 -2
- package/dist-sdk/fs/entity.js +1 -1
- package/dist-sdk/pull/missing-report.d.ts +81 -0
- package/dist-sdk/pull/missing-report.js +52 -0
- 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 +96 -23
- package/dist-sdk/src/catalog/factories.js +141 -21
- package/dist-sdk/src/catalog/from-authoring.d.ts +5 -5
- package/dist-sdk/src/catalog/from-authoring.js +20 -10
- 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 +63 -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 +8 -2
- package/dist-sdk/src/catalog/token.js +18 -4
- package/dist-sdk/src/catalog/types.d.ts +64 -24
- package/dist-sdk/src/catalog/types.js +12 -4
- package/dist-sdk/src/core/app-to-ui.d.ts +6 -6
- package/dist-sdk/src/core/app-to-ui.js +7 -9
- package/dist-sdk/src/core/index.d.ts +11 -10
- package/dist-sdk/src/core/index.js +10 -9
- package/dist-sdk/src/core/platform-id.d.ts +11 -0
- package/dist-sdk/src/core/platform-id.js +8 -0
- package/dist-sdk/src/{entities/flow/activities/render-catalog.d.ts → core/render-tree.d.ts} +3 -3
- package/dist-sdk/src/{entities/flow/activities/render-catalog.js → core/render-tree.js} +7 -10
- 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 +78 -52
- package/dist-sdk/src/core/types/app.js +2 -3
- 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 +23 -16
- package/dist-sdk/src/engine/entity.d.ts +1 -1
- package/dist-sdk/src/engine/pull/attrs.d.ts +4 -0
- package/dist-sdk/src/engine/pull/attrs.js +17 -0
- package/dist-sdk/src/engine/pull/context.d.ts +73 -0
- package/dist-sdk/src/engine/pull/context.js +14 -0
- package/dist-sdk/src/engine/pull/org.d.ts +10 -0
- package/dist-sdk/src/engine/pull/org.js +35 -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 +7 -3
- package/dist-sdk/src/engine/tf/expr.js +27 -15
- 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/engine/workspace/authoring-layout.js +4 -2
- package/dist-sdk/src/entities/access-policy/build.d.ts +6 -16
- package/dist-sdk/src/entities/access-policy/build.js +2 -2
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +14 -40
- package/dist-sdk/src/entities/access-policy/from-tf.js +26 -85
- package/dist-sdk/src/entities/access-policy/principal.d.ts +39 -0
- package/dist-sdk/src/entities/access-policy/principal.js +13 -0
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +33 -6
- package/dist-sdk/src/entities/access-policy/to-tf.js +62 -60
- package/dist-sdk/src/entities/agent/build.d.ts +42 -11
- package/dist-sdk/src/entities/agent/build.js +40 -19
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +11 -1
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +180 -45
- package/dist-sdk/src/entities/agent/from-tf.d.ts +3 -1
- package/dist-sdk/src/entities/agent/from-tf.js +17 -12
- package/dist-sdk/src/entities/agent/index.d.ts +5 -2
- package/dist-sdk/src/entities/agent/index.js +4 -2
- package/dist-sdk/src/entities/agent/module.js +7 -2
- package/dist-sdk/src/entities/agent/run-as.d.ts +16 -0
- package/dist-sdk/src/entities/agent/run-as.js +1 -0
- package/dist-sdk/src/entities/agent/to-tf.d.ts +6 -2
- package/dist-sdk/src/entities/agent/to-tf.js +58 -9
- package/dist-sdk/src/entities/agent/tools.d.ts +97 -70
- package/dist-sdk/src/entities/agent/tools.js +63 -43
- package/dist-sdk/src/entities/agent-a2a-skill/from-tf.js +1 -1
- package/dist-sdk/src/entities/agent-a2a-skill/to-tf.js +4 -4
- 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 +25 -15
- package/dist-sdk/src/entities/agent-tool/from-tf.js +175 -43
- package/dist-sdk/src/entities/agent-tool/module.js +6 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +15 -7
- package/dist-sdk/src/entities/agent-tool/to-tf.js +169 -48
- package/dist-sdk/src/entities/agent-tool/types.d.ts +4 -6
- package/dist-sdk/src/entities/agent-tool/types.js +30 -29
- package/dist-sdk/src/entities/app/build.d.ts +214 -47
- package/dist-sdk/src/entities/app/build.js +128 -66
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +188 -8
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.d.ts +59 -0
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.js +70 -0
- package/dist-sdk/src/entities/app/display-blocks.d.ts +2 -1
- package/dist-sdk/src/entities/app/display-blocks.js +1 -1
- package/dist-sdk/src/entities/app/from-tf.d.ts +11 -1
- package/dist-sdk/src/entities/app/from-tf.js +30 -2
- package/dist-sdk/src/entities/app/index.d.ts +20 -8
- package/dist-sdk/src/entities/app/index.js +16 -6
- package/dist-sdk/src/entities/app/module.js +29 -4
- package/dist-sdk/src/entities/app/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/app/to-tf.js +97 -7
- package/dist-sdk/src/entities/approval-chain/build.d.ts +31 -16
- package/dist-sdk/src/entities/approval-chain/build.js +49 -49
- package/dist-sdk/src/entities/approval-chain/from-tf.d.ts +17 -0
- package/dist-sdk/src/entities/approval-chain/from-tf.js +57 -0
- package/dist-sdk/src/entities/approval-chain/index.d.ts +2 -3
- package/dist-sdk/src/entities/approval-chain/index.js +2 -3
- package/dist-sdk/src/entities/approval-chain/module.d.ts +3 -0
- package/dist-sdk/src/entities/approval-chain/module.js +51 -0
- package/dist-sdk/src/entities/approval-chain/printer.d.ts +2 -0
- package/dist-sdk/src/entities/approval-chain/printer.js +21 -0
- package/dist-sdk/src/entities/approval-chain/to-tf.d.ts +9 -0
- package/dist-sdk/src/entities/approval-chain/to-tf.js +43 -0
- package/dist-sdk/src/entities/automation/build.d.ts +177 -95
- package/dist-sdk/src/entities/automation/build.js +164 -72
- 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 +18 -9
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +18 -14
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +214 -311
- package/dist-sdk/src/entities/automation/filter.d.ts +1 -115
- package/dist-sdk/src/entities/automation/filter.js +1 -197
- package/dist-sdk/src/entities/automation/from-tf.d.ts +28 -0
- package/dist-sdk/src/entities/automation/from-tf.js +695 -182
- package/dist-sdk/src/entities/automation/index.d.ts +9 -10
- package/dist-sdk/src/entities/automation/index.js +11 -11
- package/dist-sdk/src/entities/automation/module.js +82 -8
- 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 +107 -28
- package/dist-sdk/src/entities/automation/serialize.js +1 -1
- package/dist-sdk/src/entities/automation/tasks.d.ts +167 -102
- package/dist-sdk/src/entities/automation/tasks.js +66 -13
- package/dist-sdk/src/entities/automation/to-tf.d.ts +44 -3
- package/dist-sdk/src/entities/automation/to-tf.js +607 -161
- package/dist-sdk/src/entities/automation/triggers.d.ts +33 -25
- package/dist-sdk/src/entities/automation/triggers.js +8 -2
- 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 +44 -0
- package/dist-sdk/src/entities/dashboard/build.js +16 -0
- package/dist-sdk/src/entities/dashboard/from-tf.d.ts +12 -0
- package/dist-sdk/src/entities/dashboard/from-tf.js +113 -0
- package/dist-sdk/src/entities/dashboard/module.d.ts +3 -0
- package/dist-sdk/src/entities/dashboard/module.js +16 -0
- package/dist-sdk/src/entities/dashboard/to-tf.d.ts +43 -0
- package/dist-sdk/src/entities/dashboard/to-tf.js +121 -0
- package/dist-sdk/src/entities/dashboard-widget/module.d.ts +3 -0
- package/dist-sdk/src/entities/dashboard-widget/module.js +10 -0
- package/dist-sdk/src/entities/data-lookup/module.d.ts +3 -0
- package/dist-sdk/src/entities/data-lookup/module.js +22 -0
- package/dist-sdk/src/entities/datamine/build.d.ts +22 -0
- package/dist-sdk/src/entities/datamine/from-tf.d.ts +17 -0
- package/dist-sdk/src/entities/datamine/from-tf.js +98 -0
- package/dist-sdk/src/entities/datamine/module.d.ts +3 -0
- package/dist-sdk/src/entities/datamine/module.js +23 -0
- package/dist-sdk/src/entities/datamine/to-tf.d.ts +11 -0
- package/dist-sdk/src/entities/datamine/to-tf.js +53 -0
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +304 -0
- package/dist-sdk/src/entities/dynamic-layout/build.js +4 -0
- package/dist-sdk/src/entities/dynamic-layout/dialect.d.ts +4 -0
- package/dist-sdk/src/entities/dynamic-layout/dialect.js +47 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.d.ts +10 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.js +239 -0
- package/dist-sdk/src/entities/dynamic-layout/module.d.ts +3 -0
- package/dist-sdk/src/entities/dynamic-layout/module.js +13 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +26 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +267 -0
- package/dist-sdk/src/entities/element/build.d.ts +48 -38
- package/dist-sdk/src/entities/element/build.js +24 -33
- package/dist-sdk/src/entities/element/from-tf.d.ts +9 -1
- package/dist-sdk/src/entities/element/from-tf.js +31 -2
- package/dist-sdk/src/entities/element/index.d.ts +14 -7
- package/dist-sdk/src/entities/element/index.js +11 -5
- package/dist-sdk/src/entities/element/module.js +26 -5
- package/dist-sdk/src/entities/element/to-tf.d.ts +2 -1
- package/dist-sdk/src/entities/element/to-tf.js +64 -4
- package/dist-sdk/src/entities/field/build.d.ts +55 -27
- 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.d.ts +6 -0
- package/dist-sdk/src/entities/field/calculation-types.js +49 -0
- package/dist-sdk/src/entities/field/from-tf.js +238 -13
- 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.d.ts +1 -0
- package/dist-sdk/src/entities/field/module.js +27 -7
- package/dist-sdk/src/entities/field/record-shape.d.ts +25 -11
- package/dist-sdk/src/entities/field/to-tf.d.ts +41 -2
- package/dist-sdk/src/entities/field/to-tf.js +314 -40
- package/dist-sdk/src/entities/field/types.d.ts +1 -1
- package/dist-sdk/src/entities/field/types.js +10 -1
- package/dist-sdk/src/entities/file-reader/build.d.ts +71 -19
- package/dist-sdk/src/entities/file-reader/build.js +49 -4
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.d.ts +1 -0
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +12 -10
- package/dist-sdk/src/entities/file-reader/from-tf.d.ts +1 -1
- package/dist-sdk/src/entities/file-reader/from-tf.js +31 -2
- package/dist-sdk/src/entities/file-reader/index.d.ts +3 -3
- package/dist-sdk/src/entities/file-reader/index.js +3 -3
- package/dist-sdk/src/entities/file-reader/module.js +6 -5
- package/dist-sdk/src/entities/file-reader/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/file-reader/to-tf.js +5 -2
- package/dist-sdk/src/entities/file-reader/types.d.ts +3 -4
- package/dist-sdk/src/entities/file-reader/types.js +4 -5
- package/dist-sdk/src/entities/org/category.js +4 -5
- 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/group.js +4 -5
- package/dist-sdk/src/entities/org/index.d.ts +2 -0
- package/dist-sdk/src/entities/org/index.js +2 -0
- package/dist-sdk/src/entities/org/phone-provider.d.ts +4 -0
- package/dist-sdk/src/entities/org/phone-provider.js +30 -0
- package/dist-sdk/src/entities/org/role.d.ts +3 -3
- package/dist-sdk/src/entities/org/role.js +9 -6
- package/dist-sdk/src/entities/organization/build.d.ts +241 -0
- package/dist-sdk/src/entities/organization/build.js +165 -0
- package/dist-sdk/src/entities/organization/index.d.ts +2 -0
- package/dist-sdk/src/entities/organization/index.js +2 -0
- package/dist-sdk/src/entities/organization/module.d.ts +2 -0
- package/dist-sdk/src/entities/organization/module.js +21 -0
- package/dist-sdk/src/entities/organization/to-tf.d.ts +7 -0
- package/dist-sdk/src/entities/organization/to-tf.js +154 -0
- package/dist-sdk/src/entities/phone-service/build.d.ts +17 -0
- package/dist-sdk/src/entities/phone-service/build.js +31 -0
- package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.d.ts +4 -0
- package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.js +56 -0
- package/dist-sdk/src/entities/phone-service/from-tf.d.ts +25 -0
- package/dist-sdk/src/entities/phone-service/from-tf.js +75 -0
- package/dist-sdk/src/entities/phone-service/index.d.ts +2 -0
- package/dist-sdk/src/entities/phone-service/index.js +2 -0
- package/dist-sdk/src/entities/phone-service/module.d.ts +3 -0
- package/dist-sdk/src/entities/phone-service/module.js +55 -0
- package/dist-sdk/src/entities/phone-service/to-tf.d.ts +12 -0
- package/dist-sdk/src/entities/phone-service/to-tf.js +54 -0
- package/dist-sdk/src/entities/phone-service/types.d.ts +35 -0
- package/dist-sdk/src/entities/phone-service/types.js +22 -0
- package/dist-sdk/src/entities/record-create-form/from-tf.d.ts +11 -0
- package/dist-sdk/src/entities/record-create-form/from-tf.js +74 -0
- package/dist-sdk/src/entities/record-create-form/module.d.ts +11 -0
- package/dist-sdk/src/entities/record-create-form/module.js +24 -0
- package/dist-sdk/src/entities/record-create-form/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/record-create-form/to-tf.js +88 -0
- package/dist-sdk/src/entities/relationship/build.d.ts +16 -0
- package/dist-sdk/src/entities/relationship/build.js +1 -0
- package/dist-sdk/src/entities/relationship/from-tf.d.ts +12 -0
- package/dist-sdk/src/entities/relationship/from-tf.js +109 -0
- package/dist-sdk/src/entities/relationship/module.d.ts +3 -0
- package/dist-sdk/src/entities/relationship/module.js +16 -0
- package/dist-sdk/src/entities/relationship/to-tf.d.ts +32 -0
- package/dist-sdk/src/entities/relationship/to-tf.js +145 -0
- package/dist-sdk/src/entities/role/build.d.ts +65 -0
- package/dist-sdk/src/entities/role/build.js +33 -0
- package/dist-sdk/src/entities/role/from-tf.d.ts +13 -0
- package/dist-sdk/src/entities/role/from-tf.js +138 -0
- package/dist-sdk/src/entities/role/to-tf.d.ts +13 -0
- package/dist-sdk/src/entities/role/to-tf.js +69 -0
- package/dist-sdk/src/entities/search-table/build.d.ts +67 -28
- package/dist-sdk/src/entities/search-table/build.js +110 -56
- package/dist-sdk/src/entities/search-table/from-tf.d.ts +37 -0
- package/dist-sdk/src/entities/search-table/from-tf.js +113 -0
- 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/module.js +88 -10
- package/dist-sdk/src/entities/search-table/printer.d.ts +2 -0
- package/dist-sdk/src/entities/search-table/printer.js +52 -0
- package/dist-sdk/src/entities/search-table/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/search-table/to-tf.js +104 -0
- package/dist-sdk/src/entities/search-table/types.d.ts +8 -0
- package/dist-sdk/src/entities/search-table/types.js +21 -0
- package/dist-sdk/src/entities/service-account/build.d.ts +32 -0
- package/dist-sdk/src/entities/service-account/build.js +9 -0
- package/dist-sdk/src/entities/service-account/from-tf.d.ts +10 -0
- package/dist-sdk/src/entities/service-account/from-tf.js +109 -0
- package/dist-sdk/src/entities/service-account/module.d.ts +4 -0
- package/dist-sdk/src/entities/service-account/module.js +21 -0
- package/dist-sdk/src/entities/service-account/ref.d.ts +11 -0
- package/dist-sdk/src/entities/service-account/ref.js +5 -0
- package/dist-sdk/src/entities/service-account/to-tf.d.ts +32 -0
- package/dist-sdk/src/entities/service-account/to-tf.js +103 -0
- package/dist-sdk/src/entities/shared/connector-from-tf.d.ts +14 -0
- package/dist-sdk/src/entities/shared/connector-from-tf.js +14 -0
- 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 +30 -81
- package/dist-sdk/src/entities/shared/filters/ast.js +6 -2
- package/dist-sdk/src/entities/shared/filters/index.d.ts +95 -206
- package/dist-sdk/src/entities/shared/filters/index.js +196 -341
- package/dist-sdk/src/entities/shared/filters/print.d.ts +11 -0
- package/dist-sdk/src/entities/shared/filters/print.js +122 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +170 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +527 -0
- package/dist-sdk/src/entities/shared/filters/types.d.ts +66 -69
- package/dist-sdk/src/entities/shared/filters/types.js +2 -3
- 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 +4 -4
- package/dist-sdk/src/entities/skill/build.js +6 -5
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +11 -1
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +100 -39
- package/dist-sdk/src/entities/skill/index.d.ts +3 -2
- package/dist-sdk/src/entities/skill/index.js +3 -2
- package/dist-sdk/src/entities/skill/module.js +8 -2
- package/dist-sdk/src/entities/skill/to-tf.d.ts +6 -2
- package/dist-sdk/src/entities/skill/to-tf.js +20 -2
- package/dist-sdk/src/entities/skill/tools.d.ts +47 -31
- package/dist-sdk/src/entities/skill/tools.js +37 -23
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +17 -1
- package/dist-sdk/src/entities/skill-tool/from-tf.js +118 -8
- package/dist-sdk/src/entities/skill-tool/module.js +9 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +6 -1
- package/dist-sdk/src/entities/skill-tool/to-tf.js +100 -48
- package/dist-sdk/src/entities/skill-tool/types.js +18 -1
- package/dist-sdk/src/entities/table/build.d.ts +64 -23
- package/dist-sdk/src/entities/table/build.js +41 -26
- package/dist-sdk/src/entities/table/catalog-render.js +15 -1
- package/dist-sdk/src/entities/table/deserializer/normalize.d.ts +99 -0
- package/dist-sdk/src/entities/table/deserializer/normalize.js +192 -0
- package/dist-sdk/src/entities/table/fields/types.d.ts +86 -0
- package/dist-sdk/src/entities/table/fields/types.js +12 -0
- package/dist-sdk/src/entities/table/fields.d.ts +107 -47
- package/dist-sdk/src/entities/table/fields.js +76 -55
- package/dist-sdk/src/entities/table/from-tf.d.ts +4 -0
- package/dist-sdk/src/entities/table/from-tf.js +261 -0
- package/dist-sdk/src/entities/table/index.d.ts +7 -5
- package/dist-sdk/src/entities/table/index.js +7 -7
- package/dist-sdk/src/entities/table/joins.d.ts +22 -9
- package/dist-sdk/src/entities/table/joins.js +8 -16
- package/dist-sdk/src/entities/table/module.d.ts +2 -1
- package/dist-sdk/src/entities/table/module.js +13 -6
- package/dist-sdk/src/entities/table/to-tf.d.ts +10 -0
- package/dist-sdk/src/entities/table/to-tf.js +222 -0
- package/dist-sdk/src/entities/task/build.d.ts +43 -0
- package/dist-sdk/src/entities/task/build.js +17 -0
- package/dist-sdk/src/entities/task/from-tf.d.ts +28 -0
- package/dist-sdk/src/entities/task/from-tf.js +38 -0
- package/dist-sdk/src/entities/task/index.d.ts +1 -0
- package/dist-sdk/src/entities/task/index.js +1 -0
- package/dist-sdk/src/entities/task/module.d.ts +3 -0
- package/dist-sdk/src/entities/task/module.js +12 -0
- package/dist-sdk/src/entities/task/to-tf.d.ts +9 -0
- package/dist-sdk/src/entities/task/to-tf.js +49 -0
- 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.d.ts +7 -2
- package/dist-sdk/src/entities/view/from-tf.js +264 -30
- package/dist-sdk/src/entities/view/module.d.ts +6 -13
- package/dist-sdk/src/entities/view/module.js +12 -15
- 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 +56 -12
- package/dist-sdk/src/entities/view/to-tf.js +192 -20
- package/dist-sdk/src/entities/view/types.d.ts +8 -0
- package/dist-sdk/src/entities/view/types.js +46 -0
- package/dist-sdk/src/entities/visual-flow/build.d.ts +87 -0
- package/dist-sdk/src/entities/visual-flow/build.js +72 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.d.ts +49 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.js +124 -0
- package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -0
- package/dist-sdk/src/entities/visual-flow/index.js +1 -0
- package/dist-sdk/src/entities/visual-flow/module.d.ts +3 -0
- package/dist-sdk/src/entities/visual-flow/module.js +41 -0
- package/dist-sdk/src/entities/visual-flow/printer.d.ts +8 -0
- package/dist-sdk/src/entities/visual-flow/printer.js +92 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.d.ts +15 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.js +97 -0
- package/dist-sdk/src/entities/widget/build.d.ts +55 -0
- package/dist-sdk/src/entities/widget/build.js +1 -0
- package/dist-sdk/src/entities/widget/from-tf.d.ts +11 -0
- package/dist-sdk/src/entities/widget/from-tf.js +209 -0
- package/dist-sdk/src/entities/widget/module.d.ts +3 -0
- package/dist-sdk/src/entities/widget/module.js +16 -0
- package/dist-sdk/src/entities/widget/to-tf.d.ts +45 -0
- package/dist-sdk/src/entities/widget/to-tf.js +206 -0
- package/dist-sdk/src/graph/deferred-catalog-render.d.ts +1 -1
- package/dist-sdk/src/graph/deferred-catalog-render.js +1 -1
- package/dist-sdk/src/graph/index.d.ts +12 -1
- package/dist-sdk/src/graph/index.js +8 -19
- package/dist-sdk/src/graph/modules.js +35 -1
- package/dist-sdk/src/graph/types.d.ts +106 -7
- 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 +5 -2
- package/package.json +39 -15
- package/dist-sdk/src/entities/access-policy/filter.d.ts +0 -61
- package/dist-sdk/src/entities/access-policy/filter.js +0 -83
- package/dist-sdk/src/entities/approval-chain/steps.d.ts +0 -24
- package/dist-sdk/src/entities/approval-chain/steps.js +0 -20
- package/dist-sdk/src/entities/flow/activities/agent.d.ts +0 -15
- package/dist-sdk/src/entities/flow/activities/agent.js +0 -29
- package/dist-sdk/src/entities/flow/activities/approval.d.ts +0 -9
- package/dist-sdk/src/entities/flow/activities/approval.js +0 -18
- package/dist-sdk/src/entities/flow/activities/automation.d.ts +0 -12
- package/dist-sdk/src/entities/flow/activities/automation.js +0 -22
- package/dist-sdk/src/entities/flow/activities/ctx.d.ts +0 -34
- package/dist-sdk/src/entities/flow/activities/ctx.js +0 -38
- package/dist-sdk/src/entities/flow/activities/form.d.ts +0 -22
- package/dist-sdk/src/entities/flow/activities/form.js +0 -36
- package/dist-sdk/src/entities/flow/activities/index.d.ts +0 -14
- package/dist-sdk/src/entities/flow/activities/index.js +0 -13
- package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +0 -39
- package/dist-sdk/src/entities/flow/activities/input-refs.js +0 -19
- package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +0 -13
- package/dist-sdk/src/entities/flow/activities/prompt-template.js +0 -34
- package/dist-sdk/src/entities/flow/activities/types.d.ts +0 -33
- package/dist-sdk/src/entities/flow/build.d.ts +0 -38
- package/dist-sdk/src/entities/flow/build.js +0 -115
- package/dist-sdk/src/entities/flow/index.d.ts +0 -8
- package/dist-sdk/src/entities/flow/index.js +0 -7
- package/dist-sdk/src/entities/flow/serialize.d.ts +0 -51
- package/dist-sdk/src/entities/flow/serialize.js +0 -94
- package/dist-sdk/src/entities/flow/util.d.ts +0 -27
- package/dist-sdk/src/entities/flow/util.js +0 -38
- package/dist-sdk/src/entities/table/filter.d.ts +0 -41
- package/dist-sdk/src/entities/table/filter.js +0 -89
- /package/dist-sdk/src/entities/{flow/activities/types.js → datamine/build.js} +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type EntityKindModule } from "../../graph/types.js";
|
|
2
|
+
export declare const SERVICE_ACCOUNT_RESOURCE_TYPE = "elementum_service_account";
|
|
3
|
+
export declare const SERVICE_ACCOUNT_ACCESS_POLICY_RESOURCE_TYPE = "elementum_service_account_access_policy";
|
|
4
|
+
export declare const serviceAccountModule: EntityKindModule;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NO_CANVAS, NO_CATALOG, NO_LIFECYCLE } from "../../graph/types.js";
|
|
2
|
+
export const SERVICE_ACCOUNT_RESOURCE_TYPE = "elementum_service_account";
|
|
3
|
+
export const SERVICE_ACCOUNT_ACCESS_POLICY_RESOURCE_TYPE = "elementum_service_account_access_policy";
|
|
4
|
+
export const serviceAccountModule = {
|
|
5
|
+
kind: "service-account",
|
|
6
|
+
stream: { role: "streamMember" },
|
|
7
|
+
authoring: { unit: "inline", bag: "serviceAccounts" },
|
|
8
|
+
parents: [{ parent: "app", child: "service-account" }],
|
|
9
|
+
resource: {
|
|
10
|
+
shape: "composite",
|
|
11
|
+
adoptable: true,
|
|
12
|
+
members: [
|
|
13
|
+
{ role: "skeleton", resourceType: SERVICE_ACCOUNT_RESOURCE_TYPE, implemented: true },
|
|
14
|
+
{ role: "accessPolicy", resourceType: SERVICE_ACCOUNT_ACCESS_POLICY_RESOURCE_TYPE, implemented: true },
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
data: { participates: true, resourceType: SERVICE_ACCOUNT_RESOURCE_TYPE, lookupAttr: "name", referencedByBuild: true },
|
|
18
|
+
lifecycle: NO_LIFECYCLE,
|
|
19
|
+
canvas: NO_CANVAS,
|
|
20
|
+
catalog: NO_CATALOG,
|
|
21
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AppCatalogRef } from "../../catalog/index.js";
|
|
2
|
+
/** A portable reference to a service account by display name within its app. */
|
|
3
|
+
export interface ServiceAccountRef {
|
|
4
|
+
readonly __kind: "serviceAccount";
|
|
5
|
+
readonly appRefName: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function serviceAccountRef(opts: {
|
|
9
|
+
readonly app: AppCatalogRef;
|
|
10
|
+
readonly name: string;
|
|
11
|
+
}): ServiceAccountRef;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { OrgRefLookup } from "../../engine/build/context.js";
|
|
2
|
+
import { type TfBlock, type TfValue } from "../../engine/tf/index.js";
|
|
3
|
+
import type { AppRole } from "../role/build.js";
|
|
4
|
+
import type { AppServiceAccount } from "./build.js";
|
|
5
|
+
/**
|
|
6
|
+
* Resolve a `serviceAccountRef({ app, name })` token to its terraform value:
|
|
7
|
+
* `elementum_service_account.<label>.id` when the name matches an account
|
|
8
|
+
* authored on the SAME app's `serviceAccounts` bag, otherwise a foreign
|
|
9
|
+
* `data.elementum_service_account` lookup (name/app_id-scoped, matching the
|
|
10
|
+
* provider's data source). Cross-app references are rejected with a
|
|
11
|
+
* diagnostic rather than silently guessed at — same restriction skill tool
|
|
12
|
+
* `runAs` already applies (a service account has no email to disambiguate
|
|
13
|
+
* it, only its owning app + name).
|
|
14
|
+
*/
|
|
15
|
+
export declare function serviceAccountRefToTf(token: {
|
|
16
|
+
readonly __kind?: string;
|
|
17
|
+
readonly appRefName?: string;
|
|
18
|
+
readonly name?: string;
|
|
19
|
+
}, opts: {
|
|
20
|
+
readonly appRefName: string;
|
|
21
|
+
readonly appTfLabel: string;
|
|
22
|
+
readonly appId: TfValue;
|
|
23
|
+
readonly serviceAccounts?: Readonly<Record<string, AppServiceAccount>>;
|
|
24
|
+
readonly orgRefs: OrgRefLookup;
|
|
25
|
+
}, where: string, diagnostics: string[]): TfValue | undefined;
|
|
26
|
+
export declare function serviceAccountsToTf(accounts: Readonly<Record<string, AppServiceAccount>> | undefined, opts: {
|
|
27
|
+
readonly ownerTfLabel: string;
|
|
28
|
+
readonly appId: TfValue;
|
|
29
|
+
readonly roles?: Readonly<Record<string, AppRole>>;
|
|
30
|
+
readonly orgRefs: OrgRefLookup;
|
|
31
|
+
readonly diagnostics: string[];
|
|
32
|
+
}): TfBlock[];
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { appScopedResourceLabel, expr, sanitizeName, scopedResourceLabel, tsLabelToTfLabel } from "../../engine/tf/index.js";
|
|
2
|
+
import { SERVICE_ACCOUNT_ACCESS_POLICY_RESOURCE_TYPE, SERVICE_ACCOUNT_RESOURCE_TYPE } from "./module.js";
|
|
3
|
+
/**
|
|
4
|
+
* Resolve a `serviceAccountRef({ app, name })` token to its terraform value:
|
|
5
|
+
* `elementum_service_account.<label>.id` when the name matches an account
|
|
6
|
+
* authored on the SAME app's `serviceAccounts` bag, otherwise a foreign
|
|
7
|
+
* `data.elementum_service_account` lookup (name/app_id-scoped, matching the
|
|
8
|
+
* provider's data source). Cross-app references are rejected with a
|
|
9
|
+
* diagnostic rather than silently guessed at — same restriction skill tool
|
|
10
|
+
* `runAs` already applies (a service account has no email to disambiguate
|
|
11
|
+
* it, only its owning app + name).
|
|
12
|
+
*/
|
|
13
|
+
export function serviceAccountRefToTf(token, opts, where, diagnostics) {
|
|
14
|
+
if (token.__kind !== "serviceAccount" || token.name === undefined || token.name === "") {
|
|
15
|
+
diagnostics.push(`${where}: serviceAccount must be a serviceAccountRef({ app, name }); dropped`);
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
if (token.appRefName !== opts.appRefName) {
|
|
19
|
+
diagnostics.push(`${where}: service account ${JSON.stringify(token.name)} belongs to app ${JSON.stringify(token.appRefName ?? "")}, not owning app ${JSON.stringify(opts.appRefName)}; dropped`);
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
const local = Object.entries(opts.serviceAccounts ?? {}).filter(([, account]) => `${account.firstName} ${account.lastName}`.trim() === token.name);
|
|
23
|
+
if (local.length > 1) {
|
|
24
|
+
diagnostics.push(`${where}: service account name ${JSON.stringify(token.name)} is ambiguous in app ${JSON.stringify(opts.appRefName)}; dropped`);
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
if (local.length === 1) {
|
|
28
|
+
return expr.resourceAttr(SERVICE_ACCOUNT_RESOURCE_TYPE, appScopedResourceLabel(opts.appTfLabel, tsLabelToTfLabel(local[0][0])), ["id"]);
|
|
29
|
+
}
|
|
30
|
+
const label = appScopedResourceLabel(opts.appTfLabel, sanitizeName(token.name));
|
|
31
|
+
opts.orgRefs.rawLookup(SERVICE_ACCOUNT_RESOURCE_TYPE, label, token.name, { app_id: opts.appId });
|
|
32
|
+
return expr.dataAttr(SERVICE_ACCOUNT_RESOURCE_TYPE, label, ["id"]);
|
|
33
|
+
}
|
|
34
|
+
function principalValues(values, type, where, orgRefs, diagnostics) {
|
|
35
|
+
if (values === undefined || values.length === 0)
|
|
36
|
+
return undefined;
|
|
37
|
+
const out = [];
|
|
38
|
+
for (const value of values) {
|
|
39
|
+
if (type === "elementum_user" && value.__kind === "user") {
|
|
40
|
+
const email = value.email;
|
|
41
|
+
const label = sanitizeName(email.split("@", 1)[0] ?? email);
|
|
42
|
+
orgRefs.rawLookup(type, label, email);
|
|
43
|
+
out.push(expr.dataAttr(type, label, ["id"]));
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (type === "elementum_group" && value.__kind === "group") {
|
|
47
|
+
const refName = value.refName ?? "";
|
|
48
|
+
const resolved = orgRefs.byTsLabel("groups", refName);
|
|
49
|
+
if (resolved === undefined)
|
|
50
|
+
diagnostics.push(`${where}: group ${JSON.stringify(refName)} is not in org.ts; dropped`);
|
|
51
|
+
else
|
|
52
|
+
out.push(expr.dataAttr(type, resolved.tfLabel, ["id"]));
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
diagnostics.push(`${where}: expected a typed ${type === "elementum_user" ? "userRef" : "group ref"}; dropped`);
|
|
56
|
+
}
|
|
57
|
+
return out.length > 0 ? out : undefined;
|
|
58
|
+
}
|
|
59
|
+
function roleValue(value, roles, ownerTfLabel, appId, orgRefs) {
|
|
60
|
+
const local = Object.entries(roles ?? {}).find(([, role]) => role.name === value.name);
|
|
61
|
+
if (local !== undefined) {
|
|
62
|
+
return expr.resourceAttr("elementum_role", scopedResourceLabel(ownerTfLabel, tsLabelToTfLabel(local[0]), "app"), ["id"]);
|
|
63
|
+
}
|
|
64
|
+
const label = sanitizeName(value.name);
|
|
65
|
+
orgRefs.rawLookup("elementum_role", label, value.name, { object_id: appId });
|
|
66
|
+
return expr.dataAttr("elementum_role", label, ["id"]);
|
|
67
|
+
}
|
|
68
|
+
export function serviceAccountsToTf(accounts, opts) {
|
|
69
|
+
const blocks = [];
|
|
70
|
+
for (const [key, account] of Object.entries(accounts ?? {})) {
|
|
71
|
+
const label = scopedResourceLabel(opts.ownerTfLabel, tsLabelToTfLabel(key), "app");
|
|
72
|
+
const attrs = {
|
|
73
|
+
app_id: opts.appId,
|
|
74
|
+
first_name: account.firstName,
|
|
75
|
+
last_name: account.lastName,
|
|
76
|
+
purpose: account.purpose,
|
|
77
|
+
};
|
|
78
|
+
if (account.status !== undefined)
|
|
79
|
+
attrs["status"] = account.status;
|
|
80
|
+
if (account.roles !== undefined)
|
|
81
|
+
attrs["role_ids"] = account.roles.map((role) => roleValue(role, opts.roles, opts.ownerTfLabel, opts.appId, opts.orgRefs));
|
|
82
|
+
blocks.push({ kind: "resource", type: SERVICE_ACCOUNT_RESOURCE_TYPE, label, attrs });
|
|
83
|
+
for (const [index, policy] of (account.accessPolicies ?? []).entries()) {
|
|
84
|
+
const policyAttrs = {
|
|
85
|
+
app_id: opts.appId,
|
|
86
|
+
service_account_id: expr.resourceAttr(SERVICE_ACCOUNT_RESOURCE_TYPE, label, ["id"]),
|
|
87
|
+
};
|
|
88
|
+
const users = principalValues(policy.users, "elementum_user", `serviceAccounts.${key}.accessPolicies[${index}].users`, opts.orgRefs, opts.diagnostics);
|
|
89
|
+
const groups = principalValues(policy.groups, "elementum_group", `serviceAccounts.${key}.accessPolicies[${index}].groups`, opts.orgRefs, opts.diagnostics);
|
|
90
|
+
if (users !== undefined)
|
|
91
|
+
policyAttrs["user_ids"] = users;
|
|
92
|
+
if (groups !== undefined)
|
|
93
|
+
policyAttrs["group_ids"] = groups;
|
|
94
|
+
blocks.push({
|
|
95
|
+
kind: "resource",
|
|
96
|
+
type: SERVICE_ACCOUNT_ACCESS_POLICY_RESOURCE_TYPE,
|
|
97
|
+
label: `${label}_access_policy${index === 0 ? "" : `_${index}`}`,
|
|
98
|
+
attrs: policyAttrs,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return blocks;
|
|
103
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ConnectorDataLookup {
|
|
2
|
+
dataName(type: string, label: string): string | undefined;
|
|
3
|
+
dataRef(type: string, label: string): {
|
|
4
|
+
readonly resourceType: string;
|
|
5
|
+
readonly tfLabel: string;
|
|
6
|
+
} | undefined;
|
|
7
|
+
}
|
|
8
|
+
export interface ConnectorIdentity {
|
|
9
|
+
readonly handle: string;
|
|
10
|
+
readonly providerKey?: string;
|
|
11
|
+
readonly catalogKey?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Derive connector identity from its own model and provider data blocks. */
|
|
14
|
+
export declare function connectorIdentityFromTf(connectorType: string, connectorLabel: string, lookup: ConnectorDataLookup): ConnectorIdentity;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { sanitizeName, tfLabelToTsLabel } from "../../engine/tf/index.js";
|
|
2
|
+
/** Derive connector identity from its own model and provider data blocks. */
|
|
3
|
+
export function connectorIdentityFromTf(connectorType, connectorLabel, lookup) {
|
|
4
|
+
const modelName = lookup.dataName(connectorType, connectorLabel);
|
|
5
|
+
const handle = tfLabelToTsLabel(sanitizeName(modelName ?? connectorLabel));
|
|
6
|
+
const providerRef = lookup.dataRef(connectorType, connectorLabel);
|
|
7
|
+
const providerName = providerRef === undefined
|
|
8
|
+
? undefined
|
|
9
|
+
: lookup.dataName(providerRef.resourceType, providerRef.tfLabel);
|
|
10
|
+
if (providerName === undefined || modelName === undefined)
|
|
11
|
+
return { handle };
|
|
12
|
+
const providerKey = tfLabelToTsLabel(sanitizeName(providerName));
|
|
13
|
+
return { handle, providerKey, catalogKey: `${providerKey}.${handle}` };
|
|
14
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Context & Proxy factory — builds the typed `ctx` object passed to each
|
|
3
|
-
*
|
|
3
|
+
* fluent action method.
|
|
4
4
|
*
|
|
5
5
|
* At the TypeScript level, ctx.trigger.vendorName is Ref<string>.
|
|
6
6
|
* At runtime, a Proxy intercepts the property access and returns a Ref
|
|
@@ -8,22 +8,22 @@
|
|
|
8
8
|
*
|
|
9
9
|
* This bridges compile-time type safety with runtime reference building.
|
|
10
10
|
*/
|
|
11
|
-
import type {
|
|
11
|
+
import type { CalculationTypeOfValue, Ref, Simplify, ToRefs } from "./ref.js";
|
|
12
12
|
/**
|
|
13
13
|
* Deep ref — a `Ref<T>` that also exposes `T`'s string-keyed properties as
|
|
14
|
-
* nested deep refs. This is what makes `ctx.
|
|
14
|
+
* nested deep refs. This is what makes `ctx.actions.x.record.id` and
|
|
15
15
|
* `ctx.trigger.record.summary` type-check: each property access yields
|
|
16
16
|
* another `Ref` whose runtime proxy extends the dotted path in `RefData.name`.
|
|
17
17
|
*
|
|
18
18
|
* Arrays stop the recursion — you can't drill into an array element by type.
|
|
19
19
|
*/
|
|
20
|
-
export type DeepRef<T> = Ref<T
|
|
20
|
+
export type DeepRef<T> = Ref<T, CalculationTypeOfValue<T>> & (T extends ReadonlyArray<unknown> ? unknown : T extends string | number | boolean | bigint | null | undefined ? unknown : T extends object ? {
|
|
21
21
|
[K in keyof T & string]: DeepRef<T[K]>;
|
|
22
22
|
} : unknown);
|
|
23
23
|
/**
|
|
24
24
|
* Maps each key of `T` to a `DeepRef` — used for both trigger outputs and
|
|
25
|
-
*
|
|
26
|
-
* `ctx.
|
|
25
|
+
* action outputs so that property drilling (`ctx.trigger.record.summary`,
|
|
26
|
+
* `ctx.actions.x.record.id`) type-checks uniformly.
|
|
27
27
|
*/
|
|
28
28
|
export type DeepRefs<T> = {
|
|
29
29
|
[K in keyof T]: DeepRef<T[K]>;
|
|
@@ -31,27 +31,27 @@ export type DeepRefs<T> = {
|
|
|
31
31
|
/**
|
|
32
32
|
* Default open-ended shape for variables when the builder hasn't tracked
|
|
33
33
|
* any typed `setVariable` calls yet — the generic-path form, where a variable
|
|
34
|
-
*
|
|
34
|
+
* an action may create several variables: `ctx.variables.<action>.<varName>` is
|
|
35
35
|
* `Ref<unknown>`.
|
|
36
36
|
*/
|
|
37
37
|
export type VariableRefs = {
|
|
38
|
-
[
|
|
38
|
+
[actionName: string]: {
|
|
39
39
|
[varName: string]: Ref<unknown>;
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
|
-
* Narrow variable refs from
|
|
44
|
-
* the variable's TS value type). A fluent variable
|
|
45
|
-
* variable named after the
|
|
43
|
+
* Narrow variable refs from fluent `setVariable` tracking (action name →
|
|
44
|
+
* the variable's TS value type). A fluent variable action holds exactly one
|
|
45
|
+
* variable named after the action, so the action-name access is the ref:
|
|
46
46
|
* `ctx.variables.<name>` is `Ref<T>` — no second hop.
|
|
47
47
|
*/
|
|
48
48
|
type TypedVariableRefs<TVariables extends Record<string, unknown>> = {
|
|
49
|
-
[
|
|
49
|
+
[ActionName in keyof TVariables]: Ref<TVariables[ActionName]>;
|
|
50
50
|
};
|
|
51
|
-
export type Context<TTrigger,
|
|
51
|
+
export type Context<TTrigger, TActions extends Record<string, unknown>, TVariables extends Record<string, unknown> = Record<string, never>> = {
|
|
52
52
|
readonly trigger: DeepRefs<TTrigger>;
|
|
53
|
-
readonly
|
|
54
|
-
[K in keyof
|
|
53
|
+
readonly actions: Simplify<{
|
|
54
|
+
[K in keyof TActions]: DeepRefs<TActions[K]>;
|
|
55
55
|
}>;
|
|
56
56
|
readonly variables: keyof TVariables extends never ? VariableRefs : TypedVariableRefs<TVariables> & VariableRefs;
|
|
57
57
|
};
|
|
@@ -63,15 +63,16 @@ export type Context<TTrigger, TTasks extends Record<string, unknown>, TVariables
|
|
|
63
63
|
*/
|
|
64
64
|
export declare function createTriggerProxy<T>(): DeepRefs<T>;
|
|
65
65
|
/**
|
|
66
|
-
* Creates a proxy for a single
|
|
67
|
-
* ctx.
|
|
66
|
+
* Creates a proxy for a single action's outputs.
|
|
67
|
+
* ctx.actions.findVendor.records → Ref with
|
|
68
|
+
* { kind: "task", actionRefKey: "findVendor", name: "records" }
|
|
68
69
|
*/
|
|
69
|
-
export declare function
|
|
70
|
+
export declare function createActionOutputProxy<T>(actionRefKey: string): DeepRefs<T>;
|
|
70
71
|
/**
|
|
71
|
-
* Creates a proxy for the
|
|
72
|
-
* ctx.
|
|
72
|
+
* Creates a proxy for the actions namespace.
|
|
73
|
+
* ctx.actions → Proxy where each property access returns an action output proxy.
|
|
73
74
|
*/
|
|
74
|
-
export declare function
|
|
75
|
+
export declare function createActionsProxy<TActions extends Record<string, unknown>>(actionNames: string[]): Context<never, TActions>["actions"];
|
|
75
76
|
/**
|
|
76
77
|
* A forEach item that is both a Ref to the whole item and a proxy
|
|
77
78
|
* with typed field access: item.fieldName → Ref<T[fieldName]>.
|
|
@@ -79,15 +80,15 @@ export declare function createTasksProxy<TTasks extends Record<string, unknown>>
|
|
|
79
80
|
export type ForEachItem<T> = Ref<T> & ToRefs<T>;
|
|
80
81
|
/**
|
|
81
82
|
* Creates a forEach item proxy.
|
|
82
|
-
* item.fieldName → Ref with { kind: "forEach",
|
|
83
|
+
* item.fieldName → Ref with { kind: "forEach", forEachActionName, name: "fieldName" }
|
|
83
84
|
* Accessing the item directly (without a property) returns a Ref to the whole item.
|
|
84
85
|
*/
|
|
85
|
-
export declare function createForEachItemProxy<T>(
|
|
86
|
+
export declare function createForEachItemProxy<T>(forEachActionName: string): ForEachItem<T>;
|
|
86
87
|
/**
|
|
87
88
|
* Build a complete Context object for a given point in the chain.
|
|
88
89
|
*
|
|
89
90
|
* `TVariables` is a phantom — it only affects the compile-time shape of
|
|
90
91
|
* `ctx.variables`. The runtime proxy is still an open-ended lookup.
|
|
91
92
|
*/
|
|
92
|
-
export declare function buildContext<TTrigger,
|
|
93
|
+
export declare function buildContext<TTrigger, TActions extends Record<string, unknown>, TVariables extends Record<string, unknown> = Record<string, never>>(actionNames: string[]): Context<TTrigger, TActions, TVariables>;
|
|
93
94
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Context & Proxy factory — builds the typed `ctx` object passed to each
|
|
3
|
-
*
|
|
3
|
+
* fluent action method.
|
|
4
4
|
*
|
|
5
5
|
* At the TypeScript level, ctx.trigger.vendorName is Ref<string>.
|
|
6
6
|
* At runtime, a Proxy intercepts the property access and returns a Ref
|
|
@@ -14,14 +14,14 @@ import { createRef } from "./ref.js";
|
|
|
14
14
|
// ---------------------------------------------------------------------------
|
|
15
15
|
/**
|
|
16
16
|
* Ref to a trigger output path; further property access extends `name`
|
|
17
|
-
* with dot segments, mirroring
|
|
17
|
+
* with dot segments, mirroring action output refs.
|
|
18
18
|
* ctx.trigger.record.summary → { kind: "trigger", name: "record.summary" }
|
|
19
19
|
*/
|
|
20
20
|
function createTriggerFieldRef(path) {
|
|
21
21
|
const base = createRef({ kind: "trigger", name: path });
|
|
22
22
|
return new Proxy(base, {
|
|
23
23
|
get(target, prop, receiver) {
|
|
24
|
-
if (typeof prop === "symbol" || prop === "__data" || prop === "__type") {
|
|
24
|
+
if (typeof prop === "symbol" || prop === "__data" || prop === "__type" || prop === "__calculationType") {
|
|
25
25
|
return Reflect.get(target, prop, receiver);
|
|
26
26
|
}
|
|
27
27
|
return createTriggerFieldRef(`${path}.${String(prop)}`);
|
|
@@ -44,55 +44,56 @@ export function createTriggerProxy() {
|
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
* Ref to
|
|
48
|
-
* (`record.id` → `{ kind: "task",
|
|
47
|
+
* Ref to an action output path; further property access extends `name` with dot
|
|
48
|
+
* segments (`record.id` → `{ kind: "task", actionRefKey, name: "record.id" }`).
|
|
49
49
|
*/
|
|
50
|
-
function
|
|
51
|
-
const base = createRef({ kind: "task",
|
|
50
|
+
function createActionOutputFieldRef(actionRefKey, outputPath) {
|
|
51
|
+
const base = createRef({ kind: "task", actionRefKey, name: outputPath });
|
|
52
52
|
return new Proxy(base, {
|
|
53
53
|
get(target, prop, receiver) {
|
|
54
|
-
if (typeof prop === "symbol" || prop === "__data" || prop === "__type") {
|
|
54
|
+
if (typeof prop === "symbol" || prop === "__data" || prop === "__type" || prop === "__calculationType") {
|
|
55
55
|
return Reflect.get(target, prop, receiver);
|
|
56
56
|
}
|
|
57
|
-
return
|
|
57
|
+
return createActionOutputFieldRef(actionRefKey, `${outputPath}.${String(prop)}`);
|
|
58
58
|
},
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
|
-
* Creates a proxy for a single
|
|
63
|
-
* ctx.
|
|
62
|
+
* Creates a proxy for a single action's outputs.
|
|
63
|
+
* ctx.actions.findVendor.records → Ref with
|
|
64
|
+
* { kind: "task", actionRefKey: "findVendor", name: "records" }
|
|
64
65
|
*/
|
|
65
|
-
export function
|
|
66
|
+
export function createActionOutputProxy(actionRefKey) {
|
|
66
67
|
return new Proxy({}, {
|
|
67
68
|
get(_target, prop) {
|
|
68
69
|
if (typeof prop === "symbol")
|
|
69
70
|
return undefined;
|
|
70
|
-
return
|
|
71
|
+
return createActionOutputFieldRef(actionRefKey, String(prop));
|
|
71
72
|
},
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
75
|
/**
|
|
75
|
-
* Creates a proxy for the
|
|
76
|
-
* ctx.
|
|
76
|
+
* Creates a proxy for the actions namespace.
|
|
77
|
+
* ctx.actions → Proxy where each property access returns an action output proxy.
|
|
77
78
|
*/
|
|
78
|
-
export function
|
|
79
|
+
export function createActionsProxy(actionNames) {
|
|
79
80
|
const cache = new Map();
|
|
80
81
|
return new Proxy({}, {
|
|
81
82
|
get(_target, prop) {
|
|
82
83
|
if (typeof prop === "symbol")
|
|
83
84
|
return undefined;
|
|
84
85
|
if (!cache.has(prop)) {
|
|
85
|
-
cache.set(prop,
|
|
86
|
+
cache.set(prop, createActionOutputProxy(prop));
|
|
86
87
|
}
|
|
87
88
|
return cache.get(prop);
|
|
88
89
|
},
|
|
89
90
|
ownKeys() {
|
|
90
|
-
return
|
|
91
|
+
return actionNames;
|
|
91
92
|
},
|
|
92
93
|
getOwnPropertyDescriptor(_target, prop) {
|
|
93
94
|
if (typeof prop === "symbol")
|
|
94
95
|
return undefined;
|
|
95
|
-
if (
|
|
96
|
+
if (actionNames.includes(prop)) {
|
|
96
97
|
return { configurable: true, enumerable: true, writable: false };
|
|
97
98
|
}
|
|
98
99
|
return undefined;
|
|
@@ -101,41 +102,41 @@ export function createTasksProxy(taskNames) {
|
|
|
101
102
|
}
|
|
102
103
|
/**
|
|
103
104
|
* Creates a forEach item proxy.
|
|
104
|
-
* item.fieldName → Ref with { kind: "forEach",
|
|
105
|
+
* item.fieldName → Ref with { kind: "forEach", forEachActionName, name: "fieldName" }
|
|
105
106
|
* Accessing the item directly (without a property) returns a Ref to the whole item.
|
|
106
107
|
*/
|
|
107
|
-
export function createForEachItemProxy(
|
|
108
|
-
const baseRef = createRef({ kind: "forEach",
|
|
108
|
+
export function createForEachItemProxy(forEachActionName) {
|
|
109
|
+
const baseRef = createRef({ kind: "forEach", forEachActionName, name: "item" });
|
|
109
110
|
return new Proxy(baseRef, {
|
|
110
111
|
get(target, prop) {
|
|
111
|
-
if (typeof prop === "symbol" || prop === "__data" || prop === "__type") {
|
|
112
|
+
if (typeof prop === "symbol" || prop === "__data" || prop === "__type" || prop === "__calculationType") {
|
|
112
113
|
return target[prop];
|
|
113
114
|
}
|
|
114
|
-
return createRef({ kind: "forEach",
|
|
115
|
+
return createRef({ kind: "forEach", forEachActionName, name: prop });
|
|
115
116
|
},
|
|
116
117
|
});
|
|
117
118
|
}
|
|
118
119
|
/**
|
|
119
120
|
* Variables proxy. The first-level access is a HYBRID (same pattern as
|
|
120
121
|
* {@link createForEachItemProxy}): it is itself a Ref to the variable named
|
|
121
|
-
* after the
|
|
122
|
+
* after the action — the fluent form, `ctx.variables.greeting` — AND a proxy
|
|
122
123
|
* whose further property access yields per-variable refs — the generic form,
|
|
123
|
-
* `ctx.variables.
|
|
124
|
-
* variables. Both produce { kind: "variableParam",
|
|
124
|
+
* `ctx.variables.actionName.varName`, for variable actions creating several
|
|
125
|
+
* variables. Both produce { kind: "variableParam", variableActionRefKey, name }.
|
|
125
126
|
*/
|
|
126
127
|
function createVariablesProxy() {
|
|
127
128
|
return new Proxy({}, {
|
|
128
|
-
get(_target,
|
|
129
|
-
if (typeof
|
|
129
|
+
get(_target, actionName) {
|
|
130
|
+
if (typeof actionName === "symbol")
|
|
130
131
|
return undefined;
|
|
131
|
-
const
|
|
132
|
-
const base = createRef({ kind: "variableParam",
|
|
132
|
+
const action = String(actionName);
|
|
133
|
+
const base = createRef({ kind: "variableParam", variableActionRefKey: action, name: action });
|
|
133
134
|
return new Proxy(base, {
|
|
134
135
|
get(target, varName, receiver) {
|
|
135
|
-
if (typeof varName === "symbol" || varName === "__data" || varName === "__type") {
|
|
136
|
+
if (typeof varName === "symbol" || varName === "__data" || varName === "__type" || varName === "__calculationType") {
|
|
136
137
|
return Reflect.get(target, varName, receiver);
|
|
137
138
|
}
|
|
138
|
-
return createRef({ kind: "variableParam",
|
|
139
|
+
return createRef({ kind: "variableParam", variableActionRefKey: action, name: String(varName) });
|
|
139
140
|
},
|
|
140
141
|
});
|
|
141
142
|
},
|
|
@@ -147,10 +148,10 @@ function createVariablesProxy() {
|
|
|
147
148
|
* `TVariables` is a phantom — it only affects the compile-time shape of
|
|
148
149
|
* `ctx.variables`. The runtime proxy is still an open-ended lookup.
|
|
149
150
|
*/
|
|
150
|
-
export function buildContext(
|
|
151
|
+
export function buildContext(actionNames) {
|
|
151
152
|
return {
|
|
152
153
|
trigger: createTriggerProxy(),
|
|
153
|
-
|
|
154
|
+
actions: createActionsProxy(actionNames),
|
|
154
155
|
variables: createVariablesProxy(),
|
|
155
156
|
};
|
|
156
157
|
}
|