@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,180 @@
|
|
|
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 { EntityTfError } from "../../engine/entity.js";
|
|
11
|
+
import { dataRefLabel, optionalString, plainObject } from "../../engine/pull/context.js";
|
|
12
|
+
import { snakeSlug, tfLabelToTsLabel } from "../../engine/tf/index.js";
|
|
13
|
+
import { fieldFromTf } from "../field/from-tf.js";
|
|
14
|
+
import { optionsFromTf } from "../field/options.js";
|
|
15
|
+
import { viewsFromTf } from "../view/from-tf.js";
|
|
16
|
+
import { APP_RESOURCE_TYPE } from "./module.js";
|
|
17
|
+
/** Attributes `appFromTf` understands — anything else is dialect growth, reported loudly. */
|
|
18
|
+
const KNOWN_APP_ATTRS = new Set([
|
|
19
|
+
"name",
|
|
20
|
+
"namespace",
|
|
21
|
+
"handle",
|
|
22
|
+
"description",
|
|
23
|
+
"icon",
|
|
24
|
+
"color",
|
|
25
|
+
"category_id",
|
|
26
|
+
"cloud_link_id",
|
|
27
|
+
"status_options",
|
|
28
|
+
"stages",
|
|
29
|
+
"title_field_name",
|
|
30
|
+
"id_field_name",
|
|
31
|
+
"status_field_name",
|
|
32
|
+
"title_field_description",
|
|
33
|
+
"id_field_description",
|
|
34
|
+
"status_field_description",
|
|
35
|
+
"comments_enabled",
|
|
36
|
+
]);
|
|
37
|
+
export function appFromTf(appBlock, fieldBlocks, ctx, viewBlocks = { layoutBlocks: [], listViewBlocks: [], managedViewOrderBlocks: [] }) {
|
|
38
|
+
const label = appBlock.label;
|
|
39
|
+
if (label === undefined || label === "") {
|
|
40
|
+
throw new EntityTfError("elementum_app block is missing its label");
|
|
41
|
+
}
|
|
42
|
+
const attrs = appBlock.attrs;
|
|
43
|
+
const refName = tfLabelToTsLabel(label);
|
|
44
|
+
for (const key of Object.keys(attrs)) {
|
|
45
|
+
if (!KNOWN_APP_ATTRS.has(key)) {
|
|
46
|
+
ctx.diagnostics.push(`app "${label}": unhandled attribute "${key}" — the export dialect grew; extend appFromTf deliberately`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const name = optionalString(attrs, "name", `app "${label}"`, ctx) ?? "";
|
|
50
|
+
const namespace = optionalString(attrs, "namespace", `app "${label}"`, ctx);
|
|
51
|
+
const handle = optionalString(attrs, "handle", `app "${label}"`, ctx);
|
|
52
|
+
const description = optionalString(attrs, "description", `app "${label}"`, ctx);
|
|
53
|
+
const icon = optionalString(attrs, "icon", `app "${label}"`, ctx);
|
|
54
|
+
const color = optionalString(attrs, "color", `app "${label}"`, ctx);
|
|
55
|
+
if (handle === undefined) {
|
|
56
|
+
ctx.diagnostics.push(`app "${label}": export stream carries no handle; derived "${label.toUpperCase()}"`);
|
|
57
|
+
}
|
|
58
|
+
for (const key of ["title_field_description", "id_field_description", "status_field_description"]) {
|
|
59
|
+
if (attrs[key] !== undefined) {
|
|
60
|
+
ctx.diagnostics.push(`app "${label}": ${key} has no authoring slot yet (systemFields overrides are name/options only); dropped`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// Captured on the normalized shape (same as the wire normalize) but not yet
|
|
64
|
+
// authorable — defineApp has no slot and build won't re-emit it.
|
|
65
|
+
// Platform default is false. Only loud-warn when true — a rebuilt stream
|
|
66
|
+
// would drop a real enablement (no authoring slot yet).
|
|
67
|
+
const commentsEnabled = typeof attrs["comments_enabled"] === "boolean" ? attrs["comments_enabled"] : undefined;
|
|
68
|
+
if (commentsEnabled === true) {
|
|
69
|
+
ctx.diagnostics.push(`app "${label}": comments_enabled has no authoring slot yet; a rebuilt stream will omit it`);
|
|
70
|
+
}
|
|
71
|
+
// --- Org data references (category / cloud link).
|
|
72
|
+
let category;
|
|
73
|
+
if (attrs["category_id"] !== undefined) {
|
|
74
|
+
const dataLabel = dataRefLabel(attrs["category_id"], "elementum_category");
|
|
75
|
+
const categoryName = dataLabel !== undefined ? ctx.dataName("elementum_category", dataLabel) : undefined;
|
|
76
|
+
if (categoryName === undefined) {
|
|
77
|
+
ctx.diagnostics.push(`app "${label}": category_id is not a resolvable elementum_category data reference; dropped`);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
category = { name: categoryName };
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
let cloudLinkId;
|
|
84
|
+
let cloudLinkHandle;
|
|
85
|
+
if (attrs["cloud_link_id"] !== undefined) {
|
|
86
|
+
const dataLabel = dataRefLabel(attrs["cloud_link_id"], "elementum_cloudlink");
|
|
87
|
+
if (dataLabel === undefined) {
|
|
88
|
+
ctx.diagnostics.push(`app "${label}": cloud_link_id is not an elementum_cloudlink data reference; dropped`);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
// The org.ts key is the data label's bijective image — same derivation
|
|
92
|
+
// the org extractor used, so the printed token matches the catalog.
|
|
93
|
+
cloudLinkHandle = tfLabelToTsLabel(dataLabel);
|
|
94
|
+
// Address, not a platform id — only the printer's TODO fallback ever
|
|
95
|
+
// shows it, and only when the org catalog lookup misses.
|
|
96
|
+
cloudLinkId = `data.elementum_cloudlink.${dataLabel}`;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// --- System-field attributes → tagged NormalizedField entries.
|
|
100
|
+
const fields = [];
|
|
101
|
+
const titleName = optionalString(attrs, "title_field_name", `app "${label}"`, ctx);
|
|
102
|
+
if (titleName !== undefined)
|
|
103
|
+
fields.push(systemEntry("title", titleName, "TEXT", "TITLE"));
|
|
104
|
+
const idName = optionalString(attrs, "id_field_name", `app "${label}"`, ctx);
|
|
105
|
+
if (idName !== undefined)
|
|
106
|
+
fields.push(systemEntry("id", idName, "TEXT", "HANDLE"));
|
|
107
|
+
const statusName = optionalString(attrs, "status_field_name", `app "${label}"`, ctx) ?? "Status";
|
|
108
|
+
const statusOptions = optionsFromTf(attrs["status_options"], `app "${label}" status_options`, ctx);
|
|
109
|
+
if (statusName !== "Status" || statusOptions !== undefined) {
|
|
110
|
+
fields.push({
|
|
111
|
+
key: "status",
|
|
112
|
+
field: {
|
|
113
|
+
id: "",
|
|
114
|
+
name: statusName,
|
|
115
|
+
type: "PICKLIST",
|
|
116
|
+
tags: ["STATUS"],
|
|
117
|
+
...(statusOptions !== undefined && { options: statusOptions }),
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
const stages = [];
|
|
122
|
+
const stagesAttr = attrs["stages"];
|
|
123
|
+
if (Array.isArray(stagesAttr)) {
|
|
124
|
+
for (const item of stagesAttr) {
|
|
125
|
+
const rec = plainObject(item);
|
|
126
|
+
const stageKey = typeof rec?.["key"] === "string" ? rec["key"] : undefined;
|
|
127
|
+
const stageName = typeof rec?.["name"] === "string" ? rec["name"] : undefined;
|
|
128
|
+
if (rec === undefined || stageKey === undefined || stageName === undefined) {
|
|
129
|
+
ctx.diagnostics.push(`app "${label}": stages item has an unrecognized shape; dropped`);
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (stageKey !== snakeSlug(stageName)) {
|
|
133
|
+
// Build derives stage keys from names (snakeSlug) — a stream key that
|
|
134
|
+
// doesn't match means a renamed stage, and a rebuilt stream will
|
|
135
|
+
// differ there. Surface it now instead of failing the build-vs-export blind.
|
|
136
|
+
ctx.diagnostics.push(`app "${label}": stage "${stageName}" has key "${stageKey}" but build derives "${snakeSlug(stageName)}" — was the stage renamed on the platform?`);
|
|
137
|
+
}
|
|
138
|
+
stages.push({ key: stageKey, stage: { id: "", name: stageName } });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else if (stagesAttr !== undefined) {
|
|
142
|
+
ctx.diagnostics.push(`app "${label}": stages is not a list; dropped`);
|
|
143
|
+
}
|
|
144
|
+
// --- Custom field resources (entities/field).
|
|
145
|
+
const owner = { type: APP_RESOURCE_TYPE, label };
|
|
146
|
+
for (const block of fieldBlocks) {
|
|
147
|
+
const entry = fieldFromTf(block, owner, ctx);
|
|
148
|
+
if (entry !== undefined)
|
|
149
|
+
fields.push(entry);
|
|
150
|
+
}
|
|
151
|
+
const appId = ctx.importId(`${APP_RESOURCE_TYPE}.${label}`);
|
|
152
|
+
if (appId === undefined) {
|
|
153
|
+
ctx.diagnostics.push(`app "${label}": no import block in the stream — adoption has no identity to bind`);
|
|
154
|
+
}
|
|
155
|
+
// --- View pass: layouts / list views / view order (entities/view), owner passed in.
|
|
156
|
+
const { layouts, listViews, viewOrder } = viewsFromTf(viewBlocks.layoutBlocks, viewBlocks.listViewBlocks, viewBlocks.managedViewOrderBlocks, { type: APP_RESOURCE_TYPE, label, stageKeys: new Set(stages.map((stage) => stage.key)) }, ctx);
|
|
157
|
+
const app = {
|
|
158
|
+
id: appId ?? "",
|
|
159
|
+
name,
|
|
160
|
+
...(description !== undefined && { description }),
|
|
161
|
+
...(namespace !== undefined && { namespace }),
|
|
162
|
+
...(icon !== undefined && { icon }),
|
|
163
|
+
...(color !== undefined && { color }),
|
|
164
|
+
type: "APP",
|
|
165
|
+
...(category !== undefined && { category }),
|
|
166
|
+
refName,
|
|
167
|
+
backendHandle: handle ?? label.toUpperCase(),
|
|
168
|
+
fields,
|
|
169
|
+
stages,
|
|
170
|
+
...(cloudLinkId !== undefined && { cloudLinkId }),
|
|
171
|
+
...(commentsEnabled !== undefined && { commentsEnabled }),
|
|
172
|
+
...(layouts.length > 0 && { layouts }),
|
|
173
|
+
...(listViews.length > 0 && { listViews }),
|
|
174
|
+
...(viewOrder !== undefined && { viewOrder }),
|
|
175
|
+
};
|
|
176
|
+
return { app, ...(cloudLinkHandle !== undefined && { cloudLinkHandle }) };
|
|
177
|
+
}
|
|
178
|
+
function systemEntry(key, name, type, tag) {
|
|
179
|
+
return { key, field: { id: "", name, type, tags: [tag] } };
|
|
180
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 app authoring — `defineApp`. Org-owned; deploys via the wire client's
|
|
3
|
+
* compose path. Standalone from v1's `src/aspects`. Elements author through
|
|
4
|
+
* the sibling `@elementumai/edk/elements` module (`defineElement`) — see
|
|
5
|
+
* `src/elements/build.ts`'s header for why apps and elements split into
|
|
6
|
+
* dedicated builders despite sharing this module's field/print internals.
|
|
7
|
+
*/
|
|
8
|
+
export { defineApp, type AppCategory, type AppCloudOptions, type AppField, type AppPicklistConfig, type AppPicklistDynamicConfig, type AppV2Options, type PicklistOption, } from "./build.js";
|
|
9
|
+
export { type DisplayBlock } from "./display-blocks.js";
|
|
10
|
+
export { attachmentField, booleanField, dateField, dateTimeField, decimalField, groupField, htmlField, jsonField, multiPicklistField, numberField, picklistField, textField, userField, type BaseFieldOptions, type NumericFieldOptions, type PicklistFieldOptions, type TextFieldOptions, } from "../field/build.js";
|
|
11
|
+
export { calc, field, type Expr, type ExprType } from "../field/calc.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 app authoring — `defineApp`. Org-owned; deploys via the wire client's
|
|
3
|
+
* compose path. Standalone from v1's `src/aspects`. Elements author through
|
|
4
|
+
* the sibling `@elementumai/edk/elements` module (`defineElement`) — see
|
|
5
|
+
* `src/elements/build.ts`'s header for why apps and elements split into
|
|
6
|
+
* dedicated builders despite sharing this module's field/print internals.
|
|
7
|
+
*/
|
|
8
|
+
export { defineApp, } from "./build.js";
|
|
9
|
+
export { attachmentField, booleanField, dateField, dateTimeField, decimalField, groupField, htmlField, jsonField, multiPicklistField, numberField, picklistField, textField, userField, } from "../field/build.js";
|
|
10
|
+
export { calc, field } from "../field/calc.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The app entity's locals.tf contribution, in ei's exact shapes:
|
|
3
|
+
* `<ns>_stage_ids_by_key`, the ten `<ns>_*_field_id` system lookups, and
|
|
4
|
+
* `<ns>_status_options_by_label` / `<ns>_stage_options_by_label`
|
|
5
|
+
* for-expressions (loop variables `opt` / `s`, matching ei's emitter
|
|
6
|
+
* verbatim). Field-level lookups are the field entity's contribution
|
|
7
|
+
* (entities/field/locals.ts).
|
|
8
|
+
*/
|
|
9
|
+
import { type TfValue } from "../../engine/tf/index.js";
|
|
10
|
+
/** Append one app's system lookup locals, keyed by its namespace (= tfLabel). */
|
|
11
|
+
export declare function appendAppLocals(attrs: Record<string, TfValue>, ns: string): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The app entity's locals.tf contribution, in ei's exact shapes:
|
|
3
|
+
* `<ns>_stage_ids_by_key`, the ten `<ns>_*_field_id` system lookups, and
|
|
4
|
+
* `<ns>_status_options_by_label` / `<ns>_stage_options_by_label`
|
|
5
|
+
* for-expressions (loop variables `opt` / `s`, matching ei's emitter
|
|
6
|
+
* verbatim). Field-level lookups are the field entity's contribution
|
|
7
|
+
* (entities/field/locals.ts).
|
|
8
|
+
*/
|
|
9
|
+
import { expr } from "../../engine/tf/index.js";
|
|
10
|
+
import { APP_RESOURCE_TYPE } from "./module.js";
|
|
11
|
+
const SYSTEM_FIELD_ID_ATTRS = [
|
|
12
|
+
"title_field_id",
|
|
13
|
+
"status_field_id",
|
|
14
|
+
"stage_field_id",
|
|
15
|
+
"id_field_id",
|
|
16
|
+
"created_by_field_id",
|
|
17
|
+
"created_at_field_id",
|
|
18
|
+
"updated_by_field_id",
|
|
19
|
+
"updated_at_field_id",
|
|
20
|
+
"closed_by_field_id",
|
|
21
|
+
"closed_at_field_id",
|
|
22
|
+
];
|
|
23
|
+
/** Append one app's system lookup locals, keyed by its namespace (= tfLabel). */
|
|
24
|
+
export function appendAppLocals(attrs, ns) {
|
|
25
|
+
const app = (path) => expr.resourceAttr(APP_RESOURCE_TYPE, ns, [path]);
|
|
26
|
+
attrs[`${ns}_stage_ids_by_key`] = app("stage_ids_by_key");
|
|
27
|
+
for (const attr of SYSTEM_FIELD_ID_ATTRS)
|
|
28
|
+
attrs[`${ns}_${attr}`] = app(attr);
|
|
29
|
+
attrs[`${ns}_status_options_by_label`] = expr.forObject("opt", app("status_options"), expr.scopedAttr("opt", ["label"]), expr.scopedAttr("opt", ["id"]));
|
|
30
|
+
attrs[`${ns}_stage_options_by_label`] = expr.forObject("s", app("stages"), expr.scopedAttr("s", ["name"]), expr.scopedAttr("s", ["id"]));
|
|
31
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** The app entity's graph module + resource-type constant (see src/graph/). */
|
|
2
|
+
import { NO_CATALOG, } from "../../graph/types.js";
|
|
3
|
+
import { appendFieldLocals } from "../field/locals.js";
|
|
4
|
+
import { LAYOUT_RESOURCE_TYPE, LIST_VIEW_RESOURCE_TYPE } from "../view/types.js";
|
|
5
|
+
import { appFromTf } from "./from-tf.js";
|
|
6
|
+
import { appendAppLocals } from "./locals.js";
|
|
7
|
+
import { appToTf } from "./to-tf.js";
|
|
8
|
+
export const APP_RESOURCE_TYPE = "elementum_app";
|
|
9
|
+
function extractAppStreamRoot(stream, ctx) {
|
|
10
|
+
const appBlocks = stream.byKind.get("app") ?? [];
|
|
11
|
+
if (appBlocks.length !== 1) {
|
|
12
|
+
throw new Error(`expected exactly one ${APP_RESOURCE_TYPE} resource in the export stream, found ${appBlocks.length}` +
|
|
13
|
+
(appBlocks.length > 1 ? " — was this exported with --recursive?" : ""));
|
|
14
|
+
}
|
|
15
|
+
const fieldBlocks = stream.byKind.get("field") ?? [];
|
|
16
|
+
const viewBlocks = stream.byKind.get("view") ?? [];
|
|
17
|
+
const layoutBlocks = viewBlocks.filter((b) => b.type === LAYOUT_RESOURCE_TYPE);
|
|
18
|
+
const listViewBlocks = viewBlocks.filter((b) => b.type === LIST_VIEW_RESOURCE_TYPE);
|
|
19
|
+
const managedViewOrderBlocks = stream.byKind.get("managed-view-order") ?? [];
|
|
20
|
+
const { app, cloudLinkHandle } = appFromTf(appBlocks[0], fieldBlocks, ctx, {
|
|
21
|
+
layoutBlocks,
|
|
22
|
+
listViewBlocks,
|
|
23
|
+
managedViewOrderBlocks,
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
instance: app,
|
|
27
|
+
...(cloudLinkHandle !== undefined && { cloudLinkHandle }),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export const appModule = {
|
|
31
|
+
kind: "app",
|
|
32
|
+
stream: { role: "streamRoot", exportVerb: "apps" },
|
|
33
|
+
authoring: { unit: "ownFile", bag: "apps" },
|
|
34
|
+
parents: [{ parent: "org", child: "app" }],
|
|
35
|
+
resource: { shape: "single", resourceType: APP_RESOURCE_TYPE, adoptable: true },
|
|
36
|
+
// Foreign/referenced apps: same KindId + bag; data facet emits
|
|
37
|
+
// `data.elementum_app` (ref-only stubs on disk are later).
|
|
38
|
+
data: { participates: true, lookupAttr: "name", referencedByBuild: true },
|
|
39
|
+
canvas: { participates: true, label: "Apps", glyph: "▣", component: "appDetail" },
|
|
40
|
+
lifecycle: {
|
|
41
|
+
participates: true,
|
|
42
|
+
extractStreamRoot: extractAppStreamRoot,
|
|
43
|
+
toTf: (entity, ctx) => {
|
|
44
|
+
const result = appToTf(entity, {
|
|
45
|
+
appTfLabel: ctx.appTfLabel,
|
|
46
|
+
orgRefs: ctx.orgRefs,
|
|
47
|
+
diagnostics: ctx.diagnostics,
|
|
48
|
+
});
|
|
49
|
+
return { blocks: result.blocks, fieldAddresses: result.fieldAddresses };
|
|
50
|
+
},
|
|
51
|
+
appendLocals: (localsAttrs, ctx) => {
|
|
52
|
+
appendAppLocals(localsAttrs, ctx.appTfLabel);
|
|
53
|
+
if (ctx.fieldAddresses !== undefined) {
|
|
54
|
+
appendFieldLocals(localsAttrs, ctx.fieldAddresses);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
catalog: NO_CATALOG,
|
|
59
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App emission (M2, plan §4.3): `appToTf` consumes the discovered
|
|
3
|
+
* `DeployableEntity` (the handle-form `defineApp` compose body) and emits
|
|
4
|
+
* `elementum_app` + one field resource per custom field (the field pass
|
|
5
|
+
* delegates to `entities/field/to-tf.ts`).
|
|
6
|
+
*
|
|
7
|
+
* Dialect invariants:
|
|
8
|
+
* 1. structured TfBlocks through src/engine/tf render — no string
|
|
9
|
+
* concatenation;
|
|
10
|
+
* 2. BARE labels derived from bag keys via the tsLabel bijection (the
|
|
11
|
+
* stable naming contract); org data refs derive the same way from
|
|
12
|
+
* org.ts keys;
|
|
13
|
+
* 3. ei's exact dialect shapes (status_options items carry `tags` always).
|
|
14
|
+
* Unsupported authoring shapes degrade through `diagnostics` — reported,
|
|
15
|
+
* never silent, never thrown (plan §4.3).
|
|
16
|
+
*/
|
|
17
|
+
import type { ToTfContext } from "../../engine/build/context.js";
|
|
18
|
+
import { type DeployableEntity } from "../../engine/entity.js";
|
|
19
|
+
import { type TfBlock } from "../../engine/tf/index.js";
|
|
20
|
+
/** System-field tags that fold into the app resource instead of emitting a field resource. */
|
|
21
|
+
export declare const SYSTEM_FIELD_TAGS: ReadonlySet<string>;
|
|
22
|
+
export interface AppToTfResult {
|
|
23
|
+
readonly blocks: readonly TfBlock[];
|
|
24
|
+
/** bag key → terraform address, for the app catalog / locals bookkeeping. */
|
|
25
|
+
readonly fieldAddresses: ReadonlyMap<string, string>;
|
|
26
|
+
}
|
|
27
|
+
/** `elementum_app` + one field resource per custom field, in ei's dialect. */
|
|
28
|
+
export declare function appToTf(entity: DeployableEntity, ctx: ToTfContext): AppToTfResult;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App emission (M2, plan §4.3): `appToTf` consumes the discovered
|
|
3
|
+
* `DeployableEntity` (the handle-form `defineApp` compose body) and emits
|
|
4
|
+
* `elementum_app` + one field resource per custom field (the field pass
|
|
5
|
+
* delegates to `entities/field/to-tf.ts`).
|
|
6
|
+
*
|
|
7
|
+
* Dialect invariants:
|
|
8
|
+
* 1. structured TfBlocks through src/engine/tf render — no string
|
|
9
|
+
* concatenation;
|
|
10
|
+
* 2. BARE labels derived from bag keys via the tsLabel bijection (the
|
|
11
|
+
* stable naming contract); org data refs derive the same way from
|
|
12
|
+
* org.ts keys;
|
|
13
|
+
* 3. ei's exact dialect shapes (status_options items carry `tags` always).
|
|
14
|
+
* Unsupported authoring shapes degrade through `diagnostics` — reported,
|
|
15
|
+
* never silent, never thrown (plan §4.3).
|
|
16
|
+
*/
|
|
17
|
+
import { EntityTfError } from "../../engine/entity.js";
|
|
18
|
+
import { expr, snakeSlug } from "../../engine/tf/index.js";
|
|
19
|
+
import { picklistLabel } from "../field/options.js";
|
|
20
|
+
import { fieldToTf } from "../field/to-tf.js";
|
|
21
|
+
import { CATEGORY_ORG_BAG } from "../org/category.js";
|
|
22
|
+
import { CLOUD_LINK_ORG_BAG } from "../org/cloud-link.js";
|
|
23
|
+
import { viewToTf } from "../view/to-tf.js";
|
|
24
|
+
import { APP_RESOURCE_TYPE } from "./module.js";
|
|
25
|
+
/** System-field tags that fold into the app resource instead of emitting a field resource. */
|
|
26
|
+
export const SYSTEM_FIELD_TAGS = new Set([
|
|
27
|
+
"TITLE",
|
|
28
|
+
"HANDLE",
|
|
29
|
+
"STATUS",
|
|
30
|
+
"STAGE",
|
|
31
|
+
"CREATED_AT",
|
|
32
|
+
"CREATED_BY",
|
|
33
|
+
"UPDATED_AT",
|
|
34
|
+
"UPDATED_BY",
|
|
35
|
+
"CLOSED_AT",
|
|
36
|
+
"CLOSED_BY",
|
|
37
|
+
]);
|
|
38
|
+
/** Audit tags the provider auto-creates with fixed names (no rename attribute). */
|
|
39
|
+
const AUDIT_DEFAULT_NAMES = {
|
|
40
|
+
CREATED_AT: "Created At",
|
|
41
|
+
CREATED_BY: "Created By",
|
|
42
|
+
UPDATED_AT: "Updated At",
|
|
43
|
+
UPDATED_BY: "Updated By",
|
|
44
|
+
CLOSED_AT: "Closed At",
|
|
45
|
+
CLOSED_BY: "Closed By",
|
|
46
|
+
};
|
|
47
|
+
/** `elementum_app` + one field resource per custom field, in ei's dialect. */
|
|
48
|
+
export function appToTf(entity, ctx) {
|
|
49
|
+
if (entity.kind !== "app") {
|
|
50
|
+
throw new EntityTfError(`appToTf expects kind "app"; got "${entity.kind}" (refName "${entity.refName}")`);
|
|
51
|
+
}
|
|
52
|
+
const payload = entity.payload;
|
|
53
|
+
if (payload === null || typeof payload !== "object") {
|
|
54
|
+
throw new EntityTfError(`app "${entity.refName}" has a non-object payload`);
|
|
55
|
+
}
|
|
56
|
+
const appAttrs = {
|
|
57
|
+
name: payload.name ?? "",
|
|
58
|
+
};
|
|
59
|
+
if (payload.namespace !== undefined)
|
|
60
|
+
appAttrs["namespace"] = payload.namespace;
|
|
61
|
+
if (payload.handle !== undefined)
|
|
62
|
+
appAttrs["handle"] = payload.handle;
|
|
63
|
+
if (payload.description !== undefined)
|
|
64
|
+
appAttrs["description"] = payload.description;
|
|
65
|
+
if (payload.icon !== undefined)
|
|
66
|
+
appAttrs["icon"] = payload.icon;
|
|
67
|
+
if (payload.color !== undefined)
|
|
68
|
+
appAttrs["color"] = payload.color;
|
|
69
|
+
const categoryName = payload.category?.name;
|
|
70
|
+
if (categoryName !== undefined && categoryName !== "") {
|
|
71
|
+
const category = ctx.orgRefs.byName(CATEGORY_ORG_BAG, categoryName);
|
|
72
|
+
if (category === undefined) {
|
|
73
|
+
ctx.diagnostics.push(`category "${categoryName}" is not in the org catalog — re-run \`elementum pull org --data-only\` (categories must already exist in the org)`);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
appAttrs["category_id"] = expr.dataAttr("elementum_category", category.tfLabel, ["id"]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const cloudLink = payload.cloudLinkId;
|
|
80
|
+
if (cloudLink !== undefined) {
|
|
81
|
+
const tsLabel = cloudLink.refName ?? "";
|
|
82
|
+
const resolved = ctx.orgRefs.byTsLabel(CLOUD_LINK_ORG_BAG, tsLabel);
|
|
83
|
+
if (resolved === undefined) {
|
|
84
|
+
ctx.diagnostics.push(`cloud link token "${tsLabel}" is not in the org catalog — re-run \`elementum pull org --data-only\``);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
appAttrs["cloud_link_id"] = expr.dataAttr("elementum_cloudlink", resolved.tfLabel, ["id"]);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (payload.cloudOptions !== undefined) {
|
|
91
|
+
ctx.diagnostics.push("cloudOptions are not supported on the terraform path yet; dropped");
|
|
92
|
+
}
|
|
93
|
+
if (payload.displayBlocks !== undefined || payload.recordCreateDisplayBlocks !== undefined) {
|
|
94
|
+
// ei export carries no display-block resources (plan learning #7) — the
|
|
95
|
+
// platform owns layouts on this path.
|
|
96
|
+
ctx.diagnostics.push("display blocks are not supported on the terraform path; dropped");
|
|
97
|
+
}
|
|
98
|
+
// --- Field pass: fold system-tagged fields, emit one resource per custom field.
|
|
99
|
+
const blocks = [];
|
|
100
|
+
const fieldAddresses = new Map();
|
|
101
|
+
let statusOptions;
|
|
102
|
+
let stages;
|
|
103
|
+
const objectId = expr.resourceAttr(APP_RESOURCE_TYPE, ctx.appTfLabel, ["id"]);
|
|
104
|
+
for (const fieldEntry of payload.fields ?? []) {
|
|
105
|
+
const typeKey = Object.keys(fieldEntry)[0];
|
|
106
|
+
if (typeKey === undefined)
|
|
107
|
+
continue;
|
|
108
|
+
const inner = fieldEntry[typeKey];
|
|
109
|
+
const name = inner.name ?? "";
|
|
110
|
+
const systemTag = inner.tags?.find((tag) => SYSTEM_FIELD_TAGS.has(tag));
|
|
111
|
+
if (systemTag !== undefined) {
|
|
112
|
+
switch (systemTag) {
|
|
113
|
+
case "TITLE":
|
|
114
|
+
if (name !== "Title")
|
|
115
|
+
appAttrs["title_field_name"] = name;
|
|
116
|
+
if (inner.description !== undefined)
|
|
117
|
+
appAttrs["title_field_description"] = inner.description;
|
|
118
|
+
break;
|
|
119
|
+
case "HANDLE":
|
|
120
|
+
if (name !== "ID")
|
|
121
|
+
appAttrs["id_field_name"] = name;
|
|
122
|
+
if (inner.description !== undefined)
|
|
123
|
+
appAttrs["id_field_description"] = inner.description;
|
|
124
|
+
break;
|
|
125
|
+
case "STATUS":
|
|
126
|
+
if (name !== "Status")
|
|
127
|
+
appAttrs["status_field_name"] = name;
|
|
128
|
+
if (inner.description !== undefined)
|
|
129
|
+
appAttrs["status_field_description"] = inner.description;
|
|
130
|
+
if (inner.picklistValues !== undefined) {
|
|
131
|
+
// ei's dialect: every status option item carries `tags` (empty
|
|
132
|
+
// ok); `color` only when set.
|
|
133
|
+
statusOptions = inner.picklistValues.map((pv) => ({
|
|
134
|
+
label: picklistLabel(pv),
|
|
135
|
+
...(pv.color !== undefined && pv.color !== "" && { color: pv.color }),
|
|
136
|
+
tags: [...(pv.tags ?? [])],
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
break;
|
|
140
|
+
case "STAGE":
|
|
141
|
+
if (name !== "Stage") {
|
|
142
|
+
ctx.diagnostics.push(`systemFields.stage: the provider has no stage field name attribute; authored name "${name}" dropped (field stays "Stage")`);
|
|
143
|
+
}
|
|
144
|
+
if (inner.picklistValues !== undefined) {
|
|
145
|
+
stages = inner.picklistValues.map((pv) => {
|
|
146
|
+
const label = picklistLabel(pv);
|
|
147
|
+
return { key: snakeSlug(label), name: label };
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
break;
|
|
151
|
+
default: {
|
|
152
|
+
const defaultName = AUDIT_DEFAULT_NAMES[systemTag];
|
|
153
|
+
if (defaultName !== undefined && name !== defaultName) {
|
|
154
|
+
ctx.diagnostics.push(`systemFields: the provider auto-creates the ${systemTag} audit field as "${defaultName}" and has no rename attribute; authored name "${name}" dropped`);
|
|
155
|
+
}
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
// Custom field → one `elementum_*_field` resource (entities/field).
|
|
162
|
+
const field = fieldToTf(typeKey, inner, { objectId, diagnostics: ctx.diagnostics });
|
|
163
|
+
if (field === undefined)
|
|
164
|
+
continue;
|
|
165
|
+
blocks.push(field.block);
|
|
166
|
+
fieldAddresses.set(field.bagKey, field.address);
|
|
167
|
+
}
|
|
168
|
+
// Required provider attributes — emitted even when empty (an empty
|
|
169
|
+
// status_options list gets the provider's defaults; empty stages = no
|
|
170
|
+
// stage workflow). Matches ei's export, which always writes both.
|
|
171
|
+
appAttrs["status_options"] = statusOptions ?? [];
|
|
172
|
+
appAttrs["stages"] = stages ?? [];
|
|
173
|
+
// --- View pass: layouts / list views / view order (entities/view), owner passed in.
|
|
174
|
+
const { blocks: viewBlocks } = viewToTf(payload.layouts, payload.listViews, payload.viewOrder, {
|
|
175
|
+
appTfLabel: ctx.appTfLabel,
|
|
176
|
+
appName: payload.name ?? "",
|
|
177
|
+
objectId,
|
|
178
|
+
diagnostics: ctx.diagnostics,
|
|
179
|
+
});
|
|
180
|
+
blocks.push(...viewBlocks);
|
|
181
|
+
blocks.unshift({ kind: "resource", type: APP_RESOURCE_TYPE, label: ctx.appTfLabel, attrs: appAttrs });
|
|
182
|
+
return { blocks, fieldAddresses };
|
|
183
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type AspectRef, type ApprovalChainRef, type FieldRef } from "../../catalog/index.js";
|
|
2
|
+
import type { DeployableEntity, EntityDeployOptions } from "../../engine/entity.js";
|
|
3
|
+
import type { ApprovalStep } from "./steps.js";
|
|
4
|
+
export interface DefineApprovalChainV2Options extends EntityDeployOptions {
|
|
5
|
+
readonly handle?: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly parent?: string;
|
|
8
|
+
/** The owning app's stage this chain gates (raw id — stages aren't v2-tokenized). */
|
|
9
|
+
readonly stageId: string;
|
|
10
|
+
/** A related app whose records the chain also touches (token → id at deploy). */
|
|
11
|
+
readonly relatedApp?: AspectRef;
|
|
12
|
+
readonly defaultReason?: string;
|
|
13
|
+
readonly summary?: string;
|
|
14
|
+
readonly approveButton?: string;
|
|
15
|
+
readonly denyButton?: string;
|
|
16
|
+
readonly exceptionButton?: string;
|
|
17
|
+
/** Fields locked while the chain is in flight (tokens → ids at deploy). */
|
|
18
|
+
readonly lockedFields?: readonly FieldRef[];
|
|
19
|
+
readonly steps: readonly ApprovalStep[];
|
|
20
|
+
}
|
|
21
|
+
/** Build a v2 approval-chain entity (app-owned; PUT-updatable). */
|
|
22
|
+
export declare function defineApprovalChain(opts: DefineApprovalChainV2Options): DeployableEntity & {
|
|
23
|
+
readonly ref: ApprovalChainRef;
|
|
24
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 approval-chain authoring — `defineApprovalChain`. Parallel to v1
|
|
3
|
+
* `src/approvalChains/`, but standalone: produces a `DeployableEntity` of kind
|
|
4
|
+
* `approvalChain` (app-owned) whose `lockedFields` and `relatedApp` are catalog
|
|
5
|
+
* tokens resolved at deploy. Approval chains support PUT, so a changed one
|
|
6
|
+
* updates in place.
|
|
7
|
+
*
|
|
8
|
+
* `stageId` is carried raw — stages are app config, not a managed v2 entity (no
|
|
9
|
+
* token to resolve); same for step user/group ids (org-directory entities).
|
|
10
|
+
*/
|
|
11
|
+
import { EdkValidationError } from "../../../elementum-entity-client/errors.js";
|
|
12
|
+
import { slimTokens } from "../../catalog/index.js";
|
|
13
|
+
function serializeStep(step) {
|
|
14
|
+
if (step.kind === "user") {
|
|
15
|
+
return { ...(step.id != null ? { id: step.id } : {}), user: { userId: step.ref.id } };
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
...(step.id != null ? { id: step.id } : {}),
|
|
19
|
+
group: {
|
|
20
|
+
groupId: step.ref.id,
|
|
21
|
+
numberOfApprovalsRequired: step.approvalsRequired,
|
|
22
|
+
numberOfDenialsRequired: step.denialsRequired,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/** Build a v2 approval-chain entity (app-owned; PUT-updatable). */
|
|
27
|
+
export function defineApprovalChain(opts) {
|
|
28
|
+
const ref = { __kind: "approvalChain", refName: opts.handle ?? "", name: opts.name, parent: opts.parent ?? "" };
|
|
29
|
+
if (opts.steps.length === 0) {
|
|
30
|
+
throw new EdkValidationError(`defineApprovalChain "${opts.name}": at least one step is required.`);
|
|
31
|
+
}
|
|
32
|
+
const payload = {
|
|
33
|
+
...(opts.relatedApp !== undefined
|
|
34
|
+
? { relatedAspectOwnerId: opts.relatedApp, relatedAspectOwnerType: "AspectApp" } // token → id
|
|
35
|
+
: {}),
|
|
36
|
+
name: opts.name,
|
|
37
|
+
stageId: opts.stageId,
|
|
38
|
+
...(opts.defaultReason != null ? { defaultReason: opts.defaultReason } : {}),
|
|
39
|
+
...(opts.summary != null ? { summary: opts.summary } : {}),
|
|
40
|
+
...(opts.approveButton != null ? { approveButton: opts.approveButton } : {}),
|
|
41
|
+
...(opts.denyButton != null ? { denyButton: opts.denyButton } : {}),
|
|
42
|
+
...(opts.exceptionButton != null ? { exceptionButton: opts.exceptionButton } : {}),
|
|
43
|
+
...(opts.lockedFields != null && opts.lockedFields.length > 0
|
|
44
|
+
? { lockedAspectFieldIds: opts.lockedFields } // FieldRef tokens → ids at deploy
|
|
45
|
+
: {}),
|
|
46
|
+
approvalTemplates: opts.steps.map(serializeStep),
|
|
47
|
+
};
|
|
48
|
+
return {
|
|
49
|
+
ref,
|
|
50
|
+
kind: "approvalChain",
|
|
51
|
+
parent: opts.parent ?? "",
|
|
52
|
+
refName: opts.handle ?? "",
|
|
53
|
+
payload: slimTokens(payload),
|
|
54
|
+
...(opts.enabled !== undefined ? { enabled: opts.enabled } : {}),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 approval-chain authoring — `defineApprovalChain`. App-owned; PUT-updatable.
|
|
3
|
+
* Standalone from v1's `src/approvalChains`.
|
|
4
|
+
*/
|
|
5
|
+
export { defineApprovalChain, type DefineApprovalChainV2Options } from "./build.js";
|
|
6
|
+
export { groupStep, userStep, type ApprovalGroupStep, type ApprovalStep, type ApprovalUserStep, } from "./steps.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { GroupRef } from "../../core/types/group.js";
|
|
2
|
+
import type { UserRef } from "../../core/types/user.js";
|
|
3
|
+
export interface ApprovalUserStep {
|
|
4
|
+
readonly kind: "user";
|
|
5
|
+
readonly ref: UserRef;
|
|
6
|
+
/** Server step id — present only on pulled chains; round-trips on update. */
|
|
7
|
+
readonly id?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ApprovalGroupStep {
|
|
10
|
+
readonly kind: "group";
|
|
11
|
+
readonly ref: GroupRef;
|
|
12
|
+
readonly approvalsRequired: number;
|
|
13
|
+
readonly denialsRequired: number;
|
|
14
|
+
readonly id?: string;
|
|
15
|
+
}
|
|
16
|
+
export type ApprovalStep = ApprovalUserStep | ApprovalGroupStep;
|
|
17
|
+
export declare function userStep(user: UserRef, options?: {
|
|
18
|
+
id?: string;
|
|
19
|
+
}): ApprovalUserStep;
|
|
20
|
+
export declare function groupStep(group: GroupRef, options: {
|
|
21
|
+
approvalsRequired: number;
|
|
22
|
+
denialsRequired: number;
|
|
23
|
+
id?: string;
|
|
24
|
+
}): ApprovalGroupStep;
|