@openfin/node-adapter 42.100.91 → 42.100.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/node-adapter.js +1544 -1424
- package/package.json +2 -2
package/out/node-adapter.js
CHANGED
|
@@ -73,13 +73,13 @@ async function promiseMapSerial(arr, func) {
|
|
|
73
73
|
}
|
|
74
74
|
promises.promiseMapSerial = promiseMapSerial;
|
|
75
75
|
|
|
76
|
-
var __classPrivateFieldSet$
|
|
76
|
+
var __classPrivateFieldSet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
77
77
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
78
78
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
79
79
|
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");
|
|
80
80
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
81
81
|
};
|
|
82
|
-
var __classPrivateFieldGet$
|
|
82
|
+
var __classPrivateFieldGet$i = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
83
83
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
84
84
|
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");
|
|
85
85
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -164,7 +164,7 @@ class EmitterBase extends Base {
|
|
|
164
164
|
this.emit = (eventType, payload, ...args) => {
|
|
165
165
|
return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
|
|
166
166
|
};
|
|
167
|
-
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$
|
|
167
|
+
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
|
|
168
168
|
/**
|
|
169
169
|
* Cleans up after removal of a listener, e.g. deleting any lingering deregistration handlers for a
|
|
170
170
|
* `once` subscription.
|
|
@@ -174,14 +174,14 @@ class EmitterBase extends Base {
|
|
|
174
174
|
* which would involve less "magic," but would be more-vulnerable to accidental re-introduction of a leak.
|
|
175
175
|
*/
|
|
176
176
|
this.cleanUpRemovedListener = (eventType, listener) => {
|
|
177
|
-
const deregister = __classPrivateFieldGet$
|
|
177
|
+
const deregister = __classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").get(listener);
|
|
178
178
|
if (deregister) {
|
|
179
|
-
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$
|
|
179
|
+
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
|
|
180
180
|
emitter.removeListener(eventType, deregister);
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
183
|
this.getOrCreateEmitter = () => {
|
|
184
|
-
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$
|
|
184
|
+
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
|
|
185
185
|
if (!emitter.listeners('removeListener').includes(this.cleanUpRemovedListener)) {
|
|
186
186
|
emitter.on('removeListener', this.cleanUpRemovedListener);
|
|
187
187
|
}
|
|
@@ -223,8 +223,8 @@ class EmitterBase extends Base {
|
|
|
223
223
|
// This will only be reached if unsubscribe from event that does not exist but do not want to error here
|
|
224
224
|
return Promise.resolve();
|
|
225
225
|
};
|
|
226
|
-
__classPrivateFieldSet$
|
|
227
|
-
__classPrivateFieldSet$
|
|
226
|
+
__classPrivateFieldSet$h(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
|
|
227
|
+
__classPrivateFieldSet$h(this, _EmitterBase_deregisterOnceListeners, new WeakMap(), "f");
|
|
228
228
|
this.listeners = (event) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(event) : [];
|
|
229
229
|
}
|
|
230
230
|
/**
|
|
@@ -253,7 +253,7 @@ class EmitterBase extends Base {
|
|
|
253
253
|
*/
|
|
254
254
|
async once(eventType, listener, options) {
|
|
255
255
|
const deregister = () => this.deregisterEventListener(eventType);
|
|
256
|
-
__classPrivateFieldGet$
|
|
256
|
+
__classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
|
|
257
257
|
await this.registerEventListener(eventType, options, (emitter) => {
|
|
258
258
|
emitter.once(eventType, deregister);
|
|
259
259
|
emitter.once(eventType, listener);
|
|
@@ -284,7 +284,7 @@ class EmitterBase extends Base {
|
|
|
284
284
|
*/
|
|
285
285
|
async prependOnceListener(eventType, listener, options) {
|
|
286
286
|
const deregister = () => this.deregisterEventListener(eventType);
|
|
287
|
-
__classPrivateFieldGet$
|
|
287
|
+
__classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
|
|
288
288
|
await this.registerEventListener(eventType, options, (emitter) => {
|
|
289
289
|
emitter.prependOnceListener(eventType, listener);
|
|
290
290
|
emitter.once(eventType, deregister);
|
|
@@ -344,7 +344,7 @@ class EmitterBase extends Base {
|
|
|
344
344
|
}
|
|
345
345
|
deleteEmitterIfNothingRegistered(emitter) {
|
|
346
346
|
if (emitter.eventNames().every((type) => type === 'removeListener')) {
|
|
347
|
-
this.wire.eventAggregator.delete(__classPrivateFieldGet$
|
|
347
|
+
this.wire.eventAggregator.delete(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
}
|
|
@@ -576,11 +576,11 @@ const handleDeprecatedWarnings = (options) => {
|
|
|
576
576
|
};
|
|
577
577
|
warnings.handleDeprecatedWarnings = handleDeprecatedWarnings;
|
|
578
578
|
|
|
579
|
-
var hasRequiredFactory$
|
|
579
|
+
var hasRequiredFactory$1;
|
|
580
580
|
|
|
581
|
-
function requireFactory$
|
|
582
|
-
if (hasRequiredFactory$
|
|
583
|
-
hasRequiredFactory$
|
|
581
|
+
function requireFactory$1 () {
|
|
582
|
+
if (hasRequiredFactory$1) return Factory$6;
|
|
583
|
+
hasRequiredFactory$1 = 1;
|
|
584
584
|
Object.defineProperty(Factory$6, "__esModule", { value: true });
|
|
585
585
|
Factory$6.ViewModule = void 0;
|
|
586
586
|
const base_1 = base;
|
|
@@ -795,8 +795,8 @@ var main = {};
|
|
|
795
795
|
|
|
796
796
|
Object.defineProperty(main, "__esModule", { value: true });
|
|
797
797
|
main.WebContents = void 0;
|
|
798
|
-
const base_1$
|
|
799
|
-
class WebContents extends base_1$
|
|
798
|
+
const base_1$p = base;
|
|
799
|
+
class WebContents extends base_1$p.EmitterBase {
|
|
800
800
|
/**
|
|
801
801
|
* @param identity The identity of the {@link OpenFin.WebContentsEvents WebContents}.
|
|
802
802
|
* @param entityType The type of the {@link OpenFin.WebContentsEvents WebContents}.
|
|
@@ -1877,11 +1877,11 @@ class WebContents extends base_1$m.EmitterBase {
|
|
|
1877
1877
|
}
|
|
1878
1878
|
main.WebContents = WebContents;
|
|
1879
1879
|
|
|
1880
|
-
var hasRequiredInstance$
|
|
1880
|
+
var hasRequiredInstance$1;
|
|
1881
1881
|
|
|
1882
|
-
function requireInstance$
|
|
1883
|
-
if (hasRequiredInstance$
|
|
1884
|
-
hasRequiredInstance$
|
|
1882
|
+
function requireInstance$1 () {
|
|
1883
|
+
if (hasRequiredInstance$1) return Instance$5;
|
|
1884
|
+
hasRequiredInstance$1 = 1;
|
|
1885
1885
|
var _View_providerChannelClient;
|
|
1886
1886
|
Object.defineProperty(Instance$5, "__esModule", { value: true });
|
|
1887
1887
|
Instance$5.View = void 0;
|
|
@@ -2461,1160 +2461,1139 @@ function requireView () {
|
|
|
2461
2461
|
*
|
|
2462
2462
|
* @packageDocumentation
|
|
2463
2463
|
*/
|
|
2464
|
-
__exportStar(requireFactory$
|
|
2465
|
-
__exportStar(requireInstance$
|
|
2464
|
+
__exportStar(requireFactory$1(), exports);
|
|
2465
|
+
__exportStar(requireInstance$1(), exports);
|
|
2466
2466
|
} (view));
|
|
2467
2467
|
return view;
|
|
2468
2468
|
}
|
|
2469
2469
|
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
_createFromManifest(manifestUrl) {
|
|
3565
|
-
return this.wire
|
|
3566
|
-
.sendAction('get-application-manifest', { manifestUrl })
|
|
3567
|
-
.then(({ payload }) => {
|
|
3568
|
-
const uuid = payload.data.platform ? payload.data.platform.uuid : payload.data.startup_app.uuid;
|
|
3569
|
-
return this.wrap({ uuid });
|
|
3570
|
-
})
|
|
3571
|
-
.then((app) => {
|
|
3572
|
-
app._manifestUrl = manifestUrl; // eslint-disable-line no-underscore-dangle
|
|
3573
|
-
return app;
|
|
3574
|
-
});
|
|
3575
|
-
}
|
|
3576
|
-
}
|
|
3577
|
-
Factory$7.ApplicationModule = ApplicationModule;
|
|
3578
|
-
return Factory$7;
|
|
2470
|
+
Object.defineProperty(Instance$6, "__esModule", { value: true });
|
|
2471
|
+
Instance$6.Application = void 0;
|
|
2472
|
+
/* eslint-disable import/prefer-default-export */
|
|
2473
|
+
const base_1$o = base;
|
|
2474
|
+
const window_1$1 = requireWindow();
|
|
2475
|
+
const view_1 = requireView();
|
|
2476
|
+
/**
|
|
2477
|
+
* An object representing an application. Allows the developer to create,
|
|
2478
|
+
* execute, show/close an application as well as listen to {@link OpenFin.ApplicationEvents application events}.
|
|
2479
|
+
*/
|
|
2480
|
+
class Application extends base_1$o.EmitterBase {
|
|
2481
|
+
/**
|
|
2482
|
+
* @internal
|
|
2483
|
+
*/
|
|
2484
|
+
constructor(wire, identity) {
|
|
2485
|
+
super(wire, 'application', identity.uuid);
|
|
2486
|
+
this.identity = identity;
|
|
2487
|
+
this.window = new window_1$1._Window(this.wire, {
|
|
2488
|
+
uuid: this.identity.uuid,
|
|
2489
|
+
name: this.identity.uuid
|
|
2490
|
+
});
|
|
2491
|
+
}
|
|
2492
|
+
windowListFromIdentityList(identityList) {
|
|
2493
|
+
const windowList = [];
|
|
2494
|
+
identityList.forEach((identity) => {
|
|
2495
|
+
windowList.push(new window_1$1._Window(this.wire, {
|
|
2496
|
+
uuid: identity.uuid,
|
|
2497
|
+
name: identity.name
|
|
2498
|
+
}));
|
|
2499
|
+
});
|
|
2500
|
+
return windowList;
|
|
2501
|
+
}
|
|
2502
|
+
/**
|
|
2503
|
+
* Determines if the application is currently running.
|
|
2504
|
+
*
|
|
2505
|
+
* @example
|
|
2506
|
+
*
|
|
2507
|
+
* ```js
|
|
2508
|
+
* async function isAppRunning() {
|
|
2509
|
+
* const app = await fin.Application.getCurrent();
|
|
2510
|
+
* return await app.isRunning();
|
|
2511
|
+
* }
|
|
2512
|
+
* isAppRunning().then(running => console.log(`Current app is running: ${running}`)).catch(err => console.log(err));
|
|
2513
|
+
* ```
|
|
2514
|
+
*/
|
|
2515
|
+
isRunning() {
|
|
2516
|
+
return this.wire.sendAction('is-application-running', this.identity).then(({ payload }) => payload.data);
|
|
2517
|
+
}
|
|
2518
|
+
/**
|
|
2519
|
+
* Closes the application and any child windows created by the application.
|
|
2520
|
+
* Cleans the application from state so it is no longer found in getAllApplications.
|
|
2521
|
+
* @param force Close will be prevented from closing when force is false and
|
|
2522
|
+
* ‘close-requested’ has been subscribed to for application’s main window.
|
|
2523
|
+
*
|
|
2524
|
+
* @example
|
|
2525
|
+
*
|
|
2526
|
+
* ```js
|
|
2527
|
+
* async function closeApp() {
|
|
2528
|
+
* const allApps1 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}, {uuid: 'app2', isRunning: true}]
|
|
2529
|
+
* const app = await fin.Application.wrap({uuid: 'app2'});
|
|
2530
|
+
* await app.quit();
|
|
2531
|
+
* const allApps2 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}]
|
|
2532
|
+
*
|
|
2533
|
+
* }
|
|
2534
|
+
* closeApp().then(() => console.log('Application quit')).catch(err => console.log(err));
|
|
2535
|
+
* ```
|
|
2536
|
+
*/
|
|
2537
|
+
async quit(force = false) {
|
|
2538
|
+
try {
|
|
2539
|
+
await this._close(force);
|
|
2540
|
+
await this.wire.sendAction('destroy-application', { force, ...this.identity });
|
|
2541
|
+
}
|
|
2542
|
+
catch (error) {
|
|
2543
|
+
const acceptableErrors = ['Remote connection has closed', 'Could not locate the requested application'];
|
|
2544
|
+
if (!acceptableErrors.some((msg) => error.message.includes(msg))) {
|
|
2545
|
+
throw error;
|
|
2546
|
+
}
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
async _close(force = false) {
|
|
2550
|
+
try {
|
|
2551
|
+
await this.wire.sendAction('close-application', { force, ...this.identity });
|
|
2552
|
+
}
|
|
2553
|
+
catch (error) {
|
|
2554
|
+
if (!error.message.includes('Remote connection has closed')) {
|
|
2555
|
+
throw error;
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
/**
|
|
2560
|
+
* @deprecated use Application.quit instead
|
|
2561
|
+
* Closes the application and any child windows created by the application.
|
|
2562
|
+
* @param force - Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for application’s main window.
|
|
2563
|
+
* @param callback - called if the method succeeds.
|
|
2564
|
+
* @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
|
|
2565
|
+
*
|
|
2566
|
+
* @example
|
|
2567
|
+
*
|
|
2568
|
+
* ```js
|
|
2569
|
+
* async function closeApp() {
|
|
2570
|
+
* const app = await fin.Application.getCurrent();
|
|
2571
|
+
* return await app.close();
|
|
2572
|
+
* }
|
|
2573
|
+
* closeApp().then(() => console.log('Application closed')).catch(err => console.log(err));
|
|
2574
|
+
* ```
|
|
2575
|
+
*/
|
|
2576
|
+
close(force = false) {
|
|
2577
|
+
console.warn('Deprecation Warning: Application.close is deprecated Please use Application.quit');
|
|
2578
|
+
this.wire.sendAction('application-close', this.identity).catch((e) => {
|
|
2579
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
2580
|
+
});
|
|
2581
|
+
return this._close(force);
|
|
2582
|
+
}
|
|
2583
|
+
/**
|
|
2584
|
+
* Retrieves an array of wrapped fin.Windows for each of the application’s child windows.
|
|
2585
|
+
*
|
|
2586
|
+
* @example
|
|
2587
|
+
*
|
|
2588
|
+
* ```js
|
|
2589
|
+
* async function getChildWindows() {
|
|
2590
|
+
* const app = await fin.Application.getCurrent();
|
|
2591
|
+
* return await app.getChildWindows();
|
|
2592
|
+
* }
|
|
2593
|
+
*
|
|
2594
|
+
* getChildWindows().then(children => console.log(children)).catch(err => console.log(err));
|
|
2595
|
+
* ```
|
|
2596
|
+
*/
|
|
2597
|
+
getChildWindows() {
|
|
2598
|
+
return this.wire.sendAction('get-child-windows', this.identity).then(({ payload }) => {
|
|
2599
|
+
const identityList = [];
|
|
2600
|
+
payload.data.forEach((winName) => {
|
|
2601
|
+
identityList.push({ uuid: this.identity.uuid, name: winName });
|
|
2602
|
+
});
|
|
2603
|
+
return this.windowListFromIdentityList(identityList);
|
|
2604
|
+
});
|
|
2605
|
+
}
|
|
2606
|
+
/**
|
|
2607
|
+
* Retrieves the JSON manifest that was used to create the application. Invokes the error callback
|
|
2608
|
+
* if the application was not created from a manifest.
|
|
2609
|
+
*
|
|
2610
|
+
* @example
|
|
2611
|
+
*
|
|
2612
|
+
* ```js
|
|
2613
|
+
* async function getManifest() {
|
|
2614
|
+
* const app = await fin.Application.getCurrent();
|
|
2615
|
+
* return await app.getManifest();
|
|
2616
|
+
* }
|
|
2617
|
+
*
|
|
2618
|
+
* getManifest().then(manifest => console.log(manifest)).catch(err => console.log(err));
|
|
2619
|
+
* ```
|
|
2620
|
+
*/
|
|
2621
|
+
getManifest() {
|
|
2622
|
+
return this.wire.sendAction('get-application-manifest', this.identity).then(({ payload }) => payload.data);
|
|
2623
|
+
}
|
|
2624
|
+
/**
|
|
2625
|
+
* Retrieves UUID of the application that launches this application. Invokes the error callback
|
|
2626
|
+
* if the application was created from a manifest.
|
|
2627
|
+
*
|
|
2628
|
+
* @example
|
|
2629
|
+
*
|
|
2630
|
+
* ```js
|
|
2631
|
+
* async function getParentUuid() {
|
|
2632
|
+
* const app = await fin.Application.start({
|
|
2633
|
+
* uuid: 'app-1',
|
|
2634
|
+
* name: 'myApp',
|
|
2635
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getParentUuid.html',
|
|
2636
|
+
* autoShow: true
|
|
2637
|
+
* });
|
|
2638
|
+
* return await app.getParentUuid();
|
|
2639
|
+
* }
|
|
2640
|
+
*
|
|
2641
|
+
* getParentUuid().then(parentUuid => console.log(parentUuid)).catch(err => console.log(err));
|
|
2642
|
+
* ```
|
|
2643
|
+
*/
|
|
2644
|
+
getParentUuid() {
|
|
2645
|
+
return this.wire.sendAction('get-parent-application', this.identity).then(({ payload }) => payload.data);
|
|
2646
|
+
}
|
|
2647
|
+
/**
|
|
2648
|
+
* Retrieves current application's shortcut configuration.
|
|
2649
|
+
*
|
|
2650
|
+
* @example
|
|
2651
|
+
*
|
|
2652
|
+
* ```js
|
|
2653
|
+
* async function getShortcuts() {
|
|
2654
|
+
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
2655
|
+
* return await app.getShortcuts();
|
|
2656
|
+
* }
|
|
2657
|
+
* getShortcuts().then(config => console.log(config)).catch(err => console.log(err));
|
|
2658
|
+
* ```
|
|
2659
|
+
*/
|
|
2660
|
+
getShortcuts() {
|
|
2661
|
+
return this.wire.sendAction('get-shortcuts', this.identity).then(({ payload }) => payload.data);
|
|
2662
|
+
}
|
|
2663
|
+
/**
|
|
2664
|
+
* Retrieves current application's views.
|
|
2665
|
+
* @experimental
|
|
2666
|
+
*
|
|
2667
|
+
* @example
|
|
2668
|
+
*
|
|
2669
|
+
* ```js
|
|
2670
|
+
* async function getViews() {
|
|
2671
|
+
* const app = await fin.Application.getCurrent();
|
|
2672
|
+
* return await app.getViews();
|
|
2673
|
+
* }
|
|
2674
|
+
* getViews().then(views => console.log(views)).catch(err => console.log(err));
|
|
2675
|
+
* ```
|
|
2676
|
+
*/
|
|
2677
|
+
async getViews() {
|
|
2678
|
+
const { payload } = await this.wire.sendAction('application-get-views', this.identity);
|
|
2679
|
+
return payload.data.map((id) => new view_1.View(this.wire, id));
|
|
2680
|
+
}
|
|
2681
|
+
/**
|
|
2682
|
+
* Returns the current zoom level of the application.
|
|
2683
|
+
*
|
|
2684
|
+
* @example
|
|
2685
|
+
*
|
|
2686
|
+
* ```js
|
|
2687
|
+
* async function getZoomLevel() {
|
|
2688
|
+
* const app = await fin.Application.getCurrent();
|
|
2689
|
+
* return await app.getZoomLevel();
|
|
2690
|
+
* }
|
|
2691
|
+
*
|
|
2692
|
+
* getZoomLevel().then(zoomLevel => console.log(zoomLevel)).catch(err => console.log(err));
|
|
2693
|
+
* ```
|
|
2694
|
+
*/
|
|
2695
|
+
getZoomLevel() {
|
|
2696
|
+
return this.wire.sendAction('get-application-zoom-level', this.identity).then(({ payload }) => payload.data);
|
|
2697
|
+
}
|
|
2698
|
+
/**
|
|
2699
|
+
* Returns an instance of the main Window of the application
|
|
2700
|
+
*
|
|
2701
|
+
* @example
|
|
2702
|
+
*
|
|
2703
|
+
* ```js
|
|
2704
|
+
* async function getWindow() {
|
|
2705
|
+
* const app = await fin.Application.start({
|
|
2706
|
+
* uuid: 'app-1',
|
|
2707
|
+
* name: 'myApp',
|
|
2708
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getWindow.html',
|
|
2709
|
+
* autoShow: true
|
|
2710
|
+
* });
|
|
2711
|
+
* return await app.getWindow();
|
|
2712
|
+
* }
|
|
2713
|
+
*
|
|
2714
|
+
* getWindow().then(win => {
|
|
2715
|
+
* win.showAt(0, 400);
|
|
2716
|
+
* win.flash();
|
|
2717
|
+
* }).catch(err => console.log(err));
|
|
2718
|
+
* ```
|
|
2719
|
+
*/
|
|
2720
|
+
getWindow() {
|
|
2721
|
+
this.wire.sendAction('application-get-window', this.identity).catch((e) => {
|
|
2722
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
2723
|
+
});
|
|
2724
|
+
return Promise.resolve(this.window);
|
|
2725
|
+
}
|
|
2726
|
+
/**
|
|
2727
|
+
* Manually registers a user with the licensing service. The only data sent by this call is userName and appName.
|
|
2728
|
+
* @param userName - username to be passed to the RVM.
|
|
2729
|
+
* @param appName - app name to be passed to the RVM.
|
|
2730
|
+
*
|
|
2731
|
+
* @example
|
|
2732
|
+
*
|
|
2733
|
+
* ```js
|
|
2734
|
+
* async function registerUser() {
|
|
2735
|
+
* const app = await fin.Application.getCurrent();
|
|
2736
|
+
* return await app.registerUser('user', 'myApp');
|
|
2737
|
+
* }
|
|
2738
|
+
*
|
|
2739
|
+
* registerUser().then(() => console.log('Successfully registered the user')).catch(err => console.log(err));
|
|
2740
|
+
* ```
|
|
2741
|
+
*/
|
|
2742
|
+
registerUser(userName, appName) {
|
|
2743
|
+
return this.wire.sendAction('register-user', { userName, appName, ...this.identity }).then(() => undefined);
|
|
2744
|
+
}
|
|
2745
|
+
/**
|
|
2746
|
+
* Removes the application’s icon from the tray.
|
|
2747
|
+
*
|
|
2748
|
+
* @example
|
|
2749
|
+
*
|
|
2750
|
+
* ```js
|
|
2751
|
+
* async function removeTrayIcon() {
|
|
2752
|
+
* const app = await fin.Application.getCurrent();
|
|
2753
|
+
* return await app.removeTrayIcon();
|
|
2754
|
+
* }
|
|
2755
|
+
*
|
|
2756
|
+
* removeTrayIcon().then(() => console.log('Removed the tray icon.')).catch(err => console.log(err));
|
|
2757
|
+
* ```
|
|
2758
|
+
*/
|
|
2759
|
+
removeTrayIcon() {
|
|
2760
|
+
return this.wire.sendAction('remove-tray-icon', this.identity).then(() => undefined);
|
|
2761
|
+
}
|
|
2762
|
+
/**
|
|
2763
|
+
* Restarts the application.
|
|
2764
|
+
*
|
|
2765
|
+
* @example
|
|
2766
|
+
*
|
|
2767
|
+
* ```js
|
|
2768
|
+
* async function restartApp() {
|
|
2769
|
+
* const app = await fin.Application.getCurrent();
|
|
2770
|
+
* return await app.restart();
|
|
2771
|
+
* }
|
|
2772
|
+
* restartApp().then(() => console.log('Application restarted')).catch(err => console.log(err));
|
|
2773
|
+
* ```
|
|
2774
|
+
*/
|
|
2775
|
+
restart() {
|
|
2776
|
+
return this.wire.sendAction('restart-application', this.identity).then(() => undefined);
|
|
2777
|
+
}
|
|
2778
|
+
/**
|
|
2779
|
+
* DEPRECATED method to run the application.
|
|
2780
|
+
* Needed when starting application via {@link Application.create}, but NOT needed when starting via {@link Application.start}.
|
|
2781
|
+
*
|
|
2782
|
+
* @example
|
|
2783
|
+
*
|
|
2784
|
+
* ```js
|
|
2785
|
+
* async function run() {
|
|
2786
|
+
* const app = await fin.Application.create({
|
|
2787
|
+
* name: 'myApp',
|
|
2788
|
+
* uuid: 'app-1',
|
|
2789
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.run.html',
|
|
2790
|
+
* autoShow: true
|
|
2791
|
+
* });
|
|
2792
|
+
* await app.run();
|
|
2793
|
+
* }
|
|
2794
|
+
* run().then(() => console.log('Application is running')).catch(err => console.log(err));
|
|
2795
|
+
* ```
|
|
2796
|
+
*
|
|
2797
|
+
* @ignore
|
|
2798
|
+
*/
|
|
2799
|
+
run() {
|
|
2800
|
+
console.warn('Deprecation Warning: Application.run is deprecated Please use fin.Application.start');
|
|
2801
|
+
this.wire.sendAction('application-run', this.identity).catch((e) => {
|
|
2802
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
2803
|
+
});
|
|
2804
|
+
return this._run();
|
|
2805
|
+
}
|
|
2806
|
+
_run(opts = {}) {
|
|
2807
|
+
return this.wire
|
|
2808
|
+
.sendAction('run-application', {
|
|
2809
|
+
manifestUrl: this._manifestUrl,
|
|
2810
|
+
opts,
|
|
2811
|
+
...this.identity
|
|
2812
|
+
})
|
|
2813
|
+
.then(() => undefined);
|
|
2814
|
+
}
|
|
2815
|
+
/**
|
|
2816
|
+
* Instructs the RVM to schedule one restart of the application.
|
|
2817
|
+
*
|
|
2818
|
+
* @example
|
|
2819
|
+
*
|
|
2820
|
+
* ```js
|
|
2821
|
+
* async function scheduleRestart() {
|
|
2822
|
+
* const app = await fin.Application.getCurrent();
|
|
2823
|
+
* return await app.scheduleRestart();
|
|
2824
|
+
* }
|
|
2825
|
+
*
|
|
2826
|
+
* scheduleRestart().then(() => console.log('Application is scheduled to restart')).catch(err => console.log(err));
|
|
2827
|
+
* ```
|
|
2828
|
+
*/
|
|
2829
|
+
scheduleRestart() {
|
|
2830
|
+
return this.wire.sendAction('relaunch-on-close', this.identity).then(() => undefined);
|
|
2831
|
+
}
|
|
2832
|
+
/**
|
|
2833
|
+
* Sends a message to the RVM to upload the application's logs. On success,
|
|
2834
|
+
* an object containing logId is returned.
|
|
2835
|
+
*
|
|
2836
|
+
* @example
|
|
2837
|
+
*
|
|
2838
|
+
* ```js
|
|
2839
|
+
* async function sendLog() {
|
|
2840
|
+
* const app = await fin.Application.getCurrent();
|
|
2841
|
+
* return await app.sendApplicationLog();
|
|
2842
|
+
* }
|
|
2843
|
+
*
|
|
2844
|
+
* sendLog().then(info => console.log(info.logId)).catch(err => console.log(err));
|
|
2845
|
+
* ```
|
|
2846
|
+
*/
|
|
2847
|
+
async sendApplicationLog() {
|
|
2848
|
+
const { payload } = await this.wire.sendAction('send-application-log', this.identity);
|
|
2849
|
+
return payload.data;
|
|
2850
|
+
}
|
|
2851
|
+
/**
|
|
2852
|
+
* Sets or removes a custom JumpList for the application. Only applicable in Windows OS.
|
|
2853
|
+
* If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
|
|
2854
|
+
*
|
|
2855
|
+
* Note: If the "name" property is omitted it defaults to "tasks".
|
|
2856
|
+
* @param jumpListCategories An array of JumpList Categories to populate. If null, remove any existing JumpList configuration and set to Windows default.
|
|
2857
|
+
*
|
|
2858
|
+
*
|
|
2859
|
+
* @remarks If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
|
|
2860
|
+
*
|
|
2861
|
+
* The bottommost item in the jumplist will always be an item pointing to the current app. Its name is taken from the manifest's
|
|
2862
|
+
* **` shortcut.name `** and uses **` shortcut.company `** as a fallback. Clicking that item will launch the app from its current manifest.
|
|
2863
|
+
*
|
|
2864
|
+
* Note: If the "name" property is omitted it defaults to "tasks".
|
|
2865
|
+
*
|
|
2866
|
+
* Note: Window OS caches jumplists icons, therefore an icon change might only be visible after the cache is removed or the
|
|
2867
|
+
* uuid or shortcut.name is changed.
|
|
2868
|
+
*
|
|
2869
|
+
* @example
|
|
2870
|
+
*
|
|
2871
|
+
* ```js
|
|
2872
|
+
* const app = fin.Application.getCurrentSync();
|
|
2873
|
+
* const appName = 'My App';
|
|
2874
|
+
* const jumpListConfig = [ // array of JumpList categories
|
|
2875
|
+
* {
|
|
2876
|
+
* // has no name and no type so `type` is assumed to be "tasks"
|
|
2877
|
+
* items: [ // array of JumpList items
|
|
2878
|
+
* {
|
|
2879
|
+
* type: 'task',
|
|
2880
|
+
* title: `Launch ${appName}`,
|
|
2881
|
+
* description: `Runs ${appName} with the default configuration`,
|
|
2882
|
+
* deepLink: 'fins://path.to/app/manifest.json',
|
|
2883
|
+
* iconPath: 'https://path.to/app/icon.ico',
|
|
2884
|
+
* iconIndex: 0
|
|
2885
|
+
* },
|
|
2886
|
+
* { type: 'separator' },
|
|
2887
|
+
* {
|
|
2888
|
+
* type: 'task',
|
|
2889
|
+
* title: `Restore ${appName}`,
|
|
2890
|
+
* description: 'Restore to last configuration',
|
|
2891
|
+
* deepLink: 'fins://path.to/app/manifest.json?$$use-last-configuration=true',
|
|
2892
|
+
* iconPath: 'https://path.to/app/icon.ico',
|
|
2893
|
+
* iconIndex: 0
|
|
2894
|
+
* },
|
|
2895
|
+
* ]
|
|
2896
|
+
* },
|
|
2897
|
+
* {
|
|
2898
|
+
* name: 'Tools',
|
|
2899
|
+
* items: [ // array of JumpList items
|
|
2900
|
+
* {
|
|
2901
|
+
* type: 'task',
|
|
2902
|
+
* title: 'Tool A',
|
|
2903
|
+
* description: 'Runs Tool A',
|
|
2904
|
+
* deepLink: 'fins://path.to/tool-a/manifest.json',
|
|
2905
|
+
* iconPath: 'https://path.to/tool-a/icon.ico',
|
|
2906
|
+
* iconIndex: 0
|
|
2907
|
+
* },
|
|
2908
|
+
* {
|
|
2909
|
+
* type: 'task',
|
|
2910
|
+
* title: 'Tool B',
|
|
2911
|
+
* description: 'Runs Tool B',
|
|
2912
|
+
* deepLink: 'fins://path.to/tool-b/manifest.json',
|
|
2913
|
+
* iconPath: 'https://path.to/tool-b/icon.ico',
|
|
2914
|
+
* iconIndex: 0
|
|
2915
|
+
* }]
|
|
2916
|
+
* }
|
|
2917
|
+
* ];
|
|
2918
|
+
*
|
|
2919
|
+
* app.setJumpList(jumpListConfig).then(() => console.log('JumpList applied')).catch(e => console.log(`JumpList failed to apply: ${e.toString()}`));
|
|
2920
|
+
* ```
|
|
2921
|
+
*
|
|
2922
|
+
* To handle deeplink args:
|
|
2923
|
+
* ```js
|
|
2924
|
+
* function handleUseLastConfiguration() {
|
|
2925
|
+
* // this handler is called when the app is being launched
|
|
2926
|
+
* app.on('run-requested', event => {
|
|
2927
|
+
* if(event.userAppConfigArgs['use-last-configuration']) {
|
|
2928
|
+
* // your logic here
|
|
2929
|
+
* }
|
|
2930
|
+
* });
|
|
2931
|
+
* // this handler is called when the app was already running when the launch was requested
|
|
2932
|
+
* fin.desktop.main(function(args) {
|
|
2933
|
+
* if(args && args['use-last-configuration']) {
|
|
2934
|
+
* // your logic here
|
|
2935
|
+
* }
|
|
2936
|
+
* });
|
|
2937
|
+
* }
|
|
2938
|
+
* ```
|
|
2939
|
+
*/
|
|
2940
|
+
async setJumpList(jumpListCategories) {
|
|
2941
|
+
await this.wire.sendAction('set-jump-list', { config: jumpListCategories, ...this.identity });
|
|
2942
|
+
}
|
|
2943
|
+
/**
|
|
2944
|
+
* Adds a customizable icon in the system tray. To listen for a click on the icon use the `tray-icon-clicked` event.
|
|
2945
|
+
* @param icon Image URL or base64 encoded string to be used as the icon
|
|
2946
|
+
*
|
|
2947
|
+
* @example
|
|
2948
|
+
*
|
|
2949
|
+
* ```js
|
|
2950
|
+
* const imageUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
|
|
2951
|
+
* const base64EncodedImage = "iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX\
|
|
2952
|
+
* ///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII";
|
|
2953
|
+
* const dataURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DH\
|
|
2954
|
+
* xgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
|
|
2955
|
+
*
|
|
2956
|
+
* async function setTrayIcon(icon) {
|
|
2957
|
+
* const app = await fin.Application.getCurrent();
|
|
2958
|
+
* return await app.setTrayIcon(icon);
|
|
2959
|
+
* }
|
|
2960
|
+
*
|
|
2961
|
+
* // use image url to set tray icon
|
|
2962
|
+
* setTrayIcon(imageUrl).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
2963
|
+
*
|
|
2964
|
+
* // use base64 encoded string to set tray icon
|
|
2965
|
+
* setTrayIcon(base64EncodedImage).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
2966
|
+
*
|
|
2967
|
+
* // use a dataURL to set tray icon
|
|
2968
|
+
* setTrayIcon(dataURL).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
2969
|
+
* ```
|
|
2970
|
+
*/
|
|
2971
|
+
setTrayIcon(icon) {
|
|
2972
|
+
return this.wire
|
|
2973
|
+
.sendAction('set-tray-icon', {
|
|
2974
|
+
enabledIcon: icon,
|
|
2975
|
+
...this.identity
|
|
2976
|
+
})
|
|
2977
|
+
.then(() => undefined);
|
|
2978
|
+
}
|
|
2979
|
+
/**
|
|
2980
|
+
* Set hover text for this application's system tray icon.
|
|
2981
|
+
* Note: Application must first set a tray icon with {@link Application.setTrayIcon}.
|
|
2982
|
+
* @param toolTip
|
|
2983
|
+
*
|
|
2984
|
+
* @example
|
|
2985
|
+
*
|
|
2986
|
+
* ```js
|
|
2987
|
+
* const app = fin.Application.getCurrentSync();
|
|
2988
|
+
* const iconUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
|
|
2989
|
+
*
|
|
2990
|
+
* await app.setTrayIcon(iconUrl);
|
|
2991
|
+
*
|
|
2992
|
+
* await app.setTrayIconToolTip('My Application');
|
|
2993
|
+
* ```
|
|
2994
|
+
*/
|
|
2995
|
+
async setTrayIconToolTip(toolTip) {
|
|
2996
|
+
await this.wire.sendAction('set-tray-icon-tooltip', { ...this.identity, toolTip });
|
|
2997
|
+
}
|
|
2998
|
+
/**
|
|
2999
|
+
* Sets new application's shortcut configuration. Windows only.
|
|
3000
|
+
* @param config New application's shortcut configuration.
|
|
3001
|
+
*
|
|
3002
|
+
* @remarks Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest
|
|
3003
|
+
* to be able to change shortcut states.
|
|
3004
|
+
*
|
|
3005
|
+
* @example
|
|
3006
|
+
*
|
|
3007
|
+
* ```js
|
|
3008
|
+
* async function setShortcuts(config) {
|
|
3009
|
+
* const app = await fin.Application.getCurrent();
|
|
3010
|
+
* return app.setShortcuts(config);
|
|
3011
|
+
* }
|
|
3012
|
+
*
|
|
3013
|
+
* setShortcuts({
|
|
3014
|
+
* desktop: true,
|
|
3015
|
+
* startMenu: false,
|
|
3016
|
+
* systemStartup: true
|
|
3017
|
+
* }).then(() => console.log('Shortcuts are set.')).catch(err => console.log(err));
|
|
3018
|
+
* ```
|
|
3019
|
+
*/
|
|
3020
|
+
setShortcuts(config) {
|
|
3021
|
+
return this.wire.sendAction('set-shortcuts', { data: config, ...this.identity }).then(() => undefined);
|
|
3022
|
+
}
|
|
3023
|
+
/**
|
|
3024
|
+
* Sets the query string in all shortcuts for this app. Requires RVM 5.5+.
|
|
3025
|
+
* @param queryString The new query string for this app's shortcuts.
|
|
3026
|
+
*
|
|
3027
|
+
* @example
|
|
3028
|
+
*
|
|
3029
|
+
* ```js
|
|
3030
|
+
* const newQueryArgs = 'arg=true&arg2=false';
|
|
3031
|
+
* const app = await fin.Application.getCurrent();
|
|
3032
|
+
* try {
|
|
3033
|
+
* await app.setShortcutQueryParams(newQueryArgs);
|
|
3034
|
+
* } catch(err) {
|
|
3035
|
+
* console.error(err)
|
|
3036
|
+
* }
|
|
3037
|
+
* ```
|
|
3038
|
+
*/
|
|
3039
|
+
async setShortcutQueryParams(queryString) {
|
|
3040
|
+
await this.wire.sendAction('set-shortcut-query-args', { data: queryString, ...this.identity });
|
|
3041
|
+
}
|
|
3042
|
+
/**
|
|
3043
|
+
* Sets the zoom level of the application. The original size is 0 and each increment above or below represents zooming 20%
|
|
3044
|
+
* larger or smaller to default limits of 300% and 50% of original size, respectively.
|
|
3045
|
+
* @param level The zoom level
|
|
3046
|
+
*
|
|
3047
|
+
* @example
|
|
3048
|
+
*
|
|
3049
|
+
* ```js
|
|
3050
|
+
* async function setZoomLevel(number) {
|
|
3051
|
+
* const app = await fin.Application.getCurrent();
|
|
3052
|
+
* return await app.setZoomLevel(number);
|
|
3053
|
+
* }
|
|
3054
|
+
*
|
|
3055
|
+
* setZoomLevel(5).then(() => console.log('Setting a zoom level')).catch(err => console.log(err));
|
|
3056
|
+
* ```
|
|
3057
|
+
*/
|
|
3058
|
+
setZoomLevel(level) {
|
|
3059
|
+
return this.wire.sendAction('set-application-zoom-level', { level, ...this.identity }).then(() => undefined);
|
|
3060
|
+
}
|
|
3061
|
+
/**
|
|
3062
|
+
* Sets a username to correlate with App Log Management.
|
|
3063
|
+
* @param username Username to correlate with App's Log.
|
|
3064
|
+
*
|
|
3065
|
+
* @example
|
|
3066
|
+
*
|
|
3067
|
+
* ```js
|
|
3068
|
+
* async function setAppLogUser() {
|
|
3069
|
+
* const app = await fin.Application.getCurrent();
|
|
3070
|
+
* return await app.setAppLogUsername('username');
|
|
3071
|
+
* }
|
|
3072
|
+
*
|
|
3073
|
+
* setAppLogUser().then(() => console.log('Success')).catch(err => console.log(err));
|
|
3074
|
+
*
|
|
3075
|
+
* ```
|
|
3076
|
+
*/
|
|
3077
|
+
async setAppLogUsername(username) {
|
|
3078
|
+
await this.wire.sendAction('set-app-log-username', { data: username, ...this.identity });
|
|
3079
|
+
}
|
|
3080
|
+
/**
|
|
3081
|
+
* Retrieves information about the system tray. If the system tray is not set, it will throw an error message.
|
|
3082
|
+
* @remarks The only information currently returned is the position and dimensions.
|
|
3083
|
+
*
|
|
3084
|
+
* @example
|
|
3085
|
+
*
|
|
3086
|
+
* ```js
|
|
3087
|
+
* async function getTrayIconInfo() {
|
|
3088
|
+
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
3089
|
+
* return await app.getTrayIconInfo();
|
|
3090
|
+
* }
|
|
3091
|
+
* getTrayIconInfo().then(info => console.log(info)).catch(err => console.log(err));
|
|
3092
|
+
* ```
|
|
3093
|
+
*/
|
|
3094
|
+
getTrayIconInfo() {
|
|
3095
|
+
return this.wire.sendAction('get-tray-icon-info', this.identity).then(({ payload }) => payload.data);
|
|
3096
|
+
}
|
|
3097
|
+
/**
|
|
3098
|
+
* Checks if the application has an associated tray icon.
|
|
3099
|
+
*
|
|
3100
|
+
* @example
|
|
3101
|
+
*
|
|
3102
|
+
* ```js
|
|
3103
|
+
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
3104
|
+
* const hasTrayIcon = await app.hasTrayIcon();
|
|
3105
|
+
* console.log(hasTrayIcon);
|
|
3106
|
+
* ```
|
|
3107
|
+
*/
|
|
3108
|
+
hasTrayIcon() {
|
|
3109
|
+
return this.wire.sendAction('has-tray-icon', this.identity).then(({ payload }) => payload.data);
|
|
3110
|
+
}
|
|
3111
|
+
/**
|
|
3112
|
+
* Closes the application by terminating its process.
|
|
3113
|
+
*
|
|
3114
|
+
* @example
|
|
3115
|
+
*
|
|
3116
|
+
* ```js
|
|
3117
|
+
* async function terminateApp() {
|
|
3118
|
+
* const app = await fin.Application.getCurrent();
|
|
3119
|
+
* return await app.terminate();
|
|
3120
|
+
* }
|
|
3121
|
+
* terminateApp().then(() => console.log('Application terminated')).catch(err => console.log(err));
|
|
3122
|
+
* ```
|
|
3123
|
+
*/
|
|
3124
|
+
terminate() {
|
|
3125
|
+
return this.wire.sendAction('terminate-application', this.identity).then(() => undefined);
|
|
3126
|
+
}
|
|
3127
|
+
/**
|
|
3128
|
+
* Waits for a hanging application. This method can be called in response to an application
|
|
3129
|
+
* "not-responding" to allow the application to continue and to generate another "not-responding"
|
|
3130
|
+
* message after a certain period of time.
|
|
3131
|
+
*
|
|
3132
|
+
* @ignore
|
|
3133
|
+
*/
|
|
3134
|
+
wait() {
|
|
3135
|
+
return this.wire.sendAction('wait-for-hung-application', this.identity).then(() => undefined);
|
|
3136
|
+
}
|
|
3137
|
+
/**
|
|
3138
|
+
* Retrieves information about the application.
|
|
3139
|
+
*
|
|
3140
|
+
* @remarks If the application was not launched from a manifest, the call will return the closest parent application `manifest`
|
|
3141
|
+
* and `manifestUrl`. `initialOptions` shows the parameters used when launched programmatically, or the `startup_app` options
|
|
3142
|
+
* if launched from manifest. The `parentUuid` will be the uuid of the immediate parent (if applicable).
|
|
3143
|
+
*
|
|
3144
|
+
* @example
|
|
3145
|
+
*
|
|
3146
|
+
* ```js
|
|
3147
|
+
* async function getInfo() {
|
|
3148
|
+
* const app = await fin.Application.getCurrent();
|
|
3149
|
+
* return await app.getInfo();
|
|
3150
|
+
* }
|
|
3151
|
+
*
|
|
3152
|
+
* getInfo().then(info => console.log(info)).catch(err => console.log(err));
|
|
3153
|
+
* ```
|
|
3154
|
+
*/
|
|
3155
|
+
getInfo() {
|
|
3156
|
+
return this.wire.sendAction('get-info', this.identity).then(({ payload }) => payload.data);
|
|
3157
|
+
}
|
|
3158
|
+
/**
|
|
3159
|
+
* Retrieves all process information for entities (windows and views) associated with an application.
|
|
3160
|
+
*
|
|
3161
|
+
* @example
|
|
3162
|
+
* ```js
|
|
3163
|
+
* const app = await fin.Application.getCurrent();
|
|
3164
|
+
* const processInfo = await app.getProcessInfo();
|
|
3165
|
+
* ```
|
|
3166
|
+
* @experimental
|
|
3167
|
+
*/
|
|
3168
|
+
async getProcessInfo() {
|
|
3169
|
+
const { payload: { data } } = await this.wire.sendAction('application-get-process-info', this.identity);
|
|
3170
|
+
return data;
|
|
3171
|
+
}
|
|
3172
|
+
/**
|
|
3173
|
+
* Sets file auto download location. It's only allowed in the same application.
|
|
3174
|
+
*
|
|
3175
|
+
* Note: This method is restricted by default and must be enabled via
|
|
3176
|
+
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
3177
|
+
* @param downloadLocation file auto download location
|
|
3178
|
+
*
|
|
3179
|
+
* @throws if setting file auto download location on different applications.
|
|
3180
|
+
* @example
|
|
3181
|
+
*
|
|
3182
|
+
* ```js
|
|
3183
|
+
* const downloadLocation = 'C:\\dev\\temp';
|
|
3184
|
+
* const app = await fin.Application.getCurrent();
|
|
3185
|
+
* try {
|
|
3186
|
+
* await app.setFileDownloadLocation(downloadLocation);
|
|
3187
|
+
* console.log('File download location is set');
|
|
3188
|
+
* } catch(err) {
|
|
3189
|
+
* console.error(err)
|
|
3190
|
+
* }
|
|
3191
|
+
* ```
|
|
3192
|
+
*/
|
|
3193
|
+
async setFileDownloadLocation(downloadLocation) {
|
|
3194
|
+
const { name } = this.wire.me;
|
|
3195
|
+
const entityIdentity = { uuid: this.identity.uuid, name };
|
|
3196
|
+
await this.wire.sendAction('set-file-download-location', { ...entityIdentity, downloadLocation });
|
|
3197
|
+
}
|
|
3198
|
+
/**
|
|
3199
|
+
* Gets file auto download location. It's only allowed in the same application. If file auto download location is not set, it will return the default location.
|
|
3200
|
+
*
|
|
3201
|
+
* Note: This method is restricted by default and must be enabled via
|
|
3202
|
+
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
3203
|
+
*
|
|
3204
|
+
* @throws if getting file auto download location on different applications.
|
|
3205
|
+
* @example
|
|
3206
|
+
*
|
|
3207
|
+
* ```js
|
|
3208
|
+
* const app = await fin.Application.getCurrent();
|
|
3209
|
+
* const fileDownloadDir = await app.getFileDownloadLocation();
|
|
3210
|
+
* ```
|
|
3211
|
+
*/
|
|
3212
|
+
async getFileDownloadLocation() {
|
|
3213
|
+
const { payload: { data } } = await this.wire.sendAction('get-file-download-location', this.identity);
|
|
3214
|
+
return data;
|
|
3215
|
+
}
|
|
3216
|
+
/**
|
|
3217
|
+
* Shows a menu on the tray icon. Use with tray-icon-clicked event.
|
|
3218
|
+
* @param options
|
|
3219
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
|
3220
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
|
3221
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
|
3222
|
+
* these with a "reducer" pattern.
|
|
3223
|
+
* @throws if the application has no tray icon set
|
|
3224
|
+
* @throws if the system tray is currently hidden
|
|
3225
|
+
* @example
|
|
3226
|
+
*
|
|
3227
|
+
* ```js
|
|
3228
|
+
* const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
|
|
3229
|
+
* const app = fin.Application.getCurrentSync();
|
|
3230
|
+
*
|
|
3231
|
+
* await app.setTrayIcon(iconUrl);
|
|
3232
|
+
*
|
|
3233
|
+
* const template = [
|
|
3234
|
+
* {
|
|
3235
|
+
* label: 'Menu Item 1',
|
|
3236
|
+
* data: 'hello from item 1'
|
|
3237
|
+
* },
|
|
3238
|
+
* { type: 'separator' },
|
|
3239
|
+
* {
|
|
3240
|
+
* label: 'Menu Item 2',
|
|
3241
|
+
* type: 'checkbox',
|
|
3242
|
+
* checked: true,
|
|
3243
|
+
* data: 'The user clicked the checkbox'
|
|
3244
|
+
* },
|
|
3245
|
+
* {
|
|
3246
|
+
* label: 'see more',
|
|
3247
|
+
* enabled: false,
|
|
3248
|
+
* submenu: [
|
|
3249
|
+
* { label: 'submenu 1', data: 'hello from submenu' }
|
|
3250
|
+
* ]
|
|
3251
|
+
* }
|
|
3252
|
+
* ];
|
|
3253
|
+
*
|
|
3254
|
+
* app.addListener('tray-icon-clicked', (event) => {
|
|
3255
|
+
* // right-click
|
|
3256
|
+
* if (event.button === 2) {
|
|
3257
|
+
* app.showTrayIconPopupMenu({ template }).then(r => {
|
|
3258
|
+
* if (r.result === 'closed') {
|
|
3259
|
+
* console.log('nothing happened');
|
|
3260
|
+
* } else {
|
|
3261
|
+
* console.log(r.data);
|
|
3262
|
+
* }
|
|
3263
|
+
* });
|
|
3264
|
+
* }
|
|
3265
|
+
* });
|
|
3266
|
+
* ```
|
|
3267
|
+
*/
|
|
3268
|
+
async showTrayIconPopupMenu(options) {
|
|
3269
|
+
const { name } = this.wire.me;
|
|
3270
|
+
const entityIdentity = { uuid: this.identity.uuid, name };
|
|
3271
|
+
const { payload } = await this.wire.sendAction('show-tray-icon-popup-menu', { ...entityIdentity, options });
|
|
3272
|
+
return payload.data;
|
|
3273
|
+
}
|
|
3274
|
+
/**
|
|
3275
|
+
* Closes the tray icon menu.
|
|
3276
|
+
*
|
|
3277
|
+
* @throws if the application has no tray icon set
|
|
3278
|
+
* @example
|
|
3279
|
+
*
|
|
3280
|
+
* ```js
|
|
3281
|
+
* const app = fin.Application.getCurrentSync();
|
|
3282
|
+
*
|
|
3283
|
+
* await app.closeTrayIconPopupMenu();
|
|
3284
|
+
* ```
|
|
3285
|
+
*/
|
|
3286
|
+
async closeTrayIconPopupMenu() {
|
|
3287
|
+
const { name } = this.wire.me;
|
|
3288
|
+
const entityIdentity = { uuid: this.identity.uuid, name };
|
|
3289
|
+
await this.wire.sendAction('close-tray-icon-popup-menu', { ...entityIdentity });
|
|
3290
|
+
}
|
|
3291
|
+
}
|
|
3292
|
+
Instance$6.Application = Application;
|
|
3293
|
+
|
|
3294
|
+
Object.defineProperty(Factory$7, "__esModule", { value: true });
|
|
3295
|
+
Factory$7.ApplicationModule = void 0;
|
|
3296
|
+
const base_1$n = base;
|
|
3297
|
+
const validate_1$4 = validate;
|
|
3298
|
+
const Instance_1$5 = Instance$6;
|
|
3299
|
+
/**
|
|
3300
|
+
* Static namespace for OpenFin API methods that interact with the {@link Application} class, available under `fin.Application`.
|
|
3301
|
+
*/
|
|
3302
|
+
class ApplicationModule extends base_1$n.Base {
|
|
3303
|
+
/**
|
|
3304
|
+
* Asynchronously returns an API handle for the given Application identity.
|
|
3305
|
+
*
|
|
3306
|
+
* @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
|
|
3307
|
+
* returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
|
|
3308
|
+
* for an Application throughout its entire lifecycle.
|
|
3309
|
+
*
|
|
3310
|
+
* @example
|
|
3311
|
+
*
|
|
3312
|
+
* ```js
|
|
3313
|
+
* fin.Application.wrap({ uuid: 'testapp' })
|
|
3314
|
+
* .then(app => app.isRunning())
|
|
3315
|
+
* .then(running => console.log('Application is running: ' + running))
|
|
3316
|
+
* .catch(err => console.log(err));
|
|
3317
|
+
* ```
|
|
3318
|
+
*
|
|
3319
|
+
*/
|
|
3320
|
+
async wrap(identity) {
|
|
3321
|
+
this.wire.sendAction('wrap-application').catch((e) => {
|
|
3322
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3323
|
+
});
|
|
3324
|
+
const errorMsg = (0, validate_1$4.validateIdentity)(identity);
|
|
3325
|
+
if (errorMsg) {
|
|
3326
|
+
throw new Error(errorMsg);
|
|
3327
|
+
}
|
|
3328
|
+
return new Instance_1$5.Application(this.wire, identity);
|
|
3329
|
+
}
|
|
3330
|
+
/**
|
|
3331
|
+
* Synchronously returns an API handle for the given Application identity.
|
|
3332
|
+
*
|
|
3333
|
+
* @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
|
|
3334
|
+
* returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
|
|
3335
|
+
* for an Aplication throughout its entire lifecycle.
|
|
3336
|
+
*
|
|
3337
|
+
* @example
|
|
3338
|
+
*
|
|
3339
|
+
* ```js
|
|
3340
|
+
* const app = fin.Application.wrapSync({ uuid: 'testapp' });
|
|
3341
|
+
* await app.close();
|
|
3342
|
+
* ```
|
|
3343
|
+
*
|
|
3344
|
+
*/
|
|
3345
|
+
wrapSync(identity) {
|
|
3346
|
+
this.wire.sendAction('wrap-application-sync').catch((e) => {
|
|
3347
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3348
|
+
});
|
|
3349
|
+
const errorMsg = (0, validate_1$4.validateIdentity)(identity);
|
|
3350
|
+
if (errorMsg) {
|
|
3351
|
+
throw new Error(errorMsg);
|
|
3352
|
+
}
|
|
3353
|
+
return new Instance_1$5.Application(this.wire, identity);
|
|
3354
|
+
}
|
|
3355
|
+
async _create(appOptions) {
|
|
3356
|
+
// set defaults:
|
|
3357
|
+
if (appOptions.waitForPageLoad === undefined) {
|
|
3358
|
+
appOptions.waitForPageLoad = false;
|
|
3359
|
+
}
|
|
3360
|
+
if (appOptions.autoShow === undefined && appOptions.isPlatformController === undefined) {
|
|
3361
|
+
appOptions.autoShow = true;
|
|
3362
|
+
}
|
|
3363
|
+
await this.wire.sendAction('create-application', appOptions);
|
|
3364
|
+
return this.wrap({ uuid: appOptions.uuid });
|
|
3365
|
+
}
|
|
3366
|
+
/**
|
|
3367
|
+
* DEPRECATED method to create a new Application. Use {@link Application.ApplicationModule.start Application.start} instead.
|
|
3368
|
+
*
|
|
3369
|
+
* @example
|
|
3370
|
+
*
|
|
3371
|
+
* ```js
|
|
3372
|
+
* async function createApp() {
|
|
3373
|
+
* const app = await fin.Application.create({
|
|
3374
|
+
* name: 'myApp',
|
|
3375
|
+
* uuid: 'app-3',
|
|
3376
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.create.html',
|
|
3377
|
+
* autoShow: true
|
|
3378
|
+
* });
|
|
3379
|
+
* await app.run();
|
|
3380
|
+
* }
|
|
3381
|
+
*
|
|
3382
|
+
* createApp().then(() => console.log('Application is created')).catch(err => console.log(err));
|
|
3383
|
+
* ```
|
|
3384
|
+
*
|
|
3385
|
+
* @ignore
|
|
3386
|
+
*/
|
|
3387
|
+
create(appOptions) {
|
|
3388
|
+
console.warn('Deprecation Warning: fin.Application.create is deprecated. Please use fin.Application.start');
|
|
3389
|
+
this.wire.sendAction('application-create').catch((e) => {
|
|
3390
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3391
|
+
});
|
|
3392
|
+
return this._create(appOptions);
|
|
3393
|
+
}
|
|
3394
|
+
/**
|
|
3395
|
+
* Creates and starts a new Application.
|
|
3396
|
+
*
|
|
3397
|
+
* @example
|
|
3398
|
+
*
|
|
3399
|
+
* ```js
|
|
3400
|
+
* async function start() {
|
|
3401
|
+
* return fin.Application.start({
|
|
3402
|
+
* name: 'app-1',
|
|
3403
|
+
* uuid: 'app-1',
|
|
3404
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.start.html',
|
|
3405
|
+
* autoShow: true
|
|
3406
|
+
* });
|
|
3407
|
+
* }
|
|
3408
|
+
* start().then(() => console.log('Application is running')).catch(err => console.log(err));
|
|
3409
|
+
* ```
|
|
3410
|
+
*
|
|
3411
|
+
*/
|
|
3412
|
+
async start(appOptions) {
|
|
3413
|
+
this.wire.sendAction('start-application').catch((e) => {
|
|
3414
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3415
|
+
});
|
|
3416
|
+
const app = await this._create(appOptions);
|
|
3417
|
+
await this.wire.sendAction('run-application', { uuid: appOptions.uuid });
|
|
3418
|
+
return app;
|
|
3419
|
+
}
|
|
3420
|
+
/**
|
|
3421
|
+
* Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls.
|
|
3422
|
+
* Returns once the RVM is finished attempting to launch the applications.
|
|
3423
|
+
* @param opts - Parameters that the RVM will use.
|
|
3424
|
+
*
|
|
3425
|
+
* @example
|
|
3426
|
+
*
|
|
3427
|
+
* ```js
|
|
3428
|
+
*
|
|
3429
|
+
* const applicationInfoArray = [
|
|
3430
|
+
* {
|
|
3431
|
+
* "uuid": 'App-1',
|
|
3432
|
+
* "manifestUrl": 'http://localhost:5555/app1.json',
|
|
3433
|
+
* },
|
|
3434
|
+
* {
|
|
3435
|
+
* "uuid": 'App-2',
|
|
3436
|
+
* "manifestUrl": 'http://localhost:5555/app2.json',
|
|
3437
|
+
* },
|
|
3438
|
+
* {
|
|
3439
|
+
* "uuid": 'App-3',
|
|
3440
|
+
* "manifestUrl": 'http://localhost:5555/app3.json',
|
|
3441
|
+
* }
|
|
3442
|
+
* ]
|
|
3443
|
+
*
|
|
3444
|
+
* fin.Application.startManyManifests(applicationInfoArray)
|
|
3445
|
+
* .then(() => {
|
|
3446
|
+
* console.log('RVM has finished launching the application list.');
|
|
3447
|
+
* })
|
|
3448
|
+
* .catch((err) => {
|
|
3449
|
+
* console.log(err);
|
|
3450
|
+
* })
|
|
3451
|
+
* ```
|
|
3452
|
+
*
|
|
3453
|
+
* @experimental
|
|
3454
|
+
*/
|
|
3455
|
+
async startManyManifests(applications, opts) {
|
|
3456
|
+
return this.wire.sendAction('run-applications', { applications, opts }).then(() => undefined);
|
|
3457
|
+
}
|
|
3458
|
+
/**
|
|
3459
|
+
* Asynchronously returns an Application object that represents the current application
|
|
3460
|
+
*
|
|
3461
|
+
* @example
|
|
3462
|
+
*
|
|
3463
|
+
* ```js
|
|
3464
|
+
* async function isCurrentAppRunning () {
|
|
3465
|
+
* const app = await fin.Application.getCurrent();
|
|
3466
|
+
* return app.isRunning();
|
|
3467
|
+
* }
|
|
3468
|
+
*
|
|
3469
|
+
* isCurrentAppRunning().then(running => {
|
|
3470
|
+
* console.log(`Current app is running: ${running}`);
|
|
3471
|
+
* }).catch(err => {
|
|
3472
|
+
* console.error(err);
|
|
3473
|
+
* });
|
|
3474
|
+
*
|
|
3475
|
+
* ```
|
|
3476
|
+
*/
|
|
3477
|
+
getCurrent() {
|
|
3478
|
+
this.wire.sendAction('get-current-application').catch((e) => {
|
|
3479
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3480
|
+
});
|
|
3481
|
+
return this.wrap({ uuid: this.wire.me.uuid });
|
|
3482
|
+
}
|
|
3483
|
+
/**
|
|
3484
|
+
* Synchronously returns an Application object that represents the current application
|
|
3485
|
+
*
|
|
3486
|
+
* @example
|
|
3487
|
+
*
|
|
3488
|
+
* ```js
|
|
3489
|
+
* async function isCurrentAppRunning () {
|
|
3490
|
+
* const app = fin.Application.getCurrentSync();
|
|
3491
|
+
* return app.isRunning();
|
|
3492
|
+
* }
|
|
3493
|
+
*
|
|
3494
|
+
* isCurrentAppRunning().then(running => {
|
|
3495
|
+
* console.log(`Current app is running: ${running}`);
|
|
3496
|
+
* }).catch(err => {
|
|
3497
|
+
* console.error(err);
|
|
3498
|
+
* });
|
|
3499
|
+
*
|
|
3500
|
+
* ```
|
|
3501
|
+
*/
|
|
3502
|
+
getCurrentSync() {
|
|
3503
|
+
this.wire.sendAction('get-current-application-sync').catch((e) => {
|
|
3504
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3505
|
+
});
|
|
3506
|
+
return this.wrapSync({ uuid: this.wire.me.uuid });
|
|
3507
|
+
}
|
|
3508
|
+
/**
|
|
3509
|
+
* Retrieves application's manifest and returns a running instance of the application.
|
|
3510
|
+
* @param manifestUrl - The URL of app's manifest.
|
|
3511
|
+
* @param opts - Parameters that the RVM will use.
|
|
3512
|
+
*
|
|
3513
|
+
* @example
|
|
3514
|
+
*
|
|
3515
|
+
* ```js
|
|
3516
|
+
* fin.Application.startFromManifest('http://localhost:5555/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
|
|
3517
|
+
*
|
|
3518
|
+
* // For a local manifest file:
|
|
3519
|
+
* fin.Application.startFromManifest('file:///C:/somefolder/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
|
|
3520
|
+
* ```
|
|
3521
|
+
*/
|
|
3522
|
+
async startFromManifest(manifestUrl, opts) {
|
|
3523
|
+
this.wire.sendAction('application-start-from-manifest').catch((e) => {
|
|
3524
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3525
|
+
});
|
|
3526
|
+
const app = await this._createFromManifest(manifestUrl);
|
|
3527
|
+
// @ts-expect-error using private method without warning.
|
|
3528
|
+
await app._run(opts); // eslint-disable-line no-underscore-dangle
|
|
3529
|
+
return app;
|
|
3530
|
+
}
|
|
3531
|
+
/**
|
|
3532
|
+
* @deprecated Use {@link Application.ApplicationModule.startFromManifest Application.startFromManifest} instead.
|
|
3533
|
+
* Retrieves application's manifest and returns a wrapped application.
|
|
3534
|
+
* @param manifestUrl - The URL of app's manifest.
|
|
3535
|
+
* @param callback - called if the method succeeds.
|
|
3536
|
+
* @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
|
|
3537
|
+
*
|
|
3538
|
+
* @example
|
|
3539
|
+
*
|
|
3540
|
+
* ```js
|
|
3541
|
+
* fin.Application.createFromManifest('http://localhost:5555/app.json').then(app => console.log(app)).catch(err => console.log(err));
|
|
3542
|
+
* ```
|
|
3543
|
+
* @ignore
|
|
3544
|
+
*/
|
|
3545
|
+
createFromManifest(manifestUrl) {
|
|
3546
|
+
console.warn('Deprecation Warning: fin.Application.createFromManifest is deprecated. Please use fin.Application.startFromManifest');
|
|
3547
|
+
this.wire.sendAction('application-create-from-manifest').catch((e) => {
|
|
3548
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3549
|
+
});
|
|
3550
|
+
return this._createFromManifest(manifestUrl);
|
|
3551
|
+
}
|
|
3552
|
+
_createFromManifest(manifestUrl) {
|
|
3553
|
+
return this.wire
|
|
3554
|
+
.sendAction('get-application-manifest', { manifestUrl })
|
|
3555
|
+
.then(({ payload }) => {
|
|
3556
|
+
const uuid = payload.data.platform ? payload.data.platform.uuid : payload.data.startup_app.uuid;
|
|
3557
|
+
return this.wrap({ uuid });
|
|
3558
|
+
})
|
|
3559
|
+
.then((app) => {
|
|
3560
|
+
app._manifestUrl = manifestUrl; // eslint-disable-line no-underscore-dangle
|
|
3561
|
+
return app;
|
|
3562
|
+
});
|
|
3563
|
+
}
|
|
3579
3564
|
}
|
|
3565
|
+
Factory$7.ApplicationModule = ApplicationModule;
|
|
3580
3566
|
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
* @packageDocumentation
|
|
3612
|
-
*/
|
|
3613
|
-
__exportStar(requireFactory$1(), exports);
|
|
3614
|
-
__exportStar(requireInstance$1(), exports);
|
|
3615
|
-
} (application));
|
|
3616
|
-
return application;
|
|
3617
|
-
}
|
|
3567
|
+
(function (exports) {
|
|
3568
|
+
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3569
|
+
if (k2 === undefined) k2 = k;
|
|
3570
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3571
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3572
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
3573
|
+
}
|
|
3574
|
+
Object.defineProperty(o, k2, desc);
|
|
3575
|
+
}) : (function(o, m, k, k2) {
|
|
3576
|
+
if (k2 === undefined) k2 = k;
|
|
3577
|
+
o[k2] = m[k];
|
|
3578
|
+
}));
|
|
3579
|
+
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
3580
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
3581
|
+
};
|
|
3582
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3583
|
+
/**
|
|
3584
|
+
* Entry points for the OpenFin `Application` API (`fin.Application`).
|
|
3585
|
+
*
|
|
3586
|
+
* * {@link ApplicationModule} contains static members of the `Application` API, accessible through `fin.Application`.
|
|
3587
|
+
* * {@link Application} describes an instance of an OpenFin Application, e.g. as returned by `fin.Application.getCurrent`.
|
|
3588
|
+
*
|
|
3589
|
+
* These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/32.114.76.10/index.html),
|
|
3590
|
+
* both of these were documented on the same page.
|
|
3591
|
+
*
|
|
3592
|
+
* @packageDocumentation
|
|
3593
|
+
*/
|
|
3594
|
+
__exportStar(Factory$7, exports);
|
|
3595
|
+
__exportStar(Instance$6, exports);
|
|
3596
|
+
} (application));
|
|
3618
3597
|
|
|
3619
3598
|
var promisifySubscription$1 = {};
|
|
3620
3599
|
|
|
@@ -3658,7 +3637,7 @@ function requireInstance () {
|
|
|
3658
3637
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3659
3638
|
/* eslint-disable no-console */
|
|
3660
3639
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
3661
|
-
const application_1 =
|
|
3640
|
+
const application_1 = application;
|
|
3662
3641
|
const main_1 = main;
|
|
3663
3642
|
const view_1 = requireView();
|
|
3664
3643
|
const warnings_1 = warnings;
|
|
@@ -3756,6 +3735,37 @@ function requireInstance () {
|
|
|
3756
3735
|
getAllFrames() {
|
|
3757
3736
|
return this.wire.sendAction('get-all-frames', this.identity).then(({ payload }) => payload.data);
|
|
3758
3737
|
}
|
|
3738
|
+
/**
|
|
3739
|
+
* Activates the current window and focuses the child entity if it exists. If this does
|
|
3740
|
+
* not succeed - say the child does not belong to this window, or the identity does not exist -
|
|
3741
|
+
* it will return false.
|
|
3742
|
+
*
|
|
3743
|
+
* @example
|
|
3744
|
+
* ```js
|
|
3745
|
+
* const win = fin.Window.wrapSync({ uuid: 'myApp', name: 'myOtherWindow' });
|
|
3746
|
+
*
|
|
3747
|
+
* win.getCurrentViews()
|
|
3748
|
+
* .then(([view1]) => {
|
|
3749
|
+
* return win.activateAndFocus(view1.identity);
|
|
3750
|
+
* })
|
|
3751
|
+
* .then(success => {
|
|
3752
|
+
* if (success) {
|
|
3753
|
+
* console.log('Window activated and child focused');
|
|
3754
|
+
* } else {
|
|
3755
|
+
* console.log('Window activation failed, focus state unchanged');
|
|
3756
|
+
* }
|
|
3757
|
+
* })
|
|
3758
|
+
* .catch(console.error);
|
|
3759
|
+
* ```
|
|
3760
|
+
*/
|
|
3761
|
+
activateAndFocus(childIdentityToFocus) {
|
|
3762
|
+
return this.wire
|
|
3763
|
+
.sendAction('activate-window-and-focus', {
|
|
3764
|
+
winIdentity: this.identity,
|
|
3765
|
+
focusIdentity: childIdentityToFocus
|
|
3766
|
+
})
|
|
3767
|
+
.then(({ payload }) => payload.data);
|
|
3768
|
+
}
|
|
3759
3769
|
/**
|
|
3760
3770
|
* Gets the current bounds (top, bottom, right, left, width, height) of the window.
|
|
3761
3771
|
*
|
|
@@ -5113,7 +5123,7 @@ function requireWindow () {
|
|
|
5113
5123
|
*/
|
|
5114
5124
|
Object.defineProperty(system, "__esModule", { value: true });
|
|
5115
5125
|
system.System = void 0;
|
|
5116
|
-
const base_1$
|
|
5126
|
+
const base_1$m = base;
|
|
5117
5127
|
const transport_errors_1$6 = transportErrors;
|
|
5118
5128
|
const window_1 = requireWindow();
|
|
5119
5129
|
const events_1$6 = require$$0;
|
|
@@ -5123,7 +5133,7 @@ const events_1$6 = require$$0;
|
|
|
5123
5133
|
* clearing the cache and exiting the runtime as well as listen to {@link OpenFin.SystemEvents system events}.
|
|
5124
5134
|
*
|
|
5125
5135
|
*/
|
|
5126
|
-
class System extends base_1$
|
|
5136
|
+
class System extends base_1$m.EmitterBase {
|
|
5127
5137
|
/**
|
|
5128
5138
|
* @internal
|
|
5129
5139
|
*/
|
|
@@ -7434,12 +7444,12 @@ class ChannelError extends Error {
|
|
|
7434
7444
|
}
|
|
7435
7445
|
channelError.ChannelError = ChannelError;
|
|
7436
7446
|
|
|
7437
|
-
var __classPrivateFieldGet$
|
|
7447
|
+
var __classPrivateFieldGet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7438
7448
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7439
7449
|
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");
|
|
7440
7450
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
7441
7451
|
};
|
|
7442
|
-
var __classPrivateFieldSet$
|
|
7452
|
+
var __classPrivateFieldSet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7443
7453
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
7444
7454
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
7445
7455
|
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");
|
|
@@ -7483,7 +7493,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
7483
7493
|
static closeChannelByEndpointId(id) {
|
|
7484
7494
|
const channel = channelClientsByEndpointId.get(id);
|
|
7485
7495
|
if (channel) {
|
|
7486
|
-
__classPrivateFieldGet$
|
|
7496
|
+
__classPrivateFieldGet$h(channel, _ChannelClient_close, "f").call(channel);
|
|
7487
7497
|
}
|
|
7488
7498
|
}
|
|
7489
7499
|
/**
|
|
@@ -7494,7 +7504,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
7494
7504
|
for (const channelClient of channelClientsByEndpointId.values()) {
|
|
7495
7505
|
if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
|
|
7496
7506
|
channelClient.disconnectListener(eventPayload);
|
|
7497
|
-
__classPrivateFieldGet$
|
|
7507
|
+
__classPrivateFieldGet$h(channelClient, _ChannelClient_close, "f").call(channelClient);
|
|
7498
7508
|
}
|
|
7499
7509
|
}
|
|
7500
7510
|
}
|
|
@@ -7509,12 +7519,12 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
7509
7519
|
this.processAction = (action, payload, senderIdentity) => super.processAction(action, payload, senderIdentity);
|
|
7510
7520
|
_ChannelClient_close.set(this, () => {
|
|
7511
7521
|
channelClientsByEndpointId.delete(this.endpointId);
|
|
7512
|
-
__classPrivateFieldGet$
|
|
7522
|
+
__classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").close();
|
|
7513
7523
|
});
|
|
7514
|
-
__classPrivateFieldSet$
|
|
7524
|
+
__classPrivateFieldSet$g(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
|
|
7515
7525
|
this.disconnectListener = () => undefined;
|
|
7516
7526
|
this.endpointId = routingInfo.endpointId;
|
|
7517
|
-
__classPrivateFieldSet$
|
|
7527
|
+
__classPrivateFieldSet$g(this, _ChannelClient_strategy, strategy, "f");
|
|
7518
7528
|
channelClientsByEndpointId.set(this.endpointId, this);
|
|
7519
7529
|
strategy.receive(this.processAction);
|
|
7520
7530
|
}
|
|
@@ -7522,7 +7532,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
7522
7532
|
* a read-only provider identity
|
|
7523
7533
|
*/
|
|
7524
7534
|
get providerIdentity() {
|
|
7525
|
-
const protectedObj = __classPrivateFieldGet$
|
|
7535
|
+
const protectedObj = __classPrivateFieldGet$h(this, _ChannelClient_protectedObj, "f");
|
|
7526
7536
|
return protectedObj.providerIdentity;
|
|
7527
7537
|
}
|
|
7528
7538
|
/**
|
|
@@ -7551,9 +7561,9 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
7551
7561
|
* ```
|
|
7552
7562
|
*/
|
|
7553
7563
|
async dispatch(action, payload) {
|
|
7554
|
-
if (__classPrivateFieldGet$
|
|
7564
|
+
if (__classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
|
|
7555
7565
|
const callSites = transport_errors_1$3.RuntimeError.getCallSite();
|
|
7556
|
-
return __classPrivateFieldGet$
|
|
7566
|
+
return __classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
|
|
7557
7567
|
throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
|
|
7558
7568
|
});
|
|
7559
7569
|
}
|
|
@@ -7605,10 +7615,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
7605
7615
|
*/
|
|
7606
7616
|
async disconnect() {
|
|
7607
7617
|
await this.sendDisconnectAction();
|
|
7608
|
-
__classPrivateFieldGet$
|
|
7618
|
+
__classPrivateFieldGet$h(this, _ChannelClient_close, "f").call(this);
|
|
7609
7619
|
}
|
|
7610
7620
|
async sendDisconnectAction() {
|
|
7611
|
-
const protectedObj = __classPrivateFieldGet$
|
|
7621
|
+
const protectedObj = __classPrivateFieldGet$h(this, _ChannelClient_protectedObj, "f");
|
|
7612
7622
|
await protectedObj.close();
|
|
7613
7623
|
}
|
|
7614
7624
|
/**
|
|
@@ -7641,13 +7651,13 @@ exhaustive.exhaustiveCheck = exhaustiveCheck;
|
|
|
7641
7651
|
|
|
7642
7652
|
var strategy$3 = {};
|
|
7643
7653
|
|
|
7644
|
-
var __classPrivateFieldSet$
|
|
7654
|
+
var __classPrivateFieldSet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7645
7655
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
7646
7656
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
7647
7657
|
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");
|
|
7648
7658
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7649
7659
|
};
|
|
7650
|
-
var __classPrivateFieldGet$
|
|
7660
|
+
var __classPrivateFieldGet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7651
7661
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7652
7662
|
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");
|
|
7653
7663
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -7672,7 +7682,7 @@ class ClassicStrategy {
|
|
|
7672
7682
|
// connection problems occur
|
|
7673
7683
|
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
|
|
7674
7684
|
this.send = async (endpointId, action, payload) => {
|
|
7675
|
-
const to = __classPrivateFieldGet$
|
|
7685
|
+
const to = __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
7676
7686
|
if (!to) {
|
|
7677
7687
|
throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
|
|
7678
7688
|
}
|
|
@@ -7684,13 +7694,13 @@ class ClassicStrategy {
|
|
|
7684
7694
|
}
|
|
7685
7695
|
delete cleanId.isLocalEndpointId;
|
|
7686
7696
|
// grab the promise before awaiting it to save in our pending messages map
|
|
7687
|
-
const p = __classPrivateFieldGet$
|
|
7697
|
+
const p = __classPrivateFieldGet$g(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
|
|
7688
7698
|
...cleanId,
|
|
7689
7699
|
providerIdentity: this.providerIdentity,
|
|
7690
7700
|
action,
|
|
7691
7701
|
payload
|
|
7692
7702
|
});
|
|
7693
|
-
__classPrivateFieldGet$
|
|
7703
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
|
|
7694
7704
|
const raw = await p
|
|
7695
7705
|
.catch((error) => {
|
|
7696
7706
|
if ('cause' in error) {
|
|
@@ -7700,16 +7710,16 @@ class ClassicStrategy {
|
|
|
7700
7710
|
})
|
|
7701
7711
|
.finally(() => {
|
|
7702
7712
|
// clean up the pending promise
|
|
7703
|
-
__classPrivateFieldGet$
|
|
7713
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
|
|
7704
7714
|
});
|
|
7705
7715
|
return raw.payload.data.result;
|
|
7706
7716
|
};
|
|
7707
7717
|
this.close = async () => {
|
|
7708
7718
|
this.messageReceiver.removeEndpoint(this.providerIdentity.channelId, this.endpointId);
|
|
7709
|
-
[...__classPrivateFieldGet$
|
|
7710
|
-
__classPrivateFieldSet$
|
|
7719
|
+
[...__classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
|
|
7720
|
+
__classPrivateFieldSet$f(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
|
|
7711
7721
|
};
|
|
7712
|
-
__classPrivateFieldSet$
|
|
7722
|
+
__classPrivateFieldSet$f(this, _ClassicStrategy_wire, wire, "f");
|
|
7713
7723
|
}
|
|
7714
7724
|
onEndpointDisconnect(endpointId, listener) {
|
|
7715
7725
|
// Never fires for 'classic'.
|
|
@@ -7718,20 +7728,20 @@ class ClassicStrategy {
|
|
|
7718
7728
|
this.messageReceiver.addEndpoint(listener, this.providerIdentity.channelId, this.endpointId);
|
|
7719
7729
|
}
|
|
7720
7730
|
async closeEndpoint(endpointId) {
|
|
7721
|
-
const id = __classPrivateFieldGet$
|
|
7722
|
-
__classPrivateFieldGet$
|
|
7723
|
-
const pendingSet = __classPrivateFieldGet$
|
|
7731
|
+
const id = __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
7732
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
|
|
7733
|
+
const pendingSet = __classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
|
|
7724
7734
|
pendingSet?.forEach((p) => {
|
|
7725
7735
|
const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
|
|
7726
7736
|
p.cancel(new Error(errorMsg));
|
|
7727
7737
|
});
|
|
7728
7738
|
}
|
|
7729
7739
|
isEndpointConnected(endpointId) {
|
|
7730
|
-
return __classPrivateFieldGet$
|
|
7740
|
+
return __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
|
|
7731
7741
|
}
|
|
7732
7742
|
addEndpoint(endpointId, payload) {
|
|
7733
|
-
__classPrivateFieldGet$
|
|
7734
|
-
__classPrivateFieldGet$
|
|
7743
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
|
|
7744
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
|
|
7735
7745
|
}
|
|
7736
7746
|
isValidEndpointPayload(payload) {
|
|
7737
7747
|
return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
|
|
@@ -7766,12 +7776,12 @@ function errorToPOJO(error) {
|
|
|
7766
7776
|
}
|
|
7767
7777
|
errors.errorToPOJO = errorToPOJO;
|
|
7768
7778
|
|
|
7769
|
-
var __classPrivateFieldGet$
|
|
7779
|
+
var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7770
7780
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7771
7781
|
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");
|
|
7772
7782
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
7773
7783
|
};
|
|
7774
|
-
var __classPrivateFieldSet$
|
|
7784
|
+
var __classPrivateFieldSet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7775
7785
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
7776
7786
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
7777
7787
|
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");
|
|
@@ -7806,8 +7816,8 @@ class RTCEndpoint {
|
|
|
7806
7816
|
if (this.rtc.rtcClient.connectionState !== 'connected') {
|
|
7807
7817
|
this.rtc.rtcClient.removeEventListener('connectionstatechange', this.connectionStateChangeHandler);
|
|
7808
7818
|
this.close();
|
|
7809
|
-
if (__classPrivateFieldGet$
|
|
7810
|
-
__classPrivateFieldGet$
|
|
7819
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
7820
|
+
__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
|
7811
7821
|
}
|
|
7812
7822
|
}
|
|
7813
7823
|
};
|
|
@@ -7855,9 +7865,9 @@ class RTCEndpoint {
|
|
|
7855
7865
|
data = new TextDecoder().decode(e.data);
|
|
7856
7866
|
}
|
|
7857
7867
|
const { messageId, action, payload } = JSON.parse(data);
|
|
7858
|
-
if (__classPrivateFieldGet$
|
|
7868
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f")) {
|
|
7859
7869
|
try {
|
|
7860
|
-
const res = await __classPrivateFieldGet$
|
|
7870
|
+
const res = await __classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
|
|
7861
7871
|
this.rtc.channels.response.send(JSON.stringify({
|
|
7862
7872
|
messageId,
|
|
7863
7873
|
payload: res,
|
|
@@ -7891,25 +7901,25 @@ class RTCEndpoint {
|
|
|
7891
7901
|
datachannel.onclose = (e) => {
|
|
7892
7902
|
[...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.')));
|
|
7893
7903
|
this.close();
|
|
7894
|
-
if (__classPrivateFieldGet$
|
|
7895
|
-
__classPrivateFieldGet$
|
|
7904
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
7905
|
+
__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
|
7896
7906
|
}
|
|
7897
7907
|
};
|
|
7898
7908
|
});
|
|
7899
7909
|
}
|
|
7900
7910
|
onDisconnect(listener) {
|
|
7901
|
-
if (!__classPrivateFieldGet$
|
|
7902
|
-
__classPrivateFieldSet$
|
|
7911
|
+
if (!__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
|
|
7912
|
+
__classPrivateFieldSet$e(this, _RTCEndpoint_disconnectListener, listener, "f");
|
|
7903
7913
|
}
|
|
7904
7914
|
else {
|
|
7905
7915
|
throw new Error('RTCEndpoint disconnectListener cannot be set twice.');
|
|
7906
7916
|
}
|
|
7907
7917
|
}
|
|
7908
7918
|
receive(listener) {
|
|
7909
|
-
if (__classPrivateFieldGet$
|
|
7919
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f")) {
|
|
7910
7920
|
throw new Error('You have already set a listener for this RTC Endpoint.');
|
|
7911
7921
|
}
|
|
7912
|
-
__classPrivateFieldSet$
|
|
7922
|
+
__classPrivateFieldSet$e(this, _RTCEndpoint_processAction, listener, "f");
|
|
7913
7923
|
}
|
|
7914
7924
|
get connected() {
|
|
7915
7925
|
return this.rtc.rtcClient.connectionState === 'connected';
|
|
@@ -7920,12 +7930,12 @@ _RTCEndpoint_processAction = new WeakMap(), _RTCEndpoint_disconnectListener = ne
|
|
|
7920
7930
|
|
|
7921
7931
|
var strategy$1 = {};
|
|
7922
7932
|
|
|
7923
|
-
var __classPrivateFieldGet$
|
|
7933
|
+
var __classPrivateFieldGet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7924
7934
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7925
7935
|
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");
|
|
7926
7936
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
7927
7937
|
};
|
|
7928
|
-
var __classPrivateFieldSet$
|
|
7938
|
+
var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7929
7939
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
7930
7940
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
7931
7941
|
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");
|
|
@@ -7946,11 +7956,11 @@ class EndpointStrategy {
|
|
|
7946
7956
|
return this.getEndpointById(endpointId).send(action, payload);
|
|
7947
7957
|
};
|
|
7948
7958
|
this.close = async () => {
|
|
7949
|
-
if (__classPrivateFieldGet$
|
|
7950
|
-
__classPrivateFieldGet$
|
|
7951
|
-
__classPrivateFieldSet$
|
|
7959
|
+
if (__classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f")) {
|
|
7960
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
|
|
7961
|
+
__classPrivateFieldSet$d(this, _EndpointStrategy_endpointMap, new Map(), "f");
|
|
7952
7962
|
}
|
|
7953
|
-
__classPrivateFieldSet$
|
|
7963
|
+
__classPrivateFieldSet$d(this, _EndpointStrategy_connected, false, "f");
|
|
7954
7964
|
};
|
|
7955
7965
|
this.isValidEndpointPayload = validateEndpoint;
|
|
7956
7966
|
}
|
|
@@ -7958,39 +7968,39 @@ class EndpointStrategy {
|
|
|
7958
7968
|
this.getEndpointById(endpointId).onDisconnect(listener);
|
|
7959
7969
|
}
|
|
7960
7970
|
receive(listener) {
|
|
7961
|
-
if (__classPrivateFieldGet$
|
|
7971
|
+
if (__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")) {
|
|
7962
7972
|
throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);
|
|
7963
7973
|
}
|
|
7964
|
-
__classPrivateFieldSet$
|
|
7974
|
+
__classPrivateFieldSet$d(this, _EndpointStrategy_processAction, listener, "f");
|
|
7965
7975
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
7966
|
-
__classPrivateFieldGet$
|
|
7976
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")));
|
|
7967
7977
|
}
|
|
7968
7978
|
getEndpointById(endpointId) {
|
|
7969
|
-
const endpoint = __classPrivateFieldGet$
|
|
7979
|
+
const endpoint = __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
|
|
7970
7980
|
if (!endpoint) {
|
|
7971
7981
|
throw new Error(`Client with endpoint id ${endpointId} is not connected`);
|
|
7972
7982
|
}
|
|
7973
7983
|
return endpoint;
|
|
7974
7984
|
}
|
|
7975
7985
|
get connected() {
|
|
7976
|
-
return __classPrivateFieldGet$
|
|
7986
|
+
return __classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f");
|
|
7977
7987
|
}
|
|
7978
7988
|
isEndpointConnected(endpointId) {
|
|
7979
|
-
return __classPrivateFieldGet$
|
|
7989
|
+
return __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
|
|
7980
7990
|
}
|
|
7981
7991
|
addEndpoint(endpointId, payload) {
|
|
7982
|
-
if (!__classPrivateFieldGet$
|
|
7992
|
+
if (!__classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f")) {
|
|
7983
7993
|
console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);
|
|
7984
7994
|
return;
|
|
7985
7995
|
}
|
|
7986
7996
|
const clientStrat = new this.EndpointType(payload);
|
|
7987
|
-
if (__classPrivateFieldGet$
|
|
7988
|
-
clientStrat.receive(__classPrivateFieldGet$
|
|
7997
|
+
if (__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")) {
|
|
7998
|
+
clientStrat.receive(__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f"));
|
|
7989
7999
|
}
|
|
7990
|
-
__classPrivateFieldGet$
|
|
8000
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
|
|
7991
8001
|
}
|
|
7992
8002
|
async closeEndpoint(endpointId) {
|
|
7993
|
-
__classPrivateFieldGet$
|
|
8003
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
|
|
7994
8004
|
}
|
|
7995
8005
|
}
|
|
7996
8006
|
strategy$1.EndpointStrategy = EndpointStrategy;
|
|
@@ -8017,11 +8027,11 @@ var iceManager = {};
|
|
|
8017
8027
|
|
|
8018
8028
|
Object.defineProperty(iceManager, "__esModule", { value: true });
|
|
8019
8029
|
iceManager.RTCICEManager = void 0;
|
|
8020
|
-
const base_1$
|
|
8030
|
+
const base_1$l = base;
|
|
8021
8031
|
/*
|
|
8022
8032
|
Singleton that facilitates Offer and Answer exchange required for establishing RTC connections.
|
|
8023
8033
|
*/
|
|
8024
|
-
class RTCICEManager extends base_1$
|
|
8034
|
+
class RTCICEManager extends base_1$l.EmitterBase {
|
|
8025
8035
|
constructor(wire) {
|
|
8026
8036
|
super(wire, 'channel');
|
|
8027
8037
|
this.ensureChannelOpened = (channel) => {
|
|
@@ -8172,12 +8182,12 @@ function runtimeUuidMeetsMinimumRuntimeVersion(runtimeUuid, minVersion) {
|
|
|
8172
8182
|
}
|
|
8173
8183
|
runtimeVersioning.runtimeUuidMeetsMinimumRuntimeVersion = runtimeUuidMeetsMinimumRuntimeVersion;
|
|
8174
8184
|
|
|
8175
|
-
var __classPrivateFieldGet$
|
|
8185
|
+
var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8176
8186
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
8177
8187
|
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");
|
|
8178
8188
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
8179
8189
|
};
|
|
8180
|
-
var __classPrivateFieldSet$
|
|
8190
|
+
var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8181
8191
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8182
8192
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
8183
8193
|
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");
|
|
@@ -8221,19 +8231,19 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8221
8231
|
* a read-only array containing all the identities of connecting clients.
|
|
8222
8232
|
*/
|
|
8223
8233
|
get connections() {
|
|
8224
|
-
return [...__classPrivateFieldGet$
|
|
8234
|
+
return [...__classPrivateFieldGet$d(this, _ChannelProvider_connections, "f")];
|
|
8225
8235
|
}
|
|
8226
8236
|
static handleClientDisconnection(channel, payload) {
|
|
8227
8237
|
if (payload?.endpointId) {
|
|
8228
8238
|
const { uuid, name, endpointId, isLocalEndpointId } = payload;
|
|
8229
|
-
__classPrivateFieldGet$
|
|
8239
|
+
__classPrivateFieldGet$d(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
|
|
8230
8240
|
}
|
|
8231
8241
|
else {
|
|
8232
8242
|
// this is here to support older runtimes that did not have endpointId
|
|
8233
8243
|
const multipleRemoves = channel.connections.filter((identity) => {
|
|
8234
8244
|
return identity.uuid === payload.uuid && identity.name === payload.name;
|
|
8235
8245
|
});
|
|
8236
|
-
multipleRemoves.forEach(__classPrivateFieldGet$
|
|
8246
|
+
multipleRemoves.forEach(__classPrivateFieldGet$d(channel, _ChannelProvider_removeEndpoint, "f"));
|
|
8237
8247
|
}
|
|
8238
8248
|
channel.disconnectListener(payload);
|
|
8239
8249
|
}
|
|
@@ -8250,8 +8260,8 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8250
8260
|
_ChannelProvider_strategy.set(this, void 0);
|
|
8251
8261
|
_ChannelProvider_removeEndpoint.set(this, (identity) => {
|
|
8252
8262
|
const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
|
|
8253
|
-
__classPrivateFieldGet$
|
|
8254
|
-
__classPrivateFieldSet$
|
|
8263
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
|
|
8264
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_connections, remainingConnections, "f");
|
|
8255
8265
|
});
|
|
8256
8266
|
// Must be bound.
|
|
8257
8267
|
this.processAction = async (action, payload, senderIdentity) => {
|
|
@@ -8265,17 +8275,17 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8265
8275
|
return super.processAction(action, payload, senderIdentity);
|
|
8266
8276
|
};
|
|
8267
8277
|
_ChannelProvider_close.set(this, () => {
|
|
8268
|
-
__classPrivateFieldGet$
|
|
8278
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").close();
|
|
8269
8279
|
const remove = ChannelProvider.removalMap.get(this);
|
|
8270
8280
|
if (remove) {
|
|
8271
8281
|
remove();
|
|
8272
8282
|
}
|
|
8273
8283
|
});
|
|
8274
|
-
__classPrivateFieldSet$
|
|
8284
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
|
|
8275
8285
|
this.connectListener = () => undefined;
|
|
8276
8286
|
this.disconnectListener = () => undefined;
|
|
8277
|
-
__classPrivateFieldSet$
|
|
8278
|
-
__classPrivateFieldSet$
|
|
8287
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_connections, [], "f");
|
|
8288
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_strategy, strategy, "f");
|
|
8279
8289
|
strategy.receive(this.processAction);
|
|
8280
8290
|
}
|
|
8281
8291
|
/**
|
|
@@ -8306,16 +8316,16 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8306
8316
|
*/
|
|
8307
8317
|
dispatch(to, action, payload) {
|
|
8308
8318
|
const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
|
|
8309
|
-
if (endpointId && __classPrivateFieldGet$
|
|
8319
|
+
if (endpointId && __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
|
|
8310
8320
|
const callSites = transport_errors_1$2.RuntimeError.getCallSite();
|
|
8311
|
-
return __classPrivateFieldGet$
|
|
8321
|
+
return __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
|
|
8312
8322
|
throw new channel_error_1.ChannelError(e, action, payload, callSites);
|
|
8313
8323
|
});
|
|
8314
8324
|
}
|
|
8315
8325
|
return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
|
|
8316
8326
|
}
|
|
8317
8327
|
async processConnection(senderId, payload) {
|
|
8318
|
-
__classPrivateFieldGet$
|
|
8328
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_connections, "f").push(senderId);
|
|
8319
8329
|
return this.connectListener(senderId, payload);
|
|
8320
8330
|
}
|
|
8321
8331
|
/**
|
|
@@ -8338,7 +8348,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8338
8348
|
* ```
|
|
8339
8349
|
*/
|
|
8340
8350
|
publish(action, payload) {
|
|
8341
|
-
return this.connections.map((to) => __classPrivateFieldGet$
|
|
8351
|
+
return this.connections.map((to) => __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
|
|
8342
8352
|
}
|
|
8343
8353
|
/**
|
|
8344
8354
|
* Register a listener that is called on every new client connection.
|
|
@@ -8412,11 +8422,11 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8412
8422
|
* ```
|
|
8413
8423
|
*/
|
|
8414
8424
|
async destroy() {
|
|
8415
|
-
const protectedObj = __classPrivateFieldGet$
|
|
8425
|
+
const protectedObj = __classPrivateFieldGet$d(this, _ChannelProvider_protectedObj, "f");
|
|
8416
8426
|
protectedObj.providerIdentity;
|
|
8417
|
-
__classPrivateFieldSet$
|
|
8427
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_connections, [], "f");
|
|
8418
8428
|
await protectedObj.close();
|
|
8419
|
-
__classPrivateFieldGet$
|
|
8429
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_close, "f").call(this);
|
|
8420
8430
|
}
|
|
8421
8431
|
/**
|
|
8422
8432
|
* Returns an array with info on every Client connected to the Provider
|
|
@@ -8486,7 +8496,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
8486
8496
|
getEndpointIdForOpenFinId(clientIdentity, action) {
|
|
8487
8497
|
const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
|
|
8488
8498
|
if (matchingConnections.length >= 2) {
|
|
8489
|
-
const protectedObj = __classPrivateFieldGet$
|
|
8499
|
+
const protectedObj = __classPrivateFieldGet$d(this, _ChannelProvider_protectedObj, "f");
|
|
8490
8500
|
const { uuid, name } = clientIdentity;
|
|
8491
8501
|
const providerUuid = protectedObj?.providerIdentity.uuid;
|
|
8492
8502
|
const providerName = protectedObj?.providerIdentity.name;
|
|
@@ -8522,14 +8532,14 @@ var messageReceiver$1 = {};
|
|
|
8522
8532
|
Object.defineProperty(messageReceiver$1, "__esModule", { value: true });
|
|
8523
8533
|
messageReceiver$1.MessageReceiver = void 0;
|
|
8524
8534
|
const client_1$1 = client;
|
|
8525
|
-
const base_1$
|
|
8535
|
+
const base_1$k = base;
|
|
8526
8536
|
const errors_1$1 = errors;
|
|
8527
8537
|
/*
|
|
8528
8538
|
This is a singleton (per fin object) tasked with routing messages coming off the ipc to the correct endpoint.
|
|
8529
8539
|
It needs to be a singleton because there can only be one per wire. It tracks both clients and providers' processAction passed in via the strategy.
|
|
8530
8540
|
If functionality is not about receiving messages, it does not belong here.
|
|
8531
8541
|
*/
|
|
8532
|
-
class MessageReceiver extends base_1$
|
|
8542
|
+
class MessageReceiver extends base_1$k.Base {
|
|
8533
8543
|
constructor(wire) {
|
|
8534
8544
|
super(wire);
|
|
8535
8545
|
this.onmessage = (msg) => {
|
|
@@ -8698,13 +8708,13 @@ class CombinedStrategy {
|
|
|
8698
8708
|
}
|
|
8699
8709
|
strategy.default = CombinedStrategy;
|
|
8700
8710
|
|
|
8701
|
-
var __classPrivateFieldSet$
|
|
8711
|
+
var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8702
8712
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8703
8713
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
8704
8714
|
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");
|
|
8705
8715
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
8706
8716
|
};
|
|
8707
|
-
var __classPrivateFieldGet$
|
|
8717
|
+
var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8708
8718
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
8709
8719
|
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");
|
|
8710
8720
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -8716,7 +8726,7 @@ var _ConnectionManager_messageReceiver, _ConnectionManager_rtcConnectionManager;
|
|
|
8716
8726
|
Object.defineProperty(connectionManager, "__esModule", { value: true });
|
|
8717
8727
|
connectionManager.ConnectionManager = void 0;
|
|
8718
8728
|
const exhaustive_1 = exhaustive;
|
|
8719
|
-
const base_1$
|
|
8729
|
+
const base_1$j = base;
|
|
8720
8730
|
const strategy_1 = strategy$3;
|
|
8721
8731
|
const strategy_2 = strategy$2;
|
|
8722
8732
|
const ice_manager_1 = iceManager;
|
|
@@ -8724,7 +8734,7 @@ const provider_1$1 = provider;
|
|
|
8724
8734
|
const message_receiver_1 = messageReceiver$1;
|
|
8725
8735
|
const protocol_manager_1 = protocolManager;
|
|
8726
8736
|
const strategy_3 = __importDefault$5(strategy);
|
|
8727
|
-
class ConnectionManager extends base_1$
|
|
8737
|
+
class ConnectionManager extends base_1$j.Base {
|
|
8728
8738
|
static getProtocolOptionsFromStrings(protocols) {
|
|
8729
8739
|
return protocols.map((protocol) => {
|
|
8730
8740
|
switch (protocol) {
|
|
@@ -8753,8 +8763,8 @@ class ConnectionManager extends base_1$i.Base {
|
|
|
8753
8763
|
};
|
|
8754
8764
|
this.providerMap = new Map();
|
|
8755
8765
|
this.protocolManager = new protocol_manager_1.ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
|
|
8756
|
-
__classPrivateFieldSet$
|
|
8757
|
-
__classPrivateFieldSet$
|
|
8766
|
+
__classPrivateFieldSet$b(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
|
|
8767
|
+
__classPrivateFieldSet$b(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
|
|
8758
8768
|
wire.registerMessageHandler(this.onmessage.bind(this));
|
|
8759
8769
|
}
|
|
8760
8770
|
createProvider(options, providerIdentity) {
|
|
@@ -8765,7 +8775,7 @@ class ConnectionManager extends base_1$i.Base {
|
|
|
8765
8775
|
case 'rtc':
|
|
8766
8776
|
return new strategy_2.RTCStrategy();
|
|
8767
8777
|
case 'classic':
|
|
8768
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
|
8778
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f"),
|
|
8769
8779
|
// Providers do not have an endpointId, use channelId as endpointId in the strategy.
|
|
8770
8780
|
providerIdentity.channelId, providerIdentity);
|
|
8771
8781
|
default:
|
|
@@ -8801,7 +8811,7 @@ class ConnectionManager extends base_1$i.Base {
|
|
|
8801
8811
|
const supportedProtocols = await Promise.all(protocols.map(async (type) => {
|
|
8802
8812
|
switch (type) {
|
|
8803
8813
|
case 'rtc': {
|
|
8804
|
-
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$
|
|
8814
|
+
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
|
|
8805
8815
|
rtcPacket = { rtcClient, channels, channelsOpened };
|
|
8806
8816
|
return {
|
|
8807
8817
|
type: 'rtc',
|
|
@@ -8828,18 +8838,18 @@ class ConnectionManager extends base_1$i.Base {
|
|
|
8828
8838
|
routingInfo.endpointId = this.wire.environment.getNextMessageId();
|
|
8829
8839
|
// For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
|
|
8830
8840
|
// clients that are in the same context as the newly-connected client.
|
|
8831
|
-
__classPrivateFieldGet$
|
|
8841
|
+
__classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
|
|
8832
8842
|
}
|
|
8833
8843
|
const answer = routingInfo.answer ?? {
|
|
8834
8844
|
supportedProtocols: [{ type: 'classic', version: 1 }]
|
|
8835
8845
|
};
|
|
8836
8846
|
const createStrategyFromAnswer = async (protocol) => {
|
|
8837
8847
|
if (protocol.type === 'rtc' && rtcPacket) {
|
|
8838
|
-
await __classPrivateFieldGet$
|
|
8848
|
+
await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
|
|
8839
8849
|
return new strategy_2.RTCStrategy();
|
|
8840
8850
|
}
|
|
8841
8851
|
if (protocol.type === 'classic') {
|
|
8842
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
|
8852
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
|
|
8843
8853
|
}
|
|
8844
8854
|
return null;
|
|
8845
8855
|
};
|
|
@@ -8907,7 +8917,7 @@ class ConnectionManager extends base_1$i.Base {
|
|
|
8907
8917
|
clientAnswer = await overlappingProtocols.reduce(async (accumP, protocolToUse) => {
|
|
8908
8918
|
const answer = await accumP;
|
|
8909
8919
|
if (protocolToUse.type === 'rtc') {
|
|
8910
|
-
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$
|
|
8920
|
+
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
|
|
8911
8921
|
answer.supportedProtocols.push({
|
|
8912
8922
|
type: 'rtc',
|
|
8913
8923
|
version: strategy_2.RTCInfo.version,
|
|
@@ -8955,13 +8965,13 @@ _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnec
|
|
|
8955
8965
|
*
|
|
8956
8966
|
* @packageDocumentation
|
|
8957
8967
|
*/
|
|
8958
|
-
var __classPrivateFieldSet$
|
|
8968
|
+
var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8959
8969
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8960
8970
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
8961
8971
|
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");
|
|
8962
8972
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
8963
8973
|
};
|
|
8964
|
-
var __classPrivateFieldGet$
|
|
8974
|
+
var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8965
8975
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
8966
8976
|
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");
|
|
8967
8977
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -8971,8 +8981,8 @@ Object.defineProperty(channel$1, "__esModule", { value: true });
|
|
|
8971
8981
|
channel$1.Channel = void 0;
|
|
8972
8982
|
/* eslint-disable no-console */
|
|
8973
8983
|
const events_1$5 = require$$0;
|
|
8974
|
-
const lazy_1$
|
|
8975
|
-
const base_1$
|
|
8984
|
+
const lazy_1$3 = lazy;
|
|
8985
|
+
const base_1$i = base;
|
|
8976
8986
|
const client_1 = client;
|
|
8977
8987
|
const connection_manager_1 = connectionManager;
|
|
8978
8988
|
const provider_1 = provider;
|
|
@@ -9003,7 +9013,7 @@ function retryDelay(count) {
|
|
|
9003
9013
|
* * {@link Channel.onChannelConnect onChannelConnect(listener)}
|
|
9004
9014
|
* * {@link Channel.onChannelDisconnect onChannelDisconnect(listener)}
|
|
9005
9015
|
*/
|
|
9006
|
-
class Channel extends base_1$
|
|
9016
|
+
class Channel extends base_1$i.EmitterBase {
|
|
9007
9017
|
/**
|
|
9008
9018
|
* @internal
|
|
9009
9019
|
*/
|
|
@@ -9012,17 +9022,17 @@ class Channel extends base_1$h.EmitterBase {
|
|
|
9012
9022
|
_Channel_connectionManager.set(this, void 0);
|
|
9013
9023
|
_Channel_internalEmitter.set(this, new events_1$5.EventEmitter());
|
|
9014
9024
|
// OpenFin API has not been injected at construction time, *must* wait for API to be ready.
|
|
9015
|
-
_Channel_readyToConnect.set(this, new lazy_1$
|
|
9025
|
+
_Channel_readyToConnect.set(this, new lazy_1$3.AsyncRetryableLazy(async () => {
|
|
9016
9026
|
await Promise.all([
|
|
9017
9027
|
this.on('disconnected', (eventPayload) => {
|
|
9018
9028
|
client_1.ChannelClient.handleProviderDisconnect(eventPayload);
|
|
9019
9029
|
}),
|
|
9020
9030
|
this.on('connected', (...args) => {
|
|
9021
|
-
__classPrivateFieldGet$
|
|
9031
|
+
__classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").emit('connected', ...args);
|
|
9022
9032
|
})
|
|
9023
9033
|
]).catch(() => new Error('error setting up channel connection listeners'));
|
|
9024
9034
|
}));
|
|
9025
|
-
__classPrivateFieldSet$
|
|
9035
|
+
__classPrivateFieldSet$a(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
|
|
9026
9036
|
}
|
|
9027
9037
|
/**
|
|
9028
9038
|
*
|
|
@@ -9097,7 +9107,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
|
9097
9107
|
resolve(true);
|
|
9098
9108
|
}
|
|
9099
9109
|
};
|
|
9100
|
-
__classPrivateFieldGet$
|
|
9110
|
+
__classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
|
|
9101
9111
|
});
|
|
9102
9112
|
try {
|
|
9103
9113
|
if (retryInfo.count > 0) {
|
|
@@ -9129,7 +9139,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
|
9129
9139
|
finally {
|
|
9130
9140
|
retryInfo.count += 1;
|
|
9131
9141
|
// in case of other errors, remove our listener
|
|
9132
|
-
__classPrivateFieldGet$
|
|
9142
|
+
__classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
|
|
9133
9143
|
}
|
|
9134
9144
|
} while (shouldWait); // If we're waiting we retry the above loop
|
|
9135
9145
|
// Should wait was false, no channel was found.
|
|
@@ -9188,12 +9198,12 @@ class Channel extends base_1$h.EmitterBase {
|
|
|
9188
9198
|
async connect(channelName, options = {}) {
|
|
9189
9199
|
// Make sure we don't connect before listeners are set up
|
|
9190
9200
|
// This also errors if we're not in OpenFin, ensuring we don't run unnecessary code
|
|
9191
|
-
await __classPrivateFieldGet$
|
|
9201
|
+
await __classPrivateFieldGet$b(this, _Channel_readyToConnect, "f").getValue();
|
|
9192
9202
|
if (!channelName || typeof channelName !== 'string') {
|
|
9193
9203
|
throw new Error('Please provide a channelName string to connect to a channel.');
|
|
9194
9204
|
}
|
|
9195
9205
|
const opts = { wait: true, ...this.wire.environment.getDefaultChannelOptions().connect, ...options };
|
|
9196
|
-
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$
|
|
9206
|
+
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createClientOffer(opts);
|
|
9197
9207
|
let connectionUrl;
|
|
9198
9208
|
if (this.fin.me.isFrame || this.fin.me.isView || this.fin.me.isWindow) {
|
|
9199
9209
|
connectionUrl = (await this.fin.me.getInfo()).url;
|
|
@@ -9205,7 +9215,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
|
9205
9215
|
connectionUrl
|
|
9206
9216
|
};
|
|
9207
9217
|
const routingInfo = await this.safeConnect(channelName, opts.wait, connectPayload);
|
|
9208
|
-
const strategy = await __classPrivateFieldGet$
|
|
9218
|
+
const strategy = await __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
|
|
9209
9219
|
const channel = new client_1.ChannelClient(routingInfo, () => client_1.ChannelClient.wireClose(this.wire, routingInfo, routingInfo.endpointId), strategy);
|
|
9210
9220
|
// It is the client's responsibility to handle endpoint disconnection to the provider.
|
|
9211
9221
|
// If the endpoint dies, the client will force a disconnection through the core.
|
|
@@ -9274,7 +9284,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
|
9274
9284
|
throw new Error('Please provide a channelName to create a channel');
|
|
9275
9285
|
}
|
|
9276
9286
|
const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
|
|
9277
|
-
const channel = __classPrivateFieldGet$
|
|
9287
|
+
const channel = __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
|
|
9278
9288
|
// TODO: fix typing (internal)
|
|
9279
9289
|
// @ts-expect-error
|
|
9280
9290
|
this.on('client-disconnected', (eventPayload) => {
|
|
@@ -9298,7 +9308,7 @@ interappbus.InterAppPayload = interappbus.InterApplicationBus = void 0;
|
|
|
9298
9308
|
* @packageDocumentation
|
|
9299
9309
|
*/
|
|
9300
9310
|
const events_1$4 = require$$0;
|
|
9301
|
-
const base_1$
|
|
9311
|
+
const base_1$h = base;
|
|
9302
9312
|
const ref_counter_1 = refCounter;
|
|
9303
9313
|
const index_1$2 = channel$1;
|
|
9304
9314
|
const validate_1$3 = validate;
|
|
@@ -9306,7 +9316,7 @@ const validate_1$3 = validate;
|
|
|
9306
9316
|
* A messaging bus that allows for pub/sub messaging between different applications.
|
|
9307
9317
|
*
|
|
9308
9318
|
*/
|
|
9309
|
-
class InterApplicationBus extends base_1$
|
|
9319
|
+
class InterApplicationBus extends base_1$h.Base {
|
|
9310
9320
|
/**
|
|
9311
9321
|
* @internal
|
|
9312
9322
|
*/
|
|
@@ -9512,12 +9522,12 @@ var clipboard = {};
|
|
|
9512
9522
|
*/
|
|
9513
9523
|
Object.defineProperty(clipboard, "__esModule", { value: true });
|
|
9514
9524
|
clipboard.Clipboard = void 0;
|
|
9515
|
-
const base_1$
|
|
9525
|
+
const base_1$g = base;
|
|
9516
9526
|
/**
|
|
9517
9527
|
* The Clipboard API allows reading and writing to the clipboard in multiple formats.
|
|
9518
9528
|
*
|
|
9519
9529
|
*/
|
|
9520
|
-
class Clipboard extends base_1$
|
|
9530
|
+
class Clipboard extends base_1$g.Base {
|
|
9521
9531
|
/**
|
|
9522
9532
|
* Writes data into the clipboard as plain text
|
|
9523
9533
|
* @param writeObj The object for writing data into the clipboard
|
|
@@ -9706,7 +9716,7 @@ var Instance$4 = {};
|
|
|
9706
9716
|
Object.defineProperty(Instance$4, "__esModule", { value: true });
|
|
9707
9717
|
Instance$4.ExternalApplication = void 0;
|
|
9708
9718
|
/* eslint-disable import/prefer-default-export */
|
|
9709
|
-
const base_1$
|
|
9719
|
+
const base_1$f = base;
|
|
9710
9720
|
/**
|
|
9711
9721
|
* An ExternalApplication object representing native language adapter connections to the runtime. Allows
|
|
9712
9722
|
* the developer to listen to {@link OpenFin.ExternalApplicationEvents external application events}.
|
|
@@ -9717,7 +9727,7 @@ const base_1$e = base;
|
|
|
9717
9727
|
* - Processes started via `System.launchExternalApplication`
|
|
9718
9728
|
* - Processes monitored via `System.monitorExternalProcess`
|
|
9719
9729
|
*/
|
|
9720
|
-
class ExternalApplication extends base_1$
|
|
9730
|
+
class ExternalApplication extends base_1$f.EmitterBase {
|
|
9721
9731
|
/**
|
|
9722
9732
|
* @internal
|
|
9723
9733
|
*/
|
|
@@ -9745,12 +9755,12 @@ Instance$4.ExternalApplication = ExternalApplication;
|
|
|
9745
9755
|
|
|
9746
9756
|
Object.defineProperty(Factory$5, "__esModule", { value: true });
|
|
9747
9757
|
Factory$5.ExternalApplicationModule = void 0;
|
|
9748
|
-
const base_1$
|
|
9758
|
+
const base_1$e = base;
|
|
9749
9759
|
const Instance_1$4 = Instance$4;
|
|
9750
9760
|
/**
|
|
9751
9761
|
* Static namespace for OpenFin API methods that interact with the {@link ExternalApplication} class, available under `fin.ExternalApplication`.
|
|
9752
9762
|
*/
|
|
9753
|
-
class ExternalApplicationModule extends base_1$
|
|
9763
|
+
class ExternalApplicationModule extends base_1$e.Base {
|
|
9754
9764
|
/**
|
|
9755
9765
|
* Asynchronously returns an External Application object that represents an external application.
|
|
9756
9766
|
* <br>It is possible to wrap a process that does not yet exist, (for example, to listen for startup-related events)
|
|
@@ -9832,7 +9842,7 @@ var Instance$3 = {};
|
|
|
9832
9842
|
Object.defineProperty(Instance$3, "__esModule", { value: true });
|
|
9833
9843
|
Instance$3._Frame = void 0;
|
|
9834
9844
|
/* eslint-disable import/prefer-default-export */
|
|
9835
|
-
const base_1$
|
|
9845
|
+
const base_1$d = base;
|
|
9836
9846
|
/**
|
|
9837
9847
|
* An iframe represents an embedded HTML page within a parent HTML page. Because this embedded page
|
|
9838
9848
|
* has its own DOM and global JS context (which may or may not be linked to that of the parent depending
|
|
@@ -9853,7 +9863,7 @@ const base_1$c = base;
|
|
|
9853
9863
|
* The fin.Frame namespace represents a way to interact with `iframes` and facilitates the discovery of current context
|
|
9854
9864
|
* (iframe or main window) as well as the ability to listen for {@link OpenFin.FrameEvents frame-specific events}.
|
|
9855
9865
|
*/
|
|
9856
|
-
class _Frame extends base_1$
|
|
9866
|
+
class _Frame extends base_1$d.EmitterBase {
|
|
9857
9867
|
/**
|
|
9858
9868
|
* @internal
|
|
9859
9869
|
*/
|
|
@@ -9899,13 +9909,13 @@ Instance$3._Frame = _Frame;
|
|
|
9899
9909
|
|
|
9900
9910
|
Object.defineProperty(Factory$4, "__esModule", { value: true });
|
|
9901
9911
|
Factory$4._FrameModule = void 0;
|
|
9902
|
-
const base_1$
|
|
9912
|
+
const base_1$c = base;
|
|
9903
9913
|
const validate_1$2 = validate;
|
|
9904
9914
|
const Instance_1$3 = Instance$3;
|
|
9905
9915
|
/**
|
|
9906
9916
|
* Static namespace for OpenFin API methods that interact with the {@link _Frame} class, available under `fin.Frame`.
|
|
9907
9917
|
*/
|
|
9908
|
-
class _FrameModule extends base_1$
|
|
9918
|
+
class _FrameModule extends base_1$c.Base {
|
|
9909
9919
|
/**
|
|
9910
9920
|
* Asynchronously returns an API handle for the given Frame identity.
|
|
9911
9921
|
*
|
|
@@ -10026,12 +10036,12 @@ var globalHotkey = {};
|
|
|
10026
10036
|
|
|
10027
10037
|
Object.defineProperty(globalHotkey, "__esModule", { value: true });
|
|
10028
10038
|
globalHotkey.GlobalHotkey = void 0;
|
|
10029
|
-
const base_1$
|
|
10039
|
+
const base_1$b = base;
|
|
10030
10040
|
/**
|
|
10031
10041
|
* The GlobalHotkey module can register/unregister a global hotkeys.
|
|
10032
10042
|
*
|
|
10033
10043
|
*/
|
|
10034
|
-
class GlobalHotkey extends base_1$
|
|
10044
|
+
class GlobalHotkey extends base_1$b.EmitterBase {
|
|
10035
10045
|
/**
|
|
10036
10046
|
* @internal
|
|
10037
10047
|
*/
|
|
@@ -10165,13 +10175,13 @@ var Factory$3 = {};
|
|
|
10165
10175
|
|
|
10166
10176
|
var Instance$2 = {};
|
|
10167
10177
|
|
|
10168
|
-
var __classPrivateFieldSet$
|
|
10178
|
+
var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
10169
10179
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
10170
10180
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10171
10181
|
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");
|
|
10172
10182
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
10173
10183
|
};
|
|
10174
|
-
var __classPrivateFieldGet$
|
|
10184
|
+
var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
10175
10185
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10176
10186
|
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");
|
|
10177
10187
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -10180,14 +10190,14 @@ var _Platform_channelName, _Platform_connectToProvider;
|
|
|
10180
10190
|
Object.defineProperty(Instance$2, "__esModule", { value: true });
|
|
10181
10191
|
Instance$2.Platform = void 0;
|
|
10182
10192
|
/* eslint-disable import/prefer-default-export, no-undef */
|
|
10183
|
-
const base_1$
|
|
10193
|
+
const base_1$a = base;
|
|
10184
10194
|
const validate_1$1 = validate;
|
|
10185
10195
|
/** Manages the life cycle of windows and views in the application.
|
|
10186
10196
|
*
|
|
10187
10197
|
* Enables taking snapshots of itself and applying them to restore a previous configuration
|
|
10188
10198
|
* as well as listen to {@link OpenFin.PlatformEvents platform events}.
|
|
10189
10199
|
*/
|
|
10190
|
-
class Platform extends base_1$
|
|
10200
|
+
class Platform extends base_1$a.EmitterBase {
|
|
10191
10201
|
/**
|
|
10192
10202
|
* @internal
|
|
10193
10203
|
*/
|
|
@@ -10208,24 +10218,24 @@ class Platform extends base_1$9.EmitterBase {
|
|
|
10208
10218
|
this.wire.sendAction('platform-get-client', this.identity).catch((e) => {
|
|
10209
10219
|
// don't expose
|
|
10210
10220
|
});
|
|
10211
|
-
if (!Platform.clientMap.has(__classPrivateFieldGet$
|
|
10212
|
-
const clientPromise = __classPrivateFieldGet$
|
|
10213
|
-
Platform.clientMap.set(__classPrivateFieldGet$
|
|
10221
|
+
if (!Platform.clientMap.has(__classPrivateFieldGet$a(this, _Platform_channelName, "f"))) {
|
|
10222
|
+
const clientPromise = __classPrivateFieldGet$a(this, _Platform_connectToProvider, "f").call(this);
|
|
10223
|
+
Platform.clientMap.set(__classPrivateFieldGet$a(this, _Platform_channelName, "f"), clientPromise);
|
|
10214
10224
|
}
|
|
10215
10225
|
// we set it above
|
|
10216
10226
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
10217
|
-
return Platform.clientMap.get(__classPrivateFieldGet$
|
|
10227
|
+
return Platform.clientMap.get(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
|
|
10218
10228
|
};
|
|
10219
10229
|
_Platform_connectToProvider.set(this, async () => {
|
|
10220
10230
|
try {
|
|
10221
|
-
const client = await this._channel.connect(__classPrivateFieldGet$
|
|
10231
|
+
const client = await this._channel.connect(__classPrivateFieldGet$a(this, _Platform_channelName, "f"), { wait: false });
|
|
10222
10232
|
client.onDisconnection(() => {
|
|
10223
|
-
Platform.clientMap.delete(__classPrivateFieldGet$
|
|
10233
|
+
Platform.clientMap.delete(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
|
|
10224
10234
|
});
|
|
10225
10235
|
return client;
|
|
10226
10236
|
}
|
|
10227
10237
|
catch (e) {
|
|
10228
|
-
Platform.clientMap.delete(__classPrivateFieldGet$
|
|
10238
|
+
Platform.clientMap.delete(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
|
|
10229
10239
|
throw new Error('The targeted Platform is not currently running. Listen for application-started event for the given Uuid.');
|
|
10230
10240
|
}
|
|
10231
10241
|
});
|
|
@@ -10238,7 +10248,7 @@ class Platform extends base_1$9.EmitterBase {
|
|
|
10238
10248
|
if (errorMsg) {
|
|
10239
10249
|
throw new Error(errorMsg);
|
|
10240
10250
|
}
|
|
10241
|
-
__classPrivateFieldSet$
|
|
10251
|
+
__classPrivateFieldSet$9(this, _Platform_channelName, channelName, "f");
|
|
10242
10252
|
this._channel = this.fin.InterApplicationBus.Channel;
|
|
10243
10253
|
this.identity = { uuid: identity.uuid };
|
|
10244
10254
|
this.Layout = this.fin.Platform.Layout;
|
|
@@ -11294,13 +11304,13 @@ const createRelayedDispatch = (client, target, relayId, relayErrorMsg) => async
|
|
|
11294
11304
|
};
|
|
11295
11305
|
channelApiRelay.createRelayedDispatch = createRelayedDispatch;
|
|
11296
11306
|
|
|
11297
|
-
var __classPrivateFieldSet$
|
|
11307
|
+
var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
11298
11308
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
11299
11309
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
11300
11310
|
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");
|
|
11301
11311
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11302
11312
|
};
|
|
11303
|
-
var __classPrivateFieldGet$
|
|
11313
|
+
var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
11304
11314
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
11305
11315
|
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");
|
|
11306
11316
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -11354,7 +11364,7 @@ class LayoutNode {
|
|
|
11354
11364
|
* console.log(`The parent ColumnOrRow is root: ${parentIsRoot}`);
|
|
11355
11365
|
* ```
|
|
11356
11366
|
*/
|
|
11357
|
-
this.isRoot = () => __classPrivateFieldGet$
|
|
11367
|
+
this.isRoot = () => __classPrivateFieldGet$9(this, _LayoutNode_client, "f").isRoot(this.entityId);
|
|
11358
11368
|
/**
|
|
11359
11369
|
* Checks if the TabStack or ColumnOrRow exists
|
|
11360
11370
|
*
|
|
@@ -11374,7 +11384,7 @@ class LayoutNode {
|
|
|
11374
11384
|
* console.log(`The entity exists: ${exists}`);
|
|
11375
11385
|
* ```
|
|
11376
11386
|
*/
|
|
11377
|
-
this.exists = () => __classPrivateFieldGet$
|
|
11387
|
+
this.exists = () => __classPrivateFieldGet$9(this, _LayoutNode_client, "f").exists(this.entityId);
|
|
11378
11388
|
/**
|
|
11379
11389
|
* Retrieves the parent of the TabStack or ColumnOrRow
|
|
11380
11390
|
*
|
|
@@ -11395,11 +11405,11 @@ class LayoutNode {
|
|
|
11395
11405
|
* ```
|
|
11396
11406
|
*/
|
|
11397
11407
|
this.getParent = async () => {
|
|
11398
|
-
const parent = await __classPrivateFieldGet$
|
|
11408
|
+
const parent = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").getParent(this.entityId);
|
|
11399
11409
|
if (!parent) {
|
|
11400
11410
|
return undefined;
|
|
11401
11411
|
}
|
|
11402
|
-
return LayoutNode.getEntity(parent, __classPrivateFieldGet$
|
|
11412
|
+
return LayoutNode.getEntity(parent, __classPrivateFieldGet$9(this, _LayoutNode_client, "f"));
|
|
11403
11413
|
};
|
|
11404
11414
|
/**
|
|
11405
11415
|
* Creates a new TabStack adjacent to the given TabStack or ColumnOrRow. Inputs can be new views to create, or existing views.
|
|
@@ -11450,8 +11460,8 @@ class LayoutNode {
|
|
|
11450
11460
|
* @experimental
|
|
11451
11461
|
*/
|
|
11452
11462
|
this.createAdjacentStack = async (views, options) => {
|
|
11453
|
-
const entityId = await __classPrivateFieldGet$
|
|
11454
|
-
return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet$
|
|
11463
|
+
const entityId = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").createAdjacentStack(this.entityId, views, options);
|
|
11464
|
+
return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet$9(this, _LayoutNode_client, "f"));
|
|
11455
11465
|
};
|
|
11456
11466
|
/**
|
|
11457
11467
|
* Retrieves the adjacent TabStacks of the given TabStack or ColumnOrRow.
|
|
@@ -11479,16 +11489,16 @@ class LayoutNode {
|
|
|
11479
11489
|
* @experimental
|
|
11480
11490
|
*/
|
|
11481
11491
|
this.getAdjacentStacks = async (edge) => {
|
|
11482
|
-
const adjacentStacks = await __classPrivateFieldGet$
|
|
11492
|
+
const adjacentStacks = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").getAdjacentStacks({
|
|
11483
11493
|
targetId: this.entityId,
|
|
11484
11494
|
edge
|
|
11485
11495
|
});
|
|
11486
11496
|
return adjacentStacks.map((stack) => LayoutNode.getEntity({
|
|
11487
11497
|
type: 'stack',
|
|
11488
11498
|
entityId: stack.entityId
|
|
11489
|
-
}, __classPrivateFieldGet$
|
|
11499
|
+
}, __classPrivateFieldGet$9(this, _LayoutNode_client, "f")));
|
|
11490
11500
|
};
|
|
11491
|
-
__classPrivateFieldSet$
|
|
11501
|
+
__classPrivateFieldSet$8(this, _LayoutNode_client, client, "f");
|
|
11492
11502
|
this.entityId = entityId;
|
|
11493
11503
|
}
|
|
11494
11504
|
}
|
|
@@ -11561,7 +11571,7 @@ class TabStack extends LayoutNode {
|
|
|
11561
11571
|
* ```
|
|
11562
11572
|
* @experimental
|
|
11563
11573
|
*/
|
|
11564
|
-
this.getViews = () => __classPrivateFieldGet$
|
|
11574
|
+
this.getViews = () => __classPrivateFieldGet$9(this, _TabStack_client, "f").getStackViews(this.entityId);
|
|
11565
11575
|
/**
|
|
11566
11576
|
* Adds or creates a view in this {@link TabStack}.
|
|
11567
11577
|
*
|
|
@@ -11591,7 +11601,7 @@ class TabStack extends LayoutNode {
|
|
|
11591
11601
|
* ```
|
|
11592
11602
|
* @experimental
|
|
11593
11603
|
*/
|
|
11594
|
-
this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet$
|
|
11604
|
+
this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet$9(this, _TabStack_client, "f").addViewToStack(this.entityId, view, options);
|
|
11595
11605
|
/**
|
|
11596
11606
|
* Removes a view from this {@link TabStack}.
|
|
11597
11607
|
*
|
|
@@ -11621,7 +11631,7 @@ class TabStack extends LayoutNode {
|
|
|
11621
11631
|
* ```
|
|
11622
11632
|
*/
|
|
11623
11633
|
this.removeView = async (view) => {
|
|
11624
|
-
await __classPrivateFieldGet$
|
|
11634
|
+
await __classPrivateFieldGet$9(this, _TabStack_client, "f").removeViewFromStack(this.entityId, view);
|
|
11625
11635
|
};
|
|
11626
11636
|
/**
|
|
11627
11637
|
* Sets the active view of the {@link TabStack} without focusing it.
|
|
@@ -11645,9 +11655,9 @@ class TabStack extends LayoutNode {
|
|
|
11645
11655
|
* @experimental
|
|
11646
11656
|
*/
|
|
11647
11657
|
this.setActiveView = async (view) => {
|
|
11648
|
-
await __classPrivateFieldGet$
|
|
11658
|
+
await __classPrivateFieldGet$9(this, _TabStack_client, "f").setStackActiveView(this.entityId, view);
|
|
11649
11659
|
};
|
|
11650
|
-
__classPrivateFieldSet$
|
|
11660
|
+
__classPrivateFieldSet$8(this, _TabStack_client, client, "f");
|
|
11651
11661
|
}
|
|
11652
11662
|
}
|
|
11653
11663
|
layoutEntities.TabStack = TabStack;
|
|
@@ -11686,10 +11696,10 @@ class ColumnOrRow extends LayoutNode {
|
|
|
11686
11696
|
* ```
|
|
11687
11697
|
*/
|
|
11688
11698
|
this.getContent = async () => {
|
|
11689
|
-
const contentItemEntities = await __classPrivateFieldGet$
|
|
11690
|
-
return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet$
|
|
11699
|
+
const contentItemEntities = await __classPrivateFieldGet$9(this, _ColumnOrRow_client, "f").getContent(this.entityId);
|
|
11700
|
+
return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet$9(this, _ColumnOrRow_client, "f")));
|
|
11691
11701
|
};
|
|
11692
|
-
__classPrivateFieldSet$
|
|
11702
|
+
__classPrivateFieldSet$8(this, _ColumnOrRow_client, client, "f");
|
|
11693
11703
|
this.type = type;
|
|
11694
11704
|
}
|
|
11695
11705
|
}
|
|
@@ -11704,7 +11714,7 @@ layout_constants.LAYOUT_CONTROLLER_ID = 'layout-entities';
|
|
|
11704
11714
|
// TODO: eventually export this somehow
|
|
11705
11715
|
layout_constants.DEFAULT_LAYOUT_KEY = '__default__';
|
|
11706
11716
|
|
|
11707
|
-
var __classPrivateFieldGet$
|
|
11717
|
+
var __classPrivateFieldGet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
11708
11718
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
11709
11719
|
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");
|
|
11710
11720
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -11712,9 +11722,9 @@ var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
11712
11722
|
var _Layout_instances, _Layout_layoutClient, _Layout_forwardLayoutAction;
|
|
11713
11723
|
Object.defineProperty(Instance$1, "__esModule", { value: true });
|
|
11714
11724
|
Instance$1.Layout = void 0;
|
|
11715
|
-
const lazy_1$
|
|
11725
|
+
const lazy_1$2 = lazy;
|
|
11716
11726
|
const validate_1 = validate;
|
|
11717
|
-
const base_1$
|
|
11727
|
+
const base_1$9 = base;
|
|
11718
11728
|
const common_utils_1$1 = commonUtils;
|
|
11719
11729
|
const layout_entities_1 = layoutEntities;
|
|
11720
11730
|
const layout_constants_1$1 = layout_constants;
|
|
@@ -11850,12 +11860,12 @@ const layout_constants_1$1 = layout_constants;
|
|
|
11850
11860
|
* }
|
|
11851
11861
|
* ```
|
|
11852
11862
|
*/
|
|
11853
|
-
class Layout extends base_1$
|
|
11863
|
+
class Layout extends base_1$9.Base {
|
|
11854
11864
|
/**
|
|
11855
11865
|
* @internal
|
|
11856
11866
|
*/
|
|
11857
11867
|
static getClient(layout) {
|
|
11858
|
-
return __classPrivateFieldGet$
|
|
11868
|
+
return __classPrivateFieldGet$8(layout, _Layout_layoutClient, "f").getValue();
|
|
11859
11869
|
}
|
|
11860
11870
|
/**
|
|
11861
11871
|
* @internal
|
|
@@ -11869,7 +11879,7 @@ class Layout extends base_1$8.Base {
|
|
|
11869
11879
|
* Lazily constructed {@link LayoutEntitiesClient} bound to this platform's client and identity
|
|
11870
11880
|
* The client is for {@link LayoutEntitiesController}
|
|
11871
11881
|
*/
|
|
11872
|
-
_Layout_layoutClient.set(this, new lazy_1$
|
|
11882
|
+
_Layout_layoutClient.set(this, new lazy_1$2.Lazy(async () => layout_entities_1.LayoutNode.newLayoutEntitiesClient(await this.platform.getClient(), layout_constants_1$1.LAYOUT_CONTROLLER_ID, this.identity)));
|
|
11873
11883
|
/**
|
|
11874
11884
|
* Replaces a Platform window's layout with a new layout.
|
|
11875
11885
|
*
|
|
@@ -12078,7 +12088,7 @@ class Layout extends base_1$8.Base {
|
|
|
12078
12088
|
this.wire.sendAction('layout-get-root-item').catch(() => {
|
|
12079
12089
|
// don't expose
|
|
12080
12090
|
});
|
|
12081
|
-
const client = await __classPrivateFieldGet$
|
|
12091
|
+
const client = await __classPrivateFieldGet$8(this, _Layout_layoutClient, "f").getValue();
|
|
12082
12092
|
const root = await client.getRoot('layoutName' in this.identity ? this.identity : undefined);
|
|
12083
12093
|
return layout_entities_1.LayoutNode.getEntity(root, client);
|
|
12084
12094
|
}
|
|
@@ -12096,7 +12106,7 @@ class Layout extends base_1$8.Base {
|
|
|
12096
12106
|
this.wire.sendAction('layout-get-stack-by-view').catch(() => {
|
|
12097
12107
|
// don't expose
|
|
12098
12108
|
});
|
|
12099
|
-
const client = await __classPrivateFieldGet$
|
|
12109
|
+
const client = await __classPrivateFieldGet$8(this, _Layout_layoutClient, "f").getValue();
|
|
12100
12110
|
const stack = await client.getStackByView(identity);
|
|
12101
12111
|
if (!stack) {
|
|
12102
12112
|
throw new Error(`No stack found for view: ${identity.uuid}/${identity.name}`);
|
|
@@ -12116,7 +12126,7 @@ class Layout extends base_1$8.Base {
|
|
|
12116
12126
|
this.wire.sendAction('layout-add-view').catch((e) => {
|
|
12117
12127
|
// don't expose
|
|
12118
12128
|
});
|
|
12119
|
-
const { identity } = await __classPrivateFieldGet$
|
|
12129
|
+
const { identity } = await __classPrivateFieldGet$8(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-add-view', {
|
|
12120
12130
|
viewOptions,
|
|
12121
12131
|
location,
|
|
12122
12132
|
targetView
|
|
@@ -12134,7 +12144,7 @@ class Layout extends base_1$8.Base {
|
|
|
12134
12144
|
this.wire.sendAction('layout-close-view').catch((e) => {
|
|
12135
12145
|
// don't expose
|
|
12136
12146
|
});
|
|
12137
|
-
await __classPrivateFieldGet$
|
|
12147
|
+
await __classPrivateFieldGet$8(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-close-view', { viewIdentity });
|
|
12138
12148
|
}
|
|
12139
12149
|
}
|
|
12140
12150
|
Instance$1.Layout = Layout;
|
|
@@ -12148,12 +12158,12 @@ async function _Layout_forwardLayoutAction(action, payload) {
|
|
|
12148
12158
|
return client.dispatch(action, { target: this.identity, opts: payload });
|
|
12149
12159
|
};
|
|
12150
12160
|
|
|
12151
|
-
var __classPrivateFieldGet$
|
|
12161
|
+
var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12152
12162
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
12153
12163
|
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");
|
|
12154
12164
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12155
12165
|
};
|
|
12156
|
-
var __classPrivateFieldSet$
|
|
12166
|
+
var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12157
12167
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
12158
12168
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
12159
12169
|
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");
|
|
@@ -12162,13 +12172,13 @@ var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
12162
12172
|
var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_getLayoutManagerSpy, _LayoutModule_getSafeLayoutManager;
|
|
12163
12173
|
Object.defineProperty(Factory$2, "__esModule", { value: true });
|
|
12164
12174
|
Factory$2.LayoutModule = void 0;
|
|
12165
|
-
const base_1$
|
|
12175
|
+
const base_1$8 = base;
|
|
12166
12176
|
const Instance_1$2 = Instance$1;
|
|
12167
12177
|
const layout_constants_1 = layout_constants;
|
|
12168
12178
|
/**
|
|
12169
12179
|
* Static namespace for OpenFin API methods that interact with the {@link Layout} class, available under `fin.Platform.Layout`.
|
|
12170
12180
|
*/
|
|
12171
|
-
class LayoutModule extends base_1$
|
|
12181
|
+
class LayoutModule extends base_1$8.Base {
|
|
12172
12182
|
constructor() {
|
|
12173
12183
|
super(...arguments);
|
|
12174
12184
|
_LayoutModule_instances.add(this);
|
|
@@ -12219,23 +12229,23 @@ class LayoutModule extends base_1$7.Base {
|
|
|
12219
12229
|
if (!this.wire.environment.layoutAllowedInContext(this.fin)) {
|
|
12220
12230
|
throw new Error('Layout.init can only be called from a Window context.');
|
|
12221
12231
|
}
|
|
12222
|
-
if (__classPrivateFieldGet$
|
|
12232
|
+
if (__classPrivateFieldGet$7(this, _LayoutModule_layoutInitializationAttempted, "f")) {
|
|
12223
12233
|
throw new Error('Layout.init was already called, please use Layout.create to add additional layouts.');
|
|
12224
12234
|
}
|
|
12225
12235
|
if (this.wire.environment.type === 'openfin') {
|
|
12226
12236
|
// preload the client
|
|
12227
12237
|
await this.fin.Platform.getCurrentSync().getClient();
|
|
12228
12238
|
}
|
|
12229
|
-
__classPrivateFieldSet$
|
|
12239
|
+
__classPrivateFieldSet$7(this, _LayoutModule_layoutInitializationAttempted, true, "f");
|
|
12230
12240
|
// TODO: rename to createLayoutManager
|
|
12231
|
-
__classPrivateFieldSet$
|
|
12232
|
-
await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$
|
|
12241
|
+
__classPrivateFieldSet$7(this, _LayoutModule_layoutManager, await this.wire.environment.initLayoutManager(this.fin, this.wire, options), "f");
|
|
12242
|
+
await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f"), options);
|
|
12233
12243
|
const meIdentity = { name: this.fin.me.name, uuid: this.fin.me.uuid };
|
|
12234
12244
|
if (!options.layoutManagerOverride) {
|
|
12235
12245
|
// CORE-1081 to be removed when we actually delete the `layoutManager` prop
|
|
12236
12246
|
// in single-layout case, we return the undocumented layoutManager type
|
|
12237
12247
|
const layoutIdentity = { layoutName: layout_constants_1.DEFAULT_LAYOUT_KEY, ...meIdentity };
|
|
12238
|
-
return __classPrivateFieldGet$
|
|
12248
|
+
return __classPrivateFieldGet$7(this, _LayoutModule_getLayoutManagerSpy, "f").call(this, layoutIdentity);
|
|
12239
12249
|
}
|
|
12240
12250
|
return this.wrapSync(meIdentity);
|
|
12241
12251
|
};
|
|
@@ -12264,13 +12274,13 @@ class LayoutModule extends base_1$7.Base {
|
|
|
12264
12274
|
* @returns
|
|
12265
12275
|
*/
|
|
12266
12276
|
this.getCurrentLayoutManagerSync = () => {
|
|
12267
|
-
return __classPrivateFieldGet$
|
|
12277
|
+
return __classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.getCurrentLayoutManagerSync()`);
|
|
12268
12278
|
};
|
|
12269
12279
|
this.create = async (options) => {
|
|
12270
|
-
return this.wire.environment.createLayout(__classPrivateFieldGet$
|
|
12280
|
+
return this.wire.environment.createLayout(__classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.create()`), options);
|
|
12271
12281
|
};
|
|
12272
12282
|
this.destroy = async (layoutIdentity) => {
|
|
12273
|
-
return this.wire.environment.destroyLayout(__classPrivateFieldGet$
|
|
12283
|
+
return this.wire.environment.destroyLayout(__classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.destroy()`), layoutIdentity);
|
|
12274
12284
|
};
|
|
12275
12285
|
}
|
|
12276
12286
|
/**
|
|
@@ -12411,10 +12421,10 @@ class LayoutModule extends base_1$7.Base {
|
|
|
12411
12421
|
}
|
|
12412
12422
|
Factory$2.LayoutModule = LayoutModule;
|
|
12413
12423
|
_LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_getLayoutManagerSpy = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
|
|
12414
|
-
if (!__classPrivateFieldGet$
|
|
12424
|
+
if (!__classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f")) {
|
|
12415
12425
|
throw new Error(`You must call init before using the API ${method}`);
|
|
12416
12426
|
}
|
|
12417
|
-
return __classPrivateFieldGet$
|
|
12427
|
+
return __classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f");
|
|
12418
12428
|
};
|
|
12419
12429
|
|
|
12420
12430
|
(function (exports) {
|
|
@@ -12451,13 +12461,13 @@ _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layou
|
|
|
12451
12461
|
|
|
12452
12462
|
Object.defineProperty(Factory$3, "__esModule", { value: true });
|
|
12453
12463
|
Factory$3.PlatformModule = void 0;
|
|
12454
|
-
const base_1$
|
|
12464
|
+
const base_1$7 = base;
|
|
12455
12465
|
const Instance_1$1 = Instance$2;
|
|
12456
12466
|
const index_1$1 = layout;
|
|
12457
12467
|
/**
|
|
12458
12468
|
* Static namespace for OpenFin API methods that interact with the {@link Platform} class, available under `fin.Platform`.
|
|
12459
12469
|
*/
|
|
12460
|
-
class PlatformModule extends base_1$
|
|
12470
|
+
class PlatformModule extends base_1$7.Base {
|
|
12461
12471
|
/**
|
|
12462
12472
|
* @internal
|
|
12463
12473
|
*/
|
|
@@ -13377,13 +13387,13 @@ class PrivateChannelProvider {
|
|
|
13377
13387
|
}
|
|
13378
13388
|
PrivateChannelProvider$1.PrivateChannelProvider = PrivateChannelProvider;
|
|
13379
13389
|
|
|
13380
|
-
var __classPrivateFieldSet$
|
|
13390
|
+
var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
13381
13391
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
13382
13392
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
13383
13393
|
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");
|
|
13384
13394
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
13385
13395
|
};
|
|
13386
|
-
var __classPrivateFieldGet$
|
|
13396
|
+
var __classPrivateFieldGet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
13387
13397
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13388
13398
|
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");
|
|
13389
13399
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -13394,12 +13404,12 @@ var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || fu
|
|
|
13394
13404
|
var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
|
|
13395
13405
|
Object.defineProperty(InteropBroker$1, "__esModule", { value: true });
|
|
13396
13406
|
InteropBroker$1.InteropBroker = void 0;
|
|
13397
|
-
const base_1$
|
|
13407
|
+
const base_1$6 = base;
|
|
13398
13408
|
const SessionContextGroupBroker_1 = __importDefault$4(SessionContextGroupBroker$1);
|
|
13399
13409
|
const utils_1$7 = utils$3;
|
|
13400
13410
|
const isEqual_1$1 = __importDefault$4(require$$3);
|
|
13401
13411
|
const PrivateChannelProvider_1 = PrivateChannelProvider$1;
|
|
13402
|
-
const lazy_1 = lazy;
|
|
13412
|
+
const lazy_1$1 = lazy;
|
|
13403
13413
|
const defaultContextGroups = [
|
|
13404
13414
|
{
|
|
13405
13415
|
id: 'green',
|
|
@@ -13563,7 +13573,7 @@ const defaultContextGroups = [
|
|
|
13563
13573
|
* ---
|
|
13564
13574
|
*
|
|
13565
13575
|
*/
|
|
13566
|
-
class InteropBroker extends base_1$
|
|
13576
|
+
class InteropBroker extends base_1$6.Base {
|
|
13567
13577
|
/**
|
|
13568
13578
|
* @internal
|
|
13569
13579
|
*/
|
|
@@ -13574,19 +13584,19 @@ class InteropBroker extends base_1$5.Base {
|
|
|
13574
13584
|
_InteropBroker_contextGroups.set(this, void 0);
|
|
13575
13585
|
_InteropBroker_providerPromise.set(this, void 0);
|
|
13576
13586
|
this.getProvider = () => {
|
|
13577
|
-
return __classPrivateFieldGet$
|
|
13587
|
+
return __classPrivateFieldGet$6(this, _InteropBroker_providerPromise, "f").getValue();
|
|
13578
13588
|
};
|
|
13579
13589
|
this.interopClients = new Map();
|
|
13580
13590
|
this.contextGroupsById = new Map();
|
|
13581
|
-
__classPrivateFieldSet$
|
|
13582
|
-
__classPrivateFieldSet$
|
|
13591
|
+
__classPrivateFieldSet$6(this, _InteropBroker_contextGroups, options.contextGroups ?? [...defaultContextGroups], "f");
|
|
13592
|
+
__classPrivateFieldSet$6(this, _InteropBroker_fdc3Info, options.fdc3Info, "f");
|
|
13583
13593
|
if (options?.logging) {
|
|
13584
13594
|
this.logging = options.logging;
|
|
13585
13595
|
}
|
|
13586
13596
|
this.intentClientMap = new Map();
|
|
13587
13597
|
this.lastContextMap = new Map();
|
|
13588
13598
|
this.sessionContextGroupMap = new Map();
|
|
13589
|
-
__classPrivateFieldSet$
|
|
13599
|
+
__classPrivateFieldSet$6(this, _InteropBroker_providerPromise, new lazy_1$1.Lazy(createProvider), "f");
|
|
13590
13600
|
this.setContextGroupMap();
|
|
13591
13601
|
this.setupChannelProvider();
|
|
13592
13602
|
}
|
|
@@ -13854,7 +13864,7 @@ class InteropBroker extends base_1$5.Base {
|
|
|
13854
13864
|
// don't expose, analytics-only call
|
|
13855
13865
|
});
|
|
13856
13866
|
// Create copy for immutability
|
|
13857
|
-
return __classPrivateFieldGet$
|
|
13867
|
+
return __classPrivateFieldGet$6(this, _InteropBroker_contextGroups, "f").map((contextGroup) => {
|
|
13858
13868
|
return { ...contextGroup };
|
|
13859
13869
|
});
|
|
13860
13870
|
}
|
|
@@ -14265,7 +14275,7 @@ class InteropBroker extends base_1$5.Base {
|
|
|
14265
14275
|
const { fdc3Version } = payload;
|
|
14266
14276
|
return {
|
|
14267
14277
|
fdc3Version,
|
|
14268
|
-
...__classPrivateFieldGet$
|
|
14278
|
+
...__classPrivateFieldGet$6(this, _InteropBroker_fdc3Info, "f"),
|
|
14269
14279
|
optionalFeatures: {
|
|
14270
14280
|
OriginatingAppMetadata: false,
|
|
14271
14281
|
UserChannelMembershipAPIs: true
|
|
@@ -14642,27 +14652,27 @@ var InteropClient$1 = {};
|
|
|
14642
14652
|
|
|
14643
14653
|
var SessionContextGroupClient$1 = {};
|
|
14644
14654
|
|
|
14645
|
-
var __classPrivateFieldSet$
|
|
14655
|
+
var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
14646
14656
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
14647
14657
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
14648
14658
|
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");
|
|
14649
14659
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
14650
14660
|
};
|
|
14651
|
-
var __classPrivateFieldGet$
|
|
14661
|
+
var __classPrivateFieldGet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
14652
14662
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
14653
14663
|
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");
|
|
14654
14664
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
14655
14665
|
};
|
|
14656
14666
|
var _SessionContextGroupClient_clientPromise;
|
|
14657
14667
|
Object.defineProperty(SessionContextGroupClient$1, "__esModule", { value: true });
|
|
14658
|
-
const base_1$
|
|
14668
|
+
const base_1$5 = base;
|
|
14659
14669
|
const utils_1$6 = utils$3;
|
|
14660
|
-
class SessionContextGroupClient extends base_1$
|
|
14670
|
+
class SessionContextGroupClient extends base_1$5.Base {
|
|
14661
14671
|
constructor(wire, client, id) {
|
|
14662
14672
|
super(wire);
|
|
14663
14673
|
_SessionContextGroupClient_clientPromise.set(this, void 0);
|
|
14664
14674
|
this.id = id;
|
|
14665
|
-
__classPrivateFieldSet$
|
|
14675
|
+
__classPrivateFieldSet$5(this, _SessionContextGroupClient_clientPromise, client, "f");
|
|
14666
14676
|
}
|
|
14667
14677
|
/**
|
|
14668
14678
|
* Sets a context for the session context group.
|
|
@@ -14674,7 +14684,7 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
|
14674
14684
|
this.wire.sendAction('interop-session-context-group-set-context').catch((e) => {
|
|
14675
14685
|
// don't expose, analytics-only call
|
|
14676
14686
|
});
|
|
14677
|
-
const client = await __classPrivateFieldGet$
|
|
14687
|
+
const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
|
|
14678
14688
|
return client.dispatch(`sessionContextGroup:setContext-${this.id}`, {
|
|
14679
14689
|
sessionContextGroupId: this.id,
|
|
14680
14690
|
context
|
|
@@ -14684,7 +14694,7 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
|
14684
14694
|
this.wire.sendAction('interop-session-context-group-get-context').catch((e) => {
|
|
14685
14695
|
// don't expose, analytics-only call
|
|
14686
14696
|
});
|
|
14687
|
-
const client = await __classPrivateFieldGet$
|
|
14697
|
+
const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
|
|
14688
14698
|
return client.dispatch(`sessionContextGroup:getContext-${this.id}`, {
|
|
14689
14699
|
sessionContextGroupId: this.id,
|
|
14690
14700
|
type
|
|
@@ -14697,7 +14707,7 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
|
14697
14707
|
if (typeof contextHandler !== 'function') {
|
|
14698
14708
|
throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
|
|
14699
14709
|
}
|
|
14700
|
-
const client = await __classPrivateFieldGet$
|
|
14710
|
+
const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
|
|
14701
14711
|
let handlerId;
|
|
14702
14712
|
if (contextType) {
|
|
14703
14713
|
handlerId = `sessionContextHandler:invoke-${this.id}-${contextType}-${(0, utils_1$6.generateId)()}`;
|
|
@@ -14710,7 +14720,7 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
|
14710
14720
|
return { unsubscribe: await this.createUnsubscribeCb(handlerId) };
|
|
14711
14721
|
}
|
|
14712
14722
|
async createUnsubscribeCb(handlerId) {
|
|
14713
|
-
const client = await __classPrivateFieldGet$
|
|
14723
|
+
const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
|
|
14714
14724
|
return async () => {
|
|
14715
14725
|
client.remove(handlerId);
|
|
14716
14726
|
await client.dispatch(`sessionContextGroup:handlerRemoved-${this.id}`, { handlerId });
|
|
@@ -14728,13 +14738,13 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
|
14728
14738
|
SessionContextGroupClient$1.default = SessionContextGroupClient;
|
|
14729
14739
|
_SessionContextGroupClient_clientPromise = new WeakMap();
|
|
14730
14740
|
|
|
14731
|
-
var __classPrivateFieldSet$
|
|
14741
|
+
var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
14732
14742
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
14733
14743
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
14734
14744
|
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");
|
|
14735
14745
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
14736
14746
|
};
|
|
14737
|
-
var __classPrivateFieldGet$
|
|
14747
|
+
var __classPrivateFieldGet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
14738
14748
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
14739
14749
|
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");
|
|
14740
14750
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -14745,7 +14755,7 @@ var __importDefault$3 = (commonjsGlobal && commonjsGlobal.__importDefault) || fu
|
|
|
14745
14755
|
var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory;
|
|
14746
14756
|
Object.defineProperty(InteropClient$1, "__esModule", { value: true });
|
|
14747
14757
|
InteropClient$1.InteropClient = void 0;
|
|
14748
|
-
const base_1$
|
|
14758
|
+
const base_1$4 = base;
|
|
14749
14759
|
const SessionContextGroupClient_1 = __importDefault$3(SessionContextGroupClient$1);
|
|
14750
14760
|
const utils_1$5 = utils$3;
|
|
14751
14761
|
/**
|
|
@@ -14797,7 +14807,7 @@ const utils_1$5 = utils$3;
|
|
|
14797
14807
|
* * {@link InteropClient#getAllClientsInContextGroup getAllClientsInContextGroup(contextGroupId)}
|
|
14798
14808
|
*
|
|
14799
14809
|
*/
|
|
14800
|
-
class InteropClient extends base_1$
|
|
14810
|
+
class InteropClient extends base_1$4.Base {
|
|
14801
14811
|
/**
|
|
14802
14812
|
* @internal
|
|
14803
14813
|
*/
|
|
@@ -14806,9 +14816,9 @@ class InteropClient extends base_1$3.Base {
|
|
|
14806
14816
|
_InteropClient_clientPromise.set(this, void 0);
|
|
14807
14817
|
_InteropClient_sessionContextGroups.set(this, void 0);
|
|
14808
14818
|
_InteropClient_fdc3Factory.set(this, void 0);
|
|
14809
|
-
__classPrivateFieldSet$
|
|
14810
|
-
__classPrivateFieldSet$
|
|
14811
|
-
__classPrivateFieldSet$
|
|
14819
|
+
__classPrivateFieldSet$4(this, _InteropClient_sessionContextGroups, new Map(), "f");
|
|
14820
|
+
__classPrivateFieldSet$4(this, _InteropClient_clientPromise, clientPromise, "f");
|
|
14821
|
+
__classPrivateFieldSet$4(this, _InteropClient_fdc3Factory, fdc3Factory, "f");
|
|
14812
14822
|
}
|
|
14813
14823
|
/*
|
|
14814
14824
|
Client APIs
|
|
@@ -14836,7 +14846,7 @@ class InteropClient extends base_1$3.Base {
|
|
|
14836
14846
|
this.wire.sendAction('interop-client-set-context').catch((e) => {
|
|
14837
14847
|
// don't expose, analytics-only call
|
|
14838
14848
|
});
|
|
14839
|
-
const client = await __classPrivateFieldGet$
|
|
14849
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
|
14840
14850
|
return client.dispatch('setContext', { context });
|
|
14841
14851
|
}
|
|
14842
14852
|
/**
|
|
@@ -14903,7 +14913,7 @@ class InteropClient extends base_1$3.Base {
|
|
|
14903
14913
|
if (typeof handler !== 'function') {
|
|
14904
14914
|
throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
|
|
14905
14915
|
}
|
|
14906
|
-
const client = await __classPrivateFieldGet$
|
|
14916
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
|
14907
14917
|
let handlerId;
|
|
14908
14918
|
if (contextType) {
|
|
14909
14919
|
handlerId = `invokeContextHandler-${contextType}-${(0, utils_1$5.generateId)()}`;
|
|
@@ -14943,7 +14953,7 @@ class InteropClient extends base_1$3.Base {
|
|
|
14943
14953
|
this.wire.sendAction('interop-client-get-context-groups').catch((e) => {
|
|
14944
14954
|
// don't expose, analytics-only call
|
|
14945
14955
|
});
|
|
14946
|
-
const client = await __classPrivateFieldGet$
|
|
14956
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
|
14947
14957
|
return client.dispatch('getContextGroups');
|
|
14948
14958
|
}
|
|
14949
14959
|
/**
|
|
@@ -14974,7 +14984,7 @@ class InteropClient extends base_1$3.Base {
|
|
|
14974
14984
|
this.wire.sendAction('interop-client-join-context-group').catch((e) => {
|
|
14975
14985
|
// don't expose, analytics-only call
|
|
14976
14986
|
});
|
|
14977
|
-
const client = await __classPrivateFieldGet$
|
|
14987
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
|
14978
14988
|
if (!contextGroupId) {
|
|
14979
14989
|
throw new Error('No contextGroupId specified for joinContextGroup.');
|
|
14980
14990
|
}
|
|
@@ -15003,7 +15013,7 @@ class InteropClient extends base_1$3.Base {
|
|
|
15003
15013
|
this.wire.sendAction('interop-client-remove-from-context-group').catch((e) => {
|
|
15004
15014
|
// don't expose, analytics-only call
|
|
15005
15015
|
});
|
|
15006
|
-
const client = await __classPrivateFieldGet$
|
|
15016
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
|
15007
15017
|
return client.dispatch('removeFromContextGroup', { target });
|
|
15008
15018
|
}
|
|
15009
15019
|
/**
|
|
@@ -15026,7 +15036,7 @@ class InteropClient extends base_1$3.Base {
|
|
|
15026
15036
|
this.wire.sendAction('interop-client-get-all-clients-in-context-group').catch((e) => {
|
|
15027
15037
|
// don't expose, analytics-only call
|
|
15028
15038
|
});
|
|
15029
|
-
const client = await __classPrivateFieldGet$
|
|
15039
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
|
15030
15040
|
if (!contextGroupId) {
|
|
15031
15041
|
throw new Error('No contextGroupId specified for getAllClientsInContextGroup.');
|
|
15032
15042
|
}
|
|
@@ -15051,7 +15061,7 @@ class InteropClient extends base_1$3.Base {
|
|
|
15051
15061
|
this.wire.sendAction('interop-client-get-info-for-context-group').catch((e) => {
|
|
15052
15062
|
// don't expose, analytics-only call
|
|
15053
15063
|
});
|
|
15054
|
-
const client = await __classPrivateFieldGet$
|
|
15064
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
|
15055
15065
|
if (!contextGroupId) {
|
|
15056
15066
|
throw new Error('No contextGroupId specified for getInfoForContextGroup.');
|
|
15057
15067
|
}
|
|
@@ -15079,7 +15089,7 @@ class InteropClient extends base_1$3.Base {
|
|
|
15079
15089
|
this.wire.sendAction('interop-client-fire-intent').catch((e) => {
|
|
15080
15090
|
// don't expose, this is only for api analytics purposes
|
|
15081
15091
|
});
|
|
15082
|
-
const client = await __classPrivateFieldGet$
|
|
15092
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
|
15083
15093
|
return client.dispatch('fireIntent', intent);
|
|
15084
15094
|
}
|
|
15085
15095
|
/**
|
|
@@ -15106,7 +15116,7 @@ class InteropClient extends base_1$3.Base {
|
|
|
15106
15116
|
this.wire.sendAction('interop-client-register-intent-handler').catch((e) => {
|
|
15107
15117
|
// don't expose, this is only for api analytics purposes
|
|
15108
15118
|
});
|
|
15109
|
-
const client = await __classPrivateFieldGet$
|
|
15119
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
|
15110
15120
|
const handlerId = `intent-handler-${intentName}`;
|
|
15111
15121
|
const wrappedHandler = (0, utils_1$5.wrapIntentHandler)(handler, handlerId);
|
|
15112
15122
|
try {
|
|
@@ -15144,7 +15154,7 @@ class InteropClient extends base_1$3.Base {
|
|
|
15144
15154
|
this.wire.sendAction('interop-client-get-current-context').catch((e) => {
|
|
15145
15155
|
// don't expose, analytics-only call
|
|
15146
15156
|
});
|
|
15147
|
-
const client = await __classPrivateFieldGet$
|
|
15157
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
|
15148
15158
|
return client.dispatch('getCurrentContext', { contextType });
|
|
15149
15159
|
}
|
|
15150
15160
|
/**
|
|
@@ -15164,7 +15174,7 @@ class InteropClient extends base_1$3.Base {
|
|
|
15164
15174
|
this.wire.sendAction('interop-client-get-info-for-intent').catch((e) => {
|
|
15165
15175
|
// don't expose, analytics-only call
|
|
15166
15176
|
});
|
|
15167
|
-
const client = await __classPrivateFieldGet$
|
|
15177
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
|
15168
15178
|
return client.dispatch('getInfoForIntent', options);
|
|
15169
15179
|
}
|
|
15170
15180
|
/**
|
|
@@ -15195,7 +15205,7 @@ class InteropClient extends base_1$3.Base {
|
|
|
15195
15205
|
this.wire.sendAction('interop-client-get-info-for-intents-by-context').catch((e) => {
|
|
15196
15206
|
// don't expose, analytics-only call
|
|
15197
15207
|
});
|
|
15198
|
-
const client = await __classPrivateFieldGet$
|
|
15208
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
|
15199
15209
|
return client.dispatch('getInfoForIntentsByContext', context);
|
|
15200
15210
|
}
|
|
15201
15211
|
/**
|
|
@@ -15227,7 +15237,7 @@ class InteropClient extends base_1$3.Base {
|
|
|
15227
15237
|
this.wire.sendAction('interop-client-fire-intent-for-context').catch((e) => {
|
|
15228
15238
|
// don't expose, analytics-only call
|
|
15229
15239
|
});
|
|
15230
|
-
const client = await __classPrivateFieldGet$
|
|
15240
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
|
15231
15241
|
return client.dispatch('fireIntentForContext', context);
|
|
15232
15242
|
}
|
|
15233
15243
|
/**
|
|
@@ -15264,19 +15274,19 @@ class InteropClient extends base_1$3.Base {
|
|
|
15264
15274
|
*/
|
|
15265
15275
|
async joinSessionContextGroup(sessionContextGroupId) {
|
|
15266
15276
|
try {
|
|
15267
|
-
const currentSessionContextGroup = __classPrivateFieldGet$
|
|
15277
|
+
const currentSessionContextGroup = __classPrivateFieldGet$4(this, _InteropClient_sessionContextGroups, "f").get(sessionContextGroupId);
|
|
15268
15278
|
if (currentSessionContextGroup) {
|
|
15269
15279
|
return currentSessionContextGroup.getUserInstance();
|
|
15270
15280
|
}
|
|
15271
|
-
const client = await __classPrivateFieldGet$
|
|
15281
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
|
15272
15282
|
const { hasConflict } = await client.dispatch('sessionContextGroup:createIfNeeded', {
|
|
15273
15283
|
sessionContextGroupId
|
|
15274
15284
|
});
|
|
15275
15285
|
if (hasConflict) {
|
|
15276
15286
|
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.`);
|
|
15277
15287
|
}
|
|
15278
|
-
const newSessionContextGroup = new SessionContextGroupClient_1.default(this.wire, __classPrivateFieldGet$
|
|
15279
|
-
__classPrivateFieldGet$
|
|
15288
|
+
const newSessionContextGroup = new SessionContextGroupClient_1.default(this.wire, __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f"), sessionContextGroupId);
|
|
15289
|
+
__classPrivateFieldGet$4(this, _InteropClient_sessionContextGroups, "f").set(sessionContextGroupId, newSessionContextGroup);
|
|
15280
15290
|
return newSessionContextGroup.getUserInstance();
|
|
15281
15291
|
}
|
|
15282
15292
|
catch (error) {
|
|
@@ -15303,14 +15313,14 @@ class InteropClient extends base_1$3.Base {
|
|
|
15303
15313
|
this.wire.sendAction('interop-client-add-ondisconnection-listener').catch((e) => {
|
|
15304
15314
|
// don't expose, analytics-only call
|
|
15305
15315
|
});
|
|
15306
|
-
const client = await __classPrivateFieldGet$
|
|
15316
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
|
15307
15317
|
return client.onDisconnection((event) => {
|
|
15308
15318
|
const { uuid } = event;
|
|
15309
15319
|
listener({ type: 'interop-broker', topic: 'disconnected', brokerName: uuid });
|
|
15310
15320
|
});
|
|
15311
15321
|
}
|
|
15312
15322
|
getFDC3Sync(version) {
|
|
15313
|
-
return __classPrivateFieldGet$
|
|
15323
|
+
return __classPrivateFieldGet$4(this, _InteropClient_fdc3Factory, "f").call(this, version, this, this.wire);
|
|
15314
15324
|
}
|
|
15315
15325
|
async getFDC3(version) {
|
|
15316
15326
|
return this.getFDC3Sync(version);
|
|
@@ -15321,7 +15331,7 @@ class InteropClient extends base_1$3.Base {
|
|
|
15321
15331
|
* Used to ferry fdc3-only calls from the fdc3 shim to the Interop Broker
|
|
15322
15332
|
*/
|
|
15323
15333
|
static async ferryFdc3Call(interopClient, action, payload) {
|
|
15324
|
-
const client = await __classPrivateFieldGet$
|
|
15334
|
+
const client = await __classPrivateFieldGet$4(interopClient, _InteropClient_clientPromise, "f");
|
|
15325
15335
|
return client.dispatch(action, payload || null);
|
|
15326
15336
|
}
|
|
15327
15337
|
}
|
|
@@ -15736,12 +15746,12 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
|
|
|
15736
15746
|
exports.getIntentResolution = getIntentResolution;
|
|
15737
15747
|
} (utils$2));
|
|
15738
15748
|
|
|
15739
|
-
var __classPrivateFieldGet$
|
|
15749
|
+
var __classPrivateFieldGet$3 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
15740
15750
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
15741
15751
|
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");
|
|
15742
15752
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15743
15753
|
};
|
|
15744
|
-
var __classPrivateFieldSet$
|
|
15754
|
+
var __classPrivateFieldSet$3 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
15745
15755
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
15746
15756
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
15747
15757
|
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");
|
|
@@ -15759,7 +15769,7 @@ const InteropClient_1$2 = InteropClient$1;
|
|
|
15759
15769
|
const isEqual_1 = __importDefault$2(require$$3);
|
|
15760
15770
|
class FDC3ModuleBase {
|
|
15761
15771
|
get client() {
|
|
15762
|
-
return __classPrivateFieldGet$
|
|
15772
|
+
return __classPrivateFieldGet$3(this, _FDC3ModuleBase_producer, "f").call(this);
|
|
15763
15773
|
}
|
|
15764
15774
|
get fin() {
|
|
15765
15775
|
return this.wire.getFin();
|
|
@@ -15768,7 +15778,7 @@ class FDC3ModuleBase {
|
|
|
15768
15778
|
constructor(producer, wire) {
|
|
15769
15779
|
this.wire = wire;
|
|
15770
15780
|
_FDC3ModuleBase_producer.set(this, void 0);
|
|
15771
|
-
__classPrivateFieldSet$
|
|
15781
|
+
__classPrivateFieldSet$3(this, _FDC3ModuleBase_producer, producer, "f");
|
|
15772
15782
|
}
|
|
15773
15783
|
/**
|
|
15774
15784
|
* Broadcasts a context for the channel of the current entity.
|
|
@@ -16549,7 +16559,7 @@ Object.defineProperty(Factory$1, "__esModule", { value: true });
|
|
|
16549
16559
|
Factory$1.InteropModule = void 0;
|
|
16550
16560
|
const cloneDeep_1 = __importDefault$1(require$$0$1);
|
|
16551
16561
|
const inaccessibleObject_1 = inaccessibleObject;
|
|
16552
|
-
const base_1$
|
|
16562
|
+
const base_1$3 = base;
|
|
16553
16563
|
const InteropBroker_1 = InteropBroker$1;
|
|
16554
16564
|
const InteropClient_1 = InteropClient$1;
|
|
16555
16565
|
const overrideCheck_1$1 = overrideCheck$1;
|
|
@@ -16561,7 +16571,7 @@ const BrokerParamAccessError = 'You have attempted to use or modify InteropBroke
|
|
|
16561
16571
|
* Manages creation of Interop Brokers and Interop Clients. These APIs are called under-the-hood in Platforms.
|
|
16562
16572
|
*
|
|
16563
16573
|
*/
|
|
16564
|
-
class InteropModule extends base_1$
|
|
16574
|
+
class InteropModule extends base_1$3.Base {
|
|
16565
16575
|
/**
|
|
16566
16576
|
* Initializes an Interop Broker. This is called under-the-hood for Platforms.
|
|
16567
16577
|
*
|
|
@@ -16685,13 +16695,13 @@ const channelPrefix = 'snapshot-source-provider-';
|
|
|
16685
16695
|
const getSnapshotSourceChannelName = (id) => `${channelPrefix}${id.uuid}`;
|
|
16686
16696
|
utils.getSnapshotSourceChannelName = getSnapshotSourceChannelName;
|
|
16687
16697
|
|
|
16688
|
-
var __classPrivateFieldSet$
|
|
16698
|
+
var __classPrivateFieldSet$2 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
16689
16699
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
16690
16700
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
16691
16701
|
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");
|
|
16692
16702
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16693
16703
|
};
|
|
16694
|
-
var __classPrivateFieldGet$
|
|
16704
|
+
var __classPrivateFieldGet$2 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
16695
16705
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
16696
16706
|
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");
|
|
16697
16707
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -16700,7 +16710,7 @@ var _SnapshotSource_identity, _SnapshotSource_getConnection, _SnapshotSource_get
|
|
|
16700
16710
|
Object.defineProperty(Instance, "__esModule", { value: true });
|
|
16701
16711
|
Instance.SnapshotSource = void 0;
|
|
16702
16712
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
16703
|
-
const base_1$
|
|
16713
|
+
const base_1$2 = base;
|
|
16704
16714
|
const utils_1$1 = utils;
|
|
16705
16715
|
const connectionMap = new Map();
|
|
16706
16716
|
/**
|
|
@@ -16709,7 +16719,7 @@ const connectionMap = new Map();
|
|
|
16709
16719
|
* @typeParam Snapshot Implementation-defined shape of an application snapshot. Allows
|
|
16710
16720
|
* custom snapshot implementations for legacy applications to define their own snapshot format.
|
|
16711
16721
|
*/
|
|
16712
|
-
class SnapshotSource extends base_1$
|
|
16722
|
+
class SnapshotSource extends base_1$2.Base {
|
|
16713
16723
|
/**
|
|
16714
16724
|
* @internal
|
|
16715
16725
|
*/
|
|
@@ -16723,26 +16733,26 @@ class SnapshotSource extends base_1$1.Base {
|
|
|
16723
16733
|
return connectionMap.get(this.identity.uuid);
|
|
16724
16734
|
});
|
|
16725
16735
|
_SnapshotSource_getClient.set(this, () => {
|
|
16726
|
-
if (!__classPrivateFieldGet$
|
|
16727
|
-
__classPrivateFieldGet$
|
|
16736
|
+
if (!__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise) {
|
|
16737
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = __classPrivateFieldGet$2(this, _SnapshotSource_startConnection, "f").call(this);
|
|
16728
16738
|
}
|
|
16729
|
-
return __classPrivateFieldGet$
|
|
16739
|
+
return __classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise;
|
|
16730
16740
|
});
|
|
16731
16741
|
_SnapshotSource_startConnection.set(this, async () => {
|
|
16732
16742
|
const channelName = (0, utils_1$1.getSnapshotSourceChannelName)(this.identity);
|
|
16733
16743
|
try {
|
|
16734
|
-
if (!__classPrivateFieldGet$
|
|
16735
|
-
await __classPrivateFieldGet$
|
|
16744
|
+
if (!__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).eventFired) {
|
|
16745
|
+
await __classPrivateFieldGet$2(this, _SnapshotSource_setUpConnectionListener, "f").call(this);
|
|
16736
16746
|
}
|
|
16737
16747
|
const client = await this.fin.InterApplicationBus.Channel.connect(channelName, { wait: false });
|
|
16738
16748
|
client.onDisconnection(() => {
|
|
16739
|
-
__classPrivateFieldGet$
|
|
16740
|
-
__classPrivateFieldGet$
|
|
16749
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = null;
|
|
16750
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).eventFired = null;
|
|
16741
16751
|
});
|
|
16742
16752
|
return client;
|
|
16743
16753
|
}
|
|
16744
16754
|
catch (e) {
|
|
16745
|
-
__classPrivateFieldGet$
|
|
16755
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = null;
|
|
16746
16756
|
throw new Error("The targeted SnapshotSource is not currently initialized. Await this object's ready() method.");
|
|
16747
16757
|
}
|
|
16748
16758
|
});
|
|
@@ -16754,7 +16764,7 @@ class SnapshotSource extends base_1$1.Base {
|
|
|
16754
16764
|
resolve = y;
|
|
16755
16765
|
reject = n;
|
|
16756
16766
|
});
|
|
16757
|
-
__classPrivateFieldGet$
|
|
16767
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).eventFired = eventFired;
|
|
16758
16768
|
const listener = async (e) => {
|
|
16759
16769
|
try {
|
|
16760
16770
|
if (e.channelName === channelName) {
|
|
@@ -16768,10 +16778,10 @@ class SnapshotSource extends base_1$1.Base {
|
|
|
16768
16778
|
};
|
|
16769
16779
|
await this.fin.InterApplicationBus.Channel.on('connected', listener);
|
|
16770
16780
|
});
|
|
16771
|
-
__classPrivateFieldSet$
|
|
16781
|
+
__classPrivateFieldSet$2(this, _SnapshotSource_identity, id, "f");
|
|
16772
16782
|
}
|
|
16773
16783
|
get identity() {
|
|
16774
|
-
return __classPrivateFieldGet$
|
|
16784
|
+
return __classPrivateFieldGet$2(this, _SnapshotSource_identity, "f");
|
|
16775
16785
|
}
|
|
16776
16786
|
/**
|
|
16777
16787
|
* Method to determine if the SnapshotSource has been initialized.
|
|
@@ -16807,11 +16817,11 @@ class SnapshotSource extends base_1$1.Base {
|
|
|
16807
16817
|
// eslint-disable-next-line no-async-promise-executor
|
|
16808
16818
|
try {
|
|
16809
16819
|
// 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?
|
|
16810
|
-
await __classPrivateFieldGet$
|
|
16820
|
+
await __classPrivateFieldGet$2(this, _SnapshotSource_getClient, "f").call(this);
|
|
16811
16821
|
}
|
|
16812
16822
|
catch (e) {
|
|
16813
16823
|
// it was not running.
|
|
16814
|
-
await __classPrivateFieldGet$
|
|
16824
|
+
await __classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).eventFired;
|
|
16815
16825
|
}
|
|
16816
16826
|
}
|
|
16817
16827
|
/**
|
|
@@ -16822,7 +16832,7 @@ class SnapshotSource extends base_1$1.Base {
|
|
|
16822
16832
|
this.wire.sendAction('snapshot-source-get-snapshot').catch((e) => {
|
|
16823
16833
|
// don't expose, analytics-only call
|
|
16824
16834
|
});
|
|
16825
|
-
const client = await __classPrivateFieldGet$
|
|
16835
|
+
const client = await __classPrivateFieldGet$2(this, _SnapshotSource_getClient, "f").call(this);
|
|
16826
16836
|
const response = (await client.dispatch('get-snapshot'));
|
|
16827
16837
|
return (await response).snapshot;
|
|
16828
16838
|
}
|
|
@@ -16834,7 +16844,7 @@ class SnapshotSource extends base_1$1.Base {
|
|
|
16834
16844
|
this.wire.sendAction('snapshot-source-apply-snapshot').catch((e) => {
|
|
16835
16845
|
// don't expose, analytics-only call
|
|
16836
16846
|
});
|
|
16837
|
-
const client = await __classPrivateFieldGet$
|
|
16847
|
+
const client = await __classPrivateFieldGet$2(this, _SnapshotSource_getClient, "f").call(this);
|
|
16838
16848
|
return client.dispatch('apply-snapshot', { snapshot });
|
|
16839
16849
|
}
|
|
16840
16850
|
}
|
|
@@ -16843,13 +16853,13 @@ _SnapshotSource_identity = new WeakMap(), _SnapshotSource_getConnection = new We
|
|
|
16843
16853
|
|
|
16844
16854
|
Object.defineProperty(Factory, "__esModule", { value: true });
|
|
16845
16855
|
Factory.SnapshotSourceModule = void 0;
|
|
16846
|
-
const base_1 = base;
|
|
16856
|
+
const base_1$1 = base;
|
|
16847
16857
|
const Instance_1 = Instance;
|
|
16848
16858
|
const utils_1 = utils;
|
|
16849
16859
|
/**
|
|
16850
16860
|
* Static namespace for OpenFin API methods that interact with the {@link SnapshotSource} class, available under `fin.SnapshotSource`.
|
|
16851
16861
|
*/
|
|
16852
|
-
class SnapshotSourceModule extends base_1.Base {
|
|
16862
|
+
class SnapshotSourceModule extends base_1$1.Base {
|
|
16853
16863
|
/**
|
|
16854
16864
|
* Initializes a SnapshotSource with the getSnapshot and applySnapshot methods defined.
|
|
16855
16865
|
*
|
|
@@ -16955,13 +16965,121 @@ Factory.SnapshotSourceModule = SnapshotSourceModule;
|
|
|
16955
16965
|
__exportStar(Instance, exports);
|
|
16956
16966
|
} (snapshotSource));
|
|
16957
16967
|
|
|
16968
|
+
var notificationManager = {};
|
|
16969
|
+
|
|
16970
|
+
var factory = {};
|
|
16971
|
+
|
|
16972
|
+
var instance = {};
|
|
16973
|
+
|
|
16974
|
+
var __classPrivateFieldSet$1 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
16975
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
16976
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
16977
|
+
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");
|
|
16978
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16979
|
+
};
|
|
16980
|
+
var __classPrivateFieldGet$1 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
16981
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
16982
|
+
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");
|
|
16983
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
16984
|
+
};
|
|
16985
|
+
var _NotificationManagerInstance_wire, _NotificationManagerInstance_handler, _NotificationManagerInstance_id, _NotificationManagerInstance_isReceivingNotifications;
|
|
16986
|
+
Object.defineProperty(instance, "__esModule", { value: true });
|
|
16987
|
+
instance.NotificationManagerInstance = void 0;
|
|
16988
|
+
const lazy_1 = lazy;
|
|
16989
|
+
class NotificationManagerInstance {
|
|
16990
|
+
constructor(wire, id) {
|
|
16991
|
+
_NotificationManagerInstance_wire.set(this, void 0);
|
|
16992
|
+
_NotificationManagerInstance_handler.set(this, void 0);
|
|
16993
|
+
_NotificationManagerInstance_id.set(this, void 0);
|
|
16994
|
+
_NotificationManagerInstance_isReceivingNotifications.set(this, new lazy_1.Lazy(async () => {
|
|
16995
|
+
await __classPrivateFieldGet$1(this, _NotificationManagerInstance_wire, "f").registerMessageHandler((message) => {
|
|
16996
|
+
if (message.action === 'notification-created' && message.payload.managerId === __classPrivateFieldGet$1(this, _NotificationManagerInstance_id, "f")) {
|
|
16997
|
+
const { notificationId, properties, documentUrl: url, notificationIcon: icon, badge, image } = message.payload;
|
|
16998
|
+
try {
|
|
16999
|
+
__classPrivateFieldGet$1(this, _NotificationManagerInstance_handler, "f")?.call(this, {
|
|
17000
|
+
properties,
|
|
17001
|
+
images: {
|
|
17002
|
+
image,
|
|
17003
|
+
icon,
|
|
17004
|
+
badge
|
|
17005
|
+
},
|
|
17006
|
+
url,
|
|
17007
|
+
notificationId
|
|
17008
|
+
});
|
|
17009
|
+
}
|
|
17010
|
+
catch (error) {
|
|
17011
|
+
console.error('Failed to handle notification', error);
|
|
17012
|
+
}
|
|
17013
|
+
return true;
|
|
17014
|
+
}
|
|
17015
|
+
return false;
|
|
17016
|
+
});
|
|
17017
|
+
return true;
|
|
17018
|
+
}));
|
|
17019
|
+
this.setNotificationHandler = async (handler) => {
|
|
17020
|
+
await __classPrivateFieldGet$1(this, _NotificationManagerInstance_isReceivingNotifications, "f").getValue();
|
|
17021
|
+
__classPrivateFieldSet$1(this, _NotificationManagerInstance_handler, handler, "f");
|
|
17022
|
+
};
|
|
17023
|
+
this.destroy = async () => {
|
|
17024
|
+
await __classPrivateFieldGet$1(this, _NotificationManagerInstance_wire, "f").sendAction('destroy-notification-manager', { managerId: __classPrivateFieldGet$1(this, _NotificationManagerInstance_id, "f") });
|
|
17025
|
+
};
|
|
17026
|
+
this.dispatch = async (event) => {
|
|
17027
|
+
const { notificationId, type } = event;
|
|
17028
|
+
await __classPrivateFieldGet$1(this, _NotificationManagerInstance_wire, "f").sendAction('dispatch-notification-event', {
|
|
17029
|
+
notificationId,
|
|
17030
|
+
type
|
|
17031
|
+
});
|
|
17032
|
+
};
|
|
17033
|
+
__classPrivateFieldSet$1(this, _NotificationManagerInstance_wire, wire, "f");
|
|
17034
|
+
__classPrivateFieldSet$1(this, _NotificationManagerInstance_id, id, "f");
|
|
17035
|
+
}
|
|
17036
|
+
}
|
|
17037
|
+
instance.NotificationManagerInstance = NotificationManagerInstance;
|
|
17038
|
+
_NotificationManagerInstance_wire = new WeakMap(), _NotificationManagerInstance_handler = new WeakMap(), _NotificationManagerInstance_id = new WeakMap(), _NotificationManagerInstance_isReceivingNotifications = new WeakMap();
|
|
17039
|
+
|
|
17040
|
+
Object.defineProperty(factory, "__esModule", { value: true });
|
|
17041
|
+
factory.NotificationManagerModule = void 0;
|
|
17042
|
+
const base_1 = base;
|
|
17043
|
+
const instance_1 = instance;
|
|
17044
|
+
class NotificationManagerModule extends base_1.Base {
|
|
17045
|
+
constructor() {
|
|
17046
|
+
super(...arguments);
|
|
17047
|
+
this.init = async () => {
|
|
17048
|
+
const { payload: { data: { managerId } } } = await this.wire.sendAction('init-notification-manager');
|
|
17049
|
+
const manager = new instance_1.NotificationManagerInstance(this.wire, managerId);
|
|
17050
|
+
return manager;
|
|
17051
|
+
};
|
|
17052
|
+
}
|
|
17053
|
+
}
|
|
17054
|
+
factory.NotificationManagerModule = NotificationManagerModule;
|
|
17055
|
+
|
|
17056
|
+
(function (exports) {
|
|
17057
|
+
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
17058
|
+
if (k2 === undefined) k2 = k;
|
|
17059
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17060
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17061
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17062
|
+
}
|
|
17063
|
+
Object.defineProperty(o, k2, desc);
|
|
17064
|
+
}) : (function(o, m, k, k2) {
|
|
17065
|
+
if (k2 === undefined) k2 = k;
|
|
17066
|
+
o[k2] = m[k];
|
|
17067
|
+
}));
|
|
17068
|
+
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
17069
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17070
|
+
};
|
|
17071
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17072
|
+
__exportStar(factory, exports);
|
|
17073
|
+
__exportStar(instance, exports);
|
|
17074
|
+
} (notificationManager));
|
|
17075
|
+
|
|
16958
17076
|
Object.defineProperty(fin$1, "__esModule", { value: true });
|
|
16959
17077
|
var Fin_1 = fin$1.Fin = void 0;
|
|
16960
17078
|
const events_1$3 = require$$0;
|
|
16961
17079
|
// Import from the file rather than the directory in case someone consuming types is using module resolution other than "node"
|
|
16962
17080
|
const index_1 = system;
|
|
16963
17081
|
const index_2 = requireWindow();
|
|
16964
|
-
const index_3 =
|
|
17082
|
+
const index_3 = application;
|
|
16965
17083
|
const index_4 = interappbus;
|
|
16966
17084
|
const index_5 = clipboard;
|
|
16967
17085
|
const index_6 = externalApplication;
|
|
@@ -16972,6 +17090,7 @@ const index_10 = platform;
|
|
|
16972
17090
|
const me_1$1 = me;
|
|
16973
17091
|
const interop_1 = interop;
|
|
16974
17092
|
const snapshot_source_1 = snapshotSource;
|
|
17093
|
+
const notification_manager_1 = notificationManager;
|
|
16975
17094
|
/**
|
|
16976
17095
|
* @internal
|
|
16977
17096
|
*/
|
|
@@ -16994,6 +17113,7 @@ class Fin extends events_1$3.EventEmitter {
|
|
|
16994
17113
|
this.View = new index_9.ViewModule(wire);
|
|
16995
17114
|
this.Interop = new interop_1.InteropModule(wire);
|
|
16996
17115
|
this.SnapshotSource = new snapshot_source_1.SnapshotSourceModule(wire);
|
|
17116
|
+
this.NotificationManager = new notification_manager_1.NotificationManagerModule(wire);
|
|
16997
17117
|
wire.registerFin(this);
|
|
16998
17118
|
this.me = (0, me_1$1.getMe)(wire);
|
|
16999
17119
|
// Handle disconnect events
|
|
@@ -17762,7 +17882,7 @@ class NodeEnvironment extends BaseEnvironment_1 {
|
|
|
17762
17882
|
};
|
|
17763
17883
|
}
|
|
17764
17884
|
getAdapterVersionSync() {
|
|
17765
|
-
return "42.100.
|
|
17885
|
+
return "42.100.93";
|
|
17766
17886
|
}
|
|
17767
17887
|
observeBounds(element, onChange) {
|
|
17768
17888
|
throw new Error('Method not implemented.');
|