@interopio/browser 4.4.0 → 4.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.md +2 -0
- package/dist/browser.es.js +117 -81
- package/dist/browser.es.js.map +1 -1
- package/dist/browser.umd.js +117 -81
- package/dist/browser.umd.js.map +1 -1
- package/dist/browser.umd.min.js +3 -3
- package/package.json +9 -13
package/dist/browser.umd.js
CHANGED
|
@@ -7783,7 +7783,7 @@
|
|
|
7783
7783
|
}
|
|
7784
7784
|
}
|
|
7785
7785
|
|
|
7786
|
-
var version$1 = "4.4.
|
|
7786
|
+
var version$1 = "4.4.1";
|
|
7787
7787
|
|
|
7788
7788
|
const setupGlobalSystem = (io, bridge) => {
|
|
7789
7789
|
return {
|
|
@@ -9832,6 +9832,83 @@
|
|
|
9832
9832
|
}
|
|
9833
9833
|
}
|
|
9834
9834
|
|
|
9835
|
+
function normalizeError(value) {
|
|
9836
|
+
if (value instanceof Error) {
|
|
9837
|
+
return value;
|
|
9838
|
+
}
|
|
9839
|
+
if (typeof value === "string") {
|
|
9840
|
+
return new Error(value);
|
|
9841
|
+
}
|
|
9842
|
+
const anyVal = value;
|
|
9843
|
+
const msgField = typeof anyVal?.message === "string" ? anyVal.message : undefined;
|
|
9844
|
+
const reasonField = typeof anyVal?.reason === "string" ? anyVal.reason : undefined;
|
|
9845
|
+
if (msgField !== undefined && msgField.length > 0) {
|
|
9846
|
+
return new Error(msgField);
|
|
9847
|
+
}
|
|
9848
|
+
if (reasonField !== undefined && reasonField.length > 0) {
|
|
9849
|
+
return new Error(reasonField);
|
|
9850
|
+
}
|
|
9851
|
+
if (msgField === "" || reasonField === "") {
|
|
9852
|
+
return new Error("");
|
|
9853
|
+
}
|
|
9854
|
+
return new Error(safeStringify$1(value));
|
|
9855
|
+
}
|
|
9856
|
+
function safeErrorStack(value) {
|
|
9857
|
+
try {
|
|
9858
|
+
if (value instanceof Error) {
|
|
9859
|
+
if (typeof value.stack === "string") {
|
|
9860
|
+
return value.stack;
|
|
9861
|
+
}
|
|
9862
|
+
if (typeof value.message === "string") {
|
|
9863
|
+
const name = typeof value.name === "string" && value.name.length > 0 ? value.name : "Error";
|
|
9864
|
+
return `${name}: ${value.message}`;
|
|
9865
|
+
}
|
|
9866
|
+
}
|
|
9867
|
+
if (typeof value === "string") {
|
|
9868
|
+
return value;
|
|
9869
|
+
}
|
|
9870
|
+
}
|
|
9871
|
+
catch { }
|
|
9872
|
+
return safeStringify$1(value);
|
|
9873
|
+
}
|
|
9874
|
+
function safeStringify$1(value) {
|
|
9875
|
+
try {
|
|
9876
|
+
const seen = new WeakSet();
|
|
9877
|
+
const json = JSON.stringify(value, (_key, v) => {
|
|
9878
|
+
if (typeof v === "bigint") {
|
|
9879
|
+
return `${v.toString()}n`;
|
|
9880
|
+
}
|
|
9881
|
+
if (typeof v === "function") {
|
|
9882
|
+
return "[Function]";
|
|
9883
|
+
}
|
|
9884
|
+
if (typeof v === "symbol") {
|
|
9885
|
+
return v.toString();
|
|
9886
|
+
}
|
|
9887
|
+
if (typeof v === "object" && v !== null) {
|
|
9888
|
+
if (seen.has(v)) {
|
|
9889
|
+
return "[Circular]";
|
|
9890
|
+
}
|
|
9891
|
+
seen.add(v);
|
|
9892
|
+
}
|
|
9893
|
+
return v;
|
|
9894
|
+
});
|
|
9895
|
+
if (json !== undefined) {
|
|
9896
|
+
return json;
|
|
9897
|
+
}
|
|
9898
|
+
}
|
|
9899
|
+
catch { }
|
|
9900
|
+
if (value !== null && typeof value === "object") {
|
|
9901
|
+
const ctor = value.constructor?.name ?? "Object";
|
|
9902
|
+
let keys = [];
|
|
9903
|
+
try {
|
|
9904
|
+
keys = Object.keys(value);
|
|
9905
|
+
}
|
|
9906
|
+
catch { }
|
|
9907
|
+
return keys.length > 0 ? `[${ctor} keys=${keys.join(",")}]` : `[${ctor}]`;
|
|
9908
|
+
}
|
|
9909
|
+
return String(value);
|
|
9910
|
+
}
|
|
9911
|
+
|
|
9835
9912
|
function domainSession (domain, connection, logger, successMessages, errorMessages) {
|
|
9836
9913
|
if (domain == null) {
|
|
9837
9914
|
domain = "global";
|
|
@@ -10067,7 +10144,7 @@
|
|
|
10067
10144
|
callback(msg);
|
|
10068
10145
|
}
|
|
10069
10146
|
catch (e) {
|
|
10070
|
-
logger.error(`Callback
|
|
10147
|
+
logger.error(`Callback failed: ${safeErrorStack(e)} \n msg was: ${JSON.stringify(msg)}`, e);
|
|
10071
10148
|
}
|
|
10072
10149
|
});
|
|
10073
10150
|
},
|
|
@@ -10083,65 +10160,6 @@
|
|
|
10083
10160
|
};
|
|
10084
10161
|
}
|
|
10085
10162
|
|
|
10086
|
-
function normalizeError(value) {
|
|
10087
|
-
if (value instanceof Error) {
|
|
10088
|
-
return value;
|
|
10089
|
-
}
|
|
10090
|
-
if (typeof value === "string") {
|
|
10091
|
-
return new Error(value);
|
|
10092
|
-
}
|
|
10093
|
-
const anyVal = value;
|
|
10094
|
-
const msgField = typeof anyVal?.message === "string" ? anyVal.message : undefined;
|
|
10095
|
-
const reasonField = typeof anyVal?.reason === "string" ? anyVal.reason : undefined;
|
|
10096
|
-
if (msgField !== undefined && msgField.length > 0) {
|
|
10097
|
-
return new Error(msgField);
|
|
10098
|
-
}
|
|
10099
|
-
if (reasonField !== undefined && reasonField.length > 0) {
|
|
10100
|
-
return new Error(reasonField);
|
|
10101
|
-
}
|
|
10102
|
-
if (msgField === "" || reasonField === "") {
|
|
10103
|
-
return new Error("");
|
|
10104
|
-
}
|
|
10105
|
-
return new Error(safeStringify$1(value));
|
|
10106
|
-
}
|
|
10107
|
-
function safeStringify$1(value) {
|
|
10108
|
-
try {
|
|
10109
|
-
const seen = new WeakSet();
|
|
10110
|
-
const json = JSON.stringify(value, (_key, v) => {
|
|
10111
|
-
if (typeof v === "bigint") {
|
|
10112
|
-
return `${v.toString()}n`;
|
|
10113
|
-
}
|
|
10114
|
-
if (typeof v === "function") {
|
|
10115
|
-
return "[Function]";
|
|
10116
|
-
}
|
|
10117
|
-
if (typeof v === "symbol") {
|
|
10118
|
-
return v.toString();
|
|
10119
|
-
}
|
|
10120
|
-
if (typeof v === "object" && v !== null) {
|
|
10121
|
-
if (seen.has(v)) {
|
|
10122
|
-
return "[Circular]";
|
|
10123
|
-
}
|
|
10124
|
-
seen.add(v);
|
|
10125
|
-
}
|
|
10126
|
-
return v;
|
|
10127
|
-
});
|
|
10128
|
-
if (json !== undefined) {
|
|
10129
|
-
return json;
|
|
10130
|
-
}
|
|
10131
|
-
}
|
|
10132
|
-
catch { }
|
|
10133
|
-
if (value !== null && typeof value === "object") {
|
|
10134
|
-
const ctor = value.constructor?.name ?? "Object";
|
|
10135
|
-
let keys = [];
|
|
10136
|
-
try {
|
|
10137
|
-
keys = Object.keys(value);
|
|
10138
|
-
}
|
|
10139
|
-
catch { }
|
|
10140
|
-
return keys.length > 0 ? `[${ctor} keys=${keys.join(",")}]` : `[${ctor}]`;
|
|
10141
|
-
}
|
|
10142
|
-
return String(value);
|
|
10143
|
-
}
|
|
10144
|
-
|
|
10145
10163
|
class Connection {
|
|
10146
10164
|
settings;
|
|
10147
10165
|
logger;
|
|
@@ -10400,7 +10418,7 @@
|
|
|
10400
10418
|
}
|
|
10401
10419
|
catch (error) {
|
|
10402
10420
|
try {
|
|
10403
|
-
this.logger.error(`Message handler failed with ${error
|
|
10421
|
+
this.logger.error(`Message handler failed with ${safeErrorStack(error)}`, error);
|
|
10404
10422
|
}
|
|
10405
10423
|
catch (loggerError) {
|
|
10406
10424
|
console.log("Message handler failed", error);
|
|
@@ -10878,7 +10896,7 @@
|
|
|
10878
10896
|
}
|
|
10879
10897
|
interop.invoke(Logger.InteropMethodName, args)
|
|
10880
10898
|
.catch((e) => {
|
|
10881
|
-
this.logFn.error(`Unable to send log message to the platform: ${e.message}`, e);
|
|
10899
|
+
this.logFn.error(`Unable to send log message to the platform: ${normalizeError(e).message}`, e);
|
|
10882
10900
|
});
|
|
10883
10901
|
}
|
|
10884
10902
|
}
|
|
@@ -10962,7 +10980,7 @@
|
|
|
10962
10980
|
}
|
|
10963
10981
|
};
|
|
10964
10982
|
|
|
10965
|
-
var version = "6.10.
|
|
10983
|
+
var version = "6.10.6";
|
|
10966
10984
|
|
|
10967
10985
|
/*!
|
|
10968
10986
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
@@ -11626,6 +11644,7 @@
|
|
|
11626
11644
|
(function (exports$1) {
|
|
11627
11645
|
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
11628
11646
|
exports$1.extractFilteringContextFromArgs = exports$1.deep_value = exports$1.getOTELData = exports$1.flattenOtelAtributes = void 0;
|
|
11647
|
+
exports$1.withTimeout = withTimeout;
|
|
11629
11648
|
const container_1 = requireContainer();
|
|
11630
11649
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
11631
11650
|
const flattenOtelAtributes = (data, maxDepth) => {
|
|
@@ -11743,6 +11762,19 @@
|
|
|
11743
11762
|
return filteringContext;
|
|
11744
11763
|
};
|
|
11745
11764
|
exports$1.extractFilteringContextFromArgs = extractFilteringContextFromArgs;
|
|
11765
|
+
function withTimeout(promise, timeout) {
|
|
11766
|
+
if (!promise) {
|
|
11767
|
+
return Promise.resolve();
|
|
11768
|
+
}
|
|
11769
|
+
if (!timeout) {
|
|
11770
|
+
return promise;
|
|
11771
|
+
}
|
|
11772
|
+
let timeoutId;
|
|
11773
|
+
return new Promise((rs, rj) => {
|
|
11774
|
+
timeoutId = setTimeout(rs, timeout);
|
|
11775
|
+
promise.then(() => rs(), rj);
|
|
11776
|
+
}).then(() => clearTimeout(timeoutId));
|
|
11777
|
+
}
|
|
11746
11778
|
|
|
11747
11779
|
} (otelUtils));
|
|
11748
11780
|
return otelUtils;
|
|
@@ -12403,21 +12435,11 @@
|
|
|
12403
12435
|
Builder.maybeAddResourceAttributesToAttributes(this.settings.logs);
|
|
12404
12436
|
Builder.maybeAddResourceAttributesToAttributes(this.settings.metrics);
|
|
12405
12437
|
Builder.maybeAddResourceAttributesToAttributes(this.settings.traces);
|
|
12406
|
-
Builder.
|
|
12407
|
-
Builder.
|
|
12408
|
-
Builder.
|
|
12409
|
-
Builder.
|
|
12410
|
-
Builder.
|
|
12411
|
-
Builder.propagateAttributeDown("useSSOAuthRawToken", this.settings, this.settings.traces);
|
|
12412
|
-
Builder.propagateAttributesDown("headers", this.settings, this.settings.logs);
|
|
12413
|
-
Builder.propagateAttributesDown("headers", this.settings, this.settings.metrics);
|
|
12414
|
-
Builder.propagateAttributesDown("headers", this.settings, this.settings.traces);
|
|
12415
|
-
Builder.propagateAttributesDown("additionalAttributes", this.settings, this.settings.logs);
|
|
12416
|
-
Builder.propagateAttributesDown("additionalResourceAttributes", this.settings, this.settings.logs);
|
|
12417
|
-
Builder.propagateAttributesDown("additionalAttributes", this.settings, this.settings.metrics);
|
|
12418
|
-
Builder.propagateAttributesDown("additionalResourceAttributes", this.settings, this.settings.metrics);
|
|
12419
|
-
Builder.propagateAttributesDown("additionalAttributes", this.settings, this.settings.traces);
|
|
12420
|
-
Builder.propagateAttributesDown("additionalResourceAttributes", this.settings, this.settings.traces);
|
|
12438
|
+
// Builder.propagateAttributeDownEx("useSSOAuth", this.settings);
|
|
12439
|
+
// Builder.propagateAttributeDownEx("useSSOAuthRawToken", this.settings);
|
|
12440
|
+
Builder.propagateAttributesDownEx("headers", this.settings);
|
|
12441
|
+
Builder.propagateAttributesDownEx("additionalAttributes", this.settings);
|
|
12442
|
+
Builder.propagateAttributesDownEx("additionalResourceAttributes", this.settings);
|
|
12421
12443
|
const metricsBuilder = (_g = this.metricsBuilder) !== null && _g !== void 0 ? _g : this.withMetrics();
|
|
12422
12444
|
const metrics = metricsBuilder
|
|
12423
12445
|
.withLogger(this.logger)
|
|
@@ -12445,6 +12467,11 @@
|
|
|
12445
12467
|
}
|
|
12446
12468
|
settings[k] = (_a = settings[k]) !== null && _a !== void 0 ? _a : otelSettings[k];
|
|
12447
12469
|
}
|
|
12470
|
+
static propagateAttributeDownEx(k, otelSettings) {
|
|
12471
|
+
Builder.propagateAttributeDown(k, otelSettings, otelSettings.logs);
|
|
12472
|
+
Builder.propagateAttributeDown(k, otelSettings, otelSettings.metrics);
|
|
12473
|
+
Builder.propagateAttributeDown(k, otelSettings, otelSettings.traces);
|
|
12474
|
+
}
|
|
12448
12475
|
static propagateAttributesDown(k, otelSettings, settings) {
|
|
12449
12476
|
var _a, _b;
|
|
12450
12477
|
if (!settings) {
|
|
@@ -12452,7 +12479,15 @@
|
|
|
12452
12479
|
}
|
|
12453
12480
|
const providedOtel = (_a = otelSettings[k]) !== null && _a !== void 0 ? _a : {};
|
|
12454
12481
|
const provided = (_b = settings[k]) !== null && _b !== void 0 ? _b : {};
|
|
12455
|
-
settings[k] = () =>
|
|
12482
|
+
settings[k] = () => {
|
|
12483
|
+
var _a, _b, _c;
|
|
12484
|
+
return ((0, _1.flattenOtelAtributes)(Object.assign(Object.assign({}, container_1.Container.errorless(providedOtel)), container_1.Container.errorless(provided)), (_c = (_a = settings.maxAttributeDepth) !== null && _a !== void 0 ? _a : (_b = settings.defaults) === null || _b === void 0 ? void 0 : _b.maxAttributeDepth) !== null && _c !== void 0 ? _c : 5));
|
|
12485
|
+
};
|
|
12486
|
+
}
|
|
12487
|
+
static propagateAttributesDownEx(k, otelSettings) {
|
|
12488
|
+
Builder.propagateAttributesDown(k, otelSettings, otelSettings.logs);
|
|
12489
|
+
Builder.propagateAttributesDown(k, otelSettings, otelSettings.metrics);
|
|
12490
|
+
Builder.propagateAttributesDown(k, otelSettings, otelSettings.traces);
|
|
12456
12491
|
}
|
|
12457
12492
|
static maybeAddResourceAttributesToAttributes(settings) {
|
|
12458
12493
|
if (settings === null || settings === void 0 ? void 0 : settings.addResourceAttributesToAttributes) {
|
|
@@ -12880,7 +12915,7 @@
|
|
|
12880
12915
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12881
12916
|
};
|
|
12882
12917
|
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
12883
|
-
exports$1.SpanStatusCode = exports$1.deep_value = exports$1.extractFilteringContextFromArgs = exports$1.getOTELData = exports$1.flattenOtelAtributes = exports$1.safeStringify = exports$1.isNode = exports$1.loadInsightsPlugin = exports$1.registerInsightsPlugin = exports$1.Logs = exports$1.NullTracingState = exports$1.OTEL_PI_KEY = exports$1.withSpan = exports$1.Traces = exports$1.MetricsDependencyBuilder = exports$1.NullMetric = exports$1.Container = exports$1.Log4jsWrapper = exports$1.Builder = void 0;
|
|
12918
|
+
exports$1.SpanStatusCode = exports$1.withTimeout = exports$1.deep_value = exports$1.extractFilteringContextFromArgs = exports$1.getOTELData = exports$1.flattenOtelAtributes = exports$1.safeStringify = exports$1.isNode = exports$1.loadInsightsPlugin = exports$1.registerInsightsPlugin = exports$1.Logs = exports$1.NullTracingState = exports$1.OTEL_PI_KEY = exports$1.withSpan = exports$1.Traces = exports$1.MetricsDependencyBuilder = exports$1.NullMetric = exports$1.Container = exports$1.Log4jsWrapper = exports$1.Builder = void 0;
|
|
12884
12919
|
var builder_1 = requireBuilder();
|
|
12885
12920
|
Object.defineProperty(exports$1, "Builder", { enumerable: true, get: function () { return builder_1.Builder; } });
|
|
12886
12921
|
var log4jsWrapper_1 = requireLog4jsWrapper();
|
|
@@ -12911,6 +12946,7 @@
|
|
|
12911
12946
|
Object.defineProperty(exports$1, "flattenOtelAtributes", { enumerable: true, get: function () { return otelUtils_1.flattenOtelAtributes; } });
|
|
12912
12947
|
Object.defineProperty(exports$1, "extractFilteringContextFromArgs", { enumerable: true, get: function () { return otelUtils_1.extractFilteringContextFromArgs; } });
|
|
12913
12948
|
Object.defineProperty(exports$1, "deep_value", { enumerable: true, get: function () { return otelUtils_1.deep_value; } });
|
|
12949
|
+
Object.defineProperty(exports$1, "withTimeout", { enumerable: true, get: function () { return otelUtils_1.withTimeout; } });
|
|
12914
12950
|
if (typeof Promise !== "undefined") {
|
|
12915
12951
|
Promise.allSettled = Promise.allSettled || ((promises) => Promise.all(promises.map((p) => p
|
|
12916
12952
|
.then((value) => ({
|