@elementumai/edk 0.8.2-alpha.6 → 0.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -37
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.d.ts +3 -3
- package/dist-sdk/elementum-entity-client/clients/aspects/models/index.d.ts +1 -1
- package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.d.ts +3 -11
- package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +3 -11
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +1 -1
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +1 -1
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +1 -1
- package/dist-sdk/fs/entity.d.ts +2 -2
- package/dist-sdk/fs/entity.js +1 -1
- package/dist-sdk/pull/missing-report.d.ts +81 -0
- package/dist-sdk/pull/missing-report.js +52 -0
- package/dist-sdk/pull/util.d.ts +1 -1
- package/dist-sdk/pull/util.js +3 -3
- package/dist-sdk/src/catalog/factories.d.ts +96 -23
- package/dist-sdk/src/catalog/factories.js +141 -21
- package/dist-sdk/src/catalog/from-authoring.d.ts +5 -5
- package/dist-sdk/src/catalog/from-authoring.js +20 -10
- package/dist-sdk/src/catalog/index.d.ts +2 -2
- package/dist-sdk/src/catalog/index.js +1 -1
- package/dist-sdk/src/catalog/org.js +63 -4
- package/dist-sdk/src/catalog/render-helpers.d.ts +1 -1
- package/dist-sdk/src/catalog/render-helpers.js +1 -1
- package/dist-sdk/src/catalog/render.d.ts +1 -0
- package/dist-sdk/src/catalog/render.js +8 -2
- package/dist-sdk/src/catalog/token.js +18 -4
- package/dist-sdk/src/catalog/types.d.ts +64 -24
- package/dist-sdk/src/catalog/types.js +12 -4
- package/dist-sdk/src/core/app-to-ui.d.ts +6 -6
- package/dist-sdk/src/core/app-to-ui.js +7 -9
- package/dist-sdk/src/core/index.d.ts +11 -10
- package/dist-sdk/src/core/index.js +10 -9
- package/dist-sdk/src/core/platform-id.d.ts +11 -0
- package/dist-sdk/src/core/platform-id.js +8 -0
- package/dist-sdk/src/{entities/flow/activities/render-catalog.d.ts → core/render-tree.d.ts} +3 -3
- package/dist-sdk/src/{entities/flow/activities/render-catalog.js → core/render-tree.js} +7 -10
- package/dist-sdk/src/core/types/ai-provider.d.ts +1 -1
- package/dist-sdk/src/core/types/ai-provider.js +1 -1
- package/dist-sdk/src/core/types/app.d.ts +78 -52
- package/dist-sdk/src/core/types/app.js +2 -3
- package/dist-sdk/src/core/types/aspect-category.d.ts +4 -4
- package/dist-sdk/src/core/types/aspect-category.js +4 -4
- package/dist-sdk/src/core/types/cloud-link.d.ts +3 -3
- package/dist-sdk/src/core/types/cloud-link.js +3 -3
- package/dist-sdk/src/core/types/display-block.d.ts +2 -2
- package/dist-sdk/src/core/types/display-block.js +2 -2
- package/dist-sdk/src/core/types/group.d.ts +1 -1
- package/dist-sdk/src/core/types/group.js +1 -1
- package/dist-sdk/src/core/types/user.d.ts +1 -1
- package/dist-sdk/src/core/types/user.js +1 -1
- package/dist-sdk/src/core/wire/ref-serializer.js +3 -3
- package/dist-sdk/src/engine/build/context.d.ts +23 -16
- package/dist-sdk/src/engine/entity.d.ts +1 -1
- package/dist-sdk/src/engine/pull/attrs.d.ts +4 -0
- package/dist-sdk/src/engine/pull/attrs.js +17 -0
- package/dist-sdk/src/engine/pull/context.d.ts +73 -0
- package/dist-sdk/src/engine/pull/context.js +14 -0
- package/dist-sdk/src/engine/pull/org.d.ts +10 -0
- package/dist-sdk/src/engine/pull/org.js +35 -0
- package/dist-sdk/src/engine/pull/ref-only.d.ts +37 -0
- package/dist-sdk/src/engine/pull/ref-only.js +204 -0
- package/dist-sdk/src/engine/tf/expr.d.ts +7 -3
- package/dist-sdk/src/engine/tf/expr.js +27 -15
- package/dist-sdk/src/engine/tf/index.d.ts +1 -1
- package/dist-sdk/src/engine/tf/index.js +1 -1
- package/dist-sdk/src/engine/tf/model.d.ts +8 -1
- package/dist-sdk/src/engine/tf/model.js +4 -0
- package/dist-sdk/src/engine/tf/parse.js +13 -2
- package/dist-sdk/src/engine/tf/render.js +4 -0
- package/dist-sdk/src/engine/workspace/authoring-layout.js +4 -2
- package/dist-sdk/src/entities/access-policy/build.d.ts +6 -16
- package/dist-sdk/src/entities/access-policy/build.js +2 -2
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +14 -40
- package/dist-sdk/src/entities/access-policy/from-tf.js +26 -85
- package/dist-sdk/src/entities/access-policy/principal.d.ts +39 -0
- package/dist-sdk/src/entities/access-policy/principal.js +13 -0
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +33 -6
- package/dist-sdk/src/entities/access-policy/to-tf.js +62 -60
- package/dist-sdk/src/entities/agent/build.d.ts +42 -11
- package/dist-sdk/src/entities/agent/build.js +40 -19
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +11 -1
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +180 -45
- package/dist-sdk/src/entities/agent/from-tf.d.ts +3 -1
- package/dist-sdk/src/entities/agent/from-tf.js +17 -12
- package/dist-sdk/src/entities/agent/index.d.ts +5 -2
- package/dist-sdk/src/entities/agent/index.js +4 -2
- package/dist-sdk/src/entities/agent/module.js +7 -2
- package/dist-sdk/src/entities/agent/run-as.d.ts +16 -0
- package/dist-sdk/src/entities/agent/run-as.js +1 -0
- package/dist-sdk/src/entities/agent/to-tf.d.ts +6 -2
- package/dist-sdk/src/entities/agent/to-tf.js +58 -9
- package/dist-sdk/src/entities/agent/tools.d.ts +97 -70
- package/dist-sdk/src/entities/agent/tools.js +63 -43
- package/dist-sdk/src/entities/agent-a2a-skill/from-tf.js +1 -1
- package/dist-sdk/src/entities/agent-a2a-skill/to-tf.js +4 -4
- package/dist-sdk/src/entities/agent-evaluation/build.d.ts +19 -0
- package/dist-sdk/src/entities/agent-evaluation/build.js +41 -0
- package/dist-sdk/src/entities/agent-evaluation/deserializer/print-agent-evaluation.d.ts +4 -0
- package/dist-sdk/src/entities/agent-evaluation/deserializer/print-agent-evaluation.js +30 -0
- package/dist-sdk/src/entities/agent-evaluation/from-tf.d.ts +12 -0
- package/dist-sdk/src/entities/agent-evaluation/from-tf.js +46 -0
- package/dist-sdk/src/entities/agent-evaluation/index.d.ts +1 -0
- package/dist-sdk/src/entities/agent-evaluation/index.js +1 -0
- package/dist-sdk/src/entities/agent-evaluation/module.d.ts +3 -0
- package/dist-sdk/src/entities/agent-evaluation/module.js +58 -0
- package/dist-sdk/src/entities/agent-evaluation/to-tf.d.ts +12 -0
- package/dist-sdk/src/entities/agent-evaluation/to-tf.js +35 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +25 -15
- package/dist-sdk/src/entities/agent-tool/from-tf.js +175 -43
- package/dist-sdk/src/entities/agent-tool/module.js +6 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +15 -7
- package/dist-sdk/src/entities/agent-tool/to-tf.js +169 -48
- package/dist-sdk/src/entities/agent-tool/types.d.ts +4 -6
- package/dist-sdk/src/entities/agent-tool/types.js +30 -29
- package/dist-sdk/src/entities/app/build.d.ts +214 -47
- package/dist-sdk/src/entities/app/build.js +128 -66
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +188 -8
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.d.ts +59 -0
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.js +70 -0
- package/dist-sdk/src/entities/app/display-blocks.d.ts +2 -1
- package/dist-sdk/src/entities/app/display-blocks.js +1 -1
- package/dist-sdk/src/entities/app/from-tf.d.ts +11 -1
- package/dist-sdk/src/entities/app/from-tf.js +30 -2
- package/dist-sdk/src/entities/app/index.d.ts +20 -8
- package/dist-sdk/src/entities/app/index.js +16 -6
- package/dist-sdk/src/entities/app/module.js +29 -4
- package/dist-sdk/src/entities/app/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/app/to-tf.js +97 -7
- package/dist-sdk/src/entities/approval-chain/build.d.ts +31 -16
- package/dist-sdk/src/entities/approval-chain/build.js +49 -49
- package/dist-sdk/src/entities/approval-chain/from-tf.d.ts +17 -0
- package/dist-sdk/src/entities/approval-chain/from-tf.js +57 -0
- package/dist-sdk/src/entities/approval-chain/index.d.ts +2 -3
- package/dist-sdk/src/entities/approval-chain/index.js +2 -3
- package/dist-sdk/src/entities/approval-chain/module.d.ts +3 -0
- package/dist-sdk/src/entities/approval-chain/module.js +51 -0
- package/dist-sdk/src/entities/approval-chain/printer.d.ts +2 -0
- package/dist-sdk/src/entities/approval-chain/printer.js +21 -0
- package/dist-sdk/src/entities/approval-chain/to-tf.d.ts +9 -0
- package/dist-sdk/src/entities/approval-chain/to-tf.js +43 -0
- package/dist-sdk/src/entities/automation/build.d.ts +177 -95
- package/dist-sdk/src/entities/automation/build.js +164 -72
- package/dist-sdk/src/entities/automation/calculation-expression.d.ts +191 -0
- package/dist-sdk/src/entities/automation/calculation-expression.js +57 -0
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +18 -9
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +18 -14
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +214 -311
- package/dist-sdk/src/entities/automation/filter.d.ts +1 -115
- package/dist-sdk/src/entities/automation/filter.js +1 -197
- package/dist-sdk/src/entities/automation/from-tf.d.ts +28 -0
- package/dist-sdk/src/entities/automation/from-tf.js +695 -182
- package/dist-sdk/src/entities/automation/index.d.ts +9 -10
- package/dist-sdk/src/entities/automation/index.js +11 -11
- package/dist-sdk/src/entities/automation/module.js +82 -8
- package/dist-sdk/src/entities/automation/operators.d.ts +32 -48
- package/dist-sdk/src/entities/automation/operators.js +10 -37
- package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +1 -1
- package/dist-sdk/src/entities/automation/output-key-wire-name.js +1 -1
- package/dist-sdk/src/entities/automation/script-code.js +107 -28
- package/dist-sdk/src/entities/automation/serialize.js +1 -1
- package/dist-sdk/src/entities/automation/tasks.d.ts +167 -102
- package/dist-sdk/src/entities/automation/tasks.js +66 -13
- package/dist-sdk/src/entities/automation/to-tf.d.ts +44 -3
- package/dist-sdk/src/entities/automation/to-tf.js +607 -161
- package/dist-sdk/src/entities/automation/triggers.d.ts +33 -25
- package/dist-sdk/src/entities/automation/triggers.js +8 -2
- package/dist-sdk/src/entities/automation/types.d.ts +3 -2
- package/dist-sdk/src/entities/automation/types.js +3 -2
- package/dist-sdk/src/entities/chart/build.d.ts +95 -0
- package/dist-sdk/src/entities/chart/build.js +42 -0
- package/dist-sdk/src/entities/chart/from-tf.d.ts +55 -0
- package/dist-sdk/src/entities/chart/from-tf.js +269 -0
- package/dist-sdk/src/entities/chart/index.d.ts +4 -0
- package/dist-sdk/src/entities/chart/index.js +3 -0
- package/dist-sdk/src/entities/chart/module.d.ts +3 -0
- package/dist-sdk/src/entities/chart/module.js +61 -0
- package/dist-sdk/src/entities/chart/printer.d.ts +5 -0
- package/dist-sdk/src/entities/chart/printer.js +104 -0
- package/dist-sdk/src/entities/chart/to-tf.d.ts +15 -0
- package/dist-sdk/src/entities/chart/to-tf.js +150 -0
- package/dist-sdk/src/entities/chart/types.d.ts +53 -0
- package/dist-sdk/src/entities/chart/types.js +22 -0
- package/dist-sdk/src/entities/dashboard/build.d.ts +44 -0
- package/dist-sdk/src/entities/dashboard/build.js +16 -0
- package/dist-sdk/src/entities/dashboard/from-tf.d.ts +12 -0
- package/dist-sdk/src/entities/dashboard/from-tf.js +113 -0
- package/dist-sdk/src/entities/dashboard/module.d.ts +3 -0
- package/dist-sdk/src/entities/dashboard/module.js +16 -0
- package/dist-sdk/src/entities/dashboard/to-tf.d.ts +43 -0
- package/dist-sdk/src/entities/dashboard/to-tf.js +121 -0
- package/dist-sdk/src/entities/dashboard-widget/module.d.ts +3 -0
- package/dist-sdk/src/entities/dashboard-widget/module.js +10 -0
- package/dist-sdk/src/entities/data-lookup/module.d.ts +3 -0
- package/dist-sdk/src/entities/data-lookup/module.js +22 -0
- package/dist-sdk/src/entities/datamine/build.d.ts +22 -0
- package/dist-sdk/src/entities/datamine/from-tf.d.ts +17 -0
- package/dist-sdk/src/entities/datamine/from-tf.js +98 -0
- package/dist-sdk/src/entities/datamine/module.d.ts +3 -0
- package/dist-sdk/src/entities/datamine/module.js +23 -0
- package/dist-sdk/src/entities/datamine/to-tf.d.ts +11 -0
- package/dist-sdk/src/entities/datamine/to-tf.js +53 -0
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +304 -0
- package/dist-sdk/src/entities/dynamic-layout/build.js +4 -0
- package/dist-sdk/src/entities/dynamic-layout/dialect.d.ts +4 -0
- package/dist-sdk/src/entities/dynamic-layout/dialect.js +47 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.d.ts +10 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.js +239 -0
- package/dist-sdk/src/entities/dynamic-layout/module.d.ts +3 -0
- package/dist-sdk/src/entities/dynamic-layout/module.js +13 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +26 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +267 -0
- package/dist-sdk/src/entities/element/build.d.ts +48 -38
- package/dist-sdk/src/entities/element/build.js +24 -33
- package/dist-sdk/src/entities/element/from-tf.d.ts +9 -1
- package/dist-sdk/src/entities/element/from-tf.js +31 -2
- package/dist-sdk/src/entities/element/index.d.ts +14 -7
- package/dist-sdk/src/entities/element/index.js +11 -5
- package/dist-sdk/src/entities/element/module.js +26 -5
- package/dist-sdk/src/entities/element/to-tf.d.ts +2 -1
- package/dist-sdk/src/entities/element/to-tf.js +64 -4
- package/dist-sdk/src/entities/field/build.d.ts +55 -27
- package/dist-sdk/src/entities/field/build.js +31 -6
- package/dist-sdk/src/entities/field/calc/aggregate.d.ts +52 -21
- package/dist-sdk/src/entities/field/calc/aggregate.js +59 -29
- package/dist-sdk/src/entities/field/calc/date.d.ts +78 -29
- package/dist-sdk/src/entities/field/calc/date.js +120 -29
- package/dist-sdk/src/entities/field/calc/index.d.ts +80 -85
- package/dist-sdk/src/entities/field/calc/index.js +82 -139
- package/dist-sdk/src/entities/field/calc/numeric.d.ts +8 -12
- package/dist-sdk/src/entities/field/calc/numeric.js +10 -27
- package/dist-sdk/src/entities/field/calc/runtime.d.ts +19 -2
- package/dist-sdk/src/entities/field/calc/runtime.js +79 -8
- package/dist-sdk/src/entities/field/calc/text.d.ts +32 -23
- package/dist-sdk/src/entities/field/calc/text.js +43 -31
- package/dist-sdk/src/entities/field/calc/types.d.ts +36 -81
- package/dist-sdk/src/entities/field/calc/types.js +1 -22
- package/dist-sdk/src/entities/field/calc.d.ts +71 -48
- package/dist-sdk/src/entities/field/calc.js +5 -15
- package/dist-sdk/src/entities/field/calculation-types.d.ts +6 -0
- package/dist-sdk/src/entities/field/calculation-types.js +49 -0
- package/dist-sdk/src/entities/field/from-tf.js +238 -13
- package/dist-sdk/src/entities/field/locals.d.ts +11 -3
- package/dist-sdk/src/entities/field/locals.js +15 -2
- package/dist-sdk/src/entities/field/module.d.ts +1 -0
- package/dist-sdk/src/entities/field/module.js +27 -7
- package/dist-sdk/src/entities/field/record-shape.d.ts +25 -11
- package/dist-sdk/src/entities/field/to-tf.d.ts +41 -2
- package/dist-sdk/src/entities/field/to-tf.js +314 -40
- package/dist-sdk/src/entities/field/types.d.ts +1 -1
- package/dist-sdk/src/entities/field/types.js +10 -1
- package/dist-sdk/src/entities/file-reader/build.d.ts +71 -19
- package/dist-sdk/src/entities/file-reader/build.js +49 -4
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.d.ts +1 -0
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +12 -10
- package/dist-sdk/src/entities/file-reader/from-tf.d.ts +1 -1
- package/dist-sdk/src/entities/file-reader/from-tf.js +31 -2
- package/dist-sdk/src/entities/file-reader/index.d.ts +3 -3
- package/dist-sdk/src/entities/file-reader/index.js +3 -3
- package/dist-sdk/src/entities/file-reader/module.js +6 -5
- package/dist-sdk/src/entities/file-reader/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/file-reader/to-tf.js +5 -2
- package/dist-sdk/src/entities/file-reader/types.d.ts +3 -4
- package/dist-sdk/src/entities/file-reader/types.js +4 -5
- package/dist-sdk/src/entities/org/category.js +4 -5
- package/dist-sdk/src/entities/org/cloud-link.js +4 -5
- package/dist-sdk/src/entities/org/email-alias.d.ts +2 -0
- package/dist-sdk/src/entities/org/email-alias.js +12 -0
- package/dist-sdk/src/entities/org/group.js +4 -5
- package/dist-sdk/src/entities/org/index.d.ts +2 -0
- package/dist-sdk/src/entities/org/index.js +2 -0
- package/dist-sdk/src/entities/org/phone-provider.d.ts +4 -0
- package/dist-sdk/src/entities/org/phone-provider.js +30 -0
- package/dist-sdk/src/entities/org/role.d.ts +3 -3
- package/dist-sdk/src/entities/org/role.js +9 -6
- package/dist-sdk/src/entities/organization/build.d.ts +241 -0
- package/dist-sdk/src/entities/organization/build.js +165 -0
- package/dist-sdk/src/entities/organization/index.d.ts +2 -0
- package/dist-sdk/src/entities/organization/index.js +2 -0
- package/dist-sdk/src/entities/organization/module.d.ts +2 -0
- package/dist-sdk/src/entities/organization/module.js +21 -0
- package/dist-sdk/src/entities/organization/to-tf.d.ts +7 -0
- package/dist-sdk/src/entities/organization/to-tf.js +154 -0
- package/dist-sdk/src/entities/phone-service/build.d.ts +17 -0
- package/dist-sdk/src/entities/phone-service/build.js +31 -0
- package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.d.ts +4 -0
- package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.js +56 -0
- package/dist-sdk/src/entities/phone-service/from-tf.d.ts +25 -0
- package/dist-sdk/src/entities/phone-service/from-tf.js +75 -0
- package/dist-sdk/src/entities/phone-service/index.d.ts +2 -0
- package/dist-sdk/src/entities/phone-service/index.js +2 -0
- package/dist-sdk/src/entities/phone-service/module.d.ts +3 -0
- package/dist-sdk/src/entities/phone-service/module.js +55 -0
- package/dist-sdk/src/entities/phone-service/to-tf.d.ts +12 -0
- package/dist-sdk/src/entities/phone-service/to-tf.js +54 -0
- package/dist-sdk/src/entities/phone-service/types.d.ts +35 -0
- package/dist-sdk/src/entities/phone-service/types.js +22 -0
- package/dist-sdk/src/entities/record-create-form/from-tf.d.ts +11 -0
- package/dist-sdk/src/entities/record-create-form/from-tf.js +74 -0
- package/dist-sdk/src/entities/record-create-form/module.d.ts +11 -0
- package/dist-sdk/src/entities/record-create-form/module.js +24 -0
- package/dist-sdk/src/entities/record-create-form/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/record-create-form/to-tf.js +88 -0
- package/dist-sdk/src/entities/relationship/build.d.ts +16 -0
- package/dist-sdk/src/entities/relationship/build.js +1 -0
- package/dist-sdk/src/entities/relationship/from-tf.d.ts +12 -0
- package/dist-sdk/src/entities/relationship/from-tf.js +109 -0
- package/dist-sdk/src/entities/relationship/module.d.ts +3 -0
- package/dist-sdk/src/entities/relationship/module.js +16 -0
- package/dist-sdk/src/entities/relationship/to-tf.d.ts +32 -0
- package/dist-sdk/src/entities/relationship/to-tf.js +145 -0
- package/dist-sdk/src/entities/role/build.d.ts +65 -0
- package/dist-sdk/src/entities/role/build.js +33 -0
- package/dist-sdk/src/entities/role/from-tf.d.ts +13 -0
- package/dist-sdk/src/entities/role/from-tf.js +138 -0
- package/dist-sdk/src/entities/role/to-tf.d.ts +13 -0
- package/dist-sdk/src/entities/role/to-tf.js +69 -0
- package/dist-sdk/src/entities/search-table/build.d.ts +67 -28
- package/dist-sdk/src/entities/search-table/build.js +110 -56
- package/dist-sdk/src/entities/search-table/from-tf.d.ts +37 -0
- package/dist-sdk/src/entities/search-table/from-tf.js +113 -0
- package/dist-sdk/src/entities/search-table/index.d.ts +2 -2
- package/dist-sdk/src/entities/search-table/index.js +2 -2
- package/dist-sdk/src/entities/search-table/module.js +88 -10
- package/dist-sdk/src/entities/search-table/printer.d.ts +2 -0
- package/dist-sdk/src/entities/search-table/printer.js +52 -0
- package/dist-sdk/src/entities/search-table/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/search-table/to-tf.js +104 -0
- package/dist-sdk/src/entities/search-table/types.d.ts +8 -0
- package/dist-sdk/src/entities/search-table/types.js +21 -0
- package/dist-sdk/src/entities/service-account/build.d.ts +32 -0
- package/dist-sdk/src/entities/service-account/build.js +9 -0
- package/dist-sdk/src/entities/service-account/from-tf.d.ts +10 -0
- package/dist-sdk/src/entities/service-account/from-tf.js +109 -0
- package/dist-sdk/src/entities/service-account/module.d.ts +4 -0
- package/dist-sdk/src/entities/service-account/module.js +21 -0
- package/dist-sdk/src/entities/service-account/ref.d.ts +11 -0
- package/dist-sdk/src/entities/service-account/ref.js +5 -0
- package/dist-sdk/src/entities/service-account/to-tf.d.ts +32 -0
- package/dist-sdk/src/entities/service-account/to-tf.js +103 -0
- package/dist-sdk/src/entities/shared/connector-from-tf.d.ts +14 -0
- package/dist-sdk/src/entities/shared/connector-from-tf.js +14 -0
- package/dist-sdk/src/entities/shared/context.d.ts +25 -24
- package/dist-sdk/src/entities/shared/context.js +36 -35
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +30 -81
- package/dist-sdk/src/entities/shared/filters/ast.js +6 -2
- package/dist-sdk/src/entities/shared/filters/index.d.ts +95 -206
- package/dist-sdk/src/entities/shared/filters/index.js +196 -341
- package/dist-sdk/src/entities/shared/filters/print.d.ts +11 -0
- package/dist-sdk/src/entities/shared/filters/print.js +122 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +170 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +527 -0
- package/dist-sdk/src/entities/shared/filters/types.d.ts +66 -69
- package/dist-sdk/src/entities/shared/filters/types.js +2 -3
- package/dist-sdk/src/entities/shared/foreign-ref.d.ts +14 -0
- package/dist-sdk/src/entities/shared/foreign-ref.js +12 -0
- package/dist-sdk/src/entities/shared/ref.d.ts +26 -11
- package/dist-sdk/src/entities/shared/ref.js +8 -3
- package/dist-sdk/src/entities/shared/types/common.d.ts +2 -2
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +1 -1
- package/dist-sdk/src/entities/shared/types/field-types.js +1 -1
- package/dist-sdk/src/entities/skill/build.d.ts +4 -4
- package/dist-sdk/src/entities/skill/build.js +6 -5
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +11 -1
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +100 -39
- package/dist-sdk/src/entities/skill/index.d.ts +3 -2
- package/dist-sdk/src/entities/skill/index.js +3 -2
- package/dist-sdk/src/entities/skill/module.js +8 -2
- package/dist-sdk/src/entities/skill/to-tf.d.ts +6 -2
- package/dist-sdk/src/entities/skill/to-tf.js +20 -2
- package/dist-sdk/src/entities/skill/tools.d.ts +47 -31
- package/dist-sdk/src/entities/skill/tools.js +37 -23
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +17 -1
- package/dist-sdk/src/entities/skill-tool/from-tf.js +118 -8
- package/dist-sdk/src/entities/skill-tool/module.js +9 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +6 -1
- package/dist-sdk/src/entities/skill-tool/to-tf.js +100 -48
- package/dist-sdk/src/entities/skill-tool/types.js +18 -1
- package/dist-sdk/src/entities/table/build.d.ts +64 -23
- package/dist-sdk/src/entities/table/build.js +41 -26
- package/dist-sdk/src/entities/table/catalog-render.js +15 -1
- package/dist-sdk/src/entities/table/deserializer/normalize.d.ts +99 -0
- package/dist-sdk/src/entities/table/deserializer/normalize.js +192 -0
- package/dist-sdk/src/entities/table/fields/types.d.ts +86 -0
- package/dist-sdk/src/entities/table/fields/types.js +12 -0
- package/dist-sdk/src/entities/table/fields.d.ts +107 -47
- package/dist-sdk/src/entities/table/fields.js +76 -55
- package/dist-sdk/src/entities/table/from-tf.d.ts +4 -0
- package/dist-sdk/src/entities/table/from-tf.js +261 -0
- package/dist-sdk/src/entities/table/index.d.ts +7 -5
- package/dist-sdk/src/entities/table/index.js +7 -7
- package/dist-sdk/src/entities/table/joins.d.ts +22 -9
- package/dist-sdk/src/entities/table/joins.js +8 -16
- package/dist-sdk/src/entities/table/module.d.ts +2 -1
- package/dist-sdk/src/entities/table/module.js +13 -6
- package/dist-sdk/src/entities/table/to-tf.d.ts +10 -0
- package/dist-sdk/src/entities/table/to-tf.js +222 -0
- package/dist-sdk/src/entities/task/build.d.ts +43 -0
- package/dist-sdk/src/entities/task/build.js +17 -0
- package/dist-sdk/src/entities/task/from-tf.d.ts +28 -0
- package/dist-sdk/src/entities/task/from-tf.js +38 -0
- package/dist-sdk/src/entities/task/index.d.ts +1 -0
- package/dist-sdk/src/entities/task/index.js +1 -0
- package/dist-sdk/src/entities/task/module.d.ts +3 -0
- package/dist-sdk/src/entities/task/module.js +12 -0
- package/dist-sdk/src/entities/task/to-tf.d.ts +9 -0
- package/dist-sdk/src/entities/task/to-tf.js +49 -0
- package/dist-sdk/src/entities/view/build.d.ts +46 -0
- package/dist-sdk/src/entities/view/build.js +19 -0
- package/dist-sdk/src/entities/view/from-tf.d.ts +7 -2
- package/dist-sdk/src/entities/view/from-tf.js +264 -30
- package/dist-sdk/src/entities/view/module.d.ts +6 -13
- package/dist-sdk/src/entities/view/module.js +12 -15
- package/dist-sdk/src/entities/view/sharing.d.ts +10 -0
- package/dist-sdk/src/entities/view/sharing.js +6 -0
- package/dist-sdk/src/entities/view/to-tf.d.ts +56 -12
- package/dist-sdk/src/entities/view/to-tf.js +192 -20
- package/dist-sdk/src/entities/view/types.d.ts +8 -0
- package/dist-sdk/src/entities/view/types.js +46 -0
- package/dist-sdk/src/entities/visual-flow/build.d.ts +87 -0
- package/dist-sdk/src/entities/visual-flow/build.js +72 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.d.ts +49 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.js +124 -0
- package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -0
- package/dist-sdk/src/entities/visual-flow/index.js +1 -0
- package/dist-sdk/src/entities/visual-flow/module.d.ts +3 -0
- package/dist-sdk/src/entities/visual-flow/module.js +41 -0
- package/dist-sdk/src/entities/visual-flow/printer.d.ts +8 -0
- package/dist-sdk/src/entities/visual-flow/printer.js +92 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.d.ts +15 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.js +97 -0
- package/dist-sdk/src/entities/widget/build.d.ts +55 -0
- package/dist-sdk/src/entities/widget/build.js +1 -0
- package/dist-sdk/src/entities/widget/from-tf.d.ts +11 -0
- package/dist-sdk/src/entities/widget/from-tf.js +209 -0
- package/dist-sdk/src/entities/widget/module.d.ts +3 -0
- package/dist-sdk/src/entities/widget/module.js +16 -0
- package/dist-sdk/src/entities/widget/to-tf.d.ts +45 -0
- package/dist-sdk/src/entities/widget/to-tf.js +206 -0
- package/dist-sdk/src/graph/deferred-catalog-render.d.ts +1 -1
- package/dist-sdk/src/graph/deferred-catalog-render.js +1 -1
- package/dist-sdk/src/graph/index.d.ts +12 -1
- package/dist-sdk/src/graph/index.js +8 -19
- package/dist-sdk/src/graph/modules.js +35 -1
- package/dist-sdk/src/graph/types.d.ts +106 -7
- package/dist-sdk/src/internal/safe-identifier.d.ts +4 -0
- package/dist-sdk/src/internal/safe-identifier.js +13 -0
- package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
- package/dist-sdk/src/internal/sdk-package.js +5 -2
- package/package.json +39 -15
- package/dist-sdk/src/entities/access-policy/filter.d.ts +0 -61
- package/dist-sdk/src/entities/access-policy/filter.js +0 -83
- package/dist-sdk/src/entities/approval-chain/steps.d.ts +0 -24
- package/dist-sdk/src/entities/approval-chain/steps.js +0 -20
- package/dist-sdk/src/entities/flow/activities/agent.d.ts +0 -15
- package/dist-sdk/src/entities/flow/activities/agent.js +0 -29
- package/dist-sdk/src/entities/flow/activities/approval.d.ts +0 -9
- package/dist-sdk/src/entities/flow/activities/approval.js +0 -18
- package/dist-sdk/src/entities/flow/activities/automation.d.ts +0 -12
- package/dist-sdk/src/entities/flow/activities/automation.js +0 -22
- package/dist-sdk/src/entities/flow/activities/ctx.d.ts +0 -34
- package/dist-sdk/src/entities/flow/activities/ctx.js +0 -38
- package/dist-sdk/src/entities/flow/activities/form.d.ts +0 -22
- package/dist-sdk/src/entities/flow/activities/form.js +0 -36
- package/dist-sdk/src/entities/flow/activities/index.d.ts +0 -14
- package/dist-sdk/src/entities/flow/activities/index.js +0 -13
- package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +0 -39
- package/dist-sdk/src/entities/flow/activities/input-refs.js +0 -19
- package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +0 -13
- package/dist-sdk/src/entities/flow/activities/prompt-template.js +0 -34
- package/dist-sdk/src/entities/flow/activities/types.d.ts +0 -33
- package/dist-sdk/src/entities/flow/build.d.ts +0 -38
- package/dist-sdk/src/entities/flow/build.js +0 -115
- package/dist-sdk/src/entities/flow/index.d.ts +0 -8
- package/dist-sdk/src/entities/flow/index.js +0 -7
- package/dist-sdk/src/entities/flow/serialize.d.ts +0 -51
- package/dist-sdk/src/entities/flow/serialize.js +0 -94
- package/dist-sdk/src/entities/flow/util.d.ts +0 -27
- package/dist-sdk/src/entities/flow/util.js +0 -38
- package/dist-sdk/src/entities/table/filter.d.ts +0 -41
- package/dist-sdk/src/entities/table/filter.js +0 -89
- /package/dist-sdk/src/entities/{flow/activities/types.js → datamine/build.js} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const roleAutoShare = {
|
|
2
|
+
approvalChain: "APPROVAL_CHAIN",
|
|
3
|
+
assignee: "ASSIGNEE",
|
|
4
|
+
mention: "MENTION",
|
|
5
|
+
recordShare: "RECORD_SHARE",
|
|
6
|
+
watcher: "WATCHER",
|
|
7
|
+
};
|
|
8
|
+
export const rolePermissionGroup = {
|
|
9
|
+
agents: "AGENTS",
|
|
10
|
+
aiProviders: "AI_PROVIDERS",
|
|
11
|
+
analytics: "ANALYTICS",
|
|
12
|
+
apps: "APPS",
|
|
13
|
+
attachments: "ATTACHMENTS",
|
|
14
|
+
automations: "AUTOMATIONS",
|
|
15
|
+
conversations: "CONVERSATIONS",
|
|
16
|
+
records: "RECORDS",
|
|
17
|
+
relationships: "RELATIONSHIPS",
|
|
18
|
+
services: "SERVICES",
|
|
19
|
+
slas: "SLAS",
|
|
20
|
+
users: "USERS",
|
|
21
|
+
};
|
|
22
|
+
export const rolePermissionLevel = {
|
|
23
|
+
admin: "ADMIN",
|
|
24
|
+
edit: "EDIT",
|
|
25
|
+
view: "VIEW",
|
|
26
|
+
none: "NONE",
|
|
27
|
+
custom: "CUSTOM",
|
|
28
|
+
};
|
|
29
|
+
export function userRef(email) {
|
|
30
|
+
if (!email.includes("@"))
|
|
31
|
+
throw new Error("userRef requires an email address.");
|
|
32
|
+
return { __kind: "user", email };
|
|
33
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type FromTfContext } from "../../engine/pull/context.js";
|
|
2
|
+
import { type ChildResourceScope, type TfBlock } from "../../engine/tf/index.js";
|
|
3
|
+
import type { AppRole } from "./build.js";
|
|
4
|
+
export interface NormalizedRole extends AppRole {
|
|
5
|
+
readonly key: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function rolesFromTf(blocks: readonly TfBlock[], owner: {
|
|
8
|
+
readonly type: string;
|
|
9
|
+
readonly label: string;
|
|
10
|
+
readonly ownerRefName: string;
|
|
11
|
+
readonly ownerTfLabel: string;
|
|
12
|
+
readonly scope: ChildResourceScope;
|
|
13
|
+
}, ctx: FromTfContext): NormalizedRole[];
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { dataRefLabel, resourceRefLabel } from "../../engine/pull/context.js";
|
|
2
|
+
import { scopedLabelToBagKey, tfLabelToTsLabel } from "../../engine/tf/index.js";
|
|
3
|
+
import { ROLE_RESOURCE_TYPE } from "../org/role.js";
|
|
4
|
+
const KNOWN = new Set(["id", "object_id", "name", "description", "auto_share", "user_ids", "group_ids", "service_account_ids", "permissions", "managed", "tags"]);
|
|
5
|
+
function strings(value, where, ctx) {
|
|
6
|
+
if (value === undefined)
|
|
7
|
+
return undefined;
|
|
8
|
+
if (!Array.isArray(value) || !value.every((item) => typeof item === "string")) {
|
|
9
|
+
ctx.diagnostics.push(`${where}: expected a string list; dropped`);
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
function principal(value, type, where, ctx) {
|
|
15
|
+
const label = dataRefLabel(value, type);
|
|
16
|
+
if (label !== undefined) {
|
|
17
|
+
const name = ctx.dataName(type, label);
|
|
18
|
+
if (name !== undefined)
|
|
19
|
+
return type === "elementum_user"
|
|
20
|
+
? { __kind: "user", email: name }
|
|
21
|
+
: { __kind: "group", refName: tfLabelToTsLabel(label), name };
|
|
22
|
+
ctx.diagnostics.push(`${where}: data.${type}.${label} has no lookup value; dropped`);
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
if (typeof value === "string")
|
|
26
|
+
ctx.diagnostics.push(`${where}: raw platform ids are not part of the public EDK API; dropped`);
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
function principalList(value, type, where, ctx) {
|
|
30
|
+
if (value === undefined)
|
|
31
|
+
return undefined;
|
|
32
|
+
if (!Array.isArray(value)) {
|
|
33
|
+
ctx.diagnostics.push(`${where}: expected a list; dropped`);
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
const out = value.flatMap((item) => (type === "elementum_user"
|
|
37
|
+
? principal(item, "elementum_user", where, ctx)
|
|
38
|
+
: principal(item, "elementum_group", where, ctx)) ?? []);
|
|
39
|
+
return out.length > 0 ? out : undefined;
|
|
40
|
+
}
|
|
41
|
+
function permissions(value, where, ctx) {
|
|
42
|
+
if (value === undefined)
|
|
43
|
+
return undefined;
|
|
44
|
+
if (!Array.isArray(value)) {
|
|
45
|
+
ctx.diagnostics.push(`${where}: expected a list; dropped`);
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
const out = [];
|
|
49
|
+
for (const item of value) {
|
|
50
|
+
if (item === null || typeof item !== "object" || Array.isArray(item)) {
|
|
51
|
+
ctx.diagnostics.push(`${where}: malformed permission; dropped`);
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const p = item;
|
|
55
|
+
if (typeof p["group"] !== "string" || typeof p["level"] !== "string") {
|
|
56
|
+
ctx.diagnostics.push(`${where}: permission needs group and level; dropped`);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const level = p["level"];
|
|
60
|
+
// The platform export contains its implicit full permission matrix. NONE
|
|
61
|
+
// rows are defaults, not authored intent, and retaining them makes a pull
|
|
62
|
+
// noisy and order-sensitive on the very next plan.
|
|
63
|
+
if (level === "NONE")
|
|
64
|
+
continue;
|
|
65
|
+
out.push({
|
|
66
|
+
group: p["group"],
|
|
67
|
+
level,
|
|
68
|
+
...(strings(p["custom_permissions"], `${where}.custom_permissions`, ctx) !== undefined && { customPermissions: strings(p["custom_permissions"], `${where}.custom_permissions`, ctx) }),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return out.length > 0 ? out : undefined;
|
|
72
|
+
}
|
|
73
|
+
export function rolesFromTf(blocks, owner, ctx) {
|
|
74
|
+
return blocks.flatMap((block) => {
|
|
75
|
+
const label = block.label ?? "";
|
|
76
|
+
const where = `${ROLE_RESOURCE_TYPE}.${label || "?"}`;
|
|
77
|
+
if (label === "" || resourceRefLabel(block.attrs["object_id"], owner.type) !== owner.label)
|
|
78
|
+
return [];
|
|
79
|
+
for (const key of Object.keys(block.attrs))
|
|
80
|
+
if (!KNOWN.has(key))
|
|
81
|
+
ctx.diagnostics.push(`${where}: unhandled attribute ${JSON.stringify(key)}`);
|
|
82
|
+
if (typeof block.attrs["name"] !== "string") {
|
|
83
|
+
ctx.diagnostics.push(`${where}: name is required; skipped`);
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
const autoShare = strings(block.attrs["auto_share"], `${where}.auto_share`, ctx);
|
|
87
|
+
const serviceAccountsValue = block.attrs["service_account_ids"];
|
|
88
|
+
let serviceAccounts;
|
|
89
|
+
if (serviceAccountsValue !== undefined) {
|
|
90
|
+
if (!Array.isArray(serviceAccountsValue)) {
|
|
91
|
+
ctx.diagnostics.push(`${where}.service_account_ids: expected a list; dropped`);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
serviceAccounts = [];
|
|
95
|
+
for (const value of serviceAccountsValue) {
|
|
96
|
+
const resourceLabel = resourceRefLabel(value, "elementum_service_account");
|
|
97
|
+
if (resourceLabel !== undefined) {
|
|
98
|
+
const account = blocks.find((candidate) => candidate.type === "elementum_service_account" && candidate.label === resourceLabel);
|
|
99
|
+
const explicitName = account?.attrs["name"];
|
|
100
|
+
const firstName = account?.attrs["first_name"];
|
|
101
|
+
const lastName = account?.attrs["last_name"];
|
|
102
|
+
const name = typeof explicitName === "string"
|
|
103
|
+
? explicitName
|
|
104
|
+
: typeof firstName === "string" && typeof lastName === "string" ? `${firstName} ${lastName}` : undefined;
|
|
105
|
+
if (name !== undefined)
|
|
106
|
+
serviceAccounts.push({ __kind: "serviceAccount", appRefName: owner.ownerRefName, name });
|
|
107
|
+
else
|
|
108
|
+
ctx.diagnostics.push(`${where}.service_account_ids: ${resourceLabel} has no recoverable display name; dropped`);
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const dataLabel = dataRefLabel(value, "elementum_service_account");
|
|
112
|
+
const name = dataLabel === undefined ? undefined : ctx.dataName("elementum_service_account", dataLabel);
|
|
113
|
+
if (name !== undefined) {
|
|
114
|
+
serviceAccounts.push({ __kind: "serviceAccount", appRefName: owner.ownerRefName, name });
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
if (typeof value === "string")
|
|
118
|
+
ctx.diagnostics.push(`${where}.service_account_ids: raw platform ids are not part of the public EDK API; dropped`);
|
|
119
|
+
else
|
|
120
|
+
ctx.diagnostics.push(`${where}.service_account_ids: unrecognized expression; dropped`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const users = principalList(block.attrs["user_ids"], "elementum_user", `${where}.user_ids`, ctx);
|
|
125
|
+
const groups = principalList(block.attrs["group_ids"], "elementum_group", `${where}.group_ids`, ctx);
|
|
126
|
+
const rolePermissions = permissions(block.attrs["permissions"], `${where}.permissions`, ctx);
|
|
127
|
+
return [{
|
|
128
|
+
key: scopedLabelToBagKey(owner.ownerTfLabel, label, owner.scope),
|
|
129
|
+
name: block.attrs["name"],
|
|
130
|
+
...(typeof block.attrs["description"] === "string" && { description: block.attrs["description"] }),
|
|
131
|
+
...(autoShare !== undefined && { autoShare }),
|
|
132
|
+
...(users !== undefined && { users }),
|
|
133
|
+
...(groups !== undefined && { groups }),
|
|
134
|
+
...(serviceAccounts !== undefined && serviceAccounts.length > 0 && { serviceAccounts }),
|
|
135
|
+
...(rolePermissions !== undefined && { permissions: rolePermissions }),
|
|
136
|
+
}];
|
|
137
|
+
});
|
|
138
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { OrgRefLookup } from "../../engine/build/context.js";
|
|
2
|
+
import { type ChildResourceScope, type TfBlock, type TfValue } from "../../engine/tf/index.js";
|
|
3
|
+
import type { AppRole } from "./build.js";
|
|
4
|
+
import type { AppServiceAccount } from "../service-account/build.js";
|
|
5
|
+
export declare function rolesToTf(roles: Readonly<Record<string, AppRole>> | undefined, opts: {
|
|
6
|
+
readonly ownerRefName: string;
|
|
7
|
+
readonly ownerTfLabel: string;
|
|
8
|
+
readonly scope: ChildResourceScope;
|
|
9
|
+
readonly objectId: TfValue;
|
|
10
|
+
readonly serviceAccounts?: Readonly<Record<string, AppServiceAccount>>;
|
|
11
|
+
readonly orgRefs: OrgRefLookup;
|
|
12
|
+
readonly diagnostics: string[];
|
|
13
|
+
}): TfBlock[];
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { expr, sanitizeName, scopedResourceLabel, tsLabelToTfLabel } from "../../engine/tf/index.js";
|
|
2
|
+
import { ROLE_RESOURCE_TYPE } from "../org/role.js";
|
|
3
|
+
import { SERVICE_ACCOUNT_RESOURCE_TYPE } from "../service-account/module.js";
|
|
4
|
+
function principals(values, type, where, orgRefs, diagnostics) {
|
|
5
|
+
if (values === undefined || values.length === 0)
|
|
6
|
+
return undefined;
|
|
7
|
+
const out = [];
|
|
8
|
+
for (const value of values) {
|
|
9
|
+
const user = value;
|
|
10
|
+
if (type === "elementum_user" && user?.__kind === "user" && user.email) {
|
|
11
|
+
const label = sanitizeName(user.email.split("@", 1)[0] ?? user.email);
|
|
12
|
+
orgRefs.rawLookup(type, label, user.email);
|
|
13
|
+
out.push(expr.dataAttr(type, label, ["id"]));
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
const token = value;
|
|
17
|
+
if (type === "elementum_group" && token?.__kind === "group") {
|
|
18
|
+
const resolved = orgRefs.byTsLabel("groups", token.refName ?? "");
|
|
19
|
+
if (resolved === undefined)
|
|
20
|
+
diagnostics.push(`${where}: group token ${JSON.stringify(token.refName ?? "")} is not in org.ts; dropped`);
|
|
21
|
+
else
|
|
22
|
+
out.push(expr.dataAttr(type, resolved.tfLabel, ["id"]));
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
diagnostics.push(`${where}: unrecognized typed principal; dropped`);
|
|
26
|
+
}
|
|
27
|
+
return out.length > 0 ? out : undefined;
|
|
28
|
+
}
|
|
29
|
+
export function rolesToTf(roles, opts) {
|
|
30
|
+
return Object.entries(roles ?? {}).map(([key, role]) => {
|
|
31
|
+
const attrs = { object_id: opts.objectId, name: role.name };
|
|
32
|
+
if (role.description !== undefined)
|
|
33
|
+
attrs["description"] = role.description;
|
|
34
|
+
if (role.autoShare !== undefined)
|
|
35
|
+
attrs["auto_share"] = [...role.autoShare].sort();
|
|
36
|
+
const users = principals(role.users, "elementum_user", `roles.${key}.users`, opts.orgRefs, opts.diagnostics);
|
|
37
|
+
const groups = principals(role.groups, "elementum_group", `roles.${key}.groups`, opts.orgRefs, opts.diagnostics);
|
|
38
|
+
if (users !== undefined)
|
|
39
|
+
attrs["user_ids"] = users;
|
|
40
|
+
if (groups !== undefined)
|
|
41
|
+
attrs["group_ids"] = groups;
|
|
42
|
+
if (role.serviceAccounts !== undefined) {
|
|
43
|
+
attrs["service_account_ids"] = role.serviceAccounts.flatMap((account) => {
|
|
44
|
+
if (account.appRefName !== opts.ownerRefName) {
|
|
45
|
+
opts.diagnostics.push(`roles.${key}.serviceAccounts: ${JSON.stringify(account.name)} belongs to app ${JSON.stringify(account.appRefName)}, not ${JSON.stringify(opts.ownerRefName)}; dropped`);
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
const local = Object.entries(opts.serviceAccounts ?? {}).find(([, candidate]) => `${candidate.firstName} ${candidate.lastName}` === account.name);
|
|
49
|
+
if (local !== undefined)
|
|
50
|
+
return [expr.resourceAttr(SERVICE_ACCOUNT_RESOURCE_TYPE, scopedResourceLabel(opts.ownerTfLabel, tsLabelToTfLabel(local[0]), "app"), ["id"])];
|
|
51
|
+
const label = sanitizeName(account.name);
|
|
52
|
+
opts.orgRefs.rawLookup(SERVICE_ACCOUNT_RESOURCE_TYPE, label, account.name, { app_id: opts.objectId });
|
|
53
|
+
return [expr.dataAttr(SERVICE_ACCOUNT_RESOURCE_TYPE, label, ["id"])];
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (role.permissions !== undefined)
|
|
57
|
+
attrs["permissions"] = [...role.permissions].sort((a, b) => a.group.localeCompare(b.group)).map((permission) => ({
|
|
58
|
+
group: permission.group,
|
|
59
|
+
level: permission.level,
|
|
60
|
+
...(permission.customPermissions !== undefined && { custom_permissions: [...permission.customPermissions] }),
|
|
61
|
+
}));
|
|
62
|
+
return {
|
|
63
|
+
kind: "resource",
|
|
64
|
+
type: ROLE_RESOURCE_TYPE,
|
|
65
|
+
label: scopedResourceLabel(opts.ownerTfLabel, tsLabelToTfLabel(key), opts.scope),
|
|
66
|
+
attrs,
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
}
|
|
@@ -1,41 +1,80 @@
|
|
|
1
|
+
/** Type-safe search-table authoring with provider variants kept private. */
|
|
1
2
|
import type { SearchTableTimeUnit } from "../../../elementum-entity-client/clients/search-tables/models/index.js";
|
|
2
|
-
import { type CloudLinkRef, type
|
|
3
|
+
import { type AiServiceRef, type CloudLinkRef, type ElementCatalogRef, type FieldRef, type SearchTableRef, type TableRef } from "../../catalog/index.js";
|
|
3
4
|
import type { DeployableEntity, EntityDeployOptions } from "../../engine/entity.js";
|
|
4
5
|
export type { SearchTableTimeUnit } from "../../../elementum-entity-client/clients/search-tables/models/index.js";
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
readonly
|
|
8
|
-
|
|
6
|
+
declare const searchTableDurationBrand: unique symbol;
|
|
7
|
+
export type SearchTableDuration = SearchTableTimeUnit & {
|
|
8
|
+
readonly [searchTableDurationBrand]: "SearchTableDuration";
|
|
9
|
+
};
|
|
10
|
+
export declare const searchTableDuration: {
|
|
11
|
+
readonly seconds: SearchTableDuration;
|
|
12
|
+
readonly minutes: SearchTableDuration;
|
|
13
|
+
readonly hours: SearchTableDuration;
|
|
14
|
+
readonly days: SearchTableDuration;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A managed or linked search table is owned by an ELEMENT — never an app. An
|
|
18
|
+
* app's backing Snowflake table is hybrid and Cortex cannot index one (the
|
|
19
|
+
* platform rejects it with "AI Search Tables cannot be created on hybrid
|
|
20
|
+
* tables (target object has storageType HYBRID)").
|
|
21
|
+
*
|
|
22
|
+
* Table-owned search is a separate product concept with its own builder,
|
|
23
|
+
* `tableSearchTable`, so `TableRef` deliberately does not appear here.
|
|
24
|
+
*/
|
|
25
|
+
type SearchTableOwner = ElementCatalogRef;
|
|
26
|
+
/** One vector-index column plus the AI service that indexes it. */
|
|
27
|
+
export interface VectorIndex<Owner extends SearchTableOwner = SearchTableOwner> {
|
|
28
|
+
readonly field: FieldRef<Owner["refName"]>;
|
|
29
|
+
readonly service: AiServiceRef;
|
|
9
30
|
}
|
|
10
|
-
|
|
11
|
-
readonly
|
|
31
|
+
type OwnerOption<Owner extends SearchTableOwner> = {
|
|
32
|
+
readonly element: Owner;
|
|
33
|
+
};
|
|
34
|
+
type OwnedField<Owner extends SearchTableOwner> = Owner extends {
|
|
35
|
+
readonly fields: infer Fields;
|
|
36
|
+
} ? Fields extends Readonly<Record<string, FieldRef>> ? Fields[keyof Fields] : FieldRef<Owner["refName"]> : FieldRef<Owner["refName"]>;
|
|
37
|
+
type CommonOptions<Owner extends SearchTableOwner> = EntityDeployOptions & OwnerOption<Owner> & {
|
|
12
38
|
readonly name: string;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export
|
|
16
|
-
readonly
|
|
17
|
-
|
|
18
|
-
readonly attributeFields: readonly FieldRef[];
|
|
19
|
-
readonly duration: SearchTableTimeUnit;
|
|
39
|
+
};
|
|
40
|
+
/** Options for an Elementum-managed element search table. */
|
|
41
|
+
export type DefineSearchTableOptions<Owner extends SearchTableOwner = SearchTableOwner> = CommonOptions<Owner> & {
|
|
42
|
+
readonly attributeFields: readonly [OwnedField<Owner>, ...OwnedField<Owner>[]];
|
|
43
|
+
readonly duration: SearchTableDuration;
|
|
20
44
|
readonly targetLag: number;
|
|
21
|
-
readonly textIndexFields?: readonly
|
|
22
|
-
readonly
|
|
45
|
+
readonly textIndexFields?: readonly [OwnedField<Owner>, ...OwnedField<Owner>[]];
|
|
46
|
+
readonly vectorIndex: VectorIndex<Owner>;
|
|
23
47
|
readonly warehouse?: string;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
export interface SearchTableLinkedV2Options extends CommonOptions {
|
|
30
|
-
readonly kind: "linked";
|
|
48
|
+
readonly creationTimeout?: string;
|
|
49
|
+
};
|
|
50
|
+
/** Options for linking an existing Cortex Search Service. */
|
|
51
|
+
export type DefineLinkedSearchTableOptions<Owner extends SearchTableOwner = SearchTableOwner> = CommonOptions<Owner> & {
|
|
31
52
|
readonly cloudLink: CloudLinkRef;
|
|
32
53
|
readonly database: string;
|
|
33
54
|
readonly schema: string;
|
|
34
55
|
readonly serviceName: string;
|
|
35
56
|
readonly warehouse?: string;
|
|
36
|
-
}
|
|
37
|
-
export type DefineSearchTableV2Options = SearchTableSnowflakeV2Options | SearchTableLinkedV2Options;
|
|
38
|
-
/** Build a v2 search-table entity (app-owned; create-only), returning DeployableEntity with `.ref`. */
|
|
39
|
-
export declare function defineSearchTable(opts: DefineSearchTableV2Options): DeployableEntity & {
|
|
40
|
-
readonly ref: SearchTableRef;
|
|
41
57
|
};
|
|
58
|
+
type ColumnsOf<Table extends TableRef> = NonNullable<Table["columns"]>[keyof NonNullable<Table["columns"]>];
|
|
59
|
+
/** Options for semantic search over an organization table. */
|
|
60
|
+
export interface DefineTableSearchTableOptions<Table extends TableRef = TableRef> extends EntityDeployOptions {
|
|
61
|
+
readonly table: Table;
|
|
62
|
+
readonly name?: string;
|
|
63
|
+
readonly field: ColumnsOf<Table>;
|
|
64
|
+
readonly service: AiServiceRef;
|
|
65
|
+
readonly attributeFields: readonly [ColumnsOf<Table>, ...ColumnsOf<Table>[]];
|
|
66
|
+
readonly duration: SearchTableDuration;
|
|
67
|
+
readonly targetLag: number;
|
|
68
|
+
readonly warehouse?: string;
|
|
69
|
+
readonly creationTimeout?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface SearchTableConfigured<Parent extends string = string> {
|
|
72
|
+
ref<const RefName extends string>(refName: RefName): SearchTableRef<Parent, RefName>;
|
|
73
|
+
def(refName: string): DeployableEntity;
|
|
74
|
+
}
|
|
75
|
+
/** Build an element-owned managed search table. */
|
|
76
|
+
export declare function searchTable<Owner extends SearchTableOwner>(opts: DefineSearchTableOptions<Owner>): SearchTableConfigured<Owner["refName"]>;
|
|
77
|
+
/** Link an existing Cortex Search Service to an element. */
|
|
78
|
+
export declare function linkedSearchTable<Owner extends SearchTableOwner>(opts: DefineLinkedSearchTableOptions<Owner>): SearchTableConfigured<Owner["refName"]>;
|
|
79
|
+
/** Build an immutable AI search index owned by an organization table. */
|
|
80
|
+
export declare function tableSearchTable<Table extends TableRef>(opts: DefineTableSearchTableOptions<Table>): SearchTableConfigured<Table["refName"]>;
|
|
@@ -1,79 +1,133 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v2 search-table authoring — `defineSearchTable`. Parallel to v1
|
|
3
|
-
* `src/searchTables`, but standalone: produces a `DeployableEntity` of kind
|
|
4
|
-
* `searchTable` (app-owned) whose field / connector / cloud-link references are
|
|
5
|
-
* catalog tokens resolved at deploy. Two variants — `snowflake` (Elementum
|
|
6
|
-
* manages the table) and `linked` (points at an existing Cortex service) — pick
|
|
7
|
-
* the create endpoint via a `__variant` discriminator on the payload.
|
|
8
|
-
*
|
|
9
|
-
* Mostly create-only in v2: the platform's thin PUT only honors
|
|
10
|
-
* duration/targetLag on a snowflake table (see `planV2`'s
|
|
11
|
-
* `isSearchTableUpdateSupported`, `src/deploy/plan/plan.ts`). A diff limited
|
|
12
|
-
* to those fields routes to update; anything else (attributeFields,
|
|
13
|
-
* vectorIndexes, kind, warehouse, a linked table at all) surfaces as
|
|
14
|
-
* `update-unsupported` (delete + re-create).
|
|
15
|
-
*/
|
|
16
1
|
import { EdkValidationError } from "../../../elementum-entity-client/errors.js";
|
|
17
2
|
import { slimTokens, } from "../../catalog/index.js";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
3
|
+
export const searchTableDuration = {
|
|
4
|
+
seconds: "SECONDS",
|
|
5
|
+
minutes: "MINUTES",
|
|
6
|
+
hours: "HOURS",
|
|
7
|
+
days: "DAYS",
|
|
8
|
+
};
|
|
9
|
+
function ownerOf(opts) {
|
|
10
|
+
// The TYPE surface rejects `app:`, but plain JavaScript — or an existing
|
|
11
|
+
// casted callsite — still reaches here, and the union-era fallback this
|
|
12
|
+
// replaces PREFERRED `opts.app` whenever it was present. That silently built
|
|
13
|
+
// an app-owned entity which the platform then refuses at apply ("AI Search
|
|
14
|
+
// Tables cannot be created on hybrid tables (target object has storageType
|
|
15
|
+
// HYBRID)"), so the ownership rule is enforced at runtime too rather than by
|
|
16
|
+
// types alone.
|
|
17
|
+
const { app, element } = opts;
|
|
18
|
+
if (app !== undefined) {
|
|
19
|
+
throw new EdkValidationError(`search table owner: got \`app: ${app.refName ?? "?"}\` — a managed or linked search table is owned by an ` +
|
|
20
|
+
`element, never an app (an app's backing Snowflake table is hybrid, which Cortex cannot index). Pass ` +
|
|
21
|
+
`\`element:\`, or use tableSearchTable for a table-owned search table.`);
|
|
21
22
|
}
|
|
23
|
+
if (element === undefined) {
|
|
24
|
+
throw new EdkValidationError("search table owner: `element` is required — a search table is owned by an element.");
|
|
25
|
+
}
|
|
26
|
+
const kind = element.__kind;
|
|
27
|
+
if (kind !== "element") {
|
|
28
|
+
throw new EdkValidationError(`search table owner: \`element\` must be an element catalog ref (got __kind ${JSON.stringify(kind ?? null)}).`);
|
|
29
|
+
}
|
|
30
|
+
return element;
|
|
31
|
+
}
|
|
32
|
+
function assertPositiveLag(targetLag) {
|
|
33
|
+
if (targetLag <= 0)
|
|
34
|
+
throw new EdkValidationError(`search table targetLag must be > 0 (got ${targetLag}).`);
|
|
35
|
+
}
|
|
36
|
+
function managedBody(opts) {
|
|
37
|
+
assertPositiveLag(opts.targetLag);
|
|
22
38
|
if (opts.attributeFields.length === 0) {
|
|
23
|
-
throw new EdkValidationError("
|
|
39
|
+
throw new EdkValidationError("searchTable requires at least one attributeField.");
|
|
24
40
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (hasLegacy && (opts.keyField == null || opts.embeddingConnector == null)) {
|
|
28
|
-
throw new EdkValidationError("defineSearchTable: `keyField` and `embeddingConnector` must be provided together.");
|
|
41
|
+
if (opts.vectorIndex === undefined) {
|
|
42
|
+
throw new EdkValidationError("searchTable requires a vectorIndex.");
|
|
29
43
|
}
|
|
30
|
-
|
|
31
|
-
|
|
44
|
+
const primaryField = opts.vectorIndex.field;
|
|
45
|
+
const owner = ownerOf(opts);
|
|
46
|
+
for (const field of [primaryField, ...opts.attributeFields, ...(opts.textIndexFields ?? [])]) {
|
|
47
|
+
if (field.parent !== owner.refName) {
|
|
48
|
+
throw new EdkValidationError(`searchTable field ${JSON.stringify(field.refName)} belongs to ${JSON.stringify(field.parent)}, not ${owner.__kind} ${JSON.stringify(owner.refName)}.`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
for (const attribute of opts.attributeFields) {
|
|
52
|
+
if (primaryField.refName === attribute.refName && primaryField.parent === attribute.parent) {
|
|
53
|
+
throw new EdkValidationError(`searchTable: primary search field ${JSON.stringify(attribute.refName)} must not also appear in attributeFields; it is indexed automatically.`);
|
|
54
|
+
}
|
|
32
55
|
}
|
|
33
56
|
return {
|
|
34
|
-
|
|
57
|
+
name: opts.name,
|
|
58
|
+
attributeFieldIds: opts.attributeFields,
|
|
35
59
|
duration: opts.duration,
|
|
36
60
|
targetLag: opts.targetLag,
|
|
37
|
-
...(opts.textIndexFields
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
...(hasVectors
|
|
42
|
-
? { vectorIndexes: opts.vectorIndexes.map((v) => ({ fieldId: v.field, aiProviderConnectorId: v.connector })) }
|
|
43
|
-
: {}),
|
|
44
|
-
...(opts.keyField != null ? { fieldId: opts.keyField } : {}),
|
|
45
|
-
...(opts.embeddingConnector != null ? { aiProviderConnectorId: opts.embeddingConnector } : {}),
|
|
61
|
+
...(opts.textIndexFields !== undefined ? { textIndexFieldIds: opts.textIndexFields } : {}),
|
|
62
|
+
...(opts.warehouse !== undefined ? { warehouse: opts.warehouse } : {}),
|
|
63
|
+
...(opts.creationTimeout !== undefined ? { creationTimeout: opts.creationTimeout } : {}),
|
|
64
|
+
vectorIndexes: [{ fieldId: opts.vectorIndex.field, aiProviderConnectorId: opts.vectorIndex.service }],
|
|
46
65
|
};
|
|
47
66
|
}
|
|
48
67
|
function linkedBody(opts) {
|
|
49
|
-
if (
|
|
50
|
-
throw new EdkValidationError("
|
|
51
|
-
}
|
|
68
|
+
if (opts.serviceName.trim() === "")
|
|
69
|
+
throw new EdkValidationError("linkedSearchTable requires a non-empty serviceName.");
|
|
52
70
|
return {
|
|
53
|
-
|
|
71
|
+
name: opts.name,
|
|
72
|
+
cloudLinkId: opts.cloudLink,
|
|
54
73
|
database: opts.database,
|
|
55
74
|
schema: opts.schema,
|
|
56
75
|
serviceName: opts.serviceName,
|
|
57
|
-
...(opts.warehouse
|
|
76
|
+
...(opts.warehouse !== undefined ? { warehouse: opts.warehouse } : {}),
|
|
58
77
|
};
|
|
59
78
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
79
|
+
function configuredSearchTable(opts, variant, body) {
|
|
80
|
+
const owner = ownerOf(opts);
|
|
81
|
+
const payload = slimTokens({ __variant: variant, ...body });
|
|
82
|
+
return {
|
|
83
|
+
ref(refName) {
|
|
84
|
+
return { __kind: "searchTable", refName, name: opts.name, parent: owner.refName, __variant: variant };
|
|
85
|
+
},
|
|
86
|
+
def(refName) {
|
|
87
|
+
return { kind: "searchTable", parent: owner.refName, refName, payload, ...(opts.enabled !== undefined ? { enabled: opts.enabled } : {}) };
|
|
88
|
+
},
|
|
70
89
|
};
|
|
90
|
+
}
|
|
91
|
+
/** Build an element-owned managed search table. */
|
|
92
|
+
export function searchTable(opts) {
|
|
93
|
+
if (opts.name.trim() === "")
|
|
94
|
+
throw new EdkValidationError("searchTable requires a non-empty name.");
|
|
95
|
+
return configuredSearchTable(opts, "snowflake", managedBody(opts));
|
|
96
|
+
}
|
|
97
|
+
/** Link an existing Cortex Search Service to an element. */
|
|
98
|
+
export function linkedSearchTable(opts) {
|
|
99
|
+
if (opts.name.trim() === "")
|
|
100
|
+
throw new EdkValidationError("linkedSearchTable requires a non-empty name.");
|
|
101
|
+
return configuredSearchTable(opts, "linked", linkedBody(opts));
|
|
102
|
+
}
|
|
103
|
+
/** Build an immutable AI search index owned by an organization table. */
|
|
104
|
+
export function tableSearchTable(opts) {
|
|
105
|
+
assertPositiveLag(opts.targetLag);
|
|
106
|
+
for (const column of [opts.field, ...opts.attributeFields]) {
|
|
107
|
+
if (column.parent !== opts.table.refName) {
|
|
108
|
+
throw new EdkValidationError(`tableSearchTable column ${JSON.stringify(column.refName)} belongs to ${JSON.stringify(column.parent)}, not table ${JSON.stringify(opts.table.refName)}.`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (opts.attributeFields.some((column) => column.refName === opts.field.refName)) {
|
|
112
|
+
throw new EdkValidationError("tableSearchTable: field cannot also appear in attributeFields.");
|
|
113
|
+
}
|
|
114
|
+
const payload = slimTokens({
|
|
115
|
+
__variant: "table",
|
|
116
|
+
...(opts.name !== undefined ? { name: opts.name } : {}),
|
|
117
|
+
fieldId: opts.field,
|
|
118
|
+
aiProviderConnectorId: opts.service,
|
|
119
|
+
attributeFieldIds: opts.attributeFields,
|
|
120
|
+
duration: opts.duration,
|
|
121
|
+
targetLag: opts.targetLag,
|
|
122
|
+
...(opts.warehouse !== undefined ? { warehouse: opts.warehouse } : {}),
|
|
123
|
+
...(opts.creationTimeout !== undefined ? { creationTimeout: opts.creationTimeout } : {}),
|
|
124
|
+
});
|
|
71
125
|
return {
|
|
72
|
-
ref
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
refName
|
|
76
|
-
|
|
77
|
-
|
|
126
|
+
ref(refName) {
|
|
127
|
+
return { __kind: "searchTable", refName, name: opts.name ?? refName, parent: opts.table.refName, __variant: "table" };
|
|
128
|
+
},
|
|
129
|
+
def(refName) {
|
|
130
|
+
return { kind: "searchTable", parent: opts.table.refName, refName, payload, ...(opts.enabled !== undefined ? { enabled: opts.enabled } : {}) };
|
|
131
|
+
},
|
|
78
132
|
};
|
|
79
133
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type FromTfContext } from "../../engine/pull/context.js";
|
|
2
|
+
import { type ChildResourceScope, type TfBlock } from "../../engine/tf/index.js";
|
|
3
|
+
export interface NormalizedSnowflakeSearchTable {
|
|
4
|
+
readonly kind: "snowflake";
|
|
5
|
+
readonly refName: string;
|
|
6
|
+
readonly name?: string;
|
|
7
|
+
readonly fieldKey: string;
|
|
8
|
+
readonly attributeFieldKeys: readonly string[];
|
|
9
|
+
readonly connectorKey: string;
|
|
10
|
+
readonly duration: "DAYS" | "HOURS" | "MINUTES" | "SECONDS";
|
|
11
|
+
readonly targetLag: number;
|
|
12
|
+
readonly warehouse?: string;
|
|
13
|
+
readonly creationTimeout?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface NormalizedLinkedSearchTable {
|
|
16
|
+
readonly kind: "linked";
|
|
17
|
+
readonly refName: string;
|
|
18
|
+
readonly cloudLinkKey: string;
|
|
19
|
+
readonly database: string;
|
|
20
|
+
readonly schema: string;
|
|
21
|
+
readonly serviceName: string;
|
|
22
|
+
readonly warehouse?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface NormalizedTableSearchTable {
|
|
25
|
+
readonly kind: "table";
|
|
26
|
+
readonly refName: string;
|
|
27
|
+
readonly name?: string;
|
|
28
|
+
readonly fieldKey: string;
|
|
29
|
+
readonly attributeFieldKeys: readonly string[];
|
|
30
|
+
readonly connectorKey: string;
|
|
31
|
+
readonly duration: "DAYS" | "HOURS" | "MINUTES" | "SECONDS";
|
|
32
|
+
readonly targetLag: number;
|
|
33
|
+
readonly warehouse?: string;
|
|
34
|
+
readonly creationTimeout?: string;
|
|
35
|
+
}
|
|
36
|
+
export type NormalizedSearchTable = NormalizedSnowflakeSearchTable | NormalizedLinkedSearchTable | NormalizedTableSearchTable;
|
|
37
|
+
export declare function searchTableFromTf(block: TfBlock, ownerTfLabel: string, scope: ChildResourceScope | "table", ctx: FromTfContext): NormalizedSearchTable;
|