@openfin/remote-adapter 43.100.62 → 43.100.64
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 +1222 -1154
- package/package.json +2 -2
package/out/remote-adapter.js
CHANGED
|
@@ -868,7 +868,7 @@ var __importDefault$6 = (commonjsGlobal && commonjsGlobal.__importDefault) || fu
|
|
|
868
868
|
var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
|
|
869
869
|
Object.defineProperty(InteropBroker$1, "__esModule", { value: true });
|
|
870
870
|
InteropBroker$1.InteropBroker = void 0;
|
|
871
|
-
const base_1$
|
|
871
|
+
const base_1$p = base;
|
|
872
872
|
const SessionContextGroupBroker_1 = __importDefault$6(SessionContextGroupBroker$1);
|
|
873
873
|
const utils_1$7 = utils$3;
|
|
874
874
|
const isEqual_1$1 = __importDefault$6(require$$3);
|
|
@@ -1037,7 +1037,7 @@ const defaultContextGroups = [
|
|
|
1037
1037
|
* ---
|
|
1038
1038
|
*
|
|
1039
1039
|
*/
|
|
1040
|
-
class InteropBroker extends base_1$
|
|
1040
|
+
class InteropBroker extends base_1$p.Base {
|
|
1041
1041
|
/**
|
|
1042
1042
|
* @internal
|
|
1043
1043
|
*/
|
|
@@ -2585,11 +2585,11 @@ const handleDeprecatedWarnings = (options) => {
|
|
|
2585
2585
|
};
|
|
2586
2586
|
warnings.handleDeprecatedWarnings = handleDeprecatedWarnings;
|
|
2587
2587
|
|
|
2588
|
-
var hasRequiredFactory$
|
|
2588
|
+
var hasRequiredFactory$1;
|
|
2589
2589
|
|
|
2590
|
-
function requireFactory$
|
|
2591
|
-
if (hasRequiredFactory$
|
|
2592
|
-
hasRequiredFactory$
|
|
2590
|
+
function requireFactory$1 () {
|
|
2591
|
+
if (hasRequiredFactory$1) return Factory$8;
|
|
2592
|
+
hasRequiredFactory$1 = 1;
|
|
2593
2593
|
Object.defineProperty(Factory$8, "__esModule", { value: true });
|
|
2594
2594
|
Factory$8.ViewModule = void 0;
|
|
2595
2595
|
const base_1 = base;
|
|
@@ -2748,8 +2748,8 @@ var main = {};
|
|
|
2748
2748
|
|
|
2749
2749
|
Object.defineProperty(main, "__esModule", { value: true });
|
|
2750
2750
|
main.WebContents = void 0;
|
|
2751
|
-
const base_1$
|
|
2752
|
-
class WebContents extends base_1$
|
|
2751
|
+
const base_1$o = base;
|
|
2752
|
+
class WebContents extends base_1$o.EmitterBase {
|
|
2753
2753
|
/**
|
|
2754
2754
|
* @param identity The identity of the {@link OpenFin.WebContentsEvents WebContents}.
|
|
2755
2755
|
* @param entityType The type of the {@link OpenFin.WebContentsEvents WebContents}.
|
|
@@ -3842,1154 +3842,1133 @@ var Factory$6 = {};
|
|
|
3842
3842
|
|
|
3843
3843
|
var Instance$5 = {};
|
|
3844
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
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
async closeTrayIconPopupMenu() {
|
|
4667
|
-
const { name } = this.wire.me;
|
|
4668
|
-
const entityIdentity = { uuid: this.identity.uuid, name };
|
|
4669
|
-
await this.wire.sendAction('close-tray-icon-popup-menu', { ...entityIdentity });
|
|
4670
|
-
}
|
|
4671
|
-
}
|
|
4672
|
-
Instance$5.Application = Application;
|
|
4673
|
-
return Instance$5;
|
|
3845
|
+
Object.defineProperty(Instance$5, "__esModule", { value: true });
|
|
3846
|
+
Instance$5.Application = void 0;
|
|
3847
|
+
/* eslint-disable import/prefer-default-export */
|
|
3848
|
+
const base_1$n = base;
|
|
3849
|
+
const window_1$1 = requireWindow();
|
|
3850
|
+
const view_1 = requireView();
|
|
3851
|
+
/**
|
|
3852
|
+
* An object representing an application. Allows the developer to create,
|
|
3853
|
+
* execute, show/close an application as well as listen to {@link OpenFin.ApplicationEvents application events}.
|
|
3854
|
+
*/
|
|
3855
|
+
class Application extends base_1$n.EmitterBase {
|
|
3856
|
+
/**
|
|
3857
|
+
* @internal
|
|
3858
|
+
*/
|
|
3859
|
+
constructor(wire, identity) {
|
|
3860
|
+
super(wire, 'application', identity.uuid);
|
|
3861
|
+
this.identity = identity;
|
|
3862
|
+
this.window = new window_1$1._Window(this.wire, {
|
|
3863
|
+
uuid: this.identity.uuid,
|
|
3864
|
+
name: this.identity.uuid
|
|
3865
|
+
});
|
|
3866
|
+
}
|
|
3867
|
+
windowListFromIdentityList(identityList) {
|
|
3868
|
+
const windowList = [];
|
|
3869
|
+
identityList.forEach((identity) => {
|
|
3870
|
+
windowList.push(new window_1$1._Window(this.wire, {
|
|
3871
|
+
uuid: identity.uuid,
|
|
3872
|
+
name: identity.name
|
|
3873
|
+
}));
|
|
3874
|
+
});
|
|
3875
|
+
return windowList;
|
|
3876
|
+
}
|
|
3877
|
+
/**
|
|
3878
|
+
* Determines if the application is currently running.
|
|
3879
|
+
*
|
|
3880
|
+
* @example
|
|
3881
|
+
*
|
|
3882
|
+
* ```js
|
|
3883
|
+
* async function isAppRunning() {
|
|
3884
|
+
* const app = await fin.Application.getCurrent();
|
|
3885
|
+
* return await app.isRunning();
|
|
3886
|
+
* }
|
|
3887
|
+
* isAppRunning().then(running => console.log(`Current app is running: ${running}`)).catch(err => console.log(err));
|
|
3888
|
+
* ```
|
|
3889
|
+
*/
|
|
3890
|
+
isRunning() {
|
|
3891
|
+
return this.wire.sendAction('is-application-running', this.identity).then(({ payload }) => payload.data);
|
|
3892
|
+
}
|
|
3893
|
+
/**
|
|
3894
|
+
* Closes the application and any child windows created by the application.
|
|
3895
|
+
* Cleans the application from state so it is no longer found in getAllApplications.
|
|
3896
|
+
* @param force Close will be prevented from closing when force is false and
|
|
3897
|
+
* ‘close-requested’ has been subscribed to for application’s main window.
|
|
3898
|
+
*
|
|
3899
|
+
* @example
|
|
3900
|
+
*
|
|
3901
|
+
* ```js
|
|
3902
|
+
* async function closeApp() {
|
|
3903
|
+
* const allApps1 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}, {uuid: 'app2', isRunning: true}]
|
|
3904
|
+
* const app = await fin.Application.wrap({uuid: 'app2'});
|
|
3905
|
+
* await app.quit();
|
|
3906
|
+
* const allApps2 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}]
|
|
3907
|
+
*
|
|
3908
|
+
* }
|
|
3909
|
+
* closeApp().then(() => console.log('Application quit')).catch(err => console.log(err));
|
|
3910
|
+
* ```
|
|
3911
|
+
*/
|
|
3912
|
+
async quit(force = false) {
|
|
3913
|
+
try {
|
|
3914
|
+
await this._close(force);
|
|
3915
|
+
await this.wire.sendAction('destroy-application', { force, ...this.identity });
|
|
3916
|
+
}
|
|
3917
|
+
catch (error) {
|
|
3918
|
+
const acceptableErrors = ['Remote connection has closed', 'Could not locate the requested application'];
|
|
3919
|
+
if (!acceptableErrors.some((msg) => error.message.includes(msg))) {
|
|
3920
|
+
throw error;
|
|
3921
|
+
}
|
|
3922
|
+
}
|
|
3923
|
+
}
|
|
3924
|
+
async _close(force = false) {
|
|
3925
|
+
try {
|
|
3926
|
+
await this.wire.sendAction('close-application', { force, ...this.identity });
|
|
3927
|
+
}
|
|
3928
|
+
catch (error) {
|
|
3929
|
+
if (!error.message.includes('Remote connection has closed')) {
|
|
3930
|
+
throw error;
|
|
3931
|
+
}
|
|
3932
|
+
}
|
|
3933
|
+
}
|
|
3934
|
+
/**
|
|
3935
|
+
* @deprecated use Application.quit instead
|
|
3936
|
+
* Closes the application and any child windows created by the application.
|
|
3937
|
+
* @param force - Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for application’s main window.
|
|
3938
|
+
* @param callback - called if the method succeeds.
|
|
3939
|
+
* @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
|
|
3940
|
+
*
|
|
3941
|
+
* @example
|
|
3942
|
+
*
|
|
3943
|
+
* ```js
|
|
3944
|
+
* async function closeApp() {
|
|
3945
|
+
* const app = await fin.Application.getCurrent();
|
|
3946
|
+
* return await app.close();
|
|
3947
|
+
* }
|
|
3948
|
+
* closeApp().then(() => console.log('Application closed')).catch(err => console.log(err));
|
|
3949
|
+
* ```
|
|
3950
|
+
*/
|
|
3951
|
+
close(force = false) {
|
|
3952
|
+
console.warn('Deprecation Warning: Application.close is deprecated Please use Application.quit');
|
|
3953
|
+
this.wire.sendAction('application-close', this.identity).catch((e) => {
|
|
3954
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
3955
|
+
});
|
|
3956
|
+
return this._close(force);
|
|
3957
|
+
}
|
|
3958
|
+
/**
|
|
3959
|
+
* Retrieves an array of wrapped fin.Windows for each of the application’s child windows.
|
|
3960
|
+
*
|
|
3961
|
+
* @example
|
|
3962
|
+
*
|
|
3963
|
+
* ```js
|
|
3964
|
+
* async function getChildWindows() {
|
|
3965
|
+
* const app = await fin.Application.getCurrent();
|
|
3966
|
+
* return await app.getChildWindows();
|
|
3967
|
+
* }
|
|
3968
|
+
*
|
|
3969
|
+
* getChildWindows().then(children => console.log(children)).catch(err => console.log(err));
|
|
3970
|
+
* ```
|
|
3971
|
+
*/
|
|
3972
|
+
getChildWindows() {
|
|
3973
|
+
return this.wire.sendAction('get-child-windows', this.identity).then(({ payload }) => {
|
|
3974
|
+
const identityList = [];
|
|
3975
|
+
payload.data.forEach((winName) => {
|
|
3976
|
+
identityList.push({ uuid: this.identity.uuid, name: winName });
|
|
3977
|
+
});
|
|
3978
|
+
return this.windowListFromIdentityList(identityList);
|
|
3979
|
+
});
|
|
3980
|
+
}
|
|
3981
|
+
/**
|
|
3982
|
+
* Retrieves the JSON manifest that was used to create the application. Invokes the error callback
|
|
3983
|
+
* if the application was not created from a manifest.
|
|
3984
|
+
*
|
|
3985
|
+
* @example
|
|
3986
|
+
*
|
|
3987
|
+
* ```js
|
|
3988
|
+
* async function getManifest() {
|
|
3989
|
+
* const app = await fin.Application.getCurrent();
|
|
3990
|
+
* return await app.getManifest();
|
|
3991
|
+
* }
|
|
3992
|
+
*
|
|
3993
|
+
* getManifest().then(manifest => console.log(manifest)).catch(err => console.log(err));
|
|
3994
|
+
* ```
|
|
3995
|
+
*/
|
|
3996
|
+
getManifest() {
|
|
3997
|
+
return this.wire.sendAction('get-application-manifest', this.identity).then(({ payload }) => payload.data);
|
|
3998
|
+
}
|
|
3999
|
+
/**
|
|
4000
|
+
* Retrieves UUID of the application that launches this application. Invokes the error callback
|
|
4001
|
+
* if the application was created from a manifest.
|
|
4002
|
+
*
|
|
4003
|
+
* @example
|
|
4004
|
+
*
|
|
4005
|
+
* ```js
|
|
4006
|
+
* async function getParentUuid() {
|
|
4007
|
+
* const app = await fin.Application.start({
|
|
4008
|
+
* uuid: 'app-1',
|
|
4009
|
+
* name: 'myApp',
|
|
4010
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getParentUuid.html',
|
|
4011
|
+
* autoShow: true
|
|
4012
|
+
* });
|
|
4013
|
+
* return await app.getParentUuid();
|
|
4014
|
+
* }
|
|
4015
|
+
*
|
|
4016
|
+
* getParentUuid().then(parentUuid => console.log(parentUuid)).catch(err => console.log(err));
|
|
4017
|
+
* ```
|
|
4018
|
+
*/
|
|
4019
|
+
getParentUuid() {
|
|
4020
|
+
return this.wire.sendAction('get-parent-application', this.identity).then(({ payload }) => payload.data);
|
|
4021
|
+
}
|
|
4022
|
+
/**
|
|
4023
|
+
* Retrieves current application's shortcut configuration.
|
|
4024
|
+
*
|
|
4025
|
+
* @example
|
|
4026
|
+
*
|
|
4027
|
+
* ```js
|
|
4028
|
+
* async function getShortcuts() {
|
|
4029
|
+
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
4030
|
+
* return await app.getShortcuts();
|
|
4031
|
+
* }
|
|
4032
|
+
* getShortcuts().then(config => console.log(config)).catch(err => console.log(err));
|
|
4033
|
+
* ```
|
|
4034
|
+
*/
|
|
4035
|
+
getShortcuts() {
|
|
4036
|
+
return this.wire.sendAction('get-shortcuts', this.identity).then(({ payload }) => payload.data);
|
|
4037
|
+
}
|
|
4038
|
+
/**
|
|
4039
|
+
* Retrieves current application's views.
|
|
4040
|
+
* @experimental
|
|
4041
|
+
*
|
|
4042
|
+
* @example
|
|
4043
|
+
*
|
|
4044
|
+
* ```js
|
|
4045
|
+
* async function getViews() {
|
|
4046
|
+
* const app = await fin.Application.getCurrent();
|
|
4047
|
+
* return await app.getViews();
|
|
4048
|
+
* }
|
|
4049
|
+
* getViews().then(views => console.log(views)).catch(err => console.log(err));
|
|
4050
|
+
* ```
|
|
4051
|
+
*/
|
|
4052
|
+
async getViews() {
|
|
4053
|
+
const { payload } = await this.wire.sendAction('application-get-views', this.identity);
|
|
4054
|
+
return payload.data.map((id) => new view_1.View(this.wire, id));
|
|
4055
|
+
}
|
|
4056
|
+
/**
|
|
4057
|
+
* Returns the current zoom level of the application.
|
|
4058
|
+
*
|
|
4059
|
+
* @example
|
|
4060
|
+
*
|
|
4061
|
+
* ```js
|
|
4062
|
+
* async function getZoomLevel() {
|
|
4063
|
+
* const app = await fin.Application.getCurrent();
|
|
4064
|
+
* return await app.getZoomLevel();
|
|
4065
|
+
* }
|
|
4066
|
+
*
|
|
4067
|
+
* getZoomLevel().then(zoomLevel => console.log(zoomLevel)).catch(err => console.log(err));
|
|
4068
|
+
* ```
|
|
4069
|
+
*/
|
|
4070
|
+
getZoomLevel() {
|
|
4071
|
+
return this.wire.sendAction('get-application-zoom-level', this.identity).then(({ payload }) => payload.data);
|
|
4072
|
+
}
|
|
4073
|
+
/**
|
|
4074
|
+
* Returns an instance of the main Window of the application
|
|
4075
|
+
*
|
|
4076
|
+
* @example
|
|
4077
|
+
*
|
|
4078
|
+
* ```js
|
|
4079
|
+
* async function getWindow() {
|
|
4080
|
+
* const app = await fin.Application.start({
|
|
4081
|
+
* uuid: 'app-1',
|
|
4082
|
+
* name: 'myApp',
|
|
4083
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getWindow.html',
|
|
4084
|
+
* autoShow: true
|
|
4085
|
+
* });
|
|
4086
|
+
* return await app.getWindow();
|
|
4087
|
+
* }
|
|
4088
|
+
*
|
|
4089
|
+
* getWindow().then(win => {
|
|
4090
|
+
* win.showAt(0, 400);
|
|
4091
|
+
* win.flash();
|
|
4092
|
+
* }).catch(err => console.log(err));
|
|
4093
|
+
* ```
|
|
4094
|
+
*/
|
|
4095
|
+
getWindow() {
|
|
4096
|
+
this.wire.sendAction('application-get-window', this.identity).catch((e) => {
|
|
4097
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4098
|
+
});
|
|
4099
|
+
return Promise.resolve(this.window);
|
|
4100
|
+
}
|
|
4101
|
+
/**
|
|
4102
|
+
* Manually registers a user with the licensing service. The only data sent by this call is userName and appName.
|
|
4103
|
+
* @param userName - username to be passed to the RVM.
|
|
4104
|
+
* @param appName - app name to be passed to the RVM.
|
|
4105
|
+
*
|
|
4106
|
+
* @example
|
|
4107
|
+
*
|
|
4108
|
+
* ```js
|
|
4109
|
+
* async function registerUser() {
|
|
4110
|
+
* const app = await fin.Application.getCurrent();
|
|
4111
|
+
* return await app.registerUser('user', 'myApp');
|
|
4112
|
+
* }
|
|
4113
|
+
*
|
|
4114
|
+
* registerUser().then(() => console.log('Successfully registered the user')).catch(err => console.log(err));
|
|
4115
|
+
* ```
|
|
4116
|
+
*/
|
|
4117
|
+
registerUser(userName, appName) {
|
|
4118
|
+
return this.wire.sendAction('register-user', { userName, appName, ...this.identity }).then(() => undefined);
|
|
4119
|
+
}
|
|
4120
|
+
/**
|
|
4121
|
+
* Removes the application’s icon from the tray.
|
|
4122
|
+
*
|
|
4123
|
+
* @example
|
|
4124
|
+
*
|
|
4125
|
+
* ```js
|
|
4126
|
+
* async function removeTrayIcon() {
|
|
4127
|
+
* const app = await fin.Application.getCurrent();
|
|
4128
|
+
* return await app.removeTrayIcon();
|
|
4129
|
+
* }
|
|
4130
|
+
*
|
|
4131
|
+
* removeTrayIcon().then(() => console.log('Removed the tray icon.')).catch(err => console.log(err));
|
|
4132
|
+
* ```
|
|
4133
|
+
*/
|
|
4134
|
+
removeTrayIcon() {
|
|
4135
|
+
return this.wire.sendAction('remove-tray-icon', this.identity).then(() => undefined);
|
|
4136
|
+
}
|
|
4137
|
+
/**
|
|
4138
|
+
* Restarts the application.
|
|
4139
|
+
*
|
|
4140
|
+
* @example
|
|
4141
|
+
*
|
|
4142
|
+
* ```js
|
|
4143
|
+
* async function restartApp() {
|
|
4144
|
+
* const app = await fin.Application.getCurrent();
|
|
4145
|
+
* return await app.restart();
|
|
4146
|
+
* }
|
|
4147
|
+
* restartApp().then(() => console.log('Application restarted')).catch(err => console.log(err));
|
|
4148
|
+
* ```
|
|
4149
|
+
*/
|
|
4150
|
+
restart() {
|
|
4151
|
+
return this.wire.sendAction('restart-application', this.identity).then(() => undefined);
|
|
4152
|
+
}
|
|
4153
|
+
/**
|
|
4154
|
+
* DEPRECATED method to run the application.
|
|
4155
|
+
* Needed when starting application via {@link Application.create}, but NOT needed when starting via {@link Application.start}.
|
|
4156
|
+
*
|
|
4157
|
+
* @example
|
|
4158
|
+
*
|
|
4159
|
+
* ```js
|
|
4160
|
+
* async function run() {
|
|
4161
|
+
* const app = await fin.Application.create({
|
|
4162
|
+
* name: 'myApp',
|
|
4163
|
+
* uuid: 'app-1',
|
|
4164
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.run.html',
|
|
4165
|
+
* autoShow: true
|
|
4166
|
+
* });
|
|
4167
|
+
* await app.run();
|
|
4168
|
+
* }
|
|
4169
|
+
* run().then(() => console.log('Application is running')).catch(err => console.log(err));
|
|
4170
|
+
* ```
|
|
4171
|
+
*
|
|
4172
|
+
* @ignore
|
|
4173
|
+
*/
|
|
4174
|
+
run() {
|
|
4175
|
+
console.warn('Deprecation Warning: Application.run is deprecated Please use fin.Application.start');
|
|
4176
|
+
this.wire.sendAction('application-run', this.identity).catch((e) => {
|
|
4177
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4178
|
+
});
|
|
4179
|
+
return this._run();
|
|
4180
|
+
}
|
|
4181
|
+
_run(opts = {}) {
|
|
4182
|
+
return this.wire
|
|
4183
|
+
.sendAction('run-application', {
|
|
4184
|
+
manifestUrl: this._manifestUrl,
|
|
4185
|
+
opts,
|
|
4186
|
+
...this.identity
|
|
4187
|
+
})
|
|
4188
|
+
.then(() => undefined);
|
|
4189
|
+
}
|
|
4190
|
+
/**
|
|
4191
|
+
* Instructs the RVM to schedule one restart of the application.
|
|
4192
|
+
*
|
|
4193
|
+
* @example
|
|
4194
|
+
*
|
|
4195
|
+
* ```js
|
|
4196
|
+
* async function scheduleRestart() {
|
|
4197
|
+
* const app = await fin.Application.getCurrent();
|
|
4198
|
+
* return await app.scheduleRestart();
|
|
4199
|
+
* }
|
|
4200
|
+
*
|
|
4201
|
+
* scheduleRestart().then(() => console.log('Application is scheduled to restart')).catch(err => console.log(err));
|
|
4202
|
+
* ```
|
|
4203
|
+
*/
|
|
4204
|
+
scheduleRestart() {
|
|
4205
|
+
return this.wire.sendAction('relaunch-on-close', this.identity).then(() => undefined);
|
|
4206
|
+
}
|
|
4207
|
+
/**
|
|
4208
|
+
* Sends a message to the RVM to upload the application's logs. On success,
|
|
4209
|
+
* an object containing logId is returned.
|
|
4210
|
+
*
|
|
4211
|
+
* @example
|
|
4212
|
+
*
|
|
4213
|
+
* ```js
|
|
4214
|
+
* async function sendLog() {
|
|
4215
|
+
* const app = await fin.Application.getCurrent();
|
|
4216
|
+
* return await app.sendApplicationLog();
|
|
4217
|
+
* }
|
|
4218
|
+
*
|
|
4219
|
+
* sendLog().then(info => console.log(info.logId)).catch(err => console.log(err));
|
|
4220
|
+
* ```
|
|
4221
|
+
*/
|
|
4222
|
+
async sendApplicationLog() {
|
|
4223
|
+
const { payload } = await this.wire.sendAction('send-application-log', this.identity);
|
|
4224
|
+
return payload.data;
|
|
4225
|
+
}
|
|
4226
|
+
/**
|
|
4227
|
+
* Sets or removes a custom JumpList for the application. Only applicable in Windows OS.
|
|
4228
|
+
* If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
|
|
4229
|
+
*
|
|
4230
|
+
* Note: If the "name" property is omitted it defaults to "tasks".
|
|
4231
|
+
* @param jumpListCategories An array of JumpList Categories to populate. If null, remove any existing JumpList configuration and set to Windows default.
|
|
4232
|
+
*
|
|
4233
|
+
*
|
|
4234
|
+
* @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).
|
|
4235
|
+
*
|
|
4236
|
+
* The bottommost item in the jumplist will always be an item pointing to the current app. Its name is taken from the manifest's
|
|
4237
|
+
* **` shortcut.name `** and uses **` shortcut.company `** as a fallback. Clicking that item will launch the app from its current manifest.
|
|
4238
|
+
*
|
|
4239
|
+
* Note: If the "name" property is omitted it defaults to "tasks".
|
|
4240
|
+
*
|
|
4241
|
+
* Note: Window OS caches jumplists icons, therefore an icon change might only be visible after the cache is removed or the
|
|
4242
|
+
* uuid or shortcut.name is changed.
|
|
4243
|
+
*
|
|
4244
|
+
* @example
|
|
4245
|
+
*
|
|
4246
|
+
* ```js
|
|
4247
|
+
* const app = fin.Application.getCurrentSync();
|
|
4248
|
+
* const appName = 'My App';
|
|
4249
|
+
* const jumpListConfig = [ // array of JumpList categories
|
|
4250
|
+
* {
|
|
4251
|
+
* // has no name and no type so `type` is assumed to be "tasks"
|
|
4252
|
+
* items: [ // array of JumpList items
|
|
4253
|
+
* {
|
|
4254
|
+
* type: 'task',
|
|
4255
|
+
* title: `Launch ${appName}`,
|
|
4256
|
+
* description: `Runs ${appName} with the default configuration`,
|
|
4257
|
+
* deepLink: 'fins://path.to/app/manifest.json',
|
|
4258
|
+
* iconPath: 'https://path.to/app/icon.ico',
|
|
4259
|
+
* iconIndex: 0
|
|
4260
|
+
* },
|
|
4261
|
+
* { type: 'separator' },
|
|
4262
|
+
* {
|
|
4263
|
+
* type: 'task',
|
|
4264
|
+
* title: `Restore ${appName}`,
|
|
4265
|
+
* description: 'Restore to last configuration',
|
|
4266
|
+
* deepLink: 'fins://path.to/app/manifest.json?$$use-last-configuration=true',
|
|
4267
|
+
* iconPath: 'https://path.to/app/icon.ico',
|
|
4268
|
+
* iconIndex: 0
|
|
4269
|
+
* },
|
|
4270
|
+
* ]
|
|
4271
|
+
* },
|
|
4272
|
+
* {
|
|
4273
|
+
* name: 'Tools',
|
|
4274
|
+
* items: [ // array of JumpList items
|
|
4275
|
+
* {
|
|
4276
|
+
* type: 'task',
|
|
4277
|
+
* title: 'Tool A',
|
|
4278
|
+
* description: 'Runs Tool A',
|
|
4279
|
+
* deepLink: 'fins://path.to/tool-a/manifest.json',
|
|
4280
|
+
* iconPath: 'https://path.to/tool-a/icon.ico',
|
|
4281
|
+
* iconIndex: 0
|
|
4282
|
+
* },
|
|
4283
|
+
* {
|
|
4284
|
+
* type: 'task',
|
|
4285
|
+
* title: 'Tool B',
|
|
4286
|
+
* description: 'Runs Tool B',
|
|
4287
|
+
* deepLink: 'fins://path.to/tool-b/manifest.json',
|
|
4288
|
+
* iconPath: 'https://path.to/tool-b/icon.ico',
|
|
4289
|
+
* iconIndex: 0
|
|
4290
|
+
* }]
|
|
4291
|
+
* }
|
|
4292
|
+
* ];
|
|
4293
|
+
*
|
|
4294
|
+
* app.setJumpList(jumpListConfig).then(() => console.log('JumpList applied')).catch(e => console.log(`JumpList failed to apply: ${e.toString()}`));
|
|
4295
|
+
* ```
|
|
4296
|
+
*
|
|
4297
|
+
* To handle deeplink args:
|
|
4298
|
+
* ```js
|
|
4299
|
+
* function handleUseLastConfiguration() {
|
|
4300
|
+
* // this handler is called when the app is being launched
|
|
4301
|
+
* app.on('run-requested', event => {
|
|
4302
|
+
* if(event.userAppConfigArgs['use-last-configuration']) {
|
|
4303
|
+
* // your logic here
|
|
4304
|
+
* }
|
|
4305
|
+
* });
|
|
4306
|
+
* // this handler is called when the app was already running when the launch was requested
|
|
4307
|
+
* fin.desktop.main(function(args) {
|
|
4308
|
+
* if(args && args['use-last-configuration']) {
|
|
4309
|
+
* // your logic here
|
|
4310
|
+
* }
|
|
4311
|
+
* });
|
|
4312
|
+
* }
|
|
4313
|
+
* ```
|
|
4314
|
+
*/
|
|
4315
|
+
async setJumpList(jumpListCategories) {
|
|
4316
|
+
await this.wire.sendAction('set-jump-list', { config: jumpListCategories, ...this.identity });
|
|
4317
|
+
}
|
|
4318
|
+
/**
|
|
4319
|
+
* Adds a customizable icon in the system tray. To listen for a click on the icon use the `tray-icon-clicked` event.
|
|
4320
|
+
* @param icon Image URL or base64 encoded string to be used as the icon
|
|
4321
|
+
*
|
|
4322
|
+
* @example
|
|
4323
|
+
*
|
|
4324
|
+
* ```js
|
|
4325
|
+
* const imageUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
|
|
4326
|
+
* const base64EncodedImage = "iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX\
|
|
4327
|
+
* ///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII";
|
|
4328
|
+
* const dataURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DH\
|
|
4329
|
+
* xgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
|
|
4330
|
+
*
|
|
4331
|
+
* async function setTrayIcon(icon) {
|
|
4332
|
+
* const app = await fin.Application.getCurrent();
|
|
4333
|
+
* return await app.setTrayIcon(icon);
|
|
4334
|
+
* }
|
|
4335
|
+
*
|
|
4336
|
+
* // use image url to set tray icon
|
|
4337
|
+
* setTrayIcon(imageUrl).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
4338
|
+
*
|
|
4339
|
+
* // use base64 encoded string to set tray icon
|
|
4340
|
+
* setTrayIcon(base64EncodedImage).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
4341
|
+
*
|
|
4342
|
+
* // use a dataURL to set tray icon
|
|
4343
|
+
* setTrayIcon(dataURL).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
|
|
4344
|
+
* ```
|
|
4345
|
+
*/
|
|
4346
|
+
setTrayIcon(icon) {
|
|
4347
|
+
return this.wire
|
|
4348
|
+
.sendAction('set-tray-icon', {
|
|
4349
|
+
enabledIcon: icon,
|
|
4350
|
+
...this.identity
|
|
4351
|
+
})
|
|
4352
|
+
.then(() => undefined);
|
|
4353
|
+
}
|
|
4354
|
+
/**
|
|
4355
|
+
* Set hover text for this application's system tray icon.
|
|
4356
|
+
* Note: Application must first set a tray icon with {@link Application.setTrayIcon}.
|
|
4357
|
+
* @param toolTip
|
|
4358
|
+
*
|
|
4359
|
+
* @example
|
|
4360
|
+
*
|
|
4361
|
+
* ```js
|
|
4362
|
+
* const app = fin.Application.getCurrentSync();
|
|
4363
|
+
* const iconUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
|
|
4364
|
+
*
|
|
4365
|
+
* await app.setTrayIcon(iconUrl);
|
|
4366
|
+
*
|
|
4367
|
+
* await app.setTrayIconToolTip('My Application');
|
|
4368
|
+
* ```
|
|
4369
|
+
*/
|
|
4370
|
+
async setTrayIconToolTip(toolTip) {
|
|
4371
|
+
await this.wire.sendAction('set-tray-icon-tooltip', { ...this.identity, toolTip });
|
|
4372
|
+
}
|
|
4373
|
+
/**
|
|
4374
|
+
* Sets new application's shortcut configuration. Windows only.
|
|
4375
|
+
* @param config New application's shortcut configuration.
|
|
4376
|
+
*
|
|
4377
|
+
* @remarks Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest
|
|
4378
|
+
* to be able to change shortcut states.
|
|
4379
|
+
*
|
|
4380
|
+
* @example
|
|
4381
|
+
*
|
|
4382
|
+
* ```js
|
|
4383
|
+
* async function setShortcuts(config) {
|
|
4384
|
+
* const app = await fin.Application.getCurrent();
|
|
4385
|
+
* return app.setShortcuts(config);
|
|
4386
|
+
* }
|
|
4387
|
+
*
|
|
4388
|
+
* setShortcuts({
|
|
4389
|
+
* desktop: true,
|
|
4390
|
+
* startMenu: false,
|
|
4391
|
+
* systemStartup: true
|
|
4392
|
+
* }).then(() => console.log('Shortcuts are set.')).catch(err => console.log(err));
|
|
4393
|
+
* ```
|
|
4394
|
+
*/
|
|
4395
|
+
setShortcuts(config) {
|
|
4396
|
+
return this.wire.sendAction('set-shortcuts', { data: config, ...this.identity }).then(() => undefined);
|
|
4397
|
+
}
|
|
4398
|
+
/**
|
|
4399
|
+
* Sets the query string in all shortcuts for this app. Requires RVM 5.5+.
|
|
4400
|
+
* @param queryString The new query string for this app's shortcuts.
|
|
4401
|
+
*
|
|
4402
|
+
* @example
|
|
4403
|
+
*
|
|
4404
|
+
* ```js
|
|
4405
|
+
* const newQueryArgs = 'arg=true&arg2=false';
|
|
4406
|
+
* const app = await fin.Application.getCurrent();
|
|
4407
|
+
* try {
|
|
4408
|
+
* await app.setShortcutQueryParams(newQueryArgs);
|
|
4409
|
+
* } catch(err) {
|
|
4410
|
+
* console.error(err)
|
|
4411
|
+
* }
|
|
4412
|
+
* ```
|
|
4413
|
+
*/
|
|
4414
|
+
async setShortcutQueryParams(queryString) {
|
|
4415
|
+
await this.wire.sendAction('set-shortcut-query-args', { data: queryString, ...this.identity });
|
|
4416
|
+
}
|
|
4417
|
+
/**
|
|
4418
|
+
* Sets the zoom level of the application. The original size is 0 and each increment above or below represents zooming 20%
|
|
4419
|
+
* larger or smaller to default limits of 300% and 50% of original size, respectively.
|
|
4420
|
+
* @param level The zoom level
|
|
4421
|
+
*
|
|
4422
|
+
* @example
|
|
4423
|
+
*
|
|
4424
|
+
* ```js
|
|
4425
|
+
* async function setZoomLevel(number) {
|
|
4426
|
+
* const app = await fin.Application.getCurrent();
|
|
4427
|
+
* return await app.setZoomLevel(number);
|
|
4428
|
+
* }
|
|
4429
|
+
*
|
|
4430
|
+
* setZoomLevel(5).then(() => console.log('Setting a zoom level')).catch(err => console.log(err));
|
|
4431
|
+
* ```
|
|
4432
|
+
*/
|
|
4433
|
+
setZoomLevel(level) {
|
|
4434
|
+
return this.wire.sendAction('set-application-zoom-level', { level, ...this.identity }).then(() => undefined);
|
|
4435
|
+
}
|
|
4436
|
+
/**
|
|
4437
|
+
* Sets a username to correlate with App Log Management.
|
|
4438
|
+
* @param username Username to correlate with App's Log.
|
|
4439
|
+
*
|
|
4440
|
+
* @example
|
|
4441
|
+
*
|
|
4442
|
+
* ```js
|
|
4443
|
+
* async function setAppLogUser() {
|
|
4444
|
+
* const app = await fin.Application.getCurrent();
|
|
4445
|
+
* return await app.setAppLogUsername('username');
|
|
4446
|
+
* }
|
|
4447
|
+
*
|
|
4448
|
+
* setAppLogUser().then(() => console.log('Success')).catch(err => console.log(err));
|
|
4449
|
+
*
|
|
4450
|
+
* ```
|
|
4451
|
+
*/
|
|
4452
|
+
async setAppLogUsername(username) {
|
|
4453
|
+
await this.wire.sendAction('set-app-log-username', { data: username, ...this.identity });
|
|
4454
|
+
}
|
|
4455
|
+
/**
|
|
4456
|
+
* Retrieves information about the system tray. If the system tray is not set, it will throw an error message.
|
|
4457
|
+
* @remarks The only information currently returned is the position and dimensions.
|
|
4458
|
+
*
|
|
4459
|
+
* @example
|
|
4460
|
+
*
|
|
4461
|
+
* ```js
|
|
4462
|
+
* async function getTrayIconInfo() {
|
|
4463
|
+
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
4464
|
+
* return await app.getTrayIconInfo();
|
|
4465
|
+
* }
|
|
4466
|
+
* getTrayIconInfo().then(info => console.log(info)).catch(err => console.log(err));
|
|
4467
|
+
* ```
|
|
4468
|
+
*/
|
|
4469
|
+
getTrayIconInfo() {
|
|
4470
|
+
return this.wire.sendAction('get-tray-icon-info', this.identity).then(({ payload }) => payload.data);
|
|
4471
|
+
}
|
|
4472
|
+
/**
|
|
4473
|
+
* Checks if the application has an associated tray icon.
|
|
4474
|
+
*
|
|
4475
|
+
* @example
|
|
4476
|
+
*
|
|
4477
|
+
* ```js
|
|
4478
|
+
* const app = await fin.Application.wrap({ uuid: 'testapp' });
|
|
4479
|
+
* const hasTrayIcon = await app.hasTrayIcon();
|
|
4480
|
+
* console.log(hasTrayIcon);
|
|
4481
|
+
* ```
|
|
4482
|
+
*/
|
|
4483
|
+
hasTrayIcon() {
|
|
4484
|
+
return this.wire.sendAction('has-tray-icon', this.identity).then(({ payload }) => payload.data);
|
|
4485
|
+
}
|
|
4486
|
+
/**
|
|
4487
|
+
* Closes the application by terminating its process.
|
|
4488
|
+
*
|
|
4489
|
+
* @example
|
|
4490
|
+
*
|
|
4491
|
+
* ```js
|
|
4492
|
+
* async function terminateApp() {
|
|
4493
|
+
* const app = await fin.Application.getCurrent();
|
|
4494
|
+
* return await app.terminate();
|
|
4495
|
+
* }
|
|
4496
|
+
* terminateApp().then(() => console.log('Application terminated')).catch(err => console.log(err));
|
|
4497
|
+
* ```
|
|
4498
|
+
*/
|
|
4499
|
+
terminate() {
|
|
4500
|
+
return this.wire.sendAction('terminate-application', this.identity).then(() => undefined);
|
|
4501
|
+
}
|
|
4502
|
+
/**
|
|
4503
|
+
* Waits for a hanging application. This method can be called in response to an application
|
|
4504
|
+
* "not-responding" to allow the application to continue and to generate another "not-responding"
|
|
4505
|
+
* message after a certain period of time.
|
|
4506
|
+
*
|
|
4507
|
+
* @ignore
|
|
4508
|
+
*/
|
|
4509
|
+
wait() {
|
|
4510
|
+
return this.wire.sendAction('wait-for-hung-application', this.identity).then(() => undefined);
|
|
4511
|
+
}
|
|
4512
|
+
/**
|
|
4513
|
+
* Retrieves information about the application.
|
|
4514
|
+
*
|
|
4515
|
+
* @remarks If the application was not launched from a manifest, the call will return the closest parent application `manifest`
|
|
4516
|
+
* and `manifestUrl`. `initialOptions` shows the parameters used when launched programmatically, or the `startup_app` options
|
|
4517
|
+
* if launched from manifest. The `parentUuid` will be the uuid of the immediate parent (if applicable).
|
|
4518
|
+
*
|
|
4519
|
+
* @example
|
|
4520
|
+
*
|
|
4521
|
+
* ```js
|
|
4522
|
+
* async function getInfo() {
|
|
4523
|
+
* const app = await fin.Application.getCurrent();
|
|
4524
|
+
* return await app.getInfo();
|
|
4525
|
+
* }
|
|
4526
|
+
*
|
|
4527
|
+
* getInfo().then(info => console.log(info)).catch(err => console.log(err));
|
|
4528
|
+
* ```
|
|
4529
|
+
*/
|
|
4530
|
+
getInfo() {
|
|
4531
|
+
return this.wire.sendAction('get-info', this.identity).then(({ payload }) => payload.data);
|
|
4532
|
+
}
|
|
4533
|
+
/**
|
|
4534
|
+
* Retrieves all process information for entities (windows and views) associated with an application.
|
|
4535
|
+
*
|
|
4536
|
+
* @example
|
|
4537
|
+
* ```js
|
|
4538
|
+
* const app = await fin.Application.getCurrent();
|
|
4539
|
+
* const processInfo = await app.getProcessInfo();
|
|
4540
|
+
* ```
|
|
4541
|
+
* @experimental
|
|
4542
|
+
*/
|
|
4543
|
+
async getProcessInfo() {
|
|
4544
|
+
const { payload: { data } } = await this.wire.sendAction('application-get-process-info', this.identity);
|
|
4545
|
+
return data;
|
|
4546
|
+
}
|
|
4547
|
+
/**
|
|
4548
|
+
* Sets file auto download location. It's only allowed in the same application.
|
|
4549
|
+
*
|
|
4550
|
+
* Note: This method is restricted by default and must be enabled via
|
|
4551
|
+
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
4552
|
+
* @param downloadLocation file auto download location
|
|
4553
|
+
*
|
|
4554
|
+
* @throws if setting file auto download location on different applications.
|
|
4555
|
+
* @example
|
|
4556
|
+
*
|
|
4557
|
+
* ```js
|
|
4558
|
+
* const downloadLocation = 'C:\\dev\\temp';
|
|
4559
|
+
* const app = await fin.Application.getCurrent();
|
|
4560
|
+
* try {
|
|
4561
|
+
* await app.setFileDownloadLocation(downloadLocation);
|
|
4562
|
+
* console.log('File download location is set');
|
|
4563
|
+
* } catch(err) {
|
|
4564
|
+
* console.error(err)
|
|
4565
|
+
* }
|
|
4566
|
+
* ```
|
|
4567
|
+
*/
|
|
4568
|
+
async setFileDownloadLocation(downloadLocation) {
|
|
4569
|
+
const { name } = this.wire.me;
|
|
4570
|
+
const entityIdentity = { uuid: this.identity.uuid, name };
|
|
4571
|
+
await this.wire.sendAction('set-file-download-location', { ...entityIdentity, downloadLocation });
|
|
4572
|
+
}
|
|
4573
|
+
/**
|
|
4574
|
+
* 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.
|
|
4575
|
+
*
|
|
4576
|
+
* Note: This method is restricted by default and must be enabled via
|
|
4577
|
+
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
4578
|
+
*
|
|
4579
|
+
* @throws if getting file auto download location on different applications.
|
|
4580
|
+
* @example
|
|
4581
|
+
*
|
|
4582
|
+
* ```js
|
|
4583
|
+
* const app = await fin.Application.getCurrent();
|
|
4584
|
+
* const fileDownloadDir = await app.getFileDownloadLocation();
|
|
4585
|
+
* ```
|
|
4586
|
+
*/
|
|
4587
|
+
async getFileDownloadLocation() {
|
|
4588
|
+
const { payload: { data } } = await this.wire.sendAction('get-file-download-location', this.identity);
|
|
4589
|
+
return data;
|
|
4590
|
+
}
|
|
4591
|
+
/**
|
|
4592
|
+
* Shows a menu on the tray icon. Use with tray-icon-clicked event.
|
|
4593
|
+
* @param options
|
|
4594
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
|
4595
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
|
4596
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
|
4597
|
+
* these with a "reducer" pattern.
|
|
4598
|
+
* @throws if the application has no tray icon set
|
|
4599
|
+
* @throws if the system tray is currently hidden
|
|
4600
|
+
* @example
|
|
4601
|
+
*
|
|
4602
|
+
* ```js
|
|
4603
|
+
* const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
|
|
4604
|
+
* const app = fin.Application.getCurrentSync();
|
|
4605
|
+
*
|
|
4606
|
+
* await app.setTrayIcon(iconUrl);
|
|
4607
|
+
*
|
|
4608
|
+
* const template = [
|
|
4609
|
+
* {
|
|
4610
|
+
* label: 'Menu Item 1',
|
|
4611
|
+
* data: 'hello from item 1'
|
|
4612
|
+
* },
|
|
4613
|
+
* { type: 'separator' },
|
|
4614
|
+
* {
|
|
4615
|
+
* label: 'Menu Item 2',
|
|
4616
|
+
* type: 'checkbox',
|
|
4617
|
+
* checked: true,
|
|
4618
|
+
* data: 'The user clicked the checkbox'
|
|
4619
|
+
* },
|
|
4620
|
+
* {
|
|
4621
|
+
* label: 'see more',
|
|
4622
|
+
* enabled: false,
|
|
4623
|
+
* submenu: [
|
|
4624
|
+
* { label: 'submenu 1', data: 'hello from submenu' }
|
|
4625
|
+
* ]
|
|
4626
|
+
* }
|
|
4627
|
+
* ];
|
|
4628
|
+
*
|
|
4629
|
+
* app.addListener('tray-icon-clicked', (event) => {
|
|
4630
|
+
* // right-click
|
|
4631
|
+
* if (event.button === 2) {
|
|
4632
|
+
* app.showTrayIconPopupMenu({ template }).then(r => {
|
|
4633
|
+
* if (r.result === 'closed') {
|
|
4634
|
+
* console.log('nothing happened');
|
|
4635
|
+
* } else {
|
|
4636
|
+
* console.log(r.data);
|
|
4637
|
+
* }
|
|
4638
|
+
* });
|
|
4639
|
+
* }
|
|
4640
|
+
* });
|
|
4641
|
+
* ```
|
|
4642
|
+
*/
|
|
4643
|
+
async showTrayIconPopupMenu(options) {
|
|
4644
|
+
const { name } = this.wire.me;
|
|
4645
|
+
const entityIdentity = { uuid: this.identity.uuid, name };
|
|
4646
|
+
const { payload } = await this.wire.sendAction('show-tray-icon-popup-menu', { ...entityIdentity, options });
|
|
4647
|
+
return payload.data;
|
|
4648
|
+
}
|
|
4649
|
+
/**
|
|
4650
|
+
* Closes the tray icon menu.
|
|
4651
|
+
*
|
|
4652
|
+
* @throws if the application has no tray icon set
|
|
4653
|
+
* @example
|
|
4654
|
+
*
|
|
4655
|
+
* ```js
|
|
4656
|
+
* const app = fin.Application.getCurrentSync();
|
|
4657
|
+
*
|
|
4658
|
+
* await app.closeTrayIconPopupMenu();
|
|
4659
|
+
* ```
|
|
4660
|
+
*/
|
|
4661
|
+
async closeTrayIconPopupMenu() {
|
|
4662
|
+
const { name } = this.wire.me;
|
|
4663
|
+
const entityIdentity = { uuid: this.identity.uuid, name };
|
|
4664
|
+
await this.wire.sendAction('close-tray-icon-popup-menu', { ...entityIdentity });
|
|
4665
|
+
}
|
|
4674
4666
|
}
|
|
4667
|
+
Instance$5.Application = Application;
|
|
4675
4668
|
|
|
4676
|
-
|
|
4669
|
+
Object.defineProperty(Factory$6, "__esModule", { value: true });
|
|
4670
|
+
Factory$6.ApplicationModule = void 0;
|
|
4671
|
+
const base_1$m = base;
|
|
4672
|
+
const validate_1$4 = validate;
|
|
4673
|
+
const Instance_1$5 = Instance$5;
|
|
4674
|
+
/**
|
|
4675
|
+
* Static namespace for OpenFin API methods that interact with the {@link Application} class, available under `fin.Application`.
|
|
4676
|
+
*/
|
|
4677
|
+
class ApplicationModule extends base_1$m.Base {
|
|
4678
|
+
/**
|
|
4679
|
+
* Asynchronously returns an API handle for the given Application identity.
|
|
4680
|
+
*
|
|
4681
|
+
* @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
|
|
4682
|
+
* returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
|
|
4683
|
+
* for an Application throughout its entire lifecycle.
|
|
4684
|
+
*
|
|
4685
|
+
* @example
|
|
4686
|
+
*
|
|
4687
|
+
* ```js
|
|
4688
|
+
* fin.Application.wrap({ uuid: 'testapp' })
|
|
4689
|
+
* .then(app => app.isRunning())
|
|
4690
|
+
* .then(running => console.log('Application is running: ' + running))
|
|
4691
|
+
* .catch(err => console.log(err));
|
|
4692
|
+
* ```
|
|
4693
|
+
*
|
|
4694
|
+
*/
|
|
4695
|
+
async wrap(identity) {
|
|
4696
|
+
this.wire.sendAction('wrap-application').catch((e) => {
|
|
4697
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4698
|
+
});
|
|
4699
|
+
const errorMsg = (0, validate_1$4.validateIdentity)(identity);
|
|
4700
|
+
if (errorMsg) {
|
|
4701
|
+
throw new Error(errorMsg);
|
|
4702
|
+
}
|
|
4703
|
+
return new Instance_1$5.Application(this.wire, identity);
|
|
4704
|
+
}
|
|
4705
|
+
/**
|
|
4706
|
+
* Synchronously returns an API handle for the given Application identity.
|
|
4707
|
+
*
|
|
4708
|
+
* @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
|
|
4709
|
+
* returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
|
|
4710
|
+
* for an Aplication throughout its entire lifecycle.
|
|
4711
|
+
*
|
|
4712
|
+
* @example
|
|
4713
|
+
*
|
|
4714
|
+
* ```js
|
|
4715
|
+
* const app = fin.Application.wrapSync({ uuid: 'testapp' });
|
|
4716
|
+
* await app.close();
|
|
4717
|
+
* ```
|
|
4718
|
+
*
|
|
4719
|
+
*/
|
|
4720
|
+
wrapSync(identity) {
|
|
4721
|
+
this.wire.sendAction('wrap-application-sync').catch((e) => {
|
|
4722
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4723
|
+
});
|
|
4724
|
+
const errorMsg = (0, validate_1$4.validateIdentity)(identity);
|
|
4725
|
+
if (errorMsg) {
|
|
4726
|
+
throw new Error(errorMsg);
|
|
4727
|
+
}
|
|
4728
|
+
return new Instance_1$5.Application(this.wire, identity);
|
|
4729
|
+
}
|
|
4730
|
+
async _create(appOptions) {
|
|
4731
|
+
// set defaults:
|
|
4732
|
+
if (appOptions.waitForPageLoad === undefined) {
|
|
4733
|
+
appOptions.waitForPageLoad = false;
|
|
4734
|
+
}
|
|
4735
|
+
if (appOptions.autoShow === undefined && appOptions.isPlatformController === undefined) {
|
|
4736
|
+
appOptions.autoShow = true;
|
|
4737
|
+
}
|
|
4738
|
+
await this.wire.sendAction('create-application', appOptions);
|
|
4739
|
+
return this.wrap({ uuid: appOptions.uuid });
|
|
4740
|
+
}
|
|
4741
|
+
/**
|
|
4742
|
+
* DEPRECATED method to create a new Application. Use {@link Application.ApplicationModule.start Application.start} instead.
|
|
4743
|
+
*
|
|
4744
|
+
* @example
|
|
4745
|
+
*
|
|
4746
|
+
* ```js
|
|
4747
|
+
* async function createApp() {
|
|
4748
|
+
* const app = await fin.Application.create({
|
|
4749
|
+
* name: 'myApp',
|
|
4750
|
+
* uuid: 'app-3',
|
|
4751
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.create.html',
|
|
4752
|
+
* autoShow: true
|
|
4753
|
+
* });
|
|
4754
|
+
* await app.run();
|
|
4755
|
+
* }
|
|
4756
|
+
*
|
|
4757
|
+
* createApp().then(() => console.log('Application is created')).catch(err => console.log(err));
|
|
4758
|
+
* ```
|
|
4759
|
+
*
|
|
4760
|
+
* @ignore
|
|
4761
|
+
*/
|
|
4762
|
+
create(appOptions) {
|
|
4763
|
+
console.warn('Deprecation Warning: fin.Application.create is deprecated. Please use fin.Application.start');
|
|
4764
|
+
this.wire.sendAction('application-create').catch((e) => {
|
|
4765
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4766
|
+
});
|
|
4767
|
+
return this._create(appOptions);
|
|
4768
|
+
}
|
|
4769
|
+
/**
|
|
4770
|
+
* Creates and starts a new Application.
|
|
4771
|
+
*
|
|
4772
|
+
* @example
|
|
4773
|
+
*
|
|
4774
|
+
* ```js
|
|
4775
|
+
* async function start() {
|
|
4776
|
+
* return fin.Application.start({
|
|
4777
|
+
* name: 'app-1',
|
|
4778
|
+
* uuid: 'app-1',
|
|
4779
|
+
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.start.html',
|
|
4780
|
+
* autoShow: true
|
|
4781
|
+
* });
|
|
4782
|
+
* }
|
|
4783
|
+
* start().then(() => console.log('Application is running')).catch(err => console.log(err));
|
|
4784
|
+
* ```
|
|
4785
|
+
*
|
|
4786
|
+
*/
|
|
4787
|
+
async start(appOptions) {
|
|
4788
|
+
this.wire.sendAction('start-application').catch((e) => {
|
|
4789
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4790
|
+
});
|
|
4791
|
+
const app = await this._create(appOptions);
|
|
4792
|
+
await this.wire.sendAction('run-application', { uuid: appOptions.uuid });
|
|
4793
|
+
return app;
|
|
4794
|
+
}
|
|
4795
|
+
/**
|
|
4796
|
+
* Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls.
|
|
4797
|
+
* Returns once the RVM is finished attempting to launch the applications.
|
|
4798
|
+
* @param opts - Parameters that the RVM will use.
|
|
4799
|
+
*
|
|
4800
|
+
* @example
|
|
4801
|
+
*
|
|
4802
|
+
* ```js
|
|
4803
|
+
*
|
|
4804
|
+
* const applicationInfoArray = [
|
|
4805
|
+
* {
|
|
4806
|
+
* "uuid": 'App-1',
|
|
4807
|
+
* "manifestUrl": 'http://localhost:5555/app1.json',
|
|
4808
|
+
* },
|
|
4809
|
+
* {
|
|
4810
|
+
* "uuid": 'App-2',
|
|
4811
|
+
* "manifestUrl": 'http://localhost:5555/app2.json',
|
|
4812
|
+
* },
|
|
4813
|
+
* {
|
|
4814
|
+
* "uuid": 'App-3',
|
|
4815
|
+
* "manifestUrl": 'http://localhost:5555/app3.json',
|
|
4816
|
+
* }
|
|
4817
|
+
* ]
|
|
4818
|
+
*
|
|
4819
|
+
* fin.Application.startManyManifests(applicationInfoArray)
|
|
4820
|
+
* .then(() => {
|
|
4821
|
+
* console.log('RVM has finished launching the application list.');
|
|
4822
|
+
* })
|
|
4823
|
+
* .catch((err) => {
|
|
4824
|
+
* console.log(err);
|
|
4825
|
+
* })
|
|
4826
|
+
* ```
|
|
4827
|
+
*
|
|
4828
|
+
* @experimental
|
|
4829
|
+
*/
|
|
4830
|
+
async startManyManifests(applications, opts) {
|
|
4831
|
+
return this.wire.sendAction('run-applications', { applications, opts }).then(() => undefined);
|
|
4832
|
+
}
|
|
4833
|
+
/**
|
|
4834
|
+
* Asynchronously returns an Application object that represents the current application
|
|
4835
|
+
*
|
|
4836
|
+
* @example
|
|
4837
|
+
*
|
|
4838
|
+
* ```js
|
|
4839
|
+
* async function isCurrentAppRunning () {
|
|
4840
|
+
* const app = await fin.Application.getCurrent();
|
|
4841
|
+
* return app.isRunning();
|
|
4842
|
+
* }
|
|
4843
|
+
*
|
|
4844
|
+
* isCurrentAppRunning().then(running => {
|
|
4845
|
+
* console.log(`Current app is running: ${running}`);
|
|
4846
|
+
* }).catch(err => {
|
|
4847
|
+
* console.error(err);
|
|
4848
|
+
* });
|
|
4849
|
+
*
|
|
4850
|
+
* ```
|
|
4851
|
+
*/
|
|
4852
|
+
getCurrent() {
|
|
4853
|
+
this.wire.sendAction('get-current-application').catch((e) => {
|
|
4854
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4855
|
+
});
|
|
4856
|
+
return this.wrap({ uuid: this.wire.me.uuid });
|
|
4857
|
+
}
|
|
4858
|
+
/**
|
|
4859
|
+
* Synchronously returns an Application object that represents the current application
|
|
4860
|
+
*
|
|
4861
|
+
* @example
|
|
4862
|
+
*
|
|
4863
|
+
* ```js
|
|
4864
|
+
* async function isCurrentAppRunning () {
|
|
4865
|
+
* const app = fin.Application.getCurrentSync();
|
|
4866
|
+
* return app.isRunning();
|
|
4867
|
+
* }
|
|
4868
|
+
*
|
|
4869
|
+
* isCurrentAppRunning().then(running => {
|
|
4870
|
+
* console.log(`Current app is running: ${running}`);
|
|
4871
|
+
* }).catch(err => {
|
|
4872
|
+
* console.error(err);
|
|
4873
|
+
* });
|
|
4874
|
+
*
|
|
4875
|
+
* ```
|
|
4876
|
+
*/
|
|
4877
|
+
getCurrentSync() {
|
|
4878
|
+
this.wire.sendAction('get-current-application-sync').catch((e) => {
|
|
4879
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4880
|
+
});
|
|
4881
|
+
return this.wrapSync({ uuid: this.wire.me.uuid });
|
|
4882
|
+
}
|
|
4883
|
+
/**
|
|
4884
|
+
* Retrieves application's manifest and returns a running instance of the application.
|
|
4885
|
+
* @param manifestUrl - The URL of app's manifest.
|
|
4886
|
+
* @param opts - Parameters that the RVM will use.
|
|
4887
|
+
*
|
|
4888
|
+
* @example
|
|
4889
|
+
*
|
|
4890
|
+
* ```js
|
|
4891
|
+
* fin.Application.startFromManifest('http://localhost:5555/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
|
|
4892
|
+
*
|
|
4893
|
+
* // For a local manifest file:
|
|
4894
|
+
* fin.Application.startFromManifest('file:///C:/somefolder/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
|
|
4895
|
+
* ```
|
|
4896
|
+
*/
|
|
4897
|
+
async startFromManifest(manifestUrl, opts) {
|
|
4898
|
+
this.wire.sendAction('application-start-from-manifest').catch((e) => {
|
|
4899
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4900
|
+
});
|
|
4901
|
+
const app = await this._createFromManifest(manifestUrl);
|
|
4902
|
+
// @ts-expect-error using private method without warning.
|
|
4903
|
+
await app._run(opts); // eslint-disable-line no-underscore-dangle
|
|
4904
|
+
return app;
|
|
4905
|
+
}
|
|
4906
|
+
/**
|
|
4907
|
+
* @deprecated Use {@link Application.ApplicationModule.startFromManifest Application.startFromManifest} instead.
|
|
4908
|
+
* Retrieves application's manifest and returns a wrapped application.
|
|
4909
|
+
* @param manifestUrl - The URL of app's manifest.
|
|
4910
|
+
* @param callback - called if the method succeeds.
|
|
4911
|
+
* @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
|
|
4912
|
+
*
|
|
4913
|
+
* @example
|
|
4914
|
+
*
|
|
4915
|
+
* ```js
|
|
4916
|
+
* fin.Application.createFromManifest('http://localhost:5555/app.json').then(app => console.log(app)).catch(err => console.log(err));
|
|
4917
|
+
* ```
|
|
4918
|
+
* @ignore
|
|
4919
|
+
*/
|
|
4920
|
+
createFromManifest(manifestUrl) {
|
|
4921
|
+
console.warn('Deprecation Warning: fin.Application.createFromManifest is deprecated. Please use fin.Application.startFromManifest');
|
|
4922
|
+
this.wire.sendAction('application-create-from-manifest').catch((e) => {
|
|
4923
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4924
|
+
});
|
|
4925
|
+
return this._createFromManifest(manifestUrl);
|
|
4926
|
+
}
|
|
4927
|
+
_createFromManifest(manifestUrl) {
|
|
4928
|
+
return this.wire
|
|
4929
|
+
.sendAction('get-application-manifest', { manifestUrl })
|
|
4930
|
+
.then(({ payload }) => {
|
|
4931
|
+
const uuid = payload.data.platform ? payload.data.platform.uuid : payload.data.startup_app.uuid;
|
|
4932
|
+
return this.wrap({ uuid });
|
|
4933
|
+
})
|
|
4934
|
+
.then((app) => {
|
|
4935
|
+
app._manifestUrl = manifestUrl; // eslint-disable-line no-underscore-dangle
|
|
4936
|
+
return app;
|
|
4937
|
+
});
|
|
4938
|
+
}
|
|
4939
|
+
}
|
|
4940
|
+
Factory$6.ApplicationModule = ApplicationModule;
|
|
4677
4941
|
|
|
4678
|
-
function
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
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 });
|
|
4686
4958
|
/**
|
|
4687
|
-
*
|
|
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
|
|
4688
4968
|
*/
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
*
|
|
4693
|
-
* @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
|
|
4694
|
-
* returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
|
|
4695
|
-
* for an Application throughout its entire lifecycle.
|
|
4696
|
-
*
|
|
4697
|
-
* @example
|
|
4698
|
-
*
|
|
4699
|
-
* ```js
|
|
4700
|
-
* fin.Application.wrap({ uuid: 'testapp' })
|
|
4701
|
-
* .then(app => app.isRunning())
|
|
4702
|
-
* .then(running => console.log('Application is running: ' + running))
|
|
4703
|
-
* .catch(err => console.log(err));
|
|
4704
|
-
* ```
|
|
4705
|
-
*
|
|
4706
|
-
*/
|
|
4707
|
-
async wrap(identity) {
|
|
4708
|
-
this.wire.sendAction('wrap-application').catch((e) => {
|
|
4709
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4710
|
-
});
|
|
4711
|
-
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
4712
|
-
if (errorMsg) {
|
|
4713
|
-
throw new Error(errorMsg);
|
|
4714
|
-
}
|
|
4715
|
-
return new Instance_1.Application(this.wire, identity);
|
|
4716
|
-
}
|
|
4717
|
-
/**
|
|
4718
|
-
* Synchronously returns an API handle for the given Application identity.
|
|
4719
|
-
*
|
|
4720
|
-
* @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
|
|
4721
|
-
* returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
|
|
4722
|
-
* for an Aplication throughout its entire lifecycle.
|
|
4723
|
-
*
|
|
4724
|
-
* @example
|
|
4725
|
-
*
|
|
4726
|
-
* ```js
|
|
4727
|
-
* const app = fin.Application.wrapSync({ uuid: 'testapp' });
|
|
4728
|
-
* await app.close();
|
|
4729
|
-
* ```
|
|
4730
|
-
*
|
|
4731
|
-
*/
|
|
4732
|
-
wrapSync(identity) {
|
|
4733
|
-
this.wire.sendAction('wrap-application-sync').catch((e) => {
|
|
4734
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4735
|
-
});
|
|
4736
|
-
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
4737
|
-
if (errorMsg) {
|
|
4738
|
-
throw new Error(errorMsg);
|
|
4739
|
-
}
|
|
4740
|
-
return new Instance_1.Application(this.wire, identity);
|
|
4741
|
-
}
|
|
4742
|
-
async _create(appOptions) {
|
|
4743
|
-
// set defaults:
|
|
4744
|
-
if (appOptions.waitForPageLoad === undefined) {
|
|
4745
|
-
appOptions.waitForPageLoad = false;
|
|
4746
|
-
}
|
|
4747
|
-
if (appOptions.autoShow === undefined && appOptions.isPlatformController === undefined) {
|
|
4748
|
-
appOptions.autoShow = true;
|
|
4749
|
-
}
|
|
4750
|
-
await this.wire.sendAction('create-application', appOptions);
|
|
4751
|
-
return this.wrap({ uuid: appOptions.uuid });
|
|
4752
|
-
}
|
|
4753
|
-
/**
|
|
4754
|
-
* DEPRECATED method to create a new Application. Use {@link Application.ApplicationModule.start Application.start} instead.
|
|
4755
|
-
*
|
|
4756
|
-
* @example
|
|
4757
|
-
*
|
|
4758
|
-
* ```js
|
|
4759
|
-
* async function createApp() {
|
|
4760
|
-
* const app = await fin.Application.create({
|
|
4761
|
-
* name: 'myApp',
|
|
4762
|
-
* uuid: 'app-3',
|
|
4763
|
-
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.create.html',
|
|
4764
|
-
* autoShow: true
|
|
4765
|
-
* });
|
|
4766
|
-
* await app.run();
|
|
4767
|
-
* }
|
|
4768
|
-
*
|
|
4769
|
-
* createApp().then(() => console.log('Application is created')).catch(err => console.log(err));
|
|
4770
|
-
* ```
|
|
4771
|
-
*
|
|
4772
|
-
* @ignore
|
|
4773
|
-
*/
|
|
4774
|
-
create(appOptions) {
|
|
4775
|
-
console.warn('Deprecation Warning: fin.Application.create is deprecated. Please use fin.Application.start');
|
|
4776
|
-
this.wire.sendAction('application-create').catch((e) => {
|
|
4777
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4778
|
-
});
|
|
4779
|
-
return this._create(appOptions);
|
|
4780
|
-
}
|
|
4781
|
-
/**
|
|
4782
|
-
* Creates and starts a new Application.
|
|
4783
|
-
*
|
|
4784
|
-
* @example
|
|
4785
|
-
*
|
|
4786
|
-
* ```js
|
|
4787
|
-
* async function start() {
|
|
4788
|
-
* return fin.Application.start({
|
|
4789
|
-
* name: 'app-1',
|
|
4790
|
-
* uuid: 'app-1',
|
|
4791
|
-
* url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.start.html',
|
|
4792
|
-
* autoShow: true
|
|
4793
|
-
* });
|
|
4794
|
-
* }
|
|
4795
|
-
* start().then(() => console.log('Application is running')).catch(err => console.log(err));
|
|
4796
|
-
* ```
|
|
4797
|
-
*
|
|
4798
|
-
*/
|
|
4799
|
-
async start(appOptions) {
|
|
4800
|
-
this.wire.sendAction('start-application').catch((e) => {
|
|
4801
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4802
|
-
});
|
|
4803
|
-
const app = await this._create(appOptions);
|
|
4804
|
-
await this.wire.sendAction('run-application', { uuid: appOptions.uuid });
|
|
4805
|
-
return app;
|
|
4806
|
-
}
|
|
4807
|
-
/**
|
|
4808
|
-
* Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls.
|
|
4809
|
-
* Returns once the RVM is finished attempting to launch the applications.
|
|
4810
|
-
* @param opts - Parameters that the RVM will use.
|
|
4811
|
-
*
|
|
4812
|
-
* @example
|
|
4813
|
-
*
|
|
4814
|
-
* ```js
|
|
4815
|
-
*
|
|
4816
|
-
* const applicationInfoArray = [
|
|
4817
|
-
* {
|
|
4818
|
-
* "uuid": 'App-1',
|
|
4819
|
-
* "manifestUrl": 'http://localhost:5555/app1.json',
|
|
4820
|
-
* },
|
|
4821
|
-
* {
|
|
4822
|
-
* "uuid": 'App-2',
|
|
4823
|
-
* "manifestUrl": 'http://localhost:5555/app2.json',
|
|
4824
|
-
* },
|
|
4825
|
-
* {
|
|
4826
|
-
* "uuid": 'App-3',
|
|
4827
|
-
* "manifestUrl": 'http://localhost:5555/app3.json',
|
|
4828
|
-
* }
|
|
4829
|
-
* ]
|
|
4830
|
-
*
|
|
4831
|
-
* fin.Application.startManyManifests(applicationInfoArray)
|
|
4832
|
-
* .then(() => {
|
|
4833
|
-
* console.log('RVM has finished launching the application list.');
|
|
4834
|
-
* })
|
|
4835
|
-
* .catch((err) => {
|
|
4836
|
-
* console.log(err);
|
|
4837
|
-
* })
|
|
4838
|
-
* ```
|
|
4839
|
-
*
|
|
4840
|
-
* @experimental
|
|
4841
|
-
*/
|
|
4842
|
-
async startManyManifests(applications, opts) {
|
|
4843
|
-
return this.wire.sendAction('run-applications', { applications, opts }).then(() => undefined);
|
|
4844
|
-
}
|
|
4845
|
-
/**
|
|
4846
|
-
* Asynchronously returns an Application object that represents the current application
|
|
4847
|
-
*
|
|
4848
|
-
* @example
|
|
4849
|
-
*
|
|
4850
|
-
* ```js
|
|
4851
|
-
* async function isCurrentAppRunning () {
|
|
4852
|
-
* const app = await fin.Application.getCurrent();
|
|
4853
|
-
* return app.isRunning();
|
|
4854
|
-
* }
|
|
4855
|
-
*
|
|
4856
|
-
* isCurrentAppRunning().then(running => {
|
|
4857
|
-
* console.log(`Current app is running: ${running}`);
|
|
4858
|
-
* }).catch(err => {
|
|
4859
|
-
* console.error(err);
|
|
4860
|
-
* });
|
|
4861
|
-
*
|
|
4862
|
-
* ```
|
|
4863
|
-
*/
|
|
4864
|
-
getCurrent() {
|
|
4865
|
-
this.wire.sendAction('get-current-application').catch((e) => {
|
|
4866
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4867
|
-
});
|
|
4868
|
-
return this.wrap({ uuid: this.wire.me.uuid });
|
|
4869
|
-
}
|
|
4870
|
-
/**
|
|
4871
|
-
* Synchronously returns an Application object that represents the current application
|
|
4872
|
-
*
|
|
4873
|
-
* @example
|
|
4874
|
-
*
|
|
4875
|
-
* ```js
|
|
4876
|
-
* async function isCurrentAppRunning () {
|
|
4877
|
-
* const app = fin.Application.getCurrentSync();
|
|
4878
|
-
* return app.isRunning();
|
|
4879
|
-
* }
|
|
4880
|
-
*
|
|
4881
|
-
* isCurrentAppRunning().then(running => {
|
|
4882
|
-
* console.log(`Current app is running: ${running}`);
|
|
4883
|
-
* }).catch(err => {
|
|
4884
|
-
* console.error(err);
|
|
4885
|
-
* });
|
|
4886
|
-
*
|
|
4887
|
-
* ```
|
|
4888
|
-
*/
|
|
4889
|
-
getCurrentSync() {
|
|
4890
|
-
this.wire.sendAction('get-current-application-sync').catch((e) => {
|
|
4891
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4892
|
-
});
|
|
4893
|
-
return this.wrapSync({ uuid: this.wire.me.uuid });
|
|
4894
|
-
}
|
|
4895
|
-
/**
|
|
4896
|
-
* Retrieves application's manifest and returns a running instance of the application.
|
|
4897
|
-
* @param manifestUrl - The URL of app's manifest.
|
|
4898
|
-
* @param opts - Parameters that the RVM will use.
|
|
4899
|
-
*
|
|
4900
|
-
* @example
|
|
4901
|
-
*
|
|
4902
|
-
* ```js
|
|
4903
|
-
* fin.Application.startFromManifest('http://localhost:5555/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
|
|
4904
|
-
*
|
|
4905
|
-
* // For a local manifest file:
|
|
4906
|
-
* fin.Application.startFromManifest('file:///C:/somefolder/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
|
|
4907
|
-
* ```
|
|
4908
|
-
*/
|
|
4909
|
-
async startFromManifest(manifestUrl, opts) {
|
|
4910
|
-
this.wire.sendAction('application-start-from-manifest').catch((e) => {
|
|
4911
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4912
|
-
});
|
|
4913
|
-
const app = await this._createFromManifest(manifestUrl);
|
|
4914
|
-
// @ts-expect-error using private method without warning.
|
|
4915
|
-
await app._run(opts); // eslint-disable-line no-underscore-dangle
|
|
4916
|
-
return app;
|
|
4917
|
-
}
|
|
4918
|
-
/**
|
|
4919
|
-
* @deprecated Use {@link Application.ApplicationModule.startFromManifest Application.startFromManifest} instead.
|
|
4920
|
-
* Retrieves application's manifest and returns a wrapped application.
|
|
4921
|
-
* @param manifestUrl - The URL of app's manifest.
|
|
4922
|
-
* @param callback - called if the method succeeds.
|
|
4923
|
-
* @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
|
|
4924
|
-
*
|
|
4925
|
-
* @example
|
|
4926
|
-
*
|
|
4927
|
-
* ```js
|
|
4928
|
-
* fin.Application.createFromManifest('http://localhost:5555/app.json').then(app => console.log(app)).catch(err => console.log(err));
|
|
4929
|
-
* ```
|
|
4930
|
-
* @ignore
|
|
4931
|
-
*/
|
|
4932
|
-
createFromManifest(manifestUrl) {
|
|
4933
|
-
console.warn('Deprecation Warning: fin.Application.createFromManifest is deprecated. Please use fin.Application.startFromManifest');
|
|
4934
|
-
this.wire.sendAction('application-create-from-manifest').catch((e) => {
|
|
4935
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
4936
|
-
});
|
|
4937
|
-
return this._createFromManifest(manifestUrl);
|
|
4938
|
-
}
|
|
4939
|
-
_createFromManifest(manifestUrl) {
|
|
4940
|
-
return this.wire
|
|
4941
|
-
.sendAction('get-application-manifest', { manifestUrl })
|
|
4942
|
-
.then(({ payload }) => {
|
|
4943
|
-
const uuid = payload.data.platform ? payload.data.platform.uuid : payload.data.startup_app.uuid;
|
|
4944
|
-
return this.wrap({ uuid });
|
|
4945
|
-
})
|
|
4946
|
-
.then((app) => {
|
|
4947
|
-
app._manifestUrl = manifestUrl; // eslint-disable-line no-underscore-dangle
|
|
4948
|
-
return app;
|
|
4949
|
-
});
|
|
4950
|
-
}
|
|
4951
|
-
}
|
|
4952
|
-
Factory$6.ApplicationModule = ApplicationModule;
|
|
4953
|
-
return Factory$6;
|
|
4954
|
-
}
|
|
4955
|
-
|
|
4956
|
-
var hasRequiredApplication;
|
|
4957
|
-
|
|
4958
|
-
function requireApplication () {
|
|
4959
|
-
if (hasRequiredApplication) return application;
|
|
4960
|
-
hasRequiredApplication = 1;
|
|
4961
|
-
(function (exports) {
|
|
4962
|
-
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4963
|
-
if (k2 === undefined) k2 = k;
|
|
4964
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4965
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
4966
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
4967
|
-
}
|
|
4968
|
-
Object.defineProperty(o, k2, desc);
|
|
4969
|
-
}) : (function(o, m, k, k2) {
|
|
4970
|
-
if (k2 === undefined) k2 = k;
|
|
4971
|
-
o[k2] = m[k];
|
|
4972
|
-
}));
|
|
4973
|
-
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
4974
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
4975
|
-
};
|
|
4976
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4977
|
-
/**
|
|
4978
|
-
* Entry points for the OpenFin `Application` API (`fin.Application`).
|
|
4979
|
-
*
|
|
4980
|
-
* * {@link ApplicationModule} contains static members of the `Application` API, accessible through `fin.Application`.
|
|
4981
|
-
* * {@link Application} describes an instance of an OpenFin Application, e.g. as returned by `fin.Application.getCurrent`.
|
|
4982
|
-
*
|
|
4983
|
-
* 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),
|
|
4984
|
-
* both of these were documented on the same page.
|
|
4985
|
-
*
|
|
4986
|
-
* @packageDocumentation
|
|
4987
|
-
*/
|
|
4988
|
-
__exportStar(requireFactory$1(), exports);
|
|
4989
|
-
__exportStar(requireInstance$2(), exports);
|
|
4990
|
-
} (application));
|
|
4991
|
-
return application;
|
|
4992
|
-
}
|
|
4969
|
+
__exportStar(Factory$6, exports);
|
|
4970
|
+
__exportStar(Instance$5, exports);
|
|
4971
|
+
} (application));
|
|
4993
4972
|
|
|
4994
4973
|
var promisifySubscription$1 = {};
|
|
4995
4974
|
|
|
@@ -5033,7 +5012,7 @@ function requireInstance$1 () {
|
|
|
5033
5012
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
5034
5013
|
/* eslint-disable no-console */
|
|
5035
5014
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
5036
|
-
const application_1 =
|
|
5015
|
+
const application_1 = application;
|
|
5037
5016
|
const main_1 = main;
|
|
5038
5017
|
const view_1 = requireView();
|
|
5039
5018
|
const warnings_1 = warnings;
|
|
@@ -7094,7 +7073,7 @@ function requireView () {
|
|
|
7094
7073
|
*
|
|
7095
7074
|
* @packageDocumentation
|
|
7096
7075
|
*/
|
|
7097
|
-
__exportStar(requireFactory$
|
|
7076
|
+
__exportStar(requireFactory$1(), exports);
|
|
7098
7077
|
__exportStar(requireInstance(), exports);
|
|
7099
7078
|
} (view));
|
|
7100
7079
|
return view;
|
|
@@ -17514,7 +17493,24 @@ var _NotificationManagerInstance_wire, _NotificationManagerInstance_handler, _No
|
|
|
17514
17493
|
Object.defineProperty(instance, "__esModule", { value: true });
|
|
17515
17494
|
instance.NotificationManagerInstance = void 0;
|
|
17516
17495
|
const lazy_1 = lazy;
|
|
17496
|
+
/**
|
|
17497
|
+
* NotificationManagers allow all {@link https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API | HTML5 notifications} created in the application to be intercepted and dispatched.
|
|
17498
|
+
*
|
|
17499
|
+
* Please note, currently Notifications will only be intercepted if the following conditions are met:
|
|
17500
|
+
* - The source WebContents has the `notification` webAPI permission.
|
|
17501
|
+
* - The source WebContents is not a service worker.
|
|
17502
|
+
*
|
|
17503
|
+
* Service worker and push notifications are currently not supported.
|
|
17504
|
+
*
|
|
17505
|
+
* **See also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API | Notification API (MDN)}
|
|
17506
|
+
*
|
|
17507
|
+
* @experimental This API is subject to change in future releases.
|
|
17508
|
+
*
|
|
17509
|
+
*/
|
|
17517
17510
|
class NotificationManagerInstance {
|
|
17511
|
+
/**
|
|
17512
|
+
* @internal
|
|
17513
|
+
*/
|
|
17518
17514
|
constructor(wire, id) {
|
|
17519
17515
|
_NotificationManagerInstance_wire.set(this, void 0);
|
|
17520
17516
|
_NotificationManagerInstance_handler.set(this, void 0);
|
|
@@ -17544,13 +17540,60 @@ class NotificationManagerInstance {
|
|
|
17544
17540
|
});
|
|
17545
17541
|
return true;
|
|
17546
17542
|
}));
|
|
17543
|
+
/**
|
|
17544
|
+
* Sets the current handler for notifications. The provided function will be invoked whenever a WebContents successfully raises a notification.
|
|
17545
|
+
*
|
|
17546
|
+
* **Note**, only one handler can be used at a time, calling `setNotificationHandler` will replace any existing registered handler.
|
|
17547
|
+
*
|
|
17548
|
+
* @param handler The notification handler callback which will be invoked whenever a notification is created.
|
|
17549
|
+
*
|
|
17550
|
+
* @example
|
|
17551
|
+
*
|
|
17552
|
+
* ```typescript
|
|
17553
|
+
* const notificationManager = await fin.NotificationManager.init();
|
|
17554
|
+
* const handler = (notification) => {
|
|
17555
|
+
* console.log("Received the following notification", info);
|
|
17556
|
+
* }
|
|
17557
|
+
* await notificationManager.setNotificationHandler(handler);
|
|
17558
|
+
* ```
|
|
17559
|
+
*/
|
|
17547
17560
|
this.setNotificationHandler = async (handler) => {
|
|
17548
17561
|
await __classPrivateFieldGet(this, _NotificationManagerInstance_isReceivingNotifications, "f").getValue();
|
|
17549
17562
|
__classPrivateFieldSet(this, _NotificationManagerInstance_handler, handler, "f");
|
|
17550
17563
|
};
|
|
17564
|
+
/**
|
|
17565
|
+
* Destroys the current NotificationManagerInstance.
|
|
17566
|
+
*
|
|
17567
|
+
* @example
|
|
17568
|
+
* ```typescript
|
|
17569
|
+
* await notificationManager.destroy();
|
|
17570
|
+
* ```
|
|
17571
|
+
*/
|
|
17551
17572
|
this.destroy = async () => {
|
|
17552
17573
|
await __classPrivateFieldGet(this, _NotificationManagerInstance_wire, "f").sendAction('destroy-notification-manager', { managerId: __classPrivateFieldGet(this, _NotificationManagerInstance_id, "f") });
|
|
17553
17574
|
};
|
|
17575
|
+
/**
|
|
17576
|
+
* Dispatches a Notification lifecycle event ('close' | 'click' | 'show').
|
|
17577
|
+
*
|
|
17578
|
+
* @param event Identifies the type of event to emit, and which `notificationId` to emit it for.
|
|
17579
|
+
*
|
|
17580
|
+
* @example
|
|
17581
|
+
* ```typescript
|
|
17582
|
+
* notificationManager.setNotificationHandler((notification) => {
|
|
17583
|
+
* await mockNotificationUi.showNotification(notification);
|
|
17584
|
+
* await notificationManager.dispatchNotificationEvent({
|
|
17585
|
+
* notificationId: notification.notificationId,
|
|
17586
|
+
* type: 'show
|
|
17587
|
+
* })
|
|
17588
|
+
* })
|
|
17589
|
+
* ```
|
|
17590
|
+
*
|
|
17591
|
+
* **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/click_event | Notification Click Event (MDN)}
|
|
17592
|
+
*
|
|
17593
|
+
* **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/close_event | Notification Close Event (MDN)}
|
|
17594
|
+
*
|
|
17595
|
+
* **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/show_event | Notification Show Event (MDN)}
|
|
17596
|
+
*/
|
|
17554
17597
|
this.dispatch = async (event) => {
|
|
17555
17598
|
const { notificationId, type } = event;
|
|
17556
17599
|
await __classPrivateFieldGet(this, _NotificationManagerInstance_wire, "f").sendAction('dispatch-notification-event', {
|
|
@@ -17572,6 +17615,24 @@ const instance_1 = instance;
|
|
|
17572
17615
|
class NotificationManagerModule extends base_1.Base {
|
|
17573
17616
|
constructor() {
|
|
17574
17617
|
super(...arguments);
|
|
17618
|
+
/**
|
|
17619
|
+
* Initializes a NotificationManager for the current application, which allows interception of HTML5 web notifications.
|
|
17620
|
+
*
|
|
17621
|
+
* Secured by default, must be called from a WebContents with the NotificationManager.init permission.
|
|
17622
|
+
*
|
|
17623
|
+
* Only one NotificationManager can be active at a time, calls to `init` will fail otherwise.
|
|
17624
|
+
*
|
|
17625
|
+
* If a WebContents with the NotificationManager active reloads or is closed, it will be possible to create a new one.
|
|
17626
|
+
*
|
|
17627
|
+
* @example
|
|
17628
|
+
*
|
|
17629
|
+
* ```js
|
|
17630
|
+
* // From Provider context
|
|
17631
|
+
* const notificationManager = await fin.NotificationManager.init();
|
|
17632
|
+
* // NotificationManager is now active and will intercept all incoming notifications.
|
|
17633
|
+
* ```
|
|
17634
|
+
* @experimental
|
|
17635
|
+
*/
|
|
17575
17636
|
this.init = async () => {
|
|
17576
17637
|
const { payload: { data: { managerId } } } = await this.wire.sendAction('init-notification-manager');
|
|
17577
17638
|
const manager = new instance_1.NotificationManagerInstance(this.wire, managerId);
|
|
@@ -17597,6 +17658,13 @@ factory.NotificationManagerModule = NotificationManagerModule;
|
|
|
17597
17658
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17598
17659
|
};
|
|
17599
17660
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17661
|
+
/**
|
|
17662
|
+
* Entry point for the OpenFin `NotificationManager` API (`fin.NotificationManager`).
|
|
17663
|
+
*
|
|
17664
|
+
* * {@link NotificationManagerModule} contains static initialisation apis to create a {@link NotificationManagerInstance} instance.
|
|
17665
|
+
*
|
|
17666
|
+
* @packageDocumentation
|
|
17667
|
+
*/
|
|
17600
17668
|
__exportStar(factory, exports);
|
|
17601
17669
|
__exportStar(instance, exports);
|
|
17602
17670
|
} (notificationManager));
|
|
@@ -17607,7 +17675,7 @@ const events_1 = require$$0;
|
|
|
17607
17675
|
// Import from the file rather than the directory in case someone consuming types is using module resolution other than "node"
|
|
17608
17676
|
const index_1 = system;
|
|
17609
17677
|
const index_2 = requireWindow();
|
|
17610
|
-
const index_3 =
|
|
17678
|
+
const index_3 = application;
|
|
17611
17679
|
const index_4 = interappbus;
|
|
17612
17680
|
const index_5 = clipboard;
|
|
17613
17681
|
const index_6 = externalApplication;
|