@openfin/core 45.100.71 → 45.100.73
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 +164 -5
- package/out/mock-beta.d.ts +164 -5
- package/out/mock-public.d.ts +164 -5
- package/out/stub.d.ts +164 -5
- package/out/stub.js +380 -249
- package/package.json +1 -1
package/out/stub.js
CHANGED
|
@@ -196,9 +196,6 @@ var window$1 = /*#__PURE__*/Object.freeze({
|
|
|
196
196
|
* @packageDocumentation
|
|
197
197
|
*/
|
|
198
198
|
// Deprecated shim to preserve v30 namespace names
|
|
199
|
-
/**
|
|
200
|
-
* End of Interop Client Events
|
|
201
|
-
*/
|
|
202
199
|
|
|
203
200
|
var OpenFin = /*#__PURE__*/Object.freeze({
|
|
204
201
|
__proto__: null,
|
|
@@ -214,13 +211,13 @@ var OpenFin = /*#__PURE__*/Object.freeze({
|
|
|
214
211
|
WindowEvents: window$1
|
|
215
212
|
});
|
|
216
213
|
|
|
217
|
-
var __classPrivateFieldSet$
|
|
214
|
+
var __classPrivateFieldSet$k = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
218
215
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
219
216
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
220
217
|
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");
|
|
221
218
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
222
219
|
};
|
|
223
|
-
var __classPrivateFieldGet$
|
|
220
|
+
var __classPrivateFieldGet$l = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
224
221
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
225
222
|
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");
|
|
226
223
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -301,9 +298,9 @@ class EmitterBase extends Base {
|
|
|
301
298
|
this.emit = (eventType, payload, ...args) => {
|
|
302
299
|
return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
|
|
303
300
|
};
|
|
304
|
-
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$
|
|
301
|
+
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$l(this, _EmitterBase_emitterAccessor, "f"));
|
|
305
302
|
this.getOrCreateEmitter = () => {
|
|
306
|
-
return this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$
|
|
303
|
+
return this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$l(this, _EmitterBase_emitterAccessor, "f"));
|
|
307
304
|
};
|
|
308
305
|
this.listeners = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(type) : [];
|
|
309
306
|
this.listenerCount = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listenerCount(type) : 0;
|
|
@@ -341,8 +338,8 @@ class EmitterBase extends Base {
|
|
|
341
338
|
// This will only be reached if unsubscribe from event that does not exist but do not want to error here
|
|
342
339
|
return Promise.resolve();
|
|
343
340
|
};
|
|
344
|
-
__classPrivateFieldSet$
|
|
345
|
-
__classPrivateFieldSet$
|
|
341
|
+
__classPrivateFieldSet$k(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
|
|
342
|
+
__classPrivateFieldSet$k(this, _EmitterBase_deregisterOnceListeners, new WeakMap(), "f");
|
|
346
343
|
}
|
|
347
344
|
/**
|
|
348
345
|
* Adds a listener to the end of the listeners array for the specified event.
|
|
@@ -370,7 +367,7 @@ class EmitterBase extends Base {
|
|
|
370
367
|
*/
|
|
371
368
|
async once(eventType, listener, options) {
|
|
372
369
|
const deregister = () => this.deregisterEventListener(eventType);
|
|
373
|
-
__classPrivateFieldGet$
|
|
370
|
+
__classPrivateFieldGet$l(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
|
|
374
371
|
await this.registerEventListener(eventType, options, (emitter) => {
|
|
375
372
|
emitter.once(eventType, deregister);
|
|
376
373
|
emitter.once(eventType, listener);
|
|
@@ -401,7 +398,7 @@ class EmitterBase extends Base {
|
|
|
401
398
|
*/
|
|
402
399
|
async prependOnceListener(eventType, listener, options) {
|
|
403
400
|
const deregister = () => this.deregisterEventListener(eventType);
|
|
404
|
-
__classPrivateFieldGet$
|
|
401
|
+
__classPrivateFieldGet$l(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
|
|
405
402
|
await this.registerEventListener(eventType, options, (emitter) => {
|
|
406
403
|
emitter.prependOnceListener(eventType, listener);
|
|
407
404
|
emitter.once(eventType, deregister);
|
|
@@ -420,7 +417,7 @@ class EmitterBase extends Base {
|
|
|
420
417
|
const emitter = await this.deregisterEventListener(eventType, options);
|
|
421
418
|
if (emitter) {
|
|
422
419
|
emitter.removeListener(eventType, listener);
|
|
423
|
-
const deregister = __classPrivateFieldGet$
|
|
420
|
+
const deregister = __classPrivateFieldGet$l(this, _EmitterBase_deregisterOnceListeners, "f").get(listener);
|
|
424
421
|
if (deregister) {
|
|
425
422
|
emitter.removeListener(eventType, deregister);
|
|
426
423
|
}
|
|
@@ -466,7 +463,7 @@ class EmitterBase extends Base {
|
|
|
466
463
|
deleteEmitterIfNothingRegistered(emitter) {
|
|
467
464
|
// TODO: maybe emitterMap should clean up itself..
|
|
468
465
|
if (emitter.eventNames().length === 0) {
|
|
469
|
-
this.wire.eventAggregator.delete(__classPrivateFieldGet$
|
|
466
|
+
this.wire.eventAggregator.delete(__classPrivateFieldGet$l(this, _EmitterBase_emitterAccessor, "f"));
|
|
470
467
|
}
|
|
471
468
|
}
|
|
472
469
|
}
|
|
@@ -5170,13 +5167,15 @@ class System extends EmitterBase {
|
|
|
5170
5167
|
* * cookies: browser [cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies)
|
|
5171
5168
|
* * localStorage: browser data that can be used across sessions ([local storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage))
|
|
5172
5169
|
* * appcache: html5 [application cache](https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache)
|
|
5170
|
+
* * windowState: clears data written for windows using `saveWindowState`; after clearing, previously saved bounds and state will not be restored until new state is written
|
|
5173
5171
|
* @example
|
|
5174
5172
|
* ```js
|
|
5175
5173
|
* const clearCacheOptions = {
|
|
5176
5174
|
* appcache: true,
|
|
5177
5175
|
* cache: true,
|
|
5178
5176
|
* cookies: true,
|
|
5179
|
-
* localStorage: true
|
|
5177
|
+
* localStorage: true,
|
|
5178
|
+
* windowState: true
|
|
5180
5179
|
* };
|
|
5181
5180
|
* fin.System.clearCache(clearCacheOptions).then(() => console.log('Cache cleared')).catch(err => console.log(err));
|
|
5182
5181
|
* ```
|
|
@@ -5205,12 +5204,16 @@ class System extends EmitterBase {
|
|
|
5205
5204
|
*
|
|
5206
5205
|
* @param options - Optional configuration for what data to clear
|
|
5207
5206
|
*
|
|
5207
|
+
* @remarks Set `windowState: true` to also clear data written for windows using `saveWindowState`.
|
|
5208
|
+
* After this data is cleared, previously saved bounds and state will not be restored until new state is written again.
|
|
5209
|
+
*
|
|
5208
5210
|
* @example
|
|
5209
5211
|
* ```js
|
|
5210
5212
|
* // Clear only cookies and localStorage for a specific origin
|
|
5211
5213
|
* await fin.System.clearCacheData({
|
|
5212
5214
|
* dataTypes: ['cookies', 'localStorage'],
|
|
5213
|
-
* origins: ['http://localhost:8081']
|
|
5215
|
+
* origins: ['http://localhost:8081'],
|
|
5216
|
+
* windowState: true
|
|
5214
5217
|
* });
|
|
5215
5218
|
*
|
|
5216
5219
|
* // Clear everything except for a specific origin
|
|
@@ -7555,12 +7558,12 @@ let ChannelError$1 = class ChannelError extends Error {
|
|
|
7555
7558
|
}
|
|
7556
7559
|
};
|
|
7557
7560
|
|
|
7558
|
-
var __classPrivateFieldGet$
|
|
7561
|
+
var __classPrivateFieldGet$k = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7559
7562
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7560
7563
|
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");
|
|
7561
7564
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
7562
7565
|
};
|
|
7563
|
-
var __classPrivateFieldSet$
|
|
7566
|
+
var __classPrivateFieldSet$j = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7564
7567
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
7565
7568
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
7566
7569
|
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");
|
|
@@ -7599,7 +7602,7 @@ class ChannelClient extends ChannelBase {
|
|
|
7599
7602
|
static closeChannelByEndpointId(id) {
|
|
7600
7603
|
const channel = channelClientsByEndpointId.get(id);
|
|
7601
7604
|
if (channel) {
|
|
7602
|
-
__classPrivateFieldGet$
|
|
7605
|
+
__classPrivateFieldGet$k(channel, _ChannelClient_close, "f").call(channel);
|
|
7603
7606
|
}
|
|
7604
7607
|
}
|
|
7605
7608
|
/**
|
|
@@ -7610,7 +7613,7 @@ class ChannelClient extends ChannelBase {
|
|
|
7610
7613
|
for (const channelClient of channelClientsByEndpointId.values()) {
|
|
7611
7614
|
if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
|
|
7612
7615
|
channelClient.disconnectListener(eventPayload);
|
|
7613
|
-
__classPrivateFieldGet$
|
|
7616
|
+
__classPrivateFieldGet$k(channelClient, _ChannelClient_close, "f").call(channelClient);
|
|
7614
7617
|
}
|
|
7615
7618
|
}
|
|
7616
7619
|
}
|
|
@@ -7625,12 +7628,12 @@ class ChannelClient extends ChannelBase {
|
|
|
7625
7628
|
this.processAction = (action, payload, senderIdentity) => super.processAction(action, payload, senderIdentity);
|
|
7626
7629
|
_ChannelClient_close.set(this, () => {
|
|
7627
7630
|
channelClientsByEndpointId.delete(this.endpointId);
|
|
7628
|
-
__classPrivateFieldGet$
|
|
7631
|
+
__classPrivateFieldGet$k(this, _ChannelClient_strategy, "f").close();
|
|
7629
7632
|
});
|
|
7630
|
-
__classPrivateFieldSet$
|
|
7633
|
+
__classPrivateFieldSet$j(this, _ChannelClient_protectedObj, new ProtectedItems(routingInfo, close), "f");
|
|
7631
7634
|
this.disconnectListener = () => undefined;
|
|
7632
7635
|
this.endpointId = routingInfo.endpointId;
|
|
7633
|
-
__classPrivateFieldSet$
|
|
7636
|
+
__classPrivateFieldSet$j(this, _ChannelClient_strategy, strategy, "f");
|
|
7634
7637
|
channelClientsByEndpointId.set(this.endpointId, this);
|
|
7635
7638
|
strategy.receive(this.processAction);
|
|
7636
7639
|
}
|
|
@@ -7638,7 +7641,7 @@ class ChannelClient extends ChannelBase {
|
|
|
7638
7641
|
* a read-only provider identity
|
|
7639
7642
|
*/
|
|
7640
7643
|
get providerIdentity() {
|
|
7641
|
-
const protectedObj = __classPrivateFieldGet$
|
|
7644
|
+
const protectedObj = __classPrivateFieldGet$k(this, _ChannelClient_protectedObj, "f");
|
|
7642
7645
|
return protectedObj.providerIdentity;
|
|
7643
7646
|
}
|
|
7644
7647
|
/**
|
|
@@ -7667,9 +7670,9 @@ class ChannelClient extends ChannelBase {
|
|
|
7667
7670
|
* ```
|
|
7668
7671
|
*/
|
|
7669
7672
|
async dispatch(action, payload) {
|
|
7670
|
-
if (__classPrivateFieldGet$
|
|
7673
|
+
if (__classPrivateFieldGet$k(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
|
|
7671
7674
|
const callSites = RuntimeError.getCallSite();
|
|
7672
|
-
return __classPrivateFieldGet$
|
|
7675
|
+
return __classPrivateFieldGet$k(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
|
|
7673
7676
|
throw new ChannelError$1(e, action, payload, callSites);
|
|
7674
7677
|
});
|
|
7675
7678
|
}
|
|
@@ -7721,10 +7724,10 @@ class ChannelClient extends ChannelBase {
|
|
|
7721
7724
|
*/
|
|
7722
7725
|
async disconnect() {
|
|
7723
7726
|
await this.sendDisconnectAction();
|
|
7724
|
-
__classPrivateFieldGet$
|
|
7727
|
+
__classPrivateFieldGet$k(this, _ChannelClient_close, "f").call(this);
|
|
7725
7728
|
}
|
|
7726
7729
|
async sendDisconnectAction() {
|
|
7727
|
-
const protectedObj = __classPrivateFieldGet$
|
|
7730
|
+
const protectedObj = __classPrivateFieldGet$k(this, _ChannelClient_protectedObj, "f");
|
|
7728
7731
|
await protectedObj.close();
|
|
7729
7732
|
}
|
|
7730
7733
|
/**
|
|
@@ -7747,13 +7750,13 @@ function exhaustiveCheck(value, allowed) {
|
|
|
7747
7750
|
throw new Error(`Unsupported value: ${value}${allowed ? `\n Supported values are: ${allowed.join('')}` : ''}`);
|
|
7748
7751
|
}
|
|
7749
7752
|
|
|
7750
|
-
var __classPrivateFieldSet$
|
|
7753
|
+
var __classPrivateFieldSet$i = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7751
7754
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
7752
7755
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
7753
7756
|
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");
|
|
7754
7757
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7755
7758
|
};
|
|
7756
|
-
var __classPrivateFieldGet$
|
|
7759
|
+
var __classPrivateFieldGet$j = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7757
7760
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7758
7761
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
7759
7762
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -7776,7 +7779,7 @@ class ClassicStrategy {
|
|
|
7776
7779
|
// connection problems occur
|
|
7777
7780
|
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
|
|
7778
7781
|
this.send = async (endpointId, action, payload) => {
|
|
7779
|
-
const to = __classPrivateFieldGet$
|
|
7782
|
+
const to = __classPrivateFieldGet$j(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
7780
7783
|
if (!to) {
|
|
7781
7784
|
throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
|
|
7782
7785
|
}
|
|
@@ -7788,13 +7791,13 @@ class ClassicStrategy {
|
|
|
7788
7791
|
}
|
|
7789
7792
|
delete cleanId.isLocalEndpointId;
|
|
7790
7793
|
// grab the promise before awaiting it to save in our pending messages map
|
|
7791
|
-
const p = __classPrivateFieldGet$
|
|
7794
|
+
const p = __classPrivateFieldGet$j(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
|
|
7792
7795
|
...cleanId,
|
|
7793
7796
|
providerIdentity: this.providerIdentity,
|
|
7794
7797
|
action,
|
|
7795
7798
|
payload
|
|
7796
7799
|
});
|
|
7797
|
-
__classPrivateFieldGet$
|
|
7800
|
+
__classPrivateFieldGet$j(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
|
|
7798
7801
|
const raw = await p
|
|
7799
7802
|
.catch((error) => {
|
|
7800
7803
|
if ('cause' in error) {
|
|
@@ -7804,16 +7807,16 @@ class ClassicStrategy {
|
|
|
7804
7807
|
})
|
|
7805
7808
|
.finally(() => {
|
|
7806
7809
|
// clean up the pending promise
|
|
7807
|
-
__classPrivateFieldGet$
|
|
7810
|
+
__classPrivateFieldGet$j(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
|
|
7808
7811
|
});
|
|
7809
7812
|
return raw.payload.data.result;
|
|
7810
7813
|
};
|
|
7811
7814
|
this.close = async () => {
|
|
7812
7815
|
this.messageReceiver.removeEndpoint(this.providerIdentity.channelId, this.endpointId);
|
|
7813
|
-
[...__classPrivateFieldGet$
|
|
7814
|
-
__classPrivateFieldSet$
|
|
7816
|
+
[...__classPrivateFieldGet$j(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
|
|
7817
|
+
__classPrivateFieldSet$i(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
|
|
7815
7818
|
};
|
|
7816
|
-
__classPrivateFieldSet$
|
|
7819
|
+
__classPrivateFieldSet$i(this, _ClassicStrategy_wire, wire, "f");
|
|
7817
7820
|
}
|
|
7818
7821
|
onEndpointDisconnect(endpointId, listener) {
|
|
7819
7822
|
// Never fires for 'classic'.
|
|
@@ -7822,20 +7825,20 @@ class ClassicStrategy {
|
|
|
7822
7825
|
this.messageReceiver.addEndpoint(listener, this.providerIdentity.channelId, this.endpointId);
|
|
7823
7826
|
}
|
|
7824
7827
|
async closeEndpoint(endpointId) {
|
|
7825
|
-
const id = __classPrivateFieldGet$
|
|
7826
|
-
__classPrivateFieldGet$
|
|
7827
|
-
const pendingSet = __classPrivateFieldGet$
|
|
7828
|
+
const id = __classPrivateFieldGet$j(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
7829
|
+
__classPrivateFieldGet$j(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
|
|
7830
|
+
const pendingSet = __classPrivateFieldGet$j(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
|
|
7828
7831
|
pendingSet?.forEach((p) => {
|
|
7829
7832
|
const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
|
|
7830
7833
|
p.cancel(new Error(errorMsg));
|
|
7831
7834
|
});
|
|
7832
7835
|
}
|
|
7833
7836
|
isEndpointConnected(endpointId) {
|
|
7834
|
-
return __classPrivateFieldGet$
|
|
7837
|
+
return __classPrivateFieldGet$j(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
|
|
7835
7838
|
}
|
|
7836
7839
|
addEndpoint(endpointId, payload) {
|
|
7837
|
-
__classPrivateFieldGet$
|
|
7838
|
-
__classPrivateFieldGet$
|
|
7840
|
+
__classPrivateFieldGet$j(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
|
|
7841
|
+
__classPrivateFieldGet$j(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
|
|
7839
7842
|
}
|
|
7840
7843
|
isValidEndpointPayload(payload) {
|
|
7841
7844
|
return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
|
|
@@ -7860,12 +7863,12 @@ function errorToPOJO(error) {
|
|
|
7860
7863
|
return errorObj;
|
|
7861
7864
|
}
|
|
7862
7865
|
|
|
7863
|
-
var __classPrivateFieldGet$
|
|
7866
|
+
var __classPrivateFieldGet$i = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7864
7867
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7865
7868
|
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");
|
|
7866
7869
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
7867
7870
|
};
|
|
7868
|
-
var __classPrivateFieldSet$
|
|
7871
|
+
var __classPrivateFieldSet$h = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7869
7872
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
7870
7873
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
7871
7874
|
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");
|
|
@@ -7896,8 +7899,8 @@ class RTCEndpoint {
|
|
|
7896
7899
|
if (this.rtc.rtcClient.connectionState !== 'connected') {
|
|
7897
7900
|
this.rtc.rtcClient.removeEventListener('connectionstatechange', this.connectionStateChangeHandler);
|
|
7898
7901
|
this.close();
|
|
7899
|
-
if (__classPrivateFieldGet$
|
|
7900
|
-
__classPrivateFieldGet$
|
|
7902
|
+
if (__classPrivateFieldGet$i(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
7903
|
+
__classPrivateFieldGet$i(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
|
7901
7904
|
}
|
|
7902
7905
|
}
|
|
7903
7906
|
};
|
|
@@ -7945,9 +7948,9 @@ class RTCEndpoint {
|
|
|
7945
7948
|
data = new TextDecoder().decode(e.data);
|
|
7946
7949
|
}
|
|
7947
7950
|
const { messageId, action, payload } = JSON.parse(data);
|
|
7948
|
-
if (__classPrivateFieldGet$
|
|
7951
|
+
if (__classPrivateFieldGet$i(this, _RTCEndpoint_processAction, "f")) {
|
|
7949
7952
|
try {
|
|
7950
|
-
const res = await __classPrivateFieldGet$
|
|
7953
|
+
const res = await __classPrivateFieldGet$i(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
|
|
7951
7954
|
this.rtc.channels.response.send(JSON.stringify({
|
|
7952
7955
|
messageId,
|
|
7953
7956
|
payload: res,
|
|
@@ -7981,25 +7984,25 @@ class RTCEndpoint {
|
|
|
7981
7984
|
datachannel.onclose = (e) => {
|
|
7982
7985
|
[...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.')));
|
|
7983
7986
|
this.close();
|
|
7984
|
-
if (__classPrivateFieldGet$
|
|
7985
|
-
__classPrivateFieldGet$
|
|
7987
|
+
if (__classPrivateFieldGet$i(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
7988
|
+
__classPrivateFieldGet$i(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
|
7986
7989
|
}
|
|
7987
7990
|
};
|
|
7988
7991
|
});
|
|
7989
7992
|
}
|
|
7990
7993
|
onDisconnect(listener) {
|
|
7991
|
-
if (!__classPrivateFieldGet$
|
|
7992
|
-
__classPrivateFieldSet$
|
|
7994
|
+
if (!__classPrivateFieldGet$i(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
7995
|
+
__classPrivateFieldSet$h(this, _RTCEndpoint_disconnectListener, listener, "f");
|
|
7993
7996
|
}
|
|
7994
7997
|
else {
|
|
7995
7998
|
throw new Error('RTCEndpoint disconnectListener cannot be set twice.');
|
|
7996
7999
|
}
|
|
7997
8000
|
}
|
|
7998
8001
|
receive(listener) {
|
|
7999
|
-
if (__classPrivateFieldGet$
|
|
8002
|
+
if (__classPrivateFieldGet$i(this, _RTCEndpoint_processAction, "f")) {
|
|
8000
8003
|
throw new Error('You have already set a listener for this RTC Endpoint.');
|
|
8001
8004
|
}
|
|
8002
|
-
__classPrivateFieldSet$
|
|
8005
|
+
__classPrivateFieldSet$h(this, _RTCEndpoint_processAction, listener, "f");
|
|
8003
8006
|
}
|
|
8004
8007
|
get connected() {
|
|
8005
8008
|
return this.rtc.rtcClient.connectionState === 'connected';
|
|
@@ -8007,12 +8010,12 @@ class RTCEndpoint {
|
|
|
8007
8010
|
}
|
|
8008
8011
|
_RTCEndpoint_processAction = new WeakMap(), _RTCEndpoint_disconnectListener = new WeakMap();
|
|
8009
8012
|
|
|
8010
|
-
var __classPrivateFieldGet$
|
|
8013
|
+
var __classPrivateFieldGet$h = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8011
8014
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
8012
8015
|
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");
|
|
8013
8016
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
8014
8017
|
};
|
|
8015
|
-
var __classPrivateFieldSet$
|
|
8018
|
+
var __classPrivateFieldSet$g = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8016
8019
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8017
8020
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
8018
8021
|
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");
|
|
@@ -8031,11 +8034,11 @@ class EndpointStrategy {
|
|
|
8031
8034
|
return this.getEndpointById(endpointId).send(action, payload);
|
|
8032
8035
|
};
|
|
8033
8036
|
this.close = async () => {
|
|
8034
|
-
if (__classPrivateFieldGet$
|
|
8035
|
-
__classPrivateFieldGet$
|
|
8036
|
-
__classPrivateFieldSet$
|
|
8037
|
+
if (__classPrivateFieldGet$h(this, _EndpointStrategy_connected, "f")) {
|
|
8038
|
+
__classPrivateFieldGet$h(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
|
|
8039
|
+
__classPrivateFieldSet$g(this, _EndpointStrategy_endpointMap, new Map(), "f");
|
|
8037
8040
|
}
|
|
8038
|
-
__classPrivateFieldSet$
|
|
8041
|
+
__classPrivateFieldSet$g(this, _EndpointStrategy_connected, false, "f");
|
|
8039
8042
|
};
|
|
8040
8043
|
this.isValidEndpointPayload = validateEndpoint;
|
|
8041
8044
|
}
|
|
@@ -8043,39 +8046,39 @@ class EndpointStrategy {
|
|
|
8043
8046
|
this.getEndpointById(endpointId).onDisconnect(listener);
|
|
8044
8047
|
}
|
|
8045
8048
|
receive(listener) {
|
|
8046
|
-
if (__classPrivateFieldGet$
|
|
8049
|
+
if (__classPrivateFieldGet$h(this, _EndpointStrategy_processAction, "f")) {
|
|
8047
8050
|
throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);
|
|
8048
8051
|
}
|
|
8049
|
-
__classPrivateFieldSet$
|
|
8052
|
+
__classPrivateFieldSet$g(this, _EndpointStrategy_processAction, listener, "f");
|
|
8050
8053
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
8051
|
-
__classPrivateFieldGet$
|
|
8054
|
+
__classPrivateFieldGet$h(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$h(this, _EndpointStrategy_processAction, "f")));
|
|
8052
8055
|
}
|
|
8053
8056
|
getEndpointById(endpointId) {
|
|
8054
|
-
const endpoint = __classPrivateFieldGet$
|
|
8057
|
+
const endpoint = __classPrivateFieldGet$h(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
|
|
8055
8058
|
if (!endpoint) {
|
|
8056
8059
|
throw new Error(`Client with endpoint id ${endpointId} is not connected`);
|
|
8057
8060
|
}
|
|
8058
8061
|
return endpoint;
|
|
8059
8062
|
}
|
|
8060
8063
|
get connected() {
|
|
8061
|
-
return __classPrivateFieldGet$
|
|
8064
|
+
return __classPrivateFieldGet$h(this, _EndpointStrategy_connected, "f");
|
|
8062
8065
|
}
|
|
8063
8066
|
isEndpointConnected(endpointId) {
|
|
8064
|
-
return __classPrivateFieldGet$
|
|
8067
|
+
return __classPrivateFieldGet$h(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
|
|
8065
8068
|
}
|
|
8066
8069
|
addEndpoint(endpointId, payload) {
|
|
8067
|
-
if (!__classPrivateFieldGet$
|
|
8070
|
+
if (!__classPrivateFieldGet$h(this, _EndpointStrategy_connected, "f")) {
|
|
8068
8071
|
console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);
|
|
8069
8072
|
return;
|
|
8070
8073
|
}
|
|
8071
8074
|
const clientStrat = new this.EndpointType(payload);
|
|
8072
|
-
if (__classPrivateFieldGet$
|
|
8073
|
-
clientStrat.receive(__classPrivateFieldGet$
|
|
8075
|
+
if (__classPrivateFieldGet$h(this, _EndpointStrategy_processAction, "f")) {
|
|
8076
|
+
clientStrat.receive(__classPrivateFieldGet$h(this, _EndpointStrategy_processAction, "f"));
|
|
8074
8077
|
}
|
|
8075
|
-
__classPrivateFieldGet$
|
|
8078
|
+
__classPrivateFieldGet$h(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
|
|
8076
8079
|
}
|
|
8077
8080
|
async closeEndpoint(endpointId) {
|
|
8078
|
-
__classPrivateFieldGet$
|
|
8081
|
+
__classPrivateFieldGet$h(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
|
|
8079
8082
|
}
|
|
8080
8083
|
}
|
|
8081
8084
|
_EndpointStrategy_processAction = new WeakMap(), _EndpointStrategy_endpointMap = new WeakMap(), _EndpointStrategy_connected = new WeakMap();
|
|
@@ -8236,12 +8239,12 @@ function runtimeUuidMeetsMinimumRuntimeVersion(runtimeUuid, minVersion) {
|
|
|
8236
8239
|
return meetsMinimumRuntimeVersion(runtimeVersion, minVersion);
|
|
8237
8240
|
}
|
|
8238
8241
|
|
|
8239
|
-
var __classPrivateFieldGet$
|
|
8242
|
+
var __classPrivateFieldGet$g = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8240
8243
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
8241
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");
|
|
8242
8245
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
8243
8246
|
};
|
|
8244
|
-
var __classPrivateFieldSet$
|
|
8247
|
+
var __classPrivateFieldSet$f = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8245
8248
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8246
8249
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
8247
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");
|
|
@@ -8279,19 +8282,19 @@ class ChannelProvider extends ChannelBase {
|
|
|
8279
8282
|
* a read-only array containing all the identities of connecting clients.
|
|
8280
8283
|
*/
|
|
8281
8284
|
get connections() {
|
|
8282
|
-
return [...__classPrivateFieldGet$
|
|
8285
|
+
return [...__classPrivateFieldGet$g(this, _ChannelProvider_connections, "f")];
|
|
8283
8286
|
}
|
|
8284
8287
|
static handleClientDisconnection(channel, payload) {
|
|
8285
8288
|
if (payload?.endpointId) {
|
|
8286
8289
|
const { uuid, name, endpointId, isLocalEndpointId } = payload;
|
|
8287
|
-
__classPrivateFieldGet$
|
|
8290
|
+
__classPrivateFieldGet$g(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
|
|
8288
8291
|
}
|
|
8289
8292
|
else {
|
|
8290
8293
|
// this is here to support older runtimes that did not have endpointId
|
|
8291
8294
|
const multipleRemoves = channel.connections.filter((identity) => {
|
|
8292
8295
|
return identity.uuid === payload.uuid && identity.name === payload.name;
|
|
8293
8296
|
});
|
|
8294
|
-
multipleRemoves.forEach(__classPrivateFieldGet$
|
|
8297
|
+
multipleRemoves.forEach(__classPrivateFieldGet$g(channel, _ChannelProvider_removeEndpoint, "f"));
|
|
8295
8298
|
}
|
|
8296
8299
|
channel.disconnectListener(payload);
|
|
8297
8300
|
}
|
|
@@ -8308,8 +8311,8 @@ class ChannelProvider extends ChannelBase {
|
|
|
8308
8311
|
_ChannelProvider_strategy.set(this, void 0);
|
|
8309
8312
|
_ChannelProvider_removeEndpoint.set(this, (identity) => {
|
|
8310
8313
|
const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
|
|
8311
|
-
__classPrivateFieldGet$
|
|
8312
|
-
__classPrivateFieldSet$
|
|
8314
|
+
__classPrivateFieldGet$g(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
|
|
8315
|
+
__classPrivateFieldSet$f(this, _ChannelProvider_connections, remainingConnections, "f");
|
|
8313
8316
|
});
|
|
8314
8317
|
// Must be bound.
|
|
8315
8318
|
this.processAction = async (action, payload, senderIdentity) => {
|
|
@@ -8323,17 +8326,17 @@ class ChannelProvider extends ChannelBase {
|
|
|
8323
8326
|
return super.processAction(action, payload, senderIdentity);
|
|
8324
8327
|
};
|
|
8325
8328
|
_ChannelProvider_close.set(this, () => {
|
|
8326
|
-
__classPrivateFieldGet$
|
|
8329
|
+
__classPrivateFieldGet$g(this, _ChannelProvider_strategy, "f").close();
|
|
8327
8330
|
const remove = ChannelProvider.removalMap.get(this);
|
|
8328
8331
|
if (remove) {
|
|
8329
8332
|
remove();
|
|
8330
8333
|
}
|
|
8331
8334
|
});
|
|
8332
|
-
__classPrivateFieldSet$
|
|
8335
|
+
__classPrivateFieldSet$f(this, _ChannelProvider_protectedObj, new ProtectedItems(providerIdentity, close), "f");
|
|
8333
8336
|
this.connectListener = () => undefined;
|
|
8334
8337
|
this.disconnectListener = () => undefined;
|
|
8335
|
-
__classPrivateFieldSet$
|
|
8336
|
-
__classPrivateFieldSet$
|
|
8338
|
+
__classPrivateFieldSet$f(this, _ChannelProvider_connections, [], "f");
|
|
8339
|
+
__classPrivateFieldSet$f(this, _ChannelProvider_strategy, strategy, "f");
|
|
8337
8340
|
strategy.receive(this.processAction);
|
|
8338
8341
|
}
|
|
8339
8342
|
/**
|
|
@@ -8364,16 +8367,16 @@ class ChannelProvider extends ChannelBase {
|
|
|
8364
8367
|
*/
|
|
8365
8368
|
dispatch(to, action, payload) {
|
|
8366
8369
|
const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
|
|
8367
|
-
if (endpointId && __classPrivateFieldGet$
|
|
8370
|
+
if (endpointId && __classPrivateFieldGet$g(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
|
|
8368
8371
|
const callSites = RuntimeError.getCallSite();
|
|
8369
|
-
return __classPrivateFieldGet$
|
|
8372
|
+
return __classPrivateFieldGet$g(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
|
|
8370
8373
|
throw new ChannelError$1(e, action, payload, callSites);
|
|
8371
8374
|
});
|
|
8372
8375
|
}
|
|
8373
8376
|
return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
|
|
8374
8377
|
}
|
|
8375
8378
|
async processConnection(senderId, payload) {
|
|
8376
|
-
__classPrivateFieldGet$
|
|
8379
|
+
__classPrivateFieldGet$g(this, _ChannelProvider_connections, "f").push(senderId);
|
|
8377
8380
|
return this.connectListener(senderId, payload);
|
|
8378
8381
|
}
|
|
8379
8382
|
/**
|
|
@@ -8396,7 +8399,7 @@ class ChannelProvider extends ChannelBase {
|
|
|
8396
8399
|
* ```
|
|
8397
8400
|
*/
|
|
8398
8401
|
publish(action, payload) {
|
|
8399
|
-
return this.connections.map((to) => __classPrivateFieldGet$
|
|
8402
|
+
return this.connections.map((to) => __classPrivateFieldGet$g(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
|
|
8400
8403
|
}
|
|
8401
8404
|
/**
|
|
8402
8405
|
* Register a listener that is called on every new client connection.
|
|
@@ -8470,11 +8473,11 @@ class ChannelProvider extends ChannelBase {
|
|
|
8470
8473
|
* ```
|
|
8471
8474
|
*/
|
|
8472
8475
|
async destroy() {
|
|
8473
|
-
const protectedObj = __classPrivateFieldGet$
|
|
8476
|
+
const protectedObj = __classPrivateFieldGet$g(this, _ChannelProvider_protectedObj, "f");
|
|
8474
8477
|
protectedObj.providerIdentity;
|
|
8475
|
-
__classPrivateFieldSet$
|
|
8478
|
+
__classPrivateFieldSet$f(this, _ChannelProvider_connections, [], "f");
|
|
8476
8479
|
await protectedObj.close();
|
|
8477
|
-
__classPrivateFieldGet$
|
|
8480
|
+
__classPrivateFieldGet$g(this, _ChannelProvider_close, "f").call(this);
|
|
8478
8481
|
}
|
|
8479
8482
|
/**
|
|
8480
8483
|
* Returns an array with info on every Client connected to the Provider
|
|
@@ -8544,7 +8547,7 @@ class ChannelProvider extends ChannelBase {
|
|
|
8544
8547
|
getEndpointIdForOpenFinId(clientIdentity, action) {
|
|
8545
8548
|
const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
|
|
8546
8549
|
if (matchingConnections.length >= 2) {
|
|
8547
|
-
const protectedObj = __classPrivateFieldGet$
|
|
8550
|
+
const protectedObj = __classPrivateFieldGet$g(this, _ChannelProvider_protectedObj, "f");
|
|
8548
8551
|
const { uuid, name } = clientIdentity;
|
|
8549
8552
|
const providerUuid = protectedObj?.providerIdentity.uuid;
|
|
8550
8553
|
const providerName = protectedObj?.providerIdentity.name;
|
|
@@ -8738,13 +8741,13 @@ class CombinedStrategy {
|
|
|
8738
8741
|
}
|
|
8739
8742
|
}
|
|
8740
8743
|
|
|
8741
|
-
var __classPrivateFieldSet$
|
|
8744
|
+
var __classPrivateFieldSet$e = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8742
8745
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8743
8746
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
8744
8747
|
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");
|
|
8745
8748
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
8746
8749
|
};
|
|
8747
|
-
var __classPrivateFieldGet$
|
|
8750
|
+
var __classPrivateFieldGet$f = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8748
8751
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
8749
8752
|
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");
|
|
8750
8753
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -8779,8 +8782,8 @@ class ConnectionManager extends Base {
|
|
|
8779
8782
|
};
|
|
8780
8783
|
this.providerMap = new Map();
|
|
8781
8784
|
this.protocolManager = new ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
|
|
8782
|
-
__classPrivateFieldSet$
|
|
8783
|
-
__classPrivateFieldSet$
|
|
8785
|
+
__classPrivateFieldSet$e(this, _ConnectionManager_messageReceiver, new MessageReceiver(wire), "f");
|
|
8786
|
+
__classPrivateFieldSet$e(this, _ConnectionManager_rtcConnectionManager, new RTCICEManager(wire), "f");
|
|
8784
8787
|
wire.registerMessageHandler(this.onmessage.bind(this));
|
|
8785
8788
|
}
|
|
8786
8789
|
createProvider(options, providerIdentity) {
|
|
@@ -8791,7 +8794,7 @@ class ConnectionManager extends Base {
|
|
|
8791
8794
|
case 'rtc':
|
|
8792
8795
|
return new RTCStrategy();
|
|
8793
8796
|
case 'classic':
|
|
8794
|
-
return new ClassicStrategy(this.wire, __classPrivateFieldGet$
|
|
8797
|
+
return new ClassicStrategy(this.wire, __classPrivateFieldGet$f(this, _ConnectionManager_messageReceiver, "f"),
|
|
8795
8798
|
// Providers do not have an endpointId, use channelId as endpointId in the strategy.
|
|
8796
8799
|
providerIdentity.channelId, providerIdentity);
|
|
8797
8800
|
default:
|
|
@@ -8827,7 +8830,7 @@ class ConnectionManager extends Base {
|
|
|
8827
8830
|
const supportedProtocols = await Promise.all(protocols.map(async (type) => {
|
|
8828
8831
|
switch (type) {
|
|
8829
8832
|
case 'rtc': {
|
|
8830
|
-
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$
|
|
8833
|
+
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$f(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
|
|
8831
8834
|
rtcPacket = { rtcClient, channels, channelsOpened };
|
|
8832
8835
|
return {
|
|
8833
8836
|
type: 'rtc',
|
|
@@ -8854,18 +8857,18 @@ class ConnectionManager extends Base {
|
|
|
8854
8857
|
routingInfo.endpointId = this.wire.environment.getNextMessageId();
|
|
8855
8858
|
// For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
|
|
8856
8859
|
// clients that are in the same context as the newly-connected client.
|
|
8857
|
-
__classPrivateFieldGet$
|
|
8860
|
+
__classPrivateFieldGet$f(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
|
|
8858
8861
|
}
|
|
8859
8862
|
const answer = routingInfo.answer ?? {
|
|
8860
8863
|
supportedProtocols: [{ type: 'classic', version: 1 }]
|
|
8861
8864
|
};
|
|
8862
8865
|
const createStrategyFromAnswer = async (protocol) => {
|
|
8863
8866
|
if (protocol.type === 'rtc' && rtcPacket) {
|
|
8864
|
-
await __classPrivateFieldGet$
|
|
8867
|
+
await __classPrivateFieldGet$f(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
|
|
8865
8868
|
return new RTCStrategy();
|
|
8866
8869
|
}
|
|
8867
8870
|
if (protocol.type === 'classic') {
|
|
8868
|
-
return new ClassicStrategy(this.wire, __classPrivateFieldGet$
|
|
8871
|
+
return new ClassicStrategy(this.wire, __classPrivateFieldGet$f(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
|
|
8869
8872
|
}
|
|
8870
8873
|
return null;
|
|
8871
8874
|
};
|
|
@@ -8933,7 +8936,7 @@ class ConnectionManager extends Base {
|
|
|
8933
8936
|
clientAnswer = await overlappingProtocols.reduce(async (accumP, protocolToUse) => {
|
|
8934
8937
|
const answer = await accumP;
|
|
8935
8938
|
if (protocolToUse.type === 'rtc') {
|
|
8936
|
-
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$
|
|
8939
|
+
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$f(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
|
|
8937
8940
|
answer.supportedProtocols.push({
|
|
8938
8941
|
type: 'rtc',
|
|
8939
8942
|
version: RTCInfo.version,
|
|
@@ -8980,13 +8983,13 @@ _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnec
|
|
|
8980
8983
|
*
|
|
8981
8984
|
* @packageDocumentation
|
|
8982
8985
|
*/
|
|
8983
|
-
var __classPrivateFieldSet$
|
|
8986
|
+
var __classPrivateFieldSet$d = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8984
8987
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8985
8988
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
8986
8989
|
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");
|
|
8987
8990
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
8988
8991
|
};
|
|
8989
|
-
var __classPrivateFieldGet$
|
|
8992
|
+
var __classPrivateFieldGet$e = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8990
8993
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
8991
8994
|
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");
|
|
8992
8995
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -9034,11 +9037,11 @@ class Channel extends EmitterBase {
|
|
|
9034
9037
|
ChannelClient.handleProviderDisconnect(eventPayload);
|
|
9035
9038
|
}),
|
|
9036
9039
|
this.on('connected', (...args) => {
|
|
9037
|
-
__classPrivateFieldGet$
|
|
9040
|
+
__classPrivateFieldGet$e(this, _Channel_internalEmitter, "f").emit('connected', ...args);
|
|
9038
9041
|
})
|
|
9039
9042
|
]).catch(() => new Error('error setting up channel connection listeners'));
|
|
9040
9043
|
}));
|
|
9041
|
-
__classPrivateFieldSet$
|
|
9044
|
+
__classPrivateFieldSet$d(this, _Channel_connectionManager, new ConnectionManager(wire), "f");
|
|
9042
9045
|
}
|
|
9043
9046
|
/**
|
|
9044
9047
|
*
|
|
@@ -9113,7 +9116,7 @@ class Channel extends EmitterBase {
|
|
|
9113
9116
|
resolve(true);
|
|
9114
9117
|
}
|
|
9115
9118
|
};
|
|
9116
|
-
__classPrivateFieldGet$
|
|
9119
|
+
__classPrivateFieldGet$e(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
|
|
9117
9120
|
});
|
|
9118
9121
|
try {
|
|
9119
9122
|
if (retryInfo.count > 0) {
|
|
@@ -9145,7 +9148,7 @@ class Channel extends EmitterBase {
|
|
|
9145
9148
|
finally {
|
|
9146
9149
|
retryInfo.count += 1;
|
|
9147
9150
|
// in case of other errors, remove our listener
|
|
9148
|
-
__classPrivateFieldGet$
|
|
9151
|
+
__classPrivateFieldGet$e(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
|
|
9149
9152
|
}
|
|
9150
9153
|
} while (shouldWait); // If we're waiting we retry the above loop
|
|
9151
9154
|
// Should wait was false, no channel was found.
|
|
@@ -9204,12 +9207,12 @@ class Channel extends EmitterBase {
|
|
|
9204
9207
|
async connect(channelName, options = {}) {
|
|
9205
9208
|
// Make sure we don't connect before listeners are set up
|
|
9206
9209
|
// This also errors if we're not in OpenFin, ensuring we don't run unnecessary code
|
|
9207
|
-
await __classPrivateFieldGet$
|
|
9210
|
+
await __classPrivateFieldGet$e(this, _Channel_readyToConnect, "f").getValue();
|
|
9208
9211
|
if (!channelName || typeof channelName !== 'string') {
|
|
9209
9212
|
throw new Error('Please provide a channelName string to connect to a channel.');
|
|
9210
9213
|
}
|
|
9211
9214
|
const opts = { wait: true, ...this.wire.environment.getDefaultChannelOptions().connect, ...options };
|
|
9212
|
-
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$
|
|
9215
|
+
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$e(this, _Channel_connectionManager, "f").createClientOffer(opts);
|
|
9213
9216
|
let connectionUrl;
|
|
9214
9217
|
if (this.fin.me.isFrame || this.fin.me.isView || this.fin.me.isWindow) {
|
|
9215
9218
|
connectionUrl = (await this.fin.me.getInfo()).url;
|
|
@@ -9221,7 +9224,7 @@ class Channel extends EmitterBase {
|
|
|
9221
9224
|
connectionUrl
|
|
9222
9225
|
};
|
|
9223
9226
|
const routingInfo = await this.safeConnect(channelName, opts.wait, connectPayload);
|
|
9224
|
-
const strategy = await __classPrivateFieldGet$
|
|
9227
|
+
const strategy = await __classPrivateFieldGet$e(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
|
|
9225
9228
|
const channel = new ChannelClient(routingInfo, () => ChannelClient.wireClose(this.wire, routingInfo, routingInfo.endpointId), strategy);
|
|
9226
9229
|
// It is the client's responsibility to handle endpoint disconnection to the provider.
|
|
9227
9230
|
// If the endpoint dies, the client will force a disconnection through the core.
|
|
@@ -9290,7 +9293,7 @@ class Channel extends EmitterBase {
|
|
|
9290
9293
|
throw new Error('Please provide a channelName to create a channel');
|
|
9291
9294
|
}
|
|
9292
9295
|
const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
|
|
9293
|
-
const channel = __classPrivateFieldGet$
|
|
9296
|
+
const channel = __classPrivateFieldGet$e(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
|
|
9294
9297
|
// TODO: fix typing (internal)
|
|
9295
9298
|
// @ts-expect-error
|
|
9296
9299
|
this.on('client-disconnected', (eventPayload) => {
|
|
@@ -10047,13 +10050,13 @@ class GlobalHotkey extends EmitterBase {
|
|
|
10047
10050
|
}
|
|
10048
10051
|
}
|
|
10049
10052
|
|
|
10050
|
-
var __classPrivateFieldSet$
|
|
10053
|
+
var __classPrivateFieldSet$c = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
10051
10054
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
10052
10055
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10053
10056
|
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");
|
|
10054
10057
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
10055
10058
|
};
|
|
10056
|
-
var __classPrivateFieldGet$
|
|
10059
|
+
var __classPrivateFieldGet$d = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
10057
10060
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10058
10061
|
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");
|
|
10059
10062
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -10085,24 +10088,24 @@ class Platform extends EmitterBase {
|
|
|
10085
10088
|
this.wire.sendAction('platform-get-client', this.identity).catch((e) => {
|
|
10086
10089
|
// don't expose
|
|
10087
10090
|
});
|
|
10088
|
-
if (!Platform.clientMap.has(__classPrivateFieldGet$
|
|
10089
|
-
const clientPromise = __classPrivateFieldGet$
|
|
10090
|
-
Platform.clientMap.set(__classPrivateFieldGet$
|
|
10091
|
+
if (!Platform.clientMap.has(__classPrivateFieldGet$d(this, _Platform_channelName, "f"))) {
|
|
10092
|
+
const clientPromise = __classPrivateFieldGet$d(this, _Platform_connectToProvider, "f").call(this);
|
|
10093
|
+
Platform.clientMap.set(__classPrivateFieldGet$d(this, _Platform_channelName, "f"), clientPromise);
|
|
10091
10094
|
}
|
|
10092
10095
|
// we set it above
|
|
10093
10096
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
10094
|
-
return Platform.clientMap.get(__classPrivateFieldGet$
|
|
10097
|
+
return Platform.clientMap.get(__classPrivateFieldGet$d(this, _Platform_channelName, "f"));
|
|
10095
10098
|
};
|
|
10096
10099
|
_Platform_connectToProvider.set(this, async () => {
|
|
10097
10100
|
try {
|
|
10098
|
-
const client = await this._channel.connect(__classPrivateFieldGet$
|
|
10101
|
+
const client = await this._channel.connect(__classPrivateFieldGet$d(this, _Platform_channelName, "f"), { wait: false });
|
|
10099
10102
|
client.onDisconnection(() => {
|
|
10100
|
-
Platform.clientMap.delete(__classPrivateFieldGet$
|
|
10103
|
+
Platform.clientMap.delete(__classPrivateFieldGet$d(this, _Platform_channelName, "f"));
|
|
10101
10104
|
});
|
|
10102
10105
|
return client;
|
|
10103
10106
|
}
|
|
10104
10107
|
catch (e) {
|
|
10105
|
-
Platform.clientMap.delete(__classPrivateFieldGet$
|
|
10108
|
+
Platform.clientMap.delete(__classPrivateFieldGet$d(this, _Platform_channelName, "f"));
|
|
10106
10109
|
throw new Error('The targeted Platform is not currently running. Listen for application-started event for the given Uuid.');
|
|
10107
10110
|
}
|
|
10108
10111
|
});
|
|
@@ -10115,7 +10118,7 @@ class Platform extends EmitterBase {
|
|
|
10115
10118
|
if (errorMsg) {
|
|
10116
10119
|
throw new Error(errorMsg);
|
|
10117
10120
|
}
|
|
10118
|
-
__classPrivateFieldSet$
|
|
10121
|
+
__classPrivateFieldSet$c(this, _Platform_channelName, channelName, "f");
|
|
10119
10122
|
this._channel = this.fin.InterApplicationBus.Channel;
|
|
10120
10123
|
this.identity = { uuid: identity.uuid };
|
|
10121
10124
|
this.Layout = this.fin.Platform.Layout;
|
|
@@ -10971,13 +10974,13 @@ const createRelayedDispatch = (client, target, relayId, relayErrorMsg) => async
|
|
|
10971
10974
|
}
|
|
10972
10975
|
};
|
|
10973
10976
|
|
|
10974
|
-
var __classPrivateFieldSet$
|
|
10977
|
+
var __classPrivateFieldSet$b = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
10975
10978
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
10976
10979
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10977
10980
|
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");
|
|
10978
10981
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
10979
10982
|
};
|
|
10980
|
-
var __classPrivateFieldGet$
|
|
10983
|
+
var __classPrivateFieldGet$c = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
10981
10984
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10982
10985
|
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");
|
|
10983
10986
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -11027,7 +11030,7 @@ class LayoutNode {
|
|
|
11027
11030
|
* console.log(`The parent ColumnOrRow is root: ${parentIsRoot}`);
|
|
11028
11031
|
* ```
|
|
11029
11032
|
*/
|
|
11030
|
-
this.isRoot = () => __classPrivateFieldGet$
|
|
11033
|
+
this.isRoot = () => __classPrivateFieldGet$c(this, _LayoutNode_client, "f").isRoot(this.entityId);
|
|
11031
11034
|
/**
|
|
11032
11035
|
* Checks if the TabStack or ColumnOrRow exists
|
|
11033
11036
|
*
|
|
@@ -11047,7 +11050,7 @@ class LayoutNode {
|
|
|
11047
11050
|
* console.log(`The entity exists: ${exists}`);
|
|
11048
11051
|
* ```
|
|
11049
11052
|
*/
|
|
11050
|
-
this.exists = () => __classPrivateFieldGet$
|
|
11053
|
+
this.exists = () => __classPrivateFieldGet$c(this, _LayoutNode_client, "f").exists(this.entityId);
|
|
11051
11054
|
/**
|
|
11052
11055
|
* Retrieves the parent of the TabStack or ColumnOrRow
|
|
11053
11056
|
*
|
|
@@ -11068,11 +11071,11 @@ class LayoutNode {
|
|
|
11068
11071
|
* ```
|
|
11069
11072
|
*/
|
|
11070
11073
|
this.getParent = async () => {
|
|
11071
|
-
const parent = await __classPrivateFieldGet$
|
|
11074
|
+
const parent = await __classPrivateFieldGet$c(this, _LayoutNode_client, "f").getParent(this.entityId);
|
|
11072
11075
|
if (!parent) {
|
|
11073
11076
|
return undefined;
|
|
11074
11077
|
}
|
|
11075
|
-
return LayoutNode.getEntity(parent, __classPrivateFieldGet$
|
|
11078
|
+
return LayoutNode.getEntity(parent, __classPrivateFieldGet$c(this, _LayoutNode_client, "f"));
|
|
11076
11079
|
};
|
|
11077
11080
|
/**
|
|
11078
11081
|
* Creates a new TabStack adjacent to the given TabStack or ColumnOrRow. Inputs can be new views to create, or existing views.
|
|
@@ -11123,8 +11126,8 @@ class LayoutNode {
|
|
|
11123
11126
|
* @experimental
|
|
11124
11127
|
*/
|
|
11125
11128
|
this.createAdjacentStack = async (views, options) => {
|
|
11126
|
-
const entityId = await __classPrivateFieldGet$
|
|
11127
|
-
return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet$
|
|
11129
|
+
const entityId = await __classPrivateFieldGet$c(this, _LayoutNode_client, "f").createAdjacentStack(this.entityId, views, options);
|
|
11130
|
+
return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet$c(this, _LayoutNode_client, "f"));
|
|
11128
11131
|
};
|
|
11129
11132
|
/**
|
|
11130
11133
|
* Retrieves the adjacent TabStacks of the given TabStack or ColumnOrRow.
|
|
@@ -11152,16 +11155,16 @@ class LayoutNode {
|
|
|
11152
11155
|
* @experimental
|
|
11153
11156
|
*/
|
|
11154
11157
|
this.getAdjacentStacks = async (edge) => {
|
|
11155
|
-
const adjacentStacks = await __classPrivateFieldGet$
|
|
11158
|
+
const adjacentStacks = await __classPrivateFieldGet$c(this, _LayoutNode_client, "f").getAdjacentStacks({
|
|
11156
11159
|
targetId: this.entityId,
|
|
11157
11160
|
edge
|
|
11158
11161
|
});
|
|
11159
11162
|
return adjacentStacks.map((stack) => LayoutNode.getEntity({
|
|
11160
11163
|
type: 'stack',
|
|
11161
11164
|
entityId: stack.entityId
|
|
11162
|
-
}, __classPrivateFieldGet$
|
|
11165
|
+
}, __classPrivateFieldGet$c(this, _LayoutNode_client, "f")));
|
|
11163
11166
|
};
|
|
11164
|
-
__classPrivateFieldSet$
|
|
11167
|
+
__classPrivateFieldSet$b(this, _LayoutNode_client, client, "f");
|
|
11165
11168
|
this.entityId = entityId;
|
|
11166
11169
|
}
|
|
11167
11170
|
}
|
|
@@ -11234,7 +11237,7 @@ class TabStack extends LayoutNode {
|
|
|
11234
11237
|
* ```
|
|
11235
11238
|
* @experimental
|
|
11236
11239
|
*/
|
|
11237
|
-
this.getViews = () => __classPrivateFieldGet$
|
|
11240
|
+
this.getViews = () => __classPrivateFieldGet$c(this, _TabStack_client, "f").getStackViews(this.entityId);
|
|
11238
11241
|
/**
|
|
11239
11242
|
* Adds or creates a view in this {@link TabStack}.
|
|
11240
11243
|
*
|
|
@@ -11265,7 +11268,7 @@ class TabStack extends LayoutNode {
|
|
|
11265
11268
|
* ```
|
|
11266
11269
|
* @experimental
|
|
11267
11270
|
*/
|
|
11268
|
-
this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet$
|
|
11271
|
+
this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet$c(this, _TabStack_client, "f").addViewToStack(this.entityId, view, options);
|
|
11269
11272
|
/**
|
|
11270
11273
|
* Removes a view from this {@link TabStack}.
|
|
11271
11274
|
*
|
|
@@ -11295,7 +11298,7 @@ class TabStack extends LayoutNode {
|
|
|
11295
11298
|
* ```
|
|
11296
11299
|
*/
|
|
11297
11300
|
this.removeView = async (view) => {
|
|
11298
|
-
await __classPrivateFieldGet$
|
|
11301
|
+
await __classPrivateFieldGet$c(this, _TabStack_client, "f").removeViewFromStack(this.entityId, view);
|
|
11299
11302
|
};
|
|
11300
11303
|
/**
|
|
11301
11304
|
* Sets the active view of the {@link TabStack} without focusing it.
|
|
@@ -11319,9 +11322,9 @@ class TabStack extends LayoutNode {
|
|
|
11319
11322
|
* @experimental
|
|
11320
11323
|
*/
|
|
11321
11324
|
this.setActiveView = async (view) => {
|
|
11322
|
-
await __classPrivateFieldGet$
|
|
11325
|
+
await __classPrivateFieldGet$c(this, _TabStack_client, "f").setStackActiveView(this.entityId, view);
|
|
11323
11326
|
};
|
|
11324
|
-
__classPrivateFieldSet$
|
|
11327
|
+
__classPrivateFieldSet$b(this, _TabStack_client, client, "f");
|
|
11325
11328
|
}
|
|
11326
11329
|
}
|
|
11327
11330
|
_TabStack_client = new WeakMap();
|
|
@@ -11359,10 +11362,10 @@ class ColumnOrRow extends LayoutNode {
|
|
|
11359
11362
|
* ```
|
|
11360
11363
|
*/
|
|
11361
11364
|
this.getContent = async () => {
|
|
11362
|
-
const contentItemEntities = await __classPrivateFieldGet$
|
|
11363
|
-
return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet$
|
|
11365
|
+
const contentItemEntities = await __classPrivateFieldGet$c(this, _ColumnOrRow_client, "f").getContent(this.entityId);
|
|
11366
|
+
return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet$c(this, _ColumnOrRow_client, "f")));
|
|
11364
11367
|
};
|
|
11365
|
-
__classPrivateFieldSet$
|
|
11368
|
+
__classPrivateFieldSet$b(this, _ColumnOrRow_client, client, "f");
|
|
11366
11369
|
this.type = type;
|
|
11367
11370
|
}
|
|
11368
11371
|
}
|
|
@@ -11372,7 +11375,7 @@ const LAYOUT_CONTROLLER_ID = 'layout-entities';
|
|
|
11372
11375
|
// TODO: eventually export this somehow
|
|
11373
11376
|
const DEFAULT_LAYOUT_KEY = '__default__';
|
|
11374
11377
|
|
|
11375
|
-
var __classPrivateFieldGet$
|
|
11378
|
+
var __classPrivateFieldGet$b = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
11376
11379
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
11377
11380
|
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");
|
|
11378
11381
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -11515,7 +11518,7 @@ class Layout extends Base {
|
|
|
11515
11518
|
* @internal
|
|
11516
11519
|
*/
|
|
11517
11520
|
static getClient(layout) {
|
|
11518
|
-
return __classPrivateFieldGet$
|
|
11521
|
+
return __classPrivateFieldGet$b(layout, _Layout_layoutClient, "f").getValue();
|
|
11519
11522
|
}
|
|
11520
11523
|
/**
|
|
11521
11524
|
* @internal
|
|
@@ -11738,7 +11741,7 @@ class Layout extends Base {
|
|
|
11738
11741
|
this.wire.sendAction('layout-get-root-item').catch(() => {
|
|
11739
11742
|
// don't expose
|
|
11740
11743
|
});
|
|
11741
|
-
const client = await __classPrivateFieldGet$
|
|
11744
|
+
const client = await __classPrivateFieldGet$b(this, _Layout_layoutClient, "f").getValue();
|
|
11742
11745
|
const root = await client.getRoot('layoutName' in this.identity ? this.identity : undefined);
|
|
11743
11746
|
return LayoutNode.getEntity(root, client);
|
|
11744
11747
|
}
|
|
@@ -11756,7 +11759,7 @@ class Layout extends Base {
|
|
|
11756
11759
|
this.wire.sendAction('layout-get-stack-by-view').catch(() => {
|
|
11757
11760
|
// don't expose
|
|
11758
11761
|
});
|
|
11759
|
-
const client = await __classPrivateFieldGet$
|
|
11762
|
+
const client = await __classPrivateFieldGet$b(this, _Layout_layoutClient, "f").getValue();
|
|
11760
11763
|
const stack = await client.getStackByView(identity);
|
|
11761
11764
|
if (!stack) {
|
|
11762
11765
|
throw new Error(`No stack found for view: ${identity.uuid}/${identity.name}`);
|
|
@@ -11776,7 +11779,7 @@ class Layout extends Base {
|
|
|
11776
11779
|
this.wire.sendAction('layout-add-view').catch((e) => {
|
|
11777
11780
|
// don't expose
|
|
11778
11781
|
});
|
|
11779
|
-
const { identity } = await __classPrivateFieldGet$
|
|
11782
|
+
const { identity } = await __classPrivateFieldGet$b(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-add-view', {
|
|
11780
11783
|
viewOptions,
|
|
11781
11784
|
location,
|
|
11782
11785
|
targetView
|
|
@@ -11794,7 +11797,7 @@ class Layout extends Base {
|
|
|
11794
11797
|
this.wire.sendAction('layout-close-view').catch((e) => {
|
|
11795
11798
|
// don't expose
|
|
11796
11799
|
});
|
|
11797
|
-
await __classPrivateFieldGet$
|
|
11800
|
+
await __classPrivateFieldGet$b(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-close-view', { viewIdentity });
|
|
11798
11801
|
}
|
|
11799
11802
|
}
|
|
11800
11803
|
_Layout_layoutClient = new WeakMap(), _Layout_instances = new WeakSet(), _Layout_forwardLayoutAction =
|
|
@@ -11807,12 +11810,12 @@ async function _Layout_forwardLayoutAction(action, payload) {
|
|
|
11807
11810
|
return client.dispatch(action, { target: this.identity, opts: payload });
|
|
11808
11811
|
};
|
|
11809
11812
|
|
|
11810
|
-
var __classPrivateFieldGet$
|
|
11813
|
+
var __classPrivateFieldGet$a = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
11811
11814
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
11812
11815
|
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");
|
|
11813
11816
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11814
11817
|
};
|
|
11815
|
-
var __classPrivateFieldSet$
|
|
11818
|
+
var __classPrivateFieldSet$a = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
11816
11819
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
11817
11820
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
11818
11821
|
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");
|
|
@@ -11871,23 +11874,23 @@ class LayoutModule extends Base {
|
|
|
11871
11874
|
if (!this.wire.environment.layoutAllowedInContext(this.fin)) {
|
|
11872
11875
|
throw new Error('Layout.init can only be called from a Window context.');
|
|
11873
11876
|
}
|
|
11874
|
-
if (__classPrivateFieldGet$
|
|
11877
|
+
if (__classPrivateFieldGet$a(this, _LayoutModule_layoutInitializationAttempted, "f")) {
|
|
11875
11878
|
throw new Error('Layout.init was already called, please use Layout.create to add additional layouts.');
|
|
11876
11879
|
}
|
|
11877
11880
|
if (this.wire.environment.type === 'openfin') {
|
|
11878
11881
|
// preload the client
|
|
11879
11882
|
await this.fin.Platform.getCurrentSync().getClient();
|
|
11880
11883
|
}
|
|
11881
|
-
__classPrivateFieldSet$
|
|
11884
|
+
__classPrivateFieldSet$a(this, _LayoutModule_layoutInitializationAttempted, true, "f");
|
|
11882
11885
|
// TODO: rename to createLayoutManager
|
|
11883
|
-
__classPrivateFieldSet$
|
|
11884
|
-
await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$
|
|
11886
|
+
__classPrivateFieldSet$a(this, _LayoutModule_layoutManager, await this.wire.environment.initLayoutManager(this.fin, this.wire, options), "f");
|
|
11887
|
+
await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$a(this, _LayoutModule_layoutManager, "f"), options);
|
|
11885
11888
|
const meIdentity = { name: this.fin.me.name, uuid: this.fin.me.uuid };
|
|
11886
11889
|
if (!options.layoutManagerOverride) {
|
|
11887
11890
|
// CORE-1081 to be removed when we actually delete the `layoutManager` prop
|
|
11888
11891
|
// in single-layout case, we return the undocumented layoutManager type
|
|
11889
11892
|
const layoutIdentity = { layoutName: DEFAULT_LAYOUT_KEY, ...meIdentity };
|
|
11890
|
-
return __classPrivateFieldGet$
|
|
11893
|
+
return __classPrivateFieldGet$a(this, _LayoutModule_getLayoutManagerSpy, "f").call(this, layoutIdentity);
|
|
11891
11894
|
}
|
|
11892
11895
|
return this.wrapSync(meIdentity);
|
|
11893
11896
|
};
|
|
@@ -11916,13 +11919,13 @@ class LayoutModule extends Base {
|
|
|
11916
11919
|
* @returns
|
|
11917
11920
|
*/
|
|
11918
11921
|
this.getCurrentLayoutManagerSync = () => {
|
|
11919
|
-
return __classPrivateFieldGet$
|
|
11922
|
+
return __classPrivateFieldGet$a(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.getCurrentLayoutManagerSync()`);
|
|
11920
11923
|
};
|
|
11921
11924
|
this.create = async (options) => {
|
|
11922
|
-
return this.wire.environment.createLayout(__classPrivateFieldGet$
|
|
11925
|
+
return this.wire.environment.createLayout(__classPrivateFieldGet$a(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.create()`), options);
|
|
11923
11926
|
};
|
|
11924
11927
|
this.destroy = async (layoutIdentity) => {
|
|
11925
|
-
return this.wire.environment.destroyLayout(__classPrivateFieldGet$
|
|
11928
|
+
return this.wire.environment.destroyLayout(__classPrivateFieldGet$a(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.destroy()`), layoutIdentity);
|
|
11926
11929
|
};
|
|
11927
11930
|
}
|
|
11928
11931
|
/**
|
|
@@ -12052,10 +12055,10 @@ class LayoutModule extends Base {
|
|
|
12052
12055
|
}
|
|
12053
12056
|
}
|
|
12054
12057
|
_LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_getLayoutManagerSpy = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
|
|
12055
|
-
if (!__classPrivateFieldGet$
|
|
12058
|
+
if (!__classPrivateFieldGet$a(this, _LayoutModule_layoutManager, "f")) {
|
|
12056
12059
|
throw new Error(`You must call init before using the API ${method}`);
|
|
12057
12060
|
}
|
|
12058
|
-
return __classPrivateFieldGet$
|
|
12061
|
+
return __classPrivateFieldGet$a(this, _LayoutModule_layoutManager, "f");
|
|
12059
12062
|
};
|
|
12060
12063
|
|
|
12061
12064
|
/**
|
|
@@ -12891,13 +12894,13 @@ class PrivateChannelProvider {
|
|
|
12891
12894
|
}
|
|
12892
12895
|
}
|
|
12893
12896
|
|
|
12894
|
-
var __classPrivateFieldSet$
|
|
12897
|
+
var __classPrivateFieldSet$9 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12895
12898
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
12896
12899
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
12897
12900
|
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");
|
|
12898
12901
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
12899
12902
|
};
|
|
12900
|
-
var __classPrivateFieldGet$
|
|
12903
|
+
var __classPrivateFieldGet$9 = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12901
12904
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
12902
12905
|
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");
|
|
12903
12906
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -13077,12 +13080,12 @@ class InteropBroker extends Base {
|
|
|
13077
13080
|
_InteropBroker_contextGroups.set(this, void 0);
|
|
13078
13081
|
_InteropBroker_providerPromise.set(this, void 0);
|
|
13079
13082
|
this.getProvider = () => {
|
|
13080
|
-
return __classPrivateFieldGet$
|
|
13083
|
+
return __classPrivateFieldGet$9(this, _InteropBroker_providerPromise, "f").getValue();
|
|
13081
13084
|
};
|
|
13082
13085
|
this.interopClients = new Map();
|
|
13083
13086
|
this.contextGroupsById = new Map();
|
|
13084
|
-
__classPrivateFieldSet$
|
|
13085
|
-
__classPrivateFieldSet$
|
|
13087
|
+
__classPrivateFieldSet$9(this, _InteropBroker_contextGroups, options.contextGroups ?? [...defaultContextGroups], "f");
|
|
13088
|
+
__classPrivateFieldSet$9(this, _InteropBroker_fdc3Info, options.fdc3Info, "f");
|
|
13086
13089
|
if (options?.logging) {
|
|
13087
13090
|
this.logging = options.logging;
|
|
13088
13091
|
}
|
|
@@ -13090,7 +13093,7 @@ class InteropBroker extends Base {
|
|
|
13090
13093
|
this.lastContextMap = new Map();
|
|
13091
13094
|
this.sessionContextGroupMap = new Map();
|
|
13092
13095
|
this.privateChannelProviderMap = new Map();
|
|
13093
|
-
__classPrivateFieldSet$
|
|
13096
|
+
__classPrivateFieldSet$9(this, _InteropBroker_providerPromise, new Lazy(createProvider), "f");
|
|
13094
13097
|
this.setContextGroupMap();
|
|
13095
13098
|
this.setupChannelProvider();
|
|
13096
13099
|
}
|
|
@@ -13373,7 +13376,7 @@ class InteropBroker extends Base {
|
|
|
13373
13376
|
// don't expose, analytics-only call
|
|
13374
13377
|
});
|
|
13375
13378
|
// Create copy for immutability
|
|
13376
|
-
return __classPrivateFieldGet$
|
|
13379
|
+
return __classPrivateFieldGet$9(this, _InteropBroker_contextGroups, "f").map((contextGroup) => {
|
|
13377
13380
|
return { ...contextGroup };
|
|
13378
13381
|
});
|
|
13379
13382
|
}
|
|
@@ -13784,7 +13787,7 @@ class InteropBroker extends Base {
|
|
|
13784
13787
|
const { fdc3Version } = payload;
|
|
13785
13788
|
return {
|
|
13786
13789
|
fdc3Version,
|
|
13787
|
-
...__classPrivateFieldGet$
|
|
13790
|
+
...__classPrivateFieldGet$9(this, _InteropBroker_fdc3Info, "f"),
|
|
13788
13791
|
optionalFeatures: {
|
|
13789
13792
|
OriginatingAppMetadata: false,
|
|
13790
13793
|
UserChannelMembershipAPIs: true
|
|
@@ -14164,13 +14167,13 @@ class InteropBroker extends Base {
|
|
|
14164
14167
|
_InteropBroker_fdc3Info = new WeakMap(), _InteropBroker_contextGroups = new WeakMap(), _InteropBroker_providerPromise = new WeakMap();
|
|
14165
14168
|
InteropBroker.checkContextIntegrity = checkContextIntegrity;
|
|
14166
14169
|
|
|
14167
|
-
var __classPrivateFieldSet$
|
|
14170
|
+
var __classPrivateFieldSet$8 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
14168
14171
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
14169
14172
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
14170
14173
|
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");
|
|
14171
14174
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
14172
14175
|
};
|
|
14173
|
-
var __classPrivateFieldGet$
|
|
14176
|
+
var __classPrivateFieldGet$8 = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
14174
14177
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
14175
14178
|
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");
|
|
14176
14179
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -14181,7 +14184,7 @@ class SessionContextGroupClient extends Base {
|
|
|
14181
14184
|
super(wire);
|
|
14182
14185
|
_SessionContextGroupClient_clientPromise.set(this, void 0);
|
|
14183
14186
|
this.id = id;
|
|
14184
|
-
__classPrivateFieldSet$
|
|
14187
|
+
__classPrivateFieldSet$8(this, _SessionContextGroupClient_clientPromise, client, "f");
|
|
14185
14188
|
}
|
|
14186
14189
|
/**
|
|
14187
14190
|
* Sets a context for the session context group.
|
|
@@ -14193,7 +14196,7 @@ class SessionContextGroupClient extends Base {
|
|
|
14193
14196
|
this.wire.sendAction('interop-session-context-group-set-context').catch((e) => {
|
|
14194
14197
|
// don't expose, analytics-only call
|
|
14195
14198
|
});
|
|
14196
|
-
const client = await __classPrivateFieldGet$
|
|
14199
|
+
const client = await __classPrivateFieldGet$8(this, _SessionContextGroupClient_clientPromise, "f");
|
|
14197
14200
|
return client.dispatch(`sessionContextGroup:setContext-${this.id}`, {
|
|
14198
14201
|
sessionContextGroupId: this.id,
|
|
14199
14202
|
context
|
|
@@ -14203,7 +14206,7 @@ class SessionContextGroupClient extends Base {
|
|
|
14203
14206
|
this.wire.sendAction('interop-session-context-group-get-context').catch((e) => {
|
|
14204
14207
|
// don't expose, analytics-only call
|
|
14205
14208
|
});
|
|
14206
|
-
const client = await __classPrivateFieldGet$
|
|
14209
|
+
const client = await __classPrivateFieldGet$8(this, _SessionContextGroupClient_clientPromise, "f");
|
|
14207
14210
|
return client.dispatch(`sessionContextGroup:getContext-${this.id}`, {
|
|
14208
14211
|
sessionContextGroupId: this.id,
|
|
14209
14212
|
type
|
|
@@ -14216,7 +14219,7 @@ class SessionContextGroupClient extends Base {
|
|
|
14216
14219
|
if (typeof contextHandler !== 'function') {
|
|
14217
14220
|
throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
|
|
14218
14221
|
}
|
|
14219
|
-
const client = await __classPrivateFieldGet$
|
|
14222
|
+
const client = await __classPrivateFieldGet$8(this, _SessionContextGroupClient_clientPromise, "f");
|
|
14220
14223
|
let handlerId;
|
|
14221
14224
|
if (contextType) {
|
|
14222
14225
|
handlerId = `sessionContextHandler:invoke-${this.id}-${contextType}-${generateId()}`;
|
|
@@ -14229,7 +14232,7 @@ class SessionContextGroupClient extends Base {
|
|
|
14229
14232
|
return { unsubscribe: await this.createUnsubscribeCb(handlerId) };
|
|
14230
14233
|
}
|
|
14231
14234
|
async createUnsubscribeCb(handlerId) {
|
|
14232
|
-
const client = await __classPrivateFieldGet$
|
|
14235
|
+
const client = await __classPrivateFieldGet$8(this, _SessionContextGroupClient_clientPromise, "f");
|
|
14233
14236
|
return async () => {
|
|
14234
14237
|
client.remove(handlerId);
|
|
14235
14238
|
await client.dispatch(`sessionContextGroup:handlerRemoved-${this.id}`, { handlerId });
|
|
@@ -14246,13 +14249,13 @@ class SessionContextGroupClient extends Base {
|
|
|
14246
14249
|
}
|
|
14247
14250
|
_SessionContextGroupClient_clientPromise = new WeakMap();
|
|
14248
14251
|
|
|
14249
|
-
var __classPrivateFieldSet$
|
|
14252
|
+
var __classPrivateFieldSet$7 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
14250
14253
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
14251
14254
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
14252
14255
|
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");
|
|
14253
14256
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
14254
14257
|
};
|
|
14255
|
-
var __classPrivateFieldGet$
|
|
14258
|
+
var __classPrivateFieldGet$7 = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
14256
14259
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
14257
14260
|
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");
|
|
14258
14261
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -14270,11 +14273,11 @@ class ChannelEvents {
|
|
|
14270
14273
|
_ChannelEvents_channelClient.set(this, void 0);
|
|
14271
14274
|
_ChannelEvents_isChannelReady.set(this, false);
|
|
14272
14275
|
_ChannelEvents_getActions.set(this, async () => {
|
|
14273
|
-
const channelClient = await __classPrivateFieldGet$
|
|
14274
|
-
let actions = __classPrivateFieldGet$
|
|
14276
|
+
const channelClient = await __classPrivateFieldGet$7(this, _ChannelEvents_channelClient, "f");
|
|
14277
|
+
let actions = __classPrivateFieldGet$7(ChannelEvents, _a, "f", _ChannelEvents_actionsByClient).get(channelClient);
|
|
14275
14278
|
if (!actions) {
|
|
14276
14279
|
actions = {};
|
|
14277
|
-
__classPrivateFieldGet$
|
|
14280
|
+
__classPrivateFieldGet$7(ChannelEvents, _a, "f", _ChannelEvents_actionsByClient).set(channelClient, actions);
|
|
14278
14281
|
}
|
|
14279
14282
|
return actions;
|
|
14280
14283
|
});
|
|
@@ -14291,7 +14294,7 @@ class ChannelEvents {
|
|
|
14291
14294
|
if (index >= 0) {
|
|
14292
14295
|
callbacks.splice(index, 1);
|
|
14293
14296
|
if (callbacks.length === 0) {
|
|
14294
|
-
const client = await __classPrivateFieldGet$
|
|
14297
|
+
const client = await __classPrivateFieldGet$7(this, _ChannelEvents_channelClient, "f");
|
|
14295
14298
|
client.remove(actionId);
|
|
14296
14299
|
}
|
|
14297
14300
|
}
|
|
@@ -14300,7 +14303,7 @@ class ChannelEvents {
|
|
|
14300
14303
|
// Use lazy eval to only setup and register the channel on first attempt.
|
|
14301
14304
|
if (!registrationPromise) {
|
|
14302
14305
|
registrationPromise = (async () => {
|
|
14303
|
-
const client = await __classPrivateFieldGet$
|
|
14306
|
+
const client = await __classPrivateFieldGet$7(this, _ChannelEvents_channelClient, "f");
|
|
14304
14307
|
await client.register(actionId, onChannelAction);
|
|
14305
14308
|
})();
|
|
14306
14309
|
}
|
|
@@ -14309,14 +14312,14 @@ class ChannelEvents {
|
|
|
14309
14312
|
};
|
|
14310
14313
|
});
|
|
14311
14314
|
_ChannelEvents_getRegistration.set(this, async (actionId) => {
|
|
14312
|
-
const actions = await __classPrivateFieldGet$
|
|
14315
|
+
const actions = await __classPrivateFieldGet$7(this, _ChannelEvents_getActions, "f").call(this);
|
|
14313
14316
|
return actions[actionId];
|
|
14314
14317
|
});
|
|
14315
14318
|
_ChannelEvents_getOrCreateRegistration.set(this, async (actionId) => {
|
|
14316
|
-
const actions = await __classPrivateFieldGet$
|
|
14317
|
-
const registration = await __classPrivateFieldGet$
|
|
14319
|
+
const actions = await __classPrivateFieldGet$7(this, _ChannelEvents_getActions, "f").call(this);
|
|
14320
|
+
const registration = await __classPrivateFieldGet$7(this, _ChannelEvents_getRegistration, "f").call(this, actionId);
|
|
14318
14321
|
if (!registration) {
|
|
14319
|
-
actions[actionId] = __classPrivateFieldGet$
|
|
14322
|
+
actions[actionId] = __classPrivateFieldGet$7(this, _ChannelEvents_createRegistration, "f").call(this, actionId);
|
|
14320
14323
|
}
|
|
14321
14324
|
return actions[actionId];
|
|
14322
14325
|
});
|
|
@@ -14331,7 +14334,7 @@ class ChannelEvents {
|
|
|
14331
14334
|
* @param callback Callback to be called whenever the action is dispatched.
|
|
14332
14335
|
*/
|
|
14333
14336
|
this.addListener = async (action, callback) => {
|
|
14334
|
-
const event = await __classPrivateFieldGet$
|
|
14337
|
+
const event = await __classPrivateFieldGet$7(this, _ChannelEvents_getOrCreateRegistration, "f").call(this, action);
|
|
14335
14338
|
event.callbacks.push(callback);
|
|
14336
14339
|
// This ensures we only resolve the subscription once the action is registered
|
|
14337
14340
|
await event.waitForRegistration();
|
|
@@ -14345,19 +14348,19 @@ class ChannelEvents {
|
|
|
14345
14348
|
* @param callback Callback to remove.
|
|
14346
14349
|
*/
|
|
14347
14350
|
this.removeListener = async (action, callback) => {
|
|
14348
|
-
if (!__classPrivateFieldGet$
|
|
14351
|
+
if (!__classPrivateFieldGet$7(this, _ChannelEvents_isChannelReady, "f")) {
|
|
14349
14352
|
return;
|
|
14350
14353
|
}
|
|
14351
|
-
const registration = await __classPrivateFieldGet$
|
|
14354
|
+
const registration = await __classPrivateFieldGet$7(this, _ChannelEvents_getRegistration, "f").call(this, action);
|
|
14352
14355
|
if (registration) {
|
|
14353
|
-
const event = await __classPrivateFieldGet$
|
|
14356
|
+
const event = await __classPrivateFieldGet$7(this, _ChannelEvents_getOrCreateRegistration, "f").call(this, action);
|
|
14354
14357
|
await event.dispose(callback);
|
|
14355
14358
|
}
|
|
14356
14359
|
};
|
|
14357
|
-
__classPrivateFieldSet$
|
|
14360
|
+
__classPrivateFieldSet$7(this, _ChannelEvents_channelClient, channelClient, "f");
|
|
14358
14361
|
Promise.resolve(channelClient)
|
|
14359
14362
|
.then(() => {
|
|
14360
|
-
__classPrivateFieldSet$
|
|
14363
|
+
__classPrivateFieldSet$7(this, _ChannelEvents_isChannelReady, true, "f");
|
|
14361
14364
|
})
|
|
14362
14365
|
.catch(() => {
|
|
14363
14366
|
// eslint-disable-next-line
|
|
@@ -14374,13 +14377,13 @@ _a = ChannelEvents, _ChannelEvents_channelClient = new WeakMap(), _ChannelEvents
|
|
|
14374
14377
|
*/
|
|
14375
14378
|
_ChannelEvents_actionsByClient = { value: new WeakMap() };
|
|
14376
14379
|
|
|
14377
|
-
var __classPrivateFieldSet$
|
|
14380
|
+
var __classPrivateFieldSet$6 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
14378
14381
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
14379
14382
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
14380
14383
|
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");
|
|
14381
14384
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
14382
14385
|
};
|
|
14383
|
-
var __classPrivateFieldGet$
|
|
14386
|
+
var __classPrivateFieldGet$6 = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
14384
14387
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
14385
14388
|
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");
|
|
14386
14389
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -14456,7 +14459,7 @@ class InteropClient extends Base {
|
|
|
14456
14459
|
*/
|
|
14457
14460
|
this.addListener = async (type, listener) => {
|
|
14458
14461
|
try {
|
|
14459
|
-
await __classPrivateFieldGet$
|
|
14462
|
+
await __classPrivateFieldGet$6(this, _InteropClient_channelEvents, "f").addListener(type, listener);
|
|
14460
14463
|
}
|
|
14461
14464
|
catch (error) {
|
|
14462
14465
|
throw new Error(`An unexpected error occurred when adding a listener to the event ${type}. \n${error.stack}.`);
|
|
@@ -14470,16 +14473,16 @@ class InteropClient extends Base {
|
|
|
14470
14473
|
*/
|
|
14471
14474
|
this.removeListener = async (type, listener) => {
|
|
14472
14475
|
try {
|
|
14473
|
-
await __classPrivateFieldGet$
|
|
14476
|
+
await __classPrivateFieldGet$6(this, _InteropClient_channelEvents, "f").removeListener(type, listener);
|
|
14474
14477
|
}
|
|
14475
14478
|
catch (error) {
|
|
14476
14479
|
throw new Error(`An unexpected error occurred when removing a listener for the event ${type}. \n${error.stack}.`);
|
|
14477
14480
|
}
|
|
14478
14481
|
};
|
|
14479
|
-
__classPrivateFieldSet$
|
|
14480
|
-
__classPrivateFieldSet$
|
|
14481
|
-
__classPrivateFieldSet$
|
|
14482
|
-
__classPrivateFieldSet$
|
|
14482
|
+
__classPrivateFieldSet$6(this, _InteropClient_sessionContextGroups, new Map(), "f");
|
|
14483
|
+
__classPrivateFieldSet$6(this, _InteropClient_clientPromise, clientPromise, "f");
|
|
14484
|
+
__classPrivateFieldSet$6(this, _InteropClient_fdc3Factory, fdc3Factory, "f");
|
|
14485
|
+
__classPrivateFieldSet$6(this, _InteropClient_channelEvents, new ChannelEvents(clientPromise), "f");
|
|
14483
14486
|
}
|
|
14484
14487
|
/**
|
|
14485
14488
|
* Sets a context for the context group of the current entity.
|
|
@@ -14504,7 +14507,7 @@ class InteropClient extends Base {
|
|
|
14504
14507
|
this.wire.sendAction('interop-client-set-context').catch((e) => {
|
|
14505
14508
|
// don't expose, analytics-only call
|
|
14506
14509
|
});
|
|
14507
|
-
const client = await __classPrivateFieldGet$
|
|
14510
|
+
const client = await __classPrivateFieldGet$6(this, _InteropClient_clientPromise, "f");
|
|
14508
14511
|
return client.dispatch('setContext', { context });
|
|
14509
14512
|
}
|
|
14510
14513
|
/**
|
|
@@ -14571,7 +14574,7 @@ class InteropClient extends Base {
|
|
|
14571
14574
|
if (typeof handler !== 'function') {
|
|
14572
14575
|
throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
|
|
14573
14576
|
}
|
|
14574
|
-
const client = await __classPrivateFieldGet$
|
|
14577
|
+
const client = await __classPrivateFieldGet$6(this, _InteropClient_clientPromise, "f");
|
|
14575
14578
|
let handlerId;
|
|
14576
14579
|
if (contextType) {
|
|
14577
14580
|
handlerId = `invokeContextHandler-${contextType}-${generateId()}`;
|
|
@@ -14611,7 +14614,7 @@ class InteropClient extends Base {
|
|
|
14611
14614
|
this.wire.sendAction('interop-client-get-context-groups').catch((e) => {
|
|
14612
14615
|
// don't expose, analytics-only call
|
|
14613
14616
|
});
|
|
14614
|
-
const client = await __classPrivateFieldGet$
|
|
14617
|
+
const client = await __classPrivateFieldGet$6(this, _InteropClient_clientPromise, "f");
|
|
14615
14618
|
return client.dispatch('getContextGroups');
|
|
14616
14619
|
}
|
|
14617
14620
|
/**
|
|
@@ -14642,7 +14645,7 @@ class InteropClient extends Base {
|
|
|
14642
14645
|
this.wire.sendAction('interop-client-join-context-group').catch((e) => {
|
|
14643
14646
|
// don't expose, analytics-only call
|
|
14644
14647
|
});
|
|
14645
|
-
const client = await __classPrivateFieldGet$
|
|
14648
|
+
const client = await __classPrivateFieldGet$6(this, _InteropClient_clientPromise, "f");
|
|
14646
14649
|
if (!contextGroupId) {
|
|
14647
14650
|
throw new Error('No contextGroupId specified for joinContextGroup.');
|
|
14648
14651
|
}
|
|
@@ -14671,7 +14674,7 @@ class InteropClient extends Base {
|
|
|
14671
14674
|
this.wire.sendAction('interop-client-remove-from-context-group').catch((e) => {
|
|
14672
14675
|
// don't expose, analytics-only call
|
|
14673
14676
|
});
|
|
14674
|
-
const client = await __classPrivateFieldGet$
|
|
14677
|
+
const client = await __classPrivateFieldGet$6(this, _InteropClient_clientPromise, "f");
|
|
14675
14678
|
return client.dispatch('removeFromContextGroup', { target });
|
|
14676
14679
|
}
|
|
14677
14680
|
/**
|
|
@@ -14694,7 +14697,7 @@ class InteropClient extends Base {
|
|
|
14694
14697
|
this.wire.sendAction('interop-client-get-all-clients-in-context-group').catch((e) => {
|
|
14695
14698
|
// don't expose, analytics-only call
|
|
14696
14699
|
});
|
|
14697
|
-
const client = await __classPrivateFieldGet$
|
|
14700
|
+
const client = await __classPrivateFieldGet$6(this, _InteropClient_clientPromise, "f");
|
|
14698
14701
|
if (!contextGroupId) {
|
|
14699
14702
|
throw new Error('No contextGroupId specified for getAllClientsInContextGroup.');
|
|
14700
14703
|
}
|
|
@@ -14719,7 +14722,7 @@ class InteropClient extends Base {
|
|
|
14719
14722
|
this.wire.sendAction('interop-client-get-info-for-context-group').catch((e) => {
|
|
14720
14723
|
// don't expose, analytics-only call
|
|
14721
14724
|
});
|
|
14722
|
-
const client = await __classPrivateFieldGet$
|
|
14725
|
+
const client = await __classPrivateFieldGet$6(this, _InteropClient_clientPromise, "f");
|
|
14723
14726
|
if (!contextGroupId) {
|
|
14724
14727
|
throw new Error('No contextGroupId specified for getInfoForContextGroup.');
|
|
14725
14728
|
}
|
|
@@ -14747,7 +14750,7 @@ class InteropClient extends Base {
|
|
|
14747
14750
|
this.wire.sendAction('interop-client-fire-intent').catch((e) => {
|
|
14748
14751
|
// don't expose, this is only for api analytics purposes
|
|
14749
14752
|
});
|
|
14750
|
-
const client = await __classPrivateFieldGet$
|
|
14753
|
+
const client = await __classPrivateFieldGet$6(this, _InteropClient_clientPromise, "f");
|
|
14751
14754
|
return client.dispatch('fireIntent', intent);
|
|
14752
14755
|
}
|
|
14753
14756
|
/**
|
|
@@ -14774,7 +14777,7 @@ class InteropClient extends Base {
|
|
|
14774
14777
|
this.wire.sendAction('interop-client-register-intent-handler').catch((e) => {
|
|
14775
14778
|
// don't expose, this is only for api analytics purposes
|
|
14776
14779
|
});
|
|
14777
|
-
const client = await __classPrivateFieldGet$
|
|
14780
|
+
const client = await __classPrivateFieldGet$6(this, _InteropClient_clientPromise, "f");
|
|
14778
14781
|
const handlerId = `intent-handler-${intentName}`;
|
|
14779
14782
|
const wrappedHandler = wrapIntentHandler(handler, handlerId);
|
|
14780
14783
|
try {
|
|
@@ -14812,7 +14815,7 @@ class InteropClient extends Base {
|
|
|
14812
14815
|
this.wire.sendAction('interop-client-get-current-context').catch((e) => {
|
|
14813
14816
|
// don't expose, analytics-only call
|
|
14814
14817
|
});
|
|
14815
|
-
const client = await __classPrivateFieldGet$
|
|
14818
|
+
const client = await __classPrivateFieldGet$6(this, _InteropClient_clientPromise, "f");
|
|
14816
14819
|
return client.dispatch('getCurrentContext', { contextType });
|
|
14817
14820
|
}
|
|
14818
14821
|
/**
|
|
@@ -14832,7 +14835,7 @@ class InteropClient extends Base {
|
|
|
14832
14835
|
this.wire.sendAction('interop-client-get-info-for-intent').catch((e) => {
|
|
14833
14836
|
// don't expose, analytics-only call
|
|
14834
14837
|
});
|
|
14835
|
-
const client = await __classPrivateFieldGet$
|
|
14838
|
+
const client = await __classPrivateFieldGet$6(this, _InteropClient_clientPromise, "f");
|
|
14836
14839
|
return client.dispatch('getInfoForIntent', options);
|
|
14837
14840
|
}
|
|
14838
14841
|
/**
|
|
@@ -14863,7 +14866,7 @@ class InteropClient extends Base {
|
|
|
14863
14866
|
this.wire.sendAction('interop-client-get-info-for-intents-by-context').catch((e) => {
|
|
14864
14867
|
// don't expose, analytics-only call
|
|
14865
14868
|
});
|
|
14866
|
-
const client = await __classPrivateFieldGet$
|
|
14869
|
+
const client = await __classPrivateFieldGet$6(this, _InteropClient_clientPromise, "f");
|
|
14867
14870
|
return client.dispatch('getInfoForIntentsByContext', context);
|
|
14868
14871
|
}
|
|
14869
14872
|
/**
|
|
@@ -14895,7 +14898,7 @@ class InteropClient extends Base {
|
|
|
14895
14898
|
this.wire.sendAction('interop-client-fire-intent-for-context').catch((e) => {
|
|
14896
14899
|
// don't expose, analytics-only call
|
|
14897
14900
|
});
|
|
14898
|
-
const client = await __classPrivateFieldGet$
|
|
14901
|
+
const client = await __classPrivateFieldGet$6(this, _InteropClient_clientPromise, "f");
|
|
14899
14902
|
return client.dispatch('fireIntentForContext', context);
|
|
14900
14903
|
}
|
|
14901
14904
|
/**
|
|
@@ -14932,19 +14935,19 @@ class InteropClient extends Base {
|
|
|
14932
14935
|
*/
|
|
14933
14936
|
async joinSessionContextGroup(sessionContextGroupId) {
|
|
14934
14937
|
try {
|
|
14935
|
-
const currentSessionContextGroup = __classPrivateFieldGet$
|
|
14938
|
+
const currentSessionContextGroup = __classPrivateFieldGet$6(this, _InteropClient_sessionContextGroups, "f").get(sessionContextGroupId);
|
|
14936
14939
|
if (currentSessionContextGroup) {
|
|
14937
14940
|
return currentSessionContextGroup.getUserInstance();
|
|
14938
14941
|
}
|
|
14939
|
-
const client = await __classPrivateFieldGet$
|
|
14942
|
+
const client = await __classPrivateFieldGet$6(this, _InteropClient_clientPromise, "f");
|
|
14940
14943
|
const { hasConflict } = await client.dispatch('sessionContextGroup:createIfNeeded', {
|
|
14941
14944
|
sessionContextGroupId
|
|
14942
14945
|
});
|
|
14943
14946
|
if (hasConflict) {
|
|
14944
14947
|
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.`);
|
|
14945
14948
|
}
|
|
14946
|
-
const newSessionContextGroup = new SessionContextGroupClient(this.wire, __classPrivateFieldGet$
|
|
14947
|
-
__classPrivateFieldGet$
|
|
14949
|
+
const newSessionContextGroup = new SessionContextGroupClient(this.wire, __classPrivateFieldGet$6(this, _InteropClient_clientPromise, "f"), sessionContextGroupId);
|
|
14950
|
+
__classPrivateFieldGet$6(this, _InteropClient_sessionContextGroups, "f").set(sessionContextGroupId, newSessionContextGroup);
|
|
14948
14951
|
return newSessionContextGroup.getUserInstance();
|
|
14949
14952
|
}
|
|
14950
14953
|
catch (error) {
|
|
@@ -14971,14 +14974,14 @@ class InteropClient extends Base {
|
|
|
14971
14974
|
this.wire.sendAction('interop-client-add-ondisconnection-listener').catch((e) => {
|
|
14972
14975
|
// don't expose, analytics-only call
|
|
14973
14976
|
});
|
|
14974
|
-
const client = await __classPrivateFieldGet$
|
|
14977
|
+
const client = await __classPrivateFieldGet$6(this, _InteropClient_clientPromise, "f");
|
|
14975
14978
|
return client.onDisconnection((event) => {
|
|
14976
14979
|
const { uuid } = event;
|
|
14977
14980
|
listener({ type: 'interop-broker', topic: 'disconnected', brokerName: uuid });
|
|
14978
14981
|
});
|
|
14979
14982
|
}
|
|
14980
14983
|
getFDC3Sync(version) {
|
|
14981
|
-
return __classPrivateFieldGet$
|
|
14984
|
+
return __classPrivateFieldGet$6(this, _InteropClient_fdc3Factory, "f").call(this, version, this, this.wire);
|
|
14982
14985
|
}
|
|
14983
14986
|
async getFDC3(version) {
|
|
14984
14987
|
return this.getFDC3Sync(version);
|
|
@@ -14989,7 +14992,7 @@ class InteropClient extends Base {
|
|
|
14989
14992
|
* Used to ferry fdc3-only calls from the fdc3 shim to the Interop Broker
|
|
14990
14993
|
*/
|
|
14991
14994
|
static async ferryFdc3Call(interopClient, action, payload) {
|
|
14992
|
-
const client = await __classPrivateFieldGet$
|
|
14995
|
+
const client = await __classPrivateFieldGet$6(interopClient, _InteropClient_clientPromise, "f");
|
|
14993
14996
|
return client.dispatch(action, payload || null);
|
|
14994
14997
|
}
|
|
14995
14998
|
}
|
|
@@ -15351,12 +15354,12 @@ const getIntentResolution = async (interopModule, context, app, intent) => {
|
|
|
15351
15354
|
return { ...intentResolutionInfoFromBroker, getResult };
|
|
15352
15355
|
};
|
|
15353
15356
|
|
|
15354
|
-
var __classPrivateFieldGet$
|
|
15357
|
+
var __classPrivateFieldGet$5 = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
15355
15358
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
15356
15359
|
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");
|
|
15357
15360
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15358
15361
|
};
|
|
15359
|
-
var __classPrivateFieldSet$
|
|
15362
|
+
var __classPrivateFieldSet$5 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
15360
15363
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
15361
15364
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
15362
15365
|
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");
|
|
@@ -15365,7 +15368,7 @@ var __classPrivateFieldSet$3 = (undefined && undefined.__classPrivateFieldSet) |
|
|
|
15365
15368
|
var _FDC3ModuleBase_producer;
|
|
15366
15369
|
class FDC3ModuleBase {
|
|
15367
15370
|
get client() {
|
|
15368
|
-
return __classPrivateFieldGet$
|
|
15371
|
+
return __classPrivateFieldGet$5(this, _FDC3ModuleBase_producer, "f").call(this);
|
|
15369
15372
|
}
|
|
15370
15373
|
get fin() {
|
|
15371
15374
|
return this.wire.getFin();
|
|
@@ -15374,7 +15377,7 @@ class FDC3ModuleBase {
|
|
|
15374
15377
|
constructor(producer, wire) {
|
|
15375
15378
|
this.wire = wire;
|
|
15376
15379
|
_FDC3ModuleBase_producer.set(this, void 0);
|
|
15377
|
-
__classPrivateFieldSet$
|
|
15380
|
+
__classPrivateFieldSet$5(this, _FDC3ModuleBase_producer, producer, "f");
|
|
15378
15381
|
}
|
|
15379
15382
|
/**
|
|
15380
15383
|
* Broadcasts a context for the channel of the current entity.
|
|
@@ -16174,13 +16177,13 @@ class InteropModule extends Base {
|
|
|
16174
16177
|
const channelPrefix = 'snapshot-source-provider-';
|
|
16175
16178
|
const getSnapshotSourceChannelName = (id) => `${channelPrefix}${id.uuid}`;
|
|
16176
16179
|
|
|
16177
|
-
var __classPrivateFieldSet$
|
|
16180
|
+
var __classPrivateFieldSet$4 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
16178
16181
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
16179
16182
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
16180
16183
|
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");
|
|
16181
16184
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16182
16185
|
};
|
|
16183
|
-
var __classPrivateFieldGet$
|
|
16186
|
+
var __classPrivateFieldGet$4 = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
16184
16187
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
16185
16188
|
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");
|
|
16186
16189
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -16207,26 +16210,26 @@ class SnapshotSource extends Base {
|
|
|
16207
16210
|
return connectionMap.get(this.identity.uuid);
|
|
16208
16211
|
});
|
|
16209
16212
|
_SnapshotSource_getClient.set(this, () => {
|
|
16210
|
-
if (!__classPrivateFieldGet$
|
|
16211
|
-
__classPrivateFieldGet$
|
|
16213
|
+
if (!__classPrivateFieldGet$4(this, _SnapshotSource_getConnection, "f").call(this).clientPromise) {
|
|
16214
|
+
__classPrivateFieldGet$4(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = __classPrivateFieldGet$4(this, _SnapshotSource_startConnection, "f").call(this);
|
|
16212
16215
|
}
|
|
16213
|
-
return __classPrivateFieldGet$
|
|
16216
|
+
return __classPrivateFieldGet$4(this, _SnapshotSource_getConnection, "f").call(this).clientPromise;
|
|
16214
16217
|
});
|
|
16215
16218
|
_SnapshotSource_startConnection.set(this, async () => {
|
|
16216
16219
|
const channelName = getSnapshotSourceChannelName(this.identity);
|
|
16217
16220
|
try {
|
|
16218
|
-
if (!__classPrivateFieldGet$
|
|
16219
|
-
await __classPrivateFieldGet$
|
|
16221
|
+
if (!__classPrivateFieldGet$4(this, _SnapshotSource_getConnection, "f").call(this).eventFired) {
|
|
16222
|
+
await __classPrivateFieldGet$4(this, _SnapshotSource_setUpConnectionListener, "f").call(this);
|
|
16220
16223
|
}
|
|
16221
16224
|
const client = await this.fin.InterApplicationBus.Channel.connect(channelName, { wait: false });
|
|
16222
16225
|
client.onDisconnection(() => {
|
|
16223
|
-
__classPrivateFieldGet$
|
|
16224
|
-
__classPrivateFieldGet$
|
|
16226
|
+
__classPrivateFieldGet$4(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = null;
|
|
16227
|
+
__classPrivateFieldGet$4(this, _SnapshotSource_getConnection, "f").call(this).eventFired = null;
|
|
16225
16228
|
});
|
|
16226
16229
|
return client;
|
|
16227
16230
|
}
|
|
16228
16231
|
catch (e) {
|
|
16229
|
-
__classPrivateFieldGet$
|
|
16232
|
+
__classPrivateFieldGet$4(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = null;
|
|
16230
16233
|
throw new Error("The targeted SnapshotSource is not currently initialized. Await this object's ready() method.");
|
|
16231
16234
|
}
|
|
16232
16235
|
});
|
|
@@ -16238,7 +16241,7 @@ class SnapshotSource extends Base {
|
|
|
16238
16241
|
resolve = y;
|
|
16239
16242
|
reject = n;
|
|
16240
16243
|
});
|
|
16241
|
-
__classPrivateFieldGet$
|
|
16244
|
+
__classPrivateFieldGet$4(this, _SnapshotSource_getConnection, "f").call(this).eventFired = eventFired;
|
|
16242
16245
|
const listener = async (e) => {
|
|
16243
16246
|
try {
|
|
16244
16247
|
if (e.channelName === channelName) {
|
|
@@ -16252,10 +16255,10 @@ class SnapshotSource extends Base {
|
|
|
16252
16255
|
};
|
|
16253
16256
|
await this.fin.InterApplicationBus.Channel.on('connected', listener);
|
|
16254
16257
|
});
|
|
16255
|
-
__classPrivateFieldSet$
|
|
16258
|
+
__classPrivateFieldSet$4(this, _SnapshotSource_identity, id, "f");
|
|
16256
16259
|
}
|
|
16257
16260
|
get identity() {
|
|
16258
|
-
return __classPrivateFieldGet$
|
|
16261
|
+
return __classPrivateFieldGet$4(this, _SnapshotSource_identity, "f");
|
|
16259
16262
|
}
|
|
16260
16263
|
/**
|
|
16261
16264
|
* Method to determine if the SnapshotSource has been initialized.
|
|
@@ -16289,11 +16292,11 @@ class SnapshotSource extends Base {
|
|
|
16289
16292
|
// eslint-disable-next-line no-async-promise-executor
|
|
16290
16293
|
try {
|
|
16291
16294
|
// 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?
|
|
16292
|
-
await __classPrivateFieldGet$
|
|
16295
|
+
await __classPrivateFieldGet$4(this, _SnapshotSource_getClient, "f").call(this);
|
|
16293
16296
|
}
|
|
16294
16297
|
catch (e) {
|
|
16295
16298
|
// it was not running.
|
|
16296
|
-
await __classPrivateFieldGet$
|
|
16299
|
+
await __classPrivateFieldGet$4(this, _SnapshotSource_getConnection, "f").call(this).eventFired;
|
|
16297
16300
|
}
|
|
16298
16301
|
}
|
|
16299
16302
|
/**
|
|
@@ -16302,7 +16305,7 @@ class SnapshotSource extends Base {
|
|
|
16302
16305
|
*/
|
|
16303
16306
|
async getSnapshot() {
|
|
16304
16307
|
this.wire.recordAnalytic('snapshot-source-get-snapshot');
|
|
16305
|
-
const client = await __classPrivateFieldGet$
|
|
16308
|
+
const client = await __classPrivateFieldGet$4(this, _SnapshotSource_getClient, "f").call(this);
|
|
16306
16309
|
const response = (await client.dispatch('get-snapshot'));
|
|
16307
16310
|
return (await response).snapshot;
|
|
16308
16311
|
}
|
|
@@ -16312,7 +16315,7 @@ class SnapshotSource extends Base {
|
|
|
16312
16315
|
*/
|
|
16313
16316
|
async applySnapshot(snapshot) {
|
|
16314
16317
|
this.wire.recordAnalytic('snapshot-source-apply-snapshot');
|
|
16315
|
-
const client = await __classPrivateFieldGet$
|
|
16318
|
+
const client = await __classPrivateFieldGet$4(this, _SnapshotSource_getClient, "f").call(this);
|
|
16316
16319
|
return client.dispatch('apply-snapshot', { snapshot });
|
|
16317
16320
|
}
|
|
16318
16321
|
}
|
|
@@ -16389,13 +16392,13 @@ class SnapshotSourceModule extends Base {
|
|
|
16389
16392
|
}
|
|
16390
16393
|
}
|
|
16391
16394
|
|
|
16392
|
-
var __classPrivateFieldSet$
|
|
16395
|
+
var __classPrivateFieldSet$3 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
16393
16396
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
16394
16397
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
16395
16398
|
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");
|
|
16396
16399
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16397
16400
|
};
|
|
16398
|
-
var __classPrivateFieldGet$
|
|
16401
|
+
var __classPrivateFieldGet$3 = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
16399
16402
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
16400
16403
|
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");
|
|
16401
16404
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -16424,11 +16427,11 @@ class NotificationManagerInstance {
|
|
|
16424
16427
|
_NotificationManagerInstance_handler.set(this, void 0);
|
|
16425
16428
|
_NotificationManagerInstance_id.set(this, void 0);
|
|
16426
16429
|
_NotificationManagerInstance_isReceivingNotifications.set(this, new Lazy(async () => {
|
|
16427
|
-
await __classPrivateFieldGet$
|
|
16428
|
-
if (message.action === 'notification-created' && message.payload.managerId === __classPrivateFieldGet$
|
|
16430
|
+
await __classPrivateFieldGet$3(this, _NotificationManagerInstance_wire, "f").registerMessageHandler((message) => {
|
|
16431
|
+
if (message.action === 'notification-created' && message.payload.managerId === __classPrivateFieldGet$3(this, _NotificationManagerInstance_id, "f")) {
|
|
16429
16432
|
const { notificationId, properties, documentUrl: url, notificationIcon: icon, badge, image } = message.payload;
|
|
16430
16433
|
try {
|
|
16431
|
-
__classPrivateFieldGet$
|
|
16434
|
+
__classPrivateFieldGet$3(this, _NotificationManagerInstance_handler, "f")?.call(this, {
|
|
16432
16435
|
properties,
|
|
16433
16436
|
images: {
|
|
16434
16437
|
image,
|
|
@@ -16466,8 +16469,8 @@ class NotificationManagerInstance {
|
|
|
16466
16469
|
* ```
|
|
16467
16470
|
*/
|
|
16468
16471
|
this.setNotificationHandler = async (handler) => {
|
|
16469
|
-
await __classPrivateFieldGet$
|
|
16470
|
-
__classPrivateFieldSet$
|
|
16472
|
+
await __classPrivateFieldGet$3(this, _NotificationManagerInstance_isReceivingNotifications, "f").getValue();
|
|
16473
|
+
__classPrivateFieldSet$3(this, _NotificationManagerInstance_handler, handler, "f");
|
|
16471
16474
|
};
|
|
16472
16475
|
/**
|
|
16473
16476
|
* Destroys the current NotificationManagerInstance.
|
|
@@ -16478,7 +16481,7 @@ class NotificationManagerInstance {
|
|
|
16478
16481
|
* ```
|
|
16479
16482
|
*/
|
|
16480
16483
|
this.destroy = async () => {
|
|
16481
|
-
await __classPrivateFieldGet$
|
|
16484
|
+
await __classPrivateFieldGet$3(this, _NotificationManagerInstance_wire, "f").sendAction('destroy-notification-manager', { managerId: __classPrivateFieldGet$3(this, _NotificationManagerInstance_id, "f") });
|
|
16482
16485
|
};
|
|
16483
16486
|
/**
|
|
16484
16487
|
* Dispatches a Notification lifecycle event ('close' | 'click' | 'show').
|
|
@@ -16504,13 +16507,13 @@ class NotificationManagerInstance {
|
|
|
16504
16507
|
*/
|
|
16505
16508
|
this.dispatch = async (event) => {
|
|
16506
16509
|
const { notificationId, type } = event;
|
|
16507
|
-
await __classPrivateFieldGet$
|
|
16510
|
+
await __classPrivateFieldGet$3(this, _NotificationManagerInstance_wire, "f").sendAction('dispatch-notification-event', {
|
|
16508
16511
|
notificationId,
|
|
16509
16512
|
type
|
|
16510
16513
|
});
|
|
16511
16514
|
};
|
|
16512
|
-
__classPrivateFieldSet$
|
|
16513
|
-
__classPrivateFieldSet$
|
|
16515
|
+
__classPrivateFieldSet$3(this, _NotificationManagerInstance_wire, wire, "f");
|
|
16516
|
+
__classPrivateFieldSet$3(this, _NotificationManagerInstance_id, id, "f");
|
|
16514
16517
|
}
|
|
16515
16518
|
}
|
|
16516
16519
|
_NotificationManagerInstance_wire = new WeakMap(), _NotificationManagerInstance_handler = new WeakMap(), _NotificationManagerInstance_id = new WeakMap(), _NotificationManagerInstance_isReceivingNotifications = new WeakMap();
|
|
@@ -16544,6 +16547,133 @@ class NotificationManagerModule extends Base {
|
|
|
16544
16547
|
}
|
|
16545
16548
|
}
|
|
16546
16549
|
|
|
16550
|
+
var __classPrivateFieldSet$2 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
16551
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
16552
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
16553
|
+
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");
|
|
16554
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16555
|
+
};
|
|
16556
|
+
var __classPrivateFieldGet$2 = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
16557
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
16558
|
+
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");
|
|
16559
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
16560
|
+
};
|
|
16561
|
+
var _Writable_value, _Writable_listeners, _Writable_readonlyWrapper;
|
|
16562
|
+
/**
|
|
16563
|
+
* Internal, a mutable implementation of the observable pattern.
|
|
16564
|
+
* It strictly controls its internal state and provides a secure
|
|
16565
|
+
* read-only wrapper for public consumption.
|
|
16566
|
+
*/
|
|
16567
|
+
class Writable {
|
|
16568
|
+
constructor(initialValue) {
|
|
16569
|
+
_Writable_value.set(this, void 0);
|
|
16570
|
+
_Writable_listeners.set(this, new Set());
|
|
16571
|
+
_Writable_readonlyWrapper.set(this, null);
|
|
16572
|
+
this.get = () => {
|
|
16573
|
+
return __classPrivateFieldGet$2(this, _Writable_value, "f");
|
|
16574
|
+
};
|
|
16575
|
+
this.set = (newValue) => {
|
|
16576
|
+
if (__classPrivateFieldGet$2(this, _Writable_value, "f") !== newValue) {
|
|
16577
|
+
__classPrivateFieldSet$2(this, _Writable_value, newValue, "f");
|
|
16578
|
+
// Snapshot listeners before invoking so subscribe/unsubscribe calls
|
|
16579
|
+
// made by a listener affect future emits, not the in-flight one.
|
|
16580
|
+
for (const listener of [...__classPrivateFieldGet$2(this, _Writable_listeners, "f")]) {
|
|
16581
|
+
try {
|
|
16582
|
+
listener();
|
|
16583
|
+
}
|
|
16584
|
+
catch (err) {
|
|
16585
|
+
// A throwing listener must not block later listeners; rethrow async
|
|
16586
|
+
// so the error surfaces via the host's unhandled-error reporter.
|
|
16587
|
+
setTimeout(() => {
|
|
16588
|
+
throw err;
|
|
16589
|
+
}, 0);
|
|
16590
|
+
}
|
|
16591
|
+
}
|
|
16592
|
+
}
|
|
16593
|
+
};
|
|
16594
|
+
this.subscribe = (listener) => {
|
|
16595
|
+
__classPrivateFieldGet$2(this, _Writable_listeners, "f").add(listener);
|
|
16596
|
+
return () => {
|
|
16597
|
+
__classPrivateFieldGet$2(this, _Writable_listeners, "f").delete(listener);
|
|
16598
|
+
};
|
|
16599
|
+
};
|
|
16600
|
+
__classPrivateFieldSet$2(this, _Writable_value, initialValue, "f");
|
|
16601
|
+
}
|
|
16602
|
+
get readonly() {
|
|
16603
|
+
if (!__classPrivateFieldGet$2(this, _Writable_readonlyWrapper, "f")) {
|
|
16604
|
+
__classPrivateFieldSet$2(this, _Writable_readonlyWrapper, {
|
|
16605
|
+
get: this.get,
|
|
16606
|
+
subscribe: this.subscribe
|
|
16607
|
+
}, "f");
|
|
16608
|
+
}
|
|
16609
|
+
return __classPrivateFieldGet$2(this, _Writable_readonlyWrapper, "f");
|
|
16610
|
+
}
|
|
16611
|
+
}
|
|
16612
|
+
_Writable_value = new WeakMap(), _Writable_listeners = new WeakMap(), _Writable_readonlyWrapper = new WeakMap();
|
|
16613
|
+
|
|
16614
|
+
var __classPrivateFieldSet$1 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
16615
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
16616
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
16617
|
+
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");
|
|
16618
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16619
|
+
};
|
|
16620
|
+
var __classPrivateFieldGet$1 = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
16621
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
16622
|
+
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");
|
|
16623
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
16624
|
+
};
|
|
16625
|
+
var _ChromeBrowserActionsImpl_wire, _ChromeBrowserActionsImpl_state;
|
|
16626
|
+
class ChromeBrowserActionsImpl {
|
|
16627
|
+
constructor(wire) {
|
|
16628
|
+
_ChromeBrowserActionsImpl_wire.set(this, void 0);
|
|
16629
|
+
_ChromeBrowserActionsImpl_state.set(this, new Writable([]));
|
|
16630
|
+
__classPrivateFieldSet$1(this, _ChromeBrowserActionsImpl_wire, wire, "f");
|
|
16631
|
+
}
|
|
16632
|
+
get state() {
|
|
16633
|
+
return __classPrivateFieldGet$1(this, _ChromeBrowserActionsImpl_state, "f").readonly;
|
|
16634
|
+
}
|
|
16635
|
+
/**
|
|
16636
|
+
* @internal Wires up the runtime push-update handler. Called once at construction
|
|
16637
|
+
* for window contexts; views never receive these updates.
|
|
16638
|
+
*/
|
|
16639
|
+
static activate(instance) {
|
|
16640
|
+
__classPrivateFieldGet$1(instance, _ChromeBrowserActionsImpl_wire, "f").registerMessageHandler((msg) => {
|
|
16641
|
+
if (msg?.action === 'chrome-browser-actions-update') {
|
|
16642
|
+
__classPrivateFieldGet$1(instance, _ChromeBrowserActionsImpl_state, "f").set(msg?.payload?.actions ?? []);
|
|
16643
|
+
return true;
|
|
16644
|
+
}
|
|
16645
|
+
return false;
|
|
16646
|
+
});
|
|
16647
|
+
}
|
|
16648
|
+
async getExtensionActions() {
|
|
16649
|
+
const ack = await __classPrivateFieldGet$1(this, _ChromeBrowserActionsImpl_wire, "f").sendAction('chrome-browser-get-extension-actions', {});
|
|
16650
|
+
return ack.payload.data.actions;
|
|
16651
|
+
}
|
|
16652
|
+
async invokeExtensionAction(options) {
|
|
16653
|
+
await __classPrivateFieldGet$1(this, _ChromeBrowserActionsImpl_wire, "f").sendAction('chrome-browser-invoke-extension-action', options);
|
|
16654
|
+
}
|
|
16655
|
+
async hideActiveExtensionPopup() {
|
|
16656
|
+
await __classPrivateFieldGet$1(this, _ChromeBrowserActionsImpl_wire, "f").sendAction('chrome-browser-hide-active-extension-popup', {});
|
|
16657
|
+
}
|
|
16658
|
+
}
|
|
16659
|
+
_ChromeBrowserActionsImpl_wire = new WeakMap(), _ChromeBrowserActionsImpl_state = new WeakMap();
|
|
16660
|
+
|
|
16661
|
+
/**
|
|
16662
|
+
* Client-side handle for the chrome-browser feature on the current window.
|
|
16663
|
+
*
|
|
16664
|
+
* The window must have been created with `chromeBrowser: true` for these APIs to do
|
|
16665
|
+
* anything meaningful — there is no separate `init()` step. From a view or a non
|
|
16666
|
+
* chrome-browser window, calls into `Actions` will resolve to empty results.
|
|
16667
|
+
*/
|
|
16668
|
+
class ChromeBrowserModule {
|
|
16669
|
+
constructor(wire, isWindow) {
|
|
16670
|
+
this.Actions = new ChromeBrowserActionsImpl(wire);
|
|
16671
|
+
if (isWindow) {
|
|
16672
|
+
ChromeBrowserActionsImpl.activate(this.Actions);
|
|
16673
|
+
}
|
|
16674
|
+
}
|
|
16675
|
+
}
|
|
16676
|
+
|
|
16547
16677
|
/**
|
|
16548
16678
|
* @internal
|
|
16549
16679
|
*/
|
|
@@ -16567,6 +16697,7 @@ class Fin extends events.EventEmitter {
|
|
|
16567
16697
|
this.Interop = new InteropModule(wire);
|
|
16568
16698
|
this.SnapshotSource = new SnapshotSourceModule(wire);
|
|
16569
16699
|
this.NotificationManager = new NotificationManagerModule(wire);
|
|
16700
|
+
this.ChromeBrowser = new ChromeBrowserModule(wire, wire.me.entityType === 'window');
|
|
16570
16701
|
wire.registerFin(this);
|
|
16571
16702
|
this.me = getMe(wire);
|
|
16572
16703
|
// Handle disconnect events
|