@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
|
@@ -1,115 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* v2 filter helpers — build the platform's wire `Filter` shape (mirroring
|
|
3
|
-
* `core/filters/types`).
|
|
4
|
-
*
|
|
5
|
-
* The left-hand side of every operator accepts either:
|
|
6
|
-
* - a `FieldRef` catalog token (`app.fields.x`) — the wire `field:` slot,
|
|
7
|
-
* resolved to a field id at deploy by `resolvePayload`; or
|
|
8
|
-
* - a `Ref` (`ctx.trigger.x`, `ctx.tasks.y.z`) — the wire `leftValue:` slot,
|
|
9
|
-
* for row-less contexts (switch/operator conditions) where there's no
|
|
10
|
-
* record to project a field off.
|
|
11
|
-
* Both are detected at call time, so one function (`filter.eq`, `filter.gt`,
|
|
12
|
-
* …) covers both shapes — authors never need to know which slot the platform
|
|
13
|
-
* ends up using. When the left side is a `Ref`, the comparison's value type
|
|
14
|
-
* defaults per-operator (`"TEXT"` for equality/string ops, `"NUMBER"` for
|
|
15
|
-
* ordering ops) and can be overridden with the trailing `leftType` parameter;
|
|
16
|
-
* a `FieldRef` left side always supplies its own type from `fieldType`.
|
|
17
|
-
*
|
|
18
|
-
* Values may be literals, `Ref`s (`ctx.trigger.x`, `ctx.tasks.y.z`), or another
|
|
19
|
-
* `FieldRef`: a ref compares the field against a referenced value at run time,
|
|
20
|
-
* serialized to the platform's `REFERENCE` value shape; a field value serializes
|
|
21
|
-
* to the platform's `FIELD` value shape for field-to-field comparisons. The
|
|
22
|
-
* reference-value conversion is shared with `core/filters` so the two DSLs can't
|
|
23
|
-
* drift.
|
|
24
|
-
*/
|
|
25
|
-
import type { FieldRef, UserFieldRef } from "../../catalog/index.js";
|
|
26
|
-
import { type LikeMode, type ValueType } from "../shared/filters/index.js";
|
|
27
|
-
import { type Ref } from "../shared/ref.js";
|
|
28
|
-
/** A wire filter (may embed `FieldRef` tokens at `field` positions). */
|
|
29
|
-
export type Filter = Record<string, unknown>;
|
|
30
|
-
type Primitive = string | number | boolean | null;
|
|
31
|
-
/**
|
|
32
|
-
* A filter value: a literal, or a `Ref` to a trigger/task/forEach output. A ref
|
|
33
|
-
* serializes to the platform's `REFERENCE` value shape, with `realType` taken
|
|
34
|
-
* from the compared field's `fieldType` (or the operator's `leftType` when the
|
|
35
|
-
* left side is itself a `Ref`).
|
|
36
|
-
*/
|
|
37
|
-
/**
|
|
38
|
-
* Marker produced by {@link currentUser} — compares against the acting
|
|
39
|
-
* user's id/email/domain rather than a literal or ref value. A plain object
|
|
40
|
-
* literal (not a `Ref`/`FieldRef`), recognized by {@link value} before
|
|
41
|
-
* falling through to the primitive cases.
|
|
42
|
-
*/
|
|
43
|
-
export interface CurrentUserFilterValue {
|
|
44
|
-
readonly __kind: "currentUser";
|
|
45
|
-
readonly currentUserType: "id" | "email" | "domain";
|
|
46
|
-
}
|
|
47
|
-
export type FilterValue = Primitive | Ref<unknown> | FieldRef | UserFieldRef | CurrentUserFilterValue;
|
|
48
|
-
/** Compare against the current (acting) user — id by default. */
|
|
49
|
-
export declare function currentUser(type?: "id" | "email" | "domain"): CurrentUserFilterValue;
|
|
50
|
-
/** Either side of a filter: a catalog field token, or a task/trigger/… output ref. */
|
|
51
|
-
export type LeftRef = FieldRef | UserFieldRef | Ref<unknown>;
|
|
52
|
-
/**
|
|
53
|
-
* Marker prefix a pulled filter's left side carries when the pull-time
|
|
54
|
-
* deserializer couldn't decode its `left_value`/REFERENCE shape to a typed
|
|
55
|
-
* ref (e.g. a `variable.<uuid>` reference to a not-yet-authorable workflow
|
|
56
|
-
* variable — see `from-tf.ts`'s `decodeReferenceString`). Distinct from an
|
|
57
|
-
* unresolved FIELD placeholder (a bare uuid, no prefix), which legitimately
|
|
58
|
-
* round-trips through the `{ field }`/`field_id` wire slot below — a
|
|
59
|
-
* left_value/REFERENCE position never does, so silently routing it through
|
|
60
|
-
* `{ field }` would rebuild a structurally different filter than the one
|
|
61
|
-
* `ei` exported. `leftDescriptor` routes this marker through the SAME
|
|
62
|
-
* `leftValue`/REFERENCE wire slot instead, reproducing the original raw
|
|
63
|
-
* `value_reference` string verbatim (#290) rather than either corrupting it
|
|
64
|
-
* (routing to `field`) or refusing to build it (a single bad automation
|
|
65
|
-
* file throwing during `elementum build`'s jiti discovery aborts discovery
|
|
66
|
-
* for the WHOLE workspace, not just this app — confirmed in
|
|
67
|
-
* `engine/build/build.ts`'s `discoverOwnFileChildren`, which deliberately
|
|
68
|
-
* treats any load failure as fatal rather than risk a silently-missing
|
|
69
|
-
* entity planning as a destroy — so throwing here would trade "one
|
|
70
|
-
* automation invisible" for "the entire org can no longer build," a much
|
|
71
|
-
* worse regression).
|
|
72
|
-
*/
|
|
73
|
-
export declare const UNRESOLVED_REFERENCE_MARKER = "__edkUnresolvedReference::";
|
|
74
|
-
/** Match every record (the minimal valid filter). */
|
|
75
|
-
export declare function whereTrue(): Filter;
|
|
76
|
-
/** Match no record. */
|
|
77
|
-
export declare function whereFalse(): Filter;
|
|
78
|
-
export declare function eq(left: LeftRef, v: FilterValue, leftType?: ValueType): Filter;
|
|
79
|
-
export declare function notEq(left: LeftRef, v: FilterValue, leftType?: ValueType): Filter;
|
|
80
|
-
export declare function gt(left: LeftRef, v: FilterValue, leftType?: ValueType): Filter;
|
|
81
|
-
export declare function gte(left: LeftRef, v: FilterValue, leftType?: ValueType): Filter;
|
|
82
|
-
export declare function lt(left: LeftRef, v: FilterValue, leftType?: ValueType): Filter;
|
|
83
|
-
export declare function lte(left: LeftRef, v: FilterValue, leftType?: ValueType): Filter;
|
|
84
|
-
export declare function like(left: LeftRef, v: string | Ref<unknown>, options?: {
|
|
85
|
-
not?: boolean;
|
|
86
|
-
caseInsensitive?: boolean;
|
|
87
|
-
mode?: LikeMode;
|
|
88
|
-
}, leftType?: ValueType): Filter;
|
|
89
|
-
export declare function isNull(left: LeftRef, options?: {
|
|
90
|
-
not?: boolean;
|
|
91
|
-
}, leftType?: ValueType): Filter;
|
|
92
|
-
export declare function isNotNull(left: LeftRef, leftType?: ValueType): Filter;
|
|
93
|
-
export declare function inList(left: LeftRef, values: readonly FilterValue[], leftType?: ValueType): Filter;
|
|
94
|
-
export declare function between(left: LeftRef, low: FilterValue, high: FilterValue, options?: {
|
|
95
|
-
not?: boolean;
|
|
96
|
-
}, leftType?: ValueType): Filter;
|
|
97
|
-
/**
|
|
98
|
-
* CONSECUTIVE_RANGE filter — field falls within a relative calendar range
|
|
99
|
-
* (`count` `unit`s, shifted `offset` `unit`s back from now). `semantic`
|
|
100
|
-
* selects whether the range snaps to calendar-unit boundaries (`true`) or
|
|
101
|
-
* is a rolling window measured from the current moment (`false`, the
|
|
102
|
-
* default). `unit` is a platform-defined calendar-unit string (e.g.
|
|
103
|
-
* `"QUARTER"`) — not validated here.
|
|
104
|
-
*/
|
|
105
|
-
export declare function consecutiveRange(left: LeftRef, options: {
|
|
106
|
-
unit: string;
|
|
107
|
-
count: number;
|
|
108
|
-
offset: number;
|
|
109
|
-
semantic?: boolean;
|
|
110
|
-
}, leftType?: ValueType): Filter;
|
|
111
|
-
export declare function contains(left: LeftRef, values: readonly FilterValue[], leftType?: ValueType): Filter;
|
|
112
|
-
export declare function overlaps(left: LeftRef, values: readonly FilterValue[], leftType?: ValueType): Filter;
|
|
113
|
-
export declare function and(...children: Filter[]): Filter;
|
|
114
|
-
export declare function or(...children: Filter[]): Filter;
|
|
115
|
-
export {};
|
|
1
|
+
export * from "../shared/filters/index.js";
|
|
@@ -1,197 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { isRef } from "../shared/ref.js";
|
|
3
|
-
/** Compare against the current (acting) user — id by default. */
|
|
4
|
-
export function currentUser(type = "id") {
|
|
5
|
-
return { __kind: "currentUser", currentUserType: type };
|
|
6
|
-
}
|
|
7
|
-
function isCurrentUserValue(value) {
|
|
8
|
-
return typeof value === "object" && value !== null && !isRef(value) && value.__kind === "currentUser";
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Marker prefix a pulled filter's left side carries when the pull-time
|
|
12
|
-
* deserializer couldn't decode its `left_value`/REFERENCE shape to a typed
|
|
13
|
-
* ref (e.g. a `variable.<uuid>` reference to a not-yet-authorable workflow
|
|
14
|
-
* variable — see `from-tf.ts`'s `decodeReferenceString`). Distinct from an
|
|
15
|
-
* unresolved FIELD placeholder (a bare uuid, no prefix), which legitimately
|
|
16
|
-
* round-trips through the `{ field }`/`field_id` wire slot below — a
|
|
17
|
-
* left_value/REFERENCE position never does, so silently routing it through
|
|
18
|
-
* `{ field }` would rebuild a structurally different filter than the one
|
|
19
|
-
* `ei` exported. `leftDescriptor` routes this marker through the SAME
|
|
20
|
-
* `leftValue`/REFERENCE wire slot instead, reproducing the original raw
|
|
21
|
-
* `value_reference` string verbatim (#290) rather than either corrupting it
|
|
22
|
-
* (routing to `field`) or refusing to build it (a single bad automation
|
|
23
|
-
* file throwing during `elementum build`'s jiti discovery aborts discovery
|
|
24
|
-
* for the WHOLE workspace, not just this app — confirmed in
|
|
25
|
-
* `engine/build/build.ts`'s `discoverOwnFileChildren`, which deliberately
|
|
26
|
-
* treats any load failure as fatal rather than risk a silently-missing
|
|
27
|
-
* entity planning as a destroy — so throwing here would trade "one
|
|
28
|
-
* automation invisible" for "the entire org can no longer build," a much
|
|
29
|
-
* worse regression).
|
|
30
|
-
*/
|
|
31
|
-
export const UNRESOLVED_REFERENCE_MARKER = "__edkUnresolvedReference::";
|
|
32
|
-
/**
|
|
33
|
-
* True when `left` is a genuine `Ref` (task/trigger/… output) rather than a
|
|
34
|
-
* field. Note this is *not* "is a `FieldRef`" — an unresolved-field
|
|
35
|
-
* placeholder (a bare uuid string, `"<uuid>" as any`) is neither a `Ref` nor
|
|
36
|
-
* a real `FieldRef`, but must still take the `{ field }` path (matching its
|
|
37
|
-
* pre-refactor behavior) since it stands in for a field, not a ref.
|
|
38
|
-
*/
|
|
39
|
-
function isRefLeft(left) {
|
|
40
|
-
return isRef(left);
|
|
41
|
-
}
|
|
42
|
-
function isFieldValue(value) {
|
|
43
|
-
const kind = typeof value === "object" && value !== null ? value.__kind : undefined;
|
|
44
|
-
return !isRef(value) && (kind === "field" || kind === "userField");
|
|
45
|
-
}
|
|
46
|
-
/** The wire LHS descriptor: `{ field }` for a FieldRef (or field placeholder), `{ leftValue }` for a Ref. */
|
|
47
|
-
function leftDescriptor(left, defaultType, leftType) {
|
|
48
|
-
if (isRefLeft(left)) {
|
|
49
|
-
return {
|
|
50
|
-
leftValue: {
|
|
51
|
-
type: "REFERENCE",
|
|
52
|
-
realType: leftType ?? defaultType,
|
|
53
|
-
value: refDataToFilterReference(left.__data),
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
const rawLeft = left;
|
|
58
|
-
if (typeof rawLeft === "string" && rawLeft.startsWith(UNRESOLVED_REFERENCE_MARKER)) {
|
|
59
|
-
return {
|
|
60
|
-
leftValue: {
|
|
61
|
-
type: "REFERENCE",
|
|
62
|
-
realType: leftType ?? defaultType,
|
|
63
|
-
// Raw pass-through, recognized by to-tf.ts's filterReferenceToTf -
|
|
64
|
-
// bypasses the typed TRIGGER/TASK/FOR_EACH dispatch entirely since
|
|
65
|
-
// there is no typed ref to dispatch on, only the original wire
|
|
66
|
-
// string preserved verbatim from pull.
|
|
67
|
-
value: { __rawFilterReference: rawLeft.slice(UNRESOLVED_REFERENCE_MARKER.length) },
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
return { field: left };
|
|
72
|
-
}
|
|
73
|
-
/** The value type to compare against — from the FieldRef's fieldType, or the operator's (possibly overridden) default when the LHS is a Ref. */
|
|
74
|
-
function leftValueType(left, defaultType, leftType) {
|
|
75
|
-
if (isRefLeft(left))
|
|
76
|
-
return leftType ?? defaultType;
|
|
77
|
-
const rawLeft = left;
|
|
78
|
-
if (typeof rawLeft === "string" && rawLeft.startsWith(UNRESOLVED_REFERENCE_MARKER))
|
|
79
|
-
return leftType ?? defaultType;
|
|
80
|
-
return fieldTypeToValueType(left.fieldType);
|
|
81
|
-
}
|
|
82
|
-
/** Map a filter value to the platform's `Value` wire shape, typed `vt`. */
|
|
83
|
-
function value(vt, v) {
|
|
84
|
-
if (isCurrentUserValue(v))
|
|
85
|
-
return { type: "CURRENT_USER", currentUserType: v.currentUserType };
|
|
86
|
-
if (isRef(v)) {
|
|
87
|
-
// A `static` ref (`val(…)`) is a literal in disguise — unwrap it so it
|
|
88
|
-
// emits as a plain typed value rather than a REFERENCE the platform
|
|
89
|
-
// doesn't expect for literals.
|
|
90
|
-
if (v.__data.kind === "static")
|
|
91
|
-
return value(vt, v.__data.value);
|
|
92
|
-
return { type: "REFERENCE", realType: vt, value: refDataToFilterReference(v.__data) };
|
|
93
|
-
}
|
|
94
|
-
if (isFieldValue(v))
|
|
95
|
-
return { type: "FIELD", value: v };
|
|
96
|
-
if (v === null)
|
|
97
|
-
return { type: "NULL" };
|
|
98
|
-
if (typeof v === "number")
|
|
99
|
-
return { type: "NUMBER", value: v };
|
|
100
|
-
if (typeof v === "boolean")
|
|
101
|
-
return { type: "BOOLEAN", value: v };
|
|
102
|
-
return { type: "TEXT", value: v };
|
|
103
|
-
}
|
|
104
|
-
/** Match every record (the minimal valid filter). */
|
|
105
|
-
export function whereTrue() {
|
|
106
|
-
return { type: "TRUE" };
|
|
107
|
-
}
|
|
108
|
-
/** Match no record. */
|
|
109
|
-
export function whereFalse() {
|
|
110
|
-
return { type: "FALSE" };
|
|
111
|
-
}
|
|
112
|
-
export function eq(left, v, leftType) {
|
|
113
|
-
const vt = leftValueType(left, "TEXT", leftType);
|
|
114
|
-
return { type: "EQUALS", ...leftDescriptor(left, "TEXT", leftType), value: value(vt, v) };
|
|
115
|
-
}
|
|
116
|
-
export function notEq(left, v, leftType) {
|
|
117
|
-
const vt = leftValueType(left, "TEXT", leftType);
|
|
118
|
-
return { type: "EQUALS", ...leftDescriptor(left, "TEXT", leftType), value: value(vt, v), not: true };
|
|
119
|
-
}
|
|
120
|
-
export function gt(left, v, leftType) {
|
|
121
|
-
const vt = leftValueType(left, "NUMBER", leftType);
|
|
122
|
-
return { type: "GREATER_THAN", ...leftDescriptor(left, "NUMBER", leftType), value: value(vt, v) };
|
|
123
|
-
}
|
|
124
|
-
export function gte(left, v, leftType) {
|
|
125
|
-
const vt = leftValueType(left, "NUMBER", leftType);
|
|
126
|
-
return { type: "GREATER_THAN_EQUALS", ...leftDescriptor(left, "NUMBER", leftType), value: value(vt, v) };
|
|
127
|
-
}
|
|
128
|
-
export function lt(left, v, leftType) {
|
|
129
|
-
const vt = leftValueType(left, "NUMBER", leftType);
|
|
130
|
-
return { type: "LESS_THAN", ...leftDescriptor(left, "NUMBER", leftType), value: value(vt, v) };
|
|
131
|
-
}
|
|
132
|
-
export function lte(left, v, leftType) {
|
|
133
|
-
const vt = leftValueType(left, "NUMBER", leftType);
|
|
134
|
-
return { type: "LESS_THAN_EQUALS", ...leftDescriptor(left, "NUMBER", leftType), value: value(vt, v) };
|
|
135
|
-
}
|
|
136
|
-
export function like(left, v, options, leftType) {
|
|
137
|
-
const vt = leftValueType(left, "TEXT", leftType);
|
|
138
|
-
return {
|
|
139
|
-
type: "LIKE",
|
|
140
|
-
...leftDescriptor(left, "TEXT", leftType),
|
|
141
|
-
value: value(vt, v),
|
|
142
|
-
...(options?.not ? { not: true } : {}),
|
|
143
|
-
...(options?.caseInsensitive !== undefined ? { caseInsensitive: options.caseInsensitive } : {}),
|
|
144
|
-
...(options?.mode ? { mode: options.mode } : {}),
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
export function isNull(left, options, leftType) {
|
|
148
|
-
return { type: "IS_NULL", ...leftDescriptor(left, "TEXT", leftType), ...(options?.not ? { not: true } : {}) };
|
|
149
|
-
}
|
|
150
|
-
export function isNotNull(left, leftType) {
|
|
151
|
-
return isNull(left, { not: true }, leftType);
|
|
152
|
-
}
|
|
153
|
-
export function inList(left, values, leftType) {
|
|
154
|
-
const vt = leftValueType(left, "TEXT", leftType);
|
|
155
|
-
return { type: "IN", ...leftDescriptor(left, "TEXT", leftType), values: values.map((v) => value(vt, v)) };
|
|
156
|
-
}
|
|
157
|
-
export function between(left, low, high, options, leftType) {
|
|
158
|
-
const vt = leftValueType(left, "NUMBER", leftType);
|
|
159
|
-
return {
|
|
160
|
-
type: "BETWEEN",
|
|
161
|
-
...leftDescriptor(left, "NUMBER", leftType),
|
|
162
|
-
values: [value(vt, low), value(vt, high)],
|
|
163
|
-
...(options?.not ? { not: true } : {}),
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* CONSECUTIVE_RANGE filter — field falls within a relative calendar range
|
|
168
|
-
* (`count` `unit`s, shifted `offset` `unit`s back from now). `semantic`
|
|
169
|
-
* selects whether the range snaps to calendar-unit boundaries (`true`) or
|
|
170
|
-
* is a rolling window measured from the current moment (`false`, the
|
|
171
|
-
* default). `unit` is a platform-defined calendar-unit string (e.g.
|
|
172
|
-
* `"QUARTER"`) — not validated here.
|
|
173
|
-
*/
|
|
174
|
-
export function consecutiveRange(left, options, leftType) {
|
|
175
|
-
return {
|
|
176
|
-
type: "CONSECUTIVE_RANGE",
|
|
177
|
-
...leftDescriptor(left, "DATETIME", leftType),
|
|
178
|
-
unit: options.unit,
|
|
179
|
-
count: options.count,
|
|
180
|
-
offset: options.offset,
|
|
181
|
-
semantic: options.semantic ?? false,
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
export function contains(left, values, leftType) {
|
|
185
|
-
const vt = leftValueType(left, "TEXT", leftType);
|
|
186
|
-
return { type: "CONTAINS", ...leftDescriptor(left, "TEXT", leftType), values: values.map((v) => value(vt, v)) };
|
|
187
|
-
}
|
|
188
|
-
export function overlaps(left, values, leftType) {
|
|
189
|
-
const vt = leftValueType(left, "TEXT", leftType);
|
|
190
|
-
return { type: "OVERLAPS", ...leftDescriptor(left, "TEXT", leftType), values: values.map((v) => value(vt, v)) };
|
|
191
|
-
}
|
|
192
|
-
export function and(...children) {
|
|
193
|
-
return { type: "AND", children };
|
|
194
|
-
}
|
|
195
|
-
export function or(...children) {
|
|
196
|
-
return { type: "OR", children };
|
|
197
|
-
}
|
|
1
|
+
export * from "../shared/filters/index.js";
|
|
@@ -26,6 +26,23 @@ export declare function automationOwnedAddresses(doc: TfDocument, automationLabe
|
|
|
26
26
|
export interface AutomationFromTfContext {
|
|
27
27
|
readonly ownerHandle: string;
|
|
28
28
|
readonly diagnostics: string[];
|
|
29
|
+
readonly foreignFieldRefsById?: ReadonlyMap<string, {
|
|
30
|
+
readonly ownerRefName: string;
|
|
31
|
+
readonly fieldKey: string;
|
|
32
|
+
readonly fieldName?: string;
|
|
33
|
+
}>;
|
|
34
|
+
readonly foreignFieldRefsByDataAddress?: ReadonlyMap<string, {
|
|
35
|
+
readonly ownerRefName: string;
|
|
36
|
+
readonly fieldKey: string;
|
|
37
|
+
}>;
|
|
38
|
+
readonly foreignTableRefsById?: ReadonlyMap<string, {
|
|
39
|
+
readonly tableRefName: string;
|
|
40
|
+
readonly name: string;
|
|
41
|
+
}>;
|
|
42
|
+
readonly picklistOptionLabelById?: ReadonlyMap<string, string>;
|
|
43
|
+
readonly fieldNamesByOwnerRefName?: ReadonlyMap<string, ReadonlyMap<string, string>>;
|
|
44
|
+
readonly foreignAppRefNames?: ReadonlyMap<string, string>;
|
|
45
|
+
readonly foreignElementRefNames?: ReadonlyMap<string, string>;
|
|
29
46
|
}
|
|
30
47
|
export interface AutomationGraphFromTfResult {
|
|
31
48
|
readonly automation?: AutomationAst;
|
|
@@ -33,3 +50,14 @@ export interface AutomationGraphFromTfResult {
|
|
|
33
50
|
}
|
|
34
51
|
export declare function automationFromTf(blocks: readonly TfBlock[], ctx: AutomationFromTfContext): AutomationGraphFromTfResult;
|
|
35
52
|
export declare function automationFromTf(doc: TfDocument, automationLabel: string, appRefName: string): AutomationFromTfResult;
|
|
53
|
+
export declare function automationFromTf(doc: TfDocument, automationLabel: string, appRefName: string, foreignFieldRefsById?: ReadonlyMap<string, {
|
|
54
|
+
readonly ownerRefName: string;
|
|
55
|
+
readonly fieldKey: string;
|
|
56
|
+
readonly fieldName?: string;
|
|
57
|
+
}>, foreignFieldRefsByDataAddress?: ReadonlyMap<string, {
|
|
58
|
+
readonly ownerRefName: string;
|
|
59
|
+
readonly fieldKey: string;
|
|
60
|
+
}>, foreignTableRefsById?: ReadonlyMap<string, {
|
|
61
|
+
readonly tableRefName: string;
|
|
62
|
+
readonly name: string;
|
|
63
|
+
}>, picklistOptionLabelById?: ReadonlyMap<string, string>, fieldNamesByOwnerRefName?: ReadonlyMap<string, ReadonlyMap<string, string>>, foreignAppRefNames?: ReadonlyMap<string, string>, foreignElementRefNames?: ReadonlyMap<string, string>): AutomationFromTfResult;
|