trm-core 7.4.6 → 7.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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,35 +1,35 @@
1
- # <a href="https://docs.trmregistry.com/"><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
- [![Core License](https://img.shields.io/github/license/RegestaItalia/trm-core)](https://github.com/RegestaItalia/trm-core)
5
- [![Core Latest version](https://img.shields.io/npm/v/trm-core)](https://www.npmjs.com/package/trm-core)
6
- [![Core Installs](https://img.shields.io/npm/dt/trm-core)](https://www.npmjs.com/package/trm-core)
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 module contains the core functionalities of [TRM (Transport Request Manager)](https://trmregistry.com/).
14
-
15
- TRM is a software designed to make transports between SAP ECC/S4 systems easy.
16
-
17
- # Requirements
18
-
19
- - [Node >=22.12.0](https://github.com/nodejs/node/releases/tag/v22.12.0)
20
-
21
- # Documentation <!-- {docsify-remove} -->
22
-
23
- Full documentation can be seen at [https://docs.trmregistry.com/](https://docs.trmregistry.com).
24
-
25
- # Contributing <!-- {docsify-remove} -->
26
-
27
- Like every other TRM open-source projects, contributions are always welcomed ❤️.
28
-
29
- Make sure to open an issue first.
30
-
31
- Contributions will be merged upon approval.
32
-
33
- [Click here](https://docs.trmregistry.com/#/CONTRIBUTING) for the full list of TRM contribution guidelines.
34
-
35
- [<img src="https://trmregistry.com/public/contributors?image=true">](https://docs.trmregistry.com/#/?id=contributors)
1
+ # <a href="https://docs.trmregistry.com/"><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
+ [![Core License](https://img.shields.io/github/license/RegestaItalia/trm-core)](https://github.com/RegestaItalia/trm-core)
5
+ [![Core Latest version](https://img.shields.io/npm/v/trm-core)](https://www.npmjs.com/package/trm-core)
6
+ [![Core Installs](https://img.shields.io/npm/dt/trm-core)](https://www.npmjs.com/package/trm-core)
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 module contains the core functionalities of [TRM (Transport Request Manager)](https://trmregistry.com/).
14
+
15
+ TRM is a software designed to make transports between SAP ECC/S4 systems easy.
16
+
17
+ # Requirements
18
+
19
+ - [Node >=22.12.0](https://github.com/nodejs/node/releases/tag/v22.12.0)
20
+
21
+ # Documentation <!-- {docsify-remove} -->
22
+
23
+ Full documentation can be seen at [https://docs.trmregistry.com/](https://docs.trmregistry.com).
24
+
25
+ # Contributing <!-- {docsify-remove} -->
26
+
27
+ Like every other TRM open-source projects, contributions are always welcomed ❤️.
28
+
29
+ Make sure to open an issue first.
30
+
31
+ Contributions will be merged upon approval.
32
+
33
+ [Click here](https://docs.trmregistry.com/#/CONTRIBUTING) for the full list of TRM contribution guidelines.
34
+
35
+ [<img src="https://trmregistry.com/public/contributors?image=true">](https://docs.trmregistry.com/#/?id=contributors)
package/changelog.txt CHANGED
@@ -1,149 +1,160 @@
1
- trm-core changelog
2
- =================
3
-
4
- Legend
5
- ------
6
- * : fixed
7
- ! : changed
8
- + : added
9
- - : removed
10
-
11
- 2025-08-27 v7.4.6
12
- -------------------
13
- * template manifest values
14
-
15
- 2025-08-17 v7.4.5
16
- -------------------
17
- ! node-r3trans ^2.0.1
18
- * r3trans options in getContent method
19
-
20
- 2025-07-30 v7.4.4
21
- -------------------
22
- ! node-r3trans ^2.0.0
23
-
24
- 2025-07-30 v7.4.3
25
- -------------------
26
- ! trm-commons ^2.0.0 as peer dependency
27
-
28
- 2025-07-29 v7.4.2
29
- -------------------
30
- ! enforce node engine >=22.12.0 with post install script
31
- ! protocol-registry ^2.0.0
32
-
33
- 2025-07-29 7.4.1
34
- -------------------
35
- ! trm-commons ^2.0.0
36
-
37
- 2025-07-29 7.4.0
38
- -------------------
39
- - dependency install doesn't ask for cust/lang/package replacements anymore if not needed
40
- ! install asks for cust/lang/package replacements when not provided by default parameter
41
- ! import logger shows package name
42
- ! trm-commons ^1.1.0
43
- ! trm-server ^5.0.0
44
- ! set/overwrite dependencies with or without automatic detection
45
- + manifest template for post activities, trm dependency and sap entries
46
- * local package install
47
-
48
- 2025-07-08 v7.3.0
49
- -------------------
50
- + enforce node engine ^22.12.0 with post install script
51
- * install package hierarchy
52
-
53
- 2025-06-04 v7.2.1
54
- -------------------
55
- * inquirer/logger prefix on install dependency
56
- + removed useless wb transport find on package first install
57
-
58
- 2025-06-03 v7.2.0
59
- -------------------
60
- * find dependency with custom object not found without devc reference
61
-
62
- 2025-06-03 v7.1.0
63
- -------------------
64
- * change tr owner on install tr update
65
-
66
- 2025-06-03 v7.0.0
67
- -------------------
68
- ! trm-server ^4.0.0
69
- + change tr owner on install tr update
70
-
71
- 2025-05-29 v6.9.1
72
- -------------------
73
- * remote function for updating server
74
- + confirm if objects exists but no root sap package found
75
-
76
- 2025-05-29 v6.9.0
77
- -------------------
78
- ! check server api auth before install and publish
79
- ! trm-server ^3.1.0
80
- ! read wb transport from package
81
-
82
- 2025-05-27 v6.8.0
83
- -------------------
84
- ! on install transport update, check tasks before add object attempt
85
- * commit before post activity run on RFC
86
- * post activity error log
87
- + node-rfc #327 -> device or resource busy, added workaround
88
-
89
- 2025-05-20 v6.7.1
90
- -------------------
91
- ! get installed packages from backend with trm-server version check
92
-
93
- 2025-05-14 v6.7.0
94
- -------------------
95
- ! trm-server ^3.0.0
96
- * abapgit ignored objects
97
- + post activity pre check
98
- + get installed packages from backend where possible
99
- + regen SAPLZTRM before post activity
100
- * rest sap-client
101
- + keep track of post activities based on latest release
102
-
103
- 2025-05-08 v6.6.0
104
- -------------------
105
- * no integrity with trm-server/trm-rest dependency allowed
106
- ! REST Client and RFC Client error generic -> specific
107
- ! REST Client error xml body parsing with title as message
108
- ! trm-server ^2.2.2
109
-
110
- 2025-05-08 v6.5.1
111
- -------------------
112
- ! rest error handling
113
-
114
- 2025-05-05 v6.5.0
115
- -------------------
116
- ! trm-commons ^1.0.0
117
- * upgrade trm-server fixes
118
- * core package.json location find
119
-
120
- 2025-04-28 v6.4.1
121
- -------------------
122
-
123
- ! node-r3trans ^1.5.0
124
-
125
- 2025-04-28 v6.4.0
126
- -------------------
127
-
128
- + post activities in abap manifest
129
- * return exception type for REST client
130
-
131
- 2025-02-06 v6.3.0
132
- -------------------
133
-
134
- * upgrading package remove previous ZTRM comments in workbench (import) transport
135
- + fetch package remote content
136
- * fix translation transport generation
137
- + move trm package dependencies to core
138
- + transport migration on overwrite
139
- ! DEVC, CUST and LANG are now TRM relevant
140
- * root superpackage on devc tr import blank
141
- + clear state on package install (remove from skipped transports)
142
- + add abapgit source code to TRM artifact
143
- + skip ignored objects listed in .abapgit.xml
144
- + add namespace in manifest
145
- ! abstract registry for custom implementation
146
- + add file system registry for local publish and install
147
- + add post activities
148
- ! cache transports in dependency detection for performance issues on big packages
1
+ trm-core changelog
2
+ =================
3
+
4
+ Legend
5
+ ------
6
+ * : fixed
7
+ ! : changed
8
+ + : added
9
+ - : removed
10
+
11
+ 2025-09-03 v7.5.1
12
+ -------------------
13
+ ! trm-commons ^3.2.0
14
+
15
+ 2025-09-03 v7.5.0
16
+ -------------------
17
+ ! trm-commons ^3.1.0
18
+ * npm global path
19
+ + rfc closeConnection method
20
+ ! private/protected methods/attributes
21
+
22
+ 2025-08-27 v7.4.6
23
+ -------------------
24
+ * template manifest values
25
+
26
+ 2025-08-17 v7.4.5
27
+ -------------------
28
+ ! node-r3trans ^2.0.1
29
+ * r3trans options in getContent method
30
+
31
+ 2025-07-30 v7.4.4
32
+ -------------------
33
+ ! node-r3trans ^2.0.0
34
+
35
+ 2025-07-30 v7.4.3
36
+ -------------------
37
+ ! trm-commons ^2.0.0 as peer dependency
38
+
39
+ 2025-07-29 v7.4.2
40
+ -------------------
41
+ ! enforce node engine >=22.12.0 with post install script
42
+ ! protocol-registry ^2.0.0
43
+
44
+ 2025-07-29 7.4.1
45
+ -------------------
46
+ ! trm-commons ^2.0.0
47
+
48
+ 2025-07-29 7.4.0
49
+ -------------------
50
+ - dependency install doesn't ask for cust/lang/package replacements anymore if not needed
51
+ ! install asks for cust/lang/package replacements when not provided by default parameter
52
+ ! import logger shows package name
53
+ ! trm-commons ^1.1.0
54
+ ! trm-server ^5.0.0
55
+ ! set/overwrite dependencies with or without automatic detection
56
+ + manifest template for post activities, trm dependency and sap entries
57
+ * local package install
58
+
59
+ 2025-07-08 v7.3.0
60
+ -------------------
61
+ + enforce node engine ^22.12.0 with post install script
62
+ * install package hierarchy
63
+
64
+ 2025-06-04 v7.2.1
65
+ -------------------
66
+ * inquirer/logger prefix on install dependency
67
+ + removed useless wb transport find on package first install
68
+
69
+ 2025-06-03 v7.2.0
70
+ -------------------
71
+ * find dependency with custom object not found without devc reference
72
+
73
+ 2025-06-03 v7.1.0
74
+ -------------------
75
+ * change tr owner on install tr update
76
+
77
+ 2025-06-03 v7.0.0
78
+ -------------------
79
+ ! trm-server ^4.0.0
80
+ + change tr owner on install tr update
81
+
82
+ 2025-05-29 v6.9.1
83
+ -------------------
84
+ * remote function for updating server
85
+ + confirm if objects exists but no root sap package found
86
+
87
+ 2025-05-29 v6.9.0
88
+ -------------------
89
+ ! check server api auth before install and publish
90
+ ! trm-server ^3.1.0
91
+ ! read wb transport from package
92
+
93
+ 2025-05-27 v6.8.0
94
+ -------------------
95
+ ! on install transport update, check tasks before add object attempt
96
+ * commit before post activity run on RFC
97
+ * post activity error log
98
+ + node-rfc #327 -> device or resource busy, added workaround
99
+
100
+ 2025-05-20 v6.7.1
101
+ -------------------
102
+ ! get installed packages from backend with trm-server version check
103
+
104
+ 2025-05-14 v6.7.0
105
+ -------------------
106
+ ! trm-server ^3.0.0
107
+ * abapgit ignored objects
108
+ + post activity pre check
109
+ + get installed packages from backend where possible
110
+ + regen SAPLZTRM before post activity
111
+ * rest sap-client
112
+ + keep track of post activities based on latest release
113
+
114
+ 2025-05-08 v6.6.0
115
+ -------------------
116
+ * no integrity with trm-server/trm-rest dependency allowed
117
+ ! REST Client and RFC Client error generic -> specific
118
+ ! REST Client error xml body parsing with title as message
119
+ ! trm-server ^2.2.2
120
+
121
+ 2025-05-08 v6.5.1
122
+ -------------------
123
+ ! rest error handling
124
+
125
+ 2025-05-05 v6.5.0
126
+ -------------------
127
+ ! trm-commons ^1.0.0
128
+ * upgrade trm-server fixes
129
+ * core package.json location find
130
+
131
+ 2025-04-28 v6.4.1
132
+ -------------------
133
+
134
+ ! node-r3trans ^1.5.0
135
+
136
+ 2025-04-28 v6.4.0
137
+ -------------------
138
+
139
+ + post activities in abap manifest
140
+ * return exception type for REST client
141
+
142
+ 2025-02-06 v6.3.0
143
+ -------------------
144
+
145
+ * upgrading package remove previous ZTRM comments in workbench (import) transport
146
+ + fetch package remote content
147
+ * fix translation transport generation
148
+ + move trm package dependencies to core
149
+ + transport migration on overwrite
150
+ ! DEVC, CUST and LANG are now TRM relevant
151
+ * root superpackage on devc tr import blank
152
+ + clear state on package install (remove from skipped transports)
153
+ + add abapgit source code to TRM artifact
154
+ + skip ignored objects listed in .abapgit.xml
155
+ + add namespace in manifest
156
+ ! abstract registry for custom implementation
157
+ + add file system registry for local publish and install
158
+ + add post activities
159
+ ! cache transports in dependency detection for performance issues on big packages
149
160
  * check object existance before install
@@ -25,7 +25,7 @@ exports.commit = {
25
25
  run: (context) => __awaiter(void 0, void 0, void 0, function* () {
26
26
  trm_commons_1.Logger.log('Commit (RFC Connection) step', true);
27
27
  trm_commons_1.Logger.loading(`Closing rfc connection...`, true);
28
- yield systemConnector_1.SystemConnector.systemConnector.close();
28
+ yield systemConnector_1.SystemConnector.systemConnector.closeConnection();
29
29
  trm_commons_1.Logger.loading(`Opening rfc connection...`, true);
30
30
  yield systemConnector_1.SystemConnector.systemConnector.connect(true);
31
31
  trm_commons_1.Logger.success(`Commit OK`, true);
@@ -1,13 +1,14 @@
1
1
  import * as components from "./components";
2
2
  import * as struct from "./struct";
3
3
  import { IClient } from "./IClient";
4
+ import { AxiosInstance } from "axios";
4
5
  import { Login, RESTClientError, SapMessage } from ".";
5
6
  export declare class RESTClient implements IClient {
6
7
  endpoint: string;
7
8
  rfcdest: components.RFCDEST;
8
9
  private _login;
9
10
  private _cLangu;
10
- private _axiosInstance;
11
+ protected _axiosInstance: AxiosInstance;
11
12
  private _connected;
12
13
  constructor(endpoint: string, rfcdest: components.RFCDEST, _login: Login, _cLangu: string);
13
14
  open(): Promise<void>;
@@ -5,7 +5,7 @@ import { RFCClientError, SapMessage } from ".";
5
5
  export declare class RFCClient implements IClient {
6
6
  private _rfcClientArgs;
7
7
  private _cLangu;
8
- private _rfcClient;
8
+ protected _rfcClient: any;
9
9
  private _aliveCheck;
10
10
  constructor(_rfcClientArgs: any, _cLangu: string, traceDir?: string);
11
11
  private getRfcClient;
@@ -1,5 +1,5 @@
1
- import { CreateAxiosDefaults } from "axios";
1
+ import { AxiosInstance, CreateAxiosDefaults } from "axios";
2
2
  export declare const AXIOS_SESSION_HEADER = "X-TRM-SESSION-ID";
3
3
  export declare const AXIOS_INTERNAL_HEADER = "X-TRM-REQUEST-ID";
4
4
  export type AxiosCtx = 'Registry' | 'RestServer';
5
- export declare function getAxiosInstance(config: CreateAxiosDefaults<any>, sCtx: AxiosCtx): import("axios").AxiosInstance;
5
+ export declare function getAxiosInstance(config: CreateAxiosDefaults<any>, sCtx: AxiosCtx, inj?: AxiosInstance): AxiosInstance;
@@ -20,8 +20,8 @@ function _getInternalId(response) {
20
20
  return 'Unknown';
21
21
  }
22
22
  }
23
- function getAxiosInstance(config, sCtx) {
24
- const instance = axios_1.default.create(config);
23
+ function getAxiosInstance(config, sCtx, inj) {
24
+ var instance = inj || axios_1.default.create(config);
25
25
  instance.interceptors.request.use((request) => {
26
26
  const internalId = (0, uuid_1.v4)();
27
27
  request.headers.set(exports.AXIOS_INTERNAL_HEADER, internalId);
@@ -8,22 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
12
  exports.getNpmGlobalPath = getNpmGlobalPath;
16
13
  const child_process_1 = require("child_process");
17
- const path_1 = __importDefault(require("path"));
18
14
  const util_1 = require("util");
19
15
  const trm_commons_1 = require("trm-commons");
20
16
  function getNpmGlobalPath() {
21
17
  return __awaiter(this, void 0, void 0, function* () {
22
18
  trm_commons_1.Logger.loading(`Reading NPM global path...`);
23
19
  const execPromise = (0, util_1.promisify)(child_process_1.exec);
24
- const { stdout } = yield execPromise(`npm config get prefix`);
25
- const prefixPath = stdout.replace(/\n$/, '');
26
- const globalPath = path_1.default.join(prefixPath, 'node_modules');
20
+ const { stdout } = yield execPromise(`npm root -g`);
21
+ const globalPath = stdout.replace(/\n$/, '');
27
22
  trm_commons_1.Logger.log(`NPM Global path: ${globalPath}`, true);
28
23
  return globalPath;
29
24
  });
@@ -12,6 +12,7 @@ export interface ISystemConnector extends ISystemConnectorBase {
12
12
  getLogonLanguage: (c: boolean) => string;
13
13
  getLogonUser: () => string;
14
14
  connect: () => Promise<void>;
15
+ closeConnection: () => Promise<void>;
15
16
  checkConnection: () => Promise<boolean>;
16
17
  ping: () => Promise<string>;
17
18
  getFileSystem: () => Promise<struct.FILESYS>;
@@ -6,7 +6,7 @@ import * as components from "../client/components";
6
6
  import * as struct from "../client/struct";
7
7
  import { SystemConnectorBase } from "./SystemConnectorBase";
8
8
  import { RESTConnection } from "./RESTConnection";
9
- import { ClientError, SapMessage } from "../client";
9
+ import { ClientError, RESTClient, SapMessage } from "../client";
10
10
  import { SystemConnectorSupportedBulk } from "./SystemConnectorSupportedBulk";
11
11
  export declare class RESTSystemConnector extends SystemConnectorBase implements ISystemConnector {
12
12
  private _connection;
@@ -14,10 +14,10 @@ export declare class RESTSystemConnector extends SystemConnectorBase implements
14
14
  private _dest;
15
15
  private _lang;
16
16
  private _user;
17
- private _client;
17
+ protected _client: RESTClient;
18
18
  private _isServerApisAllowed;
19
19
  supportedBulk: SystemConnectorSupportedBulk;
20
- constructor(_connection: RESTConnection, _login: Login);
20
+ constructor(_connection: RESTConnection, _login: Login, normalizeEndpoint?: boolean);
21
21
  protected getSysname(): string;
22
22
  getDest(): string;
23
23
  protected getLangu(c: boolean): string;
@@ -32,6 +32,7 @@ export declare class RESTSystemConnector extends SystemConnectorBase implements
32
32
  getConnectionData(): RESTConnection;
33
33
  getLogonUser(): string;
34
34
  connect(): Promise<void>;
35
+ closeConnection(): Promise<void>;
35
36
  checkConnection(): Promise<boolean>;
36
37
  ping(): Promise<string>;
37
38
  getFileSystem(): Promise<struct.FILESYS>;
@@ -20,7 +20,7 @@ const normalize_url_1 = __importDefault(require("@esm2cjs/normalize-url"));
20
20
  const ENDPOINT_RESOURCE_BASE = '/ztrmserver';
21
21
  const NONE_DEST = 'NONE';
22
22
  class RESTSystemConnector extends SystemConnectorBase_1.SystemConnectorBase {
23
- constructor(_connection, _login) {
23
+ constructor(_connection, _login, normalizeEndpoint = true) {
24
24
  super();
25
25
  this._connection = _connection;
26
26
  this._login = _login;
@@ -31,10 +31,12 @@ class RESTSystemConnector extends SystemConnectorBase_1.SystemConnectorBase {
31
31
  this._login.user = this._login.user.toUpperCase();
32
32
  this._lang = this._login.lang;
33
33
  this._user = this._login.user;
34
- trm_commons_1.Logger.log(`REST connection data before normalize: ${JSON.stringify(this._connection)}`, true);
35
- this._connection.endpoint = (0, normalize_url_1.default)(this._connection.endpoint, {
36
- removeTrailingSlash: true
37
- });
34
+ if (normalizeEndpoint) {
35
+ trm_commons_1.Logger.log(`REST connection data before normalize: ${JSON.stringify(this._connection)}`, true);
36
+ this._connection.endpoint = (0, normalize_url_1.default)(this._connection.endpoint, {
37
+ removeTrailingSlash: true
38
+ });
39
+ }
38
40
  if (!new RegExp(`${ENDPOINT_RESOURCE_BASE}$`, 'gmi').test(this._connection.endpoint)) {
39
41
  this._connection.endpoint = `${this._connection.endpoint}${ENDPOINT_RESOURCE_BASE}`;
40
42
  }
@@ -119,6 +121,10 @@ class RESTSystemConnector extends SystemConnectorBase_1.SystemConnectorBase {
119
121
  }
120
122
  });
121
123
  }
124
+ closeConnection() {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ });
127
+ }
122
128
  checkConnection() {
123
129
  return __awaiter(this, void 0, void 0, function* () {
124
130
  return this._client.checkConnection();
@@ -1,4 +1,4 @@
1
- import { ClientError, SapMessage } from "../client";
1
+ import { ClientError, RFCClient, SapMessage } from "../client";
2
2
  import { DEVCLASS } from "../client/components";
3
3
  import { TADIR } from "../client/struct";
4
4
  import { RFCConnection } from "./RFCConnection";
@@ -14,7 +14,7 @@ export declare class RFCSystemConnector extends SystemConnectorBase implements I
14
14
  private _traceDir?;
15
15
  private _lang;
16
16
  private _user;
17
- private _client;
17
+ protected _client: RFCClient;
18
18
  private _isServerApisAllowed;
19
19
  supportedBulk: SystemConnectorSupportedBulk;
20
20
  constructor(_connection: RFCConnection, _login: Login, _traceDir?: string);
@@ -32,7 +32,7 @@ export declare class RFCSystemConnector extends SystemConnectorBase implements I
32
32
  getConnectionData(): RFCConnection;
33
33
  getLogonUser(): string;
34
34
  connect(silent?: boolean): Promise<void>;
35
- close(): Promise<void>;
35
+ closeConnection(): Promise<void>;
36
36
  checkConnection(): Promise<boolean>;
37
37
  ping(): Promise<string>;
38
38
  getFileSystem(): Promise<struct.FILESYS>;
@@ -100,7 +100,7 @@ class RFCSystemConnector extends SystemConnectorBase_1.SystemConnectorBase {
100
100
  }
101
101
  });
102
102
  }
103
- close() {
103
+ closeConnection() {
104
104
  return __awaiter(this, void 0, void 0, function* () {
105
105
  yield this._client.close();
106
106
  });
@@ -16,6 +16,7 @@ export declare namespace SystemConnector {
16
16
  function getLogonLanguage(c: boolean): string;
17
17
  function getLogonUser(): string;
18
18
  function connect(): Promise<void>;
19
+ function closeConnection(): Promise<void>;
19
20
  function checkConnection(): Promise<boolean>;
20
21
  function getTransportStatus(trkorr: TRKORR): Promise<string>;
21
22
  function getPackageWorkbenchTransport(oPackage: TrmPackage): Promise<Transport>;
@@ -58,6 +58,13 @@ var SystemConnector;
58
58
  });
59
59
  }
60
60
  SystemConnector.connect = connect;
61
+ function closeConnection() {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ yield checkSystemConnector();
64
+ return SystemConnector.systemConnector.closeConnection();
65
+ });
66
+ }
67
+ SystemConnector.closeConnection = closeConnection;
61
68
  function checkConnection() {
62
69
  return __awaiter(this, void 0, void 0, function* () {
63
70
  yield checkSystemConnector();
package/package.json CHANGED
@@ -1,97 +1,97 @@
1
- {
2
- "name": "trm-core",
3
- "version": "7.4.6",
4
- "description": "TRM (Transport Request Manager) Core",
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
- "scripts": {
17
- "cleanBuild": "rimraf dist/",
18
- "build": "npm run cleanBuild && tsc --sourceMap false",
19
- "test": "jest",
20
- "prepublishOnly": "npm run build",
21
- "postinstall": "node dist/scripts/checkEngine.js"
22
- },
23
- "keywords": [
24
- "trm",
25
- "abap"
26
- ],
27
- "homepage": "https://www.trmregistry.com",
28
- "repository": {
29
- "type": "git",
30
- "url": "git+https://github.com/RegestaItalia/trm-core.git"
31
- },
32
- "author": {
33
- "name": "Simone Gaffurini",
34
- "email": "simone.gaffurini@regestaitalia.it"
35
- },
36
- "license": "MIT",
37
- "trmDependencies": {
38
- "trm-server": "^5.0.0"
39
- },
40
- "dependencies": {
41
- "@esm2cjs/normalize-url": "^8.0.0",
42
- "@inquirer/prompts": "^7.8.1",
43
- "@simonegaffurini/sammarksworkflow": "^1.3.2-fork",
44
- "@xmldom/xmldom": "^0.9.8",
45
- "adm-zip": "^0.5.10",
46
- "axios": "^1.7.9",
47
- "chalk": "^4.1.2",
48
- "cli-progress": "^3.12.0",
49
- "dotenv": "^16.3.1",
50
- "email-validator": "^2.0.4",
51
- "express": "^4.18.2",
52
- "get-root-path": "^3.0.1",
53
- "get-stack-trace": "^3.1.1",
54
- "lodash": "^4.17.21",
55
- "minimatch": "^10.0.1",
56
- "node-html-parser": "^7.0.1",
57
- "node-r3trans": "^2.0.1",
58
- "object-keys-normalizer": "^1.0.1",
59
- "opener": "^1.5.2",
60
- "parse-multipart-data": "^1.5.0",
61
- "protocol-registry": "^2.0.0",
62
- "semver": "^7.5.4",
63
- "semver-sort": "^1.0.0",
64
- "spdx-license-ids": "^3.0.13",
65
- "trm-registry-types": "^1.1.1",
66
- "uuid": "^9.0.1",
67
- "xml-beautify": "^1.2.3",
68
- "xml-js": "^1.6.11"
69
- },
70
- "peerDependencies": {
71
- "trm-commons": "^2.0.0"
72
- },
73
- "devDependencies": {
74
- "@types/adm-zip": "^0.5.0",
75
- "@types/cli-progress": "^3.11.3",
76
- "@types/debug": "^4.1.12",
77
- "@types/express": "^4.17.17",
78
- "@types/inquirer": "^9.0.3",
79
- "@types/jest": "^29.5.12",
80
- "@types/lodash": "^4.14.202",
81
- "@types/node": "^20.4.4",
82
- "@types/opener": "^1.4.0",
83
- "@types/semver": "^7.5.0",
84
- "@types/semver-sort": "^0.0.1",
85
- "@types/stack-trace": "^0.0.33",
86
- "@types/uuid": "^9.0.8",
87
- "jest": "^29.7.0",
88
- "rimraf": "^6.0.1",
89
- "trm-commons": "^2.0.0",
90
- "ts-jest": "^29.1.2",
91
- "ts-node": "^10.9.2",
92
- "typescript": "^5.8.2"
93
- },
94
- "engines": {
95
- "node": ">=22.12.0"
96
- }
97
- }
1
+ {
2
+ "name": "trm-core",
3
+ "version": "7.5.1",
4
+ "description": "TRM (Transport Request Manager) Core",
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
+ "scripts": {
17
+ "cleanBuild": "rimraf dist/",
18
+ "build": "npm run cleanBuild && tsc --sourceMap false",
19
+ "test": "jest",
20
+ "prepublishOnly": "npm run build",
21
+ "postinstall": "node dist/scripts/checkEngine.js"
22
+ },
23
+ "keywords": [
24
+ "trm",
25
+ "abap"
26
+ ],
27
+ "homepage": "https://www.trmregistry.com",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/RegestaItalia/trm-core.git"
31
+ },
32
+ "author": {
33
+ "name": "Simone Gaffurini",
34
+ "email": "simone.gaffurini@regestaitalia.it"
35
+ },
36
+ "license": "MIT",
37
+ "trmDependencies": {
38
+ "trm-server": "^5.0.0"
39
+ },
40
+ "dependencies": {
41
+ "@esm2cjs/normalize-url": "^8.0.0",
42
+ "@inquirer/prompts": "^7.8.1",
43
+ "@simonegaffurini/sammarksworkflow": "^1.3.2-fork",
44
+ "@xmldom/xmldom": "^0.9.8",
45
+ "adm-zip": "^0.5.10",
46
+ "axios": "^1.7.9",
47
+ "chalk": "^4.1.2",
48
+ "cli-progress": "^3.12.0",
49
+ "dotenv": "^16.3.1",
50
+ "email-validator": "^2.0.4",
51
+ "express": "^4.18.2",
52
+ "get-root-path": "^3.0.1",
53
+ "get-stack-trace": "^3.1.1",
54
+ "lodash": "^4.17.21",
55
+ "minimatch": "^10.0.1",
56
+ "node-html-parser": "^7.0.1",
57
+ "node-r3trans": "^2.0.1",
58
+ "object-keys-normalizer": "^1.0.1",
59
+ "opener": "^1.5.2",
60
+ "parse-multipart-data": "^1.5.0",
61
+ "protocol-registry": "^2.0.0",
62
+ "semver": "^7.5.4",
63
+ "semver-sort": "^1.0.0",
64
+ "spdx-license-ids": "^3.0.13",
65
+ "trm-registry-types": "^1.1.1",
66
+ "uuid": "^9.0.1",
67
+ "xml-beautify": "^1.2.3",
68
+ "xml-js": "^1.6.11"
69
+ },
70
+ "peerDependencies": {
71
+ "trm-commons": "^3.2.0"
72
+ },
73
+ "devDependencies": {
74
+ "@types/adm-zip": "^0.5.0",
75
+ "@types/cli-progress": "^3.11.3",
76
+ "@types/debug": "^4.1.12",
77
+ "@types/express": "^4.17.17",
78
+ "@types/inquirer": "^9.0.3",
79
+ "@types/jest": "^29.5.12",
80
+ "@types/lodash": "^4.14.202",
81
+ "@types/node": "^20.4.4",
82
+ "@types/opener": "^1.4.0",
83
+ "@types/semver": "^7.5.0",
84
+ "@types/semver-sort": "^0.0.1",
85
+ "@types/stack-trace": "^0.0.33",
86
+ "@types/uuid": "^9.0.8",
87
+ "jest": "^29.7.0",
88
+ "rimraf": "^6.0.1",
89
+ "trm-commons": "^3.2.0",
90
+ "ts-jest": "^29.1.2",
91
+ "ts-node": "^10.9.2",
92
+ "typescript": "^5.8.2"
93
+ },
94
+ "engines": {
95
+ "node": ">=22.12.0"
96
+ }
97
+ }