@interopio/desktop 6.9.0 → 6.9.2

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.
@@ -1674,12 +1674,16 @@ class WebPlatformTransport {
1674
1674
  child.source.postMessage(event.data, child.origin, [data.port]);
1675
1675
  return;
1676
1676
  }
1677
- handleConnectionRejected() {
1677
+ handleConnectionRejected(event) {
1678
1678
  this.logger.debug("handling a connection rejection. Most likely the reason is that this window was not created by a glue API call");
1679
- if (this.connectionReject) {
1680
- this.connectionReject("The platform connection was rejected. Most likely because this window was not created by a glue API call");
1681
- delete this.connectionReject;
1679
+ if (!this.connectionReject) {
1680
+ return;
1682
1681
  }
1682
+ const errorMsg = typeof event.data.glue42core?.error === "string"
1683
+ ? `Connection was rejected. ${event.data.glue42core?.error}`
1684
+ : "The platform connection was rejected. Most likely because this window was not created by a glue API call";
1685
+ this.connectionReject(errorMsg);
1686
+ delete this.connectionReject;
1683
1687
  }
1684
1688
  handleConnectionRequest(event) {
1685
1689
  if (this.extContentConnecting) {
@@ -1863,7 +1867,7 @@ class WebPlatformTransport {
1863
1867
  await this.requestConnectionPermissionFromExt();
1864
1868
  }
1865
1869
  getPossibleParentsInWindow(currentWindow) {
1866
- return (!currentWindow || currentWindow === currentWindow.top) ? [] : [currentWindow.parent, ...this.getPossibleParentsInWindow(currentWindow.parent)];
1870
+ return (!currentWindow?.parent || currentWindow === currentWindow.parent) ? [] : [currentWindow.parent, ...this.getPossibleParentsInWindow(currentWindow.parent)];
1867
1871
  }
1868
1872
  getPossibleParentsOutsideWindow(opener, current) {
1869
1873
  return (!opener || !current || opener === current) ? [] : [opener, ...this.getPossibleParentsInWindow(opener), ...this.getPossibleParentsOutsideWindow(opener.opener, opener)];
@@ -2819,7 +2823,7 @@ let Logger$1 = class Logger {
2819
2823
  this.log(message, "warn");
2820
2824
  }
2821
2825
  error(message, err) {
2822
- this.log(message, "error");
2826
+ this.log(message, "error", err);
2823
2827
  }
2824
2828
  canPublish(level, compareWith) {
2825
2829
  const levelIdx = order.indexOf(level);
@@ -2836,7 +2840,7 @@ let Logger$1 = class Logger {
2836
2840
  "\n" +
2837
2841
  e.stack
2838
2842
  .split("\n")
2839
- .slice(3)
2843
+ .slice(4)
2840
2844
  .join("\n");
2841
2845
  }
2842
2846
  }
@@ -2845,11 +2849,18 @@ let Logger$1 = class Logger {
2845
2849
  if (interop) {
2846
2850
  try {
2847
2851
  if (interop.methods({ name: Logger.InteropMethodName }).length > 0) {
2848
- interop.invoke(Logger.InteropMethodName, {
2849
- msg: `${message}`,
2852
+ const args = {
2853
+ msg: message,
2850
2854
  logger: loggerName,
2851
2855
  level
2852
- });
2856
+ };
2857
+ if (error && error instanceof Error) {
2858
+ args.error = {
2859
+ message: error.message,
2860
+ stack: error.stack ?? ""
2861
+ };
2862
+ }
2863
+ interop.invoke(Logger.InteropMethodName, args);
2853
2864
  }
2854
2865
  }
2855
2866
  catch {
@@ -2927,7 +2938,7 @@ const ContextMessageReplaySpec = {
2927
2938
  }
2928
2939
  };
2929
2940
 
2930
- var version$1 = "6.4.2";
2941
+ var version$1 = "6.5.0";
2931
2942
 
2932
2943
  function prepareConfig$1 (configuration, ext, glue42gd) {
2933
2944
  let nodeStartingContext;
@@ -18543,7 +18554,7 @@ function factory$3(agm) {
18543
18554
  };
18544
18555
  }
18545
18556
 
18546
- var version = "6.9.0";
18557
+ var version = "6.9.2";
18547
18558
 
18548
18559
  var prepareConfig = (options) => {
18549
18560
  function getLibConfig(value, defaultMode, trueMode) {
@@ -20293,9 +20304,14 @@ class Intents {
20293
20304
  if (request.target === "startNew") {
20294
20305
  return handlers.filter((handler) => handler.type === "app").length > 1;
20295
20306
  }
20296
- if (typeof request.target === "object") {
20307
+ if (request.target.instance) {
20297
20308
  return false;
20298
20309
  }
20310
+ if (request.target.app) {
20311
+ const searchedAppName = request.target.app;
20312
+ const instanceHandlersByAppName = handlers.filter((handler) => handler.applicationName === searchedAppName && handler.instanceId);
20313
+ return instanceHandlersByAppName.length > 1;
20314
+ }
20299
20315
  return false;
20300
20316
  }
20301
20317
  async removeSingletons(handlers) {