@openfin/core 44.100.61 → 45.100.18
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/mock-alpha.d.ts +113 -12
- package/out/mock-beta.d.ts +113 -12
- package/out/mock-public.d.ts +113 -12
- package/out/stub.d.ts +113 -12
- package/out/stub.js +362 -175
- package/package.json +4 -4
package/out/stub.js
CHANGED
|
@@ -316,7 +316,10 @@ events.WindowEvents = WindowEvents;
|
|
|
316
316
|
};
|
|
317
317
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
318
318
|
// Deprecated shim to preserve v30 namespace names
|
|
319
|
-
__exportStar(events, exports);
|
|
319
|
+
__exportStar(events, exports);
|
|
320
|
+
/**
|
|
321
|
+
* End of Interop Client Events
|
|
322
|
+
*/
|
|
320
323
|
} (OpenFin$2));
|
|
321
324
|
|
|
322
325
|
var OpenFin = /*@__PURE__*/getDefaultExportFromCjs(OpenFin$2);
|
|
@@ -332,13 +335,13 @@ var system = {};
|
|
|
332
335
|
|
|
333
336
|
var base = {};
|
|
334
337
|
|
|
335
|
-
var __classPrivateFieldSet$
|
|
338
|
+
var __classPrivateFieldSet$i = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
336
339
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
337
340
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
338
341
|
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");
|
|
339
342
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
340
343
|
};
|
|
341
|
-
var __classPrivateFieldGet$
|
|
344
|
+
var __classPrivateFieldGet$j = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
342
345
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
343
346
|
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");
|
|
344
347
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -422,9 +425,9 @@ class EmitterBase extends Base {
|
|
|
422
425
|
this.emit = (eventType, payload, ...args) => {
|
|
423
426
|
return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
|
|
424
427
|
};
|
|
425
|
-
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$
|
|
428
|
+
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$j(this, _EmitterBase_emitterAccessor, "f"));
|
|
426
429
|
this.getOrCreateEmitter = () => {
|
|
427
|
-
return this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$
|
|
430
|
+
return this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$j(this, _EmitterBase_emitterAccessor, "f"));
|
|
428
431
|
};
|
|
429
432
|
this.listeners = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(type) : [];
|
|
430
433
|
this.listenerCount = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listenerCount(type) : 0;
|
|
@@ -462,8 +465,8 @@ class EmitterBase extends Base {
|
|
|
462
465
|
// This will only be reached if unsubscribe from event that does not exist but do not want to error here
|
|
463
466
|
return Promise.resolve();
|
|
464
467
|
};
|
|
465
|
-
__classPrivateFieldSet$
|
|
466
|
-
__classPrivateFieldSet$
|
|
468
|
+
__classPrivateFieldSet$i(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
|
|
469
|
+
__classPrivateFieldSet$i(this, _EmitterBase_deregisterOnceListeners, new WeakMap(), "f");
|
|
467
470
|
}
|
|
468
471
|
/**
|
|
469
472
|
* Adds a listener to the end of the listeners array for the specified event.
|
|
@@ -491,7 +494,7 @@ class EmitterBase extends Base {
|
|
|
491
494
|
*/
|
|
492
495
|
async once(eventType, listener, options) {
|
|
493
496
|
const deregister = () => this.deregisterEventListener(eventType);
|
|
494
|
-
__classPrivateFieldGet$
|
|
497
|
+
__classPrivateFieldGet$j(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
|
|
495
498
|
await this.registerEventListener(eventType, options, (emitter) => {
|
|
496
499
|
emitter.once(eventType, deregister);
|
|
497
500
|
emitter.once(eventType, listener);
|
|
@@ -522,7 +525,7 @@ class EmitterBase extends Base {
|
|
|
522
525
|
*/
|
|
523
526
|
async prependOnceListener(eventType, listener, options) {
|
|
524
527
|
const deregister = () => this.deregisterEventListener(eventType);
|
|
525
|
-
__classPrivateFieldGet$
|
|
528
|
+
__classPrivateFieldGet$j(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
|
|
526
529
|
await this.registerEventListener(eventType, options, (emitter) => {
|
|
527
530
|
emitter.prependOnceListener(eventType, listener);
|
|
528
531
|
emitter.once(eventType, deregister);
|
|
@@ -541,7 +544,7 @@ class EmitterBase extends Base {
|
|
|
541
544
|
const emitter = await this.deregisterEventListener(eventType, options);
|
|
542
545
|
if (emitter) {
|
|
543
546
|
emitter.removeListener(eventType, listener);
|
|
544
|
-
const deregister = __classPrivateFieldGet$
|
|
547
|
+
const deregister = __classPrivateFieldGet$j(this, _EmitterBase_deregisterOnceListeners, "f").get(listener);
|
|
545
548
|
if (deregister) {
|
|
546
549
|
emitter.removeListener(eventType, deregister);
|
|
547
550
|
}
|
|
@@ -587,7 +590,7 @@ class EmitterBase extends Base {
|
|
|
587
590
|
deleteEmitterIfNothingRegistered(emitter) {
|
|
588
591
|
// TODO: maybe emitterMap should clean up itself..
|
|
589
592
|
if (emitter.eventNames().length === 0) {
|
|
590
|
-
this.wire.eventAggregator.delete(__classPrivateFieldGet$
|
|
593
|
+
this.wire.eventAggregator.delete(__classPrivateFieldGet$j(this, _EmitterBase_emitterAccessor, "f"));
|
|
591
594
|
}
|
|
592
595
|
}
|
|
593
596
|
}
|
|
@@ -5811,6 +5814,11 @@ class System extends base_1$m.EmitterBase {
|
|
|
5811
5814
|
/**
|
|
5812
5815
|
* Returns a unique identifier (UUID) provided by the machine.
|
|
5813
5816
|
*
|
|
5817
|
+
* On Windows, the machine ID is the `MachineGuid` value located in the Windows Registry at:
|
|
5818
|
+
* `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`.
|
|
5819
|
+
*
|
|
5820
|
+
* On macOS, the machine ID is the hardware UUID of the machine, obtained via native OS APIs.
|
|
5821
|
+
*
|
|
5814
5822
|
* @example
|
|
5815
5823
|
* ```js
|
|
5816
5824
|
* fin.System.getMachineId().then(id => console.log(id)).catch(err => console.log(err));
|
|
@@ -7899,12 +7907,12 @@ class ChannelError extends Error {
|
|
|
7899
7907
|
}
|
|
7900
7908
|
channelError.ChannelError = ChannelError;
|
|
7901
7909
|
|
|
7902
|
-
var __classPrivateFieldGet$
|
|
7910
|
+
var __classPrivateFieldGet$i = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7903
7911
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7904
7912
|
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");
|
|
7905
7913
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
7906
7914
|
};
|
|
7907
|
-
var __classPrivateFieldSet$
|
|
7915
|
+
var __classPrivateFieldSet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7908
7916
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
7909
7917
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
7910
7918
|
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");
|
|
@@ -7948,7 +7956,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
7948
7956
|
static closeChannelByEndpointId(id) {
|
|
7949
7957
|
const channel = channelClientsByEndpointId.get(id);
|
|
7950
7958
|
if (channel) {
|
|
7951
|
-
__classPrivateFieldGet$
|
|
7959
|
+
__classPrivateFieldGet$i(channel, _ChannelClient_close, "f").call(channel);
|
|
7952
7960
|
}
|
|
7953
7961
|
}
|
|
7954
7962
|
/**
|
|
@@ -7959,7 +7967,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
7959
7967
|
for (const channelClient of channelClientsByEndpointId.values()) {
|
|
7960
7968
|
if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
|
|
7961
7969
|
channelClient.disconnectListener(eventPayload);
|
|
7962
|
-
__classPrivateFieldGet$
|
|
7970
|
+
__classPrivateFieldGet$i(channelClient, _ChannelClient_close, "f").call(channelClient);
|
|
7963
7971
|
}
|
|
7964
7972
|
}
|
|
7965
7973
|
}
|
|
@@ -7974,12 +7982,12 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
7974
7982
|
this.processAction = (action, payload, senderIdentity) => super.processAction(action, payload, senderIdentity);
|
|
7975
7983
|
_ChannelClient_close.set(this, () => {
|
|
7976
7984
|
channelClientsByEndpointId.delete(this.endpointId);
|
|
7977
|
-
__classPrivateFieldGet$
|
|
7985
|
+
__classPrivateFieldGet$i(this, _ChannelClient_strategy, "f").close();
|
|
7978
7986
|
});
|
|
7979
|
-
__classPrivateFieldSet$
|
|
7987
|
+
__classPrivateFieldSet$h(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
|
|
7980
7988
|
this.disconnectListener = () => undefined;
|
|
7981
7989
|
this.endpointId = routingInfo.endpointId;
|
|
7982
|
-
__classPrivateFieldSet$
|
|
7990
|
+
__classPrivateFieldSet$h(this, _ChannelClient_strategy, strategy, "f");
|
|
7983
7991
|
channelClientsByEndpointId.set(this.endpointId, this);
|
|
7984
7992
|
strategy.receive(this.processAction);
|
|
7985
7993
|
}
|
|
@@ -7987,7 +7995,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
7987
7995
|
* a read-only provider identity
|
|
7988
7996
|
*/
|
|
7989
7997
|
get providerIdentity() {
|
|
7990
|
-
const protectedObj = __classPrivateFieldGet$
|
|
7998
|
+
const protectedObj = __classPrivateFieldGet$i(this, _ChannelClient_protectedObj, "f");
|
|
7991
7999
|
return protectedObj.providerIdentity;
|
|
7992
8000
|
}
|
|
7993
8001
|
/**
|
|
@@ -8016,9 +8024,9 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
8016
8024
|
* ```
|
|
8017
8025
|
*/
|
|
8018
8026
|
async dispatch(action, payload) {
|
|
8019
|
-
if (__classPrivateFieldGet$
|
|
8027
|
+
if (__classPrivateFieldGet$i(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
|
|
8020
8028
|
const callSites = transport_errors_1$2.RuntimeError.getCallSite();
|
|
8021
|
-
return __classPrivateFieldGet$
|
|
8029
|
+
return __classPrivateFieldGet$i(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
|
|
8022
8030
|
throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
|
|
8023
8031
|
});
|
|
8024
8032
|
}
|
|
@@ -8070,10 +8078,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
8070
8078
|
*/
|
|
8071
8079
|
async disconnect() {
|
|
8072
8080
|
await this.sendDisconnectAction();
|
|
8073
|
-
__classPrivateFieldGet$
|
|
8081
|
+
__classPrivateFieldGet$i(this, _ChannelClient_close, "f").call(this);
|
|
8074
8082
|
}
|
|
8075
8083
|
async sendDisconnectAction() {
|
|
8076
|
-
const protectedObj = __classPrivateFieldGet$
|
|
8084
|
+
const protectedObj = __classPrivateFieldGet$i(this, _ChannelClient_protectedObj, "f");
|
|
8077
8085
|
await protectedObj.close();
|
|
8078
8086
|
}
|
|
8079
8087
|
/**
|
|
@@ -8106,13 +8114,13 @@ exhaustive.exhaustiveCheck = exhaustiveCheck;
|
|
|
8106
8114
|
|
|
8107
8115
|
var strategy$3 = {};
|
|
8108
8116
|
|
|
8109
|
-
var __classPrivateFieldSet$
|
|
8117
|
+
var __classPrivateFieldSet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8110
8118
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8111
8119
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
8112
8120
|
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");
|
|
8113
8121
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
8114
8122
|
};
|
|
8115
|
-
var __classPrivateFieldGet$
|
|
8123
|
+
var __classPrivateFieldGet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8116
8124
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
8117
8125
|
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");
|
|
8118
8126
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -8137,7 +8145,7 @@ class ClassicStrategy {
|
|
|
8137
8145
|
// connection problems occur
|
|
8138
8146
|
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
|
|
8139
8147
|
this.send = async (endpointId, action, payload) => {
|
|
8140
|
-
const to = __classPrivateFieldGet$
|
|
8148
|
+
const to = __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
8141
8149
|
if (!to) {
|
|
8142
8150
|
throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
|
|
8143
8151
|
}
|
|
@@ -8149,13 +8157,13 @@ class ClassicStrategy {
|
|
|
8149
8157
|
}
|
|
8150
8158
|
delete cleanId.isLocalEndpointId;
|
|
8151
8159
|
// grab the promise before awaiting it to save in our pending messages map
|
|
8152
|
-
const p = __classPrivateFieldGet$
|
|
8160
|
+
const p = __classPrivateFieldGet$h(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
|
|
8153
8161
|
...cleanId,
|
|
8154
8162
|
providerIdentity: this.providerIdentity,
|
|
8155
8163
|
action,
|
|
8156
8164
|
payload
|
|
8157
8165
|
});
|
|
8158
|
-
__classPrivateFieldGet$
|
|
8166
|
+
__classPrivateFieldGet$h(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
|
|
8159
8167
|
const raw = await p
|
|
8160
8168
|
.catch((error) => {
|
|
8161
8169
|
if ('cause' in error) {
|
|
@@ -8165,16 +8173,16 @@ class ClassicStrategy {
|
|
|
8165
8173
|
})
|
|
8166
8174
|
.finally(() => {
|
|
8167
8175
|
// clean up the pending promise
|
|
8168
|
-
__classPrivateFieldGet$
|
|
8176
|
+
__classPrivateFieldGet$h(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
|
|
8169
8177
|
});
|
|
8170
8178
|
return raw.payload.data.result;
|
|
8171
8179
|
};
|
|
8172
8180
|
this.close = async () => {
|
|
8173
8181
|
this.messageReceiver.removeEndpoint(this.providerIdentity.channelId, this.endpointId);
|
|
8174
|
-
[...__classPrivateFieldGet$
|
|
8175
|
-
__classPrivateFieldSet$
|
|
8182
|
+
[...__classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
|
|
8183
|
+
__classPrivateFieldSet$g(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
|
|
8176
8184
|
};
|
|
8177
|
-
__classPrivateFieldSet$
|
|
8185
|
+
__classPrivateFieldSet$g(this, _ClassicStrategy_wire, wire, "f");
|
|
8178
8186
|
}
|
|
8179
8187
|
onEndpointDisconnect(endpointId, listener) {
|
|
8180
8188
|
// Never fires for 'classic'.
|
|
@@ -8183,20 +8191,20 @@ class ClassicStrategy {
|
|
|
8183
8191
|
this.messageReceiver.addEndpoint(listener, this.providerIdentity.channelId, this.endpointId);
|
|
8184
8192
|
}
|
|
8185
8193
|
async closeEndpoint(endpointId) {
|
|
8186
|
-
const id = __classPrivateFieldGet$
|
|
8187
|
-
__classPrivateFieldGet$
|
|
8188
|
-
const pendingSet = __classPrivateFieldGet$
|
|
8194
|
+
const id = __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
8195
|
+
__classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
|
|
8196
|
+
const pendingSet = __classPrivateFieldGet$h(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
|
|
8189
8197
|
pendingSet?.forEach((p) => {
|
|
8190
8198
|
const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
|
|
8191
8199
|
p.cancel(new Error(errorMsg));
|
|
8192
8200
|
});
|
|
8193
8201
|
}
|
|
8194
8202
|
isEndpointConnected(endpointId) {
|
|
8195
|
-
return __classPrivateFieldGet$
|
|
8203
|
+
return __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
|
|
8196
8204
|
}
|
|
8197
8205
|
addEndpoint(endpointId, payload) {
|
|
8198
|
-
__classPrivateFieldGet$
|
|
8199
|
-
__classPrivateFieldGet$
|
|
8206
|
+
__classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
|
|
8207
|
+
__classPrivateFieldGet$h(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
|
|
8200
8208
|
}
|
|
8201
8209
|
isValidEndpointPayload(payload) {
|
|
8202
8210
|
return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
|
|
@@ -8231,12 +8239,12 @@ function errorToPOJO(error) {
|
|
|
8231
8239
|
}
|
|
8232
8240
|
errors.errorToPOJO = errorToPOJO;
|
|
8233
8241
|
|
|
8234
|
-
var __classPrivateFieldGet$
|
|
8242
|
+
var __classPrivateFieldGet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8235
8243
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
8236
8244
|
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");
|
|
8237
8245
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
8238
8246
|
};
|
|
8239
|
-
var __classPrivateFieldSet$
|
|
8247
|
+
var __classPrivateFieldSet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8240
8248
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8241
8249
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
8242
8250
|
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");
|
|
@@ -8271,8 +8279,8 @@ class RTCEndpoint {
|
|
|
8271
8279
|
if (this.rtc.rtcClient.connectionState !== 'connected') {
|
|
8272
8280
|
this.rtc.rtcClient.removeEventListener('connectionstatechange', this.connectionStateChangeHandler);
|
|
8273
8281
|
this.close();
|
|
8274
|
-
if (__classPrivateFieldGet$
|
|
8275
|
-
__classPrivateFieldGet$
|
|
8282
|
+
if (__classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
8283
|
+
__classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
|
8276
8284
|
}
|
|
8277
8285
|
}
|
|
8278
8286
|
};
|
|
@@ -8320,9 +8328,9 @@ class RTCEndpoint {
|
|
|
8320
8328
|
data = new TextDecoder().decode(e.data);
|
|
8321
8329
|
}
|
|
8322
8330
|
const { messageId, action, payload } = JSON.parse(data);
|
|
8323
|
-
if (__classPrivateFieldGet$
|
|
8331
|
+
if (__classPrivateFieldGet$g(this, _RTCEndpoint_processAction, "f")) {
|
|
8324
8332
|
try {
|
|
8325
|
-
const res = await __classPrivateFieldGet$
|
|
8333
|
+
const res = await __classPrivateFieldGet$g(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
|
|
8326
8334
|
this.rtc.channels.response.send(JSON.stringify({
|
|
8327
8335
|
messageId,
|
|
8328
8336
|
payload: res,
|
|
@@ -8356,25 +8364,25 @@ class RTCEndpoint {
|
|
|
8356
8364
|
datachannel.onclose = (e) => {
|
|
8357
8365
|
[...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.')));
|
|
8358
8366
|
this.close();
|
|
8359
|
-
if (__classPrivateFieldGet$
|
|
8360
|
-
__classPrivateFieldGet$
|
|
8367
|
+
if (__classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
8368
|
+
__classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
|
8361
8369
|
}
|
|
8362
8370
|
};
|
|
8363
8371
|
});
|
|
8364
8372
|
}
|
|
8365
8373
|
onDisconnect(listener) {
|
|
8366
|
-
if (!__classPrivateFieldGet$
|
|
8367
|
-
__classPrivateFieldSet$
|
|
8374
|
+
if (!__classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
8375
|
+
__classPrivateFieldSet$f(this, _RTCEndpoint_disconnectListener, listener, "f");
|
|
8368
8376
|
}
|
|
8369
8377
|
else {
|
|
8370
8378
|
throw new Error('RTCEndpoint disconnectListener cannot be set twice.');
|
|
8371
8379
|
}
|
|
8372
8380
|
}
|
|
8373
8381
|
receive(listener) {
|
|
8374
|
-
if (__classPrivateFieldGet$
|
|
8382
|
+
if (__classPrivateFieldGet$g(this, _RTCEndpoint_processAction, "f")) {
|
|
8375
8383
|
throw new Error('You have already set a listener for this RTC Endpoint.');
|
|
8376
8384
|
}
|
|
8377
|
-
__classPrivateFieldSet$
|
|
8385
|
+
__classPrivateFieldSet$f(this, _RTCEndpoint_processAction, listener, "f");
|
|
8378
8386
|
}
|
|
8379
8387
|
get connected() {
|
|
8380
8388
|
return this.rtc.rtcClient.connectionState === 'connected';
|
|
@@ -8385,12 +8393,12 @@ _RTCEndpoint_processAction = new WeakMap(), _RTCEndpoint_disconnectListener = ne
|
|
|
8385
8393
|
|
|
8386
8394
|
var strategy$1 = {};
|
|
8387
8395
|
|
|
8388
|
-
var __classPrivateFieldGet$
|
|
8396
|
+
var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8389
8397
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
8390
8398
|
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");
|
|
8391
8399
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
8392
8400
|
};
|
|
8393
|
-
var __classPrivateFieldSet$
|
|
8401
|
+
var __classPrivateFieldSet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8394
8402
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8395
8403
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
8396
8404
|
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");
|
|
@@ -8411,11 +8419,11 @@ class EndpointStrategy {
|
|
|
8411
8419
|
return this.getEndpointById(endpointId).send(action, payload);
|
|
8412
8420
|
};
|
|
8413
8421
|
this.close = async () => {
|
|
8414
|
-
if (__classPrivateFieldGet$
|
|
8415
|
-
__classPrivateFieldGet$
|
|
8416
|
-
__classPrivateFieldSet$
|
|
8422
|
+
if (__classPrivateFieldGet$f(this, _EndpointStrategy_connected, "f")) {
|
|
8423
|
+
__classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
|
|
8424
|
+
__classPrivateFieldSet$e(this, _EndpointStrategy_endpointMap, new Map(), "f");
|
|
8417
8425
|
}
|
|
8418
|
-
__classPrivateFieldSet$
|
|
8426
|
+
__classPrivateFieldSet$e(this, _EndpointStrategy_connected, false, "f");
|
|
8419
8427
|
};
|
|
8420
8428
|
this.isValidEndpointPayload = validateEndpoint;
|
|
8421
8429
|
}
|
|
@@ -8423,39 +8431,39 @@ class EndpointStrategy {
|
|
|
8423
8431
|
this.getEndpointById(endpointId).onDisconnect(listener);
|
|
8424
8432
|
}
|
|
8425
8433
|
receive(listener) {
|
|
8426
|
-
if (__classPrivateFieldGet$
|
|
8434
|
+
if (__classPrivateFieldGet$f(this, _EndpointStrategy_processAction, "f")) {
|
|
8427
8435
|
throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);
|
|
8428
8436
|
}
|
|
8429
|
-
__classPrivateFieldSet$
|
|
8437
|
+
__classPrivateFieldSet$e(this, _EndpointStrategy_processAction, listener, "f");
|
|
8430
8438
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
8431
|
-
__classPrivateFieldGet$
|
|
8439
|
+
__classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$f(this, _EndpointStrategy_processAction, "f")));
|
|
8432
8440
|
}
|
|
8433
8441
|
getEndpointById(endpointId) {
|
|
8434
|
-
const endpoint = __classPrivateFieldGet$
|
|
8442
|
+
const endpoint = __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
|
|
8435
8443
|
if (!endpoint) {
|
|
8436
8444
|
throw new Error(`Client with endpoint id ${endpointId} is not connected`);
|
|
8437
8445
|
}
|
|
8438
8446
|
return endpoint;
|
|
8439
8447
|
}
|
|
8440
8448
|
get connected() {
|
|
8441
|
-
return __classPrivateFieldGet$
|
|
8449
|
+
return __classPrivateFieldGet$f(this, _EndpointStrategy_connected, "f");
|
|
8442
8450
|
}
|
|
8443
8451
|
isEndpointConnected(endpointId) {
|
|
8444
|
-
return __classPrivateFieldGet$
|
|
8452
|
+
return __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
|
|
8445
8453
|
}
|
|
8446
8454
|
addEndpoint(endpointId, payload) {
|
|
8447
|
-
if (!__classPrivateFieldGet$
|
|
8455
|
+
if (!__classPrivateFieldGet$f(this, _EndpointStrategy_connected, "f")) {
|
|
8448
8456
|
console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);
|
|
8449
8457
|
return;
|
|
8450
8458
|
}
|
|
8451
8459
|
const clientStrat = new this.EndpointType(payload);
|
|
8452
|
-
if (__classPrivateFieldGet$
|
|
8453
|
-
clientStrat.receive(__classPrivateFieldGet$
|
|
8460
|
+
if (__classPrivateFieldGet$f(this, _EndpointStrategy_processAction, "f")) {
|
|
8461
|
+
clientStrat.receive(__classPrivateFieldGet$f(this, _EndpointStrategy_processAction, "f"));
|
|
8454
8462
|
}
|
|
8455
|
-
__classPrivateFieldGet$
|
|
8463
|
+
__classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
|
|
8456
8464
|
}
|
|
8457
8465
|
async closeEndpoint(endpointId) {
|
|
8458
|
-
__classPrivateFieldGet$
|
|
8466
|
+
__classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
|
|
8459
8467
|
}
|
|
8460
8468
|
}
|
|
8461
8469
|
strategy$1.EndpointStrategy = EndpointStrategy;
|
|
@@ -8637,12 +8645,12 @@ function runtimeUuidMeetsMinimumRuntimeVersion(runtimeUuid, minVersion) {
|
|
|
8637
8645
|
}
|
|
8638
8646
|
runtimeVersioning.runtimeUuidMeetsMinimumRuntimeVersion = runtimeUuidMeetsMinimumRuntimeVersion;
|
|
8639
8647
|
|
|
8640
|
-
var __classPrivateFieldGet$
|
|
8648
|
+
var __classPrivateFieldGet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8641
8649
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
8642
8650
|
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");
|
|
8643
8651
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
8644
8652
|
};
|
|
8645
|
-
var __classPrivateFieldSet$
|
|
8653
|
+
var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8646
8654
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8647
8655
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
8648
8656
|
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");
|
|
@@ -8686,19 +8694,19 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8686
8694
|
* a read-only array containing all the identities of connecting clients.
|
|
8687
8695
|
*/
|
|
8688
8696
|
get connections() {
|
|
8689
|
-
return [...__classPrivateFieldGet$
|
|
8697
|
+
return [...__classPrivateFieldGet$e(this, _ChannelProvider_connections, "f")];
|
|
8690
8698
|
}
|
|
8691
8699
|
static handleClientDisconnection(channel, payload) {
|
|
8692
8700
|
if (payload?.endpointId) {
|
|
8693
8701
|
const { uuid, name, endpointId, isLocalEndpointId } = payload;
|
|
8694
|
-
__classPrivateFieldGet$
|
|
8702
|
+
__classPrivateFieldGet$e(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
|
|
8695
8703
|
}
|
|
8696
8704
|
else {
|
|
8697
8705
|
// this is here to support older runtimes that did not have endpointId
|
|
8698
8706
|
const multipleRemoves = channel.connections.filter((identity) => {
|
|
8699
8707
|
return identity.uuid === payload.uuid && identity.name === payload.name;
|
|
8700
8708
|
});
|
|
8701
|
-
multipleRemoves.forEach(__classPrivateFieldGet$
|
|
8709
|
+
multipleRemoves.forEach(__classPrivateFieldGet$e(channel, _ChannelProvider_removeEndpoint, "f"));
|
|
8702
8710
|
}
|
|
8703
8711
|
channel.disconnectListener(payload);
|
|
8704
8712
|
}
|
|
@@ -8715,8 +8723,8 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8715
8723
|
_ChannelProvider_strategy.set(this, void 0);
|
|
8716
8724
|
_ChannelProvider_removeEndpoint.set(this, (identity) => {
|
|
8717
8725
|
const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
|
|
8718
|
-
__classPrivateFieldGet$
|
|
8719
|
-
__classPrivateFieldSet$
|
|
8726
|
+
__classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
|
|
8727
|
+
__classPrivateFieldSet$d(this, _ChannelProvider_connections, remainingConnections, "f");
|
|
8720
8728
|
});
|
|
8721
8729
|
// Must be bound.
|
|
8722
8730
|
this.processAction = async (action, payload, senderIdentity) => {
|
|
@@ -8730,17 +8738,17 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8730
8738
|
return super.processAction(action, payload, senderIdentity);
|
|
8731
8739
|
};
|
|
8732
8740
|
_ChannelProvider_close.set(this, () => {
|
|
8733
|
-
__classPrivateFieldGet$
|
|
8741
|
+
__classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").close();
|
|
8734
8742
|
const remove = ChannelProvider.removalMap.get(this);
|
|
8735
8743
|
if (remove) {
|
|
8736
8744
|
remove();
|
|
8737
8745
|
}
|
|
8738
8746
|
});
|
|
8739
|
-
__classPrivateFieldSet$
|
|
8747
|
+
__classPrivateFieldSet$d(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
|
|
8740
8748
|
this.connectListener = () => undefined;
|
|
8741
8749
|
this.disconnectListener = () => undefined;
|
|
8742
|
-
__classPrivateFieldSet$
|
|
8743
|
-
__classPrivateFieldSet$
|
|
8750
|
+
__classPrivateFieldSet$d(this, _ChannelProvider_connections, [], "f");
|
|
8751
|
+
__classPrivateFieldSet$d(this, _ChannelProvider_strategy, strategy, "f");
|
|
8744
8752
|
strategy.receive(this.processAction);
|
|
8745
8753
|
}
|
|
8746
8754
|
/**
|
|
@@ -8771,16 +8779,16 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8771
8779
|
*/
|
|
8772
8780
|
dispatch(to, action, payload) {
|
|
8773
8781
|
const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
|
|
8774
|
-
if (endpointId && __classPrivateFieldGet$
|
|
8782
|
+
if (endpointId && __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
|
|
8775
8783
|
const callSites = transport_errors_1$1.RuntimeError.getCallSite();
|
|
8776
|
-
return __classPrivateFieldGet$
|
|
8784
|
+
return __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
|
|
8777
8785
|
throw new channel_error_1.ChannelError(e, action, payload, callSites);
|
|
8778
8786
|
});
|
|
8779
8787
|
}
|
|
8780
8788
|
return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
|
|
8781
8789
|
}
|
|
8782
8790
|
async processConnection(senderId, payload) {
|
|
8783
|
-
__classPrivateFieldGet$
|
|
8791
|
+
__classPrivateFieldGet$e(this, _ChannelProvider_connections, "f").push(senderId);
|
|
8784
8792
|
return this.connectListener(senderId, payload);
|
|
8785
8793
|
}
|
|
8786
8794
|
/**
|
|
@@ -8803,7 +8811,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8803
8811
|
* ```
|
|
8804
8812
|
*/
|
|
8805
8813
|
publish(action, payload) {
|
|
8806
|
-
return this.connections.map((to) => __classPrivateFieldGet$
|
|
8814
|
+
return this.connections.map((to) => __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
|
|
8807
8815
|
}
|
|
8808
8816
|
/**
|
|
8809
8817
|
* Register a listener that is called on every new client connection.
|
|
@@ -8877,11 +8885,11 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8877
8885
|
* ```
|
|
8878
8886
|
*/
|
|
8879
8887
|
async destroy() {
|
|
8880
|
-
const protectedObj = __classPrivateFieldGet$
|
|
8888
|
+
const protectedObj = __classPrivateFieldGet$e(this, _ChannelProvider_protectedObj, "f");
|
|
8881
8889
|
protectedObj.providerIdentity;
|
|
8882
|
-
__classPrivateFieldSet$
|
|
8890
|
+
__classPrivateFieldSet$d(this, _ChannelProvider_connections, [], "f");
|
|
8883
8891
|
await protectedObj.close();
|
|
8884
|
-
__classPrivateFieldGet$
|
|
8892
|
+
__classPrivateFieldGet$e(this, _ChannelProvider_close, "f").call(this);
|
|
8885
8893
|
}
|
|
8886
8894
|
/**
|
|
8887
8895
|
* Returns an array with info on every Client connected to the Provider
|
|
@@ -8951,7 +8959,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8951
8959
|
getEndpointIdForOpenFinId(clientIdentity, action) {
|
|
8952
8960
|
const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
|
|
8953
8961
|
if (matchingConnections.length >= 2) {
|
|
8954
|
-
const protectedObj = __classPrivateFieldGet$
|
|
8962
|
+
const protectedObj = __classPrivateFieldGet$e(this, _ChannelProvider_protectedObj, "f");
|
|
8955
8963
|
const { uuid, name } = clientIdentity;
|
|
8956
8964
|
const providerUuid = protectedObj?.providerIdentity.uuid;
|
|
8957
8965
|
const providerName = protectedObj?.providerIdentity.name;
|
|
@@ -9163,13 +9171,13 @@ class CombinedStrategy {
|
|
|
9163
9171
|
}
|
|
9164
9172
|
strategy.default = CombinedStrategy;
|
|
9165
9173
|
|
|
9166
|
-
var __classPrivateFieldSet$
|
|
9174
|
+
var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
9167
9175
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
9168
9176
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9169
9177
|
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");
|
|
9170
9178
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
9171
9179
|
};
|
|
9172
|
-
var __classPrivateFieldGet$
|
|
9180
|
+
var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9173
9181
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9174
9182
|
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");
|
|
9175
9183
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -9218,8 +9226,8 @@ class ConnectionManager extends base_1$j.Base {
|
|
|
9218
9226
|
};
|
|
9219
9227
|
this.providerMap = new Map();
|
|
9220
9228
|
this.protocolManager = new protocol_manager_1.ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
|
|
9221
|
-
__classPrivateFieldSet$
|
|
9222
|
-
__classPrivateFieldSet$
|
|
9229
|
+
__classPrivateFieldSet$c(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
|
|
9230
|
+
__classPrivateFieldSet$c(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
|
|
9223
9231
|
wire.registerMessageHandler(this.onmessage.bind(this));
|
|
9224
9232
|
}
|
|
9225
9233
|
createProvider(options, providerIdentity) {
|
|
@@ -9230,7 +9238,7 @@ class ConnectionManager extends base_1$j.Base {
|
|
|
9230
9238
|
case 'rtc':
|
|
9231
9239
|
return new strategy_2.RTCStrategy();
|
|
9232
9240
|
case 'classic':
|
|
9233
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
|
9241
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$d(this, _ConnectionManager_messageReceiver, "f"),
|
|
9234
9242
|
// Providers do not have an endpointId, use channelId as endpointId in the strategy.
|
|
9235
9243
|
providerIdentity.channelId, providerIdentity);
|
|
9236
9244
|
default:
|
|
@@ -9266,7 +9274,7 @@ class ConnectionManager extends base_1$j.Base {
|
|
|
9266
9274
|
const supportedProtocols = await Promise.all(protocols.map(async (type) => {
|
|
9267
9275
|
switch (type) {
|
|
9268
9276
|
case 'rtc': {
|
|
9269
|
-
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$
|
|
9277
|
+
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$d(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
|
|
9270
9278
|
rtcPacket = { rtcClient, channels, channelsOpened };
|
|
9271
9279
|
return {
|
|
9272
9280
|
type: 'rtc',
|
|
@@ -9293,18 +9301,18 @@ class ConnectionManager extends base_1$j.Base {
|
|
|
9293
9301
|
routingInfo.endpointId = this.wire.environment.getNextMessageId();
|
|
9294
9302
|
// For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
|
|
9295
9303
|
// clients that are in the same context as the newly-connected client.
|
|
9296
|
-
__classPrivateFieldGet$
|
|
9304
|
+
__classPrivateFieldGet$d(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
|
|
9297
9305
|
}
|
|
9298
9306
|
const answer = routingInfo.answer ?? {
|
|
9299
9307
|
supportedProtocols: [{ type: 'classic', version: 1 }]
|
|
9300
9308
|
};
|
|
9301
9309
|
const createStrategyFromAnswer = async (protocol) => {
|
|
9302
9310
|
if (protocol.type === 'rtc' && rtcPacket) {
|
|
9303
|
-
await __classPrivateFieldGet$
|
|
9311
|
+
await __classPrivateFieldGet$d(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
|
|
9304
9312
|
return new strategy_2.RTCStrategy();
|
|
9305
9313
|
}
|
|
9306
9314
|
if (protocol.type === 'classic') {
|
|
9307
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
|
9315
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$d(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
|
|
9308
9316
|
}
|
|
9309
9317
|
return null;
|
|
9310
9318
|
};
|
|
@@ -9372,7 +9380,7 @@ class ConnectionManager extends base_1$j.Base {
|
|
|
9372
9380
|
clientAnswer = await overlappingProtocols.reduce(async (accumP, protocolToUse) => {
|
|
9373
9381
|
const answer = await accumP;
|
|
9374
9382
|
if (protocolToUse.type === 'rtc') {
|
|
9375
|
-
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$
|
|
9383
|
+
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$d(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
|
|
9376
9384
|
answer.supportedProtocols.push({
|
|
9377
9385
|
type: 'rtc',
|
|
9378
9386
|
version: strategy_2.RTCInfo.version,
|
|
@@ -9420,13 +9428,13 @@ _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnec
|
|
|
9420
9428
|
*
|
|
9421
9429
|
* @packageDocumentation
|
|
9422
9430
|
*/
|
|
9423
|
-
var __classPrivateFieldSet$
|
|
9431
|
+
var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
9424
9432
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
9425
9433
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9426
9434
|
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");
|
|
9427
9435
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
9428
9436
|
};
|
|
9429
|
-
var __classPrivateFieldGet$
|
|
9437
|
+
var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9430
9438
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9431
9439
|
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");
|
|
9432
9440
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -9483,11 +9491,11 @@ class Channel extends base_1$i.EmitterBase {
|
|
|
9483
9491
|
client_1.ChannelClient.handleProviderDisconnect(eventPayload);
|
|
9484
9492
|
}),
|
|
9485
9493
|
this.on('connected', (...args) => {
|
|
9486
|
-
__classPrivateFieldGet$
|
|
9494
|
+
__classPrivateFieldGet$c(this, _Channel_internalEmitter, "f").emit('connected', ...args);
|
|
9487
9495
|
})
|
|
9488
9496
|
]).catch(() => new Error('error setting up channel connection listeners'));
|
|
9489
9497
|
}));
|
|
9490
|
-
__classPrivateFieldSet$
|
|
9498
|
+
__classPrivateFieldSet$b(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
|
|
9491
9499
|
}
|
|
9492
9500
|
/**
|
|
9493
9501
|
*
|
|
@@ -9562,7 +9570,7 @@ class Channel extends base_1$i.EmitterBase {
|
|
|
9562
9570
|
resolve(true);
|
|
9563
9571
|
}
|
|
9564
9572
|
};
|
|
9565
|
-
__classPrivateFieldGet$
|
|
9573
|
+
__classPrivateFieldGet$c(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
|
|
9566
9574
|
});
|
|
9567
9575
|
try {
|
|
9568
9576
|
if (retryInfo.count > 0) {
|
|
@@ -9594,7 +9602,7 @@ class Channel extends base_1$i.EmitterBase {
|
|
|
9594
9602
|
finally {
|
|
9595
9603
|
retryInfo.count += 1;
|
|
9596
9604
|
// in case of other errors, remove our listener
|
|
9597
|
-
__classPrivateFieldGet$
|
|
9605
|
+
__classPrivateFieldGet$c(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
|
|
9598
9606
|
}
|
|
9599
9607
|
} while (shouldWait); // If we're waiting we retry the above loop
|
|
9600
9608
|
// Should wait was false, no channel was found.
|
|
@@ -9653,12 +9661,12 @@ class Channel extends base_1$i.EmitterBase {
|
|
|
9653
9661
|
async connect(channelName, options = {}) {
|
|
9654
9662
|
// Make sure we don't connect before listeners are set up
|
|
9655
9663
|
// This also errors if we're not in OpenFin, ensuring we don't run unnecessary code
|
|
9656
|
-
await __classPrivateFieldGet$
|
|
9664
|
+
await __classPrivateFieldGet$c(this, _Channel_readyToConnect, "f").getValue();
|
|
9657
9665
|
if (!channelName || typeof channelName !== 'string') {
|
|
9658
9666
|
throw new Error('Please provide a channelName string to connect to a channel.');
|
|
9659
9667
|
}
|
|
9660
9668
|
const opts = { wait: true, ...this.wire.environment.getDefaultChannelOptions().connect, ...options };
|
|
9661
|
-
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$
|
|
9669
|
+
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$c(this, _Channel_connectionManager, "f").createClientOffer(opts);
|
|
9662
9670
|
let connectionUrl;
|
|
9663
9671
|
if (this.fin.me.isFrame || this.fin.me.isView || this.fin.me.isWindow) {
|
|
9664
9672
|
connectionUrl = (await this.fin.me.getInfo()).url;
|
|
@@ -9670,7 +9678,7 @@ class Channel extends base_1$i.EmitterBase {
|
|
|
9670
9678
|
connectionUrl
|
|
9671
9679
|
};
|
|
9672
9680
|
const routingInfo = await this.safeConnect(channelName, opts.wait, connectPayload);
|
|
9673
|
-
const strategy = await __classPrivateFieldGet$
|
|
9681
|
+
const strategy = await __classPrivateFieldGet$c(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
|
|
9674
9682
|
const channel = new client_1.ChannelClient(routingInfo, () => client_1.ChannelClient.wireClose(this.wire, routingInfo, routingInfo.endpointId), strategy);
|
|
9675
9683
|
// It is the client's responsibility to handle endpoint disconnection to the provider.
|
|
9676
9684
|
// If the endpoint dies, the client will force a disconnection through the core.
|
|
@@ -9739,7 +9747,7 @@ class Channel extends base_1$i.EmitterBase {
|
|
|
9739
9747
|
throw new Error('Please provide a channelName to create a channel');
|
|
9740
9748
|
}
|
|
9741
9749
|
const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
|
|
9742
|
-
const channel = __classPrivateFieldGet$
|
|
9750
|
+
const channel = __classPrivateFieldGet$c(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
|
|
9743
9751
|
// TODO: fix typing (internal)
|
|
9744
9752
|
// @ts-expect-error
|
|
9745
9753
|
this.on('client-disconnected', (eventPayload) => {
|
|
@@ -10630,13 +10638,13 @@ var Factory$3 = {};
|
|
|
10630
10638
|
|
|
10631
10639
|
var Instance$2 = {};
|
|
10632
10640
|
|
|
10633
|
-
var __classPrivateFieldSet$
|
|
10641
|
+
var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
10634
10642
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
10635
10643
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10636
10644
|
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");
|
|
10637
10645
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
10638
10646
|
};
|
|
10639
|
-
var __classPrivateFieldGet$
|
|
10647
|
+
var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
10640
10648
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10641
10649
|
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");
|
|
10642
10650
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -10673,24 +10681,24 @@ class Platform extends base_1$a.EmitterBase {
|
|
|
10673
10681
|
this.wire.sendAction('platform-get-client', this.identity).catch((e) => {
|
|
10674
10682
|
// don't expose
|
|
10675
10683
|
});
|
|
10676
|
-
if (!Platform.clientMap.has(__classPrivateFieldGet$
|
|
10677
|
-
const clientPromise = __classPrivateFieldGet$
|
|
10678
|
-
Platform.clientMap.set(__classPrivateFieldGet$
|
|
10684
|
+
if (!Platform.clientMap.has(__classPrivateFieldGet$b(this, _Platform_channelName, "f"))) {
|
|
10685
|
+
const clientPromise = __classPrivateFieldGet$b(this, _Platform_connectToProvider, "f").call(this);
|
|
10686
|
+
Platform.clientMap.set(__classPrivateFieldGet$b(this, _Platform_channelName, "f"), clientPromise);
|
|
10679
10687
|
}
|
|
10680
10688
|
// we set it above
|
|
10681
10689
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
10682
|
-
return Platform.clientMap.get(__classPrivateFieldGet$
|
|
10690
|
+
return Platform.clientMap.get(__classPrivateFieldGet$b(this, _Platform_channelName, "f"));
|
|
10683
10691
|
};
|
|
10684
10692
|
_Platform_connectToProvider.set(this, async () => {
|
|
10685
10693
|
try {
|
|
10686
|
-
const client = await this._channel.connect(__classPrivateFieldGet$
|
|
10694
|
+
const client = await this._channel.connect(__classPrivateFieldGet$b(this, _Platform_channelName, "f"), { wait: false });
|
|
10687
10695
|
client.onDisconnection(() => {
|
|
10688
|
-
Platform.clientMap.delete(__classPrivateFieldGet$
|
|
10696
|
+
Platform.clientMap.delete(__classPrivateFieldGet$b(this, _Platform_channelName, "f"));
|
|
10689
10697
|
});
|
|
10690
10698
|
return client;
|
|
10691
10699
|
}
|
|
10692
10700
|
catch (e) {
|
|
10693
|
-
Platform.clientMap.delete(__classPrivateFieldGet$
|
|
10701
|
+
Platform.clientMap.delete(__classPrivateFieldGet$b(this, _Platform_channelName, "f"));
|
|
10694
10702
|
throw new Error('The targeted Platform is not currently running. Listen for application-started event for the given Uuid.');
|
|
10695
10703
|
}
|
|
10696
10704
|
});
|
|
@@ -10703,7 +10711,7 @@ class Platform extends base_1$a.EmitterBase {
|
|
|
10703
10711
|
if (errorMsg) {
|
|
10704
10712
|
throw new Error(errorMsg);
|
|
10705
10713
|
}
|
|
10706
|
-
__classPrivateFieldSet$
|
|
10714
|
+
__classPrivateFieldSet$a(this, _Platform_channelName, channelName, "f");
|
|
10707
10715
|
this._channel = this.fin.InterApplicationBus.Channel;
|
|
10708
10716
|
this.identity = { uuid: identity.uuid };
|
|
10709
10717
|
this.Layout = this.fin.Platform.Layout;
|
|
@@ -11759,13 +11767,13 @@ const createRelayedDispatch = (client, target, relayId, relayErrorMsg) => async
|
|
|
11759
11767
|
};
|
|
11760
11768
|
channelApiRelay.createRelayedDispatch = createRelayedDispatch;
|
|
11761
11769
|
|
|
11762
|
-
var __classPrivateFieldSet$
|
|
11770
|
+
var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
11763
11771
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
11764
11772
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
11765
11773
|
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");
|
|
11766
11774
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11767
11775
|
};
|
|
11768
|
-
var __classPrivateFieldGet$
|
|
11776
|
+
var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
11769
11777
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
11770
11778
|
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");
|
|
11771
11779
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -11819,7 +11827,7 @@ class LayoutNode {
|
|
|
11819
11827
|
* console.log(`The parent ColumnOrRow is root: ${parentIsRoot}`);
|
|
11820
11828
|
* ```
|
|
11821
11829
|
*/
|
|
11822
|
-
this.isRoot = () => __classPrivateFieldGet$
|
|
11830
|
+
this.isRoot = () => __classPrivateFieldGet$a(this, _LayoutNode_client, "f").isRoot(this.entityId);
|
|
11823
11831
|
/**
|
|
11824
11832
|
* Checks if the TabStack or ColumnOrRow exists
|
|
11825
11833
|
*
|
|
@@ -11839,7 +11847,7 @@ class LayoutNode {
|
|
|
11839
11847
|
* console.log(`The entity exists: ${exists}`);
|
|
11840
11848
|
* ```
|
|
11841
11849
|
*/
|
|
11842
|
-
this.exists = () => __classPrivateFieldGet$
|
|
11850
|
+
this.exists = () => __classPrivateFieldGet$a(this, _LayoutNode_client, "f").exists(this.entityId);
|
|
11843
11851
|
/**
|
|
11844
11852
|
* Retrieves the parent of the TabStack or ColumnOrRow
|
|
11845
11853
|
*
|
|
@@ -11860,11 +11868,11 @@ class LayoutNode {
|
|
|
11860
11868
|
* ```
|
|
11861
11869
|
*/
|
|
11862
11870
|
this.getParent = async () => {
|
|
11863
|
-
const parent = await __classPrivateFieldGet$
|
|
11871
|
+
const parent = await __classPrivateFieldGet$a(this, _LayoutNode_client, "f").getParent(this.entityId);
|
|
11864
11872
|
if (!parent) {
|
|
11865
11873
|
return undefined;
|
|
11866
11874
|
}
|
|
11867
|
-
return LayoutNode.getEntity(parent, __classPrivateFieldGet$
|
|
11875
|
+
return LayoutNode.getEntity(parent, __classPrivateFieldGet$a(this, _LayoutNode_client, "f"));
|
|
11868
11876
|
};
|
|
11869
11877
|
/**
|
|
11870
11878
|
* Creates a new TabStack adjacent to the given TabStack or ColumnOrRow. Inputs can be new views to create, or existing views.
|
|
@@ -11915,8 +11923,8 @@ class LayoutNode {
|
|
|
11915
11923
|
* @experimental
|
|
11916
11924
|
*/
|
|
11917
11925
|
this.createAdjacentStack = async (views, options) => {
|
|
11918
|
-
const entityId = await __classPrivateFieldGet$
|
|
11919
|
-
return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet$
|
|
11926
|
+
const entityId = await __classPrivateFieldGet$a(this, _LayoutNode_client, "f").createAdjacentStack(this.entityId, views, options);
|
|
11927
|
+
return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet$a(this, _LayoutNode_client, "f"));
|
|
11920
11928
|
};
|
|
11921
11929
|
/**
|
|
11922
11930
|
* Retrieves the adjacent TabStacks of the given TabStack or ColumnOrRow.
|
|
@@ -11944,16 +11952,16 @@ class LayoutNode {
|
|
|
11944
11952
|
* @experimental
|
|
11945
11953
|
*/
|
|
11946
11954
|
this.getAdjacentStacks = async (edge) => {
|
|
11947
|
-
const adjacentStacks = await __classPrivateFieldGet$
|
|
11955
|
+
const adjacentStacks = await __classPrivateFieldGet$a(this, _LayoutNode_client, "f").getAdjacentStacks({
|
|
11948
11956
|
targetId: this.entityId,
|
|
11949
11957
|
edge
|
|
11950
11958
|
});
|
|
11951
11959
|
return adjacentStacks.map((stack) => LayoutNode.getEntity({
|
|
11952
11960
|
type: 'stack',
|
|
11953
11961
|
entityId: stack.entityId
|
|
11954
|
-
}, __classPrivateFieldGet$
|
|
11962
|
+
}, __classPrivateFieldGet$a(this, _LayoutNode_client, "f")));
|
|
11955
11963
|
};
|
|
11956
|
-
__classPrivateFieldSet$
|
|
11964
|
+
__classPrivateFieldSet$9(this, _LayoutNode_client, client, "f");
|
|
11957
11965
|
this.entityId = entityId;
|
|
11958
11966
|
}
|
|
11959
11967
|
}
|
|
@@ -12027,7 +12035,7 @@ class TabStack extends LayoutNode {
|
|
|
12027
12035
|
* ```
|
|
12028
12036
|
* @experimental
|
|
12029
12037
|
*/
|
|
12030
|
-
this.getViews = () => __classPrivateFieldGet$
|
|
12038
|
+
this.getViews = () => __classPrivateFieldGet$a(this, _TabStack_client, "f").getStackViews(this.entityId);
|
|
12031
12039
|
/**
|
|
12032
12040
|
* Adds or creates a view in this {@link TabStack}.
|
|
12033
12041
|
*
|
|
@@ -12058,7 +12066,7 @@ class TabStack extends LayoutNode {
|
|
|
12058
12066
|
* ```
|
|
12059
12067
|
* @experimental
|
|
12060
12068
|
*/
|
|
12061
|
-
this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet$
|
|
12069
|
+
this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet$a(this, _TabStack_client, "f").addViewToStack(this.entityId, view, options);
|
|
12062
12070
|
/**
|
|
12063
12071
|
* Removes a view from this {@link TabStack}.
|
|
12064
12072
|
*
|
|
@@ -12088,7 +12096,7 @@ class TabStack extends LayoutNode {
|
|
|
12088
12096
|
* ```
|
|
12089
12097
|
*/
|
|
12090
12098
|
this.removeView = async (view) => {
|
|
12091
|
-
await __classPrivateFieldGet$
|
|
12099
|
+
await __classPrivateFieldGet$a(this, _TabStack_client, "f").removeViewFromStack(this.entityId, view);
|
|
12092
12100
|
};
|
|
12093
12101
|
/**
|
|
12094
12102
|
* Sets the active view of the {@link TabStack} without focusing it.
|
|
@@ -12112,9 +12120,9 @@ class TabStack extends LayoutNode {
|
|
|
12112
12120
|
* @experimental
|
|
12113
12121
|
*/
|
|
12114
12122
|
this.setActiveView = async (view) => {
|
|
12115
|
-
await __classPrivateFieldGet$
|
|
12123
|
+
await __classPrivateFieldGet$a(this, _TabStack_client, "f").setStackActiveView(this.entityId, view);
|
|
12116
12124
|
};
|
|
12117
|
-
__classPrivateFieldSet$
|
|
12125
|
+
__classPrivateFieldSet$9(this, _TabStack_client, client, "f");
|
|
12118
12126
|
}
|
|
12119
12127
|
}
|
|
12120
12128
|
layoutEntities.TabStack = TabStack;
|
|
@@ -12153,10 +12161,10 @@ class ColumnOrRow extends LayoutNode {
|
|
|
12153
12161
|
* ```
|
|
12154
12162
|
*/
|
|
12155
12163
|
this.getContent = async () => {
|
|
12156
|
-
const contentItemEntities = await __classPrivateFieldGet$
|
|
12157
|
-
return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet$
|
|
12164
|
+
const contentItemEntities = await __classPrivateFieldGet$a(this, _ColumnOrRow_client, "f").getContent(this.entityId);
|
|
12165
|
+
return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet$a(this, _ColumnOrRow_client, "f")));
|
|
12158
12166
|
};
|
|
12159
|
-
__classPrivateFieldSet$
|
|
12167
|
+
__classPrivateFieldSet$9(this, _ColumnOrRow_client, client, "f");
|
|
12160
12168
|
this.type = type;
|
|
12161
12169
|
}
|
|
12162
12170
|
}
|
|
@@ -12171,7 +12179,7 @@ layout_constants.LAYOUT_CONTROLLER_ID = 'layout-entities';
|
|
|
12171
12179
|
// TODO: eventually export this somehow
|
|
12172
12180
|
layout_constants.DEFAULT_LAYOUT_KEY = '__default__';
|
|
12173
12181
|
|
|
12174
|
-
var __classPrivateFieldGet$
|
|
12182
|
+
var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12175
12183
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
12176
12184
|
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");
|
|
12177
12185
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -12322,7 +12330,7 @@ class Layout extends base_1$9.Base {
|
|
|
12322
12330
|
* @internal
|
|
12323
12331
|
*/
|
|
12324
12332
|
static getClient(layout) {
|
|
12325
|
-
return __classPrivateFieldGet$
|
|
12333
|
+
return __classPrivateFieldGet$9(layout, _Layout_layoutClient, "f").getValue();
|
|
12326
12334
|
}
|
|
12327
12335
|
/**
|
|
12328
12336
|
* @internal
|
|
@@ -12545,7 +12553,7 @@ class Layout extends base_1$9.Base {
|
|
|
12545
12553
|
this.wire.sendAction('layout-get-root-item').catch(() => {
|
|
12546
12554
|
// don't expose
|
|
12547
12555
|
});
|
|
12548
|
-
const client = await __classPrivateFieldGet$
|
|
12556
|
+
const client = await __classPrivateFieldGet$9(this, _Layout_layoutClient, "f").getValue();
|
|
12549
12557
|
const root = await client.getRoot('layoutName' in this.identity ? this.identity : undefined);
|
|
12550
12558
|
return layout_entities_1.LayoutNode.getEntity(root, client);
|
|
12551
12559
|
}
|
|
@@ -12563,7 +12571,7 @@ class Layout extends base_1$9.Base {
|
|
|
12563
12571
|
this.wire.sendAction('layout-get-stack-by-view').catch(() => {
|
|
12564
12572
|
// don't expose
|
|
12565
12573
|
});
|
|
12566
|
-
const client = await __classPrivateFieldGet$
|
|
12574
|
+
const client = await __classPrivateFieldGet$9(this, _Layout_layoutClient, "f").getValue();
|
|
12567
12575
|
const stack = await client.getStackByView(identity);
|
|
12568
12576
|
if (!stack) {
|
|
12569
12577
|
throw new Error(`No stack found for view: ${identity.uuid}/${identity.name}`);
|
|
@@ -12583,7 +12591,7 @@ class Layout extends base_1$9.Base {
|
|
|
12583
12591
|
this.wire.sendAction('layout-add-view').catch((e) => {
|
|
12584
12592
|
// don't expose
|
|
12585
12593
|
});
|
|
12586
|
-
const { identity } = await __classPrivateFieldGet$
|
|
12594
|
+
const { identity } = await __classPrivateFieldGet$9(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-add-view', {
|
|
12587
12595
|
viewOptions,
|
|
12588
12596
|
location,
|
|
12589
12597
|
targetView
|
|
@@ -12601,7 +12609,7 @@ class Layout extends base_1$9.Base {
|
|
|
12601
12609
|
this.wire.sendAction('layout-close-view').catch((e) => {
|
|
12602
12610
|
// don't expose
|
|
12603
12611
|
});
|
|
12604
|
-
await __classPrivateFieldGet$
|
|
12612
|
+
await __classPrivateFieldGet$9(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-close-view', { viewIdentity });
|
|
12605
12613
|
}
|
|
12606
12614
|
}
|
|
12607
12615
|
Instance$1.Layout = Layout;
|
|
@@ -12615,12 +12623,12 @@ async function _Layout_forwardLayoutAction(action, payload) {
|
|
|
12615
12623
|
return client.dispatch(action, { target: this.identity, opts: payload });
|
|
12616
12624
|
};
|
|
12617
12625
|
|
|
12618
|
-
var __classPrivateFieldGet$
|
|
12626
|
+
var __classPrivateFieldGet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12619
12627
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
12620
12628
|
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");
|
|
12621
12629
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12622
12630
|
};
|
|
12623
|
-
var __classPrivateFieldSet$
|
|
12631
|
+
var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12624
12632
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
12625
12633
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
12626
12634
|
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");
|
|
@@ -12686,23 +12694,23 @@ class LayoutModule extends base_1$8.Base {
|
|
|
12686
12694
|
if (!this.wire.environment.layoutAllowedInContext(this.fin)) {
|
|
12687
12695
|
throw new Error('Layout.init can only be called from a Window context.');
|
|
12688
12696
|
}
|
|
12689
|
-
if (__classPrivateFieldGet$
|
|
12697
|
+
if (__classPrivateFieldGet$8(this, _LayoutModule_layoutInitializationAttempted, "f")) {
|
|
12690
12698
|
throw new Error('Layout.init was already called, please use Layout.create to add additional layouts.');
|
|
12691
12699
|
}
|
|
12692
12700
|
if (this.wire.environment.type === 'openfin') {
|
|
12693
12701
|
// preload the client
|
|
12694
12702
|
await this.fin.Platform.getCurrentSync().getClient();
|
|
12695
12703
|
}
|
|
12696
|
-
__classPrivateFieldSet$
|
|
12704
|
+
__classPrivateFieldSet$8(this, _LayoutModule_layoutInitializationAttempted, true, "f");
|
|
12697
12705
|
// TODO: rename to createLayoutManager
|
|
12698
|
-
__classPrivateFieldSet$
|
|
12699
|
-
await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$
|
|
12706
|
+
__classPrivateFieldSet$8(this, _LayoutModule_layoutManager, await this.wire.environment.initLayoutManager(this.fin, this.wire, options), "f");
|
|
12707
|
+
await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$8(this, _LayoutModule_layoutManager, "f"), options);
|
|
12700
12708
|
const meIdentity = { name: this.fin.me.name, uuid: this.fin.me.uuid };
|
|
12701
12709
|
if (!options.layoutManagerOverride) {
|
|
12702
12710
|
// CORE-1081 to be removed when we actually delete the `layoutManager` prop
|
|
12703
12711
|
// in single-layout case, we return the undocumented layoutManager type
|
|
12704
12712
|
const layoutIdentity = { layoutName: layout_constants_1.DEFAULT_LAYOUT_KEY, ...meIdentity };
|
|
12705
|
-
return __classPrivateFieldGet$
|
|
12713
|
+
return __classPrivateFieldGet$8(this, _LayoutModule_getLayoutManagerSpy, "f").call(this, layoutIdentity);
|
|
12706
12714
|
}
|
|
12707
12715
|
return this.wrapSync(meIdentity);
|
|
12708
12716
|
};
|
|
@@ -12731,13 +12739,13 @@ class LayoutModule extends base_1$8.Base {
|
|
|
12731
12739
|
* @returns
|
|
12732
12740
|
*/
|
|
12733
12741
|
this.getCurrentLayoutManagerSync = () => {
|
|
12734
|
-
return __classPrivateFieldGet$
|
|
12742
|
+
return __classPrivateFieldGet$8(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.getCurrentLayoutManagerSync()`);
|
|
12735
12743
|
};
|
|
12736
12744
|
this.create = async (options) => {
|
|
12737
|
-
return this.wire.environment.createLayout(__classPrivateFieldGet$
|
|
12745
|
+
return this.wire.environment.createLayout(__classPrivateFieldGet$8(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.create()`), options);
|
|
12738
12746
|
};
|
|
12739
12747
|
this.destroy = async (layoutIdentity) => {
|
|
12740
|
-
return this.wire.environment.destroyLayout(__classPrivateFieldGet$
|
|
12748
|
+
return this.wire.environment.destroyLayout(__classPrivateFieldGet$8(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.destroy()`), layoutIdentity);
|
|
12741
12749
|
};
|
|
12742
12750
|
}
|
|
12743
12751
|
/**
|
|
@@ -12878,10 +12886,10 @@ class LayoutModule extends base_1$8.Base {
|
|
|
12878
12886
|
}
|
|
12879
12887
|
Factory$2.LayoutModule = LayoutModule;
|
|
12880
12888
|
_LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_getLayoutManagerSpy = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
|
|
12881
|
-
if (!__classPrivateFieldGet$
|
|
12889
|
+
if (!__classPrivateFieldGet$8(this, _LayoutModule_layoutManager, "f")) {
|
|
12882
12890
|
throw new Error(`You must call init before using the API ${method}`);
|
|
12883
12891
|
}
|
|
12884
|
-
return __classPrivateFieldGet$
|
|
12892
|
+
return __classPrivateFieldGet$8(this, _LayoutModule_layoutManager, "f");
|
|
12885
12893
|
};
|
|
12886
12894
|
|
|
12887
12895
|
(function (exports) {
|
|
@@ -13846,13 +13854,13 @@ class PrivateChannelProvider {
|
|
|
13846
13854
|
}
|
|
13847
13855
|
PrivateChannelProvider$1.PrivateChannelProvider = PrivateChannelProvider;
|
|
13848
13856
|
|
|
13849
|
-
var __classPrivateFieldSet$
|
|
13857
|
+
var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
13850
13858
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
13851
13859
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
13852
13860
|
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");
|
|
13853
13861
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
13854
13862
|
};
|
|
13855
|
-
var __classPrivateFieldGet$
|
|
13863
|
+
var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
13856
13864
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13857
13865
|
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");
|
|
13858
13866
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -14043,12 +14051,12 @@ class InteropBroker extends base_1$6.Base {
|
|
|
14043
14051
|
_InteropBroker_contextGroups.set(this, void 0);
|
|
14044
14052
|
_InteropBroker_providerPromise.set(this, void 0);
|
|
14045
14053
|
this.getProvider = () => {
|
|
14046
|
-
return __classPrivateFieldGet$
|
|
14054
|
+
return __classPrivateFieldGet$7(this, _InteropBroker_providerPromise, "f").getValue();
|
|
14047
14055
|
};
|
|
14048
14056
|
this.interopClients = new Map();
|
|
14049
14057
|
this.contextGroupsById = new Map();
|
|
14050
|
-
__classPrivateFieldSet$
|
|
14051
|
-
__classPrivateFieldSet$
|
|
14058
|
+
__classPrivateFieldSet$7(this, _InteropBroker_contextGroups, options.contextGroups ?? [...defaultContextGroups], "f");
|
|
14059
|
+
__classPrivateFieldSet$7(this, _InteropBroker_fdc3Info, options.fdc3Info, "f");
|
|
14052
14060
|
if (options?.logging) {
|
|
14053
14061
|
this.logging = options.logging;
|
|
14054
14062
|
}
|
|
@@ -14056,7 +14064,7 @@ class InteropBroker extends base_1$6.Base {
|
|
|
14056
14064
|
this.lastContextMap = new Map();
|
|
14057
14065
|
this.sessionContextGroupMap = new Map();
|
|
14058
14066
|
this.privateChannelProviderMap = new Map();
|
|
14059
|
-
__classPrivateFieldSet$
|
|
14067
|
+
__classPrivateFieldSet$7(this, _InteropBroker_providerPromise, new lazy_1$1.Lazy(createProvider), "f");
|
|
14060
14068
|
this.setContextGroupMap();
|
|
14061
14069
|
this.setupChannelProvider();
|
|
14062
14070
|
}
|
|
@@ -14228,8 +14236,8 @@ class InteropBroker extends base_1$6.Base {
|
|
|
14228
14236
|
if (!this.getContextGroups().find((contextGroupInfo) => contextGroupInfo.id === contextGroupId)) {
|
|
14229
14237
|
throw new Error(`Attempting to join a context group that does not exist: ${contextGroupId}. You may only join existing context groups.`);
|
|
14230
14238
|
}
|
|
14231
|
-
const
|
|
14232
|
-
if (
|
|
14239
|
+
const previousContextGroupId = clientSubscriptionState.contextGroupId;
|
|
14240
|
+
if (previousContextGroupId !== contextGroupId) {
|
|
14233
14241
|
clientSubscriptionState.contextGroupId = contextGroupId;
|
|
14234
14242
|
await this.setCurrentContextGroupInClientOptions(clientIdentity, contextGroupId);
|
|
14235
14243
|
const contextGroupMap = this.contextGroupsById.get(contextGroupId);
|
|
@@ -14248,6 +14256,13 @@ class InteropBroker extends base_1$6.Base {
|
|
|
14248
14256
|
}
|
|
14249
14257
|
}
|
|
14250
14258
|
}
|
|
14259
|
+
// All settled will suppress uncaught exceptions. We don't want to await this because it could
|
|
14260
|
+
// result in the operation hanging.
|
|
14261
|
+
Promise.allSettled(this.channel.publish('client-changed-context-group', {
|
|
14262
|
+
identity: clientIdentity,
|
|
14263
|
+
contextGroupId,
|
|
14264
|
+
previousContextGroupId: previousContextGroupId || null
|
|
14265
|
+
}));
|
|
14251
14266
|
}
|
|
14252
14267
|
}
|
|
14253
14268
|
// Removes the target from its context group. Similar structure to joinContextGroup.
|
|
@@ -14307,10 +14322,18 @@ class InteropBroker extends base_1$6.Base {
|
|
|
14307
14322
|
// don't expose, analytics-only call
|
|
14308
14323
|
});
|
|
14309
14324
|
const clientState = this.getClientState(clientIdentity);
|
|
14325
|
+
const previousContextGroupId = clientState?.contextGroupId;
|
|
14310
14326
|
if (clientState) {
|
|
14311
14327
|
clientState.contextGroupId = undefined;
|
|
14312
14328
|
}
|
|
14313
14329
|
await this.setCurrentContextGroupInClientOptions(clientIdentity, null);
|
|
14330
|
+
// All settled will suppress uncaught exceptions. We don't want to await this because it could
|
|
14331
|
+
// result in the operation hanging.
|
|
14332
|
+
Promise.allSettled(this.channel.publish('client-changed-context-group', {
|
|
14333
|
+
identity: clientIdentity,
|
|
14334
|
+
contextGroupId: null,
|
|
14335
|
+
previousContextGroupId: previousContextGroupId || null
|
|
14336
|
+
}));
|
|
14314
14337
|
}
|
|
14315
14338
|
// Used by platform windows to know what client groups the provider has declared. Also used internally to access context groups. Overrideable so that the platform developer can modify it.
|
|
14316
14339
|
/**
|
|
@@ -14324,7 +14347,7 @@ class InteropBroker extends base_1$6.Base {
|
|
|
14324
14347
|
// don't expose, analytics-only call
|
|
14325
14348
|
});
|
|
14326
14349
|
// Create copy for immutability
|
|
14327
|
-
return __classPrivateFieldGet$
|
|
14350
|
+
return __classPrivateFieldGet$7(this, _InteropBroker_contextGroups, "f").map((contextGroup) => {
|
|
14328
14351
|
return { ...contextGroup };
|
|
14329
14352
|
});
|
|
14330
14353
|
}
|
|
@@ -14735,7 +14758,7 @@ class InteropBroker extends base_1$6.Base {
|
|
|
14735
14758
|
const { fdc3Version } = payload;
|
|
14736
14759
|
return {
|
|
14737
14760
|
fdc3Version,
|
|
14738
|
-
...__classPrivateFieldGet$
|
|
14761
|
+
...__classPrivateFieldGet$7(this, _InteropBroker_fdc3Info, "f"),
|
|
14739
14762
|
optionalFeatures: {
|
|
14740
14763
|
OriginatingAppMetadata: false,
|
|
14741
14764
|
UserChannelMembershipAPIs: true
|
|
@@ -15120,13 +15143,13 @@ var InteropClient$1 = {};
|
|
|
15120
15143
|
|
|
15121
15144
|
var SessionContextGroupClient$1 = {};
|
|
15122
15145
|
|
|
15123
|
-
var __classPrivateFieldSet$
|
|
15146
|
+
var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
15124
15147
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
15125
15148
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
15126
15149
|
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");
|
|
15127
15150
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
15128
15151
|
};
|
|
15129
|
-
var __classPrivateFieldGet$
|
|
15152
|
+
var __classPrivateFieldGet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
15130
15153
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
15131
15154
|
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");
|
|
15132
15155
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -15140,7 +15163,7 @@ class SessionContextGroupClient extends base_1$5.Base {
|
|
|
15140
15163
|
super(wire);
|
|
15141
15164
|
_SessionContextGroupClient_clientPromise.set(this, void 0);
|
|
15142
15165
|
this.id = id;
|
|
15143
|
-
__classPrivateFieldSet$
|
|
15166
|
+
__classPrivateFieldSet$6(this, _SessionContextGroupClient_clientPromise, client, "f");
|
|
15144
15167
|
}
|
|
15145
15168
|
/**
|
|
15146
15169
|
* Sets a context for the session context group.
|
|
@@ -15152,7 +15175,7 @@ class SessionContextGroupClient extends base_1$5.Base {
|
|
|
15152
15175
|
this.wire.sendAction('interop-session-context-group-set-context').catch((e) => {
|
|
15153
15176
|
// don't expose, analytics-only call
|
|
15154
15177
|
});
|
|
15155
|
-
const client = await __classPrivateFieldGet$
|
|
15178
|
+
const client = await __classPrivateFieldGet$6(this, _SessionContextGroupClient_clientPromise, "f");
|
|
15156
15179
|
return client.dispatch(`sessionContextGroup:setContext-${this.id}`, {
|
|
15157
15180
|
sessionContextGroupId: this.id,
|
|
15158
15181
|
context
|
|
@@ -15162,7 +15185,7 @@ class SessionContextGroupClient extends base_1$5.Base {
|
|
|
15162
15185
|
this.wire.sendAction('interop-session-context-group-get-context').catch((e) => {
|
|
15163
15186
|
// don't expose, analytics-only call
|
|
15164
15187
|
});
|
|
15165
|
-
const client = await __classPrivateFieldGet$
|
|
15188
|
+
const client = await __classPrivateFieldGet$6(this, _SessionContextGroupClient_clientPromise, "f");
|
|
15166
15189
|
return client.dispatch(`sessionContextGroup:getContext-${this.id}`, {
|
|
15167
15190
|
sessionContextGroupId: this.id,
|
|
15168
15191
|
type
|
|
@@ -15175,7 +15198,7 @@ class SessionContextGroupClient extends base_1$5.Base {
|
|
|
15175
15198
|
if (typeof contextHandler !== 'function') {
|
|
15176
15199
|
throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
|
|
15177
15200
|
}
|
|
15178
|
-
const client = await __classPrivateFieldGet$
|
|
15201
|
+
const client = await __classPrivateFieldGet$6(this, _SessionContextGroupClient_clientPromise, "f");
|
|
15179
15202
|
let handlerId;
|
|
15180
15203
|
if (contextType) {
|
|
15181
15204
|
handlerId = `sessionContextHandler:invoke-${this.id}-${contextType}-${(0, utils_1$6.generateId)()}`;
|
|
@@ -15188,7 +15211,7 @@ class SessionContextGroupClient extends base_1$5.Base {
|
|
|
15188
15211
|
return { unsubscribe: await this.createUnsubscribeCb(handlerId) };
|
|
15189
15212
|
}
|
|
15190
15213
|
async createUnsubscribeCb(handlerId) {
|
|
15191
|
-
const client = await __classPrivateFieldGet$
|
|
15214
|
+
const client = await __classPrivateFieldGet$6(this, _SessionContextGroupClient_clientPromise, "f");
|
|
15192
15215
|
return async () => {
|
|
15193
15216
|
client.remove(handlerId);
|
|
15194
15217
|
await client.dispatch(`sessionContextGroup:handlerRemoved-${this.id}`, { handlerId });
|
|
@@ -15206,6 +15229,139 @@ class SessionContextGroupClient extends base_1$5.Base {
|
|
|
15206
15229
|
SessionContextGroupClient$1.default = SessionContextGroupClient;
|
|
15207
15230
|
_SessionContextGroupClient_clientPromise = new WeakMap();
|
|
15208
15231
|
|
|
15232
|
+
var channelEvents = {};
|
|
15233
|
+
|
|
15234
|
+
var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
15235
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
15236
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
15237
|
+
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");
|
|
15238
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
15239
|
+
};
|
|
15240
|
+
var __classPrivateFieldGet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
15241
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
15242
|
+
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");
|
|
15243
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15244
|
+
};
|
|
15245
|
+
var _a, _ChannelEvents_channelClient, _ChannelEvents_isChannelReady, _ChannelEvents_actionsByClient, _ChannelEvents_getActions, _ChannelEvents_createRegistration, _ChannelEvents_getRegistration, _ChannelEvents_getOrCreateRegistration;
|
|
15246
|
+
Object.defineProperty(channelEvents, "__esModule", { value: true });
|
|
15247
|
+
channelEvents.ChannelEvents = void 0;
|
|
15248
|
+
/**
|
|
15249
|
+
* Channel events creates a event like syntax out of a channel action, allowing multiple events to be triggered
|
|
15250
|
+
* from a single action (normally only one callback can be created per action).
|
|
15251
|
+
*
|
|
15252
|
+
* This Class essentially allows us to multiplex channel actions to multiple callbacks.
|
|
15253
|
+
*/
|
|
15254
|
+
class ChannelEvents {
|
|
15255
|
+
constructor(channelClient) {
|
|
15256
|
+
// eslint-disable-next-line
|
|
15257
|
+
_ChannelEvents_channelClient.set(this, void 0);
|
|
15258
|
+
_ChannelEvents_isChannelReady.set(this, false);
|
|
15259
|
+
_ChannelEvents_getActions.set(this, async () => {
|
|
15260
|
+
const channelClient = await __classPrivateFieldGet$5(this, _ChannelEvents_channelClient, "f");
|
|
15261
|
+
let actions = __classPrivateFieldGet$5(ChannelEvents, _a, "f", _ChannelEvents_actionsByClient).get(channelClient);
|
|
15262
|
+
if (!actions) {
|
|
15263
|
+
actions = {};
|
|
15264
|
+
__classPrivateFieldGet$5(ChannelEvents, _a, "f", _ChannelEvents_actionsByClient).set(channelClient, actions);
|
|
15265
|
+
}
|
|
15266
|
+
return actions;
|
|
15267
|
+
});
|
|
15268
|
+
_ChannelEvents_createRegistration.set(this, (actionId) => {
|
|
15269
|
+
const callbacks = [];
|
|
15270
|
+
let registrationPromise;
|
|
15271
|
+
const onChannelAction = (data) => {
|
|
15272
|
+
callbacks.forEach((callback) => callback(data));
|
|
15273
|
+
};
|
|
15274
|
+
return {
|
|
15275
|
+
callbacks,
|
|
15276
|
+
dispose: async (callback) => {
|
|
15277
|
+
const index = callbacks.indexOf(callback);
|
|
15278
|
+
if (index >= 0) {
|
|
15279
|
+
callbacks.splice(index, 1);
|
|
15280
|
+
if (callbacks.length === 0) {
|
|
15281
|
+
const client = await __classPrivateFieldGet$5(this, _ChannelEvents_channelClient, "f");
|
|
15282
|
+
client.remove(actionId);
|
|
15283
|
+
}
|
|
15284
|
+
}
|
|
15285
|
+
},
|
|
15286
|
+
waitForRegistration: async () => {
|
|
15287
|
+
// Use lazy eval to only setup and register the channel on first attempt.
|
|
15288
|
+
if (!registrationPromise) {
|
|
15289
|
+
registrationPromise = (async () => {
|
|
15290
|
+
const client = await __classPrivateFieldGet$5(this, _ChannelEvents_channelClient, "f");
|
|
15291
|
+
await client.register(actionId, onChannelAction);
|
|
15292
|
+
})();
|
|
15293
|
+
}
|
|
15294
|
+
await registrationPromise;
|
|
15295
|
+
}
|
|
15296
|
+
};
|
|
15297
|
+
});
|
|
15298
|
+
_ChannelEvents_getRegistration.set(this, async (actionId) => {
|
|
15299
|
+
const actions = await __classPrivateFieldGet$5(this, _ChannelEvents_getActions, "f").call(this);
|
|
15300
|
+
return actions[actionId];
|
|
15301
|
+
});
|
|
15302
|
+
_ChannelEvents_getOrCreateRegistration.set(this, async (actionId) => {
|
|
15303
|
+
const actions = await __classPrivateFieldGet$5(this, _ChannelEvents_getActions, "f").call(this);
|
|
15304
|
+
const registration = await __classPrivateFieldGet$5(this, _ChannelEvents_getRegistration, "f").call(this, actionId);
|
|
15305
|
+
if (!registration) {
|
|
15306
|
+
actions[actionId] = __classPrivateFieldGet$5(this, _ChannelEvents_createRegistration, "f").call(this, actionId);
|
|
15307
|
+
}
|
|
15308
|
+
return actions[actionId];
|
|
15309
|
+
});
|
|
15310
|
+
/**
|
|
15311
|
+
* Add a listener for the given channel action.
|
|
15312
|
+
*
|
|
15313
|
+
* This will register a handler for the specified channel action if this is the first time we have requested one, or reuse an existing one if it exists.
|
|
15314
|
+
*
|
|
15315
|
+
* Note, only void channel actions are currently supported.
|
|
15316
|
+
*
|
|
15317
|
+
* @param action Action ID, must match the underlying channel action.
|
|
15318
|
+
* @param callback Callback to be called whenever the action is dispatched.
|
|
15319
|
+
*/
|
|
15320
|
+
this.addListener = async (action, callback) => {
|
|
15321
|
+
const event = await __classPrivateFieldGet$5(this, _ChannelEvents_getOrCreateRegistration, "f").call(this, action);
|
|
15322
|
+
event.callbacks.push(callback);
|
|
15323
|
+
// This ensures we only resolve the subscription once the action is registered
|
|
15324
|
+
await event.waitForRegistration();
|
|
15325
|
+
};
|
|
15326
|
+
/**
|
|
15327
|
+
* Removes a callback associated with a given action if it exists.
|
|
15328
|
+
*
|
|
15329
|
+
* If this callback is the last one associated with the specified action, the underlying channel action registration is
|
|
15330
|
+
* also removed.
|
|
15331
|
+
* @param action Action ID to remove
|
|
15332
|
+
* @param callback Callback to remove.
|
|
15333
|
+
*/
|
|
15334
|
+
this.removeListener = async (action, callback) => {
|
|
15335
|
+
if (!__classPrivateFieldGet$5(this, _ChannelEvents_isChannelReady, "f")) {
|
|
15336
|
+
return;
|
|
15337
|
+
}
|
|
15338
|
+
const registration = await __classPrivateFieldGet$5(this, _ChannelEvents_getRegistration, "f").call(this, action);
|
|
15339
|
+
if (registration) {
|
|
15340
|
+
const event = await __classPrivateFieldGet$5(this, _ChannelEvents_getOrCreateRegistration, "f").call(this, action);
|
|
15341
|
+
await event.dispose(callback);
|
|
15342
|
+
}
|
|
15343
|
+
};
|
|
15344
|
+
__classPrivateFieldSet$5(this, _ChannelEvents_channelClient, channelClient, "f");
|
|
15345
|
+
Promise.resolve(channelClient)
|
|
15346
|
+
.then(() => {
|
|
15347
|
+
__classPrivateFieldSet$5(this, _ChannelEvents_isChannelReady, true, "f");
|
|
15348
|
+
})
|
|
15349
|
+
.catch(() => {
|
|
15350
|
+
// eslint-disable-next-line
|
|
15351
|
+
console.warn('Channel Connection error occurred in channel client. Channel-events registrations will fail.');
|
|
15352
|
+
});
|
|
15353
|
+
}
|
|
15354
|
+
}
|
|
15355
|
+
channelEvents.ChannelEvents = ChannelEvents;
|
|
15356
|
+
_a = ChannelEvents, _ChannelEvents_channelClient = new WeakMap(), _ChannelEvents_isChannelReady = new WeakMap(), _ChannelEvents_getActions = new WeakMap(), _ChannelEvents_createRegistration = new WeakMap(), _ChannelEvents_getRegistration = new WeakMap(), _ChannelEvents_getOrCreateRegistration = new WeakMap();
|
|
15357
|
+
/**
|
|
15358
|
+
* Static map of actions by channel client. This ensures we can reuse the same event and keep track of all its callbacks.
|
|
15359
|
+
*
|
|
15360
|
+
* Weak map will also ensure that when a channel is GC'ed we also tear down the actions/callbacks associated
|
|
15361
|
+
* with it.
|
|
15362
|
+
*/
|
|
15363
|
+
_ChannelEvents_actionsByClient = { value: new WeakMap() };
|
|
15364
|
+
|
|
15209
15365
|
var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
15210
15366
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
15211
15367
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
@@ -15220,12 +15376,13 @@ var __classPrivateFieldGet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
15220
15376
|
var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
15221
15377
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15222
15378
|
};
|
|
15223
|
-
var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory;
|
|
15379
|
+
var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory, _InteropClient_channelEvents;
|
|
15224
15380
|
Object.defineProperty(InteropClient$1, "__esModule", { value: true });
|
|
15225
15381
|
InteropClient$1.InteropClient = void 0;
|
|
15226
15382
|
const base_1$4 = base;
|
|
15227
15383
|
const SessionContextGroupClient_1 = __importDefault$4(SessionContextGroupClient$1);
|
|
15228
15384
|
const utils_1$5 = utils$3;
|
|
15385
|
+
const channel_events_1 = channelEvents;
|
|
15229
15386
|
/**
|
|
15230
15387
|
* The Interop Client API is broken up into two groups:
|
|
15231
15388
|
*
|
|
@@ -15284,13 +15441,43 @@ class InteropClient extends base_1$4.Base {
|
|
|
15284
15441
|
_InteropClient_clientPromise.set(this, void 0);
|
|
15285
15442
|
_InteropClient_sessionContextGroups.set(this, void 0);
|
|
15286
15443
|
_InteropClient_fdc3Factory.set(this, void 0);
|
|
15444
|
+
_InteropClient_channelEvents.set(this, void 0);
|
|
15445
|
+
/*
|
|
15446
|
+
Client APIs
|
|
15447
|
+
*/
|
|
15448
|
+
/**
|
|
15449
|
+
* `addListener` allows the InteropClient to subscribe to events emitted by the connected InteropBroker.
|
|
15450
|
+
* @param type The event type to subscribe to.
|
|
15451
|
+
* @param listener Callback invoked whenever the event occurs.
|
|
15452
|
+
* @returns Promise resolving with void once the listener is registered.
|
|
15453
|
+
*/
|
|
15454
|
+
this.addListener = async (type, listener) => {
|
|
15455
|
+
try {
|
|
15456
|
+
await __classPrivateFieldGet$4(this, _InteropClient_channelEvents, "f").addListener(type, listener);
|
|
15457
|
+
}
|
|
15458
|
+
catch (error) {
|
|
15459
|
+
throw new Error(`An unexpected error occurred when adding a listener to the event ${type}. \n${error.stack}.`);
|
|
15460
|
+
}
|
|
15461
|
+
};
|
|
15462
|
+
/**
|
|
15463
|
+
* `removeListener` removes a registered event listener.
|
|
15464
|
+
* @param type The event type to subscribe to.
|
|
15465
|
+
* @param listener Callback to be removed.
|
|
15466
|
+
* @returns Promise resolving with void even if no callback was found.
|
|
15467
|
+
*/
|
|
15468
|
+
this.removeListener = async (type, listener) => {
|
|
15469
|
+
try {
|
|
15470
|
+
await __classPrivateFieldGet$4(this, _InteropClient_channelEvents, "f").removeListener(type, listener);
|
|
15471
|
+
}
|
|
15472
|
+
catch (error) {
|
|
15473
|
+
throw new Error(`An unexpected error occurred when removing a listener for the event ${type}. \n${error.stack}.`);
|
|
15474
|
+
}
|
|
15475
|
+
};
|
|
15287
15476
|
__classPrivateFieldSet$4(this, _InteropClient_sessionContextGroups, new Map(), "f");
|
|
15288
15477
|
__classPrivateFieldSet$4(this, _InteropClient_clientPromise, clientPromise, "f");
|
|
15289
15478
|
__classPrivateFieldSet$4(this, _InteropClient_fdc3Factory, fdc3Factory, "f");
|
|
15479
|
+
__classPrivateFieldSet$4(this, _InteropClient_channelEvents, new channel_events_1.ChannelEvents(clientPromise), "f");
|
|
15290
15480
|
}
|
|
15291
|
-
/*
|
|
15292
|
-
Client APIs
|
|
15293
|
-
*/
|
|
15294
15481
|
/**
|
|
15295
15482
|
* Sets a context for the context group of the current entity.
|
|
15296
15483
|
*
|
|
@@ -15804,7 +15991,7 @@ class InteropClient extends base_1$4.Base {
|
|
|
15804
15991
|
}
|
|
15805
15992
|
}
|
|
15806
15993
|
InteropClient$1.InteropClient = InteropClient;
|
|
15807
|
-
_InteropClient_clientPromise = new WeakMap(), _InteropClient_sessionContextGroups = new WeakMap(), _InteropClient_fdc3Factory = new WeakMap();
|
|
15994
|
+
_InteropClient_clientPromise = new WeakMap(), _InteropClient_sessionContextGroups = new WeakMap(), _InteropClient_fdc3Factory = new WeakMap(), _InteropClient_channelEvents = new WeakMap();
|
|
15808
15995
|
|
|
15809
15996
|
var overrideCheck$1 = {};
|
|
15810
15997
|
|