trm-client 6.1.1 → 7.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/LICENSE +20 -20
- package/README.md +65 -65
- package/changelog.txt +179 -165
- package/dist/command/AbstractCommand.d.ts +42 -0
- package/dist/command/AbstractCommand.js +418 -0
- package/dist/command/InquirerType.d.ts +3 -0
- package/dist/command/InquirerType.js +7 -0
- package/dist/{utils/executeCommand.d.ts → command/LoggerType.d.ts} +0 -4
- package/dist/command/LoggerType.js +11 -0
- package/dist/{utils/registerCommand.d.ts → command/RegisterCommandOpts.d.ts} +4 -3
- package/dist/command/implementations/Alias.d.ts +8 -0
- package/dist/command/implementations/Alias.js +172 -0
- package/dist/command/implementations/Compare.d.ts +7 -0
- package/dist/command/implementations/Compare.js +133 -0
- package/dist/command/implementations/Content.d.ts +5 -0
- package/dist/command/implementations/Content.js +195 -0
- package/dist/command/implementations/Deprecate.d.ts +5 -0
- package/dist/command/implementations/Deprecate.js +33 -0
- package/dist/command/implementations/DistTag.d.ts +5 -0
- package/dist/command/implementations/DistTag.js +48 -0
- package/dist/command/implementations/FindDependencies.d.ts +5 -0
- package/dist/command/implementations/FindDependencies.js +42 -0
- package/dist/command/implementations/Info.d.ts +11 -0
- package/dist/command/implementations/Info.js +245 -0
- package/dist/command/implementations/Install.d.ts +13 -0
- package/dist/command/implementations/Install.js +201 -0
- package/dist/command/implementations/List.d.ts +5 -0
- package/dist/command/implementations/List.js +116 -0
- package/dist/command/implementations/Lock.d.ts +5 -0
- package/dist/command/implementations/Lock.js +40 -0
- package/dist/command/implementations/Login.d.ts +5 -0
- package/dist/command/implementations/Login.js +66 -0
- package/dist/command/implementations/Logout.d.ts +5 -0
- package/dist/command/implementations/Logout.js +37 -0
- package/dist/command/implementations/Ping.d.ts +5 -0
- package/dist/{commands/findDependencies.js → command/implementations/Ping.js} +15 -16
- package/dist/command/implementations/Publish.d.ts +6 -0
- package/dist/command/implementations/Publish.js +145 -0
- package/dist/command/implementations/Registry.d.ts +5 -0
- package/dist/command/implementations/Registry.js +88 -0
- package/dist/command/implementations/Settings.d.ts +5 -0
- package/dist/command/implementations/Settings.js +42 -0
- package/dist/command/implementations/Unpublish.d.ts +5 -0
- package/dist/command/implementations/Unpublish.js +34 -0
- package/dist/command/implementations/View.d.ts +9 -0
- package/dist/command/implementations/View.js +237 -0
- package/dist/command/implementations/WhoAmI.d.ts +5 -0
- package/dist/command/implementations/WhoAmI.js +36 -0
- package/dist/command/implementations/index.d.ts +19 -0
- package/dist/command/implementations/index.js +35 -0
- package/dist/command/index.d.ts +4 -0
- package/dist/{commands/commons → command}/index.js +4 -2
- package/dist/{commands/arguments/ConnectArguments.d.ts → command/prompts/connect.d.ts} +2 -0
- package/dist/{commands → command}/prompts/connect.js +3 -3
- package/dist/command/prompts/createAlias.d.ts +1 -0
- package/dist/{commands → command/prompts}/createAlias.js +8 -8
- package/dist/command/prompts/deleteAlias.d.ts +1 -0
- package/dist/{commands → command/prompts}/deleteAlias.js +3 -4
- package/dist/command/prompts/index.d.ts +4 -0
- package/dist/{commands → command}/prompts/index.js +2 -0
- package/dist/index.js +34 -278
- package/dist/registryAlias/RegistryAlias.js +1 -1
- package/dist/systemAlias/SystemAlias.js +4 -4
- package/dist/utils/{Context.d.ts → GlobalContext.d.ts} +3 -3
- package/dist/utils/{Context.js → GlobalContext.js} +6 -6
- package/dist/utils/checkCliUpdate.d.ts +3 -2
- package/dist/utils/checkCliUpdate.js +3 -3
- package/dist/utils/getSapLogonConnections.js +3 -3
- package/dist/utils/index.d.ts +1 -4
- package/dist/utils/index.js +1 -4
- package/package.json +67 -65
- package/dist/commands/addRegistry.d.ts +0 -2
- package/dist/commands/addRegistry.js +0 -66
- package/dist/commands/alias.d.ts +0 -2
- package/dist/commands/alias.js +0 -156
- package/dist/commands/arguments/AddRegistryArguments.d.ts +0 -5
- package/dist/commands/arguments/AliasArguments.d.ts +0 -3
- package/dist/commands/arguments/AliasArguments.js +0 -2
- package/dist/commands/arguments/CheckArguments.d.ts +0 -4
- package/dist/commands/arguments/CheckArguments.js +0 -2
- package/dist/commands/arguments/CompareArguments.d.ts +0 -4
- package/dist/commands/arguments/CompareArguments.js +0 -2
- package/dist/commands/arguments/ConnectArguments.js +0 -2
- package/dist/commands/arguments/ContentArguments.d.ts +0 -6
- package/dist/commands/arguments/ContentArguments.js +0 -2
- package/dist/commands/arguments/CreateAliasArguments.d.ts +0 -3
- package/dist/commands/arguments/CreateAliasArguments.js +0 -2
- package/dist/commands/arguments/DeleteAliasArguments.d.ts +0 -3
- package/dist/commands/arguments/DeleteAliasArguments.js +0 -2
- package/dist/commands/arguments/FindDependenciesArguments.d.ts +0 -5
- package/dist/commands/arguments/FindDependenciesArguments.js +0 -2
- package/dist/commands/arguments/ImportArguments.d.ts +0 -19
- package/dist/commands/arguments/ImportArguments.js +0 -2
- package/dist/commands/arguments/InfoArguments.d.ts +0 -1
- package/dist/commands/arguments/InfoArguments.js +0 -2
- package/dist/commands/arguments/InstallArguments.d.ts +0 -20
- package/dist/commands/arguments/InstallArguments.js +0 -2
- package/dist/commands/arguments/ListArguments.d.ts +0 -3
- package/dist/commands/arguments/ListArguments.js +0 -2
- package/dist/commands/arguments/LockArguments.d.ts +0 -4
- package/dist/commands/arguments/LockArguments.js +0 -2
- package/dist/commands/arguments/LoginArguments.d.ts +0 -4
- package/dist/commands/arguments/LoginArguments.js +0 -2
- package/dist/commands/arguments/LogoutArguments.d.ts +0 -1
- package/dist/commands/arguments/LogoutArguments.js +0 -2
- package/dist/commands/arguments/PackArguments.d.ts +0 -22
- package/dist/commands/arguments/PackArguments.js +0 -2
- package/dist/commands/arguments/PingArguments.d.ts +0 -1
- package/dist/commands/arguments/PingArguments.js +0 -2
- package/dist/commands/arguments/PublishArguments.d.ts +0 -24
- package/dist/commands/arguments/PublishArguments.js +0 -2
- package/dist/commands/arguments/RemoveRegistryArguments.d.ts +0 -4
- package/dist/commands/arguments/RemoveRegistryArguments.js +0 -2
- package/dist/commands/arguments/SettingsArgument.d.ts +0 -3
- package/dist/commands/arguments/SettingsArgument.js +0 -2
- package/dist/commands/arguments/UnpublishArguments.d.ts +0 -4
- package/dist/commands/arguments/UnpublishArguments.js +0 -2
- package/dist/commands/arguments/UpdateArguments.d.ts +0 -2
- package/dist/commands/arguments/UpdateArguments.js +0 -2
- package/dist/commands/arguments/ViewArguments.d.ts +0 -3
- package/dist/commands/arguments/ViewArguments.js +0 -2
- package/dist/commands/arguments/WhoAmIArguments.d.ts +0 -1
- package/dist/commands/arguments/WhoAmIArguments.js +0 -2
- package/dist/commands/arguments/index.d.ts +0 -24
- package/dist/commands/arguments/index.js +0 -40
- package/dist/commands/check.d.ts +0 -2
- package/dist/commands/check.js +0 -87
- package/dist/commands/commons/CommandContext.d.ts +0 -9
- package/dist/commands/commons/CommandContext.js +0 -41
- package/dist/commands/commons/index.d.ts +0 -2
- package/dist/commands/commons/viewRegistryPackage.d.ts +0 -2
- package/dist/commands/commons/viewRegistryPackage.js +0 -48
- package/dist/commands/compare.d.ts +0 -2
- package/dist/commands/compare.js +0 -167
- package/dist/commands/content.d.ts +0 -2
- package/dist/commands/content.js +0 -182
- package/dist/commands/createAlias.d.ts +0 -2
- package/dist/commands/deleteAlias.d.ts +0 -2
- package/dist/commands/findDependencies.d.ts +0 -2
- package/dist/commands/import.d.ts +0 -2
- package/dist/commands/import.js +0 -84
- package/dist/commands/index.d.ts +0 -27
- package/dist/commands/index.js +0 -43
- package/dist/commands/info.d.ts +0 -2
- package/dist/commands/info.js +0 -233
- package/dist/commands/install.d.ts +0 -2
- package/dist/commands/install.js +0 -85
- package/dist/commands/list.d.ts +0 -2
- package/dist/commands/list.js +0 -70
- package/dist/commands/lock.d.ts +0 -2
- package/dist/commands/lock.js +0 -64
- package/dist/commands/login.d.ts +0 -2
- package/dist/commands/login.js +0 -59
- package/dist/commands/logout.d.ts +0 -2
- package/dist/commands/logout.js +0 -27
- package/dist/commands/pack.d.ts +0 -2
- package/dist/commands/pack.js +0 -95
- package/dist/commands/ping.d.ts +0 -2
- package/dist/commands/ping.js +0 -21
- package/dist/commands/prompts/connect.d.ts +0 -3
- package/dist/commands/prompts/index.d.ts +0 -2
- package/dist/commands/publish.d.ts +0 -2
- package/dist/commands/publish.js +0 -128
- package/dist/commands/removeRegistry.d.ts +0 -2
- package/dist/commands/removeRegistry.js +0 -36
- package/dist/commands/selfUpdate.d.ts +0 -1
- package/dist/commands/selfUpdate.js +0 -77
- package/dist/commands/settings.d.ts +0 -2
- package/dist/commands/settings.js +0 -32
- package/dist/commands/unpublish.d.ts +0 -2
- package/dist/commands/unpublish.js +0 -61
- package/dist/commands/update.d.ts +0 -2
- package/dist/commands/update.js +0 -20
- package/dist/commands/view.d.ts +0 -2
- package/dist/commands/view.js +0 -219
- package/dist/commands/whoami.d.ts +0 -2
- package/dist/commands/whoami.js +0 -34
- package/dist/utils/checkTrmDependencies.d.ts +0 -1
- package/dist/utils/checkTrmDependencies.js +0 -43
- package/dist/utils/executeCommand.js +0 -213
- package/dist/utils/registerCommand.js +0 -93
- /package/dist/{commands/arguments/AddRegistryArguments.js → command/RegisterCommandOpts.js} +0 -0
- /package/dist/{commands → command}/prompts/pickRegistry.d.ts +0 -0
- /package/dist/{commands → command}/prompts/pickRegistry.js +0 -0
|
@@ -0,0 +1,133 @@
|
|
|
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.Compare = void 0;
|
|
13
|
+
const trm_commons_1 = require("trm-commons");
|
|
14
|
+
const trm_core_1 = require("trm-core");
|
|
15
|
+
const AbstractCommand_1 = require("../AbstractCommand");
|
|
16
|
+
const systemAlias_1 = require("../../systemAlias");
|
|
17
|
+
const prompts_1 = require("../prompts");
|
|
18
|
+
class Compare extends AbstractCommand_1.AbstractCommand {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.connections = [];
|
|
22
|
+
}
|
|
23
|
+
init() {
|
|
24
|
+
this.registerOpts.requiresRegistry = true;
|
|
25
|
+
this.registerOpts.ignoreRegistryUnreachable = true;
|
|
26
|
+
this.command.description(`Compare a package between different systems.`);
|
|
27
|
+
this.command.argument(`<package>`, `Name of the package.`);
|
|
28
|
+
this.command.option(`-c, --connections <json>`, `Array of system connection aliases (JSON or path to JSON file).`);
|
|
29
|
+
}
|
|
30
|
+
promptConnections() {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
if (this.connections.length > 0) {
|
|
33
|
+
trm_commons_1.Logger.info(`Compare systems: ${this.connections.map(o => o.getDest()).join(', ')}`);
|
|
34
|
+
}
|
|
35
|
+
var askConnection = true;
|
|
36
|
+
const inq1 = yield trm_commons_1.Inquirer.prompt([{
|
|
37
|
+
message: "Add another connection?",
|
|
38
|
+
name: "continue",
|
|
39
|
+
type: "confirm",
|
|
40
|
+
default: true,
|
|
41
|
+
when: this.connections.length > 0
|
|
42
|
+
}]);
|
|
43
|
+
askConnection = inq1.continue !== undefined ? inq1.continue : askConnection;
|
|
44
|
+
if (askConnection) {
|
|
45
|
+
const connectArgs = yield (0, prompts_1.connect)({}, false, false);
|
|
46
|
+
const systemConnector = connectArgs.getSystemConnector();
|
|
47
|
+
yield systemConnector.connect();
|
|
48
|
+
this.connections.push(systemConnector);
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
handler() {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const packageName = this.args.package;
|
|
59
|
+
const registry = this.getRegistry();
|
|
60
|
+
var inputConnections = this.parseJsonArg('connections');
|
|
61
|
+
if (Array.isArray(inputConnections)) {
|
|
62
|
+
for (const sAlias of inputConnections) {
|
|
63
|
+
if (typeof (sAlias) === 'string') {
|
|
64
|
+
const oAlias = systemAlias_1.SystemAlias.get(sAlias);
|
|
65
|
+
const oConnection = oAlias.getConnection();
|
|
66
|
+
this.connections.push(oConnection);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
var keepPrompt = true;
|
|
72
|
+
while (keepPrompt) {
|
|
73
|
+
keepPrompt = yield this.promptConnections();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
trm_commons_1.Logger.info(`Compare systems: ${this.connections.map(o => o.getDest()).join(', ')}`);
|
|
77
|
+
const tableHead = [`System`, `Installed`, `Version`, `Devclass`, `Import transport`];
|
|
78
|
+
var tableData = [];
|
|
79
|
+
trm_commons_1.Logger.loading(`Reading registry data...`);
|
|
80
|
+
var oRegistryView;
|
|
81
|
+
try {
|
|
82
|
+
oRegistryView = yield this.viewRegistryPackage(packageName, true);
|
|
83
|
+
}
|
|
84
|
+
catch (e) { }
|
|
85
|
+
trm_commons_1.Logger.loading(`Reading system data...`);
|
|
86
|
+
for (const oConnection of this.connections) {
|
|
87
|
+
trm_core_1.SystemConnector.systemConnector = oConnection;
|
|
88
|
+
const system = trm_core_1.SystemConnector.getDest() || '';
|
|
89
|
+
var installed;
|
|
90
|
+
var version;
|
|
91
|
+
var devclass;
|
|
92
|
+
var importTransport;
|
|
93
|
+
const aSystemPackages = yield trm_core_1.SystemConnector.getInstalledPackages(true);
|
|
94
|
+
const oSystemView = aSystemPackages.find(o => o.compareName(packageName) && o.compareRegistry(registry));
|
|
95
|
+
if (oSystemView && oSystemView.manifest) {
|
|
96
|
+
installed = 'Yes';
|
|
97
|
+
version = oSystemView.manifest.get().version || 'Unknown';
|
|
98
|
+
devclass = oSystemView.getDevclass() || 'Unknown';
|
|
99
|
+
if (oSystemView.manifest.getLinkedTransport()) {
|
|
100
|
+
importTransport = oSystemView.manifest.getLinkedTransport().trkorr;
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
importTransport = 'Unknown';
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
installed = 'No';
|
|
108
|
+
version = '';
|
|
109
|
+
devclass = '';
|
|
110
|
+
importTransport = '';
|
|
111
|
+
}
|
|
112
|
+
tableData.push([
|
|
113
|
+
system,
|
|
114
|
+
installed,
|
|
115
|
+
version,
|
|
116
|
+
devclass,
|
|
117
|
+
importTransport
|
|
118
|
+
]);
|
|
119
|
+
}
|
|
120
|
+
trm_commons_1.Logger.info(`Package name: ${packageName}`);
|
|
121
|
+
trm_commons_1.Logger.info(`Registry: ${registry.name}`);
|
|
122
|
+
try {
|
|
123
|
+
trm_commons_1.Logger.info(`Latest version: ${oRegistryView.dist_tags['latest'] || 'unknown'}`);
|
|
124
|
+
}
|
|
125
|
+
catch (e) {
|
|
126
|
+
trm_commons_1.Logger.warning(`Latest version: Unknown`);
|
|
127
|
+
}
|
|
128
|
+
trm_commons_1.Logger.log(`\n`);
|
|
129
|
+
trm_commons_1.Logger.table(tableHead, tableData);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
exports.Compare = Compare;
|
|
@@ -0,0 +1,195 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.Content = void 0;
|
|
16
|
+
const trm_commons_1 = require("trm-commons");
|
|
17
|
+
const AbstractCommand_1 = require("../AbstractCommand");
|
|
18
|
+
const utils_1 = require("../../utils");
|
|
19
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
20
|
+
class Content extends AbstractCommand_1.AbstractCommand {
|
|
21
|
+
init() {
|
|
22
|
+
this.registerOpts.requiresRegistry = true;
|
|
23
|
+
this.registerOpts.requiresR3trans = true;
|
|
24
|
+
this.command.description(`Extract and list content of a package.`);
|
|
25
|
+
this.command.addHelpText(`before`, `This command has no effect when trying to login into a registry that doesn't require authentication.`);
|
|
26
|
+
this.command.argument(`<package>`, `Name of the package.`);
|
|
27
|
+
this.command.argument(`[version]`, `Version or tag of the package`, 'latest');
|
|
28
|
+
this.command.option(`--full`, `Show all transport entries of the package`, false);
|
|
29
|
+
}
|
|
30
|
+
handler() {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
var transports = {};
|
|
33
|
+
var aNodes = [];
|
|
34
|
+
var iOtherEntries = 0;
|
|
35
|
+
const registry = this.getRegistry();
|
|
36
|
+
trm_commons_1.Logger.loading(`Searching package "${this.args.package}"...`);
|
|
37
|
+
const data = yield registry.getPackage(this.args.package, this.args.version);
|
|
38
|
+
const artifact = yield registry.downloadArtifact(this.args.package, this.args.version);
|
|
39
|
+
trm_commons_1.Logger.loading(`Reading content...`);
|
|
40
|
+
const packageContent = yield artifact.getContent({
|
|
41
|
+
tempDirPath: (0, utils_1.getTempFolder)(),
|
|
42
|
+
r3transDirPath: this.args.r3transPath,
|
|
43
|
+
useDocker: utils_1.GlobalContext.getInstance().getSettings().r3transDocker,
|
|
44
|
+
dockerOptions: {
|
|
45
|
+
name: utils_1.GlobalContext.getInstance().getSettings().r3transDockerName
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
if (this.args.tadirOnly) {
|
|
49
|
+
transports.TADIR = packageContent.TADIR.trkorr;
|
|
50
|
+
aNodes.push({
|
|
51
|
+
tableName: 'TADIR',
|
|
52
|
+
content: packageContent.TADIR.content.TADIR
|
|
53
|
+
});
|
|
54
|
+
Object.keys(packageContent).forEach(type => {
|
|
55
|
+
if (type === 'TADIR') {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
Object.keys(packageContent[type].content).forEach(tableName => {
|
|
59
|
+
iOtherEntries += packageContent[type].content[tableName].length;
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
Object.keys(packageContent).forEach(type => {
|
|
65
|
+
transports[type] = packageContent[type].trkorr;
|
|
66
|
+
Object.keys(packageContent[type].content).forEach(tableName => {
|
|
67
|
+
var nodeIndex = aNodes.findIndex(o => o.tableName === tableName);
|
|
68
|
+
if (nodeIndex < 0) {
|
|
69
|
+
nodeIndex = (aNodes.push({
|
|
70
|
+
tableName,
|
|
71
|
+
content: []
|
|
72
|
+
})) - 1;
|
|
73
|
+
}
|
|
74
|
+
aNodes[nodeIndex].content = aNodes[nodeIndex].content.concat(packageContent[type].content[tableName].map(o => {
|
|
75
|
+
o.__isDevc = type === 'DEVC';
|
|
76
|
+
o.__isLang = type === 'LANG';
|
|
77
|
+
o.__isCust = type === 'CUST';
|
|
78
|
+
return o;
|
|
79
|
+
}));
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
var tree = {
|
|
84
|
+
text: `${chalk_1.default.bold(this.args.package)} v${data.manifest.version} content`,
|
|
85
|
+
children: []
|
|
86
|
+
};
|
|
87
|
+
aNodes.forEach(node => {
|
|
88
|
+
if (node.content.length > 0) {
|
|
89
|
+
var tableNode = {
|
|
90
|
+
text: `${chalk_1.default.bold(node.tableName)} (${node.content.length} record${node.content.length > 1 ? 's' : ''})`,
|
|
91
|
+
children: []
|
|
92
|
+
};
|
|
93
|
+
node.content.forEach(record => {
|
|
94
|
+
var sRecord = [];
|
|
95
|
+
Object.keys(record).filter(k => !k.startsWith('__')).forEach(field => {
|
|
96
|
+
var fieldValue = record[field];
|
|
97
|
+
if (field && fieldValue) {
|
|
98
|
+
if (node.tableName === 'TADIR') {
|
|
99
|
+
if (field === 'SRCSYSTEM') {
|
|
100
|
+
fieldValue = chalk_1.default.strikethrough(fieldValue);
|
|
101
|
+
}
|
|
102
|
+
else if (field === 'DEVCLASS') {
|
|
103
|
+
fieldValue = chalk_1.default.italic(fieldValue);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
sRecord.push(`${chalk_1.default.bold(field)}: ${fieldValue}`);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
if (sRecord.length > 0) {
|
|
110
|
+
if (record.__isDevc) {
|
|
111
|
+
tableNode.children.push({
|
|
112
|
+
text: chalk_1.default.bgGrey(sRecord.join(', ')),
|
|
113
|
+
children: []
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
else if (record.__isLang) {
|
|
117
|
+
tableNode.children.push({
|
|
118
|
+
text: chalk_1.default.bgGreen(sRecord.join(', ')),
|
|
119
|
+
children: []
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
else if (record.__isCust) {
|
|
123
|
+
tableNode.children.push({
|
|
124
|
+
text: chalk_1.default.bgYellow(sRecord.join(', ')),
|
|
125
|
+
children: []
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
tableNode.children.push({
|
|
130
|
+
text: sRecord.join(', '),
|
|
131
|
+
children: []
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
tree.children.push(tableNode);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
trm_commons_1.Logger.tree(tree);
|
|
140
|
+
var header = ['', 'Namespace', 'ABAP Package', 'TRM Transport', 'Customizing', 'Translations'];
|
|
141
|
+
var row1 = [''];
|
|
142
|
+
var row2 = ['Highlight color'];
|
|
143
|
+
if (data.manifest.namespace) {
|
|
144
|
+
row1.push(`${data.manifest.namespace.ns || 'Yes'} ${data.manifest.namespace.replicense}`);
|
|
145
|
+
row2.push(``);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
row1.push(`No`);
|
|
149
|
+
row2.push(``);
|
|
150
|
+
}
|
|
151
|
+
if (Object.keys(packageContent).includes('DEVC')) {
|
|
152
|
+
row1.push(packageContent['DEVC'].trkorr);
|
|
153
|
+
row2.push(`${chalk_1.default.bgGrey('Grey')}`);
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
row1.push(`No`);
|
|
157
|
+
row2.push(``);
|
|
158
|
+
}
|
|
159
|
+
if (Object.keys(packageContent).includes('TADIR')) {
|
|
160
|
+
row1.push(packageContent['TADIR'].trkorr);
|
|
161
|
+
row2.push(``);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
row1.push(`No`);
|
|
165
|
+
row2.push(``);
|
|
166
|
+
}
|
|
167
|
+
if (Object.keys(packageContent).includes('CUST')) {
|
|
168
|
+
row1.push(packageContent['CUST'].trkorr);
|
|
169
|
+
row2.push(`${chalk_1.default.bgYellow('Yellow')}`);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
row1.push(`No`);
|
|
173
|
+
row2.push(``);
|
|
174
|
+
}
|
|
175
|
+
if (Object.keys(packageContent).includes('LANG')) {
|
|
176
|
+
row1.push(packageContent['LANG'].trkorr);
|
|
177
|
+
row2.push(`${chalk_1.default.bgGreen('Green')}`);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
row1.push(`No`);
|
|
181
|
+
row2.push(``);
|
|
182
|
+
}
|
|
183
|
+
if (row2.filter(s => s.length > 0).length > 0) {
|
|
184
|
+
trm_commons_1.Logger.table(header, [row1, row2]);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
trm_commons_1.Logger.table(header, [row1]);
|
|
188
|
+
}
|
|
189
|
+
if (iOtherEntries > 0) {
|
|
190
|
+
trm_commons_1.Logger.warning(`There are ${iOtherEntries} other entries to show. Run with option "--full" in order to see them.`);
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
exports.Content = Content;
|
|
@@ -0,0 +1,33 @@
|
|
|
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.Deprecate = void 0;
|
|
13
|
+
const AbstractCommand_1 = require("../AbstractCommand");
|
|
14
|
+
class Deprecate extends AbstractCommand_1.AbstractCommand {
|
|
15
|
+
init() {
|
|
16
|
+
this.registerOpts.requiresRegistry = true;
|
|
17
|
+
this.command.description(`Deprecate a package release from registry.`);
|
|
18
|
+
this.command.argument(`<package>`, `Name of the package.`);
|
|
19
|
+
this.command.argument(`<version>`, `Version of the release.`);
|
|
20
|
+
this.command.option(`--note <note>`, `Deprecation note`);
|
|
21
|
+
}
|
|
22
|
+
handler() {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
if (!this.args.note) {
|
|
25
|
+
throw new Error(`Provide a message with option "--note".`);
|
|
26
|
+
}
|
|
27
|
+
yield this.getRegistry().deprecate(this.args.package, this.args.version, {
|
|
28
|
+
deprecate_note: this.args.note
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.Deprecate = Deprecate;
|
|
@@ -0,0 +1,48 @@
|
|
|
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.DistTag = void 0;
|
|
13
|
+
const AbstractCommand_1 = require("../AbstractCommand");
|
|
14
|
+
class DistTag extends AbstractCommand_1.AbstractCommand {
|
|
15
|
+
init() {
|
|
16
|
+
this.registerOpts.requiresRegistry = true;
|
|
17
|
+
if (this.name.includes('add')) {
|
|
18
|
+
this.command.description(`Tag a release.`);
|
|
19
|
+
this.command.argument(`<package>`, `Name of the package.`);
|
|
20
|
+
this.command.argument(`<version>`, `Release version of the package.`);
|
|
21
|
+
this.command.argument(`<tag>`, `Tag to assign to release.`);
|
|
22
|
+
}
|
|
23
|
+
else if (this.name.includes('rm')) {
|
|
24
|
+
this.command.description(`Remove tag from a release.`);
|
|
25
|
+
this.command.argument(`<package>`, `Name of the package.`);
|
|
26
|
+
this.command.argument(`<tag>`, `Tag to remove.`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
handler() {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
if (this.args.add && this.args.add.trim().toLowerCase() === 'add') {
|
|
32
|
+
yield this.getRegistry().addDistTag(this.args.package, {
|
|
33
|
+
version: this.args.version,
|
|
34
|
+
tag: this.args.tag
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
else if (this.args.rm && this.args.rm.trim().toLowerCase() === 'rm') {
|
|
38
|
+
yield this.getRegistry().rmDistTag(this.args.package, {
|
|
39
|
+
tag: this.args.tag
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
throw new Error(`Unknown command.`);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.DistTag = DistTag;
|
|
@@ -0,0 +1,42 @@
|
|
|
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.FindDependencies = void 0;
|
|
13
|
+
const trm_commons_1 = require("trm-commons");
|
|
14
|
+
const trm_core_1 = require("trm-core");
|
|
15
|
+
const AbstractCommand_1 = require("../AbstractCommand");
|
|
16
|
+
class FindDependencies extends AbstractCommand_1.AbstractCommand {
|
|
17
|
+
init() {
|
|
18
|
+
this.registerOpts.requiresConnection = true;
|
|
19
|
+
this.command.description(`Find SAP package dependencies with custom packages/trm packages/SAP entries/objects.`);
|
|
20
|
+
this.command.argument(`<sap package>`, `Name of the SAP package to check.`);
|
|
21
|
+
this.command.option(`--sap-entries`, `Show list of required SAP entries/objects.`, false);
|
|
22
|
+
this.command.option(`--no-prompts`, `No prompts (will force some decisions).`, false);
|
|
23
|
+
}
|
|
24
|
+
handler() {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
trm_commons_1.Logger.loading(`Searching for dependencies in package "${this.args.sapPackage}"...`);
|
|
27
|
+
yield (0, trm_core_1.findDependencies)({
|
|
28
|
+
contextData: {
|
|
29
|
+
noInquirer: this.args.noPrompts
|
|
30
|
+
},
|
|
31
|
+
packageData: {
|
|
32
|
+
package: this.args.sapPackage
|
|
33
|
+
},
|
|
34
|
+
printOptions: {
|
|
35
|
+
trmDependencies: true,
|
|
36
|
+
sapObjectDependencies: this.args.sapEntries
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.FindDependencies = FindDependencies;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TrmPackage } from "trm-core";
|
|
2
|
+
import { AbstractCommand } from "../AbstractCommand";
|
|
3
|
+
export declare class Info extends AbstractCommand {
|
|
4
|
+
protected init(): void;
|
|
5
|
+
protected onTrmDepMissing(dependency: string): boolean;
|
|
6
|
+
protected onTrmDepVersionNotSatisfied(trmPackage: TrmPackage): boolean;
|
|
7
|
+
private getDependencyVersion;
|
|
8
|
+
private getNodeRfcVersion;
|
|
9
|
+
private getNpmLatestForText;
|
|
10
|
+
protected handler(): Promise<void>;
|
|
11
|
+
}
|