@elementumai/edk 0.8.2-alpha.6 → 0.9.2
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 +18 -14
- 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 +2 -10
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +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/src/catalog/factories.d.ts +53 -19
- package/dist-sdk/src/catalog/factories.js +51 -12
- package/dist-sdk/src/catalog/from-authoring.js +13 -3
- 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 +1 -0
- package/dist-sdk/src/catalog/render.js +6 -0
- package/dist-sdk/src/catalog/token.js +7 -0
- package/dist-sdk/src/catalog/types.d.ts +34 -23
- package/dist-sdk/src/catalog/types.js +7 -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 +1 -0
- package/dist-sdk/src/core/index.js +1 -0
- 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} +2 -2
- package/dist-sdk/src/{entities/flow/activities/render-catalog.js → core/render-tree.js} +6 -8
- package/dist-sdk/src/core/types/app.d.ts +13 -23
- package/dist-sdk/src/core/types/app.js +0 -1
- package/dist-sdk/src/engine/build/context.d.ts +3 -3
- 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 +39 -0
- package/dist-sdk/src/engine/pull/org.d.ts +1 -0
- package/dist-sdk/src/engine/pull/org.js +2 -0
- package/dist-sdk/src/engine/tf/expr.d.ts +1 -1
- package/dist-sdk/src/engine/tf/expr.js +10 -3
- package/dist-sdk/src/engine/workspace/authoring-layout.js +4 -2
- package/dist-sdk/src/entities/access-policy/build.d.ts +4 -13
- package/dist-sdk/src/entities/access-policy/build.js +1 -1
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +12 -38
- package/dist-sdk/src/entities/access-policy/from-tf.js +16 -74
- package/dist-sdk/src/entities/access-policy/principal.d.ts +29 -0
- package/dist-sdk/src/entities/access-policy/principal.js +13 -0
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +20 -5
- package/dist-sdk/src/entities/access-policy/to-tf.js +26 -54
- package/dist-sdk/src/entities/agent/build.d.ts +39 -8
- package/dist-sdk/src/entities/agent/build.js +36 -15
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +5 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +121 -36
- package/dist-sdk/src/entities/agent/from-tf.js +5 -8
- 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 +5 -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 +2 -1
- package/dist-sdk/src/entities/agent/to-tf.js +2 -1
- package/dist-sdk/src/entities/agent/tools.d.ts +60 -48
- package/dist-sdk/src/entities/agent/tools.js +44 -38
- 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-tool/from-tf.d.ts +17 -8
- package/dist-sdk/src/entities/agent-tool/from-tf.js +127 -37
- package/dist-sdk/src/entities/agent-tool/module.js +6 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +5 -5
- package/dist-sdk/src/entities/agent-tool/to-tf.js +93 -20
- package/dist-sdk/src/entities/agent-tool/types.d.ts +4 -5
- package/dist-sdk/src/entities/agent-tool/types.js +36 -8
- package/dist-sdk/src/entities/app/build.d.ts +137 -25
- package/dist-sdk/src/entities/app/build.js +104 -53
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +173 -1
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.d.ts +59 -0
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.js +68 -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 +13 -4
- package/dist-sdk/src/entities/app/index.js +8 -1
- package/dist-sdk/src/entities/app/module.js +27 -2
- package/dist-sdk/src/entities/app/to-tf.js +75 -1
- 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 +10 -6
- package/dist-sdk/src/entities/automation/build.js +5 -4
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +10 -8
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +51 -114
- 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 +4 -0
- package/dist-sdk/src/entities/automation/from-tf.js +202 -119
- package/dist-sdk/src/entities/automation/index.d.ts +4 -2
- package/dist-sdk/src/entities/automation/index.js +3 -1
- package/dist-sdk/src/entities/automation/module.js +10 -4
- package/dist-sdk/src/entities/automation/script-code.js +94 -6
- package/dist-sdk/src/entities/automation/tasks.d.ts +20 -19
- package/dist-sdk/src/entities/automation/tasks.js +2 -2
- package/dist-sdk/src/entities/automation/to-tf.d.ts +34 -2
- package/dist-sdk/src/entities/automation/to-tf.js +273 -98
- package/dist-sdk/src/entities/automation/triggers.d.ts +18 -17
- package/dist-sdk/src/entities/automation/triggers.js +1 -1
- package/dist-sdk/src/entities/dashboard/build.d.ts +17 -0
- package/dist-sdk/src/entities/dashboard/from-tf.d.ts +12 -0
- package/dist-sdk/src/entities/dashboard/from-tf.js +95 -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 +30 -0
- package/dist-sdk/src/entities/dashboard/to-tf.js +94 -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/build.js +1 -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 +303 -0
- package/dist-sdk/src/entities/dynamic-layout/build.js +4 -0
- package/dist-sdk/src/entities/dynamic-layout/dialect.d.ts +2 -0
- package/dist-sdk/src/entities/dynamic-layout/dialect.js +9 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.d.ts +10 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.js +233 -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 +31 -14
- package/dist-sdk/src/entities/element/build.js +12 -4
- 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 +8 -3
- package/dist-sdk/src/entities/element/index.js +4 -1
- package/dist-sdk/src/entities/element/module.js +19 -2
- package/dist-sdk/src/entities/element/to-tf.js +57 -1
- package/dist-sdk/src/entities/field/build.d.ts +4 -3
- package/dist-sdk/src/entities/field/calculation-types.d.ts +6 -0
- package/dist-sdk/src/entities/field/calculation-types.js +42 -0
- package/dist-sdk/src/entities/field/from-tf.js +90 -11
- package/dist-sdk/src/entities/field/module.d.ts +1 -0
- package/dist-sdk/src/entities/field/module.js +5 -2
- package/dist-sdk/src/entities/field/record-shape.d.ts +1 -1
- package/dist-sdk/src/entities/field/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/field/to-tf.js +22 -6
- package/dist-sdk/src/entities/field/types.js +3 -0
- package/dist-sdk/src/entities/file-reader/build.d.ts +66 -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 +11 -9
- 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/group.js +4 -5
- package/dist-sdk/src/entities/org/index.d.ts +1 -0
- package/dist-sdk/src/entities/org/index.js +1 -0
- package/dist-sdk/src/entities/org/phone-provider.d.ts +4 -0
- package/dist-sdk/src/entities/org/phone-provider.js +33 -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 +29 -0
- package/dist-sdk/src/entities/organization/build.js +24 -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 +18 -0
- package/dist-sdk/src/entities/organization/to-tf.d.ts +6 -0
- package/dist-sdk/src/entities/organization/to-tf.js +37 -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 +54 -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 +80 -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 +31 -0
- package/dist-sdk/src/entities/relationship/to-tf.js +153 -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 +11 -0
- package/dist-sdk/src/entities/service-account/to-tf.js +72 -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/filters/ast.d.ts +21 -79
- package/dist-sdk/src/entities/shared/filters/ast.js +5 -2
- package/dist-sdk/src/entities/shared/filters/index.d.ts +94 -206
- package/dist-sdk/src/entities/shared/filters/index.js +189 -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/skill/build.d.ts +2 -2
- package/dist-sdk/src/entities/skill/build.js +4 -3
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +10 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +74 -32
- package/dist-sdk/src/entities/skill/index.d.ts +2 -1
- package/dist-sdk/src/entities/skill/index.js +2 -1
- package/dist-sdk/src/entities/skill/module.js +6 -0
- package/dist-sdk/src/entities/skill/to-tf.d.ts +5 -1
- package/dist-sdk/src/entities/skill/to-tf.js +18 -0
- package/dist-sdk/src/entities/skill/tools.d.ts +46 -31
- package/dist-sdk/src/entities/skill/tools.js +33 -20
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +4 -1
- package/dist-sdk/src/entities/skill-tool/from-tf.js +76 -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 +94 -42
- 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 +33 -18
- package/dist-sdk/src/entities/table/catalog-render.js +6 -0
- 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 +230 -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/from-tf.d.ts +7 -2
- package/dist-sdk/src/entities/view/from-tf.js +209 -25
- package/dist-sdk/src/entities/view/module.js +5 -1
- package/dist-sdk/src/entities/view/to-tf.d.ts +49 -7
- package/dist-sdk/src/entities/view/to-tf.js +155 -18
- package/dist-sdk/src/entities/view/types.d.ts +8 -0
- package/dist-sdk/src/entities/view/types.js +43 -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 +14 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.js +101 -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 +44 -0
- package/dist-sdk/src/entities/widget/to-tf.js +204 -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 +7 -0
- package/dist-sdk/src/graph/index.js +4 -18
- package/dist-sdk/src/graph/modules.js +30 -1
- package/dist-sdk/src/graph/types.d.ts +55 -7
- package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
- package/dist-sdk/src/internal/sdk-package.js +4 -2
- package/package.json +30 -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 → dashboard/build.js} +0 -0
|
@@ -4,23 +4,36 @@
|
|
|
4
4
|
* the `(left, right)` field-id pairs may be raw ids, app/element field tokens,
|
|
5
5
|
* or table-column tokens resolved at deploy.
|
|
6
6
|
*/
|
|
7
|
-
import type { TableJoinType } from "../../../elementum-entity-client/clients/tables/models/index.js";
|
|
8
|
-
import type {
|
|
9
|
-
type
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
import type { TableJoinType as WireTableJoinType } from "../../../elementum-entity-client/clients/tables/models/index.js";
|
|
8
|
+
import type { AppOrElementRef, FieldRef, TableColumnRef, TableRef } from "../../catalog/index.js";
|
|
9
|
+
import type { Filter } from "../shared/filters/types.js";
|
|
10
|
+
type TableJoinFieldRef = FieldRef | TableColumnRef;
|
|
11
|
+
declare const tableJoinTypeBrand: unique symbol;
|
|
12
|
+
declare const tableJoinBrand: unique symbol;
|
|
13
|
+
export type TableJoinType = WireTableJoinType & {
|
|
14
|
+
readonly [tableJoinTypeBrand]: "TableJoinType";
|
|
15
|
+
};
|
|
16
|
+
export declare const tableJoinType: {
|
|
17
|
+
readonly full: TableJoinType;
|
|
18
|
+
readonly inner: TableJoinType;
|
|
19
|
+
readonly left: TableJoinType;
|
|
20
|
+
readonly right: TableJoinType;
|
|
21
|
+
};
|
|
12
22
|
export interface TableJoinFieldPair {
|
|
13
23
|
readonly left: TableJoinFieldRef;
|
|
14
24
|
readonly right: TableJoinFieldRef;
|
|
15
25
|
}
|
|
16
|
-
export interface
|
|
26
|
+
export interface TableJoinOptions {
|
|
17
27
|
/** The table/aspect joined into this one (token → id at deploy). */
|
|
18
|
-
readonly source:
|
|
28
|
+
readonly source: AppOrElementRef | TableRef;
|
|
19
29
|
readonly type: TableJoinType;
|
|
20
30
|
readonly on: readonly TableJoinFieldPair[];
|
|
21
|
-
readonly filter?:
|
|
31
|
+
readonly filter?: Filter;
|
|
22
32
|
}
|
|
23
|
-
export
|
|
33
|
+
export type TableJoin = TableJoinOptions & {
|
|
34
|
+
readonly [tableJoinBrand]: "TableJoin";
|
|
35
|
+
};
|
|
36
|
+
export declare function tableJoin(opts: TableJoinOptions): TableJoin;
|
|
24
37
|
/** Serialize a join to the wire shape (source token left in place for deploy). */
|
|
25
38
|
export declare function serializeJoin(def: TableJoin): Record<string, unknown>;
|
|
26
39
|
export {};
|
|
@@ -1,29 +1,21 @@
|
|
|
1
1
|
import { EdkValidationError } from "../../../elementum-entity-client/errors.js";
|
|
2
|
+
export const tableJoinType = {
|
|
3
|
+
full: "FULL",
|
|
4
|
+
inner: "INNER",
|
|
5
|
+
left: "LEFT",
|
|
6
|
+
right: "RIGHT",
|
|
7
|
+
};
|
|
2
8
|
export function tableJoin(opts) {
|
|
3
9
|
if (opts.on.length === 0) {
|
|
4
10
|
throw new EdkValidationError("tableJoin: `on` must list at least one (left, right) field pair.");
|
|
5
11
|
}
|
|
6
12
|
return opts;
|
|
7
13
|
}
|
|
8
|
-
function idOf(v) {
|
|
9
|
-
if (isFieldRef(v) || isTableColumnRef(v))
|
|
10
|
-
return v;
|
|
11
|
-
return typeof v === "string" ? v : v.id;
|
|
12
|
-
}
|
|
13
|
-
function isFieldRef(value) {
|
|
14
|
-
return (typeof value === "object" &&
|
|
15
|
-
value !== null &&
|
|
16
|
-
value.__kind === "field");
|
|
17
|
-
}
|
|
18
|
-
function isTableColumnRef(value) {
|
|
19
|
-
return (typeof value === "object" &&
|
|
20
|
-
value !== null &&
|
|
21
|
-
value.__kind === "tableColumn");
|
|
22
|
-
}
|
|
14
|
+
function idOf(v) { return v; }
|
|
23
15
|
/** Serialize a join to the wire shape (source token left in place for deploy). */
|
|
24
16
|
export function serializeJoin(def) {
|
|
25
17
|
return {
|
|
26
|
-
source: def.source, //
|
|
18
|
+
source: def.source, // AppOrElementRef / TableRef token → id at deploy
|
|
27
19
|
type: def.type,
|
|
28
20
|
joinOn: def.on.map((p) => ({ leftFieldId: idOf(p.left), rightFieldId: idOf(p.right) })),
|
|
29
21
|
...(def.filter !== undefined ? { filter: def.filter } : {}),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Org-owned table
|
|
2
|
+
* Org-owned table graph — authoring root `tables/`, Terraform build and pull.
|
|
3
3
|
*/
|
|
4
4
|
import { type EntityKindModule } from "../../graph/types.js";
|
|
5
|
+
export declare const TABLE_RESOURCE_TYPE = "elementum_table";
|
|
5
6
|
export declare const tableModule: EntityKindModule;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Org-owned table
|
|
2
|
+
* Org-owned table graph — authoring root `tables/`, Terraform build and pull.
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { tfLabelToTsLabel } from "../../engine/tf/index.js";
|
|
5
5
|
import { renderTableCatalogEntry } from "./catalog-render.js";
|
|
6
|
+
import { tableFromTf } from "./from-tf.js";
|
|
7
|
+
import { tableToTf } from "./to-tf.js";
|
|
8
|
+
export const TABLE_RESOURCE_TYPE = "elementum_table";
|
|
9
|
+
function extract(stream, ctx) { const blocks = stream.byKind.get("table") ?? []; if (blocks.length !== 1)
|
|
10
|
+
throw new Error(`expected exactly one ${TABLE_RESOURCE_TYPE}, found ${blocks.length}`); const table = tableFromTf(blocks[0], ctx, stream.byKind.get("datamine") ?? []); return { instance: { ...table, refName: tfLabelToTsLabel(blocks[0].label ?? table.handle) } }; }
|
|
6
11
|
export const tableModule = {
|
|
7
12
|
kind: "table",
|
|
8
|
-
stream: { role: "
|
|
13
|
+
stream: { role: "streamRoot", exportVerb: "tables" },
|
|
9
14
|
authoring: { unit: "ownFile", bag: "tables" },
|
|
10
15
|
parents: [{ parent: "org", child: "table" }],
|
|
11
|
-
resource: { shape: "
|
|
12
|
-
data
|
|
13
|
-
|
|
16
|
+
resource: { shape: "single", resourceType: TABLE_RESOURCE_TYPE, adoptable: true },
|
|
17
|
+
// Cross-table relationships already emit name-keyed data lookups through
|
|
18
|
+
// OrgRefLookup.rawLookup; register that real build surface in the graph.
|
|
19
|
+
data: { participates: true, resourceType: "elementum_table", lookupAttr: "name", referencedByBuild: true },
|
|
20
|
+
lifecycle: { participates: true, extractStreamRoot: extract, toTf: (entity, ctx) => tableToTf(entity, { orgRefs: ctx.orgRefs, diagnostics: ctx.diagnostics, workspaceAspects: ctx.workspaceAspects }) },
|
|
14
21
|
canvas: { participates: true, label: "Tables", glyph: "▤", component: "generic" },
|
|
15
22
|
catalog: {
|
|
16
23
|
participates: true,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type OrgRefLookup, type WorkspaceAspect } from "../../engine/build/context.js";
|
|
2
|
+
import { type DeployableEntity } from "../../engine/entity.js";
|
|
3
|
+
import { type TfBlock } from "../../engine/tf/index.js";
|
|
4
|
+
export declare function tableToTf(entity: DeployableEntity, ctx: {
|
|
5
|
+
orgRefs: OrgRefLookup;
|
|
6
|
+
diagnostics: string[];
|
|
7
|
+
workspaceAspects?: ReadonlyMap<string, WorkspaceAspect>;
|
|
8
|
+
}): {
|
|
9
|
+
blocks: readonly TfBlock[];
|
|
10
|
+
};
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { workspaceAspectKey, } from "../../engine/build/context.js";
|
|
2
|
+
import { EntityTfError } from "../../engine/entity.js";
|
|
3
|
+
import { expr, sanitizeName, tsLabelToTfLabel, } from "../../engine/tf/index.js";
|
|
4
|
+
import { CATEGORY_ORG_BAG } from "../org/category.js";
|
|
5
|
+
import { CLOUD_LINK_ORG_BAG } from "../org/cloud-link.js";
|
|
6
|
+
import { tableDataminesToTf, } from "../datamine/to-tf.js";
|
|
7
|
+
import { fieldRefToTfValue } from "../field/to-tf.js";
|
|
8
|
+
import { filterToTf as serializeFilterToTf } from "../shared/filters/tf-codec.js";
|
|
9
|
+
import { TABLE_RESOURCE_TYPE } from "./module.js";
|
|
10
|
+
function tableColumnName(column) {
|
|
11
|
+
for (const kind of ["cloud", "calculation", "reference"]) {
|
|
12
|
+
const value = column[kind];
|
|
13
|
+
if (value !== null &&
|
|
14
|
+
typeof value === "object" &&
|
|
15
|
+
typeof value.name === "string") {
|
|
16
|
+
return value.name;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
function aspectId(ref, orgRefs, workspaceAspects) {
|
|
22
|
+
if (typeof ref === "string")
|
|
23
|
+
return ref;
|
|
24
|
+
const name = ref.name ?? ref.refName ?? "";
|
|
25
|
+
const label = sanitizeName(name);
|
|
26
|
+
if (ref.__kind === "table") {
|
|
27
|
+
orgRefs.rawLookup("elementum_table", label, name);
|
|
28
|
+
return expr.dataAttr("elementum_table", label, ["id"]);
|
|
29
|
+
}
|
|
30
|
+
if (ref.__kind === "element") {
|
|
31
|
+
const local = workspaceAspects?.get(workspaceAspectKey("element", ref.refName ?? ""));
|
|
32
|
+
if (local !== undefined)
|
|
33
|
+
return expr.resourceAttr("elementum_element", local.tfLabel, ["id"]);
|
|
34
|
+
orgRefs.foreignElement(label, name);
|
|
35
|
+
return expr.dataAttr("elementum_element", label, ["id"]);
|
|
36
|
+
}
|
|
37
|
+
if (ref.__kind === "app") {
|
|
38
|
+
const local = workspaceAspects?.get(workspaceAspectKey("app", ref.refName ?? ""));
|
|
39
|
+
if (local !== undefined)
|
|
40
|
+
return expr.resourceAttr("elementum_app", local.tfLabel, ["id"]);
|
|
41
|
+
orgRefs.foreignApp(label, name);
|
|
42
|
+
return expr.dataAttr("elementum_app", label, ["id"]);
|
|
43
|
+
}
|
|
44
|
+
throw new EntityTfError(`defineTable source must be an app, element, table, or raw id`);
|
|
45
|
+
}
|
|
46
|
+
function fieldId(value, orgRefs, ownRef, ownLabel, ownColumnNames, workspaceAspects) {
|
|
47
|
+
if (typeof value === "string")
|
|
48
|
+
return value;
|
|
49
|
+
if (value !== null &&
|
|
50
|
+
typeof value === "object" &&
|
|
51
|
+
typeof value.id === "string")
|
|
52
|
+
return value.id;
|
|
53
|
+
const ref = value;
|
|
54
|
+
if (ref.__kind === "tableColumn") {
|
|
55
|
+
if (ref.parent === ownRef) {
|
|
56
|
+
const key = ref.refName ?? "";
|
|
57
|
+
const name = ownColumnNames[key];
|
|
58
|
+
if (name === undefined) {
|
|
59
|
+
throw new EntityTfError(`defineTable filter references unknown column key ${JSON.stringify(key)}`);
|
|
60
|
+
}
|
|
61
|
+
return expr.resourceAttr(TABLE_RESOURCE_TYPE, ownLabel, [
|
|
62
|
+
"field_ids",
|
|
63
|
+
{ index: name },
|
|
64
|
+
]);
|
|
65
|
+
}
|
|
66
|
+
const tableLabel = sanitizeName(ref.parent ?? "table");
|
|
67
|
+
orgRefs.rawLookup("elementum_table", tableLabel, ref.parent ?? "");
|
|
68
|
+
const fieldLabel = sanitizeName(`${ref.parent ?? "table"}_${ref.refName ?? ref.name ?? "field"}`);
|
|
69
|
+
orgRefs.foreignField("elementum_field", fieldLabel, expr.dataAttr("elementum_table", tableLabel, ["id"]), ref.name ?? ref.refName ?? "");
|
|
70
|
+
return expr.dataAttr("elementum_field", fieldLabel, ["id"]);
|
|
71
|
+
}
|
|
72
|
+
if (ref.__kind === "field") {
|
|
73
|
+
const parent = ref.parent ?? "app";
|
|
74
|
+
const kind = ref.parentKind ?? "app";
|
|
75
|
+
const local = workspaceAspects?.get(workspaceAspectKey(kind, parent));
|
|
76
|
+
if (local !== undefined &&
|
|
77
|
+
ref.fieldType !== undefined &&
|
|
78
|
+
ref.refName !== undefined) {
|
|
79
|
+
const resolved = fieldRefToTfValue(ref.fieldType, ref.refName, local.tfLabel, kind);
|
|
80
|
+
if (resolved !== undefined)
|
|
81
|
+
return resolved;
|
|
82
|
+
}
|
|
83
|
+
const parentName = ref.parentName ?? parent;
|
|
84
|
+
const parentLabel = sanitizeName(parentName);
|
|
85
|
+
if (kind === "element")
|
|
86
|
+
orgRefs.foreignElement(parentLabel, parentName);
|
|
87
|
+
else
|
|
88
|
+
orgRefs.foreignApp(parentLabel, parentName);
|
|
89
|
+
const label = sanitizeName(`${parent}_${ref.refName ?? ref.name ?? "field"}`);
|
|
90
|
+
const parentType = kind === "element" ? "elementum_element" : "elementum_app";
|
|
91
|
+
orgRefs.foreignField("elementum_field", label, expr.dataAttr(parentType, parentLabel, ["id"]), ref.name ?? ref.refName ?? "");
|
|
92
|
+
return expr.dataAttr("elementum_field", label, ["id"]);
|
|
93
|
+
}
|
|
94
|
+
throw new EntityTfError(`defineTable field reference has an unsupported shape`);
|
|
95
|
+
}
|
|
96
|
+
function tableFilterToTf(filter, orgRefs, ownRef, ownLabel, ownColumnNames, workspaceAspects) {
|
|
97
|
+
return serializeFilterToTf(filter, {
|
|
98
|
+
field: (field) => fieldId(field, orgRefs, ownRef, ownLabel, ownColumnNames, workspaceAspects),
|
|
99
|
+
aspect: (aspect) => aspectId(aspect, orgRefs, workspaceAspects),
|
|
100
|
+
reference: () => { throw new EntityTfError("table filters do not support reference values"); },
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
export function tableToTf(entity, ctx) {
|
|
104
|
+
if (entity.kind !== "table")
|
|
105
|
+
throw new EntityTfError(`tableToTf expects table; got ${entity.kind}`);
|
|
106
|
+
const p = entity.payload;
|
|
107
|
+
if (p === null || !p.name || !p.handle)
|
|
108
|
+
throw new EntityTfError(`table ${entity.refName}: name and handle are required`);
|
|
109
|
+
const label = tsLabelToTfLabel(entity.refName || p.handle);
|
|
110
|
+
const columnNames = Object.fromEntries(Object.entries(p.columns ?? {}).flatMap(([key, column]) => {
|
|
111
|
+
const name = tableColumnName(column);
|
|
112
|
+
return name === undefined ? [] : [[key, name]];
|
|
113
|
+
}));
|
|
114
|
+
const attrs = { name: p.name, handle: p.handle };
|
|
115
|
+
const categoryRefName = typeof p.categoryId === "string" ? undefined : p.categoryId?.refName;
|
|
116
|
+
const category = categoryRefName
|
|
117
|
+
? ctx.orgRefs.byTsLabel(CATEGORY_ORG_BAG, categoryRefName)
|
|
118
|
+
: undefined;
|
|
119
|
+
if (category === undefined)
|
|
120
|
+
throw new EntityTfError(`table ${JSON.stringify(p.name)}: category ${JSON.stringify(categoryRefName ?? "")} is not in the org catalog`);
|
|
121
|
+
attrs["category_id"] = expr.dataAttr("elementum_category", category.tfLabel, [
|
|
122
|
+
"id",
|
|
123
|
+
]);
|
|
124
|
+
if (p.source !== undefined)
|
|
125
|
+
attrs["source_id"] = aspectId(p.source, ctx.orgRefs, ctx.workspaceAspects);
|
|
126
|
+
for (const key of ["description", "icon", "color"])
|
|
127
|
+
if (p[key] !== undefined)
|
|
128
|
+
attrs[key] = p[key];
|
|
129
|
+
const mapping = p.cloudMapping;
|
|
130
|
+
if (mapping !== undefined) {
|
|
131
|
+
const link = mapping.cloudLinkId;
|
|
132
|
+
const resolved = link?.refName
|
|
133
|
+
? ctx.orgRefs.byTsLabel(CLOUD_LINK_ORG_BAG, link.refName)
|
|
134
|
+
: undefined;
|
|
135
|
+
if (resolved === undefined)
|
|
136
|
+
throw new EntityTfError(`table ${JSON.stringify(p.name)}: cloudMapping.cloudLink is not in the org catalog`);
|
|
137
|
+
attrs["cloud_mapping_cloudlink_id"] = expr.dataAttr("elementum_cloudlink", resolved.tfLabel, ["id"]);
|
|
138
|
+
const variants = [
|
|
139
|
+
["snowflakeMapping", "snowflake", ["database", "schema", "table"]],
|
|
140
|
+
["bigQueryMapping", "bigquery", ["dataset", "table"]],
|
|
141
|
+
["databricksMapping", "databricks", ["database", "schema", "table"]],
|
|
142
|
+
];
|
|
143
|
+
for (const [wire, prefix, keys] of variants) {
|
|
144
|
+
const value = mapping[wire];
|
|
145
|
+
if (!value)
|
|
146
|
+
continue;
|
|
147
|
+
for (const key of keys) {
|
|
148
|
+
const sourceKey = `${key}Name`;
|
|
149
|
+
const v = value[sourceKey] ?? value[key];
|
|
150
|
+
if (typeof v === "string")
|
|
151
|
+
attrs[`cloud_mapping_${prefix}_${key}`] = v;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
const columns = Object.entries(p.columns ?? {}).map(([, column]) => {
|
|
156
|
+
if (column.cloud) {
|
|
157
|
+
const c = column.cloud;
|
|
158
|
+
const variant = (c.snowflake ?? c.bigQuery);
|
|
159
|
+
return {
|
|
160
|
+
name: c.name,
|
|
161
|
+
cloud_column_name: (variant.columnName ??
|
|
162
|
+
variant.column_name),
|
|
163
|
+
cloud_type: variant.type,
|
|
164
|
+
...(Array.isArray(c.tags) && { tags: c.tags }),
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
if (column.calculation) {
|
|
168
|
+
const c = column.calculation;
|
|
169
|
+
return {
|
|
170
|
+
name: c.name,
|
|
171
|
+
calculation_text: c.text,
|
|
172
|
+
...(Array.isArray(c.tags) && { tags: c.tags }),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
const c = column.reference;
|
|
176
|
+
const result = {
|
|
177
|
+
name: c.name,
|
|
178
|
+
reference_field_id: fieldId(c.field, ctx.orgRefs, entity.refName, label, columnNames, ctx.workspaceAspects),
|
|
179
|
+
...(Array.isArray(c.tags) && { tags: c.tags }),
|
|
180
|
+
};
|
|
181
|
+
if (typeof c.aggregation === "string")
|
|
182
|
+
result.reference_aggregation = c.aggregation;
|
|
183
|
+
if (typeof c.expanded === "string")
|
|
184
|
+
result.reference_expanded = c.expanded;
|
|
185
|
+
return result;
|
|
186
|
+
});
|
|
187
|
+
attrs["fields"] = columns;
|
|
188
|
+
if (p.joins !== undefined)
|
|
189
|
+
attrs["joins"] = p.joins.map((join) => ({
|
|
190
|
+
type: join.type,
|
|
191
|
+
source_id: aspectId(join.source, ctx.orgRefs, ctx.workspaceAspects),
|
|
192
|
+
join_on: (join.joinOn ?? []).map((pair) => ({
|
|
193
|
+
left_field_id: fieldId(pair.leftFieldId, ctx.orgRefs, entity.refName, label, columnNames, ctx.workspaceAspects),
|
|
194
|
+
right_field_id: fieldId(pair.rightFieldId, ctx.orgRefs, entity.refName, label, columnNames, ctx.workspaceAspects),
|
|
195
|
+
})),
|
|
196
|
+
...(join.filter !== undefined && {
|
|
197
|
+
filter: tableFilterToTf(join.filter, ctx.orgRefs, entity.refName, label, columnNames, ctx.workspaceAspects),
|
|
198
|
+
}),
|
|
199
|
+
}));
|
|
200
|
+
if (p.filter !== undefined) {
|
|
201
|
+
attrs["filter"] = tableFilterToTf(p.filter, ctx.orgRefs, entity.refName, label, columnNames, ctx.workspaceAspects);
|
|
202
|
+
}
|
|
203
|
+
if (typeof p.limit === "number")
|
|
204
|
+
attrs["limit"] = p.limit;
|
|
205
|
+
if (p.orderBy !== undefined)
|
|
206
|
+
attrs["order_by"] =
|
|
207
|
+
typeof p.orderBy === "string"
|
|
208
|
+
? p.orderBy
|
|
209
|
+
: expr.jsonencode(p.orderBy);
|
|
210
|
+
const view = p.views?.[0];
|
|
211
|
+
if (view !== undefined) {
|
|
212
|
+
const snowflake = (view.snowflake ?? view);
|
|
213
|
+
for (const key of ["database", "schema", "name"]) {
|
|
214
|
+
const v = snowflake[`${key}Name`] ?? snowflake[key];
|
|
215
|
+
if (typeof v === "string")
|
|
216
|
+
attrs[`data_view_snowflake_${key}`] = v;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
blocks: [
|
|
221
|
+
{ kind: "resource", type: TABLE_RESOURCE_TYPE, label, attrs },
|
|
222
|
+
...tableDataminesToTf(p.datamines, {
|
|
223
|
+
tableTfLabel: label,
|
|
224
|
+
columnNames,
|
|
225
|
+
diagnostics: ctx.diagnostics,
|
|
226
|
+
filterToTf: (filter) => tableFilterToTf(filter, ctx.orgRefs, entity.refName, label, columnNames, ctx.workspaceAspects),
|
|
227
|
+
}),
|
|
228
|
+
],
|
|
229
|
+
};
|
|
230
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type CategoryRef, type CloudLinkRef } from "../../catalog/index.js";
|
|
2
|
+
import type { DeployableEntity, EntityDeployOptions } from "../../engine/entity.js";
|
|
3
|
+
declare const taskStatusTagBrand: unique symbol;
|
|
4
|
+
export type TaskStatusTag = string & {
|
|
5
|
+
readonly [taskStatusTagBrand]: "TaskStatusTag";
|
|
6
|
+
};
|
|
7
|
+
export declare const taskStatusTag: {
|
|
8
|
+
readonly closed: TaskStatusTag;
|
|
9
|
+
};
|
|
10
|
+
export interface TaskStatusOption {
|
|
11
|
+
readonly label: string;
|
|
12
|
+
readonly color?: string;
|
|
13
|
+
readonly tags?: readonly TaskStatusTag[];
|
|
14
|
+
}
|
|
15
|
+
export interface DefineTaskOptions extends EntityDeployOptions {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly handle?: string;
|
|
18
|
+
readonly namespace?: string;
|
|
19
|
+
readonly category: CategoryRef;
|
|
20
|
+
readonly description?: string;
|
|
21
|
+
readonly icon?: string;
|
|
22
|
+
readonly color?: string;
|
|
23
|
+
readonly cloudLink?: CloudLinkRef;
|
|
24
|
+
readonly titleField?: {
|
|
25
|
+
readonly name?: string;
|
|
26
|
+
readonly description?: string;
|
|
27
|
+
};
|
|
28
|
+
readonly idField?: {
|
|
29
|
+
readonly name?: string;
|
|
30
|
+
readonly description?: string;
|
|
31
|
+
};
|
|
32
|
+
readonly statusField?: {
|
|
33
|
+
readonly name?: string;
|
|
34
|
+
readonly description?: string;
|
|
35
|
+
readonly options?: readonly TaskStatusOption[];
|
|
36
|
+
};
|
|
37
|
+
readonly commentsEnabled?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface TaskConfigured {
|
|
40
|
+
def(refName: string): DeployableEntity;
|
|
41
|
+
}
|
|
42
|
+
export declare function defineTask(opts: DefineTaskOptions): TaskConfigured;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { slimTokens } from "../../catalog/index.js";
|
|
2
|
+
export const taskStatusTag = { closed: "CLOSED" };
|
|
3
|
+
export function defineTask(opts) {
|
|
4
|
+
if (opts.name.trim() === "")
|
|
5
|
+
throw new Error("defineTask requires a non-empty name.");
|
|
6
|
+
if (opts.handle !== undefined && !/^[A-Za-z]+$/.test(opts.handle))
|
|
7
|
+
throw new Error(`defineTask ${JSON.stringify(opts.name)}: handle must contain only letters.`);
|
|
8
|
+
if (opts.namespace !== undefined && !/^[A-Za-z]+$/.test(opts.namespace))
|
|
9
|
+
throw new Error(`defineTask ${JSON.stringify(opts.name)}: namespace must contain only letters.`);
|
|
10
|
+
if (opts.category.refName.trim() === "")
|
|
11
|
+
throw new Error(`defineTask ${JSON.stringify(opts.name)}: category ref is required.`);
|
|
12
|
+
return { def(refName) {
|
|
13
|
+
const handle = opts.handle ?? refName.replace(/[^A-Za-z]/g, "").toUpperCase();
|
|
14
|
+
const namespace = opts.namespace ?? refName.replace(/[^A-Za-z]/g, "").toLowerCase();
|
|
15
|
+
return { kind: "task", parent: "org", refName, payload: slimTokens({ ...opts, handle, namespace }), ...(opts.enabled !== undefined ? { enabled: opts.enabled } : {}) };
|
|
16
|
+
} };
|
|
17
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type FromTfContext } from "../../engine/pull/context.js";
|
|
2
|
+
import { type TfBlock } from "../../engine/tf/index.js";
|
|
3
|
+
export interface NormalizedTask {
|
|
4
|
+
readonly refName: string;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly handle: string;
|
|
7
|
+
readonly namespace: string;
|
|
8
|
+
readonly categoryRef?: string;
|
|
9
|
+
readonly cloudLinkRef?: string;
|
|
10
|
+
readonly description?: string;
|
|
11
|
+
readonly icon?: string;
|
|
12
|
+
readonly color?: string;
|
|
13
|
+
readonly commentsEnabled?: boolean;
|
|
14
|
+
readonly titleField?: {
|
|
15
|
+
readonly name?: string;
|
|
16
|
+
readonly description?: string;
|
|
17
|
+
};
|
|
18
|
+
readonly idField?: {
|
|
19
|
+
readonly name?: string;
|
|
20
|
+
readonly description?: string;
|
|
21
|
+
};
|
|
22
|
+
readonly statusField?: {
|
|
23
|
+
readonly name?: string;
|
|
24
|
+
readonly description?: string;
|
|
25
|
+
readonly options?: readonly Record<string, unknown>[];
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export declare function taskFromTf(block: TfBlock, ctx: FromTfContext): NormalizedTask;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { dataRefLabel, optionalBoolean, optionalString, plainObject } from "../../engine/pull/context.js";
|
|
2
|
+
import { tfLabelToTsLabel } from "../../engine/tf/index.js";
|
|
3
|
+
import { TASK_RESOURCE_TYPE } from "./module.js";
|
|
4
|
+
const KNOWN = new Set(["id", "name", "handle", "namespace", "category_id", "cloud_link_id", "description", "icon", "color", "title_field_name", "title_field_description", "id_field_name", "id_field_description", "status_field_name", "status_field_description", "status_options", "status_option_ids_by_label", "title_field_id", "id_field_id", "status_field_id", "comments_enabled", "comments_display_block_id"]);
|
|
5
|
+
export function taskFromTf(block, ctx) {
|
|
6
|
+
if (block.type !== TASK_RESOURCE_TYPE || !block.label)
|
|
7
|
+
throw new Error(`expected ${TASK_RESOURCE_TYPE}`);
|
|
8
|
+
for (const key of Object.keys(block.attrs))
|
|
9
|
+
if (!KNOWN.has(key))
|
|
10
|
+
ctx.diagnostics.push(`${block.type}.${block.label}: unhandled attribute ${key}`);
|
|
11
|
+
const name = optionalString(block.attrs, "name", `task ${block.label}`, ctx) ?? "";
|
|
12
|
+
const handle = optionalString(block.attrs, "handle", `task ${block.label}`, ctx) ?? block.label.toUpperCase();
|
|
13
|
+
const namespace = optionalString(block.attrs, "namespace", `task ${block.label}`, ctx) ?? block.label;
|
|
14
|
+
const categoryLabel = dataRefLabel(block.attrs["category_id"], "elementum_category");
|
|
15
|
+
const cloudLabel = dataRefLabel(block.attrs["cloud_link_id"], "elementum_cloudlink");
|
|
16
|
+
const statusOptions = Array.isArray(block.attrs["status_options"])
|
|
17
|
+
? block.attrs["status_options"].flatMap((item) => {
|
|
18
|
+
const option = plainObject(item);
|
|
19
|
+
return option === undefined ? [] : [option];
|
|
20
|
+
})
|
|
21
|
+
: undefined;
|
|
22
|
+
const titleName = optionalString(block.attrs, "title_field_name", `task ${block.label}`, ctx);
|
|
23
|
+
const titleDescription = optionalString(block.attrs, "title_field_description", `task ${block.label}`, ctx);
|
|
24
|
+
const idName = optionalString(block.attrs, "id_field_name", `task ${block.label}`, ctx);
|
|
25
|
+
const idDescription = optionalString(block.attrs, "id_field_description", `task ${block.label}`, ctx);
|
|
26
|
+
const statusName = optionalString(block.attrs, "status_field_name", `task ${block.label}`, ctx);
|
|
27
|
+
const statusDescription = optionalString(block.attrs, "status_field_description", `task ${block.label}`, ctx);
|
|
28
|
+
return { refName: tfLabelToTsLabel(block.label), name, handle, namespace,
|
|
29
|
+
...(categoryLabel !== undefined && { categoryRef: tfLabelToTsLabel(categoryLabel) }),
|
|
30
|
+
...(cloudLabel !== undefined && { cloudLinkRef: tfLabelToTsLabel(cloudLabel) }),
|
|
31
|
+
...(optionalString(block.attrs, "description", `task ${block.label}`, ctx) !== undefined && { description: optionalString(block.attrs, "description", `task ${block.label}`, ctx) }),
|
|
32
|
+
...(optionalString(block.attrs, "icon", `task ${block.label}`, ctx) !== undefined && { icon: optionalString(block.attrs, "icon", `task ${block.label}`, ctx) }),
|
|
33
|
+
...(optionalString(block.attrs, "color", `task ${block.label}`, ctx) !== undefined && { color: optionalString(block.attrs, "color", `task ${block.label}`, ctx) }),
|
|
34
|
+
...(optionalBoolean(block.attrs, "comments_enabled", `task ${block.label}`, ctx) !== undefined && { commentsEnabled: optionalBoolean(block.attrs, "comments_enabled", `task ${block.label}`, ctx) }),
|
|
35
|
+
...((titleName !== undefined || titleDescription !== undefined) && { titleField: { ...(titleName !== undefined && { name: titleName }), ...(titleDescription !== undefined && { description: titleDescription }) } }),
|
|
36
|
+
...((idName !== undefined || idDescription !== undefined) && { idField: { ...(idName !== undefined && { name: idName }), ...(idDescription !== undefined && { description: idDescription }) } }),
|
|
37
|
+
...((statusName !== undefined || statusDescription !== undefined || statusOptions !== undefined) && { statusField: { ...(statusName !== undefined && { name: statusName }), ...(statusDescription !== undefined && { description: statusDescription }), ...(statusOptions !== undefined && { options: statusOptions }) } }), };
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { defineTask, taskStatusTag, type DefineTaskOptions, type TaskConfigured, type TaskStatusOption, type TaskStatusTag } from "./build.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { defineTask, taskStatusTag } from "./build.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NO_CATALOG } from "../../graph/types.js";
|
|
2
|
+
import { taskFromTf } from "./from-tf.js";
|
|
3
|
+
import { taskToTf } from "./to-tf.js";
|
|
4
|
+
export const TASK_RESOURCE_TYPE = "elementum_task";
|
|
5
|
+
function extract(stream, ctx) { const blocks = stream.byKind.get("task") ?? []; if (blocks.length !== 1)
|
|
6
|
+
throw new Error(`expected exactly one ${TASK_RESOURCE_TYPE}, found ${blocks.length}`); return { instance: taskFromTf(blocks[0], ctx) }; }
|
|
7
|
+
export const taskModule = {
|
|
8
|
+
kind: "task", stream: { role: "streamRoot", exportVerb: "tasks" }, authoring: { unit: "ownFile", bag: "tasks" }, parents: [{ parent: "org", child: "task" }],
|
|
9
|
+
resource: { shape: "single", resourceType: TASK_RESOURCE_TYPE, adoptable: true }, data: { participates: true, lookupAttr: "name", referencedByBuild: false },
|
|
10
|
+
lifecycle: { participates: true, extractStreamRoot: extract, toTf: (entity, ctx) => taskToTf(entity, { orgRefs: ctx.orgRefs, diagnostics: ctx.diagnostics }) },
|
|
11
|
+
canvas: { participates: true, label: "Tasks", glyph: "☑", component: "appDetail" }, catalog: NO_CATALOG,
|
|
12
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { OrgRefLookup } from "../../engine/build/context.js";
|
|
2
|
+
import { type DeployableEntity } from "../../engine/entity.js";
|
|
3
|
+
import { type TfBlock } from "../../engine/tf/index.js";
|
|
4
|
+
export declare function taskToTf(entity: DeployableEntity, ctx: {
|
|
5
|
+
orgRefs: OrgRefLookup;
|
|
6
|
+
diagnostics: string[];
|
|
7
|
+
}): {
|
|
8
|
+
blocks: readonly TfBlock[];
|
|
9
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { EntityTfError } from "../../engine/entity.js";
|
|
2
|
+
import { expr } from "../../engine/tf/index.js";
|
|
3
|
+
import { CATEGORY_ORG_BAG } from "../org/category.js";
|
|
4
|
+
import { CLOUD_LINK_ORG_BAG } from "../org/cloud-link.js";
|
|
5
|
+
import { TASK_RESOURCE_TYPE } from "./module.js";
|
|
6
|
+
export function taskToTf(entity, ctx) {
|
|
7
|
+
if (entity.kind !== "task")
|
|
8
|
+
throw new EntityTfError(`taskToTf expects task; got ${entity.kind}`);
|
|
9
|
+
const p = entity.payload;
|
|
10
|
+
if (p === null || !p.name || !p.handle || !p.namespace)
|
|
11
|
+
throw new EntityTfError(`task ${entity.refName}: name, handle, and namespace are required`);
|
|
12
|
+
const attrs = { name: p.name, handle: p.handle, namespace: p.namespace };
|
|
13
|
+
const categoryRefName = p.category?.refName;
|
|
14
|
+
const category = categoryRefName ? ctx.orgRefs.byTsLabel(CATEGORY_ORG_BAG, categoryRefName) : undefined;
|
|
15
|
+
if (category === undefined)
|
|
16
|
+
ctx.diagnostics.push(`task ${JSON.stringify(p.name)}: category ${JSON.stringify(categoryRefName ?? "")} is not in the org catalog`);
|
|
17
|
+
else
|
|
18
|
+
attrs["category_id"] = expr.dataAttr("elementum_category", category.tfLabel, ["id"]);
|
|
19
|
+
if (p.cloudLink?.refName) {
|
|
20
|
+
const link = ctx.orgRefs.byTsLabel(CLOUD_LINK_ORG_BAG, p.cloudLink.refName);
|
|
21
|
+
if (link === undefined)
|
|
22
|
+
ctx.diagnostics.push(`task ${JSON.stringify(p.name)}: cloud link ${JSON.stringify(p.cloudLink.refName)} is not in the org catalog`);
|
|
23
|
+
else
|
|
24
|
+
attrs["cloud_link_id"] = expr.dataAttr("elementum_cloudlink", link.tfLabel, ["id"]);
|
|
25
|
+
}
|
|
26
|
+
if (p.description !== undefined)
|
|
27
|
+
attrs["description"] = p.description;
|
|
28
|
+
if (p.icon !== undefined)
|
|
29
|
+
attrs["icon"] = p.icon;
|
|
30
|
+
if (p.color !== undefined)
|
|
31
|
+
attrs["color"] = p.color;
|
|
32
|
+
if (p.commentsEnabled !== undefined)
|
|
33
|
+
attrs["comments_enabled"] = p.commentsEnabled;
|
|
34
|
+
if (p.titleField?.name !== undefined)
|
|
35
|
+
attrs["title_field_name"] = p.titleField.name;
|
|
36
|
+
if (p.titleField?.description !== undefined)
|
|
37
|
+
attrs["title_field_description"] = p.titleField.description;
|
|
38
|
+
if (p.idField?.name !== undefined)
|
|
39
|
+
attrs["id_field_name"] = p.idField.name;
|
|
40
|
+
if (p.idField?.description !== undefined)
|
|
41
|
+
attrs["id_field_description"] = p.idField.description;
|
|
42
|
+
if (p.statusField?.name !== undefined)
|
|
43
|
+
attrs["status_field_name"] = p.statusField.name;
|
|
44
|
+
if (p.statusField?.description !== undefined)
|
|
45
|
+
attrs["status_field_description"] = p.statusField.description;
|
|
46
|
+
if (p.statusField?.options !== undefined)
|
|
47
|
+
attrs["status_options"] = p.statusField.options.map((option) => ({ label: option.label ?? "", ...(option.color !== undefined && { color: option.color }), tags: [...(option.tags ?? [])] }));
|
|
48
|
+
return { blocks: [{ kind: "resource", type: TASK_RESOURCE_TYPE, label: p.namespace, attrs }] };
|
|
49
|
+
}
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { type FromTfContext } from "../../engine/pull/context.js";
|
|
9
9
|
import { type ChildResourceScope, type TfBlock } from "../../engine/tf/index.js";
|
|
10
|
-
import type { NormalizedLayout, NormalizedListView } from "../app/deserializer/normalize.js";
|
|
10
|
+
import type { NormalizedAgentView, NormalizedCalendarView, NormalizedDashboardView, NormalizedKanbanView, NormalizedLayout, NormalizedListView } from "../app/deserializer/normalize.js";
|
|
11
|
+
/** Report every attribute key not in `known` as dialect growth — shared by all four view/section passes below. */
|
|
11
12
|
export interface ViewOwner {
|
|
12
13
|
/** The owner's resource type ("elementum_app") — what `object_id`/`aspect_id` must reference. */
|
|
13
14
|
readonly type: string;
|
|
@@ -23,7 +24,11 @@ export interface ViewOwner {
|
|
|
23
24
|
export interface ViewsFromTfResult {
|
|
24
25
|
readonly layouts: readonly NormalizedLayout[];
|
|
25
26
|
readonly listViews: readonly NormalizedListView[];
|
|
27
|
+
readonly calendarViews: readonly NormalizedCalendarView[];
|
|
28
|
+
readonly kanbanViews: readonly NormalizedKanbanView[];
|
|
29
|
+
readonly dashboardViews: readonly NormalizedDashboardView[];
|
|
30
|
+
readonly agentViews: readonly NormalizedAgentView[];
|
|
26
31
|
readonly viewOrder?: readonly string[];
|
|
27
32
|
}
|
|
28
33
|
/** All three view resource kinds → the normalized shapes the app printer consumes. */
|
|
29
|
-
export declare function viewsFromTf(layoutBlocks: readonly TfBlock[], listViewBlocks: readonly TfBlock[], managedViewOrderBlocks: readonly TfBlock[], owner: ViewOwner, ctx: FromTfContext): ViewsFromTfResult;
|
|
34
|
+
export declare function viewsFromTf(layoutBlocks: readonly TfBlock[], listViewBlocks: readonly TfBlock[], calendarViewBlocks: readonly TfBlock[], kanbanViewBlocks: readonly TfBlock[], dashboardViewBlocks: readonly TfBlock[], agentViewBlocks: readonly TfBlock[], managedViewOrderBlocks: readonly TfBlock[], owner: ViewOwner, ctx: FromTfContext): ViewsFromTfResult;
|