@openfin/core 25.68.30 → 25.70.2
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 +30 -826
- package/README.md +12 -2
- package/package.json +1 -1
- package/src/api/application/Factory.d.ts +145 -145
- package/src/api/application/Factory.js +229 -229
- package/src/api/application/Instance.d.ts +301 -302
- package/src/api/application/Instance.js +412 -412
- package/src/api/application/index.d.ts +3 -3
- package/src/api/application/index.js +15 -15
- package/src/api/base.d.ts +43 -43
- package/src/api/base.js +177 -177
- package/src/api/clipboard/index.d.ts +69 -69
- package/src/api/clipboard/index.js +88 -88
- package/src/api/events/application.d.ts +69 -0
- package/src/api/events/application.js +2 -0
- package/src/api/events/base.d.ts +17 -0
- package/src/api/events/base.js +2 -0
- package/src/api/events/channel.d.ts +10 -11
- package/src/api/events/channel.js +2 -2
- package/src/api/events/emitterMap.d.ts +11 -11
- package/src/api/events/emitterMap.js +35 -35
- package/src/api/events/eventAggregator.d.ts +5 -5
- package/src/api/events/eventAggregator.js +43 -43
- package/src/api/events/externalApplication.d.ts +5 -0
- package/src/api/events/externalApplication.js +2 -0
- package/src/api/events/frame.d.ts +9 -0
- package/src/api/events/frame.js +2 -0
- package/src/api/events/globalHotkey.d.ts +10 -0
- package/src/api/events/globalHotkey.js +2 -0
- package/src/api/events/platform.d.ts +18 -0
- package/src/api/events/platform.js +2 -0
- package/src/api/events/system.d.ts +22 -0
- package/src/api/events/system.js +2 -0
- package/src/api/events/view.d.ts +56 -0
- package/src/api/events/view.js +2 -0
- package/src/api/events/webcontents.d.ts +48 -0
- package/src/api/events/webcontents.js +2 -0
- package/src/api/events/window.d.ts +176 -0
- package/src/api/events/window.js +2 -0
- package/src/api/external-application/Factory.d.ts +26 -26
- package/src/api/external-application/Factory.js +40 -40
- package/src/api/external-application/Instance.d.ts +101 -102
- package/src/api/external-application/Instance.js +109 -109
- package/src/api/external-application/index.d.ts +3 -3
- package/src/api/external-application/index.js +15 -15
- package/src/api/fin.d.ts +49 -49
- package/src/api/fin.js +43 -43
- package/src/api/frame/Factory.d.ts +36 -36
- package/src/api/frame/Factory.js +69 -69
- package/src/api/frame/Instance.d.ts +121 -121
- package/src/api/frame/Instance.js +130 -130
- package/src/api/frame/index.d.ts +3 -3
- package/src/api/frame/index.js +15 -15
- package/src/api/global-hotkey/index.d.ts +38 -38
- package/src/api/global-hotkey/index.js +58 -58
- package/src/api/interappbus/channel/channel.d.ts +26 -26
- package/src/api/interappbus/channel/channel.js +77 -77
- package/src/api/interappbus/channel/channels-docs.d.ts +318 -318
- package/src/api/interappbus/channel/channels-docs.js +376 -376
- package/src/api/interappbus/channel/client.d.ts +22 -22
- package/src/api/interappbus/channel/client.js +84 -84
- package/src/api/interappbus/channel/connection-manager.d.ts +28 -28
- package/src/api/interappbus/channel/connection-manager.js +244 -244
- package/src/api/interappbus/channel/index.d.ts +22 -23
- package/src/api/interappbus/channel/index.js +121 -121
- package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +13 -13
- package/src/api/interappbus/channel/protocols/classic/message-receiver.js +73 -73
- package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +22 -22
- package/src/api/interappbus/channel/protocols/classic/strategy.js +84 -84
- package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +20 -20
- package/src/api/interappbus/channel/protocols/combined/strategy.js +58 -58
- package/src/api/interappbus/channel/protocols/index.d.ts +44 -44
- package/src/api/interappbus/channel/protocols/index.js +2 -2
- package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +10 -10
- package/src/api/interappbus/channel/protocols/protocol-manager.js +43 -43
- package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +23 -23
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +135 -135
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +30 -30
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +131 -131
- package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +22 -22
- package/src/api/interappbus/channel/protocols/rtc/strategy.js +87 -87
- package/src/api/interappbus/channel/protocols/strategy-types.d.ts +13 -13
- package/src/api/interappbus/channel/protocols/strategy-types.js +2 -2
- package/src/api/interappbus/channel/protocols/strategy.d.ts +15 -15
- package/src/api/interappbus/channel/protocols/strategy.js +2 -2
- package/src/api/interappbus/channel/provider.d.ts +31 -31
- package/src/api/interappbus/channel/provider.js +160 -160
- package/src/api/interappbus/index.d.ts +85 -86
- package/src/api/interappbus/index.js +175 -175
- package/src/api/interop/Factory.d.ts +37 -37
- package/src/api/interop/Factory.js +54 -54
- package/src/api/interop/InteropBroker.d.ts +363 -363
- package/src/api/interop/InteropBroker.js +914 -914
- package/src/api/interop/InteropClient.d.ts +268 -268
- package/src/api/interop/InteropClient.js +450 -450
- package/src/api/interop/SessionContextGroupBroker.d.ts +26 -26
- package/src/api/interop/SessionContextGroupBroker.js +107 -107
- package/src/api/interop/SessionContextGroupClient.d.ts +20 -20
- package/src/api/interop/SessionContextGroupClient.js +85 -85
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +187 -187
- package/src/api/interop/fdc3/fdc3-1.2.js +385 -385
- package/src/api/interop/fdc3/fdc3.js +17 -17
- package/src/api/interop/fdc3/utils.d.ts +6 -6
- package/src/api/interop/fdc3/utils.js +17 -17
- package/src/api/interop/index.d.ts +4 -4
- package/src/api/interop/index.js +16 -16
- package/src/api/interop/utils.d.ts +11 -11
- package/src/api/interop/utils.js +36 -36
- package/src/api/me.d.ts +38 -35
- package/src/api/me.js +128 -60
- package/src/api/platform/Factory.d.ts +109 -109
- package/src/api/platform/Factory.js +188 -188
- package/src/api/platform/Instance.d.ts +122 -122
- package/src/api/platform/Instance.js +298 -298
- package/src/api/platform/common-utils.d.ts +6 -6
- package/src/api/platform/common-utils.js +16 -16
- package/src/api/platform/index.d.ts +3 -3
- package/src/api/platform/index.js +15 -15
- package/src/api/platform/layout/Factory.d.ts +108 -108
- package/src/api/platform/layout/Factory.js +189 -189
- package/src/api/platform/layout/Instance.d.ts +49 -49
- package/src/api/platform/layout/Instance.js +99 -99
- package/src/api/platform/layout/index.d.ts +2 -2
- package/src/api/platform/layout/index.js +14 -14
- package/src/api/platform/layout/shapes.d.ts +11 -0
- package/src/api/{window → platform/layout}/shapes.js +2 -2
- package/src/api/snapshot-source/Factory.d.ts +36 -36
- package/src/api/snapshot-source/Factory.js +65 -65
- package/src/api/snapshot-source/Instance.d.ts +30 -30
- package/src/api/snapshot-source/Instance.js +134 -134
- package/src/api/snapshot-source/index.d.ts +3 -3
- package/src/api/snapshot-source/index.js +15 -15
- package/src/api/snapshot-source/utils.d.ts +1 -1
- package/src/api/snapshot-source/utils.js +5 -5
- package/src/api/system/index.d.ts +960 -961
- package/src/api/system/index.js +1241 -1241
- package/src/api/view/Factory.d.ts +49 -49
- package/src/api/view/Factory.js +103 -103
- package/src/api/view/Instance.d.ts +387 -380
- package/src/api/view/Instance.js +422 -415
- package/src/api/view/index.d.ts +3 -3
- package/src/api/view/index.js +15 -15
- package/src/api/webcontents/main.d.ts +36 -36
- package/src/api/webcontents/main.js +82 -82
- package/src/api/window/Factory.d.ts +44 -44
- package/src/api/window/Factory.js +91 -91
- package/src/api/window/Instance.d.ts +972 -966
- package/src/api/window/Instance.js +1209 -1202
- package/src/api/window/index.d.ts +3 -5
- package/src/api/window/index.js +15 -17
- package/src/environment/environment.d.ts +28 -25
- package/src/environment/environment.js +4 -4
- package/src/environment/node-env.d.ts +25 -26
- package/src/environment/node-env.js +64 -64
- package/src/environment/openfin-env.d.ts +29 -30
- package/src/environment/openfin-env.js +107 -107
- package/src/mock.d.ts +3 -3
- package/src/mock.js +91 -90
- package/src/shapes/ERROR_BOX_TYPES.d.ts +1 -0
- package/src/shapes/ERROR_BOX_TYPES.js +2 -0
- package/src/shapes/WebOptions.d.ts +12 -0
- package/src/shapes/WebOptions.js +2 -0
- package/src/shapes/WindowOptions.d.ts +42 -0
- package/src/shapes/WindowOptions.js +2 -0
- package/src/shapes/protocol.d.ts +178 -0
- package/src/shapes/protocol.js +2 -0
- package/src/transport/fin_store.d.ts +4 -4
- package/src/transport/fin_store.js +16 -16
- package/src/transport/transport-errors.d.ts +18 -18
- package/src/transport/transport-errors.js +37 -37
- package/src/transport/transport.d.ts +56 -43
- package/src/transport/transport.js +181 -181
- package/src/transport/wire.d.ts +71 -11
- package/src/transport/wire.js +32 -32
- package/src/util/asyncFilter.d.ts +1 -1
- package/src/util/asyncFilter.js +7 -7
- package/src/util/errors.d.ts +9 -5
- package/src/util/errors.js +11 -11
- package/src/util/exhaustive.d.ts +1 -1
- package/src/util/exhaustive.js +7 -7
- package/src/util/http.d.ts +11 -11
- package/src/util/http.js +83 -83
- package/src/util/normalize-config.d.ts +3 -5
- package/src/util/normalize-config.js +47 -47
- package/src/util/promises.d.ts +5 -5
- package/src/util/promises.js +27 -27
- package/src/util/ref-counter.d.ts +7 -7
- package/src/util/ref-counter.js +51 -51
- package/src/util/runtimeVersioning.d.ts +3 -3
- package/src/util/runtimeVersioning.js +25 -25
- package/src/util/utilTypes.d.ts +8 -8
- package/src/util/utilTypes.js +2 -2
- package/src/util/validate.d.ts +3 -3
- package/src/util/validate.js +11 -11
- package/docs.README(OLD).md +0 -82
- package/resources/win/OpenFinRVM.exe +0 -0
- package/src/api/window/bounds-changed.d.ts +0 -10
- package/src/api/window/bounds-changed.js +0 -6
- package/src/api/window/shapes.d.ts +0 -13
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
|
|
3
|
-
if (!privateMap.has(receiver)) {
|
|
4
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
5
|
-
}
|
|
6
|
-
return privateMap.get(receiver);
|
|
7
|
-
};
|
|
8
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
|
|
9
|
-
if (!privateMap.has(receiver)) {
|
|
10
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
11
|
-
}
|
|
12
|
-
privateMap.set(receiver, value);
|
|
13
|
-
return value;
|
|
14
|
-
};
|
|
15
|
-
var _processAction, _rtcEndpointMap, _connected;
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.RTCInfo = exports.RTCStrategy = void 0;
|
|
18
|
-
const endpoint_1 = require("./endpoint");
|
|
19
|
-
/*
|
|
20
|
-
This is used to abstract out rtc messaging from the channels implementation using RTCEndpoints.
|
|
21
|
-
*/
|
|
22
|
-
class RTCStrategy {
|
|
23
|
-
constructor() {
|
|
24
|
-
_processAction.set(this, null);
|
|
25
|
-
_rtcEndpointMap.set(this, new Map());
|
|
26
|
-
_connected.set(this, true);
|
|
27
|
-
this.send = async (endpointId, action, payload) => {
|
|
28
|
-
return this.getEndpointById(endpointId).send(action, payload);
|
|
29
|
-
};
|
|
30
|
-
this.close = async () => {
|
|
31
|
-
if (__classPrivateFieldGet(this, _connected)) {
|
|
32
|
-
__classPrivateFieldGet(this, _rtcEndpointMap).forEach((rtcEndpoint) => rtcEndpoint.close());
|
|
33
|
-
__classPrivateFieldSet(this, _rtcEndpointMap, new Map());
|
|
34
|
-
}
|
|
35
|
-
__classPrivateFieldSet(this, _connected, false);
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
onEndpointDisconnect(endpointId, listener) {
|
|
39
|
-
this.getEndpointById(endpointId).onDisconnect(listener);
|
|
40
|
-
}
|
|
41
|
-
receive(listener) {
|
|
42
|
-
if (__classPrivateFieldGet(this, _processAction)) {
|
|
43
|
-
throw new Error('You have already set a listener for this RTC Strategy');
|
|
44
|
-
}
|
|
45
|
-
__classPrivateFieldSet(this, _processAction, listener);
|
|
46
|
-
__classPrivateFieldGet(this, _rtcEndpointMap).forEach((rtcEndpoint) => rtcEndpoint.receive(__classPrivateFieldGet(this, _processAction)));
|
|
47
|
-
}
|
|
48
|
-
getEndpointById(endpointId) {
|
|
49
|
-
const endpoint = __classPrivateFieldGet(this, _rtcEndpointMap).get(endpointId);
|
|
50
|
-
if (!endpoint) {
|
|
51
|
-
throw new Error(`Client with endpoint id ${endpointId} is not connected`);
|
|
52
|
-
}
|
|
53
|
-
return endpoint;
|
|
54
|
-
}
|
|
55
|
-
get connected() {
|
|
56
|
-
return __classPrivateFieldGet(this, _connected);
|
|
57
|
-
}
|
|
58
|
-
isEndpointConnected(endpointId) {
|
|
59
|
-
return __classPrivateFieldGet(this, _rtcEndpointMap).has(endpointId);
|
|
60
|
-
}
|
|
61
|
-
addEndpoint(endpointId, payload) {
|
|
62
|
-
if (!__classPrivateFieldGet(this, _connected)) {
|
|
63
|
-
console.warn('Adding endpoint to disconnected RTC Strategy');
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const clientStrat = new endpoint_1.RTCEndpoint(payload.rtc, payload.endpointIdentity);
|
|
67
|
-
if (__classPrivateFieldGet(this, _processAction)) {
|
|
68
|
-
clientStrat.receive(__classPrivateFieldGet(this, _processAction));
|
|
69
|
-
}
|
|
70
|
-
__classPrivateFieldGet(this, _rtcEndpointMap).set(endpointId, clientStrat);
|
|
71
|
-
}
|
|
72
|
-
async closeEndpoint(endpointId) {
|
|
73
|
-
__classPrivateFieldGet(this, _rtcEndpointMap).delete(endpointId);
|
|
74
|
-
}
|
|
75
|
-
isValidEndpointPayload(payload) {
|
|
76
|
-
const isObject = (x) => {
|
|
77
|
-
return typeof x === 'object' && x !== null;
|
|
78
|
-
};
|
|
79
|
-
return (isObject(payload) &&
|
|
80
|
-
isObject(payload.endpointIdentity) &&
|
|
81
|
-
isObject(payload.rtc) &&
|
|
82
|
-
typeof payload.endpointIdentity.endpointId === 'string');
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
exports.RTCStrategy = RTCStrategy;
|
|
86
|
-
_processAction = new WeakMap(), _rtcEndpointMap = new WeakMap(), _connected = new WeakMap();
|
|
87
|
-
exports.RTCInfo = { version: 1, minimumVersion: 0, type: 'rtc' };
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
|
|
3
|
+
if (!privateMap.has(receiver)) {
|
|
4
|
+
throw new TypeError("attempted to get private field on non-instance");
|
|
5
|
+
}
|
|
6
|
+
return privateMap.get(receiver);
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
|
|
9
|
+
if (!privateMap.has(receiver)) {
|
|
10
|
+
throw new TypeError("attempted to set private field on non-instance");
|
|
11
|
+
}
|
|
12
|
+
privateMap.set(receiver, value);
|
|
13
|
+
return value;
|
|
14
|
+
};
|
|
15
|
+
var _processAction, _rtcEndpointMap, _connected;
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.RTCInfo = exports.RTCStrategy = void 0;
|
|
18
|
+
const endpoint_1 = require("./endpoint");
|
|
19
|
+
/*
|
|
20
|
+
This is used to abstract out rtc messaging from the channels implementation using RTCEndpoints.
|
|
21
|
+
*/
|
|
22
|
+
class RTCStrategy {
|
|
23
|
+
constructor() {
|
|
24
|
+
_processAction.set(this, null);
|
|
25
|
+
_rtcEndpointMap.set(this, new Map());
|
|
26
|
+
_connected.set(this, true);
|
|
27
|
+
this.send = async (endpointId, action, payload) => {
|
|
28
|
+
return this.getEndpointById(endpointId).send(action, payload);
|
|
29
|
+
};
|
|
30
|
+
this.close = async () => {
|
|
31
|
+
if (__classPrivateFieldGet(this, _connected)) {
|
|
32
|
+
__classPrivateFieldGet(this, _rtcEndpointMap).forEach((rtcEndpoint) => rtcEndpoint.close());
|
|
33
|
+
__classPrivateFieldSet(this, _rtcEndpointMap, new Map());
|
|
34
|
+
}
|
|
35
|
+
__classPrivateFieldSet(this, _connected, false);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
onEndpointDisconnect(endpointId, listener) {
|
|
39
|
+
this.getEndpointById(endpointId).onDisconnect(listener);
|
|
40
|
+
}
|
|
41
|
+
receive(listener) {
|
|
42
|
+
if (__classPrivateFieldGet(this, _processAction)) {
|
|
43
|
+
throw new Error('You have already set a listener for this RTC Strategy');
|
|
44
|
+
}
|
|
45
|
+
__classPrivateFieldSet(this, _processAction, listener);
|
|
46
|
+
__classPrivateFieldGet(this, _rtcEndpointMap).forEach((rtcEndpoint) => rtcEndpoint.receive(__classPrivateFieldGet(this, _processAction)));
|
|
47
|
+
}
|
|
48
|
+
getEndpointById(endpointId) {
|
|
49
|
+
const endpoint = __classPrivateFieldGet(this, _rtcEndpointMap).get(endpointId);
|
|
50
|
+
if (!endpoint) {
|
|
51
|
+
throw new Error(`Client with endpoint id ${endpointId} is not connected`);
|
|
52
|
+
}
|
|
53
|
+
return endpoint;
|
|
54
|
+
}
|
|
55
|
+
get connected() {
|
|
56
|
+
return __classPrivateFieldGet(this, _connected);
|
|
57
|
+
}
|
|
58
|
+
isEndpointConnected(endpointId) {
|
|
59
|
+
return __classPrivateFieldGet(this, _rtcEndpointMap).has(endpointId);
|
|
60
|
+
}
|
|
61
|
+
addEndpoint(endpointId, payload) {
|
|
62
|
+
if (!__classPrivateFieldGet(this, _connected)) {
|
|
63
|
+
console.warn('Adding endpoint to disconnected RTC Strategy');
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const clientStrat = new endpoint_1.RTCEndpoint(payload.rtc, payload.endpointIdentity);
|
|
67
|
+
if (__classPrivateFieldGet(this, _processAction)) {
|
|
68
|
+
clientStrat.receive(__classPrivateFieldGet(this, _processAction));
|
|
69
|
+
}
|
|
70
|
+
__classPrivateFieldGet(this, _rtcEndpointMap).set(endpointId, clientStrat);
|
|
71
|
+
}
|
|
72
|
+
async closeEndpoint(endpointId) {
|
|
73
|
+
__classPrivateFieldGet(this, _rtcEndpointMap).delete(endpointId);
|
|
74
|
+
}
|
|
75
|
+
isValidEndpointPayload(payload) {
|
|
76
|
+
const isObject = (x) => {
|
|
77
|
+
return typeof x === 'object' && x !== null;
|
|
78
|
+
};
|
|
79
|
+
return (isObject(payload) &&
|
|
80
|
+
isObject(payload.endpointIdentity) &&
|
|
81
|
+
isObject(payload.rtc) &&
|
|
82
|
+
typeof payload.endpointIdentity.endpointId === 'string');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.RTCStrategy = RTCStrategy;
|
|
86
|
+
_processAction = new WeakMap(), _rtcEndpointMap = new WeakMap(), _connected = new WeakMap();
|
|
87
|
+
exports.RTCInfo = { version: 1, minimumVersion: 0, type: 'rtc' };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { MessagingProtocols } from '.';
|
|
2
|
-
import { ClassicStrategy } from './classic/strategy';
|
|
3
|
-
import CombinedStrategy from './combined/strategy';
|
|
4
|
-
import { RTCStrategy } from './rtc/strategy';
|
|
5
|
-
import { ChannelStrategy } from './strategy';
|
|
6
|
-
declare type StrategyMap = {
|
|
7
|
-
rtc: RTCStrategy;
|
|
8
|
-
classic: ClassicStrategy;
|
|
9
|
-
};
|
|
10
|
-
export declare type StrategyByProtocol<T extends MessagingProtocols> = StrategyMap[T];
|
|
11
|
-
export declare type PayloadTypeByStrategy<T extends ChannelStrategy<unknown>> = T extends ChannelStrategy<infer U> ? U : never;
|
|
12
|
-
export declare type AnyStrategy = ClassicStrategy | RTCStrategy | CombinedStrategy<PayloadTypeByStrategy<RTCStrategy>, PayloadTypeByStrategy<ClassicStrategy>>;
|
|
13
|
-
export {};
|
|
1
|
+
import { MessagingProtocols } from '.';
|
|
2
|
+
import { ClassicStrategy } from './classic/strategy';
|
|
3
|
+
import CombinedStrategy from './combined/strategy';
|
|
4
|
+
import { RTCStrategy } from './rtc/strategy';
|
|
5
|
+
import { ChannelStrategy } from './strategy';
|
|
6
|
+
declare type StrategyMap = {
|
|
7
|
+
rtc: RTCStrategy;
|
|
8
|
+
classic: ClassicStrategy;
|
|
9
|
+
};
|
|
10
|
+
export declare type StrategyByProtocol<T extends MessagingProtocols> = StrategyMap[T];
|
|
11
|
+
export declare type PayloadTypeByStrategy<T extends ChannelStrategy<unknown>> = T extends ChannelStrategy<infer U> ? U : never;
|
|
12
|
+
export declare type AnyStrategy = ClassicStrategy | RTCStrategy | CombinedStrategy<PayloadTypeByStrategy<RTCStrategy>, PayloadTypeByStrategy<ClassicStrategy>>;
|
|
13
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import ProviderIdentity = OpenFin.ProviderIdentity;
|
|
2
|
-
export interface ChannelStrategy<T extends unknown> {
|
|
3
|
-
onEndpointDisconnect(endpointId: string, listener: () => void): void;
|
|
4
|
-
receive(listener: (action: string, payload: any, identity: any) => Promise<any>): void;
|
|
5
|
-
send(endpointId: string, action: string, payload: any): Promise<any>;
|
|
6
|
-
closeEndpoint(endpointId: string): Promise<void>;
|
|
7
|
-
close(): Promise<void>;
|
|
8
|
-
isEndpointConnected(endpointId: string): boolean;
|
|
9
|
-
addEndpoint(endpointId: string, payload: T): void;
|
|
10
|
-
isValidEndpointPayload(payload: unknown): payload is T;
|
|
11
|
-
}
|
|
12
|
-
export declare type EndpointIdentity = OpenFin.ClientIdentity | ProviderIdentity;
|
|
13
|
-
export declare type EndpointPayload = {
|
|
14
|
-
endpointIdentity: EndpointIdentity;
|
|
15
|
-
};
|
|
1
|
+
import ProviderIdentity = OpenFin.ProviderIdentity;
|
|
2
|
+
export interface ChannelStrategy<T extends unknown> {
|
|
3
|
+
onEndpointDisconnect(endpointId: string, listener: () => void): void;
|
|
4
|
+
receive(listener: (action: string, payload: any, identity: any) => Promise<any>): void;
|
|
5
|
+
send(endpointId: string, action: string, payload: any): Promise<any>;
|
|
6
|
+
closeEndpoint(endpointId: string): Promise<void>;
|
|
7
|
+
close(): Promise<void>;
|
|
8
|
+
isEndpointConnected(endpointId: string): boolean;
|
|
9
|
+
addEndpoint(endpointId: string, payload: T): void;
|
|
10
|
+
isValidEndpointPayload(payload: unknown): payload is T;
|
|
11
|
+
}
|
|
12
|
+
export declare type EndpointIdentity = OpenFin.ClientIdentity | ProviderIdentity;
|
|
13
|
+
export declare type EndpointPayload = {
|
|
14
|
+
endpointIdentity: EndpointIdentity;
|
|
15
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { ChannelBase } from './channel';
|
|
2
|
-
import Transport from '../../../transport/transport';
|
|
3
|
-
import { AnyStrategy } from './protocols/strategy-types';
|
|
4
|
-
import ProviderIdentity = OpenFin.ProviderIdentity;
|
|
5
|
-
import ClientIdentity = OpenFin.ClientIdentity;
|
|
6
|
-
export declare type ConnectionListener = (identity: ClientIdentity, connectionMessage?: any) => any;
|
|
7
|
-
export declare type DisconnectionListener = (identity: ClientIdentity) => any;
|
|
8
|
-
export declare class ChannelProvider extends ChannelBase {
|
|
9
|
-
#private;
|
|
10
|
-
private static removalMap;
|
|
11
|
-
private connectListener;
|
|
12
|
-
private disconnectListener;
|
|
13
|
-
get connections(): OpenFin.ClientIdentity[];
|
|
14
|
-
static handleClientDisconnection(channel: ChannelProvider, payload: any): void;
|
|
15
|
-
static setProviderRemoval(provider: ChannelProvider, remove: Function): void;
|
|
16
|
-
constructor(providerIdentity: ProviderIdentity, wire: Transport, strategy: AnyStrategy);
|
|
17
|
-
dispatch(to: OpenFin.ClientIdentity | OpenFin.Identity, action: string, payload?: any): Promise<any>;
|
|
18
|
-
protected processAction: (action: string, payload: any, senderIdentity: OpenFin.ClientIdentity | OpenFin.ClientIdentityMultiRuntime) => Promise<any>;
|
|
19
|
-
processConnection(senderId: OpenFin.ClientIdentity, payload: any): Promise<any>;
|
|
20
|
-
publish(action: string, payload: any): Promise<any>[];
|
|
21
|
-
onConnection(listener: ConnectionListener): void;
|
|
22
|
-
onDisconnection(listener: DisconnectionListener): void;
|
|
23
|
-
destroy(): Promise<void>;
|
|
24
|
-
private checkForClientConnection;
|
|
25
|
-
private isClientConnected;
|
|
26
|
-
private isLegacyClientConnected;
|
|
27
|
-
private handleMultiRuntimeLegacyClient;
|
|
28
|
-
private getEndpointIdForOpenFinId;
|
|
29
|
-
private static clientIdentityIncludesEndpointId;
|
|
30
|
-
private static clientIsMultiRuntime;
|
|
31
|
-
}
|
|
1
|
+
import { ChannelBase } from './channel';
|
|
2
|
+
import Transport from '../../../transport/transport';
|
|
3
|
+
import { AnyStrategy } from './protocols/strategy-types';
|
|
4
|
+
import ProviderIdentity = OpenFin.ProviderIdentity;
|
|
5
|
+
import ClientIdentity = OpenFin.ClientIdentity;
|
|
6
|
+
export declare type ConnectionListener = (identity: ClientIdentity, connectionMessage?: any) => any;
|
|
7
|
+
export declare type DisconnectionListener = (identity: ClientIdentity) => any;
|
|
8
|
+
export declare class ChannelProvider extends ChannelBase {
|
|
9
|
+
#private;
|
|
10
|
+
private static removalMap;
|
|
11
|
+
private connectListener;
|
|
12
|
+
private disconnectListener;
|
|
13
|
+
get connections(): OpenFin.ClientIdentity[];
|
|
14
|
+
static handleClientDisconnection(channel: ChannelProvider, payload: any): void;
|
|
15
|
+
static setProviderRemoval(provider: ChannelProvider, remove: Function): void;
|
|
16
|
+
constructor(providerIdentity: ProviderIdentity, wire: Transport, strategy: AnyStrategy);
|
|
17
|
+
dispatch(to: OpenFin.ClientIdentity | OpenFin.Identity, action: string, payload?: any): Promise<any>;
|
|
18
|
+
protected processAction: (action: string, payload: any, senderIdentity: OpenFin.ClientIdentity | OpenFin.ClientIdentityMultiRuntime) => Promise<any>;
|
|
19
|
+
processConnection(senderId: OpenFin.ClientIdentity, payload: any): Promise<any>;
|
|
20
|
+
publish(action: string, payload: any): Promise<any>[];
|
|
21
|
+
onConnection(listener: ConnectionListener): void;
|
|
22
|
+
onDisconnection(listener: DisconnectionListener): void;
|
|
23
|
+
destroy(): Promise<void>;
|
|
24
|
+
private checkForClientConnection;
|
|
25
|
+
private isClientConnected;
|
|
26
|
+
private isLegacyClientConnected;
|
|
27
|
+
private handleMultiRuntimeLegacyClient;
|
|
28
|
+
private getEndpointIdForOpenFinId;
|
|
29
|
+
private static clientIdentityIncludesEndpointId;
|
|
30
|
+
private static clientIsMultiRuntime;
|
|
31
|
+
}
|
|
@@ -1,165 +1,165 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
|
|
3
|
-
if (!privateMap.has(receiver)) {
|
|
4
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
5
|
-
}
|
|
6
|
-
privateMap.set(receiver, value);
|
|
7
|
-
return value;
|
|
8
|
-
};
|
|
9
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
|
|
10
|
-
if (!privateMap.has(receiver)) {
|
|
11
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
12
|
-
}
|
|
13
|
-
return privateMap.get(receiver);
|
|
14
|
-
};
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.ChannelProvider = void 0;
|
|
17
|
-
const channel_1 = require("./channel");
|
|
18
|
-
const runtimeVersioning_1 = require("../../../util/runtimeVersioning");
|
|
19
|
-
let ChannelProvider = /** @class */ (() => {
|
|
20
|
-
var _connections, _protectedObj, _strategy, _removeEndpoint, _close;
|
|
21
|
-
class ChannelProvider extends channel_1.ChannelBase {
|
|
22
|
-
constructor(providerIdentity, wire, strategy) {
|
|
23
|
-
super();
|
|
24
|
-
_connections.set(this, void 0);
|
|
25
|
-
_protectedObj.set(this, void 0);
|
|
26
|
-
_strategy.set(this, void 0);
|
|
27
|
-
_removeEndpoint.set(this, (identity) => {
|
|
28
|
-
const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
|
|
29
|
-
__classPrivateFieldGet(this, _strategy).closeEndpoint(identity.endpointId);
|
|
30
|
-
__classPrivateFieldSet(this, _connections, remainingConnections);
|
|
31
|
-
});
|
|
32
|
-
// Must be bound.
|
|
33
|
-
this.processAction = async (action, payload, senderIdentity) => {
|
|
34
|
-
if (ChannelProvider.clientIsMultiRuntime(senderIdentity) &&
|
|
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);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
const multipleRemoves = channel.connections.filter((identity) => {
|
|
67
|
-
return identity.uuid === payload.uuid && identity.name === payload.name;
|
|
68
|
-
});
|
|
69
|
-
multipleRemoves.forEach(__classPrivateFieldGet(channel, _removeEndpoint));
|
|
70
|
-
}
|
|
71
|
-
channel.disconnectListener(payload);
|
|
72
|
-
}
|
|
73
|
-
static setProviderRemoval(provider, remove) {
|
|
74
|
-
ChannelProvider.removalMap.set(provider, remove);
|
|
75
|
-
}
|
|
76
|
-
dispatch(to, action, payload) {
|
|
77
|
-
var _a;
|
|
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);
|
|
81
|
-
}
|
|
82
|
-
return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
|
|
83
|
-
}
|
|
84
|
-
async processConnection(senderId, payload) {
|
|
85
|
-
__classPrivateFieldGet(this, _connections).push(senderId);
|
|
86
|
-
return this.connectListener(senderId, payload);
|
|
87
|
-
}
|
|
88
|
-
publish(action, payload) {
|
|
89
|
-
return this.connections.map((to) => __classPrivateFieldGet(this, _strategy).send(to.endpointId, action, payload));
|
|
90
|
-
}
|
|
91
|
-
onConnection(listener) {
|
|
92
|
-
this.connectListener = listener;
|
|
93
|
-
}
|
|
94
|
-
onDisconnection(listener) {
|
|
95
|
-
this.disconnectListener = listener;
|
|
96
|
-
}
|
|
97
|
-
async destroy() {
|
|
98
|
-
const protectedObj = __classPrivateFieldGet(this, _protectedObj);
|
|
99
|
-
const { channelName } = protectedObj.providerIdentity;
|
|
100
|
-
__classPrivateFieldSet(this, _connections, []);
|
|
101
|
-
await protectedObj.wire.sendAction('destroy-channel', { channelName });
|
|
102
|
-
__classPrivateFieldGet(this, _close).call(this);
|
|
103
|
-
}
|
|
104
|
-
checkForClientConnection(clientIdentity) {
|
|
105
|
-
if (!this.isClientConnected(clientIdentity)) {
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
|
|
3
|
+
if (!privateMap.has(receiver)) {
|
|
4
|
+
throw new TypeError("attempted to set private field on non-instance");
|
|
5
|
+
}
|
|
6
|
+
privateMap.set(receiver, value);
|
|
7
|
+
return value;
|
|
8
|
+
};
|
|
9
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
|
|
10
|
+
if (!privateMap.has(receiver)) {
|
|
11
|
+
throw new TypeError("attempted to get private field on non-instance");
|
|
12
|
+
}
|
|
13
|
+
return privateMap.get(receiver);
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.ChannelProvider = void 0;
|
|
17
|
+
const channel_1 = require("./channel");
|
|
18
|
+
const runtimeVersioning_1 = require("../../../util/runtimeVersioning");
|
|
19
|
+
let ChannelProvider = /** @class */ (() => {
|
|
20
|
+
var _connections, _protectedObj, _strategy, _removeEndpoint, _close;
|
|
21
|
+
class ChannelProvider extends channel_1.ChannelBase {
|
|
22
|
+
constructor(providerIdentity, wire, strategy) {
|
|
23
|
+
super();
|
|
24
|
+
_connections.set(this, void 0);
|
|
25
|
+
_protectedObj.set(this, void 0);
|
|
26
|
+
_strategy.set(this, void 0);
|
|
27
|
+
_removeEndpoint.set(this, (identity) => {
|
|
28
|
+
const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
|
|
29
|
+
__classPrivateFieldGet(this, _strategy).closeEndpoint(identity.endpointId);
|
|
30
|
+
__classPrivateFieldSet(this, _connections, remainingConnections);
|
|
31
|
+
});
|
|
32
|
+
// Must be bound.
|
|
33
|
+
this.processAction = async (action, payload, senderIdentity) => {
|
|
34
|
+
if (ChannelProvider.clientIsMultiRuntime(senderIdentity) &&
|
|
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);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const multipleRemoves = channel.connections.filter((identity) => {
|
|
67
|
+
return identity.uuid === payload.uuid && identity.name === payload.name;
|
|
68
|
+
});
|
|
69
|
+
multipleRemoves.forEach(__classPrivateFieldGet(channel, _removeEndpoint));
|
|
70
|
+
}
|
|
71
|
+
channel.disconnectListener(payload);
|
|
72
|
+
}
|
|
73
|
+
static setProviderRemoval(provider, remove) {
|
|
74
|
+
ChannelProvider.removalMap.set(provider, remove);
|
|
75
|
+
}
|
|
76
|
+
dispatch(to, action, payload) {
|
|
77
|
+
var _a;
|
|
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);
|
|
81
|
+
}
|
|
82
|
+
return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
|
|
83
|
+
}
|
|
84
|
+
async processConnection(senderId, payload) {
|
|
85
|
+
__classPrivateFieldGet(this, _connections).push(senderId);
|
|
86
|
+
return this.connectListener(senderId, payload);
|
|
87
|
+
}
|
|
88
|
+
publish(action, payload) {
|
|
89
|
+
return this.connections.map((to) => __classPrivateFieldGet(this, _strategy).send(to.endpointId, action, payload));
|
|
90
|
+
}
|
|
91
|
+
onConnection(listener) {
|
|
92
|
+
this.connectListener = listener;
|
|
93
|
+
}
|
|
94
|
+
onDisconnection(listener) {
|
|
95
|
+
this.disconnectListener = listener;
|
|
96
|
+
}
|
|
97
|
+
async destroy() {
|
|
98
|
+
const protectedObj = __classPrivateFieldGet(this, _protectedObj);
|
|
99
|
+
const { channelName } = protectedObj.providerIdentity;
|
|
100
|
+
__classPrivateFieldSet(this, _connections, []);
|
|
101
|
+
await protectedObj.wire.sendAction('destroy-channel', { channelName });
|
|
102
|
+
__classPrivateFieldGet(this, _close).call(this);
|
|
103
|
+
}
|
|
104
|
+
checkForClientConnection(clientIdentity) {
|
|
105
|
+
if (!this.isClientConnected(clientIdentity)) {
|
|
106
106
|
throw new Error(`This action was sent from a client that is not connected to the provider.
|
|
107
|
-
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
|
-
}
|
|
122
|
-
isLegacyClientConnected(clientIdentity) {
|
|
123
|
-
return this.connections.some((identity) => {
|
|
124
|
-
return identity.uuid === clientIdentity.uuid && identity.name === clientIdentity.name;
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
handleMultiRuntimeLegacyClient(senderIdentity) {
|
|
128
|
-
if (!this.isLegacyClientConnected(senderIdentity)) {
|
|
107
|
+
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
|
+
}
|
|
122
|
+
isLegacyClientConnected(clientIdentity) {
|
|
123
|
+
return this.connections.some((identity) => {
|
|
124
|
+
return identity.uuid === clientIdentity.uuid && identity.name === clientIdentity.name;
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
handleMultiRuntimeLegacyClient(senderIdentity) {
|
|
128
|
+
if (!this.isLegacyClientConnected(senderIdentity)) {
|
|
129
129
|
throw new Error(`This action was sent from a client that is not connected to the provider. Client Identity:
|
|
130
|
-
{uuid: ${senderIdentity.uuid}, name: ${senderIdentity.name}, endpointId: ${senderIdentity.endpointId}}`);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
getEndpointIdForOpenFinId(clientIdentity, action) {
|
|
134
|
-
var _a;
|
|
135
|
-
const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
|
|
136
|
-
if (matchingConnections.length >= 2) {
|
|
137
|
-
const protectedObj = __classPrivateFieldGet(this, _protectedObj);
|
|
138
|
-
const { uuid, name } = clientIdentity;
|
|
139
|
-
const providerUuid = protectedObj === null || protectedObj === void 0 ? void 0 : protectedObj.providerIdentity.uuid;
|
|
140
|
-
const providerName = protectedObj === null || protectedObj === void 0 ? void 0 : protectedObj.providerIdentity.name;
|
|
141
|
-
// eslint-disable-next-line no-console
|
|
130
|
+
{uuid: ${senderIdentity.uuid}, name: ${senderIdentity.name}, endpointId: ${senderIdentity.endpointId}}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
getEndpointIdForOpenFinId(clientIdentity, action) {
|
|
134
|
+
var _a;
|
|
135
|
+
const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
|
|
136
|
+
if (matchingConnections.length >= 2) {
|
|
137
|
+
const protectedObj = __classPrivateFieldGet(this, _protectedObj);
|
|
138
|
+
const { uuid, name } = clientIdentity;
|
|
139
|
+
const providerUuid = protectedObj === null || protectedObj === void 0 ? void 0 : protectedObj.providerIdentity.uuid;
|
|
140
|
+
const providerName = protectedObj === null || protectedObj === void 0 ? void 0 : protectedObj.providerIdentity.name;
|
|
141
|
+
// eslint-disable-next-line no-console
|
|
142
142
|
console.warn(`WARNING: Dispatch call may have unintended results. The "to" argument of your dispatch call is missing the
|
|
143
143
|
"endpointId" parameter. The identity you are dispatching to ({uuid: ${uuid}, name: ${name}})
|
|
144
144
|
has multiple channelClients for this channel. Your dispatched action: (${action}) from the provider:
|
|
145
|
-
({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
|
-
}
|
|
158
|
-
}
|
|
159
|
-
_connections = new WeakMap(), _protectedObj = new WeakMap(), _strategy = new WeakMap(), _removeEndpoint = new WeakMap(), _close = new WeakMap();
|
|
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
|
-
})();
|
|
165
|
-
exports.ChannelProvider = ChannelProvider;
|
|
145
|
+
({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
|
+
}
|
|
158
|
+
}
|
|
159
|
+
_connections = new WeakMap(), _protectedObj = new WeakMap(), _strategy = new WeakMap(), _removeEndpoint = new WeakMap(), _close = new WeakMap();
|
|
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
|
+
})();
|
|
165
|
+
exports.ChannelProvider = ChannelProvider;
|