@openfin/remote-adapter 37.80.35 → 37.80.38
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.
|
@@ -7190,6 +7190,15 @@ declare class InteropBroker extends Base {
|
|
|
7190
7190
|
setContext({ context }: {
|
|
7191
7191
|
context: OpenFin.Context;
|
|
7192
7192
|
}, clientIdentity: OpenFin.ClientIdentity): void;
|
|
7193
|
+
/**
|
|
7194
|
+
* Sets a context for the context group.
|
|
7195
|
+
* @param setContextOptions - New context to set.
|
|
7196
|
+
* @param contextGroupId - Context group id.
|
|
7197
|
+
*
|
|
7198
|
+
*/
|
|
7199
|
+
setContextForGroup({ context }: {
|
|
7200
|
+
context: OpenFin.Context;
|
|
7201
|
+
}, contextGroupId: string): void;
|
|
7193
7202
|
/**
|
|
7194
7203
|
* Get current context for a client subscribed to a Context Group.
|
|
7195
7204
|
*
|
|
@@ -11978,7 +11987,7 @@ declare type PreloadScriptInfoRunning = {
|
|
|
11978
11987
|
* @interface
|
|
11979
11988
|
*/
|
|
11980
11989
|
declare type PreloadScriptsStateChangedEvent = PreloadScriptsStateChangeEvent & {
|
|
11981
|
-
type: 'preload-
|
|
11990
|
+
type: 'preload-scripts-state-changed';
|
|
11982
11991
|
};
|
|
11983
11992
|
|
|
11984
11993
|
/**
|
|
@@ -11995,7 +12004,7 @@ declare type PreloadScriptsStateChangeEvent = BaseEvent_5 & {
|
|
|
11995
12004
|
* @interface
|
|
11996
12005
|
*/
|
|
11997
12006
|
declare type PreloadScriptsStateChangingEvent = PreloadScriptsStateChangeEvent & {
|
|
11998
|
-
type: 'preload-
|
|
12007
|
+
type: 'preload-scripts-state-changing';
|
|
11999
12008
|
};
|
|
12000
12009
|
|
|
12001
12010
|
declare type PresetLayoutOptions = OpenFin.PresetLayoutOptions;
|
|
@@ -12421,6 +12430,7 @@ declare interface ProtocolMap extends ProtocolMapBase {
|
|
|
12421
12430
|
'interop-broker-remove-client-from-context-group': VoidCall;
|
|
12422
12431
|
'interop-broker-remove-from-context-group': VoidCall;
|
|
12423
12432
|
'interop-broker-set-context': VoidCall;
|
|
12433
|
+
'interop-broker-set-context-for-group': VoidCall;
|
|
12424
12434
|
'query-permission-for-current-context': {
|
|
12425
12435
|
request: {
|
|
12426
12436
|
apiName: string;
|
|
@@ -7190,6 +7190,15 @@ declare class InteropBroker extends Base {
|
|
|
7190
7190
|
setContext({ context }: {
|
|
7191
7191
|
context: OpenFin.Context;
|
|
7192
7192
|
}, clientIdentity: OpenFin.ClientIdentity): void;
|
|
7193
|
+
/**
|
|
7194
|
+
* Sets a context for the context group.
|
|
7195
|
+
* @param setContextOptions - New context to set.
|
|
7196
|
+
* @param contextGroupId - Context group id.
|
|
7197
|
+
*
|
|
7198
|
+
*/
|
|
7199
|
+
setContextForGroup({ context }: {
|
|
7200
|
+
context: OpenFin.Context;
|
|
7201
|
+
}, contextGroupId: string): void;
|
|
7193
7202
|
/**
|
|
7194
7203
|
* Get current context for a client subscribed to a Context Group.
|
|
7195
7204
|
*
|
|
@@ -11978,7 +11987,7 @@ declare type PreloadScriptInfoRunning = {
|
|
|
11978
11987
|
* @interface
|
|
11979
11988
|
*/
|
|
11980
11989
|
declare type PreloadScriptsStateChangedEvent = PreloadScriptsStateChangeEvent & {
|
|
11981
|
-
type: 'preload-
|
|
11990
|
+
type: 'preload-scripts-state-changed';
|
|
11982
11991
|
};
|
|
11983
11992
|
|
|
11984
11993
|
/**
|
|
@@ -11995,7 +12004,7 @@ declare type PreloadScriptsStateChangeEvent = BaseEvent_5 & {
|
|
|
11995
12004
|
* @interface
|
|
11996
12005
|
*/
|
|
11997
12006
|
declare type PreloadScriptsStateChangingEvent = PreloadScriptsStateChangeEvent & {
|
|
11998
|
-
type: 'preload-
|
|
12007
|
+
type: 'preload-scripts-state-changing';
|
|
11999
12008
|
};
|
|
12000
12009
|
|
|
12001
12010
|
declare type PresetLayoutOptions = OpenFin.PresetLayoutOptions;
|
|
@@ -12421,6 +12430,7 @@ declare interface ProtocolMap extends ProtocolMapBase {
|
|
|
12421
12430
|
'interop-broker-remove-client-from-context-group': VoidCall;
|
|
12422
12431
|
'interop-broker-remove-from-context-group': VoidCall;
|
|
12423
12432
|
'interop-broker-set-context': VoidCall;
|
|
12433
|
+
'interop-broker-set-context-for-group': VoidCall;
|
|
12424
12434
|
'query-permission-for-current-context': {
|
|
12425
12435
|
request: {
|
|
12426
12436
|
apiName: string;
|
|
@@ -7190,6 +7190,15 @@ declare class InteropBroker extends Base {
|
|
|
7190
7190
|
setContext({ context }: {
|
|
7191
7191
|
context: OpenFin.Context;
|
|
7192
7192
|
}, clientIdentity: OpenFin.ClientIdentity): void;
|
|
7193
|
+
/**
|
|
7194
|
+
* Sets a context for the context group.
|
|
7195
|
+
* @param setContextOptions - New context to set.
|
|
7196
|
+
* @param contextGroupId - Context group id.
|
|
7197
|
+
*
|
|
7198
|
+
*/
|
|
7199
|
+
setContextForGroup({ context }: {
|
|
7200
|
+
context: OpenFin.Context;
|
|
7201
|
+
}, contextGroupId: string): void;
|
|
7193
7202
|
/**
|
|
7194
7203
|
* Get current context for a client subscribed to a Context Group.
|
|
7195
7204
|
*
|
|
@@ -11978,7 +11987,7 @@ declare type PreloadScriptInfoRunning = {
|
|
|
11978
11987
|
* @interface
|
|
11979
11988
|
*/
|
|
11980
11989
|
declare type PreloadScriptsStateChangedEvent = PreloadScriptsStateChangeEvent & {
|
|
11981
|
-
type: 'preload-
|
|
11990
|
+
type: 'preload-scripts-state-changed';
|
|
11982
11991
|
};
|
|
11983
11992
|
|
|
11984
11993
|
/**
|
|
@@ -11995,7 +12004,7 @@ declare type PreloadScriptsStateChangeEvent = BaseEvent_5 & {
|
|
|
11995
12004
|
* @interface
|
|
11996
12005
|
*/
|
|
11997
12006
|
declare type PreloadScriptsStateChangingEvent = PreloadScriptsStateChangeEvent & {
|
|
11998
|
-
type: 'preload-
|
|
12007
|
+
type: 'preload-scripts-state-changing';
|
|
11999
12008
|
};
|
|
12000
12009
|
|
|
12001
12010
|
declare type PresetLayoutOptions = OpenFin.PresetLayoutOptions;
|
|
@@ -12421,6 +12430,7 @@ declare interface ProtocolMap extends ProtocolMapBase {
|
|
|
12421
12430
|
'interop-broker-remove-client-from-context-group': VoidCall;
|
|
12422
12431
|
'interop-broker-remove-from-context-group': VoidCall;
|
|
12423
12432
|
'interop-broker-set-context': VoidCall;
|
|
12433
|
+
'interop-broker-set-context-for-group': VoidCall;
|
|
12424
12434
|
'query-permission-for-current-context': {
|
|
12425
12435
|
request: {
|
|
12426
12436
|
apiName: string;
|
package/out/remote-adapter.d.ts
CHANGED
|
@@ -7295,6 +7295,15 @@ declare class InteropBroker extends Base {
|
|
|
7295
7295
|
setContext({ context }: {
|
|
7296
7296
|
context: OpenFin.Context;
|
|
7297
7297
|
}, clientIdentity: OpenFin.ClientIdentity): void;
|
|
7298
|
+
/**
|
|
7299
|
+
* Sets a context for the context group.
|
|
7300
|
+
* @param setContextOptions - New context to set.
|
|
7301
|
+
* @param contextGroupId - Context group id.
|
|
7302
|
+
*
|
|
7303
|
+
*/
|
|
7304
|
+
setContextForGroup({ context }: {
|
|
7305
|
+
context: OpenFin.Context;
|
|
7306
|
+
}, contextGroupId: string): void;
|
|
7298
7307
|
/**
|
|
7299
7308
|
* Get current context for a client subscribed to a Context Group.
|
|
7300
7309
|
*
|
|
@@ -12367,7 +12376,7 @@ declare type PreloadScriptInfoRunning = {
|
|
|
12367
12376
|
* @interface
|
|
12368
12377
|
*/
|
|
12369
12378
|
declare type PreloadScriptsStateChangedEvent = PreloadScriptsStateChangeEvent & {
|
|
12370
|
-
type: 'preload-
|
|
12379
|
+
type: 'preload-scripts-state-changed';
|
|
12371
12380
|
};
|
|
12372
12381
|
|
|
12373
12382
|
/**
|
|
@@ -12384,7 +12393,7 @@ declare type PreloadScriptsStateChangeEvent = BaseEvent_5 & {
|
|
|
12384
12393
|
* @interface
|
|
12385
12394
|
*/
|
|
12386
12395
|
declare type PreloadScriptsStateChangingEvent = PreloadScriptsStateChangeEvent & {
|
|
12387
|
-
type: 'preload-
|
|
12396
|
+
type: 'preload-scripts-state-changing';
|
|
12388
12397
|
};
|
|
12389
12398
|
|
|
12390
12399
|
declare type PresetLayoutOptions = OpenFin.PresetLayoutOptions;
|
|
@@ -12810,6 +12819,7 @@ declare interface ProtocolMap extends ProtocolMapBase {
|
|
|
12810
12819
|
'interop-broker-remove-client-from-context-group': VoidCall;
|
|
12811
12820
|
'interop-broker-remove-from-context-group': VoidCall;
|
|
12812
12821
|
'interop-broker-set-context': VoidCall;
|
|
12822
|
+
'interop-broker-set-context-for-group': VoidCall;
|
|
12813
12823
|
'query-permission-for-current-context': {
|
|
12814
12824
|
request: {
|
|
12815
12825
|
apiName: string;
|
package/out/remote-adapter.js
CHANGED
|
@@ -1920,27 +1920,7 @@ function requireInteropBroker () {
|
|
|
1920
1920
|
const clientState = this.getClientState(clientIdentity);
|
|
1921
1921
|
if (clientState && clientState.contextGroupId) {
|
|
1922
1922
|
const { contextGroupId } = clientState;
|
|
1923
|
-
|
|
1924
|
-
// Theoretically not possible.
|
|
1925
|
-
throw new Error(`Client has a context group that isn't in the context group mapping: ${contextGroupId}.`);
|
|
1926
|
-
}
|
|
1927
|
-
const contextIntegrityCheckResult = InteropBroker.checkContextIntegrity(context);
|
|
1928
|
-
if (contextIntegrityCheckResult.isValid === false) {
|
|
1929
|
-
throw new Error(`Failed to set Context - bad Context. Reason: ${contextIntegrityCheckResult.reason}. Context: ${JSON.stringify(context)}`);
|
|
1930
|
-
}
|
|
1931
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1932
|
-
const contextGroupState = this.contextGroupsById.get(contextGroupId);
|
|
1933
|
-
const broadcastedContextType = context.type;
|
|
1934
|
-
contextGroupState.set(broadcastedContextType, context);
|
|
1935
|
-
this.lastContextMap.set(contextGroupId, broadcastedContextType);
|
|
1936
|
-
const clientsInSameContextGroup = Array.from(this.interopClients.values()).filter((connectedClient) => connectedClient.contextGroupId === contextGroupId);
|
|
1937
|
-
clientsInSameContextGroup.forEach((client) => {
|
|
1938
|
-
for (const [, handlerInfo] of client.contextHandlers) {
|
|
1939
|
-
if (InteropBroker.isContextTypeCompatible(broadcastedContextType, handlerInfo.contextType)) {
|
|
1940
|
-
this.invokeContextHandler(client.clientIdentity, handlerInfo.handlerId, context);
|
|
1941
|
-
}
|
|
1942
|
-
}
|
|
1943
|
-
});
|
|
1923
|
+
this.setContextForGroup({ context }, contextGroupId);
|
|
1944
1924
|
}
|
|
1945
1925
|
else if (clientState) {
|
|
1946
1926
|
// Client has not joined any context group behavior.
|
|
@@ -1951,6 +1931,36 @@ function requireInteropBroker () {
|
|
|
1951
1931
|
throw new Error(`Client with Identity: ${clientIdentity.uuid} ${clientIdentity.name} not in Client State Map`);
|
|
1952
1932
|
}
|
|
1953
1933
|
}
|
|
1934
|
+
/**
|
|
1935
|
+
* Sets a context for the context group.
|
|
1936
|
+
* @param setContextOptions - New context to set.
|
|
1937
|
+
* @param contextGroupId - Context group id.
|
|
1938
|
+
*
|
|
1939
|
+
*/
|
|
1940
|
+
setContextForGroup({ context }, contextGroupId) {
|
|
1941
|
+
this.wire.sendAction('interop-broker-set-context-for-group').catch((e) => {
|
|
1942
|
+
// don't expose, analytics-only call
|
|
1943
|
+
});
|
|
1944
|
+
const contextGroupState = this.contextGroupsById.get(contextGroupId);
|
|
1945
|
+
if (!contextGroupState) {
|
|
1946
|
+
throw new Error(`Unable to set context for context group that isn't in the context group mapping: ${contextGroupId}.`);
|
|
1947
|
+
}
|
|
1948
|
+
const contextIntegrityCheckResult = InteropBroker.checkContextIntegrity(context);
|
|
1949
|
+
if (contextIntegrityCheckResult.isValid === false) {
|
|
1950
|
+
throw new Error(`Failed to set Context - bad Context. Reason: ${contextIntegrityCheckResult.reason}. Context: ${JSON.stringify(context)}`);
|
|
1951
|
+
}
|
|
1952
|
+
const broadcastedContextType = context.type;
|
|
1953
|
+
contextGroupState.set(broadcastedContextType, context);
|
|
1954
|
+
this.lastContextMap.set(contextGroupId, broadcastedContextType);
|
|
1955
|
+
const clientsInSameContextGroup = Array.from(this.interopClients.values()).filter((connectedClient) => connectedClient.contextGroupId === contextGroupId);
|
|
1956
|
+
clientsInSameContextGroup.forEach((client) => {
|
|
1957
|
+
for (const [, handlerInfo] of client.contextHandlers) {
|
|
1958
|
+
if (InteropBroker.isContextTypeCompatible(broadcastedContextType, handlerInfo.contextType)) {
|
|
1959
|
+
this.invokeContextHandler(client.clientIdentity, handlerInfo.handlerId, context);
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
});
|
|
1963
|
+
}
|
|
1954
1964
|
/**
|
|
1955
1965
|
* Get current context for a client subscribed to a Context Group.
|
|
1956
1966
|
*
|