@openfin/remote-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.
Files changed (2) hide show
  1. package/out/remote-adapter.js +1148 -1174
  2. package/package.json +2 -2
@@ -3,7 +3,6 @@
3
3
  var require$$3 = require('lodash/isEqual');
4
4
  var require$$0 = require('events');
5
5
  var bridge = require('./bridge-ef11968f.js');
6
- var require$$0$1 = require('lodash/cloneDeep');
7
6
  var crypto = require('crypto');
8
7
  var backchannel = require('./backchannel.js');
9
8
  var constants = require('./constants.js');
@@ -819,16 +818,16 @@ var __classPrivateFieldGet$i = (commonjsGlobal && commonjsGlobal.__classPrivateF
819
818
  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");
820
819
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
821
820
  };
822
- var __importDefault$7 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
821
+ var __importDefault$6 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
823
822
  return (mod && mod.__esModule) ? mod : { "default": mod };
824
823
  };
825
824
  var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
826
825
  Object.defineProperty(InteropBroker$1, "__esModule", { value: true });
827
826
  InteropBroker$1.InteropBroker = void 0;
828
- const base_1$n = base;
829
- const SessionContextGroupBroker_1 = __importDefault$7(SessionContextGroupBroker$1);
827
+ const base_1$p = base;
828
+ const SessionContextGroupBroker_1 = __importDefault$6(SessionContextGroupBroker$1);
830
829
  const utils_1$7 = utils$3;
831
- const isEqual_1$2 = __importDefault$7(require$$3);
830
+ const isEqual_1$2 = __importDefault$6(require$$3);
832
831
  const PrivateChannelProvider_1 = PrivateChannelProvider$1;
833
832
  const lazy_1$3 = lazy;
834
833
  const defaultContextGroups = [
@@ -994,7 +993,7 @@ const defaultContextGroups = [
994
993
  * ---
995
994
  *
996
995
  */
997
- class InteropBroker extends base_1$n.Base {
996
+ class InteropBroker extends base_1$p.Base {
998
997
  /**
999
998
  * @internal
1000
999
  */
@@ -2566,11 +2565,11 @@ const handleDeprecatedWarnings = (options) => {
2566
2565
  };
2567
2566
  warnings.handleDeprecatedWarnings = handleDeprecatedWarnings;
2568
2567
 
2569
- var hasRequiredFactory$2;
2568
+ var hasRequiredFactory$1;
2570
2569
 
2571
- function requireFactory$2 () {
2572
- if (hasRequiredFactory$2) return Factory$8;
2573
- hasRequiredFactory$2 = 1;
2570
+ function requireFactory$1 () {
2571
+ if (hasRequiredFactory$1) return Factory$8;
2572
+ hasRequiredFactory$1 = 1;
2574
2573
  Object.defineProperty(Factory$8, "__esModule", { value: true });
2575
2574
  Factory$8.ViewModule = void 0;
2576
2575
  const base_1 = base;
@@ -2729,8 +2728,8 @@ var main = {};
2729
2728
 
2730
2729
  Object.defineProperty(main, "__esModule", { value: true });
2731
2730
  main.WebContents = void 0;
2732
- const base_1$m = base;
2733
- class WebContents extends base_1$m.EmitterBase {
2731
+ const base_1$o = base;
2732
+ class WebContents extends base_1$o.EmitterBase {
2734
2733
  /**
2735
2734
  * @param identity The identity of the {@link OpenFin.WebContentsEvents WebContents}.
2736
2735
  * @param entityType The type of the {@link OpenFin.WebContentsEvents WebContents}.
@@ -3823,1154 +3822,1133 @@ var Factory$6 = {};
3823
3822
 
3824
3823
  var Instance$5 = {};
3825
3824
 
3826
- var hasRequiredInstance$2;
3827
-
3828
- function requireInstance$2 () {
3829
- if (hasRequiredInstance$2) return Instance$5;
3830
- hasRequiredInstance$2 = 1;
3831
- Object.defineProperty(Instance$5, "__esModule", { value: true });
3832
- Instance$5.Application = void 0;
3833
- /* eslint-disable import/prefer-default-export */
3834
- const base_1 = base;
3835
- const window_1 = requireWindow();
3836
- const view_1 = requireView();
3837
- /**
3838
- * An object representing an application. Allows the developer to create,
3839
- * execute, show/close an application as well as listen to {@link OpenFin.ApplicationEvents application events}.
3840
- */
3841
- class Application extends base_1.EmitterBase {
3842
- /**
3843
- * @internal
3844
- */
3845
- constructor(wire, identity) {
3846
- super(wire, 'application', identity.uuid);
3847
- this.identity = identity;
3848
- this.window = new window_1._Window(this.wire, {
3849
- uuid: this.identity.uuid,
3850
- name: this.identity.uuid
3851
- });
3852
- }
3853
- windowListFromIdentityList(identityList) {
3854
- const windowList = [];
3855
- identityList.forEach((identity) => {
3856
- windowList.push(new window_1._Window(this.wire, {
3857
- uuid: identity.uuid,
3858
- name: identity.name
3859
- }));
3860
- });
3861
- return windowList;
3862
- }
3863
- /**
3864
- * Determines if the application is currently running.
3865
- *
3866
- * @example
3867
- *
3868
- * ```js
3869
- * async function isAppRunning() {
3870
- * const app = await fin.Application.getCurrent();
3871
- * return await app.isRunning();
3872
- * }
3873
- * isAppRunning().then(running => console.log(`Current app is running: ${running}`)).catch(err => console.log(err));
3874
- * ```
3875
- */
3876
- isRunning() {
3877
- return this.wire.sendAction('is-application-running', this.identity).then(({ payload }) => payload.data);
3878
- }
3879
- /**
3880
- * Closes the application and any child windows created by the application.
3881
- * Cleans the application from state so it is no longer found in getAllApplications.
3882
- * @param force Close will be prevented from closing when force is false and
3883
- * ‘close-requested’ has been subscribed to for application’s main window.
3884
- *
3885
- * @example
3886
- *
3887
- * ```js
3888
- * async function closeApp() {
3889
- * const allApps1 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}, {uuid: 'app2', isRunning: true}]
3890
- * const app = await fin.Application.wrap({uuid: 'app2'});
3891
- * await app.quit();
3892
- * const allApps2 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}]
3893
- *
3894
- * }
3895
- * closeApp().then(() => console.log('Application quit')).catch(err => console.log(err));
3896
- * ```
3897
- */
3898
- async quit(force = false) {
3899
- try {
3900
- await this._close(force);
3901
- await this.wire.sendAction('destroy-application', { force, ...this.identity });
3902
- }
3903
- catch (error) {
3904
- const acceptableErrors = ['Remote connection has closed', 'Could not locate the requested application'];
3905
- if (!acceptableErrors.some((msg) => error.message.includes(msg))) {
3906
- throw error;
3907
- }
3908
- }
3909
- }
3910
- async _close(force = false) {
3911
- try {
3912
- await this.wire.sendAction('close-application', { force, ...this.identity });
3913
- }
3914
- catch (error) {
3915
- if (!error.message.includes('Remote connection has closed')) {
3916
- throw error;
3917
- }
3918
- }
3919
- }
3920
- /**
3921
- * @deprecated use Application.quit instead
3922
- * Closes the application and any child windows created by the application.
3923
- * @param force - Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for application’s main window.
3924
- * @param callback - called if the method succeeds.
3925
- * @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
3926
- *
3927
- * @example
3928
- *
3929
- * ```js
3930
- * async function closeApp() {
3931
- * const app = await fin.Application.getCurrent();
3932
- * return await app.close();
3933
- * }
3934
- * closeApp().then(() => console.log('Application closed')).catch(err => console.log(err));
3935
- * ```
3936
- */
3937
- close(force = false) {
3938
- console.warn('Deprecation Warning: Application.close is deprecated Please use Application.quit');
3939
- this.wire.sendAction('application-close', this.identity).catch((e) => {
3940
- // we do not want to expose this error, just continue if this analytics-only call fails
3941
- });
3942
- return this._close(force);
3943
- }
3944
- /**
3945
- * Retrieves an array of wrapped fin.Windows for each of the application’s child windows.
3946
- *
3947
- * @example
3948
- *
3949
- * ```js
3950
- * async function getChildWindows() {
3951
- * const app = await fin.Application.getCurrent();
3952
- * return await app.getChildWindows();
3953
- * }
3954
- *
3955
- * getChildWindows().then(children => console.log(children)).catch(err => console.log(err));
3956
- * ```
3957
- */
3958
- getChildWindows() {
3959
- return this.wire.sendAction('get-child-windows', this.identity).then(({ payload }) => {
3960
- const identityList = [];
3961
- payload.data.forEach((winName) => {
3962
- identityList.push({ uuid: this.identity.uuid, name: winName });
3963
- });
3964
- return this.windowListFromIdentityList(identityList);
3965
- });
3966
- }
3967
- /**
3968
- * Retrieves the JSON manifest that was used to create the application. Invokes the error callback
3969
- * if the application was not created from a manifest.
3970
- *
3971
- * @example
3972
- *
3973
- * ```js
3974
- * async function getManifest() {
3975
- * const app = await fin.Application.getCurrent();
3976
- * return await app.getManifest();
3977
- * }
3978
- *
3979
- * getManifest().then(manifest => console.log(manifest)).catch(err => console.log(err));
3980
- * ```
3981
- */
3982
- getManifest() {
3983
- return this.wire.sendAction('get-application-manifest', this.identity).then(({ payload }) => payload.data);
3984
- }
3985
- /**
3986
- * Retrieves UUID of the application that launches this application. Invokes the error callback
3987
- * if the application was created from a manifest.
3988
- *
3989
- * @example
3990
- *
3991
- * ```js
3992
- * async function getParentUuid() {
3993
- * const app = await fin.Application.start({
3994
- * uuid: 'app-1',
3995
- * name: 'myApp',
3996
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getParentUuid.html',
3997
- * autoShow: true
3998
- * });
3999
- * return await app.getParentUuid();
4000
- * }
4001
- *
4002
- * getParentUuid().then(parentUuid => console.log(parentUuid)).catch(err => console.log(err));
4003
- * ```
4004
- */
4005
- getParentUuid() {
4006
- return this.wire.sendAction('get-parent-application', this.identity).then(({ payload }) => payload.data);
4007
- }
4008
- /**
4009
- * Retrieves current application's shortcut configuration.
4010
- *
4011
- * @example
4012
- *
4013
- * ```js
4014
- * async function getShortcuts() {
4015
- * const app = await fin.Application.wrap({ uuid: 'testapp' });
4016
- * return await app.getShortcuts();
4017
- * }
4018
- * getShortcuts().then(config => console.log(config)).catch(err => console.log(err));
4019
- * ```
4020
- */
4021
- getShortcuts() {
4022
- return this.wire.sendAction('get-shortcuts', this.identity).then(({ payload }) => payload.data);
4023
- }
4024
- /**
4025
- * Retrieves current application's views.
4026
- * @experimental
4027
- *
4028
- * @example
4029
- *
4030
- * ```js
4031
- * async function getViews() {
4032
- * const app = await fin.Application.getCurrent();
4033
- * return await app.getViews();
4034
- * }
4035
- * getViews().then(views => console.log(views)).catch(err => console.log(err));
4036
- * ```
4037
- */
4038
- async getViews() {
4039
- const { payload } = await this.wire.sendAction('application-get-views', this.identity);
4040
- return payload.data.map((id) => new view_1.View(this.wire, id));
4041
- }
4042
- /**
4043
- * Returns the current zoom level of the application.
4044
- *
4045
- * @example
4046
- *
4047
- * ```js
4048
- * async function getZoomLevel() {
4049
- * const app = await fin.Application.getCurrent();
4050
- * return await app.getZoomLevel();
4051
- * }
4052
- *
4053
- * getZoomLevel().then(zoomLevel => console.log(zoomLevel)).catch(err => console.log(err));
4054
- * ```
4055
- */
4056
- getZoomLevel() {
4057
- return this.wire.sendAction('get-application-zoom-level', this.identity).then(({ payload }) => payload.data);
4058
- }
4059
- /**
4060
- * Returns an instance of the main Window of the application
4061
- *
4062
- * @example
4063
- *
4064
- * ```js
4065
- * async function getWindow() {
4066
- * const app = await fin.Application.start({
4067
- * uuid: 'app-1',
4068
- * name: 'myApp',
4069
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getWindow.html',
4070
- * autoShow: true
4071
- * });
4072
- * return await app.getWindow();
4073
- * }
4074
- *
4075
- * getWindow().then(win => {
4076
- * win.showAt(0, 400);
4077
- * win.flash();
4078
- * }).catch(err => console.log(err));
4079
- * ```
4080
- */
4081
- getWindow() {
4082
- this.wire.sendAction('application-get-window', this.identity).catch((e) => {
4083
- // we do not want to expose this error, just continue if this analytics-only call fails
4084
- });
4085
- return Promise.resolve(this.window);
4086
- }
4087
- /**
4088
- * Manually registers a user with the licensing service. The only data sent by this call is userName and appName.
4089
- * @param userName - username to be passed to the RVM.
4090
- * @param appName - app name to be passed to the RVM.
4091
- *
4092
- * @example
4093
- *
4094
- * ```js
4095
- * async function registerUser() {
4096
- * const app = await fin.Application.getCurrent();
4097
- * return await app.registerUser('user', 'myApp');
4098
- * }
4099
- *
4100
- * registerUser().then(() => console.log('Successfully registered the user')).catch(err => console.log(err));
4101
- * ```
4102
- */
4103
- registerUser(userName, appName) {
4104
- return this.wire.sendAction('register-user', { userName, appName, ...this.identity }).then(() => undefined);
4105
- }
4106
- /**
4107
- * Removes the application’s icon from the tray.
4108
- *
4109
- * @example
4110
- *
4111
- * ```js
4112
- * async function removeTrayIcon() {
4113
- * const app = await fin.Application.getCurrent();
4114
- * return await app.removeTrayIcon();
4115
- * }
4116
- *
4117
- * removeTrayIcon().then(() => console.log('Removed the tray icon.')).catch(err => console.log(err));
4118
- * ```
4119
- */
4120
- removeTrayIcon() {
4121
- return this.wire.sendAction('remove-tray-icon', this.identity).then(() => undefined);
4122
- }
4123
- /**
4124
- * Restarts the application.
4125
- *
4126
- * @example
4127
- *
4128
- * ```js
4129
- * async function restartApp() {
4130
- * const app = await fin.Application.getCurrent();
4131
- * return await app.restart();
4132
- * }
4133
- * restartApp().then(() => console.log('Application restarted')).catch(err => console.log(err));
4134
- * ```
4135
- */
4136
- restart() {
4137
- return this.wire.sendAction('restart-application', this.identity).then(() => undefined);
4138
- }
4139
- /**
4140
- * DEPRECATED method to run the application.
4141
- * Needed when starting application via {@link Application.create}, but NOT needed when starting via {@link Application.start}.
4142
- *
4143
- * @example
4144
- *
4145
- * ```js
4146
- * async function run() {
4147
- * const app = await fin.Application.create({
4148
- * name: 'myApp',
4149
- * uuid: 'app-1',
4150
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.run.html',
4151
- * autoShow: true
4152
- * });
4153
- * await app.run();
4154
- * }
4155
- * run().then(() => console.log('Application is running')).catch(err => console.log(err));
4156
- * ```
4157
- *
4158
- * @ignore
4159
- */
4160
- run() {
4161
- console.warn('Deprecation Warning: Application.run is deprecated Please use fin.Application.start');
4162
- this.wire.sendAction('application-run', this.identity).catch((e) => {
4163
- // we do not want to expose this error, just continue if this analytics-only call fails
4164
- });
4165
- return this._run();
4166
- }
4167
- _run(opts = {}) {
4168
- return this.wire
4169
- .sendAction('run-application', {
4170
- manifestUrl: this._manifestUrl,
4171
- opts,
4172
- ...this.identity
4173
- })
4174
- .then(() => undefined);
4175
- }
4176
- /**
4177
- * Instructs the RVM to schedule one restart of the application.
4178
- *
4179
- * @example
4180
- *
4181
- * ```js
4182
- * async function scheduleRestart() {
4183
- * const app = await fin.Application.getCurrent();
4184
- * return await app.scheduleRestart();
4185
- * }
4186
- *
4187
- * scheduleRestart().then(() => console.log('Application is scheduled to restart')).catch(err => console.log(err));
4188
- * ```
4189
- */
4190
- scheduleRestart() {
4191
- return this.wire.sendAction('relaunch-on-close', this.identity).then(() => undefined);
4192
- }
4193
- /**
4194
- * Sends a message to the RVM to upload the application's logs. On success,
4195
- * an object containing logId is returned.
4196
- *
4197
- * @example
4198
- *
4199
- * ```js
4200
- * async function sendLog() {
4201
- * const app = await fin.Application.getCurrent();
4202
- * return await app.sendApplicationLog();
4203
- * }
4204
- *
4205
- * sendLog().then(info => console.log(info.logId)).catch(err => console.log(err));
4206
- * ```
4207
- */
4208
- async sendApplicationLog() {
4209
- const { payload } = await this.wire.sendAction('send-application-log', this.identity);
4210
- return payload.data;
4211
- }
4212
- /**
4213
- * Sets or removes a custom JumpList for the application. Only applicable in Windows OS.
4214
- * If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
4215
- *
4216
- * Note: If the "name" property is omitted it defaults to "tasks".
4217
- * @param jumpListCategories An array of JumpList Categories to populate. If null, remove any existing JumpList configuration and set to Windows default.
4218
- *
4219
- *
4220
- * @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).
4221
- *
4222
- * The bottommost item in the jumplist will always be an item pointing to the current app. Its name is taken from the manifest's
4223
- * **` shortcut.name `** and uses **` shortcut.company `** as a fallback. Clicking that item will launch the app from its current manifest.
4224
- *
4225
- * Note: If the "name" property is omitted it defaults to "tasks".
4226
- *
4227
- * Note: Window OS caches jumplists icons, therefore an icon change might only be visible after the cache is removed or the
4228
- * uuid or shortcut.name is changed.
4229
- *
4230
- * @example
4231
- *
4232
- * ```js
4233
- * const app = fin.Application.getCurrentSync();
4234
- * const appName = 'My App';
4235
- * const jumpListConfig = [ // array of JumpList categories
4236
- * {
4237
- * // has no name and no type so `type` is assumed to be "tasks"
4238
- * items: [ // array of JumpList items
4239
- * {
4240
- * type: 'task',
4241
- * title: `Launch ${appName}`,
4242
- * description: `Runs ${appName} with the default configuration`,
4243
- * deepLink: 'fins://path.to/app/manifest.json',
4244
- * iconPath: 'https://path.to/app/icon.ico',
4245
- * iconIndex: 0
4246
- * },
4247
- * { type: 'separator' },
4248
- * {
4249
- * type: 'task',
4250
- * title: `Restore ${appName}`,
4251
- * description: 'Restore to last configuration',
4252
- * deepLink: 'fins://path.to/app/manifest.json?$$use-last-configuration=true',
4253
- * iconPath: 'https://path.to/app/icon.ico',
4254
- * iconIndex: 0
4255
- * },
4256
- * ]
4257
- * },
4258
- * {
4259
- * name: 'Tools',
4260
- * items: [ // array of JumpList items
4261
- * {
4262
- * type: 'task',
4263
- * title: 'Tool A',
4264
- * description: 'Runs Tool A',
4265
- * deepLink: 'fins://path.to/tool-a/manifest.json',
4266
- * iconPath: 'https://path.to/tool-a/icon.ico',
4267
- * iconIndex: 0
4268
- * },
4269
- * {
4270
- * type: 'task',
4271
- * title: 'Tool B',
4272
- * description: 'Runs Tool B',
4273
- * deepLink: 'fins://path.to/tool-b/manifest.json',
4274
- * iconPath: 'https://path.to/tool-b/icon.ico',
4275
- * iconIndex: 0
4276
- * }]
4277
- * }
4278
- * ];
4279
- *
4280
- * app.setJumpList(jumpListConfig).then(() => console.log('JumpList applied')).catch(e => console.log(`JumpList failed to apply: ${e.toString()}`));
4281
- * ```
4282
- *
4283
- * To handle deeplink args:
4284
- * ```js
4285
- * function handleUseLastConfiguration() {
4286
- * // this handler is called when the app is being launched
4287
- * app.on('run-requested', event => {
4288
- * if(event.userAppConfigArgs['use-last-configuration']) {
4289
- * // your logic here
4290
- * }
4291
- * });
4292
- * // this handler is called when the app was already running when the launch was requested
4293
- * fin.desktop.main(function(args) {
4294
- * if(args && args['use-last-configuration']) {
4295
- * // your logic here
4296
- * }
4297
- * });
4298
- * }
4299
- * ```
4300
- */
4301
- async setJumpList(jumpListCategories) {
4302
- await this.wire.sendAction('set-jump-list', { config: jumpListCategories, ...this.identity });
4303
- }
4304
- /**
4305
- * Adds a customizable icon in the system tray. To listen for a click on the icon use the `tray-icon-clicked` event.
4306
- * @param icon Image URL or base64 encoded string to be used as the icon
4307
- *
4308
- * @example
4309
- *
4310
- * ```js
4311
- * const imageUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
4312
- * const base64EncodedImage = "iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX\
4313
- * ///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII";
4314
- * const dataURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DH\
4315
- * xgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
4316
- *
4317
- * async function setTrayIcon(icon) {
4318
- * const app = await fin.Application.getCurrent();
4319
- * return await app.setTrayIcon(icon);
4320
- * }
4321
- *
4322
- * // use image url to set tray icon
4323
- * setTrayIcon(imageUrl).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
4324
- *
4325
- * // use base64 encoded string to set tray icon
4326
- * setTrayIcon(base64EncodedImage).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
4327
- *
4328
- * // use a dataURL to set tray icon
4329
- * setTrayIcon(dataURL).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
4330
- * ```
4331
- */
4332
- setTrayIcon(icon) {
4333
- return this.wire
4334
- .sendAction('set-tray-icon', {
4335
- enabledIcon: icon,
4336
- ...this.identity
4337
- })
4338
- .then(() => undefined);
4339
- }
4340
- /**
4341
- * Set hover text for this application's system tray icon.
4342
- * Note: Application must first set a tray icon with {@link Application.setTrayIcon}.
4343
- * @param toolTip
4344
- *
4345
- * @example
4346
- *
4347
- * ```js
4348
- * const app = fin.Application.getCurrentSync();
4349
- * const iconUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
4350
- *
4351
- * await app.setTrayIcon(iconUrl);
4352
- *
4353
- * await app.setTrayIconToolTip('My Application');
4354
- * ```
4355
- */
4356
- async setTrayIconToolTip(toolTip) {
4357
- await this.wire.sendAction('set-tray-icon-tooltip', { ...this.identity, toolTip });
4358
- }
4359
- /**
4360
- * Sets new application's shortcut configuration. Windows only.
4361
- * @param config New application's shortcut configuration.
4362
- *
4363
- * @remarks Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest
4364
- * to be able to change shortcut states.
4365
- *
4366
- * @example
4367
- *
4368
- * ```js
4369
- * async function setShortcuts(config) {
4370
- * const app = await fin.Application.getCurrent();
4371
- * return app.setShortcuts(config);
4372
- * }
4373
- *
4374
- * setShortcuts({
4375
- * desktop: true,
4376
- * startMenu: false,
4377
- * systemStartup: true
4378
- * }).then(() => console.log('Shortcuts are set.')).catch(err => console.log(err));
4379
- * ```
4380
- */
4381
- setShortcuts(config) {
4382
- return this.wire.sendAction('set-shortcuts', { data: config, ...this.identity }).then(() => undefined);
4383
- }
4384
- /**
4385
- * Sets the query string in all shortcuts for this app. Requires RVM 5.5+.
4386
- * @param queryString The new query string for this app's shortcuts.
4387
- *
4388
- * @example
4389
- *
4390
- * ```js
4391
- * const newQueryArgs = 'arg=true&arg2=false';
4392
- * const app = await fin.Application.getCurrent();
4393
- * try {
4394
- * await app.setShortcutQueryParams(newQueryArgs);
4395
- * } catch(err) {
4396
- * console.error(err)
4397
- * }
4398
- * ```
4399
- */
4400
- async setShortcutQueryParams(queryString) {
4401
- await this.wire.sendAction('set-shortcut-query-args', { data: queryString, ...this.identity });
4402
- }
4403
- /**
4404
- * Sets the zoom level of the application. The original size is 0 and each increment above or below represents zooming 20%
4405
- * larger or smaller to default limits of 300% and 50% of original size, respectively.
4406
- * @param level The zoom level
4407
- *
4408
- * @example
4409
- *
4410
- * ```js
4411
- * async function setZoomLevel(number) {
4412
- * const app = await fin.Application.getCurrent();
4413
- * return await app.setZoomLevel(number);
4414
- * }
4415
- *
4416
- * setZoomLevel(5).then(() => console.log('Setting a zoom level')).catch(err => console.log(err));
4417
- * ```
4418
- */
4419
- setZoomLevel(level) {
4420
- return this.wire.sendAction('set-application-zoom-level', { level, ...this.identity }).then(() => undefined);
4421
- }
4422
- /**
4423
- * Sets a username to correlate with App Log Management.
4424
- * @param username Username to correlate with App's Log.
4425
- *
4426
- * @example
4427
- *
4428
- * ```js
4429
- * async function setAppLogUser() {
4430
- * const app = await fin.Application.getCurrent();
4431
- * return await app.setAppLogUsername('username');
4432
- * }
4433
- *
4434
- * setAppLogUser().then(() => console.log('Success')).catch(err => console.log(err));
4435
- *
4436
- * ```
4437
- */
4438
- async setAppLogUsername(username) {
4439
- await this.wire.sendAction('set-app-log-username', { data: username, ...this.identity });
4440
- }
4441
- /**
4442
- * Retrieves information about the system tray. If the system tray is not set, it will throw an error message.
4443
- * @remarks The only information currently returned is the position and dimensions.
4444
- *
4445
- * @example
4446
- *
4447
- * ```js
4448
- * async function getTrayIconInfo() {
4449
- * const app = await fin.Application.wrap({ uuid: 'testapp' });
4450
- * return await app.getTrayIconInfo();
4451
- * }
4452
- * getTrayIconInfo().then(info => console.log(info)).catch(err => console.log(err));
4453
- * ```
4454
- */
4455
- getTrayIconInfo() {
4456
- return this.wire.sendAction('get-tray-icon-info', this.identity).then(({ payload }) => payload.data);
4457
- }
4458
- /**
4459
- * Checks if the application has an associated tray icon.
4460
- *
4461
- * @example
4462
- *
4463
- * ```js
4464
- * const app = await fin.Application.wrap({ uuid: 'testapp' });
4465
- * const hasTrayIcon = await app.hasTrayIcon();
4466
- * console.log(hasTrayIcon);
4467
- * ```
4468
- */
4469
- hasTrayIcon() {
4470
- return this.wire.sendAction('has-tray-icon', this.identity).then(({ payload }) => payload.data);
4471
- }
4472
- /**
4473
- * Closes the application by terminating its process.
4474
- *
4475
- * @example
4476
- *
4477
- * ```js
4478
- * async function terminateApp() {
4479
- * const app = await fin.Application.getCurrent();
4480
- * return await app.terminate();
4481
- * }
4482
- * terminateApp().then(() => console.log('Application terminated')).catch(err => console.log(err));
4483
- * ```
4484
- */
4485
- terminate() {
4486
- return this.wire.sendAction('terminate-application', this.identity).then(() => undefined);
4487
- }
4488
- /**
4489
- * Waits for a hanging application. This method can be called in response to an application
4490
- * "not-responding" to allow the application to continue and to generate another "not-responding"
4491
- * message after a certain period of time.
4492
- *
4493
- * @ignore
4494
- */
4495
- wait() {
4496
- return this.wire.sendAction('wait-for-hung-application', this.identity).then(() => undefined);
4497
- }
4498
- /**
4499
- * Retrieves information about the application.
4500
- *
4501
- * @remarks If the application was not launched from a manifest, the call will return the closest parent application `manifest`
4502
- * and `manifestUrl`. `initialOptions` shows the parameters used when launched programmatically, or the `startup_app` options
4503
- * if launched from manifest. The `parentUuid` will be the uuid of the immediate parent (if applicable).
4504
- *
4505
- * @example
4506
- *
4507
- * ```js
4508
- * async function getInfo() {
4509
- * const app = await fin.Application.getCurrent();
4510
- * return await app.getInfo();
4511
- * }
4512
- *
4513
- * getInfo().then(info => console.log(info)).catch(err => console.log(err));
4514
- * ```
4515
- */
4516
- getInfo() {
4517
- return this.wire.sendAction('get-info', this.identity).then(({ payload }) => payload.data);
4518
- }
4519
- /**
4520
- * Retrieves all process information for entities (windows and views) associated with an application.
4521
- *
4522
- * @example
4523
- * ```js
4524
- * const app = await fin.Application.getCurrent();
4525
- * const processInfo = await app.getProcessInfo();
4526
- * ```
4527
- * @experimental
4528
- */
4529
- async getProcessInfo() {
4530
- const { payload: { data } } = await this.wire.sendAction('application-get-process-info', this.identity);
4531
- return data;
4532
- }
4533
- /**
4534
- * Sets file auto download location. It's only allowed in the same application.
4535
- *
4536
- * Note: This method is restricted by default and must be enabled via
4537
- * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
4538
- * @param downloadLocation file auto download location
4539
- *
4540
- * @throws if setting file auto download location on different applications.
4541
- * @example
4542
- *
4543
- * ```js
4544
- * const downloadLocation = 'C:\\dev\\temp';
4545
- * const app = await fin.Application.getCurrent();
4546
- * try {
4547
- * await app.setFileDownloadLocation(downloadLocation);
4548
- * console.log('File download location is set');
4549
- * } catch(err) {
4550
- * console.error(err)
4551
- * }
4552
- * ```
4553
- */
4554
- async setFileDownloadLocation(downloadLocation) {
4555
- const { name } = this.wire.me;
4556
- const entityIdentity = { uuid: this.identity.uuid, name };
4557
- await this.wire.sendAction('set-file-download-location', { ...entityIdentity, downloadLocation });
4558
- }
4559
- /**
4560
- * 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.
4561
- *
4562
- * Note: This method is restricted by default and must be enabled via
4563
- * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
4564
- *
4565
- * @throws if getting file auto download location on different applications.
4566
- * @example
4567
- *
4568
- * ```js
4569
- * const app = await fin.Application.getCurrent();
4570
- * const fileDownloadDir = await app.getFileDownloadLocation();
4571
- * ```
4572
- */
4573
- async getFileDownloadLocation() {
4574
- const { payload: { data } } = await this.wire.sendAction('get-file-download-location', this.identity);
4575
- return data;
4576
- }
4577
- /**
4578
- * Shows a menu on the tray icon. Use with tray-icon-clicked event.
4579
- * @param options
4580
- * @typeParam Data User-defined shape for data returned upon menu item click. Should be a
4581
- * [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
4582
- * of all possible data shapes for the entire menu, and the click handler should process
4583
- * these with a "reducer" pattern.
4584
- * @throws if the application has no tray icon set
4585
- * @throws if the system tray is currently hidden
4586
- * @example
4587
- *
4588
- * ```js
4589
- * const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
4590
- * const app = fin.Application.getCurrentSync();
4591
- *
4592
- * await app.setTrayIcon(iconUrl);
4593
- *
4594
- * const template = [
4595
- * {
4596
- * label: 'Menu Item 1',
4597
- * data: 'hello from item 1'
4598
- * },
4599
- * { type: 'separator' },
4600
- * {
4601
- * label: 'Menu Item 2',
4602
- * type: 'checkbox',
4603
- * checked: true,
4604
- * data: 'The user clicked the checkbox'
4605
- * },
4606
- * {
4607
- * label: 'see more',
4608
- * enabled: false,
4609
- * submenu: [
4610
- * { label: 'submenu 1', data: 'hello from submenu' }
4611
- * ]
4612
- * }
4613
- * ];
4614
- *
4615
- * app.addListener('tray-icon-clicked', (event) => {
4616
- * // right-click
4617
- * if (event.button === 2) {
4618
- * app.showTrayIconPopupMenu({ template }).then(r => {
4619
- * if (r.result === 'closed') {
4620
- * console.log('nothing happened');
4621
- * } else {
4622
- * console.log(r.data);
4623
- * }
4624
- * });
4625
- * }
4626
- * });
4627
- * ```
4628
- */
4629
- async showTrayIconPopupMenu(options) {
4630
- const { name } = this.wire.me;
4631
- const entityIdentity = { uuid: this.identity.uuid, name };
4632
- const { payload } = await this.wire.sendAction('show-tray-icon-popup-menu', { ...entityIdentity, options });
4633
- return payload.data;
4634
- }
4635
- /**
4636
- * Closes the tray icon menu.
4637
- *
4638
- * @throws if the application has no tray icon set
4639
- * @example
4640
- *
4641
- * ```js
4642
- * const app = fin.Application.getCurrentSync();
4643
- *
4644
- * await app.closeTrayIconPopupMenu();
4645
- * ```
4646
- */
4647
- async closeTrayIconPopupMenu() {
4648
- const { name } = this.wire.me;
4649
- const entityIdentity = { uuid: this.identity.uuid, name };
4650
- await this.wire.sendAction('close-tray-icon-popup-menu', { ...entityIdentity });
4651
- }
4652
- }
4653
- Instance$5.Application = Application;
4654
- return Instance$5;
3825
+ Object.defineProperty(Instance$5, "__esModule", { value: true });
3826
+ Instance$5.Application = void 0;
3827
+ /* eslint-disable import/prefer-default-export */
3828
+ const base_1$n = base;
3829
+ const window_1$1 = requireWindow();
3830
+ const view_1 = requireView();
3831
+ /**
3832
+ * An object representing an application. Allows the developer to create,
3833
+ * execute, show/close an application as well as listen to {@link OpenFin.ApplicationEvents application events}.
3834
+ */
3835
+ class Application extends base_1$n.EmitterBase {
3836
+ /**
3837
+ * @internal
3838
+ */
3839
+ constructor(wire, identity) {
3840
+ super(wire, 'application', identity.uuid);
3841
+ this.identity = identity;
3842
+ this.window = new window_1$1._Window(this.wire, {
3843
+ uuid: this.identity.uuid,
3844
+ name: this.identity.uuid
3845
+ });
3846
+ }
3847
+ windowListFromIdentityList(identityList) {
3848
+ const windowList = [];
3849
+ identityList.forEach((identity) => {
3850
+ windowList.push(new window_1$1._Window(this.wire, {
3851
+ uuid: identity.uuid,
3852
+ name: identity.name
3853
+ }));
3854
+ });
3855
+ return windowList;
3856
+ }
3857
+ /**
3858
+ * Determines if the application is currently running.
3859
+ *
3860
+ * @example
3861
+ *
3862
+ * ```js
3863
+ * async function isAppRunning() {
3864
+ * const app = await fin.Application.getCurrent();
3865
+ * return await app.isRunning();
3866
+ * }
3867
+ * isAppRunning().then(running => console.log(`Current app is running: ${running}`)).catch(err => console.log(err));
3868
+ * ```
3869
+ */
3870
+ isRunning() {
3871
+ return this.wire.sendAction('is-application-running', this.identity).then(({ payload }) => payload.data);
3872
+ }
3873
+ /**
3874
+ * Closes the application and any child windows created by the application.
3875
+ * Cleans the application from state so it is no longer found in getAllApplications.
3876
+ * @param force Close will be prevented from closing when force is false and
3877
+ * ‘close-requested’ has been subscribed to for application’s main window.
3878
+ *
3879
+ * @example
3880
+ *
3881
+ * ```js
3882
+ * async function closeApp() {
3883
+ * const allApps1 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}, {uuid: 'app2', isRunning: true}]
3884
+ * const app = await fin.Application.wrap({uuid: 'app2'});
3885
+ * await app.quit();
3886
+ * const allApps2 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}]
3887
+ *
3888
+ * }
3889
+ * closeApp().then(() => console.log('Application quit')).catch(err => console.log(err));
3890
+ * ```
3891
+ */
3892
+ async quit(force = false) {
3893
+ try {
3894
+ await this._close(force);
3895
+ await this.wire.sendAction('destroy-application', { force, ...this.identity });
3896
+ }
3897
+ catch (error) {
3898
+ const acceptableErrors = ['Remote connection has closed', 'Could not locate the requested application'];
3899
+ if (!acceptableErrors.some((msg) => error.message.includes(msg))) {
3900
+ throw error;
3901
+ }
3902
+ }
3903
+ }
3904
+ async _close(force = false) {
3905
+ try {
3906
+ await this.wire.sendAction('close-application', { force, ...this.identity });
3907
+ }
3908
+ catch (error) {
3909
+ if (!error.message.includes('Remote connection has closed')) {
3910
+ throw error;
3911
+ }
3912
+ }
3913
+ }
3914
+ /**
3915
+ * @deprecated use Application.quit instead
3916
+ * Closes the application and any child windows created by the application.
3917
+ * @param force - Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for application’s main window.
3918
+ * @param callback - called if the method succeeds.
3919
+ * @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
3920
+ *
3921
+ * @example
3922
+ *
3923
+ * ```js
3924
+ * async function closeApp() {
3925
+ * const app = await fin.Application.getCurrent();
3926
+ * return await app.close();
3927
+ * }
3928
+ * closeApp().then(() => console.log('Application closed')).catch(err => console.log(err));
3929
+ * ```
3930
+ */
3931
+ close(force = false) {
3932
+ console.warn('Deprecation Warning: Application.close is deprecated Please use Application.quit');
3933
+ this.wire.sendAction('application-close', this.identity).catch((e) => {
3934
+ // we do not want to expose this error, just continue if this analytics-only call fails
3935
+ });
3936
+ return this._close(force);
3937
+ }
3938
+ /**
3939
+ * Retrieves an array of wrapped fin.Windows for each of the application’s child windows.
3940
+ *
3941
+ * @example
3942
+ *
3943
+ * ```js
3944
+ * async function getChildWindows() {
3945
+ * const app = await fin.Application.getCurrent();
3946
+ * return await app.getChildWindows();
3947
+ * }
3948
+ *
3949
+ * getChildWindows().then(children => console.log(children)).catch(err => console.log(err));
3950
+ * ```
3951
+ */
3952
+ getChildWindows() {
3953
+ return this.wire.sendAction('get-child-windows', this.identity).then(({ payload }) => {
3954
+ const identityList = [];
3955
+ payload.data.forEach((winName) => {
3956
+ identityList.push({ uuid: this.identity.uuid, name: winName });
3957
+ });
3958
+ return this.windowListFromIdentityList(identityList);
3959
+ });
3960
+ }
3961
+ /**
3962
+ * Retrieves the JSON manifest that was used to create the application. Invokes the error callback
3963
+ * if the application was not created from a manifest.
3964
+ *
3965
+ * @example
3966
+ *
3967
+ * ```js
3968
+ * async function getManifest() {
3969
+ * const app = await fin.Application.getCurrent();
3970
+ * return await app.getManifest();
3971
+ * }
3972
+ *
3973
+ * getManifest().then(manifest => console.log(manifest)).catch(err => console.log(err));
3974
+ * ```
3975
+ */
3976
+ getManifest() {
3977
+ return this.wire.sendAction('get-application-manifest', this.identity).then(({ payload }) => payload.data);
3978
+ }
3979
+ /**
3980
+ * Retrieves UUID of the application that launches this application. Invokes the error callback
3981
+ * if the application was created from a manifest.
3982
+ *
3983
+ * @example
3984
+ *
3985
+ * ```js
3986
+ * async function getParentUuid() {
3987
+ * const app = await fin.Application.start({
3988
+ * uuid: 'app-1',
3989
+ * name: 'myApp',
3990
+ * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getParentUuid.html',
3991
+ * autoShow: true
3992
+ * });
3993
+ * return await app.getParentUuid();
3994
+ * }
3995
+ *
3996
+ * getParentUuid().then(parentUuid => console.log(parentUuid)).catch(err => console.log(err));
3997
+ * ```
3998
+ */
3999
+ getParentUuid() {
4000
+ return this.wire.sendAction('get-parent-application', this.identity).then(({ payload }) => payload.data);
4001
+ }
4002
+ /**
4003
+ * Retrieves current application's shortcut configuration.
4004
+ *
4005
+ * @example
4006
+ *
4007
+ * ```js
4008
+ * async function getShortcuts() {
4009
+ * const app = await fin.Application.wrap({ uuid: 'testapp' });
4010
+ * return await app.getShortcuts();
4011
+ * }
4012
+ * getShortcuts().then(config => console.log(config)).catch(err => console.log(err));
4013
+ * ```
4014
+ */
4015
+ getShortcuts() {
4016
+ return this.wire.sendAction('get-shortcuts', this.identity).then(({ payload }) => payload.data);
4017
+ }
4018
+ /**
4019
+ * Retrieves current application's views.
4020
+ * @experimental
4021
+ *
4022
+ * @example
4023
+ *
4024
+ * ```js
4025
+ * async function getViews() {
4026
+ * const app = await fin.Application.getCurrent();
4027
+ * return await app.getViews();
4028
+ * }
4029
+ * getViews().then(views => console.log(views)).catch(err => console.log(err));
4030
+ * ```
4031
+ */
4032
+ async getViews() {
4033
+ const { payload } = await this.wire.sendAction('application-get-views', this.identity);
4034
+ return payload.data.map((id) => new view_1.View(this.wire, id));
4035
+ }
4036
+ /**
4037
+ * Returns the current zoom level of the application.
4038
+ *
4039
+ * @example
4040
+ *
4041
+ * ```js
4042
+ * async function getZoomLevel() {
4043
+ * const app = await fin.Application.getCurrent();
4044
+ * return await app.getZoomLevel();
4045
+ * }
4046
+ *
4047
+ * getZoomLevel().then(zoomLevel => console.log(zoomLevel)).catch(err => console.log(err));
4048
+ * ```
4049
+ */
4050
+ getZoomLevel() {
4051
+ return this.wire.sendAction('get-application-zoom-level', this.identity).then(({ payload }) => payload.data);
4052
+ }
4053
+ /**
4054
+ * Returns an instance of the main Window of the application
4055
+ *
4056
+ * @example
4057
+ *
4058
+ * ```js
4059
+ * async function getWindow() {
4060
+ * const app = await fin.Application.start({
4061
+ * uuid: 'app-1',
4062
+ * name: 'myApp',
4063
+ * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getWindow.html',
4064
+ * autoShow: true
4065
+ * });
4066
+ * return await app.getWindow();
4067
+ * }
4068
+ *
4069
+ * getWindow().then(win => {
4070
+ * win.showAt(0, 400);
4071
+ * win.flash();
4072
+ * }).catch(err => console.log(err));
4073
+ * ```
4074
+ */
4075
+ getWindow() {
4076
+ this.wire.sendAction('application-get-window', this.identity).catch((e) => {
4077
+ // we do not want to expose this error, just continue if this analytics-only call fails
4078
+ });
4079
+ return Promise.resolve(this.window);
4080
+ }
4081
+ /**
4082
+ * Manually registers a user with the licensing service. The only data sent by this call is userName and appName.
4083
+ * @param userName - username to be passed to the RVM.
4084
+ * @param appName - app name to be passed to the RVM.
4085
+ *
4086
+ * @example
4087
+ *
4088
+ * ```js
4089
+ * async function registerUser() {
4090
+ * const app = await fin.Application.getCurrent();
4091
+ * return await app.registerUser('user', 'myApp');
4092
+ * }
4093
+ *
4094
+ * registerUser().then(() => console.log('Successfully registered the user')).catch(err => console.log(err));
4095
+ * ```
4096
+ */
4097
+ registerUser(userName, appName) {
4098
+ return this.wire.sendAction('register-user', { userName, appName, ...this.identity }).then(() => undefined);
4099
+ }
4100
+ /**
4101
+ * Removes the application’s icon from the tray.
4102
+ *
4103
+ * @example
4104
+ *
4105
+ * ```js
4106
+ * async function removeTrayIcon() {
4107
+ * const app = await fin.Application.getCurrent();
4108
+ * return await app.removeTrayIcon();
4109
+ * }
4110
+ *
4111
+ * removeTrayIcon().then(() => console.log('Removed the tray icon.')).catch(err => console.log(err));
4112
+ * ```
4113
+ */
4114
+ removeTrayIcon() {
4115
+ return this.wire.sendAction('remove-tray-icon', this.identity).then(() => undefined);
4116
+ }
4117
+ /**
4118
+ * Restarts the application.
4119
+ *
4120
+ * @example
4121
+ *
4122
+ * ```js
4123
+ * async function restartApp() {
4124
+ * const app = await fin.Application.getCurrent();
4125
+ * return await app.restart();
4126
+ * }
4127
+ * restartApp().then(() => console.log('Application restarted')).catch(err => console.log(err));
4128
+ * ```
4129
+ */
4130
+ restart() {
4131
+ return this.wire.sendAction('restart-application', this.identity).then(() => undefined);
4132
+ }
4133
+ /**
4134
+ * DEPRECATED method to run the application.
4135
+ * Needed when starting application via {@link Application.create}, but NOT needed when starting via {@link Application.start}.
4136
+ *
4137
+ * @example
4138
+ *
4139
+ * ```js
4140
+ * async function run() {
4141
+ * const app = await fin.Application.create({
4142
+ * name: 'myApp',
4143
+ * uuid: 'app-1',
4144
+ * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.run.html',
4145
+ * autoShow: true
4146
+ * });
4147
+ * await app.run();
4148
+ * }
4149
+ * run().then(() => console.log('Application is running')).catch(err => console.log(err));
4150
+ * ```
4151
+ *
4152
+ * @ignore
4153
+ */
4154
+ run() {
4155
+ console.warn('Deprecation Warning: Application.run is deprecated Please use fin.Application.start');
4156
+ this.wire.sendAction('application-run', this.identity).catch((e) => {
4157
+ // we do not want to expose this error, just continue if this analytics-only call fails
4158
+ });
4159
+ return this._run();
4160
+ }
4161
+ _run(opts = {}) {
4162
+ return this.wire
4163
+ .sendAction('run-application', {
4164
+ manifestUrl: this._manifestUrl,
4165
+ opts,
4166
+ ...this.identity
4167
+ })
4168
+ .then(() => undefined);
4169
+ }
4170
+ /**
4171
+ * Instructs the RVM to schedule one restart of the application.
4172
+ *
4173
+ * @example
4174
+ *
4175
+ * ```js
4176
+ * async function scheduleRestart() {
4177
+ * const app = await fin.Application.getCurrent();
4178
+ * return await app.scheduleRestart();
4179
+ * }
4180
+ *
4181
+ * scheduleRestart().then(() => console.log('Application is scheduled to restart')).catch(err => console.log(err));
4182
+ * ```
4183
+ */
4184
+ scheduleRestart() {
4185
+ return this.wire.sendAction('relaunch-on-close', this.identity).then(() => undefined);
4186
+ }
4187
+ /**
4188
+ * Sends a message to the RVM to upload the application's logs. On success,
4189
+ * an object containing logId is returned.
4190
+ *
4191
+ * @example
4192
+ *
4193
+ * ```js
4194
+ * async function sendLog() {
4195
+ * const app = await fin.Application.getCurrent();
4196
+ * return await app.sendApplicationLog();
4197
+ * }
4198
+ *
4199
+ * sendLog().then(info => console.log(info.logId)).catch(err => console.log(err));
4200
+ * ```
4201
+ */
4202
+ async sendApplicationLog() {
4203
+ const { payload } = await this.wire.sendAction('send-application-log', this.identity);
4204
+ return payload.data;
4205
+ }
4206
+ /**
4207
+ * Sets or removes a custom JumpList for the application. Only applicable in Windows OS.
4208
+ * If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
4209
+ *
4210
+ * Note: If the "name" property is omitted it defaults to "tasks".
4211
+ * @param jumpListCategories An array of JumpList Categories to populate. If null, remove any existing JumpList configuration and set to Windows default.
4212
+ *
4213
+ *
4214
+ * @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).
4215
+ *
4216
+ * The bottommost item in the jumplist will always be an item pointing to the current app. Its name is taken from the manifest's
4217
+ * **` shortcut.name `** and uses **` shortcut.company `** as a fallback. Clicking that item will launch the app from its current manifest.
4218
+ *
4219
+ * Note: If the "name" property is omitted it defaults to "tasks".
4220
+ *
4221
+ * Note: Window OS caches jumplists icons, therefore an icon change might only be visible after the cache is removed or the
4222
+ * uuid or shortcut.name is changed.
4223
+ *
4224
+ * @example
4225
+ *
4226
+ * ```js
4227
+ * const app = fin.Application.getCurrentSync();
4228
+ * const appName = 'My App';
4229
+ * const jumpListConfig = [ // array of JumpList categories
4230
+ * {
4231
+ * // has no name and no type so `type` is assumed to be "tasks"
4232
+ * items: [ // array of JumpList items
4233
+ * {
4234
+ * type: 'task',
4235
+ * title: `Launch ${appName}`,
4236
+ * description: `Runs ${appName} with the default configuration`,
4237
+ * deepLink: 'fins://path.to/app/manifest.json',
4238
+ * iconPath: 'https://path.to/app/icon.ico',
4239
+ * iconIndex: 0
4240
+ * },
4241
+ * { type: 'separator' },
4242
+ * {
4243
+ * type: 'task',
4244
+ * title: `Restore ${appName}`,
4245
+ * description: 'Restore to last configuration',
4246
+ * deepLink: 'fins://path.to/app/manifest.json?$$use-last-configuration=true',
4247
+ * iconPath: 'https://path.to/app/icon.ico',
4248
+ * iconIndex: 0
4249
+ * },
4250
+ * ]
4251
+ * },
4252
+ * {
4253
+ * name: 'Tools',
4254
+ * items: [ // array of JumpList items
4255
+ * {
4256
+ * type: 'task',
4257
+ * title: 'Tool A',
4258
+ * description: 'Runs Tool A',
4259
+ * deepLink: 'fins://path.to/tool-a/manifest.json',
4260
+ * iconPath: 'https://path.to/tool-a/icon.ico',
4261
+ * iconIndex: 0
4262
+ * },
4263
+ * {
4264
+ * type: 'task',
4265
+ * title: 'Tool B',
4266
+ * description: 'Runs Tool B',
4267
+ * deepLink: 'fins://path.to/tool-b/manifest.json',
4268
+ * iconPath: 'https://path.to/tool-b/icon.ico',
4269
+ * iconIndex: 0
4270
+ * }]
4271
+ * }
4272
+ * ];
4273
+ *
4274
+ * app.setJumpList(jumpListConfig).then(() => console.log('JumpList applied')).catch(e => console.log(`JumpList failed to apply: ${e.toString()}`));
4275
+ * ```
4276
+ *
4277
+ * To handle deeplink args:
4278
+ * ```js
4279
+ * function handleUseLastConfiguration() {
4280
+ * // this handler is called when the app is being launched
4281
+ * app.on('run-requested', event => {
4282
+ * if(event.userAppConfigArgs['use-last-configuration']) {
4283
+ * // your logic here
4284
+ * }
4285
+ * });
4286
+ * // this handler is called when the app was already running when the launch was requested
4287
+ * fin.desktop.main(function(args) {
4288
+ * if(args && args['use-last-configuration']) {
4289
+ * // your logic here
4290
+ * }
4291
+ * });
4292
+ * }
4293
+ * ```
4294
+ */
4295
+ async setJumpList(jumpListCategories) {
4296
+ await this.wire.sendAction('set-jump-list', { config: jumpListCategories, ...this.identity });
4297
+ }
4298
+ /**
4299
+ * Adds a customizable icon in the system tray. To listen for a click on the icon use the `tray-icon-clicked` event.
4300
+ * @param icon Image URL or base64 encoded string to be used as the icon
4301
+ *
4302
+ * @example
4303
+ *
4304
+ * ```js
4305
+ * const imageUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
4306
+ * const base64EncodedImage = "iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX\
4307
+ * ///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII";
4308
+ * const dataURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DH\
4309
+ * xgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
4310
+ *
4311
+ * async function setTrayIcon(icon) {
4312
+ * const app = await fin.Application.getCurrent();
4313
+ * return await app.setTrayIcon(icon);
4314
+ * }
4315
+ *
4316
+ * // use image url to set tray icon
4317
+ * setTrayIcon(imageUrl).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
4318
+ *
4319
+ * // use base64 encoded string to set tray icon
4320
+ * setTrayIcon(base64EncodedImage).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
4321
+ *
4322
+ * // use a dataURL to set tray icon
4323
+ * setTrayIcon(dataURL).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
4324
+ * ```
4325
+ */
4326
+ setTrayIcon(icon) {
4327
+ return this.wire
4328
+ .sendAction('set-tray-icon', {
4329
+ enabledIcon: icon,
4330
+ ...this.identity
4331
+ })
4332
+ .then(() => undefined);
4333
+ }
4334
+ /**
4335
+ * Set hover text for this application's system tray icon.
4336
+ * Note: Application must first set a tray icon with {@link Application.setTrayIcon}.
4337
+ * @param toolTip
4338
+ *
4339
+ * @example
4340
+ *
4341
+ * ```js
4342
+ * const app = fin.Application.getCurrentSync();
4343
+ * const iconUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
4344
+ *
4345
+ * await app.setTrayIcon(iconUrl);
4346
+ *
4347
+ * await app.setTrayIconToolTip('My Application');
4348
+ * ```
4349
+ */
4350
+ async setTrayIconToolTip(toolTip) {
4351
+ await this.wire.sendAction('set-tray-icon-tooltip', { ...this.identity, toolTip });
4352
+ }
4353
+ /**
4354
+ * Sets new application's shortcut configuration. Windows only.
4355
+ * @param config New application's shortcut configuration.
4356
+ *
4357
+ * @remarks Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest
4358
+ * to be able to change shortcut states.
4359
+ *
4360
+ * @example
4361
+ *
4362
+ * ```js
4363
+ * async function setShortcuts(config) {
4364
+ * const app = await fin.Application.getCurrent();
4365
+ * return app.setShortcuts(config);
4366
+ * }
4367
+ *
4368
+ * setShortcuts({
4369
+ * desktop: true,
4370
+ * startMenu: false,
4371
+ * systemStartup: true
4372
+ * }).then(() => console.log('Shortcuts are set.')).catch(err => console.log(err));
4373
+ * ```
4374
+ */
4375
+ setShortcuts(config) {
4376
+ return this.wire.sendAction('set-shortcuts', { data: config, ...this.identity }).then(() => undefined);
4377
+ }
4378
+ /**
4379
+ * Sets the query string in all shortcuts for this app. Requires RVM 5.5+.
4380
+ * @param queryString The new query string for this app's shortcuts.
4381
+ *
4382
+ * @example
4383
+ *
4384
+ * ```js
4385
+ * const newQueryArgs = 'arg=true&arg2=false';
4386
+ * const app = await fin.Application.getCurrent();
4387
+ * try {
4388
+ * await app.setShortcutQueryParams(newQueryArgs);
4389
+ * } catch(err) {
4390
+ * console.error(err)
4391
+ * }
4392
+ * ```
4393
+ */
4394
+ async setShortcutQueryParams(queryString) {
4395
+ await this.wire.sendAction('set-shortcut-query-args', { data: queryString, ...this.identity });
4396
+ }
4397
+ /**
4398
+ * Sets the zoom level of the application. The original size is 0 and each increment above or below represents zooming 20%
4399
+ * larger or smaller to default limits of 300% and 50% of original size, respectively.
4400
+ * @param level The zoom level
4401
+ *
4402
+ * @example
4403
+ *
4404
+ * ```js
4405
+ * async function setZoomLevel(number) {
4406
+ * const app = await fin.Application.getCurrent();
4407
+ * return await app.setZoomLevel(number);
4408
+ * }
4409
+ *
4410
+ * setZoomLevel(5).then(() => console.log('Setting a zoom level')).catch(err => console.log(err));
4411
+ * ```
4412
+ */
4413
+ setZoomLevel(level) {
4414
+ return this.wire.sendAction('set-application-zoom-level', { level, ...this.identity }).then(() => undefined);
4415
+ }
4416
+ /**
4417
+ * Sets a username to correlate with App Log Management.
4418
+ * @param username Username to correlate with App's Log.
4419
+ *
4420
+ * @example
4421
+ *
4422
+ * ```js
4423
+ * async function setAppLogUser() {
4424
+ * const app = await fin.Application.getCurrent();
4425
+ * return await app.setAppLogUsername('username');
4426
+ * }
4427
+ *
4428
+ * setAppLogUser().then(() => console.log('Success')).catch(err => console.log(err));
4429
+ *
4430
+ * ```
4431
+ */
4432
+ async setAppLogUsername(username) {
4433
+ await this.wire.sendAction('set-app-log-username', { data: username, ...this.identity });
4434
+ }
4435
+ /**
4436
+ * Retrieves information about the system tray. If the system tray is not set, it will throw an error message.
4437
+ * @remarks The only information currently returned is the position and dimensions.
4438
+ *
4439
+ * @example
4440
+ *
4441
+ * ```js
4442
+ * async function getTrayIconInfo() {
4443
+ * const app = await fin.Application.wrap({ uuid: 'testapp' });
4444
+ * return await app.getTrayIconInfo();
4445
+ * }
4446
+ * getTrayIconInfo().then(info => console.log(info)).catch(err => console.log(err));
4447
+ * ```
4448
+ */
4449
+ getTrayIconInfo() {
4450
+ return this.wire.sendAction('get-tray-icon-info', this.identity).then(({ payload }) => payload.data);
4451
+ }
4452
+ /**
4453
+ * Checks if the application has an associated tray icon.
4454
+ *
4455
+ * @example
4456
+ *
4457
+ * ```js
4458
+ * const app = await fin.Application.wrap({ uuid: 'testapp' });
4459
+ * const hasTrayIcon = await app.hasTrayIcon();
4460
+ * console.log(hasTrayIcon);
4461
+ * ```
4462
+ */
4463
+ hasTrayIcon() {
4464
+ return this.wire.sendAction('has-tray-icon', this.identity).then(({ payload }) => payload.data);
4465
+ }
4466
+ /**
4467
+ * Closes the application by terminating its process.
4468
+ *
4469
+ * @example
4470
+ *
4471
+ * ```js
4472
+ * async function terminateApp() {
4473
+ * const app = await fin.Application.getCurrent();
4474
+ * return await app.terminate();
4475
+ * }
4476
+ * terminateApp().then(() => console.log('Application terminated')).catch(err => console.log(err));
4477
+ * ```
4478
+ */
4479
+ terminate() {
4480
+ return this.wire.sendAction('terminate-application', this.identity).then(() => undefined);
4481
+ }
4482
+ /**
4483
+ * Waits for a hanging application. This method can be called in response to an application
4484
+ * "not-responding" to allow the application to continue and to generate another "not-responding"
4485
+ * message after a certain period of time.
4486
+ *
4487
+ * @ignore
4488
+ */
4489
+ wait() {
4490
+ return this.wire.sendAction('wait-for-hung-application', this.identity).then(() => undefined);
4491
+ }
4492
+ /**
4493
+ * Retrieves information about the application.
4494
+ *
4495
+ * @remarks If the application was not launched from a manifest, the call will return the closest parent application `manifest`
4496
+ * and `manifestUrl`. `initialOptions` shows the parameters used when launched programmatically, or the `startup_app` options
4497
+ * if launched from manifest. The `parentUuid` will be the uuid of the immediate parent (if applicable).
4498
+ *
4499
+ * @example
4500
+ *
4501
+ * ```js
4502
+ * async function getInfo() {
4503
+ * const app = await fin.Application.getCurrent();
4504
+ * return await app.getInfo();
4505
+ * }
4506
+ *
4507
+ * getInfo().then(info => console.log(info)).catch(err => console.log(err));
4508
+ * ```
4509
+ */
4510
+ getInfo() {
4511
+ return this.wire.sendAction('get-info', this.identity).then(({ payload }) => payload.data);
4512
+ }
4513
+ /**
4514
+ * Retrieves all process information for entities (windows and views) associated with an application.
4515
+ *
4516
+ * @example
4517
+ * ```js
4518
+ * const app = await fin.Application.getCurrent();
4519
+ * const processInfo = await app.getProcessInfo();
4520
+ * ```
4521
+ * @experimental
4522
+ */
4523
+ async getProcessInfo() {
4524
+ const { payload: { data } } = await this.wire.sendAction('application-get-process-info', this.identity);
4525
+ return data;
4526
+ }
4527
+ /**
4528
+ * Sets file auto download location. It's only allowed in the same application.
4529
+ *
4530
+ * Note: This method is restricted by default and must be enabled via
4531
+ * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
4532
+ * @param downloadLocation file auto download location
4533
+ *
4534
+ * @throws if setting file auto download location on different applications.
4535
+ * @example
4536
+ *
4537
+ * ```js
4538
+ * const downloadLocation = 'C:\\dev\\temp';
4539
+ * const app = await fin.Application.getCurrent();
4540
+ * try {
4541
+ * await app.setFileDownloadLocation(downloadLocation);
4542
+ * console.log('File download location is set');
4543
+ * } catch(err) {
4544
+ * console.error(err)
4545
+ * }
4546
+ * ```
4547
+ */
4548
+ async setFileDownloadLocation(downloadLocation) {
4549
+ const { name } = this.wire.me;
4550
+ const entityIdentity = { uuid: this.identity.uuid, name };
4551
+ await this.wire.sendAction('set-file-download-location', { ...entityIdentity, downloadLocation });
4552
+ }
4553
+ /**
4554
+ * 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.
4555
+ *
4556
+ * Note: This method is restricted by default and must be enabled via
4557
+ * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
4558
+ *
4559
+ * @throws if getting file auto download location on different applications.
4560
+ * @example
4561
+ *
4562
+ * ```js
4563
+ * const app = await fin.Application.getCurrent();
4564
+ * const fileDownloadDir = await app.getFileDownloadLocation();
4565
+ * ```
4566
+ */
4567
+ async getFileDownloadLocation() {
4568
+ const { payload: { data } } = await this.wire.sendAction('get-file-download-location', this.identity);
4569
+ return data;
4570
+ }
4571
+ /**
4572
+ * Shows a menu on the tray icon. Use with tray-icon-clicked event.
4573
+ * @param options
4574
+ * @typeParam Data User-defined shape for data returned upon menu item click. Should be a
4575
+ * [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
4576
+ * of all possible data shapes for the entire menu, and the click handler should process
4577
+ * these with a "reducer" pattern.
4578
+ * @throws if the application has no tray icon set
4579
+ * @throws if the system tray is currently hidden
4580
+ * @example
4581
+ *
4582
+ * ```js
4583
+ * const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
4584
+ * const app = fin.Application.getCurrentSync();
4585
+ *
4586
+ * await app.setTrayIcon(iconUrl);
4587
+ *
4588
+ * const template = [
4589
+ * {
4590
+ * label: 'Menu Item 1',
4591
+ * data: 'hello from item 1'
4592
+ * },
4593
+ * { type: 'separator' },
4594
+ * {
4595
+ * label: 'Menu Item 2',
4596
+ * type: 'checkbox',
4597
+ * checked: true,
4598
+ * data: 'The user clicked the checkbox'
4599
+ * },
4600
+ * {
4601
+ * label: 'see more',
4602
+ * enabled: false,
4603
+ * submenu: [
4604
+ * { label: 'submenu 1', data: 'hello from submenu' }
4605
+ * ]
4606
+ * }
4607
+ * ];
4608
+ *
4609
+ * app.addListener('tray-icon-clicked', (event) => {
4610
+ * // right-click
4611
+ * if (event.button === 2) {
4612
+ * app.showTrayIconPopupMenu({ template }).then(r => {
4613
+ * if (r.result === 'closed') {
4614
+ * console.log('nothing happened');
4615
+ * } else {
4616
+ * console.log(r.data);
4617
+ * }
4618
+ * });
4619
+ * }
4620
+ * });
4621
+ * ```
4622
+ */
4623
+ async showTrayIconPopupMenu(options) {
4624
+ const { name } = this.wire.me;
4625
+ const entityIdentity = { uuid: this.identity.uuid, name };
4626
+ const { payload } = await this.wire.sendAction('show-tray-icon-popup-menu', { ...entityIdentity, options });
4627
+ return payload.data;
4628
+ }
4629
+ /**
4630
+ * Closes the tray icon menu.
4631
+ *
4632
+ * @throws if the application has no tray icon set
4633
+ * @example
4634
+ *
4635
+ * ```js
4636
+ * const app = fin.Application.getCurrentSync();
4637
+ *
4638
+ * await app.closeTrayIconPopupMenu();
4639
+ * ```
4640
+ */
4641
+ async closeTrayIconPopupMenu() {
4642
+ const { name } = this.wire.me;
4643
+ const entityIdentity = { uuid: this.identity.uuid, name };
4644
+ await this.wire.sendAction('close-tray-icon-popup-menu', { ...entityIdentity });
4645
+ }
4646
+ }
4647
+ Instance$5.Application = Application;
4648
+
4649
+ Object.defineProperty(Factory$6, "__esModule", { value: true });
4650
+ Factory$6.ApplicationModule = void 0;
4651
+ const base_1$m = base;
4652
+ const validate_1$4 = validate;
4653
+ const Instance_1$5 = Instance$5;
4654
+ /**
4655
+ * Static namespace for OpenFin API methods that interact with the {@link Application} class, available under `fin.Application`.
4656
+ */
4657
+ class ApplicationModule extends base_1$m.Base {
4658
+ /**
4659
+ * Asynchronously returns an API handle for the given Application identity.
4660
+ *
4661
+ * @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
4662
+ * returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
4663
+ * for an Application throughout its entire lifecycle.
4664
+ *
4665
+ * @example
4666
+ *
4667
+ * ```js
4668
+ * fin.Application.wrap({ uuid: 'testapp' })
4669
+ * .then(app => app.isRunning())
4670
+ * .then(running => console.log('Application is running: ' + running))
4671
+ * .catch(err => console.log(err));
4672
+ * ```
4673
+ *
4674
+ */
4675
+ async wrap(identity) {
4676
+ this.wire.sendAction('wrap-application').catch((e) => {
4677
+ // we do not want to expose this error, just continue if this analytics-only call fails
4678
+ });
4679
+ const errorMsg = (0, validate_1$4.validateIdentity)(identity);
4680
+ if (errorMsg) {
4681
+ throw new Error(errorMsg);
4682
+ }
4683
+ return new Instance_1$5.Application(this.wire, identity);
4684
+ }
4685
+ /**
4686
+ * Synchronously returns an API handle for the given Application identity.
4687
+ *
4688
+ * @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
4689
+ * returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
4690
+ * for an Aplication throughout its entire lifecycle.
4691
+ *
4692
+ * @example
4693
+ *
4694
+ * ```js
4695
+ * const app = fin.Application.wrapSync({ uuid: 'testapp' });
4696
+ * await app.close();
4697
+ * ```
4698
+ *
4699
+ */
4700
+ wrapSync(identity) {
4701
+ this.wire.sendAction('wrap-application-sync').catch((e) => {
4702
+ // we do not want to expose this error, just continue if this analytics-only call fails
4703
+ });
4704
+ const errorMsg = (0, validate_1$4.validateIdentity)(identity);
4705
+ if (errorMsg) {
4706
+ throw new Error(errorMsg);
4707
+ }
4708
+ return new Instance_1$5.Application(this.wire, identity);
4709
+ }
4710
+ async _create(appOptions) {
4711
+ // set defaults:
4712
+ if (appOptions.waitForPageLoad === undefined) {
4713
+ appOptions.waitForPageLoad = false;
4714
+ }
4715
+ if (appOptions.autoShow === undefined && appOptions.isPlatformController === undefined) {
4716
+ appOptions.autoShow = true;
4717
+ }
4718
+ await this.wire.sendAction('create-application', appOptions);
4719
+ return this.wrap({ uuid: appOptions.uuid });
4720
+ }
4721
+ /**
4722
+ * DEPRECATED method to create a new Application. Use {@link Application.ApplicationModule.start Application.start} instead.
4723
+ *
4724
+ * @example
4725
+ *
4726
+ * ```js
4727
+ * async function createApp() {
4728
+ * const app = await fin.Application.create({
4729
+ * name: 'myApp',
4730
+ * uuid: 'app-3',
4731
+ * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.create.html',
4732
+ * autoShow: true
4733
+ * });
4734
+ * await app.run();
4735
+ * }
4736
+ *
4737
+ * createApp().then(() => console.log('Application is created')).catch(err => console.log(err));
4738
+ * ```
4739
+ *
4740
+ * @ignore
4741
+ */
4742
+ create(appOptions) {
4743
+ console.warn('Deprecation Warning: fin.Application.create is deprecated. Please use fin.Application.start');
4744
+ this.wire.sendAction('application-create').catch((e) => {
4745
+ // we do not want to expose this error, just continue if this analytics-only call fails
4746
+ });
4747
+ return this._create(appOptions);
4748
+ }
4749
+ /**
4750
+ * Creates and starts a new Application.
4751
+ *
4752
+ * @example
4753
+ *
4754
+ * ```js
4755
+ * async function start() {
4756
+ * return fin.Application.start({
4757
+ * name: 'app-1',
4758
+ * uuid: 'app-1',
4759
+ * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.start.html',
4760
+ * autoShow: true
4761
+ * });
4762
+ * }
4763
+ * start().then(() => console.log('Application is running')).catch(err => console.log(err));
4764
+ * ```
4765
+ *
4766
+ */
4767
+ async start(appOptions) {
4768
+ this.wire.sendAction('start-application').catch((e) => {
4769
+ // we do not want to expose this error, just continue if this analytics-only call fails
4770
+ });
4771
+ const app = await this._create(appOptions);
4772
+ await this.wire.sendAction('run-application', { uuid: appOptions.uuid });
4773
+ return app;
4774
+ }
4775
+ /**
4776
+ * Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls.
4777
+ * Returns once the RVM is finished attempting to launch the applications.
4778
+ * @param opts - Parameters that the RVM will use.
4779
+ *
4780
+ * @example
4781
+ *
4782
+ * ```js
4783
+ *
4784
+ * const applicationInfoArray = [
4785
+ * {
4786
+ * "uuid": 'App-1',
4787
+ * "manifestUrl": 'http://localhost:5555/app1.json',
4788
+ * },
4789
+ * {
4790
+ * "uuid": 'App-2',
4791
+ * "manifestUrl": 'http://localhost:5555/app2.json',
4792
+ * },
4793
+ * {
4794
+ * "uuid": 'App-3',
4795
+ * "manifestUrl": 'http://localhost:5555/app3.json',
4796
+ * }
4797
+ * ]
4798
+ *
4799
+ * fin.Application.startManyManifests(applicationInfoArray)
4800
+ * .then(() => {
4801
+ * console.log('RVM has finished launching the application list.');
4802
+ * })
4803
+ * .catch((err) => {
4804
+ * console.log(err);
4805
+ * })
4806
+ * ```
4807
+ *
4808
+ * @experimental
4809
+ */
4810
+ async startManyManifests(applications, opts) {
4811
+ return this.wire.sendAction('run-applications', { applications, opts }).then(() => undefined);
4812
+ }
4813
+ /**
4814
+ * Asynchronously returns an Application object that represents the current application
4815
+ *
4816
+ * @example
4817
+ *
4818
+ * ```js
4819
+ * async function isCurrentAppRunning () {
4820
+ * const app = await fin.Application.getCurrent();
4821
+ * return app.isRunning();
4822
+ * }
4823
+ *
4824
+ * isCurrentAppRunning().then(running => {
4825
+ * console.log(`Current app is running: ${running}`);
4826
+ * }).catch(err => {
4827
+ * console.error(err);
4828
+ * });
4829
+ *
4830
+ * ```
4831
+ */
4832
+ getCurrent() {
4833
+ this.wire.sendAction('get-current-application').catch((e) => {
4834
+ // we do not want to expose this error, just continue if this analytics-only call fails
4835
+ });
4836
+ return this.wrap({ uuid: this.wire.me.uuid });
4837
+ }
4838
+ /**
4839
+ * Synchronously returns an Application object that represents the current application
4840
+ *
4841
+ * @example
4842
+ *
4843
+ * ```js
4844
+ * async function isCurrentAppRunning () {
4845
+ * const app = fin.Application.getCurrentSync();
4846
+ * return app.isRunning();
4847
+ * }
4848
+ *
4849
+ * isCurrentAppRunning().then(running => {
4850
+ * console.log(`Current app is running: ${running}`);
4851
+ * }).catch(err => {
4852
+ * console.error(err);
4853
+ * });
4854
+ *
4855
+ * ```
4856
+ */
4857
+ getCurrentSync() {
4858
+ this.wire.sendAction('get-current-application-sync').catch((e) => {
4859
+ // we do not want to expose this error, just continue if this analytics-only call fails
4860
+ });
4861
+ return this.wrapSync({ uuid: this.wire.me.uuid });
4862
+ }
4863
+ /**
4864
+ * Retrieves application's manifest and returns a running instance of the application.
4865
+ * @param manifestUrl - The URL of app's manifest.
4866
+ * @param opts - Parameters that the RVM will use.
4867
+ *
4868
+ * @example
4869
+ *
4870
+ * ```js
4871
+ * fin.Application.startFromManifest('http://localhost:5555/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
4872
+ *
4873
+ * // For a local manifest file:
4874
+ * fin.Application.startFromManifest('file:///C:/somefolder/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
4875
+ * ```
4876
+ */
4877
+ async startFromManifest(manifestUrl, opts) {
4878
+ this.wire.sendAction('application-start-from-manifest').catch((e) => {
4879
+ // we do not want to expose this error, just continue if this analytics-only call fails
4880
+ });
4881
+ const app = await this._createFromManifest(manifestUrl);
4882
+ // @ts-expect-error using private method without warning.
4883
+ await app._run(opts); // eslint-disable-line no-underscore-dangle
4884
+ return app;
4885
+ }
4886
+ /**
4887
+ * @deprecated Use {@link Application.ApplicationModule.startFromManifest Application.startFromManifest} instead.
4888
+ * Retrieves application's manifest and returns a wrapped application.
4889
+ * @param manifestUrl - The URL of app's manifest.
4890
+ * @param callback - called if the method succeeds.
4891
+ * @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
4892
+ *
4893
+ * @example
4894
+ *
4895
+ * ```js
4896
+ * fin.Application.createFromManifest('http://localhost:5555/app.json').then(app => console.log(app)).catch(err => console.log(err));
4897
+ * ```
4898
+ * @ignore
4899
+ */
4900
+ createFromManifest(manifestUrl) {
4901
+ console.warn('Deprecation Warning: fin.Application.createFromManifest is deprecated. Please use fin.Application.startFromManifest');
4902
+ this.wire.sendAction('application-create-from-manifest').catch((e) => {
4903
+ // we do not want to expose this error, just continue if this analytics-only call fails
4904
+ });
4905
+ return this._createFromManifest(manifestUrl);
4906
+ }
4907
+ _createFromManifest(manifestUrl) {
4908
+ return this.wire
4909
+ .sendAction('get-application-manifest', { manifestUrl })
4910
+ .then(({ payload }) => {
4911
+ const uuid = payload.data.platform ? payload.data.platform.uuid : payload.data.startup_app.uuid;
4912
+ return this.wrap({ uuid });
4913
+ })
4914
+ .then((app) => {
4915
+ app._manifestUrl = manifestUrl; // eslint-disable-line no-underscore-dangle
4916
+ return app;
4917
+ });
4918
+ }
4655
4919
  }
4920
+ Factory$6.ApplicationModule = ApplicationModule;
4656
4921
 
4657
- var hasRequiredFactory$1;
4658
-
4659
- function requireFactory$1 () {
4660
- if (hasRequiredFactory$1) return Factory$6;
4661
- hasRequiredFactory$1 = 1;
4662
- Object.defineProperty(Factory$6, "__esModule", { value: true });
4663
- Factory$6.ApplicationModule = void 0;
4664
- const base_1 = base;
4665
- const validate_1 = validate;
4666
- const Instance_1 = requireInstance$2();
4922
+ (function (exports) {
4923
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4924
+ if (k2 === undefined) k2 = k;
4925
+ var desc = Object.getOwnPropertyDescriptor(m, k);
4926
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
4927
+ desc = { enumerable: true, get: function() { return m[k]; } };
4928
+ }
4929
+ Object.defineProperty(o, k2, desc);
4930
+ }) : (function(o, m, k, k2) {
4931
+ if (k2 === undefined) k2 = k;
4932
+ o[k2] = m[k];
4933
+ }));
4934
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
4935
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
4936
+ };
4937
+ Object.defineProperty(exports, "__esModule", { value: true });
4667
4938
  /**
4668
- * Static namespace for OpenFin API methods that interact with the {@link Application} class, available under `fin.Application`.
4939
+ * Entry points for the OpenFin `Application` API (`fin.Application`).
4940
+ *
4941
+ * * {@link ApplicationModule} contains static members of the `Application` API, accessible through `fin.Application`.
4942
+ * * {@link Application} describes an instance of an OpenFin Application, e.g. as returned by `fin.Application.getCurrent`.
4943
+ *
4944
+ * 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),
4945
+ * both of these were documented on the same page.
4946
+ *
4947
+ * @packageDocumentation
4669
4948
  */
4670
- class ApplicationModule extends base_1.Base {
4671
- /**
4672
- * Asynchronously returns an API handle for the given Application identity.
4673
- *
4674
- * @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
4675
- * returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
4676
- * for an Application throughout its entire lifecycle.
4677
- *
4678
- * @example
4679
- *
4680
- * ```js
4681
- * fin.Application.wrap({ uuid: 'testapp' })
4682
- * .then(app => app.isRunning())
4683
- * .then(running => console.log('Application is running: ' + running))
4684
- * .catch(err => console.log(err));
4685
- * ```
4686
- *
4687
- */
4688
- async wrap(identity) {
4689
- this.wire.sendAction('wrap-application').catch((e) => {
4690
- // we do not want to expose this error, just continue if this analytics-only call fails
4691
- });
4692
- const errorMsg = (0, validate_1.validateIdentity)(identity);
4693
- if (errorMsg) {
4694
- throw new Error(errorMsg);
4695
- }
4696
- return new Instance_1.Application(this.wire, identity);
4697
- }
4698
- /**
4699
- * Synchronously returns an API handle for the given Application identity.
4700
- *
4701
- * @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
4702
- * returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
4703
- * for an Aplication throughout its entire lifecycle.
4704
- *
4705
- * @example
4706
- *
4707
- * ```js
4708
- * const app = fin.Application.wrapSync({ uuid: 'testapp' });
4709
- * await app.close();
4710
- * ```
4711
- *
4712
- */
4713
- wrapSync(identity) {
4714
- this.wire.sendAction('wrap-application-sync').catch((e) => {
4715
- // we do not want to expose this error, just continue if this analytics-only call fails
4716
- });
4717
- const errorMsg = (0, validate_1.validateIdentity)(identity);
4718
- if (errorMsg) {
4719
- throw new Error(errorMsg);
4720
- }
4721
- return new Instance_1.Application(this.wire, identity);
4722
- }
4723
- async _create(appOptions) {
4724
- // set defaults:
4725
- if (appOptions.waitForPageLoad === undefined) {
4726
- appOptions.waitForPageLoad = false;
4727
- }
4728
- if (appOptions.autoShow === undefined && appOptions.isPlatformController === undefined) {
4729
- appOptions.autoShow = true;
4730
- }
4731
- await this.wire.sendAction('create-application', appOptions);
4732
- return this.wrap({ uuid: appOptions.uuid });
4733
- }
4734
- /**
4735
- * DEPRECATED method to create a new Application. Use {@link Application.ApplicationModule.start Application.start} instead.
4736
- *
4737
- * @example
4738
- *
4739
- * ```js
4740
- * async function createApp() {
4741
- * const app = await fin.Application.create({
4742
- * name: 'myApp',
4743
- * uuid: 'app-3',
4744
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.create.html',
4745
- * autoShow: true
4746
- * });
4747
- * await app.run();
4748
- * }
4749
- *
4750
- * createApp().then(() => console.log('Application is created')).catch(err => console.log(err));
4751
- * ```
4752
- *
4753
- * @ignore
4754
- */
4755
- create(appOptions) {
4756
- console.warn('Deprecation Warning: fin.Application.create is deprecated. Please use fin.Application.start');
4757
- this.wire.sendAction('application-create').catch((e) => {
4758
- // we do not want to expose this error, just continue if this analytics-only call fails
4759
- });
4760
- return this._create(appOptions);
4761
- }
4762
- /**
4763
- * Creates and starts a new Application.
4764
- *
4765
- * @example
4766
- *
4767
- * ```js
4768
- * async function start() {
4769
- * return fin.Application.start({
4770
- * name: 'app-1',
4771
- * uuid: 'app-1',
4772
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.start.html',
4773
- * autoShow: true
4774
- * });
4775
- * }
4776
- * start().then(() => console.log('Application is running')).catch(err => console.log(err));
4777
- * ```
4778
- *
4779
- */
4780
- async start(appOptions) {
4781
- this.wire.sendAction('start-application').catch((e) => {
4782
- // we do not want to expose this error, just continue if this analytics-only call fails
4783
- });
4784
- const app = await this._create(appOptions);
4785
- await this.wire.sendAction('run-application', { uuid: appOptions.uuid });
4786
- return app;
4787
- }
4788
- /**
4789
- * Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls.
4790
- * Returns once the RVM is finished attempting to launch the applications.
4791
- * @param opts - Parameters that the RVM will use.
4792
- *
4793
- * @example
4794
- *
4795
- * ```js
4796
- *
4797
- * const applicationInfoArray = [
4798
- * {
4799
- * "uuid": 'App-1',
4800
- * "manifestUrl": 'http://localhost:5555/app1.json',
4801
- * },
4802
- * {
4803
- * "uuid": 'App-2',
4804
- * "manifestUrl": 'http://localhost:5555/app2.json',
4805
- * },
4806
- * {
4807
- * "uuid": 'App-3',
4808
- * "manifestUrl": 'http://localhost:5555/app3.json',
4809
- * }
4810
- * ]
4811
- *
4812
- * fin.Application.startManyManifests(applicationInfoArray)
4813
- * .then(() => {
4814
- * console.log('RVM has finished launching the application list.');
4815
- * })
4816
- * .catch((err) => {
4817
- * console.log(err);
4818
- * })
4819
- * ```
4820
- *
4821
- * @experimental
4822
- */
4823
- async startManyManifests(applications, opts) {
4824
- return this.wire.sendAction('run-applications', { applications, opts }).then(() => undefined);
4825
- }
4826
- /**
4827
- * Asynchronously returns an Application object that represents the current application
4828
- *
4829
- * @example
4830
- *
4831
- * ```js
4832
- * async function isCurrentAppRunning () {
4833
- * const app = await fin.Application.getCurrent();
4834
- * return app.isRunning();
4835
- * }
4836
- *
4837
- * isCurrentAppRunning().then(running => {
4838
- * console.log(`Current app is running: ${running}`);
4839
- * }).catch(err => {
4840
- * console.error(err);
4841
- * });
4842
- *
4843
- * ```
4844
- */
4845
- getCurrent() {
4846
- this.wire.sendAction('get-current-application').catch((e) => {
4847
- // we do not want to expose this error, just continue if this analytics-only call fails
4848
- });
4849
- return this.wrap({ uuid: this.wire.me.uuid });
4850
- }
4851
- /**
4852
- * Synchronously returns an Application object that represents the current application
4853
- *
4854
- * @example
4855
- *
4856
- * ```js
4857
- * async function isCurrentAppRunning () {
4858
- * const app = fin.Application.getCurrentSync();
4859
- * return app.isRunning();
4860
- * }
4861
- *
4862
- * isCurrentAppRunning().then(running => {
4863
- * console.log(`Current app is running: ${running}`);
4864
- * }).catch(err => {
4865
- * console.error(err);
4866
- * });
4867
- *
4868
- * ```
4869
- */
4870
- getCurrentSync() {
4871
- this.wire.sendAction('get-current-application-sync').catch((e) => {
4872
- // we do not want to expose this error, just continue if this analytics-only call fails
4873
- });
4874
- return this.wrapSync({ uuid: this.wire.me.uuid });
4875
- }
4876
- /**
4877
- * Retrieves application's manifest and returns a running instance of the application.
4878
- * @param manifestUrl - The URL of app's manifest.
4879
- * @param opts - Parameters that the RVM will use.
4880
- *
4881
- * @example
4882
- *
4883
- * ```js
4884
- * fin.Application.startFromManifest('http://localhost:5555/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
4885
- *
4886
- * // For a local manifest file:
4887
- * fin.Application.startFromManifest('file:///C:/somefolder/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
4888
- * ```
4889
- */
4890
- async startFromManifest(manifestUrl, opts) {
4891
- this.wire.sendAction('application-start-from-manifest').catch((e) => {
4892
- // we do not want to expose this error, just continue if this analytics-only call fails
4893
- });
4894
- const app = await this._createFromManifest(manifestUrl);
4895
- // @ts-expect-error using private method without warning.
4896
- await app._run(opts); // eslint-disable-line no-underscore-dangle
4897
- return app;
4898
- }
4899
- /**
4900
- * @deprecated Use {@link Application.ApplicationModule.startFromManifest Application.startFromManifest} instead.
4901
- * Retrieves application's manifest and returns a wrapped application.
4902
- * @param manifestUrl - The URL of app's manifest.
4903
- * @param callback - called if the method succeeds.
4904
- * @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
4905
- *
4906
- * @example
4907
- *
4908
- * ```js
4909
- * fin.Application.createFromManifest('http://localhost:5555/app.json').then(app => console.log(app)).catch(err => console.log(err));
4910
- * ```
4911
- * @ignore
4912
- */
4913
- createFromManifest(manifestUrl) {
4914
- console.warn('Deprecation Warning: fin.Application.createFromManifest is deprecated. Please use fin.Application.startFromManifest');
4915
- this.wire.sendAction('application-create-from-manifest').catch((e) => {
4916
- // we do not want to expose this error, just continue if this analytics-only call fails
4917
- });
4918
- return this._createFromManifest(manifestUrl);
4919
- }
4920
- _createFromManifest(manifestUrl) {
4921
- return this.wire
4922
- .sendAction('get-application-manifest', { manifestUrl })
4923
- .then(({ payload }) => {
4924
- const uuid = payload.data.platform ? payload.data.platform.uuid : payload.data.startup_app.uuid;
4925
- return this.wrap({ uuid });
4926
- })
4927
- .then((app) => {
4928
- app._manifestUrl = manifestUrl; // eslint-disable-line no-underscore-dangle
4929
- return app;
4930
- });
4931
- }
4932
- }
4933
- Factory$6.ApplicationModule = ApplicationModule;
4934
- return Factory$6;
4935
- }
4936
-
4937
- var hasRequiredApplication;
4938
-
4939
- function requireApplication () {
4940
- if (hasRequiredApplication) return application;
4941
- hasRequiredApplication = 1;
4942
- (function (exports) {
4943
- var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4944
- if (k2 === undefined) k2 = k;
4945
- var desc = Object.getOwnPropertyDescriptor(m, k);
4946
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
4947
- desc = { enumerable: true, get: function() { return m[k]; } };
4948
- }
4949
- Object.defineProperty(o, k2, desc);
4950
- }) : (function(o, m, k, k2) {
4951
- if (k2 === undefined) k2 = k;
4952
- o[k2] = m[k];
4953
- }));
4954
- var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
4955
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
4956
- };
4957
- Object.defineProperty(exports, "__esModule", { value: true });
4958
- /**
4959
- * Entry points for the OpenFin `Application` API (`fin.Application`).
4960
- *
4961
- * * {@link ApplicationModule} contains static members of the `Application` API, accessible through `fin.Application`.
4962
- * * {@link Application} describes an instance of an OpenFin Application, e.g. as returned by `fin.Application.getCurrent`.
4963
- *
4964
- * 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),
4965
- * both of these were documented on the same page.
4966
- *
4967
- * @packageDocumentation
4968
- */
4969
- __exportStar(requireFactory$1(), exports);
4970
- __exportStar(requireInstance$2(), exports);
4971
- } (application));
4972
- return application;
4973
- }
4949
+ __exportStar(Factory$6, exports);
4950
+ __exportStar(Instance$5, exports);
4951
+ } (application));
4974
4952
 
4975
4953
  var promisifySubscription$1 = {};
4976
4954
 
@@ -5014,7 +4992,7 @@ function requireInstance$1 () {
5014
4992
  /* eslint-disable @typescript-eslint/no-unused-vars */
5015
4993
  /* eslint-disable no-console */
5016
4994
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
5017
- const application_1 = requireApplication();
4995
+ const application_1 = application;
5018
4996
  const main_1 = main;
5019
4997
  const view_1 = requireView();
5020
4998
  const warnings_1 = warnings;
@@ -7137,7 +7115,7 @@ function requireView () {
7137
7115
  *
7138
7116
  * @packageDocumentation
7139
7117
  */
7140
- __exportStar(requireFactory$2(), exports);
7118
+ __exportStar(requireFactory$1(), exports);
7141
7119
  __exportStar(requireInstance(), exports);
7142
7120
  } (view));
7143
7121
  return view;
@@ -7634,7 +7612,7 @@ var __classPrivateFieldGet$h = (commonjsGlobal && commonjsGlobal.__classPrivateF
7634
7612
  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");
7635
7613
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
7636
7614
  };
7637
- var __importDefault$6 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
7615
+ var __importDefault$5 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
7638
7616
  return (mod && mod.__esModule) ? mod : { "default": mod };
7639
7617
  };
7640
7618
  var _Transport_wire, _Transport_fin;
@@ -7643,7 +7621,7 @@ var Transport_1 = transport.Transport = void 0;
7643
7621
  const events_1$5 = require$$0;
7644
7622
  const wire_1 = wire;
7645
7623
  const transport_errors_1$6 = transportErrors;
7646
- const eventAggregator_1 = __importDefault$6(eventAggregator);
7624
+ const eventAggregator_1 = __importDefault$5(eventAggregator);
7647
7625
  const me_1$1 = me;
7648
7626
  const errors_1$2 = errors;
7649
7627
  class Transport extends events_1$5.EventEmitter {
@@ -11687,7 +11665,7 @@ var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateF
11687
11665
  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");
11688
11666
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11689
11667
  };
11690
- var __importDefault$5 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
11668
+ var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
11691
11669
  return (mod && mod.__esModule) ? mod : { "default": mod };
11692
11670
  };
11693
11671
  var _ConnectionManager_messageReceiver, _ConnectionManager_rtcConnectionManager;
@@ -11701,7 +11679,7 @@ const ice_manager_1 = iceManager;
11701
11679
  const provider_1$1 = provider;
11702
11680
  const message_receiver_1 = messageReceiver;
11703
11681
  const protocol_manager_1 = protocolManager;
11704
- const strategy_3 = __importDefault$5(strategy);
11682
+ const strategy_3 = __importDefault$4(strategy);
11705
11683
  class ConnectionManager extends base_1$e.Base {
11706
11684
  static getProtocolOptionsFromStrings(protocols) {
11707
11685
  return protocols.map((protocol) => {
@@ -15661,14 +15639,14 @@ var __classPrivateFieldGet$3 = (commonjsGlobal && commonjsGlobal.__classPrivateF
15661
15639
  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");
15662
15640
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15663
15641
  };
15664
- var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
15642
+ var __importDefault$3 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
15665
15643
  return (mod && mod.__esModule) ? mod : { "default": mod };
15666
15644
  };
15667
15645
  var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory, _InteropClient_channelEvents;
15668
15646
  Object.defineProperty(InteropClient$1, "__esModule", { value: true });
15669
15647
  InteropClient$1.InteropClient = void 0;
15670
15648
  const base_1$4 = base;
15671
- const SessionContextGroupClient_1 = __importDefault$4(SessionContextGroupClient$1);
15649
+ const SessionContextGroupClient_1 = __importDefault$3(SessionContextGroupClient$1);
15672
15650
  const utils_1$5 = utils$3;
15673
15651
  const channel_events_1 = channelEvents;
15674
15652
  /**
@@ -16408,12 +16386,12 @@ var fdc3Channels2_0 = {};
16408
16386
 
16409
16387
  var fdc3Channels1_2 = {};
16410
16388
 
16411
- var __importDefault$3 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
16389
+ var __importDefault$2 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
16412
16390
  return (mod && mod.__esModule) ? mod : { "default": mod };
16413
16391
  };
16414
16392
  Object.defineProperty(fdc3Channels1_2, "__esModule", { value: true });
16415
16393
  fdc3Channels1_2.createV1Channel = void 0;
16416
- const isEqual_1$1 = __importDefault$3(require$$3);
16394
+ const isEqual_1$1 = __importDefault$2(require$$3);
16417
16395
  const createV1Channel = (sessionContextGroup) => {
16418
16396
  return {
16419
16397
  id: sessionContextGroup.id,
@@ -16692,7 +16670,7 @@ var __classPrivateFieldSet$2 = (commonjsGlobal && commonjsGlobal.__classPrivateF
16692
16670
  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");
16693
16671
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
16694
16672
  };
16695
- var __importDefault$2 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
16673
+ var __importDefault$1 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
16696
16674
  return (mod && mod.__esModule) ? mod : { "default": mod };
16697
16675
  };
16698
16676
  var _FDC3ModuleBase_producer;
@@ -16701,7 +16679,7 @@ fdc3Common.FDC3ModuleBase = void 0;
16701
16679
  const utils_1$4 = utils$2;
16702
16680
  const utils_2$1 = utils$3;
16703
16681
  const InteropClient_1$2 = InteropClient$1;
16704
- const isEqual_1 = __importDefault$2(require$$3);
16682
+ const isEqual_1 = __importDefault$1(require$$3);
16705
16683
  class FDC3ModuleBase {
16706
16684
  get client() {
16707
16685
  return __classPrivateFieldGet$2(this, _FDC3ModuleBase_producer, "f").call(this);
@@ -17495,12 +17473,8 @@ const fdc3Factory = (version, interopClient, wire) => {
17495
17473
  };
17496
17474
  fdc3ClientFactory.fdc3Factory = fdc3Factory;
17497
17475
 
17498
- var __importDefault$1 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
17499
- return (mod && mod.__esModule) ? mod : { "default": mod };
17500
- };
17501
17476
  Object.defineProperty(Factory$1, "__esModule", { value: true });
17502
17477
  Factory$1.InteropModule = void 0;
17503
- const cloneDeep_1 = __importDefault$1(require$$0$1);
17504
17478
  const inaccessibleObject_1 = inaccessibleObject;
17505
17479
  const base_1$3 = base;
17506
17480
  const InteropBroker_1 = InteropBroker$1;
@@ -17538,7 +17512,7 @@ class InteropModule extends base_1$3.Base {
17538
17512
  // Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
17539
17513
  const options = await this.wire.environment.getInteropInfo(this.wire.getFin());
17540
17514
  const objectThatThrows = (0, inaccessibleObject_1.createUnusableObject)(BrokerParamAccessError);
17541
- const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (0, cloneDeep_1.default)(options));
17515
+ const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, structuredClone(options));
17542
17516
  const getProvider = () => {
17543
17517
  return this.fin.InterApplicationBus.Channel.create(`interop-broker-${name}`);
17544
17518
  };
@@ -18111,7 +18085,7 @@ const events_1 = require$$0;
18111
18085
  // Import from the file rather than the directory in case someone consuming types is using module resolution other than "node"
18112
18086
  const index_1 = system;
18113
18087
  const index_2 = requireWindow();
18114
- const index_3 = requireApplication();
18088
+ const index_3 = application;
18115
18089
  const index_4 = interappbus;
18116
18090
  const index_5 = clipboard;
18117
18091
  const index_6 = externalApplication;