@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.
@@ -2205,7 +2205,7 @@ 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
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"));
2211
2211
  const windowRelativeDirectionDecoder = oneOf$1(constant$2("top"), constant$2("left"), constant$2("right"), constant$2("bottom"));
@@ -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 },
@@ -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);
@@ -7780,7 +7816,7 @@ class IoC {
7780
7816
  }
7781
7817
  }
7782
7818
 
7783
- var version$1 = "4.5.0-beta.0";
7819
+ var version$1 = "4.5.0";
7784
7820
 
7785
7821
  const setupGlobalSystem = (io, bridge) => {
7786
7822
  return {
@@ -9213,9 +9249,9 @@ class MessageReplayerImpl {
9213
9249
  }
9214
9250
  }
9215
9251
 
9216
- /* @ts-self-types="./index.d.ts" */
9217
9252
  let urlAlphabet =
9218
9253
  'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
9254
+
9219
9255
  let nanoid = (size = 21) => {
9220
9256
  let id = '';
9221
9257
  let i = size | 0;
@@ -9769,6 +9805,10 @@ class WebPlatformTransport {
9769
9805
  return window.name.substring(0, window.name.indexOf("#wsp"));
9770
9806
  }
9771
9807
  if (window !== window.top) {
9808
+ const ifrIndex = window.name.indexOf("#ifr");
9809
+ if (ifrIndex !== -1) {
9810
+ return window.name.substring(0, ifrIndex);
9811
+ }
9772
9812
  return;
9773
9813
  }
9774
9814
  if (window.name?.includes("g42")) {
@@ -9829,6 +9869,83 @@ class AsyncSequelizer {
9829
9869
  }
9830
9870
  }
9831
9871
 
9872
+ function normalizeError(value) {
9873
+ if (value instanceof Error) {
9874
+ return value;
9875
+ }
9876
+ if (typeof value === "string") {
9877
+ return new Error(value);
9878
+ }
9879
+ const anyVal = value;
9880
+ const msgField = typeof anyVal?.message === "string" ? anyVal.message : undefined;
9881
+ const reasonField = typeof anyVal?.reason === "string" ? anyVal.reason : undefined;
9882
+ if (msgField !== undefined && msgField.length > 0) {
9883
+ return new Error(msgField);
9884
+ }
9885
+ if (reasonField !== undefined && reasonField.length > 0) {
9886
+ return new Error(reasonField);
9887
+ }
9888
+ if (msgField === "" || reasonField === "") {
9889
+ return new Error("");
9890
+ }
9891
+ return new Error(safeStringify$1(value));
9892
+ }
9893
+ function safeErrorStack(value) {
9894
+ try {
9895
+ if (value instanceof Error) {
9896
+ if (typeof value.stack === "string") {
9897
+ return value.stack;
9898
+ }
9899
+ if (typeof value.message === "string") {
9900
+ const name = typeof value.name === "string" && value.name.length > 0 ? value.name : "Error";
9901
+ return `${name}: ${value.message}`;
9902
+ }
9903
+ }
9904
+ if (typeof value === "string") {
9905
+ return value;
9906
+ }
9907
+ }
9908
+ catch { }
9909
+ return safeStringify$1(value);
9910
+ }
9911
+ function safeStringify$1(value) {
9912
+ try {
9913
+ const seen = new WeakSet();
9914
+ const json = JSON.stringify(value, (_key, v) => {
9915
+ if (typeof v === "bigint") {
9916
+ return `${v.toString()}n`;
9917
+ }
9918
+ if (typeof v === "function") {
9919
+ return "[Function]";
9920
+ }
9921
+ if (typeof v === "symbol") {
9922
+ return v.toString();
9923
+ }
9924
+ if (typeof v === "object" && v !== null) {
9925
+ if (seen.has(v)) {
9926
+ return "[Circular]";
9927
+ }
9928
+ seen.add(v);
9929
+ }
9930
+ return v;
9931
+ });
9932
+ if (json !== undefined) {
9933
+ return json;
9934
+ }
9935
+ }
9936
+ catch { }
9937
+ if (value !== null && typeof value === "object") {
9938
+ const ctor = value.constructor?.name ?? "Object";
9939
+ let keys = [];
9940
+ try {
9941
+ keys = Object.keys(value);
9942
+ }
9943
+ catch { }
9944
+ return keys.length > 0 ? `[${ctor} keys=${keys.join(",")}]` : `[${ctor}]`;
9945
+ }
9946
+ return String(value);
9947
+ }
9948
+
9832
9949
  function domainSession (domain, connection, logger, successMessages, errorMessages) {
9833
9950
  if (domain == null) {
9834
9951
  domain = "global";
@@ -10064,7 +10181,7 @@ function domainSession (domain, connection, logger, successMessages, errorMessag
10064
10181
  callback(msg);
10065
10182
  }
10066
10183
  catch (e) {
10067
- logger.error(`Callback failed: ${e} \n ${e.stack} \n msg was: ${JSON.stringify(msg)}`, e);
10184
+ logger.error(`Callback failed: ${safeErrorStack(e)} \n msg was: ${JSON.stringify(msg)}`, e);
10068
10185
  }
10069
10186
  });
10070
10187
  },
@@ -10080,65 +10197,6 @@ function domainSession (domain, connection, logger, successMessages, errorMessag
10080
10197
  };
10081
10198
  }
10082
10199
 
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
10200
  class Connection {
10143
10201
  settings;
10144
10202
  logger;
@@ -10397,7 +10455,7 @@ class Connection {
10397
10455
  }
10398
10456
  catch (error) {
10399
10457
  try {
10400
- this.logger.error(`Message handler failed with ${error.stack}`, error);
10458
+ this.logger.error(`Message handler failed with ${safeErrorStack(error)}`, error);
10401
10459
  }
10402
10460
  catch (loggerError) {
10403
10461
  console.log("Message handler failed", error);
@@ -10875,7 +10933,7 @@ class Logger {
10875
10933
  }
10876
10934
  interop.invoke(Logger.InteropMethodName, args)
10877
10935
  .catch((e) => {
10878
- this.logFn.error(`Unable to send log message to the platform: ${e.message}`, e);
10936
+ this.logFn.error(`Unable to send log message to the platform: ${normalizeError(e).message}`, e);
10879
10937
  });
10880
10938
  }
10881
10939
  }
@@ -10959,7 +11017,7 @@ const ContextMessageReplaySpec = {
10959
11017
  }
10960
11018
  };
10961
11019
 
10962
- var version = "6.10.4";
11020
+ var version = "6.11.0";
10963
11021
 
10964
11022
  /*!
10965
11023
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
@@ -11623,6 +11681,7 @@ function requireOtelUtils () {
11623
11681
  (function (exports$1) {
11624
11682
  Object.defineProperty(exports$1, "__esModule", { value: true });
11625
11683
  exports$1.extractFilteringContextFromArgs = exports$1.deep_value = exports$1.getOTELData = exports$1.flattenOtelAtributes = void 0;
11684
+ exports$1.withTimeout = withTimeout;
11626
11685
  const container_1 = requireContainer();
11627
11686
  /* eslint-disable @typescript-eslint/no-explicit-any */
11628
11687
  const flattenOtelAtributes = (data, maxDepth) => {
@@ -11740,6 +11799,19 @@ function requireOtelUtils () {
11740
11799
  return filteringContext;
11741
11800
  };
11742
11801
  exports$1.extractFilteringContextFromArgs = extractFilteringContextFromArgs;
11802
+ function withTimeout(promise, timeout) {
11803
+ if (!promise) {
11804
+ return Promise.resolve();
11805
+ }
11806
+ if (!timeout) {
11807
+ return promise;
11808
+ }
11809
+ let timeoutId;
11810
+ return new Promise((rs, rj) => {
11811
+ timeoutId = setTimeout(rs, timeout);
11812
+ promise.then(() => rs(), rj);
11813
+ }).then(() => clearTimeout(timeoutId));
11814
+ }
11743
11815
 
11744
11816
  } (otelUtils));
11745
11817
  return otelUtils;
@@ -12400,21 +12472,11 @@ function requireBuilder () {
12400
12472
  Builder.maybeAddResourceAttributesToAttributes(this.settings.logs);
12401
12473
  Builder.maybeAddResourceAttributesToAttributes(this.settings.metrics);
12402
12474
  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);
12475
+ // Builder.propagateAttributeDownEx("useSSOAuth", this.settings);
12476
+ // Builder.propagateAttributeDownEx("useSSOAuthRawToken", this.settings);
12477
+ Builder.propagateAttributesDownEx("headers", this.settings);
12478
+ Builder.propagateAttributesDownEx("additionalAttributes", this.settings);
12479
+ Builder.propagateAttributesDownEx("additionalResourceAttributes", this.settings);
12418
12480
  const metricsBuilder = (_g = this.metricsBuilder) !== null && _g !== void 0 ? _g : this.withMetrics();
12419
12481
  const metrics = metricsBuilder
12420
12482
  .withLogger(this.logger)
@@ -12442,6 +12504,11 @@ function requireBuilder () {
12442
12504
  }
12443
12505
  settings[k] = (_a = settings[k]) !== null && _a !== void 0 ? _a : otelSettings[k];
12444
12506
  }
12507
+ static propagateAttributeDownEx(k, otelSettings) {
12508
+ Builder.propagateAttributeDown(k, otelSettings, otelSettings.logs);
12509
+ Builder.propagateAttributeDown(k, otelSettings, otelSettings.metrics);
12510
+ Builder.propagateAttributeDown(k, otelSettings, otelSettings.traces);
12511
+ }
12445
12512
  static propagateAttributesDown(k, otelSettings, settings) {
12446
12513
  var _a, _b;
12447
12514
  if (!settings) {
@@ -12449,7 +12516,15 @@ function requireBuilder () {
12449
12516
  }
12450
12517
  const providedOtel = (_a = otelSettings[k]) !== null && _a !== void 0 ? _a : {};
12451
12518
  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)));
12519
+ settings[k] = () => {
12520
+ var _a, _b, _c;
12521
+ 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));
12522
+ };
12523
+ }
12524
+ static propagateAttributesDownEx(k, otelSettings) {
12525
+ Builder.propagateAttributesDown(k, otelSettings, otelSettings.logs);
12526
+ Builder.propagateAttributesDown(k, otelSettings, otelSettings.metrics);
12527
+ Builder.propagateAttributesDown(k, otelSettings, otelSettings.traces);
12453
12528
  }
12454
12529
  static maybeAddResourceAttributesToAttributes(settings) {
12455
12530
  if (settings === null || settings === void 0 ? void 0 : settings.addResourceAttributesToAttributes) {
@@ -12877,7 +12952,7 @@ function requireDist () {
12877
12952
  return (mod && mod.__esModule) ? mod : { "default": mod };
12878
12953
  };
12879
12954
  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;
12955
+ 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
12956
  var builder_1 = requireBuilder();
12882
12957
  Object.defineProperty(exports$1, "Builder", { enumerable: true, get: function () { return builder_1.Builder; } });
12883
12958
  var log4jsWrapper_1 = requireLog4jsWrapper();
@@ -12908,6 +12983,7 @@ function requireDist () {
12908
12983
  Object.defineProperty(exports$1, "flattenOtelAtributes", { enumerable: true, get: function () { return otelUtils_1.flattenOtelAtributes; } });
12909
12984
  Object.defineProperty(exports$1, "extractFilteringContextFromArgs", { enumerable: true, get: function () { return otelUtils_1.extractFilteringContextFromArgs; } });
12910
12985
  Object.defineProperty(exports$1, "deep_value", { enumerable: true, get: function () { return otelUtils_1.deep_value; } });
12986
+ Object.defineProperty(exports$1, "withTimeout", { enumerable: true, get: function () { return otelUtils_1.withTimeout; } });
12911
12987
  if (typeof Promise !== "undefined") {
12912
12988
  Promise.allSettled = Promise.allSettled || ((promises) => Promise.all(promises.map((p) => p
12913
12989
  .then((value) => ({
@@ -15516,7 +15592,7 @@ class GW3Bridge {
15516
15592
  distExports.Traces.currentTracingState = ts;
15517
15593
  }
15518
15594
  const contextData = this._contextNameToData[name];
15519
- ts.addData("DIAGNOSTIC", { data: contextData });
15595
+ ts.addData("DIAGNOSTIC", { data });
15520
15596
  ts.injectPropagationInfo(data);
15521
15597
  if (!contextData || !contextData.isAnnounced) {
15522
15598
  return this.createContext(name, data);
@@ -15918,6 +15994,10 @@ class GW3Bridge {
15918
15994
  }
15919
15995
  }
15920
15996
  }
15997
+ const pi = distExports.Traces.extractPropagationInfo(delta, true) ||
15998
+ distExports.Traces.extractPropagationInfo(delta?.added, true) ||
15999
+ distExports.Traces.extractPropagationInfo(delta?.updated, true) ||
16000
+ distExports.Traces.extractPropagationInfo(delta?.reset, true);
15921
16001
  for (const updateCallbackIndex in contextData.updateCallbacks) {
15922
16002
  if (contextData.updateCallbacks.hasOwnProperty(updateCallbackIndex)) {
15923
16003
  try {
@@ -15927,7 +16007,7 @@ class GW3Bridge {
15927
16007
  ...delta.updated,
15928
16008
  ...delta.reset
15929
16009
  });
15930
- updateCallback(deepClone(contextData.context), deltaArg, delta.removed, parseInt(updateCallbackIndex, 10), extraData, distExports.Traces.extractPropagationInfo(delta));
16010
+ updateCallback(deepClone(contextData.context), deltaArg, delta.removed, parseInt(updateCallbackIndex, 10), extraData, pi);
15931
16011
  }
15932
16012
  catch (err) {
15933
16013
  this._logger.debug("callback error: " + JSON.stringify(err));