@openfin/remote-adapter 46.100.64 → 46.100.66
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/remote-adapter.js +190 -99
- package/package.json +2 -2
package/out/remote-adapter.js
CHANGED
|
@@ -758,6 +758,45 @@ class AsyncRetryableLazy {
|
|
|
758
758
|
}
|
|
759
759
|
}
|
|
760
760
|
|
|
761
|
+
/**
|
|
762
|
+
* The default FDC3 user channels advertised by the Interop Broker.
|
|
763
|
+
*/
|
|
764
|
+
const defaultColorChannels = {
|
|
765
|
+
'fdc3.channel.1': { name: 'Channel 1', color: 'red', glyph: '1' },
|
|
766
|
+
'fdc3.channel.2': { name: 'Channel 2', color: 'orange', glyph: '2' },
|
|
767
|
+
'fdc3.channel.3': { name: 'Channel 3', color: 'yellow', glyph: '3' },
|
|
768
|
+
'fdc3.channel.4': { name: 'Channel 4', color: 'green', glyph: '4' },
|
|
769
|
+
'fdc3.channel.5': { name: 'Channel 5', color: 'cyan', glyph: '5' },
|
|
770
|
+
'fdc3.channel.6': { name: 'Channel 6', color: 'blue', glyph: '6' },
|
|
771
|
+
'fdc3.channel.7': { name: 'Channel 7', color: 'magenta', glyph: '7' },
|
|
772
|
+
'fdc3.channel.8': { name: 'Channel 8', color: 'purple', glyph: '8' }
|
|
773
|
+
};
|
|
774
|
+
const legacyColorChannelIds = {
|
|
775
|
+
red: 'fdc3.channel.1',
|
|
776
|
+
orange: 'fdc3.channel.2',
|
|
777
|
+
yellow: 'fdc3.channel.3',
|
|
778
|
+
green: 'fdc3.channel.4',
|
|
779
|
+
teal: 'fdc3.channel.5',
|
|
780
|
+
blue: 'fdc3.channel.6',
|
|
781
|
+
pink: 'fdc3.channel.7',
|
|
782
|
+
// Legacy indigo (workspace) and purple (core) intentionally converge on the same FDC3 purple channel.
|
|
783
|
+
indigo: 'fdc3.channel.8',
|
|
784
|
+
purple: 'fdc3.channel.8'
|
|
785
|
+
};
|
|
786
|
+
/**
|
|
787
|
+
* Converts a legacy color-named channel ID to its canonical FDC3 user-channel ID.
|
|
788
|
+
* The removed legacy gray channel resolves to no channel.
|
|
789
|
+
*/
|
|
790
|
+
function normalizeColorChannelId(colorChannelId) {
|
|
791
|
+
if (colorChannelId === 'gray') {
|
|
792
|
+
return undefined;
|
|
793
|
+
}
|
|
794
|
+
if (Object.prototype.hasOwnProperty.call(legacyColorChannelIds, colorChannelId)) {
|
|
795
|
+
return legacyColorChannelIds[colorChannelId];
|
|
796
|
+
}
|
|
797
|
+
return colorChannelId;
|
|
798
|
+
}
|
|
799
|
+
|
|
761
800
|
var __classPrivateFieldSet$k = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
762
801
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
763
802
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
@@ -770,50 +809,7 @@ var __classPrivateFieldGet$l = (undefined && undefined.__classPrivateFieldGet) |
|
|
|
770
809
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
771
810
|
};
|
|
772
811
|
var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
|
|
773
|
-
const defaultContextGroups = [
|
|
774
|
-
{
|
|
775
|
-
id: 'green',
|
|
776
|
-
displayMetadata: {
|
|
777
|
-
color: '#00CC88',
|
|
778
|
-
name: 'green'
|
|
779
|
-
}
|
|
780
|
-
},
|
|
781
|
-
{
|
|
782
|
-
id: 'purple',
|
|
783
|
-
displayMetadata: {
|
|
784
|
-
color: '#8C61FF',
|
|
785
|
-
name: 'purple'
|
|
786
|
-
}
|
|
787
|
-
},
|
|
788
|
-
{
|
|
789
|
-
id: 'orange',
|
|
790
|
-
displayMetadata: {
|
|
791
|
-
color: '#FF8C4C',
|
|
792
|
-
name: 'orange'
|
|
793
|
-
}
|
|
794
|
-
},
|
|
795
|
-
{
|
|
796
|
-
id: 'red',
|
|
797
|
-
displayMetadata: {
|
|
798
|
-
color: '#FF5E60',
|
|
799
|
-
name: 'red'
|
|
800
|
-
}
|
|
801
|
-
},
|
|
802
|
-
{
|
|
803
|
-
id: 'pink',
|
|
804
|
-
displayMetadata: {
|
|
805
|
-
color: '#FF8FB8',
|
|
806
|
-
name: 'pink'
|
|
807
|
-
}
|
|
808
|
-
},
|
|
809
|
-
{
|
|
810
|
-
id: 'yellow',
|
|
811
|
-
displayMetadata: {
|
|
812
|
-
color: '#E9FF8F',
|
|
813
|
-
name: 'yellow'
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
];
|
|
812
|
+
const defaultContextGroups = Object.entries(defaultColorChannels).map(([id, displayMetadata]) => ({ id, displayMetadata }));
|
|
817
813
|
/**
|
|
818
814
|
* {@link https://developers.openfin.co/of-docs/docs/enable-color-linking}
|
|
819
815
|
*
|
|
@@ -843,17 +839,19 @@ const defaultContextGroups = [
|
|
|
843
839
|
* "interopBrokerConfiguration": {
|
|
844
840
|
* "contextGroups": [
|
|
845
841
|
* {
|
|
846
|
-
* "id": "
|
|
842
|
+
* "id": "fdc3.channel.4",
|
|
847
843
|
* "displayMetadata": {
|
|
848
|
-
* "color": "
|
|
849
|
-
* "name": "
|
|
844
|
+
* "color": "green",
|
|
845
|
+
* "name": "Channel 4",
|
|
846
|
+
* "glyph": "4"
|
|
850
847
|
* }
|
|
851
848
|
* },
|
|
852
849
|
* {
|
|
853
|
-
* "id": "
|
|
850
|
+
* "id": "fdc3.channel.8",
|
|
854
851
|
* "displayMetadata": {
|
|
855
|
-
* "color": "
|
|
856
|
-
* "name": "
|
|
852
|
+
* "color": "purple",
|
|
853
|
+
* "name": "Channel 8",
|
|
854
|
+
* "glyph": "8"
|
|
857
855
|
* }
|
|
858
856
|
* },
|
|
859
857
|
* ]
|
|
@@ -1016,9 +1014,13 @@ class InteropBroker extends Base {
|
|
|
1016
1014
|
this.wire.sendAction('interop-broker-set-context-for-group').catch((e) => {
|
|
1017
1015
|
// don't expose, analytics-only call
|
|
1018
1016
|
});
|
|
1019
|
-
const
|
|
1017
|
+
const normalizedContextGroupId = this.normalizeContextGroupId(contextGroupId);
|
|
1018
|
+
if (normalizedContextGroupId === undefined) {
|
|
1019
|
+
return;
|
|
1020
|
+
}
|
|
1021
|
+
const contextGroupState = this.contextGroupsById.get(normalizedContextGroupId);
|
|
1020
1022
|
if (!contextGroupState) {
|
|
1021
|
-
throw new Error(`Unable to set context for context group that isn't in the context group mapping: ${
|
|
1023
|
+
throw new Error(`Unable to set context for context group that isn't in the context group mapping: ${normalizedContextGroupId}.`);
|
|
1022
1024
|
}
|
|
1023
1025
|
const contextIntegrityCheckResult = InteropBroker.checkContextIntegrity(context);
|
|
1024
1026
|
if (contextIntegrityCheckResult.isValid === false) {
|
|
@@ -1026,8 +1028,8 @@ class InteropBroker extends Base {
|
|
|
1026
1028
|
}
|
|
1027
1029
|
const broadcastedContextType = context.type;
|
|
1028
1030
|
contextGroupState.set(broadcastedContextType, context);
|
|
1029
|
-
this.lastContextMap.set(
|
|
1030
|
-
const clientsInSameContextGroup = Array.from(this.interopClients.values()).filter((connectedClient) => connectedClient.contextGroupId ===
|
|
1031
|
+
this.lastContextMap.set(normalizedContextGroupId, broadcastedContextType);
|
|
1032
|
+
const clientsInSameContextGroup = Array.from(this.interopClients.values()).filter((connectedClient) => connectedClient.contextGroupId === normalizedContextGroupId);
|
|
1031
1033
|
clientsInSameContextGroup.forEach((client) => {
|
|
1032
1034
|
for (const [, handlerInfo] of client.contextHandlers) {
|
|
1033
1035
|
if (InteropBroker.isContextTypeCompatible(broadcastedContextType, handlerInfo.contextType)) {
|
|
@@ -1073,10 +1075,20 @@ class InteropBroker extends Base {
|
|
|
1073
1075
|
* @param joinContextGroupOptions - Id of the Context Group and identity of the entity to join to the group.
|
|
1074
1076
|
* @param senderIdentity - Identity of the client sender.
|
|
1075
1077
|
*/
|
|
1076
|
-
async joinContextGroup({ contextGroupId, target }, senderIdentity) {
|
|
1078
|
+
async joinContextGroup({ contextGroupId: requestedContextGroupId, target }, senderIdentity) {
|
|
1077
1079
|
this.wire.sendAction('interop-broker-join-context-group').catch((e) => {
|
|
1078
1080
|
// don't expose, analytics-only call
|
|
1079
1081
|
});
|
|
1082
|
+
const contextGroupId = this.normalizeContextGroupId(requestedContextGroupId);
|
|
1083
|
+
if (contextGroupId === undefined) {
|
|
1084
|
+
if (target) {
|
|
1085
|
+
await this.removeFromContextGroup({ target }, senderIdentity);
|
|
1086
|
+
}
|
|
1087
|
+
else {
|
|
1088
|
+
await this.removeClientFromContextGroup(senderIdentity);
|
|
1089
|
+
}
|
|
1090
|
+
return;
|
|
1091
|
+
}
|
|
1080
1092
|
if (this.sessionContextGroupMap.has(contextGroupId)) {
|
|
1081
1093
|
throw new Error(BROKER_ERRORS.joinSessionContextGroupWithJoinContextGroup);
|
|
1082
1094
|
}
|
|
@@ -1118,10 +1130,15 @@ class InteropBroker extends Base {
|
|
|
1118
1130
|
* @param addClientToContextGroupOptions - Contains the contextGroupId
|
|
1119
1131
|
* @param clientIdentity - Identity of the client sender.
|
|
1120
1132
|
*/
|
|
1121
|
-
async addClientToContextGroup({ contextGroupId }, clientIdentity) {
|
|
1133
|
+
async addClientToContextGroup({ contextGroupId: requestedContextGroupId }, clientIdentity) {
|
|
1122
1134
|
this.wire.sendAction('interop-broker-add-client-to-context-group').catch((e) => {
|
|
1123
1135
|
// don't expose, analytics-only call
|
|
1124
1136
|
});
|
|
1137
|
+
const contextGroupId = this.normalizeContextGroupId(requestedContextGroupId);
|
|
1138
|
+
if (contextGroupId === undefined) {
|
|
1139
|
+
await this.removeClientFromContextGroup(clientIdentity);
|
|
1140
|
+
return;
|
|
1141
|
+
}
|
|
1125
1142
|
const clientSubscriptionState = this.getClientState(clientIdentity);
|
|
1126
1143
|
if (!clientSubscriptionState) {
|
|
1127
1144
|
throw new Error(`Client with Identity: ${clientIdentity.uuid} ${clientIdentity.name} not in Client State Map`);
|
|
@@ -1220,6 +1237,9 @@ class InteropBroker extends Base {
|
|
|
1220
1237
|
clientState.contextGroupId = undefined;
|
|
1221
1238
|
}
|
|
1222
1239
|
await this.setCurrentContextGroupInClientOptions(clientIdentity, null);
|
|
1240
|
+
if (previousContextGroupId === undefined) {
|
|
1241
|
+
return;
|
|
1242
|
+
}
|
|
1223
1243
|
// All settled will suppress uncaught exceptions. We don't want to await this because it could
|
|
1224
1244
|
// result in the operation hanging.
|
|
1225
1245
|
Promise.allSettled(this.channel.publish('client-changed-context-group', {
|
|
@@ -1257,7 +1277,11 @@ class InteropBroker extends Base {
|
|
|
1257
1277
|
this.wire.sendAction('interop-broker-get-info-for-context-group').catch((e) => {
|
|
1258
1278
|
// don't expose, analytics-only call
|
|
1259
1279
|
});
|
|
1260
|
-
|
|
1280
|
+
const normalizedContextGroupId = this.normalizeContextGroupId(contextGroupId);
|
|
1281
|
+
if (normalizedContextGroupId === undefined) {
|
|
1282
|
+
return undefined;
|
|
1283
|
+
}
|
|
1284
|
+
return this.getContextGroups().find((contextGroup) => contextGroup.id === normalizedContextGroupId);
|
|
1261
1285
|
}
|
|
1262
1286
|
// Used by platform windows to get all clients for a context group.
|
|
1263
1287
|
/**
|
|
@@ -1273,8 +1297,12 @@ class InteropBroker extends Base {
|
|
|
1273
1297
|
this.wire.sendAction('interop-broker-get-all-clients-in-context-group').catch((e) => {
|
|
1274
1298
|
// don't expose, analytics-only call
|
|
1275
1299
|
});
|
|
1300
|
+
const normalizedContextGroupId = this.normalizeContextGroupId(contextGroupId);
|
|
1301
|
+
if (normalizedContextGroupId === undefined) {
|
|
1302
|
+
return [];
|
|
1303
|
+
}
|
|
1276
1304
|
const clientsInContextGroup = Array.from(this.interopClients.values())
|
|
1277
|
-
.filter((connectedClient) => connectedClient.contextGroupId ===
|
|
1305
|
+
.filter((connectedClient) => connectedClient.contextGroupId === normalizedContextGroupId)
|
|
1278
1306
|
.map((subscriptionState) => {
|
|
1279
1307
|
return subscriptionState.clientIdentity;
|
|
1280
1308
|
});
|
|
@@ -1721,8 +1749,9 @@ class InteropBroker extends Base {
|
|
|
1721
1749
|
}
|
|
1722
1750
|
// Used to restore interop broker state in snapshots.
|
|
1723
1751
|
applySnapshot(snapshot, options) {
|
|
1724
|
-
const
|
|
1725
|
-
if (
|
|
1752
|
+
const incomingContextGroupStates = snapshot?.interopSnapshotDetails?.contextGroupStates;
|
|
1753
|
+
if (incomingContextGroupStates) {
|
|
1754
|
+
const contextGroupStates = this.normalizeContextGroupStates(incomingContextGroupStates);
|
|
1726
1755
|
if (!options?.closeExistingWindows) {
|
|
1727
1756
|
this.updateExistingClients(contextGroupStates);
|
|
1728
1757
|
}
|
|
@@ -1867,6 +1896,23 @@ class InteropBroker extends Base {
|
|
|
1867
1896
|
});
|
|
1868
1897
|
return newObject;
|
|
1869
1898
|
}
|
|
1899
|
+
normalizeContextGroupStates(incomingContextGroupStates) {
|
|
1900
|
+
const normalizedContextGroupStates = {};
|
|
1901
|
+
for (const [contextGroupId, contexts] of Object.entries(incomingContextGroupStates)) {
|
|
1902
|
+
const normalizedContextGroupId = this.normalizeContextGroupId(contextGroupId);
|
|
1903
|
+
if (normalizedContextGroupId !== undefined) {
|
|
1904
|
+
normalizedContextGroupStates[normalizedContextGroupId] = {
|
|
1905
|
+
...normalizedContextGroupStates[normalizedContextGroupId],
|
|
1906
|
+
...contexts
|
|
1907
|
+
};
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
return normalizedContextGroupStates;
|
|
1911
|
+
}
|
|
1912
|
+
normalizeContextGroupId(contextGroupId) {
|
|
1913
|
+
const usesDefaultColorChannels = Object.keys(defaultColorChannels).every((defaultContextGroupId) => this.contextGroupsById.has(defaultContextGroupId));
|
|
1914
|
+
return usesDefaultColorChannels ? normalizeColorChannelId(contextGroupId) : contextGroupId;
|
|
1915
|
+
}
|
|
1870
1916
|
// Util to check a client identity.
|
|
1871
1917
|
static hasEndpointId(target) {
|
|
1872
1918
|
return target.endpointId !== undefined;
|
|
@@ -1930,8 +1976,14 @@ class InteropBroker extends Base {
|
|
|
1930
1976
|
clientIdentity
|
|
1931
1977
|
};
|
|
1932
1978
|
// Only allow the client to join a contextGroup that actually exists.
|
|
1933
|
-
|
|
1934
|
-
|
|
1979
|
+
const currentContextGroup = payload?.currentContextGroup
|
|
1980
|
+
? this.normalizeContextGroupId(payload.currentContextGroup)
|
|
1981
|
+
: undefined;
|
|
1982
|
+
if (currentContextGroup && this.contextGroupsById.has(currentContextGroup)) {
|
|
1983
|
+
clientSubscriptionState.contextGroupId = currentContextGroup;
|
|
1984
|
+
if (currentContextGroup !== payload.currentContextGroup) {
|
|
1985
|
+
await this.setCurrentContextGroupInClientOptions(clientIdentity, currentContextGroup);
|
|
1986
|
+
}
|
|
1935
1987
|
}
|
|
1936
1988
|
this.interopClients.set(clientIdentity.endpointId, clientSubscriptionState);
|
|
1937
1989
|
});
|
|
@@ -2179,6 +2231,26 @@ function isNewConnectConfig(config) {
|
|
|
2179
2231
|
return hasUuid(config) && hasRuntimeVersion(config);
|
|
2180
2232
|
}
|
|
2181
2233
|
|
|
2234
|
+
const V8Error = Error;
|
|
2235
|
+
function isCallSiteArray(stack) {
|
|
2236
|
+
if (!Array.isArray(stack) || stack.length === 0) {
|
|
2237
|
+
return Array.isArray(stack);
|
|
2238
|
+
}
|
|
2239
|
+
const first = stack[0];
|
|
2240
|
+
return typeof first === 'object' && first !== null && typeof first.getFileName === 'function';
|
|
2241
|
+
}
|
|
2242
|
+
function isStackFrameLine(line) {
|
|
2243
|
+
return /^\s*at\s/.test(line) || line.includes('@');
|
|
2244
|
+
}
|
|
2245
|
+
/**
|
|
2246
|
+
* Split a native `error.stack` string into frames and drop the dummy Error header plus `framesToRemove` frames.
|
|
2247
|
+
* Safari/Firefox ignore V8's Error.prepareStackTrace, so `.stack` stays a string and `.slice(n)` would cut characters.
|
|
2248
|
+
*/
|
|
2249
|
+
function stackStringToFrames(stack, framesToRemove) {
|
|
2250
|
+
const lines = stack.split('\n').filter((line) => line.length > 0);
|
|
2251
|
+
const start = lines[0] !== undefined && !isStackFrameLine(lines[0]) ? 1 : 0;
|
|
2252
|
+
return lines.slice(start + framesToRemove);
|
|
2253
|
+
}
|
|
2182
2254
|
class DisconnectedError extends Error {
|
|
2183
2255
|
constructor(readyState) {
|
|
2184
2256
|
super(`Expected websocket state OPEN but found ${readyState}`);
|
|
@@ -2215,17 +2287,17 @@ class DeserializedError extends Error {
|
|
|
2215
2287
|
class RuntimeError extends Error {
|
|
2216
2288
|
static trimEndCallSites(err, takeUntilRegex) {
|
|
2217
2289
|
// save original props
|
|
2218
|
-
const length =
|
|
2290
|
+
const length = V8Error.stackTraceLimit;
|
|
2219
2291
|
// eslint-disable-next-line no-underscore-dangle
|
|
2220
|
-
const _prepareStackTrace =
|
|
2292
|
+
const _prepareStackTrace = V8Error.prepareStackTrace;
|
|
2221
2293
|
// This will be called when we access the `stack` property
|
|
2222
|
-
|
|
2294
|
+
V8Error.prepareStackTrace = (_, stack) => stack;
|
|
2223
2295
|
// in channel errors, the error was already serialized so we need to handle both string and CallSite[]
|
|
2224
2296
|
const isString = typeof err.stack === 'string';
|
|
2225
2297
|
const stack = (isString ? err.stack?.split('\n') : err.stack) ?? [];
|
|
2226
2298
|
// restore original props
|
|
2227
|
-
|
|
2228
|
-
|
|
2299
|
+
V8Error.prepareStackTrace = _prepareStackTrace;
|
|
2300
|
+
V8Error.stackTraceLimit = length;
|
|
2229
2301
|
// stack is optional in non chromium contexts
|
|
2230
2302
|
if (stack.length) {
|
|
2231
2303
|
const newStack = [];
|
|
@@ -2247,31 +2319,47 @@ class RuntimeError extends Error {
|
|
|
2247
2319
|
}
|
|
2248
2320
|
}
|
|
2249
2321
|
static getCallSite(callsToRemove = 0) {
|
|
2250
|
-
const length =
|
|
2322
|
+
const length = V8Error.stackTraceLimit;
|
|
2251
2323
|
const realCallsToRemove = callsToRemove + 1; // remove this call;
|
|
2252
|
-
|
|
2324
|
+
const limit = typeof length === 'number' && Number.isFinite(length) ? length : 10;
|
|
2253
2325
|
// eslint-disable-next-line no-underscore-dangle
|
|
2254
|
-
const _prepareStackTrace =
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2326
|
+
const _prepareStackTrace = V8Error.prepareStackTrace;
|
|
2327
|
+
try {
|
|
2328
|
+
V8Error.stackTraceLimit = limit + realCallsToRemove;
|
|
2329
|
+
// V8 only: accessing `.stack` invokes this and returns CallSite[]. Safari/Firefox ignore it.
|
|
2330
|
+
V8Error.prepareStackTrace = (_, stack) => stack;
|
|
2331
|
+
const rawStack = new Error().stack;
|
|
2332
|
+
if (Array.isArray(rawStack)) {
|
|
2333
|
+
return rawStack.slice(realCallsToRemove);
|
|
2334
|
+
}
|
|
2335
|
+
if (typeof rawStack === 'string' && rawStack.length > 0) {
|
|
2336
|
+
return stackStringToFrames(rawStack, realCallsToRemove);
|
|
2337
|
+
}
|
|
2338
|
+
return [];
|
|
2339
|
+
}
|
|
2340
|
+
finally {
|
|
2341
|
+
V8Error.prepareStackTrace = _prepareStackTrace;
|
|
2342
|
+
V8Error.stackTraceLimit = length;
|
|
2343
|
+
}
|
|
2262
2344
|
}
|
|
2263
2345
|
static prepareStackTrace(err, callSites) {
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2346
|
+
const header = `${err.name || 'Error'}: ${err.message || ''}`;
|
|
2347
|
+
const frames = typeof callSites === 'string' ? stackStringToFrames(callSites, 0) : callSites;
|
|
2348
|
+
if (!Array.isArray(frames) || frames.length === 0) {
|
|
2349
|
+
return header;
|
|
2350
|
+
}
|
|
2351
|
+
if (isCallSiteArray(frames)) {
|
|
2352
|
+
const prepare = V8Error.prepareStackTrace;
|
|
2353
|
+
// Only V8 CallSite[] may be passed to a user-supplied Error.prepareStackTrace.
|
|
2354
|
+
if (typeof prepare === 'function') {
|
|
2355
|
+
return prepare(err, frames);
|
|
2356
|
+
}
|
|
2357
|
+
// TODO: this is just a first iteration, we can make this "nicer" at some point
|
|
2358
|
+
// const EXCLUSIONS = ['IpcRenderer', 'Object.onMessage', 'Transport.onmessage', 'MessageReceiver.onmessage'];
|
|
2359
|
+
return `${header}\n${frames.map((line) => ` at ${line}`).join('\n')}`;
|
|
2360
|
+
}
|
|
2361
|
+
// Native Safari/Firefox frames already include their engine's format (`func@file:line:col`).
|
|
2362
|
+
return `${header}\n${frames.join('\n')}`;
|
|
2275
2363
|
}
|
|
2276
2364
|
/*
|
|
2277
2365
|
|
|
@@ -15113,7 +15201,7 @@ class InteropClient extends Base {
|
|
|
15113
15201
|
*
|
|
15114
15202
|
* getLastFocusedView()
|
|
15115
15203
|
* .then(lastFocusedViewIdentity => {
|
|
15116
|
-
* joinViewToContextGroup('
|
|
15204
|
+
* joinViewToContextGroup('fdc3.channel.1', lastFocusedViewIdentity)
|
|
15117
15205
|
* })
|
|
15118
15206
|
* ```
|
|
15119
15207
|
*/
|
|
@@ -15163,7 +15251,7 @@ class InteropClient extends Base {
|
|
|
15163
15251
|
*
|
|
15164
15252
|
* @example
|
|
15165
15253
|
* ```js
|
|
15166
|
-
* fin.me.interop.getAllClientsInContextGroup('
|
|
15254
|
+
* fin.me.interop.getAllClientsInContextGroup('fdc3.channel.1')
|
|
15167
15255
|
* .then(clientsInContextGroup => {
|
|
15168
15256
|
* console.log(clientsInContextGroup)
|
|
15169
15257
|
* })
|
|
@@ -15187,7 +15275,7 @@ class InteropClient extends Base {
|
|
|
15187
15275
|
*
|
|
15188
15276
|
* @example
|
|
15189
15277
|
* ```js
|
|
15190
|
-
* fin.me.interop.getInfoForContextGroup('
|
|
15278
|
+
* fin.me.interop.getInfoForContextGroup('fdc3.channel.1')
|
|
15191
15279
|
* .then(contextGroupInfo => {
|
|
15192
15280
|
* console.log(contextGroupInfo.displayMetadata.name)
|
|
15193
15281
|
* console.log(contextGroupInfo.displayMetadata.color)
|
|
@@ -15276,12 +15364,12 @@ class InteropClient extends Base {
|
|
|
15276
15364
|
*
|
|
15277
15365
|
* @example
|
|
15278
15366
|
* ```js
|
|
15279
|
-
* await fin.me.interop.joinContextGroup('
|
|
15367
|
+
* await fin.me.interop.joinContextGroup('fdc3.channel.3');
|
|
15280
15368
|
* await fin.me.interop.setContext({ type: 'instrument', id: { ticker: 'FOO' }});
|
|
15281
15369
|
* const currentContext = await fin.me.interop.getCurrentContext();
|
|
15282
15370
|
*
|
|
15283
15371
|
* // with a specific context
|
|
15284
|
-
* await fin.me.interop.joinContextGroup('
|
|
15372
|
+
* await fin.me.interop.joinContextGroup('fdc3.channel.3');
|
|
15285
15373
|
* await fin.me.interop.setContext({ type: 'country', id: { ISOALPHA3: 'US' }});
|
|
15286
15374
|
* await fin.me.interop.setContext({ type: 'instrument', id: { ticker: 'FOO' }});
|
|
15287
15375
|
* const currentContext = await fin.me.interop.getCurrentContext('country');
|
|
@@ -15918,15 +16006,18 @@ class FDC3ModuleBase {
|
|
|
15918
16006
|
async joinChannel(channelId) {
|
|
15919
16007
|
this.wire.recordAnalytic('fdc3-join-channel');
|
|
15920
16008
|
try {
|
|
16009
|
+
const contextGroup = await this.client.getInfoForContextGroup(channelId);
|
|
16010
|
+
if (!contextGroup) {
|
|
16011
|
+
console.error(`No User Channel was found with the ID "${channelId}". If this is an App Channel, use getOrCreateChannel instead.`);
|
|
16012
|
+
throw new Error(ChannelError.NoChannelFound);
|
|
16013
|
+
}
|
|
15921
16014
|
return await this.client.joinContextGroup(channelId);
|
|
15922
16015
|
}
|
|
15923
16016
|
catch (error) {
|
|
15924
|
-
if (error.message ===
|
|
15925
|
-
|
|
15926
|
-
}
|
|
15927
|
-
else {
|
|
15928
|
-
console.error(error.message);
|
|
16017
|
+
if (error.message === ChannelError.NoChannelFound) {
|
|
16018
|
+
throw new Error(ChannelError.NoChannelFound);
|
|
15929
16019
|
}
|
|
16020
|
+
console.error(error.message);
|
|
15930
16021
|
if (error.message.startsWith('Attempting to join a context group that does not exist')) {
|
|
15931
16022
|
throw new Error(ChannelError.NoChannelFound);
|
|
15932
16023
|
}
|
|
@@ -16606,7 +16697,7 @@ class InteropModule extends Base {
|
|
|
16606
16697
|
* @example
|
|
16607
16698
|
* ```js
|
|
16608
16699
|
* const interopConfig = {
|
|
16609
|
-
* currentContextGroup: '
|
|
16700
|
+
* currentContextGroup: 'fdc3.channel.4'
|
|
16610
16701
|
* }
|
|
16611
16702
|
*
|
|
16612
16703
|
* const interopBroker = await fin.Interop.init('openfin');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfin/remote-adapter",
|
|
3
|
-
"version": "46.100.
|
|
3
|
+
"version": "46.100.66",
|
|
4
4
|
"description": "Establish intermachine runtime connections using webRTC.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"private": false,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"es-toolkit": "^1.39.3",
|
|
18
18
|
"tslib": "2.8.1",
|
|
19
|
-
"@openfin/core": "46.100.
|
|
19
|
+
"@openfin/core": "46.100.66"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"prebuild": "rimraf ./out",
|