@elementumai/edk 0.8.2-alpha.6 → 0.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -37
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.d.ts +3 -3
- package/dist-sdk/elementum-entity-client/clients/aspects/models/index.d.ts +1 -1
- package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.d.ts +3 -11
- package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +3 -11
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +1 -1
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +1 -1
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +1 -1
- package/dist-sdk/fs/entity.d.ts +2 -2
- package/dist-sdk/fs/entity.js +1 -1
- package/dist-sdk/pull/missing-report.d.ts +81 -0
- package/dist-sdk/pull/missing-report.js +52 -0
- package/dist-sdk/pull/util.d.ts +1 -1
- package/dist-sdk/pull/util.js +3 -3
- package/dist-sdk/src/catalog/factories.d.ts +96 -23
- package/dist-sdk/src/catalog/factories.js +141 -21
- package/dist-sdk/src/catalog/from-authoring.d.ts +5 -5
- package/dist-sdk/src/catalog/from-authoring.js +20 -10
- package/dist-sdk/src/catalog/index.d.ts +2 -2
- package/dist-sdk/src/catalog/index.js +1 -1
- package/dist-sdk/src/catalog/org.js +63 -4
- package/dist-sdk/src/catalog/render-helpers.d.ts +1 -1
- package/dist-sdk/src/catalog/render-helpers.js +1 -1
- package/dist-sdk/src/catalog/render.d.ts +1 -0
- package/dist-sdk/src/catalog/render.js +8 -2
- package/dist-sdk/src/catalog/token.js +18 -4
- package/dist-sdk/src/catalog/types.d.ts +64 -24
- package/dist-sdk/src/catalog/types.js +12 -4
- package/dist-sdk/src/core/app-to-ui.d.ts +6 -6
- package/dist-sdk/src/core/app-to-ui.js +7 -9
- package/dist-sdk/src/core/index.d.ts +11 -10
- package/dist-sdk/src/core/index.js +10 -9
- package/dist-sdk/src/core/platform-id.d.ts +11 -0
- package/dist-sdk/src/core/platform-id.js +8 -0
- package/dist-sdk/src/{entities/flow/activities/render-catalog.d.ts → core/render-tree.d.ts} +3 -3
- package/dist-sdk/src/{entities/flow/activities/render-catalog.js → core/render-tree.js} +7 -10
- package/dist-sdk/src/core/types/ai-provider.d.ts +1 -1
- package/dist-sdk/src/core/types/ai-provider.js +1 -1
- package/dist-sdk/src/core/types/app.d.ts +78 -52
- package/dist-sdk/src/core/types/app.js +2 -3
- package/dist-sdk/src/core/types/aspect-category.d.ts +4 -4
- package/dist-sdk/src/core/types/aspect-category.js +4 -4
- package/dist-sdk/src/core/types/cloud-link.d.ts +3 -3
- package/dist-sdk/src/core/types/cloud-link.js +3 -3
- package/dist-sdk/src/core/types/display-block.d.ts +2 -2
- package/dist-sdk/src/core/types/display-block.js +2 -2
- package/dist-sdk/src/core/types/group.d.ts +1 -1
- package/dist-sdk/src/core/types/group.js +1 -1
- package/dist-sdk/src/core/types/user.d.ts +1 -1
- package/dist-sdk/src/core/types/user.js +1 -1
- package/dist-sdk/src/core/wire/ref-serializer.js +3 -3
- package/dist-sdk/src/engine/build/context.d.ts +23 -16
- package/dist-sdk/src/engine/entity.d.ts +1 -1
- package/dist-sdk/src/engine/pull/attrs.d.ts +4 -0
- package/dist-sdk/src/engine/pull/attrs.js +17 -0
- package/dist-sdk/src/engine/pull/context.d.ts +73 -0
- package/dist-sdk/src/engine/pull/context.js +14 -0
- package/dist-sdk/src/engine/pull/org.d.ts +10 -0
- package/dist-sdk/src/engine/pull/org.js +35 -0
- package/dist-sdk/src/engine/pull/ref-only.d.ts +37 -0
- package/dist-sdk/src/engine/pull/ref-only.js +204 -0
- package/dist-sdk/src/engine/tf/expr.d.ts +7 -3
- package/dist-sdk/src/engine/tf/expr.js +27 -15
- package/dist-sdk/src/engine/tf/index.d.ts +1 -1
- package/dist-sdk/src/engine/tf/index.js +1 -1
- package/dist-sdk/src/engine/tf/model.d.ts +8 -1
- package/dist-sdk/src/engine/tf/model.js +4 -0
- package/dist-sdk/src/engine/tf/parse.js +13 -2
- package/dist-sdk/src/engine/tf/render.js +4 -0
- package/dist-sdk/src/engine/workspace/authoring-layout.js +4 -2
- package/dist-sdk/src/entities/access-policy/build.d.ts +6 -16
- package/dist-sdk/src/entities/access-policy/build.js +2 -2
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +14 -40
- package/dist-sdk/src/entities/access-policy/from-tf.js +26 -85
- package/dist-sdk/src/entities/access-policy/principal.d.ts +39 -0
- package/dist-sdk/src/entities/access-policy/principal.js +13 -0
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +33 -6
- package/dist-sdk/src/entities/access-policy/to-tf.js +62 -60
- package/dist-sdk/src/entities/agent/build.d.ts +42 -11
- package/dist-sdk/src/entities/agent/build.js +40 -19
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +11 -1
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +180 -45
- package/dist-sdk/src/entities/agent/from-tf.d.ts +3 -1
- package/dist-sdk/src/entities/agent/from-tf.js +17 -12
- package/dist-sdk/src/entities/agent/index.d.ts +5 -2
- package/dist-sdk/src/entities/agent/index.js +4 -2
- package/dist-sdk/src/entities/agent/module.js +7 -2
- package/dist-sdk/src/entities/agent/run-as.d.ts +16 -0
- package/dist-sdk/src/entities/agent/run-as.js +1 -0
- package/dist-sdk/src/entities/agent/to-tf.d.ts +6 -2
- package/dist-sdk/src/entities/agent/to-tf.js +58 -9
- package/dist-sdk/src/entities/agent/tools.d.ts +97 -70
- package/dist-sdk/src/entities/agent/tools.js +63 -43
- package/dist-sdk/src/entities/agent-a2a-skill/from-tf.js +1 -1
- package/dist-sdk/src/entities/agent-a2a-skill/to-tf.js +4 -4
- package/dist-sdk/src/entities/agent-evaluation/build.d.ts +19 -0
- package/dist-sdk/src/entities/agent-evaluation/build.js +41 -0
- package/dist-sdk/src/entities/agent-evaluation/deserializer/print-agent-evaluation.d.ts +4 -0
- package/dist-sdk/src/entities/agent-evaluation/deserializer/print-agent-evaluation.js +30 -0
- package/dist-sdk/src/entities/agent-evaluation/from-tf.d.ts +12 -0
- package/dist-sdk/src/entities/agent-evaluation/from-tf.js +46 -0
- package/dist-sdk/src/entities/agent-evaluation/index.d.ts +1 -0
- package/dist-sdk/src/entities/agent-evaluation/index.js +1 -0
- package/dist-sdk/src/entities/agent-evaluation/module.d.ts +3 -0
- package/dist-sdk/src/entities/agent-evaluation/module.js +58 -0
- package/dist-sdk/src/entities/agent-evaluation/to-tf.d.ts +12 -0
- package/dist-sdk/src/entities/agent-evaluation/to-tf.js +35 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +25 -15
- package/dist-sdk/src/entities/agent-tool/from-tf.js +175 -43
- package/dist-sdk/src/entities/agent-tool/module.js +6 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +15 -7
- package/dist-sdk/src/entities/agent-tool/to-tf.js +169 -48
- package/dist-sdk/src/entities/agent-tool/types.d.ts +4 -6
- package/dist-sdk/src/entities/agent-tool/types.js +30 -29
- package/dist-sdk/src/entities/app/build.d.ts +214 -47
- package/dist-sdk/src/entities/app/build.js +128 -66
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +188 -8
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.d.ts +59 -0
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.js +70 -0
- package/dist-sdk/src/entities/app/display-blocks.d.ts +2 -1
- package/dist-sdk/src/entities/app/display-blocks.js +1 -1
- package/dist-sdk/src/entities/app/from-tf.d.ts +11 -1
- package/dist-sdk/src/entities/app/from-tf.js +30 -2
- package/dist-sdk/src/entities/app/index.d.ts +20 -8
- package/dist-sdk/src/entities/app/index.js +16 -6
- package/dist-sdk/src/entities/app/module.js +29 -4
- package/dist-sdk/src/entities/app/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/app/to-tf.js +97 -7
- package/dist-sdk/src/entities/approval-chain/build.d.ts +31 -16
- package/dist-sdk/src/entities/approval-chain/build.js +49 -49
- package/dist-sdk/src/entities/approval-chain/from-tf.d.ts +17 -0
- package/dist-sdk/src/entities/approval-chain/from-tf.js +57 -0
- package/dist-sdk/src/entities/approval-chain/index.d.ts +2 -3
- package/dist-sdk/src/entities/approval-chain/index.js +2 -3
- package/dist-sdk/src/entities/approval-chain/module.d.ts +3 -0
- package/dist-sdk/src/entities/approval-chain/module.js +51 -0
- package/dist-sdk/src/entities/approval-chain/printer.d.ts +2 -0
- package/dist-sdk/src/entities/approval-chain/printer.js +21 -0
- package/dist-sdk/src/entities/approval-chain/to-tf.d.ts +9 -0
- package/dist-sdk/src/entities/approval-chain/to-tf.js +43 -0
- package/dist-sdk/src/entities/automation/build.d.ts +177 -95
- package/dist-sdk/src/entities/automation/build.js +164 -72
- package/dist-sdk/src/entities/automation/calculation-expression.d.ts +191 -0
- package/dist-sdk/src/entities/automation/calculation-expression.js +57 -0
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +18 -9
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +18 -14
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +214 -311
- package/dist-sdk/src/entities/automation/filter.d.ts +1 -115
- package/dist-sdk/src/entities/automation/filter.js +1 -197
- package/dist-sdk/src/entities/automation/from-tf.d.ts +28 -0
- package/dist-sdk/src/entities/automation/from-tf.js +695 -182
- package/dist-sdk/src/entities/automation/index.d.ts +9 -10
- package/dist-sdk/src/entities/automation/index.js +11 -11
- package/dist-sdk/src/entities/automation/module.js +82 -8
- package/dist-sdk/src/entities/automation/operators.d.ts +32 -48
- package/dist-sdk/src/entities/automation/operators.js +10 -37
- package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +1 -1
- package/dist-sdk/src/entities/automation/output-key-wire-name.js +1 -1
- package/dist-sdk/src/entities/automation/script-code.js +107 -28
- package/dist-sdk/src/entities/automation/serialize.js +1 -1
- package/dist-sdk/src/entities/automation/tasks.d.ts +167 -102
- package/dist-sdk/src/entities/automation/tasks.js +66 -13
- package/dist-sdk/src/entities/automation/to-tf.d.ts +44 -3
- package/dist-sdk/src/entities/automation/to-tf.js +607 -161
- package/dist-sdk/src/entities/automation/triggers.d.ts +33 -25
- package/dist-sdk/src/entities/automation/triggers.js +8 -2
- package/dist-sdk/src/entities/automation/types.d.ts +3 -2
- package/dist-sdk/src/entities/automation/types.js +3 -2
- package/dist-sdk/src/entities/chart/build.d.ts +95 -0
- package/dist-sdk/src/entities/chart/build.js +42 -0
- package/dist-sdk/src/entities/chart/from-tf.d.ts +55 -0
- package/dist-sdk/src/entities/chart/from-tf.js +269 -0
- package/dist-sdk/src/entities/chart/index.d.ts +4 -0
- package/dist-sdk/src/entities/chart/index.js +3 -0
- package/dist-sdk/src/entities/chart/module.d.ts +3 -0
- package/dist-sdk/src/entities/chart/module.js +61 -0
- package/dist-sdk/src/entities/chart/printer.d.ts +5 -0
- package/dist-sdk/src/entities/chart/printer.js +104 -0
- package/dist-sdk/src/entities/chart/to-tf.d.ts +15 -0
- package/dist-sdk/src/entities/chart/to-tf.js +150 -0
- package/dist-sdk/src/entities/chart/types.d.ts +53 -0
- package/dist-sdk/src/entities/chart/types.js +22 -0
- package/dist-sdk/src/entities/dashboard/build.d.ts +44 -0
- package/dist-sdk/src/entities/dashboard/build.js +16 -0
- package/dist-sdk/src/entities/dashboard/from-tf.d.ts +12 -0
- package/dist-sdk/src/entities/dashboard/from-tf.js +113 -0
- package/dist-sdk/src/entities/dashboard/module.d.ts +3 -0
- package/dist-sdk/src/entities/dashboard/module.js +16 -0
- package/dist-sdk/src/entities/dashboard/to-tf.d.ts +43 -0
- package/dist-sdk/src/entities/dashboard/to-tf.js +121 -0
- package/dist-sdk/src/entities/dashboard-widget/module.d.ts +3 -0
- package/dist-sdk/src/entities/dashboard-widget/module.js +10 -0
- package/dist-sdk/src/entities/data-lookup/module.d.ts +3 -0
- package/dist-sdk/src/entities/data-lookup/module.js +22 -0
- package/dist-sdk/src/entities/datamine/build.d.ts +22 -0
- package/dist-sdk/src/entities/datamine/from-tf.d.ts +17 -0
- package/dist-sdk/src/entities/datamine/from-tf.js +98 -0
- package/dist-sdk/src/entities/datamine/module.d.ts +3 -0
- package/dist-sdk/src/entities/datamine/module.js +23 -0
- package/dist-sdk/src/entities/datamine/to-tf.d.ts +11 -0
- package/dist-sdk/src/entities/datamine/to-tf.js +53 -0
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +304 -0
- package/dist-sdk/src/entities/dynamic-layout/build.js +4 -0
- package/dist-sdk/src/entities/dynamic-layout/dialect.d.ts +4 -0
- package/dist-sdk/src/entities/dynamic-layout/dialect.js +47 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.d.ts +10 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.js +239 -0
- package/dist-sdk/src/entities/dynamic-layout/module.d.ts +3 -0
- package/dist-sdk/src/entities/dynamic-layout/module.js +13 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +26 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +267 -0
- package/dist-sdk/src/entities/element/build.d.ts +48 -38
- package/dist-sdk/src/entities/element/build.js +24 -33
- package/dist-sdk/src/entities/element/from-tf.d.ts +9 -1
- package/dist-sdk/src/entities/element/from-tf.js +31 -2
- package/dist-sdk/src/entities/element/index.d.ts +14 -7
- package/dist-sdk/src/entities/element/index.js +11 -5
- package/dist-sdk/src/entities/element/module.js +26 -5
- package/dist-sdk/src/entities/element/to-tf.d.ts +2 -1
- package/dist-sdk/src/entities/element/to-tf.js +64 -4
- package/dist-sdk/src/entities/field/build.d.ts +55 -27
- package/dist-sdk/src/entities/field/build.js +31 -6
- package/dist-sdk/src/entities/field/calc/aggregate.d.ts +52 -21
- package/dist-sdk/src/entities/field/calc/aggregate.js +59 -29
- package/dist-sdk/src/entities/field/calc/date.d.ts +78 -29
- package/dist-sdk/src/entities/field/calc/date.js +120 -29
- package/dist-sdk/src/entities/field/calc/index.d.ts +80 -85
- package/dist-sdk/src/entities/field/calc/index.js +82 -139
- package/dist-sdk/src/entities/field/calc/numeric.d.ts +8 -12
- package/dist-sdk/src/entities/field/calc/numeric.js +10 -27
- package/dist-sdk/src/entities/field/calc/runtime.d.ts +19 -2
- package/dist-sdk/src/entities/field/calc/runtime.js +79 -8
- package/dist-sdk/src/entities/field/calc/text.d.ts +32 -23
- package/dist-sdk/src/entities/field/calc/text.js +43 -31
- package/dist-sdk/src/entities/field/calc/types.d.ts +36 -81
- package/dist-sdk/src/entities/field/calc/types.js +1 -22
- package/dist-sdk/src/entities/field/calc.d.ts +71 -48
- package/dist-sdk/src/entities/field/calc.js +5 -15
- package/dist-sdk/src/entities/field/calculation-types.d.ts +6 -0
- package/dist-sdk/src/entities/field/calculation-types.js +49 -0
- package/dist-sdk/src/entities/field/from-tf.js +238 -13
- package/dist-sdk/src/entities/field/locals.d.ts +11 -3
- package/dist-sdk/src/entities/field/locals.js +15 -2
- package/dist-sdk/src/entities/field/module.d.ts +1 -0
- package/dist-sdk/src/entities/field/module.js +27 -7
- package/dist-sdk/src/entities/field/record-shape.d.ts +25 -11
- package/dist-sdk/src/entities/field/to-tf.d.ts +41 -2
- package/dist-sdk/src/entities/field/to-tf.js +314 -40
- package/dist-sdk/src/entities/field/types.d.ts +1 -1
- package/dist-sdk/src/entities/field/types.js +10 -1
- package/dist-sdk/src/entities/file-reader/build.d.ts +71 -19
- package/dist-sdk/src/entities/file-reader/build.js +49 -4
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.d.ts +1 -0
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +12 -10
- package/dist-sdk/src/entities/file-reader/from-tf.d.ts +1 -1
- package/dist-sdk/src/entities/file-reader/from-tf.js +31 -2
- package/dist-sdk/src/entities/file-reader/index.d.ts +3 -3
- package/dist-sdk/src/entities/file-reader/index.js +3 -3
- package/dist-sdk/src/entities/file-reader/module.js +6 -5
- package/dist-sdk/src/entities/file-reader/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/file-reader/to-tf.js +5 -2
- package/dist-sdk/src/entities/file-reader/types.d.ts +3 -4
- package/dist-sdk/src/entities/file-reader/types.js +4 -5
- package/dist-sdk/src/entities/org/category.js +4 -5
- package/dist-sdk/src/entities/org/cloud-link.js +4 -5
- package/dist-sdk/src/entities/org/email-alias.d.ts +2 -0
- package/dist-sdk/src/entities/org/email-alias.js +12 -0
- package/dist-sdk/src/entities/org/group.js +4 -5
- package/dist-sdk/src/entities/org/index.d.ts +2 -0
- package/dist-sdk/src/entities/org/index.js +2 -0
- package/dist-sdk/src/entities/org/phone-provider.d.ts +4 -0
- package/dist-sdk/src/entities/org/phone-provider.js +30 -0
- package/dist-sdk/src/entities/org/role.d.ts +3 -3
- package/dist-sdk/src/entities/org/role.js +9 -6
- package/dist-sdk/src/entities/organization/build.d.ts +241 -0
- package/dist-sdk/src/entities/organization/build.js +165 -0
- package/dist-sdk/src/entities/organization/index.d.ts +2 -0
- package/dist-sdk/src/entities/organization/index.js +2 -0
- package/dist-sdk/src/entities/organization/module.d.ts +2 -0
- package/dist-sdk/src/entities/organization/module.js +21 -0
- package/dist-sdk/src/entities/organization/to-tf.d.ts +7 -0
- package/dist-sdk/src/entities/organization/to-tf.js +154 -0
- package/dist-sdk/src/entities/phone-service/build.d.ts +17 -0
- package/dist-sdk/src/entities/phone-service/build.js +31 -0
- package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.d.ts +4 -0
- package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.js +56 -0
- package/dist-sdk/src/entities/phone-service/from-tf.d.ts +25 -0
- package/dist-sdk/src/entities/phone-service/from-tf.js +75 -0
- package/dist-sdk/src/entities/phone-service/index.d.ts +2 -0
- package/dist-sdk/src/entities/phone-service/index.js +2 -0
- package/dist-sdk/src/entities/phone-service/module.d.ts +3 -0
- package/dist-sdk/src/entities/phone-service/module.js +55 -0
- package/dist-sdk/src/entities/phone-service/to-tf.d.ts +12 -0
- package/dist-sdk/src/entities/phone-service/to-tf.js +54 -0
- package/dist-sdk/src/entities/phone-service/types.d.ts +35 -0
- package/dist-sdk/src/entities/phone-service/types.js +22 -0
- package/dist-sdk/src/entities/record-create-form/from-tf.d.ts +11 -0
- package/dist-sdk/src/entities/record-create-form/from-tf.js +74 -0
- package/dist-sdk/src/entities/record-create-form/module.d.ts +11 -0
- package/dist-sdk/src/entities/record-create-form/module.js +24 -0
- package/dist-sdk/src/entities/record-create-form/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/record-create-form/to-tf.js +88 -0
- package/dist-sdk/src/entities/relationship/build.d.ts +16 -0
- package/dist-sdk/src/entities/relationship/build.js +1 -0
- package/dist-sdk/src/entities/relationship/from-tf.d.ts +12 -0
- package/dist-sdk/src/entities/relationship/from-tf.js +109 -0
- package/dist-sdk/src/entities/relationship/module.d.ts +3 -0
- package/dist-sdk/src/entities/relationship/module.js +16 -0
- package/dist-sdk/src/entities/relationship/to-tf.d.ts +32 -0
- package/dist-sdk/src/entities/relationship/to-tf.js +145 -0
- package/dist-sdk/src/entities/role/build.d.ts +65 -0
- package/dist-sdk/src/entities/role/build.js +33 -0
- package/dist-sdk/src/entities/role/from-tf.d.ts +13 -0
- package/dist-sdk/src/entities/role/from-tf.js +138 -0
- package/dist-sdk/src/entities/role/to-tf.d.ts +13 -0
- package/dist-sdk/src/entities/role/to-tf.js +69 -0
- package/dist-sdk/src/entities/search-table/build.d.ts +67 -28
- package/dist-sdk/src/entities/search-table/build.js +110 -56
- package/dist-sdk/src/entities/search-table/from-tf.d.ts +37 -0
- package/dist-sdk/src/entities/search-table/from-tf.js +113 -0
- package/dist-sdk/src/entities/search-table/index.d.ts +2 -2
- package/dist-sdk/src/entities/search-table/index.js +2 -2
- package/dist-sdk/src/entities/search-table/module.js +88 -10
- package/dist-sdk/src/entities/search-table/printer.d.ts +2 -0
- package/dist-sdk/src/entities/search-table/printer.js +52 -0
- package/dist-sdk/src/entities/search-table/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/search-table/to-tf.js +104 -0
- package/dist-sdk/src/entities/search-table/types.d.ts +8 -0
- package/dist-sdk/src/entities/search-table/types.js +21 -0
- package/dist-sdk/src/entities/service-account/build.d.ts +32 -0
- package/dist-sdk/src/entities/service-account/build.js +9 -0
- package/dist-sdk/src/entities/service-account/from-tf.d.ts +10 -0
- package/dist-sdk/src/entities/service-account/from-tf.js +109 -0
- package/dist-sdk/src/entities/service-account/module.d.ts +4 -0
- package/dist-sdk/src/entities/service-account/module.js +21 -0
- package/dist-sdk/src/entities/service-account/ref.d.ts +11 -0
- package/dist-sdk/src/entities/service-account/ref.js +5 -0
- package/dist-sdk/src/entities/service-account/to-tf.d.ts +32 -0
- package/dist-sdk/src/entities/service-account/to-tf.js +103 -0
- package/dist-sdk/src/entities/shared/connector-from-tf.d.ts +14 -0
- package/dist-sdk/src/entities/shared/connector-from-tf.js +14 -0
- package/dist-sdk/src/entities/shared/context.d.ts +25 -24
- package/dist-sdk/src/entities/shared/context.js +36 -35
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +30 -81
- package/dist-sdk/src/entities/shared/filters/ast.js +6 -2
- package/dist-sdk/src/entities/shared/filters/index.d.ts +95 -206
- package/dist-sdk/src/entities/shared/filters/index.js +196 -341
- package/dist-sdk/src/entities/shared/filters/print.d.ts +11 -0
- package/dist-sdk/src/entities/shared/filters/print.js +122 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +170 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +527 -0
- package/dist-sdk/src/entities/shared/filters/types.d.ts +66 -69
- package/dist-sdk/src/entities/shared/filters/types.js +2 -3
- package/dist-sdk/src/entities/shared/foreign-ref.d.ts +14 -0
- package/dist-sdk/src/entities/shared/foreign-ref.js +12 -0
- package/dist-sdk/src/entities/shared/ref.d.ts +26 -11
- package/dist-sdk/src/entities/shared/ref.js +8 -3
- package/dist-sdk/src/entities/shared/types/common.d.ts +2 -2
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +1 -1
- package/dist-sdk/src/entities/shared/types/field-types.js +1 -1
- package/dist-sdk/src/entities/skill/build.d.ts +4 -4
- package/dist-sdk/src/entities/skill/build.js +6 -5
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +11 -1
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +100 -39
- package/dist-sdk/src/entities/skill/index.d.ts +3 -2
- package/dist-sdk/src/entities/skill/index.js +3 -2
- package/dist-sdk/src/entities/skill/module.js +8 -2
- package/dist-sdk/src/entities/skill/to-tf.d.ts +6 -2
- package/dist-sdk/src/entities/skill/to-tf.js +20 -2
- package/dist-sdk/src/entities/skill/tools.d.ts +47 -31
- package/dist-sdk/src/entities/skill/tools.js +37 -23
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +17 -1
- package/dist-sdk/src/entities/skill-tool/from-tf.js +118 -8
- package/dist-sdk/src/entities/skill-tool/module.js +9 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +6 -1
- package/dist-sdk/src/entities/skill-tool/to-tf.js +100 -48
- package/dist-sdk/src/entities/skill-tool/types.js +18 -1
- package/dist-sdk/src/entities/table/build.d.ts +64 -23
- package/dist-sdk/src/entities/table/build.js +41 -26
- package/dist-sdk/src/entities/table/catalog-render.js +15 -1
- package/dist-sdk/src/entities/table/deserializer/normalize.d.ts +99 -0
- package/dist-sdk/src/entities/table/deserializer/normalize.js +192 -0
- package/dist-sdk/src/entities/table/fields/types.d.ts +86 -0
- package/dist-sdk/src/entities/table/fields/types.js +12 -0
- package/dist-sdk/src/entities/table/fields.d.ts +107 -47
- package/dist-sdk/src/entities/table/fields.js +76 -55
- package/dist-sdk/src/entities/table/from-tf.d.ts +4 -0
- package/dist-sdk/src/entities/table/from-tf.js +261 -0
- package/dist-sdk/src/entities/table/index.d.ts +7 -5
- package/dist-sdk/src/entities/table/index.js +7 -7
- package/dist-sdk/src/entities/table/joins.d.ts +22 -9
- package/dist-sdk/src/entities/table/joins.js +8 -16
- package/dist-sdk/src/entities/table/module.d.ts +2 -1
- package/dist-sdk/src/entities/table/module.js +13 -6
- package/dist-sdk/src/entities/table/to-tf.d.ts +10 -0
- package/dist-sdk/src/entities/table/to-tf.js +222 -0
- package/dist-sdk/src/entities/task/build.d.ts +43 -0
- package/dist-sdk/src/entities/task/build.js +17 -0
- package/dist-sdk/src/entities/task/from-tf.d.ts +28 -0
- package/dist-sdk/src/entities/task/from-tf.js +38 -0
- package/dist-sdk/src/entities/task/index.d.ts +1 -0
- package/dist-sdk/src/entities/task/index.js +1 -0
- package/dist-sdk/src/entities/task/module.d.ts +3 -0
- package/dist-sdk/src/entities/task/module.js +12 -0
- package/dist-sdk/src/entities/task/to-tf.d.ts +9 -0
- package/dist-sdk/src/entities/task/to-tf.js +49 -0
- package/dist-sdk/src/entities/view/build.d.ts +46 -0
- package/dist-sdk/src/entities/view/build.js +19 -0
- package/dist-sdk/src/entities/view/from-tf.d.ts +7 -2
- package/dist-sdk/src/entities/view/from-tf.js +264 -30
- package/dist-sdk/src/entities/view/module.d.ts +6 -13
- package/dist-sdk/src/entities/view/module.js +12 -15
- package/dist-sdk/src/entities/view/sharing.d.ts +10 -0
- package/dist-sdk/src/entities/view/sharing.js +6 -0
- package/dist-sdk/src/entities/view/to-tf.d.ts +56 -12
- package/dist-sdk/src/entities/view/to-tf.js +192 -20
- package/dist-sdk/src/entities/view/types.d.ts +8 -0
- package/dist-sdk/src/entities/view/types.js +46 -0
- package/dist-sdk/src/entities/visual-flow/build.d.ts +87 -0
- package/dist-sdk/src/entities/visual-flow/build.js +72 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.d.ts +49 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.js +124 -0
- package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -0
- package/dist-sdk/src/entities/visual-flow/index.js +1 -0
- package/dist-sdk/src/entities/visual-flow/module.d.ts +3 -0
- package/dist-sdk/src/entities/visual-flow/module.js +41 -0
- package/dist-sdk/src/entities/visual-flow/printer.d.ts +8 -0
- package/dist-sdk/src/entities/visual-flow/printer.js +92 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.d.ts +15 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.js +97 -0
- package/dist-sdk/src/entities/widget/build.d.ts +55 -0
- package/dist-sdk/src/entities/widget/build.js +1 -0
- package/dist-sdk/src/entities/widget/from-tf.d.ts +11 -0
- package/dist-sdk/src/entities/widget/from-tf.js +209 -0
- package/dist-sdk/src/entities/widget/module.d.ts +3 -0
- package/dist-sdk/src/entities/widget/module.js +16 -0
- package/dist-sdk/src/entities/widget/to-tf.d.ts +45 -0
- package/dist-sdk/src/entities/widget/to-tf.js +206 -0
- package/dist-sdk/src/graph/deferred-catalog-render.d.ts +1 -1
- package/dist-sdk/src/graph/deferred-catalog-render.js +1 -1
- package/dist-sdk/src/graph/index.d.ts +12 -1
- package/dist-sdk/src/graph/index.js +8 -19
- package/dist-sdk/src/graph/modules.js +35 -1
- package/dist-sdk/src/graph/types.d.ts +106 -7
- package/dist-sdk/src/internal/safe-identifier.d.ts +4 -0
- package/dist-sdk/src/internal/safe-identifier.js +13 -0
- package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
- package/dist-sdk/src/internal/sdk-package.js +5 -2
- package/package.json +39 -15
- package/dist-sdk/src/entities/access-policy/filter.d.ts +0 -61
- package/dist-sdk/src/entities/access-policy/filter.js +0 -83
- package/dist-sdk/src/entities/approval-chain/steps.d.ts +0 -24
- package/dist-sdk/src/entities/approval-chain/steps.js +0 -20
- package/dist-sdk/src/entities/flow/activities/agent.d.ts +0 -15
- package/dist-sdk/src/entities/flow/activities/agent.js +0 -29
- package/dist-sdk/src/entities/flow/activities/approval.d.ts +0 -9
- package/dist-sdk/src/entities/flow/activities/approval.js +0 -18
- package/dist-sdk/src/entities/flow/activities/automation.d.ts +0 -12
- package/dist-sdk/src/entities/flow/activities/automation.js +0 -22
- package/dist-sdk/src/entities/flow/activities/ctx.d.ts +0 -34
- package/dist-sdk/src/entities/flow/activities/ctx.js +0 -38
- package/dist-sdk/src/entities/flow/activities/form.d.ts +0 -22
- package/dist-sdk/src/entities/flow/activities/form.js +0 -36
- package/dist-sdk/src/entities/flow/activities/index.d.ts +0 -14
- package/dist-sdk/src/entities/flow/activities/index.js +0 -13
- package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +0 -39
- package/dist-sdk/src/entities/flow/activities/input-refs.js +0 -19
- package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +0 -13
- package/dist-sdk/src/entities/flow/activities/prompt-template.js +0 -34
- package/dist-sdk/src/entities/flow/activities/types.d.ts +0 -33
- package/dist-sdk/src/entities/flow/build.d.ts +0 -38
- package/dist-sdk/src/entities/flow/build.js +0 -115
- package/dist-sdk/src/entities/flow/index.d.ts +0 -8
- package/dist-sdk/src/entities/flow/index.js +0 -7
- package/dist-sdk/src/entities/flow/serialize.d.ts +0 -51
- package/dist-sdk/src/entities/flow/serialize.js +0 -94
- package/dist-sdk/src/entities/flow/util.d.ts +0 -27
- package/dist-sdk/src/entities/flow/util.js +0 -38
- package/dist-sdk/src/entities/table/filter.d.ts +0 -41
- package/dist-sdk/src/entities/table/filter.js +0 -89
- /package/dist-sdk/src/entities/{flow/activities/types.js → datamine/build.js} +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { optionalString, plainObject, resourceRefLabel } from "../../engine/pull/context.js";
|
|
2
|
+
import { reportUnknownAttrs } from "../../engine/pull/attrs.js";
|
|
3
|
+
import { scopedLabelToBagKey } from "../../engine/tf/index.js";
|
|
4
|
+
import { fieldKeyFromTfRef } from "../field/from-tf.js";
|
|
5
|
+
import { RECORD_CREATE_FORM_RESOURCE_TYPE } from "./module.js";
|
|
6
|
+
const KNOWN_ATTRS = new Set(["app_id", "sections"]);
|
|
7
|
+
const KNOWN_SECTION_ATTRS = new Set([
|
|
8
|
+
"name", "field_ids", "agent_id", "icon", "color", "display_order", "display_location",
|
|
9
|
+
"side_nav_item", "hidden", "max_columns",
|
|
10
|
+
]);
|
|
11
|
+
/** Provider resource -> id-free normalized create-form authoring. */
|
|
12
|
+
export function recordCreateFormFromTf(block, owner, ctx) {
|
|
13
|
+
if (block === undefined)
|
|
14
|
+
return undefined;
|
|
15
|
+
const where = `${RECORD_CREATE_FORM_RESOURCE_TYPE}.${block.label ?? "?"}`;
|
|
16
|
+
reportUnknownAttrs(block.attrs, KNOWN_ATTRS, where, "recordCreateFormFromTf", ctx);
|
|
17
|
+
if (resourceRefLabel(block.attrs["app_id"], owner.type) !== owner.label) {
|
|
18
|
+
ctx.diagnostics.push(`${where}: app_id does not reference ${owner.type}.${owner.label}; skipped`);
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
const rawSections = block.attrs["sections"];
|
|
22
|
+
if (!Array.isArray(rawSections)) {
|
|
23
|
+
ctx.diagnostics.push(`${where}: sections is not a list; skipped`);
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
const sections = [];
|
|
27
|
+
for (const [index, raw] of rawSections.entries()) {
|
|
28
|
+
const section = sectionFromTf(raw, index, where, owner, ctx);
|
|
29
|
+
if (section !== undefined)
|
|
30
|
+
sections.push(section);
|
|
31
|
+
}
|
|
32
|
+
return { sections };
|
|
33
|
+
}
|
|
34
|
+
function sectionFromTf(raw, index, formWhere, owner, ctx) {
|
|
35
|
+
const rec = plainObject(raw);
|
|
36
|
+
const where = `${formWhere} section ${index}`;
|
|
37
|
+
if (rec === undefined) {
|
|
38
|
+
ctx.diagnostics.push(`${where}: unrecognized shape; dropped`);
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
reportUnknownAttrs(rec, KNOWN_SECTION_ATTRS, where, "recordCreateFormFromTf", ctx);
|
|
42
|
+
const fieldIds = rec["field_ids"];
|
|
43
|
+
if (!Array.isArray(fieldIds)) {
|
|
44
|
+
ctx.diagnostics.push(`${where}: field_ids is not a list; dropped`);
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
const fields = [];
|
|
48
|
+
for (const fieldId of fieldIds) {
|
|
49
|
+
const key = fieldKeyFromTfRef(fieldId, owner.ownerTfLabel, owner.scope);
|
|
50
|
+
if (key === undefined)
|
|
51
|
+
ctx.diagnostics.push(`${where}: a field_ids entry is not a known field reference; dropped`);
|
|
52
|
+
else
|
|
53
|
+
fields.push(key);
|
|
54
|
+
}
|
|
55
|
+
const agentLabel = resourceRefLabel(rec["agent_id"], "elementum_agent");
|
|
56
|
+
if (rec["agent_id"] !== undefined && agentLabel === undefined) {
|
|
57
|
+
ctx.diagnostics.push(`${where}: agent_id is not an elementum_agent resource reference; dropped`);
|
|
58
|
+
}
|
|
59
|
+
if (agentLabel !== undefined && owner.scope !== "app") {
|
|
60
|
+
ctx.diagnostics.push(`${where}: agent-assisted sections are only supported on app-owned forms; agent dropped`);
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
name: optionalString(rec, "name", where, ctx) ?? "",
|
|
64
|
+
fields,
|
|
65
|
+
...(agentLabel !== undefined && owner.scope === "app" && { agentKey: scopedLabelToBagKey(owner.ownerTfLabel, agentLabel, "app") }),
|
|
66
|
+
...(typeof rec["icon"] === "string" && { icon: rec["icon"] }),
|
|
67
|
+
...(typeof rec["color"] === "string" && { color: rec["color"] }),
|
|
68
|
+
...(typeof rec["display_order"] === "number" && { displayOrder: rec["display_order"] }),
|
|
69
|
+
...(typeof rec["display_location"] === "string" && { displayLocation: rec["display_location"] }),
|
|
70
|
+
...(typeof rec["side_nav_item"] === "boolean" && { sideNavItem: rec["side_nav_item"] }),
|
|
71
|
+
...(typeof rec["hidden"] === "boolean" && { hidden: rec["hidden"] }),
|
|
72
|
+
...(typeof rec["max_columns"] === "number" && { maxColumns: rec["max_columns"] }),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Record-create-form graph declaration. */
|
|
2
|
+
import { type EntityKindModule } from "../../graph/types.js";
|
|
3
|
+
export declare const RECORD_CREATE_FORM_RESOURCE_TYPE = "elementum_record_create_form";
|
|
4
|
+
/**
|
|
5
|
+
* One immutable create form may be owned by an app or element. Task ownership
|
|
6
|
+
* is not wired into the graph yet. Its
|
|
7
|
+
* provider id is deliberately the owner's id, but Terraform supports the
|
|
8
|
+
* two distinct resource addresses in state, so this resource remains
|
|
9
|
+
* adoptable and participates in pull's zero-write gate.
|
|
10
|
+
*/
|
|
11
|
+
export declare const recordCreateFormModule: EntityKindModule;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Record-create-form graph declaration. */
|
|
2
|
+
import { NO_CANVAS, NO_CATALOG, NO_DATA, NO_LIFECYCLE } from "../../graph/types.js";
|
|
3
|
+
export const RECORD_CREATE_FORM_RESOURCE_TYPE = "elementum_record_create_form";
|
|
4
|
+
/**
|
|
5
|
+
* One immutable create form may be owned by an app or element. Task ownership
|
|
6
|
+
* is not wired into the graph yet. Its
|
|
7
|
+
* provider id is deliberately the owner's id, but Terraform supports the
|
|
8
|
+
* two distinct resource addresses in state, so this resource remains
|
|
9
|
+
* adoptable and participates in pull's zero-write gate.
|
|
10
|
+
*/
|
|
11
|
+
export const recordCreateFormModule = {
|
|
12
|
+
kind: "record-create-form",
|
|
13
|
+
stream: { role: "streamMember" },
|
|
14
|
+
authoring: { unit: "inline", bag: "recordCreateForm" },
|
|
15
|
+
parents: [
|
|
16
|
+
{ parent: "app", child: "record-create-form" },
|
|
17
|
+
{ parent: "element", child: "record-create-form" },
|
|
18
|
+
],
|
|
19
|
+
resource: { shape: "single", resourceType: RECORD_CREATE_FORM_RESOURCE_TYPE, adoptable: true },
|
|
20
|
+
data: NO_DATA,
|
|
21
|
+
lifecycle: NO_LIFECYCLE,
|
|
22
|
+
canvas: NO_CANVAS,
|
|
23
|
+
catalog: NO_CATALOG,
|
|
24
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ChildResourceScope, type TfBlock, type TfValue } from "../../engine/tf/index.js";
|
|
2
|
+
export type RecordCreateFormFieldRefWire = string | {
|
|
3
|
+
readonly refName?: string;
|
|
4
|
+
readonly fieldType?: string;
|
|
5
|
+
readonly parent?: string;
|
|
6
|
+
};
|
|
7
|
+
export interface RecordCreateFormSectionWire {
|
|
8
|
+
readonly name?: string;
|
|
9
|
+
readonly fields?: readonly RecordCreateFormFieldRefWire[];
|
|
10
|
+
readonly agent?: {
|
|
11
|
+
readonly refName?: string;
|
|
12
|
+
readonly parent?: string;
|
|
13
|
+
};
|
|
14
|
+
readonly icon?: string;
|
|
15
|
+
readonly color?: string;
|
|
16
|
+
readonly displayOrder?: number;
|
|
17
|
+
readonly displayLocation?: string;
|
|
18
|
+
readonly sideNavItem?: boolean;
|
|
19
|
+
readonly hidden?: boolean;
|
|
20
|
+
readonly maxColumns?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface RecordCreateFormWire {
|
|
23
|
+
readonly sections?: readonly RecordCreateFormSectionWire[];
|
|
24
|
+
}
|
|
25
|
+
export interface RecordCreateFormToTfOptions {
|
|
26
|
+
readonly ownerRefName: string;
|
|
27
|
+
readonly ownerTfLabel: string;
|
|
28
|
+
readonly scope: ChildResourceScope;
|
|
29
|
+
readonly objectId: TfValue;
|
|
30
|
+
readonly diagnostics: string[];
|
|
31
|
+
}
|
|
32
|
+
/** Typed authoring form -> the provider's immutable sections resource. */
|
|
33
|
+
export declare function recordCreateFormToTf(form: RecordCreateFormWire | undefined, opts: RecordCreateFormToTfOptions): TfBlock | undefined;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { expr, isCanonicalTsLabel, scopedResourceLabel, tsLabelToTfLabel, } from "../../engine/tf/index.js";
|
|
2
|
+
import { fieldRefToTfValue } from "../field/to-tf.js";
|
|
3
|
+
import { SUB_TYPE_BY_AUTHORING_TYPE } from "../field/types.js";
|
|
4
|
+
import { SYSTEM_FIELD_ID_ATTR_BY_KEY } from "../view/types.js";
|
|
5
|
+
import { RECORD_CREATE_FORM_RESOURCE_TYPE } from "./module.js";
|
|
6
|
+
// The platform export uses Int32 max for its terminal "Other fields"
|
|
7
|
+
// position, but a newly created form canonicalizes that value to the actual
|
|
8
|
+
// zero-based list position. Sending the sentinel back verbatim therefore
|
|
9
|
+
// makes Terraform see an inconsistent post-create value.
|
|
10
|
+
const PLATFORM_TERMINAL_DISPLAY_ORDER = 2147483647;
|
|
11
|
+
/** Typed authoring form -> the provider's immutable sections resource. */
|
|
12
|
+
export function recordCreateFormToTf(form, opts) {
|
|
13
|
+
if (form === undefined)
|
|
14
|
+
return undefined;
|
|
15
|
+
const sections = [];
|
|
16
|
+
for (const [index, section] of (form.sections ?? []).entries()) {
|
|
17
|
+
const where = `recordCreateForm.sections[${index}]`;
|
|
18
|
+
const displayOrder = section.displayOrder === PLATFORM_TERMINAL_DISPLAY_ORDER
|
|
19
|
+
? index
|
|
20
|
+
: section.displayOrder ?? index;
|
|
21
|
+
const attrs = {
|
|
22
|
+
name: section.name ?? "",
|
|
23
|
+
field_ids: resolveFields(section.fields ?? [], where, opts),
|
|
24
|
+
display_order: displayOrder,
|
|
25
|
+
display_location: section.displayLocation ?? "CENTER",
|
|
26
|
+
side_nav_item: section.sideNavItem ?? true,
|
|
27
|
+
hidden: section.hidden ?? false,
|
|
28
|
+
};
|
|
29
|
+
if (section.icon !== undefined)
|
|
30
|
+
attrs["icon"] = section.icon;
|
|
31
|
+
if (section.color !== undefined)
|
|
32
|
+
attrs["color"] = section.color;
|
|
33
|
+
if (section.maxColumns !== undefined)
|
|
34
|
+
attrs["max_columns"] = section.maxColumns;
|
|
35
|
+
if (section.agent !== undefined) {
|
|
36
|
+
const refName = section.agent.refName ?? "";
|
|
37
|
+
if (opts.scope !== "app") {
|
|
38
|
+
opts.diagnostics.push(`${where}: agent-assisted sections are only resolvable for app-owned agents; agent dropped`);
|
|
39
|
+
}
|
|
40
|
+
else if (section.agent.parent !== opts.ownerRefName) {
|
|
41
|
+
opts.diagnostics.push(`${where}: agent targets a different app; agent dropped`);
|
|
42
|
+
}
|
|
43
|
+
else if (!isCanonicalTsLabel(refName)) {
|
|
44
|
+
opts.diagnostics.push(`${where}: agent key "${refName}" is not a canonical tsLabel; agent dropped`);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
attrs["agent_id"] = expr.resourceAttr("elementum_agent", scopedResourceLabel(opts.ownerTfLabel, tsLabelToTfLabel(refName), "app"), ["id"]);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
sections.push(attrs);
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
kind: "resource",
|
|
54
|
+
type: RECORD_CREATE_FORM_RESOURCE_TYPE,
|
|
55
|
+
label: scopedResourceLabel(opts.ownerTfLabel, "record_create_form", opts.scope),
|
|
56
|
+
attrs: { app_id: opts.objectId, sections },
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function resolveFields(refs, where, opts) {
|
|
60
|
+
const out = [];
|
|
61
|
+
for (const ref of refs) {
|
|
62
|
+
if (typeof ref === "string") {
|
|
63
|
+
const attr = SYSTEM_FIELD_ID_ATTR_BY_KEY.get(ref);
|
|
64
|
+
if (attr === undefined)
|
|
65
|
+
opts.diagnostics.push(`${where}: "${ref}" is not a known system field key; dropped`);
|
|
66
|
+
else
|
|
67
|
+
out.push(expr.local(`${opts.ownerTfLabel}_${attr}`));
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const refName = ref.refName ?? "";
|
|
71
|
+
if (ref.parent !== undefined && ref.parent !== opts.ownerRefName) {
|
|
72
|
+
opts.diagnostics.push(`${where}: field "${refName}" targets a different aspect; dropped`);
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (!SUB_TYPE_BY_AUTHORING_TYPE.has(ref.fieldType ?? "")) {
|
|
76
|
+
opts.diagnostics.push(`${where}: field "${refName}" has no Terraform field mapping; dropped`);
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (!isCanonicalTsLabel(refName)) {
|
|
80
|
+
opts.diagnostics.push(`${where}: field key "${refName}" is not a canonical tsLabel; dropped`);
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
const value = fieldRefToTfValue(ref.fieldType, refName, opts.ownerTfLabel, opts.scope);
|
|
84
|
+
if (value !== undefined)
|
|
85
|
+
out.push(value);
|
|
86
|
+
}
|
|
87
|
+
return out;
|
|
88
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AppOrElementRef, FieldRef, TableColumnRef, TableRef } from "../../catalog/index.js";
|
|
2
|
+
import type { Filter } from "../shared/filters/types.js";
|
|
3
|
+
import type { AppViewFieldRef } from "../app/build.js";
|
|
4
|
+
export interface AppRelationshipColumn {
|
|
5
|
+
/** Field on the owning app/element. */
|
|
6
|
+
readonly field: AppViewFieldRef;
|
|
7
|
+
/** Field/column on `target`. */
|
|
8
|
+
readonly relatedField: FieldRef | TableColumnRef;
|
|
9
|
+
}
|
|
10
|
+
/** A provider AutoRelation, keyed under the owning aspect's `relationships` bag. */
|
|
11
|
+
export interface AppRelationship {
|
|
12
|
+
readonly target: AppOrElementRef | TableRef;
|
|
13
|
+
readonly columns: readonly AppRelationshipColumn[];
|
|
14
|
+
/** Uses the same typed filter DSL as access policies. */
|
|
15
|
+
readonly filter?: Filter;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type FromTfContext } from "../../engine/pull/context.js";
|
|
2
|
+
import { type ChildResourceScope, type TfBlock } from "../../engine/tf/index.js";
|
|
3
|
+
import type { NormalizedRelationship } from "../app/deserializer/normalize.js";
|
|
4
|
+
export interface RelationshipOwner {
|
|
5
|
+
/** Public EDK vocabulary; provider resource names stay at the TF boundary. */
|
|
6
|
+
readonly kind: "app" | "element";
|
|
7
|
+
readonly label: string;
|
|
8
|
+
readonly ownerRefName: string;
|
|
9
|
+
readonly ownerTfLabel: string;
|
|
10
|
+
readonly scope: ChildResourceScope;
|
|
11
|
+
}
|
|
12
|
+
export declare function relationshipsFromTf(blocks: readonly TfBlock[], owner: RelationshipOwner, ctx: FromTfContext): NormalizedRelationship[];
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { dataRefLabel, resourceRefLabel } from "../../engine/pull/context.js";
|
|
2
|
+
import { isTfExpr, scopedLabelToBagKey, tfLabelToTsLabel, } from "../../engine/tf/index.js";
|
|
3
|
+
import { filterFromTf } from "../access-policy/from-tf.js";
|
|
4
|
+
import { fieldKeyFromTfRef } from "../field/from-tf.js";
|
|
5
|
+
import { SUB_TYPE_BY_RESOURCE } from "../field/types.js";
|
|
6
|
+
import { RELATIONSHIP_RESOURCE_TYPE } from "./module.js";
|
|
7
|
+
const KNOWN_ATTRS = new Set(["object_id", "related_object_id", "columns", "filter"]);
|
|
8
|
+
export function relationshipsFromTf(blocks, owner, ctx) {
|
|
9
|
+
const out = [];
|
|
10
|
+
for (const block of blocks) {
|
|
11
|
+
const entry = relationshipFromTf(block, owner, ctx);
|
|
12
|
+
if (entry !== undefined)
|
|
13
|
+
out.push(entry);
|
|
14
|
+
}
|
|
15
|
+
return out;
|
|
16
|
+
}
|
|
17
|
+
function relationshipFromTf(block, owner, ctx) {
|
|
18
|
+
const where = `${RELATIONSHIP_RESOURCE_TYPE}.${block.label ?? "?"}`;
|
|
19
|
+
const ownerResourceType = owner.kind === "app" ? "elementum_app" : "elementum_element";
|
|
20
|
+
for (const key of Object.keys(block.attrs)) {
|
|
21
|
+
if (!KNOWN_ATTRS.has(key))
|
|
22
|
+
ctx.diagnostics.push(`${where}: unhandled attribute "${key}" — extend relationship extraction`);
|
|
23
|
+
}
|
|
24
|
+
if (resourceRefLabel(block.attrs["object_id"], ownerResourceType) !== owner.label) {
|
|
25
|
+
ctx.diagnostics.push(`${where}: object_id does not reference ${ownerResourceType}.${owner.label}; skipped`);
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
const target = targetRef(block.attrs["related_object_id"], owner, ctx);
|
|
29
|
+
if (target === undefined) {
|
|
30
|
+
ctx.diagnostics.push(`${where}: related_object_id is not resolvable; skipped`);
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
const columnsRaw = block.attrs["columns"];
|
|
34
|
+
if (!Array.isArray(columnsRaw)) {
|
|
35
|
+
ctx.diagnostics.push(`${where}: columns is not a list; skipped`);
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
const columns = [];
|
|
39
|
+
for (const [index, raw] of columnsRaw.entries()) {
|
|
40
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw) || isTfExpr(raw)) {
|
|
41
|
+
ctx.diagnostics.push(`${where}.columns[${index}]: unrecognized shape; dropped`);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
const rec = raw;
|
|
45
|
+
const field = fieldKeyFromTfRef(rec["field_id"], owner.ownerTfLabel, owner.scope);
|
|
46
|
+
const relatedField = relatedFieldRef(rec["related_field_id"], target, ctx);
|
|
47
|
+
if (field === undefined || relatedField === undefined) {
|
|
48
|
+
ctx.diagnostics.push(`${where}.columns[${index}]: field references are not resolvable; dropped`);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
columns.push({ field, relatedField });
|
|
52
|
+
}
|
|
53
|
+
const key = scopedLabelToBagKey(owner.ownerTfLabel, block.label ?? "", owner.scope);
|
|
54
|
+
const filter = block.attrs["filter"] !== undefined
|
|
55
|
+
? filterFromTf(block.attrs["filter"], {
|
|
56
|
+
type: ownerResourceType,
|
|
57
|
+
label: owner.label,
|
|
58
|
+
ownerRefName: owner.ownerRefName,
|
|
59
|
+
ownerTfLabel: owner.ownerTfLabel,
|
|
60
|
+
scope: owner.scope,
|
|
61
|
+
}, `${where}.filter`)
|
|
62
|
+
: undefined;
|
|
63
|
+
return { key, target, columns, ...(filter !== undefined && { filter }) };
|
|
64
|
+
}
|
|
65
|
+
function targetRef(value, owner, ctx) {
|
|
66
|
+
if (value === undefined)
|
|
67
|
+
return undefined;
|
|
68
|
+
const ownerResourceType = owner.kind === "app" ? "elementum_app" : "elementum_element";
|
|
69
|
+
if (resourceRefLabel(value, ownerResourceType) === owner.label) {
|
|
70
|
+
return { kind: owner.scope, key: owner.ownerRefName, name: owner.ownerRefName };
|
|
71
|
+
}
|
|
72
|
+
for (const [type, kind] of [
|
|
73
|
+
["elementum_app", "app"],
|
|
74
|
+
["elementum_element", "element"],
|
|
75
|
+
["elementum_table", "table"],
|
|
76
|
+
]) {
|
|
77
|
+
const resourceLabel = resourceRefLabel(value, type);
|
|
78
|
+
if (resourceLabel !== undefined)
|
|
79
|
+
return { kind, key: tfLabelToTsLabel(resourceLabel), name: tfLabelToTsLabel(resourceLabel), tfLabel: resourceLabel, managed: true };
|
|
80
|
+
const dataLabel = dataRefLabel(value, type);
|
|
81
|
+
if (dataLabel !== undefined) {
|
|
82
|
+
const name = ctx.dataName(type, dataLabel) ?? tfLabelToTsLabel(dataLabel);
|
|
83
|
+
return { kind, key: tfLabelToTsLabel(dataLabel), name, tfLabel: dataLabel, managed: false };
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
function relatedFieldRef(value, target, ctx) {
|
|
89
|
+
if (value === undefined)
|
|
90
|
+
return undefined;
|
|
91
|
+
if (isTfExpr(value) && value.$expr === "resource-attr" && value.path.length === 1 && value.path[0] === "id") {
|
|
92
|
+
const subType = SUB_TYPE_BY_RESOURCE.get(value.type);
|
|
93
|
+
if (subType !== undefined) {
|
|
94
|
+
const scope = target.kind === "element" ? "element" : "app";
|
|
95
|
+
const ownerLabel = target.tfLabel ?? target.key;
|
|
96
|
+
const key = fieldKeyFromTfRef(value, ownerLabel, scope);
|
|
97
|
+
if (key !== undefined)
|
|
98
|
+
return { kind: target.kind === "table" ? "tableColumn" : "field", key, name: key, parent: target.key, fieldType: subType.authoringType };
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const dataLabel = dataRefLabel(value, "elementum_field");
|
|
102
|
+
if (dataLabel !== undefined) {
|
|
103
|
+
const name = ctx.dataName("elementum_field", dataLabel) ?? tfLabelToTsLabel(dataLabel);
|
|
104
|
+
return { kind: target.kind === "table" ? "tableColumn" : "field", key: tfLabelToTsLabel(dataLabel), name, parent: target.key, fieldType: "TEXT" };
|
|
105
|
+
}
|
|
106
|
+
const scope = target.kind === "element" ? "element" : "app";
|
|
107
|
+
const key = fieldKeyFromTfRef(value, target.tfLabel ?? target.key, scope);
|
|
108
|
+
return key === undefined ? undefined : { kind: target.kind === "table" ? "tableColumn" : "field", key, name: key, parent: target.key, fieldType: "TEXT" };
|
|
109
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NO_CANVAS, NO_CATALOG, NO_LIFECYCLE } from "../../graph/types.js";
|
|
2
|
+
export const RELATIONSHIP_RESOURCE_TYPE = "elementum_relationship";
|
|
3
|
+
export const relationshipModule = {
|
|
4
|
+
kind: "relationship",
|
|
5
|
+
stream: { role: "streamMember" },
|
|
6
|
+
authoring: { unit: "inline", bag: "relationships" },
|
|
7
|
+
parents: [
|
|
8
|
+
{ parent: "app", child: "relationship" },
|
|
9
|
+
{ parent: "element", child: "relationship" },
|
|
10
|
+
],
|
|
11
|
+
resource: { shape: "single", resourceType: RELATIONSHIP_RESOURCE_TYPE, adoptable: true },
|
|
12
|
+
data: { participates: true, resourceType: RELATIONSHIP_RESOURCE_TYPE, lookupAttr: "id", referencedByBuild: false },
|
|
13
|
+
lifecycle: NO_LIFECYCLE,
|
|
14
|
+
canvas: NO_CANVAS,
|
|
15
|
+
catalog: NO_CATALOG,
|
|
16
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type OrgRefLookup, type WorkspaceAspect } from "../../engine/build/context.js";
|
|
2
|
+
import { type ChildResourceScope, type TfBlock, type TfValue } from "../../engine/tf/index.js";
|
|
3
|
+
import type { Filter } from "../shared/filters/types.js";
|
|
4
|
+
interface RefWire {
|
|
5
|
+
readonly __kind?: string;
|
|
6
|
+
readonly refName?: string;
|
|
7
|
+
readonly name?: string;
|
|
8
|
+
readonly namespace?: string;
|
|
9
|
+
readonly parent?: string;
|
|
10
|
+
readonly fieldType?: string;
|
|
11
|
+
readonly tfLabel?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface RelationshipWire {
|
|
14
|
+
readonly target?: RefWire;
|
|
15
|
+
readonly columns?: readonly {
|
|
16
|
+
readonly field?: string | RefWire;
|
|
17
|
+
readonly relatedField?: RefWire;
|
|
18
|
+
}[];
|
|
19
|
+
readonly filter?: Filter;
|
|
20
|
+
}
|
|
21
|
+
export interface RelationshipsToTfOptions {
|
|
22
|
+
readonly ownerRefName: string;
|
|
23
|
+
readonly ownerTfLabel: string;
|
|
24
|
+
readonly ownerType: "elementum_app" | "elementum_element";
|
|
25
|
+
readonly scope: ChildResourceScope;
|
|
26
|
+
readonly objectId: TfValue;
|
|
27
|
+
readonly orgRefs: OrgRefLookup;
|
|
28
|
+
readonly workspaceAspects?: ReadonlyMap<string, WorkspaceAspect>;
|
|
29
|
+
readonly diagnostics: string[];
|
|
30
|
+
}
|
|
31
|
+
export declare function relationshipsToTf(relationships: Readonly<Record<string, RelationshipWire>> | undefined, opts: RelationshipsToTfOptions): TfBlock[];
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { workspaceAspectKey, } from "../../engine/build/context.js";
|
|
2
|
+
import { expr, isCanonicalTsLabel, sanitizeName, scopedResourceLabel, tsLabelToTfLabel, } from "../../engine/tf/index.js";
|
|
3
|
+
import { filterToTf } from "../access-policy/to-tf.js";
|
|
4
|
+
import { resolveForeignRef } from "../shared/foreign-ref.js";
|
|
5
|
+
import { fieldRefToTfValue } from "../field/to-tf.js";
|
|
6
|
+
import { SYSTEM_FIELD_ID_ATTR_BY_KEY } from "../view/types.js";
|
|
7
|
+
import { RELATIONSHIP_RESOURCE_TYPE } from "./module.js";
|
|
8
|
+
export function relationshipsToTf(relationships, opts) {
|
|
9
|
+
const blocks = [];
|
|
10
|
+
for (const [key, relationship] of Object.entries(relationships ?? {})) {
|
|
11
|
+
const where = `relationships.${key}`;
|
|
12
|
+
if (!isCanonicalTsLabel(key)) {
|
|
13
|
+
opts.diagnostics.push(`${where}: key is not a canonical tsLabel; dropped`);
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
const target = resolveTarget(relationship.target, where, opts);
|
|
17
|
+
if (target === undefined)
|
|
18
|
+
continue;
|
|
19
|
+
const columns = [];
|
|
20
|
+
for (const [index, column] of (relationship.columns ?? []).entries()) {
|
|
21
|
+
const field = resolveOwnerField(column.field, `${where}.columns[${index}].field`, opts);
|
|
22
|
+
const relatedField = resolveRelatedField(column.relatedField, target, `${where}.columns[${index}].relatedField`, opts);
|
|
23
|
+
if (field !== undefined && relatedField !== undefined)
|
|
24
|
+
columns.push({ field_id: field, related_field_id: relatedField });
|
|
25
|
+
}
|
|
26
|
+
const attrs = {
|
|
27
|
+
object_id: opts.objectId,
|
|
28
|
+
related_object_id: target.value,
|
|
29
|
+
columns,
|
|
30
|
+
};
|
|
31
|
+
if (relationship.filter !== undefined) {
|
|
32
|
+
attrs["filter"] = filterToTf(relationship.filter, `${where}.filter`, {
|
|
33
|
+
ownerTfLabel: opts.ownerTfLabel,
|
|
34
|
+
scope: opts.scope,
|
|
35
|
+
objectId: opts.objectId,
|
|
36
|
+
orgRefs: opts.orgRefs,
|
|
37
|
+
diagnostics: opts.diagnostics,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const tfKey = tsLabelToTfLabel(key);
|
|
41
|
+
const label = opts.scope === "app"
|
|
42
|
+
? scopedResourceLabel(opts.ownerTfLabel, tfKey, "app")
|
|
43
|
+
: `${opts.ownerTfLabel}_${tfKey}`;
|
|
44
|
+
blocks.push({
|
|
45
|
+
kind: "resource",
|
|
46
|
+
type: RELATIONSHIP_RESOURCE_TYPE,
|
|
47
|
+
label,
|
|
48
|
+
attrs,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return blocks;
|
|
52
|
+
}
|
|
53
|
+
function resolveOwnerField(value, where, opts) {
|
|
54
|
+
if (typeof value === "string") {
|
|
55
|
+
if (opts.scope === "element" && value !== "id" && value !== "title") {
|
|
56
|
+
opts.diagnostics.push(`${where}: element relationships only support system fields "id" and "title"; dropped`);
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
const attr = SYSTEM_FIELD_ID_ATTR_BY_KEY.get(value);
|
|
60
|
+
if (attr === undefined)
|
|
61
|
+
opts.diagnostics.push(`${where}: "${value}" is not a known system field key; dropped`);
|
|
62
|
+
return attr === undefined
|
|
63
|
+
? undefined
|
|
64
|
+
: expr.local(`${opts.ownerTfLabel}_${attr}`);
|
|
65
|
+
}
|
|
66
|
+
const refName = value?.refName ?? "";
|
|
67
|
+
if (value?.parent !== undefined && value.parent !== opts.ownerRefName) {
|
|
68
|
+
opts.diagnostics.push(`${where}: field "${refName}" belongs to a different aspect; dropped`);
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
const result = fieldRefToTfValue(value?.fieldType ?? "", refName, opts.ownerTfLabel, opts.scope);
|
|
72
|
+
if (result === undefined)
|
|
73
|
+
opts.diagnostics.push(`${where}: field "${refName}" has no Terraform mapping; dropped`);
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
function resolveTarget(value, where, opts) {
|
|
77
|
+
const kind = value?.__kind === "element"
|
|
78
|
+
? "element"
|
|
79
|
+
: value?.__kind === "table"
|
|
80
|
+
? "table"
|
|
81
|
+
: "app";
|
|
82
|
+
const refName = value?.refName ?? "";
|
|
83
|
+
if (kind === opts.scope && refName === opts.ownerRefName) {
|
|
84
|
+
return {
|
|
85
|
+
value: opts.objectId,
|
|
86
|
+
kind,
|
|
87
|
+
refName,
|
|
88
|
+
tfLabel: opts.ownerTfLabel,
|
|
89
|
+
managed: true,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
if (kind !== "table") {
|
|
93
|
+
const sibling = opts.workspaceAspects?.get(workspaceAspectKey(kind, refName));
|
|
94
|
+
if (sibling !== undefined) {
|
|
95
|
+
return {
|
|
96
|
+
value: expr.resourceAttr(kind === "app" ? "elementum_app" : "elementum_element", sibling.tfLabel, ["id"]),
|
|
97
|
+
kind,
|
|
98
|
+
refName,
|
|
99
|
+
tfLabel: sibling.tfLabel,
|
|
100
|
+
managed: true,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const name = value?.name ?? refName;
|
|
105
|
+
if (name === "") {
|
|
106
|
+
opts.diagnostics.push(`${where}: target has no name/refName; dropped`);
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
const namespace = value?.namespace;
|
|
110
|
+
const foreign = resolveForeignRef(kind, { name, ...(kind !== "table" && namespace !== undefined ? { namespace } : {}), tfLabel: value?.tfLabel }, opts.orgRefs, opts.diagnostics, where);
|
|
111
|
+
return {
|
|
112
|
+
value: foreign.value,
|
|
113
|
+
kind,
|
|
114
|
+
refName,
|
|
115
|
+
tfLabel: foreign.tfLabel,
|
|
116
|
+
managed: false,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function resolveRelatedField(value, target, where, opts) {
|
|
120
|
+
const refName = value?.refName ?? "";
|
|
121
|
+
if (refName === "") {
|
|
122
|
+
opts.diagnostics.push(`${where}: field has no refName; dropped`);
|
|
123
|
+
return undefined;
|
|
124
|
+
}
|
|
125
|
+
if (value?.parent !== undefined && value.parent !== target.refName) {
|
|
126
|
+
opts.diagnostics.push(`${where}: field "${refName}" does not belong to target "${target.refName}"; dropped`);
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
if (target.managed &&
|
|
130
|
+
target.kind !== "table" &&
|
|
131
|
+
target.tfLabel !== undefined) {
|
|
132
|
+
const direct = fieldRefToTfValue(value?.fieldType ?? "", refName, target.tfLabel, target.kind);
|
|
133
|
+
if (direct !== undefined)
|
|
134
|
+
return direct;
|
|
135
|
+
}
|
|
136
|
+
const name = value?.name ?? refName;
|
|
137
|
+
const targetResourceType = target.kind === "app"
|
|
138
|
+
? "elementum_app"
|
|
139
|
+
: target.kind === "element"
|
|
140
|
+
? "elementum_element"
|
|
141
|
+
: "elementum_table";
|
|
142
|
+
const label = sanitizeName(`${targetResourceType}_${target.tfLabel ?? target.refName}_${name}`);
|
|
143
|
+
opts.orgRefs.foreignField("elementum_field", label, target.value, name);
|
|
144
|
+
return expr.dataAttr("elementum_field", label, ["id"]);
|
|
145
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { GroupRef } from "../../catalog/index.js";
|
|
2
|
+
import type { ServiceAccountRef } from "../service-account/ref.js";
|
|
3
|
+
declare const roleAutoShareBrand: unique symbol;
|
|
4
|
+
export type RoleAutoShare = string & {
|
|
5
|
+
readonly [roleAutoShareBrand]: "RoleAutoShare";
|
|
6
|
+
};
|
|
7
|
+
export declare const roleAutoShare: {
|
|
8
|
+
readonly approvalChain: RoleAutoShare;
|
|
9
|
+
readonly assignee: RoleAutoShare;
|
|
10
|
+
readonly mention: RoleAutoShare;
|
|
11
|
+
readonly recordShare: RoleAutoShare;
|
|
12
|
+
readonly watcher: RoleAutoShare;
|
|
13
|
+
};
|
|
14
|
+
declare const rolePermissionGroupBrand: unique symbol;
|
|
15
|
+
export type RolePermissionGroup = string & {
|
|
16
|
+
readonly [rolePermissionGroupBrand]: "RolePermissionGroup";
|
|
17
|
+
};
|
|
18
|
+
export declare const rolePermissionGroup: {
|
|
19
|
+
readonly agents: RolePermissionGroup;
|
|
20
|
+
readonly aiProviders: RolePermissionGroup;
|
|
21
|
+
readonly analytics: RolePermissionGroup;
|
|
22
|
+
readonly apps: RolePermissionGroup;
|
|
23
|
+
readonly attachments: RolePermissionGroup;
|
|
24
|
+
readonly automations: RolePermissionGroup;
|
|
25
|
+
readonly conversations: RolePermissionGroup;
|
|
26
|
+
readonly records: RolePermissionGroup;
|
|
27
|
+
readonly relationships: RolePermissionGroup;
|
|
28
|
+
readonly services: RolePermissionGroup;
|
|
29
|
+
readonly slas: RolePermissionGroup;
|
|
30
|
+
readonly users: RolePermissionGroup;
|
|
31
|
+
};
|
|
32
|
+
declare const rolePermissionLevelBrand: unique symbol;
|
|
33
|
+
export type RolePermissionLevel = string & {
|
|
34
|
+
readonly [rolePermissionLevelBrand]: "RolePermissionLevel";
|
|
35
|
+
};
|
|
36
|
+
export declare const rolePermissionLevel: {
|
|
37
|
+
readonly admin: RolePermissionLevel;
|
|
38
|
+
readonly edit: RolePermissionLevel;
|
|
39
|
+
readonly view: RolePermissionLevel;
|
|
40
|
+
readonly none: RolePermissionLevel;
|
|
41
|
+
readonly custom: RolePermissionLevel;
|
|
42
|
+
};
|
|
43
|
+
export interface RolePermission {
|
|
44
|
+
readonly group: RolePermissionGroup;
|
|
45
|
+
readonly level: RolePermissionLevel;
|
|
46
|
+
readonly customPermissions?: readonly string[];
|
|
47
|
+
}
|
|
48
|
+
export interface RoleUserRef {
|
|
49
|
+
readonly __kind: "user";
|
|
50
|
+
readonly email: string;
|
|
51
|
+
}
|
|
52
|
+
export declare function userRef(email: string): RoleUserRef;
|
|
53
|
+
export type RoleGroupRef = GroupRef;
|
|
54
|
+
/** One custom app/element role. Managed Admin/Edit/View roles stay data lookups. */
|
|
55
|
+
export interface AppRole {
|
|
56
|
+
readonly name: string;
|
|
57
|
+
readonly description?: string;
|
|
58
|
+
readonly autoShare?: readonly RoleAutoShare[];
|
|
59
|
+
readonly users?: readonly RoleUserRef[];
|
|
60
|
+
readonly groups?: readonly RoleGroupRef[];
|
|
61
|
+
/** Service accounts assigned to this role, by name within their owning app. */
|
|
62
|
+
readonly serviceAccounts?: readonly ServiceAccountRef[];
|
|
63
|
+
readonly permissions?: readonly RolePermission[];
|
|
64
|
+
}
|
|
65
|
+
export {};
|