@openfin/core 40.82.11 → 40.82.13

Sign up to get free protection for your applications and to get access to all the features.
package/out/mock.js CHANGED
@@ -3,7 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var require$$0 = require('events');
6
- var require$$3 = require('lodash');
6
+ var require$$0$1 = require('lodash/cloneDeep');
7
+ var require$$3 = require('lodash/isEqual');
7
8
 
8
9
  function _mergeNamespaces(n, m) {
9
10
  m.forEach(function (e) {
@@ -241,27 +242,50 @@ Object.defineProperty(window$2, "__esModule", { value: true });
241
242
  *
242
243
  * @packageDocumentation
243
244
  */
245
+ var __createBinding$1 = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
246
+ if (k2 === undefined) k2 = k;
247
+ var desc = Object.getOwnPropertyDescriptor(m, k);
248
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
249
+ desc = { enumerable: true, get: function() { return m[k]; } };
250
+ }
251
+ Object.defineProperty(o, k2, desc);
252
+ }) : (function(o, m, k, k2) {
253
+ if (k2 === undefined) k2 = k;
254
+ o[k2] = m[k];
255
+ }));
256
+ var __setModuleDefault$1 = (commonjsGlobal && commonjsGlobal.__setModuleDefault) || (Object.create ? (function(o, v) {
257
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
258
+ }) : function(o, v) {
259
+ o["default"] = v;
260
+ });
261
+ var __importStar$1 = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) {
262
+ if (mod && mod.__esModule) return mod;
263
+ var result = {};
264
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$1(result, mod, k);
265
+ __setModuleDefault$1(result, mod);
266
+ return result;
267
+ };
244
268
  Object.defineProperty(events, "__esModule", { value: true });
245
269
  events.WindowEvents = events.WebContentsEvents = events.ViewEvents = events.SystemEvents = events.PlatformEvents = events.GlobalHotkeyEvents = events.FrameEvents = events.ExternalApplicationEvents = events.BaseEvents = events.ApplicationEvents = void 0;
246
- const ApplicationEvents = application$1;
270
+ const ApplicationEvents = __importStar$1(application$1);
247
271
  events.ApplicationEvents = ApplicationEvents;
248
- const BaseEvents = base$1;
272
+ const BaseEvents = __importStar$1(base$1);
249
273
  events.BaseEvents = BaseEvents;
250
- const ExternalApplicationEvents = externalApplication$1;
274
+ const ExternalApplicationEvents = __importStar$1(externalApplication$1);
251
275
  events.ExternalApplicationEvents = ExternalApplicationEvents;
252
- const FrameEvents = frame$1;
276
+ const FrameEvents = __importStar$1(frame$1);
253
277
  events.FrameEvents = FrameEvents;
254
- const GlobalHotkeyEvents = globalHotkey$1;
278
+ const GlobalHotkeyEvents = __importStar$1(globalHotkey$1);
255
279
  events.GlobalHotkeyEvents = GlobalHotkeyEvents;
256
- const PlatformEvents = platform$1;
280
+ const PlatformEvents = __importStar$1(platform$1);
257
281
  events.PlatformEvents = PlatformEvents;
258
- const SystemEvents = system$1;
282
+ const SystemEvents = __importStar$1(system$1);
259
283
  events.SystemEvents = SystemEvents;
260
- const ViewEvents = view$1;
284
+ const ViewEvents = __importStar$1(view$1);
261
285
  events.ViewEvents = ViewEvents;
262
- const WebContentsEvents = webcontents;
286
+ const WebContentsEvents = __importStar$1(webcontents);
263
287
  events.WebContentsEvents = WebContentsEvents;
264
- const WindowEvents = window$2;
288
+ const WindowEvents = __importStar$1(window$2);
265
289
  events.WindowEvents = WindowEvents;
266
290
 
267
291
  (function (exports) {
@@ -620,19 +644,57 @@ transportErrors.NotImplementedError = NotImplementedError;
620
644
  class NotSupportedError extends Error {
621
645
  }
622
646
  transportErrors.NotSupportedError = NotSupportedError;
623
- class InternalError extends Error {
647
+ class DeserializedError extends Error {
624
648
  constructor(err) {
625
649
  const { message, name, stack, ...rest } = err;
626
650
  super(message);
651
+ if ('cause' in err && err.cause) {
652
+ this.cause = new DeserializedError(err.cause);
653
+ }
627
654
  this.name = name || 'Error';
628
655
  this.stack = stack ?? this.toString();
629
- Object.keys(rest).forEach(key => {
656
+ Object.keys(rest)
657
+ .filter((k) => k !== 'cause')
658
+ .forEach((key) => {
630
659
  this[key] = rest[key];
631
660
  });
632
661
  }
633
662
  }
634
663
  // For documentation of the error methods being used see here: https://v8.dev/docs/stack-trace-api
635
664
  class RuntimeError extends Error {
665
+ static trimEndCallSites(err, takeUntilRegex) {
666
+ // save original props
667
+ const length = Error.stackTraceLimit;
668
+ // eslint-disable-next-line no-underscore-dangle
669
+ const _prepareStackTrace = Error.prepareStackTrace;
670
+ // This will be called when we access the `stack` property
671
+ Error.prepareStackTrace = (_, stack) => stack;
672
+ // in channel errors, the error was already serialized so we need to handle both string and CallSite[]
673
+ const isString = typeof err.stack === 'string';
674
+ const stack = (isString ? err.stack?.split('\n') : err.stack) ?? [];
675
+ // restore original props
676
+ Error.prepareStackTrace = _prepareStackTrace;
677
+ Error.stackTraceLimit = length;
678
+ // stack is optional in non chromium contexts
679
+ if (stack.length) {
680
+ const newStack = [];
681
+ // remove this call ONLY if it's not a string
682
+ for (const line of isString ? stack : stack.slice(1)) {
683
+ // inclusive take until
684
+ newStack.push(line);
685
+ if (takeUntilRegex.test(line.toString())) {
686
+ break;
687
+ }
688
+ }
689
+ if (isString) {
690
+ // maintain it as a string
691
+ err.stack = newStack.join('\n');
692
+ }
693
+ else {
694
+ err.stack = RuntimeError.prepareStackTrace(err, newStack);
695
+ }
696
+ }
697
+ }
636
698
  static getCallSite(callsToRemove = 0) {
637
699
  const length = Error.stackTraceLimit;
638
700
  const realCallsToRemove = callsToRemove + 1; // remove this call;
@@ -651,21 +713,82 @@ class RuntimeError extends Error {
651
713
  if (typeof Error.prepareStackTrace === 'function') {
652
714
  return Error.prepareStackTrace(err, callSites);
653
715
  }
654
- let string = "";
655
- string += err.name || "Error";
656
- string += `: ${err.message || ""}`;
657
- for (const callSite of callSites) {
658
- string += `\n at ${callSite.toString()}`;
659
- }
660
- return string;
661
- }
662
- ;
716
+ // TODO: this is just a first iteration, we can make this "nicer" at some point
717
+ // const EXCLUSIONS = ['IpcRenderer', 'Object.onMessage', 'Transport.onmessage', 'MessageReceiver.onmessage'];
718
+ let stackTrace = `${err.name || 'Error'}: ${err.message || ''}\n`;
719
+ stackTrace += callSites
720
+ .map((line) => ` at ${line}`)
721
+ // .filter((line) => !EXCLUSIONS.some((l) => line.includes(l)))
722
+ .join('\n');
723
+ return stackTrace;
724
+ }
725
+ /*
726
+
727
+ NON filtered stack trace example from MTP page channel-errors.tsx:
728
+
729
+ Caused by: ChannelError: Error from ch0
730
+ at ChannelClient.dispatch (<anonymous>:3:119560)
731
+ at eval (test-channel-errors.tsx:73:26)
732
+ at ChannelProvider.processAction (<anonymous>:3:116748)
733
+ at ChannelProvider.processAction (<anonymous>:3:149121)
734
+ at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
735
+ at MessageReceiver.onmessage (<anonymous>:3:131232)
736
+ at Transport.onmessage (<anonymous>:3:282049)
737
+ at IpcRenderer.<anonymous> (<anonymous>:3:275150)
738
+ at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
739
+ at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
740
+ Caused by: ChannelError: Error from ch0
741
+ at ChannelClient.dispatch (<anonymous>:3:119560)
742
+ at eval (test-channel-errors.tsx:73:26)
743
+ at ChannelProvider.processAction (<anonymous>:3:116748)
744
+ at ChannelProvider.processAction (<anonymous>:3:149121)
745
+ at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
746
+ at MessageReceiver.onmessage (<anonymous>:3:131232)
747
+ at Transport.onmessage (<anonymous>:3:282049)
748
+ at IpcRenderer.<anonymous> (<anonymous>:3:275150)
749
+ at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
750
+ at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
751
+ Caused by: ChannelError: Error from ch0
752
+ at ChannelClient.dispatch (<anonymous>:3:119560)
753
+ at eval (test-channel-errors.tsx:73:26)
754
+ at ChannelProvider.processAction (<anonymous>:3:116748)
755
+ at ChannelProvider.processAction (<anonymous>:3:149121)
756
+ at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
757
+ at MessageReceiver.onmessage (<anonymous>:3:131232)
758
+ at Transport.onmessage (<anonymous>:3:282049)
759
+ at IpcRenderer.<anonymous> (<anonymous>:3:275150)
760
+ at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
761
+ at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
762
+ Caused by: ChannelError: Error from ch0
763
+ at ChannelClient.dispatch (<anonymous>:3:119560)
764
+ at eval (test-channel-errors.tsx:50:23)
765
+ at ChannelProvider.processAction (<anonymous>:3:116748)
766
+ at ChannelProvider.processAction (<anonymous>:3:149121)
767
+ at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
768
+ at MessageReceiver.onmessage (<anonymous>:3:131232)
769
+ at Transport.onmessage (<anonymous>:3:282049)
770
+ at IpcRenderer.<anonymous> (<anonymous>:3:275150)
771
+ at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
772
+ at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
773
+ Caused by: Error: Error from ch0
774
+ at eval (test-channel-errors.tsx:54:19)
775
+ at ChannelProvider.processAction (<anonymous>:3:116748)
776
+ at ChannelProvider.processAction (<anonymous>:3:149121)
777
+ at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
778
+ at MessageReceiver.onmessage (<anonymous>:3:131232)
779
+ at Transport.onmessage (<anonymous>:3:282049)
780
+ at IpcRenderer.<anonymous> (<anonymous>:3:275150)
781
+ at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
782
+ at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
783
+
784
+
785
+ */
663
786
  constructor(payload, callSites) {
664
787
  const { reason, error } = payload;
665
788
  super(reason);
666
- this.name = 'RuntimeError';
789
+ this.name = this.constructor.name;
667
790
  if (error?.stack) {
668
- this.cause = new InternalError(error);
791
+ this.cause = new DeserializedError(error);
669
792
  }
670
793
  if (callSites) {
671
794
  this.stack = RuntimeError.prepareStackTrace(this, callSites);
@@ -793,7 +916,9 @@ function requireFactory$3 () {
793
916
  * @experimental
794
917
  */
795
918
  async wrap(identity) {
796
- this.wire.sendAction('view-wrap');
919
+ this.wire.sendAction('view-wrap').catch((e) => {
920
+ // we do not want to expose this error, just continue if this analytics-only call fails
921
+ });
797
922
  const errorMsg = (0, validate_1.validateIdentity)(identity);
798
923
  if (errorMsg) {
799
924
  throw new Error(errorMsg);
@@ -3016,9 +3141,14 @@ function requireInstance$2 () {
3016
3141
  // don't expose
3017
3142
  });
3018
3143
  const layoutWindow = await this.getCurrentWindow();
3144
+ let layoutWindowIdentity = layoutWindow.identity;
3145
+ // TODO: CORE-1857 - when we tearout active layout or drag a view out of a window, the above identity includes the whole window info.
3146
+ if (layoutWindowIdentity.identity) {
3147
+ layoutWindowIdentity = layoutWindowIdentity.identity;
3148
+ }
3019
3149
  try {
3020
3150
  const providerChannelClient = await __classPrivateFieldGet(this, _View_providerChannelClient, "f").getValue();
3021
- const client = await layout_entities_1.LayoutNode.newLayoutEntitiesClient(providerChannelClient, layout_constants_1.LAYOUT_CONTROLLER_ID, layoutWindow.identity);
3151
+ const client = await layout_entities_1.LayoutNode.newLayoutEntitiesClient(providerChannelClient, layout_constants_1.LAYOUT_CONTROLLER_ID, layoutWindowIdentity);
3022
3152
  const layoutIdentity = await client.getLayoutIdentityForViewOrThrow(this.identity);
3023
3153
  return this.fin.Platform.Layout.wrap(layoutIdentity);
3024
3154
  }
@@ -3031,7 +3161,7 @@ function requireInstance$2 () {
3031
3161
  throw e;
3032
3162
  }
3033
3163
  // fallback logic for missing endpoint
3034
- return this.fin.Platform.Layout.wrap(layoutWindow.identity);
3164
+ return this.fin.Platform.Layout.wrap(layoutWindowIdentity);
3035
3165
  }
3036
3166
  };
3037
3167
  /**
@@ -5907,7 +6037,7 @@ function requireWindow () {
5907
6037
  Object.defineProperty(system, "__esModule", { value: true });
5908
6038
  system.System = void 0;
5909
6039
  const base_1$i = base;
5910
- const transport_errors_1$1 = transportErrors;
6040
+ const transport_errors_1$5 = transportErrors;
5911
6041
  const window_1 = requireWindow();
5912
6042
  const events_1$6 = require$$0;
5913
6043
  /**
@@ -6997,9 +7127,9 @@ class System extends base_1$i.EmitterBase {
6997
7127
  });
6998
7128
  // node.js environment not supported
6999
7129
  if (this.wire.environment.type !== 'openfin') {
7000
- throw new transport_errors_1$1.NotSupportedError('downloadAsset only supported in an OpenFin Render process');
7130
+ throw new transport_errors_1$5.NotSupportedError('downloadAsset only supported in an OpenFin Render process');
7001
7131
  }
7002
- const callSite = transport_errors_1$1.RuntimeError.getCallSite();
7132
+ const callSite = transport_errors_1$5.RuntimeError.getCallSite();
7003
7133
  const downloadId = this.wire.environment.getNextMessageId().toString();
7004
7134
  const dlProgressKey = `asset-download-progress-${downloadId}`;
7005
7135
  const dlErrorKey = `asset-download-error-${downloadId}`;
@@ -7019,7 +7149,7 @@ class System extends base_1$i.EmitterBase {
7019
7149
  const dlError = (payload) => {
7020
7150
  cleanListeners();
7021
7151
  const { reason, err: error } = payload;
7022
- reject(new transport_errors_1$1.RuntimeError({ reason, error }, callSite));
7152
+ reject(new transport_errors_1$5.RuntimeError({ reason, error }, callSite));
7023
7153
  };
7024
7154
  const dlComplete = () => {
7025
7155
  cleanListeners();
@@ -7070,11 +7200,11 @@ class System extends base_1$i.EmitterBase {
7070
7200
  * ```
7071
7201
  */
7072
7202
  downloadRuntime(options, progressListener) {
7073
- const callsites = transport_errors_1$1.RuntimeError.getCallSite();
7203
+ const callsites = transport_errors_1$5.RuntimeError.getCallSite();
7074
7204
  return new Promise((resolve, reject) => {
7075
7205
  // node.js environment not supported
7076
7206
  if (this.wire.environment.type !== 'openfin') {
7077
- reject(new transport_errors_1$1.NotSupportedError('downloadRuntime only supported in an OpenFin Render process'));
7207
+ reject(new transport_errors_1$5.NotSupportedError('downloadRuntime only supported in an OpenFin Render process'));
7078
7208
  return;
7079
7209
  }
7080
7210
  const downloadId = this.wire.environment.getNextMessageId().toString();
@@ -7096,7 +7226,7 @@ class System extends base_1$i.EmitterBase {
7096
7226
  const dlError = (payload) => {
7097
7227
  cleanListeners();
7098
7228
  const { reason, err: error } = payload;
7099
- reject(new transport_errors_1$1.RuntimeError({ reason, error }, callsites));
7229
+ reject(new transport_errors_1$5.RuntimeError({ reason, error }, callsites));
7100
7230
  };
7101
7231
  const dlComplete = () => {
7102
7232
  cleanListeners();
@@ -7831,6 +7961,7 @@ var channel = {};
7831
7961
 
7832
7962
  Object.defineProperty(channel, "__esModule", { value: true });
7833
7963
  channel.ChannelBase = channel.ProtectedItems = void 0;
7964
+ const transport_errors_1$4 = transportErrors;
7834
7965
  const resultOrPayload = (func) => async (topic, payload, senderIdentity) => {
7835
7966
  const res = await func(topic, payload, senderIdentity);
7836
7967
  return res === undefined ? payload : res;
@@ -7863,6 +7994,7 @@ class ChannelBase {
7863
7994
  return this.postAction ? await this.postAction(topic, actionProcessed, senderIdentity) : actionProcessed;
7864
7995
  }
7865
7996
  catch (e) {
7997
+ transport_errors_1$4.RuntimeError.trimEndCallSites(e, /Channel.*processAction/);
7866
7998
  if (this.errorMiddleware) {
7867
7999
  return this.errorMiddleware(topic, e, senderIdentity);
7868
8000
  }
@@ -8164,6 +8296,25 @@ class ChannelBase {
8164
8296
  }
8165
8297
  channel.ChannelBase = ChannelBase;
8166
8298
 
8299
+ var channelError = {};
8300
+
8301
+ Object.defineProperty(channelError, "__esModule", { value: true });
8302
+ channelError.ChannelError = void 0;
8303
+ const transport_errors_1$3 = transportErrors;
8304
+ class ChannelError extends Error {
8305
+ constructor(originalError, action, dispatchPayload, callsites) {
8306
+ super(originalError.message);
8307
+ this.action = action;
8308
+ this.dispatchPayload = dispatchPayload;
8309
+ this.name = this.constructor.name;
8310
+ if ('cause' in originalError && originalError.cause instanceof Error) {
8311
+ this.cause = originalError.cause;
8312
+ }
8313
+ this.stack = transport_errors_1$3.RuntimeError.prepareStackTrace(this, callsites);
8314
+ }
8315
+ }
8316
+ channelError.ChannelError = ChannelError;
8317
+
8167
8318
  var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8168
8319
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
8169
8320
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
@@ -8178,7 +8329,9 @@ var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateF
8178
8329
  var _ChannelClient_protectedObj, _ChannelClient_strategy, _ChannelClient_close;
8179
8330
  Object.defineProperty(client, "__esModule", { value: true });
8180
8331
  client.ChannelClient = void 0;
8332
+ const transport_errors_1$2 = transportErrors;
8181
8333
  const channel_1$1 = channel;
8334
+ const channel_error_1$1 = channelError;
8182
8335
  const channelClientsByEndpointId = new Map();
8183
8336
  /**
8184
8337
  * Instance created to enable use of a channel as a client. Allows for communication with the
@@ -8280,7 +8433,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
8280
8433
  */
8281
8434
  async dispatch(action, payload) {
8282
8435
  if (__classPrivateFieldGet$c(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
8283
- return __classPrivateFieldGet$c(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload);
8436
+ const callSites = transport_errors_1$2.RuntimeError.getCallSite();
8437
+ return __classPrivateFieldGet$c(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
8438
+ throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
8439
+ });
8284
8440
  }
8285
8441
  throw new Error('The client you are trying to dispatch from is disconnected from the target provider.');
8286
8442
  }
@@ -8395,7 +8551,7 @@ class ClassicStrategy {
8395
8551
  _ClassicStrategy_endpointIdentityMap.set(this, new Map());
8396
8552
  // Store a set of cancellable promises to be able to reject them when client
8397
8553
  // connection problems occur
8398
- _ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map);
8554
+ _ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
8399
8555
  this.send = async (endpointId, action, payload) => {
8400
8556
  const to = __classPrivateFieldGet$b(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
8401
8557
  if (!to) {
@@ -8409,17 +8565,21 @@ class ClassicStrategy {
8409
8565
  }
8410
8566
  delete cleanId.isLocalEndpointId;
8411
8567
  // grab the promise before awaiting it to save in our pending messages map
8412
- const p = __classPrivateFieldGet$b(this, _ClassicStrategy_wire, "f")
8413
- .sendAction('send-channel-message', {
8568
+ const p = __classPrivateFieldGet$b(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
8414
8569
  ...cleanId,
8415
8570
  providerIdentity: this.providerIdentity,
8416
8571
  action,
8417
8572
  payload
8418
8573
  });
8419
8574
  __classPrivateFieldGet$b(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
8420
- const raw = await p.catch((error) => {
8575
+ const raw = await p
8576
+ .catch((error) => {
8577
+ if ('cause' in error) {
8578
+ throw error;
8579
+ }
8421
8580
  throw new Error(error.message);
8422
- }).finally(() => {
8581
+ })
8582
+ .finally(() => {
8423
8583
  // clean up the pending promise
8424
8584
  __classPrivateFieldGet$b(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
8425
8585
  });
@@ -8473,13 +8633,17 @@ var errors = {};
8473
8633
  Object.defineProperty(errors, "__esModule", { value: true });
8474
8634
  errors.errorToPOJO = void 0;
8475
8635
  function errorToPOJO(error) {
8476
- return {
8636
+ const errorObj = {
8477
8637
  stack: error.stack,
8478
8638
  name: error.name,
8479
8639
  message: error.message,
8480
8640
  // support the case where stack is empty or missing
8481
8641
  toString: () => error.stack || error.toString()
8482
8642
  };
8643
+ if ('cause' in error) {
8644
+ errorObj.cause = errorToPOJO(error.cause);
8645
+ }
8646
+ return errorObj;
8483
8647
  }
8484
8648
  errors.errorToPOJO = errorToPOJO;
8485
8649
 
@@ -8498,7 +8662,7 @@ var _RTCEndpoint_processAction, _RTCEndpoint_disconnectListener;
8498
8662
  Object.defineProperty(endpoint, "__esModule", { value: true });
8499
8663
  endpoint.RTCEndpoint = void 0;
8500
8664
  /* eslint-disable @typescript-eslint/no-unused-vars */
8501
- const errors_1$1 = errors;
8665
+ const errors_1$2 = errors;
8502
8666
  /*
8503
8667
  This handles sending RTC messages between RTC connections over the request and response data channels.
8504
8668
  */
@@ -8587,7 +8751,7 @@ class RTCEndpoint {
8587
8751
  if (this.rtc.channels.response.readyState === 'open') {
8588
8752
  this.rtc.channels.response.send(JSON.stringify({
8589
8753
  messageId,
8590
- error: (0, errors_1$1.errorToPOJO)(error),
8754
+ error: (0, errors_1$2.errorToPOJO)(error),
8591
8755
  success: false
8592
8756
  }));
8593
8757
  }
@@ -8903,8 +9067,10 @@ var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateF
8903
9067
  var _ChannelProvider_connections, _ChannelProvider_protectedObj, _ChannelProvider_strategy, _ChannelProvider_removeEndpoint, _ChannelProvider_close;
8904
9068
  Object.defineProperty(provider, "__esModule", { value: true });
8905
9069
  provider.ChannelProvider = void 0;
8906
- const channel_1 = channel;
9070
+ const transport_errors_1$1 = transportErrors;
8907
9071
  const runtimeVersioning_1 = runtimeVersioning;
9072
+ const channel_1 = channel;
9073
+ const channel_error_1 = channelError;
8908
9074
  /**
8909
9075
  * Instance created to enable use of a channel as a provider. Allows for communication with the {@link ChannelClient ChannelClients} by invoking an action on
8910
9076
  * a single client via {@link ChannelProvider#dispatch dispatch} or all clients via {@link ChannelProvider#publish publish}
@@ -9021,7 +9187,10 @@ class ChannelProvider extends channel_1.ChannelBase {
9021
9187
  dispatch(to, action, payload) {
9022
9188
  const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
9023
9189
  if (endpointId && __classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
9024
- return __classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload);
9190
+ const callSites = transport_errors_1$1.RuntimeError.getCallSite();
9191
+ return __classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
9192
+ throw new channel_error_1.ChannelError(e, action, payload, callSites);
9193
+ });
9025
9194
  }
9026
9195
  return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
9027
9196
  }
@@ -9234,6 +9403,7 @@ Object.defineProperty(messageReceiver, "__esModule", { value: true });
9234
9403
  messageReceiver.MessageReceiver = void 0;
9235
9404
  const client_1$1 = client;
9236
9405
  const base_1$g = base;
9406
+ const errors_1$1 = errors;
9237
9407
  /*
9238
9408
  This is a singleton (per fin object) tasked with routing messages coming off the ipc to the correct endpoint.
9239
9409
  It needs to be a singleton because there can only be one per wire. It tracks both clients and providers' processAction passed in via the strategy.
@@ -9262,6 +9432,7 @@ class MessageReceiver extends base_1$g.Base {
9262
9432
  if (!handler) {
9263
9433
  ackToSender.payload.success = false;
9264
9434
  ackToSender.payload.reason = `Client connection with identity uuid: ${this.wire.me.uuid} / name: ${this.wire.me.name} / endpointId: ${key} no longer connected.`;
9435
+ ackToSender.payload.error = (0, errors_1$1.errorToPOJO)(new Error(ackToSender.payload.reason));
9265
9436
  return this.wire.sendRaw(ackToSender);
9266
9437
  }
9267
9438
  try {
@@ -9273,6 +9444,7 @@ class MessageReceiver extends base_1$g.Base {
9273
9444
  catch (e) {
9274
9445
  ackToSender.payload.success = false;
9275
9446
  ackToSender.payload.reason = e.message;
9447
+ ackToSender.payload.error = (0, errors_1$1.errorToPOJO)(e);
9276
9448
  return this.wire.sendRaw(ackToSender);
9277
9449
  }
9278
9450
  }
@@ -9417,6 +9589,9 @@ var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateF
9417
9589
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
9418
9590
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
9419
9591
  };
9592
+ var __importDefault$1 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
9593
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9594
+ };
9420
9595
  var _ConnectionManager_messageReceiver, _ConnectionManager_rtcConnectionManager;
9421
9596
  Object.defineProperty(connectionManager, "__esModule", { value: true });
9422
9597
  connectionManager.ConnectionManager = void 0;
@@ -9428,7 +9603,7 @@ const ice_manager_1 = iceManager;
9428
9603
  const provider_1$1 = provider;
9429
9604
  const message_receiver_1 = messageReceiver;
9430
9605
  const protocol_manager_1 = protocolManager;
9431
- const strategy_3 = strategy;
9606
+ const strategy_3 = __importDefault$1(strategy);
9432
9607
  class ConnectionManager extends base_1$f.Base {
9433
9608
  static getProtocolOptionsFromStrings(protocols) {
9434
9609
  return protocols.map((protocol) => {
@@ -13307,13 +13482,16 @@ function requireInteropBroker () {
13307
13482
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
13308
13483
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
13309
13484
  };
13485
+ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
13486
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13487
+ };
13310
13488
  var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
13311
13489
  Object.defineProperty(InteropBroker, "__esModule", { value: true });
13312
13490
  InteropBroker.InteropBroker = void 0;
13313
13491
  const base_1 = base;
13314
- const SessionContextGroupBroker_1 = requireSessionContextGroupBroker();
13492
+ const SessionContextGroupBroker_1 = __importDefault(requireSessionContextGroupBroker());
13315
13493
  const utils_1 = utils$3;
13316
- const lodash_1 = require$$3;
13494
+ const isEqual_1 = __importDefault(require$$3);
13317
13495
  const PrivateChannelProvider_1 = requirePrivateChannelProvider();
13318
13496
  const lazy_1 = lazy;
13319
13497
  const defaultContextGroups = [
@@ -13511,7 +13689,7 @@ function requireInteropBroker () {
13511
13689
  constructor(...unused) {
13512
13690
  if (unused.length) {
13513
13691
  const [_ignore1, ignore2, opts] = unused;
13514
- if (opts && typeof opts === 'object' && !(0, lodash_1.isEqual)(opts, args[2])) {
13692
+ if (opts && typeof opts === 'object' && !(0, isEqual_1.default)(opts, args[2])) {
13515
13693
  // eslint-disable-next-line no-console
13516
13694
  console.warn('You have modified the parameters of the InteropOverride constructor. This behavior is deprecated and will be removed in a future version. You can modify these options in your manifest. Please consult our Interop docs for guidance on migrating to the new override scheme.');
13517
13695
  super(args[0], args[1], opts);
@@ -14688,9 +14866,32 @@ var utils$2 = {};
14688
14866
 
14689
14867
  var PrivateChannelClient$1 = {};
14690
14868
 
14869
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14870
+ if (k2 === undefined) k2 = k;
14871
+ var desc = Object.getOwnPropertyDescriptor(m, k);
14872
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14873
+ desc = { enumerable: true, get: function() { return m[k]; } };
14874
+ }
14875
+ Object.defineProperty(o, k2, desc);
14876
+ }) : (function(o, m, k, k2) {
14877
+ if (k2 === undefined) k2 = k;
14878
+ o[k2] = m[k];
14879
+ }));
14880
+ var __setModuleDefault = (commonjsGlobal && commonjsGlobal.__setModuleDefault) || (Object.create ? (function(o, v) {
14881
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
14882
+ }) : function(o, v) {
14883
+ o["default"] = v;
14884
+ });
14885
+ var __importStar = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) {
14886
+ if (mod && mod.__esModule) return mod;
14887
+ var result = {};
14888
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
14889
+ __setModuleDefault(result, mod);
14890
+ return result;
14891
+ };
14691
14892
  Object.defineProperty(PrivateChannelClient$1, "__esModule", { value: true });
14692
14893
  PrivateChannelClient$1.PrivateChannelClient = void 0;
14693
- const utils$1 = utils$3;
14894
+ const utils$1 = __importStar(utils$3);
14694
14895
  class PrivateChannelClient {
14695
14896
  constructor(client, id) {
14696
14897
  this.id = id;
@@ -14779,11 +14980,14 @@ class PrivateChannelClient {
14779
14980
  PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
14780
14981
 
14781
14982
  (function (exports) {
14983
+ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
14984
+ return (mod && mod.__esModule) ? mod : { "default": mod };
14985
+ };
14782
14986
  Object.defineProperty(exports, "__esModule", { value: true });
14783
14987
  exports.getIntentResolution = exports.isChannel = exports.isContext = exports.connectPrivateChannel = exports.buildAppChannelObject = exports.buildPrivateChannelObject = exports.ChannelError = exports.ResultError = exports.UnsupportedChannelApiError = exports.getUnsupportedChannelApis = void 0;
14784
14988
  const utils_1 = utils$3;
14785
14989
  const PrivateChannelClient_1 = PrivateChannelClient$1;
14786
- const lodash_1 = require$$3;
14990
+ const isEqual_1 = __importDefault(require$$3);
14787
14991
  const getUnsupportedChannelApis = (channelType) => {
14788
14992
  return {
14789
14993
  addContextListener: () => {
@@ -14911,7 +15115,7 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
14911
15115
  const wrappedHandler = (context, contextMetadata) => {
14912
15116
  if (first) {
14913
15117
  first = false;
14914
- if ((0, lodash_1.isEqual)(currentContext, context)) {
15118
+ if ((0, isEqual_1.default)(currentContext, context)) {
14915
15119
  return;
14916
15120
  }
14917
15121
  }
@@ -15033,13 +15237,16 @@ function requireFdc3Common () {
15033
15237
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
15034
15238
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
15035
15239
  };
15240
+ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
15241
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15242
+ };
15036
15243
  var _FDC3ModuleBase_producer;
15037
15244
  Object.defineProperty(fdc3Common, "__esModule", { value: true });
15038
15245
  fdc3Common.FDC3ModuleBase = void 0;
15039
15246
  const utils_1 = utils$2;
15040
15247
  const utils_2 = utils$3;
15041
15248
  const InteropClient_1 = requireInteropClient();
15042
- const lodash_1 = require$$3;
15249
+ const isEqual_1 = __importDefault(require$$3);
15043
15250
  class FDC3ModuleBase {
15044
15251
  get client() {
15045
15252
  return __classPrivateFieldGet(this, _FDC3ModuleBase_producer, "f").call(this);
@@ -15228,7 +15435,7 @@ function requireFdc3Common () {
15228
15435
  const wrappedHandler = (context, contextMetadata) => {
15229
15436
  if (first) {
15230
15437
  first = false;
15231
- if ((0, lodash_1.isEqual)(currentContext, context)) {
15438
+ if ((0, isEqual_1.default)(currentContext, context)) {
15232
15439
  return;
15233
15440
  }
15234
15441
  }
@@ -15841,11 +16048,14 @@ function requireInteropClient () {
15841
16048
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
15842
16049
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15843
16050
  };
16051
+ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
16052
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16053
+ };
15844
16054
  var _InteropClient_clientPromise, _InteropClient_sessionContextGroups;
15845
16055
  Object.defineProperty(InteropClient, "__esModule", { value: true });
15846
16056
  InteropClient.InteropClient = void 0;
15847
16057
  const base_1 = base;
15848
- const SessionContextGroupClient_1 = SessionContextGroupClient$1;
16058
+ const SessionContextGroupClient_1 = __importDefault(SessionContextGroupClient$1);
15849
16059
  const fdc3_1_2_1 = requireFdc31_2();
15850
16060
  const fdc3_2_0_1 = requireFdc32_0();
15851
16061
  const utils_1 = utils$3;
@@ -16485,9 +16695,12 @@ var hasRequiredFactory;
16485
16695
  function requireFactory () {
16486
16696
  if (hasRequiredFactory) return Factory$1;
16487
16697
  hasRequiredFactory = 1;
16698
+ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
16699
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16700
+ };
16488
16701
  Object.defineProperty(Factory$1, "__esModule", { value: true });
16489
16702
  Factory$1.InteropModule = void 0;
16490
- const lodash_1 = require$$3;
16703
+ const cloneDeep_1 = __importDefault(require$$0$1);
16491
16704
  const inaccessibleObject_1 = inaccessibleObject;
16492
16705
  const base_1 = base;
16493
16706
  const InteropBroker_1 = requireInteropBroker();
@@ -16524,7 +16737,7 @@ function requireFactory () {
16524
16737
  // Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
16525
16738
  const options = await this.wire.environment.getInteropInfo(this.wire.getFin());
16526
16739
  const objectThatThrows = (0, inaccessibleObject_1.createUnusableObject)(BrokerParamAccessError);
16527
- const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (0, lodash_1.cloneDeep)(options));
16740
+ const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (0, cloneDeep_1.default)(options));
16528
16741
  const getProvider = () => {
16529
16742
  return this.fin.InterApplicationBus.Channel.create(`interop-broker-${name}`);
16530
16743
  };
@@ -17081,13 +17294,16 @@ var __classPrivateFieldGet = (commonjsGlobal && commonjsGlobal.__classPrivateFie
17081
17294
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
17082
17295
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
17083
17296
  };
17297
+ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
17298
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17299
+ };
17084
17300
  var _Transport_wire, _Transport_fin;
17085
17301
  Object.defineProperty(transport, "__esModule", { value: true });
17086
17302
  var Transport_1 = transport.Transport = void 0;
17087
17303
  const events_1$1 = require$$0;
17088
17304
  const wire_1 = wire;
17089
17305
  const transport_errors_1 = transportErrors;
17090
- const eventAggregator_1 = eventAggregator;
17306
+ const eventAggregator_1 = __importDefault(eventAggregator);
17091
17307
  const me_1$1 = me;
17092
17308
  const errors_1 = errors;
17093
17309
  class Transport extends events_1$1.EventEmitter {
@@ -17281,7 +17497,10 @@ class Transport extends events_1$1.EventEmitter {
17281
17497
  }
17282
17498
  else {
17283
17499
  console.warn('Received invalid response from core', data);
17284
- handleNack({ reason: 'invalid response shape' });
17500
+ handleNack({
17501
+ reason: 'invalid response shape',
17502
+ error: (0, errors_1.errorToPOJO)(new Error('Invalid response shape'))
17503
+ });
17285
17504
  }
17286
17505
  }
17287
17506
  else if (!data.payload.success) {