trm-client 4.4.0 → 4.5.0
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/changelog.txt +13 -0
- package/dist/commands/alias.js +36 -24
- package/dist/commands/arguments/AliasArguments.d.ts +1 -1
- package/dist/commands/createAlias.js +3 -1
- package/dist/commands/info.js +11 -2
- package/dist/commands/prompts/connect.js +29 -3
- package/dist/index.js +3 -6
- package/dist/systemAlias/SystemAlias.js +4 -1
- package/dist/utils/NoConnection.d.ts +1 -0
- package/dist/utils/NoConnection.js +1 -0
- package/dist/utils/executeCommand.js +15 -15
- package/dist/utils/logError.js +28 -17
- package/package.json +2 -3
package/changelog.txt
CHANGED
|
@@ -8,6 +8,19 @@ Legend
|
|
|
8
8
|
+ : added
|
|
9
9
|
- : removed
|
|
10
10
|
|
|
11
|
+
2025-05-08 v4.5.0
|
|
12
|
+
-------------------
|
|
13
|
+
|
|
14
|
+
! trm-core ^6.7.0
|
|
15
|
+
! error handling
|
|
16
|
+
* alias command/saprouter alias save
|
|
17
|
+
* fix connection validators
|
|
18
|
+
|
|
19
|
+
2025-04-28 v4.4.1
|
|
20
|
+
-------------------
|
|
21
|
+
|
|
22
|
+
* node-r3trans version read
|
|
23
|
+
|
|
11
24
|
2025-04-28 v4.4.0
|
|
12
25
|
-------------------
|
|
13
26
|
|
package/dist/commands/alias.js
CHANGED
|
@@ -27,6 +27,7 @@ const _create = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
29
|
const _view = (alias) => {
|
|
30
|
+
const client = alias.login.client;
|
|
30
31
|
const lang = alias.login.lang;
|
|
31
32
|
const user = alias.login.user;
|
|
32
33
|
const hasPassword = alias.login.passwd ? true : false;
|
|
@@ -83,6 +84,12 @@ const _view = (alias) => {
|
|
|
83
84
|
else {
|
|
84
85
|
trm_commons_1.Logger.warning(`Logon language: Unknown`);
|
|
85
86
|
}
|
|
87
|
+
if (client) {
|
|
88
|
+
trm_commons_1.Logger.info(`Logon client: ${client}`);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
trm_commons_1.Logger.warning(`Logon client: Unknown`);
|
|
92
|
+
}
|
|
86
93
|
if (user) {
|
|
87
94
|
trm_commons_1.Logger.info(`Logon user: ${user}`);
|
|
88
95
|
}
|
|
@@ -90,7 +97,7 @@ const _view = (alias) => {
|
|
|
90
97
|
trm_commons_1.Logger.warning(`Logon user: Unknown`);
|
|
91
98
|
}
|
|
92
99
|
if (hasPassword) {
|
|
93
|
-
trm_commons_1.Logger.info(`Logon password:
|
|
100
|
+
trm_commons_1.Logger.info(`Logon password: SAVED IN PLAIN TEXT`);
|
|
94
101
|
}
|
|
95
102
|
else {
|
|
96
103
|
trm_commons_1.Logger.warning(`Logon password: Unknown`);
|
|
@@ -138,7 +145,8 @@ const _edit = (alias) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
138
145
|
}, {
|
|
139
146
|
lang: connectionArgs.lang,
|
|
140
147
|
passwd: connectionArgs.passwd,
|
|
141
|
-
user: connectionArgs.user
|
|
148
|
+
user: connectionArgs.user,
|
|
149
|
+
client: connectionArgs.client
|
|
142
150
|
});
|
|
143
151
|
}
|
|
144
152
|
yield updatedAlias.getConnection().connect();
|
|
@@ -174,7 +182,8 @@ const _edit = (alias) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
174
182
|
}, {
|
|
175
183
|
lang: alias.login.lang,
|
|
176
184
|
passwd: alias.login.passwd,
|
|
177
|
-
user: alias.login.user
|
|
185
|
+
user: alias.login.user,
|
|
186
|
+
client: alias.login.client
|
|
178
187
|
});
|
|
179
188
|
}
|
|
180
189
|
}
|
|
@@ -188,35 +197,38 @@ const _delete = (alias) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
188
197
|
function alias(commandArgs) {
|
|
189
198
|
return __awaiter(this, void 0, void 0, function* () {
|
|
190
199
|
const aAlias = systemAlias_1.SystemAlias.getAll();
|
|
191
|
-
var aliasPick;
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
200
|
+
var aliasPick = '';
|
|
201
|
+
var inq1Choices = [];
|
|
202
|
+
if (commandArgs.alias) {
|
|
203
|
+
if (!aAlias.find(o => o.alias === commandArgs.alias)) {
|
|
204
|
+
trm_commons_1.Logger.warning(`Alias "${commandArgs.alias}" not found.`);
|
|
205
|
+
inq1Choices.push({
|
|
206
|
+
name: `Create alias`,
|
|
207
|
+
value: `create`
|
|
208
|
+
});
|
|
195
209
|
}
|
|
196
210
|
else {
|
|
197
|
-
aliasPick = commandArgs.
|
|
211
|
+
aliasPick = commandArgs.alias;
|
|
198
212
|
}
|
|
199
213
|
}
|
|
214
|
+
inq1Choices = inq1Choices.concat([{
|
|
215
|
+
name: aliasPick ? `View "${aliasPick}"` : `View alias`,
|
|
216
|
+
value: `pick_view`
|
|
217
|
+
}, {
|
|
218
|
+
name: aliasPick ? `Check "${aliasPick}" connection` : `Check alias connection`,
|
|
219
|
+
value: `pick_check`
|
|
220
|
+
}, {
|
|
221
|
+
name: aliasPick ? `Edit "${aliasPick}"` : `Edit alias`,
|
|
222
|
+
value: `pick_edit`
|
|
223
|
+
}, {
|
|
224
|
+
name: aliasPick ? `Delete "${aliasPick}"` : `Delete alias`,
|
|
225
|
+
value: `pick_delete`
|
|
226
|
+
}]);
|
|
200
227
|
const inq1 = yield trm_commons_1.Inquirer.prompt({
|
|
201
228
|
name: `action`,
|
|
202
229
|
message: `Action`,
|
|
203
230
|
type: `list`,
|
|
204
|
-
choices:
|
|
205
|
-
name: `Create alias`,
|
|
206
|
-
value: `create`
|
|
207
|
-
}, {
|
|
208
|
-
name: `View alias`,
|
|
209
|
-
value: `pick_view`
|
|
210
|
-
}, {
|
|
211
|
-
name: `Check alias connection`,
|
|
212
|
-
value: `pick_check`
|
|
213
|
-
}, {
|
|
214
|
-
name: `Edit alias`,
|
|
215
|
-
value: `pick_edit`
|
|
216
|
-
}, {
|
|
217
|
-
name: `Delete alias`,
|
|
218
|
-
value: `pick_delete`
|
|
219
|
-
}]
|
|
231
|
+
choices: inq1Choices
|
|
220
232
|
});
|
|
221
233
|
if (inq1.action.startsWith(`pick_`) && !aliasPick) {
|
|
222
234
|
const inq2 = yield trm_commons_1.Inquirer.prompt({
|
|
@@ -20,6 +20,7 @@ function createAlias(commandArgs) {
|
|
|
20
20
|
noSystemAlias: true,
|
|
21
21
|
force: true
|
|
22
22
|
}, false);
|
|
23
|
+
trm_commons_1.Logger.loading(`Connecting to "${commandArgs.alias}"...`);
|
|
23
24
|
var alias;
|
|
24
25
|
if (connectionArgs.type === utils_1.SystemConnectorType.RFC) {
|
|
25
26
|
alias = systemAlias_1.SystemAlias.create(commandArgs.alias, connectionArgs.type, {
|
|
@@ -41,7 +42,8 @@ function createAlias(commandArgs) {
|
|
|
41
42
|
}, {
|
|
42
43
|
lang: connectionArgs.lang,
|
|
43
44
|
passwd: connectionArgs.passwd,
|
|
44
|
-
user: connectionArgs.user
|
|
45
|
+
user: connectionArgs.user,
|
|
46
|
+
client: connectionArgs.client
|
|
45
47
|
});
|
|
46
48
|
}
|
|
47
49
|
if (alias) {
|
package/dist/commands/info.js
CHANGED
|
@@ -31,7 +31,7 @@ const _getDependencyVersion = (moduleName, rootModule = 'trm-client') => {
|
|
|
31
31
|
file = (0, fs_1.readFileSync)(path_1.default.join(get_root_path_1.rootPath, `/node_modules/${moduleName}/package.json`));
|
|
32
32
|
}
|
|
33
33
|
if (!file) {
|
|
34
|
-
trm_commons_1.Logger.warning(`Library ${moduleName} was not found!`, true);
|
|
34
|
+
trm_commons_1.Logger.warning(`Library ${moduleName} (root ${rootModule}) was not found!`, true);
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
37
|
return JSON.parse(file.toString()).version;
|
|
@@ -77,9 +77,18 @@ function info(commandArgs) {
|
|
|
77
77
|
const trmDependenciesInstances = commons_1.CommandContext.trmDependencies;
|
|
78
78
|
const trmMissingDependencies = commons_1.CommandContext.missingTrmDependencies;
|
|
79
79
|
const nodeRfcVersion = _getNodeRfcVersion(npmGlobal);
|
|
80
|
-
const nodeR3transVersion = _getDependencyVersion("node-r3trans", "trm-core");
|
|
81
80
|
const packages = yield commons_1.CommandContext.getSystemPackages();
|
|
82
81
|
const trmRest = packages.find(o => o.compareName("trm-rest") && o.compareRegistry(new trm_core_1.Registry(trm_core_1.PUBLIC_RESERVED_KEYWORD)));
|
|
82
|
+
var nodeR3transVersion;
|
|
83
|
+
try {
|
|
84
|
+
nodeR3transVersion = _getDependencyVersion("node-r3trans", "trm-core");
|
|
85
|
+
if (!nodeR3transVersion) {
|
|
86
|
+
throw new Error();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
catch (e) {
|
|
90
|
+
nodeR3transVersion = _getDependencyVersion("node-r3trans");
|
|
91
|
+
}
|
|
83
92
|
var clientDependenciesTree = [];
|
|
84
93
|
if (clientDependencies) {
|
|
85
94
|
for (const d of Object.keys(clientDependencies).filter(k => k.startsWith('trm'))) {
|
|
@@ -174,7 +174,7 @@ function connect(commandArgs, createAliasIfNotExist = true, addNoConnection) {
|
|
|
174
174
|
type: `input`,
|
|
175
175
|
name: `forwardRfcDest`,
|
|
176
176
|
message: `Forward RFC Destination`,
|
|
177
|
-
default: commandArgs.forwardRfcDest,
|
|
177
|
+
default: commandArgs.forwardRfcDest || 'NONE',
|
|
178
178
|
when: (hash) => {
|
|
179
179
|
return hash.type === 'REST' && (commandArgs.forwardRfcDest || force);
|
|
180
180
|
}
|
|
@@ -194,6 +194,14 @@ function connect(commandArgs, createAliasIfNotExist = true, addNoConnection) {
|
|
|
194
194
|
default: commandArgs.dest,
|
|
195
195
|
when: (hash) => {
|
|
196
196
|
return hash.type === 'RFC' && ((commandArgs.dest ? false : true) || force);
|
|
197
|
+
},
|
|
198
|
+
validate: (val) => {
|
|
199
|
+
if (val && /^\w{3}$/.test(val)) {
|
|
200
|
+
return true;
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
return `Invalid input: expected length 3, only letters allowed`;
|
|
204
|
+
}
|
|
197
205
|
}
|
|
198
206
|
}, {
|
|
199
207
|
type: `input`,
|
|
@@ -202,6 +210,14 @@ function connect(commandArgs, createAliasIfNotExist = true, addNoConnection) {
|
|
|
202
210
|
default: commandArgs.sysnr,
|
|
203
211
|
when: (hash) => {
|
|
204
212
|
return hash.type === 'RFC' && ((commandArgs.sysnr ? false : true) || force);
|
|
213
|
+
},
|
|
214
|
+
validate: (val) => {
|
|
215
|
+
if (val && /^\d{2}$/.test(val)) {
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
return `Invalid input: expected length 2, only numbers allowed`;
|
|
220
|
+
}
|
|
205
221
|
}
|
|
206
222
|
}, {
|
|
207
223
|
type: `input`,
|
|
@@ -217,7 +233,15 @@ function connect(commandArgs, createAliasIfNotExist = true, addNoConnection) {
|
|
|
217
233
|
message: `Logon Client`,
|
|
218
234
|
default: commandArgs.client,
|
|
219
235
|
when: (hash) => {
|
|
220
|
-
return (
|
|
236
|
+
return (commandArgs.client ? false : true) || force;
|
|
237
|
+
},
|
|
238
|
+
validate: (val) => {
|
|
239
|
+
if (val && /^\d{3}$/.test(val)) {
|
|
240
|
+
return true;
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
return `Invalid input: expected length 3, only numbers allowed`;
|
|
244
|
+
}
|
|
221
245
|
}
|
|
222
246
|
}, {
|
|
223
247
|
type: `input`,
|
|
@@ -281,6 +305,7 @@ function connect(commandArgs, createAliasIfNotExist = true, addNoConnection) {
|
|
|
281
305
|
else if (result.type === utils_1.SystemConnectorType.REST) {
|
|
282
306
|
result.endpoint = result.endpoint || commandArgs.endpoint;
|
|
283
307
|
result.forwardRfcDest = result.forwardRfcDest || commandArgs.forwardRfcDest;
|
|
308
|
+
result.client = result.client || commandArgs.client;
|
|
284
309
|
if (result.forwardRfcDest) {
|
|
285
310
|
result.forwardRfcDest = result.forwardRfcDest.toUpperCase();
|
|
286
311
|
}
|
|
@@ -295,7 +320,8 @@ function connect(commandArgs, createAliasIfNotExist = true, addNoConnection) {
|
|
|
295
320
|
login: {
|
|
296
321
|
user: result.user,
|
|
297
322
|
passwd: result.passwd,
|
|
298
|
-
lang: result.lang
|
|
323
|
+
lang: result.lang,
|
|
324
|
+
client: result.client
|
|
299
325
|
}
|
|
300
326
|
});
|
|
301
327
|
}
|
package/dist/index.js
CHANGED
|
@@ -11,15 +11,12 @@ program
|
|
|
11
11
|
.version((0, utils_1.getClientVersion)(), `-cv, --clientVersion`, `Client version.`);
|
|
12
12
|
const createAlias = program.command(`createAlias <alias>`)
|
|
13
13
|
.description(`Create a new system alias.`);
|
|
14
|
-
(0, utils_1.registerCommand)(createAlias
|
|
15
|
-
noSystemAlias: true,
|
|
16
|
-
});
|
|
14
|
+
(0, utils_1.registerCommand)(createAlias);
|
|
17
15
|
const deleteAlias = program.command(`deleteAlias <alias>`)
|
|
18
16
|
.description(`Delete a system alias.`);
|
|
19
17
|
(0, utils_1.registerCommand)(deleteAlias);
|
|
20
|
-
const manageAliases = program.command(`alias`)
|
|
21
|
-
.description(`List and manage aliases.`)
|
|
22
|
-
.option(`-a, --systemAlias <systemAlias>`, `System Alias.`);
|
|
18
|
+
const manageAliases = program.command(`alias [alias]`)
|
|
19
|
+
.description(`List and manage aliases.`);
|
|
23
20
|
(0, utils_1.registerCommand)(manageAliases);
|
|
24
21
|
const addRegistry = program.command(`addRegistry <registryName>`)
|
|
25
22
|
.description(`Add a new registry.`)
|
|
@@ -66,6 +66,7 @@ class SystemAlias {
|
|
|
66
66
|
dest: o.connection.dest,
|
|
67
67
|
ashost: o.connection.ashost,
|
|
68
68
|
sysnr: o.connection.sysnr,
|
|
69
|
+
saprouter: o.connection.saprouter,
|
|
69
70
|
client: o.login.client,
|
|
70
71
|
user: o.login.user,
|
|
71
72
|
passwd: o.login.passwd,
|
|
@@ -77,6 +78,7 @@ class SystemAlias {
|
|
|
77
78
|
type: o.type,
|
|
78
79
|
endpoint: o.connection.endpoint,
|
|
79
80
|
rfcdest: o.connection.rfcdest || 'NONE',
|
|
81
|
+
client: o.login.client,
|
|
80
82
|
user: o.login.user,
|
|
81
83
|
passwd: o.login.passwd,
|
|
82
84
|
lang: o.login.lang
|
|
@@ -127,7 +129,8 @@ class SystemAlias {
|
|
|
127
129
|
login: {
|
|
128
130
|
user: oIni[sAlias].user,
|
|
129
131
|
passwd: oIni[sAlias].passwd,
|
|
130
|
-
lang: oIni[sAlias].lang
|
|
132
|
+
lang: oIni[sAlias].lang,
|
|
133
|
+
client: oIni[sAlias].client
|
|
131
134
|
}
|
|
132
135
|
});
|
|
133
136
|
}
|
|
@@ -97,6 +97,7 @@ class NoConnection {
|
|
|
97
97
|
this.getAbapgitSource = () => __awaiter(this, void 0, void 0, function* () { return this._throw(); });
|
|
98
98
|
this.executePostActivity = () => __awaiter(this, void 0, void 0, function* () { return this._throw(); });
|
|
99
99
|
this.readClassDescriptions = () => __awaiter(this, void 0, void 0, function* () { return this._throw(); });
|
|
100
|
+
this.regenProg = () => __awaiter(this, void 0, void 0, function* () { return this._throw(); });
|
|
100
101
|
}
|
|
101
102
|
_throw() {
|
|
102
103
|
throw new Error(`No connection to SAP server.`);
|
|
@@ -88,21 +88,6 @@ function executeCommand(args) {
|
|
|
88
88
|
const registryAuthBlacklist = args.registryAuthBlacklist;
|
|
89
89
|
const ignoreRegistryUnreachable = args.ignoreRegistryUnreachable;
|
|
90
90
|
yield (0, checkCliUpdate_1.checkCliUpdate)(true);
|
|
91
|
-
if (requiresConnection) {
|
|
92
|
-
var system;
|
|
93
|
-
if (args.systemAlias) {
|
|
94
|
-
system = systemAlias_1.SystemAlias.get(args.systemAlias).getConnection();
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
const skipCreateAlias = ['createAlias', 'deleteAlias', 'alias'];
|
|
98
|
-
system = (yield commands.connect(args, !skipCreateAlias.includes(args.command), args.addNoConnection)).connection;
|
|
99
|
-
}
|
|
100
|
-
yield system.connect();
|
|
101
|
-
trm_core_1.SystemConnector.systemConnector = system;
|
|
102
|
-
if (requiresTrmDependencies) {
|
|
103
|
-
yield (0, checkTrmDependencies_1.checkTrmDependencies)(args);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
91
|
if (requiresRegistry) {
|
|
107
92
|
var registryAlias;
|
|
108
93
|
var registry;
|
|
@@ -155,6 +140,21 @@ function executeCommand(args) {
|
|
|
155
140
|
}
|
|
156
141
|
});
|
|
157
142
|
}
|
|
143
|
+
if (requiresConnection) {
|
|
144
|
+
var system;
|
|
145
|
+
if (args.systemAlias) {
|
|
146
|
+
system = systemAlias_1.SystemAlias.get(args.systemAlias).getConnection();
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
const skipCreateAlias = ['createAlias', 'deleteAlias', 'alias'];
|
|
150
|
+
system = (yield commands.connect(args, !skipCreateAlias.includes(args.command), args.addNoConnection)).connection;
|
|
151
|
+
}
|
|
152
|
+
yield system.connect();
|
|
153
|
+
trm_core_1.SystemConnector.systemConnector = system;
|
|
154
|
+
if (requiresTrmDependencies) {
|
|
155
|
+
yield (0, checkTrmDependencies_1.checkTrmDependencies)(args);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
158
|
var commandFn = args.command;
|
|
159
159
|
if (!commands[commandFn]) {
|
|
160
160
|
commandFn = `_${commandFn}`;
|
package/dist/utils/logError.js
CHANGED
|
@@ -16,8 +16,10 @@ exports.logError = void 0;
|
|
|
16
16
|
const trm_core_1 = require("trm-core");
|
|
17
17
|
const util_1 = require("util");
|
|
18
18
|
const chalk_1 = __importDefault(require("chalk"));
|
|
19
|
-
const node_html_parser_1 = require("node-html-parser");
|
|
20
19
|
const trm_commons_1 = require("trm-commons");
|
|
20
|
+
const _getUnauthorizedError = () => {
|
|
21
|
+
return `User "${trm_core_1.SystemConnector.getLogonUser()}" is not authorized to execute TRM RFC functions. Follow this guide https://docs.trmregistry.com/#/server/docs/setup?id=user-authorization-maintenance.`;
|
|
22
|
+
};
|
|
21
23
|
function logError(err) {
|
|
22
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
25
|
var originalException;
|
|
@@ -35,6 +37,7 @@ function logError(err) {
|
|
|
35
37
|
var sError = (originalException.message || 'Unknown error.').trim();
|
|
36
38
|
var aError = [];
|
|
37
39
|
if (originalException.name === 'ExitPromptError') {
|
|
40
|
+
trm_commons_1.Logger.log(`User exited prompt: ${originalException.message}`, true);
|
|
38
41
|
return;
|
|
39
42
|
}
|
|
40
43
|
else if (originalException.name === 'TrmRegistryError') {
|
|
@@ -43,30 +46,38 @@ function logError(err) {
|
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
else if (originalException.name === 'TrmRFCClient') {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
|
|
49
|
+
const rfcClientError = originalException;
|
|
50
|
+
if (rfcClientError.rfcError && rfcClientError.rfcError.key) {
|
|
51
|
+
if (rfcClientError.rfcError.key[0] === 'Z') {
|
|
52
|
+
trm_commons_1.Logger.error(`${rfcClientError.rfcError.key} ${sError}`, true);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
sError = `${chalk_1.default.black.bgRed(rfcClientError.rfcError.key)} ${sError}`;
|
|
56
|
+
if (rfcClientError.rfcError.key === "TRM_RFC_UNAUTHORIZED") {
|
|
57
|
+
sError = chalk_1.default.black.bgRed(`${chalk_1.default.black.bgRed(rfcClientError.rfcError.key)} ${_getUnauthorizedError()}`);
|
|
58
|
+
}
|
|
50
59
|
}
|
|
51
60
|
}
|
|
52
61
|
}
|
|
53
|
-
else if (originalException.name === '
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
62
|
+
else if (originalException.name === 'TrmRESTClient') {
|
|
63
|
+
const restClientError = originalException;
|
|
64
|
+
if (restClientError.restError) {
|
|
65
|
+
if (restClientError.restError.status === 401) {
|
|
66
|
+
aError.push(chalk_1.default.black.bgRed(`${chalk_1.default.black.bgRed(restClientError.restError.status)} ${_getUnauthorizedError()}`));
|
|
57
67
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (originalException.status) {
|
|
61
|
-
if (originalException.status === 404) {
|
|
62
|
-
aError.push(`Service cannot be reached (Check if trm-rest is installed and activated correctly).`);
|
|
68
|
+
else if (restClientError.restError.status === 404) {
|
|
69
|
+
aError.push(`${chalk_1.default.black.bgRed(restClientError.restError.status)} Service cannot be reached (Check if trm-rest is installed and activated correctly).`);
|
|
63
70
|
}
|
|
64
|
-
sError = `${chalk_1.default.black.bgRed(
|
|
71
|
+
sError = `${chalk_1.default.black.bgRed(restClientError.restError.status)} ${sError}`;
|
|
65
72
|
}
|
|
66
73
|
}
|
|
67
|
-
|
|
74
|
+
if (sError) {
|
|
75
|
+
trm_commons_1.Logger.error(sError);
|
|
76
|
+
}
|
|
68
77
|
aError.forEach(message => {
|
|
69
|
-
|
|
78
|
+
if (message) {
|
|
79
|
+
trm_commons_1.Logger.error(message);
|
|
80
|
+
}
|
|
70
81
|
});
|
|
71
82
|
});
|
|
72
83
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trm-client",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"description": "TRM (Transport Request Manager) Client",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -43,10 +43,9 @@
|
|
|
43
43
|
"get-latest-version": "^5.1.0",
|
|
44
44
|
"get-root-path": "^2.0.2",
|
|
45
45
|
"ini": "^4.1.1",
|
|
46
|
-
"node-html-parser": "^6.1.13",
|
|
47
46
|
"semver": "^7.5.4",
|
|
48
47
|
"trm-commons": "^1.0.0",
|
|
49
|
-
"trm-core": "^6.
|
|
48
|
+
"trm-core": "^6.7.0",
|
|
50
49
|
"trm-registry-types": "^1.2.0",
|
|
51
50
|
"xml2js": "^0.6.2"
|
|
52
51
|
},
|