@contrail/cli 3.5.4-alpha.2a94b1c → 3.5.4-alpha.a8a0075
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
CHANGED
|
@@ -17,7 +17,7 @@ $ npm install -g @contrail/cli
|
|
|
17
17
|
$ contrail COMMAND
|
|
18
18
|
running command...
|
|
19
19
|
$ contrail (--version)
|
|
20
|
-
@contrail/cli/3.5.4-alpha.
|
|
20
|
+
@contrail/cli/3.5.4-alpha.a8a0075 linux-x64 node-v24.18.0
|
|
21
21
|
$ contrail --help [COMMAND]
|
|
22
22
|
USAGE
|
|
23
23
|
$ contrail COMMAND
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventWorkflowActionDefinition, WorkflowTemplate, WorkflowTemplateDeclaration } from '../../interfaces';
|
|
2
2
|
export declare class LocalWorkflowTemplateDeployer {
|
|
3
3
|
deployWorkflows(wtDeclaration: WorkflowTemplateDeclaration): Promise<void>;
|
|
4
|
-
deployWorkflowTemplate(workflow: WorkflowTemplate, existingWorkflows: WorkflowTemplate[], appIdentifier: string): Promise<WorkflowTemplate>;
|
|
4
|
+
deployWorkflowTemplate(workflow: WorkflowTemplate, existingWorkflows: WorkflowTemplate[], appIdentifier: string | undefined): Promise<WorkflowTemplate>;
|
|
5
5
|
private createNewWorkflowTemplate;
|
|
6
6
|
private populateActionIds;
|
|
7
7
|
createWorkflowSchedule(workflowTemplate: WorkflowTemplate, workflowId: string): Promise<any>;
|
|
@@ -35,14 +35,14 @@ class LocalWorkflowTemplateDeployer {
|
|
|
35
35
|
return await this.createNewWorkflowTemplate(identifier, workflow, appIdentifier);
|
|
36
36
|
}
|
|
37
37
|
async createNewWorkflowTemplate(workflowKey, workflowTemplate, appIdentifier) {
|
|
38
|
-
await this.populateActionIds(workflowTemplate, workflowKey, appIdentifier);
|
|
38
|
+
const appId = await this.populateActionIds(workflowTemplate, workflowKey, appIdentifier);
|
|
39
39
|
const newObject = {
|
|
40
40
|
identifier: getWorkflowTemplateIdentifier(workflowTemplate),
|
|
41
41
|
name: workflowTemplate.name,
|
|
42
42
|
triggerKey: workflowTemplate.triggerKey,
|
|
43
43
|
workflowDefinition: workflowTemplate.workflowDefinition,
|
|
44
44
|
isActive: workflowTemplate.isActive,
|
|
45
|
-
supportingAppId:
|
|
45
|
+
supportingAppId: appId,
|
|
46
46
|
messageGroupId: workflowTemplate.messageGroupId,
|
|
47
47
|
messageGroup: workflowTemplate.messageGroup,
|
|
48
48
|
dynamicMessageGroupId: workflowTemplate.dynamicMessageGroupId,
|
|
@@ -56,6 +56,10 @@ class LocalWorkflowTemplateDeployer {
|
|
|
56
56
|
return newWorkflowTemplate;
|
|
57
57
|
}
|
|
58
58
|
async populateActionIds(workflowTemplate, workflowKey, appIdentifier) {
|
|
59
|
+
if (!appIdentifier) {
|
|
60
|
+
logger_1.default.info(`WORKFLOW TEMPLATES No appIdentifier for "${workflowKey}" — skipping action ID resolution.`);
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
59
63
|
const installedApps = await (0, apps_1.getInstalledApps)();
|
|
60
64
|
const appOrg = installedApps.find((x) => x.app?.identifier === appIdentifier);
|
|
61
65
|
logger_1.default.info('workflow template:', JSON.stringify(workflowTemplate, null, 2));
|
|
@@ -63,7 +67,7 @@ class LocalWorkflowTemplateDeployer {
|
|
|
63
67
|
throw new Error(`Could not find installed app with identifier "${appIdentifier}". Make sure the app is installed in this org before importing workflows.`);
|
|
64
68
|
}
|
|
65
69
|
if (!workflowTemplate?.workflowDefinition?.paths) {
|
|
66
|
-
return;
|
|
70
|
+
return appOrg.appId;
|
|
67
71
|
}
|
|
68
72
|
for (const path of workflowTemplate.workflowDefinition.paths) {
|
|
69
73
|
if (!path?.actionDefinitionConfigs) {
|
|
@@ -89,6 +93,7 @@ class LocalWorkflowTemplateDeployer {
|
|
|
89
93
|
}
|
|
90
94
|
}
|
|
91
95
|
}
|
|
96
|
+
return appOrg.appId;
|
|
92
97
|
}
|
|
93
98
|
async createWorkflowSchedule(workflowTemplate, workflowId) {
|
|
94
99
|
if (!workflowTemplate?.crons?.length) {
|
package/oclif.manifest.json
CHANGED