@ikonintegration/ikapi 3.0.6 → 3.0.9
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/package.json +1 -1
- package/src/API/IKResponse.js +2 -1
- package/src/API/IKUtils.js +1 -1
- package/src/Logger/IKLogger.js +2 -1
package/package.json
CHANGED
package/src/API/IKResponse.js
CHANGED
|
@@ -10,6 +10,7 @@ export default class IKResponse {
|
|
|
10
10
|
this._isStream = false; //
|
|
11
11
|
this._contextRawBody = false;
|
|
12
12
|
this._throwOnErrors = false;
|
|
13
|
+
this.disableTransactionID = false;
|
|
13
14
|
//
|
|
14
15
|
this._headers = {
|
|
15
16
|
"Access-Control-Allow-Origin": "*",
|
|
@@ -27,7 +28,7 @@ export default class IKResponse {
|
|
|
27
28
|
if (this._isStream) return this._pipe(context);
|
|
28
29
|
|
|
29
30
|
//append default fields
|
|
30
|
-
if (transaction.request.getRequestID() && this._body) this.appendIntoBody('transactionID', transaction.request.getRequestID()); //append transaction ID
|
|
31
|
+
if (transaction.request.getRequestID() && this._body && !this.disableTransactionID) this.appendIntoBody('transactionID', transaction.request.getRequestID()); //append transaction ID
|
|
31
32
|
//Raw response support
|
|
32
33
|
if (this._contextRawBody) return this.rawContext(context, transaction);
|
|
33
34
|
|
package/src/API/IKUtils.js
CHANGED
|
@@ -4,7 +4,7 @@ import { convertToAttr, marshall, unmarshall } from "@aws-sdk/util-dynamodb";
|
|
|
4
4
|
//
|
|
5
5
|
export default class IKUtils {}
|
|
6
6
|
IKUtils.isOffline = function() { return process.env.IS_OFFLINE; }
|
|
7
|
-
IKUtils.
|
|
7
|
+
IKUtils.isHybridlessContainer = function() { return process.env.HYBRIDLESS_RUNTIME; }
|
|
8
8
|
IKUtils.logLevel = function() { return process.env.LOG_LEVEL; }
|
|
9
9
|
|
|
10
10
|
//formatting
|
package/src/Logger/IKLogger.js
CHANGED
|
@@ -30,6 +30,7 @@ export default class IKLogger {
|
|
|
30
30
|
this._setupBindings();
|
|
31
31
|
//
|
|
32
32
|
this.log("Using logger with level: " + LOG_STRINGS[this._LOG_LEVEL]);
|
|
33
|
+
this.debug("logger config: " + this._config);
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
//Public
|
|
@@ -79,7 +80,7 @@ export default class IKLogger {
|
|
|
79
80
|
_formattedLog(level, msg, caller, isRaw) {
|
|
80
81
|
if (Utils.isOffline()) {
|
|
81
82
|
return ` [${this._timestamp()} - ${LOG_STRINGS[level]}] [${caller}] ${msg.join(" ")}`;
|
|
82
|
-
} else if (Utils.
|
|
83
|
+
} else if (Utils.isHybridlessContainer() && this._transactionID) {
|
|
83
84
|
return (isRaw ? '' : ` ${this._transactionID}`) + ` [${LOG_STRINGS[level]}] [${caller}] ${this._supressSensitiveInfo(msg.join(" "))}`;
|
|
84
85
|
} else {
|
|
85
86
|
return ` [${LOG_STRINGS[level]}] [${caller}] ${msg.join(" ")}`;
|