trm-client 9.4.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.txt +12 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +78 -0
- package/dist/command/AbstractCommand.d.ts +9 -4
- package/dist/command/AbstractCommand.js +82 -34
- package/dist/command/implementations/Alias.d.ts +2 -1
- package/dist/command/implementations/Alias.js +44 -13
- package/dist/command/implementations/Cg3y.d.ts +2 -1
- package/dist/command/implementations/Cg3y.js +18 -7
- package/dist/command/implementations/Cg3z.d.ts +2 -1
- package/dist/command/implementations/Cg3z.js +18 -7
- package/dist/command/implementations/ClearCache.d.ts +2 -1
- package/dist/command/implementations/ClearCache.js +11 -3
- package/dist/command/implementations/Compare.d.ts +2 -1
- package/dist/command/implementations/Compare.js +20 -7
- package/dist/command/implementations/Content.d.ts +2 -1
- package/dist/command/implementations/Content.js +21 -9
- package/dist/command/implementations/Deprecate.d.ts +2 -1
- package/dist/command/implementations/Deprecate.js +19 -7
- package/dist/command/implementations/Dirty.d.ts +2 -1
- package/dist/command/implementations/Dirty.js +21 -8
- package/dist/command/implementations/DistTag.d.ts +2 -1
- package/dist/command/implementations/DistTag.js +38 -14
- package/dist/command/implementations/FindDependencies.d.ts +2 -1
- package/dist/command/implementations/FindDependencies.js +20 -8
- package/dist/command/implementations/Info.d.ts +2 -1
- package/dist/command/implementations/Info.js +16 -6
- package/dist/command/implementations/Install.d.ts +4 -1
- package/dist/command/implementations/Install.js +118 -43
- package/dist/command/implementations/List.d.ts +2 -1
- package/dist/command/implementations/List.js +19 -6
- package/dist/command/implementations/Lock.d.ts +2 -1
- package/dist/command/implementations/Lock.js +21 -8
- package/dist/command/implementations/Login.d.ts +2 -1
- package/dist/command/implementations/Login.js +26 -8
- package/dist/command/implementations/Logout.d.ts +2 -1
- package/dist/command/implementations/Logout.js +17 -7
- package/dist/command/implementations/Ping.d.ts +2 -1
- package/dist/command/implementations/Ping.js +15 -5
- package/dist/command/implementations/Publish.d.ts +3 -1
- package/dist/command/implementations/Publish.js +70 -40
- package/dist/command/implementations/Registry.d.ts +2 -1
- package/dist/command/implementations/Registry.js +39 -12
- package/dist/command/implementations/Settings.d.ts +2 -1
- package/dist/command/implementations/Settings.js +18 -6
- package/dist/command/implementations/Unpublish.d.ts +2 -1
- package/dist/command/implementations/Unpublish.js +17 -6
- package/dist/command/implementations/View.d.ts +2 -1
- package/dist/command/implementations/View.js +22 -11
- package/dist/command/implementations/WhoAmI.d.ts +2 -1
- package/dist/command/implementations/WhoAmI.js +17 -7
- package/dist/command/implementations/index.d.ts +27 -0
- package/dist/command/implementations/index.js +65 -0
- package/dist/command/index.d.ts +2 -0
- package/dist/command/index.js +2 -0
- package/dist/command/metadata/CommandMetadata.d.ts +55 -0
- package/dist/command/metadata/CommandMetadata.js +2 -0
- package/dist/command/metadata/applyCommandMetadata.d.ts +3 -0
- package/dist/command/metadata/applyCommandMetadata.js +26 -0
- package/dist/command/metadata/helpers.d.ts +5 -0
- package/dist/command/metadata/helpers.js +42 -0
- package/dist/command/metadata/index.d.ts +3 -0
- package/dist/command/metadata/index.js +19 -0
- package/dist/command/runCommandHandler.d.ts +2 -0
- package/dist/command/runCommandHandler.js +24 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +19 -75
- package/dist/utils/GlobalContext.d.ts +3 -1
- package/dist/utils/GlobalContext.js +28 -20
- package/dist/utils/SettingsData.d.ts +4 -0
- package/package.json +5 -6
package/changelog.txt
CHANGED
|
@@ -8,6 +8,18 @@ Legend
|
|
|
8
8
|
+ : added
|
|
9
9
|
- : removed
|
|
10
10
|
|
|
11
|
+
2026-07-06 v10.0.0
|
|
12
|
+
-------------------
|
|
13
|
+
+ expose commands metadata
|
|
14
|
+
! format commands descriptions and longtexts
|
|
15
|
+
- execa dependency
|
|
16
|
+
- support for dockerized trm
|
|
17
|
+
* cache management
|
|
18
|
+
|
|
19
|
+
2026-07-02 v9.4.1
|
|
20
|
+
-------------------
|
|
21
|
+
+ expose exports
|
|
22
|
+
|
|
11
23
|
2026-06-15 v9.4.0
|
|
12
24
|
-------------------
|
|
13
25
|
! trm-core ^9.8.0
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
8
|
+
const commander_1 = require("commander");
|
|
9
|
+
const utils_1 = require("./utils");
|
|
10
|
+
const implementations_1 = require("./command/implementations");
|
|
11
|
+
const trm_core_1 = require("trm-core");
|
|
12
|
+
dotenv_1.default.config({
|
|
13
|
+
quiet: true
|
|
14
|
+
});
|
|
15
|
+
const program = new commander_1.Command();
|
|
16
|
+
program
|
|
17
|
+
.name(`trm`)
|
|
18
|
+
.description(`${trm_core_1.Transport.getTransportIcon()} TRM - Transport Request Manager CLI
|
|
19
|
+
|
|
20
|
+
Full documentation available at https://docs.trmregistry.com/
|
|
21
|
+
Public registry at https://trmregistry.com/
|
|
22
|
+
|
|
23
|
+
© 2023 RegestaItalia https://regestaitalia.eu/`)
|
|
24
|
+
.version(process.env.DEVELOPMENT && process.env.DEVELOPMENT.toLowerCase().trim() === 'true' ? 'Development' : (0, utils_1.getClientVersion)());
|
|
25
|
+
program.configureHelp({
|
|
26
|
+
sortSubcommands: true,
|
|
27
|
+
visibleCommands: (cmd) => {
|
|
28
|
+
var commands = [];
|
|
29
|
+
cmd.commands.forEach(c => {
|
|
30
|
+
if (c.description()) {
|
|
31
|
+
commands.push(c);
|
|
32
|
+
}
|
|
33
|
+
c.commands.forEach(s => {
|
|
34
|
+
commands.push(s);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
return commands;
|
|
38
|
+
},
|
|
39
|
+
subcommandTerm: (cmd) => {
|
|
40
|
+
var term = `${cmd.name()} ${cmd.usage()}`;
|
|
41
|
+
if (cmd.parent.name() !== program.name()) {
|
|
42
|
+
term = `${cmd.parent.name()} ${cmd.name()} ${cmd.usage()}`;
|
|
43
|
+
}
|
|
44
|
+
return term;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
new implementations_1.Ping(program, 'ping').register();
|
|
48
|
+
new implementations_1.Info(program, 'info').register();
|
|
49
|
+
new implementations_1.Registry(program, 'registry', null, 'add').register();
|
|
50
|
+
new implementations_1.Registry(program, 'registry', null, 'rm').register();
|
|
51
|
+
new implementations_1.Login(program, 'login').register();
|
|
52
|
+
new implementations_1.WhoAmI(program, 'whoami').register();
|
|
53
|
+
new implementations_1.Logout(program, 'logout').register();
|
|
54
|
+
new implementations_1.Alias(program, 'alias').register();
|
|
55
|
+
new implementations_1.Alias(program, 'alias', null, 'create').register();
|
|
56
|
+
new implementations_1.Alias(program, 'alias', null, 'delete').register();
|
|
57
|
+
new implementations_1.Publish(program, 'publish').register();
|
|
58
|
+
new implementations_1.DistTag(program, 'dist-tag', null, 'add').register();
|
|
59
|
+
new implementations_1.DistTag(program, 'dist-tag', null, 'rm').register();
|
|
60
|
+
new implementations_1.Publish(program, 'pack', ['export']).register();
|
|
61
|
+
new implementations_1.Lock(program, 'lock', ['lock-file']).register();
|
|
62
|
+
new implementations_1.Unpublish(program, 'unpublish').register();
|
|
63
|
+
new implementations_1.Deprecate(program, 'deprecate').register();
|
|
64
|
+
new implementations_1.Install(program, 'install', ['i']).register();
|
|
65
|
+
new implementations_1.Install(program, 'clean-install', ['ci']).register();
|
|
66
|
+
new implementations_1.Install(program, 'update').register();
|
|
67
|
+
new implementations_1.Install(program, 'import').register();
|
|
68
|
+
new implementations_1.List(program, 'list', ['ls']).register();
|
|
69
|
+
new implementations_1.Content(program, 'content', ['contents']).register();
|
|
70
|
+
new implementations_1.View(program, 'view').register();
|
|
71
|
+
new implementations_1.Compare(program, 'compare').register();
|
|
72
|
+
new implementations_1.Dirty(program, 'dirty').register();
|
|
73
|
+
new implementations_1.FindDependencies(program, 'find-dependencies').register();
|
|
74
|
+
new implementations_1.Cg3y(program, 'cg3y').register();
|
|
75
|
+
new implementations_1.Cg3z(program, 'cg3z').register();
|
|
76
|
+
new implementations_1.Settings(program, 'settings').register();
|
|
77
|
+
new implementations_1.ClearCache(program, 'clear-cache').register();
|
|
78
|
+
program.parse(process.argv);
|
|
@@ -4,19 +4,22 @@ import { CliVersionStatus } from "../utils";
|
|
|
4
4
|
import * as Core from "trm-core";
|
|
5
5
|
import { Package } from "trm-registry-types";
|
|
6
6
|
export declare abstract class AbstractCommand {
|
|
7
|
-
protected readonly name: string;
|
|
8
|
-
protected readonly aliases?: string[];
|
|
9
|
-
protected readonly subcommand?: string;
|
|
10
7
|
protected command: Command;
|
|
11
8
|
protected registerOpts: RegisterCommandOpts;
|
|
12
9
|
protected args: any;
|
|
10
|
+
protected readonly name: string;
|
|
11
|
+
protected readonly aliases?: string[];
|
|
12
|
+
protected readonly subcommand?: string;
|
|
13
13
|
private cliVersionStatus;
|
|
14
14
|
private registry;
|
|
15
15
|
private registryAuthData;
|
|
16
16
|
private registryAuthFailed;
|
|
17
17
|
private systemPackages;
|
|
18
18
|
private trmDependenciesCheck;
|
|
19
|
+
private metadata;
|
|
19
20
|
constructor(program: Command, name: string, aliases?: string[], subcommand?: string);
|
|
21
|
+
constructor(name: string, aliases?: string[], subcommand?: string);
|
|
22
|
+
private getMetadata;
|
|
20
23
|
getCliVersionStatus(): Promise<CliVersionStatus>;
|
|
21
24
|
getRegistry(): Core.AbstractRegistry;
|
|
22
25
|
hasRegistryAuthData(): boolean;
|
|
@@ -25,11 +28,11 @@ export declare abstract class AbstractCommand {
|
|
|
25
28
|
viewRegistryPackage(packageName: string, print?: boolean): Promise<Package>;
|
|
26
29
|
getSystemPackages(): Promise<Core.TrmPackage[]>;
|
|
27
30
|
getTrmDependenciesCheck(): Promise<Core.CheckTrmDependencies>;
|
|
28
|
-
protected abstract init(): void;
|
|
29
31
|
protected abstract handler(): Promise<void>;
|
|
30
32
|
register(): void;
|
|
31
33
|
private getLogger;
|
|
32
34
|
private getInquirer;
|
|
35
|
+
private normalizeArgs;
|
|
33
36
|
private parseCommandArgs;
|
|
34
37
|
validateOutputFileArg(argValue: string): void;
|
|
35
38
|
validateInputFileArg(argValue: string): void;
|
|
@@ -41,5 +44,7 @@ export declare abstract class AbstractCommand {
|
|
|
41
44
|
parseJsonArg(name: string): any;
|
|
42
45
|
parseArrayArg(name: string): string[];
|
|
43
46
|
parseNumberArg(name: string): number;
|
|
47
|
+
run(args?: any): Promise<void>;
|
|
44
48
|
private execute;
|
|
49
|
+
private executePrepared;
|
|
45
50
|
}
|
|
@@ -59,33 +59,48 @@ const fs_1 = require("fs");
|
|
|
59
59
|
const path_1 = require("path");
|
|
60
60
|
const constants_1 = __importDefault(require("constants"));
|
|
61
61
|
const sanitize_filename_1 = __importDefault(require("sanitize-filename"));
|
|
62
|
+
const applyCommandMetadata_1 = require("./metadata/applyCommandMetadata");
|
|
62
63
|
class AbstractCommand {
|
|
63
|
-
constructor(
|
|
64
|
-
this.name = name;
|
|
65
|
-
this.aliases = aliases;
|
|
66
|
-
this.subcommand = subcommand;
|
|
64
|
+
constructor(programOrName, nameOrAliases, aliasesOrSubcommand, subcommandArg) {
|
|
67
65
|
this.registerOpts = {};
|
|
68
66
|
this.args = {};
|
|
69
67
|
this.registryAuthData = false;
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
const program = typeof programOrName === "string" ? undefined : programOrName;
|
|
69
|
+
this.name = typeof programOrName === "string" ? programOrName : nameOrAliases;
|
|
70
|
+
this.aliases = typeof programOrName === "string" ? nameOrAliases : aliasesOrSubcommand;
|
|
71
|
+
this.subcommand = typeof programOrName === "string" ? aliasesOrSubcommand : subcommandArg;
|
|
72
|
+
this.metadata = this.getMetadata();
|
|
73
|
+
if (this.metadata) {
|
|
74
|
+
this.registerOpts = Object.assign({}, this.metadata.requirements);
|
|
75
|
+
}
|
|
76
|
+
if (program) {
|
|
77
|
+
const index = program.commands.findIndex(c => c.name() === this.name);
|
|
78
|
+
if (index >= 0) {
|
|
79
|
+
if (this.subcommand) {
|
|
80
|
+
this.command = program.commands[index];
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
throw new Error(`Command "${this.name}" declared multiple times without subcommand.`);
|
|
84
|
+
}
|
|
74
85
|
}
|
|
75
86
|
else {
|
|
76
|
-
|
|
87
|
+
this.command = program.command(this.name);
|
|
88
|
+
}
|
|
89
|
+
if (this.subcommand) {
|
|
90
|
+
this.command = this.command.command(this.subcommand);
|
|
91
|
+
}
|
|
92
|
+
if (this.aliases) {
|
|
93
|
+
this.command.aliases(this.aliases);
|
|
94
|
+
}
|
|
95
|
+
if (this.metadata) {
|
|
96
|
+
(0, applyCommandMetadata_1.applyCommandMetadata)(this.command, this.metadata);
|
|
77
97
|
}
|
|
78
98
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
if (aliases) {
|
|
86
|
-
this.command.aliases(aliases);
|
|
87
|
-
}
|
|
88
|
-
this.init();
|
|
99
|
+
}
|
|
100
|
+
getMetadata() {
|
|
101
|
+
const metadata = this.constructor.metadata;
|
|
102
|
+
const entries = Array.isArray(metadata) ? metadata : metadata ? [metadata] : [];
|
|
103
|
+
return entries.find(entry => entry.command === this.name && entry.subcommand === this.subcommand);
|
|
89
104
|
}
|
|
90
105
|
getCliVersionStatus() {
|
|
91
106
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -171,6 +186,9 @@ class AbstractCommand {
|
|
|
171
186
|
});
|
|
172
187
|
}
|
|
173
188
|
register() {
|
|
189
|
+
if (!this.command) {
|
|
190
|
+
throw new Error(`Command "${this.name}" cannot be registered without a Commander program.`);
|
|
191
|
+
}
|
|
174
192
|
const defaultLogger = utils_1.GlobalContext.getInstance().getSettings().loggerType;
|
|
175
193
|
const logOutputFolder = utils_1.GlobalContext.getInstance().getSettings().logOutputFolder;
|
|
176
194
|
this.command
|
|
@@ -227,22 +245,38 @@ class AbstractCommand {
|
|
|
227
245
|
default: throw new Error(`Unknown inquirer type "${type}". Possible values are ${Object.keys(InquirerType_1.InquirerType).map(k => InquirerType_1.InquirerType[k]).join(', ')}.`);
|
|
228
246
|
}
|
|
229
247
|
}
|
|
248
|
+
normalizeArgs(args = {}) {
|
|
249
|
+
const defaultLogger = utils_1.GlobalContext.getInstance().getSettings().loggerType;
|
|
250
|
+
const logOutputFolder = utils_1.GlobalContext.getInstance().getSettings().logOutputFolder;
|
|
251
|
+
const normalized = {
|
|
252
|
+
logger: defaultLogger,
|
|
253
|
+
loggerOutDir: logOutputFolder,
|
|
254
|
+
debug: false
|
|
255
|
+
};
|
|
256
|
+
if (this.metadata) {
|
|
257
|
+
[...this.metadata.arguments, ...this.metadata.options].forEach(field => {
|
|
258
|
+
if (field.defaultValue !== undefined) {
|
|
259
|
+
normalized[field.name] = field.defaultValue;
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
const providedArgs = Object.entries(args).reduce((acc, [key, value]) => {
|
|
264
|
+
const newKey = key.replace(/[ -](\w)/g, (_, char) => char.toUpperCase());
|
|
265
|
+
acc[newKey] = value;
|
|
266
|
+
return acc;
|
|
267
|
+
}, {});
|
|
268
|
+
return Object.assign(Object.assign({}, normalized), providedArgs);
|
|
269
|
+
}
|
|
230
270
|
parseCommandArgs(argsValues) {
|
|
231
271
|
var args = {};
|
|
232
|
-
const commandOpts = this.command
|
|
233
|
-
const commandArgs = this.
|
|
272
|
+
const commandOpts = this.command ? this.command.opts() : {};
|
|
273
|
+
const commandArgs = this.metadata ? [...this.metadata.arguments].sort((a, b) => a.position - b.position) : [];
|
|
234
274
|
commandArgs.forEach((a, i) => {
|
|
235
275
|
if (typeof (argsValues[i]) === 'string') {
|
|
236
|
-
args[a.name
|
|
276
|
+
args[a.name] = argsValues[i];
|
|
237
277
|
}
|
|
238
278
|
});
|
|
239
|
-
|
|
240
|
-
args = Object.entries(args).reduce((acc, [key, value]) => {
|
|
241
|
-
const newKey = key.includes(" ") ? key.replace(/ (\w)/g, (_, char) => char.toUpperCase()) : key;
|
|
242
|
-
acc[newKey] = value;
|
|
243
|
-
return acc;
|
|
244
|
-
}, {});
|
|
245
|
-
return args;
|
|
279
|
+
return this.normalizeArgs(Object.assign(Object.assign({}, commandOpts), args));
|
|
246
280
|
}
|
|
247
281
|
validateOutputFileArg(argValue) {
|
|
248
282
|
const resolvedPath = (0, path_1.resolve)(argValue);
|
|
@@ -366,11 +400,23 @@ class AbstractCommand {
|
|
|
366
400
|
catch (_a) { }
|
|
367
401
|
}
|
|
368
402
|
}
|
|
403
|
+
run() {
|
|
404
|
+
return __awaiter(this, arguments, void 0, function* (args = {}) {
|
|
405
|
+
this.args = this.normalizeArgs(args);
|
|
406
|
+
this.onArgs();
|
|
407
|
+
yield this.executePrepared(false);
|
|
408
|
+
});
|
|
409
|
+
}
|
|
369
410
|
execute(...args) {
|
|
370
411
|
return __awaiter(this, void 0, void 0, function* () {
|
|
371
412
|
this.args = this.parseCommandArgs(args);
|
|
372
413
|
this.onArgs();
|
|
373
|
-
|
|
414
|
+
const exitCode = yield this.executePrepared(true);
|
|
415
|
+
process.exit(exitCode);
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
executePrepared(logErrors) {
|
|
419
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
374
420
|
try {
|
|
375
421
|
yield utils_1.GlobalContext.getInstance().load();
|
|
376
422
|
yield Commons.Plugin.call("client", "loadCore", { core: Core });
|
|
@@ -457,11 +503,14 @@ class AbstractCommand {
|
|
|
457
503
|
if (Commons.Logger.logger instanceof Commons.CliLogger || Commons.Logger.logger instanceof Commons.CliLogFileLogger) {
|
|
458
504
|
Commons.Logger.logger.forceStop();
|
|
459
505
|
}
|
|
460
|
-
|
|
506
|
+
return 0;
|
|
461
507
|
}
|
|
462
508
|
catch (e) {
|
|
463
|
-
|
|
464
|
-
|
|
509
|
+
if (logErrors) {
|
|
510
|
+
yield (0, utils_1.logError)(e);
|
|
511
|
+
return 1;
|
|
512
|
+
}
|
|
513
|
+
throw e;
|
|
465
514
|
}
|
|
466
515
|
finally {
|
|
467
516
|
if (Core.SystemConnector.systemConnector) {
|
|
@@ -478,7 +527,6 @@ class AbstractCommand {
|
|
|
478
527
|
const logFilePath = Commons.Logger.logger.getFilePath();
|
|
479
528
|
Commons.Logger.info(`Saved log output "${logFilePath}" for session ID ${sessionId}.`);
|
|
480
529
|
}
|
|
481
|
-
process.exit(exitCode);
|
|
482
530
|
}
|
|
483
531
|
});
|
|
484
532
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AbstractCommand } from "../AbstractCommand";
|
|
2
|
+
import { CommandMetadata } from "../metadata/CommandMetadata";
|
|
2
3
|
export declare class Alias extends AbstractCommand {
|
|
3
|
-
|
|
4
|
+
static readonly metadata: CommandMetadata[];
|
|
4
5
|
private view;
|
|
5
6
|
private check;
|
|
6
7
|
private edit;
|
|
@@ -15,20 +15,8 @@ const AbstractCommand_1 = require("../AbstractCommand");
|
|
|
15
15
|
const prompts_1 = require("../prompts");
|
|
16
16
|
const systemAlias_1 = require("../../systemAlias");
|
|
17
17
|
const utils_1 = require("../../utils");
|
|
18
|
+
const helpers_1 = require("../metadata/helpers");
|
|
18
19
|
class Alias extends AbstractCommand_1.AbstractCommand {
|
|
19
|
-
init() {
|
|
20
|
-
if (this.subcommand === 'create') {
|
|
21
|
-
this.command.description(`Create a new system alias.`);
|
|
22
|
-
this.command.argument(`<alias>`, `Alias name.`);
|
|
23
|
-
}
|
|
24
|
-
else if (this.subcommand === 'delete') {
|
|
25
|
-
this.command.description(`Delete a system alias.`);
|
|
26
|
-
this.command.argument(`<alias>`, `Alias name.`);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
this.command.description(`Manage system aliases.`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
20
|
view(alias) {
|
|
33
21
|
const connection = utils_1.GlobalContext.getInstance().getConnections().find(o => o.name === alias.type);
|
|
34
22
|
if (!connection) {
|
|
@@ -170,3 +158,46 @@ class Alias extends AbstractCommand_1.AbstractCommand {
|
|
|
170
158
|
}
|
|
171
159
|
}
|
|
172
160
|
exports.Alias = Alias;
|
|
161
|
+
Alias.metadata = [
|
|
162
|
+
{
|
|
163
|
+
id: "alias",
|
|
164
|
+
command: "alias",
|
|
165
|
+
title: "Manage aliases",
|
|
166
|
+
group: "system",
|
|
167
|
+
description: "Create, view, edit, check, or delete system aliases.",
|
|
168
|
+
icon: "Network",
|
|
169
|
+
arguments: [],
|
|
170
|
+
options: [],
|
|
171
|
+
requirements: {}
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: "alias:create",
|
|
175
|
+
command: "alias",
|
|
176
|
+
subcommand: "create",
|
|
177
|
+
title: "Create alias",
|
|
178
|
+
group: "system",
|
|
179
|
+
guiRelevant: false,
|
|
180
|
+
description: "Create a system alias.",
|
|
181
|
+
icon: "Network",
|
|
182
|
+
arguments: [
|
|
183
|
+
(0, helpers_1.argument)(0, { name: "alias", label: "Alias", description: "Name of the system alias." })
|
|
184
|
+
],
|
|
185
|
+
options: [],
|
|
186
|
+
requirements: {}
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
id: "alias:delete",
|
|
190
|
+
command: "alias",
|
|
191
|
+
subcommand: "delete",
|
|
192
|
+
title: "Delete alias",
|
|
193
|
+
group: "system",
|
|
194
|
+
guiRelevant: false,
|
|
195
|
+
description: "Delete a system alias.",
|
|
196
|
+
icon: "Network",
|
|
197
|
+
arguments: [
|
|
198
|
+
(0, helpers_1.argument)(0, { name: "alias", label: "Alias", description: "Name of the system alias." })
|
|
199
|
+
],
|
|
200
|
+
options: [],
|
|
201
|
+
requirements: {}
|
|
202
|
+
}
|
|
203
|
+
];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbstractCommand } from "../AbstractCommand";
|
|
2
|
+
import { CommandMetadata } from "../metadata/CommandMetadata";
|
|
2
3
|
export declare class Cg3y extends AbstractCommand {
|
|
3
|
-
|
|
4
|
+
static readonly metadata: CommandMetadata;
|
|
4
5
|
protected handler(): Promise<void>;
|
|
5
6
|
}
|
|
@@ -19,14 +19,8 @@ const trm_core_1 = require("trm-core");
|
|
|
19
19
|
const trm_commons_1 = require("trm-commons");
|
|
20
20
|
const promises_1 = require("fs/promises");
|
|
21
21
|
const sanitize_filename_1 = __importDefault(require("sanitize-filename"));
|
|
22
|
+
const helpers_1 = require("../metadata/helpers");
|
|
22
23
|
class Cg3y extends AbstractCommand_1.AbstractCommand {
|
|
23
|
-
init() {
|
|
24
|
-
this.registerOpts.requiresConnection = true;
|
|
25
|
-
this.registerOpts.requiresTrmDependencies = true;
|
|
26
|
-
this.command.description(`Download any released transport.`);
|
|
27
|
-
this.command.argument(`<transport>`, `Transport number.`);
|
|
28
|
-
this.command.argument(`[filename]`, `Name (or path) of the output file.`);
|
|
29
|
-
}
|
|
30
24
|
handler() {
|
|
31
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
26
|
if (!this.args.filename) {
|
|
@@ -47,3 +41,20 @@ class Cg3y extends AbstractCommand_1.AbstractCommand {
|
|
|
47
41
|
}
|
|
48
42
|
}
|
|
49
43
|
exports.Cg3y = Cg3y;
|
|
44
|
+
Cg3y.metadata = {
|
|
45
|
+
id: "cg3y",
|
|
46
|
+
command: "cg3y",
|
|
47
|
+
title: "Download transport",
|
|
48
|
+
group: "utility",
|
|
49
|
+
description: "Download a released transport from the connected system.",
|
|
50
|
+
icon: "Download",
|
|
51
|
+
arguments: [
|
|
52
|
+
(0, helpers_1.argument)(0, { name: "transport", label: "Transport", description: "Transport request number." }),
|
|
53
|
+
(0, helpers_1.argument)(1, { name: "filename", label: "Output file", description: "Output file name or path.", required: false, control: "file-picker" })
|
|
54
|
+
],
|
|
55
|
+
options: [],
|
|
56
|
+
requirements: {
|
|
57
|
+
requiresConnection: true,
|
|
58
|
+
requiresTrmDependencies: true
|
|
59
|
+
}
|
|
60
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbstractCommand } from "../AbstractCommand";
|
|
2
|
+
import { CommandMetadata } from "../metadata/CommandMetadata";
|
|
2
3
|
export declare class Cg3z extends AbstractCommand {
|
|
3
|
-
|
|
4
|
+
static readonly metadata: CommandMetadata;
|
|
4
5
|
protected handler(): Promise<void>;
|
|
5
6
|
}
|
|
@@ -16,14 +16,8 @@ const trm_core_1 = require("trm-core");
|
|
|
16
16
|
const utils_1 = require("../../utils");
|
|
17
17
|
const promises_1 = require("fs/promises");
|
|
18
18
|
const path_1 = require("path");
|
|
19
|
+
const helpers_1 = require("../metadata/helpers");
|
|
19
20
|
class Cg3z extends AbstractCommand_1.AbstractCommand {
|
|
20
|
-
init() {
|
|
21
|
-
this.registerOpts.requiresConnection = true;
|
|
22
|
-
this.registerOpts.requiresTrmDependencies = true;
|
|
23
|
-
this.registerOpts.requiresR3trans = true;
|
|
24
|
-
this.command.description(`Upload any released transport.`);
|
|
25
|
-
this.command.argument(`<filename>`, `Name (or path) of the file.`);
|
|
26
|
-
}
|
|
27
21
|
handler() {
|
|
28
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
23
|
const extension = (0, path_1.extname)(this.args.filename);
|
|
@@ -58,3 +52,20 @@ class Cg3z extends AbstractCommand_1.AbstractCommand {
|
|
|
58
52
|
}
|
|
59
53
|
}
|
|
60
54
|
exports.Cg3z = Cg3z;
|
|
55
|
+
Cg3z.metadata = {
|
|
56
|
+
id: "cg3z",
|
|
57
|
+
command: "cg3z",
|
|
58
|
+
title: "Upload transport",
|
|
59
|
+
group: "utility",
|
|
60
|
+
description: "Upload a released transport archive to the connected system.",
|
|
61
|
+
icon: "Upload",
|
|
62
|
+
arguments: [
|
|
63
|
+
(0, helpers_1.argument)(0, { name: "filename", label: "Transport archive", description: "Transport archive file name or path.", control: "file-picker" })
|
|
64
|
+
],
|
|
65
|
+
options: [],
|
|
66
|
+
requirements: {
|
|
67
|
+
requiresConnection: true,
|
|
68
|
+
requiresTrmDependencies: true,
|
|
69
|
+
requiresR3trans: true
|
|
70
|
+
}
|
|
71
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbstractCommand } from "../AbstractCommand";
|
|
2
|
+
import { CommandMetadata } from "../metadata/CommandMetadata";
|
|
2
3
|
export declare class ClearCache extends AbstractCommand {
|
|
3
|
-
|
|
4
|
+
static readonly metadata: CommandMetadata;
|
|
4
5
|
protected handler(): Promise<void>;
|
|
5
6
|
}
|
|
@@ -14,9 +14,6 @@ const AbstractCommand_1 = require("../AbstractCommand");
|
|
|
14
14
|
const trm_commons_1 = require("trm-commons");
|
|
15
15
|
const utils_1 = require("../../utils");
|
|
16
16
|
class ClearCache extends AbstractCommand_1.AbstractCommand {
|
|
17
|
-
init() {
|
|
18
|
-
this.command.description(`Clear client cache.`);
|
|
19
|
-
}
|
|
20
17
|
handler() {
|
|
21
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
19
|
utils_1.GlobalContext.getInstance().clearCache();
|
|
@@ -25,3 +22,14 @@ class ClearCache extends AbstractCommand_1.AbstractCommand {
|
|
|
25
22
|
}
|
|
26
23
|
}
|
|
27
24
|
exports.ClearCache = ClearCache;
|
|
25
|
+
ClearCache.metadata = {
|
|
26
|
+
id: "clear-cache",
|
|
27
|
+
command: "clear-cache",
|
|
28
|
+
title: "Clear cache",
|
|
29
|
+
group: "utility",
|
|
30
|
+
description: "Clear the client cache.",
|
|
31
|
+
icon: "Trash2",
|
|
32
|
+
arguments: [],
|
|
33
|
+
options: [],
|
|
34
|
+
requirements: {}
|
|
35
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AbstractCommand } from "../AbstractCommand";
|
|
2
|
+
import { CommandMetadata } from "../metadata/CommandMetadata";
|
|
2
3
|
export declare class Compare extends AbstractCommand {
|
|
4
|
+
static readonly metadata: CommandMetadata;
|
|
3
5
|
private connections;
|
|
4
|
-
protected init(): void;
|
|
5
6
|
private promptConnections;
|
|
6
7
|
protected handler(): Promise<void>;
|
|
7
8
|
}
|
|
@@ -15,18 +15,12 @@ const trm_core_1 = require("trm-core");
|
|
|
15
15
|
const AbstractCommand_1 = require("../AbstractCommand");
|
|
16
16
|
const systemAlias_1 = require("../../systemAlias");
|
|
17
17
|
const prompts_1 = require("../prompts");
|
|
18
|
+
const helpers_1 = require("../metadata/helpers");
|
|
18
19
|
class Compare extends AbstractCommand_1.AbstractCommand {
|
|
19
20
|
constructor() {
|
|
20
21
|
super(...arguments);
|
|
21
22
|
this.connections = [];
|
|
22
23
|
}
|
|
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
24
|
promptConnections() {
|
|
31
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
26
|
if (this.connections.length > 0) {
|
|
@@ -131,3 +125,22 @@ class Compare extends AbstractCommand_1.AbstractCommand {
|
|
|
131
125
|
}
|
|
132
126
|
}
|
|
133
127
|
exports.Compare = Compare;
|
|
128
|
+
Compare.metadata = {
|
|
129
|
+
id: "compare",
|
|
130
|
+
command: "compare",
|
|
131
|
+
title: "Compare package",
|
|
132
|
+
group: "package",
|
|
133
|
+
guiRelevant: false,
|
|
134
|
+
description: "Compare a package across multiple systems.",
|
|
135
|
+
icon: "GitCompare",
|
|
136
|
+
arguments: [
|
|
137
|
+
(0, helpers_1.argument)(0, { name: "package", label: "Package", description: "Package name." })
|
|
138
|
+
],
|
|
139
|
+
options: [
|
|
140
|
+
(0, helpers_1.option)("-c, --connections <json>", { name: "connections", label: "Connections", description: "System connection aliases as JSON, or a path to a JSON file.", control: "textarea" })
|
|
141
|
+
],
|
|
142
|
+
requirements: {
|
|
143
|
+
requiresRegistry: true,
|
|
144
|
+
ignoreRegistryUnreachable: true
|
|
145
|
+
}
|
|
146
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbstractCommand } from "../AbstractCommand";
|
|
2
|
+
import { CommandMetadata } from "../metadata/CommandMetadata";
|
|
2
3
|
export declare class Content extends AbstractCommand {
|
|
3
|
-
|
|
4
|
+
static readonly metadata: CommandMetadata;
|
|
4
5
|
protected handler(): Promise<void>;
|
|
5
6
|
}
|
|
@@ -17,16 +17,8 @@ const trm_commons_1 = require("trm-commons");
|
|
|
17
17
|
const AbstractCommand_1 = require("../AbstractCommand");
|
|
18
18
|
const utils_1 = require("../../utils");
|
|
19
19
|
const chalk_1 = __importDefault(require("chalk"));
|
|
20
|
+
const helpers_1 = require("../metadata/helpers");
|
|
20
21
|
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
22
|
handler() {
|
|
31
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
24
|
var transports = {};
|
|
@@ -193,3 +185,23 @@ class Content extends AbstractCommand_1.AbstractCommand {
|
|
|
193
185
|
}
|
|
194
186
|
}
|
|
195
187
|
exports.Content = Content;
|
|
188
|
+
Content.metadata = {
|
|
189
|
+
id: "content",
|
|
190
|
+
command: "content",
|
|
191
|
+
aliases: ["contents"],
|
|
192
|
+
title: "Package content",
|
|
193
|
+
group: "registry",
|
|
194
|
+
description: "View the contents of a package release in registry.",
|
|
195
|
+
icon: "ListTree",
|
|
196
|
+
arguments: [
|
|
197
|
+
(0, helpers_1.argument)(0, { name: "package", label: "Package", description: "Package name." }),
|
|
198
|
+
(0, helpers_1.argument)(1, { name: "version", label: "Version", description: "Package version or distribution tag.", required: false, defaultValue: "latest" })
|
|
199
|
+
],
|
|
200
|
+
options: [
|
|
201
|
+
(0, helpers_1.option)("--full", { name: "full", label: "Full content", description: "Show all transport entries in the package.", control: "checkbox", defaultValue: false })
|
|
202
|
+
],
|
|
203
|
+
requirements: {
|
|
204
|
+
requiresRegistry: true,
|
|
205
|
+
requiresR3trans: true
|
|
206
|
+
}
|
|
207
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbstractCommand } from "../AbstractCommand";
|
|
2
|
+
import { CommandMetadata } from "../metadata/CommandMetadata";
|
|
2
3
|
export declare class Deprecate extends AbstractCommand {
|
|
3
|
-
|
|
4
|
+
static readonly metadata: CommandMetadata;
|
|
4
5
|
protected handler(): Promise<void>;
|
|
5
6
|
}
|