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