@xeno-js/core 4.1.2 → 4.1.4
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/dist/index.cjs +20 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +243 -228
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -977,7 +977,23 @@ var LoggerUtils = Object.freeze({
|
|
|
977
977
|
},
|
|
978
978
|
messaging: ctx?.messaging
|
|
979
979
|
};
|
|
980
|
-
return import_shared32.StringHelper.
|
|
980
|
+
return import_shared32.StringHelper.safeStringifyObject(context);
|
|
981
|
+
},
|
|
982
|
+
toNormalizeError(error) {
|
|
983
|
+
if (error instanceof Error) {
|
|
984
|
+
return {
|
|
985
|
+
message: error.message,
|
|
986
|
+
name: error.name,
|
|
987
|
+
stack: error.stack,
|
|
988
|
+
cause: error.cause
|
|
989
|
+
};
|
|
990
|
+
}
|
|
991
|
+
const errorString = import_shared32.Guards.isString(error) ? error : import_shared32.StringHelper.safeStringify(error);
|
|
992
|
+
const customError = new Error(errorString);
|
|
993
|
+
if (import_shared32.Guards.isObject(error) && import_shared32.Guards.isDefined(error)) {
|
|
994
|
+
Object.assign(customError, error);
|
|
995
|
+
}
|
|
996
|
+
return customError;
|
|
981
997
|
}
|
|
982
998
|
});
|
|
983
999
|
|
|
@@ -1749,8 +1765,8 @@ var HttpHeaderExtractor = class {
|
|
|
1749
1765
|
const clientIp = headers.get(this._trustedIp?.toLowerCase() ?? "x-forwarded-for") ?? headers.get("x-real-ip") ?? void 0;
|
|
1750
1766
|
const spanId = import_shared44.GuidHelper.parse(headers.get("x-span-id") ?? void 0);
|
|
1751
1767
|
const parentSpanId = headers.get("x-parent-span-id") ?? void 0;
|
|
1752
|
-
const acceptHeader = headers.get("accept");
|
|
1753
|
-
const contentTypeHeader = headers.get("content-type");
|
|
1768
|
+
const acceptHeader = headers.get("accept") ?? void 0;
|
|
1769
|
+
const contentTypeHeader = headers.get("content-type") ?? void 0;
|
|
1754
1770
|
const userAgent = headers.get("user-agent") ?? void 0;
|
|
1755
1771
|
const returnAddress = headers.get("x-return-address") ?? void 0;
|
|
1756
1772
|
const sequenceId = headers.get("x-sequence-id") ?? void 0;
|
|
@@ -1767,8 +1783,7 @@ var HttpHeaderExtractor = class {
|
|
|
1767
1783
|
const cleanOrigin = import_shared44.HttpHelper.sanitizeOriginUrl(origin);
|
|
1768
1784
|
const referer = headers.get("referer") ?? void 0;
|
|
1769
1785
|
const cleanReferer = import_shared44.HttpHelper.sanitizeOriginUrl(referer);
|
|
1770
|
-
const
|
|
1771
|
-
const formatIndicator = accept ?? contentTypeHeader ?? "application/json";
|
|
1786
|
+
const formatIndicator = import_shared44.HttpHelper.resolveFormatIndicator(acceptHeader, contentTypeHeader);
|
|
1772
1787
|
const metadata = {
|
|
1773
1788
|
correlationId,
|
|
1774
1789
|
requestId,
|