trm-core 7.5.2 → 7.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.txt +4 -0
- package/dist/client/RFCClient.d.ts +2 -1
- package/dist/client/RFCClient.js +3 -3
- package/dist/commons/index.d.ts +0 -1
- package/dist/commons/index.js +0 -1
- package/dist/systemConnector/RFCSystemConnector.d.ts +1 -1
- package/dist/systemConnector/RFCSystemConnector.js +2 -2
- package/package.json +3 -3
- package/dist/commons/getNpmGlobalPath.d.ts +0 -1
- package/dist/commons/getNpmGlobalPath.js +0 -25
package/changelog.txt
CHANGED
|
@@ -5,9 +5,10 @@ import { RFCClientError, SapMessage } from ".";
|
|
|
5
5
|
export declare class RFCClient implements IClient {
|
|
6
6
|
private _rfcClientArgs;
|
|
7
7
|
private _cLangu;
|
|
8
|
+
private _globalNodeModulesPath?;
|
|
8
9
|
protected _rfcClient: any;
|
|
9
10
|
private _aliveCheck;
|
|
10
|
-
constructor(_rfcClientArgs: any, _cLangu: string, traceDir?: string);
|
|
11
|
+
constructor(_rfcClientArgs: any, _cLangu: string, traceDir?: string, _globalNodeModulesPath?: string);
|
|
11
12
|
private getRfcClient;
|
|
12
13
|
open(): Promise<void>;
|
|
13
14
|
close(): Promise<void>;
|
package/dist/client/RFCClient.js
CHANGED
|
@@ -54,9 +54,10 @@ const _1 = require(".");
|
|
|
54
54
|
const xml = __importStar(require("xml-js"));
|
|
55
55
|
const nodeRfcLib = 'node-rfc';
|
|
56
56
|
class RFCClient {
|
|
57
|
-
constructor(_rfcClientArgs, _cLangu, traceDir) {
|
|
57
|
+
constructor(_rfcClientArgs, _cLangu, traceDir, _globalNodeModulesPath) {
|
|
58
58
|
this._rfcClientArgs = _rfcClientArgs;
|
|
59
59
|
this._cLangu = _cLangu;
|
|
60
|
+
this._globalNodeModulesPath = _globalNodeModulesPath;
|
|
60
61
|
this._aliveCheck = false;
|
|
61
62
|
try {
|
|
62
63
|
process.env["RFC_TRACE_DIR"] = traceDir || process.cwd();
|
|
@@ -70,8 +71,7 @@ class RFCClient {
|
|
|
70
71
|
getRfcClient() {
|
|
71
72
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
73
|
if (!this._rfcClient) {
|
|
73
|
-
const
|
|
74
|
-
const libPath = path_1.default.join(globalPath, nodeRfcLib);
|
|
74
|
+
const libPath = path_1.default.join(this._globalNodeModulesPath || (0, trm_commons_1.getGlobalNodeModules)(), nodeRfcLib);
|
|
75
75
|
trm_commons_1.Logger.log(`Node RFC lib path: ${libPath}`, true);
|
|
76
76
|
if (!(0, fs_1.existsSync)(libPath)) {
|
|
77
77
|
throw new _1.RFCClientError("ZRFC_LIB_NOT_FOUND", null, null, `${nodeRfcLib} not found. Run command "npm install ${nodeRfcLib} -g" to continue.`);
|
package/dist/commons/index.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export * from "./getParentFromHierarchy";
|
|
|
10
10
|
export * from "./getPackageNamespace";
|
|
11
11
|
export * from "./LogTableStruct";
|
|
12
12
|
export * from "./getAxiosInstance";
|
|
13
|
-
export * from "./getNpmGlobalPath";
|
|
14
13
|
export * from "./getNodePackage";
|
|
15
14
|
export * from "./getCoreTrmDependencies";
|
|
16
15
|
export * from "./checkCoreTrmDependencies";
|
package/dist/commons/index.js
CHANGED
|
@@ -26,7 +26,6 @@ __exportStar(require("./getParentFromHierarchy"), exports);
|
|
|
26
26
|
__exportStar(require("./getPackageNamespace"), exports);
|
|
27
27
|
__exportStar(require("./LogTableStruct"), exports);
|
|
28
28
|
__exportStar(require("./getAxiosInstance"), exports);
|
|
29
|
-
__exportStar(require("./getNpmGlobalPath"), exports);
|
|
30
29
|
__exportStar(require("./getNodePackage"), exports);
|
|
31
30
|
__exportStar(require("./getCoreTrmDependencies"), exports);
|
|
32
31
|
__exportStar(require("./checkCoreTrmDependencies"), exports);
|
|
@@ -17,7 +17,7 @@ export declare class RFCSystemConnector extends SystemConnectorBase implements I
|
|
|
17
17
|
protected _client: RFCClient;
|
|
18
18
|
private _isServerApisAllowed;
|
|
19
19
|
supportedBulk: SystemConnectorSupportedBulk;
|
|
20
|
-
constructor(_connection: RFCConnection, _login: Login, _traceDir?: string);
|
|
20
|
+
constructor(_connection: RFCConnection, _login: Login, _traceDir?: string, _globalNodeModulesPath?: string);
|
|
21
21
|
protected getSysname(): string;
|
|
22
22
|
getDest(): string;
|
|
23
23
|
protected getLangu(c: boolean): string;
|
|
@@ -14,7 +14,7 @@ const trm_commons_1 = require("trm-commons");
|
|
|
14
14
|
const client_1 = require("../client");
|
|
15
15
|
const SystemConnectorBase_1 = require("./SystemConnectorBase");
|
|
16
16
|
class RFCSystemConnector extends SystemConnectorBase_1.SystemConnectorBase {
|
|
17
|
-
constructor(_connection, _login, _traceDir) {
|
|
17
|
+
constructor(_connection, _login, _traceDir, _globalNodeModulesPath) {
|
|
18
18
|
super();
|
|
19
19
|
this._connection = _connection;
|
|
20
20
|
this._login = _login;
|
|
@@ -29,7 +29,7 @@ class RFCSystemConnector extends SystemConnectorBase_1.SystemConnectorBase {
|
|
|
29
29
|
if (!this._connection.saprouter) {
|
|
30
30
|
delete this._connection.saprouter;
|
|
31
31
|
}
|
|
32
|
-
this._client = new client_1.RFCClient(Object.assign(Object.assign({}, this._connection), this._login), this._lang[0], this._traceDir);
|
|
32
|
+
this._client = new client_1.RFCClient(Object.assign(Object.assign({}, this._connection), this._login), this._lang[0], this._traceDir, _globalNodeModulesPath);
|
|
33
33
|
}
|
|
34
34
|
getSysname() {
|
|
35
35
|
return this.getDest();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trm-core",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.3",
|
|
4
4
|
"description": "TRM (Transport Request Manager) Core",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"xml-js": "^1.6.11"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"trm-commons": "^3.2
|
|
71
|
+
"trm-commons": "^3.3.2"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@types/adm-zip": "^0.5.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@types/uuid": "^9.0.8",
|
|
87
87
|
"jest": "^29.7.0",
|
|
88
88
|
"rimraf": "^6.0.1",
|
|
89
|
-
"trm-commons": "^3.2
|
|
89
|
+
"trm-commons": "^3.3.2",
|
|
90
90
|
"ts-jest": "^29.1.2",
|
|
91
91
|
"ts-node": "^10.9.2",
|
|
92
92
|
"typescript": "^5.8.2"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getNpmGlobalPath(): Promise<string>;
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.getNpmGlobalPath = getNpmGlobalPath;
|
|
13
|
-
const child_process_1 = require("child_process");
|
|
14
|
-
const util_1 = require("util");
|
|
15
|
-
const trm_commons_1 = require("trm-commons");
|
|
16
|
-
function getNpmGlobalPath() {
|
|
17
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
trm_commons_1.Logger.loading(`Reading NPM global path...`);
|
|
19
|
-
const execPromise = (0, util_1.promisify)(child_process_1.exec);
|
|
20
|
-
const { stdout } = yield execPromise(`npm root -g`);
|
|
21
|
-
const globalPath = stdout.replace(/\n$/, '');
|
|
22
|
-
trm_commons_1.Logger.log(`NPM Global path: ${globalPath}`, true);
|
|
23
|
-
return globalPath;
|
|
24
|
-
});
|
|
25
|
-
}
|