@elementumai/edk 0.8.2-alpha.6 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -14
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.d.ts +3 -3
- package/dist-sdk/elementum-entity-client/clients/aspects/models/index.d.ts +1 -1
- package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.d.ts +3 -11
- package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +2 -10
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +1 -1
- package/dist-sdk/fs/entity.d.ts +2 -2
- package/dist-sdk/fs/entity.js +1 -1
- package/dist-sdk/pull/missing-report.d.ts +81 -0
- package/dist-sdk/pull/missing-report.js +52 -0
- package/dist-sdk/src/catalog/factories.d.ts +53 -19
- package/dist-sdk/src/catalog/factories.js +51 -12
- package/dist-sdk/src/catalog/from-authoring.js +13 -3
- package/dist-sdk/src/catalog/index.d.ts +2 -2
- package/dist-sdk/src/catalog/index.js +1 -1
- package/dist-sdk/src/catalog/org.js +1 -0
- package/dist-sdk/src/catalog/render.js +6 -0
- package/dist-sdk/src/catalog/token.js +7 -0
- package/dist-sdk/src/catalog/types.d.ts +34 -23
- package/dist-sdk/src/catalog/types.js +7 -4
- package/dist-sdk/src/core/app-to-ui.d.ts +6 -6
- package/dist-sdk/src/core/app-to-ui.js +7 -9
- package/dist-sdk/src/core/index.d.ts +1 -0
- package/dist-sdk/src/core/index.js +1 -0
- package/dist-sdk/src/core/platform-id.d.ts +11 -0
- package/dist-sdk/src/core/platform-id.js +8 -0
- package/dist-sdk/src/{entities/flow/activities/render-catalog.d.ts → core/render-tree.d.ts} +2 -2
- package/dist-sdk/src/{entities/flow/activities/render-catalog.js → core/render-tree.js} +6 -8
- package/dist-sdk/src/core/types/app.d.ts +13 -23
- package/dist-sdk/src/core/types/app.js +0 -1
- package/dist-sdk/src/engine/build/context.d.ts +3 -3
- package/dist-sdk/src/engine/pull/attrs.d.ts +4 -0
- package/dist-sdk/src/engine/pull/attrs.js +17 -0
- package/dist-sdk/src/engine/pull/context.d.ts +39 -0
- package/dist-sdk/src/engine/pull/org.d.ts +1 -0
- package/dist-sdk/src/engine/pull/org.js +2 -0
- package/dist-sdk/src/engine/tf/expr.d.ts +1 -1
- package/dist-sdk/src/engine/tf/expr.js +10 -3
- package/dist-sdk/src/engine/workspace/authoring-layout.js +4 -2
- package/dist-sdk/src/entities/access-policy/build.d.ts +4 -13
- package/dist-sdk/src/entities/access-policy/build.js +1 -1
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +12 -38
- package/dist-sdk/src/entities/access-policy/from-tf.js +16 -74
- package/dist-sdk/src/entities/access-policy/principal.d.ts +29 -0
- package/dist-sdk/src/entities/access-policy/principal.js +13 -0
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +20 -5
- package/dist-sdk/src/entities/access-policy/to-tf.js +26 -54
- package/dist-sdk/src/entities/agent/build.d.ts +39 -8
- package/dist-sdk/src/entities/agent/build.js +36 -15
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +5 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +121 -36
- package/dist-sdk/src/entities/agent/from-tf.js +5 -8
- package/dist-sdk/src/entities/agent/index.d.ts +5 -2
- package/dist-sdk/src/entities/agent/index.js +4 -2
- package/dist-sdk/src/entities/agent/module.js +5 -2
- package/dist-sdk/src/entities/agent/run-as.d.ts +16 -0
- package/dist-sdk/src/entities/agent/run-as.js +1 -0
- package/dist-sdk/src/entities/agent/to-tf.d.ts +2 -1
- package/dist-sdk/src/entities/agent/to-tf.js +2 -1
- package/dist-sdk/src/entities/agent/tools.d.ts +60 -48
- package/dist-sdk/src/entities/agent/tools.js +44 -38
- package/dist-sdk/src/entities/agent-a2a-skill/from-tf.js +1 -1
- package/dist-sdk/src/entities/agent-a2a-skill/to-tf.js +4 -4
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +17 -8
- package/dist-sdk/src/entities/agent-tool/from-tf.js +127 -37
- package/dist-sdk/src/entities/agent-tool/module.js +6 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +5 -5
- package/dist-sdk/src/entities/agent-tool/to-tf.js +93 -20
- package/dist-sdk/src/entities/agent-tool/types.d.ts +4 -5
- package/dist-sdk/src/entities/agent-tool/types.js +36 -8
- package/dist-sdk/src/entities/app/build.d.ts +137 -25
- package/dist-sdk/src/entities/app/build.js +104 -53
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +173 -1
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.d.ts +59 -0
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.js +68 -0
- package/dist-sdk/src/entities/app/display-blocks.d.ts +2 -1
- package/dist-sdk/src/entities/app/display-blocks.js +1 -1
- package/dist-sdk/src/entities/app/from-tf.d.ts +11 -1
- package/dist-sdk/src/entities/app/from-tf.js +30 -2
- package/dist-sdk/src/entities/app/index.d.ts +13 -4
- package/dist-sdk/src/entities/app/index.js +8 -1
- package/dist-sdk/src/entities/app/module.js +27 -2
- package/dist-sdk/src/entities/app/to-tf.js +75 -1
- package/dist-sdk/src/entities/approval-chain/build.d.ts +31 -16
- package/dist-sdk/src/entities/approval-chain/build.js +49 -49
- package/dist-sdk/src/entities/approval-chain/from-tf.d.ts +17 -0
- package/dist-sdk/src/entities/approval-chain/from-tf.js +57 -0
- package/dist-sdk/src/entities/approval-chain/index.d.ts +2 -3
- package/dist-sdk/src/entities/approval-chain/index.js +2 -3
- package/dist-sdk/src/entities/approval-chain/module.d.ts +3 -0
- package/dist-sdk/src/entities/approval-chain/module.js +51 -0
- package/dist-sdk/src/entities/approval-chain/printer.d.ts +2 -0
- package/dist-sdk/src/entities/approval-chain/printer.js +21 -0
- package/dist-sdk/src/entities/approval-chain/to-tf.d.ts +9 -0
- package/dist-sdk/src/entities/approval-chain/to-tf.js +43 -0
- package/dist-sdk/src/entities/automation/build.d.ts +10 -6
- package/dist-sdk/src/entities/automation/build.js +5 -4
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +10 -8
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +51 -114
- package/dist-sdk/src/entities/automation/filter.d.ts +1 -115
- package/dist-sdk/src/entities/automation/filter.js +1 -197
- package/dist-sdk/src/entities/automation/from-tf.d.ts +4 -0
- package/dist-sdk/src/entities/automation/from-tf.js +202 -119
- package/dist-sdk/src/entities/automation/index.d.ts +4 -2
- package/dist-sdk/src/entities/automation/index.js +3 -1
- package/dist-sdk/src/entities/automation/module.js +10 -4
- package/dist-sdk/src/entities/automation/script-code.js +94 -6
- package/dist-sdk/src/entities/automation/tasks.d.ts +20 -19
- package/dist-sdk/src/entities/automation/tasks.js +2 -2
- package/dist-sdk/src/entities/automation/to-tf.d.ts +34 -2
- package/dist-sdk/src/entities/automation/to-tf.js +273 -98
- package/dist-sdk/src/entities/automation/triggers.d.ts +18 -17
- package/dist-sdk/src/entities/automation/triggers.js +1 -1
- package/dist-sdk/src/entities/dashboard/build.d.ts +17 -0
- package/dist-sdk/src/entities/dashboard/from-tf.d.ts +12 -0
- package/dist-sdk/src/entities/dashboard/from-tf.js +95 -0
- package/dist-sdk/src/entities/dashboard/module.d.ts +3 -0
- package/dist-sdk/src/entities/dashboard/module.js +16 -0
- package/dist-sdk/src/entities/dashboard/to-tf.d.ts +30 -0
- package/dist-sdk/src/entities/dashboard/to-tf.js +94 -0
- package/dist-sdk/src/entities/dashboard-widget/module.d.ts +3 -0
- package/dist-sdk/src/entities/dashboard-widget/module.js +10 -0
- package/dist-sdk/src/entities/data-lookup/module.d.ts +3 -0
- package/dist-sdk/src/entities/data-lookup/module.js +22 -0
- package/dist-sdk/src/entities/datamine/build.d.ts +22 -0
- package/dist-sdk/src/entities/datamine/build.js +1 -0
- package/dist-sdk/src/entities/datamine/from-tf.d.ts +17 -0
- package/dist-sdk/src/entities/datamine/from-tf.js +98 -0
- package/dist-sdk/src/entities/datamine/module.d.ts +3 -0
- package/dist-sdk/src/entities/datamine/module.js +23 -0
- package/dist-sdk/src/entities/datamine/to-tf.d.ts +11 -0
- package/dist-sdk/src/entities/datamine/to-tf.js +53 -0
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +303 -0
- package/dist-sdk/src/entities/dynamic-layout/build.js +4 -0
- package/dist-sdk/src/entities/dynamic-layout/dialect.d.ts +2 -0
- package/dist-sdk/src/entities/dynamic-layout/dialect.js +9 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.d.ts +10 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.js +233 -0
- package/dist-sdk/src/entities/dynamic-layout/module.d.ts +3 -0
- package/dist-sdk/src/entities/dynamic-layout/module.js +13 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +26 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +267 -0
- package/dist-sdk/src/entities/element/build.d.ts +31 -14
- package/dist-sdk/src/entities/element/build.js +12 -4
- package/dist-sdk/src/entities/element/from-tf.d.ts +9 -1
- package/dist-sdk/src/entities/element/from-tf.js +31 -2
- package/dist-sdk/src/entities/element/index.d.ts +8 -3
- package/dist-sdk/src/entities/element/index.js +4 -1
- package/dist-sdk/src/entities/element/module.js +19 -2
- package/dist-sdk/src/entities/element/to-tf.js +57 -1
- package/dist-sdk/src/entities/field/build.d.ts +4 -3
- package/dist-sdk/src/entities/field/calculation-types.d.ts +6 -0
- package/dist-sdk/src/entities/field/calculation-types.js +42 -0
- package/dist-sdk/src/entities/field/from-tf.js +90 -11
- package/dist-sdk/src/entities/field/module.d.ts +1 -0
- package/dist-sdk/src/entities/field/module.js +5 -2
- package/dist-sdk/src/entities/field/record-shape.d.ts +1 -1
- package/dist-sdk/src/entities/field/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/field/to-tf.js +22 -6
- package/dist-sdk/src/entities/field/types.js +3 -0
- package/dist-sdk/src/entities/file-reader/build.d.ts +66 -19
- package/dist-sdk/src/entities/file-reader/build.js +49 -4
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.d.ts +1 -0
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +11 -9
- package/dist-sdk/src/entities/file-reader/from-tf.d.ts +1 -1
- package/dist-sdk/src/entities/file-reader/from-tf.js +31 -2
- package/dist-sdk/src/entities/file-reader/index.d.ts +3 -3
- package/dist-sdk/src/entities/file-reader/index.js +3 -3
- package/dist-sdk/src/entities/file-reader/module.js +6 -5
- package/dist-sdk/src/entities/file-reader/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/file-reader/to-tf.js +5 -2
- package/dist-sdk/src/entities/file-reader/types.d.ts +3 -4
- package/dist-sdk/src/entities/file-reader/types.js +4 -5
- package/dist-sdk/src/entities/org/category.js +4 -5
- package/dist-sdk/src/entities/org/group.js +4 -5
- package/dist-sdk/src/entities/org/index.d.ts +1 -0
- package/dist-sdk/src/entities/org/index.js +1 -0
- package/dist-sdk/src/entities/org/phone-provider.d.ts +4 -0
- package/dist-sdk/src/entities/org/phone-provider.js +33 -0
- package/dist-sdk/src/entities/org/role.d.ts +3 -3
- package/dist-sdk/src/entities/org/role.js +9 -6
- package/dist-sdk/src/entities/organization/build.d.ts +29 -0
- package/dist-sdk/src/entities/organization/build.js +24 -0
- package/dist-sdk/src/entities/organization/index.d.ts +2 -0
- package/dist-sdk/src/entities/organization/index.js +2 -0
- package/dist-sdk/src/entities/organization/module.d.ts +2 -0
- package/dist-sdk/src/entities/organization/module.js +18 -0
- package/dist-sdk/src/entities/organization/to-tf.d.ts +6 -0
- package/dist-sdk/src/entities/organization/to-tf.js +37 -0
- package/dist-sdk/src/entities/phone-service/build.d.ts +17 -0
- package/dist-sdk/src/entities/phone-service/build.js +31 -0
- package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.d.ts +4 -0
- package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.js +54 -0
- package/dist-sdk/src/entities/phone-service/from-tf.d.ts +25 -0
- package/dist-sdk/src/entities/phone-service/from-tf.js +75 -0
- package/dist-sdk/src/entities/phone-service/index.d.ts +2 -0
- package/dist-sdk/src/entities/phone-service/index.js +2 -0
- package/dist-sdk/src/entities/phone-service/module.d.ts +3 -0
- package/dist-sdk/src/entities/phone-service/module.js +55 -0
- package/dist-sdk/src/entities/phone-service/to-tf.d.ts +12 -0
- package/dist-sdk/src/entities/phone-service/to-tf.js +54 -0
- package/dist-sdk/src/entities/phone-service/types.d.ts +35 -0
- package/dist-sdk/src/entities/phone-service/types.js +22 -0
- package/dist-sdk/src/entities/record-create-form/from-tf.d.ts +11 -0
- package/dist-sdk/src/entities/record-create-form/from-tf.js +74 -0
- package/dist-sdk/src/entities/record-create-form/module.d.ts +11 -0
- package/dist-sdk/src/entities/record-create-form/module.js +24 -0
- package/dist-sdk/src/entities/record-create-form/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/record-create-form/to-tf.js +80 -0
- package/dist-sdk/src/entities/relationship/build.d.ts +16 -0
- package/dist-sdk/src/entities/relationship/build.js +1 -0
- package/dist-sdk/src/entities/relationship/from-tf.d.ts +12 -0
- package/dist-sdk/src/entities/relationship/from-tf.js +109 -0
- package/dist-sdk/src/entities/relationship/module.d.ts +3 -0
- package/dist-sdk/src/entities/relationship/module.js +16 -0
- package/dist-sdk/src/entities/relationship/to-tf.d.ts +31 -0
- package/dist-sdk/src/entities/relationship/to-tf.js +153 -0
- package/dist-sdk/src/entities/role/build.d.ts +65 -0
- package/dist-sdk/src/entities/role/build.js +33 -0
- package/dist-sdk/src/entities/role/from-tf.d.ts +13 -0
- package/dist-sdk/src/entities/role/from-tf.js +138 -0
- package/dist-sdk/src/entities/role/to-tf.d.ts +13 -0
- package/dist-sdk/src/entities/role/to-tf.js +69 -0
- package/dist-sdk/src/entities/search-table/build.d.ts +67 -28
- package/dist-sdk/src/entities/search-table/build.js +110 -56
- package/dist-sdk/src/entities/search-table/from-tf.d.ts +37 -0
- package/dist-sdk/src/entities/search-table/from-tf.js +113 -0
- package/dist-sdk/src/entities/search-table/index.d.ts +2 -2
- package/dist-sdk/src/entities/search-table/index.js +2 -2
- package/dist-sdk/src/entities/search-table/module.js +88 -10
- package/dist-sdk/src/entities/search-table/printer.d.ts +2 -0
- package/dist-sdk/src/entities/search-table/printer.js +52 -0
- package/dist-sdk/src/entities/search-table/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/search-table/to-tf.js +104 -0
- package/dist-sdk/src/entities/search-table/types.d.ts +8 -0
- package/dist-sdk/src/entities/search-table/types.js +21 -0
- package/dist-sdk/src/entities/service-account/build.d.ts +32 -0
- package/dist-sdk/src/entities/service-account/build.js +9 -0
- package/dist-sdk/src/entities/service-account/from-tf.d.ts +10 -0
- package/dist-sdk/src/entities/service-account/from-tf.js +109 -0
- package/dist-sdk/src/entities/service-account/module.d.ts +4 -0
- package/dist-sdk/src/entities/service-account/module.js +21 -0
- package/dist-sdk/src/entities/service-account/ref.d.ts +11 -0
- package/dist-sdk/src/entities/service-account/ref.js +5 -0
- package/dist-sdk/src/entities/service-account/to-tf.d.ts +11 -0
- package/dist-sdk/src/entities/service-account/to-tf.js +72 -0
- package/dist-sdk/src/entities/shared/connector-from-tf.d.ts +14 -0
- package/dist-sdk/src/entities/shared/connector-from-tf.js +14 -0
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +21 -79
- package/dist-sdk/src/entities/shared/filters/ast.js +5 -2
- package/dist-sdk/src/entities/shared/filters/index.d.ts +94 -206
- package/dist-sdk/src/entities/shared/filters/index.js +189 -341
- package/dist-sdk/src/entities/shared/filters/print.d.ts +11 -0
- package/dist-sdk/src/entities/shared/filters/print.js +122 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +170 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +527 -0
- package/dist-sdk/src/entities/shared/filters/types.d.ts +66 -69
- package/dist-sdk/src/entities/shared/filters/types.js +2 -3
- package/dist-sdk/src/entities/skill/build.d.ts +2 -2
- package/dist-sdk/src/entities/skill/build.js +4 -3
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +10 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +74 -32
- package/dist-sdk/src/entities/skill/index.d.ts +2 -1
- package/dist-sdk/src/entities/skill/index.js +2 -1
- package/dist-sdk/src/entities/skill/module.js +6 -0
- package/dist-sdk/src/entities/skill/to-tf.d.ts +5 -1
- package/dist-sdk/src/entities/skill/to-tf.js +18 -0
- package/dist-sdk/src/entities/skill/tools.d.ts +46 -31
- package/dist-sdk/src/entities/skill/tools.js +33 -20
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +4 -1
- package/dist-sdk/src/entities/skill-tool/from-tf.js +76 -8
- package/dist-sdk/src/entities/skill-tool/module.js +9 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +6 -1
- package/dist-sdk/src/entities/skill-tool/to-tf.js +94 -42
- package/dist-sdk/src/entities/skill-tool/types.js +18 -1
- package/dist-sdk/src/entities/table/build.d.ts +64 -23
- package/dist-sdk/src/entities/table/build.js +33 -18
- package/dist-sdk/src/entities/table/catalog-render.js +6 -0
- package/dist-sdk/src/entities/table/deserializer/normalize.d.ts +99 -0
- package/dist-sdk/src/entities/table/deserializer/normalize.js +192 -0
- package/dist-sdk/src/entities/table/fields/types.d.ts +86 -0
- package/dist-sdk/src/entities/table/fields/types.js +12 -0
- package/dist-sdk/src/entities/table/fields.d.ts +107 -47
- package/dist-sdk/src/entities/table/fields.js +76 -55
- package/dist-sdk/src/entities/table/from-tf.d.ts +4 -0
- package/dist-sdk/src/entities/table/from-tf.js +261 -0
- package/dist-sdk/src/entities/table/index.d.ts +7 -5
- package/dist-sdk/src/entities/table/index.js +7 -7
- package/dist-sdk/src/entities/table/joins.d.ts +22 -9
- package/dist-sdk/src/entities/table/joins.js +8 -16
- package/dist-sdk/src/entities/table/module.d.ts +2 -1
- package/dist-sdk/src/entities/table/module.js +13 -6
- package/dist-sdk/src/entities/table/to-tf.d.ts +10 -0
- package/dist-sdk/src/entities/table/to-tf.js +230 -0
- package/dist-sdk/src/entities/task/build.d.ts +43 -0
- package/dist-sdk/src/entities/task/build.js +17 -0
- package/dist-sdk/src/entities/task/from-tf.d.ts +28 -0
- package/dist-sdk/src/entities/task/from-tf.js +38 -0
- package/dist-sdk/src/entities/task/index.d.ts +1 -0
- package/dist-sdk/src/entities/task/index.js +1 -0
- package/dist-sdk/src/entities/task/module.d.ts +3 -0
- package/dist-sdk/src/entities/task/module.js +12 -0
- package/dist-sdk/src/entities/task/to-tf.d.ts +9 -0
- package/dist-sdk/src/entities/task/to-tf.js +49 -0
- package/dist-sdk/src/entities/view/from-tf.d.ts +7 -2
- package/dist-sdk/src/entities/view/from-tf.js +209 -25
- package/dist-sdk/src/entities/view/module.js +5 -1
- package/dist-sdk/src/entities/view/to-tf.d.ts +49 -7
- package/dist-sdk/src/entities/view/to-tf.js +155 -18
- package/dist-sdk/src/entities/view/types.d.ts +8 -0
- package/dist-sdk/src/entities/view/types.js +43 -0
- package/dist-sdk/src/entities/visual-flow/build.d.ts +87 -0
- package/dist-sdk/src/entities/visual-flow/build.js +72 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.d.ts +49 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.js +124 -0
- package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -0
- package/dist-sdk/src/entities/visual-flow/index.js +1 -0
- package/dist-sdk/src/entities/visual-flow/module.d.ts +3 -0
- package/dist-sdk/src/entities/visual-flow/module.js +41 -0
- package/dist-sdk/src/entities/visual-flow/printer.d.ts +8 -0
- package/dist-sdk/src/entities/visual-flow/printer.js +92 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.js +101 -0
- package/dist-sdk/src/entities/widget/build.d.ts +55 -0
- package/dist-sdk/src/entities/widget/build.js +1 -0
- package/dist-sdk/src/entities/widget/from-tf.d.ts +11 -0
- package/dist-sdk/src/entities/widget/from-tf.js +209 -0
- package/dist-sdk/src/entities/widget/module.d.ts +3 -0
- package/dist-sdk/src/entities/widget/module.js +16 -0
- package/dist-sdk/src/entities/widget/to-tf.d.ts +44 -0
- package/dist-sdk/src/entities/widget/to-tf.js +204 -0
- package/dist-sdk/src/graph/deferred-catalog-render.d.ts +1 -1
- package/dist-sdk/src/graph/deferred-catalog-render.js +1 -1
- package/dist-sdk/src/graph/index.d.ts +7 -0
- package/dist-sdk/src/graph/index.js +4 -18
- package/dist-sdk/src/graph/modules.js +30 -1
- package/dist-sdk/src/graph/types.d.ts +55 -7
- package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
- package/dist-sdk/src/internal/sdk-package.js +4 -2
- package/package.json +30 -15
- package/dist-sdk/src/entities/access-policy/filter.d.ts +0 -61
- package/dist-sdk/src/entities/access-policy/filter.js +0 -83
- package/dist-sdk/src/entities/approval-chain/steps.d.ts +0 -24
- package/dist-sdk/src/entities/approval-chain/steps.js +0 -20
- package/dist-sdk/src/entities/flow/activities/agent.d.ts +0 -15
- package/dist-sdk/src/entities/flow/activities/agent.js +0 -29
- package/dist-sdk/src/entities/flow/activities/approval.d.ts +0 -9
- package/dist-sdk/src/entities/flow/activities/approval.js +0 -18
- package/dist-sdk/src/entities/flow/activities/automation.d.ts +0 -12
- package/dist-sdk/src/entities/flow/activities/automation.js +0 -22
- package/dist-sdk/src/entities/flow/activities/ctx.d.ts +0 -34
- package/dist-sdk/src/entities/flow/activities/ctx.js +0 -38
- package/dist-sdk/src/entities/flow/activities/form.d.ts +0 -22
- package/dist-sdk/src/entities/flow/activities/form.js +0 -36
- package/dist-sdk/src/entities/flow/activities/index.d.ts +0 -14
- package/dist-sdk/src/entities/flow/activities/index.js +0 -13
- package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +0 -39
- package/dist-sdk/src/entities/flow/activities/input-refs.js +0 -19
- package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +0 -13
- package/dist-sdk/src/entities/flow/activities/prompt-template.js +0 -34
- package/dist-sdk/src/entities/flow/activities/types.d.ts +0 -33
- package/dist-sdk/src/entities/flow/build.d.ts +0 -38
- package/dist-sdk/src/entities/flow/build.js +0 -115
- package/dist-sdk/src/entities/flow/index.d.ts +0 -8
- package/dist-sdk/src/entities/flow/index.js +0 -7
- package/dist-sdk/src/entities/flow/serialize.d.ts +0 -51
- package/dist-sdk/src/entities/flow/serialize.js +0 -94
- package/dist-sdk/src/entities/flow/util.d.ts +0 -27
- package/dist-sdk/src/entities/flow/util.js +0 -38
- package/dist-sdk/src/entities/table/filter.d.ts +0 -41
- package/dist-sdk/src/entities/table/filter.js +0 -89
- /package/dist-sdk/src/entities/{flow/activities/types.js → dashboard/build.js} +0 -0
|
@@ -1,372 +1,220 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Filter DSL — structured helpers that produce filter objects matching
|
|
3
|
-
* the Elementum Filter Java model exactly.
|
|
4
|
-
*
|
|
5
|
-
* Row-scoped vs context filters
|
|
6
|
-
* -----------------------------
|
|
7
|
-
* Field-based helpers (`eq`, `gt`, `lt`, `like`, `isIn`, `between`,
|
|
8
|
-
* `contains`, `overlaps`, `isNull`, ...) compare a *column of the current
|
|
9
|
-
* row* against a value. That only makes sense when a row is in scope — i.e.
|
|
10
|
-
* inside a row-filter callback supplied to a row-searching task. The
|
|
11
|
-
* parameter type is `AppField<"row">`, which is only produced by the row
|
|
12
|
-
* proxy handed to those callbacks. A bare `app.fields.X` at module scope is
|
|
13
|
-
* `AppField<"unscoped">` and will not type-check here.
|
|
14
|
-
*
|
|
15
|
-
* Row-less contexts (e.g. `switchTask` conditions, operator-filter slots)
|
|
16
|
-
* have no row — use `refEq` / `refIn` / `refGt` / `refLt` (with a
|
|
17
|
-
* task-output or trigger `Ref` on the left) or combine those with
|
|
18
|
-
* `and` / `or`. Passing a field descriptor in those contexts is a compile
|
|
19
|
-
* error by design.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```ts
|
|
23
|
-
* // Field-based (record search / findRelatedRecords filters)
|
|
24
|
-
* eq(app.fields.name, "ACME")
|
|
25
|
-
* eq(app.fields.name, ctx.trigger.vendorName) // Ref auto-typed from field
|
|
26
|
-
* gt(app.fields.amount, 1000)
|
|
27
|
-
*
|
|
28
|
-
* // Ref-based (switch case conditions)
|
|
29
|
-
* refGt(ctx.tasks.metrics.load, ctx.tasks.find.count) // both auto-typed NUMBER
|
|
30
|
-
* refEq(ctx.tasks.lookup.status, "active") // auto-typed TEXT
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
import { isRef } from "../ref.js";
|
|
1
|
+
/** Canonical Elementum filter model and authoring helpers. */
|
|
34
2
|
import { picklistStaticValueToApiId } from "../../../core/types/app.js";
|
|
3
|
+
import { serializeRefData } from "../../../core/wire/ref-serializer.js";
|
|
35
4
|
import { EdkValidationError } from "../../../../elementum-entity-client/errors.js";
|
|
36
|
-
|
|
37
|
-
// AppField → field ID + value type resolution
|
|
38
|
-
// ---------------------------------------------------------------------------
|
|
5
|
+
import { isRef } from "../ref.js";
|
|
39
6
|
export function fieldTypeToValueType(type) {
|
|
40
7
|
switch (type) {
|
|
41
|
-
case "TEXT":
|
|
42
|
-
case "HTML":
|
|
43
|
-
case "RICH_TEXT":
|
|
44
|
-
case "PICKLIST": return "TEXT";
|
|
45
8
|
case "NUMBER":
|
|
46
9
|
case "DECIMAL": return "NUMBER";
|
|
47
10
|
case "BOOLEAN": return "BOOLEAN";
|
|
48
11
|
case "DATE": return "DATE";
|
|
49
12
|
case "DATETIME": return "DATETIME";
|
|
13
|
+
case "USER":
|
|
14
|
+
case "USER_ID":
|
|
15
|
+
case "GROUP":
|
|
16
|
+
case "GROUP_ID":
|
|
50
17
|
case "ASPECT_ID":
|
|
51
18
|
case "ASPECT_RECORD":
|
|
52
19
|
case "ASPECT_RECORD_ID":
|
|
53
|
-
case "ASPECT_FIELD_ID":
|
|
20
|
+
case "ASPECT_FIELD_ID":
|
|
21
|
+
return "UUID";
|
|
54
22
|
default: return "TEXT";
|
|
55
23
|
}
|
|
56
24
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const TYPED_BRAND = Symbol("TypedRef");
|
|
61
|
-
/**
|
|
62
|
-
* Annotate a Ref with its ValueType for use in filter values.
|
|
63
|
-
* Use when there is no AppField context (e.g. some switch conditions).
|
|
64
|
-
* With `eq(app.fields.x, ref)`, the field supplies the type automatically.
|
|
65
|
-
*/
|
|
66
|
-
export function typed(ref, valueType) {
|
|
67
|
-
return { [TYPED_BRAND]: true, ref, valueType };
|
|
68
|
-
}
|
|
69
|
-
export function isTypedRef(value) {
|
|
70
|
-
return (typeof value === "object" &&
|
|
71
|
-
value !== null &&
|
|
72
|
-
TYPED_BRAND in value &&
|
|
73
|
-
value[TYPED_BRAND] === true);
|
|
74
|
-
}
|
|
75
|
-
// ---------------------------------------------------------------------------
|
|
76
|
-
// Internal: resolve a filter value, auto-typing Refs from AppField
|
|
77
|
-
// ---------------------------------------------------------------------------
|
|
78
|
-
/**
|
|
79
|
-
* Auto-type a RefFilterInput: bare Refs get wrapped with `typed(ref, fallbackType)`;
|
|
80
|
-
* already-typed values (TypedRef, literals, null) pass through unchanged.
|
|
81
|
-
*/
|
|
82
|
-
function resolveRefInput(input, fallbackType) {
|
|
83
|
-
if (isRef(input) && !isTypedRef(input)) {
|
|
84
|
-
// Static-value refs (val(75)) should resolve to their raw value so
|
|
85
|
-
// toFilterValue emits { type: "NUMBER", value: 75 } instead of a
|
|
86
|
-
// REFERENCE wrapper that Mobius doesn't understand for literals.
|
|
87
|
-
if (input.__data.kind === "static") {
|
|
88
|
-
return input.__data.value;
|
|
89
|
-
}
|
|
90
|
-
return typed(input, fallbackType);
|
|
91
|
-
}
|
|
92
|
-
return input;
|
|
93
|
-
}
|
|
94
|
-
function resolveRefInputs(inputs, fallbackType) {
|
|
95
|
-
return inputs.map((v) => resolveRefInput(v, fallbackType));
|
|
96
|
-
}
|
|
97
|
-
export function refDataToFilterReference(data) {
|
|
98
|
-
switch (data.kind) {
|
|
99
|
-
case "trigger":
|
|
100
|
-
return { type: "TRIGGER", name: data.name };
|
|
101
|
-
case "task":
|
|
102
|
-
return { type: "TASK", taskRefKey: data.taskRefKey, name: data.name };
|
|
103
|
-
case "forEach":
|
|
104
|
-
return { type: "FOR_EACH", forEachTaskRefKey: data.forEachTaskName, name: data.name };
|
|
105
|
-
case "static":
|
|
106
|
-
return { type: "VALUE", value: data.value };
|
|
107
|
-
case "template":
|
|
108
|
-
throw new EdkValidationError("Template refs cannot be used directly in filter values");
|
|
109
|
-
case "variableParam":
|
|
110
|
-
throw new EdkValidationError("Variable param refs cannot be used directly in filter values");
|
|
111
|
-
case "secret":
|
|
112
|
-
throw new EdkValidationError("Secret refs cannot be used directly in filter values");
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
export function toFilterValue(input) {
|
|
116
|
-
if (input === null) {
|
|
117
|
-
return { type: "NULL" };
|
|
118
|
-
}
|
|
119
|
-
if (isTypedRef(input)) {
|
|
120
|
-
return {
|
|
121
|
-
type: "REFERENCE",
|
|
122
|
-
realType: input.valueType,
|
|
123
|
-
value: refDataToFilterReference(input.ref.__data),
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
switch (typeof input) {
|
|
127
|
-
case "string":
|
|
128
|
-
return { type: "TEXT", value: input };
|
|
129
|
-
case "number":
|
|
130
|
-
return { type: "NUMBER", value: input };
|
|
131
|
-
case "boolean":
|
|
132
|
-
return { type: "BOOLEAN", value: input };
|
|
133
|
-
default:
|
|
134
|
-
throw new EdkValidationError(`Cannot infer filter value type from: ${typeof input}`);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
function toFilterValues(inputs) {
|
|
138
|
-
return inputs.map(toFilterValue);
|
|
139
|
-
}
|
|
140
|
-
function isPicklistOptionShape(value) {
|
|
141
|
-
return (typeof value === "object" &&
|
|
142
|
-
value !== null &&
|
|
143
|
-
"id" in value &&
|
|
144
|
-
"label" in value &&
|
|
145
|
-
typeof value.id === "string" &&
|
|
146
|
-
typeof value.label === "string");
|
|
147
|
-
}
|
|
148
|
-
// Runtime helpers below accept any-scope `AppField` — scope is a pure
|
|
149
|
-
// type-level concern, so the internal signatures must be scope-agnostic or
|
|
150
|
-
// TS sees `AppField<"row">` as unassignable to the default `AppField<"unscoped">`.
|
|
151
|
-
// `RowField` (alias below) tightens the *public* parameter so only
|
|
152
|
-
// row-scoped descriptors can reach these helpers from user code.
|
|
153
|
-
function resolveValue(field, value) {
|
|
154
|
-
if (isRef(value)) {
|
|
155
|
-
// `AppField.type` includes `"HANDLE"` for aspect compose authoring;
|
|
156
|
-
// `WorkflowFieldType` (used by `fieldTypeToValueType`) doesn't list it,
|
|
157
|
-
// but a HANDLE field on the wire stores a TEXT value, so the cast is
|
|
158
|
-
// safe at runtime — the lookup table treats HANDLE the same as TEXT.
|
|
159
|
-
return typed(value, fieldTypeToValueType(field.type));
|
|
160
|
-
}
|
|
161
|
-
const coerced = picklistStaticValueToApiId(field, value);
|
|
162
|
-
if (coerced !== value) {
|
|
163
|
-
return coerced;
|
|
164
|
-
}
|
|
165
|
-
if (isPicklistOptionShape(value)) {
|
|
166
|
-
throw new EdkValidationError(`Picklist option does not match field "${field.name}" for filter`);
|
|
167
|
-
}
|
|
168
|
-
return value;
|
|
169
|
-
}
|
|
170
|
-
function resolveValues(field, values) {
|
|
171
|
-
return values.map((v) => resolveValue(field, v));
|
|
25
|
+
const FILTER_REFERENCE_BRAND = Symbol("FilterReferenceInput");
|
|
26
|
+
function referenceInput(ref, valueType, options) {
|
|
27
|
+
return { [FILTER_REFERENCE_BRAND]: true, ref, valueType, ...(options?.multiple === true && { multiple: true }) };
|
|
172
28
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
// ---------------------------------------------------------------------------
|
|
176
|
-
/** EQUALS filter. Value type is checked against the field's type. Requires a row-scoped field. */
|
|
177
|
-
export function eq(field, value, options) {
|
|
178
|
-
return { type: "EQUALS", field: field.id, value: toFilterValue(resolveValue(field, value)), ...(options?.not ? { not: true } : {}) };
|
|
29
|
+
export function boolean(ref, options) {
|
|
30
|
+
return referenceInput(ref, "BOOLEAN", options);
|
|
179
31
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
return eq(field, value, { not: true });
|
|
32
|
+
export function date(ref, options) {
|
|
33
|
+
return referenceInput(ref, "DATE", options);
|
|
183
34
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return { type: "GREATER_THAN", field: field.id, value: toFilterValue(resolveValue(field, value)) };
|
|
35
|
+
export function dateTime(ref, options) {
|
|
36
|
+
return referenceInput(ref, "DATETIME", options);
|
|
187
37
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
return { type: "GREATER_THAN_EQUALS", field: field.id, value: toFilterValue(resolveValue(field, value)) };
|
|
38
|
+
export function number(ref, options) {
|
|
39
|
+
return referenceInput(ref, "NUMBER", options);
|
|
191
40
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
return { type: "LESS_THAN", field: field.id, value: toFilterValue(resolveValue(field, value)) };
|
|
41
|
+
export function text(ref, options) {
|
|
42
|
+
return referenceInput(ref, "TEXT", options);
|
|
195
43
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return { type: "LESS_THAN_EQUALS", field: field.id, value: toFilterValue(resolveValue(field, value)) };
|
|
199
|
-
}
|
|
200
|
-
/** LIKE filter with optional mode and case sensitivity. Requires a row-scoped field. */
|
|
201
|
-
export function like(field, value, options) {
|
|
202
|
-
return {
|
|
203
|
-
type: "LIKE",
|
|
204
|
-
field: field.id,
|
|
205
|
-
value: toFilterValue(resolveValue(field, value)),
|
|
206
|
-
...(options?.not ? { not: true } : {}),
|
|
207
|
-
...(options?.caseInsensitive ? { caseInsensitive: true } : {}),
|
|
208
|
-
...(options?.mode ? { mode: options.mode } : {}),
|
|
209
|
-
};
|
|
44
|
+
export function uuid(ref, options) {
|
|
45
|
+
return referenceInput(ref, "UUID", options);
|
|
210
46
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
// ---------------------------------------------------------------------------
|
|
214
|
-
/** IN filter — field matches any of the provided values. Requires a row-scoped field. */
|
|
215
|
-
export function isIn(field, values, options) {
|
|
216
|
-
return {
|
|
217
|
-
type: "IN",
|
|
218
|
-
field: field.id,
|
|
219
|
-
values: toFilterValues(resolveValues(field, values)),
|
|
220
|
-
...(options?.not ? { not: true } : {}),
|
|
221
|
-
};
|
|
47
|
+
export function isFilterReferenceInput(value) {
|
|
48
|
+
return typeof value === "object" && value !== null && FILTER_REFERENCE_BRAND in value;
|
|
222
49
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
return { type: "BETWEEN", field: field.id, values: [toFilterValue(resolveValue(field, low)), toFilterValue(resolveValue(field, high))] };
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* CONSECUTIVE_RANGE filter — field falls within a relative calendar range
|
|
229
|
-
* (`count` `unit`s, shifted `offset` `unit`s back from now). `semantic`
|
|
230
|
-
* selects whether the range snaps to calendar-unit boundaries (`true`) or
|
|
231
|
-
* is a rolling window measured from the current moment (`false`, the
|
|
232
|
-
* default). `unit` is a platform-defined calendar-unit string (e.g.
|
|
233
|
-
* `"QUARTER"`) — not validated here. Requires a row-scoped field.
|
|
234
|
-
*/
|
|
235
|
-
export function consecutiveRange(field, options) {
|
|
236
|
-
return {
|
|
237
|
-
type: "CONSECUTIVE_RANGE",
|
|
238
|
-
field: field.id,
|
|
239
|
-
unit: options.unit,
|
|
240
|
-
count: options.count,
|
|
241
|
-
offset: options.offset,
|
|
242
|
-
semantic: options.semantic ?? false,
|
|
243
|
-
};
|
|
50
|
+
export function currentUser(valueType = "ID") {
|
|
51
|
+
return { __kind: "currentUser", valueType };
|
|
244
52
|
}
|
|
245
|
-
|
|
246
|
-
export function contains(field, values) {
|
|
247
|
-
return { type: "CONTAINS", field: field.id, values: toFilterValues(resolveValues(field, values)) };
|
|
248
|
-
}
|
|
249
|
-
/** OVERLAPS filter — array field overlaps with any of the provided values. Requires a row-scoped field. */
|
|
250
|
-
export function overlaps(field, values) {
|
|
251
|
-
return { type: "OVERLAPS", field: field.id, values: toFilterValues(resolveValues(field, values)) };
|
|
252
|
-
}
|
|
253
|
-
// ---------------------------------------------------------------------------
|
|
254
|
-
// Field-only filter helpers
|
|
255
|
-
// ---------------------------------------------------------------------------
|
|
256
|
-
/** IS_NULL filter — field is null (or not null when not=true). Requires a row-scoped field. */
|
|
257
|
-
export function isNull(field, options) {
|
|
258
|
-
return { type: "IS_NULL", field: field.id, ...(options?.not ? { not: true } : {}) };
|
|
259
|
-
}
|
|
260
|
-
/** IS NOT NULL shorthand. Requires a row-scoped field. */
|
|
261
|
-
export function isNotNull(field) {
|
|
262
|
-
return isNull(field, { not: true });
|
|
263
|
-
}
|
|
264
|
-
export function refEq(left, right, leftType = "TEXT") {
|
|
265
|
-
const leftValue = toRefFilterValue(left, leftType);
|
|
266
|
-
return { type: "EQUALS", leftValue, value: toFilterValue(resolveRefInput(right, leftType)) };
|
|
267
|
-
}
|
|
268
|
-
export function refIn(left, values, leftType = "TEXT") {
|
|
269
|
-
const leftValue = toRefFilterValue(left, leftType);
|
|
270
|
-
return { type: "IN", leftValue, values: toFilterValues(resolveRefInputs(values, leftType)) };
|
|
271
|
-
}
|
|
272
|
-
export function refGt(left, right, leftType = "NUMBER") {
|
|
273
|
-
const leftValue = toRefFilterValue(left, leftType);
|
|
274
|
-
return { type: "GREATER_THAN", leftValue, value: toFilterValue(resolveRefInput(right, leftType)) };
|
|
275
|
-
}
|
|
276
|
-
export function refGte(left, right, leftType = "NUMBER") {
|
|
277
|
-
const leftValue = toRefFilterValue(left, leftType);
|
|
278
|
-
return { type: "GREATER_THAN_EQUALS", leftValue, value: toFilterValue(resolveRefInput(right, leftType)) };
|
|
279
|
-
}
|
|
280
|
-
export function refLt(left, right, leftType = "NUMBER") {
|
|
281
|
-
const leftValue = toRefFilterValue(left, leftType);
|
|
282
|
-
return { type: "LESS_THAN", leftValue, value: toFilterValue(resolveRefInput(right, leftType)) };
|
|
283
|
-
}
|
|
284
|
-
export function refLte(left, right, leftType = "NUMBER") {
|
|
285
|
-
const leftValue = toRefFilterValue(left, leftType);
|
|
286
|
-
return { type: "LESS_THAN_EQUALS", leftValue, value: toFilterValue(resolveRefInput(right, leftType)) };
|
|
287
|
-
}
|
|
288
|
-
export function refNotEq(left, right, leftType = "TEXT") {
|
|
289
|
-
const leftValue = toRefFilterValue(left, leftType);
|
|
290
|
-
return { type: "EQUALS", leftValue, value: toFilterValue(resolveRefInput(right, leftType)), not: true };
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* LIKE filter using a Ref as the left-hand side. The right side is always a
|
|
294
|
-
* literal pattern (a Ref doesn't make sense as a LIKE pattern).
|
|
295
|
-
*/
|
|
296
|
-
export function refLike(left, value, options, leftType = "TEXT") {
|
|
297
|
-
const leftValue = toRefFilterValue(left, leftType);
|
|
53
|
+
export function fieldValue(value, options) {
|
|
298
54
|
return {
|
|
299
|
-
type: "
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
...(options?.
|
|
303
|
-
...(options?.caseInsensitive ? { caseInsensitive: true } : {}),
|
|
304
|
-
...(options?.mode ? { mode: options.mode } : {}),
|
|
55
|
+
type: "FIELD",
|
|
56
|
+
value: fieldWireValue(value),
|
|
57
|
+
...(options?.aspect !== undefined && { aspect: options.aspect }),
|
|
58
|
+
...(options?.treatNullAsEquals !== undefined && { treatNullAsEquals: options.treatNullAsEquals }),
|
|
305
59
|
};
|
|
306
60
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
type: "
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
};
|
|
61
|
+
export const UNRESOLVED_REFERENCE_MARKER = "__edkUnresolvedReference::";
|
|
62
|
+
export function refDataToFilterReference(data) {
|
|
63
|
+
switch (data.kind) {
|
|
64
|
+
case "trigger": return { type: "TRIGGER", name: data.name };
|
|
65
|
+
case "task": return { type: "TASK", taskRefKey: data.taskRefKey, name: data.name };
|
|
66
|
+
case "forEach": return { type: "FOR_EACH", forEachTaskRefKey: data.forEachTaskName, name: data.name };
|
|
67
|
+
case "static": return { type: "VALUE", value: data.value };
|
|
68
|
+
case "template": return { type: "VALUE", value: serializeRefData(data) };
|
|
69
|
+
case "variableParam": throw new EdkValidationError("Variable param refs cannot be used directly in filter values");
|
|
70
|
+
case "secret": throw new EdkValidationError("Secret refs cannot be used directly in filter values");
|
|
71
|
+
}
|
|
319
72
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
return
|
|
346
|
-
}
|
|
347
|
-
function
|
|
73
|
+
function hasKind(value, kind) {
|
|
74
|
+
return typeof value === "object" && value !== null && value.__kind === kind;
|
|
75
|
+
}
|
|
76
|
+
function isCurrentUser(value) { return hasKind(value, "currentUser"); }
|
|
77
|
+
const FILTER_VALUE_TYPES = new Set([
|
|
78
|
+
"BOOLEAN", "CURRENT_USER", "DATE", "DATETIME", "FIELD", "NULL", "NUMBER", "RECORD_FIELD", "REFERENCE", "TEXT", "UUID",
|
|
79
|
+
]);
|
|
80
|
+
function isCanonicalFilterValue(value) {
|
|
81
|
+
return typeof value === "object" && value !== null && typeof value.type === "string" &&
|
|
82
|
+
FILTER_VALUE_TYPES.has(value.type);
|
|
83
|
+
}
|
|
84
|
+
function isCatalogField(value) {
|
|
85
|
+
return hasKind(value, "field") || hasKind(value, "userField") || hasKind(value, "tableColumn");
|
|
86
|
+
}
|
|
87
|
+
function isAppField(value) {
|
|
88
|
+
return typeof value === "object" && value !== null && "id" in value && "type" in value && !isCatalogField(value);
|
|
89
|
+
}
|
|
90
|
+
function fieldWireValue(field) { return isAppField(field) ? field.id : field; }
|
|
91
|
+
function leftType(left, fallback, explicit) {
|
|
92
|
+
if (explicit !== undefined)
|
|
93
|
+
return explicit;
|
|
94
|
+
if (isFilterReferenceInput(left))
|
|
95
|
+
return left.valueType;
|
|
96
|
+
if (isRef(left) || typeof left === "string")
|
|
97
|
+
return fallback;
|
|
98
|
+
return fieldTypeToValueType(isAppField(left) ? left.type : "fieldType" in left ? left.fieldType : undefined);
|
|
99
|
+
}
|
|
100
|
+
function leftDescriptor(left, fallback, explicit) {
|
|
101
|
+
if (isFilterReferenceInput(left))
|
|
102
|
+
return { leftValue: toFilterValue(left) };
|
|
103
|
+
if (isRef(left))
|
|
104
|
+
return { leftValue: { type: "REFERENCE", realType: explicit ?? fallback, value: refDataToFilterReference(left.__data) } };
|
|
105
|
+
if (typeof left === "string" && left.startsWith(UNRESOLVED_REFERENCE_MARKER)) {
|
|
106
|
+
return { leftValue: { type: "REFERENCE", realType: explicit ?? fallback, value: { __rawFilterReference: left.slice(UNRESOLVED_REFERENCE_MARKER.length) } } };
|
|
107
|
+
}
|
|
108
|
+
return { field: fieldWireValue(left) };
|
|
109
|
+
}
|
|
110
|
+
function resolveStaticFieldValue(field, input) {
|
|
111
|
+
if (isRef(input) || isFilterReferenceInput(input) || !isAppField(field))
|
|
112
|
+
return input;
|
|
113
|
+
return picklistStaticValueToApiId(field, input);
|
|
114
|
+
}
|
|
115
|
+
export function toFilterValue(input, valueType = "TEXT") {
|
|
116
|
+
if (isCanonicalFilterValue(input))
|
|
117
|
+
return input;
|
|
118
|
+
if (isCurrentUser(input))
|
|
119
|
+
return { type: "CURRENT_USER", valueType: input.valueType };
|
|
120
|
+
if (isFilterReferenceInput(input)) {
|
|
121
|
+
const value = typeof input.ref === "string" && input.ref.startsWith(UNRESOLVED_REFERENCE_MARKER)
|
|
122
|
+
? { __rawFilterReference: input.ref.slice(UNRESOLVED_REFERENCE_MARKER.length) }
|
|
123
|
+
: typeof input.ref === "string"
|
|
124
|
+
? { __rawFilterReference: input.ref }
|
|
125
|
+
: refDataToFilterReference(input.ref.__data);
|
|
126
|
+
return { type: "REFERENCE", realType: input.valueType, value, ...(input.multiple === true && { multiple: true }) };
|
|
127
|
+
}
|
|
128
|
+
if (isRef(input)) {
|
|
129
|
+
if (input.__data.kind === "static")
|
|
130
|
+
return toFilterValue(input.__data.value, valueType);
|
|
131
|
+
return { type: "REFERENCE", realType: valueType, value: refDataToFilterReference(input.__data) };
|
|
132
|
+
}
|
|
133
|
+
if (isCatalogField(input) || isAppField(input))
|
|
134
|
+
return { type: "FIELD", value: fieldWireValue(input) };
|
|
135
|
+
if (input === null)
|
|
136
|
+
return { type: "NULL" };
|
|
137
|
+
if (typeof input === "number")
|
|
138
|
+
return { type: "NUMBER", value: input };
|
|
139
|
+
if (typeof input === "boolean")
|
|
140
|
+
return { type: "BOOLEAN", value: input };
|
|
141
|
+
if (typeof input === "string") {
|
|
142
|
+
if (valueType === "UUID")
|
|
143
|
+
return { type: "UUID", value: input };
|
|
144
|
+
if (valueType === "DATE")
|
|
145
|
+
return { type: "DATE", value: input };
|
|
146
|
+
if (valueType === "DATETIME")
|
|
147
|
+
return { type: "DATETIME", value: input };
|
|
148
|
+
return { type: "TEXT", value: input };
|
|
149
|
+
}
|
|
150
|
+
throw new EdkValidationError("Unsupported filter value");
|
|
151
|
+
}
|
|
152
|
+
function values(left, inputs, fallback, explicit) {
|
|
153
|
+
const type = leftType(left, fallback, explicit);
|
|
154
|
+
return inputs.map((input) => toFilterValue(resolveStaticFieldValue(left, input), type));
|
|
155
|
+
}
|
|
156
|
+
export function eq(left, input, explicit) {
|
|
157
|
+
const type = leftType(left, "TEXT", explicit);
|
|
158
|
+
return { type: "EQUALS", ...leftDescriptor(left, "TEXT", explicit), value: toFilterValue(resolveStaticFieldValue(left, input), type) };
|
|
159
|
+
}
|
|
160
|
+
export function neq(left, input, explicit) { return { ...eq(left, input, explicit), not: true }; }
|
|
161
|
+
export function gt(left, input, explicit) {
|
|
162
|
+
const type = leftType(left, "NUMBER", explicit);
|
|
163
|
+
return { type: "GREATER_THAN", ...leftDescriptor(left, "NUMBER", explicit), value: toFilterValue(resolveStaticFieldValue(left, input), type) };
|
|
164
|
+
}
|
|
165
|
+
export function gte(left, input, explicit) {
|
|
166
|
+
const type = leftType(left, "NUMBER", explicit);
|
|
167
|
+
return { type: "GREATER_THAN_EQUALS", ...leftDescriptor(left, "NUMBER", explicit), value: toFilterValue(resolveStaticFieldValue(left, input), type) };
|
|
168
|
+
}
|
|
169
|
+
export function lt(left, input, explicit) {
|
|
170
|
+
const type = leftType(left, "NUMBER", explicit);
|
|
171
|
+
return { type: "LESS_THAN", ...leftDescriptor(left, "NUMBER", explicit), value: toFilterValue(resolveStaticFieldValue(left, input), type) };
|
|
172
|
+
}
|
|
173
|
+
export function lte(left, input, explicit) {
|
|
174
|
+
const type = leftType(left, "NUMBER", explicit);
|
|
175
|
+
return { type: "LESS_THAN_EQUALS", ...leftDescriptor(left, "NUMBER", explicit), value: toFilterValue(resolveStaticFieldValue(left, input), type) };
|
|
176
|
+
}
|
|
177
|
+
export function like(left, input, options, explicit) {
|
|
178
|
+
const type = leftType(left, "TEXT", explicit);
|
|
179
|
+
return { type: "LIKE", ...leftDescriptor(left, "TEXT", explicit), value: toFilterValue(resolveStaticFieldValue(left, input), type), ...(options?.not === true && { not: true }), ...(options?.caseInsensitive !== undefined && { caseInsensitive: options.caseInsensitive }), ...(options?.mode !== undefined && { mode: options.mode.toUpperCase() }) };
|
|
180
|
+
}
|
|
181
|
+
export function isNull(left, options, explicit) {
|
|
182
|
+
return { type: "IS_NULL", ...leftDescriptor(left, "TEXT", explicit), ...(options?.not === true && { not: true }) };
|
|
183
|
+
}
|
|
184
|
+
export function isNotNull(left, explicit) { return isNull(left, { not: true }, explicit); }
|
|
185
|
+
export function isIn(left, input, explicit) {
|
|
186
|
+
return { type: "IN", ...leftDescriptor(left, "TEXT", explicit), values: values(left, input, "TEXT", explicit) };
|
|
187
|
+
}
|
|
188
|
+
export function isNotIn(left, input, explicit) { return { ...isIn(left, input, explicit), not: true }; }
|
|
189
|
+
export function between(left, min, max, options, explicit) {
|
|
190
|
+
const [minimum, maximum] = values(left, [min, max], "NUMBER", explicit);
|
|
191
|
+
return { type: "BETWEEN", ...leftDescriptor(left, "NUMBER", explicit), min: minimum, max: maximum, ...(options?.not === true && { not: true }) };
|
|
192
|
+
}
|
|
193
|
+
export function currentRange(left, options, explicit) {
|
|
194
|
+
return { type: "CURRENT_RANGE", ...leftDescriptor(left, "DATETIME", explicit), unit: options.unit, semantic: options.semantic ?? false, ...(options.isoWeek !== undefined && { isoWeek: options.isoWeek }) };
|
|
195
|
+
}
|
|
196
|
+
export function consecutiveRange(left, options, explicit) {
|
|
197
|
+
return { type: "CONSECUTIVE_RANGE", ...leftDescriptor(left, "DATETIME", explicit), unit: options.unit, count: options.count, offset: options.offset, semantic: options.semantic ?? false, ...(options.isoWeek !== undefined && { isoWeek: options.isoWeek }) };
|
|
198
|
+
}
|
|
199
|
+
export function contains(left, input, options, explicit) {
|
|
200
|
+
const items = Array.isArray(input) ? input : [input];
|
|
201
|
+
return { type: "CONTAINS", ...leftDescriptor(left, "TEXT", explicit), values: values(left, items, "TEXT", explicit), ...(options?.not === true && { not: true }) };
|
|
202
|
+
}
|
|
203
|
+
export function overlaps(left, input, options, explicit) {
|
|
204
|
+
const items = Array.isArray(input) ? input : [input];
|
|
205
|
+
return { type: "OVERLAPS", ...leftDescriptor(left, "TEXT", explicit), values: values(left, items, "TEXT", explicit), ...(options?.not === true && { not: true }) };
|
|
206
|
+
}
|
|
207
|
+
export function and(...children) { return { type: "AND", children }; }
|
|
208
|
+
export function or(...children) { return { type: "OR", children }; }
|
|
209
|
+
export function whereTrue() { return { type: "TRUE" }; }
|
|
210
|
+
export function whereFalse() { return { type: "FALSE" }; }
|
|
211
|
+
export function withOptions(value, options) {
|
|
212
|
+
if (value.type === "AND" || value.type === "OR" || value.type === "TRUE" || value.type === "FALSE") {
|
|
213
|
+
throw new EdkValidationError("Filter field options require a field-backed filter");
|
|
214
|
+
}
|
|
348
215
|
return {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
216
|
+
...value,
|
|
217
|
+
...(options.aspect !== undefined && { aspect: fieldWireValue(options.aspect) }),
|
|
218
|
+
...(options.semantic !== undefined && { semantic: options.semantic }),
|
|
352
219
|
};
|
|
353
220
|
}
|
|
354
|
-
// ---------------------------------------------------------------------------
|
|
355
|
-
// Composite filter helpers
|
|
356
|
-
// ---------------------------------------------------------------------------
|
|
357
|
-
/** AND — all children must match. */
|
|
358
|
-
export function and(...children) {
|
|
359
|
-
return { type: "AND", children };
|
|
360
|
-
}
|
|
361
|
-
/** OR — any child must match. */
|
|
362
|
-
export function or(...children) {
|
|
363
|
-
return { type: "OR", children };
|
|
364
|
-
}
|
|
365
|
-
/** TRUE — matches every row. Mostly used to preserve pulled platform filters. */
|
|
366
|
-
export function trueFilter() {
|
|
367
|
-
return { type: "TRUE" };
|
|
368
|
-
}
|
|
369
|
-
/** FALSE — matches no rows. Mostly used to preserve pulled platform filters. */
|
|
370
|
-
export function falseFilter() {
|
|
371
|
-
return { type: "FALSE" };
|
|
372
|
-
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Filter } from "./types.js";
|
|
2
|
+
export interface FilterPrintCodec<Field, ReferenceValue> {
|
|
3
|
+
readonly field: (field: Field) => string;
|
|
4
|
+
readonly aspect?: (aspect: Field) => string;
|
|
5
|
+
readonly reference: (reference: ReferenceValue) => string;
|
|
6
|
+
readonly quote?: (value: string) => string;
|
|
7
|
+
readonly namespace?: string;
|
|
8
|
+
readonly used?: (helper: string) => void;
|
|
9
|
+
}
|
|
10
|
+
/** Print every canonical filter through the same public `filter.*` authoring surface. */
|
|
11
|
+
export declare function printFilter<Field, ReferenceValue>(filter: Filter<Field, ReferenceValue>, codec: FilterPrintCodec<Field, ReferenceValue>): string;
|