@openfin/node-adapter 40.82.11 → 40.82.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/out/node-adapter.js +246 -50
  2. package/package.json +2 -2
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var require$$0 = require('events');
4
- var require$$3 = require('lodash');
4
+ var require$$0$1 = require('lodash/cloneDeep');
5
+ var require$$3 = require('lodash/isEqual');
5
6
  var fs = require('fs');
6
7
  var crypto = require('crypto');
7
8
  var _WS = require('ws');
@@ -355,19 +356,57 @@ var NotImplementedError_1 = transportErrors.NotImplementedError = NotImplemented
355
356
  class NotSupportedError extends Error {
356
357
  }
357
358
  var NotSupportedError_1 = transportErrors.NotSupportedError = NotSupportedError;
358
- class InternalError extends Error {
359
+ class DeserializedError extends Error {
359
360
  constructor(err) {
360
361
  const { message, name, stack, ...rest } = err;
361
362
  super(message);
363
+ if ('cause' in err && err.cause) {
364
+ this.cause = new DeserializedError(err.cause);
365
+ }
362
366
  this.name = name || 'Error';
363
367
  this.stack = stack ?? this.toString();
364
- Object.keys(rest).forEach(key => {
368
+ Object.keys(rest)
369
+ .filter((k) => k !== 'cause')
370
+ .forEach((key) => {
365
371
  this[key] = rest[key];
366
372
  });
367
373
  }
368
374
  }
369
375
  // For documentation of the error methods being used see here: https://v8.dev/docs/stack-trace-api
370
376
  class RuntimeError extends Error {
377
+ static trimEndCallSites(err, takeUntilRegex) {
378
+ // save original props
379
+ const length = Error.stackTraceLimit;
380
+ // eslint-disable-next-line no-underscore-dangle
381
+ const _prepareStackTrace = Error.prepareStackTrace;
382
+ // This will be called when we access the `stack` property
383
+ Error.prepareStackTrace = (_, stack) => stack;
384
+ // in channel errors, the error was already serialized so we need to handle both string and CallSite[]
385
+ const isString = typeof err.stack === 'string';
386
+ const stack = (isString ? err.stack?.split('\n') : err.stack) ?? [];
387
+ // restore original props
388
+ Error.prepareStackTrace = _prepareStackTrace;
389
+ Error.stackTraceLimit = length;
390
+ // stack is optional in non chromium contexts
391
+ if (stack.length) {
392
+ const newStack = [];
393
+ // remove this call ONLY if it's not a string
394
+ for (const line of isString ? stack : stack.slice(1)) {
395
+ // inclusive take until
396
+ newStack.push(line);
397
+ if (takeUntilRegex.test(line.toString())) {
398
+ break;
399
+ }
400
+ }
401
+ if (isString) {
402
+ // maintain it as a string
403
+ err.stack = newStack.join('\n');
404
+ }
405
+ else {
406
+ err.stack = RuntimeError.prepareStackTrace(err, newStack);
407
+ }
408
+ }
409
+ }
371
410
  static getCallSite(callsToRemove = 0) {
372
411
  const length = Error.stackTraceLimit;
373
412
  const realCallsToRemove = callsToRemove + 1; // remove this call;
@@ -386,21 +425,82 @@ class RuntimeError extends Error {
386
425
  if (typeof Error.prepareStackTrace === 'function') {
387
426
  return Error.prepareStackTrace(err, callSites);
388
427
  }
389
- let string = "";
390
- string += err.name || "Error";
391
- string += `: ${err.message || ""}`;
392
- for (const callSite of callSites) {
393
- string += `\n at ${callSite.toString()}`;
394
- }
395
- return string;
396
- }
397
- ;
428
+ // TODO: this is just a first iteration, we can make this "nicer" at some point
429
+ // const EXCLUSIONS = ['IpcRenderer', 'Object.onMessage', 'Transport.onmessage', 'MessageReceiver.onmessage'];
430
+ let stackTrace = `${err.name || 'Error'}: ${err.message || ''}\n`;
431
+ stackTrace += callSites
432
+ .map((line) => ` at ${line}`)
433
+ // .filter((line) => !EXCLUSIONS.some((l) => line.includes(l)))
434
+ .join('\n');
435
+ return stackTrace;
436
+ }
437
+ /*
438
+
439
+ NON filtered stack trace example from MTP page channel-errors.tsx:
440
+
441
+ Caused by: ChannelError: Error from ch0
442
+ at ChannelClient.dispatch (<anonymous>:3:119560)
443
+ at eval (test-channel-errors.tsx:73:26)
444
+ at ChannelProvider.processAction (<anonymous>:3:116748)
445
+ at ChannelProvider.processAction (<anonymous>:3:149121)
446
+ at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
447
+ at MessageReceiver.onmessage (<anonymous>:3:131232)
448
+ at Transport.onmessage (<anonymous>:3:282049)
449
+ at IpcRenderer.<anonymous> (<anonymous>:3:275150)
450
+ at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
451
+ at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
452
+ Caused by: ChannelError: Error from ch0
453
+ at ChannelClient.dispatch (<anonymous>:3:119560)
454
+ at eval (test-channel-errors.tsx:73:26)
455
+ at ChannelProvider.processAction (<anonymous>:3:116748)
456
+ at ChannelProvider.processAction (<anonymous>:3:149121)
457
+ at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
458
+ at MessageReceiver.onmessage (<anonymous>:3:131232)
459
+ at Transport.onmessage (<anonymous>:3:282049)
460
+ at IpcRenderer.<anonymous> (<anonymous>:3:275150)
461
+ at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
462
+ at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
463
+ Caused by: ChannelError: Error from ch0
464
+ at ChannelClient.dispatch (<anonymous>:3:119560)
465
+ at eval (test-channel-errors.tsx:73:26)
466
+ at ChannelProvider.processAction (<anonymous>:3:116748)
467
+ at ChannelProvider.processAction (<anonymous>:3:149121)
468
+ at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
469
+ at MessageReceiver.onmessage (<anonymous>:3:131232)
470
+ at Transport.onmessage (<anonymous>:3:282049)
471
+ at IpcRenderer.<anonymous> (<anonymous>:3:275150)
472
+ at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
473
+ at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
474
+ Caused by: ChannelError: Error from ch0
475
+ at ChannelClient.dispatch (<anonymous>:3:119560)
476
+ at eval (test-channel-errors.tsx:50:23)
477
+ at ChannelProvider.processAction (<anonymous>:3:116748)
478
+ at ChannelProvider.processAction (<anonymous>:3:149121)
479
+ at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
480
+ at MessageReceiver.onmessage (<anonymous>:3:131232)
481
+ at Transport.onmessage (<anonymous>:3:282049)
482
+ at IpcRenderer.<anonymous> (<anonymous>:3:275150)
483
+ at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
484
+ at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
485
+ Caused by: Error: Error from ch0
486
+ at eval (test-channel-errors.tsx:54:19)
487
+ at ChannelProvider.processAction (<anonymous>:3:116748)
488
+ at ChannelProvider.processAction (<anonymous>:3:149121)
489
+ at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
490
+ at MessageReceiver.onmessage (<anonymous>:3:131232)
491
+ at Transport.onmessage (<anonymous>:3:282049)
492
+ at IpcRenderer.<anonymous> (<anonymous>:3:275150)
493
+ at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
494
+ at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
495
+
496
+
497
+ */
398
498
  constructor(payload, callSites) {
399
499
  const { reason, error } = payload;
400
500
  super(reason);
401
- this.name = 'RuntimeError';
501
+ this.name = this.constructor.name;
402
502
  if (error?.stack) {
403
- this.cause = new InternalError(error);
503
+ this.cause = new DeserializedError(error);
404
504
  }
405
505
  if (callSites) {
406
506
  this.stack = RuntimeError.prepareStackTrace(this, callSites);
@@ -528,7 +628,9 @@ function requireFactory$3 () {
528
628
  * @experimental
529
629
  */
530
630
  async wrap(identity) {
531
- this.wire.sendAction('view-wrap');
631
+ this.wire.sendAction('view-wrap').catch((e) => {
632
+ // we do not want to expose this error, just continue if this analytics-only call fails
633
+ });
532
634
  const errorMsg = (0, validate_1.validateIdentity)(identity);
533
635
  if (errorMsg) {
534
636
  throw new Error(errorMsg);
@@ -2751,9 +2853,14 @@ function requireInstance$2 () {
2751
2853
  // don't expose
2752
2854
  });
2753
2855
  const layoutWindow = await this.getCurrentWindow();
2856
+ let layoutWindowIdentity = layoutWindow.identity;
2857
+ // TODO: CORE-1857 - when we tearout active layout or drag a view out of a window, the above identity includes the whole window info.
2858
+ if (layoutWindowIdentity.identity) {
2859
+ layoutWindowIdentity = layoutWindowIdentity.identity;
2860
+ }
2754
2861
  try {
2755
2862
  const providerChannelClient = await __classPrivateFieldGet(this, _View_providerChannelClient, "f").getValue();
2756
- const client = await layout_entities_1.LayoutNode.newLayoutEntitiesClient(providerChannelClient, layout_constants_1.LAYOUT_CONTROLLER_ID, layoutWindow.identity);
2863
+ const client = await layout_entities_1.LayoutNode.newLayoutEntitiesClient(providerChannelClient, layout_constants_1.LAYOUT_CONTROLLER_ID, layoutWindowIdentity);
2757
2864
  const layoutIdentity = await client.getLayoutIdentityForViewOrThrow(this.identity);
2758
2865
  return this.fin.Platform.Layout.wrap(layoutIdentity);
2759
2866
  }
@@ -2766,7 +2873,7 @@ function requireInstance$2 () {
2766
2873
  throw e;
2767
2874
  }
2768
2875
  // fallback logic for missing endpoint
2769
- return this.fin.Platform.Layout.wrap(layoutWindow.identity);
2876
+ return this.fin.Platform.Layout.wrap(layoutWindowIdentity);
2770
2877
  }
2771
2878
  };
2772
2879
  /**
@@ -5642,7 +5749,7 @@ function requireWindow () {
5642
5749
  Object.defineProperty(system, "__esModule", { value: true });
5643
5750
  system.System = void 0;
5644
5751
  const base_1$i = base;
5645
- const transport_errors_1$2 = transportErrors;
5752
+ const transport_errors_1$6 = transportErrors;
5646
5753
  const window_1 = requireWindow();
5647
5754
  const events_1$6 = require$$0;
5648
5755
  /**
@@ -6732,9 +6839,9 @@ class System extends base_1$i.EmitterBase {
6732
6839
  });
6733
6840
  // node.js environment not supported
6734
6841
  if (this.wire.environment.type !== 'openfin') {
6735
- throw new transport_errors_1$2.NotSupportedError('downloadAsset only supported in an OpenFin Render process');
6842
+ throw new transport_errors_1$6.NotSupportedError('downloadAsset only supported in an OpenFin Render process');
6736
6843
  }
6737
- const callSite = transport_errors_1$2.RuntimeError.getCallSite();
6844
+ const callSite = transport_errors_1$6.RuntimeError.getCallSite();
6738
6845
  const downloadId = this.wire.environment.getNextMessageId().toString();
6739
6846
  const dlProgressKey = `asset-download-progress-${downloadId}`;
6740
6847
  const dlErrorKey = `asset-download-error-${downloadId}`;
@@ -6754,7 +6861,7 @@ class System extends base_1$i.EmitterBase {
6754
6861
  const dlError = (payload) => {
6755
6862
  cleanListeners();
6756
6863
  const { reason, err: error } = payload;
6757
- reject(new transport_errors_1$2.RuntimeError({ reason, error }, callSite));
6864
+ reject(new transport_errors_1$6.RuntimeError({ reason, error }, callSite));
6758
6865
  };
6759
6866
  const dlComplete = () => {
6760
6867
  cleanListeners();
@@ -6805,11 +6912,11 @@ class System extends base_1$i.EmitterBase {
6805
6912
  * ```
6806
6913
  */
6807
6914
  downloadRuntime(options, progressListener) {
6808
- const callsites = transport_errors_1$2.RuntimeError.getCallSite();
6915
+ const callsites = transport_errors_1$6.RuntimeError.getCallSite();
6809
6916
  return new Promise((resolve, reject) => {
6810
6917
  // node.js environment not supported
6811
6918
  if (this.wire.environment.type !== 'openfin') {
6812
- reject(new transport_errors_1$2.NotSupportedError('downloadRuntime only supported in an OpenFin Render process'));
6919
+ reject(new transport_errors_1$6.NotSupportedError('downloadRuntime only supported in an OpenFin Render process'));
6813
6920
  return;
6814
6921
  }
6815
6922
  const downloadId = this.wire.environment.getNextMessageId().toString();
@@ -6831,7 +6938,7 @@ class System extends base_1$i.EmitterBase {
6831
6938
  const dlError = (payload) => {
6832
6939
  cleanListeners();
6833
6940
  const { reason, err: error } = payload;
6834
- reject(new transport_errors_1$2.RuntimeError({ reason, error }, callsites));
6941
+ reject(new transport_errors_1$6.RuntimeError({ reason, error }, callsites));
6835
6942
  };
6836
6943
  const dlComplete = () => {
6837
6944
  cleanListeners();
@@ -7566,6 +7673,7 @@ var channel = {};
7566
7673
 
7567
7674
  Object.defineProperty(channel, "__esModule", { value: true });
7568
7675
  channel.ChannelBase = channel.ProtectedItems = void 0;
7676
+ const transport_errors_1$5 = transportErrors;
7569
7677
  const resultOrPayload = (func) => async (topic, payload, senderIdentity) => {
7570
7678
  const res = await func(topic, payload, senderIdentity);
7571
7679
  return res === undefined ? payload : res;
@@ -7598,6 +7706,7 @@ class ChannelBase {
7598
7706
  return this.postAction ? await this.postAction(topic, actionProcessed, senderIdentity) : actionProcessed;
7599
7707
  }
7600
7708
  catch (e) {
7709
+ transport_errors_1$5.RuntimeError.trimEndCallSites(e, /Channel.*processAction/);
7601
7710
  if (this.errorMiddleware) {
7602
7711
  return this.errorMiddleware(topic, e, senderIdentity);
7603
7712
  }
@@ -7899,6 +8008,25 @@ class ChannelBase {
7899
8008
  }
7900
8009
  channel.ChannelBase = ChannelBase;
7901
8010
 
8011
+ var channelError = {};
8012
+
8013
+ Object.defineProperty(channelError, "__esModule", { value: true });
8014
+ channelError.ChannelError = void 0;
8015
+ const transport_errors_1$4 = transportErrors;
8016
+ class ChannelError extends Error {
8017
+ constructor(originalError, action, dispatchPayload, callsites) {
8018
+ super(originalError.message);
8019
+ this.action = action;
8020
+ this.dispatchPayload = dispatchPayload;
8021
+ this.name = this.constructor.name;
8022
+ if ('cause' in originalError && originalError.cause instanceof Error) {
8023
+ this.cause = originalError.cause;
8024
+ }
8025
+ this.stack = transport_errors_1$4.RuntimeError.prepareStackTrace(this, callsites);
8026
+ }
8027
+ }
8028
+ channelError.ChannelError = ChannelError;
8029
+
7902
8030
  var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
7903
8031
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
7904
8032
  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");
@@ -7913,7 +8041,9 @@ var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateF
7913
8041
  var _ChannelClient_protectedObj, _ChannelClient_strategy, _ChannelClient_close;
7914
8042
  Object.defineProperty(client, "__esModule", { value: true });
7915
8043
  client.ChannelClient = void 0;
8044
+ const transport_errors_1$3 = transportErrors;
7916
8045
  const channel_1$1 = channel;
8046
+ const channel_error_1$1 = channelError;
7917
8047
  const channelClientsByEndpointId = new Map();
7918
8048
  /**
7919
8049
  * Instance created to enable use of a channel as a client. Allows for communication with the
@@ -8015,7 +8145,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
8015
8145
  */
8016
8146
  async dispatch(action, payload) {
8017
8147
  if (__classPrivateFieldGet$c(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
8018
- return __classPrivateFieldGet$c(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload);
8148
+ const callSites = transport_errors_1$3.RuntimeError.getCallSite();
8149
+ return __classPrivateFieldGet$c(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
8150
+ throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
8151
+ });
8019
8152
  }
8020
8153
  throw new Error('The client you are trying to dispatch from is disconnected from the target provider.');
8021
8154
  }
@@ -8130,7 +8263,7 @@ class ClassicStrategy {
8130
8263
  _ClassicStrategy_endpointIdentityMap.set(this, new Map());
8131
8264
  // Store a set of cancellable promises to be able to reject them when client
8132
8265
  // connection problems occur
8133
- _ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map);
8266
+ _ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
8134
8267
  this.send = async (endpointId, action, payload) => {
8135
8268
  const to = __classPrivateFieldGet$b(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
8136
8269
  if (!to) {
@@ -8144,17 +8277,21 @@ class ClassicStrategy {
8144
8277
  }
8145
8278
  delete cleanId.isLocalEndpointId;
8146
8279
  // grab the promise before awaiting it to save in our pending messages map
8147
- const p = __classPrivateFieldGet$b(this, _ClassicStrategy_wire, "f")
8148
- .sendAction('send-channel-message', {
8280
+ const p = __classPrivateFieldGet$b(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
8149
8281
  ...cleanId,
8150
8282
  providerIdentity: this.providerIdentity,
8151
8283
  action,
8152
8284
  payload
8153
8285
  });
8154
8286
  __classPrivateFieldGet$b(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
8155
- const raw = await p.catch((error) => {
8287
+ const raw = await p
8288
+ .catch((error) => {
8289
+ if ('cause' in error) {
8290
+ throw error;
8291
+ }
8156
8292
  throw new Error(error.message);
8157
- }).finally(() => {
8293
+ })
8294
+ .finally(() => {
8158
8295
  // clean up the pending promise
8159
8296
  __classPrivateFieldGet$b(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
8160
8297
  });
@@ -8208,13 +8345,17 @@ var errors = {};
8208
8345
  Object.defineProperty(errors, "__esModule", { value: true });
8209
8346
  errors.errorToPOJO = void 0;
8210
8347
  function errorToPOJO(error) {
8211
- return {
8348
+ const errorObj = {
8212
8349
  stack: error.stack,
8213
8350
  name: error.name,
8214
8351
  message: error.message,
8215
8352
  // support the case where stack is empty or missing
8216
8353
  toString: () => error.stack || error.toString()
8217
8354
  };
8355
+ if ('cause' in error) {
8356
+ errorObj.cause = errorToPOJO(error.cause);
8357
+ }
8358
+ return errorObj;
8218
8359
  }
8219
8360
  errors.errorToPOJO = errorToPOJO;
8220
8361
 
@@ -8233,7 +8374,7 @@ var _RTCEndpoint_processAction, _RTCEndpoint_disconnectListener;
8233
8374
  Object.defineProperty(endpoint, "__esModule", { value: true });
8234
8375
  endpoint.RTCEndpoint = void 0;
8235
8376
  /* eslint-disable @typescript-eslint/no-unused-vars */
8236
- const errors_1$1 = errors;
8377
+ const errors_1$2 = errors;
8237
8378
  /*
8238
8379
  This handles sending RTC messages between RTC connections over the request and response data channels.
8239
8380
  */
@@ -8322,7 +8463,7 @@ class RTCEndpoint {
8322
8463
  if (this.rtc.channels.response.readyState === 'open') {
8323
8464
  this.rtc.channels.response.send(JSON.stringify({
8324
8465
  messageId,
8325
- error: (0, errors_1$1.errorToPOJO)(error),
8466
+ error: (0, errors_1$2.errorToPOJO)(error),
8326
8467
  success: false
8327
8468
  }));
8328
8469
  }
@@ -8638,8 +8779,10 @@ var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateF
8638
8779
  var _ChannelProvider_connections, _ChannelProvider_protectedObj, _ChannelProvider_strategy, _ChannelProvider_removeEndpoint, _ChannelProvider_close;
8639
8780
  Object.defineProperty(provider, "__esModule", { value: true });
8640
8781
  provider.ChannelProvider = void 0;
8641
- const channel_1 = channel;
8782
+ const transport_errors_1$2 = transportErrors;
8642
8783
  const runtimeVersioning_1 = runtimeVersioning;
8784
+ const channel_1 = channel;
8785
+ const channel_error_1 = channelError;
8643
8786
  /**
8644
8787
  * Instance created to enable use of a channel as a provider. Allows for communication with the {@link ChannelClient ChannelClients} by invoking an action on
8645
8788
  * a single client via {@link ChannelProvider#dispatch dispatch} or all clients via {@link ChannelProvider#publish publish}
@@ -8756,7 +8899,10 @@ class ChannelProvider extends channel_1.ChannelBase {
8756
8899
  dispatch(to, action, payload) {
8757
8900
  const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
8758
8901
  if (endpointId && __classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
8759
- return __classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload);
8902
+ const callSites = transport_errors_1$2.RuntimeError.getCallSite();
8903
+ return __classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
8904
+ throw new channel_error_1.ChannelError(e, action, payload, callSites);
8905
+ });
8760
8906
  }
8761
8907
  return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
8762
8908
  }
@@ -8969,6 +9115,7 @@ Object.defineProperty(messageReceiver$1, "__esModule", { value: true });
8969
9115
  messageReceiver$1.MessageReceiver = void 0;
8970
9116
  const client_1$1 = client;
8971
9117
  const base_1$g = base;
9118
+ const errors_1$1 = errors;
8972
9119
  /*
8973
9120
  This is a singleton (per fin object) tasked with routing messages coming off the ipc to the correct endpoint.
8974
9121
  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.
@@ -8997,6 +9144,7 @@ class MessageReceiver extends base_1$g.Base {
8997
9144
  if (!handler) {
8998
9145
  ackToSender.payload.success = false;
8999
9146
  ackToSender.payload.reason = `Client connection with identity uuid: ${this.wire.me.uuid} / name: ${this.wire.me.name} / endpointId: ${key} no longer connected.`;
9147
+ ackToSender.payload.error = (0, errors_1$1.errorToPOJO)(new Error(ackToSender.payload.reason));
9000
9148
  return this.wire.sendRaw(ackToSender);
9001
9149
  }
9002
9150
  try {
@@ -9008,6 +9156,7 @@ class MessageReceiver extends base_1$g.Base {
9008
9156
  catch (e) {
9009
9157
  ackToSender.payload.success = false;
9010
9158
  ackToSender.payload.reason = e.message;
9159
+ ackToSender.payload.error = (0, errors_1$1.errorToPOJO)(e);
9011
9160
  return this.wire.sendRaw(ackToSender);
9012
9161
  }
9013
9162
  }
@@ -9152,6 +9301,9 @@ var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateF
9152
9301
  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");
9153
9302
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
9154
9303
  };
9304
+ var __importDefault$1 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
9305
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9306
+ };
9155
9307
  var _ConnectionManager_messageReceiver, _ConnectionManager_rtcConnectionManager;
9156
9308
  Object.defineProperty(connectionManager, "__esModule", { value: true });
9157
9309
  connectionManager.ConnectionManager = void 0;
@@ -9163,7 +9315,7 @@ const ice_manager_1 = iceManager;
9163
9315
  const provider_1$1 = provider;
9164
9316
  const message_receiver_1 = messageReceiver$1;
9165
9317
  const protocol_manager_1 = protocolManager;
9166
- const strategy_3 = strategy;
9318
+ const strategy_3 = __importDefault$1(strategy);
9167
9319
  class ConnectionManager extends base_1$f.Base {
9168
9320
  static getProtocolOptionsFromStrings(protocols) {
9169
9321
  return protocols.map((protocol) => {
@@ -13042,13 +13194,16 @@ function requireInteropBroker () {
13042
13194
  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");
13043
13195
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
13044
13196
  };
13197
+ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
13198
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13199
+ };
13045
13200
  var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
13046
13201
  Object.defineProperty(InteropBroker, "__esModule", { value: true });
13047
13202
  InteropBroker.InteropBroker = void 0;
13048
13203
  const base_1 = base;
13049
- const SessionContextGroupBroker_1 = requireSessionContextGroupBroker();
13204
+ const SessionContextGroupBroker_1 = __importDefault(requireSessionContextGroupBroker());
13050
13205
  const utils_1 = utils$3;
13051
- const lodash_1 = require$$3;
13206
+ const isEqual_1 = __importDefault(require$$3);
13052
13207
  const PrivateChannelProvider_1 = requirePrivateChannelProvider();
13053
13208
  const lazy_1 = lazy;
13054
13209
  const defaultContextGroups = [
@@ -13246,7 +13401,7 @@ function requireInteropBroker () {
13246
13401
  constructor(...unused) {
13247
13402
  if (unused.length) {
13248
13403
  const [_ignore1, ignore2, opts] = unused;
13249
- if (opts && typeof opts === 'object' && !(0, lodash_1.isEqual)(opts, args[2])) {
13404
+ if (opts && typeof opts === 'object' && !(0, isEqual_1.default)(opts, args[2])) {
13250
13405
  // eslint-disable-next-line no-console
13251
13406
  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.');
13252
13407
  super(args[0], args[1], opts);
@@ -14423,9 +14578,32 @@ var utils$2 = {};
14423
14578
 
14424
14579
  var PrivateChannelClient$1 = {};
14425
14580
 
14581
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14582
+ if (k2 === undefined) k2 = k;
14583
+ var desc = Object.getOwnPropertyDescriptor(m, k);
14584
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14585
+ desc = { enumerable: true, get: function() { return m[k]; } };
14586
+ }
14587
+ Object.defineProperty(o, k2, desc);
14588
+ }) : (function(o, m, k, k2) {
14589
+ if (k2 === undefined) k2 = k;
14590
+ o[k2] = m[k];
14591
+ }));
14592
+ var __setModuleDefault = (commonjsGlobal && commonjsGlobal.__setModuleDefault) || (Object.create ? (function(o, v) {
14593
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
14594
+ }) : function(o, v) {
14595
+ o["default"] = v;
14596
+ });
14597
+ var __importStar = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) {
14598
+ if (mod && mod.__esModule) return mod;
14599
+ var result = {};
14600
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
14601
+ __setModuleDefault(result, mod);
14602
+ return result;
14603
+ };
14426
14604
  Object.defineProperty(PrivateChannelClient$1, "__esModule", { value: true });
14427
14605
  PrivateChannelClient$1.PrivateChannelClient = void 0;
14428
- const utils$1 = utils$3;
14606
+ const utils$1 = __importStar(utils$3);
14429
14607
  class PrivateChannelClient {
14430
14608
  constructor(client, id) {
14431
14609
  this.id = id;
@@ -14514,11 +14692,14 @@ class PrivateChannelClient {
14514
14692
  PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
14515
14693
 
14516
14694
  (function (exports) {
14695
+ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
14696
+ return (mod && mod.__esModule) ? mod : { "default": mod };
14697
+ };
14517
14698
  Object.defineProperty(exports, "__esModule", { value: true });
14518
14699
  exports.getIntentResolution = exports.isChannel = exports.isContext = exports.connectPrivateChannel = exports.buildAppChannelObject = exports.buildPrivateChannelObject = exports.ChannelError = exports.ResultError = exports.UnsupportedChannelApiError = exports.getUnsupportedChannelApis = void 0;
14519
14700
  const utils_1 = utils$3;
14520
14701
  const PrivateChannelClient_1 = PrivateChannelClient$1;
14521
- const lodash_1 = require$$3;
14702
+ const isEqual_1 = __importDefault(require$$3);
14522
14703
  const getUnsupportedChannelApis = (channelType) => {
14523
14704
  return {
14524
14705
  addContextListener: () => {
@@ -14646,7 +14827,7 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
14646
14827
  const wrappedHandler = (context, contextMetadata) => {
14647
14828
  if (first) {
14648
14829
  first = false;
14649
- if ((0, lodash_1.isEqual)(currentContext, context)) {
14830
+ if ((0, isEqual_1.default)(currentContext, context)) {
14650
14831
  return;
14651
14832
  }
14652
14833
  }
@@ -14768,13 +14949,16 @@ function requireFdc3Common () {
14768
14949
  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");
14769
14950
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
14770
14951
  };
14952
+ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
14953
+ return (mod && mod.__esModule) ? mod : { "default": mod };
14954
+ };
14771
14955
  var _FDC3ModuleBase_producer;
14772
14956
  Object.defineProperty(fdc3Common, "__esModule", { value: true });
14773
14957
  fdc3Common.FDC3ModuleBase = void 0;
14774
14958
  const utils_1 = utils$2;
14775
14959
  const utils_2 = utils$3;
14776
14960
  const InteropClient_1 = requireInteropClient();
14777
- const lodash_1 = require$$3;
14961
+ const isEqual_1 = __importDefault(require$$3);
14778
14962
  class FDC3ModuleBase {
14779
14963
  get client() {
14780
14964
  return __classPrivateFieldGet(this, _FDC3ModuleBase_producer, "f").call(this);
@@ -14963,7 +15147,7 @@ function requireFdc3Common () {
14963
15147
  const wrappedHandler = (context, contextMetadata) => {
14964
15148
  if (first) {
14965
15149
  first = false;
14966
- if ((0, lodash_1.isEqual)(currentContext, context)) {
15150
+ if ((0, isEqual_1.default)(currentContext, context)) {
14967
15151
  return;
14968
15152
  }
14969
15153
  }
@@ -15576,11 +15760,14 @@ function requireInteropClient () {
15576
15760
  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");
15577
15761
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15578
15762
  };
15763
+ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
15764
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15765
+ };
15579
15766
  var _InteropClient_clientPromise, _InteropClient_sessionContextGroups;
15580
15767
  Object.defineProperty(InteropClient, "__esModule", { value: true });
15581
15768
  InteropClient.InteropClient = void 0;
15582
15769
  const base_1 = base;
15583
- const SessionContextGroupClient_1 = SessionContextGroupClient$1;
15770
+ const SessionContextGroupClient_1 = __importDefault(SessionContextGroupClient$1);
15584
15771
  const fdc3_1_2_1 = requireFdc31_2();
15585
15772
  const fdc3_2_0_1 = requireFdc32_0();
15586
15773
  const utils_1 = utils$3;
@@ -16220,9 +16407,12 @@ var hasRequiredFactory;
16220
16407
  function requireFactory () {
16221
16408
  if (hasRequiredFactory) return Factory$1;
16222
16409
  hasRequiredFactory = 1;
16410
+ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
16411
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16412
+ };
16223
16413
  Object.defineProperty(Factory$1, "__esModule", { value: true });
16224
16414
  Factory$1.InteropModule = void 0;
16225
- const lodash_1 = require$$3;
16415
+ const cloneDeep_1 = __importDefault(require$$0$1);
16226
16416
  const inaccessibleObject_1 = inaccessibleObject;
16227
16417
  const base_1 = base;
16228
16418
  const InteropBroker_1 = requireInteropBroker();
@@ -16259,7 +16449,7 @@ function requireFactory () {
16259
16449
  // Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
16260
16450
  const options = await this.wire.environment.getInteropInfo(this.wire.getFin());
16261
16451
  const objectThatThrows = (0, inaccessibleObject_1.createUnusableObject)(BrokerParamAccessError);
16262
- const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (0, lodash_1.cloneDeep)(options));
16452
+ const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (0, cloneDeep_1.default)(options));
16263
16453
  const getProvider = () => {
16264
16454
  return this.fin.InterApplicationBus.Channel.create(`interop-broker-${name}`);
16265
16455
  };
@@ -17441,7 +17631,7 @@ class NodeEnvironment extends BaseEnvironment_1 {
17441
17631
  };
17442
17632
  }
17443
17633
  getAdapterVersionSync() {
17444
- return "40.82.11";
17634
+ return "40.82.13";
17445
17635
  }
17446
17636
  observeBounds(element, onChange) {
17447
17637
  throw new Error('Method not implemented.');
@@ -17572,13 +17762,16 @@ var __classPrivateFieldGet = (commonjsGlobal && commonjsGlobal.__classPrivateFie
17572
17762
  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");
17573
17763
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
17574
17764
  };
17765
+ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
17766
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17767
+ };
17575
17768
  var _Transport_wire, _Transport_fin;
17576
17769
  Object.defineProperty(transport, "__esModule", { value: true });
17577
17770
  var Transport_1 = transport.Transport = void 0;
17578
17771
  const events_1$1 = require$$0;
17579
17772
  const wire_1 = wire;
17580
17773
  const transport_errors_1$1 = transportErrors;
17581
- const eventAggregator_1 = eventAggregator;
17774
+ const eventAggregator_1 = __importDefault(eventAggregator);
17582
17775
  const me_1 = me;
17583
17776
  const errors_1 = errors;
17584
17777
  class Transport extends events_1$1.EventEmitter {
@@ -17772,7 +17965,10 @@ class Transport extends events_1$1.EventEmitter {
17772
17965
  }
17773
17966
  else {
17774
17967
  console.warn('Received invalid response from core', data);
17775
- handleNack({ reason: 'invalid response shape' });
17968
+ handleNack({
17969
+ reason: 'invalid response shape',
17970
+ error: (0, errors_1.errorToPOJO)(new Error('Invalid response shape'))
17971
+ });
17776
17972
  }
17777
17973
  }
17778
17974
  else if (!data.payload.success) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/node-adapter",
3
- "version": "40.82.11",
3
+ "version": "40.82.13",
4
4
  "description": "See README.md",
5
5
  "main": "out/node-adapter.js",
6
6
  "types": "out/node-adapter.d.ts",
@@ -23,7 +23,7 @@
23
23
  "author": "OpenFin",
24
24
  "dependencies": {
25
25
  "@types/node": "^20.14.2",
26
- "@openfin/core": "40.82.11",
26
+ "@openfin/core": "40.82.13",
27
27
  "lodash": "^4.17.21",
28
28
  "ws": "^7.3.0"
29
29
  }