@openfin/core 43.100.32 → 43.100.36
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 +132 -0
- package/out/mock-beta.d.ts +132 -0
- package/out/mock-public.d.ts +132 -0
- package/out/stub.d.ts +132 -0
- package/out/stub.js +381 -265
- package/package.json +1 -1
package/out/stub.js
CHANGED
@@ -361,13 +361,13 @@ async function promiseMapSerial(arr, func) {
|
|
361
361
|
}
|
362
362
|
promises.promiseMapSerial = promiseMapSerial;
|
363
363
|
|
364
|
-
var __classPrivateFieldSet$
|
364
|
+
var __classPrivateFieldSet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
365
365
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
366
366
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
367
367
|
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");
|
368
368
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
369
369
|
};
|
370
|
-
var __classPrivateFieldGet$
|
370
|
+
var __classPrivateFieldGet$i = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
371
371
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
372
372
|
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");
|
373
373
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -452,7 +452,7 @@ class EmitterBase extends Base {
|
|
452
452
|
this.emit = (eventType, payload, ...args) => {
|
453
453
|
return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
|
454
454
|
};
|
455
|
-
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$
|
455
|
+
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
|
456
456
|
/**
|
457
457
|
* Cleans up after removal of a listener, e.g. deleting any lingering deregistration handlers for a
|
458
458
|
* `once` subscription.
|
@@ -462,14 +462,14 @@ class EmitterBase extends Base {
|
|
462
462
|
* which would involve less "magic," but would be more-vulnerable to accidental re-introduction of a leak.
|
463
463
|
*/
|
464
464
|
this.cleanUpRemovedListener = (eventType, listener) => {
|
465
|
-
const deregister = __classPrivateFieldGet$
|
465
|
+
const deregister = __classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").get(listener);
|
466
466
|
if (deregister) {
|
467
|
-
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$
|
467
|
+
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
|
468
468
|
emitter.removeListener(eventType, deregister);
|
469
469
|
}
|
470
470
|
};
|
471
471
|
this.getOrCreateEmitter = () => {
|
472
|
-
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$
|
472
|
+
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
|
473
473
|
if (!emitter.listeners('removeListener').includes(this.cleanUpRemovedListener)) {
|
474
474
|
emitter.on('removeListener', this.cleanUpRemovedListener);
|
475
475
|
}
|
@@ -511,8 +511,8 @@ class EmitterBase extends Base {
|
|
511
511
|
// This will only be reached if unsubscribe from event that does not exist but do not want to error here
|
512
512
|
return Promise.resolve();
|
513
513
|
};
|
514
|
-
__classPrivateFieldSet$
|
515
|
-
__classPrivateFieldSet$
|
514
|
+
__classPrivateFieldSet$h(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
|
515
|
+
__classPrivateFieldSet$h(this, _EmitterBase_deregisterOnceListeners, new WeakMap(), "f");
|
516
516
|
this.listeners = (event) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(event) : [];
|
517
517
|
}
|
518
518
|
/**
|
@@ -541,7 +541,7 @@ class EmitterBase extends Base {
|
|
541
541
|
*/
|
542
542
|
async once(eventType, listener, options) {
|
543
543
|
const deregister = () => this.deregisterEventListener(eventType);
|
544
|
-
__classPrivateFieldGet$
|
544
|
+
__classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
|
545
545
|
await this.registerEventListener(eventType, options, (emitter) => {
|
546
546
|
emitter.once(eventType, deregister);
|
547
547
|
emitter.once(eventType, listener);
|
@@ -572,7 +572,7 @@ class EmitterBase extends Base {
|
|
572
572
|
*/
|
573
573
|
async prependOnceListener(eventType, listener, options) {
|
574
574
|
const deregister = () => this.deregisterEventListener(eventType);
|
575
|
-
__classPrivateFieldGet$
|
575
|
+
__classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
|
576
576
|
await this.registerEventListener(eventType, options, (emitter) => {
|
577
577
|
emitter.prependOnceListener(eventType, listener);
|
578
578
|
emitter.once(eventType, deregister);
|
@@ -632,7 +632,7 @@ class EmitterBase extends Base {
|
|
632
632
|
}
|
633
633
|
deleteEmitterIfNothingRegistered(emitter) {
|
634
634
|
if (emitter.eventNames().every((type) => type === 'removeListener')) {
|
635
|
-
this.wire.eventAggregator.delete(__classPrivateFieldGet$
|
635
|
+
this.wire.eventAggregator.delete(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
|
636
636
|
}
|
637
637
|
}
|
638
638
|
}
|
@@ -1083,8 +1083,8 @@ var main = {};
|
|
1083
1083
|
|
1084
1084
|
Object.defineProperty(main, "__esModule", { value: true });
|
1085
1085
|
main.WebContents = void 0;
|
1086
|
-
const base_1$
|
1087
|
-
class WebContents extends base_1$
|
1086
|
+
const base_1$n = base;
|
1087
|
+
class WebContents extends base_1$n.EmitterBase {
|
1088
1088
|
/**
|
1089
1089
|
* @param identity The identity of the {@link OpenFin.WebContentsEvents WebContents}.
|
1090
1090
|
* @param entityType The type of the {@link OpenFin.WebContentsEvents WebContents}.
|
@@ -5432,7 +5432,7 @@ function requireWindow () {
|
|
5432
5432
|
*/
|
5433
5433
|
Object.defineProperty(system, "__esModule", { value: true });
|
5434
5434
|
system.System = void 0;
|
5435
|
-
const base_1$
|
5435
|
+
const base_1$m = base;
|
5436
5436
|
const transport_errors_1$5 = transportErrors;
|
5437
5437
|
const window_1 = requireWindow();
|
5438
5438
|
const events_1$6 = require$$0;
|
@@ -5442,7 +5442,7 @@ const events_1$6 = require$$0;
|
|
5442
5442
|
* clearing the cache and exiting the runtime as well as listen to {@link OpenFin.SystemEvents system events}.
|
5443
5443
|
*
|
5444
5444
|
*/
|
5445
|
-
class System extends base_1$
|
5445
|
+
class System extends base_1$m.EmitterBase {
|
5446
5446
|
/**
|
5447
5447
|
* @internal
|
5448
5448
|
*/
|
@@ -7332,6 +7332,12 @@ class System extends base_1$l.EmitterBase {
|
|
7332
7332
|
async serveAsset(options) {
|
7333
7333
|
return (await this.wire.sendAction('serve-asset', { options })).payload.data;
|
7334
7334
|
}
|
7335
|
+
/**
|
7336
|
+
* Launches the Log Uploader. Full documentation can be found [here](https://resources.here.io/docs/core/develop/debug/log-uploader/).
|
7337
|
+
*/
|
7338
|
+
async launchLogUploader(options) {
|
7339
|
+
return (await this.wire.sendAction('launch-log-uploader', { options })).payload.data;
|
7340
|
+
}
|
7335
7341
|
}
|
7336
7342
|
system.System = System;
|
7337
7343
|
|
@@ -7753,12 +7759,12 @@ class ChannelError extends Error {
|
|
7753
7759
|
}
|
7754
7760
|
channelError.ChannelError = ChannelError;
|
7755
7761
|
|
7756
|
-
var __classPrivateFieldGet$
|
7762
|
+
var __classPrivateFieldGet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
7757
7763
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
7758
7764
|
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");
|
7759
7765
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
7760
7766
|
};
|
7761
|
-
var __classPrivateFieldSet$
|
7767
|
+
var __classPrivateFieldSet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
7762
7768
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
7763
7769
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
7764
7770
|
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");
|
@@ -7802,7 +7808,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7802
7808
|
static closeChannelByEndpointId(id) {
|
7803
7809
|
const channel = channelClientsByEndpointId.get(id);
|
7804
7810
|
if (channel) {
|
7805
|
-
__classPrivateFieldGet$
|
7811
|
+
__classPrivateFieldGet$h(channel, _ChannelClient_close, "f").call(channel);
|
7806
7812
|
}
|
7807
7813
|
}
|
7808
7814
|
/**
|
@@ -7813,7 +7819,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7813
7819
|
for (const channelClient of channelClientsByEndpointId.values()) {
|
7814
7820
|
if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
|
7815
7821
|
channelClient.disconnectListener(eventPayload);
|
7816
|
-
__classPrivateFieldGet$
|
7822
|
+
__classPrivateFieldGet$h(channelClient, _ChannelClient_close, "f").call(channelClient);
|
7817
7823
|
}
|
7818
7824
|
}
|
7819
7825
|
}
|
@@ -7828,12 +7834,12 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7828
7834
|
this.processAction = (action, payload, senderIdentity) => super.processAction(action, payload, senderIdentity);
|
7829
7835
|
_ChannelClient_close.set(this, () => {
|
7830
7836
|
channelClientsByEndpointId.delete(this.endpointId);
|
7831
|
-
__classPrivateFieldGet$
|
7837
|
+
__classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").close();
|
7832
7838
|
});
|
7833
|
-
__classPrivateFieldSet$
|
7839
|
+
__classPrivateFieldSet$g(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
|
7834
7840
|
this.disconnectListener = () => undefined;
|
7835
7841
|
this.endpointId = routingInfo.endpointId;
|
7836
|
-
__classPrivateFieldSet$
|
7842
|
+
__classPrivateFieldSet$g(this, _ChannelClient_strategy, strategy, "f");
|
7837
7843
|
channelClientsByEndpointId.set(this.endpointId, this);
|
7838
7844
|
strategy.receive(this.processAction);
|
7839
7845
|
}
|
@@ -7841,7 +7847,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7841
7847
|
* a read-only provider identity
|
7842
7848
|
*/
|
7843
7849
|
get providerIdentity() {
|
7844
|
-
const protectedObj = __classPrivateFieldGet$
|
7850
|
+
const protectedObj = __classPrivateFieldGet$h(this, _ChannelClient_protectedObj, "f");
|
7845
7851
|
return protectedObj.providerIdentity;
|
7846
7852
|
}
|
7847
7853
|
/**
|
@@ -7870,9 +7876,9 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7870
7876
|
* ```
|
7871
7877
|
*/
|
7872
7878
|
async dispatch(action, payload) {
|
7873
|
-
if (__classPrivateFieldGet$
|
7879
|
+
if (__classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
|
7874
7880
|
const callSites = transport_errors_1$2.RuntimeError.getCallSite();
|
7875
|
-
return __classPrivateFieldGet$
|
7881
|
+
return __classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
|
7876
7882
|
throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
|
7877
7883
|
});
|
7878
7884
|
}
|
@@ -7924,10 +7930,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7924
7930
|
*/
|
7925
7931
|
async disconnect() {
|
7926
7932
|
await this.sendDisconnectAction();
|
7927
|
-
__classPrivateFieldGet$
|
7933
|
+
__classPrivateFieldGet$h(this, _ChannelClient_close, "f").call(this);
|
7928
7934
|
}
|
7929
7935
|
async sendDisconnectAction() {
|
7930
|
-
const protectedObj = __classPrivateFieldGet$
|
7936
|
+
const protectedObj = __classPrivateFieldGet$h(this, _ChannelClient_protectedObj, "f");
|
7931
7937
|
await protectedObj.close();
|
7932
7938
|
}
|
7933
7939
|
/**
|
@@ -7960,13 +7966,13 @@ exhaustive.exhaustiveCheck = exhaustiveCheck;
|
|
7960
7966
|
|
7961
7967
|
var strategy$3 = {};
|
7962
7968
|
|
7963
|
-
var __classPrivateFieldSet$
|
7969
|
+
var __classPrivateFieldSet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
7964
7970
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
7965
7971
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
7966
7972
|
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");
|
7967
7973
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
7968
7974
|
};
|
7969
|
-
var __classPrivateFieldGet$
|
7975
|
+
var __classPrivateFieldGet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
7970
7976
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
7971
7977
|
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");
|
7972
7978
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -7991,7 +7997,7 @@ class ClassicStrategy {
|
|
7991
7997
|
// connection problems occur
|
7992
7998
|
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
|
7993
7999
|
this.send = async (endpointId, action, payload) => {
|
7994
|
-
const to = __classPrivateFieldGet$
|
8000
|
+
const to = __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
7995
8001
|
if (!to) {
|
7996
8002
|
throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
|
7997
8003
|
}
|
@@ -8003,13 +8009,13 @@ class ClassicStrategy {
|
|
8003
8009
|
}
|
8004
8010
|
delete cleanId.isLocalEndpointId;
|
8005
8011
|
// grab the promise before awaiting it to save in our pending messages map
|
8006
|
-
const p = __classPrivateFieldGet$
|
8012
|
+
const p = __classPrivateFieldGet$g(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
|
8007
8013
|
...cleanId,
|
8008
8014
|
providerIdentity: this.providerIdentity,
|
8009
8015
|
action,
|
8010
8016
|
payload
|
8011
8017
|
});
|
8012
|
-
__classPrivateFieldGet$
|
8018
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
|
8013
8019
|
const raw = await p
|
8014
8020
|
.catch((error) => {
|
8015
8021
|
if ('cause' in error) {
|
@@ -8019,16 +8025,16 @@ class ClassicStrategy {
|
|
8019
8025
|
})
|
8020
8026
|
.finally(() => {
|
8021
8027
|
// clean up the pending promise
|
8022
|
-
__classPrivateFieldGet$
|
8028
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
|
8023
8029
|
});
|
8024
8030
|
return raw.payload.data.result;
|
8025
8031
|
};
|
8026
8032
|
this.close = async () => {
|
8027
8033
|
this.messageReceiver.removeEndpoint(this.providerIdentity.channelId, this.endpointId);
|
8028
|
-
[...__classPrivateFieldGet$
|
8029
|
-
__classPrivateFieldSet$
|
8034
|
+
[...__classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
|
8035
|
+
__classPrivateFieldSet$f(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
|
8030
8036
|
};
|
8031
|
-
__classPrivateFieldSet$
|
8037
|
+
__classPrivateFieldSet$f(this, _ClassicStrategy_wire, wire, "f");
|
8032
8038
|
}
|
8033
8039
|
onEndpointDisconnect(endpointId, listener) {
|
8034
8040
|
// Never fires for 'classic'.
|
@@ -8037,20 +8043,20 @@ class ClassicStrategy {
|
|
8037
8043
|
this.messageReceiver.addEndpoint(listener, this.providerIdentity.channelId, this.endpointId);
|
8038
8044
|
}
|
8039
8045
|
async closeEndpoint(endpointId) {
|
8040
|
-
const id = __classPrivateFieldGet$
|
8041
|
-
__classPrivateFieldGet$
|
8042
|
-
const pendingSet = __classPrivateFieldGet$
|
8046
|
+
const id = __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
8047
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
|
8048
|
+
const pendingSet = __classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
|
8043
8049
|
pendingSet?.forEach((p) => {
|
8044
8050
|
const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
|
8045
8051
|
p.cancel(new Error(errorMsg));
|
8046
8052
|
});
|
8047
8053
|
}
|
8048
8054
|
isEndpointConnected(endpointId) {
|
8049
|
-
return __classPrivateFieldGet$
|
8055
|
+
return __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
|
8050
8056
|
}
|
8051
8057
|
addEndpoint(endpointId, payload) {
|
8052
|
-
__classPrivateFieldGet$
|
8053
|
-
__classPrivateFieldGet$
|
8058
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
|
8059
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
|
8054
8060
|
}
|
8055
8061
|
isValidEndpointPayload(payload) {
|
8056
8062
|
return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
|
@@ -8085,12 +8091,12 @@ function errorToPOJO(error) {
|
|
8085
8091
|
}
|
8086
8092
|
errors.errorToPOJO = errorToPOJO;
|
8087
8093
|
|
8088
|
-
var __classPrivateFieldGet$
|
8094
|
+
var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8089
8095
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8090
8096
|
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");
|
8091
8097
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
8092
8098
|
};
|
8093
|
-
var __classPrivateFieldSet$
|
8099
|
+
var __classPrivateFieldSet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8094
8100
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8095
8101
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8096
8102
|
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");
|
@@ -8125,8 +8131,8 @@ class RTCEndpoint {
|
|
8125
8131
|
if (this.rtc.rtcClient.connectionState !== 'connected') {
|
8126
8132
|
this.rtc.rtcClient.removeEventListener('connectionstatechange', this.connectionStateChangeHandler);
|
8127
8133
|
this.close();
|
8128
|
-
if (__classPrivateFieldGet$
|
8129
|
-
__classPrivateFieldGet$
|
8134
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
|
8135
|
+
__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
8130
8136
|
}
|
8131
8137
|
}
|
8132
8138
|
};
|
@@ -8174,9 +8180,9 @@ class RTCEndpoint {
|
|
8174
8180
|
data = new TextDecoder().decode(e.data);
|
8175
8181
|
}
|
8176
8182
|
const { messageId, action, payload } = JSON.parse(data);
|
8177
|
-
if (__classPrivateFieldGet$
|
8183
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f")) {
|
8178
8184
|
try {
|
8179
|
-
const res = await __classPrivateFieldGet$
|
8185
|
+
const res = await __classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
|
8180
8186
|
this.rtc.channels.response.send(JSON.stringify({
|
8181
8187
|
messageId,
|
8182
8188
|
payload: res,
|
@@ -8210,25 +8216,25 @@ class RTCEndpoint {
|
|
8210
8216
|
datachannel.onclose = (e) => {
|
8211
8217
|
[...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.')));
|
8212
8218
|
this.close();
|
8213
|
-
if (__classPrivateFieldGet$
|
8214
|
-
__classPrivateFieldGet$
|
8219
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
|
8220
|
+
__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
8215
8221
|
}
|
8216
8222
|
};
|
8217
8223
|
});
|
8218
8224
|
}
|
8219
8225
|
onDisconnect(listener) {
|
8220
|
-
if (!__classPrivateFieldGet$
|
8221
|
-
__classPrivateFieldSet$
|
8226
|
+
if (!__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
|
8227
|
+
__classPrivateFieldSet$e(this, _RTCEndpoint_disconnectListener, listener, "f");
|
8222
8228
|
}
|
8223
8229
|
else {
|
8224
8230
|
throw new Error('RTCEndpoint disconnectListener cannot be set twice.');
|
8225
8231
|
}
|
8226
8232
|
}
|
8227
8233
|
receive(listener) {
|
8228
|
-
if (__classPrivateFieldGet$
|
8234
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f")) {
|
8229
8235
|
throw new Error('You have already set a listener for this RTC Endpoint.');
|
8230
8236
|
}
|
8231
|
-
__classPrivateFieldSet$
|
8237
|
+
__classPrivateFieldSet$e(this, _RTCEndpoint_processAction, listener, "f");
|
8232
8238
|
}
|
8233
8239
|
get connected() {
|
8234
8240
|
return this.rtc.rtcClient.connectionState === 'connected';
|
@@ -8239,12 +8245,12 @@ _RTCEndpoint_processAction = new WeakMap(), _RTCEndpoint_disconnectListener = ne
|
|
8239
8245
|
|
8240
8246
|
var strategy$1 = {};
|
8241
8247
|
|
8242
|
-
var __classPrivateFieldGet$
|
8248
|
+
var __classPrivateFieldGet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8243
8249
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8244
8250
|
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");
|
8245
8251
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
8246
8252
|
};
|
8247
|
-
var __classPrivateFieldSet$
|
8253
|
+
var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8248
8254
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8249
8255
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8250
8256
|
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");
|
@@ -8265,11 +8271,11 @@ class EndpointStrategy {
|
|
8265
8271
|
return this.getEndpointById(endpointId).send(action, payload);
|
8266
8272
|
};
|
8267
8273
|
this.close = async () => {
|
8268
|
-
if (__classPrivateFieldGet$
|
8269
|
-
__classPrivateFieldGet$
|
8270
|
-
__classPrivateFieldSet$
|
8274
|
+
if (__classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f")) {
|
8275
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
|
8276
|
+
__classPrivateFieldSet$d(this, _EndpointStrategy_endpointMap, new Map(), "f");
|
8271
8277
|
}
|
8272
|
-
__classPrivateFieldSet$
|
8278
|
+
__classPrivateFieldSet$d(this, _EndpointStrategy_connected, false, "f");
|
8273
8279
|
};
|
8274
8280
|
this.isValidEndpointPayload = validateEndpoint;
|
8275
8281
|
}
|
@@ -8277,39 +8283,39 @@ class EndpointStrategy {
|
|
8277
8283
|
this.getEndpointById(endpointId).onDisconnect(listener);
|
8278
8284
|
}
|
8279
8285
|
receive(listener) {
|
8280
|
-
if (__classPrivateFieldGet$
|
8286
|
+
if (__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")) {
|
8281
8287
|
throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);
|
8282
8288
|
}
|
8283
|
-
__classPrivateFieldSet$
|
8289
|
+
__classPrivateFieldSet$d(this, _EndpointStrategy_processAction, listener, "f");
|
8284
8290
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
8285
|
-
__classPrivateFieldGet$
|
8291
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")));
|
8286
8292
|
}
|
8287
8293
|
getEndpointById(endpointId) {
|
8288
|
-
const endpoint = __classPrivateFieldGet$
|
8294
|
+
const endpoint = __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
|
8289
8295
|
if (!endpoint) {
|
8290
8296
|
throw new Error(`Client with endpoint id ${endpointId} is not connected`);
|
8291
8297
|
}
|
8292
8298
|
return endpoint;
|
8293
8299
|
}
|
8294
8300
|
get connected() {
|
8295
|
-
return __classPrivateFieldGet$
|
8301
|
+
return __classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f");
|
8296
8302
|
}
|
8297
8303
|
isEndpointConnected(endpointId) {
|
8298
|
-
return __classPrivateFieldGet$
|
8304
|
+
return __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
|
8299
8305
|
}
|
8300
8306
|
addEndpoint(endpointId, payload) {
|
8301
|
-
if (!__classPrivateFieldGet$
|
8307
|
+
if (!__classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f")) {
|
8302
8308
|
console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);
|
8303
8309
|
return;
|
8304
8310
|
}
|
8305
8311
|
const clientStrat = new this.EndpointType(payload);
|
8306
|
-
if (__classPrivateFieldGet$
|
8307
|
-
clientStrat.receive(__classPrivateFieldGet$
|
8312
|
+
if (__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")) {
|
8313
|
+
clientStrat.receive(__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f"));
|
8308
8314
|
}
|
8309
|
-
__classPrivateFieldGet$
|
8315
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
|
8310
8316
|
}
|
8311
8317
|
async closeEndpoint(endpointId) {
|
8312
|
-
__classPrivateFieldGet$
|
8318
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
|
8313
8319
|
}
|
8314
8320
|
}
|
8315
8321
|
strategy$1.EndpointStrategy = EndpointStrategy;
|
@@ -8336,11 +8342,11 @@ var iceManager = {};
|
|
8336
8342
|
|
8337
8343
|
Object.defineProperty(iceManager, "__esModule", { value: true });
|
8338
8344
|
iceManager.RTCICEManager = void 0;
|
8339
|
-
const base_1$
|
8345
|
+
const base_1$l = base;
|
8340
8346
|
/*
|
8341
8347
|
Singleton that facilitates Offer and Answer exchange required for establishing RTC connections.
|
8342
8348
|
*/
|
8343
|
-
class RTCICEManager extends base_1$
|
8349
|
+
class RTCICEManager extends base_1$l.EmitterBase {
|
8344
8350
|
constructor(wire) {
|
8345
8351
|
super(wire, 'channel');
|
8346
8352
|
this.ensureChannelOpened = (channel) => {
|
@@ -8491,12 +8497,12 @@ function runtimeUuidMeetsMinimumRuntimeVersion(runtimeUuid, minVersion) {
|
|
8491
8497
|
}
|
8492
8498
|
runtimeVersioning.runtimeUuidMeetsMinimumRuntimeVersion = runtimeUuidMeetsMinimumRuntimeVersion;
|
8493
8499
|
|
8494
|
-
var __classPrivateFieldGet$
|
8500
|
+
var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8495
8501
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8496
8502
|
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");
|
8497
8503
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
8498
8504
|
};
|
8499
|
-
var __classPrivateFieldSet$
|
8505
|
+
var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8500
8506
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8501
8507
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8502
8508
|
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");
|
@@ -8540,19 +8546,19 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8540
8546
|
* a read-only array containing all the identities of connecting clients.
|
8541
8547
|
*/
|
8542
8548
|
get connections() {
|
8543
|
-
return [...__classPrivateFieldGet$
|
8549
|
+
return [...__classPrivateFieldGet$d(this, _ChannelProvider_connections, "f")];
|
8544
8550
|
}
|
8545
8551
|
static handleClientDisconnection(channel, payload) {
|
8546
8552
|
if (payload?.endpointId) {
|
8547
8553
|
const { uuid, name, endpointId, isLocalEndpointId } = payload;
|
8548
|
-
__classPrivateFieldGet$
|
8554
|
+
__classPrivateFieldGet$d(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
|
8549
8555
|
}
|
8550
8556
|
else {
|
8551
8557
|
// this is here to support older runtimes that did not have endpointId
|
8552
8558
|
const multipleRemoves = channel.connections.filter((identity) => {
|
8553
8559
|
return identity.uuid === payload.uuid && identity.name === payload.name;
|
8554
8560
|
});
|
8555
|
-
multipleRemoves.forEach(__classPrivateFieldGet$
|
8561
|
+
multipleRemoves.forEach(__classPrivateFieldGet$d(channel, _ChannelProvider_removeEndpoint, "f"));
|
8556
8562
|
}
|
8557
8563
|
channel.disconnectListener(payload);
|
8558
8564
|
}
|
@@ -8569,8 +8575,8 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8569
8575
|
_ChannelProvider_strategy.set(this, void 0);
|
8570
8576
|
_ChannelProvider_removeEndpoint.set(this, (identity) => {
|
8571
8577
|
const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
|
8572
|
-
__classPrivateFieldGet$
|
8573
|
-
__classPrivateFieldSet$
|
8578
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
|
8579
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_connections, remainingConnections, "f");
|
8574
8580
|
});
|
8575
8581
|
// Must be bound.
|
8576
8582
|
this.processAction = async (action, payload, senderIdentity) => {
|
@@ -8584,17 +8590,17 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8584
8590
|
return super.processAction(action, payload, senderIdentity);
|
8585
8591
|
};
|
8586
8592
|
_ChannelProvider_close.set(this, () => {
|
8587
|
-
__classPrivateFieldGet$
|
8593
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").close();
|
8588
8594
|
const remove = ChannelProvider.removalMap.get(this);
|
8589
8595
|
if (remove) {
|
8590
8596
|
remove();
|
8591
8597
|
}
|
8592
8598
|
});
|
8593
|
-
__classPrivateFieldSet$
|
8599
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
|
8594
8600
|
this.connectListener = () => undefined;
|
8595
8601
|
this.disconnectListener = () => undefined;
|
8596
|
-
__classPrivateFieldSet$
|
8597
|
-
__classPrivateFieldSet$
|
8602
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_connections, [], "f");
|
8603
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_strategy, strategy, "f");
|
8598
8604
|
strategy.receive(this.processAction);
|
8599
8605
|
}
|
8600
8606
|
/**
|
@@ -8625,16 +8631,16 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8625
8631
|
*/
|
8626
8632
|
dispatch(to, action, payload) {
|
8627
8633
|
const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
|
8628
|
-
if (endpointId && __classPrivateFieldGet$
|
8634
|
+
if (endpointId && __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
|
8629
8635
|
const callSites = transport_errors_1$1.RuntimeError.getCallSite();
|
8630
|
-
return __classPrivateFieldGet$
|
8636
|
+
return __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
|
8631
8637
|
throw new channel_error_1.ChannelError(e, action, payload, callSites);
|
8632
8638
|
});
|
8633
8639
|
}
|
8634
8640
|
return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
|
8635
8641
|
}
|
8636
8642
|
async processConnection(senderId, payload) {
|
8637
|
-
__classPrivateFieldGet$
|
8643
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_connections, "f").push(senderId);
|
8638
8644
|
return this.connectListener(senderId, payload);
|
8639
8645
|
}
|
8640
8646
|
/**
|
@@ -8657,7 +8663,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8657
8663
|
* ```
|
8658
8664
|
*/
|
8659
8665
|
publish(action, payload) {
|
8660
|
-
return this.connections.map((to) => __classPrivateFieldGet$
|
8666
|
+
return this.connections.map((to) => __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
|
8661
8667
|
}
|
8662
8668
|
/**
|
8663
8669
|
* Register a listener that is called on every new client connection.
|
@@ -8731,11 +8737,11 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8731
8737
|
* ```
|
8732
8738
|
*/
|
8733
8739
|
async destroy() {
|
8734
|
-
const protectedObj = __classPrivateFieldGet$
|
8740
|
+
const protectedObj = __classPrivateFieldGet$d(this, _ChannelProvider_protectedObj, "f");
|
8735
8741
|
protectedObj.providerIdentity;
|
8736
|
-
__classPrivateFieldSet$
|
8742
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_connections, [], "f");
|
8737
8743
|
await protectedObj.close();
|
8738
|
-
__classPrivateFieldGet$
|
8744
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_close, "f").call(this);
|
8739
8745
|
}
|
8740
8746
|
/**
|
8741
8747
|
* Returns an array with info on every Client connected to the Provider
|
@@ -8805,7 +8811,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8805
8811
|
getEndpointIdForOpenFinId(clientIdentity, action) {
|
8806
8812
|
const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
|
8807
8813
|
if (matchingConnections.length >= 2) {
|
8808
|
-
const protectedObj = __classPrivateFieldGet$
|
8814
|
+
const protectedObj = __classPrivateFieldGet$d(this, _ChannelProvider_protectedObj, "f");
|
8809
8815
|
const { uuid, name } = clientIdentity;
|
8810
8816
|
const providerUuid = protectedObj?.providerIdentity.uuid;
|
8811
8817
|
const providerName = protectedObj?.providerIdentity.name;
|
@@ -8841,14 +8847,14 @@ var messageReceiver = {};
|
|
8841
8847
|
Object.defineProperty(messageReceiver, "__esModule", { value: true });
|
8842
8848
|
messageReceiver.MessageReceiver = void 0;
|
8843
8849
|
const client_1$1 = client;
|
8844
|
-
const base_1$
|
8850
|
+
const base_1$k = base;
|
8845
8851
|
const errors_1$1 = errors;
|
8846
8852
|
/*
|
8847
8853
|
This is a singleton (per fin object) tasked with routing messages coming off the ipc to the correct endpoint.
|
8848
8854
|
It needs to be a singleton because there can only be one per wire. It tracks both clients and providers' processAction passed in via the strategy.
|
8849
8855
|
If functionality is not about receiving messages, it does not belong here.
|
8850
8856
|
*/
|
8851
|
-
class MessageReceiver extends base_1$
|
8857
|
+
class MessageReceiver extends base_1$k.Base {
|
8852
8858
|
constructor(wire) {
|
8853
8859
|
super(wire);
|
8854
8860
|
this.onmessage = (msg) => {
|
@@ -9017,13 +9023,13 @@ class CombinedStrategy {
|
|
9017
9023
|
}
|
9018
9024
|
strategy.default = CombinedStrategy;
|
9019
9025
|
|
9020
|
-
var __classPrivateFieldSet$
|
9026
|
+
var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
9021
9027
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
9022
9028
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
9023
9029
|
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");
|
9024
9030
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
9025
9031
|
};
|
9026
|
-
var __classPrivateFieldGet$
|
9032
|
+
var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
9027
9033
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
9028
9034
|
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");
|
9029
9035
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -9035,7 +9041,7 @@ var _ConnectionManager_messageReceiver, _ConnectionManager_rtcConnectionManager;
|
|
9035
9041
|
Object.defineProperty(connectionManager, "__esModule", { value: true });
|
9036
9042
|
connectionManager.ConnectionManager = void 0;
|
9037
9043
|
const exhaustive_1 = exhaustive;
|
9038
|
-
const base_1$
|
9044
|
+
const base_1$j = base;
|
9039
9045
|
const strategy_1 = strategy$3;
|
9040
9046
|
const strategy_2 = strategy$2;
|
9041
9047
|
const ice_manager_1 = iceManager;
|
@@ -9043,7 +9049,7 @@ const provider_1$1 = provider;
|
|
9043
9049
|
const message_receiver_1 = messageReceiver;
|
9044
9050
|
const protocol_manager_1 = protocolManager;
|
9045
9051
|
const strategy_3 = __importDefault$5(strategy);
|
9046
|
-
class ConnectionManager extends base_1$
|
9052
|
+
class ConnectionManager extends base_1$j.Base {
|
9047
9053
|
static getProtocolOptionsFromStrings(protocols) {
|
9048
9054
|
return protocols.map((protocol) => {
|
9049
9055
|
switch (protocol) {
|
@@ -9072,8 +9078,8 @@ class ConnectionManager extends base_1$i.Base {
|
|
9072
9078
|
};
|
9073
9079
|
this.providerMap = new Map();
|
9074
9080
|
this.protocolManager = new protocol_manager_1.ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
|
9075
|
-
__classPrivateFieldSet$
|
9076
|
-
__classPrivateFieldSet$
|
9081
|
+
__classPrivateFieldSet$b(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
|
9082
|
+
__classPrivateFieldSet$b(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
|
9077
9083
|
wire.registerMessageHandler(this.onmessage.bind(this));
|
9078
9084
|
}
|
9079
9085
|
createProvider(options, providerIdentity) {
|
@@ -9084,7 +9090,7 @@ class ConnectionManager extends base_1$i.Base {
|
|
9084
9090
|
case 'rtc':
|
9085
9091
|
return new strategy_2.RTCStrategy();
|
9086
9092
|
case 'classic':
|
9087
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
9093
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f"),
|
9088
9094
|
// Providers do not have an endpointId, use channelId as endpointId in the strategy.
|
9089
9095
|
providerIdentity.channelId, providerIdentity);
|
9090
9096
|
default:
|
@@ -9120,7 +9126,7 @@ class ConnectionManager extends base_1$i.Base {
|
|
9120
9126
|
const supportedProtocols = await Promise.all(protocols.map(async (type) => {
|
9121
9127
|
switch (type) {
|
9122
9128
|
case 'rtc': {
|
9123
|
-
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$
|
9129
|
+
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
|
9124
9130
|
rtcPacket = { rtcClient, channels, channelsOpened };
|
9125
9131
|
return {
|
9126
9132
|
type: 'rtc',
|
@@ -9147,18 +9153,18 @@ class ConnectionManager extends base_1$i.Base {
|
|
9147
9153
|
routingInfo.endpointId = this.wire.environment.getNextMessageId();
|
9148
9154
|
// For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
|
9149
9155
|
// clients that are in the same context as the newly-connected client.
|
9150
|
-
__classPrivateFieldGet$
|
9156
|
+
__classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
|
9151
9157
|
}
|
9152
9158
|
const answer = routingInfo.answer ?? {
|
9153
9159
|
supportedProtocols: [{ type: 'classic', version: 1 }]
|
9154
9160
|
};
|
9155
9161
|
const createStrategyFromAnswer = async (protocol) => {
|
9156
9162
|
if (protocol.type === 'rtc' && rtcPacket) {
|
9157
|
-
await __classPrivateFieldGet$
|
9163
|
+
await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
|
9158
9164
|
return new strategy_2.RTCStrategy();
|
9159
9165
|
}
|
9160
9166
|
if (protocol.type === 'classic') {
|
9161
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
9167
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
|
9162
9168
|
}
|
9163
9169
|
return null;
|
9164
9170
|
};
|
@@ -9226,7 +9232,7 @@ class ConnectionManager extends base_1$i.Base {
|
|
9226
9232
|
clientAnswer = await overlappingProtocols.reduce(async (accumP, protocolToUse) => {
|
9227
9233
|
const answer = await accumP;
|
9228
9234
|
if (protocolToUse.type === 'rtc') {
|
9229
|
-
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$
|
9235
|
+
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
|
9230
9236
|
answer.supportedProtocols.push({
|
9231
9237
|
type: 'rtc',
|
9232
9238
|
version: strategy_2.RTCInfo.version,
|
@@ -9274,13 +9280,13 @@ _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnec
|
|
9274
9280
|
*
|
9275
9281
|
* @packageDocumentation
|
9276
9282
|
*/
|
9277
|
-
var __classPrivateFieldSet$
|
9283
|
+
var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
9278
9284
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
9279
9285
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
9280
9286
|
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");
|
9281
9287
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
9282
9288
|
};
|
9283
|
-
var __classPrivateFieldGet$
|
9289
|
+
var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
9284
9290
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
9285
9291
|
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");
|
9286
9292
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -9290,8 +9296,8 @@ Object.defineProperty(channel$1, "__esModule", { value: true });
|
|
9290
9296
|
channel$1.Channel = void 0;
|
9291
9297
|
/* eslint-disable no-console */
|
9292
9298
|
const events_1$5 = require$$0;
|
9293
|
-
const lazy_1$
|
9294
|
-
const base_1$
|
9299
|
+
const lazy_1$3 = lazy;
|
9300
|
+
const base_1$i = base;
|
9295
9301
|
const client_1 = client;
|
9296
9302
|
const connection_manager_1 = connectionManager;
|
9297
9303
|
const provider_1 = provider;
|
@@ -9322,7 +9328,7 @@ function retryDelay(count) {
|
|
9322
9328
|
* * {@link Channel.onChannelConnect onChannelConnect(listener)}
|
9323
9329
|
* * {@link Channel.onChannelDisconnect onChannelDisconnect(listener)}
|
9324
9330
|
*/
|
9325
|
-
class Channel extends base_1$
|
9331
|
+
class Channel extends base_1$i.EmitterBase {
|
9326
9332
|
/**
|
9327
9333
|
* @internal
|
9328
9334
|
*/
|
@@ -9331,17 +9337,17 @@ class Channel extends base_1$h.EmitterBase {
|
|
9331
9337
|
_Channel_connectionManager.set(this, void 0);
|
9332
9338
|
_Channel_internalEmitter.set(this, new events_1$5.EventEmitter());
|
9333
9339
|
// OpenFin API has not been injected at construction time, *must* wait for API to be ready.
|
9334
|
-
_Channel_readyToConnect.set(this, new lazy_1$
|
9340
|
+
_Channel_readyToConnect.set(this, new lazy_1$3.AsyncRetryableLazy(async () => {
|
9335
9341
|
await Promise.all([
|
9336
9342
|
this.on('disconnected', (eventPayload) => {
|
9337
9343
|
client_1.ChannelClient.handleProviderDisconnect(eventPayload);
|
9338
9344
|
}),
|
9339
9345
|
this.on('connected', (...args) => {
|
9340
|
-
__classPrivateFieldGet$
|
9346
|
+
__classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").emit('connected', ...args);
|
9341
9347
|
})
|
9342
9348
|
]).catch(() => new Error('error setting up channel connection listeners'));
|
9343
9349
|
}));
|
9344
|
-
__classPrivateFieldSet$
|
9350
|
+
__classPrivateFieldSet$a(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
|
9345
9351
|
}
|
9346
9352
|
/**
|
9347
9353
|
*
|
@@ -9416,7 +9422,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
9416
9422
|
resolve(true);
|
9417
9423
|
}
|
9418
9424
|
};
|
9419
|
-
__classPrivateFieldGet$
|
9425
|
+
__classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
|
9420
9426
|
});
|
9421
9427
|
try {
|
9422
9428
|
if (retryInfo.count > 0) {
|
@@ -9448,7 +9454,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
9448
9454
|
finally {
|
9449
9455
|
retryInfo.count += 1;
|
9450
9456
|
// in case of other errors, remove our listener
|
9451
|
-
__classPrivateFieldGet$
|
9457
|
+
__classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
|
9452
9458
|
}
|
9453
9459
|
} while (shouldWait); // If we're waiting we retry the above loop
|
9454
9460
|
// Should wait was false, no channel was found.
|
@@ -9507,12 +9513,12 @@ class Channel extends base_1$h.EmitterBase {
|
|
9507
9513
|
async connect(channelName, options = {}) {
|
9508
9514
|
// Make sure we don't connect before listeners are set up
|
9509
9515
|
// This also errors if we're not in OpenFin, ensuring we don't run unnecessary code
|
9510
|
-
await __classPrivateFieldGet$
|
9516
|
+
await __classPrivateFieldGet$b(this, _Channel_readyToConnect, "f").getValue();
|
9511
9517
|
if (!channelName || typeof channelName !== 'string') {
|
9512
9518
|
throw new Error('Please provide a channelName string to connect to a channel.');
|
9513
9519
|
}
|
9514
9520
|
const opts = { wait: true, ...this.wire.environment.getDefaultChannelOptions().connect, ...options };
|
9515
|
-
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$
|
9521
|
+
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createClientOffer(opts);
|
9516
9522
|
let connectionUrl;
|
9517
9523
|
if (this.fin.me.isFrame || this.fin.me.isView || this.fin.me.isWindow) {
|
9518
9524
|
connectionUrl = (await this.fin.me.getInfo()).url;
|
@@ -9524,7 +9530,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
9524
9530
|
connectionUrl
|
9525
9531
|
};
|
9526
9532
|
const routingInfo = await this.safeConnect(channelName, opts.wait, connectPayload);
|
9527
|
-
const strategy = await __classPrivateFieldGet$
|
9533
|
+
const strategy = await __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
|
9528
9534
|
const channel = new client_1.ChannelClient(routingInfo, () => client_1.ChannelClient.wireClose(this.wire, routingInfo, routingInfo.endpointId), strategy);
|
9529
9535
|
// It is the client's responsibility to handle endpoint disconnection to the provider.
|
9530
9536
|
// If the endpoint dies, the client will force a disconnection through the core.
|
@@ -9593,7 +9599,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
9593
9599
|
throw new Error('Please provide a channelName to create a channel');
|
9594
9600
|
}
|
9595
9601
|
const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
|
9596
|
-
const channel = __classPrivateFieldGet$
|
9602
|
+
const channel = __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
|
9597
9603
|
// TODO: fix typing (internal)
|
9598
9604
|
// @ts-expect-error
|
9599
9605
|
this.on('client-disconnected', (eventPayload) => {
|
@@ -9617,7 +9623,7 @@ interappbus.InterAppPayload = interappbus.InterApplicationBus = void 0;
|
|
9617
9623
|
* @packageDocumentation
|
9618
9624
|
*/
|
9619
9625
|
const events_1$4 = require$$0;
|
9620
|
-
const base_1$
|
9626
|
+
const base_1$h = base;
|
9621
9627
|
const ref_counter_1 = refCounter;
|
9622
9628
|
const index_1$2 = channel$1;
|
9623
9629
|
const validate_1$3 = validate;
|
@@ -9625,7 +9631,7 @@ const validate_1$3 = validate;
|
|
9625
9631
|
* A messaging bus that allows for pub/sub messaging between different applications.
|
9626
9632
|
*
|
9627
9633
|
*/
|
9628
|
-
class InterApplicationBus extends base_1$
|
9634
|
+
class InterApplicationBus extends base_1$h.Base {
|
9629
9635
|
/**
|
9630
9636
|
* @internal
|
9631
9637
|
*/
|
@@ -9831,12 +9837,12 @@ var clipboard = {};
|
|
9831
9837
|
*/
|
9832
9838
|
Object.defineProperty(clipboard, "__esModule", { value: true });
|
9833
9839
|
clipboard.Clipboard = void 0;
|
9834
|
-
const base_1$
|
9840
|
+
const base_1$g = base;
|
9835
9841
|
/**
|
9836
9842
|
* The Clipboard API allows reading and writing to the clipboard in multiple formats.
|
9837
9843
|
*
|
9838
9844
|
*/
|
9839
|
-
class Clipboard extends base_1$
|
9845
|
+
class Clipboard extends base_1$g.Base {
|
9840
9846
|
/**
|
9841
9847
|
* Writes data into the clipboard as plain text
|
9842
9848
|
* @param writeObj The object for writing data into the clipboard
|
@@ -10025,7 +10031,7 @@ var Instance$4 = {};
|
|
10025
10031
|
Object.defineProperty(Instance$4, "__esModule", { value: true });
|
10026
10032
|
Instance$4.ExternalApplication = void 0;
|
10027
10033
|
/* eslint-disable import/prefer-default-export */
|
10028
|
-
const base_1$
|
10034
|
+
const base_1$f = base;
|
10029
10035
|
/**
|
10030
10036
|
* An ExternalApplication object representing native language adapter connections to the runtime. Allows
|
10031
10037
|
* the developer to listen to {@link OpenFin.ExternalApplicationEvents external application events}.
|
@@ -10036,7 +10042,7 @@ const base_1$e = base;
|
|
10036
10042
|
* - Processes started via `System.launchExternalApplication`
|
10037
10043
|
* - Processes monitored via `System.monitorExternalProcess`
|
10038
10044
|
*/
|
10039
|
-
class ExternalApplication extends base_1$
|
10045
|
+
class ExternalApplication extends base_1$f.EmitterBase {
|
10040
10046
|
/**
|
10041
10047
|
* @internal
|
10042
10048
|
*/
|
@@ -10064,12 +10070,12 @@ Instance$4.ExternalApplication = ExternalApplication;
|
|
10064
10070
|
|
10065
10071
|
Object.defineProperty(Factory$5, "__esModule", { value: true });
|
10066
10072
|
Factory$5.ExternalApplicationModule = void 0;
|
10067
|
-
const base_1$
|
10073
|
+
const base_1$e = base;
|
10068
10074
|
const Instance_1$4 = Instance$4;
|
10069
10075
|
/**
|
10070
10076
|
* Static namespace for OpenFin API methods that interact with the {@link ExternalApplication} class, available under `fin.ExternalApplication`.
|
10071
10077
|
*/
|
10072
|
-
class ExternalApplicationModule extends base_1$
|
10078
|
+
class ExternalApplicationModule extends base_1$e.Base {
|
10073
10079
|
/**
|
10074
10080
|
* Asynchronously returns an External Application object that represents an external application.
|
10075
10081
|
* <br>It is possible to wrap a process that does not yet exist, (for example, to listen for startup-related events)
|
@@ -10151,7 +10157,7 @@ var Instance$3 = {};
|
|
10151
10157
|
Object.defineProperty(Instance$3, "__esModule", { value: true });
|
10152
10158
|
Instance$3._Frame = void 0;
|
10153
10159
|
/* eslint-disable import/prefer-default-export */
|
10154
|
-
const base_1$
|
10160
|
+
const base_1$d = base;
|
10155
10161
|
/**
|
10156
10162
|
* An iframe represents an embedded HTML page within a parent HTML page. Because this embedded page
|
10157
10163
|
* has its own DOM and global JS context (which may or may not be linked to that of the parent depending
|
@@ -10172,7 +10178,7 @@ const base_1$c = base;
|
|
10172
10178
|
* The fin.Frame namespace represents a way to interact with `iframes` and facilitates the discovery of current context
|
10173
10179
|
* (iframe or main window) as well as the ability to listen for {@link OpenFin.FrameEvents frame-specific events}.
|
10174
10180
|
*/
|
10175
|
-
class _Frame extends base_1$
|
10181
|
+
class _Frame extends base_1$d.EmitterBase {
|
10176
10182
|
/**
|
10177
10183
|
* @internal
|
10178
10184
|
*/
|
@@ -10218,13 +10224,13 @@ Instance$3._Frame = _Frame;
|
|
10218
10224
|
|
10219
10225
|
Object.defineProperty(Factory$4, "__esModule", { value: true });
|
10220
10226
|
Factory$4._FrameModule = void 0;
|
10221
|
-
const base_1$
|
10227
|
+
const base_1$c = base;
|
10222
10228
|
const validate_1$2 = validate;
|
10223
10229
|
const Instance_1$3 = Instance$3;
|
10224
10230
|
/**
|
10225
10231
|
* Static namespace for OpenFin API methods that interact with the {@link _Frame} class, available under `fin.Frame`.
|
10226
10232
|
*/
|
10227
|
-
class _FrameModule extends base_1$
|
10233
|
+
class _FrameModule extends base_1$c.Base {
|
10228
10234
|
/**
|
10229
10235
|
* Asynchronously returns an API handle for the given Frame identity.
|
10230
10236
|
*
|
@@ -10345,12 +10351,12 @@ var globalHotkey = {};
|
|
10345
10351
|
|
10346
10352
|
Object.defineProperty(globalHotkey, "__esModule", { value: true });
|
10347
10353
|
globalHotkey.GlobalHotkey = void 0;
|
10348
|
-
const base_1$
|
10354
|
+
const base_1$b = base;
|
10349
10355
|
/**
|
10350
10356
|
* The GlobalHotkey module can register/unregister a global hotkeys.
|
10351
10357
|
*
|
10352
10358
|
*/
|
10353
|
-
class GlobalHotkey extends base_1$
|
10359
|
+
class GlobalHotkey extends base_1$b.EmitterBase {
|
10354
10360
|
/**
|
10355
10361
|
* @internal
|
10356
10362
|
*/
|
@@ -10484,13 +10490,13 @@ var Factory$3 = {};
|
|
10484
10490
|
|
10485
10491
|
var Instance$2 = {};
|
10486
10492
|
|
10487
|
-
var __classPrivateFieldSet$
|
10493
|
+
var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
10488
10494
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
10489
10495
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
10490
10496
|
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");
|
10491
10497
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
10492
10498
|
};
|
10493
|
-
var __classPrivateFieldGet$
|
10499
|
+
var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
10494
10500
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
10495
10501
|
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");
|
10496
10502
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -10499,14 +10505,14 @@ var _Platform_channelName, _Platform_connectToProvider;
|
|
10499
10505
|
Object.defineProperty(Instance$2, "__esModule", { value: true });
|
10500
10506
|
Instance$2.Platform = void 0;
|
10501
10507
|
/* eslint-disable import/prefer-default-export, no-undef */
|
10502
|
-
const base_1$
|
10508
|
+
const base_1$a = base;
|
10503
10509
|
const validate_1$1 = validate;
|
10504
10510
|
/** Manages the life cycle of windows and views in the application.
|
10505
10511
|
*
|
10506
10512
|
* Enables taking snapshots of itself and applying them to restore a previous configuration
|
10507
10513
|
* as well as listen to {@link OpenFin.PlatformEvents platform events}.
|
10508
10514
|
*/
|
10509
|
-
class Platform extends base_1$
|
10515
|
+
class Platform extends base_1$a.EmitterBase {
|
10510
10516
|
/**
|
10511
10517
|
* @internal
|
10512
10518
|
*/
|
@@ -10527,24 +10533,24 @@ class Platform extends base_1$9.EmitterBase {
|
|
10527
10533
|
this.wire.sendAction('platform-get-client', this.identity).catch((e) => {
|
10528
10534
|
// don't expose
|
10529
10535
|
});
|
10530
|
-
if (!Platform.clientMap.has(__classPrivateFieldGet$
|
10531
|
-
const clientPromise = __classPrivateFieldGet$
|
10532
|
-
Platform.clientMap.set(__classPrivateFieldGet$
|
10536
|
+
if (!Platform.clientMap.has(__classPrivateFieldGet$a(this, _Platform_channelName, "f"))) {
|
10537
|
+
const clientPromise = __classPrivateFieldGet$a(this, _Platform_connectToProvider, "f").call(this);
|
10538
|
+
Platform.clientMap.set(__classPrivateFieldGet$a(this, _Platform_channelName, "f"), clientPromise);
|
10533
10539
|
}
|
10534
10540
|
// we set it above
|
10535
10541
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
10536
|
-
return Platform.clientMap.get(__classPrivateFieldGet$
|
10542
|
+
return Platform.clientMap.get(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
|
10537
10543
|
};
|
10538
10544
|
_Platform_connectToProvider.set(this, async () => {
|
10539
10545
|
try {
|
10540
|
-
const client = await this._channel.connect(__classPrivateFieldGet$
|
10546
|
+
const client = await this._channel.connect(__classPrivateFieldGet$a(this, _Platform_channelName, "f"), { wait: false });
|
10541
10547
|
client.onDisconnection(() => {
|
10542
|
-
Platform.clientMap.delete(__classPrivateFieldGet$
|
10548
|
+
Platform.clientMap.delete(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
|
10543
10549
|
});
|
10544
10550
|
return client;
|
10545
10551
|
}
|
10546
10552
|
catch (e) {
|
10547
|
-
Platform.clientMap.delete(__classPrivateFieldGet$
|
10553
|
+
Platform.clientMap.delete(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
|
10548
10554
|
throw new Error('The targeted Platform is not currently running. Listen for application-started event for the given Uuid.');
|
10549
10555
|
}
|
10550
10556
|
});
|
@@ -10557,7 +10563,7 @@ class Platform extends base_1$9.EmitterBase {
|
|
10557
10563
|
if (errorMsg) {
|
10558
10564
|
throw new Error(errorMsg);
|
10559
10565
|
}
|
10560
|
-
__classPrivateFieldSet$
|
10566
|
+
__classPrivateFieldSet$9(this, _Platform_channelName, channelName, "f");
|
10561
10567
|
this._channel = this.fin.InterApplicationBus.Channel;
|
10562
10568
|
this.identity = { uuid: identity.uuid };
|
10563
10569
|
this.Layout = this.fin.Platform.Layout;
|
@@ -11613,13 +11619,13 @@ const createRelayedDispatch = (client, target, relayId, relayErrorMsg) => async
|
|
11613
11619
|
};
|
11614
11620
|
channelApiRelay.createRelayedDispatch = createRelayedDispatch;
|
11615
11621
|
|
11616
|
-
var __classPrivateFieldSet$
|
11622
|
+
var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
11617
11623
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
11618
11624
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
11619
11625
|
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");
|
11620
11626
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
11621
11627
|
};
|
11622
|
-
var __classPrivateFieldGet$
|
11628
|
+
var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
11623
11629
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
11624
11630
|
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");
|
11625
11631
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -11673,7 +11679,7 @@ class LayoutNode {
|
|
11673
11679
|
* console.log(`The parent ColumnOrRow is root: ${parentIsRoot}`);
|
11674
11680
|
* ```
|
11675
11681
|
*/
|
11676
|
-
this.isRoot = () => __classPrivateFieldGet$
|
11682
|
+
this.isRoot = () => __classPrivateFieldGet$9(this, _LayoutNode_client, "f").isRoot(this.entityId);
|
11677
11683
|
/**
|
11678
11684
|
* Checks if the TabStack or ColumnOrRow exists
|
11679
11685
|
*
|
@@ -11693,7 +11699,7 @@ class LayoutNode {
|
|
11693
11699
|
* console.log(`The entity exists: ${exists}`);
|
11694
11700
|
* ```
|
11695
11701
|
*/
|
11696
|
-
this.exists = () => __classPrivateFieldGet$
|
11702
|
+
this.exists = () => __classPrivateFieldGet$9(this, _LayoutNode_client, "f").exists(this.entityId);
|
11697
11703
|
/**
|
11698
11704
|
* Retrieves the parent of the TabStack or ColumnOrRow
|
11699
11705
|
*
|
@@ -11714,11 +11720,11 @@ class LayoutNode {
|
|
11714
11720
|
* ```
|
11715
11721
|
*/
|
11716
11722
|
this.getParent = async () => {
|
11717
|
-
const parent = await __classPrivateFieldGet$
|
11723
|
+
const parent = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").getParent(this.entityId);
|
11718
11724
|
if (!parent) {
|
11719
11725
|
return undefined;
|
11720
11726
|
}
|
11721
|
-
return LayoutNode.getEntity(parent, __classPrivateFieldGet$
|
11727
|
+
return LayoutNode.getEntity(parent, __classPrivateFieldGet$9(this, _LayoutNode_client, "f"));
|
11722
11728
|
};
|
11723
11729
|
/**
|
11724
11730
|
* Creates a new TabStack adjacent to the given TabStack or ColumnOrRow. Inputs can be new views to create, or existing views.
|
@@ -11769,8 +11775,8 @@ class LayoutNode {
|
|
11769
11775
|
* @experimental
|
11770
11776
|
*/
|
11771
11777
|
this.createAdjacentStack = async (views, options) => {
|
11772
|
-
const entityId = await __classPrivateFieldGet$
|
11773
|
-
return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet$
|
11778
|
+
const entityId = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").createAdjacentStack(this.entityId, views, options);
|
11779
|
+
return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet$9(this, _LayoutNode_client, "f"));
|
11774
11780
|
};
|
11775
11781
|
/**
|
11776
11782
|
* Retrieves the adjacent TabStacks of the given TabStack or ColumnOrRow.
|
@@ -11798,16 +11804,16 @@ class LayoutNode {
|
|
11798
11804
|
* @experimental
|
11799
11805
|
*/
|
11800
11806
|
this.getAdjacentStacks = async (edge) => {
|
11801
|
-
const adjacentStacks = await __classPrivateFieldGet$
|
11807
|
+
const adjacentStacks = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").getAdjacentStacks({
|
11802
11808
|
targetId: this.entityId,
|
11803
11809
|
edge
|
11804
11810
|
});
|
11805
11811
|
return adjacentStacks.map((stack) => LayoutNode.getEntity({
|
11806
11812
|
type: 'stack',
|
11807
11813
|
entityId: stack.entityId
|
11808
|
-
}, __classPrivateFieldGet$
|
11814
|
+
}, __classPrivateFieldGet$9(this, _LayoutNode_client, "f")));
|
11809
11815
|
};
|
11810
|
-
__classPrivateFieldSet$
|
11816
|
+
__classPrivateFieldSet$8(this, _LayoutNode_client, client, "f");
|
11811
11817
|
this.entityId = entityId;
|
11812
11818
|
}
|
11813
11819
|
}
|
@@ -11880,7 +11886,7 @@ class TabStack extends LayoutNode {
|
|
11880
11886
|
* ```
|
11881
11887
|
* @experimental
|
11882
11888
|
*/
|
11883
|
-
this.getViews = () => __classPrivateFieldGet$
|
11889
|
+
this.getViews = () => __classPrivateFieldGet$9(this, _TabStack_client, "f").getStackViews(this.entityId);
|
11884
11890
|
/**
|
11885
11891
|
* Adds or creates a view in this {@link TabStack}.
|
11886
11892
|
*
|
@@ -11910,7 +11916,7 @@ class TabStack extends LayoutNode {
|
|
11910
11916
|
* ```
|
11911
11917
|
* @experimental
|
11912
11918
|
*/
|
11913
|
-
this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet$
|
11919
|
+
this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet$9(this, _TabStack_client, "f").addViewToStack(this.entityId, view, options);
|
11914
11920
|
/**
|
11915
11921
|
* Removes a view from this {@link TabStack}.
|
11916
11922
|
*
|
@@ -11940,7 +11946,7 @@ class TabStack extends LayoutNode {
|
|
11940
11946
|
* ```
|
11941
11947
|
*/
|
11942
11948
|
this.removeView = async (view) => {
|
11943
|
-
await __classPrivateFieldGet$
|
11949
|
+
await __classPrivateFieldGet$9(this, _TabStack_client, "f").removeViewFromStack(this.entityId, view);
|
11944
11950
|
};
|
11945
11951
|
/**
|
11946
11952
|
* Sets the active view of the {@link TabStack} without focusing it.
|
@@ -11964,9 +11970,9 @@ class TabStack extends LayoutNode {
|
|
11964
11970
|
* @experimental
|
11965
11971
|
*/
|
11966
11972
|
this.setActiveView = async (view) => {
|
11967
|
-
await __classPrivateFieldGet$
|
11973
|
+
await __classPrivateFieldGet$9(this, _TabStack_client, "f").setStackActiveView(this.entityId, view);
|
11968
11974
|
};
|
11969
|
-
__classPrivateFieldSet$
|
11975
|
+
__classPrivateFieldSet$8(this, _TabStack_client, client, "f");
|
11970
11976
|
}
|
11971
11977
|
}
|
11972
11978
|
layoutEntities.TabStack = TabStack;
|
@@ -12005,10 +12011,10 @@ class ColumnOrRow extends LayoutNode {
|
|
12005
12011
|
* ```
|
12006
12012
|
*/
|
12007
12013
|
this.getContent = async () => {
|
12008
|
-
const contentItemEntities = await __classPrivateFieldGet$
|
12009
|
-
return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet$
|
12014
|
+
const contentItemEntities = await __classPrivateFieldGet$9(this, _ColumnOrRow_client, "f").getContent(this.entityId);
|
12015
|
+
return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet$9(this, _ColumnOrRow_client, "f")));
|
12010
12016
|
};
|
12011
|
-
__classPrivateFieldSet$
|
12017
|
+
__classPrivateFieldSet$8(this, _ColumnOrRow_client, client, "f");
|
12012
12018
|
this.type = type;
|
12013
12019
|
}
|
12014
12020
|
}
|
@@ -12023,7 +12029,7 @@ layout_constants.LAYOUT_CONTROLLER_ID = 'layout-entities';
|
|
12023
12029
|
// TODO: eventually export this somehow
|
12024
12030
|
layout_constants.DEFAULT_LAYOUT_KEY = '__default__';
|
12025
12031
|
|
12026
|
-
var __classPrivateFieldGet$
|
12032
|
+
var __classPrivateFieldGet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
12027
12033
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
12028
12034
|
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");
|
12029
12035
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -12031,9 +12037,9 @@ var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
12031
12037
|
var _Layout_instances, _Layout_layoutClient, _Layout_forwardLayoutAction;
|
12032
12038
|
Object.defineProperty(Instance$1, "__esModule", { value: true });
|
12033
12039
|
Instance$1.Layout = void 0;
|
12034
|
-
const lazy_1$
|
12040
|
+
const lazy_1$2 = lazy;
|
12035
12041
|
const validate_1 = validate;
|
12036
|
-
const base_1$
|
12042
|
+
const base_1$9 = base;
|
12037
12043
|
const common_utils_1$1 = commonUtils;
|
12038
12044
|
const layout_entities_1 = layoutEntities;
|
12039
12045
|
const layout_constants_1$1 = layout_constants;
|
@@ -12169,12 +12175,12 @@ const layout_constants_1$1 = layout_constants;
|
|
12169
12175
|
* }
|
12170
12176
|
* ```
|
12171
12177
|
*/
|
12172
|
-
class Layout extends base_1$
|
12178
|
+
class Layout extends base_1$9.Base {
|
12173
12179
|
/**
|
12174
12180
|
* @internal
|
12175
12181
|
*/
|
12176
12182
|
static getClient(layout) {
|
12177
|
-
return __classPrivateFieldGet$
|
12183
|
+
return __classPrivateFieldGet$8(layout, _Layout_layoutClient, "f").getValue();
|
12178
12184
|
}
|
12179
12185
|
/**
|
12180
12186
|
* @internal
|
@@ -12188,7 +12194,7 @@ class Layout extends base_1$8.Base {
|
|
12188
12194
|
* Lazily constructed {@link LayoutEntitiesClient} bound to this platform's client and identity
|
12189
12195
|
* The client is for {@link LayoutEntitiesController}
|
12190
12196
|
*/
|
12191
|
-
_Layout_layoutClient.set(this, new lazy_1$
|
12197
|
+
_Layout_layoutClient.set(this, new lazy_1$2.Lazy(async () => layout_entities_1.LayoutNode.newLayoutEntitiesClient(await this.platform.getClient(), layout_constants_1$1.LAYOUT_CONTROLLER_ID, this.identity)));
|
12192
12198
|
/**
|
12193
12199
|
* Replaces a Platform window's layout with a new layout.
|
12194
12200
|
*
|
@@ -12397,7 +12403,7 @@ class Layout extends base_1$8.Base {
|
|
12397
12403
|
this.wire.sendAction('layout-get-root-item').catch(() => {
|
12398
12404
|
// don't expose
|
12399
12405
|
});
|
12400
|
-
const client = await __classPrivateFieldGet$
|
12406
|
+
const client = await __classPrivateFieldGet$8(this, _Layout_layoutClient, "f").getValue();
|
12401
12407
|
const root = await client.getRoot('layoutName' in this.identity ? this.identity : undefined);
|
12402
12408
|
return layout_entities_1.LayoutNode.getEntity(root, client);
|
12403
12409
|
}
|
@@ -12415,7 +12421,7 @@ class Layout extends base_1$8.Base {
|
|
12415
12421
|
this.wire.sendAction('layout-get-stack-by-view').catch(() => {
|
12416
12422
|
// don't expose
|
12417
12423
|
});
|
12418
|
-
const client = await __classPrivateFieldGet$
|
12424
|
+
const client = await __classPrivateFieldGet$8(this, _Layout_layoutClient, "f").getValue();
|
12419
12425
|
const stack = await client.getStackByView(identity);
|
12420
12426
|
if (!stack) {
|
12421
12427
|
throw new Error(`No stack found for view: ${identity.uuid}/${identity.name}`);
|
@@ -12435,7 +12441,7 @@ class Layout extends base_1$8.Base {
|
|
12435
12441
|
this.wire.sendAction('layout-add-view').catch((e) => {
|
12436
12442
|
// don't expose
|
12437
12443
|
});
|
12438
|
-
const { identity } = await __classPrivateFieldGet$
|
12444
|
+
const { identity } = await __classPrivateFieldGet$8(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-add-view', {
|
12439
12445
|
viewOptions,
|
12440
12446
|
location,
|
12441
12447
|
targetView
|
@@ -12453,7 +12459,7 @@ class Layout extends base_1$8.Base {
|
|
12453
12459
|
this.wire.sendAction('layout-close-view').catch((e) => {
|
12454
12460
|
// don't expose
|
12455
12461
|
});
|
12456
|
-
await __classPrivateFieldGet$
|
12462
|
+
await __classPrivateFieldGet$8(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-close-view', { viewIdentity });
|
12457
12463
|
}
|
12458
12464
|
}
|
12459
12465
|
Instance$1.Layout = Layout;
|
@@ -12467,12 +12473,12 @@ async function _Layout_forwardLayoutAction(action, payload) {
|
|
12467
12473
|
return client.dispatch(action, { target: this.identity, opts: payload });
|
12468
12474
|
};
|
12469
12475
|
|
12470
|
-
var __classPrivateFieldGet$
|
12476
|
+
var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
12471
12477
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
12472
12478
|
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");
|
12473
12479
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
12474
12480
|
};
|
12475
|
-
var __classPrivateFieldSet$
|
12481
|
+
var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
12476
12482
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
12477
12483
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
12478
12484
|
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");
|
@@ -12481,13 +12487,13 @@ var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
12481
12487
|
var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_getLayoutManagerSpy, _LayoutModule_getSafeLayoutManager;
|
12482
12488
|
Object.defineProperty(Factory$2, "__esModule", { value: true });
|
12483
12489
|
Factory$2.LayoutModule = void 0;
|
12484
|
-
const base_1$
|
12490
|
+
const base_1$8 = base;
|
12485
12491
|
const Instance_1$2 = Instance$1;
|
12486
12492
|
const layout_constants_1 = layout_constants;
|
12487
12493
|
/**
|
12488
12494
|
* Static namespace for OpenFin API methods that interact with the {@link Layout} class, available under `fin.Platform.Layout`.
|
12489
12495
|
*/
|
12490
|
-
class LayoutModule extends base_1$
|
12496
|
+
class LayoutModule extends base_1$8.Base {
|
12491
12497
|
constructor() {
|
12492
12498
|
super(...arguments);
|
12493
12499
|
_LayoutModule_instances.add(this);
|
@@ -12538,23 +12544,23 @@ class LayoutModule extends base_1$7.Base {
|
|
12538
12544
|
if (!this.wire.environment.layoutAllowedInContext(this.fin)) {
|
12539
12545
|
throw new Error('Layout.init can only be called from a Window context.');
|
12540
12546
|
}
|
12541
|
-
if (__classPrivateFieldGet$
|
12547
|
+
if (__classPrivateFieldGet$7(this, _LayoutModule_layoutInitializationAttempted, "f")) {
|
12542
12548
|
throw new Error('Layout.init was already called, please use Layout.create to add additional layouts.');
|
12543
12549
|
}
|
12544
12550
|
if (this.wire.environment.type === 'openfin') {
|
12545
12551
|
// preload the client
|
12546
12552
|
await this.fin.Platform.getCurrentSync().getClient();
|
12547
12553
|
}
|
12548
|
-
__classPrivateFieldSet$
|
12554
|
+
__classPrivateFieldSet$7(this, _LayoutModule_layoutInitializationAttempted, true, "f");
|
12549
12555
|
// TODO: rename to createLayoutManager
|
12550
|
-
__classPrivateFieldSet$
|
12551
|
-
await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$
|
12556
|
+
__classPrivateFieldSet$7(this, _LayoutModule_layoutManager, await this.wire.environment.initLayoutManager(this.fin, this.wire, options), "f");
|
12557
|
+
await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f"), options);
|
12552
12558
|
const meIdentity = { name: this.fin.me.name, uuid: this.fin.me.uuid };
|
12553
12559
|
if (!options.layoutManagerOverride) {
|
12554
12560
|
// CORE-1081 to be removed when we actually delete the `layoutManager` prop
|
12555
12561
|
// in single-layout case, we return the undocumented layoutManager type
|
12556
12562
|
const layoutIdentity = { layoutName: layout_constants_1.DEFAULT_LAYOUT_KEY, ...meIdentity };
|
12557
|
-
return __classPrivateFieldGet$
|
12563
|
+
return __classPrivateFieldGet$7(this, _LayoutModule_getLayoutManagerSpy, "f").call(this, layoutIdentity);
|
12558
12564
|
}
|
12559
12565
|
return this.wrapSync(meIdentity);
|
12560
12566
|
};
|
@@ -12583,13 +12589,13 @@ class LayoutModule extends base_1$7.Base {
|
|
12583
12589
|
* @returns
|
12584
12590
|
*/
|
12585
12591
|
this.getCurrentLayoutManagerSync = () => {
|
12586
|
-
return __classPrivateFieldGet$
|
12592
|
+
return __classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.getCurrentLayoutManagerSync()`);
|
12587
12593
|
};
|
12588
12594
|
this.create = async (options) => {
|
12589
|
-
return this.wire.environment.createLayout(__classPrivateFieldGet$
|
12595
|
+
return this.wire.environment.createLayout(__classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.create()`), options);
|
12590
12596
|
};
|
12591
12597
|
this.destroy = async (layoutIdentity) => {
|
12592
|
-
return this.wire.environment.destroyLayout(__classPrivateFieldGet$
|
12598
|
+
return this.wire.environment.destroyLayout(__classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.destroy()`), layoutIdentity);
|
12593
12599
|
};
|
12594
12600
|
}
|
12595
12601
|
/**
|
@@ -12730,10 +12736,10 @@ class LayoutModule extends base_1$7.Base {
|
|
12730
12736
|
}
|
12731
12737
|
Factory$2.LayoutModule = LayoutModule;
|
12732
12738
|
_LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_getLayoutManagerSpy = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
|
12733
|
-
if (!__classPrivateFieldGet$
|
12739
|
+
if (!__classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f")) {
|
12734
12740
|
throw new Error(`You must call init before using the API ${method}`);
|
12735
12741
|
}
|
12736
|
-
return __classPrivateFieldGet$
|
12742
|
+
return __classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f");
|
12737
12743
|
};
|
12738
12744
|
|
12739
12745
|
(function (exports) {
|
@@ -12770,13 +12776,13 @@ _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layou
|
|
12770
12776
|
|
12771
12777
|
Object.defineProperty(Factory$3, "__esModule", { value: true });
|
12772
12778
|
Factory$3.PlatformModule = void 0;
|
12773
|
-
const base_1$
|
12779
|
+
const base_1$7 = base;
|
12774
12780
|
const Instance_1$1 = Instance$2;
|
12775
12781
|
const index_1$1 = layout;
|
12776
12782
|
/**
|
12777
12783
|
* Static namespace for OpenFin API methods that interact with the {@link Platform} class, available under `fin.Platform`.
|
12778
12784
|
*/
|
12779
|
-
class PlatformModule extends base_1$
|
12785
|
+
class PlatformModule extends base_1$7.Base {
|
12780
12786
|
/**
|
12781
12787
|
* @internal
|
12782
12788
|
*/
|
@@ -13696,13 +13702,13 @@ class PrivateChannelProvider {
|
|
13696
13702
|
}
|
13697
13703
|
PrivateChannelProvider$1.PrivateChannelProvider = PrivateChannelProvider;
|
13698
13704
|
|
13699
|
-
var __classPrivateFieldSet$
|
13705
|
+
var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
13700
13706
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
13701
13707
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
13702
13708
|
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");
|
13703
13709
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
13704
13710
|
};
|
13705
|
-
var __classPrivateFieldGet$
|
13711
|
+
var __classPrivateFieldGet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
13706
13712
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
13707
13713
|
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");
|
13708
13714
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -13713,12 +13719,12 @@ var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || fu
|
|
13713
13719
|
var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
|
13714
13720
|
Object.defineProperty(InteropBroker$1, "__esModule", { value: true });
|
13715
13721
|
InteropBroker$1.InteropBroker = void 0;
|
13716
|
-
const base_1$
|
13722
|
+
const base_1$6 = base;
|
13717
13723
|
const SessionContextGroupBroker_1 = __importDefault$4(SessionContextGroupBroker$1);
|
13718
13724
|
const utils_1$7 = utils$3;
|
13719
13725
|
const isEqual_1$1 = __importDefault$4(require$$3);
|
13720
13726
|
const PrivateChannelProvider_1 = PrivateChannelProvider$1;
|
13721
|
-
const lazy_1 = lazy;
|
13727
|
+
const lazy_1$1 = lazy;
|
13722
13728
|
const defaultContextGroups = [
|
13723
13729
|
{
|
13724
13730
|
id: 'green',
|
@@ -13882,7 +13888,7 @@ const defaultContextGroups = [
|
|
13882
13888
|
* ---
|
13883
13889
|
*
|
13884
13890
|
*/
|
13885
|
-
class InteropBroker extends base_1$
|
13891
|
+
class InteropBroker extends base_1$6.Base {
|
13886
13892
|
/**
|
13887
13893
|
* @internal
|
13888
13894
|
*/
|
@@ -13893,19 +13899,19 @@ class InteropBroker extends base_1$5.Base {
|
|
13893
13899
|
_InteropBroker_contextGroups.set(this, void 0);
|
13894
13900
|
_InteropBroker_providerPromise.set(this, void 0);
|
13895
13901
|
this.getProvider = () => {
|
13896
|
-
return __classPrivateFieldGet$
|
13902
|
+
return __classPrivateFieldGet$6(this, _InteropBroker_providerPromise, "f").getValue();
|
13897
13903
|
};
|
13898
13904
|
this.interopClients = new Map();
|
13899
13905
|
this.contextGroupsById = new Map();
|
13900
|
-
__classPrivateFieldSet$
|
13901
|
-
__classPrivateFieldSet$
|
13906
|
+
__classPrivateFieldSet$6(this, _InteropBroker_contextGroups, options.contextGroups ?? [...defaultContextGroups], "f");
|
13907
|
+
__classPrivateFieldSet$6(this, _InteropBroker_fdc3Info, options.fdc3Info, "f");
|
13902
13908
|
if (options?.logging) {
|
13903
13909
|
this.logging = options.logging;
|
13904
13910
|
}
|
13905
13911
|
this.intentClientMap = new Map();
|
13906
13912
|
this.lastContextMap = new Map();
|
13907
13913
|
this.sessionContextGroupMap = new Map();
|
13908
|
-
__classPrivateFieldSet$
|
13914
|
+
__classPrivateFieldSet$6(this, _InteropBroker_providerPromise, new lazy_1$1.Lazy(createProvider), "f");
|
13909
13915
|
this.setContextGroupMap();
|
13910
13916
|
this.setupChannelProvider();
|
13911
13917
|
}
|
@@ -14173,7 +14179,7 @@ class InteropBroker extends base_1$5.Base {
|
|
14173
14179
|
// don't expose, analytics-only call
|
14174
14180
|
});
|
14175
14181
|
// Create copy for immutability
|
14176
|
-
return __classPrivateFieldGet$
|
14182
|
+
return __classPrivateFieldGet$6(this, _InteropBroker_contextGroups, "f").map((contextGroup) => {
|
14177
14183
|
return { ...contextGroup };
|
14178
14184
|
});
|
14179
14185
|
}
|
@@ -14584,7 +14590,7 @@ class InteropBroker extends base_1$5.Base {
|
|
14584
14590
|
const { fdc3Version } = payload;
|
14585
14591
|
return {
|
14586
14592
|
fdc3Version,
|
14587
|
-
...__classPrivateFieldGet$
|
14593
|
+
...__classPrivateFieldGet$6(this, _InteropBroker_fdc3Info, "f"),
|
14588
14594
|
optionalFeatures: {
|
14589
14595
|
OriginatingAppMetadata: false,
|
14590
14596
|
UserChannelMembershipAPIs: true
|
@@ -14961,27 +14967,27 @@ var InteropClient$1 = {};
|
|
14961
14967
|
|
14962
14968
|
var SessionContextGroupClient$1 = {};
|
14963
14969
|
|
14964
|
-
var __classPrivateFieldSet$
|
14970
|
+
var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
14965
14971
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
14966
14972
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
14967
14973
|
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");
|
14968
14974
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
14969
14975
|
};
|
14970
|
-
var __classPrivateFieldGet$
|
14976
|
+
var __classPrivateFieldGet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
14971
14977
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
14972
14978
|
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");
|
14973
14979
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
14974
14980
|
};
|
14975
14981
|
var _SessionContextGroupClient_clientPromise;
|
14976
14982
|
Object.defineProperty(SessionContextGroupClient$1, "__esModule", { value: true });
|
14977
|
-
const base_1$
|
14983
|
+
const base_1$5 = base;
|
14978
14984
|
const utils_1$6 = utils$3;
|
14979
|
-
class SessionContextGroupClient extends base_1$
|
14985
|
+
class SessionContextGroupClient extends base_1$5.Base {
|
14980
14986
|
constructor(wire, client, id) {
|
14981
14987
|
super(wire);
|
14982
14988
|
_SessionContextGroupClient_clientPromise.set(this, void 0);
|
14983
14989
|
this.id = id;
|
14984
|
-
__classPrivateFieldSet$
|
14990
|
+
__classPrivateFieldSet$5(this, _SessionContextGroupClient_clientPromise, client, "f");
|
14985
14991
|
}
|
14986
14992
|
/**
|
14987
14993
|
* Sets a context for the session context group.
|
@@ -14993,7 +14999,7 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
14993
14999
|
this.wire.sendAction('interop-session-context-group-set-context').catch((e) => {
|
14994
15000
|
// don't expose, analytics-only call
|
14995
15001
|
});
|
14996
|
-
const client = await __classPrivateFieldGet$
|
15002
|
+
const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
|
14997
15003
|
return client.dispatch(`sessionContextGroup:setContext-${this.id}`, {
|
14998
15004
|
sessionContextGroupId: this.id,
|
14999
15005
|
context
|
@@ -15003,7 +15009,7 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
15003
15009
|
this.wire.sendAction('interop-session-context-group-get-context').catch((e) => {
|
15004
15010
|
// don't expose, analytics-only call
|
15005
15011
|
});
|
15006
|
-
const client = await __classPrivateFieldGet$
|
15012
|
+
const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
|
15007
15013
|
return client.dispatch(`sessionContextGroup:getContext-${this.id}`, {
|
15008
15014
|
sessionContextGroupId: this.id,
|
15009
15015
|
type
|
@@ -15016,7 +15022,7 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
15016
15022
|
if (typeof contextHandler !== 'function') {
|
15017
15023
|
throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
|
15018
15024
|
}
|
15019
|
-
const client = await __classPrivateFieldGet$
|
15025
|
+
const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
|
15020
15026
|
let handlerId;
|
15021
15027
|
if (contextType) {
|
15022
15028
|
handlerId = `sessionContextHandler:invoke-${this.id}-${contextType}-${(0, utils_1$6.generateId)()}`;
|
@@ -15029,7 +15035,7 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
15029
15035
|
return { unsubscribe: await this.createUnsubscribeCb(handlerId) };
|
15030
15036
|
}
|
15031
15037
|
async createUnsubscribeCb(handlerId) {
|
15032
|
-
const client = await __classPrivateFieldGet$
|
15038
|
+
const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
|
15033
15039
|
return async () => {
|
15034
15040
|
client.remove(handlerId);
|
15035
15041
|
await client.dispatch(`sessionContextGroup:handlerRemoved-${this.id}`, { handlerId });
|
@@ -15047,13 +15053,13 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
15047
15053
|
SessionContextGroupClient$1.default = SessionContextGroupClient;
|
15048
15054
|
_SessionContextGroupClient_clientPromise = new WeakMap();
|
15049
15055
|
|
15050
|
-
var __classPrivateFieldSet$
|
15056
|
+
var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
15051
15057
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
15052
15058
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
15053
15059
|
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");
|
15054
15060
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
15055
15061
|
};
|
15056
|
-
var __classPrivateFieldGet$
|
15062
|
+
var __classPrivateFieldGet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
15057
15063
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
15058
15064
|
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");
|
15059
15065
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -15064,7 +15070,7 @@ var __importDefault$3 = (commonjsGlobal && commonjsGlobal.__importDefault) || fu
|
|
15064
15070
|
var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory;
|
15065
15071
|
Object.defineProperty(InteropClient$1, "__esModule", { value: true });
|
15066
15072
|
InteropClient$1.InteropClient = void 0;
|
15067
|
-
const base_1$
|
15073
|
+
const base_1$4 = base;
|
15068
15074
|
const SessionContextGroupClient_1 = __importDefault$3(SessionContextGroupClient$1);
|
15069
15075
|
const utils_1$5 = utils$3;
|
15070
15076
|
/**
|
@@ -15116,7 +15122,7 @@ const utils_1$5 = utils$3;
|
|
15116
15122
|
* * {@link InteropClient#getAllClientsInContextGroup getAllClientsInContextGroup(contextGroupId)}
|
15117
15123
|
*
|
15118
15124
|
*/
|
15119
|
-
class InteropClient extends base_1$
|
15125
|
+
class InteropClient extends base_1$4.Base {
|
15120
15126
|
/**
|
15121
15127
|
* @internal
|
15122
15128
|
*/
|
@@ -15125,9 +15131,9 @@ class InteropClient extends base_1$3.Base {
|
|
15125
15131
|
_InteropClient_clientPromise.set(this, void 0);
|
15126
15132
|
_InteropClient_sessionContextGroups.set(this, void 0);
|
15127
15133
|
_InteropClient_fdc3Factory.set(this, void 0);
|
15128
|
-
__classPrivateFieldSet$
|
15129
|
-
__classPrivateFieldSet$
|
15130
|
-
__classPrivateFieldSet$
|
15134
|
+
__classPrivateFieldSet$4(this, _InteropClient_sessionContextGroups, new Map(), "f");
|
15135
|
+
__classPrivateFieldSet$4(this, _InteropClient_clientPromise, clientPromise, "f");
|
15136
|
+
__classPrivateFieldSet$4(this, _InteropClient_fdc3Factory, fdc3Factory, "f");
|
15131
15137
|
}
|
15132
15138
|
/*
|
15133
15139
|
Client APIs
|
@@ -15155,7 +15161,7 @@ class InteropClient extends base_1$3.Base {
|
|
15155
15161
|
this.wire.sendAction('interop-client-set-context').catch((e) => {
|
15156
15162
|
// don't expose, analytics-only call
|
15157
15163
|
});
|
15158
|
-
const client = await __classPrivateFieldGet$
|
15164
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15159
15165
|
return client.dispatch('setContext', { context });
|
15160
15166
|
}
|
15161
15167
|
/**
|
@@ -15222,7 +15228,7 @@ class InteropClient extends base_1$3.Base {
|
|
15222
15228
|
if (typeof handler !== 'function') {
|
15223
15229
|
throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
|
15224
15230
|
}
|
15225
|
-
const client = await __classPrivateFieldGet$
|
15231
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15226
15232
|
let handlerId;
|
15227
15233
|
if (contextType) {
|
15228
15234
|
handlerId = `invokeContextHandler-${contextType}-${(0, utils_1$5.generateId)()}`;
|
@@ -15262,7 +15268,7 @@ class InteropClient extends base_1$3.Base {
|
|
15262
15268
|
this.wire.sendAction('interop-client-get-context-groups').catch((e) => {
|
15263
15269
|
// don't expose, analytics-only call
|
15264
15270
|
});
|
15265
|
-
const client = await __classPrivateFieldGet$
|
15271
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15266
15272
|
return client.dispatch('getContextGroups');
|
15267
15273
|
}
|
15268
15274
|
/**
|
@@ -15293,7 +15299,7 @@ class InteropClient extends base_1$3.Base {
|
|
15293
15299
|
this.wire.sendAction('interop-client-join-context-group').catch((e) => {
|
15294
15300
|
// don't expose, analytics-only call
|
15295
15301
|
});
|
15296
|
-
const client = await __classPrivateFieldGet$
|
15302
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15297
15303
|
if (!contextGroupId) {
|
15298
15304
|
throw new Error('No contextGroupId specified for joinContextGroup.');
|
15299
15305
|
}
|
@@ -15322,7 +15328,7 @@ class InteropClient extends base_1$3.Base {
|
|
15322
15328
|
this.wire.sendAction('interop-client-remove-from-context-group').catch((e) => {
|
15323
15329
|
// don't expose, analytics-only call
|
15324
15330
|
});
|
15325
|
-
const client = await __classPrivateFieldGet$
|
15331
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15326
15332
|
return client.dispatch('removeFromContextGroup', { target });
|
15327
15333
|
}
|
15328
15334
|
/**
|
@@ -15345,7 +15351,7 @@ class InteropClient extends base_1$3.Base {
|
|
15345
15351
|
this.wire.sendAction('interop-client-get-all-clients-in-context-group').catch((e) => {
|
15346
15352
|
// don't expose, analytics-only call
|
15347
15353
|
});
|
15348
|
-
const client = await __classPrivateFieldGet$
|
15354
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15349
15355
|
if (!contextGroupId) {
|
15350
15356
|
throw new Error('No contextGroupId specified for getAllClientsInContextGroup.');
|
15351
15357
|
}
|
@@ -15370,7 +15376,7 @@ class InteropClient extends base_1$3.Base {
|
|
15370
15376
|
this.wire.sendAction('interop-client-get-info-for-context-group').catch((e) => {
|
15371
15377
|
// don't expose, analytics-only call
|
15372
15378
|
});
|
15373
|
-
const client = await __classPrivateFieldGet$
|
15379
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15374
15380
|
if (!contextGroupId) {
|
15375
15381
|
throw new Error('No contextGroupId specified for getInfoForContextGroup.');
|
15376
15382
|
}
|
@@ -15398,7 +15404,7 @@ class InteropClient extends base_1$3.Base {
|
|
15398
15404
|
this.wire.sendAction('interop-client-fire-intent').catch((e) => {
|
15399
15405
|
// don't expose, this is only for api analytics purposes
|
15400
15406
|
});
|
15401
|
-
const client = await __classPrivateFieldGet$
|
15407
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15402
15408
|
return client.dispatch('fireIntent', intent);
|
15403
15409
|
}
|
15404
15410
|
/**
|
@@ -15425,7 +15431,7 @@ class InteropClient extends base_1$3.Base {
|
|
15425
15431
|
this.wire.sendAction('interop-client-register-intent-handler').catch((e) => {
|
15426
15432
|
// don't expose, this is only for api analytics purposes
|
15427
15433
|
});
|
15428
|
-
const client = await __classPrivateFieldGet$
|
15434
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15429
15435
|
const handlerId = `intent-handler-${intentName}`;
|
15430
15436
|
const wrappedHandler = (0, utils_1$5.wrapIntentHandler)(handler, handlerId);
|
15431
15437
|
try {
|
@@ -15463,7 +15469,7 @@ class InteropClient extends base_1$3.Base {
|
|
15463
15469
|
this.wire.sendAction('interop-client-get-current-context').catch((e) => {
|
15464
15470
|
// don't expose, analytics-only call
|
15465
15471
|
});
|
15466
|
-
const client = await __classPrivateFieldGet$
|
15472
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15467
15473
|
return client.dispatch('getCurrentContext', { contextType });
|
15468
15474
|
}
|
15469
15475
|
/**
|
@@ -15483,7 +15489,7 @@ class InteropClient extends base_1$3.Base {
|
|
15483
15489
|
this.wire.sendAction('interop-client-get-info-for-intent').catch((e) => {
|
15484
15490
|
// don't expose, analytics-only call
|
15485
15491
|
});
|
15486
|
-
const client = await __classPrivateFieldGet$
|
15492
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15487
15493
|
return client.dispatch('getInfoForIntent', options);
|
15488
15494
|
}
|
15489
15495
|
/**
|
@@ -15514,7 +15520,7 @@ class InteropClient extends base_1$3.Base {
|
|
15514
15520
|
this.wire.sendAction('interop-client-get-info-for-intents-by-context').catch((e) => {
|
15515
15521
|
// don't expose, analytics-only call
|
15516
15522
|
});
|
15517
|
-
const client = await __classPrivateFieldGet$
|
15523
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15518
15524
|
return client.dispatch('getInfoForIntentsByContext', context);
|
15519
15525
|
}
|
15520
15526
|
/**
|
@@ -15546,7 +15552,7 @@ class InteropClient extends base_1$3.Base {
|
|
15546
15552
|
this.wire.sendAction('interop-client-fire-intent-for-context').catch((e) => {
|
15547
15553
|
// don't expose, analytics-only call
|
15548
15554
|
});
|
15549
|
-
const client = await __classPrivateFieldGet$
|
15555
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15550
15556
|
return client.dispatch('fireIntentForContext', context);
|
15551
15557
|
}
|
15552
15558
|
/**
|
@@ -15583,19 +15589,19 @@ class InteropClient extends base_1$3.Base {
|
|
15583
15589
|
*/
|
15584
15590
|
async joinSessionContextGroup(sessionContextGroupId) {
|
15585
15591
|
try {
|
15586
|
-
const currentSessionContextGroup = __classPrivateFieldGet$
|
15592
|
+
const currentSessionContextGroup = __classPrivateFieldGet$4(this, _InteropClient_sessionContextGroups, "f").get(sessionContextGroupId);
|
15587
15593
|
if (currentSessionContextGroup) {
|
15588
15594
|
return currentSessionContextGroup.getUserInstance();
|
15589
15595
|
}
|
15590
|
-
const client = await __classPrivateFieldGet$
|
15596
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15591
15597
|
const { hasConflict } = await client.dispatch('sessionContextGroup:createIfNeeded', {
|
15592
15598
|
sessionContextGroupId
|
15593
15599
|
});
|
15594
15600
|
if (hasConflict) {
|
15595
15601
|
console.warn(`A (non-session) context group with the name "${sessionContextGroupId}" already exists. If you are trying to join a Context Group, call joinContextGroup instead.`);
|
15596
15602
|
}
|
15597
|
-
const newSessionContextGroup = new SessionContextGroupClient_1.default(this.wire, __classPrivateFieldGet$
|
15598
|
-
__classPrivateFieldGet$
|
15603
|
+
const newSessionContextGroup = new SessionContextGroupClient_1.default(this.wire, __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f"), sessionContextGroupId);
|
15604
|
+
__classPrivateFieldGet$4(this, _InteropClient_sessionContextGroups, "f").set(sessionContextGroupId, newSessionContextGroup);
|
15599
15605
|
return newSessionContextGroup.getUserInstance();
|
15600
15606
|
}
|
15601
15607
|
catch (error) {
|
@@ -15622,14 +15628,14 @@ class InteropClient extends base_1$3.Base {
|
|
15622
15628
|
this.wire.sendAction('interop-client-add-ondisconnection-listener').catch((e) => {
|
15623
15629
|
// don't expose, analytics-only call
|
15624
15630
|
});
|
15625
|
-
const client = await __classPrivateFieldGet$
|
15631
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15626
15632
|
return client.onDisconnection((event) => {
|
15627
15633
|
const { uuid } = event;
|
15628
15634
|
listener({ type: 'interop-broker', topic: 'disconnected', brokerName: uuid });
|
15629
15635
|
});
|
15630
15636
|
}
|
15631
15637
|
getFDC3Sync(version) {
|
15632
|
-
return __classPrivateFieldGet$
|
15638
|
+
return __classPrivateFieldGet$4(this, _InteropClient_fdc3Factory, "f").call(this, version, this, this.wire);
|
15633
15639
|
}
|
15634
15640
|
async getFDC3(version) {
|
15635
15641
|
return this.getFDC3Sync(version);
|
@@ -15640,7 +15646,7 @@ class InteropClient extends base_1$3.Base {
|
|
15640
15646
|
* Used to ferry fdc3-only calls from the fdc3 shim to the Interop Broker
|
15641
15647
|
*/
|
15642
15648
|
static async ferryFdc3Call(interopClient, action, payload) {
|
15643
|
-
const client = await __classPrivateFieldGet$
|
15649
|
+
const client = await __classPrivateFieldGet$4(interopClient, _InteropClient_clientPromise, "f");
|
15644
15650
|
return client.dispatch(action, payload || null);
|
15645
15651
|
}
|
15646
15652
|
}
|
@@ -16055,12 +16061,12 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
|
|
16055
16061
|
exports.getIntentResolution = getIntentResolution;
|
16056
16062
|
} (utils$2));
|
16057
16063
|
|
16058
|
-
var __classPrivateFieldGet$
|
16064
|
+
var __classPrivateFieldGet$3 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
16059
16065
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
16060
16066
|
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");
|
16061
16067
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
16062
16068
|
};
|
16063
|
-
var __classPrivateFieldSet$
|
16069
|
+
var __classPrivateFieldSet$3 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
16064
16070
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
16065
16071
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
16066
16072
|
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");
|
@@ -16078,7 +16084,7 @@ const InteropClient_1$2 = InteropClient$1;
|
|
16078
16084
|
const isEqual_1 = __importDefault$2(require$$3);
|
16079
16085
|
class FDC3ModuleBase {
|
16080
16086
|
get client() {
|
16081
|
-
return __classPrivateFieldGet$
|
16087
|
+
return __classPrivateFieldGet$3(this, _FDC3ModuleBase_producer, "f").call(this);
|
16082
16088
|
}
|
16083
16089
|
get fin() {
|
16084
16090
|
return this.wire.getFin();
|
@@ -16087,7 +16093,7 @@ class FDC3ModuleBase {
|
|
16087
16093
|
constructor(producer, wire) {
|
16088
16094
|
this.wire = wire;
|
16089
16095
|
_FDC3ModuleBase_producer.set(this, void 0);
|
16090
|
-
__classPrivateFieldSet$
|
16096
|
+
__classPrivateFieldSet$3(this, _FDC3ModuleBase_producer, producer, "f");
|
16091
16097
|
}
|
16092
16098
|
/**
|
16093
16099
|
* Broadcasts a context for the channel of the current entity.
|
@@ -16868,7 +16874,7 @@ Object.defineProperty(Factory$1, "__esModule", { value: true });
|
|
16868
16874
|
Factory$1.InteropModule = void 0;
|
16869
16875
|
const cloneDeep_1 = __importDefault$1(require$$0$1);
|
16870
16876
|
const inaccessibleObject_1 = inaccessibleObject;
|
16871
|
-
const base_1$
|
16877
|
+
const base_1$3 = base;
|
16872
16878
|
const InteropBroker_1 = InteropBroker$1;
|
16873
16879
|
const InteropClient_1 = InteropClient$1;
|
16874
16880
|
const overrideCheck_1 = overrideCheck$1;
|
@@ -16880,7 +16886,7 @@ const BrokerParamAccessError = 'You have attempted to use or modify InteropBroke
|
|
16880
16886
|
* Manages creation of Interop Brokers and Interop Clients. These APIs are called under-the-hood in Platforms.
|
16881
16887
|
*
|
16882
16888
|
*/
|
16883
|
-
class InteropModule extends base_1$
|
16889
|
+
class InteropModule extends base_1$3.Base {
|
16884
16890
|
/**
|
16885
16891
|
* Initializes an Interop Broker. This is called under-the-hood for Platforms.
|
16886
16892
|
*
|
@@ -17004,13 +17010,13 @@ const channelPrefix = 'snapshot-source-provider-';
|
|
17004
17010
|
const getSnapshotSourceChannelName = (id) => `${channelPrefix}${id.uuid}`;
|
17005
17011
|
utils.getSnapshotSourceChannelName = getSnapshotSourceChannelName;
|
17006
17012
|
|
17007
|
-
var __classPrivateFieldSet$
|
17013
|
+
var __classPrivateFieldSet$2 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
17008
17014
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
17009
17015
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
17010
17016
|
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");
|
17011
17017
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
17012
17018
|
};
|
17013
|
-
var __classPrivateFieldGet$
|
17019
|
+
var __classPrivateFieldGet$2 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
17014
17020
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
17015
17021
|
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");
|
17016
17022
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -17019,7 +17025,7 @@ var _SnapshotSource_identity, _SnapshotSource_getConnection, _SnapshotSource_get
|
|
17019
17025
|
Object.defineProperty(Instance, "__esModule", { value: true });
|
17020
17026
|
Instance.SnapshotSource = void 0;
|
17021
17027
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
17022
|
-
const base_1$
|
17028
|
+
const base_1$2 = base;
|
17023
17029
|
const utils_1$1 = utils;
|
17024
17030
|
const connectionMap = new Map();
|
17025
17031
|
/**
|
@@ -17028,7 +17034,7 @@ const connectionMap = new Map();
|
|
17028
17034
|
* @typeParam Snapshot Implementation-defined shape of an application snapshot. Allows
|
17029
17035
|
* custom snapshot implementations for legacy applications to define their own snapshot format.
|
17030
17036
|
*/
|
17031
|
-
class SnapshotSource extends base_1$
|
17037
|
+
class SnapshotSource extends base_1$2.Base {
|
17032
17038
|
/**
|
17033
17039
|
* @internal
|
17034
17040
|
*/
|
@@ -17042,26 +17048,26 @@ class SnapshotSource extends base_1$1.Base {
|
|
17042
17048
|
return connectionMap.get(this.identity.uuid);
|
17043
17049
|
});
|
17044
17050
|
_SnapshotSource_getClient.set(this, () => {
|
17045
|
-
if (!__classPrivateFieldGet$
|
17046
|
-
__classPrivateFieldGet$
|
17051
|
+
if (!__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise) {
|
17052
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = __classPrivateFieldGet$2(this, _SnapshotSource_startConnection, "f").call(this);
|
17047
17053
|
}
|
17048
|
-
return __classPrivateFieldGet$
|
17054
|
+
return __classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise;
|
17049
17055
|
});
|
17050
17056
|
_SnapshotSource_startConnection.set(this, async () => {
|
17051
17057
|
const channelName = (0, utils_1$1.getSnapshotSourceChannelName)(this.identity);
|
17052
17058
|
try {
|
17053
|
-
if (!__classPrivateFieldGet$
|
17054
|
-
await __classPrivateFieldGet$
|
17059
|
+
if (!__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).eventFired) {
|
17060
|
+
await __classPrivateFieldGet$2(this, _SnapshotSource_setUpConnectionListener, "f").call(this);
|
17055
17061
|
}
|
17056
17062
|
const client = await this.fin.InterApplicationBus.Channel.connect(channelName, { wait: false });
|
17057
17063
|
client.onDisconnection(() => {
|
17058
|
-
__classPrivateFieldGet$
|
17059
|
-
__classPrivateFieldGet$
|
17064
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = null;
|
17065
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).eventFired = null;
|
17060
17066
|
});
|
17061
17067
|
return client;
|
17062
17068
|
}
|
17063
17069
|
catch (e) {
|
17064
|
-
__classPrivateFieldGet$
|
17070
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = null;
|
17065
17071
|
throw new Error("The targeted SnapshotSource is not currently initialized. Await this object's ready() method.");
|
17066
17072
|
}
|
17067
17073
|
});
|
@@ -17073,7 +17079,7 @@ class SnapshotSource extends base_1$1.Base {
|
|
17073
17079
|
resolve = y;
|
17074
17080
|
reject = n;
|
17075
17081
|
});
|
17076
|
-
__classPrivateFieldGet$
|
17082
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).eventFired = eventFired;
|
17077
17083
|
const listener = async (e) => {
|
17078
17084
|
try {
|
17079
17085
|
if (e.channelName === channelName) {
|
@@ -17087,10 +17093,10 @@ class SnapshotSource extends base_1$1.Base {
|
|
17087
17093
|
};
|
17088
17094
|
await this.fin.InterApplicationBus.Channel.on('connected', listener);
|
17089
17095
|
});
|
17090
|
-
__classPrivateFieldSet$
|
17096
|
+
__classPrivateFieldSet$2(this, _SnapshotSource_identity, id, "f");
|
17091
17097
|
}
|
17092
17098
|
get identity() {
|
17093
|
-
return __classPrivateFieldGet$
|
17099
|
+
return __classPrivateFieldGet$2(this, _SnapshotSource_identity, "f");
|
17094
17100
|
}
|
17095
17101
|
/**
|
17096
17102
|
* Method to determine if the SnapshotSource has been initialized.
|
@@ -17126,11 +17132,11 @@ class SnapshotSource extends base_1$1.Base {
|
|
17126
17132
|
// eslint-disable-next-line no-async-promise-executor
|
17127
17133
|
try {
|
17128
17134
|
// If getClient was already called before this, do we have a timing issue where the channel might have been created but we missed the event but this still fails?
|
17129
|
-
await __classPrivateFieldGet$
|
17135
|
+
await __classPrivateFieldGet$2(this, _SnapshotSource_getClient, "f").call(this);
|
17130
17136
|
}
|
17131
17137
|
catch (e) {
|
17132
17138
|
// it was not running.
|
17133
|
-
await __classPrivateFieldGet$
|
17139
|
+
await __classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).eventFired;
|
17134
17140
|
}
|
17135
17141
|
}
|
17136
17142
|
/**
|
@@ -17141,7 +17147,7 @@ class SnapshotSource extends base_1$1.Base {
|
|
17141
17147
|
this.wire.sendAction('snapshot-source-get-snapshot').catch((e) => {
|
17142
17148
|
// don't expose, analytics-only call
|
17143
17149
|
});
|
17144
|
-
const client = await __classPrivateFieldGet$
|
17150
|
+
const client = await __classPrivateFieldGet$2(this, _SnapshotSource_getClient, "f").call(this);
|
17145
17151
|
const response = (await client.dispatch('get-snapshot'));
|
17146
17152
|
return (await response).snapshot;
|
17147
17153
|
}
|
@@ -17153,7 +17159,7 @@ class SnapshotSource extends base_1$1.Base {
|
|
17153
17159
|
this.wire.sendAction('snapshot-source-apply-snapshot').catch((e) => {
|
17154
17160
|
// don't expose, analytics-only call
|
17155
17161
|
});
|
17156
|
-
const client = await __classPrivateFieldGet$
|
17162
|
+
const client = await __classPrivateFieldGet$2(this, _SnapshotSource_getClient, "f").call(this);
|
17157
17163
|
return client.dispatch('apply-snapshot', { snapshot });
|
17158
17164
|
}
|
17159
17165
|
}
|
@@ -17162,13 +17168,13 @@ _SnapshotSource_identity = new WeakMap(), _SnapshotSource_getConnection = new We
|
|
17162
17168
|
|
17163
17169
|
Object.defineProperty(Factory, "__esModule", { value: true });
|
17164
17170
|
Factory.SnapshotSourceModule = void 0;
|
17165
|
-
const base_1 = base;
|
17171
|
+
const base_1$1 = base;
|
17166
17172
|
const Instance_1 = Instance;
|
17167
17173
|
const utils_1 = utils;
|
17168
17174
|
/**
|
17169
17175
|
* Static namespace for OpenFin API methods that interact with the {@link SnapshotSource} class, available under `fin.SnapshotSource`.
|
17170
17176
|
*/
|
17171
|
-
class SnapshotSourceModule extends base_1.Base {
|
17177
|
+
class SnapshotSourceModule extends base_1$1.Base {
|
17172
17178
|
/**
|
17173
17179
|
* Initializes a SnapshotSource with the getSnapshot and applySnapshot methods defined.
|
17174
17180
|
*
|
@@ -17274,6 +17280,114 @@ Factory.SnapshotSourceModule = SnapshotSourceModule;
|
|
17274
17280
|
__exportStar(Instance, exports);
|
17275
17281
|
} (snapshotSource));
|
17276
17282
|
|
17283
|
+
var notificationManager = {};
|
17284
|
+
|
17285
|
+
var factory = {};
|
17286
|
+
|
17287
|
+
var instance = {};
|
17288
|
+
|
17289
|
+
var __classPrivateFieldSet$1 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
17290
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
17291
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
17292
|
+
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");
|
17293
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
17294
|
+
};
|
17295
|
+
var __classPrivateFieldGet$1 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
17296
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
17297
|
+
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");
|
17298
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
17299
|
+
};
|
17300
|
+
var _NotificationManagerInstance_wire, _NotificationManagerInstance_handler, _NotificationManagerInstance_id, _NotificationManagerInstance_isReceivingNotifications;
|
17301
|
+
Object.defineProperty(instance, "__esModule", { value: true });
|
17302
|
+
instance.NotificationManagerInstance = void 0;
|
17303
|
+
const lazy_1 = lazy;
|
17304
|
+
class NotificationManagerInstance {
|
17305
|
+
constructor(wire, id) {
|
17306
|
+
_NotificationManagerInstance_wire.set(this, void 0);
|
17307
|
+
_NotificationManagerInstance_handler.set(this, void 0);
|
17308
|
+
_NotificationManagerInstance_id.set(this, void 0);
|
17309
|
+
_NotificationManagerInstance_isReceivingNotifications.set(this, new lazy_1.Lazy(async () => {
|
17310
|
+
await __classPrivateFieldGet$1(this, _NotificationManagerInstance_wire, "f").registerMessageHandler((message) => {
|
17311
|
+
if (message.action === 'notification-created' && message.payload.managerId === __classPrivateFieldGet$1(this, _NotificationManagerInstance_id, "f")) {
|
17312
|
+
const { notificationId, properties, documentUrl: url, notificationIcon: icon, badge, image } = message.payload;
|
17313
|
+
try {
|
17314
|
+
__classPrivateFieldGet$1(this, _NotificationManagerInstance_handler, "f")?.call(this, {
|
17315
|
+
properties,
|
17316
|
+
images: {
|
17317
|
+
image,
|
17318
|
+
icon,
|
17319
|
+
badge
|
17320
|
+
},
|
17321
|
+
url,
|
17322
|
+
notificationId
|
17323
|
+
});
|
17324
|
+
}
|
17325
|
+
catch (error) {
|
17326
|
+
console.error('Failed to handle notification', error);
|
17327
|
+
}
|
17328
|
+
return true;
|
17329
|
+
}
|
17330
|
+
return false;
|
17331
|
+
});
|
17332
|
+
return true;
|
17333
|
+
}));
|
17334
|
+
this.setNotificationHandler = async (handler) => {
|
17335
|
+
await __classPrivateFieldGet$1(this, _NotificationManagerInstance_isReceivingNotifications, "f").getValue();
|
17336
|
+
__classPrivateFieldSet$1(this, _NotificationManagerInstance_handler, handler, "f");
|
17337
|
+
};
|
17338
|
+
this.destroy = async () => {
|
17339
|
+
await __classPrivateFieldGet$1(this, _NotificationManagerInstance_wire, "f").sendAction('destroy-notification-manager', { managerId: __classPrivateFieldGet$1(this, _NotificationManagerInstance_id, "f") });
|
17340
|
+
};
|
17341
|
+
this.dispatch = async (event) => {
|
17342
|
+
const { notificationId, type } = event;
|
17343
|
+
await __classPrivateFieldGet$1(this, _NotificationManagerInstance_wire, "f").sendAction('dispatch-notification-event', {
|
17344
|
+
notificationId,
|
17345
|
+
type
|
17346
|
+
});
|
17347
|
+
};
|
17348
|
+
__classPrivateFieldSet$1(this, _NotificationManagerInstance_wire, wire, "f");
|
17349
|
+
__classPrivateFieldSet$1(this, _NotificationManagerInstance_id, id, "f");
|
17350
|
+
}
|
17351
|
+
}
|
17352
|
+
instance.NotificationManagerInstance = NotificationManagerInstance;
|
17353
|
+
_NotificationManagerInstance_wire = new WeakMap(), _NotificationManagerInstance_handler = new WeakMap(), _NotificationManagerInstance_id = new WeakMap(), _NotificationManagerInstance_isReceivingNotifications = new WeakMap();
|
17354
|
+
|
17355
|
+
Object.defineProperty(factory, "__esModule", { value: true });
|
17356
|
+
factory.NotificationManagerModule = void 0;
|
17357
|
+
const base_1 = base;
|
17358
|
+
const instance_1 = instance;
|
17359
|
+
class NotificationManagerModule extends base_1.Base {
|
17360
|
+
constructor() {
|
17361
|
+
super(...arguments);
|
17362
|
+
this.init = async () => {
|
17363
|
+
const { payload: { data: { managerId } } } = await this.wire.sendAction('init-notification-manager');
|
17364
|
+
const manager = new instance_1.NotificationManagerInstance(this.wire, managerId);
|
17365
|
+
return manager;
|
17366
|
+
};
|
17367
|
+
}
|
17368
|
+
}
|
17369
|
+
factory.NotificationManagerModule = NotificationManagerModule;
|
17370
|
+
|
17371
|
+
(function (exports) {
|
17372
|
+
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
17373
|
+
if (k2 === undefined) k2 = k;
|
17374
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
17375
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
17376
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
17377
|
+
}
|
17378
|
+
Object.defineProperty(o, k2, desc);
|
17379
|
+
}) : (function(o, m, k, k2) {
|
17380
|
+
if (k2 === undefined) k2 = k;
|
17381
|
+
o[k2] = m[k];
|
17382
|
+
}));
|
17383
|
+
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
17384
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
17385
|
+
};
|
17386
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17387
|
+
__exportStar(factory, exports);
|
17388
|
+
__exportStar(instance, exports);
|
17389
|
+
} (notificationManager));
|
17390
|
+
|
17277
17391
|
Object.defineProperty(fin$2, "__esModule", { value: true });
|
17278
17392
|
var Fin_1 = fin$2.Fin = void 0;
|
17279
17393
|
const events_1$3 = require$$0;
|
@@ -17291,6 +17405,7 @@ const index_10 = platform;
|
|
17291
17405
|
const me_1$2 = me;
|
17292
17406
|
const interop_1 = interop;
|
17293
17407
|
const snapshot_source_1 = snapshotSource;
|
17408
|
+
const notification_manager_1 = notificationManager;
|
17294
17409
|
/**
|
17295
17410
|
* @internal
|
17296
17411
|
*/
|
@@ -17313,6 +17428,7 @@ class Fin extends events_1$3.EventEmitter {
|
|
17313
17428
|
this.View = new index_9.ViewModule(wire);
|
17314
17429
|
this.Interop = new interop_1.InteropModule(wire);
|
17315
17430
|
this.SnapshotSource = new snapshot_source_1.SnapshotSourceModule(wire);
|
17431
|
+
this.NotificationManager = new notification_manager_1.NotificationManagerModule(wire);
|
17316
17432
|
wire.registerFin(this);
|
17317
17433
|
this.me = (0, me_1$2.getMe)(wire);
|
17318
17434
|
// Handle disconnect events
|