trm-client 5.2.1 → 6.0.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 +6 -0
- package/dist/commands/addRegistry.js +3 -1
- package/dist/commands/check.js +2 -2
- package/dist/commands/commons/viewRegistryPackage.d.ts +2 -2
- package/dist/commands/commons/viewRegistryPackage.js +8 -3
- package/dist/commands/compare.js +1 -1
- package/dist/commands/content.js +8 -9
- package/dist/commands/import.js +1 -3
- package/dist/commands/info.js +2 -2
- package/dist/commands/install.js +1 -3
- package/dist/commands/login.js +1 -1
- package/dist/commands/prompts/pickRegistry.js +0 -1
- package/dist/commands/view.js +8 -8
- package/dist/commands/whoami.js +9 -9
- package/dist/index.js +5 -0
- package/dist/registryAlias/RegistryAlias.d.ts +1 -2
- package/dist/registryAlias/RegistryAlias.js +11 -12
- package/dist/utils/DummyConnector.d.ts +1 -0
- package/dist/utils/DummyConnector.js +1 -0
- package/dist/utils/executeCommand.js +15 -15
- package/dist/utils/logError.js +1 -6
- package/package.json +4 -4
package/changelog.txt
CHANGED
|
@@ -45,7 +45,9 @@ function addRegistry(commandArgs) {
|
|
|
45
45
|
var pingSuccess = true;
|
|
46
46
|
try {
|
|
47
47
|
const ping = yield registry.getRegistry().ping();
|
|
48
|
-
|
|
48
|
+
if (ping.messages) {
|
|
49
|
+
ping.messages.forEach(m => trm_commons_1.Logger.registryResponse(m));
|
|
50
|
+
}
|
|
49
51
|
}
|
|
50
52
|
catch (e) {
|
|
51
53
|
trm_commons_1.Logger.error(`Ping to registry "${registryName}" (${endpoint}) failed.`);
|
package/dist/commands/check.js
CHANGED
|
@@ -22,7 +22,7 @@ const _dependencies = (oPackage) => __awaiter(void 0, void 0, void 0, function*
|
|
|
22
22
|
systemPackages: packages
|
|
23
23
|
},
|
|
24
24
|
packageData: {
|
|
25
|
-
|
|
25
|
+
manifest: oPackage.manifest.get()
|
|
26
26
|
},
|
|
27
27
|
printOptions: {
|
|
28
28
|
dependencyStatus: true,
|
|
@@ -34,7 +34,7 @@ const _sapEntries = (oPackage) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
34
34
|
trm_commons_1.Logger.loading(`Analyzing package SAP Entries...`);
|
|
35
35
|
yield (0, trm_core_1.checkSapEntries)({
|
|
36
36
|
packageData: {
|
|
37
|
-
|
|
37
|
+
manifest: oPackage.manifest.get()
|
|
38
38
|
},
|
|
39
39
|
printOptions: {
|
|
40
40
|
entriesStatus: true,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function viewRegistryPackage(packageName: string, print?: boolean): Promise<
|
|
1
|
+
import { Package } from "trm-registry-types";
|
|
2
|
+
export declare function viewRegistryPackage(packageName: string, print?: boolean): Promise<Package>;
|
|
@@ -21,7 +21,7 @@ function viewRegistryPackage(packageName_1) {
|
|
|
21
21
|
trm_commons_1.Logger.loading(`Reading registry data...`);
|
|
22
22
|
var oRegistryView;
|
|
23
23
|
try {
|
|
24
|
-
oRegistryView = yield CommandContext_1.CommandContext.getRegistry().
|
|
24
|
+
oRegistryView = yield CommandContext_1.CommandContext.getRegistry().getPackage(packageName, 'latest');
|
|
25
25
|
}
|
|
26
26
|
catch (e) {
|
|
27
27
|
trm_commons_1.Logger.error(e, true);
|
|
@@ -33,8 +33,13 @@ function viewRegistryPackage(packageName_1) {
|
|
|
33
33
|
trm_commons_1.Logger.warning(`${chalk_1.default.bold('WARNING')}: This package may have been deleted!`);
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
|
-
if (oRegistryView.
|
|
37
|
-
|
|
36
|
+
if (oRegistryView.deprecated) {
|
|
37
|
+
if (oRegistryView.deprecated_message) {
|
|
38
|
+
trm_commons_1.Logger.warning(`${chalk_1.default.bold('WARNING deprecate')}: ${oRegistryView.deprecated_message}`);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
trm_commons_1.Logger.warning(`${chalk_1.default.bold('WARNING deprecate')}: v${oRegistryView.manifest.version} is deprecated`);
|
|
42
|
+
}
|
|
38
43
|
}
|
|
39
44
|
}
|
|
40
45
|
}
|
package/dist/commands/compare.js
CHANGED
|
@@ -156,7 +156,7 @@ function compare(commandArgs) {
|
|
|
156
156
|
trm_commons_1.Logger.info(`Package name: ${packageName}`);
|
|
157
157
|
trm_commons_1.Logger.info(`Registry: ${registry.name}`);
|
|
158
158
|
try {
|
|
159
|
-
trm_commons_1.Logger.info(`Latest version: ${oRegistryView.
|
|
159
|
+
trm_commons_1.Logger.info(`Latest version: ${oRegistryView.latest}`);
|
|
160
160
|
}
|
|
161
161
|
catch (e) {
|
|
162
162
|
trm_commons_1.Logger.warning(`Latest version: Unknown`);
|
package/dist/commands/content.js
CHANGED
|
@@ -13,21 +13,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.content = content;
|
|
16
|
-
const trm_core_1 = require("trm-core");
|
|
17
16
|
const commons_1 = require("./commons");
|
|
18
17
|
const utils_1 = require("../utils");
|
|
19
18
|
const chalk_1 = __importDefault(require("chalk"));
|
|
20
19
|
const trm_commons_1 = require("trm-commons");
|
|
21
20
|
function content(commandArgs) {
|
|
22
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
trm_commons_1.Logger.loading(`Searching package "${commandArgs.package}"...`);
|
|
24
|
-
const remotePackage = new trm_core_1.TrmPackage(commandArgs.package, commons_1.CommandContext.getRegistry());
|
|
25
|
-
const remoteManifest = yield remotePackage.fetchRemoteManifest(commandArgs.version);
|
|
26
|
-
trm_commons_1.Logger.loading(`Reading content...`);
|
|
27
22
|
var transports = {};
|
|
28
23
|
var aNodes = [];
|
|
29
24
|
var iOtherEntries = 0;
|
|
30
|
-
|
|
25
|
+
trm_commons_1.Logger.loading(`Searching package "${commandArgs.package}"...`);
|
|
26
|
+
const data = yield commons_1.CommandContext.getRegistry().getPackage(commandArgs.package, commandArgs.version);
|
|
27
|
+
const artifact = yield commons_1.CommandContext.getRegistry().downloadArtifact(commandArgs.package, commandArgs.version);
|
|
28
|
+
trm_commons_1.Logger.loading(`Reading content...`);
|
|
29
|
+
const packageContent = yield artifact.getContent({
|
|
31
30
|
tempDirPath: (0, utils_1.getTempFolder)(),
|
|
32
31
|
r3transDirPath: commandArgs.r3transPath,
|
|
33
32
|
useDocker: utils_1.Context.getInstance().getSettings().r3transDocker,
|
|
@@ -71,7 +70,7 @@ function content(commandArgs) {
|
|
|
71
70
|
});
|
|
72
71
|
}
|
|
73
72
|
var tree = {
|
|
74
|
-
text: `${chalk_1.default.bold(commandArgs.package)} v${
|
|
73
|
+
text: `${chalk_1.default.bold(commandArgs.package)} v${data.manifest.version} content`,
|
|
75
74
|
children: []
|
|
76
75
|
};
|
|
77
76
|
aNodes.forEach(node => {
|
|
@@ -130,9 +129,9 @@ function content(commandArgs) {
|
|
|
130
129
|
var header = ['Namespace', 'ABAP Package', 'TRM Transport', 'Customizing', 'Translations'];
|
|
131
130
|
var row1 = [];
|
|
132
131
|
var row2 = [];
|
|
133
|
-
if (
|
|
132
|
+
if (data.manifest.namespace) {
|
|
134
133
|
row1.push(`\u2714`);
|
|
135
|
-
row2.push(
|
|
134
|
+
row2.push(data.manifest.namespace.replicense);
|
|
136
135
|
}
|
|
137
136
|
else {
|
|
138
137
|
row1.push(`\u274C`);
|
package/dist/commands/import.js
CHANGED
|
@@ -51,12 +51,10 @@ function _import(commandArgs) {
|
|
|
51
51
|
packageData: {
|
|
52
52
|
name: 'dummy',
|
|
53
53
|
overwrite: commandArgs.overwrite,
|
|
54
|
-
integrity: commandArgs.integrity,
|
|
55
54
|
registry
|
|
56
55
|
},
|
|
57
56
|
installData: {
|
|
58
57
|
checks: {
|
|
59
|
-
safe: commandArgs.safe,
|
|
60
58
|
noDependencies: commandArgs.noDependencies,
|
|
61
59
|
noObjectTypes: commandArgs.noObjectTypes,
|
|
62
60
|
noSapEntries: commandArgs.noSapEntries
|
|
@@ -77,7 +75,7 @@ function _import(commandArgs) {
|
|
|
77
75
|
}
|
|
78
76
|
}
|
|
79
77
|
});
|
|
80
|
-
var sOutput = `${result.
|
|
78
|
+
var sOutput = `${result.manifest.name} v${result.manifest.version} installed`;
|
|
81
79
|
if (result.installTransport) {
|
|
82
80
|
sOutput += `, use ${result.installTransport.trkorr} transport in landscape`;
|
|
83
81
|
}
|
package/dist/commands/info.js
CHANGED
|
@@ -78,7 +78,7 @@ function info(commandArgs) {
|
|
|
78
78
|
const trmMissingDependencies = commons_1.CommandContext.missingTrmDependencies;
|
|
79
79
|
const nodeRfcVersion = _getNodeRfcVersion(npmGlobal);
|
|
80
80
|
const packages = yield commons_1.CommandContext.getSystemPackages();
|
|
81
|
-
const trmRest = packages.find(o => o.compareName("trm-rest") && o.compareRegistry(
|
|
81
|
+
const trmRest = packages.find(o => o.compareName("trm-rest") && o.compareRegistry(trm_core_1.RegistryProvider.getRegistry()));
|
|
82
82
|
var nodeR3transVersion;
|
|
83
83
|
try {
|
|
84
84
|
nodeR3transVersion = _getDependencyVersion("node-r3trans", "trm-core");
|
|
@@ -120,7 +120,7 @@ function info(commandArgs) {
|
|
|
120
120
|
if (dInstalledVersion) {
|
|
121
121
|
dText = ` -> ${dInstalledVersion}`;
|
|
122
122
|
try {
|
|
123
|
-
const dLatestVersion = (yield oTrmPackage.
|
|
123
|
+
const dLatestVersion = (yield oTrmPackage.registry.getPackage(oTrmPackage.packageName, 'latest')).manifest.version;
|
|
124
124
|
if ((0, semver_1.gte)(dInstalledVersion, dLatestVersion)) {
|
|
125
125
|
dText += ` ${chalk_1.default.bgGreen('LATEST')}`;
|
|
126
126
|
}
|
package/dist/commands/install.js
CHANGED
|
@@ -51,12 +51,10 @@ function install(commandArgs) {
|
|
|
51
51
|
name: commandArgs.package,
|
|
52
52
|
version: commandArgs.version,
|
|
53
53
|
overwrite: commandArgs.overwrite,
|
|
54
|
-
integrity: commandArgs.integrity,
|
|
55
54
|
registry: commons_1.CommandContext.getRegistry()
|
|
56
55
|
},
|
|
57
56
|
installData: {
|
|
58
57
|
checks: {
|
|
59
|
-
safe: commandArgs.safe,
|
|
60
58
|
noDependencies: commandArgs.noDependencies,
|
|
61
59
|
noObjectTypes: commandArgs.noObjectTypes,
|
|
62
60
|
noSapEntries: commandArgs.noSapEntries,
|
|
@@ -78,7 +76,7 @@ function install(commandArgs) {
|
|
|
78
76
|
}
|
|
79
77
|
}
|
|
80
78
|
});
|
|
81
|
-
var sOutput = `${result.
|
|
79
|
+
var sOutput = `${result.manifest.name} v${result.manifest.version} installed`;
|
|
82
80
|
if (result.installTransport) {
|
|
83
81
|
sOutput += `, use ${result.installTransport.trkorr} transport in landscape`;
|
|
84
82
|
}
|
package/dist/commands/login.js
CHANGED
|
@@ -23,7 +23,7 @@ function login(commandArgs) {
|
|
|
23
23
|
const inq1 = yield trm_commons_1.Inquirer.prompt({
|
|
24
24
|
type: "confirm",
|
|
25
25
|
name: "continue",
|
|
26
|
-
message: `Already logged in as "${whoami.
|
|
26
|
+
message: `Already logged in as "${whoami.user}". Do you want to logout?`,
|
|
27
27
|
default: false
|
|
28
28
|
});
|
|
29
29
|
continueLogin = inq1.continue;
|
|
@@ -15,7 +15,6 @@ const registryAlias_1 = require("../../registryAlias");
|
|
|
15
15
|
function pickRegistry() {
|
|
16
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
17
|
var registryAlias;
|
|
18
|
-
registryAlias_1.RegistryAlias.generatePublicRegistryAlias();
|
|
19
18
|
const allAliases = registryAlias_1.RegistryAlias.getAll();
|
|
20
19
|
if (allAliases.length === 1) {
|
|
21
20
|
registryAlias = registryAlias_1.RegistryAlias.get(allAliases[0].alias);
|
package/dist/commands/view.js
CHANGED
|
@@ -40,10 +40,10 @@ const _printVersionSection = (systemPackage, registryView) => {
|
|
|
40
40
|
trm_commons_1.Logger.error(`Installed on ${trm_core_1.SystemConnector.getDest()}: No`);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
if (registryView
|
|
44
|
-
console.log(`Latest version available: ${registryView.
|
|
43
|
+
if (registryView) {
|
|
44
|
+
console.log(`Latest version available: ${registryView.latest}`);
|
|
45
45
|
if (oSystemManifest) {
|
|
46
|
-
if ((0, semver_1.eq)(oSystemManifest.version, registryView.
|
|
46
|
+
if ((0, semver_1.eq)(oSystemManifest.version, registryView.latest)) {
|
|
47
47
|
trm_commons_1.Logger.success(`Latest version installed: Yes`);
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
@@ -201,11 +201,11 @@ function view(commandArgs) {
|
|
|
201
201
|
else if (oRegistryView) {
|
|
202
202
|
dependencies = [];
|
|
203
203
|
printManifest = {
|
|
204
|
-
private: oRegistryView.private,
|
|
205
|
-
description: oRegistryView.shortDescription,
|
|
206
|
-
git: oRegistryView.git,
|
|
207
|
-
website: oRegistryView.website,
|
|
208
|
-
license: oRegistryView.license
|
|
204
|
+
private: oRegistryView.manifest.private,
|
|
205
|
+
description: oRegistryView.manifest.shortDescription,
|
|
206
|
+
git: oRegistryView.manifest.git,
|
|
207
|
+
website: oRegistryView.manifest.website,
|
|
208
|
+
license: oRegistryView.manifest.license
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
211
|
else {
|
package/dist/commands/whoami.js
CHANGED
|
@@ -16,19 +16,19 @@ function whoami(commandArgs) {
|
|
|
16
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
17
|
try {
|
|
18
18
|
const whoAmI = yield commons_1.CommandContext.getRegistry().whoAmI();
|
|
19
|
-
trm_commons_1.Logger.info(`Username: ${whoAmI.
|
|
20
|
-
if (whoAmI.
|
|
21
|
-
trm_commons_1.Logger.registryResponse(
|
|
19
|
+
trm_commons_1.Logger.info(`Username: ${whoAmI.user}`);
|
|
20
|
+
if (whoAmI.messages) {
|
|
21
|
+
whoAmI.messages.forEach(m => trm_commons_1.Logger.registryResponse(m));
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
catch (e) {
|
|
25
|
-
if (e.status ===
|
|
26
|
-
trm_commons_1.Logger.error(`
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
throw e;
|
|
25
|
+
if (e.status === 401) {
|
|
26
|
+
trm_commons_1.Logger.error(`You are not logged in`);
|
|
27
|
+
if (!commons_1.CommandContext.hasRegistryAuthData) {
|
|
28
|
+
trm_commons_1.Logger.error(`Run command "trm login" and follow instructions.`);
|
|
29
|
+
}
|
|
31
30
|
}
|
|
31
|
+
throw e;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
3
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
4
8
|
const commander_1 = require("commander");
|
|
5
9
|
const utils_1 = require("./utils");
|
|
6
10
|
const trm_registry_types_1 = require("trm-registry-types");
|
|
11
|
+
dotenv_1.default.config();
|
|
7
12
|
const program = new commander_1.Command();
|
|
8
13
|
program
|
|
9
14
|
.name(`trm`)
|
|
@@ -11,9 +11,8 @@ export declare class RegistryAlias {
|
|
|
11
11
|
private static getSystemAliasFilePath;
|
|
12
12
|
static getAll(): RegistryAliasData[];
|
|
13
13
|
static get(name: string): RegistryAlias;
|
|
14
|
-
static create(name: string, endpointUrl: string, auth?: any): RegistryAlias;
|
|
14
|
+
static create(name: string, endpointUrl: string, auth?: any, data?: RegistryAliasData[]): RegistryAlias;
|
|
15
15
|
static delete(name: string): void;
|
|
16
16
|
static update(name: string, auth?: any): void;
|
|
17
|
-
static generatePublicRegistryAlias(): void;
|
|
18
17
|
static getTemporaryInstance(endpoint: string, auth?: any): RegistryAlias;
|
|
19
18
|
}
|
|
@@ -58,7 +58,7 @@ class RegistryAlias {
|
|
|
58
58
|
return this;
|
|
59
59
|
}
|
|
60
60
|
getRegistry() {
|
|
61
|
-
return new trm_core_1.
|
|
61
|
+
return new trm_core_1.RegistryV2(this._endpoint, this._name);
|
|
62
62
|
}
|
|
63
63
|
static generateFile(content, filePath) {
|
|
64
64
|
if (!filePath) {
|
|
@@ -105,6 +105,9 @@ class RegistryAlias {
|
|
|
105
105
|
auth: JSON.parse(oIni[sAlias].auth)
|
|
106
106
|
});
|
|
107
107
|
});
|
|
108
|
+
if (!aAlias.find(o => o.alias.trim().toLowerCase() === trm_core_1.PUBLIC_RESERVED_KEYWORD)) {
|
|
109
|
+
RegistryAlias.create(trm_core_1.PUBLIC_RESERVED_KEYWORD, trm_core_1.PUBLIC_RESERVED_KEYWORD, null, aAlias);
|
|
110
|
+
}
|
|
108
111
|
return aAlias;
|
|
109
112
|
}
|
|
110
113
|
static get(name) {
|
|
@@ -121,19 +124,21 @@ class RegistryAlias {
|
|
|
121
124
|
throw new Error(`Registry "${name}" not found.`);
|
|
122
125
|
}
|
|
123
126
|
}
|
|
124
|
-
static create(name, endpointUrl, auth = {}) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
static create(name, endpointUrl, auth = {}, data) {
|
|
128
|
+
if (!data) {
|
|
129
|
+
data = this.getAll();
|
|
130
|
+
}
|
|
131
|
+
const alreadyExists = data.find(o => o.alias.trim().toUpperCase() === name.trim().toUpperCase()) ? true : false;
|
|
127
132
|
if (alreadyExists) {
|
|
128
133
|
throw new Error(`Alias already exists. Choose an unique name.`);
|
|
129
134
|
}
|
|
130
135
|
else {
|
|
131
|
-
|
|
136
|
+
data.push({
|
|
132
137
|
alias: name,
|
|
133
138
|
endpointUrl: endpointUrl.trim().toLowerCase() === trm_core_1.PUBLIC_RESERVED_KEYWORD ? null : endpointUrl,
|
|
134
139
|
auth
|
|
135
140
|
});
|
|
136
|
-
this.generateFile(
|
|
141
|
+
this.generateFile(data);
|
|
137
142
|
}
|
|
138
143
|
return new RegistryAlias(endpointUrl, name).setAuthData(auth);
|
|
139
144
|
}
|
|
@@ -153,12 +158,6 @@ class RegistryAlias {
|
|
|
153
158
|
this.generateFile(aAlias);
|
|
154
159
|
}
|
|
155
160
|
}
|
|
156
|
-
static generatePublicRegistryAlias() {
|
|
157
|
-
const allRegistries = this.getAll();
|
|
158
|
-
if (!allRegistries.find(o => o.alias.trim().toLowerCase() === trm_core_1.PUBLIC_RESERVED_KEYWORD)) {
|
|
159
|
-
RegistryAlias.create(trm_core_1.PUBLIC_RESERVED_KEYWORD, trm_core_1.PUBLIC_RESERVED_KEYWORD, null);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
161
|
static getTemporaryInstance(endpoint, auth) {
|
|
163
162
|
return new RegistryAlias(endpoint, endpoint).setAuthData(auth);
|
|
164
163
|
}
|
|
@@ -100,6 +100,7 @@ class DummyConnector {
|
|
|
100
100
|
this.readClassDescriptions = () => __awaiter(this, void 0, void 0, function* () { return this._throw(); });
|
|
101
101
|
this.isServerApisAllowed = () => __awaiter(this, void 0, void 0, function* () { return this._throw(); });
|
|
102
102
|
this.changeTrOwner = () => __awaiter(this, void 0, void 0, function* () { return this._throw(); });
|
|
103
|
+
this.getWbTransports = () => __awaiter(this, void 0, void 0, function* () { return this._throw(); });
|
|
103
104
|
}
|
|
104
105
|
_throw() {
|
|
105
106
|
throw new Error(`No connection to SAP server.`);
|
|
@@ -122,11 +122,11 @@ function executeCommand(args) {
|
|
|
122
122
|
registry = registryAlias.getRegistry();
|
|
123
123
|
try {
|
|
124
124
|
const registryPing = yield registry.ping();
|
|
125
|
-
if (registryPing.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
trm_commons_1.Logger.registryResponse(
|
|
125
|
+
if (registryAuthBlacklist.includes(registryPing.authentication_type)) {
|
|
126
|
+
throw new Error(`This command is not supported by registry "${registry.name}".`);
|
|
127
|
+
}
|
|
128
|
+
if (registryPing.messages) {
|
|
129
|
+
registryPing.messages.forEach(m => trm_commons_1.Logger.registryResponse(m));
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
catch (e) {
|
|
@@ -147,19 +147,19 @@ function executeCommand(args) {
|
|
|
147
147
|
commons_1.CommandContext.registry = registry;
|
|
148
148
|
commons_1.CommandContext.hasRegistryAuthData = !!registryAlias.authData;
|
|
149
149
|
trm_core_1.RegistryProvider.registry.push(registry);
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
append = !k.compare(aliasRegistry);
|
|
156
|
-
}
|
|
157
|
-
});
|
|
150
|
+
}
|
|
151
|
+
registryAlias_1.RegistryAlias.getAll().forEach(o => {
|
|
152
|
+
var append = true;
|
|
153
|
+
var aliasRegistry = registryAlias_1.RegistryAlias.get(o.alias).getRegistry();
|
|
154
|
+
trm_core_1.RegistryProvider.registry.forEach(k => {
|
|
158
155
|
if (append) {
|
|
159
|
-
|
|
156
|
+
append = !k.compare(aliasRegistry);
|
|
160
157
|
}
|
|
161
158
|
});
|
|
162
|
-
|
|
159
|
+
if (append) {
|
|
160
|
+
trm_core_1.RegistryProvider.registry.push(aliasRegistry);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
163
|
if (requiresConnection) {
|
|
164
164
|
var system;
|
|
165
165
|
if (args.systemAlias) {
|
package/dist/utils/logError.js
CHANGED
|
@@ -17,7 +17,6 @@ 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");
|
|
21
20
|
const _getUnauthorizedError = () => {
|
|
22
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.`;
|
|
23
22
|
};
|
|
@@ -41,13 +40,9 @@ function logError(err) {
|
|
|
41
40
|
trm_commons_1.Logger.log(`User exited prompt: ${originalException.message}`, true);
|
|
42
41
|
return;
|
|
43
42
|
}
|
|
44
|
-
else if (originalException.name === '
|
|
43
|
+
else if (originalException.name === 'TrmRegistryV2Error') {
|
|
45
44
|
if (originalException.status) {
|
|
46
45
|
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
|
-
}
|
|
51
46
|
}
|
|
52
47
|
}
|
|
53
48
|
else if (originalException.name === 'TrmRFCClient') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trm-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "TRM (Transport Request Manager) Client",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@esm2cjs/normalize-url": "^8.0.0",
|
|
40
40
|
"chalk": "^4.1.2",
|
|
41
41
|
"commander": "^11.0.0",
|
|
42
|
-
"dotenv": "^
|
|
42
|
+
"dotenv": "^17.2.2",
|
|
43
43
|
"execa": "^9.6.0",
|
|
44
44
|
"get-latest-version": "^5.1.0",
|
|
45
45
|
"get-root-path": "^2.0.2",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"lodash": "^4.17.21",
|
|
48
48
|
"semver": "^7.5.4",
|
|
49
49
|
"trm-commons": "^3.4.2",
|
|
50
|
-
"trm-core": "^
|
|
51
|
-
"trm-registry-types": "^
|
|
50
|
+
"trm-core": "^8.0.1",
|
|
51
|
+
"trm-registry-types": "^2.0.0",
|
|
52
52
|
"xml2js": "^0.6.2"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|