@openfin/remote-adapter 41.103.3 → 41.103.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/remote-adapter.js +179 -327
- package/package.json +28 -23
package/out/remote-adapter.js
CHANGED
|
@@ -20,35 +20,6 @@ var InteropBroker$1 = {};
|
|
|
20
20
|
|
|
21
21
|
var base = {};
|
|
22
22
|
|
|
23
|
-
var promises = {};
|
|
24
|
-
|
|
25
|
-
Object.defineProperty(promises, "__esModule", { value: true });
|
|
26
|
-
promises.promiseMapSerial = promises.serial = promises.promiseMap = promises.promisify = void 0;
|
|
27
|
-
function promisify(func) {
|
|
28
|
-
return (...args) => new Promise((resolve, reject) => {
|
|
29
|
-
func(...args, (err, val) => (err ? reject(err) : resolve(val)));
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
promises.promisify = promisify;
|
|
33
|
-
async function promiseMap(arr, asyncF) {
|
|
34
|
-
return Promise.all(arr.map(asyncF));
|
|
35
|
-
}
|
|
36
|
-
promises.promiseMap = promiseMap;
|
|
37
|
-
async function serial(arr) {
|
|
38
|
-
const ret = [];
|
|
39
|
-
for (const func of arr) {
|
|
40
|
-
// eslint-disable-next-line no-await-in-loop
|
|
41
|
-
const next = await func();
|
|
42
|
-
ret.push(next);
|
|
43
|
-
}
|
|
44
|
-
return ret;
|
|
45
|
-
}
|
|
46
|
-
promises.serial = serial;
|
|
47
|
-
async function promiseMapSerial(arr, func) {
|
|
48
|
-
return serial(arr.map((value, index, array) => () => func(value, index, array)));
|
|
49
|
-
}
|
|
50
|
-
promises.promiseMapSerial = promiseMapSerial;
|
|
51
|
-
|
|
52
23
|
var __classPrivateFieldSet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
53
24
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
54
25
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
@@ -63,7 +34,6 @@ var __classPrivateFieldGet$i = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
63
34
|
var _EmitterBase_emitterAccessor, _EmitterBase_deregisterOnceListeners;
|
|
64
35
|
Object.defineProperty(base, "__esModule", { value: true });
|
|
65
36
|
base.Reply = base.EmitterBase = base.Base = void 0;
|
|
66
|
-
const promises_1 = promises;
|
|
67
37
|
class Base {
|
|
68
38
|
/**
|
|
69
39
|
* @internal
|
|
@@ -141,27 +111,8 @@ class EmitterBase extends Base {
|
|
|
141
111
|
return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
|
|
142
112
|
};
|
|
143
113
|
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
|
|
144
|
-
/**
|
|
145
|
-
* Cleans up after removal of a listener, e.g. deleting any lingering deregistration handlers for a
|
|
146
|
-
* `once` subscription.
|
|
147
|
-
*
|
|
148
|
-
* @remarks Implementing this as a `removeListener` handler ensures that direct removal of a listener
|
|
149
|
-
* on the base emitter will not leak additional core handlers. We could do this in the forwarding method,
|
|
150
|
-
* which would involve less "magic," but would be more-vulnerable to accidental re-introduction of a leak.
|
|
151
|
-
*/
|
|
152
|
-
this.cleanUpRemovedListener = (eventType, listener) => {
|
|
153
|
-
const deregister = __classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").get(listener);
|
|
154
|
-
if (deregister) {
|
|
155
|
-
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
|
|
156
|
-
emitter.removeListener(eventType, deregister);
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
114
|
this.getOrCreateEmitter = () => {
|
|
160
|
-
|
|
161
|
-
if (!emitter.listeners('removeListener').includes(this.cleanUpRemovedListener)) {
|
|
162
|
-
emitter.on('removeListener', this.cleanUpRemovedListener);
|
|
163
|
-
}
|
|
164
|
-
return emitter;
|
|
115
|
+
return this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
|
|
165
116
|
};
|
|
166
117
|
this.listeners = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(type) : [];
|
|
167
118
|
this.listenerCount = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listenerCount(type) : 0;
|
|
@@ -201,7 +152,6 @@ class EmitterBase extends Base {
|
|
|
201
152
|
};
|
|
202
153
|
__classPrivateFieldSet$h(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
|
|
203
154
|
__classPrivateFieldSet$h(this, _EmitterBase_deregisterOnceListeners, new WeakMap(), "f");
|
|
204
|
-
this.listeners = (event) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(event) : [];
|
|
205
155
|
}
|
|
206
156
|
/**
|
|
207
157
|
* Adds a listener to the end of the listeners array for the specified event.
|
|
@@ -279,6 +229,10 @@ class EmitterBase extends Base {
|
|
|
279
229
|
const emitter = await this.deregisterEventListener(eventType, options);
|
|
280
230
|
if (emitter) {
|
|
281
231
|
emitter.removeListener(eventType, listener);
|
|
232
|
+
const deregister = __classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").get(listener);
|
|
233
|
+
if (deregister) {
|
|
234
|
+
emitter.removeListener(eventType, deregister);
|
|
235
|
+
}
|
|
282
236
|
this.deleteEmitterIfNothingRegistered(emitter);
|
|
283
237
|
}
|
|
284
238
|
return this;
|
|
@@ -314,12 +268,13 @@ class EmitterBase extends Base {
|
|
|
314
268
|
}
|
|
315
269
|
else if (this.hasEmitter()) {
|
|
316
270
|
const events = this.getOrCreateEmitter().eventNames();
|
|
317
|
-
await (
|
|
271
|
+
await Promise.all(events.map(removeByEvent));
|
|
318
272
|
}
|
|
319
273
|
return this;
|
|
320
274
|
}
|
|
321
275
|
deleteEmitterIfNothingRegistered(emitter) {
|
|
322
|
-
|
|
276
|
+
// TODO: maybe emitterMap should clean up itself..
|
|
277
|
+
if (emitter.eventNames().length === 0) {
|
|
323
278
|
this.wire.eventAggregator.delete(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
|
|
324
279
|
}
|
|
325
280
|
}
|
|
@@ -2672,9 +2627,7 @@ function requireFactory$2 () {
|
|
|
2672
2627
|
* @experimental
|
|
2673
2628
|
*/
|
|
2674
2629
|
async wrap(identity) {
|
|
2675
|
-
this.wire.
|
|
2676
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
2677
|
-
});
|
|
2630
|
+
this.wire.recordAnalytic('view-wrap');
|
|
2678
2631
|
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
2679
2632
|
if (errorMsg) {
|
|
2680
2633
|
throw new Error(errorMsg);
|
|
@@ -2696,9 +2649,7 @@ function requireFactory$2 () {
|
|
|
2696
2649
|
* @experimental
|
|
2697
2650
|
*/
|
|
2698
2651
|
wrapSync(identity) {
|
|
2699
|
-
this.wire.
|
|
2700
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
2701
|
-
});
|
|
2652
|
+
this.wire.recordAnalytic('view-wrap-sync');
|
|
2702
2653
|
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
2703
2654
|
if (errorMsg) {
|
|
2704
2655
|
throw new Error(errorMsg);
|
|
@@ -2718,9 +2669,7 @@ function requireFactory$2 () {
|
|
|
2718
2669
|
* @experimental
|
|
2719
2670
|
*/
|
|
2720
2671
|
getCurrent() {
|
|
2721
|
-
this.wire.
|
|
2722
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
2723
|
-
});
|
|
2672
|
+
this.wire.recordAnalytic('view-get-current');
|
|
2724
2673
|
if (!this.wire.me.isView) {
|
|
2725
2674
|
throw new Error('You are not in a View context');
|
|
2726
2675
|
}
|
|
@@ -2739,9 +2688,7 @@ function requireFactory$2 () {
|
|
|
2739
2688
|
* @experimental
|
|
2740
2689
|
*/
|
|
2741
2690
|
getCurrentSync() {
|
|
2742
|
-
this.wire.
|
|
2743
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
2744
|
-
});
|
|
2691
|
+
this.wire.recordAnalytic('view-get-current-sync');
|
|
2745
2692
|
if (!this.wire.me.isView) {
|
|
2746
2693
|
throw new Error('You are not in a View context');
|
|
2747
2694
|
}
|
|
@@ -3753,9 +3700,7 @@ class WebContents extends base_1$l.EmitterBase {
|
|
|
3753
3700
|
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
3754
3701
|
*/
|
|
3755
3702
|
async showPopupWindow(options) {
|
|
3756
|
-
this.wire.
|
|
3757
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3758
|
-
});
|
|
3703
|
+
this.wire.recordAnalytic(`${this.entityType}-show-popup-window`);
|
|
3759
3704
|
if (options?.onPopupReady) {
|
|
3760
3705
|
const readyListener = async ({ popupName }) => {
|
|
3761
3706
|
try {
|
|
@@ -3966,9 +3911,7 @@ function requireInstance$2 () {
|
|
|
3966
3911
|
*/
|
|
3967
3912
|
close(force = false) {
|
|
3968
3913
|
console.warn('Deprecation Warning: Application.close is deprecated Please use Application.quit');
|
|
3969
|
-
this.wire.
|
|
3970
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3971
|
-
});
|
|
3914
|
+
this.wire.recordAnalytic('application-close');
|
|
3972
3915
|
return this._close(force);
|
|
3973
3916
|
}
|
|
3974
3917
|
/**
|
|
@@ -4109,9 +4052,7 @@ function requireInstance$2 () {
|
|
|
4109
4052
|
* ```
|
|
4110
4053
|
*/
|
|
4111
4054
|
getWindow() {
|
|
4112
|
-
this.wire.
|
|
4113
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4114
|
-
});
|
|
4055
|
+
this.wire.recordAnalytic('application-get-window');
|
|
4115
4056
|
return Promise.resolve(this.window);
|
|
4116
4057
|
}
|
|
4117
4058
|
/**
|
|
@@ -4189,9 +4130,7 @@ function requireInstance$2 () {
|
|
|
4189
4130
|
*/
|
|
4190
4131
|
run() {
|
|
4191
4132
|
console.warn('Deprecation Warning: Application.run is deprecated Please use fin.Application.start');
|
|
4192
|
-
this.wire.
|
|
4193
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4194
|
-
});
|
|
4133
|
+
this.wire.recordAnalytic('application-run');
|
|
4195
4134
|
return this._run();
|
|
4196
4135
|
}
|
|
4197
4136
|
_run(opts = {}) {
|
|
@@ -4716,9 +4655,7 @@ function requireFactory$1 () {
|
|
|
4716
4655
|
*
|
|
4717
4656
|
*/
|
|
4718
4657
|
async wrap(identity) {
|
|
4719
|
-
this.wire.
|
|
4720
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4721
|
-
});
|
|
4658
|
+
this.wire.recordAnalytic('wrap-application');
|
|
4722
4659
|
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
4723
4660
|
if (errorMsg) {
|
|
4724
4661
|
throw new Error(errorMsg);
|
|
@@ -4741,9 +4678,7 @@ function requireFactory$1 () {
|
|
|
4741
4678
|
*
|
|
4742
4679
|
*/
|
|
4743
4680
|
wrapSync(identity) {
|
|
4744
|
-
this.wire.
|
|
4745
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4746
|
-
});
|
|
4681
|
+
this.wire.recordAnalytic('wrap-application-sync');
|
|
4747
4682
|
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
4748
4683
|
if (errorMsg) {
|
|
4749
4684
|
throw new Error(errorMsg);
|
|
@@ -4784,9 +4719,7 @@ function requireFactory$1 () {
|
|
|
4784
4719
|
*/
|
|
4785
4720
|
create(appOptions) {
|
|
4786
4721
|
console.warn('Deprecation Warning: fin.Application.create is deprecated. Please use fin.Application.start');
|
|
4787
|
-
this.wire.
|
|
4788
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4789
|
-
});
|
|
4722
|
+
this.wire.recordAnalytic('application-create');
|
|
4790
4723
|
return this._create(appOptions);
|
|
4791
4724
|
}
|
|
4792
4725
|
/**
|
|
@@ -4808,9 +4741,7 @@ function requireFactory$1 () {
|
|
|
4808
4741
|
*
|
|
4809
4742
|
*/
|
|
4810
4743
|
async start(appOptions) {
|
|
4811
|
-
this.wire.
|
|
4812
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4813
|
-
});
|
|
4744
|
+
this.wire.recordAnalytic('start-application');
|
|
4814
4745
|
const app = await this._create(appOptions);
|
|
4815
4746
|
await this.wire.sendAction('run-application', { uuid: appOptions.uuid });
|
|
4816
4747
|
return app;
|
|
@@ -4873,9 +4804,7 @@ function requireFactory$1 () {
|
|
|
4873
4804
|
* ```
|
|
4874
4805
|
*/
|
|
4875
4806
|
getCurrent() {
|
|
4876
|
-
this.wire.
|
|
4877
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4878
|
-
});
|
|
4807
|
+
this.wire.recordAnalytic('get-current-application');
|
|
4879
4808
|
return this.wrap({ uuid: this.wire.me.uuid });
|
|
4880
4809
|
}
|
|
4881
4810
|
/**
|
|
@@ -4898,9 +4827,7 @@ function requireFactory$1 () {
|
|
|
4898
4827
|
* ```
|
|
4899
4828
|
*/
|
|
4900
4829
|
getCurrentSync() {
|
|
4901
|
-
this.wire.
|
|
4902
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4903
|
-
});
|
|
4830
|
+
this.wire.recordAnalytic('get-current-application-sync');
|
|
4904
4831
|
return this.wrapSync({ uuid: this.wire.me.uuid });
|
|
4905
4832
|
}
|
|
4906
4833
|
/**
|
|
@@ -4918,9 +4845,7 @@ function requireFactory$1 () {
|
|
|
4918
4845
|
* ```
|
|
4919
4846
|
*/
|
|
4920
4847
|
async startFromManifest(manifestUrl, opts) {
|
|
4921
|
-
this.wire.
|
|
4922
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4923
|
-
});
|
|
4848
|
+
this.wire.recordAnalytic('application-start-from-manifest');
|
|
4924
4849
|
const app = await this._createFromManifest(manifestUrl);
|
|
4925
4850
|
// @ts-expect-error using private method without warning.
|
|
4926
4851
|
await app._run(opts); // eslint-disable-line no-underscore-dangle
|
|
@@ -4942,9 +4867,7 @@ function requireFactory$1 () {
|
|
|
4942
4867
|
*/
|
|
4943
4868
|
createFromManifest(manifestUrl) {
|
|
4944
4869
|
console.warn('Deprecation Warning: fin.Application.createFromManifest is deprecated. Please use fin.Application.startFromManifest');
|
|
4945
|
-
this.wire.
|
|
4946
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4947
|
-
});
|
|
4870
|
+
this.wire.recordAnalytic('application-create-from-manifest');
|
|
4948
4871
|
return this._createFromManifest(manifestUrl);
|
|
4949
4872
|
}
|
|
4950
4873
|
_createFromManifest(manifestUrl) {
|
|
@@ -5065,9 +4988,7 @@ function requireInstance$1 () {
|
|
|
5065
4988
|
super(wire, identity, 'window');
|
|
5066
4989
|
}
|
|
5067
4990
|
async createWindow(options) {
|
|
5068
|
-
this.wire.
|
|
5069
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
5070
|
-
});
|
|
4991
|
+
this.wire.recordAnalytic('window-create-window');
|
|
5071
4992
|
const CONSTRUCTOR_CB_TOPIC = 'fire-constructor-callback';
|
|
5072
4993
|
const responseSubscription = await (0, promisifySubscription_1.promisifySubscription)(this, CONSTRUCTOR_CB_TOPIC);
|
|
5073
4994
|
// set defaults:
|
|
@@ -5541,9 +5462,7 @@ function requireInstance$1 () {
|
|
|
5541
5462
|
* @experimental
|
|
5542
5463
|
*/
|
|
5543
5464
|
async getLayout(layoutIdentity) {
|
|
5544
|
-
this.wire.
|
|
5545
|
-
// don't expose
|
|
5546
|
-
});
|
|
5465
|
+
this.wire.recordAnalytic('window-get-layout');
|
|
5547
5466
|
const opts = await this.getOptions();
|
|
5548
5467
|
if (!opts.layout && !opts.layoutSnapshot) {
|
|
5549
5468
|
throw new Error('Window does not have a Layout');
|
|
@@ -5592,9 +5511,7 @@ function requireInstance$1 () {
|
|
|
5592
5511
|
* ```
|
|
5593
5512
|
*/
|
|
5594
5513
|
getParentApplication() {
|
|
5595
|
-
this.wire.
|
|
5596
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
5597
|
-
});
|
|
5514
|
+
this.wire.recordAnalytic('window-get-parent-application');
|
|
5598
5515
|
return Promise.resolve(new application_1.Application(this.wire, this.identity));
|
|
5599
5516
|
}
|
|
5600
5517
|
/**
|
|
@@ -5617,9 +5534,7 @@ function requireInstance$1 () {
|
|
|
5617
5534
|
* ```
|
|
5618
5535
|
*/
|
|
5619
5536
|
getParentWindow() {
|
|
5620
|
-
this.wire.
|
|
5621
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
5622
|
-
});
|
|
5537
|
+
this.wire.recordAnalytic('window-get-parent-window');
|
|
5623
5538
|
return Promise.resolve(new application_1.Application(this.wire, this.identity)).then((app) => app.getWindow());
|
|
5624
5539
|
}
|
|
5625
5540
|
/**
|
|
@@ -5723,9 +5638,7 @@ function requireInstance$1 () {
|
|
|
5723
5638
|
* ```
|
|
5724
5639
|
*/
|
|
5725
5640
|
getWebWindow() {
|
|
5726
|
-
this.wire.
|
|
5727
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
5728
|
-
});
|
|
5641
|
+
this.wire.recordAnalytic('window-get-web-window');
|
|
5729
5642
|
return this.wire.environment.getWebWindow(this.identity);
|
|
5730
5643
|
}
|
|
5731
5644
|
/**
|
|
@@ -5739,9 +5652,7 @@ function requireInstance$1 () {
|
|
|
5739
5652
|
* ```
|
|
5740
5653
|
*/
|
|
5741
5654
|
isMainWindow() {
|
|
5742
|
-
this.wire.
|
|
5743
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
5744
|
-
});
|
|
5655
|
+
this.wire.recordAnalytic('window-is-main-window');
|
|
5745
5656
|
return this.me.uuid === this.me.name;
|
|
5746
5657
|
}
|
|
5747
5658
|
/**
|
|
@@ -6124,6 +6035,9 @@ function requireInstance$1 () {
|
|
|
6124
6035
|
* ```
|
|
6125
6036
|
*/
|
|
6126
6037
|
updateOptions(options) {
|
|
6038
|
+
if ('frame' in options) {
|
|
6039
|
+
console.warn(`Deprecation Warning: Starting with version 45 it will not be possible to change the frame value after window has been created.`);
|
|
6040
|
+
}
|
|
6127
6041
|
return this.wire.sendAction('update-window-options', { options, ...this.identity }).then(() => undefined);
|
|
6128
6042
|
}
|
|
6129
6043
|
/**
|
|
@@ -6260,9 +6174,7 @@ function requireInstance$1 () {
|
|
|
6260
6174
|
* ```
|
|
6261
6175
|
*/
|
|
6262
6176
|
async dispatchPopupResult(data) {
|
|
6263
|
-
this.wire.
|
|
6264
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
6265
|
-
});
|
|
6177
|
+
this.wire.recordAnalytic('window-dispatch-popup-result');
|
|
6266
6178
|
await this.wire.sendAction('dispatch-popup-result', { data, ...this.identity });
|
|
6267
6179
|
}
|
|
6268
6180
|
/**
|
|
@@ -6362,9 +6274,7 @@ function requireFactory () {
|
|
|
6362
6274
|
* ```
|
|
6363
6275
|
*/
|
|
6364
6276
|
async wrap(identity) {
|
|
6365
|
-
this.wire.
|
|
6366
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
6367
|
-
});
|
|
6277
|
+
this.wire.recordAnalytic('window-wrap');
|
|
6368
6278
|
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
6369
6279
|
if (errorMsg) {
|
|
6370
6280
|
throw new Error(errorMsg);
|
|
@@ -6394,9 +6304,7 @@ function requireFactory () {
|
|
|
6394
6304
|
* ```
|
|
6395
6305
|
*/
|
|
6396
6306
|
wrapSync(identity) {
|
|
6397
|
-
this.wire.
|
|
6398
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
6399
|
-
});
|
|
6307
|
+
this.wire.recordAnalytic('window-wrap-sync');
|
|
6400
6308
|
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
6401
6309
|
if (errorMsg) {
|
|
6402
6310
|
throw new Error(errorMsg);
|
|
@@ -6425,9 +6333,7 @@ function requireFactory () {
|
|
|
6425
6333
|
* ```
|
|
6426
6334
|
*/
|
|
6427
6335
|
create(options) {
|
|
6428
|
-
this.wire.
|
|
6429
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
6430
|
-
});
|
|
6336
|
+
this.wire.recordAnalytic('create-window');
|
|
6431
6337
|
const win = new Instance_1._Window(this.wire, { uuid: this.me.uuid, name: options.name });
|
|
6432
6338
|
return win.createWindow(options);
|
|
6433
6339
|
}
|
|
@@ -6443,9 +6349,7 @@ function requireFactory () {
|
|
|
6443
6349
|
* ```
|
|
6444
6350
|
*/
|
|
6445
6351
|
getCurrent() {
|
|
6446
|
-
this.wire.
|
|
6447
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
6448
|
-
});
|
|
6352
|
+
this.wire.recordAnalytic('get-current-window');
|
|
6449
6353
|
if (!this.wire.me.isWindow) {
|
|
6450
6354
|
throw new Error('You are not in a Window context');
|
|
6451
6355
|
}
|
|
@@ -6464,9 +6368,7 @@ function requireFactory () {
|
|
|
6464
6368
|
* ```
|
|
6465
6369
|
*/
|
|
6466
6370
|
getCurrentSync() {
|
|
6467
|
-
this.wire.
|
|
6468
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
6469
|
-
});
|
|
6371
|
+
this.wire.recordAnalytic('get-current-window-sync');
|
|
6470
6372
|
if (!this.wire.me.isWindow) {
|
|
6471
6373
|
throw new Error('You are not in a Window context');
|
|
6472
6374
|
}
|
|
@@ -6858,9 +6760,7 @@ function requireInstance () {
|
|
|
6858
6760
|
* @experimental
|
|
6859
6761
|
*/
|
|
6860
6762
|
this.getParentLayout = async () => {
|
|
6861
|
-
this.wire.
|
|
6862
|
-
// don't expose
|
|
6863
|
-
});
|
|
6763
|
+
this.wire.recordAnalytic('view-get-parent-layout');
|
|
6864
6764
|
return this.fin.Platform.Layout.getLayoutByViewIdentity(this.identity);
|
|
6865
6765
|
};
|
|
6866
6766
|
/**
|
|
@@ -6973,9 +6873,7 @@ function requireInstance () {
|
|
|
6973
6873
|
* ```
|
|
6974
6874
|
*/
|
|
6975
6875
|
this.getCurrentStack = async () => {
|
|
6976
|
-
this.wire.
|
|
6977
|
-
// don't expose
|
|
6978
|
-
});
|
|
6876
|
+
this.wire.recordAnalytic('view-get-current-stack');
|
|
6979
6877
|
try {
|
|
6980
6878
|
const layout = await this.getParentLayout();
|
|
6981
6879
|
return layout.getStackByViewIdentity(this.identity);
|
|
@@ -7206,9 +7104,7 @@ class _FrameModule extends base_1$j.Base {
|
|
|
7206
7104
|
* ```
|
|
7207
7105
|
*/
|
|
7208
7106
|
async wrap(identity) {
|
|
7209
|
-
this.wire.
|
|
7210
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
7211
|
-
});
|
|
7107
|
+
this.wire.recordAnalytic('frame-wrap');
|
|
7212
7108
|
const errorMsg = (0, validate_1$3.validateIdentity)(identity);
|
|
7213
7109
|
if (errorMsg) {
|
|
7214
7110
|
throw new Error(errorMsg);
|
|
@@ -7230,9 +7126,7 @@ class _FrameModule extends base_1$j.Base {
|
|
|
7230
7126
|
* ```
|
|
7231
7127
|
*/
|
|
7232
7128
|
wrapSync(identity) {
|
|
7233
|
-
this.wire.
|
|
7234
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
7235
|
-
});
|
|
7129
|
+
this.wire.recordAnalytic('frame-wrap-sync');
|
|
7236
7130
|
const errorMsg = (0, validate_1$3.validateIdentity)(identity);
|
|
7237
7131
|
if (errorMsg) {
|
|
7238
7132
|
throw new Error(errorMsg);
|
|
@@ -7250,9 +7144,7 @@ class _FrameModule extends base_1$j.Base {
|
|
|
7250
7144
|
* ```
|
|
7251
7145
|
*/
|
|
7252
7146
|
getCurrent() {
|
|
7253
|
-
this.wire.
|
|
7254
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
7255
|
-
});
|
|
7147
|
+
this.wire.recordAnalytic('frame-get-current');
|
|
7256
7148
|
return Promise.resolve(new Instance_1$4._Frame(this.wire, this.wire.environment.getCurrentEntityIdentity()));
|
|
7257
7149
|
}
|
|
7258
7150
|
/**
|
|
@@ -7266,9 +7158,7 @@ class _FrameModule extends base_1$j.Base {
|
|
|
7266
7158
|
* ```
|
|
7267
7159
|
*/
|
|
7268
7160
|
getCurrentSync() {
|
|
7269
|
-
this.wire.
|
|
7270
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
7271
|
-
});
|
|
7161
|
+
this.wire.recordAnalytic('frame-get-current-sync');
|
|
7272
7162
|
return new Instance_1$4._Frame(this.wire, this.wire.environment.getCurrentEntityIdentity());
|
|
7273
7163
|
}
|
|
7274
7164
|
}
|
|
@@ -7375,9 +7265,7 @@ class ExternalApplicationModule extends base_1$h.Base {
|
|
|
7375
7265
|
* ```
|
|
7376
7266
|
*/
|
|
7377
7267
|
wrap(uuid) {
|
|
7378
|
-
this.wire.
|
|
7379
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
7380
|
-
});
|
|
7268
|
+
this.wire.recordAnalytic('external-application-wrap');
|
|
7381
7269
|
return Promise.resolve(new Instance_1$3.ExternalApplication(this.wire, { uuid }));
|
|
7382
7270
|
}
|
|
7383
7271
|
/**
|
|
@@ -7394,9 +7282,7 @@ class ExternalApplicationModule extends base_1$h.Base {
|
|
|
7394
7282
|
* ```
|
|
7395
7283
|
*/
|
|
7396
7284
|
wrapSync(uuid) {
|
|
7397
|
-
this.wire.
|
|
7398
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
7399
|
-
});
|
|
7285
|
+
this.wire.recordAnalytic('external-application-wrap-sync');
|
|
7400
7286
|
return new Instance_1$3.ExternalApplication(this.wire, { uuid });
|
|
7401
7287
|
}
|
|
7402
7288
|
}
|
|
@@ -7602,7 +7488,7 @@ var __classPrivateFieldGet$g = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
7602
7488
|
var __importDefault$6 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
7603
7489
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7604
7490
|
};
|
|
7605
|
-
var _Transport_wire, _Transport_fin;
|
|
7491
|
+
var _Transport_instances, _Transport_wire, _Transport_analyticsEnabled, _Transport_analyticsBuffer, _Transport_analyticsFlushTimeout, _Transport_fin, _Transport_flushAnalytics;
|
|
7606
7492
|
Object.defineProperty(transport, "__esModule", { value: true });
|
|
7607
7493
|
var Transport_1 = transport.Transport = void 0;
|
|
7608
7494
|
const events_1$5 = require$$0;
|
|
@@ -7614,11 +7500,15 @@ const errors_1$2 = errors;
|
|
|
7614
7500
|
class Transport extends events_1$5.EventEmitter {
|
|
7615
7501
|
constructor(factory, environment, config) {
|
|
7616
7502
|
super();
|
|
7503
|
+
_Transport_instances.add(this);
|
|
7617
7504
|
this.wireListeners = new Map();
|
|
7618
7505
|
this.topicRefMap = new Map();
|
|
7619
7506
|
this.eventAggregator = new eventAggregator_1.default();
|
|
7620
7507
|
this.messageHandlers = [this.eventAggregator.dispatchEvent];
|
|
7621
7508
|
_Transport_wire.set(this, void 0);
|
|
7509
|
+
_Transport_analyticsEnabled.set(this, true);
|
|
7510
|
+
_Transport_analyticsBuffer.set(this, new Map());
|
|
7511
|
+
_Transport_analyticsFlushTimeout.set(this, void 0);
|
|
7622
7512
|
// Typing as unknown to avoid circular dependency, should not be used directly.
|
|
7623
7513
|
_Transport_fin.set(this, void 0);
|
|
7624
7514
|
this.connectSync = () => {
|
|
@@ -7632,6 +7522,7 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
7632
7522
|
};
|
|
7633
7523
|
__classPrivateFieldSet$f(this, _Transport_wire, factory(this.onmessage.bind(this)), "f");
|
|
7634
7524
|
this.environment = environment;
|
|
7525
|
+
__classPrivateFieldSet$f(this, _Transport_analyticsEnabled, config.apiDiagnostics !== false, "f");
|
|
7635
7526
|
this.sendRaw = __classPrivateFieldGet$g(this, _Transport_wire, "f").send.bind(__classPrivateFieldGet$g(this, _Transport_wire, "f"));
|
|
7636
7527
|
this.registerMessageHandler(this.handleMessage.bind(this));
|
|
7637
7528
|
__classPrivateFieldGet$g(this, _Transport_wire, "f").on('disconnected', () => {
|
|
@@ -7639,6 +7530,9 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
7639
7530
|
handleNack({ reason: 'Remote connection has closed' });
|
|
7640
7531
|
}
|
|
7641
7532
|
this.wireListeners.clear();
|
|
7533
|
+
clearTimeout(__classPrivateFieldGet$g(this, _Transport_analyticsFlushTimeout, "f"));
|
|
7534
|
+
__classPrivateFieldSet$f(this, _Transport_analyticsFlushTimeout, undefined, "f");
|
|
7535
|
+
__classPrivateFieldGet$g(this, _Transport_analyticsBuffer, "f").clear();
|
|
7642
7536
|
this.emit('disconnected');
|
|
7643
7537
|
});
|
|
7644
7538
|
const { uuid, name } = config;
|
|
@@ -7657,6 +7551,18 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
7657
7551
|
}
|
|
7658
7552
|
__classPrivateFieldSet$f(this, _Transport_fin, _fin, "f");
|
|
7659
7553
|
}
|
|
7554
|
+
recordAnalytic(action) {
|
|
7555
|
+
if (!__classPrivateFieldGet$g(this, _Transport_analyticsEnabled, "f"))
|
|
7556
|
+
return;
|
|
7557
|
+
__classPrivateFieldGet$g(this, _Transport_analyticsBuffer, "f").set(action, (__classPrivateFieldGet$g(this, _Transport_analyticsBuffer, "f").get(action) ?? 0) + 1);
|
|
7558
|
+
if (__classPrivateFieldGet$g(this, _Transport_analyticsFlushTimeout, "f") === undefined) {
|
|
7559
|
+
const timeout = setTimeout(() => __classPrivateFieldGet$g(this, _Transport_instances, "m", _Transport_flushAnalytics).call(this), 30000);
|
|
7560
|
+
if (typeof timeout === 'object' && timeout !== null) {
|
|
7561
|
+
timeout.unref?.();
|
|
7562
|
+
}
|
|
7563
|
+
__classPrivateFieldSet$f(this, _Transport_analyticsFlushTimeout, timeout, "f");
|
|
7564
|
+
}
|
|
7565
|
+
}
|
|
7660
7566
|
shutdown() {
|
|
7661
7567
|
const wire = __classPrivateFieldGet$g(this, _Transport_wire, "f");
|
|
7662
7568
|
return wire.shutdown();
|
|
@@ -7820,7 +7726,16 @@ class Transport extends events_1$5.EventEmitter {
|
|
|
7820
7726
|
}
|
|
7821
7727
|
}
|
|
7822
7728
|
Transport_1 = transport.Transport = Transport;
|
|
7823
|
-
_Transport_wire = new WeakMap(), _Transport_fin = new WeakMap()
|
|
7729
|
+
_Transport_wire = new WeakMap(), _Transport_analyticsEnabled = new WeakMap(), _Transport_analyticsBuffer = new WeakMap(), _Transport_analyticsFlushTimeout = new WeakMap(), _Transport_fin = new WeakMap(), _Transport_instances = new WeakSet(), _Transport_flushAnalytics = function _Transport_flushAnalytics() {
|
|
7730
|
+
__classPrivateFieldSet$f(this, _Transport_analyticsFlushTimeout, undefined, "f");
|
|
7731
|
+
if (__classPrivateFieldGet$g(this, _Transport_analyticsBuffer, "f").size === 0)
|
|
7732
|
+
return;
|
|
7733
|
+
const counts = Object.fromEntries(__classPrivateFieldGet$g(this, _Transport_analyticsBuffer, "f"));
|
|
7734
|
+
__classPrivateFieldGet$g(this, _Transport_analyticsBuffer, "f").clear();
|
|
7735
|
+
this.sendAction('send-analytics-batch', { counts }).catch(() => {
|
|
7736
|
+
// analytics flush failure is non-fatal, counts are already cleared
|
|
7737
|
+
});
|
|
7738
|
+
};
|
|
7824
7739
|
|
|
7825
7740
|
var websocket = {};
|
|
7826
7741
|
|
|
@@ -7984,13 +7899,15 @@ class System extends base_1$g.EmitterBase {
|
|
|
7984
7899
|
* * cookies: browser [cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies)
|
|
7985
7900
|
* * localStorage: browser data that can be used across sessions ([local storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage))
|
|
7986
7901
|
* * appcache: html5 [application cache](https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache)
|
|
7902
|
+
* * windowState: clears data written for windows using `saveWindowState`; after clearing, previously saved bounds and state will not be restored until new state is written
|
|
7987
7903
|
* @example
|
|
7988
7904
|
* ```js
|
|
7989
7905
|
* const clearCacheOptions = {
|
|
7990
7906
|
* appcache: true,
|
|
7991
7907
|
* cache: true,
|
|
7992
7908
|
* cookies: true,
|
|
7993
|
-
* localStorage: true
|
|
7909
|
+
* localStorage: true,
|
|
7910
|
+
* windowState: true
|
|
7994
7911
|
* };
|
|
7995
7912
|
* fin.System.clearCache(clearCacheOptions).then(() => console.log('Cache cleared')).catch(err => console.log(err));
|
|
7996
7913
|
* ```
|
|
@@ -9392,9 +9309,7 @@ class System extends base_1$g.EmitterBase {
|
|
|
9392
9309
|
* @experimental
|
|
9393
9310
|
*/
|
|
9394
9311
|
async registerShutdownHandler(handler) {
|
|
9395
|
-
this.wire.
|
|
9396
|
-
// don't expose, analytics-only call
|
|
9397
|
-
});
|
|
9312
|
+
this.wire.recordAnalytic('system-register-shutdown-handler');
|
|
9398
9313
|
const SystemShutdownEventName = 'system-shutdown';
|
|
9399
9314
|
const SystemShutdownHandledEventName = 'system-shutdown-handled';
|
|
9400
9315
|
const { uuid, name } = this.wire.me;
|
|
@@ -10991,9 +10906,8 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
10991
10906
|
return [...__classPrivateFieldGet$b(this, _ChannelProvider_connections, "f")];
|
|
10992
10907
|
}
|
|
10993
10908
|
static handleClientDisconnection(channel, payload) {
|
|
10994
|
-
if (payload
|
|
10995
|
-
|
|
10996
|
-
__classPrivateFieldGet$b(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
|
|
10909
|
+
if (payload.endpointId) {
|
|
10910
|
+
__classPrivateFieldGet$b(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { endpointId: payload.endpointId });
|
|
10997
10911
|
}
|
|
10998
10912
|
else {
|
|
10999
10913
|
// this is here to support older runtimes that did not have endpointId
|
|
@@ -11163,7 +11077,9 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
11163
11077
|
* ```
|
|
11164
11078
|
*/
|
|
11165
11079
|
onDisconnection(listener) {
|
|
11166
|
-
this.disconnectListener =
|
|
11080
|
+
this.disconnectListener = (identity) => {
|
|
11081
|
+
listener(identity);
|
|
11082
|
+
};
|
|
11167
11083
|
}
|
|
11168
11084
|
/**
|
|
11169
11085
|
* Destroy the channel, raises `disconnected` events on all connected channel clients.
|
|
@@ -11180,7 +11096,6 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
11180
11096
|
*/
|
|
11181
11097
|
async destroy() {
|
|
11182
11098
|
const protectedObj = __classPrivateFieldGet$b(this, _ChannelProvider_protectedObj, "f");
|
|
11183
|
-
protectedObj.providerIdentity;
|
|
11184
11099
|
__classPrivateFieldSet$a(this, _ChannelProvider_connections, [], "f");
|
|
11185
11100
|
await protectedObj.close();
|
|
11186
11101
|
__classPrivateFieldGet$b(this, _ChannelProvider_close, "f").call(this);
|
|
@@ -11487,7 +11402,7 @@ const base_1$d = base;
|
|
|
11487
11402
|
const strategy_1 = strategy$3;
|
|
11488
11403
|
const strategy_2 = strategy$2;
|
|
11489
11404
|
const ice_manager_1 = iceManager;
|
|
11490
|
-
const provider_1
|
|
11405
|
+
const provider_1 = provider;
|
|
11491
11406
|
const message_receiver_1 = messageReceiver;
|
|
11492
11407
|
const protocol_manager_1 = protocolManager;
|
|
11493
11408
|
const strategy_3 = __importDefault$5(strategy);
|
|
@@ -11509,6 +11424,13 @@ class ConnectionManager extends base_1$d.Base {
|
|
|
11509
11424
|
_ConnectionManager_messageReceiver.set(this, void 0);
|
|
11510
11425
|
_ConnectionManager_rtcConnectionManager.set(this, void 0);
|
|
11511
11426
|
this.removeChannelFromProviderMap = (channelId) => {
|
|
11427
|
+
const providerEntry = this.providerMap.get(channelId);
|
|
11428
|
+
if (providerEntry) {
|
|
11429
|
+
const { channelName } = providerEntry.providerIdentity;
|
|
11430
|
+
if (this.providerChannelIdByName.get(channelName) === channelId) {
|
|
11431
|
+
this.providerChannelIdByName.delete(channelName);
|
|
11432
|
+
}
|
|
11433
|
+
}
|
|
11512
11434
|
this.providerMap.delete(channelId);
|
|
11513
11435
|
};
|
|
11514
11436
|
this.onmessage = (msg) => {
|
|
@@ -11519,6 +11441,7 @@ class ConnectionManager extends base_1$d.Base {
|
|
|
11519
11441
|
return false;
|
|
11520
11442
|
};
|
|
11521
11443
|
this.providerMap = new Map();
|
|
11444
|
+
this.providerChannelIdByName = new Map();
|
|
11522
11445
|
this.protocolManager = new protocol_manager_1.ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
|
|
11523
11446
|
__classPrivateFieldSet$9(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
|
|
11524
11447
|
__classPrivateFieldSet$9(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
|
|
@@ -11552,14 +11475,16 @@ class ConnectionManager extends base_1$d.Base {
|
|
|
11552
11475
|
// Should be impossible.
|
|
11553
11476
|
throw new Error('failed to combine strategies');
|
|
11554
11477
|
}
|
|
11555
|
-
const channel = new provider_1
|
|
11478
|
+
const channel = new provider_1.ChannelProvider(providerIdentity, () => provider_1.ChannelProvider.wireClose(this.wire, providerIdentity.channelName), strategy);
|
|
11556
11479
|
const key = providerIdentity.channelId;
|
|
11557
11480
|
this.providerMap.set(key, {
|
|
11481
|
+
providerIdentity,
|
|
11558
11482
|
provider: channel,
|
|
11559
11483
|
strategy,
|
|
11560
11484
|
supportedProtocols: ConnectionManager.getProtocolOptionsFromStrings(protocols)
|
|
11561
11485
|
});
|
|
11562
|
-
|
|
11486
|
+
this.providerChannelIdByName.set(providerIdentity.channelName, key);
|
|
11487
|
+
provider_1.ChannelProvider.setProviderRemoval(channel, this.removeChannelFromProviderMap.bind(this));
|
|
11563
11488
|
return channel;
|
|
11564
11489
|
}
|
|
11565
11490
|
async createClientOffer(options) {
|
|
@@ -11633,6 +11558,16 @@ class ConnectionManager extends base_1$d.Base {
|
|
|
11633
11558
|
strategy.addEndpoint(routingInfo.channelId, endpointPayload);
|
|
11634
11559
|
return strategy;
|
|
11635
11560
|
}
|
|
11561
|
+
handleClientDisconnection(eventPayload) {
|
|
11562
|
+
const channelId = eventPayload.channelId ?? this.providerChannelIdByName.get(eventPayload.channelName ?? '');
|
|
11563
|
+
if (!channelId) {
|
|
11564
|
+
return;
|
|
11565
|
+
}
|
|
11566
|
+
const providerEntry = this.providerMap.get(channelId);
|
|
11567
|
+
if (providerEntry) {
|
|
11568
|
+
provider_1.ChannelProvider.handleClientDisconnection(providerEntry.provider, eventPayload);
|
|
11569
|
+
}
|
|
11570
|
+
}
|
|
11636
11571
|
async processChannelConnection(msg) {
|
|
11637
11572
|
const { clientIdentity, providerIdentity, ackToSender, payload, offer: clientOffer } = msg.payload;
|
|
11638
11573
|
if (!clientIdentity.endpointId) {
|
|
@@ -11652,7 +11587,7 @@ class ConnectionManager extends base_1$d.Base {
|
|
|
11652
11587
|
}
|
|
11653
11588
|
const { provider, strategy, supportedProtocols } = bus;
|
|
11654
11589
|
try {
|
|
11655
|
-
if (!(provider instanceof provider_1
|
|
11590
|
+
if (!(provider instanceof provider_1.ChannelProvider)) {
|
|
11656
11591
|
throw Error('Cannot connect to a channel client');
|
|
11657
11592
|
}
|
|
11658
11593
|
const offer = clientOffer ?? {
|
|
@@ -11733,7 +11668,7 @@ var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
11733
11668
|
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");
|
|
11734
11669
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11735
11670
|
};
|
|
11736
|
-
var _Channel_connectionManager, _Channel_internalEmitter, _Channel_readyToConnect;
|
|
11671
|
+
var _Channel_connectionManager, _Channel_internalEmitter, _Channel_readyForProvider, _Channel_readyToConnect;
|
|
11737
11672
|
Object.defineProperty(channel$1, "__esModule", { value: true });
|
|
11738
11673
|
channel$1.Channel = void 0;
|
|
11739
11674
|
/* eslint-disable no-console */
|
|
@@ -11742,7 +11677,6 @@ const lazy_1$1 = lazy;
|
|
|
11742
11677
|
const base_1$c = base;
|
|
11743
11678
|
const client_1 = client;
|
|
11744
11679
|
const connection_manager_1 = connectionManager;
|
|
11745
|
-
const provider_1 = provider;
|
|
11746
11680
|
function retryDelay(count) {
|
|
11747
11681
|
const interval = 500; // base delay
|
|
11748
11682
|
const steps = 10; // How many retries to do before incrementing the delay
|
|
@@ -11778,9 +11712,19 @@ class Channel extends base_1$c.EmitterBase {
|
|
|
11778
11712
|
super(wire, 'channel');
|
|
11779
11713
|
_Channel_connectionManager.set(this, void 0);
|
|
11780
11714
|
_Channel_internalEmitter.set(this, new events_1$2.EventEmitter());
|
|
11715
|
+
// Provider-side disconnect routing setup. This must exist before first create()
|
|
11716
|
+
// so provider onDisconnection callbacks are wired even if connect() is never called.
|
|
11717
|
+
_Channel_readyForProvider.set(this, new lazy_1$1.AsyncRetryableLazy(async () => {
|
|
11718
|
+
// TODO: fix typing (internal)
|
|
11719
|
+
// @ts-expect-error
|
|
11720
|
+
await this.on('client-disconnected', (eventPayload) => {
|
|
11721
|
+
__classPrivateFieldGet$9(this, _Channel_connectionManager, "f").handleClientDisconnection(eventPayload);
|
|
11722
|
+
});
|
|
11723
|
+
}));
|
|
11781
11724
|
// OpenFin API has not been injected at construction time, *must* wait for API to be ready.
|
|
11782
11725
|
_Channel_readyToConnect.set(this, new lazy_1$1.AsyncRetryableLazy(async () => {
|
|
11783
11726
|
await Promise.all([
|
|
11727
|
+
__classPrivateFieldGet$9(this, _Channel_readyForProvider, "f").getValue(),
|
|
11784
11728
|
this.on('disconnected', (eventPayload) => {
|
|
11785
11729
|
client_1.ChannelClient.handleProviderDisconnect(eventPayload);
|
|
11786
11730
|
}),
|
|
@@ -12037,23 +11981,16 @@ class Channel extends base_1$c.EmitterBase {
|
|
|
12037
11981
|
* ```
|
|
12038
11982
|
*/
|
|
12039
11983
|
async create(channelName, options) {
|
|
11984
|
+
await __classPrivateFieldGet$9(this, _Channel_readyForProvider, "f").getValue();
|
|
12040
11985
|
if (!channelName) {
|
|
12041
11986
|
throw new Error('Please provide a channelName to create a channel');
|
|
12042
11987
|
}
|
|
12043
11988
|
const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
|
|
12044
|
-
|
|
12045
|
-
// TODO: fix typing (internal)
|
|
12046
|
-
// @ts-expect-error
|
|
12047
|
-
this.on('client-disconnected', (eventPayload) => {
|
|
12048
|
-
if (eventPayload.channelName === channelName) {
|
|
12049
|
-
provider_1.ChannelProvider.handleClientDisconnection(channel, eventPayload);
|
|
12050
|
-
}
|
|
12051
|
-
});
|
|
12052
|
-
return channel;
|
|
11989
|
+
return __classPrivateFieldGet$9(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
|
|
12053
11990
|
}
|
|
12054
11991
|
}
|
|
12055
11992
|
channel$1.Channel = Channel;
|
|
12056
|
-
_Channel_connectionManager = new WeakMap(), _Channel_internalEmitter = new WeakMap(), _Channel_readyToConnect = new WeakMap();
|
|
11993
|
+
_Channel_connectionManager = new WeakMap(), _Channel_internalEmitter = new WeakMap(), _Channel_readyForProvider = new WeakMap(), _Channel_readyToConnect = new WeakMap();
|
|
12057
11994
|
|
|
12058
11995
|
Object.defineProperty(interappbus, "__esModule", { value: true });
|
|
12059
11996
|
interappbus.InterAppPayload = interappbus.InterApplicationBus = void 0;
|
|
@@ -12079,6 +12016,16 @@ class InterApplicationBus extends base_1$b.Base {
|
|
|
12079
12016
|
*/
|
|
12080
12017
|
constructor(wire) {
|
|
12081
12018
|
super(wire);
|
|
12019
|
+
/**
|
|
12020
|
+
* Event types for the InterApplicationBus.
|
|
12021
|
+
*
|
|
12022
|
+
* @remarks The `subscriber-added` and `subscriber-removed` events are disabled by default.
|
|
12023
|
+
* To re-enable them, launch the runtime with the `--emit-legacy-iab-events` flag.
|
|
12024
|
+
* These events will be removed in a future version. Use {@link Channel} for connection
|
|
12025
|
+
* lifecycle management instead.
|
|
12026
|
+
*
|
|
12027
|
+
* @deprecated Use {@link Channel} `onConnection` / `onDisconnection` instead.
|
|
12028
|
+
*/
|
|
12082
12029
|
this.events = {
|
|
12083
12030
|
subscriberAdded: 'subscriber-added',
|
|
12084
12031
|
subscriberRemoved: 'subscriber-removed'
|
|
@@ -14688,9 +14635,7 @@ class LayoutModule extends base_1$6.Base {
|
|
|
14688
14635
|
* ```
|
|
14689
14636
|
*/
|
|
14690
14637
|
this.init = async (options = {}) => {
|
|
14691
|
-
this.wire.
|
|
14692
|
-
// don't expose
|
|
14693
|
-
});
|
|
14638
|
+
this.wire.recordAnalytic('layout-init');
|
|
14694
14639
|
if (!this.wire.environment.layoutAllowedInContext(this.fin)) {
|
|
14695
14640
|
throw new Error('Layout.init can only be called from a Window context.');
|
|
14696
14641
|
}
|
|
@@ -14768,9 +14713,7 @@ class LayoutModule extends base_1$6.Base {
|
|
|
14768
14713
|
* ```
|
|
14769
14714
|
*/
|
|
14770
14715
|
async wrap(identity) {
|
|
14771
|
-
this.wire.
|
|
14772
|
-
// don't expose
|
|
14773
|
-
});
|
|
14716
|
+
this.wire.recordAnalytic('layout-wrap');
|
|
14774
14717
|
return new Instance_1$2.Layout(identity, this.wire);
|
|
14775
14718
|
}
|
|
14776
14719
|
/**
|
|
@@ -14793,9 +14736,7 @@ class LayoutModule extends base_1$6.Base {
|
|
|
14793
14736
|
* ```
|
|
14794
14737
|
*/
|
|
14795
14738
|
wrapSync(identity) {
|
|
14796
|
-
this.wire.
|
|
14797
|
-
// don't expose
|
|
14798
|
-
});
|
|
14739
|
+
this.wire.recordAnalytic('layout-wrap-sync');
|
|
14799
14740
|
return new Instance_1$2.Layout(identity, this.wire);
|
|
14800
14741
|
}
|
|
14801
14742
|
/**
|
|
@@ -14809,9 +14750,7 @@ class LayoutModule extends base_1$6.Base {
|
|
|
14809
14750
|
* ```
|
|
14810
14751
|
*/
|
|
14811
14752
|
async getCurrent() {
|
|
14812
|
-
this.wire.
|
|
14813
|
-
// don't expose
|
|
14814
|
-
});
|
|
14753
|
+
this.wire.recordAnalytic('layout-get-current');
|
|
14815
14754
|
if (this.wire.environment.type === 'openfin' && !this.fin.me.isWindow) {
|
|
14816
14755
|
throw new Error('You are not in a Window context. Only Windows can have a Layout.');
|
|
14817
14756
|
}
|
|
@@ -14832,9 +14771,7 @@ class LayoutModule extends base_1$6.Base {
|
|
|
14832
14771
|
* ```
|
|
14833
14772
|
*/
|
|
14834
14773
|
getCurrentSync() {
|
|
14835
|
-
this.wire.
|
|
14836
|
-
// don't expose
|
|
14837
|
-
});
|
|
14774
|
+
this.wire.recordAnalytic('layout-get-current-sync');
|
|
14838
14775
|
if (this.wire.environment.type === 'openfin' && !this.fin.me.isWindow) {
|
|
14839
14776
|
throw new Error('You are not in a Window context. Only Windows can have a Layout.');
|
|
14840
14777
|
}
|
|
@@ -14852,9 +14789,7 @@ class LayoutModule extends base_1$6.Base {
|
|
|
14852
14789
|
* ```
|
|
14853
14790
|
*/
|
|
14854
14791
|
async getLayoutByViewIdentity(viewIdentity) {
|
|
14855
|
-
this.wire.
|
|
14856
|
-
// don't expose
|
|
14857
|
-
});
|
|
14792
|
+
this.wire.recordAnalytic('layout-get-by-view-identity');
|
|
14858
14793
|
const winIdentity = await this.wire.environment.getViewWindowIdentity(this.fin, viewIdentity);
|
|
14859
14794
|
let layoutWindowIdentity = winIdentity;
|
|
14860
14795
|
// TODO: CORE-1857 - when we tearout active layout or drag a view out of a window, the above identity includes the whole window info.
|
|
@@ -15016,9 +14951,7 @@ class PlatformModule extends base_1$5.Base {
|
|
|
15016
14951
|
* ```
|
|
15017
14952
|
*/
|
|
15018
14953
|
async wrap(identity) {
|
|
15019
|
-
this.wire.
|
|
15020
|
-
// don't expose
|
|
15021
|
-
});
|
|
14954
|
+
this.wire.recordAnalytic('platform-wrap');
|
|
15022
14955
|
return new Instance_1$1.Platform(this.wire, { uuid: identity.uuid });
|
|
15023
14956
|
}
|
|
15024
14957
|
/**
|
|
@@ -15033,9 +14966,7 @@ class PlatformModule extends base_1$5.Base {
|
|
|
15033
14966
|
* ```
|
|
15034
14967
|
*/
|
|
15035
14968
|
wrapSync(identity) {
|
|
15036
|
-
this.wire.
|
|
15037
|
-
// don't expose
|
|
15038
|
-
});
|
|
14969
|
+
this.wire.recordAnalytic('platform-wrap-sync');
|
|
15039
14970
|
return new Instance_1$1.Platform(this.wire, { uuid: identity.uuid });
|
|
15040
14971
|
}
|
|
15041
14972
|
/**
|
|
@@ -15049,9 +14980,7 @@ class PlatformModule extends base_1$5.Base {
|
|
|
15049
14980
|
* ```
|
|
15050
14981
|
*/
|
|
15051
14982
|
async getCurrent() {
|
|
15052
|
-
this.wire.
|
|
15053
|
-
// don't expose
|
|
15054
|
-
});
|
|
14983
|
+
this.wire.recordAnalytic('platform-get-current');
|
|
15055
14984
|
return this.wrap({ uuid: this.wire.me.uuid });
|
|
15056
14985
|
}
|
|
15057
14986
|
/**
|
|
@@ -15065,9 +14994,7 @@ class PlatformModule extends base_1$5.Base {
|
|
|
15065
14994
|
* ```
|
|
15066
14995
|
*/
|
|
15067
14996
|
getCurrentSync() {
|
|
15068
|
-
this.wire.
|
|
15069
|
-
// don't expose
|
|
15070
|
-
});
|
|
14997
|
+
this.wire.recordAnalytic('platform-get-current-sync');
|
|
15071
14998
|
return this.wrapSync({ uuid: this.wire.me.uuid });
|
|
15072
14999
|
}
|
|
15073
15000
|
/**
|
|
@@ -15095,9 +15022,7 @@ class PlatformModule extends base_1$5.Base {
|
|
|
15095
15022
|
* ```
|
|
15096
15023
|
*/
|
|
15097
15024
|
start(platformOptions) {
|
|
15098
|
-
this.wire.
|
|
15099
|
-
// don't expose
|
|
15100
|
-
});
|
|
15025
|
+
this.wire.recordAnalytic('platform-start');
|
|
15101
15026
|
// eslint-disable-next-line no-async-promise-executor
|
|
15102
15027
|
return new Promise(async (resolve, reject) => {
|
|
15103
15028
|
try {
|
|
@@ -15139,9 +15064,7 @@ class PlatformModule extends base_1$5.Base {
|
|
|
15139
15064
|
* ```
|
|
15140
15065
|
*/
|
|
15141
15066
|
startFromManifest(manifestUrl, opts) {
|
|
15142
|
-
this.wire.
|
|
15143
|
-
// don't expose
|
|
15144
|
-
});
|
|
15067
|
+
this.wire.recordAnalytic('platform-start-from-manifest');
|
|
15145
15068
|
// eslint-disable-next-line no-async-promise-executor
|
|
15146
15069
|
return new Promise(async (resolve, reject) => {
|
|
15147
15070
|
try {
|
|
@@ -16269,7 +16192,6 @@ fdc3Channels2_0.createV2Channel = createV2Channel;
|
|
|
16269
16192
|
// Generate an ID to make a session context group with. We will pass that ID to the Broker.
|
|
16270
16193
|
// The broker will then setContext on that session context group later with our Intent Result,
|
|
16271
16194
|
const guid = (0, utils_1.generateId)(); // TODO make this undefined in web
|
|
16272
|
-
let isPromiseSettled = false;
|
|
16273
16195
|
// Adding the intentResolutionResultId to the intentObj. Because fireIntent only accepts a single arg, we have to slap it in here.
|
|
16274
16196
|
const metadata = app ? { target: app, intentResolutionResultId: guid } : { intentResolutionResultId: guid };
|
|
16275
16197
|
const intentObj = intent ? { name: intent, context, metadata } : { ...context, metadata };
|
|
@@ -16285,21 +16207,11 @@ fdc3Channels2_0.createV2Channel = createV2Channel;
|
|
|
16285
16207
|
reject(new Error('getResult is not supported in this environment'));
|
|
16286
16208
|
});
|
|
16287
16209
|
});
|
|
16288
|
-
getResultPromise
|
|
16289
|
-
.then(() => {
|
|
16290
|
-
isPromiseSettled = true;
|
|
16291
|
-
})
|
|
16292
|
-
.catch(() => {
|
|
16293
|
-
isPromiseSettled = true;
|
|
16294
|
-
});
|
|
16295
16210
|
// Set up the getResult call.
|
|
16296
16211
|
const getResult = async () => {
|
|
16297
|
-
// All this mumbo jumbo is needed to make sure that getResult resolves correctly and conforms to the FDC3 spec.
|
|
16298
|
-
if (!isPromiseSettled) {
|
|
16299
|
-
return undefined;
|
|
16300
|
-
}
|
|
16301
16212
|
let intentResult = await getResultPromise;
|
|
16302
|
-
|
|
16213
|
+
// void / no payload, or web path where subscribe resolves undefined (see getResultPromise above)
|
|
16214
|
+
if (intentResult == null) {
|
|
16303
16215
|
return undefined;
|
|
16304
16216
|
}
|
|
16305
16217
|
if (typeof intentResult !== 'object') {
|
|
@@ -16390,9 +16302,7 @@ class FDC3ModuleBase {
|
|
|
16390
16302
|
* @static
|
|
16391
16303
|
*/
|
|
16392
16304
|
async broadcast(context) {
|
|
16393
|
-
this.wire.
|
|
16394
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16395
|
-
});
|
|
16305
|
+
this.wire.recordAnalytic('fdc3-broadcast');
|
|
16396
16306
|
return this.client.setContext(context);
|
|
16397
16307
|
}
|
|
16398
16308
|
/**
|
|
@@ -16403,9 +16313,7 @@ class FDC3ModuleBase {
|
|
|
16403
16313
|
* @tutorial fdc3.open
|
|
16404
16314
|
*/
|
|
16405
16315
|
async _open(app, context) {
|
|
16406
|
-
this.wire.
|
|
16407
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16408
|
-
});
|
|
16316
|
+
this.wire.recordAnalytic('fdc3-open');
|
|
16409
16317
|
try {
|
|
16410
16318
|
return await InteropClient_1$2.InteropClient.ferryFdc3Call(this.client, 'fdc3Open', { app, context });
|
|
16411
16319
|
}
|
|
@@ -16429,9 +16337,7 @@ class FDC3ModuleBase {
|
|
|
16429
16337
|
* @tutorial fdc3.getOrCreateChannel
|
|
16430
16338
|
*/
|
|
16431
16339
|
async getOrCreateChannel(channelId, fdc3Factory) {
|
|
16432
|
-
this.wire.
|
|
16433
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16434
|
-
});
|
|
16340
|
+
this.wire.recordAnalytic('fdc3-get-or-create-channel');
|
|
16435
16341
|
const hasChannelIdBeenUsed = await InteropClient_1$2.InteropClient.ferryFdc3Call(this.client, 'isIdUsedByPrivateChannel', {
|
|
16436
16342
|
channelId
|
|
16437
16343
|
});
|
|
@@ -16459,9 +16365,7 @@ class FDC3ModuleBase {
|
|
|
16459
16365
|
* @static
|
|
16460
16366
|
*/
|
|
16461
16367
|
async getSystemChannels() {
|
|
16462
|
-
this.wire.
|
|
16463
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16464
|
-
});
|
|
16368
|
+
this.wire.recordAnalytic('fdc3-get-system-channels');
|
|
16465
16369
|
return this._getChannels();
|
|
16466
16370
|
}
|
|
16467
16371
|
/**
|
|
@@ -16476,9 +16380,7 @@ class FDC3ModuleBase {
|
|
|
16476
16380
|
* @static
|
|
16477
16381
|
*/
|
|
16478
16382
|
async joinChannel(channelId) {
|
|
16479
|
-
this.wire.
|
|
16480
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16481
|
-
});
|
|
16383
|
+
this.wire.recordAnalytic('fdc3-join-channel');
|
|
16482
16384
|
try {
|
|
16483
16385
|
return await this.client.joinContextGroup(channelId);
|
|
16484
16386
|
}
|
|
@@ -16501,9 +16403,7 @@ class FDC3ModuleBase {
|
|
|
16501
16403
|
* @tutorial fdc3.getCurrentChannel
|
|
16502
16404
|
*/
|
|
16503
16405
|
async getCurrentChannel() {
|
|
16504
|
-
this.wire.
|
|
16505
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16506
|
-
});
|
|
16406
|
+
this.wire.recordAnalytic('fdc3-get-current-channel');
|
|
16507
16407
|
const currentContextGroupInfo = await this.getCurrentContextGroupInfo();
|
|
16508
16408
|
if (!currentContextGroupInfo) {
|
|
16509
16409
|
return null;
|
|
@@ -16518,9 +16418,7 @@ class FDC3ModuleBase {
|
|
|
16518
16418
|
* @static
|
|
16519
16419
|
*/
|
|
16520
16420
|
async leaveCurrentChannel() {
|
|
16521
|
-
this.wire.
|
|
16522
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16523
|
-
});
|
|
16421
|
+
this.wire.recordAnalytic('fdc3-leave-current-channel');
|
|
16524
16422
|
return this.client.removeFromContextGroup();
|
|
16525
16423
|
}
|
|
16526
16424
|
// utils
|
|
@@ -16646,9 +16544,7 @@ class Fdc3Module extends fdc3_common_1$1.FDC3ModuleBase {
|
|
|
16646
16544
|
*/
|
|
16647
16545
|
// @ts-expect-error TODO [CORE-1524]
|
|
16648
16546
|
addContextListener(contextType, handler) {
|
|
16649
|
-
this.wire.
|
|
16650
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16651
|
-
});
|
|
16547
|
+
this.wire.recordAnalytic('fdc3-add-context-listener');
|
|
16652
16548
|
let listener;
|
|
16653
16549
|
if (typeof contextType === 'function') {
|
|
16654
16550
|
console.warn('addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)');
|
|
@@ -16671,9 +16567,7 @@ class Fdc3Module extends fdc3_common_1$1.FDC3ModuleBase {
|
|
|
16671
16567
|
* @static
|
|
16672
16568
|
*/
|
|
16673
16569
|
addIntentListener(intent, handler) {
|
|
16674
|
-
this.wire.
|
|
16675
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16676
|
-
});
|
|
16570
|
+
this.wire.recordAnalytic('fdc3-add-intent-listener');
|
|
16677
16571
|
const contextHandler = (raisedIntent) => {
|
|
16678
16572
|
const { context, metadata: intentMetadata } = raisedIntent;
|
|
16679
16573
|
const { metadata } = context;
|
|
@@ -16701,9 +16595,7 @@ class Fdc3Module extends fdc3_common_1$1.FDC3ModuleBase {
|
|
|
16701
16595
|
* @static
|
|
16702
16596
|
*/
|
|
16703
16597
|
async raiseIntent(intent, context, app) {
|
|
16704
|
-
this.wire.
|
|
16705
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16706
|
-
});
|
|
16598
|
+
this.wire.recordAnalytic('fdc3-raise-intent');
|
|
16707
16599
|
const intentObj = app
|
|
16708
16600
|
? { name: intent, context, metadata: { target: app } }
|
|
16709
16601
|
: { name: intent, context };
|
|
@@ -16723,9 +16615,7 @@ class Fdc3Module extends fdc3_common_1$1.FDC3ModuleBase {
|
|
|
16723
16615
|
* @tutorial fdc3.findIntent
|
|
16724
16616
|
*/
|
|
16725
16617
|
async findIntent(intent, context) {
|
|
16726
|
-
this.wire.
|
|
16727
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16728
|
-
});
|
|
16618
|
+
this.wire.recordAnalytic('fdc3-find-intent');
|
|
16729
16619
|
try {
|
|
16730
16620
|
return await this.client.getInfoForIntent({ name: intent, context });
|
|
16731
16621
|
}
|
|
@@ -16741,9 +16631,7 @@ class Fdc3Module extends fdc3_common_1$1.FDC3ModuleBase {
|
|
|
16741
16631
|
* @tutorial fdc3.findIntentsByContext
|
|
16742
16632
|
*/
|
|
16743
16633
|
async findIntentsByContext(context) {
|
|
16744
|
-
this.wire.
|
|
16745
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16746
|
-
});
|
|
16634
|
+
this.wire.recordAnalytic('fdc3-find-intents-by-context');
|
|
16747
16635
|
try {
|
|
16748
16636
|
return await this.client.getInfoForIntentsByContext(context);
|
|
16749
16637
|
}
|
|
@@ -16760,9 +16648,7 @@ class Fdc3Module extends fdc3_common_1$1.FDC3ModuleBase {
|
|
|
16760
16648
|
* @tutorial fdc3.raiseIntentForContext
|
|
16761
16649
|
*/
|
|
16762
16650
|
async raiseIntentForContext(context, app) {
|
|
16763
|
-
this.wire.
|
|
16764
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16765
|
-
});
|
|
16651
|
+
this.wire.recordAnalytic('fdc3-raise-intent-for-context');
|
|
16766
16652
|
try {
|
|
16767
16653
|
return await this.client.fireIntentForContext({ ...context, metadata: { target: app } });
|
|
16768
16654
|
}
|
|
@@ -16786,9 +16672,7 @@ class Fdc3Module extends fdc3_common_1$1.FDC3ModuleBase {
|
|
|
16786
16672
|
* @tutorial fdc3.getInfo
|
|
16787
16673
|
*/
|
|
16788
16674
|
getInfo() {
|
|
16789
|
-
this.wire.
|
|
16790
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16791
|
-
});
|
|
16675
|
+
this.wire.recordAnalytic('fdc3-get-info');
|
|
16792
16676
|
const version = this.wire.environment.getAdapterVersionSync();
|
|
16793
16677
|
return {
|
|
16794
16678
|
providerVersion: version,
|
|
@@ -16866,9 +16750,7 @@ class Fdc3Module2 extends fdc3_common_1.FDC3ModuleBase {
|
|
|
16866
16750
|
* @tutorial fdc3v2.findInstances
|
|
16867
16751
|
*/
|
|
16868
16752
|
async findInstances(app) {
|
|
16869
|
-
this.wire.
|
|
16870
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16871
|
-
});
|
|
16753
|
+
this.wire.recordAnalytic('fdc3-find-instances');
|
|
16872
16754
|
try {
|
|
16873
16755
|
return await InteropClient_1$1.InteropClient.ferryFdc3Call(this.client, 'fdc3FindInstances', app);
|
|
16874
16756
|
}
|
|
@@ -16884,9 +16766,7 @@ class Fdc3Module2 extends fdc3_common_1.FDC3ModuleBase {
|
|
|
16884
16766
|
* @tutorial fdc3v2.getAppMetadata
|
|
16885
16767
|
*/
|
|
16886
16768
|
async getAppMetadata(app) {
|
|
16887
|
-
this.wire.
|
|
16888
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16889
|
-
});
|
|
16769
|
+
this.wire.recordAnalytic('fdc3-get-app-metadata');
|
|
16890
16770
|
try {
|
|
16891
16771
|
return await InteropClient_1$1.InteropClient.ferryFdc3Call(this.client, 'fdc3GetAppMetadata', app);
|
|
16892
16772
|
}
|
|
@@ -16904,9 +16784,7 @@ class Fdc3Module2 extends fdc3_common_1.FDC3ModuleBase {
|
|
|
16904
16784
|
*/
|
|
16905
16785
|
// @ts-expect-error TODO [CORE-1524]
|
|
16906
16786
|
async addContextListener(contextType, handler) {
|
|
16907
|
-
this.wire.
|
|
16908
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16909
|
-
});
|
|
16787
|
+
this.wire.recordAnalytic('fdc3-add-context-listener');
|
|
16910
16788
|
// The FDC3 ContextHandler only expects the context and optional ContextMetadata, so we wrap the handler
|
|
16911
16789
|
// here so it only gets passed these parameters
|
|
16912
16790
|
const getWrappedHandler = (handlerToWrap) => {
|
|
@@ -16935,9 +16813,7 @@ class Fdc3Module2 extends fdc3_common_1.FDC3ModuleBase {
|
|
|
16935
16813
|
* @tutorial fdc3.findIntent
|
|
16936
16814
|
*/
|
|
16937
16815
|
async findIntent(intent, context, resultType) {
|
|
16938
|
-
this.wire.
|
|
16939
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16940
|
-
});
|
|
16816
|
+
this.wire.recordAnalytic('fdc3-find-intent');
|
|
16941
16817
|
try {
|
|
16942
16818
|
return await this.client.getInfoForIntent({ name: intent, context, metadata: { resultType } });
|
|
16943
16819
|
}
|
|
@@ -16954,9 +16830,7 @@ class Fdc3Module2 extends fdc3_common_1.FDC3ModuleBase {
|
|
|
16954
16830
|
* @tutorial fdc3v2.findIntentsByContext
|
|
16955
16831
|
*/
|
|
16956
16832
|
async findIntentsByContext(context, resultType) {
|
|
16957
|
-
this.wire.
|
|
16958
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16959
|
-
});
|
|
16833
|
+
this.wire.recordAnalytic('fdc3-find-intents-by-context');
|
|
16960
16834
|
const payload = resultType ? { context, metadata: { resultType } } : context;
|
|
16961
16835
|
try {
|
|
16962
16836
|
return await InteropClient_1$1.InteropClient.ferryFdc3Call(this.client, 'fdc3v2FindIntentsByContext', payload);
|
|
@@ -16975,9 +16849,7 @@ class Fdc3Module2 extends fdc3_common_1.FDC3ModuleBase {
|
|
|
16975
16849
|
* @tutorial fdc3v2.raiseIntent
|
|
16976
16850
|
*/
|
|
16977
16851
|
async raiseIntent(intent, context, app) {
|
|
16978
|
-
this.wire.
|
|
16979
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16980
|
-
});
|
|
16852
|
+
this.wire.recordAnalytic('fdc3-raise-intent');
|
|
16981
16853
|
try {
|
|
16982
16854
|
if (typeof app === 'string') {
|
|
16983
16855
|
console.warn('Passing a string as the app parameter is deprecated, please use an AppIdentifier ({ appId: string; instanceId?: string }).');
|
|
@@ -16998,9 +16870,7 @@ class Fdc3Module2 extends fdc3_common_1.FDC3ModuleBase {
|
|
|
16998
16870
|
*/
|
|
16999
16871
|
async raiseIntentForContext(context, app) {
|
|
17000
16872
|
// TODO: We have to do the same thing we do for raiseIntent here as well.
|
|
17001
|
-
this.wire.
|
|
17002
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
17003
|
-
});
|
|
16873
|
+
this.wire.recordAnalytic('fdc3-raise-intent-for-context');
|
|
17004
16874
|
try {
|
|
17005
16875
|
if (typeof app === 'string') {
|
|
17006
16876
|
console.warn('Passing a string as the app parameter is deprecated, please use an AppIdentifier ({ appId: string; instanceId?: string }).');
|
|
@@ -17020,9 +16890,7 @@ class Fdc3Module2 extends fdc3_common_1.FDC3ModuleBase {
|
|
|
17020
16890
|
* @tutorial fdc3.addIntentListener
|
|
17021
16891
|
*/
|
|
17022
16892
|
async addIntentListener(intent, handler) {
|
|
17023
|
-
this.wire.
|
|
17024
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
17025
|
-
});
|
|
16893
|
+
this.wire.recordAnalytic('fdc3-add-intent-listener');
|
|
17026
16894
|
if (typeof intent !== 'string') {
|
|
17027
16895
|
throw new Error('First argument must be an Intent name');
|
|
17028
16896
|
}
|
|
@@ -17199,9 +17067,7 @@ class InteropModule extends base_1$2.Base {
|
|
|
17199
17067
|
* ```
|
|
17200
17068
|
*/
|
|
17201
17069
|
async init(name, override = defaultOverride) {
|
|
17202
|
-
this.wire.
|
|
17203
|
-
// don't expose, analytics-only call
|
|
17204
|
-
});
|
|
17070
|
+
this.wire.recordAnalytic('interop-init');
|
|
17205
17071
|
// Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
|
|
17206
17072
|
const options = await this.wire.environment.getInteropInfo(this.wire.getFin());
|
|
17207
17073
|
const objectThatThrows = (0, inaccessibleObject_1.createUnusableObject)(BrokerParamAccessError);
|
|
@@ -17250,9 +17116,7 @@ class InteropModule extends base_1$2.Base {
|
|
|
17250
17116
|
* ```
|
|
17251
17117
|
*/
|
|
17252
17118
|
connectSync(name, interopConfig) {
|
|
17253
|
-
this.wire.
|
|
17254
|
-
// don't expose, analytics-only call
|
|
17255
|
-
});
|
|
17119
|
+
this.wire.recordAnalytic('interop-connect-sync');
|
|
17256
17120
|
return new InteropClient_1.InteropClient(this.wire, this.wire.environment.whenReady().then(() => {
|
|
17257
17121
|
return this.fin.InterApplicationBus.Channel.connect(`interop-broker-${name}`, {
|
|
17258
17122
|
payload: interopConfig
|
|
@@ -17421,9 +17285,7 @@ class SnapshotSource extends base_1$1.Base {
|
|
|
17421
17285
|
* ```
|
|
17422
17286
|
*/
|
|
17423
17287
|
async ready() {
|
|
17424
|
-
this.wire.
|
|
17425
|
-
// don't expose, analytics-only call
|
|
17426
|
-
});
|
|
17288
|
+
this.wire.recordAnalytic('snapshot-source-ready');
|
|
17427
17289
|
// eslint-disable-next-line no-async-promise-executor
|
|
17428
17290
|
try {
|
|
17429
17291
|
// 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?
|
|
@@ -17439,9 +17301,7 @@ class SnapshotSource extends base_1$1.Base {
|
|
|
17439
17301
|
*
|
|
17440
17302
|
*/
|
|
17441
17303
|
async getSnapshot() {
|
|
17442
|
-
this.wire.
|
|
17443
|
-
// don't expose, analytics-only call
|
|
17444
|
-
});
|
|
17304
|
+
this.wire.recordAnalytic('snapshot-source-get-snapshot');
|
|
17445
17305
|
const client = await __classPrivateFieldGet(this, _SnapshotSource_getClient, "f").call(this);
|
|
17446
17306
|
const response = (await client.dispatch('get-snapshot'));
|
|
17447
17307
|
return (await response).snapshot;
|
|
@@ -17451,9 +17311,7 @@ class SnapshotSource extends base_1$1.Base {
|
|
|
17451
17311
|
*
|
|
17452
17312
|
*/
|
|
17453
17313
|
async applySnapshot(snapshot) {
|
|
17454
|
-
this.wire.
|
|
17455
|
-
// don't expose, analytics-only call
|
|
17456
|
-
});
|
|
17314
|
+
this.wire.recordAnalytic('snapshot-source-apply-snapshot');
|
|
17457
17315
|
const client = await __classPrivateFieldGet(this, _SnapshotSource_getClient, "f").call(this);
|
|
17458
17316
|
return client.dispatch('apply-snapshot', { snapshot });
|
|
17459
17317
|
}
|
|
@@ -17494,9 +17352,7 @@ class SnapshotSourceModule extends base_1.Base {
|
|
|
17494
17352
|
*
|
|
17495
17353
|
*/
|
|
17496
17354
|
async init(provider) {
|
|
17497
|
-
this.wire.
|
|
17498
|
-
// don't expose, analytics-only call
|
|
17499
|
-
});
|
|
17355
|
+
this.wire.recordAnalytic('snapshot-source-init');
|
|
17500
17356
|
if (typeof provider !== 'object' ||
|
|
17501
17357
|
typeof provider.getSnapshot !== 'function' ||
|
|
17502
17358
|
typeof provider.applySnapshot !== 'function') {
|
|
@@ -17520,9 +17376,7 @@ class SnapshotSourceModule extends base_1.Base {
|
|
|
17520
17376
|
* ```
|
|
17521
17377
|
*/
|
|
17522
17378
|
wrapSync(identity) {
|
|
17523
|
-
this.wire.
|
|
17524
|
-
// don't expose, analytics-only call
|
|
17525
|
-
});
|
|
17379
|
+
this.wire.recordAnalytic('snapshot-source-wrap-sync');
|
|
17526
17380
|
return new Instance_1.SnapshotSource(this.wire, identity);
|
|
17527
17381
|
}
|
|
17528
17382
|
/**
|
|
@@ -17536,9 +17390,7 @@ class SnapshotSourceModule extends base_1.Base {
|
|
|
17536
17390
|
* ```
|
|
17537
17391
|
*/
|
|
17538
17392
|
async wrap(identity) {
|
|
17539
|
-
this.wire.
|
|
17540
|
-
// don't expose, analytics-only call
|
|
17541
|
-
});
|
|
17393
|
+
this.wire.recordAnalytic('snapshot-source-wrap');
|
|
17542
17394
|
return this.wrapSync(identity);
|
|
17543
17395
|
}
|
|
17544
17396
|
}
|
package/package.json
CHANGED
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
"name": "@openfin/remote-adapter",
|
|
3
|
+
"version": "41.103.10",
|
|
4
|
+
"description": "Establish intermachine runtime connections using webRTC.",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
|
+
"private": false,
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"./out/*"
|
|
12
|
+
],
|
|
13
|
+
"main": "./out/remote-adapter.js",
|
|
14
|
+
"types": "./out/remote-adapter.d.ts",
|
|
15
|
+
"author": "OpenFin",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"lodash": "^4.17.21",
|
|
18
|
+
"tslib": "2.8.1",
|
|
19
|
+
"@openfin/core": "41.103.10"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"prebuild": "rimraf ./out",
|
|
23
|
+
"build": "rollup -c --bundleConfigAsCjs",
|
|
24
|
+
"ci:prepack": "of-npm prepack",
|
|
25
|
+
"ci:pack": "pnpm pack",
|
|
26
|
+
"ci:postpack": "of-npm postpack",
|
|
27
|
+
"version:update": "of-npm version --allow-same-version '$RMAJOR.$RMINOR.$RPATCH'",
|
|
28
|
+
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
29
|
+
}
|
|
25
30
|
}
|