@interopio/browser 4.5.0-beta.0 → 4.5.0
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/browser.d.ts +82 -9
- package/changelog.md +8 -1
- package/dist/browser.es.js +178 -98
- package/dist/browser.es.js.map +1 -1
- package/dist/browser.umd.js +178 -98
- package/dist/browser.umd.js.map +1 -1
- package/dist/browser.umd.min.js +3 -3
- package/package.json +12 -16
package/dist/browser.umd.js
CHANGED
|
@@ -2211,7 +2211,7 @@
|
|
|
2211
2211
|
const libDomainDecoder = oneOf$1(constant$2("system"), constant$2("windows"), constant$2("appManager"), constant$2("layouts"), constant$2("intents"), constant$2("notifications"), constant$2("channels"), constant$2("extension"), constant$2("themes"), constant$2("prefs"), constant$2("ui"));
|
|
2212
2212
|
const windowOperationTypesDecoder = oneOf$1(constant$2("openWindow"), constant$2("windowHello"), constant$2("windowAdded"), constant$2("windowRemoved"), constant$2("getBounds"), constant$2("getFrameBounds"), constant$2("getUrl"), constant$2("moveResize"), constant$2("focus"), constant$2("close"), constant$2("getTitle"), constant$2("setTitle"), constant$2("focusChange"), constant$2("getChannel"), constant$2("notifyChannelsChanged"), constant$2("setZoomFactor"), constant$2("zoomFactorChange"), constant$2("refresh"), constant$2("operationCheck"));
|
|
2213
2213
|
const appManagerOperationTypesDecoder = oneOf$1(constant$2("appHello"), constant$2("appDirectoryStateChange"), constant$2("instanceStarted"), constant$2("instanceStopped"), constant$2("applicationStart"), constant$2("instanceStop"), constant$2("clear"), constant$2("operationCheck"));
|
|
2214
|
-
const layoutsOperationTypesDecoder = oneOf$1(constant$2("layoutAdded"), constant$2("layoutChanged"), constant$2("layoutRemoved"), constant$2("layoutRenamed"), constant$2("get"), constant$2("getAll"), constant$2("export"), constant$2("import"), constant$2("remove"), constant$2("rename"), constant$2("clientSaveRequest"), constant$2("getGlobalPermissionState"), constant$2("checkGlobalActivated"), constant$2("requestGlobalPermission"), constant$2("getDefaultGlobal"), constant$2("setDefaultGlobal"), constant$2("clearDefaultGlobal"), constant$2("updateMetadata"), constant$2("operationCheck"), constant$2("getCurrent"), constant$2("defaultLayoutChanged"), constant$2("layoutRestored"));
|
|
2214
|
+
const layoutsOperationTypesDecoder = oneOf$1(constant$2("layoutAdded"), constant$2("layoutChanged"), constant$2("layoutRemoved"), constant$2("layoutRenamed"), constant$2("get"), constant$2("getAll"), constant$2("getLayoutContents"), constant$2("export"), constant$2("import"), constant$2("remove"), constant$2("rename"), constant$2("clientSaveRequest"), constant$2("getGlobalPermissionState"), constant$2("checkGlobalActivated"), constant$2("requestGlobalPermission"), constant$2("getDefaultGlobal"), constant$2("setDefaultGlobal"), constant$2("clearDefaultGlobal"), constant$2("updateMetadata"), constant$2("operationCheck"), constant$2("getCurrent"), constant$2("defaultLayoutChanged"), constant$2("layoutRestored"));
|
|
2215
2215
|
const notificationsOperationTypesDecoder = oneOf$1(constant$2("raiseNotification"), constant$2("requestPermission"), constant$2("notificationShow"), constant$2("notificationClick"), constant$2("getPermission"), constant$2("list"), constant$2("notificationRaised"), constant$2("notificationClosed"), constant$2("click"), constant$2("clear"), constant$2("clearAll"), constant$2("configure"), constant$2("getConfiguration"), constant$2("configurationChanged"), constant$2("setState"), constant$2("clearOld"), constant$2("activeCountChange"), constant$2("stateChange"), constant$2("operationCheck"), constant$2("getActiveCount"));
|
|
2216
2216
|
const systemOperationTypesDecoder = oneOf$1(constant$2("getEnvironment"), constant$2("getBase"), constant$2("platformShutdown"), constant$2("isFdc3DataWrappingSupported"), constant$2("clientError"), constant$2("systemHello"), constant$2("operationCheck"));
|
|
2217
2217
|
const windowRelativeDirectionDecoder = oneOf$1(constant$2("top"), constant$2("left"), constant$2("right"), constant$2("bottom"));
|
|
@@ -2306,6 +2306,9 @@
|
|
|
2306
2306
|
const iframePermissionsPolicyConfigDecoder = object$2({
|
|
2307
2307
|
flags: string$2()
|
|
2308
2308
|
});
|
|
2309
|
+
const iframeSandboxConfigDecoder = object$2({
|
|
2310
|
+
flags: string$2()
|
|
2311
|
+
});
|
|
2309
2312
|
const workspacesSandboxDecoder = object$2({
|
|
2310
2313
|
flags: string$2()
|
|
2311
2314
|
});
|
|
@@ -2324,7 +2327,8 @@
|
|
|
2324
2327
|
height: optional$2(nonNegativeNumberDecoder$2),
|
|
2325
2328
|
workspacesSandbox: optional$2(workspacesSandboxDecoder),
|
|
2326
2329
|
channelSelector: optional$2(channelSelectorDecoder$1),
|
|
2327
|
-
iframePermissionsPolicy: optional$2(iframePermissionsPolicyConfigDecoder)
|
|
2330
|
+
iframePermissionsPolicy: optional$2(iframePermissionsPolicyConfigDecoder),
|
|
2331
|
+
iframeSandbox: optional$2(iframeSandboxConfigDecoder)
|
|
2328
2332
|
});
|
|
2329
2333
|
const intentDefinitionDecoder = object$2({
|
|
2330
2334
|
name: nonEmptyStringDecoder$2,
|
|
@@ -2501,6 +2505,17 @@
|
|
|
2501
2505
|
closeMe: optional$2(boolean$2()),
|
|
2502
2506
|
timeout: optional$2(nonNegativeNumberDecoder$2)
|
|
2503
2507
|
});
|
|
2508
|
+
const getContentsOptionsDecoder = object$2({
|
|
2509
|
+
name: nonEmptyStringDecoder$2,
|
|
2510
|
+
type: layoutTypeDecoder
|
|
2511
|
+
});
|
|
2512
|
+
const layoutContentsResultDecoder = object$2({
|
|
2513
|
+
contents: object$2({
|
|
2514
|
+
appComponents: array$2(oneOf$1(windowLayoutComponentDecoder, workspaceLayoutComponentDecoder, workspaceFrameComponentDecoder)),
|
|
2515
|
+
workspaceComponents: array$2(workspaceLayoutComponentStateDecoder),
|
|
2516
|
+
workspaceWindows: array$2(windowLayoutItemDecoder)
|
|
2517
|
+
})
|
|
2518
|
+
});
|
|
2504
2519
|
const layoutSummaryDecoder = object$2({
|
|
2505
2520
|
name: nonEmptyStringDecoder$2,
|
|
2506
2521
|
type: layoutTypeDecoder,
|
|
@@ -2722,10 +2737,10 @@
|
|
|
2722
2737
|
name: optional$2(nonEmptyStringDecoder$2),
|
|
2723
2738
|
fdc3: optional$2(boolean$2())
|
|
2724
2739
|
})));
|
|
2725
|
-
const
|
|
2740
|
+
const leaveChannelsConfigDecoder = oneOf$1(nonEmptyStringDecoder$2, object$2({
|
|
2726
2741
|
windowId: optionalNonEmptyStringDecoder,
|
|
2727
2742
|
channel: optionalNonEmptyStringDecoder
|
|
2728
|
-
});
|
|
2743
|
+
}));
|
|
2729
2744
|
const fdc3ContextDecoder = anyJson$2().where((value) => typeof value.type === "string", "Expected a valid FDC3 Context with compulsory 'type' field");
|
|
2730
2745
|
const interopActionSettingsDecoder = object$2({
|
|
2731
2746
|
method: nonEmptyStringDecoder$2,
|
|
@@ -2879,7 +2894,8 @@
|
|
|
2879
2894
|
sourceFilter: object$2({
|
|
2880
2895
|
allowed: array$2(nonEmptyStringDecoder$2),
|
|
2881
2896
|
blocked: array$2(nonEmptyStringDecoder$2)
|
|
2882
|
-
})
|
|
2897
|
+
}),
|
|
2898
|
+
showNotificationBadge: optional$2(boolean$2())
|
|
2883
2899
|
})
|
|
2884
2900
|
});
|
|
2885
2901
|
const platformSaveRequestConfigDecoder = object$2({
|
|
@@ -4366,7 +4382,12 @@
|
|
|
4366
4382
|
}
|
|
4367
4383
|
getApplication(name) {
|
|
4368
4384
|
const verifiedName = runDecoderWithIOError(nonEmptyStringDecoder$2, name);
|
|
4369
|
-
|
|
4385
|
+
const application = this.applications.find((app) => app.name === verifiedName);
|
|
4386
|
+
const iframeSandbox = application?.userProperties?.details?.iframeSandbox;
|
|
4387
|
+
if (iframeSandbox) {
|
|
4388
|
+
application.userProperties.details.workspacesSandbox = iframeSandbox;
|
|
4389
|
+
}
|
|
4390
|
+
return application;
|
|
4370
4391
|
}
|
|
4371
4392
|
getInstances() {
|
|
4372
4393
|
return this.instances.slice();
|
|
@@ -4676,6 +4697,7 @@
|
|
|
4676
4697
|
layoutRenamed: { name: "layoutRenamed", dataDecoder: renamedLayoutNotificationDecoder },
|
|
4677
4698
|
get: { name: "get", dataDecoder: simpleLayoutConfigDecoder, resultDecoder: optionalSimpleLayoutResult },
|
|
4678
4699
|
getAll: { name: "getAll", dataDecoder: getAllLayoutsConfigDecoder, resultDecoder: allLayoutsSummariesResultDecoder },
|
|
4700
|
+
getLayoutContents: { name: "getLayoutContents", dataDecoder: getContentsOptionsDecoder, resultDecoder: layoutContentsResultDecoder },
|
|
4679
4701
|
export: { name: "export", dataDecoder: getAllLayoutsConfigDecoder, resultDecoder: allLayoutsFullConfigDecoder },
|
|
4680
4702
|
import: { name: "import", dataDecoder: layoutsImportConfigDecoder },
|
|
4681
4703
|
remove: { name: "remove", dataDecoder: simpleLayoutConfigDecoder },
|
|
@@ -4731,6 +4753,7 @@
|
|
|
4731
4753
|
const api = {
|
|
4732
4754
|
get: this.get.bind(this),
|
|
4733
4755
|
getAll: this.getAll.bind(this),
|
|
4756
|
+
getLayoutContents: this.getLayoutContents.bind(this),
|
|
4734
4757
|
getCurrentLayout: this.getCurrentLayout.bind(this),
|
|
4735
4758
|
export: this.exportLayouts.bind(this),
|
|
4736
4759
|
import: this.importLayouts.bind(this),
|
|
@@ -4781,6 +4804,15 @@
|
|
|
4781
4804
|
const result = await this.bridge.send("layouts", operations$8.getAll, { type });
|
|
4782
4805
|
return result.summaries;
|
|
4783
4806
|
}
|
|
4807
|
+
async getLayoutContents(options) {
|
|
4808
|
+
runDecoderWithIOError(getContentsOptionsDecoder, options);
|
|
4809
|
+
const { name, type } = options;
|
|
4810
|
+
if (type !== "Workspace" && type !== "Global") {
|
|
4811
|
+
return ioError.raiseError(`getLayoutContents is only supported for Workspace and Global layouts, but got type "${type}"`);
|
|
4812
|
+
}
|
|
4813
|
+
const result = await this.bridge.send("layouts", operations$8.getLayoutContents, { name, type }, undefined, { includeOperationCheck: true });
|
|
4814
|
+
return result.contents;
|
|
4815
|
+
}
|
|
4784
4816
|
async exportLayouts(type) {
|
|
4785
4817
|
runDecoderWithIOError(layoutTypeDecoder, type);
|
|
4786
4818
|
const result = await this.bridge.send("layouts", operations$8.export, { type });
|
|
@@ -4960,7 +4992,7 @@
|
|
|
4960
4992
|
clear: { name: "clear" },
|
|
4961
4993
|
clearAll: { name: "clearAll" },
|
|
4962
4994
|
clearOld: { name: "clearOld" },
|
|
4963
|
-
configure: { name: "configure", dataDecoder: notificationsConfigurationProtocolDecoder },
|
|
4995
|
+
configure: { name: "configure", dataDecoder: notificationsConfigurationProtocolDecoder, resultDecoder: strictNotificationsConfigurationProtocolDecoder },
|
|
4964
4996
|
getConfiguration: { name: "getConfiguration", resultDecoder: strictNotificationsConfigurationProtocolDecoder },
|
|
4965
4997
|
getActiveCount: { name: "getActiveCount", resultDecoder: activeNotificationsCountChangeDecoder },
|
|
4966
4998
|
configurationChanged: { name: "configurationChanged", resultDecoder: strictNotificationsConfigurationProtocolDecoder },
|
|
@@ -5104,7 +5136,8 @@
|
|
|
5104
5136
|
}
|
|
5105
5137
|
async configure(config) {
|
|
5106
5138
|
const verifiedConfig = runDecoderWithIOError(notificationsConfigurationDecoder, config);
|
|
5107
|
-
await this.bridge.send("notifications", operations$7.configure, { configuration: verifiedConfig }, undefined, { includeOperationCheck: true });
|
|
5139
|
+
const response = await this.bridge.send("notifications", operations$7.configure, { configuration: verifiedConfig }, undefined, { includeOperationCheck: true });
|
|
5140
|
+
return response.configuration;
|
|
5108
5141
|
}
|
|
5109
5142
|
async getConfiguration() {
|
|
5110
5143
|
const response = await this.bridge.send("notifications", operations$7.getConfiguration, undefined, undefined, { includeOperationCheck: true });
|
|
@@ -5760,12 +5793,14 @@
|
|
|
5760
5793
|
return this.changed(callback);
|
|
5761
5794
|
}
|
|
5762
5795
|
async leave(config = {}) {
|
|
5763
|
-
runDecoderWithIOError(
|
|
5764
|
-
|
|
5796
|
+
const decodedConfig = runDecoderWithIOError(leaveChannelsConfigDecoder, config);
|
|
5797
|
+
const channelName = typeof decodedConfig === "string" ? undefined : decodedConfig.channel;
|
|
5798
|
+
const windowId = typeof decodedConfig === "string" ? decodedConfig : decodedConfig.windowId;
|
|
5799
|
+
if (channelName) {
|
|
5765
5800
|
const channelNames = this.getAllChannelNames();
|
|
5766
|
-
runDecoderWithIOError(channelNameDecoder(channelNames),
|
|
5801
|
+
runDecoderWithIOError(channelNameDecoder(channelNames), channelName);
|
|
5767
5802
|
}
|
|
5768
|
-
const leaveData = { channelName
|
|
5803
|
+
const leaveData = { channelName, windowId: windowId ?? this.myWindowId };
|
|
5769
5804
|
await this.bridge.send("channels", operations$5.leaveChannel, leaveData, undefined, { includeOperationCheck: true });
|
|
5770
5805
|
}
|
|
5771
5806
|
async handleAppManagerInitialChannelId(channel) {
|
|
@@ -6148,12 +6183,13 @@
|
|
|
6148
6183
|
windowId: restrictions.windowId ?? this.myWindowId
|
|
6149
6184
|
}
|
|
6150
6185
|
};
|
|
6151
|
-
|
|
6186
|
+
await this.bridge.send("channels", operations$5.restrictAll, configData, undefined, { includeOperationCheck: true });
|
|
6152
6187
|
}
|
|
6153
6188
|
async handleRestrictAll({ restrictions }) {
|
|
6154
6189
|
const currentChannel = await this.getMy();
|
|
6155
6190
|
if (!currentChannel) {
|
|
6156
|
-
|
|
6191
|
+
this.updateAllRestrictions(restrictions);
|
|
6192
|
+
return;
|
|
6157
6193
|
}
|
|
6158
6194
|
const prevReadAllowed = this.isAllowedByRestrictions(currentChannel.name, "read");
|
|
6159
6195
|
this.updateAllRestrictions(restrictions);
|
|
@@ -7786,7 +7822,7 @@
|
|
|
7786
7822
|
}
|
|
7787
7823
|
}
|
|
7788
7824
|
|
|
7789
|
-
var version$1 = "4.5.0
|
|
7825
|
+
var version$1 = "4.5.0";
|
|
7790
7826
|
|
|
7791
7827
|
const setupGlobalSystem = (io, bridge) => {
|
|
7792
7828
|
return {
|
|
@@ -9219,9 +9255,9 @@
|
|
|
9219
9255
|
}
|
|
9220
9256
|
}
|
|
9221
9257
|
|
|
9222
|
-
/* @ts-self-types="./index.d.ts" */
|
|
9223
9258
|
let urlAlphabet =
|
|
9224
9259
|
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
|
|
9260
|
+
|
|
9225
9261
|
let nanoid = (size = 21) => {
|
|
9226
9262
|
let id = '';
|
|
9227
9263
|
let i = size | 0;
|
|
@@ -9775,6 +9811,10 @@
|
|
|
9775
9811
|
return window.name.substring(0, window.name.indexOf("#wsp"));
|
|
9776
9812
|
}
|
|
9777
9813
|
if (window !== window.top) {
|
|
9814
|
+
const ifrIndex = window.name.indexOf("#ifr");
|
|
9815
|
+
if (ifrIndex !== -1) {
|
|
9816
|
+
return window.name.substring(0, ifrIndex);
|
|
9817
|
+
}
|
|
9778
9818
|
return;
|
|
9779
9819
|
}
|
|
9780
9820
|
if (window.name?.includes("g42")) {
|
|
@@ -9835,6 +9875,83 @@
|
|
|
9835
9875
|
}
|
|
9836
9876
|
}
|
|
9837
9877
|
|
|
9878
|
+
function normalizeError(value) {
|
|
9879
|
+
if (value instanceof Error) {
|
|
9880
|
+
return value;
|
|
9881
|
+
}
|
|
9882
|
+
if (typeof value === "string") {
|
|
9883
|
+
return new Error(value);
|
|
9884
|
+
}
|
|
9885
|
+
const anyVal = value;
|
|
9886
|
+
const msgField = typeof anyVal?.message === "string" ? anyVal.message : undefined;
|
|
9887
|
+
const reasonField = typeof anyVal?.reason === "string" ? anyVal.reason : undefined;
|
|
9888
|
+
if (msgField !== undefined && msgField.length > 0) {
|
|
9889
|
+
return new Error(msgField);
|
|
9890
|
+
}
|
|
9891
|
+
if (reasonField !== undefined && reasonField.length > 0) {
|
|
9892
|
+
return new Error(reasonField);
|
|
9893
|
+
}
|
|
9894
|
+
if (msgField === "" || reasonField === "") {
|
|
9895
|
+
return new Error("");
|
|
9896
|
+
}
|
|
9897
|
+
return new Error(safeStringify$1(value));
|
|
9898
|
+
}
|
|
9899
|
+
function safeErrorStack(value) {
|
|
9900
|
+
try {
|
|
9901
|
+
if (value instanceof Error) {
|
|
9902
|
+
if (typeof value.stack === "string") {
|
|
9903
|
+
return value.stack;
|
|
9904
|
+
}
|
|
9905
|
+
if (typeof value.message === "string") {
|
|
9906
|
+
const name = typeof value.name === "string" && value.name.length > 0 ? value.name : "Error";
|
|
9907
|
+
return `${name}: ${value.message}`;
|
|
9908
|
+
}
|
|
9909
|
+
}
|
|
9910
|
+
if (typeof value === "string") {
|
|
9911
|
+
return value;
|
|
9912
|
+
}
|
|
9913
|
+
}
|
|
9914
|
+
catch { }
|
|
9915
|
+
return safeStringify$1(value);
|
|
9916
|
+
}
|
|
9917
|
+
function safeStringify$1(value) {
|
|
9918
|
+
try {
|
|
9919
|
+
const seen = new WeakSet();
|
|
9920
|
+
const json = JSON.stringify(value, (_key, v) => {
|
|
9921
|
+
if (typeof v === "bigint") {
|
|
9922
|
+
return `${v.toString()}n`;
|
|
9923
|
+
}
|
|
9924
|
+
if (typeof v === "function") {
|
|
9925
|
+
return "[Function]";
|
|
9926
|
+
}
|
|
9927
|
+
if (typeof v === "symbol") {
|
|
9928
|
+
return v.toString();
|
|
9929
|
+
}
|
|
9930
|
+
if (typeof v === "object" && v !== null) {
|
|
9931
|
+
if (seen.has(v)) {
|
|
9932
|
+
return "[Circular]";
|
|
9933
|
+
}
|
|
9934
|
+
seen.add(v);
|
|
9935
|
+
}
|
|
9936
|
+
return v;
|
|
9937
|
+
});
|
|
9938
|
+
if (json !== undefined) {
|
|
9939
|
+
return json;
|
|
9940
|
+
}
|
|
9941
|
+
}
|
|
9942
|
+
catch { }
|
|
9943
|
+
if (value !== null && typeof value === "object") {
|
|
9944
|
+
const ctor = value.constructor?.name ?? "Object";
|
|
9945
|
+
let keys = [];
|
|
9946
|
+
try {
|
|
9947
|
+
keys = Object.keys(value);
|
|
9948
|
+
}
|
|
9949
|
+
catch { }
|
|
9950
|
+
return keys.length > 0 ? `[${ctor} keys=${keys.join(",")}]` : `[${ctor}]`;
|
|
9951
|
+
}
|
|
9952
|
+
return String(value);
|
|
9953
|
+
}
|
|
9954
|
+
|
|
9838
9955
|
function domainSession (domain, connection, logger, successMessages, errorMessages) {
|
|
9839
9956
|
if (domain == null) {
|
|
9840
9957
|
domain = "global";
|
|
@@ -10070,7 +10187,7 @@
|
|
|
10070
10187
|
callback(msg);
|
|
10071
10188
|
}
|
|
10072
10189
|
catch (e) {
|
|
10073
|
-
logger.error(`Callback
|
|
10190
|
+
logger.error(`Callback failed: ${safeErrorStack(e)} \n msg was: ${JSON.stringify(msg)}`, e);
|
|
10074
10191
|
}
|
|
10075
10192
|
});
|
|
10076
10193
|
},
|
|
@@ -10086,65 +10203,6 @@
|
|
|
10086
10203
|
};
|
|
10087
10204
|
}
|
|
10088
10205
|
|
|
10089
|
-
function normalizeError(value) {
|
|
10090
|
-
if (value instanceof Error) {
|
|
10091
|
-
return value;
|
|
10092
|
-
}
|
|
10093
|
-
if (typeof value === "string") {
|
|
10094
|
-
return new Error(value);
|
|
10095
|
-
}
|
|
10096
|
-
const anyVal = value;
|
|
10097
|
-
const msgField = typeof anyVal?.message === "string" ? anyVal.message : undefined;
|
|
10098
|
-
const reasonField = typeof anyVal?.reason === "string" ? anyVal.reason : undefined;
|
|
10099
|
-
if (msgField !== undefined && msgField.length > 0) {
|
|
10100
|
-
return new Error(msgField);
|
|
10101
|
-
}
|
|
10102
|
-
if (reasonField !== undefined && reasonField.length > 0) {
|
|
10103
|
-
return new Error(reasonField);
|
|
10104
|
-
}
|
|
10105
|
-
if (msgField === "" || reasonField === "") {
|
|
10106
|
-
return new Error("");
|
|
10107
|
-
}
|
|
10108
|
-
return new Error(safeStringify$1(value));
|
|
10109
|
-
}
|
|
10110
|
-
function safeStringify$1(value) {
|
|
10111
|
-
try {
|
|
10112
|
-
const seen = new WeakSet();
|
|
10113
|
-
const json = JSON.stringify(value, (_key, v) => {
|
|
10114
|
-
if (typeof v === "bigint") {
|
|
10115
|
-
return `${v.toString()}n`;
|
|
10116
|
-
}
|
|
10117
|
-
if (typeof v === "function") {
|
|
10118
|
-
return "[Function]";
|
|
10119
|
-
}
|
|
10120
|
-
if (typeof v === "symbol") {
|
|
10121
|
-
return v.toString();
|
|
10122
|
-
}
|
|
10123
|
-
if (typeof v === "object" && v !== null) {
|
|
10124
|
-
if (seen.has(v)) {
|
|
10125
|
-
return "[Circular]";
|
|
10126
|
-
}
|
|
10127
|
-
seen.add(v);
|
|
10128
|
-
}
|
|
10129
|
-
return v;
|
|
10130
|
-
});
|
|
10131
|
-
if (json !== undefined) {
|
|
10132
|
-
return json;
|
|
10133
|
-
}
|
|
10134
|
-
}
|
|
10135
|
-
catch { }
|
|
10136
|
-
if (value !== null && typeof value === "object") {
|
|
10137
|
-
const ctor = value.constructor?.name ?? "Object";
|
|
10138
|
-
let keys = [];
|
|
10139
|
-
try {
|
|
10140
|
-
keys = Object.keys(value);
|
|
10141
|
-
}
|
|
10142
|
-
catch { }
|
|
10143
|
-
return keys.length > 0 ? `[${ctor} keys=${keys.join(",")}]` : `[${ctor}]`;
|
|
10144
|
-
}
|
|
10145
|
-
return String(value);
|
|
10146
|
-
}
|
|
10147
|
-
|
|
10148
10206
|
class Connection {
|
|
10149
10207
|
settings;
|
|
10150
10208
|
logger;
|
|
@@ -10403,7 +10461,7 @@
|
|
|
10403
10461
|
}
|
|
10404
10462
|
catch (error) {
|
|
10405
10463
|
try {
|
|
10406
|
-
this.logger.error(`Message handler failed with ${error
|
|
10464
|
+
this.logger.error(`Message handler failed with ${safeErrorStack(error)}`, error);
|
|
10407
10465
|
}
|
|
10408
10466
|
catch (loggerError) {
|
|
10409
10467
|
console.log("Message handler failed", error);
|
|
@@ -10881,7 +10939,7 @@
|
|
|
10881
10939
|
}
|
|
10882
10940
|
interop.invoke(Logger.InteropMethodName, args)
|
|
10883
10941
|
.catch((e) => {
|
|
10884
|
-
this.logFn.error(`Unable to send log message to the platform: ${e.message}`, e);
|
|
10942
|
+
this.logFn.error(`Unable to send log message to the platform: ${normalizeError(e).message}`, e);
|
|
10885
10943
|
});
|
|
10886
10944
|
}
|
|
10887
10945
|
}
|
|
@@ -10965,7 +11023,7 @@
|
|
|
10965
11023
|
}
|
|
10966
11024
|
};
|
|
10967
11025
|
|
|
10968
|
-
var version = "6.
|
|
11026
|
+
var version = "6.11.0";
|
|
10969
11027
|
|
|
10970
11028
|
/*!
|
|
10971
11029
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
@@ -11629,6 +11687,7 @@
|
|
|
11629
11687
|
(function (exports$1) {
|
|
11630
11688
|
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
11631
11689
|
exports$1.extractFilteringContextFromArgs = exports$1.deep_value = exports$1.getOTELData = exports$1.flattenOtelAtributes = void 0;
|
|
11690
|
+
exports$1.withTimeout = withTimeout;
|
|
11632
11691
|
const container_1 = requireContainer();
|
|
11633
11692
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
11634
11693
|
const flattenOtelAtributes = (data, maxDepth) => {
|
|
@@ -11746,6 +11805,19 @@
|
|
|
11746
11805
|
return filteringContext;
|
|
11747
11806
|
};
|
|
11748
11807
|
exports$1.extractFilteringContextFromArgs = extractFilteringContextFromArgs;
|
|
11808
|
+
function withTimeout(promise, timeout) {
|
|
11809
|
+
if (!promise) {
|
|
11810
|
+
return Promise.resolve();
|
|
11811
|
+
}
|
|
11812
|
+
if (!timeout) {
|
|
11813
|
+
return promise;
|
|
11814
|
+
}
|
|
11815
|
+
let timeoutId;
|
|
11816
|
+
return new Promise((rs, rj) => {
|
|
11817
|
+
timeoutId = setTimeout(rs, timeout);
|
|
11818
|
+
promise.then(() => rs(), rj);
|
|
11819
|
+
}).then(() => clearTimeout(timeoutId));
|
|
11820
|
+
}
|
|
11749
11821
|
|
|
11750
11822
|
} (otelUtils));
|
|
11751
11823
|
return otelUtils;
|
|
@@ -12406,21 +12478,11 @@
|
|
|
12406
12478
|
Builder.maybeAddResourceAttributesToAttributes(this.settings.logs);
|
|
12407
12479
|
Builder.maybeAddResourceAttributesToAttributes(this.settings.metrics);
|
|
12408
12480
|
Builder.maybeAddResourceAttributesToAttributes(this.settings.traces);
|
|
12409
|
-
Builder.
|
|
12410
|
-
Builder.
|
|
12411
|
-
Builder.
|
|
12412
|
-
Builder.
|
|
12413
|
-
Builder.
|
|
12414
|
-
Builder.propagateAttributeDown("useSSOAuthRawToken", this.settings, this.settings.traces);
|
|
12415
|
-
Builder.propagateAttributesDown("headers", this.settings, this.settings.logs);
|
|
12416
|
-
Builder.propagateAttributesDown("headers", this.settings, this.settings.metrics);
|
|
12417
|
-
Builder.propagateAttributesDown("headers", this.settings, this.settings.traces);
|
|
12418
|
-
Builder.propagateAttributesDown("additionalAttributes", this.settings, this.settings.logs);
|
|
12419
|
-
Builder.propagateAttributesDown("additionalResourceAttributes", this.settings, this.settings.logs);
|
|
12420
|
-
Builder.propagateAttributesDown("additionalAttributes", this.settings, this.settings.metrics);
|
|
12421
|
-
Builder.propagateAttributesDown("additionalResourceAttributes", this.settings, this.settings.metrics);
|
|
12422
|
-
Builder.propagateAttributesDown("additionalAttributes", this.settings, this.settings.traces);
|
|
12423
|
-
Builder.propagateAttributesDown("additionalResourceAttributes", this.settings, this.settings.traces);
|
|
12481
|
+
// Builder.propagateAttributeDownEx("useSSOAuth", this.settings);
|
|
12482
|
+
// Builder.propagateAttributeDownEx("useSSOAuthRawToken", this.settings);
|
|
12483
|
+
Builder.propagateAttributesDownEx("headers", this.settings);
|
|
12484
|
+
Builder.propagateAttributesDownEx("additionalAttributes", this.settings);
|
|
12485
|
+
Builder.propagateAttributesDownEx("additionalResourceAttributes", this.settings);
|
|
12424
12486
|
const metricsBuilder = (_g = this.metricsBuilder) !== null && _g !== void 0 ? _g : this.withMetrics();
|
|
12425
12487
|
const metrics = metricsBuilder
|
|
12426
12488
|
.withLogger(this.logger)
|
|
@@ -12448,6 +12510,11 @@
|
|
|
12448
12510
|
}
|
|
12449
12511
|
settings[k] = (_a = settings[k]) !== null && _a !== void 0 ? _a : otelSettings[k];
|
|
12450
12512
|
}
|
|
12513
|
+
static propagateAttributeDownEx(k, otelSettings) {
|
|
12514
|
+
Builder.propagateAttributeDown(k, otelSettings, otelSettings.logs);
|
|
12515
|
+
Builder.propagateAttributeDown(k, otelSettings, otelSettings.metrics);
|
|
12516
|
+
Builder.propagateAttributeDown(k, otelSettings, otelSettings.traces);
|
|
12517
|
+
}
|
|
12451
12518
|
static propagateAttributesDown(k, otelSettings, settings) {
|
|
12452
12519
|
var _a, _b;
|
|
12453
12520
|
if (!settings) {
|
|
@@ -12455,7 +12522,15 @@
|
|
|
12455
12522
|
}
|
|
12456
12523
|
const providedOtel = (_a = otelSettings[k]) !== null && _a !== void 0 ? _a : {};
|
|
12457
12524
|
const provided = (_b = settings[k]) !== null && _b !== void 0 ? _b : {};
|
|
12458
|
-
settings[k] = () =>
|
|
12525
|
+
settings[k] = () => {
|
|
12526
|
+
var _a, _b, _c;
|
|
12527
|
+
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));
|
|
12528
|
+
};
|
|
12529
|
+
}
|
|
12530
|
+
static propagateAttributesDownEx(k, otelSettings) {
|
|
12531
|
+
Builder.propagateAttributesDown(k, otelSettings, otelSettings.logs);
|
|
12532
|
+
Builder.propagateAttributesDown(k, otelSettings, otelSettings.metrics);
|
|
12533
|
+
Builder.propagateAttributesDown(k, otelSettings, otelSettings.traces);
|
|
12459
12534
|
}
|
|
12460
12535
|
static maybeAddResourceAttributesToAttributes(settings) {
|
|
12461
12536
|
if (settings === null || settings === void 0 ? void 0 : settings.addResourceAttributesToAttributes) {
|
|
@@ -12883,7 +12958,7 @@
|
|
|
12883
12958
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12884
12959
|
};
|
|
12885
12960
|
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
12886
|
-
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;
|
|
12961
|
+
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;
|
|
12887
12962
|
var builder_1 = requireBuilder();
|
|
12888
12963
|
Object.defineProperty(exports$1, "Builder", { enumerable: true, get: function () { return builder_1.Builder; } });
|
|
12889
12964
|
var log4jsWrapper_1 = requireLog4jsWrapper();
|
|
@@ -12914,6 +12989,7 @@
|
|
|
12914
12989
|
Object.defineProperty(exports$1, "flattenOtelAtributes", { enumerable: true, get: function () { return otelUtils_1.flattenOtelAtributes; } });
|
|
12915
12990
|
Object.defineProperty(exports$1, "extractFilteringContextFromArgs", { enumerable: true, get: function () { return otelUtils_1.extractFilteringContextFromArgs; } });
|
|
12916
12991
|
Object.defineProperty(exports$1, "deep_value", { enumerable: true, get: function () { return otelUtils_1.deep_value; } });
|
|
12992
|
+
Object.defineProperty(exports$1, "withTimeout", { enumerable: true, get: function () { return otelUtils_1.withTimeout; } });
|
|
12917
12993
|
if (typeof Promise !== "undefined") {
|
|
12918
12994
|
Promise.allSettled = Promise.allSettled || ((promises) => Promise.all(promises.map((p) => p
|
|
12919
12995
|
.then((value) => ({
|
|
@@ -15522,7 +15598,7 @@
|
|
|
15522
15598
|
distExports.Traces.currentTracingState = ts;
|
|
15523
15599
|
}
|
|
15524
15600
|
const contextData = this._contextNameToData[name];
|
|
15525
|
-
ts.addData("DIAGNOSTIC", { data
|
|
15601
|
+
ts.addData("DIAGNOSTIC", { data });
|
|
15526
15602
|
ts.injectPropagationInfo(data);
|
|
15527
15603
|
if (!contextData || !contextData.isAnnounced) {
|
|
15528
15604
|
return this.createContext(name, data);
|
|
@@ -15924,6 +16000,10 @@
|
|
|
15924
16000
|
}
|
|
15925
16001
|
}
|
|
15926
16002
|
}
|
|
16003
|
+
const pi = distExports.Traces.extractPropagationInfo(delta, true) ||
|
|
16004
|
+
distExports.Traces.extractPropagationInfo(delta?.added, true) ||
|
|
16005
|
+
distExports.Traces.extractPropagationInfo(delta?.updated, true) ||
|
|
16006
|
+
distExports.Traces.extractPropagationInfo(delta?.reset, true);
|
|
15927
16007
|
for (const updateCallbackIndex in contextData.updateCallbacks) {
|
|
15928
16008
|
if (contextData.updateCallbacks.hasOwnProperty(updateCallbackIndex)) {
|
|
15929
16009
|
try {
|
|
@@ -15933,7 +16013,7 @@
|
|
|
15933
16013
|
...delta.updated,
|
|
15934
16014
|
...delta.reset
|
|
15935
16015
|
});
|
|
15936
|
-
updateCallback(deepClone(contextData.context), deltaArg, delta.removed, parseInt(updateCallbackIndex, 10), extraData,
|
|
16016
|
+
updateCallback(deepClone(contextData.context), deltaArg, delta.removed, parseInt(updateCallbackIndex, 10), extraData, pi);
|
|
15937
16017
|
}
|
|
15938
16018
|
catch (err) {
|
|
15939
16019
|
this._logger.debug("callback error: " + JSON.stringify(err));
|