@elementumai/edk 0.0.0-oidc-bootstrap → 0.8.1
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 +462 -3
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.d.ts +188 -0
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.js +20 -0
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent.d.ts +245 -0
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent.js +30 -0
- package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.d.ts +18 -0
- package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.js +8 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.d.ts +718 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.js +52 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.d.ts +23 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.js +1 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.d.ts +148 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.js +12 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/format.d.ts +63 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/format.js +17 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/index.d.ts +39 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/index.js +35 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.d.ts +116 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.js +11 -0
- package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +178 -0
- package/dist-sdk/elementum-entity-client/clients/automation/models/automation.js +18 -0
- package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.d.ts +200 -0
- package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.js +1 -0
- package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.d.ts +1 -0
- package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.js +1 -0
- package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.d.ts +141 -0
- package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.js +22 -0
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +123 -0
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.js +14 -0
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +78 -0
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +23 -0
- package/dist-sdk/elementum-entity-client/clients/tables/models/index.d.ts +1 -0
- package/dist-sdk/elementum-entity-client/clients/tables/models/index.js +1 -0
- package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.d.ts +265 -0
- package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.js +15 -0
- package/dist-sdk/elementum-entity-client/errors.d.ts +90 -0
- package/dist-sdk/elementum-entity-client/errors.js +111 -0
- package/dist-sdk/elementum-entity-client/models/connection.d.ts +30 -0
- package/dist-sdk/elementum-entity-client/models/connection.js +16 -0
- package/dist-sdk/elementum-entity-client/types.d.ts +71 -0
- package/dist-sdk/elementum-entity-client/types.js +1 -0
- package/dist-sdk/fs/entity.d.ts +104 -0
- package/dist-sdk/fs/entity.js +52 -0
- package/dist-sdk/pull/util.d.ts +130 -0
- package/dist-sdk/pull/util.js +204 -0
- package/dist-sdk/src/catalog/ai-provider-models.d.ts +30 -0
- package/dist-sdk/src/catalog/ai-provider-models.js +63 -0
- package/dist-sdk/src/catalog/factories.d.ts +242 -0
- package/dist-sdk/src/catalog/factories.js +265 -0
- package/dist-sdk/src/catalog/from-authoring.d.ts +103 -0
- package/dist-sdk/src/catalog/from-authoring.js +467 -0
- package/dist-sdk/src/catalog/index.d.ts +12 -0
- package/dist-sdk/src/catalog/index.js +12 -0
- package/dist-sdk/src/catalog/org.d.ts +11 -0
- package/dist-sdk/src/catalog/org.js +288 -0
- package/dist-sdk/src/catalog/render-helpers.d.ts +35 -0
- package/dist-sdk/src/catalog/render-helpers.js +82 -0
- package/dist-sdk/src/catalog/render.d.ts +48 -0
- package/dist-sdk/src/catalog/render.js +193 -0
- package/dist-sdk/src/catalog/token.d.ts +10 -0
- package/dist-sdk/src/catalog/token.js +76 -0
- package/dist-sdk/src/catalog/types.d.ts +215 -0
- package/dist-sdk/src/catalog/types.js +86 -0
- package/dist-sdk/src/catalog/write.d.ts +43 -0
- package/dist-sdk/src/catalog/write.js +109 -0
- package/dist-sdk/src/core/app-to-ui.d.ts +22 -0
- package/dist-sdk/src/core/app-to-ui.js +75 -0
- package/dist-sdk/src/core/index.d.ts +10 -0
- package/dist-sdk/src/core/index.js +9 -0
- package/dist-sdk/src/core/system-fields.d.ts +95 -0
- package/dist-sdk/src/core/system-fields.js +153 -0
- package/dist-sdk/src/core/triggers/on-demand.d.ts +144 -0
- package/dist-sdk/src/core/triggers/on-demand.js +112 -0
- package/dist-sdk/src/core/types/ai-provider.d.ts +23 -0
- package/dist-sdk/src/core/types/ai-provider.js +8 -0
- package/dist-sdk/src/core/types/app.d.ts +857 -0
- package/dist-sdk/src/core/types/app.js +210 -0
- package/dist-sdk/src/core/types/aspect-category.d.ts +35 -0
- package/dist-sdk/src/core/types/aspect-category.js +33 -0
- package/dist-sdk/src/core/types/cloud-link.d.ts +34 -0
- package/dist-sdk/src/core/types/cloud-link.js +32 -0
- package/dist-sdk/src/core/types/display-block.d.ts +149 -0
- package/dist-sdk/src/core/types/display-block.js +61 -0
- package/dist-sdk/src/core/types/group.d.ts +13 -0
- package/dist-sdk/src/core/types/group.js +6 -0
- package/dist-sdk/src/core/types/platform.d.ts +2 -0
- package/dist-sdk/src/core/types/platform.js +1 -0
- package/dist-sdk/src/core/types/user.d.ts +20 -0
- package/dist-sdk/src/core/types/user.js +8 -0
- package/dist-sdk/src/core/wire/ref-serializer.d.ts +45 -0
- package/dist-sdk/src/core/wire/ref-serializer.js +89 -0
- package/dist-sdk/src/engine/build/context.d.ts +67 -0
- package/dist-sdk/src/engine/build/context.js +6 -0
- package/dist-sdk/src/engine/build/source-context.d.ts +45 -0
- package/dist-sdk/src/engine/build/source-context.js +23 -0
- package/dist-sdk/src/engine/entity.d.ts +44 -0
- package/dist-sdk/src/engine/entity.js +15 -0
- package/dist-sdk/src/engine/pull/context.d.ts +38 -0
- package/dist-sdk/src/engine/pull/context.js +44 -0
- package/dist-sdk/src/engine/pull/org.d.ts +54 -0
- package/dist-sdk/src/engine/pull/org.js +134 -0
- package/dist-sdk/src/engine/tf/escape.d.ts +22 -0
- package/dist-sdk/src/engine/tf/escape.js +28 -0
- package/dist-sdk/src/engine/tf/expr.d.ts +25 -0
- package/dist-sdk/src/engine/tf/expr.js +405 -0
- package/dist-sdk/src/engine/tf/index.d.ts +12 -0
- package/dist-sdk/src/engine/tf/index.js +11 -0
- package/dist-sdk/src/engine/tf/labels.d.ts +76 -0
- package/dist-sdk/src/engine/tf/labels.js +196 -0
- package/dist-sdk/src/engine/tf/model.d.ts +84 -0
- package/dist-sdk/src/engine/tf/model.js +49 -0
- package/dist-sdk/src/engine/tf/parse.d.ts +41 -0
- package/dist-sdk/src/engine/tf/parse.js +189 -0
- package/dist-sdk/src/engine/tf/render.d.ts +13 -0
- package/dist-sdk/src/engine/tf/render.js +102 -0
- package/dist-sdk/src/engine/workspace/authoring-layout.d.ts +43 -0
- package/dist-sdk/src/engine/workspace/authoring-layout.js +201 -0
- package/dist-sdk/src/entities/access-policy/build.d.ts +26 -0
- package/dist-sdk/src/entities/access-policy/build.js +7 -0
- package/dist-sdk/src/entities/access-policy/filter.d.ts +61 -0
- package/dist-sdk/src/entities/access-policy/filter.js +83 -0
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +48 -0
- package/dist-sdk/src/entities/access-policy/from-tf.js +189 -0
- package/dist-sdk/src/entities/access-policy/module.d.ts +3 -0
- package/dist-sdk/src/entities/access-policy/module.js +17 -0
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +36 -0
- package/dist-sdk/src/entities/access-policy/to-tf.js +149 -0
- package/dist-sdk/src/entities/access-policy/types.d.ts +4 -0
- package/dist-sdk/src/entities/access-policy/types.js +10 -0
- package/dist-sdk/src/entities/agent/build.d.ts +108 -0
- package/dist-sdk/src/entities/agent/build.js +148 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +53 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +344 -0
- package/dist-sdk/src/entities/agent/from-tf.d.ts +65 -0
- package/dist-sdk/src/entities/agent/from-tf.js +289 -0
- package/dist-sdk/src/entities/agent/index.d.ts +7 -0
- package/dist-sdk/src/entities/agent/index.js +7 -0
- package/dist-sdk/src/entities/agent/module.d.ts +4 -0
- package/dist-sdk/src/entities/agent/module.js +122 -0
- package/dist-sdk/src/entities/agent/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/agent/to-tf.js +188 -0
- package/dist-sdk/src/entities/agent/tools.d.ts +284 -0
- package/dist-sdk/src/entities/agent/tools.js +238 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +110 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.js +265 -0
- package/dist-sdk/src/entities/agent-tool/module.d.ts +3 -0
- package/dist-sdk/src/entities/agent-tool/module.js +32 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +40 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.js +250 -0
- package/dist-sdk/src/entities/agent-tool/types.d.ts +43 -0
- package/dist-sdk/src/entities/agent-tool/types.js +102 -0
- package/dist-sdk/src/entities/app/build.d.ts +368 -0
- package/dist-sdk/src/entities/app/build.js +372 -0
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +168 -0
- package/dist-sdk/src/entities/app/deserializer/normalize.js +12 -0
- package/dist-sdk/src/entities/app/display-blocks.d.ts +26 -0
- package/dist-sdk/src/entities/app/display-blocks.js +34 -0
- package/dist-sdk/src/entities/app/from-tf.d.ts +23 -0
- package/dist-sdk/src/entities/app/from-tf.js +197 -0
- package/dist-sdk/src/entities/app/index.d.ts +14 -0
- package/dist-sdk/src/entities/app/index.js +11 -0
- package/dist-sdk/src/entities/app/locals.d.ts +11 -0
- package/dist-sdk/src/entities/app/locals.js +31 -0
- package/dist-sdk/src/entities/app/module.d.ts +4 -0
- package/dist-sdk/src/entities/app/module.js +66 -0
- package/dist-sdk/src/entities/app/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/app/to-tf.js +212 -0
- package/dist-sdk/src/entities/approval-chain/build.d.ts +24 -0
- package/dist-sdk/src/entities/approval-chain/build.js +56 -0
- package/dist-sdk/src/entities/approval-chain/index.d.ts +6 -0
- package/dist-sdk/src/entities/approval-chain/index.js +6 -0
- package/dist-sdk/src/entities/approval-chain/steps.d.ts +24 -0
- package/dist-sdk/src/entities/approval-chain/steps.js +20 -0
- package/dist-sdk/src/entities/automation/build.d.ts +259 -0
- package/dist-sdk/src/entities/automation/build.js +436 -0
- package/dist-sdk/src/entities/automation/catalog-render.d.ts +5 -0
- package/dist-sdk/src/entities/automation/catalog-render.js +35 -0
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +152 -0
- package/dist-sdk/src/entities/automation/deserializer/ast.js +13 -0
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +55 -0
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +1176 -0
- package/dist-sdk/src/entities/automation/filter.d.ts +93 -0
- package/dist-sdk/src/entities/automation/filter.js +156 -0
- package/dist-sdk/src/entities/automation/from-tf.d.ts +35 -0
- package/dist-sdk/src/entities/automation/from-tf.js +1258 -0
- package/dist-sdk/src/entities/automation/index.d.ts +22 -0
- package/dist-sdk/src/entities/automation/index.js +25 -0
- package/dist-sdk/src/entities/automation/module.d.ts +3 -0
- package/dist-sdk/src/entities/automation/module.js +150 -0
- package/dist-sdk/src/entities/automation/operators.d.ts +93 -0
- package/dist-sdk/src/entities/automation/operators.js +69 -0
- package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +19 -0
- package/dist-sdk/src/entities/automation/output-key-wire-name.js +24 -0
- package/dist-sdk/src/entities/automation/script-code.d.ts +51 -0
- package/dist-sdk/src/entities/automation/script-code.js +633 -0
- package/dist-sdk/src/entities/automation/serialize.d.ts +6 -0
- package/dist-sdk/src/entities/automation/serialize.js +41 -0
- package/dist-sdk/src/entities/automation/tasks.d.ts +641 -0
- package/dist-sdk/src/entities/automation/tasks.js +765 -0
- package/dist-sdk/src/entities/automation/to-tf.d.ts +19 -0
- package/dist-sdk/src/entities/automation/to-tf.js +1169 -0
- package/dist-sdk/src/entities/automation/triggers.d.ts +205 -0
- package/dist-sdk/src/entities/automation/triggers.js +202 -0
- package/dist-sdk/src/entities/automation/types.d.ts +78 -0
- package/dist-sdk/src/entities/automation/types.js +131 -0
- package/dist-sdk/src/entities/element/build.d.ts +121 -0
- package/dist-sdk/src/entities/element/build.js +110 -0
- package/dist-sdk/src/entities/element/from-tf.d.ts +19 -0
- package/dist-sdk/src/entities/element/from-tf.js +170 -0
- package/dist-sdk/src/entities/element/index.d.ts +12 -0
- package/dist-sdk/src/entities/element/index.js +10 -0
- package/dist-sdk/src/entities/element/locals.d.ts +7 -0
- package/dist-sdk/src/entities/element/locals.js +12 -0
- package/dist-sdk/src/entities/element/module.d.ts +8 -0
- package/dist-sdk/src/entities/element/module.js +65 -0
- package/dist-sdk/src/entities/element/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/element/to-tf.js +169 -0
- package/dist-sdk/src/entities/field/build.d.ts +112 -0
- package/dist-sdk/src/entities/field/build.js +84 -0
- package/dist-sdk/src/entities/field/calc/aggregate.d.ts +60 -0
- package/dist-sdk/src/entities/field/calc/aggregate.js +71 -0
- package/dist-sdk/src/entities/field/calc/date.d.ts +73 -0
- package/dist-sdk/src/entities/field/calc/date.js +109 -0
- package/dist-sdk/src/entities/field/calc/index.d.ts +229 -0
- package/dist-sdk/src/entities/field/calc/index.js +433 -0
- package/dist-sdk/src/entities/field/calc/numeric.d.ts +22 -0
- package/dist-sdk/src/entities/field/calc/numeric.js +67 -0
- package/dist-sdk/src/entities/field/calc/runtime.d.ts +61 -0
- package/dist-sdk/src/entities/field/calc/runtime.js +174 -0
- package/dist-sdk/src/entities/field/calc/text.d.ts +100 -0
- package/dist-sdk/src/entities/field/calc/text.js +208 -0
- package/dist-sdk/src/entities/field/calc/types.d.ts +86 -0
- package/dist-sdk/src/entities/field/calc/types.js +23 -0
- package/dist-sdk/src/entities/field/calc.d.ts +108 -0
- package/dist-sdk/src/entities/field/calc.js +54 -0
- package/dist-sdk/src/entities/field/from-tf.d.ts +31 -0
- package/dist-sdk/src/entities/field/from-tf.js +184 -0
- package/dist-sdk/src/entities/field/locals.d.ts +8 -0
- package/dist-sdk/src/entities/field/locals.js +24 -0
- package/dist-sdk/src/entities/field/module.d.ts +3 -0
- package/dist-sdk/src/entities/field/module.js +50 -0
- package/dist-sdk/src/entities/field/options.d.ts +27 -0
- package/dist-sdk/src/entities/field/options.js +76 -0
- package/dist-sdk/src/entities/field/record-shape.d.ts +57 -0
- package/dist-sdk/src/entities/field/record-shape.js +1 -0
- package/dist-sdk/src/entities/field/to-tf.d.ts +73 -0
- package/dist-sdk/src/entities/field/to-tf.js +142 -0
- package/dist-sdk/src/entities/field/types.d.ts +53 -0
- package/dist-sdk/src/entities/field/types.js +68 -0
- package/dist-sdk/src/entities/file-reader/build.d.ts +182 -0
- package/dist-sdk/src/entities/file-reader/build.js +105 -0
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.d.ts +6 -0
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +109 -0
- package/dist-sdk/src/entities/file-reader/from-tf.d.ts +13 -0
- package/dist-sdk/src/entities/file-reader/from-tf.js +172 -0
- package/dist-sdk/src/entities/file-reader/index.d.ts +10 -0
- package/dist-sdk/src/entities/file-reader/index.js +10 -0
- package/dist-sdk/src/entities/file-reader/module.d.ts +3 -0
- package/dist-sdk/src/entities/file-reader/module.js +115 -0
- package/dist-sdk/src/entities/file-reader/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/file-reader/to-tf.js +84 -0
- package/dist-sdk/src/entities/file-reader/types.d.ts +32 -0
- package/dist-sdk/src/entities/file-reader/types.js +30 -0
- package/dist-sdk/src/entities/flow/activities/agent.d.ts +15 -0
- package/dist-sdk/src/entities/flow/activities/agent.js +29 -0
- package/dist-sdk/src/entities/flow/activities/approval.d.ts +9 -0
- package/dist-sdk/src/entities/flow/activities/approval.js +18 -0
- package/dist-sdk/src/entities/flow/activities/automation.d.ts +12 -0
- package/dist-sdk/src/entities/flow/activities/automation.js +22 -0
- package/dist-sdk/src/entities/flow/activities/ctx.d.ts +34 -0
- package/dist-sdk/src/entities/flow/activities/ctx.js +38 -0
- package/dist-sdk/src/entities/flow/activities/form.d.ts +22 -0
- package/dist-sdk/src/entities/flow/activities/form.js +36 -0
- package/dist-sdk/src/entities/flow/activities/index.d.ts +14 -0
- package/dist-sdk/src/entities/flow/activities/index.js +13 -0
- package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +39 -0
- package/dist-sdk/src/entities/flow/activities/input-refs.js +19 -0
- package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +13 -0
- package/dist-sdk/src/entities/flow/activities/prompt-template.js +34 -0
- package/dist-sdk/src/entities/flow/activities/render-catalog.d.ts +140 -0
- package/dist-sdk/src/entities/flow/activities/render-catalog.js +174 -0
- package/dist-sdk/src/entities/flow/activities/types.d.ts +33 -0
- package/dist-sdk/src/entities/flow/activities/types.js +1 -0
- package/dist-sdk/src/entities/flow/build.d.ts +38 -0
- package/dist-sdk/src/entities/flow/build.js +115 -0
- package/dist-sdk/src/entities/flow/index.d.ts +8 -0
- package/dist-sdk/src/entities/flow/index.js +7 -0
- package/dist-sdk/src/entities/flow/serialize.d.ts +51 -0
- package/dist-sdk/src/entities/flow/serialize.js +94 -0
- package/dist-sdk/src/entities/flow/util.d.ts +27 -0
- package/dist-sdk/src/entities/flow/util.js +38 -0
- package/dist-sdk/src/entities/org/ai-provider.d.ts +13 -0
- package/dist-sdk/src/entities/org/ai-provider.js +46 -0
- package/dist-sdk/src/entities/org/category.d.ts +5 -0
- package/dist-sdk/src/entities/org/category.js +33 -0
- package/dist-sdk/src/entities/org/cloud-link.d.ts +5 -0
- package/dist-sdk/src/entities/org/cloud-link.js +33 -0
- package/dist-sdk/src/entities/org/connector.d.ts +12 -0
- package/dist-sdk/src/entities/org/connector.js +35 -0
- package/dist-sdk/src/entities/org/group.d.ts +5 -0
- package/dist-sdk/src/entities/org/group.js +40 -0
- package/dist-sdk/src/entities/org/index.d.ts +11 -0
- package/dist-sdk/src/entities/org/index.js +11 -0
- package/dist-sdk/src/entities/org/role.d.ts +7 -0
- package/dist-sdk/src/entities/org/role.js +21 -0
- package/dist-sdk/src/entities/org/user.d.ts +7 -0
- package/dist-sdk/src/entities/org/user.js +30 -0
- package/dist-sdk/src/entities/search-table/build.d.ts +41 -0
- package/dist-sdk/src/entities/search-table/build.js +79 -0
- package/dist-sdk/src/entities/search-table/index.d.ts +5 -0
- package/dist-sdk/src/entities/search-table/index.js +5 -0
- package/dist-sdk/src/entities/search-table/module.d.ts +6 -0
- package/dist-sdk/src/entities/search-table/module.js +64 -0
- package/dist-sdk/src/entities/shared/context.d.ts +93 -0
- package/dist-sdk/src/entities/shared/context.js +156 -0
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +277 -0
- package/dist-sdk/src/entities/shared/filters/ast.js +65 -0
- package/dist-sdk/src/entities/shared/filters/index.d.ts +211 -0
- package/dist-sdk/src/entities/shared/filters/index.js +372 -0
- package/dist-sdk/src/entities/shared/filters/types.d.ts +170 -0
- package/dist-sdk/src/entities/shared/filters/types.js +7 -0
- package/dist-sdk/src/entities/shared/ref.d.ts +160 -0
- package/dist-sdk/src/entities/shared/ref.js +119 -0
- package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +17 -0
- package/dist-sdk/src/entities/shared/tool-field-ref.js +31 -0
- package/dist-sdk/src/entities/shared/types/common.d.ts +106 -0
- package/dist-sdk/src/entities/shared/types/common.js +64 -0
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +58 -0
- package/dist-sdk/src/entities/shared/types/field-types.js +57 -0
- package/dist-sdk/src/entities/shared/types/platform.d.ts +46 -0
- package/dist-sdk/src/entities/shared/types/platform.js +10 -0
- package/dist-sdk/src/entities/skill/build.d.ts +25 -0
- package/dist-sdk/src/entities/skill/build.js +50 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +39 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +124 -0
- package/dist-sdk/src/entities/skill/from-tf.d.ts +33 -0
- package/dist-sdk/src/entities/skill/from-tf.js +96 -0
- package/dist-sdk/src/entities/skill/index.d.ts +7 -0
- package/dist-sdk/src/entities/skill/index.js +7 -0
- package/dist-sdk/src/entities/skill/module.d.ts +4 -0
- package/dist-sdk/src/entities/skill/module.js +111 -0
- package/dist-sdk/src/entities/skill/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/skill/to-tf.js +59 -0
- package/dist-sdk/src/entities/skill/tools.d.ts +93 -0
- package/dist-sdk/src/entities/skill/tools.js +105 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +60 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.js +142 -0
- package/dist-sdk/src/entities/skill-tool/module.d.ts +3 -0
- package/dist-sdk/src/entities/skill-tool/module.js +21 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +34 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.js +130 -0
- package/dist-sdk/src/entities/skill-tool/types.d.ts +40 -0
- package/dist-sdk/src/entities/skill-tool/types.js +67 -0
- package/dist-sdk/src/entities/table/build.d.ts +74 -0
- package/dist-sdk/src/entities/table/build.js +339 -0
- package/dist-sdk/src/entities/table/catalog-render.d.ts +5 -0
- package/dist-sdk/src/entities/table/catalog-render.js +39 -0
- package/dist-sdk/src/entities/table/fields.d.ts +81 -0
- package/dist-sdk/src/entities/table/fields.js +70 -0
- package/dist-sdk/src/entities/table/filter.d.ts +41 -0
- package/dist-sdk/src/entities/table/filter.js +89 -0
- package/dist-sdk/src/entities/table/index.d.ts +8 -0
- package/dist-sdk/src/entities/table/index.js +12 -0
- package/dist-sdk/src/entities/table/joins.d.ts +26 -0
- package/dist-sdk/src/entities/table/joins.js +31 -0
- package/dist-sdk/src/entities/table/keys.d.ts +11 -0
- package/dist-sdk/src/entities/table/keys.js +25 -0
- package/dist-sdk/src/entities/table/module.d.ts +5 -0
- package/dist-sdk/src/entities/table/module.js +25 -0
- package/dist-sdk/src/entities/table/state.d.ts +39 -0
- package/dist-sdk/src/entities/table/state.js +43 -0
- package/dist-sdk/src/entities/view/from-tf.d.ts +29 -0
- package/dist-sdk/src/entities/view/from-tf.js +235 -0
- package/dist-sdk/src/entities/view/module.d.ts +24 -0
- package/dist-sdk/src/entities/view/module.js +61 -0
- package/dist-sdk/src/entities/view/to-tf.d.ts +65 -0
- package/dist-sdk/src/entities/view/to-tf.js +171 -0
- package/dist-sdk/src/entities/view/types.d.ts +58 -0
- package/dist-sdk/src/entities/view/types.js +89 -0
- package/dist-sdk/src/graph/deferred-catalog-render.d.ts +9 -0
- package/dist-sdk/src/graph/deferred-catalog-render.js +18 -0
- package/dist-sdk/src/graph/index.d.ts +91 -0
- package/dist-sdk/src/graph/index.js +211 -0
- package/dist-sdk/src/graph/modules.d.ts +7 -0
- package/dist-sdk/src/graph/modules.js +42 -0
- package/dist-sdk/src/graph/types.d.ts +375 -0
- package/dist-sdk/src/graph/types.js +102 -0
- package/dist-sdk/src/internal/sdk-package.d.ts +7 -0
- package/dist-sdk/src/internal/sdk-package.js +23 -0
- package/package.json +201 -8
|
@@ -0,0 +1,372 @@
|
|
|
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";
|
|
34
|
+
import { picklistStaticValueToApiId } from "../../../core/types/app.js";
|
|
35
|
+
import { EdkValidationError } from "../../../../elementum-entity-client/errors.js";
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
// AppField → field ID + value type resolution
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
export function fieldTypeToValueType(type) {
|
|
40
|
+
switch (type) {
|
|
41
|
+
case "TEXT":
|
|
42
|
+
case "HTML":
|
|
43
|
+
case "RICH_TEXT":
|
|
44
|
+
case "PICKLIST": return "TEXT";
|
|
45
|
+
case "NUMBER":
|
|
46
|
+
case "DECIMAL": return "NUMBER";
|
|
47
|
+
case "BOOLEAN": return "BOOLEAN";
|
|
48
|
+
case "DATE": return "DATE";
|
|
49
|
+
case "DATETIME": return "DATETIME";
|
|
50
|
+
case "ASPECT_ID":
|
|
51
|
+
case "ASPECT_RECORD":
|
|
52
|
+
case "ASPECT_RECORD_ID":
|
|
53
|
+
case "ASPECT_FIELD_ID": return "UUID";
|
|
54
|
+
default: return "TEXT";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
// typed() helper — wraps a Ref with an explicit ValueType
|
|
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));
|
|
172
|
+
}
|
|
173
|
+
// ---------------------------------------------------------------------------
|
|
174
|
+
// Single-value filter helpers (ValueFilter subtypes)
|
|
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 } : {}) };
|
|
179
|
+
}
|
|
180
|
+
/** NOT EQUALS shorthand. Requires a row-scoped field. */
|
|
181
|
+
export function neq(field, value) {
|
|
182
|
+
return eq(field, value, { not: true });
|
|
183
|
+
}
|
|
184
|
+
/** GREATER_THAN filter. Requires a row-scoped field. */
|
|
185
|
+
export function gt(field, value) {
|
|
186
|
+
return { type: "GREATER_THAN", field: field.id, value: toFilterValue(resolveValue(field, value)) };
|
|
187
|
+
}
|
|
188
|
+
/** GREATER_THAN_EQUALS filter. Requires a row-scoped field. */
|
|
189
|
+
export function gte(field, value) {
|
|
190
|
+
return { type: "GREATER_THAN_EQUALS", field: field.id, value: toFilterValue(resolveValue(field, value)) };
|
|
191
|
+
}
|
|
192
|
+
/** LESS_THAN filter. Requires a row-scoped field. */
|
|
193
|
+
export function lt(field, value) {
|
|
194
|
+
return { type: "LESS_THAN", field: field.id, value: toFilterValue(resolveValue(field, value)) };
|
|
195
|
+
}
|
|
196
|
+
/** LESS_THAN_EQUALS filter. Requires a row-scoped field. */
|
|
197
|
+
export function lte(field, value) {
|
|
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
|
+
};
|
|
210
|
+
}
|
|
211
|
+
// ---------------------------------------------------------------------------
|
|
212
|
+
// Multi-value filter helpers (MultiValueFilter subtypes)
|
|
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
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/** BETWEEN filter — field is between two values (inclusive). Requires a row-scoped field. */
|
|
224
|
+
export function between(field, low, high) {
|
|
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
|
+
};
|
|
244
|
+
}
|
|
245
|
+
/** CONTAINS filter — array field contains all of the provided values. Requires a row-scoped field. */
|
|
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);
|
|
298
|
+
return {
|
|
299
|
+
type: "LIKE",
|
|
300
|
+
leftValue,
|
|
301
|
+
value: toFilterValue(value),
|
|
302
|
+
...(options?.not ? { not: true } : {}),
|
|
303
|
+
...(options?.caseInsensitive ? { caseInsensitive: true } : {}),
|
|
304
|
+
...(options?.mode ? { mode: options.mode } : {}),
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* BETWEEN filter using a Ref as the left-hand side (inclusive).
|
|
309
|
+
* Bare Refs for `low`/`high` are auto-typed to match the left (default `"NUMBER"`).
|
|
310
|
+
*/
|
|
311
|
+
export function refBetween(left, low, high, options, leftType = "NUMBER") {
|
|
312
|
+
const leftValue = toRefFilterValue(left, leftType);
|
|
313
|
+
return {
|
|
314
|
+
type: "BETWEEN",
|
|
315
|
+
leftValue,
|
|
316
|
+
values: [toFilterValue(resolveRefInput(low, leftType)), toFilterValue(resolveRefInput(high, leftType))],
|
|
317
|
+
...(options?.not ? { not: true } : {}),
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* CONTAINS filter using a Ref as the left-hand side (array field contains all
|
|
322
|
+
* of the provided values). Bare Refs in `values` are auto-typed to match the
|
|
323
|
+
* left (default `"TEXT"`).
|
|
324
|
+
*/
|
|
325
|
+
export function refContains(left, values, leftType = "TEXT") {
|
|
326
|
+
const leftValue = toRefFilterValue(left, leftType);
|
|
327
|
+
return { type: "CONTAINS", leftValue, values: toFilterValues(resolveRefInputs(values, leftType)) };
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* OVERLAPS filter using a Ref as the left-hand side (array field overlaps
|
|
331
|
+
* with any of the provided values). Bare Refs in `values` are auto-typed to
|
|
332
|
+
* match the left (default `"TEXT"`).
|
|
333
|
+
*/
|
|
334
|
+
export function refOverlaps(left, values, leftType = "TEXT") {
|
|
335
|
+
const leftValue = toRefFilterValue(left, leftType);
|
|
336
|
+
return { type: "OVERLAPS", leftValue, values: toFilterValues(resolveRefInputs(values, leftType)) };
|
|
337
|
+
}
|
|
338
|
+
/** IS_NULL filter using a Ref as the left-hand side. */
|
|
339
|
+
export function refIsNull(left, options, leftType = "TEXT") {
|
|
340
|
+
const leftValue = toRefFilterValue(left, leftType);
|
|
341
|
+
return { type: "IS_NULL", leftValue, ...(options?.not ? { not: true } : {}) };
|
|
342
|
+
}
|
|
343
|
+
/** IS NOT NULL shorthand (ref-LHS). */
|
|
344
|
+
export function refIsNotNull(left, leftType = "TEXT") {
|
|
345
|
+
return refIsNull(left, { not: true }, leftType);
|
|
346
|
+
}
|
|
347
|
+
function toRefFilterValue(ref, valueType) {
|
|
348
|
+
return {
|
|
349
|
+
type: "REFERENCE",
|
|
350
|
+
realType: valueType,
|
|
351
|
+
value: refDataToFilterReference(ref.__data),
|
|
352
|
+
};
|
|
353
|
+
}
|
|
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,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filter types — mirrors the Java Filter hierarchy in
|
|
3
|
+
* jarvis/util/.../filter/*.java
|
|
4
|
+
*
|
|
5
|
+
* Discriminated on `type` with values matching Java FilterType names.
|
|
6
|
+
*/
|
|
7
|
+
export type ValueType = "BOOLEAN" | "CURRENT_USER" | "DATE" | "DATETIME" | "FIELD" | "NULL" | "NUMBER" | "RECORD_FIELD" | "REFERENCE" | "TEXT" | "UUID";
|
|
8
|
+
export type FilterReference = {
|
|
9
|
+
type: "TRIGGER";
|
|
10
|
+
name: string;
|
|
11
|
+
} | {
|
|
12
|
+
type: "TASK";
|
|
13
|
+
taskId: string;
|
|
14
|
+
name: string;
|
|
15
|
+
} | {
|
|
16
|
+
type: "TASK";
|
|
17
|
+
taskRefKey: string;
|
|
18
|
+
name: string;
|
|
19
|
+
} | {
|
|
20
|
+
type: "FOR_EACH";
|
|
21
|
+
forEachTaskId: string;
|
|
22
|
+
name: string;
|
|
23
|
+
} | {
|
|
24
|
+
type: "FOR_EACH";
|
|
25
|
+
forEachTaskRefKey: string;
|
|
26
|
+
name: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: "VALUE";
|
|
29
|
+
value: unknown;
|
|
30
|
+
} | {
|
|
31
|
+
type: "VARIABLE";
|
|
32
|
+
variableId: string;
|
|
33
|
+
name: string;
|
|
34
|
+
};
|
|
35
|
+
export type FilterValue = {
|
|
36
|
+
type: "TEXT";
|
|
37
|
+
value: string;
|
|
38
|
+
} | {
|
|
39
|
+
type: "NUMBER";
|
|
40
|
+
value: number;
|
|
41
|
+
} | {
|
|
42
|
+
type: "BOOLEAN";
|
|
43
|
+
value: boolean;
|
|
44
|
+
} | {
|
|
45
|
+
type: "UUID";
|
|
46
|
+
value: string;
|
|
47
|
+
} | {
|
|
48
|
+
type: "DATE";
|
|
49
|
+
value: string;
|
|
50
|
+
} | {
|
|
51
|
+
type: "DATETIME";
|
|
52
|
+
value: string;
|
|
53
|
+
} | {
|
|
54
|
+
type: "FIELD";
|
|
55
|
+
value: string;
|
|
56
|
+
treatNullAsEquals?: boolean;
|
|
57
|
+
} | {
|
|
58
|
+
type: "NULL";
|
|
59
|
+
} | {
|
|
60
|
+
type: "CURRENT_USER";
|
|
61
|
+
} | {
|
|
62
|
+
type: "REFERENCE";
|
|
63
|
+
realType: ValueType;
|
|
64
|
+
value: FilterReference;
|
|
65
|
+
};
|
|
66
|
+
export type LikeMode = "starts_with" | "ends_with" | "contains" | "legacy";
|
|
67
|
+
export interface EqualsFilter {
|
|
68
|
+
type: "EQUALS";
|
|
69
|
+
field?: string;
|
|
70
|
+
leftValue?: FilterValue;
|
|
71
|
+
value: FilterValue;
|
|
72
|
+
not?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface GreaterThanFilter {
|
|
75
|
+
type: "GREATER_THAN";
|
|
76
|
+
field?: string;
|
|
77
|
+
leftValue?: FilterValue;
|
|
78
|
+
value: FilterValue;
|
|
79
|
+
}
|
|
80
|
+
export interface GreaterThanEqualsFilter {
|
|
81
|
+
type: "GREATER_THAN_EQUALS";
|
|
82
|
+
field?: string;
|
|
83
|
+
leftValue?: FilterValue;
|
|
84
|
+
value: FilterValue;
|
|
85
|
+
}
|
|
86
|
+
export interface LessThanFilter {
|
|
87
|
+
type: "LESS_THAN";
|
|
88
|
+
field?: string;
|
|
89
|
+
leftValue?: FilterValue;
|
|
90
|
+
value: FilterValue;
|
|
91
|
+
}
|
|
92
|
+
export interface LessThanEqualsFilter {
|
|
93
|
+
type: "LESS_THAN_EQUALS";
|
|
94
|
+
field?: string;
|
|
95
|
+
leftValue?: FilterValue;
|
|
96
|
+
value: FilterValue;
|
|
97
|
+
}
|
|
98
|
+
export interface LikeFilter {
|
|
99
|
+
type: "LIKE";
|
|
100
|
+
field?: string;
|
|
101
|
+
leftValue?: FilterValue;
|
|
102
|
+
value: FilterValue;
|
|
103
|
+
not?: boolean;
|
|
104
|
+
caseInsensitive?: boolean;
|
|
105
|
+
mode?: LikeMode;
|
|
106
|
+
}
|
|
107
|
+
export interface InFilter {
|
|
108
|
+
type: "IN";
|
|
109
|
+
field?: string;
|
|
110
|
+
leftValue?: FilterValue;
|
|
111
|
+
values: FilterValue[];
|
|
112
|
+
not?: boolean;
|
|
113
|
+
}
|
|
114
|
+
export interface BetweenFilter {
|
|
115
|
+
type: "BETWEEN";
|
|
116
|
+
field?: string;
|
|
117
|
+
leftValue?: FilterValue;
|
|
118
|
+
values: [FilterValue, FilterValue];
|
|
119
|
+
not?: boolean;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Field falls within a relative calendar range: `count` `unit`s, shifted
|
|
123
|
+
* `offset` `unit`s back from now. `semantic` selects whether the range
|
|
124
|
+
* snaps to calendar-unit boundaries (`true`) or is a rolling window
|
|
125
|
+
* measured from the current moment (`false`). `unit` is a
|
|
126
|
+
* platform-defined calendar unit string (observed: `"QUARTER"`) — not a
|
|
127
|
+
* closed set here since the full enum isn't confirmed.
|
|
128
|
+
*/
|
|
129
|
+
export interface ConsecutiveRangeFilter {
|
|
130
|
+
type: "CONSECUTIVE_RANGE";
|
|
131
|
+
field?: string;
|
|
132
|
+
leftValue?: FilterValue;
|
|
133
|
+
unit: string;
|
|
134
|
+
count: number;
|
|
135
|
+
offset: number;
|
|
136
|
+
semantic: boolean;
|
|
137
|
+
}
|
|
138
|
+
export interface ContainsFilter {
|
|
139
|
+
type: "CONTAINS";
|
|
140
|
+
field?: string;
|
|
141
|
+
leftValue?: FilterValue;
|
|
142
|
+
values: FilterValue[];
|
|
143
|
+
}
|
|
144
|
+
export interface OverlapsFilter {
|
|
145
|
+
type: "OVERLAPS";
|
|
146
|
+
field?: string;
|
|
147
|
+
leftValue?: FilterValue;
|
|
148
|
+
values: FilterValue[];
|
|
149
|
+
}
|
|
150
|
+
export interface IsNullFilter {
|
|
151
|
+
type: "IS_NULL";
|
|
152
|
+
field?: string;
|
|
153
|
+
leftValue?: FilterValue;
|
|
154
|
+
not?: boolean;
|
|
155
|
+
}
|
|
156
|
+
export interface AndFilter {
|
|
157
|
+
type: "AND";
|
|
158
|
+
children: FilterExpr[];
|
|
159
|
+
}
|
|
160
|
+
export interface OrFilter {
|
|
161
|
+
type: "OR";
|
|
162
|
+
children: FilterExpr[];
|
|
163
|
+
}
|
|
164
|
+
export interface TrueFilter {
|
|
165
|
+
type: "TRUE";
|
|
166
|
+
}
|
|
167
|
+
export interface FalseFilter {
|
|
168
|
+
type: "FALSE";
|
|
169
|
+
}
|
|
170
|
+
export type FilterExpr = EqualsFilter | GreaterThanFilter | GreaterThanEqualsFilter | LessThanFilter | LessThanEqualsFilter | LikeFilter | InFilter | BetweenFilter | ConsecutiveRangeFilter | ContainsFilter | OverlapsFilter | IsNullFilter | AndFilter | OrFilter | TrueFilter | FalseFilter;
|