@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,697 @@
|
|
|
1
|
+
import { serializeValueOrRef } from "../../core/wire/ref-serializer.js";
|
|
2
|
+
import { extractScriptBody } from "./script-code.js";
|
|
3
|
+
function workflowFields(fields) {
|
|
4
|
+
return fields.map((f) => {
|
|
5
|
+
return {
|
|
6
|
+
aspectFieldId: f.field, // token → field id at deploy
|
|
7
|
+
valueReference: serializeValueOrRef(f.value),
|
|
8
|
+
};
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export function recordSearch(opts) {
|
|
12
|
+
return {
|
|
13
|
+
key: "recordSearch",
|
|
14
|
+
config: {
|
|
15
|
+
aspectId: opts.app,
|
|
16
|
+
filter: opts.filter,
|
|
17
|
+
...(opts.sort !== undefined ? { sort: opts.sort } : {}),
|
|
18
|
+
...(opts.limit !== undefined ? { limit: opts.limit } : {}),
|
|
19
|
+
},
|
|
20
|
+
__recordApp: opts.app.refName,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function tableRecordsSearch(opts) {
|
|
24
|
+
return {
|
|
25
|
+
key: "tableRecordsSearch",
|
|
26
|
+
config: {
|
|
27
|
+
tableId: opts.table,
|
|
28
|
+
...(opts.filter !== undefined ? { filter: opts.filter } : {}),
|
|
29
|
+
...(opts.limit !== undefined ? { limit: opts.limit } : {}),
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function createRecord(opts) {
|
|
34
|
+
if (opts.fields.length === 0)
|
|
35
|
+
throw new Error("createRecord requires at least one field.");
|
|
36
|
+
if (opts.relateToRecord && opts.record === undefined) {
|
|
37
|
+
throw new Error("createRecord with relateToRecord requires `record`.");
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
key: "createRecord",
|
|
41
|
+
config: {
|
|
42
|
+
aspectId: opts.app,
|
|
43
|
+
workflowFields: workflowFields(opts.fields),
|
|
44
|
+
relateToRecord: opts.relateToRecord ?? false,
|
|
45
|
+
...(opts.record !== undefined ? { recordReference: serializeValueOrRef(opts.record) } : {}),
|
|
46
|
+
},
|
|
47
|
+
__recordApp: opts.app.refName,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export function updateField(opts) {
|
|
51
|
+
if (opts.fields.length === 0)
|
|
52
|
+
throw new Error("updateField requires at least one field.");
|
|
53
|
+
return {
|
|
54
|
+
key: "updateField",
|
|
55
|
+
config: {
|
|
56
|
+
aspectId: opts.app,
|
|
57
|
+
recordReference: serializeValueOrRef(opts.record),
|
|
58
|
+
workflowFields: workflowFields(opts.fields),
|
|
59
|
+
},
|
|
60
|
+
__recordApp: opts.app.refName,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export function findRelatedRecords(opts) {
|
|
64
|
+
return {
|
|
65
|
+
key: "findRelatedRecords",
|
|
66
|
+
config: {
|
|
67
|
+
relatedAspectId: opts.relatedApp,
|
|
68
|
+
recordId: serializeValueOrRef(opts.record),
|
|
69
|
+
...(opts.filter !== undefined ? { filter: opts.filter } : {}),
|
|
70
|
+
...(opts.sort !== undefined ? { sort: opts.sort } : {}),
|
|
71
|
+
...(opts.limit !== undefined ? { limit: opts.limit } : {}),
|
|
72
|
+
},
|
|
73
|
+
__recordApp: opts.relatedApp.refName,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
export function relateRecords(opts) {
|
|
77
|
+
if (opts.sources.length === 0)
|
|
78
|
+
throw new Error("relateRecords requires at least one source record.");
|
|
79
|
+
return {
|
|
80
|
+
key: "relateRecords",
|
|
81
|
+
config: {
|
|
82
|
+
sourceRecordIds: opts.sources.length === 1
|
|
83
|
+
? serializeValueOrRef(opts.sources[0])
|
|
84
|
+
: opts.sources.map((s) => serializeValueOrRef(s)),
|
|
85
|
+
targetRecordId: serializeValueOrRef(opts.target),
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function refList(values) {
|
|
90
|
+
return values === undefined ? undefined : values.map((v) => serializeValueOrRef(v));
|
|
91
|
+
}
|
|
92
|
+
function serializeEmailAttachment(a) {
|
|
93
|
+
return "file" in a ? { file: serializeValueOrRef(a.file) } : { record: serializeValueOrRef(a.fromRecord) };
|
|
94
|
+
}
|
|
95
|
+
export function sendEmail(opts) {
|
|
96
|
+
if (!opts.toUsers?.length && !opts.toGroups?.length && !opts.toAddresses?.length) {
|
|
97
|
+
throw new Error("sendEmail requires at least one recipient (toUsers, toGroups, or toAddresses).");
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
key: "sendEmail",
|
|
101
|
+
config: {
|
|
102
|
+
...(opts.fromUsername !== undefined ? { fromUsername: opts.fromUsername } : {}),
|
|
103
|
+
...(opts.fromDisplayName !== undefined ? { fromPersonal: opts.fromDisplayName } : {}),
|
|
104
|
+
subject: serializeValueOrRef(opts.subject),
|
|
105
|
+
messageBody: serializeValueOrRef(opts.body),
|
|
106
|
+
...(opts.toUsers !== undefined ? { users: refList(opts.toUsers) } : {}),
|
|
107
|
+
...(opts.toGroups !== undefined ? { groups: refList(opts.toGroups) } : {}),
|
|
108
|
+
...(opts.toAddresses !== undefined ? { externalEmails: refList(opts.toAddresses) } : {}),
|
|
109
|
+
...(opts.attachments !== undefined
|
|
110
|
+
? { emailAttachments: opts.attachments.map(serializeEmailAttachment) }
|
|
111
|
+
: {}),
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
export function postComment(opts) {
|
|
116
|
+
if (opts.tags.length === 0)
|
|
117
|
+
throw new Error("postComment requires a non-empty tags array.");
|
|
118
|
+
return {
|
|
119
|
+
key: "message",
|
|
120
|
+
config: {
|
|
121
|
+
tags: opts.tags,
|
|
122
|
+
contentsReference: serializeValueOrRef(opts.contents),
|
|
123
|
+
recordReference: serializeValueOrRef(opts.record),
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
export function aiAgent(opts) {
|
|
128
|
+
if (opts.outputType === "json" && (opts.schema === undefined || Object.keys(opts.schema).length === 0)) {
|
|
129
|
+
throw new Error('aiAgent with outputType "json" requires at least one field in schema.');
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
key: "aiAgent",
|
|
133
|
+
config: {
|
|
134
|
+
agentId: opts.agent,
|
|
135
|
+
agentPrompt: serializeValueOrRef(opts.prompt),
|
|
136
|
+
outputType: opts.outputType.toUpperCase(),
|
|
137
|
+
...(opts.schema !== undefined
|
|
138
|
+
? {
|
|
139
|
+
jsonFields: Object.entries(opts.schema).map(([name, def]) => ({
|
|
140
|
+
name,
|
|
141
|
+
type: def.type.toUpperCase(),
|
|
142
|
+
...(def.description !== undefined ? { description: def.description } : {}),
|
|
143
|
+
})),
|
|
144
|
+
}
|
|
145
|
+
: {}),
|
|
146
|
+
...(opts.connector !== undefined ? { aiProviderConnectorId: opts.connector } : {}),
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
export function setVariable(opts) {
|
|
151
|
+
if (!opts.create?.length && !opts.update?.length) {
|
|
152
|
+
throw new Error("setVariable requires a non-empty create and/or update list.");
|
|
153
|
+
}
|
|
154
|
+
const create = (opts.create ?? []).map((c) => ({
|
|
155
|
+
id: c.id,
|
|
156
|
+
name: c.name,
|
|
157
|
+
type: c.type,
|
|
158
|
+
...(c.value !== undefined ? { value: serializeValueOrRef(c.value) } : {}),
|
|
159
|
+
}));
|
|
160
|
+
const update = (opts.update ?? []).map((u) => ({
|
|
161
|
+
variable: serializeValueOrRef(u.variable),
|
|
162
|
+
value: serializeValueOrRef(u.value),
|
|
163
|
+
}));
|
|
164
|
+
return {
|
|
165
|
+
key: "variable",
|
|
166
|
+
config: {
|
|
167
|
+
...(create.length > 0 ? { create } : {}),
|
|
168
|
+
...(update.length > 0 ? { update } : {}),
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
// --- executeScript ----------------------------------------------------------
|
|
173
|
+
/** Map an output schema (name → type) to the platform's tagged object shape. */
|
|
174
|
+
function outputSchema(outputs) {
|
|
175
|
+
const properties = Object.entries(outputs).map(([name, type]) => {
|
|
176
|
+
switch (type) {
|
|
177
|
+
case "integer":
|
|
178
|
+
return { integer: { name } };
|
|
179
|
+
case "number":
|
|
180
|
+
case "decimal":
|
|
181
|
+
return { number: { name } };
|
|
182
|
+
case "boolean":
|
|
183
|
+
return { bool: { name } };
|
|
184
|
+
default:
|
|
185
|
+
return { string: { name } };
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
// No root name: the canonical provider form omits it, ei's exporter and the
|
|
189
|
+
// import read-back both DROP empty names — emitting name:"" would diff
|
|
190
|
+
// against both (adoption zero-change gate + build-vs-export).
|
|
191
|
+
return { object: { properties } };
|
|
192
|
+
}
|
|
193
|
+
export function executeScript(opts) {
|
|
194
|
+
const inputs = Object.entries(opts.inputs ?? {}).map(([name, value]) => ({
|
|
195
|
+
name,
|
|
196
|
+
value: serializeValueOrRef(value),
|
|
197
|
+
}));
|
|
198
|
+
return {
|
|
199
|
+
key: "executeScript",
|
|
200
|
+
config: {
|
|
201
|
+
inputs,
|
|
202
|
+
code: typeof opts.code === "function" ? extractScriptBody(opts.code) : opts.code,
|
|
203
|
+
...(opts.outputs !== undefined ? { outputSchema: outputSchema(opts.outputs) } : {}),
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
export function apiRequest(opts) {
|
|
208
|
+
return {
|
|
209
|
+
key: "api",
|
|
210
|
+
config: {
|
|
211
|
+
urlReference: serializeValueOrRef(opts.url),
|
|
212
|
+
method: opts.method,
|
|
213
|
+
headers: (opts.headers ?? []).map((h) => ({
|
|
214
|
+
header: h.name,
|
|
215
|
+
value: serializeValueOrRef(h.value),
|
|
216
|
+
})),
|
|
217
|
+
...(opts.authorization !== undefined ? { authorization: opts.authorization } : {}),
|
|
218
|
+
...(opts.body !== undefined ? { body: opts.body } : {}),
|
|
219
|
+
responseType: opts.responseType ?? "JSON",
|
|
220
|
+
continueOnError: opts.continueOnError ?? false,
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
export function aiSearchTable(opts) {
|
|
225
|
+
return {
|
|
226
|
+
key: "aiSearchTable",
|
|
227
|
+
config: {
|
|
228
|
+
searchTableId: opts.table,
|
|
229
|
+
query: serializeValueOrRef(opts.query),
|
|
230
|
+
...(opts.filter !== undefined ? { filter: opts.filter } : {}),
|
|
231
|
+
...(opts.limit !== undefined ? { limit: opts.limit } : {}),
|
|
232
|
+
},
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
// --- AI text tasks ----------------------------------------------------------
|
|
236
|
+
/** Common optional AI connector slot (`ConnectorRef` token). */
|
|
237
|
+
function connectorSlot(connector) {
|
|
238
|
+
return connector !== undefined ? { aiProviderConnectorId: connector } : {};
|
|
239
|
+
}
|
|
240
|
+
export function aiSummarize(opts) {
|
|
241
|
+
if (opts.length == null || opts.length < 1) {
|
|
242
|
+
throw new Error("aiSummarize requires length ≥ 1 (the summary length in sentences).");
|
|
243
|
+
}
|
|
244
|
+
return {
|
|
245
|
+
key: "aiSummarize",
|
|
246
|
+
config: {
|
|
247
|
+
textToSummarize: serializeValueOrRef(opts.text),
|
|
248
|
+
...(opts.context !== undefined ? { context: serializeValueOrRef(opts.context) } : {}),
|
|
249
|
+
length: opts.length,
|
|
250
|
+
...connectorSlot(opts.connector),
|
|
251
|
+
},
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
export function aiTransform(opts) {
|
|
255
|
+
return {
|
|
256
|
+
key: "aiTransform",
|
|
257
|
+
config: {
|
|
258
|
+
prompt: serializeValueOrRef(opts.prompt),
|
|
259
|
+
fieldType: opts.fieldType,
|
|
260
|
+
...connectorSlot(opts.connector),
|
|
261
|
+
},
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
export function aiEmailAnalysis(opts) {
|
|
265
|
+
return {
|
|
266
|
+
key: "aiEmailAnalysis",
|
|
267
|
+
config: {
|
|
268
|
+
emailBody: serializeValueOrRef(opts.emailBody),
|
|
269
|
+
emailSubject: serializeValueOrRef(opts.emailSubject),
|
|
270
|
+
...connectorSlot(opts.connector),
|
|
271
|
+
},
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
export function aiFileAnalysis(opts) {
|
|
275
|
+
return {
|
|
276
|
+
key: "aiFileAnalysis",
|
|
277
|
+
config: {
|
|
278
|
+
attachmentId: serializeValueOrRef(opts.attachmentId),
|
|
279
|
+
documentModelId: opts.documentModel,
|
|
280
|
+
...connectorSlot(opts.connector),
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
function aiClassifyCategorySource(src) {
|
|
285
|
+
if (src.type === "static") {
|
|
286
|
+
return {
|
|
287
|
+
static: {
|
|
288
|
+
categories: src.categories.map((c) => ({
|
|
289
|
+
name: serializeValueOrRef(c.name),
|
|
290
|
+
...(c.description !== undefined ? { description: serializeValueOrRef(c.description) } : {}),
|
|
291
|
+
})),
|
|
292
|
+
},
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
return {
|
|
296
|
+
dynamic: {
|
|
297
|
+
aspectId: src.app,
|
|
298
|
+
labelFieldId: src.labelField,
|
|
299
|
+
...(src.descriptionField !== undefined ? { descriptionFieldId: src.descriptionField } : {}),
|
|
300
|
+
...(src.filter !== undefined ? { filter: src.filter } : {}),
|
|
301
|
+
...(src.limit !== undefined ? { limit: src.limit } : {}),
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
export function aiClassify(opts) {
|
|
306
|
+
if (opts.categorySource.type === "static" && opts.categorySource.categories.length === 0) {
|
|
307
|
+
throw new Error("aiClassify static categorySource requires at least one category.");
|
|
308
|
+
}
|
|
309
|
+
return {
|
|
310
|
+
key: "aiClassify",
|
|
311
|
+
config: {
|
|
312
|
+
textToClassify: serializeValueOrRef(opts.text),
|
|
313
|
+
categorySource: aiClassifyCategorySource(opts.categorySource),
|
|
314
|
+
...(opts.context !== undefined ? { context: serializeValueOrRef(opts.context) } : {}),
|
|
315
|
+
...connectorSlot(opts.connector),
|
|
316
|
+
},
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
export function notification(opts) {
|
|
320
|
+
if (!opts.userIds?.length &&
|
|
321
|
+
!opts.groupIds?.length &&
|
|
322
|
+
!opts.userRefs?.length &&
|
|
323
|
+
!opts.groupRefs?.length &&
|
|
324
|
+
!opts.notifyWatchers) {
|
|
325
|
+
throw new Error("notification requires at least one recipient (userIds, groupIds, userRefs, groupRefs, or notifyWatchers).");
|
|
326
|
+
}
|
|
327
|
+
return {
|
|
328
|
+
key: "notification",
|
|
329
|
+
config: {
|
|
330
|
+
titleReference: serializeValueOrRef(opts.title),
|
|
331
|
+
messageReference: serializeValueOrRef(opts.message),
|
|
332
|
+
...(opts.description !== undefined ? { description: opts.description } : {}),
|
|
333
|
+
...(opts.userIds?.length ? { userIds: opts.userIds } : {}),
|
|
334
|
+
...(opts.groupIds?.length ? { groupIds: opts.groupIds } : {}),
|
|
335
|
+
...(opts.userRefs !== undefined ? { userValueReferences: refList(opts.userRefs) } : {}),
|
|
336
|
+
...(opts.groupRefs !== undefined ? { groupValueReferences: refList(opts.groupRefs) } : {}),
|
|
337
|
+
...(opts.notifyWatchers !== undefined ? { notifyWatchers: opts.notifyWatchers } : {}),
|
|
338
|
+
},
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
export function filterTask(opts) {
|
|
342
|
+
return { key: "filter", config: { filter: opts.condition } };
|
|
343
|
+
}
|
|
344
|
+
export function assignUser(opts) {
|
|
345
|
+
return { key: "assignUser", config: { fieldId: opts.field, userId: opts.userId } };
|
|
346
|
+
}
|
|
347
|
+
export function assignGroup(opts) {
|
|
348
|
+
return { key: "assignGroup", config: { fieldId: opts.field, groupId: opts.groupId } };
|
|
349
|
+
}
|
|
350
|
+
export function addWatcher(opts) {
|
|
351
|
+
if (!opts.userIds?.length && !opts.groupIds?.length && !opts.userRefs?.length && !opts.groupRefs?.length) {
|
|
352
|
+
throw new Error("addWatcher requires at least one of: userIds, groupIds, userRefs, groupRefs.");
|
|
353
|
+
}
|
|
354
|
+
return {
|
|
355
|
+
key: "addWatcher",
|
|
356
|
+
config: {
|
|
357
|
+
...(opts.userIds?.length ? { userIds: opts.userIds } : {}),
|
|
358
|
+
...(opts.groupIds?.length ? { groupIds: opts.groupIds } : {}),
|
|
359
|
+
...(opts.userRefs !== undefined ? { userValueReferences: refList(opts.userRefs) } : {}),
|
|
360
|
+
...(opts.groupRefs !== undefined ? { groupValueReferences: refList(opts.groupRefs) } : {}),
|
|
361
|
+
...(opts.record !== undefined ? { recordReference: serializeValueOrRef(opts.record) } : {}),
|
|
362
|
+
},
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
export function recordFieldLocking(opts) {
|
|
366
|
+
if (!opts.fieldsToLock?.length && !opts.fieldsToUnlock?.length) {
|
|
367
|
+
throw new Error("recordFieldLocking requires at least one of: fieldsToLock, fieldsToUnlock.");
|
|
368
|
+
}
|
|
369
|
+
return {
|
|
370
|
+
key: "aspectRecordFieldLocking",
|
|
371
|
+
config: {
|
|
372
|
+
aspectId: opts.app,
|
|
373
|
+
recordId: serializeValueOrRef(opts.record),
|
|
374
|
+
...(opts.fieldsToLock !== undefined ? { fieldsToLock: opts.fieldsToLock } : {}),
|
|
375
|
+
...(opts.fieldsToUnlock !== undefined ? { fieldsToUnlock: opts.fieldsToUnlock } : {}),
|
|
376
|
+
},
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
export function userSearch(opts) {
|
|
380
|
+
return { key: "userSearch", config: { filter: opts.filter } };
|
|
381
|
+
}
|
|
382
|
+
export function userGroupSearch(opts) {
|
|
383
|
+
return { key: "userGroupSearch", config: { filter: opts.filter } };
|
|
384
|
+
}
|
|
385
|
+
export function saveAttachment(opts) {
|
|
386
|
+
return {
|
|
387
|
+
key: "saveAttachment",
|
|
388
|
+
config: {
|
|
389
|
+
recordId: serializeValueOrRef(opts.record),
|
|
390
|
+
fileInput: { file: serializeValueOrRef(opts.file) },
|
|
391
|
+
...(opts.tag !== undefined ? { tag: serializeValueOrRef(opts.tag) } : {}),
|
|
392
|
+
...(opts.viewState !== undefined ? { viewState: opts.viewState } : {}),
|
|
393
|
+
},
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
export function unzip(opts) {
|
|
397
|
+
return { key: "unzip", config: { file: serializeValueOrRef(opts.file) } };
|
|
398
|
+
}
|
|
399
|
+
export function generateReport(opts) {
|
|
400
|
+
return {
|
|
401
|
+
key: "aspectAppReportGeneration",
|
|
402
|
+
config: {
|
|
403
|
+
recordReference: serializeValueOrRef(opts.record),
|
|
404
|
+
reportId: opts.reportId,
|
|
405
|
+
reportType: opts.reportType,
|
|
406
|
+
},
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
export function postTeamsMessage(opts) {
|
|
410
|
+
return {
|
|
411
|
+
key: "postTeamsMessage",
|
|
412
|
+
config: {
|
|
413
|
+
webhookUrl: opts.webhookUrl,
|
|
414
|
+
contents: serializeValueOrRef(opts.contents),
|
|
415
|
+
title: serializeValueOrRef(opts.title),
|
|
416
|
+
subtitle: serializeValueOrRef(opts.subtitle),
|
|
417
|
+
...(opts.recordUrl !== undefined ? { recordUrl: serializeValueOrRef(opts.recordUrl) } : {}),
|
|
418
|
+
...(opts.recordButtonText !== undefined
|
|
419
|
+
? { recordButtonText: serializeValueOrRef(opts.recordButtonText) }
|
|
420
|
+
: {}),
|
|
421
|
+
},
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
export function assignmentEngine(opts) {
|
|
425
|
+
return {
|
|
426
|
+
key: "assignmentEngine",
|
|
427
|
+
config: {
|
|
428
|
+
assignmentEngineId: opts.assignmentEngineId,
|
|
429
|
+
recordReference: serializeValueOrRef(opts.record),
|
|
430
|
+
},
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
export function procedure(opts) {
|
|
434
|
+
return {
|
|
435
|
+
key: "procedure",
|
|
436
|
+
config: {
|
|
437
|
+
procedureId: opts.procedureId,
|
|
438
|
+
cloudLinkId: opts.cloudLinkId,
|
|
439
|
+
parameters: (opts.parameters ?? []).map((v, index) => ({ index, value: serializeValueOrRef(v) })),
|
|
440
|
+
},
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
export function initiateCall(opts) {
|
|
444
|
+
return {
|
|
445
|
+
key: "initiateCall",
|
|
446
|
+
config: {
|
|
447
|
+
agentId: opts.agent,
|
|
448
|
+
phoneServiceId: opts.phoneServiceId,
|
|
449
|
+
phoneNumber: serializeValueOrRef(opts.phoneNumber),
|
|
450
|
+
recordId: serializeValueOrRef(opts.record),
|
|
451
|
+
defaultLanguage: serializeValueOrRef(opts.language),
|
|
452
|
+
firstMessage: serializeValueOrRef(opts.firstMessage),
|
|
453
|
+
...(opts.context !== undefined ? { context: serializeValueOrRef(opts.context) } : {}),
|
|
454
|
+
},
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* `calculation`'s write-side template parameters use the normal nested
|
|
459
|
+
* parameter envelope, but the parameter type is carried inside that nested
|
|
460
|
+
* value. Re-shape just for this task rather than changing the shared
|
|
461
|
+
* serializer, since other tasks apply with the generic `{ value: { name,
|
|
462
|
+
* value } }` form.
|
|
463
|
+
*/
|
|
464
|
+
function calculationTemplateParameters(parameters) {
|
|
465
|
+
return parameters.map((p) => p.value
|
|
466
|
+
? { value: { name: p.value.name, value: p.value.value, type: "VALUE_PARAMETER" } }
|
|
467
|
+
: p.list
|
|
468
|
+
? {
|
|
469
|
+
value: {
|
|
470
|
+
name: p.list.name,
|
|
471
|
+
value: p.list.value,
|
|
472
|
+
type: "LIST_PARAMETER",
|
|
473
|
+
parameters: calculationTemplateParameters(p.list.parameters),
|
|
474
|
+
},
|
|
475
|
+
}
|
|
476
|
+
: p);
|
|
477
|
+
}
|
|
478
|
+
export function calculation(opts) {
|
|
479
|
+
if (opts.calculations.length === 0)
|
|
480
|
+
throw new Error("calculation requires at least one calculation entry.");
|
|
481
|
+
const names = new Set();
|
|
482
|
+
for (const c of opts.calculations) {
|
|
483
|
+
if (names.has(c.name))
|
|
484
|
+
throw new Error(`calculation entry names must be unique — duplicate "${c.name}".`);
|
|
485
|
+
names.add(c.name);
|
|
486
|
+
}
|
|
487
|
+
// The write-side input type is `WorkflowCalculationInput` (backend record:
|
|
488
|
+
// `id`, `name`, `recordId`, `calculationReference`, `includeTypes`) sent as
|
|
489
|
+
// a flat `calculation: { calculations: [...] }` array — not the
|
|
490
|
+
// GET-response-shaped `calculationInputMap` dictionary (keyed by entry id,
|
|
491
|
+
// nested under `calculationInput`, carrying `textWithIds`/`parameters`/
|
|
492
|
+
// `outputType`/`multiple`/`referencedFields`) this used to mirror. Sending
|
|
493
|
+
// the GET shape back on create/update 500s server-side with no
|
|
494
|
+
// field-level error, because it isn't what the write mutation's input type
|
|
495
|
+
// actually accepts. `id` is server-assigned and simply omitted from the
|
|
496
|
+
// entry when authoring new (mirrors {@link VariableDecl.id}).
|
|
497
|
+
const calculations = [];
|
|
498
|
+
for (const c of opts.calculations) {
|
|
499
|
+
const rawCalculationReference = serializeValueOrRef(c.expression);
|
|
500
|
+
// The calc engine always expects `calculationReference` to be a
|
|
501
|
+
// `templateReference`, even for one trivial reference — confirmed via a
|
|
502
|
+
// live GET dump and the CALCULATION test fixture, both of which show a
|
|
503
|
+
// bare single-field expression stored as `template: "{{{p1}}}"` with one
|
|
504
|
+
// parameter. `expression: ctx.trigger.record["..."]` (no `template(...)`
|
|
505
|
+
// wrapping) serializes to a bare `{ triggerReference: {...} }` with no
|
|
506
|
+
// `templateReference` at all — the calc engine 500s on that (no
|
|
507
|
+
// field-level detail). Normalize any non-template expression into that
|
|
508
|
+
// trivial single-placeholder form.
|
|
509
|
+
const calculationReference = rawCalculationReference.templateReference
|
|
510
|
+
? rawCalculationReference
|
|
511
|
+
: {
|
|
512
|
+
templateReference: {
|
|
513
|
+
template: "{{{p1}}}",
|
|
514
|
+
parameters: [{ value: { name: "p1", value: rawCalculationReference } }],
|
|
515
|
+
},
|
|
516
|
+
};
|
|
517
|
+
// `calculationReference.templateReference.parameters` needs `type` inside
|
|
518
|
+
// the nested parameter value — re-shape a copy rather than mutating the
|
|
519
|
+
// generic serializer's output.
|
|
520
|
+
const templateReference = calculationReference.templateReference;
|
|
521
|
+
const wireCalculationReference = {
|
|
522
|
+
...calculationReference,
|
|
523
|
+
templateReference: {
|
|
524
|
+
...templateReference,
|
|
525
|
+
parameters: calculationTemplateParameters(templateReference.parameters),
|
|
526
|
+
},
|
|
527
|
+
};
|
|
528
|
+
calculations.push({
|
|
529
|
+
...(c.id !== undefined ? { id: c.id } : {}),
|
|
530
|
+
name: c.name,
|
|
531
|
+
recordId: c.record !== undefined ? serializeValueOrRef(c.record) : null,
|
|
532
|
+
calculationReference: wireCalculationReference,
|
|
533
|
+
includeTypes: [],
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
return {
|
|
537
|
+
key: "calculation",
|
|
538
|
+
config: { calculations },
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
export function approvalStatusUpdate(opts) {
|
|
542
|
+
return {
|
|
543
|
+
key: "approvalStatusUpdate",
|
|
544
|
+
config: {
|
|
545
|
+
approvalChainTemplateId: opts.approvalChainTemplateId,
|
|
546
|
+
recordId: serializeValueOrRef(opts.record),
|
|
547
|
+
status: opts.status,
|
|
548
|
+
...(opts.reason !== undefined ? { reason: serializeValueOrRef(opts.reason) } : {}),
|
|
549
|
+
...(opts.tags !== undefined ? { tags: serializeValueOrRef(opts.tags) } : {}),
|
|
550
|
+
},
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
export function runAutomation(opts) {
|
|
554
|
+
const hasInputs = (opts.inputs?.length ?? 0) > 0;
|
|
555
|
+
const common = {
|
|
556
|
+
synchronous: opts.synchronous ?? false,
|
|
557
|
+
inputMappings: [],
|
|
558
|
+
dynamicInputMappings: hasInputs
|
|
559
|
+
? opts.inputs.map((i) => ({ name: i.name, value: serializeValueOrRef(i.value) }))
|
|
560
|
+
: [],
|
|
561
|
+
outputMappings: (opts.outputs ?? []).map((name) => ({ name })),
|
|
562
|
+
};
|
|
563
|
+
return {
|
|
564
|
+
key: "runAutomation",
|
|
565
|
+
config: hasInputs
|
|
566
|
+
? { targetAutomationRef: { type: "STATIC", value: opts.automation }, ...common }
|
|
567
|
+
: { targetAutomationId: opts.automation, ...common },
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
export function readFile(opts) {
|
|
571
|
+
return {
|
|
572
|
+
key: "documentModel",
|
|
573
|
+
config: {
|
|
574
|
+
documentModelId: opts.fileReader,
|
|
575
|
+
...(opts.record !== undefined ? { recordId: serializeValueOrRef(opts.record) } : {}),
|
|
576
|
+
documentModelDataSource: { [opts.dataSource.type]: serializeValueOrRef(opts.dataSource.value) },
|
|
577
|
+
},
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
export function bulkExcel(opts) {
|
|
581
|
+
if (opts.fieldMappings.length === 0)
|
|
582
|
+
throw new Error("bulkExcel requires at least one fieldMapping.");
|
|
583
|
+
return {
|
|
584
|
+
key: "bulkExcel",
|
|
585
|
+
config: {
|
|
586
|
+
attachmentId: serializeValueOrRef(opts.attachmentId),
|
|
587
|
+
documentModelId: opts.documentModel,
|
|
588
|
+
aspectId: opts.app,
|
|
589
|
+
aspectType: opts.aspectType,
|
|
590
|
+
...(opts.strict !== undefined ? { strict: opts.strict } : {}),
|
|
591
|
+
fieldMappings: opts.fieldMappings.map((m) => ({
|
|
592
|
+
aspectFieldId: m.field,
|
|
593
|
+
fieldMappingInput: m.source.type === "documentModelField"
|
|
594
|
+
? { documentModelFieldId: m.source.field }
|
|
595
|
+
: { valueReference: serializeValueOrRef(m.source.value) },
|
|
596
|
+
})),
|
|
597
|
+
},
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
export function approvalChain(opts) {
|
|
601
|
+
if (!opts.approverIds?.length && !opts.approvers?.length) {
|
|
602
|
+
throw new Error("approvalChain requires at least one approverId or approver.");
|
|
603
|
+
}
|
|
604
|
+
return {
|
|
605
|
+
key: "approvalChain",
|
|
606
|
+
config: {
|
|
607
|
+
...(opts.approverIds !== undefined ? { approverIds: opts.approverIds } : {}),
|
|
608
|
+
...(opts.approvers !== undefined ? { approvers: opts.approvers.map((a) => serializeValueOrRef(a)) } : {}),
|
|
609
|
+
...(opts.reason !== undefined ? { reason: serializeValueOrRef(opts.reason) } : {}),
|
|
610
|
+
...(opts.summary !== undefined ? { summary: serializeValueOrRef(opts.summary) } : {}),
|
|
611
|
+
},
|
|
612
|
+
};
|
|
613
|
+
}
|
|
614
|
+
export function approvalChainTemplate(opts) {
|
|
615
|
+
return {
|
|
616
|
+
key: "approvalChainTemplate",
|
|
617
|
+
config: {
|
|
618
|
+
approvalChainTemplateId: opts.approvalChainTemplateId,
|
|
619
|
+
requesterId: serializeValueOrRef(opts.requester),
|
|
620
|
+
recordId: serializeValueOrRef(opts.record),
|
|
621
|
+
...(opts.summary !== undefined ? { summary: serializeValueOrRef(opts.summary) } : {}),
|
|
622
|
+
...(opts.reason !== undefined ? { reason: serializeValueOrRef(opts.reason) } : {}),
|
|
623
|
+
...(opts.relatedRecord !== undefined ? { relatedRecordId: serializeValueOrRef(opts.relatedRecord) } : {}),
|
|
624
|
+
...(opts.tags !== undefined ? { tags: serializeValueOrRef(opts.tags) } : {}),
|
|
625
|
+
...(opts.dynamicApprovers !== undefined ? { dynamicApprovers: opts.dynamicApprovers } : {}),
|
|
626
|
+
},
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
export function sendSurvey(opts) {
|
|
630
|
+
if (!opts.userIds?.length && !opts.groupIds?.length) {
|
|
631
|
+
throw new Error("sendSurvey requires at least one recipient (userIds or groupIds).");
|
|
632
|
+
}
|
|
633
|
+
return {
|
|
634
|
+
key: "sendSurvey",
|
|
635
|
+
config: {
|
|
636
|
+
recordId: serializeValueOrRef(opts.record),
|
|
637
|
+
surveyTemplateId: serializeValueOrRef(opts.surveyTemplateId),
|
|
638
|
+
expirationDate: serializeValueOrRef(opts.expirationDate),
|
|
639
|
+
dueDate: serializeValueOrRef(opts.dueDate),
|
|
640
|
+
reminderDate: serializeValueOrRef(opts.reminderDate),
|
|
641
|
+
emailSubject: serializeValueOrRef(opts.emailSubject),
|
|
642
|
+
instructions: serializeValueOrRef(opts.instructions),
|
|
643
|
+
...(opts.attachmentIds !== undefined ? { attachmentIds: refList(opts.attachmentIds) } : {}),
|
|
644
|
+
...(opts.userIds !== undefined ? { userIds: refList(opts.userIds) } : {}),
|
|
645
|
+
...(opts.groupIds !== undefined ? { groupIds: refList(opts.groupIds) } : {}),
|
|
646
|
+
},
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
function serializeFirstEmail(fe) {
|
|
650
|
+
return {
|
|
651
|
+
...(fe.context !== undefined ? { context: serializeValueOrRef(fe.context) } : {}),
|
|
652
|
+
...(fe.contextEvaluationInstructions !== undefined
|
|
653
|
+
? { contextEvaluationInstructions: serializeValueOrRef(fe.contextEvaluationInstructions) }
|
|
654
|
+
: {}),
|
|
655
|
+
firstMessage: {
|
|
656
|
+
...(fe.firstMessage.firstEmailMessage !== undefined
|
|
657
|
+
? { firstEmailMessage: serializeValueOrRef(fe.firstMessage.firstEmailMessage) }
|
|
658
|
+
: {}),
|
|
659
|
+
...(fe.firstMessage.firstEmailMessageGenerationInstructions !== undefined
|
|
660
|
+
? {
|
|
661
|
+
firstEmailMessageGenerationInstructions: serializeValueOrRef(fe.firstMessage.firstEmailMessageGenerationInstructions),
|
|
662
|
+
}
|
|
663
|
+
: {}),
|
|
664
|
+
},
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
export function initiateEmailConversation(opts) {
|
|
668
|
+
return {
|
|
669
|
+
key: "initiateEmailConversation",
|
|
670
|
+
config: {
|
|
671
|
+
agentId: opts.agent,
|
|
672
|
+
emailAliasId: opts.emailAliasId,
|
|
673
|
+
emailAddress: serializeValueOrRef(opts.emailAddress),
|
|
674
|
+
...(opts.emailName !== undefined ? { emailName: serializeValueOrRef(opts.emailName) } : {}),
|
|
675
|
+
recordId: serializeValueOrRef(opts.record),
|
|
676
|
+
...(opts.subjectGenerationInstructions !== undefined
|
|
677
|
+
? { subjectGenerationInstructions: serializeValueOrRef(opts.subjectGenerationInstructions) }
|
|
678
|
+
: {}),
|
|
679
|
+
...(opts.inactivityDeadline !== undefined ? { inactivityDeadline: opts.inactivityDeadline } : {}),
|
|
680
|
+
...(opts.firstEmail !== undefined ? { firstEmail: serializeFirstEmail(opts.firstEmail) } : {}),
|
|
681
|
+
...(opts.emailAddressFieldId !== undefined
|
|
682
|
+
? { emailAddressFieldId: serializeValueOrRef(opts.emailAddressFieldId) }
|
|
683
|
+
: {}),
|
|
684
|
+
...(opts.emailNameFieldId !== undefined
|
|
685
|
+
? { emailNameFieldId: serializeValueOrRef(opts.emailNameFieldId) }
|
|
686
|
+
: {}),
|
|
687
|
+
...(opts.summaryFieldId !== undefined ? { summaryFieldId: serializeValueOrRef(opts.summaryFieldId) } : {}),
|
|
688
|
+
...(opts.summaryPrompt !== undefined ? { summaryPrompt: serializeValueOrRef(opts.summaryPrompt) } : {}),
|
|
689
|
+
...(opts.evaluationFieldId !== undefined
|
|
690
|
+
? { evaluationFieldId: serializeValueOrRef(opts.evaluationFieldId) }
|
|
691
|
+
: {}),
|
|
692
|
+
...(opts.evaluationPrompt !== undefined
|
|
693
|
+
? { evaluationPrompt: serializeValueOrRef(opts.evaluationPrompt) }
|
|
694
|
+
: {}),
|
|
695
|
+
},
|
|
696
|
+
};
|
|
697
|
+
}
|