@openfin/core 30.73.6 → 30.73.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/OpenFin.d.ts +1 -1729
- package/fin.d.ts +3 -4
- package/package.json +1 -1
- package/src/GlobalOpenFin.d.ts +4 -0
- package/src/OpenFin.d.ts +2938 -0
- package/src/OpenFin.js +4 -0
- package/src/api/application/Factory.d.ts +2 -0
- package/src/api/application/Factory.js +4 -3
- package/src/api/application/Instance.d.ts +3 -1
- package/src/api/application/Instance.js +1 -0
- package/src/api/application/index.js +7 -3
- package/src/api/base.d.ts +19 -15
- package/src/api/base.js +20 -22
- package/src/api/clipboard/index.d.ts +2 -0
- package/src/api/clipboard/index.js +1 -0
- package/src/api/events/application.d.ts +66 -56
- package/src/api/events/base.d.ts +33 -15
- package/src/api/events/channel.d.ts +13 -8
- package/src/api/events/eventAggregator.js +1 -9
- package/src/api/events/externalApplication.d.ts +10 -5
- package/src/api/events/frame.d.ts +13 -7
- package/src/api/events/globalHotkey.d.ts +11 -10
- package/src/api/events/platform.d.ts +10 -16
- package/src/api/events/system.d.ts +48 -18
- package/src/api/events/typedEventEmitter.d.ts +20 -0
- package/src/api/events/typedEventEmitter.js +2 -0
- package/src/api/events/view.d.ts +38 -54
- package/src/api/events/webcontents.d.ts +55 -28
- package/src/api/events/window.d.ts +148 -134
- package/src/api/external-application/Factory.d.ts +1 -0
- package/src/api/external-application/Instance.d.ts +2 -1
- package/src/api/external-application/index.js +7 -3
- package/src/api/fin.d.ts +3 -1
- package/src/api/fin.js +2 -2
- package/src/api/frame/Factory.d.ts +1 -0
- package/src/api/frame/Factory.js +2 -2
- package/src/api/frame/Instance.d.ts +3 -1
- package/src/api/frame/index.js +7 -3
- package/src/api/global-hotkey/index.d.ts +2 -2
- package/src/api/global-hotkey/index.js +6 -0
- package/src/api/interappbus/channel/channel.d.ts +6 -4
- package/src/api/interappbus/channel/channels-docs.d.ts +22 -0
- package/src/api/interappbus/channel/channels-docs.js +22 -0
- package/src/api/interappbus/channel/client.d.ts +2 -1
- package/src/api/interappbus/channel/client.js +24 -26
- package/src/api/interappbus/channel/connection-manager.d.ts +1 -0
- package/src/api/interappbus/channel/connection-manager.js +30 -28
- package/src/api/interappbus/channel/index.d.ts +6 -4
- package/src/api/interappbus/channel/index.js +34 -19
- package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +3 -1
- package/src/api/interappbus/channel/protocols/classic/strategy.js +21 -22
- package/src/api/interappbus/channel/protocols/index.d.ts +3 -0
- package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +1 -1
- package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +3 -1
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +25 -27
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +0 -1
- package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +3 -1
- package/src/api/interappbus/channel/protocols/rtc/strategy.js +29 -31
- package/src/api/interappbus/channel/protocols/strategy.d.ts +3 -1
- package/src/api/interappbus/channel/provider.d.ts +8 -4
- package/src/api/interappbus/channel/provider.js +140 -139
- package/src/api/interappbus/index.js +1 -1
- package/src/api/interop/Factory.d.ts +2 -0
- package/src/api/interop/Factory.js +20 -2
- package/src/api/interop/InteropBroker.d.ts +62 -39
- package/src/api/interop/InteropBroker.js +114 -55
- package/src/api/interop/InteropClient.d.ts +9 -0
- package/src/api/interop/InteropClient.js +46 -40
- package/src/api/interop/SessionContextGroupBroker.d.ts +1 -0
- package/src/api/interop/SessionContextGroupClient.d.ts +1 -0
- package/src/api/interop/SessionContextGroupClient.js +22 -24
- package/src/api/interop/fdc3/PrivateChannelClient.d.ts +9 -7
- package/src/api/interop/fdc3/PrivateChannelClient.js +6 -6
- package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +1 -0
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +14 -13
- package/src/api/interop/fdc3/fdc3-1.2.js +3 -14
- package/src/api/interop/fdc3/fdc3-2.0.d.ts +24 -21
- package/src/api/interop/fdc3/fdc3-2.0.js +27 -27
- package/src/api/interop/fdc3/fdc3.d.ts +12 -0
- 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/fdc3v1.d.ts +53 -0
- package/src/api/interop/fdc3/shapes/fdc3v1.js +4 -0
- package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +75 -0
- package/src/api/interop/fdc3/shapes/fdc3v2.js +2 -0
- package/src/api/interop/fdc3/utils.d.ts +15 -5
- package/src/api/interop/fdc3/utils.js +29 -11
- package/src/api/interop/fdc3/versions.d.ts +1 -0
- package/src/api/interop/fdc3/versions.js +2 -0
- package/src/api/interop/index.js +7 -3
- package/src/api/interop/utils.d.ts +2 -0
- package/src/api/interop/utils.js +29 -15
- package/src/api/me.d.ts +3 -1
- package/src/api/platform/Factory.d.ts +6 -0
- package/src/api/platform/Factory.js +14 -5
- package/src/api/platform/Instance.d.ts +18 -3
- package/src/api/platform/Instance.js +30 -13
- package/src/api/platform/common-utils.d.ts +2 -1
- package/src/api/platform/index.js +7 -3
- package/src/api/platform/layout/Factory.d.ts +7 -1
- package/src/api/platform/layout/Factory.js +22 -20
- package/src/api/platform/layout/Instance.d.ts +6 -4
- package/src/api/platform/layout/Instance.js +2 -3
- package/src/api/platform/layout/controllers/splitter-controller.js +1 -1
- package/src/api/platform/layout/controllers/tab-drag-controller.d.ts +1 -0
- package/src/api/platform/layout/controllers/tab-drag-controller.js +1 -1
- package/src/api/platform/layout/index.js +7 -3
- package/src/api/platform/layout/shapes.d.ts +3 -1
- package/src/api/platform/layout/utils/bounds-observer.d.ts +1 -1
- package/src/api/platform/layout/utils/bounds-observer.js +7 -5
- package/src/api/platform/layout/utils/view-overlay.d.ts +1 -0
- 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 +2 -0
- package/src/api/snapshot-source/Factory.js +2 -1
- package/src/api/snapshot-source/Instance.d.ts +1 -0
- package/src/api/snapshot-source/Instance.js +33 -35
- package/src/api/snapshot-source/index.js +7 -3
- package/src/api/snapshot-source/utils.d.ts +1 -0
- package/src/api/snapshot-source/utils.js +2 -1
- package/src/api/system/index.d.ts +76 -16
- package/src/api/system/index.js +127 -3
- package/src/api/view/Factory.d.ts +1 -0
- package/src/api/view/Factory.js +2 -2
- package/src/api/view/Instance.d.ts +17 -3
- package/src/api/view/Instance.js +20 -0
- package/src/api/view/index.js +7 -3
- package/src/api/webcontents/main.d.ts +20 -5
- package/src/api/webcontents/main.js +10 -0
- package/src/api/window/Factory.d.ts +1 -0
- package/src/api/window/Factory.js +2 -2
- package/src/api/window/Instance.d.ts +26 -3
- package/src/api/window/Instance.js +26 -1
- package/src/api/window/index.js +7 -3
- package/src/browser.d.ts +4 -4
- package/src/environment/browser.d.ts +3 -1
- package/src/environment/environment.d.ts +3 -1
- package/src/environment/node-env.d.ts +3 -1
- package/src/environment/node-env.js +2 -2
- package/src/environment/openfin-env.d.ts +3 -1
- package/src/environment/openfin-env.js +15 -17
- package/src/fdc3.d.ts +3 -0
- package/src/fdc3.js +1 -1
- package/src/mock.d.ts +2 -2
- package/src/mock.js +3 -3
- package/src/namespaces.d.ts +21 -0
- package/src/namespaces.js +24 -0
- package/src/shapes/WebOptions.d.ts +1 -0
- package/src/shapes/WindowOptions.d.ts +1 -0
- package/src/shapes/protocol.d.ts +34 -26
- package/src/transport/transport.d.ts +6 -5
- package/src/transport/transport.js +26 -28
- package/src/transport/wire.d.ts +9 -7
- package/src/util/http.d.ts +1 -1
- package/src/util/http.js +16 -11
- package/src/util/inaccessibleObject.d.ts +2 -0
- package/src/util/inaccessibleObject.js +49 -0
- package/src/util/normalize-config.js +5 -5
|
@@ -1,165 +1,166 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver,
|
|
3
|
-
if (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return value;
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
8
7
|
};
|
|
9
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver,
|
|
10
|
-
if (!
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return privateMap.get(receiver);
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
14
12
|
};
|
|
13
|
+
var _ChannelProvider_connections, _ChannelProvider_protectedObj, _ChannelProvider_strategy, _ChannelProvider_removeEndpoint, _ChannelProvider_close;
|
|
15
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
15
|
exports.ChannelProvider = void 0;
|
|
17
16
|
const channel_1 = require("./channel");
|
|
18
17
|
const runtimeVersioning_1 = require("../../../util/runtimeVersioning");
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
!runtimeVersioning_1.runtimeUuidMeetsMinimumRuntimeVersion(senderIdentity.runtimeUuid, '18.87.56.0')) {
|
|
36
|
-
this.handleMultiRuntimeLegacyClient(senderIdentity);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
this.checkForClientConnection(senderIdentity);
|
|
40
|
-
}
|
|
41
|
-
return super.processAction(action, payload, senderIdentity);
|
|
42
|
-
};
|
|
43
|
-
_close.set(this, () => {
|
|
44
|
-
__classPrivateFieldGet(this, _strategy).close();
|
|
45
|
-
const remove = ChannelProvider.removalMap.get(this);
|
|
46
|
-
if (remove) {
|
|
47
|
-
remove();
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
__classPrivateFieldSet(this, _protectedObj, new channel_1.ProtectedItems(providerIdentity, wire));
|
|
51
|
-
this.connectListener = () => undefined;
|
|
52
|
-
this.disconnectListener = () => undefined;
|
|
53
|
-
__classPrivateFieldSet(this, _connections, []);
|
|
54
|
-
__classPrivateFieldSet(this, _strategy, strategy);
|
|
55
|
-
strategy.receive(this.processAction);
|
|
56
|
-
}
|
|
57
|
-
get connections() {
|
|
58
|
-
return [...__classPrivateFieldGet(this, _connections)];
|
|
59
|
-
}
|
|
60
|
-
static handleClientDisconnection(channel, payload) {
|
|
61
|
-
const removeById = channel.connections.find((identity) => identity.endpointId === payload.endpointId);
|
|
62
|
-
if (removeById) {
|
|
63
|
-
__classPrivateFieldGet(channel, _removeEndpoint).call(channel, removeById);
|
|
18
|
+
class ChannelProvider extends channel_1.ChannelBase {
|
|
19
|
+
constructor(providerIdentity, wire, strategy) {
|
|
20
|
+
super();
|
|
21
|
+
_ChannelProvider_connections.set(this, void 0);
|
|
22
|
+
_ChannelProvider_protectedObj.set(this, void 0);
|
|
23
|
+
_ChannelProvider_strategy.set(this, void 0);
|
|
24
|
+
_ChannelProvider_removeEndpoint.set(this, (identity) => {
|
|
25
|
+
const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
|
|
26
|
+
__classPrivateFieldGet(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
|
|
27
|
+
__classPrivateFieldSet(this, _ChannelProvider_connections, remainingConnections, "f");
|
|
28
|
+
});
|
|
29
|
+
// Must be bound.
|
|
30
|
+
this.processAction = async (action, payload, senderIdentity) => {
|
|
31
|
+
if (ChannelProvider.clientIsMultiRuntime(senderIdentity) &&
|
|
32
|
+
!(0, runtimeVersioning_1.runtimeUuidMeetsMinimumRuntimeVersion)(senderIdentity.runtimeUuid, '18.87.56.0')) {
|
|
33
|
+
this.handleMultiRuntimeLegacyClient(senderIdentity);
|
|
64
34
|
}
|
|
65
35
|
else {
|
|
66
|
-
|
|
67
|
-
return identity.uuid === payload.uuid && identity.name === payload.name;
|
|
68
|
-
});
|
|
69
|
-
multipleRemoves.forEach(__classPrivateFieldGet(channel, _removeEndpoint));
|
|
36
|
+
this.checkForClientConnection(senderIdentity);
|
|
70
37
|
}
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const endpointId = (_a = to.endpointId) !== null && _a !== void 0 ? _a : this.getEndpointIdForOpenFinId(to, action);
|
|
79
|
-
if (endpointId && __classPrivateFieldGet(this, _strategy).isEndpointConnected(endpointId)) {
|
|
80
|
-
return __classPrivateFieldGet(this, _strategy).send(endpointId, action, payload);
|
|
38
|
+
return super.processAction(action, payload, senderIdentity);
|
|
39
|
+
};
|
|
40
|
+
_ChannelProvider_close.set(this, () => {
|
|
41
|
+
__classPrivateFieldGet(this, _ChannelProvider_strategy, "f").close();
|
|
42
|
+
const remove = ChannelProvider.removalMap.get(this);
|
|
43
|
+
if (remove) {
|
|
44
|
+
remove();
|
|
81
45
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
46
|
+
});
|
|
47
|
+
__classPrivateFieldSet(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, wire), "f");
|
|
48
|
+
this.connectListener = () => undefined;
|
|
49
|
+
this.disconnectListener = () => undefined;
|
|
50
|
+
__classPrivateFieldSet(this, _ChannelProvider_connections, [], "f");
|
|
51
|
+
__classPrivateFieldSet(this, _ChannelProvider_strategy, strategy, "f");
|
|
52
|
+
strategy.receive(this.processAction);
|
|
53
|
+
}
|
|
54
|
+
get connections() {
|
|
55
|
+
return [...__classPrivateFieldGet(this, _ChannelProvider_connections, "f")];
|
|
56
|
+
}
|
|
57
|
+
static handleClientDisconnection(channel, payload) {
|
|
58
|
+
const removeById = channel.connections.find((identity) => identity.endpointId === payload.endpointId);
|
|
59
|
+
if (removeById) {
|
|
60
|
+
__classPrivateFieldGet(channel, _ChannelProvider_removeEndpoint, "f").call(channel, removeById);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
const multipleRemoves = channel.connections.filter((identity) => {
|
|
64
|
+
return identity.uuid === payload.uuid && identity.name === payload.name;
|
|
65
|
+
});
|
|
66
|
+
multipleRemoves.forEach(__classPrivateFieldGet(channel, _ChannelProvider_removeEndpoint, "f"));
|
|
96
67
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
68
|
+
channel.disconnectListener(payload);
|
|
69
|
+
}
|
|
70
|
+
static setProviderRemoval(provider, remove) {
|
|
71
|
+
ChannelProvider.removalMap.set(provider, remove);
|
|
72
|
+
}
|
|
73
|
+
dispatch(to, action, payload) {
|
|
74
|
+
var _a;
|
|
75
|
+
const endpointId = (_a = to.endpointId) !== null && _a !== void 0 ? _a : this.getEndpointIdForOpenFinId(to, action);
|
|
76
|
+
if (endpointId && __classPrivateFieldGet(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
|
|
77
|
+
return __classPrivateFieldGet(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload);
|
|
103
78
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
79
|
+
return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
|
|
80
|
+
}
|
|
81
|
+
async processConnection(senderId, payload) {
|
|
82
|
+
__classPrivateFieldGet(this, _ChannelProvider_connections, "f").push(senderId);
|
|
83
|
+
return this.connectListener(senderId, payload);
|
|
84
|
+
}
|
|
85
|
+
publish(action, payload) {
|
|
86
|
+
return this.connections.map((to) => __classPrivateFieldGet(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
|
|
87
|
+
}
|
|
88
|
+
onConnection(listener) {
|
|
89
|
+
this.connectListener = listener;
|
|
90
|
+
}
|
|
91
|
+
onDisconnection(listener) {
|
|
92
|
+
this.disconnectListener = listener;
|
|
93
|
+
}
|
|
94
|
+
async destroy() {
|
|
95
|
+
const protectedObj = __classPrivateFieldGet(this, _ChannelProvider_protectedObj, "f");
|
|
96
|
+
const { channelName } = protectedObj.providerIdentity;
|
|
97
|
+
__classPrivateFieldSet(this, _ChannelProvider_connections, [], "f");
|
|
98
|
+
await protectedObj.wire.sendAction('destroy-channel', { channelName });
|
|
99
|
+
__classPrivateFieldGet(this, _ChannelProvider_close, "f").call(this);
|
|
100
|
+
}
|
|
101
|
+
async getAllClientInfo() {
|
|
102
|
+
return this.connections.map((clientInfo) => {
|
|
103
|
+
const { uuid, name, endpointId, entityType, connectionUrl } = clientInfo;
|
|
104
|
+
return { uuid, name, endpointId, entityType, connectionUrl };
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
checkForClientConnection(clientIdentity) {
|
|
108
|
+
if (!this.isClientConnected(clientIdentity)) {
|
|
109
|
+
throw new Error(`This action was sent from a client that is not connected to the provider.
|
|
107
110
|
Client Identity: {uuid: ${clientIdentity.uuid}, name: ${clientIdentity.name}, endpointId: ${clientIdentity.endpointId}}`);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
isClientConnected(clientIdentity) {
|
|
111
|
-
if (ChannelProvider.clientIdentityIncludesEndpointId(clientIdentity)) {
|
|
112
|
-
return this.connections.some((identity) => {
|
|
113
|
-
return (
|
|
114
|
-
// Might be redundant to check for uuid and name here after we get an endpointId match, but just in case
|
|
115
|
-
identity.endpointId === clientIdentity.endpointId &&
|
|
116
|
-
identity.uuid === clientIdentity.uuid &&
|
|
117
|
-
identity.name === clientIdentity.name);
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
return this.isLegacyClientConnected(clientIdentity);
|
|
121
111
|
}
|
|
122
|
-
|
|
112
|
+
}
|
|
113
|
+
isClientConnected(clientIdentity) {
|
|
114
|
+
if (ChannelProvider.clientIdentityIncludesEndpointId(clientIdentity)) {
|
|
123
115
|
return this.connections.some((identity) => {
|
|
124
|
-
return
|
|
116
|
+
return (
|
|
117
|
+
// Might be redundant to check for uuid and name here after we get an endpointId match, but just in case
|
|
118
|
+
identity.endpointId === clientIdentity.endpointId &&
|
|
119
|
+
identity.uuid === clientIdentity.uuid &&
|
|
120
|
+
identity.name === clientIdentity.name);
|
|
125
121
|
});
|
|
126
122
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
return this.isLegacyClientConnected(clientIdentity);
|
|
124
|
+
}
|
|
125
|
+
isLegacyClientConnected(clientIdentity) {
|
|
126
|
+
return this.connections.some((identity) => {
|
|
127
|
+
return identity.uuid === clientIdentity.uuid && identity.name === clientIdentity.name;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
handleMultiRuntimeLegacyClient(senderIdentity) {
|
|
131
|
+
if (!this.isLegacyClientConnected(senderIdentity)) {
|
|
132
|
+
throw new Error(`This action was sent from a client that is not connected to the provider. Client Identity:
|
|
130
133
|
{uuid: ${senderIdentity.uuid}, name: ${senderIdentity.name}, endpointId: ${senderIdentity.endpointId}}`);
|
|
131
|
-
}
|
|
132
134
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
135
|
+
}
|
|
136
|
+
getEndpointIdForOpenFinId(clientIdentity, action) {
|
|
137
|
+
var _a;
|
|
138
|
+
const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
|
|
139
|
+
if (matchingConnections.length >= 2) {
|
|
140
|
+
const protectedObj = __classPrivateFieldGet(this, _ChannelProvider_protectedObj, "f");
|
|
141
|
+
const { uuid, name } = clientIdentity;
|
|
142
|
+
const providerUuid = protectedObj === null || protectedObj === void 0 ? void 0 : protectedObj.providerIdentity.uuid;
|
|
143
|
+
const providerName = protectedObj === null || protectedObj === void 0 ? void 0 : protectedObj.providerIdentity.name;
|
|
144
|
+
// eslint-disable-next-line no-console
|
|
145
|
+
console.warn(`WARNING: Dispatch call may have unintended results. The "to" argument of your dispatch call is missing the
|
|
143
146
|
"endpointId" parameter. The identity you are dispatching to ({uuid: ${uuid}, name: ${name}})
|
|
144
147
|
has multiple channelClients for this channel. Your dispatched action: (${action}) from the provider:
|
|
145
148
|
({uuid: ${providerUuid}, name: ${providerName}}) will only be processed by the most recently-created client.`);
|
|
146
|
-
}
|
|
147
|
-
// Pop to return the most recently created endpointId.
|
|
148
|
-
return (_a = matchingConnections.pop()) === null || _a === void 0 ? void 0 : _a.endpointId;
|
|
149
|
-
}
|
|
150
|
-
// eslint-disable-next-line class-methods-use-this
|
|
151
|
-
static clientIdentityIncludesEndpointId(subscriptionIdentity) {
|
|
152
|
-
return subscriptionIdentity.endpointId !== undefined;
|
|
153
|
-
}
|
|
154
|
-
// eslint-disable-next-line class-methods-use-this
|
|
155
|
-
static clientIsMultiRuntime(subscriptionIdentity) {
|
|
156
|
-
return subscriptionIdentity.runtimeUuid !== undefined;
|
|
157
149
|
}
|
|
150
|
+
// Pop to return the most recently created endpointId.
|
|
151
|
+
return (_a = matchingConnections.pop()) === null || _a === void 0 ? void 0 : _a.endpointId;
|
|
152
|
+
}
|
|
153
|
+
// eslint-disable-next-line class-methods-use-this
|
|
154
|
+
static clientIdentityIncludesEndpointId(subscriptionIdentity) {
|
|
155
|
+
return subscriptionIdentity.endpointId !== undefined;
|
|
156
|
+
}
|
|
157
|
+
// eslint-disable-next-line class-methods-use-this
|
|
158
|
+
static clientIsMultiRuntime(subscriptionIdentity) {
|
|
159
|
+
return subscriptionIdentity.runtimeUuid !== undefined;
|
|
158
160
|
}
|
|
159
|
-
|
|
160
|
-
// The following line should be changed following a typescript update.
|
|
161
|
-
// static #removalMap = new WeakMap<ChannelProvider, Function>();
|
|
162
|
-
ChannelProvider.removalMap = new WeakMap();
|
|
163
|
-
return ChannelProvider;
|
|
164
|
-
})();
|
|
161
|
+
}
|
|
165
162
|
exports.ChannelProvider = ChannelProvider;
|
|
163
|
+
_ChannelProvider_connections = new WeakMap(), _ChannelProvider_protectedObj = new WeakMap(), _ChannelProvider_strategy = new WeakMap(), _ChannelProvider_removeEndpoint = new WeakMap(), _ChannelProvider_close = new WeakMap();
|
|
164
|
+
// The following line should be changed following a typescript update.
|
|
165
|
+
// static #removalMap = new WeakMap<ChannelProvider, Function>();
|
|
166
|
+
ChannelProvider.removalMap = new WeakMap();
|
|
@@ -54,7 +54,7 @@ class InterApplicationBus extends base_1.Base {
|
|
|
54
54
|
* @tutorial InterApplicationBus.send
|
|
55
55
|
*/
|
|
56
56
|
async send(destination, topic, message) {
|
|
57
|
-
const errorMsg = validate_1.validateIdentity(destination);
|
|
57
|
+
const errorMsg = (0, validate_1.validateIdentity)(destination);
|
|
58
58
|
if (errorMsg) {
|
|
59
59
|
throw new Error(errorMsg);
|
|
60
60
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type * as OpenFin from '../../OpenFin';
|
|
1
2
|
import { Base } from '../base';
|
|
2
3
|
import { InteropBroker } from './InteropBroker';
|
|
3
4
|
import { InteropClient } from './InteropClient';
|
|
4
5
|
/**
|
|
6
|
+
* @PORTED
|
|
5
7
|
* @typedef { object } InteropConfig
|
|
6
8
|
* @summary Information relevant to the Interop Broker.
|
|
7
9
|
* @property {string} [currentContextGroup] Context Group for the client. (green, yellow, red, etc.)
|
|
@@ -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.)
|
|
@@ -26,11 +31,15 @@ class InteropModule extends base_1.Base {
|
|
|
26
31
|
* @static
|
|
27
32
|
*/
|
|
28
33
|
async init(name, override = defaultOverride) {
|
|
34
|
+
var _a;
|
|
29
35
|
this.wire.sendAction('interop-init').catch((e) => {
|
|
30
36
|
// don't expose, analytics-only call
|
|
31
37
|
});
|
|
32
38
|
// Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
|
|
33
39
|
const options = await this.fin.Application.getCurrentSync().getInfo();
|
|
40
|
+
const opts = (_a = options.initialOptions.interopBrokerConfiguration) !== null && _a !== void 0 ? _a : {};
|
|
41
|
+
const objectThatThrows = (0, inaccessibleObject_1.createUnusableObject)(BrokerParamAccessError);
|
|
42
|
+
const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (0, lodash_1.cloneDeep)(opts));
|
|
34
43
|
let provider;
|
|
35
44
|
const getProvider = () => {
|
|
36
45
|
if (!provider) {
|
|
@@ -38,7 +47,16 @@ class InteropModule extends base_1.Base {
|
|
|
38
47
|
}
|
|
39
48
|
return provider;
|
|
40
49
|
};
|
|
41
|
-
|
|
50
|
+
const throwingGetProvider = async () => {
|
|
51
|
+
// eslint-disable-next-line no-console
|
|
52
|
+
throw new Error(BrokerParamAccessError);
|
|
53
|
+
};
|
|
54
|
+
const OverrideableBroker = InteropBroker_1.InteropBroker.createClosedConstructor(this.wire, getProvider, opts);
|
|
55
|
+
// We need to use these objects because removing them entirely would be a breaking change and we want an informative error
|
|
56
|
+
// @ts-expect-error
|
|
57
|
+
const broker = await override(OverrideableBroker, objectThatThrows, throwingGetProvider, warningOptsClone);
|
|
58
|
+
(0, overrideCheck_1.overrideCheck)(broker, (0, overrideCheck_1.getDefaultViewFdc3VersionFromAppInfo)(options));
|
|
59
|
+
return broker;
|
|
42
60
|
}
|
|
43
61
|
/**
|
|
44
62
|
* Connects a client to an Interop broker. This is called under-the-hood for Views in a Platform.
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { TargetApp } from './fdc3/shapes/fdc3v1';
|
|
2
|
+
import { AppIdentifier } from './fdc3/shapes/fdc3v2';
|
|
3
|
+
import type * as OpenFin from '../../OpenFin';
|
|
1
4
|
import { Base } from '../base';
|
|
2
5
|
import type Transport from '../../transport/transport';
|
|
3
|
-
|
|
6
|
+
declare type Identity = OpenFin.Identity;
|
|
4
7
|
/**
|
|
5
8
|
* {@link https://developers.openfin.co/of-docs/docs/enable-color-linking **THE INTEROP API IS EXPERIMENTAL. IF YOU WOULD LIKE TO USE IT, PLEASE USE OUR DEFAULT IMPLEMENTATION IN BROWSER**}
|
|
6
9
|
*
|
|
@@ -46,6 +49,32 @@ import Identity = OpenFin.Identity;
|
|
|
46
49
|
* }
|
|
47
50
|
* ```
|
|
48
51
|
*
|
|
52
|
+
* By default the Interop Broker logs all actions to the console. You can disable this by using the logging option in `interopBrokerConfiguration`:
|
|
53
|
+
* ```js
|
|
54
|
+
* {
|
|
55
|
+
* "runtime": {
|
|
56
|
+
* "arguments": "--v=1 --inspect",
|
|
57
|
+
* "version": "alpha-v19"
|
|
58
|
+
* },
|
|
59
|
+
* "platform": {
|
|
60
|
+
* "uuid": "platform_customization_local",
|
|
61
|
+
* "applicationIcon": "https://openfin.github.io/golden-prototype/favicon.ico",
|
|
62
|
+
* "autoShow": false,
|
|
63
|
+
* "providerUrl": "http://localhost:5555/provider.html",
|
|
64
|
+
* "interopBrokerConfiguration": {
|
|
65
|
+
* "logging": {
|
|
66
|
+
* "beforeAction": {
|
|
67
|
+
* "enabled": false
|
|
68
|
+
* },
|
|
69
|
+
* "afterAction": {
|
|
70
|
+
* "enabled": false
|
|
71
|
+
* }
|
|
72
|
+
* }
|
|
73
|
+
* }
|
|
74
|
+
* }
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
49
78
|
* ---
|
|
50
79
|
* **2. Overriding**
|
|
51
80
|
*
|
|
@@ -74,7 +103,7 @@ import Identity = OpenFin.Identity;
|
|
|
74
103
|
* };
|
|
75
104
|
* return new Override();
|
|
76
105
|
* },
|
|
77
|
-
* interopOverride: async (InteropBroker
|
|
106
|
+
* interopOverride: async (InteropBroker) => {
|
|
78
107
|
* class Override extends InteropBroker {
|
|
79
108
|
* async joinContextGroup(channelName = 'default', target) {
|
|
80
109
|
* console.log('before super joinContextGroup')
|
|
@@ -83,37 +112,7 @@ import Identity = OpenFin.Identity;
|
|
|
83
112
|
* }
|
|
84
113
|
* }
|
|
85
114
|
*
|
|
86
|
-
*
|
|
87
|
-
* {
|
|
88
|
-
* id: 'green',
|
|
89
|
-
* displayMetadata: {
|
|
90
|
-
* color: '#00CC88',
|
|
91
|
-
* name: 'green'
|
|
92
|
-
* }
|
|
93
|
-
* },
|
|
94
|
-
* {
|
|
95
|
-
* id: 'purple',
|
|
96
|
-
* displayMetadata: {
|
|
97
|
-
* color: '#8C61FF',
|
|
98
|
-
* name: 'purple'
|
|
99
|
-
* }
|
|
100
|
-
* },
|
|
101
|
-
* {
|
|
102
|
-
* id: 'orange',
|
|
103
|
-
* displayMetadata: {
|
|
104
|
-
* color: '#FF8C4C',
|
|
105
|
-
* name: 'orange'
|
|
106
|
-
* }
|
|
107
|
-
* },
|
|
108
|
-
* {
|
|
109
|
-
* id: 'red',
|
|
110
|
-
* displayMetadata: {
|
|
111
|
-
* color: '#FF5E60',
|
|
112
|
-
* name: 'red'
|
|
113
|
-
* }
|
|
114
|
-
* }
|
|
115
|
-
* ];
|
|
116
|
-
* return new Override(provider, options, ...args);
|
|
115
|
+
* return new Override();
|
|
117
116
|
* }
|
|
118
117
|
* });
|
|
119
118
|
* ```
|
|
@@ -131,44 +130,56 @@ export declare class InteropBroker extends Base {
|
|
|
131
130
|
private lastContextMap;
|
|
132
131
|
private sessionContextGroupMap;
|
|
133
132
|
private channel;
|
|
133
|
+
private logging;
|
|
134
134
|
constructor(wire: Transport, getProvider: () => Promise<OpenFin.ChannelProvider>, options?: any);
|
|
135
|
+
static createClosedConstructor(...args: ConstructorParameters<typeof InteropBroker>): {
|
|
136
|
+
new (): InteropBroker;
|
|
137
|
+
};
|
|
135
138
|
/**
|
|
139
|
+
* @REMOVED
|
|
136
140
|
* SetContextOptions interface
|
|
137
141
|
* @typedef { object } SetContextOptions
|
|
138
142
|
* @property { Context } {context} - New context to set.
|
|
139
143
|
*/
|
|
140
144
|
/**
|
|
145
|
+
* @REMOVED
|
|
141
146
|
* GetContextOptions interface
|
|
142
147
|
* @typedef { object } GetContextOptions
|
|
143
148
|
* @property { string } [contextType] - Context Type
|
|
144
149
|
*/
|
|
145
150
|
/**
|
|
151
|
+
* @REMOVED
|
|
146
152
|
* JoinContextGroupOptions interface
|
|
147
153
|
* @typedef { object } JoinContextGroupOptions
|
|
148
154
|
* @property { string } contextGroupId - Id of the context group.
|
|
149
155
|
* @property { Identity | ClientIdentity } [target] - Identity of the entity you wish to join to a context group.
|
|
150
156
|
*/
|
|
151
157
|
/**
|
|
158
|
+
* @REMOVED
|
|
152
159
|
* AddClientToContextGroupOptions interface
|
|
153
160
|
* @typedef { object } AddClientToContextGroupOptions
|
|
154
161
|
* @property { string } contextGroupId - Name of the context group.
|
|
155
162
|
*/
|
|
156
163
|
/**
|
|
164
|
+
* @REMOVED
|
|
157
165
|
* RemoveFromContextGroupOptions interface
|
|
158
166
|
* @typedef { object } RemoveFromContextGroupOptions
|
|
159
167
|
* @property { Identity | ClientIdentity } target - Identity of the entity you wish to join to a context group.
|
|
160
168
|
*/
|
|
161
169
|
/**
|
|
170
|
+
* @REMOVED
|
|
162
171
|
* GetInfoForContextGroupOptions interface
|
|
163
172
|
* @typedef { object } GetInfoForContextGroupOptions
|
|
164
173
|
* @property { string } contextGroupId - Name of the context group to get info for.
|
|
165
174
|
*/
|
|
166
175
|
/**
|
|
176
|
+
* @REMOVED
|
|
167
177
|
* GetAllClientsInContextGroupOptions interface
|
|
168
178
|
* @typedef { object } GetAllClientsInContextGroupOptions
|
|
169
179
|
* @property { string } contextGroupId - Name of the context group to get info for.
|
|
170
180
|
*/
|
|
171
181
|
/**
|
|
182
|
+
* @PORTED
|
|
172
183
|
* InfoForIntentOptions interface
|
|
173
184
|
* @typedef { object } InfoForIntentOptions
|
|
174
185
|
* @property { string } name Name of the intent to get info for.
|
|
@@ -329,23 +340,23 @@ export declare class InteropBroker extends Base {
|
|
|
329
340
|
* @param { ClientIdentity } clientIdentity Identity of the Client making the request.
|
|
330
341
|
*/
|
|
331
342
|
fdc3HandleOpen({ app, context }: {
|
|
332
|
-
app:
|
|
343
|
+
app: TargetApp | AppIdentifier;
|
|
333
344
|
context: OpenFin.Context;
|
|
334
|
-
}, clientIdentity: OpenFin.ClientIdentity): Promise<void |
|
|
345
|
+
}, clientIdentity: OpenFin.ClientIdentity): Promise<void | AppIdentifier>;
|
|
335
346
|
/**
|
|
336
347
|
* Responsible for resolving the fdc3.findInstances call.
|
|
337
348
|
* Must be overridden
|
|
338
349
|
* @param { AppIdentifier(2) } app AppIdentifier that was passed to fdc3.findInstances
|
|
339
350
|
* @param { ClientIdentity } clientIdentity Identity of the Client making the request.
|
|
340
351
|
*/
|
|
341
|
-
fdc3HandleFindInstances(app:
|
|
352
|
+
fdc3HandleFindInstances(app: AppIdentifier, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
|
|
342
353
|
/**
|
|
343
354
|
* Responsible for resolving the fdc3.getAppMetadata call.
|
|
344
355
|
* Must be overridden
|
|
345
356
|
* @param { AppIdentifier(2) } app AppIdentifier that was passed to fdc3.getAppMetadata
|
|
346
357
|
* @param { ClientIdentity } clientIdentity Identity of the Client making the request.
|
|
347
358
|
*/
|
|
348
|
-
fdc3HandleGetAppMetadata(app:
|
|
359
|
+
fdc3HandleGetAppMetadata(app: AppIdentifier, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
|
|
349
360
|
/**
|
|
350
361
|
* This function is called by the Interop Broker whenever a Context handler would fire.
|
|
351
362
|
* For FDC3 2.0 you would need to override this function and add the contextMetadata as
|
|
@@ -377,7 +388,18 @@ export declare class InteropBroker extends Base {
|
|
|
377
388
|
* @param clientIdentity
|
|
378
389
|
* @returns { Promise<ImplementationMetadata(2)> }
|
|
379
390
|
*/
|
|
380
|
-
fdc3HandleGetInfo(
|
|
391
|
+
fdc3HandleGetInfo(payload: {
|
|
392
|
+
fdc3Version: string;
|
|
393
|
+
}, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
|
|
394
|
+
/**
|
|
395
|
+
* Returns an array of info for each Interop Client connected to the Interop Broker.
|
|
396
|
+
*
|
|
397
|
+
* FDC3 2.0: Use the endpointId in the ClientInfo as the instanceId when generating
|
|
398
|
+
* an AppIdentifier.
|
|
399
|
+
* @return { Promise<Array<ClientInfo>> }
|
|
400
|
+
* @tutorial interop.getAllClientInfo
|
|
401
|
+
*/
|
|
402
|
+
getAllClientInfo(): Promise<Array<OpenFin.ClientInfo>>;
|
|
381
403
|
decorateSnapshot(snapshot: OpenFin.Snapshot): OpenFin.Snapshot;
|
|
382
404
|
applySnapshot(snapshot: OpenFin.Snapshot, options: OpenFin.ApplySnapshotOptions): void;
|
|
383
405
|
updateExistingClients(contextGroupStates: OpenFin.ContextGroupStates): void;
|
|
@@ -407,7 +429,7 @@ export declare class InteropBroker extends Base {
|
|
|
407
429
|
private static hasEndpointId;
|
|
408
430
|
static isContextTypeCompatible(contextType: string, registeredContextType: string | undefined): boolean;
|
|
409
431
|
private setContextGroupMap;
|
|
410
|
-
private
|
|
432
|
+
private setCurrentContextGroupInClientOptions;
|
|
411
433
|
private setupChannelProvider;
|
|
412
434
|
private wireChannel;
|
|
413
435
|
/**
|
|
@@ -425,3 +447,4 @@ export declare class InteropBroker extends Base {
|
|
|
425
447
|
*/
|
|
426
448
|
isActionAuthorized(_action: string, _payload: any, _identity: OpenFin.ClientIdentity): Promise<boolean> | boolean;
|
|
427
449
|
}
|
|
450
|
+
export {};
|