@openfin/node-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/node-adapter.js +191 -100
- package/package.json +2 -2
package/out/node-adapter.js
CHANGED
|
@@ -293,6 +293,26 @@ class EmitterBase extends Base {
|
|
|
293
293
|
}
|
|
294
294
|
_EmitterBase_emitterAccessor = new WeakMap(), _EmitterBase_deregisterOnceListeners = new WeakMap();
|
|
295
295
|
|
|
296
|
+
const V8Error = Error;
|
|
297
|
+
function isCallSiteArray(stack) {
|
|
298
|
+
if (!Array.isArray(stack) || stack.length === 0) {
|
|
299
|
+
return Array.isArray(stack);
|
|
300
|
+
}
|
|
301
|
+
const first = stack[0];
|
|
302
|
+
return typeof first === 'object' && first !== null && typeof first.getFileName === 'function';
|
|
303
|
+
}
|
|
304
|
+
function isStackFrameLine(line) {
|
|
305
|
+
return /^\s*at\s/.test(line) || line.includes('@');
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Split a native `error.stack` string into frames and drop the dummy Error header plus `framesToRemove` frames.
|
|
309
|
+
* Safari/Firefox ignore V8's Error.prepareStackTrace, so `.stack` stays a string and `.slice(n)` would cut characters.
|
|
310
|
+
*/
|
|
311
|
+
function stackStringToFrames(stack, framesToRemove) {
|
|
312
|
+
const lines = stack.split('\n').filter((line) => line.length > 0);
|
|
313
|
+
const start = lines[0] !== undefined && !isStackFrameLine(lines[0]) ? 1 : 0;
|
|
314
|
+
return lines.slice(start + framesToRemove);
|
|
315
|
+
}
|
|
296
316
|
class DisconnectedError extends Error {
|
|
297
317
|
constructor(readyState) {
|
|
298
318
|
super(`Expected websocket state OPEN but found ${readyState}`);
|
|
@@ -329,17 +349,17 @@ class DeserializedError extends Error {
|
|
|
329
349
|
class RuntimeError extends Error {
|
|
330
350
|
static trimEndCallSites(err, takeUntilRegex) {
|
|
331
351
|
// save original props
|
|
332
|
-
const length =
|
|
352
|
+
const length = V8Error.stackTraceLimit;
|
|
333
353
|
// eslint-disable-next-line no-underscore-dangle
|
|
334
|
-
const _prepareStackTrace =
|
|
354
|
+
const _prepareStackTrace = V8Error.prepareStackTrace;
|
|
335
355
|
// This will be called when we access the `stack` property
|
|
336
|
-
|
|
356
|
+
V8Error.prepareStackTrace = (_, stack) => stack;
|
|
337
357
|
// in channel errors, the error was already serialized so we need to handle both string and CallSite[]
|
|
338
358
|
const isString = typeof err.stack === 'string';
|
|
339
359
|
const stack = (isString ? err.stack?.split('\n') : err.stack) ?? [];
|
|
340
360
|
// restore original props
|
|
341
|
-
|
|
342
|
-
|
|
361
|
+
V8Error.prepareStackTrace = _prepareStackTrace;
|
|
362
|
+
V8Error.stackTraceLimit = length;
|
|
343
363
|
// stack is optional in non chromium contexts
|
|
344
364
|
if (stack.length) {
|
|
345
365
|
const newStack = [];
|
|
@@ -361,31 +381,47 @@ class RuntimeError extends Error {
|
|
|
361
381
|
}
|
|
362
382
|
}
|
|
363
383
|
static getCallSite(callsToRemove = 0) {
|
|
364
|
-
const length =
|
|
384
|
+
const length = V8Error.stackTraceLimit;
|
|
365
385
|
const realCallsToRemove = callsToRemove + 1; // remove this call;
|
|
366
|
-
|
|
386
|
+
const limit = typeof length === 'number' && Number.isFinite(length) ? length : 10;
|
|
367
387
|
// eslint-disable-next-line no-underscore-dangle
|
|
368
|
-
const _prepareStackTrace =
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
388
|
+
const _prepareStackTrace = V8Error.prepareStackTrace;
|
|
389
|
+
try {
|
|
390
|
+
V8Error.stackTraceLimit = limit + realCallsToRemove;
|
|
391
|
+
// V8 only: accessing `.stack` invokes this and returns CallSite[]. Safari/Firefox ignore it.
|
|
392
|
+
V8Error.prepareStackTrace = (_, stack) => stack;
|
|
393
|
+
const rawStack = new Error().stack;
|
|
394
|
+
if (Array.isArray(rawStack)) {
|
|
395
|
+
return rawStack.slice(realCallsToRemove);
|
|
396
|
+
}
|
|
397
|
+
if (typeof rawStack === 'string' && rawStack.length > 0) {
|
|
398
|
+
return stackStringToFrames(rawStack, realCallsToRemove);
|
|
399
|
+
}
|
|
400
|
+
return [];
|
|
401
|
+
}
|
|
402
|
+
finally {
|
|
403
|
+
V8Error.prepareStackTrace = _prepareStackTrace;
|
|
404
|
+
V8Error.stackTraceLimit = length;
|
|
405
|
+
}
|
|
376
406
|
}
|
|
377
407
|
static prepareStackTrace(err, callSites) {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
408
|
+
const header = `${err.name || 'Error'}: ${err.message || ''}`;
|
|
409
|
+
const frames = typeof callSites === 'string' ? stackStringToFrames(callSites, 0) : callSites;
|
|
410
|
+
if (!Array.isArray(frames) || frames.length === 0) {
|
|
411
|
+
return header;
|
|
412
|
+
}
|
|
413
|
+
if (isCallSiteArray(frames)) {
|
|
414
|
+
const prepare = V8Error.prepareStackTrace;
|
|
415
|
+
// Only V8 CallSite[] may be passed to a user-supplied Error.prepareStackTrace.
|
|
416
|
+
if (typeof prepare === 'function') {
|
|
417
|
+
return prepare(err, frames);
|
|
418
|
+
}
|
|
419
|
+
// TODO: this is just a first iteration, we can make this "nicer" at some point
|
|
420
|
+
// const EXCLUSIONS = ['IpcRenderer', 'Object.onMessage', 'Transport.onmessage', 'MessageReceiver.onmessage'];
|
|
421
|
+
return `${header}\n${frames.map((line) => ` at ${line}`).join('\n')}`;
|
|
422
|
+
}
|
|
423
|
+
// Native Safari/Firefox frames already include their engine's format (`func@file:line:col`).
|
|
424
|
+
return `${header}\n${frames.join('\n')}`;
|
|
389
425
|
}
|
|
390
426
|
/*
|
|
391
427
|
|
|
@@ -12880,6 +12916,45 @@ class PrivateChannelProvider {
|
|
|
12880
12916
|
}
|
|
12881
12917
|
}
|
|
12882
12918
|
|
|
12919
|
+
/**
|
|
12920
|
+
* The default FDC3 user channels advertised by the Interop Broker.
|
|
12921
|
+
*/
|
|
12922
|
+
const defaultColorChannels = {
|
|
12923
|
+
'fdc3.channel.1': { name: 'Channel 1', color: 'red', glyph: '1' },
|
|
12924
|
+
'fdc3.channel.2': { name: 'Channel 2', color: 'orange', glyph: '2' },
|
|
12925
|
+
'fdc3.channel.3': { name: 'Channel 3', color: 'yellow', glyph: '3' },
|
|
12926
|
+
'fdc3.channel.4': { name: 'Channel 4', color: 'green', glyph: '4' },
|
|
12927
|
+
'fdc3.channel.5': { name: 'Channel 5', color: 'cyan', glyph: '5' },
|
|
12928
|
+
'fdc3.channel.6': { name: 'Channel 6', color: 'blue', glyph: '6' },
|
|
12929
|
+
'fdc3.channel.7': { name: 'Channel 7', color: 'magenta', glyph: '7' },
|
|
12930
|
+
'fdc3.channel.8': { name: 'Channel 8', color: 'purple', glyph: '8' }
|
|
12931
|
+
};
|
|
12932
|
+
const legacyColorChannelIds = {
|
|
12933
|
+
red: 'fdc3.channel.1',
|
|
12934
|
+
orange: 'fdc3.channel.2',
|
|
12935
|
+
yellow: 'fdc3.channel.3',
|
|
12936
|
+
green: 'fdc3.channel.4',
|
|
12937
|
+
teal: 'fdc3.channel.5',
|
|
12938
|
+
blue: 'fdc3.channel.6',
|
|
12939
|
+
pink: 'fdc3.channel.7',
|
|
12940
|
+
// Legacy indigo (workspace) and purple (core) intentionally converge on the same FDC3 purple channel.
|
|
12941
|
+
indigo: 'fdc3.channel.8',
|
|
12942
|
+
purple: 'fdc3.channel.8'
|
|
12943
|
+
};
|
|
12944
|
+
/**
|
|
12945
|
+
* Converts a legacy color-named channel ID to its canonical FDC3 user-channel ID.
|
|
12946
|
+
* The removed legacy gray channel resolves to no channel.
|
|
12947
|
+
*/
|
|
12948
|
+
function normalizeColorChannelId(colorChannelId) {
|
|
12949
|
+
if (colorChannelId === 'gray') {
|
|
12950
|
+
return undefined;
|
|
12951
|
+
}
|
|
12952
|
+
if (Object.prototype.hasOwnProperty.call(legacyColorChannelIds, colorChannelId)) {
|
|
12953
|
+
return legacyColorChannelIds[colorChannelId];
|
|
12954
|
+
}
|
|
12955
|
+
return colorChannelId;
|
|
12956
|
+
}
|
|
12957
|
+
|
|
12883
12958
|
var __classPrivateFieldSet$9 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12884
12959
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
12885
12960
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
@@ -12892,50 +12967,7 @@ var __classPrivateFieldGet$9 = (undefined && undefined.__classPrivateFieldGet) |
|
|
|
12892
12967
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12893
12968
|
};
|
|
12894
12969
|
var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
|
|
12895
|
-
const defaultContextGroups = [
|
|
12896
|
-
{
|
|
12897
|
-
id: 'green',
|
|
12898
|
-
displayMetadata: {
|
|
12899
|
-
color: '#00CC88',
|
|
12900
|
-
name: 'green'
|
|
12901
|
-
}
|
|
12902
|
-
},
|
|
12903
|
-
{
|
|
12904
|
-
id: 'purple',
|
|
12905
|
-
displayMetadata: {
|
|
12906
|
-
color: '#8C61FF',
|
|
12907
|
-
name: 'purple'
|
|
12908
|
-
}
|
|
12909
|
-
},
|
|
12910
|
-
{
|
|
12911
|
-
id: 'orange',
|
|
12912
|
-
displayMetadata: {
|
|
12913
|
-
color: '#FF8C4C',
|
|
12914
|
-
name: 'orange'
|
|
12915
|
-
}
|
|
12916
|
-
},
|
|
12917
|
-
{
|
|
12918
|
-
id: 'red',
|
|
12919
|
-
displayMetadata: {
|
|
12920
|
-
color: '#FF5E60',
|
|
12921
|
-
name: 'red'
|
|
12922
|
-
}
|
|
12923
|
-
},
|
|
12924
|
-
{
|
|
12925
|
-
id: 'pink',
|
|
12926
|
-
displayMetadata: {
|
|
12927
|
-
color: '#FF8FB8',
|
|
12928
|
-
name: 'pink'
|
|
12929
|
-
}
|
|
12930
|
-
},
|
|
12931
|
-
{
|
|
12932
|
-
id: 'yellow',
|
|
12933
|
-
displayMetadata: {
|
|
12934
|
-
color: '#E9FF8F',
|
|
12935
|
-
name: 'yellow'
|
|
12936
|
-
}
|
|
12937
|
-
}
|
|
12938
|
-
];
|
|
12970
|
+
const defaultContextGroups = Object.entries(defaultColorChannels).map(([id, displayMetadata]) => ({ id, displayMetadata }));
|
|
12939
12971
|
/**
|
|
12940
12972
|
* {@link https://developers.openfin.co/of-docs/docs/enable-color-linking}
|
|
12941
12973
|
*
|
|
@@ -12965,17 +12997,19 @@ const defaultContextGroups = [
|
|
|
12965
12997
|
* "interopBrokerConfiguration": {
|
|
12966
12998
|
* "contextGroups": [
|
|
12967
12999
|
* {
|
|
12968
|
-
* "id": "
|
|
13000
|
+
* "id": "fdc3.channel.4",
|
|
12969
13001
|
* "displayMetadata": {
|
|
12970
|
-
* "color": "
|
|
12971
|
-
* "name": "
|
|
13002
|
+
* "color": "green",
|
|
13003
|
+
* "name": "Channel 4",
|
|
13004
|
+
* "glyph": "4"
|
|
12972
13005
|
* }
|
|
12973
13006
|
* },
|
|
12974
13007
|
* {
|
|
12975
|
-
* "id": "
|
|
13008
|
+
* "id": "fdc3.channel.8",
|
|
12976
13009
|
* "displayMetadata": {
|
|
12977
|
-
* "color": "
|
|
12978
|
-
* "name": "
|
|
13010
|
+
* "color": "purple",
|
|
13011
|
+
* "name": "Channel 8",
|
|
13012
|
+
* "glyph": "8"
|
|
12979
13013
|
* }
|
|
12980
13014
|
* },
|
|
12981
13015
|
* ]
|
|
@@ -13138,9 +13172,13 @@ class InteropBroker extends Base {
|
|
|
13138
13172
|
this.wire.sendAction('interop-broker-set-context-for-group').catch((e) => {
|
|
13139
13173
|
// don't expose, analytics-only call
|
|
13140
13174
|
});
|
|
13141
|
-
const
|
|
13175
|
+
const normalizedContextGroupId = this.normalizeContextGroupId(contextGroupId);
|
|
13176
|
+
if (normalizedContextGroupId === undefined) {
|
|
13177
|
+
return;
|
|
13178
|
+
}
|
|
13179
|
+
const contextGroupState = this.contextGroupsById.get(normalizedContextGroupId);
|
|
13142
13180
|
if (!contextGroupState) {
|
|
13143
|
-
throw new Error(`Unable to set context for context group that isn't in the context group mapping: ${
|
|
13181
|
+
throw new Error(`Unable to set context for context group that isn't in the context group mapping: ${normalizedContextGroupId}.`);
|
|
13144
13182
|
}
|
|
13145
13183
|
const contextIntegrityCheckResult = InteropBroker.checkContextIntegrity(context);
|
|
13146
13184
|
if (contextIntegrityCheckResult.isValid === false) {
|
|
@@ -13148,8 +13186,8 @@ class InteropBroker extends Base {
|
|
|
13148
13186
|
}
|
|
13149
13187
|
const broadcastedContextType = context.type;
|
|
13150
13188
|
contextGroupState.set(broadcastedContextType, context);
|
|
13151
|
-
this.lastContextMap.set(
|
|
13152
|
-
const clientsInSameContextGroup = Array.from(this.interopClients.values()).filter((connectedClient) => connectedClient.contextGroupId ===
|
|
13189
|
+
this.lastContextMap.set(normalizedContextGroupId, broadcastedContextType);
|
|
13190
|
+
const clientsInSameContextGroup = Array.from(this.interopClients.values()).filter((connectedClient) => connectedClient.contextGroupId === normalizedContextGroupId);
|
|
13153
13191
|
clientsInSameContextGroup.forEach((client) => {
|
|
13154
13192
|
for (const [, handlerInfo] of client.contextHandlers) {
|
|
13155
13193
|
if (InteropBroker.isContextTypeCompatible(broadcastedContextType, handlerInfo.contextType)) {
|
|
@@ -13195,10 +13233,20 @@ class InteropBroker extends Base {
|
|
|
13195
13233
|
* @param joinContextGroupOptions - Id of the Context Group and identity of the entity to join to the group.
|
|
13196
13234
|
* @param senderIdentity - Identity of the client sender.
|
|
13197
13235
|
*/
|
|
13198
|
-
async joinContextGroup({ contextGroupId, target }, senderIdentity) {
|
|
13236
|
+
async joinContextGroup({ contextGroupId: requestedContextGroupId, target }, senderIdentity) {
|
|
13199
13237
|
this.wire.sendAction('interop-broker-join-context-group').catch((e) => {
|
|
13200
13238
|
// don't expose, analytics-only call
|
|
13201
13239
|
});
|
|
13240
|
+
const contextGroupId = this.normalizeContextGroupId(requestedContextGroupId);
|
|
13241
|
+
if (contextGroupId === undefined) {
|
|
13242
|
+
if (target) {
|
|
13243
|
+
await this.removeFromContextGroup({ target }, senderIdentity);
|
|
13244
|
+
}
|
|
13245
|
+
else {
|
|
13246
|
+
await this.removeClientFromContextGroup(senderIdentity);
|
|
13247
|
+
}
|
|
13248
|
+
return;
|
|
13249
|
+
}
|
|
13202
13250
|
if (this.sessionContextGroupMap.has(contextGroupId)) {
|
|
13203
13251
|
throw new Error(BROKER_ERRORS.joinSessionContextGroupWithJoinContextGroup);
|
|
13204
13252
|
}
|
|
@@ -13240,10 +13288,15 @@ class InteropBroker extends Base {
|
|
|
13240
13288
|
* @param addClientToContextGroupOptions - Contains the contextGroupId
|
|
13241
13289
|
* @param clientIdentity - Identity of the client sender.
|
|
13242
13290
|
*/
|
|
13243
|
-
async addClientToContextGroup({ contextGroupId }, clientIdentity) {
|
|
13291
|
+
async addClientToContextGroup({ contextGroupId: requestedContextGroupId }, clientIdentity) {
|
|
13244
13292
|
this.wire.sendAction('interop-broker-add-client-to-context-group').catch((e) => {
|
|
13245
13293
|
// don't expose, analytics-only call
|
|
13246
13294
|
});
|
|
13295
|
+
const contextGroupId = this.normalizeContextGroupId(requestedContextGroupId);
|
|
13296
|
+
if (contextGroupId === undefined) {
|
|
13297
|
+
await this.removeClientFromContextGroup(clientIdentity);
|
|
13298
|
+
return;
|
|
13299
|
+
}
|
|
13247
13300
|
const clientSubscriptionState = this.getClientState(clientIdentity);
|
|
13248
13301
|
if (!clientSubscriptionState) {
|
|
13249
13302
|
throw new Error(`Client with Identity: ${clientIdentity.uuid} ${clientIdentity.name} not in Client State Map`);
|
|
@@ -13342,6 +13395,9 @@ class InteropBroker extends Base {
|
|
|
13342
13395
|
clientState.contextGroupId = undefined;
|
|
13343
13396
|
}
|
|
13344
13397
|
await this.setCurrentContextGroupInClientOptions(clientIdentity, null);
|
|
13398
|
+
if (previousContextGroupId === undefined) {
|
|
13399
|
+
return;
|
|
13400
|
+
}
|
|
13345
13401
|
// All settled will suppress uncaught exceptions. We don't want to await this because it could
|
|
13346
13402
|
// result in the operation hanging.
|
|
13347
13403
|
Promise.allSettled(this.channel.publish('client-changed-context-group', {
|
|
@@ -13379,7 +13435,11 @@ class InteropBroker extends Base {
|
|
|
13379
13435
|
this.wire.sendAction('interop-broker-get-info-for-context-group').catch((e) => {
|
|
13380
13436
|
// don't expose, analytics-only call
|
|
13381
13437
|
});
|
|
13382
|
-
|
|
13438
|
+
const normalizedContextGroupId = this.normalizeContextGroupId(contextGroupId);
|
|
13439
|
+
if (normalizedContextGroupId === undefined) {
|
|
13440
|
+
return undefined;
|
|
13441
|
+
}
|
|
13442
|
+
return this.getContextGroups().find((contextGroup) => contextGroup.id === normalizedContextGroupId);
|
|
13383
13443
|
}
|
|
13384
13444
|
// Used by platform windows to get all clients for a context group.
|
|
13385
13445
|
/**
|
|
@@ -13395,8 +13455,12 @@ class InteropBroker extends Base {
|
|
|
13395
13455
|
this.wire.sendAction('interop-broker-get-all-clients-in-context-group').catch((e) => {
|
|
13396
13456
|
// don't expose, analytics-only call
|
|
13397
13457
|
});
|
|
13458
|
+
const normalizedContextGroupId = this.normalizeContextGroupId(contextGroupId);
|
|
13459
|
+
if (normalizedContextGroupId === undefined) {
|
|
13460
|
+
return [];
|
|
13461
|
+
}
|
|
13398
13462
|
const clientsInContextGroup = Array.from(this.interopClients.values())
|
|
13399
|
-
.filter((connectedClient) => connectedClient.contextGroupId ===
|
|
13463
|
+
.filter((connectedClient) => connectedClient.contextGroupId === normalizedContextGroupId)
|
|
13400
13464
|
.map((subscriptionState) => {
|
|
13401
13465
|
return subscriptionState.clientIdentity;
|
|
13402
13466
|
});
|
|
@@ -13843,8 +13907,9 @@ class InteropBroker extends Base {
|
|
|
13843
13907
|
}
|
|
13844
13908
|
// Used to restore interop broker state in snapshots.
|
|
13845
13909
|
applySnapshot(snapshot, options) {
|
|
13846
|
-
const
|
|
13847
|
-
if (
|
|
13910
|
+
const incomingContextGroupStates = snapshot?.interopSnapshotDetails?.contextGroupStates;
|
|
13911
|
+
if (incomingContextGroupStates) {
|
|
13912
|
+
const contextGroupStates = this.normalizeContextGroupStates(incomingContextGroupStates);
|
|
13848
13913
|
if (!options?.closeExistingWindows) {
|
|
13849
13914
|
this.updateExistingClients(contextGroupStates);
|
|
13850
13915
|
}
|
|
@@ -13989,6 +14054,23 @@ class InteropBroker extends Base {
|
|
|
13989
14054
|
});
|
|
13990
14055
|
return newObject;
|
|
13991
14056
|
}
|
|
14057
|
+
normalizeContextGroupStates(incomingContextGroupStates) {
|
|
14058
|
+
const normalizedContextGroupStates = {};
|
|
14059
|
+
for (const [contextGroupId, contexts] of Object.entries(incomingContextGroupStates)) {
|
|
14060
|
+
const normalizedContextGroupId = this.normalizeContextGroupId(contextGroupId);
|
|
14061
|
+
if (normalizedContextGroupId !== undefined) {
|
|
14062
|
+
normalizedContextGroupStates[normalizedContextGroupId] = {
|
|
14063
|
+
...normalizedContextGroupStates[normalizedContextGroupId],
|
|
14064
|
+
...contexts
|
|
14065
|
+
};
|
|
14066
|
+
}
|
|
14067
|
+
}
|
|
14068
|
+
return normalizedContextGroupStates;
|
|
14069
|
+
}
|
|
14070
|
+
normalizeContextGroupId(contextGroupId) {
|
|
14071
|
+
const usesDefaultColorChannels = Object.keys(defaultColorChannels).every((defaultContextGroupId) => this.contextGroupsById.has(defaultContextGroupId));
|
|
14072
|
+
return usesDefaultColorChannels ? normalizeColorChannelId(contextGroupId) : contextGroupId;
|
|
14073
|
+
}
|
|
13992
14074
|
// Util to check a client identity.
|
|
13993
14075
|
static hasEndpointId(target) {
|
|
13994
14076
|
return target.endpointId !== undefined;
|
|
@@ -14052,8 +14134,14 @@ class InteropBroker extends Base {
|
|
|
14052
14134
|
clientIdentity
|
|
14053
14135
|
};
|
|
14054
14136
|
// Only allow the client to join a contextGroup that actually exists.
|
|
14055
|
-
|
|
14056
|
-
|
|
14137
|
+
const currentContextGroup = payload?.currentContextGroup
|
|
14138
|
+
? this.normalizeContextGroupId(payload.currentContextGroup)
|
|
14139
|
+
: undefined;
|
|
14140
|
+
if (currentContextGroup && this.contextGroupsById.has(currentContextGroup)) {
|
|
14141
|
+
clientSubscriptionState.contextGroupId = currentContextGroup;
|
|
14142
|
+
if (currentContextGroup !== payload.currentContextGroup) {
|
|
14143
|
+
await this.setCurrentContextGroupInClientOptions(clientIdentity, currentContextGroup);
|
|
14144
|
+
}
|
|
14057
14145
|
}
|
|
14058
14146
|
this.interopClients.set(clientIdentity.endpointId, clientSubscriptionState);
|
|
14059
14147
|
});
|
|
@@ -14623,7 +14711,7 @@ class InteropClient extends Base {
|
|
|
14623
14711
|
*
|
|
14624
14712
|
* getLastFocusedView()
|
|
14625
14713
|
* .then(lastFocusedViewIdentity => {
|
|
14626
|
-
* joinViewToContextGroup('
|
|
14714
|
+
* joinViewToContextGroup('fdc3.channel.1', lastFocusedViewIdentity)
|
|
14627
14715
|
* })
|
|
14628
14716
|
* ```
|
|
14629
14717
|
*/
|
|
@@ -14673,7 +14761,7 @@ class InteropClient extends Base {
|
|
|
14673
14761
|
*
|
|
14674
14762
|
* @example
|
|
14675
14763
|
* ```js
|
|
14676
|
-
* fin.me.interop.getAllClientsInContextGroup('
|
|
14764
|
+
* fin.me.interop.getAllClientsInContextGroup('fdc3.channel.1')
|
|
14677
14765
|
* .then(clientsInContextGroup => {
|
|
14678
14766
|
* console.log(clientsInContextGroup)
|
|
14679
14767
|
* })
|
|
@@ -14697,7 +14785,7 @@ class InteropClient extends Base {
|
|
|
14697
14785
|
*
|
|
14698
14786
|
* @example
|
|
14699
14787
|
* ```js
|
|
14700
|
-
* fin.me.interop.getInfoForContextGroup('
|
|
14788
|
+
* fin.me.interop.getInfoForContextGroup('fdc3.channel.1')
|
|
14701
14789
|
* .then(contextGroupInfo => {
|
|
14702
14790
|
* console.log(contextGroupInfo.displayMetadata.name)
|
|
14703
14791
|
* console.log(contextGroupInfo.displayMetadata.color)
|
|
@@ -14786,12 +14874,12 @@ class InteropClient extends Base {
|
|
|
14786
14874
|
*
|
|
14787
14875
|
* @example
|
|
14788
14876
|
* ```js
|
|
14789
|
-
* await fin.me.interop.joinContextGroup('
|
|
14877
|
+
* await fin.me.interop.joinContextGroup('fdc3.channel.3');
|
|
14790
14878
|
* await fin.me.interop.setContext({ type: 'instrument', id: { ticker: 'FOO' }});
|
|
14791
14879
|
* const currentContext = await fin.me.interop.getCurrentContext();
|
|
14792
14880
|
*
|
|
14793
14881
|
* // with a specific context
|
|
14794
|
-
* await fin.me.interop.joinContextGroup('
|
|
14882
|
+
* await fin.me.interop.joinContextGroup('fdc3.channel.3');
|
|
14795
14883
|
* await fin.me.interop.setContext({ type: 'country', id: { ISOALPHA3: 'US' }});
|
|
14796
14884
|
* await fin.me.interop.setContext({ type: 'instrument', id: { ticker: 'FOO' }});
|
|
14797
14885
|
* const currentContext = await fin.me.interop.getCurrentContext('country');
|
|
@@ -15457,15 +15545,18 @@ class FDC3ModuleBase {
|
|
|
15457
15545
|
async joinChannel(channelId) {
|
|
15458
15546
|
this.wire.recordAnalytic('fdc3-join-channel');
|
|
15459
15547
|
try {
|
|
15548
|
+
const contextGroup = await this.client.getInfoForContextGroup(channelId);
|
|
15549
|
+
if (!contextGroup) {
|
|
15550
|
+
console.error(`No User Channel was found with the ID "${channelId}". If this is an App Channel, use getOrCreateChannel instead.`);
|
|
15551
|
+
throw new Error(ChannelError.NoChannelFound);
|
|
15552
|
+
}
|
|
15460
15553
|
return await this.client.joinContextGroup(channelId);
|
|
15461
15554
|
}
|
|
15462
15555
|
catch (error) {
|
|
15463
|
-
if (error.message ===
|
|
15464
|
-
|
|
15465
|
-
}
|
|
15466
|
-
else {
|
|
15467
|
-
console.error(error.message);
|
|
15556
|
+
if (error.message === ChannelError.NoChannelFound) {
|
|
15557
|
+
throw new Error(ChannelError.NoChannelFound);
|
|
15468
15558
|
}
|
|
15559
|
+
console.error(error.message);
|
|
15469
15560
|
if (error.message.startsWith('Attempting to join a context group that does not exist')) {
|
|
15470
15561
|
throw new Error(ChannelError.NoChannelFound);
|
|
15471
15562
|
}
|
|
@@ -16145,7 +16236,7 @@ class InteropModule extends Base {
|
|
|
16145
16236
|
* @example
|
|
16146
16237
|
* ```js
|
|
16147
16238
|
* const interopConfig = {
|
|
16148
|
-
* currentContextGroup: '
|
|
16239
|
+
* currentContextGroup: 'fdc3.channel.4'
|
|
16149
16240
|
* }
|
|
16150
16241
|
*
|
|
16151
16242
|
* const interopBroker = await fin.Interop.init('openfin');
|
|
@@ -17459,7 +17550,7 @@ class NodeEnvironment extends BaseEnvironment {
|
|
|
17459
17550
|
};
|
|
17460
17551
|
}
|
|
17461
17552
|
getAdapterVersionSync() {
|
|
17462
|
-
return "46.100.
|
|
17553
|
+
return "46.100.66";
|
|
17463
17554
|
}
|
|
17464
17555
|
observeBounds(element, onChange) {
|
|
17465
17556
|
throw new Error('Method not implemented.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfin/node-adapter",
|
|
3
|
-
"version": "46.100.
|
|
3
|
+
"version": "46.100.66",
|
|
4
4
|
"description": "See README.md",
|
|
5
5
|
"main": "out/node-adapter.js",
|
|
6
6
|
"types": "out/node-adapter.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"es-toolkit": "^1.39.3",
|
|
21
21
|
"ws": "^7.5.11",
|
|
22
22
|
"tslib": "2.8.1",
|
|
23
|
-
"@openfin/core": "46.100.
|
|
23
|
+
"@openfin/core": "46.100.66"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"prebuild": "rimraf ./out",
|