@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
|
@@ -1,81 +1,141 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v2 table field factories — `cloudField`, `calculationField`,
|
|
3
|
-
* `referenceField`. Parallel to v1 `src/tables/fields`. Table fields carry no
|
|
4
|
-
* catalog tokens for projected source fields. Cloud columns + calc expressions
|
|
5
|
-
* are literal; a reference field's `source` can be a raw field id, an
|
|
6
|
-
* app/element FieldRef, or a table column token resolved at apply.
|
|
7
|
-
*
|
|
8
|
-
* `fieldsFromAspect` is intentionally omitted in v2 day-one: a v2 app catalog
|
|
9
|
-
* exposes `FieldRef` tokens, not the column metadata that projection needs.
|
|
10
|
-
*/
|
|
1
|
+
/** Typed table-column factories. Wire discriminators stay internal. */
|
|
11
2
|
import type { AspectFieldSemanticTag, AspectFieldType, TableFieldAggregation, TableFieldCreateInput, TableFieldExpanded } from "../../../elementum-entity-client/clients/tables/models/index.js";
|
|
12
3
|
import type { FieldRef, TableColumnRef } from "../../catalog/index.js";
|
|
4
|
+
declare const tableColumnTypeBrand: unique symbol;
|
|
5
|
+
declare const tableColumnTagBrand: unique symbol;
|
|
6
|
+
declare const tableAggregationBrand: unique symbol;
|
|
7
|
+
declare const tableExpansionBrand: unique symbol;
|
|
8
|
+
declare const tableColumnBrand: unique symbol;
|
|
9
|
+
export type TableColumnType = AspectFieldType & {
|
|
10
|
+
readonly [tableColumnTypeBrand]: "TableColumnType";
|
|
11
|
+
};
|
|
12
|
+
export type TableColumnTag = AspectFieldSemanticTag & {
|
|
13
|
+
readonly [tableColumnTagBrand]: "TableColumnTag";
|
|
14
|
+
};
|
|
15
|
+
export type TableAggregation = TableFieldAggregation & {
|
|
16
|
+
readonly [tableAggregationBrand]: "TableAggregation";
|
|
17
|
+
};
|
|
18
|
+
export type TableExpansion = TableFieldExpanded & {
|
|
19
|
+
readonly [tableExpansionBrand]: "TableExpansion";
|
|
20
|
+
};
|
|
21
|
+
export declare const tableColumnType: {
|
|
22
|
+
readonly attachmentId: TableColumnType;
|
|
23
|
+
readonly boolean: TableColumnType;
|
|
24
|
+
readonly date: TableColumnType;
|
|
25
|
+
readonly dateTime: TableColumnType;
|
|
26
|
+
readonly decimal: TableColumnType;
|
|
27
|
+
readonly groupId: TableColumnType;
|
|
28
|
+
readonly handle: TableColumnType;
|
|
29
|
+
readonly html: TableColumnType;
|
|
30
|
+
readonly json: TableColumnType;
|
|
31
|
+
readonly multiPicklist: TableColumnType;
|
|
32
|
+
readonly number: TableColumnType;
|
|
33
|
+
readonly picklist: TableColumnType;
|
|
34
|
+
readonly text: TableColumnType;
|
|
35
|
+
readonly userId: TableColumnType;
|
|
36
|
+
};
|
|
37
|
+
export declare const tableColumnTag: {
|
|
38
|
+
readonly assignee: TableColumnTag;
|
|
39
|
+
readonly assignmentGroup: TableColumnTag;
|
|
40
|
+
readonly breakLine: TableColumnTag;
|
|
41
|
+
readonly closedAt: TableColumnTag;
|
|
42
|
+
readonly closedBy: TableColumnTag;
|
|
43
|
+
readonly cost: TableColumnTag;
|
|
44
|
+
readonly createdAt: TableColumnTag;
|
|
45
|
+
readonly createdBy: TableColumnTag;
|
|
46
|
+
readonly currency: TableColumnTag;
|
|
47
|
+
readonly description: TableColumnTag;
|
|
48
|
+
readonly dueDate: TableColumnTag;
|
|
49
|
+
readonly fullLine: TableColumnTag;
|
|
50
|
+
readonly handle: TableColumnTag;
|
|
51
|
+
readonly percent: TableColumnTag;
|
|
52
|
+
readonly percentMultiply: TableColumnTag;
|
|
53
|
+
readonly priority: TableColumnTag;
|
|
54
|
+
readonly revenue: TableColumnTag;
|
|
55
|
+
readonly stage: TableColumnTag;
|
|
56
|
+
readonly status: TableColumnTag;
|
|
57
|
+
readonly title: TableColumnTag;
|
|
58
|
+
readonly totalValueManaged: TableColumnTag;
|
|
59
|
+
readonly updatedAt: TableColumnTag;
|
|
60
|
+
readonly updatedBy: TableColumnTag;
|
|
61
|
+
readonly version: TableColumnTag;
|
|
62
|
+
};
|
|
63
|
+
export declare const tableAggregation: {
|
|
64
|
+
readonly average: TableAggregation;
|
|
65
|
+
readonly count: TableAggregation;
|
|
66
|
+
readonly countDistinct: TableAggregation;
|
|
67
|
+
readonly max: TableAggregation;
|
|
68
|
+
readonly min: TableAggregation;
|
|
69
|
+
readonly none: TableAggregation;
|
|
70
|
+
readonly standardDeviation: TableAggregation;
|
|
71
|
+
readonly sum: TableAggregation;
|
|
72
|
+
};
|
|
73
|
+
export declare const tableExpansion: {
|
|
74
|
+
readonly groupName: TableExpansion;
|
|
75
|
+
readonly multiPicklistLabel: TableExpansion;
|
|
76
|
+
readonly picklistLabel: TableExpansion;
|
|
77
|
+
readonly stageName: TableExpansion;
|
|
78
|
+
readonly userEmail: TableExpansion;
|
|
79
|
+
readonly userFirstName: TableExpansion;
|
|
80
|
+
readonly userLastName: TableExpansion;
|
|
81
|
+
};
|
|
13
82
|
export interface TableCloudField {
|
|
83
|
+
readonly [tableColumnBrand]: "TableColumn";
|
|
14
84
|
readonly kind: "cloud";
|
|
15
85
|
readonly name: string;
|
|
16
86
|
readonly cloud: {
|
|
17
87
|
readonly snowflake: {
|
|
18
88
|
readonly columnName: string;
|
|
19
|
-
readonly type:
|
|
89
|
+
readonly type: TableColumnType;
|
|
20
90
|
};
|
|
21
91
|
} | {
|
|
22
92
|
readonly bigQuery: {
|
|
23
93
|
readonly columnName: string;
|
|
24
|
-
readonly type:
|
|
94
|
+
readonly type: TableColumnType;
|
|
25
95
|
};
|
|
26
96
|
};
|
|
27
|
-
readonly tags?: readonly
|
|
97
|
+
readonly tags?: readonly TableColumnTag[];
|
|
28
98
|
}
|
|
29
99
|
export interface TableCalculationField {
|
|
100
|
+
readonly [tableColumnBrand]: "TableColumn";
|
|
30
101
|
readonly kind: "calculation";
|
|
31
102
|
readonly name: string;
|
|
32
103
|
readonly expression: string;
|
|
33
|
-
readonly tags?: readonly
|
|
104
|
+
readonly tags?: readonly TableColumnTag[];
|
|
34
105
|
}
|
|
35
106
|
export interface TableReferenceField {
|
|
107
|
+
readonly [tableColumnBrand]: "TableColumn";
|
|
36
108
|
readonly kind: "reference";
|
|
37
109
|
readonly name: string;
|
|
38
|
-
|
|
39
|
-
readonly
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
readonly aggregation?: TableFieldAggregation;
|
|
43
|
-
readonly expanded?: TableFieldExpanded;
|
|
44
|
-
readonly tags?: readonly AspectFieldSemanticTag[];
|
|
110
|
+
readonly source: FieldRef | TableColumnRef;
|
|
111
|
+
readonly aggregation?: TableAggregation;
|
|
112
|
+
readonly expanded?: TableExpansion;
|
|
113
|
+
readonly tags?: readonly TableColumnTag[];
|
|
45
114
|
}
|
|
46
115
|
export type TableField = TableCloudField | TableCalculationField | TableReferenceField;
|
|
47
116
|
export type TableColumn = TableField;
|
|
48
|
-
|
|
117
|
+
interface CloudColumnOptions {
|
|
49
118
|
readonly name: string;
|
|
50
|
-
readonly
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
readonly bigQuery?: {
|
|
55
|
-
readonly columnName: string;
|
|
56
|
-
readonly type: AspectFieldType;
|
|
57
|
-
};
|
|
58
|
-
readonly tags?: readonly AspectFieldSemanticTag[];
|
|
119
|
+
readonly column: string;
|
|
120
|
+
readonly type: TableColumnType;
|
|
121
|
+
readonly tags?: readonly TableColumnTag[];
|
|
59
122
|
}
|
|
60
|
-
export declare function
|
|
61
|
-
export
|
|
123
|
+
export declare function snowflakeColumn(opts: CloudColumnOptions): TableCloudField;
|
|
124
|
+
export declare function bigQueryColumn(opts: CloudColumnOptions): TableCloudField;
|
|
125
|
+
export interface CalculationColumnOptions {
|
|
62
126
|
readonly name: string;
|
|
63
127
|
readonly expression: string;
|
|
64
|
-
readonly tags?: readonly
|
|
128
|
+
readonly tags?: readonly TableColumnTag[];
|
|
65
129
|
}
|
|
66
|
-
export declare function
|
|
67
|
-
export interface
|
|
130
|
+
export declare function calculationColumn(opts: CalculationColumnOptions): TableCalculationField;
|
|
131
|
+
export interface SourceColumnOptions {
|
|
68
132
|
readonly name: string;
|
|
69
|
-
readonly source:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
readonly
|
|
73
|
-
readonly expanded?: TableFieldExpanded;
|
|
74
|
-
readonly tags?: readonly AspectFieldSemanticTag[];
|
|
133
|
+
readonly source: FieldRef | TableColumnRef;
|
|
134
|
+
readonly aggregation?: TableAggregation;
|
|
135
|
+
readonly expanded?: TableExpansion;
|
|
136
|
+
readonly tags?: readonly TableColumnTag[];
|
|
75
137
|
}
|
|
76
|
-
export declare function
|
|
77
|
-
/** Serialize one
|
|
138
|
+
export declare function sourceColumn(opts: SourceColumnOptions): TableReferenceField;
|
|
139
|
+
/** Serialize one public column factory result to the platform wire shape. */
|
|
78
140
|
export declare function serializeTableField(def: TableField): TableFieldCreateInput;
|
|
79
|
-
export
|
|
80
|
-
export declare const calculationColumn: typeof calculationField;
|
|
81
|
-
export declare const sourceColumn: typeof referenceField;
|
|
141
|
+
export {};
|
|
@@ -1,70 +1,91 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export const tableColumnType = {
|
|
2
|
+
attachmentId: "ATTACHMENT_ID",
|
|
3
|
+
boolean: "BOOLEAN",
|
|
4
|
+
date: "DATE",
|
|
5
|
+
dateTime: "DATETIME",
|
|
6
|
+
decimal: "DECIMAL",
|
|
7
|
+
groupId: "GROUP_ID",
|
|
8
|
+
handle: "HANDLE",
|
|
9
|
+
html: "HTML",
|
|
10
|
+
json: "JSON",
|
|
11
|
+
multiPicklist: "MULTI_PICKLIST",
|
|
12
|
+
number: "NUMBER",
|
|
13
|
+
picklist: "PICKLIST",
|
|
14
|
+
text: "TEXT",
|
|
15
|
+
userId: "USER_ID",
|
|
16
|
+
};
|
|
17
|
+
export const tableColumnTag = {
|
|
18
|
+
assignee: "ASSIGNEE",
|
|
19
|
+
assignmentGroup: "ASSIGNMENT_GROUP",
|
|
20
|
+
breakLine: "BREAK_LINE",
|
|
21
|
+
closedAt: "CLOSED_AT",
|
|
22
|
+
closedBy: "CLOSED_BY",
|
|
23
|
+
cost: "COST",
|
|
24
|
+
createdAt: "CREATED_AT",
|
|
25
|
+
createdBy: "CREATED_BY",
|
|
26
|
+
currency: "CURRENCY",
|
|
27
|
+
description: "DESCRIPTION",
|
|
28
|
+
dueDate: "DUE_DATE",
|
|
29
|
+
fullLine: "FULL_LINE",
|
|
30
|
+
handle: "HANDLE",
|
|
31
|
+
percent: "PERCENT",
|
|
32
|
+
percentMultiply: "PERCENT_MULTIPLY",
|
|
33
|
+
priority: "PRIORITY",
|
|
34
|
+
revenue: "REVENUE",
|
|
35
|
+
stage: "STAGE",
|
|
36
|
+
status: "STATUS",
|
|
37
|
+
title: "TITLE",
|
|
38
|
+
totalValueManaged: "TOTAL_VALUE_MANAGED",
|
|
39
|
+
updatedAt: "UPDATED_AT",
|
|
40
|
+
updatedBy: "UPDATED_BY",
|
|
41
|
+
version: "VERSION",
|
|
42
|
+
};
|
|
43
|
+
export const tableAggregation = {
|
|
44
|
+
average: "AVERAGE",
|
|
45
|
+
count: "COUNT",
|
|
46
|
+
countDistinct: "COUNT_DISTINCT",
|
|
47
|
+
max: "MAX",
|
|
48
|
+
min: "MIN",
|
|
49
|
+
none: "NOT_SET",
|
|
50
|
+
standardDeviation: "STANDARD_DEVIATION",
|
|
51
|
+
sum: "SUM",
|
|
52
|
+
};
|
|
53
|
+
export const tableExpansion = {
|
|
54
|
+
groupName: "GROUP_NAME",
|
|
55
|
+
multiPicklistLabel: "MULTI_PICKLIST_LABEL",
|
|
56
|
+
picklistLabel: "PICKLIST_LABEL",
|
|
57
|
+
stageName: "STAGE_NAME",
|
|
58
|
+
userEmail: "USER_EMAIL",
|
|
59
|
+
userFirstName: "USER_FIRST_NAME",
|
|
60
|
+
userLastName: "USER_LAST_NAME",
|
|
61
|
+
};
|
|
62
|
+
export function snowflakeColumn(opts) {
|
|
63
|
+
return { kind: "cloud", name: opts.name, cloud: { snowflake: { columnName: opts.column, type: opts.type } }, ...(opts.tags !== undefined ? { tags: opts.tags } : {}) };
|
|
64
|
+
}
|
|
65
|
+
export function bigQueryColumn(opts) {
|
|
66
|
+
return { kind: "cloud", name: opts.name, cloud: { bigQuery: { columnName: opts.column, type: opts.type } }, ...(opts.tags !== undefined ? { tags: opts.tags } : {}) };
|
|
9
67
|
}
|
|
10
|
-
export function
|
|
11
|
-
return { kind: "calculation", name: opts.name, expression: opts.expression, ...(opts.tags
|
|
68
|
+
export function calculationColumn(opts) {
|
|
69
|
+
return { kind: "calculation", name: opts.name, expression: opts.expression, ...(opts.tags !== undefined ? { tags: opts.tags } : {}) };
|
|
12
70
|
}
|
|
13
|
-
export function
|
|
71
|
+
export function sourceColumn(opts) {
|
|
14
72
|
return {
|
|
15
73
|
kind: "reference",
|
|
16
74
|
name: opts.name,
|
|
17
75
|
source: opts.source,
|
|
18
|
-
...(opts.aggregation
|
|
19
|
-
...(opts.expanded
|
|
20
|
-
...(opts.tags
|
|
76
|
+
...(opts.aggregation !== undefined ? { aggregation: opts.aggregation } : {}),
|
|
77
|
+
...(opts.expanded !== undefined ? { expanded: opts.expanded } : {}),
|
|
78
|
+
...(opts.tags !== undefined ? { tags: opts.tags } : {}),
|
|
21
79
|
};
|
|
22
80
|
}
|
|
23
|
-
|
|
24
|
-
if (isFieldRef(source) || isTableColumnRef(source)) {
|
|
25
|
-
return source;
|
|
26
|
-
}
|
|
27
|
-
const id = typeof source === "string" ? source : source?.id;
|
|
28
|
-
if (typeof id !== "string" || id === "") {
|
|
29
|
-
throw new EdkValidationError(`referenceField "${name}": \`source\` must be a non-empty id string, { id }, FieldRef, or TableColumnRef.`);
|
|
30
|
-
}
|
|
31
|
-
return id;
|
|
32
|
-
}
|
|
33
|
-
function isFieldRef(value) {
|
|
34
|
-
return (typeof value === "object" &&
|
|
35
|
-
value !== null &&
|
|
36
|
-
value.__kind === "field");
|
|
37
|
-
}
|
|
38
|
-
function isTableColumnRef(value) {
|
|
39
|
-
return (typeof value === "object" &&
|
|
40
|
-
value !== null &&
|
|
41
|
-
value.__kind === "tableColumn");
|
|
42
|
-
}
|
|
43
|
-
/** Serialize one field to the wire `TableFieldCreateInput` (exactly one slot populated). */
|
|
81
|
+
/** Serialize one public column factory result to the platform wire shape. */
|
|
44
82
|
export function serializeTableField(def) {
|
|
45
83
|
switch (def.kind) {
|
|
46
84
|
case "cloud":
|
|
47
|
-
return {
|
|
48
|
-
cloud: {
|
|
49
|
-
name: def.name,
|
|
50
|
-
...("snowflake" in def.cloud ? { snowflake: def.cloud.snowflake } : { bigQuery: def.cloud.bigQuery }),
|
|
51
|
-
...(def.tags != null ? { tags: def.tags } : {}),
|
|
52
|
-
},
|
|
53
|
-
};
|
|
85
|
+
return { cloud: { name: def.name, ...(def.tags !== undefined ? { tags: def.tags } : {}), ...("snowflake" in def.cloud ? { snowflake: def.cloud.snowflake } : { bigQuery: def.cloud.bigQuery }) } };
|
|
54
86
|
case "calculation":
|
|
55
|
-
return { calculation: { name: def.name, text: def.expression, ...(def.tags
|
|
87
|
+
return { calculation: { name: def.name, text: def.expression, ...(def.tags !== undefined ? { tags: def.tags } : {}) } };
|
|
56
88
|
case "reference":
|
|
57
|
-
return {
|
|
58
|
-
reference: {
|
|
59
|
-
name: def.name,
|
|
60
|
-
field: sourceId(def.source, def.name),
|
|
61
|
-
...(def.aggregation != null ? { aggregation: def.aggregation } : {}),
|
|
62
|
-
...(def.expanded != null ? { expanded: def.expanded } : {}),
|
|
63
|
-
...(def.tags != null ? { tags: def.tags } : {}),
|
|
64
|
-
},
|
|
65
|
-
};
|
|
89
|
+
return { reference: { name: def.name, field: def.source, ...(def.aggregation !== undefined ? { aggregation: def.aggregation } : {}), ...(def.expanded !== undefined ? { expanded: def.expanded } : {}), ...(def.tags !== undefined ? { tags: def.tags } : {}) } };
|
|
66
90
|
}
|
|
67
91
|
}
|
|
68
|
-
export const cloudColumn = cloudField;
|
|
69
|
-
export const calculationColumn = calculationField;
|
|
70
|
-
export const sourceColumn = referenceField;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type FromTfContext } from "../../engine/pull/context.js";
|
|
2
|
+
import { type TfBlock } from "../../engine/tf/index.js";
|
|
3
|
+
import type { NormalizedTable } from "./deserializer/normalize.js";
|
|
4
|
+
export declare function tableFromTf(block: TfBlock, ctx: FromTfContext, datamineBlocks?: readonly TfBlock[]): NormalizedTable;
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { dataRefLabel, optionalBoolean, optionalString, plainObject, resourceRefLabel, } from "../../engine/pull/context.js";
|
|
2
|
+
import { isTfExpr, sanitizeName, snakeSlug, tfLabelToTsLabel, tsLabelToTfLabel } from "../../engine/tf/index.js";
|
|
3
|
+
import { tableDataminesFromTf } from "../datamine/from-tf.js";
|
|
4
|
+
import { TABLE_RESOURCE_TYPE } from "./module.js";
|
|
5
|
+
import { EntityTfError } from "../../engine/entity.js";
|
|
6
|
+
import { filterFromTf } from "../shared/filters/tf-codec.js";
|
|
7
|
+
function str(obj, key) {
|
|
8
|
+
return typeof obj[key] === "string" ? obj[key] : undefined;
|
|
9
|
+
}
|
|
10
|
+
function stringList(value) {
|
|
11
|
+
if (!Array.isArray(value) || !value.every((item) => typeof item === "string"))
|
|
12
|
+
return undefined;
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
function sourceRef(value) {
|
|
16
|
+
for (const [kind, type] of [
|
|
17
|
+
["app", "elementum_app"],
|
|
18
|
+
["element", "elementum_element"],
|
|
19
|
+
["table", "elementum_table"],
|
|
20
|
+
]) {
|
|
21
|
+
const label = dataRefLabel(value, type) ?? resourceRefLabel(value, type);
|
|
22
|
+
if (label !== undefined)
|
|
23
|
+
return { kind, refName: tfLabelToTsLabel(label) };
|
|
24
|
+
}
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
function rawRef(value) {
|
|
28
|
+
if (typeof value === "string")
|
|
29
|
+
return value;
|
|
30
|
+
if (value === undefined || !isTfExpr(value))
|
|
31
|
+
return undefined;
|
|
32
|
+
return `${value.$expr}:${"type" in value ? value.type : "ref"}:${"label" in value ? value.label : ""}:${JSON.stringify("path" in value ? value.path : [])}`;
|
|
33
|
+
}
|
|
34
|
+
function fieldSourceRef(value, ctx) {
|
|
35
|
+
if (value === undefined || !isTfExpr(value))
|
|
36
|
+
return undefined;
|
|
37
|
+
if (value.$expr === "resource-attr" && value.type === TABLE_RESOURCE_TYPE && value.path.length === 2 && value.path[0] === "field_ids" && typeof value.path[1] === "object") {
|
|
38
|
+
const index = value.path[1];
|
|
39
|
+
if (typeof index.index === "string") {
|
|
40
|
+
return { kind: "tableColumn", parentRefName: tfLabelToTsLabel(value.label), refName: tfLabelToTsLabel(index.index) };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const fieldLabel = dataRefLabel(value, "elementum_field");
|
|
44
|
+
if (fieldLabel === undefined)
|
|
45
|
+
return undefined;
|
|
46
|
+
const attrs = ctx.dataAttrs?.("elementum_field", fieldLabel);
|
|
47
|
+
const owner = sourceRef(attrs?.["object_id"]);
|
|
48
|
+
if (owner === undefined)
|
|
49
|
+
return undefined;
|
|
50
|
+
const prefix = `${owner.refName}_`;
|
|
51
|
+
const fieldPart = fieldLabel.startsWith(prefix) ? fieldLabel.slice(prefix.length) : fieldLabel;
|
|
52
|
+
if (owner.kind === "table")
|
|
53
|
+
return { kind: "tableColumn", parentRefName: owner.refName, refName: tfLabelToTsLabel(fieldPart) };
|
|
54
|
+
return { kind: "field", parentKind: owner.kind, parentRefName: owner.refName, refName: tfLabelToTsLabel(fieldPart) };
|
|
55
|
+
}
|
|
56
|
+
function cloudMapping(attrs) {
|
|
57
|
+
const cloudLinkLabel = dataRefLabel(attrs["cloud_mapping_cloudlink_id"], "elementum_cloudlink");
|
|
58
|
+
if (cloudLinkLabel === undefined)
|
|
59
|
+
return undefined;
|
|
60
|
+
const cloudLinkRef = tfLabelToTsLabel(cloudLinkLabel);
|
|
61
|
+
const snowflakeTable = str(attrs, "cloud_mapping_snowflake_table");
|
|
62
|
+
if (snowflakeTable !== undefined)
|
|
63
|
+
return {
|
|
64
|
+
provider: "snowflake",
|
|
65
|
+
cloudLinkRef,
|
|
66
|
+
database: str(attrs, "cloud_mapping_snowflake_database"),
|
|
67
|
+
schema: str(attrs, "cloud_mapping_snowflake_schema"),
|
|
68
|
+
table: snowflakeTable,
|
|
69
|
+
};
|
|
70
|
+
const bigQueryTable = str(attrs, "cloud_mapping_bigquery_table");
|
|
71
|
+
if (bigQueryTable !== undefined)
|
|
72
|
+
return {
|
|
73
|
+
provider: "bigQuery",
|
|
74
|
+
cloudLinkRef,
|
|
75
|
+
dataset: str(attrs, "cloud_mapping_bigquery_dataset"),
|
|
76
|
+
table: bigQueryTable,
|
|
77
|
+
};
|
|
78
|
+
const databricksTable = str(attrs, "cloud_mapping_databricks_table");
|
|
79
|
+
if (databricksTable !== undefined)
|
|
80
|
+
return {
|
|
81
|
+
provider: "databricks",
|
|
82
|
+
cloudLinkRef,
|
|
83
|
+
database: str(attrs, "cloud_mapping_databricks_database"),
|
|
84
|
+
schema: str(attrs, "cloud_mapping_databricks_schema"),
|
|
85
|
+
table: databricksTable,
|
|
86
|
+
};
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
function dataView(attrs) {
|
|
90
|
+
const name = str(attrs, "data_view_snowflake_name");
|
|
91
|
+
const database = str(attrs, "data_view_snowflake_database");
|
|
92
|
+
const schema = str(attrs, "data_view_snowflake_schema");
|
|
93
|
+
return name !== undefined && database !== undefined && schema !== undefined
|
|
94
|
+
? { snowflake: { name, databaseName: database, schemaName: schema } }
|
|
95
|
+
: undefined;
|
|
96
|
+
}
|
|
97
|
+
function orderBy(value) {
|
|
98
|
+
if (typeof value !== "string")
|
|
99
|
+
return value;
|
|
100
|
+
try {
|
|
101
|
+
return JSON.parse(value);
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
return value;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function tableFilterFromTf(value, tableTfLabel, columnKeyByName, ctx, where) {
|
|
108
|
+
return filterFromTf(value, {
|
|
109
|
+
field: (field) => tableFilterFieldFromTf(field, tableTfLabel, columnKeyByName, ctx, where),
|
|
110
|
+
reference: () => { throw new EntityTfError("table filters do not support reference values"); },
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function tableFilterFieldFromTf(value, tableTfLabel, columnKeyByName, ctx, where) {
|
|
114
|
+
if (isTfExpr(value) && value.$expr === "resource-attr" && value.type === TABLE_RESOURCE_TYPE && value.path[0] === "field_ids") {
|
|
115
|
+
const index = value.path[1];
|
|
116
|
+
const name = typeof index === "object" && index !== null && "index" in index && typeof index.index === "string"
|
|
117
|
+
? index.index
|
|
118
|
+
: typeof index === "string" ? index : undefined;
|
|
119
|
+
if (name === undefined)
|
|
120
|
+
throw new EntityTfError(`${where}: table field_ids reference has no field name`);
|
|
121
|
+
const ownKey = value.label === tableTfLabel ? columnKeyByName.get(name) : undefined;
|
|
122
|
+
return {
|
|
123
|
+
kind: "tableColumn",
|
|
124
|
+
tableRefName: tfLabelToTsLabel(value.label),
|
|
125
|
+
columnRefName: ownKey ?? tfLabelToTsLabel(sanitizeName(name)),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
const fieldLabel = dataRefLabel(value, "elementum_field");
|
|
129
|
+
if (fieldLabel === undefined)
|
|
130
|
+
return value;
|
|
131
|
+
const attrs = ctx.dataAttrs?.("elementum_field", fieldLabel);
|
|
132
|
+
if (attrs === undefined) {
|
|
133
|
+
throw new EntityTfError(`${where}: data.elementum_field.${fieldLabel} has no matching data block`);
|
|
134
|
+
}
|
|
135
|
+
const fieldName = attrs["name"];
|
|
136
|
+
if (typeof fieldName !== "string" || fieldName === "") {
|
|
137
|
+
throw new EntityTfError(`${where}: data.elementum_field.${fieldLabel} has no string name`);
|
|
138
|
+
}
|
|
139
|
+
for (const [ownerType, ownerKind] of [
|
|
140
|
+
["elementum_app", "app"],
|
|
141
|
+
["elementum_element", "element"],
|
|
142
|
+
[TABLE_RESOURCE_TYPE, "table"],
|
|
143
|
+
]) {
|
|
144
|
+
const dataLabel = dataRefLabel(attrs["object_id"], ownerType);
|
|
145
|
+
const resourceLabel = resourceRefLabel(attrs["object_id"], ownerType);
|
|
146
|
+
const ownerLabel = dataLabel ?? resourceLabel;
|
|
147
|
+
if (ownerLabel === undefined)
|
|
148
|
+
continue;
|
|
149
|
+
const ownerName = dataLabel === undefined ? undefined : ctx.dataName(ownerType, dataLabel);
|
|
150
|
+
const ownerRefName = ownerKind === "app"
|
|
151
|
+
? (ownerName === undefined ? undefined : ctx.foreignAppRefNames?.get(ownerName)) ?? tfLabelToTsLabel(ownerLabel)
|
|
152
|
+
: ownerKind === "element"
|
|
153
|
+
? (ownerName === undefined ? undefined : ctx.foreignElementRefNames?.get(ownerName)) ?? tfLabelToTsLabel(ownerLabel)
|
|
154
|
+
: tfLabelToTsLabel(ownerLabel);
|
|
155
|
+
const prefix = `${tsLabelToTfLabel(ownerRefName)}_`;
|
|
156
|
+
const fieldTfLabel = fieldLabel.startsWith(prefix) ? fieldLabel.slice(prefix.length) : sanitizeName(fieldName);
|
|
157
|
+
const fieldRefName = tfLabelToTsLabel(fieldTfLabel);
|
|
158
|
+
return ownerKind === "table"
|
|
159
|
+
? { kind: "tableColumn", tableRefName: ownerRefName, columnRefName: fieldRefName }
|
|
160
|
+
: { kind: "catalogField", ownerKind, ownerRefName, fieldRefName };
|
|
161
|
+
}
|
|
162
|
+
throw new EntityTfError(`${where}: data.elementum_field.${fieldLabel}.object_id does not reference an app, element, or table`);
|
|
163
|
+
}
|
|
164
|
+
export function tableFromTf(block, ctx, datamineBlocks = []) {
|
|
165
|
+
if (block.type !== TABLE_RESOURCE_TYPE || !block.label)
|
|
166
|
+
throw new Error(`expected ${TABLE_RESOURCE_TYPE}`);
|
|
167
|
+
const tableTfLabel = block.label;
|
|
168
|
+
const attrs = block.attrs;
|
|
169
|
+
const name = optionalString(attrs, "name", `table ${block.label}`, ctx) ?? block.label;
|
|
170
|
+
const handle = optionalString(attrs, "handle", `table ${block.label}`, ctx) ?? block.label;
|
|
171
|
+
const mapping = cloudMapping(attrs);
|
|
172
|
+
const rawFields = Array.isArray(attrs["fields"]) ? attrs["fields"] : [];
|
|
173
|
+
const columns = rawFields.flatMap((item, index) => {
|
|
174
|
+
const field = plainObject(item);
|
|
175
|
+
if (field === undefined)
|
|
176
|
+
return [];
|
|
177
|
+
const fieldName = str(field, "name") ?? `Column ${index + 1}`;
|
|
178
|
+
const key = snakeSlug(fieldName).replace(/_([a-z0-9])/g, (_match, char) => char.toUpperCase());
|
|
179
|
+
const tags = stringList(field["tags"]);
|
|
180
|
+
const ref = fieldSourceRef(field["reference_field_id"], ctx);
|
|
181
|
+
let def;
|
|
182
|
+
if (str(field, "calculation_text") !== undefined) {
|
|
183
|
+
def = { kind: "calculation", name: fieldName, expression: str(field, "calculation_text"), ...(tags !== undefined && { tags: tags }) };
|
|
184
|
+
}
|
|
185
|
+
else if (field["reference_field_id"] !== undefined) {
|
|
186
|
+
def = {
|
|
187
|
+
kind: "reference",
|
|
188
|
+
name: fieldName,
|
|
189
|
+
source: rawRef(field["reference_field_id"]) ?? "",
|
|
190
|
+
...(str(field, "reference_aggregation") !== undefined && { aggregation: str(field, "reference_aggregation") }),
|
|
191
|
+
...(str(field, "reference_expanded") !== undefined && { expanded: str(field, "reference_expanded") }),
|
|
192
|
+
...(tags !== undefined && { tags: tags }),
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
const columnName = str(field, "cloud_column_name") ?? fieldName;
|
|
197
|
+
const type = (str(field, "cloud_type") ?? "TEXT");
|
|
198
|
+
def = mapping?.provider === "bigQuery"
|
|
199
|
+
? { kind: "cloud", name: fieldName, cloud: { bigQuery: { columnName, type } }, ...(tags !== undefined && { tags: tags }) }
|
|
200
|
+
: { kind: "cloud", name: fieldName, cloud: { snowflake: { columnName, type } }, ...(tags !== undefined && { tags: tags }) };
|
|
201
|
+
}
|
|
202
|
+
return [{
|
|
203
|
+
key,
|
|
204
|
+
def,
|
|
205
|
+
state: { id: "", name: fieldName, ...(str(field, "cloud_type") !== undefined && { fieldType: str(field, "cloud_type") }), ...(tags !== undefined && { tags }) },
|
|
206
|
+
...(rawRef(field["reference_field_id"]) !== undefined && { sourceFieldId: rawRef(field["reference_field_id"]) }),
|
|
207
|
+
...(ref !== undefined && { sourceRef: ref }),
|
|
208
|
+
}];
|
|
209
|
+
});
|
|
210
|
+
const columnKeyByName = new Map(columns.map((column) => [column.state.name, column.key]));
|
|
211
|
+
const joins = (Array.isArray(attrs["joins"]) ? attrs["joins"] : []).flatMap((item) => {
|
|
212
|
+
const join = plainObject(item);
|
|
213
|
+
if (join === undefined)
|
|
214
|
+
return [];
|
|
215
|
+
const joinedSource = sourceRef(join["source_id"]);
|
|
216
|
+
return [{
|
|
217
|
+
type: (str(join, "type") ?? "LEFT"),
|
|
218
|
+
...(joinedSource !== undefined && { sourceRef: joinedSource }),
|
|
219
|
+
on: (Array.isArray(join["join_on"]) ? join["join_on"] : []).flatMap((pair) => {
|
|
220
|
+
const value = plainObject(pair);
|
|
221
|
+
const leftId = value ? rawRef(value["left_field_id"]) : undefined;
|
|
222
|
+
const rightId = value ? rawRef(value["right_field_id"]) : undefined;
|
|
223
|
+
return leftId && rightId ? [{ leftId, rightId }] : [];
|
|
224
|
+
}),
|
|
225
|
+
...(join["filter"] !== undefined && {
|
|
226
|
+
filter: tableFilterFromTf(join["filter"], tableTfLabel, columnKeyByName, ctx, `elementum_table.${tableTfLabel}.joins.filter`),
|
|
227
|
+
}),
|
|
228
|
+
}];
|
|
229
|
+
});
|
|
230
|
+
const categoryLabel = dataRefLabel(attrs["category_id"], "elementum_category");
|
|
231
|
+
const source = sourceRef(attrs["source_id"]);
|
|
232
|
+
const sourceID = typeof attrs["source_id"] === "string" ? attrs["source_id"] : undefined;
|
|
233
|
+
const view = dataView(attrs);
|
|
234
|
+
const datamines = tableDataminesFromTf(datamineBlocks, tableTfLabel, columnKeyByName, ctx, new Map(columns.flatMap((column) => [column.state.id, column.sourceFieldId]
|
|
235
|
+
.filter((id) => typeof id === "string" && id !== "")
|
|
236
|
+
.map((id) => [id, column.key]))));
|
|
237
|
+
return {
|
|
238
|
+
id: ctx.importId(`${TABLE_RESOURCE_TYPE}.${block.label}`) ?? "",
|
|
239
|
+
name,
|
|
240
|
+
handle,
|
|
241
|
+
...(source !== undefined && { sourceRef: source }),
|
|
242
|
+
...(sourceID !== undefined && { source: { id: sourceID } }),
|
|
243
|
+
...(categoryLabel !== undefined && { categoryRef: tfLabelToTsLabel(categoryLabel) }),
|
|
244
|
+
...(mapping !== undefined && { cloudMapping: mapping }),
|
|
245
|
+
...(view !== undefined && { dataView: view }),
|
|
246
|
+
...(optionalString(attrs, "description", `table ${block.label}`, ctx) !== undefined && { description: optionalString(attrs, "description", `table ${block.label}`, ctx) }),
|
|
247
|
+
...(optionalString(attrs, "icon", `table ${block.label}`, ctx) !== undefined && { icon: optionalString(attrs, "icon", `table ${block.label}`, ctx) }),
|
|
248
|
+
...(optionalString(attrs, "color", `table ${block.label}`, ctx) !== undefined && { color: optionalString(attrs, "color", `table ${block.label}`, ctx) }),
|
|
249
|
+
...(typeof attrs["limit"] === "number" && { limit: attrs["limit"] }),
|
|
250
|
+
...(attrs["order_by"] !== undefined && { orderBy: orderBy(attrs["order_by"]) }),
|
|
251
|
+
...(attrs["filter"] !== undefined && {
|
|
252
|
+
filter: tableFilterFromTf(attrs["filter"], tableTfLabel, columnKeyByName, ctx, `elementum_table.${tableTfLabel}.filter`),
|
|
253
|
+
}),
|
|
254
|
+
joins,
|
|
255
|
+
columns,
|
|
256
|
+
tableColumns: Object.fromEntries(columns.map((column) => [column.key, column.state])),
|
|
257
|
+
...(datamines.length > 0 && { datamines }),
|
|
258
|
+
...(optionalBoolean(attrs, "editable", `table ${block.label}`, ctx) !== undefined && { editable: optionalBoolean(attrs, "editable", `table ${block.label}`, ctx) }),
|
|
259
|
+
...(optionalBoolean(attrs, "cloud_managed", `table ${block.label}`, ctx) !== undefined && { cloudManaged: optionalBoolean(attrs, "cloud_managed", `table ${block.label}`, ctx) }),
|
|
260
|
+
};
|
|
261
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* v2 table authoring — `defineTable`. Org-owned top-level entity
|
|
2
|
+
* v2 table authoring — `defineTable`. Org-owned top-level entity.
|
|
3
3
|
* Standalone from v1's `src/tables`.
|
|
4
4
|
*/
|
|
5
|
-
export { defineTable, tablePayloadToCreateRequest, tablePayloadToReadOnlyUpdateRequest, tablePayloadToUpdateRequest, type
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
5
|
+
export { defineTable, bigQueryTableMapping, databricksTableMapping, snowflakeTableMapping, snowflakeTableView, tablePayloadToCreateRequest, tablePayloadToReadOnlyUpdateRequest, tablePayloadToUpdateRequest, type DefineTableV2Options, type TableAuthoringPayload, type TableConfigured, type TableView, } from "./build.js";
|
|
6
|
+
export { type TableDatamine, type DatamineSchedule, type DatamineTimeUnit } from "../datamine/build.js";
|
|
7
|
+
export { calculationColumn, bigQueryColumn, serializeTableField, snowflakeColumn, sourceColumn, tableAggregation, tableColumnTag, tableColumnType, tableExpansion, type CalculationColumnOptions, type SourceColumnOptions, type TableAggregation, type TableColumn, type TableColumnTag, type TableColumnType, type TableCalculationField, type TableCloudField, type TableField, type TableExpansion, type TableReferenceField, } from "./fields.js";
|
|
8
|
+
export { serializeJoin, tableJoin, tableJoinType, type TableJoinFieldPair, type TableJoin, type TableJoinOptions, type TableJoinType, } from "./joins.js";
|
|
9
|
+
export * as filter from "../shared/filters/index.js";
|
|
10
|
+
export { type Filter } from "../shared/filters/index.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* v2 table authoring — `defineTable`. Org-owned top-level entity
|
|
2
|
+
* v2 table authoring — `defineTable`. Org-owned top-level entity.
|
|
3
3
|
* Standalone from v1's `src/tables`.
|
|
4
4
|
*/
|
|
5
|
-
export { defineTable, tablePayloadToCreateRequest, tablePayloadToReadOnlyUpdateRequest, tablePayloadToUpdateRequest, } from "./build.js";
|
|
6
|
-
export { calculationColumn,
|
|
7
|
-
export { serializeJoin, tableJoin, } from "./joins.js";
|
|
8
|
-
export
|
|
9
|
-
// `defineTable.fromJSON` has no callable to attach to (
|
|
10
|
-
//
|
|
5
|
+
export { defineTable, bigQueryTableMapping, databricksTableMapping, snowflakeTableMapping, snowflakeTableView, tablePayloadToCreateRequest, tablePayloadToReadOnlyUpdateRequest, tablePayloadToUpdateRequest, } from "./build.js";
|
|
6
|
+
export { calculationColumn, bigQueryColumn, serializeTableField, snowflakeColumn, sourceColumn, tableAggregation, tableColumnTag, tableColumnType, tableExpansion, } from "./fields.js";
|
|
7
|
+
export { serializeJoin, tableJoin, tableJoinType, } from "./joins.js";
|
|
8
|
+
export * as filter from "../shared/filters/index.js";
|
|
9
|
+
// `defineTable.fromJSON` has no callable to attach to (the builder returns a
|
|
10
|
+
// configured object), so the table pull orchestrator
|
|
11
11
|
// ships as a standalone named export — mirroring the other materialize-backed
|
|
12
12
|
// entities (agents, skills, aspects, automations).
|