@elementumai/edk 0.9.20 → 0.10.1
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 +19 -7
- package/dist-sdk/src/catalog/factories.d.ts +10 -2
- package/dist-sdk/src/catalog/factories.js +10 -1
- package/dist-sdk/src/catalog/index.d.ts +2 -2
- package/dist-sdk/src/catalog/index.js +1 -1
- package/dist-sdk/src/catalog/token.js +4 -0
- package/dist-sdk/src/catalog/types.d.ts +7 -1
- package/dist-sdk/src/catalog/types.js +1 -0
- package/dist-sdk/src/core/triggers/on-demand.d.ts +2 -2
- package/dist-sdk/src/core/triggers/on-demand.js +7 -0
- package/dist-sdk/src/core/types/app.d.ts +2 -2
- package/dist-sdk/src/engine/coverage-gaps.d.ts +86 -0
- package/dist-sdk/src/engine/coverage-gaps.js +156 -0
- package/dist-sdk/src/engine/ei/run.d.ts +21 -1
- package/dist-sdk/src/engine/ei/run.js +89 -2
- package/dist-sdk/src/engine/pull/catalog-ref.d.ts +16 -0
- package/dist-sdk/src/engine/pull/catalog-ref.js +24 -0
- package/dist-sdk/src/engine/pull/context.d.ts +68 -6
- package/dist-sdk/src/engine/pull/context.js +40 -1
- package/dist-sdk/src/engine/pull/procedure-refs.d.ts +8 -0
- package/dist-sdk/src/engine/pull/procedure-refs.js +28 -0
- package/dist-sdk/src/engine/pull/result-output.js +27 -1
- package/dist-sdk/src/engine/tf/index.d.ts +1 -1
- package/dist-sdk/src/engine/tf/index.js +1 -1
- package/dist-sdk/src/engine/tf/labels.d.ts +22 -5
- package/dist-sdk/src/engine/tf/labels.js +45 -3
- package/dist-sdk/src/engine/tf/parse.js +3 -2
- package/dist-sdk/src/engine/validation.d.ts +5 -0
- package/dist-sdk/src/engine/validation.js +12 -2
- package/dist-sdk/src/entities/access-policy/from-tf.js +38 -1
- package/dist-sdk/src/entities/access-policy/principal.d.ts +2 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +3 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +42 -19
- package/dist-sdk/src/entities/agent/from-tf.js +11 -3
- package/dist-sdk/src/entities/agent/module.js +2 -0
- package/dist-sdk/src/entities/agent/to-tf.js +14 -3
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +8 -1
- package/dist-sdk/src/entities/agent-tool/from-tf.js +11 -5
- package/dist-sdk/src/entities/agent-tool/module.js +3 -0
- package/dist-sdk/src/entities/app/auto-share.d.ts +38 -0
- package/dist-sdk/src/entities/app/auto-share.js +49 -0
- package/dist-sdk/src/entities/app/build.d.ts +17 -3
- package/dist-sdk/src/entities/app/build.js +56 -4
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +6 -1
- package/dist-sdk/src/entities/app/from-tf.js +4 -0
- package/dist-sdk/src/entities/app/index.d.ts +2 -1
- package/dist-sdk/src/entities/app/index.js +1 -8
- package/dist-sdk/src/entities/app/to-tf.d.ts +6 -0
- package/dist-sdk/src/entities/app/to-tf.js +21 -2
- package/dist-sdk/src/entities/automation/build.d.ts +10 -2
- package/dist-sdk/src/entities/automation/build.js +104 -17
- package/dist-sdk/src/entities/automation/calculation-expression.d.ts +7 -7
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +17 -4
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +156 -19
- package/dist-sdk/src/entities/automation/from-tf.d.ts +9 -2
- package/dist-sdk/src/entities/automation/from-tf.js +366 -86
- package/dist-sdk/src/entities/automation/index.d.ts +1 -1
- package/dist-sdk/src/entities/automation/index.js +1 -1
- package/dist-sdk/src/entities/automation/module.d.ts +3 -0
- package/dist-sdk/src/entities/automation/module.js +70 -7
- package/dist-sdk/src/entities/automation/script-code.d.ts +5 -2
- package/dist-sdk/src/entities/automation/script-code.js +23 -5
- package/dist-sdk/src/entities/automation/task-output-labels.d.ts +37 -0
- package/dist-sdk/src/entities/automation/task-output-labels.js +76 -0
- package/dist-sdk/src/entities/automation/tasks.d.ts +92 -20
- package/dist-sdk/src/entities/automation/tasks.js +48 -15
- package/dist-sdk/src/entities/automation/to-tf.d.ts +20 -3
- package/dist-sdk/src/entities/automation/to-tf.js +606 -62
- package/dist-sdk/src/entities/automation/triggers.d.ts +8 -4
- package/dist-sdk/src/entities/automation/types.d.ts +9 -0
- package/dist-sdk/src/entities/automation/types.js +19 -0
- package/dist-sdk/src/entities/automation/value-ref-tf.d.ts +1 -1
- package/dist-sdk/src/entities/automation/value-ref-tf.js +1 -1
- package/dist-sdk/src/entities/chart/from-tf.js +9 -1
- package/dist-sdk/src/entities/data-lookup/module.js +2 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +7 -5
- package/dist-sdk/src/entities/element/build.d.ts +3 -0
- package/dist-sdk/src/entities/element/build.js +1 -0
- package/dist-sdk/src/entities/element/from-tf.js +4 -0
- package/dist-sdk/src/entities/element/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/element/to-tf.js +8 -14
- package/dist-sdk/src/entities/field/build.d.ts +3 -2
- package/dist-sdk/src/entities/field/calc.d.ts +7 -7
- package/dist-sdk/src/entities/field/from-tf.d.ts +4 -4
- package/dist-sdk/src/entities/field/from-tf.js +205 -48
- package/dist-sdk/src/entities/field/module.js +1 -0
- package/dist-sdk/src/entities/field/options.js +6 -1
- package/dist-sdk/src/entities/field/to-tf.d.ts +4 -4
- package/dist-sdk/src/entities/field/to-tf.js +7 -1
- package/dist-sdk/src/entities/field/types.d.ts +2 -0
- package/dist-sdk/src/entities/field/types.js +27 -0
- package/dist-sdk/src/entities/role/from-tf.js +3 -3
- package/dist-sdk/src/entities/role/to-tf.d.ts +2 -0
- package/dist-sdk/src/entities/role/to-tf.js +12 -4
- package/dist-sdk/src/entities/service-account/from-tf.js +3 -3
- package/dist-sdk/src/entities/service-account/workspace-owner.d.ts +16 -0
- package/dist-sdk/src/entities/service-account/workspace-owner.js +22 -0
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +15 -1
- package/dist-sdk/src/entities/shared/filters/ast.js +2 -0
- package/dist-sdk/src/entities/shared/filters/index.d.ts +5 -0
- package/dist-sdk/src/entities/shared/filters/index.js +5 -0
- package/dist-sdk/src/entities/shared/filters/print.js +7 -2
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +5 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +42 -7
- package/dist-sdk/src/entities/shared/filters/types.d.ts +8 -3
- package/dist-sdk/src/entities/shared/ref.d.ts +5 -7
- package/dist-sdk/src/entities/shared/ref.js +5 -7
- package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +9 -0
- package/dist-sdk/src/entities/shared/tool-field-ref.js +35 -2
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +10 -0
- package/dist-sdk/src/entities/shared/types/field-types.js +4 -0
- package/dist-sdk/src/entities/skill/access-policy.js +3 -3
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +3 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +12 -5
- package/dist-sdk/src/entities/skill/from-tf.js +4 -2
- package/dist-sdk/src/entities/skill/module.js +2 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.js +41 -8
- package/dist-sdk/src/entities/skill-tool/module.js +3 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +0 -6
- package/dist-sdk/src/entities/skill-tool/to-tf.js +22 -9
- package/dist-sdk/src/entities/task/build.d.ts +8 -0
- package/dist-sdk/src/entities/task/build.js +10 -1
- package/dist-sdk/src/entities/task/from-tf.d.ts +4 -2
- package/dist-sdk/src/entities/task/from-tf.js +7 -2
- package/dist-sdk/src/entities/task/module.js +2 -2
- package/dist-sdk/src/entities/task/to-tf.d.ts +8 -4
- package/dist-sdk/src/entities/task/to-tf.js +28 -1
- package/dist-sdk/src/entities/view/from-tf.js +9 -1
- package/dist-sdk/src/entities/view/to-tf.d.ts +6 -7
- package/dist-sdk/src/entities/view/to-tf.js +19 -8
- package/dist-sdk/src/entities/visual-flow/build.d.ts +16 -1
- package/dist-sdk/src/entities/visual-flow/build.js +9 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.d.ts +14 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.js +51 -3
- package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -1
- package/dist-sdk/src/entities/visual-flow/index.js +1 -1
- package/dist-sdk/src/entities/visual-flow/printer.js +19 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.js +87 -3
- package/dist-sdk/src/entities/widget/from-tf.js +3 -3
- package/dist-sdk/src/entities/widget/to-tf.d.ts +2 -0
- package/dist-sdk/src/entities/widget/to-tf.js +7 -6
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +133 -9
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
- package/dist-sdk/src/graph/index.d.ts +1 -0
- package/dist-sdk/src/graph/types.d.ts +29 -3
- package/package.json +7 -3
|
@@ -18,5 +18,5 @@ 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
20
|
export { workflowOutput, workflowOutputType, type WorkflowOutputDeclaration, type WorkflowOutputType, } from "./workflow-output.js";
|
|
21
|
-
export { addWatcher, aiAgent, aiClassify, aiEmailAnalysis, aiFileAnalysis, aiSearchTable, aiSummarize, aiTransform, apiRequest, approvalChain, approvalChainTemplate, approvalStatusUpdate, requiredSecret, assignGroup, assignUser, assignmentEngine, bulkExcel, 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 ApprovalChainOptions, type RequiredSecret, type ApprovalChainTemplateOptions, type ApprovalStatusUpdateOptions, type ApprovalStatusUpdateStatus, type AssignGroupOptions, type AssignUserOptions, type AssignmentEngineOptions, type BulkExcelFieldMapping, type BulkExcelFieldSource, type BulkExcelOptions, 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 FieldAssignment, type FindRelatedRecordsOptions, type FindRelatedRecordsOutput, type GenerateReportOptions, type InitiateCallOptions, type InitiateEmailConversationOptions, type InitiateEmailFirstEmail, type LegacyCalculationOptions, type MultiSelectUpdateMode, type NotificationOptions, 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 RunAutomationOptions, 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";
|
|
21
|
+
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 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 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
22
|
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";
|
|
@@ -18,7 +18,7 @@ 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
20
|
export { workflowOutput, workflowOutputType, } from "./workflow-output.js";
|
|
21
|
-
export { addWatcher, aiAgent, aiClassify, aiEmailAnalysis, aiFileAnalysis, aiSearchTable, aiSummarize, aiTransform, apiRequest, approvalChain, approvalChainTemplate, approvalStatusUpdate, requiredSecret, assignGroup, assignUser, assignmentEngine, bulkExcel, 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";
|
|
21
|
+
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
22
|
export { approvalProcessStatusUpdated, attachment, commentAdded, conversationEnd, dataMine, emailReceived, onDemand, recordCreated, recordUpdated, schedule, slackMessage, surveyResponseCreate, temporal, webHook, webhook } from "./triggers.js";
|
|
23
23
|
// Pull a deployed automation back as editable v2 source. `automation`
|
|
24
24
|
// is a plain factory returning a builder-chain object (not an Object.assign-able
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/** The automation entity's registry entry (see src/graph/). */
|
|
2
|
+
import { type TfBlock } from "../../engine/tf/index.js";
|
|
2
3
|
import { type EntityKindModule } from "../../graph/types.js";
|
|
4
|
+
/** The named WARN for an automation pull could not extract (edk#1054, edk#1480). */
|
|
5
|
+
export declare function droppedAutomationGap(autoBlock: TfBlock, autoLabel: string, reason: string): string;
|
|
3
6
|
export declare const automationModule: EntityKindModule;
|
|
4
7
|
/** The provider's `normalizeOnDemandFilterRefName`, which computes `filter_refs` at plan time. */
|
|
5
8
|
export declare function onDemandFilterRefName(name: string): string;
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
/** The automation entity's registry entry (see src/graph/). */
|
|
2
|
-
import { sanitizeName, tfLabelToTsLabel, isTfExpr } from "../../engine/tf/index.js";
|
|
2
|
+
import { appScopedResourceLabel, sanitizeName, tfLabelToTsLabel, isTfExpr } from "../../engine/tf/index.js";
|
|
3
|
+
function elementOwnerHandle(payload) {
|
|
4
|
+
if (payload === null || typeof payload !== "object" || !("handle" in payload))
|
|
5
|
+
return undefined;
|
|
6
|
+
const handle = payload.handle;
|
|
7
|
+
return typeof handle === "string" && handle !== "" ? handle : undefined;
|
|
8
|
+
}
|
|
3
9
|
import { renderAutomationCatalogEntry } from "./catalog-render.js";
|
|
4
10
|
import { hasUnresolvedForEachItem, preserveAuthoredAutomationPullMeta, printAutomationV2WithScriptFiles, SCRIPT_FILES_DIR } from "./deserializer/print-automation.js";
|
|
11
|
+
import { reportAuthoringBlocker } from "../../engine/pull/context.js";
|
|
5
12
|
import { recordValidations } from "../../engine/validation.js";
|
|
6
13
|
import { automationFromTf, automationOwnedAddresses, ForEachItemOutsideLoopError, UnsupportedMultiTriggerError } from "./from-tf.js";
|
|
7
14
|
import { scriptFileRefs } from "./script-code.js";
|
|
15
|
+
import { typedCoverageGap } from "../../engine/coverage-gaps.js";
|
|
8
16
|
import { TASK_OUTPUT_REFERENCE_NAMES } from "./task-output-labels.js";
|
|
9
17
|
import { automationToTf } from "./to-tf.js";
|
|
10
18
|
import { ALL_AUTOMATION_SUB_TYPES, AUTOMATION_RESOURCE_TYPE, WORKFLOW_PUBLISH_RESOURCE_TYPE, } from "./types.js";
|
|
19
|
+
const AUTOMATION_MEMBER_TYPES = new Set([
|
|
20
|
+
WORKFLOW_PUBLISH_RESOURCE_TYPE,
|
|
21
|
+
...ALL_AUTOMATION_SUB_TYPES.map((subType) => subType.resourceType),
|
|
22
|
+
]);
|
|
11
23
|
function isConfigured(value) {
|
|
12
24
|
return (typeof value === "object" &&
|
|
13
25
|
value !== null &&
|
|
@@ -89,19 +101,36 @@ function registerForeignObjectIdDeps(doc, automationLabel, ctx) {
|
|
|
89
101
|
if (!isTfExpr(objectId) || objectId.$expr !== "data-attr")
|
|
90
102
|
continue;
|
|
91
103
|
if (objectId.type === "elementum_app") {
|
|
92
|
-
|
|
104
|
+
// Namespace-only data blocks (ei's common foreign-app shape) leave
|
|
105
|
+
// dataName undefined; fall back to the namespace attribute (#1647).
|
|
106
|
+
const attrs = ctx.dataAttrs?.("elementum_app", objectId.label);
|
|
107
|
+
const name = ctx.dataName("elementum_app", objectId.label)
|
|
108
|
+
?? (typeof attrs?.["namespace"] === "string" ? attrs["namespace"] : undefined);
|
|
93
109
|
if (name === undefined || ctx.foreignAppRefNames?.has(name))
|
|
94
110
|
continue;
|
|
95
111
|
unresolved.apps.add(name);
|
|
96
112
|
}
|
|
97
113
|
else if (objectId.type === "elementum_element") {
|
|
98
|
-
const
|
|
114
|
+
const attrs = ctx.dataAttrs?.("elementum_element", objectId.label);
|
|
115
|
+
const name = ctx.dataName("elementum_element", objectId.label)
|
|
116
|
+
?? (typeof attrs?.["namespace"] === "string" ? attrs["namespace"] : undefined);
|
|
99
117
|
if (name === undefined || ctx.foreignElementRefNames?.has(name))
|
|
100
118
|
continue;
|
|
101
119
|
unresolved.elements.add(name);
|
|
102
120
|
}
|
|
103
121
|
}
|
|
104
122
|
}
|
|
123
|
+
/** The named WARN for an automation pull could not extract (edk#1054, edk#1480). */
|
|
124
|
+
export function droppedAutomationGap(autoBlock, autoLabel, reason) {
|
|
125
|
+
const name = autoBlock.attrs["name"];
|
|
126
|
+
const display = typeof name === "string" && name !== "" ? name : autoLabel;
|
|
127
|
+
return typedCoverageGap({
|
|
128
|
+
kind: "skipped",
|
|
129
|
+
entity: `automation ${JSON.stringify(display)} (${autoLabel})`,
|
|
130
|
+
detail: `not pulled, skipped: ${reason}`,
|
|
131
|
+
consequence: "it is not written to source or adopted; it keeps running on the platform unmanaged",
|
|
132
|
+
});
|
|
133
|
+
}
|
|
105
134
|
function extractAutomations(ownBlocks, stream, ctx) {
|
|
106
135
|
const items = [];
|
|
107
136
|
const skipped = [];
|
|
@@ -117,7 +146,7 @@ function extractAutomations(ownBlocks, stream, ctx) {
|
|
|
117
146
|
// (one owned-address walk) relative to from-tf.
|
|
118
147
|
registerForeignObjectIdDeps(doc, autoLabel, ctx);
|
|
119
148
|
try {
|
|
120
|
-
const extracted = automationFromTf(doc, autoLabel, ctx.appRefName, ctx.foreignFieldRefsById, ctx.foreignFieldRefsByDataAddress, ctx.foreignTableRefsById, ctx.picklistOptionLabelById, ctx.fieldNamesByOwnerRefName, ctx.foreignAppRefNames, ctx.foreignElementRefNames, ctx.procedureKeysByDiscriminator, ctx.foreignTaskRefNames);
|
|
149
|
+
const extracted = automationFromTf(doc, autoLabel, ctx.appRefName, ctx.foreignFieldRefsById, ctx.foreignFieldRefsByDataAddress, ctx.foreignTableRefsById, ctx.picklistOptionLabelById, ctx.fieldNamesByOwnerRefName, ctx.foreignAppRefNames, ctx.foreignElementRefNames, ctx.procedureKeysByDiscriminator, ctx.foreignTaskRefNames, ctx.groupKeysByName);
|
|
121
150
|
// Keep automationFromTf's label-derived refName — agent/skill tools store
|
|
122
151
|
// the same scopedLabelToBagKey as automationKey. Pushing bare AST (name
|
|
123
152
|
// only) made missing-automation diagnostics false-positive on every real
|
|
@@ -158,9 +187,36 @@ function extractAutomations(ownBlocks, stream, ctx) {
|
|
|
158
187
|
// not printed, so the build must not also report the placeholder.
|
|
159
188
|
if (err instanceof ForEachItemOutsideLoopError)
|
|
160
189
|
releaseIfManaged.push(...owned);
|
|
161
|
-
|
|
190
|
+
// edk#1480: name the dropped automation and say what that means, as a
|
|
191
|
+
// typed gap so it counts (and fails --strict-coverage) by itself.
|
|
192
|
+
diagnostics.push(droppedAutomationGap(autoBlock, autoLabel, err instanceof Error ? err.message : String(err)));
|
|
162
193
|
}
|
|
163
194
|
}
|
|
195
|
+
// A trigger, task, or publish with no automation resource is not in any
|
|
196
|
+
// skeleton's graph. extractAutomations never sees it, and its resource type
|
|
197
|
+
// is still adoptable, so the next plan can destroy it (#1484).
|
|
198
|
+
const doc = { blocks: [...stream.allBlocks] };
|
|
199
|
+
const owned = new Set();
|
|
200
|
+
for (const autoBlock of ownBlocks) {
|
|
201
|
+
if (autoBlock.label === undefined || autoBlock.label === "")
|
|
202
|
+
continue;
|
|
203
|
+
for (const address of automationOwnedAddresses(doc, autoBlock.label))
|
|
204
|
+
owned.add(address);
|
|
205
|
+
}
|
|
206
|
+
for (const block of stream.familyByKind.get("automation") ?? []) {
|
|
207
|
+
if (block.type === undefined || block.label === undefined || !AUTOMATION_MEMBER_TYPES.has(block.type))
|
|
208
|
+
continue;
|
|
209
|
+
const address = `${block.type}.${block.label}`;
|
|
210
|
+
if (owned.has(address))
|
|
211
|
+
continue;
|
|
212
|
+
skipped.push(address);
|
|
213
|
+
reportAuthoringBlocker(ctx, {
|
|
214
|
+
address,
|
|
215
|
+
ownFileKind: "automation",
|
|
216
|
+
description: `${address} is not owned by an ${AUTOMATION_RESOURCE_TYPE} resource, so it cannot be pulled`,
|
|
217
|
+
remedy: "The export is missing the automation these resources belong to. Re-export the app, or remove the orphaned automation resources, then pull again.",
|
|
218
|
+
});
|
|
219
|
+
}
|
|
164
220
|
return { items, skipped, releaseIfManaged, diagnostics, validations, adoptionAddressAliases };
|
|
165
221
|
}
|
|
166
222
|
export const automationModule = {
|
|
@@ -174,6 +230,9 @@ export const automationModule = {
|
|
|
174
230
|
resource: {
|
|
175
231
|
shape: "composite",
|
|
176
232
|
adoptable: true,
|
|
233
|
+
// An element-owned automation's ref name already carries the handle prefix
|
|
234
|
+
// ei exports and build keeps (`<handle>_<automation>`).
|
|
235
|
+
childLabel: (ownerTfLabel, childTfLabel, scope) => scope === "element" ? childTfLabel : appScopedResourceLabel(ownerTfLabel, childTfLabel),
|
|
177
236
|
members: [
|
|
178
237
|
{ role: "skeleton", resourceType: AUTOMATION_RESOURCE_TYPE, implemented: true },
|
|
179
238
|
{ role: "publish", resourceType: WORKFLOW_PUBLISH_RESOURCE_TYPE, implemented: true },
|
|
@@ -221,6 +280,8 @@ export const automationModule = {
|
|
|
221
280
|
appRefName: opts.appRefName,
|
|
222
281
|
...(opts.foreignAppRefNames !== undefined && { foreignAppRefNames: opts.foreignAppRefNames }),
|
|
223
282
|
...(opts.foreignElementRefNames !== undefined && { foreignElementRefNames: opts.foreignElementRefNames }),
|
|
283
|
+
...(opts.foreignAppRefNamespaces !== undefined && { foreignAppRefNamespaces: opts.foreignAppRefNamespaces }),
|
|
284
|
+
...(opts.foreignElementRefNamespaces !== undefined && { foreignElementRefNamespaces: opts.foreignElementRefNamespaces }),
|
|
224
285
|
...(opts.foreignTaskRefNames !== undefined && { foreignTaskRefNames: opts.foreignTaskRefNames }),
|
|
225
286
|
...(opts.unresolvedReferences !== undefined && { unresolvedReferences: opts.unresolvedReferences }),
|
|
226
287
|
});
|
|
@@ -236,6 +297,7 @@ export const automationModule = {
|
|
|
236
297
|
appRefName: ctx.appRefName,
|
|
237
298
|
appTfLabel: ctx.appTfLabel,
|
|
238
299
|
parentScope: ctx.parentScope === "element" ? "element" : "app",
|
|
300
|
+
...(ctx.parentScope === "element" ? { ownerHandle: elementOwnerHandle(ctx.streamRootEntity?.payload) } : {}),
|
|
239
301
|
...(ctx.streamRootEntity?.payload?.auditFields === true
|
|
240
302
|
? { ownerAuditFields: true }
|
|
241
303
|
: {}),
|
|
@@ -286,8 +348,9 @@ export const automationModule = {
|
|
|
286
348
|
}],
|
|
287
349
|
exportedAttributeLocals: [{
|
|
288
350
|
resourceType: "elementum_variable_task",
|
|
289
|
-
attribute: "
|
|
290
|
-
localPrefix: "
|
|
351
|
+
attribute: "variables",
|
|
352
|
+
localPrefix: "edk_variable_ids_",
|
|
353
|
+
listField: "id",
|
|
291
354
|
}],
|
|
292
355
|
},
|
|
293
356
|
};
|
|
@@ -48,8 +48,11 @@ export declare class ScriptCodeError extends Error {
|
|
|
48
48
|
* only as TypeScript has its types erased by the TypeScript transpiler with an
|
|
49
49
|
* ESNext target, so no syntax is downleveled into helpers; one that parses as
|
|
50
50
|
* neither is refused. `label` names the script in errors. With
|
|
51
|
-
* `stripTypes: false` (script files
|
|
52
|
-
* TypeScript
|
|
51
|
+
* `stripTypes: false` (script files) a TypeScript body is kept byte for byte
|
|
52
|
+
* so a pulled workflow round-trips. When TypeScript is available, a body that
|
|
53
|
+
* parses as neither JavaScript nor TypeScript is refused. When the TypeScript
|
|
54
|
+
* package cannot be loaded, the stored body is kept so pull can finish,
|
|
55
|
+
* including a body that cannot be classified.
|
|
53
56
|
*/
|
|
54
57
|
export declare function toPlatformScriptBody(body: string, label: string, options?: {
|
|
55
58
|
readonly stripTypes?: boolean;
|
|
@@ -174,17 +174,35 @@ function plainJavaScriptSyntaxError(body) {
|
|
|
174
174
|
* only as TypeScript has its types erased by the TypeScript transpiler with an
|
|
175
175
|
* ESNext target, so no syntax is downleveled into helpers; one that parses as
|
|
176
176
|
* neither is refused. `label` names the script in errors. With
|
|
177
|
-
* `stripTypes: false` (script files
|
|
178
|
-
* TypeScript
|
|
177
|
+
* `stripTypes: false` (script files) a TypeScript body is kept byte for byte
|
|
178
|
+
* so a pulled workflow round-trips. When TypeScript is available, a body that
|
|
179
|
+
* parses as neither JavaScript nor TypeScript is refused. When the TypeScript
|
|
180
|
+
* package cannot be loaded, the stored body is kept so pull can finish,
|
|
181
|
+
* including a body that cannot be classified.
|
|
179
182
|
*/
|
|
180
183
|
export function toPlatformScriptBody(body, label, options = {}) {
|
|
181
184
|
const wrapped = `${SCRIPT_WRAPPER_OPEN}${body}${SCRIPT_WRAPPER_CLOSE}`;
|
|
182
|
-
const plainJsRefusal = () => new ScriptCodeError(`${label}: script files must be plain JavaScript, but this one uses TypeScript syntax (type annotations, \`as\`, \`!\`, ...).`);
|
|
183
185
|
const jsError = plainJavaScriptSyntaxError(body);
|
|
184
186
|
if (jsError === undefined)
|
|
185
187
|
return body;
|
|
186
|
-
if (options.stripTypes === false)
|
|
187
|
-
|
|
188
|
+
if (options.stripTypes === false) {
|
|
189
|
+
// Script files round-trip the platform body. Live workflows store
|
|
190
|
+
// TypeScript syntax in that body; stripping it would plan a rewrite and
|
|
191
|
+
// refusing it stops pull (#1424). When TypeScript loads, a body that
|
|
192
|
+
// parses as neither JavaScript nor TypeScript still fails.
|
|
193
|
+
const ts = (options.loadTypeScript === undefined ? getTs() : options.loadTypeScript());
|
|
194
|
+
// The standalone CLI does not bundle TypeScript, and the workspace often
|
|
195
|
+
// does not install it either. Keep the stored body so pull can finish,
|
|
196
|
+
// including one that is not valid TypeScript: without a parser it cannot
|
|
197
|
+
// be told apart from a TypeScript workflow body.
|
|
198
|
+
if (ts === undefined)
|
|
199
|
+
return body;
|
|
200
|
+
const tsErrors = scriptSyntaxErrors(wrapped, "script.ts", ts);
|
|
201
|
+
if (tsErrors.length > 0) {
|
|
202
|
+
throw new ScriptCodeError(`${label}: the script body does not parse: ${tsErrors.join("; ")}`);
|
|
203
|
+
}
|
|
204
|
+
return body;
|
|
205
|
+
}
|
|
188
206
|
const ts = (options.loadTypeScript === undefined ? getTs() : options.loadTypeScript());
|
|
189
207
|
if (ts === undefined) {
|
|
190
208
|
throw new ScriptCodeError(`${label}: the script body is not plain JavaScript and TypeScript is unavailable: ${jsError}`);
|
|
@@ -13,5 +13,42 @@ export declare const TASK_OUTPUT_REFERENCE_NAMES: Readonly<Record<string, Readon
|
|
|
13
13
|
* `record_reference` needs; a field-mapped input needs the record itself.
|
|
14
14
|
*/
|
|
15
15
|
export declare const WHOLE_RECORD_REF_WIRE_NAMES: Readonly<Record<string, string>>;
|
|
16
|
+
/**
|
|
17
|
+
* Marks a trigger reference that a field-mapped script input reads as the
|
|
18
|
+
* whole record (edk#1284). Record triggers expose the whole record
|
|
19
|
+
* (`record`, ASPECT_RECORD) and the record ID (ASPECT_RECORD_ID) under one
|
|
20
|
+
* display name, "Record", and the provider's refs map keeps only the ID there.
|
|
21
|
+
* Build sets this on the input's value; to-tf then writes the exact reference
|
|
22
|
+
* JSON (`triggerWholeRecordRefJson`) instead of `refs["Record"]`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const TRIGGER_WHOLE_RECORD_MARKER = "__edkTriggerWholeRecord";
|
|
25
|
+
/** The trigger's whole record (`record`) in field mappings. */
|
|
26
|
+
export declare const TRIGGER_WHOLE_RECORD_REF_NAME = "record";
|
|
27
|
+
/**
|
|
28
|
+
* The reference JSON for a trigger's whole record: the string provider Read
|
|
29
|
+
* returns for it and the exporter emits, byte for byte (sorted keys).
|
|
30
|
+
*/
|
|
31
|
+
export declare function triggerWholeRecordRefJson(name: string): string;
|
|
32
|
+
/** The trigger reference name a whole-record reference JSON names, if `value` is one. */
|
|
33
|
+
export declare function parseTriggerWholeRecordRefJson(value: unknown): string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* An attachment trigger's own payload fields. A record field can share one's
|
|
36
|
+
* display name (a "Description" field) and then owns that refs key, so build
|
|
37
|
+
* always writes these as exact reference JSON.
|
|
38
|
+
*/
|
|
39
|
+
export declare const ATTACHMENT_PAYLOAD_FIELD_TYPES: Readonly<Record<string, string>>;
|
|
40
|
+
/**
|
|
41
|
+
* The reference for an attachment payload field. JSON-encoded (sorted keys),
|
|
42
|
+
* it is the string provider Read returns for it.
|
|
43
|
+
*/
|
|
44
|
+
export declare function triggerAttachmentPayloadRef(key: string): {
|
|
45
|
+
readonly fieldType: string;
|
|
46
|
+
readonly multiple: false;
|
|
47
|
+
readonly triggerReference: {
|
|
48
|
+
readonly name: string;
|
|
49
|
+
};
|
|
50
|
+
} | undefined;
|
|
51
|
+
/** The attachment payload field an exact reference JSON names, if `value` is one. */
|
|
52
|
+
export declare function parseTriggerAttachmentPayloadRefJson(value: unknown): string | undefined;
|
|
16
53
|
/** aiSearchTable accessor → [refs-map display label, canonical `service_tasks` output name]. */
|
|
17
54
|
export declare const AI_SEARCH_TABLE_OUTPUT_NAMES: Readonly<Record<string, readonly [display: string, canonical: string]>>;
|
|
@@ -26,6 +26,11 @@ export const TASK_OUTPUT_REFERENCE_NAMES = {
|
|
|
26
26
|
Name: "group.name",
|
|
27
27
|
"All found groups": "groups",
|
|
28
28
|
},
|
|
29
|
+
// Captured live from a deployed bulk_update_fields task's refs map.
|
|
30
|
+
elementum_bulk_update_fields_task: {
|
|
31
|
+
"Records Updated": "recordsUpdated",
|
|
32
|
+
"All Matching Records Updated": "allMatchingRecordsUpdated",
|
|
33
|
+
},
|
|
29
34
|
};
|
|
30
35
|
/**
|
|
31
36
|
* A record-bearing task's whole-record output (ASPECT_RECORD). The bare
|
|
@@ -37,6 +42,77 @@ export const WHOLE_RECORD_REF_WIRE_NAMES = {
|
|
|
37
42
|
createRecord: "Created record",
|
|
38
43
|
updateField: "Updated record",
|
|
39
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* Marks a trigger reference that a field-mapped script input reads as the
|
|
47
|
+
* whole record (edk#1284). Record triggers expose the whole record
|
|
48
|
+
* (`record`, ASPECT_RECORD) and the record ID (ASPECT_RECORD_ID) under one
|
|
49
|
+
* display name, "Record", and the provider's refs map keeps only the ID there.
|
|
50
|
+
* Build sets this on the input's value; to-tf then writes the exact reference
|
|
51
|
+
* JSON (`triggerWholeRecordRefJson`) instead of `refs["Record"]`.
|
|
52
|
+
*/
|
|
53
|
+
export const TRIGGER_WHOLE_RECORD_MARKER = "__edkTriggerWholeRecord";
|
|
54
|
+
/** The trigger's whole record (`record`) in field mappings. */
|
|
55
|
+
export const TRIGGER_WHOLE_RECORD_REF_NAME = "record";
|
|
56
|
+
/**
|
|
57
|
+
* The reference JSON for a trigger's whole record: the string provider Read
|
|
58
|
+
* returns for it and the exporter emits, byte for byte (sorted keys).
|
|
59
|
+
*/
|
|
60
|
+
export function triggerWholeRecordRefJson(name) {
|
|
61
|
+
return JSON.stringify({ fieldType: "ASPECT_RECORD", multiple: false, triggerReference: { name } });
|
|
62
|
+
}
|
|
63
|
+
/** The trigger reference name a whole-record reference JSON names, if `value` is one. */
|
|
64
|
+
export function parseTriggerWholeRecordRefJson(value) {
|
|
65
|
+
const ref = parseSingleTriggerRefJson(value);
|
|
66
|
+
return ref?.fieldType === "ASPECT_RECORD" ? ref.name : undefined;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* An attachment trigger's own payload fields. A record field can share one's
|
|
70
|
+
* display name (a "Description" field) and then owns that refs key, so build
|
|
71
|
+
* always writes these as exact reference JSON.
|
|
72
|
+
*/
|
|
73
|
+
export const ATTACHMENT_PAYLOAD_FIELD_TYPES = {
|
|
74
|
+
name: "TEXT",
|
|
75
|
+
url: "TEXT",
|
|
76
|
+
mediaType: "TEXT",
|
|
77
|
+
size: "NUMBER",
|
|
78
|
+
description: "TEXT",
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* The reference for an attachment payload field. JSON-encoded (sorted keys),
|
|
82
|
+
* it is the string provider Read returns for it.
|
|
83
|
+
*/
|
|
84
|
+
export function triggerAttachmentPayloadRef(key) {
|
|
85
|
+
const fieldType = ATTACHMENT_PAYLOAD_FIELD_TYPES[key];
|
|
86
|
+
if (fieldType === undefined)
|
|
87
|
+
return undefined;
|
|
88
|
+
return { fieldType, multiple: false, triggerReference: { name: `attachment.${key}` } };
|
|
89
|
+
}
|
|
90
|
+
/** The attachment payload field an exact reference JSON names, if `value` is one. */
|
|
91
|
+
export function parseTriggerAttachmentPayloadRefJson(value) {
|
|
92
|
+
const ref = parseSingleTriggerRefJson(value);
|
|
93
|
+
if (ref === undefined || !ref.name.startsWith("attachment."))
|
|
94
|
+
return undefined;
|
|
95
|
+
const key = ref.name.slice("attachment.".length);
|
|
96
|
+
return ATTACHMENT_PAYLOAD_FIELD_TYPES[key] === ref.fieldType ? key : undefined;
|
|
97
|
+
}
|
|
98
|
+
function parseSingleTriggerRefJson(value) {
|
|
99
|
+
if (typeof value !== "string" || !value.startsWith("{"))
|
|
100
|
+
return undefined;
|
|
101
|
+
let parsed;
|
|
102
|
+
try {
|
|
103
|
+
parsed = JSON.parse(value);
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
|
|
109
|
+
return undefined;
|
|
110
|
+
const { fieldType, multiple, triggerReference, ...rest } = parsed;
|
|
111
|
+
if ((multiple !== undefined && multiple !== false) || Object.keys(rest).length > 0)
|
|
112
|
+
return undefined;
|
|
113
|
+
const name = triggerReference?.name;
|
|
114
|
+
return typeof name === "string" && Object.keys(triggerReference).length === 1 ? { name, fieldType } : undefined;
|
|
115
|
+
}
|
|
40
116
|
/** aiSearchTable accessor → [refs-map display label, canonical `service_tasks` output name]. */
|
|
41
117
|
export const AI_SEARCH_TABLE_OUTPUT_NAMES = {
|
|
42
118
|
records: ["All Records", "searchTableRecords"],
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
* accept a literal or a `ctx` `Ref` and are pre-serialized to the platform's
|
|
12
12
|
* `ValueReference` JSON via the shared, agnostic `serializeValueOrRef`.
|
|
13
13
|
*/
|
|
14
|
-
import type { AgentRef, AppOrElementOrTaskRef, AppOrElementRef, ApprovalProcessRef, AutomationCatalogRef, CloudLinkRef, ConnectorRef, DocumentModelFieldRef, FieldRef, FileReaderCatalogRef, OutputPropertyRef, PhoneServiceRef, ProcedureParameterType, ProcedureRef, SearchTableRef, TableRef } from "../../catalog/index.js";
|
|
14
|
+
import type { AgentRef, AppOrElementOrTaskRef, AppOrElementRef, ApprovalProcessRef, AutomationCatalogRef, CloudLinkRef, ConnectorRef, DocumentModelFieldRef, FieldRef, FileReaderCatalogRef, GroupRef, OutputPropertyRef, PhoneServiceRef, ProcedureParameterType, ProcedureRef, SearchTableRef, TableRef } from "../../catalog/index.js";
|
|
15
15
|
import type { UnsafePlatformId } from "../../core/platform-id.js";
|
|
16
16
|
import type { CalculationInclude, Expr, ExprCardinality, ExprContext, ExprType } from "../field/calc/types.js";
|
|
17
17
|
import type { RecordId, RecordShape } from "../field/record-shape.js";
|
|
18
18
|
import type { RoleUserRef } from "../role/build.js";
|
|
19
|
-
import type
|
|
19
|
+
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";
|
|
@@ -124,6 +124,22 @@ export interface UpdateFieldOptions<A extends AppOrElementOrTaskRef = AppOrEleme
|
|
|
124
124
|
export declare function updateField<A extends AppOrElementOrTaskRef, const Fields extends readonly FieldAssignment[]>(opts: UpdateFieldOptions<A, Fields>): ActionDef<{
|
|
125
125
|
record: RecordShape<A>;
|
|
126
126
|
}>;
|
|
127
|
+
/** The two scalar outputs a bulk update exposes. */
|
|
128
|
+
export interface BulkUpdateFieldsOutput {
|
|
129
|
+
readonly recordsUpdated: number;
|
|
130
|
+
readonly allMatchingRecordsUpdated: boolean;
|
|
131
|
+
}
|
|
132
|
+
export interface BulkUpdateFieldsOptions<A extends AppOrElementOrTaskRef = AppOrElementOrTaskRef, Fields extends readonly FieldAssignment[] = readonly FieldAssignment[]> {
|
|
133
|
+
readonly app: A;
|
|
134
|
+
/** Required — every record matching this filter is updated (use `filter.whereTrue()` for all). */
|
|
135
|
+
readonly filter: Filter;
|
|
136
|
+
readonly fields: Fields & ValidatedUpdateFieldAssignments<NoInfer<Fields>>;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Update fields on every record matching a filter — a filter-scoped mass
|
|
140
|
+
* updateField. No single-record option: the filter selects the set.
|
|
141
|
+
*/
|
|
142
|
+
export declare function bulkUpdateFields<A extends AppOrElementOrTaskRef, const Fields extends readonly FieldAssignment[]>(opts: BulkUpdateFieldsOptions<A, Fields>): ActionDef<BulkUpdateFieldsOutput>;
|
|
127
143
|
export interface FindRelatedRecordsOptions<A extends AppOrElementOrTaskRef = AppOrElementOrTaskRef> {
|
|
128
144
|
readonly relatedApp: A;
|
|
129
145
|
/**
|
|
@@ -334,10 +350,15 @@ export interface ExecuteScriptListInputToken {
|
|
|
334
350
|
readonly fields: readonly ExecuteScriptFieldMapping[];
|
|
335
351
|
}
|
|
336
352
|
/**
|
|
337
|
-
* Wrap a
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
353
|
+
* Wrap a record-valued executeScript input with the field mappings the script
|
|
354
|
+
* can read - which fields, and under what alias. The value is a whole record
|
|
355
|
+
* or a list of records (a prior task's `.records`, read per item).
|
|
356
|
+
*
|
|
357
|
+
* Inside this wrapper these deploy the whole record: a record trigger's
|
|
358
|
+
* `ctx.trigger.record`, and the `.record` of `recordSearch`, `createRecord`
|
|
359
|
+
* and `updateField`. Elsewhere they are the record ID a `record:` slot takes.
|
|
360
|
+
* An on-demand record parameter and `findRelatedRecords`' `.record` expose
|
|
361
|
+
* only the record ID, so they stay the ID here too.
|
|
341
362
|
*/
|
|
342
363
|
export declare function withFieldMappings(value: ValueOrRef<unknown>, fields: readonly ExecuteScriptFieldMapping[]): ExecuteScriptListInputToken;
|
|
343
364
|
export interface ExecuteScriptOptions<O extends ScriptOutputs | undefined = undefined> {
|
|
@@ -358,8 +379,9 @@ export interface ExecuteScriptOptions<O extends ScriptOutputs | undefined = unde
|
|
|
358
379
|
*/
|
|
359
380
|
readonly code: ScriptCodeFn<Record<string, unknown>, Record<string, unknown>> | ScriptFile;
|
|
360
381
|
/**
|
|
361
|
-
* A
|
|
362
|
-
*
|
|
382
|
+
* A record-valued input (a whole record, or a list of records) can carry
|
|
383
|
+
* {@link withFieldMappings} to declare which fields the script can read, and
|
|
384
|
+
* under what alias.
|
|
363
385
|
*/
|
|
364
386
|
readonly inputs?: Record<string, ValueOrRef<unknown> | ExecuteScriptListInputToken>;
|
|
365
387
|
/**
|
|
@@ -401,6 +423,13 @@ export interface RequiredSecret {
|
|
|
401
423
|
export declare function requiredSecret(variable: string): RequiredSecret;
|
|
402
424
|
export declare function isRequiredSecret(value: unknown): value is RequiredSecret;
|
|
403
425
|
export interface ApiRequestBasicAuth {
|
|
426
|
+
/**
|
|
427
|
+
* A static username, a `requiredSecret()` write-only username, or
|
|
428
|
+
* `secret("KEY")` for a username bound to a vault entry. A vault-bound
|
|
429
|
+
* username builds to `basic_auth.reference_username` through a key-only
|
|
430
|
+
* `elementum_vault_entry` lookup, so no vault ID or value lands in source
|
|
431
|
+
* or HCL (edk#1283).
|
|
432
|
+
*/
|
|
404
433
|
readonly username: ValueOrRef<unknown>;
|
|
405
434
|
/**
|
|
406
435
|
* elementum_api_task's `basic_auth.reference_password` - a dynamic
|
|
@@ -426,16 +455,18 @@ export interface ApiRequestBearerAuth {
|
|
|
426
455
|
readonly referenceToken?: ValueOrRef<unknown>;
|
|
427
456
|
}
|
|
428
457
|
/**
|
|
429
|
-
* elementum_api_task's `oauth` block (client-credentials grant).
|
|
430
|
-
* `clientSecret`
|
|
458
|
+
* elementum_api_task's `oauth` block (client-credentials grant). A plain
|
|
459
|
+
* string `clientId`/`clientSecret` is static and write-only on read like
|
|
431
460
|
* bearer_auth.token - always resent from authored source, never
|
|
432
|
-
* reconstructed from a pull.
|
|
433
|
-
* `
|
|
461
|
+
* reconstructed from a pull. `secret("KEY")` binds either one to a vault
|
|
462
|
+
* entry instead: it builds to `reference_client_id`/`reference_client_secret`
|
|
463
|
+
* through a key-only `elementum_vault_entry` lookup and round-trips through a
|
|
464
|
+
* pull (edk#1283). Mutually exclusive with `basicAuth`/`bearerAuth`.
|
|
434
465
|
*/
|
|
435
466
|
export interface ApiRequestOAuth {
|
|
436
467
|
readonly url?: ValueOrRef<unknown>;
|
|
437
|
-
readonly clientId?: string
|
|
438
|
-
readonly clientSecret?: string
|
|
468
|
+
readonly clientId?: string | Ref<string>;
|
|
469
|
+
readonly clientSecret?: string | Ref<string>;
|
|
439
470
|
readonly requestType: "BASIC" | "FORM";
|
|
440
471
|
readonly headers?: readonly ApiRequestHeader[];
|
|
441
472
|
}
|
|
@@ -583,13 +614,19 @@ export declare function aiClassify(opts: AiClassifyOptions): ActionDef<{
|
|
|
583
614
|
output: unknown;
|
|
584
615
|
}>;
|
|
585
616
|
type Empty = Record<string, never>;
|
|
617
|
+
/** A user recipient picked by identity rather than mapped from a record. */
|
|
618
|
+
export type StaticUserRecipient = RoleUserRef | string;
|
|
619
|
+
/** A group recipient picked by identity rather than mapped from a record. */
|
|
620
|
+
export type StaticGroupRecipient = GroupRef | string;
|
|
586
621
|
export interface NotificationOptions {
|
|
587
622
|
readonly title: ValueOrRef<string>;
|
|
588
623
|
readonly message: ValueOrRef<string>;
|
|
589
624
|
/** Description shown in the notification's metadata. Supports templates with value references. */
|
|
590
625
|
readonly description?: ValueOrRef<string>;
|
|
591
|
-
|
|
592
|
-
readonly
|
|
626
|
+
/** Users picked directly as recipients: `userRef(email)`, or a platform id. */
|
|
627
|
+
readonly userIds?: readonly StaticUserRecipient[];
|
|
628
|
+
/** Groups picked directly as recipients: an `org.groups.<key>` token, or a platform id. */
|
|
629
|
+
readonly groupIds?: readonly StaticGroupRecipient[];
|
|
593
630
|
readonly userRefs?: readonly ValueOrRef<string>[];
|
|
594
631
|
readonly groupRefs?: readonly ValueOrRef<string>[];
|
|
595
632
|
/** Also notify the record's watchers. */
|
|
@@ -607,8 +644,8 @@ export interface AssignGroupOptions {
|
|
|
607
644
|
}
|
|
608
645
|
export declare function assignGroup(opts: AssignGroupOptions): ActionDef<Empty>;
|
|
609
646
|
export interface AddWatcherOptions {
|
|
610
|
-
readonly userIds?: readonly
|
|
611
|
-
readonly groupIds?: readonly
|
|
647
|
+
readonly userIds?: readonly StaticUserRecipient[];
|
|
648
|
+
readonly groupIds?: readonly StaticGroupRecipient[];
|
|
612
649
|
readonly record?: ValueOrRef<unknown>;
|
|
613
650
|
}
|
|
614
651
|
export declare function addWatcher(opts: AddWatcherOptions): ActionDef<Empty>;
|
|
@@ -844,7 +881,8 @@ type WorkflowOutputValue<T extends string | undefined, Multiple extends boolean
|
|
|
844
881
|
export type RunAutomationOutput<A extends AutomationCatalogRef> = A["outputs"] extends Record<string, OutputPropertyRef> ? {
|
|
845
882
|
readonly [K in keyof A["outputs"]]: WorkflowOutputValue<A["outputs"][K]["valueType"], A["outputs"][K]["multiple"]>;
|
|
846
883
|
} : Record<string, unknown>;
|
|
847
|
-
|
|
884
|
+
/** The UI's "Select Automation" mode: a known automation chosen at build time. */
|
|
885
|
+
export interface RunAutomationStaticOptions<A extends AutomationCatalogRef = AutomationCatalogRef> {
|
|
848
886
|
readonly automation: A;
|
|
849
887
|
readonly synchronous?: boolean;
|
|
850
888
|
/**
|
|
@@ -860,7 +898,41 @@ export interface RunAutomationOptions<A extends AutomationCatalogRef = Automatio
|
|
|
860
898
|
*/
|
|
861
899
|
readonly outputs?: readonly string[];
|
|
862
900
|
}
|
|
863
|
-
|
|
901
|
+
/**
|
|
902
|
+
* The UI's "Dynamic Reference" mode: the automation to run is a value
|
|
903
|
+
* resolved at runtime, such as a trigger parameter or an earlier step's
|
|
904
|
+
* output holding an automation ID. The platform always waits for a dynamic
|
|
905
|
+
* target, so `synchronous` must be `true`.
|
|
906
|
+
*/
|
|
907
|
+
export interface RunAutomationDynamicReferenceOptions<Outputs extends readonly string[] | undefined = undefined> {
|
|
908
|
+
readonly automation: Ref<string>;
|
|
909
|
+
readonly synchronous: true;
|
|
910
|
+
/** Input mappings by the target's on-demand trigger parameter **name**. */
|
|
911
|
+
readonly inputs?: readonly RunAutomationInput[];
|
|
912
|
+
/**
|
|
913
|
+
* Output names to capture from whichever automation runs. The target is
|
|
914
|
+
* unknown at build time, so each captured name is `unknown`. Omitting
|
|
915
|
+
* `outputs` exposes nothing on the step result.
|
|
916
|
+
*/
|
|
917
|
+
readonly outputs?: Outputs;
|
|
918
|
+
}
|
|
919
|
+
/** Keys of a Dynamic Reference `runAutomation` step. Empty when `outputs` is omitted. */
|
|
920
|
+
export type RunAutomationDynamicResult<Outputs extends readonly string[] | undefined> = [
|
|
921
|
+
Outputs
|
|
922
|
+
] extends [readonly string[]] ? {
|
|
923
|
+
readonly [K in Outputs[number]]: unknown;
|
|
924
|
+
} : Record<never, never>;
|
|
925
|
+
/** Step result for one `runAutomation` options object, static or Dynamic Reference. */
|
|
926
|
+
export type RunAutomationStepResult<O> = O extends {
|
|
927
|
+
readonly automation: Ref<string>;
|
|
928
|
+
} ? RunAutomationDynamicResult<O extends {
|
|
929
|
+
readonly outputs?: infer Out extends readonly string[] | undefined;
|
|
930
|
+
} ? Out : undefined> : O extends {
|
|
931
|
+
readonly automation: infer A extends AutomationCatalogRef;
|
|
932
|
+
} ? RunAutomationOutput<A> : Record<string, unknown>;
|
|
933
|
+
export type RunAutomationOptions<A extends AutomationCatalogRef = AutomationCatalogRef> = RunAutomationStaticOptions<A> | RunAutomationDynamicReferenceOptions;
|
|
934
|
+
export declare function runAutomation<const A extends AutomationCatalogRef>(opts: RunAutomationStaticOptions<A>): ActionDef<RunAutomationOutput<A>>;
|
|
935
|
+
export declare function runAutomation<const Outputs extends readonly string[] | undefined = undefined>(opts: RunAutomationDynamicReferenceOptions<Outputs>): ActionDef<RunAutomationDynamicResult<Outputs>>;
|
|
864
936
|
export type ReadFileDataSource = {
|
|
865
937
|
readonly type: "attachmentId";
|
|
866
938
|
readonly value: ValueOrRef<unknown>;
|