@openfin/remote-adapter 42.100.58 → 42.100.60
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 +137 -168
- 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$g = (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$h = (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$h(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$h(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$h(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$h(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$g(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
|
|
203
|
+
__classPrivateFieldSet$g(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$h(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$h(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$h(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$f = (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$g = (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$g(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$f(this, _InteropBroker_contextGroups, options.contextGroups ?? [...defaultContextGroups], "f");
|
|
1056
|
+
__classPrivateFieldSet$f(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$f(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$g(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$g(this, _InteropBroker_fdc3Info, "f"),
|
|
1743
1743
|
optionalFeatures: {
|
|
1744
1744
|
OriginatingAppMetadata: false,
|
|
1745
1745
|
UserChannelMembershipAPIs: true
|
|
@@ -2046,7 +2046,9 @@ class InteropBroker extends base_1$m.Base {
|
|
|
2046
2046
|
});
|
|
2047
2047
|
channel.afterAction((action, payload, clientIdentity) => {
|
|
2048
2048
|
if (this.logging?.afterAction?.enabled) {
|
|
2049
|
-
|
|
2049
|
+
// afterAction can result in payload being undefined
|
|
2050
|
+
const logArgs = payload ? [action, payload, clientIdentity] : [action, clientIdentity];
|
|
2051
|
+
console.log(...logArgs);
|
|
2050
2052
|
}
|
|
2051
2053
|
});
|
|
2052
2054
|
// Client functions
|
|
@@ -7544,13 +7546,13 @@ function errorToPOJO(error) {
|
|
|
7544
7546
|
}
|
|
7545
7547
|
errors.errorToPOJO = errorToPOJO;
|
|
7546
7548
|
|
|
7547
|
-
var __classPrivateFieldSet$
|
|
7549
|
+
var __classPrivateFieldSet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7548
7550
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
7549
7551
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
7550
7552
|
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
7553
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7552
7554
|
};
|
|
7553
|
-
var __classPrivateFieldGet$
|
|
7555
|
+
var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7554
7556
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7555
7557
|
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
7558
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -7578,19 +7580,19 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
7578
7580
|
// Typing as unknown to avoid circular dependency, should not be used directly.
|
|
7579
7581
|
_Transport_fin.set(this, void 0);
|
|
7580
7582
|
this.connectSync = () => {
|
|
7581
|
-
const wire = __classPrivateFieldGet$
|
|
7583
|
+
const wire = __classPrivateFieldGet$f(this, _Transport_wire, "f");
|
|
7582
7584
|
wire.connectSync();
|
|
7583
7585
|
};
|
|
7584
7586
|
// This function is only used in our tests.
|
|
7585
7587
|
this.getPort = () => {
|
|
7586
|
-
const wire = __classPrivateFieldGet$
|
|
7588
|
+
const wire = __classPrivateFieldGet$f(this, _Transport_wire, "f");
|
|
7587
7589
|
return wire.getPort();
|
|
7588
7590
|
};
|
|
7589
|
-
__classPrivateFieldSet$
|
|
7591
|
+
__classPrivateFieldSet$e(this, _Transport_wire, factory(this.onmessage.bind(this)), "f");
|
|
7590
7592
|
this.environment = environment;
|
|
7591
|
-
this.sendRaw = __classPrivateFieldGet$
|
|
7593
|
+
this.sendRaw = __classPrivateFieldGet$f(this, _Transport_wire, "f").send.bind(__classPrivateFieldGet$f(this, _Transport_wire, "f"));
|
|
7592
7594
|
this.registerMessageHandler(this.handleMessage.bind(this));
|
|
7593
|
-
__classPrivateFieldGet$
|
|
7595
|
+
__classPrivateFieldGet$f(this, _Transport_wire, "f").on('disconnected', () => {
|
|
7594
7596
|
for (const [, { handleNack }] of this.wireListeners) {
|
|
7595
7597
|
handleNack({ reason: 'Remote connection has closed' });
|
|
7596
7598
|
}
|
|
@@ -7602,24 +7604,24 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
7602
7604
|
this.me = (0, me_1$1.getBaseMe)(entityType, uuid, name);
|
|
7603
7605
|
}
|
|
7604
7606
|
getFin() {
|
|
7605
|
-
if (!__classPrivateFieldGet$
|
|
7607
|
+
if (!__classPrivateFieldGet$f(this, _Transport_fin, "f")) {
|
|
7606
7608
|
throw new Error('No Fin object registered for this transport');
|
|
7607
7609
|
}
|
|
7608
|
-
return __classPrivateFieldGet$
|
|
7610
|
+
return __classPrivateFieldGet$f(this, _Transport_fin, "f");
|
|
7609
7611
|
}
|
|
7610
7612
|
registerFin(_fin) {
|
|
7611
|
-
if (__classPrivateFieldGet$
|
|
7613
|
+
if (__classPrivateFieldGet$f(this, _Transport_fin, "f")) {
|
|
7612
7614
|
throw new Error('Fin object has already been registered for this transport');
|
|
7613
7615
|
}
|
|
7614
|
-
__classPrivateFieldSet$
|
|
7616
|
+
__classPrivateFieldSet$e(this, _Transport_fin, _fin, "f");
|
|
7615
7617
|
}
|
|
7616
7618
|
shutdown() {
|
|
7617
|
-
const wire = __classPrivateFieldGet$
|
|
7619
|
+
const wire = __classPrivateFieldGet$f(this, _Transport_wire, "f");
|
|
7618
7620
|
return wire.shutdown();
|
|
7619
7621
|
}
|
|
7620
7622
|
async connect(config) {
|
|
7621
7623
|
if ((0, wire_1.isConfigWithReceiver)(config)) {
|
|
7622
|
-
await __classPrivateFieldGet$
|
|
7624
|
+
await __classPrivateFieldGet$f(this, _Transport_wire, "f").connect(config.receiver);
|
|
7623
7625
|
return this.authorize(config);
|
|
7624
7626
|
}
|
|
7625
7627
|
if ((0, wire_1.isRemoteConfig)(config)) {
|
|
@@ -7635,13 +7637,13 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
7635
7637
|
return undefined;
|
|
7636
7638
|
}
|
|
7637
7639
|
async connectRemote(config) {
|
|
7638
|
-
await __classPrivateFieldGet$
|
|
7640
|
+
await __classPrivateFieldGet$f(this, _Transport_wire, "f").connect(new (this.environment.getWsConstructor())(config.address));
|
|
7639
7641
|
return this.authorize(config);
|
|
7640
7642
|
}
|
|
7641
7643
|
async connectByPort(config) {
|
|
7642
7644
|
const { address, uuid } = config;
|
|
7643
7645
|
const reqAuthPayload = { ...config, type: 'file-token' };
|
|
7644
|
-
const wire = __classPrivateFieldGet$
|
|
7646
|
+
const wire = __classPrivateFieldGet$f(this, _Transport_wire, "f");
|
|
7645
7647
|
await wire.connect(new (this.environment.getWsConstructor())(config.address));
|
|
7646
7648
|
const requestExtAuthRet = await this.sendAction('request-external-authorization', {
|
|
7647
7649
|
uuid,
|
|
@@ -7677,7 +7679,7 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
7677
7679
|
payload,
|
|
7678
7680
|
messageId
|
|
7679
7681
|
};
|
|
7680
|
-
const wire = __classPrivateFieldGet$
|
|
7682
|
+
const wire = __classPrivateFieldGet$f(this, _Transport_wire, "f");
|
|
7681
7683
|
this.addWireListener(messageId, resolve, (payload) => this.nackHandler(payload, reject, callSites), uncorrelated);
|
|
7682
7684
|
return wire.send(msg).catch(reject);
|
|
7683
7685
|
});
|
|
@@ -7699,7 +7701,7 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
7699
7701
|
const resolver = (data) => {
|
|
7700
7702
|
resolve(data.payload);
|
|
7701
7703
|
};
|
|
7702
|
-
const wire = __classPrivateFieldGet$
|
|
7704
|
+
const wire = __classPrivateFieldGet$f(this, _Transport_wire, "f");
|
|
7703
7705
|
return wire
|
|
7704
7706
|
.send(origData)
|
|
7705
7707
|
.then(() => this.addWireListener(id, resolver, (payload) => this.nackHandler(payload, reject), false))
|
|
@@ -9847,9 +9849,9 @@ class ChannelBase {
|
|
|
9847
9849
|
}
|
|
9848
9850
|
async processAction(topic, payload, senderIdentity) {
|
|
9849
9851
|
try {
|
|
9850
|
-
const
|
|
9851
|
-
|
|
9852
|
-
|
|
9852
|
+
const registeredAction = this.subscriptions.get(topic);
|
|
9853
|
+
const defaultAction = (currentPayload, id) => (this.defaultAction ?? ChannelBase.defaultAction)(topic, currentPayload, id);
|
|
9854
|
+
const mainAction = registeredAction ?? defaultAction;
|
|
9853
9855
|
const preActionProcessed = this.preAction ? await this.preAction(topic, payload, senderIdentity) : payload;
|
|
9854
9856
|
const actionProcessed = await mainAction(preActionProcessed, senderIdentity);
|
|
9855
9857
|
return this.postAction ? await this.postAction(topic, actionProcessed, senderIdentity) : actionProcessed;
|
|
@@ -10176,12 +10178,12 @@ class ChannelError extends Error {
|
|
|
10176
10178
|
}
|
|
10177
10179
|
channelError.ChannelError = ChannelError;
|
|
10178
10180
|
|
|
10179
|
-
var __classPrivateFieldGet$
|
|
10181
|
+
var __classPrivateFieldGet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
10180
10182
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10181
10183
|
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
10184
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
10183
10185
|
};
|
|
10184
|
-
var __classPrivateFieldSet$
|
|
10186
|
+
var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
10185
10187
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
10186
10188
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10187
10189
|
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 +10227,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
10225
10227
|
static closeChannelByEndpointId(id) {
|
|
10226
10228
|
const channel = channelClientsByEndpointId.get(id);
|
|
10227
10229
|
if (channel) {
|
|
10228
|
-
__classPrivateFieldGet$
|
|
10230
|
+
__classPrivateFieldGet$e(channel, _ChannelClient_close, "f").call(channel);
|
|
10229
10231
|
}
|
|
10230
10232
|
}
|
|
10231
10233
|
/**
|
|
@@ -10236,7 +10238,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
10236
10238
|
for (const channelClient of channelClientsByEndpointId.values()) {
|
|
10237
10239
|
if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
|
|
10238
10240
|
channelClient.disconnectListener(eventPayload);
|
|
10239
|
-
__classPrivateFieldGet$
|
|
10241
|
+
__classPrivateFieldGet$e(channelClient, _ChannelClient_close, "f").call(channelClient);
|
|
10240
10242
|
}
|
|
10241
10243
|
}
|
|
10242
10244
|
}
|
|
@@ -10251,12 +10253,12 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
10251
10253
|
this.processAction = (action, payload, senderIdentity) => super.processAction(action, payload, senderIdentity);
|
|
10252
10254
|
_ChannelClient_close.set(this, () => {
|
|
10253
10255
|
channelClientsByEndpointId.delete(this.endpointId);
|
|
10254
|
-
__classPrivateFieldGet$
|
|
10256
|
+
__classPrivateFieldGet$e(this, _ChannelClient_strategy, "f").close();
|
|
10255
10257
|
});
|
|
10256
|
-
__classPrivateFieldSet$
|
|
10258
|
+
__classPrivateFieldSet$d(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
|
|
10257
10259
|
this.disconnectListener = () => undefined;
|
|
10258
10260
|
this.endpointId = routingInfo.endpointId;
|
|
10259
|
-
__classPrivateFieldSet$
|
|
10261
|
+
__classPrivateFieldSet$d(this, _ChannelClient_strategy, strategy, "f");
|
|
10260
10262
|
channelClientsByEndpointId.set(this.endpointId, this);
|
|
10261
10263
|
strategy.receive(this.processAction);
|
|
10262
10264
|
}
|
|
@@ -10264,7 +10266,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
10264
10266
|
* a read-only provider identity
|
|
10265
10267
|
*/
|
|
10266
10268
|
get providerIdentity() {
|
|
10267
|
-
const protectedObj = __classPrivateFieldGet$
|
|
10269
|
+
const protectedObj = __classPrivateFieldGet$e(this, _ChannelClient_protectedObj, "f");
|
|
10268
10270
|
return protectedObj.providerIdentity;
|
|
10269
10271
|
}
|
|
10270
10272
|
/**
|
|
@@ -10293,9 +10295,9 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
10293
10295
|
* ```
|
|
10294
10296
|
*/
|
|
10295
10297
|
async dispatch(action, payload) {
|
|
10296
|
-
if (__classPrivateFieldGet$
|
|
10298
|
+
if (__classPrivateFieldGet$e(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
|
|
10297
10299
|
const callSites = transport_errors_1$1.RuntimeError.getCallSite();
|
|
10298
|
-
return __classPrivateFieldGet$
|
|
10300
|
+
return __classPrivateFieldGet$e(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
|
|
10299
10301
|
throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
|
|
10300
10302
|
});
|
|
10301
10303
|
}
|
|
@@ -10347,10 +10349,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
10347
10349
|
*/
|
|
10348
10350
|
async disconnect() {
|
|
10349
10351
|
await this.sendDisconnectAction();
|
|
10350
|
-
__classPrivateFieldGet$
|
|
10352
|
+
__classPrivateFieldGet$e(this, _ChannelClient_close, "f").call(this);
|
|
10351
10353
|
}
|
|
10352
10354
|
async sendDisconnectAction() {
|
|
10353
|
-
const protectedObj = __classPrivateFieldGet$
|
|
10355
|
+
const protectedObj = __classPrivateFieldGet$e(this, _ChannelClient_protectedObj, "f");
|
|
10354
10356
|
await protectedObj.close();
|
|
10355
10357
|
}
|
|
10356
10358
|
/**
|
|
@@ -10383,13 +10385,13 @@ exhaustive.exhaustiveCheck = exhaustiveCheck;
|
|
|
10383
10385
|
|
|
10384
10386
|
var strategy$3 = {};
|
|
10385
10387
|
|
|
10386
|
-
var __classPrivateFieldSet$
|
|
10388
|
+
var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
10387
10389
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
10388
10390
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10389
10391
|
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
10392
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
10391
10393
|
};
|
|
10392
|
-
var __classPrivateFieldGet$
|
|
10394
|
+
var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
10393
10395
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10394
10396
|
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
10397
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -10414,7 +10416,7 @@ class ClassicStrategy {
|
|
|
10414
10416
|
// connection problems occur
|
|
10415
10417
|
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
|
|
10416
10418
|
this.send = async (endpointId, action, payload) => {
|
|
10417
|
-
const to = __classPrivateFieldGet$
|
|
10419
|
+
const to = __classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
10418
10420
|
if (!to) {
|
|
10419
10421
|
throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
|
|
10420
10422
|
}
|
|
@@ -10426,13 +10428,13 @@ class ClassicStrategy {
|
|
|
10426
10428
|
}
|
|
10427
10429
|
delete cleanId.isLocalEndpointId;
|
|
10428
10430
|
// grab the promise before awaiting it to save in our pending messages map
|
|
10429
|
-
const p = __classPrivateFieldGet$
|
|
10431
|
+
const p = __classPrivateFieldGet$d(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
|
|
10430
10432
|
...cleanId,
|
|
10431
10433
|
providerIdentity: this.providerIdentity,
|
|
10432
10434
|
action,
|
|
10433
10435
|
payload
|
|
10434
10436
|
});
|
|
10435
|
-
__classPrivateFieldGet$
|
|
10437
|
+
__classPrivateFieldGet$d(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
|
|
10436
10438
|
const raw = await p
|
|
10437
10439
|
.catch((error) => {
|
|
10438
10440
|
if ('cause' in error) {
|
|
@@ -10442,16 +10444,16 @@ class ClassicStrategy {
|
|
|
10442
10444
|
})
|
|
10443
10445
|
.finally(() => {
|
|
10444
10446
|
// clean up the pending promise
|
|
10445
|
-
__classPrivateFieldGet$
|
|
10447
|
+
__classPrivateFieldGet$d(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
|
|
10446
10448
|
});
|
|
10447
10449
|
return raw.payload.data.result;
|
|
10448
10450
|
};
|
|
10449
10451
|
this.close = async () => {
|
|
10450
10452
|
this.messageReceiver.removeEndpoint(this.providerIdentity.channelId, this.endpointId);
|
|
10451
|
-
[...__classPrivateFieldGet$
|
|
10452
|
-
__classPrivateFieldSet$
|
|
10453
|
+
[...__classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
|
|
10454
|
+
__classPrivateFieldSet$c(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
|
|
10453
10455
|
};
|
|
10454
|
-
__classPrivateFieldSet$
|
|
10456
|
+
__classPrivateFieldSet$c(this, _ClassicStrategy_wire, wire, "f");
|
|
10455
10457
|
}
|
|
10456
10458
|
onEndpointDisconnect(endpointId, listener) {
|
|
10457
10459
|
// Never fires for 'classic'.
|
|
@@ -10460,20 +10462,20 @@ class ClassicStrategy {
|
|
|
10460
10462
|
this.messageReceiver.addEndpoint(listener, this.providerIdentity.channelId, this.endpointId);
|
|
10461
10463
|
}
|
|
10462
10464
|
async closeEndpoint(endpointId) {
|
|
10463
|
-
const id = __classPrivateFieldGet$
|
|
10464
|
-
__classPrivateFieldGet$
|
|
10465
|
-
const pendingSet = __classPrivateFieldGet$
|
|
10465
|
+
const id = __classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
10466
|
+
__classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
|
|
10467
|
+
const pendingSet = __classPrivateFieldGet$d(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
|
|
10466
10468
|
pendingSet?.forEach((p) => {
|
|
10467
10469
|
const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
|
|
10468
10470
|
p.cancel(new Error(errorMsg));
|
|
10469
10471
|
});
|
|
10470
10472
|
}
|
|
10471
10473
|
isEndpointConnected(endpointId) {
|
|
10472
|
-
return __classPrivateFieldGet$
|
|
10474
|
+
return __classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
|
|
10473
10475
|
}
|
|
10474
10476
|
addEndpoint(endpointId, payload) {
|
|
10475
|
-
__classPrivateFieldGet$
|
|
10476
|
-
__classPrivateFieldGet$
|
|
10477
|
+
__classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
|
|
10478
|
+
__classPrivateFieldGet$d(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
|
|
10477
10479
|
}
|
|
10478
10480
|
isValidEndpointPayload(payload) {
|
|
10479
10481
|
return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
|
|
@@ -10489,12 +10491,12 @@ var strategy$2 = {};
|
|
|
10489
10491
|
|
|
10490
10492
|
var endpoint = {};
|
|
10491
10493
|
|
|
10492
|
-
var __classPrivateFieldGet$
|
|
10494
|
+
var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
10493
10495
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10494
10496
|
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
10497
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
10496
10498
|
};
|
|
10497
|
-
var __classPrivateFieldSet$
|
|
10499
|
+
var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
10498
10500
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
10499
10501
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10500
10502
|
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 +10531,8 @@ class RTCEndpoint {
|
|
|
10529
10531
|
if (this.rtc.rtcClient.connectionState !== 'connected') {
|
|
10530
10532
|
this.rtc.rtcClient.removeEventListener('connectionstatechange', this.connectionStateChangeHandler);
|
|
10531
10533
|
this.close();
|
|
10532
|
-
if (__classPrivateFieldGet$
|
|
10533
|
-
__classPrivateFieldGet$
|
|
10534
|
+
if (__classPrivateFieldGet$c(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
10535
|
+
__classPrivateFieldGet$c(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
|
10534
10536
|
}
|
|
10535
10537
|
}
|
|
10536
10538
|
};
|
|
@@ -10578,9 +10580,9 @@ class RTCEndpoint {
|
|
|
10578
10580
|
data = new TextDecoder().decode(e.data);
|
|
10579
10581
|
}
|
|
10580
10582
|
const { messageId, action, payload } = JSON.parse(data);
|
|
10581
|
-
if (__classPrivateFieldGet$
|
|
10583
|
+
if (__classPrivateFieldGet$c(this, _RTCEndpoint_processAction, "f")) {
|
|
10582
10584
|
try {
|
|
10583
|
-
const res = await __classPrivateFieldGet$
|
|
10585
|
+
const res = await __classPrivateFieldGet$c(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
|
|
10584
10586
|
this.rtc.channels.response.send(JSON.stringify({
|
|
10585
10587
|
messageId,
|
|
10586
10588
|
payload: res,
|
|
@@ -10614,25 +10616,25 @@ class RTCEndpoint {
|
|
|
10614
10616
|
datachannel.onclose = (e) => {
|
|
10615
10617
|
[...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
10618
|
this.close();
|
|
10617
|
-
if (__classPrivateFieldGet$
|
|
10618
|
-
__classPrivateFieldGet$
|
|
10619
|
+
if (__classPrivateFieldGet$c(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
10620
|
+
__classPrivateFieldGet$c(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
|
10619
10621
|
}
|
|
10620
10622
|
};
|
|
10621
10623
|
});
|
|
10622
10624
|
}
|
|
10623
10625
|
onDisconnect(listener) {
|
|
10624
|
-
if (!__classPrivateFieldGet$
|
|
10625
|
-
__classPrivateFieldSet$
|
|
10626
|
+
if (!__classPrivateFieldGet$c(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
10627
|
+
__classPrivateFieldSet$b(this, _RTCEndpoint_disconnectListener, listener, "f");
|
|
10626
10628
|
}
|
|
10627
10629
|
else {
|
|
10628
10630
|
throw new Error('RTCEndpoint disconnectListener cannot be set twice.');
|
|
10629
10631
|
}
|
|
10630
10632
|
}
|
|
10631
10633
|
receive(listener) {
|
|
10632
|
-
if (__classPrivateFieldGet$
|
|
10634
|
+
if (__classPrivateFieldGet$c(this, _RTCEndpoint_processAction, "f")) {
|
|
10633
10635
|
throw new Error('You have already set a listener for this RTC Endpoint.');
|
|
10634
10636
|
}
|
|
10635
|
-
__classPrivateFieldSet$
|
|
10637
|
+
__classPrivateFieldSet$b(this, _RTCEndpoint_processAction, listener, "f");
|
|
10636
10638
|
}
|
|
10637
10639
|
get connected() {
|
|
10638
10640
|
return this.rtc.rtcClient.connectionState === 'connected';
|
|
@@ -10643,12 +10645,12 @@ _RTCEndpoint_processAction = new WeakMap(), _RTCEndpoint_disconnectListener = ne
|
|
|
10643
10645
|
|
|
10644
10646
|
var strategy$1 = {};
|
|
10645
10647
|
|
|
10646
|
-
var __classPrivateFieldGet$
|
|
10648
|
+
var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
10647
10649
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10648
10650
|
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
10651
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
10650
10652
|
};
|
|
10651
|
-
var __classPrivateFieldSet$
|
|
10653
|
+
var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
10652
10654
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
10653
10655
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10654
10656
|
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 +10671,11 @@ class EndpointStrategy {
|
|
|
10669
10671
|
return this.getEndpointById(endpointId).send(action, payload);
|
|
10670
10672
|
};
|
|
10671
10673
|
this.close = async () => {
|
|
10672
|
-
if (__classPrivateFieldGet$
|
|
10673
|
-
__classPrivateFieldGet$
|
|
10674
|
-
__classPrivateFieldSet$
|
|
10674
|
+
if (__classPrivateFieldGet$b(this, _EndpointStrategy_connected, "f")) {
|
|
10675
|
+
__classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
|
|
10676
|
+
__classPrivateFieldSet$a(this, _EndpointStrategy_endpointMap, new Map(), "f");
|
|
10675
10677
|
}
|
|
10676
|
-
__classPrivateFieldSet$
|
|
10678
|
+
__classPrivateFieldSet$a(this, _EndpointStrategy_connected, false, "f");
|
|
10677
10679
|
};
|
|
10678
10680
|
this.isValidEndpointPayload = validateEndpoint;
|
|
10679
10681
|
}
|
|
@@ -10681,39 +10683,39 @@ class EndpointStrategy {
|
|
|
10681
10683
|
this.getEndpointById(endpointId).onDisconnect(listener);
|
|
10682
10684
|
}
|
|
10683
10685
|
receive(listener) {
|
|
10684
|
-
if (__classPrivateFieldGet$
|
|
10686
|
+
if (__classPrivateFieldGet$b(this, _EndpointStrategy_processAction, "f")) {
|
|
10685
10687
|
throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);
|
|
10686
10688
|
}
|
|
10687
|
-
__classPrivateFieldSet$
|
|
10689
|
+
__classPrivateFieldSet$a(this, _EndpointStrategy_processAction, listener, "f");
|
|
10688
10690
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
10689
|
-
__classPrivateFieldGet$
|
|
10691
|
+
__classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$b(this, _EndpointStrategy_processAction, "f")));
|
|
10690
10692
|
}
|
|
10691
10693
|
getEndpointById(endpointId) {
|
|
10692
|
-
const endpoint = __classPrivateFieldGet$
|
|
10694
|
+
const endpoint = __classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
|
|
10693
10695
|
if (!endpoint) {
|
|
10694
10696
|
throw new Error(`Client with endpoint id ${endpointId} is not connected`);
|
|
10695
10697
|
}
|
|
10696
10698
|
return endpoint;
|
|
10697
10699
|
}
|
|
10698
10700
|
get connected() {
|
|
10699
|
-
return __classPrivateFieldGet$
|
|
10701
|
+
return __classPrivateFieldGet$b(this, _EndpointStrategy_connected, "f");
|
|
10700
10702
|
}
|
|
10701
10703
|
isEndpointConnected(endpointId) {
|
|
10702
|
-
return __classPrivateFieldGet$
|
|
10704
|
+
return __classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
|
|
10703
10705
|
}
|
|
10704
10706
|
addEndpoint(endpointId, payload) {
|
|
10705
|
-
if (!__classPrivateFieldGet$
|
|
10707
|
+
if (!__classPrivateFieldGet$b(this, _EndpointStrategy_connected, "f")) {
|
|
10706
10708
|
console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);
|
|
10707
10709
|
return;
|
|
10708
10710
|
}
|
|
10709
10711
|
const clientStrat = new this.EndpointType(payload);
|
|
10710
|
-
if (__classPrivateFieldGet$
|
|
10711
|
-
clientStrat.receive(__classPrivateFieldGet$
|
|
10712
|
+
if (__classPrivateFieldGet$b(this, _EndpointStrategy_processAction, "f")) {
|
|
10713
|
+
clientStrat.receive(__classPrivateFieldGet$b(this, _EndpointStrategy_processAction, "f"));
|
|
10712
10714
|
}
|
|
10713
|
-
__classPrivateFieldGet$
|
|
10715
|
+
__classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
|
|
10714
10716
|
}
|
|
10715
10717
|
async closeEndpoint(endpointId) {
|
|
10716
|
-
__classPrivateFieldGet$
|
|
10718
|
+
__classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
|
|
10717
10719
|
}
|
|
10718
10720
|
}
|
|
10719
10721
|
strategy$1.EndpointStrategy = EndpointStrategy;
|
|
@@ -10895,12 +10897,12 @@ function runtimeUuidMeetsMinimumRuntimeVersion(runtimeUuid, minVersion) {
|
|
|
10895
10897
|
}
|
|
10896
10898
|
runtimeVersioning.runtimeUuidMeetsMinimumRuntimeVersion = runtimeUuidMeetsMinimumRuntimeVersion;
|
|
10897
10899
|
|
|
10898
|
-
var __classPrivateFieldGet$
|
|
10900
|
+
var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
10899
10901
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10900
10902
|
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
10903
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
10902
10904
|
};
|
|
10903
|
-
var __classPrivateFieldSet$
|
|
10905
|
+
var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
10904
10906
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
10905
10907
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10906
10908
|
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 +10946,19 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
10944
10946
|
* a read-only array containing all the identities of connecting clients.
|
|
10945
10947
|
*/
|
|
10946
10948
|
get connections() {
|
|
10947
|
-
return [...__classPrivateFieldGet$
|
|
10949
|
+
return [...__classPrivateFieldGet$a(this, _ChannelProvider_connections, "f")];
|
|
10948
10950
|
}
|
|
10949
10951
|
static handleClientDisconnection(channel, payload) {
|
|
10950
10952
|
if (payload?.endpointId) {
|
|
10951
10953
|
const { uuid, name, endpointId, isLocalEndpointId } = payload;
|
|
10952
|
-
__classPrivateFieldGet$
|
|
10954
|
+
__classPrivateFieldGet$a(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
|
|
10953
10955
|
}
|
|
10954
10956
|
else {
|
|
10955
10957
|
// this is here to support older runtimes that did not have endpointId
|
|
10956
10958
|
const multipleRemoves = channel.connections.filter((identity) => {
|
|
10957
10959
|
return identity.uuid === payload.uuid && identity.name === payload.name;
|
|
10958
10960
|
});
|
|
10959
|
-
multipleRemoves.forEach(__classPrivateFieldGet$
|
|
10961
|
+
multipleRemoves.forEach(__classPrivateFieldGet$a(channel, _ChannelProvider_removeEndpoint, "f"));
|
|
10960
10962
|
}
|
|
10961
10963
|
channel.disconnectListener(payload);
|
|
10962
10964
|
}
|
|
@@ -10973,8 +10975,8 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
10973
10975
|
_ChannelProvider_strategy.set(this, void 0);
|
|
10974
10976
|
_ChannelProvider_removeEndpoint.set(this, (identity) => {
|
|
10975
10977
|
const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
|
|
10976
|
-
__classPrivateFieldGet$
|
|
10977
|
-
__classPrivateFieldSet$
|
|
10978
|
+
__classPrivateFieldGet$a(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
|
|
10979
|
+
__classPrivateFieldSet$9(this, _ChannelProvider_connections, remainingConnections, "f");
|
|
10978
10980
|
});
|
|
10979
10981
|
// Must be bound.
|
|
10980
10982
|
this.processAction = async (action, payload, senderIdentity) => {
|
|
@@ -10988,17 +10990,17 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
10988
10990
|
return super.processAction(action, payload, senderIdentity);
|
|
10989
10991
|
};
|
|
10990
10992
|
_ChannelProvider_close.set(this, () => {
|
|
10991
|
-
__classPrivateFieldGet$
|
|
10993
|
+
__classPrivateFieldGet$a(this, _ChannelProvider_strategy, "f").close();
|
|
10992
10994
|
const remove = ChannelProvider.removalMap.get(this);
|
|
10993
10995
|
if (remove) {
|
|
10994
10996
|
remove();
|
|
10995
10997
|
}
|
|
10996
10998
|
});
|
|
10997
|
-
__classPrivateFieldSet$
|
|
10999
|
+
__classPrivateFieldSet$9(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
|
|
10998
11000
|
this.connectListener = () => undefined;
|
|
10999
11001
|
this.disconnectListener = () => undefined;
|
|
11000
|
-
__classPrivateFieldSet$
|
|
11001
|
-
__classPrivateFieldSet$
|
|
11002
|
+
__classPrivateFieldSet$9(this, _ChannelProvider_connections, [], "f");
|
|
11003
|
+
__classPrivateFieldSet$9(this, _ChannelProvider_strategy, strategy, "f");
|
|
11002
11004
|
strategy.receive(this.processAction);
|
|
11003
11005
|
}
|
|
11004
11006
|
/**
|
|
@@ -11029,16 +11031,16 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
11029
11031
|
*/
|
|
11030
11032
|
dispatch(to, action, payload) {
|
|
11031
11033
|
const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
|
|
11032
|
-
if (endpointId && __classPrivateFieldGet$
|
|
11034
|
+
if (endpointId && __classPrivateFieldGet$a(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
|
|
11033
11035
|
const callSites = transport_errors_1.RuntimeError.getCallSite();
|
|
11034
|
-
return __classPrivateFieldGet$
|
|
11036
|
+
return __classPrivateFieldGet$a(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
|
|
11035
11037
|
throw new channel_error_1.ChannelError(e, action, payload, callSites);
|
|
11036
11038
|
});
|
|
11037
11039
|
}
|
|
11038
11040
|
return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
|
|
11039
11041
|
}
|
|
11040
11042
|
async processConnection(senderId, payload) {
|
|
11041
|
-
__classPrivateFieldGet$
|
|
11043
|
+
__classPrivateFieldGet$a(this, _ChannelProvider_connections, "f").push(senderId);
|
|
11042
11044
|
return this.connectListener(senderId, payload);
|
|
11043
11045
|
}
|
|
11044
11046
|
/**
|
|
@@ -11061,7 +11063,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
11061
11063
|
* ```
|
|
11062
11064
|
*/
|
|
11063
11065
|
publish(action, payload) {
|
|
11064
|
-
return this.connections.map((to) => __classPrivateFieldGet$
|
|
11066
|
+
return this.connections.map((to) => __classPrivateFieldGet$a(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
|
|
11065
11067
|
}
|
|
11066
11068
|
/**
|
|
11067
11069
|
* Register a listener that is called on every new client connection.
|
|
@@ -11135,11 +11137,11 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
11135
11137
|
* ```
|
|
11136
11138
|
*/
|
|
11137
11139
|
async destroy() {
|
|
11138
|
-
const protectedObj = __classPrivateFieldGet$
|
|
11140
|
+
const protectedObj = __classPrivateFieldGet$a(this, _ChannelProvider_protectedObj, "f");
|
|
11139
11141
|
protectedObj.providerIdentity;
|
|
11140
|
-
__classPrivateFieldSet$
|
|
11142
|
+
__classPrivateFieldSet$9(this, _ChannelProvider_connections, [], "f");
|
|
11141
11143
|
await protectedObj.close();
|
|
11142
|
-
__classPrivateFieldGet$
|
|
11144
|
+
__classPrivateFieldGet$a(this, _ChannelProvider_close, "f").call(this);
|
|
11143
11145
|
}
|
|
11144
11146
|
/**
|
|
11145
11147
|
* Returns an array with info on every Client connected to the Provider
|
|
@@ -11209,7 +11211,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
11209
11211
|
getEndpointIdForOpenFinId(clientIdentity, action) {
|
|
11210
11212
|
const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
|
|
11211
11213
|
if (matchingConnections.length >= 2) {
|
|
11212
|
-
const protectedObj = __classPrivateFieldGet$
|
|
11214
|
+
const protectedObj = __classPrivateFieldGet$a(this, _ChannelProvider_protectedObj, "f");
|
|
11213
11215
|
const { uuid, name } = clientIdentity;
|
|
11214
11216
|
const providerUuid = protectedObj?.providerIdentity.uuid;
|
|
11215
11217
|
const providerName = protectedObj?.providerIdentity.name;
|
|
@@ -11421,13 +11423,13 @@ class CombinedStrategy {
|
|
|
11421
11423
|
}
|
|
11422
11424
|
strategy.default = CombinedStrategy;
|
|
11423
11425
|
|
|
11424
|
-
var __classPrivateFieldSet$
|
|
11426
|
+
var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
11425
11427
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
11426
11428
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
11427
11429
|
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
11430
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11429
11431
|
};
|
|
11430
|
-
var __classPrivateFieldGet$
|
|
11432
|
+
var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
11431
11433
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
11432
11434
|
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
11435
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -11476,8 +11478,8 @@ class ConnectionManager extends base_1$d.Base {
|
|
|
11476
11478
|
};
|
|
11477
11479
|
this.providerMap = new Map();
|
|
11478
11480
|
this.protocolManager = new protocol_manager_1.ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
|
|
11479
|
-
__classPrivateFieldSet$
|
|
11480
|
-
__classPrivateFieldSet$
|
|
11481
|
+
__classPrivateFieldSet$8(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
|
|
11482
|
+
__classPrivateFieldSet$8(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
|
|
11481
11483
|
wire.registerMessageHandler(this.onmessage.bind(this));
|
|
11482
11484
|
}
|
|
11483
11485
|
createProvider(options, providerIdentity) {
|
|
@@ -11488,7 +11490,7 @@ class ConnectionManager extends base_1$d.Base {
|
|
|
11488
11490
|
case 'rtc':
|
|
11489
11491
|
return new strategy_2.RTCStrategy();
|
|
11490
11492
|
case 'classic':
|
|
11491
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
|
11493
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$9(this, _ConnectionManager_messageReceiver, "f"),
|
|
11492
11494
|
// Providers do not have an endpointId, use channelId as endpointId in the strategy.
|
|
11493
11495
|
providerIdentity.channelId, providerIdentity);
|
|
11494
11496
|
default:
|
|
@@ -11524,7 +11526,7 @@ class ConnectionManager extends base_1$d.Base {
|
|
|
11524
11526
|
const supportedProtocols = await Promise.all(protocols.map(async (type) => {
|
|
11525
11527
|
switch (type) {
|
|
11526
11528
|
case 'rtc': {
|
|
11527
|
-
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$
|
|
11529
|
+
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$9(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
|
|
11528
11530
|
rtcPacket = { rtcClient, channels, channelsOpened };
|
|
11529
11531
|
return {
|
|
11530
11532
|
type: 'rtc',
|
|
@@ -11551,18 +11553,18 @@ class ConnectionManager extends base_1$d.Base {
|
|
|
11551
11553
|
routingInfo.endpointId = this.wire.environment.getNextMessageId();
|
|
11552
11554
|
// For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
|
|
11553
11555
|
// clients that are in the same context as the newly-connected client.
|
|
11554
|
-
__classPrivateFieldGet$
|
|
11556
|
+
__classPrivateFieldGet$9(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
|
|
11555
11557
|
}
|
|
11556
11558
|
const answer = routingInfo.answer ?? {
|
|
11557
11559
|
supportedProtocols: [{ type: 'classic', version: 1 }]
|
|
11558
11560
|
};
|
|
11559
11561
|
const createStrategyFromAnswer = async (protocol) => {
|
|
11560
11562
|
if (protocol.type === 'rtc' && rtcPacket) {
|
|
11561
|
-
await __classPrivateFieldGet$
|
|
11563
|
+
await __classPrivateFieldGet$9(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
|
|
11562
11564
|
return new strategy_2.RTCStrategy();
|
|
11563
11565
|
}
|
|
11564
11566
|
if (protocol.type === 'classic') {
|
|
11565
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
|
11567
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$9(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
|
|
11566
11568
|
}
|
|
11567
11569
|
return null;
|
|
11568
11570
|
};
|
|
@@ -11630,7 +11632,7 @@ class ConnectionManager extends base_1$d.Base {
|
|
|
11630
11632
|
clientAnswer = await overlappingProtocols.reduce(async (accumP, protocolToUse) => {
|
|
11631
11633
|
const answer = await accumP;
|
|
11632
11634
|
if (protocolToUse.type === 'rtc') {
|
|
11633
|
-
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$
|
|
11635
|
+
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$9(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
|
|
11634
11636
|
answer.supportedProtocols.push({
|
|
11635
11637
|
type: 'rtc',
|
|
11636
11638
|
version: strategy_2.RTCInfo.version,
|
|
@@ -11678,13 +11680,13 @@ _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnec
|
|
|
11678
11680
|
*
|
|
11679
11681
|
* @packageDocumentation
|
|
11680
11682
|
*/
|
|
11681
|
-
var __classPrivateFieldSet$
|
|
11683
|
+
var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
11682
11684
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
11683
11685
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
11684
11686
|
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
11687
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11686
11688
|
};
|
|
11687
|
-
var __classPrivateFieldGet$
|
|
11689
|
+
var __classPrivateFieldGet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
11688
11690
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
11689
11691
|
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
11692
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -11741,11 +11743,11 @@ class Channel extends base_1$c.EmitterBase {
|
|
|
11741
11743
|
client_1.ChannelClient.handleProviderDisconnect(eventPayload);
|
|
11742
11744
|
}),
|
|
11743
11745
|
this.on('connected', (...args) => {
|
|
11744
|
-
__classPrivateFieldGet$
|
|
11746
|
+
__classPrivateFieldGet$8(this, _Channel_internalEmitter, "f").emit('connected', ...args);
|
|
11745
11747
|
})
|
|
11746
11748
|
]).catch(() => new Error('error setting up channel connection listeners'));
|
|
11747
11749
|
}));
|
|
11748
|
-
__classPrivateFieldSet$
|
|
11750
|
+
__classPrivateFieldSet$7(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
|
|
11749
11751
|
}
|
|
11750
11752
|
/**
|
|
11751
11753
|
*
|
|
@@ -11820,7 +11822,7 @@ class Channel extends base_1$c.EmitterBase {
|
|
|
11820
11822
|
resolve(true);
|
|
11821
11823
|
}
|
|
11822
11824
|
};
|
|
11823
|
-
__classPrivateFieldGet$
|
|
11825
|
+
__classPrivateFieldGet$8(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
|
|
11824
11826
|
});
|
|
11825
11827
|
try {
|
|
11826
11828
|
if (retryInfo.count > 0) {
|
|
@@ -11852,7 +11854,7 @@ class Channel extends base_1$c.EmitterBase {
|
|
|
11852
11854
|
finally {
|
|
11853
11855
|
retryInfo.count += 1;
|
|
11854
11856
|
// in case of other errors, remove our listener
|
|
11855
|
-
__classPrivateFieldGet$
|
|
11857
|
+
__classPrivateFieldGet$8(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
|
|
11856
11858
|
}
|
|
11857
11859
|
} while (shouldWait); // If we're waiting we retry the above loop
|
|
11858
11860
|
// Should wait was false, no channel was found.
|
|
@@ -11911,12 +11913,12 @@ class Channel extends base_1$c.EmitterBase {
|
|
|
11911
11913
|
async connect(channelName, options = {}) {
|
|
11912
11914
|
// Make sure we don't connect before listeners are set up
|
|
11913
11915
|
// This also errors if we're not in OpenFin, ensuring we don't run unnecessary code
|
|
11914
|
-
await __classPrivateFieldGet$
|
|
11916
|
+
await __classPrivateFieldGet$8(this, _Channel_readyToConnect, "f").getValue();
|
|
11915
11917
|
if (!channelName || typeof channelName !== 'string') {
|
|
11916
11918
|
throw new Error('Please provide a channelName string to connect to a channel.');
|
|
11917
11919
|
}
|
|
11918
11920
|
const opts = { wait: true, ...this.wire.environment.getDefaultChannelOptions().connect, ...options };
|
|
11919
|
-
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$
|
|
11921
|
+
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$8(this, _Channel_connectionManager, "f").createClientOffer(opts);
|
|
11920
11922
|
let connectionUrl;
|
|
11921
11923
|
if (this.fin.me.isFrame || this.fin.me.isView || this.fin.me.isWindow) {
|
|
11922
11924
|
connectionUrl = (await this.fin.me.getInfo()).url;
|
|
@@ -11928,7 +11930,7 @@ class Channel extends base_1$c.EmitterBase {
|
|
|
11928
11930
|
connectionUrl
|
|
11929
11931
|
};
|
|
11930
11932
|
const routingInfo = await this.safeConnect(channelName, opts.wait, connectPayload);
|
|
11931
|
-
const strategy = await __classPrivateFieldGet$
|
|
11933
|
+
const strategy = await __classPrivateFieldGet$8(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
|
|
11932
11934
|
const channel = new client_1.ChannelClient(routingInfo, () => client_1.ChannelClient.wireClose(this.wire, routingInfo, routingInfo.endpointId), strategy);
|
|
11933
11935
|
// It is the client's responsibility to handle endpoint disconnection to the provider.
|
|
11934
11936
|
// If the endpoint dies, the client will force a disconnection through the core.
|
|
@@ -11997,7 +11999,7 @@ class Channel extends base_1$c.EmitterBase {
|
|
|
11997
11999
|
throw new Error('Please provide a channelName to create a channel');
|
|
11998
12000
|
}
|
|
11999
12001
|
const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
|
|
12000
|
-
const channel = __classPrivateFieldGet$
|
|
12002
|
+
const channel = __classPrivateFieldGet$8(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
|
|
12001
12003
|
// TODO: fix typing (internal)
|
|
12002
12004
|
// @ts-expect-error
|
|
12003
12005
|
this.on('client-disconnected', (eventPayload) => {
|
|
@@ -12233,32 +12235,14 @@ var clipboard = {};
|
|
|
12233
12235
|
*
|
|
12234
12236
|
* @packageDocumentation
|
|
12235
12237
|
*/
|
|
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;
|
|
12248
12238
|
Object.defineProperty(clipboard, "__esModule", { value: true });
|
|
12249
12239
|
clipboard.Clipboard = void 0;
|
|
12250
12240
|
const base_1$a = base;
|
|
12251
|
-
const maxSecuredApiWarnings = 10;
|
|
12252
12241
|
/**
|
|
12253
12242
|
* The Clipboard API allows reading and writing to the clipboard in multiple formats.
|
|
12254
12243
|
*
|
|
12255
12244
|
*/
|
|
12256
12245
|
class Clipboard extends base_1$a.Base {
|
|
12257
|
-
constructor() {
|
|
12258
|
-
super(...arguments);
|
|
12259
|
-
_Clipboard_instances.add(this);
|
|
12260
|
-
_Clipboard_securedApiWarningCount.set(this, 0);
|
|
12261
|
-
}
|
|
12262
12246
|
/**
|
|
12263
12247
|
* Writes data into the clipboard as plain text
|
|
12264
12248
|
* @param writeObj The object for writing data into the clipboard
|
|
@@ -12271,7 +12255,6 @@ class Clipboard extends base_1$a.Base {
|
|
|
12271
12255
|
* ```
|
|
12272
12256
|
*/
|
|
12273
12257
|
async writeText(writeObj) {
|
|
12274
|
-
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeText');
|
|
12275
12258
|
await this.wire.sendAction('clipboard-write-text', writeObj);
|
|
12276
12259
|
}
|
|
12277
12260
|
/**
|
|
@@ -12284,7 +12267,6 @@ class Clipboard extends base_1$a.Base {
|
|
|
12284
12267
|
* ```
|
|
12285
12268
|
*/
|
|
12286
12269
|
async readText(type) {
|
|
12287
|
-
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readText');
|
|
12288
12270
|
// NOTE: When we start supporting linux, we could detect the OS and choose 'selection' automatically for the user
|
|
12289
12271
|
const { payload } = await this.wire.sendAction('clipboard-read-text', { type });
|
|
12290
12272
|
return payload.data;
|
|
@@ -12302,7 +12284,6 @@ class Clipboard extends base_1$a.Base {
|
|
|
12302
12284
|
* ```
|
|
12303
12285
|
*/
|
|
12304
12286
|
async writeImage(writeRequest) {
|
|
12305
|
-
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeImage');
|
|
12306
12287
|
await this.wire.sendAction('clipboard-write-image', writeRequest);
|
|
12307
12288
|
}
|
|
12308
12289
|
/**
|
|
@@ -12338,7 +12319,6 @@ class Clipboard extends base_1$a.Base {
|
|
|
12338
12319
|
* ```
|
|
12339
12320
|
*/
|
|
12340
12321
|
async readImage(readRequest = { format: 'dataURL' }) {
|
|
12341
|
-
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readImage');
|
|
12342
12322
|
const { payload } = await this.wire.sendAction('clipboard-read-image', readRequest);
|
|
12343
12323
|
return payload.data;
|
|
12344
12324
|
}
|
|
@@ -12354,7 +12334,6 @@ class Clipboard extends base_1$a.Base {
|
|
|
12354
12334
|
* ```
|
|
12355
12335
|
*/
|
|
12356
12336
|
async writeHtml(writeObj) {
|
|
12357
|
-
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeHtml');
|
|
12358
12337
|
await this.wire.sendAction('clipboard-write-html', writeObj);
|
|
12359
12338
|
}
|
|
12360
12339
|
/**
|
|
@@ -12367,7 +12346,6 @@ class Clipboard extends base_1$a.Base {
|
|
|
12367
12346
|
* ```
|
|
12368
12347
|
*/
|
|
12369
12348
|
async readHtml(type) {
|
|
12370
|
-
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readHtml');
|
|
12371
12349
|
const { payload } = await this.wire.sendAction('clipboard-read-html', { type });
|
|
12372
12350
|
return payload.data;
|
|
12373
12351
|
}
|
|
@@ -12383,7 +12361,6 @@ class Clipboard extends base_1$a.Base {
|
|
|
12383
12361
|
* ```
|
|
12384
12362
|
*/
|
|
12385
12363
|
async writeRtf(writeObj) {
|
|
12386
|
-
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeRtf');
|
|
12387
12364
|
await this.wire.sendAction('clipboard-write-rtf', writeObj);
|
|
12388
12365
|
}
|
|
12389
12366
|
/**
|
|
@@ -12404,7 +12381,6 @@ class Clipboard extends base_1$a.Base {
|
|
|
12404
12381
|
* ```
|
|
12405
12382
|
*/
|
|
12406
12383
|
async readRtf(type) {
|
|
12407
|
-
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readRtf');
|
|
12408
12384
|
const { payload } = await this.wire.sendAction('clipboard-read-rtf', { type });
|
|
12409
12385
|
return payload.data;
|
|
12410
12386
|
}
|
|
@@ -12428,7 +12404,6 @@ class Clipboard extends base_1$a.Base {
|
|
|
12428
12404
|
* ```
|
|
12429
12405
|
*/
|
|
12430
12406
|
async write(writeObj) {
|
|
12431
|
-
__classPrivateFieldGet$8(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.write');
|
|
12432
12407
|
await this.wire.sendAction('clipboard-write', writeObj);
|
|
12433
12408
|
}
|
|
12434
12409
|
/**
|
|
@@ -12446,12 +12421,6 @@ class Clipboard extends base_1$a.Base {
|
|
|
12446
12421
|
}
|
|
12447
12422
|
}
|
|
12448
12423
|
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
|
-
};
|
|
12455
12424
|
|
|
12456
12425
|
var globalHotkey = {};
|
|
12457
12426
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfin/remote-adapter",
|
|
3
|
-
"version": "42.100.
|
|
3
|
+
"version": "42.100.60",
|
|
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.60"
|
|
24
24
|
}
|
|
25
25
|
}
|