@openfin/remote-adapter 44.100.57 → 44.100.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/remote-adapter.js +1195 -1162
- package/package.json +2 -2
package/out/remote-adapter.js
CHANGED
|
@@ -825,7 +825,7 @@ var __importDefault$7 = (commonjsGlobal && commonjsGlobal.__importDefault) || fu
|
|
|
825
825
|
var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
|
|
826
826
|
Object.defineProperty(InteropBroker$1, "__esModule", { value: true });
|
|
827
827
|
InteropBroker$1.InteropBroker = void 0;
|
|
828
|
-
const base_1$
|
|
828
|
+
const base_1$p = base;
|
|
829
829
|
const SessionContextGroupBroker_1 = __importDefault$7(SessionContextGroupBroker$1);
|
|
830
830
|
const utils_1$7 = utils$3;
|
|
831
831
|
const isEqual_1$2 = __importDefault$7(require$$3);
|
|
@@ -994,7 +994,7 @@ const defaultContextGroups = [
|
|
|
994
994
|
* ---
|
|
995
995
|
*
|
|
996
996
|
*/
|
|
997
|
-
class InteropBroker extends base_1$
|
|
997
|
+
class InteropBroker extends base_1$p.Base {
|
|
998
998
|
/**
|
|
999
999
|
* @internal
|
|
1000
1000
|
*/
|
|
@@ -2551,11 +2551,11 @@ const handleDeprecatedWarnings = (options) => {
|
|
|
2551
2551
|
};
|
|
2552
2552
|
warnings.handleDeprecatedWarnings = handleDeprecatedWarnings;
|
|
2553
2553
|
|
|
2554
|
-
var hasRequiredFactory$
|
|
2554
|
+
var hasRequiredFactory$1;
|
|
2555
2555
|
|
|
2556
|
-
function requireFactory$
|
|
2557
|
-
if (hasRequiredFactory$
|
|
2558
|
-
hasRequiredFactory$
|
|
2556
|
+
function requireFactory$1 () {
|
|
2557
|
+
if (hasRequiredFactory$1) return Factory$8;
|
|
2558
|
+
hasRequiredFactory$1 = 1;
|
|
2559
2559
|
Object.defineProperty(Factory$8, "__esModule", { value: true });
|
|
2560
2560
|
Factory$8.ViewModule = void 0;
|
|
2561
2561
|
const base_1 = base;
|
|
@@ -2714,8 +2714,8 @@ var main = {};
|
|
|
2714
2714
|
|
|
2715
2715
|
Object.defineProperty(main, "__esModule", { value: true });
|
|
2716
2716
|
main.WebContents = void 0;
|
|
2717
|
-
const base_1$
|
|
2718
|
-
class WebContents extends base_1$
|
|
2717
|
+
const base_1$o = base;
|
|
2718
|
+
class WebContents extends base_1$o.EmitterBase {
|
|
2719
2719
|
/**
|
|
2720
2720
|
* @param identity The identity of the {@link OpenFin.WebContentsEvents WebContents}.
|
|
2721
2721
|
* @param entityType The type of the {@link OpenFin.WebContentsEvents WebContents}.
|
|
@@ -3808,1154 +3808,1133 @@ var Factory$6 = {};
|
|
|
3808
3808
|
|
|
3809
3809
|
var Instance$5 = {};
|
|
3810
3810
|
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
3811
|
+
Object.defineProperty(Instance$5, "__esModule", { value: true });
|
|
3812
|
+
Instance$5.Application = void 0;
|
|
3813
|
+
/* eslint-disable import/prefer-default-export */
|
|
3814
|
+
const base_1$n = base;
|
|
3815
|
+
const window_1$1 = requireWindow();
|
|
3816
|
+
const view_1 = requireView();
|
|
3817
|
+
/**
|
|
3818
|
+
* An object representing an application. Allows the developer to create,
|
|
3819
|
+
* execute, show/close an application as well as listen to {@link OpenFin.ApplicationEvents application events}.
|
|
3820
|
+
*/
|
|
3821
|
+
class Application extends base_1$n.EmitterBase {
|
|
3822
|
+
/**
|
|
3823
|
+
* @internal
|
|
3824
|
+
*/
|
|
3825
|
+
constructor(wire, identity) {
|
|
3826
|
+
super(wire, 'application', identity.uuid);
|
|
3827
|
+
this.identity = identity;
|
|
3828
|
+
this.window = new window_1$1._Window(this.wire, {
|
|
3829
|
+
uuid: this.identity.uuid,
|
|
3830
|
+
name: this.identity.uuid
|
|
3831
|
+
});
|
|
3832
|
+
}
|
|
3833
|
+
windowListFromIdentityList(identityList) {
|
|
3834
|
+
const windowList = [];
|
|
3835
|
+
identityList.forEach((identity) => {
|
|
3836
|
+
windowList.push(new window_1$1._Window(this.wire, {
|
|
3837
|
+
uuid: identity.uuid,
|
|
3838
|
+
name: identity.name
|
|
3839
|
+
}));
|
|
3840
|
+
});
|
|
3841
|
+
return windowList;
|
|
3842
|
+
}
|
|
3843
|
+
/**
|
|
3844
|
+
* Determines if the application is currently running.
|
|
3845
|
+
*
|
|
3846
|
+
* @example
|
|
3847
|
+
*
|
|
3848
|
+
* ```js
|
|
3849
|
+
* async function isAppRunning() {
|
|
3850
|
+
* const app = await fin.Application.getCurrent();
|
|
3851
|
+
* return await app.isRunning();
|
|
3852
|
+
* }
|
|
3853
|
+
* isAppRunning().then(running => console.log(`Current app is running: ${running}`)).catch(err => console.log(err));
|
|
3854
|
+
* ```
|
|
3855
|
+
*/
|
|
3856
|
+
isRunning() {
|
|
3857
|
+
return this.wire.sendAction('is-application-running', this.identity).then(({ payload }) => payload.data);
|
|
3858
|
+
}
|
|
3859
|
+
/**
|
|
3860
|
+
* Closes the application and any child windows created by the application.
|
|
3861
|
+
* Cleans the application from state so it is no longer found in getAllApplications.
|
|
3862
|
+
* @param force Close will be prevented from closing when force is false and
|
|
3863
|
+
* ‘close-requested’ has been subscribed to for application’s main window.
|
|
3864
|
+
*
|
|
3865
|
+
* @example
|
|
3866
|
+
*
|
|
3867
|
+
* ```js
|
|
3868
|
+
* async function closeApp() {
|
|
3869
|
+
* const allApps1 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}, {uuid: 'app2', isRunning: true}]
|
|
3870
|
+
* const app = await fin.Application.wrap({uuid: 'app2'});
|
|
3871
|
+
* await app.quit();
|
|
3872
|
+
* const allApps2 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}]
|
|
3873
|
+
*
|
|
3874
|
+
* }
|
|
3875
|
+
* closeApp().then(() => console.log('Application quit')).catch(err => console.log(err));
|
|
3876
|
+
* ```
|
|
3877
|
+
*/
|
|
3878
|
+
async quit(force = false) {
|
|
3879
|
+
try {
|
|
3880
|
+
await this._close(force);
|
|
3881
|
+
await this.wire.sendAction('destroy-application', { force, ...this.identity });
|
|
3882
|
+
}
|
|
3883
|
+
catch (error) {
|
|
3884
|
+
const acceptableErrors = ['Remote connection has closed', 'Could not locate the requested application'];
|
|
3885
|
+
if (!acceptableErrors.some((msg) => error.message.includes(msg))) {
|
|
3886
|
+
throw error;
|
|
3887
|
+
}
|
|
3888
|
+
}
|
|
3889
|
+
}
|
|
3890
|
+
async _close(force = false) {
|
|
3891
|
+
try {
|
|
3892
|
+
await this.wire.sendAction('close-application', { force, ...this.identity });
|
|
3893
|
+
}
|
|
3894
|
+
catch (error) {
|
|
3895
|
+
if (!error.message.includes('Remote connection has closed')) {
|
|
3896
|
+
throw error;
|
|
3897
|
+
}
|
|
3898
|
+
}
|
|
3899
|
+
}
|
|
3900
|
+
/**
|
|
3901
|
+
* @deprecated use Application.quit instead
|
|
3902
|
+
* Closes the application and any child windows created by the application.
|
|
3903
|
+
* @param force - Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for application’s main window.
|
|
3904
|
+
* @param callback - called if the method succeeds.
|
|
3905
|
+
* @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
|
|
3906
|
+
*
|
|
3907
|
+
* @example
|
|
3908
|
+
*
|
|
3909
|
+
* ```js
|
|
3910
|
+
* async function closeApp() {
|
|
3911
|
+
* const app = await fin.Application.getCurrent();
|
|
3912
|
+
* return await app.close();
|
|
3913
|
+
* }
|
|
3914
|
+
* closeApp().then(() => console.log('Application closed')).catch(err => console.log(err));
|
|
3915
|
+
* ```
|
|
3916
|
+
*/
|
|
3917
|
+
close(force = false) {
|
|
3918
|
+
console.warn('Deprecation Warning: Application.close is deprecated Please use Application.quit');
|
|
3919
|
+
this.wire.sendAction('application-close', this.identity).catch((e) => {
|
|
3920
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3921
|
+
});
|
|
3922
|
+
return this._close(force);
|
|
3923
|
+
}
|
|
3924
|
+
/**
|
|
3925
|
+
* Retrieves an array of wrapped fin.Windows for each of the application’s child windows.
|
|
3926
|
+
*
|
|
3927
|
+
* @example
|
|
3928
|
+
*
|
|
3929
|
+
* ```js
|
|
3930
|
+
* async function getChildWindows() {
|
|
3931
|
+
* const app = await fin.Application.getCurrent();
|
|
3932
|
+
* return await app.getChildWindows();
|
|
3933
|
+
* }
|
|
3934
|
+
*
|
|
3935
|
+
* getChildWindows().then(children => console.log(children)).catch(err => console.log(err));
|
|
3936
|
+
* ```
|
|
3937
|
+
*/
|
|
3938
|
+
getChildWindows() {
|
|
3939
|
+
return this.wire.sendAction('get-child-windows', this.identity).then(({ payload }) => {
|
|
3940
|
+
const identityList = [];
|
|
3941
|
+
payload.data.forEach((winName) => {
|
|
3942
|
+
identityList.push({ uuid: this.identity.uuid, name: winName });
|
|
3943
|
+
});
|
|
3944
|
+
return this.windowListFromIdentityList(identityList);
|
|
3945
|
+
});
|
|
3946
|
+
}
|
|
3947
|
+
/**
|
|
3948
|
+
* Retrieves the JSON manifest that was used to create the application. Invokes the error callback
|
|
3949
|
+
* if the application was not created from a manifest.
|
|
3950
|
+
*
|
|
3951
|
+
* @example
|
|
3952
|
+
*
|
|
3953
|
+
* ```js
|
|
3954
|
+
* async function getManifest() {
|
|
3955
|
+
* const app = await fin.Application.getCurrent();
|
|
3956
|
+
* return await app.getManifest();
|
|
3957
|
+
* }
|
|
3958
|
+
*
|
|
3959
|
+
* getManifest().then(manifest => console.log(manifest)).catch(err => console.log(err));
|
|
3960
|
+
* ```
|
|
3961
|
+
*/
|
|
3962
|
+
getManifest() {
|
|
3963
|
+
return this.wire.sendAction('get-application-manifest', this.identity).then(({ payload }) => payload.data);
|
|
3964
|
+
}
|
|
3965
|
+
/**
|
|
3966
|
+
* Retrieves UUID of the application that launches this application. Invokes the error callback
|
|
3967
|
+
* if the application was created from a manifest.
|
|
3968
|
+
*
|
|
3969
|
+
* @example
|
|
3970
|
+
*
|
|
3971
|
+
* ```js
|
|
3972
|
+
* async function getParentUuid() {
|
|
3973
|
+
* const app = await fin.Application.start({
|
|
3974
|
+
* uuid: 'app-1',
|
|
3975
|
+
* name: 'myApp',
|
|
3976
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getParentUuid.html',
|
|
3977
|
+
* autoShow: true
|
|
3978
|
+
* });
|
|
3979
|
+
* return await app.getParentUuid();
|
|
3980
|
+
* }
|
|
3981
|
+
*
|
|
3982
|
+
* getParentUuid().then(parentUuid => console.log(parentUuid)).catch(err => console.log(err));
|
|
3983
|
+
* ```
|
|
3984
|
+
*/
|
|
3985
|
+
getParentUuid() {
|
|
3986
|
+
return this.wire.sendAction('get-parent-application', this.identity).then(({ payload }) => payload.data);
|
|
3987
|
+
}
|
|
3988
|
+
/**
|
|
3989
|
+
* Retrieves current application's shortcut configuration.
|
|
3990
|
+
*
|
|
3991
|
+
* @example
|
|
3992
|
+
*
|
|
3993
|
+
* ```js
|
|
3994
|
+
* async function getShortcuts() {
|
|
3995
|
+
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
3996
|
+
* return await app.getShortcuts();
|
|
3997
|
+
* }
|
|
3998
|
+
* getShortcuts().then(config => console.log(config)).catch(err => console.log(err));
|
|
3999
|
+
* ```
|
|
4000
|
+
*/
|
|
4001
|
+
getShortcuts() {
|
|
4002
|
+
return this.wire.sendAction('get-shortcuts', this.identity).then(({ payload }) => payload.data);
|
|
4003
|
+
}
|
|
4004
|
+
/**
|
|
4005
|
+
* Retrieves current application's views.
|
|
4006
|
+
* @experimental
|
|
4007
|
+
*
|
|
4008
|
+
* @example
|
|
4009
|
+
*
|
|
4010
|
+
* ```js
|
|
4011
|
+
* async function getViews() {
|
|
4012
|
+
* const app = await fin.Application.getCurrent();
|
|
4013
|
+
* return await app.getViews();
|
|
4014
|
+
* }
|
|
4015
|
+
* getViews().then(views => console.log(views)).catch(err => console.log(err));
|
|
4016
|
+
* ```
|
|
4017
|
+
*/
|
|
4018
|
+
async getViews() {
|
|
4019
|
+
const { payload } = await this.wire.sendAction('application-get-views', this.identity);
|
|
4020
|
+
return payload.data.map((id) => new view_1.View(this.wire, id));
|
|
4021
|
+
}
|
|
4022
|
+
/**
|
|
4023
|
+
* Returns the current zoom level of the application.
|
|
4024
|
+
*
|
|
4025
|
+
* @example
|
|
4026
|
+
*
|
|
4027
|
+
* ```js
|
|
4028
|
+
* async function getZoomLevel() {
|
|
4029
|
+
* const app = await fin.Application.getCurrent();
|
|
4030
|
+
* return await app.getZoomLevel();
|
|
4031
|
+
* }
|
|
4032
|
+
*
|
|
4033
|
+
* getZoomLevel().then(zoomLevel => console.log(zoomLevel)).catch(err => console.log(err));
|
|
4034
|
+
* ```
|
|
4035
|
+
*/
|
|
4036
|
+
getZoomLevel() {
|
|
4037
|
+
return this.wire.sendAction('get-application-zoom-level', this.identity).then(({ payload }) => payload.data);
|
|
4038
|
+
}
|
|
4039
|
+
/**
|
|
4040
|
+
* Returns an instance of the main Window of the application
|
|
4041
|
+
*
|
|
4042
|
+
* @example
|
|
4043
|
+
*
|
|
4044
|
+
* ```js
|
|
4045
|
+
* async function getWindow() {
|
|
4046
|
+
* const app = await fin.Application.start({
|
|
4047
|
+
* uuid: 'app-1',
|
|
4048
|
+
* name: 'myApp',
|
|
4049
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getWindow.html',
|
|
4050
|
+
* autoShow: true
|
|
4051
|
+
* });
|
|
4052
|
+
* return await app.getWindow();
|
|
4053
|
+
* }
|
|
4054
|
+
*
|
|
4055
|
+
* getWindow().then(win => {
|
|
4056
|
+
* win.showAt(0, 400);
|
|
4057
|
+
* win.flash();
|
|
4058
|
+
* }).catch(err => console.log(err));
|
|
4059
|
+
* ```
|
|
4060
|
+
*/
|
|
4061
|
+
getWindow() {
|
|
4062
|
+
this.wire.sendAction('application-get-window', this.identity).catch((e) => {
|
|
4063
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4064
|
+
});
|
|
4065
|
+
return Promise.resolve(this.window);
|
|
4066
|
+
}
|
|
4067
|
+
/**
|
|
4068
|
+
* Manually registers a user with the licensing service. The only data sent by this call is userName and appName.
|
|
4069
|
+
* @param userName - username to be passed to the RVM.
|
|
4070
|
+
* @param appName - app name to be passed to the RVM.
|
|
4071
|
+
*
|
|
4072
|
+
* @example
|
|
4073
|
+
*
|
|
4074
|
+
* ```js
|
|
4075
|
+
* async function registerUser() {
|
|
4076
|
+
* const app = await fin.Application.getCurrent();
|
|
4077
|
+
* return await app.registerUser('user', 'myApp');
|
|
4078
|
+
* }
|
|
4079
|
+
*
|
|
4080
|
+
* registerUser().then(() => console.log('Successfully registered the user')).catch(err => console.log(err));
|
|
4081
|
+
* ```
|
|
4082
|
+
*/
|
|
4083
|
+
registerUser(userName, appName) {
|
|
4084
|
+
return this.wire.sendAction('register-user', { userName, appName, ...this.identity }).then(() => undefined);
|
|
4085
|
+
}
|
|
4086
|
+
/**
|
|
4087
|
+
* Removes the application’s icon from the tray.
|
|
4088
|
+
*
|
|
4089
|
+
* @example
|
|
4090
|
+
*
|
|
4091
|
+
* ```js
|
|
4092
|
+
* async function removeTrayIcon() {
|
|
4093
|
+
* const app = await fin.Application.getCurrent();
|
|
4094
|
+
* return await app.removeTrayIcon();
|
|
4095
|
+
* }
|
|
4096
|
+
*
|
|
4097
|
+
* removeTrayIcon().then(() => console.log('Removed the tray icon.')).catch(err => console.log(err));
|
|
4098
|
+
* ```
|
|
4099
|
+
*/
|
|
4100
|
+
removeTrayIcon() {
|
|
4101
|
+
return this.wire.sendAction('remove-tray-icon', this.identity).then(() => undefined);
|
|
4102
|
+
}
|
|
4103
|
+
/**
|
|
4104
|
+
* Restarts the application.
|
|
4105
|
+
*
|
|
4106
|
+
* @example
|
|
4107
|
+
*
|
|
4108
|
+
* ```js
|
|
4109
|
+
* async function restartApp() {
|
|
4110
|
+
* const app = await fin.Application.getCurrent();
|
|
4111
|
+
* return await app.restart();
|
|
4112
|
+
* }
|
|
4113
|
+
* restartApp().then(() => console.log('Application restarted')).catch(err => console.log(err));
|
|
4114
|
+
* ```
|
|
4115
|
+
*/
|
|
4116
|
+
restart() {
|
|
4117
|
+
return this.wire.sendAction('restart-application', this.identity).then(() => undefined);
|
|
4118
|
+
}
|
|
4119
|
+
/**
|
|
4120
|
+
* DEPRECATED method to run the application.
|
|
4121
|
+
* Needed when starting application via {@link Application.create}, but NOT needed when starting via {@link Application.start}.
|
|
4122
|
+
*
|
|
4123
|
+
* @example
|
|
4124
|
+
*
|
|
4125
|
+
* ```js
|
|
4126
|
+
* async function run() {
|
|
4127
|
+
* const app = await fin.Application.create({
|
|
4128
|
+
* name: 'myApp',
|
|
4129
|
+
* uuid: 'app-1',
|
|
4130
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.run.html',
|
|
4131
|
+
* autoShow: true
|
|
4132
|
+
* });
|
|
4133
|
+
* await app.run();
|
|
4134
|
+
* }
|
|
4135
|
+
* run().then(() => console.log('Application is running')).catch(err => console.log(err));
|
|
4136
|
+
* ```
|
|
4137
|
+
*
|
|
4138
|
+
* @ignore
|
|
4139
|
+
*/
|
|
4140
|
+
run() {
|
|
4141
|
+
console.warn('Deprecation Warning: Application.run is deprecated Please use fin.Application.start');
|
|
4142
|
+
this.wire.sendAction('application-run', this.identity).catch((e) => {
|
|
4143
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4144
|
+
});
|
|
4145
|
+
return this._run();
|
|
4146
|
+
}
|
|
4147
|
+
_run(opts = {}) {
|
|
4148
|
+
return this.wire
|
|
4149
|
+
.sendAction('run-application', {
|
|
4150
|
+
manifestUrl: this._manifestUrl,
|
|
4151
|
+
opts,
|
|
4152
|
+
...this.identity
|
|
4153
|
+
})
|
|
4154
|
+
.then(() => undefined);
|
|
4155
|
+
}
|
|
4156
|
+
/**
|
|
4157
|
+
* Instructs the RVM to schedule one restart of the application.
|
|
4158
|
+
*
|
|
4159
|
+
* @example
|
|
4160
|
+
*
|
|
4161
|
+
* ```js
|
|
4162
|
+
* async function scheduleRestart() {
|
|
4163
|
+
* const app = await fin.Application.getCurrent();
|
|
4164
|
+
* return await app.scheduleRestart();
|
|
4165
|
+
* }
|
|
4166
|
+
*
|
|
4167
|
+
* scheduleRestart().then(() => console.log('Application is scheduled to restart')).catch(err => console.log(err));
|
|
4168
|
+
* ```
|
|
4169
|
+
*/
|
|
4170
|
+
scheduleRestart() {
|
|
4171
|
+
return this.wire.sendAction('relaunch-on-close', this.identity).then(() => undefined);
|
|
4172
|
+
}
|
|
4173
|
+
/**
|
|
4174
|
+
* Sends a message to the RVM to upload the application's logs. On success,
|
|
4175
|
+
* an object containing logId is returned.
|
|
4176
|
+
*
|
|
4177
|
+
* @example
|
|
4178
|
+
*
|
|
4179
|
+
* ```js
|
|
4180
|
+
* async function sendLog() {
|
|
4181
|
+
* const app = await fin.Application.getCurrent();
|
|
4182
|
+
* return await app.sendApplicationLog();
|
|
4183
|
+
* }
|
|
4184
|
+
*
|
|
4185
|
+
* sendLog().then(info => console.log(info.logId)).catch(err => console.log(err));
|
|
4186
|
+
* ```
|
|
4187
|
+
*/
|
|
4188
|
+
async sendApplicationLog() {
|
|
4189
|
+
const { payload } = await this.wire.sendAction('send-application-log', this.identity);
|
|
4190
|
+
return payload.data;
|
|
4191
|
+
}
|
|
4192
|
+
/**
|
|
4193
|
+
* Sets or removes a custom JumpList for the application. Only applicable in Windows OS.
|
|
4194
|
+
* If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
|
|
4195
|
+
*
|
|
4196
|
+
* Note: If the "name" property is omitted it defaults to "tasks".
|
|
4197
|
+
* @param jumpListCategories An array of JumpList Categories to populate. If null, remove any existing JumpList configuration and set to Windows default.
|
|
4198
|
+
*
|
|
4199
|
+
*
|
|
4200
|
+
* @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).
|
|
4201
|
+
*
|
|
4202
|
+
* The bottommost item in the jumplist will always be an item pointing to the current app. Its name is taken from the manifest's
|
|
4203
|
+
* **` shortcut.name `** and uses **` shortcut.company `** as a fallback. Clicking that item will launch the app from its current manifest.
|
|
4204
|
+
*
|
|
4205
|
+
* Note: If the "name" property is omitted it defaults to "tasks".
|
|
4206
|
+
*
|
|
4207
|
+
* Note: Window OS caches jumplists icons, therefore an icon change might only be visible after the cache is removed or the
|
|
4208
|
+
* uuid or shortcut.name is changed.
|
|
4209
|
+
*
|
|
4210
|
+
* @example
|
|
4211
|
+
*
|
|
4212
|
+
* ```js
|
|
4213
|
+
* const app = fin.Application.getCurrentSync();
|
|
4214
|
+
* const appName = 'My App';
|
|
4215
|
+
* const jumpListConfig = [ // array of JumpList categories
|
|
4216
|
+
* {
|
|
4217
|
+
* // has no name and no type so `type` is assumed to be "tasks"
|
|
4218
|
+
* items: [ // array of JumpList items
|
|
4219
|
+
* {
|
|
4220
|
+
* type: 'task',
|
|
4221
|
+
* title: `Launch ${appName}`,
|
|
4222
|
+
* description: `Runs ${appName} with the default configuration`,
|
|
4223
|
+
* deepLink: 'fins://path.to/app/manifest.json',
|
|
4224
|
+
* iconPath: 'https://path.to/app/icon.ico',
|
|
4225
|
+
* iconIndex: 0
|
|
4226
|
+
* },
|
|
4227
|
+
* { type: 'separator' },
|
|
4228
|
+
* {
|
|
4229
|
+
* type: 'task',
|
|
4230
|
+
* title: `Restore ${appName}`,
|
|
4231
|
+
* description: 'Restore to last configuration',
|
|
4232
|
+
* deepLink: 'fins://path.to/app/manifest.json?$$use-last-configuration=true',
|
|
4233
|
+
* iconPath: 'https://path.to/app/icon.ico',
|
|
4234
|
+
* iconIndex: 0
|
|
4235
|
+
* },
|
|
4236
|
+
* ]
|
|
4237
|
+
* },
|
|
4238
|
+
* {
|
|
4239
|
+
* name: 'Tools',
|
|
4240
|
+
* items: [ // array of JumpList items
|
|
4241
|
+
* {
|
|
4242
|
+
* type: 'task',
|
|
4243
|
+
* title: 'Tool A',
|
|
4244
|
+
* description: 'Runs Tool A',
|
|
4245
|
+
* deepLink: 'fins://path.to/tool-a/manifest.json',
|
|
4246
|
+
* iconPath: 'https://path.to/tool-a/icon.ico',
|
|
4247
|
+
* iconIndex: 0
|
|
4248
|
+
* },
|
|
4249
|
+
* {
|
|
4250
|
+
* type: 'task',
|
|
4251
|
+
* title: 'Tool B',
|
|
4252
|
+
* description: 'Runs Tool B',
|
|
4253
|
+
* deepLink: 'fins://path.to/tool-b/manifest.json',
|
|
4254
|
+
* iconPath: 'https://path.to/tool-b/icon.ico',
|
|
4255
|
+
* iconIndex: 0
|
|
4256
|
+
* }]
|
|
4257
|
+
* }
|
|
4258
|
+
* ];
|
|
4259
|
+
*
|
|
4260
|
+
* app.setJumpList(jumpListConfig).then(() => console.log('JumpList applied')).catch(e => console.log(`JumpList failed to apply: ${e.toString()}`));
|
|
4261
|
+
* ```
|
|
4262
|
+
*
|
|
4263
|
+
* To handle deeplink args:
|
|
4264
|
+
* ```js
|
|
4265
|
+
* function handleUseLastConfiguration() {
|
|
4266
|
+
* // this handler is called when the app is being launched
|
|
4267
|
+
* app.on('run-requested', event => {
|
|
4268
|
+
* if(event.userAppConfigArgs['use-last-configuration']) {
|
|
4269
|
+
* // your logic here
|
|
4270
|
+
* }
|
|
4271
|
+
* });
|
|
4272
|
+
* // this handler is called when the app was already running when the launch was requested
|
|
4273
|
+
* fin.desktop.main(function(args) {
|
|
4274
|
+
* if(args && args['use-last-configuration']) {
|
|
4275
|
+
* // your logic here
|
|
4276
|
+
* }
|
|
4277
|
+
* });
|
|
4278
|
+
* }
|
|
4279
|
+
* ```
|
|
4280
|
+
*/
|
|
4281
|
+
async setJumpList(jumpListCategories) {
|
|
4282
|
+
await this.wire.sendAction('set-jump-list', { config: jumpListCategories, ...this.identity });
|
|
4283
|
+
}
|
|
4284
|
+
/**
|
|
4285
|
+
* Adds a customizable icon in the system tray. To listen for a click on the icon use the `tray-icon-clicked` event.
|
|
4286
|
+
* @param icon Image URL or base64 encoded string to be used as the icon
|
|
4287
|
+
*
|
|
4288
|
+
* @example
|
|
4289
|
+
*
|
|
4290
|
+
* ```js
|
|
4291
|
+
* const imageUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
|
|
4292
|
+
* const base64EncodedImage = "iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX\
|
|
4293
|
+
* ///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII";
|
|
4294
|
+
* const dataURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DH\
|
|
4295
|
+
* xgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
|
|
4296
|
+
*
|
|
4297
|
+
* async function setTrayIcon(icon) {
|
|
4298
|
+
* const app = await fin.Application.getCurrent();
|
|
4299
|
+
* return await app.setTrayIcon(icon);
|
|
4300
|
+
* }
|
|
4301
|
+
*
|
|
4302
|
+
* // use image url to set tray icon
|
|
4303
|
+
* setTrayIcon(imageUrl).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
4304
|
+
*
|
|
4305
|
+
* // use base64 encoded string to set tray icon
|
|
4306
|
+
* setTrayIcon(base64EncodedImage).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
4307
|
+
*
|
|
4308
|
+
* // use a dataURL to set tray icon
|
|
4309
|
+
* setTrayIcon(dataURL).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
4310
|
+
* ```
|
|
4311
|
+
*/
|
|
4312
|
+
setTrayIcon(icon) {
|
|
4313
|
+
return this.wire
|
|
4314
|
+
.sendAction('set-tray-icon', {
|
|
4315
|
+
enabledIcon: icon,
|
|
4316
|
+
...this.identity
|
|
4317
|
+
})
|
|
4318
|
+
.then(() => undefined);
|
|
4319
|
+
}
|
|
4320
|
+
/**
|
|
4321
|
+
* Set hover text for this application's system tray icon.
|
|
4322
|
+
* Note: Application must first set a tray icon with {@link Application.setTrayIcon}.
|
|
4323
|
+
* @param toolTip
|
|
4324
|
+
*
|
|
4325
|
+
* @example
|
|
4326
|
+
*
|
|
4327
|
+
* ```js
|
|
4328
|
+
* const app = fin.Application.getCurrentSync();
|
|
4329
|
+
* const iconUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
|
|
4330
|
+
*
|
|
4331
|
+
* await app.setTrayIcon(iconUrl);
|
|
4332
|
+
*
|
|
4333
|
+
* await app.setTrayIconToolTip('My Application');
|
|
4334
|
+
* ```
|
|
4335
|
+
*/
|
|
4336
|
+
async setTrayIconToolTip(toolTip) {
|
|
4337
|
+
await this.wire.sendAction('set-tray-icon-tooltip', { ...this.identity, toolTip });
|
|
4338
|
+
}
|
|
4339
|
+
/**
|
|
4340
|
+
* Sets new application's shortcut configuration. Windows only.
|
|
4341
|
+
* @param config New application's shortcut configuration.
|
|
4342
|
+
*
|
|
4343
|
+
* @remarks Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest
|
|
4344
|
+
* to be able to change shortcut states.
|
|
4345
|
+
*
|
|
4346
|
+
* @example
|
|
4347
|
+
*
|
|
4348
|
+
* ```js
|
|
4349
|
+
* async function setShortcuts(config) {
|
|
4350
|
+
* const app = await fin.Application.getCurrent();
|
|
4351
|
+
* return app.setShortcuts(config);
|
|
4352
|
+
* }
|
|
4353
|
+
*
|
|
4354
|
+
* setShortcuts({
|
|
4355
|
+
* desktop: true,
|
|
4356
|
+
* startMenu: false,
|
|
4357
|
+
* systemStartup: true
|
|
4358
|
+
* }).then(() => console.log('Shortcuts are set.')).catch(err => console.log(err));
|
|
4359
|
+
* ```
|
|
4360
|
+
*/
|
|
4361
|
+
setShortcuts(config) {
|
|
4362
|
+
return this.wire.sendAction('set-shortcuts', { data: config, ...this.identity }).then(() => undefined);
|
|
4363
|
+
}
|
|
4364
|
+
/**
|
|
4365
|
+
* Sets the query string in all shortcuts for this app. Requires RVM 5.5+.
|
|
4366
|
+
* @param queryString The new query string for this app's shortcuts.
|
|
4367
|
+
*
|
|
4368
|
+
* @example
|
|
4369
|
+
*
|
|
4370
|
+
* ```js
|
|
4371
|
+
* const newQueryArgs = 'arg=true&arg2=false';
|
|
4372
|
+
* const app = await fin.Application.getCurrent();
|
|
4373
|
+
* try {
|
|
4374
|
+
* await app.setShortcutQueryParams(newQueryArgs);
|
|
4375
|
+
* } catch(err) {
|
|
4376
|
+
* console.error(err)
|
|
4377
|
+
* }
|
|
4378
|
+
* ```
|
|
4379
|
+
*/
|
|
4380
|
+
async setShortcutQueryParams(queryString) {
|
|
4381
|
+
await this.wire.sendAction('set-shortcut-query-args', { data: queryString, ...this.identity });
|
|
4382
|
+
}
|
|
4383
|
+
/**
|
|
4384
|
+
* Sets the zoom level of the application. The original size is 0 and each increment above or below represents zooming 20%
|
|
4385
|
+
* larger or smaller to default limits of 300% and 50% of original size, respectively.
|
|
4386
|
+
* @param level The zoom level
|
|
4387
|
+
*
|
|
4388
|
+
* @example
|
|
4389
|
+
*
|
|
4390
|
+
* ```js
|
|
4391
|
+
* async function setZoomLevel(number) {
|
|
4392
|
+
* const app = await fin.Application.getCurrent();
|
|
4393
|
+
* return await app.setZoomLevel(number);
|
|
4394
|
+
* }
|
|
4395
|
+
*
|
|
4396
|
+
* setZoomLevel(5).then(() => console.log('Setting a zoom level')).catch(err => console.log(err));
|
|
4397
|
+
* ```
|
|
4398
|
+
*/
|
|
4399
|
+
setZoomLevel(level) {
|
|
4400
|
+
return this.wire.sendAction('set-application-zoom-level', { level, ...this.identity }).then(() => undefined);
|
|
4401
|
+
}
|
|
4402
|
+
/**
|
|
4403
|
+
* Sets a username to correlate with App Log Management.
|
|
4404
|
+
* @param username Username to correlate with App's Log.
|
|
4405
|
+
*
|
|
4406
|
+
* @example
|
|
4407
|
+
*
|
|
4408
|
+
* ```js
|
|
4409
|
+
* async function setAppLogUser() {
|
|
4410
|
+
* const app = await fin.Application.getCurrent();
|
|
4411
|
+
* return await app.setAppLogUsername('username');
|
|
4412
|
+
* }
|
|
4413
|
+
*
|
|
4414
|
+
* setAppLogUser().then(() => console.log('Success')).catch(err => console.log(err));
|
|
4415
|
+
*
|
|
4416
|
+
* ```
|
|
4417
|
+
*/
|
|
4418
|
+
async setAppLogUsername(username) {
|
|
4419
|
+
await this.wire.sendAction('set-app-log-username', { data: username, ...this.identity });
|
|
4420
|
+
}
|
|
4421
|
+
/**
|
|
4422
|
+
* Retrieves information about the system tray. If the system tray is not set, it will throw an error message.
|
|
4423
|
+
* @remarks The only information currently returned is the position and dimensions.
|
|
4424
|
+
*
|
|
4425
|
+
* @example
|
|
4426
|
+
*
|
|
4427
|
+
* ```js
|
|
4428
|
+
* async function getTrayIconInfo() {
|
|
4429
|
+
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
4430
|
+
* return await app.getTrayIconInfo();
|
|
4431
|
+
* }
|
|
4432
|
+
* getTrayIconInfo().then(info => console.log(info)).catch(err => console.log(err));
|
|
4433
|
+
* ```
|
|
4434
|
+
*/
|
|
4435
|
+
getTrayIconInfo() {
|
|
4436
|
+
return this.wire.sendAction('get-tray-icon-info', this.identity).then(({ payload }) => payload.data);
|
|
4437
|
+
}
|
|
4438
|
+
/**
|
|
4439
|
+
* Checks if the application has an associated tray icon.
|
|
4440
|
+
*
|
|
4441
|
+
* @example
|
|
4442
|
+
*
|
|
4443
|
+
* ```js
|
|
4444
|
+
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
4445
|
+
* const hasTrayIcon = await app.hasTrayIcon();
|
|
4446
|
+
* console.log(hasTrayIcon);
|
|
4447
|
+
* ```
|
|
4448
|
+
*/
|
|
4449
|
+
hasTrayIcon() {
|
|
4450
|
+
return this.wire.sendAction('has-tray-icon', this.identity).then(({ payload }) => payload.data);
|
|
4451
|
+
}
|
|
4452
|
+
/**
|
|
4453
|
+
* Closes the application by terminating its process.
|
|
4454
|
+
*
|
|
4455
|
+
* @example
|
|
4456
|
+
*
|
|
4457
|
+
* ```js
|
|
4458
|
+
* async function terminateApp() {
|
|
4459
|
+
* const app = await fin.Application.getCurrent();
|
|
4460
|
+
* return await app.terminate();
|
|
4461
|
+
* }
|
|
4462
|
+
* terminateApp().then(() => console.log('Application terminated')).catch(err => console.log(err));
|
|
4463
|
+
* ```
|
|
4464
|
+
*/
|
|
4465
|
+
terminate() {
|
|
4466
|
+
return this.wire.sendAction('terminate-application', this.identity).then(() => undefined);
|
|
4467
|
+
}
|
|
4468
|
+
/**
|
|
4469
|
+
* Waits for a hanging application. This method can be called in response to an application
|
|
4470
|
+
* "not-responding" to allow the application to continue and to generate another "not-responding"
|
|
4471
|
+
* message after a certain period of time.
|
|
4472
|
+
*
|
|
4473
|
+
* @ignore
|
|
4474
|
+
*/
|
|
4475
|
+
wait() {
|
|
4476
|
+
return this.wire.sendAction('wait-for-hung-application', this.identity).then(() => undefined);
|
|
4477
|
+
}
|
|
4478
|
+
/**
|
|
4479
|
+
* Retrieves information about the application.
|
|
4480
|
+
*
|
|
4481
|
+
* @remarks If the application was not launched from a manifest, the call will return the closest parent application `manifest`
|
|
4482
|
+
* and `manifestUrl`. `initialOptions` shows the parameters used when launched programmatically, or the `startup_app` options
|
|
4483
|
+
* if launched from manifest. The `parentUuid` will be the uuid of the immediate parent (if applicable).
|
|
4484
|
+
*
|
|
4485
|
+
* @example
|
|
4486
|
+
*
|
|
4487
|
+
* ```js
|
|
4488
|
+
* async function getInfo() {
|
|
4489
|
+
* const app = await fin.Application.getCurrent();
|
|
4490
|
+
* return await app.getInfo();
|
|
4491
|
+
* }
|
|
4492
|
+
*
|
|
4493
|
+
* getInfo().then(info => console.log(info)).catch(err => console.log(err));
|
|
4494
|
+
* ```
|
|
4495
|
+
*/
|
|
4496
|
+
getInfo() {
|
|
4497
|
+
return this.wire.sendAction('get-info', this.identity).then(({ payload }) => payload.data);
|
|
4498
|
+
}
|
|
4499
|
+
/**
|
|
4500
|
+
* Retrieves all process information for entities (windows and views) associated with an application.
|
|
4501
|
+
*
|
|
4502
|
+
* @example
|
|
4503
|
+
* ```js
|
|
4504
|
+
* const app = await fin.Application.getCurrent();
|
|
4505
|
+
* const processInfo = await app.getProcessInfo();
|
|
4506
|
+
* ```
|
|
4507
|
+
* @experimental
|
|
4508
|
+
*/
|
|
4509
|
+
async getProcessInfo() {
|
|
4510
|
+
const { payload: { data } } = await this.wire.sendAction('application-get-process-info', this.identity);
|
|
4511
|
+
return data;
|
|
4512
|
+
}
|
|
4513
|
+
/**
|
|
4514
|
+
* Sets file auto download location. It's only allowed in the same application.
|
|
4515
|
+
*
|
|
4516
|
+
* Note: This method is restricted by default and must be enabled via
|
|
4517
|
+
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
4518
|
+
* @param downloadLocation file auto download location
|
|
4519
|
+
*
|
|
4520
|
+
* @throws if setting file auto download location on different applications.
|
|
4521
|
+
* @example
|
|
4522
|
+
*
|
|
4523
|
+
* ```js
|
|
4524
|
+
* const downloadLocation = 'C:\\dev\\temp';
|
|
4525
|
+
* const app = await fin.Application.getCurrent();
|
|
4526
|
+
* try {
|
|
4527
|
+
* await app.setFileDownloadLocation(downloadLocation);
|
|
4528
|
+
* console.log('File download location is set');
|
|
4529
|
+
* } catch(err) {
|
|
4530
|
+
* console.error(err)
|
|
4531
|
+
* }
|
|
4532
|
+
* ```
|
|
4533
|
+
*/
|
|
4534
|
+
async setFileDownloadLocation(downloadLocation) {
|
|
4535
|
+
const { name } = this.wire.me;
|
|
4536
|
+
const entityIdentity = { uuid: this.identity.uuid, name };
|
|
4537
|
+
await this.wire.sendAction('set-file-download-location', { ...entityIdentity, downloadLocation });
|
|
4538
|
+
}
|
|
4539
|
+
/**
|
|
4540
|
+
* 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.
|
|
4541
|
+
*
|
|
4542
|
+
* Note: This method is restricted by default and must be enabled via
|
|
4543
|
+
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
4544
|
+
*
|
|
4545
|
+
* @throws if getting file auto download location on different applications.
|
|
4546
|
+
* @example
|
|
4547
|
+
*
|
|
4548
|
+
* ```js
|
|
4549
|
+
* const app = await fin.Application.getCurrent();
|
|
4550
|
+
* const fileDownloadDir = await app.getFileDownloadLocation();
|
|
4551
|
+
* ```
|
|
4552
|
+
*/
|
|
4553
|
+
async getFileDownloadLocation() {
|
|
4554
|
+
const { payload: { data } } = await this.wire.sendAction('get-file-download-location', this.identity);
|
|
4555
|
+
return data;
|
|
4556
|
+
}
|
|
4557
|
+
/**
|
|
4558
|
+
* Shows a menu on the tray icon. Use with tray-icon-clicked event.
|
|
4559
|
+
* @param options
|
|
4560
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
|
4561
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
|
4562
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
|
4563
|
+
* these with a "reducer" pattern.
|
|
4564
|
+
* @throws if the application has no tray icon set
|
|
4565
|
+
* @throws if the system tray is currently hidden
|
|
4566
|
+
* @example
|
|
4567
|
+
*
|
|
4568
|
+
* ```js
|
|
4569
|
+
* const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
|
|
4570
|
+
* const app = fin.Application.getCurrentSync();
|
|
4571
|
+
*
|
|
4572
|
+
* await app.setTrayIcon(iconUrl);
|
|
4573
|
+
*
|
|
4574
|
+
* const template = [
|
|
4575
|
+
* {
|
|
4576
|
+
* label: 'Menu Item 1',
|
|
4577
|
+
* data: 'hello from item 1'
|
|
4578
|
+
* },
|
|
4579
|
+
* { type: 'separator' },
|
|
4580
|
+
* {
|
|
4581
|
+
* label: 'Menu Item 2',
|
|
4582
|
+
* type: 'checkbox',
|
|
4583
|
+
* checked: true,
|
|
4584
|
+
* data: 'The user clicked the checkbox'
|
|
4585
|
+
* },
|
|
4586
|
+
* {
|
|
4587
|
+
* label: 'see more',
|
|
4588
|
+
* enabled: false,
|
|
4589
|
+
* submenu: [
|
|
4590
|
+
* { label: 'submenu 1', data: 'hello from submenu' }
|
|
4591
|
+
* ]
|
|
4592
|
+
* }
|
|
4593
|
+
* ];
|
|
4594
|
+
*
|
|
4595
|
+
* app.addListener('tray-icon-clicked', (event) => {
|
|
4596
|
+
* // right-click
|
|
4597
|
+
* if (event.button === 2) {
|
|
4598
|
+
* app.showTrayIconPopupMenu({ template }).then(r => {
|
|
4599
|
+
* if (r.result === 'closed') {
|
|
4600
|
+
* console.log('nothing happened');
|
|
4601
|
+
* } else {
|
|
4602
|
+
* console.log(r.data);
|
|
4603
|
+
* }
|
|
4604
|
+
* });
|
|
4605
|
+
* }
|
|
4606
|
+
* });
|
|
4607
|
+
* ```
|
|
4608
|
+
*/
|
|
4609
|
+
async showTrayIconPopupMenu(options) {
|
|
4610
|
+
const { name } = this.wire.me;
|
|
4611
|
+
const entityIdentity = { uuid: this.identity.uuid, name };
|
|
4612
|
+
const { payload } = await this.wire.sendAction('show-tray-icon-popup-menu', { ...entityIdentity, options });
|
|
4613
|
+
return payload.data;
|
|
4614
|
+
}
|
|
4615
|
+
/**
|
|
4616
|
+
* Closes the tray icon menu.
|
|
4617
|
+
*
|
|
4618
|
+
* @throws if the application has no tray icon set
|
|
4619
|
+
* @example
|
|
4620
|
+
*
|
|
4621
|
+
* ```js
|
|
4622
|
+
* const app = fin.Application.getCurrentSync();
|
|
4623
|
+
*
|
|
4624
|
+
* await app.closeTrayIconPopupMenu();
|
|
4625
|
+
* ```
|
|
4626
|
+
*/
|
|
4627
|
+
async closeTrayIconPopupMenu() {
|
|
4628
|
+
const { name } = this.wire.me;
|
|
4629
|
+
const entityIdentity = { uuid: this.identity.uuid, name };
|
|
4630
|
+
await this.wire.sendAction('close-tray-icon-popup-menu', { ...entityIdentity });
|
|
4631
|
+
}
|
|
4632
|
+
}
|
|
4633
|
+
Instance$5.Application = Application;
|
|
4634
|
+
|
|
4635
|
+
Object.defineProperty(Factory$6, "__esModule", { value: true });
|
|
4636
|
+
Factory$6.ApplicationModule = void 0;
|
|
4637
|
+
const base_1$m = base;
|
|
4638
|
+
const validate_1$4 = validate;
|
|
4639
|
+
const Instance_1$5 = Instance$5;
|
|
4640
|
+
/**
|
|
4641
|
+
* Static namespace for OpenFin API methods that interact with the {@link Application} class, available under `fin.Application`.
|
|
4642
|
+
*/
|
|
4643
|
+
class ApplicationModule extends base_1$m.Base {
|
|
4644
|
+
/**
|
|
4645
|
+
* Asynchronously returns an API handle for the given Application identity.
|
|
4646
|
+
*
|
|
4647
|
+
* @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
|
|
4648
|
+
* returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
|
|
4649
|
+
* for an Application throughout its entire lifecycle.
|
|
4650
|
+
*
|
|
4651
|
+
* @example
|
|
4652
|
+
*
|
|
4653
|
+
* ```js
|
|
4654
|
+
* fin.Application.wrap({ uuid: 'testapp' })
|
|
4655
|
+
* .then(app => app.isRunning())
|
|
4656
|
+
* .then(running => console.log('Application is running: ' + running))
|
|
4657
|
+
* .catch(err => console.log(err));
|
|
4658
|
+
* ```
|
|
4659
|
+
*
|
|
4660
|
+
*/
|
|
4661
|
+
async wrap(identity) {
|
|
4662
|
+
this.wire.sendAction('wrap-application').catch((e) => {
|
|
4663
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4664
|
+
});
|
|
4665
|
+
const errorMsg = (0, validate_1$4.validateIdentity)(identity);
|
|
4666
|
+
if (errorMsg) {
|
|
4667
|
+
throw new Error(errorMsg);
|
|
4668
|
+
}
|
|
4669
|
+
return new Instance_1$5.Application(this.wire, identity);
|
|
4670
|
+
}
|
|
4671
|
+
/**
|
|
4672
|
+
* Synchronously 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 Aplication throughout its entire lifecycle.
|
|
4677
|
+
*
|
|
4678
|
+
* @example
|
|
4679
|
+
*
|
|
4680
|
+
* ```js
|
|
4681
|
+
* const app = fin.Application.wrapSync({ uuid: 'testapp' });
|
|
4682
|
+
* await app.close();
|
|
4683
|
+
* ```
|
|
4684
|
+
*
|
|
4685
|
+
*/
|
|
4686
|
+
wrapSync(identity) {
|
|
4687
|
+
this.wire.sendAction('wrap-application-sync').catch((e) => {
|
|
4688
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4689
|
+
});
|
|
4690
|
+
const errorMsg = (0, validate_1$4.validateIdentity)(identity);
|
|
4691
|
+
if (errorMsg) {
|
|
4692
|
+
throw new Error(errorMsg);
|
|
4693
|
+
}
|
|
4694
|
+
return new Instance_1$5.Application(this.wire, identity);
|
|
4695
|
+
}
|
|
4696
|
+
async _create(appOptions) {
|
|
4697
|
+
// set defaults:
|
|
4698
|
+
if (appOptions.waitForPageLoad === undefined) {
|
|
4699
|
+
appOptions.waitForPageLoad = false;
|
|
4700
|
+
}
|
|
4701
|
+
if (appOptions.autoShow === undefined && appOptions.isPlatformController === undefined) {
|
|
4702
|
+
appOptions.autoShow = true;
|
|
4703
|
+
}
|
|
4704
|
+
await this.wire.sendAction('create-application', appOptions);
|
|
4705
|
+
return this.wrap({ uuid: appOptions.uuid });
|
|
4706
|
+
}
|
|
4707
|
+
/**
|
|
4708
|
+
* DEPRECATED method to create a new Application. Use {@link Application.ApplicationModule.start Application.start} instead.
|
|
4709
|
+
*
|
|
4710
|
+
* @example
|
|
4711
|
+
*
|
|
4712
|
+
* ```js
|
|
4713
|
+
* async function createApp() {
|
|
4714
|
+
* const app = await fin.Application.create({
|
|
4715
|
+
* name: 'myApp',
|
|
4716
|
+
* uuid: 'app-3',
|
|
4717
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.create.html',
|
|
4718
|
+
* autoShow: true
|
|
4719
|
+
* });
|
|
4720
|
+
* await app.run();
|
|
4721
|
+
* }
|
|
4722
|
+
*
|
|
4723
|
+
* createApp().then(() => console.log('Application is created')).catch(err => console.log(err));
|
|
4724
|
+
* ```
|
|
4725
|
+
*
|
|
4726
|
+
* @ignore
|
|
4727
|
+
*/
|
|
4728
|
+
create(appOptions) {
|
|
4729
|
+
console.warn('Deprecation Warning: fin.Application.create is deprecated. Please use fin.Application.start');
|
|
4730
|
+
this.wire.sendAction('application-create').catch((e) => {
|
|
4731
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4732
|
+
});
|
|
4733
|
+
return this._create(appOptions);
|
|
4734
|
+
}
|
|
4735
|
+
/**
|
|
4736
|
+
* Creates and starts a new Application.
|
|
4737
|
+
*
|
|
4738
|
+
* @example
|
|
4739
|
+
*
|
|
4740
|
+
* ```js
|
|
4741
|
+
* async function start() {
|
|
4742
|
+
* return fin.Application.start({
|
|
4743
|
+
* name: 'app-1',
|
|
4744
|
+
* uuid: 'app-1',
|
|
4745
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.start.html',
|
|
4746
|
+
* autoShow: true
|
|
4747
|
+
* });
|
|
4748
|
+
* }
|
|
4749
|
+
* start().then(() => console.log('Application is running')).catch(err => console.log(err));
|
|
4750
|
+
* ```
|
|
4751
|
+
*
|
|
4752
|
+
*/
|
|
4753
|
+
async start(appOptions) {
|
|
4754
|
+
this.wire.sendAction('start-application').catch((e) => {
|
|
4755
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4756
|
+
});
|
|
4757
|
+
const app = await this._create(appOptions);
|
|
4758
|
+
await this.wire.sendAction('run-application', { uuid: appOptions.uuid });
|
|
4759
|
+
return app;
|
|
4760
|
+
}
|
|
4761
|
+
/**
|
|
4762
|
+
* Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls.
|
|
4763
|
+
* Returns once the RVM is finished attempting to launch the applications.
|
|
4764
|
+
* @param opts - Parameters that the RVM will use.
|
|
4765
|
+
*
|
|
4766
|
+
* @example
|
|
4767
|
+
*
|
|
4768
|
+
* ```js
|
|
4769
|
+
*
|
|
4770
|
+
* const applicationInfoArray = [
|
|
4771
|
+
* {
|
|
4772
|
+
* "uuid": 'App-1',
|
|
4773
|
+
* "manifestUrl": 'http://localhost:5555/app1.json',
|
|
4774
|
+
* },
|
|
4775
|
+
* {
|
|
4776
|
+
* "uuid": 'App-2',
|
|
4777
|
+
* "manifestUrl": 'http://localhost:5555/app2.json',
|
|
4778
|
+
* },
|
|
4779
|
+
* {
|
|
4780
|
+
* "uuid": 'App-3',
|
|
4781
|
+
* "manifestUrl": 'http://localhost:5555/app3.json',
|
|
4782
|
+
* }
|
|
4783
|
+
* ]
|
|
4784
|
+
*
|
|
4785
|
+
* fin.Application.startManyManifests(applicationInfoArray)
|
|
4786
|
+
* .then(() => {
|
|
4787
|
+
* console.log('RVM has finished launching the application list.');
|
|
4788
|
+
* })
|
|
4789
|
+
* .catch((err) => {
|
|
4790
|
+
* console.log(err);
|
|
4791
|
+
* })
|
|
4792
|
+
* ```
|
|
4793
|
+
*
|
|
4794
|
+
* @experimental
|
|
4795
|
+
*/
|
|
4796
|
+
async startManyManifests(applications, opts) {
|
|
4797
|
+
return this.wire.sendAction('run-applications', { applications, opts }).then(() => undefined);
|
|
4798
|
+
}
|
|
4799
|
+
/**
|
|
4800
|
+
* Asynchronously returns an Application object that represents the current application
|
|
4801
|
+
*
|
|
4802
|
+
* @example
|
|
4803
|
+
*
|
|
4804
|
+
* ```js
|
|
4805
|
+
* async function isCurrentAppRunning () {
|
|
4806
|
+
* const app = await fin.Application.getCurrent();
|
|
4807
|
+
* return app.isRunning();
|
|
4808
|
+
* }
|
|
4809
|
+
*
|
|
4810
|
+
* isCurrentAppRunning().then(running => {
|
|
4811
|
+
* console.log(`Current app is running: ${running}`);
|
|
4812
|
+
* }).catch(err => {
|
|
4813
|
+
* console.error(err);
|
|
4814
|
+
* });
|
|
4815
|
+
*
|
|
4816
|
+
* ```
|
|
4817
|
+
*/
|
|
4818
|
+
getCurrent() {
|
|
4819
|
+
this.wire.sendAction('get-current-application').catch((e) => {
|
|
4820
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4821
|
+
});
|
|
4822
|
+
return this.wrap({ uuid: this.wire.me.uuid });
|
|
4823
|
+
}
|
|
4824
|
+
/**
|
|
4825
|
+
* Synchronously returns an Application object that represents the current application
|
|
4826
|
+
*
|
|
4827
|
+
* @example
|
|
4828
|
+
*
|
|
4829
|
+
* ```js
|
|
4830
|
+
* async function isCurrentAppRunning () {
|
|
4831
|
+
* const app = fin.Application.getCurrentSync();
|
|
4832
|
+
* return app.isRunning();
|
|
4833
|
+
* }
|
|
4834
|
+
*
|
|
4835
|
+
* isCurrentAppRunning().then(running => {
|
|
4836
|
+
* console.log(`Current app is running: ${running}`);
|
|
4837
|
+
* }).catch(err => {
|
|
4838
|
+
* console.error(err);
|
|
4839
|
+
* });
|
|
4840
|
+
*
|
|
4841
|
+
* ```
|
|
4842
|
+
*/
|
|
4843
|
+
getCurrentSync() {
|
|
4844
|
+
this.wire.sendAction('get-current-application-sync').catch((e) => {
|
|
4845
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4846
|
+
});
|
|
4847
|
+
return this.wrapSync({ uuid: this.wire.me.uuid });
|
|
4848
|
+
}
|
|
4849
|
+
/**
|
|
4850
|
+
* Retrieves application's manifest and returns a running instance of the application.
|
|
4851
|
+
* @param manifestUrl - The URL of app's manifest.
|
|
4852
|
+
* @param opts - Parameters that the RVM will use.
|
|
4853
|
+
*
|
|
4854
|
+
* @example
|
|
4855
|
+
*
|
|
4856
|
+
* ```js
|
|
4857
|
+
* fin.Application.startFromManifest('http://localhost:5555/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
|
|
4858
|
+
*
|
|
4859
|
+
* // For a local manifest file:
|
|
4860
|
+
* fin.Application.startFromManifest('file:///C:/somefolder/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
|
|
4861
|
+
* ```
|
|
4862
|
+
*/
|
|
4863
|
+
async startFromManifest(manifestUrl, opts) {
|
|
4864
|
+
this.wire.sendAction('application-start-from-manifest').catch((e) => {
|
|
4865
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4866
|
+
});
|
|
4867
|
+
const app = await this._createFromManifest(manifestUrl);
|
|
4868
|
+
// @ts-expect-error using private method without warning.
|
|
4869
|
+
await app._run(opts); // eslint-disable-line no-underscore-dangle
|
|
4870
|
+
return app;
|
|
4871
|
+
}
|
|
4872
|
+
/**
|
|
4873
|
+
* @deprecated Use {@link Application.ApplicationModule.startFromManifest Application.startFromManifest} instead.
|
|
4874
|
+
* Retrieves application's manifest and returns a wrapped application.
|
|
4875
|
+
* @param manifestUrl - The URL of app's manifest.
|
|
4876
|
+
* @param callback - called if the method succeeds.
|
|
4877
|
+
* @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
|
|
4878
|
+
*
|
|
4879
|
+
* @example
|
|
4880
|
+
*
|
|
4881
|
+
* ```js
|
|
4882
|
+
* fin.Application.createFromManifest('http://localhost:5555/app.json').then(app => console.log(app)).catch(err => console.log(err));
|
|
4883
|
+
* ```
|
|
4884
|
+
* @ignore
|
|
4885
|
+
*/
|
|
4886
|
+
createFromManifest(manifestUrl) {
|
|
4887
|
+
console.warn('Deprecation Warning: fin.Application.createFromManifest is deprecated. Please use fin.Application.startFromManifest');
|
|
4888
|
+
this.wire.sendAction('application-create-from-manifest').catch((e) => {
|
|
4889
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4890
|
+
});
|
|
4891
|
+
return this._createFromManifest(manifestUrl);
|
|
4892
|
+
}
|
|
4893
|
+
_createFromManifest(manifestUrl) {
|
|
4894
|
+
return this.wire
|
|
4895
|
+
.sendAction('get-application-manifest', { manifestUrl })
|
|
4896
|
+
.then(({ payload }) => {
|
|
4897
|
+
const uuid = payload.data.platform ? payload.data.platform.uuid : payload.data.startup_app.uuid;
|
|
4898
|
+
return this.wrap({ uuid });
|
|
4899
|
+
})
|
|
4900
|
+
.then((app) => {
|
|
4901
|
+
app._manifestUrl = manifestUrl; // eslint-disable-line no-underscore-dangle
|
|
4902
|
+
return app;
|
|
4903
|
+
});
|
|
4904
|
+
}
|
|
4640
4905
|
}
|
|
4906
|
+
Factory$6.ApplicationModule = ApplicationModule;
|
|
4641
4907
|
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4908
|
+
(function (exports) {
|
|
4909
|
+
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4910
|
+
if (k2 === undefined) k2 = k;
|
|
4911
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4912
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
4913
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
4914
|
+
}
|
|
4915
|
+
Object.defineProperty(o, k2, desc);
|
|
4916
|
+
}) : (function(o, m, k, k2) {
|
|
4917
|
+
if (k2 === undefined) k2 = k;
|
|
4918
|
+
o[k2] = m[k];
|
|
4919
|
+
}));
|
|
4920
|
+
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
4921
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
4922
|
+
};
|
|
4923
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4652
4924
|
/**
|
|
4653
|
-
*
|
|
4925
|
+
* Entry points for the OpenFin `Application` API (`fin.Application`).
|
|
4926
|
+
*
|
|
4927
|
+
* * {@link ApplicationModule} contains static members of the `Application` API, accessible through `fin.Application`.
|
|
4928
|
+
* * {@link Application} describes an instance of an OpenFin Application, e.g. as returned by `fin.Application.getCurrent`.
|
|
4929
|
+
*
|
|
4930
|
+
* 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),
|
|
4931
|
+
* both of these were documented on the same page.
|
|
4932
|
+
*
|
|
4933
|
+
* @packageDocumentation
|
|
4654
4934
|
*/
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
*
|
|
4659
|
-
* @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
|
|
4660
|
-
* returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
|
|
4661
|
-
* for an Application throughout its entire lifecycle.
|
|
4662
|
-
*
|
|
4663
|
-
* @example
|
|
4664
|
-
*
|
|
4665
|
-
* ```js
|
|
4666
|
-
* fin.Application.wrap({ uuid: 'testapp' })
|
|
4667
|
-
* .then(app => app.isRunning())
|
|
4668
|
-
* .then(running => console.log('Application is running: ' + running))
|
|
4669
|
-
* .catch(err => console.log(err));
|
|
4670
|
-
* ```
|
|
4671
|
-
*
|
|
4672
|
-
*/
|
|
4673
|
-
async wrap(identity) {
|
|
4674
|
-
this.wire.sendAction('wrap-application').catch((e) => {
|
|
4675
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4676
|
-
});
|
|
4677
|
-
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
4678
|
-
if (errorMsg) {
|
|
4679
|
-
throw new Error(errorMsg);
|
|
4680
|
-
}
|
|
4681
|
-
return new Instance_1.Application(this.wire, identity);
|
|
4682
|
-
}
|
|
4683
|
-
/**
|
|
4684
|
-
* Synchronously returns an API handle for the given Application identity.
|
|
4685
|
-
*
|
|
4686
|
-
* @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
|
|
4687
|
-
* returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
|
|
4688
|
-
* for an Aplication throughout its entire lifecycle.
|
|
4689
|
-
*
|
|
4690
|
-
* @example
|
|
4691
|
-
*
|
|
4692
|
-
* ```js
|
|
4693
|
-
* const app = fin.Application.wrapSync({ uuid: 'testapp' });
|
|
4694
|
-
* await app.close();
|
|
4695
|
-
* ```
|
|
4696
|
-
*
|
|
4697
|
-
*/
|
|
4698
|
-
wrapSync(identity) {
|
|
4699
|
-
this.wire.sendAction('wrap-application-sync').catch((e) => {
|
|
4700
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4701
|
-
});
|
|
4702
|
-
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
4703
|
-
if (errorMsg) {
|
|
4704
|
-
throw new Error(errorMsg);
|
|
4705
|
-
}
|
|
4706
|
-
return new Instance_1.Application(this.wire, identity);
|
|
4707
|
-
}
|
|
4708
|
-
async _create(appOptions) {
|
|
4709
|
-
// set defaults:
|
|
4710
|
-
if (appOptions.waitForPageLoad === undefined) {
|
|
4711
|
-
appOptions.waitForPageLoad = false;
|
|
4712
|
-
}
|
|
4713
|
-
if (appOptions.autoShow === undefined && appOptions.isPlatformController === undefined) {
|
|
4714
|
-
appOptions.autoShow = true;
|
|
4715
|
-
}
|
|
4716
|
-
await this.wire.sendAction('create-application', appOptions);
|
|
4717
|
-
return this.wrap({ uuid: appOptions.uuid });
|
|
4718
|
-
}
|
|
4719
|
-
/**
|
|
4720
|
-
* DEPRECATED method to create a new Application. Use {@link Application.ApplicationModule.start Application.start} instead.
|
|
4721
|
-
*
|
|
4722
|
-
* @example
|
|
4723
|
-
*
|
|
4724
|
-
* ```js
|
|
4725
|
-
* async function createApp() {
|
|
4726
|
-
* const app = await fin.Application.create({
|
|
4727
|
-
* name: 'myApp',
|
|
4728
|
-
* uuid: 'app-3',
|
|
4729
|
-
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.create.html',
|
|
4730
|
-
* autoShow: true
|
|
4731
|
-
* });
|
|
4732
|
-
* await app.run();
|
|
4733
|
-
* }
|
|
4734
|
-
*
|
|
4735
|
-
* createApp().then(() => console.log('Application is created')).catch(err => console.log(err));
|
|
4736
|
-
* ```
|
|
4737
|
-
*
|
|
4738
|
-
* @ignore
|
|
4739
|
-
*/
|
|
4740
|
-
create(appOptions) {
|
|
4741
|
-
console.warn('Deprecation Warning: fin.Application.create is deprecated. Please use fin.Application.start');
|
|
4742
|
-
this.wire.sendAction('application-create').catch((e) => {
|
|
4743
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4744
|
-
});
|
|
4745
|
-
return this._create(appOptions);
|
|
4746
|
-
}
|
|
4747
|
-
/**
|
|
4748
|
-
* Creates and starts a new Application.
|
|
4749
|
-
*
|
|
4750
|
-
* @example
|
|
4751
|
-
*
|
|
4752
|
-
* ```js
|
|
4753
|
-
* async function start() {
|
|
4754
|
-
* return fin.Application.start({
|
|
4755
|
-
* name: 'app-1',
|
|
4756
|
-
* uuid: 'app-1',
|
|
4757
|
-
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.start.html',
|
|
4758
|
-
* autoShow: true
|
|
4759
|
-
* });
|
|
4760
|
-
* }
|
|
4761
|
-
* start().then(() => console.log('Application is running')).catch(err => console.log(err));
|
|
4762
|
-
* ```
|
|
4763
|
-
*
|
|
4764
|
-
*/
|
|
4765
|
-
async start(appOptions) {
|
|
4766
|
-
this.wire.sendAction('start-application').catch((e) => {
|
|
4767
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4768
|
-
});
|
|
4769
|
-
const app = await this._create(appOptions);
|
|
4770
|
-
await this.wire.sendAction('run-application', { uuid: appOptions.uuid });
|
|
4771
|
-
return app;
|
|
4772
|
-
}
|
|
4773
|
-
/**
|
|
4774
|
-
* Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls.
|
|
4775
|
-
* Returns once the RVM is finished attempting to launch the applications.
|
|
4776
|
-
* @param opts - Parameters that the RVM will use.
|
|
4777
|
-
*
|
|
4778
|
-
* @example
|
|
4779
|
-
*
|
|
4780
|
-
* ```js
|
|
4781
|
-
*
|
|
4782
|
-
* const applicationInfoArray = [
|
|
4783
|
-
* {
|
|
4784
|
-
* "uuid": 'App-1',
|
|
4785
|
-
* "manifestUrl": 'http://localhost:5555/app1.json',
|
|
4786
|
-
* },
|
|
4787
|
-
* {
|
|
4788
|
-
* "uuid": 'App-2',
|
|
4789
|
-
* "manifestUrl": 'http://localhost:5555/app2.json',
|
|
4790
|
-
* },
|
|
4791
|
-
* {
|
|
4792
|
-
* "uuid": 'App-3',
|
|
4793
|
-
* "manifestUrl": 'http://localhost:5555/app3.json',
|
|
4794
|
-
* }
|
|
4795
|
-
* ]
|
|
4796
|
-
*
|
|
4797
|
-
* fin.Application.startManyManifests(applicationInfoArray)
|
|
4798
|
-
* .then(() => {
|
|
4799
|
-
* console.log('RVM has finished launching the application list.');
|
|
4800
|
-
* })
|
|
4801
|
-
* .catch((err) => {
|
|
4802
|
-
* console.log(err);
|
|
4803
|
-
* })
|
|
4804
|
-
* ```
|
|
4805
|
-
*
|
|
4806
|
-
* @experimental
|
|
4807
|
-
*/
|
|
4808
|
-
async startManyManifests(applications, opts) {
|
|
4809
|
-
return this.wire.sendAction('run-applications', { applications, opts }).then(() => undefined);
|
|
4810
|
-
}
|
|
4811
|
-
/**
|
|
4812
|
-
* Asynchronously returns an Application object that represents the current application
|
|
4813
|
-
*
|
|
4814
|
-
* @example
|
|
4815
|
-
*
|
|
4816
|
-
* ```js
|
|
4817
|
-
* async function isCurrentAppRunning () {
|
|
4818
|
-
* const app = await fin.Application.getCurrent();
|
|
4819
|
-
* return app.isRunning();
|
|
4820
|
-
* }
|
|
4821
|
-
*
|
|
4822
|
-
* isCurrentAppRunning().then(running => {
|
|
4823
|
-
* console.log(`Current app is running: ${running}`);
|
|
4824
|
-
* }).catch(err => {
|
|
4825
|
-
* console.error(err);
|
|
4826
|
-
* });
|
|
4827
|
-
*
|
|
4828
|
-
* ```
|
|
4829
|
-
*/
|
|
4830
|
-
getCurrent() {
|
|
4831
|
-
this.wire.sendAction('get-current-application').catch((e) => {
|
|
4832
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4833
|
-
});
|
|
4834
|
-
return this.wrap({ uuid: this.wire.me.uuid });
|
|
4835
|
-
}
|
|
4836
|
-
/**
|
|
4837
|
-
* Synchronously returns an Application object that represents the current application
|
|
4838
|
-
*
|
|
4839
|
-
* @example
|
|
4840
|
-
*
|
|
4841
|
-
* ```js
|
|
4842
|
-
* async function isCurrentAppRunning () {
|
|
4843
|
-
* const app = fin.Application.getCurrentSync();
|
|
4844
|
-
* return app.isRunning();
|
|
4845
|
-
* }
|
|
4846
|
-
*
|
|
4847
|
-
* isCurrentAppRunning().then(running => {
|
|
4848
|
-
* console.log(`Current app is running: ${running}`);
|
|
4849
|
-
* }).catch(err => {
|
|
4850
|
-
* console.error(err);
|
|
4851
|
-
* });
|
|
4852
|
-
*
|
|
4853
|
-
* ```
|
|
4854
|
-
*/
|
|
4855
|
-
getCurrentSync() {
|
|
4856
|
-
this.wire.sendAction('get-current-application-sync').catch((e) => {
|
|
4857
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4858
|
-
});
|
|
4859
|
-
return this.wrapSync({ uuid: this.wire.me.uuid });
|
|
4860
|
-
}
|
|
4861
|
-
/**
|
|
4862
|
-
* Retrieves application's manifest and returns a running instance of the application.
|
|
4863
|
-
* @param manifestUrl - The URL of app's manifest.
|
|
4864
|
-
* @param opts - Parameters that the RVM will use.
|
|
4865
|
-
*
|
|
4866
|
-
* @example
|
|
4867
|
-
*
|
|
4868
|
-
* ```js
|
|
4869
|
-
* fin.Application.startFromManifest('http://localhost:5555/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
|
|
4870
|
-
*
|
|
4871
|
-
* // For a local manifest file:
|
|
4872
|
-
* fin.Application.startFromManifest('file:///C:/somefolder/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
|
|
4873
|
-
* ```
|
|
4874
|
-
*/
|
|
4875
|
-
async startFromManifest(manifestUrl, opts) {
|
|
4876
|
-
this.wire.sendAction('application-start-from-manifest').catch((e) => {
|
|
4877
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4878
|
-
});
|
|
4879
|
-
const app = await this._createFromManifest(manifestUrl);
|
|
4880
|
-
// @ts-expect-error using private method without warning.
|
|
4881
|
-
await app._run(opts); // eslint-disable-line no-underscore-dangle
|
|
4882
|
-
return app;
|
|
4883
|
-
}
|
|
4884
|
-
/**
|
|
4885
|
-
* @deprecated Use {@link Application.ApplicationModule.startFromManifest Application.startFromManifest} instead.
|
|
4886
|
-
* Retrieves application's manifest and returns a wrapped application.
|
|
4887
|
-
* @param manifestUrl - The URL of app's manifest.
|
|
4888
|
-
* @param callback - called if the method succeeds.
|
|
4889
|
-
* @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
|
|
4890
|
-
*
|
|
4891
|
-
* @example
|
|
4892
|
-
*
|
|
4893
|
-
* ```js
|
|
4894
|
-
* fin.Application.createFromManifest('http://localhost:5555/app.json').then(app => console.log(app)).catch(err => console.log(err));
|
|
4895
|
-
* ```
|
|
4896
|
-
* @ignore
|
|
4897
|
-
*/
|
|
4898
|
-
createFromManifest(manifestUrl) {
|
|
4899
|
-
console.warn('Deprecation Warning: fin.Application.createFromManifest is deprecated. Please use fin.Application.startFromManifest');
|
|
4900
|
-
this.wire.sendAction('application-create-from-manifest').catch((e) => {
|
|
4901
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4902
|
-
});
|
|
4903
|
-
return this._createFromManifest(manifestUrl);
|
|
4904
|
-
}
|
|
4905
|
-
_createFromManifest(manifestUrl) {
|
|
4906
|
-
return this.wire
|
|
4907
|
-
.sendAction('get-application-manifest', { manifestUrl })
|
|
4908
|
-
.then(({ payload }) => {
|
|
4909
|
-
const uuid = payload.data.platform ? payload.data.platform.uuid : payload.data.startup_app.uuid;
|
|
4910
|
-
return this.wrap({ uuid });
|
|
4911
|
-
})
|
|
4912
|
-
.then((app) => {
|
|
4913
|
-
app._manifestUrl = manifestUrl; // eslint-disable-line no-underscore-dangle
|
|
4914
|
-
return app;
|
|
4915
|
-
});
|
|
4916
|
-
}
|
|
4917
|
-
}
|
|
4918
|
-
Factory$6.ApplicationModule = ApplicationModule;
|
|
4919
|
-
return Factory$6;
|
|
4920
|
-
}
|
|
4921
|
-
|
|
4922
|
-
var hasRequiredApplication;
|
|
4923
|
-
|
|
4924
|
-
function requireApplication () {
|
|
4925
|
-
if (hasRequiredApplication) return application;
|
|
4926
|
-
hasRequiredApplication = 1;
|
|
4927
|
-
(function (exports) {
|
|
4928
|
-
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4929
|
-
if (k2 === undefined) k2 = k;
|
|
4930
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4931
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
4932
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
4933
|
-
}
|
|
4934
|
-
Object.defineProperty(o, k2, desc);
|
|
4935
|
-
}) : (function(o, m, k, k2) {
|
|
4936
|
-
if (k2 === undefined) k2 = k;
|
|
4937
|
-
o[k2] = m[k];
|
|
4938
|
-
}));
|
|
4939
|
-
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
4940
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
4941
|
-
};
|
|
4942
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4943
|
-
/**
|
|
4944
|
-
* Entry points for the OpenFin `Application` API (`fin.Application`).
|
|
4945
|
-
*
|
|
4946
|
-
* * {@link ApplicationModule} contains static members of the `Application` API, accessible through `fin.Application`.
|
|
4947
|
-
* * {@link Application} describes an instance of an OpenFin Application, e.g. as returned by `fin.Application.getCurrent`.
|
|
4948
|
-
*
|
|
4949
|
-
* 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),
|
|
4950
|
-
* both of these were documented on the same page.
|
|
4951
|
-
*
|
|
4952
|
-
* @packageDocumentation
|
|
4953
|
-
*/
|
|
4954
|
-
__exportStar(requireFactory$1(), exports);
|
|
4955
|
-
__exportStar(requireInstance$2(), exports);
|
|
4956
|
-
} (application));
|
|
4957
|
-
return application;
|
|
4958
|
-
}
|
|
4935
|
+
__exportStar(Factory$6, exports);
|
|
4936
|
+
__exportStar(Instance$5, exports);
|
|
4937
|
+
} (application));
|
|
4959
4938
|
|
|
4960
4939
|
var promisifySubscription$1 = {};
|
|
4961
4940
|
|
|
@@ -4999,7 +4978,7 @@ function requireInstance$1 () {
|
|
|
4999
4978
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
5000
4979
|
/* eslint-disable no-console */
|
|
5001
4980
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
5002
|
-
const application_1 =
|
|
4981
|
+
const application_1 = application;
|
|
5003
4982
|
const main_1 = main;
|
|
5004
4983
|
const view_1 = requireView();
|
|
5005
4984
|
const warnings_1 = warnings;
|
|
@@ -6288,9 +6267,20 @@ function requireInstance$1 () {
|
|
|
6288
6267
|
* @returns {Promise<void>}
|
|
6289
6268
|
* A promise that resolves once the request to show the download bubble
|
|
6290
6269
|
* has been processed.
|
|
6270
|
+
* @example
|
|
6271
|
+
* ```js
|
|
6272
|
+
* const w = fin.Window.getCurrentSync();
|
|
6273
|
+
* const el = document.getElementById("download-bubble-button");
|
|
6274
|
+
* const rect = el.getBoundingClientRect();
|
|
6275
|
+
* const anchor = {
|
|
6276
|
+
* bounds: rect,
|
|
6277
|
+
* location: "topRight"
|
|
6278
|
+
* };
|
|
6279
|
+
* w.showDownloadBubble(anchor);
|
|
6280
|
+
* ```
|
|
6291
6281
|
*/
|
|
6292
|
-
async showDownloadBubble(
|
|
6293
|
-
return this.wire.sendAction('show-download-bubble', { ...this.identity,
|
|
6282
|
+
async showDownloadBubble(anchor) {
|
|
6283
|
+
return this.wire.sendAction('show-download-bubble', { ...this.identity, anchor }).then(() => undefined);
|
|
6294
6284
|
}
|
|
6295
6285
|
/**
|
|
6296
6286
|
* Updates the anchor used for positioning the download bubble. This allows
|
|
@@ -6303,10 +6293,29 @@ function requireInstance$1 () {
|
|
|
6303
6293
|
*
|
|
6304
6294
|
* @returns {Promise<void>}
|
|
6305
6295
|
* A promise that resolves once the anchor update has been applied.
|
|
6296
|
+
* @example
|
|
6297
|
+
* ```js
|
|
6298
|
+
* var w = fin.Window.getCurrentSync();
|
|
6299
|
+
* w.on('download-button-visibility-changed', (evt) => {
|
|
6300
|
+
* if (evt.visible) {
|
|
6301
|
+
* const el = document.getElementById("download-bubble-button");
|
|
6302
|
+
* //We show our button and get it's bounding rect
|
|
6303
|
+
* el.classList.remove("hidden");
|
|
6304
|
+
* const rect = el.getBoundingClientRect();
|
|
6305
|
+
* const anchor = {
|
|
6306
|
+
* bounds: rect,
|
|
6307
|
+
* location: "topRight"
|
|
6308
|
+
* }
|
|
6309
|
+
* w.updateDownloadBubbleAnchor(anchor);
|
|
6310
|
+
* } else {
|
|
6311
|
+
* //We hide our button
|
|
6312
|
+
* document.getElementById("download-bubble-button")?.classList.add("hidden");
|
|
6313
|
+
* }
|
|
6314
|
+
});
|
|
6306
6315
|
*/
|
|
6307
|
-
async updateDownloadBubbleAnchor(
|
|
6316
|
+
async updateDownloadBubbleAnchor(anchor) {
|
|
6308
6317
|
return this.wire
|
|
6309
|
-
.sendAction('update-download-bubble-anchor', { ...this.identity,
|
|
6318
|
+
.sendAction('update-download-bubble-anchor', { ...this.identity, anchor })
|
|
6310
6319
|
.then(() => undefined);
|
|
6311
6320
|
}
|
|
6312
6321
|
}
|
|
@@ -7092,7 +7101,7 @@ function requireView () {
|
|
|
7092
7101
|
*
|
|
7093
7102
|
* @packageDocumentation
|
|
7094
7103
|
*/
|
|
7095
|
-
__exportStar(requireFactory$
|
|
7104
|
+
__exportStar(requireFactory$1(), exports);
|
|
7096
7105
|
__exportStar(requireInstance(), exports);
|
|
7097
7106
|
} (view));
|
|
7098
7107
|
return view;
|
|
@@ -8766,15 +8775,15 @@ class System extends base_1$h.EmitterBase {
|
|
|
8766
8775
|
* Writes the passed message into both the log file and the console.
|
|
8767
8776
|
* @param level The log level for the entry. Can be either "info", "warning" or "error"
|
|
8768
8777
|
* @param message The log message text
|
|
8769
|
-
* @param target
|
|
8778
|
+
* @param target The log stream this message will be sent to, defaults to 'debug.log'. Specify 'app.log' to log to the app log of the sending View / Window. Note, when using `app.log`, it will always log to app.log irrespective of the `enableAppLogging` setting for the sender. This is particularly useful if you wish to log certain things from a View / Window but ignore generic console logs.
|
|
8770
8779
|
*
|
|
8771
8780
|
* @example
|
|
8772
8781
|
* ```js
|
|
8773
8782
|
* fin.System.log("info", "An example log message", { type: 'debug.log' }).then(() => console.log('Log info message')).catch(err => console.log(err));
|
|
8774
8783
|
* ```
|
|
8775
8784
|
*/
|
|
8776
|
-
log(level, message,
|
|
8777
|
-
return this.wire.sendAction('write-to-log', { level, message, target:
|
|
8785
|
+
log(level, message, target) {
|
|
8786
|
+
return this.wire.sendAction('write-to-log', { level, message, target: target ?? {} }).then(() => undefined);
|
|
8778
8787
|
}
|
|
8779
8788
|
/**
|
|
8780
8789
|
* Opens the passed URL in the default web browser.
|
|
@@ -9882,6 +9891,25 @@ class System extends base_1$h.EmitterBase {
|
|
|
9882
9891
|
/**
|
|
9883
9892
|
* Overrides original Chromium theme color providers matching key (currently except high contrast ones). Only colors passed in the map will be overridden.
|
|
9884
9893
|
* @param overrides - Array of ColorProviderOverrides objects
|
|
9894
|
+
* @example
|
|
9895
|
+
* ```ts
|
|
9896
|
+
* await fin.System.setThemePalette([
|
|
9897
|
+
* {
|
|
9898
|
+
* colorProviderKey: { colorMode: 'light' },
|
|
9899
|
+
* colorsMap: {
|
|
9900
|
+
* kColorLabelForeground: 4278190080,
|
|
9901
|
+
* kColorBubbleBackground: 4293980400
|
|
9902
|
+
* }
|
|
9903
|
+
* },
|
|
9904
|
+
* {
|
|
9905
|
+
* colorProviderKey: { colorMode: 'dark' },
|
|
9906
|
+
* colorsMap: {
|
|
9907
|
+
* kColorLabelForeground: 4293980400,
|
|
9908
|
+
* kColorBubbleBackground: 4293980400
|
|
9909
|
+
* }
|
|
9910
|
+
* }
|
|
9911
|
+
* ]);
|
|
9912
|
+
* ```
|
|
9885
9913
|
*/
|
|
9886
9914
|
async setThemePalette(themePalette) {
|
|
9887
9915
|
return (await this.wire.sendAction('set-theme-palette', { themePalette })).payload.data;
|
|
@@ -9889,6 +9917,11 @@ class System extends base_1$h.EmitterBase {
|
|
|
9889
9917
|
/**
|
|
9890
9918
|
* Retrieves currently used color overrides
|
|
9891
9919
|
* @returns Array of ColorProviderOverrides objects
|
|
9920
|
+
* @example
|
|
9921
|
+
* ```ts
|
|
9922
|
+
* const themePalette = await fin.System.getThemePalette();
|
|
9923
|
+
* console.log(themePalette);
|
|
9924
|
+
* ```
|
|
9892
9925
|
*/
|
|
9893
9926
|
async getThemePalette() {
|
|
9894
9927
|
const { payload } = await this.wire.sendAction('get-theme-palette');
|
|
@@ -17842,7 +17875,7 @@ const events_1 = require$$0;
|
|
|
17842
17875
|
// Import from the file rather than the directory in case someone consuming types is using module resolution other than "node"
|
|
17843
17876
|
const index_1 = system;
|
|
17844
17877
|
const index_2 = requireWindow();
|
|
17845
|
-
const index_3 =
|
|
17878
|
+
const index_3 = application;
|
|
17846
17879
|
const index_4 = interappbus;
|
|
17847
17880
|
const index_5 = clipboard;
|
|
17848
17881
|
const index_6 = externalApplication;
|