trm-client 4.9.2 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +65 -65
- package/changelog.txt +104 -87
- package/dist/commands/alias.js +12 -125
- package/dist/commands/arguments/ConnectArguments.d.ts +1 -2
- package/dist/commands/compare.js +5 -46
- package/dist/commands/content.js +5 -1
- package/dist/commands/createAlias.js +14 -44
- package/dist/commands/import.js +5 -1
- package/dist/commands/install.js +5 -1
- package/dist/commands/prompts/connect.d.ts +2 -1
- package/dist/commands/prompts/connect.js +82 -201
- package/dist/commands/settings.js +3 -3
- package/dist/index.js +11 -11
- package/dist/systemAlias/SystemAlias.d.ts +9 -9
- package/dist/systemAlias/SystemAlias.js +67 -102
- package/dist/systemAlias/SystemAliasData.d.ts +2 -5
- package/dist/utils/Context.d.ts +14 -0
- package/dist/utils/Context.js +125 -0
- package/dist/utils/NoConnection.d.ts +1 -0
- package/dist/utils/NoConnection.js +1 -0
- package/dist/{settings → utils}/SettingsData.d.ts +2 -0
- package/dist/utils/executeCommand.js +17 -4
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/registerCommand.js +4 -4
- package/package.json +62 -62
- package/dist/settings/Settings.d.ts +0 -11
- package/dist/settings/Settings.js +0 -88
- package/dist/settings/index.d.ts +0 -2
- package/dist/settings/index.js +0 -18
- package/dist/utils/getSystemConnector.d.ts +0 -9
- package/dist/utils/getSystemConnector.js +0 -32
- /package/dist/{settings → utils}/SettingsData.js +0 -0
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,88 +1,105 @@
|
|
|
1
|
-
trm-client changelog
|
|
2
|
-
=================
|
|
3
|
-
|
|
4
|
-
Legend
|
|
5
|
-
------
|
|
6
|
-
* : fixed
|
|
7
|
-
! : changed
|
|
8
|
-
+ : added
|
|
9
|
-
- : removed
|
|
10
|
-
|
|
11
|
-
2025-
|
|
12
|
-
-------------------
|
|
13
|
-
|
|
14
|
-
! trm-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
!
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
+
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
!
|
|
44
|
-
! trm-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
!
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
|
88
105
|
+ pack/import command
|
package/dist/commands/alias.js
CHANGED
|
@@ -11,10 +11,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.alias = alias;
|
|
13
13
|
const systemAlias_1 = require("../systemAlias");
|
|
14
|
+
const utils_1 = require("../utils");
|
|
14
15
|
const createAlias_1 = require("./createAlias");
|
|
15
16
|
const deleteAlias_1 = require("./deleteAlias");
|
|
16
17
|
const prompts_1 = require("./prompts");
|
|
17
|
-
const utils_1 = require("../utils");
|
|
18
18
|
const trm_commons_1 = require("trm-commons");
|
|
19
19
|
const _create = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
20
|
const inq1 = yield trm_commons_1.Inquirer.prompt({
|
|
@@ -27,88 +27,23 @@ const _create = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
29
|
const _view = (alias) => {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const hasPassword = alias.login.passwd ? true : false;
|
|
34
|
-
if (alias.type === utils_1.SystemConnectorType.RFC) {
|
|
35
|
-
const dest = alias.connection.dest;
|
|
36
|
-
const ashost = alias.connection.ashost;
|
|
37
|
-
const sysnr = alias.connection.sysnr;
|
|
38
|
-
const saprouter = alias.connection.saprouter;
|
|
39
|
-
const client = alias.login.client;
|
|
40
|
-
if (dest) {
|
|
41
|
-
trm_commons_1.Logger.info(`System ID: ${dest}`);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
trm_commons_1.Logger.warning(`System ID: Unknown`);
|
|
45
|
-
}
|
|
46
|
-
if (ashost) {
|
|
47
|
-
trm_commons_1.Logger.info(`Application server: ${ashost}`);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
trm_commons_1.Logger.warning(`Application server: Unknown`);
|
|
51
|
-
}
|
|
52
|
-
if (sysnr) {
|
|
53
|
-
trm_commons_1.Logger.info(`Instance number: ${sysnr}`);
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
trm_commons_1.Logger.warning(`Instance number: Unknown`);
|
|
57
|
-
}
|
|
58
|
-
if (saprouter) {
|
|
59
|
-
trm_commons_1.Logger.info(`SAProuter: ${saprouter}`);
|
|
60
|
-
}
|
|
61
|
-
if (client) {
|
|
62
|
-
trm_commons_1.Logger.info(`Logon client: ${client}`);
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
trm_commons_1.Logger.warning(`Logon client: Unknown`);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
else if (alias.type === utils_1.SystemConnectorType.REST) {
|
|
69
|
-
const endpoint = alias.connection.endpoint;
|
|
70
|
-
const rfcdest = alias.connection.rfcdest;
|
|
71
|
-
if (endpoint) {
|
|
72
|
-
trm_commons_1.Logger.info(`System endpoint: ${endpoint}`);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
trm_commons_1.Logger.warning(`System endpoint: Unknown`);
|
|
76
|
-
}
|
|
77
|
-
if (rfcdest) {
|
|
78
|
-
trm_commons_1.Logger.info(`RFC Forward: ${rfcdest}`);
|
|
79
|
-
}
|
|
30
|
+
const connection = utils_1.Context.getInstance().connections.find(o => o.name === alias.type);
|
|
31
|
+
if (!connection) {
|
|
32
|
+
throw new Error(`Unknown connection type "${alias.type}".`);
|
|
80
33
|
}
|
|
81
|
-
if (
|
|
82
|
-
|
|
34
|
+
if (connection.logData) {
|
|
35
|
+
connection.logData();
|
|
83
36
|
}
|
|
84
37
|
else {
|
|
85
|
-
trm_commons_1.Logger.
|
|
86
|
-
}
|
|
87
|
-
if (client) {
|
|
88
|
-
trm_commons_1.Logger.info(`Logon client: ${client}`);
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
trm_commons_1.Logger.warning(`Logon client: Unknown`);
|
|
92
|
-
}
|
|
93
|
-
if (user) {
|
|
94
|
-
trm_commons_1.Logger.info(`Logon user: ${user}`);
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
trm_commons_1.Logger.warning(`Logon user: Unknown`);
|
|
98
|
-
}
|
|
99
|
-
if (hasPassword) {
|
|
100
|
-
trm_commons_1.Logger.info(`Logon password: SAVED IN PLAIN TEXT`);
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
trm_commons_1.Logger.warning(`Logon password: Unknown`);
|
|
38
|
+
trm_commons_1.Logger.info(`No data to show.`);
|
|
104
39
|
}
|
|
105
40
|
};
|
|
106
41
|
const _check = (alias) => __awaiter(void 0, void 0, void 0, function* () {
|
|
107
42
|
trm_commons_1.Logger.loading(`Checking connection with alias "${alias.alias}"...`);
|
|
108
|
-
const oSystemAlias = new systemAlias_1.SystemAlias(alias.type, alias.
|
|
43
|
+
const oSystemAlias = new systemAlias_1.SystemAlias(alias.type, alias.data);
|
|
109
44
|
try {
|
|
110
45
|
yield oSystemAlias.getConnection().connect();
|
|
111
|
-
trm_commons_1.Logger.success(`Connection OK.`);
|
|
46
|
+
trm_commons_1.Logger.success(`Connection to alias "${alias.alias}" OK.`);
|
|
112
47
|
}
|
|
113
48
|
catch (e) {
|
|
114
49
|
trm_commons_1.Logger.error(`Connection failed!`);
|
|
@@ -117,39 +52,14 @@ const _check = (alias) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
117
52
|
});
|
|
118
53
|
const _edit = (alias) => __awaiter(void 0, void 0, void 0, function* () {
|
|
119
54
|
var connectionSuccess = true;
|
|
120
|
-
const connectionArgs = yield (0, prompts_1.connect)(Object.assign(Object.assign(
|
|
55
|
+
const connectionArgs = yield (0, prompts_1.connect)(Object.assign(Object.assign({}, alias.data), {
|
|
121
56
|
type: alias.type,
|
|
122
57
|
noSystemAlias: true,
|
|
123
58
|
force: true
|
|
124
59
|
}), false);
|
|
125
60
|
try {
|
|
126
61
|
systemAlias_1.SystemAlias.delete(alias.alias);
|
|
127
|
-
|
|
128
|
-
if (connectionArgs.type === utils_1.SystemConnectorType.RFC) {
|
|
129
|
-
updatedAlias = systemAlias_1.SystemAlias.create(alias.alias, connectionArgs.type, {
|
|
130
|
-
ashost: connectionArgs.ashost,
|
|
131
|
-
dest: connectionArgs.dest,
|
|
132
|
-
sysnr: connectionArgs.sysnr,
|
|
133
|
-
saprouter: connectionArgs.saprouter
|
|
134
|
-
}, {
|
|
135
|
-
client: connectionArgs.client,
|
|
136
|
-
lang: connectionArgs.lang,
|
|
137
|
-
passwd: connectionArgs.passwd,
|
|
138
|
-
user: connectionArgs.user
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
else if (connectionArgs.type === utils_1.SystemConnectorType.REST) {
|
|
142
|
-
updatedAlias = systemAlias_1.SystemAlias.create(alias.alias, connectionArgs.type, {
|
|
143
|
-
endpoint: connectionArgs.endpoint,
|
|
144
|
-
rfcdest: connectionArgs.forwardRfcDest
|
|
145
|
-
}, {
|
|
146
|
-
lang: connectionArgs.lang,
|
|
147
|
-
passwd: connectionArgs.passwd,
|
|
148
|
-
user: connectionArgs.user,
|
|
149
|
-
client: connectionArgs.client
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
yield updatedAlias.getConnection().connect();
|
|
62
|
+
yield systemAlias_1.SystemAlias.create(alias.alias, connectionArgs.name, connectionArgs.getData()).getConnection().connect();
|
|
153
63
|
}
|
|
154
64
|
catch (e) {
|
|
155
65
|
connectionSuccess = false;
|
|
@@ -162,30 +72,7 @@ const _edit = (alias) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
162
72
|
else {
|
|
163
73
|
trm_commons_1.Logger.error(`Alias "${alias.alias}" couldn't be updated.`);
|
|
164
74
|
systemAlias_1.SystemAlias.delete(alias.alias);
|
|
165
|
-
|
|
166
|
-
systemAlias_1.SystemAlias.create(alias.alias, alias.type, {
|
|
167
|
-
ashost: alias.connection.ashost,
|
|
168
|
-
dest: alias.connection.dest,
|
|
169
|
-
sysnr: alias.connection.sysnr,
|
|
170
|
-
saprouter: alias.connection.saprouter
|
|
171
|
-
}, {
|
|
172
|
-
client: alias.login.client,
|
|
173
|
-
lang: alias.login.lang,
|
|
174
|
-
passwd: alias.login.passwd,
|
|
175
|
-
user: alias.login.user
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
else if (alias.type === utils_1.SystemConnectorType.REST) {
|
|
179
|
-
systemAlias_1.SystemAlias.create(alias.alias, alias.type, {
|
|
180
|
-
endpoint: alias.connection.endpoint,
|
|
181
|
-
rfcdest: alias.connection.rfcdest
|
|
182
|
-
}, {
|
|
183
|
-
lang: alias.login.lang,
|
|
184
|
-
passwd: alias.login.passwd,
|
|
185
|
-
user: alias.login.user,
|
|
186
|
-
client: alias.login.client
|
|
187
|
-
});
|
|
188
|
-
}
|
|
75
|
+
systemAlias_1.SystemAlias.create(alias.alias, alias.type, alias.data);
|
|
189
76
|
}
|
|
190
77
|
}
|
|
191
78
|
});
|
package/dist/commands/compare.js
CHANGED
|
@@ -48,11 +48,7 @@ const systemAlias_1 = require("../systemAlias");
|
|
|
48
48
|
const prompts_1 = require("./prompts");
|
|
49
49
|
const commons_1 = require("./commons");
|
|
50
50
|
const trm_core_1 = require("trm-core");
|
|
51
|
-
const utils_1 = require("../utils");
|
|
52
51
|
const trm_commons_1 = require("trm-commons");
|
|
53
|
-
const _compareConnectionData = (a, b) => {
|
|
54
|
-
return false;
|
|
55
|
-
};
|
|
56
52
|
const _promptConnections = (aConnections) => __awaiter(void 0, void 0, void 0, function* () {
|
|
57
53
|
if (aConnections.length > 0) {
|
|
58
54
|
trm_commons_1.Logger.info(`Compare systems: ${aConnections.map(o => o.getDest()).join(', ')}`);
|
|
@@ -67,44 +63,10 @@ const _promptConnections = (aConnections) => __awaiter(void 0, void 0, void 0, f
|
|
|
67
63
|
}]);
|
|
68
64
|
askConnection = inq1.continue !== undefined ? inq1.continue : askConnection;
|
|
69
65
|
if (askConnection) {
|
|
70
|
-
const connectArgs = yield (0, prompts_1.connect)({}, false);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
connection: {
|
|
75
|
-
ashost: connectArgs.ashost,
|
|
76
|
-
dest: connectArgs.dest,
|
|
77
|
-
sysnr: connectArgs.sysnr,
|
|
78
|
-
saprouter: connectArgs.saprouter
|
|
79
|
-
},
|
|
80
|
-
login: {
|
|
81
|
-
user: connectArgs.user,
|
|
82
|
-
passwd: connectArgs.passwd,
|
|
83
|
-
lang: connectArgs.lang,
|
|
84
|
-
client: connectArgs.client
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
else if (connectArgs.type === utils_1.SystemConnectorType.REST) {
|
|
89
|
-
oConnection = (0, utils_1.getSystemConnector)(connectArgs.type, {
|
|
90
|
-
connection: {
|
|
91
|
-
endpoint: connectArgs.endpoint,
|
|
92
|
-
rfcdest: connectArgs.forwardRfcDest
|
|
93
|
-
},
|
|
94
|
-
login: {
|
|
95
|
-
user: connectArgs.user,
|
|
96
|
-
passwd: connectArgs.passwd,
|
|
97
|
-
lang: connectArgs.lang,
|
|
98
|
-
client: connectArgs.client
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
if (oConnection) {
|
|
103
|
-
if (!aConnections.find(o => _compareConnectionData(o.getConnectionData(), oConnection.getConnectionData()))) {
|
|
104
|
-
yield oConnection.connect();
|
|
105
|
-
aConnections.push(oConnection);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
66
|
+
const connectArgs = yield (0, prompts_1.connect)({}, false, false);
|
|
67
|
+
const systemConnector = connectArgs.getSystemConnector();
|
|
68
|
+
yield systemConnector.connect();
|
|
69
|
+
aConnections.push(systemConnector);
|
|
108
70
|
}
|
|
109
71
|
return {
|
|
110
72
|
continue: askConnection,
|
|
@@ -136,10 +98,7 @@ function compare(commandArgs) {
|
|
|
136
98
|
for (const sAlias of aInputConnections) {
|
|
137
99
|
const oAlias = systemAlias_1.SystemAlias.get(sAlias);
|
|
138
100
|
const oConnection = oAlias.getConnection();
|
|
139
|
-
|
|
140
|
-
yield oConnection.connect();
|
|
141
|
-
aConnections.push(oConnection);
|
|
142
|
-
}
|
|
101
|
+
aConnections.push(oConnection);
|
|
143
102
|
}
|
|
144
103
|
}
|
|
145
104
|
if (aConnections.length === 0) {
|
package/dist/commands/content.js
CHANGED
|
@@ -29,7 +29,11 @@ function content(commandArgs) {
|
|
|
29
29
|
var iOtherEntries = 0;
|
|
30
30
|
const packageContent = yield remotePackage.fetchRemoteContent(commandArgs.version, {
|
|
31
31
|
tempDirPath: (0, utils_1.getTempFolder)(),
|
|
32
|
-
r3transDirPath: commandArgs.r3transPath
|
|
32
|
+
r3transDirPath: commandArgs.r3transPath,
|
|
33
|
+
useDocker: utils_1.Context.getInstance().settings.r3transDocker,
|
|
34
|
+
dockerOptions: {
|
|
35
|
+
name: utils_1.Context.getInstance().settings.r3transDockerName
|
|
36
|
+
}
|
|
33
37
|
});
|
|
34
38
|
if (!commandArgs.all) {
|
|
35
39
|
transports.TADIR = packageContent.TADIR.trkorr;
|