@openfin/node-adapter 43.100.29 → 43.100.35
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 +1513 -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;
|
@@ -5144,7 +5123,7 @@ function requireWindow () {
|
|
5144
5123
|
*/
|
5145
5124
|
Object.defineProperty(system, "__esModule", { value: true });
|
5146
5125
|
system.System = void 0;
|
5147
|
-
const base_1$
|
5126
|
+
const base_1$m = base;
|
5148
5127
|
const transport_errors_1$6 = transportErrors;
|
5149
5128
|
const window_1 = requireWindow();
|
5150
5129
|
const events_1$6 = require$$0;
|
@@ -5154,7 +5133,7 @@ const events_1$6 = require$$0;
|
|
5154
5133
|
* clearing the cache and exiting the runtime as well as listen to {@link OpenFin.SystemEvents system events}.
|
5155
5134
|
*
|
5156
5135
|
*/
|
5157
|
-
class System extends base_1$
|
5136
|
+
class System extends base_1$m.EmitterBase {
|
5158
5137
|
/**
|
5159
5138
|
* @internal
|
5160
5139
|
*/
|
@@ -7465,12 +7444,12 @@ class ChannelError extends Error {
|
|
7465
7444
|
}
|
7466
7445
|
channelError.ChannelError = ChannelError;
|
7467
7446
|
|
7468
|
-
var __classPrivateFieldGet$
|
7447
|
+
var __classPrivateFieldGet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
7469
7448
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
7470
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");
|
7471
7450
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
7472
7451
|
};
|
7473
|
-
var __classPrivateFieldSet$
|
7452
|
+
var __classPrivateFieldSet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
7474
7453
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
7475
7454
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
7476
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");
|
@@ -7514,7 +7493,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7514
7493
|
static closeChannelByEndpointId(id) {
|
7515
7494
|
const channel = channelClientsByEndpointId.get(id);
|
7516
7495
|
if (channel) {
|
7517
|
-
__classPrivateFieldGet$
|
7496
|
+
__classPrivateFieldGet$h(channel, _ChannelClient_close, "f").call(channel);
|
7518
7497
|
}
|
7519
7498
|
}
|
7520
7499
|
/**
|
@@ -7525,7 +7504,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7525
7504
|
for (const channelClient of channelClientsByEndpointId.values()) {
|
7526
7505
|
if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
|
7527
7506
|
channelClient.disconnectListener(eventPayload);
|
7528
|
-
__classPrivateFieldGet$
|
7507
|
+
__classPrivateFieldGet$h(channelClient, _ChannelClient_close, "f").call(channelClient);
|
7529
7508
|
}
|
7530
7509
|
}
|
7531
7510
|
}
|
@@ -7540,12 +7519,12 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7540
7519
|
this.processAction = (action, payload, senderIdentity) => super.processAction(action, payload, senderIdentity);
|
7541
7520
|
_ChannelClient_close.set(this, () => {
|
7542
7521
|
channelClientsByEndpointId.delete(this.endpointId);
|
7543
|
-
__classPrivateFieldGet$
|
7522
|
+
__classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").close();
|
7544
7523
|
});
|
7545
|
-
__classPrivateFieldSet$
|
7524
|
+
__classPrivateFieldSet$g(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
|
7546
7525
|
this.disconnectListener = () => undefined;
|
7547
7526
|
this.endpointId = routingInfo.endpointId;
|
7548
|
-
__classPrivateFieldSet$
|
7527
|
+
__classPrivateFieldSet$g(this, _ChannelClient_strategy, strategy, "f");
|
7549
7528
|
channelClientsByEndpointId.set(this.endpointId, this);
|
7550
7529
|
strategy.receive(this.processAction);
|
7551
7530
|
}
|
@@ -7553,7 +7532,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7553
7532
|
* a read-only provider identity
|
7554
7533
|
*/
|
7555
7534
|
get providerIdentity() {
|
7556
|
-
const protectedObj = __classPrivateFieldGet$
|
7535
|
+
const protectedObj = __classPrivateFieldGet$h(this, _ChannelClient_protectedObj, "f");
|
7557
7536
|
return protectedObj.providerIdentity;
|
7558
7537
|
}
|
7559
7538
|
/**
|
@@ -7582,9 +7561,9 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7582
7561
|
* ```
|
7583
7562
|
*/
|
7584
7563
|
async dispatch(action, payload) {
|
7585
|
-
if (__classPrivateFieldGet$
|
7564
|
+
if (__classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
|
7586
7565
|
const callSites = transport_errors_1$3.RuntimeError.getCallSite();
|
7587
|
-
return __classPrivateFieldGet$
|
7566
|
+
return __classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
|
7588
7567
|
throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
|
7589
7568
|
});
|
7590
7569
|
}
|
@@ -7636,10 +7615,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7636
7615
|
*/
|
7637
7616
|
async disconnect() {
|
7638
7617
|
await this.sendDisconnectAction();
|
7639
|
-
__classPrivateFieldGet$
|
7618
|
+
__classPrivateFieldGet$h(this, _ChannelClient_close, "f").call(this);
|
7640
7619
|
}
|
7641
7620
|
async sendDisconnectAction() {
|
7642
|
-
const protectedObj = __classPrivateFieldGet$
|
7621
|
+
const protectedObj = __classPrivateFieldGet$h(this, _ChannelClient_protectedObj, "f");
|
7643
7622
|
await protectedObj.close();
|
7644
7623
|
}
|
7645
7624
|
/**
|
@@ -7672,13 +7651,13 @@ exhaustive.exhaustiveCheck = exhaustiveCheck;
|
|
7672
7651
|
|
7673
7652
|
var strategy$3 = {};
|
7674
7653
|
|
7675
|
-
var __classPrivateFieldSet$
|
7654
|
+
var __classPrivateFieldSet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
7676
7655
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
7677
7656
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
7678
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");
|
7679
7658
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
7680
7659
|
};
|
7681
|
-
var __classPrivateFieldGet$
|
7660
|
+
var __classPrivateFieldGet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
7682
7661
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
7683
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");
|
7684
7663
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -7703,7 +7682,7 @@ class ClassicStrategy {
|
|
7703
7682
|
// connection problems occur
|
7704
7683
|
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
|
7705
7684
|
this.send = async (endpointId, action, payload) => {
|
7706
|
-
const to = __classPrivateFieldGet$
|
7685
|
+
const to = __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
7707
7686
|
if (!to) {
|
7708
7687
|
throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
|
7709
7688
|
}
|
@@ -7715,13 +7694,13 @@ class ClassicStrategy {
|
|
7715
7694
|
}
|
7716
7695
|
delete cleanId.isLocalEndpointId;
|
7717
7696
|
// grab the promise before awaiting it to save in our pending messages map
|
7718
|
-
const p = __classPrivateFieldGet$
|
7697
|
+
const p = __classPrivateFieldGet$g(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
|
7719
7698
|
...cleanId,
|
7720
7699
|
providerIdentity: this.providerIdentity,
|
7721
7700
|
action,
|
7722
7701
|
payload
|
7723
7702
|
});
|
7724
|
-
__classPrivateFieldGet$
|
7703
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
|
7725
7704
|
const raw = await p
|
7726
7705
|
.catch((error) => {
|
7727
7706
|
if ('cause' in error) {
|
@@ -7731,16 +7710,16 @@ class ClassicStrategy {
|
|
7731
7710
|
})
|
7732
7711
|
.finally(() => {
|
7733
7712
|
// clean up the pending promise
|
7734
|
-
__classPrivateFieldGet$
|
7713
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
|
7735
7714
|
});
|
7736
7715
|
return raw.payload.data.result;
|
7737
7716
|
};
|
7738
7717
|
this.close = async () => {
|
7739
7718
|
this.messageReceiver.removeEndpoint(this.providerIdentity.channelId, this.endpointId);
|
7740
|
-
[...__classPrivateFieldGet$
|
7741
|
-
__classPrivateFieldSet$
|
7719
|
+
[...__classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
|
7720
|
+
__classPrivateFieldSet$f(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
|
7742
7721
|
};
|
7743
|
-
__classPrivateFieldSet$
|
7722
|
+
__classPrivateFieldSet$f(this, _ClassicStrategy_wire, wire, "f");
|
7744
7723
|
}
|
7745
7724
|
onEndpointDisconnect(endpointId, listener) {
|
7746
7725
|
// Never fires for 'classic'.
|
@@ -7749,20 +7728,20 @@ class ClassicStrategy {
|
|
7749
7728
|
this.messageReceiver.addEndpoint(listener, this.providerIdentity.channelId, this.endpointId);
|
7750
7729
|
}
|
7751
7730
|
async closeEndpoint(endpointId) {
|
7752
|
-
const id = __classPrivateFieldGet$
|
7753
|
-
__classPrivateFieldGet$
|
7754
|
-
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);
|
7755
7734
|
pendingSet?.forEach((p) => {
|
7756
7735
|
const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
|
7757
7736
|
p.cancel(new Error(errorMsg));
|
7758
7737
|
});
|
7759
7738
|
}
|
7760
7739
|
isEndpointConnected(endpointId) {
|
7761
|
-
return __classPrivateFieldGet$
|
7740
|
+
return __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
|
7762
7741
|
}
|
7763
7742
|
addEndpoint(endpointId, payload) {
|
7764
|
-
__classPrivateFieldGet$
|
7765
|
-
__classPrivateFieldGet$
|
7743
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
|
7744
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
|
7766
7745
|
}
|
7767
7746
|
isValidEndpointPayload(payload) {
|
7768
7747
|
return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
|
@@ -7797,12 +7776,12 @@ function errorToPOJO(error) {
|
|
7797
7776
|
}
|
7798
7777
|
errors.errorToPOJO = errorToPOJO;
|
7799
7778
|
|
7800
|
-
var __classPrivateFieldGet$
|
7779
|
+
var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
7801
7780
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
7802
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");
|
7803
7782
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
7804
7783
|
};
|
7805
|
-
var __classPrivateFieldSet$
|
7784
|
+
var __classPrivateFieldSet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
7806
7785
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
7807
7786
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
7808
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");
|
@@ -7837,8 +7816,8 @@ class RTCEndpoint {
|
|
7837
7816
|
if (this.rtc.rtcClient.connectionState !== 'connected') {
|
7838
7817
|
this.rtc.rtcClient.removeEventListener('connectionstatechange', this.connectionStateChangeHandler);
|
7839
7818
|
this.close();
|
7840
|
-
if (__classPrivateFieldGet$
|
7841
|
-
__classPrivateFieldGet$
|
7819
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
|
7820
|
+
__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
7842
7821
|
}
|
7843
7822
|
}
|
7844
7823
|
};
|
@@ -7886,9 +7865,9 @@ class RTCEndpoint {
|
|
7886
7865
|
data = new TextDecoder().decode(e.data);
|
7887
7866
|
}
|
7888
7867
|
const { messageId, action, payload } = JSON.parse(data);
|
7889
|
-
if (__classPrivateFieldGet$
|
7868
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f")) {
|
7890
7869
|
try {
|
7891
|
-
const res = await __classPrivateFieldGet$
|
7870
|
+
const res = await __classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
|
7892
7871
|
this.rtc.channels.response.send(JSON.stringify({
|
7893
7872
|
messageId,
|
7894
7873
|
payload: res,
|
@@ -7922,25 +7901,25 @@ class RTCEndpoint {
|
|
7922
7901
|
datachannel.onclose = (e) => {
|
7923
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.')));
|
7924
7903
|
this.close();
|
7925
|
-
if (__classPrivateFieldGet$
|
7926
|
-
__classPrivateFieldGet$
|
7904
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
|
7905
|
+
__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
7927
7906
|
}
|
7928
7907
|
};
|
7929
7908
|
});
|
7930
7909
|
}
|
7931
7910
|
onDisconnect(listener) {
|
7932
|
-
if (!__classPrivateFieldGet$
|
7933
|
-
__classPrivateFieldSet$
|
7911
|
+
if (!__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
|
7912
|
+
__classPrivateFieldSet$e(this, _RTCEndpoint_disconnectListener, listener, "f");
|
7934
7913
|
}
|
7935
7914
|
else {
|
7936
7915
|
throw new Error('RTCEndpoint disconnectListener cannot be set twice.');
|
7937
7916
|
}
|
7938
7917
|
}
|
7939
7918
|
receive(listener) {
|
7940
|
-
if (__classPrivateFieldGet$
|
7919
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f")) {
|
7941
7920
|
throw new Error('You have already set a listener for this RTC Endpoint.');
|
7942
7921
|
}
|
7943
|
-
__classPrivateFieldSet$
|
7922
|
+
__classPrivateFieldSet$e(this, _RTCEndpoint_processAction, listener, "f");
|
7944
7923
|
}
|
7945
7924
|
get connected() {
|
7946
7925
|
return this.rtc.rtcClient.connectionState === 'connected';
|
@@ -7951,12 +7930,12 @@ _RTCEndpoint_processAction = new WeakMap(), _RTCEndpoint_disconnectListener = ne
|
|
7951
7930
|
|
7952
7931
|
var strategy$1 = {};
|
7953
7932
|
|
7954
|
-
var __classPrivateFieldGet$
|
7933
|
+
var __classPrivateFieldGet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
7955
7934
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
7956
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");
|
7957
7936
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
7958
7937
|
};
|
7959
|
-
var __classPrivateFieldSet$
|
7938
|
+
var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
7960
7939
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
7961
7940
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
7962
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");
|
@@ -7977,11 +7956,11 @@ class EndpointStrategy {
|
|
7977
7956
|
return this.getEndpointById(endpointId).send(action, payload);
|
7978
7957
|
};
|
7979
7958
|
this.close = async () => {
|
7980
|
-
if (__classPrivateFieldGet$
|
7981
|
-
__classPrivateFieldGet$
|
7982
|
-
__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");
|
7983
7962
|
}
|
7984
|
-
__classPrivateFieldSet$
|
7963
|
+
__classPrivateFieldSet$d(this, _EndpointStrategy_connected, false, "f");
|
7985
7964
|
};
|
7986
7965
|
this.isValidEndpointPayload = validateEndpoint;
|
7987
7966
|
}
|
@@ -7989,39 +7968,39 @@ class EndpointStrategy {
|
|
7989
7968
|
this.getEndpointById(endpointId).onDisconnect(listener);
|
7990
7969
|
}
|
7991
7970
|
receive(listener) {
|
7992
|
-
if (__classPrivateFieldGet$
|
7971
|
+
if (__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")) {
|
7993
7972
|
throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);
|
7994
7973
|
}
|
7995
|
-
__classPrivateFieldSet$
|
7974
|
+
__classPrivateFieldSet$d(this, _EndpointStrategy_processAction, listener, "f");
|
7996
7975
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
7997
|
-
__classPrivateFieldGet$
|
7976
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")));
|
7998
7977
|
}
|
7999
7978
|
getEndpointById(endpointId) {
|
8000
|
-
const endpoint = __classPrivateFieldGet$
|
7979
|
+
const endpoint = __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
|
8001
7980
|
if (!endpoint) {
|
8002
7981
|
throw new Error(`Client with endpoint id ${endpointId} is not connected`);
|
8003
7982
|
}
|
8004
7983
|
return endpoint;
|
8005
7984
|
}
|
8006
7985
|
get connected() {
|
8007
|
-
return __classPrivateFieldGet$
|
7986
|
+
return __classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f");
|
8008
7987
|
}
|
8009
7988
|
isEndpointConnected(endpointId) {
|
8010
|
-
return __classPrivateFieldGet$
|
7989
|
+
return __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
|
8011
7990
|
}
|
8012
7991
|
addEndpoint(endpointId, payload) {
|
8013
|
-
if (!__classPrivateFieldGet$
|
7992
|
+
if (!__classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f")) {
|
8014
7993
|
console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);
|
8015
7994
|
return;
|
8016
7995
|
}
|
8017
7996
|
const clientStrat = new this.EndpointType(payload);
|
8018
|
-
if (__classPrivateFieldGet$
|
8019
|
-
clientStrat.receive(__classPrivateFieldGet$
|
7997
|
+
if (__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")) {
|
7998
|
+
clientStrat.receive(__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f"));
|
8020
7999
|
}
|
8021
|
-
__classPrivateFieldGet$
|
8000
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
|
8022
8001
|
}
|
8023
8002
|
async closeEndpoint(endpointId) {
|
8024
|
-
__classPrivateFieldGet$
|
8003
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
|
8025
8004
|
}
|
8026
8005
|
}
|
8027
8006
|
strategy$1.EndpointStrategy = EndpointStrategy;
|
@@ -8048,11 +8027,11 @@ var iceManager = {};
|
|
8048
8027
|
|
8049
8028
|
Object.defineProperty(iceManager, "__esModule", { value: true });
|
8050
8029
|
iceManager.RTCICEManager = void 0;
|
8051
|
-
const base_1$
|
8030
|
+
const base_1$l = base;
|
8052
8031
|
/*
|
8053
8032
|
Singleton that facilitates Offer and Answer exchange required for establishing RTC connections.
|
8054
8033
|
*/
|
8055
|
-
class RTCICEManager extends base_1$
|
8034
|
+
class RTCICEManager extends base_1$l.EmitterBase {
|
8056
8035
|
constructor(wire) {
|
8057
8036
|
super(wire, 'channel');
|
8058
8037
|
this.ensureChannelOpened = (channel) => {
|
@@ -8203,12 +8182,12 @@ function runtimeUuidMeetsMinimumRuntimeVersion(runtimeUuid, minVersion) {
|
|
8203
8182
|
}
|
8204
8183
|
runtimeVersioning.runtimeUuidMeetsMinimumRuntimeVersion = runtimeUuidMeetsMinimumRuntimeVersion;
|
8205
8184
|
|
8206
|
-
var __classPrivateFieldGet$
|
8185
|
+
var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8207
8186
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8208
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");
|
8209
8188
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
8210
8189
|
};
|
8211
|
-
var __classPrivateFieldSet$
|
8190
|
+
var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8212
8191
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8213
8192
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8214
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");
|
@@ -8252,19 +8231,19 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8252
8231
|
* a read-only array containing all the identities of connecting clients.
|
8253
8232
|
*/
|
8254
8233
|
get connections() {
|
8255
|
-
return [...__classPrivateFieldGet$
|
8234
|
+
return [...__classPrivateFieldGet$d(this, _ChannelProvider_connections, "f")];
|
8256
8235
|
}
|
8257
8236
|
static handleClientDisconnection(channel, payload) {
|
8258
8237
|
if (payload?.endpointId) {
|
8259
8238
|
const { uuid, name, endpointId, isLocalEndpointId } = payload;
|
8260
|
-
__classPrivateFieldGet$
|
8239
|
+
__classPrivateFieldGet$d(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
|
8261
8240
|
}
|
8262
8241
|
else {
|
8263
8242
|
// this is here to support older runtimes that did not have endpointId
|
8264
8243
|
const multipleRemoves = channel.connections.filter((identity) => {
|
8265
8244
|
return identity.uuid === payload.uuid && identity.name === payload.name;
|
8266
8245
|
});
|
8267
|
-
multipleRemoves.forEach(__classPrivateFieldGet$
|
8246
|
+
multipleRemoves.forEach(__classPrivateFieldGet$d(channel, _ChannelProvider_removeEndpoint, "f"));
|
8268
8247
|
}
|
8269
8248
|
channel.disconnectListener(payload);
|
8270
8249
|
}
|
@@ -8281,8 +8260,8 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8281
8260
|
_ChannelProvider_strategy.set(this, void 0);
|
8282
8261
|
_ChannelProvider_removeEndpoint.set(this, (identity) => {
|
8283
8262
|
const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
|
8284
|
-
__classPrivateFieldGet$
|
8285
|
-
__classPrivateFieldSet$
|
8263
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
|
8264
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_connections, remainingConnections, "f");
|
8286
8265
|
});
|
8287
8266
|
// Must be bound.
|
8288
8267
|
this.processAction = async (action, payload, senderIdentity) => {
|
@@ -8296,17 +8275,17 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8296
8275
|
return super.processAction(action, payload, senderIdentity);
|
8297
8276
|
};
|
8298
8277
|
_ChannelProvider_close.set(this, () => {
|
8299
|
-
__classPrivateFieldGet$
|
8278
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").close();
|
8300
8279
|
const remove = ChannelProvider.removalMap.get(this);
|
8301
8280
|
if (remove) {
|
8302
8281
|
remove();
|
8303
8282
|
}
|
8304
8283
|
});
|
8305
|
-
__classPrivateFieldSet$
|
8284
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
|
8306
8285
|
this.connectListener = () => undefined;
|
8307
8286
|
this.disconnectListener = () => undefined;
|
8308
|
-
__classPrivateFieldSet$
|
8309
|
-
__classPrivateFieldSet$
|
8287
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_connections, [], "f");
|
8288
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_strategy, strategy, "f");
|
8310
8289
|
strategy.receive(this.processAction);
|
8311
8290
|
}
|
8312
8291
|
/**
|
@@ -8337,16 +8316,16 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8337
8316
|
*/
|
8338
8317
|
dispatch(to, action, payload) {
|
8339
8318
|
const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
|
8340
|
-
if (endpointId && __classPrivateFieldGet$
|
8319
|
+
if (endpointId && __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
|
8341
8320
|
const callSites = transport_errors_1$2.RuntimeError.getCallSite();
|
8342
|
-
return __classPrivateFieldGet$
|
8321
|
+
return __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
|
8343
8322
|
throw new channel_error_1.ChannelError(e, action, payload, callSites);
|
8344
8323
|
});
|
8345
8324
|
}
|
8346
8325
|
return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
|
8347
8326
|
}
|
8348
8327
|
async processConnection(senderId, payload) {
|
8349
|
-
__classPrivateFieldGet$
|
8328
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_connections, "f").push(senderId);
|
8350
8329
|
return this.connectListener(senderId, payload);
|
8351
8330
|
}
|
8352
8331
|
/**
|
@@ -8369,7 +8348,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8369
8348
|
* ```
|
8370
8349
|
*/
|
8371
8350
|
publish(action, payload) {
|
8372
|
-
return this.connections.map((to) => __classPrivateFieldGet$
|
8351
|
+
return this.connections.map((to) => __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
|
8373
8352
|
}
|
8374
8353
|
/**
|
8375
8354
|
* Register a listener that is called on every new client connection.
|
@@ -8443,11 +8422,11 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8443
8422
|
* ```
|
8444
8423
|
*/
|
8445
8424
|
async destroy() {
|
8446
|
-
const protectedObj = __classPrivateFieldGet$
|
8425
|
+
const protectedObj = __classPrivateFieldGet$d(this, _ChannelProvider_protectedObj, "f");
|
8447
8426
|
protectedObj.providerIdentity;
|
8448
|
-
__classPrivateFieldSet$
|
8427
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_connections, [], "f");
|
8449
8428
|
await protectedObj.close();
|
8450
|
-
__classPrivateFieldGet$
|
8429
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_close, "f").call(this);
|
8451
8430
|
}
|
8452
8431
|
/**
|
8453
8432
|
* Returns an array with info on every Client connected to the Provider
|
@@ -8517,7 +8496,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8517
8496
|
getEndpointIdForOpenFinId(clientIdentity, action) {
|
8518
8497
|
const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
|
8519
8498
|
if (matchingConnections.length >= 2) {
|
8520
|
-
const protectedObj = __classPrivateFieldGet$
|
8499
|
+
const protectedObj = __classPrivateFieldGet$d(this, _ChannelProvider_protectedObj, "f");
|
8521
8500
|
const { uuid, name } = clientIdentity;
|
8522
8501
|
const providerUuid = protectedObj?.providerIdentity.uuid;
|
8523
8502
|
const providerName = protectedObj?.providerIdentity.name;
|
@@ -8553,14 +8532,14 @@ var messageReceiver$1 = {};
|
|
8553
8532
|
Object.defineProperty(messageReceiver$1, "__esModule", { value: true });
|
8554
8533
|
messageReceiver$1.MessageReceiver = void 0;
|
8555
8534
|
const client_1$1 = client;
|
8556
|
-
const base_1$
|
8535
|
+
const base_1$k = base;
|
8557
8536
|
const errors_1$1 = errors;
|
8558
8537
|
/*
|
8559
8538
|
This is a singleton (per fin object) tasked with routing messages coming off the ipc to the correct endpoint.
|
8560
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.
|
8561
8540
|
If functionality is not about receiving messages, it does not belong here.
|
8562
8541
|
*/
|
8563
|
-
class MessageReceiver extends base_1$
|
8542
|
+
class MessageReceiver extends base_1$k.Base {
|
8564
8543
|
constructor(wire) {
|
8565
8544
|
super(wire);
|
8566
8545
|
this.onmessage = (msg) => {
|
@@ -8729,13 +8708,13 @@ class CombinedStrategy {
|
|
8729
8708
|
}
|
8730
8709
|
strategy.default = CombinedStrategy;
|
8731
8710
|
|
8732
|
-
var __classPrivateFieldSet$
|
8711
|
+
var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8733
8712
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8734
8713
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8735
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");
|
8736
8715
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
8737
8716
|
};
|
8738
|
-
var __classPrivateFieldGet$
|
8717
|
+
var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8739
8718
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8740
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");
|
8741
8720
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -8747,7 +8726,7 @@ var _ConnectionManager_messageReceiver, _ConnectionManager_rtcConnectionManager;
|
|
8747
8726
|
Object.defineProperty(connectionManager, "__esModule", { value: true });
|
8748
8727
|
connectionManager.ConnectionManager = void 0;
|
8749
8728
|
const exhaustive_1 = exhaustive;
|
8750
|
-
const base_1$
|
8729
|
+
const base_1$j = base;
|
8751
8730
|
const strategy_1 = strategy$3;
|
8752
8731
|
const strategy_2 = strategy$2;
|
8753
8732
|
const ice_manager_1 = iceManager;
|
@@ -8755,7 +8734,7 @@ const provider_1$1 = provider;
|
|
8755
8734
|
const message_receiver_1 = messageReceiver$1;
|
8756
8735
|
const protocol_manager_1 = protocolManager;
|
8757
8736
|
const strategy_3 = __importDefault$5(strategy);
|
8758
|
-
class ConnectionManager extends base_1$
|
8737
|
+
class ConnectionManager extends base_1$j.Base {
|
8759
8738
|
static getProtocolOptionsFromStrings(protocols) {
|
8760
8739
|
return protocols.map((protocol) => {
|
8761
8740
|
switch (protocol) {
|
@@ -8784,8 +8763,8 @@ class ConnectionManager extends base_1$i.Base {
|
|
8784
8763
|
};
|
8785
8764
|
this.providerMap = new Map();
|
8786
8765
|
this.protocolManager = new protocol_manager_1.ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
|
8787
|
-
__classPrivateFieldSet$
|
8788
|
-
__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");
|
8789
8768
|
wire.registerMessageHandler(this.onmessage.bind(this));
|
8790
8769
|
}
|
8791
8770
|
createProvider(options, providerIdentity) {
|
@@ -8796,7 +8775,7 @@ class ConnectionManager extends base_1$i.Base {
|
|
8796
8775
|
case 'rtc':
|
8797
8776
|
return new strategy_2.RTCStrategy();
|
8798
8777
|
case 'classic':
|
8799
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
8778
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f"),
|
8800
8779
|
// Providers do not have an endpointId, use channelId as endpointId in the strategy.
|
8801
8780
|
providerIdentity.channelId, providerIdentity);
|
8802
8781
|
default:
|
@@ -8832,7 +8811,7 @@ class ConnectionManager extends base_1$i.Base {
|
|
8832
8811
|
const supportedProtocols = await Promise.all(protocols.map(async (type) => {
|
8833
8812
|
switch (type) {
|
8834
8813
|
case 'rtc': {
|
8835
|
-
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$
|
8814
|
+
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
|
8836
8815
|
rtcPacket = { rtcClient, channels, channelsOpened };
|
8837
8816
|
return {
|
8838
8817
|
type: 'rtc',
|
@@ -8859,18 +8838,18 @@ class ConnectionManager extends base_1$i.Base {
|
|
8859
8838
|
routingInfo.endpointId = this.wire.environment.getNextMessageId();
|
8860
8839
|
// For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
|
8861
8840
|
// clients that are in the same context as the newly-connected client.
|
8862
|
-
__classPrivateFieldGet$
|
8841
|
+
__classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
|
8863
8842
|
}
|
8864
8843
|
const answer = routingInfo.answer ?? {
|
8865
8844
|
supportedProtocols: [{ type: 'classic', version: 1 }]
|
8866
8845
|
};
|
8867
8846
|
const createStrategyFromAnswer = async (protocol) => {
|
8868
8847
|
if (protocol.type === 'rtc' && rtcPacket) {
|
8869
|
-
await __classPrivateFieldGet$
|
8848
|
+
await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
|
8870
8849
|
return new strategy_2.RTCStrategy();
|
8871
8850
|
}
|
8872
8851
|
if (protocol.type === 'classic') {
|
8873
|
-
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);
|
8874
8853
|
}
|
8875
8854
|
return null;
|
8876
8855
|
};
|
@@ -8938,7 +8917,7 @@ class ConnectionManager extends base_1$i.Base {
|
|
8938
8917
|
clientAnswer = await overlappingProtocols.reduce(async (accumP, protocolToUse) => {
|
8939
8918
|
const answer = await accumP;
|
8940
8919
|
if (protocolToUse.type === 'rtc') {
|
8941
|
-
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);
|
8942
8921
|
answer.supportedProtocols.push({
|
8943
8922
|
type: 'rtc',
|
8944
8923
|
version: strategy_2.RTCInfo.version,
|
@@ -8986,13 +8965,13 @@ _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnec
|
|
8986
8965
|
*
|
8987
8966
|
* @packageDocumentation
|
8988
8967
|
*/
|
8989
|
-
var __classPrivateFieldSet$
|
8968
|
+
var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8990
8969
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8991
8970
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8992
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");
|
8993
8972
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
8994
8973
|
};
|
8995
|
-
var __classPrivateFieldGet$
|
8974
|
+
var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8996
8975
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8997
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");
|
8998
8977
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -9002,8 +8981,8 @@ Object.defineProperty(channel$1, "__esModule", { value: true });
|
|
9002
8981
|
channel$1.Channel = void 0;
|
9003
8982
|
/* eslint-disable no-console */
|
9004
8983
|
const events_1$5 = require$$0;
|
9005
|
-
const lazy_1$
|
9006
|
-
const base_1$
|
8984
|
+
const lazy_1$3 = lazy;
|
8985
|
+
const base_1$i = base;
|
9007
8986
|
const client_1 = client;
|
9008
8987
|
const connection_manager_1 = connectionManager;
|
9009
8988
|
const provider_1 = provider;
|
@@ -9034,7 +9013,7 @@ function retryDelay(count) {
|
|
9034
9013
|
* * {@link Channel.onChannelConnect onChannelConnect(listener)}
|
9035
9014
|
* * {@link Channel.onChannelDisconnect onChannelDisconnect(listener)}
|
9036
9015
|
*/
|
9037
|
-
class Channel extends base_1$
|
9016
|
+
class Channel extends base_1$i.EmitterBase {
|
9038
9017
|
/**
|
9039
9018
|
* @internal
|
9040
9019
|
*/
|
@@ -9043,17 +9022,17 @@ class Channel extends base_1$h.EmitterBase {
|
|
9043
9022
|
_Channel_connectionManager.set(this, void 0);
|
9044
9023
|
_Channel_internalEmitter.set(this, new events_1$5.EventEmitter());
|
9045
9024
|
// OpenFin API has not been injected at construction time, *must* wait for API to be ready.
|
9046
|
-
_Channel_readyToConnect.set(this, new lazy_1$
|
9025
|
+
_Channel_readyToConnect.set(this, new lazy_1$3.AsyncRetryableLazy(async () => {
|
9047
9026
|
await Promise.all([
|
9048
9027
|
this.on('disconnected', (eventPayload) => {
|
9049
9028
|
client_1.ChannelClient.handleProviderDisconnect(eventPayload);
|
9050
9029
|
}),
|
9051
9030
|
this.on('connected', (...args) => {
|
9052
|
-
__classPrivateFieldGet$
|
9031
|
+
__classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").emit('connected', ...args);
|
9053
9032
|
})
|
9054
9033
|
]).catch(() => new Error('error setting up channel connection listeners'));
|
9055
9034
|
}));
|
9056
|
-
__classPrivateFieldSet$
|
9035
|
+
__classPrivateFieldSet$a(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
|
9057
9036
|
}
|
9058
9037
|
/**
|
9059
9038
|
*
|
@@ -9128,7 +9107,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
9128
9107
|
resolve(true);
|
9129
9108
|
}
|
9130
9109
|
};
|
9131
|
-
__classPrivateFieldGet$
|
9110
|
+
__classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
|
9132
9111
|
});
|
9133
9112
|
try {
|
9134
9113
|
if (retryInfo.count > 0) {
|
@@ -9160,7 +9139,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
9160
9139
|
finally {
|
9161
9140
|
retryInfo.count += 1;
|
9162
9141
|
// in case of other errors, remove our listener
|
9163
|
-
__classPrivateFieldGet$
|
9142
|
+
__classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
|
9164
9143
|
}
|
9165
9144
|
} while (shouldWait); // If we're waiting we retry the above loop
|
9166
9145
|
// Should wait was false, no channel was found.
|
@@ -9219,12 +9198,12 @@ class Channel extends base_1$h.EmitterBase {
|
|
9219
9198
|
async connect(channelName, options = {}) {
|
9220
9199
|
// Make sure we don't connect before listeners are set up
|
9221
9200
|
// This also errors if we're not in OpenFin, ensuring we don't run unnecessary code
|
9222
|
-
await __classPrivateFieldGet$
|
9201
|
+
await __classPrivateFieldGet$b(this, _Channel_readyToConnect, "f").getValue();
|
9223
9202
|
if (!channelName || typeof channelName !== 'string') {
|
9224
9203
|
throw new Error('Please provide a channelName string to connect to a channel.');
|
9225
9204
|
}
|
9226
9205
|
const opts = { wait: true, ...this.wire.environment.getDefaultChannelOptions().connect, ...options };
|
9227
|
-
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$
|
9206
|
+
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createClientOffer(opts);
|
9228
9207
|
let connectionUrl;
|
9229
9208
|
if (this.fin.me.isFrame || this.fin.me.isView || this.fin.me.isWindow) {
|
9230
9209
|
connectionUrl = (await this.fin.me.getInfo()).url;
|
@@ -9236,7 +9215,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
9236
9215
|
connectionUrl
|
9237
9216
|
};
|
9238
9217
|
const routingInfo = await this.safeConnect(channelName, opts.wait, connectPayload);
|
9239
|
-
const strategy = await __classPrivateFieldGet$
|
9218
|
+
const strategy = await __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
|
9240
9219
|
const channel = new client_1.ChannelClient(routingInfo, () => client_1.ChannelClient.wireClose(this.wire, routingInfo, routingInfo.endpointId), strategy);
|
9241
9220
|
// It is the client's responsibility to handle endpoint disconnection to the provider.
|
9242
9221
|
// If the endpoint dies, the client will force a disconnection through the core.
|
@@ -9305,7 +9284,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
9305
9284
|
throw new Error('Please provide a channelName to create a channel');
|
9306
9285
|
}
|
9307
9286
|
const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
|
9308
|
-
const channel = __classPrivateFieldGet$
|
9287
|
+
const channel = __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
|
9309
9288
|
// TODO: fix typing (internal)
|
9310
9289
|
// @ts-expect-error
|
9311
9290
|
this.on('client-disconnected', (eventPayload) => {
|
@@ -9329,7 +9308,7 @@ interappbus.InterAppPayload = interappbus.InterApplicationBus = void 0;
|
|
9329
9308
|
* @packageDocumentation
|
9330
9309
|
*/
|
9331
9310
|
const events_1$4 = require$$0;
|
9332
|
-
const base_1$
|
9311
|
+
const base_1$h = base;
|
9333
9312
|
const ref_counter_1 = refCounter;
|
9334
9313
|
const index_1$2 = channel$1;
|
9335
9314
|
const validate_1$3 = validate;
|
@@ -9337,7 +9316,7 @@ const validate_1$3 = validate;
|
|
9337
9316
|
* A messaging bus that allows for pub/sub messaging between different applications.
|
9338
9317
|
*
|
9339
9318
|
*/
|
9340
|
-
class InterApplicationBus extends base_1$
|
9319
|
+
class InterApplicationBus extends base_1$h.Base {
|
9341
9320
|
/**
|
9342
9321
|
* @internal
|
9343
9322
|
*/
|
@@ -9543,12 +9522,12 @@ var clipboard = {};
|
|
9543
9522
|
*/
|
9544
9523
|
Object.defineProperty(clipboard, "__esModule", { value: true });
|
9545
9524
|
clipboard.Clipboard = void 0;
|
9546
|
-
const base_1$
|
9525
|
+
const base_1$g = base;
|
9547
9526
|
/**
|
9548
9527
|
* The Clipboard API allows reading and writing to the clipboard in multiple formats.
|
9549
9528
|
*
|
9550
9529
|
*/
|
9551
|
-
class Clipboard extends base_1$
|
9530
|
+
class Clipboard extends base_1$g.Base {
|
9552
9531
|
/**
|
9553
9532
|
* Writes data into the clipboard as plain text
|
9554
9533
|
* @param writeObj The object for writing data into the clipboard
|
@@ -9737,7 +9716,7 @@ var Instance$4 = {};
|
|
9737
9716
|
Object.defineProperty(Instance$4, "__esModule", { value: true });
|
9738
9717
|
Instance$4.ExternalApplication = void 0;
|
9739
9718
|
/* eslint-disable import/prefer-default-export */
|
9740
|
-
const base_1$
|
9719
|
+
const base_1$f = base;
|
9741
9720
|
/**
|
9742
9721
|
* An ExternalApplication object representing native language adapter connections to the runtime. Allows
|
9743
9722
|
* the developer to listen to {@link OpenFin.ExternalApplicationEvents external application events}.
|
@@ -9748,7 +9727,7 @@ const base_1$e = base;
|
|
9748
9727
|
* - Processes started via `System.launchExternalApplication`
|
9749
9728
|
* - Processes monitored via `System.monitorExternalProcess`
|
9750
9729
|
*/
|
9751
|
-
class ExternalApplication extends base_1$
|
9730
|
+
class ExternalApplication extends base_1$f.EmitterBase {
|
9752
9731
|
/**
|
9753
9732
|
* @internal
|
9754
9733
|
*/
|
@@ -9776,12 +9755,12 @@ Instance$4.ExternalApplication = ExternalApplication;
|
|
9776
9755
|
|
9777
9756
|
Object.defineProperty(Factory$5, "__esModule", { value: true });
|
9778
9757
|
Factory$5.ExternalApplicationModule = void 0;
|
9779
|
-
const base_1$
|
9758
|
+
const base_1$e = base;
|
9780
9759
|
const Instance_1$4 = Instance$4;
|
9781
9760
|
/**
|
9782
9761
|
* Static namespace for OpenFin API methods that interact with the {@link ExternalApplication} class, available under `fin.ExternalApplication`.
|
9783
9762
|
*/
|
9784
|
-
class ExternalApplicationModule extends base_1$
|
9763
|
+
class ExternalApplicationModule extends base_1$e.Base {
|
9785
9764
|
/**
|
9786
9765
|
* Asynchronously returns an External Application object that represents an external application.
|
9787
9766
|
* <br>It is possible to wrap a process that does not yet exist, (for example, to listen for startup-related events)
|
@@ -9863,7 +9842,7 @@ var Instance$3 = {};
|
|
9863
9842
|
Object.defineProperty(Instance$3, "__esModule", { value: true });
|
9864
9843
|
Instance$3._Frame = void 0;
|
9865
9844
|
/* eslint-disable import/prefer-default-export */
|
9866
|
-
const base_1$
|
9845
|
+
const base_1$d = base;
|
9867
9846
|
/**
|
9868
9847
|
* An iframe represents an embedded HTML page within a parent HTML page. Because this embedded page
|
9869
9848
|
* has its own DOM and global JS context (which may or may not be linked to that of the parent depending
|
@@ -9884,7 +9863,7 @@ const base_1$c = base;
|
|
9884
9863
|
* The fin.Frame namespace represents a way to interact with `iframes` and facilitates the discovery of current context
|
9885
9864
|
* (iframe or main window) as well as the ability to listen for {@link OpenFin.FrameEvents frame-specific events}.
|
9886
9865
|
*/
|
9887
|
-
class _Frame extends base_1$
|
9866
|
+
class _Frame extends base_1$d.EmitterBase {
|
9888
9867
|
/**
|
9889
9868
|
* @internal
|
9890
9869
|
*/
|
@@ -9930,13 +9909,13 @@ Instance$3._Frame = _Frame;
|
|
9930
9909
|
|
9931
9910
|
Object.defineProperty(Factory$4, "__esModule", { value: true });
|
9932
9911
|
Factory$4._FrameModule = void 0;
|
9933
|
-
const base_1$
|
9912
|
+
const base_1$c = base;
|
9934
9913
|
const validate_1$2 = validate;
|
9935
9914
|
const Instance_1$3 = Instance$3;
|
9936
9915
|
/**
|
9937
9916
|
* Static namespace for OpenFin API methods that interact with the {@link _Frame} class, available under `fin.Frame`.
|
9938
9917
|
*/
|
9939
|
-
class _FrameModule extends base_1$
|
9918
|
+
class _FrameModule extends base_1$c.Base {
|
9940
9919
|
/**
|
9941
9920
|
* Asynchronously returns an API handle for the given Frame identity.
|
9942
9921
|
*
|
@@ -10057,12 +10036,12 @@ var globalHotkey = {};
|
|
10057
10036
|
|
10058
10037
|
Object.defineProperty(globalHotkey, "__esModule", { value: true });
|
10059
10038
|
globalHotkey.GlobalHotkey = void 0;
|
10060
|
-
const base_1$
|
10039
|
+
const base_1$b = base;
|
10061
10040
|
/**
|
10062
10041
|
* The GlobalHotkey module can register/unregister a global hotkeys.
|
10063
10042
|
*
|
10064
10043
|
*/
|
10065
|
-
class GlobalHotkey extends base_1$
|
10044
|
+
class GlobalHotkey extends base_1$b.EmitterBase {
|
10066
10045
|
/**
|
10067
10046
|
* @internal
|
10068
10047
|
*/
|
@@ -10196,13 +10175,13 @@ var Factory$3 = {};
|
|
10196
10175
|
|
10197
10176
|
var Instance$2 = {};
|
10198
10177
|
|
10199
|
-
var __classPrivateFieldSet$
|
10178
|
+
var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
10200
10179
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
10201
10180
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
10202
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");
|
10203
10182
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
10204
10183
|
};
|
10205
|
-
var __classPrivateFieldGet$
|
10184
|
+
var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
10206
10185
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
10207
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");
|
10208
10187
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -10211,14 +10190,14 @@ var _Platform_channelName, _Platform_connectToProvider;
|
|
10211
10190
|
Object.defineProperty(Instance$2, "__esModule", { value: true });
|
10212
10191
|
Instance$2.Platform = void 0;
|
10213
10192
|
/* eslint-disable import/prefer-default-export, no-undef */
|
10214
|
-
const base_1$
|
10193
|
+
const base_1$a = base;
|
10215
10194
|
const validate_1$1 = validate;
|
10216
10195
|
/** Manages the life cycle of windows and views in the application.
|
10217
10196
|
*
|
10218
10197
|
* Enables taking snapshots of itself and applying them to restore a previous configuration
|
10219
10198
|
* as well as listen to {@link OpenFin.PlatformEvents platform events}.
|
10220
10199
|
*/
|
10221
|
-
class Platform extends base_1$
|
10200
|
+
class Platform extends base_1$a.EmitterBase {
|
10222
10201
|
/**
|
10223
10202
|
* @internal
|
10224
10203
|
*/
|
@@ -10239,24 +10218,24 @@ class Platform extends base_1$9.EmitterBase {
|
|
10239
10218
|
this.wire.sendAction('platform-get-client', this.identity).catch((e) => {
|
10240
10219
|
// don't expose
|
10241
10220
|
});
|
10242
|
-
if (!Platform.clientMap.has(__classPrivateFieldGet$
|
10243
|
-
const clientPromise = __classPrivateFieldGet$
|
10244
|
-
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);
|
10245
10224
|
}
|
10246
10225
|
// we set it above
|
10247
10226
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
10248
|
-
return Platform.clientMap.get(__classPrivateFieldGet$
|
10227
|
+
return Platform.clientMap.get(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
|
10249
10228
|
};
|
10250
10229
|
_Platform_connectToProvider.set(this, async () => {
|
10251
10230
|
try {
|
10252
|
-
const client = await this._channel.connect(__classPrivateFieldGet$
|
10231
|
+
const client = await this._channel.connect(__classPrivateFieldGet$a(this, _Platform_channelName, "f"), { wait: false });
|
10253
10232
|
client.onDisconnection(() => {
|
10254
|
-
Platform.clientMap.delete(__classPrivateFieldGet$
|
10233
|
+
Platform.clientMap.delete(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
|
10255
10234
|
});
|
10256
10235
|
return client;
|
10257
10236
|
}
|
10258
10237
|
catch (e) {
|
10259
|
-
Platform.clientMap.delete(__classPrivateFieldGet$
|
10238
|
+
Platform.clientMap.delete(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
|
10260
10239
|
throw new Error('The targeted Platform is not currently running. Listen for application-started event for the given Uuid.');
|
10261
10240
|
}
|
10262
10241
|
});
|
@@ -10269,7 +10248,7 @@ class Platform extends base_1$9.EmitterBase {
|
|
10269
10248
|
if (errorMsg) {
|
10270
10249
|
throw new Error(errorMsg);
|
10271
10250
|
}
|
10272
|
-
__classPrivateFieldSet$
|
10251
|
+
__classPrivateFieldSet$9(this, _Platform_channelName, channelName, "f");
|
10273
10252
|
this._channel = this.fin.InterApplicationBus.Channel;
|
10274
10253
|
this.identity = { uuid: identity.uuid };
|
10275
10254
|
this.Layout = this.fin.Platform.Layout;
|
@@ -11325,13 +11304,13 @@ const createRelayedDispatch = (client, target, relayId, relayErrorMsg) => async
|
|
11325
11304
|
};
|
11326
11305
|
channelApiRelay.createRelayedDispatch = createRelayedDispatch;
|
11327
11306
|
|
11328
|
-
var __classPrivateFieldSet$
|
11307
|
+
var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
11329
11308
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
11330
11309
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
11331
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");
|
11332
11311
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
11333
11312
|
};
|
11334
|
-
var __classPrivateFieldGet$
|
11313
|
+
var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
11335
11314
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
11336
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");
|
11337
11316
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -11385,7 +11364,7 @@ class LayoutNode {
|
|
11385
11364
|
* console.log(`The parent ColumnOrRow is root: ${parentIsRoot}`);
|
11386
11365
|
* ```
|
11387
11366
|
*/
|
11388
|
-
this.isRoot = () => __classPrivateFieldGet$
|
11367
|
+
this.isRoot = () => __classPrivateFieldGet$9(this, _LayoutNode_client, "f").isRoot(this.entityId);
|
11389
11368
|
/**
|
11390
11369
|
* Checks if the TabStack or ColumnOrRow exists
|
11391
11370
|
*
|
@@ -11405,7 +11384,7 @@ class LayoutNode {
|
|
11405
11384
|
* console.log(`The entity exists: ${exists}`);
|
11406
11385
|
* ```
|
11407
11386
|
*/
|
11408
|
-
this.exists = () => __classPrivateFieldGet$
|
11387
|
+
this.exists = () => __classPrivateFieldGet$9(this, _LayoutNode_client, "f").exists(this.entityId);
|
11409
11388
|
/**
|
11410
11389
|
* Retrieves the parent of the TabStack or ColumnOrRow
|
11411
11390
|
*
|
@@ -11426,11 +11405,11 @@ class LayoutNode {
|
|
11426
11405
|
* ```
|
11427
11406
|
*/
|
11428
11407
|
this.getParent = async () => {
|
11429
|
-
const parent = await __classPrivateFieldGet$
|
11408
|
+
const parent = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").getParent(this.entityId);
|
11430
11409
|
if (!parent) {
|
11431
11410
|
return undefined;
|
11432
11411
|
}
|
11433
|
-
return LayoutNode.getEntity(parent, __classPrivateFieldGet$
|
11412
|
+
return LayoutNode.getEntity(parent, __classPrivateFieldGet$9(this, _LayoutNode_client, "f"));
|
11434
11413
|
};
|
11435
11414
|
/**
|
11436
11415
|
* Creates a new TabStack adjacent to the given TabStack or ColumnOrRow. Inputs can be new views to create, or existing views.
|
@@ -11481,8 +11460,8 @@ class LayoutNode {
|
|
11481
11460
|
* @experimental
|
11482
11461
|
*/
|
11483
11462
|
this.createAdjacentStack = async (views, options) => {
|
11484
|
-
const entityId = await __classPrivateFieldGet$
|
11485
|
-
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"));
|
11486
11465
|
};
|
11487
11466
|
/**
|
11488
11467
|
* Retrieves the adjacent TabStacks of the given TabStack or ColumnOrRow.
|
@@ -11510,16 +11489,16 @@ class LayoutNode {
|
|
11510
11489
|
* @experimental
|
11511
11490
|
*/
|
11512
11491
|
this.getAdjacentStacks = async (edge) => {
|
11513
|
-
const adjacentStacks = await __classPrivateFieldGet$
|
11492
|
+
const adjacentStacks = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").getAdjacentStacks({
|
11514
11493
|
targetId: this.entityId,
|
11515
11494
|
edge
|
11516
11495
|
});
|
11517
11496
|
return adjacentStacks.map((stack) => LayoutNode.getEntity({
|
11518
11497
|
type: 'stack',
|
11519
11498
|
entityId: stack.entityId
|
11520
|
-
}, __classPrivateFieldGet$
|
11499
|
+
}, __classPrivateFieldGet$9(this, _LayoutNode_client, "f")));
|
11521
11500
|
};
|
11522
|
-
__classPrivateFieldSet$
|
11501
|
+
__classPrivateFieldSet$8(this, _LayoutNode_client, client, "f");
|
11523
11502
|
this.entityId = entityId;
|
11524
11503
|
}
|
11525
11504
|
}
|
@@ -11592,7 +11571,7 @@ class TabStack extends LayoutNode {
|
|
11592
11571
|
* ```
|
11593
11572
|
* @experimental
|
11594
11573
|
*/
|
11595
|
-
this.getViews = () => __classPrivateFieldGet$
|
11574
|
+
this.getViews = () => __classPrivateFieldGet$9(this, _TabStack_client, "f").getStackViews(this.entityId);
|
11596
11575
|
/**
|
11597
11576
|
* Adds or creates a view in this {@link TabStack}.
|
11598
11577
|
*
|
@@ -11622,7 +11601,7 @@ class TabStack extends LayoutNode {
|
|
11622
11601
|
* ```
|
11623
11602
|
* @experimental
|
11624
11603
|
*/
|
11625
|
-
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);
|
11626
11605
|
/**
|
11627
11606
|
* Removes a view from this {@link TabStack}.
|
11628
11607
|
*
|
@@ -11652,7 +11631,7 @@ class TabStack extends LayoutNode {
|
|
11652
11631
|
* ```
|
11653
11632
|
*/
|
11654
11633
|
this.removeView = async (view) => {
|
11655
|
-
await __classPrivateFieldGet$
|
11634
|
+
await __classPrivateFieldGet$9(this, _TabStack_client, "f").removeViewFromStack(this.entityId, view);
|
11656
11635
|
};
|
11657
11636
|
/**
|
11658
11637
|
* Sets the active view of the {@link TabStack} without focusing it.
|
@@ -11676,9 +11655,9 @@ class TabStack extends LayoutNode {
|
|
11676
11655
|
* @experimental
|
11677
11656
|
*/
|
11678
11657
|
this.setActiveView = async (view) => {
|
11679
|
-
await __classPrivateFieldGet$
|
11658
|
+
await __classPrivateFieldGet$9(this, _TabStack_client, "f").setStackActiveView(this.entityId, view);
|
11680
11659
|
};
|
11681
|
-
__classPrivateFieldSet$
|
11660
|
+
__classPrivateFieldSet$8(this, _TabStack_client, client, "f");
|
11682
11661
|
}
|
11683
11662
|
}
|
11684
11663
|
layoutEntities.TabStack = TabStack;
|
@@ -11717,10 +11696,10 @@ class ColumnOrRow extends LayoutNode {
|
|
11717
11696
|
* ```
|
11718
11697
|
*/
|
11719
11698
|
this.getContent = async () => {
|
11720
|
-
const contentItemEntities = await __classPrivateFieldGet$
|
11721
|
-
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")));
|
11722
11701
|
};
|
11723
|
-
__classPrivateFieldSet$
|
11702
|
+
__classPrivateFieldSet$8(this, _ColumnOrRow_client, client, "f");
|
11724
11703
|
this.type = type;
|
11725
11704
|
}
|
11726
11705
|
}
|
@@ -11735,7 +11714,7 @@ layout_constants.LAYOUT_CONTROLLER_ID = 'layout-entities';
|
|
11735
11714
|
// TODO: eventually export this somehow
|
11736
11715
|
layout_constants.DEFAULT_LAYOUT_KEY = '__default__';
|
11737
11716
|
|
11738
|
-
var __classPrivateFieldGet$
|
11717
|
+
var __classPrivateFieldGet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
11739
11718
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
11740
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");
|
11741
11720
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -11743,9 +11722,9 @@ var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
11743
11722
|
var _Layout_instances, _Layout_layoutClient, _Layout_forwardLayoutAction;
|
11744
11723
|
Object.defineProperty(Instance$1, "__esModule", { value: true });
|
11745
11724
|
Instance$1.Layout = void 0;
|
11746
|
-
const lazy_1$
|
11725
|
+
const lazy_1$2 = lazy;
|
11747
11726
|
const validate_1 = validate;
|
11748
|
-
const base_1$
|
11727
|
+
const base_1$9 = base;
|
11749
11728
|
const common_utils_1$1 = commonUtils;
|
11750
11729
|
const layout_entities_1 = layoutEntities;
|
11751
11730
|
const layout_constants_1$1 = layout_constants;
|
@@ -11881,12 +11860,12 @@ const layout_constants_1$1 = layout_constants;
|
|
11881
11860
|
* }
|
11882
11861
|
* ```
|
11883
11862
|
*/
|
11884
|
-
class Layout extends base_1$
|
11863
|
+
class Layout extends base_1$9.Base {
|
11885
11864
|
/**
|
11886
11865
|
* @internal
|
11887
11866
|
*/
|
11888
11867
|
static getClient(layout) {
|
11889
|
-
return __classPrivateFieldGet$
|
11868
|
+
return __classPrivateFieldGet$8(layout, _Layout_layoutClient, "f").getValue();
|
11890
11869
|
}
|
11891
11870
|
/**
|
11892
11871
|
* @internal
|
@@ -11900,7 +11879,7 @@ class Layout extends base_1$8.Base {
|
|
11900
11879
|
* Lazily constructed {@link LayoutEntitiesClient} bound to this platform's client and identity
|
11901
11880
|
* The client is for {@link LayoutEntitiesController}
|
11902
11881
|
*/
|
11903
|
-
_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)));
|
11904
11883
|
/**
|
11905
11884
|
* Replaces a Platform window's layout with a new layout.
|
11906
11885
|
*
|
@@ -12109,7 +12088,7 @@ class Layout extends base_1$8.Base {
|
|
12109
12088
|
this.wire.sendAction('layout-get-root-item').catch(() => {
|
12110
12089
|
// don't expose
|
12111
12090
|
});
|
12112
|
-
const client = await __classPrivateFieldGet$
|
12091
|
+
const client = await __classPrivateFieldGet$8(this, _Layout_layoutClient, "f").getValue();
|
12113
12092
|
const root = await client.getRoot('layoutName' in this.identity ? this.identity : undefined);
|
12114
12093
|
return layout_entities_1.LayoutNode.getEntity(root, client);
|
12115
12094
|
}
|
@@ -12127,7 +12106,7 @@ class Layout extends base_1$8.Base {
|
|
12127
12106
|
this.wire.sendAction('layout-get-stack-by-view').catch(() => {
|
12128
12107
|
// don't expose
|
12129
12108
|
});
|
12130
|
-
const client = await __classPrivateFieldGet$
|
12109
|
+
const client = await __classPrivateFieldGet$8(this, _Layout_layoutClient, "f").getValue();
|
12131
12110
|
const stack = await client.getStackByView(identity);
|
12132
12111
|
if (!stack) {
|
12133
12112
|
throw new Error(`No stack found for view: ${identity.uuid}/${identity.name}`);
|
@@ -12147,7 +12126,7 @@ class Layout extends base_1$8.Base {
|
|
12147
12126
|
this.wire.sendAction('layout-add-view').catch((e) => {
|
12148
12127
|
// don't expose
|
12149
12128
|
});
|
12150
|
-
const { identity } = await __classPrivateFieldGet$
|
12129
|
+
const { identity } = await __classPrivateFieldGet$8(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-add-view', {
|
12151
12130
|
viewOptions,
|
12152
12131
|
location,
|
12153
12132
|
targetView
|
@@ -12165,7 +12144,7 @@ class Layout extends base_1$8.Base {
|
|
12165
12144
|
this.wire.sendAction('layout-close-view').catch((e) => {
|
12166
12145
|
// don't expose
|
12167
12146
|
});
|
12168
|
-
await __classPrivateFieldGet$
|
12147
|
+
await __classPrivateFieldGet$8(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-close-view', { viewIdentity });
|
12169
12148
|
}
|
12170
12149
|
}
|
12171
12150
|
Instance$1.Layout = Layout;
|
@@ -12179,12 +12158,12 @@ async function _Layout_forwardLayoutAction(action, payload) {
|
|
12179
12158
|
return client.dispatch(action, { target: this.identity, opts: payload });
|
12180
12159
|
};
|
12181
12160
|
|
12182
|
-
var __classPrivateFieldGet$
|
12161
|
+
var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
12183
12162
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
12184
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");
|
12185
12164
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
12186
12165
|
};
|
12187
|
-
var __classPrivateFieldSet$
|
12166
|
+
var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
12188
12167
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
12189
12168
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
12190
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");
|
@@ -12193,13 +12172,13 @@ var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
12193
12172
|
var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_getLayoutManagerSpy, _LayoutModule_getSafeLayoutManager;
|
12194
12173
|
Object.defineProperty(Factory$2, "__esModule", { value: true });
|
12195
12174
|
Factory$2.LayoutModule = void 0;
|
12196
|
-
const base_1$
|
12175
|
+
const base_1$8 = base;
|
12197
12176
|
const Instance_1$2 = Instance$1;
|
12198
12177
|
const layout_constants_1 = layout_constants;
|
12199
12178
|
/**
|
12200
12179
|
* Static namespace for OpenFin API methods that interact with the {@link Layout} class, available under `fin.Platform.Layout`.
|
12201
12180
|
*/
|
12202
|
-
class LayoutModule extends base_1$
|
12181
|
+
class LayoutModule extends base_1$8.Base {
|
12203
12182
|
constructor() {
|
12204
12183
|
super(...arguments);
|
12205
12184
|
_LayoutModule_instances.add(this);
|
@@ -12250,23 +12229,23 @@ class LayoutModule extends base_1$7.Base {
|
|
12250
12229
|
if (!this.wire.environment.layoutAllowedInContext(this.fin)) {
|
12251
12230
|
throw new Error('Layout.init can only be called from a Window context.');
|
12252
12231
|
}
|
12253
|
-
if (__classPrivateFieldGet$
|
12232
|
+
if (__classPrivateFieldGet$7(this, _LayoutModule_layoutInitializationAttempted, "f")) {
|
12254
12233
|
throw new Error('Layout.init was already called, please use Layout.create to add additional layouts.');
|
12255
12234
|
}
|
12256
12235
|
if (this.wire.environment.type === 'openfin') {
|
12257
12236
|
// preload the client
|
12258
12237
|
await this.fin.Platform.getCurrentSync().getClient();
|
12259
12238
|
}
|
12260
|
-
__classPrivateFieldSet$
|
12239
|
+
__classPrivateFieldSet$7(this, _LayoutModule_layoutInitializationAttempted, true, "f");
|
12261
12240
|
// TODO: rename to createLayoutManager
|
12262
|
-
__classPrivateFieldSet$
|
12263
|
-
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);
|
12264
12243
|
const meIdentity = { name: this.fin.me.name, uuid: this.fin.me.uuid };
|
12265
12244
|
if (!options.layoutManagerOverride) {
|
12266
12245
|
// CORE-1081 to be removed when we actually delete the `layoutManager` prop
|
12267
12246
|
// in single-layout case, we return the undocumented layoutManager type
|
12268
12247
|
const layoutIdentity = { layoutName: layout_constants_1.DEFAULT_LAYOUT_KEY, ...meIdentity };
|
12269
|
-
return __classPrivateFieldGet$
|
12248
|
+
return __classPrivateFieldGet$7(this, _LayoutModule_getLayoutManagerSpy, "f").call(this, layoutIdentity);
|
12270
12249
|
}
|
12271
12250
|
return this.wrapSync(meIdentity);
|
12272
12251
|
};
|
@@ -12295,13 +12274,13 @@ class LayoutModule extends base_1$7.Base {
|
|
12295
12274
|
* @returns
|
12296
12275
|
*/
|
12297
12276
|
this.getCurrentLayoutManagerSync = () => {
|
12298
|
-
return __classPrivateFieldGet$
|
12277
|
+
return __classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.getCurrentLayoutManagerSync()`);
|
12299
12278
|
};
|
12300
12279
|
this.create = async (options) => {
|
12301
|
-
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);
|
12302
12281
|
};
|
12303
12282
|
this.destroy = async (layoutIdentity) => {
|
12304
|
-
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);
|
12305
12284
|
};
|
12306
12285
|
}
|
12307
12286
|
/**
|
@@ -12442,10 +12421,10 @@ class LayoutModule extends base_1$7.Base {
|
|
12442
12421
|
}
|
12443
12422
|
Factory$2.LayoutModule = LayoutModule;
|
12444
12423
|
_LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_getLayoutManagerSpy = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
|
12445
|
-
if (!__classPrivateFieldGet$
|
12424
|
+
if (!__classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f")) {
|
12446
12425
|
throw new Error(`You must call init before using the API ${method}`);
|
12447
12426
|
}
|
12448
|
-
return __classPrivateFieldGet$
|
12427
|
+
return __classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f");
|
12449
12428
|
};
|
12450
12429
|
|
12451
12430
|
(function (exports) {
|
@@ -12482,13 +12461,13 @@ _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layou
|
|
12482
12461
|
|
12483
12462
|
Object.defineProperty(Factory$3, "__esModule", { value: true });
|
12484
12463
|
Factory$3.PlatformModule = void 0;
|
12485
|
-
const base_1$
|
12464
|
+
const base_1$7 = base;
|
12486
12465
|
const Instance_1$1 = Instance$2;
|
12487
12466
|
const index_1$1 = layout;
|
12488
12467
|
/**
|
12489
12468
|
* Static namespace for OpenFin API methods that interact with the {@link Platform} class, available under `fin.Platform`.
|
12490
12469
|
*/
|
12491
|
-
class PlatformModule extends base_1$
|
12470
|
+
class PlatformModule extends base_1$7.Base {
|
12492
12471
|
/**
|
12493
12472
|
* @internal
|
12494
12473
|
*/
|
@@ -13408,13 +13387,13 @@ class PrivateChannelProvider {
|
|
13408
13387
|
}
|
13409
13388
|
PrivateChannelProvider$1.PrivateChannelProvider = PrivateChannelProvider;
|
13410
13389
|
|
13411
|
-
var __classPrivateFieldSet$
|
13390
|
+
var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
13412
13391
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
13413
13392
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
13414
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");
|
13415
13394
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
13416
13395
|
};
|
13417
|
-
var __classPrivateFieldGet$
|
13396
|
+
var __classPrivateFieldGet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
13418
13397
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
13419
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");
|
13420
13399
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -13425,12 +13404,12 @@ var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || fu
|
|
13425
13404
|
var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
|
13426
13405
|
Object.defineProperty(InteropBroker$1, "__esModule", { value: true });
|
13427
13406
|
InteropBroker$1.InteropBroker = void 0;
|
13428
|
-
const base_1$
|
13407
|
+
const base_1$6 = base;
|
13429
13408
|
const SessionContextGroupBroker_1 = __importDefault$4(SessionContextGroupBroker$1);
|
13430
13409
|
const utils_1$7 = utils$3;
|
13431
13410
|
const isEqual_1$1 = __importDefault$4(require$$3);
|
13432
13411
|
const PrivateChannelProvider_1 = PrivateChannelProvider$1;
|
13433
|
-
const lazy_1 = lazy;
|
13412
|
+
const lazy_1$1 = lazy;
|
13434
13413
|
const defaultContextGroups = [
|
13435
13414
|
{
|
13436
13415
|
id: 'green',
|
@@ -13594,7 +13573,7 @@ const defaultContextGroups = [
|
|
13594
13573
|
* ---
|
13595
13574
|
*
|
13596
13575
|
*/
|
13597
|
-
class InteropBroker extends base_1$
|
13576
|
+
class InteropBroker extends base_1$6.Base {
|
13598
13577
|
/**
|
13599
13578
|
* @internal
|
13600
13579
|
*/
|
@@ -13605,19 +13584,19 @@ class InteropBroker extends base_1$5.Base {
|
|
13605
13584
|
_InteropBroker_contextGroups.set(this, void 0);
|
13606
13585
|
_InteropBroker_providerPromise.set(this, void 0);
|
13607
13586
|
this.getProvider = () => {
|
13608
|
-
return __classPrivateFieldGet$
|
13587
|
+
return __classPrivateFieldGet$6(this, _InteropBroker_providerPromise, "f").getValue();
|
13609
13588
|
};
|
13610
13589
|
this.interopClients = new Map();
|
13611
13590
|
this.contextGroupsById = new Map();
|
13612
|
-
__classPrivateFieldSet$
|
13613
|
-
__classPrivateFieldSet$
|
13591
|
+
__classPrivateFieldSet$6(this, _InteropBroker_contextGroups, options.contextGroups ?? [...defaultContextGroups], "f");
|
13592
|
+
__classPrivateFieldSet$6(this, _InteropBroker_fdc3Info, options.fdc3Info, "f");
|
13614
13593
|
if (options?.logging) {
|
13615
13594
|
this.logging = options.logging;
|
13616
13595
|
}
|
13617
13596
|
this.intentClientMap = new Map();
|
13618
13597
|
this.lastContextMap = new Map();
|
13619
13598
|
this.sessionContextGroupMap = new Map();
|
13620
|
-
__classPrivateFieldSet$
|
13599
|
+
__classPrivateFieldSet$6(this, _InteropBroker_providerPromise, new lazy_1$1.Lazy(createProvider), "f");
|
13621
13600
|
this.setContextGroupMap();
|
13622
13601
|
this.setupChannelProvider();
|
13623
13602
|
}
|
@@ -13885,7 +13864,7 @@ class InteropBroker extends base_1$5.Base {
|
|
13885
13864
|
// don't expose, analytics-only call
|
13886
13865
|
});
|
13887
13866
|
// Create copy for immutability
|
13888
|
-
return __classPrivateFieldGet$
|
13867
|
+
return __classPrivateFieldGet$6(this, _InteropBroker_contextGroups, "f").map((contextGroup) => {
|
13889
13868
|
return { ...contextGroup };
|
13890
13869
|
});
|
13891
13870
|
}
|
@@ -14296,7 +14275,7 @@ class InteropBroker extends base_1$5.Base {
|
|
14296
14275
|
const { fdc3Version } = payload;
|
14297
14276
|
return {
|
14298
14277
|
fdc3Version,
|
14299
|
-
...__classPrivateFieldGet$
|
14278
|
+
...__classPrivateFieldGet$6(this, _InteropBroker_fdc3Info, "f"),
|
14300
14279
|
optionalFeatures: {
|
14301
14280
|
OriginatingAppMetadata: false,
|
14302
14281
|
UserChannelMembershipAPIs: true
|
@@ -14673,27 +14652,27 @@ var InteropClient$1 = {};
|
|
14673
14652
|
|
14674
14653
|
var SessionContextGroupClient$1 = {};
|
14675
14654
|
|
14676
|
-
var __classPrivateFieldSet$
|
14655
|
+
var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
14677
14656
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
14678
14657
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
14679
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");
|
14680
14659
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
14681
14660
|
};
|
14682
|
-
var __classPrivateFieldGet$
|
14661
|
+
var __classPrivateFieldGet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
14683
14662
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
14684
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");
|
14685
14664
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
14686
14665
|
};
|
14687
14666
|
var _SessionContextGroupClient_clientPromise;
|
14688
14667
|
Object.defineProperty(SessionContextGroupClient$1, "__esModule", { value: true });
|
14689
|
-
const base_1$
|
14668
|
+
const base_1$5 = base;
|
14690
14669
|
const utils_1$6 = utils$3;
|
14691
|
-
class SessionContextGroupClient extends base_1$
|
14670
|
+
class SessionContextGroupClient extends base_1$5.Base {
|
14692
14671
|
constructor(wire, client, id) {
|
14693
14672
|
super(wire);
|
14694
14673
|
_SessionContextGroupClient_clientPromise.set(this, void 0);
|
14695
14674
|
this.id = id;
|
14696
|
-
__classPrivateFieldSet$
|
14675
|
+
__classPrivateFieldSet$5(this, _SessionContextGroupClient_clientPromise, client, "f");
|
14697
14676
|
}
|
14698
14677
|
/**
|
14699
14678
|
* Sets a context for the session context group.
|
@@ -14705,7 +14684,7 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
14705
14684
|
this.wire.sendAction('interop-session-context-group-set-context').catch((e) => {
|
14706
14685
|
// don't expose, analytics-only call
|
14707
14686
|
});
|
14708
|
-
const client = await __classPrivateFieldGet$
|
14687
|
+
const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
|
14709
14688
|
return client.dispatch(`sessionContextGroup:setContext-${this.id}`, {
|
14710
14689
|
sessionContextGroupId: this.id,
|
14711
14690
|
context
|
@@ -14715,7 +14694,7 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
14715
14694
|
this.wire.sendAction('interop-session-context-group-get-context').catch((e) => {
|
14716
14695
|
// don't expose, analytics-only call
|
14717
14696
|
});
|
14718
|
-
const client = await __classPrivateFieldGet$
|
14697
|
+
const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
|
14719
14698
|
return client.dispatch(`sessionContextGroup:getContext-${this.id}`, {
|
14720
14699
|
sessionContextGroupId: this.id,
|
14721
14700
|
type
|
@@ -14728,7 +14707,7 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
14728
14707
|
if (typeof contextHandler !== 'function') {
|
14729
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.");
|
14730
14709
|
}
|
14731
|
-
const client = await __classPrivateFieldGet$
|
14710
|
+
const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
|
14732
14711
|
let handlerId;
|
14733
14712
|
if (contextType) {
|
14734
14713
|
handlerId = `sessionContextHandler:invoke-${this.id}-${contextType}-${(0, utils_1$6.generateId)()}`;
|
@@ -14741,7 +14720,7 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
14741
14720
|
return { unsubscribe: await this.createUnsubscribeCb(handlerId) };
|
14742
14721
|
}
|
14743
14722
|
async createUnsubscribeCb(handlerId) {
|
14744
|
-
const client = await __classPrivateFieldGet$
|
14723
|
+
const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
|
14745
14724
|
return async () => {
|
14746
14725
|
client.remove(handlerId);
|
14747
14726
|
await client.dispatch(`sessionContextGroup:handlerRemoved-${this.id}`, { handlerId });
|
@@ -14759,13 +14738,13 @@ class SessionContextGroupClient extends base_1$4.Base {
|
|
14759
14738
|
SessionContextGroupClient$1.default = SessionContextGroupClient;
|
14760
14739
|
_SessionContextGroupClient_clientPromise = new WeakMap();
|
14761
14740
|
|
14762
|
-
var __classPrivateFieldSet$
|
14741
|
+
var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
14763
14742
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
14764
14743
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
14765
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");
|
14766
14745
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
14767
14746
|
};
|
14768
|
-
var __classPrivateFieldGet$
|
14747
|
+
var __classPrivateFieldGet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
14769
14748
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
14770
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");
|
14771
14750
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -14776,7 +14755,7 @@ var __importDefault$3 = (commonjsGlobal && commonjsGlobal.__importDefault) || fu
|
|
14776
14755
|
var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory;
|
14777
14756
|
Object.defineProperty(InteropClient$1, "__esModule", { value: true });
|
14778
14757
|
InteropClient$1.InteropClient = void 0;
|
14779
|
-
const base_1$
|
14758
|
+
const base_1$4 = base;
|
14780
14759
|
const SessionContextGroupClient_1 = __importDefault$3(SessionContextGroupClient$1);
|
14781
14760
|
const utils_1$5 = utils$3;
|
14782
14761
|
/**
|
@@ -14828,7 +14807,7 @@ const utils_1$5 = utils$3;
|
|
14828
14807
|
* * {@link InteropClient#getAllClientsInContextGroup getAllClientsInContextGroup(contextGroupId)}
|
14829
14808
|
*
|
14830
14809
|
*/
|
14831
|
-
class InteropClient extends base_1$
|
14810
|
+
class InteropClient extends base_1$4.Base {
|
14832
14811
|
/**
|
14833
14812
|
* @internal
|
14834
14813
|
*/
|
@@ -14837,9 +14816,9 @@ class InteropClient extends base_1$3.Base {
|
|
14837
14816
|
_InteropClient_clientPromise.set(this, void 0);
|
14838
14817
|
_InteropClient_sessionContextGroups.set(this, void 0);
|
14839
14818
|
_InteropClient_fdc3Factory.set(this, void 0);
|
14840
|
-
__classPrivateFieldSet$
|
14841
|
-
__classPrivateFieldSet$
|
14842
|
-
__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");
|
14843
14822
|
}
|
14844
14823
|
/*
|
14845
14824
|
Client APIs
|
@@ -14867,7 +14846,7 @@ class InteropClient extends base_1$3.Base {
|
|
14867
14846
|
this.wire.sendAction('interop-client-set-context').catch((e) => {
|
14868
14847
|
// don't expose, analytics-only call
|
14869
14848
|
});
|
14870
|
-
const client = await __classPrivateFieldGet$
|
14849
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
14871
14850
|
return client.dispatch('setContext', { context });
|
14872
14851
|
}
|
14873
14852
|
/**
|
@@ -14934,7 +14913,7 @@ class InteropClient extends base_1$3.Base {
|
|
14934
14913
|
if (typeof handler !== 'function') {
|
14935
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.");
|
14936
14915
|
}
|
14937
|
-
const client = await __classPrivateFieldGet$
|
14916
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
14938
14917
|
let handlerId;
|
14939
14918
|
if (contextType) {
|
14940
14919
|
handlerId = `invokeContextHandler-${contextType}-${(0, utils_1$5.generateId)()}`;
|
@@ -14974,7 +14953,7 @@ class InteropClient extends base_1$3.Base {
|
|
14974
14953
|
this.wire.sendAction('interop-client-get-context-groups').catch((e) => {
|
14975
14954
|
// don't expose, analytics-only call
|
14976
14955
|
});
|
14977
|
-
const client = await __classPrivateFieldGet$
|
14956
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
14978
14957
|
return client.dispatch('getContextGroups');
|
14979
14958
|
}
|
14980
14959
|
/**
|
@@ -15005,7 +14984,7 @@ class InteropClient extends base_1$3.Base {
|
|
15005
14984
|
this.wire.sendAction('interop-client-join-context-group').catch((e) => {
|
15006
14985
|
// don't expose, analytics-only call
|
15007
14986
|
});
|
15008
|
-
const client = await __classPrivateFieldGet$
|
14987
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15009
14988
|
if (!contextGroupId) {
|
15010
14989
|
throw new Error('No contextGroupId specified for joinContextGroup.');
|
15011
14990
|
}
|
@@ -15034,7 +15013,7 @@ class InteropClient extends base_1$3.Base {
|
|
15034
15013
|
this.wire.sendAction('interop-client-remove-from-context-group').catch((e) => {
|
15035
15014
|
// don't expose, analytics-only call
|
15036
15015
|
});
|
15037
|
-
const client = await __classPrivateFieldGet$
|
15016
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15038
15017
|
return client.dispatch('removeFromContextGroup', { target });
|
15039
15018
|
}
|
15040
15019
|
/**
|
@@ -15057,7 +15036,7 @@ class InteropClient extends base_1$3.Base {
|
|
15057
15036
|
this.wire.sendAction('interop-client-get-all-clients-in-context-group').catch((e) => {
|
15058
15037
|
// don't expose, analytics-only call
|
15059
15038
|
});
|
15060
|
-
const client = await __classPrivateFieldGet$
|
15039
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15061
15040
|
if (!contextGroupId) {
|
15062
15041
|
throw new Error('No contextGroupId specified for getAllClientsInContextGroup.');
|
15063
15042
|
}
|
@@ -15082,7 +15061,7 @@ class InteropClient extends base_1$3.Base {
|
|
15082
15061
|
this.wire.sendAction('interop-client-get-info-for-context-group').catch((e) => {
|
15083
15062
|
// don't expose, analytics-only call
|
15084
15063
|
});
|
15085
|
-
const client = await __classPrivateFieldGet$
|
15064
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15086
15065
|
if (!contextGroupId) {
|
15087
15066
|
throw new Error('No contextGroupId specified for getInfoForContextGroup.');
|
15088
15067
|
}
|
@@ -15110,7 +15089,7 @@ class InteropClient extends base_1$3.Base {
|
|
15110
15089
|
this.wire.sendAction('interop-client-fire-intent').catch((e) => {
|
15111
15090
|
// don't expose, this is only for api analytics purposes
|
15112
15091
|
});
|
15113
|
-
const client = await __classPrivateFieldGet$
|
15092
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15114
15093
|
return client.dispatch('fireIntent', intent);
|
15115
15094
|
}
|
15116
15095
|
/**
|
@@ -15137,7 +15116,7 @@ class InteropClient extends base_1$3.Base {
|
|
15137
15116
|
this.wire.sendAction('interop-client-register-intent-handler').catch((e) => {
|
15138
15117
|
// don't expose, this is only for api analytics purposes
|
15139
15118
|
});
|
15140
|
-
const client = await __classPrivateFieldGet$
|
15119
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15141
15120
|
const handlerId = `intent-handler-${intentName}`;
|
15142
15121
|
const wrappedHandler = (0, utils_1$5.wrapIntentHandler)(handler, handlerId);
|
15143
15122
|
try {
|
@@ -15175,7 +15154,7 @@ class InteropClient extends base_1$3.Base {
|
|
15175
15154
|
this.wire.sendAction('interop-client-get-current-context').catch((e) => {
|
15176
15155
|
// don't expose, analytics-only call
|
15177
15156
|
});
|
15178
|
-
const client = await __classPrivateFieldGet$
|
15157
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15179
15158
|
return client.dispatch('getCurrentContext', { contextType });
|
15180
15159
|
}
|
15181
15160
|
/**
|
@@ -15195,7 +15174,7 @@ class InteropClient extends base_1$3.Base {
|
|
15195
15174
|
this.wire.sendAction('interop-client-get-info-for-intent').catch((e) => {
|
15196
15175
|
// don't expose, analytics-only call
|
15197
15176
|
});
|
15198
|
-
const client = await __classPrivateFieldGet$
|
15177
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15199
15178
|
return client.dispatch('getInfoForIntent', options);
|
15200
15179
|
}
|
15201
15180
|
/**
|
@@ -15226,7 +15205,7 @@ class InteropClient extends base_1$3.Base {
|
|
15226
15205
|
this.wire.sendAction('interop-client-get-info-for-intents-by-context').catch((e) => {
|
15227
15206
|
// don't expose, analytics-only call
|
15228
15207
|
});
|
15229
|
-
const client = await __classPrivateFieldGet$
|
15208
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15230
15209
|
return client.dispatch('getInfoForIntentsByContext', context);
|
15231
15210
|
}
|
15232
15211
|
/**
|
@@ -15258,7 +15237,7 @@ class InteropClient extends base_1$3.Base {
|
|
15258
15237
|
this.wire.sendAction('interop-client-fire-intent-for-context').catch((e) => {
|
15259
15238
|
// don't expose, analytics-only call
|
15260
15239
|
});
|
15261
|
-
const client = await __classPrivateFieldGet$
|
15240
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15262
15241
|
return client.dispatch('fireIntentForContext', context);
|
15263
15242
|
}
|
15264
15243
|
/**
|
@@ -15295,19 +15274,19 @@ class InteropClient extends base_1$3.Base {
|
|
15295
15274
|
*/
|
15296
15275
|
async joinSessionContextGroup(sessionContextGroupId) {
|
15297
15276
|
try {
|
15298
|
-
const currentSessionContextGroup = __classPrivateFieldGet$
|
15277
|
+
const currentSessionContextGroup = __classPrivateFieldGet$4(this, _InteropClient_sessionContextGroups, "f").get(sessionContextGroupId);
|
15299
15278
|
if (currentSessionContextGroup) {
|
15300
15279
|
return currentSessionContextGroup.getUserInstance();
|
15301
15280
|
}
|
15302
|
-
const client = await __classPrivateFieldGet$
|
15281
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15303
15282
|
const { hasConflict } = await client.dispatch('sessionContextGroup:createIfNeeded', {
|
15304
15283
|
sessionContextGroupId
|
15305
15284
|
});
|
15306
15285
|
if (hasConflict) {
|
15307
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.`);
|
15308
15287
|
}
|
15309
|
-
const newSessionContextGroup = new SessionContextGroupClient_1.default(this.wire, __classPrivateFieldGet$
|
15310
|
-
__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);
|
15311
15290
|
return newSessionContextGroup.getUserInstance();
|
15312
15291
|
}
|
15313
15292
|
catch (error) {
|
@@ -15334,14 +15313,14 @@ class InteropClient extends base_1$3.Base {
|
|
15334
15313
|
this.wire.sendAction('interop-client-add-ondisconnection-listener').catch((e) => {
|
15335
15314
|
// don't expose, analytics-only call
|
15336
15315
|
});
|
15337
|
-
const client = await __classPrivateFieldGet$
|
15316
|
+
const client = await __classPrivateFieldGet$4(this, _InteropClient_clientPromise, "f");
|
15338
15317
|
return client.onDisconnection((event) => {
|
15339
15318
|
const { uuid } = event;
|
15340
15319
|
listener({ type: 'interop-broker', topic: 'disconnected', brokerName: uuid });
|
15341
15320
|
});
|
15342
15321
|
}
|
15343
15322
|
getFDC3Sync(version) {
|
15344
|
-
return __classPrivateFieldGet$
|
15323
|
+
return __classPrivateFieldGet$4(this, _InteropClient_fdc3Factory, "f").call(this, version, this, this.wire);
|
15345
15324
|
}
|
15346
15325
|
async getFDC3(version) {
|
15347
15326
|
return this.getFDC3Sync(version);
|
@@ -15352,7 +15331,7 @@ class InteropClient extends base_1$3.Base {
|
|
15352
15331
|
* Used to ferry fdc3-only calls from the fdc3 shim to the Interop Broker
|
15353
15332
|
*/
|
15354
15333
|
static async ferryFdc3Call(interopClient, action, payload) {
|
15355
|
-
const client = await __classPrivateFieldGet$
|
15334
|
+
const client = await __classPrivateFieldGet$4(interopClient, _InteropClient_clientPromise, "f");
|
15356
15335
|
return client.dispatch(action, payload || null);
|
15357
15336
|
}
|
15358
15337
|
}
|
@@ -15767,12 +15746,12 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
|
|
15767
15746
|
exports.getIntentResolution = getIntentResolution;
|
15768
15747
|
} (utils$2));
|
15769
15748
|
|
15770
|
-
var __classPrivateFieldGet$
|
15749
|
+
var __classPrivateFieldGet$3 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
15771
15750
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
15772
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");
|
15773
15752
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
15774
15753
|
};
|
15775
|
-
var __classPrivateFieldSet$
|
15754
|
+
var __classPrivateFieldSet$3 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
15776
15755
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
15777
15756
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
15778
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");
|
@@ -15790,7 +15769,7 @@ const InteropClient_1$2 = InteropClient$1;
|
|
15790
15769
|
const isEqual_1 = __importDefault$2(require$$3);
|
15791
15770
|
class FDC3ModuleBase {
|
15792
15771
|
get client() {
|
15793
|
-
return __classPrivateFieldGet$
|
15772
|
+
return __classPrivateFieldGet$3(this, _FDC3ModuleBase_producer, "f").call(this);
|
15794
15773
|
}
|
15795
15774
|
get fin() {
|
15796
15775
|
return this.wire.getFin();
|
@@ -15799,7 +15778,7 @@ class FDC3ModuleBase {
|
|
15799
15778
|
constructor(producer, wire) {
|
15800
15779
|
this.wire = wire;
|
15801
15780
|
_FDC3ModuleBase_producer.set(this, void 0);
|
15802
|
-
__classPrivateFieldSet$
|
15781
|
+
__classPrivateFieldSet$3(this, _FDC3ModuleBase_producer, producer, "f");
|
15803
15782
|
}
|
15804
15783
|
/**
|
15805
15784
|
* Broadcasts a context for the channel of the current entity.
|
@@ -16580,7 +16559,7 @@ Object.defineProperty(Factory$1, "__esModule", { value: true });
|
|
16580
16559
|
Factory$1.InteropModule = void 0;
|
16581
16560
|
const cloneDeep_1 = __importDefault$1(require$$0$1);
|
16582
16561
|
const inaccessibleObject_1 = inaccessibleObject;
|
16583
|
-
const base_1$
|
16562
|
+
const base_1$3 = base;
|
16584
16563
|
const InteropBroker_1 = InteropBroker$1;
|
16585
16564
|
const InteropClient_1 = InteropClient$1;
|
16586
16565
|
const overrideCheck_1$1 = overrideCheck$1;
|
@@ -16592,7 +16571,7 @@ const BrokerParamAccessError = 'You have attempted to use or modify InteropBroke
|
|
16592
16571
|
* Manages creation of Interop Brokers and Interop Clients. These APIs are called under-the-hood in Platforms.
|
16593
16572
|
*
|
16594
16573
|
*/
|
16595
|
-
class InteropModule extends base_1$
|
16574
|
+
class InteropModule extends base_1$3.Base {
|
16596
16575
|
/**
|
16597
16576
|
* Initializes an Interop Broker. This is called under-the-hood for Platforms.
|
16598
16577
|
*
|
@@ -16716,13 +16695,13 @@ const channelPrefix = 'snapshot-source-provider-';
|
|
16716
16695
|
const getSnapshotSourceChannelName = (id) => `${channelPrefix}${id.uuid}`;
|
16717
16696
|
utils.getSnapshotSourceChannelName = getSnapshotSourceChannelName;
|
16718
16697
|
|
16719
|
-
var __classPrivateFieldSet$
|
16698
|
+
var __classPrivateFieldSet$2 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
16720
16699
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
16721
16700
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
16722
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");
|
16723
16702
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
16724
16703
|
};
|
16725
|
-
var __classPrivateFieldGet$
|
16704
|
+
var __classPrivateFieldGet$2 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
16726
16705
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
16727
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");
|
16728
16707
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -16731,7 +16710,7 @@ var _SnapshotSource_identity, _SnapshotSource_getConnection, _SnapshotSource_get
|
|
16731
16710
|
Object.defineProperty(Instance, "__esModule", { value: true });
|
16732
16711
|
Instance.SnapshotSource = void 0;
|
16733
16712
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
16734
|
-
const base_1$
|
16713
|
+
const base_1$2 = base;
|
16735
16714
|
const utils_1$1 = utils;
|
16736
16715
|
const connectionMap = new Map();
|
16737
16716
|
/**
|
@@ -16740,7 +16719,7 @@ const connectionMap = new Map();
|
|
16740
16719
|
* @typeParam Snapshot Implementation-defined shape of an application snapshot. Allows
|
16741
16720
|
* custom snapshot implementations for legacy applications to define their own snapshot format.
|
16742
16721
|
*/
|
16743
|
-
class SnapshotSource extends base_1$
|
16722
|
+
class SnapshotSource extends base_1$2.Base {
|
16744
16723
|
/**
|
16745
16724
|
* @internal
|
16746
16725
|
*/
|
@@ -16754,26 +16733,26 @@ class SnapshotSource extends base_1$1.Base {
|
|
16754
16733
|
return connectionMap.get(this.identity.uuid);
|
16755
16734
|
});
|
16756
16735
|
_SnapshotSource_getClient.set(this, () => {
|
16757
|
-
if (!__classPrivateFieldGet$
|
16758
|
-
__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);
|
16759
16738
|
}
|
16760
|
-
return __classPrivateFieldGet$
|
16739
|
+
return __classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise;
|
16761
16740
|
});
|
16762
16741
|
_SnapshotSource_startConnection.set(this, async () => {
|
16763
16742
|
const channelName = (0, utils_1$1.getSnapshotSourceChannelName)(this.identity);
|
16764
16743
|
try {
|
16765
|
-
if (!__classPrivateFieldGet$
|
16766
|
-
await __classPrivateFieldGet$
|
16744
|
+
if (!__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).eventFired) {
|
16745
|
+
await __classPrivateFieldGet$2(this, _SnapshotSource_setUpConnectionListener, "f").call(this);
|
16767
16746
|
}
|
16768
16747
|
const client = await this.fin.InterApplicationBus.Channel.connect(channelName, { wait: false });
|
16769
16748
|
client.onDisconnection(() => {
|
16770
|
-
__classPrivateFieldGet$
|
16771
|
-
__classPrivateFieldGet$
|
16749
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = null;
|
16750
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).eventFired = null;
|
16772
16751
|
});
|
16773
16752
|
return client;
|
16774
16753
|
}
|
16775
16754
|
catch (e) {
|
16776
|
-
__classPrivateFieldGet$
|
16755
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = null;
|
16777
16756
|
throw new Error("The targeted SnapshotSource is not currently initialized. Await this object's ready() method.");
|
16778
16757
|
}
|
16779
16758
|
});
|
@@ -16785,7 +16764,7 @@ class SnapshotSource extends base_1$1.Base {
|
|
16785
16764
|
resolve = y;
|
16786
16765
|
reject = n;
|
16787
16766
|
});
|
16788
|
-
__classPrivateFieldGet$
|
16767
|
+
__classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).eventFired = eventFired;
|
16789
16768
|
const listener = async (e) => {
|
16790
16769
|
try {
|
16791
16770
|
if (e.channelName === channelName) {
|
@@ -16799,10 +16778,10 @@ class SnapshotSource extends base_1$1.Base {
|
|
16799
16778
|
};
|
16800
16779
|
await this.fin.InterApplicationBus.Channel.on('connected', listener);
|
16801
16780
|
});
|
16802
|
-
__classPrivateFieldSet$
|
16781
|
+
__classPrivateFieldSet$2(this, _SnapshotSource_identity, id, "f");
|
16803
16782
|
}
|
16804
16783
|
get identity() {
|
16805
|
-
return __classPrivateFieldGet$
|
16784
|
+
return __classPrivateFieldGet$2(this, _SnapshotSource_identity, "f");
|
16806
16785
|
}
|
16807
16786
|
/**
|
16808
16787
|
* Method to determine if the SnapshotSource has been initialized.
|
@@ -16838,11 +16817,11 @@ class SnapshotSource extends base_1$1.Base {
|
|
16838
16817
|
// eslint-disable-next-line no-async-promise-executor
|
16839
16818
|
try {
|
16840
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?
|
16841
|
-
await __classPrivateFieldGet$
|
16820
|
+
await __classPrivateFieldGet$2(this, _SnapshotSource_getClient, "f").call(this);
|
16842
16821
|
}
|
16843
16822
|
catch (e) {
|
16844
16823
|
// it was not running.
|
16845
|
-
await __classPrivateFieldGet$
|
16824
|
+
await __classPrivateFieldGet$2(this, _SnapshotSource_getConnection, "f").call(this).eventFired;
|
16846
16825
|
}
|
16847
16826
|
}
|
16848
16827
|
/**
|
@@ -16853,7 +16832,7 @@ class SnapshotSource extends base_1$1.Base {
|
|
16853
16832
|
this.wire.sendAction('snapshot-source-get-snapshot').catch((e) => {
|
16854
16833
|
// don't expose, analytics-only call
|
16855
16834
|
});
|
16856
|
-
const client = await __classPrivateFieldGet$
|
16835
|
+
const client = await __classPrivateFieldGet$2(this, _SnapshotSource_getClient, "f").call(this);
|
16857
16836
|
const response = (await client.dispatch('get-snapshot'));
|
16858
16837
|
return (await response).snapshot;
|
16859
16838
|
}
|
@@ -16865,7 +16844,7 @@ class SnapshotSource extends base_1$1.Base {
|
|
16865
16844
|
this.wire.sendAction('snapshot-source-apply-snapshot').catch((e) => {
|
16866
16845
|
// don't expose, analytics-only call
|
16867
16846
|
});
|
16868
|
-
const client = await __classPrivateFieldGet$
|
16847
|
+
const client = await __classPrivateFieldGet$2(this, _SnapshotSource_getClient, "f").call(this);
|
16869
16848
|
return client.dispatch('apply-snapshot', { snapshot });
|
16870
16849
|
}
|
16871
16850
|
}
|
@@ -16874,13 +16853,13 @@ _SnapshotSource_identity = new WeakMap(), _SnapshotSource_getConnection = new We
|
|
16874
16853
|
|
16875
16854
|
Object.defineProperty(Factory, "__esModule", { value: true });
|
16876
16855
|
Factory.SnapshotSourceModule = void 0;
|
16877
|
-
const base_1 = base;
|
16856
|
+
const base_1$1 = base;
|
16878
16857
|
const Instance_1 = Instance;
|
16879
16858
|
const utils_1 = utils;
|
16880
16859
|
/**
|
16881
16860
|
* Static namespace for OpenFin API methods that interact with the {@link SnapshotSource} class, available under `fin.SnapshotSource`.
|
16882
16861
|
*/
|
16883
|
-
class SnapshotSourceModule extends base_1.Base {
|
16862
|
+
class SnapshotSourceModule extends base_1$1.Base {
|
16884
16863
|
/**
|
16885
16864
|
* Initializes a SnapshotSource with the getSnapshot and applySnapshot methods defined.
|
16886
16865
|
*
|
@@ -16986,13 +16965,121 @@ Factory.SnapshotSourceModule = SnapshotSourceModule;
|
|
16986
16965
|
__exportStar(Instance, exports);
|
16987
16966
|
} (snapshotSource));
|
16988
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
|
+
|
16989
17076
|
Object.defineProperty(fin$1, "__esModule", { value: true });
|
16990
17077
|
var Fin_1 = fin$1.Fin = void 0;
|
16991
17078
|
const events_1$3 = require$$0;
|
16992
17079
|
// Import from the file rather than the directory in case someone consuming types is using module resolution other than "node"
|
16993
17080
|
const index_1 = system;
|
16994
17081
|
const index_2 = requireWindow();
|
16995
|
-
const index_3 =
|
17082
|
+
const index_3 = application;
|
16996
17083
|
const index_4 = interappbus;
|
16997
17084
|
const index_5 = clipboard;
|
16998
17085
|
const index_6 = externalApplication;
|
@@ -17003,6 +17090,7 @@ const index_10 = platform;
|
|
17003
17090
|
const me_1$1 = me;
|
17004
17091
|
const interop_1 = interop;
|
17005
17092
|
const snapshot_source_1 = snapshotSource;
|
17093
|
+
const notification_manager_1 = notificationManager;
|
17006
17094
|
/**
|
17007
17095
|
* @internal
|
17008
17096
|
*/
|
@@ -17025,6 +17113,7 @@ class Fin extends events_1$3.EventEmitter {
|
|
17025
17113
|
this.View = new index_9.ViewModule(wire);
|
17026
17114
|
this.Interop = new interop_1.InteropModule(wire);
|
17027
17115
|
this.SnapshotSource = new snapshot_source_1.SnapshotSourceModule(wire);
|
17116
|
+
this.NotificationManager = new notification_manager_1.NotificationManagerModule(wire);
|
17028
17117
|
wire.registerFin(this);
|
17029
17118
|
this.me = (0, me_1$1.getMe)(wire);
|
17030
17119
|
// Handle disconnect events
|
@@ -17793,7 +17882,7 @@ class NodeEnvironment extends BaseEnvironment_1 {
|
|
17793
17882
|
};
|
17794
17883
|
}
|
17795
17884
|
getAdapterVersionSync() {
|
17796
|
-
return "43.100.
|
17885
|
+
return "43.100.35";
|
17797
17886
|
}
|
17798
17887
|
observeBounds(element, onChange) {
|
17799
17888
|
throw new Error('Method not implemented.');
|