@cerema/cadriciel 1.4.37 → 1.4.38

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.
Files changed (2) hide show
  1. package/lib/cadriciel.js +6 -10
  2. package/package.json +1 -1
package/lib/cadriciel.js CHANGED
@@ -5,28 +5,24 @@ const fs = require('fs');
5
5
  const os = require('os');
6
6
  const HomeDir = os.homedir() + '/.cadriciel';
7
7
  const { error } = require('./message');
8
+ const https = require('https');
8
9
  var baseURL = global.CADRICIEL_URI;
9
10
  class CadricielAPI {
10
11
  constructor(token) {
12
+ const httpsAgent = new https.Agent({
13
+ rejectUnauthorized: false,
14
+ });
11
15
  if (!token) {
12
16
  try {
13
17
  token = fs.readFileSync(HomeDir + '/account', 'utf-8');
14
18
  token = token.replace(/\n/g, '');
15
- } catch (e) {
16
- /*console.log(e);
17
- console.log(
18
- chalk.bold(' [AUTH] ') +
19
- chalk.red(
20
- ' Vous devez être authentifié pour utiliser cette fonctionnalité.'
21
- )
22
- );
23
- return process.exit(1);*/
24
- }
19
+ } catch (e) {}
25
20
  }
26
21
  this.client = axios.create({
27
22
  baseURL: baseURL,
28
23
  timeout: 10000,
29
24
  headers: { Authorization: 'Bearer ' + token },
25
+ httpsAgent: httpsAgent,
30
26
  });
31
27
  }
32
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerema/cadriciel",
3
- "version": "1.4.37",
3
+ "version": "1.4.38",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "npm": ">=8.0.0",