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