trm-client 5.0.1 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +65 -65
- package/changelog.txt +127 -104
- package/dist/commands/alias.js +3 -1
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.js +1 -0
- package/dist/commands/info.js +27 -2
- package/dist/commands/prompts/connect.js +11 -1
- package/dist/commands/selfUpdate.d.ts +1 -0
- package/dist/commands/selfUpdate.js +77 -0
- package/dist/commands/view.js +2 -2
- package/dist/index.js +62 -36
- package/dist/utils/Context.d.ts +2 -0
- package/dist/utils/Context.js +29 -6
- package/dist/utils/{NoConnection.d.ts → DummyConnector.d.ts} +1 -1
- package/dist/utils/{NoConnection.js → DummyConnector.js} +3 -3
- package/dist/utils/SettingsData.d.ts +2 -0
- package/dist/utils/checkCliUpdate.js +1 -1
- package/dist/utils/executeCommand.js +3 -1
- package/dist/utils/getSapLogonConnections.js +28 -30
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/registerCommand.js +8 -0
- package/package.json +63 -62
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
|
-
[](https://github.com/RegestaItalia/trm-docs/blob/main/CODE_OF_CONDUCT.md)
|
|
4
|
-
[](https://github.com/RegestaItalia/trm-client)
|
|
5
|
-
[](https://www.npmjs.com/package/trm-client)
|
|
6
|
-
[](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
|
+
[](https://github.com/RegestaItalia/trm-docs/blob/main/CODE_OF_CONDUCT.md)
|
|
4
|
+
[](https://github.com/RegestaItalia/trm-client)
|
|
5
|
+
[](https://www.npmjs.com/package/trm-client)
|
|
6
|
+
[](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,128 @@
|
|
|
1
|
-
trm-client changelog
|
|
2
|
-
=================
|
|
3
|
-
|
|
4
|
-
Legend
|
|
5
|
-
------
|
|
6
|
-
* : fixed
|
|
7
|
-
! : changed
|
|
8
|
-
+ : added
|
|
9
|
-
- : removed
|
|
10
|
-
|
|
11
|
-
2025-09-
|
|
12
|
-
-------------------
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
!
|
|
16
|
-
!
|
|
17
|
-
|
|
18
|
-
+
|
|
19
|
-
!
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
+
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
! trm-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
!
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
! trm-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
!
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
1
|
+
trm-client changelog
|
|
2
|
+
=================
|
|
3
|
+
|
|
4
|
+
Legend
|
|
5
|
+
------
|
|
6
|
+
* : fixed
|
|
7
|
+
! : changed
|
|
8
|
+
+ : added
|
|
9
|
+
- : removed
|
|
10
|
+
|
|
11
|
+
2025-09-24 v5.1.0
|
|
12
|
+
-------------------
|
|
13
|
+
|
|
14
|
+
* alias command view/edit
|
|
15
|
+
! npm global path in settings
|
|
16
|
+
! sap landscape in settings
|
|
17
|
+
* sap landscape for mac
|
|
18
|
+
+ add plugins in info command
|
|
19
|
+
! trm-commons ^3.3.2
|
|
20
|
+
! trm-core ^7.5.3
|
|
21
|
+
|
|
22
|
+
2025-09-09 v5.0.2
|
|
23
|
+
-------------------
|
|
24
|
+
|
|
25
|
+
* fix no connection
|
|
26
|
+
+ fallback text for node-rfc and node-r3trans not found in info command
|
|
27
|
+
+ update command now self updates the client if ran without arguments
|
|
28
|
+
|
|
29
|
+
2025-09-03 v5.0.1
|
|
30
|
+
-------------------
|
|
31
|
+
|
|
32
|
+
+ plugin loadCommons
|
|
33
|
+
|
|
34
|
+
2025-09-03 v5.0.0
|
|
35
|
+
-------------------
|
|
36
|
+
|
|
37
|
+
! trm-core ^7.5.1
|
|
38
|
+
! trm-commons ^3.2.0
|
|
39
|
+
! moved settings to context
|
|
40
|
+
+ plugin calls
|
|
41
|
+
+ gracefully close connection
|
|
42
|
+
! moved connection prompts to commons
|
|
43
|
+
|
|
44
|
+
2025-08-13 v4.10.0
|
|
45
|
+
-------------------
|
|
46
|
+
|
|
47
|
+
! trm-core ^7.4.5
|
|
48
|
+
+ support for darwin os
|
|
49
|
+
+ support for r3trans dockerized
|
|
50
|
+
|
|
51
|
+
2025-07-30 v4.9.2
|
|
52
|
+
-------------------
|
|
53
|
+
|
|
54
|
+
! trm-commons ^2.0.0 as peer dependency and dependency
|
|
55
|
+
|
|
56
|
+
2025-07-29 v4.9.1
|
|
57
|
+
-------------------
|
|
58
|
+
|
|
59
|
+
! trm-core ^7.4.1
|
|
60
|
+
! trm-commons ^2.0.0
|
|
61
|
+
|
|
62
|
+
2025-07-29 v4.9.0
|
|
63
|
+
-------------------
|
|
64
|
+
|
|
65
|
+
+ handle registry unauthorized error
|
|
66
|
+
! trm-core ^7.4.0
|
|
67
|
+
! trm-commons ^1.1.0
|
|
68
|
+
|
|
69
|
+
2025-06-04 v4.8.0
|
|
70
|
+
-------------------
|
|
71
|
+
|
|
72
|
+
! trm-core ^7.2.1
|
|
73
|
+
! overwrite flag in install/update ignores existing objects replace
|
|
74
|
+
|
|
75
|
+
2025-06-03 v4.7.0
|
|
76
|
+
-------------------
|
|
77
|
+
|
|
78
|
+
! trm-core ^7.0.0
|
|
79
|
+
|
|
80
|
+
2025-05-29 v4.6.1
|
|
81
|
+
-------------------
|
|
82
|
+
|
|
83
|
+
! logging error changes
|
|
84
|
+
! trm-core ^6.9.0
|
|
85
|
+
+ landscape transport to list and view command
|
|
86
|
+
|
|
87
|
+
2025-05-08 v4.6.0
|
|
88
|
+
-------------------
|
|
89
|
+
|
|
90
|
+
! trm-core ^6.8.0
|
|
91
|
+
* saprouter in alias
|
|
92
|
+
|
|
93
|
+
2025-05-08 v4.5.0
|
|
94
|
+
-------------------
|
|
95
|
+
|
|
96
|
+
! trm-core ^6.7.0
|
|
97
|
+
! error handling
|
|
98
|
+
* alias command/saprouter alias save
|
|
99
|
+
* fix connection validators
|
|
100
|
+
|
|
101
|
+
2025-04-28 v4.4.1
|
|
102
|
+
-------------------
|
|
103
|
+
|
|
104
|
+
* node-r3trans version read
|
|
105
|
+
|
|
106
|
+
2025-04-28 v4.4.0
|
|
107
|
+
-------------------
|
|
108
|
+
|
|
109
|
+
! trm-core ^6.5.0
|
|
110
|
+
! trm-commons ^1.0.0
|
|
111
|
+
|
|
112
|
+
2025-04-28 v4.3.0
|
|
113
|
+
-------------------
|
|
114
|
+
|
|
115
|
+
! trm-core ^6.4.1
|
|
116
|
+
|
|
117
|
+
2025-04-23 v4.2.1
|
|
118
|
+
-------------------
|
|
119
|
+
|
|
120
|
+
* node-r3trans version read
|
|
121
|
+
|
|
122
|
+
2025-02-26 v4.2.0
|
|
123
|
+
-------------------
|
|
124
|
+
|
|
125
|
+
! connect to registry via option
|
|
126
|
+
- trm dependencies on client
|
|
127
|
+
+ content command
|
|
105
128
|
+ pack/import command
|
package/dist/commands/alias.js
CHANGED
|
@@ -31,6 +31,7 @@ const _view = (alias) => {
|
|
|
31
31
|
if (!connection) {
|
|
32
32
|
throw new Error(`Unknown connection type "${alias.type}".`);
|
|
33
33
|
}
|
|
34
|
+
connection.setData(alias.data);
|
|
34
35
|
if (connection.logData) {
|
|
35
36
|
connection.logData();
|
|
36
37
|
}
|
|
@@ -57,9 +58,10 @@ const _edit = (alias) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
57
58
|
noSystemAlias: true,
|
|
58
59
|
force: true
|
|
59
60
|
}), false);
|
|
61
|
+
const newData = connectionArgs.getData();
|
|
60
62
|
try {
|
|
61
63
|
systemAlias_1.SystemAlias.delete(alias.alias);
|
|
62
|
-
yield systemAlias_1.SystemAlias.create(alias.alias, connectionArgs.name,
|
|
64
|
+
yield systemAlias_1.SystemAlias.create(alias.alias, connectionArgs.name, newData).getConnection().connect();
|
|
63
65
|
}
|
|
64
66
|
catch (e) {
|
|
65
67
|
connectionSuccess = false;
|
package/dist/commands/index.d.ts
CHANGED
package/dist/commands/index.js
CHANGED
package/dist/commands/info.js
CHANGED
|
@@ -69,7 +69,7 @@ const _getNpmLatestForText = (packageName, installedVersion, text) => __awaiter(
|
|
|
69
69
|
function info(commandArgs) {
|
|
70
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
71
|
trm_commons_1.Logger.loading(`Reading data...`);
|
|
72
|
-
const npmGlobal =
|
|
72
|
+
const npmGlobal = utils_1.Context.getInstance().settings.globalNodeModules;
|
|
73
73
|
const clientLatest = yield (0, utils_1.checkCliUpdate)(false);
|
|
74
74
|
const clientVersion = (0, utils_1.getClientVersion)();
|
|
75
75
|
const clientDependencies = (0, utils_1.getClientNodeDependencies)();
|
|
@@ -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,8 +204,21 @@ 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.
|
|
207
|
+
if (!(trm_core_1.SystemConnector.systemConnector instanceof utils_1.DummyConnector)) {
|
|
196
208
|
trm_commons_1.Logger.tree(serverTree);
|
|
197
209
|
}
|
|
210
|
+
const pluginsTree = {
|
|
211
|
+
text: chalk_1.default.bold(`Plugins`),
|
|
212
|
+
children: []
|
|
213
|
+
};
|
|
214
|
+
utils_1.Context.getInstance().plugins.forEach(p => {
|
|
215
|
+
pluginsTree.children.push({
|
|
216
|
+
text: p,
|
|
217
|
+
children: []
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
if (pluginsTree.children.length > 0) {
|
|
221
|
+
trm_commons_1.Logger.tree(pluginsTree);
|
|
222
|
+
}
|
|
198
223
|
});
|
|
199
224
|
}
|
|
@@ -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
|
|
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
|
+
}
|
package/dist/commands/view.js
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
12
|
-
|
|
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
|
|
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
|
|
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
|
|
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>`, `
|
|
32
|
+
.option(`-a, --authentication <authentication>`, `Authentication as a valid JSON string.`);
|
|
25
33
|
(0, utils_1.registerCommand)(addRegistry);
|
|
26
|
-
const removeRegistry = program.command(`removeRegistry
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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(`-
|
|
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
|
|
152
|
-
.
|
|
153
|
-
.
|
|
154
|
-
.
|
|
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(`-
|
|
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(`-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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);
|
package/dist/utils/Context.d.ts
CHANGED
|
@@ -4,10 +4,12 @@ export declare class Context {
|
|
|
4
4
|
private static _instance;
|
|
5
5
|
settings: SettingsData;
|
|
6
6
|
connections: IConnect[];
|
|
7
|
+
plugins: string[];
|
|
7
8
|
constructor();
|
|
8
9
|
load(): Promise<void>;
|
|
9
10
|
setSetting(key: string, value: string): void;
|
|
10
11
|
private getSettingsFilePath;
|
|
12
|
+
private getDefaultSettings;
|
|
11
13
|
private getSettings;
|
|
12
14
|
private generateSettingsFile;
|
|
13
15
|
static getInstance(): Context;
|
package/dist/utils/Context.js
CHANGED
|
@@ -53,10 +53,6 @@ const ini = __importStar(require("ini"));
|
|
|
53
53
|
const trm_commons_1 = require("trm-commons");
|
|
54
54
|
const trm_core_1 = require("trm-core");
|
|
55
55
|
const SETTINGS_FILE_NAME = "settings.ini";
|
|
56
|
-
const defaultSettings = {
|
|
57
|
-
loggerType: 'CLI',
|
|
58
|
-
logOutputFolder: 'default'
|
|
59
|
-
};
|
|
60
56
|
class RESTConnectExtended extends trm_commons_1.RESTConnect {
|
|
61
57
|
getSystemConnector() {
|
|
62
58
|
const data = this.getData();
|
|
@@ -66,7 +62,7 @@ class RESTConnectExtended extends trm_commons_1.RESTConnect {
|
|
|
66
62
|
class RFCConnectExtended extends trm_commons_1.RFCConnect {
|
|
67
63
|
getSystemConnector() {
|
|
68
64
|
const data = this.getData();
|
|
69
|
-
return new trm_core_1.RFCSystemConnector(data, data, (0, _1.getTempFolder)());
|
|
65
|
+
return new trm_core_1.RFCSystemConnector(data, data, (0, _1.getTempFolder)(), Context.getInstance().settings.globalNodeModules);
|
|
70
66
|
}
|
|
71
67
|
}
|
|
72
68
|
class Context {
|
|
@@ -81,7 +77,10 @@ class Context {
|
|
|
81
77
|
}
|
|
82
78
|
load() {
|
|
83
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
-
yield trm_commons_1.Plugin.load(
|
|
80
|
+
const plugins = yield trm_commons_1.Plugin.load({
|
|
81
|
+
globalNodeModulesPath: this.settings.globalNodeModules
|
|
82
|
+
});
|
|
83
|
+
this.plugins = [...new Set(plugins)];
|
|
85
84
|
if (!this.connections) {
|
|
86
85
|
this.connections = yield trm_commons_1.Plugin.call("client", "onContextLoadConnections", [new RESTConnectExtended(), new RFCConnectExtended()]);
|
|
87
86
|
}
|
|
@@ -98,16 +97,40 @@ class Context {
|
|
|
98
97
|
getSettingsFilePath() {
|
|
99
98
|
return path_1.default.join((0, _1.getRoamingFolder)(), SETTINGS_FILE_NAME);
|
|
100
99
|
}
|
|
100
|
+
getDefaultSettings() {
|
|
101
|
+
var sapLandscape = path_1.default.join((0, _1.getRoamingPath)(), process.platform === 'win32' ? 'SAP\\Common\\SAPUILandscape.xml' : 'SAP/SAPGUILandscape.xml');
|
|
102
|
+
if (!fs.existsSync(sapLandscape)) {
|
|
103
|
+
sapLandscape = undefined;
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
loggerType: 'CLI',
|
|
107
|
+
logOutputFolder: 'default',
|
|
108
|
+
globalNodeModules: (0, trm_commons_1.getGlobalNodeModules)() || '',
|
|
109
|
+
sapLandscape
|
|
110
|
+
};
|
|
111
|
+
}
|
|
101
112
|
getSettings() {
|
|
113
|
+
var defaultSettings;
|
|
102
114
|
const filePath = this.getSettingsFilePath();
|
|
103
115
|
if (fs.existsSync(filePath)) {
|
|
104
116
|
try {
|
|
105
117
|
const sIni = fs.readFileSync(filePath).toString();
|
|
106
118
|
const settingsData = ini.decode(sIni);
|
|
119
|
+
if (!settingsData.globalNodeModules || !settingsData.sapLandscape) {
|
|
120
|
+
defaultSettings = this.getDefaultSettings();
|
|
121
|
+
if (!settingsData.globalNodeModules) {
|
|
122
|
+
settingsData.globalNodeModules = defaultSettings.globalNodeModules;
|
|
123
|
+
}
|
|
124
|
+
if (!settingsData.sapLandscape) {
|
|
125
|
+
settingsData.sapLandscape = defaultSettings.sapLandscape;
|
|
126
|
+
}
|
|
127
|
+
this.generateSettingsFile(settingsData, filePath);
|
|
128
|
+
}
|
|
107
129
|
return settingsData;
|
|
108
130
|
}
|
|
109
131
|
catch (e) { }
|
|
110
132
|
}
|
|
133
|
+
defaultSettings = this.getDefaultSettings();
|
|
111
134
|
this.generateSettingsFile(defaultSettings, filePath);
|
|
112
135
|
return defaultSettings;
|
|
113
136
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ISystemConnector, SystemConnectorSupportedBulk, TADIR } from "trm-core";
|
|
2
|
-
export declare class
|
|
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.
|
|
13
|
-
class
|
|
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.
|
|
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(`
|
|
32
|
+
trm_commons_1.Logger.warning(` ${chalk_1.default.bold('trm update')})`);
|
|
33
33
|
trm_commons_1.Logger.warning(` `);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -104,7 +104,9 @@ function executeCommand(args) {
|
|
|
104
104
|
const requiresRegistry = args.requiresRegistry;
|
|
105
105
|
const registryAuthBlacklist = args.registryAuthBlacklist;
|
|
106
106
|
const ignoreRegistryUnreachable = args.ignoreRegistryUnreachable;
|
|
107
|
-
|
|
107
|
+
if (args.checkUpdate) {
|
|
108
|
+
yield (0, checkCliUpdate_1.checkCliUpdate)(true);
|
|
109
|
+
}
|
|
108
110
|
if (requiresRegistry) {
|
|
109
111
|
var registryAlias;
|
|
110
112
|
var registry;
|
|
@@ -41,46 +41,44 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
41
41
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
|
-
};
|
|
47
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
45
|
exports.getSapLogonConnections = getSapLogonConnections;
|
|
49
|
-
const path_1 = __importDefault(require("path"));
|
|
50
46
|
const fs = __importStar(require("fs"));
|
|
51
47
|
const xml2js_1 = require("./xml2js");
|
|
52
|
-
const
|
|
48
|
+
const Context_1 = require("./Context");
|
|
53
49
|
function getSapLogonConnections() {
|
|
54
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
const landscapePath = path_1.default.join((0, getRoamingPath_1.getRoamingPath)(), `SAP\\Common\\SAPUILandscape.xml`);
|
|
56
|
-
const sXml = fs.readFileSync(landscapePath, { encoding: 'utf8', flag: 'r' });
|
|
57
|
-
const result = yield (0, xml2js_1.xml2js)(sXml);
|
|
58
51
|
var systems = [];
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
52
|
+
const sapLandscape = Context_1.Context.getInstance().settings.sapLandscape;
|
|
53
|
+
if (sapLandscape) {
|
|
54
|
+
const sXml = fs.readFileSync(Context_1.Context.getInstance().settings.sapLandscape, { encoding: 'utf8', flag: 'r' });
|
|
55
|
+
const result = yield (0, xml2js_1.xml2js)(sXml);
|
|
56
|
+
try {
|
|
57
|
+
result.Landscape.Services[0].Service.forEach((xmlObj) => {
|
|
58
|
+
var obj = xmlObj['$'];
|
|
59
|
+
var addrMatches = obj.server.match(/(.*)\:(\d*)$/);
|
|
60
|
+
var ashost = addrMatches[1];
|
|
61
|
+
var port = addrMatches[2];
|
|
62
|
+
var sysnr = port.slice(-2);
|
|
63
|
+
var saprouter;
|
|
64
|
+
if (obj.routerid) {
|
|
65
|
+
const router = result.Landscape.Routers[0].Router.find((o) => o['$'].uuid === obj.routerid);
|
|
66
|
+
if (router) {
|
|
67
|
+
saprouter = router['$'].router;
|
|
68
|
+
}
|
|
71
69
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
systems.push({
|
|
71
|
+
id: obj.uuid,
|
|
72
|
+
name: obj.name,
|
|
73
|
+
dest: obj.systemid,
|
|
74
|
+
sysnr,
|
|
75
|
+
ashost,
|
|
76
|
+
saprouter
|
|
77
|
+
});
|
|
80
78
|
});
|
|
81
|
-
}
|
|
79
|
+
}
|
|
80
|
+
catch (_a) { }
|
|
82
81
|
}
|
|
83
|
-
catch (e) { }
|
|
84
82
|
return systems;
|
|
85
83
|
});
|
|
86
84
|
}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -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 "./
|
|
15
|
+
export * from "./DummyConnector";
|
|
16
16
|
export * from "./getNpmPackageLatestVersion";
|
|
17
17
|
export * from "./SettingsData";
|
|
18
18
|
export * from "./Context";
|
package/dist/utils/index.js
CHANGED
|
@@ -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("./
|
|
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
|
|
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
|
-
"
|
|
44
|
-
"get-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"trm-
|
|
49
|
-
"trm-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"@types/
|
|
58
|
-
"@types/
|
|
59
|
-
"@types/
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "trm-client",
|
|
3
|
+
"version": "5.1.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
|
+
"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.3.2",
|
|
49
|
+
"trm-core": "^7.5.3",
|
|
50
|
+
"trm-registry-types": "^1.2.0",
|
|
51
|
+
"xml2js": "^0.6.2"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"trm-commons": "^3.3.2"
|
|
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
|
+
}
|