@openfin/node-adapter 40.82.2 → 40.82.4
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 +197 -36
- 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);
|
|
@@ -2751,9 +2850,14 @@ function requireInstance$2 () {
|
|
|
2751
2850
|
// don't expose
|
|
2752
2851
|
});
|
|
2753
2852
|
const layoutWindow = await this.getCurrentWindow();
|
|
2853
|
+
let layoutWindowIdentity = layoutWindow.identity;
|
|
2854
|
+
// TODO: CORE-1857 - when we tearout active layout or drag a view out of a window, the above identity includes the whole window info.
|
|
2855
|
+
if (layoutWindowIdentity.identity) {
|
|
2856
|
+
layoutWindowIdentity = layoutWindowIdentity.identity;
|
|
2857
|
+
}
|
|
2754
2858
|
try {
|
|
2755
2859
|
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,
|
|
2860
|
+
const client = await layout_entities_1.LayoutNode.newLayoutEntitiesClient(providerChannelClient, layout_constants_1.LAYOUT_CONTROLLER_ID, layoutWindowIdentity);
|
|
2757
2861
|
const layoutIdentity = await client.getLayoutIdentityForViewOrThrow(this.identity);
|
|
2758
2862
|
return this.fin.Platform.Layout.wrap(layoutIdentity);
|
|
2759
2863
|
}
|
|
@@ -2766,7 +2870,7 @@ function requireInstance$2 () {
|
|
|
2766
2870
|
throw e;
|
|
2767
2871
|
}
|
|
2768
2872
|
// fallback logic for missing endpoint
|
|
2769
|
-
return this.fin.Platform.Layout.wrap(
|
|
2873
|
+
return this.fin.Platform.Layout.wrap(layoutWindowIdentity);
|
|
2770
2874
|
}
|
|
2771
2875
|
};
|
|
2772
2876
|
/**
|
|
@@ -5642,7 +5746,7 @@ function requireWindow () {
|
|
|
5642
5746
|
Object.defineProperty(system, "__esModule", { value: true });
|
|
5643
5747
|
system.System = void 0;
|
|
5644
5748
|
const base_1$i = base;
|
|
5645
|
-
const transport_errors_1$
|
|
5749
|
+
const transport_errors_1$6 = transportErrors;
|
|
5646
5750
|
const window_1 = requireWindow();
|
|
5647
5751
|
const events_1$6 = require$$0;
|
|
5648
5752
|
/**
|
|
@@ -6128,7 +6232,8 @@ class System extends base_1$i.EmitterBase {
|
|
|
6128
6232
|
return this.wire.sendAction('get-rvm-info').then(({ payload }) => payload.data);
|
|
6129
6233
|
}
|
|
6130
6234
|
/**
|
|
6131
|
-
* Retrieves system information.
|
|
6235
|
+
* Retrieves general system information. If you need more detailed information about the
|
|
6236
|
+
* OS and the currently logged in user, use `fin.System.getOSInfo()` instead.
|
|
6132
6237
|
*
|
|
6133
6238
|
* @example
|
|
6134
6239
|
* ```js
|
|
@@ -6138,6 +6243,17 @@ class System extends base_1$i.EmitterBase {
|
|
|
6138
6243
|
getHostSpecs() {
|
|
6139
6244
|
return this.wire.sendAction('get-host-specs').then(({ payload }) => payload.data);
|
|
6140
6245
|
}
|
|
6246
|
+
/**
|
|
6247
|
+
* Retrieves information about the OS and the currently logged in user.
|
|
6248
|
+
*
|
|
6249
|
+
* @example
|
|
6250
|
+
* ```js
|
|
6251
|
+
* fin.System.getOSInfo().then(specs => console.log(specs)).catch(err => console.log(err));
|
|
6252
|
+
* ```
|
|
6253
|
+
*/
|
|
6254
|
+
getOSInfo() {
|
|
6255
|
+
return this.wire.sendAction('get-os-info').then(({ payload }) => payload.data);
|
|
6256
|
+
}
|
|
6141
6257
|
/**
|
|
6142
6258
|
* Runs an executable or batch file. A path to the file must be included in options.
|
|
6143
6259
|
* <br> A uuid may be optionally provided. If not provided, OpenFin will create a uuid for the new process.
|
|
@@ -6720,9 +6836,9 @@ class System extends base_1$i.EmitterBase {
|
|
|
6720
6836
|
});
|
|
6721
6837
|
// node.js environment not supported
|
|
6722
6838
|
if (this.wire.environment.type !== 'openfin') {
|
|
6723
|
-
throw new transport_errors_1$
|
|
6839
|
+
throw new transport_errors_1$6.NotSupportedError('downloadAsset only supported in an OpenFin Render process');
|
|
6724
6840
|
}
|
|
6725
|
-
const callSite = transport_errors_1$
|
|
6841
|
+
const callSite = transport_errors_1$6.RuntimeError.getCallSite();
|
|
6726
6842
|
const downloadId = this.wire.environment.getNextMessageId().toString();
|
|
6727
6843
|
const dlProgressKey = `asset-download-progress-${downloadId}`;
|
|
6728
6844
|
const dlErrorKey = `asset-download-error-${downloadId}`;
|
|
@@ -6742,7 +6858,7 @@ class System extends base_1$i.EmitterBase {
|
|
|
6742
6858
|
const dlError = (payload) => {
|
|
6743
6859
|
cleanListeners();
|
|
6744
6860
|
const { reason, err: error } = payload;
|
|
6745
|
-
reject(new transport_errors_1$
|
|
6861
|
+
reject(new transport_errors_1$6.RuntimeError({ reason, error }, callSite));
|
|
6746
6862
|
};
|
|
6747
6863
|
const dlComplete = () => {
|
|
6748
6864
|
cleanListeners();
|
|
@@ -6793,11 +6909,11 @@ class System extends base_1$i.EmitterBase {
|
|
|
6793
6909
|
* ```
|
|
6794
6910
|
*/
|
|
6795
6911
|
downloadRuntime(options, progressListener) {
|
|
6796
|
-
const callsites = transport_errors_1$
|
|
6912
|
+
const callsites = transport_errors_1$6.RuntimeError.getCallSite();
|
|
6797
6913
|
return new Promise((resolve, reject) => {
|
|
6798
6914
|
// node.js environment not supported
|
|
6799
6915
|
if (this.wire.environment.type !== 'openfin') {
|
|
6800
|
-
reject(new transport_errors_1$
|
|
6916
|
+
reject(new transport_errors_1$6.NotSupportedError('downloadRuntime only supported in an OpenFin Render process'));
|
|
6801
6917
|
return;
|
|
6802
6918
|
}
|
|
6803
6919
|
const downloadId = this.wire.environment.getNextMessageId().toString();
|
|
@@ -6819,7 +6935,7 @@ class System extends base_1$i.EmitterBase {
|
|
|
6819
6935
|
const dlError = (payload) => {
|
|
6820
6936
|
cleanListeners();
|
|
6821
6937
|
const { reason, err: error } = payload;
|
|
6822
|
-
reject(new transport_errors_1$
|
|
6938
|
+
reject(new transport_errors_1$6.RuntimeError({ reason, error }, callsites));
|
|
6823
6939
|
};
|
|
6824
6940
|
const dlComplete = () => {
|
|
6825
6941
|
cleanListeners();
|
|
@@ -7554,6 +7670,7 @@ var channel = {};
|
|
|
7554
7670
|
|
|
7555
7671
|
Object.defineProperty(channel, "__esModule", { value: true });
|
|
7556
7672
|
channel.ChannelBase = channel.ProtectedItems = void 0;
|
|
7673
|
+
const transport_errors_1$5 = transportErrors;
|
|
7557
7674
|
const resultOrPayload = (func) => async (topic, payload, senderIdentity) => {
|
|
7558
7675
|
const res = await func(topic, payload, senderIdentity);
|
|
7559
7676
|
return res === undefined ? payload : res;
|
|
@@ -7586,6 +7703,7 @@ class ChannelBase {
|
|
|
7586
7703
|
return this.postAction ? await this.postAction(topic, actionProcessed, senderIdentity) : actionProcessed;
|
|
7587
7704
|
}
|
|
7588
7705
|
catch (e) {
|
|
7706
|
+
transport_errors_1$5.RuntimeError.trimEndCallSites(e, /Channel.*processAction/);
|
|
7589
7707
|
if (this.errorMiddleware) {
|
|
7590
7708
|
return this.errorMiddleware(topic, e, senderIdentity);
|
|
7591
7709
|
}
|
|
@@ -7887,6 +8005,25 @@ class ChannelBase {
|
|
|
7887
8005
|
}
|
|
7888
8006
|
channel.ChannelBase = ChannelBase;
|
|
7889
8007
|
|
|
8008
|
+
var channelError = {};
|
|
8009
|
+
|
|
8010
|
+
Object.defineProperty(channelError, "__esModule", { value: true });
|
|
8011
|
+
channelError.ChannelError = void 0;
|
|
8012
|
+
const transport_errors_1$4 = transportErrors;
|
|
8013
|
+
class ChannelError extends Error {
|
|
8014
|
+
constructor(originalError, action, dispatchPayload, callsites) {
|
|
8015
|
+
super(originalError.message);
|
|
8016
|
+
this.action = action;
|
|
8017
|
+
this.dispatchPayload = dispatchPayload;
|
|
8018
|
+
this.name = this.constructor.name;
|
|
8019
|
+
if ('cause' in originalError && originalError.cause instanceof Error) {
|
|
8020
|
+
this.cause = originalError.cause;
|
|
8021
|
+
}
|
|
8022
|
+
this.stack = transport_errors_1$4.RuntimeError.prepareStackTrace(this, callsites);
|
|
8023
|
+
}
|
|
8024
|
+
}
|
|
8025
|
+
channelError.ChannelError = ChannelError;
|
|
8026
|
+
|
|
7890
8027
|
var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7891
8028
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7892
8029
|
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");
|
|
@@ -7901,7 +8038,9 @@ var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
7901
8038
|
var _ChannelClient_protectedObj, _ChannelClient_strategy, _ChannelClient_close;
|
|
7902
8039
|
Object.defineProperty(client, "__esModule", { value: true });
|
|
7903
8040
|
client.ChannelClient = void 0;
|
|
8041
|
+
const transport_errors_1$3 = transportErrors;
|
|
7904
8042
|
const channel_1$1 = channel;
|
|
8043
|
+
const channel_error_1$1 = channelError;
|
|
7905
8044
|
const channelClientsByEndpointId = new Map();
|
|
7906
8045
|
/**
|
|
7907
8046
|
* Instance created to enable use of a channel as a client. Allows for communication with the
|
|
@@ -8003,7 +8142,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
8003
8142
|
*/
|
|
8004
8143
|
async dispatch(action, payload) {
|
|
8005
8144
|
if (__classPrivateFieldGet$c(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
|
|
8006
|
-
|
|
8145
|
+
const callSites = transport_errors_1$3.RuntimeError.getCallSite();
|
|
8146
|
+
return __classPrivateFieldGet$c(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
|
|
8147
|
+
throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
|
|
8148
|
+
});
|
|
8007
8149
|
}
|
|
8008
8150
|
throw new Error('The client you are trying to dispatch from is disconnected from the target provider.');
|
|
8009
8151
|
}
|
|
@@ -8118,7 +8260,7 @@ class ClassicStrategy {
|
|
|
8118
8260
|
_ClassicStrategy_endpointIdentityMap.set(this, new Map());
|
|
8119
8261
|
// Store a set of cancellable promises to be able to reject them when client
|
|
8120
8262
|
// connection problems occur
|
|
8121
|
-
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map);
|
|
8263
|
+
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
|
|
8122
8264
|
this.send = async (endpointId, action, payload) => {
|
|
8123
8265
|
const to = __classPrivateFieldGet$b(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
8124
8266
|
if (!to) {
|
|
@@ -8132,17 +8274,21 @@ class ClassicStrategy {
|
|
|
8132
8274
|
}
|
|
8133
8275
|
delete cleanId.isLocalEndpointId;
|
|
8134
8276
|
// grab the promise before awaiting it to save in our pending messages map
|
|
8135
|
-
const p = __classPrivateFieldGet$b(this, _ClassicStrategy_wire, "f")
|
|
8136
|
-
.sendAction('send-channel-message', {
|
|
8277
|
+
const p = __classPrivateFieldGet$b(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
|
|
8137
8278
|
...cleanId,
|
|
8138
8279
|
providerIdentity: this.providerIdentity,
|
|
8139
8280
|
action,
|
|
8140
8281
|
payload
|
|
8141
8282
|
});
|
|
8142
8283
|
__classPrivateFieldGet$b(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
|
|
8143
|
-
const raw = await p
|
|
8284
|
+
const raw = await p
|
|
8285
|
+
.catch((error) => {
|
|
8286
|
+
if ('cause' in error) {
|
|
8287
|
+
throw error;
|
|
8288
|
+
}
|
|
8144
8289
|
throw new Error(error.message);
|
|
8145
|
-
})
|
|
8290
|
+
})
|
|
8291
|
+
.finally(() => {
|
|
8146
8292
|
// clean up the pending promise
|
|
8147
8293
|
__classPrivateFieldGet$b(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
|
|
8148
8294
|
});
|
|
@@ -8196,13 +8342,17 @@ var errors = {};
|
|
|
8196
8342
|
Object.defineProperty(errors, "__esModule", { value: true });
|
|
8197
8343
|
errors.errorToPOJO = void 0;
|
|
8198
8344
|
function errorToPOJO(error) {
|
|
8199
|
-
|
|
8345
|
+
const errorObj = {
|
|
8200
8346
|
stack: error.stack,
|
|
8201
8347
|
name: error.name,
|
|
8202
8348
|
message: error.message,
|
|
8203
8349
|
// support the case where stack is empty or missing
|
|
8204
8350
|
toString: () => error.stack || error.toString()
|
|
8205
8351
|
};
|
|
8352
|
+
if ('cause' in error) {
|
|
8353
|
+
errorObj.cause = errorToPOJO(error.cause);
|
|
8354
|
+
}
|
|
8355
|
+
return errorObj;
|
|
8206
8356
|
}
|
|
8207
8357
|
errors.errorToPOJO = errorToPOJO;
|
|
8208
8358
|
|
|
@@ -8221,7 +8371,7 @@ var _RTCEndpoint_processAction, _RTCEndpoint_disconnectListener;
|
|
|
8221
8371
|
Object.defineProperty(endpoint, "__esModule", { value: true });
|
|
8222
8372
|
endpoint.RTCEndpoint = void 0;
|
|
8223
8373
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
8224
|
-
const errors_1$
|
|
8374
|
+
const errors_1$2 = errors;
|
|
8225
8375
|
/*
|
|
8226
8376
|
This handles sending RTC messages between RTC connections over the request and response data channels.
|
|
8227
8377
|
*/
|
|
@@ -8310,7 +8460,7 @@ class RTCEndpoint {
|
|
|
8310
8460
|
if (this.rtc.channels.response.readyState === 'open') {
|
|
8311
8461
|
this.rtc.channels.response.send(JSON.stringify({
|
|
8312
8462
|
messageId,
|
|
8313
|
-
error: (0, errors_1$
|
|
8463
|
+
error: (0, errors_1$2.errorToPOJO)(error),
|
|
8314
8464
|
success: false
|
|
8315
8465
|
}));
|
|
8316
8466
|
}
|
|
@@ -8626,8 +8776,10 @@ var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
8626
8776
|
var _ChannelProvider_connections, _ChannelProvider_protectedObj, _ChannelProvider_strategy, _ChannelProvider_removeEndpoint, _ChannelProvider_close;
|
|
8627
8777
|
Object.defineProperty(provider, "__esModule", { value: true });
|
|
8628
8778
|
provider.ChannelProvider = void 0;
|
|
8629
|
-
const
|
|
8779
|
+
const transport_errors_1$2 = transportErrors;
|
|
8630
8780
|
const runtimeVersioning_1 = runtimeVersioning;
|
|
8781
|
+
const channel_1 = channel;
|
|
8782
|
+
const channel_error_1 = channelError;
|
|
8631
8783
|
/**
|
|
8632
8784
|
* Instance created to enable use of a channel as a provider. Allows for communication with the {@link ChannelClient ChannelClients} by invoking an action on
|
|
8633
8785
|
* a single client via {@link ChannelProvider#dispatch dispatch} or all clients via {@link ChannelProvider#publish publish}
|
|
@@ -8744,7 +8896,10 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8744
8896
|
dispatch(to, action, payload) {
|
|
8745
8897
|
const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
|
|
8746
8898
|
if (endpointId && __classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
|
|
8747
|
-
|
|
8899
|
+
const callSites = transport_errors_1$2.RuntimeError.getCallSite();
|
|
8900
|
+
return __classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
|
|
8901
|
+
throw new channel_error_1.ChannelError(e, action, payload, callSites);
|
|
8902
|
+
});
|
|
8748
8903
|
}
|
|
8749
8904
|
return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
|
|
8750
8905
|
}
|
|
@@ -8957,6 +9112,7 @@ Object.defineProperty(messageReceiver$1, "__esModule", { value: true });
|
|
|
8957
9112
|
messageReceiver$1.MessageReceiver = void 0;
|
|
8958
9113
|
const client_1$1 = client;
|
|
8959
9114
|
const base_1$g = base;
|
|
9115
|
+
const errors_1$1 = errors;
|
|
8960
9116
|
/*
|
|
8961
9117
|
This is a singleton (per fin object) tasked with routing messages coming off the ipc to the correct endpoint.
|
|
8962
9118
|
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.
|
|
@@ -8985,6 +9141,7 @@ class MessageReceiver extends base_1$g.Base {
|
|
|
8985
9141
|
if (!handler) {
|
|
8986
9142
|
ackToSender.payload.success = false;
|
|
8987
9143
|
ackToSender.payload.reason = `Client connection with identity uuid: ${this.wire.me.uuid} / name: ${this.wire.me.name} / endpointId: ${key} no longer connected.`;
|
|
9144
|
+
ackToSender.payload.error = (0, errors_1$1.errorToPOJO)(new Error(ackToSender.payload.reason));
|
|
8988
9145
|
return this.wire.sendRaw(ackToSender);
|
|
8989
9146
|
}
|
|
8990
9147
|
try {
|
|
@@ -8996,6 +9153,7 @@ class MessageReceiver extends base_1$g.Base {
|
|
|
8996
9153
|
catch (e) {
|
|
8997
9154
|
ackToSender.payload.success = false;
|
|
8998
9155
|
ackToSender.payload.reason = e.message;
|
|
9156
|
+
ackToSender.payload.error = (0, errors_1$1.errorToPOJO)(e);
|
|
8999
9157
|
return this.wire.sendRaw(ackToSender);
|
|
9000
9158
|
}
|
|
9001
9159
|
}
|
|
@@ -17429,7 +17587,7 @@ class NodeEnvironment extends BaseEnvironment_1 {
|
|
|
17429
17587
|
};
|
|
17430
17588
|
}
|
|
17431
17589
|
getAdapterVersionSync() {
|
|
17432
|
-
return "40.82.
|
|
17590
|
+
return "40.82.4";
|
|
17433
17591
|
}
|
|
17434
17592
|
observeBounds(element, onChange) {
|
|
17435
17593
|
throw new Error('Method not implemented.');
|
|
@@ -17760,7 +17918,10 @@ class Transport extends events_1$1.EventEmitter {
|
|
|
17760
17918
|
}
|
|
17761
17919
|
else {
|
|
17762
17920
|
console.warn('Received invalid response from core', data);
|
|
17763
|
-
handleNack({
|
|
17921
|
+
handleNack({
|
|
17922
|
+
reason: 'invalid response shape',
|
|
17923
|
+
error: (0, errors_1.errorToPOJO)(new Error('Invalid response shape'))
|
|
17924
|
+
});
|
|
17764
17925
|
}
|
|
17765
17926
|
}
|
|
17766
17927
|
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.4",
|
|
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.4",
|
|
27
27
|
"lodash": "^4.17.21",
|
|
28
28
|
"ws": "^7.3.0"
|
|
29
29
|
}
|