trm-client 4.8.0 → 4.9.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
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AbstractRegistry, TrmPackage } from "trm-core";
|
|
2
2
|
export declare namespace CommandContext {
|
|
3
3
|
var registry: AbstractRegistry;
|
|
4
|
+
var hasRegistryAuthData: boolean;
|
|
4
5
|
var trmDependencies: TrmPackage[];
|
|
5
6
|
var missingTrmDependencies: (TrmPackage | string)[];
|
|
6
7
|
function getRegistry(): AbstractRegistry;
|
|
@@ -16,6 +16,7 @@ var CommandContext;
|
|
|
16
16
|
(function (CommandContext) {
|
|
17
17
|
var _systemPackages = undefined;
|
|
18
18
|
CommandContext.registry = undefined;
|
|
19
|
+
CommandContext.hasRegistryAuthData = false;
|
|
19
20
|
CommandContext.trmDependencies = [];
|
|
20
21
|
CommandContext.missingTrmDependencies = [];
|
|
21
22
|
function getRegistry() {
|
|
@@ -126,6 +126,7 @@ function executeCommand(args) {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
commons_1.CommandContext.registry = registry;
|
|
129
|
+
commons_1.CommandContext.hasRegistryAuthData = !!registryAlias.authData;
|
|
129
130
|
trm_core_1.RegistryProvider.registry.push(registry);
|
|
130
131
|
registryAlias_1.RegistryAlias.getAll().forEach(o => {
|
|
131
132
|
var append = true;
|
package/dist/utils/logError.js
CHANGED
|
@@ -17,6 +17,7 @@ const trm_core_1 = require("trm-core");
|
|
|
17
17
|
const util_1 = require("util");
|
|
18
18
|
const chalk_1 = __importDefault(require("chalk"));
|
|
19
19
|
const trm_commons_1 = require("trm-commons");
|
|
20
|
+
const commons_1 = require("../commands/commons");
|
|
20
21
|
const _getUnauthorizedError = () => {
|
|
21
22
|
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
23
|
};
|
|
@@ -43,6 +44,10 @@ function logError(err) {
|
|
|
43
44
|
else if (originalException.name === 'TrmRegistryError') {
|
|
44
45
|
if (originalException.status) {
|
|
45
46
|
sError = `${chalk_1.default.black.bgRed(originalException.status)} ${sError}`;
|
|
47
|
+
if ((originalException.status === 401 || /whoami$/.test(originalException.axiosError.request.path)) && !commons_1.CommandContext.hasRegistryAuthData) {
|
|
48
|
+
aError.push(`${chalk_1.default.black.bgRed(originalException.status)} You are not logged in!`);
|
|
49
|
+
aError.push(`${chalk_1.default.black.bgRed(originalException.status)} Run command "trm login" and follow instructions.`);
|
|
50
|
+
}
|
|
46
51
|
}
|
|
47
52
|
}
|
|
48
53
|
else if (originalException.name === 'TrmRFCClient') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trm-client",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.9.0",
|
|
4
4
|
"description": "TRM (Transport Request Manager) Client",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"get-root-path": "^2.0.2",
|
|
45
45
|
"ini": "^4.1.1",
|
|
46
46
|
"semver": "^7.5.4",
|
|
47
|
-
"trm-commons": "^1.
|
|
48
|
-
"trm-core": "^7.
|
|
47
|
+
"trm-commons": "^1.1.0",
|
|
48
|
+
"trm-core": "^7.4.0",
|
|
49
49
|
"trm-registry-types": "^1.2.0",
|
|
50
50
|
"xml2js": "^0.6.2"
|
|
51
51
|
},
|