@openfin/node-adapter 43.100.91 → 43.100.92
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 +1245 -1224
- package/package.json +2 -2
package/out/node-adapter.js
CHANGED
@@ -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$n.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
|
-
async closeTrayIconPopupMenu() {
|
3292
|
-
const { name } = this.wire.me;
|
3293
|
-
const entityIdentity = { uuid: this.identity.uuid, name };
|
3294
|
-
await this.wire.sendAction('close-tray-icon-popup-menu', { ...entityIdentity });
|
3295
|
-
}
|
3296
|
-
}
|
3297
|
-
Instance$6.Application = Application;
|
3298
|
-
return Instance$6;
|
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
|
+
}
|
3299
3291
|
}
|
3292
|
+
Instance$6.Application = Application;
|
3300
3293
|
|
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
|
-
|
3565
|
-
|
3566
|
-
|
3567
|
-
|
3568
|
-
|
3569
|
-
|
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;
|
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;
|
@@ -8747,7 +8726,7 @@ var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
8747
8726
|
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");
|
8748
8727
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
8749
8728
|
};
|
8750
|
-
var __importDefault$
|
8729
|
+
var __importDefault$6 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
8751
8730
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
8752
8731
|
};
|
8753
8732
|
var _ConnectionManager_messageReceiver, _ConnectionManager_rtcConnectionManager;
|
@@ -8761,7 +8740,7 @@ const ice_manager_1 = iceManager;
|
|
8761
8740
|
const provider_1$1 = provider;
|
8762
8741
|
const message_receiver_1 = messageReceiver$1;
|
8763
8742
|
const protocol_manager_1 = protocolManager;
|
8764
|
-
const strategy_3 = __importDefault$
|
8743
|
+
const strategy_3 = __importDefault$6(strategy);
|
8765
8744
|
class ConnectionManager extends base_1$j.Base {
|
8766
8745
|
static getProtocolOptionsFromStrings(protocols) {
|
8767
8746
|
return protocols.map((protocol) => {
|
@@ -13428,16 +13407,16 @@ var __classPrivateFieldGet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
13428
13407
|
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");
|
13429
13408
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
13430
13409
|
};
|
13431
|
-
var __importDefault$
|
13410
|
+
var __importDefault$5 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
13432
13411
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13433
13412
|
};
|
13434
13413
|
var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
|
13435
13414
|
Object.defineProperty(InteropBroker$1, "__esModule", { value: true });
|
13436
13415
|
InteropBroker$1.InteropBroker = void 0;
|
13437
13416
|
const base_1$6 = base;
|
13438
|
-
const SessionContextGroupBroker_1 = __importDefault$
|
13417
|
+
const SessionContextGroupBroker_1 = __importDefault$5(SessionContextGroupBroker$1);
|
13439
13418
|
const utils_1$7 = utils$3;
|
13440
|
-
const isEqual_1$
|
13419
|
+
const isEqual_1$2 = __importDefault$5(require$$3);
|
13441
13420
|
const PrivateChannelProvider_1 = PrivateChannelProvider$1;
|
13442
13421
|
const lazy_1$1 = lazy;
|
13443
13422
|
const defaultContextGroups = [
|
@@ -13636,7 +13615,7 @@ class InteropBroker extends base_1$6.Base {
|
|
13636
13615
|
constructor(...unused) {
|
13637
13616
|
if (unused.length) {
|
13638
13617
|
const [_ignore1, ignore2, opts] = unused;
|
13639
|
-
if (opts && typeof opts === 'object' && !(0, isEqual_1$
|
13618
|
+
if (opts && typeof opts === 'object' && !(0, isEqual_1$2.default)(opts, args[2])) {
|
13640
13619
|
// eslint-disable-next-line no-console
|
13641
13620
|
console.warn('You have modified the parameters of the InteropOverride constructor. This behavior is deprecated and will be removed in a future version. You can modify these options in your manifest. Please consult our Interop docs for guidance on migrating to the new override scheme.');
|
13642
13621
|
super(args[0], args[1], opts);
|
@@ -14788,14 +14767,14 @@ var __classPrivateFieldGet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
14788
14767
|
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");
|
14789
14768
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
14790
14769
|
};
|
14791
|
-
var __importDefault$
|
14770
|
+
var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
14792
14771
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
14793
14772
|
};
|
14794
14773
|
var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory;
|
14795
14774
|
Object.defineProperty(InteropClient$1, "__esModule", { value: true });
|
14796
14775
|
InteropClient$1.InteropClient = void 0;
|
14797
14776
|
const base_1$4 = base;
|
14798
|
-
const SessionContextGroupClient_1 = __importDefault$
|
14777
|
+
const SessionContextGroupClient_1 = __importDefault$4(SessionContextGroupClient$1);
|
14799
14778
|
const utils_1$5 = utils$3;
|
14800
14779
|
/**
|
14801
14780
|
* The Interop Client API is broken up into two groups:
|
@@ -15537,15 +15516,86 @@ class PrivateChannelClient {
|
|
15537
15516
|
}
|
15538
15517
|
PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
|
15539
15518
|
|
15519
|
+
var fdc3Channels2_0 = {};
|
15520
|
+
|
15521
|
+
var fdc3Channels1_2 = {};
|
15522
|
+
|
15523
|
+
var __importDefault$3 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
15524
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
15525
|
+
};
|
15526
|
+
Object.defineProperty(fdc3Channels1_2, "__esModule", { value: true });
|
15527
|
+
fdc3Channels1_2.createV1Channel = void 0;
|
15528
|
+
const isEqual_1$1 = __importDefault$3(require$$3);
|
15529
|
+
const createV1Channel = (sessionContextGroup) => {
|
15530
|
+
return {
|
15531
|
+
id: sessionContextGroup.id,
|
15532
|
+
type: 'app',
|
15533
|
+
broadcast: sessionContextGroup.setContext,
|
15534
|
+
getCurrentContext: async (contextType) => {
|
15535
|
+
const context = await sessionContextGroup.getCurrentContext(contextType);
|
15536
|
+
return context === undefined ? null : context;
|
15537
|
+
},
|
15538
|
+
// @ts-expect-error TODO [CORE-1524]
|
15539
|
+
addContextListener: (contextType, handler) => {
|
15540
|
+
let realHandler;
|
15541
|
+
let realType;
|
15542
|
+
if (typeof contextType === 'function') {
|
15543
|
+
console.warn('addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)');
|
15544
|
+
realHandler = contextType;
|
15545
|
+
}
|
15546
|
+
else {
|
15547
|
+
realHandler = handler;
|
15548
|
+
if (typeof contextType === 'string') {
|
15549
|
+
realType = contextType;
|
15550
|
+
}
|
15551
|
+
}
|
15552
|
+
const listener = (async () => {
|
15553
|
+
let first = true;
|
15554
|
+
const currentContext = await sessionContextGroup.getCurrentContext(realType);
|
15555
|
+
const wrappedHandler = (context, contextMetadata) => {
|
15556
|
+
if (first) {
|
15557
|
+
first = false;
|
15558
|
+
if ((0, isEqual_1$1.default)(currentContext, context)) {
|
15559
|
+
return;
|
15560
|
+
}
|
15561
|
+
}
|
15562
|
+
// eslint-disable-next-line consistent-return
|
15563
|
+
return realHandler(context, contextMetadata);
|
15564
|
+
};
|
15565
|
+
return sessionContextGroup.addContextHandler(wrappedHandler, realType);
|
15566
|
+
})();
|
15567
|
+
return {
|
15568
|
+
...listener,
|
15569
|
+
unsubscribe: () => listener.then((l) => l.unsubscribe())
|
15570
|
+
};
|
15571
|
+
}
|
15572
|
+
};
|
15573
|
+
};
|
15574
|
+
fdc3Channels1_2.createV1Channel = createV1Channel;
|
15575
|
+
|
15576
|
+
Object.defineProperty(fdc3Channels2_0, "__esModule", { value: true });
|
15577
|
+
fdc3Channels2_0.createV2Channel = void 0;
|
15578
|
+
const fdc3_channels_1_2_1$1 = fdc3Channels1_2;
|
15579
|
+
const createV2Channel = (sessionContextGroup) => {
|
15580
|
+
const channel = (0, fdc3_channels_1_2_1$1.createV1Channel)(sessionContextGroup);
|
15581
|
+
return {
|
15582
|
+
...channel,
|
15583
|
+
// @ts-expect-error Type incompatibility on signature.
|
15584
|
+
addContextListener: async (...args) => channel.addContextListener(...args)
|
15585
|
+
};
|
15586
|
+
};
|
15587
|
+
fdc3Channels2_0.createV2Channel = createV2Channel;
|
15588
|
+
|
15540
15589
|
(function (exports) {
|
15541
15590
|
var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
15542
15591
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
15543
15592
|
};
|
15544
15593
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15545
|
-
exports.getIntentResolution = exports.isChannel = exports.isContext = exports.connectPrivateChannel = exports.
|
15594
|
+
exports.getIntentResolution = exports.isChannel = exports.isContext = exports.connectPrivateChannel = exports.buildPrivateChannelObject = exports.ChannelError = exports.ResultError = exports.UnsupportedChannelApiError = exports.getUnsupportedChannelApis = void 0;
|
15546
15595
|
const utils_1 = utils$3;
|
15547
15596
|
const PrivateChannelClient_1 = PrivateChannelClient$1;
|
15548
|
-
|
15597
|
+
__importDefault(require$$3);
|
15598
|
+
const fdc3_channels_2_0_1 = fdc3Channels2_0;
|
15549
15599
|
const getUnsupportedChannelApis = (channelType) => {
|
15550
15600
|
return {
|
15551
15601
|
addContextListener: () => {
|
@@ -15644,52 +15694,6 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
|
|
15644
15694
|
};
|
15645
15695
|
};
|
15646
15696
|
exports.buildPrivateChannelObject = buildPrivateChannelObject;
|
15647
|
-
const buildAppChannelObject = (sessionContextGroup) => {
|
15648
|
-
return {
|
15649
|
-
id: sessionContextGroup.id,
|
15650
|
-
type: 'app',
|
15651
|
-
broadcast: sessionContextGroup.setContext,
|
15652
|
-
getCurrentContext: async (contextType) => {
|
15653
|
-
const context = await sessionContextGroup.getCurrentContext(contextType);
|
15654
|
-
return context === undefined ? null : context;
|
15655
|
-
},
|
15656
|
-
// @ts-expect-error TODO [CORE-1524]
|
15657
|
-
addContextListener: (contextType, handler) => {
|
15658
|
-
let realHandler;
|
15659
|
-
let realType;
|
15660
|
-
if (typeof contextType === 'function') {
|
15661
|
-
console.warn('addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)');
|
15662
|
-
realHandler = contextType;
|
15663
|
-
}
|
15664
|
-
else {
|
15665
|
-
realHandler = handler;
|
15666
|
-
if (typeof contextType === 'string') {
|
15667
|
-
realType = contextType;
|
15668
|
-
}
|
15669
|
-
}
|
15670
|
-
const listener = (async () => {
|
15671
|
-
let first = true;
|
15672
|
-
const currentContext = await sessionContextGroup.getCurrentContext(realType);
|
15673
|
-
const wrappedHandler = (context, contextMetadata) => {
|
15674
|
-
if (first) {
|
15675
|
-
first = false;
|
15676
|
-
if ((0, isEqual_1.default)(currentContext, context)) {
|
15677
|
-
return;
|
15678
|
-
}
|
15679
|
-
}
|
15680
|
-
// eslint-disable-next-line consistent-return
|
15681
|
-
return realHandler(context, contextMetadata);
|
15682
|
-
};
|
15683
|
-
return sessionContextGroup.addContextHandler(wrappedHandler, realType);
|
15684
|
-
})();
|
15685
|
-
return {
|
15686
|
-
...listener,
|
15687
|
-
unsubscribe: () => listener.then((l) => l.unsubscribe())
|
15688
|
-
};
|
15689
|
-
}
|
15690
|
-
};
|
15691
|
-
};
|
15692
|
-
exports.buildAppChannelObject = buildAppChannelObject;
|
15693
15697
|
const connectPrivateChannel = async (channelId) => {
|
15694
15698
|
try {
|
15695
15699
|
const channelClient = await fin.InterApplicationBus.Channel.connect(channelId);
|
@@ -15721,6 +15725,10 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
|
|
15721
15725
|
// Generate an ID to make a session context group with. We will pass that ID to the Broker.
|
15722
15726
|
// The broker will then setContext on that session context group later with our Intent Result,
|
15723
15727
|
const guid = (0, utils_1.generateId)(); // TODO make this undefined in web
|
15728
|
+
let isPromiseSettled = false;
|
15729
|
+
// Adding the intentResolutionResultId to the intentObj. Because fireIntent only accepts a single arg, we have to slap it in here.
|
15730
|
+
const metadata = app ? { target: app, intentResolutionResultId: guid } : { intentResolutionResultId: guid };
|
15731
|
+
const intentObj = intent ? { name: intent, context, metadata } : { ...context, metadata };
|
15724
15732
|
// Promise we'll use in getResult
|
15725
15733
|
const getResultPromise = new Promise((resolve, reject) => {
|
15726
15734
|
fin.InterApplicationBus.subscribe({ uuid: '*' }, guid, (intentResult) => {
|
@@ -15733,13 +15741,24 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
|
|
15733
15741
|
reject(new Error('getResult is not supported in this environment'));
|
15734
15742
|
});
|
15735
15743
|
});
|
15736
|
-
|
15737
|
-
|
15738
|
-
|
15744
|
+
getResultPromise
|
15745
|
+
.then(() => {
|
15746
|
+
isPromiseSettled = true;
|
15747
|
+
})
|
15748
|
+
.catch(() => {
|
15749
|
+
isPromiseSettled = true;
|
15750
|
+
});
|
15739
15751
|
// Set up the getResult call.
|
15740
15752
|
const getResult = async () => {
|
15753
|
+
// All this mumbo jumbo is needed to make sure that getResult resolves correctly and conforms to the FDC3 spec.
|
15754
|
+
if (!isPromiseSettled) {
|
15755
|
+
return undefined;
|
15756
|
+
}
|
15741
15757
|
let intentResult = await getResultPromise;
|
15742
|
-
if (
|
15758
|
+
if (isPromiseSettled && !intentResult) {
|
15759
|
+
return undefined;
|
15760
|
+
}
|
15761
|
+
if (typeof intentResult !== 'object') {
|
15743
15762
|
throw new Error(ResultError.NoResultReturned);
|
15744
15763
|
}
|
15745
15764
|
const { error } = intentResult;
|
@@ -15755,7 +15774,7 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
|
|
15755
15774
|
}
|
15756
15775
|
case 'app': {
|
15757
15776
|
const sessionContextGroup = await interopModule.joinSessionContextGroup(id);
|
15758
|
-
intentResult = (0,
|
15777
|
+
intentResult = (0, fdc3_channels_2_0_1.createV2Channel)(sessionContextGroup);
|
15759
15778
|
break;
|
15760
15779
|
}
|
15761
15780
|
}
|
@@ -15865,7 +15884,7 @@ class FDC3ModuleBase {
|
|
15865
15884
|
*
|
15866
15885
|
* @tutorial fdc3.getOrCreateChannel
|
15867
15886
|
*/
|
15868
|
-
async getOrCreateChannel(channelId) {
|
15887
|
+
async getOrCreateChannel(channelId, fdc3Factory) {
|
15869
15888
|
this.wire.sendAction('fdc3-get-or-create-channel').catch((e) => {
|
15870
15889
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
15871
15890
|
});
|
@@ -15882,7 +15901,7 @@ class FDC3ModuleBase {
|
|
15882
15901
|
}
|
15883
15902
|
try {
|
15884
15903
|
const sessionContextGroup = await this.client.joinSessionContextGroup(channelId);
|
15885
|
-
return (
|
15904
|
+
return fdc3Factory(sessionContextGroup);
|
15886
15905
|
}
|
15887
15906
|
catch (error) {
|
15888
15907
|
console.error(error.message);
|
@@ -16032,6 +16051,7 @@ Object.defineProperty(fdc31_2, "__esModule", { value: true });
|
|
16032
16051
|
fdc31_2.Fdc3Module = void 0;
|
16033
16052
|
const utils_1$3 = utils$3;
|
16034
16053
|
const fdc3_common_1$1 = fdc3Common;
|
16054
|
+
const fdc3_channels_1_2_1 = fdc3Channels1_2;
|
16035
16055
|
/**
|
16036
16056
|
* @version 1.2
|
16037
16057
|
* The FDC3 Client Library provides a set APIs to be used for FDC3 compliance,
|
@@ -16214,7 +16234,7 @@ class Fdc3Module extends fdc3_common_1$1.FDC3ModuleBase {
|
|
16214
16234
|
* @tutorial fdc3.getOrCreateChannel
|
16215
16235
|
*/
|
16216
16236
|
async getOrCreateChannel(channelId) {
|
16217
|
-
return super.getOrCreateChannel(channelId);
|
16237
|
+
return super.getOrCreateChannel(channelId, fdc3_channels_1_2_1.createV1Channel);
|
16218
16238
|
}
|
16219
16239
|
/**
|
16220
16240
|
* Returns metadata relating to the FDC3 object and its provider, including the supported version of the FDC3 specification and the name of the provider of the implementation.
|
@@ -16244,6 +16264,7 @@ const utils_1$2 = utils$3;
|
|
16244
16264
|
const InteropClient_1$1 = InteropClient$1;
|
16245
16265
|
const utils_2 = utils$2;
|
16246
16266
|
const PrivateChannelClient_1 = PrivateChannelClient$1;
|
16267
|
+
const fdc3_channels_2_0_1 = fdc3Channels2_0;
|
16247
16268
|
/**
|
16248
16269
|
* @version 2.0
|
16249
16270
|
* The FDC3 Client Library provides a set APIs to be used for FDC3 compliance,
|
@@ -16495,7 +16516,7 @@ class Fdc3Module2 extends fdc3_common_1.FDC3ModuleBase {
|
|
16495
16516
|
* @tutorial fdc3.getOrCreateChannel
|
16496
16517
|
*/
|
16497
16518
|
async getOrCreateChannel(channelId) {
|
16498
|
-
return super.getOrCreateChannel(channelId);
|
16519
|
+
return super.getOrCreateChannel(channelId, fdc3_channels_2_0_1.createV2Channel);
|
16499
16520
|
}
|
16500
16521
|
/**
|
16501
16522
|
* Returns a Channel with an auto-generated identity that is intended for private communication between applications. Primarily used to create channels that will be returned to other applications via an IntentResolution for a raised intent.
|
@@ -17213,7 +17234,7 @@ const events_1$3 = require$$0;
|
|
17213
17234
|
// Import from the file rather than the directory in case someone consuming types is using module resolution other than "node"
|
17214
17235
|
const index_1 = system;
|
17215
17236
|
const index_2 = requireWindow();
|
17216
|
-
const index_3 =
|
17237
|
+
const index_3 = application;
|
17217
17238
|
const index_4 = interappbus;
|
17218
17239
|
const index_5 = clipboard;
|
17219
17240
|
const index_6 = externalApplication;
|
@@ -18016,7 +18037,7 @@ class NodeEnvironment extends BaseEnvironment_1 {
|
|
18016
18037
|
};
|
18017
18038
|
}
|
18018
18039
|
getAdapterVersionSync() {
|
18019
|
-
return "43.100.
|
18040
|
+
return "43.100.92";
|
18020
18041
|
}
|
18021
18042
|
observeBounds(element, onChange) {
|
18022
18043
|
throw new Error('Method not implemented.');
|