@openfin/node-adapter 45.100.47 → 45.100.48
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 +1170 -1154
- package/package.json +2 -2
package/out/node-adapter.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var require$$0 = require('events');
|
|
4
|
-
var require$$0$1 = require('lodash/cloneDeep');
|
|
5
4
|
var require$$3 = require('lodash/isEqual');
|
|
6
5
|
var fs = require('fs');
|
|
7
6
|
var crypto = require('crypto');
|
|
@@ -531,11 +530,11 @@ const handleDeprecatedWarnings = (options) => {
|
|
|
531
530
|
};
|
|
532
531
|
warnings.handleDeprecatedWarnings = handleDeprecatedWarnings;
|
|
533
532
|
|
|
534
|
-
var hasRequiredFactory$
|
|
533
|
+
var hasRequiredFactory$2;
|
|
535
534
|
|
|
536
|
-
function requireFactory$
|
|
537
|
-
if (hasRequiredFactory$
|
|
538
|
-
hasRequiredFactory$
|
|
535
|
+
function requireFactory$2 () {
|
|
536
|
+
if (hasRequiredFactory$2) return Factory$6;
|
|
537
|
+
hasRequiredFactory$2 = 1;
|
|
539
538
|
Object.defineProperty(Factory$6, "__esModule", { value: true });
|
|
540
539
|
Factory$6.ViewModule = void 0;
|
|
541
540
|
const base_1 = base;
|
|
@@ -750,8 +749,8 @@ var main = {};
|
|
|
750
749
|
|
|
751
750
|
Object.defineProperty(main, "__esModule", { value: true });
|
|
752
751
|
main.WebContents = void 0;
|
|
753
|
-
const base_1$
|
|
754
|
-
class WebContents extends base_1$
|
|
752
|
+
const base_1$n = base;
|
|
753
|
+
class WebContents extends base_1$n.EmitterBase {
|
|
755
754
|
/**
|
|
756
755
|
* @param identity The identity of the {@link OpenFin.WebContentsEvents WebContents}.
|
|
757
756
|
* @param entityType The type of the {@link OpenFin.WebContentsEvents WebContents}.
|
|
@@ -1832,11 +1831,11 @@ class WebContents extends base_1$p.EmitterBase {
|
|
|
1832
1831
|
}
|
|
1833
1832
|
main.WebContents = WebContents;
|
|
1834
1833
|
|
|
1835
|
-
var hasRequiredInstance$
|
|
1834
|
+
var hasRequiredInstance$2;
|
|
1836
1835
|
|
|
1837
|
-
function requireInstance$
|
|
1838
|
-
if (hasRequiredInstance$
|
|
1839
|
-
hasRequiredInstance$
|
|
1836
|
+
function requireInstance$2 () {
|
|
1837
|
+
if (hasRequiredInstance$2) return Instance$5;
|
|
1838
|
+
hasRequiredInstance$2 = 1;
|
|
1840
1839
|
var _View_providerChannelClient;
|
|
1841
1840
|
Object.defineProperty(Instance$5, "__esModule", { value: true });
|
|
1842
1841
|
Instance$5.View = void 0;
|
|
@@ -2416,1139 +2415,1160 @@ function requireView () {
|
|
|
2416
2415
|
*
|
|
2417
2416
|
* @packageDocumentation
|
|
2418
2417
|
*/
|
|
2419
|
-
__exportStar(requireFactory$
|
|
2420
|
-
__exportStar(requireInstance$
|
|
2418
|
+
__exportStar(requireFactory$2(), exports);
|
|
2419
|
+
__exportStar(requireInstance$2(), exports);
|
|
2421
2420
|
} (view));
|
|
2422
2421
|
return view;
|
|
2423
2422
|
}
|
|
2424
2423
|
|
|
2425
|
-
|
|
2426
|
-
Instance$6.Application = void 0;
|
|
2427
|
-
/* eslint-disable import/prefer-default-export */
|
|
2428
|
-
const base_1$o = base;
|
|
2429
|
-
const window_1$1 = requireWindow();
|
|
2430
|
-
const view_1 = requireView();
|
|
2431
|
-
/**
|
|
2432
|
-
* An object representing an application. Allows the developer to create,
|
|
2433
|
-
* execute, show/close an application as well as listen to {@link OpenFin.ApplicationEvents application events}.
|
|
2434
|
-
*/
|
|
2435
|
-
class Application extends base_1$o.EmitterBase {
|
|
2436
|
-
/**
|
|
2437
|
-
* @internal
|
|
2438
|
-
*/
|
|
2439
|
-
constructor(wire, identity) {
|
|
2440
|
-
super(wire, 'application', identity.uuid);
|
|
2441
|
-
this.identity = identity;
|
|
2442
|
-
this.window = new window_1$1._Window(this.wire, {
|
|
2443
|
-
uuid: this.identity.uuid,
|
|
2444
|
-
name: this.identity.uuid
|
|
2445
|
-
});
|
|
2446
|
-
}
|
|
2447
|
-
windowListFromIdentityList(identityList) {
|
|
2448
|
-
const windowList = [];
|
|
2449
|
-
identityList.forEach((identity) => {
|
|
2450
|
-
windowList.push(new window_1$1._Window(this.wire, {
|
|
2451
|
-
uuid: identity.uuid,
|
|
2452
|
-
name: identity.name
|
|
2453
|
-
}));
|
|
2454
|
-
});
|
|
2455
|
-
return windowList;
|
|
2456
|
-
}
|
|
2457
|
-
/**
|
|
2458
|
-
* Determines if the application is currently running.
|
|
2459
|
-
*
|
|
2460
|
-
* @example
|
|
2461
|
-
*
|
|
2462
|
-
* ```js
|
|
2463
|
-
* async function isAppRunning() {
|
|
2464
|
-
* const app = await fin.Application.getCurrent();
|
|
2465
|
-
* return await app.isRunning();
|
|
2466
|
-
* }
|
|
2467
|
-
* isAppRunning().then(running => console.log(`Current app is running: ${running}`)).catch(err => console.log(err));
|
|
2468
|
-
* ```
|
|
2469
|
-
*/
|
|
2470
|
-
isRunning() {
|
|
2471
|
-
return this.wire.sendAction('is-application-running', this.identity).then(({ payload }) => payload.data);
|
|
2472
|
-
}
|
|
2473
|
-
/**
|
|
2474
|
-
* Closes the application and any child windows created by the application.
|
|
2475
|
-
* Cleans the application from state so it is no longer found in getAllApplications.
|
|
2476
|
-
* @param force Close will be prevented from closing when force is false and
|
|
2477
|
-
* ‘close-requested’ has been subscribed to for application’s main window.
|
|
2478
|
-
*
|
|
2479
|
-
* @example
|
|
2480
|
-
*
|
|
2481
|
-
* ```js
|
|
2482
|
-
* async function closeApp() {
|
|
2483
|
-
* const allApps1 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}, {uuid: 'app2', isRunning: true}]
|
|
2484
|
-
* const app = await fin.Application.wrap({uuid: 'app2'});
|
|
2485
|
-
* await app.quit();
|
|
2486
|
-
* const allApps2 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}]
|
|
2487
|
-
*
|
|
2488
|
-
* }
|
|
2489
|
-
* closeApp().then(() => console.log('Application quit')).catch(err => console.log(err));
|
|
2490
|
-
* ```
|
|
2491
|
-
*/
|
|
2492
|
-
async quit(force = false) {
|
|
2493
|
-
try {
|
|
2494
|
-
await this._close(force);
|
|
2495
|
-
await this.wire.sendAction('destroy-application', { force, ...this.identity });
|
|
2496
|
-
}
|
|
2497
|
-
catch (error) {
|
|
2498
|
-
const acceptableErrors = ['Remote connection has closed', 'Could not locate the requested application'];
|
|
2499
|
-
if (!acceptableErrors.some((msg) => error.message.includes(msg))) {
|
|
2500
|
-
throw error;
|
|
2501
|
-
}
|
|
2502
|
-
}
|
|
2503
|
-
}
|
|
2504
|
-
async _close(force = false) {
|
|
2505
|
-
try {
|
|
2506
|
-
await this.wire.sendAction('close-application', { force, ...this.identity });
|
|
2507
|
-
}
|
|
2508
|
-
catch (error) {
|
|
2509
|
-
if (!error.message.includes('Remote connection has closed')) {
|
|
2510
|
-
throw error;
|
|
2511
|
-
}
|
|
2512
|
-
}
|
|
2513
|
-
}
|
|
2514
|
-
/**
|
|
2515
|
-
* @deprecated use Application.quit instead
|
|
2516
|
-
* Closes the application and any child windows created by the application.
|
|
2517
|
-
* @param force - Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for application’s main window.
|
|
2518
|
-
* @param callback - called if the method succeeds.
|
|
2519
|
-
* @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
|
|
2520
|
-
*
|
|
2521
|
-
* @example
|
|
2522
|
-
*
|
|
2523
|
-
* ```js
|
|
2524
|
-
* async function closeApp() {
|
|
2525
|
-
* const app = await fin.Application.getCurrent();
|
|
2526
|
-
* return await app.close();
|
|
2527
|
-
* }
|
|
2528
|
-
* closeApp().then(() => console.log('Application closed')).catch(err => console.log(err));
|
|
2529
|
-
* ```
|
|
2530
|
-
*/
|
|
2531
|
-
close(force = false) {
|
|
2532
|
-
console.warn('Deprecation Warning: Application.close is deprecated Please use Application.quit');
|
|
2533
|
-
this.wire.sendAction('application-close', this.identity).catch((e) => {
|
|
2534
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
2535
|
-
});
|
|
2536
|
-
return this._close(force);
|
|
2537
|
-
}
|
|
2538
|
-
/**
|
|
2539
|
-
* Retrieves an array of wrapped fin.Windows for each of the application’s child windows.
|
|
2540
|
-
*
|
|
2541
|
-
* @example
|
|
2542
|
-
*
|
|
2543
|
-
* ```js
|
|
2544
|
-
* async function getChildWindows() {
|
|
2545
|
-
* const app = await fin.Application.getCurrent();
|
|
2546
|
-
* return await app.getChildWindows();
|
|
2547
|
-
* }
|
|
2548
|
-
*
|
|
2549
|
-
* getChildWindows().then(children => console.log(children)).catch(err => console.log(err));
|
|
2550
|
-
* ```
|
|
2551
|
-
*/
|
|
2552
|
-
getChildWindows() {
|
|
2553
|
-
return this.wire.sendAction('get-child-windows', this.identity).then(({ payload }) => {
|
|
2554
|
-
const identityList = [];
|
|
2555
|
-
payload.data.forEach((winName) => {
|
|
2556
|
-
identityList.push({ uuid: this.identity.uuid, name: winName });
|
|
2557
|
-
});
|
|
2558
|
-
return this.windowListFromIdentityList(identityList);
|
|
2559
|
-
});
|
|
2560
|
-
}
|
|
2561
|
-
/**
|
|
2562
|
-
* Retrieves the JSON manifest that was used to create the application. Invokes the error callback
|
|
2563
|
-
* if the application was not created from a manifest.
|
|
2564
|
-
*
|
|
2565
|
-
* @example
|
|
2566
|
-
*
|
|
2567
|
-
* ```js
|
|
2568
|
-
* async function getManifest() {
|
|
2569
|
-
* const app = await fin.Application.getCurrent();
|
|
2570
|
-
* return await app.getManifest();
|
|
2571
|
-
* }
|
|
2572
|
-
*
|
|
2573
|
-
* getManifest().then(manifest => console.log(manifest)).catch(err => console.log(err));
|
|
2574
|
-
* ```
|
|
2575
|
-
*/
|
|
2576
|
-
getManifest() {
|
|
2577
|
-
return this.wire.sendAction('get-application-manifest', this.identity).then(({ payload }) => payload.data);
|
|
2578
|
-
}
|
|
2579
|
-
/**
|
|
2580
|
-
* Retrieves UUID of the application that launches this application. Invokes the error callback
|
|
2581
|
-
* if the application was created from a manifest.
|
|
2582
|
-
*
|
|
2583
|
-
* @example
|
|
2584
|
-
*
|
|
2585
|
-
* ```js
|
|
2586
|
-
* async function getParentUuid() {
|
|
2587
|
-
* const app = await fin.Application.start({
|
|
2588
|
-
* uuid: 'app-1',
|
|
2589
|
-
* name: 'myApp',
|
|
2590
|
-
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getParentUuid.html',
|
|
2591
|
-
* autoShow: true
|
|
2592
|
-
* });
|
|
2593
|
-
* return await app.getParentUuid();
|
|
2594
|
-
* }
|
|
2595
|
-
*
|
|
2596
|
-
* getParentUuid().then(parentUuid => console.log(parentUuid)).catch(err => console.log(err));
|
|
2597
|
-
* ```
|
|
2598
|
-
*/
|
|
2599
|
-
getParentUuid() {
|
|
2600
|
-
return this.wire.sendAction('get-parent-application', this.identity).then(({ payload }) => payload.data);
|
|
2601
|
-
}
|
|
2602
|
-
/**
|
|
2603
|
-
* Retrieves current application's shortcut configuration.
|
|
2604
|
-
*
|
|
2605
|
-
* @example
|
|
2606
|
-
*
|
|
2607
|
-
* ```js
|
|
2608
|
-
* async function getShortcuts() {
|
|
2609
|
-
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
2610
|
-
* return await app.getShortcuts();
|
|
2611
|
-
* }
|
|
2612
|
-
* getShortcuts().then(config => console.log(config)).catch(err => console.log(err));
|
|
2613
|
-
* ```
|
|
2614
|
-
*/
|
|
2615
|
-
getShortcuts() {
|
|
2616
|
-
return this.wire.sendAction('get-shortcuts', this.identity).then(({ payload }) => payload.data);
|
|
2617
|
-
}
|
|
2618
|
-
/**
|
|
2619
|
-
* Retrieves current application's views.
|
|
2620
|
-
* @experimental
|
|
2621
|
-
*
|
|
2622
|
-
* @example
|
|
2623
|
-
*
|
|
2624
|
-
* ```js
|
|
2625
|
-
* async function getViews() {
|
|
2626
|
-
* const app = await fin.Application.getCurrent();
|
|
2627
|
-
* return await app.getViews();
|
|
2628
|
-
* }
|
|
2629
|
-
* getViews().then(views => console.log(views)).catch(err => console.log(err));
|
|
2630
|
-
* ```
|
|
2631
|
-
*/
|
|
2632
|
-
async getViews() {
|
|
2633
|
-
const { payload } = await this.wire.sendAction('application-get-views', this.identity);
|
|
2634
|
-
return payload.data.map((id) => new view_1.View(this.wire, id));
|
|
2635
|
-
}
|
|
2636
|
-
/**
|
|
2637
|
-
* Returns the current zoom level of the application.
|
|
2638
|
-
*
|
|
2639
|
-
* @example
|
|
2640
|
-
*
|
|
2641
|
-
* ```js
|
|
2642
|
-
* async function getZoomLevel() {
|
|
2643
|
-
* const app = await fin.Application.getCurrent();
|
|
2644
|
-
* return await app.getZoomLevel();
|
|
2645
|
-
* }
|
|
2646
|
-
*
|
|
2647
|
-
* getZoomLevel().then(zoomLevel => console.log(zoomLevel)).catch(err => console.log(err));
|
|
2648
|
-
* ```
|
|
2649
|
-
*/
|
|
2650
|
-
getZoomLevel() {
|
|
2651
|
-
return this.wire.sendAction('get-application-zoom-level', this.identity).then(({ payload }) => payload.data);
|
|
2652
|
-
}
|
|
2653
|
-
/**
|
|
2654
|
-
* Returns an instance of the main Window of the application
|
|
2655
|
-
*
|
|
2656
|
-
* @example
|
|
2657
|
-
*
|
|
2658
|
-
* ```js
|
|
2659
|
-
* async function getWindow() {
|
|
2660
|
-
* const app = await fin.Application.start({
|
|
2661
|
-
* uuid: 'app-1',
|
|
2662
|
-
* name: 'myApp',
|
|
2663
|
-
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getWindow.html',
|
|
2664
|
-
* autoShow: true
|
|
2665
|
-
* });
|
|
2666
|
-
* return await app.getWindow();
|
|
2667
|
-
* }
|
|
2668
|
-
*
|
|
2669
|
-
* getWindow().then(win => {
|
|
2670
|
-
* win.showAt(0, 400);
|
|
2671
|
-
* win.flash();
|
|
2672
|
-
* }).catch(err => console.log(err));
|
|
2673
|
-
* ```
|
|
2674
|
-
*/
|
|
2675
|
-
getWindow() {
|
|
2676
|
-
this.wire.sendAction('application-get-window', this.identity).catch((e) => {
|
|
2677
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
2678
|
-
});
|
|
2679
|
-
return Promise.resolve(this.window);
|
|
2680
|
-
}
|
|
2681
|
-
/**
|
|
2682
|
-
* Manually registers a user with the licensing service. The only data sent by this call is userName and appName.
|
|
2683
|
-
* @param userName - username to be passed to the RVM.
|
|
2684
|
-
* @param appName - app name to be passed to the RVM.
|
|
2685
|
-
*
|
|
2686
|
-
* @example
|
|
2687
|
-
*
|
|
2688
|
-
* ```js
|
|
2689
|
-
* async function registerUser() {
|
|
2690
|
-
* const app = await fin.Application.getCurrent();
|
|
2691
|
-
* return await app.registerUser('user', 'myApp');
|
|
2692
|
-
* }
|
|
2693
|
-
*
|
|
2694
|
-
* registerUser().then(() => console.log('Successfully registered the user')).catch(err => console.log(err));
|
|
2695
|
-
* ```
|
|
2696
|
-
*/
|
|
2697
|
-
registerUser(userName, appName) {
|
|
2698
|
-
return this.wire.sendAction('register-user', { userName, appName, ...this.identity }).then(() => undefined);
|
|
2699
|
-
}
|
|
2700
|
-
/**
|
|
2701
|
-
* Removes the application’s icon from the tray.
|
|
2702
|
-
*
|
|
2703
|
-
* @example
|
|
2704
|
-
*
|
|
2705
|
-
* ```js
|
|
2706
|
-
* async function removeTrayIcon() {
|
|
2707
|
-
* const app = await fin.Application.getCurrent();
|
|
2708
|
-
* return await app.removeTrayIcon();
|
|
2709
|
-
* }
|
|
2710
|
-
*
|
|
2711
|
-
* removeTrayIcon().then(() => console.log('Removed the tray icon.')).catch(err => console.log(err));
|
|
2712
|
-
* ```
|
|
2713
|
-
*/
|
|
2714
|
-
removeTrayIcon() {
|
|
2715
|
-
return this.wire.sendAction('remove-tray-icon', this.identity).then(() => undefined);
|
|
2716
|
-
}
|
|
2717
|
-
/**
|
|
2718
|
-
* Restarts the application.
|
|
2719
|
-
*
|
|
2720
|
-
* @example
|
|
2721
|
-
*
|
|
2722
|
-
* ```js
|
|
2723
|
-
* async function restartApp() {
|
|
2724
|
-
* const app = await fin.Application.getCurrent();
|
|
2725
|
-
* return await app.restart();
|
|
2726
|
-
* }
|
|
2727
|
-
* restartApp().then(() => console.log('Application restarted')).catch(err => console.log(err));
|
|
2728
|
-
* ```
|
|
2729
|
-
*/
|
|
2730
|
-
restart() {
|
|
2731
|
-
return this.wire.sendAction('restart-application', this.identity).then(() => undefined);
|
|
2732
|
-
}
|
|
2733
|
-
/**
|
|
2734
|
-
* DEPRECATED method to run the application.
|
|
2735
|
-
* Needed when starting application via {@link Application.create}, but NOT needed when starting via {@link Application.start}.
|
|
2736
|
-
*
|
|
2737
|
-
* @example
|
|
2738
|
-
*
|
|
2739
|
-
* ```js
|
|
2740
|
-
* async function run() {
|
|
2741
|
-
* const app = await fin.Application.create({
|
|
2742
|
-
* name: 'myApp',
|
|
2743
|
-
* uuid: 'app-1',
|
|
2744
|
-
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.run.html',
|
|
2745
|
-
* autoShow: true
|
|
2746
|
-
* });
|
|
2747
|
-
* await app.run();
|
|
2748
|
-
* }
|
|
2749
|
-
* run().then(() => console.log('Application is running')).catch(err => console.log(err));
|
|
2750
|
-
* ```
|
|
2751
|
-
*
|
|
2752
|
-
* @ignore
|
|
2753
|
-
*/
|
|
2754
|
-
run() {
|
|
2755
|
-
console.warn('Deprecation Warning: Application.run is deprecated Please use fin.Application.start');
|
|
2756
|
-
this.wire.sendAction('application-run', this.identity).catch((e) => {
|
|
2757
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
2758
|
-
});
|
|
2759
|
-
return this._run();
|
|
2760
|
-
}
|
|
2761
|
-
_run(opts = {}) {
|
|
2762
|
-
return this.wire
|
|
2763
|
-
.sendAction('run-application', {
|
|
2764
|
-
manifestUrl: this._manifestUrl,
|
|
2765
|
-
opts,
|
|
2766
|
-
...this.identity
|
|
2767
|
-
})
|
|
2768
|
-
.then(() => undefined);
|
|
2769
|
-
}
|
|
2770
|
-
/**
|
|
2771
|
-
* Instructs the RVM to schedule one restart of the application.
|
|
2772
|
-
*
|
|
2773
|
-
* @example
|
|
2774
|
-
*
|
|
2775
|
-
* ```js
|
|
2776
|
-
* async function scheduleRestart() {
|
|
2777
|
-
* const app = await fin.Application.getCurrent();
|
|
2778
|
-
* return await app.scheduleRestart();
|
|
2779
|
-
* }
|
|
2780
|
-
*
|
|
2781
|
-
* scheduleRestart().then(() => console.log('Application is scheduled to restart')).catch(err => console.log(err));
|
|
2782
|
-
* ```
|
|
2783
|
-
*/
|
|
2784
|
-
scheduleRestart() {
|
|
2785
|
-
return this.wire.sendAction('relaunch-on-close', this.identity).then(() => undefined);
|
|
2786
|
-
}
|
|
2787
|
-
/**
|
|
2788
|
-
* Sends a message to the RVM to upload the application's logs. On success,
|
|
2789
|
-
* an object containing logId is returned.
|
|
2790
|
-
*
|
|
2791
|
-
* @example
|
|
2792
|
-
*
|
|
2793
|
-
* ```js
|
|
2794
|
-
* async function sendLog() {
|
|
2795
|
-
* const app = await fin.Application.getCurrent();
|
|
2796
|
-
* return await app.sendApplicationLog();
|
|
2797
|
-
* }
|
|
2798
|
-
*
|
|
2799
|
-
* sendLog().then(info => console.log(info.logId)).catch(err => console.log(err));
|
|
2800
|
-
* ```
|
|
2801
|
-
*/
|
|
2802
|
-
async sendApplicationLog() {
|
|
2803
|
-
const { payload } = await this.wire.sendAction('send-application-log', this.identity);
|
|
2804
|
-
return payload.data;
|
|
2805
|
-
}
|
|
2806
|
-
/**
|
|
2807
|
-
* Sets or removes a custom JumpList for the application. Only applicable in Windows OS.
|
|
2808
|
-
* If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
|
|
2809
|
-
*
|
|
2810
|
-
* Note: If the "name" property is omitted it defaults to "tasks".
|
|
2811
|
-
* @param jumpListCategories An array of JumpList Categories to populate. If null, remove any existing JumpList configuration and set to Windows default.
|
|
2812
|
-
*
|
|
2813
|
-
*
|
|
2814
|
-
* @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).
|
|
2815
|
-
*
|
|
2816
|
-
* The bottommost item in the jumplist will always be an item pointing to the current app. Its name is taken from the manifest's
|
|
2817
|
-
* **` shortcut.name `** and uses **` shortcut.company `** as a fallback. Clicking that item will launch the app from its current manifest.
|
|
2818
|
-
*
|
|
2819
|
-
* Note: If the "name" property is omitted it defaults to "tasks".
|
|
2820
|
-
*
|
|
2821
|
-
* Note: Window OS caches jumplists icons, therefore an icon change might only be visible after the cache is removed or the
|
|
2822
|
-
* uuid or shortcut.name is changed.
|
|
2823
|
-
*
|
|
2824
|
-
* @example
|
|
2825
|
-
*
|
|
2826
|
-
* ```js
|
|
2827
|
-
* const app = fin.Application.getCurrentSync();
|
|
2828
|
-
* const appName = 'My App';
|
|
2829
|
-
* const jumpListConfig = [ // array of JumpList categories
|
|
2830
|
-
* {
|
|
2831
|
-
* // has no name and no type so `type` is assumed to be "tasks"
|
|
2832
|
-
* items: [ // array of JumpList items
|
|
2833
|
-
* {
|
|
2834
|
-
* type: 'task',
|
|
2835
|
-
* title: `Launch ${appName}`,
|
|
2836
|
-
* description: `Runs ${appName} with the default configuration`,
|
|
2837
|
-
* deepLink: 'fins://path.to/app/manifest.json',
|
|
2838
|
-
* iconPath: 'https://path.to/app/icon.ico',
|
|
2839
|
-
* iconIndex: 0
|
|
2840
|
-
* },
|
|
2841
|
-
* { type: 'separator' },
|
|
2842
|
-
* {
|
|
2843
|
-
* type: 'task',
|
|
2844
|
-
* title: `Restore ${appName}`,
|
|
2845
|
-
* description: 'Restore to last configuration',
|
|
2846
|
-
* deepLink: 'fins://path.to/app/manifest.json?$$use-last-configuration=true',
|
|
2847
|
-
* iconPath: 'https://path.to/app/icon.ico',
|
|
2848
|
-
* iconIndex: 0
|
|
2849
|
-
* },
|
|
2850
|
-
* ]
|
|
2851
|
-
* },
|
|
2852
|
-
* {
|
|
2853
|
-
* name: 'Tools',
|
|
2854
|
-
* items: [ // array of JumpList items
|
|
2855
|
-
* {
|
|
2856
|
-
* type: 'task',
|
|
2857
|
-
* title: 'Tool A',
|
|
2858
|
-
* description: 'Runs Tool A',
|
|
2859
|
-
* deepLink: 'fins://path.to/tool-a/manifest.json',
|
|
2860
|
-
* iconPath: 'https://path.to/tool-a/icon.ico',
|
|
2861
|
-
* iconIndex: 0
|
|
2862
|
-
* },
|
|
2863
|
-
* {
|
|
2864
|
-
* type: 'task',
|
|
2865
|
-
* title: 'Tool B',
|
|
2866
|
-
* description: 'Runs Tool B',
|
|
2867
|
-
* deepLink: 'fins://path.to/tool-b/manifest.json',
|
|
2868
|
-
* iconPath: 'https://path.to/tool-b/icon.ico',
|
|
2869
|
-
* iconIndex: 0
|
|
2870
|
-
* }]
|
|
2871
|
-
* }
|
|
2872
|
-
* ];
|
|
2873
|
-
*
|
|
2874
|
-
* app.setJumpList(jumpListConfig).then(() => console.log('JumpList applied')).catch(e => console.log(`JumpList failed to apply: ${e.toString()}`));
|
|
2875
|
-
* ```
|
|
2876
|
-
*
|
|
2877
|
-
* To handle deeplink args:
|
|
2878
|
-
* ```js
|
|
2879
|
-
* function handleUseLastConfiguration() {
|
|
2880
|
-
* // this handler is called when the app is being launched
|
|
2881
|
-
* app.on('run-requested', event => {
|
|
2882
|
-
* if(event.userAppConfigArgs['use-last-configuration']) {
|
|
2883
|
-
* // your logic here
|
|
2884
|
-
* }
|
|
2885
|
-
* });
|
|
2886
|
-
* // this handler is called when the app was already running when the launch was requested
|
|
2887
|
-
* fin.desktop.main(function(args) {
|
|
2888
|
-
* if(args && args['use-last-configuration']) {
|
|
2889
|
-
* // your logic here
|
|
2890
|
-
* }
|
|
2891
|
-
* });
|
|
2892
|
-
* }
|
|
2893
|
-
* ```
|
|
2894
|
-
*/
|
|
2895
|
-
async setJumpList(jumpListCategories) {
|
|
2896
|
-
await this.wire.sendAction('set-jump-list', { config: jumpListCategories, ...this.identity });
|
|
2897
|
-
}
|
|
2898
|
-
/**
|
|
2899
|
-
* Adds a customizable icon in the system tray. To listen for a click on the icon use the `tray-icon-clicked` event.
|
|
2900
|
-
* @param icon Image URL or base64 encoded string to be used as the icon
|
|
2901
|
-
*
|
|
2902
|
-
* @example
|
|
2903
|
-
*
|
|
2904
|
-
* ```js
|
|
2905
|
-
* const imageUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
|
|
2906
|
-
* const base64EncodedImage = "iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX\
|
|
2907
|
-
* ///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII";
|
|
2908
|
-
* const dataURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DH\
|
|
2909
|
-
* xgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
|
|
2910
|
-
*
|
|
2911
|
-
* async function setTrayIcon(icon) {
|
|
2912
|
-
* const app = await fin.Application.getCurrent();
|
|
2913
|
-
* return await app.setTrayIcon(icon);
|
|
2914
|
-
* }
|
|
2915
|
-
*
|
|
2916
|
-
* // use image url to set tray icon
|
|
2917
|
-
* setTrayIcon(imageUrl).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
2918
|
-
*
|
|
2919
|
-
* // use base64 encoded string to set tray icon
|
|
2920
|
-
* setTrayIcon(base64EncodedImage).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
2921
|
-
*
|
|
2922
|
-
* // use a dataURL to set tray icon
|
|
2923
|
-
* setTrayIcon(dataURL).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
2924
|
-
* ```
|
|
2925
|
-
*/
|
|
2926
|
-
setTrayIcon(icon) {
|
|
2927
|
-
return this.wire
|
|
2928
|
-
.sendAction('set-tray-icon', {
|
|
2929
|
-
enabledIcon: icon,
|
|
2930
|
-
...this.identity
|
|
2931
|
-
})
|
|
2932
|
-
.then(() => undefined);
|
|
2933
|
-
}
|
|
2934
|
-
/**
|
|
2935
|
-
* Set hover text for this application's system tray icon.
|
|
2936
|
-
* Note: Application must first set a tray icon with {@link Application.setTrayIcon}.
|
|
2937
|
-
* @param toolTip
|
|
2938
|
-
*
|
|
2939
|
-
* @example
|
|
2940
|
-
*
|
|
2941
|
-
* ```js
|
|
2942
|
-
* const app = fin.Application.getCurrentSync();
|
|
2943
|
-
* const iconUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
|
|
2944
|
-
*
|
|
2945
|
-
* await app.setTrayIcon(iconUrl);
|
|
2946
|
-
*
|
|
2947
|
-
* await app.setTrayIconToolTip('My Application');
|
|
2948
|
-
* ```
|
|
2949
|
-
*/
|
|
2950
|
-
async setTrayIconToolTip(toolTip) {
|
|
2951
|
-
await this.wire.sendAction('set-tray-icon-tooltip', { ...this.identity, toolTip });
|
|
2952
|
-
}
|
|
2953
|
-
/**
|
|
2954
|
-
* Sets new application's shortcut configuration. Windows only.
|
|
2955
|
-
* @param config New application's shortcut configuration.
|
|
2956
|
-
*
|
|
2957
|
-
* @remarks Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest
|
|
2958
|
-
* to be able to change shortcut states.
|
|
2959
|
-
*
|
|
2960
|
-
* @example
|
|
2961
|
-
*
|
|
2962
|
-
* ```js
|
|
2963
|
-
* async function setShortcuts(config) {
|
|
2964
|
-
* const app = await fin.Application.getCurrent();
|
|
2965
|
-
* return app.setShortcuts(config);
|
|
2966
|
-
* }
|
|
2967
|
-
*
|
|
2968
|
-
* setShortcuts({
|
|
2969
|
-
* desktop: true,
|
|
2970
|
-
* startMenu: false,
|
|
2971
|
-
* systemStartup: true
|
|
2972
|
-
* }).then(() => console.log('Shortcuts are set.')).catch(err => console.log(err));
|
|
2973
|
-
* ```
|
|
2974
|
-
*/
|
|
2975
|
-
setShortcuts(config) {
|
|
2976
|
-
return this.wire.sendAction('set-shortcuts', { data: config, ...this.identity }).then(() => undefined);
|
|
2977
|
-
}
|
|
2978
|
-
/**
|
|
2979
|
-
* Sets the query string in all shortcuts for this app. Requires RVM 5.5+.
|
|
2980
|
-
* @param queryString The new query string for this app's shortcuts.
|
|
2981
|
-
*
|
|
2982
|
-
* @example
|
|
2983
|
-
*
|
|
2984
|
-
* ```js
|
|
2985
|
-
* const newQueryArgs = 'arg=true&arg2=false';
|
|
2986
|
-
* const app = await fin.Application.getCurrent();
|
|
2987
|
-
* try {
|
|
2988
|
-
* await app.setShortcutQueryParams(newQueryArgs);
|
|
2989
|
-
* } catch(err) {
|
|
2990
|
-
* console.error(err)
|
|
2991
|
-
* }
|
|
2992
|
-
* ```
|
|
2993
|
-
*/
|
|
2994
|
-
async setShortcutQueryParams(queryString) {
|
|
2995
|
-
await this.wire.sendAction('set-shortcut-query-args', { data: queryString, ...this.identity });
|
|
2996
|
-
}
|
|
2997
|
-
/**
|
|
2998
|
-
* Sets the zoom level of the application. The original size is 0 and each increment above or below represents zooming 20%
|
|
2999
|
-
* larger or smaller to default limits of 300% and 50% of original size, respectively.
|
|
3000
|
-
* @param level The zoom level
|
|
3001
|
-
*
|
|
3002
|
-
* @example
|
|
3003
|
-
*
|
|
3004
|
-
* ```js
|
|
3005
|
-
* async function setZoomLevel(number) {
|
|
3006
|
-
* const app = await fin.Application.getCurrent();
|
|
3007
|
-
* return await app.setZoomLevel(number);
|
|
3008
|
-
* }
|
|
3009
|
-
*
|
|
3010
|
-
* setZoomLevel(5).then(() => console.log('Setting a zoom level')).catch(err => console.log(err));
|
|
3011
|
-
* ```
|
|
3012
|
-
*/
|
|
3013
|
-
setZoomLevel(level) {
|
|
3014
|
-
return this.wire.sendAction('set-application-zoom-level', { level, ...this.identity }).then(() => undefined);
|
|
3015
|
-
}
|
|
3016
|
-
/**
|
|
3017
|
-
* Sets a username to correlate with App Log Management.
|
|
3018
|
-
* @param username Username to correlate with App's Log.
|
|
3019
|
-
*
|
|
3020
|
-
* @example
|
|
3021
|
-
*
|
|
3022
|
-
* ```js
|
|
3023
|
-
* async function setAppLogUser() {
|
|
3024
|
-
* const app = await fin.Application.getCurrent();
|
|
3025
|
-
* return await app.setAppLogUsername('username');
|
|
3026
|
-
* }
|
|
3027
|
-
*
|
|
3028
|
-
* setAppLogUser().then(() => console.log('Success')).catch(err => console.log(err));
|
|
3029
|
-
*
|
|
3030
|
-
* ```
|
|
3031
|
-
*/
|
|
3032
|
-
async setAppLogUsername(username) {
|
|
3033
|
-
await this.wire.sendAction('set-app-log-username', { data: username, ...this.identity });
|
|
3034
|
-
}
|
|
3035
|
-
/**
|
|
3036
|
-
* Retrieves information about the system tray. If the system tray is not set, it will throw an error message.
|
|
3037
|
-
* @remarks The only information currently returned is the position and dimensions.
|
|
3038
|
-
*
|
|
3039
|
-
* @example
|
|
3040
|
-
*
|
|
3041
|
-
* ```js
|
|
3042
|
-
* async function getTrayIconInfo() {
|
|
3043
|
-
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
3044
|
-
* return await app.getTrayIconInfo();
|
|
3045
|
-
* }
|
|
3046
|
-
* getTrayIconInfo().then(info => console.log(info)).catch(err => console.log(err));
|
|
3047
|
-
* ```
|
|
3048
|
-
*/
|
|
3049
|
-
getTrayIconInfo() {
|
|
3050
|
-
return this.wire.sendAction('get-tray-icon-info', this.identity).then(({ payload }) => payload.data);
|
|
3051
|
-
}
|
|
3052
|
-
/**
|
|
3053
|
-
* Checks if the application has an associated tray icon.
|
|
3054
|
-
*
|
|
3055
|
-
* @example
|
|
3056
|
-
*
|
|
3057
|
-
* ```js
|
|
3058
|
-
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
3059
|
-
* const hasTrayIcon = await app.hasTrayIcon();
|
|
3060
|
-
* console.log(hasTrayIcon);
|
|
3061
|
-
* ```
|
|
3062
|
-
*/
|
|
3063
|
-
hasTrayIcon() {
|
|
3064
|
-
return this.wire.sendAction('has-tray-icon', this.identity).then(({ payload }) => payload.data);
|
|
3065
|
-
}
|
|
3066
|
-
/**
|
|
3067
|
-
* Closes the application by terminating its process.
|
|
3068
|
-
*
|
|
3069
|
-
* @example
|
|
3070
|
-
*
|
|
3071
|
-
* ```js
|
|
3072
|
-
* async function terminateApp() {
|
|
3073
|
-
* const app = await fin.Application.getCurrent();
|
|
3074
|
-
* return await app.terminate();
|
|
3075
|
-
* }
|
|
3076
|
-
* terminateApp().then(() => console.log('Application terminated')).catch(err => console.log(err));
|
|
3077
|
-
* ```
|
|
3078
|
-
*/
|
|
3079
|
-
terminate() {
|
|
3080
|
-
return this.wire.sendAction('terminate-application', this.identity).then(() => undefined);
|
|
3081
|
-
}
|
|
3082
|
-
/**
|
|
3083
|
-
* Waits for a hanging application. This method can be called in response to an application
|
|
3084
|
-
* "not-responding" to allow the application to continue and to generate another "not-responding"
|
|
3085
|
-
* message after a certain period of time.
|
|
3086
|
-
*
|
|
3087
|
-
* @ignore
|
|
3088
|
-
*/
|
|
3089
|
-
wait() {
|
|
3090
|
-
return this.wire.sendAction('wait-for-hung-application', this.identity).then(() => undefined);
|
|
3091
|
-
}
|
|
3092
|
-
/**
|
|
3093
|
-
* Retrieves information about the application.
|
|
3094
|
-
*
|
|
3095
|
-
* @remarks If the application was not launched from a manifest, the call will return the closest parent application `manifest`
|
|
3096
|
-
* and `manifestUrl`. `initialOptions` shows the parameters used when launched programmatically, or the `startup_app` options
|
|
3097
|
-
* if launched from manifest. The `parentUuid` will be the uuid of the immediate parent (if applicable).
|
|
3098
|
-
*
|
|
3099
|
-
* @example
|
|
3100
|
-
*
|
|
3101
|
-
* ```js
|
|
3102
|
-
* async function getInfo() {
|
|
3103
|
-
* const app = await fin.Application.getCurrent();
|
|
3104
|
-
* return await app.getInfo();
|
|
3105
|
-
* }
|
|
3106
|
-
*
|
|
3107
|
-
* getInfo().then(info => console.log(info)).catch(err => console.log(err));
|
|
3108
|
-
* ```
|
|
3109
|
-
*/
|
|
3110
|
-
getInfo() {
|
|
3111
|
-
return this.wire.sendAction('get-info', this.identity).then(({ payload }) => payload.data);
|
|
3112
|
-
}
|
|
3113
|
-
/**
|
|
3114
|
-
* Retrieves all process information for entities (windows and views) associated with an application.
|
|
3115
|
-
*
|
|
3116
|
-
* @example
|
|
3117
|
-
* ```js
|
|
3118
|
-
* const app = await fin.Application.getCurrent();
|
|
3119
|
-
* const processInfo = await app.getProcessInfo();
|
|
3120
|
-
* ```
|
|
3121
|
-
* @experimental
|
|
3122
|
-
*/
|
|
3123
|
-
async getProcessInfo() {
|
|
3124
|
-
const { payload: { data } } = await this.wire.sendAction('application-get-process-info', this.identity);
|
|
3125
|
-
return data;
|
|
3126
|
-
}
|
|
3127
|
-
/**
|
|
3128
|
-
* Sets file auto download location. It's only allowed in the same application.
|
|
3129
|
-
*
|
|
3130
|
-
* Note: This method is restricted by default and must be enabled via
|
|
3131
|
-
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
3132
|
-
* @param downloadLocation file auto download location
|
|
3133
|
-
*
|
|
3134
|
-
* @throws if setting file auto download location on different applications.
|
|
3135
|
-
* @example
|
|
3136
|
-
*
|
|
3137
|
-
* ```js
|
|
3138
|
-
* const downloadLocation = 'C:\\dev\\temp';
|
|
3139
|
-
* const app = await fin.Application.getCurrent();
|
|
3140
|
-
* try {
|
|
3141
|
-
* await app.setFileDownloadLocation(downloadLocation);
|
|
3142
|
-
* console.log('File download location is set');
|
|
3143
|
-
* } catch(err) {
|
|
3144
|
-
* console.error(err)
|
|
3145
|
-
* }
|
|
3146
|
-
* ```
|
|
3147
|
-
*/
|
|
3148
|
-
async setFileDownloadLocation(downloadLocation) {
|
|
3149
|
-
const { name } = this.wire.me;
|
|
3150
|
-
const entityIdentity = { uuid: this.identity.uuid, name };
|
|
3151
|
-
await this.wire.sendAction('set-file-download-location', { ...entityIdentity, downloadLocation });
|
|
3152
|
-
}
|
|
3153
|
-
/**
|
|
3154
|
-
* 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.
|
|
3155
|
-
*
|
|
3156
|
-
* Note: This method is restricted by default and must be enabled via
|
|
3157
|
-
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
3158
|
-
*
|
|
3159
|
-
* @throws if getting file auto download location on different applications.
|
|
3160
|
-
* @example
|
|
3161
|
-
*
|
|
3162
|
-
* ```js
|
|
3163
|
-
* const app = await fin.Application.getCurrent();
|
|
3164
|
-
* const fileDownloadDir = await app.getFileDownloadLocation();
|
|
3165
|
-
* ```
|
|
3166
|
-
*/
|
|
3167
|
-
async getFileDownloadLocation() {
|
|
3168
|
-
const { payload: { data } } = await this.wire.sendAction('get-file-download-location', this.identity);
|
|
3169
|
-
return data;
|
|
3170
|
-
}
|
|
3171
|
-
/**
|
|
3172
|
-
* Shows a menu on the tray icon. Use with tray-icon-clicked event.
|
|
3173
|
-
* @param options
|
|
3174
|
-
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
|
3175
|
-
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
|
3176
|
-
* of all possible data shapes for the entire menu, and the click handler should process
|
|
3177
|
-
* these with a "reducer" pattern.
|
|
3178
|
-
* @throws if the application has no tray icon set
|
|
3179
|
-
* @throws if the system tray is currently hidden
|
|
3180
|
-
* @example
|
|
3181
|
-
*
|
|
3182
|
-
* ```js
|
|
3183
|
-
* const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
|
|
3184
|
-
* const app = fin.Application.getCurrentSync();
|
|
3185
|
-
*
|
|
3186
|
-
* await app.setTrayIcon(iconUrl);
|
|
3187
|
-
*
|
|
3188
|
-
* const template = [
|
|
3189
|
-
* {
|
|
3190
|
-
* label: 'Menu Item 1',
|
|
3191
|
-
* data: 'hello from item 1'
|
|
3192
|
-
* },
|
|
3193
|
-
* { type: 'separator' },
|
|
3194
|
-
* {
|
|
3195
|
-
* label: 'Menu Item 2',
|
|
3196
|
-
* type: 'checkbox',
|
|
3197
|
-
* checked: true,
|
|
3198
|
-
* data: 'The user clicked the checkbox'
|
|
3199
|
-
* },
|
|
3200
|
-
* {
|
|
3201
|
-
* label: 'see more',
|
|
3202
|
-
* enabled: false,
|
|
3203
|
-
* submenu: [
|
|
3204
|
-
* { label: 'submenu 1', data: 'hello from submenu' }
|
|
3205
|
-
* ]
|
|
3206
|
-
* }
|
|
3207
|
-
* ];
|
|
3208
|
-
*
|
|
3209
|
-
* app.addListener('tray-icon-clicked', (event) => {
|
|
3210
|
-
* // right-click
|
|
3211
|
-
* if (event.button === 2) {
|
|
3212
|
-
* app.showTrayIconPopupMenu({ template }).then(r => {
|
|
3213
|
-
* if (r.result === 'closed') {
|
|
3214
|
-
* console.log('nothing happened');
|
|
3215
|
-
* } else {
|
|
3216
|
-
* console.log(r.data);
|
|
3217
|
-
* }
|
|
3218
|
-
* });
|
|
3219
|
-
* }
|
|
3220
|
-
* });
|
|
3221
|
-
* ```
|
|
3222
|
-
*/
|
|
3223
|
-
async showTrayIconPopupMenu(options) {
|
|
3224
|
-
const { name } = this.wire.me;
|
|
3225
|
-
const entityIdentity = { uuid: this.identity.uuid, name };
|
|
3226
|
-
const { payload } = await this.wire.sendAction('show-tray-icon-popup-menu', { ...entityIdentity, options });
|
|
3227
|
-
return payload.data;
|
|
3228
|
-
}
|
|
3229
|
-
/**
|
|
3230
|
-
* Closes the tray icon menu.
|
|
3231
|
-
*
|
|
3232
|
-
* @throws if the application has no tray icon set
|
|
3233
|
-
* @example
|
|
3234
|
-
*
|
|
3235
|
-
* ```js
|
|
3236
|
-
* const app = fin.Application.getCurrentSync();
|
|
3237
|
-
*
|
|
3238
|
-
* await app.closeTrayIconPopupMenu();
|
|
3239
|
-
* ```
|
|
3240
|
-
*/
|
|
3241
|
-
async closeTrayIconPopupMenu() {
|
|
3242
|
-
const { name } = this.wire.me;
|
|
3243
|
-
const entityIdentity = { uuid: this.identity.uuid, name };
|
|
3244
|
-
await this.wire.sendAction('close-tray-icon-popup-menu', { ...entityIdentity });
|
|
3245
|
-
}
|
|
3246
|
-
}
|
|
3247
|
-
Instance$6.Application = Application;
|
|
2424
|
+
var hasRequiredInstance$1;
|
|
3248
2425
|
|
|
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
|
-
|
|
2426
|
+
function requireInstance$1 () {
|
|
2427
|
+
if (hasRequiredInstance$1) return Instance$6;
|
|
2428
|
+
hasRequiredInstance$1 = 1;
|
|
2429
|
+
Object.defineProperty(Instance$6, "__esModule", { value: true });
|
|
2430
|
+
Instance$6.Application = void 0;
|
|
2431
|
+
/* eslint-disable import/prefer-default-export */
|
|
2432
|
+
const base_1 = base;
|
|
2433
|
+
const window_1 = requireWindow();
|
|
2434
|
+
const view_1 = requireView();
|
|
2435
|
+
/**
|
|
2436
|
+
* An object representing an application. Allows the developer to create,
|
|
2437
|
+
* execute, show/close an application as well as listen to {@link OpenFin.ApplicationEvents application events}.
|
|
2438
|
+
*/
|
|
2439
|
+
class Application extends base_1.EmitterBase {
|
|
2440
|
+
/**
|
|
2441
|
+
* @internal
|
|
2442
|
+
*/
|
|
2443
|
+
constructor(wire, identity) {
|
|
2444
|
+
super(wire, 'application', identity.uuid);
|
|
2445
|
+
this.identity = identity;
|
|
2446
|
+
this.window = new window_1._Window(this.wire, {
|
|
2447
|
+
uuid: this.identity.uuid,
|
|
2448
|
+
name: this.identity.uuid
|
|
2449
|
+
});
|
|
2450
|
+
}
|
|
2451
|
+
windowListFromIdentityList(identityList) {
|
|
2452
|
+
const windowList = [];
|
|
2453
|
+
identityList.forEach((identity) => {
|
|
2454
|
+
windowList.push(new window_1._Window(this.wire, {
|
|
2455
|
+
uuid: identity.uuid,
|
|
2456
|
+
name: identity.name
|
|
2457
|
+
}));
|
|
2458
|
+
});
|
|
2459
|
+
return windowList;
|
|
2460
|
+
}
|
|
2461
|
+
/**
|
|
2462
|
+
* Determines if the application is currently running.
|
|
2463
|
+
*
|
|
2464
|
+
* @example
|
|
2465
|
+
*
|
|
2466
|
+
* ```js
|
|
2467
|
+
* async function isAppRunning() {
|
|
2468
|
+
* const app = await fin.Application.getCurrent();
|
|
2469
|
+
* return await app.isRunning();
|
|
2470
|
+
* }
|
|
2471
|
+
* isAppRunning().then(running => console.log(`Current app is running: ${running}`)).catch(err => console.log(err));
|
|
2472
|
+
* ```
|
|
2473
|
+
*/
|
|
2474
|
+
isRunning() {
|
|
2475
|
+
return this.wire.sendAction('is-application-running', this.identity).then(({ payload }) => payload.data);
|
|
2476
|
+
}
|
|
2477
|
+
/**
|
|
2478
|
+
* Closes the application and any child windows created by the application.
|
|
2479
|
+
* Cleans the application from state so it is no longer found in getAllApplications.
|
|
2480
|
+
* @param force Close will be prevented from closing when force is false and
|
|
2481
|
+
* ‘close-requested’ has been subscribed to for application’s main window.
|
|
2482
|
+
*
|
|
2483
|
+
* @example
|
|
2484
|
+
*
|
|
2485
|
+
* ```js
|
|
2486
|
+
* async function closeApp() {
|
|
2487
|
+
* const allApps1 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}, {uuid: 'app2', isRunning: true}]
|
|
2488
|
+
* const app = await fin.Application.wrap({uuid: 'app2'});
|
|
2489
|
+
* await app.quit();
|
|
2490
|
+
* const allApps2 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}]
|
|
2491
|
+
*
|
|
2492
|
+
* }
|
|
2493
|
+
* closeApp().then(() => console.log('Application quit')).catch(err => console.log(err));
|
|
2494
|
+
* ```
|
|
2495
|
+
*/
|
|
2496
|
+
async quit(force = false) {
|
|
2497
|
+
try {
|
|
2498
|
+
await this._close(force);
|
|
2499
|
+
await this.wire.sendAction('destroy-application', { force, ...this.identity });
|
|
2500
|
+
}
|
|
2501
|
+
catch (error) {
|
|
2502
|
+
const acceptableErrors = ['Remote connection has closed', 'Could not locate the requested application'];
|
|
2503
|
+
if (!acceptableErrors.some((msg) => error.message.includes(msg))) {
|
|
2504
|
+
throw error;
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
async _close(force = false) {
|
|
2509
|
+
try {
|
|
2510
|
+
await this.wire.sendAction('close-application', { force, ...this.identity });
|
|
2511
|
+
}
|
|
2512
|
+
catch (error) {
|
|
2513
|
+
if (!error.message.includes('Remote connection has closed')) {
|
|
2514
|
+
throw error;
|
|
2515
|
+
}
|
|
2516
|
+
}
|
|
2517
|
+
}
|
|
2518
|
+
/**
|
|
2519
|
+
* @deprecated use Application.quit instead
|
|
2520
|
+
* Closes the application and any child windows created by the application.
|
|
2521
|
+
* @param force - Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for application’s main window.
|
|
2522
|
+
* @param callback - called if the method succeeds.
|
|
2523
|
+
* @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
|
|
2524
|
+
*
|
|
2525
|
+
* @example
|
|
2526
|
+
*
|
|
2527
|
+
* ```js
|
|
2528
|
+
* async function closeApp() {
|
|
2529
|
+
* const app = await fin.Application.getCurrent();
|
|
2530
|
+
* return await app.close();
|
|
2531
|
+
* }
|
|
2532
|
+
* closeApp().then(() => console.log('Application closed')).catch(err => console.log(err));
|
|
2533
|
+
* ```
|
|
2534
|
+
*/
|
|
2535
|
+
close(force = false) {
|
|
2536
|
+
console.warn('Deprecation Warning: Application.close is deprecated Please use Application.quit');
|
|
2537
|
+
this.wire.sendAction('application-close', this.identity).catch((e) => {
|
|
2538
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
2539
|
+
});
|
|
2540
|
+
return this._close(force);
|
|
2541
|
+
}
|
|
2542
|
+
/**
|
|
2543
|
+
* Retrieves an array of wrapped fin.Windows for each of the application’s child windows.
|
|
2544
|
+
*
|
|
2545
|
+
* @example
|
|
2546
|
+
*
|
|
2547
|
+
* ```js
|
|
2548
|
+
* async function getChildWindows() {
|
|
2549
|
+
* const app = await fin.Application.getCurrent();
|
|
2550
|
+
* return await app.getChildWindows();
|
|
2551
|
+
* }
|
|
2552
|
+
*
|
|
2553
|
+
* getChildWindows().then(children => console.log(children)).catch(err => console.log(err));
|
|
2554
|
+
* ```
|
|
2555
|
+
*/
|
|
2556
|
+
getChildWindows() {
|
|
2557
|
+
return this.wire.sendAction('get-child-windows', this.identity).then(({ payload }) => {
|
|
2558
|
+
const identityList = [];
|
|
2559
|
+
payload.data.forEach((winName) => {
|
|
2560
|
+
identityList.push({ uuid: this.identity.uuid, name: winName });
|
|
2561
|
+
});
|
|
2562
|
+
return this.windowListFromIdentityList(identityList);
|
|
2563
|
+
});
|
|
2564
|
+
}
|
|
2565
|
+
/**
|
|
2566
|
+
* Retrieves the JSON manifest that was used to create the application. Invokes the error callback
|
|
2567
|
+
* if the application was not created from a manifest.
|
|
2568
|
+
*
|
|
2569
|
+
* @example
|
|
2570
|
+
*
|
|
2571
|
+
* ```js
|
|
2572
|
+
* async function getManifest() {
|
|
2573
|
+
* const app = await fin.Application.getCurrent();
|
|
2574
|
+
* return await app.getManifest();
|
|
2575
|
+
* }
|
|
2576
|
+
*
|
|
2577
|
+
* getManifest().then(manifest => console.log(manifest)).catch(err => console.log(err));
|
|
2578
|
+
* ```
|
|
2579
|
+
*/
|
|
2580
|
+
getManifest() {
|
|
2581
|
+
return this.wire.sendAction('get-application-manifest', this.identity).then(({ payload }) => payload.data);
|
|
2582
|
+
}
|
|
2583
|
+
/**
|
|
2584
|
+
* Retrieves UUID of the application that launches this application. Invokes the error callback
|
|
2585
|
+
* if the application was created from a manifest.
|
|
2586
|
+
*
|
|
2587
|
+
* @example
|
|
2588
|
+
*
|
|
2589
|
+
* ```js
|
|
2590
|
+
* async function getParentUuid() {
|
|
2591
|
+
* const app = await fin.Application.start({
|
|
2592
|
+
* uuid: 'app-1',
|
|
2593
|
+
* name: 'myApp',
|
|
2594
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getParentUuid.html',
|
|
2595
|
+
* autoShow: true
|
|
2596
|
+
* });
|
|
2597
|
+
* return await app.getParentUuid();
|
|
2598
|
+
* }
|
|
2599
|
+
*
|
|
2600
|
+
* getParentUuid().then(parentUuid => console.log(parentUuid)).catch(err => console.log(err));
|
|
2601
|
+
* ```
|
|
2602
|
+
*/
|
|
2603
|
+
getParentUuid() {
|
|
2604
|
+
return this.wire.sendAction('get-parent-application', this.identity).then(({ payload }) => payload.data);
|
|
2605
|
+
}
|
|
2606
|
+
/**
|
|
2607
|
+
* Retrieves current application's shortcut configuration.
|
|
2608
|
+
*
|
|
2609
|
+
* @example
|
|
2610
|
+
*
|
|
2611
|
+
* ```js
|
|
2612
|
+
* async function getShortcuts() {
|
|
2613
|
+
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
2614
|
+
* return await app.getShortcuts();
|
|
2615
|
+
* }
|
|
2616
|
+
* getShortcuts().then(config => console.log(config)).catch(err => console.log(err));
|
|
2617
|
+
* ```
|
|
2618
|
+
*/
|
|
2619
|
+
getShortcuts() {
|
|
2620
|
+
return this.wire.sendAction('get-shortcuts', this.identity).then(({ payload }) => payload.data);
|
|
2621
|
+
}
|
|
2622
|
+
/**
|
|
2623
|
+
* Retrieves current application's views.
|
|
2624
|
+
* @experimental
|
|
2625
|
+
*
|
|
2626
|
+
* @example
|
|
2627
|
+
*
|
|
2628
|
+
* ```js
|
|
2629
|
+
* async function getViews() {
|
|
2630
|
+
* const app = await fin.Application.getCurrent();
|
|
2631
|
+
* return await app.getViews();
|
|
2632
|
+
* }
|
|
2633
|
+
* getViews().then(views => console.log(views)).catch(err => console.log(err));
|
|
2634
|
+
* ```
|
|
2635
|
+
*/
|
|
2636
|
+
async getViews() {
|
|
2637
|
+
const { payload } = await this.wire.sendAction('application-get-views', this.identity);
|
|
2638
|
+
return payload.data.map((id) => new view_1.View(this.wire, id));
|
|
2639
|
+
}
|
|
2640
|
+
/**
|
|
2641
|
+
* Returns the current zoom level of the application.
|
|
2642
|
+
*
|
|
2643
|
+
* @example
|
|
2644
|
+
*
|
|
2645
|
+
* ```js
|
|
2646
|
+
* async function getZoomLevel() {
|
|
2647
|
+
* const app = await fin.Application.getCurrent();
|
|
2648
|
+
* return await app.getZoomLevel();
|
|
2649
|
+
* }
|
|
2650
|
+
*
|
|
2651
|
+
* getZoomLevel().then(zoomLevel => console.log(zoomLevel)).catch(err => console.log(err));
|
|
2652
|
+
* ```
|
|
2653
|
+
*/
|
|
2654
|
+
getZoomLevel() {
|
|
2655
|
+
return this.wire.sendAction('get-application-zoom-level', this.identity).then(({ payload }) => payload.data);
|
|
2656
|
+
}
|
|
2657
|
+
/**
|
|
2658
|
+
* Returns an instance of the main Window of the application
|
|
2659
|
+
*
|
|
2660
|
+
* @example
|
|
2661
|
+
*
|
|
2662
|
+
* ```js
|
|
2663
|
+
* async function getWindow() {
|
|
2664
|
+
* const app = await fin.Application.start({
|
|
2665
|
+
* uuid: 'app-1',
|
|
2666
|
+
* name: 'myApp',
|
|
2667
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getWindow.html',
|
|
2668
|
+
* autoShow: true
|
|
2669
|
+
* });
|
|
2670
|
+
* return await app.getWindow();
|
|
2671
|
+
* }
|
|
2672
|
+
*
|
|
2673
|
+
* getWindow().then(win => {
|
|
2674
|
+
* win.showAt(0, 400);
|
|
2675
|
+
* win.flash();
|
|
2676
|
+
* }).catch(err => console.log(err));
|
|
2677
|
+
* ```
|
|
2678
|
+
*/
|
|
2679
|
+
getWindow() {
|
|
2680
|
+
this.wire.sendAction('application-get-window', this.identity).catch((e) => {
|
|
2681
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
2682
|
+
});
|
|
2683
|
+
return Promise.resolve(this.window);
|
|
2684
|
+
}
|
|
2685
|
+
/**
|
|
2686
|
+
* Manually registers a user with the licensing service. The only data sent by this call is userName and appName.
|
|
2687
|
+
* @param userName - username to be passed to the RVM.
|
|
2688
|
+
* @param appName - app name to be passed to the RVM.
|
|
2689
|
+
*
|
|
2690
|
+
* @example
|
|
2691
|
+
*
|
|
2692
|
+
* ```js
|
|
2693
|
+
* async function registerUser() {
|
|
2694
|
+
* const app = await fin.Application.getCurrent();
|
|
2695
|
+
* return await app.registerUser('user', 'myApp');
|
|
2696
|
+
* }
|
|
2697
|
+
*
|
|
2698
|
+
* registerUser().then(() => console.log('Successfully registered the user')).catch(err => console.log(err));
|
|
2699
|
+
* ```
|
|
2700
|
+
*/
|
|
2701
|
+
registerUser(userName, appName) {
|
|
2702
|
+
return this.wire.sendAction('register-user', { userName, appName, ...this.identity }).then(() => undefined);
|
|
2703
|
+
}
|
|
2704
|
+
/**
|
|
2705
|
+
* Removes the application’s icon from the tray.
|
|
2706
|
+
*
|
|
2707
|
+
* @example
|
|
2708
|
+
*
|
|
2709
|
+
* ```js
|
|
2710
|
+
* async function removeTrayIcon() {
|
|
2711
|
+
* const app = await fin.Application.getCurrent();
|
|
2712
|
+
* return await app.removeTrayIcon();
|
|
2713
|
+
* }
|
|
2714
|
+
*
|
|
2715
|
+
* removeTrayIcon().then(() => console.log('Removed the tray icon.')).catch(err => console.log(err));
|
|
2716
|
+
* ```
|
|
2717
|
+
*/
|
|
2718
|
+
removeTrayIcon() {
|
|
2719
|
+
return this.wire.sendAction('remove-tray-icon', this.identity).then(() => undefined);
|
|
2720
|
+
}
|
|
2721
|
+
/**
|
|
2722
|
+
* Restarts the application.
|
|
2723
|
+
*
|
|
2724
|
+
* @example
|
|
2725
|
+
*
|
|
2726
|
+
* ```js
|
|
2727
|
+
* async function restartApp() {
|
|
2728
|
+
* const app = await fin.Application.getCurrent();
|
|
2729
|
+
* return await app.restart();
|
|
2730
|
+
* }
|
|
2731
|
+
* restartApp().then(() => console.log('Application restarted')).catch(err => console.log(err));
|
|
2732
|
+
* ```
|
|
2733
|
+
*/
|
|
2734
|
+
restart() {
|
|
2735
|
+
return this.wire.sendAction('restart-application', this.identity).then(() => undefined);
|
|
2736
|
+
}
|
|
2737
|
+
/**
|
|
2738
|
+
* DEPRECATED method to run the application.
|
|
2739
|
+
* Needed when starting application via {@link Application.create}, but NOT needed when starting via {@link Application.start}.
|
|
2740
|
+
*
|
|
2741
|
+
* @example
|
|
2742
|
+
*
|
|
2743
|
+
* ```js
|
|
2744
|
+
* async function run() {
|
|
2745
|
+
* const app = await fin.Application.create({
|
|
2746
|
+
* name: 'myApp',
|
|
2747
|
+
* uuid: 'app-1',
|
|
2748
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.run.html',
|
|
2749
|
+
* autoShow: true
|
|
2750
|
+
* });
|
|
2751
|
+
* await app.run();
|
|
2752
|
+
* }
|
|
2753
|
+
* run().then(() => console.log('Application is running')).catch(err => console.log(err));
|
|
2754
|
+
* ```
|
|
2755
|
+
*
|
|
2756
|
+
* @ignore
|
|
2757
|
+
*/
|
|
2758
|
+
run() {
|
|
2759
|
+
console.warn('Deprecation Warning: Application.run is deprecated Please use fin.Application.start');
|
|
2760
|
+
this.wire.sendAction('application-run', this.identity).catch((e) => {
|
|
2761
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
2762
|
+
});
|
|
2763
|
+
return this._run();
|
|
2764
|
+
}
|
|
2765
|
+
_run(opts = {}) {
|
|
2766
|
+
return this.wire
|
|
2767
|
+
.sendAction('run-application', {
|
|
2768
|
+
manifestUrl: this._manifestUrl,
|
|
2769
|
+
opts,
|
|
2770
|
+
...this.identity
|
|
2771
|
+
})
|
|
2772
|
+
.then(() => undefined);
|
|
2773
|
+
}
|
|
2774
|
+
/**
|
|
2775
|
+
* Instructs the RVM to schedule one restart of the application.
|
|
2776
|
+
*
|
|
2777
|
+
* @example
|
|
2778
|
+
*
|
|
2779
|
+
* ```js
|
|
2780
|
+
* async function scheduleRestart() {
|
|
2781
|
+
* const app = await fin.Application.getCurrent();
|
|
2782
|
+
* return await app.scheduleRestart();
|
|
2783
|
+
* }
|
|
2784
|
+
*
|
|
2785
|
+
* scheduleRestart().then(() => console.log('Application is scheduled to restart')).catch(err => console.log(err));
|
|
2786
|
+
* ```
|
|
2787
|
+
*/
|
|
2788
|
+
scheduleRestart() {
|
|
2789
|
+
return this.wire.sendAction('relaunch-on-close', this.identity).then(() => undefined);
|
|
2790
|
+
}
|
|
2791
|
+
/**
|
|
2792
|
+
* Sends a message to the RVM to upload the application's logs. On success,
|
|
2793
|
+
* an object containing logId is returned.
|
|
2794
|
+
*
|
|
2795
|
+
* @example
|
|
2796
|
+
*
|
|
2797
|
+
* ```js
|
|
2798
|
+
* async function sendLog() {
|
|
2799
|
+
* const app = await fin.Application.getCurrent();
|
|
2800
|
+
* return await app.sendApplicationLog();
|
|
2801
|
+
* }
|
|
2802
|
+
*
|
|
2803
|
+
* sendLog().then(info => console.log(info.logId)).catch(err => console.log(err));
|
|
2804
|
+
* ```
|
|
2805
|
+
*/
|
|
2806
|
+
async sendApplicationLog() {
|
|
2807
|
+
const { payload } = await this.wire.sendAction('send-application-log', this.identity);
|
|
2808
|
+
return payload.data;
|
|
2809
|
+
}
|
|
2810
|
+
/**
|
|
2811
|
+
* Sets or removes a custom JumpList for the application. Only applicable in Windows OS.
|
|
2812
|
+
* If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
|
|
2813
|
+
*
|
|
2814
|
+
* Note: If the "name" property is omitted it defaults to "tasks".
|
|
2815
|
+
* @param jumpListCategories An array of JumpList Categories to populate. If null, remove any existing JumpList configuration and set to Windows default.
|
|
2816
|
+
*
|
|
2817
|
+
*
|
|
2818
|
+
* @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).
|
|
2819
|
+
*
|
|
2820
|
+
* The bottommost item in the jumplist will always be an item pointing to the current app. Its name is taken from the manifest's
|
|
2821
|
+
* **` shortcut.name `** and uses **` shortcut.company `** as a fallback. Clicking that item will launch the app from its current manifest.
|
|
2822
|
+
*
|
|
2823
|
+
* Note: If the "name" property is omitted it defaults to "tasks".
|
|
2824
|
+
*
|
|
2825
|
+
* Note: Window OS caches jumplists icons, therefore an icon change might only be visible after the cache is removed or the
|
|
2826
|
+
* uuid or shortcut.name is changed.
|
|
2827
|
+
*
|
|
2828
|
+
* @example
|
|
2829
|
+
*
|
|
2830
|
+
* ```js
|
|
2831
|
+
* const app = fin.Application.getCurrentSync();
|
|
2832
|
+
* const appName = 'My App';
|
|
2833
|
+
* const jumpListConfig = [ // array of JumpList categories
|
|
2834
|
+
* {
|
|
2835
|
+
* // has no name and no type so `type` is assumed to be "tasks"
|
|
2836
|
+
* items: [ // array of JumpList items
|
|
2837
|
+
* {
|
|
2838
|
+
* type: 'task',
|
|
2839
|
+
* title: `Launch ${appName}`,
|
|
2840
|
+
* description: `Runs ${appName} with the default configuration`,
|
|
2841
|
+
* deepLink: 'fins://path.to/app/manifest.json',
|
|
2842
|
+
* iconPath: 'https://path.to/app/icon.ico',
|
|
2843
|
+
* iconIndex: 0
|
|
2844
|
+
* },
|
|
2845
|
+
* { type: 'separator' },
|
|
2846
|
+
* {
|
|
2847
|
+
* type: 'task',
|
|
2848
|
+
* title: `Restore ${appName}`,
|
|
2849
|
+
* description: 'Restore to last configuration',
|
|
2850
|
+
* deepLink: 'fins://path.to/app/manifest.json?$$use-last-configuration=true',
|
|
2851
|
+
* iconPath: 'https://path.to/app/icon.ico',
|
|
2852
|
+
* iconIndex: 0
|
|
2853
|
+
* },
|
|
2854
|
+
* ]
|
|
2855
|
+
* },
|
|
2856
|
+
* {
|
|
2857
|
+
* name: 'Tools',
|
|
2858
|
+
* items: [ // array of JumpList items
|
|
2859
|
+
* {
|
|
2860
|
+
* type: 'task',
|
|
2861
|
+
* title: 'Tool A',
|
|
2862
|
+
* description: 'Runs Tool A',
|
|
2863
|
+
* deepLink: 'fins://path.to/tool-a/manifest.json',
|
|
2864
|
+
* iconPath: 'https://path.to/tool-a/icon.ico',
|
|
2865
|
+
* iconIndex: 0
|
|
2866
|
+
* },
|
|
2867
|
+
* {
|
|
2868
|
+
* type: 'task',
|
|
2869
|
+
* title: 'Tool B',
|
|
2870
|
+
* description: 'Runs Tool B',
|
|
2871
|
+
* deepLink: 'fins://path.to/tool-b/manifest.json',
|
|
2872
|
+
* iconPath: 'https://path.to/tool-b/icon.ico',
|
|
2873
|
+
* iconIndex: 0
|
|
2874
|
+
* }]
|
|
2875
|
+
* }
|
|
2876
|
+
* ];
|
|
2877
|
+
*
|
|
2878
|
+
* app.setJumpList(jumpListConfig).then(() => console.log('JumpList applied')).catch(e => console.log(`JumpList failed to apply: ${e.toString()}`));
|
|
2879
|
+
* ```
|
|
2880
|
+
*
|
|
2881
|
+
* To handle deeplink args:
|
|
2882
|
+
* ```js
|
|
2883
|
+
* function handleUseLastConfiguration() {
|
|
2884
|
+
* // this handler is called when the app is being launched
|
|
2885
|
+
* app.on('run-requested', event => {
|
|
2886
|
+
* if(event.userAppConfigArgs['use-last-configuration']) {
|
|
2887
|
+
* // your logic here
|
|
2888
|
+
* }
|
|
2889
|
+
* });
|
|
2890
|
+
* // this handler is called when the app was already running when the launch was requested
|
|
2891
|
+
* fin.desktop.main(function(args) {
|
|
2892
|
+
* if(args && args['use-last-configuration']) {
|
|
2893
|
+
* // your logic here
|
|
2894
|
+
* }
|
|
2895
|
+
* });
|
|
2896
|
+
* }
|
|
2897
|
+
* ```
|
|
2898
|
+
*/
|
|
2899
|
+
async setJumpList(jumpListCategories) {
|
|
2900
|
+
await this.wire.sendAction('set-jump-list', { config: jumpListCategories, ...this.identity });
|
|
2901
|
+
}
|
|
2902
|
+
/**
|
|
2903
|
+
* Adds a customizable icon in the system tray. To listen for a click on the icon use the `tray-icon-clicked` event.
|
|
2904
|
+
* @param icon Image URL or base64 encoded string to be used as the icon
|
|
2905
|
+
*
|
|
2906
|
+
* @example
|
|
2907
|
+
*
|
|
2908
|
+
* ```js
|
|
2909
|
+
* const imageUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
|
|
2910
|
+
* const base64EncodedImage = "iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX\
|
|
2911
|
+
* ///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII";
|
|
2912
|
+
* const dataURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DH\
|
|
2913
|
+
* xgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
|
|
2914
|
+
*
|
|
2915
|
+
* async function setTrayIcon(icon) {
|
|
2916
|
+
* const app = await fin.Application.getCurrent();
|
|
2917
|
+
* return await app.setTrayIcon(icon);
|
|
2918
|
+
* }
|
|
2919
|
+
*
|
|
2920
|
+
* // use image url to set tray icon
|
|
2921
|
+
* setTrayIcon(imageUrl).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
2922
|
+
*
|
|
2923
|
+
* // use base64 encoded string to set tray icon
|
|
2924
|
+
* setTrayIcon(base64EncodedImage).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
2925
|
+
*
|
|
2926
|
+
* // use a dataURL to set tray icon
|
|
2927
|
+
* setTrayIcon(dataURL).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
2928
|
+
* ```
|
|
2929
|
+
*/
|
|
2930
|
+
setTrayIcon(icon) {
|
|
2931
|
+
return this.wire
|
|
2932
|
+
.sendAction('set-tray-icon', {
|
|
2933
|
+
enabledIcon: icon,
|
|
2934
|
+
...this.identity
|
|
2935
|
+
})
|
|
2936
|
+
.then(() => undefined);
|
|
2937
|
+
}
|
|
2938
|
+
/**
|
|
2939
|
+
* Set hover text for this application's system tray icon.
|
|
2940
|
+
* Note: Application must first set a tray icon with {@link Application.setTrayIcon}.
|
|
2941
|
+
* @param toolTip
|
|
2942
|
+
*
|
|
2943
|
+
* @example
|
|
2944
|
+
*
|
|
2945
|
+
* ```js
|
|
2946
|
+
* const app = fin.Application.getCurrentSync();
|
|
2947
|
+
* const iconUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
|
|
2948
|
+
*
|
|
2949
|
+
* await app.setTrayIcon(iconUrl);
|
|
2950
|
+
*
|
|
2951
|
+
* await app.setTrayIconToolTip('My Application');
|
|
2952
|
+
* ```
|
|
2953
|
+
*/
|
|
2954
|
+
async setTrayIconToolTip(toolTip) {
|
|
2955
|
+
await this.wire.sendAction('set-tray-icon-tooltip', { ...this.identity, toolTip });
|
|
2956
|
+
}
|
|
2957
|
+
/**
|
|
2958
|
+
* Sets new application's shortcut configuration. Windows only.
|
|
2959
|
+
* @param config New application's shortcut configuration.
|
|
2960
|
+
*
|
|
2961
|
+
* @remarks Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest
|
|
2962
|
+
* to be able to change shortcut states.
|
|
2963
|
+
*
|
|
2964
|
+
* @example
|
|
2965
|
+
*
|
|
2966
|
+
* ```js
|
|
2967
|
+
* async function setShortcuts(config) {
|
|
2968
|
+
* const app = await fin.Application.getCurrent();
|
|
2969
|
+
* return app.setShortcuts(config);
|
|
2970
|
+
* }
|
|
2971
|
+
*
|
|
2972
|
+
* setShortcuts({
|
|
2973
|
+
* desktop: true,
|
|
2974
|
+
* startMenu: false,
|
|
2975
|
+
* systemStartup: true
|
|
2976
|
+
* }).then(() => console.log('Shortcuts are set.')).catch(err => console.log(err));
|
|
2977
|
+
* ```
|
|
2978
|
+
*/
|
|
2979
|
+
setShortcuts(config) {
|
|
2980
|
+
return this.wire.sendAction('set-shortcuts', { data: config, ...this.identity }).then(() => undefined);
|
|
2981
|
+
}
|
|
2982
|
+
/**
|
|
2983
|
+
* Sets the query string in all shortcuts for this app. Requires RVM 5.5+.
|
|
2984
|
+
* @param queryString The new query string for this app's shortcuts.
|
|
2985
|
+
*
|
|
2986
|
+
* @example
|
|
2987
|
+
*
|
|
2988
|
+
* ```js
|
|
2989
|
+
* const newQueryArgs = 'arg=true&arg2=false';
|
|
2990
|
+
* const app = await fin.Application.getCurrent();
|
|
2991
|
+
* try {
|
|
2992
|
+
* await app.setShortcutQueryParams(newQueryArgs);
|
|
2993
|
+
* } catch(err) {
|
|
2994
|
+
* console.error(err)
|
|
2995
|
+
* }
|
|
2996
|
+
* ```
|
|
2997
|
+
*/
|
|
2998
|
+
async setShortcutQueryParams(queryString) {
|
|
2999
|
+
await this.wire.sendAction('set-shortcut-query-args', { data: queryString, ...this.identity });
|
|
3000
|
+
}
|
|
3001
|
+
/**
|
|
3002
|
+
* Sets the zoom level of the application. The original size is 0 and each increment above or below represents zooming 20%
|
|
3003
|
+
* larger or smaller to default limits of 300% and 50% of original size, respectively.
|
|
3004
|
+
* @param level The zoom level
|
|
3005
|
+
*
|
|
3006
|
+
* @example
|
|
3007
|
+
*
|
|
3008
|
+
* ```js
|
|
3009
|
+
* async function setZoomLevel(number) {
|
|
3010
|
+
* const app = await fin.Application.getCurrent();
|
|
3011
|
+
* return await app.setZoomLevel(number);
|
|
3012
|
+
* }
|
|
3013
|
+
*
|
|
3014
|
+
* setZoomLevel(5).then(() => console.log('Setting a zoom level')).catch(err => console.log(err));
|
|
3015
|
+
* ```
|
|
3016
|
+
*/
|
|
3017
|
+
setZoomLevel(level) {
|
|
3018
|
+
return this.wire.sendAction('set-application-zoom-level', { level, ...this.identity }).then(() => undefined);
|
|
3019
|
+
}
|
|
3020
|
+
/**
|
|
3021
|
+
* Sets a username to correlate with App Log Management.
|
|
3022
|
+
* @param username Username to correlate with App's Log.
|
|
3023
|
+
*
|
|
3024
|
+
* @example
|
|
3025
|
+
*
|
|
3026
|
+
* ```js
|
|
3027
|
+
* async function setAppLogUser() {
|
|
3028
|
+
* const app = await fin.Application.getCurrent();
|
|
3029
|
+
* return await app.setAppLogUsername('username');
|
|
3030
|
+
* }
|
|
3031
|
+
*
|
|
3032
|
+
* setAppLogUser().then(() => console.log('Success')).catch(err => console.log(err));
|
|
3033
|
+
*
|
|
3034
|
+
* ```
|
|
3035
|
+
*/
|
|
3036
|
+
async setAppLogUsername(username) {
|
|
3037
|
+
await this.wire.sendAction('set-app-log-username', { data: username, ...this.identity });
|
|
3038
|
+
}
|
|
3039
|
+
/**
|
|
3040
|
+
* Retrieves information about the system tray. If the system tray is not set, it will throw an error message.
|
|
3041
|
+
* @remarks The only information currently returned is the position and dimensions.
|
|
3042
|
+
*
|
|
3043
|
+
* @example
|
|
3044
|
+
*
|
|
3045
|
+
* ```js
|
|
3046
|
+
* async function getTrayIconInfo() {
|
|
3047
|
+
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
3048
|
+
* return await app.getTrayIconInfo();
|
|
3049
|
+
* }
|
|
3050
|
+
* getTrayIconInfo().then(info => console.log(info)).catch(err => console.log(err));
|
|
3051
|
+
* ```
|
|
3052
|
+
*/
|
|
3053
|
+
getTrayIconInfo() {
|
|
3054
|
+
return this.wire.sendAction('get-tray-icon-info', this.identity).then(({ payload }) => payload.data);
|
|
3055
|
+
}
|
|
3056
|
+
/**
|
|
3057
|
+
* Checks if the application has an associated tray icon.
|
|
3058
|
+
*
|
|
3059
|
+
* @example
|
|
3060
|
+
*
|
|
3061
|
+
* ```js
|
|
3062
|
+
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
3063
|
+
* const hasTrayIcon = await app.hasTrayIcon();
|
|
3064
|
+
* console.log(hasTrayIcon);
|
|
3065
|
+
* ```
|
|
3066
|
+
*/
|
|
3067
|
+
hasTrayIcon() {
|
|
3068
|
+
return this.wire.sendAction('has-tray-icon', this.identity).then(({ payload }) => payload.data);
|
|
3069
|
+
}
|
|
3070
|
+
/**
|
|
3071
|
+
* Closes the application by terminating its process.
|
|
3072
|
+
*
|
|
3073
|
+
* @example
|
|
3074
|
+
*
|
|
3075
|
+
* ```js
|
|
3076
|
+
* async function terminateApp() {
|
|
3077
|
+
* const app = await fin.Application.getCurrent();
|
|
3078
|
+
* return await app.terminate();
|
|
3079
|
+
* }
|
|
3080
|
+
* terminateApp().then(() => console.log('Application terminated')).catch(err => console.log(err));
|
|
3081
|
+
* ```
|
|
3082
|
+
*/
|
|
3083
|
+
terminate() {
|
|
3084
|
+
return this.wire.sendAction('terminate-application', this.identity).then(() => undefined);
|
|
3085
|
+
}
|
|
3086
|
+
/**
|
|
3087
|
+
* Waits for a hanging application. This method can be called in response to an application
|
|
3088
|
+
* "not-responding" to allow the application to continue and to generate another "not-responding"
|
|
3089
|
+
* message after a certain period of time.
|
|
3090
|
+
*
|
|
3091
|
+
* @ignore
|
|
3092
|
+
*/
|
|
3093
|
+
wait() {
|
|
3094
|
+
return this.wire.sendAction('wait-for-hung-application', this.identity).then(() => undefined);
|
|
3095
|
+
}
|
|
3096
|
+
/**
|
|
3097
|
+
* Retrieves information about the application.
|
|
3098
|
+
*
|
|
3099
|
+
* @remarks If the application was not launched from a manifest, the call will return the closest parent application `manifest`
|
|
3100
|
+
* and `manifestUrl`. `initialOptions` shows the parameters used when launched programmatically, or the `startup_app` options
|
|
3101
|
+
* if launched from manifest. The `parentUuid` will be the uuid of the immediate parent (if applicable).
|
|
3102
|
+
*
|
|
3103
|
+
* @example
|
|
3104
|
+
*
|
|
3105
|
+
* ```js
|
|
3106
|
+
* async function getInfo() {
|
|
3107
|
+
* const app = await fin.Application.getCurrent();
|
|
3108
|
+
* return await app.getInfo();
|
|
3109
|
+
* }
|
|
3110
|
+
*
|
|
3111
|
+
* getInfo().then(info => console.log(info)).catch(err => console.log(err));
|
|
3112
|
+
* ```
|
|
3113
|
+
*/
|
|
3114
|
+
getInfo() {
|
|
3115
|
+
return this.wire.sendAction('get-info', this.identity).then(({ payload }) => payload.data);
|
|
3116
|
+
}
|
|
3117
|
+
/**
|
|
3118
|
+
* Retrieves all process information for entities (windows and views) associated with an application.
|
|
3119
|
+
*
|
|
3120
|
+
* @example
|
|
3121
|
+
* ```js
|
|
3122
|
+
* const app = await fin.Application.getCurrent();
|
|
3123
|
+
* const processInfo = await app.getProcessInfo();
|
|
3124
|
+
* ```
|
|
3125
|
+
* @experimental
|
|
3126
|
+
*/
|
|
3127
|
+
async getProcessInfo() {
|
|
3128
|
+
const { payload: { data } } = await this.wire.sendAction('application-get-process-info', this.identity);
|
|
3129
|
+
return data;
|
|
3130
|
+
}
|
|
3131
|
+
/**
|
|
3132
|
+
* Sets file auto download location. It's only allowed in the same application.
|
|
3133
|
+
*
|
|
3134
|
+
* Note: This method is restricted by default and must be enabled via
|
|
3135
|
+
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
3136
|
+
* @param downloadLocation file auto download location
|
|
3137
|
+
*
|
|
3138
|
+
* @throws if setting file auto download location on different applications.
|
|
3139
|
+
* @example
|
|
3140
|
+
*
|
|
3141
|
+
* ```js
|
|
3142
|
+
* const downloadLocation = 'C:\\dev\\temp';
|
|
3143
|
+
* const app = await fin.Application.getCurrent();
|
|
3144
|
+
* try {
|
|
3145
|
+
* await app.setFileDownloadLocation(downloadLocation);
|
|
3146
|
+
* console.log('File download location is set');
|
|
3147
|
+
* } catch(err) {
|
|
3148
|
+
* console.error(err)
|
|
3149
|
+
* }
|
|
3150
|
+
* ```
|
|
3151
|
+
*/
|
|
3152
|
+
async setFileDownloadLocation(downloadLocation) {
|
|
3153
|
+
const { name } = this.wire.me;
|
|
3154
|
+
const entityIdentity = { uuid: this.identity.uuid, name };
|
|
3155
|
+
await this.wire.sendAction('set-file-download-location', { ...entityIdentity, downloadLocation });
|
|
3156
|
+
}
|
|
3157
|
+
/**
|
|
3158
|
+
* 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.
|
|
3159
|
+
*
|
|
3160
|
+
* Note: This method is restricted by default and must be enabled via
|
|
3161
|
+
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
3162
|
+
*
|
|
3163
|
+
* @throws if getting file auto download location on different applications.
|
|
3164
|
+
* @example
|
|
3165
|
+
*
|
|
3166
|
+
* ```js
|
|
3167
|
+
* const app = await fin.Application.getCurrent();
|
|
3168
|
+
* const fileDownloadDir = await app.getFileDownloadLocation();
|
|
3169
|
+
* ```
|
|
3170
|
+
*/
|
|
3171
|
+
async getFileDownloadLocation() {
|
|
3172
|
+
const { payload: { data } } = await this.wire.sendAction('get-file-download-location', this.identity);
|
|
3173
|
+
return data;
|
|
3174
|
+
}
|
|
3175
|
+
/**
|
|
3176
|
+
* Shows a menu on the tray icon. Use with tray-icon-clicked event.
|
|
3177
|
+
* @param options
|
|
3178
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
|
3179
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
|
3180
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
|
3181
|
+
* these with a "reducer" pattern.
|
|
3182
|
+
* @throws if the application has no tray icon set
|
|
3183
|
+
* @throws if the system tray is currently hidden
|
|
3184
|
+
* @example
|
|
3185
|
+
*
|
|
3186
|
+
* ```js
|
|
3187
|
+
* const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
|
|
3188
|
+
* const app = fin.Application.getCurrentSync();
|
|
3189
|
+
*
|
|
3190
|
+
* await app.setTrayIcon(iconUrl);
|
|
3191
|
+
*
|
|
3192
|
+
* const template = [
|
|
3193
|
+
* {
|
|
3194
|
+
* label: 'Menu Item 1',
|
|
3195
|
+
* data: 'hello from item 1'
|
|
3196
|
+
* },
|
|
3197
|
+
* { type: 'separator' },
|
|
3198
|
+
* {
|
|
3199
|
+
* label: 'Menu Item 2',
|
|
3200
|
+
* type: 'checkbox',
|
|
3201
|
+
* checked: true,
|
|
3202
|
+
* data: 'The user clicked the checkbox'
|
|
3203
|
+
* },
|
|
3204
|
+
* {
|
|
3205
|
+
* label: 'see more',
|
|
3206
|
+
* enabled: false,
|
|
3207
|
+
* submenu: [
|
|
3208
|
+
* { label: 'submenu 1', data: 'hello from submenu' }
|
|
3209
|
+
* ]
|
|
3210
|
+
* }
|
|
3211
|
+
* ];
|
|
3212
|
+
*
|
|
3213
|
+
* app.addListener('tray-icon-clicked', (event) => {
|
|
3214
|
+
* // right-click
|
|
3215
|
+
* if (event.button === 2) {
|
|
3216
|
+
* app.showTrayIconPopupMenu({ template }).then(r => {
|
|
3217
|
+
* if (r.result === 'closed') {
|
|
3218
|
+
* console.log('nothing happened');
|
|
3219
|
+
* } else {
|
|
3220
|
+
* console.log(r.data);
|
|
3221
|
+
* }
|
|
3222
|
+
* });
|
|
3223
|
+
* }
|
|
3224
|
+
* });
|
|
3225
|
+
* ```
|
|
3226
|
+
*/
|
|
3227
|
+
async showTrayIconPopupMenu(options) {
|
|
3228
|
+
const { name } = this.wire.me;
|
|
3229
|
+
const entityIdentity = { uuid: this.identity.uuid, name };
|
|
3230
|
+
const { payload } = await this.wire.sendAction('show-tray-icon-popup-menu', { ...entityIdentity, options });
|
|
3231
|
+
return payload.data;
|
|
3232
|
+
}
|
|
3233
|
+
/**
|
|
3234
|
+
* Closes the tray icon menu.
|
|
3235
|
+
*
|
|
3236
|
+
* @throws if the application has no tray icon set
|
|
3237
|
+
* @example
|
|
3238
|
+
*
|
|
3239
|
+
* ```js
|
|
3240
|
+
* const app = fin.Application.getCurrentSync();
|
|
3241
|
+
*
|
|
3242
|
+
* await app.closeTrayIconPopupMenu();
|
|
3243
|
+
* ```
|
|
3244
|
+
*/
|
|
3245
|
+
async closeTrayIconPopupMenu() {
|
|
3246
|
+
const { name } = this.wire.me;
|
|
3247
|
+
const entityIdentity = { uuid: this.identity.uuid, name };
|
|
3248
|
+
await this.wire.sendAction('close-tray-icon-popup-menu', { ...entityIdentity });
|
|
3249
|
+
}
|
|
3250
|
+
}
|
|
3251
|
+
Instance$6.Application = Application;
|
|
3252
|
+
return Instance$6;
|
|
3519
3253
|
}
|
|
3520
|
-
Factory$7.ApplicationModule = ApplicationModule;
|
|
3521
3254
|
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
o[k2] = m[k];
|
|
3533
|
-
}));
|
|
3534
|
-
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
3535
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
3536
|
-
};
|
|
3537
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3255
|
+
var hasRequiredFactory$1;
|
|
3256
|
+
|
|
3257
|
+
function requireFactory$1 () {
|
|
3258
|
+
if (hasRequiredFactory$1) return Factory$7;
|
|
3259
|
+
hasRequiredFactory$1 = 1;
|
|
3260
|
+
Object.defineProperty(Factory$7, "__esModule", { value: true });
|
|
3261
|
+
Factory$7.ApplicationModule = void 0;
|
|
3262
|
+
const base_1 = base;
|
|
3263
|
+
const validate_1 = validate;
|
|
3264
|
+
const Instance_1 = requireInstance$1();
|
|
3538
3265
|
/**
|
|
3539
|
-
*
|
|
3540
|
-
*
|
|
3541
|
-
* * {@link ApplicationModule} contains static members of the `Application` API, accessible through `fin.Application`.
|
|
3542
|
-
* * {@link Application} describes an instance of an OpenFin Application, e.g. as returned by `fin.Application.getCurrent`.
|
|
3543
|
-
*
|
|
3544
|
-
* 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),
|
|
3545
|
-
* both of these were documented on the same page.
|
|
3546
|
-
*
|
|
3547
|
-
* @packageDocumentation
|
|
3266
|
+
* Static namespace for OpenFin API methods that interact with the {@link Application} class, available under `fin.Application`.
|
|
3548
3267
|
*/
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3268
|
+
class ApplicationModule extends base_1.Base {
|
|
3269
|
+
/**
|
|
3270
|
+
* Asynchronously returns an API handle for the given Application identity.
|
|
3271
|
+
*
|
|
3272
|
+
* @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
|
|
3273
|
+
* returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
|
|
3274
|
+
* for an Application throughout its entire lifecycle.
|
|
3275
|
+
*
|
|
3276
|
+
* @example
|
|
3277
|
+
*
|
|
3278
|
+
* ```js
|
|
3279
|
+
* fin.Application.wrap({ uuid: 'testapp' })
|
|
3280
|
+
* .then(app => app.isRunning())
|
|
3281
|
+
* .then(running => console.log('Application is running: ' + running))
|
|
3282
|
+
* .catch(err => console.log(err));
|
|
3283
|
+
* ```
|
|
3284
|
+
*
|
|
3285
|
+
*/
|
|
3286
|
+
async wrap(identity) {
|
|
3287
|
+
this.wire.sendAction('wrap-application').catch((e) => {
|
|
3288
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3289
|
+
});
|
|
3290
|
+
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
3291
|
+
if (errorMsg) {
|
|
3292
|
+
throw new Error(errorMsg);
|
|
3293
|
+
}
|
|
3294
|
+
return new Instance_1.Application(this.wire, identity);
|
|
3295
|
+
}
|
|
3296
|
+
/**
|
|
3297
|
+
* Synchronously returns an API handle for the given Application identity.
|
|
3298
|
+
*
|
|
3299
|
+
* @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
|
|
3300
|
+
* returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
|
|
3301
|
+
* for an Aplication throughout its entire lifecycle.
|
|
3302
|
+
*
|
|
3303
|
+
* @example
|
|
3304
|
+
*
|
|
3305
|
+
* ```js
|
|
3306
|
+
* const app = fin.Application.wrapSync({ uuid: 'testapp' });
|
|
3307
|
+
* await app.close();
|
|
3308
|
+
* ```
|
|
3309
|
+
*
|
|
3310
|
+
*/
|
|
3311
|
+
wrapSync(identity) {
|
|
3312
|
+
this.wire.sendAction('wrap-application-sync').catch((e) => {
|
|
3313
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3314
|
+
});
|
|
3315
|
+
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
3316
|
+
if (errorMsg) {
|
|
3317
|
+
throw new Error(errorMsg);
|
|
3318
|
+
}
|
|
3319
|
+
return new Instance_1.Application(this.wire, identity);
|
|
3320
|
+
}
|
|
3321
|
+
async _create(appOptions) {
|
|
3322
|
+
// set defaults:
|
|
3323
|
+
if (appOptions.waitForPageLoad === undefined) {
|
|
3324
|
+
appOptions.waitForPageLoad = false;
|
|
3325
|
+
}
|
|
3326
|
+
if (appOptions.autoShow === undefined && appOptions.isPlatformController === undefined) {
|
|
3327
|
+
appOptions.autoShow = true;
|
|
3328
|
+
}
|
|
3329
|
+
await this.wire.sendAction('create-application', appOptions);
|
|
3330
|
+
return this.wrap({ uuid: appOptions.uuid });
|
|
3331
|
+
}
|
|
3332
|
+
/**
|
|
3333
|
+
* DEPRECATED method to create a new Application. Use {@link Application.ApplicationModule.start Application.start} instead.
|
|
3334
|
+
*
|
|
3335
|
+
* @example
|
|
3336
|
+
*
|
|
3337
|
+
* ```js
|
|
3338
|
+
* async function createApp() {
|
|
3339
|
+
* const app = await fin.Application.create({
|
|
3340
|
+
* name: 'myApp',
|
|
3341
|
+
* uuid: 'app-3',
|
|
3342
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.create.html',
|
|
3343
|
+
* autoShow: true
|
|
3344
|
+
* });
|
|
3345
|
+
* await app.run();
|
|
3346
|
+
* }
|
|
3347
|
+
*
|
|
3348
|
+
* createApp().then(() => console.log('Application is created')).catch(err => console.log(err));
|
|
3349
|
+
* ```
|
|
3350
|
+
*
|
|
3351
|
+
* @ignore
|
|
3352
|
+
*/
|
|
3353
|
+
create(appOptions) {
|
|
3354
|
+
console.warn('Deprecation Warning: fin.Application.create is deprecated. Please use fin.Application.start');
|
|
3355
|
+
this.wire.sendAction('application-create').catch((e) => {
|
|
3356
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3357
|
+
});
|
|
3358
|
+
return this._create(appOptions);
|
|
3359
|
+
}
|
|
3360
|
+
/**
|
|
3361
|
+
* Creates and starts a new Application.
|
|
3362
|
+
*
|
|
3363
|
+
* @example
|
|
3364
|
+
*
|
|
3365
|
+
* ```js
|
|
3366
|
+
* async function start() {
|
|
3367
|
+
* return fin.Application.start({
|
|
3368
|
+
* name: 'app-1',
|
|
3369
|
+
* uuid: 'app-1',
|
|
3370
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.start.html',
|
|
3371
|
+
* autoShow: true
|
|
3372
|
+
* });
|
|
3373
|
+
* }
|
|
3374
|
+
* start().then(() => console.log('Application is running')).catch(err => console.log(err));
|
|
3375
|
+
* ```
|
|
3376
|
+
*
|
|
3377
|
+
*/
|
|
3378
|
+
async start(appOptions) {
|
|
3379
|
+
this.wire.sendAction('start-application').catch((e) => {
|
|
3380
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3381
|
+
});
|
|
3382
|
+
const app = await this._create(appOptions);
|
|
3383
|
+
await this.wire.sendAction('run-application', { uuid: appOptions.uuid });
|
|
3384
|
+
return app;
|
|
3385
|
+
}
|
|
3386
|
+
/**
|
|
3387
|
+
* Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls.
|
|
3388
|
+
* Returns once the RVM is finished attempting to launch the applications.
|
|
3389
|
+
* @param opts - Parameters that the RVM will use.
|
|
3390
|
+
*
|
|
3391
|
+
* @example
|
|
3392
|
+
*
|
|
3393
|
+
* ```js
|
|
3394
|
+
*
|
|
3395
|
+
* const applicationInfoArray = [
|
|
3396
|
+
* {
|
|
3397
|
+
* "uuid": 'App-1',
|
|
3398
|
+
* "manifestUrl": 'http://localhost:5555/app1.json',
|
|
3399
|
+
* },
|
|
3400
|
+
* {
|
|
3401
|
+
* "uuid": 'App-2',
|
|
3402
|
+
* "manifestUrl": 'http://localhost:5555/app2.json',
|
|
3403
|
+
* },
|
|
3404
|
+
* {
|
|
3405
|
+
* "uuid": 'App-3',
|
|
3406
|
+
* "manifestUrl": 'http://localhost:5555/app3.json',
|
|
3407
|
+
* }
|
|
3408
|
+
* ]
|
|
3409
|
+
*
|
|
3410
|
+
* fin.Application.startManyManifests(applicationInfoArray)
|
|
3411
|
+
* .then(() => {
|
|
3412
|
+
* console.log('RVM has finished launching the application list.');
|
|
3413
|
+
* })
|
|
3414
|
+
* .catch((err) => {
|
|
3415
|
+
* console.log(err);
|
|
3416
|
+
* })
|
|
3417
|
+
* ```
|
|
3418
|
+
*
|
|
3419
|
+
* @experimental
|
|
3420
|
+
*/
|
|
3421
|
+
async startManyManifests(applications, opts) {
|
|
3422
|
+
return this.wire.sendAction('run-applications', { applications, opts }).then(() => undefined);
|
|
3423
|
+
}
|
|
3424
|
+
/**
|
|
3425
|
+
* Asynchronously returns an Application object that represents the current application
|
|
3426
|
+
*
|
|
3427
|
+
* @example
|
|
3428
|
+
*
|
|
3429
|
+
* ```js
|
|
3430
|
+
* async function isCurrentAppRunning () {
|
|
3431
|
+
* const app = await fin.Application.getCurrent();
|
|
3432
|
+
* return app.isRunning();
|
|
3433
|
+
* }
|
|
3434
|
+
*
|
|
3435
|
+
* isCurrentAppRunning().then(running => {
|
|
3436
|
+
* console.log(`Current app is running: ${running}`);
|
|
3437
|
+
* }).catch(err => {
|
|
3438
|
+
* console.error(err);
|
|
3439
|
+
* });
|
|
3440
|
+
*
|
|
3441
|
+
* ```
|
|
3442
|
+
*/
|
|
3443
|
+
getCurrent() {
|
|
3444
|
+
this.wire.sendAction('get-current-application').catch((e) => {
|
|
3445
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3446
|
+
});
|
|
3447
|
+
return this.wrap({ uuid: this.wire.me.uuid });
|
|
3448
|
+
}
|
|
3449
|
+
/**
|
|
3450
|
+
* Synchronously returns an Application object that represents the current application
|
|
3451
|
+
*
|
|
3452
|
+
* @example
|
|
3453
|
+
*
|
|
3454
|
+
* ```js
|
|
3455
|
+
* async function isCurrentAppRunning () {
|
|
3456
|
+
* const app = fin.Application.getCurrentSync();
|
|
3457
|
+
* return app.isRunning();
|
|
3458
|
+
* }
|
|
3459
|
+
*
|
|
3460
|
+
* isCurrentAppRunning().then(running => {
|
|
3461
|
+
* console.log(`Current app is running: ${running}`);
|
|
3462
|
+
* }).catch(err => {
|
|
3463
|
+
* console.error(err);
|
|
3464
|
+
* });
|
|
3465
|
+
*
|
|
3466
|
+
* ```
|
|
3467
|
+
*/
|
|
3468
|
+
getCurrentSync() {
|
|
3469
|
+
this.wire.sendAction('get-current-application-sync').catch((e) => {
|
|
3470
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3471
|
+
});
|
|
3472
|
+
return this.wrapSync({ uuid: this.wire.me.uuid });
|
|
3473
|
+
}
|
|
3474
|
+
/**
|
|
3475
|
+
* Retrieves application's manifest and returns a running instance of the application.
|
|
3476
|
+
* @param manifestUrl - The URL of app's manifest.
|
|
3477
|
+
* @param opts - Parameters that the RVM will use.
|
|
3478
|
+
*
|
|
3479
|
+
* @example
|
|
3480
|
+
*
|
|
3481
|
+
* ```js
|
|
3482
|
+
* fin.Application.startFromManifest('http://localhost:5555/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
|
|
3483
|
+
*
|
|
3484
|
+
* // For a local manifest file:
|
|
3485
|
+
* fin.Application.startFromManifest('file:///C:/somefolder/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
|
|
3486
|
+
* ```
|
|
3487
|
+
*/
|
|
3488
|
+
async startFromManifest(manifestUrl, opts) {
|
|
3489
|
+
this.wire.sendAction('application-start-from-manifest').catch((e) => {
|
|
3490
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3491
|
+
});
|
|
3492
|
+
const app = await this._createFromManifest(manifestUrl);
|
|
3493
|
+
// @ts-expect-error using private method without warning.
|
|
3494
|
+
await app._run(opts); // eslint-disable-line no-underscore-dangle
|
|
3495
|
+
return app;
|
|
3496
|
+
}
|
|
3497
|
+
/**
|
|
3498
|
+
* @deprecated Use {@link Application.ApplicationModule.startFromManifest Application.startFromManifest} instead.
|
|
3499
|
+
* Retrieves application's manifest and returns a wrapped application.
|
|
3500
|
+
* @param manifestUrl - The URL of app's manifest.
|
|
3501
|
+
* @param callback - called if the method succeeds.
|
|
3502
|
+
* @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
|
|
3503
|
+
*
|
|
3504
|
+
* @example
|
|
3505
|
+
*
|
|
3506
|
+
* ```js
|
|
3507
|
+
* fin.Application.createFromManifest('http://localhost:5555/app.json').then(app => console.log(app)).catch(err => console.log(err));
|
|
3508
|
+
* ```
|
|
3509
|
+
* @ignore
|
|
3510
|
+
*/
|
|
3511
|
+
createFromManifest(manifestUrl) {
|
|
3512
|
+
console.warn('Deprecation Warning: fin.Application.createFromManifest is deprecated. Please use fin.Application.startFromManifest');
|
|
3513
|
+
this.wire.sendAction('application-create-from-manifest').catch((e) => {
|
|
3514
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3515
|
+
});
|
|
3516
|
+
return this._createFromManifest(manifestUrl);
|
|
3517
|
+
}
|
|
3518
|
+
_createFromManifest(manifestUrl) {
|
|
3519
|
+
return this.wire
|
|
3520
|
+
.sendAction('get-application-manifest', { manifestUrl })
|
|
3521
|
+
.then(({ payload }) => {
|
|
3522
|
+
const uuid = payload.data.platform ? payload.data.platform.uuid : payload.data.startup_app.uuid;
|
|
3523
|
+
return this.wrap({ uuid });
|
|
3524
|
+
})
|
|
3525
|
+
.then((app) => {
|
|
3526
|
+
app._manifestUrl = manifestUrl; // eslint-disable-line no-underscore-dangle
|
|
3527
|
+
return app;
|
|
3528
|
+
});
|
|
3529
|
+
}
|
|
3530
|
+
}
|
|
3531
|
+
Factory$7.ApplicationModule = ApplicationModule;
|
|
3532
|
+
return Factory$7;
|
|
3533
|
+
}
|
|
3534
|
+
|
|
3535
|
+
var hasRequiredApplication;
|
|
3536
|
+
|
|
3537
|
+
function requireApplication () {
|
|
3538
|
+
if (hasRequiredApplication) return application;
|
|
3539
|
+
hasRequiredApplication = 1;
|
|
3540
|
+
(function (exports) {
|
|
3541
|
+
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3542
|
+
if (k2 === undefined) k2 = k;
|
|
3543
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3544
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3545
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
3546
|
+
}
|
|
3547
|
+
Object.defineProperty(o, k2, desc);
|
|
3548
|
+
}) : (function(o, m, k, k2) {
|
|
3549
|
+
if (k2 === undefined) k2 = k;
|
|
3550
|
+
o[k2] = m[k];
|
|
3551
|
+
}));
|
|
3552
|
+
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
3553
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
3554
|
+
};
|
|
3555
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3556
|
+
/**
|
|
3557
|
+
* Entry points for the OpenFin `Application` API (`fin.Application`).
|
|
3558
|
+
*
|
|
3559
|
+
* * {@link ApplicationModule} contains static members of the `Application` API, accessible through `fin.Application`.
|
|
3560
|
+
* * {@link Application} describes an instance of an OpenFin Application, e.g. as returned by `fin.Application.getCurrent`.
|
|
3561
|
+
*
|
|
3562
|
+
* 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),
|
|
3563
|
+
* both of these were documented on the same page.
|
|
3564
|
+
*
|
|
3565
|
+
* @packageDocumentation
|
|
3566
|
+
*/
|
|
3567
|
+
__exportStar(requireFactory$1(), exports);
|
|
3568
|
+
__exportStar(requireInstance$1(), exports);
|
|
3569
|
+
} (application));
|
|
3570
|
+
return application;
|
|
3571
|
+
}
|
|
3552
3572
|
|
|
3553
3573
|
var promisifySubscription$1 = {};
|
|
3554
3574
|
|
|
@@ -3592,7 +3612,7 @@ function requireInstance () {
|
|
|
3592
3612
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3593
3613
|
/* eslint-disable no-console */
|
|
3594
3614
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
3595
|
-
const application_1 =
|
|
3615
|
+
const application_1 = requireApplication();
|
|
3596
3616
|
const main_1 = main;
|
|
3597
3617
|
const view_1 = requireView();
|
|
3598
3618
|
const warnings_1 = warnings;
|
|
@@ -8912,7 +8932,7 @@ var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
8912
8932
|
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");
|
|
8913
8933
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
8914
8934
|
};
|
|
8915
|
-
var __importDefault$
|
|
8935
|
+
var __importDefault$5 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
8916
8936
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8917
8937
|
};
|
|
8918
8938
|
var _ConnectionManager_messageReceiver, _ConnectionManager_rtcConnectionManager;
|
|
@@ -8926,7 +8946,7 @@ const ice_manager_1 = iceManager;
|
|
|
8926
8946
|
const provider_1$1 = provider;
|
|
8927
8947
|
const message_receiver_1 = messageReceiver$1;
|
|
8928
8948
|
const protocol_manager_1 = protocolManager;
|
|
8929
|
-
const strategy_3 = __importDefault$
|
|
8949
|
+
const strategy_3 = __importDefault$5(strategy);
|
|
8930
8950
|
class ConnectionManager extends base_1$j.Base {
|
|
8931
8951
|
static getProtocolOptionsFromStrings(protocols) {
|
|
8932
8952
|
return protocols.map((protocol) => {
|
|
@@ -13595,16 +13615,16 @@ var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
13595
13615
|
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");
|
|
13596
13616
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
13597
13617
|
};
|
|
13598
|
-
var __importDefault$
|
|
13618
|
+
var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
13599
13619
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13600
13620
|
};
|
|
13601
13621
|
var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
|
|
13602
13622
|
Object.defineProperty(InteropBroker$1, "__esModule", { value: true });
|
|
13603
13623
|
InteropBroker$1.InteropBroker = void 0;
|
|
13604
13624
|
const base_1$6 = base;
|
|
13605
|
-
const SessionContextGroupBroker_1 = __importDefault$
|
|
13625
|
+
const SessionContextGroupBroker_1 = __importDefault$4(SessionContextGroupBroker$1);
|
|
13606
13626
|
const utils_1$7 = utils$3;
|
|
13607
|
-
const isEqual_1$2 = __importDefault$
|
|
13627
|
+
const isEqual_1$2 = __importDefault$4(require$$3);
|
|
13608
13628
|
const PrivateChannelProvider_1 = PrivateChannelProvider$1;
|
|
13609
13629
|
const lazy_1$1 = lazy;
|
|
13610
13630
|
const defaultContextGroups = [
|
|
@@ -15103,14 +15123,14 @@ var __classPrivateFieldGet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
15103
15123
|
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");
|
|
15104
15124
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15105
15125
|
};
|
|
15106
|
-
var __importDefault$
|
|
15126
|
+
var __importDefault$3 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
15107
15127
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15108
15128
|
};
|
|
15109
15129
|
var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory, _InteropClient_channelEvents;
|
|
15110
15130
|
Object.defineProperty(InteropClient$1, "__esModule", { value: true });
|
|
15111
15131
|
InteropClient$1.InteropClient = void 0;
|
|
15112
15132
|
const base_1$4 = base;
|
|
15113
|
-
const SessionContextGroupClient_1 = __importDefault$
|
|
15133
|
+
const SessionContextGroupClient_1 = __importDefault$3(SessionContextGroupClient$1);
|
|
15114
15134
|
const utils_1$5 = utils$3;
|
|
15115
15135
|
const channel_events_1 = channelEvents;
|
|
15116
15136
|
/**
|
|
@@ -15887,12 +15907,12 @@ var fdc3Channels2_0 = {};
|
|
|
15887
15907
|
|
|
15888
15908
|
var fdc3Channels1_2 = {};
|
|
15889
15909
|
|
|
15890
|
-
var __importDefault$
|
|
15910
|
+
var __importDefault$2 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
15891
15911
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15892
15912
|
};
|
|
15893
15913
|
Object.defineProperty(fdc3Channels1_2, "__esModule", { value: true });
|
|
15894
15914
|
fdc3Channels1_2.createV1Channel = void 0;
|
|
15895
|
-
const isEqual_1$1 = __importDefault$
|
|
15915
|
+
const isEqual_1$1 = __importDefault$2(require$$3);
|
|
15896
15916
|
const createV1Channel = (sessionContextGroup) => {
|
|
15897
15917
|
return {
|
|
15898
15918
|
id: sessionContextGroup.id,
|
|
@@ -16171,7 +16191,7 @@ var __classPrivateFieldSet$3 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
16171
16191
|
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");
|
|
16172
16192
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16173
16193
|
};
|
|
16174
|
-
var __importDefault$
|
|
16194
|
+
var __importDefault$1 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
16175
16195
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16176
16196
|
};
|
|
16177
16197
|
var _FDC3ModuleBase_producer;
|
|
@@ -16180,7 +16200,7 @@ fdc3Common.FDC3ModuleBase = void 0;
|
|
|
16180
16200
|
const utils_1$4 = utils$2;
|
|
16181
16201
|
const utils_2$1 = utils$3;
|
|
16182
16202
|
const InteropClient_1$2 = InteropClient$1;
|
|
16183
|
-
const isEqual_1 = __importDefault$
|
|
16203
|
+
const isEqual_1 = __importDefault$1(require$$3);
|
|
16184
16204
|
class FDC3ModuleBase {
|
|
16185
16205
|
get client() {
|
|
16186
16206
|
return __classPrivateFieldGet$3(this, _FDC3ModuleBase_producer, "f").call(this);
|
|
@@ -16974,12 +16994,8 @@ const fdc3Factory = (version, interopClient, wire) => {
|
|
|
16974
16994
|
};
|
|
16975
16995
|
fdc3ClientFactory.fdc3Factory = fdc3Factory;
|
|
16976
16996
|
|
|
16977
|
-
var __importDefault$1 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
16978
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16979
|
-
};
|
|
16980
16997
|
Object.defineProperty(Factory$1, "__esModule", { value: true });
|
|
16981
16998
|
Factory$1.InteropModule = void 0;
|
|
16982
|
-
const cloneDeep_1 = __importDefault$1(require$$0$1);
|
|
16983
16999
|
const inaccessibleObject_1 = inaccessibleObject;
|
|
16984
17000
|
const base_1$3 = base;
|
|
16985
17001
|
const InteropBroker_1 = InteropBroker$1;
|
|
@@ -17017,7 +17033,7 @@ class InteropModule extends base_1$3.Base {
|
|
|
17017
17033
|
// Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
|
|
17018
17034
|
const options = await this.wire.environment.getInteropInfo(this.wire.getFin());
|
|
17019
17035
|
const objectThatThrows = (0, inaccessibleObject_1.createUnusableObject)(BrokerParamAccessError);
|
|
17020
|
-
const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (
|
|
17036
|
+
const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, structuredClone(options));
|
|
17021
17037
|
const getProvider = () => {
|
|
17022
17038
|
return this.fin.InterApplicationBus.Channel.create(`interop-broker-${name}`);
|
|
17023
17039
|
};
|
|
@@ -17590,7 +17606,7 @@ const events_1$3 = require$$0;
|
|
|
17590
17606
|
// Import from the file rather than the directory in case someone consuming types is using module resolution other than "node"
|
|
17591
17607
|
const index_1 = system;
|
|
17592
17608
|
const index_2 = requireWindow();
|
|
17593
|
-
const index_3 =
|
|
17609
|
+
const index_3 = requireApplication();
|
|
17594
17610
|
const index_4 = interappbus;
|
|
17595
17611
|
const index_5 = clipboard;
|
|
17596
17612
|
const index_6 = externalApplication;
|
|
@@ -18404,7 +18420,7 @@ class NodeEnvironment extends BaseEnvironment_1 {
|
|
|
18404
18420
|
};
|
|
18405
18421
|
}
|
|
18406
18422
|
getAdapterVersionSync() {
|
|
18407
|
-
return "45.100.
|
|
18423
|
+
return "45.100.48";
|
|
18408
18424
|
}
|
|
18409
18425
|
observeBounds(element, onChange) {
|
|
18410
18426
|
throw new Error('Method not implemented.');
|