@unito/integration-cli 0.56.1 → 0.56.2

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.
@@ -6,7 +6,6 @@ const child_process_1 = tslib_1.__importDefault(require("child_process"));
6
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
7
  const baseCommand_1 = require("../baseCommand");
8
8
  const errors_1 = require("../errors");
9
- const errors_2 = require("../errors");
10
9
  class Upgrade extends baseCommand_1.BaseCommand {
11
10
  static description = 'Upgrade the CLI';
12
11
  static examples = ['<%= config.bin %> <%= command.id %>'];
@@ -18,17 +17,6 @@ class Upgrade extends baseCommand_1.BaseCommand {
18
17
  throw error;
19
18
  }
20
19
  async run() {
21
- //
22
- // Check for the presence of UNITO_GITHUB_PKG_TOKEN.
23
- //
24
- // Necessary until we deploy to a public NPM repository.
25
- //
26
- core_1.ux.action.start('Checking for the presence of UNITO_GITHUB_PKG_TOKEN');
27
- // istanbul ignore next
28
- if (!process.env.UNITO_GITHUB_PKG_TOKEN) {
29
- throw new errors_2.MissingEnvironmentVariableError('UNITO_GITHUB_PKG_TOKEN');
30
- }
31
- core_1.ux.action.stop('found');
32
20
  //
33
21
  // Global command options
34
22
  //
@@ -5,8 +5,6 @@ export declare class NoConfigurationFileError extends Error {
5
5
  }
6
6
  export declare class ConfigurationMalformed extends Error {
7
7
  }
8
- export declare class MissingEnvironmentVariableError extends Error {
9
- }
10
8
  export declare class NoRefreshTokenError extends Error {
11
9
  }
12
10
  export declare class FailedToRetrieveAccessTokenError extends Error {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handleError = exports.ConfigurationInvalid = exports.EntryDecryptionError = exports.DecryptionAuthenticationError = exports.AuthenticationFailed = exports.MissingApiKey = exports.FileSizeExceeded = exports.MissingAuth2AuthorizationError = exports.MissingCredentialsError = exports.InvalidRequestContentTypeError = exports.FailedToRetrieveAccessTokenError = exports.NoRefreshTokenError = exports.MissingEnvironmentVariableError = exports.ConfigurationMalformed = exports.NoConfigurationFileError = exports.NoIntegrationFoundError = void 0;
3
+ exports.handleError = exports.ConfigurationInvalid = exports.EntryDecryptionError = exports.DecryptionAuthenticationError = exports.AuthenticationFailed = exports.MissingApiKey = exports.FileSizeExceeded = exports.MissingAuth2AuthorizationError = exports.MissingCredentialsError = exports.InvalidRequestContentTypeError = exports.FailedToRetrieveAccessTokenError = exports.NoRefreshTokenError = exports.ConfigurationMalformed = exports.NoConfigurationFileError = exports.NoIntegrationFoundError = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const core_1 = require("@oclif/core");
6
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
@@ -17,9 +17,6 @@ exports.NoConfigurationFileError = NoConfigurationFileError;
17
17
  class ConfigurationMalformed extends Error {
18
18
  }
19
19
  exports.ConfigurationMalformed = ConfigurationMalformed;
20
- class MissingEnvironmentVariableError extends Error {
21
- }
22
- exports.MissingEnvironmentVariableError = MissingEnvironmentVariableError;
23
20
  class NoRefreshTokenError extends Error {
24
21
  }
25
22
  exports.NoRefreshTokenError = NoRefreshTokenError;
@@ -90,11 +87,6 @@ function handleError(command, error) {
90
87
  command.logToStderr(`This file should be located at ${chalk_1.default.yellowBright(path_1.default.relative(process.cwd(), (0, configuration_1.getConfigurationPath)()))}.`);
91
88
  handled = true;
92
89
  }
93
- else if (error instanceof MissingEnvironmentVariableError) {
94
- command.logToStderr(chalk_1.default.redBright('This command requires a variable which is missing from your environment :('));
95
- command.logToStderr(`Make sure the environment variable ${chalk_1.default.yellowBright(error.message)} is defined.`);
96
- handled = true;
97
- }
98
90
  else if (error instanceof ConfigurationMalformed) {
99
91
  command.logToStderr(chalk_1.default.redBright(`Your ${chalk_1.default.yellowBright(configuration_1.DEFAULT_CONFIGURATION_NAME)} was found but its not a valid JSON file!`));
100
92
  handled = true;
@@ -82,7 +82,7 @@ describe('Login', () => {
82
82
  test_1.test
83
83
  .stdout()
84
84
  .stub(GlobalConfiguration, 'read', () => {
85
- throw new errors_1.MissingEnvironmentVariableError();
85
+ throw new errors_1.ConfigurationMalformed();
86
86
  })
87
87
  .command(['login'])
88
88
  .exit(-1)
@@ -39,7 +39,7 @@ describe('Upgrade', () => {
39
39
  test_1.test
40
40
  .stdout()
41
41
  .stub(child_process_1.default, 'execSync', () => {
42
- throw new errors_1.MissingEnvironmentVariableError();
42
+ throw new errors_1.ConfigurationMalformed();
43
43
  })
44
44
  .command(['upgrade'])
45
45
  .exit(-1)
@@ -37,21 +37,13 @@ describe('handleError', () => {
37
37
  (0, chai_1.expect)(stdErrStub.firstCall.args[0]).to.equal(chalk_1.default.redBright('This command requires a configuration file for your integration :('));
38
38
  (0, chai_1.expect)(stdErrStub.secondCall.args[0]).to.equal(`This file should be located at ${chalk_1.default.yellowBright(path_1.default.relative(process.cwd(), (0, configuration_1.getConfigurationPath)()))}.`);
39
39
  });
40
- it('should handle MissingEnvironmentVariableError', () => {
41
- const error = new errors_1.MissingEnvironmentVariableError('VAR_NAME');
42
- const handled = (0, errors_1.handleError)(command, error);
43
- (0, chai_1.expect)(handled).to.be.true;
44
- (0, chai_1.expect)(stdErrStub.calledTwice).to.be.true;
45
- (0, chai_1.expect)(stdErrStub.firstCall.args[0]).to.equal(chalk_1.default.redBright('This command requires a variable which is missing from your environment :('));
46
- (0, chai_1.expect)(stdErrStub.secondCall.args[0]).to.equal(`Make sure the environment variable ${chalk_1.default.yellowBright('VAR_NAME')} is defined.`);
47
- });
48
40
  it('should return false for unrecognized error', () => {
49
41
  const error = new Error('Unrecognized error');
50
42
  const handled = (0, errors_1.handleError)(command, error);
51
43
  (0, chai_1.expect)(handled).to.be.false;
52
44
  (0, chai_1.expect)(stdErrStub.called).to.be.false;
53
45
  });
54
- it('should handle MissingEnvironmentVariableError', () => {
46
+ it('should handle ConfigurationInvalid', () => {
55
47
  const error = new errors_1.ConfigurationInvalid('VAR_NAME', 'details', 'prettyDetails');
56
48
  const handled = (0, errors_1.handleError)(command, error);
57
49
  (0, chai_1.expect)(handled).to.be.true;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.56.1",
2
+ "version": "0.56.2",
3
3
  "commands": {
4
4
  "activity": {
5
5
  "id": "activity",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unito/integration-cli",
3
- "version": "0.56.1",
3
+ "version": "0.56.2",
4
4
  "description": "Integration CLI",
5
5
  "bin": {
6
6
  "integration-cli": "./bin/run"