@openfin/core 42.100.91 → 42.100.93
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 +94 -0
- package/out/mock-beta.d.ts +94 -0
- package/out/mock-public.d.ts +94 -0
- package/out/stub.d.ts +94 -0
- package/out/stub.js +406 -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}.
|
@@ -4044,6 +4044,37 @@ function requireInstance () {
|
|
4044
4044
|
getAllFrames() {
|
4045
4045
|
return this.wire.sendAction('get-all-frames', this.identity).then(({ payload }) => payload.data);
|
4046
4046
|
}
|
4047
|
+
/**
|
4048
|
+
* Activates the current window and focuses the child entity if it exists. If this does
|
4049
|
+
* not succeed - say the child does not belong to this window, or the identity does not exist -
|
4050
|
+
* it will return false.
|
4051
|
+
*
|
4052
|
+
* @example
|
4053
|
+
* ```js
|
4054
|
+
* const win = fin.Window.wrapSync({ uuid: 'myApp', name: 'myOtherWindow' });
|
4055
|
+
*
|
4056
|
+
* win.getCurrentViews()
|
4057
|
+
* .then(([view1]) => {
|
4058
|
+
* return win.activateAndFocus(view1.identity);
|
4059
|
+
* })
|
4060
|
+
* .then(success => {
|
4061
|
+
* if (success) {
|
4062
|
+
* console.log('Window activated and child focused');
|
4063
|
+
* } else {
|
4064
|
+
* console.log('Window activation failed, focus state unchanged');
|
4065
|
+
* }
|
4066
|
+
* })
|
4067
|
+
* .catch(console.error);
|
4068
|
+
* ```
|
4069
|
+
*/
|
4070
|
+
activateAndFocus(childIdentityToFocus) {
|
4071
|
+
return this.wire
|
4072
|
+
.sendAction('activate-window-and-focus', {
|
4073
|
+
winIdentity: this.identity,
|
4074
|
+
focusIdentity: childIdentityToFocus
|
4075
|
+
})
|
4076
|
+
.then(({ payload }) => payload.data);
|
4077
|
+
}
|
4047
4078
|
/**
|
4048
4079
|
* Gets the current bounds (top, bottom, right, left, width, height) of the window.
|
4049
4080
|
*
|
@@ -5401,7 +5432,7 @@ function requireWindow () {
|
|
5401
5432
|
*/
|
5402
5433
|
Object.defineProperty(system, "__esModule", { value: true });
|
5403
5434
|
system.System = void 0;
|
5404
|
-
const base_1$
|
5435
|
+
const base_1$m = base;
|
5405
5436
|
const transport_errors_1$5 = transportErrors;
|
5406
5437
|
const window_1 = requireWindow();
|
5407
5438
|
const events_1$6 = require$$0;
|
@@ -5411,7 +5442,7 @@ const events_1$6 = require$$0;
|
|
5411
5442
|
* clearing the cache and exiting the runtime as well as listen to {@link OpenFin.SystemEvents system events}.
|
5412
5443
|
*
|
5413
5444
|
*/
|
5414
|
-
class System extends base_1$
|
5445
|
+
class System extends base_1$m.EmitterBase {
|
5415
5446
|
/**
|
5416
5447
|
* @internal
|
5417
5448
|
*/
|
@@ -7722,12 +7753,12 @@ class ChannelError extends Error {
|
|
7722
7753
|
}
|
7723
7754
|
channelError.ChannelError = ChannelError;
|
7724
7755
|
|
7725
|
-
var __classPrivateFieldGet$
|
7756
|
+
var __classPrivateFieldGet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
7726
7757
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
7727
7758
|
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");
|
7728
7759
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
7729
7760
|
};
|
7730
|
-
var __classPrivateFieldSet$
|
7761
|
+
var __classPrivateFieldSet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
7731
7762
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
7732
7763
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
7733
7764
|
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");
|
@@ -7771,7 +7802,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7771
7802
|
static closeChannelByEndpointId(id) {
|
7772
7803
|
const channel = channelClientsByEndpointId.get(id);
|
7773
7804
|
if (channel) {
|
7774
|
-
__classPrivateFieldGet$
|
7805
|
+
__classPrivateFieldGet$h(channel, _ChannelClient_close, "f").call(channel);
|
7775
7806
|
}
|
7776
7807
|
}
|
7777
7808
|
/**
|
@@ -7782,7 +7813,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7782
7813
|
for (const channelClient of channelClientsByEndpointId.values()) {
|
7783
7814
|
if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
|
7784
7815
|
channelClient.disconnectListener(eventPayload);
|
7785
|
-
__classPrivateFieldGet$
|
7816
|
+
__classPrivateFieldGet$h(channelClient, _ChannelClient_close, "f").call(channelClient);
|
7786
7817
|
}
|
7787
7818
|
}
|
7788
7819
|
}
|
@@ -7797,12 +7828,12 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7797
7828
|
this.processAction = (action, payload, senderIdentity) => super.processAction(action, payload, senderIdentity);
|
7798
7829
|
_ChannelClient_close.set(this, () => {
|
7799
7830
|
channelClientsByEndpointId.delete(this.endpointId);
|
7800
|
-
__classPrivateFieldGet$
|
7831
|
+
__classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").close();
|
7801
7832
|
});
|
7802
|
-
__classPrivateFieldSet$
|
7833
|
+
__classPrivateFieldSet$g(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
|
7803
7834
|
this.disconnectListener = () => undefined;
|
7804
7835
|
this.endpointId = routingInfo.endpointId;
|
7805
|
-
__classPrivateFieldSet$
|
7836
|
+
__classPrivateFieldSet$g(this, _ChannelClient_strategy, strategy, "f");
|
7806
7837
|
channelClientsByEndpointId.set(this.endpointId, this);
|
7807
7838
|
strategy.receive(this.processAction);
|
7808
7839
|
}
|
@@ -7810,7 +7841,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7810
7841
|
* a read-only provider identity
|
7811
7842
|
*/
|
7812
7843
|
get providerIdentity() {
|
7813
|
-
const protectedObj = __classPrivateFieldGet$
|
7844
|
+
const protectedObj = __classPrivateFieldGet$h(this, _ChannelClient_protectedObj, "f");
|
7814
7845
|
return protectedObj.providerIdentity;
|
7815
7846
|
}
|
7816
7847
|
/**
|
@@ -7839,9 +7870,9 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7839
7870
|
* ```
|
7840
7871
|
*/
|
7841
7872
|
async dispatch(action, payload) {
|
7842
|
-
if (__classPrivateFieldGet$
|
7873
|
+
if (__classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
|
7843
7874
|
const callSites = transport_errors_1$2.RuntimeError.getCallSite();
|
7844
|
-
return __classPrivateFieldGet$
|
7875
|
+
return __classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
|
7845
7876
|
throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
|
7846
7877
|
});
|
7847
7878
|
}
|
@@ -7893,10 +7924,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7893
7924
|
*/
|
7894
7925
|
async disconnect() {
|
7895
7926
|
await this.sendDisconnectAction();
|
7896
|
-
__classPrivateFieldGet$
|
7927
|
+
__classPrivateFieldGet$h(this, _ChannelClient_close, "f").call(this);
|
7897
7928
|
}
|
7898
7929
|
async sendDisconnectAction() {
|
7899
|
-
const protectedObj = __classPrivateFieldGet$
|
7930
|
+
const protectedObj = __classPrivateFieldGet$h(this, _ChannelClient_protectedObj, "f");
|
7900
7931
|
await protectedObj.close();
|
7901
7932
|
}
|
7902
7933
|
/**
|
@@ -7929,13 +7960,13 @@ exhaustive.exhaustiveCheck = exhaustiveCheck;
|
|
7929
7960
|
|
7930
7961
|
var strategy$3 = {};
|
7931
7962
|
|
7932
|
-
var __classPrivateFieldSet$
|
7963
|
+
var __classPrivateFieldSet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
7933
7964
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
7934
7965
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
7935
7966
|
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");
|
7936
7967
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
7937
7968
|
};
|
7938
|
-
var __classPrivateFieldGet$
|
7969
|
+
var __classPrivateFieldGet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
7939
7970
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
7940
7971
|
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");
|
7941
7972
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -7960,7 +7991,7 @@ class ClassicStrategy {
|
|
7960
7991
|
// connection problems occur
|
7961
7992
|
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
|
7962
7993
|
this.send = async (endpointId, action, payload) => {
|
7963
|
-
const to = __classPrivateFieldGet$
|
7994
|
+
const to = __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
7964
7995
|
if (!to) {
|
7965
7996
|
throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
|
7966
7997
|
}
|
@@ -7972,13 +8003,13 @@ class ClassicStrategy {
|
|
7972
8003
|
}
|
7973
8004
|
delete cleanId.isLocalEndpointId;
|
7974
8005
|
// grab the promise before awaiting it to save in our pending messages map
|
7975
|
-
const p = __classPrivateFieldGet$
|
8006
|
+
const p = __classPrivateFieldGet$g(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
|
7976
8007
|
...cleanId,
|
7977
8008
|
providerIdentity: this.providerIdentity,
|
7978
8009
|
action,
|
7979
8010
|
payload
|
7980
8011
|
});
|
7981
|
-
__classPrivateFieldGet$
|
8012
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
|
7982
8013
|
const raw = await p
|
7983
8014
|
.catch((error) => {
|
7984
8015
|
if ('cause' in error) {
|
@@ -7988,16 +8019,16 @@ class ClassicStrategy {
|
|
7988
8019
|
})
|
7989
8020
|
.finally(() => {
|
7990
8021
|
// clean up the pending promise
|
7991
|
-
__classPrivateFieldGet$
|
8022
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
|
7992
8023
|
});
|
7993
8024
|
return raw.payload.data.result;
|
7994
8025
|
};
|
7995
8026
|
this.close = async () => {
|
7996
8027
|
this.messageReceiver.removeEndpoint(this.providerIdentity.channelId, this.endpointId);
|
7997
|
-
[...__classPrivateFieldGet$
|
7998
|
-
__classPrivateFieldSet$
|
8028
|
+
[...__classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
|
8029
|
+
__classPrivateFieldSet$f(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
|
7999
8030
|
};
|
8000
|
-
__classPrivateFieldSet$
|
8031
|
+
__classPrivateFieldSet$f(this, _ClassicStrategy_wire, wire, "f");
|
8001
8032
|
}
|
8002
8033
|
onEndpointDisconnect(endpointId, listener) {
|
8003
8034
|
// Never fires for 'classic'.
|
@@ -8006,20 +8037,20 @@ class ClassicStrategy {
|
|
8006
8037
|
this.messageReceiver.addEndpoint(listener, this.providerIdentity.channelId, this.endpointId);
|
8007
8038
|
}
|
8008
8039
|
async closeEndpoint(endpointId) {
|
8009
|
-
const id = __classPrivateFieldGet$
|
8010
|
-
__classPrivateFieldGet$
|
8011
|
-
const pendingSet = __classPrivateFieldGet$
|
8040
|
+
const id = __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
8041
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
|
8042
|
+
const pendingSet = __classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
|
8012
8043
|
pendingSet?.forEach((p) => {
|
8013
8044
|
const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
|
8014
8045
|
p.cancel(new Error(errorMsg));
|
8015
8046
|
});
|
8016
8047
|
}
|
8017
8048
|
isEndpointConnected(endpointId) {
|
8018
|
-
return __classPrivateFieldGet$
|
8049
|
+
return __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
|
8019
8050
|
}
|
8020
8051
|
addEndpoint(endpointId, payload) {
|
8021
|
-
__classPrivateFieldGet$
|
8022
|
-
__classPrivateFieldGet$
|
8052
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
|
8053
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
|
8023
8054
|
}
|
8024
8055
|
isValidEndpointPayload(payload) {
|
8025
8056
|
return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
|
@@ -8054,12 +8085,12 @@ function errorToPOJO(error) {
|
|
8054
8085
|
}
|
8055
8086
|
errors.errorToPOJO = errorToPOJO;
|
8056
8087
|
|
8057
|
-
var __classPrivateFieldGet$
|
8088
|
+
var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8058
8089
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8059
8090
|
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");
|
8060
8091
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
8061
8092
|
};
|
8062
|
-
var __classPrivateFieldSet$
|
8093
|
+
var __classPrivateFieldSet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8063
8094
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8064
8095
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8065
8096
|
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");
|
@@ -8094,8 +8125,8 @@ class RTCEndpoint {
|
|
8094
8125
|
if (this.rtc.rtcClient.connectionState !== 'connected') {
|
8095
8126
|
this.rtc.rtcClient.removeEventListener('connectionstatechange', this.connectionStateChangeHandler);
|
8096
8127
|
this.close();
|
8097
|
-
if (__classPrivateFieldGet$
|
8098
|
-
__classPrivateFieldGet$
|
8128
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
|
8129
|
+
__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
8099
8130
|
}
|
8100
8131
|
}
|
8101
8132
|
};
|
@@ -8143,9 +8174,9 @@ class RTCEndpoint {
|
|
8143
8174
|
data = new TextDecoder().decode(e.data);
|
8144
8175
|
}
|
8145
8176
|
const { messageId, action, payload } = JSON.parse(data);
|
8146
|
-
if (__classPrivateFieldGet$
|
8177
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f")) {
|
8147
8178
|
try {
|
8148
|
-
const res = await __classPrivateFieldGet$
|
8179
|
+
const res = await __classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
|
8149
8180
|
this.rtc.channels.response.send(JSON.stringify({
|
8150
8181
|
messageId,
|
8151
8182
|
payload: res,
|
@@ -8179,25 +8210,25 @@ class RTCEndpoint {
|
|
8179
8210
|
datachannel.onclose = (e) => {
|
8180
8211
|
[...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.')));
|
8181
8212
|
this.close();
|
8182
|
-
if (__classPrivateFieldGet$
|
8183
|
-
__classPrivateFieldGet$
|
8213
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
|
8214
|
+
__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
8184
8215
|
}
|
8185
8216
|
};
|
8186
8217
|
});
|
8187
8218
|
}
|
8188
8219
|
onDisconnect(listener) {
|
8189
|
-
if (!__classPrivateFieldGet$
|
8190
|
-
__classPrivateFieldSet$
|
8220
|
+
if (!__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
|
8221
|
+
__classPrivateFieldSet$e(this, _RTCEndpoint_disconnectListener, listener, "f");
|
8191
8222
|
}
|
8192
8223
|
else {
|
8193
8224
|
throw new Error('RTCEndpoint disconnectListener cannot be set twice.');
|
8194
8225
|
}
|
8195
8226
|
}
|
8196
8227
|
receive(listener) {
|
8197
|
-
if (__classPrivateFieldGet$
|
8228
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f")) {
|
8198
8229
|
throw new Error('You have already set a listener for this RTC Endpoint.');
|
8199
8230
|
}
|
8200
|
-
__classPrivateFieldSet$
|
8231
|
+
__classPrivateFieldSet$e(this, _RTCEndpoint_processAction, listener, "f");
|
8201
8232
|
}
|
8202
8233
|
get connected() {
|
8203
8234
|
return this.rtc.rtcClient.connectionState === 'connected';
|
@@ -8208,12 +8239,12 @@ _RTCEndpoint_processAction = new WeakMap(), _RTCEndpoint_disconnectListener = ne
|
|
8208
8239
|
|
8209
8240
|
var strategy$1 = {};
|
8210
8241
|
|
8211
|
-
var __classPrivateFieldGet$
|
8242
|
+
var __classPrivateFieldGet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8212
8243
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8213
8244
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
8214
8245
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
8215
8246
|
};
|
8216
|
-
var __classPrivateFieldSet$
|
8247
|
+
var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8217
8248
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8218
8249
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8219
8250
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
@@ -8234,11 +8265,11 @@ class EndpointStrategy {
|
|
8234
8265
|
return this.getEndpointById(endpointId).send(action, payload);
|
8235
8266
|
};
|
8236
8267
|
this.close = async () => {
|
8237
|
-
if (__classPrivateFieldGet$
|
8238
|
-
__classPrivateFieldGet$
|
8239
|
-
__classPrivateFieldSet$
|
8268
|
+
if (__classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f")) {
|
8269
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
|
8270
|
+
__classPrivateFieldSet$d(this, _EndpointStrategy_endpointMap, new Map(), "f");
|
8240
8271
|
}
|
8241
|
-
__classPrivateFieldSet$
|
8272
|
+
__classPrivateFieldSet$d(this, _EndpointStrategy_connected, false, "f");
|
8242
8273
|
};
|
8243
8274
|
this.isValidEndpointPayload = validateEndpoint;
|
8244
8275
|
}
|
@@ -8246,39 +8277,39 @@ class EndpointStrategy {
|
|
8246
8277
|
this.getEndpointById(endpointId).onDisconnect(listener);
|
8247
8278
|
}
|
8248
8279
|
receive(listener) {
|
8249
|
-
if (__classPrivateFieldGet$
|
8280
|
+
if (__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")) {
|
8250
8281
|
throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);
|
8251
8282
|
}
|
8252
|
-
__classPrivateFieldSet$
|
8283
|
+
__classPrivateFieldSet$d(this, _EndpointStrategy_processAction, listener, "f");
|
8253
8284
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
8254
|
-
__classPrivateFieldGet$
|
8285
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")));
|
8255
8286
|
}
|
8256
8287
|
getEndpointById(endpointId) {
|
8257
|
-
const endpoint = __classPrivateFieldGet$
|
8288
|
+
const endpoint = __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
|
8258
8289
|
if (!endpoint) {
|
8259
8290
|
throw new Error(`Client with endpoint id ${endpointId} is not connected`);
|
8260
8291
|
}
|
8261
8292
|
return endpoint;
|
8262
8293
|
}
|
8263
8294
|
get connected() {
|
8264
|
-
return __classPrivateFieldGet$
|
8295
|
+
return __classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f");
|
8265
8296
|
}
|
8266
8297
|
isEndpointConnected(endpointId) {
|
8267
|
-
return __classPrivateFieldGet$
|
8298
|
+
return __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
|
8268
8299
|
}
|
8269
8300
|
addEndpoint(endpointId, payload) {
|
8270
|
-
if (!__classPrivateFieldGet$
|
8301
|
+
if (!__classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f")) {
|
8271
8302
|
console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);
|
8272
8303
|
return;
|
8273
8304
|
}
|
8274
8305
|
const clientStrat = new this.EndpointType(payload);
|
8275
|
-
if (__classPrivateFieldGet$
|
8276
|
-
clientStrat.receive(__classPrivateFieldGet$
|
8306
|
+
if (__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")) {
|
8307
|
+
clientStrat.receive(__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f"));
|
8277
8308
|
}
|
8278
|
-
__classPrivateFieldGet$
|
8309
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
|
8279
8310
|
}
|
8280
8311
|
async closeEndpoint(endpointId) {
|
8281
|
-
__classPrivateFieldGet$
|
8312
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
|
8282
8313
|
}
|
8283
8314
|
}
|
8284
8315
|
strategy$1.EndpointStrategy = EndpointStrategy;
|
@@ -8305,11 +8336,11 @@ var iceManager = {};
|
|
8305
8336
|
|
8306
8337
|
Object.defineProperty(iceManager, "__esModule", { value: true });
|
8307
8338
|
iceManager.RTCICEManager = void 0;
|
8308
|
-
const base_1$
|
8339
|
+
const base_1$l = base;
|
8309
8340
|
/*
|
8310
8341
|
Singleton that facilitates Offer and Answer exchange required for establishing RTC connections.
|
8311
8342
|
*/
|
8312
|
-
class RTCICEManager extends base_1$
|
8343
|
+
class RTCICEManager extends base_1$l.EmitterBase {
|
8313
8344
|
constructor(wire) {
|
8314
8345
|
super(wire, 'channel');
|
8315
8346
|
this.ensureChannelOpened = (channel) => {
|
@@ -8460,12 +8491,12 @@ function runtimeUuidMeetsMinimumRuntimeVersion(runtimeUuid, minVersion) {
|
|
8460
8491
|
}
|
8461
8492
|
runtimeVersioning.runtimeUuidMeetsMinimumRuntimeVersion = runtimeUuidMeetsMinimumRuntimeVersion;
|
8462
8493
|
|
8463
|
-
var __classPrivateFieldGet$
|
8494
|
+
var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8464
8495
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8465
8496
|
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");
|
8466
8497
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
8467
8498
|
};
|
8468
|
-
var __classPrivateFieldSet$
|
8499
|
+
var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8469
8500
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8470
8501
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8471
8502
|
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");
|
@@ -8509,19 +8540,19 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8509
8540
|
* a read-only array containing all the identities of connecting clients.
|
8510
8541
|
*/
|
8511
8542
|
get connections() {
|
8512
|
-
return [...__classPrivateFieldGet$
|
8543
|
+
return [...__classPrivateFieldGet$d(this, _ChannelProvider_connections, "f")];
|
8513
8544
|
}
|
8514
8545
|
static handleClientDisconnection(channel, payload) {
|
8515
8546
|
if (payload?.endpointId) {
|
8516
8547
|
const { uuid, name, endpointId, isLocalEndpointId } = payload;
|
8517
|
-
__classPrivateFieldGet$
|
8548
|
+
__classPrivateFieldGet$d(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
|
8518
8549
|
}
|
8519
8550
|
else {
|
8520
8551
|
// this is here to support older runtimes that did not have endpointId
|
8521
8552
|
const multipleRemoves = channel.connections.filter((identity) => {
|
8522
8553
|
return identity.uuid === payload.uuid && identity.name === payload.name;
|
8523
8554
|
});
|
8524
|
-
multipleRemoves.forEach(__classPrivateFieldGet$
|
8555
|
+
multipleRemoves.forEach(__classPrivateFieldGet$d(channel, _ChannelProvider_removeEndpoint, "f"));
|
8525
8556
|
}
|
8526
8557
|
channel.disconnectListener(payload);
|
8527
8558
|
}
|
@@ -8538,8 +8569,8 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8538
8569
|
_ChannelProvider_strategy.set(this, void 0);
|
8539
8570
|
_ChannelProvider_removeEndpoint.set(this, (identity) => {
|
8540
8571
|
const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
|
8541
|
-
__classPrivateFieldGet$
|
8542
|
-
__classPrivateFieldSet$
|
8572
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
|
8573
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_connections, remainingConnections, "f");
|
8543
8574
|
});
|
8544
8575
|
// Must be bound.
|
8545
8576
|
this.processAction = async (action, payload, senderIdentity) => {
|
@@ -8553,17 +8584,17 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8553
8584
|
return super.processAction(action, payload, senderIdentity);
|
8554
8585
|
};
|
8555
8586
|
_ChannelProvider_close.set(this, () => {
|
8556
|
-
__classPrivateFieldGet$
|
8587
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").close();
|
8557
8588
|
const remove = ChannelProvider.removalMap.get(this);
|
8558
8589
|
if (remove) {
|
8559
8590
|
remove();
|
8560
8591
|
}
|
8561
8592
|
});
|
8562
|
-
__classPrivateFieldSet$
|
8593
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
|
8563
8594
|
this.connectListener = () => undefined;
|
8564
8595
|
this.disconnectListener = () => undefined;
|
8565
|
-
__classPrivateFieldSet$
|
8566
|
-
__classPrivateFieldSet$
|
8596
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_connections, [], "f");
|
8597
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_strategy, strategy, "f");
|
8567
8598
|
strategy.receive(this.processAction);
|
8568
8599
|
}
|
8569
8600
|
/**
|
@@ -8594,16 +8625,16 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8594
8625
|
*/
|
8595
8626
|
dispatch(to, action, payload) {
|
8596
8627
|
const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
|
8597
|
-
if (endpointId && __classPrivateFieldGet$
|
8628
|
+
if (endpointId && __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
|
8598
8629
|
const callSites = transport_errors_1$1.RuntimeError.getCallSite();
|
8599
|
-
return __classPrivateFieldGet$
|
8630
|
+
return __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
|
8600
8631
|
throw new channel_error_1.ChannelError(e, action, payload, callSites);
|
8601
8632
|
});
|
8602
8633
|
}
|
8603
8634
|
return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
|
8604
8635
|
}
|
8605
8636
|
async processConnection(senderId, payload) {
|
8606
|
-
__classPrivateFieldGet$
|
8637
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_connections, "f").push(senderId);
|
8607
8638
|
return this.connectListener(senderId, payload);
|
8608
8639
|
}
|
8609
8640
|
/**
|
@@ -8626,7 +8657,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8626
8657
|
* ```
|
8627
8658
|
*/
|
8628
8659
|
publish(action, payload) {
|
8629
|
-
return this.connections.map((to) => __classPrivateFieldGet$
|
8660
|
+
return this.connections.map((to) => __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
|
8630
8661
|
}
|
8631
8662
|
/**
|
8632
8663
|
* Register a listener that is called on every new client connection.
|
@@ -8700,11 +8731,11 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8700
8731
|
* ```
|
8701
8732
|
*/
|
8702
8733
|
async destroy() {
|
8703
|
-
const protectedObj = __classPrivateFieldGet$
|
8734
|
+
const protectedObj = __classPrivateFieldGet$d(this, _ChannelProvider_protectedObj, "f");
|
8704
8735
|
protectedObj.providerIdentity;
|
8705
|
-
__classPrivateFieldSet$
|
8736
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_connections, [], "f");
|
8706
8737
|
await protectedObj.close();
|
8707
|
-
__classPrivateFieldGet$
|
8738
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_close, "f").call(this);
|
8708
8739
|
}
|
8709
8740
|
/**
|
8710
8741
|
* Returns an array with info on every Client connected to the Provider
|
@@ -8774,7 +8805,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8774
8805
|
getEndpointIdForOpenFinId(clientIdentity, action) {
|
8775
8806
|
const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
|
8776
8807
|
if (matchingConnections.length >= 2) {
|
8777
|
-
const protectedObj = __classPrivateFieldGet$
|
8808
|
+
const protectedObj = __classPrivateFieldGet$d(this, _ChannelProvider_protectedObj, "f");
|
8778
8809
|
const { uuid, name } = clientIdentity;
|
8779
8810
|
const providerUuid = protectedObj?.providerIdentity.uuid;
|
8780
8811
|
const providerName = protectedObj?.providerIdentity.name;
|
@@ -8810,14 +8841,14 @@ var messageReceiver = {};
|
|
8810
8841
|
Object.defineProperty(messageReceiver, "__esModule", { value: true });
|
8811
8842
|
messageReceiver.MessageReceiver = void 0;
|
8812
8843
|
const client_1$1 = client;
|
8813
|
-
const base_1$
|
8844
|
+
const base_1$k = base;
|
8814
8845
|
const errors_1$1 = errors;
|
8815
8846
|
/*
|
8816
8847
|
This is a singleton (per fin object) tasked with routing messages coming off the ipc to the correct endpoint.
|
8817
8848
|
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.
|
8818
8849
|
If functionality is not about receiving messages, it does not belong here.
|
8819
8850
|
*/
|
8820
|
-
class MessageReceiver extends base_1$
|
8851
|
+
class MessageReceiver extends base_1$k.Base {
|
8821
8852
|
constructor(wire) {
|
8822
8853
|
super(wire);
|
8823
8854
|
this.onmessage = (msg) => {
|
@@ -8986,13 +9017,13 @@ class CombinedStrategy {
|
|
8986
9017
|
}
|
8987
9018
|
strategy.default = CombinedStrategy;
|
8988
9019
|
|
8989
|
-
var __classPrivateFieldSet$
|
9020
|
+
var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8990
9021
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8991
9022
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8992
9023
|
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");
|
8993
9024
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
8994
9025
|
};
|
8995
|
-
var __classPrivateFieldGet$
|
9026
|
+
var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8996
9027
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8997
9028
|
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");
|
8998
9029
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -9004,7 +9035,7 @@ var _ConnectionManager_messageReceiver, _ConnectionManager_rtcConnectionManager;
|
|
9004
9035
|
Object.defineProperty(connectionManager, "__esModule", { value: true });
|
9005
9036
|
connectionManager.ConnectionManager = void 0;
|
9006
9037
|
const exhaustive_1 = exhaustive;
|
9007
|
-
const base_1$
|
9038
|
+
const base_1$j = base;
|
9008
9039
|
const strategy_1 = strategy$3;
|
9009
9040
|
const strategy_2 = strategy$2;
|
9010
9041
|
const ice_manager_1 = iceManager;
|
@@ -9012,7 +9043,7 @@ const provider_1$1 = provider;
|
|
9012
9043
|
const message_receiver_1 = messageReceiver;
|
9013
9044
|
const protocol_manager_1 = protocolManager;
|
9014
9045
|
const strategy_3 = __importDefault$5(strategy);
|
9015
|
-
class ConnectionManager extends base_1$
|
9046
|
+
class ConnectionManager extends base_1$j.Base {
|
9016
9047
|
static getProtocolOptionsFromStrings(protocols) {
|
9017
9048
|
return protocols.map((protocol) => {
|
9018
9049
|
switch (protocol) {
|
@@ -9041,8 +9072,8 @@ class ConnectionManager extends base_1$i.Base {
|
|
9041
9072
|
};
|
9042
9073
|
this.providerMap = new Map();
|
9043
9074
|
this.protocolManager = new protocol_manager_1.ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
|
9044
|
-
__classPrivateFieldSet$
|
9045
|
-
__classPrivateFieldSet$
|
9075
|
+
__classPrivateFieldSet$b(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
|
9076
|
+
__classPrivateFieldSet$b(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
|
9046
9077
|
wire.registerMessageHandler(this.onmessage.bind(this));
|
9047
9078
|
}
|
9048
9079
|
createProvider(options, providerIdentity) {
|
@@ -9053,7 +9084,7 @@ class ConnectionManager extends base_1$i.Base {
|
|
9053
9084
|
case 'rtc':
|
9054
9085
|
return new strategy_2.RTCStrategy();
|
9055
9086
|
case 'classic':
|
9056
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
9087
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f"),
|
9057
9088
|
// Providers do not have an endpointId, use channelId as endpointId in the strategy.
|
9058
9089
|
providerIdentity.channelId, providerIdentity);
|
9059
9090
|
default:
|
@@ -9089,7 +9120,7 @@ class ConnectionManager extends base_1$i.Base {
|
|
9089
9120
|
const supportedProtocols = await Promise.all(protocols.map(async (type) => {
|
9090
9121
|
switch (type) {
|
9091
9122
|
case 'rtc': {
|
9092
|
-
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$
|
9123
|
+
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
|
9093
9124
|
rtcPacket = { rtcClient, channels, channelsOpened };
|
9094
9125
|
return {
|
9095
9126
|
type: 'rtc',
|
@@ -9116,18 +9147,18 @@ class ConnectionManager extends base_1$i.Base {
|
|
9116
9147
|
routingInfo.endpointId = this.wire.environment.getNextMessageId();
|
9117
9148
|
// For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
|
9118
9149
|
// clients that are in the same context as the newly-connected client.
|
9119
|
-
__classPrivateFieldGet$
|
9150
|
+
__classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
|
9120
9151
|
}
|
9121
9152
|
const answer = routingInfo.answer ?? {
|
9122
9153
|
supportedProtocols: [{ type: 'classic', version: 1 }]
|
9123
9154
|
};
|
9124
9155
|
const createStrategyFromAnswer = async (protocol) => {
|
9125
9156
|
if (protocol.type === 'rtc' && rtcPacket) {
|
9126
|
-
await __classPrivateFieldGet$
|
9157
|
+
await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
|
9127
9158
|
return new strategy_2.RTCStrategy();
|
9128
9159
|
}
|
9129
9160
|
if (protocol.type === 'classic') {
|
9130
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
9161
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
|
9131
9162
|
}
|
9132
9163
|
return null;
|
9133
9164
|
};
|
@@ -9195,7 +9226,7 @@ class ConnectionManager extends base_1$i.Base {
|
|
9195
9226
|
clientAnswer = await overlappingProtocols.reduce(async (accumP, protocolToUse) => {
|
9196
9227
|
const answer = await accumP;
|
9197
9228
|
if (protocolToUse.type === 'rtc') {
|
9198
|
-
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$
|
9229
|
+
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
|
9199
9230
|
answer.supportedProtocols.push({
|
9200
9231
|
type: 'rtc',
|
9201
9232
|
version: strategy_2.RTCInfo.version,
|
@@ -9243,13 +9274,13 @@ _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnec
|
|
9243
9274
|
*
|
9244
9275
|
* @packageDocumentation
|
9245
9276
|
*/
|
9246
|
-
var __classPrivateFieldSet$
|
9277
|
+
var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
9247
9278
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
9248
9279
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
9249
9280
|
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");
|
9250
9281
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
9251
9282
|
};
|
9252
|
-
var __classPrivateFieldGet$
|
9283
|
+
var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
9253
9284
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
9254
9285
|
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");
|
9255
9286
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -9259,8 +9290,8 @@ Object.defineProperty(channel$1, "__esModule", { value: true });
|
|
9259
9290
|
channel$1.Channel = void 0;
|
9260
9291
|
/* eslint-disable no-console */
|
9261
9292
|
const events_1$5 = require$$0;
|
9262
|
-
const lazy_1$
|
9263
|
-
const base_1$
|
9293
|
+
const lazy_1$3 = lazy;
|
9294
|
+
const base_1$i = base;
|
9264
9295
|
const client_1 = client;
|
9265
9296
|
const connection_manager_1 = connectionManager;
|
9266
9297
|
const provider_1 = provider;
|
@@ -9291,7 +9322,7 @@ function retryDelay(count) {
|
|
9291
9322
|
* * {@link Channel.onChannelConnect onChannelConnect(listener)}
|
9292
9323
|
* * {@link Channel.onChannelDisconnect onChannelDisconnect(listener)}
|
9293
9324
|
*/
|
9294
|
-
class Channel extends base_1$
|
9325
|
+
class Channel extends base_1$i.EmitterBase {
|
9295
9326
|
/**
|
9296
9327
|
* @internal
|
9297
9328
|
*/
|
@@ -9300,17 +9331,17 @@ class Channel extends base_1$h.EmitterBase {
|
|
9300
9331
|
_Channel_connectionManager.set(this, void 0);
|
9301
9332
|
_Channel_internalEmitter.set(this, new events_1$5.EventEmitter());
|
9302
9333
|
// OpenFin API has not been injected at construction time, *must* wait for API to be ready.
|
9303
|
-
_Channel_readyToConnect.set(this, new lazy_1$
|
9334
|
+
_Channel_readyToConnect.set(this, new lazy_1$3.AsyncRetryableLazy(async () => {
|
9304
9335
|
await Promise.all([
|
9305
9336
|
this.on('disconnected', (eventPayload) => {
|
9306
9337
|
client_1.ChannelClient.handleProviderDisconnect(eventPayload);
|
9307
9338
|
}),
|
9308
9339
|
this.on('connected', (...args) => {
|
9309
|
-
__classPrivateFieldGet$
|
9340
|
+
__classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").emit('connected', ...args);
|
9310
9341
|
})
|
9311
9342
|
]).catch(() => new Error('error setting up channel connection listeners'));
|
9312
9343
|
}));
|
9313
|
-
__classPrivateFieldSet$
|
9344
|
+
__classPrivateFieldSet$a(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
|
9314
9345
|
}
|
9315
9346
|
/**
|
9316
9347
|
*
|
@@ -9385,7 +9416,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
9385
9416
|
resolve(true);
|
9386
9417
|
}
|
9387
9418
|
};
|
9388
|
-
__classPrivateFieldGet$
|
9419
|
+
__classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
|
9389
9420
|
});
|
9390
9421
|
try {
|
9391
9422
|
if (retryInfo.count > 0) {
|
@@ -9417,7 +9448,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
9417
9448
|
finally {
|
9418
9449
|
retryInfo.count += 1;
|
9419
9450
|
// in case of other errors, remove our listener
|
9420
|
-
__classPrivateFieldGet$
|
9451
|
+
__classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
|
9421
9452
|
}
|
9422
9453
|
} while (shouldWait); // If we're waiting we retry the above loop
|
9423
9454
|
// Should wait was false, no channel was found.
|
@@ -9476,12 +9507,12 @@ class Channel extends base_1$h.EmitterBase {
|
|
9476
9507
|
async connect(channelName, options = {}) {
|
9477
9508
|
// Make sure we don't connect before listeners are set up
|
9478
9509
|
// This also errors if we're not in OpenFin, ensuring we don't run unnecessary code
|
9479
|
-
await __classPrivateFieldGet$
|
9510
|
+
await __classPrivateFieldGet$b(this, _Channel_readyToConnect, "f").getValue();
|
9480
9511
|
if (!channelName || typeof channelName !== 'string') {
|
9481
9512
|
throw new Error('Please provide a channelName string to connect to a channel.');
|
9482
9513
|
}
|
9483
9514
|
const opts = { wait: true, ...this.wire.environment.getDefaultChannelOptions().connect, ...options };
|
9484
|
-
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$
|
9515
|
+
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createClientOffer(opts);
|
9485
9516
|
let connectionUrl;
|
9486
9517
|
if (this.fin.me.isFrame || this.fin.me.isView || this.fin.me.isWindow) {
|
9487
9518
|
connectionUrl = (await this.fin.me.getInfo()).url;
|
@@ -9493,7 +9524,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
9493
9524
|
connectionUrl
|
9494
9525
|
};
|
9495
9526
|
const routingInfo = await this.safeConnect(channelName, opts.wait, connectPayload);
|
9496
|
-
const strategy = await __classPrivateFieldGet$
|
9527
|
+
const strategy = await __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
|
9497
9528
|
const channel = new client_1.ChannelClient(routingInfo, () => client_1.ChannelClient.wireClose(this.wire, routingInfo, routingInfo.endpointId), strategy);
|
9498
9529
|
// It is the client's responsibility to handle endpoint disconnection to the provider.
|
9499
9530
|
// If the endpoint dies, the client will force a disconnection through the core.
|
@@ -9562,7 +9593,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
9562
9593
|
throw new Error('Please provide a channelName to create a channel');
|
9563
9594
|
}
|
9564
9595
|
const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
|
9565
|
-
const channel = __classPrivateFieldGet$
|
9596
|
+
const channel = __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
|
9566
9597
|
// TODO: fix typing (internal)
|
9567
9598
|
// @ts-expect-error
|
9568
9599
|
this.on('client-disconnected', (eventPayload) => {
|
@@ -9586,7 +9617,7 @@ interappbus.InterAppPayload = interappbus.InterApplicationBus = void 0;
|
|
9586
9617
|
* @packageDocumentation
|
9587
9618
|
*/
|
9588
9619
|
const events_1$4 = require$$0;
|
9589
|
-
const base_1$
|
9620
|
+
const base_1$h = base;
|
9590
9621
|
const ref_counter_1 = refCounter;
|
9591
9622
|
const index_1$2 = channel$1;
|
9592
9623
|
const validate_1$3 = validate;
|
@@ -9594,7 +9625,7 @@ const validate_1$3 = validate;
|
|
9594
9625
|
* A messaging bus that allows for pub/sub messaging between different applications.
|
9595
9626
|
*
|
9596
9627
|
*/
|
9597
|
-
class InterApplicationBus extends base_1$
|
9628
|
+
class InterApplicationBus extends base_1$h.Base {
|
9598
9629
|
/**
|
9599
9630
|
* @internal
|
9600
9631
|
*/
|
@@ -9800,12 +9831,12 @@ var clipboard = {};
|
|
9800
9831
|
*/
|
9801
9832
|
Object.defineProperty(clipboard, "__esModule", { value: true });
|
9802
9833
|
clipboard.Clipboard = void 0;
|
9803
|
-
const base_1$
|
9834
|
+
const base_1$g = base;
|
9804
9835
|
/**
|
9805
9836
|
* The Clipboard API allows reading and writing to the clipboard in multiple formats.
|
9806
9837
|
*
|
9807
9838
|
*/
|
9808
|
-
class Clipboard extends base_1$
|
9839
|
+
class Clipboard extends base_1$g.Base {
|
9809
9840
|
/**
|
9810
9841
|
* Writes data into the clipboard as plain text
|
9811
9842
|
* @param writeObj The object for writing data into the clipboard
|
@@ -9994,7 +10025,7 @@ var Instance$4 = {};
|
|
9994
10025
|
Object.defineProperty(Instance$4, "__esModule", { value: true });
|
9995
10026
|
Instance$4.ExternalApplication = void 0;
|
9996
10027
|
/* eslint-disable import/prefer-default-export */
|
9997
|
-
const base_1$
|
10028
|
+
const base_1$f = base;
|
9998
10029
|
/**
|
9999
10030
|
* An ExternalApplication object representing native language adapter connections to the runtime. Allows
|
10000
10031
|
* the developer to listen to {@link OpenFin.ExternalApplicationEvents external application events}.
|
@@ -10005,7 +10036,7 @@ const base_1$e = base;
|
|
10005
10036
|
* - Processes started via `System.launchExternalApplication`
|
10006
10037
|
* - Processes monitored via `System.monitorExternalProcess`
|
10007
10038
|
*/
|
10008
|
-
class ExternalApplication extends base_1$
|
10039
|
+
class ExternalApplication extends base_1$f.EmitterBase {
|
10009
10040
|
/**
|
10010
10041
|
* @internal
|
10011
10042
|
*/
|
@@ -10033,12 +10064,12 @@ Instance$4.ExternalApplication = ExternalApplication;
|
|
10033
10064
|
|
10034
10065
|
Object.defineProperty(Factory$5, "__esModule", { value: true });
|
10035
10066
|
Factory$5.ExternalApplicationModule = void 0;
|
10036
|
-
const base_1$
|
10067
|
+
const base_1$e = base;
|
10037
10068
|
const Instance_1$4 = Instance$4;
|
10038
10069
|
/**
|
10039
10070
|
* Static namespace for OpenFin API methods that interact with the {@link ExternalApplication} class, available under `fin.ExternalApplication`.
|
10040
10071
|
*/
|
10041
|
-
class ExternalApplicationModule extends base_1$
|
10072
|
+
class ExternalApplicationModule extends base_1$e.Base {
|
10042
10073
|
/**
|
10043
10074
|
* Asynchronously returns an External Application object that represents an external application.
|
10044
10075
|
* <br>It is possible to wrap a process that does not yet exist, (for example, to listen for startup-related events)
|
@@ -10120,7 +10151,7 @@ var Instance$3 = {};
|
|
10120
10151
|
Object.defineProperty(Instance$3, "__esModule", { value: true });
|
10121
10152
|
Instance$3._Frame = void 0;
|
10122
10153
|
/* eslint-disable import/prefer-default-export */
|
10123
|
-
const base_1$
|
10154
|
+
const base_1$d = base;
|
10124
10155
|
/**
|
10125
10156
|
* An iframe represents an embedded HTML page within a parent HTML page. Because this embedded page
|
10126
10157
|
* has its own DOM and global JS context (which may or may not be linked to that of the parent depending
|
@@ -10141,7 +10172,7 @@ const base_1$c = base;
|
|
10141
10172
|
* The fin.Frame namespace represents a way to interact with `iframes` and facilitates the discovery of current context
|
10142
10173
|
* (iframe or main window) as well as the ability to listen for {@link OpenFin.FrameEvents frame-specific events}.
|
10143
10174
|
*/
|
10144
|
-
class _Frame extends base_1$
|
10175
|
+
class _Frame extends base_1$d.EmitterBase {
|
10145
10176
|
/**
|
10146
10177
|
* @internal
|
10147
10178
|
*/
|
@@ -10187,13 +10218,13 @@ Instance$3._Frame = _Frame;
|
|
10187
10218
|
|
10188
10219
|
Object.defineProperty(Factory$4, "__esModule", { value: true });
|
10189
10220
|
Factory$4._FrameModule = void 0;
|
10190
|
-
const base_1$
|
10221
|
+
const base_1$c = base;
|
10191
10222
|
const validate_1$2 = validate;
|
10192
10223
|
const Instance_1$3 = Instance$3;
|
10193
10224
|
/**
|
10194
10225
|
* Static namespace for OpenFin API methods that interact with the {@link _Frame} class, available under `fin.Frame`.
|
10195
10226
|
*/
|
10196
|
-
class _FrameModule extends base_1$
|
10227
|
+
class _FrameModule extends base_1$c.Base {
|
10197
10228
|
/**
|
10198
10229
|
* Asynchronously returns an API handle for the given Frame identity.
|
10199
10230
|
*
|
@@ -10314,12 +10345,12 @@ var globalHotkey = {};
|
|
10314
10345
|
|
10315
10346
|
Object.defineProperty(globalHotkey, "__esModule", { value: true });
|
10316
10347
|
globalHotkey.GlobalHotkey = void 0;
|
10317
|
-
const base_1$
|
10348
|
+
const base_1$b = base;
|
10318
10349
|
/**
|
10319
10350
|
* The GlobalHotkey module can register/unregister a global hotkeys.
|
10320
10351
|
*
|
10321
10352
|
*/
|
10322
|
-
class GlobalHotkey extends base_1$
|
10353
|
+
class GlobalHotkey extends base_1$b.EmitterBase {
|
10323
10354
|
/**
|
10324
10355
|
* @internal
|
10325
10356
|
*/
|
@@ -10453,13 +10484,13 @@ var Factory$3 = {};
|
|
10453
10484
|
|
10454
10485
|
var Instance$2 = {};
|
10455
10486
|
|
10456
|
-
var __classPrivateFieldSet$
|
10487
|
+
var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
10457
10488
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
10458
10489
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
10459
10490
|
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");
|
10460
10491
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
10461
10492
|
};
|
10462
|
-
var __classPrivateFieldGet$
|
10493
|
+
var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
10463
10494
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
10464
10495
|
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");
|
10465
10496
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -10468,14 +10499,14 @@ var _Platform_channelName, _Platform_connectToProvider;
|
|
10468
10499
|
Object.defineProperty(Instance$2, "__esModule", { value: true });
|
10469
10500
|
Instance$2.Platform = void 0;
|
10470
10501
|
/* eslint-disable import/prefer-default-export, no-undef */
|
10471
|
-
const base_1$
|
10502
|
+
const base_1$a = base;
|
10472
10503
|
const validate_1$1 = validate;
|
10473
10504
|
/** Manages the life cycle of windows and views in the application.
|
10474
10505
|
*
|
10475
10506
|
* Enables taking snapshots of itself and applying them to restore a previous configuration
|
10476
10507
|
* as well as listen to {@link OpenFin.PlatformEvents platform events}.
|
10477
10508
|
*/
|
10478
|
-
class Platform extends base_1$
|
10509
|
+
class Platform extends base_1$a.EmitterBase {
|
10479
10510
|
/**
|
10480
10511
|
* @internal
|
10481
10512
|
*/
|
@@ -10496,24 +10527,24 @@ class Platform extends base_1$9.EmitterBase {
|
|
10496
10527
|
this.wire.sendAction('platform-get-client', this.identity).catch((e) => {
|
10497
10528
|
// don't expose
|
10498
10529
|
});
|
10499
|
-
if (!Platform.clientMap.has(__classPrivateFieldGet$
|
10500
|
-
const clientPromise = __classPrivateFieldGet$
|
10501
|
-
Platform.clientMap.set(__classPrivateFieldGet$
|
10530
|
+
if (!Platform.clientMap.has(__classPrivateFieldGet$a(this, _Platform_channelName, "f"))) {
|
10531
|
+
const clientPromise = __classPrivateFieldGet$a(this, _Platform_connectToProvider, "f").call(this);
|
10532
|
+
Platform.clientMap.set(__classPrivateFieldGet$a(this, _Platform_channelName, "f"), clientPromise);
|
10502
10533
|
}
|
10503
10534
|
// we set it above
|
10504
10535
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
10505
|
-
return Platform.clientMap.get(__classPrivateFieldGet$
|
10536
|
+
return Platform.clientMap.get(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
|
10506
10537
|
};
|
10507
10538
|
_Platform_connectToProvider.set(this, async () => {
|
10508
10539
|
try {
|
10509
|
-
const client = await this._channel.connect(__classPrivateFieldGet$
|
10540
|
+
const client = await this._channel.connect(__classPrivateFieldGet$a(this, _Platform_channelName, "f"), { wait: false });
|
10510
10541
|
client.onDisconnection(() => {
|
10511
|
-
Platform.clientMap.delete(__classPrivateFieldGet$
|
10542
|
+
Platform.clientMap.delete(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
|
10512
10543
|
});
|
10513
10544
|
return client;
|
10514
10545
|
}
|
10515
10546
|
catch (e) {
|
10516
|
-
Platform.clientMap.delete(__classPrivateFieldGet$
|
10547
|
+
Platform.clientMap.delete(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
|
10517
10548
|
throw new Error('The targeted Platform is not currently running. Listen for application-started event for the given Uuid.');
|
10518
10549
|
}
|
10519
10550
|
});
|
@@ -10526,7 +10557,7 @@ class Platform extends base_1$9.EmitterBase {
|
|
10526
10557
|
if (errorMsg) {
|
10527
10558
|
throw new Error(errorMsg);
|
10528
10559
|
}
|
10529
|
-
__classPrivateFieldSet$
|
10560
|
+
__classPrivateFieldSet$9(this, _Platform_channelName, channelName, "f");
|
10530
10561
|
this._channel = this.fin.InterApplicationBus.Channel;
|
10531
10562
|
this.identity = { uuid: identity.uuid };
|
10532
10563
|
this.Layout = this.fin.Platform.Layout;
|
@@ -11582,13 +11613,13 @@ const createRelayedDispatch = (client, target, relayId, relayErrorMsg) => async
|
|
11582
11613
|
};
|
11583
11614
|
channelApiRelay.createRelayedDispatch = createRelayedDispatch;
|
11584
11615
|
|
11585
|
-
var __classPrivateFieldSet$
|
11616
|
+
var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
11586
11617
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
11587
11618
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
11588
11619
|
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");
|
11589
11620
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
11590
11621
|
};
|
11591
|
-
var __classPrivateFieldGet$
|
11622
|
+
var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
11592
11623
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
11593
11624
|
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");
|
11594
11625
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -11642,7 +11673,7 @@ class LayoutNode {
|
|
11642
11673
|
* console.log(`The parent ColumnOrRow is root: ${parentIsRoot}`);
|
11643
11674
|
* ```
|
11644
11675
|
*/
|
11645
|
-
this.isRoot = () => __classPrivateFieldGet$
|
11676
|
+
this.isRoot = () => __classPrivateFieldGet$9(this, _LayoutNode_client, "f").isRoot(this.entityId);
|
11646
11677
|
/**
|
11647
11678
|
* Checks if the TabStack or ColumnOrRow exists
|
11648
11679
|
*
|
@@ -11662,7 +11693,7 @@ class LayoutNode {
|
|
11662
11693
|
* console.log(`The entity exists: ${exists}`);
|
11663
11694
|
* ```
|
11664
11695
|
*/
|
11665
|
-
this.exists = () => __classPrivateFieldGet$
|
11696
|
+
this.exists = () => __classPrivateFieldGet$9(this, _LayoutNode_client, "f").exists(this.entityId);
|
11666
11697
|
/**
|
11667
11698
|
* Retrieves the parent of the TabStack or ColumnOrRow
|
11668
11699
|
*
|
@@ -11683,11 +11714,11 @@ class LayoutNode {
|
|
11683
11714
|
* ```
|
11684
11715
|
*/
|
11685
11716
|
this.getParent = async () => {
|
11686
|
-
const parent = await __classPrivateFieldGet$
|
11717
|
+
const parent = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").getParent(this.entityId);
|
11687
11718
|
if (!parent) {
|
11688
11719
|
return undefined;
|
11689
11720
|
}
|
11690
|
-
return LayoutNode.getEntity(parent, __classPrivateFieldGet$
|
11721
|
+
return LayoutNode.getEntity(parent, __classPrivateFieldGet$9(this, _LayoutNode_client, "f"));
|
11691
11722
|
};
|
11692
11723
|
/**
|
11693
11724
|
* Creates a new TabStack adjacent to the given TabStack or ColumnOrRow. Inputs can be new views to create, or existing views.
|
@@ -11738,8 +11769,8 @@ class LayoutNode {
|
|
11738
11769
|
* @experimental
|
11739
11770
|
*/
|
11740
11771
|
this.createAdjacentStack = async (views, options) => {
|
11741
|
-
const entityId = await __classPrivateFieldGet$
|
11742
|
-
return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet$
|
11772
|
+
const entityId = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").createAdjacentStack(this.entityId, views, options);
|
11773
|
+
return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet$9(this, _LayoutNode_client, "f"));
|
11743
11774
|
};
|
11744
11775
|
/**
|
11745
11776
|
* Retrieves the adjacent TabStacks of the given TabStack or ColumnOrRow.
|
@@ -11767,16 +11798,16 @@ class LayoutNode {
|
|
11767
11798
|
* @experimental
|
11768
11799
|
*/
|
11769
11800
|
this.getAdjacentStacks = async (edge) => {
|
11770
|
-
const adjacentStacks = await __classPrivateFieldGet$
|
11801
|
+
const adjacentStacks = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").getAdjacentStacks({
|
11771
11802
|
targetId: this.entityId,
|
11772
11803
|
edge
|
11773
11804
|
});
|
11774
11805
|
return adjacentStacks.map((stack) => LayoutNode.getEntity({
|
11775
11806
|
type: 'stack',
|
11776
11807
|
entityId: stack.entityId
|
11777
|
-
}, __classPrivateFieldGet$
|
11808
|
+
}, __classPrivateFieldGet$9(this, _LayoutNode_client, "f")));
|
11778
11809
|
};
|
11779
|
-
__classPrivateFieldSet$
|
11810
|
+
__classPrivateFieldSet$8(this, _LayoutNode_client, client, "f");
|
11780
11811
|
this.entityId = entityId;
|
11781
11812
|
}
|
11782
11813
|
}
|
@@ -11849,7 +11880,7 @@ class TabStack extends LayoutNode {
|
|
11849
11880
|
* ```
|
11850
11881
|
* @experimental
|
11851
11882
|
*/
|
11852
|
-
this.getViews = () => __classPrivateFieldGet$
|
11883
|
+
this.getViews = () => __classPrivateFieldGet$9(this, _TabStack_client, "f").getStackViews(this.entityId);
|
11853
11884
|
/**
|
11854
11885
|
* Adds or creates a view in this {@link TabStack}.
|
11855
11886
|
*
|
@@ -11879,7 +11910,7 @@ class TabStack extends LayoutNode {
|
|
11879
11910
|
* ```
|
11880
11911
|
* @experimental
|
11881
11912
|
*/
|
11882
|
-
this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet$
|
11913
|
+
this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet$9(this, _TabStack_client, "f").addViewToStack(this.entityId, view, options);
|
11883
11914
|
/**
|
11884
11915
|
* Removes a view from this {@link TabStack}.
|
11885
11916
|
*
|
@@ -11909,7 +11940,7 @@ class TabStack extends LayoutNode {
|
|
11909
11940
|
* ```
|
11910
11941
|
*/
|
11911
11942
|
this.removeView = async (view) => {
|
11912
|
-
await __classPrivateFieldGet$
|
11943
|
+
await __classPrivateFieldGet$9(this, _TabStack_client, "f").removeViewFromStack(this.entityId, view);
|
11913
11944
|
};
|
11914
11945
|
/**
|
11915
11946
|
* Sets the active view of the {@link TabStack} without focusing it.
|
@@ -11933,9 +11964,9 @@ class TabStack extends LayoutNode {
|
|
11933
11964
|
* @experimental
|
11934
11965
|
*/
|
11935
11966
|
this.setActiveView = async (view) => {
|
11936
|
-
await __classPrivateFieldGet$
|
11967
|
+
await __classPrivateFieldGet$9(this, _TabStack_client, "f").setStackActiveView(this.entityId, view);
|
11937
11968
|
};
|
11938
|
-
__classPrivateFieldSet$
|
11969
|
+
__classPrivateFieldSet$8(this, _TabStack_client, client, "f");
|
11939
11970
|
}
|
11940
11971
|
}
|
11941
11972
|
layoutEntities.TabStack = TabStack;
|
@@ -11974,10 +12005,10 @@ class ColumnOrRow extends LayoutNode {
|
|
11974
12005
|
* ```
|
11975
12006
|
*/
|
11976
12007
|
this.getContent = async () => {
|
11977
|
-
const contentItemEntities = await __classPrivateFieldGet$
|
11978
|
-
return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet$
|
12008
|
+
const contentItemEntities = await __classPrivateFieldGet$9(this, _ColumnOrRow_client, "f").getContent(this.entityId);
|
12009
|
+
return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet$9(this, _ColumnOrRow_client, "f")));
|
11979
12010
|
};
|
11980
|
-
__classPrivateFieldSet$
|
12011
|
+
__classPrivateFieldSet$8(this, _ColumnOrRow_client, client, "f");
|
11981
12012
|
this.type = type;
|
11982
12013
|
}
|
11983
12014
|
}
|
@@ -11992,7 +12023,7 @@ layout_constants.LAYOUT_CONTROLLER_ID = 'layout-entities';
|
|
11992
12023
|
// TODO: eventually export this somehow
|
11993
12024
|
layout_constants.DEFAULT_LAYOUT_KEY = '__default__';
|
11994
12025
|
|
11995
|
-
var __classPrivateFieldGet$
|
12026
|
+
var __classPrivateFieldGet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
11996
12027
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
11997
12028
|
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");
|
11998
12029
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -12000,9 +12031,9 @@ var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
12000
12031
|
var _Layout_instances, _Layout_layoutClient, _Layout_forwardLayoutAction;
|
12001
12032
|
Object.defineProperty(Instance$1, "__esModule", { value: true });
|
12002
12033
|
Instance$1.Layout = void 0;
|
12003
|
-
const lazy_1$
|
12034
|
+
const lazy_1$2 = lazy;
|
12004
12035
|
const validate_1 = validate;
|
12005
|
-
const base_1$
|
12036
|
+
const base_1$9 = base;
|
12006
12037
|
const common_utils_1$1 = commonUtils;
|
12007
12038
|
const layout_entities_1 = layoutEntities;
|
12008
12039
|
const layout_constants_1$1 = layout_constants;
|
@@ -12138,12 +12169,12 @@ const layout_constants_1$1 = layout_constants;
|
|
12138
12169
|
* }
|
12139
12170
|
* ```
|
12140
12171
|
*/
|
12141
|
-
class Layout extends base_1$
|
12172
|
+
class Layout extends base_1$9.Base {
|
12142
12173
|
/**
|
12143
12174
|
* @internal
|
12144
12175
|
*/
|
12145
12176
|
static getClient(layout) {
|
12146
|
-
return __classPrivateFieldGet$
|
12177
|
+
return __classPrivateFieldGet$8(layout, _Layout_layoutClient, "f").getValue();
|
12147
12178
|
}
|
12148
12179
|
/**
|
12149
12180
|
* @internal
|
@@ -12157,7 +12188,7 @@ class Layout extends base_1$8.Base {
|
|
12157
12188
|
* Lazily constructed {@link LayoutEntitiesClient} bound to this platform's client and identity
|
12158
12189
|
* The client is for {@link LayoutEntitiesController}
|
12159
12190
|
*/
|
12160
|
-
_Layout_layoutClient.set(this, new lazy_1$
|
12191
|
+
_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)));
|
12161
12192
|
/**
|
12162
12193
|
* Replaces a Platform window's layout with a new layout.
|
12163
12194
|
*
|
@@ -12366,7 +12397,7 @@ class Layout extends base_1$8.Base {
|
|
12366
12397
|
this.wire.sendAction('layout-get-root-item').catch(() => {
|
12367
12398
|
// don't expose
|
12368
12399
|
});
|
12369
|
-
const client = await __classPrivateFieldGet$
|
12400
|
+
const client = await __classPrivateFieldGet$8(this, _Layout_layoutClient, "f").getValue();
|
12370
12401
|
const root = await client.getRoot('layoutName' in this.identity ? this.identity : undefined);
|
12371
12402
|
return layout_entities_1.LayoutNode.getEntity(root, client);
|
12372
12403
|
}
|
@@ -12384,7 +12415,7 @@ class Layout extends base_1$8.Base {
|
|
12384
12415
|
this.wire.sendAction('layout-get-stack-by-view').catch(() => {
|
12385
12416
|
// don't expose
|
12386
12417
|
});
|
12387
|
-
const client = await __classPrivateFieldGet$
|
12418
|
+
const client = await __classPrivateFieldGet$8(this, _Layout_layoutClient, "f").getValue();
|
12388
12419
|
const stack = await client.getStackByView(identity);
|
12389
12420
|
if (!stack) {
|
12390
12421
|
throw new Error(`No stack found for view: ${identity.uuid}/${identity.name}`);
|
@@ -12404,7 +12435,7 @@ class Layout extends base_1$8.Base {
|
|
12404
12435
|
this.wire.sendAction('layout-add-view').catch((e) => {
|
12405
12436
|
// don't expose
|
12406
12437
|
});
|
12407
|
-
const { identity } = await __classPrivateFieldGet$
|
12438
|
+
const { identity } = await __classPrivateFieldGet$8(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-add-view', {
|
12408
12439
|
viewOptions,
|
12409
12440
|
location,
|
12410
12441
|
targetView
|
@@ -12422,7 +12453,7 @@ class Layout extends base_1$8.Base {
|
|
12422
12453
|
this.wire.sendAction('layout-close-view').catch((e) => {
|
12423
12454
|
// don't expose
|
12424
12455
|
});
|
12425
|
-
await __classPrivateFieldGet$
|
12456
|
+
await __classPrivateFieldGet$8(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-close-view', { viewIdentity });
|
12426
12457
|
}
|
12427
12458
|
}
|
12428
12459
|
Instance$1.Layout = Layout;
|
@@ -12436,12 +12467,12 @@ async function _Layout_forwardLayoutAction(action, payload) {
|
|
12436
12467
|
return client.dispatch(action, { target: this.identity, opts: payload });
|
12437
12468
|
};
|
12438
12469
|
|
12439
|
-
var __classPrivateFieldGet$
|
12470
|
+
var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
12440
12471
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
12441
12472
|
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");
|
12442
12473
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
12443
12474
|
};
|
12444
|
-
var __classPrivateFieldSet$
|
12475
|
+
var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
12445
12476
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
12446
12477
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
12447
12478
|
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");
|
@@ -12450,13 +12481,13 @@ var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
12450
12481
|
var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_getLayoutManagerSpy, _LayoutModule_getSafeLayoutManager;
|
12451
12482
|
Object.defineProperty(Factory$2, "__esModule", { value: true });
|
12452
12483
|
Factory$2.LayoutModule = void 0;
|
12453
|
-
const base_1$
|
12484
|
+
const base_1$8 = base;
|
12454
12485
|
const Instance_1$2 = Instance$1;
|
12455
12486
|
const layout_constants_1 = layout_constants;
|
12456
12487
|
/**
|
12457
12488
|
* Static namespace for OpenFin API methods that interact with the {@link Layout} class, available under `fin.Platform.Layout`.
|
12458
12489
|
*/
|
12459
|
-
class LayoutModule extends base_1$
|
12490
|
+
class LayoutModule extends base_1$8.Base {
|
12460
12491
|
constructor() {
|
12461
12492
|
super(...arguments);
|
12462
12493
|
_LayoutModule_instances.add(this);
|
@@ -12507,23 +12538,23 @@ class LayoutModule extends base_1$7.Base {
|
|
12507
12538
|
if (!this.wire.environment.layoutAllowedInContext(this.fin)) {
|
12508
12539
|
throw new Error('Layout.init can only be called from a Window context.');
|
12509
12540
|
}
|
12510
|
-
if (__classPrivateFieldGet$
|
12541
|
+
if (__classPrivateFieldGet$7(this, _LayoutModule_layoutInitializationAttempted, "f")) {
|
12511
12542
|
throw new Error('Layout.init was already called, please use Layout.create to add additional layouts.');
|
12512
12543
|
}
|
12513
12544
|
if (this.wire.environment.type === 'openfin') {
|
12514
12545
|
// preload the client
|
12515
12546
|
await this.fin.Platform.getCurrentSync().getClient();
|
12516
12547
|
}
|
12517
|
-
__classPrivateFieldSet$
|
12548
|
+
__classPrivateFieldSet$7(this, _LayoutModule_layoutInitializationAttempted, true, "f");
|
12518
12549
|
// TODO: rename to createLayoutManager
|
12519
|
-
__classPrivateFieldSet$
|
12520
|
-
await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$
|
12550
|
+
__classPrivateFieldSet$7(this, _LayoutModule_layoutManager, await this.wire.environment.initLayoutManager(this.fin, this.wire, options), "f");
|
12551
|
+
await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f"), options);
|
12521
12552
|
const meIdentity = { name: this.fin.me.name, uuid: this.fin.me.uuid };
|
12522
12553
|
if (!options.layoutManagerOverride) {
|
12523
12554
|
// CORE-1081 to be removed when we actually delete the `layoutManager` prop
|
12524
12555
|
// in single-layout case, we return the undocumented layoutManager type
|
12525
12556
|
const layoutIdentity = { layoutName: layout_constants_1.DEFAULT_LAYOUT_KEY, ...meIdentity };
|
12526
|
-
return __classPrivateFieldGet$
|
12557
|
+
return __classPrivateFieldGet$7(this, _LayoutModule_getLayoutManagerSpy, "f").call(this, layoutIdentity);
|
12527
12558
|
}
|
12528
12559
|
return this.wrapSync(meIdentity);
|
12529
12560
|
};
|
@@ -12552,13 +12583,13 @@ class LayoutModule extends base_1$7.Base {
|
|
12552
12583
|
* @returns
|
12553
12584
|
*/
|
12554
12585
|
this.getCurrentLayoutManagerSync = () => {
|
12555
|
-
return __classPrivateFieldGet$
|
12586
|
+
return __classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.getCurrentLayoutManagerSync()`);
|
12556
12587
|
};
|
12557
12588
|
this.create = async (options) => {
|
12558
|
-
return this.wire.environment.createLayout(__classPrivateFieldGet$
|
12589
|
+
return this.wire.environment.createLayout(__classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.create()`), options);
|
12559
12590
|
};
|
12560
12591
|
this.destroy = async (layoutIdentity) => {
|
12561
|
-
return this.wire.environment.destroyLayout(__classPrivateFieldGet$
|
12592
|
+
return this.wire.environment.destroyLayout(__classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.destroy()`), layoutIdentity);
|
12562
12593
|
};
|
12563
12594
|
}
|
12564
12595
|
/**
|
@@ -12699,10 +12730,10 @@ class LayoutModule extends base_1$7.Base {
|
|
12699
12730
|
}
|
12700
12731
|
Factory$2.LayoutModule = LayoutModule;
|
12701
12732
|
_LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_getLayoutManagerSpy = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
|
12702
|
-
if (!__classPrivateFieldGet$
|
12733
|
+
if (!__classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f")) {
|
12703
12734
|
throw new Error(`You must call init before using the API ${method}`);
|
12704
12735
|
}
|
12705
|
-
return __classPrivateFieldGet$
|
12736
|
+
return __classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f");
|
12706
12737
|
};
|
12707
12738
|
|
12708
12739
|
(function (exports) {
|
@@ -12739,13 +12770,13 @@ _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layou
|
|
12739
12770
|
|
12740
12771
|
Object.defineProperty(Factory$3, "__esModule", { value: true });
|
12741
12772
|
Factory$3.PlatformModule = void 0;
|
12742
|
-
const base_1$
|
12773
|
+
const base_1$7 = base;
|
12743
12774
|
const Instance_1$1 = Instance$2;
|
12744
12775
|
const index_1$1 = layout;
|
12745
12776
|
/**
|
12746
12777
|
* Static namespace for OpenFin API methods that interact with the {@link Platform} class, available under `fin.Platform`.
|
12747
12778
|
*/
|
12748
|
-
class PlatformModule extends base_1$
|
12779
|
+
class PlatformModule extends base_1$7.Base {
|
12749
12780
|
/**
|
12750
12781
|
* @internal
|
12751
12782
|
*/
|
@@ -13665,13 +13696,13 @@ class PrivateChannelProvider {
|
|
13665
13696
|
}
|
13666
13697
|
PrivateChannelProvider$1.PrivateChannelProvider = PrivateChannelProvider;
|
13667
13698
|
|
13668
|
-
var __classPrivateFieldSet$
|
13699
|
+
var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
13669
13700
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
13670
13701
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
13671
13702
|
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");
|
13672
13703
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
13673
13704
|
};
|
13674
|
-
var __classPrivateFieldGet$
|
13705
|
+
var __classPrivateFieldGet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
13675
13706
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
13676
13707
|
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");
|
13677
13708
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -13682,12 +13713,12 @@ var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || fu
|
|
13682
13713
|
var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
|
13683
13714
|
Object.defineProperty(InteropBroker$1, "__esModule", { value: true });
|
13684
13715
|
InteropBroker$1.InteropBroker = void 0;
|
13685
|
-
const base_1$
|
13716
|
+
const base_1$6 = base;
|
13686
13717
|
const SessionContextGroupBroker_1 = __importDefault$4(SessionContextGroupBroker$1);
|
13687
13718
|
const utils_1$7 = utils$3;
|
13688
13719
|
const isEqual_1$1 = __importDefault$4(require$$3);
|
13689
13720
|
const PrivateChannelProvider_1 = PrivateChannelProvider$1;
|
13690
|
-
const lazy_1 = lazy;
|
13721
|
+
const lazy_1$1 = lazy;
|
13691
13722
|
const defaultContextGroups = [
|
13692
13723
|
{
|
13693
13724
|
id: 'green',
|
@@ -13851,7 +13882,7 @@ const defaultContextGroups = [
|
|
13851
13882
|
* ---
|
13852
13883
|
*
|
13853
13884
|
*/
|
13854
|
-
class InteropBroker extends base_1$
|
13885
|
+
class InteropBroker extends base_1$6.Base {
|
13855
13886
|
/**
|
13856
13887
|
* @internal
|
13857
13888
|
*/
|
@@ -13862,19 +13893,19 @@ class InteropBroker extends base_1$5.Base {
|
|
13862
13893
|
_InteropBroker_contextGroups.set(this, void 0);
|
13863
13894
|
_InteropBroker_providerPromise.set(this, void 0);
|
13864
13895
|
this.getProvider = () => {
|
13865
|
-
return __classPrivateFieldGet$
|
13896
|
+
return __classPrivateFieldGet$6(this, _InteropBroker_providerPromise, "f").getValue();
|
13866
13897
|
};
|
13867
13898
|
this.interopClients = new Map();
|
13868
13899
|
this.contextGroupsById = new Map();
|
13869
|
-
__classPrivateFieldSet$
|
13870
|
-
__classPrivateFieldSet$
|
13900
|
+
__classPrivateFieldSet$6(this, _InteropBroker_contextGroups, options.contextGroups ?? [...defaultContextGroups], "f");
|
13901
|
+
__classPrivateFieldSet$6(this, _InteropBroker_fdc3Info, options.fdc3Info, "f");
|
13871
13902
|
if (options?.logging) {
|
13872
13903
|
this.logging = options.logging;
|
13873
13904
|
}
|
13874
13905
|
this.intentClientMap = new Map();
|
13875
13906
|
this.lastContextMap = new Map();
|
13876
13907
|
this.sessionContextGroupMap = new Map();
|
13877
|
-
__classPrivateFieldSet$
|
13908
|
+
__classPrivateFieldSet$6(this, _InteropBroker_providerPromise, new lazy_1$1.Lazy(createProvider), "f");
|
13878
13909
|
this.setContextGroupMap();
|
13879
13910
|
this.setupChannelProvider();
|
13880
13911
|
}
|
@@ -14142,7 +14173,7 @@ class InteropBroker extends base_1$5.Base {
|
|
14142
14173
|
// don't expose, analytics-only call
|
14143
14174
|
});
|
14144
14175
|
// Create copy for immutability
|
14145
|
-
return __classPrivateFieldGet$
|
14176
|
+
return __classPrivateFieldGet$6(this, _InteropBroker_contextGroups, "f").map((contextGroup) => {
|
14146
14177
|
return { ...contextGroup };
|
14147
14178
|
});
|
14148
14179
|
}
|
@@ -14553,7 +14584,7 @@ class InteropBroker extends base_1$5.Base {
|
|
14553
14584
|
const { fdc3Version } = payload;
|
14554
14585
|
return {
|
14555
14586
|
fdc3Version,
|
14556
|
-
...__classPrivateFieldGet$
|
14587
|
+
...__classPrivateFieldGet$6(this, _InteropBroker_fdc3Info, "f"),
|
14557
14588
|
optionalFeatures: {
|
14558
14589
|
OriginatingAppMetadata: false,
|
14559
14590
|
UserChannelMembershipAPIs: true
|
@@ -14930,27 +14961,27 @@ var InteropClient$1 = {};
|
|
14930
14961
|
|
14931
14962
|
var SessionContextGroupClient$1 = {};
|
14932
14963
|
|
14933
|
-
var __classPrivateFieldSet$
|
14964
|
+
var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
14934
14965
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
14935
14966
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
14936
14967
|
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");
|
14937
14968
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
14938
14969
|
};
|
14939
|
-
var __classPrivateFieldGet$
|
14970
|
+
var __classPrivateFieldGet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
14940
14971
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
14941
14972
|
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");
|
14942
14973
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
14943
14974
|
};
|
14944
14975
|
var _SessionContextGroupClient_clientPromise;
|
14945
14976
|
Object.defineProperty(SessionContextGroupClient$1, "__esModule", { value: true });
|
14946
|
-
const base_1$
|
14977
|
+
const base_1$5 = base;
|
14947
14978
|
const utils_1$6 = utils$3;
|
14948
|
-
class SessionContextGroupClient extends base_1$
|
14979
|
+
class SessionContextGroupClient extends base_1$5.Base {
|
14949
14980
|
constructor(wire, client, id) {
|
14950
14981
|
super(wire);
|
14951
14982
|
_SessionContextGroupClient_clientPromise.set(this, void 0);
|
14952
14983
|
this.id = id;
|
14953
|
-
__classPrivateFieldSet$
|
14984
|
+
__classPrivateFieldSet$5(this, _SessionContextGroupClient_clientPromise, client, "f");
|
14954
14985
|
}
|
14955
14986
|
/**
|
14956
14987
|
* Sets a context for the session context group.
|
@@ -14962,7 +14993,7 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
14962
14993
|
this.wire.sendAction('interop-session-context-group-set-context').catch((e) => {
|
14963
14994
|
// don't expose, analytics-only call
|
14964
14995
|
});
|
14965
|
-
const client = await __classPrivateFieldGet$
|
14996
|
+
const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
|
14966
14997
|
return client.dispatch(`sessionContextGroup:setContext-${this.id}`, {
|
14967
14998
|
sessionContextGroupId: this.id,
|
14968
14999
|
context
|
@@ -14972,7 +15003,7 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
14972
15003
|
this.wire.sendAction('interop-session-context-group-get-context').catch((e) => {
|
14973
15004
|
// don't expose, analytics-only call
|
14974
15005
|
});
|
14975
|
-
const client = await __classPrivateFieldGet$
|
15006
|
+
const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
|
14976
15007
|
return client.dispatch(`sessionContextGroup:getContext-${this.id}`, {
|
14977
15008
|
sessionContextGroupId: this.id,
|
14978
15009
|
type
|
@@ -14985,7 +15016,7 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
14985
15016
|
if (typeof contextHandler !== 'function') {
|
14986
15017
|
throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
|
14987
15018
|
}
|
14988
|
-
const client = await __classPrivateFieldGet$
|
15019
|
+
const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
|
14989
15020
|
let handlerId;
|
14990
15021
|
if (contextType) {
|
14991
15022
|
handlerId = `sessionContextHandler:invoke-${this.id}-${contextType}-${(0, utils_1$6.generateId)()}`;
|
@@ -14998,7 +15029,7 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
14998
15029
|
return { unsubscribe: await this.createUnsubscribeCb(handlerId) };
|
14999
15030
|
}
|
15000
15031
|
async createUnsubscribeCb(handlerId) {
|
15001
|
-
const client = await __classPrivateFieldGet$
|
15032
|
+
const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
|
15002
15033
|
return async () => {
|
15003
15034
|
client.remove(handlerId);
|
15004
15035
|
await client.dispatch(`sessionContextGroup:handlerRemoved-${this.id}`, { handlerId });
|
@@ -15016,13 +15047,13 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
15016
15047
|
SessionContextGroupClient$1.default = SessionContextGroupClient;
|
15017
15048
|
_SessionContextGroupClient_clientPromise = new WeakMap();
|
15018
15049
|
|
15019
|
-
var __classPrivateFieldSet$
|
15050
|
+
var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
15020
15051
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
15021
15052
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
15022
15053
|
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");
|
15023
15054
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
15024
15055
|
};
|
15025
|
-
var __classPrivateFieldGet$
|
15056
|
+
var __classPrivateFieldGet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
15026
15057
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
15027
15058
|
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");
|
15028
15059
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -15033,7 +15064,7 @@ var __importDefault$3 = (commonjsGlobal && commonjsGlobal.__importDefault) || fu
|
|
15033
15064
|
var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory;
|
15034
15065
|
Object.defineProperty(InteropClient$1, "__esModule", { value: true });
|
15035
15066
|
InteropClient$1.InteropClient = void 0;
|
15036
|
-
const base_1$
|
15067
|
+
const base_1$4 = base;
|
15037
15068
|
const SessionContextGroupClient_1 = __importDefault$3(SessionContextGroupClient$1);
|
15038
15069
|
const utils_1$5 = utils$3;
|
15039
15070
|
/**
|
@@ -15085,7 +15116,7 @@ const utils_1$5 = utils$3;
|
|
15085
15116
|
* * {@link InteropClient#getAllClientsInContextGroup getAllClientsInContextGroup(contextGroupId)}
|
15086
15117
|
*
|
15087
15118
|
*/
|
15088
|
-
class InteropClient extends base_1$
|
15119
|
+
class InteropClient extends base_1$4.Base {
|
15089
15120
|
/**
|
15090
15121
|
* @internal
|
15091
15122
|
*/
|
@@ -15094,9 +15125,9 @@ class InteropClient extends base_1$3.Base {
|
|
15094
15125
|
_InteropClient_clientPromise.set(this, void 0);
|
15095
15126
|
_InteropClient_sessionContextGroups.set(this, void 0);
|
15096
15127
|
_InteropClient_fdc3Factory.set(this, void 0);
|
15097
|
-
__classPrivateFieldSet$
|
15098
|
-
__classPrivateFieldSet$
|
15099
|
-
__classPrivateFieldSet$
|
15128
|
+
__classPrivateFieldSet$4(this, _InteropClient_sessionContextGroups, new Map(), "f");
|
15129
|
+
__classPrivateFieldSet$4(this, _InteropClient_clientPromise, clientPromise, "f");
|
15130
|
+
__classPrivateFieldSet$4(this, _InteropClient_fdc3Factory, fdc3Factory, "f");
|
15100
15131
|
}
|
15101
15132
|
/*
|
15102
15133
|
Client APIs
|
@@ -15124,7 +15155,7 @@ class InteropClient extends base_1$3.Base {
|
|
15124
15155
|
this.wire.sendAction('interop-client-set-context').catch((e) => {
|
15125
15156
|
// don't expose, analytics-only call
|
15126
15157
|
});
|
15127
|
-
const client = await __classPrivateFieldGet$
|
15158
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15128
15159
|
return client.dispatch('setContext', { context });
|
15129
15160
|
}
|
15130
15161
|
/**
|
@@ -15191,7 +15222,7 @@ class InteropClient extends base_1$3.Base {
|
|
15191
15222
|
if (typeof handler !== 'function') {
|
15192
15223
|
throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
|
15193
15224
|
}
|
15194
|
-
const client = await __classPrivateFieldGet$
|
15225
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15195
15226
|
let handlerId;
|
15196
15227
|
if (contextType) {
|
15197
15228
|
handlerId = `invokeContextHandler-${contextType}-${(0, utils_1$5.generateId)()}`;
|
@@ -15231,7 +15262,7 @@ class InteropClient extends base_1$3.Base {
|
|
15231
15262
|
this.wire.sendAction('interop-client-get-context-groups').catch((e) => {
|
15232
15263
|
// don't expose, analytics-only call
|
15233
15264
|
});
|
15234
|
-
const client = await __classPrivateFieldGet$
|
15265
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15235
15266
|
return client.dispatch('getContextGroups');
|
15236
15267
|
}
|
15237
15268
|
/**
|
@@ -15262,7 +15293,7 @@ class InteropClient extends base_1$3.Base {
|
|
15262
15293
|
this.wire.sendAction('interop-client-join-context-group').catch((e) => {
|
15263
15294
|
// don't expose, analytics-only call
|
15264
15295
|
});
|
15265
|
-
const client = await __classPrivateFieldGet$
|
15296
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15266
15297
|
if (!contextGroupId) {
|
15267
15298
|
throw new Error('No contextGroupId specified for joinContextGroup.');
|
15268
15299
|
}
|
@@ -15291,7 +15322,7 @@ class InteropClient extends base_1$3.Base {
|
|
15291
15322
|
this.wire.sendAction('interop-client-remove-from-context-group').catch((e) => {
|
15292
15323
|
// don't expose, analytics-only call
|
15293
15324
|
});
|
15294
|
-
const client = await __classPrivateFieldGet$
|
15325
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15295
15326
|
return client.dispatch('removeFromContextGroup', { target });
|
15296
15327
|
}
|
15297
15328
|
/**
|
@@ -15314,7 +15345,7 @@ class InteropClient extends base_1$3.Base {
|
|
15314
15345
|
this.wire.sendAction('interop-client-get-all-clients-in-context-group').catch((e) => {
|
15315
15346
|
// don't expose, analytics-only call
|
15316
15347
|
});
|
15317
|
-
const client = await __classPrivateFieldGet$
|
15348
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15318
15349
|
if (!contextGroupId) {
|
15319
15350
|
throw new Error('No contextGroupId specified for getAllClientsInContextGroup.');
|
15320
15351
|
}
|
@@ -15339,7 +15370,7 @@ class InteropClient extends base_1$3.Base {
|
|
15339
15370
|
this.wire.sendAction('interop-client-get-info-for-context-group').catch((e) => {
|
15340
15371
|
// don't expose, analytics-only call
|
15341
15372
|
});
|
15342
|
-
const client = await __classPrivateFieldGet$
|
15373
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15343
15374
|
if (!contextGroupId) {
|
15344
15375
|
throw new Error('No contextGroupId specified for getInfoForContextGroup.');
|
15345
15376
|
}
|
@@ -15367,7 +15398,7 @@ class InteropClient extends base_1$3.Base {
|
|
15367
15398
|
this.wire.sendAction('interop-client-fire-intent').catch((e) => {
|
15368
15399
|
// don't expose, this is only for api analytics purposes
|
15369
15400
|
});
|
15370
|
-
const client = await __classPrivateFieldGet$
|
15401
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15371
15402
|
return client.dispatch('fireIntent', intent);
|
15372
15403
|
}
|
15373
15404
|
/**
|
@@ -15394,7 +15425,7 @@ class InteropClient extends base_1$3.Base {
|
|
15394
15425
|
this.wire.sendAction('interop-client-register-intent-handler').catch((e) => {
|
15395
15426
|
// don't expose, this is only for api analytics purposes
|
15396
15427
|
});
|
15397
|
-
const client = await __classPrivateFieldGet$
|
15428
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15398
15429
|
const handlerId = `intent-handler-${intentName}`;
|
15399
15430
|
const wrappedHandler = (0, utils_1$5.wrapIntentHandler)(handler, handlerId);
|
15400
15431
|
try {
|
@@ -15432,7 +15463,7 @@ class InteropClient extends base_1$3.Base {
|
|
15432
15463
|
this.wire.sendAction('interop-client-get-current-context').catch((e) => {
|
15433
15464
|
// don't expose, analytics-only call
|
15434
15465
|
});
|
15435
|
-
const client = await __classPrivateFieldGet$
|
15466
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15436
15467
|
return client.dispatch('getCurrentContext', { contextType });
|
15437
15468
|
}
|
15438
15469
|
/**
|
@@ -15452,7 +15483,7 @@ class InteropClient extends base_1$3.Base {
|
|
15452
15483
|
this.wire.sendAction('interop-client-get-info-for-intent').catch((e) => {
|
15453
15484
|
// don't expose, analytics-only call
|
15454
15485
|
});
|
15455
|
-
const client = await __classPrivateFieldGet$
|
15486
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15456
15487
|
return client.dispatch('getInfoForIntent', options);
|
15457
15488
|
}
|
15458
15489
|
/**
|
@@ -15483,7 +15514,7 @@ class InteropClient extends base_1$3.Base {
|
|
15483
15514
|
this.wire.sendAction('interop-client-get-info-for-intents-by-context').catch((e) => {
|
15484
15515
|
// don't expose, analytics-only call
|
15485
15516
|
});
|
15486
|
-
const client = await __classPrivateFieldGet$
|
15517
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15487
15518
|
return client.dispatch('getInfoForIntentsByContext', context);
|
15488
15519
|
}
|
15489
15520
|
/**
|
@@ -15515,7 +15546,7 @@ class InteropClient extends base_1$3.Base {
|
|
15515
15546
|
this.wire.sendAction('interop-client-fire-intent-for-context').catch((e) => {
|
15516
15547
|
// don't expose, analytics-only call
|
15517
15548
|
});
|
15518
|
-
const client = await __classPrivateFieldGet$
|
15549
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15519
15550
|
return client.dispatch('fireIntentForContext', context);
|
15520
15551
|
}
|
15521
15552
|
/**
|
@@ -15552,19 +15583,19 @@ class InteropClient extends base_1$3.Base {
|
|
15552
15583
|
*/
|
15553
15584
|
async joinSessionContextGroup(sessionContextGroupId) {
|
15554
15585
|
try {
|
15555
|
-
const currentSessionContextGroup = __classPrivateFieldGet$
|
15586
|
+
const currentSessionContextGroup = __classPrivateFieldGet$4(this, _InteropClient_sessionContextGroups, "f").get(sessionContextGroupId);
|
15556
15587
|
if (currentSessionContextGroup) {
|
15557
15588
|
return currentSessionContextGroup.getUserInstance();
|
15558
15589
|
}
|
15559
|
-
const client = await __classPrivateFieldGet$
|
15590
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15560
15591
|
const { hasConflict } = await client.dispatch('sessionContextGroup:createIfNeeded', {
|
15561
15592
|
sessionContextGroupId
|
15562
15593
|
});
|
15563
15594
|
if (hasConflict) {
|
15564
15595
|
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.`);
|
15565
15596
|
}
|
15566
|
-
const newSessionContextGroup = new SessionContextGroupClient_1.default(this.wire, __classPrivateFieldGet$
|
15567
|
-
__classPrivateFieldGet$
|
15597
|
+
const newSessionContextGroup = new SessionContextGroupClient_1.default(this.wire, __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f"), sessionContextGroupId);
|
15598
|
+
__classPrivateFieldGet$4(this, _InteropClient_sessionContextGroups, "f").set(sessionContextGroupId, newSessionContextGroup);
|
15568
15599
|
return newSessionContextGroup.getUserInstance();
|
15569
15600
|
}
|
15570
15601
|
catch (error) {
|
@@ -15591,14 +15622,14 @@ class InteropClient extends base_1$3.Base {
|
|
15591
15622
|
this.wire.sendAction('interop-client-add-ondisconnection-listener').catch((e) => {
|
15592
15623
|
// don't expose, analytics-only call
|
15593
15624
|
});
|
15594
|
-
const client = await __classPrivateFieldGet$
|
15625
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15595
15626
|
return client.onDisconnection((event) => {
|
15596
15627
|
const { uuid } = event;
|
15597
15628
|
listener({ type: 'interop-broker', topic: 'disconnected', brokerName: uuid });
|
15598
15629
|
});
|
15599
15630
|
}
|
15600
15631
|
getFDC3Sync(version) {
|
15601
|
-
return __classPrivateFieldGet$
|
15632
|
+
return __classPrivateFieldGet$4(this, _InteropClient_fdc3Factory, "f").call(this, version, this, this.wire);
|
15602
15633
|
}
|
15603
15634
|
async getFDC3(version) {
|
15604
15635
|
return this.getFDC3Sync(version);
|
@@ -15609,7 +15640,7 @@ class InteropClient extends base_1$3.Base {
|
|
15609
15640
|
* Used to ferry fdc3-only calls from the fdc3 shim to the Interop Broker
|
15610
15641
|
*/
|
15611
15642
|
static async ferryFdc3Call(interopClient, action, payload) {
|
15612
|
-
const client = await __classPrivateFieldGet$
|
15643
|
+
const client = await __classPrivateFieldGet$4(interopClient, _InteropClient_clientPromise, "f");
|
15613
15644
|
return client.dispatch(action, payload || null);
|
15614
15645
|
}
|
15615
15646
|
}
|
@@ -16024,12 +16055,12 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
|
|
16024
16055
|
exports.getIntentResolution = getIntentResolution;
|
16025
16056
|
} (utils$2));
|
16026
16057
|
|
16027
|
-
var __classPrivateFieldGet$
|
16058
|
+
var __classPrivateFieldGet$3 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
16028
16059
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
16029
16060
|
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");
|
16030
16061
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
16031
16062
|
};
|
16032
|
-
var __classPrivateFieldSet$
|
16063
|
+
var __classPrivateFieldSet$3 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
16033
16064
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
16034
16065
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
16035
16066
|
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");
|
@@ -16047,7 +16078,7 @@ const InteropClient_1$2 = InteropClient$1;
|
|
16047
16078
|
const isEqual_1 = __importDefault$2(require$$3);
|
16048
16079
|
class FDC3ModuleBase {
|
16049
16080
|
get client() {
|
16050
|
-
return __classPrivateFieldGet$
|
16081
|
+
return __classPrivateFieldGet$3(this, _FDC3ModuleBase_producer, "f").call(this);
|
16051
16082
|
}
|
16052
16083
|
get fin() {
|
16053
16084
|
return this.wire.getFin();
|
@@ -16056,7 +16087,7 @@ class FDC3ModuleBase {
|
|
16056
16087
|
constructor(producer, wire) {
|
16057
16088
|
this.wire = wire;
|
16058
16089
|
_FDC3ModuleBase_producer.set(this, void 0);
|
16059
|
-
__classPrivateFieldSet$
|
16090
|
+
__classPrivateFieldSet$3(this, _FDC3ModuleBase_producer, producer, "f");
|
16060
16091
|
}
|
16061
16092
|
/**
|
16062
16093
|
* Broadcasts a context for the channel of the current entity.
|
@@ -16837,7 +16868,7 @@ Object.defineProperty(Factory$1, "__esModule", { value: true });
|
|
16837
16868
|
Factory$1.InteropModule = void 0;
|
16838
16869
|
const cloneDeep_1 = __importDefault$1(require$$0$1);
|
16839
16870
|
const inaccessibleObject_1 = inaccessibleObject;
|
16840
|
-
const base_1$
|
16871
|
+
const base_1$3 = base;
|
16841
16872
|
const InteropBroker_1 = InteropBroker$1;
|
16842
16873
|
const InteropClient_1 = InteropClient$1;
|
16843
16874
|
const overrideCheck_1 = overrideCheck$1;
|
@@ -16849,7 +16880,7 @@ const BrokerParamAccessError = 'You have attempted to use or modify InteropBroke
|
|
16849
16880
|
* Manages creation of Interop Brokers and Interop Clients. These APIs are called under-the-hood in Platforms.
|
16850
16881
|
*
|
16851
16882
|
*/
|
16852
|
-
class InteropModule extends base_1$
|
16883
|
+
class InteropModule extends base_1$3.Base {
|
16853
16884
|
/**
|
16854
16885
|
* Initializes an Interop Broker. This is called under-the-hood for Platforms.
|
16855
16886
|
*
|
@@ -16973,13 +17004,13 @@ const channelPrefix = 'snapshot-source-provider-';
|
|
16973
17004
|
const getSnapshotSourceChannelName = (id) => `${channelPrefix}${id.uuid}`;
|
16974
17005
|
utils.getSnapshotSourceChannelName = getSnapshotSourceChannelName;
|
16975
17006
|
|
16976
|
-
var __classPrivateFieldSet$
|
17007
|
+
var __classPrivateFieldSet$2 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
16977
17008
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
16978
17009
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
16979
17010
|
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");
|
16980
17011
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
16981
17012
|
};
|
16982
|
-
var __classPrivateFieldGet$
|
17013
|
+
var __classPrivateFieldGet$2 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
16983
17014
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
16984
17015
|
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");
|
16985
17016
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -16988,7 +17019,7 @@ var _SnapshotSource_identity, _SnapshotSource_getConnection, _SnapshotSource_get
|
|
16988
17019
|
Object.defineProperty(Instance, "__esModule", { value: true });
|
16989
17020
|
Instance.SnapshotSource = void 0;
|
16990
17021
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
16991
|
-
const base_1$
|
17022
|
+
const base_1$2 = base;
|
16992
17023
|
const utils_1$1 = utils;
|
16993
17024
|
const connectionMap = new Map();
|
16994
17025
|
/**
|
@@ -16997,7 +17028,7 @@ const connectionMap = new Map();
|
|
16997
17028
|
* @typeParam Snapshot Implementation-defined shape of an application snapshot. Allows
|
16998
17029
|
* custom snapshot implementations for legacy applications to define their own snapshot format.
|
16999
17030
|
*/
|
17000
|
-
class SnapshotSource extends base_1$
|
17031
|
+
class SnapshotSource extends base_1$2.Base {
|
17001
17032
|
/**
|
17002
17033
|
* @internal
|
17003
17034
|
*/
|
@@ -17011,26 +17042,26 @@ class SnapshotSource extends base_1$1.Base {
|
|
17011
17042
|
return connectionMap.get(this.identity.uuid);
|
17012
17043
|
});
|
17013
17044
|
_SnapshotSource_getClient.set(this, () => {
|
17014
|
-
if (!__classPrivateFieldGet$
|
17015
|
-
__classPrivateFieldGet$
|
17045
|
+
if (!__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise) {
|
17046
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = __classPrivateFieldGet$2(this, _SnapshotSource_startConnection, "f").call(this);
|
17016
17047
|
}
|
17017
|
-
return __classPrivateFieldGet$
|
17048
|
+
return __classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise;
|
17018
17049
|
});
|
17019
17050
|
_SnapshotSource_startConnection.set(this, async () => {
|
17020
17051
|
const channelName = (0, utils_1$1.getSnapshotSourceChannelName)(this.identity);
|
17021
17052
|
try {
|
17022
|
-
if (!__classPrivateFieldGet$
|
17023
|
-
await __classPrivateFieldGet$
|
17053
|
+
if (!__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).eventFired) {
|
17054
|
+
await __classPrivateFieldGet$2(this, _SnapshotSource_setUpConnectionListener, "f").call(this);
|
17024
17055
|
}
|
17025
17056
|
const client = await this.fin.InterApplicationBus.Channel.connect(channelName, { wait: false });
|
17026
17057
|
client.onDisconnection(() => {
|
17027
|
-
__classPrivateFieldGet$
|
17028
|
-
__classPrivateFieldGet$
|
17058
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = null;
|
17059
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).eventFired = null;
|
17029
17060
|
});
|
17030
17061
|
return client;
|
17031
17062
|
}
|
17032
17063
|
catch (e) {
|
17033
|
-
__classPrivateFieldGet$
|
17064
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = null;
|
17034
17065
|
throw new Error("The targeted SnapshotSource is not currently initialized. Await this object's ready() method.");
|
17035
17066
|
}
|
17036
17067
|
});
|
@@ -17042,7 +17073,7 @@ class SnapshotSource extends base_1$1.Base {
|
|
17042
17073
|
resolve = y;
|
17043
17074
|
reject = n;
|
17044
17075
|
});
|
17045
|
-
__classPrivateFieldGet$
|
17076
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).eventFired = eventFired;
|
17046
17077
|
const listener = async (e) => {
|
17047
17078
|
try {
|
17048
17079
|
if (e.channelName === channelName) {
|
@@ -17056,10 +17087,10 @@ class SnapshotSource extends base_1$1.Base {
|
|
17056
17087
|
};
|
17057
17088
|
await this.fin.InterApplicationBus.Channel.on('connected', listener);
|
17058
17089
|
});
|
17059
|
-
__classPrivateFieldSet$
|
17090
|
+
__classPrivateFieldSet$2(this, _SnapshotSource_identity, id, "f");
|
17060
17091
|
}
|
17061
17092
|
get identity() {
|
17062
|
-
return __classPrivateFieldGet$
|
17093
|
+
return __classPrivateFieldGet$2(this, _SnapshotSource_identity, "f");
|
17063
17094
|
}
|
17064
17095
|
/**
|
17065
17096
|
* Method to determine if the SnapshotSource has been initialized.
|
@@ -17095,11 +17126,11 @@ class SnapshotSource extends base_1$1.Base {
|
|
17095
17126
|
// eslint-disable-next-line no-async-promise-executor
|
17096
17127
|
try {
|
17097
17128
|
// 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?
|
17098
|
-
await __classPrivateFieldGet$
|
17129
|
+
await __classPrivateFieldGet$2(this, _SnapshotSource_getClient, "f").call(this);
|
17099
17130
|
}
|
17100
17131
|
catch (e) {
|
17101
17132
|
// it was not running.
|
17102
|
-
await __classPrivateFieldGet$
|
17133
|
+
await __classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).eventFired;
|
17103
17134
|
}
|
17104
17135
|
}
|
17105
17136
|
/**
|
@@ -17110,7 +17141,7 @@ class SnapshotSource extends base_1$1.Base {
|
|
17110
17141
|
this.wire.sendAction('snapshot-source-get-snapshot').catch((e) => {
|
17111
17142
|
// don't expose, analytics-only call
|
17112
17143
|
});
|
17113
|
-
const client = await __classPrivateFieldGet$
|
17144
|
+
const client = await __classPrivateFieldGet$2(this, _SnapshotSource_getClient, "f").call(this);
|
17114
17145
|
const response = (await client.dispatch('get-snapshot'));
|
17115
17146
|
return (await response).snapshot;
|
17116
17147
|
}
|
@@ -17122,7 +17153,7 @@ class SnapshotSource extends base_1$1.Base {
|
|
17122
17153
|
this.wire.sendAction('snapshot-source-apply-snapshot').catch((e) => {
|
17123
17154
|
// don't expose, analytics-only call
|
17124
17155
|
});
|
17125
|
-
const client = await __classPrivateFieldGet$
|
17156
|
+
const client = await __classPrivateFieldGet$2(this, _SnapshotSource_getClient, "f").call(this);
|
17126
17157
|
return client.dispatch('apply-snapshot', { snapshot });
|
17127
17158
|
}
|
17128
17159
|
}
|
@@ -17131,13 +17162,13 @@ _SnapshotSource_identity = new WeakMap(), _SnapshotSource_getConnection = new We
|
|
17131
17162
|
|
17132
17163
|
Object.defineProperty(Factory, "__esModule", { value: true });
|
17133
17164
|
Factory.SnapshotSourceModule = void 0;
|
17134
|
-
const base_1 = base;
|
17165
|
+
const base_1$1 = base;
|
17135
17166
|
const Instance_1 = Instance;
|
17136
17167
|
const utils_1 = utils;
|
17137
17168
|
/**
|
17138
17169
|
* Static namespace for OpenFin API methods that interact with the {@link SnapshotSource} class, available under `fin.SnapshotSource`.
|
17139
17170
|
*/
|
17140
|
-
class SnapshotSourceModule extends base_1.Base {
|
17171
|
+
class SnapshotSourceModule extends base_1$1.Base {
|
17141
17172
|
/**
|
17142
17173
|
* Initializes a SnapshotSource with the getSnapshot and applySnapshot methods defined.
|
17143
17174
|
*
|
@@ -17243,6 +17274,114 @@ Factory.SnapshotSourceModule = SnapshotSourceModule;
|
|
17243
17274
|
__exportStar(Instance, exports);
|
17244
17275
|
} (snapshotSource));
|
17245
17276
|
|
17277
|
+
var notificationManager = {};
|
17278
|
+
|
17279
|
+
var factory = {};
|
17280
|
+
|
17281
|
+
var instance = {};
|
17282
|
+
|
17283
|
+
var __classPrivateFieldSet$1 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
17284
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
17285
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
17286
|
+
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");
|
17287
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
17288
|
+
};
|
17289
|
+
var __classPrivateFieldGet$1 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
17290
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
17291
|
+
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");
|
17292
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
17293
|
+
};
|
17294
|
+
var _NotificationManagerInstance_wire, _NotificationManagerInstance_handler, _NotificationManagerInstance_id, _NotificationManagerInstance_isReceivingNotifications;
|
17295
|
+
Object.defineProperty(instance, "__esModule", { value: true });
|
17296
|
+
instance.NotificationManagerInstance = void 0;
|
17297
|
+
const lazy_1 = lazy;
|
17298
|
+
class NotificationManagerInstance {
|
17299
|
+
constructor(wire, id) {
|
17300
|
+
_NotificationManagerInstance_wire.set(this, void 0);
|
17301
|
+
_NotificationManagerInstance_handler.set(this, void 0);
|
17302
|
+
_NotificationManagerInstance_id.set(this, void 0);
|
17303
|
+
_NotificationManagerInstance_isReceivingNotifications.set(this, new lazy_1.Lazy(async () => {
|
17304
|
+
await __classPrivateFieldGet$1(this, _NotificationManagerInstance_wire, "f").registerMessageHandler((message) => {
|
17305
|
+
if (message.action === 'notification-created' && message.payload.managerId === __classPrivateFieldGet$1(this, _NotificationManagerInstance_id, "f")) {
|
17306
|
+
const { notificationId, properties, documentUrl: url, notificationIcon: icon, badge, image } = message.payload;
|
17307
|
+
try {
|
17308
|
+
__classPrivateFieldGet$1(this, _NotificationManagerInstance_handler, "f")?.call(this, {
|
17309
|
+
properties,
|
17310
|
+
images: {
|
17311
|
+
image,
|
17312
|
+
icon,
|
17313
|
+
badge
|
17314
|
+
},
|
17315
|
+
url,
|
17316
|
+
notificationId
|
17317
|
+
});
|
17318
|
+
}
|
17319
|
+
catch (error) {
|
17320
|
+
console.error('Failed to handle notification', error);
|
17321
|
+
}
|
17322
|
+
return true;
|
17323
|
+
}
|
17324
|
+
return false;
|
17325
|
+
});
|
17326
|
+
return true;
|
17327
|
+
}));
|
17328
|
+
this.setNotificationHandler = async (handler) => {
|
17329
|
+
await __classPrivateFieldGet$1(this, _NotificationManagerInstance_isReceivingNotifications, "f").getValue();
|
17330
|
+
__classPrivateFieldSet$1(this, _NotificationManagerInstance_handler, handler, "f");
|
17331
|
+
};
|
17332
|
+
this.destroy = async () => {
|
17333
|
+
await __classPrivateFieldGet$1(this, _NotificationManagerInstance_wire, "f").sendAction('destroy-notification-manager', { managerId: __classPrivateFieldGet$1(this, _NotificationManagerInstance_id, "f") });
|
17334
|
+
};
|
17335
|
+
this.dispatch = async (event) => {
|
17336
|
+
const { notificationId, type } = event;
|
17337
|
+
await __classPrivateFieldGet$1(this, _NotificationManagerInstance_wire, "f").sendAction('dispatch-notification-event', {
|
17338
|
+
notificationId,
|
17339
|
+
type
|
17340
|
+
});
|
17341
|
+
};
|
17342
|
+
__classPrivateFieldSet$1(this, _NotificationManagerInstance_wire, wire, "f");
|
17343
|
+
__classPrivateFieldSet$1(this, _NotificationManagerInstance_id, id, "f");
|
17344
|
+
}
|
17345
|
+
}
|
17346
|
+
instance.NotificationManagerInstance = NotificationManagerInstance;
|
17347
|
+
_NotificationManagerInstance_wire = new WeakMap(), _NotificationManagerInstance_handler = new WeakMap(), _NotificationManagerInstance_id = new WeakMap(), _NotificationManagerInstance_isReceivingNotifications = new WeakMap();
|
17348
|
+
|
17349
|
+
Object.defineProperty(factory, "__esModule", { value: true });
|
17350
|
+
factory.NotificationManagerModule = void 0;
|
17351
|
+
const base_1 = base;
|
17352
|
+
const instance_1 = instance;
|
17353
|
+
class NotificationManagerModule extends base_1.Base {
|
17354
|
+
constructor() {
|
17355
|
+
super(...arguments);
|
17356
|
+
this.init = async () => {
|
17357
|
+
const { payload: { data: { managerId } } } = await this.wire.sendAction('init-notification-manager');
|
17358
|
+
const manager = new instance_1.NotificationManagerInstance(this.wire, managerId);
|
17359
|
+
return manager;
|
17360
|
+
};
|
17361
|
+
}
|
17362
|
+
}
|
17363
|
+
factory.NotificationManagerModule = NotificationManagerModule;
|
17364
|
+
|
17365
|
+
(function (exports) {
|
17366
|
+
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
17367
|
+
if (k2 === undefined) k2 = k;
|
17368
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
17369
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
17370
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
17371
|
+
}
|
17372
|
+
Object.defineProperty(o, k2, desc);
|
17373
|
+
}) : (function(o, m, k, k2) {
|
17374
|
+
if (k2 === undefined) k2 = k;
|
17375
|
+
o[k2] = m[k];
|
17376
|
+
}));
|
17377
|
+
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
17378
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
17379
|
+
};
|
17380
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17381
|
+
__exportStar(factory, exports);
|
17382
|
+
__exportStar(instance, exports);
|
17383
|
+
} (notificationManager));
|
17384
|
+
|
17246
17385
|
Object.defineProperty(fin$2, "__esModule", { value: true });
|
17247
17386
|
var Fin_1 = fin$2.Fin = void 0;
|
17248
17387
|
const events_1$3 = require$$0;
|
@@ -17260,6 +17399,7 @@ const index_10 = platform;
|
|
17260
17399
|
const me_1$2 = me;
|
17261
17400
|
const interop_1 = interop;
|
17262
17401
|
const snapshot_source_1 = snapshotSource;
|
17402
|
+
const notification_manager_1 = notificationManager;
|
17263
17403
|
/**
|
17264
17404
|
* @internal
|
17265
17405
|
*/
|
@@ -17282,6 +17422,7 @@ class Fin extends events_1$3.EventEmitter {
|
|
17282
17422
|
this.View = new index_9.ViewModule(wire);
|
17283
17423
|
this.Interop = new interop_1.InteropModule(wire);
|
17284
17424
|
this.SnapshotSource = new snapshot_source_1.SnapshotSourceModule(wire);
|
17425
|
+
this.NotificationManager = new notification_manager_1.NotificationManagerModule(wire);
|
17285
17426
|
wire.registerFin(this);
|
17286
17427
|
this.me = (0, me_1$2.getMe)(wire);
|
17287
17428
|
// Handle disconnect events
|