@openfin/node-adapter 40.82.10 → 40.82.12
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.
- package/out/node-adapter.js +227 -41
- package/package.json +2 -2
package/out/node-adapter.js
CHANGED
|
@@ -355,19 +355,57 @@ var NotImplementedError_1 = transportErrors.NotImplementedError = NotImplemented
|
|
|
355
355
|
class NotSupportedError extends Error {
|
|
356
356
|
}
|
|
357
357
|
var NotSupportedError_1 = transportErrors.NotSupportedError = NotSupportedError;
|
|
358
|
-
class
|
|
358
|
+
class DeserializedError extends Error {
|
|
359
359
|
constructor(err) {
|
|
360
360
|
const { message, name, stack, ...rest } = err;
|
|
361
361
|
super(message);
|
|
362
|
+
if ('cause' in err && err.cause) {
|
|
363
|
+
this.cause = new DeserializedError(err.cause);
|
|
364
|
+
}
|
|
362
365
|
this.name = name || 'Error';
|
|
363
366
|
this.stack = stack ?? this.toString();
|
|
364
|
-
Object.keys(rest)
|
|
367
|
+
Object.keys(rest)
|
|
368
|
+
.filter((k) => k !== 'cause')
|
|
369
|
+
.forEach((key) => {
|
|
365
370
|
this[key] = rest[key];
|
|
366
371
|
});
|
|
367
372
|
}
|
|
368
373
|
}
|
|
369
374
|
// For documentation of the error methods being used see here: https://v8.dev/docs/stack-trace-api
|
|
370
375
|
class RuntimeError extends Error {
|
|
376
|
+
static trimEndCallSites(err, takeUntilRegex) {
|
|
377
|
+
// save original props
|
|
378
|
+
const length = Error.stackTraceLimit;
|
|
379
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
380
|
+
const _prepareStackTrace = Error.prepareStackTrace;
|
|
381
|
+
// This will be called when we access the `stack` property
|
|
382
|
+
Error.prepareStackTrace = (_, stack) => stack;
|
|
383
|
+
// in channel errors, the error was already serialized so we need to handle both string and CallSite[]
|
|
384
|
+
const isString = typeof err.stack === 'string';
|
|
385
|
+
const stack = (isString ? err.stack?.split('\n') : err.stack) ?? [];
|
|
386
|
+
// restore original props
|
|
387
|
+
Error.prepareStackTrace = _prepareStackTrace;
|
|
388
|
+
Error.stackTraceLimit = length;
|
|
389
|
+
// stack is optional in non chromium contexts
|
|
390
|
+
if (stack.length) {
|
|
391
|
+
const newStack = [];
|
|
392
|
+
// remove this call ONLY if it's not a string
|
|
393
|
+
for (const line of isString ? stack : stack.slice(1)) {
|
|
394
|
+
// inclusive take until
|
|
395
|
+
newStack.push(line);
|
|
396
|
+
if (takeUntilRegex.test(line.toString())) {
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
if (isString) {
|
|
401
|
+
// maintain it as a string
|
|
402
|
+
err.stack = newStack.join('\n');
|
|
403
|
+
}
|
|
404
|
+
else {
|
|
405
|
+
err.stack = RuntimeError.prepareStackTrace(err, newStack);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
371
409
|
static getCallSite(callsToRemove = 0) {
|
|
372
410
|
const length = Error.stackTraceLimit;
|
|
373
411
|
const realCallsToRemove = callsToRemove + 1; // remove this call;
|
|
@@ -386,21 +424,82 @@ class RuntimeError extends Error {
|
|
|
386
424
|
if (typeof Error.prepareStackTrace === 'function') {
|
|
387
425
|
return Error.prepareStackTrace(err, callSites);
|
|
388
426
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
427
|
+
// TODO: this is just a first iteration, we can make this "nicer" at some point
|
|
428
|
+
// const EXCLUSIONS = ['IpcRenderer', 'Object.onMessage', 'Transport.onmessage', 'MessageReceiver.onmessage'];
|
|
429
|
+
let stackTrace = `${err.name || 'Error'}: ${err.message || ''}\n`;
|
|
430
|
+
stackTrace += callSites
|
|
431
|
+
.map((line) => ` at ${line}`)
|
|
432
|
+
// .filter((line) => !EXCLUSIONS.some((l) => line.includes(l)))
|
|
433
|
+
.join('\n');
|
|
434
|
+
return stackTrace;
|
|
435
|
+
}
|
|
436
|
+
/*
|
|
437
|
+
|
|
438
|
+
NON filtered stack trace example from MTP page channel-errors.tsx:
|
|
439
|
+
|
|
440
|
+
Caused by: ChannelError: Error from ch0
|
|
441
|
+
at ChannelClient.dispatch (<anonymous>:3:119560)
|
|
442
|
+
at eval (test-channel-errors.tsx:73:26)
|
|
443
|
+
at ChannelProvider.processAction (<anonymous>:3:116748)
|
|
444
|
+
at ChannelProvider.processAction (<anonymous>:3:149121)
|
|
445
|
+
at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
|
|
446
|
+
at MessageReceiver.onmessage (<anonymous>:3:131232)
|
|
447
|
+
at Transport.onmessage (<anonymous>:3:282049)
|
|
448
|
+
at IpcRenderer.<anonymous> (<anonymous>:3:275150)
|
|
449
|
+
at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
|
|
450
|
+
at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
|
|
451
|
+
Caused by: ChannelError: Error from ch0
|
|
452
|
+
at ChannelClient.dispatch (<anonymous>:3:119560)
|
|
453
|
+
at eval (test-channel-errors.tsx:73:26)
|
|
454
|
+
at ChannelProvider.processAction (<anonymous>:3:116748)
|
|
455
|
+
at ChannelProvider.processAction (<anonymous>:3:149121)
|
|
456
|
+
at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
|
|
457
|
+
at MessageReceiver.onmessage (<anonymous>:3:131232)
|
|
458
|
+
at Transport.onmessage (<anonymous>:3:282049)
|
|
459
|
+
at IpcRenderer.<anonymous> (<anonymous>:3:275150)
|
|
460
|
+
at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
|
|
461
|
+
at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
|
|
462
|
+
Caused by: ChannelError: Error from ch0
|
|
463
|
+
at ChannelClient.dispatch (<anonymous>:3:119560)
|
|
464
|
+
at eval (test-channel-errors.tsx:73:26)
|
|
465
|
+
at ChannelProvider.processAction (<anonymous>:3:116748)
|
|
466
|
+
at ChannelProvider.processAction (<anonymous>:3:149121)
|
|
467
|
+
at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
|
|
468
|
+
at MessageReceiver.onmessage (<anonymous>:3:131232)
|
|
469
|
+
at Transport.onmessage (<anonymous>:3:282049)
|
|
470
|
+
at IpcRenderer.<anonymous> (<anonymous>:3:275150)
|
|
471
|
+
at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
|
|
472
|
+
at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
|
|
473
|
+
Caused by: ChannelError: Error from ch0
|
|
474
|
+
at ChannelClient.dispatch (<anonymous>:3:119560)
|
|
475
|
+
at eval (test-channel-errors.tsx:50:23)
|
|
476
|
+
at ChannelProvider.processAction (<anonymous>:3:116748)
|
|
477
|
+
at ChannelProvider.processAction (<anonymous>:3:149121)
|
|
478
|
+
at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
|
|
479
|
+
at MessageReceiver.onmessage (<anonymous>:3:131232)
|
|
480
|
+
at Transport.onmessage (<anonymous>:3:282049)
|
|
481
|
+
at IpcRenderer.<anonymous> (<anonymous>:3:275150)
|
|
482
|
+
at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
|
|
483
|
+
at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
|
|
484
|
+
Caused by: Error: Error from ch0
|
|
485
|
+
at eval (test-channel-errors.tsx:54:19)
|
|
486
|
+
at ChannelProvider.processAction (<anonymous>:3:116748)
|
|
487
|
+
at ChannelProvider.processAction (<anonymous>:3:149121)
|
|
488
|
+
at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
|
|
489
|
+
at MessageReceiver.onmessage (<anonymous>:3:131232)
|
|
490
|
+
at Transport.onmessage (<anonymous>:3:282049)
|
|
491
|
+
at IpcRenderer.<anonymous> (<anonymous>:3:275150)
|
|
492
|
+
at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
|
|
493
|
+
at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
*/
|
|
398
497
|
constructor(payload, callSites) {
|
|
399
498
|
const { reason, error } = payload;
|
|
400
499
|
super(reason);
|
|
401
|
-
this.name =
|
|
500
|
+
this.name = this.constructor.name;
|
|
402
501
|
if (error?.stack) {
|
|
403
|
-
this.cause = new
|
|
502
|
+
this.cause = new DeserializedError(error);
|
|
404
503
|
}
|
|
405
504
|
if (callSites) {
|
|
406
505
|
this.stack = RuntimeError.prepareStackTrace(this, callSites);
|
|
@@ -528,7 +627,9 @@ function requireFactory$3 () {
|
|
|
528
627
|
* @experimental
|
|
529
628
|
*/
|
|
530
629
|
async wrap(identity) {
|
|
531
|
-
this.wire.sendAction('view-wrap')
|
|
630
|
+
this.wire.sendAction('view-wrap').catch((e) => {
|
|
631
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
632
|
+
});
|
|
532
633
|
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
533
634
|
if (errorMsg) {
|
|
534
635
|
throw new Error(errorMsg);
|
|
@@ -2751,9 +2852,14 @@ function requireInstance$2 () {
|
|
|
2751
2852
|
// don't expose
|
|
2752
2853
|
});
|
|
2753
2854
|
const layoutWindow = await this.getCurrentWindow();
|
|
2855
|
+
let layoutWindowIdentity = layoutWindow.identity;
|
|
2856
|
+
// TODO: CORE-1857 - when we tearout active layout or drag a view out of a window, the above identity includes the whole window info.
|
|
2857
|
+
if (layoutWindowIdentity.identity) {
|
|
2858
|
+
layoutWindowIdentity = layoutWindowIdentity.identity;
|
|
2859
|
+
}
|
|
2754
2860
|
try {
|
|
2755
2861
|
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,
|
|
2862
|
+
const client = await layout_entities_1.LayoutNode.newLayoutEntitiesClient(providerChannelClient, layout_constants_1.LAYOUT_CONTROLLER_ID, layoutWindowIdentity);
|
|
2757
2863
|
const layoutIdentity = await client.getLayoutIdentityForViewOrThrow(this.identity);
|
|
2758
2864
|
return this.fin.Platform.Layout.wrap(layoutIdentity);
|
|
2759
2865
|
}
|
|
@@ -2766,7 +2872,7 @@ function requireInstance$2 () {
|
|
|
2766
2872
|
throw e;
|
|
2767
2873
|
}
|
|
2768
2874
|
// fallback logic for missing endpoint
|
|
2769
|
-
return this.fin.Platform.Layout.wrap(
|
|
2875
|
+
return this.fin.Platform.Layout.wrap(layoutWindowIdentity);
|
|
2770
2876
|
}
|
|
2771
2877
|
};
|
|
2772
2878
|
/**
|
|
@@ -5642,7 +5748,7 @@ function requireWindow () {
|
|
|
5642
5748
|
Object.defineProperty(system, "__esModule", { value: true });
|
|
5643
5749
|
system.System = void 0;
|
|
5644
5750
|
const base_1$i = base;
|
|
5645
|
-
const transport_errors_1$
|
|
5751
|
+
const transport_errors_1$6 = transportErrors;
|
|
5646
5752
|
const window_1 = requireWindow();
|
|
5647
5753
|
const events_1$6 = require$$0;
|
|
5648
5754
|
/**
|
|
@@ -6732,9 +6838,9 @@ class System extends base_1$i.EmitterBase {
|
|
|
6732
6838
|
});
|
|
6733
6839
|
// node.js environment not supported
|
|
6734
6840
|
if (this.wire.environment.type !== 'openfin') {
|
|
6735
|
-
throw new transport_errors_1$
|
|
6841
|
+
throw new transport_errors_1$6.NotSupportedError('downloadAsset only supported in an OpenFin Render process');
|
|
6736
6842
|
}
|
|
6737
|
-
const callSite = transport_errors_1$
|
|
6843
|
+
const callSite = transport_errors_1$6.RuntimeError.getCallSite();
|
|
6738
6844
|
const downloadId = this.wire.environment.getNextMessageId().toString();
|
|
6739
6845
|
const dlProgressKey = `asset-download-progress-${downloadId}`;
|
|
6740
6846
|
const dlErrorKey = `asset-download-error-${downloadId}`;
|
|
@@ -6754,7 +6860,7 @@ class System extends base_1$i.EmitterBase {
|
|
|
6754
6860
|
const dlError = (payload) => {
|
|
6755
6861
|
cleanListeners();
|
|
6756
6862
|
const { reason, err: error } = payload;
|
|
6757
|
-
reject(new transport_errors_1$
|
|
6863
|
+
reject(new transport_errors_1$6.RuntimeError({ reason, error }, callSite));
|
|
6758
6864
|
};
|
|
6759
6865
|
const dlComplete = () => {
|
|
6760
6866
|
cleanListeners();
|
|
@@ -6805,11 +6911,11 @@ class System extends base_1$i.EmitterBase {
|
|
|
6805
6911
|
* ```
|
|
6806
6912
|
*/
|
|
6807
6913
|
downloadRuntime(options, progressListener) {
|
|
6808
|
-
const callsites = transport_errors_1$
|
|
6914
|
+
const callsites = transport_errors_1$6.RuntimeError.getCallSite();
|
|
6809
6915
|
return new Promise((resolve, reject) => {
|
|
6810
6916
|
// node.js environment not supported
|
|
6811
6917
|
if (this.wire.environment.type !== 'openfin') {
|
|
6812
|
-
reject(new transport_errors_1$
|
|
6918
|
+
reject(new transport_errors_1$6.NotSupportedError('downloadRuntime only supported in an OpenFin Render process'));
|
|
6813
6919
|
return;
|
|
6814
6920
|
}
|
|
6815
6921
|
const downloadId = this.wire.environment.getNextMessageId().toString();
|
|
@@ -6831,7 +6937,7 @@ class System extends base_1$i.EmitterBase {
|
|
|
6831
6937
|
const dlError = (payload) => {
|
|
6832
6938
|
cleanListeners();
|
|
6833
6939
|
const { reason, err: error } = payload;
|
|
6834
|
-
reject(new transport_errors_1$
|
|
6940
|
+
reject(new transport_errors_1$6.RuntimeError({ reason, error }, callsites));
|
|
6835
6941
|
};
|
|
6836
6942
|
const dlComplete = () => {
|
|
6837
6943
|
cleanListeners();
|
|
@@ -7566,6 +7672,7 @@ var channel = {};
|
|
|
7566
7672
|
|
|
7567
7673
|
Object.defineProperty(channel, "__esModule", { value: true });
|
|
7568
7674
|
channel.ChannelBase = channel.ProtectedItems = void 0;
|
|
7675
|
+
const transport_errors_1$5 = transportErrors;
|
|
7569
7676
|
const resultOrPayload = (func) => async (topic, payload, senderIdentity) => {
|
|
7570
7677
|
const res = await func(topic, payload, senderIdentity);
|
|
7571
7678
|
return res === undefined ? payload : res;
|
|
@@ -7598,6 +7705,7 @@ class ChannelBase {
|
|
|
7598
7705
|
return this.postAction ? await this.postAction(topic, actionProcessed, senderIdentity) : actionProcessed;
|
|
7599
7706
|
}
|
|
7600
7707
|
catch (e) {
|
|
7708
|
+
transport_errors_1$5.RuntimeError.trimEndCallSites(e, /Channel.*processAction/);
|
|
7601
7709
|
if (this.errorMiddleware) {
|
|
7602
7710
|
return this.errorMiddleware(topic, e, senderIdentity);
|
|
7603
7711
|
}
|
|
@@ -7899,6 +8007,25 @@ class ChannelBase {
|
|
|
7899
8007
|
}
|
|
7900
8008
|
channel.ChannelBase = ChannelBase;
|
|
7901
8009
|
|
|
8010
|
+
var channelError = {};
|
|
8011
|
+
|
|
8012
|
+
Object.defineProperty(channelError, "__esModule", { value: true });
|
|
8013
|
+
channelError.ChannelError = void 0;
|
|
8014
|
+
const transport_errors_1$4 = transportErrors;
|
|
8015
|
+
class ChannelError extends Error {
|
|
8016
|
+
constructor(originalError, action, dispatchPayload, callsites) {
|
|
8017
|
+
super(originalError.message);
|
|
8018
|
+
this.action = action;
|
|
8019
|
+
this.dispatchPayload = dispatchPayload;
|
|
8020
|
+
this.name = this.constructor.name;
|
|
8021
|
+
if ('cause' in originalError && originalError.cause instanceof Error) {
|
|
8022
|
+
this.cause = originalError.cause;
|
|
8023
|
+
}
|
|
8024
|
+
this.stack = transport_errors_1$4.RuntimeError.prepareStackTrace(this, callsites);
|
|
8025
|
+
}
|
|
8026
|
+
}
|
|
8027
|
+
channelError.ChannelError = ChannelError;
|
|
8028
|
+
|
|
7902
8029
|
var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7903
8030
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7904
8031
|
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 +8040,9 @@ var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
7913
8040
|
var _ChannelClient_protectedObj, _ChannelClient_strategy, _ChannelClient_close;
|
|
7914
8041
|
Object.defineProperty(client, "__esModule", { value: true });
|
|
7915
8042
|
client.ChannelClient = void 0;
|
|
8043
|
+
const transport_errors_1$3 = transportErrors;
|
|
7916
8044
|
const channel_1$1 = channel;
|
|
8045
|
+
const channel_error_1$1 = channelError;
|
|
7917
8046
|
const channelClientsByEndpointId = new Map();
|
|
7918
8047
|
/**
|
|
7919
8048
|
* Instance created to enable use of a channel as a client. Allows for communication with the
|
|
@@ -8015,7 +8144,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
8015
8144
|
*/
|
|
8016
8145
|
async dispatch(action, payload) {
|
|
8017
8146
|
if (__classPrivateFieldGet$c(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
|
|
8018
|
-
|
|
8147
|
+
const callSites = transport_errors_1$3.RuntimeError.getCallSite();
|
|
8148
|
+
return __classPrivateFieldGet$c(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
|
|
8149
|
+
throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
|
|
8150
|
+
});
|
|
8019
8151
|
}
|
|
8020
8152
|
throw new Error('The client you are trying to dispatch from is disconnected from the target provider.');
|
|
8021
8153
|
}
|
|
@@ -8130,7 +8262,7 @@ class ClassicStrategy {
|
|
|
8130
8262
|
_ClassicStrategy_endpointIdentityMap.set(this, new Map());
|
|
8131
8263
|
// Store a set of cancellable promises to be able to reject them when client
|
|
8132
8264
|
// connection problems occur
|
|
8133
|
-
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map);
|
|
8265
|
+
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
|
|
8134
8266
|
this.send = async (endpointId, action, payload) => {
|
|
8135
8267
|
const to = __classPrivateFieldGet$b(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
8136
8268
|
if (!to) {
|
|
@@ -8144,17 +8276,21 @@ class ClassicStrategy {
|
|
|
8144
8276
|
}
|
|
8145
8277
|
delete cleanId.isLocalEndpointId;
|
|
8146
8278
|
// 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', {
|
|
8279
|
+
const p = __classPrivateFieldGet$b(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
|
|
8149
8280
|
...cleanId,
|
|
8150
8281
|
providerIdentity: this.providerIdentity,
|
|
8151
8282
|
action,
|
|
8152
8283
|
payload
|
|
8153
8284
|
});
|
|
8154
8285
|
__classPrivateFieldGet$b(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
|
|
8155
|
-
const raw = await p
|
|
8286
|
+
const raw = await p
|
|
8287
|
+
.catch((error) => {
|
|
8288
|
+
if ('cause' in error) {
|
|
8289
|
+
throw error;
|
|
8290
|
+
}
|
|
8156
8291
|
throw new Error(error.message);
|
|
8157
|
-
})
|
|
8292
|
+
})
|
|
8293
|
+
.finally(() => {
|
|
8158
8294
|
// clean up the pending promise
|
|
8159
8295
|
__classPrivateFieldGet$b(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
|
|
8160
8296
|
});
|
|
@@ -8208,13 +8344,17 @@ var errors = {};
|
|
|
8208
8344
|
Object.defineProperty(errors, "__esModule", { value: true });
|
|
8209
8345
|
errors.errorToPOJO = void 0;
|
|
8210
8346
|
function errorToPOJO(error) {
|
|
8211
|
-
|
|
8347
|
+
const errorObj = {
|
|
8212
8348
|
stack: error.stack,
|
|
8213
8349
|
name: error.name,
|
|
8214
8350
|
message: error.message,
|
|
8215
8351
|
// support the case where stack is empty or missing
|
|
8216
8352
|
toString: () => error.stack || error.toString()
|
|
8217
8353
|
};
|
|
8354
|
+
if ('cause' in error) {
|
|
8355
|
+
errorObj.cause = errorToPOJO(error.cause);
|
|
8356
|
+
}
|
|
8357
|
+
return errorObj;
|
|
8218
8358
|
}
|
|
8219
8359
|
errors.errorToPOJO = errorToPOJO;
|
|
8220
8360
|
|
|
@@ -8233,7 +8373,7 @@ var _RTCEndpoint_processAction, _RTCEndpoint_disconnectListener;
|
|
|
8233
8373
|
Object.defineProperty(endpoint, "__esModule", { value: true });
|
|
8234
8374
|
endpoint.RTCEndpoint = void 0;
|
|
8235
8375
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
8236
|
-
const errors_1$
|
|
8376
|
+
const errors_1$2 = errors;
|
|
8237
8377
|
/*
|
|
8238
8378
|
This handles sending RTC messages between RTC connections over the request and response data channels.
|
|
8239
8379
|
*/
|
|
@@ -8322,7 +8462,7 @@ class RTCEndpoint {
|
|
|
8322
8462
|
if (this.rtc.channels.response.readyState === 'open') {
|
|
8323
8463
|
this.rtc.channels.response.send(JSON.stringify({
|
|
8324
8464
|
messageId,
|
|
8325
|
-
error: (0, errors_1$
|
|
8465
|
+
error: (0, errors_1$2.errorToPOJO)(error),
|
|
8326
8466
|
success: false
|
|
8327
8467
|
}));
|
|
8328
8468
|
}
|
|
@@ -8638,8 +8778,10 @@ var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
8638
8778
|
var _ChannelProvider_connections, _ChannelProvider_protectedObj, _ChannelProvider_strategy, _ChannelProvider_removeEndpoint, _ChannelProvider_close;
|
|
8639
8779
|
Object.defineProperty(provider, "__esModule", { value: true });
|
|
8640
8780
|
provider.ChannelProvider = void 0;
|
|
8641
|
-
const
|
|
8781
|
+
const transport_errors_1$2 = transportErrors;
|
|
8642
8782
|
const runtimeVersioning_1 = runtimeVersioning;
|
|
8783
|
+
const channel_1 = channel;
|
|
8784
|
+
const channel_error_1 = channelError;
|
|
8643
8785
|
/**
|
|
8644
8786
|
* 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
8787
|
* a single client via {@link ChannelProvider#dispatch dispatch} or all clients via {@link ChannelProvider#publish publish}
|
|
@@ -8756,7 +8898,10 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8756
8898
|
dispatch(to, action, payload) {
|
|
8757
8899
|
const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
|
|
8758
8900
|
if (endpointId && __classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
|
|
8759
|
-
|
|
8901
|
+
const callSites = transport_errors_1$2.RuntimeError.getCallSite();
|
|
8902
|
+
return __classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
|
|
8903
|
+
throw new channel_error_1.ChannelError(e, action, payload, callSites);
|
|
8904
|
+
});
|
|
8760
8905
|
}
|
|
8761
8906
|
return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
|
|
8762
8907
|
}
|
|
@@ -8969,6 +9114,7 @@ Object.defineProperty(messageReceiver$1, "__esModule", { value: true });
|
|
|
8969
9114
|
messageReceiver$1.MessageReceiver = void 0;
|
|
8970
9115
|
const client_1$1 = client;
|
|
8971
9116
|
const base_1$g = base;
|
|
9117
|
+
const errors_1$1 = errors;
|
|
8972
9118
|
/*
|
|
8973
9119
|
This is a singleton (per fin object) tasked with routing messages coming off the ipc to the correct endpoint.
|
|
8974
9120
|
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 +9143,7 @@ class MessageReceiver extends base_1$g.Base {
|
|
|
8997
9143
|
if (!handler) {
|
|
8998
9144
|
ackToSender.payload.success = false;
|
|
8999
9145
|
ackToSender.payload.reason = `Client connection with identity uuid: ${this.wire.me.uuid} / name: ${this.wire.me.name} / endpointId: ${key} no longer connected.`;
|
|
9146
|
+
ackToSender.payload.error = (0, errors_1$1.errorToPOJO)(new Error(ackToSender.payload.reason));
|
|
9000
9147
|
return this.wire.sendRaw(ackToSender);
|
|
9001
9148
|
}
|
|
9002
9149
|
try {
|
|
@@ -9008,6 +9155,7 @@ class MessageReceiver extends base_1$g.Base {
|
|
|
9008
9155
|
catch (e) {
|
|
9009
9156
|
ackToSender.payload.success = false;
|
|
9010
9157
|
ackToSender.payload.reason = e.message;
|
|
9158
|
+
ackToSender.payload.error = (0, errors_1$1.errorToPOJO)(e);
|
|
9011
9159
|
return this.wire.sendRaw(ackToSender);
|
|
9012
9160
|
}
|
|
9013
9161
|
}
|
|
@@ -9152,6 +9300,9 @@ var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
9152
9300
|
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
9301
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
9154
9302
|
};
|
|
9303
|
+
var __importDefault$1 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
9304
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9305
|
+
};
|
|
9155
9306
|
var _ConnectionManager_messageReceiver, _ConnectionManager_rtcConnectionManager;
|
|
9156
9307
|
Object.defineProperty(connectionManager, "__esModule", { value: true });
|
|
9157
9308
|
connectionManager.ConnectionManager = void 0;
|
|
@@ -9163,7 +9314,7 @@ const ice_manager_1 = iceManager;
|
|
|
9163
9314
|
const provider_1$1 = provider;
|
|
9164
9315
|
const message_receiver_1 = messageReceiver$1;
|
|
9165
9316
|
const protocol_manager_1 = protocolManager;
|
|
9166
|
-
const strategy_3 = strategy;
|
|
9317
|
+
const strategy_3 = __importDefault$1(strategy);
|
|
9167
9318
|
class ConnectionManager extends base_1$f.Base {
|
|
9168
9319
|
static getProtocolOptionsFromStrings(protocols) {
|
|
9169
9320
|
return protocols.map((protocol) => {
|
|
@@ -13042,11 +13193,14 @@ function requireInteropBroker () {
|
|
|
13042
13193
|
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
13194
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
13044
13195
|
};
|
|
13196
|
+
var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
13197
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13198
|
+
};
|
|
13045
13199
|
var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
|
|
13046
13200
|
Object.defineProperty(InteropBroker, "__esModule", { value: true });
|
|
13047
13201
|
InteropBroker.InteropBroker = void 0;
|
|
13048
13202
|
const base_1 = base;
|
|
13049
|
-
const SessionContextGroupBroker_1 = requireSessionContextGroupBroker();
|
|
13203
|
+
const SessionContextGroupBroker_1 = __importDefault(requireSessionContextGroupBroker());
|
|
13050
13204
|
const utils_1 = utils$3;
|
|
13051
13205
|
const lodash_1 = require$$3;
|
|
13052
13206
|
const PrivateChannelProvider_1 = requirePrivateChannelProvider();
|
|
@@ -14423,9 +14577,32 @@ var utils$2 = {};
|
|
|
14423
14577
|
|
|
14424
14578
|
var PrivateChannelClient$1 = {};
|
|
14425
14579
|
|
|
14580
|
+
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14581
|
+
if (k2 === undefined) k2 = k;
|
|
14582
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14583
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14584
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14585
|
+
}
|
|
14586
|
+
Object.defineProperty(o, k2, desc);
|
|
14587
|
+
}) : (function(o, m, k, k2) {
|
|
14588
|
+
if (k2 === undefined) k2 = k;
|
|
14589
|
+
o[k2] = m[k];
|
|
14590
|
+
}));
|
|
14591
|
+
var __setModuleDefault = (commonjsGlobal && commonjsGlobal.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14592
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14593
|
+
}) : function(o, v) {
|
|
14594
|
+
o["default"] = v;
|
|
14595
|
+
});
|
|
14596
|
+
var __importStar = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) {
|
|
14597
|
+
if (mod && mod.__esModule) return mod;
|
|
14598
|
+
var result = {};
|
|
14599
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
14600
|
+
__setModuleDefault(result, mod);
|
|
14601
|
+
return result;
|
|
14602
|
+
};
|
|
14426
14603
|
Object.defineProperty(PrivateChannelClient$1, "__esModule", { value: true });
|
|
14427
14604
|
PrivateChannelClient$1.PrivateChannelClient = void 0;
|
|
14428
|
-
const utils$1 = utils$3;
|
|
14605
|
+
const utils$1 = __importStar(utils$3);
|
|
14429
14606
|
class PrivateChannelClient {
|
|
14430
14607
|
constructor(client, id) {
|
|
14431
14608
|
this.id = id;
|
|
@@ -15576,11 +15753,14 @@ function requireInteropClient () {
|
|
|
15576
15753
|
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
15754
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15578
15755
|
};
|
|
15756
|
+
var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
15757
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15758
|
+
};
|
|
15579
15759
|
var _InteropClient_clientPromise, _InteropClient_sessionContextGroups;
|
|
15580
15760
|
Object.defineProperty(InteropClient, "__esModule", { value: true });
|
|
15581
15761
|
InteropClient.InteropClient = void 0;
|
|
15582
15762
|
const base_1 = base;
|
|
15583
|
-
const SessionContextGroupClient_1 = SessionContextGroupClient$1;
|
|
15763
|
+
const SessionContextGroupClient_1 = __importDefault(SessionContextGroupClient$1);
|
|
15584
15764
|
const fdc3_1_2_1 = requireFdc31_2();
|
|
15585
15765
|
const fdc3_2_0_1 = requireFdc32_0();
|
|
15586
15766
|
const utils_1 = utils$3;
|
|
@@ -17441,7 +17621,7 @@ class NodeEnvironment extends BaseEnvironment_1 {
|
|
|
17441
17621
|
};
|
|
17442
17622
|
}
|
|
17443
17623
|
getAdapterVersionSync() {
|
|
17444
|
-
return "40.82.
|
|
17624
|
+
return "40.82.12";
|
|
17445
17625
|
}
|
|
17446
17626
|
observeBounds(element, onChange) {
|
|
17447
17627
|
throw new Error('Method not implemented.');
|
|
@@ -17572,13 +17752,16 @@ var __classPrivateFieldGet = (commonjsGlobal && commonjsGlobal.__classPrivateFie
|
|
|
17572
17752
|
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
17753
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
17574
17754
|
};
|
|
17755
|
+
var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
17756
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17757
|
+
};
|
|
17575
17758
|
var _Transport_wire, _Transport_fin;
|
|
17576
17759
|
Object.defineProperty(transport, "__esModule", { value: true });
|
|
17577
17760
|
var Transport_1 = transport.Transport = void 0;
|
|
17578
17761
|
const events_1$1 = require$$0;
|
|
17579
17762
|
const wire_1 = wire;
|
|
17580
17763
|
const transport_errors_1$1 = transportErrors;
|
|
17581
|
-
const eventAggregator_1 = eventAggregator;
|
|
17764
|
+
const eventAggregator_1 = __importDefault(eventAggregator);
|
|
17582
17765
|
const me_1 = me;
|
|
17583
17766
|
const errors_1 = errors;
|
|
17584
17767
|
class Transport extends events_1$1.EventEmitter {
|
|
@@ -17772,7 +17955,10 @@ class Transport extends events_1$1.EventEmitter {
|
|
|
17772
17955
|
}
|
|
17773
17956
|
else {
|
|
17774
17957
|
console.warn('Received invalid response from core', data);
|
|
17775
|
-
handleNack({
|
|
17958
|
+
handleNack({
|
|
17959
|
+
reason: 'invalid response shape',
|
|
17960
|
+
error: (0, errors_1.errorToPOJO)(new Error('Invalid response shape'))
|
|
17961
|
+
});
|
|
17776
17962
|
}
|
|
17777
17963
|
}
|
|
17778
17964
|
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.
|
|
3
|
+
"version": "40.82.12",
|
|
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.
|
|
26
|
+
"@openfin/core": "40.82.12",
|
|
27
27
|
"lodash": "^4.17.21",
|
|
28
28
|
"ws": "^7.3.0"
|
|
29
29
|
}
|