@openfin/remote-adapter 42.100.35 → 42.100.40
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/remote-adapter.js +164 -131
- package/package.json +2 -2
package/out/remote-adapter.js
CHANGED
|
@@ -49,13 +49,13 @@ async function promiseMapSerial(arr, func) {
|
|
|
49
49
|
}
|
|
50
50
|
promises.promiseMapSerial = promiseMapSerial;
|
|
51
51
|
|
|
52
|
-
var __classPrivateFieldSet$
|
|
52
|
+
var __classPrivateFieldSet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
53
53
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
54
54
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
55
55
|
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");
|
|
56
56
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
57
57
|
};
|
|
58
|
-
var __classPrivateFieldGet$
|
|
58
|
+
var __classPrivateFieldGet$i = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
59
59
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
60
60
|
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");
|
|
61
61
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -140,7 +140,7 @@ class EmitterBase extends Base {
|
|
|
140
140
|
this.emit = (eventType, payload, ...args) => {
|
|
141
141
|
return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
|
|
142
142
|
};
|
|
143
|
-
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$
|
|
143
|
+
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
|
|
144
144
|
/**
|
|
145
145
|
* Cleans up after removal of a listener, e.g. deleting any lingering deregistration handlers for a
|
|
146
146
|
* `once` subscription.
|
|
@@ -150,14 +150,14 @@ class EmitterBase extends Base {
|
|
|
150
150
|
* which would involve less "magic," but would be more-vulnerable to accidental re-introduction of a leak.
|
|
151
151
|
*/
|
|
152
152
|
this.cleanUpRemovedListener = (eventType, listener) => {
|
|
153
|
-
const deregister = __classPrivateFieldGet$
|
|
153
|
+
const deregister = __classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").get(listener);
|
|
154
154
|
if (deregister) {
|
|
155
|
-
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$
|
|
155
|
+
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
|
|
156
156
|
emitter.removeListener(eventType, deregister);
|
|
157
157
|
}
|
|
158
158
|
};
|
|
159
159
|
this.getOrCreateEmitter = () => {
|
|
160
|
-
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$
|
|
160
|
+
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
|
|
161
161
|
if (!emitter.listeners('removeListener').includes(this.cleanUpRemovedListener)) {
|
|
162
162
|
emitter.on('removeListener', this.cleanUpRemovedListener);
|
|
163
163
|
}
|
|
@@ -199,8 +199,8 @@ class EmitterBase extends Base {
|
|
|
199
199
|
// This will only be reached if unsubscribe from event that does not exist but do not want to error here
|
|
200
200
|
return Promise.resolve();
|
|
201
201
|
};
|
|
202
|
-
__classPrivateFieldSet$
|
|
203
|
-
__classPrivateFieldSet$
|
|
202
|
+
__classPrivateFieldSet$h(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
|
|
203
|
+
__classPrivateFieldSet$h(this, _EmitterBase_deregisterOnceListeners, new WeakMap(), "f");
|
|
204
204
|
this.listeners = (event) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(event) : [];
|
|
205
205
|
}
|
|
206
206
|
/**
|
|
@@ -229,7 +229,7 @@ class EmitterBase extends Base {
|
|
|
229
229
|
*/
|
|
230
230
|
async once(eventType, listener, options) {
|
|
231
231
|
const deregister = () => this.deregisterEventListener(eventType);
|
|
232
|
-
__classPrivateFieldGet$
|
|
232
|
+
__classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
|
|
233
233
|
await this.registerEventListener(eventType, options, (emitter) => {
|
|
234
234
|
emitter.once(eventType, deregister);
|
|
235
235
|
emitter.once(eventType, listener);
|
|
@@ -260,7 +260,7 @@ class EmitterBase extends Base {
|
|
|
260
260
|
*/
|
|
261
261
|
async prependOnceListener(eventType, listener, options) {
|
|
262
262
|
const deregister = () => this.deregisterEventListener(eventType);
|
|
263
|
-
__classPrivateFieldGet$
|
|
263
|
+
__classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
|
|
264
264
|
await this.registerEventListener(eventType, options, (emitter) => {
|
|
265
265
|
emitter.prependOnceListener(eventType, listener);
|
|
266
266
|
emitter.once(eventType, deregister);
|
|
@@ -320,7 +320,7 @@ class EmitterBase extends Base {
|
|
|
320
320
|
}
|
|
321
321
|
deleteEmitterIfNothingRegistered(emitter) {
|
|
322
322
|
if (emitter.eventNames().every((type) => type === 'removeListener')) {
|
|
323
|
-
this.wire.eventAggregator.delete(__classPrivateFieldGet$
|
|
323
|
+
this.wire.eventAggregator.delete(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
}
|
|
@@ -851,13 +851,13 @@ class AsyncRetryableLazy {
|
|
|
851
851
|
}
|
|
852
852
|
lazy.AsyncRetryableLazy = AsyncRetryableLazy;
|
|
853
853
|
|
|
854
|
-
var __classPrivateFieldSet$
|
|
854
|
+
var __classPrivateFieldSet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
855
855
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
856
856
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
857
857
|
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");
|
|
858
858
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
859
859
|
};
|
|
860
|
-
var __classPrivateFieldGet$
|
|
860
|
+
var __classPrivateFieldGet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
861
861
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
862
862
|
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");
|
|
863
863
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -1048,19 +1048,19 @@ class InteropBroker extends base_1$m.Base {
|
|
|
1048
1048
|
_InteropBroker_contextGroups.set(this, void 0);
|
|
1049
1049
|
_InteropBroker_providerPromise.set(this, void 0);
|
|
1050
1050
|
this.getProvider = () => {
|
|
1051
|
-
return __classPrivateFieldGet$
|
|
1051
|
+
return __classPrivateFieldGet$h(this, _InteropBroker_providerPromise, "f").getValue();
|
|
1052
1052
|
};
|
|
1053
1053
|
this.interopClients = new Map();
|
|
1054
1054
|
this.contextGroupsById = new Map();
|
|
1055
|
-
__classPrivateFieldSet$
|
|
1056
|
-
__classPrivateFieldSet$
|
|
1055
|
+
__classPrivateFieldSet$g(this, _InteropBroker_contextGroups, options.contextGroups ?? [...defaultContextGroups], "f");
|
|
1056
|
+
__classPrivateFieldSet$g(this, _InteropBroker_fdc3Info, options.fdc3Info, "f");
|
|
1057
1057
|
if (options?.logging) {
|
|
1058
1058
|
this.logging = options.logging;
|
|
1059
1059
|
}
|
|
1060
1060
|
this.intentClientMap = new Map();
|
|
1061
1061
|
this.lastContextMap = new Map();
|
|
1062
1062
|
this.sessionContextGroupMap = new Map();
|
|
1063
|
-
__classPrivateFieldSet$
|
|
1063
|
+
__classPrivateFieldSet$g(this, _InteropBroker_providerPromise, new lazy_1$2.Lazy(createProvider), "f");
|
|
1064
1064
|
this.setContextGroupMap();
|
|
1065
1065
|
this.setupChannelProvider();
|
|
1066
1066
|
}
|
|
@@ -1328,7 +1328,7 @@ class InteropBroker extends base_1$m.Base {
|
|
|
1328
1328
|
// don't expose, analytics-only call
|
|
1329
1329
|
});
|
|
1330
1330
|
// Create copy for immutability
|
|
1331
|
-
return __classPrivateFieldGet$
|
|
1331
|
+
return __classPrivateFieldGet$h(this, _InteropBroker_contextGroups, "f").map((contextGroup) => {
|
|
1332
1332
|
return { ...contextGroup };
|
|
1333
1333
|
});
|
|
1334
1334
|
}
|
|
@@ -1739,7 +1739,7 @@ class InteropBroker extends base_1$m.Base {
|
|
|
1739
1739
|
const { fdc3Version } = payload;
|
|
1740
1740
|
return {
|
|
1741
1741
|
fdc3Version,
|
|
1742
|
-
...__classPrivateFieldGet$
|
|
1742
|
+
...__classPrivateFieldGet$h(this, _InteropBroker_fdc3Info, "f"),
|
|
1743
1743
|
optionalFeatures: {
|
|
1744
1744
|
OriginatingAppMetadata: false,
|
|
1745
1745
|
UserChannelMembershipAPIs: true
|
|
@@ -7544,13 +7544,13 @@ function errorToPOJO(error) {
|
|
|
7544
7544
|
}
|
|
7545
7545
|
errors.errorToPOJO = errorToPOJO;
|
|
7546
7546
|
|
|
7547
|
-
var __classPrivateFieldSet$
|
|
7547
|
+
var __classPrivateFieldSet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7548
7548
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
7549
7549
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
7550
7550
|
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");
|
|
7551
7551
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7552
7552
|
};
|
|
7553
|
-
var __classPrivateFieldGet$
|
|
7553
|
+
var __classPrivateFieldGet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7554
7554
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7555
7555
|
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");
|
|
7556
7556
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -7578,19 +7578,19 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
7578
7578
|
// Typing as unknown to avoid circular dependency, should not be used directly.
|
|
7579
7579
|
_Transport_fin.set(this, void 0);
|
|
7580
7580
|
this.connectSync = () => {
|
|
7581
|
-
const wire = __classPrivateFieldGet$
|
|
7581
|
+
const wire = __classPrivateFieldGet$g(this, _Transport_wire, "f");
|
|
7582
7582
|
wire.connectSync();
|
|
7583
7583
|
};
|
|
7584
7584
|
// This function is only used in our tests.
|
|
7585
7585
|
this.getPort = () => {
|
|
7586
|
-
const wire = __classPrivateFieldGet$
|
|
7586
|
+
const wire = __classPrivateFieldGet$g(this, _Transport_wire, "f");
|
|
7587
7587
|
return wire.getPort();
|
|
7588
7588
|
};
|
|
7589
|
-
__classPrivateFieldSet$
|
|
7589
|
+
__classPrivateFieldSet$f(this, _Transport_wire, factory(this.onmessage.bind(this)), "f");
|
|
7590
7590
|
this.environment = environment;
|
|
7591
|
-
this.sendRaw = __classPrivateFieldGet$
|
|
7591
|
+
this.sendRaw = __classPrivateFieldGet$g(this, _Transport_wire, "f").send.bind(__classPrivateFieldGet$g(this, _Transport_wire, "f"));
|
|
7592
7592
|
this.registerMessageHandler(this.handleMessage.bind(this));
|
|
7593
|
-
__classPrivateFieldGet$
|
|
7593
|
+
__classPrivateFieldGet$g(this, _Transport_wire, "f").on('disconnected', () => {
|
|
7594
7594
|
for (const [, { handleNack }] of this.wireListeners) {
|
|
7595
7595
|
handleNack({ reason: 'Remote connection has closed' });
|
|
7596
7596
|
}
|
|
@@ -7602,24 +7602,24 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
7602
7602
|
this.me = (0, me_1$1.getBaseMe)(entityType, uuid, name);
|
|
7603
7603
|
}
|
|
7604
7604
|
getFin() {
|
|
7605
|
-
if (!__classPrivateFieldGet$
|
|
7605
|
+
if (!__classPrivateFieldGet$g(this, _Transport_fin, "f")) {
|
|
7606
7606
|
throw new Error('No Fin object registered for this transport');
|
|
7607
7607
|
}
|
|
7608
|
-
return __classPrivateFieldGet$
|
|
7608
|
+
return __classPrivateFieldGet$g(this, _Transport_fin, "f");
|
|
7609
7609
|
}
|
|
7610
7610
|
registerFin(_fin) {
|
|
7611
|
-
if (__classPrivateFieldGet$
|
|
7611
|
+
if (__classPrivateFieldGet$g(this, _Transport_fin, "f")) {
|
|
7612
7612
|
throw new Error('Fin object has already been registered for this transport');
|
|
7613
7613
|
}
|
|
7614
|
-
__classPrivateFieldSet$
|
|
7614
|
+
__classPrivateFieldSet$f(this, _Transport_fin, _fin, "f");
|
|
7615
7615
|
}
|
|
7616
7616
|
shutdown() {
|
|
7617
|
-
const wire = __classPrivateFieldGet$
|
|
7617
|
+
const wire = __classPrivateFieldGet$g(this, _Transport_wire, "f");
|
|
7618
7618
|
return wire.shutdown();
|
|
7619
7619
|
}
|
|
7620
7620
|
async connect(config) {
|
|
7621
7621
|
if ((0, wire_1.isConfigWithReceiver)(config)) {
|
|
7622
|
-
await __classPrivateFieldGet$
|
|
7622
|
+
await __classPrivateFieldGet$g(this, _Transport_wire, "f").connect(config.receiver);
|
|
7623
7623
|
return this.authorize(config);
|
|
7624
7624
|
}
|
|
7625
7625
|
if ((0, wire_1.isRemoteConfig)(config)) {
|
|
@@ -7635,13 +7635,13 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
7635
7635
|
return undefined;
|
|
7636
7636
|
}
|
|
7637
7637
|
async connectRemote(config) {
|
|
7638
|
-
await __classPrivateFieldGet$
|
|
7638
|
+
await __classPrivateFieldGet$g(this, _Transport_wire, "f").connect(new (this.environment.getWsConstructor())(config.address));
|
|
7639
7639
|
return this.authorize(config);
|
|
7640
7640
|
}
|
|
7641
7641
|
async connectByPort(config) {
|
|
7642
7642
|
const { address, uuid } = config;
|
|
7643
7643
|
const reqAuthPayload = { ...config, type: 'file-token' };
|
|
7644
|
-
const wire = __classPrivateFieldGet$
|
|
7644
|
+
const wire = __classPrivateFieldGet$g(this, _Transport_wire, "f");
|
|
7645
7645
|
await wire.connect(new (this.environment.getWsConstructor())(config.address));
|
|
7646
7646
|
const requestExtAuthRet = await this.sendAction('request-external-authorization', {
|
|
7647
7647
|
uuid,
|
|
@@ -7677,7 +7677,7 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
7677
7677
|
payload,
|
|
7678
7678
|
messageId
|
|
7679
7679
|
};
|
|
7680
|
-
const wire = __classPrivateFieldGet$
|
|
7680
|
+
const wire = __classPrivateFieldGet$g(this, _Transport_wire, "f");
|
|
7681
7681
|
this.addWireListener(messageId, resolve, (payload) => this.nackHandler(payload, reject, callSites), uncorrelated);
|
|
7682
7682
|
return wire.send(msg).catch(reject);
|
|
7683
7683
|
});
|
|
@@ -7699,7 +7699,7 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
7699
7699
|
const resolver = (data) => {
|
|
7700
7700
|
resolve(data.payload);
|
|
7701
7701
|
};
|
|
7702
|
-
const wire = __classPrivateFieldGet$
|
|
7702
|
+
const wire = __classPrivateFieldGet$g(this, _Transport_wire, "f");
|
|
7703
7703
|
return wire
|
|
7704
7704
|
.send(origData)
|
|
7705
7705
|
.then(() => this.addWireListener(id, resolver, (payload) => this.nackHandler(payload, reject), false))
|
|
@@ -10176,12 +10176,12 @@ class ChannelError extends Error {
|
|
|
10176
10176
|
}
|
|
10177
10177
|
channelError.ChannelError = ChannelError;
|
|
10178
10178
|
|
|
10179
|
-
var __classPrivateFieldGet$
|
|
10179
|
+
var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
10180
10180
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10181
10181
|
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");
|
|
10182
10182
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
10183
10183
|
};
|
|
10184
|
-
var __classPrivateFieldSet$
|
|
10184
|
+
var __classPrivateFieldSet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
10185
10185
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
10186
10186
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10187
10187
|
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");
|
|
@@ -10225,7 +10225,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
10225
10225
|
static closeChannelByEndpointId(id) {
|
|
10226
10226
|
const channel = channelClientsByEndpointId.get(id);
|
|
10227
10227
|
if (channel) {
|
|
10228
|
-
__classPrivateFieldGet$
|
|
10228
|
+
__classPrivateFieldGet$f(channel, _ChannelClient_close, "f").call(channel);
|
|
10229
10229
|
}
|
|
10230
10230
|
}
|
|
10231
10231
|
/**
|
|
@@ -10236,7 +10236,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
10236
10236
|
for (const channelClient of channelClientsByEndpointId.values()) {
|
|
10237
10237
|
if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
|
|
10238
10238
|
channelClient.disconnectListener(eventPayload);
|
|
10239
|
-
__classPrivateFieldGet$
|
|
10239
|
+
__classPrivateFieldGet$f(channelClient, _ChannelClient_close, "f").call(channelClient);
|
|
10240
10240
|
}
|
|
10241
10241
|
}
|
|
10242
10242
|
}
|
|
@@ -10251,12 +10251,12 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
10251
10251
|
this.processAction = (action, payload, senderIdentity) => super.processAction(action, payload, senderIdentity);
|
|
10252
10252
|
_ChannelClient_close.set(this, () => {
|
|
10253
10253
|
channelClientsByEndpointId.delete(this.endpointId);
|
|
10254
|
-
__classPrivateFieldGet$
|
|
10254
|
+
__classPrivateFieldGet$f(this, _ChannelClient_strategy, "f").close();
|
|
10255
10255
|
});
|
|
10256
|
-
__classPrivateFieldSet$
|
|
10256
|
+
__classPrivateFieldSet$e(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
|
|
10257
10257
|
this.disconnectListener = () => undefined;
|
|
10258
10258
|
this.endpointId = routingInfo.endpointId;
|
|
10259
|
-
__classPrivateFieldSet$
|
|
10259
|
+
__classPrivateFieldSet$e(this, _ChannelClient_strategy, strategy, "f");
|
|
10260
10260
|
channelClientsByEndpointId.set(this.endpointId, this);
|
|
10261
10261
|
strategy.receive(this.processAction);
|
|
10262
10262
|
}
|
|
@@ -10264,7 +10264,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
10264
10264
|
* a read-only provider identity
|
|
10265
10265
|
*/
|
|
10266
10266
|
get providerIdentity() {
|
|
10267
|
-
const protectedObj = __classPrivateFieldGet$
|
|
10267
|
+
const protectedObj = __classPrivateFieldGet$f(this, _ChannelClient_protectedObj, "f");
|
|
10268
10268
|
return protectedObj.providerIdentity;
|
|
10269
10269
|
}
|
|
10270
10270
|
/**
|
|
@@ -10293,9 +10293,9 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
10293
10293
|
* ```
|
|
10294
10294
|
*/
|
|
10295
10295
|
async dispatch(action, payload) {
|
|
10296
|
-
if (__classPrivateFieldGet$
|
|
10296
|
+
if (__classPrivateFieldGet$f(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
|
|
10297
10297
|
const callSites = transport_errors_1$1.RuntimeError.getCallSite();
|
|
10298
|
-
return __classPrivateFieldGet$
|
|
10298
|
+
return __classPrivateFieldGet$f(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
|
|
10299
10299
|
throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
|
|
10300
10300
|
});
|
|
10301
10301
|
}
|
|
@@ -10347,10 +10347,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
10347
10347
|
*/
|
|
10348
10348
|
async disconnect() {
|
|
10349
10349
|
await this.sendDisconnectAction();
|
|
10350
|
-
__classPrivateFieldGet$
|
|
10350
|
+
__classPrivateFieldGet$f(this, _ChannelClient_close, "f").call(this);
|
|
10351
10351
|
}
|
|
10352
10352
|
async sendDisconnectAction() {
|
|
10353
|
-
const protectedObj = __classPrivateFieldGet$
|
|
10353
|
+
const protectedObj = __classPrivateFieldGet$f(this, _ChannelClient_protectedObj, "f");
|
|
10354
10354
|
await protectedObj.close();
|
|
10355
10355
|
}
|
|
10356
10356
|
/**
|
|
@@ -10383,13 +10383,13 @@ exhaustive.exhaustiveCheck = exhaustiveCheck;
|
|
|
10383
10383
|
|
|
10384
10384
|
var strategy$3 = {};
|
|
10385
10385
|
|
|
10386
|
-
var __classPrivateFieldSet$
|
|
10386
|
+
var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
10387
10387
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
10388
10388
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10389
10389
|
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");
|
|
10390
10390
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
10391
10391
|
};
|
|
10392
|
-
var __classPrivateFieldGet$
|
|
10392
|
+
var __classPrivateFieldGet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
10393
10393
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10394
10394
|
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");
|
|
10395
10395
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -10414,7 +10414,7 @@ class ClassicStrategy {
|
|
|
10414
10414
|
// connection problems occur
|
|
10415
10415
|
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
|
|
10416
10416
|
this.send = async (endpointId, action, payload) => {
|
|
10417
|
-
const to = __classPrivateFieldGet$
|
|
10417
|
+
const to = __classPrivateFieldGet$e(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
10418
10418
|
if (!to) {
|
|
10419
10419
|
throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
|
|
10420
10420
|
}
|
|
@@ -10426,13 +10426,13 @@ class ClassicStrategy {
|
|
|
10426
10426
|
}
|
|
10427
10427
|
delete cleanId.isLocalEndpointId;
|
|
10428
10428
|
// grab the promise before awaiting it to save in our pending messages map
|
|
10429
|
-
const p = __classPrivateFieldGet$
|
|
10429
|
+
const p = __classPrivateFieldGet$e(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
|
|
10430
10430
|
...cleanId,
|
|
10431
10431
|
providerIdentity: this.providerIdentity,
|
|
10432
10432
|
action,
|
|
10433
10433
|
payload
|
|
10434
10434
|
});
|
|
10435
|
-
__classPrivateFieldGet$
|
|
10435
|
+
__classPrivateFieldGet$e(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
|
|
10436
10436
|
const raw = await p
|
|
10437
10437
|
.catch((error) => {
|
|
10438
10438
|
if ('cause' in error) {
|
|
@@ -10442,16 +10442,16 @@ class ClassicStrategy {
|
|
|
10442
10442
|
})
|
|
10443
10443
|
.finally(() => {
|
|
10444
10444
|
// clean up the pending promise
|
|
10445
|
-
__classPrivateFieldGet$
|
|
10445
|
+
__classPrivateFieldGet$e(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
|
|
10446
10446
|
});
|
|
10447
10447
|
return raw.payload.data.result;
|
|
10448
10448
|
};
|
|
10449
10449
|
this.close = async () => {
|
|
10450
10450
|
this.messageReceiver.removeEndpoint(this.providerIdentity.channelId, this.endpointId);
|
|
10451
|
-
[...__classPrivateFieldGet$
|
|
10452
|
-
__classPrivateFieldSet$
|
|
10451
|
+
[...__classPrivateFieldGet$e(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
|
|
10452
|
+
__classPrivateFieldSet$d(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
|
|
10453
10453
|
};
|
|
10454
|
-
__classPrivateFieldSet$
|
|
10454
|
+
__classPrivateFieldSet$d(this, _ClassicStrategy_wire, wire, "f");
|
|
10455
10455
|
}
|
|
10456
10456
|
onEndpointDisconnect(endpointId, listener) {
|
|
10457
10457
|
// Never fires for 'classic'.
|
|
@@ -10460,20 +10460,20 @@ class ClassicStrategy {
|
|
|
10460
10460
|
this.messageReceiver.addEndpoint(listener, this.providerIdentity.channelId, this.endpointId);
|
|
10461
10461
|
}
|
|
10462
10462
|
async closeEndpoint(endpointId) {
|
|
10463
|
-
const id = __classPrivateFieldGet$
|
|
10464
|
-
__classPrivateFieldGet$
|
|
10465
|
-
const pendingSet = __classPrivateFieldGet$
|
|
10463
|
+
const id = __classPrivateFieldGet$e(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
10464
|
+
__classPrivateFieldGet$e(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
|
|
10465
|
+
const pendingSet = __classPrivateFieldGet$e(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
|
|
10466
10466
|
pendingSet?.forEach((p) => {
|
|
10467
10467
|
const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
|
|
10468
10468
|
p.cancel(new Error(errorMsg));
|
|
10469
10469
|
});
|
|
10470
10470
|
}
|
|
10471
10471
|
isEndpointConnected(endpointId) {
|
|
10472
|
-
return __classPrivateFieldGet$
|
|
10472
|
+
return __classPrivateFieldGet$e(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
|
|
10473
10473
|
}
|
|
10474
10474
|
addEndpoint(endpointId, payload) {
|
|
10475
|
-
__classPrivateFieldGet$
|
|
10476
|
-
__classPrivateFieldGet$
|
|
10475
|
+
__classPrivateFieldGet$e(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
|
|
10476
|
+
__classPrivateFieldGet$e(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
|
|
10477
10477
|
}
|
|
10478
10478
|
isValidEndpointPayload(payload) {
|
|
10479
10479
|
return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
|
|
@@ -10489,12 +10489,12 @@ var strategy$2 = {};
|
|
|
10489
10489
|
|
|
10490
10490
|
var endpoint = {};
|
|
10491
10491
|
|
|
10492
|
-
var __classPrivateFieldGet$
|
|
10492
|
+
var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
10493
10493
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10494
10494
|
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");
|
|
10495
10495
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
10496
10496
|
};
|
|
10497
|
-
var __classPrivateFieldSet$
|
|
10497
|
+
var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
10498
10498
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
10499
10499
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10500
10500
|
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");
|
|
@@ -10529,8 +10529,8 @@ class RTCEndpoint {
|
|
|
10529
10529
|
if (this.rtc.rtcClient.connectionState !== 'connected') {
|
|
10530
10530
|
this.rtc.rtcClient.removeEventListener('connectionstatechange', this.connectionStateChangeHandler);
|
|
10531
10531
|
this.close();
|
|
10532
|
-
if (__classPrivateFieldGet$
|
|
10533
|
-
__classPrivateFieldGet$
|
|
10532
|
+
if (__classPrivateFieldGet$d(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
10533
|
+
__classPrivateFieldGet$d(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
|
10534
10534
|
}
|
|
10535
10535
|
}
|
|
10536
10536
|
};
|
|
@@ -10578,9 +10578,9 @@ class RTCEndpoint {
|
|
|
10578
10578
|
data = new TextDecoder().decode(e.data);
|
|
10579
10579
|
}
|
|
10580
10580
|
const { messageId, action, payload } = JSON.parse(data);
|
|
10581
|
-
if (__classPrivateFieldGet$
|
|
10581
|
+
if (__classPrivateFieldGet$d(this, _RTCEndpoint_processAction, "f")) {
|
|
10582
10582
|
try {
|
|
10583
|
-
const res = await __classPrivateFieldGet$
|
|
10583
|
+
const res = await __classPrivateFieldGet$d(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
|
|
10584
10584
|
this.rtc.channels.response.send(JSON.stringify({
|
|
10585
10585
|
messageId,
|
|
10586
10586
|
payload: res,
|
|
@@ -10614,25 +10614,25 @@ class RTCEndpoint {
|
|
|
10614
10614
|
datachannel.onclose = (e) => {
|
|
10615
10615
|
[...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.')));
|
|
10616
10616
|
this.close();
|
|
10617
|
-
if (__classPrivateFieldGet$
|
|
10618
|
-
__classPrivateFieldGet$
|
|
10617
|
+
if (__classPrivateFieldGet$d(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
10618
|
+
__classPrivateFieldGet$d(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
|
10619
10619
|
}
|
|
10620
10620
|
};
|
|
10621
10621
|
});
|
|
10622
10622
|
}
|
|
10623
10623
|
onDisconnect(listener) {
|
|
10624
|
-
if (!__classPrivateFieldGet$
|
|
10625
|
-
__classPrivateFieldSet$
|
|
10624
|
+
if (!__classPrivateFieldGet$d(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
10625
|
+
__classPrivateFieldSet$c(this, _RTCEndpoint_disconnectListener, listener, "f");
|
|
10626
10626
|
}
|
|
10627
10627
|
else {
|
|
10628
10628
|
throw new Error('RTCEndpoint disconnectListener cannot be set twice.');
|
|
10629
10629
|
}
|
|
10630
10630
|
}
|
|
10631
10631
|
receive(listener) {
|
|
10632
|
-
if (__classPrivateFieldGet$
|
|
10632
|
+
if (__classPrivateFieldGet$d(this, _RTCEndpoint_processAction, "f")) {
|
|
10633
10633
|
throw new Error('You have already set a listener for this RTC Endpoint.');
|
|
10634
10634
|
}
|
|
10635
|
-
__classPrivateFieldSet$
|
|
10635
|
+
__classPrivateFieldSet$c(this, _RTCEndpoint_processAction, listener, "f");
|
|
10636
10636
|
}
|
|
10637
10637
|
get connected() {
|
|
10638
10638
|
return this.rtc.rtcClient.connectionState === 'connected';
|
|
@@ -10643,12 +10643,12 @@ _RTCEndpoint_processAction = new WeakMap(), _RTCEndpoint_disconnectListener = ne
|
|
|
10643
10643
|
|
|
10644
10644
|
var strategy$1 = {};
|
|
10645
10645
|
|
|
10646
|
-
var __classPrivateFieldGet$
|
|
10646
|
+
var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
10647
10647
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10648
10648
|
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");
|
|
10649
10649
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
10650
10650
|
};
|
|
10651
|
-
var __classPrivateFieldSet$
|
|
10651
|
+
var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
10652
10652
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
10653
10653
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10654
10654
|
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");
|
|
@@ -10669,11 +10669,11 @@ class EndpointStrategy {
|
|
|
10669
10669
|
return this.getEndpointById(endpointId).send(action, payload);
|
|
10670
10670
|
};
|
|
10671
10671
|
this.close = async () => {
|
|
10672
|
-
if (__classPrivateFieldGet$
|
|
10673
|
-
__classPrivateFieldGet$
|
|
10674
|
-
__classPrivateFieldSet$
|
|
10672
|
+
if (__classPrivateFieldGet$c(this, _EndpointStrategy_connected, "f")) {
|
|
10673
|
+
__classPrivateFieldGet$c(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
|
|
10674
|
+
__classPrivateFieldSet$b(this, _EndpointStrategy_endpointMap, new Map(), "f");
|
|
10675
10675
|
}
|
|
10676
|
-
__classPrivateFieldSet$
|
|
10676
|
+
__classPrivateFieldSet$b(this, _EndpointStrategy_connected, false, "f");
|
|
10677
10677
|
};
|
|
10678
10678
|
this.isValidEndpointPayload = validateEndpoint;
|
|
10679
10679
|
}
|
|
@@ -10681,39 +10681,39 @@ class EndpointStrategy {
|
|
|
10681
10681
|
this.getEndpointById(endpointId).onDisconnect(listener);
|
|
10682
10682
|
}
|
|
10683
10683
|
receive(listener) {
|
|
10684
|
-
if (__classPrivateFieldGet$
|
|
10684
|
+
if (__classPrivateFieldGet$c(this, _EndpointStrategy_processAction, "f")) {
|
|
10685
10685
|
throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);
|
|
10686
10686
|
}
|
|
10687
|
-
__classPrivateFieldSet$
|
|
10687
|
+
__classPrivateFieldSet$b(this, _EndpointStrategy_processAction, listener, "f");
|
|
10688
10688
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
10689
|
-
__classPrivateFieldGet$
|
|
10689
|
+
__classPrivateFieldGet$c(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$c(this, _EndpointStrategy_processAction, "f")));
|
|
10690
10690
|
}
|
|
10691
10691
|
getEndpointById(endpointId) {
|
|
10692
|
-
const endpoint = __classPrivateFieldGet$
|
|
10692
|
+
const endpoint = __classPrivateFieldGet$c(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
|
|
10693
10693
|
if (!endpoint) {
|
|
10694
10694
|
throw new Error(`Client with endpoint id ${endpointId} is not connected`);
|
|
10695
10695
|
}
|
|
10696
10696
|
return endpoint;
|
|
10697
10697
|
}
|
|
10698
10698
|
get connected() {
|
|
10699
|
-
return __classPrivateFieldGet$
|
|
10699
|
+
return __classPrivateFieldGet$c(this, _EndpointStrategy_connected, "f");
|
|
10700
10700
|
}
|
|
10701
10701
|
isEndpointConnected(endpointId) {
|
|
10702
|
-
return __classPrivateFieldGet$
|
|
10702
|
+
return __classPrivateFieldGet$c(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
|
|
10703
10703
|
}
|
|
10704
10704
|
addEndpoint(endpointId, payload) {
|
|
10705
|
-
if (!__classPrivateFieldGet$
|
|
10705
|
+
if (!__classPrivateFieldGet$c(this, _EndpointStrategy_connected, "f")) {
|
|
10706
10706
|
console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);
|
|
10707
10707
|
return;
|
|
10708
10708
|
}
|
|
10709
10709
|
const clientStrat = new this.EndpointType(payload);
|
|
10710
|
-
if (__classPrivateFieldGet$
|
|
10711
|
-
clientStrat.receive(__classPrivateFieldGet$
|
|
10710
|
+
if (__classPrivateFieldGet$c(this, _EndpointStrategy_processAction, "f")) {
|
|
10711
|
+
clientStrat.receive(__classPrivateFieldGet$c(this, _EndpointStrategy_processAction, "f"));
|
|
10712
10712
|
}
|
|
10713
|
-
__classPrivateFieldGet$
|
|
10713
|
+
__classPrivateFieldGet$c(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
|
|
10714
10714
|
}
|
|
10715
10715
|
async closeEndpoint(endpointId) {
|
|
10716
|
-
__classPrivateFieldGet$
|
|
10716
|
+
__classPrivateFieldGet$c(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
|
|
10717
10717
|
}
|
|
10718
10718
|
}
|
|
10719
10719
|
strategy$1.EndpointStrategy = EndpointStrategy;
|
|
@@ -10895,12 +10895,12 @@ function runtimeUuidMeetsMinimumRuntimeVersion(runtimeUuid, minVersion) {
|
|
|
10895
10895
|
}
|
|
10896
10896
|
runtimeVersioning.runtimeUuidMeetsMinimumRuntimeVersion = runtimeUuidMeetsMinimumRuntimeVersion;
|
|
10897
10897
|
|
|
10898
|
-
var __classPrivateFieldGet$
|
|
10898
|
+
var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
10899
10899
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10900
10900
|
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");
|
|
10901
10901
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
10902
10902
|
};
|
|
10903
|
-
var __classPrivateFieldSet$
|
|
10903
|
+
var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
10904
10904
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
10905
10905
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10906
10906
|
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");
|
|
@@ -10944,19 +10944,19 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
10944
10944
|
* a read-only array containing all the identities of connecting clients.
|
|
10945
10945
|
*/
|
|
10946
10946
|
get connections() {
|
|
10947
|
-
return [...__classPrivateFieldGet$
|
|
10947
|
+
return [...__classPrivateFieldGet$b(this, _ChannelProvider_connections, "f")];
|
|
10948
10948
|
}
|
|
10949
10949
|
static handleClientDisconnection(channel, payload) {
|
|
10950
10950
|
if (payload?.endpointId) {
|
|
10951
10951
|
const { uuid, name, endpointId, isLocalEndpointId } = payload;
|
|
10952
|
-
__classPrivateFieldGet$
|
|
10952
|
+
__classPrivateFieldGet$b(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
|
|
10953
10953
|
}
|
|
10954
10954
|
else {
|
|
10955
10955
|
// this is here to support older runtimes that did not have endpointId
|
|
10956
10956
|
const multipleRemoves = channel.connections.filter((identity) => {
|
|
10957
10957
|
return identity.uuid === payload.uuid && identity.name === payload.name;
|
|
10958
10958
|
});
|
|
10959
|
-
multipleRemoves.forEach(__classPrivateFieldGet$
|
|
10959
|
+
multipleRemoves.forEach(__classPrivateFieldGet$b(channel, _ChannelProvider_removeEndpoint, "f"));
|
|
10960
10960
|
}
|
|
10961
10961
|
channel.disconnectListener(payload);
|
|
10962
10962
|
}
|
|
@@ -10973,8 +10973,8 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
10973
10973
|
_ChannelProvider_strategy.set(this, void 0);
|
|
10974
10974
|
_ChannelProvider_removeEndpoint.set(this, (identity) => {
|
|
10975
10975
|
const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
|
|
10976
|
-
__classPrivateFieldGet$
|
|
10977
|
-
__classPrivateFieldSet$
|
|
10976
|
+
__classPrivateFieldGet$b(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
|
|
10977
|
+
__classPrivateFieldSet$a(this, _ChannelProvider_connections, remainingConnections, "f");
|
|
10978
10978
|
});
|
|
10979
10979
|
// Must be bound.
|
|
10980
10980
|
this.processAction = async (action, payload, senderIdentity) => {
|
|
@@ -10988,17 +10988,17 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
10988
10988
|
return super.processAction(action, payload, senderIdentity);
|
|
10989
10989
|
};
|
|
10990
10990
|
_ChannelProvider_close.set(this, () => {
|
|
10991
|
-
__classPrivateFieldGet$
|
|
10991
|
+
__classPrivateFieldGet$b(this, _ChannelProvider_strategy, "f").close();
|
|
10992
10992
|
const remove = ChannelProvider.removalMap.get(this);
|
|
10993
10993
|
if (remove) {
|
|
10994
10994
|
remove();
|
|
10995
10995
|
}
|
|
10996
10996
|
});
|
|
10997
|
-
__classPrivateFieldSet$
|
|
10997
|
+
__classPrivateFieldSet$a(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
|
|
10998
10998
|
this.connectListener = () => undefined;
|
|
10999
10999
|
this.disconnectListener = () => undefined;
|
|
11000
|
-
__classPrivateFieldSet$
|
|
11001
|
-
__classPrivateFieldSet$
|
|
11000
|
+
__classPrivateFieldSet$a(this, _ChannelProvider_connections, [], "f");
|
|
11001
|
+
__classPrivateFieldSet$a(this, _ChannelProvider_strategy, strategy, "f");
|
|
11002
11002
|
strategy.receive(this.processAction);
|
|
11003
11003
|
}
|
|
11004
11004
|
/**
|
|
@@ -11029,16 +11029,16 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
11029
11029
|
*/
|
|
11030
11030
|
dispatch(to, action, payload) {
|
|
11031
11031
|
const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
|
|
11032
|
-
if (endpointId && __classPrivateFieldGet$
|
|
11032
|
+
if (endpointId && __classPrivateFieldGet$b(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
|
|
11033
11033
|
const callSites = transport_errors_1.RuntimeError.getCallSite();
|
|
11034
|
-
return __classPrivateFieldGet$
|
|
11034
|
+
return __classPrivateFieldGet$b(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
|
|
11035
11035
|
throw new channel_error_1.ChannelError(e, action, payload, callSites);
|
|
11036
11036
|
});
|
|
11037
11037
|
}
|
|
11038
11038
|
return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
|
|
11039
11039
|
}
|
|
11040
11040
|
async processConnection(senderId, payload) {
|
|
11041
|
-
__classPrivateFieldGet$
|
|
11041
|
+
__classPrivateFieldGet$b(this, _ChannelProvider_connections, "f").push(senderId);
|
|
11042
11042
|
return this.connectListener(senderId, payload);
|
|
11043
11043
|
}
|
|
11044
11044
|
/**
|
|
@@ -11061,7 +11061,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
11061
11061
|
* ```
|
|
11062
11062
|
*/
|
|
11063
11063
|
publish(action, payload) {
|
|
11064
|
-
return this.connections.map((to) => __classPrivateFieldGet$
|
|
11064
|
+
return this.connections.map((to) => __classPrivateFieldGet$b(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
|
|
11065
11065
|
}
|
|
11066
11066
|
/**
|
|
11067
11067
|
* Register a listener that is called on every new client connection.
|
|
@@ -11135,11 +11135,11 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
11135
11135
|
* ```
|
|
11136
11136
|
*/
|
|
11137
11137
|
async destroy() {
|
|
11138
|
-
const protectedObj = __classPrivateFieldGet$
|
|
11138
|
+
const protectedObj = __classPrivateFieldGet$b(this, _ChannelProvider_protectedObj, "f");
|
|
11139
11139
|
protectedObj.providerIdentity;
|
|
11140
|
-
__classPrivateFieldSet$
|
|
11140
|
+
__classPrivateFieldSet$a(this, _ChannelProvider_connections, [], "f");
|
|
11141
11141
|
await protectedObj.close();
|
|
11142
|
-
__classPrivateFieldGet$
|
|
11142
|
+
__classPrivateFieldGet$b(this, _ChannelProvider_close, "f").call(this);
|
|
11143
11143
|
}
|
|
11144
11144
|
/**
|
|
11145
11145
|
* Returns an array with info on every Client connected to the Provider
|
|
@@ -11209,7 +11209,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
11209
11209
|
getEndpointIdForOpenFinId(clientIdentity, action) {
|
|
11210
11210
|
const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
|
|
11211
11211
|
if (matchingConnections.length >= 2) {
|
|
11212
|
-
const protectedObj = __classPrivateFieldGet$
|
|
11212
|
+
const protectedObj = __classPrivateFieldGet$b(this, _ChannelProvider_protectedObj, "f");
|
|
11213
11213
|
const { uuid, name } = clientIdentity;
|
|
11214
11214
|
const providerUuid = protectedObj?.providerIdentity.uuid;
|
|
11215
11215
|
const providerName = protectedObj?.providerIdentity.name;
|
|
@@ -11421,13 +11421,13 @@ class CombinedStrategy {
|
|
|
11421
11421
|
}
|
|
11422
11422
|
strategy.default = CombinedStrategy;
|
|
11423
11423
|
|
|
11424
|
-
var __classPrivateFieldSet$
|
|
11424
|
+
var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
11425
11425
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
11426
11426
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
11427
11427
|
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");
|
|
11428
11428
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11429
11429
|
};
|
|
11430
|
-
var __classPrivateFieldGet$
|
|
11430
|
+
var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
11431
11431
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
11432
11432
|
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");
|
|
11433
11433
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -11476,8 +11476,8 @@ class ConnectionManager extends base_1$d.Base {
|
|
|
11476
11476
|
};
|
|
11477
11477
|
this.providerMap = new Map();
|
|
11478
11478
|
this.protocolManager = new protocol_manager_1.ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
|
|
11479
|
-
__classPrivateFieldSet$
|
|
11480
|
-
__classPrivateFieldSet$
|
|
11479
|
+
__classPrivateFieldSet$9(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
|
|
11480
|
+
__classPrivateFieldSet$9(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
|
|
11481
11481
|
wire.registerMessageHandler(this.onmessage.bind(this));
|
|
11482
11482
|
}
|
|
11483
11483
|
createProvider(options, providerIdentity) {
|
|
@@ -11488,7 +11488,7 @@ class ConnectionManager extends base_1$d.Base {
|
|
|
11488
11488
|
case 'rtc':
|
|
11489
11489
|
return new strategy_2.RTCStrategy();
|
|
11490
11490
|
case 'classic':
|
|
11491
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
|
11491
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$a(this, _ConnectionManager_messageReceiver, "f"),
|
|
11492
11492
|
// Providers do not have an endpointId, use channelId as endpointId in the strategy.
|
|
11493
11493
|
providerIdentity.channelId, providerIdentity);
|
|
11494
11494
|
default:
|
|
@@ -11524,7 +11524,7 @@ class ConnectionManager extends base_1$d.Base {
|
|
|
11524
11524
|
const supportedProtocols = await Promise.all(protocols.map(async (type) => {
|
|
11525
11525
|
switch (type) {
|
|
11526
11526
|
case 'rtc': {
|
|
11527
|
-
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$
|
|
11527
|
+
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$a(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
|
|
11528
11528
|
rtcPacket = { rtcClient, channels, channelsOpened };
|
|
11529
11529
|
return {
|
|
11530
11530
|
type: 'rtc',
|
|
@@ -11551,18 +11551,18 @@ class ConnectionManager extends base_1$d.Base {
|
|
|
11551
11551
|
routingInfo.endpointId = this.wire.environment.getNextMessageId();
|
|
11552
11552
|
// For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
|
|
11553
11553
|
// clients that are in the same context as the newly-connected client.
|
|
11554
|
-
__classPrivateFieldGet$
|
|
11554
|
+
__classPrivateFieldGet$a(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
|
|
11555
11555
|
}
|
|
11556
11556
|
const answer = routingInfo.answer ?? {
|
|
11557
11557
|
supportedProtocols: [{ type: 'classic', version: 1 }]
|
|
11558
11558
|
};
|
|
11559
11559
|
const createStrategyFromAnswer = async (protocol) => {
|
|
11560
11560
|
if (protocol.type === 'rtc' && rtcPacket) {
|
|
11561
|
-
await __classPrivateFieldGet$
|
|
11561
|
+
await __classPrivateFieldGet$a(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
|
|
11562
11562
|
return new strategy_2.RTCStrategy();
|
|
11563
11563
|
}
|
|
11564
11564
|
if (protocol.type === 'classic') {
|
|
11565
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
|
11565
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$a(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
|
|
11566
11566
|
}
|
|
11567
11567
|
return null;
|
|
11568
11568
|
};
|
|
@@ -11630,7 +11630,7 @@ class ConnectionManager extends base_1$d.Base {
|
|
|
11630
11630
|
clientAnswer = await overlappingProtocols.reduce(async (accumP, protocolToUse) => {
|
|
11631
11631
|
const answer = await accumP;
|
|
11632
11632
|
if (protocolToUse.type === 'rtc') {
|
|
11633
|
-
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$
|
|
11633
|
+
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$a(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
|
|
11634
11634
|
answer.supportedProtocols.push({
|
|
11635
11635
|
type: 'rtc',
|
|
11636
11636
|
version: strategy_2.RTCInfo.version,
|
|
@@ -11678,13 +11678,13 @@ _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnec
|
|
|
11678
11678
|
*
|
|
11679
11679
|
* @packageDocumentation
|
|
11680
11680
|
*/
|
|
11681
|
-
var __classPrivateFieldSet$
|
|
11681
|
+
var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
11682
11682
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
11683
11683
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
11684
11684
|
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");
|
|
11685
11685
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11686
11686
|
};
|
|
11687
|
-
var __classPrivateFieldGet$
|
|
11687
|
+
var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
11688
11688
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
11689
11689
|
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");
|
|
11690
11690
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -11741,11 +11741,11 @@ class Channel extends base_1$c.EmitterBase {
|
|
|
11741
11741
|
client_1.ChannelClient.handleProviderDisconnect(eventPayload);
|
|
11742
11742
|
}),
|
|
11743
11743
|
this.on('connected', (...args) => {
|
|
11744
|
-
__classPrivateFieldGet$
|
|
11744
|
+
__classPrivateFieldGet$9(this, _Channel_internalEmitter, "f").emit('connected', ...args);
|
|
11745
11745
|
})
|
|
11746
11746
|
]).catch(() => new Error('error setting up channel connection listeners'));
|
|
11747
11747
|
}));
|
|
11748
|
-
__classPrivateFieldSet$
|
|
11748
|
+
__classPrivateFieldSet$8(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
|
|
11749
11749
|
}
|
|
11750
11750
|
/**
|
|
11751
11751
|
*
|
|
@@ -11820,7 +11820,7 @@ class Channel extends base_1$c.EmitterBase {
|
|
|
11820
11820
|
resolve(true);
|
|
11821
11821
|
}
|
|
11822
11822
|
};
|
|
11823
|
-
__classPrivateFieldGet$
|
|
11823
|
+
__classPrivateFieldGet$9(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
|
|
11824
11824
|
});
|
|
11825
11825
|
try {
|
|
11826
11826
|
if (retryInfo.count > 0) {
|
|
@@ -11852,7 +11852,7 @@ class Channel extends base_1$c.EmitterBase {
|
|
|
11852
11852
|
finally {
|
|
11853
11853
|
retryInfo.count += 1;
|
|
11854
11854
|
// in case of other errors, remove our listener
|
|
11855
|
-
__classPrivateFieldGet$
|
|
11855
|
+
__classPrivateFieldGet$9(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
|
|
11856
11856
|
}
|
|
11857
11857
|
} while (shouldWait); // If we're waiting we retry the above loop
|
|
11858
11858
|
// Should wait was false, no channel was found.
|
|
@@ -11911,12 +11911,12 @@ class Channel extends base_1$c.EmitterBase {
|
|
|
11911
11911
|
async connect(channelName, options = {}) {
|
|
11912
11912
|
// Make sure we don't connect before listeners are set up
|
|
11913
11913
|
// This also errors if we're not in OpenFin, ensuring we don't run unnecessary code
|
|
11914
|
-
await __classPrivateFieldGet$
|
|
11914
|
+
await __classPrivateFieldGet$9(this, _Channel_readyToConnect, "f").getValue();
|
|
11915
11915
|
if (!channelName || typeof channelName !== 'string') {
|
|
11916
11916
|
throw new Error('Please provide a channelName string to connect to a channel.');
|
|
11917
11917
|
}
|
|
11918
11918
|
const opts = { wait: true, ...this.wire.environment.getDefaultChannelOptions().connect, ...options };
|
|
11919
|
-
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$
|
|
11919
|
+
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$9(this, _Channel_connectionManager, "f").createClientOffer(opts);
|
|
11920
11920
|
let connectionUrl;
|
|
11921
11921
|
if (this.fin.me.isFrame || this.fin.me.isView || this.fin.me.isWindow) {
|
|
11922
11922
|
connectionUrl = (await this.fin.me.getInfo()).url;
|
|
@@ -11928,7 +11928,7 @@ class Channel extends base_1$c.EmitterBase {
|
|
|
11928
11928
|
connectionUrl
|
|
11929
11929
|
};
|
|
11930
11930
|
const routingInfo = await this.safeConnect(channelName, opts.wait, connectPayload);
|
|
11931
|
-
const strategy = await __classPrivateFieldGet$
|
|
11931
|
+
const strategy = await __classPrivateFieldGet$9(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
|
|
11932
11932
|
const channel = new client_1.ChannelClient(routingInfo, () => client_1.ChannelClient.wireClose(this.wire, routingInfo, routingInfo.endpointId), strategy);
|
|
11933
11933
|
// It is the client's responsibility to handle endpoint disconnection to the provider.
|
|
11934
11934
|
// If the endpoint dies, the client will force a disconnection through the core.
|
|
@@ -11997,7 +11997,7 @@ class Channel extends base_1$c.EmitterBase {
|
|
|
11997
11997
|
throw new Error('Please provide a channelName to create a channel');
|
|
11998
11998
|
}
|
|
11999
11999
|
const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
|
|
12000
|
-
const channel = __classPrivateFieldGet$
|
|
12000
|
+
const channel = __classPrivateFieldGet$9(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
|
|
12001
12001
|
// TODO: fix typing (internal)
|
|
12002
12002
|
// @ts-expect-error
|
|
12003
12003
|
this.on('client-disconnected', (eventPayload) => {
|
|
@@ -12233,14 +12233,32 @@ var clipboard = {};
|
|
|
12233
12233
|
*
|
|
12234
12234
|
* @packageDocumentation
|
|
12235
12235
|
*/
|
|
12236
|
+
var __classPrivateFieldGet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12237
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
12238
|
+
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");
|
|
12239
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12240
|
+
};
|
|
12241
|
+
var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12242
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
12243
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
12244
|
+
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");
|
|
12245
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
12246
|
+
};
|
|
12247
|
+
var _Clipboard_instances, _Clipboard_securedApiWarningCount, _Clipboard_warnSecuredApi;
|
|
12236
12248
|
Object.defineProperty(clipboard, "__esModule", { value: true });
|
|
12237
12249
|
clipboard.Clipboard = void 0;
|
|
12238
12250
|
const base_1$a = base;
|
|
12251
|
+
const maxSecuredApiWarnings = 10;
|
|
12239
12252
|
/**
|
|
12240
12253
|
* The Clipboard API allows reading and writing to the clipboard in multiple formats.
|
|
12241
12254
|
*
|
|
12242
12255
|
*/
|
|
12243
12256
|
class Clipboard extends base_1$a.Base {
|
|
12257
|
+
constructor() {
|
|
12258
|
+
super(...arguments);
|
|
12259
|
+
_Clipboard_instances.add(this);
|
|
12260
|
+
_Clipboard_securedApiWarningCount.set(this, 0);
|
|
12261
|
+
}
|
|
12244
12262
|
/**
|
|
12245
12263
|
* Writes data into the clipboard as plain text
|
|
12246
12264
|
* @param writeObj The object for writing data into the clipboard
|
|
@@ -12253,6 +12271,7 @@ class Clipboard extends base_1$a.Base {
|
|
|
12253
12271
|
* ```
|
|
12254
12272
|
*/
|
|
12255
12273
|
async writeText(writeObj) {
|
|
12274
|
+
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeText');
|
|
12256
12275
|
await this.wire.sendAction('clipboard-write-text', writeObj);
|
|
12257
12276
|
}
|
|
12258
12277
|
/**
|
|
@@ -12265,6 +12284,7 @@ class Clipboard extends base_1$a.Base {
|
|
|
12265
12284
|
* ```
|
|
12266
12285
|
*/
|
|
12267
12286
|
async readText(type) {
|
|
12287
|
+
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readText');
|
|
12268
12288
|
// NOTE: When we start supporting linux, we could detect the OS and choose 'selection' automatically for the user
|
|
12269
12289
|
const { payload } = await this.wire.sendAction('clipboard-read-text', { type });
|
|
12270
12290
|
return payload.data;
|
|
@@ -12282,6 +12302,7 @@ class Clipboard extends base_1$a.Base {
|
|
|
12282
12302
|
* ```
|
|
12283
12303
|
*/
|
|
12284
12304
|
async writeImage(writeRequest) {
|
|
12305
|
+
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeImage');
|
|
12285
12306
|
await this.wire.sendAction('clipboard-write-image', writeRequest);
|
|
12286
12307
|
}
|
|
12287
12308
|
/**
|
|
@@ -12317,6 +12338,7 @@ class Clipboard extends base_1$a.Base {
|
|
|
12317
12338
|
* ```
|
|
12318
12339
|
*/
|
|
12319
12340
|
async readImage(readRequest = { format: 'dataURL' }) {
|
|
12341
|
+
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readImage');
|
|
12320
12342
|
const { payload } = await this.wire.sendAction('clipboard-read-image', readRequest);
|
|
12321
12343
|
return payload.data;
|
|
12322
12344
|
}
|
|
@@ -12332,6 +12354,7 @@ class Clipboard extends base_1$a.Base {
|
|
|
12332
12354
|
* ```
|
|
12333
12355
|
*/
|
|
12334
12356
|
async writeHtml(writeObj) {
|
|
12357
|
+
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeHtml');
|
|
12335
12358
|
await this.wire.sendAction('clipboard-write-html', writeObj);
|
|
12336
12359
|
}
|
|
12337
12360
|
/**
|
|
@@ -12344,6 +12367,7 @@ class Clipboard extends base_1$a.Base {
|
|
|
12344
12367
|
* ```
|
|
12345
12368
|
*/
|
|
12346
12369
|
async readHtml(type) {
|
|
12370
|
+
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readHtml');
|
|
12347
12371
|
const { payload } = await this.wire.sendAction('clipboard-read-html', { type });
|
|
12348
12372
|
return payload.data;
|
|
12349
12373
|
}
|
|
@@ -12359,6 +12383,7 @@ class Clipboard extends base_1$a.Base {
|
|
|
12359
12383
|
* ```
|
|
12360
12384
|
*/
|
|
12361
12385
|
async writeRtf(writeObj) {
|
|
12386
|
+
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeRtf');
|
|
12362
12387
|
await this.wire.sendAction('clipboard-write-rtf', writeObj);
|
|
12363
12388
|
}
|
|
12364
12389
|
/**
|
|
@@ -12379,6 +12404,7 @@ class Clipboard extends base_1$a.Base {
|
|
|
12379
12404
|
* ```
|
|
12380
12405
|
*/
|
|
12381
12406
|
async readRtf(type) {
|
|
12407
|
+
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readRtf');
|
|
12382
12408
|
const { payload } = await this.wire.sendAction('clipboard-read-rtf', { type });
|
|
12383
12409
|
return payload.data;
|
|
12384
12410
|
}
|
|
@@ -12402,6 +12428,7 @@ class Clipboard extends base_1$a.Base {
|
|
|
12402
12428
|
* ```
|
|
12403
12429
|
*/
|
|
12404
12430
|
async write(writeObj) {
|
|
12431
|
+
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.write');
|
|
12405
12432
|
await this.wire.sendAction('clipboard-write', writeObj);
|
|
12406
12433
|
}
|
|
12407
12434
|
/**
|
|
@@ -12419,6 +12446,12 @@ class Clipboard extends base_1$a.Base {
|
|
|
12419
12446
|
}
|
|
12420
12447
|
}
|
|
12421
12448
|
clipboard.Clipboard = Clipboard;
|
|
12449
|
+
_Clipboard_securedApiWarningCount = new WeakMap(), _Clipboard_instances = new WeakSet(), _Clipboard_warnSecuredApi = async function _Clipboard_warnSecuredApi(apiName) {
|
|
12450
|
+
if (__classPrivateFieldGet$8(this, _Clipboard_securedApiWarningCount, "f") <= maxSecuredApiWarnings) {
|
|
12451
|
+
console.warn(`Here's Clipboard APIs will become secured APIs 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/`);
|
|
12452
|
+
__classPrivateFieldSet$7(this, _Clipboard_securedApiWarningCount, __classPrivateFieldGet$8(this, _Clipboard_securedApiWarningCount, "f") + 1, "f");
|
|
12453
|
+
}
|
|
12454
|
+
};
|
|
12422
12455
|
|
|
12423
12456
|
var globalHotkey = {};
|
|
12424
12457
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfin/remote-adapter",
|
|
3
|
-
"version": "42.100.
|
|
3
|
+
"version": "42.100.40",
|
|
4
4
|
"description": "Establish intermachine runtime connections using webRTC.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"private": false,
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
"author": "OpenFin",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"lodash": "^4.17.21",
|
|
23
|
-
"@openfin/core": "42.100.
|
|
23
|
+
"@openfin/core": "42.100.40"
|
|
24
24
|
}
|
|
25
25
|
}
|