@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
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* reference := ("data." type "." label | type "." label) ("." ident)* index?
|
|
6
6
|
* | "local." ident
|
|
7
7
|
* index := "[" quoted-string "]"
|
|
8
|
-
* jsonencode:= "jsonencode(" hcl-
|
|
8
|
+
* jsonencode:= "jsonencode(" hcl-value ")"
|
|
9
9
|
*
|
|
10
10
|
* plus templates: strings mixing literal text with ${...} parts.
|
|
11
11
|
* Anything else is a LOUD error — an unknown form in a stream means the
|
|
@@ -19,13 +19,8 @@ export class TfExprError extends Error {
|
|
|
19
19
|
this.name = "TfExprError";
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* hcl2json encodes every expression attribute as "${...}"; plain strings
|
|
25
|
-
* stay plain (with template escapes still doubled).
|
|
26
|
-
*/
|
|
27
|
-
export function parseStringValue(raw) {
|
|
28
|
-
const parts = splitTemplate(raw);
|
|
22
|
+
export function parseStringValue(raw, options = {}) {
|
|
23
|
+
const parts = splitTemplate(raw, options);
|
|
29
24
|
if (parts.length === 1 && typeof parts[0] === "string") {
|
|
30
25
|
return parts[0]; // plain string, already decoded
|
|
31
26
|
}
|
|
@@ -38,7 +33,7 @@ export function parseStringValue(raw) {
|
|
|
38
33
|
* Split a raw template string into alternating literal text (decoded) and
|
|
39
34
|
* parsed expressions. "$${" is an escape, not an interpolation start.
|
|
40
35
|
*/
|
|
41
|
-
function splitTemplate(raw) {
|
|
36
|
+
function splitTemplate(raw, options) {
|
|
42
37
|
const parts = [];
|
|
43
38
|
let literal = "";
|
|
44
39
|
let i = 0;
|
|
@@ -54,7 +49,7 @@ function splitTemplate(raw) {
|
|
|
54
49
|
parts.push(decodeTemplateEscapes(literal));
|
|
55
50
|
literal = "";
|
|
56
51
|
}
|
|
57
|
-
parts.push(parseExpression(raw.slice(i + 2, end)));
|
|
52
|
+
parts.push(parseExpression(raw.slice(i + 2, end), options));
|
|
58
53
|
i = end + 1;
|
|
59
54
|
continue;
|
|
60
55
|
}
|
|
@@ -104,8 +99,8 @@ function skipQuotedString(s, openQuote) {
|
|
|
104
99
|
throw new TfExprError("unterminated string literal", s);
|
|
105
100
|
}
|
|
106
101
|
/** Parse the inside of a ${...} interpolation. */
|
|
107
|
-
export function parseExpression(src) {
|
|
108
|
-
const p = new Parser(src);
|
|
102
|
+
export function parseExpression(src, options = {}) {
|
|
103
|
+
const p = new Parser(src, options);
|
|
109
104
|
const e = p.parseExpr();
|
|
110
105
|
p.skipWs();
|
|
111
106
|
if (!p.done()) {
|
|
@@ -116,9 +111,11 @@ export function parseExpression(src) {
|
|
|
116
111
|
const IDENT_RE = /^[A-Za-z_][A-Za-z0-9_-]*/;
|
|
117
112
|
class Parser {
|
|
118
113
|
src;
|
|
114
|
+
options;
|
|
119
115
|
pos = 0;
|
|
120
|
-
constructor(src) {
|
|
116
|
+
constructor(src, options) {
|
|
121
117
|
this.src = src;
|
|
118
|
+
this.options = options;
|
|
122
119
|
}
|
|
123
120
|
parseExpr() {
|
|
124
121
|
this.skipWs();
|
|
@@ -180,6 +177,14 @@ class Parser {
|
|
|
180
177
|
const name = this.takeIdent();
|
|
181
178
|
return expr.local(name, this.parsePath());
|
|
182
179
|
}
|
|
180
|
+
if (first === "var") {
|
|
181
|
+
if (this.options.allowVariables !== true) {
|
|
182
|
+
throw new TfExprError("Terraform variables are only supported in modeled credential attributes", this.src);
|
|
183
|
+
}
|
|
184
|
+
this.expect(".");
|
|
185
|
+
const name = this.takeIdent();
|
|
186
|
+
return expr.variable(name, this.parsePath());
|
|
187
|
+
}
|
|
183
188
|
let type;
|
|
184
189
|
let isData = false;
|
|
185
190
|
if (first === "data") {
|
|
@@ -222,7 +227,7 @@ class Parser {
|
|
|
222
227
|
}
|
|
223
228
|
return path;
|
|
224
229
|
}
|
|
225
|
-
/** HCL
|
|
230
|
+
/** HCL value inside jsonencode(...): objects, arrays, scalars, or supported references. */
|
|
226
231
|
parseLiteral() {
|
|
227
232
|
this.skipWs();
|
|
228
233
|
const c = this.peek();
|
|
@@ -234,6 +239,7 @@ class Parser {
|
|
|
234
239
|
return this.parseQuotedString();
|
|
235
240
|
if (c === "-" || (c !== undefined && c >= "0" && c <= "9"))
|
|
236
241
|
return this.parseNumber();
|
|
242
|
+
const identStart = this.pos;
|
|
237
243
|
const ident = this.tryIdent();
|
|
238
244
|
if (ident === "true")
|
|
239
245
|
return true;
|
|
@@ -241,7 +247,13 @@ class Parser {
|
|
|
241
247
|
return false;
|
|
242
248
|
if (ident === "null")
|
|
243
249
|
return null;
|
|
244
|
-
|
|
250
|
+
if (ident !== null) {
|
|
251
|
+
this.pos = identStart;
|
|
252
|
+
if (ident === "data" || ident === "local" || ident === "var" || ident.startsWith("elementum_")) {
|
|
253
|
+
return this.parseReference();
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
throw new TfExprError(`unsupported value in jsonencode payload at "${this.rest().slice(0, 40)}" — only literals and supported references are in the grammar`, this.src);
|
|
245
257
|
}
|
|
246
258
|
parseObjectLiteral() {
|
|
247
259
|
this.expect("{");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* src/tf — the ONE HCL parse/render surface
|
|
2
|
+
* src/tf — the ONE HCL parse/render surface.
|
|
3
3
|
* A second dialect must not exist: extractors consume TfBlock from parseHcl;
|
|
4
4
|
* toHcl emitters produce TfBlock rendered by renderDocument.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* src/tf — the ONE HCL parse/render surface
|
|
2
|
+
* src/tf — the ONE HCL parse/render surface.
|
|
3
3
|
* A second dialect must not exist: extractors consume TfBlock from parseHcl;
|
|
4
4
|
* toHcl emitters produce TfBlock rendered by renderDocument.
|
|
5
5
|
*/
|
|
@@ -33,6 +33,12 @@ export type TfExpr =
|
|
|
33
33
|
name: string;
|
|
34
34
|
path: PathSeg[];
|
|
35
35
|
}
|
|
36
|
+
/** var.secret_name — used for sensitive organization credentials. */
|
|
37
|
+
| {
|
|
38
|
+
$expr: "variable";
|
|
39
|
+
name: string;
|
|
40
|
+
path: PathSeg[];
|
|
41
|
+
}
|
|
36
42
|
/** jsonencode({ ... }) — value is the payload as plain data */
|
|
37
43
|
| {
|
|
38
44
|
$expr: "jsonencode";
|
|
@@ -60,7 +66,7 @@ export type TfExpr =
|
|
|
60
66
|
export type TfValue = string | number | boolean | null | TfValue[] | {
|
|
61
67
|
[k: string]: TfValue;
|
|
62
68
|
} | TfExpr;
|
|
63
|
-
export type TfBlockKind = "resource" | "data" | "locals" | "import" | "provider" | "terraform";
|
|
69
|
+
export type TfBlockKind = "resource" | "data" | "locals" | "import" | "provider" | "terraform" | "variable";
|
|
64
70
|
export interface TfBlock {
|
|
65
71
|
kind: TfBlockKind;
|
|
66
72
|
/** resource/data only: the terraform type, e.g. "elementum_app" */
|
|
@@ -77,6 +83,7 @@ export declare const expr: {
|
|
|
77
83
|
resourceAttr(type: string, label: string, path?: PathSeg[]): TfExpr;
|
|
78
84
|
dataAttr(type: string, label: string, path?: PathSeg[]): TfExpr;
|
|
79
85
|
local(name: string, path?: PathSeg[]): TfExpr;
|
|
86
|
+
variable(name: string, path?: PathSeg[]): TfExpr;
|
|
80
87
|
jsonencode(value: TfValue): TfExpr;
|
|
81
88
|
template(parts: (string | TfExpr)[]): TfExpr;
|
|
82
89
|
scopedAttr(name: string, path?: PathSeg[]): TfExpr;
|
|
@@ -12,6 +12,7 @@ const EXPR_KINDS = new Set([
|
|
|
12
12
|
"resource-attr",
|
|
13
13
|
"data-attr",
|
|
14
14
|
"local",
|
|
15
|
+
"variable",
|
|
15
16
|
"jsonencode",
|
|
16
17
|
"template",
|
|
17
18
|
"scoped-attr",
|
|
@@ -34,6 +35,9 @@ export const expr = {
|
|
|
34
35
|
local(name, path = []) {
|
|
35
36
|
return { $expr: "local", name, path };
|
|
36
37
|
},
|
|
38
|
+
variable(name, path = []) {
|
|
39
|
+
return { $expr: "variable", name, path };
|
|
40
|
+
},
|
|
37
41
|
jsonencode(value) {
|
|
38
42
|
return { $expr: "jsonencode", value };
|
|
39
43
|
},
|
|
@@ -43,7 +43,7 @@ export class TfParseError extends Error {
|
|
|
43
43
|
this.name = "TfParseError";
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
const KNOWN_TOP_LEVEL = new Set(["resource", "data", "locals", "import", "provider", "terraform"]);
|
|
46
|
+
const KNOWN_TOP_LEVEL = new Set(["resource", "data", "locals", "import", "provider", "terraform", "variable"]);
|
|
47
47
|
const BACKEND_TOP_LEVEL = new Set(["terraform", "variable", "locals"]);
|
|
48
48
|
const BACKEND_SECRET_KEYS = new Set([
|
|
49
49
|
"access_key",
|
|
@@ -252,6 +252,13 @@ export async function parseHcl(text) {
|
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
+
const variables = raw["variable"];
|
|
256
|
+
if (variables) {
|
|
257
|
+
for (const [name, bodies] of Object.entries(variables)) {
|
|
258
|
+
for (const body of bodies)
|
|
259
|
+
blocks.push({ kind: "variable", label: name, attrs: convertBody(body, `variable.${name}`) });
|
|
260
|
+
}
|
|
261
|
+
}
|
|
255
262
|
const terraformBodies = raw["terraform"];
|
|
256
263
|
if (terraformBodies) {
|
|
257
264
|
for (const body of terraformBodies) {
|
|
@@ -277,7 +284,7 @@ function convertValue(value, ctx) {
|
|
|
277
284
|
return value;
|
|
278
285
|
if (typeof value === "string") {
|
|
279
286
|
try {
|
|
280
|
-
return parseStringValue(value);
|
|
287
|
+
return parseStringValue(value, { allowVariables: isCredentialVariableContext(ctx) });
|
|
281
288
|
}
|
|
282
289
|
catch (e) {
|
|
283
290
|
if (e instanceof TfExprError) {
|
|
@@ -303,6 +310,10 @@ function convertValue(value, ctx) {
|
|
|
303
310
|
}
|
|
304
311
|
throw new TfParseError(`unsupported value type "${typeof value}" at ${ctx}`);
|
|
305
312
|
}
|
|
313
|
+
function isCredentialVariableContext(ctx) {
|
|
314
|
+
return /^resource\.elementum_cloudlink\.[^.]+\.credentials(?:\.|$)/.test(ctx) ||
|
|
315
|
+
/^resource\.elementum_phone_provider\.[^.]+\.twilio(?:\.|$)/.test(ctx);
|
|
316
|
+
}
|
|
306
317
|
/**
|
|
307
318
|
* Refuse to parse text whose integer literals exceed Number.MAX_SAFE_INTEGER —
|
|
308
319
|
* hcl2json would round them silently (verified: 2^53+1 → 2^53).
|
|
@@ -28,6 +28,8 @@ function blockHeader(block) {
|
|
|
28
28
|
return `${block.kind} ${quoteLabel(block.type)} ${quoteLabel(block.label)}`;
|
|
29
29
|
case "provider":
|
|
30
30
|
return `provider ${quoteLabel(block.label)}`;
|
|
31
|
+
case "variable":
|
|
32
|
+
return `variable ${quoteLabel(block.label)}`;
|
|
31
33
|
case "locals":
|
|
32
34
|
case "import":
|
|
33
35
|
case "terraform":
|
|
@@ -76,6 +78,8 @@ function renderExpr(e, depth) {
|
|
|
76
78
|
return `data.${e.type}.${e.label}${renderPath(e.path)}`;
|
|
77
79
|
case "local":
|
|
78
80
|
return `local.${e.name}${renderPath(e.path)}`;
|
|
81
|
+
case "variable":
|
|
82
|
+
return `var.${e.name}${renderPath(e.path)}`;
|
|
79
83
|
case "jsonencode":
|
|
80
84
|
return `jsonencode(${renderValue(e.value, depth)})`;
|
|
81
85
|
case "template": {
|
|
@@ -29,9 +29,9 @@ const ASPECT_ROOTS = new Set(ENTITY_KIND_MODULES.flatMap((m) => {
|
|
|
29
29
|
}));
|
|
30
30
|
/**
|
|
31
31
|
* Child bags under apps|elements: union of own-file bags under app/element,
|
|
32
|
-
* plus legacy authoring dirs not yet registered as graph kinds
|
|
32
|
+
* plus legacy authoring dirs not yet registered as graph kinds.
|
|
33
33
|
*/
|
|
34
|
-
const LEGACY_CHILD_BAGS = ["
|
|
34
|
+
const LEGACY_CHILD_BAGS = ["approval-chains", "tables", "fileReaders"];
|
|
35
35
|
const CHILD_BAGS = new Set([
|
|
36
36
|
...ownFileBagsUnder("app"),
|
|
37
37
|
...ownFileBagsUnder("element"),
|
|
@@ -83,6 +83,8 @@ export function assertRelativeAuthoringPath(relPath) {
|
|
|
83
83
|
throw new Error(`Flat authoring path is not allowed (${bag}/${stem}.ts). ` +
|
|
84
84
|
`Use ${bag}/${stem}/${stem}.ts instead.`);
|
|
85
85
|
}
|
|
86
|
+
if (parts.length === 4 && parts[2] === "search-tables")
|
|
87
|
+
return;
|
|
86
88
|
throw new Error(`Org-owned table authoring path must be tables/<ref>/<ref>.ts, got: ${rel}`);
|
|
87
89
|
}
|
|
88
90
|
if (!bag || !ASPECT_ROOTS.has(bag)) {
|
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Access-policy authoring options — the `accessPolicies: [...]` array shared
|
|
3
|
-
* by `
|
|
3
|
+
* by `app`/`element` (`entities/app/build.ts` /
|
|
4
4
|
* `entities/element/build.ts`). Kept here, not duplicated per parent, since
|
|
5
5
|
* both parents accept the identical shape.
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* A principal (user/group) reference: a raw platform id — EDK has no
|
|
12
|
-
* `org.users` catalog bag to reference a user by handle (see
|
|
13
|
-
* `entities/org/user.ts`) — or, for groups only, a real `org.groups.<key>`
|
|
14
|
-
* catalog token. `AccessPolicyPrincipalRef` is the pulled-source echo (see
|
|
15
|
-
* that type's own doc comment) — round-tripped, not meant to be hand-authored.
|
|
16
|
-
*/
|
|
17
|
-
export type AccessPolicyUserRef = string | AccessPolicyPrincipalRef;
|
|
18
|
-
export type AccessPolicyGroupRef = string | GroupRef | AccessPolicyPrincipalRef;
|
|
7
|
+
import type { Filter } from "../shared/filters/types.js";
|
|
8
|
+
import type { AccessPolicyGroupRef, AccessPolicyServiceAccountRef, AccessPolicyUserRef } from "./principal.js";
|
|
9
|
+
export { groupId, userId, type AccessPolicyGroupRef, type AccessPolicyPrincipal, type AccessPolicyPrincipalRef, type AccessPolicyServiceAccountRef, type AccessPolicyUserRef, type GroupId, type UserId, } from "./principal.js";
|
|
19
10
|
export interface AccessPolicyOptions {
|
|
20
11
|
/** Row-level-security predicate. Omit for the platform default (matches every record). */
|
|
21
|
-
readonly filter?:
|
|
12
|
+
readonly filter?: Filter;
|
|
22
13
|
readonly userIds?: readonly AccessPolicyUserRef[];
|
|
23
14
|
readonly groupIds?: readonly AccessPolicyGroupRef[];
|
|
24
|
-
|
|
25
|
-
readonly serviceAccountIds?: readonly string[];
|
|
15
|
+
readonly serviceAccountIds?: readonly AccessPolicyServiceAccountRef[];
|
|
26
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Access-policy authoring options — the `accessPolicies: [...]` array shared
|
|
3
|
-
* by `
|
|
3
|
+
* by `app`/`element` (`entities/app/build.ts` /
|
|
4
4
|
* `entities/element/build.ts`). Kept here, not duplicated per parent, since
|
|
5
5
|
* both parents accept the identical shape.
|
|
6
6
|
*/
|
|
7
|
-
export {};
|
|
7
|
+
export { groupId, userId, } from "./principal.js";
|
|
@@ -11,8 +11,11 @@
|
|
|
11
11
|
* dropped with a diagnostic rather than silently misattributed.
|
|
12
12
|
*/
|
|
13
13
|
import { type FromTfContext } from "../../engine/pull/context.js";
|
|
14
|
-
import { type ChildResourceScope, type TfBlock } from "../../engine/tf/index.js";
|
|
15
|
-
import type {
|
|
14
|
+
import { type ChildResourceScope, type TfBlock, type TfValue } from "../../engine/tf/index.js";
|
|
15
|
+
import type { RefExpr } from "../shared/filters/ast.js";
|
|
16
|
+
import type { Filter } from "../shared/filters/types.js";
|
|
17
|
+
import { type AccessPolicyGroupRef, type AccessPolicyServiceAccountRef, type AccessPolicyUserRef } from "./principal.js";
|
|
18
|
+
export type { AccessPolicyPrincipalRef, AccessPolicyServiceAccountRef } from "./principal.js";
|
|
16
19
|
export interface AccessPolicyOwner {
|
|
17
20
|
readonly type: string;
|
|
18
21
|
readonly label: string;
|
|
@@ -22,45 +25,16 @@ export interface AccessPolicyOwner {
|
|
|
22
25
|
readonly ownerTfLabel: string;
|
|
23
26
|
readonly scope: ChildResourceScope;
|
|
24
27
|
}
|
|
25
|
-
/**
|
|
26
|
-
* A resolved `data.elementum_user`/`data.elementum_group` reference, decoded
|
|
27
|
-
* from a pulled stream — reproduced byte-for-byte by `to-tf.ts`'s
|
|
28
|
-
* `rawLookup`, never re-derived. Also a valid `AccessPolicyUserRef`/
|
|
29
|
-
* `AccessPolicyGroupRef` (see `build.ts`), so the printer can round-trip it
|
|
30
|
-
* straight into `userIds`/`groupIds` without a separate print-time shape.
|
|
31
|
-
*/
|
|
32
|
-
export interface AccessPolicyPrincipalRef {
|
|
33
|
-
readonly __kind: "orgPrincipalRef";
|
|
34
|
-
readonly dataType: "elementum_user" | "elementum_group";
|
|
35
|
-
/** The data block's own label, captured verbatim — reproduced byte-for-byte, never re-derived. */
|
|
36
|
-
readonly label: string;
|
|
37
|
-
/** The data block's lookup-attr value ("email" for a user, "name" for a group). */
|
|
38
|
-
readonly value: string;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* FilterAst kinds {@link decodeFilter} can emit — same set as
|
|
42
|
-
* `access-policy/filter.ts` (no consecutiveRange / contains / overlaps).
|
|
43
|
-
* Printer + hoist walker switch on this, not the full automation FilterAst,
|
|
44
|
-
* so an automation-only kind cannot silently grow AP coverage. A new
|
|
45
|
-
* FilterAst kind still fails exhaustiveness here until it is excluded or
|
|
46
|
-
* implemented in decodeFilter + filter.ts.
|
|
47
|
-
*/
|
|
48
|
-
export type AccessPolicyFilterAst = Exclude<FilterAst, {
|
|
49
|
-
kind: "and" | "or";
|
|
50
|
-
} | {
|
|
51
|
-
kind: "consecutiveRange";
|
|
52
|
-
} | {
|
|
53
|
-
kind: "contains" | "overlaps";
|
|
54
|
-
}> | {
|
|
55
|
-
kind: "and" | "or";
|
|
56
|
-
children: readonly AccessPolicyFilterAst[];
|
|
57
|
-
};
|
|
58
28
|
export interface NormalizedAccessPolicy {
|
|
59
|
-
readonly filter:
|
|
60
|
-
readonly userIds?: readonly
|
|
61
|
-
readonly groupIds?: readonly
|
|
62
|
-
|
|
63
|
-
readonly serviceAccountIds?: readonly string[];
|
|
29
|
+
readonly filter: Filter<RefExpr, RefExpr>;
|
|
30
|
+
readonly userIds?: readonly AccessPolicyUserRef[];
|
|
31
|
+
readonly groupIds?: readonly AccessPolicyGroupRef[];
|
|
32
|
+
readonly serviceAccountIds?: readonly AccessPolicyServiceAccountRef[];
|
|
64
33
|
}
|
|
34
|
+
/** Decode one `filter` attribute through the shared exhaustive codec. */
|
|
35
|
+
export declare function filterFromTf(value: TfValue, owner: AccessPolicyOwner, where: string): Filter<RefExpr, RefExpr>;
|
|
36
|
+
export declare function principalList(value: TfValue | undefined, dataType: "elementum_user", where: string, ctx: FromTfContext): AccessPolicyUserRef[] | undefined;
|
|
37
|
+
export declare function principalList(value: TfValue | undefined, dataType: "elementum_group", where: string, ctx: FromTfContext): AccessPolicyGroupRef[] | undefined;
|
|
38
|
+
export declare function principalList(value: TfValue | undefined, dataType: "elementum_service_account", where: string, ctx: FromTfContext): AccessPolicyServiceAccountRef[] | undefined;
|
|
65
39
|
/** One `elementum_access_policy` block → its normalized shape, or undefined when it belongs to a different owner. */
|
|
66
40
|
export declare function accessPolicyFromTf(block: TfBlock, owner: AccessPolicyOwner, ctx: FromTfContext): NormalizedAccessPolicy | undefined;
|
|
@@ -13,10 +13,9 @@
|
|
|
13
13
|
import { EntityTfError } from "../../engine/entity.js";
|
|
14
14
|
import { dataRefLabel, resourceRefLabel } from "../../engine/pull/context.js";
|
|
15
15
|
import { isTfExpr, scopedLabelToBagKey, tfLabelToTsLabel } from "../../engine/tf/index.js";
|
|
16
|
+
import { filterFromTf as deserializeFilterFromTf } from "../shared/filters/tf-codec.js";
|
|
17
|
+
import { groupId, userId, } from "./principal.js";
|
|
16
18
|
import { KNOWN_ACCESS_POLICY_ATTRS } from "./types.js";
|
|
17
|
-
function isObject(value) {
|
|
18
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19
|
-
}
|
|
20
19
|
function fieldRef(value, owner, where) {
|
|
21
20
|
if (isTfExpr(value) && value.$expr === "resource-attr" && value.type.endsWith("_field") && value.path[0] === "id") {
|
|
22
21
|
return { kind: "field", appHandle: owner.ownerRefName, fieldKey: scopedLabelToBagKey(owner.ownerTfLabel, value.label, owner.scope) };
|
|
@@ -52,74 +51,15 @@ function picklistOptionLabel(value) {
|
|
|
52
51
|
? segment.index
|
|
53
52
|
: undefined;
|
|
54
53
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
throw new EntityTfError(`${where}: filter value has no type`);
|
|
64
|
-
if (type === "null")
|
|
65
|
-
return { kind: "null" };
|
|
66
|
-
if (type === "current_user") {
|
|
67
|
-
const raw = typeof value.current_user_type === "string" ? value.current_user_type.toLowerCase() : "id";
|
|
68
|
-
const currentUserType = raw === "email" || raw === "domain" ? raw : "id";
|
|
69
|
-
return { kind: "currentUser", currentUserType };
|
|
70
|
-
}
|
|
71
|
-
if (["text", "number", "boolean", "uuid", "date", "datetime"].includes(type)) {
|
|
72
|
-
return { kind: type, value: value.value };
|
|
73
|
-
}
|
|
74
|
-
if (type === "field")
|
|
75
|
-
return { kind: "reference", ref: fieldRef(value.value, owner, where) };
|
|
76
|
-
throw new EntityTfError(`${where}: unsupported filter value type "${type}"`);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Decode one `filter` attribute. Kinds are the {@link AccessPolicyFilterAst}
|
|
80
|
-
* set — `filter.ts` builders plus what ei actually exports. consecutiveRange /
|
|
81
|
-
* contains / overlaps throw here rather than decode into FilterAst nodes the
|
|
82
|
-
* printer cannot author.
|
|
83
|
-
*/
|
|
84
|
-
function decodeFilter(value, owner, where) {
|
|
85
|
-
if (!isObject(value) || isTfExpr(value) || typeof value.type !== "string")
|
|
86
|
-
throw new EntityTfError(`${where}: invalid filter object`);
|
|
87
|
-
const type = value.type.toLowerCase();
|
|
88
|
-
if (type === "true" || type === "false")
|
|
89
|
-
return { kind: type };
|
|
90
|
-
if (type === "and" || type === "or") {
|
|
91
|
-
if (!Array.isArray(value.children))
|
|
92
|
-
throw new EntityTfError(`${where}: ${type} filter has no children`);
|
|
93
|
-
return { kind: type, children: value.children.map((child) => decodeFilter(child, owner, where)) };
|
|
94
|
-
}
|
|
95
|
-
if (value.field_id === undefined)
|
|
96
|
-
throw new EntityTfError(`${where}: ${type} filter has no field_id`);
|
|
97
|
-
const left = fieldRef(value.field_id, owner, where);
|
|
98
|
-
const not = value.not === true ? { not: true } : {};
|
|
99
|
-
if (type === "is_null")
|
|
100
|
-
return { kind: "isNull", left, ...not };
|
|
101
|
-
if (type === "in") {
|
|
102
|
-
if (!Array.isArray(value.values))
|
|
103
|
-
throw new EntityTfError(`${where}: in filter has no values`);
|
|
104
|
-
return { kind: "in", left, values: value.values.map((item) => filterValue(item, owner, where)), ...not };
|
|
105
|
-
}
|
|
106
|
-
if (type === "between") {
|
|
107
|
-
if (!Array.isArray(value.values) || value.values.length !== 2)
|
|
108
|
-
throw new EntityTfError(`${where}: between filter requires two values`);
|
|
109
|
-
return { kind: "between", left, values: [filterValue(value.values[0], owner, where), filterValue(value.values[1], owner, where)], ...not };
|
|
110
|
-
}
|
|
111
|
-
const kindByType = {
|
|
112
|
-
equals: "eq", greater_than: "gt", greater_than_equals: "gte", less_than: "lt", less_than_equals: "lte", like: "like",
|
|
113
|
-
};
|
|
114
|
-
const kind = kindByType[type];
|
|
115
|
-
if (kind === undefined || value.value === undefined)
|
|
116
|
-
throw new EntityTfError(`${where}: unsupported filter type "${type}"`);
|
|
117
|
-
const right = filterValue(value.value, owner, where);
|
|
118
|
-
return kind === "like"
|
|
119
|
-
? { kind, left, right, ...not, ...(typeof value.case_insensitive === "boolean" ? { caseInsensitive: value.case_insensitive } : {}), ...(typeof value.mode === "string" ? { mode: value.mode.toLowerCase() } : {}) }
|
|
120
|
-
: { kind, left, right, ...not };
|
|
54
|
+
/** Decode one `filter` attribute through the shared exhaustive codec. */
|
|
55
|
+
export function filterFromTf(value, owner, where) {
|
|
56
|
+
const decoded = deserializeFilterFromTf(value, {
|
|
57
|
+
field: (fieldValue) => fieldRef(fieldValue, owner, where),
|
|
58
|
+
reference: () => { throw new EntityTfError(`${where}: access-policy reference values are not supported`); },
|
|
59
|
+
literal: (literal) => picklistOptionLabel(literal) ?? literal,
|
|
60
|
+
});
|
|
61
|
+
return decoded;
|
|
121
62
|
}
|
|
122
|
-
/** Decode one `user_ids`/`group_ids` list item: a `data.elementum_user|group` lookup, or a raw platform id fallback. undefined = dropped, with a diagnostic already pushed. */
|
|
123
63
|
function principalListItem(item, dataType, where, ctx) {
|
|
124
64
|
const label = dataRefLabel(item, dataType);
|
|
125
65
|
if (label !== undefined) {
|
|
@@ -129,12 +69,18 @@ function principalListItem(item, dataType, where, ctx) {
|
|
|
129
69
|
ctx.diagnostics.push(`${where}: references data.${dataType}.${label}, but the stream has no matching data block; dropped`);
|
|
130
70
|
return undefined;
|
|
131
71
|
}
|
|
132
|
-
if (typeof item === "string")
|
|
133
|
-
|
|
72
|
+
if (typeof item === "string") {
|
|
73
|
+
if (dataType === "elementum_user")
|
|
74
|
+
return userId(item);
|
|
75
|
+
if (dataType === "elementum_group")
|
|
76
|
+
return groupId(item);
|
|
77
|
+
ctx.diagnostics.push(`${where}: raw service account id could not be resolved to a name; dropped`);
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
134
80
|
ctx.diagnostics.push(`${where}: list item has an unrecognized shape; dropped`);
|
|
135
81
|
return undefined;
|
|
136
82
|
}
|
|
137
|
-
function principalList(value, dataType, where, ctx) {
|
|
83
|
+
export function principalList(value, dataType, where, ctx) {
|
|
138
84
|
if (value === undefined)
|
|
139
85
|
return undefined;
|
|
140
86
|
if (!Array.isArray(value)) {
|
|
@@ -143,7 +89,11 @@ function principalList(value, dataType, where, ctx) {
|
|
|
143
89
|
}
|
|
144
90
|
const items = [];
|
|
145
91
|
for (const item of value) {
|
|
146
|
-
const decoded =
|
|
92
|
+
const decoded = dataType === "elementum_user"
|
|
93
|
+
? principalListItem(item, "elementum_user", where, ctx)
|
|
94
|
+
: dataType === "elementum_group"
|
|
95
|
+
? principalListItem(item, "elementum_group", where, ctx)
|
|
96
|
+
: principalListItem(item, "elementum_service_account", where, ctx);
|
|
147
97
|
if (decoded !== undefined)
|
|
148
98
|
items.push(decoded);
|
|
149
99
|
}
|
|
@@ -165,19 +115,10 @@ export function accessPolicyFromTf(block, owner, ctx) {
|
|
|
165
115
|
ctx.diagnostics.push(`${where}: object_id does not reference ${owner.type}.${owner.label}; skipped`);
|
|
166
116
|
return undefined;
|
|
167
117
|
}
|
|
168
|
-
const filter = attrs["filter"] !== undefined ?
|
|
118
|
+
const filter = attrs["filter"] !== undefined ? filterFromTf(attrs["filter"], owner, where) : { type: "TRUE" };
|
|
169
119
|
const userIds = principalList(attrs["user_ids"], "elementum_user", `${where}: user_ids`, ctx);
|
|
170
120
|
const groupIds = principalList(attrs["group_ids"], "elementum_group", `${where}: group_ids`, ctx);
|
|
171
|
-
|
|
172
|
-
const saAttr = attrs["service_account_ids"];
|
|
173
|
-
if (Array.isArray(saAttr)) {
|
|
174
|
-
serviceAccountIds = saAttr.filter((id) => typeof id === "string");
|
|
175
|
-
if (serviceAccountIds.length === 0)
|
|
176
|
-
serviceAccountIds = undefined;
|
|
177
|
-
}
|
|
178
|
-
else if (saAttr !== undefined) {
|
|
179
|
-
ctx.diagnostics.push(`${where}: service_account_ids is not a list; dropped`);
|
|
180
|
-
}
|
|
121
|
+
const serviceAccountIds = principalList(attrs["service_account_ids"], "elementum_service_account", `${where}: service_account_ids`, ctx);
|
|
181
122
|
return {
|
|
182
123
|
filter,
|
|
183
124
|
...(userIds !== undefined && { userIds }),
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { GroupRef } from "../../catalog/index.js";
|
|
2
|
+
import type { ServiceAccountRef } from "../service-account/ref.js";
|
|
3
|
+
import type { RoleUserRef } from "../role/build.js";
|
|
4
|
+
declare const userIdBrand: unique symbol;
|
|
5
|
+
declare const groupIdBrand: unique symbol;
|
|
6
|
+
/** A platform user id, kept distinct from every other string id. */
|
|
7
|
+
export type UserId = string & {
|
|
8
|
+
readonly [userIdBrand]: "UserId";
|
|
9
|
+
};
|
|
10
|
+
/** A platform group id, kept distinct from every other string id. */
|
|
11
|
+
export type GroupId = string & {
|
|
12
|
+
readonly [groupIdBrand]: "GroupId";
|
|
13
|
+
};
|
|
14
|
+
/** Mark an explicit platform user id. Prefer a portable user reference when one is available. */
|
|
15
|
+
export declare function userId(value: string): UserId;
|
|
16
|
+
/** Mark an explicit platform group id. Prefer an `org.groups.*` token when one is available. */
|
|
17
|
+
export declare function groupId(value: string): GroupId;
|
|
18
|
+
export type PrincipalDataType = "elementum_user" | "elementum_group" | "elementum_service_account";
|
|
19
|
+
/** A portable principal lookup preserved verbatim from pulled Terraform. */
|
|
20
|
+
export interface AccessPolicyPrincipalRef<DataType extends PrincipalDataType = PrincipalDataType> {
|
|
21
|
+
readonly __kind: "orgPrincipalRef";
|
|
22
|
+
readonly dataType: DataType;
|
|
23
|
+
/** The data block's own label, captured verbatim. */
|
|
24
|
+
readonly label: string;
|
|
25
|
+
/** The data block's lookup value: email for a user, name for a group or service account. */
|
|
26
|
+
readonly value: string;
|
|
27
|
+
}
|
|
28
|
+
export type AccessPolicyUserRef = UserId | RoleUserRef | AccessPolicyPrincipalRef<"elementum_user">;
|
|
29
|
+
export type AccessPolicyGroupRef = GroupId | GroupRef | AccessPolicyPrincipalRef<"elementum_group">;
|
|
30
|
+
/**
|
|
31
|
+
* Service accounts have no bare-id brand (unlike users/groups): they are
|
|
32
|
+
* always app-owned, so there is no context-free "raw id" worth authoring.
|
|
33
|
+
* Fresh authoring uses the same `serviceAccountRef({ app, name })` token
|
|
34
|
+
* agent/skill `runAs` already accepts; a pulled policy round-trips through
|
|
35
|
+
* the resolved data-source lookup instead (elementum-fde/edk#388).
|
|
36
|
+
*/
|
|
37
|
+
export type AccessPolicyServiceAccountRef = ServiceAccountRef | AccessPolicyPrincipalRef<"elementum_service_account">;
|
|
38
|
+
export type AccessPolicyPrincipal = AccessPolicyUserRef | AccessPolicyGroupRef | AccessPolicyServiceAccountRef;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EdkValidationError } from "../../../elementum-entity-client/errors.js";
|
|
2
|
+
/** Mark an explicit platform user id. Prefer a portable user reference when one is available. */
|
|
3
|
+
export function userId(value) {
|
|
4
|
+
if (value.trim() === "")
|
|
5
|
+
throw new EdkValidationError("userId requires a non-empty platform id.");
|
|
6
|
+
return value;
|
|
7
|
+
}
|
|
8
|
+
/** Mark an explicit platform group id. Prefer an `org.groups.*` token when one is available. */
|
|
9
|
+
export function groupId(value) {
|
|
10
|
+
if (value.trim() === "")
|
|
11
|
+
throw new EdkValidationError("groupId requires a non-empty platform id.");
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import type { OrgRefLookup } from "../../engine/build/context.js";
|
|
21
21
|
import { type ChildResourceScope, type TfBlock, type TfValue } from "../../engine/tf/index.js";
|
|
22
|
+
import type { Filter } from "../shared/filters/types.js";
|
|
23
|
+
import type { AppServiceAccount } from "../service-account/build.js";
|
|
24
|
+
import type { AccessPolicyGroupRef, AccessPolicyServiceAccountRef, AccessPolicyUserRef } from "./principal.js";
|
|
22
25
|
export interface AccessPolicyToTfContext {
|
|
23
26
|
readonly ownerTfLabel: string;
|
|
24
27
|
readonly scope: ChildResourceScope;
|
|
@@ -26,18 +29,42 @@ export interface AccessPolicyToTfContext {
|
|
|
26
29
|
readonly objectId: TfValue;
|
|
27
30
|
readonly orgRefs: OrgRefLookup;
|
|
28
31
|
readonly diagnostics: string[];
|
|
32
|
+
/**
|
|
33
|
+
* Owner's EDK refName + the same app's authored `serviceAccounts` bag —
|
|
34
|
+
* only apps own service accounts, so element/task owners omit these and a
|
|
35
|
+
* `serviceAccountRef` token in their policies is dropped with a
|
|
36
|
+
* diagnostic (there is nothing local it could match).
|
|
37
|
+
*/
|
|
38
|
+
readonly appRefName?: string;
|
|
39
|
+
readonly serviceAccounts?: Readonly<Record<string, AppServiceAccount>>;
|
|
40
|
+
}
|
|
41
|
+
/** Filter conversion only needs owner/field context; org lookups are accepted so full policy contexts remain assignable. */
|
|
42
|
+
export interface FilterToTfContext extends Omit<AccessPolicyToTfContext, "orgRefs"> {
|
|
43
|
+
readonly orgRefs?: OrgRefLookup;
|
|
29
44
|
}
|
|
30
45
|
export interface AccessPolicyToTfResult {
|
|
31
46
|
readonly block: TfBlock;
|
|
32
47
|
readonly address: string;
|
|
33
48
|
}
|
|
34
|
-
/**
|
|
35
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Encode one canonical filter through the shared exhaustive Terraform codec.
|
|
51
|
+
* Access-policy filters omit the trigger/task `leftValue` branch.
|
|
52
|
+
*/
|
|
53
|
+
export declare function filterToTf(f: Filter, where: string, ctx: FilterToTfContext): TfValue;
|
|
36
54
|
export interface AccessPolicyEntryWire {
|
|
37
|
-
readonly filter?:
|
|
38
|
-
readonly userIds?: readonly
|
|
39
|
-
readonly groupIds?: readonly
|
|
40
|
-
readonly serviceAccountIds?: readonly
|
|
55
|
+
readonly filter?: Filter;
|
|
56
|
+
readonly userIds?: readonly AccessPolicyUserRef[];
|
|
57
|
+
readonly groupIds?: readonly AccessPolicyGroupRef[];
|
|
58
|
+
readonly serviceAccountIds?: readonly AccessPolicyServiceAccountRef[];
|
|
41
59
|
}
|
|
60
|
+
export declare function principalListToTf(items: readonly AccessPolicyUserRef[] | undefined, dataType: "elementum_user", where: string, ctx: Omit<AccessPolicyToTfContext, "orgRefs"> & {
|
|
61
|
+
readonly orgRefs?: OrgRefLookup;
|
|
62
|
+
}): TfValue[] | undefined;
|
|
63
|
+
export declare function principalListToTf(items: readonly AccessPolicyGroupRef[] | undefined, dataType: "elementum_group", where: string, ctx: Omit<AccessPolicyToTfContext, "orgRefs"> & {
|
|
64
|
+
readonly orgRefs?: OrgRefLookup;
|
|
65
|
+
}): TfValue[] | undefined;
|
|
66
|
+
export declare function principalListToTf(items: readonly AccessPolicyServiceAccountRef[] | undefined, dataType: "elementum_service_account", where: string, ctx: Omit<AccessPolicyToTfContext, "orgRefs"> & {
|
|
67
|
+
readonly orgRefs?: OrgRefLookup;
|
|
68
|
+
}): TfValue[] | undefined;
|
|
42
69
|
/** One authored access-policy entry → its resource block, positioned by `index` (0-based) for label numbering. */
|
|
43
70
|
export declare function accessPolicyToTf(entry: AccessPolicyEntryWire, index: number, ctx: AccessPolicyToTfContext): AccessPolicyToTfResult;
|