trm-client 4.1.0 → 4.2.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 +17 -0
- package/dist/commands/addRegistry.js +5 -2
- package/dist/commands/arguments/ContentArguments.d.ts +6 -0
- package/dist/commands/arguments/ContentArguments.js +2 -0
- package/dist/commands/arguments/ImportArguments.d.ts +19 -0
- package/dist/commands/arguments/ImportArguments.js +2 -0
- package/dist/commands/arguments/ListArguments.d.ts +3 -1
- package/dist/commands/arguments/PackArguments.d.ts +22 -0
- package/dist/commands/arguments/PackArguments.js +2 -0
- package/dist/commands/arguments/index.d.ts +2 -0
- package/dist/commands/arguments/index.js +2 -0
- package/dist/commands/check.js +3 -2
- package/dist/commands/commons/CommandContext.d.ts +4 -4
- package/dist/commands/commons/CommandContext.js +21 -1
- package/dist/commands/commons/viewRegistryPackage.js +1 -1
- package/dist/commands/compare.js +3 -2
- package/dist/commands/content.d.ts +2 -0
- package/dist/commands/content.js +179 -0
- package/dist/commands/import.d.ts +2 -0
- package/dist/commands/import.js +82 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.js +3 -0
- package/dist/commands/info.js +66 -23
- package/dist/commands/install.js +2 -1
- package/dist/commands/list.js +18 -4
- package/dist/commands/pack.d.ts +2 -0
- package/dist/commands/pack.js +95 -0
- package/dist/commands/prompts/connect.d.ts +1 -1
- package/dist/commands/prompts/connect.js +17 -7
- package/dist/commands/publish.js +2 -1
- package/dist/commands/view.js +36 -29
- package/dist/index.d.ts +1 -1
- package/dist/index.js +61 -2
- package/dist/registryAlias/RegistryAlias.d.ts +3 -2
- package/dist/registryAlias/RegistryAlias.js +9 -6
- package/dist/utils/NoConnection.d.ts +75 -0
- package/dist/utils/NoConnection.js +106 -0
- package/dist/utils/checkCliUpdate.d.ts +4 -1
- package/dist/utils/checkCliUpdate.js +18 -31
- package/dist/utils/checkTrmDependencies.js +20 -35
- package/dist/utils/executeCommand.js +27 -10
- package/dist/utils/getClientNodeDependencies.d.ts +3 -0
- package/dist/utils/getClientNodeDependencies.js +9 -0
- package/dist/utils/getClientVersion.js +2 -2
- package/dist/utils/getNodePackage.d.ts +1 -0
- package/dist/utils/{getClientPackage.js → getNodePackage.js} +3 -3
- package/dist/utils/getNpmPackageLatestVersion.d.ts +1 -0
- package/dist/utils/getNpmPackageLatestVersion.js +42 -0
- package/dist/utils/index.d.ts +4 -3
- package/dist/utils/index.js +4 -3
- package/dist/utils/registerCommand.d.ts +1 -0
- package/dist/utils/registerCommand.js +4 -0
- package/package.json +10 -9
- package/dist/utils/getClientDependencies.d.ts +0 -1
- package/dist/utils/getClientDependencies.js +0 -9
- package/dist/utils/getClientPackage.d.ts +0 -1
- package/dist/utils/getTrmDependencies.d.ts +0 -1
- package/dist/utils/getTrmDependencies.js +0 -9
package/dist/commands/install.js
CHANGED
|
@@ -31,6 +31,7 @@ const _parseImportTimeoutArg = (arg) => {
|
|
|
31
31
|
};
|
|
32
32
|
function install(commandArgs) {
|
|
33
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
const packages = yield commons_1.CommandContext.getSystemPackages();
|
|
34
35
|
const result = yield (0, trm_core_1.install)({
|
|
35
36
|
contextData: {
|
|
36
37
|
r3transOptions: {
|
|
@@ -38,7 +39,7 @@ function install(commandArgs) {
|
|
|
38
39
|
r3transDirPath: commandArgs.r3transPath
|
|
39
40
|
},
|
|
40
41
|
noInquirer: commandArgs.noPrompts,
|
|
41
|
-
systemPackages:
|
|
42
|
+
systemPackages: packages,
|
|
42
43
|
noR3transInfo: false
|
|
43
44
|
},
|
|
44
45
|
packageData: {
|
package/dist/commands/list.js
CHANGED
|
@@ -8,14 +8,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.list = void 0;
|
|
13
16
|
const trm_core_1 = require("trm-core");
|
|
17
|
+
const commons_1 = require("./commons");
|
|
18
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
14
19
|
function list(commandArgs) {
|
|
15
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
21
|
trm_core_1.Logger.loading(`Reading packages...`);
|
|
17
22
|
const dest = trm_core_1.SystemConnector.getDest();
|
|
18
|
-
|
|
23
|
+
var aPackages = yield commons_1.CommandContext.getSystemPackages();
|
|
24
|
+
var iLocals = aPackages.filter(o => o.registry.getRegistryType() === trm_core_1.RegistryType.LOCAL).length;
|
|
25
|
+
if (!commandArgs.locals) {
|
|
26
|
+
aPackages = aPackages.filter(o => o.registry.getRegistryType() !== trm_core_1.RegistryType.LOCAL);
|
|
27
|
+
}
|
|
19
28
|
if (aPackages.length > 0) {
|
|
20
29
|
const tableHead = [`Name`, `Version`, `Registry`, `Devclass`, `Import transport`];
|
|
21
30
|
var tableData = [];
|
|
@@ -23,10 +32,13 @@ function list(commandArgs) {
|
|
|
23
32
|
try {
|
|
24
33
|
const packageName = oPackage.packageName || '';
|
|
25
34
|
const version = oPackage.manifest.get().version || '';
|
|
26
|
-
const registry = oPackage.registry.getRegistryType() === trm_core_1.RegistryType.
|
|
35
|
+
const registry = oPackage.registry.getRegistryType() === trm_core_1.RegistryType.LOCAL ? chalk_1.default.bold(oPackage.registry.name) : oPackage.registry.name;
|
|
27
36
|
const devclass = oPackage.getDevclass() || '';
|
|
28
37
|
const linkedTransport = oPackage.manifest.getLinkedTransport();
|
|
29
|
-
|
|
38
|
+
var importTransport = '';
|
|
39
|
+
if (linkedTransport && (yield linkedTransport.isImported())) {
|
|
40
|
+
importTransport = linkedTransport.trkorr;
|
|
41
|
+
}
|
|
30
42
|
tableData.push([
|
|
31
43
|
packageName,
|
|
32
44
|
version,
|
|
@@ -43,8 +55,10 @@ function list(commandArgs) {
|
|
|
43
55
|
trm_core_1.Logger.warning(`${aPackages.length - tableData.length} packages couldn't be printed (check logs).`);
|
|
44
56
|
}
|
|
45
57
|
trm_core_1.Logger.info(`${dest} has ${aPackages.length} packages.`);
|
|
46
|
-
trm_core_1.Logger.log(`\n`);
|
|
47
58
|
trm_core_1.Logger.table(tableHead, tableData);
|
|
59
|
+
if (iLocals > 0 && !commandArgs.locals) {
|
|
60
|
+
trm_core_1.Logger.warning(`There ${iLocals === 1 ? 'is' : 'are'} ${iLocals} local package${iLocals === 1 ? '' : 's'}. Run with option -l (--locals) to list ${iLocals === 1 ? 'it' : 'them'}.`);
|
|
61
|
+
}
|
|
48
62
|
}
|
|
49
63
|
else {
|
|
50
64
|
trm_core_1.Logger.info(`${dest} has 0 packages.`);
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.pack = void 0;
|
|
13
|
+
const trm_core_1 = require("trm-core");
|
|
14
|
+
const utils_1 = require("../utils");
|
|
15
|
+
const commons_1 = require("./commons");
|
|
16
|
+
const _parseDependenciesArg = (arg) => {
|
|
17
|
+
if (arg) {
|
|
18
|
+
try {
|
|
19
|
+
return JSON.parse(arg);
|
|
20
|
+
}
|
|
21
|
+
catch (e) { }
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const _parseSapEntriesArg = (arg) => {
|
|
25
|
+
if (arg) {
|
|
26
|
+
try {
|
|
27
|
+
return JSON.parse(arg);
|
|
28
|
+
}
|
|
29
|
+
catch (e) { }
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const _parseReleaseTimeoutArg = (arg) => {
|
|
33
|
+
if (arg) {
|
|
34
|
+
try {
|
|
35
|
+
return parseInt(arg);
|
|
36
|
+
}
|
|
37
|
+
catch (e) { }
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
function pack(commandArgs) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
var outputPath = commandArgs.outputPath;
|
|
43
|
+
if (!outputPath) {
|
|
44
|
+
if (commandArgs.noPrompts) {
|
|
45
|
+
throw new Error(`Provide an output path for the file with option -o (--output). Run with option -h (--help) for more information.`);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
outputPath = (yield trm_core_1.Inquirer.prompt({
|
|
49
|
+
message: `Output path`,
|
|
50
|
+
name: 'outputPath',
|
|
51
|
+
type: `input`
|
|
52
|
+
})).outputPath;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const registry = new trm_core_1.FileSystem(outputPath);
|
|
56
|
+
const packages = yield commons_1.CommandContext.getSystemPackages();
|
|
57
|
+
const result = yield (0, trm_core_1.publish)({
|
|
58
|
+
contextData: {
|
|
59
|
+
logTemporaryFolder: (0, utils_1.getTempFolder)(),
|
|
60
|
+
systemPackages: packages,
|
|
61
|
+
noInquirer: commandArgs.noPrompts
|
|
62
|
+
},
|
|
63
|
+
packageData: {
|
|
64
|
+
name: commandArgs.package,
|
|
65
|
+
version: commandArgs.version,
|
|
66
|
+
devclass: commandArgs.devclass,
|
|
67
|
+
manifest: {
|
|
68
|
+
authors: commandArgs.authors,
|
|
69
|
+
backwardsCompatible: commandArgs.backwardsCompatible,
|
|
70
|
+
description: commandArgs.description,
|
|
71
|
+
git: commandArgs.git,
|
|
72
|
+
keywords: commandArgs.keywords,
|
|
73
|
+
license: commandArgs.license,
|
|
74
|
+
website: commandArgs.website,
|
|
75
|
+
dependencies: _parseDependenciesArg(commandArgs.dependencies),
|
|
76
|
+
sapEntries: _parseSapEntriesArg(commandArgs.sapEntries)
|
|
77
|
+
},
|
|
78
|
+
registry
|
|
79
|
+
},
|
|
80
|
+
publishData: {
|
|
81
|
+
noLanguageTransport: commandArgs.noLanguageTransport,
|
|
82
|
+
noDependenciesDetection: commandArgs.noDependenciesDetection,
|
|
83
|
+
skipCustomizingTransports: commandArgs.skipCustomizingTransports,
|
|
84
|
+
customizingTransports: commandArgs.customizingTransports
|
|
85
|
+
},
|
|
86
|
+
systemData: {
|
|
87
|
+
releaseTimeout: _parseReleaseTimeoutArg(commandArgs.releaseTimeout),
|
|
88
|
+
transportTarget: commandArgs.transportTarget
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const sOutput = `+ ${result.trmPackage.manifest.get().name} ${result.trmPackage.manifest.get().version} >> ${outputPath}`;
|
|
92
|
+
trm_core_1.Logger.success(sOutput);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
exports.pack = pack;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ConnectArguments } from "../arguments";
|
|
2
|
-
export declare function connect(commandArgs: ConnectArguments, createAliasIfNotExist?: boolean): Promise<ConnectArguments>;
|
|
2
|
+
export declare function connect(commandArgs: ConnectArguments, createAliasIfNotExist?: boolean, addNoConnection?: boolean): Promise<ConnectArguments>;
|
|
@@ -60,7 +60,7 @@ const languageList = [
|
|
|
60
60
|
];
|
|
61
61
|
const _createAliasIfNotExists = () => {
|
|
62
62
|
};
|
|
63
|
-
function connect(commandArgs, createAliasIfNotExist = true) {
|
|
63
|
+
function connect(commandArgs, createAliasIfNotExist = true, addNoConnection) {
|
|
64
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65
65
|
const noSystemAlias = commandArgs.noSystemAlias ? true : false;
|
|
66
66
|
const force = commandArgs.force ? true : false;
|
|
@@ -74,6 +74,11 @@ function connect(commandArgs, createAliasIfNotExist = true) {
|
|
|
74
74
|
catch (e) {
|
|
75
75
|
aSapLogonConnections = [];
|
|
76
76
|
}
|
|
77
|
+
if (addNoConnection) {
|
|
78
|
+
aInputType.push({
|
|
79
|
+
value: 'none', name: 'No connection'
|
|
80
|
+
});
|
|
81
|
+
}
|
|
77
82
|
if (aAlias.length > 0 && !noSystemAlias) {
|
|
78
83
|
aInputType.push({
|
|
79
84
|
value: 'alias', name: 'System Alias'
|
|
@@ -101,7 +106,12 @@ function connect(commandArgs, createAliasIfNotExist = true) {
|
|
|
101
106
|
else {
|
|
102
107
|
inputType = 'input';
|
|
103
108
|
}
|
|
104
|
-
if (inputType === '
|
|
109
|
+
if (inputType === 'none') {
|
|
110
|
+
return {
|
|
111
|
+
connection: new utils_1.NoConnection()
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
else if (inputType === 'alias') {
|
|
105
115
|
const inq2 = yield trm_core_1.Inquirer.prompt({
|
|
106
116
|
type: `list`,
|
|
107
117
|
name: `aliasName`,
|
|
@@ -207,7 +217,7 @@ function connect(commandArgs, createAliasIfNotExist = true) {
|
|
|
207
217
|
message: `Logon Client`,
|
|
208
218
|
default: commandArgs.client,
|
|
209
219
|
when: (hash) => {
|
|
210
|
-
return hash.type === 'RFC' && ((commandArgs.client ? false : true) || force);
|
|
220
|
+
return (hash.type === 'RFC' || inputType === 'logon') && ((commandArgs.client ? false : true) || force);
|
|
211
221
|
}
|
|
212
222
|
}, {
|
|
213
223
|
type: `input`,
|
|
@@ -239,13 +249,13 @@ function connect(commandArgs, createAliasIfNotExist = true) {
|
|
|
239
249
|
choices: languageList
|
|
240
250
|
}]);
|
|
241
251
|
}
|
|
242
|
-
type = result.type || type;
|
|
252
|
+
result.type = result.type || type;
|
|
243
253
|
result.user = result.user || commandArgs.user;
|
|
244
254
|
result.passwd = result.passwd || commandArgs.passwd;
|
|
245
255
|
result.lang = result.lang || commandArgs.lang;
|
|
246
256
|
result.user = result.user.toUpperCase();
|
|
247
257
|
result.lang = result.lang.toUpperCase();
|
|
248
|
-
if (type === utils_1.SystemConnectorType.RFC) {
|
|
258
|
+
if (result.type === utils_1.SystemConnectorType.RFC) {
|
|
249
259
|
result.ashost = result.ashost || commandArgs.ashost;
|
|
250
260
|
result.dest = result.dest || commandArgs.dest;
|
|
251
261
|
result.saprouter = result.saprouter || commandArgs.saprouter;
|
|
@@ -268,7 +278,7 @@ function connect(commandArgs, createAliasIfNotExist = true) {
|
|
|
268
278
|
}
|
|
269
279
|
});
|
|
270
280
|
}
|
|
271
|
-
else if (type === utils_1.SystemConnectorType.REST) {
|
|
281
|
+
else if (result.type === utils_1.SystemConnectorType.REST) {
|
|
272
282
|
result.endpoint = result.endpoint || commandArgs.endpoint;
|
|
273
283
|
result.forwardRfcDest = result.forwardRfcDest || commandArgs.forwardRfcDest;
|
|
274
284
|
if (result.forwardRfcDest) {
|
|
@@ -290,7 +300,7 @@ function connect(commandArgs, createAliasIfNotExist = true) {
|
|
|
290
300
|
});
|
|
291
301
|
}
|
|
292
302
|
else {
|
|
293
|
-
throw new Error(`Unknown connection type "${type}".`);
|
|
303
|
+
throw new Error(`Unknown connection type "${result.type}".`);
|
|
294
304
|
}
|
|
295
305
|
if (createAliasIfNotExist) {
|
|
296
306
|
yield systemAlias_1.SystemAlias.createIfNotExists(result);
|
package/dist/commands/publish.js
CHANGED
|
@@ -73,10 +73,11 @@ const _parseReleaseTimeoutArg = (arg) => {
|
|
|
73
73
|
};
|
|
74
74
|
function publish(commandArgs) {
|
|
75
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
const packages = yield commons_1.CommandContext.getSystemPackages();
|
|
76
77
|
const result = yield (0, trm_core_1.publish)({
|
|
77
78
|
contextData: {
|
|
78
79
|
logTemporaryFolder: (0, utils_1.getTempFolder)(),
|
|
79
|
-
systemPackages:
|
|
80
|
+
systemPackages: packages,
|
|
80
81
|
noInquirer: commandArgs.noPrompts
|
|
81
82
|
},
|
|
82
83
|
packageData: {
|
package/dist/commands/view.js
CHANGED
|
@@ -8,14 +8,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.view = void 0;
|
|
13
16
|
const trm_core_1 = require("trm-core");
|
|
14
17
|
const commons_1 = require("./commons");
|
|
15
18
|
const semver_1 = require("semver");
|
|
16
19
|
const registryAlias_1 = require("../registryAlias");
|
|
20
|
+
const utils_1 = require("../utils");
|
|
21
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
17
22
|
const _printHeaderSection = (packageName) => {
|
|
18
|
-
trm_core_1.Logger.info(`Package name: ${packageName}`);
|
|
23
|
+
trm_core_1.Logger.info(`Package name: ${chalk_1.default.bold(packageName)}`);
|
|
19
24
|
trm_core_1.Logger.info(`Registry: ${commons_1.CommandContext.getRegistry().name}`);
|
|
20
25
|
};
|
|
21
26
|
const _printVersionSection = (systemPackage, registryView) => {
|
|
@@ -23,73 +28,75 @@ const _printVersionSection = (systemPackage, registryView) => {
|
|
|
23
28
|
return;
|
|
24
29
|
}
|
|
25
30
|
var oSystemManifest;
|
|
26
|
-
trm_core_1.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
if (!(trm_core_1.SystemConnector.systemConnector instanceof utils_1.NoConnection)) {
|
|
32
|
+
console.log('');
|
|
33
|
+
if (systemPackage) {
|
|
34
|
+
oSystemManifest = systemPackage.manifest.get();
|
|
35
|
+
trm_core_1.Logger.success(`Installed on ${trm_core_1.SystemConnector.getDest()}: Yes`);
|
|
36
|
+
console.log(`Installed version: ${oSystemManifest.version}`);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
trm_core_1.Logger.error(`Installed on ${trm_core_1.SystemConnector.getDest()}: No`);
|
|
40
|
+
}
|
|
34
41
|
}
|
|
35
42
|
if (registryView && registryView.release) {
|
|
36
|
-
|
|
43
|
+
console.log(`Latest version available: ${registryView.release.version}`);
|
|
37
44
|
if (oSystemManifest) {
|
|
38
45
|
if ((0, semver_1.eq)(oSystemManifest.version, registryView.release.version)) {
|
|
39
46
|
trm_core_1.Logger.success(`Latest version installed: Yes`);
|
|
40
47
|
}
|
|
41
48
|
else {
|
|
42
|
-
trm_core_1.Logger.
|
|
49
|
+
trm_core_1.Logger.error(`Latest version installed: No`);
|
|
43
50
|
}
|
|
44
51
|
}
|
|
45
52
|
}
|
|
46
53
|
};
|
|
47
54
|
const _printManifestSection = (manifest) => {
|
|
48
|
-
|
|
55
|
+
console.log('');
|
|
49
56
|
if (manifest.devclass !== undefined) {
|
|
50
|
-
|
|
57
|
+
console.log(`SAP Package: ${manifest.devclass}`);
|
|
51
58
|
}
|
|
52
59
|
if (manifest.importTransport !== undefined) {
|
|
53
|
-
|
|
60
|
+
console.log(`Import transport: ${manifest.importTransport}`);
|
|
54
61
|
}
|
|
55
62
|
if (manifest.workbenchTransport !== undefined) {
|
|
56
|
-
|
|
63
|
+
console.log(`Workbench transport: ${manifest.workbenchTransport}`);
|
|
57
64
|
}
|
|
58
65
|
if (manifest.private !== undefined) {
|
|
59
66
|
if (manifest.private) {
|
|
60
|
-
|
|
67
|
+
console.log(`Private: Yes`);
|
|
61
68
|
}
|
|
62
69
|
else {
|
|
63
|
-
|
|
70
|
+
console.log(`Private: No`);
|
|
64
71
|
}
|
|
65
72
|
}
|
|
66
73
|
if (manifest.description !== undefined) {
|
|
67
|
-
|
|
74
|
+
console.log(`Short description: ${manifest.description}`);
|
|
68
75
|
}
|
|
69
76
|
if (manifest.backwardsCompatible !== undefined) {
|
|
70
77
|
if (manifest.backwardsCompatible) {
|
|
71
|
-
|
|
78
|
+
console.log(`Backwards compatible: Yes`);
|
|
72
79
|
}
|
|
73
80
|
else {
|
|
74
|
-
|
|
81
|
+
console.log(`Backwards compatible: No`);
|
|
75
82
|
}
|
|
76
83
|
}
|
|
77
84
|
if (manifest.website !== undefined) {
|
|
78
|
-
|
|
85
|
+
console.log(`Website: ${manifest.website}`);
|
|
79
86
|
}
|
|
80
87
|
if (manifest.git !== undefined) {
|
|
81
|
-
|
|
88
|
+
console.log(`Git: ${manifest.git}`);
|
|
82
89
|
}
|
|
83
90
|
if (manifest.authors !== undefined) {
|
|
84
|
-
|
|
91
|
+
console.log(`Authors: ${manifest.authors}`);
|
|
85
92
|
}
|
|
86
93
|
if (manifest.license !== undefined) {
|
|
87
|
-
|
|
94
|
+
console.log(`License: ${manifest.license}`);
|
|
88
95
|
}
|
|
89
96
|
};
|
|
90
97
|
const _printDependenciesSection = (dependencies) => {
|
|
91
98
|
if (dependencies.length > 0) {
|
|
92
|
-
|
|
99
|
+
console.log('');
|
|
93
100
|
trm_core_1.Logger.info(`This package has a total of ${dependencies.length} dependencies.`);
|
|
94
101
|
const registryAliases = registryAlias_1.RegistryAlias.getAll();
|
|
95
102
|
const tableHead = [`Name`, `Version`, `Registry`];
|
|
@@ -98,8 +105,8 @@ const _printDependenciesSection = (dependencies) => {
|
|
|
98
105
|
const dependencyName = o.name;
|
|
99
106
|
const dependencyVersion = o.version;
|
|
100
107
|
var dependencyRegistry;
|
|
101
|
-
if (!o.registry || o.registry.trim().toLowerCase() ===
|
|
102
|
-
dependencyRegistry =
|
|
108
|
+
if (!o.registry || o.registry.trim().toLowerCase() === trm_core_1.PUBLIC_RESERVED_KEYWORD) {
|
|
109
|
+
dependencyRegistry = trm_core_1.PUBLIC_RESERVED_KEYWORD;
|
|
103
110
|
}
|
|
104
111
|
else {
|
|
105
112
|
const oRegistryAlias = registryAliases.find(k => k.endpointUrl === o.registry);
|
|
@@ -123,8 +130,8 @@ function view(commandArgs) {
|
|
|
123
130
|
return __awaiter(this, void 0, void 0, function* () {
|
|
124
131
|
const packageName = commandArgs.package;
|
|
125
132
|
const dest = trm_core_1.SystemConnector.getDest();
|
|
126
|
-
trm_core_1.Logger.loading(`
|
|
127
|
-
const aSystemPackages = yield
|
|
133
|
+
trm_core_1.Logger.loading(`Searching package ${packageName}...`);
|
|
134
|
+
const aSystemPackages = yield commons_1.CommandContext.getSystemPackages();
|
|
128
135
|
const oSystemView = aSystemPackages.find(o => o.compareName(packageName) && o.compareRegistry(commons_1.CommandContext.getRegistry()));
|
|
129
136
|
const oRegistryView = yield (0, commons_1.viewRegistryPackage)(packageName, true);
|
|
130
137
|
var authors;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
require("dotenv/config");
|
|
5
4
|
const commander_1 = require("commander");
|
|
6
5
|
const utils_1 = require("./utils");
|
|
7
6
|
const trm_registry_types_1 = require("trm-registry-types");
|
|
@@ -95,6 +94,34 @@ If a default manifest with dependencies is provided in conjunction with the auto
|
|
|
95
94
|
requiresRegistry: true,
|
|
96
95
|
requiresTrmDependencies: true
|
|
97
96
|
});
|
|
97
|
+
const pack = program.command(`pack <package> [version]`)
|
|
98
|
+
.description(`Save package locally.`)
|
|
99
|
+
.addHelpText(`before`, `When no version is defined, it will automatically set to 1.0.0.
|
|
100
|
+
Translation transport is only generated for packages that contain one or more objects with translations (unless skipped by flag).
|
|
101
|
+
Customizing transport is only generated if a valid list of customizing transports is provided (unless skipped by flag).
|
|
102
|
+
If a default manifest with dependencies is provided in conjunction with the automatic dependency generation, results will be merged.`)
|
|
103
|
+
.option(`-o, --output <<outputPath>>`, `Output path.`)
|
|
104
|
+
.option(`-np, --noPrompts`, `No prompts (will force some decisions).`, false)
|
|
105
|
+
.option(`-nl, --noLanguageTransport`, `Skip language (translations) transport publish.`, false)
|
|
106
|
+
.option(`-nd, --noDependenciesDetection`, `Skip automatic dependencies detection.`, false)
|
|
107
|
+
.option(`-sc, --skipCustomizingTransports`, `Skip customizing transports input.`, false)
|
|
108
|
+
.option(`-to, --releaseTimeout <timeout>`, `Publish transports release timeout (in seconds).`, '180')
|
|
109
|
+
.option(`-d, --devclass <devclass>`, `ABAP package to publish.`)
|
|
110
|
+
.option(`-cust, --customizingTransports <customizingTransports>`, `Customizing transports (separated by comma).`)
|
|
111
|
+
.option(`-tt, --transportTarget <transportTarget>`, `Publish transports target.`)
|
|
112
|
+
.option(`-bc, --backwardsCompatible`, `Indicates backwards compatibility with older releases.`, true)
|
|
113
|
+
.option(`-sd, --description`, `Short description of the package.`)
|
|
114
|
+
.option(`-gl, --git <link>`, `Git link.`)
|
|
115
|
+
.option(`-wl, --website <link>`, `Website link.`)
|
|
116
|
+
.option(`-pl, --license <license>`, `Package license.`)
|
|
117
|
+
.option(`-pa, --authors <authors>`, `Package authors (separated by comma).`)
|
|
118
|
+
.option(`-pk, --keywords <keywords>`, `Package keywords (separated by comma).`)
|
|
119
|
+
.option(`-pd, --dependencies <JSON>`, `Package dependencies (in JSON format).`)
|
|
120
|
+
.option(`-ps, --sapEntries <JSON>`, `Package SAP entries (in JSON format).`);
|
|
121
|
+
(0, utils_1.registerCommand)(pack, {
|
|
122
|
+
requiresConnection: true,
|
|
123
|
+
requiresTrmDependencies: true
|
|
124
|
+
});
|
|
98
125
|
const unpublish = program.command(`unpublish <package> [version]`)
|
|
99
126
|
.description(`Unpublish a package release from registry.`);
|
|
100
127
|
(0, utils_1.registerCommand)(unpublish, {
|
|
@@ -148,12 +175,35 @@ const update = program.command(`update <package> [version]`)
|
|
|
148
175
|
requiresRegistry: true,
|
|
149
176
|
requiresTrmDependencies: true
|
|
150
177
|
});
|
|
178
|
+
const _import = program.command(`import <file>`)
|
|
179
|
+
.description(`Import a package (as a file) into system.`)
|
|
180
|
+
.option(`-np, --noPrompts`, `No prompts (will force some decisions).`, false)
|
|
181
|
+
.option(`-ow, --overwrite`, `Overwrite installation (allow re-install).`, false)
|
|
182
|
+
.option(`-sf, --safe`, `Safe install (needs package integrity).`, false)
|
|
183
|
+
.option(`-nd, --noDependencies`, `Skip check/install of package dependencies.`, false)
|
|
184
|
+
.option(`-no, --noObjectTypes`, `Skip check of package object types.`, false)
|
|
185
|
+
.option(`-ns, --noSapEntries`, `Skip check of package SAP entries/objects.`, false)
|
|
186
|
+
.option(`-nl, --noLanguageTransport`, `Skip install of language (translations) transport (if exists).`, false)
|
|
187
|
+
.option(`-nc, --noCustomizingTransport`, `Skip install of customizing transport (if exists).`, false)
|
|
188
|
+
.option(`-to, --importTimeout <timeout>`, `Install transports import timeout (in seconds).`, '180')
|
|
189
|
+
.option(`-kd, --keepOriginalPackages`, `Keep original ABAP packages names.`, false)
|
|
190
|
+
.option(`-it, --createInstallTransport`, `Create/update install transport (used for landscape transports).`, true)
|
|
191
|
+
.option(`-r3, --r3transPath <path>`, `R3trans program path. (default: Environment variable R3TRANS_HOME)`)
|
|
192
|
+
.option(`-sha, --integrity <sha>`, `Package integrity.`)
|
|
193
|
+
.option(`-tl, --transportLayer <transportLayer>`, `ABAP packages transport layer. (default: System default)`)
|
|
194
|
+
.option(`-tl, --packageReplacements <JSON>`, `ABAP package replacements in JSON format.`)
|
|
195
|
+
.option(`-itt, --installTransportTargetSys <transportTarget>`, `Install transport target system.`);
|
|
196
|
+
(0, utils_1.registerCommand)(_import, {
|
|
197
|
+
requiresConnection: true,
|
|
198
|
+
requiresTrmDependencies: true
|
|
199
|
+
});
|
|
151
200
|
const view = program.command(`view <package>`)
|
|
152
201
|
.description(`View package.`)
|
|
153
202
|
.addHelpText(`before`, `Shows package details.
|
|
154
203
|
If the package is not found on the system, it will automatically fall back to the data provided by the registry, granted it exists.`);
|
|
155
204
|
(0, utils_1.registerCommand)(view, {
|
|
156
205
|
requiresConnection: true,
|
|
206
|
+
addNoConnection: true,
|
|
157
207
|
requiresRegistry: true,
|
|
158
208
|
ignoreRegistryUnreachable: true
|
|
159
209
|
});
|
|
@@ -164,8 +214,16 @@ const compare = program.command(`compare <package>`)
|
|
|
164
214
|
requiresRegistry: true,
|
|
165
215
|
ignoreRegistryUnreachable: true
|
|
166
216
|
});
|
|
217
|
+
const content = program.command(`content <package> [version]`)
|
|
218
|
+
.description(`List content of a package.`)
|
|
219
|
+
.option(`-a, --all`, `List all content`, false)
|
|
220
|
+
.option(`-r3, --r3transPath <path>`, `R3trans program path. (default: Environment variable R3TRANS_HOME)`);
|
|
221
|
+
(0, utils_1.registerCommand)(content, {
|
|
222
|
+
requiresRegistry: true
|
|
223
|
+
});
|
|
167
224
|
const list = program.command(`list`)
|
|
168
|
-
.description(`List packages installed on a system.`)
|
|
225
|
+
.description(`List packages installed on a system.`)
|
|
226
|
+
.option(`-l, --locals`, `List imported/exported local packages`, false);
|
|
169
227
|
(0, utils_1.registerCommand)(list, {
|
|
170
228
|
requiresConnection: true
|
|
171
229
|
});
|
|
@@ -188,6 +246,7 @@ const info = program.command(`info`)
|
|
|
188
246
|
.description(`TRM Client/Server Info.`);
|
|
189
247
|
(0, utils_1.registerCommand)(info, {
|
|
190
248
|
requiresConnection: true,
|
|
249
|
+
addNoConnection: true,
|
|
191
250
|
requiresTrmDependencies: true
|
|
192
251
|
});
|
|
193
252
|
const settings = program.command(`settings`)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { RegistryAliasData } from "./RegistryAliasData";
|
|
2
|
-
import {
|
|
2
|
+
import { AbstractRegistry } from "trm-core";
|
|
3
3
|
export declare class RegistryAlias {
|
|
4
4
|
private _endpoint;
|
|
5
5
|
private _name;
|
|
6
6
|
authData: any;
|
|
7
7
|
constructor(_endpoint: string, _name: string);
|
|
8
8
|
private setAuthData;
|
|
9
|
-
getRegistry():
|
|
9
|
+
getRegistry(): AbstractRegistry;
|
|
10
10
|
private static generateFile;
|
|
11
11
|
private static getSystemAliasFilePath;
|
|
12
12
|
static getAll(): RegistryAliasData[];
|
|
@@ -15,4 +15,5 @@ export declare class RegistryAlias {
|
|
|
15
15
|
static delete(name: string): void;
|
|
16
16
|
static update(name: string, auth?: any): void;
|
|
17
17
|
static generatePublicRegistryAlias(): void;
|
|
18
|
+
static getTemporaryInstance(endpoint: string, auth?: any): RegistryAlias;
|
|
18
19
|
}
|
|
@@ -101,9 +101,9 @@ class RegistryAlias {
|
|
|
101
101
|
const aAlias = this.getAll();
|
|
102
102
|
var alias = aAlias.find(o => o.alias.trim().toUpperCase() === name.trim().toUpperCase());
|
|
103
103
|
if (alias) {
|
|
104
|
-
if (name.trim().toLowerCase() ===
|
|
105
|
-
alias.endpointUrl =
|
|
106
|
-
alias.alias =
|
|
104
|
+
if (name.trim().toLowerCase() === trm_core_1.PUBLIC_RESERVED_KEYWORD) {
|
|
105
|
+
alias.endpointUrl = trm_core_1.PUBLIC_RESERVED_KEYWORD;
|
|
106
|
+
alias.alias = trm_core_1.PUBLIC_RESERVED_KEYWORD;
|
|
107
107
|
}
|
|
108
108
|
return new RegistryAlias(alias.endpointUrl, alias.alias).setAuthData(alias.auth);
|
|
109
109
|
}
|
|
@@ -120,7 +120,7 @@ class RegistryAlias {
|
|
|
120
120
|
else {
|
|
121
121
|
aAlias.push({
|
|
122
122
|
alias: name,
|
|
123
|
-
endpointUrl: endpointUrl.trim().toLowerCase() ===
|
|
123
|
+
endpointUrl: endpointUrl.trim().toLowerCase() === trm_core_1.PUBLIC_RESERVED_KEYWORD ? null : endpointUrl,
|
|
124
124
|
auth
|
|
125
125
|
});
|
|
126
126
|
this.generateFile(aAlias);
|
|
@@ -145,9 +145,12 @@ class RegistryAlias {
|
|
|
145
145
|
}
|
|
146
146
|
static generatePublicRegistryAlias() {
|
|
147
147
|
const allRegistries = this.getAll();
|
|
148
|
-
if (!allRegistries.find(o => o.alias.trim().toLowerCase() ===
|
|
149
|
-
RegistryAlias.create(
|
|
148
|
+
if (!allRegistries.find(o => o.alias.trim().toLowerCase() === trm_core_1.PUBLIC_RESERVED_KEYWORD)) {
|
|
149
|
+
RegistryAlias.create(trm_core_1.PUBLIC_RESERVED_KEYWORD, trm_core_1.PUBLIC_RESERVED_KEYWORD, null);
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
+
static getTemporaryInstance(endpoint, auth) {
|
|
153
|
+
return new RegistryAlias(endpoint, endpoint).setAuthData(auth);
|
|
154
|
+
}
|
|
152
155
|
}
|
|
153
156
|
exports.RegistryAlias = RegistryAlias;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ISystemConnector, SystemConnectorSupportedBulk, TADIR } from "trm-core";
|
|
2
|
+
export declare class NoConnection implements ISystemConnector {
|
|
3
|
+
_throw(): any;
|
|
4
|
+
supportedBulk: SystemConnectorSupportedBulk;
|
|
5
|
+
getConnectionData: () => any;
|
|
6
|
+
getDest: () => string;
|
|
7
|
+
getLogonLanguage: (c: boolean) => "X" | "XX";
|
|
8
|
+
getLogonUser: () => string;
|
|
9
|
+
connect: () => Promise<void>;
|
|
10
|
+
checkConnection: () => Promise<boolean>;
|
|
11
|
+
ping: () => Promise<string>;
|
|
12
|
+
getFileSystem: () => Promise<any>;
|
|
13
|
+
getDirTrans: () => Promise<any>;
|
|
14
|
+
getBinaryFile: () => Promise<any>;
|
|
15
|
+
writeBinaryFile: () => Promise<any>;
|
|
16
|
+
createTocTransport: () => Promise<any>;
|
|
17
|
+
createWbTransport: () => Promise<any>;
|
|
18
|
+
setTransportDoc: () => Promise<any>;
|
|
19
|
+
addToTransportRequest: () => Promise<any>;
|
|
20
|
+
repositoryEnvironment: () => Promise<any>;
|
|
21
|
+
deleteTrkorr: () => Promise<any>;
|
|
22
|
+
releaseTrkorr: () => Promise<any>;
|
|
23
|
+
addSkipTrkorr: () => Promise<any>;
|
|
24
|
+
addSrcTrkorr: () => Promise<any>;
|
|
25
|
+
readTmsQueue: () => Promise<any>;
|
|
26
|
+
createPackage: () => Promise<any>;
|
|
27
|
+
getDefaultTransportLayer: () => Promise<string>;
|
|
28
|
+
tadirInterface: () => Promise<any>;
|
|
29
|
+
dequeueTransport: () => Promise<any>;
|
|
30
|
+
forwardTransport: () => Promise<any>;
|
|
31
|
+
importTransport: () => Promise<any>;
|
|
32
|
+
setInstallDevc: () => Promise<any>;
|
|
33
|
+
getObjectsList: () => Promise<any>;
|
|
34
|
+
renameTransportRequest: () => Promise<any>;
|
|
35
|
+
setPackageIntegrity: () => Promise<any>;
|
|
36
|
+
addTranslationToTr: () => Promise<any>;
|
|
37
|
+
trCopy: () => Promise<any>;
|
|
38
|
+
getTransportObjectsBulk?: () => Promise<TADIR[]>;
|
|
39
|
+
getExistingObjectsBulk?: () => Promise<TADIR[]>;
|
|
40
|
+
addNamespace: () => Promise<any>;
|
|
41
|
+
getMessage: () => Promise<any>;
|
|
42
|
+
getTransportStatus: () => Promise<any>;
|
|
43
|
+
getPackageWorkbenchTransport: () => Promise<any>;
|
|
44
|
+
getSourceTrkorr: () => Promise<any>;
|
|
45
|
+
getIgnoredTrkorr: () => Promise<any>;
|
|
46
|
+
getObject: () => Promise<any>;
|
|
47
|
+
getInstalledPackages: () => Promise<any[]>;
|
|
48
|
+
getDevclass: () => Promise<any>;
|
|
49
|
+
getTransportTargets: () => Promise<any>;
|
|
50
|
+
getSubpackages: () => Promise<any>;
|
|
51
|
+
getDevclassObjects: () => Promise<any>;
|
|
52
|
+
getInstallPackages: () => Promise<any>;
|
|
53
|
+
setPackageSuperpackage: () => Promise<any>;
|
|
54
|
+
clearPackageSuperpackage: () => Promise<any>;
|
|
55
|
+
setPackageTransportLayer: () => Promise<any>;
|
|
56
|
+
checkSapEntryExists: () => Promise<any>;
|
|
57
|
+
getPackageIntegrity: () => Promise<any>;
|
|
58
|
+
getFunctionModule: () => Promise<any>;
|
|
59
|
+
getExistingObjects: () => Promise<any>;
|
|
60
|
+
getNamespace: () => Promise<any>;
|
|
61
|
+
getR3transVersion: () => Promise<any>;
|
|
62
|
+
getR3transUnicode: () => Promise<any>;
|
|
63
|
+
isTransportLayerExist: () => Promise<any>;
|
|
64
|
+
getTrmServerPackage: () => Promise<any>;
|
|
65
|
+
getTrmRestPackage: () => Promise<any>;
|
|
66
|
+
removeComments: () => Promise<any>;
|
|
67
|
+
removeSkipTrkorr: () => Promise<any>;
|
|
68
|
+
migrateTransport: () => Promise<any>;
|
|
69
|
+
deleteTmsTransport: () => Promise<any>;
|
|
70
|
+
refreshTransportTmsTxt: () => Promise<any>;
|
|
71
|
+
getDotAbapgit: () => Promise<any>;
|
|
72
|
+
getAbapgitSource: () => Promise<any>;
|
|
73
|
+
executePostActivity: () => Promise<any>;
|
|
74
|
+
readClassDescriptions: () => Promise<any>;
|
|
75
|
+
}
|