@openfin/core 30.73.28 → 30.74.7
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/LICENSE.md +4 -0
- package/package.json +2 -2
- package/src/OpenFin.d.ts +1726 -189
- package/src/OpenFin.js +3 -2
- package/src/api/api-exposer/api-consumer.d.ts +28 -0
- package/src/api/api-exposer/api-consumer.js +28 -0
- package/src/api/api-exposer/api-exposer.d.ts +35 -0
- package/src/api/api-exposer/api-exposer.js +38 -0
- package/src/api/api-exposer/decorators.d.ts +10 -0
- package/src/api/api-exposer/decorators.js +18 -0
- package/src/api/api-exposer/index.d.ts +4 -0
- package/src/api/api-exposer/index.js +20 -0
- package/src/api/api-exposer/strategies/index.d.ts +1 -0
- package/src/api/api-exposer/strategies/index.js +17 -0
- package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.d.ts +14 -0
- package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.js +20 -0
- package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.d.ts +20 -0
- package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.js +23 -0
- package/src/api/api-exposer/strategies/openfin-channels/index.d.ts +2 -0
- package/src/api/api-exposer/strategies/openfin-channels/index.js +18 -0
- package/src/api/application/Factory.d.ts +1 -0
- package/src/api/application/Factory.js +1 -0
- package/src/api/application/Instance.d.ts +2 -1
- package/src/api/application/Instance.js +1 -0
- package/src/api/base.d.ts +2 -2
- package/src/api/clipboard/index.d.ts +1 -0
- package/src/api/clipboard/index.js +1 -0
- package/src/api/events/base.d.ts +0 -3
- package/src/api/events/platform.d.ts +4 -5
- package/src/api/events/system.d.ts +5 -6
- package/src/api/events/view.d.ts +6 -3
- package/src/api/events/webcontents.d.ts +25 -3
- package/src/api/events/window.d.ts +21 -13
- package/src/api/external-application/Instance.d.ts +1 -1
- package/src/api/fin.d.ts +1 -1
- package/src/api/frame/Instance.d.ts +1 -1
- package/src/api/global-hotkey/index.d.ts +1 -1
- package/src/api/interappbus/channel/channel.d.ts +1 -1
- package/src/api/interappbus/channel/channels-docs.d.ts +7 -0
- package/src/api/interappbus/channel/channels-docs.js +7 -0
- package/src/api/interappbus/channel/client.d.ts +3 -2
- package/src/api/interappbus/channel/client.js +12 -5
- package/src/api/interappbus/channel/connection-manager.d.ts +1 -1
- package/src/api/interappbus/channel/index.d.ts +1 -1
- package/src/api/interappbus/channel/index.js +6 -8
- package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +1 -1
- package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +1 -1
- package/src/api/interappbus/channel/protocols/index.d.ts +3 -0
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +10 -2
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +1 -1
- package/src/api/interappbus/channel/protocols/rtc/strategy.js +1 -1
- package/src/api/interappbus/channel/provider.d.ts +1 -1
- package/src/api/interappbus/index.d.ts +1 -1
- package/src/api/interop/Factory.d.ts +1 -2
- package/src/api/interop/Factory.js +20 -4
- package/src/api/interop/InteropBroker.d.ts +15 -47
- package/src/api/interop/InteropBroker.js +38 -46
- package/src/api/interop/InteropClient.d.ts +10 -9
- package/src/api/interop/InteropClient.js +9 -8
- package/src/api/interop/SessionContextGroupClient.d.ts +1 -1
- package/src/api/interop/fdc3/PrivateChannelClient.d.ts +1 -0
- package/src/api/interop/fdc3/PrivateChannelClient.js +15 -7
- package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +15 -1
- package/src/api/interop/fdc3/PrivateChannelProvider.js +80 -21
- package/src/api/interop/fdc3/fdc3-1.2.js +27 -12
- package/src/api/interop/fdc3/fdc3-2.0.d.ts +13 -12
- package/src/api/interop/fdc3/fdc3-2.0.js +33 -26
- package/src/api/interop/fdc3/fdc3.d.ts +4 -5
- package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
- package/src/api/interop/fdc3/overrideCheck.js +32 -0
- package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +1 -1
- package/src/api/interop/fdc3/utils.d.ts +17 -0
- package/src/api/interop/fdc3/utils.js +52 -18
- package/src/api/interop/fdc3/versions.d.ts +1 -0
- package/src/api/interop/fdc3/versions.js +2 -0
- package/src/api/me.d.ts +1 -1
- package/src/api/platform/Factory.d.ts +6 -1
- package/src/api/platform/Factory.js +5 -0
- package/src/api/platform/Instance.d.ts +5 -3
- package/src/api/platform/Instance.js +5 -3
- package/src/api/platform/layout/Factory.d.ts +4 -0
- package/src/api/platform/layout/Factory.js +15 -3
- package/src/api/platform/layout/Instance.d.ts +7 -1
- package/src/api/platform/layout/Instance.js +26 -1
- package/src/api/platform/layout/controllers/layout-content-cache.d.ts +9 -0
- package/src/api/platform/layout/controllers/layout-content-cache.js +54 -0
- package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +117 -0
- package/src/api/platform/layout/controllers/layout-entities-controller.js +270 -0
- package/src/api/platform/layout/entities/layout-entities.d.ts +144 -0
- package/src/api/platform/layout/entities/layout-entities.js +216 -0
- package/src/api/platform/layout/entities/shapes.d.ts +6 -0
- package/src/api/platform/layout/entities/shapes.js +2 -0
- package/src/api/platform/layout/layout.constants.d.ts +1 -0
- package/src/api/platform/layout/layout.constants.js +4 -0
- package/src/api/platform/layout/shapes.d.ts +3 -0
- package/src/api/platform/layout/utils/layout-traversal.d.ts +4 -0
- package/src/api/platform/layout/utils/layout-traversal.js +65 -0
- package/src/api/platform/layout/utils/view-overlay.d.ts +1 -1
- package/src/api/platform/provider.d.ts +162 -0
- package/src/api/platform/provider.js +2 -0
- package/src/api/snapshot-source/Factory.d.ts +1 -0
- package/src/api/snapshot-source/Factory.js +1 -0
- package/src/api/snapshot-source/Instance.d.ts +1 -1
- package/src/api/system/index.d.ts +1 -471
- package/src/api/system/index.js +6 -476
- package/src/api/view/Instance.d.ts +24 -5
- package/src/api/view/Instance.js +53 -8
- package/src/api/webcontents/main.d.ts +18 -4
- package/src/api/window/Instance.d.ts +26 -1
- package/src/api/window/Instance.js +25 -0
- package/src/browser.js +1 -1
- package/src/mock.js +1 -1
- package/src/namespaces.d.ts +21 -0
- package/src/namespaces.js +24 -0
- package/src/transport/fin_store.d.ts +1 -1
- package/src/transport/transport-errors.d.ts +6 -1
- package/src/transport/transport-errors.js +1 -2
- package/src/transport/transport.d.ts +9 -6
- package/src/transport/transport.js +11 -2
- package/src/util/channel-api-relay.d.ts +13 -0
- package/src/util/channel-api-relay.js +37 -0
- package/src/util/inaccessibleObject.d.ts +2 -0
- package/src/util/inaccessibleObject.js +49 -0
- package/src/util/lazy.d.ts +16 -0
- package/src/util/lazy.js +26 -0
- package/src/util/reversible-map.d.ts +11 -0
- package/src/util/reversible-map.js +49 -0
package/src/api/fin.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
import type * as OpenFin from '../OpenFin';
|
|
4
|
-
import Transport from '../transport/transport';
|
|
4
|
+
import { Transport } from '../transport/transport';
|
|
5
5
|
import System from './system/index';
|
|
6
6
|
import _WindowModule from './window/index';
|
|
7
7
|
import ApplicationModule from './application/index';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as OpenFin from '../../OpenFin';
|
|
2
2
|
import { EmitterBase } from '../base';
|
|
3
|
-
import Transport from '../../transport/transport';
|
|
3
|
+
import { Transport } from '../../transport/transport';
|
|
4
4
|
/**
|
|
5
5
|
* The GlobalHotkey module can register/unregister a global hotkeys.
|
|
6
6
|
* @namespace
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as OpenFin from '../../../OpenFin';
|
|
2
|
-
import Transport from '../../../transport/transport';
|
|
2
|
+
import { Transport } from '../../../transport/transport';
|
|
3
3
|
declare type ProviderIdentity = OpenFin.ProviderIdentity;
|
|
4
4
|
declare type ChannelMiddleware = OpenFin.ChannelMiddleware;
|
|
5
5
|
declare type ErrorMiddleware = OpenFin.ErrorMiddleware;
|
|
@@ -278,6 +278,7 @@ declare class ChannelClient {
|
|
|
278
278
|
* @param {any} payload - Payload sent with connection request.
|
|
279
279
|
*/
|
|
280
280
|
/**
|
|
281
|
+
* @REMOVED
|
|
281
282
|
* Callback for onChannelConnect or onChannelDisconnect.
|
|
282
283
|
* @typedef {object} InterApplicationBus.Channel~ConnectionEvent
|
|
283
284
|
* @property {string} channelId - Identifier of the channel.
|
|
@@ -286,17 +287,20 @@ declare class ChannelClient {
|
|
|
286
287
|
* @property {string} channelName - Name of the channel.
|
|
287
288
|
*/
|
|
288
289
|
/**
|
|
290
|
+
* @PORTED
|
|
289
291
|
* Protocol values for determining channel messaging strategy.
|
|
290
292
|
* @typedef {('classic' | 'rtc')} InterApplicationBus.Channel~MessagingProtocols - EXPERIMENTAL
|
|
291
293
|
*
|
|
292
294
|
*/
|
|
293
295
|
/**
|
|
296
|
+
* @PORTED
|
|
294
297
|
* Channel provider creation options.
|
|
295
298
|
* @typedef {object} InterApplicationBus.Channel~ChannelCreateOptions
|
|
296
299
|
* @property {InterApplicationBus.Channel~MessagingProtocols[]} [protocols=['classic']] - EXPERIMENTAL: Messaging protocols supported by the channel provider.
|
|
297
300
|
*
|
|
298
301
|
*/
|
|
299
302
|
/**
|
|
303
|
+
* @PORTED
|
|
300
304
|
* Options provided on a client connection to a channel.
|
|
301
305
|
* @typedef {object} InterApplicationBus.Channel~ChannelConnectOptions
|
|
302
306
|
* @property {InterApplicationBus.Channel~MessagingProtocols[]} [protocols=['classic']] - EXPERIMENTAL: Messaging protocols requested by the client, connection will fail if the provider protocols are not compatible.
|
|
@@ -305,6 +309,7 @@ declare class ChannelClient {
|
|
|
305
309
|
*
|
|
306
310
|
*/
|
|
307
311
|
/**
|
|
312
|
+
* @PORTED
|
|
308
313
|
* Provider Identity.
|
|
309
314
|
* @typedef {object} InterApplicationBus.Channel~ProviderIdentity
|
|
310
315
|
* @property {string} uuid - Channel provider uuid.
|
|
@@ -315,6 +320,7 @@ declare class ChannelClient {
|
|
|
315
320
|
*
|
|
316
321
|
*/
|
|
317
322
|
/**
|
|
323
|
+
* @PORTED
|
|
318
324
|
* Client Identity.
|
|
319
325
|
* @typedef {object} InterApplicationBus.Channel~ClientIdentity
|
|
320
326
|
* @property {string} uuid - Channel client uuid.
|
|
@@ -323,6 +329,7 @@ declare class ChannelClient {
|
|
|
323
329
|
*
|
|
324
330
|
*/
|
|
325
331
|
/**
|
|
332
|
+
* @PORTED
|
|
326
333
|
* Extended Client Information
|
|
327
334
|
* @typedef {object} InterApplicationBus.Channel~ClientInfo
|
|
328
335
|
* @property {string} uuid - Channel client uuid
|
|
@@ -336,6 +336,7 @@ class ChannelClient {
|
|
|
336
336
|
* @param {any} payload - Payload sent with connection request.
|
|
337
337
|
*/
|
|
338
338
|
/**
|
|
339
|
+
* @REMOVED
|
|
339
340
|
* Callback for onChannelConnect or onChannelDisconnect.
|
|
340
341
|
* @typedef {object} InterApplicationBus.Channel~ConnectionEvent
|
|
341
342
|
* @property {string} channelId - Identifier of the channel.
|
|
@@ -344,17 +345,20 @@ class ChannelClient {
|
|
|
344
345
|
* @property {string} channelName - Name of the channel.
|
|
345
346
|
*/
|
|
346
347
|
/**
|
|
348
|
+
* @PORTED
|
|
347
349
|
* Protocol values for determining channel messaging strategy.
|
|
348
350
|
* @typedef {('classic' | 'rtc')} InterApplicationBus.Channel~MessagingProtocols - EXPERIMENTAL
|
|
349
351
|
*
|
|
350
352
|
*/
|
|
351
353
|
/**
|
|
354
|
+
* @PORTED
|
|
352
355
|
* Channel provider creation options.
|
|
353
356
|
* @typedef {object} InterApplicationBus.Channel~ChannelCreateOptions
|
|
354
357
|
* @property {InterApplicationBus.Channel~MessagingProtocols[]} [protocols=['classic']] - EXPERIMENTAL: Messaging protocols supported by the channel provider.
|
|
355
358
|
*
|
|
356
359
|
*/
|
|
357
360
|
/**
|
|
361
|
+
* @PORTED
|
|
358
362
|
* Options provided on a client connection to a channel.
|
|
359
363
|
* @typedef {object} InterApplicationBus.Channel~ChannelConnectOptions
|
|
360
364
|
* @property {InterApplicationBus.Channel~MessagingProtocols[]} [protocols=['classic']] - EXPERIMENTAL: Messaging protocols requested by the client, connection will fail if the provider protocols are not compatible.
|
|
@@ -363,6 +367,7 @@ class ChannelClient {
|
|
|
363
367
|
*
|
|
364
368
|
*/
|
|
365
369
|
/**
|
|
370
|
+
* @PORTED
|
|
366
371
|
* Provider Identity.
|
|
367
372
|
* @typedef {object} InterApplicationBus.Channel~ProviderIdentity
|
|
368
373
|
* @property {string} uuid - Channel provider uuid.
|
|
@@ -373,6 +378,7 @@ class ChannelClient {
|
|
|
373
378
|
*
|
|
374
379
|
*/
|
|
375
380
|
/**
|
|
381
|
+
* @PORTED
|
|
376
382
|
* Client Identity.
|
|
377
383
|
* @typedef {object} InterApplicationBus.Channel~ClientIdentity
|
|
378
384
|
* @property {string} uuid - Channel client uuid.
|
|
@@ -381,6 +387,7 @@ class ChannelClient {
|
|
|
381
387
|
*
|
|
382
388
|
*/
|
|
383
389
|
/**
|
|
390
|
+
* @PORTED
|
|
384
391
|
* Extended Client Information
|
|
385
392
|
* @typedef {object} InterApplicationBus.Channel~ClientInfo
|
|
386
393
|
* @property {string} uuid - Channel client uuid
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as OpenFin from '../../../OpenFin';
|
|
2
2
|
import { ChannelBase } from './channel';
|
|
3
|
-
import Transport from '../../../transport/transport';
|
|
3
|
+
import { Transport } from '../../../transport/transport';
|
|
4
4
|
import { AnyStrategy } from './protocols/strategy-types';
|
|
5
5
|
declare type ProviderIdentity = OpenFin.ProviderIdentity;
|
|
6
6
|
declare type DisconnectionListener = (providerIdentity: ProviderIdentity) => any;
|
|
@@ -12,12 +12,13 @@ export default class ChannelClient extends ChannelBase {
|
|
|
12
12
|
private disconnectListener;
|
|
13
13
|
private endpointId;
|
|
14
14
|
static closeChannelByEndpointId(id: string): void;
|
|
15
|
-
static handleProviderDisconnect(
|
|
15
|
+
static handleProviderDisconnect(eventPayload: ProviderIdentity): void;
|
|
16
16
|
constructor(routingInfo: RoutingInfo, wire: Transport, strategy: AnyStrategy);
|
|
17
17
|
protected processAction: (action: string, payload: any, senderIdentity: ProviderIdentity | OpenFin.ClientIdentity) => Promise<any>;
|
|
18
18
|
get providerIdentity(): ProviderIdentity;
|
|
19
19
|
dispatch(action: string, payload?: any): Promise<any>;
|
|
20
20
|
onDisconnection(listener: DisconnectionListener): void;
|
|
21
21
|
disconnect(): Promise<void>;
|
|
22
|
+
sendDisconnectAction(): Promise<void>;
|
|
22
23
|
}
|
|
23
24
|
export {};
|
|
@@ -38,10 +38,14 @@ class ChannelClient extends channel_1.ChannelBase {
|
|
|
38
38
|
__classPrivateFieldGet(channel, _ChannelClient_close, "f").call(channel);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
// closes the channel and invokes the disconnect listener if an event payload is passed.
|
|
42
|
-
static handleProviderDisconnect(
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
// closes the corresponding channel and invokes the disconnect listener if an event payload is passed.
|
|
42
|
+
static handleProviderDisconnect(eventPayload) {
|
|
43
|
+
for (const channelClient of channelClientsByEndpointId.values()) {
|
|
44
|
+
if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
|
|
45
|
+
channelClient.disconnectListener(eventPayload);
|
|
46
|
+
__classPrivateFieldGet(channelClient, _ChannelClient_close, "f").call(channelClient);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
45
49
|
}
|
|
46
50
|
get providerIdentity() {
|
|
47
51
|
const protectedObj = __classPrivateFieldGet(this, _ChannelClient_protectedObj, "f");
|
|
@@ -67,6 +71,10 @@ class ChannelClient extends channel_1.ChannelBase {
|
|
|
67
71
|
};
|
|
68
72
|
}
|
|
69
73
|
async disconnect() {
|
|
74
|
+
await this.sendDisconnectAction();
|
|
75
|
+
__classPrivateFieldGet(this, _ChannelClient_close, "f").call(this);
|
|
76
|
+
}
|
|
77
|
+
async sendDisconnectAction() {
|
|
70
78
|
const protectedObj = __classPrivateFieldGet(this, _ChannelClient_protectedObj, "f");
|
|
71
79
|
const { channelName, uuid, name } = protectedObj.providerIdentity;
|
|
72
80
|
await protectedObj.wire.sendAction('disconnect-from-channel', {
|
|
@@ -75,7 +83,6 @@ class ChannelClient extends channel_1.ChannelBase {
|
|
|
75
83
|
name,
|
|
76
84
|
endpointId: this.endpointId
|
|
77
85
|
});
|
|
78
|
-
__classPrivateFieldGet(this, _ChannelClient_close, "f").call(this);
|
|
79
86
|
}
|
|
80
87
|
}
|
|
81
88
|
exports.default = ChannelClient;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as OpenFin from '../../../OpenFin';
|
|
2
2
|
import { ChannelMessage } from '.';
|
|
3
|
-
import Transport from '../../../transport/transport';
|
|
3
|
+
import { Transport } from '../../../transport/transport';
|
|
4
4
|
import { Base } from '../../base';
|
|
5
5
|
import { ClientOffer, LocalSupportedProtocol } from './protocols/index';
|
|
6
6
|
import { RTCPacket } from './protocols/rtc/endpoint';
|
|
@@ -2,7 +2,7 @@ import type * as OpenFin from '../../../OpenFin';
|
|
|
2
2
|
import ChannelClient from './client';
|
|
3
3
|
import { ChannelProvider } from './provider';
|
|
4
4
|
import { EmitterBase } from '../../base';
|
|
5
|
-
import Transport,
|
|
5
|
+
import { Transport, Message } from '../../../transport/transport';
|
|
6
6
|
import { ChannelEvent } from '../../events/channel';
|
|
7
7
|
declare type ProviderIdentity = OpenFin.ProviderIdentity;
|
|
8
8
|
declare type Identity = OpenFin.Identity;
|
|
@@ -25,6 +25,9 @@ class Channel extends base_1.EmitterBase {
|
|
|
25
25
|
super(wire, 'channel');
|
|
26
26
|
_Channel_connectionManager.set(this, void 0);
|
|
27
27
|
__classPrivateFieldSet(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
|
|
28
|
+
this.on('disconnected', (eventPayload) => {
|
|
29
|
+
client_1.default.handleProviderDisconnect(eventPayload);
|
|
30
|
+
}).catch((e) => console.error('Error setting up a disconnected listener:', e));
|
|
28
31
|
}
|
|
29
32
|
async getAllChannels() {
|
|
30
33
|
return this.wire.sendAction('get-all-channels').then(({ payload }) => payload.data);
|
|
@@ -59,7 +62,7 @@ class Channel extends base_1.EmitterBase {
|
|
|
59
62
|
if (entityType === 'iframe') {
|
|
60
63
|
// @ts-expect-error
|
|
61
64
|
// TODO: type this correctly (frame types are broken)
|
|
62
|
-
|
|
65
|
+
connectionUrl = (await this.fin.me.getInfo()).url;
|
|
63
66
|
}
|
|
64
67
|
else if (entityType === 'window' || entityType === 'view') {
|
|
65
68
|
connectionUrl = (await this.fin.me.getInfo()).url;
|
|
@@ -83,18 +86,13 @@ class Channel extends base_1.EmitterBase {
|
|
|
83
86
|
// The provider does not care about endpoint disconnection.
|
|
84
87
|
strategy.onEndpointDisconnect(routingInfo.channelId, async () => {
|
|
85
88
|
try {
|
|
86
|
-
await channel.
|
|
89
|
+
await channel.sendDisconnectAction();
|
|
87
90
|
}
|
|
88
91
|
catch (error) {
|
|
89
92
|
console.warn(`Something went wrong during disconnect for client with uuid: ${routingInfo.uuid} / name: ${routingInfo.name} / endpointId: ${routingInfo.endpointId}.`);
|
|
90
93
|
}
|
|
91
94
|
finally {
|
|
92
|
-
client_1.default.handleProviderDisconnect(
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
this.on('disconnected', (eventPayload) => {
|
|
96
|
-
if (eventPayload.channelName === channelName) {
|
|
97
|
-
client_1.default.handleProviderDisconnect(channel, eventPayload);
|
|
95
|
+
client_1.default.handleProviderDisconnect(routingInfo);
|
|
98
96
|
}
|
|
99
97
|
});
|
|
100
98
|
return channel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as OpenFin from '../../../../../OpenFin';
|
|
2
|
-
import Transport from '../../../../../transport/transport';
|
|
2
|
+
import { Transport } from '../../../../../transport/transport';
|
|
3
3
|
import { MessageReceiver } from './message-receiver';
|
|
4
4
|
import { ChannelStrategy, EndpointPayload } from '../strategy';
|
|
5
5
|
import { LocalSupportedProtocol } from '..';
|
|
@@ -15,6 +15,9 @@ export interface RTCProtocolOffer extends ProtocolPacketBase {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
export declare type ProtocolOffer = ClassicProtocolOffer | RTCProtocolOffer;
|
|
18
|
+
/**
|
|
19
|
+
* Protocol values for determining channel messaging strategy.
|
|
20
|
+
*/
|
|
18
21
|
export declare type MessagingProtocols = ProtocolOffer['type'];
|
|
19
22
|
export declare type LocalSupportedProtocol = {
|
|
20
23
|
type: MessagingProtocols;
|
|
@@ -51,7 +51,11 @@ class RTCEndpoint {
|
|
|
51
51
|
};
|
|
52
52
|
this.rtc.channels.response.addEventListener('message', (e) => {
|
|
53
53
|
var _a;
|
|
54
|
-
|
|
54
|
+
let { data } = e;
|
|
55
|
+
if (e.data instanceof ArrayBuffer) {
|
|
56
|
+
data = new TextDecoder().decode(e.data);
|
|
57
|
+
}
|
|
58
|
+
const { messageId, payload, success, error } = JSON.parse(data);
|
|
55
59
|
const { resolve, reject } = (_a = this.responseMap.get(messageId)) !== null && _a !== void 0 ? _a : {};
|
|
56
60
|
if (resolve && reject) {
|
|
57
61
|
this.responseMap.delete(messageId);
|
|
@@ -68,7 +72,11 @@ class RTCEndpoint {
|
|
|
68
72
|
}
|
|
69
73
|
});
|
|
70
74
|
this.rtc.channels.request.addEventListener('message', async (e) => {
|
|
71
|
-
|
|
75
|
+
let { data } = e;
|
|
76
|
+
if (e.data instanceof ArrayBuffer) {
|
|
77
|
+
data = new TextDecoder().decode(e.data);
|
|
78
|
+
}
|
|
79
|
+
const { messageId, action, payload } = JSON.parse(data);
|
|
72
80
|
if (__classPrivateFieldGet(this, _RTCEndpoint_processAction, "f")) {
|
|
73
81
|
try {
|
|
74
82
|
const res = await __classPrivateFieldGet(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Transport from '../../../../../transport/transport';
|
|
1
|
+
import { Transport } from '../../../../../transport/transport';
|
|
2
2
|
import { EmitterBase } from '../../../../base';
|
|
3
3
|
import { RTCEndpointChannels } from './endpoint';
|
|
4
4
|
export declare class RTCICEManager extends EmitterBase<any> {
|
|
@@ -82,4 +82,4 @@ class RTCStrategy {
|
|
|
82
82
|
}
|
|
83
83
|
exports.RTCStrategy = RTCStrategy;
|
|
84
84
|
_RTCStrategy_processAction = new WeakMap(), _RTCStrategy_rtcEndpointMap = new WeakMap(), _RTCStrategy_connected = new WeakMap();
|
|
85
|
-
exports.RTCInfo = { version:
|
|
85
|
+
exports.RTCInfo = { version: 2, minimumVersion: 0, type: 'rtc' };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as OpenFin from '../../../OpenFin';
|
|
2
2
|
import { ChannelBase } from './channel';
|
|
3
|
-
import Transport from '../../../transport/transport';
|
|
3
|
+
import { Transport } from '../../../transport/transport';
|
|
4
4
|
import { AnyStrategy } from './protocols/strategy-types';
|
|
5
5
|
declare type ProviderIdentity = OpenFin.ProviderIdentity;
|
|
6
6
|
declare type ClientIdentity = OpenFin.ClientIdentity;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
import { Base } from '../base';
|
|
4
|
-
import Transport,
|
|
4
|
+
import { Transport, Message } from '../../transport/transport';
|
|
5
5
|
import { Channel } from './channel/index';
|
|
6
6
|
/**
|
|
7
7
|
* A messaging bus that allows for pub/sub messaging between different applications.
|
|
@@ -3,6 +3,7 @@ import { Base } from '../base';
|
|
|
3
3
|
import { InteropBroker } from './InteropBroker';
|
|
4
4
|
import { InteropClient } from './InteropClient';
|
|
5
5
|
/**
|
|
6
|
+
* @PORTED
|
|
6
7
|
* @typedef { object } InteropConfig
|
|
7
8
|
* @summary Information relevant to the Interop Broker.
|
|
8
9
|
* @property {string} [currentContextGroup] Context Group for the client. (green, yellow, red, etc.)
|
|
@@ -20,7 +21,6 @@ export default class InteropModule extends Base {
|
|
|
20
21
|
* @param { OverrideCallback<InteropBroker> } [override] - A callback function that can be used to extend or replace default Interop Broker behavior.
|
|
21
22
|
* @return {Promise.<InteropBroker>}
|
|
22
23
|
* @tutorial Interop.init
|
|
23
|
-
* @experimental
|
|
24
24
|
* @static
|
|
25
25
|
*/
|
|
26
26
|
init(name: string, override?: OpenFin.OverrideCallback<InteropBroker>): Promise<InteropBroker>;
|
|
@@ -31,7 +31,6 @@ export default class InteropModule extends Base {
|
|
|
31
31
|
* what context(s) the entity wants to subscribe to, and the current Context Group of the entity.
|
|
32
32
|
* @return {InteropClient}
|
|
33
33
|
* @tutorial Interop.connectSync
|
|
34
|
-
* @experimental
|
|
35
34
|
* @static
|
|
36
35
|
*/
|
|
37
36
|
connectSync(name: string, interopConfig?: OpenFin.InteropConfig): InteropClient;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lodash_1 = require("lodash");
|
|
4
|
+
const inaccessibleObject_1 = require("../../util/inaccessibleObject");
|
|
3
5
|
const base_1 = require("../base");
|
|
4
6
|
const InteropBroker_1 = require("./InteropBroker");
|
|
5
7
|
const InteropClient_1 = require("./InteropClient");
|
|
6
|
-
const
|
|
8
|
+
const overrideCheck_1 = require("./fdc3/overrideCheck");
|
|
9
|
+
const defaultOverride = (Class) => new Class();
|
|
10
|
+
const BrokerParamAccessError = 'You have attempted to use or modify InteropBroker parameters, which is not allowed. You are likely using an older InteropBroker override scheme. Please consult our Interop docs for guidance on migrating to the new override scheme.';
|
|
7
11
|
/**
|
|
12
|
+
* @PORTED
|
|
8
13
|
* @typedef { object } InteropConfig
|
|
9
14
|
* @summary Information relevant to the Interop Broker.
|
|
10
15
|
* @property {string} [currentContextGroup] Context Group for the client. (green, yellow, red, etc.)
|
|
@@ -22,15 +27,18 @@ class InteropModule extends base_1.Base {
|
|
|
22
27
|
* @param { OverrideCallback<InteropBroker> } [override] - A callback function that can be used to extend or replace default Interop Broker behavior.
|
|
23
28
|
* @return {Promise.<InteropBroker>}
|
|
24
29
|
* @tutorial Interop.init
|
|
25
|
-
* @experimental
|
|
26
30
|
* @static
|
|
27
31
|
*/
|
|
28
32
|
async init(name, override = defaultOverride) {
|
|
33
|
+
var _a;
|
|
29
34
|
this.wire.sendAction('interop-init').catch((e) => {
|
|
30
35
|
// don't expose, analytics-only call
|
|
31
36
|
});
|
|
32
37
|
// Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
|
|
33
38
|
const options = await this.fin.Application.getCurrentSync().getInfo();
|
|
39
|
+
const opts = (_a = options.initialOptions.interopBrokerConfiguration) !== null && _a !== void 0 ? _a : {};
|
|
40
|
+
const objectThatThrows = (0, inaccessibleObject_1.createUnusableObject)(BrokerParamAccessError);
|
|
41
|
+
const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (0, lodash_1.cloneDeep)(opts));
|
|
34
42
|
let provider;
|
|
35
43
|
const getProvider = () => {
|
|
36
44
|
if (!provider) {
|
|
@@ -38,7 +46,16 @@ class InteropModule extends base_1.Base {
|
|
|
38
46
|
}
|
|
39
47
|
return provider;
|
|
40
48
|
};
|
|
41
|
-
|
|
49
|
+
const throwingGetProvider = async () => {
|
|
50
|
+
// eslint-disable-next-line no-console
|
|
51
|
+
throw new Error(BrokerParamAccessError);
|
|
52
|
+
};
|
|
53
|
+
const OverrideableBroker = InteropBroker_1.InteropBroker.createClosedConstructor(this.wire, getProvider, opts);
|
|
54
|
+
// We need to use these objects because removing them entirely would be a breaking change and we want an informative error
|
|
55
|
+
// @ts-expect-error
|
|
56
|
+
const broker = await override(OverrideableBroker, objectThatThrows, throwingGetProvider, warningOptsClone);
|
|
57
|
+
(0, overrideCheck_1.overrideCheck)(broker, (0, overrideCheck_1.getDefaultViewFdc3VersionFromAppInfo)(options));
|
|
58
|
+
return broker;
|
|
42
59
|
}
|
|
43
60
|
/**
|
|
44
61
|
* Connects a client to an Interop broker. This is called under-the-hood for Views in a Platform.
|
|
@@ -47,7 +64,6 @@ class InteropModule extends base_1.Base {
|
|
|
47
64
|
* what context(s) the entity wants to subscribe to, and the current Context Group of the entity.
|
|
48
65
|
* @return {InteropClient}
|
|
49
66
|
* @tutorial Interop.connectSync
|
|
50
|
-
* @experimental
|
|
51
67
|
* @static
|
|
52
68
|
*/
|
|
53
69
|
connectSync(name, interopConfig) {
|
|
@@ -2,10 +2,10 @@ import { TargetApp } from './fdc3/shapes/fdc3v1';
|
|
|
2
2
|
import { AppIdentifier } from './fdc3/shapes/fdc3v2';
|
|
3
3
|
import type * as OpenFin from '../../OpenFin';
|
|
4
4
|
import { Base } from '../base';
|
|
5
|
-
import type Transport from '../../transport/transport';
|
|
5
|
+
import type { Transport } from '../../transport/transport';
|
|
6
6
|
declare type Identity = OpenFin.Identity;
|
|
7
7
|
/**
|
|
8
|
-
* {@link https://developers.openfin.co/of-docs/docs/enable-color-linking
|
|
8
|
+
* {@link https://developers.openfin.co/of-docs/docs/enable-color-linking}
|
|
9
9
|
*
|
|
10
10
|
* The Interop Broker is responsible for keeping track of the Interop state of the Platform, and for directing messages to the proper locations.
|
|
11
11
|
*
|
|
@@ -103,7 +103,7 @@ declare type Identity = OpenFin.Identity;
|
|
|
103
103
|
* };
|
|
104
104
|
* return new Override();
|
|
105
105
|
* },
|
|
106
|
-
* interopOverride: async (InteropBroker
|
|
106
|
+
* interopOverride: async (InteropBroker) => {
|
|
107
107
|
* class Override extends InteropBroker {
|
|
108
108
|
* async joinContextGroup(channelName = 'default', target) {
|
|
109
109
|
* console.log('before super joinContextGroup')
|
|
@@ -112,37 +112,7 @@ declare type Identity = OpenFin.Identity;
|
|
|
112
112
|
* }
|
|
113
113
|
* }
|
|
114
114
|
*
|
|
115
|
-
*
|
|
116
|
-
* {
|
|
117
|
-
* id: 'green',
|
|
118
|
-
* displayMetadata: {
|
|
119
|
-
* color: '#00CC88',
|
|
120
|
-
* name: 'green'
|
|
121
|
-
* }
|
|
122
|
-
* },
|
|
123
|
-
* {
|
|
124
|
-
* id: 'purple',
|
|
125
|
-
* displayMetadata: {
|
|
126
|
-
* color: '#8C61FF',
|
|
127
|
-
* name: 'purple'
|
|
128
|
-
* }
|
|
129
|
-
* },
|
|
130
|
-
* {
|
|
131
|
-
* id: 'orange',
|
|
132
|
-
* displayMetadata: {
|
|
133
|
-
* color: '#FF8C4C',
|
|
134
|
-
* name: 'orange'
|
|
135
|
-
* }
|
|
136
|
-
* },
|
|
137
|
-
* {
|
|
138
|
-
* id: 'red',
|
|
139
|
-
* displayMetadata: {
|
|
140
|
-
* color: '#FF5E60',
|
|
141
|
-
* name: 'red'
|
|
142
|
-
* }
|
|
143
|
-
* }
|
|
144
|
-
* ];
|
|
145
|
-
* return new Override(provider, options, ...args);
|
|
115
|
+
* return new Override();
|
|
146
116
|
* }
|
|
147
117
|
* });
|
|
148
118
|
* ```
|
|
@@ -162,43 +132,54 @@ export declare class InteropBroker extends Base {
|
|
|
162
132
|
private channel;
|
|
163
133
|
private logging;
|
|
164
134
|
constructor(wire: Transport, getProvider: () => Promise<OpenFin.ChannelProvider>, options?: any);
|
|
135
|
+
static createClosedConstructor(...args: ConstructorParameters<typeof InteropBroker>): {
|
|
136
|
+
new (): InteropBroker;
|
|
137
|
+
};
|
|
165
138
|
/**
|
|
139
|
+
* @REMOVED
|
|
166
140
|
* SetContextOptions interface
|
|
167
141
|
* @typedef { object } SetContextOptions
|
|
168
142
|
* @property { Context } {context} - New context to set.
|
|
169
143
|
*/
|
|
170
144
|
/**
|
|
145
|
+
* @REMOVED
|
|
171
146
|
* GetContextOptions interface
|
|
172
147
|
* @typedef { object } GetContextOptions
|
|
173
148
|
* @property { string } [contextType] - Context Type
|
|
174
149
|
*/
|
|
175
150
|
/**
|
|
151
|
+
* @REMOVED
|
|
176
152
|
* JoinContextGroupOptions interface
|
|
177
153
|
* @typedef { object } JoinContextGroupOptions
|
|
178
154
|
* @property { string } contextGroupId - Id of the context group.
|
|
179
155
|
* @property { Identity | ClientIdentity } [target] - Identity of the entity you wish to join to a context group.
|
|
180
156
|
*/
|
|
181
157
|
/**
|
|
158
|
+
* @REMOVED
|
|
182
159
|
* AddClientToContextGroupOptions interface
|
|
183
160
|
* @typedef { object } AddClientToContextGroupOptions
|
|
184
161
|
* @property { string } contextGroupId - Name of the context group.
|
|
185
162
|
*/
|
|
186
163
|
/**
|
|
164
|
+
* @REMOVED
|
|
187
165
|
* RemoveFromContextGroupOptions interface
|
|
188
166
|
* @typedef { object } RemoveFromContextGroupOptions
|
|
189
167
|
* @property { Identity | ClientIdentity } target - Identity of the entity you wish to join to a context group.
|
|
190
168
|
*/
|
|
191
169
|
/**
|
|
170
|
+
* @REMOVED
|
|
192
171
|
* GetInfoForContextGroupOptions interface
|
|
193
172
|
* @typedef { object } GetInfoForContextGroupOptions
|
|
194
173
|
* @property { string } contextGroupId - Name of the context group to get info for.
|
|
195
174
|
*/
|
|
196
175
|
/**
|
|
176
|
+
* @REMOVED
|
|
197
177
|
* GetAllClientsInContextGroupOptions interface
|
|
198
178
|
* @typedef { object } GetAllClientsInContextGroupOptions
|
|
199
179
|
* @property { string } contextGroupId - Name of the context group to get info for.
|
|
200
180
|
*/
|
|
201
181
|
/**
|
|
182
|
+
* @PORTED
|
|
202
183
|
* InfoForIntentOptions interface
|
|
203
184
|
* @typedef { object } InfoForIntentOptions
|
|
204
185
|
* @property { string } name Name of the intent to get info for.
|
|
@@ -209,7 +190,6 @@ export declare class InteropBroker extends Base {
|
|
|
209
190
|
* @param { SetContextOptions } setContextOptions - New context to set.
|
|
210
191
|
* @param { ClientIdentity } clientIdentity - Identity of the client sender.
|
|
211
192
|
* @return { void }
|
|
212
|
-
* @experimental
|
|
213
193
|
*/
|
|
214
194
|
setContext({ context }: {
|
|
215
195
|
context: OpenFin.Context;
|
|
@@ -231,7 +211,6 @@ export declare class InteropBroker extends Base {
|
|
|
231
211
|
* @return { Promise<void> }
|
|
232
212
|
* @param { JoinContextGroupOptions } joinContextGroupOptions - Id of the Context Group and identity of the entity to join to the group.
|
|
233
213
|
* @param { ClientIdentity } senderIdentity - Identity of the client sender.
|
|
234
|
-
* @experimental
|
|
235
214
|
*/
|
|
236
215
|
joinContextGroup({ contextGroupId, target }: {
|
|
237
216
|
contextGroupId: string;
|
|
@@ -243,7 +222,6 @@ export declare class InteropBroker extends Base {
|
|
|
243
222
|
* @return { Promise<void> }
|
|
244
223
|
* @param { AddClientToContextGroupOptions } addClientToContextGroupOptions - Contains the contextGroupId
|
|
245
224
|
* @param { ClientIdentity } clientIdentity - Identity of the client sender.
|
|
246
|
-
* @experimental
|
|
247
225
|
*/
|
|
248
226
|
addClientToContextGroup({ contextGroupId }: {
|
|
249
227
|
contextGroupId: string;
|
|
@@ -256,7 +234,6 @@ export declare class InteropBroker extends Base {
|
|
|
256
234
|
* @return { Promise<void> }
|
|
257
235
|
* @param { RemoveFromContextGroupOptions } removeFromContextGroupOptions - Contains the target identity to remove.
|
|
258
236
|
* @param { ClientIdentity } senderIdentity - Identity of the client sender.
|
|
259
|
-
* @experimental
|
|
260
237
|
*/
|
|
261
238
|
removeFromContextGroup({ target }: {
|
|
262
239
|
target: OpenFin.Identity;
|
|
@@ -266,14 +243,12 @@ export declare class InteropBroker extends Base {
|
|
|
266
243
|
* Used by Platform Windows.
|
|
267
244
|
* @return { Promise<void> }
|
|
268
245
|
* @property { ClientIdentity } clientIdentity - Identity of the client sender.
|
|
269
|
-
* @experimental
|
|
270
246
|
*/
|
|
271
247
|
removeClientFromContextGroup(clientIdentity: OpenFin.ClientIdentity): Promise<void>;
|
|
272
248
|
/**
|
|
273
249
|
* Returns the Interop-Broker-defined context groups available for an entity to join. Because this function is used in the rest of the Interop Broker to fetch the Context Groups, overriding this allows you to customize the Context Groups for the Interop Broker. However, we recommend customizing the context groups through configuration instead.
|
|
274
250
|
* Used by Platform Windows.
|
|
275
251
|
* @return { Promise<ContextGroupInfo[]>}
|
|
276
|
-
* @experimental
|
|
277
252
|
*/
|
|
278
253
|
getContextGroups(): Readonly<OpenFin.ContextGroupInfo[]>;
|
|
279
254
|
/**
|
|
@@ -281,7 +256,6 @@ export declare class InteropBroker extends Base {
|
|
|
281
256
|
* Used by Platform Windows.
|
|
282
257
|
* @param { GetInfoForContextGroupOptions } getInfoForContextGroupOptions - Contains contextGroupId, the context group you wish to get display info for.
|
|
283
258
|
* @return { Promise<ContextGroupInfo>}
|
|
284
|
-
* @experimental
|
|
285
259
|
*/
|
|
286
260
|
getInfoForContextGroup({ contextGroupId }: {
|
|
287
261
|
contextGroupId: string;
|
|
@@ -291,7 +265,6 @@ export declare class InteropBroker extends Base {
|
|
|
291
265
|
* Used by Platform Windows.
|
|
292
266
|
* @param { GetAllClientsInContextGroupOptions } getAllClientsInContextGroupOptions - Contains contextGroupId, the context group you wish to get clients for.
|
|
293
267
|
* @return { Promise<ClientIdentity[]>}
|
|
294
|
-
* @experimental
|
|
295
268
|
*/
|
|
296
269
|
getAllClientsInContextGroup({ contextGroupId }: {
|
|
297
270
|
contextGroupId: string;
|
|
@@ -303,7 +276,6 @@ export declare class InteropBroker extends Base {
|
|
|
303
276
|
* @param { ClientIdentity } clientIdentity Identity of the Client making the request.
|
|
304
277
|
* @return { Promise<unknown> }
|
|
305
278
|
* @tutorial interop.handleFiredIntent
|
|
306
|
-
* @experimental
|
|
307
279
|
*/
|
|
308
280
|
handleFiredIntent(intent: OpenFin.Intent, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
|
|
309
281
|
/**
|
|
@@ -312,7 +284,6 @@ export declare class InteropBroker extends Base {
|
|
|
312
284
|
* @param { Intent } intent The combination of an action and a context that is passed to an application for resolution.
|
|
313
285
|
* @param { Identity } target - Identity of the target that will handle the intent.
|
|
314
286
|
* @return { Promise<void> }
|
|
315
|
-
* @experimental
|
|
316
287
|
*/
|
|
317
288
|
setIntentTarget(intent: OpenFin.Intent, target: OpenFin.Identity): Promise<void>;
|
|
318
289
|
/**
|
|
@@ -322,7 +293,6 @@ export declare class InteropBroker extends Base {
|
|
|
322
293
|
* @param { ClientIdentity } clientIdentity Identity of the Client making the request.
|
|
323
294
|
* @return { Promise<unknown> }
|
|
324
295
|
* @tutorial interop.handleInfoForIntent
|
|
325
|
-
* @experimental
|
|
326
296
|
*/
|
|
327
297
|
handleInfoForIntent(options: OpenFin.InfoForIntentOptions, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
|
|
328
298
|
/**
|
|
@@ -332,7 +302,6 @@ export declare class InteropBroker extends Base {
|
|
|
332
302
|
* @param { ClientIdentity } clientIdentity Identity of the Client making the request.
|
|
333
303
|
* @return { Promise<unknown> }
|
|
334
304
|
* @tutorial interop.handleInfoForIntentsByContext
|
|
335
|
-
* @experimental
|
|
336
305
|
*/
|
|
337
306
|
handleInfoForIntentsByContext(context: OpenFin.Context | OpenFin.FindIntentsByContextOptions, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
|
|
338
307
|
/**
|
|
@@ -342,7 +311,6 @@ export declare class InteropBroker extends Base {
|
|
|
342
311
|
* @param { ClientIdentity } clientIdentity Identity of the Client making the request.
|
|
343
312
|
* @return { Promise<unknown> }
|
|
344
313
|
* @tutorial interop.handleFiredIntentForContext
|
|
345
|
-
* @experimental
|
|
346
314
|
*/
|
|
347
315
|
handleFiredIntentForContext(contextForIntent: OpenFin.ContextForIntent, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
|
|
348
316
|
/**
|