@cerema/cadriciel 1.4.14 → 1.4.16
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/cli/global/doctor.js +0 -9
- package/cli/global/init.js +1 -0
- package/cli/global/install.js +3 -1
- package/cli/global/login.js +11 -6
- package/cli.js +2 -1
- package/lib/cadriciel.js +6 -0
- package/package.json +1 -1
package/cli/global/doctor.js
CHANGED
|
@@ -43,15 +43,6 @@ module.exports = (args) => {
|
|
|
43
43
|
title: 'Java',
|
|
44
44
|
task: () => checkInstallation('java --version'),
|
|
45
45
|
},
|
|
46
|
-
{
|
|
47
|
-
title: 'Maven',
|
|
48
|
-
task: () => checkInstallation('mvn -v'),
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
title: 'Liquibase',
|
|
52
|
-
task: () =>
|
|
53
|
-
checkInstallation('liquibase --version', extractLiquibaseVersion),
|
|
54
|
-
},
|
|
55
46
|
],
|
|
56
47
|
{ concurrent: true, exitOnError: false }
|
|
57
48
|
);
|
package/cli/global/init.js
CHANGED
package/cli/global/install.js
CHANGED
|
@@ -86,10 +86,12 @@ module.exports = (args) => {
|
|
|
86
86
|
});
|
|
87
87
|
});
|
|
88
88
|
};
|
|
89
|
+
|
|
89
90
|
return {
|
|
90
91
|
info: {
|
|
91
92
|
title: 'install',
|
|
92
|
-
|
|
93
|
+
label: 'docker',
|
|
94
|
+
description: 'Installation des images Docker',
|
|
93
95
|
},
|
|
94
96
|
start: () => {
|
|
95
97
|
addMapping();
|
package/cli/global/login.js
CHANGED
|
@@ -14,12 +14,16 @@ module.exports = (args) => {
|
|
|
14
14
|
const querystring = require('querystring');
|
|
15
15
|
|
|
16
16
|
const app = express();
|
|
17
|
-
const PORT = 4200;
|
|
18
|
-
|
|
19
|
-
const KEYCLOAK_SERVER = 'https://orion-recette.cerema.fr';
|
|
20
17
|
const REALM = 'CeremaApps';
|
|
21
|
-
|
|
22
|
-
const
|
|
18
|
+
|
|
19
|
+
const KEYCLOAK_SERVER = 'https://orion.cerema.fr';
|
|
20
|
+
const PORT = 14211;
|
|
21
|
+
const CLIENT_ID = 'cadriciel_login';
|
|
22
|
+
|
|
23
|
+
//const KEYCLOAK_SERVER = 'https://orion-recette.cerema.fr';
|
|
24
|
+
//const PORT = 4200;
|
|
25
|
+
//const CLIENT_ID = 'marep_dev';
|
|
26
|
+
const REDIRECT_URI = 'http://localhost:' + PORT + '/login';
|
|
23
27
|
|
|
24
28
|
const INDEX_HTML = fs.readFileSync(
|
|
25
29
|
__dirname + '/../assets/index.html',
|
|
@@ -61,7 +65,7 @@ module.exports = (args) => {
|
|
|
61
65
|
|
|
62
66
|
const auth = async (wellKnownConfig) => {
|
|
63
67
|
app.use(express.static(__dirname + '/../assets'));
|
|
64
|
-
app.get('/
|
|
68
|
+
app.get('/login', (req, res) => {
|
|
65
69
|
const code = req.query.code;
|
|
66
70
|
axios
|
|
67
71
|
.post(
|
|
@@ -92,6 +96,7 @@ module.exports = (args) => {
|
|
|
92
96
|
try {
|
|
93
97
|
var response = await cadriciel.get('/login');
|
|
94
98
|
} catch (e) {
|
|
99
|
+
console.log(e);
|
|
95
100
|
console.log(' ');
|
|
96
101
|
console.log(
|
|
97
102
|
chalk.red(' [AUTH]') +
|
package/cli.js
CHANGED
|
@@ -91,6 +91,7 @@ const loadCadricielCommands = (path) => {
|
|
|
91
91
|
const label = (caption) => {
|
|
92
92
|
if (caption === 'experimental') return chalk.red(' (' + caption + ') ');
|
|
93
93
|
if (caption === 'beta') return chalk.magenta(' (' + caption + ') ');
|
|
94
|
+
if (caption === 'docker') return chalk.green(' (' + caption + ') ');
|
|
94
95
|
if (caption === 'ai')
|
|
95
96
|
return chalk.yellow(' (' + caption.toUpperCase() + ') ');
|
|
96
97
|
return '';
|
|
@@ -199,7 +200,7 @@ const displayBanner = () => {
|
|
|
199
200
|
}
|
|
200
201
|
console.log(
|
|
201
202
|
chalk.cyan(data) +
|
|
202
|
-
chalk.bold('\n CLI v
|
|
203
|
+
chalk.bold('\n CLI v' + require('./package.json').version) +
|
|
203
204
|
version_cadriciel
|
|
204
205
|
);
|
|
205
206
|
console.log(' ');
|
package/lib/cadriciel.js
CHANGED
|
@@ -29,11 +29,17 @@ class CadricielAPI {
|
|
|
29
29
|
timeout: 10000,
|
|
30
30
|
headers: { Authorization: 'Bearer ' + token },
|
|
31
31
|
});
|
|
32
|
+
console.log({
|
|
33
|
+
baseURL: baseURL,
|
|
34
|
+
timeout: 10000,
|
|
35
|
+
headers: { Authorization: 'Bearer ' + token },
|
|
36
|
+
});
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
async get(url, params = {}) {
|
|
35
40
|
try {
|
|
36
41
|
const response = await this.client.get(url, { params });
|
|
42
|
+
console.log(response);
|
|
37
43
|
return response.data;
|
|
38
44
|
} catch (error) {
|
|
39
45
|
throw error;
|