@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
|
@@ -1,56 +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
1
|
import { EdkValidationError } from "../../../elementum-entity-client/errors.js";
|
|
12
|
-
import { slimTokens } from "../../catalog/index.js";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
};
|
|
2
|
+
import { slimTokens, } from "../../catalog/index.js";
|
|
3
|
+
/** Explicit escape hatch used only when pull cannot recover a portable stage key. */
|
|
4
|
+
export function unsafeApprovalStageId(value) {
|
|
5
|
+
if (value.trim() === "")
|
|
6
|
+
throw new EdkValidationError("unsafeApprovalStageId requires a non-empty platform id.");
|
|
7
|
+
return { __unsafe: "approvalStageId", value };
|
|
25
8
|
}
|
|
26
|
-
/**
|
|
27
|
-
export function
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
9
|
+
/** Define an app-owned approval process using the provider's dynamic-approver contract. */
|
|
10
|
+
export function approvalProcess(opts) {
|
|
11
|
+
if ("steps" in opts) {
|
|
12
|
+
throw new EdkValidationError("approvalProcess static steps are not supported; use the dynamic approver contract.");
|
|
13
|
+
}
|
|
14
|
+
if (opts.name.trim() === "")
|
|
15
|
+
throw new EdkValidationError("approvalProcess requires a non-empty name.");
|
|
16
|
+
if (!Number.isInteger(opts.numberOfDynamicApprovers) || opts.numberOfDynamicApprovers < 0) {
|
|
17
|
+
throw new EdkValidationError("approvalProcess numberOfDynamicApprovers must be an integer >= 0.");
|
|
31
18
|
}
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
19
|
+
for (const field of opts.lockedFields ?? []) {
|
|
20
|
+
if (field.parent !== opts.app.refName) {
|
|
21
|
+
throw new EdkValidationError(`approvalProcess locked field ${JSON.stringify(field.refName)} belongs to ${JSON.stringify(field.parent)}, not app ${JSON.stringify(opts.app.refName)}.`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const payload = slimTokens({
|
|
36
25
|
name: opts.name,
|
|
37
|
-
|
|
38
|
-
...(opts.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
...(opts.
|
|
43
|
-
...(opts.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
};
|
|
26
|
+
...(opts.stage !== undefined ? { stage: opts.stage } : {}),
|
|
27
|
+
...(opts.unsafeStageId !== undefined ? { stageId: opts.unsafeStageId.value } : {}),
|
|
28
|
+
numberOfDynamicApprovers: opts.numberOfDynamicApprovers,
|
|
29
|
+
managedByAutomation: opts.managedByAutomation ?? false,
|
|
30
|
+
denyButton: opts.denyButton ?? "Deny",
|
|
31
|
+
...(opts.defaultReason !== undefined ? { defaultReason: opts.defaultReason } : {}),
|
|
32
|
+
...(opts.summary !== undefined ? { summary: opts.summary } : {}),
|
|
33
|
+
approveButton: opts.approveButton ?? "Approve",
|
|
34
|
+
...(opts.exceptionButton !== undefined ? { exceptionButton: opts.exceptionButton } : {}),
|
|
35
|
+
...(opts.lockedFields !== undefined ? { lockedFieldIds: opts.lockedFields } : {}),
|
|
36
|
+
});
|
|
48
37
|
return {
|
|
49
|
-
ref
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
38
|
+
ref(refName) {
|
|
39
|
+
return {
|
|
40
|
+
__kind: "approvalChain",
|
|
41
|
+
refName,
|
|
42
|
+
name: opts.name,
|
|
43
|
+
parent: opts.app.refName,
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
def(refName) {
|
|
47
|
+
return {
|
|
48
|
+
kind: "approvalChain",
|
|
49
|
+
parent: opts.app.refName,
|
|
50
|
+
refName,
|
|
51
|
+
payload,
|
|
52
|
+
...(opts.enabled !== undefined ? { enabled: opts.enabled } : {}),
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
55
|
};
|
|
56
56
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type FromTfContext } from "../../engine/pull/context.js";
|
|
2
|
+
import { type TfBlock } from "../../engine/tf/index.js";
|
|
3
|
+
export interface NormalizedApprovalChain {
|
|
4
|
+
readonly refName: string;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly stage?: string;
|
|
7
|
+
readonly stageId?: string;
|
|
8
|
+
readonly numberOfDynamicApprovers: number;
|
|
9
|
+
readonly managedByAutomation: boolean;
|
|
10
|
+
readonly denyButton: string;
|
|
11
|
+
readonly approveButton: string;
|
|
12
|
+
readonly exceptionButton?: string;
|
|
13
|
+
readonly defaultReason?: string;
|
|
14
|
+
readonly summary?: string;
|
|
15
|
+
readonly lockedFields: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
export declare function approvalChainFromTf(block: TfBlock, appTfLabel: string, _ctx: FromTfContext): NormalizedApprovalChain;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { EntityTfError } from "../../engine/entity.js";
|
|
2
|
+
import { resourceRefLabel } from "../../engine/pull/context.js";
|
|
3
|
+
import { isTfExpr, scopedLabelToBagKey, tfLabelToTsLabel } from "../../engine/tf/index.js";
|
|
4
|
+
import { fieldKeyFromTfRef } from "../field/from-tf.js";
|
|
5
|
+
import { APPROVAL_PROCESS_RESOURCE_TYPE } from "./module.js";
|
|
6
|
+
const KNOWN = new Set(["id", "app_id", "name", "stage_id", "number_of_dynamic_approvers", "locked_field_ids", "managed_by_automation", "approve_button_text", "deny_button_text", "exception_button_text", "default_reason", "approval_summary"]);
|
|
7
|
+
function stringAttr(attrs, key) { return typeof attrs[key] === "string" ? attrs[key] : undefined; }
|
|
8
|
+
export function approvalChainFromTf(block, appTfLabel, _ctx) {
|
|
9
|
+
if (block.type !== APPROVAL_PROCESS_RESOURCE_TYPE || block.label === undefined)
|
|
10
|
+
throw new EntityTfError(`expected ${APPROVAL_PROCESS_RESOURCE_TYPE}`);
|
|
11
|
+
for (const key of Object.keys(block.attrs))
|
|
12
|
+
if (!KNOWN.has(key))
|
|
13
|
+
throw new EntityTfError(`${block.type}.${block.label}: unknown attribute ${key}`);
|
|
14
|
+
if (resourceRefLabel(block.attrs["app_id"], "elementum_app") !== appTfLabel)
|
|
15
|
+
throw new EntityTfError(`${block.type}.${block.label}: wrong app_id`);
|
|
16
|
+
const name = stringAttr(block.attrs, "name");
|
|
17
|
+
const count = block.attrs["number_of_dynamic_approvers"];
|
|
18
|
+
const managed = block.attrs["managed_by_automation"];
|
|
19
|
+
const deny = stringAttr(block.attrs, "deny_button_text");
|
|
20
|
+
// ei's export (cmd/elementum/export/hcl_approval.go) now always emits
|
|
21
|
+
// approve_button_text, but this fallback stays for backward compatibility
|
|
22
|
+
// with pre-fix captured .tf/in/ exports that omitted the key — don't
|
|
23
|
+
// reintroduce conditional emission logic under the false premise that
|
|
24
|
+
// ei's export still omits it.
|
|
25
|
+
const approve = stringAttr(block.attrs, "approve_button_text") ?? "Approve";
|
|
26
|
+
if (name === undefined || typeof count !== "number" || typeof managed !== "boolean" || deny === undefined)
|
|
27
|
+
throw new EntityTfError(`${block.type}.${block.label}: missing required approval attributes`);
|
|
28
|
+
const stageValue = block.attrs["stage_id"];
|
|
29
|
+
let stage;
|
|
30
|
+
let stageId;
|
|
31
|
+
if (isTfExpr(stageValue) && stageValue.$expr === "local" && stageValue.name === `${appTfLabel}_stage_ids_by_key`) {
|
|
32
|
+
const index = stageValue.path[0];
|
|
33
|
+
if (typeof index === "object")
|
|
34
|
+
stage = tfLabelToTsLabel(index.index);
|
|
35
|
+
}
|
|
36
|
+
else if (typeof stageValue === "string")
|
|
37
|
+
stageId = stageValue;
|
|
38
|
+
else if (stageValue !== undefined)
|
|
39
|
+
throw new EntityTfError(`${block.type}.${block.label}: unsupported stage_id expression`);
|
|
40
|
+
const rawFields = block.attrs["locked_field_ids"];
|
|
41
|
+
if (rawFields !== undefined && !Array.isArray(rawFields))
|
|
42
|
+
throw new EntityTfError(`${block.type}.${block.label}: locked_field_ids must be a list`);
|
|
43
|
+
const lockedFields = (rawFields ?? []).map((value) => {
|
|
44
|
+
const key = fieldKeyFromTfRef(value, appTfLabel, "app");
|
|
45
|
+
if (key === undefined)
|
|
46
|
+
throw new EntityTfError(`${block.type}.${block.label}: locked field is not a local field reference`);
|
|
47
|
+
return key;
|
|
48
|
+
});
|
|
49
|
+
return {
|
|
50
|
+
refName: scopedLabelToBagKey(appTfLabel, block.label, "app"), name,
|
|
51
|
+
...(stage !== undefined && { stage }), ...(stageId !== undefined && { stageId }),
|
|
52
|
+
numberOfDynamicApprovers: count, managedByAutomation: managed, denyButton: deny, approveButton: approve, lockedFields,
|
|
53
|
+
...(stringAttr(block.attrs, "exception_button_text") !== undefined && { exceptionButton: stringAttr(block.attrs, "exception_button_text") }),
|
|
54
|
+
...(stringAttr(block.attrs, "default_reason") !== undefined && { defaultReason: stringAttr(block.attrs, "default_reason") }),
|
|
55
|
+
...(stringAttr(block.attrs, "approval_summary") !== undefined && { summary: stringAttr(block.attrs, "approval_summary") }),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Approval-process authoring. App-owned; PUT-updatable.
|
|
3
3
|
* Standalone from v1's `src/approvalChains`.
|
|
4
4
|
*/
|
|
5
|
-
export {
|
|
6
|
-
export { groupStep, userStep, type ApprovalGroupStep, type ApprovalStep, type ApprovalUserStep, } from "./steps.js";
|
|
5
|
+
export { approvalProcess, unsafeApprovalStageId, type ApprovalProcessConfigured, type DefineApprovalProcessOptions, type UnsafeApprovalStageId, } from "./build.js";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Approval-process authoring. App-owned; PUT-updatable.
|
|
3
3
|
* Standalone from v1's `src/approvalChains`.
|
|
4
4
|
*/
|
|
5
|
-
export {
|
|
6
|
-
export { groupStep, userStep, } from "./steps.js";
|
|
5
|
+
export { approvalProcess, unsafeApprovalStageId, } from "./build.js";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { rootParentFactoryEntry } from "../../catalog/render-helpers.js";
|
|
2
|
+
import { NO_DATA } from "../../graph/types.js";
|
|
3
|
+
import { approvalChainFromTf } from "./from-tf.js";
|
|
4
|
+
import { printApprovalChain } from "./printer.js";
|
|
5
|
+
import { approvalChainToTf } from "./to-tf.js";
|
|
6
|
+
export const APPROVAL_PROCESS_RESOURCE_TYPE = "elementum_approval_process";
|
|
7
|
+
function stub(refName, parent) { return { __kind: "approvalChain", refName, name: refName, parent }; }
|
|
8
|
+
function refFromAuthoring(args) {
|
|
9
|
+
const value = args.defaultExport;
|
|
10
|
+
if (typeof value === "object" &&
|
|
11
|
+
value !== null &&
|
|
12
|
+
typeof value.ref === "function" &&
|
|
13
|
+
typeof value.def === "function") {
|
|
14
|
+
const ref = value.ref(args.refName);
|
|
15
|
+
return typeof ref === "object" && ref !== null && ref.__kind === "approvalChain"
|
|
16
|
+
? ref
|
|
17
|
+
: undefined;
|
|
18
|
+
}
|
|
19
|
+
if (typeof value !== "object" || value === null || value.kind !== "approvalChain")
|
|
20
|
+
return undefined;
|
|
21
|
+
const entity = value;
|
|
22
|
+
const name = entity.payload?.name;
|
|
23
|
+
return { __kind: "approvalChain", refName: entity.refName || args.refName, name: typeof name === "string" ? name : args.refName, parent: entity.parent || args.parent };
|
|
24
|
+
}
|
|
25
|
+
function extract(blocks, _stream, ctx) {
|
|
26
|
+
const items = [];
|
|
27
|
+
const skipped = [];
|
|
28
|
+
const diagnostics = [];
|
|
29
|
+
for (const block of blocks) {
|
|
30
|
+
try {
|
|
31
|
+
items.push(approvalChainFromTf(block, ctx.appTfLabel, ctx));
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
skipped.push(`${block.type}.${block.label ?? ""}`);
|
|
35
|
+
diagnostics.push(error instanceof Error ? error.message : String(error));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return { items, skipped, diagnostics };
|
|
39
|
+
}
|
|
40
|
+
export const approvalChainModule = {
|
|
41
|
+
kind: "approval-chain", stream: { role: "streamMember" }, authoring: { unit: "ownFile", bag: "approval-chains" },
|
|
42
|
+
parents: [{ parent: "app", child: "approval-chain" }],
|
|
43
|
+
resource: { shape: "single", resourceType: APPROVAL_PROCESS_RESOURCE_TYPE, adoptable: true }, data: NO_DATA,
|
|
44
|
+
lifecycle: {
|
|
45
|
+
participates: true, extractOwnFile: extract,
|
|
46
|
+
printOwnFile: (item, opts) => { const chain = item; return { refName: chain.refName, source: printApprovalChain(chain, opts.appRefName) }; },
|
|
47
|
+
toTf: (entity, ctx) => approvalChainToTf(entity, { appRefName: ctx.appRefName, appTfLabel: ctx.appTfLabel }),
|
|
48
|
+
},
|
|
49
|
+
canvas: { participates: true, label: "Approval processes", glyph: "✓", component: "generic" },
|
|
50
|
+
catalog: { participates: true, refKind: "approvalChain", catalogBag: "approvalChains", renderOrder: 26, catalogRoot: "app", renderEntry: rootParentFactoryEntry("approvalChainRef"), stubRef: stub, refFromAuthoring },
|
|
51
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const safe = (value) => /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(value) ? value : JSON.stringify(value);
|
|
2
|
+
export function printApprovalChain(chain, appRefName) {
|
|
3
|
+
const imports = ["approvalProcess", ...(chain.stageId !== undefined ? ["unsafeApprovalStageId"] : [])];
|
|
4
|
+
const lines = [`import { ${imports.join(", ")} } from "@elementumai/edk/approvalProcesses";`, `import catalog from "@catalog";`];
|
|
5
|
+
const props = [
|
|
6
|
+
`app: catalog.${safe(appRefName)}`,
|
|
7
|
+
`name: ${JSON.stringify(chain.name)}`,
|
|
8
|
+
...(chain.stage !== undefined ? [`stage: ${JSON.stringify(chain.stage)}`] : []),
|
|
9
|
+
...(chain.stageId !== undefined ? [`unsafeStageId: unsafeApprovalStageId(${JSON.stringify(chain.stageId)})`] : []),
|
|
10
|
+
`numberOfDynamicApprovers: ${chain.numberOfDynamicApprovers}`,
|
|
11
|
+
`managedByAutomation: ${chain.managedByAutomation}`,
|
|
12
|
+
`denyButton: ${JSON.stringify(chain.denyButton)}`,
|
|
13
|
+
`approveButton: ${JSON.stringify(chain.approveButton)}`,
|
|
14
|
+
...(chain.exceptionButton !== undefined ? [`exceptionButton: ${JSON.stringify(chain.exceptionButton)}`] : []),
|
|
15
|
+
...(chain.defaultReason !== undefined ? [`defaultReason: ${JSON.stringify(chain.defaultReason)}`] : []),
|
|
16
|
+
...(chain.summary !== undefined ? [`summary: ${JSON.stringify(chain.summary)}`] : []),
|
|
17
|
+
...(chain.lockedFields.length > 0 ? [`lockedFields: [${[...chain.lockedFields].sort().map((key) => `catalog.${safe(appRefName)}.fields.${safe(key)}`).join(", ")}]`] : []),
|
|
18
|
+
];
|
|
19
|
+
lines.push(``, `export default approvalProcess({`, ...props.map((prop) => ` ${prop},`), `});`, ``);
|
|
20
|
+
return lines.join("\n");
|
|
21
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type DeployableEntity } from "../../engine/entity.js";
|
|
2
|
+
import { type TfBlock } from "../../engine/tf/index.js";
|
|
3
|
+
export declare function approvalChainToTf(entity: DeployableEntity, ctx: {
|
|
4
|
+
appRefName: string;
|
|
5
|
+
appTfLabel: string;
|
|
6
|
+
}): {
|
|
7
|
+
blocks: readonly TfBlock[];
|
|
8
|
+
address: string;
|
|
9
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { EntityTfError } from "../../engine/entity.js";
|
|
2
|
+
import { appScopedResourceLabel, expr, tsLabelToTfLabel } from "../../engine/tf/index.js";
|
|
3
|
+
import { APP_RESOURCE_TYPE } from "../app/module.js";
|
|
4
|
+
import { fieldRefToTfValue } from "../field/to-tf.js";
|
|
5
|
+
import { APPROVAL_PROCESS_RESOURCE_TYPE } from "./module.js";
|
|
6
|
+
export function approvalChainToTf(entity, ctx) {
|
|
7
|
+
if (entity.kind !== "approvalChain")
|
|
8
|
+
throw new EntityTfError(`approvalChainToTf expects approvalChain; got ${entity.kind}`);
|
|
9
|
+
const payload = entity.payload;
|
|
10
|
+
if (payload === null)
|
|
11
|
+
throw new EntityTfError(`approval chain ${entity.refName} has no payload`);
|
|
12
|
+
const label = appScopedResourceLabel(ctx.appTfLabel, tsLabelToTfLabel(entity.refName));
|
|
13
|
+
const attrs = {
|
|
14
|
+
app_id: expr.resourceAttr(APP_RESOURCE_TYPE, ctx.appTfLabel, ["id"]),
|
|
15
|
+
name: payload.name ?? "",
|
|
16
|
+
number_of_dynamic_approvers: payload.numberOfDynamicApprovers ?? 0,
|
|
17
|
+
managed_by_automation: payload.managedByAutomation ?? false,
|
|
18
|
+
deny_button_text: payload.denyButton ?? "Deny",
|
|
19
|
+
approve_button_text: payload.approveButton ?? "Approve",
|
|
20
|
+
};
|
|
21
|
+
if (payload.stage !== undefined)
|
|
22
|
+
attrs["stage_id"] = expr.local(`${ctx.appTfLabel}_stage_ids_by_key`, [{ index: tsLabelToTfLabel(payload.stage) }]);
|
|
23
|
+
else if (payload.stageId !== undefined)
|
|
24
|
+
attrs["stage_id"] = payload.stageId;
|
|
25
|
+
if (payload.exceptionButton !== undefined)
|
|
26
|
+
attrs["exception_button_text"] = payload.exceptionButton;
|
|
27
|
+
if (payload.defaultReason !== undefined)
|
|
28
|
+
attrs["default_reason"] = payload.defaultReason;
|
|
29
|
+
if (payload.summary !== undefined)
|
|
30
|
+
attrs["approval_summary"] = payload.summary;
|
|
31
|
+
if (payload.lockedFieldIds !== undefined) {
|
|
32
|
+
attrs["locked_field_ids"] = payload.lockedFieldIds.map((field) => {
|
|
33
|
+
if (field.parent !== undefined && field.parent !== "" && field.parent !== ctx.appRefName)
|
|
34
|
+
throw new EntityTfError(`approval chain ${entity.refName}: locked field belongs to ${field.parent}`);
|
|
35
|
+
const value = fieldRefToTfValue(field.fieldType ?? "", field.refName ?? "", ctx.appTfLabel);
|
|
36
|
+
if (value === undefined)
|
|
37
|
+
throw new EntityTfError(`approval chain ${entity.refName}: locked field ${field.refName ?? ""} has no Terraform mapping`);
|
|
38
|
+
return value;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const block = { kind: "resource", type: APPROVAL_PROCESS_RESOURCE_TYPE, label, attrs };
|
|
42
|
+
return { blocks: [block], address: `${APPROVAL_PROCESS_RESOURCE_TYPE}.${label}` };
|
|
43
|
+
}
|