@contrail/cli 3.6.0-alpha-8-alpha.f16d816 → 3.6.0-alpha-8-alpha.2ab4f80

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.6.0-alpha-8-alpha.f16d816 linux-x64 node-v24.21.0
20
+ @contrail/cli/3.6.0-alpha-8-alpha.2ab4f80 linux-x64 node-v24.21.0
21
21
  $ contrail --help [COMMAND]
22
22
  USAGE
23
23
  $ contrail COMMAND
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getVersionFromPackageJson = exports.authUser = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const amazon_cognito_identity_js_1 = require("amazon-cognito-identity-js");
6
- const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
7
6
  const sdk_1 = require("@contrail/sdk");
8
7
  const config_1 = require("../helpers/config/config");
9
8
  const logger_1 = tslib_1.__importDefault(require("../logger"));
@@ -63,7 +62,7 @@ exports.authUser = authUser;
63
62
  async function getOrgSlug(config) {
64
63
  const orgSlug = config?.orgSlug || process.env.CONTRAIL_CLI_ORG_SLUG;
65
64
  if (!orgSlug) {
66
- const answers = await inquirer_1.default.prompt([
65
+ const answers = await (0, common_1.promptOnStderr)([
67
66
  {
68
67
  type: 'input',
69
68
  name: 'orgSlug',
@@ -106,7 +105,7 @@ async function authenticateWithUsernamePassword(config) {
106
105
  message: 'Password',
107
106
  });
108
107
  }
109
- const answers = await inquirer_1.default.prompt(questions);
108
+ const answers = await (0, common_1.promptOnStderr)(questions);
110
109
  const params = {
111
110
  email: process.env.CONTRAIL_CLI_EMAIL || answers.email,
112
111
  password: process.env.CONTRAIL_CLI_PASSWORD || answers.password,
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BaseCommand = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const core_1 = require("@oclif/core");
6
+ const common_1 = require("./common");
6
7
  const logger_1 = tslib_1.__importDefault(require("./logger"));
7
- const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
8
8
  const config_1 = require("./helpers/config/config");
9
9
  const lodash_1 = require("lodash");
10
10
  const login_1 = require("./auth/login");
@@ -73,7 +73,7 @@ class BaseCommand extends core_1.Command {
73
73
  choices: ['yes', 'no'],
74
74
  default: 'no',
75
75
  });
76
- const { confirm } = await inquirer_1.default.prompt(questions);
76
+ const { confirm } = await (0, common_1.promptOnStderr)(questions);
77
77
  if (confirm === 'no') {
78
78
  logger_1.default.info('Please use `contrail config use` command to choose the configuration or `contrail config set --environment=prod` to set different environment.');
79
79
  this.exit(1);
package/dist/common.d.ts CHANGED
@@ -4,3 +4,4 @@ export declare function delay(ms: number): Promise<NodeJS.Timeout>;
4
4
  export declare function removeSlash(string: string): string;
5
5
  export declare function routeConsoleLogToStderr(): void;
6
6
  export declare function sdkErrorMessage(reason: any): string;
7
+ export declare const promptOnStderr: any;
package/dist/common.js CHANGED
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sdkErrorMessage = exports.routeConsoleLogToStderr = exports.removeSlash = exports.delay = exports.getSeparatorByPlatform = void 0;
3
+ exports.promptOnStderr = exports.sdkErrorMessage = exports.routeConsoleLogToStderr = exports.removeSlash = exports.delay = exports.getSeparatorByPlatform = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
4
6
  function getSeparatorByPlatform() {
5
7
  const isWin = process.platform === 'win32';
6
8
  const separator = isWin ? '\\' : '/';
@@ -28,3 +30,6 @@ function sdkErrorMessage(reason) {
28
30
  return reason?.message || reason?.details || String(reason);
29
31
  }
30
32
  exports.sdkErrorMessage = sdkErrorMessage;
33
+ // inquirer renders prompt UI to its output stream directly, bypassing the
34
+ // console.log redirect; stdout must stay data-only
35
+ exports.promptOnStderr = inquirer_1.default.createPromptModule({ output: process.stderr });
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadData = exports.saveData = exports.parseFileAsJsonArray = exports.parseCSVData = exports.safeFileOverwrite = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const path = tslib_1.__importStar(require("path"));
6
+ const common_1 = require("../common");
6
7
  const fs_1 = tslib_1.__importDefault(require("fs"));
7
- const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
8
8
  const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
9
9
  const logger_1 = tslib_1.__importDefault(require("../logger"));
10
10
  const sync_1 = require("csv-parse/sync");
@@ -15,7 +15,7 @@ async function safeFileOverwrite(fileLocation, overwrite) {
15
15
  logger_1.default.info(`overwriting ${fileLocation}`);
16
16
  return true;
17
17
  }
18
- const answers = await inquirer_1.default.prompt([
18
+ const answers = await (0, common_1.promptOnStderr)([
19
19
  {
20
20
  type: 'confirm',
21
21
  name: 'shouldOverwrite',
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.6.0-alpha-8-alpha.f16d816",
2
+ "version": "3.6.0-alpha-8-alpha.2ab4f80",
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.6.0-alpha-8-alpha.f16d816",
3
+ "version": "3.6.0-alpha-8-alpha.2ab4f80",
4
4
  "description": "VibeIQ's Contrail Platform CLI.",
5
5
  "bin": {
6
6
  "contrail-cli": "./bin/run",