Skip to content

Commit

Permalink
Bump eslint from 8.57.0 to 9.7.0 in /Framework (#2481)
Browse files Browse the repository at this point in the history
* Bump eslint from 8.57.0 to 9.7.0 in /Framework

Bumps [eslint](https://github.com/eslint/eslint) from 8.57.0 to 9.7.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v8.57.0...v9.7.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Add new eslint config file

* Auto-fix eslint

* Further manual migration changes

* Make use of prototype has own property

* Remove retries for tests

* Fix potential 0 values of timeout

* Remove fix from eslint command

---------
Co-authored-by: George Raduta <[email protected]>
  • Loading branch information
dependabot[bot] and graduta authored Jul 27, 2024
1 parent f2d5eb9 commit dae3cb7
Show file tree
Hide file tree
Showing 58 changed files with 1,899 additions and 1,261 deletions.
15 changes: 8 additions & 7 deletions Framework/Backend/db/mysql.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

const mysql = require('mysql');
const assert = require('assert');
const {LogManager} = require('../log/LogManager');
const { LogManager } = require('../log/LogManager');

/**
* MySQL pool wrapper
Expand All @@ -32,11 +32,11 @@ class MySQL {
assert(config.host, 'Missing config value: mysql.host');
assert(config.user, 'Missing config value: mysql.user');
assert(config.database, 'Missing config value: mysql.database');
config.port = (!config.port) ? 3306 : config.port;
config.connectionLimit = (!config.connectionLimit) ? 25 : config.connectionLimit;
config.queueLimit = (!config.queueLimit) ? 50 : config.queueLimit;
config.password = (!config.password) ? '' : config.password;
config.timeout = (!config.timeout) ? 30000 : config.timeout;
config.port = !config.port ? 3306 : config.port;
config.connectionLimit = config.connectionLimit ?? 25;
config.queueLimit = config.queueLimit ?? 50;
config.password = !config.password ? '' : config.password;
config.timeout = config.timeout ?? 30000;

this.config = config;
this.logger = LogManager.getLogger(`${process.env.npm_config_log_label ?? 'framework'}/mysql`);
Expand All @@ -45,7 +45,7 @@ class MySQL {

/**
* Method to test connection of mysql connector once initialized
* @return {Promise}
* @return {Promise} - a promise that resolves if connection is successful
*/
testConnection() {
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -113,4 +113,5 @@ class MySQL {
return message;
}
}

module.exports = MySQL;
12 changes: 6 additions & 6 deletions Framework/Backend/errors/grpcErrorToNativeError.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
* or submit itself to any jurisdiction.
*/

const {InvalidInputError} = require('./InvalidInputError.js');
const {NotFoundError} = require('./NotFoundError.js');
const {ServiceUnavailableError} = require('./ServiceUnavailableError.js');
const {TimeoutError} = require('./TimeoutError.js');
const {UnauthorizedAccessError} = require('./UnauthorizedAccessError.js');
const { InvalidInputError } = require('./InvalidInputError.js');
const { NotFoundError } = require('./NotFoundError.js');
const { ServiceUnavailableError } = require('./ServiceUnavailableError.js');
const { TimeoutError } = require('./TimeoutError.js');
const { UnauthorizedAccessError } = require('./UnauthorizedAccessError.js');

/**
* @typedef GrpcError
* also known as gRPC Status Object
*
*
* @property {number} code - code of the gRPC Status object
* @property {string} message - message of the gRPC Status object
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
* or submit itself to any jurisdiction.
*/

const {InvalidInputError} = require('./InvalidInputError.js');
const {NotFoundError} = require('./NotFoundError.js');
const {ServiceUnavailableError} = require('./ServiceUnavailableError.js');
const {TimeoutError} = require('./TimeoutError.js');
const {UnauthorizedAccessError} = require('./UnauthorizedAccessError.js');
const { InvalidInputError } = require('./InvalidInputError.js');
const { NotFoundError } = require('./NotFoundError.js');
const { ServiceUnavailableError } = require('./ServiceUnavailableError.js');
const { TimeoutError } = require('./TimeoutError.js');
const { UnauthorizedAccessError } = require('./UnauthorizedAccessError.js');

/**
* Given an Express response object and an error, use the response object to set a custom status code and send the message
Expand All @@ -27,7 +27,7 @@ const {UnauthorizedAccessError} = require('./UnauthorizedAccessError.js');
const updateAndSendExpressResponseFromNativeError = (response, error) => {
let status = 500;
let title = 'Unknown Error';
const {message, constructor} = error;
const { message, constructor } = error;
switch (constructor) {
case InvalidInputError:
status = 400;
Expand All @@ -51,7 +51,7 @@ const updateAndSendExpressResponseFromNativeError = (response, error) => {
break;
}

response.status(status).json({message, status, title});
response.status(status).json({ message, status, title });
};

exports.updateAndSendExpressResponseFromNativeError = updateAndSendExpressResponseFromNativeError;
10 changes: 5 additions & 5 deletions Framework/Backend/http/openid.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
* or submit itself to any jurisdiction.
*/

const {Issuer, generators, custom} = require('openid-client');
const { Issuer, generators, custom } = require('openid-client');
const assert = require('assert');
const {LogManager} = require('../log/LogManager');
const { LogManager } = require('../log/LogManager');

/**
* Authenticates and authorises users via OpenID Connect (new CERN SSO).
* Authenticates and authorizes users via OpenID Connect (new CERN SSO).
* @author Adam Wegrzynek <[email protected]>
*/
class OpenId {
Expand All @@ -30,7 +30,7 @@ class OpenId {
assert(config.secret, 'Missing config value: secret');
assert(config.well_known, 'Missing config value: well_known');
assert(config.redirect_uri, 'Missing config value: redirect_uri');
config.timeout = (!config.timeout) ? 5000 : config.timeout;
config.timeout = config.timeout ?? 5000;
this.config = config;
this.code_verifier = generators.codeVerifier();
custom.setHttpOptionsDefaults({
Expand Down Expand Up @@ -59,7 +59,7 @@ class OpenId {
this.logger.info('Client initialised');
resolve();
}).catch((error) => {
this.logger.error('Initialisation failed: ' + error);
this.logger.error(`Initialisation failed: ${error}`);
reject(error);
});
});
Expand Down
Loading

0 comments on commit dae3cb7

Please sign in to comment.