@contrail/cli 3.5.3-alpha.b575364 → 3.5.3-alpha.d39a3e1

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.3-alpha.b575364 linux-x64 node-v24.16.0
20
+ @contrail/cli/3.5.3-alpha.d39a3e1 linux-x64 node-v24.16.0
21
21
  $ contrail --help [COMMAND]
22
22
  USAGE
23
23
  $ contrail COMMAND
@@ -19,9 +19,9 @@ exports.DEFAULT_FILE_LOCATION = 'workflows.yml';
19
19
  class ExportWorkflows extends basecommand_1.BaseCommand {
20
20
  static description = 'Export all workflows in the org. By default exports one file per app to the current directory.';
21
21
  static examples = [
22
- `$ contrail workflow-templates export`,
23
- `$ contrail workflow-templates export --dir ./workflows`,
24
- `$ contrail workflow-templates export --outFile workflows.yml`,
22
+ '$ contrail workflow-templates export',
23
+ '$ contrail workflow-templates export --dir ./workflows',
24
+ '$ contrail workflow-templates export --outFile workflows.yml',
25
25
  ];
26
26
  static flags = {
27
27
  ...basecommand_1.BaseCommand.baseFlags,
@@ -78,7 +78,8 @@ async function exportWorkflowsByApp(outputDir, overwrite) {
78
78
  if (!appIdentifier && workflow.identifier) {
79
79
  const match = workflow.identifier.match(/^@([^@]+)@/);
80
80
  if (match) {
81
- appIdentifier = match[1];
81
+ // Keep the @ prefix in the appIdentifier
82
+ appIdentifier = `@${match[1]}`;
82
83
  }
83
84
  }
84
85
  if (appIdentifier) {
@@ -106,7 +107,13 @@ async function exportWorkflowsByApp(outputDir, overwrite) {
106
107
  console.log(`${chalk_1.default.green('EXPORTED')} ${filePath}`);
107
108
  }
108
109
  if (unassigned.length > 0) {
109
- console.log(`${chalk_1.default.yellow('SKIPPED')} ${unassigned.length} workflows could not be associated with an app. Re-run with --outFile to export them to a single file.`);
110
+ const unassignedObj = { workflows: [] };
111
+ for (const workflow of unassigned) {
112
+ unassignedObj.workflows.push(await buildExportWorkflow(workflow, allSchedules));
113
+ }
114
+ const unassignedFilePath = path.join(resolvedDir, 'workflows-unassigned.yml');
115
+ await writeYamlFile(unassignedObj, unassignedFilePath, overwrite);
116
+ console.log(`${chalk_1.default.yellow('EXPORTED')} ${unassignedFilePath} (unassigned workflows)`);
110
117
  }
111
118
  }
112
119
  exports.exportWorkflowsByApp = exportWorkflowsByApp;
@@ -20,7 +20,6 @@ class LocalWorkflowTemplateDeployer {
20
20
  const existingWorkflows = await (0, event_workflow_templates_1.getExistingWorkflowTemplates)();
21
21
  // UPSERT / DELETE BASED ON WORKFLOW TEMPLATES IDENTIFIER
22
22
  logger_1.default.info(`${chalk_1.default.yellow.bold('WORKFLOW TEMPLATES')} Deploying workflow templates.`);
23
- logger_1.default.info(wtDeclaration);
24
23
  for (const workflowKey of Object.keys(wtDeclaration.workflows)) {
25
24
  await this.deployWorkflowTemplate(wtDeclaration.workflows[workflowKey], existingWorkflows, wtDeclaration.appIdentifier);
26
25
  }
@@ -57,8 +56,10 @@ class LocalWorkflowTemplateDeployer {
57
56
  }
58
57
  async populateActionIds(workflowTemplate, workflowKey, appIdentifier) {
59
58
  const installedApps = await (0, apps_1.getInstalledApps)();
60
- const appOrg = installedApps.find((x) => x.app.identifier === appIdentifier);
61
- logger_1.default.info('workflow template:', JSON.stringify(workflowTemplate, null, 2));
59
+ const appOrg = installedApps.find((x) => x.app?.identifier === appIdentifier);
60
+ if (!appOrg) {
61
+ throw new Error(`Could not find installed app with identifier "${appIdentifier}". Make sure the app is installed in this org before importing workflows.`);
62
+ }
62
63
  if (!workflowTemplate?.workflowDefinition?.paths) {
63
64
  return;
64
65
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.5.3-alpha.b575364",
2
+ "version": "3.5.3-alpha.d39a3e1",
3
3
  "commands": {
4
4
  "app:create": {
5
5
  "id": "app:create",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/cli",
3
- "version": "3.5.3-alpha.b575364",
3
+ "version": "3.5.3-alpha.d39a3e1",
4
4
  "description": "VibeIQ's Contrail Platform CLI.",
5
5
  "bin": {
6
6
  "contrail-cli": "./bin/run",