@openfin/node-adapter 45.100.114 → 45.100.116
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 +194 -85
- package/package.json +3 -3
package/out/node-adapter.js
CHANGED
|
@@ -2350,6 +2350,47 @@ class Application extends EmitterBase {
|
|
|
2350
2350
|
constructor(wire, identity) {
|
|
2351
2351
|
super(wire, 'application', identity.uuid);
|
|
2352
2352
|
this.identity = identity;
|
|
2353
|
+
/**
|
|
2354
|
+
* @experimental
|
|
2355
|
+
* Retrieves a performance snapshot for all Windows, Views and Frames in the Application.
|
|
2356
|
+
*
|
|
2357
|
+
* By default, all custom marks and measures are collected, along with navigation/paint entries
|
|
2358
|
+
* and resource timing (`resources` defaults to `true`). Pass `include` to restrict custom
|
|
2359
|
+
* marks/measures to matching names (string substring or RegExp). Pass `browser: true` to also
|
|
2360
|
+
* include hereio internal runtime metrics.
|
|
2361
|
+
*
|
|
2362
|
+
* See also [MDN | Performance Mark API](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark)
|
|
2363
|
+
*
|
|
2364
|
+
* Note - only currently running WebContents will be captured, and performance entries can only be
|
|
2365
|
+
* captured for the current navigation of each.
|
|
2366
|
+
*/
|
|
2367
|
+
this.getPerformanceStats = async (options = {}) => {
|
|
2368
|
+
/**
|
|
2369
|
+
* Returns a filter object compatible with JSON.stringify (regexs stringify to `{}`).
|
|
2370
|
+
* @param include Array of strings or regexps.
|
|
2371
|
+
*/
|
|
2372
|
+
const getSerializableFilterObject = (include) => {
|
|
2373
|
+
return include.map((filter) => {
|
|
2374
|
+
if (filter instanceof RegExp) {
|
|
2375
|
+
return {
|
|
2376
|
+
type: 'regex',
|
|
2377
|
+
expression: filter.source,
|
|
2378
|
+
flags: filter.flags
|
|
2379
|
+
};
|
|
2380
|
+
}
|
|
2381
|
+
return filter;
|
|
2382
|
+
});
|
|
2383
|
+
};
|
|
2384
|
+
const { include, resources = true, browser = false } = options;
|
|
2385
|
+
const result = await this.wire.sendAction('get-application-performance-stats', {
|
|
2386
|
+
...this.identity,
|
|
2387
|
+
// Omit `include` when unspecified so the runtime collects all custom marks/measures.
|
|
2388
|
+
...(include !== undefined ? { include: getSerializableFilterObject(include) } : {}),
|
|
2389
|
+
resources,
|
|
2390
|
+
browser
|
|
2391
|
+
});
|
|
2392
|
+
return result.payload.data;
|
|
2393
|
+
};
|
|
2353
2394
|
this.window = new _Window(this.wire, {
|
|
2354
2395
|
uuid: this.identity.uuid,
|
|
2355
2396
|
name: this.identity.uuid
|
|
@@ -12917,6 +12958,45 @@ class PrivateChannelProvider {
|
|
|
12917
12958
|
}
|
|
12918
12959
|
}
|
|
12919
12960
|
|
|
12961
|
+
/**
|
|
12962
|
+
* The default FDC3 user channels advertised by the Interop Broker.
|
|
12963
|
+
*/
|
|
12964
|
+
const defaultColorChannels = {
|
|
12965
|
+
'fdc3.channel.1': { name: 'Channel 1', color: 'red', glyph: '1' },
|
|
12966
|
+
'fdc3.channel.2': { name: 'Channel 2', color: 'orange', glyph: '2' },
|
|
12967
|
+
'fdc3.channel.3': { name: 'Channel 3', color: 'yellow', glyph: '3' },
|
|
12968
|
+
'fdc3.channel.4': { name: 'Channel 4', color: 'green', glyph: '4' },
|
|
12969
|
+
'fdc3.channel.5': { name: 'Channel 5', color: 'cyan', glyph: '5' },
|
|
12970
|
+
'fdc3.channel.6': { name: 'Channel 6', color: 'blue', glyph: '6' },
|
|
12971
|
+
'fdc3.channel.7': { name: 'Channel 7', color: 'magenta', glyph: '7' },
|
|
12972
|
+
'fdc3.channel.8': { name: 'Channel 8', color: 'purple', glyph: '8' }
|
|
12973
|
+
};
|
|
12974
|
+
const legacyColorChannelIds = {
|
|
12975
|
+
red: 'fdc3.channel.1',
|
|
12976
|
+
orange: 'fdc3.channel.2',
|
|
12977
|
+
yellow: 'fdc3.channel.3',
|
|
12978
|
+
green: 'fdc3.channel.4',
|
|
12979
|
+
teal: 'fdc3.channel.5',
|
|
12980
|
+
blue: 'fdc3.channel.6',
|
|
12981
|
+
pink: 'fdc3.channel.7',
|
|
12982
|
+
// Legacy indigo (workspace) and purple (core) intentionally converge on the same FDC3 purple channel.
|
|
12983
|
+
indigo: 'fdc3.channel.8',
|
|
12984
|
+
purple: 'fdc3.channel.8'
|
|
12985
|
+
};
|
|
12986
|
+
/**
|
|
12987
|
+
* Converts a legacy color-named channel ID to its canonical FDC3 user-channel ID.
|
|
12988
|
+
* The removed legacy gray channel resolves to no channel.
|
|
12989
|
+
*/
|
|
12990
|
+
function normalizeColorChannelId(colorChannelId) {
|
|
12991
|
+
if (colorChannelId === 'gray') {
|
|
12992
|
+
return undefined;
|
|
12993
|
+
}
|
|
12994
|
+
if (Object.prototype.hasOwnProperty.call(legacyColorChannelIds, colorChannelId)) {
|
|
12995
|
+
return legacyColorChannelIds[colorChannelId];
|
|
12996
|
+
}
|
|
12997
|
+
return colorChannelId;
|
|
12998
|
+
}
|
|
12999
|
+
|
|
12920
13000
|
var __classPrivateFieldSet$9 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12921
13001
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
12922
13002
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
@@ -12929,50 +13009,7 @@ var __classPrivateFieldGet$9 = (undefined && undefined.__classPrivateFieldGet) |
|
|
|
12929
13009
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12930
13010
|
};
|
|
12931
13011
|
var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
|
|
12932
|
-
const defaultContextGroups = [
|
|
12933
|
-
{
|
|
12934
|
-
id: 'green',
|
|
12935
|
-
displayMetadata: {
|
|
12936
|
-
color: '#00CC88',
|
|
12937
|
-
name: 'green'
|
|
12938
|
-
}
|
|
12939
|
-
},
|
|
12940
|
-
{
|
|
12941
|
-
id: 'purple',
|
|
12942
|
-
displayMetadata: {
|
|
12943
|
-
color: '#8C61FF',
|
|
12944
|
-
name: 'purple'
|
|
12945
|
-
}
|
|
12946
|
-
},
|
|
12947
|
-
{
|
|
12948
|
-
id: 'orange',
|
|
12949
|
-
displayMetadata: {
|
|
12950
|
-
color: '#FF8C4C',
|
|
12951
|
-
name: 'orange'
|
|
12952
|
-
}
|
|
12953
|
-
},
|
|
12954
|
-
{
|
|
12955
|
-
id: 'red',
|
|
12956
|
-
displayMetadata: {
|
|
12957
|
-
color: '#FF5E60',
|
|
12958
|
-
name: 'red'
|
|
12959
|
-
}
|
|
12960
|
-
},
|
|
12961
|
-
{
|
|
12962
|
-
id: 'pink',
|
|
12963
|
-
displayMetadata: {
|
|
12964
|
-
color: '#FF8FB8',
|
|
12965
|
-
name: 'pink'
|
|
12966
|
-
}
|
|
12967
|
-
},
|
|
12968
|
-
{
|
|
12969
|
-
id: 'yellow',
|
|
12970
|
-
displayMetadata: {
|
|
12971
|
-
color: '#E9FF8F',
|
|
12972
|
-
name: 'yellow'
|
|
12973
|
-
}
|
|
12974
|
-
}
|
|
12975
|
-
];
|
|
13012
|
+
const defaultContextGroups = Object.entries(defaultColorChannels).map(([id, displayMetadata]) => ({ id, displayMetadata }));
|
|
12976
13013
|
/**
|
|
12977
13014
|
* {@link https://developers.openfin.co/of-docs/docs/enable-color-linking}
|
|
12978
13015
|
*
|
|
@@ -13002,17 +13039,19 @@ const defaultContextGroups = [
|
|
|
13002
13039
|
* "interopBrokerConfiguration": {
|
|
13003
13040
|
* "contextGroups": [
|
|
13004
13041
|
* {
|
|
13005
|
-
* "id": "
|
|
13042
|
+
* "id": "fdc3.channel.4",
|
|
13006
13043
|
* "displayMetadata": {
|
|
13007
|
-
* "color": "
|
|
13008
|
-
* "name": "
|
|
13044
|
+
* "color": "green",
|
|
13045
|
+
* "name": "Channel 4",
|
|
13046
|
+
* "glyph": "4"
|
|
13009
13047
|
* }
|
|
13010
13048
|
* },
|
|
13011
13049
|
* {
|
|
13012
|
-
* "id": "
|
|
13050
|
+
* "id": "fdc3.channel.8",
|
|
13013
13051
|
* "displayMetadata": {
|
|
13014
|
-
* "color": "
|
|
13015
|
-
* "name": "
|
|
13052
|
+
* "color": "purple",
|
|
13053
|
+
* "name": "Channel 8",
|
|
13054
|
+
* "glyph": "8"
|
|
13016
13055
|
* }
|
|
13017
13056
|
* },
|
|
13018
13057
|
* ]
|
|
@@ -13175,9 +13214,13 @@ class InteropBroker extends Base {
|
|
|
13175
13214
|
this.wire.sendAction('interop-broker-set-context-for-group').catch((e) => {
|
|
13176
13215
|
// don't expose, analytics-only call
|
|
13177
13216
|
});
|
|
13178
|
-
const
|
|
13217
|
+
const normalizedContextGroupId = this.normalizeContextGroupId(contextGroupId);
|
|
13218
|
+
if (normalizedContextGroupId === undefined) {
|
|
13219
|
+
return;
|
|
13220
|
+
}
|
|
13221
|
+
const contextGroupState = this.contextGroupsById.get(normalizedContextGroupId);
|
|
13179
13222
|
if (!contextGroupState) {
|
|
13180
|
-
throw new Error(`Unable to set context for context group that isn't in the context group mapping: ${
|
|
13223
|
+
throw new Error(`Unable to set context for context group that isn't in the context group mapping: ${normalizedContextGroupId}.`);
|
|
13181
13224
|
}
|
|
13182
13225
|
const contextIntegrityCheckResult = InteropBroker.checkContextIntegrity(context);
|
|
13183
13226
|
if (contextIntegrityCheckResult.isValid === false) {
|
|
@@ -13185,8 +13228,8 @@ class InteropBroker extends Base {
|
|
|
13185
13228
|
}
|
|
13186
13229
|
const broadcastedContextType = context.type;
|
|
13187
13230
|
contextGroupState.set(broadcastedContextType, context);
|
|
13188
|
-
this.lastContextMap.set(
|
|
13189
|
-
const clientsInSameContextGroup = Array.from(this.interopClients.values()).filter((connectedClient) => connectedClient.contextGroupId ===
|
|
13231
|
+
this.lastContextMap.set(normalizedContextGroupId, broadcastedContextType);
|
|
13232
|
+
const clientsInSameContextGroup = Array.from(this.interopClients.values()).filter((connectedClient) => connectedClient.contextGroupId === normalizedContextGroupId);
|
|
13190
13233
|
clientsInSameContextGroup.forEach((client) => {
|
|
13191
13234
|
for (const [, handlerInfo] of client.contextHandlers) {
|
|
13192
13235
|
if (InteropBroker.isContextTypeCompatible(broadcastedContextType, handlerInfo.contextType)) {
|
|
@@ -13232,10 +13275,20 @@ class InteropBroker extends Base {
|
|
|
13232
13275
|
* @param joinContextGroupOptions - Id of the Context Group and identity of the entity to join to the group.
|
|
13233
13276
|
* @param senderIdentity - Identity of the client sender.
|
|
13234
13277
|
*/
|
|
13235
|
-
async joinContextGroup({ contextGroupId, target }, senderIdentity) {
|
|
13278
|
+
async joinContextGroup({ contextGroupId: requestedContextGroupId, target }, senderIdentity) {
|
|
13236
13279
|
this.wire.sendAction('interop-broker-join-context-group').catch((e) => {
|
|
13237
13280
|
// don't expose, analytics-only call
|
|
13238
13281
|
});
|
|
13282
|
+
const contextGroupId = this.normalizeContextGroupId(requestedContextGroupId);
|
|
13283
|
+
if (contextGroupId === undefined) {
|
|
13284
|
+
if (target) {
|
|
13285
|
+
await this.removeFromContextGroup({ target }, senderIdentity);
|
|
13286
|
+
}
|
|
13287
|
+
else {
|
|
13288
|
+
await this.removeClientFromContextGroup(senderIdentity);
|
|
13289
|
+
}
|
|
13290
|
+
return;
|
|
13291
|
+
}
|
|
13239
13292
|
if (this.sessionContextGroupMap.has(contextGroupId)) {
|
|
13240
13293
|
throw new Error(BROKER_ERRORS.joinSessionContextGroupWithJoinContextGroup);
|
|
13241
13294
|
}
|
|
@@ -13277,10 +13330,15 @@ class InteropBroker extends Base {
|
|
|
13277
13330
|
* @param addClientToContextGroupOptions - Contains the contextGroupId
|
|
13278
13331
|
* @param clientIdentity - Identity of the client sender.
|
|
13279
13332
|
*/
|
|
13280
|
-
async addClientToContextGroup({ contextGroupId }, clientIdentity) {
|
|
13333
|
+
async addClientToContextGroup({ contextGroupId: requestedContextGroupId }, clientIdentity) {
|
|
13281
13334
|
this.wire.sendAction('interop-broker-add-client-to-context-group').catch((e) => {
|
|
13282
13335
|
// don't expose, analytics-only call
|
|
13283
13336
|
});
|
|
13337
|
+
const contextGroupId = this.normalizeContextGroupId(requestedContextGroupId);
|
|
13338
|
+
if (contextGroupId === undefined) {
|
|
13339
|
+
await this.removeClientFromContextGroup(clientIdentity);
|
|
13340
|
+
return;
|
|
13341
|
+
}
|
|
13284
13342
|
const clientSubscriptionState = this.getClientState(clientIdentity);
|
|
13285
13343
|
if (!clientSubscriptionState) {
|
|
13286
13344
|
throw new Error(`Client with Identity: ${clientIdentity.uuid} ${clientIdentity.name} not in Client State Map`);
|
|
@@ -13379,6 +13437,9 @@ class InteropBroker extends Base {
|
|
|
13379
13437
|
clientState.contextGroupId = undefined;
|
|
13380
13438
|
}
|
|
13381
13439
|
await this.setCurrentContextGroupInClientOptions(clientIdentity, null);
|
|
13440
|
+
if (previousContextGroupId === undefined) {
|
|
13441
|
+
return;
|
|
13442
|
+
}
|
|
13382
13443
|
// All settled will suppress uncaught exceptions. We don't want to await this because it could
|
|
13383
13444
|
// result in the operation hanging.
|
|
13384
13445
|
Promise.allSettled(this.channel.publish('client-changed-context-group', {
|
|
@@ -13416,7 +13477,11 @@ class InteropBroker extends Base {
|
|
|
13416
13477
|
this.wire.sendAction('interop-broker-get-info-for-context-group').catch((e) => {
|
|
13417
13478
|
// don't expose, analytics-only call
|
|
13418
13479
|
});
|
|
13419
|
-
|
|
13480
|
+
const normalizedContextGroupId = this.normalizeContextGroupId(contextGroupId);
|
|
13481
|
+
if (normalizedContextGroupId === undefined) {
|
|
13482
|
+
return undefined;
|
|
13483
|
+
}
|
|
13484
|
+
return this.getContextGroups().find((contextGroup) => contextGroup.id === normalizedContextGroupId);
|
|
13420
13485
|
}
|
|
13421
13486
|
// Used by platform windows to get all clients for a context group.
|
|
13422
13487
|
/**
|
|
@@ -13432,8 +13497,12 @@ class InteropBroker extends Base {
|
|
|
13432
13497
|
this.wire.sendAction('interop-broker-get-all-clients-in-context-group').catch((e) => {
|
|
13433
13498
|
// don't expose, analytics-only call
|
|
13434
13499
|
});
|
|
13500
|
+
const normalizedContextGroupId = this.normalizeContextGroupId(contextGroupId);
|
|
13501
|
+
if (normalizedContextGroupId === undefined) {
|
|
13502
|
+
return [];
|
|
13503
|
+
}
|
|
13435
13504
|
const clientsInContextGroup = Array.from(this.interopClients.values())
|
|
13436
|
-
.filter((connectedClient) => connectedClient.contextGroupId ===
|
|
13505
|
+
.filter((connectedClient) => connectedClient.contextGroupId === normalizedContextGroupId)
|
|
13437
13506
|
.map((subscriptionState) => {
|
|
13438
13507
|
return subscriptionState.clientIdentity;
|
|
13439
13508
|
});
|
|
@@ -13880,8 +13949,9 @@ class InteropBroker extends Base {
|
|
|
13880
13949
|
}
|
|
13881
13950
|
// Used to restore interop broker state in snapshots.
|
|
13882
13951
|
applySnapshot(snapshot, options) {
|
|
13883
|
-
const
|
|
13884
|
-
if (
|
|
13952
|
+
const incomingContextGroupStates = snapshot?.interopSnapshotDetails?.contextGroupStates;
|
|
13953
|
+
if (incomingContextGroupStates) {
|
|
13954
|
+
const contextGroupStates = this.normalizeContextGroupStates(incomingContextGroupStates);
|
|
13885
13955
|
if (!options?.closeExistingWindows) {
|
|
13886
13956
|
this.updateExistingClients(contextGroupStates);
|
|
13887
13957
|
}
|
|
@@ -14026,6 +14096,23 @@ class InteropBroker extends Base {
|
|
|
14026
14096
|
});
|
|
14027
14097
|
return newObject;
|
|
14028
14098
|
}
|
|
14099
|
+
normalizeContextGroupStates(incomingContextGroupStates) {
|
|
14100
|
+
const normalizedContextGroupStates = {};
|
|
14101
|
+
for (const [contextGroupId, contexts] of Object.entries(incomingContextGroupStates)) {
|
|
14102
|
+
const normalizedContextGroupId = this.normalizeContextGroupId(contextGroupId);
|
|
14103
|
+
if (normalizedContextGroupId !== undefined) {
|
|
14104
|
+
normalizedContextGroupStates[normalizedContextGroupId] = {
|
|
14105
|
+
...normalizedContextGroupStates[normalizedContextGroupId],
|
|
14106
|
+
...contexts
|
|
14107
|
+
};
|
|
14108
|
+
}
|
|
14109
|
+
}
|
|
14110
|
+
return normalizedContextGroupStates;
|
|
14111
|
+
}
|
|
14112
|
+
normalizeContextGroupId(contextGroupId) {
|
|
14113
|
+
const usesDefaultColorChannels = Object.keys(defaultColorChannels).every((defaultContextGroupId) => this.contextGroupsById.has(defaultContextGroupId));
|
|
14114
|
+
return usesDefaultColorChannels ? normalizeColorChannelId(contextGroupId) : contextGroupId;
|
|
14115
|
+
}
|
|
14029
14116
|
// Util to check a client identity.
|
|
14030
14117
|
static hasEndpointId(target) {
|
|
14031
14118
|
return target.endpointId !== undefined;
|
|
@@ -14089,8 +14176,14 @@ class InteropBroker extends Base {
|
|
|
14089
14176
|
clientIdentity
|
|
14090
14177
|
};
|
|
14091
14178
|
// Only allow the client to join a contextGroup that actually exists.
|
|
14092
|
-
|
|
14093
|
-
|
|
14179
|
+
const currentContextGroup = payload?.currentContextGroup
|
|
14180
|
+
? this.normalizeContextGroupId(payload.currentContextGroup)
|
|
14181
|
+
: undefined;
|
|
14182
|
+
if (currentContextGroup && this.contextGroupsById.has(currentContextGroup)) {
|
|
14183
|
+
clientSubscriptionState.contextGroupId = currentContextGroup;
|
|
14184
|
+
if (currentContextGroup !== payload.currentContextGroup) {
|
|
14185
|
+
await this.setCurrentContextGroupInClientOptions(clientIdentity, currentContextGroup);
|
|
14186
|
+
}
|
|
14094
14187
|
}
|
|
14095
14188
|
this.interopClients.set(clientIdentity.endpointId, clientSubscriptionState);
|
|
14096
14189
|
});
|
|
@@ -14660,7 +14753,7 @@ class InteropClient extends Base {
|
|
|
14660
14753
|
*
|
|
14661
14754
|
* getLastFocusedView()
|
|
14662
14755
|
* .then(lastFocusedViewIdentity => {
|
|
14663
|
-
* joinViewToContextGroup('
|
|
14756
|
+
* joinViewToContextGroup('fdc3.channel.1', lastFocusedViewIdentity)
|
|
14664
14757
|
* })
|
|
14665
14758
|
* ```
|
|
14666
14759
|
*/
|
|
@@ -14710,7 +14803,7 @@ class InteropClient extends Base {
|
|
|
14710
14803
|
*
|
|
14711
14804
|
* @example
|
|
14712
14805
|
* ```js
|
|
14713
|
-
* fin.me.interop.getAllClientsInContextGroup('
|
|
14806
|
+
* fin.me.interop.getAllClientsInContextGroup('fdc3.channel.1')
|
|
14714
14807
|
* .then(clientsInContextGroup => {
|
|
14715
14808
|
* console.log(clientsInContextGroup)
|
|
14716
14809
|
* })
|
|
@@ -14734,7 +14827,7 @@ class InteropClient extends Base {
|
|
|
14734
14827
|
*
|
|
14735
14828
|
* @example
|
|
14736
14829
|
* ```js
|
|
14737
|
-
* fin.me.interop.getInfoForContextGroup('
|
|
14830
|
+
* fin.me.interop.getInfoForContextGroup('fdc3.channel.1')
|
|
14738
14831
|
* .then(contextGroupInfo => {
|
|
14739
14832
|
* console.log(contextGroupInfo.displayMetadata.name)
|
|
14740
14833
|
* console.log(contextGroupInfo.displayMetadata.color)
|
|
@@ -14823,12 +14916,12 @@ class InteropClient extends Base {
|
|
|
14823
14916
|
*
|
|
14824
14917
|
* @example
|
|
14825
14918
|
* ```js
|
|
14826
|
-
* await fin.me.interop.joinContextGroup('
|
|
14919
|
+
* await fin.me.interop.joinContextGroup('fdc3.channel.3');
|
|
14827
14920
|
* await fin.me.interop.setContext({ type: 'instrument', id: { ticker: 'FOO' }});
|
|
14828
14921
|
* const currentContext = await fin.me.interop.getCurrentContext();
|
|
14829
14922
|
*
|
|
14830
14923
|
* // with a specific context
|
|
14831
|
-
* await fin.me.interop.joinContextGroup('
|
|
14924
|
+
* await fin.me.interop.joinContextGroup('fdc3.channel.3');
|
|
14832
14925
|
* await fin.me.interop.setContext({ type: 'country', id: { ISOALPHA3: 'US' }});
|
|
14833
14926
|
* await fin.me.interop.setContext({ type: 'instrument', id: { ticker: 'FOO' }});
|
|
14834
14927
|
* const currentContext = await fin.me.interop.getCurrentContext('country');
|
|
@@ -15494,15 +15587,18 @@ class FDC3ModuleBase {
|
|
|
15494
15587
|
async joinChannel(channelId) {
|
|
15495
15588
|
this.wire.recordAnalytic('fdc3-join-channel');
|
|
15496
15589
|
try {
|
|
15590
|
+
const contextGroup = await this.client.getInfoForContextGroup(channelId);
|
|
15591
|
+
if (!contextGroup) {
|
|
15592
|
+
console.error(`No User Channel was found with the ID "${channelId}". If this is an App Channel, use getOrCreateChannel instead.`);
|
|
15593
|
+
throw new Error(ChannelError.NoChannelFound);
|
|
15594
|
+
}
|
|
15497
15595
|
return await this.client.joinContextGroup(channelId);
|
|
15498
15596
|
}
|
|
15499
15597
|
catch (error) {
|
|
15500
|
-
if (error.message ===
|
|
15501
|
-
|
|
15502
|
-
}
|
|
15503
|
-
else {
|
|
15504
|
-
console.error(error.message);
|
|
15598
|
+
if (error.message === ChannelError.NoChannelFound) {
|
|
15599
|
+
throw new Error(ChannelError.NoChannelFound);
|
|
15505
15600
|
}
|
|
15601
|
+
console.error(error.message);
|
|
15506
15602
|
if (error.message.startsWith('Attempting to join a context group that does not exist')) {
|
|
15507
15603
|
throw new Error(ChannelError.NoChannelFound);
|
|
15508
15604
|
}
|
|
@@ -16182,7 +16278,7 @@ class InteropModule extends Base {
|
|
|
16182
16278
|
* @example
|
|
16183
16279
|
* ```js
|
|
16184
16280
|
* const interopConfig = {
|
|
16185
|
-
* currentContextGroup: '
|
|
16281
|
+
* currentContextGroup: 'fdc3.channel.4'
|
|
16186
16282
|
* }
|
|
16187
16283
|
*
|
|
16188
16284
|
* const interopBroker = await fin.Interop.init('openfin');
|
|
@@ -17178,6 +17274,30 @@ class BufferReader {
|
|
|
17178
17274
|
}
|
|
17179
17275
|
}
|
|
17180
17276
|
|
|
17277
|
+
/**
|
|
17278
|
+
* Optional `platform` avoids stubbing os.platform in tests.
|
|
17279
|
+
* On macOS, the RVM appends --security-realm=standalone_app_<hash> for
|
|
17280
|
+
* standalone-app launches (see RuntimeManagerMac), overriding the
|
|
17281
|
+
* manifest realm. Accept these standalone_app_* realms as valid when the
|
|
17282
|
+
* runtime version matches so port discovery succeeds on macOS.
|
|
17283
|
+
*/
|
|
17284
|
+
function matchRuntimeInstance(config, message, platform = os__namespace.platform()) {
|
|
17285
|
+
const args = config.runtime.arguments || '';
|
|
17286
|
+
const realm = config.runtime.securityRealm || (args.split('--security-realm=')[1] || '').split(' ')[0];
|
|
17287
|
+
if (config.runtime.version && realm) {
|
|
17288
|
+
const versionMatch = config.runtime.version === message.requestedVersion;
|
|
17289
|
+
const realmMatch = realm === message.securityRealm ||
|
|
17290
|
+
(platform === 'darwin' &&
|
|
17291
|
+
typeof message.securityRealm === 'string' &&
|
|
17292
|
+
message.securityRealm.startsWith('standalone_app_'));
|
|
17293
|
+
return versionMatch && realmMatch;
|
|
17294
|
+
}
|
|
17295
|
+
if (config.runtime.version) {
|
|
17296
|
+
return config.runtime.version === message.requestedVersion && !message.securityRealm;
|
|
17297
|
+
}
|
|
17298
|
+
return false;
|
|
17299
|
+
}
|
|
17300
|
+
|
|
17181
17301
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
17182
17302
|
const launcher = new Launcher();
|
|
17183
17303
|
// value for message_type
|
|
@@ -17192,17 +17312,6 @@ var DiscoverState;
|
|
|
17192
17312
|
DiscoverState[DiscoverState["HELLO"] = 1] = "HELLO";
|
|
17193
17313
|
DiscoverState[DiscoverState["PORT_MESSAGE"] = 2] = "PORT_MESSAGE";
|
|
17194
17314
|
})(DiscoverState || (DiscoverState = {}));
|
|
17195
|
-
function matchRuntimeInstance(config, message) {
|
|
17196
|
-
const args = config.runtime.arguments || '';
|
|
17197
|
-
const realm = config.runtime.securityRealm || (args.split('--security-realm=')[1] || '').split(' ')[0];
|
|
17198
|
-
if (config.runtime.version && realm) {
|
|
17199
|
-
return config.runtime.version === message.requestedVersion && realm === message.securityRealm;
|
|
17200
|
-
}
|
|
17201
|
-
if (config.runtime.version) {
|
|
17202
|
-
return config.runtime.version === message.requestedVersion && !message.securityRealm;
|
|
17203
|
-
}
|
|
17204
|
-
return false;
|
|
17205
|
-
}
|
|
17206
17315
|
function generateManifest(config) {
|
|
17207
17316
|
const manifest = {
|
|
17208
17317
|
devtools_port: config.devToolsPort,
|
|
@@ -17483,7 +17592,7 @@ class NodeEnvironment extends BaseEnvironment {
|
|
|
17483
17592
|
};
|
|
17484
17593
|
}
|
|
17485
17594
|
getAdapterVersionSync() {
|
|
17486
|
-
return "45.100.
|
|
17595
|
+
return "45.100.116";
|
|
17487
17596
|
}
|
|
17488
17597
|
observeBounds(element, onChange) {
|
|
17489
17598
|
throw new Error('Method not implemented.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfin/node-adapter",
|
|
3
|
-
"version": "45.100.
|
|
3
|
+
"version": "45.100.116",
|
|
4
4
|
"description": "See README.md",
|
|
5
5
|
"main": "out/node-adapter.js",
|
|
6
6
|
"types": "out/node-adapter.d.ts",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@types/node": "^20.14.2",
|
|
20
20
|
"es-toolkit": "^1.39.3",
|
|
21
|
-
"ws": "^7.5.
|
|
21
|
+
"ws": "^7.5.11",
|
|
22
22
|
"tslib": "2.8.1",
|
|
23
|
-
"@openfin/core": "45.100.
|
|
23
|
+
"@openfin/core": "45.100.116"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"prebuild": "rimraf ./out",
|