trm-client 5.0.0 → 5.0.2

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 CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 RegestaItalia
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2023 RegestaItalia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,65 +1,65 @@
1
- # <a href="https://docs.trmregistry.com/#/server/README"><img src="https://docs.trmregistry.com/_media/logo.png" height="40" alt="TRM"></a>
2
-
3
- [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-1.3.0-4baaaa.svg)](https://github.com/RegestaItalia/trm-docs/blob/main/CODE_OF_CONDUCT.md)
4
- [![trm-client License](https://img.shields.io/github/license/RegestaItalia/trm-client)](https://github.com/RegestaItalia/trm-client)
5
- [![trm-client Latest version](https://img.shields.io/npm/v/trm-client)](https://www.npmjs.com/package/trm-client)
6
- [![trm-client Installs](https://img.shields.io/npm/dt/trm-client)](https://www.npmjs.com/package/trm-client)
7
-
8
- | 🚀 This project is funded and maintained by 🏦 | 🔗 |
9
- |-------------------------------------------------|----------------------------------------------------------------|
10
- | Regesta S.p.A. | [https://www.regestaitalia.eu/](https://www.regestaitalia.eu/) |
11
- | Clarex S.r.l. | [https://www.clarex.it/](https://www.clarex.it/) |
12
-
13
- This is the official CLI implementation of the core functionalities of TRM.
14
-
15
- TRM is a software designed to make transports between SAP ECC/S4 systems easy.
16
-
17
- To find out more about TRM, visit its full [documentation](https://docs.trmregistry.com).
18
-
19
- # Documentation <!-- {docsify-remove} -->
20
-
21
- Full documentation can be seen at [https://docs.trmregistry.com](https://docs.trmregistry.com).
22
-
23
- <!-- START TABLE_OF_CONTENTS.md -->
24
- - [Setup](/docs/setup.md)
25
- - [Commands](/docs/commands.md)
26
- - [Installing your first package](/docs/examples/install.md)
27
- - [Publishing your first package](/docs/examples/publish.md)
28
- - [Integrate with abapGit & Github Actions](/docs/examples/githubActions.md)
29
- <!-- END TABLE_OF_CONTENTS.md -->
30
-
31
- ## Install <!-- {docsify-remove} -->
32
-
33
- First, make sure you have all the [requirements installed](/docs/setup.md#trm-client-requirements).
34
-
35
- You can then install the CLI via npm:
36
-
37
- `npm install trm-client -g`
38
-
39
- ## Commands <!-- {docsify-remove} -->
40
-
41
- List of all commands is available [here](/docs/commands.md).
42
-
43
- ### Demo publish <!-- {docsify-remove} -->
44
-
45
- <p align="center">
46
-   <img src="https://docs.trmregistry.com/_media/publish.gif" />
47
- </p>
48
-
49
- ### Demo install <!-- {docsify-remove} -->
50
-
51
- <p align="center">
52
-   <img src="https://docs.trmregistry.com/_media/install.gif" />
53
- </p>
54
-
55
- # Contributing <!-- {docsify-remove} -->
56
-
57
- Like every other TRM open-source projects, contributions are always welcomed ❤️.
58
-
59
- Make sure to open an issue first.
60
-
61
- Contributions will be merged upon approval.
62
-
63
- [Click here](https://docs.trmregistry.com/#/CONTRIBUTING) for the full list of TRM contribution guidelines.
64
-
65
- [<img src="https://trmregistry.com/public/contributors?image=true">](https://docs.trmregistry.com/#/?id=contributors)
1
+ # <a href="https://docs.trmregistry.com/#/server/README"><img src="https://docs.trmregistry.com/_media/logo.png" height="40" alt="TRM"></a>
2
+
3
+ [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-1.3.0-4baaaa.svg)](https://github.com/RegestaItalia/trm-docs/blob/main/CODE_OF_CONDUCT.md)
4
+ [![trm-client License](https://img.shields.io/github/license/RegestaItalia/trm-client)](https://github.com/RegestaItalia/trm-client)
5
+ [![trm-client Latest version](https://img.shields.io/npm/v/trm-client)](https://www.npmjs.com/package/trm-client)
6
+ [![trm-client Installs](https://img.shields.io/npm/dt/trm-client)](https://www.npmjs.com/package/trm-client)
7
+
8
+ | 🚀 This project is funded and maintained by 🏦 | 🔗 |
9
+ |-------------------------------------------------|----------------------------------------------------------------|
10
+ | Regesta S.p.A. | [https://www.regestaitalia.eu/](https://www.regestaitalia.eu/) |
11
+ | Clarex S.r.l. | [https://www.clarex.it/](https://www.clarex.it/) |
12
+
13
+ This is the official CLI implementation of the core functionalities of TRM.
14
+
15
+ TRM is a software designed to make transports between SAP ECC/S4 systems easy.
16
+
17
+ To find out more about TRM, visit its full [documentation](https://docs.trmregistry.com).
18
+
19
+ # Documentation <!-- {docsify-remove} -->
20
+
21
+ Full documentation can be seen at [https://docs.trmregistry.com](https://docs.trmregistry.com).
22
+
23
+ <!-- START TABLE_OF_CONTENTS.md -->
24
+ - [Setup](/docs/setup.md)
25
+ - [Commands](/docs/commands.md)
26
+ - [Installing your first package](/docs/examples/install.md)
27
+ - [Publishing your first package](/docs/examples/publish.md)
28
+ - [Integrate with abapGit & Github Actions](/docs/examples/githubActions.md)
29
+ <!-- END TABLE_OF_CONTENTS.md -->
30
+
31
+ ## Install <!-- {docsify-remove} -->
32
+
33
+ First, make sure you have all the [requirements installed](/docs/setup.md#trm-client-requirements).
34
+
35
+ You can then install the CLI via npm:
36
+
37
+ `npm install trm-client -g`
38
+
39
+ ## Commands <!-- {docsify-remove} -->
40
+
41
+ List of all commands is available [here](/docs/commands.md).
42
+
43
+ ### Demo publish <!-- {docsify-remove} -->
44
+
45
+ <p align="center">
46
+   <img src="https://docs.trmregistry.com/_media/publish.gif" />
47
+ </p>
48
+
49
+ ### Demo install <!-- {docsify-remove} -->
50
+
51
+ <p align="center">
52
+   <img src="https://docs.trmregistry.com/_media/install.gif" />
53
+ </p>
54
+
55
+ # Contributing <!-- {docsify-remove} -->
56
+
57
+ Like every other TRM open-source projects, contributions are always welcomed ❤️.
58
+
59
+ Make sure to open an issue first.
60
+
61
+ Contributions will be merged upon approval.
62
+
63
+ [Click here](https://docs.trmregistry.com/#/CONTRIBUTING) for the full list of TRM contribution guidelines.
64
+
65
+ [<img src="https://trmregistry.com/public/contributors?image=true">](https://docs.trmregistry.com/#/?id=contributors)
package/changelog.txt CHANGED
@@ -1,105 +1,117 @@
1
- trm-client changelog
2
- =================
3
-
4
- Legend
5
- ------
6
- * : fixed
7
- ! : changed
8
- + : added
9
- - : removed
10
-
11
- 2025-09-03 v5.0.0
12
- -------------------
13
-
14
- ! trm-core ^7.5.1
15
- ! trm-commons ^3.2.0
16
- ! moved settings to context
17
- + plugin calls
18
- + gracefully close connection
19
- ! moved connection prompts to commons
20
-
21
- 2025-08-13 v4.10.0
22
- -------------------
23
-
24
- ! trm-core ^7.4.5
25
- + support for darwin os
26
- + support for r3trans dockerized
27
-
28
- 2025-07-30 v4.9.2
29
- -------------------
30
-
31
- ! trm-commons ^2.0.0 as peer dependency and dependency
32
-
33
- 2025-07-29 v4.9.1
34
- -------------------
35
-
36
- ! trm-core ^7.4.1
37
- ! trm-commons ^2.0.0
38
-
39
- 2025-07-29 v4.9.0
40
- -------------------
41
-
42
- + handle registry unauthorized error
43
- ! trm-core ^7.4.0
44
- ! trm-commons ^1.1.0
45
-
46
- 2025-06-04 v4.8.0
47
- -------------------
48
-
49
- ! trm-core ^7.2.1
50
- ! overwrite flag in install/update ignores existing objects replace
51
-
52
- 2025-06-03 v4.7.0
53
- -------------------
54
-
55
- ! trm-core ^7.0.0
56
-
57
- 2025-05-29 v4.6.1
58
- -------------------
59
-
60
- ! logging error changes
61
- ! trm-core ^6.9.0
62
- + landscape transport to list and view command
63
-
64
- 2025-05-08 v4.6.0
65
- -------------------
66
-
67
- ! trm-core ^6.8.0
68
- * saprouter in alias
69
-
70
- 2025-05-08 v4.5.0
71
- -------------------
72
-
73
- ! trm-core ^6.7.0
74
- ! error handling
75
- * alias command/saprouter alias save
76
- * fix connection validators
77
-
78
- 2025-04-28 v4.4.1
79
- -------------------
80
-
81
- * node-r3trans version read
82
-
83
- 2025-04-28 v4.4.0
84
- -------------------
85
-
86
- ! trm-core ^6.5.0
87
- ! trm-commons ^1.0.0
88
-
89
- 2025-04-28 v4.3.0
90
- -------------------
91
-
92
- ! trm-core ^6.4.1
93
-
94
- 2025-04-23 v4.2.1
95
- -------------------
96
-
97
- * node-r3trans version read
98
-
99
- 2025-02-26 v4.2.0
100
- -------------------
101
-
102
- ! connect to registry via option
103
- - trm dependencies on client
104
- + content command
1
+ trm-client changelog
2
+ =================
3
+
4
+ Legend
5
+ ------
6
+ * : fixed
7
+ ! : changed
8
+ + : added
9
+ - : removed
10
+
11
+ 2025-09-09 v5.0.2
12
+ -------------------
13
+
14
+ * fix no connection
15
+ + fallback text for node-rfc and node-r3trans not found in info command
16
+ + update command now self updates the client if ran without arguments
17
+
18
+ 2025-09-03 v5.0.1
19
+ -------------------
20
+
21
+ + plugin loadCommons
22
+
23
+ 2025-09-03 v5.0.0
24
+ -------------------
25
+
26
+ ! trm-core ^7.5.1
27
+ ! trm-commons ^3.2.0
28
+ ! moved settings to context
29
+ + plugin calls
30
+ + gracefully close connection
31
+ ! moved connection prompts to commons
32
+
33
+ 2025-08-13 v4.10.0
34
+ -------------------
35
+
36
+ ! trm-core ^7.4.5
37
+ + support for darwin os
38
+ + support for r3trans dockerized
39
+
40
+ 2025-07-30 v4.9.2
41
+ -------------------
42
+
43
+ ! trm-commons ^2.0.0 as peer dependency and dependency
44
+
45
+ 2025-07-29 v4.9.1
46
+ -------------------
47
+
48
+ ! trm-core ^7.4.1
49
+ ! trm-commons ^2.0.0
50
+
51
+ 2025-07-29 v4.9.0
52
+ -------------------
53
+
54
+ + handle registry unauthorized error
55
+ ! trm-core ^7.4.0
56
+ ! trm-commons ^1.1.0
57
+
58
+ 2025-06-04 v4.8.0
59
+ -------------------
60
+
61
+ ! trm-core ^7.2.1
62
+ ! overwrite flag in install/update ignores existing objects replace
63
+
64
+ 2025-06-03 v4.7.0
65
+ -------------------
66
+
67
+ ! trm-core ^7.0.0
68
+
69
+ 2025-05-29 v4.6.1
70
+ -------------------
71
+
72
+ ! logging error changes
73
+ ! trm-core ^6.9.0
74
+ + landscape transport to list and view command
75
+
76
+ 2025-05-08 v4.6.0
77
+ -------------------
78
+
79
+ ! trm-core ^6.8.0
80
+ * saprouter in alias
81
+
82
+ 2025-05-08 v4.5.0
83
+ -------------------
84
+
85
+ ! trm-core ^6.7.0
86
+ ! error handling
87
+ * alias command/saprouter alias save
88
+ * fix connection validators
89
+
90
+ 2025-04-28 v4.4.1
91
+ -------------------
92
+
93
+ * node-r3trans version read
94
+
95
+ 2025-04-28 v4.4.0
96
+ -------------------
97
+
98
+ ! trm-core ^6.5.0
99
+ ! trm-commons ^1.0.0
100
+
101
+ 2025-04-28 v4.3.0
102
+ -------------------
103
+
104
+ ! trm-core ^6.4.1
105
+
106
+ 2025-04-23 v4.2.1
107
+ -------------------
108
+
109
+ * node-r3trans version read
110
+
111
+ 2025-02-26 v4.2.0
112
+ -------------------
113
+
114
+ ! connect to registry via option
115
+ - trm dependencies on client
116
+ + content command
105
117
  + pack/import command
@@ -23,3 +23,4 @@ export * from "./update";
23
23
  export * from "./content";
24
24
  export * from "./pack";
25
25
  export * from "./import";
26
+ export * from "./selfUpdate";
@@ -39,3 +39,4 @@ __exportStar(require("./update"), exports);
39
39
  __exportStar(require("./content"), exports);
40
40
  __exportStar(require("./pack"), exports);
41
41
  __exportStar(require("./import"), exports);
42
+ __exportStar(require("./selfUpdate"), exports);
@@ -177,12 +177,24 @@ function info(commandArgs) {
177
177
  children: []
178
178
  });
179
179
  }
180
+ else {
181
+ clientChildrenTree.push({
182
+ text: `node-rfc ${chalk_1.default.bold('not found')}`,
183
+ children: []
184
+ });
185
+ }
180
186
  if (nodeR3transVersion) {
181
187
  clientChildrenTree.push({
182
188
  text: yield _getNpmLatestForText('node-r3trans', nodeR3transVersion, `node-r3trans ${nodeR3transVersion}`),
183
189
  children: []
184
190
  });
185
191
  }
192
+ else {
193
+ clientChildrenTree.push({
194
+ text: `node-r3trans ${chalk_1.default.bold('not found')}`,
195
+ children: []
196
+ });
197
+ }
186
198
  const clientTree = {
187
199
  text: chalk_1.default.bold(`Client`),
188
200
  children: clientChildrenTree
@@ -192,7 +204,7 @@ function info(commandArgs) {
192
204
  text: chalk_1.default.bold(`Server (${trm_core_1.SystemConnector.getDest()})`),
193
205
  children: serverDependenciesTree
194
206
  };
195
- if (!(trm_core_1.SystemConnector.systemConnector instanceof utils_1.NoConnection)) {
207
+ if (!(trm_core_1.SystemConnector.systemConnector instanceof utils_1.DummyConnector)) {
196
208
  trm_commons_1.Logger.tree(serverTree);
197
209
  }
198
210
  });
@@ -54,6 +54,16 @@ const languageList = [
54
54
  { value: 'UK', name: 'UK (Ukrainian)' },
55
55
  { value: 'VI', name: 'VI (Vietnamese)' }
56
56
  ];
57
+ class NoConnection {
58
+ constructor() {
59
+ this.name = null;
60
+ this.description = 'No connection';
61
+ this.loginData = false;
62
+ }
63
+ getSystemConnector() {
64
+ return new utils_1.DummyConnector();
65
+ }
66
+ }
57
67
  function connect(commandArgs_1) {
58
68
  return __awaiter(this, arguments, void 0, function* (commandArgs, createAliasIfNotExist = true, addNoConnection) {
59
69
  const noSystemAlias = commandArgs.noSystemAlias ? true : false;
@@ -97,7 +107,7 @@ function connect(commandArgs_1) {
97
107
  inputType = inq1.inputType;
98
108
  }
99
109
  if (inputType === 'none') {
100
- return null;
110
+ return new NoConnection();
101
111
  }
102
112
  else if (inputType === 'alias') {
103
113
  const inq2 = (yield trm_commons_1.Inquirer.prompt({
@@ -0,0 +1 @@
1
+ export declare function selfUpdate(): Promise<void>;
@@ -0,0 +1,77 @@
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.selfUpdate = selfUpdate;
16
+ const execa_1 = require("execa");
17
+ const node_os_1 = __importDefault(require("node:os"));
18
+ const trm_commons_1 = require("trm-commons");
19
+ function selfUpdate() {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const pm = detectPackageManager();
22
+ const target = `trm-client@latest`;
23
+ const command = pm === "pnpm"
24
+ ? { bin: "pnpm", args: ["add", "-g", target] }
25
+ : pm === "yarn1"
26
+ ? { bin: "yarn", args: ["global", "add", target] }
27
+ : { bin: "npm", args: ["install", "-g", target] };
28
+ try {
29
+ yield (0, execa_1.execa)(command.bin, command.args, { stdio: "inherit" });
30
+ trm_commons_1.Logger.success(`Client updated successfully.`);
31
+ }
32
+ catch (err) {
33
+ if (isPermsError(err)) {
34
+ trm_commons_1.Logger.error(formatPermsHelp(command.bin));
35
+ }
36
+ if (command.bin === "yarn" && looksLikeYarnBerry()) {
37
+ trm_commons_1.Logger.error(`\Detected Yarn ≥2 (Berry). It doesn't support reliable global installs.\n` +
38
+ ` Try: npm install -g ${target}`);
39
+ }
40
+ throw err;
41
+ }
42
+ });
43
+ }
44
+ function detectPackageManager() {
45
+ var _a;
46
+ const ua = (_a = process.env.npm_config_user_agent) !== null && _a !== void 0 ? _a : "";
47
+ if (ua.includes("pnpm/"))
48
+ return "pnpm";
49
+ if (ua.includes("yarn/1."))
50
+ return "yarn1";
51
+ return "npm";
52
+ }
53
+ function looksLikeYarnBerry() {
54
+ var _a;
55
+ const ua = (_a = process.env.npm_config_user_agent) !== null && _a !== void 0 ? _a : "";
56
+ return ua.includes("yarn/") && !ua.includes("yarn/1.");
57
+ }
58
+ function isPermsError(err) {
59
+ const msg = String((err === null || err === void 0 ? void 0 : err.message) || err);
60
+ return ((err === null || err === void 0 ? void 0 : err.code) === "EACCES" ||
61
+ (err === null || err === void 0 ? void 0 : err.errno) === -13 ||
62
+ /EACCES|EPERM|permission denied/i.test(msg));
63
+ }
64
+ function formatPermsHelp(bin) {
65
+ const isUnix = node_os_1.default.platform() !== "win32";
66
+ return (`Permission error installing globally.\n` +
67
+ `Troubleshooting tips:\n` +
68
+ (isUnix
69
+ ? ` • If you used a system Node, configure a user-level global prefix:\n` +
70
+ ` mkdir -p ~/.npm-global && npm config set prefix ~/.npm-global\n` +
71
+ ` export PATH="$HOME/.npm-global/bin:$PATH"\n` +
72
+ ` (Then rerun: ${bin} …)\n` +
73
+ ` • Prefer using a Node version manager (nvm/fnm/volta) to avoid sudo.\n` +
74
+ ` • Avoid running global installs with sudo unless you know why.\n`
75
+ : ` • Run your shell as Administrator, or use a Node manager (nvs/volta).\n`) +
76
+ ``);
77
+ }
@@ -17,9 +17,9 @@ const trm_core_1 = require("trm-core");
17
17
  const commons_1 = require("./commons");
18
18
  const semver_1 = require("semver");
19
19
  const registryAlias_1 = require("../registryAlias");
20
- const utils_1 = require("../utils");
21
20
  const chalk_1 = __importDefault(require("chalk"));
22
21
  const trm_commons_1 = require("trm-commons");
22
+ const utils_1 = require("../utils");
23
23
  const _printHeaderSection = (packageName) => {
24
24
  trm_commons_1.Logger.info(`Package name: ${chalk_1.default.bold(packageName)}`);
25
25
  trm_commons_1.Logger.info(`Registry: ${commons_1.CommandContext.getRegistry().name}`);
@@ -29,7 +29,7 @@ const _printVersionSection = (systemPackage, registryView) => {
29
29
  return;
30
30
  }
31
31
  var oSystemManifest;
32
- if (!(trm_core_1.SystemConnector.systemConnector instanceof utils_1.NoConnection)) {
32
+ if (!(trm_core_1.SystemConnector.systemConnector instanceof utils_1.DummyConnector)) {
33
33
  console.log('');
34
34
  if (systemPackage) {
35
35
  oSystemManifest = systemPackage.manifest.get();
package/dist/index.js CHANGED
@@ -7,23 +7,32 @@ const trm_registry_types_1 = require("trm-registry-types");
7
7
  const program = new commander_1.Command();
8
8
  program
9
9
  .name(`trm`)
10
- .description(`TRM - Transport Request Manager CLI`)
11
- .version((0, utils_1.getClientVersion)(), `-cv, --clientVersion`, `Client version.`);
12
- const createAlias = program.command(`createAlias <alias>`)
10
+ .description(`TRM - Transport Request Manager CLI
11
+
12
+ Full documentation available at https://docs.trmregistry.com/
13
+
14
+ © 2025 RegestaItalia https://www.regestaitalia.eu/`)
15
+ .version((0, utils_1.getClientVersion)());
16
+ const createAlias = program.command(`createAlias`)
17
+ .argument(`<alias>`, `Name of the alias to generate.`)
13
18
  .description(`Create a new system alias.`);
14
19
  (0, utils_1.registerCommand)(createAlias);
15
- const deleteAlias = program.command(`deleteAlias <alias>`)
20
+ const deleteAlias = program.command(`deleteAlias`)
21
+ .argument(`<alias>`, `Name of the alias to delete.`)
16
22
  .description(`Delete a system alias.`);
17
23
  (0, utils_1.registerCommand)(deleteAlias);
18
- const manageAliases = program.command(`alias [alias]`)
24
+ const manageAliases = program.command(`alias`)
25
+ .argument(`[alias]`, `Optional: Single alias to maintain.`)
19
26
  .description(`List and manage aliases.`);
20
27
  (0, utils_1.registerCommand)(manageAliases);
21
- const addRegistry = program.command(`addRegistry <registryName>`)
28
+ const addRegistry = program.command(`addRegistry`)
29
+ .argument(`<registryName>`, `Name of the registry to generate.`)
22
30
  .description(`Add a new registry.`)
23
31
  .option(`-e, --endpoint <endpoint>`, `Endpoint.`)
24
- .option(`-a, --authentication <authentication>`, `Optional authentication as a valid JSON string.`);
32
+ .option(`-a, --authentication <authentication>`, `Authentication as a valid JSON string.`);
25
33
  (0, utils_1.registerCommand)(addRegistry);
26
- const removeRegistry = program.command(`removeRegistry <registryName>`)
34
+ const removeRegistry = program.command(`removeRegistry`)
35
+ .argument(`<registryName>`, `Name of the registry to delete.`)
27
36
  .description(`Remove a registry.`)
28
37
  .option(`-f, --force`, `Force.`, false);
29
38
  (0, utils_1.registerCommand)(removeRegistry);
@@ -56,15 +65,17 @@ const ping = program.command(`ping`)
56
65
  requiresConnection: true,
57
66
  requiresTrmDependencies: true
58
67
  });
59
- const publish = program.command(`publish <package> [version]`)
68
+ const publish = program.command(`publish`)
69
+ .argument(`<package>`, `Name of the package to publish.`)
70
+ .argument(`[version]`, `Optional: Version of the package to publish. If not specified, check help text for details.`)
60
71
  .description(`Publish package to registry.`)
61
- .addHelpText(`before`, `When no version is defined, it will automatically set to:
62
- - When it's the first publish: 1.0.0
63
- - When it's already published: the latest available release with patch increased by 1
64
- When it's the first publish, full manifest definition is asked.
65
- When a release is already published, the latest available manifest is used but can be overwritten.
66
- Translation transport is only generated for packages that contain one or more objects with translations (unless skipped by flag).
67
- Customizing transport is only generated if a valid list of customizing transports is provided (unless skipped by flag).
72
+ .addHelpText(`before`, `When no version argument is defined, it will automatically set to:
73
+ - When it's the first publish: 1.0.0
74
+ - When it's already published: the latest available release with patch increased by 1
75
+ When it's the first publish, full manifest definition is asked.
76
+ When a release is already published, the latest available manifest is used but can be overwritten.
77
+ Translation transport is only generated for packages that contain one or more objects with translations (unless skipped by flag).
78
+ Customizing transport is only generated if a valid list of customizing transports is provided (unless skipped by flag).
68
79
  If a default manifest with dependencies is provided in conjunction with the automatic dependency generation, results will be merged.`)
69
80
  .option(`-p, --private`, `Publish package with private visibility.`)
70
81
  .option(`-np, --noPrompts`, `No prompts (will force some decisions).`, false)
@@ -91,11 +102,13 @@ If a default manifest with dependencies is provided in conjunction with the auto
91
102
  requiresRegistry: true,
92
103
  requiresTrmDependencies: true
93
104
  });
94
- const pack = program.command(`pack <package> [version]`)
105
+ const pack = program.command(`pack`)
106
+ .argument(`<package>`, `Name of the package to generate.`)
107
+ .argument(`[version]`, `Optional: Version of the package to generate. If not specified, check help text for details.`)
95
108
  .description(`Save package locally.`)
96
- .addHelpText(`before`, `When no version is defined, it will automatically set to 1.0.0.
97
- Translation transport is only generated for packages that contain one or more objects with translations (unless skipped by flag).
98
- Customizing transport is only generated if a valid list of customizing transports is provided (unless skipped by flag).
109
+ .addHelpText(`before`, `When no version is defined, it will automatically set to 1.0.0.
110
+ Translation transport is only generated for packages that contain one or more objects with translations (unless skipped by flag).
111
+ Customizing transport is only generated if a valid list of customizing transports is provided (unless skipped by flag).
99
112
  If a default manifest with dependencies is provided in conjunction with the automatic dependency generation, results will be merged.`)
100
113
  .option(`-o, --output <<outputPath>>`, `Output path.`)
101
114
  .option(`-np, --noPrompts`, `No prompts (will force some decisions).`, false)
@@ -119,12 +132,16 @@ If a default manifest with dependencies is provided in conjunction with the auto
119
132
  requiresConnection: true,
120
133
  requiresTrmDependencies: true
121
134
  });
122
- const unpublish = program.command(`unpublish <package> [version]`)
135
+ const unpublish = program.command(`unpublish`)
136
+ .argument(`<package>`, `Name of the package to unpublish from registry.`)
137
+ .argument(`[version]`, `Optional: Version of the package to generate.`, `latest`)
123
138
  .description(`Unpublish a package release from registry.`);
124
139
  (0, utils_1.registerCommand)(unpublish, {
125
140
  requiresRegistry: true
126
141
  });
127
- const install = program.command(`install <package> [version]`)
142
+ const install = program.command(`install`)
143
+ .argument(`<package>`, `Name of the package to install.`)
144
+ .argument(`[version]`, `Optional: Version of the package to install.`, `latest`)
128
145
  .description(`Install package from registry into system.`)
129
146
  .addHelpText(`before`, `When no version is specified, the latest will be installed.`)
130
147
  .option(`-np, --noPrompts`, `No prompts (will force some decisions).`, false)
@@ -141,17 +158,19 @@ const install = program.command(`install <package> [version]`)
141
158
  .option(`-r3, --r3transPath <path>`, `R3trans program path. (default: Environment variable R3TRANS_HOME)`)
142
159
  .option(`-sha, --integrity <sha>`, `Package integrity.`)
143
160
  .option(`-tl, --transportLayer <transportLayer>`, `ABAP packages transport layer. (default: System default)`)
144
- .option(`-tl, --packageReplacements <JSON>`, `ABAP package replacements in JSON format.`)
161
+ .option(`-pr, --packageReplacements <JSON>`, `ABAP package replacements in JSON format.`)
145
162
  .option(`-itt, --installTransportTargetSys <transportTarget>`, `Install transport target system.`);
146
163
  (0, utils_1.registerCommand)(install, {
147
164
  requiresConnection: true,
148
165
  requiresRegistry: true,
149
166
  requiresTrmDependencies: true
150
167
  });
151
- const update = program.command(`update <package> [version]`)
152
- .description(`Update package from registry into system.`)
153
- .description(`Install package from registry into system.`)
154
- .addHelpText(`before`, `When no version is specified, the latest will be installed.`)
168
+ const update = program.command(`update`)
169
+ .argument(`[package]`, `Name of the package to update.`)
170
+ .argument(`[version]`, `Optional: Target package version to update.`)
171
+ .description(`Update trm-client / Update package from registry into system.`)
172
+ .addHelpText(`before`, `When no package name is specified, trm-client will self-update. All options are invalid, in this case.
173
+ When no version is specified, the latest will be installed.`)
155
174
  .option(`-np, --noPrompts`, `No prompts (will force some decisions).`, false)
156
175
  .option(`-sf, --safe`, `Safe install (needs package integrity).`, false)
157
176
  .option(`-nd, --noDependencies`, `Skip check/install of package dependencies.`, false)
@@ -165,7 +184,7 @@ const update = program.command(`update <package> [version]`)
165
184
  .option(`-r3, --r3transPath <path>`, `R3trans program path. (default: Environment variable R3TRANS_HOME)`)
166
185
  .option(`-sha, --integrity <sha>`, `Package integrity.`)
167
186
  .option(`-tl, --transportLayer <transportLayer>`, `ABAP packages transport layer. (default: System default)`)
168
- .option(`-tl, --packageReplacements <JSON>`, `ABAP package replacements in JSON format.`)
187
+ .option(`-pr, --packageReplacements <JSON>`, `ABAP package replacements in JSON format.`)
169
188
  .option(`-itt, --installTransportTargetSys <transportTarget>`, `Install transport target system.`);
170
189
  (0, utils_1.registerCommand)(update, {
171
190
  requiresConnection: true,
@@ -173,6 +192,7 @@ const update = program.command(`update <package> [version]`)
173
192
  requiresTrmDependencies: true
174
193
  });
175
194
  const _import = program.command(`import <file>`)
195
+ .argument(`<file>`, `Path or filename of the TRM package to import.`)
176
196
  .description(`Import a package (as a file) into system.`)
177
197
  .option(`-np, --noPrompts`, `No prompts (will force some decisions).`, false)
178
198
  .option(`-ow, --overwrite`, `Overwrite installation (allow re-install).`, false)
@@ -188,15 +208,16 @@ const _import = program.command(`import <file>`)
188
208
  .option(`-r3, --r3transPath <path>`, `R3trans program path. (default: Environment variable R3TRANS_HOME)`)
189
209
  .option(`-sha, --integrity <sha>`, `Package integrity.`)
190
210
  .option(`-tl, --transportLayer <transportLayer>`, `ABAP packages transport layer. (default: System default)`)
191
- .option(`-tl, --packageReplacements <JSON>`, `ABAP package replacements in JSON format.`)
211
+ .option(`-pr, --packageReplacements <JSON>`, `ABAP package replacements in JSON format.`)
192
212
  .option(`-itt, --installTransportTargetSys <transportTarget>`, `Install transport target system.`);
193
213
  (0, utils_1.registerCommand)(_import, {
194
214
  requiresConnection: true,
195
215
  requiresTrmDependencies: true
196
216
  });
197
- const view = program.command(`view <package>`)
217
+ const view = program.command(`view`)
218
+ .argument(`<package>`, `Name of the package to view.`)
198
219
  .description(`View package.`)
199
- .addHelpText(`before`, `Shows package details.
220
+ .addHelpText(`before`, `Shows package details.
200
221
  If the package is not found on the system, it will automatically fall back to the data provided by the registry, granted it exists.`);
201
222
  (0, utils_1.registerCommand)(view, {
202
223
  requiresConnection: true,
@@ -204,14 +225,17 @@ If the package is not found on the system, it will automatically fall back to th
204
225
  requiresRegistry: true,
205
226
  ignoreRegistryUnreachable: true
206
227
  });
207
- const compare = program.command(`compare <package>`)
228
+ const compare = program.command(`compare`)
229
+ .argument(`<package>`, `Name of the package to compare.`)
208
230
  .description(`Compare a package on different systems.`)
209
231
  .option(`-c, --connections <json>`, `Path to JSON file or JSON containing an array of aliases.`);
210
232
  (0, utils_1.registerCommand)(compare, {
211
233
  requiresRegistry: true,
212
234
  ignoreRegistryUnreachable: true
213
235
  });
214
- const content = program.command(`content <package> [version]`)
236
+ const content = program.command(`content`)
237
+ .argument(`<package>`, `Name of the package.`)
238
+ .argument(`[version]`, `Optional: Version of the package`)
215
239
  .description(`List content of a package.`)
216
240
  .option(`-a, --all`, `List all content`, false)
217
241
  .option(`-r3, --r3transPath <path>`, `R3trans program path. (default: Environment variable R3TRANS_HOME)`);
@@ -224,15 +248,17 @@ const list = program.command(`list`)
224
248
  (0, utils_1.registerCommand)(list, {
225
249
  requiresConnection: true
226
250
  });
227
- const check = program.command(`check <package>`)
251
+ const check = program.command(`check`)
252
+ .argument(`<package>`, `Name of the package to check.`)
228
253
  .description(`Analyze installed package status on a system.`)
229
- .option(`-at, --analysisType`, `Analysis type (DEPENDENCIES, SAPENTRIES or ALL).`);
254
+ .option(`-at, --analysisType`, `Analysis type (DEPENDENCIES, SAPENTRIES or ALL).`, `DEPENDENCIES`);
230
255
  (0, utils_1.registerCommand)(check, {
231
256
  requiresConnection: true,
232
257
  requiresRegistry: true,
233
258
  ignoreRegistryUnreachable: true
234
259
  });
235
- const findDependencies = program.command(`findDependencies <devclass>`)
260
+ const findDependencies = program.command(`findDependencies`)
261
+ .argument(`<devclass>`, `Name of the SAP package to check.`)
236
262
  .description(`Find SAP package dependencies with custom packages/trm packages/SAP entries/objects.`)
237
263
  .option(`-se, --sapEntries`, `Show list of required SAP entries/objects.`, false)
238
264
  .option(`-np, --noPrompts`, `No prompts (will force some decisions).`, false);
@@ -1,5 +1,5 @@
1
1
  import { ISystemConnector, SystemConnectorSupportedBulk, TADIR } from "trm-core";
2
- export declare class NoConnection implements ISystemConnector {
2
+ export declare class DummyConnector implements ISystemConnector {
3
3
  _throw(): any;
4
4
  supportedBulk: SystemConnectorSupportedBulk;
5
5
  getConnectionData: () => any;
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.NoConnection = void 0;
13
- class NoConnection {
12
+ exports.DummyConnector = void 0;
13
+ class DummyConnector {
14
14
  constructor() {
15
15
  this.supportedBulk = {
16
16
  getExistingObjects: false,
@@ -106,4 +106,4 @@ class NoConnection {
106
106
  return null;
107
107
  }
108
108
  }
109
- exports.NoConnection = NoConnection;
109
+ exports.DummyConnector = DummyConnector;
@@ -29,7 +29,7 @@ function checkCliUpdate(print) {
29
29
  trm_commons_1.Logger.warning(`A newer release of trm-client (v${chalk_1.default.bold(latestVersion)}) is available.`);
30
30
  trm_commons_1.Logger.warning(`New releases can introduce features and bug fixes.`);
31
31
  trm_commons_1.Logger.warning(`It is recommended to update your client by running the command`);
32
- trm_commons_1.Logger.warning(` npm update trm-client --global`);
32
+ trm_commons_1.Logger.warning(` ${chalk_1.default.bold('trm update')})`);
33
33
  trm_commons_1.Logger.warning(` `);
34
34
  }
35
35
  }
@@ -46,6 +46,7 @@ exports.InquirerType = exports.LoggerType = void 0;
46
46
  exports.executeCommand = executeCommand;
47
47
  const commands = __importStar(require("../commands"));
48
48
  const Core = __importStar(require("trm-core"));
49
+ const Commons = __importStar(require("trm-commons"));
49
50
  const systemAlias_1 = require("../systemAlias");
50
51
  const logError_1 = require("./logError");
51
52
  const checkTrmDependencies_1 = require("./checkTrmDependencies");
@@ -92,6 +93,7 @@ function executeCommand(args) {
92
93
  try {
93
94
  yield Context_1.Context.getInstance().load();
94
95
  yield trm_commons_1.Plugin.call("client", "loadCore", { core: Core });
96
+ yield trm_commons_1.Plugin.call("client", "loadCommons", { commons: Commons });
95
97
  trm_commons_1.Inquirer.inquirer = _getInquirer(InquirerType.CLI);
96
98
  trm_commons_1.Logger.logger = _getLogger(args.logType, args.debug, args.logOutputFolder);
97
99
  if (process.platform !== 'win32' && process.platform !== 'darwin') {
@@ -102,7 +104,9 @@ function executeCommand(args) {
102
104
  const requiresRegistry = args.requiresRegistry;
103
105
  const registryAuthBlacklist = args.registryAuthBlacklist;
104
106
  const ignoreRegistryUnreachable = args.ignoreRegistryUnreachable;
105
- yield (0, checkCliUpdate_1.checkCliUpdate)(true);
107
+ if (args.checkUpdate) {
108
+ yield (0, checkCliUpdate_1.checkCliUpdate)(true);
109
+ }
106
110
  if (requiresRegistry) {
107
111
  var registryAlias;
108
112
  var registry;
@@ -12,7 +12,7 @@ export * from "./getClientVersion";
12
12
  export * from "./getTempFolder";
13
13
  export * from "./getLogFolder";
14
14
  export * from "./getClientNodeDependencies";
15
- export * from "./NoConnection";
15
+ export * from "./DummyConnector";
16
16
  export * from "./getNpmPackageLatestVersion";
17
17
  export * from "./SettingsData";
18
18
  export * from "./Context";
@@ -28,7 +28,7 @@ __exportStar(require("./getClientVersion"), exports);
28
28
  __exportStar(require("./getTempFolder"), exports);
29
29
  __exportStar(require("./getLogFolder"), exports);
30
30
  __exportStar(require("./getClientNodeDependencies"), exports);
31
- __exportStar(require("./NoConnection"), exports);
31
+ __exportStar(require("./DummyConnector"), exports);
32
32
  __exportStar(require("./getNpmPackageLatestVersion"), exports);
33
33
  __exportStar(require("./SettingsData"), exports);
34
34
  __exportStar(require("./Context"), exports);
@@ -51,6 +51,7 @@ function registerCommand(command, args) {
51
51
  command.action((arg1, arg2) => __awaiter(this, void 0, void 0, function* () {
52
52
  var args = Object.assign({
53
53
  command: commandName,
54
+ checkUpdate: true,
54
55
  requiresConnection,
55
56
  addNoConnection,
56
57
  requiresTrmDependencies,
@@ -80,6 +81,13 @@ function registerCommand(command, args) {
80
81
  else {
81
82
  args = Object.assign(Object.assign({}, args), arg1);
82
83
  }
84
+ if (args.command === 'update' && !args.package) {
85
+ args.command = 'selfUpdate';
86
+ delete args.requiresConnection;
87
+ delete args.requiresRegistry;
88
+ delete args.requiresTrmDependencies;
89
+ delete args.checkUpdate;
90
+ }
83
91
  yield (0, executeCommand_1.executeCommand)(args);
84
92
  }));
85
93
  }
package/package.json CHANGED
@@ -1,62 +1,63 @@
1
- {
2
- "name": "trm-client",
3
- "version": "5.0.0",
4
- "description": "TRM (Transport Request Manager) Client",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "files": [
8
- "changelog.txt",
9
- "dist",
10
- "!dist/test.js",
11
- "!dist/test.js.map",
12
- "!dist/test.d.ts",
13
- "!dist/.env",
14
- "!dist/dev_rfc.log"
15
- ],
16
- "bin": {
17
- "trm": "dist/index.js"
18
- },
19
- "scripts": {
20
- "cleanBuild": "rimraf dist/",
21
- "build": "npm run cleanBuild && tsc --sourceMap false",
22
- "prepublishOnly": "npm run build"
23
- },
24
- "keywords": [
25
- "trm",
26
- "abap"
27
- ],
28
- "homepage": "https://www.trmregistry.com",
29
- "repository": {
30
- "type": "git",
31
- "url": "git+https://github.com/RegestaItalia/trm-client.git"
32
- },
33
- "author": {
34
- "name": "Simone Gaffurini",
35
- "email": "simone.gaffurini@regestaitalia.it"
36
- },
37
- "license": "MIT",
38
- "dependencies": {
39
- "@esm2cjs/normalize-url": "^8.0.0",
40
- "chalk": "^4.1.2",
41
- "commander": "^11.0.0",
42
- "dotenv": "^16.3.1",
43
- "get-latest-version": "^5.1.0",
44
- "get-root-path": "^2.0.2",
45
- "ini": "^4.1.1",
46
- "semver": "^7.5.4",
47
- "trm-core": "^7.5.1",
48
- "trm-registry-types": "^1.2.0",
49
- "trm-commons": "^3.2.0",
50
- "xml2js": "^0.6.2"
51
- },
52
- "peerDependencies": {
53
- "trm-commons": "^3.2.0"
54
- },
55
- "devDependencies": {
56
- "@types/ini": "^1.3.31",
57
- "@types/node": "^20.4.8",
58
- "@types/semver": "^7.5.3",
59
- "@types/xml2js": "^0.4.11",
60
- "rimraf": "^6.0.1"
61
- }
62
- }
1
+ {
2
+ "name": "trm-client",
3
+ "version": "5.0.2",
4
+ "description": "TRM (Transport Request Manager) Client",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "changelog.txt",
9
+ "dist",
10
+ "!dist/test.js",
11
+ "!dist/test.js.map",
12
+ "!dist/test.d.ts",
13
+ "!dist/.env",
14
+ "!dist/dev_rfc.log"
15
+ ],
16
+ "bin": {
17
+ "trm": "dist/index.js"
18
+ },
19
+ "scripts": {
20
+ "cleanBuild": "rimraf dist/",
21
+ "build": "npm run cleanBuild && tsc --sourceMap false",
22
+ "prepublishOnly": "npm run build"
23
+ },
24
+ "keywords": [
25
+ "trm",
26
+ "abap"
27
+ ],
28
+ "homepage": "https://www.trmregistry.com",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/RegestaItalia/trm-client.git"
32
+ },
33
+ "author": {
34
+ "name": "Simone Gaffurini",
35
+ "email": "simone.gaffurini@regestaitalia.it"
36
+ },
37
+ "license": "MIT",
38
+ "dependencies": {
39
+ "@esm2cjs/normalize-url": "^8.0.0",
40
+ "chalk": "^4.1.2",
41
+ "commander": "^11.0.0",
42
+ "dotenv": "^16.3.1",
43
+ "execa": "^9.6.0",
44
+ "get-latest-version": "^5.1.0",
45
+ "get-root-path": "^2.0.2",
46
+ "ini": "^4.1.1",
47
+ "semver": "^7.5.4",
48
+ "trm-commons": "^3.2.0",
49
+ "trm-core": "^7.5.1",
50
+ "trm-registry-types": "^1.2.0",
51
+ "xml2js": "^0.6.2"
52
+ },
53
+ "peerDependencies": {
54
+ "trm-commons": "^3.2.0"
55
+ },
56
+ "devDependencies": {
57
+ "@types/ini": "^1.3.31",
58
+ "@types/node": "^20.4.8",
59
+ "@types/semver": "^7.5.3",
60
+ "@types/xml2js": "^0.4.11",
61
+ "rimraf": "^6.0.1"
62
+ }
63
+ }