@openfin/node-adapter 40.104.2 → 40.104.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/node-adapter.js +140 -107
- package/package.json +2 -2
package/out/node-adapter.js
CHANGED
|
@@ -73,13 +73,13 @@ async function promiseMapSerial(arr, func) {
|
|
|
73
73
|
}
|
|
74
74
|
promises.promiseMapSerial = promiseMapSerial;
|
|
75
75
|
|
|
76
|
-
var __classPrivateFieldSet$
|
|
76
|
+
var __classPrivateFieldSet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
77
77
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
78
78
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
79
79
|
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");
|
|
80
80
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
81
81
|
};
|
|
82
|
-
var __classPrivateFieldGet$
|
|
82
|
+
var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
83
83
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
84
84
|
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");
|
|
85
85
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -164,7 +164,7 @@ class EmitterBase extends Base {
|
|
|
164
164
|
this.emit = (eventType, payload, ...args) => {
|
|
165
165
|
return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
|
|
166
166
|
};
|
|
167
|
-
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$
|
|
167
|
+
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$f(this, _EmitterBase_emitterAccessor, "f"));
|
|
168
168
|
/**
|
|
169
169
|
* Cleans up after removal of a listener, e.g. deleting any lingering deregistration handlers for a
|
|
170
170
|
* `once` subscription.
|
|
@@ -174,14 +174,14 @@ class EmitterBase extends Base {
|
|
|
174
174
|
* which would involve less "magic," but would be more-vulnerable to accidental re-introduction of a leak.
|
|
175
175
|
*/
|
|
176
176
|
this.cleanUpRemovedListener = (eventType, listener) => {
|
|
177
|
-
const deregister = __classPrivateFieldGet$
|
|
177
|
+
const deregister = __classPrivateFieldGet$f(this, _EmitterBase_deregisterOnceListeners, "f").get(listener);
|
|
178
178
|
if (deregister) {
|
|
179
|
-
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$
|
|
179
|
+
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$f(this, _EmitterBase_emitterAccessor, "f"));
|
|
180
180
|
emitter.removeListener(eventType, deregister);
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
183
|
this.getOrCreateEmitter = () => {
|
|
184
|
-
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$
|
|
184
|
+
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$f(this, _EmitterBase_emitterAccessor, "f"));
|
|
185
185
|
if (!emitter.listeners('removeListener').includes(this.cleanUpRemovedListener)) {
|
|
186
186
|
emitter.on('removeListener', this.cleanUpRemovedListener);
|
|
187
187
|
}
|
|
@@ -223,8 +223,8 @@ class EmitterBase extends Base {
|
|
|
223
223
|
// This will only be reached if unsubscribe from event that does not exist but do not want to error here
|
|
224
224
|
return Promise.resolve();
|
|
225
225
|
};
|
|
226
|
-
__classPrivateFieldSet$
|
|
227
|
-
__classPrivateFieldSet$
|
|
226
|
+
__classPrivateFieldSet$e(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
|
|
227
|
+
__classPrivateFieldSet$e(this, _EmitterBase_deregisterOnceListeners, new WeakMap(), "f");
|
|
228
228
|
this.listeners = (event) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(event) : [];
|
|
229
229
|
}
|
|
230
230
|
/**
|
|
@@ -253,7 +253,7 @@ class EmitterBase extends Base {
|
|
|
253
253
|
*/
|
|
254
254
|
async once(eventType, listener, options) {
|
|
255
255
|
const deregister = () => this.deregisterEventListener(eventType);
|
|
256
|
-
__classPrivateFieldGet$
|
|
256
|
+
__classPrivateFieldGet$f(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
|
|
257
257
|
await this.registerEventListener(eventType, options, (emitter) => {
|
|
258
258
|
emitter.once(eventType, deregister);
|
|
259
259
|
emitter.once(eventType, listener);
|
|
@@ -284,7 +284,7 @@ class EmitterBase extends Base {
|
|
|
284
284
|
*/
|
|
285
285
|
async prependOnceListener(eventType, listener, options) {
|
|
286
286
|
const deregister = () => this.deregisterEventListener(eventType);
|
|
287
|
-
__classPrivateFieldGet$
|
|
287
|
+
__classPrivateFieldGet$f(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
|
|
288
288
|
await this.registerEventListener(eventType, options, (emitter) => {
|
|
289
289
|
emitter.prependOnceListener(eventType, listener);
|
|
290
290
|
emitter.once(eventType, deregister);
|
|
@@ -344,7 +344,7 @@ class EmitterBase extends Base {
|
|
|
344
344
|
}
|
|
345
345
|
deleteEmitterIfNothingRegistered(emitter) {
|
|
346
346
|
if (emitter.eventNames().every((type) => type === 'removeListener')) {
|
|
347
|
-
this.wire.eventAggregator.delete(__classPrivateFieldGet$
|
|
347
|
+
this.wire.eventAggregator.delete(__classPrivateFieldGet$f(this, _EmitterBase_emitterAccessor, "f"));
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
}
|
|
@@ -7425,12 +7425,12 @@ class ChannelError extends Error {
|
|
|
7425
7425
|
}
|
|
7426
7426
|
channelError.ChannelError = ChannelError;
|
|
7427
7427
|
|
|
7428
|
-
var __classPrivateFieldGet$
|
|
7428
|
+
var __classPrivateFieldGet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7429
7429
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7430
7430
|
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");
|
|
7431
7431
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
7432
7432
|
};
|
|
7433
|
-
var __classPrivateFieldSet$
|
|
7433
|
+
var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7434
7434
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
7435
7435
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
7436
7436
|
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");
|
|
@@ -7474,7 +7474,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
7474
7474
|
static closeChannelByEndpointId(id) {
|
|
7475
7475
|
const channel = channelClientsByEndpointId.get(id);
|
|
7476
7476
|
if (channel) {
|
|
7477
|
-
__classPrivateFieldGet$
|
|
7477
|
+
__classPrivateFieldGet$e(channel, _ChannelClient_close, "f").call(channel);
|
|
7478
7478
|
}
|
|
7479
7479
|
}
|
|
7480
7480
|
/**
|
|
@@ -7485,7 +7485,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
7485
7485
|
for (const channelClient of channelClientsByEndpointId.values()) {
|
|
7486
7486
|
if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
|
|
7487
7487
|
channelClient.disconnectListener(eventPayload);
|
|
7488
|
-
__classPrivateFieldGet$
|
|
7488
|
+
__classPrivateFieldGet$e(channelClient, _ChannelClient_close, "f").call(channelClient);
|
|
7489
7489
|
}
|
|
7490
7490
|
}
|
|
7491
7491
|
}
|
|
@@ -7500,12 +7500,12 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
7500
7500
|
this.processAction = (action, payload, senderIdentity) => super.processAction(action, payload, senderIdentity);
|
|
7501
7501
|
_ChannelClient_close.set(this, () => {
|
|
7502
7502
|
channelClientsByEndpointId.delete(this.endpointId);
|
|
7503
|
-
__classPrivateFieldGet$
|
|
7503
|
+
__classPrivateFieldGet$e(this, _ChannelClient_strategy, "f").close();
|
|
7504
7504
|
});
|
|
7505
|
-
__classPrivateFieldSet$
|
|
7505
|
+
__classPrivateFieldSet$d(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
|
|
7506
7506
|
this.disconnectListener = () => undefined;
|
|
7507
7507
|
this.endpointId = routingInfo.endpointId;
|
|
7508
|
-
__classPrivateFieldSet$
|
|
7508
|
+
__classPrivateFieldSet$d(this, _ChannelClient_strategy, strategy, "f");
|
|
7509
7509
|
channelClientsByEndpointId.set(this.endpointId, this);
|
|
7510
7510
|
strategy.receive(this.processAction);
|
|
7511
7511
|
}
|
|
@@ -7513,7 +7513,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
7513
7513
|
* a read-only provider identity
|
|
7514
7514
|
*/
|
|
7515
7515
|
get providerIdentity() {
|
|
7516
|
-
const protectedObj = __classPrivateFieldGet$
|
|
7516
|
+
const protectedObj = __classPrivateFieldGet$e(this, _ChannelClient_protectedObj, "f");
|
|
7517
7517
|
return protectedObj.providerIdentity;
|
|
7518
7518
|
}
|
|
7519
7519
|
/**
|
|
@@ -7542,9 +7542,9 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
7542
7542
|
* ```
|
|
7543
7543
|
*/
|
|
7544
7544
|
async dispatch(action, payload) {
|
|
7545
|
-
if (__classPrivateFieldGet$
|
|
7545
|
+
if (__classPrivateFieldGet$e(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
|
|
7546
7546
|
const callSites = transport_errors_1$3.RuntimeError.getCallSite();
|
|
7547
|
-
return __classPrivateFieldGet$
|
|
7547
|
+
return __classPrivateFieldGet$e(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
|
|
7548
7548
|
throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
|
|
7549
7549
|
});
|
|
7550
7550
|
}
|
|
@@ -7596,10 +7596,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
7596
7596
|
*/
|
|
7597
7597
|
async disconnect() {
|
|
7598
7598
|
await this.sendDisconnectAction();
|
|
7599
|
-
__classPrivateFieldGet$
|
|
7599
|
+
__classPrivateFieldGet$e(this, _ChannelClient_close, "f").call(this);
|
|
7600
7600
|
}
|
|
7601
7601
|
async sendDisconnectAction() {
|
|
7602
|
-
const protectedObj = __classPrivateFieldGet$
|
|
7602
|
+
const protectedObj = __classPrivateFieldGet$e(this, _ChannelClient_protectedObj, "f");
|
|
7603
7603
|
await protectedObj.close();
|
|
7604
7604
|
}
|
|
7605
7605
|
/**
|
|
@@ -7632,13 +7632,13 @@ exhaustive.exhaustiveCheck = exhaustiveCheck;
|
|
|
7632
7632
|
|
|
7633
7633
|
var strategy$3 = {};
|
|
7634
7634
|
|
|
7635
|
-
var __classPrivateFieldSet$
|
|
7635
|
+
var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7636
7636
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
7637
7637
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
7638
7638
|
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");
|
|
7639
7639
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7640
7640
|
};
|
|
7641
|
-
var __classPrivateFieldGet$
|
|
7641
|
+
var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7642
7642
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7643
7643
|
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");
|
|
7644
7644
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -7663,7 +7663,7 @@ class ClassicStrategy {
|
|
|
7663
7663
|
// connection problems occur
|
|
7664
7664
|
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
|
|
7665
7665
|
this.send = async (endpointId, action, payload) => {
|
|
7666
|
-
const to = __classPrivateFieldGet$
|
|
7666
|
+
const to = __classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
7667
7667
|
if (!to) {
|
|
7668
7668
|
throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
|
|
7669
7669
|
}
|
|
@@ -7675,13 +7675,13 @@ class ClassicStrategy {
|
|
|
7675
7675
|
}
|
|
7676
7676
|
delete cleanId.isLocalEndpointId;
|
|
7677
7677
|
// grab the promise before awaiting it to save in our pending messages map
|
|
7678
|
-
const p = __classPrivateFieldGet$
|
|
7678
|
+
const p = __classPrivateFieldGet$d(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
|
|
7679
7679
|
...cleanId,
|
|
7680
7680
|
providerIdentity: this.providerIdentity,
|
|
7681
7681
|
action,
|
|
7682
7682
|
payload
|
|
7683
7683
|
});
|
|
7684
|
-
__classPrivateFieldGet$
|
|
7684
|
+
__classPrivateFieldGet$d(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
|
|
7685
7685
|
const raw = await p
|
|
7686
7686
|
.catch((error) => {
|
|
7687
7687
|
if ('cause' in error) {
|
|
@@ -7691,16 +7691,16 @@ class ClassicStrategy {
|
|
|
7691
7691
|
})
|
|
7692
7692
|
.finally(() => {
|
|
7693
7693
|
// clean up the pending promise
|
|
7694
|
-
__classPrivateFieldGet$
|
|
7694
|
+
__classPrivateFieldGet$d(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
|
|
7695
7695
|
});
|
|
7696
7696
|
return raw.payload.data.result;
|
|
7697
7697
|
};
|
|
7698
7698
|
this.close = async () => {
|
|
7699
7699
|
this.messageReceiver.removeEndpoint(this.providerIdentity.channelId, this.endpointId);
|
|
7700
|
-
[...__classPrivateFieldGet$
|
|
7701
|
-
__classPrivateFieldSet$
|
|
7700
|
+
[...__classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
|
|
7701
|
+
__classPrivateFieldSet$c(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
|
|
7702
7702
|
};
|
|
7703
|
-
__classPrivateFieldSet$
|
|
7703
|
+
__classPrivateFieldSet$c(this, _ClassicStrategy_wire, wire, "f");
|
|
7704
7704
|
}
|
|
7705
7705
|
onEndpointDisconnect(endpointId, listener) {
|
|
7706
7706
|
// Never fires for 'classic'.
|
|
@@ -7709,20 +7709,20 @@ class ClassicStrategy {
|
|
|
7709
7709
|
this.messageReceiver.addEndpoint(listener, this.providerIdentity.channelId, this.endpointId);
|
|
7710
7710
|
}
|
|
7711
7711
|
async closeEndpoint(endpointId) {
|
|
7712
|
-
const id = __classPrivateFieldGet$
|
|
7713
|
-
__classPrivateFieldGet$
|
|
7714
|
-
const pendingSet = __classPrivateFieldGet$
|
|
7712
|
+
const id = __classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
7713
|
+
__classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
|
|
7714
|
+
const pendingSet = __classPrivateFieldGet$d(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
|
|
7715
7715
|
pendingSet?.forEach((p) => {
|
|
7716
7716
|
const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
|
|
7717
7717
|
p.cancel(new Error(errorMsg));
|
|
7718
7718
|
});
|
|
7719
7719
|
}
|
|
7720
7720
|
isEndpointConnected(endpointId) {
|
|
7721
|
-
return __classPrivateFieldGet$
|
|
7721
|
+
return __classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
|
|
7722
7722
|
}
|
|
7723
7723
|
addEndpoint(endpointId, payload) {
|
|
7724
|
-
__classPrivateFieldGet$
|
|
7725
|
-
__classPrivateFieldGet$
|
|
7724
|
+
__classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
|
|
7725
|
+
__classPrivateFieldGet$d(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
|
|
7726
7726
|
}
|
|
7727
7727
|
isValidEndpointPayload(payload) {
|
|
7728
7728
|
return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
|
|
@@ -7757,12 +7757,12 @@ function errorToPOJO(error) {
|
|
|
7757
7757
|
}
|
|
7758
7758
|
errors.errorToPOJO = errorToPOJO;
|
|
7759
7759
|
|
|
7760
|
-
var __classPrivateFieldGet$
|
|
7760
|
+
var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7761
7761
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7762
7762
|
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");
|
|
7763
7763
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
7764
7764
|
};
|
|
7765
|
-
var __classPrivateFieldSet$
|
|
7765
|
+
var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7766
7766
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
7767
7767
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
7768
7768
|
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");
|
|
@@ -7797,8 +7797,8 @@ class RTCEndpoint {
|
|
|
7797
7797
|
if (this.rtc.rtcClient.connectionState !== 'connected') {
|
|
7798
7798
|
this.rtc.rtcClient.removeEventListener('connectionstatechange', this.connectionStateChangeHandler);
|
|
7799
7799
|
this.close();
|
|
7800
|
-
if (__classPrivateFieldGet$
|
|
7801
|
-
__classPrivateFieldGet$
|
|
7800
|
+
if (__classPrivateFieldGet$c(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
7801
|
+
__classPrivateFieldGet$c(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
|
7802
7802
|
}
|
|
7803
7803
|
}
|
|
7804
7804
|
};
|
|
@@ -7846,9 +7846,9 @@ class RTCEndpoint {
|
|
|
7846
7846
|
data = new TextDecoder().decode(e.data);
|
|
7847
7847
|
}
|
|
7848
7848
|
const { messageId, action, payload } = JSON.parse(data);
|
|
7849
|
-
if (__classPrivateFieldGet$
|
|
7849
|
+
if (__classPrivateFieldGet$c(this, _RTCEndpoint_processAction, "f")) {
|
|
7850
7850
|
try {
|
|
7851
|
-
const res = await __classPrivateFieldGet$
|
|
7851
|
+
const res = await __classPrivateFieldGet$c(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
|
|
7852
7852
|
this.rtc.channels.response.send(JSON.stringify({
|
|
7853
7853
|
messageId,
|
|
7854
7854
|
payload: res,
|
|
@@ -7882,25 +7882,25 @@ class RTCEndpoint {
|
|
|
7882
7882
|
datachannel.onclose = (e) => {
|
|
7883
7883
|
[...this.responseMap.values()].forEach((promise) => promise.reject(new Error('RTCDataChannel closed unexpectedly, this is most commonly caused by message size. Note: RTC Channels have a message size limit of ~255kB.')));
|
|
7884
7884
|
this.close();
|
|
7885
|
-
if (__classPrivateFieldGet$
|
|
7886
|
-
__classPrivateFieldGet$
|
|
7885
|
+
if (__classPrivateFieldGet$c(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
7886
|
+
__classPrivateFieldGet$c(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
|
7887
7887
|
}
|
|
7888
7888
|
};
|
|
7889
7889
|
});
|
|
7890
7890
|
}
|
|
7891
7891
|
onDisconnect(listener) {
|
|
7892
|
-
if (!__classPrivateFieldGet$
|
|
7893
|
-
__classPrivateFieldSet$
|
|
7892
|
+
if (!__classPrivateFieldGet$c(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
7893
|
+
__classPrivateFieldSet$b(this, _RTCEndpoint_disconnectListener, listener, "f");
|
|
7894
7894
|
}
|
|
7895
7895
|
else {
|
|
7896
7896
|
throw new Error('RTCEndpoint disconnectListener cannot be set twice.');
|
|
7897
7897
|
}
|
|
7898
7898
|
}
|
|
7899
7899
|
receive(listener) {
|
|
7900
|
-
if (__classPrivateFieldGet$
|
|
7900
|
+
if (__classPrivateFieldGet$c(this, _RTCEndpoint_processAction, "f")) {
|
|
7901
7901
|
throw new Error('You have already set a listener for this RTC Endpoint.');
|
|
7902
7902
|
}
|
|
7903
|
-
__classPrivateFieldSet$
|
|
7903
|
+
__classPrivateFieldSet$b(this, _RTCEndpoint_processAction, listener, "f");
|
|
7904
7904
|
}
|
|
7905
7905
|
get connected() {
|
|
7906
7906
|
return this.rtc.rtcClient.connectionState === 'connected';
|
|
@@ -7911,12 +7911,12 @@ _RTCEndpoint_processAction = new WeakMap(), _RTCEndpoint_disconnectListener = ne
|
|
|
7911
7911
|
|
|
7912
7912
|
var strategy$1 = {};
|
|
7913
7913
|
|
|
7914
|
-
var __classPrivateFieldGet$
|
|
7914
|
+
var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7915
7915
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7916
7916
|
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");
|
|
7917
7917
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
7918
7918
|
};
|
|
7919
|
-
var __classPrivateFieldSet$
|
|
7919
|
+
var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7920
7920
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
7921
7921
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
7922
7922
|
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");
|
|
@@ -7937,11 +7937,11 @@ class EndpointStrategy {
|
|
|
7937
7937
|
return this.getEndpointById(endpointId).send(action, payload);
|
|
7938
7938
|
};
|
|
7939
7939
|
this.close = async () => {
|
|
7940
|
-
if (__classPrivateFieldGet$
|
|
7941
|
-
__classPrivateFieldGet$
|
|
7942
|
-
__classPrivateFieldSet$
|
|
7940
|
+
if (__classPrivateFieldGet$b(this, _EndpointStrategy_connected, "f")) {
|
|
7941
|
+
__classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
|
|
7942
|
+
__classPrivateFieldSet$a(this, _EndpointStrategy_endpointMap, new Map(), "f");
|
|
7943
7943
|
}
|
|
7944
|
-
__classPrivateFieldSet$
|
|
7944
|
+
__classPrivateFieldSet$a(this, _EndpointStrategy_connected, false, "f");
|
|
7945
7945
|
};
|
|
7946
7946
|
this.isValidEndpointPayload = validateEndpoint;
|
|
7947
7947
|
}
|
|
@@ -7949,39 +7949,39 @@ class EndpointStrategy {
|
|
|
7949
7949
|
this.getEndpointById(endpointId).onDisconnect(listener);
|
|
7950
7950
|
}
|
|
7951
7951
|
receive(listener) {
|
|
7952
|
-
if (__classPrivateFieldGet$
|
|
7952
|
+
if (__classPrivateFieldGet$b(this, _EndpointStrategy_processAction, "f")) {
|
|
7953
7953
|
throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);
|
|
7954
7954
|
}
|
|
7955
|
-
__classPrivateFieldSet$
|
|
7955
|
+
__classPrivateFieldSet$a(this, _EndpointStrategy_processAction, listener, "f");
|
|
7956
7956
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
7957
|
-
__classPrivateFieldGet$
|
|
7957
|
+
__classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$b(this, _EndpointStrategy_processAction, "f")));
|
|
7958
7958
|
}
|
|
7959
7959
|
getEndpointById(endpointId) {
|
|
7960
|
-
const endpoint = __classPrivateFieldGet$
|
|
7960
|
+
const endpoint = __classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
|
|
7961
7961
|
if (!endpoint) {
|
|
7962
7962
|
throw new Error(`Client with endpoint id ${endpointId} is not connected`);
|
|
7963
7963
|
}
|
|
7964
7964
|
return endpoint;
|
|
7965
7965
|
}
|
|
7966
7966
|
get connected() {
|
|
7967
|
-
return __classPrivateFieldGet$
|
|
7967
|
+
return __classPrivateFieldGet$b(this, _EndpointStrategy_connected, "f");
|
|
7968
7968
|
}
|
|
7969
7969
|
isEndpointConnected(endpointId) {
|
|
7970
|
-
return __classPrivateFieldGet$
|
|
7970
|
+
return __classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
|
|
7971
7971
|
}
|
|
7972
7972
|
addEndpoint(endpointId, payload) {
|
|
7973
|
-
if (!__classPrivateFieldGet$
|
|
7973
|
+
if (!__classPrivateFieldGet$b(this, _EndpointStrategy_connected, "f")) {
|
|
7974
7974
|
console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);
|
|
7975
7975
|
return;
|
|
7976
7976
|
}
|
|
7977
7977
|
const clientStrat = new this.EndpointType(payload);
|
|
7978
|
-
if (__classPrivateFieldGet$
|
|
7979
|
-
clientStrat.receive(__classPrivateFieldGet$
|
|
7978
|
+
if (__classPrivateFieldGet$b(this, _EndpointStrategy_processAction, "f")) {
|
|
7979
|
+
clientStrat.receive(__classPrivateFieldGet$b(this, _EndpointStrategy_processAction, "f"));
|
|
7980
7980
|
}
|
|
7981
|
-
__classPrivateFieldGet$
|
|
7981
|
+
__classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
|
|
7982
7982
|
}
|
|
7983
7983
|
async closeEndpoint(endpointId) {
|
|
7984
|
-
__classPrivateFieldGet$
|
|
7984
|
+
__classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
|
|
7985
7985
|
}
|
|
7986
7986
|
}
|
|
7987
7987
|
strategy$1.EndpointStrategy = EndpointStrategy;
|
|
@@ -8163,12 +8163,12 @@ function runtimeUuidMeetsMinimumRuntimeVersion(runtimeUuid, minVersion) {
|
|
|
8163
8163
|
}
|
|
8164
8164
|
runtimeVersioning.runtimeUuidMeetsMinimumRuntimeVersion = runtimeUuidMeetsMinimumRuntimeVersion;
|
|
8165
8165
|
|
|
8166
|
-
var __classPrivateFieldGet$
|
|
8166
|
+
var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8167
8167
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
8168
8168
|
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");
|
|
8169
8169
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
8170
8170
|
};
|
|
8171
|
-
var __classPrivateFieldSet$
|
|
8171
|
+
var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8172
8172
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8173
8173
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
8174
8174
|
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");
|
|
@@ -8212,19 +8212,19 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8212
8212
|
* a read-only array containing all the identities of connecting clients.
|
|
8213
8213
|
*/
|
|
8214
8214
|
get connections() {
|
|
8215
|
-
return [...__classPrivateFieldGet$
|
|
8215
|
+
return [...__classPrivateFieldGet$a(this, _ChannelProvider_connections, "f")];
|
|
8216
8216
|
}
|
|
8217
8217
|
static handleClientDisconnection(channel, payload) {
|
|
8218
8218
|
if (payload?.endpointId) {
|
|
8219
8219
|
const { uuid, name, endpointId, isLocalEndpointId } = payload;
|
|
8220
|
-
__classPrivateFieldGet$
|
|
8220
|
+
__classPrivateFieldGet$a(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
|
|
8221
8221
|
}
|
|
8222
8222
|
else {
|
|
8223
8223
|
// this is here to support older runtimes that did not have endpointId
|
|
8224
8224
|
const multipleRemoves = channel.connections.filter((identity) => {
|
|
8225
8225
|
return identity.uuid === payload.uuid && identity.name === payload.name;
|
|
8226
8226
|
});
|
|
8227
|
-
multipleRemoves.forEach(__classPrivateFieldGet$
|
|
8227
|
+
multipleRemoves.forEach(__classPrivateFieldGet$a(channel, _ChannelProvider_removeEndpoint, "f"));
|
|
8228
8228
|
}
|
|
8229
8229
|
channel.disconnectListener(payload);
|
|
8230
8230
|
}
|
|
@@ -8241,8 +8241,8 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8241
8241
|
_ChannelProvider_strategy.set(this, void 0);
|
|
8242
8242
|
_ChannelProvider_removeEndpoint.set(this, (identity) => {
|
|
8243
8243
|
const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
|
|
8244
|
-
__classPrivateFieldGet$
|
|
8245
|
-
__classPrivateFieldSet$
|
|
8244
|
+
__classPrivateFieldGet$a(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
|
|
8245
|
+
__classPrivateFieldSet$9(this, _ChannelProvider_connections, remainingConnections, "f");
|
|
8246
8246
|
});
|
|
8247
8247
|
// Must be bound.
|
|
8248
8248
|
this.processAction = async (action, payload, senderIdentity) => {
|
|
@@ -8256,17 +8256,17 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8256
8256
|
return super.processAction(action, payload, senderIdentity);
|
|
8257
8257
|
};
|
|
8258
8258
|
_ChannelProvider_close.set(this, () => {
|
|
8259
|
-
__classPrivateFieldGet$
|
|
8259
|
+
__classPrivateFieldGet$a(this, _ChannelProvider_strategy, "f").close();
|
|
8260
8260
|
const remove = ChannelProvider.removalMap.get(this);
|
|
8261
8261
|
if (remove) {
|
|
8262
8262
|
remove();
|
|
8263
8263
|
}
|
|
8264
8264
|
});
|
|
8265
|
-
__classPrivateFieldSet$
|
|
8265
|
+
__classPrivateFieldSet$9(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
|
|
8266
8266
|
this.connectListener = () => undefined;
|
|
8267
8267
|
this.disconnectListener = () => undefined;
|
|
8268
|
-
__classPrivateFieldSet$
|
|
8269
|
-
__classPrivateFieldSet$
|
|
8268
|
+
__classPrivateFieldSet$9(this, _ChannelProvider_connections, [], "f");
|
|
8269
|
+
__classPrivateFieldSet$9(this, _ChannelProvider_strategy, strategy, "f");
|
|
8270
8270
|
strategy.receive(this.processAction);
|
|
8271
8271
|
}
|
|
8272
8272
|
/**
|
|
@@ -8297,16 +8297,16 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8297
8297
|
*/
|
|
8298
8298
|
dispatch(to, action, payload) {
|
|
8299
8299
|
const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
|
|
8300
|
-
if (endpointId && __classPrivateFieldGet$
|
|
8300
|
+
if (endpointId && __classPrivateFieldGet$a(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
|
|
8301
8301
|
const callSites = transport_errors_1$2.RuntimeError.getCallSite();
|
|
8302
|
-
return __classPrivateFieldGet$
|
|
8302
|
+
return __classPrivateFieldGet$a(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
|
|
8303
8303
|
throw new channel_error_1.ChannelError(e, action, payload, callSites);
|
|
8304
8304
|
});
|
|
8305
8305
|
}
|
|
8306
8306
|
return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
|
|
8307
8307
|
}
|
|
8308
8308
|
async processConnection(senderId, payload) {
|
|
8309
|
-
__classPrivateFieldGet$
|
|
8309
|
+
__classPrivateFieldGet$a(this, _ChannelProvider_connections, "f").push(senderId);
|
|
8310
8310
|
return this.connectListener(senderId, payload);
|
|
8311
8311
|
}
|
|
8312
8312
|
/**
|
|
@@ -8329,7 +8329,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8329
8329
|
* ```
|
|
8330
8330
|
*/
|
|
8331
8331
|
publish(action, payload) {
|
|
8332
|
-
return this.connections.map((to) => __classPrivateFieldGet$
|
|
8332
|
+
return this.connections.map((to) => __classPrivateFieldGet$a(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
|
|
8333
8333
|
}
|
|
8334
8334
|
/**
|
|
8335
8335
|
* Register a listener that is called on every new client connection.
|
|
@@ -8403,11 +8403,11 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8403
8403
|
* ```
|
|
8404
8404
|
*/
|
|
8405
8405
|
async destroy() {
|
|
8406
|
-
const protectedObj = __classPrivateFieldGet$
|
|
8406
|
+
const protectedObj = __classPrivateFieldGet$a(this, _ChannelProvider_protectedObj, "f");
|
|
8407
8407
|
protectedObj.providerIdentity;
|
|
8408
|
-
__classPrivateFieldSet$
|
|
8408
|
+
__classPrivateFieldSet$9(this, _ChannelProvider_connections, [], "f");
|
|
8409
8409
|
await protectedObj.close();
|
|
8410
|
-
__classPrivateFieldGet$
|
|
8410
|
+
__classPrivateFieldGet$a(this, _ChannelProvider_close, "f").call(this);
|
|
8411
8411
|
}
|
|
8412
8412
|
/**
|
|
8413
8413
|
* Returns an array with info on every Client connected to the Provider
|
|
@@ -8477,7 +8477,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8477
8477
|
getEndpointIdForOpenFinId(clientIdentity, action) {
|
|
8478
8478
|
const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
|
|
8479
8479
|
if (matchingConnections.length >= 2) {
|
|
8480
|
-
const protectedObj = __classPrivateFieldGet$
|
|
8480
|
+
const protectedObj = __classPrivateFieldGet$a(this, _ChannelProvider_protectedObj, "f");
|
|
8481
8481
|
const { uuid, name } = clientIdentity;
|
|
8482
8482
|
const providerUuid = protectedObj?.providerIdentity.uuid;
|
|
8483
8483
|
const providerName = protectedObj?.providerIdentity.name;
|
|
@@ -8689,13 +8689,13 @@ class CombinedStrategy {
|
|
|
8689
8689
|
}
|
|
8690
8690
|
strategy.default = CombinedStrategy;
|
|
8691
8691
|
|
|
8692
|
-
var __classPrivateFieldSet$
|
|
8692
|
+
var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8693
8693
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8694
8694
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
8695
8695
|
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");
|
|
8696
8696
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
8697
8697
|
};
|
|
8698
|
-
var __classPrivateFieldGet$
|
|
8698
|
+
var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8699
8699
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
8700
8700
|
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");
|
|
8701
8701
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -8744,8 +8744,8 @@ class ConnectionManager extends base_1$f.Base {
|
|
|
8744
8744
|
};
|
|
8745
8745
|
this.providerMap = new Map();
|
|
8746
8746
|
this.protocolManager = new protocol_manager_1.ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
|
|
8747
|
-
__classPrivateFieldSet$
|
|
8748
|
-
__classPrivateFieldSet$
|
|
8747
|
+
__classPrivateFieldSet$8(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
|
|
8748
|
+
__classPrivateFieldSet$8(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
|
|
8749
8749
|
wire.registerMessageHandler(this.onmessage.bind(this));
|
|
8750
8750
|
}
|
|
8751
8751
|
createProvider(options, providerIdentity) {
|
|
@@ -8756,7 +8756,7 @@ class ConnectionManager extends base_1$f.Base {
|
|
|
8756
8756
|
case 'rtc':
|
|
8757
8757
|
return new strategy_2.RTCStrategy();
|
|
8758
8758
|
case 'classic':
|
|
8759
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
|
8759
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$9(this, _ConnectionManager_messageReceiver, "f"),
|
|
8760
8760
|
// Providers do not have an endpointId, use channelId as endpointId in the strategy.
|
|
8761
8761
|
providerIdentity.channelId, providerIdentity);
|
|
8762
8762
|
default:
|
|
@@ -8792,7 +8792,7 @@ class ConnectionManager extends base_1$f.Base {
|
|
|
8792
8792
|
const supportedProtocols = await Promise.all(protocols.map(async (type) => {
|
|
8793
8793
|
switch (type) {
|
|
8794
8794
|
case 'rtc': {
|
|
8795
|
-
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$
|
|
8795
|
+
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$9(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
|
|
8796
8796
|
rtcPacket = { rtcClient, channels, channelsOpened };
|
|
8797
8797
|
return {
|
|
8798
8798
|
type: 'rtc',
|
|
@@ -8819,18 +8819,18 @@ class ConnectionManager extends base_1$f.Base {
|
|
|
8819
8819
|
routingInfo.endpointId = this.wire.environment.getNextMessageId();
|
|
8820
8820
|
// For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
|
|
8821
8821
|
// clients that are in the same context as the newly-connected client.
|
|
8822
|
-
__classPrivateFieldGet$
|
|
8822
|
+
__classPrivateFieldGet$9(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
|
|
8823
8823
|
}
|
|
8824
8824
|
const answer = routingInfo.answer ?? {
|
|
8825
8825
|
supportedProtocols: [{ type: 'classic', version: 1 }]
|
|
8826
8826
|
};
|
|
8827
8827
|
const createStrategyFromAnswer = async (protocol) => {
|
|
8828
8828
|
if (protocol.type === 'rtc' && rtcPacket) {
|
|
8829
|
-
await __classPrivateFieldGet$
|
|
8829
|
+
await __classPrivateFieldGet$9(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
|
|
8830
8830
|
return new strategy_2.RTCStrategy();
|
|
8831
8831
|
}
|
|
8832
8832
|
if (protocol.type === 'classic') {
|
|
8833
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
|
8833
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$9(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
|
|
8834
8834
|
}
|
|
8835
8835
|
return null;
|
|
8836
8836
|
};
|
|
@@ -8898,7 +8898,7 @@ class ConnectionManager extends base_1$f.Base {
|
|
|
8898
8898
|
clientAnswer = await overlappingProtocols.reduce(async (accumP, protocolToUse) => {
|
|
8899
8899
|
const answer = await accumP;
|
|
8900
8900
|
if (protocolToUse.type === 'rtc') {
|
|
8901
|
-
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$
|
|
8901
|
+
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$9(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
|
|
8902
8902
|
answer.supportedProtocols.push({
|
|
8903
8903
|
type: 'rtc',
|
|
8904
8904
|
version: strategy_2.RTCInfo.version,
|
|
@@ -8946,13 +8946,13 @@ _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnec
|
|
|
8946
8946
|
*
|
|
8947
8947
|
* @packageDocumentation
|
|
8948
8948
|
*/
|
|
8949
|
-
var __classPrivateFieldSet$
|
|
8949
|
+
var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8950
8950
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8951
8951
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
8952
8952
|
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");
|
|
8953
8953
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
8954
8954
|
};
|
|
8955
|
-
var __classPrivateFieldGet$
|
|
8955
|
+
var __classPrivateFieldGet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8956
8956
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
8957
8957
|
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");
|
|
8958
8958
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -9009,11 +9009,11 @@ class Channel extends base_1$e.EmitterBase {
|
|
|
9009
9009
|
client_1.ChannelClient.handleProviderDisconnect(eventPayload);
|
|
9010
9010
|
}),
|
|
9011
9011
|
this.on('connected', (...args) => {
|
|
9012
|
-
__classPrivateFieldGet$
|
|
9012
|
+
__classPrivateFieldGet$8(this, _Channel_internalEmitter, "f").emit('connected', ...args);
|
|
9013
9013
|
})
|
|
9014
9014
|
]).catch(() => new Error('error setting up channel connection listeners'));
|
|
9015
9015
|
}));
|
|
9016
|
-
__classPrivateFieldSet$
|
|
9016
|
+
__classPrivateFieldSet$7(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
|
|
9017
9017
|
}
|
|
9018
9018
|
/**
|
|
9019
9019
|
*
|
|
@@ -9088,7 +9088,7 @@ class Channel extends base_1$e.EmitterBase {
|
|
|
9088
9088
|
resolve(true);
|
|
9089
9089
|
}
|
|
9090
9090
|
};
|
|
9091
|
-
__classPrivateFieldGet$
|
|
9091
|
+
__classPrivateFieldGet$8(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
|
|
9092
9092
|
});
|
|
9093
9093
|
try {
|
|
9094
9094
|
if (retryInfo.count > 0) {
|
|
@@ -9120,7 +9120,7 @@ class Channel extends base_1$e.EmitterBase {
|
|
|
9120
9120
|
finally {
|
|
9121
9121
|
retryInfo.count += 1;
|
|
9122
9122
|
// in case of other errors, remove our listener
|
|
9123
|
-
__classPrivateFieldGet$
|
|
9123
|
+
__classPrivateFieldGet$8(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
|
|
9124
9124
|
}
|
|
9125
9125
|
} while (shouldWait); // If we're waiting we retry the above loop
|
|
9126
9126
|
// Should wait was false, no channel was found.
|
|
@@ -9179,12 +9179,12 @@ class Channel extends base_1$e.EmitterBase {
|
|
|
9179
9179
|
async connect(channelName, options = {}) {
|
|
9180
9180
|
// Make sure we don't connect before listeners are set up
|
|
9181
9181
|
// This also errors if we're not in OpenFin, ensuring we don't run unnecessary code
|
|
9182
|
-
await __classPrivateFieldGet$
|
|
9182
|
+
await __classPrivateFieldGet$8(this, _Channel_readyToConnect, "f").getValue();
|
|
9183
9183
|
if (!channelName || typeof channelName !== 'string') {
|
|
9184
9184
|
throw new Error('Please provide a channelName string to connect to a channel.');
|
|
9185
9185
|
}
|
|
9186
9186
|
const opts = { wait: true, ...this.wire.environment.getDefaultChannelOptions().connect, ...options };
|
|
9187
|
-
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$
|
|
9187
|
+
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$8(this, _Channel_connectionManager, "f").createClientOffer(opts);
|
|
9188
9188
|
let connectionUrl;
|
|
9189
9189
|
if (this.fin.me.isFrame || this.fin.me.isView || this.fin.me.isWindow) {
|
|
9190
9190
|
connectionUrl = (await this.fin.me.getInfo()).url;
|
|
@@ -9196,7 +9196,7 @@ class Channel extends base_1$e.EmitterBase {
|
|
|
9196
9196
|
connectionUrl
|
|
9197
9197
|
};
|
|
9198
9198
|
const routingInfo = await this.safeConnect(channelName, opts.wait, connectPayload);
|
|
9199
|
-
const strategy = await __classPrivateFieldGet$
|
|
9199
|
+
const strategy = await __classPrivateFieldGet$8(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
|
|
9200
9200
|
const channel = new client_1.ChannelClient(routingInfo, () => client_1.ChannelClient.wireClose(this.wire, routingInfo, routingInfo.endpointId), strategy);
|
|
9201
9201
|
// It is the client's responsibility to handle endpoint disconnection to the provider.
|
|
9202
9202
|
// If the endpoint dies, the client will force a disconnection through the core.
|
|
@@ -9265,7 +9265,7 @@ class Channel extends base_1$e.EmitterBase {
|
|
|
9265
9265
|
throw new Error('Please provide a channelName to create a channel');
|
|
9266
9266
|
}
|
|
9267
9267
|
const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
|
|
9268
|
-
const channel = __classPrivateFieldGet$
|
|
9268
|
+
const channel = __classPrivateFieldGet$8(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
|
|
9269
9269
|
// TODO: fix typing (internal)
|
|
9270
9270
|
// @ts-expect-error
|
|
9271
9271
|
this.on('client-disconnected', (eventPayload) => {
|
|
@@ -9501,14 +9501,32 @@ var clipboard = {};
|
|
|
9501
9501
|
*
|
|
9502
9502
|
* @packageDocumentation
|
|
9503
9503
|
*/
|
|
9504
|
+
var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9505
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9506
|
+
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");
|
|
9507
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
9508
|
+
};
|
|
9509
|
+
var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
9510
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
9511
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9512
|
+
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");
|
|
9513
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
9514
|
+
};
|
|
9515
|
+
var _Clipboard_instances, _Clipboard_securedApiWarningCount, _Clipboard_warnSecuredApi;
|
|
9504
9516
|
Object.defineProperty(clipboard, "__esModule", { value: true });
|
|
9505
9517
|
clipboard.Clipboard = void 0;
|
|
9506
9518
|
const base_1$c = base;
|
|
9519
|
+
const maxSecuredApiWarnings = 10;
|
|
9507
9520
|
/**
|
|
9508
9521
|
* The Clipboard API allows reading and writing to the clipboard in multiple formats.
|
|
9509
9522
|
*
|
|
9510
9523
|
*/
|
|
9511
9524
|
class Clipboard extends base_1$c.Base {
|
|
9525
|
+
constructor() {
|
|
9526
|
+
super(...arguments);
|
|
9527
|
+
_Clipboard_instances.add(this);
|
|
9528
|
+
_Clipboard_securedApiWarningCount.set(this, 0);
|
|
9529
|
+
}
|
|
9512
9530
|
/**
|
|
9513
9531
|
* Writes data into the clipboard as plain text
|
|
9514
9532
|
* @param writeObj The object for writing data into the clipboard
|
|
@@ -9521,6 +9539,7 @@ class Clipboard extends base_1$c.Base {
|
|
|
9521
9539
|
* ```
|
|
9522
9540
|
*/
|
|
9523
9541
|
async writeText(writeObj) {
|
|
9542
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeText');
|
|
9524
9543
|
await this.wire.sendAction('clipboard-write-text', writeObj);
|
|
9525
9544
|
}
|
|
9526
9545
|
/**
|
|
@@ -9533,6 +9552,7 @@ class Clipboard extends base_1$c.Base {
|
|
|
9533
9552
|
* ```
|
|
9534
9553
|
*/
|
|
9535
9554
|
async readText(type) {
|
|
9555
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readText');
|
|
9536
9556
|
// NOTE: When we start supporting linux, we could detect the OS and choose 'selection' automatically for the user
|
|
9537
9557
|
const { payload } = await this.wire.sendAction('clipboard-read-text', { type });
|
|
9538
9558
|
return payload.data;
|
|
@@ -9550,6 +9570,7 @@ class Clipboard extends base_1$c.Base {
|
|
|
9550
9570
|
* ```
|
|
9551
9571
|
*/
|
|
9552
9572
|
async writeImage(writeRequest) {
|
|
9573
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeImage');
|
|
9553
9574
|
await this.wire.sendAction('clipboard-write-image', writeRequest);
|
|
9554
9575
|
}
|
|
9555
9576
|
/**
|
|
@@ -9585,6 +9606,7 @@ class Clipboard extends base_1$c.Base {
|
|
|
9585
9606
|
* ```
|
|
9586
9607
|
*/
|
|
9587
9608
|
async readImage(readRequest = { format: 'dataURL' }) {
|
|
9609
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readImage');
|
|
9588
9610
|
const { payload } = await this.wire.sendAction('clipboard-read-image', readRequest);
|
|
9589
9611
|
return payload.data;
|
|
9590
9612
|
}
|
|
@@ -9600,6 +9622,7 @@ class Clipboard extends base_1$c.Base {
|
|
|
9600
9622
|
* ```
|
|
9601
9623
|
*/
|
|
9602
9624
|
async writeHtml(writeObj) {
|
|
9625
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeHtml');
|
|
9603
9626
|
await this.wire.sendAction('clipboard-write-html', writeObj);
|
|
9604
9627
|
}
|
|
9605
9628
|
/**
|
|
@@ -9612,6 +9635,7 @@ class Clipboard extends base_1$c.Base {
|
|
|
9612
9635
|
* ```
|
|
9613
9636
|
*/
|
|
9614
9637
|
async readHtml(type) {
|
|
9638
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readHtml');
|
|
9615
9639
|
const { payload } = await this.wire.sendAction('clipboard-read-html', { type });
|
|
9616
9640
|
return payload.data;
|
|
9617
9641
|
}
|
|
@@ -9627,6 +9651,7 @@ class Clipboard extends base_1$c.Base {
|
|
|
9627
9651
|
* ```
|
|
9628
9652
|
*/
|
|
9629
9653
|
async writeRtf(writeObj) {
|
|
9654
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeRtf');
|
|
9630
9655
|
await this.wire.sendAction('clipboard-write-rtf', writeObj);
|
|
9631
9656
|
}
|
|
9632
9657
|
/**
|
|
@@ -9647,6 +9672,7 @@ class Clipboard extends base_1$c.Base {
|
|
|
9647
9672
|
* ```
|
|
9648
9673
|
*/
|
|
9649
9674
|
async readRtf(type) {
|
|
9675
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readRtf');
|
|
9650
9676
|
const { payload } = await this.wire.sendAction('clipboard-read-rtf', { type });
|
|
9651
9677
|
return payload.data;
|
|
9652
9678
|
}
|
|
@@ -9670,6 +9696,7 @@ class Clipboard extends base_1$c.Base {
|
|
|
9670
9696
|
* ```
|
|
9671
9697
|
*/
|
|
9672
9698
|
async write(writeObj) {
|
|
9699
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.write');
|
|
9673
9700
|
await this.wire.sendAction('clipboard-write', writeObj);
|
|
9674
9701
|
}
|
|
9675
9702
|
/**
|
|
@@ -9687,6 +9714,12 @@ class Clipboard extends base_1$c.Base {
|
|
|
9687
9714
|
}
|
|
9688
9715
|
}
|
|
9689
9716
|
clipboard.Clipboard = Clipboard;
|
|
9717
|
+
_Clipboard_securedApiWarningCount = new WeakMap(), _Clipboard_instances = new WeakSet(), _Clipboard_warnSecuredApi = async function _Clipboard_warnSecuredApi(apiName) {
|
|
9718
|
+
if (__classPrivateFieldGet$7(this, _Clipboard_securedApiWarningCount, "f") <= maxSecuredApiWarnings) {
|
|
9719
|
+
console.warn(`Clipboard APIs will be secure-by-default starting in v42. To continue using this API without interruption, make sure to grant explicit API permissions for ${apiName} in the Desktop Owner Settings, and in the Application, Window, View, or Domain Settings. For more information, see https://resources.here.io/docs/core/develop/security/api-security/`);
|
|
9720
|
+
__classPrivateFieldSet$6(this, _Clipboard_securedApiWarningCount, __classPrivateFieldGet$7(this, _Clipboard_securedApiWarningCount, "f") + 1, "f");
|
|
9721
|
+
}
|
|
9722
|
+
};
|
|
9690
9723
|
|
|
9691
9724
|
var externalApplication = {};
|
|
9692
9725
|
|
|
@@ -17807,7 +17840,7 @@ class NodeEnvironment extends BaseEnvironment_1 {
|
|
|
17807
17840
|
};
|
|
17808
17841
|
}
|
|
17809
17842
|
getAdapterVersionSync() {
|
|
17810
|
-
return "40.104.
|
|
17843
|
+
return "40.104.3";
|
|
17811
17844
|
}
|
|
17812
17845
|
observeBounds(element, onChange) {
|
|
17813
17846
|
throw new Error('Method not implemented.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfin/node-adapter",
|
|
3
|
-
"version": "40.104.
|
|
3
|
+
"version": "40.104.3",
|
|
4
4
|
"description": "See README.md",
|
|
5
5
|
"main": "out/node-adapter.js",
|
|
6
6
|
"types": "out/node-adapter.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"author": "OpenFin",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@types/node": "^20.14.2",
|
|
27
|
-
"@openfin/core": "40.104.
|
|
27
|
+
"@openfin/core": "40.104.3",
|
|
28
28
|
"lodash": "^4.17.21",
|
|
29
29
|
"ws": "^7.3.0"
|
|
30
30
|
}
|