trm-core 8.4.0 → 8.4.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/changelog.txt +4 -0
- package/dist/client/RFCClient.d.ts +1 -0
- package/dist/client/RFCClient.js +18 -1
- package/package.json +1 -1
package/changelog.txt
CHANGED
|
@@ -13,6 +13,7 @@ export declare class RFCClient implements IClient {
|
|
|
13
13
|
open(): Promise<void>;
|
|
14
14
|
close(): Promise<void>;
|
|
15
15
|
checkConnection(): Promise<boolean>;
|
|
16
|
+
private sanitizeDebugResponse;
|
|
16
17
|
private _call;
|
|
17
18
|
private _getMessage;
|
|
18
19
|
getMessage(data: SapMessage): Promise<string>;
|
package/dist/client/RFCClient.js
CHANGED
|
@@ -119,6 +119,23 @@ class RFCClient {
|
|
|
119
119
|
return (yield this.getRfcClient()).alive;
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
|
+
sanitizeDebugResponse(obj) {
|
|
123
|
+
if (Buffer.isBuffer(obj)) {
|
|
124
|
+
try {
|
|
125
|
+
return `<file of ${obj.byteLength} bytes>`;
|
|
126
|
+
}
|
|
127
|
+
catch (_a) {
|
|
128
|
+
return "<file of unknown bytes>";
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (Array.isArray(obj)) {
|
|
132
|
+
return obj.map(v => this.sanitizeDebugResponse(v));
|
|
133
|
+
}
|
|
134
|
+
if (obj && typeof obj === "object") {
|
|
135
|
+
return Object.fromEntries(Object.entries(obj).map(([k, v]) => [k, this.sanitizeDebugResponse(v)]));
|
|
136
|
+
}
|
|
137
|
+
return obj;
|
|
138
|
+
}
|
|
122
139
|
_call(fm_1, arg_1, timeout_1, noErrorParsing_1) {
|
|
123
140
|
return __awaiter(this, arguments, void 0, function* (fm, arg, timeout, noErrorParsing, retryCount = 0) {
|
|
124
141
|
var argNormalized;
|
|
@@ -147,7 +164,7 @@ class RFCClient {
|
|
|
147
164
|
trm_commons_1.Logger.loading(`Executing RFC, FM ${fm}, args ${JSON.stringify(argNormalized)}, opts ${JSON.stringify(callOptions)}`, true);
|
|
148
165
|
const response = yield (yield this.getRfcClient()).call(fm, argNormalized, callOptions);
|
|
149
166
|
const responseNormalized = (0, commons_1.normalize)(response);
|
|
150
|
-
trm_commons_1.Logger.success(`RFC resonse: ${JSON.stringify(responseNormalized)}`, true);
|
|
167
|
+
trm_commons_1.Logger.success(`RFC resonse: ${JSON.stringify(this.sanitizeDebugResponse(responseNormalized))}`, true);
|
|
151
168
|
return responseNormalized;
|
|
152
169
|
}
|
|
153
170
|
catch (e) {
|