@elementumai/edk 0.12.0 → 0.13.0
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 +2 -0
- package/dist-sdk/src/catalog/factories.d.ts +7 -1
- package/dist-sdk/src/catalog/factories.js +2 -0
- package/dist-sdk/src/catalog/index.d.ts +2 -2
- package/dist-sdk/src/catalog/index.js +1 -1
- package/dist-sdk/src/catalog/org.js +79 -34
- package/dist-sdk/src/catalog/token.js +5 -0
- package/dist-sdk/src/catalog/types.d.ts +7 -1
- package/dist-sdk/src/catalog/types.js +3 -0
- package/dist-sdk/src/core/system-fields.d.ts +1 -1
- package/dist-sdk/src/core/system-fields.js +1 -1
- package/dist-sdk/src/core/types/app.d.ts +6 -0
- package/dist-sdk/src/engine/build/context.d.ts +3 -0
- package/dist-sdk/src/engine/pull/authored-address.js +42 -6
- package/dist-sdk/src/engine/pull/authored-root.d.ts +88 -0
- package/dist-sdk/src/engine/pull/authored-root.js +306 -0
- package/dist-sdk/src/engine/pull/context.d.ts +10 -0
- package/dist-sdk/src/engine/pull/field-refs-registry.d.ts +114 -0
- package/dist-sdk/src/engine/pull/field-refs-registry.js +501 -0
- package/dist-sdk/src/engine/pull/org.d.ts +1 -0
- package/dist-sdk/src/engine/pull/org.js +2 -0
- package/dist-sdk/src/engine/pull/partition.d.ts +8 -0
- package/dist-sdk/src/engine/pull/partition.js +43 -0
- package/dist-sdk/src/engine/pull/pulled-roots.d.ts +89 -0
- package/dist-sdk/src/engine/pull/pulled-roots.js +203 -0
- package/dist-sdk/src/engine/pull/ref-only.d.ts +4 -0
- package/dist-sdk/src/engine/pull/ref-only.js +7 -1
- package/dist-sdk/src/engine/pull/source-resources.d.ts +39 -0
- package/dist-sdk/src/engine/pull/source-resources.js +110 -0
- package/dist-sdk/src/engine/pull/stream-root.d.ts +148 -0
- package/dist-sdk/src/engine/pull/stream-root.js +563 -0
- package/dist-sdk/src/engine/workspace/reserved-catalog-keys.d.ts +47 -0
- package/dist-sdk/src/engine/workspace/reserved-catalog-keys.js +115 -0
- package/dist-sdk/src/entities/access-policy/build.d.ts +2 -1
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +7 -0
- package/dist-sdk/src/entities/access-policy/from-tf.js +18 -3
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +19 -0
- package/dist-sdk/src/entities/access-policy/to-tf.js +65 -8
- package/dist-sdk/src/entities/agent/build.d.ts +52 -1
- package/dist-sdk/src/entities/agent/build.js +34 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +68 -0
- package/dist-sdk/src/entities/agent/from-tf.d.ts +34 -1
- package/dist-sdk/src/entities/agent/from-tf.js +262 -2
- package/dist-sdk/src/entities/agent/index.d.ts +1 -1
- package/dist-sdk/src/entities/agent/to-tf.d.ts +8 -10
- package/dist-sdk/src/entities/agent/to-tf.js +158 -14
- package/dist-sdk/src/entities/agent-tool/from-tf.js +6 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +2 -2
- package/dist-sdk/src/entities/agent-tool/to-tf.js +2 -2
- package/dist-sdk/src/entities/app/build.d.ts +33 -13
- package/dist-sdk/src/entities/app/build.js +14 -12
- package/dist-sdk/src/entities/app/from-tf.js +24 -9
- package/dist-sdk/src/entities/app/index.d.ts +1 -0
- package/dist-sdk/src/entities/app/index.js +1 -0
- package/dist-sdk/src/entities/app/module.js +1 -0
- package/dist-sdk/src/entities/app/stage-keys.d.ts +2 -2
- package/dist-sdk/src/entities/app/stage-keys.js +3 -3
- package/dist-sdk/src/entities/app/to-tf.js +1 -0
- package/dist-sdk/src/entities/approval-chain/build.d.ts +46 -11
- package/dist-sdk/src/entities/approval-chain/build.js +120 -8
- package/dist-sdk/src/entities/approval-chain/from-tf.d.ts +24 -2
- package/dist-sdk/src/entities/approval-chain/from-tf.js +148 -6
- package/dist-sdk/src/entities/approval-chain/index.d.ts +4 -1
- package/dist-sdk/src/entities/approval-chain/index.js +4 -1
- package/dist-sdk/src/entities/approval-chain/module.js +23 -5
- package/dist-sdk/src/entities/approval-chain/printer.d.ts +1 -1
- package/dist-sdk/src/entities/approval-chain/printer.js +91 -5
- package/dist-sdk/src/entities/approval-chain/steps-tf.d.ts +77 -0
- package/dist-sdk/src/entities/approval-chain/steps-tf.js +255 -0
- package/dist-sdk/src/entities/approval-chain/steps.d.ts +71 -0
- package/dist-sdk/src/entities/approval-chain/steps.js +83 -0
- package/dist-sdk/src/entities/approval-chain/to-tf.d.ts +16 -6
- package/dist-sdk/src/entities/approval-chain/to-tf.js +37 -4
- package/dist-sdk/src/entities/automation/build.js +70 -27
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +20 -5
- package/dist-sdk/src/entities/automation/from-tf.d.ts +26 -5
- package/dist-sdk/src/entities/automation/from-tf.js +593 -101
- package/dist-sdk/src/entities/automation/index.d.ts +1 -0
- package/dist-sdk/src/entities/automation/index.js +1 -0
- package/dist-sdk/src/entities/automation/module.d.ts +4 -3
- package/dist-sdk/src/entities/automation/module.js +33 -12
- package/dist-sdk/src/entities/automation/refs-read.d.ts +19 -0
- package/dist-sdk/src/entities/automation/refs-read.js +48 -0
- package/dist-sdk/src/entities/automation/slack-message-refs.d.ts +9 -0
- package/dist-sdk/src/entities/automation/slack-message-refs.js +75 -0
- package/dist-sdk/src/entities/automation/task-output-labels.d.ts +11 -0
- package/dist-sdk/src/entities/automation/task-output-labels.js +23 -0
- package/dist-sdk/src/entities/automation/tasks.d.ts +29 -4
- package/dist-sdk/src/entities/automation/tasks.js +34 -11
- package/dist-sdk/src/entities/automation/to-tf.d.ts +3 -0
- package/dist-sdk/src/entities/automation/to-tf.js +337 -77
- package/dist-sdk/src/entities/automation/triggers.d.ts +0 -8
- package/dist-sdk/src/entities/automation/triggers.js +26 -11
- package/dist-sdk/src/entities/automation/unsafe-script-output.d.ts +50 -0
- package/dist-sdk/src/entities/automation/unsafe-script-output.js +92 -0
- package/dist-sdk/src/entities/chart/build.d.ts +9 -1
- package/dist-sdk/src/entities/chart/from-tf.js +3 -0
- package/dist-sdk/src/entities/chart/to-tf.js +19 -2
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +2 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.js +44 -5
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +46 -12
- package/dist-sdk/src/entities/element/audit-field-guard.d.ts +9 -0
- package/dist-sdk/src/entities/element/audit-field-guard.js +88 -0
- package/dist-sdk/src/entities/element/build.js +2 -1
- package/dist-sdk/src/entities/element/from-tf.js +15 -2
- package/dist-sdk/src/entities/element/module.js +3 -0
- package/dist-sdk/src/entities/element/system-fields.d.ts +13 -0
- package/dist-sdk/src/entities/element/system-fields.js +23 -0
- package/dist-sdk/src/entities/element/to-tf.js +1 -0
- package/dist-sdk/src/entities/field/build.d.ts +9 -0
- package/dist-sdk/src/entities/field/from-tf.d.ts +29 -1
- package/dist-sdk/src/entities/field/from-tf.js +99 -6
- package/dist-sdk/src/entities/field/module.js +4 -0
- package/dist-sdk/src/entities/field/to-tf.d.ts +5 -1
- package/dist-sdk/src/entities/field/to-tf.js +33 -12
- package/dist-sdk/src/entities/org/category.js +1 -0
- package/dist-sdk/src/entities/org/index.d.ts +1 -0
- package/dist-sdk/src/entities/org/index.js +1 -0
- package/dist-sdk/src/entities/org/voice-auth.d.ts +5 -0
- package/dist-sdk/src/entities/org/voice-auth.js +33 -0
- package/dist-sdk/src/entities/organization/build.d.ts +3 -0
- package/dist-sdk/src/entities/organization/build.js +2 -0
- package/dist-sdk/src/entities/organization/index.d.ts +1 -0
- package/dist-sdk/src/entities/organization/index.js +1 -0
- package/dist-sdk/src/entities/organization/to-tf.d.ts +2 -0
- package/dist-sdk/src/entities/organization/to-tf.js +59 -1
- package/dist-sdk/src/entities/organization/voice-auth.d.ts +60 -0
- package/dist-sdk/src/entities/organization/voice-auth.js +60 -0
- package/dist-sdk/src/entities/phone-service/build.d.ts +9 -1
- package/dist-sdk/src/entities/phone-service/build.js +1 -0
- package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.js +3 -0
- package/dist-sdk/src/entities/phone-service/from-tf.d.ts +1 -0
- package/dist-sdk/src/entities/phone-service/from-tf.js +8 -1
- package/dist-sdk/src/entities/phone-service/to-tf.js +16 -0
- package/dist-sdk/src/entities/record-create-form/from-tf.js +2 -2
- package/dist-sdk/src/entities/relationship/from-tf.js +7 -2
- package/dist-sdk/src/entities/relationship/module.js +2 -2
- package/dist-sdk/src/entities/relationship/pair-check.d.ts +6 -2
- package/dist-sdk/src/entities/relationship/pair-check.js +105 -18
- package/dist-sdk/src/entities/relationship/to-tf.js +5 -2
- package/dist-sdk/src/entities/role/permission-levels.d.ts +7 -0
- package/dist-sdk/src/entities/role/permission-levels.js +78 -0
- package/dist-sdk/src/entities/role/to-tf.js +32 -2
- package/dist-sdk/src/entities/service-account/module.d.ts +2 -1
- package/dist-sdk/src/entities/service-account/module.js +4 -1
- package/dist-sdk/src/entities/service-account/resource-type.d.ts +2 -0
- package/dist-sdk/src/entities/service-account/resource-type.js +2 -0
- package/dist-sdk/src/entities/service-account/role-membership-check.d.ts +20 -0
- package/dist-sdk/src/entities/service-account/role-membership-check.js +80 -0
- package/dist-sdk/src/entities/shared/aspect-target-from-tf.d.ts +15 -0
- package/dist-sdk/src/entities/shared/aspect-target-from-tf.js +36 -0
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +2 -0
- package/dist-sdk/src/entities/shared/filters/index.d.ts +85 -14
- package/dist-sdk/src/entities/shared/filters/index.js +18 -6
- package/dist-sdk/src/entities/shared/filters/option-lookups.d.ts +57 -0
- package/dist-sdk/src/entities/shared/filters/option-lookups.js +108 -0
- package/dist-sdk/src/entities/shared/filters/print.js +9 -5
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +12 -7
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +9 -5
- package/dist-sdk/src/entities/shared/raw-option-id.d.ts +30 -0
- package/dist-sdk/src/entities/shared/raw-option-id.js +41 -0
- package/dist-sdk/src/entities/shared/tool-field-ref.js +6 -2
- package/dist-sdk/src/entities/skill/input-coverage.js +5 -2
- package/dist-sdk/src/entities/sla/build.d.ts +96 -0
- package/dist-sdk/src/entities/sla/build.js +124 -0
- package/dist-sdk/src/entities/sla/from-tf.d.ts +40 -0
- package/dist-sdk/src/entities/sla/from-tf.js +164 -0
- package/dist-sdk/src/entities/sla/index.d.ts +1 -0
- package/dist-sdk/src/entities/sla/index.js +1 -0
- package/dist-sdk/src/entities/sla/module.d.ts +4 -0
- package/dist-sdk/src/entities/sla/module.js +73 -0
- package/dist-sdk/src/entities/sla/printer.d.ts +2 -0
- package/dist-sdk/src/entities/sla/printer.js +84 -0
- package/dist-sdk/src/entities/sla/to-tf.d.ts +12 -0
- package/dist-sdk/src/entities/sla/to-tf.js +81 -0
- package/dist-sdk/src/entities/table/build.d.ts +7 -2
- package/dist-sdk/src/entities/table/build.js +22 -1
- package/dist-sdk/src/entities/table/deserializer/normalize.d.ts +4 -1
- package/dist-sdk/src/entities/table/from-tf.js +89 -14
- package/dist-sdk/src/entities/table/index.d.ts +1 -1
- package/dist-sdk/src/entities/table/to-tf.js +41 -2
- package/dist-sdk/src/entities/task/from-tf.js +2 -1
- package/dist-sdk/src/entities/view/from-tf.js +7 -4
- package/dist-sdk/src/entities/widget/from-tf.js +13 -2
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +49 -4
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
- package/dist-sdk/src/graph/index.d.ts +5 -0
- package/dist-sdk/src/graph/index.js +7 -0
- package/dist-sdk/src/graph/modules.js +11 -1
- package/dist-sdk/src/graph/resource-types.d.ts +47 -0
- package/dist-sdk/src/graph/resource-types.js +62 -0
- package/dist-sdk/src/graph/types.d.ts +78 -6
- package/package.json +6 -3
|
@@ -17,6 +17,7 @@ export { AUTOMATION_RESOURCE_TYPES, AUTOMATION_TASK_TYPES, AUTOMATION_TRIGGER_TY
|
|
|
17
17
|
export * as filter from "../shared/filters/index.js";
|
|
18
18
|
export { automationStatus, chainableTrigger, actions, automation, type ActionBuilder, type ActionChain, type ActionDef, type ActionOptions, type ActionSequenceDef, type ActionsStarted, type AutomationConfigured, type AutomationOptions, type AutomationStatus, type ForkJoinBranch, type ForkJoinBranchBuilder, type ForkJoinConfig, type ForEachBuilder, type ForEachConfig, type ForEachScope, type LoopScope, type NestedActionBuilder, type NestedActionChain, type NestedActionContext, type OperatorChild, type SwitchCase, type SwitchCaseBuilder, type SwitchConfig, type TriggerChain, type TriggerDef, type TriggerParamMeta } from "./build.js";
|
|
19
19
|
export { ScriptCodeError, scriptFile, type ScriptCodeFn, type ScriptFile, type ScriptInput } from "./script-code.js";
|
|
20
|
+
export { unsafeScriptOutput } from "./unsafe-script-output.js";
|
|
20
21
|
export { workflowOutput, workflowOutputType, type WorkflowOutputDeclaration, type WorkflowOutputType, } from "./workflow-output.js";
|
|
21
22
|
export { addWatcher, aiAgent, aiClassify, aiEmailAnalysis, aiFileAnalysis, aiSearchTable, aiSummarize, aiTransform, apiRequest, approvalChain, approvalChainTemplate, approvalStatusUpdate, requiredSecret, assignGroup, assignUser, assignmentEngine, bulkExcel, bulkUpdateFields, calculation, createRecord, executeScript, findRelatedRecords, generateReport, initiateCall, initiateEmailConversation, notification, postComment, postTeamsMessage, procedure, readFile, recordFieldLocking, recordSearch, relateRecords, runAutomation, saveAttachment, sendEmail, sendSurvey, setVariable, tableRecordsSearch, unzip, updateField, userGroupSearch, userSearch, withFieldMappings, type AddWatcherOptions, type AiAgentAttachment, type AiAgentOptions, type AiAgentOutput, type AiAgentOutputField, type AiAgentOutputFieldType, type AiClassifyCategorySource, type AiClassifyOptions, type AiClassifyStaticCategory, type AiEmailAnalysisOptions, type AiFileAnalysisOptions, type AiSearchTableOptions, type AiSearchTableOutput, type AiSummarizeOptions, type AiTransformOptions, type ApiRequestHeader, type ApiRequestOptions, type ApiRequestOutputs, type ApiResponseType, type ApprovalChainOptions, type RequiredSecret, type ApprovalChainTemplateOptions, type ApprovalStatusUpdateOptions, type ApprovalStatusUpdateStatus, type AssignGroupOptions, type AssignUserOptions, type AssignmentEngineOptions, type BulkExcelFieldMapping, type BulkExcelFieldSource, type BulkExcelOptions, type BulkUpdateFieldsOptions, type BulkUpdateFieldsOutput, type CalculationEntry, type CalculationExpression, type CalculationInclude, type CalculationOptions, type CalculationOutputs, type CalculationValueInput, type CalculationValueOptions, type CalculationValueOutputs, type CalculationValues, type CreateRecordOptions, type CreateRecordOutput, type EmailAttachment, type ExecuteScriptFieldMapping, type ExecuteScriptOptions, type ExecuteScriptOutput, type FieldAssignment, type FindRelatedRecordsOptions, type FindRelatedRecordsOutput, type GenerateReportOptions, type InitiateCallOptions, type InitiateEmailConversationOptions, type InitiateEmailFirstEmail, type LegacyCalculationOptions, type MultiSelectUpdateMode, type NotificationOptions, type StaticGroupRecipient, type StaticUserRecipient, type PostCommentOptions, type PostTeamsMessageOptions, type LegacyProcedureOptions, type ProcedureOptions, type TypedProcedureOptions, type ReadFileDataSource, type ReadFileOptions, type RecordFieldLockingOptions, type RecordId, type RecordReference, type RecordSearchOptions, type RecordSearchOutput, type RelateRecordsOptions, type RunAutomationInput, type RunAutomationDynamicReferenceOptions, type RunAutomationOptions, type RunAutomationStaticOptions, type SaveAttachmentOptions, type ScriptOutputProperties, type ScriptOutputScalarType, type ScriptOutputType, type ScriptOutputs, type SendEmailOptions, type SendSurveyOptions, type SetVariableOptions, type TableRecordsSearchOptions, type TableRecordsSearchOutput, type UnzipOptions, type UpdateFieldAssignment, type UpdateFieldOptions, type UserGroupSearchOptions, type UserGroupSearchOutput, type UserGroupShape, type UserSearchOptions, type VariableAssign, type VariableDecl } from "./tasks.js";
|
|
22
23
|
export { approvalProcessStatusUpdated, attachment, commentAdded, conversationEnd, dataMine, emailReceived, onDemand, recordCreated, recordUpdated, schedule, slackMessage, surveyResponseCreate, temporal, webHook, webhook, type AttachmentTriggerOptions, type AttachmentTriggerOutput, type CommentAddedTriggerOptions, type CommentAddedTriggerOutput, type ConversationEndConversationType, type ConversationEndTriggerOptions, type ConversationEndTriggerOutput, type DataMineTriggerOptions, type DataMineTriggerOutput, type EmailReceivedTriggerOptions, type EmailReceivedTriggerOutput, type RecordTriggerOptions, type RecordTriggerOutput, type ScheduleFrequency, type ScheduleTriggerOptions, type ScheduleTriggerOutput, type SlackMessageTriggerOutput, type SurveyResponseCreateTriggerOptions, type SurveyResponseCreateTriggerOutput, type TemporalTriggerOptions, type TemporalUnit, type WebhookTriggerOptions, type WebhookTriggerOutput, type Weekday, type approvalProcessStatusUpdatedStatus, type approvalProcessStatusUpdatedTriggerOptions } from "./triggers.js";
|
|
@@ -17,6 +17,7 @@ export { AUTOMATION_RESOURCE_TYPES, AUTOMATION_TASK_TYPES, AUTOMATION_TRIGGER_TY
|
|
|
17
17
|
export * as filter from "../shared/filters/index.js";
|
|
18
18
|
export { automationStatus, chainableTrigger, actions, automation } from "./build.js";
|
|
19
19
|
export { ScriptCodeError, scriptFile } from "./script-code.js";
|
|
20
|
+
export { unsafeScriptOutput } from "./unsafe-script-output.js";
|
|
20
21
|
export { workflowOutput, workflowOutputType, } from "./workflow-output.js";
|
|
21
22
|
export { addWatcher, aiAgent, aiClassify, aiEmailAnalysis, aiFileAnalysis, aiSearchTable, aiSummarize, aiTransform, apiRequest, approvalChain, approvalChainTemplate, approvalStatusUpdate, requiredSecret, assignGroup, assignUser, assignmentEngine, bulkExcel, bulkUpdateFields, calculation, createRecord, executeScript, findRelatedRecords, generateReport, initiateCall, initiateEmailConversation, notification, postComment, postTeamsMessage, procedure, readFile, recordFieldLocking, recordSearch, relateRecords, runAutomation, saveAttachment, sendEmail, sendSurvey, setVariable, tableRecordsSearch, unzip, updateField, userGroupSearch, userSearch, withFieldMappings } from "./tasks.js";
|
|
22
23
|
export { approvalProcessStatusUpdated, attachment, commentAdded, conversationEnd, dataMine, emailReceived, onDemand, recordCreated, recordUpdated, schedule, slackMessage, surveyResponseCreate, temporal, webHook, webhook } from "./triggers.js";
|
|
@@ -9,9 +9,10 @@ import { type EntityKindModule } from "../../graph/types.js";
|
|
|
9
9
|
* any automation is skipped, so a released file left in place would still
|
|
10
10
|
* build and the next plan would create a duplicate. The file is kept instead
|
|
11
11
|
* when a resource that stays in source still references the automation
|
|
12
|
-
* (`keptFor`): agent and skill run-automation tools
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* (`keptFor`): agent and skill run-automation tools and other kept
|
|
13
|
+
* automations can only name an automation in source, so archiving would
|
|
14
|
+
* break build. A widget can (#1901), and so can a dynamic-layout button
|
|
15
|
+
* (#2693). An automation pull skips without releasing keeps its state and
|
|
15
16
|
* its existing source file, so the next plan builds that older file against
|
|
16
17
|
* the live automation.
|
|
17
18
|
*/
|
|
@@ -11,7 +11,7 @@ import { hasUnresolvedForEachItem, preserveAuthoredAutomationPullMeta, printAuto
|
|
|
11
11
|
import { automationFromTf, automationOwnedAddresses, ForEachItemOutsideLoopError, UnresolvedForeignServiceAccountError, UnresolvedTaskFilterRefError, UnsupportedMultiTriggerError } from "./from-tf.js";
|
|
12
12
|
import { scriptFileRefs } from "./script-code.js";
|
|
13
13
|
import { typedCoverageGap } from "../../engine/coverage-gaps.js";
|
|
14
|
-
import { taskOutputReferences, USER_SEARCH_OUTPUT_REFERENCES } from "./task-output-labels.js";
|
|
14
|
+
import { executeScriptOutputReferences, taskOutputReferences, USER_SEARCH_OUTPUT_REFERENCES } from "./task-output-labels.js";
|
|
15
15
|
import { automationToTf } from "./to-tf.js";
|
|
16
16
|
import { approvalChainLostStage } from "../approval-chain/from-tf.js";
|
|
17
17
|
import { IMPLEMENTED_FILE_READER_RESOURCE_TYPES } from "../file-reader/types.js";
|
|
@@ -129,9 +129,10 @@ function registerForeignObjectIdDeps(doc, automationLabel, ctx) {
|
|
|
129
129
|
* any automation is skipped, so a released file left in place would still
|
|
130
130
|
* build and the next plan would create a duplicate. The file is kept instead
|
|
131
131
|
* when a resource that stays in source still references the automation
|
|
132
|
-
* (`keptFor`): agent and skill run-automation tools
|
|
133
|
-
*
|
|
134
|
-
*
|
|
132
|
+
* (`keptFor`): agent and skill run-automation tools and other kept
|
|
133
|
+
* automations can only name an automation in source, so archiving would
|
|
134
|
+
* break build. A widget can (#1901), and so can a dynamic-layout button
|
|
135
|
+
* (#2693). An automation pull skips without releasing keeps its state and
|
|
135
136
|
* its existing source file, so the next plan builds that older file against
|
|
136
137
|
* the live automation.
|
|
137
138
|
*/
|
|
@@ -143,7 +144,7 @@ export function droppedAutomationGap(autoBlock, autoLabel, gap) {
|
|
|
143
144
|
entity: `automation ${JSON.stringify(display)} (${autoLabel})`,
|
|
144
145
|
detail: `skipped, not written to source: ${gap.why}`,
|
|
145
146
|
consequence: gap.released && gap.keptFor !== undefined
|
|
146
|
-
? `it is not adopted, and adoption releases it from state if this workspace managed it, so it keeps running on the platform unmanaged. Pull keeps its authored file, if there is one, because ${gap.keptFor.join(", ")} still name${gap.keptFor.length === 1 ? "s" : ""} it in source, and agent and skill tools
|
|
147
|
+
? `it is not adopted, and adoption releases it from state if this workspace managed it, so it keeps running on the platform unmanaged. Pull keeps its authored file, if there is one, because ${gap.keptFor.join(", ")} still name${gap.keptFor.length === 1 ? "s" : ""} it in source, and agent and skill tools and other automations cannot name a platform id instead, so moving the file would break build. While that file exists the next plan creates a second copy of the automation: review the plan before applying, and remove those references and the file to stop it. ${gap.nextStep}`
|
|
147
148
|
: gap.released && gap.settleByState === true
|
|
148
149
|
? `it is not adopted; adoption releases it from state if this workspace managed it, and once state no longer manages it pull moves its authored file, if there is one, to .edk-state/pull-backups so the next plan neither destroys it nor creates a duplicate. Until a pull releases it (under --no-adopt, or when adoption stops before releasing it), its file and state stay as they were and this workspace still manages it. Once a pull releases it, it keeps running on the platform unmanaged and its file is archived; do not restore that file. ${gap.nextStep}`
|
|
149
150
|
: gap.released
|
|
@@ -157,7 +158,8 @@ const FIX_OR_REPORT = "If you can change what the reason names in the platform,
|
|
|
157
158
|
* Addresses of the stream's resources that stay in source (`inSource`) and
|
|
158
159
|
* reference any of `owned` by source name. A widget does not count: with its
|
|
159
160
|
* automation out of source, build points it at the live automation through a
|
|
160
|
-
* display-name lookup (#1901), so archiving is safe.
|
|
161
|
+
* display-name lookup (#1901), so archiving is safe. A dynamic-layout button
|
|
162
|
+
* does not count either (#2693). Any other reference from that layout still does.
|
|
161
163
|
*/
|
|
162
164
|
function externalReferrers(stream, owned, inSource) {
|
|
163
165
|
const ownedSet = new Set(owned);
|
|
@@ -168,11 +170,26 @@ function externalReferrers(stream, owned, inSource) {
|
|
|
168
170
|
const address = `${block.type}.${block.label}`;
|
|
169
171
|
if (ownedSet.has(address) || block.type === "elementum_widget" || !inSource(address))
|
|
170
172
|
continue;
|
|
171
|
-
|
|
173
|
+
const attrs = block.type === "elementum_dynamic_layout" ? withoutAutomationButtons(block.attrs) : block.attrs;
|
|
174
|
+
if (referenceIn(attrs, ownedSet) !== undefined)
|
|
172
175
|
referrers.push(address);
|
|
173
176
|
}
|
|
174
177
|
return referrers;
|
|
175
178
|
}
|
|
179
|
+
/** Layout attrs with each `automation_button` removed, so a button's automation ref does not keep the file. */
|
|
180
|
+
function withoutAutomationButtons(value) {
|
|
181
|
+
if (Array.isArray(value))
|
|
182
|
+
return value.map(withoutAutomationButtons);
|
|
183
|
+
if (value === null || typeof value !== "object")
|
|
184
|
+
return value;
|
|
185
|
+
const out = {};
|
|
186
|
+
for (const [key, child] of Object.entries(value)) {
|
|
187
|
+
if (key === "automation_button")
|
|
188
|
+
continue;
|
|
189
|
+
out[key] = withoutAutomationButtons(child);
|
|
190
|
+
}
|
|
191
|
+
return out;
|
|
192
|
+
}
|
|
176
193
|
/** Addresses of the stream's approval processes that pull leaves unmanaged because their stage lost its only handle (#1136). */
|
|
177
194
|
function lostStageApprovalChains(stream, ctx) {
|
|
178
195
|
const lost = new Set();
|
|
@@ -274,7 +291,7 @@ function extractAutomations(ownBlocks, stream, ctx) {
|
|
|
274
291
|
}
|
|
275
292
|
}
|
|
276
293
|
try {
|
|
277
|
-
const extracted = automationFromTf(doc, autoLabel, ctx.appRefName, ctx.foreignFieldRefsById, ctx.foreignFieldRefsByDataAddress, ctx.foreignTableRefsById, ctx.
|
|
294
|
+
const extracted = automationFromTf(doc, autoLabel, ctx.appRefName, ctx.foreignFieldRefsById, ctx.foreignFieldRefsByDataAddress, ctx.foreignTableRefsById, ctx.picklistOptionsByField, ctx.fieldNamesByOwnerRefName, ctx.foreignAppRefNames, ctx.foreignElementRefNames, ctx.procedureKeysByDiscriminator, ctx.foreignTaskRefNames, ctx.groupKeysByName, ctx.serviceAccountsById, ctx.foreignFileReaderRefsById, ctx.foreignAppRefNamespaces);
|
|
278
295
|
// edk#1646 / #1858: adopt when a rebuilt ctx ref matches provider Read.
|
|
279
296
|
// Otherwise the automation stays platform-managed. Releasing its state
|
|
280
297
|
// also archives the authored file, so the next plan does not create a
|
|
@@ -383,10 +400,12 @@ function extractAutomations(ownBlocks, stream, ctx) {
|
|
|
383
400
|
}
|
|
384
401
|
}
|
|
385
402
|
// Archive a released automation's file only when nothing that stays in
|
|
386
|
-
// source still references it (#1877)
|
|
387
|
-
// tools
|
|
388
|
-
//
|
|
389
|
-
//
|
|
403
|
+
// source still references it (#1877). Agent and skill run-automation
|
|
404
|
+
// tools and other automations can only name an automation in source, so
|
|
405
|
+
// a reference from one of those keeps the file, and the warning says so.
|
|
406
|
+
// A dynamic-layout button looks the live automation up by the display
|
|
407
|
+
// name pull prints (#2693), so its reference does not keep the file.
|
|
408
|
+
// What stays in source is known only after
|
|
390
409
|
// every own-file child of the stream is extracted, so stream root decides
|
|
391
410
|
// it and calls back. A kept file is source too: what it references must
|
|
392
411
|
// stay (an automation a kept automation runs is kept as well), so iterate
|
|
@@ -573,6 +592,7 @@ export const automationModule = {
|
|
|
573
592
|
...(ctx.fieldAddressesByAppRefName !== undefined ? { fieldAddressesByAppRefName: ctx.fieldAddressesByAppRefName } : {}),
|
|
574
593
|
...(ctx.authoredAspectKeys !== undefined ? { authoredAspectKeys: ctx.authoredAspectKeys } : {}),
|
|
575
594
|
...(ctx.allowUnknownPicklistOptions === true ? { allowUnknownPicklistOptions: true } : {}),
|
|
595
|
+
...(ctx.optionIds !== undefined ? { optionIds: ctx.optionIds } : {}),
|
|
576
596
|
orgRefs: ctx.orgRefs,
|
|
577
597
|
workspaceAspects: ctx.workspaceAspects,
|
|
578
598
|
...(ctx.outOfScopeApps !== undefined && { outOfScopeApps: ctx.outOfScopeApps }),
|
|
@@ -605,6 +625,7 @@ export const automationModule = {
|
|
|
605
625
|
taskOutputReferences: {
|
|
606
626
|
...taskOutputReferences(),
|
|
607
627
|
elementum_user_search_task: USER_SEARCH_OUTPUT_REFERENCES,
|
|
628
|
+
elementum_execute_script_task: executeScriptOutputReferences(),
|
|
608
629
|
},
|
|
609
630
|
// An on-demand parameter used as a script input: the build writes the
|
|
610
631
|
// envelope with the platform's normalized name (#1525), the export the
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A record-bearing task's or trigger's write-only `refs_read` (edk#2648):
|
|
3
|
+
* the `refs` keys this automation's resources read from it. The provider
|
|
4
|
+
* plans `refs` unknown while the owner's field set changes (edk#2280,
|
|
5
|
+
* edk#2438), which made every task that reads a trigger's refs plan an
|
|
6
|
+
* update when one field was added. With `refs_read` it keeps `refs` known
|
|
7
|
+
* when every key read is still right, and plans them unknown only when a key
|
|
8
|
+
* read is new or belongs to a field that changes in this apply.
|
|
9
|
+
*/
|
|
10
|
+
import { type TfBlock } from "../../engine/tf/index.js";
|
|
11
|
+
/**
|
|
12
|
+
* Sets `refs_read` on each block that has `object_field_ids`, from every
|
|
13
|
+
* `<type>.<label>.refs["<key>"]` read in `blocks`. A read of the whole map,
|
|
14
|
+
* or of a key that isn't a literal index, leaves `refs_read` unset, so the
|
|
15
|
+
* provider plans as before. Pull's build-vs-export compare skips `refs_read`
|
|
16
|
+
* because export does not write it; it is a build-only planning hint
|
|
17
|
+
* (edk#2649 H1).
|
|
18
|
+
*/
|
|
19
|
+
export declare function setRefsRead(blocks: readonly TfBlock[]): void;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A record-bearing task's or trigger's write-only `refs_read` (edk#2648):
|
|
3
|
+
* the `refs` keys this automation's resources read from it. The provider
|
|
4
|
+
* plans `refs` unknown while the owner's field set changes (edk#2280,
|
|
5
|
+
* edk#2438), which made every task that reads a trigger's refs plan an
|
|
6
|
+
* update when one field was added. With `refs_read` it keeps `refs` known
|
|
7
|
+
* when every key read is still right, and plans them unknown only when a key
|
|
8
|
+
* read is new or belongs to a field that changes in this apply.
|
|
9
|
+
*/
|
|
10
|
+
import { forEachExpr } from "../../engine/tf/index.js";
|
|
11
|
+
/**
|
|
12
|
+
* Sets `refs_read` on each block that has `object_field_ids`, from every
|
|
13
|
+
* `<type>.<label>.refs["<key>"]` read in `blocks`. A read of the whole map,
|
|
14
|
+
* or of a key that isn't a literal index, leaves `refs_read` unset, so the
|
|
15
|
+
* provider plans as before. Pull's build-vs-export compare skips `refs_read`
|
|
16
|
+
* because export does not write it; it is a build-only planning hint
|
|
17
|
+
* (edk#2649 H1).
|
|
18
|
+
*/
|
|
19
|
+
export function setRefsRead(blocks) {
|
|
20
|
+
const readKeys = new Map();
|
|
21
|
+
for (const block of blocks) {
|
|
22
|
+
for (const value of Object.values(block.attrs)) {
|
|
23
|
+
forEachExpr(value, (e) => {
|
|
24
|
+
if (e.$expr !== "resource-attr" || e.path[0] !== "refs")
|
|
25
|
+
return;
|
|
26
|
+
const address = `${e.type}.${e.label}`;
|
|
27
|
+
const index = e.path[1];
|
|
28
|
+
if (e.path.length !== 2 || typeof index !== "object") {
|
|
29
|
+
readKeys.set(address, "whole map");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const keys = readKeys.get(address) ?? new Set();
|
|
33
|
+
if (keys === "whole map")
|
|
34
|
+
return;
|
|
35
|
+
keys.add(index.index);
|
|
36
|
+
readKeys.set(address, keys);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
for (const block of blocks) {
|
|
41
|
+
if (block.kind !== "resource" || block.attrs["object_field_ids"] === undefined)
|
|
42
|
+
continue;
|
|
43
|
+
const keys = readKeys.get(`${block.type}.${block.label}`) ?? new Set();
|
|
44
|
+
if (keys === "whole map")
|
|
45
|
+
continue;
|
|
46
|
+
block.attrs["refs_read"] = [...keys].sort();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The accessor path for a stored Slack message trigger reference, or
|
|
3
|
+
* undefined when its first segment names no Slack output (pull keeps it).
|
|
4
|
+
*/
|
|
5
|
+
export declare function slackMessageTriggerPathFromWire(path: readonly string[]): string[] | undefined;
|
|
6
|
+
/** The `refs` map key for `ctx.trigger.<name>` on a Slack message trigger. */
|
|
7
|
+
export declare function slackMessageTriggerRefName(name: string): string;
|
|
8
|
+
/** The `triggerReference.name` (calculation formula, ValueReference) for `ctx.trigger.<name>`. */
|
|
9
|
+
export declare function slackMessageTriggerReferenceName(name: string): string;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { EntityTfError } from "../../engine/entity.js";
|
|
2
|
+
/**
|
|
3
|
+
* Every `ctx.trigger.<accessor>` on a Slack message trigger (#2581), keyed by
|
|
4
|
+
* `keyof SlackMessageTriggerOutput` so an output added to the type without an
|
|
5
|
+
* entry here fails `tsc`. Live-confirmed (`ei refs --from-remote`, edk#2581):
|
|
6
|
+
* - `refsKey` is the trigger's `refs` map key, read by task inputs and filters;
|
|
7
|
+
* - `referenceName` is its `triggerReference.name`, the name a calculation
|
|
8
|
+
* formula (`{{trigger name="content"}}`) and a ValueReference envelope use.
|
|
9
|
+
* The platform rejects the refs key there with `Unable to validate`.
|
|
10
|
+
*/
|
|
11
|
+
const SLACK_MESSAGE_TRIGGER_REFS = {
|
|
12
|
+
threadId: { refsKey: "Slack Thread ID", referenceName: "threadId" },
|
|
13
|
+
channelId: { refsKey: "Slack Channel ID", referenceName: "channelId" },
|
|
14
|
+
authorEmail: { refsKey: "Message Author Email", referenceName: "authorEmail" },
|
|
15
|
+
authorId: { refsKey: "Message Author ID", referenceName: "authorId" },
|
|
16
|
+
authorName: { refsKey: "Message Author Name", referenceName: "authorName" },
|
|
17
|
+
content: { refsKey: "Message Content", referenceName: "content" },
|
|
18
|
+
messageId: { refsKey: "Message ID", referenceName: "messageId" },
|
|
19
|
+
meta: { refsKey: "Message Metadata", referenceName: "metadata" },
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Names pull may find stored on a Slack message trigger reference → accessor:
|
|
23
|
+
* the refs keys, the reference names, and the accessor names removed in
|
|
24
|
+
* #2581. Pull-only, so a re-pull writes the one accessor spelling.
|
|
25
|
+
*/
|
|
26
|
+
const SLACK_MESSAGE_TRIGGER_REF_FROM_WIRE = new Map([
|
|
27
|
+
...Object.entries(SLACK_MESSAGE_TRIGGER_REFS).flatMap(([accessor, { refsKey, referenceName }]) => [
|
|
28
|
+
[refsKey, accessor],
|
|
29
|
+
[referenceName, accessor],
|
|
30
|
+
[accessor, accessor],
|
|
31
|
+
]),
|
|
32
|
+
["slackThreadId", "threadId"],
|
|
33
|
+
["slackChannelId", "channelId"],
|
|
34
|
+
["messageAuthorEmail", "authorEmail"],
|
|
35
|
+
["messageAuthorId", "authorId"],
|
|
36
|
+
["messageAuthorName", "authorName"],
|
|
37
|
+
["messageContent", "content"],
|
|
38
|
+
["messageMetadata", "meta"],
|
|
39
|
+
]);
|
|
40
|
+
/**
|
|
41
|
+
* The accessor path for a stored Slack message trigger reference, or
|
|
42
|
+
* undefined when its first segment names no Slack output (pull keeps it).
|
|
43
|
+
*/
|
|
44
|
+
export function slackMessageTriggerPathFromWire(path) {
|
|
45
|
+
const accessor = path[0] !== undefined ? SLACK_MESSAGE_TRIGGER_REF_FROM_WIRE.get(path[0]) : undefined;
|
|
46
|
+
return accessor !== undefined ? [accessor, ...path.slice(1)] : undefined;
|
|
47
|
+
}
|
|
48
|
+
const ACCESSOR_BY_REFS_KEY_LOWER = new Map(Object.entries(SLACK_MESSAGE_TRIGGER_REFS).map(([accessor, { refsKey }]) => [refsKey.toLowerCase(), accessor]));
|
|
49
|
+
/**
|
|
50
|
+
* Resolve `ctx.trigger.<name>` on a Slack message trigger. Fails closed: an
|
|
51
|
+
* accessor the trigger does not publish is a build error, not a name that
|
|
52
|
+
* only fails at apply (`Invalid index`, `Unable to validate`).
|
|
53
|
+
*/
|
|
54
|
+
function resolveSlackAccessor(name, column) {
|
|
55
|
+
const byRefsKey = ACCESSOR_BY_REFS_KEY_LOWER.get(name.toLowerCase());
|
|
56
|
+
if (byRefsKey !== undefined)
|
|
57
|
+
return SLACK_MESSAGE_TRIGGER_REFS[byRefsKey][column];
|
|
58
|
+
const [head, ...rest] = name.split(".");
|
|
59
|
+
const entry = Object.hasOwn(SLACK_MESSAGE_TRIGGER_REFS, head)
|
|
60
|
+
? SLACK_MESSAGE_TRIGGER_REFS[head]
|
|
61
|
+
: undefined;
|
|
62
|
+
if (entry === undefined) {
|
|
63
|
+
throw new EntityTfError(`ctx.trigger.${name}: a Slack message trigger publishes no such reference. ` +
|
|
64
|
+
`Use one of ${Object.keys(SLACK_MESSAGE_TRIGGER_REFS).join(", ")}.`);
|
|
65
|
+
}
|
|
66
|
+
return [entry[column], ...rest].join(".");
|
|
67
|
+
}
|
|
68
|
+
/** The `refs` map key for `ctx.trigger.<name>` on a Slack message trigger. */
|
|
69
|
+
export function slackMessageTriggerRefName(name) {
|
|
70
|
+
return resolveSlackAccessor(name, "refsKey");
|
|
71
|
+
}
|
|
72
|
+
/** The `triggerReference.name` (calculation formula, ValueReference) for `ctx.trigger.<name>`. */
|
|
73
|
+
export function slackMessageTriggerReferenceName(name) {
|
|
74
|
+
return resolveSlackAccessor(name, "referenceName");
|
|
75
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { TaskOutputReference } from "../../graph/types.js";
|
|
2
|
+
/** Platform reference name for a whole record's identity, distinct from its TEXT handle. */
|
|
3
|
+
export declare const RECORD_ID_REFERENCE_FIELD = "10000001-2000-4000-a000-800000000000";
|
|
2
4
|
/** userSearch authoring output → provider refs-map key (as exported from live user-search tasks). */
|
|
3
5
|
export declare const USER_SEARCH_REF_WIRE_NAMES: Readonly<Record<string, string>>;
|
|
4
6
|
/**
|
|
@@ -23,6 +25,15 @@ export declare const TASK_OUTPUT_REFERENCE_NAMES: Readonly<Record<string, Readon
|
|
|
23
25
|
* the envelope is of this type.
|
|
24
26
|
*/
|
|
25
27
|
export declare function taskOutputReferences(): Readonly<Record<string, Readonly<Record<string, TaskOutputReference>>>>;
|
|
28
|
+
/**
|
|
29
|
+
* executeScript contract outputs keyed by refs-map key ("Text Result" →
|
|
30
|
+
* `textResult`), for the build-vs-export comparison only. Build reads a
|
|
31
|
+
* script output as `refs["Text Result"]` (EXECUTE_SCRIPT_REFS_INDEX); the
|
|
32
|
+
* export spells the same read as the `textResult` envelope, so without this
|
|
33
|
+
* the comparison reported every such filter as a difference (edk#2791). Kept
|
|
34
|
+
* out of TASK_OUTPUT_REFERENCE_NAMES, which build also reads.
|
|
35
|
+
*/
|
|
36
|
+
export declare function executeScriptOutputReferences(): Readonly<Record<string, TaskOutputReference>>;
|
|
26
37
|
/**
|
|
27
38
|
* A record-bearing task's whole-record output (ASPECT_RECORD). The bare
|
|
28
39
|
* `.record` accessor otherwise builds the ASPECT_RECORD_ID `Record` key a
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { RESOURCE_TYPE_TO_EXECUTOR, TASK_OUTPUT_CONTRACTS } from "./generated/task-output-contracts.js";
|
|
2
|
+
import { EXECUTE_SCRIPT_REFS_INDEX } from "./output-key-wire-name.js";
|
|
3
|
+
/** Platform reference name for a whole record's identity, distinct from its TEXT handle. */
|
|
4
|
+
export const RECORD_ID_REFERENCE_FIELD = "10000001-2000-4000-a000-800000000000";
|
|
2
5
|
/** userSearch authoring output → provider refs-map key (as exported from live user-search tasks). */
|
|
3
6
|
export const USER_SEARCH_REF_WIRE_NAMES = {
|
|
4
7
|
"user.id": "User's Id",
|
|
@@ -89,6 +92,26 @@ export function taskOutputReferences() {
|
|
|
89
92
|
}))];
|
|
90
93
|
}));
|
|
91
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* executeScript contract outputs keyed by refs-map key ("Text Result" →
|
|
97
|
+
* `textResult`), for the build-vs-export comparison only. Build reads a
|
|
98
|
+
* script output as `refs["Text Result"]` (EXECUTE_SCRIPT_REFS_INDEX); the
|
|
99
|
+
* export spells the same read as the `textResult` envelope, so without this
|
|
100
|
+
* the comparison reported every such filter as a difference (edk#2791). Kept
|
|
101
|
+
* out of TASK_OUTPUT_REFERENCE_NAMES, which build also reads.
|
|
102
|
+
*/
|
|
103
|
+
export function executeScriptOutputReferences() {
|
|
104
|
+
const taskType = "elementum_execute_script_task";
|
|
105
|
+
const executor = RESOURCE_TYPE_TO_EXECUTOR[taskType];
|
|
106
|
+
return Object.fromEntries(Object.entries(EXECUTE_SCRIPT_REFS_INDEX)
|
|
107
|
+
.filter(([name, key]) => name !== key)
|
|
108
|
+
.map(([name, key]) => {
|
|
109
|
+
const contract = executor === undefined ? undefined : TASK_OUTPUT_CONTRACTS[executor]?.[name];
|
|
110
|
+
if (contract === undefined)
|
|
111
|
+
throw new Error(`no output contract for ${taskType} output "${name}" (refs key "${key}")`);
|
|
112
|
+
return [key, { name, fieldType: contract.fieldType, multiple: contract.multiple }];
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
92
115
|
/**
|
|
93
116
|
* A record-bearing task's whole-record output (ASPECT_RECORD). The bare
|
|
94
117
|
* `.record` accessor otherwise builds the ASPECT_RECORD_ID `Record` key a
|
|
@@ -20,6 +20,7 @@ import { type Ref, type ValueOrRef } from "../shared/ref.js";
|
|
|
20
20
|
import type { DropdownValue } from "../shared/types/platform.js";
|
|
21
21
|
import type { ActionDef } from "./build.js";
|
|
22
22
|
import { type CalculationValue } from "./calculation-expression.js";
|
|
23
|
+
import type { TextOptionValue } from "../shared/filters/index.js";
|
|
23
24
|
import type { Filter } from "./filter.js";
|
|
24
25
|
import { type ScriptCodeFn, type ScriptFile } from "./script-code.js";
|
|
25
26
|
export type { CalculationInclude } from "../field/calc/types.js";
|
|
@@ -48,7 +49,7 @@ type UpdateModeForField<F extends FieldRef | UnsafePlatformId> = [F] extends [Mu
|
|
|
48
49
|
type UpdateValueForField<F extends FieldRef | UnsafePlatformId> = IsAny<F> extends true ? {
|
|
49
50
|
readonly value: ValueOrRef<unknown>;
|
|
50
51
|
} : [F] extends [MultiSelectFieldRef] ? {
|
|
51
|
-
readonly value: readonly string[] | Ref<readonly string[], string> | Ref<readonly DropdownValue[], string>;
|
|
52
|
+
readonly value: readonly (TextOptionValue | string)[] | Ref<readonly string[], string> | Ref<readonly DropdownValue[], string>;
|
|
52
53
|
} : {
|
|
53
54
|
readonly value: ValueOrRef<unknown>;
|
|
54
55
|
};
|
|
@@ -67,6 +68,7 @@ export interface RecordSearchOptions<A extends AppOrElementOrTaskRef = AppOrElem
|
|
|
67
68
|
/** Required — the platform rejects a record search with no filter (use `filter.whereTrue()` for all). */
|
|
68
69
|
readonly filter: Filter;
|
|
69
70
|
readonly sort?: Record<string, unknown>;
|
|
71
|
+
/** Integer from 1 to 500. Compare totalCount with returned records before treating a search as complete. */
|
|
70
72
|
readonly limit?: number;
|
|
71
73
|
}
|
|
72
74
|
export declare function recordSearch<A extends AppOrElementOrTaskRef>(opts: RecordSearchOptions<A>): ActionDef<RecordSearchOutput<A>>;
|
|
@@ -600,6 +602,15 @@ export interface AiTransformOptions {
|
|
|
600
602
|
/** Required — `BOOLEAN`, `DATE`, `DATETIME`, or `TEXT`. */
|
|
601
603
|
readonly fieldType: string;
|
|
602
604
|
readonly connector?: ConnectorRef;
|
|
605
|
+
/**
|
|
606
|
+
* Size of the embedding the task produces (the web app's **Dimensions**).
|
|
607
|
+
* Only for a connector whose embedding model lists the sizes it supports,
|
|
608
|
+
* and only one of those sizes (for example 256, 512 or 1024 for Titan Embed
|
|
609
|
+
* V2). A whole number ≥ 1. Leave it out for no size. A size can be changed
|
|
610
|
+
* in place (512 to 256). Removing it from a task that has one fails the
|
|
611
|
+
* plan, so set it again or delete and recreate the task.
|
|
612
|
+
*/
|
|
613
|
+
readonly dimensions?: number;
|
|
603
614
|
}
|
|
604
615
|
export declare function aiTransform(opts: AiTransformOptions): ActionDef<Record<string, unknown>>;
|
|
605
616
|
export interface AiEmailAnalysisOptions {
|
|
@@ -684,6 +695,8 @@ export declare function assignGroup(opts: AssignGroupOptions): ActionDef<Empty>;
|
|
|
684
695
|
export interface AddWatcherOptions {
|
|
685
696
|
readonly userIds?: readonly StaticUserRecipient[];
|
|
686
697
|
readonly groupIds?: readonly StaticGroupRecipient[];
|
|
698
|
+
readonly userRefs?: readonly ValueOrRef<string>[];
|
|
699
|
+
readonly groupRefs?: readonly ValueOrRef<string>[];
|
|
687
700
|
readonly record?: ValueOrRef<unknown>;
|
|
688
701
|
}
|
|
689
702
|
export declare function addWatcher(opts: AddWatcherOptions): ActionDef<Empty>;
|
|
@@ -888,10 +901,15 @@ export declare function calculation<const Values extends CalculationValues>(opts
|
|
|
888
901
|
/** @deprecated Prefer `calculation({ values: { name: expression } })`. */
|
|
889
902
|
export declare function calculation<const Entries extends readonly CalculationEntry[]>(opts: LegacyCalculationOptions<Entries>): ActionDef<CalculationOutputs<Entries>>;
|
|
890
903
|
/** The status to set on the referenced approval. Mirrors the provider's `status` validator. */
|
|
891
|
-
export type ApprovalStatusUpdateStatus = "APPROVED" | "DENIED" | "EXCEPTION";
|
|
904
|
+
export type ApprovalStatusUpdateStatus = "APPROVED" | "DENIED" | "CANCELLED" | "EXCEPTION";
|
|
892
905
|
export interface ApprovalStatusUpdateOptions {
|
|
893
|
-
/**
|
|
894
|
-
|
|
906
|
+
/**
|
|
907
|
+
* Approval process (approval chain template) whose status to update.
|
|
908
|
+
* Sent as the platform's approvalChainTemplateId (edk#1581).
|
|
909
|
+
*/
|
|
910
|
+
readonly approvalReference: ApprovalProcessRef;
|
|
911
|
+
/** Record whose approval status to update. */
|
|
912
|
+
readonly record: RecordReference;
|
|
895
913
|
readonly status: ApprovalStatusUpdateStatus;
|
|
896
914
|
readonly reason?: ValueOrRef<unknown>;
|
|
897
915
|
}
|
|
@@ -1030,6 +1048,13 @@ export interface ApprovalChainOptions {
|
|
|
1030
1048
|
readonly approvers?: readonly ValueOrRef<unknown>[];
|
|
1031
1049
|
readonly reason?: ValueOrRef<unknown>;
|
|
1032
1050
|
readonly summary?: ValueOrRef<unknown>;
|
|
1051
|
+
/**
|
|
1052
|
+
* The Approval Process Tag. A record can have one active approval per
|
|
1053
|
+
* approval process and tag, so approvals of the same process that run in
|
|
1054
|
+
* parallel on one record each need a distinct tag (for example a loop's
|
|
1055
|
+
* iteration).
|
|
1056
|
+
*/
|
|
1057
|
+
readonly tag?: ValueOrRef<unknown>;
|
|
1033
1058
|
}
|
|
1034
1059
|
export declare function approvalChain(opts: ApprovalChainOptions): ActionDef<Empty>;
|
|
1035
1060
|
export type ApprovalChainTemplateOptions = ApprovalChainOptions;
|
|
@@ -3,13 +3,28 @@ import { isExpr } from "../field/calc/runtime.js";
|
|
|
3
3
|
import { isRef } from "../shared/ref.js";
|
|
4
4
|
import { renderCalculationExpression, } from "./calculation-expression.js";
|
|
5
5
|
import { extractScriptBody, isScriptFile, readScriptFile, toPlatformScriptBody } from "./script-code.js";
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Where an undefined `fields[i].field` most likely came from, for the error.
|
|
8
|
+
* `catalog.<owner>.fields.someKey` evaluates to undefined when the key is not
|
|
9
|
+
* in the owner's fields bag: renamed or removed in source (#1579), or added
|
|
10
|
+
* in Elementum after the owner's source was last pulled, while the pulled
|
|
11
|
+
* automation already uses it (#2629). Build names the exact keys it can find
|
|
12
|
+
* in the file; this names the owner and the pull that refreshes it.
|
|
13
|
+
*/
|
|
14
|
+
function missingFieldHint(target) {
|
|
15
|
+
const owner = target;
|
|
16
|
+
if (owner?.refName === undefined)
|
|
17
|
+
return "Check the key against its app/element's fields bag.";
|
|
18
|
+
const kind = owner.__kind === "element" || owner.__kind === "task" ? owner.__kind : "app";
|
|
19
|
+
const label = `${kind} ${JSON.stringify(owner.name ?? owner.refName)}`;
|
|
20
|
+
return (`The key is not in the fields bag of ${label} (catalog.${owner.refName}.fields). ` +
|
|
21
|
+
`If the field was added or renamed in Elementum after that ${kind} was last pulled, run ` +
|
|
22
|
+
`\`elementum pull ${kind} ${owner.namespace ?? owner.refName}\`; if it was renamed or removed in source, use its current key.`);
|
|
23
|
+
}
|
|
24
|
+
function workflowFields(action, target, fields) {
|
|
7
25
|
return fields.map((f, index) => {
|
|
8
26
|
if (typeof f.field !== "object" || f.field === null) {
|
|
9
|
-
|
|
10
|
-
// bag (renamed or removed, e.g. by a re-pull, #1579).
|
|
11
|
-
throw new Error(`updateField: fields[${index}].field is ${String(f.field)}; the field key it reads does not exist on its app/element ` +
|
|
12
|
-
"(renamed or removed?). Check the app's fields bag for the current key.");
|
|
27
|
+
throw new Error(`${action}: fields[${index}].field is ${String(f.field)}: the field key it reads does not exist. ${missingFieldHint(target)}`);
|
|
13
28
|
}
|
|
14
29
|
const updateMode = "updateMode" in f ? f.updateMode : undefined;
|
|
15
30
|
const fieldType = "fieldType" in f.field ? f.field.fieldType : undefined;
|
|
@@ -60,7 +75,7 @@ export function createRecord(opts) {
|
|
|
60
75
|
key: "createRecord",
|
|
61
76
|
config: {
|
|
62
77
|
aspectId: opts.app,
|
|
63
|
-
workflowFields: workflowFields(opts.fields),
|
|
78
|
+
workflowFields: workflowFields("createRecord", opts.app, opts.fields),
|
|
64
79
|
relateToRecord: opts.relateToRecord ?? false,
|
|
65
80
|
...(opts.record !== undefined ? { recordReference: serializeValueOrRef(opts.record) } : {}),
|
|
66
81
|
},
|
|
@@ -77,7 +92,7 @@ export function updateField(opts) {
|
|
|
77
92
|
config: {
|
|
78
93
|
aspectId: opts.app,
|
|
79
94
|
recordReference: serializeValueOrRef(opts.record),
|
|
80
|
-
workflowFields: workflowFields(opts.fields),
|
|
95
|
+
workflowFields: workflowFields("updateField", opts.app, opts.fields),
|
|
81
96
|
},
|
|
82
97
|
__recordApp: opts.app.refName,
|
|
83
98
|
...recordKindOf(opts.app),
|
|
@@ -95,7 +110,7 @@ export function bulkUpdateFields(opts) {
|
|
|
95
110
|
config: {
|
|
96
111
|
aspectId: opts.app,
|
|
97
112
|
filter: opts.filter,
|
|
98
|
-
workflowFields: workflowFields(opts.fields),
|
|
113
|
+
workflowFields: workflowFields("bulkUpdateFields", opts.app, opts.fields),
|
|
99
114
|
},
|
|
100
115
|
__recordApp: opts.app.refName,
|
|
101
116
|
...recordKindOf(opts.app),
|
|
@@ -491,12 +506,16 @@ export function aiSummarize(opts) {
|
|
|
491
506
|
};
|
|
492
507
|
}
|
|
493
508
|
export function aiTransform(opts) {
|
|
509
|
+
if (opts.dimensions !== undefined && (!Number.isInteger(opts.dimensions) || opts.dimensions < 1)) {
|
|
510
|
+
throw new Error(`aiTransform dimensions must be a whole number ≥ 1 (got ${String(opts.dimensions)}).`);
|
|
511
|
+
}
|
|
494
512
|
return {
|
|
495
513
|
key: "aiTransform",
|
|
496
514
|
config: {
|
|
497
515
|
prompt: serializeValueOrRef(opts.prompt),
|
|
498
516
|
fieldType: opts.fieldType,
|
|
499
517
|
...connectorSlot(opts.connector),
|
|
518
|
+
...(opts.dimensions !== undefined ? { dimensions: opts.dimensions } : {}),
|
|
500
519
|
},
|
|
501
520
|
};
|
|
502
521
|
}
|
|
@@ -592,14 +611,16 @@ export function assignGroup(opts) {
|
|
|
592
611
|
return { key: "assignGroup", config: { fieldId: opts.field, groupId: opts.groupId } };
|
|
593
612
|
}
|
|
594
613
|
export function addWatcher(opts) {
|
|
595
|
-
if (!opts.userIds?.length && !opts.groupIds?.length) {
|
|
596
|
-
throw new Error("addWatcher requires at least one of: userIds or
|
|
614
|
+
if (!opts.userIds?.length && !opts.groupIds?.length && !opts.userRefs?.length && !opts.groupRefs?.length) {
|
|
615
|
+
throw new Error("addWatcher requires at least one of: userIds, groupIds, userRefs, or groupRefs.");
|
|
597
616
|
}
|
|
598
617
|
return {
|
|
599
618
|
key: "addWatcher",
|
|
600
619
|
config: {
|
|
601
620
|
...(opts.userIds?.length ? { userIds: opts.userIds } : {}),
|
|
602
621
|
...(opts.groupIds?.length ? { groupIds: opts.groupIds } : {}),
|
|
622
|
+
...(opts.userRefs?.length ? { users: refList(opts.userRefs) } : {}),
|
|
623
|
+
...(opts.groupRefs?.length ? { groups: refList(opts.groupRefs) } : {}),
|
|
603
624
|
...(opts.record !== undefined ? { recordReference: serializeValueOrRef(opts.record) } : {}),
|
|
604
625
|
},
|
|
605
626
|
};
|
|
@@ -846,7 +867,8 @@ export function approvalStatusUpdate(opts) {
|
|
|
846
867
|
return {
|
|
847
868
|
key: "approvalStatusUpdate",
|
|
848
869
|
config: {
|
|
849
|
-
approvalReference:
|
|
870
|
+
approvalReference: opts.approvalReference,
|
|
871
|
+
recordReference: serializeValueOrRef(opts.record),
|
|
850
872
|
status: opts.status,
|
|
851
873
|
...(opts.reason !== undefined ? { reason: serializeValueOrRef(opts.reason) } : {}),
|
|
852
874
|
},
|
|
@@ -915,6 +937,7 @@ export function approvalChain(opts) {
|
|
|
915
937
|
...(opts.approvers !== undefined ? { approverReferences: opts.approvers.map((a) => serializeValueOrRef(a)) } : {}),
|
|
916
938
|
...(opts.reason !== undefined ? { reason: serializeValueOrRef(opts.reason) } : {}),
|
|
917
939
|
...(opts.summary !== undefined ? { summary: serializeValueOrRef(opts.summary) } : {}),
|
|
940
|
+
...(opts.tag !== undefined ? { tags: serializeValueOrRef(opts.tag) } : {}),
|
|
918
941
|
},
|
|
919
942
|
};
|
|
920
943
|
}
|
|
@@ -4,6 +4,7 @@ import { type TfBlock, type TfValue } from "../../engine/tf/index.js";
|
|
|
4
4
|
import { type ForeignRootIdentity, type OrgRefLookup, type WorkspaceAspect } from "../../engine/build/context.js";
|
|
5
5
|
import type { BuildFieldMetadata } from "../../graph/types.js";
|
|
6
6
|
import type { AppServiceAccount } from "../service-account/build.js";
|
|
7
|
+
import type { OptionIdIndex } from "../../engine/pull/field-refs-registry.js";
|
|
7
8
|
export interface AutomationToTfContext {
|
|
8
9
|
/** The owning app or element's refName. */
|
|
9
10
|
readonly appRefName?: string;
|
|
@@ -42,6 +43,8 @@ export interface AutomationToTfContext {
|
|
|
42
43
|
readonly authoredAspectKeys?: ReadonlySet<string>;
|
|
43
44
|
/** Build-time tolerance for stale labels retained by pulled automations. */
|
|
44
45
|
readonly allowUnknownPicklistOptions?: boolean;
|
|
46
|
+
/** Option ids known offline, so a raw id's warning can name its label (#1733). */
|
|
47
|
+
readonly optionIds?: OptionIdIndex;
|
|
45
48
|
readonly orgRefs?: OrgRefLookup;
|
|
46
49
|
readonly diagnostics?: string[];
|
|
47
50
|
readonly serviceAccounts?: Readonly<Record<string, AppServiceAccount>>;
|