trm-client 9.4.1 → 10.0.1
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 +19 -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 +45 -13
- package/dist/command/implementations/Cg3y.d.ts +2 -1
- package/dist/command/implementations/Cg3y.js +19 -7
- package/dist/command/implementations/Cg3z.d.ts +2 -1
- package/dist/command/implementations/Cg3z.js +19 -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 +22 -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 +40 -14
- package/dist/command/implementations/FindDependencies.d.ts +2 -1
- package/dist/command/implementations/FindDependencies.js +21 -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 +41 -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 +18 -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 +57 -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 +6 -0
- package/dist/command/metadata/helpers.js +45 -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/utils/GlobalContext.d.ts +3 -1
- package/dist/utils/GlobalContext.js +28 -20
- package/dist/utils/SettingsData.d.ts +4 -0
- package/package.json +4 -5
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbstractCommand } from "../AbstractCommand";
|
|
2
|
+
import { CommandMetadata } from "../metadata/CommandMetadata";
|
|
2
3
|
export declare class DistTag extends AbstractCommand {
|
|
3
|
-
|
|
4
|
+
static readonly metadata: CommandMetadata[];
|
|
4
5
|
protected handler(): Promise<void>;
|
|
5
6
|
}
|
|
@@ -12,21 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.DistTag = void 0;
|
|
13
13
|
const trm_commons_1 = require("trm-commons");
|
|
14
14
|
const AbstractCommand_1 = require("../AbstractCommand");
|
|
15
|
+
const helpers_1 = require("../metadata/helpers");
|
|
15
16
|
class DistTag extends AbstractCommand_1.AbstractCommand {
|
|
16
|
-
init() {
|
|
17
|
-
this.registerOpts.requiresRegistry = true;
|
|
18
|
-
if (this.subcommand === 'add') {
|
|
19
|
-
this.command.description(`Tag a release.`);
|
|
20
|
-
this.command.argument(`<package>`, `Name of the package.`);
|
|
21
|
-
this.command.argument(`<version>`, `Release version of the package.`);
|
|
22
|
-
this.command.argument(`<tag>`, `Tag to assign to release.`);
|
|
23
|
-
}
|
|
24
|
-
else if (this.subcommand === 'rm') {
|
|
25
|
-
this.command.description(`Remove tag from a release.`);
|
|
26
|
-
this.command.argument(`<package>`, `Name of the package.`);
|
|
27
|
-
this.command.argument(`<tag>`, `Tag to remove.`);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
17
|
handler() {
|
|
31
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
19
|
if (this.subcommand === 'add') {
|
|
@@ -46,3 +33,42 @@ class DistTag extends AbstractCommand_1.AbstractCommand {
|
|
|
46
33
|
}
|
|
47
34
|
}
|
|
48
35
|
exports.DistTag = DistTag;
|
|
36
|
+
DistTag.metadata = [
|
|
37
|
+
{
|
|
38
|
+
id: "dist-tag:add",
|
|
39
|
+
command: "dist-tag",
|
|
40
|
+
subcommand: "add",
|
|
41
|
+
title: "Add distribution tag",
|
|
42
|
+
group: "registry",
|
|
43
|
+
groupPriority: 9,
|
|
44
|
+
description: "Add a distribution tag to a package release.",
|
|
45
|
+
icon: "TagPlus",
|
|
46
|
+
arguments: [
|
|
47
|
+
(0, helpers_1.argument)(0, { name: "package", label: "Package", description: "Package name." }),
|
|
48
|
+
(0, helpers_1.argument)(1, { name: "version", label: "Version", description: "Release version." }),
|
|
49
|
+
(0, helpers_1.argument)(2, { name: "tag", label: "Tag", description: "Distribution tag to assign." })
|
|
50
|
+
],
|
|
51
|
+
options: [],
|
|
52
|
+
requirements: {
|
|
53
|
+
requiresRegistry: true
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: "dist-tag:rm",
|
|
58
|
+
command: "dist-tag",
|
|
59
|
+
subcommand: "rm",
|
|
60
|
+
title: "Remove distribution tag",
|
|
61
|
+
group: "registry",
|
|
62
|
+
groupPriority: 8,
|
|
63
|
+
description: "Remove a distribution tag from a package.",
|
|
64
|
+
icon: "TagX",
|
|
65
|
+
arguments: [
|
|
66
|
+
(0, helpers_1.argument)(0, { name: "package", label: "Package", description: "Package name." }),
|
|
67
|
+
(0, helpers_1.argument)(1, { name: "tag", label: "Tag", description: "Distribution tag to remove." })
|
|
68
|
+
],
|
|
69
|
+
options: [],
|
|
70
|
+
requirements: {
|
|
71
|
+
requiresRegistry: true
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbstractCommand } from "../AbstractCommand";
|
|
2
|
+
import { CommandMetadata } from "../metadata/CommandMetadata";
|
|
2
3
|
export declare class FindDependencies extends AbstractCommand {
|
|
3
|
-
|
|
4
|
+
static readonly metadata: CommandMetadata;
|
|
4
5
|
protected handler(): Promise<void>;
|
|
5
6
|
}
|
|
@@ -17,15 +17,8 @@ const trm_commons_1 = require("trm-commons");
|
|
|
17
17
|
const AbstractCommand_1 = require("../AbstractCommand");
|
|
18
18
|
const trm_core_1 = require("trm-core");
|
|
19
19
|
const chalk_1 = __importDefault(require("chalk"));
|
|
20
|
+
const helpers_1 = require("../metadata/helpers");
|
|
20
21
|
class FindDependencies extends AbstractCommand_1.AbstractCommand {
|
|
21
|
-
init() {
|
|
22
|
-
this.registerOpts.requiresConnection = true;
|
|
23
|
-
this.command.description(`Find SAP package dependencies with custom packages/trm packages/SAP entries/objects.`);
|
|
24
|
-
this.command.argument(`<sap package>`, `Name of the SAP package to check.`);
|
|
25
|
-
this.command.option(`--sap-entries`, `Show list of required SAP entries/objects.`, false);
|
|
26
|
-
this.command.option(`--no-prompts`, `No prompts (will force some decisions).`);
|
|
27
|
-
this.command.option(`--trm-found-in`, `Expand TRM dependencies with "Found in" objects.`, false);
|
|
28
|
-
}
|
|
29
22
|
handler() {
|
|
30
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31
24
|
const dependencies = yield trm_core_1.SystemConnector.getPackageDependencies(this.args.sapPackage.toUpperCase(), true);
|
|
@@ -136,3 +129,23 @@ class FindDependencies extends AbstractCommand_1.AbstractCommand {
|
|
|
136
129
|
}
|
|
137
130
|
}
|
|
138
131
|
exports.FindDependencies = FindDependencies;
|
|
132
|
+
FindDependencies.metadata = {
|
|
133
|
+
id: "find-dependencies",
|
|
134
|
+
command: "find-dependencies",
|
|
135
|
+
title: "Find dependencies",
|
|
136
|
+
group: "utility",
|
|
137
|
+
groupPriority: 9,
|
|
138
|
+
description: "Find TRM, customer package, and SAP object dependencies for an SAP package.",
|
|
139
|
+
icon: "Search",
|
|
140
|
+
arguments: [
|
|
141
|
+
(0, helpers_1.argument)(0, { name: "sapPackage", cliName: "sap package", label: "SAP package", description: "SAP package to inspect.", control: "sap-package-picker" })
|
|
142
|
+
],
|
|
143
|
+
options: [
|
|
144
|
+
(0, helpers_1.option)("--sap-entries", { name: "sapEntries", label: "SAP entries", description: "Include required SAP table entries and objects.", control: "checkbox", defaultValue: false }),
|
|
145
|
+
(0, helpers_1.option)("--no-prompts", { name: "prompts", label: "Prompts", description: "Disable prompts and use automatic decisions.", control: "checkbox", defaultValue: true, negated: true }),
|
|
146
|
+
(0, helpers_1.option)("--trm-found-in", { name: "trmFoundIn", label: "Dependency references", description: "Show which objects reference each TRM dependency.", control: "checkbox", defaultValue: false })
|
|
147
|
+
],
|
|
148
|
+
requirements: {
|
|
149
|
+
requiresConnection: true
|
|
150
|
+
}
|
|
151
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { TrmPackage } from "trm-core";
|
|
2
2
|
import { AbstractCommand } from "../AbstractCommand";
|
|
3
|
+
import { CommandMetadata } from "../metadata/CommandMetadata";
|
|
3
4
|
export declare class Info extends AbstractCommand {
|
|
4
|
-
|
|
5
|
+
static readonly metadata: CommandMetadata;
|
|
5
6
|
protected onTrmDepMissing(dependency: string): boolean;
|
|
6
7
|
protected onTrmDepVersionNotSatisfied(trmPackage: TrmPackage): boolean;
|
|
7
8
|
private getNpmLatestForText;
|
|
@@ -22,12 +22,6 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
22
22
|
const fs_1 = require("fs");
|
|
23
23
|
const path_1 = require("path");
|
|
24
24
|
class Info extends AbstractCommand_1.AbstractCommand {
|
|
25
|
-
init() {
|
|
26
|
-
this.registerOpts.requiresConnection = true;
|
|
27
|
-
this.registerOpts.addNoConnection = true;
|
|
28
|
-
this.registerOpts.requiresTrmDependencies = true;
|
|
29
|
-
this.command.description(`TRM Client/Server Info. Shows installed and available updates.`);
|
|
30
|
-
}
|
|
31
25
|
onTrmDepMissing(dependency) {
|
|
32
26
|
return false;
|
|
33
27
|
}
|
|
@@ -219,3 +213,19 @@ class Info extends AbstractCommand_1.AbstractCommand {
|
|
|
219
213
|
}
|
|
220
214
|
}
|
|
221
215
|
exports.Info = Info;
|
|
216
|
+
Info.metadata = {
|
|
217
|
+
id: "info",
|
|
218
|
+
command: "info",
|
|
219
|
+
title: "Client and server information",
|
|
220
|
+
group: "utility",
|
|
221
|
+
guiRelevant: false,
|
|
222
|
+
description: "Show TRM client and server information, including installed versions and available updates.",
|
|
223
|
+
icon: "Info",
|
|
224
|
+
arguments: [],
|
|
225
|
+
options: [],
|
|
226
|
+
requirements: {
|
|
227
|
+
requiresConnection: true,
|
|
228
|
+
addNoConnection: true,
|
|
229
|
+
requiresTrmDependencies: true
|
|
230
|
+
}
|
|
231
|
+
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { TrmPackage } from "trm-core";
|
|
2
2
|
import { AbstractCommand } from "../AbstractCommand";
|
|
3
|
+
import { CommandMetadata } from "../metadata/CommandMetadata";
|
|
3
4
|
export declare class Install extends AbstractCommand {
|
|
4
|
-
|
|
5
|
+
private static readonly installOptions;
|
|
6
|
+
static readonly metadata: CommandMetadata[];
|
|
5
7
|
private selfUpdate;
|
|
8
|
+
private spawnCommand;
|
|
6
9
|
private detectPackageManager;
|
|
7
10
|
private looksLikeYarnBerry;
|
|
8
11
|
private isPermsError;
|
|
@@ -17,52 +17,12 @@ const trm_commons_1 = require("trm-commons");
|
|
|
17
17
|
const trm_core_1 = require("trm-core");
|
|
18
18
|
const AbstractCommand_1 = require("../AbstractCommand");
|
|
19
19
|
const utils_1 = require("../../utils");
|
|
20
|
-
const execa_1 = require("execa");
|
|
21
20
|
const node_os_1 = __importDefault(require("node:os"));
|
|
21
|
+
const node_child_process_1 = require("node:child_process");
|
|
22
22
|
const lockfile_1 = require("trm-core/dist/lockfile");
|
|
23
23
|
const node_path_1 = require("node:path");
|
|
24
|
+
const helpers_1 = require("../metadata/helpers");
|
|
24
25
|
class Install extends AbstractCommand_1.AbstractCommand {
|
|
25
|
-
init() {
|
|
26
|
-
this.registerOpts.requiresConnection = true;
|
|
27
|
-
this.registerOpts.requiresTrmDependencies = true;
|
|
28
|
-
this.registerOpts.requiresR3trans = true;
|
|
29
|
-
if (this.name === 'update') {
|
|
30
|
-
this.registerOpts.requiresRegistry = true;
|
|
31
|
-
this.command.argument(`[package]`, `Name of the package.`);
|
|
32
|
-
this.command.argument(`[version]`, `Version (or tag) of the release.`, `latest`);
|
|
33
|
-
this.command.description(`Update trm-client / Update package from registry into system.`);
|
|
34
|
-
this.command.addHelpText(`before`, `When no package name is specified, trm-client will self-update; all options are invalid, in this case.`);
|
|
35
|
-
}
|
|
36
|
-
else if (this.name === 'install') {
|
|
37
|
-
this.registerOpts.requiresRegistry = true;
|
|
38
|
-
this.command.argument(`<package>`, `Name of the package.`);
|
|
39
|
-
this.command.argument(`[version]`, `Version (or tag) of the release.`, `latest`);
|
|
40
|
-
this.command.description(`Install package from registry into system.`);
|
|
41
|
-
}
|
|
42
|
-
else if (this.name === 'clean-install') {
|
|
43
|
-
this.registerOpts.requiresRegistry = true;
|
|
44
|
-
this.command.argument(`<package>`, `Name of the package.`);
|
|
45
|
-
this.command.argument(`[version]`, `Version (or tag) of the release.`, `latest`);
|
|
46
|
-
this.command.description(`Clean install package from registry into system (requires lockfile).`);
|
|
47
|
-
this.command.option(`-L, --lock-file`, `Install lockfile`, `trm-lock.json`);
|
|
48
|
-
}
|
|
49
|
-
else if (this.name === 'import') {
|
|
50
|
-
this.command.argument(`<filename>`, `Name (or path) of the file.`);
|
|
51
|
-
this.command.description(`Import a package (as a file) into system.`);
|
|
52
|
-
}
|
|
53
|
-
this.command.option(`-T, --transport-layer <transport layer>`, `Package transport layer. (default: System default)`);
|
|
54
|
-
this.command.option(`--no-deps`, `Do not install dependencies.`);
|
|
55
|
-
this.command.option(`--no-obj-type`, `Do not check object types before import.`);
|
|
56
|
-
this.command.option(`--no-obj-check`, `Do not check if objects exist before import.`);
|
|
57
|
-
this.command.option(`--no-sap-entries`, `Do not check SAP entries before import.`);
|
|
58
|
-
this.command.option(`--no-lang-tr`, `Do not import language (translation) transport.`);
|
|
59
|
-
this.command.option(`--no-cust-tr`, `Do not import customizing transports.`);
|
|
60
|
-
this.command.option(`--no-install-tr`, `Do not create install transport.`);
|
|
61
|
-
this.command.option(`--namespace`, `Import customer namespace.`);
|
|
62
|
-
this.command.option(`--package-replacements <replacements>`, `SAP Package replacements (JSON or path to JSON file)`);
|
|
63
|
-
this.command.option(`--install-tr-target <target>`, `Install transport target system`);
|
|
64
|
-
this.command.option(`--no-prompts`, `No prompts (will force some decisions).`);
|
|
65
|
-
}
|
|
66
26
|
selfUpdate() {
|
|
67
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
68
28
|
const pm = this.detectPackageManager();
|
|
@@ -73,7 +33,7 @@ class Install extends AbstractCommand_1.AbstractCommand {
|
|
|
73
33
|
? { bin: "yarn", args: ["global", "add", target] }
|
|
74
34
|
: { bin: "npm", args: ["install", "-g", target] };
|
|
75
35
|
try {
|
|
76
|
-
yield
|
|
36
|
+
yield this.spawnCommand(command.bin, command.args);
|
|
77
37
|
trm_commons_1.Logger.success(`Client updated successfully.`);
|
|
78
38
|
}
|
|
79
39
|
catch (err) {
|
|
@@ -88,6 +48,21 @@ class Install extends AbstractCommand_1.AbstractCommand {
|
|
|
88
48
|
}
|
|
89
49
|
});
|
|
90
50
|
}
|
|
51
|
+
spawnCommand(bin, args) {
|
|
52
|
+
return new Promise((resolve, reject) => {
|
|
53
|
+
const child = (0, node_child_process_1.spawn)(bin, args, { stdio: "inherit" });
|
|
54
|
+
child.on("error", reject);
|
|
55
|
+
child.on("close", exitCode => {
|
|
56
|
+
if (exitCode === 0) {
|
|
57
|
+
resolve();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const error = new Error(`Command failed with exit code ${exitCode}: ${[bin, ...args].join(" ")}`);
|
|
61
|
+
error.exitCode = exitCode;
|
|
62
|
+
reject(error);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
91
66
|
detectPackageManager() {
|
|
92
67
|
var _a;
|
|
93
68
|
const ua = (_a = process.env.npm_config_user_agent) !== null && _a !== void 0 ? _a : "";
|
|
@@ -202,3 +177,103 @@ class Install extends AbstractCommand_1.AbstractCommand {
|
|
|
202
177
|
}
|
|
203
178
|
}
|
|
204
179
|
exports.Install = Install;
|
|
180
|
+
Install.installOptions = [
|
|
181
|
+
(0, helpers_1.option)("-T, --transport-layer <transport layer>", { name: "transportLayer", label: "Transport layer", description: "Transport layer for imported package objects. Defaults to the system transport layer.", control: "transport-layer-picker" }),
|
|
182
|
+
(0, helpers_1.option)("--no-deps", { name: "deps", label: "Dependencies", description: "Skip dependency installation.", control: "checkbox", defaultValue: true, negated: true }),
|
|
183
|
+
(0, helpers_1.option)("--no-obj-type", { name: "objType", label: "Object type checks", description: "Skip object type checks before import.", control: "checkbox", defaultValue: true, negated: true }),
|
|
184
|
+
(0, helpers_1.option)("--no-obj-check", { name: "objCheck", label: "Object existence checks", description: "Skip object existence checks before import.", control: "checkbox", defaultValue: true, negated: true }),
|
|
185
|
+
(0, helpers_1.option)("--no-sap-entries", { name: "sapEntries", label: "SAP entries", description: "Skip SAP entry checks before import.", control: "checkbox", defaultValue: true, negated: true }),
|
|
186
|
+
(0, helpers_1.option)("--no-lang-tr", { name: "langTr", label: "Language transport", description: "Skip language transport import.", control: "checkbox", defaultValue: true, negated: true }),
|
|
187
|
+
(0, helpers_1.option)("--no-cust-tr", { name: "custTr", label: "Customizing transports", description: "Skip customizing transport import.", control: "checkbox", defaultValue: true, negated: true }),
|
|
188
|
+
(0, helpers_1.option)("--no-install-tr", { name: "installTr", label: "Install transport", description: "Do not create an install transport.", control: "checkbox", defaultValue: true, negated: true }),
|
|
189
|
+
(0, helpers_1.option)("--namespace", { name: "namespace", label: "Customer namespace", description: "Import the customer namespace.", control: "checkbox" }),
|
|
190
|
+
(0, helpers_1.option)("--package-replacements <replacements>", { name: "packageReplacements", label: "Package replacements", description: "SAP package replacements as JSON, or a path to a JSON file.", control: "textarea" }),
|
|
191
|
+
(0, helpers_1.option)("--install-tr-target <target>", { name: "installTrTarget", label: "Install transport target", description: "Target system for the install transport.", control: "transport-target-picker" }),
|
|
192
|
+
(0, helpers_1.option)("--no-prompts", { name: "prompts", label: "Prompts", description: "Disable prompts and use automatic decisions.", control: "checkbox", defaultValue: true, guiRelevant: false, negated: true })
|
|
193
|
+
];
|
|
194
|
+
Install.metadata = [
|
|
195
|
+
{
|
|
196
|
+
id: "install",
|
|
197
|
+
command: "install",
|
|
198
|
+
aliases: ["i"],
|
|
199
|
+
title: "Install package",
|
|
200
|
+
group: "package",
|
|
201
|
+
groupPriority: 10,
|
|
202
|
+
description: "Install a package from the registry into the connected system.",
|
|
203
|
+
icon: "PackagePlus",
|
|
204
|
+
arguments: [
|
|
205
|
+
(0, helpers_1.argument)(0, { name: "package", label: "Package", description: "Package name." }),
|
|
206
|
+
(0, helpers_1.argument)(1, { name: "version", label: "Version", description: "Release version or distribution tag.", required: false, defaultValue: "latest" })
|
|
207
|
+
],
|
|
208
|
+
options: Install.installOptions,
|
|
209
|
+
requirements: {
|
|
210
|
+
requiresConnection: true,
|
|
211
|
+
requiresTrmDependencies: true,
|
|
212
|
+
requiresR3trans: true,
|
|
213
|
+
requiresRegistry: true
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: "clean-install",
|
|
218
|
+
command: "clean-install",
|
|
219
|
+
aliases: ["ci"],
|
|
220
|
+
title: "Clean install",
|
|
221
|
+
group: "package",
|
|
222
|
+
groupPriority: 5,
|
|
223
|
+
description: "Install a package from the registry using a lockfile.",
|
|
224
|
+
icon: "PackageCheck",
|
|
225
|
+
arguments: [
|
|
226
|
+
(0, helpers_1.argument)(0, { name: "package", label: "Package", description: "Package name." }),
|
|
227
|
+
(0, helpers_1.argument)(1, { name: "version", label: "Version", description: "Release version or distribution tag.", required: false, defaultValue: "latest" })
|
|
228
|
+
],
|
|
229
|
+
options: [
|
|
230
|
+
(0, helpers_1.option)("-L, --lock-file", { name: "lockFile", label: "Lockfile", description: "Lockfile to use for installation.", control: "file-picker", pickerType: "input", defaultValue: "trm-lock.json" }),
|
|
231
|
+
...Install.installOptions
|
|
232
|
+
],
|
|
233
|
+
requirements: {
|
|
234
|
+
requiresConnection: true,
|
|
235
|
+
requiresTrmDependencies: true,
|
|
236
|
+
requiresR3trans: true,
|
|
237
|
+
requiresRegistry: true
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
id: "update",
|
|
242
|
+
command: "update",
|
|
243
|
+
title: "Update package or client",
|
|
244
|
+
group: "package",
|
|
245
|
+
guiRelevant: false,
|
|
246
|
+
description: "Update the client, or update a package from the registry.",
|
|
247
|
+
longDescription: "When no package name is provided, this command updates trm-client itself and ignores package options.",
|
|
248
|
+
icon: "RefreshCw",
|
|
249
|
+
arguments: [
|
|
250
|
+
(0, helpers_1.argument)(0, { name: "package", label: "Package", description: "Package name.", required: false }),
|
|
251
|
+
(0, helpers_1.argument)(1, { name: "version", label: "Version", description: "Release version or distribution tag.", required: false, defaultValue: "latest" })
|
|
252
|
+
],
|
|
253
|
+
options: Install.installOptions,
|
|
254
|
+
requirements: {
|
|
255
|
+
requiresConnection: true,
|
|
256
|
+
requiresTrmDependencies: true,
|
|
257
|
+
requiresR3trans: true,
|
|
258
|
+
requiresRegistry: true
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
id: "import",
|
|
263
|
+
command: "import",
|
|
264
|
+
title: "Import package file",
|
|
265
|
+
group: "package",
|
|
266
|
+
groupPriority: 8,
|
|
267
|
+
description: "Import a package file into the connected system.",
|
|
268
|
+
icon: "FolderUp",
|
|
269
|
+
arguments: [
|
|
270
|
+
(0, helpers_1.argument)(0, { name: "filename", label: "Package file", description: "Package file name or path.", control: "file-picker", pickerType: "input" })
|
|
271
|
+
],
|
|
272
|
+
options: Install.installOptions,
|
|
273
|
+
requirements: {
|
|
274
|
+
requiresConnection: true,
|
|
275
|
+
requiresTrmDependencies: true,
|
|
276
|
+
requiresR3trans: true
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbstractCommand } from "../AbstractCommand";
|
|
2
|
+
import { CommandMetadata } from "../metadata/CommandMetadata";
|
|
2
3
|
export declare class List extends AbstractCommand {
|
|
3
|
-
|
|
4
|
+
static readonly metadata: CommandMetadata;
|
|
4
5
|
protected handler(): Promise<void>;
|
|
5
6
|
}
|
|
@@ -17,13 +17,8 @@ const trm_commons_1 = require("trm-commons");
|
|
|
17
17
|
const trm_core_1 = require("trm-core");
|
|
18
18
|
const AbstractCommand_1 = require("../AbstractCommand");
|
|
19
19
|
const chalk_1 = __importDefault(require("chalk"));
|
|
20
|
+
const helpers_1 = require("../metadata/helpers");
|
|
20
21
|
class List extends AbstractCommand_1.AbstractCommand {
|
|
21
|
-
init() {
|
|
22
|
-
this.registerOpts.requiresConnection = true;
|
|
23
|
-
this.command.description(`List TRM packages in a system.`);
|
|
24
|
-
this.command.option(`-L, --locals`, `Include local packages (imported and exported)`, false);
|
|
25
|
-
this.command.option(`-o, --output-type`, `Output type (TREE or TABLE)`, 'TREE');
|
|
26
|
-
}
|
|
27
22
|
handler() {
|
|
28
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
24
|
const dest = trm_core_1.SystemConnector.getDest();
|
|
@@ -121,3 +116,21 @@ class List extends AbstractCommand_1.AbstractCommand {
|
|
|
121
116
|
}
|
|
122
117
|
}
|
|
123
118
|
exports.List = List;
|
|
119
|
+
List.metadata = {
|
|
120
|
+
id: "list",
|
|
121
|
+
command: "list",
|
|
122
|
+
aliases: ["ls"],
|
|
123
|
+
title: "List packages",
|
|
124
|
+
group: "system",
|
|
125
|
+
guiRelevant: false,
|
|
126
|
+
description: "List TRM packages installed in the connected system.",
|
|
127
|
+
icon: "List",
|
|
128
|
+
arguments: [],
|
|
129
|
+
options: [
|
|
130
|
+
(0, helpers_1.option)("-L, --locals", { name: "locals", label: "Include local packages", description: "Include imported and exported local packages.", control: "checkbox", defaultValue: false }),
|
|
131
|
+
(0, helpers_1.option)("-o, --output-type", { name: "outputType", label: "Output format", description: "Output format: TREE or TABLE.", control: "select", defaultValue: "TREE" })
|
|
132
|
+
],
|
|
133
|
+
requirements: {
|
|
134
|
+
requiresConnection: true
|
|
135
|
+
}
|
|
136
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbstractCommand } from "../AbstractCommand";
|
|
2
|
+
import { CommandMetadata } from "../metadata/CommandMetadata";
|
|
2
3
|
export declare class Lock extends AbstractCommand {
|
|
3
|
-
|
|
4
|
+
static readonly metadata: CommandMetadata;
|
|
4
5
|
protected handler(): Promise<void>;
|
|
5
6
|
}
|
|
@@ -13,15 +13,8 @@ exports.Lock = void 0;
|
|
|
13
13
|
const trm_commons_1 = require("trm-commons");
|
|
14
14
|
const AbstractCommand_1 = require("../AbstractCommand");
|
|
15
15
|
const fs_1 = require("fs");
|
|
16
|
+
const helpers_1 = require("../metadata/helpers");
|
|
16
17
|
class Lock extends AbstractCommand_1.AbstractCommand {
|
|
17
|
-
init() {
|
|
18
|
-
this.registerOpts.requiresConnection = true;
|
|
19
|
-
this.registerOpts.requiresRegistry = true;
|
|
20
|
-
this.registerOpts.ignoreRegistryUnreachable = true;
|
|
21
|
-
this.command.description(`Generate a lockfile for a TRM package.`);
|
|
22
|
-
this.command.argument(`<package>`, `Name of the package to generate lock file.`);
|
|
23
|
-
this.command.argument(`[output path]`, `Output path.`, 'trm-lock.json');
|
|
24
|
-
}
|
|
25
18
|
handler() {
|
|
26
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
20
|
const packages = yield this.getSystemPackages();
|
|
@@ -38,3 +31,23 @@ class Lock extends AbstractCommand_1.AbstractCommand {
|
|
|
38
31
|
}
|
|
39
32
|
}
|
|
40
33
|
exports.Lock = Lock;
|
|
34
|
+
Lock.metadata = {
|
|
35
|
+
id: "lock",
|
|
36
|
+
command: "lock",
|
|
37
|
+
aliases: ["lock-file"],
|
|
38
|
+
title: "Generate lockfile",
|
|
39
|
+
group: "package",
|
|
40
|
+
groupPriority: 6,
|
|
41
|
+
description: "Generate a lockfile for an installed TRM package.",
|
|
42
|
+
icon: "LockKeyhole",
|
|
43
|
+
arguments: [
|
|
44
|
+
(0, helpers_1.argument)(0, { name: "package", label: "Package", description: "Package to lock." }),
|
|
45
|
+
(0, helpers_1.argument)(1, { name: "outputPath", cliName: "output path", label: "Output path", description: "Path where the lockfile will be written.", required: false, defaultValue: "trm-lock.json", control: "file-picker", pickerType: "output" })
|
|
46
|
+
],
|
|
47
|
+
options: [],
|
|
48
|
+
requirements: {
|
|
49
|
+
requiresConnection: true,
|
|
50
|
+
requiresRegistry: true,
|
|
51
|
+
ignoreRegistryUnreachable: true
|
|
52
|
+
}
|
|
53
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbstractCommand } from "../AbstractCommand";
|
|
2
|
+
import { CommandMetadata } from "../metadata/CommandMetadata";
|
|
2
3
|
export declare class Login extends AbstractCommand {
|
|
3
|
-
|
|
4
|
+
static readonly metadata: CommandMetadata;
|
|
4
5
|
protected handler(): Promise<void>;
|
|
5
6
|
}
|
|
@@ -14,15 +14,8 @@ const trm_commons_1 = require("trm-commons");
|
|
|
14
14
|
const AbstractCommand_1 = require("../AbstractCommand");
|
|
15
15
|
const registryAlias_1 = require("../../registryAlias");
|
|
16
16
|
const trm_registry_types_1 = require("trm-registry-types");
|
|
17
|
+
const helpers_1 = require("../metadata/helpers");
|
|
17
18
|
class Login extends AbstractCommand_1.AbstractCommand {
|
|
18
|
-
init() {
|
|
19
|
-
this.registerOpts.requiresRegistry = true;
|
|
20
|
-
this.registerOpts.onlyRegistryAlias = true;
|
|
21
|
-
this.registerOpts.registryAuthBlacklist = [trm_registry_types_1.AuthenticationType.NO_AUTH];
|
|
22
|
-
this.command.description(`Log into a registry.`);
|
|
23
|
-
this.command.addHelpText(`before`, `This command has no effect when trying to login into a registry that doesn't require authentication.`);
|
|
24
|
-
this.command.option(`-A, --registry-auth <authentication>`, `Registry authentication (JSON or path to JSON file).`);
|
|
25
|
-
}
|
|
26
19
|
handler() {
|
|
27
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
21
|
const registry = this.getRegistry();
|
|
@@ -64,3 +57,28 @@ class Login extends AbstractCommand_1.AbstractCommand {
|
|
|
64
57
|
}
|
|
65
58
|
}
|
|
66
59
|
exports.Login = Login;
|
|
60
|
+
Login.metadata = {
|
|
61
|
+
id: "login",
|
|
62
|
+
command: "login",
|
|
63
|
+
title: "Log in",
|
|
64
|
+
group: "registry",
|
|
65
|
+
guiRelevant: false,
|
|
66
|
+
description: "Log in to a registry.",
|
|
67
|
+
longDescription: "This command has no effect for registries that do not require authentication.",
|
|
68
|
+
icon: "LogIn",
|
|
69
|
+
arguments: [],
|
|
70
|
+
options: [
|
|
71
|
+
(0, helpers_1.option)("-A, --registry-auth <authentication>", {
|
|
72
|
+
name: "registryAuth",
|
|
73
|
+
label: "Authentication data",
|
|
74
|
+
description: "Registry authentication data as JSON, or a path to a JSON file.",
|
|
75
|
+
control: "textarea",
|
|
76
|
+
sensitive: true
|
|
77
|
+
})
|
|
78
|
+
],
|
|
79
|
+
requirements: {
|
|
80
|
+
requiresRegistry: true,
|
|
81
|
+
onlyRegistryAlias: true,
|
|
82
|
+
registryAuthBlacklist: [trm_registry_types_1.AuthenticationType.NO_AUTH]
|
|
83
|
+
}
|
|
84
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbstractCommand } from "../AbstractCommand";
|
|
2
|
+
import { CommandMetadata } from "../metadata/CommandMetadata";
|
|
2
3
|
export declare class Logout extends AbstractCommand {
|
|
3
|
-
|
|
4
|
+
static readonly metadata: CommandMetadata;
|
|
4
5
|
protected handler(): Promise<void>;
|
|
5
6
|
}
|
|
@@ -15,13 +15,6 @@ const registryAlias_1 = require("../../registryAlias");
|
|
|
15
15
|
const AbstractCommand_1 = require("../AbstractCommand");
|
|
16
16
|
const trm_registry_types_1 = require("trm-registry-types");
|
|
17
17
|
class Logout extends AbstractCommand_1.AbstractCommand {
|
|
18
|
-
init() {
|
|
19
|
-
this.registerOpts.requiresRegistry = true;
|
|
20
|
-
this.registerOpts.onlyRegistryAlias = true;
|
|
21
|
-
this.registerOpts.registryAuthBlacklist = [trm_registry_types_1.AuthenticationType.NO_AUTH];
|
|
22
|
-
this.command.description(`Log out of a registry.`);
|
|
23
|
-
this.command.addHelpText(`before`, `This command has no effect when trying to login into a registry that doesn't require authentication.`);
|
|
24
|
-
}
|
|
25
18
|
handler() {
|
|
26
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
20
|
const registry = this.getRegistry();
|
|
@@ -35,3 +28,20 @@ class Logout extends AbstractCommand_1.AbstractCommand {
|
|
|
35
28
|
}
|
|
36
29
|
}
|
|
37
30
|
exports.Logout = Logout;
|
|
31
|
+
Logout.metadata = {
|
|
32
|
+
id: "logout",
|
|
33
|
+
command: "logout",
|
|
34
|
+
title: "Log out",
|
|
35
|
+
group: "registry",
|
|
36
|
+
guiRelevant: false,
|
|
37
|
+
description: "Log out of a registry.",
|
|
38
|
+
longDescription: "This command has no effect for registries that do not require authentication.",
|
|
39
|
+
icon: "LogOut",
|
|
40
|
+
arguments: [],
|
|
41
|
+
options: [],
|
|
42
|
+
requirements: {
|
|
43
|
+
requiresRegistry: true,
|
|
44
|
+
onlyRegistryAlias: true,
|
|
45
|
+
registryAuthBlacklist: [trm_registry_types_1.AuthenticationType.NO_AUTH]
|
|
46
|
+
}
|
|
47
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbstractCommand } from "../AbstractCommand";
|
|
2
|
+
import { CommandMetadata } from "../metadata/CommandMetadata";
|
|
2
3
|
export declare class Ping extends AbstractCommand {
|
|
3
|
-
|
|
4
|
+
static readonly metadata: CommandMetadata;
|
|
4
5
|
protected handler(): Promise<void>;
|
|
5
6
|
}
|
|
@@ -14,11 +14,6 @@ const trm_commons_1 = require("trm-commons");
|
|
|
14
14
|
const trm_core_1 = require("trm-core");
|
|
15
15
|
const AbstractCommand_1 = require("../AbstractCommand");
|
|
16
16
|
class Ping extends AbstractCommand_1.AbstractCommand {
|
|
17
|
-
init() {
|
|
18
|
-
this.registerOpts.requiresConnection = true;
|
|
19
|
-
this.registerOpts.requiresTrmDependencies = true;
|
|
20
|
-
this.command.description(`Ping trm-server (Used for testing purposes).`);
|
|
21
|
-
}
|
|
22
17
|
handler() {
|
|
23
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
19
|
trm_commons_1.Logger.loading(`Pinging trm-server on ${trm_core_1.SystemConnector.getDest()}...`);
|
|
@@ -28,3 +23,18 @@ class Ping extends AbstractCommand_1.AbstractCommand {
|
|
|
28
23
|
}
|
|
29
24
|
}
|
|
30
25
|
exports.Ping = Ping;
|
|
26
|
+
Ping.metadata = {
|
|
27
|
+
id: "ping",
|
|
28
|
+
command: "ping",
|
|
29
|
+
title: "Ping server",
|
|
30
|
+
group: "registry",
|
|
31
|
+
guiRelevant: false,
|
|
32
|
+
description: "Ping the TRM server used by the connected system.",
|
|
33
|
+
icon: "Radar",
|
|
34
|
+
arguments: [],
|
|
35
|
+
options: [],
|
|
36
|
+
requirements: {
|
|
37
|
+
requiresConnection: true,
|
|
38
|
+
requiresTrmDependencies: true
|
|
39
|
+
}
|
|
40
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { AbstractCommand } from "../AbstractCommand";
|
|
2
|
+
import { CommandMetadata } from "../metadata/CommandMetadata";
|
|
2
3
|
export declare class Publish extends AbstractCommand {
|
|
3
|
-
|
|
4
|
+
private static readonly releaseOptions;
|
|
5
|
+
static readonly metadata: CommandMetadata[];
|
|
4
6
|
private validateVersion;
|
|
5
7
|
protected handler(): Promise<void>;
|
|
6
8
|
}
|