@interopio/browser 4.5.0-beta.0 → 4.6.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.
@@ -2205,9 +2205,9 @@ const urlDecoder = decoders.common.urlDecoder;
2205
2205
  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"));
2206
2206
  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"));
2207
2207
  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"));
2208
- 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"));
2208
+ 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"));
2209
2209
  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"));
2210
- 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"));
2210
+ const systemOperationTypesDecoder = oneOf$1(constant$2("getEnvironment"), constant$2("getBase"), constant$2("platformShutdown"), constant$2("isFdc3DataWrappingSupported"), constant$2("isChannelsMetadataSupported"), constant$2("clientError"), constant$2("systemHello"), constant$2("operationCheck"));
2211
2211
  const windowRelativeDirectionDecoder = oneOf$1(constant$2("top"), constant$2("left"), constant$2("right"), constant$2("bottom"));
2212
2212
  const windowBoundsDecoder = object$2({
2213
2213
  top: number$2(),
@@ -2300,6 +2300,9 @@ const instanceDataDecoder = object$2({
2300
2300
  const iframePermissionsPolicyConfigDecoder = object$2({
2301
2301
  flags: string$2()
2302
2302
  });
2303
+ const iframeSandboxConfigDecoder = object$2({
2304
+ flags: string$2()
2305
+ });
2303
2306
  const workspacesSandboxDecoder = object$2({
2304
2307
  flags: string$2()
2305
2308
  });
@@ -2318,7 +2321,8 @@ const applicationDetailsDecoder = object$2({
2318
2321
  height: optional$2(nonNegativeNumberDecoder$2),
2319
2322
  workspacesSandbox: optional$2(workspacesSandboxDecoder),
2320
2323
  channelSelector: optional$2(channelSelectorDecoder$1),
2321
- iframePermissionsPolicy: optional$2(iframePermissionsPolicyConfigDecoder)
2324
+ iframePermissionsPolicy: optional$2(iframePermissionsPolicyConfigDecoder),
2325
+ iframeSandbox: optional$2(iframeSandboxConfigDecoder)
2322
2326
  });
2323
2327
  const intentDefinitionDecoder = object$2({
2324
2328
  name: nonEmptyStringDecoder$2,
@@ -2495,6 +2499,17 @@ const restoreOptionsDecoder = object$2({
2495
2499
  closeMe: optional$2(boolean$2()),
2496
2500
  timeout: optional$2(nonNegativeNumberDecoder$2)
2497
2501
  });
2502
+ const getContentsOptionsDecoder = object$2({
2503
+ name: nonEmptyStringDecoder$2,
2504
+ type: layoutTypeDecoder
2505
+ });
2506
+ const layoutContentsResultDecoder = object$2({
2507
+ contents: object$2({
2508
+ appComponents: array$2(oneOf$1(windowLayoutComponentDecoder, workspaceLayoutComponentDecoder, workspaceFrameComponentDecoder)),
2509
+ workspaceComponents: array$2(workspaceLayoutComponentStateDecoder),
2510
+ workspaceWindows: array$2(windowLayoutItemDecoder)
2511
+ })
2512
+ });
2498
2513
  const layoutSummaryDecoder = object$2({
2499
2514
  name: nonEmptyStringDecoder$2,
2500
2515
  type: layoutTypeDecoder,
@@ -2716,10 +2731,10 @@ const publishOptionsDecoder = optional$2(oneOf$1(nonEmptyStringDecoder$2, object
2716
2731
  name: optional$2(nonEmptyStringDecoder$2),
2717
2732
  fdc3: optional$2(boolean$2())
2718
2733
  })));
2719
- const leaveChannelsConfig = object$2({
2734
+ const leaveChannelsConfigDecoder = oneOf$1(nonEmptyStringDecoder$2, object$2({
2720
2735
  windowId: optionalNonEmptyStringDecoder,
2721
2736
  channel: optionalNonEmptyStringDecoder
2722
- });
2737
+ }));
2723
2738
  const fdc3ContextDecoder = anyJson$2().where((value) => typeof value.type === "string", "Expected a valid FDC3 Context with compulsory 'type' field");
2724
2739
  const interopActionSettingsDecoder = object$2({
2725
2740
  method: nonEmptyStringDecoder$2,
@@ -2873,7 +2888,8 @@ const strictNotificationsConfigurationProtocolDecoder = object$2({
2873
2888
  sourceFilter: object$2({
2874
2889
  allowed: array$2(nonEmptyStringDecoder$2),
2875
2890
  blocked: array$2(nonEmptyStringDecoder$2)
2876
- })
2891
+ }),
2892
+ showNotificationBadge: optional$2(boolean$2())
2877
2893
  })
2878
2894
  });
2879
2895
  const platformSaveRequestConfigDecoder = object$2({
@@ -4360,7 +4376,12 @@ class AppManagerController {
4360
4376
  }
4361
4377
  getApplication(name) {
4362
4378
  const verifiedName = runDecoderWithIOError(nonEmptyStringDecoder$2, name);
4363
- return this.applications.find((app) => app.name === verifiedName);
4379
+ const application = this.applications.find((app) => app.name === verifiedName);
4380
+ const iframeSandbox = application?.userProperties?.details?.iframeSandbox;
4381
+ if (iframeSandbox) {
4382
+ application.userProperties.details.workspacesSandbox = iframeSandbox;
4383
+ }
4384
+ return application;
4364
4385
  }
4365
4386
  getInstances() {
4366
4387
  return this.instances.slice();
@@ -4670,6 +4691,7 @@ const operations$8 = {
4670
4691
  layoutRenamed: { name: "layoutRenamed", dataDecoder: renamedLayoutNotificationDecoder },
4671
4692
  get: { name: "get", dataDecoder: simpleLayoutConfigDecoder, resultDecoder: optionalSimpleLayoutResult },
4672
4693
  getAll: { name: "getAll", dataDecoder: getAllLayoutsConfigDecoder, resultDecoder: allLayoutsSummariesResultDecoder },
4694
+ getLayoutContents: { name: "getLayoutContents", dataDecoder: getContentsOptionsDecoder, resultDecoder: layoutContentsResultDecoder },
4673
4695
  export: { name: "export", dataDecoder: getAllLayoutsConfigDecoder, resultDecoder: allLayoutsFullConfigDecoder },
4674
4696
  import: { name: "import", dataDecoder: layoutsImportConfigDecoder },
4675
4697
  remove: { name: "remove", dataDecoder: simpleLayoutConfigDecoder },
@@ -4725,6 +4747,7 @@ class LayoutsController {
4725
4747
  const api = {
4726
4748
  get: this.get.bind(this),
4727
4749
  getAll: this.getAll.bind(this),
4750
+ getLayoutContents: this.getLayoutContents.bind(this),
4728
4751
  getCurrentLayout: this.getCurrentLayout.bind(this),
4729
4752
  export: this.exportLayouts.bind(this),
4730
4753
  import: this.importLayouts.bind(this),
@@ -4775,6 +4798,15 @@ class LayoutsController {
4775
4798
  const result = await this.bridge.send("layouts", operations$8.getAll, { type });
4776
4799
  return result.summaries;
4777
4800
  }
4801
+ async getLayoutContents(options) {
4802
+ runDecoderWithIOError(getContentsOptionsDecoder, options);
4803
+ const { name, type } = options;
4804
+ if (type !== "Workspace" && type !== "Global") {
4805
+ return ioError.raiseError(`getLayoutContents is only supported for Workspace and Global layouts, but got type "${type}"`);
4806
+ }
4807
+ const result = await this.bridge.send("layouts", operations$8.getLayoutContents, { name, type }, undefined, { includeOperationCheck: true });
4808
+ return result.contents;
4809
+ }
4778
4810
  async exportLayouts(type) {
4779
4811
  runDecoderWithIOError(layoutTypeDecoder, type);
4780
4812
  const result = await this.bridge.send("layouts", operations$8.export, { type });
@@ -4954,7 +4986,7 @@ const operations$7 = {
4954
4986
  clear: { name: "clear" },
4955
4987
  clearAll: { name: "clearAll" },
4956
4988
  clearOld: { name: "clearOld" },
4957
- configure: { name: "configure", dataDecoder: notificationsConfigurationProtocolDecoder },
4989
+ configure: { name: "configure", dataDecoder: notificationsConfigurationProtocolDecoder, resultDecoder: strictNotificationsConfigurationProtocolDecoder },
4958
4990
  getConfiguration: { name: "getConfiguration", resultDecoder: strictNotificationsConfigurationProtocolDecoder },
4959
4991
  getActiveCount: { name: "getActiveCount", resultDecoder: activeNotificationsCountChangeDecoder },
4960
4992
  configurationChanged: { name: "configurationChanged", resultDecoder: strictNotificationsConfigurationProtocolDecoder },
@@ -4964,13 +4996,13 @@ const operations$7 = {
4964
4996
  operationCheck: { name: "operationCheck" }
4965
4997
  };
4966
4998
 
4967
- /* @ts-self-types="./index.d.ts" */
4968
4999
  let urlAlphabet$1 =
4969
5000
  'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
5001
+
4970
5002
  let nanoid$1 = (size = 21) => {
4971
5003
  let id = '';
4972
5004
  let i = size | 0;
4973
- while (i--) {
5005
+ while (i-- > 0) {
4974
5006
  id += urlAlphabet$1[(Math.random() * 64) | 0];
4975
5007
  }
4976
5008
  return id
@@ -5098,7 +5130,8 @@ class NotificationsController {
5098
5130
  }
5099
5131
  async configure(config) {
5100
5132
  const verifiedConfig = runDecoderWithIOError(notificationsConfigurationDecoder, config);
5101
- await this.bridge.send("notifications", operations$7.configure, { configuration: verifiedConfig }, undefined, { includeOperationCheck: true });
5133
+ const response = await this.bridge.send("notifications", operations$7.configure, { configuration: verifiedConfig }, undefined, { includeOperationCheck: true });
5134
+ return response.configuration;
5102
5135
  }
5103
5136
  async getConfiguration() {
5104
5137
  const response = await this.bridge.send("notifications", operations$7.getConfiguration, undefined, undefined, { includeOperationCheck: true });
@@ -5754,12 +5787,14 @@ class ChannelsController {
5754
5787
  return this.changed(callback);
5755
5788
  }
5756
5789
  async leave(config = {}) {
5757
- runDecoderWithIOError(leaveChannelsConfig, config);
5758
- if (config.channel) {
5790
+ const decodedConfig = runDecoderWithIOError(leaveChannelsConfigDecoder, config);
5791
+ const channelName = typeof decodedConfig === "string" ? undefined : decodedConfig.channel;
5792
+ const windowId = typeof decodedConfig === "string" ? decodedConfig : decodedConfig.windowId;
5793
+ if (channelName) {
5759
5794
  const channelNames = this.getAllChannelNames();
5760
- runDecoderWithIOError(channelNameDecoder(channelNames), config.channel);
5795
+ runDecoderWithIOError(channelNameDecoder(channelNames), channelName);
5761
5796
  }
5762
- const leaveData = { channelName: config.channel, windowId: config.windowId ?? this.myWindowId };
5797
+ const leaveData = { channelName, windowId: windowId ?? this.myWindowId };
5763
5798
  await this.bridge.send("channels", operations$5.leaveChannel, leaveData, undefined, { includeOperationCheck: true });
5764
5799
  }
5765
5800
  async handleAppManagerInitialChannelId(channel) {
@@ -6142,12 +6177,13 @@ class ChannelsController {
6142
6177
  windowId: restrictions.windowId ?? this.myWindowId
6143
6178
  }
6144
6179
  };
6145
- return this.bridge.send("channels", operations$5.restrictAll, configData, undefined, { includeOperationCheck: true });
6180
+ await this.bridge.send("channels", operations$5.restrictAll, configData, undefined, { includeOperationCheck: true });
6146
6181
  }
6147
6182
  async handleRestrictAll({ restrictions }) {
6148
6183
  const currentChannel = await this.getMy();
6149
6184
  if (!currentChannel) {
6150
- return this.updateAllRestrictions(restrictions);
6185
+ this.updateAllRestrictions(restrictions);
6186
+ return;
6151
6187
  }
6152
6188
  const prevReadAllowed = this.isAllowedByRestrictions(currentChannel.name, "read");
6153
6189
  this.updateAllRestrictions(restrictions);
@@ -6382,6 +6418,7 @@ const operations$4 = {
6382
6418
  getBase: { name: "getBase", resultDecoder: anyDecoder },
6383
6419
  platformShutdown: { name: "platformShutdown" },
6384
6420
  isFdc3DataWrappingSupported: { name: "isFdc3DataWrappingSupported" },
6421
+ isChannelsMetadataSupported: { name: "isChannelsMetadataSupported" },
6385
6422
  clientError: { name: "clientError", dataDecoder: clientErrorDataDecoder },
6386
6423
  systemHello: { name: "systemHello", resultDecoder: systemHelloSuccessDecoder },
6387
6424
  operationCheck: { name: "operationCheck" }
@@ -6404,7 +6441,7 @@ class SystemController {
6404
6441
  const systemHelloSuccess = await this.bridge.send("system", operations$4.systemHello, undefined, undefined, { includeOperationCheck: true });
6405
6442
  isClientErrorOperationSupported = systemHelloSuccess.isClientErrorOperationSupported;
6406
6443
  }
6407
- catch (error) {
6444
+ catch {
6408
6445
  this.logger.warn("The platform of this client is outdated and does not support some system operations.");
6409
6446
  }
6410
6447
  this.errorPort.onmessage = async (event) => {
@@ -6444,12 +6481,16 @@ class SystemController {
6444
6481
  addOperationsExecutors() {
6445
6482
  operations$4.platformShutdown.execute = this.processPlatformShutdown.bind(this);
6446
6483
  operations$4.isFdc3DataWrappingSupported.execute = this.handleIsFdc3DataWrappingSupported.bind(this);
6484
+ operations$4.isChannelsMetadataSupported.execute = this.handleIsChannelsMetadataSupported.bind(this);
6447
6485
  operations$4.operationCheck.execute = async (config) => handleOperationCheck(this.supportedOperationsNames, config.operation);
6448
6486
  this.supportedOperationsNames = getSupportedOperationsNames(operations$4);
6449
6487
  }
6450
6488
  async handleIsFdc3DataWrappingSupported() {
6451
6489
  return { isSupported: true };
6452
6490
  }
6491
+ async handleIsChannelsMetadataSupported() {
6492
+ return { isSupported: false };
6493
+ }
6453
6494
  }
6454
6495
 
6455
6496
  class Notification {
@@ -7780,7 +7821,7 @@ class IoC {
7780
7821
  }
7781
7822
  }
7782
7823
 
7783
- var version$1 = "4.5.0-beta.0";
7824
+ var version$1 = "4.6.0";
7784
7825
 
7785
7826
  const setupGlobalSystem = (io, bridge) => {
7786
7827
  return {
@@ -9213,9 +9254,9 @@ class MessageReplayerImpl {
9213
9254
  }
9214
9255
  }
9215
9256
 
9216
- /* @ts-self-types="./index.d.ts" */
9217
9257
  let urlAlphabet =
9218
9258
  'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
9259
+
9219
9260
  let nanoid = (size = 21) => {
9220
9261
  let id = '';
9221
9262
  let i = size | 0;
@@ -9769,6 +9810,10 @@ class WebPlatformTransport {
9769
9810
  return window.name.substring(0, window.name.indexOf("#wsp"));
9770
9811
  }
9771
9812
  if (window !== window.top) {
9813
+ const ifrIndex = window.name.indexOf("#ifr");
9814
+ if (ifrIndex !== -1) {
9815
+ return window.name.substring(0, ifrIndex);
9816
+ }
9772
9817
  return;
9773
9818
  }
9774
9819
  if (window.name?.includes("g42")) {
@@ -9829,6 +9874,83 @@ class AsyncSequelizer {
9829
9874
  }
9830
9875
  }
9831
9876
 
9877
+ function normalizeError(value) {
9878
+ if (value instanceof Error) {
9879
+ return value;
9880
+ }
9881
+ if (typeof value === "string") {
9882
+ return new Error(value);
9883
+ }
9884
+ const anyVal = value;
9885
+ const msgField = typeof anyVal?.message === "string" ? anyVal.message : undefined;
9886
+ const reasonField = typeof anyVal?.reason === "string" ? anyVal.reason : undefined;
9887
+ if (msgField !== undefined && msgField.length > 0) {
9888
+ return new Error(msgField);
9889
+ }
9890
+ if (reasonField !== undefined && reasonField.length > 0) {
9891
+ return new Error(reasonField);
9892
+ }
9893
+ if (msgField === "" || reasonField === "") {
9894
+ return new Error("");
9895
+ }
9896
+ return new Error(safeStringify$1(value));
9897
+ }
9898
+ function safeErrorStack(value) {
9899
+ try {
9900
+ if (value instanceof Error) {
9901
+ if (typeof value.stack === "string") {
9902
+ return value.stack;
9903
+ }
9904
+ if (typeof value.message === "string") {
9905
+ const name = typeof value.name === "string" && value.name.length > 0 ? value.name : "Error";
9906
+ return `${name}: ${value.message}`;
9907
+ }
9908
+ }
9909
+ if (typeof value === "string") {
9910
+ return value;
9911
+ }
9912
+ }
9913
+ catch { }
9914
+ return safeStringify$1(value);
9915
+ }
9916
+ function safeStringify$1(value) {
9917
+ try {
9918
+ const seen = new WeakSet();
9919
+ const json = JSON.stringify(value, (_key, v) => {
9920
+ if (typeof v === "bigint") {
9921
+ return `${v.toString()}n`;
9922
+ }
9923
+ if (typeof v === "function") {
9924
+ return "[Function]";
9925
+ }
9926
+ if (typeof v === "symbol") {
9927
+ return v.toString();
9928
+ }
9929
+ if (typeof v === "object" && v !== null) {
9930
+ if (seen.has(v)) {
9931
+ return "[Circular]";
9932
+ }
9933
+ seen.add(v);
9934
+ }
9935
+ return v;
9936
+ });
9937
+ if (json !== undefined) {
9938
+ return json;
9939
+ }
9940
+ }
9941
+ catch { }
9942
+ if (value !== null && typeof value === "object") {
9943
+ const ctor = value.constructor?.name ?? "Object";
9944
+ let keys = [];
9945
+ try {
9946
+ keys = Object.keys(value);
9947
+ }
9948
+ catch { }
9949
+ return keys.length > 0 ? `[${ctor} keys=${keys.join(",")}]` : `[${ctor}]`;
9950
+ }
9951
+ return String(value);
9952
+ }
9953
+
9832
9954
  function domainSession (domain, connection, logger, successMessages, errorMessages) {
9833
9955
  if (domain == null) {
9834
9956
  domain = "global";
@@ -10064,7 +10186,7 @@ function domainSession (domain, connection, logger, successMessages, errorMessag
10064
10186
  callback(msg);
10065
10187
  }
10066
10188
  catch (e) {
10067
- logger.error(`Callback failed: ${e} \n ${e.stack} \n msg was: ${JSON.stringify(msg)}`, e);
10189
+ logger.error(`Callback failed: ${safeErrorStack(e)} \n msg was: ${JSON.stringify(msg)}`, e);
10068
10190
  }
10069
10191
  });
10070
10192
  },
@@ -10080,65 +10202,6 @@ function domainSession (domain, connection, logger, successMessages, errorMessag
10080
10202
  };
10081
10203
  }
10082
10204
 
10083
- function normalizeError(value) {
10084
- if (value instanceof Error) {
10085
- return value;
10086
- }
10087
- if (typeof value === "string") {
10088
- return new Error(value);
10089
- }
10090
- const anyVal = value;
10091
- const msgField = typeof anyVal?.message === "string" ? anyVal.message : undefined;
10092
- const reasonField = typeof anyVal?.reason === "string" ? anyVal.reason : undefined;
10093
- if (msgField !== undefined && msgField.length > 0) {
10094
- return new Error(msgField);
10095
- }
10096
- if (reasonField !== undefined && reasonField.length > 0) {
10097
- return new Error(reasonField);
10098
- }
10099
- if (msgField === "" || reasonField === "") {
10100
- return new Error("");
10101
- }
10102
- return new Error(safeStringify$1(value));
10103
- }
10104
- function safeStringify$1(value) {
10105
- try {
10106
- const seen = new WeakSet();
10107
- const json = JSON.stringify(value, (_key, v) => {
10108
- if (typeof v === "bigint") {
10109
- return `${v.toString()}n`;
10110
- }
10111
- if (typeof v === "function") {
10112
- return "[Function]";
10113
- }
10114
- if (typeof v === "symbol") {
10115
- return v.toString();
10116
- }
10117
- if (typeof v === "object" && v !== null) {
10118
- if (seen.has(v)) {
10119
- return "[Circular]";
10120
- }
10121
- seen.add(v);
10122
- }
10123
- return v;
10124
- });
10125
- if (json !== undefined) {
10126
- return json;
10127
- }
10128
- }
10129
- catch { }
10130
- if (value !== null && typeof value === "object") {
10131
- const ctor = value.constructor?.name ?? "Object";
10132
- let keys = [];
10133
- try {
10134
- keys = Object.keys(value);
10135
- }
10136
- catch { }
10137
- return keys.length > 0 ? `[${ctor} keys=${keys.join(",")}]` : `[${ctor}]`;
10138
- }
10139
- return String(value);
10140
- }
10141
-
10142
10205
  class Connection {
10143
10206
  settings;
10144
10207
  logger;
@@ -10397,7 +10460,7 @@ class Connection {
10397
10460
  }
10398
10461
  catch (error) {
10399
10462
  try {
10400
- this.logger.error(`Message handler failed with ${error.stack}`, error);
10463
+ this.logger.error(`Message handler failed with ${safeErrorStack(error)}`, error);
10401
10464
  }
10402
10465
  catch (loggerError) {
10403
10466
  console.log("Message handler failed", error);
@@ -10875,7 +10938,7 @@ class Logger {
10875
10938
  }
10876
10939
  interop.invoke(Logger.InteropMethodName, args)
10877
10940
  .catch((e) => {
10878
- this.logFn.error(`Unable to send log message to the platform: ${e.message}`, e);
10941
+ this.logFn.error(`Unable to send log message to the platform: ${normalizeError(e).message}`, e);
10879
10942
  });
10880
10943
  }
10881
10944
  }
@@ -10959,7 +11022,7 @@ const ContextMessageReplaySpec = {
10959
11022
  }
10960
11023
  };
10961
11024
 
10962
- var version = "6.10.4";
11025
+ var version = "6.11.0";
10963
11026
 
10964
11027
  /*!
10965
11028
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
@@ -11623,6 +11686,7 @@ function requireOtelUtils () {
11623
11686
  (function (exports$1) {
11624
11687
  Object.defineProperty(exports$1, "__esModule", { value: true });
11625
11688
  exports$1.extractFilteringContextFromArgs = exports$1.deep_value = exports$1.getOTELData = exports$1.flattenOtelAtributes = void 0;
11689
+ exports$1.withTimeout = withTimeout;
11626
11690
  const container_1 = requireContainer();
11627
11691
  /* eslint-disable @typescript-eslint/no-explicit-any */
11628
11692
  const flattenOtelAtributes = (data, maxDepth) => {
@@ -11740,6 +11804,19 @@ function requireOtelUtils () {
11740
11804
  return filteringContext;
11741
11805
  };
11742
11806
  exports$1.extractFilteringContextFromArgs = extractFilteringContextFromArgs;
11807
+ function withTimeout(promise, timeout) {
11808
+ if (!promise) {
11809
+ return Promise.resolve();
11810
+ }
11811
+ if (!timeout) {
11812
+ return promise;
11813
+ }
11814
+ let timeoutId;
11815
+ return new Promise((rs, rj) => {
11816
+ timeoutId = setTimeout(rs, timeout);
11817
+ promise.then(() => rs(), rj);
11818
+ }).then(() => clearTimeout(timeoutId));
11819
+ }
11743
11820
 
11744
11821
  } (otelUtils));
11745
11822
  return otelUtils;
@@ -12400,21 +12477,11 @@ function requireBuilder () {
12400
12477
  Builder.maybeAddResourceAttributesToAttributes(this.settings.logs);
12401
12478
  Builder.maybeAddResourceAttributesToAttributes(this.settings.metrics);
12402
12479
  Builder.maybeAddResourceAttributesToAttributes(this.settings.traces);
12403
- Builder.propagateAttributeDown("useSSOAuth", this.settings, this.settings.logs);
12404
- Builder.propagateAttributeDown("useSSOAuth", this.settings, this.settings.metrics);
12405
- Builder.propagateAttributeDown("useSSOAuth", this.settings, this.settings.traces);
12406
- Builder.propagateAttributeDown("useSSOAuthRawToken", this.settings, this.settings.logs);
12407
- Builder.propagateAttributeDown("useSSOAuthRawToken", this.settings, this.settings.metrics);
12408
- Builder.propagateAttributeDown("useSSOAuthRawToken", this.settings, this.settings.traces);
12409
- Builder.propagateAttributesDown("headers", this.settings, this.settings.logs);
12410
- Builder.propagateAttributesDown("headers", this.settings, this.settings.metrics);
12411
- Builder.propagateAttributesDown("headers", this.settings, this.settings.traces);
12412
- Builder.propagateAttributesDown("additionalAttributes", this.settings, this.settings.logs);
12413
- Builder.propagateAttributesDown("additionalResourceAttributes", this.settings, this.settings.logs);
12414
- Builder.propagateAttributesDown("additionalAttributes", this.settings, this.settings.metrics);
12415
- Builder.propagateAttributesDown("additionalResourceAttributes", this.settings, this.settings.metrics);
12416
- Builder.propagateAttributesDown("additionalAttributes", this.settings, this.settings.traces);
12417
- Builder.propagateAttributesDown("additionalResourceAttributes", this.settings, this.settings.traces);
12480
+ // Builder.propagateAttributeDownEx("useSSOAuth", this.settings);
12481
+ // Builder.propagateAttributeDownEx("useSSOAuthRawToken", this.settings);
12482
+ Builder.propagateAttributesDownEx("headers", this.settings);
12483
+ Builder.propagateAttributesDownEx("additionalAttributes", this.settings);
12484
+ Builder.propagateAttributesDownEx("additionalResourceAttributes", this.settings);
12418
12485
  const metricsBuilder = (_g = this.metricsBuilder) !== null && _g !== void 0 ? _g : this.withMetrics();
12419
12486
  const metrics = metricsBuilder
12420
12487
  .withLogger(this.logger)
@@ -12442,6 +12509,11 @@ function requireBuilder () {
12442
12509
  }
12443
12510
  settings[k] = (_a = settings[k]) !== null && _a !== void 0 ? _a : otelSettings[k];
12444
12511
  }
12512
+ static propagateAttributeDownEx(k, otelSettings) {
12513
+ Builder.propagateAttributeDown(k, otelSettings, otelSettings.logs);
12514
+ Builder.propagateAttributeDown(k, otelSettings, otelSettings.metrics);
12515
+ Builder.propagateAttributeDown(k, otelSettings, otelSettings.traces);
12516
+ }
12445
12517
  static propagateAttributesDown(k, otelSettings, settings) {
12446
12518
  var _a, _b;
12447
12519
  if (!settings) {
@@ -12449,7 +12521,15 @@ function requireBuilder () {
12449
12521
  }
12450
12522
  const providedOtel = (_a = otelSettings[k]) !== null && _a !== void 0 ? _a : {};
12451
12523
  const provided = (_b = settings[k]) !== null && _b !== void 0 ? _b : {};
12452
- settings[k] = () => (Object.assign(Object.assign({}, container_1.Container.errorless(providedOtel)), container_1.Container.errorless(provided)));
12524
+ settings[k] = () => {
12525
+ var _a, _b, _c;
12526
+ 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));
12527
+ };
12528
+ }
12529
+ static propagateAttributesDownEx(k, otelSettings) {
12530
+ Builder.propagateAttributesDown(k, otelSettings, otelSettings.logs);
12531
+ Builder.propagateAttributesDown(k, otelSettings, otelSettings.metrics);
12532
+ Builder.propagateAttributesDown(k, otelSettings, otelSettings.traces);
12453
12533
  }
12454
12534
  static maybeAddResourceAttributesToAttributes(settings) {
12455
12535
  if (settings === null || settings === void 0 ? void 0 : settings.addResourceAttributesToAttributes) {
@@ -12877,7 +12957,7 @@ function requireDist () {
12877
12957
  return (mod && mod.__esModule) ? mod : { "default": mod };
12878
12958
  };
12879
12959
  Object.defineProperty(exports$1, "__esModule", { value: true });
12880
- 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;
12960
+ 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;
12881
12961
  var builder_1 = requireBuilder();
12882
12962
  Object.defineProperty(exports$1, "Builder", { enumerable: true, get: function () { return builder_1.Builder; } });
12883
12963
  var log4jsWrapper_1 = requireLog4jsWrapper();
@@ -12908,6 +12988,7 @@ function requireDist () {
12908
12988
  Object.defineProperty(exports$1, "flattenOtelAtributes", { enumerable: true, get: function () { return otelUtils_1.flattenOtelAtributes; } });
12909
12989
  Object.defineProperty(exports$1, "extractFilteringContextFromArgs", { enumerable: true, get: function () { return otelUtils_1.extractFilteringContextFromArgs; } });
12910
12990
  Object.defineProperty(exports$1, "deep_value", { enumerable: true, get: function () { return otelUtils_1.deep_value; } });
12991
+ Object.defineProperty(exports$1, "withTimeout", { enumerable: true, get: function () { return otelUtils_1.withTimeout; } });
12911
12992
  if (typeof Promise !== "undefined") {
12912
12993
  Promise.allSettled = Promise.allSettled || ((promises) => Promise.all(promises.map((p) => p
12913
12994
  .then((value) => ({
@@ -15516,7 +15597,7 @@ class GW3Bridge {
15516
15597
  distExports.Traces.currentTracingState = ts;
15517
15598
  }
15518
15599
  const contextData = this._contextNameToData[name];
15519
- ts.addData("DIAGNOSTIC", { data: contextData });
15600
+ ts.addData("DIAGNOSTIC", { data });
15520
15601
  ts.injectPropagationInfo(data);
15521
15602
  if (!contextData || !contextData.isAnnounced) {
15522
15603
  return this.createContext(name, data);
@@ -15918,6 +15999,10 @@ class GW3Bridge {
15918
15999
  }
15919
16000
  }
15920
16001
  }
16002
+ const pi = distExports.Traces.extractPropagationInfo(delta, true) ||
16003
+ distExports.Traces.extractPropagationInfo(delta?.added, true) ||
16004
+ distExports.Traces.extractPropagationInfo(delta?.updated, true) ||
16005
+ distExports.Traces.extractPropagationInfo(delta?.reset, true);
15921
16006
  for (const updateCallbackIndex in contextData.updateCallbacks) {
15922
16007
  if (contextData.updateCallbacks.hasOwnProperty(updateCallbackIndex)) {
15923
16008
  try {
@@ -15927,7 +16012,7 @@ class GW3Bridge {
15927
16012
  ...delta.updated,
15928
16013
  ...delta.reset
15929
16014
  });
15930
- updateCallback(deepClone(contextData.context), deltaArg, delta.removed, parseInt(updateCallbackIndex, 10), extraData, distExports.Traces.extractPropagationInfo(delta));
16015
+ updateCallback(deepClone(contextData.context), deltaArg, delta.removed, parseInt(updateCallbackIndex, 10), extraData, pi);
15931
16016
  }
15932
16017
  catch (err) {
15933
16018
  this._logger.debug("callback error: " + JSON.stringify(err));