Files
bruno/packages/bruno-cli/src/constants.js
Sanjai Kumar 8d2f087206 feat: enhance json environment file support in bruno-cli (#5660)
* feat: enhance json environment file support in bruno-cli

feat: add parseEnvironmentJson function to normalize environment JSON structure

lint fixes

feat: added tests for invalid JSON environment files in CLI and added missing constant defenition.

feat: improve JSON environment file handling and update tests

Trigger test

fix: update CLI command syntax for non-existent JSON environment file test

fix: correct CLI command syntax in test for non-existent JSON environment file

fix: update CLI command syntax in test for non-existent JSON environment file

fix: update test to use temporary path for non-existent JSON environment file

trying to fix the tests

fix tests

refactor: rename ERROR_INVALID_JSON to ERROR_INVALID_FILE and update related error handling in CLI commands and tests

fix: update parseEnvironmentJson to preserve secret flag

test: improved tests

* refactor: move parseEnvironmentJson function to utils/ environment.js file and update imports

* test: update tests
2025-10-07 12:49:22 +05:30

37 lines
1.0 KiB
JavaScript

const { version } = require('../package.json');
const CLI_EPILOGUE = `Documentation: https://docs.usebruno.com (v${version})`;
const CLI_VERSION = version;
// Exit codes
const EXIT_STATUS = {
// One or more assertions, tests, or requests failed
ERROR_FAILED_COLLECTION: 1,
// The specified output dir does not exist
ERROR_MISSING_OUTPUT_DIR: 2,
// request chain caused an endless loop
ERROR_INFINITE_LOOP: 3,
// bru was called outside of a collection root
ERROR_NOT_IN_COLLECTION: 4,
// The specified file was not found
ERROR_FILE_NOT_FOUND: 5,
// The specified environment was not found
ERROR_ENV_NOT_FOUND: 6,
// Environment override not presented as string or object
ERROR_MALFORMED_ENV_OVERRIDE: 7,
// Environment overrides format incorrect
ERROR_INCORRECT_ENV_OVERRIDE: 8,
// Invalid output format requested
ERROR_INCORRECT_OUTPUT_FORMAT: 9,
// Invalid file format
ERROR_INVALID_FILE: 10,
// Everything else
ERROR_GENERIC: 255
};
module.exports = {
CLI_EPILOGUE,
CLI_VERSION,
EXIT_STATUS
};