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,237 @@
|
|
|
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.View = void 0;
|
|
16
|
+
const trm_commons_1 = require("trm-commons");
|
|
17
|
+
const trm_core_1 = require("trm-core");
|
|
18
|
+
const AbstractCommand_1 = require("../AbstractCommand");
|
|
19
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
20
|
+
const utils_1 = require("../../utils");
|
|
21
|
+
const semver_1 = require("semver");
|
|
22
|
+
const registryAlias_1 = require("../../registryAlias");
|
|
23
|
+
class View extends AbstractCommand_1.AbstractCommand {
|
|
24
|
+
init() {
|
|
25
|
+
this.registerOpts.requiresConnection = true;
|
|
26
|
+
this.registerOpts.addNoConnection = true;
|
|
27
|
+
this.registerOpts.requiresRegistry = true;
|
|
28
|
+
this.registerOpts.ignoreRegistryUnreachable = true;
|
|
29
|
+
this.command.description(`View package.`);
|
|
30
|
+
this.command.addHelpText(`before`, `Shows package details.
|
|
31
|
+
If the package is not found on the system, it will automatically fall back to the data provided by the registry, granted it exists.`);
|
|
32
|
+
this.command.argument(`<package>`, `Name of the package.`);
|
|
33
|
+
}
|
|
34
|
+
printHeaderSection() {
|
|
35
|
+
trm_commons_1.Logger.info(`Package name: ${chalk_1.default.bold(this.args.package)}`);
|
|
36
|
+
trm_commons_1.Logger.info(`Registry: ${this.getRegistry().name}`);
|
|
37
|
+
}
|
|
38
|
+
printVersionSection(systemPackage, registryView) {
|
|
39
|
+
if (!systemPackage && !registryView) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
var oSystemManifest;
|
|
43
|
+
if (!(trm_core_1.SystemConnector.systemConnector instanceof utils_1.DummyConnector)) {
|
|
44
|
+
console.log('');
|
|
45
|
+
if (systemPackage) {
|
|
46
|
+
oSystemManifest = systemPackage.manifest.get();
|
|
47
|
+
trm_commons_1.Logger.success(`Installed on ${trm_core_1.SystemConnector.getDest()}: Yes`);
|
|
48
|
+
console.log(`Installed version: ${oSystemManifest.version}`);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
trm_commons_1.Logger.error(`Installed on ${trm_core_1.SystemConnector.getDest()}: No`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (registryView) {
|
|
55
|
+
if (registryView.dist_tags['latest']) {
|
|
56
|
+
console.log(`Latest version available: ${registryView.dist_tags['latest']}`);
|
|
57
|
+
if (oSystemManifest) {
|
|
58
|
+
if ((0, semver_1.eq)(oSystemManifest.version, registryView.dist_tags['latest'])) {
|
|
59
|
+
trm_commons_1.Logger.success(`Latest version installed: Yes`);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
trm_commons_1.Logger.error(`Latest version installed: No`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
console.log(`Latest version available: unknown`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
printManifestSection(manifest) {
|
|
72
|
+
console.log('');
|
|
73
|
+
if (manifest.devclass !== undefined) {
|
|
74
|
+
console.log(`SAP Package: ${manifest.devclass}`);
|
|
75
|
+
}
|
|
76
|
+
if (manifest.importTransport !== undefined) {
|
|
77
|
+
console.log(`TRM transport: ${manifest.importTransport}`);
|
|
78
|
+
}
|
|
79
|
+
if (manifest.workbenchTransport !== undefined) {
|
|
80
|
+
console.log(`Landscape transport: ${manifest.workbenchTransport}`);
|
|
81
|
+
}
|
|
82
|
+
if (manifest.private !== undefined) {
|
|
83
|
+
if (manifest.private) {
|
|
84
|
+
console.log(`Private: Yes`);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
console.log(`Private: No`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (manifest.description !== undefined) {
|
|
91
|
+
console.log(`Short description: ${manifest.description}`);
|
|
92
|
+
}
|
|
93
|
+
if (manifest.backwardsCompatible !== undefined) {
|
|
94
|
+
if (manifest.backwardsCompatible) {
|
|
95
|
+
console.log(`Backwards compatible: Yes`);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
console.log(`Backwards compatible: No`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (manifest.website !== undefined) {
|
|
102
|
+
console.log(`Website: ${manifest.website}`);
|
|
103
|
+
}
|
|
104
|
+
if (manifest.git !== undefined) {
|
|
105
|
+
console.log(`Git: ${manifest.git}`);
|
|
106
|
+
}
|
|
107
|
+
if (manifest.authors !== undefined) {
|
|
108
|
+
console.log(`Authors: ${manifest.authors}`);
|
|
109
|
+
}
|
|
110
|
+
if (manifest.license !== undefined) {
|
|
111
|
+
console.log(`License: ${manifest.license}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
printDependenciesSection(dependencies) {
|
|
115
|
+
if (dependencies.length > 0) {
|
|
116
|
+
console.log('');
|
|
117
|
+
trm_commons_1.Logger.info(`This package has a total of ${dependencies.length} dependencies.`);
|
|
118
|
+
const registryAliases = registryAlias_1.RegistryAlias.getAll();
|
|
119
|
+
const tableHead = [`Name`, `Version`, `Registry`];
|
|
120
|
+
var tableData = [];
|
|
121
|
+
dependencies.forEach(o => {
|
|
122
|
+
const dependencyName = o.name;
|
|
123
|
+
const dependencyVersion = o.version;
|
|
124
|
+
var dependencyRegistry;
|
|
125
|
+
if (!o.registry || o.registry.trim().toLowerCase() === trm_core_1.PUBLIC_RESERVED_KEYWORD) {
|
|
126
|
+
dependencyRegistry = trm_core_1.PUBLIC_RESERVED_KEYWORD;
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
const oRegistryAlias = registryAliases.find(k => k.endpointUrl === o.registry);
|
|
130
|
+
if (oRegistryAlias) {
|
|
131
|
+
dependencyRegistry = oRegistryAlias.alias;
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
dependencyRegistry = o.registry;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
tableData.push([
|
|
138
|
+
dependencyName,
|
|
139
|
+
dependencyVersion,
|
|
140
|
+
dependencyRegistry
|
|
141
|
+
]);
|
|
142
|
+
});
|
|
143
|
+
trm_commons_1.Logger.table(tableHead, tableData);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
handler() {
|
|
147
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
148
|
+
const packageName = this.args.package;
|
|
149
|
+
const dest = trm_core_1.SystemConnector.getDest();
|
|
150
|
+
const aSystemPackages = yield this.getSystemPackages();
|
|
151
|
+
trm_commons_1.Logger.loading(`Searching package ${packageName}...`);
|
|
152
|
+
const oSystemView = aSystemPackages.find(o => o.compareName(packageName) && o.compareRegistry(this.getRegistry()));
|
|
153
|
+
const oRegistryView = yield this.viewRegistryPackage(packageName, true);
|
|
154
|
+
var authors;
|
|
155
|
+
var keywords;
|
|
156
|
+
var printManifest;
|
|
157
|
+
var dependencies;
|
|
158
|
+
if (oSystemView) {
|
|
159
|
+
if (!oSystemView.manifest) {
|
|
160
|
+
throw new Error(`Package "${packageName}" found, but manifest is missing on ${dest}!`);
|
|
161
|
+
}
|
|
162
|
+
const oSystemManifest = oSystemView.manifest.get();
|
|
163
|
+
if (Array.isArray(oSystemManifest.authors)) {
|
|
164
|
+
authors = oSystemManifest.authors.map(o => {
|
|
165
|
+
var sAuthor;
|
|
166
|
+
if (o.email) {
|
|
167
|
+
if (o.name) {
|
|
168
|
+
sAuthor = `${o.name} <${o.email}>`;
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
sAuthor = o.email;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
else if (o.name) {
|
|
175
|
+
sAuthor = o.name;
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
return undefined;
|
|
179
|
+
}
|
|
180
|
+
return sAuthor;
|
|
181
|
+
}).join(', ');
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
authors = oSystemManifest.authors;
|
|
185
|
+
}
|
|
186
|
+
if (Array.isArray(oSystemManifest.keywords)) {
|
|
187
|
+
keywords = oSystemManifest.keywords.join(', ');
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
keywords = oSystemManifest.keywords;
|
|
191
|
+
}
|
|
192
|
+
var importTransport;
|
|
193
|
+
var workbenchTransport;
|
|
194
|
+
try {
|
|
195
|
+
importTransport = oSystemView.manifest.getLinkedTransport().trkorr;
|
|
196
|
+
}
|
|
197
|
+
catch (e) { }
|
|
198
|
+
try {
|
|
199
|
+
workbenchTransport = (yield oSystemView.getWbTransport()).trkorr;
|
|
200
|
+
}
|
|
201
|
+
catch (e) { }
|
|
202
|
+
dependencies = oSystemManifest.dependencies || [];
|
|
203
|
+
printManifest = {
|
|
204
|
+
devclass: oSystemView.getDevclass(),
|
|
205
|
+
private: oSystemManifest.private,
|
|
206
|
+
description: oSystemManifest.description,
|
|
207
|
+
git: oSystemManifest.git,
|
|
208
|
+
website: oSystemManifest.website,
|
|
209
|
+
backwardsCompatible: oSystemManifest.backwardsCompatible,
|
|
210
|
+
license: oSystemManifest.license,
|
|
211
|
+
authors,
|
|
212
|
+
keywords,
|
|
213
|
+
importTransport,
|
|
214
|
+
workbenchTransport
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
else if (oRegistryView) {
|
|
218
|
+
dependencies = [];
|
|
219
|
+
printManifest = {
|
|
220
|
+
private: oRegistryView.manifest.private,
|
|
221
|
+
description: oRegistryView.manifest.shortDescription,
|
|
222
|
+
git: oRegistryView.manifest.git,
|
|
223
|
+
website: oRegistryView.manifest.website,
|
|
224
|
+
license: oRegistryView.manifest.license
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
throw new Error(`Package "${packageName}" does not exist or insufficient view permissions.`);
|
|
229
|
+
}
|
|
230
|
+
this.printHeaderSection();
|
|
231
|
+
this.printVersionSection(oSystemView, oRegistryView);
|
|
232
|
+
this.printManifestSection(printManifest);
|
|
233
|
+
this.printDependenciesSection(dependencies);
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
exports.View = View;
|
|
@@ -0,0 +1,36 @@
|
|
|
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.WhoAmI = void 0;
|
|
13
|
+
const trm_commons_1 = require("trm-commons");
|
|
14
|
+
const AbstractCommand_1 = require("../AbstractCommand");
|
|
15
|
+
const trm_registry_types_1 = require("trm-registry-types");
|
|
16
|
+
class WhoAmI extends AbstractCommand_1.AbstractCommand {
|
|
17
|
+
init() {
|
|
18
|
+
this.registerOpts.requiresRegistry = true;
|
|
19
|
+
this.registerOpts.onlyRegistryAlias = true;
|
|
20
|
+
this.registerOpts.registryAuthBlacklist = [trm_registry_types_1.AuthenticationType.NO_AUTH];
|
|
21
|
+
this.command.description(`Get data about a current registry logged user.`);
|
|
22
|
+
this.command.addHelpText(`before`, `This command has no effect when trying to login into a registry that doesn't require authentication.`);
|
|
23
|
+
}
|
|
24
|
+
handler() {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
if (this.hasRegistryAuthData()) {
|
|
27
|
+
yield this.registryWhoAmI();
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
trm_commons_1.Logger.error(`You are not logged in`);
|
|
31
|
+
trm_commons_1.Logger.error(`Run command "trm login" and follow instructions.`);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.WhoAmI = WhoAmI;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from "./Ping";
|
|
2
|
+
export * from "./Info";
|
|
3
|
+
export * from "./Registry";
|
|
4
|
+
export * from "./Login";
|
|
5
|
+
export * from "./WhoAmI";
|
|
6
|
+
export * from "./Logout";
|
|
7
|
+
export * from "./Alias";
|
|
8
|
+
export * from "./Publish";
|
|
9
|
+
export * from "./DistTag";
|
|
10
|
+
export * from "./Lock";
|
|
11
|
+
export * from "./Unpublish";
|
|
12
|
+
export * from "./Deprecate";
|
|
13
|
+
export * from "./Install";
|
|
14
|
+
export * from "./List";
|
|
15
|
+
export * from "./Content";
|
|
16
|
+
export * from "./View";
|
|
17
|
+
export * from "./Compare";
|
|
18
|
+
export * from "./FindDependencies";
|
|
19
|
+
export * from "./Settings";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Ping"), exports);
|
|
18
|
+
__exportStar(require("./Info"), exports);
|
|
19
|
+
__exportStar(require("./Registry"), exports);
|
|
20
|
+
__exportStar(require("./Login"), exports);
|
|
21
|
+
__exportStar(require("./WhoAmI"), exports);
|
|
22
|
+
__exportStar(require("./Logout"), exports);
|
|
23
|
+
__exportStar(require("./Alias"), exports);
|
|
24
|
+
__exportStar(require("./Publish"), exports);
|
|
25
|
+
__exportStar(require("./DistTag"), exports);
|
|
26
|
+
__exportStar(require("./Lock"), exports);
|
|
27
|
+
__exportStar(require("./Unpublish"), exports);
|
|
28
|
+
__exportStar(require("./Deprecate"), exports);
|
|
29
|
+
__exportStar(require("./Install"), exports);
|
|
30
|
+
__exportStar(require("./List"), exports);
|
|
31
|
+
__exportStar(require("./Content"), exports);
|
|
32
|
+
__exportStar(require("./View"), exports);
|
|
33
|
+
__exportStar(require("./Compare"), exports);
|
|
34
|
+
__exportStar(require("./FindDependencies"), exports);
|
|
35
|
+
__exportStar(require("./Settings"), exports);
|
|
@@ -14,5 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./AbstractCommand"), exports);
|
|
18
|
+
__exportStar(require("./InquirerType"), exports);
|
|
19
|
+
__exportStar(require("./LoggerType"), exports);
|
|
20
|
+
__exportStar(require("./RegisterCommandOpts"), exports);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IConnect } from "trm-commons";
|
|
1
2
|
import { ISystemConnector } from "trm-core";
|
|
2
3
|
export type ConnectArguments = {
|
|
3
4
|
type?: string;
|
|
@@ -15,3 +16,4 @@ export type ConnectArguments = {
|
|
|
15
16
|
forwardRfcDest?: string;
|
|
16
17
|
connection?: ISystemConnector;
|
|
17
18
|
};
|
|
19
|
+
export declare function connect(commandArgs: ConnectArguments, createAliasIfNotExist?: boolean, addNoConnection?: boolean): Promise<IConnect>;
|
|
@@ -121,7 +121,7 @@ function connect(commandArgs_1) {
|
|
|
121
121
|
};
|
|
122
122
|
})
|
|
123
123
|
})).alias;
|
|
124
|
-
const connection = utils_1.
|
|
124
|
+
const connection = utils_1.GlobalContext.getInstance().getConnections().find(o => o.name === inq2.type);
|
|
125
125
|
if (!connection) {
|
|
126
126
|
throw new Error(`Unknown connection type "${inq2.type}" in alias "${inq2.name}"`);
|
|
127
127
|
}
|
|
@@ -158,7 +158,7 @@ function connect(commandArgs_1) {
|
|
|
158
158
|
type: `list`,
|
|
159
159
|
name: `type`,
|
|
160
160
|
message: `Connection type`,
|
|
161
|
-
choices: utils_1.
|
|
161
|
+
choices: utils_1.GlobalContext.getInstance().getConnections().map(o => {
|
|
162
162
|
return {
|
|
163
163
|
name: o.description,
|
|
164
164
|
value: o.name
|
|
@@ -166,7 +166,7 @@ function connect(commandArgs_1) {
|
|
|
166
166
|
})
|
|
167
167
|
})).type;
|
|
168
168
|
}
|
|
169
|
-
const connectionType = utils_1.
|
|
169
|
+
const connectionType = utils_1.GlobalContext.getInstance().getConnections().find(o => o.name === type);
|
|
170
170
|
if (!connectionType) {
|
|
171
171
|
throw new Error(`Invalid connection type "${type}"`);
|
|
172
172
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createAlias(alias: string): Promise<void>;
|
|
@@ -10,17 +10,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.createAlias = createAlias;
|
|
13
|
-
const systemAlias_1 = require("../systemAlias");
|
|
14
|
-
const prompts_1 = require("./prompts");
|
|
15
13
|
const trm_commons_1 = require("trm-commons");
|
|
16
|
-
|
|
14
|
+
const systemAlias_1 = require("../../systemAlias");
|
|
15
|
+
const connect_1 = require("./connect");
|
|
16
|
+
function createAlias(alias) {
|
|
17
17
|
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
const connection = yield (0,
|
|
18
|
+
const connection = yield (0, connect_1.connect)({
|
|
19
19
|
noSystemAlias: true,
|
|
20
20
|
force: true
|
|
21
21
|
}, false, false);
|
|
22
|
-
systemAlias_1.SystemAlias.create(
|
|
23
|
-
trm_commons_1.Logger.loading(`Connecting to "${
|
|
22
|
+
systemAlias_1.SystemAlias.create(alias, connection.name, connection.getData());
|
|
23
|
+
trm_commons_1.Logger.loading(`Connecting to "${alias}"...`);
|
|
24
24
|
var connectionSuccess = true;
|
|
25
25
|
try {
|
|
26
26
|
yield connection.getSystemConnector().connect();
|
|
@@ -31,10 +31,10 @@ function createAlias(commandArgs) {
|
|
|
31
31
|
}
|
|
32
32
|
finally {
|
|
33
33
|
if (connectionSuccess) {
|
|
34
|
-
trm_commons_1.Logger.success(`Alias "${
|
|
34
|
+
trm_commons_1.Logger.success(`Alias "${alias}" has been created.`);
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
|
-
systemAlias_1.SystemAlias.delete(
|
|
37
|
+
systemAlias_1.SystemAlias.delete(alias);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function deleteAlias(alias: string): Promise<void>;
|
|
@@ -11,12 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.deleteAlias = deleteAlias;
|
|
13
13
|
const trm_commons_1 = require("trm-commons");
|
|
14
|
-
const systemAlias_1 = require("
|
|
15
|
-
function deleteAlias(
|
|
14
|
+
const systemAlias_1 = require("../../systemAlias");
|
|
15
|
+
function deleteAlias(alias) {
|
|
16
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const alias = commandArgs.alias;
|
|
18
17
|
systemAlias_1.SystemAlias.get(alias);
|
|
19
18
|
systemAlias_1.SystemAlias.delete(alias);
|
|
20
|
-
trm_commons_1.Logger.success(`Alias "${alias}" deleted.`);
|
|
19
|
+
trm_commons_1.Logger.success(`Alias "${alias}" has been deleted.`);
|
|
21
20
|
});
|
|
22
21
|
}
|
|
@@ -16,3 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./connect"), exports);
|
|
18
18
|
__exportStar(require("./pickRegistry"), exports);
|
|
19
|
+
__exportStar(require("./createAlias"), exports);
|
|
20
|
+
__exportStar(require("./deleteAlias"), exports);
|