@openfin/remote-adapter 40.104.2 → 40.104.4
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 +163 -130
- 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$e = (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$f = (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$f(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$f(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$f(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$f(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$e(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
|
|
203
|
+
__classPrivateFieldSet$e(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$f(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$f(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$f(this, _EmitterBase_emitterAccessor, "f"));
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
}
|
|
@@ -456,13 +456,13 @@ var utils$3 = {};
|
|
|
456
456
|
exports.wrapIntentHandler = wrapIntentHandler;
|
|
457
457
|
} (utils$3));
|
|
458
458
|
|
|
459
|
-
var __classPrivateFieldSet$
|
|
459
|
+
var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
460
460
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
461
461
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
462
462
|
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");
|
|
463
463
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
464
464
|
};
|
|
465
|
-
var __classPrivateFieldGet$
|
|
465
|
+
var __classPrivateFieldGet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
466
466
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
467
467
|
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");
|
|
468
468
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -476,7 +476,7 @@ class SessionContextGroupClient extends base_1$j.Base {
|
|
|
476
476
|
super(wire);
|
|
477
477
|
_SessionContextGroupClient_clientPromise.set(this, void 0);
|
|
478
478
|
this.id = id;
|
|
479
|
-
__classPrivateFieldSet$
|
|
479
|
+
__classPrivateFieldSet$d(this, _SessionContextGroupClient_clientPromise, client, "f");
|
|
480
480
|
}
|
|
481
481
|
/**
|
|
482
482
|
* Sets a context for the session context group.
|
|
@@ -488,7 +488,7 @@ class SessionContextGroupClient extends base_1$j.Base {
|
|
|
488
488
|
this.wire.sendAction('interop-session-context-group-set-context').catch((e) => {
|
|
489
489
|
// don't expose, analytics-only call
|
|
490
490
|
});
|
|
491
|
-
const client = await __classPrivateFieldGet$
|
|
491
|
+
const client = await __classPrivateFieldGet$e(this, _SessionContextGroupClient_clientPromise, "f");
|
|
492
492
|
return client.dispatch(`sessionContextGroup:setContext-${this.id}`, {
|
|
493
493
|
sessionContextGroupId: this.id,
|
|
494
494
|
context
|
|
@@ -498,7 +498,7 @@ class SessionContextGroupClient extends base_1$j.Base {
|
|
|
498
498
|
this.wire.sendAction('interop-session-context-group-get-context').catch((e) => {
|
|
499
499
|
// don't expose, analytics-only call
|
|
500
500
|
});
|
|
501
|
-
const client = await __classPrivateFieldGet$
|
|
501
|
+
const client = await __classPrivateFieldGet$e(this, _SessionContextGroupClient_clientPromise, "f");
|
|
502
502
|
return client.dispatch(`sessionContextGroup:getContext-${this.id}`, {
|
|
503
503
|
sessionContextGroupId: this.id,
|
|
504
504
|
type
|
|
@@ -511,7 +511,7 @@ class SessionContextGroupClient extends base_1$j.Base {
|
|
|
511
511
|
if (typeof contextHandler !== 'function') {
|
|
512
512
|
throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
|
|
513
513
|
}
|
|
514
|
-
const client = await __classPrivateFieldGet$
|
|
514
|
+
const client = await __classPrivateFieldGet$e(this, _SessionContextGroupClient_clientPromise, "f");
|
|
515
515
|
let handlerId;
|
|
516
516
|
if (contextType) {
|
|
517
517
|
handlerId = `sessionContextHandler:invoke-${this.id}-${contextType}-${(0, utils_1$2.generateId)()}`;
|
|
@@ -524,7 +524,7 @@ class SessionContextGroupClient extends base_1$j.Base {
|
|
|
524
524
|
return { unsubscribe: await this.createUnsubscribeCb(handlerId) };
|
|
525
525
|
}
|
|
526
526
|
async createUnsubscribeCb(handlerId) {
|
|
527
|
-
const client = await __classPrivateFieldGet$
|
|
527
|
+
const client = await __classPrivateFieldGet$e(this, _SessionContextGroupClient_clientPromise, "f");
|
|
528
528
|
return async () => {
|
|
529
529
|
client.remove(handlerId);
|
|
530
530
|
await client.dispatch(`sessionContextGroup:handlerRemoved-${this.id}`, { handlerId });
|
|
@@ -9673,13 +9673,13 @@ function errorToPOJO(error) {
|
|
|
9673
9673
|
}
|
|
9674
9674
|
errors.errorToPOJO = errorToPOJO;
|
|
9675
9675
|
|
|
9676
|
-
var __classPrivateFieldSet$
|
|
9676
|
+
var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
9677
9677
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
9678
9678
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9679
9679
|
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");
|
|
9680
9680
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
9681
9681
|
};
|
|
9682
|
-
var __classPrivateFieldGet$
|
|
9682
|
+
var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9683
9683
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9684
9684
|
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");
|
|
9685
9685
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -9707,19 +9707,19 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
9707
9707
|
// Typing as unknown to avoid circular dependency, should not be used directly.
|
|
9708
9708
|
_Transport_fin.set(this, void 0);
|
|
9709
9709
|
this.connectSync = () => {
|
|
9710
|
-
const wire = __classPrivateFieldGet$
|
|
9710
|
+
const wire = __classPrivateFieldGet$d(this, _Transport_wire, "f");
|
|
9711
9711
|
wire.connectSync();
|
|
9712
9712
|
};
|
|
9713
9713
|
// This function is only used in our tests.
|
|
9714
9714
|
this.getPort = () => {
|
|
9715
|
-
const wire = __classPrivateFieldGet$
|
|
9715
|
+
const wire = __classPrivateFieldGet$d(this, _Transport_wire, "f");
|
|
9716
9716
|
return wire.getPort();
|
|
9717
9717
|
};
|
|
9718
|
-
__classPrivateFieldSet$
|
|
9718
|
+
__classPrivateFieldSet$c(this, _Transport_wire, new WireType(this.onmessage.bind(this)), "f");
|
|
9719
9719
|
this.environment = environment;
|
|
9720
|
-
this.sendRaw = __classPrivateFieldGet$
|
|
9720
|
+
this.sendRaw = __classPrivateFieldGet$d(this, _Transport_wire, "f").send.bind(__classPrivateFieldGet$d(this, _Transport_wire, "f"));
|
|
9721
9721
|
this.registerMessageHandler(this.handleMessage.bind(this));
|
|
9722
|
-
__classPrivateFieldGet$
|
|
9722
|
+
__classPrivateFieldGet$d(this, _Transport_wire, "f").on('disconnected', () => {
|
|
9723
9723
|
for (const [, { handleNack }] of this.wireListeners) {
|
|
9724
9724
|
handleNack({ reason: 'Remote connection has closed' });
|
|
9725
9725
|
}
|
|
@@ -9731,24 +9731,24 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
9731
9731
|
this.me = (0, me_1$1.getBaseMe)(entityType, uuid, name);
|
|
9732
9732
|
}
|
|
9733
9733
|
getFin() {
|
|
9734
|
-
if (!__classPrivateFieldGet$
|
|
9734
|
+
if (!__classPrivateFieldGet$d(this, _Transport_fin, "f")) {
|
|
9735
9735
|
throw new Error('No Fin object registered for this transport');
|
|
9736
9736
|
}
|
|
9737
|
-
return __classPrivateFieldGet$
|
|
9737
|
+
return __classPrivateFieldGet$d(this, _Transport_fin, "f");
|
|
9738
9738
|
}
|
|
9739
9739
|
registerFin(_fin) {
|
|
9740
|
-
if (__classPrivateFieldGet$
|
|
9740
|
+
if (__classPrivateFieldGet$d(this, _Transport_fin, "f")) {
|
|
9741
9741
|
throw new Error('Fin object has already been registered for this transport');
|
|
9742
9742
|
}
|
|
9743
|
-
__classPrivateFieldSet$
|
|
9743
|
+
__classPrivateFieldSet$c(this, _Transport_fin, _fin, "f");
|
|
9744
9744
|
}
|
|
9745
9745
|
shutdown() {
|
|
9746
|
-
const wire = __classPrivateFieldGet$
|
|
9746
|
+
const wire = __classPrivateFieldGet$d(this, _Transport_wire, "f");
|
|
9747
9747
|
return wire.shutdown();
|
|
9748
9748
|
}
|
|
9749
9749
|
async connect(config) {
|
|
9750
9750
|
if ((0, wire_1.isConfigWithReceiver)(config)) {
|
|
9751
|
-
await __classPrivateFieldGet$
|
|
9751
|
+
await __classPrivateFieldGet$d(this, _Transport_wire, "f").connect(config.receiver);
|
|
9752
9752
|
return this.authorize(config);
|
|
9753
9753
|
}
|
|
9754
9754
|
if ((0, wire_1.isRemoteConfig)(config)) {
|
|
@@ -9764,13 +9764,13 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
9764
9764
|
return undefined;
|
|
9765
9765
|
}
|
|
9766
9766
|
async connectRemote(config) {
|
|
9767
|
-
await __classPrivateFieldGet$
|
|
9767
|
+
await __classPrivateFieldGet$d(this, _Transport_wire, "f").connect(new (this.environment.getWsConstructor())(config.address));
|
|
9768
9768
|
return this.authorize(config);
|
|
9769
9769
|
}
|
|
9770
9770
|
async connectByPort(config) {
|
|
9771
9771
|
const { address, uuid } = config;
|
|
9772
9772
|
const reqAuthPayload = { ...config, type: 'file-token' };
|
|
9773
|
-
const wire = __classPrivateFieldGet$
|
|
9773
|
+
const wire = __classPrivateFieldGet$d(this, _Transport_wire, "f");
|
|
9774
9774
|
await wire.connect(new (this.environment.getWsConstructor())(config.address));
|
|
9775
9775
|
const requestExtAuthRet = await this.sendAction('request-external-authorization', {
|
|
9776
9776
|
uuid,
|
|
@@ -9806,7 +9806,7 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
9806
9806
|
payload,
|
|
9807
9807
|
messageId
|
|
9808
9808
|
};
|
|
9809
|
-
const wire = __classPrivateFieldGet$
|
|
9809
|
+
const wire = __classPrivateFieldGet$d(this, _Transport_wire, "f");
|
|
9810
9810
|
this.addWireListener(messageId, resolve, (payload) => this.nackHandler(payload, reject, callSites), uncorrelated);
|
|
9811
9811
|
return wire.send(msg).catch(reject);
|
|
9812
9812
|
});
|
|
@@ -9828,7 +9828,7 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
9828
9828
|
const resolver = (data) => {
|
|
9829
9829
|
resolve(data.payload);
|
|
9830
9830
|
};
|
|
9831
|
-
const wire = __classPrivateFieldGet$
|
|
9831
|
+
const wire = __classPrivateFieldGet$d(this, _Transport_wire, "f");
|
|
9832
9832
|
return wire
|
|
9833
9833
|
.send(origData)
|
|
9834
9834
|
.then(() => this.addWireListener(id, resolver, (payload) => this.nackHandler(payload, reject), false))
|
|
@@ -12299,12 +12299,12 @@ class ChannelError extends Error {
|
|
|
12299
12299
|
}
|
|
12300
12300
|
channelError.ChannelError = ChannelError;
|
|
12301
12301
|
|
|
12302
|
-
var __classPrivateFieldGet$
|
|
12302
|
+
var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12303
12303
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
12304
12304
|
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");
|
|
12305
12305
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12306
12306
|
};
|
|
12307
|
-
var __classPrivateFieldSet$
|
|
12307
|
+
var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12308
12308
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
12309
12309
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
12310
12310
|
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");
|
|
@@ -12348,7 +12348,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
12348
12348
|
static closeChannelByEndpointId(id) {
|
|
12349
12349
|
const channel = channelClientsByEndpointId.get(id);
|
|
12350
12350
|
if (channel) {
|
|
12351
|
-
__classPrivateFieldGet$
|
|
12351
|
+
__classPrivateFieldGet$c(channel, _ChannelClient_close, "f").call(channel);
|
|
12352
12352
|
}
|
|
12353
12353
|
}
|
|
12354
12354
|
/**
|
|
@@ -12359,7 +12359,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
12359
12359
|
for (const channelClient of channelClientsByEndpointId.values()) {
|
|
12360
12360
|
if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
|
|
12361
12361
|
channelClient.disconnectListener(eventPayload);
|
|
12362
|
-
__classPrivateFieldGet$
|
|
12362
|
+
__classPrivateFieldGet$c(channelClient, _ChannelClient_close, "f").call(channelClient);
|
|
12363
12363
|
}
|
|
12364
12364
|
}
|
|
12365
12365
|
}
|
|
@@ -12374,12 +12374,12 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
12374
12374
|
this.processAction = (action, payload, senderIdentity) => super.processAction(action, payload, senderIdentity);
|
|
12375
12375
|
_ChannelClient_close.set(this, () => {
|
|
12376
12376
|
channelClientsByEndpointId.delete(this.endpointId);
|
|
12377
|
-
__classPrivateFieldGet$
|
|
12377
|
+
__classPrivateFieldGet$c(this, _ChannelClient_strategy, "f").close();
|
|
12378
12378
|
});
|
|
12379
|
-
__classPrivateFieldSet$
|
|
12379
|
+
__classPrivateFieldSet$b(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
|
|
12380
12380
|
this.disconnectListener = () => undefined;
|
|
12381
12381
|
this.endpointId = routingInfo.endpointId;
|
|
12382
|
-
__classPrivateFieldSet$
|
|
12382
|
+
__classPrivateFieldSet$b(this, _ChannelClient_strategy, strategy, "f");
|
|
12383
12383
|
channelClientsByEndpointId.set(this.endpointId, this);
|
|
12384
12384
|
strategy.receive(this.processAction);
|
|
12385
12385
|
}
|
|
@@ -12387,7 +12387,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
12387
12387
|
* a read-only provider identity
|
|
12388
12388
|
*/
|
|
12389
12389
|
get providerIdentity() {
|
|
12390
|
-
const protectedObj = __classPrivateFieldGet$
|
|
12390
|
+
const protectedObj = __classPrivateFieldGet$c(this, _ChannelClient_protectedObj, "f");
|
|
12391
12391
|
return protectedObj.providerIdentity;
|
|
12392
12392
|
}
|
|
12393
12393
|
/**
|
|
@@ -12416,9 +12416,9 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
12416
12416
|
* ```
|
|
12417
12417
|
*/
|
|
12418
12418
|
async dispatch(action, payload) {
|
|
12419
|
-
if (__classPrivateFieldGet$
|
|
12419
|
+
if (__classPrivateFieldGet$c(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
|
|
12420
12420
|
const callSites = transport_errors_1$1.RuntimeError.getCallSite();
|
|
12421
|
-
return __classPrivateFieldGet$
|
|
12421
|
+
return __classPrivateFieldGet$c(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
|
|
12422
12422
|
throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
|
|
12423
12423
|
});
|
|
12424
12424
|
}
|
|
@@ -12470,10 +12470,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
12470
12470
|
*/
|
|
12471
12471
|
async disconnect() {
|
|
12472
12472
|
await this.sendDisconnectAction();
|
|
12473
|
-
__classPrivateFieldGet$
|
|
12473
|
+
__classPrivateFieldGet$c(this, _ChannelClient_close, "f").call(this);
|
|
12474
12474
|
}
|
|
12475
12475
|
async sendDisconnectAction() {
|
|
12476
|
-
const protectedObj = __classPrivateFieldGet$
|
|
12476
|
+
const protectedObj = __classPrivateFieldGet$c(this, _ChannelClient_protectedObj, "f");
|
|
12477
12477
|
await protectedObj.close();
|
|
12478
12478
|
}
|
|
12479
12479
|
/**
|
|
@@ -12506,13 +12506,13 @@ exhaustive.exhaustiveCheck = exhaustiveCheck;
|
|
|
12506
12506
|
|
|
12507
12507
|
var strategy$3 = {};
|
|
12508
12508
|
|
|
12509
|
-
var __classPrivateFieldSet$
|
|
12509
|
+
var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12510
12510
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
12511
12511
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
12512
12512
|
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");
|
|
12513
12513
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
12514
12514
|
};
|
|
12515
|
-
var __classPrivateFieldGet$
|
|
12515
|
+
var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12516
12516
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
12517
12517
|
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");
|
|
12518
12518
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -12537,7 +12537,7 @@ class ClassicStrategy {
|
|
|
12537
12537
|
// connection problems occur
|
|
12538
12538
|
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
|
|
12539
12539
|
this.send = async (endpointId, action, payload) => {
|
|
12540
|
-
const to = __classPrivateFieldGet$
|
|
12540
|
+
const to = __classPrivateFieldGet$b(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
12541
12541
|
if (!to) {
|
|
12542
12542
|
throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
|
|
12543
12543
|
}
|
|
@@ -12549,13 +12549,13 @@ class ClassicStrategy {
|
|
|
12549
12549
|
}
|
|
12550
12550
|
delete cleanId.isLocalEndpointId;
|
|
12551
12551
|
// grab the promise before awaiting it to save in our pending messages map
|
|
12552
|
-
const p = __classPrivateFieldGet$
|
|
12552
|
+
const p = __classPrivateFieldGet$b(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
|
|
12553
12553
|
...cleanId,
|
|
12554
12554
|
providerIdentity: this.providerIdentity,
|
|
12555
12555
|
action,
|
|
12556
12556
|
payload
|
|
12557
12557
|
});
|
|
12558
|
-
__classPrivateFieldGet$
|
|
12558
|
+
__classPrivateFieldGet$b(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
|
|
12559
12559
|
const raw = await p
|
|
12560
12560
|
.catch((error) => {
|
|
12561
12561
|
if ('cause' in error) {
|
|
@@ -12565,16 +12565,16 @@ class ClassicStrategy {
|
|
|
12565
12565
|
})
|
|
12566
12566
|
.finally(() => {
|
|
12567
12567
|
// clean up the pending promise
|
|
12568
|
-
__classPrivateFieldGet$
|
|
12568
|
+
__classPrivateFieldGet$b(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
|
|
12569
12569
|
});
|
|
12570
12570
|
return raw.payload.data.result;
|
|
12571
12571
|
};
|
|
12572
12572
|
this.close = async () => {
|
|
12573
12573
|
this.messageReceiver.removeEndpoint(this.providerIdentity.channelId, this.endpointId);
|
|
12574
|
-
[...__classPrivateFieldGet$
|
|
12575
|
-
__classPrivateFieldSet$
|
|
12574
|
+
[...__classPrivateFieldGet$b(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
|
|
12575
|
+
__classPrivateFieldSet$a(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
|
|
12576
12576
|
};
|
|
12577
|
-
__classPrivateFieldSet$
|
|
12577
|
+
__classPrivateFieldSet$a(this, _ClassicStrategy_wire, wire, "f");
|
|
12578
12578
|
}
|
|
12579
12579
|
onEndpointDisconnect(endpointId, listener) {
|
|
12580
12580
|
// Never fires for 'classic'.
|
|
@@ -12583,20 +12583,20 @@ class ClassicStrategy {
|
|
|
12583
12583
|
this.messageReceiver.addEndpoint(listener, this.providerIdentity.channelId, this.endpointId);
|
|
12584
12584
|
}
|
|
12585
12585
|
async closeEndpoint(endpointId) {
|
|
12586
|
-
const id = __classPrivateFieldGet$
|
|
12587
|
-
__classPrivateFieldGet$
|
|
12588
|
-
const pendingSet = __classPrivateFieldGet$
|
|
12586
|
+
const id = __classPrivateFieldGet$b(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
12587
|
+
__classPrivateFieldGet$b(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
|
|
12588
|
+
const pendingSet = __classPrivateFieldGet$b(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
|
|
12589
12589
|
pendingSet?.forEach((p) => {
|
|
12590
12590
|
const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
|
|
12591
12591
|
p.cancel(new Error(errorMsg));
|
|
12592
12592
|
});
|
|
12593
12593
|
}
|
|
12594
12594
|
isEndpointConnected(endpointId) {
|
|
12595
|
-
return __classPrivateFieldGet$
|
|
12595
|
+
return __classPrivateFieldGet$b(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
|
|
12596
12596
|
}
|
|
12597
12597
|
addEndpoint(endpointId, payload) {
|
|
12598
|
-
__classPrivateFieldGet$
|
|
12599
|
-
__classPrivateFieldGet$
|
|
12598
|
+
__classPrivateFieldGet$b(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
|
|
12599
|
+
__classPrivateFieldGet$b(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
|
|
12600
12600
|
}
|
|
12601
12601
|
isValidEndpointPayload(payload) {
|
|
12602
12602
|
return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
|
|
@@ -12612,12 +12612,12 @@ var strategy$2 = {};
|
|
|
12612
12612
|
|
|
12613
12613
|
var endpoint = {};
|
|
12614
12614
|
|
|
12615
|
-
var __classPrivateFieldGet$
|
|
12615
|
+
var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12616
12616
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
12617
12617
|
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");
|
|
12618
12618
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12619
12619
|
};
|
|
12620
|
-
var __classPrivateFieldSet$
|
|
12620
|
+
var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12621
12621
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
12622
12622
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
12623
12623
|
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");
|
|
@@ -12652,8 +12652,8 @@ class RTCEndpoint {
|
|
|
12652
12652
|
if (this.rtc.rtcClient.connectionState !== 'connected') {
|
|
12653
12653
|
this.rtc.rtcClient.removeEventListener('connectionstatechange', this.connectionStateChangeHandler);
|
|
12654
12654
|
this.close();
|
|
12655
|
-
if (__classPrivateFieldGet$
|
|
12656
|
-
__classPrivateFieldGet$
|
|
12655
|
+
if (__classPrivateFieldGet$a(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
12656
|
+
__classPrivateFieldGet$a(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
|
12657
12657
|
}
|
|
12658
12658
|
}
|
|
12659
12659
|
};
|
|
@@ -12701,9 +12701,9 @@ class RTCEndpoint {
|
|
|
12701
12701
|
data = new TextDecoder().decode(e.data);
|
|
12702
12702
|
}
|
|
12703
12703
|
const { messageId, action, payload } = JSON.parse(data);
|
|
12704
|
-
if (__classPrivateFieldGet$
|
|
12704
|
+
if (__classPrivateFieldGet$a(this, _RTCEndpoint_processAction, "f")) {
|
|
12705
12705
|
try {
|
|
12706
|
-
const res = await __classPrivateFieldGet$
|
|
12706
|
+
const res = await __classPrivateFieldGet$a(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
|
|
12707
12707
|
this.rtc.channels.response.send(JSON.stringify({
|
|
12708
12708
|
messageId,
|
|
12709
12709
|
payload: res,
|
|
@@ -12737,25 +12737,25 @@ class RTCEndpoint {
|
|
|
12737
12737
|
datachannel.onclose = (e) => {
|
|
12738
12738
|
[...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.')));
|
|
12739
12739
|
this.close();
|
|
12740
|
-
if (__classPrivateFieldGet$
|
|
12741
|
-
__classPrivateFieldGet$
|
|
12740
|
+
if (__classPrivateFieldGet$a(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
12741
|
+
__classPrivateFieldGet$a(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
|
12742
12742
|
}
|
|
12743
12743
|
};
|
|
12744
12744
|
});
|
|
12745
12745
|
}
|
|
12746
12746
|
onDisconnect(listener) {
|
|
12747
|
-
if (!__classPrivateFieldGet$
|
|
12748
|
-
__classPrivateFieldSet$
|
|
12747
|
+
if (!__classPrivateFieldGet$a(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
12748
|
+
__classPrivateFieldSet$9(this, _RTCEndpoint_disconnectListener, listener, "f");
|
|
12749
12749
|
}
|
|
12750
12750
|
else {
|
|
12751
12751
|
throw new Error('RTCEndpoint disconnectListener cannot be set twice.');
|
|
12752
12752
|
}
|
|
12753
12753
|
}
|
|
12754
12754
|
receive(listener) {
|
|
12755
|
-
if (__classPrivateFieldGet$
|
|
12755
|
+
if (__classPrivateFieldGet$a(this, _RTCEndpoint_processAction, "f")) {
|
|
12756
12756
|
throw new Error('You have already set a listener for this RTC Endpoint.');
|
|
12757
12757
|
}
|
|
12758
|
-
__classPrivateFieldSet$
|
|
12758
|
+
__classPrivateFieldSet$9(this, _RTCEndpoint_processAction, listener, "f");
|
|
12759
12759
|
}
|
|
12760
12760
|
get connected() {
|
|
12761
12761
|
return this.rtc.rtcClient.connectionState === 'connected';
|
|
@@ -12766,12 +12766,12 @@ _RTCEndpoint_processAction = new WeakMap(), _RTCEndpoint_disconnectListener = ne
|
|
|
12766
12766
|
|
|
12767
12767
|
var strategy$1 = {};
|
|
12768
12768
|
|
|
12769
|
-
var __classPrivateFieldGet$
|
|
12769
|
+
var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12770
12770
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
12771
12771
|
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");
|
|
12772
12772
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12773
12773
|
};
|
|
12774
|
-
var __classPrivateFieldSet$
|
|
12774
|
+
var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12775
12775
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
12776
12776
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
12777
12777
|
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");
|
|
@@ -12792,11 +12792,11 @@ class EndpointStrategy {
|
|
|
12792
12792
|
return this.getEndpointById(endpointId).send(action, payload);
|
|
12793
12793
|
};
|
|
12794
12794
|
this.close = async () => {
|
|
12795
|
-
if (__classPrivateFieldGet$
|
|
12796
|
-
__classPrivateFieldGet$
|
|
12797
|
-
__classPrivateFieldSet$
|
|
12795
|
+
if (__classPrivateFieldGet$9(this, _EndpointStrategy_connected, "f")) {
|
|
12796
|
+
__classPrivateFieldGet$9(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
|
|
12797
|
+
__classPrivateFieldSet$8(this, _EndpointStrategy_endpointMap, new Map(), "f");
|
|
12798
12798
|
}
|
|
12799
|
-
__classPrivateFieldSet$
|
|
12799
|
+
__classPrivateFieldSet$8(this, _EndpointStrategy_connected, false, "f");
|
|
12800
12800
|
};
|
|
12801
12801
|
this.isValidEndpointPayload = validateEndpoint;
|
|
12802
12802
|
}
|
|
@@ -12804,39 +12804,39 @@ class EndpointStrategy {
|
|
|
12804
12804
|
this.getEndpointById(endpointId).onDisconnect(listener);
|
|
12805
12805
|
}
|
|
12806
12806
|
receive(listener) {
|
|
12807
|
-
if (__classPrivateFieldGet$
|
|
12807
|
+
if (__classPrivateFieldGet$9(this, _EndpointStrategy_processAction, "f")) {
|
|
12808
12808
|
throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);
|
|
12809
12809
|
}
|
|
12810
|
-
__classPrivateFieldSet$
|
|
12810
|
+
__classPrivateFieldSet$8(this, _EndpointStrategy_processAction, listener, "f");
|
|
12811
12811
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
12812
|
-
__classPrivateFieldGet$
|
|
12812
|
+
__classPrivateFieldGet$9(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$9(this, _EndpointStrategy_processAction, "f")));
|
|
12813
12813
|
}
|
|
12814
12814
|
getEndpointById(endpointId) {
|
|
12815
|
-
const endpoint = __classPrivateFieldGet$
|
|
12815
|
+
const endpoint = __classPrivateFieldGet$9(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
|
|
12816
12816
|
if (!endpoint) {
|
|
12817
12817
|
throw new Error(`Client with endpoint id ${endpointId} is not connected`);
|
|
12818
12818
|
}
|
|
12819
12819
|
return endpoint;
|
|
12820
12820
|
}
|
|
12821
12821
|
get connected() {
|
|
12822
|
-
return __classPrivateFieldGet$
|
|
12822
|
+
return __classPrivateFieldGet$9(this, _EndpointStrategy_connected, "f");
|
|
12823
12823
|
}
|
|
12824
12824
|
isEndpointConnected(endpointId) {
|
|
12825
|
-
return __classPrivateFieldGet$
|
|
12825
|
+
return __classPrivateFieldGet$9(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
|
|
12826
12826
|
}
|
|
12827
12827
|
addEndpoint(endpointId, payload) {
|
|
12828
|
-
if (!__classPrivateFieldGet$
|
|
12828
|
+
if (!__classPrivateFieldGet$9(this, _EndpointStrategy_connected, "f")) {
|
|
12829
12829
|
console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);
|
|
12830
12830
|
return;
|
|
12831
12831
|
}
|
|
12832
12832
|
const clientStrat = new this.EndpointType(payload);
|
|
12833
|
-
if (__classPrivateFieldGet$
|
|
12834
|
-
clientStrat.receive(__classPrivateFieldGet$
|
|
12833
|
+
if (__classPrivateFieldGet$9(this, _EndpointStrategy_processAction, "f")) {
|
|
12834
|
+
clientStrat.receive(__classPrivateFieldGet$9(this, _EndpointStrategy_processAction, "f"));
|
|
12835
12835
|
}
|
|
12836
|
-
__classPrivateFieldGet$
|
|
12836
|
+
__classPrivateFieldGet$9(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
|
|
12837
12837
|
}
|
|
12838
12838
|
async closeEndpoint(endpointId) {
|
|
12839
|
-
__classPrivateFieldGet$
|
|
12839
|
+
__classPrivateFieldGet$9(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
|
|
12840
12840
|
}
|
|
12841
12841
|
}
|
|
12842
12842
|
strategy$1.EndpointStrategy = EndpointStrategy;
|
|
@@ -13018,12 +13018,12 @@ function runtimeUuidMeetsMinimumRuntimeVersion(runtimeUuid, minVersion) {
|
|
|
13018
13018
|
}
|
|
13019
13019
|
runtimeVersioning.runtimeUuidMeetsMinimumRuntimeVersion = runtimeUuidMeetsMinimumRuntimeVersion;
|
|
13020
13020
|
|
|
13021
|
-
var __classPrivateFieldGet$
|
|
13021
|
+
var __classPrivateFieldGet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
13022
13022
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13023
13023
|
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");
|
|
13024
13024
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
13025
13025
|
};
|
|
13026
|
-
var __classPrivateFieldSet$
|
|
13026
|
+
var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
13027
13027
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
13028
13028
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
13029
13029
|
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");
|
|
@@ -13067,19 +13067,19 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
13067
13067
|
* a read-only array containing all the identities of connecting clients.
|
|
13068
13068
|
*/
|
|
13069
13069
|
get connections() {
|
|
13070
|
-
return [...__classPrivateFieldGet$
|
|
13070
|
+
return [...__classPrivateFieldGet$8(this, _ChannelProvider_connections, "f")];
|
|
13071
13071
|
}
|
|
13072
13072
|
static handleClientDisconnection(channel, payload) {
|
|
13073
13073
|
if (payload?.endpointId) {
|
|
13074
13074
|
const { uuid, name, endpointId, isLocalEndpointId } = payload;
|
|
13075
|
-
__classPrivateFieldGet$
|
|
13075
|
+
__classPrivateFieldGet$8(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
|
|
13076
13076
|
}
|
|
13077
13077
|
else {
|
|
13078
13078
|
// this is here to support older runtimes that did not have endpointId
|
|
13079
13079
|
const multipleRemoves = channel.connections.filter((identity) => {
|
|
13080
13080
|
return identity.uuid === payload.uuid && identity.name === payload.name;
|
|
13081
13081
|
});
|
|
13082
|
-
multipleRemoves.forEach(__classPrivateFieldGet$
|
|
13082
|
+
multipleRemoves.forEach(__classPrivateFieldGet$8(channel, _ChannelProvider_removeEndpoint, "f"));
|
|
13083
13083
|
}
|
|
13084
13084
|
channel.disconnectListener(payload);
|
|
13085
13085
|
}
|
|
@@ -13096,8 +13096,8 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
13096
13096
|
_ChannelProvider_strategy.set(this, void 0);
|
|
13097
13097
|
_ChannelProvider_removeEndpoint.set(this, (identity) => {
|
|
13098
13098
|
const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
|
|
13099
|
-
__classPrivateFieldGet$
|
|
13100
|
-
__classPrivateFieldSet$
|
|
13099
|
+
__classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
|
|
13100
|
+
__classPrivateFieldSet$7(this, _ChannelProvider_connections, remainingConnections, "f");
|
|
13101
13101
|
});
|
|
13102
13102
|
// Must be bound.
|
|
13103
13103
|
this.processAction = async (action, payload, senderIdentity) => {
|
|
@@ -13111,17 +13111,17 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
13111
13111
|
return super.processAction(action, payload, senderIdentity);
|
|
13112
13112
|
};
|
|
13113
13113
|
_ChannelProvider_close.set(this, () => {
|
|
13114
|
-
__classPrivateFieldGet$
|
|
13114
|
+
__classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").close();
|
|
13115
13115
|
const remove = ChannelProvider.removalMap.get(this);
|
|
13116
13116
|
if (remove) {
|
|
13117
13117
|
remove();
|
|
13118
13118
|
}
|
|
13119
13119
|
});
|
|
13120
|
-
__classPrivateFieldSet$
|
|
13120
|
+
__classPrivateFieldSet$7(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
|
|
13121
13121
|
this.connectListener = () => undefined;
|
|
13122
13122
|
this.disconnectListener = () => undefined;
|
|
13123
|
-
__classPrivateFieldSet$
|
|
13124
|
-
__classPrivateFieldSet$
|
|
13123
|
+
__classPrivateFieldSet$7(this, _ChannelProvider_connections, [], "f");
|
|
13124
|
+
__classPrivateFieldSet$7(this, _ChannelProvider_strategy, strategy, "f");
|
|
13125
13125
|
strategy.receive(this.processAction);
|
|
13126
13126
|
}
|
|
13127
13127
|
/**
|
|
@@ -13152,16 +13152,16 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
13152
13152
|
*/
|
|
13153
13153
|
dispatch(to, action, payload) {
|
|
13154
13154
|
const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
|
|
13155
|
-
if (endpointId && __classPrivateFieldGet$
|
|
13155
|
+
if (endpointId && __classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
|
|
13156
13156
|
const callSites = transport_errors_1.RuntimeError.getCallSite();
|
|
13157
|
-
return __classPrivateFieldGet$
|
|
13157
|
+
return __classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
|
|
13158
13158
|
throw new channel_error_1.ChannelError(e, action, payload, callSites);
|
|
13159
13159
|
});
|
|
13160
13160
|
}
|
|
13161
13161
|
return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
|
|
13162
13162
|
}
|
|
13163
13163
|
async processConnection(senderId, payload) {
|
|
13164
|
-
__classPrivateFieldGet$
|
|
13164
|
+
__classPrivateFieldGet$8(this, _ChannelProvider_connections, "f").push(senderId);
|
|
13165
13165
|
return this.connectListener(senderId, payload);
|
|
13166
13166
|
}
|
|
13167
13167
|
/**
|
|
@@ -13184,7 +13184,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
13184
13184
|
* ```
|
|
13185
13185
|
*/
|
|
13186
13186
|
publish(action, payload) {
|
|
13187
|
-
return this.connections.map((to) => __classPrivateFieldGet$
|
|
13187
|
+
return this.connections.map((to) => __classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
|
|
13188
13188
|
}
|
|
13189
13189
|
/**
|
|
13190
13190
|
* Register a listener that is called on every new client connection.
|
|
@@ -13258,11 +13258,11 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
13258
13258
|
* ```
|
|
13259
13259
|
*/
|
|
13260
13260
|
async destroy() {
|
|
13261
|
-
const protectedObj = __classPrivateFieldGet$
|
|
13261
|
+
const protectedObj = __classPrivateFieldGet$8(this, _ChannelProvider_protectedObj, "f");
|
|
13262
13262
|
protectedObj.providerIdentity;
|
|
13263
|
-
__classPrivateFieldSet$
|
|
13263
|
+
__classPrivateFieldSet$7(this, _ChannelProvider_connections, [], "f");
|
|
13264
13264
|
await protectedObj.close();
|
|
13265
|
-
__classPrivateFieldGet$
|
|
13265
|
+
__classPrivateFieldGet$8(this, _ChannelProvider_close, "f").call(this);
|
|
13266
13266
|
}
|
|
13267
13267
|
/**
|
|
13268
13268
|
* Returns an array with info on every Client connected to the Provider
|
|
@@ -13332,7 +13332,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
13332
13332
|
getEndpointIdForOpenFinId(clientIdentity, action) {
|
|
13333
13333
|
const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
|
|
13334
13334
|
if (matchingConnections.length >= 2) {
|
|
13335
|
-
const protectedObj = __classPrivateFieldGet$
|
|
13335
|
+
const protectedObj = __classPrivateFieldGet$8(this, _ChannelProvider_protectedObj, "f");
|
|
13336
13336
|
const { uuid, name } = clientIdentity;
|
|
13337
13337
|
const providerUuid = protectedObj?.providerIdentity.uuid;
|
|
13338
13338
|
const providerName = protectedObj?.providerIdentity.name;
|
|
@@ -13544,13 +13544,13 @@ class CombinedStrategy {
|
|
|
13544
13544
|
}
|
|
13545
13545
|
strategy.default = CombinedStrategy;
|
|
13546
13546
|
|
|
13547
|
-
var __classPrivateFieldSet$
|
|
13547
|
+
var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
13548
13548
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
13549
13549
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
13550
13550
|
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");
|
|
13551
13551
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
13552
13552
|
};
|
|
13553
|
-
var __classPrivateFieldGet$
|
|
13553
|
+
var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
13554
13554
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13555
13555
|
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");
|
|
13556
13556
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -13599,8 +13599,8 @@ class ConnectionManager extends base_1$a.Base {
|
|
|
13599
13599
|
};
|
|
13600
13600
|
this.providerMap = new Map();
|
|
13601
13601
|
this.protocolManager = new protocol_manager_1.ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
|
|
13602
|
-
__classPrivateFieldSet$
|
|
13603
|
-
__classPrivateFieldSet$
|
|
13602
|
+
__classPrivateFieldSet$6(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
|
|
13603
|
+
__classPrivateFieldSet$6(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
|
|
13604
13604
|
wire.registerMessageHandler(this.onmessage.bind(this));
|
|
13605
13605
|
}
|
|
13606
13606
|
createProvider(options, providerIdentity) {
|
|
@@ -13611,7 +13611,7 @@ class ConnectionManager extends base_1$a.Base {
|
|
|
13611
13611
|
case 'rtc':
|
|
13612
13612
|
return new strategy_2.RTCStrategy();
|
|
13613
13613
|
case 'classic':
|
|
13614
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
|
13614
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$7(this, _ConnectionManager_messageReceiver, "f"),
|
|
13615
13615
|
// Providers do not have an endpointId, use channelId as endpointId in the strategy.
|
|
13616
13616
|
providerIdentity.channelId, providerIdentity);
|
|
13617
13617
|
default:
|
|
@@ -13647,7 +13647,7 @@ class ConnectionManager extends base_1$a.Base {
|
|
|
13647
13647
|
const supportedProtocols = await Promise.all(protocols.map(async (type) => {
|
|
13648
13648
|
switch (type) {
|
|
13649
13649
|
case 'rtc': {
|
|
13650
|
-
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$
|
|
13650
|
+
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$7(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
|
|
13651
13651
|
rtcPacket = { rtcClient, channels, channelsOpened };
|
|
13652
13652
|
return {
|
|
13653
13653
|
type: 'rtc',
|
|
@@ -13674,18 +13674,18 @@ class ConnectionManager extends base_1$a.Base {
|
|
|
13674
13674
|
routingInfo.endpointId = this.wire.environment.getNextMessageId();
|
|
13675
13675
|
// For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
|
|
13676
13676
|
// clients that are in the same context as the newly-connected client.
|
|
13677
|
-
__classPrivateFieldGet$
|
|
13677
|
+
__classPrivateFieldGet$7(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
|
|
13678
13678
|
}
|
|
13679
13679
|
const answer = routingInfo.answer ?? {
|
|
13680
13680
|
supportedProtocols: [{ type: 'classic', version: 1 }]
|
|
13681
13681
|
};
|
|
13682
13682
|
const createStrategyFromAnswer = async (protocol) => {
|
|
13683
13683
|
if (protocol.type === 'rtc' && rtcPacket) {
|
|
13684
|
-
await __classPrivateFieldGet$
|
|
13684
|
+
await __classPrivateFieldGet$7(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
|
|
13685
13685
|
return new strategy_2.RTCStrategy();
|
|
13686
13686
|
}
|
|
13687
13687
|
if (protocol.type === 'classic') {
|
|
13688
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
|
13688
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$7(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
|
|
13689
13689
|
}
|
|
13690
13690
|
return null;
|
|
13691
13691
|
};
|
|
@@ -13753,7 +13753,7 @@ class ConnectionManager extends base_1$a.Base {
|
|
|
13753
13753
|
clientAnswer = await overlappingProtocols.reduce(async (accumP, protocolToUse) => {
|
|
13754
13754
|
const answer = await accumP;
|
|
13755
13755
|
if (protocolToUse.type === 'rtc') {
|
|
13756
|
-
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$
|
|
13756
|
+
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$7(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
|
|
13757
13757
|
answer.supportedProtocols.push({
|
|
13758
13758
|
type: 'rtc',
|
|
13759
13759
|
version: strategy_2.RTCInfo.version,
|
|
@@ -13801,13 +13801,13 @@ _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnec
|
|
|
13801
13801
|
*
|
|
13802
13802
|
* @packageDocumentation
|
|
13803
13803
|
*/
|
|
13804
|
-
var __classPrivateFieldSet$
|
|
13804
|
+
var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
13805
13805
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
13806
13806
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
13807
13807
|
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");
|
|
13808
13808
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
13809
13809
|
};
|
|
13810
|
-
var __classPrivateFieldGet$
|
|
13810
|
+
var __classPrivateFieldGet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
13811
13811
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13812
13812
|
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");
|
|
13813
13813
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -13864,11 +13864,11 @@ class Channel extends base_1$9.EmitterBase {
|
|
|
13864
13864
|
client_1.ChannelClient.handleProviderDisconnect(eventPayload);
|
|
13865
13865
|
}),
|
|
13866
13866
|
this.on('connected', (...args) => {
|
|
13867
|
-
__classPrivateFieldGet$
|
|
13867
|
+
__classPrivateFieldGet$6(this, _Channel_internalEmitter, "f").emit('connected', ...args);
|
|
13868
13868
|
})
|
|
13869
13869
|
]).catch(() => new Error('error setting up channel connection listeners'));
|
|
13870
13870
|
}));
|
|
13871
|
-
__classPrivateFieldSet$
|
|
13871
|
+
__classPrivateFieldSet$5(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
|
|
13872
13872
|
}
|
|
13873
13873
|
/**
|
|
13874
13874
|
*
|
|
@@ -13943,7 +13943,7 @@ class Channel extends base_1$9.EmitterBase {
|
|
|
13943
13943
|
resolve(true);
|
|
13944
13944
|
}
|
|
13945
13945
|
};
|
|
13946
|
-
__classPrivateFieldGet$
|
|
13946
|
+
__classPrivateFieldGet$6(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
|
|
13947
13947
|
});
|
|
13948
13948
|
try {
|
|
13949
13949
|
if (retryInfo.count > 0) {
|
|
@@ -13975,7 +13975,7 @@ class Channel extends base_1$9.EmitterBase {
|
|
|
13975
13975
|
finally {
|
|
13976
13976
|
retryInfo.count += 1;
|
|
13977
13977
|
// in case of other errors, remove our listener
|
|
13978
|
-
__classPrivateFieldGet$
|
|
13978
|
+
__classPrivateFieldGet$6(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
|
|
13979
13979
|
}
|
|
13980
13980
|
} while (shouldWait); // If we're waiting we retry the above loop
|
|
13981
13981
|
// Should wait was false, no channel was found.
|
|
@@ -14034,12 +14034,12 @@ class Channel extends base_1$9.EmitterBase {
|
|
|
14034
14034
|
async connect(channelName, options = {}) {
|
|
14035
14035
|
// Make sure we don't connect before listeners are set up
|
|
14036
14036
|
// This also errors if we're not in OpenFin, ensuring we don't run unnecessary code
|
|
14037
|
-
await __classPrivateFieldGet$
|
|
14037
|
+
await __classPrivateFieldGet$6(this, _Channel_readyToConnect, "f").getValue();
|
|
14038
14038
|
if (!channelName || typeof channelName !== 'string') {
|
|
14039
14039
|
throw new Error('Please provide a channelName string to connect to a channel.');
|
|
14040
14040
|
}
|
|
14041
14041
|
const opts = { wait: true, ...this.wire.environment.getDefaultChannelOptions().connect, ...options };
|
|
14042
|
-
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$
|
|
14042
|
+
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$6(this, _Channel_connectionManager, "f").createClientOffer(opts);
|
|
14043
14043
|
let connectionUrl;
|
|
14044
14044
|
if (this.fin.me.isFrame || this.fin.me.isView || this.fin.me.isWindow) {
|
|
14045
14045
|
connectionUrl = (await this.fin.me.getInfo()).url;
|
|
@@ -14051,7 +14051,7 @@ class Channel extends base_1$9.EmitterBase {
|
|
|
14051
14051
|
connectionUrl
|
|
14052
14052
|
};
|
|
14053
14053
|
const routingInfo = await this.safeConnect(channelName, opts.wait, connectPayload);
|
|
14054
|
-
const strategy = await __classPrivateFieldGet$
|
|
14054
|
+
const strategy = await __classPrivateFieldGet$6(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
|
|
14055
14055
|
const channel = new client_1.ChannelClient(routingInfo, () => client_1.ChannelClient.wireClose(this.wire, routingInfo, routingInfo.endpointId), strategy);
|
|
14056
14056
|
// It is the client's responsibility to handle endpoint disconnection to the provider.
|
|
14057
14057
|
// If the endpoint dies, the client will force a disconnection through the core.
|
|
@@ -14120,7 +14120,7 @@ class Channel extends base_1$9.EmitterBase {
|
|
|
14120
14120
|
throw new Error('Please provide a channelName to create a channel');
|
|
14121
14121
|
}
|
|
14122
14122
|
const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
|
|
14123
|
-
const channel = __classPrivateFieldGet$
|
|
14123
|
+
const channel = __classPrivateFieldGet$6(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
|
|
14124
14124
|
// TODO: fix typing (internal)
|
|
14125
14125
|
// @ts-expect-error
|
|
14126
14126
|
this.on('client-disconnected', (eventPayload) => {
|
|
@@ -14356,14 +14356,32 @@ var clipboard = {};
|
|
|
14356
14356
|
*
|
|
14357
14357
|
* @packageDocumentation
|
|
14358
14358
|
*/
|
|
14359
|
+
var __classPrivateFieldGet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
14360
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
14361
|
+
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");
|
|
14362
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
14363
|
+
};
|
|
14364
|
+
var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
14365
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
14366
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
14367
|
+
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");
|
|
14368
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
14369
|
+
};
|
|
14370
|
+
var _Clipboard_instances, _Clipboard_securedApiWarningCount, _Clipboard_warnSecuredApi;
|
|
14359
14371
|
Object.defineProperty(clipboard, "__esModule", { value: true });
|
|
14360
14372
|
clipboard.Clipboard = void 0;
|
|
14361
14373
|
const base_1$7 = base;
|
|
14374
|
+
const maxSecuredApiWarnings = 10;
|
|
14362
14375
|
/**
|
|
14363
14376
|
* The Clipboard API allows reading and writing to the clipboard in multiple formats.
|
|
14364
14377
|
*
|
|
14365
14378
|
*/
|
|
14366
14379
|
class Clipboard extends base_1$7.Base {
|
|
14380
|
+
constructor() {
|
|
14381
|
+
super(...arguments);
|
|
14382
|
+
_Clipboard_instances.add(this);
|
|
14383
|
+
_Clipboard_securedApiWarningCount.set(this, 0);
|
|
14384
|
+
}
|
|
14367
14385
|
/**
|
|
14368
14386
|
* Writes data into the clipboard as plain text
|
|
14369
14387
|
* @param writeObj The object for writing data into the clipboard
|
|
@@ -14376,6 +14394,7 @@ class Clipboard extends base_1$7.Base {
|
|
|
14376
14394
|
* ```
|
|
14377
14395
|
*/
|
|
14378
14396
|
async writeText(writeObj) {
|
|
14397
|
+
__classPrivateFieldGet$5(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeText');
|
|
14379
14398
|
await this.wire.sendAction('clipboard-write-text', writeObj);
|
|
14380
14399
|
}
|
|
14381
14400
|
/**
|
|
@@ -14388,6 +14407,7 @@ class Clipboard extends base_1$7.Base {
|
|
|
14388
14407
|
* ```
|
|
14389
14408
|
*/
|
|
14390
14409
|
async readText(type) {
|
|
14410
|
+
__classPrivateFieldGet$5(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readText');
|
|
14391
14411
|
// NOTE: When we start supporting linux, we could detect the OS and choose 'selection' automatically for the user
|
|
14392
14412
|
const { payload } = await this.wire.sendAction('clipboard-read-text', { type });
|
|
14393
14413
|
return payload.data;
|
|
@@ -14405,6 +14425,7 @@ class Clipboard extends base_1$7.Base {
|
|
|
14405
14425
|
* ```
|
|
14406
14426
|
*/
|
|
14407
14427
|
async writeImage(writeRequest) {
|
|
14428
|
+
__classPrivateFieldGet$5(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeImage');
|
|
14408
14429
|
await this.wire.sendAction('clipboard-write-image', writeRequest);
|
|
14409
14430
|
}
|
|
14410
14431
|
/**
|
|
@@ -14440,6 +14461,7 @@ class Clipboard extends base_1$7.Base {
|
|
|
14440
14461
|
* ```
|
|
14441
14462
|
*/
|
|
14442
14463
|
async readImage(readRequest = { format: 'dataURL' }) {
|
|
14464
|
+
__classPrivateFieldGet$5(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readImage');
|
|
14443
14465
|
const { payload } = await this.wire.sendAction('clipboard-read-image', readRequest);
|
|
14444
14466
|
return payload.data;
|
|
14445
14467
|
}
|
|
@@ -14455,6 +14477,7 @@ class Clipboard extends base_1$7.Base {
|
|
|
14455
14477
|
* ```
|
|
14456
14478
|
*/
|
|
14457
14479
|
async writeHtml(writeObj) {
|
|
14480
|
+
__classPrivateFieldGet$5(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeHtml');
|
|
14458
14481
|
await this.wire.sendAction('clipboard-write-html', writeObj);
|
|
14459
14482
|
}
|
|
14460
14483
|
/**
|
|
@@ -14467,6 +14490,7 @@ class Clipboard extends base_1$7.Base {
|
|
|
14467
14490
|
* ```
|
|
14468
14491
|
*/
|
|
14469
14492
|
async readHtml(type) {
|
|
14493
|
+
__classPrivateFieldGet$5(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readHtml');
|
|
14470
14494
|
const { payload } = await this.wire.sendAction('clipboard-read-html', { type });
|
|
14471
14495
|
return payload.data;
|
|
14472
14496
|
}
|
|
@@ -14482,6 +14506,7 @@ class Clipboard extends base_1$7.Base {
|
|
|
14482
14506
|
* ```
|
|
14483
14507
|
*/
|
|
14484
14508
|
async writeRtf(writeObj) {
|
|
14509
|
+
__classPrivateFieldGet$5(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeRtf');
|
|
14485
14510
|
await this.wire.sendAction('clipboard-write-rtf', writeObj);
|
|
14486
14511
|
}
|
|
14487
14512
|
/**
|
|
@@ -14502,6 +14527,7 @@ class Clipboard extends base_1$7.Base {
|
|
|
14502
14527
|
* ```
|
|
14503
14528
|
*/
|
|
14504
14529
|
async readRtf(type) {
|
|
14530
|
+
__classPrivateFieldGet$5(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readRtf');
|
|
14505
14531
|
const { payload } = await this.wire.sendAction('clipboard-read-rtf', { type });
|
|
14506
14532
|
return payload.data;
|
|
14507
14533
|
}
|
|
@@ -14525,6 +14551,7 @@ class Clipboard extends base_1$7.Base {
|
|
|
14525
14551
|
* ```
|
|
14526
14552
|
*/
|
|
14527
14553
|
async write(writeObj) {
|
|
14554
|
+
__classPrivateFieldGet$5(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.write');
|
|
14528
14555
|
await this.wire.sendAction('clipboard-write', writeObj);
|
|
14529
14556
|
}
|
|
14530
14557
|
/**
|
|
@@ -14542,6 +14569,12 @@ class Clipboard extends base_1$7.Base {
|
|
|
14542
14569
|
}
|
|
14543
14570
|
}
|
|
14544
14571
|
clipboard.Clipboard = Clipboard;
|
|
14572
|
+
_Clipboard_securedApiWarningCount = new WeakMap(), _Clipboard_instances = new WeakSet(), _Clipboard_warnSecuredApi = async function _Clipboard_warnSecuredApi(apiName) {
|
|
14573
|
+
if (__classPrivateFieldGet$5(this, _Clipboard_securedApiWarningCount, "f") <= maxSecuredApiWarnings) {
|
|
14574
|
+
console.warn(`Clipboard APIs will be secure-by-default starting in v42. To continue using this API without interruption, make sure to grant explicit API permissions for ${apiName} in the Desktop Owner Settings, and in the Application, Window, View, or Domain Settings. For more information, see https://resources.here.io/docs/core/develop/security/api-security/`);
|
|
14575
|
+
__classPrivateFieldSet$4(this, _Clipboard_securedApiWarningCount, __classPrivateFieldGet$5(this, _Clipboard_securedApiWarningCount, "f") + 1, "f");
|
|
14576
|
+
}
|
|
14577
|
+
};
|
|
14545
14578
|
|
|
14546
14579
|
var globalHotkey = {};
|
|
14547
14580
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfin/remote-adapter",
|
|
3
|
-
"version": "40.104.
|
|
3
|
+
"version": "40.104.4",
|
|
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": "40.104.
|
|
23
|
+
"@openfin/core": "40.104.4"
|
|
24
24
|
}
|
|
25
25
|
}
|