@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
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import type { AppOrElementRef, AutomationRef } from "../../catalog/index.js";
|
|
2
|
+
import type { AppViewFieldRef } from "../app/build.js";
|
|
3
|
+
export type DynamicLayoutTypedValue = {
|
|
4
|
+
readonly string: string;
|
|
5
|
+
} | {
|
|
6
|
+
readonly number: number;
|
|
7
|
+
} | {
|
|
8
|
+
readonly boolean: boolean;
|
|
9
|
+
} | {
|
|
10
|
+
readonly strings: readonly string[];
|
|
11
|
+
};
|
|
12
|
+
export type DynamicLayoutCssLength = {
|
|
13
|
+
readonly px: number;
|
|
14
|
+
} | {
|
|
15
|
+
readonly rem: number;
|
|
16
|
+
} | {
|
|
17
|
+
readonly percent: number;
|
|
18
|
+
} | {
|
|
19
|
+
readonly vh: number;
|
|
20
|
+
} | {
|
|
21
|
+
readonly vw: number;
|
|
22
|
+
} | {
|
|
23
|
+
readonly auto: true;
|
|
24
|
+
} | {
|
|
25
|
+
readonly css: string;
|
|
26
|
+
};
|
|
27
|
+
export interface DynamicLayoutStyle {
|
|
28
|
+
readonly padding?: DynamicLayoutCssLength;
|
|
29
|
+
readonly margin?: DynamicLayoutCssLength;
|
|
30
|
+
readonly background?: string;
|
|
31
|
+
readonly borderRadius?: DynamicLayoutCssLength;
|
|
32
|
+
readonly border?: string;
|
|
33
|
+
readonly width?: DynamicLayoutCssLength;
|
|
34
|
+
readonly minWidth?: DynamicLayoutCssLength;
|
|
35
|
+
readonly maxWidth?: DynamicLayoutCssLength;
|
|
36
|
+
readonly height?: DynamicLayoutCssLength;
|
|
37
|
+
readonly minHeight?: DynamicLayoutCssLength;
|
|
38
|
+
readonly maxHeight?: DynamicLayoutCssLength;
|
|
39
|
+
readonly gap?: DynamicLayoutCssLength;
|
|
40
|
+
readonly flex?: string;
|
|
41
|
+
readonly alignItems?: "start" | "center" | "end" | "stretch" | "baseline" | "flex-start" | "flex-end";
|
|
42
|
+
readonly justifyContent?: "start" | "center" | "end" | "between" | "around" | "evenly" | "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly";
|
|
43
|
+
readonly className?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface DynamicLayoutFieldComponent {
|
|
46
|
+
readonly field: AppViewFieldRef;
|
|
47
|
+
readonly fieldName?: string;
|
|
48
|
+
readonly label?: string;
|
|
49
|
+
readonly color?: string;
|
|
50
|
+
readonly defaultValue?: DynamicLayoutTypedValue;
|
|
51
|
+
readonly fullWidth?: boolean;
|
|
52
|
+
readonly dependsOn?: readonly string[];
|
|
53
|
+
}
|
|
54
|
+
interface DynamicLayoutComponentCommon<ComponentKey extends string = string, ConditionKey extends string = string, SaveGroupKey extends string = string> {
|
|
55
|
+
readonly children?: readonly ComponentKey[];
|
|
56
|
+
readonly style?: DynamicLayoutStyle;
|
|
57
|
+
readonly showWhen?: readonly ConditionKey[];
|
|
58
|
+
readonly hideWhen?: readonly ConditionKey[];
|
|
59
|
+
readonly enableWhen?: readonly ConditionKey[];
|
|
60
|
+
readonly disableWhen?: readonly ConditionKey[];
|
|
61
|
+
readonly requireWhen?: readonly ConditionKey[];
|
|
62
|
+
readonly matchAllRules?: boolean;
|
|
63
|
+
readonly saveGroup?: SaveGroupKey;
|
|
64
|
+
readonly blockId?: string;
|
|
65
|
+
}
|
|
66
|
+
interface DynamicLayoutComponentVariantMap {
|
|
67
|
+
readonly container: {
|
|
68
|
+
readonly padding?: DynamicLayoutCssLength;
|
|
69
|
+
readonly gap?: DynamicLayoutCssLength;
|
|
70
|
+
readonly background?: string;
|
|
71
|
+
readonly borderRadius?: DynamicLayoutCssLength;
|
|
72
|
+
readonly maxWidth?: DynamicLayoutCssLength;
|
|
73
|
+
readonly className?: string;
|
|
74
|
+
};
|
|
75
|
+
readonly section: {
|
|
76
|
+
readonly title?: string;
|
|
77
|
+
readonly icon?: string;
|
|
78
|
+
readonly color?: string;
|
|
79
|
+
readonly collapsible?: boolean;
|
|
80
|
+
readonly defaultCollapsed?: boolean;
|
|
81
|
+
readonly hidden?: boolean;
|
|
82
|
+
readonly className?: string;
|
|
83
|
+
};
|
|
84
|
+
readonly row: {
|
|
85
|
+
readonly gap?: DynamicLayoutCssLength;
|
|
86
|
+
readonly alignItems?: "start" | "center" | "end" | "stretch" | "baseline";
|
|
87
|
+
readonly justifyContent?: "start" | "center" | "end" | "between" | "around" | "evenly";
|
|
88
|
+
readonly wrap?: boolean;
|
|
89
|
+
readonly className?: string;
|
|
90
|
+
};
|
|
91
|
+
readonly column: {
|
|
92
|
+
readonly span?: number;
|
|
93
|
+
readonly gap?: DynamicLayoutCssLength;
|
|
94
|
+
readonly alignItems?: "start" | "center" | "end" | "stretch";
|
|
95
|
+
readonly className?: string;
|
|
96
|
+
};
|
|
97
|
+
readonly grid: {
|
|
98
|
+
readonly columns?: number;
|
|
99
|
+
readonly gap?: DynamicLayoutCssLength;
|
|
100
|
+
readonly minColumnWidth?: DynamicLayoutCssLength;
|
|
101
|
+
readonly className?: string;
|
|
102
|
+
};
|
|
103
|
+
readonly card: {
|
|
104
|
+
readonly title?: string;
|
|
105
|
+
readonly description?: string;
|
|
106
|
+
readonly padding?: DynamicLayoutCssLength;
|
|
107
|
+
readonly className?: string;
|
|
108
|
+
};
|
|
109
|
+
readonly spacer: {
|
|
110
|
+
readonly size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
111
|
+
readonly className?: string;
|
|
112
|
+
};
|
|
113
|
+
readonly divider: {
|
|
114
|
+
readonly orientation?: "horizontal" | "vertical";
|
|
115
|
+
readonly className?: string;
|
|
116
|
+
};
|
|
117
|
+
readonly automationButton: {
|
|
118
|
+
readonly automation: AutomationRef;
|
|
119
|
+
readonly label?: string;
|
|
120
|
+
readonly variant?: "default" | "outline" | "ghost" | "destructive";
|
|
121
|
+
readonly icon?: string;
|
|
122
|
+
readonly confirmMessage?: string;
|
|
123
|
+
};
|
|
124
|
+
readonly createButton: {
|
|
125
|
+
readonly target: AppOrElementRef;
|
|
126
|
+
readonly label?: string;
|
|
127
|
+
readonly variant?: "default" | "outline" | "ghost";
|
|
128
|
+
};
|
|
129
|
+
readonly relateButton: {
|
|
130
|
+
readonly label?: string;
|
|
131
|
+
readonly variant?: "default" | "outline" | "ghost";
|
|
132
|
+
readonly icon?: string;
|
|
133
|
+
};
|
|
134
|
+
readonly updateBlock: {
|
|
135
|
+
readonly title?: string;
|
|
136
|
+
readonly fields?: readonly AppViewFieldRef[];
|
|
137
|
+
readonly submitLabel?: string;
|
|
138
|
+
};
|
|
139
|
+
readonly textField: DynamicLayoutFieldComponent;
|
|
140
|
+
readonly numberField: DynamicLayoutFieldComponent;
|
|
141
|
+
readonly decimalField: DynamicLayoutFieldComponent;
|
|
142
|
+
readonly dateField: DynamicLayoutFieldComponent;
|
|
143
|
+
readonly datetimeField: DynamicLayoutFieldComponent;
|
|
144
|
+
readonly booleanField: DynamicLayoutFieldComponent;
|
|
145
|
+
readonly picklistField: DynamicLayoutFieldComponent;
|
|
146
|
+
readonly multiPicklistField: DynamicLayoutFieldComponent;
|
|
147
|
+
readonly htmlField: DynamicLayoutFieldComponent;
|
|
148
|
+
readonly attachmentField: DynamicLayoutFieldComponent;
|
|
149
|
+
readonly groupField: DynamicLayoutFieldComponent;
|
|
150
|
+
readonly jsonField: DynamicLayoutFieldComponent;
|
|
151
|
+
readonly qrCodeField: DynamicLayoutFieldComponent;
|
|
152
|
+
readonly userField: DynamicLayoutFieldComponent & {
|
|
153
|
+
readonly isAssignee?: boolean;
|
|
154
|
+
};
|
|
155
|
+
readonly calculationField: DynamicLayoutFieldComponent & {
|
|
156
|
+
readonly format?: "number" | "currency" | "percentage" | "text";
|
|
157
|
+
readonly currency?: string;
|
|
158
|
+
readonly locale?: string;
|
|
159
|
+
};
|
|
160
|
+
readonly stageBlock: {
|
|
161
|
+
readonly label?: string;
|
|
162
|
+
};
|
|
163
|
+
readonly slaBlock: {
|
|
164
|
+
readonly label?: string;
|
|
165
|
+
};
|
|
166
|
+
readonly activityLogBlock: {
|
|
167
|
+
readonly label?: string;
|
|
168
|
+
};
|
|
169
|
+
readonly approvalsBlock: {
|
|
170
|
+
readonly label?: string;
|
|
171
|
+
};
|
|
172
|
+
readonly attachmentsBlock: {
|
|
173
|
+
readonly label?: string;
|
|
174
|
+
};
|
|
175
|
+
readonly relatedTasksBlock: {
|
|
176
|
+
readonly label?: string;
|
|
177
|
+
};
|
|
178
|
+
readonly relationshipsBlock: {
|
|
179
|
+
readonly label?: string;
|
|
180
|
+
};
|
|
181
|
+
readonly relatedItemsBlock: {
|
|
182
|
+
readonly label?: string;
|
|
183
|
+
};
|
|
184
|
+
readonly surveysBlock: {
|
|
185
|
+
readonly label?: string;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
type ExactlyOneVariant<Map extends object> = {
|
|
189
|
+
[K in keyof Map]: {
|
|
190
|
+
readonly [P in K]: Map[K];
|
|
191
|
+
} & {
|
|
192
|
+
readonly [P in Exclude<keyof Map, K>]?: never;
|
|
193
|
+
};
|
|
194
|
+
}[keyof Map];
|
|
195
|
+
export type DynamicLayoutComponent<ComponentKey extends string = string, ConditionKey extends string = string, SaveGroupKey extends string = string> = DynamicLayoutComponentCommon<ComponentKey, ConditionKey, SaveGroupKey> & ExactlyOneVariant<DynamicLayoutComponentVariantMap>;
|
|
196
|
+
export type DynamicLayoutComparison = {
|
|
197
|
+
readonly field: AppViewFieldRef;
|
|
198
|
+
readonly value: DynamicLayoutTypedValue;
|
|
199
|
+
};
|
|
200
|
+
interface DynamicLayoutConditionVariantMap<ConditionKey extends string> {
|
|
201
|
+
readonly equals: DynamicLayoutComparison;
|
|
202
|
+
readonly notEquals: DynamicLayoutComparison;
|
|
203
|
+
readonly greaterThan: DynamicLayoutComparison;
|
|
204
|
+
readonly greaterThanOrEqual: DynamicLayoutComparison;
|
|
205
|
+
readonly lessThan: DynamicLayoutComparison;
|
|
206
|
+
readonly lessThanOrEqual: DynamicLayoutComparison;
|
|
207
|
+
readonly contains: DynamicLayoutComparison;
|
|
208
|
+
readonly notContains: DynamicLayoutComparison;
|
|
209
|
+
readonly in: DynamicLayoutComparison;
|
|
210
|
+
readonly notIn: DynamicLayoutComparison;
|
|
211
|
+
readonly empty: {
|
|
212
|
+
readonly field: AppViewFieldRef;
|
|
213
|
+
};
|
|
214
|
+
readonly notEmpty: {
|
|
215
|
+
readonly field: AppViewFieldRef;
|
|
216
|
+
};
|
|
217
|
+
readonly role: {
|
|
218
|
+
readonly roleId: string;
|
|
219
|
+
};
|
|
220
|
+
readonly user: {
|
|
221
|
+
readonly userId: string;
|
|
222
|
+
};
|
|
223
|
+
readonly group: {
|
|
224
|
+
readonly groupId: string;
|
|
225
|
+
};
|
|
226
|
+
/** Stage key, resolved through the owning app's stage_ids_by_key map. */
|
|
227
|
+
readonly stage: {
|
|
228
|
+
readonly stage: string;
|
|
229
|
+
};
|
|
230
|
+
readonly all: {
|
|
231
|
+
readonly conditions: readonly ConditionKey[];
|
|
232
|
+
};
|
|
233
|
+
readonly any: {
|
|
234
|
+
readonly conditions: readonly ConditionKey[];
|
|
235
|
+
};
|
|
236
|
+
readonly not: {
|
|
237
|
+
readonly condition: ConditionKey;
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
export type DynamicLayoutCondition<ConditionKey extends string = string> = ExactlyOneVariant<DynamicLayoutConditionVariantMap<ConditionKey>>;
|
|
241
|
+
type ValidationMessage = {
|
|
242
|
+
readonly message?: string;
|
|
243
|
+
};
|
|
244
|
+
export type DynamicLayoutValidationRule = ({
|
|
245
|
+
readonly type: "required" | "email" | "url";
|
|
246
|
+
} & ValidationMessage) | ({
|
|
247
|
+
readonly type: "minLength" | "maxLength" | "min" | "max";
|
|
248
|
+
readonly number: number;
|
|
249
|
+
} & ValidationMessage) | ({
|
|
250
|
+
readonly type: "pattern";
|
|
251
|
+
readonly string: string;
|
|
252
|
+
} & ValidationMessage);
|
|
253
|
+
export interface DynamicLayoutFieldValidation {
|
|
254
|
+
readonly field: AppViewFieldRef;
|
|
255
|
+
readonly rules: readonly DynamicLayoutValidationRule[];
|
|
256
|
+
}
|
|
257
|
+
export interface DynamicLayoutSaveGroup {
|
|
258
|
+
readonly name?: string;
|
|
259
|
+
readonly fields: readonly AppViewFieldRef[];
|
|
260
|
+
readonly triggersAutomation?: boolean;
|
|
261
|
+
readonly dependencies?: readonly string[];
|
|
262
|
+
readonly validations?: readonly DynamicLayoutFieldValidation[];
|
|
263
|
+
}
|
|
264
|
+
export interface DynamicLayoutDependency {
|
|
265
|
+
readonly sourceField: AppViewFieldRef;
|
|
266
|
+
readonly targetField: AppViewFieldRef;
|
|
267
|
+
readonly type: "value" | "visibility" | "validation";
|
|
268
|
+
readonly condition?: string;
|
|
269
|
+
}
|
|
270
|
+
export interface AppDynamicLayout {
|
|
271
|
+
readonly name: string;
|
|
272
|
+
readonly description?: string;
|
|
273
|
+
readonly active?: boolean;
|
|
274
|
+
/** Optional stage key. Omit for the app-level default DASHBOARD layout. */
|
|
275
|
+
readonly stage?: string;
|
|
276
|
+
readonly documentId: string;
|
|
277
|
+
readonly documentVersion?: string;
|
|
278
|
+
readonly rootComponent: string;
|
|
279
|
+
readonly components: Readonly<Record<string, DynamicLayoutComponent>>;
|
|
280
|
+
readonly conditions?: Readonly<Record<string, DynamicLayoutCondition>>;
|
|
281
|
+
readonly saveGroups?: Readonly<Record<string, DynamicLayoutSaveGroup>>;
|
|
282
|
+
readonly fieldValidations?: readonly DynamicLayoutFieldValidation[];
|
|
283
|
+
readonly dependencies?: readonly DynamicLayoutDependency[];
|
|
284
|
+
readonly metadata?: {
|
|
285
|
+
readonly createdAt?: string;
|
|
286
|
+
readonly updatedAt?: string;
|
|
287
|
+
readonly createdBy?: string;
|
|
288
|
+
readonly description?: string;
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
type DynamicLayoutInput<Components extends Readonly<Record<string, DynamicLayoutComponent>>, Conditions extends Readonly<Record<string, DynamicLayoutCondition>>, SaveGroups extends Readonly<Record<string, DynamicLayoutSaveGroup>>> = Omit<AppDynamicLayout, "rootComponent" | "components" | "conditions" | "saveGroups"> & {
|
|
292
|
+
readonly rootComponent: Extract<keyof Components, string>;
|
|
293
|
+
readonly components: {
|
|
294
|
+
readonly [K in keyof Components]: DynamicLayoutComponent<Extract<keyof Components, string>, Extract<keyof Conditions, string>, Extract<keyof SaveGroups, string>>;
|
|
295
|
+
};
|
|
296
|
+
readonly conditions?: {
|
|
297
|
+
readonly [K in keyof Conditions]: DynamicLayoutCondition<Extract<keyof Conditions, string>>;
|
|
298
|
+
};
|
|
299
|
+
readonly saveGroups?: SaveGroups;
|
|
300
|
+
};
|
|
301
|
+
/** Preserve graph keys so child, condition, save-group, and root references are checked. */
|
|
302
|
+
export declare function defineDynamicLayout<const Components extends Readonly<Record<string, DynamicLayoutComponent>>, const Conditions extends Readonly<Record<string, DynamicLayoutCondition>> = Record<never, never>, const SaveGroups extends Readonly<Record<string, DynamicLayoutSaveGroup>> = Record<never, never>>(layout: DynamicLayoutInput<Components, Conditions, SaveGroups>): AppDynamicLayout;
|
|
303
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const DYNAMIC_LAYOUT_FIELD_COMPONENT_KEYS = new Set([
|
|
2
|
+
"textField", "numberField", "decimalField", "dateField", "datetimeField", "booleanField",
|
|
3
|
+
"picklistField", "multiPicklistField", "htmlField", "attachmentField", "groupField", "jsonField",
|
|
4
|
+
"qrCodeField", "userField", "calculationField",
|
|
5
|
+
]);
|
|
6
|
+
export const DYNAMIC_LAYOUT_COMPARISON_KEYS = new Set([
|
|
7
|
+
"equals", "notEquals", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual",
|
|
8
|
+
"contains", "notContains", "in", "notIn", "empty", "notEmpty",
|
|
9
|
+
]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type FromTfContext } from "../../engine/pull/context.js";
|
|
2
|
+
import { type TfBlock } from "../../engine/tf/index.js";
|
|
3
|
+
import type { NormalizedDynamicLayout } from "../app/deserializer/normalize.js";
|
|
4
|
+
export interface DynamicLayoutOwner {
|
|
5
|
+
readonly type: string;
|
|
6
|
+
readonly label: string;
|
|
7
|
+
readonly ownerRefName: string;
|
|
8
|
+
readonly ownerTfLabel: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function dynamicLayoutsFromTf(blocks: readonly TfBlock[], owner: DynamicLayoutOwner, ctx: FromTfContext): NormalizedDynamicLayout[];
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { dataRefLabel, optionalString, plainObject, resourceRefLabel } from "../../engine/pull/context.js";
|
|
2
|
+
import { isTfExpr, scopedLabelToBagKey, tfLabelToTsLabel, } from "../../engine/tf/index.js";
|
|
3
|
+
import { fieldKeyFromTfRef } from "../field/from-tf.js";
|
|
4
|
+
import { DYNAMIC_LAYOUT_RESOURCE_TYPE } from "./module.js";
|
|
5
|
+
import { DYNAMIC_LAYOUT_COMPARISON_KEYS, DYNAMIC_LAYOUT_FIELD_COMPONENT_KEYS } from "./dialect.js";
|
|
6
|
+
const KNOWN_ATTRS = new Set([
|
|
7
|
+
"app_id", "stage_id", "name", "description", "active", "document_id", "document_version",
|
|
8
|
+
"root_component", "components", "conditions", "save_groups", "field_validations", "dependencies",
|
|
9
|
+
"metadata", "version", "created_at", "updated_at",
|
|
10
|
+
]);
|
|
11
|
+
export function dynamicLayoutsFromTf(blocks, owner, ctx) {
|
|
12
|
+
const out = [];
|
|
13
|
+
for (const block of blocks) {
|
|
14
|
+
const entry = dynamicLayoutFromTf(block, owner, ctx);
|
|
15
|
+
if (entry !== undefined)
|
|
16
|
+
out.push(entry);
|
|
17
|
+
}
|
|
18
|
+
return out;
|
|
19
|
+
}
|
|
20
|
+
function dynamicLayoutFromTf(block, owner, ctx) {
|
|
21
|
+
const where = `${DYNAMIC_LAYOUT_RESOURCE_TYPE}.${block.label ?? "?"}`;
|
|
22
|
+
for (const key of Object.keys(block.attrs)) {
|
|
23
|
+
if (!KNOWN_ATTRS.has(key))
|
|
24
|
+
ctx.diagnostics.push(`${where}: unhandled attribute "${key}" — extend dynamic-layout extraction`);
|
|
25
|
+
}
|
|
26
|
+
if (resourceRefLabel(block.attrs["app_id"], owner.type) !== owner.label) {
|
|
27
|
+
ctx.diagnostics.push(`${where}: app_id does not reference ${owner.type}.${owner.label}; skipped`);
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
const componentsRaw = plainObject(block.attrs["components"]);
|
|
31
|
+
if (componentsRaw === undefined) {
|
|
32
|
+
ctx.diagnostics.push(`${where}: components is not an object; skipped`);
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
const resolvedStageKey = stageKey(block.attrs["stage_id"], owner);
|
|
36
|
+
if (block.attrs["stage_id"] !== undefined && resolvedStageKey === undefined) {
|
|
37
|
+
ctx.diagnostics.push(`${where}: stage_id has an unrecognized shape; layout kept unscoped instead of guessing`);
|
|
38
|
+
}
|
|
39
|
+
const layout = {
|
|
40
|
+
name: optionalString(block.attrs, "name", where, ctx) ?? "",
|
|
41
|
+
...(typeof block.attrs["description"] === "string" && { description: block.attrs["description"] }),
|
|
42
|
+
...(typeof block.attrs["active"] === "boolean" && { active: block.attrs["active"] }),
|
|
43
|
+
...(resolvedStageKey !== undefined && { stage: resolvedStageKey }),
|
|
44
|
+
documentId: optionalString(block.attrs, "document_id", where, ctx) ?? "",
|
|
45
|
+
...(typeof block.attrs["document_version"] === "string" && { documentVersion: block.attrs["document_version"] }),
|
|
46
|
+
rootComponent: optionalString(block.attrs, "root_component", where, ctx) ?? "",
|
|
47
|
+
components: componentMap(componentsRaw, owner, ctx, where),
|
|
48
|
+
};
|
|
49
|
+
const conditions = plainObject(block.attrs["conditions"]);
|
|
50
|
+
if (conditions !== undefined)
|
|
51
|
+
layout["conditions"] = conditionMap(conditions, owner, ctx, where);
|
|
52
|
+
const saveGroups = plainObject(block.attrs["save_groups"]);
|
|
53
|
+
if (saveGroups !== undefined)
|
|
54
|
+
layout["saveGroups"] = saveGroupMap(saveGroups, owner, ctx, where);
|
|
55
|
+
if (Array.isArray(block.attrs["field_validations"])) {
|
|
56
|
+
layout["fieldValidations"] = block.attrs["field_validations"].map((v, i) => fieldValidation(plainObject(v) ?? {}, owner, ctx, `${where}.field_validations[${i}]`));
|
|
57
|
+
}
|
|
58
|
+
if (Array.isArray(block.attrs["dependencies"])) {
|
|
59
|
+
layout["dependencies"] = block.attrs["dependencies"].map((v, i) => dependency(plainObject(v) ?? {}, owner, ctx, `${where}.dependencies[${i}]`));
|
|
60
|
+
}
|
|
61
|
+
const metadata = plainObject(block.attrs["metadata"]);
|
|
62
|
+
if (metadata !== undefined)
|
|
63
|
+
layout["metadata"] = camelObject(metadata);
|
|
64
|
+
return {
|
|
65
|
+
key: scopedLabelToBagKey(owner.ownerTfLabel, block.label ?? "", "app"),
|
|
66
|
+
layout,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function componentMap(values, owner, ctx, where) {
|
|
70
|
+
const out = {};
|
|
71
|
+
for (const [id, raw] of Object.entries(values)) {
|
|
72
|
+
const component = camelObject(plainObject(raw) ?? {});
|
|
73
|
+
for (const key of DYNAMIC_LAYOUT_FIELD_COMPONENT_KEYS) {
|
|
74
|
+
const field = plainUnknownObject(component[key]);
|
|
75
|
+
if (field === undefined || field["fieldId"] === undefined)
|
|
76
|
+
continue;
|
|
77
|
+
field["field"] = fieldKey(field["fieldId"], owner, ctx, `${where}.components.${id}.${key}`);
|
|
78
|
+
delete field["fieldId"];
|
|
79
|
+
}
|
|
80
|
+
const update = plainUnknownObject(component["updateBlock"]);
|
|
81
|
+
if (update !== undefined && Array.isArray(update["fieldIds"])) {
|
|
82
|
+
update["fields"] = update["fieldIds"].flatMap((v) => {
|
|
83
|
+
const key = fieldKey(v, owner, ctx, `${where}.components.${id}.updateBlock`);
|
|
84
|
+
return key === undefined ? [] : [key];
|
|
85
|
+
});
|
|
86
|
+
delete update["fieldIds"];
|
|
87
|
+
}
|
|
88
|
+
const automation = plainUnknownObject(component["automationButton"]);
|
|
89
|
+
if (automation !== undefined && automation["automationId"] !== undefined) {
|
|
90
|
+
const label = resourceRefLabel(automation["automationId"], "elementum_automation");
|
|
91
|
+
if (label !== undefined) {
|
|
92
|
+
automation["automation"] = pulledRef("automation", scopedLabelToBagKey(owner.ownerTfLabel, label, "app"), owner.ownerRefName);
|
|
93
|
+
}
|
|
94
|
+
else
|
|
95
|
+
ctx.diagnostics.push(`${where}.components.${id}.automationButton: automation_id is not a managed automation ref; dropped`);
|
|
96
|
+
delete automation["automationId"];
|
|
97
|
+
}
|
|
98
|
+
const create = plainUnknownObject(component["createButton"]);
|
|
99
|
+
if (create !== undefined && create["targetAspectId"] !== undefined) {
|
|
100
|
+
const ref = aspectRef(create["targetAspectId"], owner, ctx);
|
|
101
|
+
if (ref !== undefined)
|
|
102
|
+
create["target"] = ref;
|
|
103
|
+
else
|
|
104
|
+
ctx.diagnostics.push(`${where}.components.${id}.createButton: target_aspect_id is not resolvable; dropped`);
|
|
105
|
+
delete create["targetAspectId"];
|
|
106
|
+
}
|
|
107
|
+
out[id] = component;
|
|
108
|
+
}
|
|
109
|
+
return out;
|
|
110
|
+
}
|
|
111
|
+
function conditionMap(values, owner, ctx, where) {
|
|
112
|
+
const out = {};
|
|
113
|
+
for (const [id, raw] of Object.entries(values)) {
|
|
114
|
+
const condition = camelObject(plainObject(raw) ?? {});
|
|
115
|
+
for (const key of DYNAMIC_LAYOUT_COMPARISON_KEYS) {
|
|
116
|
+
const comparison = plainUnknownObject(condition[key]);
|
|
117
|
+
if (comparison === undefined || comparison["fieldId"] === undefined)
|
|
118
|
+
continue;
|
|
119
|
+
comparison["field"] = fieldKey(comparison["fieldId"], owner, ctx, `${where}.conditions.${id}.${key}`);
|
|
120
|
+
delete comparison["fieldId"];
|
|
121
|
+
const value = plainUnknownObject(comparison["value"]);
|
|
122
|
+
const stringValue = value?.["string"];
|
|
123
|
+
if (value !== undefined && stringValue !== undefined && isTfExpr(stringValue) && stringValue.$expr === "local") {
|
|
124
|
+
const segment = stringValue.path[0];
|
|
125
|
+
if (stringValue.path.length === 1 && typeof segment === "object" && segment !== null && "index" in segment) {
|
|
126
|
+
value["string"] = segment.index;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const stage = plainUnknownObject(condition["stage"]);
|
|
131
|
+
if (stage !== undefined && stage["stageId"] !== undefined) {
|
|
132
|
+
const key = stageKey(stage["stageId"], owner);
|
|
133
|
+
if (key !== undefined)
|
|
134
|
+
stage["stage"] = key;
|
|
135
|
+
delete stage["stageId"];
|
|
136
|
+
}
|
|
137
|
+
out[id] = condition;
|
|
138
|
+
}
|
|
139
|
+
return out;
|
|
140
|
+
}
|
|
141
|
+
function saveGroupMap(values, owner, ctx, where) {
|
|
142
|
+
const out = {};
|
|
143
|
+
for (const [id, raw] of Object.entries(values)) {
|
|
144
|
+
const group = camelObject(plainObject(raw) ?? {});
|
|
145
|
+
if (Array.isArray(group["fieldIds"])) {
|
|
146
|
+
group["fields"] = group["fieldIds"].flatMap((v) => {
|
|
147
|
+
const key = fieldKey(v, owner, ctx, `${where}.saveGroups.${id}`);
|
|
148
|
+
return key === undefined ? [] : [key];
|
|
149
|
+
});
|
|
150
|
+
delete group["fieldIds"];
|
|
151
|
+
}
|
|
152
|
+
if (Array.isArray(group["validations"])) {
|
|
153
|
+
group["validations"] = group["validations"].map((v, i) => fieldValidation(plainUnknownObject(v) ?? {}, owner, ctx, `${where}.saveGroups.${id}.validations[${i}]`));
|
|
154
|
+
}
|
|
155
|
+
out[id] = group;
|
|
156
|
+
}
|
|
157
|
+
return out;
|
|
158
|
+
}
|
|
159
|
+
function fieldValidation(value, owner, ctx, where) {
|
|
160
|
+
const out = camelObject(value);
|
|
161
|
+
if (out["fieldId"] !== undefined)
|
|
162
|
+
out["field"] = fieldKey(out["fieldId"], owner, ctx, where);
|
|
163
|
+
delete out["fieldId"];
|
|
164
|
+
return out;
|
|
165
|
+
}
|
|
166
|
+
function dependency(value, owner, ctx, where) {
|
|
167
|
+
const out = camelObject(value);
|
|
168
|
+
if (out["sourceFieldId"] !== undefined)
|
|
169
|
+
out["sourceField"] = fieldKey(out["sourceFieldId"], owner, ctx, where);
|
|
170
|
+
if (out["targetFieldId"] !== undefined)
|
|
171
|
+
out["targetField"] = fieldKey(out["targetFieldId"], owner, ctx, where);
|
|
172
|
+
delete out["sourceFieldId"];
|
|
173
|
+
delete out["targetFieldId"];
|
|
174
|
+
return out;
|
|
175
|
+
}
|
|
176
|
+
function fieldKey(value, owner, ctx, where) {
|
|
177
|
+
const key = fieldKeyFromTfRef(value, owner.ownerTfLabel, "app");
|
|
178
|
+
if (key === undefined)
|
|
179
|
+
ctx.diagnostics.push(`${where}: field reference is not resolvable; dropped`);
|
|
180
|
+
return key;
|
|
181
|
+
}
|
|
182
|
+
function stageKey(value, owner) {
|
|
183
|
+
if (value === undefined || !isTfExpr(value))
|
|
184
|
+
return undefined;
|
|
185
|
+
if (value.$expr === "resource-attr" && value.type === owner.type && value.label === owner.label && value.path[0] === "stage_ids_by_key") {
|
|
186
|
+
const segment = value.path[1];
|
|
187
|
+
if (value.path.length === 2 && typeof segment === "object" && segment !== null && "index" in segment)
|
|
188
|
+
return tfLabelToTsLabel(segment.index);
|
|
189
|
+
}
|
|
190
|
+
if (value.$expr === "local" && value.name === `${owner.ownerTfLabel}_stage_ids_by_key`) {
|
|
191
|
+
const segment = value.path[0];
|
|
192
|
+
if (value.path.length === 1 && typeof segment === "object" && segment !== null && "index" in segment)
|
|
193
|
+
return tfLabelToTsLabel(segment.index);
|
|
194
|
+
}
|
|
195
|
+
return undefined;
|
|
196
|
+
}
|
|
197
|
+
function aspectRef(value, owner, ctx) {
|
|
198
|
+
if (resourceRefLabel(value, owner.type) === owner.label)
|
|
199
|
+
return pulledRef("app", owner.ownerRefName);
|
|
200
|
+
for (const [type, kind] of [["elementum_app", "app"], ["elementum_element", "element"]]) {
|
|
201
|
+
const resourceLabel = resourceRefLabel(value, type);
|
|
202
|
+
if (resourceLabel !== undefined)
|
|
203
|
+
return pulledRef(kind, tfLabelToTsLabel(resourceLabel));
|
|
204
|
+
const dataLabel = dataRefLabel(value, type);
|
|
205
|
+
if (dataLabel !== undefined)
|
|
206
|
+
return pulledRef(kind, tfLabelToTsLabel(dataLabel), undefined, ctx.dataName(type, dataLabel));
|
|
207
|
+
}
|
|
208
|
+
return undefined;
|
|
209
|
+
}
|
|
210
|
+
function pulledRef(kind, key, parent, name) {
|
|
211
|
+
return { __pulledRef: kind, key, ...(parent !== undefined && { parent }), ...(name !== undefined && { name }) };
|
|
212
|
+
}
|
|
213
|
+
function camelObject(value) {
|
|
214
|
+
const out = {};
|
|
215
|
+
for (const [key, child] of Object.entries(value))
|
|
216
|
+
out[camelKey(key)] = camelValue(child);
|
|
217
|
+
return out;
|
|
218
|
+
}
|
|
219
|
+
function camelValue(value) {
|
|
220
|
+
if (Array.isArray(value))
|
|
221
|
+
return value.map(camelValue);
|
|
222
|
+
if (isTfExpr(value) || value === null || typeof value !== "object")
|
|
223
|
+
return value;
|
|
224
|
+
return camelObject(value);
|
|
225
|
+
}
|
|
226
|
+
function camelKey(value) {
|
|
227
|
+
return value.replace(/_([a-z])/g, (_, char) => char.toUpperCase());
|
|
228
|
+
}
|
|
229
|
+
function plainUnknownObject(value) {
|
|
230
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) && !isTfExpr(value)
|
|
231
|
+
? value
|
|
232
|
+
: undefined;
|
|
233
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NO_CANVAS, NO_CATALOG, NO_DATA, NO_LIFECYCLE } from "../../graph/types.js";
|
|
2
|
+
export const DYNAMIC_LAYOUT_RESOURCE_TYPE = "elementum_dynamic_layout";
|
|
3
|
+
export const dynamicLayoutModule = {
|
|
4
|
+
kind: "dynamic-layout",
|
|
5
|
+
stream: { role: "streamMember" },
|
|
6
|
+
authoring: { unit: "inline", bag: "dynamicLayouts" },
|
|
7
|
+
parents: [{ parent: "app", child: "dynamic-layout" }],
|
|
8
|
+
resource: { shape: "single", resourceType: DYNAMIC_LAYOUT_RESOURCE_TYPE, adoptable: true },
|
|
9
|
+
data: NO_DATA,
|
|
10
|
+
lifecycle: NO_LIFECYCLE,
|
|
11
|
+
canvas: NO_CANVAS,
|
|
12
|
+
catalog: NO_CATALOG,
|
|
13
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { OrgRefLookup, WorkspaceAspect } from "../../engine/build/context.js";
|
|
2
|
+
import { type TfBlock, type TfValue } from "../../engine/tf/index.js";
|
|
3
|
+
export interface DynamicLayoutWire {
|
|
4
|
+
readonly name?: string;
|
|
5
|
+
readonly description?: string;
|
|
6
|
+
readonly active?: boolean;
|
|
7
|
+
readonly stage?: string;
|
|
8
|
+
readonly documentId?: string;
|
|
9
|
+
readonly documentVersion?: string;
|
|
10
|
+
readonly rootComponent?: string;
|
|
11
|
+
readonly components?: Readonly<Record<string, Record<string, unknown>>>;
|
|
12
|
+
readonly conditions?: Readonly<Record<string, Record<string, unknown>>>;
|
|
13
|
+
readonly saveGroups?: Readonly<Record<string, Record<string, unknown>>>;
|
|
14
|
+
readonly fieldValidations?: readonly Record<string, unknown>[];
|
|
15
|
+
readonly dependencies?: readonly Record<string, unknown>[];
|
|
16
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
17
|
+
}
|
|
18
|
+
export interface DynamicLayoutToTfOptions {
|
|
19
|
+
readonly ownerRefName: string;
|
|
20
|
+
readonly ownerTfLabel: string;
|
|
21
|
+
readonly objectId: TfValue;
|
|
22
|
+
readonly diagnostics: string[];
|
|
23
|
+
readonly orgRefs: OrgRefLookup;
|
|
24
|
+
readonly workspaceAspects?: ReadonlyMap<string, WorkspaceAspect>;
|
|
25
|
+
}
|
|
26
|
+
export declare function dynamicLayoutsToTf(layouts: Readonly<Record<string, DynamicLayoutWire>> | undefined, opts: DynamicLayoutToTfOptions): TfBlock[];
|