@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,325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 app/element authoring — `defineApp`. Parallel to v1 `src/aspects`,
|
|
3
|
+
* standalone from it.
|
|
4
|
+
*
|
|
5
|
+
* Produces a `DeployableEntity` of kind `app`/`element` with `parent: "org"` (apps are
|
|
6
|
+
* org-owned), whose payload is the platform's `AgentAspectInput` compose body.
|
|
7
|
+
* The cloud link is a `CatalogRef` token resolved at deploy; fields are authored
|
|
8
|
+
* inline (a new app's fields get server-assigned ids on compose). Deployed via
|
|
9
|
+
* the wire client's compose path (`composeAspect`).
|
|
10
|
+
*
|
|
11
|
+
* Slice scope: identity + the common scalar/picklist field types. Calc fields,
|
|
12
|
+
* dependent picklists, display blocks, and field-id reconciliation for updates
|
|
13
|
+
* follow the same pattern and land as expansion.
|
|
14
|
+
*/
|
|
15
|
+
import { slimTokens } from "../../catalog/index.js";
|
|
16
|
+
import { DEPLOY_DEFAULT_SYSTEM_FIELD_NAMES, SYSTEM_FIELD_KEYS, SYSTEM_FIELD_REQUIRED, SYSTEM_FIELD_TAG_BY_KEY, WRITABLE_SYSTEM_TAG_NAMES, } from "../../core/system-fields.js";
|
|
17
|
+
import { serializeDisplayBlocks } from "./display-blocks.js";
|
|
18
|
+
/** Map a platform field type to the `AspectFieldInput` variant key. */
|
|
19
|
+
const TYPE_TO_KEY = {
|
|
20
|
+
TEXT: "text",
|
|
21
|
+
RICH_TEXT: "text",
|
|
22
|
+
HANDLE: "handle",
|
|
23
|
+
HTML: "html",
|
|
24
|
+
NUMBER: "number",
|
|
25
|
+
DECIMAL: "decimal",
|
|
26
|
+
BOOLEAN: "bool",
|
|
27
|
+
DATE: "date",
|
|
28
|
+
DATETIME: "dateTime",
|
|
29
|
+
USER: "user",
|
|
30
|
+
USER_ID: "user",
|
|
31
|
+
GROUP: "group",
|
|
32
|
+
GROUP_ID: "group",
|
|
33
|
+
ATTACHMENT: "attachment",
|
|
34
|
+
ATTACHMENT_ID: "attachment",
|
|
35
|
+
JSON: "json",
|
|
36
|
+
PICKLIST: "picklist",
|
|
37
|
+
MULTI_PICKLIST: "multiPicklist",
|
|
38
|
+
};
|
|
39
|
+
const SYSTEM_FIELD_TAG_TO_TYPE = {
|
|
40
|
+
HANDLE: "HANDLE",
|
|
41
|
+
TITLE: "TEXT",
|
|
42
|
+
STATUS: "PICKLIST",
|
|
43
|
+
STAGE: "PICKLIST",
|
|
44
|
+
CREATED_AT: "DATETIME",
|
|
45
|
+
CREATED_BY: "USER",
|
|
46
|
+
UPDATED_AT: "DATETIME",
|
|
47
|
+
UPDATED_BY: "USER",
|
|
48
|
+
CLOSED_AT: "DATETIME",
|
|
49
|
+
CLOSED_BY: "USER",
|
|
50
|
+
};
|
|
51
|
+
function systemTag(field) {
|
|
52
|
+
return field.tags?.find((tag) => tag in SYSTEM_FIELD_TAG_TO_TYPE);
|
|
53
|
+
}
|
|
54
|
+
function typeMatchesSystemTag(field, expected) {
|
|
55
|
+
if (field.type === expected)
|
|
56
|
+
return true;
|
|
57
|
+
if (expected === "USER" && field.type === "USER_ID")
|
|
58
|
+
return true;
|
|
59
|
+
if (expected === "ATTACHMENT" && field.type === "ATTACHMENT_ID")
|
|
60
|
+
return true;
|
|
61
|
+
// The HANDLE-tagged field's own printed type varies across apps/elements
|
|
62
|
+
// (seen live: some pull as type "HANDLE", others as "TEXT") — accept any
|
|
63
|
+
// declared type for this tag rather than asserting a specific one.
|
|
64
|
+
if (expected === "HANDLE")
|
|
65
|
+
return true;
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
function assertSystemFieldRules(field) {
|
|
69
|
+
const tag = systemTag(field);
|
|
70
|
+
if (tag === undefined)
|
|
71
|
+
return;
|
|
72
|
+
const expected = SYSTEM_FIELD_TAG_TO_TYPE[tag];
|
|
73
|
+
if (!typeMatchesSystemTag(field, expected)) {
|
|
74
|
+
throw new Error(`System field "${field.name}" with tags ${JSON.stringify(field.tags)} ` +
|
|
75
|
+
`must keep platform type ${expected}; got ${field.type}.`);
|
|
76
|
+
}
|
|
77
|
+
if (!WRITABLE_SYSTEM_TAG_NAMES.has(tag)) {
|
|
78
|
+
if (field.defaultValue !== undefined) {
|
|
79
|
+
throw new Error(`System field "${field.name}" (${tag}) is read-only and cannot define a defaultValue.`);
|
|
80
|
+
}
|
|
81
|
+
// STAGE is the one non-writable system tag whose platform type is a
|
|
82
|
+
// picklist. Its options are platform-managed — the compose API rejects
|
|
83
|
+
// `picklistValues` for it with "This field is not a static picklist
|
|
84
|
+
// field.", a validation error that's opaque unless you already know
|
|
85
|
+
// that. Fail fast client-side with an explanation instead.
|
|
86
|
+
if (field.options !== undefined) {
|
|
87
|
+
throw new Error(`System field "${field.name}" (${tag}) is read-only and cannot define options — its picklist values are platform-managed.`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function shouldSerializePicklistOptions(field) {
|
|
92
|
+
return field.type === "PICKLIST" || field.type === "MULTI_PICKLIST";
|
|
93
|
+
}
|
|
94
|
+
function picklistValue(opt) {
|
|
95
|
+
if (typeof opt === "string")
|
|
96
|
+
return { value: opt, label: opt };
|
|
97
|
+
return {
|
|
98
|
+
value: opt.label,
|
|
99
|
+
label: opt.label,
|
|
100
|
+
...(opt.parentValues !== undefined ? { relatedParentValues: opt.parentValues } : {}),
|
|
101
|
+
...(opt.tags !== undefined ? { tags: opt.tags } : {}),
|
|
102
|
+
...(opt.color !== undefined ? { color: opt.color } : {}),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Serialize an authored field to its `AspectFieldInput` wire shape — shared
|
|
107
|
+
* with `defineElement`. `refName` is the field's bag key in `defineApp`'s
|
|
108
|
+
* `fields: {}` (e.g. `severity`) — carried as the internal `__refName` marker,
|
|
109
|
+
* a client-side-only bookkeeping value `applyV2`'s field reconciliation
|
|
110
|
+
* (`src/deploy/apply/apply.ts`, `reconcileFields`) reads to match this field
|
|
111
|
+
* against its previously-recorded state binding, then strips before the
|
|
112
|
+
* payload reaches the wire — it's never sent as `clientHandle` or anything
|
|
113
|
+
* else. Matching on the bag key instead of `name` is what lets a field's
|
|
114
|
+
* identity survive a display-`name` rename instead of being keyed by the
|
|
115
|
+
* mutable `name` (#230); the bag key itself is never rewritten by a rename,
|
|
116
|
+
* since it's just the field's fixed key in `fields: {}`.
|
|
117
|
+
*/
|
|
118
|
+
export function serializeField(field, refName) {
|
|
119
|
+
assertSystemFieldRules(field);
|
|
120
|
+
const key = TYPE_TO_KEY[field.type] ?? "text";
|
|
121
|
+
const base = {
|
|
122
|
+
// No `id` yet: reconciled at deploy — `reconcileFields` matches this
|
|
123
|
+
// field (by `__refName`, falling back to `name`) against state and injects
|
|
124
|
+
// the existing id for an update; create lets the server assign one.
|
|
125
|
+
name: field.name,
|
|
126
|
+
...(refName !== undefined ? { __refName: refName } : {}),
|
|
127
|
+
...(field.columnName !== undefined ? { columnName: field.columnName } : {}),
|
|
128
|
+
...(field.required !== undefined ? { required: field.required } : {}),
|
|
129
|
+
...(field.requiredOnClose !== undefined ? { requiredOnClose: field.requiredOnClose } : {}),
|
|
130
|
+
...(field.showOnCreate !== undefined ? { showOnCreate: field.showOnCreate } : {}),
|
|
131
|
+
...(field.lockOnCreate !== undefined ? { lockOnCreate: field.lockOnCreate } : {}),
|
|
132
|
+
...(field.description !== undefined ? { description: field.description } : {}),
|
|
133
|
+
...(field.defaultValue !== undefined ? { defaultValue: field.defaultValue } : {}),
|
|
134
|
+
...(field.tags !== undefined ? { tags: field.tags } : {}),
|
|
135
|
+
};
|
|
136
|
+
// Calculated field: the calc expression serializes to a text grammar string
|
|
137
|
+
// (field refs emitted by name; the platform resolves them on compose).
|
|
138
|
+
if (field.expression !== undefined) {
|
|
139
|
+
return { calculated: { ...base, calculation: { text: field.expression.toCalcString() } } };
|
|
140
|
+
}
|
|
141
|
+
if (key === "picklist" || key === "multiPicklist") {
|
|
142
|
+
if (shouldSerializePicklistOptions(field)) {
|
|
143
|
+
// Dynamic picklists must not send picklistValues — the platform rejects
|
|
144
|
+
// them with "This field is not a static picklist field."
|
|
145
|
+
if (field.options !== undefined && field.config?.dynamic === undefined) {
|
|
146
|
+
base.picklistValues = field.options.map(picklistValue);
|
|
147
|
+
}
|
|
148
|
+
if (field.config !== undefined) {
|
|
149
|
+
base.config = field.config;
|
|
150
|
+
}
|
|
151
|
+
else if (field.parentField !== undefined) {
|
|
152
|
+
// Dependent dropdown: parent field token → config.static.parentFieldId.
|
|
153
|
+
base.config = { static: { parentFieldId: field.parentField } };
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// Pure-config formats (no refs).
|
|
158
|
+
if ((key === "number" || key === "decimal") && field.numericFormat !== undefined) {
|
|
159
|
+
base.format = field.numericFormat;
|
|
160
|
+
}
|
|
161
|
+
if ((key === "text" || key === "html") && field.qrFormat !== undefined) {
|
|
162
|
+
base.format = field.qrFormat;
|
|
163
|
+
}
|
|
164
|
+
return { [key]: base };
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Reject a custom `fields:` bag key that is ALSO authored under
|
|
168
|
+
* `systemFields` — the same slot provisioned twice. Keys not present in
|
|
169
|
+
* systemFields stay legal as ordinary fields (existing workspaces key
|
|
170
|
+
* plain fields `title` etc.); full reservation of the canonical keys is
|
|
171
|
+
* deferred until system-field ref tokens land on `ref().fields`.
|
|
172
|
+
*/
|
|
173
|
+
export function assertNoSystemKeyCollision(builder, name, fields, systemFields) {
|
|
174
|
+
if (systemFields === undefined)
|
|
175
|
+
return;
|
|
176
|
+
for (const key of Object.keys(fields)) {
|
|
177
|
+
if (systemFields[key] !== undefined) {
|
|
178
|
+
throw new Error(`${builder} "${name}": fields.${key} collides with the authored systemFields.${key} override — one slot, one author.`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Serialize the AUTHORED system-field overrides into tagged compose entries
|
|
184
|
+
* (the same wire shape a system field carries on pull). Only authored keys
|
|
185
|
+
* are emitted — omitted keys stay platform-owned. status/stage overrides
|
|
186
|
+
* always carry their option set; the other keys are name-only.
|
|
187
|
+
*/
|
|
188
|
+
export function serializeSystemFields(overrides) {
|
|
189
|
+
if (overrides === undefined)
|
|
190
|
+
return [];
|
|
191
|
+
return SYSTEM_FIELD_KEYS.filter((key) => overrides[key] !== undefined).map((key) => {
|
|
192
|
+
const tag = SYSTEM_FIELD_TAG_BY_KEY[key];
|
|
193
|
+
const override = overrides[key];
|
|
194
|
+
const name = override.name ?? DEPLOY_DEFAULT_SYSTEM_FIELD_NAMES[key];
|
|
195
|
+
if (key === "stage") {
|
|
196
|
+
// Constructed directly, not via serializeField: the REST compose API
|
|
197
|
+
// rejects stage picklistValues (stage mutations have dedicated
|
|
198
|
+
// endpoints), so serializeField's system-field rules forbid them —
|
|
199
|
+
// but on the terraform path stages author via the app resource's
|
|
200
|
+
// `stages` attribute, which is exactly where toTf folds this entry.
|
|
201
|
+
return {
|
|
202
|
+
picklist: {
|
|
203
|
+
name,
|
|
204
|
+
required: SYSTEM_FIELD_REQUIRED[key],
|
|
205
|
+
tags: [tag],
|
|
206
|
+
__refName: key,
|
|
207
|
+
picklistValues: override.options.map(picklistValue),
|
|
208
|
+
},
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
const field = {
|
|
212
|
+
name,
|
|
213
|
+
type: SYSTEM_FIELD_TAG_TO_TYPE[tag],
|
|
214
|
+
required: SYSTEM_FIELD_REQUIRED[key],
|
|
215
|
+
tags: [tag],
|
|
216
|
+
...(key === "status" ? { options: override.options } : {}),
|
|
217
|
+
};
|
|
218
|
+
return serializeField(field, key);
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Build a v2 app entity: org-owned, compose-body payload. Exposes
|
|
223
|
+
* `.ref(refName)` and `.def(refName)`.
|
|
224
|
+
*
|
|
225
|
+
* Elements author through `defineElement` (`@elementumai/edk/elements`,
|
|
226
|
+
* `src/elements/build.ts`) instead — a dedicated builder/printer, since a
|
|
227
|
+
* *linked* element's cloud mapping (Cloud Link + Database + Schema + Table,
|
|
228
|
+
* vs. a *standard* element's Elementum-managed table) has no equivalent on an
|
|
229
|
+
* app. `defineApp`'s `type` no longer accepts `"ELEMENT"`.
|
|
230
|
+
*/
|
|
231
|
+
/**
|
|
232
|
+
* Client-side validation for `defineApp` — the authoring-time home for app
|
|
233
|
+
* validation rules, so a malformed definition fails at define time rather than
|
|
234
|
+
* as an opaque platform error during apply. App-specific on purpose: elements
|
|
235
|
+
* carry their own equivalent in `src/elements/build.ts`.
|
|
236
|
+
*
|
|
237
|
+
* - `handle` — uppercase letters only (A–Z), when provided (it's optional)
|
|
238
|
+
* - `namespace` — lowercase letters only (a–z), when provided
|
|
239
|
+
*/
|
|
240
|
+
function validateAppOptions(opts) {
|
|
241
|
+
if (opts.handle !== undefined && !/^[A-Z]+$/.test(opts.handle)) {
|
|
242
|
+
throw new Error(`defineApp "${opts.name}": handle "${opts.handle}" must be uppercase letters only (A–Z).`);
|
|
243
|
+
}
|
|
244
|
+
if (opts.namespace !== undefined && !/^[a-z]+$/.test(opts.namespace)) {
|
|
245
|
+
throw new Error(`defineApp "${opts.name}": namespace "${opts.namespace}" must be lowercase letters only (a–z).`);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
export function defineApp(opts) {
|
|
249
|
+
validateAppOptions(opts);
|
|
250
|
+
const fieldEntries = Object.values(opts.fields);
|
|
251
|
+
// systemFields overrides synthesize real field entries too (a pulled app can
|
|
252
|
+
// legitimately have zero custom fields — see the voicetest fixture).
|
|
253
|
+
if (fieldEntries.length === 0 && serializeSystemFields(opts.systemFields).length === 0) {
|
|
254
|
+
throw new Error(`defineApp "${opts.name}" requires at least one field — a fields: {} entry or a systemFields override.`);
|
|
255
|
+
}
|
|
256
|
+
const kind = "app";
|
|
257
|
+
return {
|
|
258
|
+
ref(refName) {
|
|
259
|
+
// `handle` here is the disambiguated bag key (the Record key, e.g.
|
|
260
|
+
// "severity") — kept so `renderCatalog` can derive the catalog's bag
|
|
261
|
+
// key from it. It's also the join key deploy resolves fields by: `def()`
|
|
262
|
+
// carries it as `serializeField`'s internal `__refName` marker (see its
|
|
263
|
+
// doc comment), and `resolveFieldBinding` tries it as a fallback after
|
|
264
|
+
// display `name`, so a field survives a `name` rename once its binding
|
|
265
|
+
// is recorded under this handle. It never appears in printed source:
|
|
266
|
+
// `render.ts`'s `renderRefCall` omits identity entirely for field refs,
|
|
267
|
+
// and `factories.ts`'s `fieldRef()` factory (used by generated code,
|
|
268
|
+
// with no bag-key context available) defaults it to `name` instead —
|
|
269
|
+
// both harmless, since printed refs re-resolve by name/bag key at their
|
|
270
|
+
// own deploy, not by this in-memory bag key.
|
|
271
|
+
const fields = {};
|
|
272
|
+
for (const [bagKey, field] of Object.entries(opts.fields)) {
|
|
273
|
+
fields[bagKey] = {
|
|
274
|
+
__kind: "field",
|
|
275
|
+
refName: bagKey,
|
|
276
|
+
name: field.name,
|
|
277
|
+
parent: refName,
|
|
278
|
+
fieldType: field.type,
|
|
279
|
+
...(field.tags !== undefined ? { tags: field.tags } : {}),
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
// readonlyFields are platform-managed (system) fields — merged into the ref's `fields` bag
|
|
283
|
+
// so other entities can reference them by typed handle, but excluded from `def()` payload.
|
|
284
|
+
if (opts.readonlyFields !== undefined) {
|
|
285
|
+
for (const [bagKey, ref] of Object.entries(opts.readonlyFields)) {
|
|
286
|
+
fields[bagKey] = { ...ref, refName: bagKey, parent: refName };
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return { __kind: kind, refName: refName, name: opts.name, fields };
|
|
290
|
+
},
|
|
291
|
+
def(refName) {
|
|
292
|
+
assertNoSystemKeyCollision("defineApp", opts.name, opts.fields, opts.systemFields);
|
|
293
|
+
const displayBlocks = serializeDisplayBlocks(opts.displayBlocks, "LAYOUT");
|
|
294
|
+
const recordCreateDisplayBlocks = serializeDisplayBlocks(opts.recordCreateDisplayBlocks, "CREATE");
|
|
295
|
+
const payload = {
|
|
296
|
+
name: opts.name,
|
|
297
|
+
...(opts.description !== undefined ? { description: opts.description } : {}),
|
|
298
|
+
handle: opts.handle, // wire field name is fixed by the compose API contract
|
|
299
|
+
namespace: opts.namespace,
|
|
300
|
+
type: "APP",
|
|
301
|
+
category: opts.category,
|
|
302
|
+
...(opts.icon !== undefined ? { icon: opts.icon } : {}),
|
|
303
|
+
...(opts.color !== undefined ? { color: opts.color } : {}),
|
|
304
|
+
...(opts.cloudLink !== undefined ? { cloudLinkId: opts.cloudLink } : {}), // token → id at deploy
|
|
305
|
+
...(opts.cloudOptions !== undefined ? { cloudOptions: opts.cloudOptions } : {}),
|
|
306
|
+
fields: [
|
|
307
|
+
...serializeSystemFields(opts.systemFields),
|
|
308
|
+
...Object.entries(opts.fields).map(([bagKey, field]) => serializeField(field, bagKey)),
|
|
309
|
+
],
|
|
310
|
+
...(displayBlocks !== undefined ? { displayBlocks } : {}),
|
|
311
|
+
...(recordCreateDisplayBlocks !== undefined ? { recordCreateDisplayBlocks } : {}),
|
|
312
|
+
...(opts.layouts !== undefined ? { layouts: opts.layouts } : {}),
|
|
313
|
+
...(opts.listViews !== undefined ? { listViews: opts.listViews } : {}),
|
|
314
|
+
...(opts.viewOrder !== undefined ? { viewOrder: opts.viewOrder } : {}),
|
|
315
|
+
};
|
|
316
|
+
return {
|
|
317
|
+
kind,
|
|
318
|
+
parent: "org",
|
|
319
|
+
refName,
|
|
320
|
+
payload: slimTokens(payload),
|
|
321
|
+
...(opts.enabled !== undefined ? { enabled: opts.enabled } : {}),
|
|
322
|
+
};
|
|
323
|
+
},
|
|
324
|
+
};
|
|
325
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalized app projection types — the shape the app printer
|
|
3
|
+
* (`./print-app.ts`), the elements printer, the tf extractor
|
|
4
|
+
* (`../tf.ts` `appFromTf`), and the app-stream orchestrator
|
|
5
|
+
* (`../../extract/app.ts`) all consume.
|
|
6
|
+
*
|
|
7
|
+
* The legacy wire→normalized projection (`normalizeAspect` over the REST
|
|
8
|
+
* `AspectPullResponse`) was deleted with the REST deploy engine; on the
|
|
9
|
+
* pristine-refactor pipeline these shapes are produced from `ei export`
|
|
10
|
+
* HCL streams instead (see `appFromTf`).
|
|
11
|
+
*/
|
|
12
|
+
import type { AppCategory, AppField, AppStage, AspectType } from "../../../core/types/app.js";
|
|
13
|
+
import type { DisplayBlock } from "../../../core/types/display-block.js";
|
|
14
|
+
/**
|
|
15
|
+
* Keyed via `withUniqueKeys`, so two stages named "Review" become
|
|
16
|
+
* `review` / `review2` deterministically. The printer emits each
|
|
17
|
+
* as `stages.<key>`.
|
|
18
|
+
*/
|
|
19
|
+
export interface NormalizedStage {
|
|
20
|
+
readonly key: string;
|
|
21
|
+
readonly stage: AppStage;
|
|
22
|
+
}
|
|
23
|
+
export interface NormalizedField {
|
|
24
|
+
readonly key: string;
|
|
25
|
+
readonly field: AppField;
|
|
26
|
+
/**
|
|
27
|
+
* Side-channel pull annotation for dependent-picklist linkage.
|
|
28
|
+
* Typed-ref `parentField` / `parentValues` on the runtime AppField
|
|
29
|
+
* need real picklist-object references, which aren't available until
|
|
30
|
+
* every sibling field has been projected — and emitting those refs
|
|
31
|
+
* from the printer requires hoisting parent / child fields to
|
|
32
|
+
* top-level `const`s before the `defineApp({...})` literal. We carry
|
|
33
|
+
* just the raw ids here; the printer resolves them against the
|
|
34
|
+
* other entries in the same `NormalizedApp.fields` list at emit
|
|
35
|
+
* time.
|
|
36
|
+
*/
|
|
37
|
+
readonly parentLinkage?: {
|
|
38
|
+
/** Parent picklist's field id (same aspect). */
|
|
39
|
+
readonly parentFieldId?: string;
|
|
40
|
+
/** Map of this field's option id → parent option ids. */
|
|
41
|
+
readonly optionParents?: ReadonlyMap<string, readonly string[]>;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Snowflake-backed cloud-table mapping for a LINKED element — the terraform
|
|
46
|
+
* dialect's `cloud_mapping_snowflake_*` / `snowflake_hybrid_table` /
|
|
47
|
+
* `title_column_name` / `id_column_name` attributes on `elementum_element`.
|
|
48
|
+
* Real and round-tripped: `elementToTf` re-sends it on build (create-only —
|
|
49
|
+
* the table binding is immutable once set). Reserved for the element pull
|
|
50
|
+
* path; apps with no source-table binding will not populate this slot.
|
|
51
|
+
*/
|
|
52
|
+
export interface NormalizedCloudConnectionSnowflake {
|
|
53
|
+
readonly kind: "snowflake";
|
|
54
|
+
readonly database?: string;
|
|
55
|
+
readonly schema?: string;
|
|
56
|
+
readonly table?: string;
|
|
57
|
+
readonly hybridTable?: boolean;
|
|
58
|
+
readonly titleColumnName?: string;
|
|
59
|
+
readonly idColumnName?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Flat projection of one display block. The printer resolves
|
|
63
|
+
* `fieldId` → the field's hoisted-const name and `stageId` → a
|
|
64
|
+
* `stages.<key>` ref at emit time, mirroring how dependent-picklist
|
|
65
|
+
* `parentLinkage` is resolved. Groups carry `childKeys` (the bag keys
|
|
66
|
+
* of their children); children appear as their own entries in the
|
|
67
|
+
* flat list, referenced by those keys.
|
|
68
|
+
*/
|
|
69
|
+
export interface NormalizedDisplayBlock {
|
|
70
|
+
readonly key: string;
|
|
71
|
+
readonly kind: DisplayBlock["kind"];
|
|
72
|
+
readonly id?: string;
|
|
73
|
+
readonly hidden?: boolean;
|
|
74
|
+
readonly displayLocation?: string;
|
|
75
|
+
/** Set only on top-level blocks (children inherit the group's stage). */
|
|
76
|
+
readonly stageId?: string;
|
|
77
|
+
/** Set on FIELD blocks — the referenced field's id. */
|
|
78
|
+
readonly fieldId?: string;
|
|
79
|
+
readonly name?: string;
|
|
80
|
+
readonly color?: string;
|
|
81
|
+
readonly icon?: string;
|
|
82
|
+
readonly maxColumns?: number;
|
|
83
|
+
readonly sideNavItem?: boolean;
|
|
84
|
+
readonly widgetId?: string;
|
|
85
|
+
readonly channels?: readonly string[];
|
|
86
|
+
readonly channelNames?: Readonly<Record<string, string>>;
|
|
87
|
+
/** GROUP children, in order, by bag key. */
|
|
88
|
+
readonly childKeys?: readonly string[];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* One section of a per-stage layout (`elementum_layout`). `fields` entries
|
|
92
|
+
* are either a canonical system-field key (`"title"`, `"status"`, …) or a
|
|
93
|
+
* custom field's bag key — never a raw id (see `entities/view/from-tf.ts`).
|
|
94
|
+
*/
|
|
95
|
+
export interface NormalizedLayoutSection {
|
|
96
|
+
readonly type: string;
|
|
97
|
+
readonly displayLocation?: string;
|
|
98
|
+
readonly displayOrder?: number;
|
|
99
|
+
readonly sideNavItem?: boolean;
|
|
100
|
+
readonly name?: string;
|
|
101
|
+
readonly icon?: string;
|
|
102
|
+
readonly color?: string;
|
|
103
|
+
readonly fields?: readonly string[];
|
|
104
|
+
}
|
|
105
|
+
/** A stage's record-detail layout, keyed by stage key on `NormalizedApp.layouts`. */
|
|
106
|
+
export interface NormalizedLayout {
|
|
107
|
+
readonly stageKey: string;
|
|
108
|
+
readonly sections: readonly NormalizedLayoutSection[];
|
|
109
|
+
}
|
|
110
|
+
/** A saved list view (`elementum_list_view`). `key` is its authoring bag key. */
|
|
111
|
+
export interface NormalizedListView {
|
|
112
|
+
readonly key: string;
|
|
113
|
+
readonly name: string;
|
|
114
|
+
readonly columns: readonly string[];
|
|
115
|
+
readonly allowRecordCreation?: boolean;
|
|
116
|
+
readonly density?: string;
|
|
117
|
+
readonly rows?: number;
|
|
118
|
+
/** Opaque JSON pass-through (see `entities/view/from-tf.ts` for why). */
|
|
119
|
+
readonly filter?: unknown;
|
|
120
|
+
/** Opaque JSON pass-through (see `entities/view/from-tf.ts` for why). */
|
|
121
|
+
readonly sort?: unknown;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Normalized aspect ready for `print-app.ts`. Carries the round-
|
|
125
|
+
* trip surface plus any cataloged metadata (handle for export
|
|
126
|
+
* binding). The wire bag fields agentsV2 / automations / search
|
|
127
|
+
* tables are not pulled here — those have their own pull scripts
|
|
128
|
+
* (`pull-agent`, `pull-automation`).
|
|
129
|
+
*
|
|
130
|
+
* `cloudLinkId`, `commentsEnabled`, and `cloudConnection` round-trip
|
|
131
|
+
* the metadata the discovery endpoints don't surface. They live on
|
|
132
|
+
* the normalized shape today; the printer wires them into the
|
|
133
|
+
* emitted `defineApp({...})` / `defineElement({...})` source as the
|
|
134
|
+
* matching authoring slots land.
|
|
135
|
+
*/
|
|
136
|
+
export interface NormalizedApp {
|
|
137
|
+
readonly id: string;
|
|
138
|
+
readonly name: string;
|
|
139
|
+
readonly description?: string;
|
|
140
|
+
readonly namespace?: string;
|
|
141
|
+
readonly icon?: string;
|
|
142
|
+
readonly color?: string;
|
|
143
|
+
readonly type?: AspectType;
|
|
144
|
+
readonly category?: AppCategory;
|
|
145
|
+
/** camelCased identifier for the export binding and EDK refName. */
|
|
146
|
+
readonly refName: string;
|
|
147
|
+
/** Backend app/element handle authored into defineApp({ handle }). */
|
|
148
|
+
readonly backendHandle: string;
|
|
149
|
+
readonly fields: readonly NormalizedField[];
|
|
150
|
+
readonly stages: readonly NormalizedStage[];
|
|
151
|
+
readonly cloudLinkId?: string;
|
|
152
|
+
readonly cloudLinkClientHandle?: string;
|
|
153
|
+
readonly commentsEnabled?: boolean;
|
|
154
|
+
readonly cloudConnection?: NormalizedCloudConnectionSnowflake;
|
|
155
|
+
/** Record-view (LAYOUT) display blocks, flat with `childKeys` linkage. */
|
|
156
|
+
readonly displayBlocks?: readonly NormalizedDisplayBlock[];
|
|
157
|
+
/** New-record-form (CREATE) display blocks. */
|
|
158
|
+
readonly recordCreateDisplayBlocks?: readonly NormalizedDisplayBlock[];
|
|
159
|
+
/** Per-stage record layouts (terraform-path `elementum_layout`), keyed by `stageKey`. */
|
|
160
|
+
readonly layouts?: readonly NormalizedLayout[];
|
|
161
|
+
/** Saved list views (`elementum_list_view`). */
|
|
162
|
+
readonly listViews?: readonly NormalizedListView[];
|
|
163
|
+
/** Display order of `listViews`, by key (`elementum_managed_view_order`). */
|
|
164
|
+
readonly viewOrder?: readonly string[];
|
|
165
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalized app projection types — the shape the app printer
|
|
3
|
+
* (`./print-app.ts`), the elements printer, the tf extractor
|
|
4
|
+
* (`../tf.ts` `appFromTf`), and the app-stream orchestrator
|
|
5
|
+
* (`../../extract/app.ts`) all consume.
|
|
6
|
+
*
|
|
7
|
+
* The legacy wire→normalized projection (`normalizeAspect` over the REST
|
|
8
|
+
* `AspectPullResponse`) was deleted with the REST deploy engine; on the
|
|
9
|
+
* pristine-refactor pipeline these shapes are produced from `ei export`
|
|
10
|
+
* HCL streams instead (see `appFromTf`).
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 display-block authoring — the record view (LAYOUT) and new-record form
|
|
3
|
+
* (CREATE) surfaces. Field blocks carry a `FieldRef` token at `fieldId`
|
|
4
|
+
* (resolved at deploy); group blocks nest children. Mirrors v1's
|
|
5
|
+
* `AspectDisplayBlockInput` shape.
|
|
6
|
+
*/
|
|
7
|
+
import type { FieldRef } from "../../catalog/index.js";
|
|
8
|
+
export type DisplayBlock = {
|
|
9
|
+
readonly kind: "field";
|
|
10
|
+
readonly field: FieldRef;
|
|
11
|
+
} | {
|
|
12
|
+
readonly kind: "group";
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly blocks: readonly DisplayBlock[];
|
|
15
|
+
readonly color?: string;
|
|
16
|
+
readonly icon?: string;
|
|
17
|
+
readonly maxColumns?: number;
|
|
18
|
+
} | {
|
|
19
|
+
readonly kind: "widget";
|
|
20
|
+
readonly widgetId: string;
|
|
21
|
+
} | {
|
|
22
|
+
readonly kind: "comments";
|
|
23
|
+
readonly channels?: readonly string[];
|
|
24
|
+
};
|
|
25
|
+
/** Serialize a display-block list for one surface; `undefined`/empty → omitted. */
|
|
26
|
+
export declare function serializeDisplayBlocks(blocks: readonly DisplayBlock[] | undefined, displayType: "LAYOUT" | "CREATE"): Record<string, unknown>[] | undefined;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
function serializeBlock(block, displayType) {
|
|
2
|
+
switch (block.kind) {
|
|
3
|
+
case "field":
|
|
4
|
+
return { fieldId: block.field, properties: { type: "FIELD", displayType } };
|
|
5
|
+
case "group":
|
|
6
|
+
return {
|
|
7
|
+
children: block.blocks.map((b) => serializeBlock(b, displayType)),
|
|
8
|
+
properties: {
|
|
9
|
+
type: "GROUP",
|
|
10
|
+
displayType,
|
|
11
|
+
name: block.name,
|
|
12
|
+
...(block.color !== undefined ? { color: block.color } : {}),
|
|
13
|
+
...(block.icon !== undefined ? { icon: block.icon } : {}),
|
|
14
|
+
...(block.maxColumns !== undefined ? { maxColumns: block.maxColumns } : {}),
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
case "widget":
|
|
18
|
+
return { properties: { type: "WIDGET", displayType, widgetId: block.widgetId } };
|
|
19
|
+
case "comments":
|
|
20
|
+
return {
|
|
21
|
+
properties: {
|
|
22
|
+
type: "COMMENTS",
|
|
23
|
+
displayType,
|
|
24
|
+
...(block.channels !== undefined ? { channels: block.channels } : {}),
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** Serialize a display-block list for one surface; `undefined`/empty → omitted. */
|
|
30
|
+
export function serializeDisplayBlocks(blocks, displayType) {
|
|
31
|
+
if (blocks === undefined || blocks.length === 0)
|
|
32
|
+
return undefined;
|
|
33
|
+
return blocks.map((b) => serializeBlock(b, displayType));
|
|
34
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App extraction (M2, plan §4.3): `appFromTf` turns the `elementum_app`
|
|
3
|
+
* block + its field resources (delegated to `entities/field/from-tf.ts`)
|
|
4
|
+
* into the `NormalizedApp` the kept `printAppV2` consumes. System-field
|
|
5
|
+
* attributes synthesize tagged `NormalizedField` entries (the shape the wire
|
|
6
|
+
* normalize produced), so the printer's `systemFields:` emission works
|
|
7
|
+
* identically for both pull paths. Platform ids come only from the stream's
|
|
8
|
+
* import blocks and stay data-side — they never reach printed source.
|
|
9
|
+
*/
|
|
10
|
+
import { type FromTfContext } from "../../engine/pull/context.js";
|
|
11
|
+
import { type TfBlock } from "../../engine/tf/index.js";
|
|
12
|
+
import type { NormalizedApp } from "./deserializer/normalize.js";
|
|
13
|
+
export interface AppFromTfResult {
|
|
14
|
+
readonly app: NormalizedApp;
|
|
15
|
+
/** org.ts `cloudLinks` bag key (the data label's tsLabel image), when the app pins one. */
|
|
16
|
+
readonly cloudLinkHandle?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface AppFromTfViewBlocks {
|
|
19
|
+
readonly layoutBlocks: readonly TfBlock[];
|
|
20
|
+
readonly listViewBlocks: readonly TfBlock[];
|
|
21
|
+
readonly managedViewOrderBlocks: readonly TfBlock[];
|
|
22
|
+
}
|
|
23
|
+
export declare function appFromTf(appBlock: TfBlock, fieldBlocks: readonly TfBlock[], ctx: FromTfContext, viewBlocks?: AppFromTfViewBlocks): AppFromTfResult;
|