@elementumai/edk 0.8.2-alpha.5 → 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
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
import { EntityTfError } from "../../engine/entity.js";
|
|
7
7
|
import { expr } from "../../engine/tf/index.js";
|
|
8
8
|
import { accessPolicyToTf } from "../access-policy/to-tf.js";
|
|
9
|
+
import { dashboardsToTf } from "../dashboard/to-tf.js";
|
|
9
10
|
import { fieldToTf } from "../field/to-tf.js";
|
|
10
11
|
import { CATEGORY_ORG_BAG } from "../org/category.js";
|
|
11
12
|
import { CLOUD_LINK_ORG_BAG } from "../org/cloud-link.js";
|
|
13
|
+
import { recordCreateFormToTf } from "../record-create-form/to-tf.js";
|
|
14
|
+
import { relationshipsToTf } from "../relationship/to-tf.js";
|
|
15
|
+
import { rolesToTf } from "../role/to-tf.js";
|
|
16
|
+
import { widgetsToTf } from "../widget/to-tf.js";
|
|
12
17
|
import { viewToTf } from "../view/to-tf.js";
|
|
13
18
|
import { ELEMENT_RESOURCE_TYPE } from "./module.js";
|
|
14
19
|
/** System-field tags that fold into the element resource (no field resource). */
|
|
@@ -143,14 +148,57 @@ export function elementToTf(entity, ctx) {
|
|
|
143
148
|
blocks.push(field.block);
|
|
144
149
|
fieldAddresses.set(field.bagKey, field.address);
|
|
145
150
|
}
|
|
146
|
-
|
|
151
|
+
blocks.push(...dashboardsToTf(payload.dashboards, {
|
|
152
|
+
ownerTfLabel: ctx.appTfLabel,
|
|
153
|
+
scope: "element",
|
|
154
|
+
ownerType: "ELEMENT_ASPECT",
|
|
155
|
+
ownerId: objectId,
|
|
156
|
+
ownerRefName: ctx.appRefName,
|
|
157
|
+
ownerResourceType: ELEMENT_RESOURCE_TYPE,
|
|
158
|
+
orgRefs: ctx.orgRefs,
|
|
159
|
+
workspaceAspects: ctx.workspaceAspects,
|
|
160
|
+
diagnostics: ctx.diagnostics,
|
|
161
|
+
}));
|
|
162
|
+
blocks.push(...widgetsToTf(payload.widgets, {
|
|
163
|
+
ownerRefName: ctx.appRefName,
|
|
164
|
+
ownerTfLabel: ctx.appTfLabel,
|
|
165
|
+
ownerType: ELEMENT_RESOURCE_TYPE,
|
|
166
|
+
scope: "element",
|
|
167
|
+
objectId,
|
|
168
|
+
orgRefs: ctx.orgRefs,
|
|
169
|
+
workspaceAspects: ctx.workspaceAspects,
|
|
170
|
+
diagnostics: ctx.diagnostics,
|
|
171
|
+
}));
|
|
172
|
+
const { blocks: viewBlocks } = viewToTf(payload.layouts, payload.listViews, payload.calendarViews, payload.kanbanViews, payload.dashboardViews, undefined, payload.viewOrder, {
|
|
173
|
+
ownerRefName: ctx.appRefName,
|
|
147
174
|
ownerTfLabel: ctx.appTfLabel,
|
|
148
175
|
scope: "element",
|
|
149
176
|
aspectName: payload.name ?? "",
|
|
150
177
|
objectId,
|
|
178
|
+
dashboardKeys: new Set(Object.keys(payload.dashboards ?? {})),
|
|
179
|
+
orgRefs: ctx.orgRefs,
|
|
151
180
|
diagnostics: ctx.diagnostics,
|
|
152
181
|
});
|
|
153
182
|
blocks.push(...viewBlocks);
|
|
183
|
+
const recordCreateForm = recordCreateFormToTf(payload.recordCreateForm, {
|
|
184
|
+
ownerRefName: ctx.appRefName,
|
|
185
|
+
ownerTfLabel: ctx.appTfLabel,
|
|
186
|
+
scope: "element",
|
|
187
|
+
objectId,
|
|
188
|
+
diagnostics: ctx.diagnostics,
|
|
189
|
+
});
|
|
190
|
+
if (recordCreateForm !== undefined)
|
|
191
|
+
blocks.push(recordCreateForm);
|
|
192
|
+
blocks.push(...relationshipsToTf(payload.relationships, {
|
|
193
|
+
ownerRefName: ctx.appRefName,
|
|
194
|
+
ownerTfLabel: ctx.appTfLabel,
|
|
195
|
+
ownerType: "elementum_element",
|
|
196
|
+
scope: "element",
|
|
197
|
+
objectId,
|
|
198
|
+
orgRefs: ctx.orgRefs,
|
|
199
|
+
workspaceAspects: ctx.workspaceAspects,
|
|
200
|
+
diagnostics: ctx.diagnostics,
|
|
201
|
+
}));
|
|
154
202
|
// Authored entries only. Creating an element also has the platform mint a
|
|
155
203
|
// creator policy (userIds = [you]) that is NOT in this payload — pull
|
|
156
204
|
// will see it; we never emit it here.
|
|
@@ -164,6 +212,14 @@ export function elementToTf(entity, ctx) {
|
|
|
164
212
|
});
|
|
165
213
|
blocks.push(block);
|
|
166
214
|
}
|
|
215
|
+
blocks.push(...rolesToTf(payload.roles, {
|
|
216
|
+
ownerRefName: ctx.appRefName,
|
|
217
|
+
ownerTfLabel: ctx.appTfLabel,
|
|
218
|
+
scope: "element",
|
|
219
|
+
objectId,
|
|
220
|
+
orgRefs: ctx.orgRefs,
|
|
221
|
+
diagnostics: ctx.diagnostics,
|
|
222
|
+
}));
|
|
167
223
|
blocks.unshift({
|
|
168
224
|
kind: "resource",
|
|
169
225
|
type: ELEMENT_RESOURCE_TYPE,
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
* AppField is accepted.
|
|
16
16
|
*/
|
|
17
17
|
import type { AppField, AppPicklistConfig, PicklistOption } from "../app/build.js";
|
|
18
|
-
import type {
|
|
18
|
+
import type { AppOrElementRef, FieldRef } from "../../catalog/index.js";
|
|
19
19
|
import type { Expr, ExprType } from "./calc/types.js";
|
|
20
|
+
import type { UnsafePlatformId } from "../../core/platform-id.js";
|
|
20
21
|
/** Options every field kind accepts (everything on {@link AppField} that isn't kind-specific). */
|
|
21
22
|
export interface BaseFieldOptions {
|
|
22
23
|
readonly name: string;
|
|
@@ -65,8 +66,8 @@ export interface TextFieldOptions extends BaseFieldOptions {
|
|
|
65
66
|
* workspace needs that.
|
|
66
67
|
*/
|
|
67
68
|
export interface RelationFieldOptions extends BaseFieldOptions {
|
|
68
|
-
readonly relatedObject:
|
|
69
|
-
readonly relatedLabelField: FieldRef |
|
|
69
|
+
readonly relatedObject: AppOrElementRef | UnsafePlatformId;
|
|
70
|
+
readonly relatedLabelField: FieldRef | UnsafePlatformId;
|
|
70
71
|
/** Defaults to `true` on the platform. */
|
|
71
72
|
readonly autoRelate?: boolean;
|
|
72
73
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ExprType } from "./calc/types.js";
|
|
2
|
+
export declare const CALCULATION_RESULT_TYPES: readonly ["ATTACHMENT_ID", "BOOLEAN", "DATE", "DATETIME", "DECIMAL", "GROUP_ID", "HANDLE", "HTML", "JSON", "MULTI_PICKLIST", "NUMBER", "PICKLIST", "TEXT", "USER_ID"];
|
|
3
|
+
export type CalculationResultType = (typeof CALCULATION_RESULT_TYPES)[number];
|
|
4
|
+
export declare function isCalculationResultType(value: unknown): value is CalculationResultType;
|
|
5
|
+
export declare function calculationAuthoringType(type: CalculationResultType): string;
|
|
6
|
+
export declare function calculationExprType(type: CalculationResultType): ExprType;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const CALCULATION_RESULT_TYPES = [
|
|
2
|
+
"ATTACHMENT_ID",
|
|
3
|
+
"BOOLEAN",
|
|
4
|
+
"DATE",
|
|
5
|
+
"DATETIME",
|
|
6
|
+
"DECIMAL",
|
|
7
|
+
"GROUP_ID",
|
|
8
|
+
"HANDLE",
|
|
9
|
+
"HTML",
|
|
10
|
+
"JSON",
|
|
11
|
+
"MULTI_PICKLIST",
|
|
12
|
+
"NUMBER",
|
|
13
|
+
"PICKLIST",
|
|
14
|
+
"TEXT",
|
|
15
|
+
"USER_ID",
|
|
16
|
+
];
|
|
17
|
+
const RESULT_TYPE_SET = new Set(CALCULATION_RESULT_TYPES);
|
|
18
|
+
export function isCalculationResultType(value) {
|
|
19
|
+
return typeof value === "string" && RESULT_TYPE_SET.has(value);
|
|
20
|
+
}
|
|
21
|
+
export function calculationAuthoringType(type) {
|
|
22
|
+
switch (type) {
|
|
23
|
+
case "ATTACHMENT_ID": return "ATTACHMENT";
|
|
24
|
+
case "GROUP_ID": return "GROUP";
|
|
25
|
+
case "USER_ID": return "USER";
|
|
26
|
+
default: return type;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function calculationExprType(type) {
|
|
30
|
+
switch (type) {
|
|
31
|
+
case "ATTACHMENT_ID": return "attachment";
|
|
32
|
+
case "BOOLEAN": return "bool";
|
|
33
|
+
case "GROUP_ID": return "group";
|
|
34
|
+
case "HANDLE":
|
|
35
|
+
case "HTML":
|
|
36
|
+
case "TEXT": return "text";
|
|
37
|
+
case "MULTI_PICKLIST":
|
|
38
|
+
case "PICKLIST": return "picklist";
|
|
39
|
+
case "USER_ID": return "user";
|
|
40
|
+
default: return type.toLowerCase();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -6,9 +6,12 @@
|
|
|
6
6
|
* import blocks and stay data-side.
|
|
7
7
|
*/
|
|
8
8
|
import { EntityTfError } from "../../engine/entity.js";
|
|
9
|
+
import { SYSTEM_FIELD_KEY_SET } from "../../core/system-fields.js";
|
|
9
10
|
import { dataRefLabel, optionalString, resourceRefLabel } from "../../engine/pull/context.js";
|
|
10
11
|
import { bareChildResourceLabel, isTfExpr, scopedLabelToBagKey, tfLabelToTsLabel } from "../../engine/tf/index.js";
|
|
12
|
+
import { __pulledExpression } from "../app/deserializer/pulled-expression.js";
|
|
11
13
|
import { optionsFromTf } from "./options.js";
|
|
14
|
+
import { isCalculationResultType } from "./calculation-types.js";
|
|
12
15
|
import { KNOWN_FIELD_ATTRS, SUB_TYPE_BY_RESOURCE } from "./types.js";
|
|
13
16
|
/**
|
|
14
17
|
* A related_object_id/related_label_field_id value → its raw platform id, if
|
|
@@ -27,6 +30,53 @@ function resolveRelatedId(v, ctx) {
|
|
|
27
30
|
}
|
|
28
31
|
return undefined;
|
|
29
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* `related_object_id` specifically (not `related_label_field_id`, which
|
|
35
|
+
* names a field and has no equivalent name-based recovery) gets one more
|
|
36
|
+
* fallback beyond `resolveRelatedId`: a `data.elementum_app.<label>` /
|
|
37
|
+
* `data.elementum_element.<label>` foreign lookup carries no raw id, but the
|
|
38
|
+
* data block's own `name = "..."` filter attribute (read via `ctx.dataName`)
|
|
39
|
+
* IS the target's real display name - the same name `readAppNameMap`/
|
|
40
|
+
* `readElementNameMap` index every already-pulled app/element by. When that
|
|
41
|
+
* name matches one already in this workspace, resolve straight to a typed
|
|
42
|
+
* `AppOrElementRef` instead of giving up - the reference then survives a
|
|
43
|
+
* build exactly like a hand-authored `catalog.<ref>` would (see
|
|
44
|
+
* agent-tool/from-tf.ts's `NormalizedToolTarget` for the same foreign-name
|
|
45
|
+
* convention on tool targets). No match (the target isn't pulled into this
|
|
46
|
+
* workspace yet, or `ctx` wasn't wired with the name maps) records the name
|
|
47
|
+
* on `ctx.unresolvedForeignRefs` (when the caller wired it up) so
|
|
48
|
+
* `--with-dependencies` can chase it down and pulls it as a workspace app/
|
|
49
|
+
* element the same way it already does for agent-tool/automation targets —
|
|
50
|
+
* then stays unresolvable this pull, same as before.
|
|
51
|
+
*/
|
|
52
|
+
function resolveRelatedObject(v, ctx) {
|
|
53
|
+
const raw = resolveRelatedId(v, ctx);
|
|
54
|
+
if (raw !== undefined)
|
|
55
|
+
return raw;
|
|
56
|
+
if (v === undefined || !isTfExpr(v) || v.$expr !== "data-attr")
|
|
57
|
+
return undefined;
|
|
58
|
+
if (v.type === "elementum_app") {
|
|
59
|
+
const name = ctx.dataName("elementum_app", v.label);
|
|
60
|
+
if (name === undefined)
|
|
61
|
+
return undefined;
|
|
62
|
+
const refName = ctx.foreignAppRefNames?.get(name);
|
|
63
|
+
if (refName !== undefined)
|
|
64
|
+
return { __kind: "app", refName, name };
|
|
65
|
+
ctx.unresolvedForeignRefs?.apps.add(name);
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
if (v.type === "elementum_element") {
|
|
69
|
+
const name = ctx.dataName("elementum_element", v.label);
|
|
70
|
+
if (name === undefined)
|
|
71
|
+
return undefined;
|
|
72
|
+
const refName = ctx.foreignElementRefNames?.get(name);
|
|
73
|
+
if (refName !== undefined)
|
|
74
|
+
return { __kind: "element", refName, name };
|
|
75
|
+
ctx.unresolvedForeignRefs?.elements.add(name);
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
30
80
|
/**
|
|
31
81
|
* One field block → its normalized entry; undefined = skipped with a
|
|
32
82
|
* diagnostic (unknown resource type, or a field belonging to a different
|
|
@@ -87,20 +137,25 @@ export function fieldFromTf(block, owner, ctx) {
|
|
|
87
137
|
// `resource-attr` expressions whose target carries its own import block in
|
|
88
138
|
// this stream, so the raw id IS recoverable - via the same `ctx.importId`
|
|
89
139
|
// lookup adoption itself uses, keyed by the referenced resource's address,
|
|
90
|
-
// not this field's own.
|
|
91
|
-
//
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
//
|
|
98
|
-
//
|
|
140
|
+
// not this field's own. A THIRD shape - a `data-attr` foreign lookup
|
|
141
|
+
// (`data.elementum_element.<label>.id`, e.g. when another own-file child
|
|
142
|
+
// in the same app also targets it, so ei's beautifier shares one `data`
|
|
143
|
+
// block instead of repeating the raw id) - carries no raw id either, but
|
|
144
|
+
// `resolveRelatedObject` recovers it by name via the stream's own data
|
|
145
|
+
// block + this workspace's already-pulled apps/elements (see its doc
|
|
146
|
+
// comment). What's genuinely NOT recoverable: that same data-attr lookup
|
|
147
|
+
// when the target isn't pulled into this workspace yet, or a `local`
|
|
148
|
+
// computed attribute (`local.<app>_id_field_id` - an app/element's system
|
|
149
|
+
// field ids are read-only outputs of that resource, never their own
|
|
150
|
+
// resource address). Both properties are required by RelationFieldOptions,
|
|
151
|
+
// so printing relationField(...) with either missing would be invalid
|
|
152
|
+
// TypeScript (item 117) - skip the whole field when either side can't be
|
|
153
|
+
// resolved, same convention as an unimplemented sub-type.
|
|
99
154
|
let relatedObject;
|
|
100
155
|
let relatedLabelField;
|
|
101
156
|
let autoRelate;
|
|
102
157
|
if (subType.hasRelation === true) {
|
|
103
|
-
relatedObject =
|
|
158
|
+
relatedObject = resolveRelatedObject(attrs["related_object_id"], ctx);
|
|
104
159
|
relatedLabelField = resolveRelatedId(attrs["related_label_field_id"], ctx);
|
|
105
160
|
if (typeof attrs["auto_relate"] === "boolean")
|
|
106
161
|
autoRelate = attrs["auto_relate"];
|
|
@@ -140,12 +195,26 @@ export function fieldFromTf(block, owner, ctx) {
|
|
|
140
195
|
}
|
|
141
196
|
}
|
|
142
197
|
const scope = owner.scope ?? "app";
|
|
198
|
+
const calculation = subType.typeKey === "calculated" ? optionalString(attrs, "calculation", where, ctx) : undefined;
|
|
199
|
+
if (subType.typeKey === "calculated" && calculation === undefined) {
|
|
200
|
+
ctx.skipped.push(`${block.type}.${fieldLabel}`);
|
|
201
|
+
ctx.diagnostics.push(`${where}: calculation is required; skipped`);
|
|
202
|
+
return undefined;
|
|
203
|
+
}
|
|
204
|
+
const calculationType = subType.typeKey === "calculated" ? attrs["calculation_type"] : undefined;
|
|
205
|
+
if (subType.typeKey === "calculated" && !isCalculationResultType(calculationType)) {
|
|
206
|
+
ctx.skipped.push(`${block.type}.${fieldLabel}`);
|
|
207
|
+
ctx.diagnostics.push(`${where}: calculation_type is missing or unsupported; skipped rather than guessing the typed result`);
|
|
208
|
+
return undefined;
|
|
209
|
+
}
|
|
143
210
|
return {
|
|
144
211
|
key: scopedLabelToBagKey(owner.label, fieldLabel, scope),
|
|
212
|
+
...(isCalculationResultType(calculationType) && { calculationType }),
|
|
145
213
|
field: {
|
|
146
214
|
id: ctx.importId(`${block.type}.${fieldLabel}`) ?? "",
|
|
147
215
|
name: fieldName,
|
|
148
216
|
type: subType.authoringType,
|
|
217
|
+
...(calculation !== undefined && { expression: __pulledExpression(calculation) }),
|
|
149
218
|
// Only true flags are carried into authoring — false is the platform
|
|
150
219
|
// default and stays unwritten (build re-emits explicit false; ei's
|
|
151
220
|
// export does the same, so the build-vs-export sees both sides as false).
|
|
@@ -175,7 +244,17 @@ export function fieldFromTf(block, owner, ctx) {
|
|
|
175
244
|
* unknown resource type.
|
|
176
245
|
*/
|
|
177
246
|
export function fieldKeyFromTfRef(v, ownerTfLabel, scope = "app") {
|
|
178
|
-
if (!isTfExpr(v)
|
|
247
|
+
if (!isTfExpr(v))
|
|
248
|
+
return undefined;
|
|
249
|
+
if (v.$expr === "local" && ownerTfLabel !== undefined && v.path.length === 0) {
|
|
250
|
+
const prefix = `${ownerTfLabel}_`;
|
|
251
|
+
if (v.name.startsWith(prefix) && v.name.endsWith("_field_id")) {
|
|
252
|
+
const key = tfLabelToTsLabel(v.name.slice(prefix.length, -"_field_id".length));
|
|
253
|
+
if (SYSTEM_FIELD_KEY_SET.has(key))
|
|
254
|
+
return key;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
if (v.$expr !== "resource-attr" || v.path.length !== 1 || v.path[0] !== "id")
|
|
179
258
|
return undefined;
|
|
180
259
|
if (!SUB_TYPE_BY_RESOURCE.has(v.type))
|
|
181
260
|
return undefined;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/** The field entity's registry entry (see src/graph/). */
|
|
2
2
|
import { rootParentFactoryEntry } from "../../catalog/render-helpers.js";
|
|
3
|
-
import {
|
|
3
|
+
import { NO_LIFECYCLE } from "../../graph/types.js";
|
|
4
4
|
import { FIELD_SUB_TYPES } from "./types.js";
|
|
5
|
+
export const FIELD_DATA_RESOURCE_TYPE = "elementum_field";
|
|
5
6
|
export const fieldModule = {
|
|
6
7
|
kind: "field",
|
|
7
8
|
stream: { role: "streamMember" },
|
|
@@ -18,7 +19,9 @@ export const fieldModule = {
|
|
|
18
19
|
implemented: t.implemented === true,
|
|
19
20
|
})),
|
|
20
21
|
},
|
|
21
|
-
|
|
22
|
+
// Foreign relationship/relation fields are looked up by name under their
|
|
23
|
+
// owning object (`object_id` is recorded by OrgRefLookup.foreignField).
|
|
24
|
+
data: { participates: true, resourceType: FIELD_DATA_RESOURCE_TYPE, lookupAttr: "name", referencedByBuild: true },
|
|
22
25
|
lifecycle: NO_LIFECYCLE,
|
|
23
26
|
canvas: { participates: true, label: "Fields", glyph: "▾", component: "fieldCard" },
|
|
24
27
|
// Inline under app — from-authoring still reads fields from app.ref(); this
|
|
@@ -21,7 +21,7 @@ import type { Attachment, Group, PicklistValue, RichText, User } from "../shared
|
|
|
21
21
|
export type FieldValueType<FieldType extends string> = FieldType extends "NUMBER" | "DECIMAL" ? number : FieldType extends "BOOLEAN" ? boolean : FieldType extends "JSON" | "OBJECT" ? unknown : FieldType extends "PICKLIST" | "PICKLIST_ID" ? PicklistValue : FieldType extends "MULTI_PICKLIST" | "MULTI_PICKLIST_ID" ? readonly PicklistValue[] : FieldType extends "ATTACHMENT" | "ATTACHMENT_ID" | "FILE" ? Attachment : FieldType extends "RICH_TEXT" ? RichText : FieldType extends "USER" | "USER_ID" ? User : FieldType extends "GROUP" | "GROUP_ID" ? Group : string;
|
|
22
22
|
/**
|
|
23
23
|
* Extract the `fields` bag off an app/element-like ref, e.g. `typeof catalog.myApp`.
|
|
24
|
-
* `undefined` when the ref carries no `fields` bag (a hand-built `
|
|
24
|
+
* `undefined` when the ref carries no `fields` bag (a hand-built `AppOrElementRef`
|
|
25
25
|
* literal, or a ref kind — like a search table — that isn't field-typed yet).
|
|
26
26
|
*/
|
|
27
27
|
export type AppFieldsOf<A> = A extends {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import { type OrgRefLookup, type WorkspaceAspect } from "../../engine/build/context.js";
|
|
13
13
|
import { type ChildResourceScope, type TfBlock, type TfExpr, type TfValue } from "../../engine/tf/index.js";
|
|
14
14
|
import { type PicklistValueWire } from "./options.js";
|
|
15
|
-
/** Slim `
|
|
15
|
+
/** Slim `AppOrElementRef` token shape as it appears in a def() payload (post-`slimTokens`). */
|
|
16
16
|
interface AspectTokenWire {
|
|
17
17
|
readonly __kind?: string;
|
|
18
18
|
readonly refName?: string;
|
|
@@ -24,7 +24,7 @@ function asOrgFieldRef(v) {
|
|
|
24
24
|
/**
|
|
25
25
|
* `relatedObject` (RELATION fields only) → its `related_object_id` value. A
|
|
26
26
|
* raw string passes through literally (unchanged, backward-compatible
|
|
27
|
-
* behavior). An `
|
|
27
|
+
* behavior). An `AppOrElementRef` token resolves, in order:
|
|
28
28
|
* 1. self (names the owner itself) — reuses the already-resolved `objectId`;
|
|
29
29
|
* 2. a SIBLING stream root in this same build (`opts.workspaceAspects`,
|
|
30
30
|
* keyed by kind+refName since an app and an element MAY share a
|
|
@@ -97,6 +97,12 @@ function resolveRelatedLabelField(token, object, opts, where) {
|
|
|
97
97
|
return undefined;
|
|
98
98
|
}
|
|
99
99
|
if (object.target !== undefined) {
|
|
100
|
+
// A field belongs to an app or element; a table exposes columns, not fields.
|
|
101
|
+
// Guard rather than widen fieldRefToTfValue's scope parameter.
|
|
102
|
+
if (object.target.kind === "table") {
|
|
103
|
+
opts.diagnostics.push(`${where}: relatedLabelField token "${refName}" resolves to table "${object.target.tfLabel}" — tables expose columns, not fields; dropped`);
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
100
106
|
const value = fieldRefToTfValue(token.fieldType ?? "", refName, object.target.tfLabel, object.target.kind);
|
|
101
107
|
if (value === undefined) {
|
|
102
108
|
opts.diagnostics.push(`${where}: relatedLabelField token "${refName}" has no terraform field resource mapping (fieldType ${JSON.stringify(token.fieldType ?? "")}); dropped`);
|
|
@@ -117,10 +123,6 @@ function resolveRelatedLabelField(token, object, opts, where) {
|
|
|
117
123
|
export function fieldToTf(typeKey, inner, opts) {
|
|
118
124
|
const { ownerTfLabel, scope = "app", objectId, diagnostics } = opts;
|
|
119
125
|
const name = inner.name ?? "";
|
|
120
|
-
if (typeKey === "calculated" || inner.calculation !== undefined) {
|
|
121
|
-
diagnostics.push(`field "${name}": calculated fields are not supported on the terraform path yet; dropped`);
|
|
122
|
-
return undefined;
|
|
123
|
-
}
|
|
124
126
|
if (inner.config !== undefined) {
|
|
125
127
|
diagnostics.push(`field "${name}": dependent/dynamic picklist config is not supported by the terraform provider yet; dropped`);
|
|
126
128
|
return undefined;
|
|
@@ -153,11 +155,25 @@ export function fieldToTf(typeKey, inner, opts) {
|
|
|
153
155
|
attrs["required_on_close"] = inner.requiredOnClose ?? false;
|
|
154
156
|
attrs["show_on_create"] = inner.showOnCreate ?? false;
|
|
155
157
|
attrs["lock_on_create"] = inner.lockOnCreate ?? false;
|
|
158
|
+
if (subType.typeKey === "calculated") {
|
|
159
|
+
const calculation = inner.calculation;
|
|
160
|
+
if (typeof calculation !== "object" ||
|
|
161
|
+
calculation === null ||
|
|
162
|
+
!("text" in calculation) ||
|
|
163
|
+
typeof calculation.text !== "string") {
|
|
164
|
+
diagnostics.push(`field "${name}": calculated fields require a serialized calculation expression; dropped`);
|
|
165
|
+
return undefined;
|
|
166
|
+
}
|
|
167
|
+
attrs["calculation"] = calculation.text;
|
|
168
|
+
}
|
|
156
169
|
if (inner.description !== undefined)
|
|
157
170
|
attrs["description"] = inner.description;
|
|
158
171
|
if (inner.columnName !== undefined)
|
|
159
172
|
attrs["column_name"] = inner.columnName;
|
|
160
|
-
if (inner.defaultValue !== undefined) {
|
|
173
|
+
if (subType.typeKey === "calculated" && inner.defaultValue !== undefined) {
|
|
174
|
+
diagnostics.push(`field "${name}": calculated fields do not support defaultValue; dropped`);
|
|
175
|
+
}
|
|
176
|
+
if (subType.typeKey !== "calculated" && inner.defaultValue !== undefined) {
|
|
161
177
|
const orgRef = asOrgFieldRef(inner.defaultValue);
|
|
162
178
|
if (orgRef !== undefined) {
|
|
163
179
|
if (opts.orgRefs === undefined) {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* this directory (the automation task/ pattern).
|
|
8
8
|
*/
|
|
9
9
|
export const FIELD_SUB_TYPES = [
|
|
10
|
+
{ typeKey: "calculated", resourceType: "elementum_calculated_field", authoringType: "CALCULATED", implemented: true },
|
|
10
11
|
{ typeKey: "text", resourceType: "elementum_text_field", authoringType: "TEXT", implemented: true },
|
|
11
12
|
{ typeKey: "html", resourceType: "elementum_longtext_field", authoringType: "HTML", implemented: true },
|
|
12
13
|
{ typeKey: "number", resourceType: "elementum_number_field", authoringType: "NUMBER", implemented: true },
|
|
@@ -65,4 +66,6 @@ export const KNOWN_FIELD_ATTRS = new Set([
|
|
|
65
66
|
"related_label_field_id",
|
|
66
67
|
"auto_relate",
|
|
67
68
|
"decimal_places",
|
|
69
|
+
"calculation",
|
|
70
|
+
"calculation_type",
|
|
68
71
|
]);
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* referenced it) — this is a from-scratch terraform-facing builder, not a
|
|
10
10
|
* migration of the old one.
|
|
11
11
|
*/
|
|
12
|
-
import type { FileReaderCatalogRef } from "../../catalog/index.js";
|
|
12
|
+
import type { AppOrElementRef, FileReaderCatalogRef } from "../../catalog/index.js";
|
|
13
13
|
import type { DeployableEntity, EntityDeployOptions } from "../../engine/entity.js";
|
|
14
14
|
/**
|
|
15
15
|
* A field in a JSON/XML file reader's structure tree. `object`/`array` nest
|
|
@@ -45,6 +45,17 @@ export type JsonStructureField = {
|
|
|
45
45
|
readonly name: string;
|
|
46
46
|
readonly itemType: JsonStructureField;
|
|
47
47
|
};
|
|
48
|
+
/** Typed constructors for JSON/XML structure nodes. Avoids authoring wire discriminant strings. */
|
|
49
|
+
export declare const fileReaderStructure: {
|
|
50
|
+
readonly text: (name: string) => JsonStructureField;
|
|
51
|
+
readonly number: (name: string) => JsonStructureField;
|
|
52
|
+
readonly decimal: (name: string) => JsonStructureField;
|
|
53
|
+
readonly boolean: (name: string) => JsonStructureField;
|
|
54
|
+
readonly date: (name: string, format: string) => JsonStructureField;
|
|
55
|
+
readonly datetime: (name: string, format: string) => JsonStructureField;
|
|
56
|
+
readonly object: (name: string, properties: readonly JsonStructureField[]) => JsonStructureField;
|
|
57
|
+
readonly array: (name: string, itemType: JsonStructureField) => JsonStructureField;
|
|
58
|
+
};
|
|
48
59
|
/** Where in the spreadsheet an Excel field's value lives (all 0-based). */
|
|
49
60
|
export interface ExcelCellLocation {
|
|
50
61
|
readonly sheet: number;
|
|
@@ -55,7 +66,7 @@ export interface ExcelCellLocation {
|
|
|
55
66
|
export interface FileReaderExcelField {
|
|
56
67
|
readonly name: string;
|
|
57
68
|
/** e.g. "TEXT", "NUMBER", "DECIMAL", "BOOLEAN", "DATE", "DATETIME", "PICKLIST", "USER_ID", "GROUP_ID", "HTML", "LOCALIZATION_KEY", "UUID". */
|
|
58
|
-
readonly type:
|
|
69
|
+
readonly type: FileReaderFieldType;
|
|
59
70
|
readonly location: ExcelCellLocation;
|
|
60
71
|
/** Defaults to true on the platform. */
|
|
61
72
|
readonly include?: boolean;
|
|
@@ -63,11 +74,25 @@ export interface FileReaderExcelField {
|
|
|
63
74
|
readonly required?: boolean;
|
|
64
75
|
}
|
|
65
76
|
interface FileReaderOptionsBase extends EntityDeployOptions {
|
|
66
|
-
readonly
|
|
77
|
+
readonly owner: AppOrElementRef;
|
|
67
78
|
readonly name: string;
|
|
68
79
|
}
|
|
69
|
-
export
|
|
70
|
-
readonly
|
|
80
|
+
export declare const fileReaderFieldType: {
|
|
81
|
+
readonly text: "TEXT";
|
|
82
|
+
readonly number: "NUMBER";
|
|
83
|
+
readonly decimal: "DECIMAL";
|
|
84
|
+
readonly boolean: "BOOLEAN";
|
|
85
|
+
readonly date: "DATE";
|
|
86
|
+
readonly datetime: "DATETIME";
|
|
87
|
+
readonly picklist: "PICKLIST";
|
|
88
|
+
readonly userId: "USER_ID";
|
|
89
|
+
readonly groupId: "GROUP_ID";
|
|
90
|
+
readonly html: "HTML";
|
|
91
|
+
readonly localizationKey: "LOCALIZATION_KEY";
|
|
92
|
+
readonly uuid: "UUID";
|
|
93
|
+
};
|
|
94
|
+
export type FileReaderFieldType = (typeof fileReaderFieldType)[keyof typeof fileReaderFieldType];
|
|
95
|
+
export interface ExcelFileReaderOptions extends FileReaderOptionsBase {
|
|
71
96
|
readonly firstRowIsHeader: boolean;
|
|
72
97
|
readonly fields: readonly FileReaderExcelField[];
|
|
73
98
|
/**
|
|
@@ -82,13 +107,10 @@ export interface FileReaderExcelOptions extends FileReaderOptionsBase {
|
|
|
82
107
|
readonly documentName?: string;
|
|
83
108
|
readonly fileType?: string;
|
|
84
109
|
}
|
|
85
|
-
export interface
|
|
86
|
-
readonly type: "json";
|
|
110
|
+
export interface JsonFileReaderOptions extends FileReaderOptionsBase {
|
|
87
111
|
readonly structure: readonly JsonStructureField[];
|
|
88
112
|
}
|
|
89
|
-
export
|
|
90
|
-
readonly type: "text";
|
|
91
|
-
}
|
|
113
|
+
export type TextFileReaderOptions = FileReaderOptionsBase;
|
|
92
114
|
/**
|
|
93
115
|
* A field the AI file reader extracts. Named with an `AiFileReader-` prefix
|
|
94
116
|
* (not `FileReaderAi-`) to avoid colliding with the deprecated
|
|
@@ -99,23 +121,43 @@ export interface AiFileReaderField {
|
|
|
99
121
|
readonly name: string;
|
|
100
122
|
readonly description: string;
|
|
101
123
|
/** e.g. "TEXT", "NUMBER", "DECIMAL", "BOOLEAN", "DATE", "DATETIME". */
|
|
102
|
-
readonly type:
|
|
124
|
+
readonly type: FileReaderFieldType;
|
|
103
125
|
/** Defaults to true on the platform. */
|
|
104
126
|
readonly required?: boolean;
|
|
105
127
|
}
|
|
106
128
|
export interface AiFileReaderOptions extends FileReaderOptionsBase {
|
|
107
|
-
readonly type: "ai";
|
|
108
129
|
readonly instructions: string;
|
|
109
130
|
readonly fields: readonly AiFileReaderField[];
|
|
110
131
|
}
|
|
111
|
-
export
|
|
132
|
+
export interface XmlFileReaderOptions extends FileReaderOptionsBase {
|
|
133
|
+
readonly structure: readonly JsonStructureField[];
|
|
134
|
+
}
|
|
112
135
|
/** The authored shape stored as `DeployableEntity.payload` — `FileReaderOptions` minus the deploy-only `parent`/`enabled`. */
|
|
113
|
-
export type FileReaderPayload = Omit<
|
|
136
|
+
export type FileReaderPayload = (Omit<ExcelFileReaderOptions, "owner" | "enabled"> & {
|
|
137
|
+
readonly type: "excel";
|
|
138
|
+
}) | (Omit<JsonFileReaderOptions, "owner" | "enabled"> & {
|
|
139
|
+
readonly type: "json";
|
|
140
|
+
}) | (Omit<TextFileReaderOptions, "owner" | "enabled"> & {
|
|
141
|
+
readonly type: "text";
|
|
142
|
+
}) | (Omit<XmlFileReaderOptions, "owner" | "enabled"> & {
|
|
143
|
+
readonly type: "xml";
|
|
144
|
+
}) | (Omit<AiFileReaderOptions, "owner" | "enabled"> & {
|
|
145
|
+
readonly type: "ai";
|
|
146
|
+
});
|
|
114
147
|
export interface FileReaderConfigured {
|
|
115
148
|
ref(refName: string): FileReaderCatalogRef;
|
|
116
149
|
def(refName: string): DeployableEntity;
|
|
117
150
|
}
|
|
118
|
-
|
|
151
|
+
/** Extract structured values with an AI model. */
|
|
152
|
+
export declare function aiFileReader(opts: AiFileReaderOptions): FileReaderConfigured;
|
|
153
|
+
/** Extract fixed cell locations from a spreadsheet. */
|
|
154
|
+
export declare function excelFileReader(opts: ExcelFileReaderOptions): FileReaderConfigured;
|
|
155
|
+
/** Extract a typed JSON structure. */
|
|
156
|
+
export declare function jsonFileReader(opts: JsonFileReaderOptions): FileReaderConfigured;
|
|
157
|
+
/** Read freeform text. */
|
|
158
|
+
export declare function textFileReader(opts: TextFileReaderOptions): FileReaderConfigured;
|
|
159
|
+
/** Extract a typed XML structure. */
|
|
160
|
+
export declare function xmlFileReader(opts: XmlFileReaderOptions): FileReaderConfigured;
|
|
119
161
|
import type { FileReaderCreateInput, FileReaderUpdateInput, InvoiceFieldLabel } from "../../../elementum-entity-client/clients/document-models/models/document-model.js";
|
|
120
162
|
/** @deprecated Pre-terraform API. An AI-extraction field definition. */
|
|
121
163
|
export interface FileReaderAiField {
|
|
@@ -160,15 +202,20 @@ export interface FileReaderInvoiceOptions extends FileReaderOptionsBase {
|
|
|
160
202
|
export interface FileReaderOcrOptions extends FileReaderOptionsBase {
|
|
161
203
|
readonly type: "ocr";
|
|
162
204
|
}
|
|
163
|
-
/** @deprecated Pre-terraform
|
|
164
|
-
export interface
|
|
205
|
+
/** @deprecated Pre-terraform XML reader payload. */
|
|
206
|
+
export interface LegacyFileReaderXmlOptions extends FileReaderOptionsBase {
|
|
165
207
|
readonly type: "xml";
|
|
166
208
|
readonly structure: readonly JsonStructureField[];
|
|
167
209
|
}
|
|
210
|
+
/** @deprecated Pre-terraform JSON reader payload. */
|
|
211
|
+
export interface LegacyFileReaderJsonOptions extends FileReaderOptionsBase {
|
|
212
|
+
readonly type: "json";
|
|
213
|
+
readonly structure: readonly JsonStructureField[];
|
|
214
|
+
}
|
|
168
215
|
/** @deprecated Pre-terraform API. Renamed from `FileReaderOptions` (now the terraform-facing union above). */
|
|
169
|
-
export type LegacyFileReaderOptions = FileReaderAiOptions | LegacyFileReaderExcelOptions | FileReaderExcelCellOptions | FileReaderInvoiceOptions |
|
|
216
|
+
export type LegacyFileReaderOptions = FileReaderAiOptions | LegacyFileReaderExcelOptions | FileReaderExcelCellOptions | FileReaderInvoiceOptions | LegacyFileReaderJsonOptions | FileReaderOcrOptions | LegacyFileReaderXmlOptions;
|
|
170
217
|
/** @deprecated Pre-terraform API. Renamed from `FileReaderPayload` (now the terraform-facing union above). */
|
|
171
|
-
export type LegacyFileReaderPayload = Omit<FileReaderAiOptions, "
|
|
218
|
+
export type LegacyFileReaderPayload = Omit<FileReaderAiOptions, "owner" | "enabled"> | Omit<LegacyFileReaderExcelOptions, "owner" | "enabled"> | Omit<FileReaderExcelCellOptions, "owner" | "enabled"> | Omit<FileReaderInvoiceOptions, "owner" | "enabled"> | Omit<LegacyFileReaderJsonOptions, "owner" | "enabled"> | Omit<FileReaderOcrOptions, "owner" | "enabled"> | Omit<LegacyFileReaderXmlOptions, "owner" | "enabled">;
|
|
172
219
|
/** @deprecated Pre-terraform API. Build the `documentModelCreate` mutation input from a document model's authored payload. */
|
|
173
220
|
export declare function fileReaderCreateBody(opts: LegacyFileReaderPayload): FileReaderCreateInput;
|
|
174
221
|
/**
|