@elementumai/edk 0.0.0-oidc-bootstrap → 0.8.0-preview.11
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 +408 -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/factories.d.ts +189 -0
- package/dist-sdk/src/catalog/factories.js +202 -0
- package/dist-sdk/src/catalog/from-authoring.d.ts +103 -0
- package/dist-sdk/src/catalog/from-authoring.js +462 -0
- package/dist-sdk/src/catalog/index.d.ts +11 -0
- package/dist-sdk/src/catalog/index.js +11 -0
- package/dist-sdk/src/catalog/org.d.ts +11 -0
- package/dist-sdk/src/catalog/org.js +211 -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 +36 -0
- package/dist-sdk/src/catalog/render.js +176 -0
- package/dist-sdk/src/catalog/token.d.ts +10 -0
- package/dist-sdk/src/catalog/token.js +62 -0
- package/dist-sdk/src/catalog/types.d.ts +158 -0
- package/dist-sdk/src/catalog/types.js +83 -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 +93 -0
- package/dist-sdk/src/core/system-fields.js +151 -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 +36 -0
- package/dist-sdk/src/core/types/ai-provider.js +32 -0
- package/dist-sdk/src/core/types/app.d.ts +838 -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 +49 -0
- package/dist-sdk/src/engine/build/context.js +6 -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 +23 -0
- package/dist-sdk/src/engine/pull/context.js +44 -0
- package/dist-sdk/src/engine/pull/org.d.ts +44 -0
- package/dist-sdk/src/engine/pull/org.js +104 -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 +31 -0
- package/dist-sdk/src/engine/tf/labels.js +125 -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/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 +18 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +177 -0
- package/dist-sdk/src/entities/agent/from-tf.d.ts +50 -0
- package/dist-sdk/src/entities/agent/from-tf.js +169 -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 +116 -0
- package/dist-sdk/src/entities/agent/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/agent/to-tf.js +136 -0
- package/dist-sdk/src/entities/agent/tools.d.ts +205 -0
- package/dist-sdk/src/entities/agent/tools.js +199 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +63 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.js +169 -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 +38 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.js +164 -0
- package/dist-sdk/src/entities/agent-tool/types.d.ts +42 -0
- package/dist-sdk/src/entities/agent-tool/types.js +70 -0
- package/dist-sdk/src/entities/app/build.d.ts +318 -0
- package/dist-sdk/src/entities/app/build.js +325 -0
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +165 -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 +180 -0
- package/dist-sdk/src/entities/app/index.d.ts +11 -0
- package/dist-sdk/src/entities/app/index.js +10 -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 +59 -0
- package/dist-sdk/src/entities/app/to-tf.d.ts +28 -0
- package/dist-sdk/src/entities/app/to-tf.js +183 -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 +215 -0
- package/dist-sdk/src/entities/automation/build.js +424 -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 +135 -0
- package/dist-sdk/src/entities/automation/deserializer/ast.js +13 -0
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +40 -0
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +1040 -0
- package/dist-sdk/src/entities/automation/filter.d.ts +81 -0
- package/dist-sdk/src/entities/automation/filter.js +146 -0
- package/dist-sdk/src/entities/automation/from-tf.d.ts +36 -0
- package/dist-sdk/src/entities/automation/from-tf.js +252 -0
- package/dist-sdk/src/entities/automation/index.d.ts +18 -0
- package/dist-sdk/src/entities/automation/index.js +21 -0
- package/dist-sdk/src/entities/automation/module.d.ts +3 -0
- package/dist-sdk/src/entities/automation/module.js +153 -0
- package/dist-sdk/src/entities/automation/operators.d.ts +66 -0
- package/dist-sdk/src/entities/automation/operators.js +43 -0
- package/dist-sdk/src/entities/automation/script-code.d.ts +62 -0
- package/dist-sdk/src/entities/automation/script-code.js +366 -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 +535 -0
- package/dist-sdk/src/entities/automation/tasks.js +697 -0
- package/dist-sdk/src/entities/automation/to-tf.d.ts +38 -0
- package/dist-sdk/src/entities/automation/to-tf.js +266 -0
- package/dist-sdk/src/entities/automation/triggers.d.ts +197 -0
- package/dist-sdk/src/entities/automation/triggers.js +202 -0
- package/dist-sdk/src/entities/automation/types.d.ts +53 -0
- package/dist-sdk/src/entities/automation/types.js +101 -0
- package/dist-sdk/src/entities/automation/value-ref-tf.d.ts +76 -0
- package/dist-sdk/src/entities/automation/value-ref-tf.js +190 -0
- package/dist-sdk/src/entities/element/build.d.ts +108 -0
- package/dist-sdk/src/entities/element/build.js +109 -0
- package/dist-sdk/src/entities/element/from-tf.d.ts +19 -0
- package/dist-sdk/src/entities/element/from-tf.js +155 -0
- package/dist-sdk/src/entities/element/index.d.ts +9 -0
- package/dist-sdk/src/entities/element/index.js +9 -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 +63 -0
- package/dist-sdk/src/entities/element/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/element/to-tf.js +151 -0
- package/dist-sdk/src/entities/field/build.d.ts +69 -0
- package/dist-sdk/src/entities/field/build.js +74 -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 +170 -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 +29 -0
- package/dist-sdk/src/entities/field/from-tf.js +73 -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 +49 -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 +55 -0
- package/dist-sdk/src/entities/field/to-tf.js +97 -0
- package/dist-sdk/src/entities/field/types.d.ts +27 -0
- package/dist-sdk/src/entities/field/types.js +46 -0
- package/dist-sdk/src/entities/file-reader/build.d.ts +124 -0
- package/dist-sdk/src/entities/file-reader/build.js +105 -0
- package/dist-sdk/src/entities/file-reader/index.d.ts +5 -0
- package/dist-sdk/src/entities/file-reader/index.js +5 -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/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 +5 -0
- package/dist-sdk/src/entities/org/connector.js +37 -0
- package/dist-sdk/src/entities/org/group.d.ts +5 -0
- package/dist-sdk/src/entities/org/group.js +31 -0
- package/dist-sdk/src/entities/org/index.d.ts +10 -0
- package/dist-sdk/src/entities/org/index.js +10 -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 +21 -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 +242 -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/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 +49 -0
- package/dist-sdk/src/entities/shared/types/field-types.js +48 -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 +20 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +96 -0
- package/dist-sdk/src/entities/skill/from-tf.d.ts +33 -0
- package/dist-sdk/src/entities/skill/from-tf.js +95 -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 +106 -0
- package/dist-sdk/src/entities/skill/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/skill/to-tf.js +58 -0
- package/dist-sdk/src/entities/skill/tools.d.ts +71 -0
- package/dist-sdk/src/entities/skill/tools.js +88 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +47 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.js +121 -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 +32 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.js +107 -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 +25 -0
- package/dist-sdk/src/entities/view/from-tf.js +233 -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 +63 -0
- package/dist-sdk/src/entities/view/to-tf.js +156 -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 +14 -0
- package/dist-sdk/src/graph/deferred-catalog-render.js +37 -0
- package/dist-sdk/src/graph/index.d.ts +83 -0
- package/dist-sdk/src/graph/index.js +207 -0
- package/dist-sdk/src/graph/modules.d.ts +7 -0
- package/dist-sdk/src/graph/modules.js +37 -0
- package/dist-sdk/src/graph/types.d.ts +301 -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 +173 -8
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type system for the calculated-field DSL.
|
|
3
|
+
*
|
|
4
|
+
* Every node the `calc.*` builder produces is an `Expr<T>` — a
|
|
5
|
+
* `CalculationExpression` (the brand `CalculatedAppField.expression`
|
|
6
|
+
* accepts) augmented with a phantom `__exprType` literal carrying the
|
|
7
|
+
* type the expression evaluates to. The phantom drives compile-time
|
|
8
|
+
* argument checking for operators, comparisons, sub-selects, and
|
|
9
|
+
* `if`/`coalesce` shape rules — bad types fail `tsc --noEmit` before
|
|
10
|
+
* the agent ever calls `.deploy()`.
|
|
11
|
+
*
|
|
12
|
+
* `ExprLike<T>` is the argument-position union: every builder accepts
|
|
13
|
+
* either an `Expr<T>`, a typed `AppField` whose type maps to `T`, or
|
|
14
|
+
* (for the primitive types) a raw TS literal. Coercion happens inside
|
|
15
|
+
* the builder via `coerce()` in `runtime.ts`.
|
|
16
|
+
*
|
|
17
|
+
* The 12 `ExprType` brands track the GraphQL `AspectFieldType` enum
|
|
18
|
+
* plus `decimal` (split from `number`) and `uuid` (the `UUID()`
|
|
19
|
+
* built-in's return type — used in tier 2). `text` collapses
|
|
20
|
+
* HTML/RICH_TEXT/HANDLE since they're indistinguishable inside an
|
|
21
|
+
* expression.
|
|
22
|
+
*/
|
|
23
|
+
import type { AppField, AttachmentAppField, BooleanAppField, CalculationExpression, DateAppField, DateTimeAppField, DecimalAppField, FieldScope, GroupAppField, HandleAppField, HtmlAppField, JsonAppField, MultiPicklistAppField, NumberAppField, PicklistAppField, TextAppField, UserAppField } from "../../../core/types/app.js";
|
|
24
|
+
/**
|
|
25
|
+
* The brands an expression can carry. Mirrors `AspectFieldType` plus
|
|
26
|
+
* `decimal` (split from `number` because `/` promotes — see the Java
|
|
27
|
+
* test's `Quantity / Threshold → DECIMAL` case) and `uuid` (the
|
|
28
|
+
* built-in `UUID()` function's return type).
|
|
29
|
+
*/
|
|
30
|
+
export type ExprType = "number" | "decimal" | "text" | "bool" | "date" | "datetime" | "picklist" | "user" | "group" | "attachment" | "json" | "uuid";
|
|
31
|
+
/**
|
|
32
|
+
* One node in the calc AST. Extends the `CalculationExpression` brand
|
|
33
|
+
* so an `Expr<T>` is assignable directly to a `CalculatedAppField`'s
|
|
34
|
+
* `expression` slot. The `__exprType` phantom carries the output type
|
|
35
|
+
* the operator/function declared.
|
|
36
|
+
*/
|
|
37
|
+
export interface Expr<T extends ExprType> extends CalculationExpression {
|
|
38
|
+
readonly __exprType: T;
|
|
39
|
+
}
|
|
40
|
+
/** Number or decimal. Numeric operators accept either. */
|
|
41
|
+
export type NumericExpr = Expr<"number"> | Expr<"decimal">;
|
|
42
|
+
/**
|
|
43
|
+
* The types `gt`/`lt`/`gte`/`lte` accept. Booleans, picklists, user/
|
|
44
|
+
* group/attachment ids, JSON, and UUIDs are not orderable in the calc
|
|
45
|
+
* language. `eq` and `ne` widen to any `ExprType` (handled separately).
|
|
46
|
+
*/
|
|
47
|
+
export type ComparableExprType = "number" | "decimal" | "text" | "date" | "datetime";
|
|
48
|
+
/**
|
|
49
|
+
* Map an `ExprType` to the `AppField` variant(s) whose value is
|
|
50
|
+
* assignable as that expression type. Used by `ExprLike<T>` to accept
|
|
51
|
+
* field handles in argument position.
|
|
52
|
+
*
|
|
53
|
+
* Picklist/user/group/attachment fields surface here as their **id**
|
|
54
|
+
* brand — text projections require an explicit `calc.label(...)` /
|
|
55
|
+
* `calc.email(...)` / `calc.name(...)` call. This is the
|
|
56
|
+
* hallucination-control choice: a bare field reference doesn't quietly
|
|
57
|
+
* coerce to the server's implicit default sub-select; the author has
|
|
58
|
+
* to declare which projection they want.
|
|
59
|
+
*/
|
|
60
|
+
export type AppFieldOfExprType<T extends ExprType, Scope extends FieldScope = FieldScope> = T extends "number" ? NumberAppField<Scope> : T extends "decimal" ? DecimalAppField<Scope> : T extends "text" ? TextAppField<Scope> | HandleAppField<Scope> | HtmlAppField<Scope> : T extends "bool" ? BooleanAppField<Scope> : T extends "date" ? DateAppField<Scope> : T extends "datetime" ? DateTimeAppField<Scope> : T extends "picklist" ? PicklistAppField<Scope> | MultiPicklistAppField<Scope> : T extends "user" ? UserAppField<Scope> : T extends "group" ? GroupAppField<Scope> : T extends "attachment" ? AttachmentAppField<Scope> : T extends "json" ? JsonAppField<Scope> : never;
|
|
61
|
+
/**
|
|
62
|
+
* Raw TS literals that coerce into the matching `Expr<T>`. Limited to
|
|
63
|
+
* the primitive types — `date`, `datetime`, and the reference types
|
|
64
|
+
* (picklist/user/group/attachment) require explicit builders so
|
|
65
|
+
* intent is unambiguous. A bare `number` literal coerces to
|
|
66
|
+
* `Expr<"number"> | Expr<"decimal">` (the builder picks based on
|
|
67
|
+
* Number.isInteger at runtime); functions that need a specific
|
|
68
|
+
* sub-type use the explicit `calc.num` / `calc.dec` literals.
|
|
69
|
+
*/
|
|
70
|
+
export type LiteralOfExprType<T extends ExprType> = T extends "number" ? number : T extends "decimal" ? number : T extends "text" ? string : T extends "bool" ? boolean : never;
|
|
71
|
+
/**
|
|
72
|
+
* Argument-position union — every `calc.*` builder accepts these
|
|
73
|
+
* shapes interchangeably. Coercion to `Expr<T>` happens at runtime
|
|
74
|
+
* inside the builder.
|
|
75
|
+
*/
|
|
76
|
+
export type ExprLike<T extends ExprType> = Expr<T> | AppFieldOfExprType<T> | LiteralOfExprType<T>;
|
|
77
|
+
/** Convenience: anything that can be passed where a numeric expr is required. */
|
|
78
|
+
export type NumericLike = ExprLike<"number"> | ExprLike<"decimal">;
|
|
79
|
+
/** Convenience: anything that can be passed where a boolean expr is required. */
|
|
80
|
+
export type BoolLike = ExprLike<"bool">;
|
|
81
|
+
/**
|
|
82
|
+
* Compile-time helper: narrow an `AppField` to its `ExprType` brand.
|
|
83
|
+
* Used internally by `coerce()` so the runtime branch picks the right
|
|
84
|
+
* factory based on the field's `type` discriminator.
|
|
85
|
+
*/
|
|
86
|
+
export type AppFieldExprType<F extends AppField<FieldScope>> = F extends NumberAppField<FieldScope> ? "number" : F extends DecimalAppField<FieldScope> ? "decimal" : F extends TextAppField<FieldScope> | HandleAppField<FieldScope> | HtmlAppField<FieldScope> ? "text" : F extends BooleanAppField<FieldScope> ? "bool" : F extends DateAppField<FieldScope> ? "date" : F extends DateTimeAppField<FieldScope> ? "datetime" : F extends PicklistAppField<FieldScope> | MultiPicklistAppField<FieldScope> ? "picklist" : F extends UserAppField<FieldScope> ? "user" : F extends GroupAppField<FieldScope> ? "group" : F extends AttachmentAppField<FieldScope> ? "attachment" : F extends JsonAppField<FieldScope> ? "json" : never;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type system for the calculated-field DSL.
|
|
3
|
+
*
|
|
4
|
+
* Every node the `calc.*` builder produces is an `Expr<T>` — a
|
|
5
|
+
* `CalculationExpression` (the brand `CalculatedAppField.expression`
|
|
6
|
+
* accepts) augmented with a phantom `__exprType` literal carrying the
|
|
7
|
+
* type the expression evaluates to. The phantom drives compile-time
|
|
8
|
+
* argument checking for operators, comparisons, sub-selects, and
|
|
9
|
+
* `if`/`coalesce` shape rules — bad types fail `tsc --noEmit` before
|
|
10
|
+
* the agent ever calls `.deploy()`.
|
|
11
|
+
*
|
|
12
|
+
* `ExprLike<T>` is the argument-position union: every builder accepts
|
|
13
|
+
* either an `Expr<T>`, a typed `AppField` whose type maps to `T`, or
|
|
14
|
+
* (for the primitive types) a raw TS literal. Coercion happens inside
|
|
15
|
+
* the builder via `coerce()` in `runtime.ts`.
|
|
16
|
+
*
|
|
17
|
+
* The 12 `ExprType` brands track the GraphQL `AspectFieldType` enum
|
|
18
|
+
* plus `decimal` (split from `number`) and `uuid` (the `UUID()`
|
|
19
|
+
* built-in's return type — used in tier 2). `text` collapses
|
|
20
|
+
* HTML/RICH_TEXT/HANDLE since they're indistinguishable inside an
|
|
21
|
+
* expression.
|
|
22
|
+
*/
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { Expr, ExprType } from "./calc/types.js";
|
|
2
|
+
import type { FieldRef } from "../../catalog/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Reference an app field inside a calc expression (e.g. `calc.gt(calc.field(
|
|
5
|
+
* app.fields.quantity), calc.num(0))`). Emits the field name — the platform
|
|
6
|
+
* resolves calc field refs by name on compose.
|
|
7
|
+
*
|
|
8
|
+
* The expr type defaults to the one implied by the field's `fieldType`, but is
|
|
9
|
+
* generic so it composes with strictly-typed operators when annotated
|
|
10
|
+
* (`calc.field<"number">(ref)`) — TS can't infer the literal type from the
|
|
11
|
+
* runtime `fieldType`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function field<T extends ExprType = ExprType>(ref: FieldRef): Expr<T>;
|
|
14
|
+
/** v2 calc namespace — v1's grammar plus `field()` for v2 field references. */
|
|
15
|
+
export declare const calc: {
|
|
16
|
+
field: typeof field;
|
|
17
|
+
num: (value: number) => Expr<"number">;
|
|
18
|
+
dec: (value: number) => Expr<"decimal">;
|
|
19
|
+
text: (value: string) => Expr<"text">;
|
|
20
|
+
bool: (value: boolean) => Expr<"bool">;
|
|
21
|
+
blank: <T extends ExprType>() => Expr<T>;
|
|
22
|
+
plus: {
|
|
23
|
+
(a: import("./calc/types.js").NumericLike, b: import("./calc/types.js").NumericLike): import("./calc/types.js").NumericExpr;
|
|
24
|
+
(a: import("./calc/types.js").ExprLike<"date">, b: import("./calc/types.js").NumericLike): Expr<"date">;
|
|
25
|
+
(a: import("./calc/types.js").ExprLike<"datetime">, b: import("./calc/types.js").NumericLike): Expr<"datetime">;
|
|
26
|
+
};
|
|
27
|
+
minus: {
|
|
28
|
+
(a: import("./calc/types.js").NumericLike, b: import("./calc/types.js").NumericLike): import("./calc/types.js").NumericExpr;
|
|
29
|
+
(a: import("./calc/types.js").ExprLike<"date">, b: import("./calc/types.js").NumericLike): Expr<"date">;
|
|
30
|
+
(a: import("./calc/types.js").ExprLike<"datetime">, b: import("./calc/types.js").NumericLike): Expr<"datetime">;
|
|
31
|
+
};
|
|
32
|
+
times: (a: import("./calc/types.js").NumericLike, b: import("./calc/types.js").NumericLike) => import("./calc/types.js").NumericExpr;
|
|
33
|
+
dividedBy: (a: import("./calc/types.js").NumericLike, b: import("./calc/types.js").NumericLike) => import("./calc/types.js").NumericExpr;
|
|
34
|
+
gt: <T extends import("./calc/types.js").ComparableExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>) => Expr<"bool">;
|
|
35
|
+
lt: <T extends import("./calc/types.js").ComparableExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>) => Expr<"bool">;
|
|
36
|
+
gte: <T extends import("./calc/types.js").ComparableExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>) => Expr<"bool">;
|
|
37
|
+
lte: <T extends import("./calc/types.js").ComparableExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>) => Expr<"bool">;
|
|
38
|
+
eq: <T extends ExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>) => Expr<"bool">;
|
|
39
|
+
ne: <T extends ExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>) => Expr<"bool">;
|
|
40
|
+
and: (a: import("./calc/types.js").BoolLike, b: import("./calc/types.js").BoolLike, ...rest: import("./calc/types.js").BoolLike[]) => Expr<"bool">;
|
|
41
|
+
or: (a: import("./calc/types.js").BoolLike, b: import("./calc/types.js").BoolLike, ...rest: import("./calc/types.js").BoolLike[]) => Expr<"bool">;
|
|
42
|
+
not: (value: import("./calc/types.js").BoolLike) => Expr<"bool">;
|
|
43
|
+
if: <T extends ExprType>(cond: import("./calc/types.js").BoolLike, thenArm: import("./calc/types.js").ExprLike<T>, elseArm: import("./calc/types.js").ExprLike<T>) => Expr<T>;
|
|
44
|
+
ifs: <T extends ExprType>(args_0: import("./calc/types.js").BoolLike, args_1: import("./calc/types.js").ExprLike<T>, ...args: (import("./calc/types.js").BoolLike | import("./calc/types.js").ExprLike<T>)[]) => Expr<T>;
|
|
45
|
+
coalesce: <T extends ExprType>(args_0: import("./calc/types.js").ExprLike<T>, args_1: import("./calc/types.js").ExprLike<T>, ...args: import("./calc/types.js").ExprLike<T>[]) => Expr<T>;
|
|
46
|
+
nullIf: <T extends ExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>) => Expr<T>;
|
|
47
|
+
isBlank: <T extends ExprType>(value: import("./calc/types.js").ExprLike<T>) => Expr<"bool">;
|
|
48
|
+
sum: (value: import("./calc/types.js").NumericLike) => import("./calc/types.js").NumericExpr;
|
|
49
|
+
count: <T extends ExprType>(value: import("./calc/types.js").ExprLike<T>) => Expr<"number">;
|
|
50
|
+
countUnique: <T extends ExprType>(value: import("./calc/types.js").ExprLike<T>) => Expr<"number">;
|
|
51
|
+
average: (value: import("./calc/types.js").NumericLike) => Expr<"decimal">;
|
|
52
|
+
stdev: (value: import("./calc/types.js").NumericLike) => Expr<"decimal">;
|
|
53
|
+
min: {
|
|
54
|
+
<T extends import("./calc/types.js").ComparableExprType>(value: import("./calc/types.js").ExprLike<T>): Expr<T>;
|
|
55
|
+
<T extends import("./calc/types.js").ComparableExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>, ...rest: import("./calc/types.js").ExprLike<T>[]): Expr<T>;
|
|
56
|
+
};
|
|
57
|
+
max: {
|
|
58
|
+
<T extends import("./calc/types.js").ComparableExprType>(value: import("./calc/types.js").ExprLike<T>): Expr<T>;
|
|
59
|
+
<T extends import("./calc/types.js").ComparableExprType>(a: import("./calc/types.js").ExprLike<T>, b: import("./calc/types.js").ExprLike<T>, ...rest: import("./calc/types.js").ExprLike<T>[]): Expr<T>;
|
|
60
|
+
};
|
|
61
|
+
concat: typeof import("./calc/text.js").concat;
|
|
62
|
+
toText: typeof import("./calc/text.js").toText;
|
|
63
|
+
len: typeof import("./calc/text.js").len;
|
|
64
|
+
trim: typeof import("./calc/text.js").trim;
|
|
65
|
+
upper: typeof import("./calc/text.js").upper;
|
|
66
|
+
lower: typeof import("./calc/text.js").lower;
|
|
67
|
+
left: typeof import("./calc/text.js").left;
|
|
68
|
+
right: typeof import("./calc/text.js").right;
|
|
69
|
+
mid: typeof import("./calc/text.js").mid;
|
|
70
|
+
substitute: typeof import("./calc/text.js").substitute;
|
|
71
|
+
find: typeof import("./calc/text.js").find;
|
|
72
|
+
search: typeof import("./calc/text.js").search;
|
|
73
|
+
splitText: typeof import("./calc/text.js").splitText;
|
|
74
|
+
regexMatch: typeof import("./calc/text.js").regexMatch;
|
|
75
|
+
regexReplace: typeof import("./calc/text.js").regexReplace;
|
|
76
|
+
regexExtract: typeof import("./calc/text.js").regexExtract;
|
|
77
|
+
jsonEscape: typeof import("./calc/text.js").jsonEscape;
|
|
78
|
+
jsonUnescape: typeof import("./calc/text.js").jsonUnescape;
|
|
79
|
+
round: typeof import("./calc/numeric.js").round;
|
|
80
|
+
power: typeof import("./calc/numeric.js").power;
|
|
81
|
+
sqrt: typeof import("./calc/numeric.js").sqrt;
|
|
82
|
+
mod: typeof import("./calc/numeric.js").mod;
|
|
83
|
+
abs: typeof import("./calc/numeric.js").abs;
|
|
84
|
+
toNumber: typeof import("./calc/numeric.js").toNumber;
|
|
85
|
+
uuid: typeof import("./calc/numeric.js").uuid;
|
|
86
|
+
now: typeof import("./calc/date.js").now;
|
|
87
|
+
today: typeof import("./calc/date.js").today;
|
|
88
|
+
makeDate: typeof import("./calc/date.js").makeDate;
|
|
89
|
+
dateValue: typeof import("./calc/date.js").dateValue;
|
|
90
|
+
dateDif: typeof import("./calc/date.js").dateDif;
|
|
91
|
+
dateTimeTrunc: typeof import("./calc/date.js").dateTimeTrunc;
|
|
92
|
+
weekday: typeof import("./calc/date.js").weekday;
|
|
93
|
+
year: typeof import("./calc/date.js").year;
|
|
94
|
+
month: typeof import("./calc/date.js").month;
|
|
95
|
+
day: typeof import("./calc/date.js").day;
|
|
96
|
+
hour: typeof import("./calc/date.js").hour;
|
|
97
|
+
minute: typeof import("./calc/date.js").minute;
|
|
98
|
+
second: typeof import("./calc/date.js").second;
|
|
99
|
+
countIf: typeof import("./calc/aggregate.js").countIf;
|
|
100
|
+
sumIf: typeof import("./calc/aggregate.js").sumIf;
|
|
101
|
+
stringAgg: typeof import("./calc/aggregate.js").stringAgg;
|
|
102
|
+
stringAggUnique: typeof import("./calc/aggregate.js").stringAggUnique;
|
|
103
|
+
label: (field: import("./calc/types.js").ExprLike<"picklist">) => Expr<"text">;
|
|
104
|
+
id: <T extends "picklist" | "user" | "group" | "attachment">(field: import("./calc/types.js").ExprLike<T>) => Expr<T>;
|
|
105
|
+
email: (field: import("./calc/types.js").ExprLike<"user">) => Expr<"text">;
|
|
106
|
+
name: (field: import("./calc/types.js").ExprLike<"group">) => Expr<"text">;
|
|
107
|
+
};
|
|
108
|
+
export type { Expr, ExprType } from "./calc/types.js";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 calculated-field expressions. Reuses v1's `calc.*` grammar wholesale (all
|
|
3
|
+
* operators/functions, correct wire emission) and adds {@link field} for v2
|
|
4
|
+
* field references.
|
|
5
|
+
*
|
|
6
|
+
* The v2 twist: v1 emits a referenced field as its **id** when known, else its
|
|
7
|
+
* **name** — and the platform resolves calc field refs by name on compose. v2
|
|
8
|
+
* has no ids at author time, so a field reference emits the field **name**
|
|
9
|
+
* (carried on the `FieldRef` token). That sidesteps the token-resolution problem
|
|
10
|
+
* entirely (the id is buried in the expression *string*, which `resolvePayload`
|
|
11
|
+
* can't reach) — no deploy-time rewrite needed.
|
|
12
|
+
*
|
|
13
|
+
* Lives under `entities/field/` because calculated is a field sub-type
|
|
14
|
+
* (authored through `defineApp` fields, hence re-exported from the `/app`
|
|
15
|
+
* subpath). The terraform path does not support calculated fields yet —
|
|
16
|
+
* `fieldToTf` degrades them with a diagnostic.
|
|
17
|
+
*/
|
|
18
|
+
import { calc as baseCalc } from "./calc/index.js";
|
|
19
|
+
import { makeExpr } from "./calc/runtime.js";
|
|
20
|
+
const FIELD_TYPE_TO_EXPR = {
|
|
21
|
+
TEXT: "text",
|
|
22
|
+
RICH_TEXT: "text",
|
|
23
|
+
HTML: "text",
|
|
24
|
+
NUMBER: "number",
|
|
25
|
+
DECIMAL: "decimal",
|
|
26
|
+
BOOLEAN: "bool",
|
|
27
|
+
DATE: "date",
|
|
28
|
+
DATETIME: "datetime",
|
|
29
|
+
PICKLIST: "picklist",
|
|
30
|
+
MULTI_PICKLIST: "picklist",
|
|
31
|
+
USER: "user",
|
|
32
|
+
USER_ID: "user",
|
|
33
|
+
GROUP: "group",
|
|
34
|
+
GROUP_ID: "group",
|
|
35
|
+
ATTACHMENT: "attachment",
|
|
36
|
+
ATTACHMENT_ID: "attachment",
|
|
37
|
+
JSON: "json",
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Reference an app field inside a calc expression (e.g. `calc.gt(calc.field(
|
|
41
|
+
* app.fields.quantity), calc.num(0))`). Emits the field name — the platform
|
|
42
|
+
* resolves calc field refs by name on compose.
|
|
43
|
+
*
|
|
44
|
+
* The expr type defaults to the one implied by the field's `fieldType`, but is
|
|
45
|
+
* generic so it composes with strictly-typed operators when annotated
|
|
46
|
+
* (`calc.field<"number">(ref)`) — TS can't infer the literal type from the
|
|
47
|
+
* runtime `fieldType`.
|
|
48
|
+
*/
|
|
49
|
+
export function field(ref) {
|
|
50
|
+
const exprType = (FIELD_TYPE_TO_EXPR[ref.fieldType] ?? "text");
|
|
51
|
+
return makeExpr(exprType, () => `"${ref.name.replace(/"/g, '""')}"`);
|
|
52
|
+
}
|
|
53
|
+
/** v2 calc namespace — v1's grammar plus `field()` for v2 field references. */
|
|
54
|
+
export const calc = { ...baseCalc, field };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field extraction: one `elementum_*_field` resource block → the
|
|
3
|
+
* `NormalizedField` entry the owner's printer consumes. The owning aspect's
|
|
4
|
+
* from-tf drives the pass and says who the owner is — this module never
|
|
5
|
+
* names the owner's resource type. Platform ids come only from the stream's
|
|
6
|
+
* import blocks and stay data-side.
|
|
7
|
+
*/
|
|
8
|
+
import { type FromTfContext } from "../../engine/pull/context.js";
|
|
9
|
+
import { type TfBlock, type TfValue } from "../../engine/tf/index.js";
|
|
10
|
+
import type { NormalizedField } from "../app/deserializer/normalize.js";
|
|
11
|
+
export interface FieldOwner {
|
|
12
|
+
/** The owner's resource type ("elementum_app") — what `object_id` must reference. */
|
|
13
|
+
readonly type: string;
|
|
14
|
+
/** The owner's tfLabel. */
|
|
15
|
+
readonly label: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* One field block → its normalized entry; undefined = skipped with a
|
|
19
|
+
* diagnostic (unknown resource type, or a field belonging to a different
|
|
20
|
+
* owner — a recursive stream carries discovered aspects' fields too).
|
|
21
|
+
*/
|
|
22
|
+
export declare function fieldFromTf(block: TfBlock, owner: FieldOwner, ctx: FromTfContext): NormalizedField | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* `<resourceType>.<tfLabel>.id` → the field's bag key — shared by anything
|
|
25
|
+
* that names a field by ref rather than owning it directly (agent-tool
|
|
26
|
+
* fields, view field_ids/columns). Undefined for any other shape or an
|
|
27
|
+
* unknown resource type.
|
|
28
|
+
*/
|
|
29
|
+
export declare function fieldKeyFromTfRef(v: TfValue): string | undefined;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field extraction: one `elementum_*_field` resource block → the
|
|
3
|
+
* `NormalizedField` entry the owner's printer consumes. The owning aspect's
|
|
4
|
+
* from-tf drives the pass and says who the owner is — this module never
|
|
5
|
+
* names the owner's resource type. Platform ids come only from the stream's
|
|
6
|
+
* import blocks and stay data-side.
|
|
7
|
+
*/
|
|
8
|
+
import { EntityTfError } from "../../engine/entity.js";
|
|
9
|
+
import { optionalString, resourceRefLabel } from "../../engine/pull/context.js";
|
|
10
|
+
import { isTfExpr, tfLabelToTsLabel } from "../../engine/tf/index.js";
|
|
11
|
+
import { optionsFromTf } from "./options.js";
|
|
12
|
+
import { KNOWN_FIELD_ATTRS, SUB_TYPE_BY_RESOURCE } from "./types.js";
|
|
13
|
+
/**
|
|
14
|
+
* One field block → its normalized entry; undefined = skipped with a
|
|
15
|
+
* diagnostic (unknown resource type, or a field belonging to a different
|
|
16
|
+
* owner — a recursive stream carries discovered aspects' fields too).
|
|
17
|
+
*/
|
|
18
|
+
export function fieldFromTf(block, owner, ctx) {
|
|
19
|
+
const subType = SUB_TYPE_BY_RESOURCE.get(block.type ?? "");
|
|
20
|
+
if (subType === undefined) {
|
|
21
|
+
ctx.diagnostics.push(`resource "${block.type}" is not a known field resource; skipped`);
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
const fieldLabel = block.label;
|
|
25
|
+
if (fieldLabel === undefined || fieldLabel === "") {
|
|
26
|
+
throw new EntityTfError(`${block.type} block is missing its label`);
|
|
27
|
+
}
|
|
28
|
+
const attrs = block.attrs;
|
|
29
|
+
const fieldName = optionalString(attrs, "name", `field "${fieldLabel}"`, ctx) ?? "";
|
|
30
|
+
const where = `field "${fieldName}" (${block.type}.${fieldLabel})`;
|
|
31
|
+
for (const key of Object.keys(attrs)) {
|
|
32
|
+
if (!KNOWN_FIELD_ATTRS.has(key)) {
|
|
33
|
+
ctx.diagnostics.push(`${where}: unhandled attribute "${key}" — the export dialect grew; extend fieldFromTf deliberately`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const objectLabel = resourceRefLabel(attrs["object_id"], owner.type);
|
|
37
|
+
if (objectLabel !== owner.label) {
|
|
38
|
+
ctx.diagnostics.push(`${where}: object_id does not reference ${owner.type}.${owner.label}; skipped`);
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
const options = subType.hasOptions === true ? optionsFromTf(attrs["options"], `${where} options`, ctx) : undefined;
|
|
42
|
+
return {
|
|
43
|
+
key: tfLabelToTsLabel(fieldLabel),
|
|
44
|
+
field: {
|
|
45
|
+
id: ctx.importId(`${block.type}.${fieldLabel}`) ?? "",
|
|
46
|
+
name: fieldName,
|
|
47
|
+
type: subType.authoringType,
|
|
48
|
+
// Only true flags are carried into authoring — false is the platform
|
|
49
|
+
// default and stays unwritten (build re-emits explicit false; ei's
|
|
50
|
+
// export does the same, so the build-vs-export sees both sides as false).
|
|
51
|
+
...(attrs["required"] === true && { required: true }),
|
|
52
|
+
...(attrs["required_on_close"] === true && { requiredOnClose: true }),
|
|
53
|
+
...(attrs["show_on_create"] === true && { showOnCreate: true }),
|
|
54
|
+
...(attrs["lock_on_create"] === true && { lockOnCreate: true }),
|
|
55
|
+
...(typeof attrs["description"] === "string" && { description: attrs["description"] }),
|
|
56
|
+
...(typeof attrs["column_name"] === "string" && { columnName: attrs["column_name"] }),
|
|
57
|
+
...(attrs["default_value"] !== undefined &&
|
|
58
|
+
!isTfExpr(attrs["default_value"]) && { defaultValue: attrs["default_value"] }),
|
|
59
|
+
...(options !== undefined && { options }),
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* `<resourceType>.<tfLabel>.id` → the field's bag key — shared by anything
|
|
65
|
+
* that names a field by ref rather than owning it directly (agent-tool
|
|
66
|
+
* fields, view field_ids/columns). Undefined for any other shape or an
|
|
67
|
+
* unknown resource type.
|
|
68
|
+
*/
|
|
69
|
+
export function fieldKeyFromTfRef(v) {
|
|
70
|
+
if (!isTfExpr(v) || v.$expr !== "resource-attr" || v.path.length !== 1 || v.path[0] !== "id")
|
|
71
|
+
return undefined;
|
|
72
|
+
return SUB_TYPE_BY_RESOURCE.has(v.type) ? tfLabelToTsLabel(v.label) : undefined;
|
|
73
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The field entity's locals.tf contribution, in ei's exact shape: one
|
|
3
|
+
* `<fieldLabel>_options_by_label` for-expression per option-carrying field
|
|
4
|
+
* resource (bare field label — ei does not namespace-prefix these).
|
|
5
|
+
*/
|
|
6
|
+
import { type TfValue } from "../../engine/tf/index.js";
|
|
7
|
+
/** Append one app's field-level lookup locals, keyed by the emitted field addresses. */
|
|
8
|
+
export declare function appendFieldLocals(attrs: Record<string, TfValue>, fieldAddresses: ReadonlyMap<string, string>): void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The field entity's locals.tf contribution, in ei's exact shape: one
|
|
3
|
+
* `<fieldLabel>_options_by_label` for-expression per option-carrying field
|
|
4
|
+
* resource (bare field label — ei does not namespace-prefix these).
|
|
5
|
+
*/
|
|
6
|
+
import { expr } from "../../engine/tf/index.js";
|
|
7
|
+
// Dropdown ONLY, deliberately: ei's GenerateLocals has a multiselect branch,
|
|
8
|
+
// but it matches import blocks against "elementum_multi_select_field" — the
|
|
9
|
+
// real resource type is elementum_multiselect_field, so that branch never
|
|
10
|
+
// fires and real exports carry option-lookup locals for dropdowns only. The
|
|
11
|
+
// dialect is ei's actual output, not its intent (integration-harness build-vs-export
|
|
12
|
+
// finding, 2026-07-23).
|
|
13
|
+
const OPTION_LOOKUP_FIELD_RESOURCE_TYPES = new Set(["elementum_dropdown_field"]);
|
|
14
|
+
/** Append one app's field-level lookup locals, keyed by the emitted field addresses. */
|
|
15
|
+
export function appendFieldLocals(attrs, fieldAddresses) {
|
|
16
|
+
for (const address of [...fieldAddresses.values()].sort()) {
|
|
17
|
+
const dot = address.indexOf(".");
|
|
18
|
+
const type = address.slice(0, dot);
|
|
19
|
+
const label = address.slice(dot + 1);
|
|
20
|
+
if (!OPTION_LOOKUP_FIELD_RESOURCE_TYPES.has(type))
|
|
21
|
+
continue;
|
|
22
|
+
attrs[`${label}_options_by_label`] = expr.forObject("opt", expr.resourceAttr(type, label, ["options"]), expr.scopedAttr("opt", ["label"]), expr.scopedAttr("opt", ["id"]));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** The field entity's registry entry (see src/graph/). */
|
|
2
|
+
import { rootParentFactoryEntry } from "../../catalog/render-helpers.js";
|
|
3
|
+
import { NO_DATA, NO_LIFECYCLE, } from "../../graph/types.js";
|
|
4
|
+
import { FIELD_SUB_TYPES } from "./types.js";
|
|
5
|
+
export const fieldModule = {
|
|
6
|
+
kind: "field",
|
|
7
|
+
stream: { role: "streamMember" },
|
|
8
|
+
authoring: { unit: "inline", bag: "fields" },
|
|
9
|
+
parents: [
|
|
10
|
+
{ parent: "app", child: "field" },
|
|
11
|
+
{ parent: "element", child: "field" },
|
|
12
|
+
],
|
|
13
|
+
resource: {
|
|
14
|
+
shape: "subTypes",
|
|
15
|
+
// All field rows round-trip today — no implemented? flag on FieldSubType.
|
|
16
|
+
rows: FIELD_SUB_TYPES.map((t) => ({
|
|
17
|
+
key: t.typeKey,
|
|
18
|
+
resourceType: t.resourceType,
|
|
19
|
+
implemented: true,
|
|
20
|
+
})),
|
|
21
|
+
},
|
|
22
|
+
data: NO_DATA,
|
|
23
|
+
lifecycle: NO_LIFECYCLE,
|
|
24
|
+
canvas: { participates: true, label: "Fields", glyph: "▾", component: "fieldCard" },
|
|
25
|
+
// Inline under app — from-authoring still reads fields from app.ref(); this
|
|
26
|
+
// facet drives render bag name / order (replaces BAG_NAME.field).
|
|
27
|
+
catalog: {
|
|
28
|
+
participates: true,
|
|
29
|
+
refKind: "field",
|
|
30
|
+
catalogBag: "fields",
|
|
31
|
+
renderOrder: 50,
|
|
32
|
+
catalogRoot: "app",
|
|
33
|
+
renderEntry: rootParentFactoryEntry("fieldRef", (ref) => {
|
|
34
|
+
const field = ref;
|
|
35
|
+
const parts = [`fieldType: ${JSON.stringify(field.fieldType)}`];
|
|
36
|
+
if (field.tags !== undefined)
|
|
37
|
+
parts.push(`tags: ${JSON.stringify(field.tags)}`);
|
|
38
|
+
return parts;
|
|
39
|
+
}),
|
|
40
|
+
stubRef: (refName, parent) => ({
|
|
41
|
+
__kind: "field",
|
|
42
|
+
refName,
|
|
43
|
+
name: refName,
|
|
44
|
+
parent,
|
|
45
|
+
fieldType: "TEXT",
|
|
46
|
+
}),
|
|
47
|
+
refFromAuthoring: () => undefined,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Picklist OPTIONS — the `[{label, color?, tags}, …]` shape shared by field
|
|
3
|
+
* `options` attributes and the app's `status_options` (the status system
|
|
4
|
+
* field is a picklist wearing an app attribute). Both directions live here:
|
|
5
|
+
* the wire→tf label projection and the tf→normalized-options extraction.
|
|
6
|
+
*/
|
|
7
|
+
import { type FromTfContext } from "../../engine/pull/context.js";
|
|
8
|
+
import type { TfValue } from "../../engine/tf/index.js";
|
|
9
|
+
import type { PicklistOption, PicklistOptionTag } from "../../core/types/app.js";
|
|
10
|
+
/** The authored picklist-value shape (post-`slimTokens` compose body). */
|
|
11
|
+
export interface PicklistValueWire {
|
|
12
|
+
readonly label?: string;
|
|
13
|
+
readonly value?: string;
|
|
14
|
+
readonly tags?: readonly string[];
|
|
15
|
+
readonly color?: string;
|
|
16
|
+
readonly relatedParentValues?: unknown;
|
|
17
|
+
}
|
|
18
|
+
export declare function picklistLabel(pv: PicklistValueWire): string;
|
|
19
|
+
export declare const KNOWN_OPTION_TAGS: ReadonlySet<PicklistOptionTag>;
|
|
20
|
+
/**
|
|
21
|
+
* A `[{label, tags?}, ...]` attribute (status_options, dropdown options) →
|
|
22
|
+
* the keyed `options` record the normalized `AppField` carries. Keys derive
|
|
23
|
+
* from labels via `withUniqueKeys` — they never print (the printer emits
|
|
24
|
+
* labels), so they only need to be unique. Unknown tags drop with a
|
|
25
|
+
* diagnostic; option ids stay empty (identity lives in terraform state).
|
|
26
|
+
*/
|
|
27
|
+
export declare function optionsFromTf(v: TfValue | undefined, where: string, ctx: FromTfContext): Record<string, PicklistOption> | undefined;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Picklist OPTIONS — the `[{label, color?, tags}, …]` shape shared by field
|
|
3
|
+
* `options` attributes and the app's `status_options` (the status system
|
|
4
|
+
* field is a picklist wearing an app attribute). Both directions live here:
|
|
5
|
+
* the wire→tf label projection and the tf→normalized-options extraction.
|
|
6
|
+
*/
|
|
7
|
+
import { plainObject } from "../../engine/pull/context.js";
|
|
8
|
+
import { withUniqueKeys } from "../../../pull/util.js";
|
|
9
|
+
export function picklistLabel(pv) {
|
|
10
|
+
return pv.label ?? pv.value ?? "";
|
|
11
|
+
}
|
|
12
|
+
export const KNOWN_OPTION_TAGS = new Set([
|
|
13
|
+
"CLOSED",
|
|
14
|
+
"CRITICAL",
|
|
15
|
+
"HIGH",
|
|
16
|
+
"MEDIUM",
|
|
17
|
+
"LOW",
|
|
18
|
+
]);
|
|
19
|
+
/**
|
|
20
|
+
* A `[{label, tags?}, ...]` attribute (status_options, dropdown options) →
|
|
21
|
+
* the keyed `options` record the normalized `AppField` carries. Keys derive
|
|
22
|
+
* from labels via `withUniqueKeys` — they never print (the printer emits
|
|
23
|
+
* labels), so they only need to be unique. Unknown tags drop with a
|
|
24
|
+
* diagnostic; option ids stay empty (identity lives in terraform state).
|
|
25
|
+
*/
|
|
26
|
+
export function optionsFromTf(v, where, ctx) {
|
|
27
|
+
if (v === undefined)
|
|
28
|
+
return undefined;
|
|
29
|
+
if (!Array.isArray(v)) {
|
|
30
|
+
ctx.diagnostics.push(`${where}: expected a list; dropped`);
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
const parsed = [];
|
|
34
|
+
for (const item of v) {
|
|
35
|
+
const rec = plainObject(item);
|
|
36
|
+
const optLabel = typeof rec?.["label"] === "string" ? rec["label"] : undefined;
|
|
37
|
+
if (rec === undefined || optLabel === undefined) {
|
|
38
|
+
ctx.diagnostics.push(`${where}: option item has an unrecognized shape; dropped`);
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
for (const key of Object.keys(rec)) {
|
|
42
|
+
if (key !== "label" && key !== "tags" && key !== "color") {
|
|
43
|
+
ctx.diagnostics.push(`${where}: option "${optLabel}" has an unhandled property "${key}"; dropped`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const color = typeof rec["color"] === "string" && rec["color"] !== "" ? rec["color"] : undefined;
|
|
47
|
+
const tags = [];
|
|
48
|
+
const rawTags = rec["tags"];
|
|
49
|
+
if (Array.isArray(rawTags)) {
|
|
50
|
+
for (const t of rawTags) {
|
|
51
|
+
if (typeof t === "string" && KNOWN_OPTION_TAGS.has(t)) {
|
|
52
|
+
tags.push(t);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
ctx.diagnostics.push(`${where}: option "${optLabel}" has an unknown tag ${JSON.stringify(t)}; dropped`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else if (rawTags !== undefined) {
|
|
60
|
+
ctx.diagnostics.push(`${where}: option "${optLabel}" tags is not a list; dropped`);
|
|
61
|
+
}
|
|
62
|
+
parsed.push({ label: optLabel, ...(color !== undefined && { color }), tags });
|
|
63
|
+
}
|
|
64
|
+
if (parsed.length === 0)
|
|
65
|
+
return undefined;
|
|
66
|
+
const out = {};
|
|
67
|
+
for (const { key, item } of withUniqueKeys(parsed, (p) => p.label, "option")) {
|
|
68
|
+
out[key] = {
|
|
69
|
+
id: "",
|
|
70
|
+
label: item.label,
|
|
71
|
+
...(item.color !== undefined && { color: item.color }),
|
|
72
|
+
...(item.tags.length > 0 && { tags: item.tags }),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
return out;
|
|
76
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derives the typed shape of an app/element's records from its catalog
|
|
3
|
+
* `fields` bag — what `ctx.trigger.record` / `ctx.tasks.<name>.record` expose
|
|
4
|
+
* for record-bearing triggers and tasks (`recordCreated`, `recordSearch`,
|
|
5
|
+
* `createRecord`, …).
|
|
6
|
+
*
|
|
7
|
+
* Most field types are scalar leaves (`TEXT` → `string`, `NUMBER` → `number`,
|
|
8
|
+
* …). A few carry richer sub-properties that the platform resolves at
|
|
9
|
+
* runtime, so their record value is an object instead — `DeepRef` then
|
|
10
|
+
* exposes those sub-properties for drilling, e.g.
|
|
11
|
+
* `ctx.trigger.record.severity.label` or `ctx.trigger.record.owner.email`.
|
|
12
|
+
* Object shapes come from `entities/shared/types/platform.ts` so a
|
|
13
|
+
* `User`/`Attachment`/… means the same thing everywhere in the SDK.
|
|
14
|
+
*
|
|
15
|
+
* Lives under the field entity (not engine): this is authoring-time field
|
|
16
|
+
* value typing consumed by automations, not stream/build orchestration.
|
|
17
|
+
*/
|
|
18
|
+
import type { FieldRef } from "../../catalog/types.js";
|
|
19
|
+
import type { Attachment, Group, PicklistValue, RichText, User } from "../shared/types/platform.js";
|
|
20
|
+
/** Map a platform field type literal to the TS type exposed on a record field. */
|
|
21
|
+
export type FieldValueType<FieldType extends string> = FieldType extends "NUMBER" | "DECIMAL" ? number : FieldType extends "BOOLEAN" ? boolean : FieldType extends "JSON" | "OBJECT" ? unknown : FieldType extends "PICKLIST" | "PICKLIST_ID" ? PicklistValue : FieldType extends "MULTI_PICKLIST" | "MULTI_PICKLIST_ID" ? readonly PicklistValue[] : FieldType extends "ATTACHMENT" | "ATTACHMENT_ID" | "FILE" ? Attachment : FieldType extends "RICH_TEXT" ? RichText : FieldType extends "USER" | "USER_ID" ? User : FieldType extends "GROUP" | "GROUP_ID" ? Group : string;
|
|
22
|
+
/**
|
|
23
|
+
* Extract the `fields` bag off an app/element-like ref, e.g. `typeof catalog.myApp`.
|
|
24
|
+
* `undefined` when the ref carries no `fields` bag (a hand-built `AspectRef`
|
|
25
|
+
* literal, or a ref kind — like a search table — that isn't field-typed yet).
|
|
26
|
+
*/
|
|
27
|
+
export type AppFieldsOf<A> = A extends {
|
|
28
|
+
readonly fields: infer F extends Record<string, FieldRef>;
|
|
29
|
+
} ? F : undefined;
|
|
30
|
+
/**
|
|
31
|
+
* The typed record shape for an app/element ref. When `A` carries a concrete
|
|
32
|
+
* `fields` bag (a real catalog app), this is a closed, per-field-typed object —
|
|
33
|
+
* an unknown field name is a compile error. Otherwise (no `fields` bag known,
|
|
34
|
+
* e.g. a caller that can't supply one, like `aiSearchTable`'s search-table
|
|
35
|
+
* ref) it falls back to an open `Record<string, unknown>`, matching the
|
|
36
|
+
* pre-existing loose behavior rather than forcing an unusable empty shape.
|
|
37
|
+
*
|
|
38
|
+
* Every record also carries its own HANDLE/ID under two different synthetic
|
|
39
|
+
* keys, matching two independent (and both intentional) wire conventions —
|
|
40
|
+
* neither has a bag key in `fields`:
|
|
41
|
+
* - `id` — for a trigger-sourced record (`ctx.trigger.record.id`), per
|
|
42
|
+
* `normalizeTriggerRefPath`'s `recordIdFieldClientHandle` → `"id"` case
|
|
43
|
+
* in `automations/materialize/ref-deserializer.ts`.
|
|
44
|
+
* - `recordId` — for a task-output record (`ctx.tasks.<t>.record.recordId`,
|
|
45
|
+
* `recordSearch`/`createRecord`/`findRelatedRecords`), per
|
|
46
|
+
* `rewriteForwardTaskRefName`'s `record.recordId` → wire `recordId`
|
|
47
|
+
* collapse in `automations/build.ts` (and its inverse in
|
|
48
|
+
* `ref-deserializer.ts`'s `buildTaskRef`).
|
|
49
|
+
* `RecordShape` backs both trigger and task record accessors, so both keys
|
|
50
|
+
* live here regardless of which context a given call site is in.
|
|
51
|
+
*/
|
|
52
|
+
export type RecordShape<A> = {
|
|
53
|
+
readonly id: string;
|
|
54
|
+
readonly recordId: string;
|
|
55
|
+
} & (AppFieldsOf<A> extends Record<string, FieldRef> ? {
|
|
56
|
+
readonly [K in keyof AppFieldsOf<A>]: FieldValueType<AppFieldsOf<A>[K]["fieldType"]>;
|
|
57
|
+
} : Record<string, unknown>);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|