@openfin/core 25.68.26
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/LICENSE +13 -0
- package/NOTICE +16 -0
- package/OpenFin.d.ts +1340 -0
- package/README.md +41 -0
- package/docs.README(OLD).md +82 -0
- package/fin.d.ts +4 -0
- package/package.json +33 -0
- package/resources/win/OpenFinRVM.exe +0 -0
- package/src/api/application/Factory.d.ts +145 -0
- package/src/api/application/Factory.js +229 -0
- package/src/api/application/Instance.d.ts +302 -0
- package/src/api/application/Instance.js +412 -0
- package/src/api/application/index.d.ts +3 -0
- package/src/api/application/index.js +15 -0
- package/src/api/base.d.ts +43 -0
- package/src/api/base.js +177 -0
- package/src/api/clipboard/index.d.ts +69 -0
- package/src/api/clipboard/index.js +88 -0
- package/src/api/events/application.d.ts +69 -0
- package/src/api/events/application.js +2 -0
- package/src/api/events/base.d.ts +17 -0
- package/src/api/events/base.js +2 -0
- package/src/api/events/channel.d.ts +10 -0
- package/src/api/events/channel.js +2 -0
- package/src/api/events/emitterMap.d.ts +11 -0
- package/src/api/events/emitterMap.js +35 -0
- package/src/api/events/eventAggregator.d.ts +5 -0
- package/src/api/events/eventAggregator.js +43 -0
- package/src/api/events/externalApplication.d.ts +5 -0
- package/src/api/events/externalApplication.js +2 -0
- package/src/api/events/frame.d.ts +9 -0
- package/src/api/events/frame.js +2 -0
- package/src/api/events/globalHotkey.d.ts +10 -0
- package/src/api/events/globalHotkey.js +2 -0
- package/src/api/events/platform.d.ts +18 -0
- package/src/api/events/platform.js +2 -0
- package/src/api/events/system.d.ts +22 -0
- package/src/api/events/system.js +2 -0
- package/src/api/events/view.d.ts +56 -0
- package/src/api/events/view.js +2 -0
- package/src/api/events/webcontents.d.ts +48 -0
- package/src/api/events/webcontents.js +2 -0
- package/src/api/events/window.d.ts +169 -0
- package/src/api/events/window.js +2 -0
- package/src/api/external-application/Factory.d.ts +26 -0
- package/src/api/external-application/Factory.js +40 -0
- package/src/api/external-application/Instance.d.ts +102 -0
- package/src/api/external-application/Instance.js +109 -0
- package/src/api/external-application/index.d.ts +3 -0
- package/src/api/external-application/index.js +15 -0
- package/src/api/fin.d.ts +49 -0
- package/src/api/fin.js +43 -0
- package/src/api/frame/Factory.d.ts +36 -0
- package/src/api/frame/Factory.js +69 -0
- package/src/api/frame/Instance.d.ts +121 -0
- package/src/api/frame/Instance.js +130 -0
- package/src/api/frame/index.d.ts +3 -0
- package/src/api/frame/index.js +15 -0
- package/src/api/global-hotkey/index.d.ts +38 -0
- package/src/api/global-hotkey/index.js +58 -0
- package/src/api/interappbus/channel/channel.d.ts +26 -0
- package/src/api/interappbus/channel/channel.js +77 -0
- package/src/api/interappbus/channel/channels-docs.d.ts +318 -0
- package/src/api/interappbus/channel/channels-docs.js +376 -0
- package/src/api/interappbus/channel/client.d.ts +22 -0
- package/src/api/interappbus/channel/client.js +84 -0
- package/src/api/interappbus/channel/connection-manager.d.ts +28 -0
- package/src/api/interappbus/channel/connection-manager.js +244 -0
- package/src/api/interappbus/channel/index.d.ts +22 -0
- package/src/api/interappbus/channel/index.js +121 -0
- package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +13 -0
- package/src/api/interappbus/channel/protocols/classic/message-receiver.js +73 -0
- package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +22 -0
- package/src/api/interappbus/channel/protocols/classic/strategy.js +84 -0
- package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +20 -0
- package/src/api/interappbus/channel/protocols/combined/strategy.js +58 -0
- package/src/api/interappbus/channel/protocols/index.d.ts +44 -0
- package/src/api/interappbus/channel/protocols/index.js +2 -0
- package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +10 -0
- package/src/api/interappbus/channel/protocols/protocol-manager.js +43 -0
- package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +23 -0
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +135 -0
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +30 -0
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +131 -0
- package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +22 -0
- package/src/api/interappbus/channel/protocols/rtc/strategy.js +87 -0
- package/src/api/interappbus/channel/protocols/strategy-types.d.ts +13 -0
- package/src/api/interappbus/channel/protocols/strategy-types.js +2 -0
- package/src/api/interappbus/channel/protocols/strategy.d.ts +15 -0
- package/src/api/interappbus/channel/protocols/strategy.js +2 -0
- package/src/api/interappbus/channel/provider.d.ts +31 -0
- package/src/api/interappbus/channel/provider.js +165 -0
- package/src/api/interappbus/index.d.ts +85 -0
- package/src/api/interappbus/index.js +175 -0
- package/src/api/interop/Factory.d.ts +37 -0
- package/src/api/interop/Factory.js +54 -0
- package/src/api/interop/InteropBroker.d.ts +363 -0
- package/src/api/interop/InteropBroker.js +914 -0
- package/src/api/interop/InteropClient.d.ts +268 -0
- package/src/api/interop/InteropClient.js +450 -0
- package/src/api/interop/SessionContextGroupBroker.d.ts +26 -0
- package/src/api/interop/SessionContextGroupBroker.js +107 -0
- package/src/api/interop/SessionContextGroupClient.d.ts +20 -0
- package/src/api/interop/SessionContextGroupClient.js +85 -0
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +187 -0
- package/src/api/interop/fdc3/fdc3-1.2.js +385 -0
- package/src/api/interop/fdc3/fdc3.js +17 -0
- package/src/api/interop/fdc3/utils.d.ts +6 -0
- package/src/api/interop/fdc3/utils.js +17 -0
- package/src/api/interop/index.d.ts +4 -0
- package/src/api/interop/index.js +16 -0
- package/src/api/interop/utils.d.ts +11 -0
- package/src/api/interop/utils.js +36 -0
- package/src/api/me.d.ts +35 -0
- package/src/api/me.js +60 -0
- package/src/api/platform/Factory.d.ts +109 -0
- package/src/api/platform/Factory.js +188 -0
- package/src/api/platform/Instance.d.ts +122 -0
- package/src/api/platform/Instance.js +299 -0
- package/src/api/platform/common-utils.d.ts +6 -0
- package/src/api/platform/common-utils.js +16 -0
- package/src/api/platform/index.d.ts +3 -0
- package/src/api/platform/index.js +15 -0
- package/src/api/platform/layout/Factory.d.ts +108 -0
- package/src/api/platform/layout/Factory.js +189 -0
- package/src/api/platform/layout/Instance.d.ts +48 -0
- package/src/api/platform/layout/Instance.js +99 -0
- package/src/api/platform/layout/index.d.ts +3 -0
- package/src/api/platform/layout/index.js +15 -0
- package/src/api/platform/layout/shapes.d.ts +11 -0
- package/src/api/platform/layout/shapes.js +2 -0
- package/src/api/snapshot-source/Factory.d.ts +36 -0
- package/src/api/snapshot-source/Factory.js +65 -0
- package/src/api/snapshot-source/Instance.d.ts +30 -0
- package/src/api/snapshot-source/Instance.js +134 -0
- package/src/api/snapshot-source/index.d.ts +3 -0
- package/src/api/snapshot-source/index.js +15 -0
- package/src/api/snapshot-source/utils.d.ts +1 -0
- package/src/api/snapshot-source/utils.js +5 -0
- package/src/api/system/application.d.ts +6 -0
- package/src/api/system/application.js +2 -0
- package/src/api/system/entity.d.ts +11 -0
- package/src/api/system/entity.js +2 -0
- package/src/api/system/index.d.ts +957 -0
- package/src/api/system/index.js +1241 -0
- package/src/api/system/installedApps.d.ts +6 -0
- package/src/api/system/installedApps.js +2 -0
- package/src/api/system/log.d.ts +11 -0
- package/src/api/system/log.js +2 -0
- package/src/api/system/process.d.ts +15 -0
- package/src/api/system/process.js +2 -0
- package/src/api/system/proxy.d.ts +15 -0
- package/src/api/system/proxy.js +2 -0
- package/src/api/system/queryPermissionTypes.d.ts +1 -0
- package/src/api/system/queryPermissionTypes.js +2 -0
- package/src/api/system/registry-info.d.ts +7 -0
- package/src/api/system/registry-info.js +2 -0
- package/src/api/system/window.d.ts +16 -0
- package/src/api/system/window.js +2 -0
- package/src/api/view/Factory.d.ts +49 -0
- package/src/api/view/Factory.js +103 -0
- package/src/api/view/Instance.d.ts +379 -0
- package/src/api/view/Instance.js +415 -0
- package/src/api/view/index.d.ts +3 -0
- package/src/api/view/index.js +15 -0
- package/src/api/webcontents/main.d.ts +36 -0
- package/src/api/webcontents/main.js +82 -0
- package/src/api/window/Factory.d.ts +44 -0
- package/src/api/window/Factory.js +91 -0
- package/src/api/window/Instance.d.ts +966 -0
- package/src/api/window/Instance.js +1202 -0
- package/src/api/window/bounds-changed.d.ts +10 -0
- package/src/api/window/bounds-changed.js +6 -0
- package/src/api/window/index.d.ts +5 -0
- package/src/api/window/index.js +17 -0
- package/src/api/window/shapes.d.ts +13 -0
- package/src/api/window/shapes.js +2 -0
- package/src/environment/environment.d.ts +28 -0
- package/src/environment/environment.js +4 -0
- package/src/environment/node-env.d.ts +25 -0
- package/src/environment/node-env.js +64 -0
- package/src/environment/openfin-env.d.ts +29 -0
- package/src/environment/openfin-env.js +105 -0
- package/src/mock.d.ts +4 -0
- package/src/mock.js +91 -0
- package/src/shapes/ERROR_BOX_TYPES.d.ts +6 -0
- package/src/shapes/ERROR_BOX_TYPES.js +10 -0
- package/src/shapes/EntityType.d.ts +1 -0
- package/src/shapes/EntityType.js +2 -0
- package/src/shapes/LayoutPresetType.d.ts +1 -0
- package/src/shapes/LayoutPresetType.js +2 -0
- package/src/shapes/Platform.d.ts +112 -0
- package/src/shapes/Platform.js +16 -0
- package/src/shapes/WebOptions.d.ts +12 -0
- package/src/shapes/WebOptions.js +2 -0
- package/src/shapes/WindowOptions.d.ts +42 -0
- package/src/shapes/WindowOptions.js +2 -0
- package/src/shapes/protocol.d.ts +178 -0
- package/src/shapes/protocol.js +2 -0
- package/src/transport/fin_store.d.ts +4 -0
- package/src/transport/fin_store.js +16 -0
- package/src/transport/transport-errors.d.ts +17 -0
- package/src/transport/transport-errors.js +39 -0
- package/src/transport/transport.d.ts +57 -0
- package/src/transport/transport.js +195 -0
- package/src/transport/wire.d.ts +76 -0
- package/src/transport/wire.js +39 -0
- package/src/util/asyncFilter.d.ts +1 -0
- package/src/util/asyncFilter.js +7 -0
- package/src/util/errors.d.ts +9 -0
- package/src/util/errors.js +14 -0
- package/src/util/exhaustive.d.ts +1 -0
- package/src/util/exhaustive.js +7 -0
- package/src/util/http.d.ts +11 -0
- package/src/util/http.js +83 -0
- package/src/util/normalize-config.d.ts +3 -0
- package/src/util/normalize-config.js +47 -0
- package/src/util/promises.d.ts +5 -0
- package/src/util/promises.js +27 -0
- package/src/util/ref-counter.d.ts +7 -0
- package/src/util/ref-counter.js +51 -0
- package/src/util/runtimeVersioning.d.ts +3 -0
- package/src/util/runtimeVersioning.js +25 -0
- package/src/util/utilTypes.d.ts +8 -0
- package/src/util/utilTypes.js +2 -0
- package/src/util/validate.d.ts +3 -0
- package/src/util/validate.js +11 -0
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# OpenFin Core
|
|
2
|
+
|
|
3
|
+
This package contains the type definitions and API entry points for the OpenFin Core API. Start here to develop OpenFin applications in TypeScript.
|
|
4
|
+
|
|
5
|
+
Libraries are also available for the following frameworks:
|
|
6
|
+
|
|
7
|
+
* [Node.js](https://www.npmjs.com/package/openfin-adapter)
|
|
8
|
+
* [.Net](https://developers.openfin.co/of-docs/docs/net-api)
|
|
9
|
+
* [Java](https://developers.openfin.co/of-docs/docs/java-api)
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
This package cannot be installed as a dev dependency because it is not types-only.
|
|
14
|
+
|
|
15
|
+
To install, run:
|
|
16
|
+
|
|
17
|
+
`npm i -S @openfin/core`
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
The `fin` export is the primary API entry point. Type definitions are defined in the package's default export. The exported `inOpenFin` boolean is true if the `fin` API is available in the current context.
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import OpenFin, { fin, inOpenFin } from "@openfin/core";
|
|
25
|
+
|
|
26
|
+
const showWindow = async (identity: OpenFin.Identity) => {
|
|
27
|
+
const win = await fin.Window.wrap(identity);
|
|
28
|
+
await win.show();
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## License
|
|
33
|
+
|
|
34
|
+
Copyright 2020-2022 OpenFin
|
|
35
|
+
|
|
36
|
+
The code in this package is distributed under the Apache License, Version 2.0.
|
|
37
|
+
|
|
38
|
+
However, if you run this code, it may call on the OpenFin RVM or OpenFin Runtime, which are covered by OpenFin's Developer, Community, and Enterprise licenses. You can learn more about OpenFin licensing at the links listed below or email us at support@openfin.co with questions.
|
|
39
|
+
|
|
40
|
+
- [Licensing](https://www.openfin.co/licensing/)
|
|
41
|
+
- [Developer agreement](https://openfin.co/developer-agreement/)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
The HadoukenIO node-adapter allows the use of the Hadouken API from Node.js applications.
|
|
2
|
+
|
|
3
|
+
## Requirements
|
|
4
|
+
|
|
5
|
+
- Node.js LTS ^6.9
|
|
6
|
+
|
|
7
|
+
### Install as dependency
|
|
8
|
+
|
|
9
|
+
$ `npm install -S HadoukenIO/node-adapter`
|
|
10
|
+
|
|
11
|
+
### Usage
|
|
12
|
+
|
|
13
|
+
Connecting to an already running runtime
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
const { connect, Identity } = require("hadouken-js-adapter");
|
|
17
|
+
|
|
18
|
+
async function launchApp() {
|
|
19
|
+
const fin = await connect({
|
|
20
|
+
address: "ws://localhost:9696",
|
|
21
|
+
uuid: "my-uuid-123"
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const version = await fin.System.getVersion();
|
|
25
|
+
console.log("Connected to Hadouken version", version);
|
|
26
|
+
|
|
27
|
+
const app = await fin.Application.create({
|
|
28
|
+
name: "adapter-test-app",
|
|
29
|
+
url: 'http://hadouken.io/',
|
|
30
|
+
uuid: "adapter-test-app",
|
|
31
|
+
autoShow: true,
|
|
32
|
+
nonPersistent : true
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
await app.run();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
launchApp().then(() => {
|
|
39
|
+
console.log("success");
|
|
40
|
+
}).catch((err) => {
|
|
41
|
+
console.log("Error trying to connect,", err.message);
|
|
42
|
+
console.log(err.stack);
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Launching a runtime and connecting
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
const { connect, Identity } = require("hadouken-js-adapter");
|
|
50
|
+
|
|
51
|
+
async function launchApp() {
|
|
52
|
+
const fin = await connect({
|
|
53
|
+
uuid: "my-uuid-123",
|
|
54
|
+
runtime: {
|
|
55
|
+
version: 'stable'
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const version = await fin.System.getVersion();
|
|
60
|
+
console.log("Connected to Hadouken version", version);
|
|
61
|
+
|
|
62
|
+
const app = await fin.Application.create({
|
|
63
|
+
name: "adapter-test-app",
|
|
64
|
+
url: 'http://hadouken.io/',
|
|
65
|
+
uuid: "adapter-test-app",
|
|
66
|
+
autoShow: true,
|
|
67
|
+
nonPersistent : true
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
await app.run();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
launchApp().then(() => {
|
|
74
|
+
console.log("success");
|
|
75
|
+
}).catch((err) => {
|
|
76
|
+
console.log("Error trying to connect,", err.message);
|
|
77
|
+
console.log(err.stack);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Note that either an address or a runtime object with version are required to connect
|
package/fin.d.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openfin/core",
|
|
3
|
+
"version": "25.68.26",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"main": "./src/mock.js",
|
|
6
|
+
"types": "./src/mock.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"path": "PATH"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@types/jquery": "^3.3.31",
|
|
12
|
+
"@types/lodash": "^4.14.171",
|
|
13
|
+
"@types/mocha": "^2.2.38",
|
|
14
|
+
"@types/rimraf": "0.0.28",
|
|
15
|
+
"@types/sinon": "^1.16.34",
|
|
16
|
+
"@types/ws": "~0.0.36",
|
|
17
|
+
"events": "^3.0.0",
|
|
18
|
+
"grunt": "^1.0.4",
|
|
19
|
+
"grunt-mocha-test": "^0.13.3",
|
|
20
|
+
"http-server": "^0.11.1",
|
|
21
|
+
"jsdoc": "3.5.5",
|
|
22
|
+
"mocha": "^5.2.0",
|
|
23
|
+
"mocha-junit-reporter": "1.23.3",
|
|
24
|
+
"ps-node": "^0.1.6",
|
|
25
|
+
"rimraf": "^2.6.2",
|
|
26
|
+
"shelljs": "^0.8.2",
|
|
27
|
+
"sinon": "~1.17.6"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"lodash": "^4.17.21",
|
|
31
|
+
"ws": "^7.3.0"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { Base } from '../base';
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {object} ApplicationOption
|
|
4
|
+
* @summary Application creation options.
|
|
5
|
+
* @desc This is the options object required by {@link Application.start Application.start}.
|
|
6
|
+
*
|
|
7
|
+
* The following options are required:
|
|
8
|
+
* * `uuid` is required in the app manifest as well as by {@link Application.start Application.start}
|
|
9
|
+
* * `name` is optional in the app manifest but required by {@link Application.start Application.start}
|
|
10
|
+
* * `url` is optional in both the app manifest {@link Application.start Application.start} and but is usually given
|
|
11
|
+
* (defaults to `"about:blank"` when omitted).
|
|
12
|
+
*
|
|
13
|
+
* _This jsdoc typedef mirrors the `ApplicationOption` TypeScript interface in `@types/openfin`._
|
|
14
|
+
*
|
|
15
|
+
* **IMPORTANT NOTE:**
|
|
16
|
+
* This object inherits all the properties of the window creation {@link Window~options options} object,
|
|
17
|
+
* which will take priority over those of the same name that may be provided in `mainWindowOptions`.
|
|
18
|
+
*
|
|
19
|
+
* @property {boolean} [disableIabSecureLogging=false]
|
|
20
|
+
* When set to `true` it will disable IAB secure logging for the app.
|
|
21
|
+
*
|
|
22
|
+
* @property {string} [loadErrorMessage="There was an error loading the application."]
|
|
23
|
+
* An error message to display when the application (launched via manifest) fails to load.
|
|
24
|
+
* A dialog box will be launched with the error message just before the runtime exits.
|
|
25
|
+
* Load fails such as failed DNS resolutions or aborted connections as well as cancellations, _e.g.,_ `window.stop()`,
|
|
26
|
+
* will trigger this dialog.
|
|
27
|
+
* Client response codes such as `404 Not Found` are not treated as fails as they are valid server responses.
|
|
28
|
+
*
|
|
29
|
+
* @property {Window~options} [mainWindowOptions]
|
|
30
|
+
* The options of the main window of the application.
|
|
31
|
+
* For a description of these options, click the link (in the Type column).
|
|
32
|
+
*
|
|
33
|
+
* @property {number} [maxViewPoolSize=1000]
|
|
34
|
+
* Platforms Only. The maximum number of "detached" or "pooled" Views that can exist in the Platform before being closed.
|
|
35
|
+
* If you do not wish for views to be pooled on your platform, set this property to zero.
|
|
36
|
+
*
|
|
37
|
+
* @property {boolean} [preventQuitOnLastWindowClosed=false]
|
|
38
|
+
* Platforms Only. Prevent the Platform Provider from quitting automatically when the last Platform Window is closed.
|
|
39
|
+
* Note: if the Platform Provider is showing, it won't close automatically.
|
|
40
|
+
* If you want a hidden Platform Provider to remain open after the last Platform Window has been closed, set this property to true.
|
|
41
|
+
*
|
|
42
|
+
* @property {string} [name]
|
|
43
|
+
* The name of the application (and the application's main window).
|
|
44
|
+
*
|
|
45
|
+
* If provided, _must_ match `uuid`.
|
|
46
|
+
*
|
|
47
|
+
* @property {boolean} [nonPersistent=false]
|
|
48
|
+
* A flag to configure the application as non-persistent.
|
|
49
|
+
* Runtime exits when there are no persistent apps running.
|
|
50
|
+
*
|
|
51
|
+
* @property {boolean} [plugins=false]
|
|
52
|
+
* Enable Flash at the application level.
|
|
53
|
+
*
|
|
54
|
+
* @property {boolean} [spellCheck=false]
|
|
55
|
+
* Enable spell check at the application level.
|
|
56
|
+
*
|
|
57
|
+
* @property {string} [url="about:blank"]
|
|
58
|
+
* The url to the application (specifically the application's main window).
|
|
59
|
+
*
|
|
60
|
+
* @property {boolean} [enableJumpList=false]
|
|
61
|
+
* Enables the use of the Jumplists API and the 'pin to taskbar' functionality.
|
|
62
|
+
* Only relevant in Windows.
|
|
63
|
+
*
|
|
64
|
+
* @property {string} uuid
|
|
65
|
+
* The _Unique Universal Identifier_ (UUID) of the application, unique within the set of all other applications
|
|
66
|
+
* running in the OpenFin Runtime.
|
|
67
|
+
*
|
|
68
|
+
* Note that `name` and `uuid` must match.
|
|
69
|
+
*
|
|
70
|
+
* @property {boolean} [webSecurity=true]
|
|
71
|
+
* When set to `false` it will disable the same-origin policy for the app.
|
|
72
|
+
*/
|
|
73
|
+
/**
|
|
74
|
+
* @lends Application
|
|
75
|
+
*/
|
|
76
|
+
export default class ApplicationModule extends Base {
|
|
77
|
+
/**
|
|
78
|
+
* Asynchronously returns an Application object that represents an existing application.
|
|
79
|
+
* @param { Identity } identity
|
|
80
|
+
* @return {Promise.<Application>}
|
|
81
|
+
* @tutorial Application.wrap
|
|
82
|
+
* @static
|
|
83
|
+
*/
|
|
84
|
+
wrap(identity: OpenFin.ApplicationIdentity): Promise<OpenFin.Application>;
|
|
85
|
+
/**
|
|
86
|
+
* Synchronously returns an Application object that represents an existing application.
|
|
87
|
+
* @param { Identity } identity
|
|
88
|
+
* @return {Application}
|
|
89
|
+
* @tutorial Application.wrapSync
|
|
90
|
+
* @static
|
|
91
|
+
*/
|
|
92
|
+
wrapSync(identity: OpenFin.ApplicationIdentity): OpenFin.Application;
|
|
93
|
+
private _create;
|
|
94
|
+
/**
|
|
95
|
+
* DEPRECATED method to create a new Application. Use {@link Application.start} instead.
|
|
96
|
+
* @param { ApplicationOption } appOptions
|
|
97
|
+
* @return {Promise.<Application>}
|
|
98
|
+
* @tutorial Application.create
|
|
99
|
+
* @ignore
|
|
100
|
+
*/
|
|
101
|
+
create(appOptions: OpenFin.ApplicationCreationOptions): Promise<OpenFin.Application>;
|
|
102
|
+
/**
|
|
103
|
+
* Creates and starts a new Application.
|
|
104
|
+
* @param { ApplicationOption } appOptions
|
|
105
|
+
* @return {Promise.<Application>}
|
|
106
|
+
* @tutorial Application.start
|
|
107
|
+
* @static
|
|
108
|
+
*/
|
|
109
|
+
start(appOptions: OpenFin.ApplicationCreationOptions): Promise<OpenFin.Application>;
|
|
110
|
+
/**
|
|
111
|
+
* Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls.
|
|
112
|
+
* Returns once the RVM is finished attempting to launch the applications.
|
|
113
|
+
* @param { Array.<ManifestInfo> } applications
|
|
114
|
+
* @return {Promise.<void>}
|
|
115
|
+
* @static
|
|
116
|
+
* @tutorial Application.startManyManifests
|
|
117
|
+
* @experimental
|
|
118
|
+
*/
|
|
119
|
+
startManyManifests(applications: Array<OpenFin.ManifestInfo>): Promise<void>;
|
|
120
|
+
/**
|
|
121
|
+
* Asynchronously returns an Application object that represents the current application
|
|
122
|
+
* @return {Promise.<Application>}
|
|
123
|
+
* @tutorial Application.getCurrent
|
|
124
|
+
* @static
|
|
125
|
+
*/
|
|
126
|
+
getCurrent(): Promise<OpenFin.Application>;
|
|
127
|
+
/**
|
|
128
|
+
* Synchronously returns an Application object that represents the current application
|
|
129
|
+
* @return {Application}
|
|
130
|
+
* @tutorial Application.getCurrentSync
|
|
131
|
+
* @static
|
|
132
|
+
*/
|
|
133
|
+
getCurrentSync(): OpenFin.Application;
|
|
134
|
+
/**
|
|
135
|
+
* Retrieves application's manifest and returns a running instance of the application.
|
|
136
|
+
* @param {string} manifestUrl - The URL of app's manifest.
|
|
137
|
+
* @param {RvmLaunchOptions} [opts] - Parameters that the RVM will use.
|
|
138
|
+
* @return {Promise.<Application>}
|
|
139
|
+
* @tutorial Application.startFromManifest
|
|
140
|
+
* @static
|
|
141
|
+
*/
|
|
142
|
+
startFromManifest(manifestUrl: string, opts?: OpenFin.RvmLaunchOptions): Promise<OpenFin.Application>;
|
|
143
|
+
createFromManifest(manifestUrl: string): Promise<OpenFin.Application>;
|
|
144
|
+
private _createFromManifest;
|
|
145
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const base_1 = require("../base");
|
|
4
|
+
const validate_1 = require("../../util/validate");
|
|
5
|
+
const Instance_1 = require("./Instance");
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {object} ApplicationOption
|
|
8
|
+
* @summary Application creation options.
|
|
9
|
+
* @desc This is the options object required by {@link Application.start Application.start}.
|
|
10
|
+
*
|
|
11
|
+
* The following options are required:
|
|
12
|
+
* * `uuid` is required in the app manifest as well as by {@link Application.start Application.start}
|
|
13
|
+
* * `name` is optional in the app manifest but required by {@link Application.start Application.start}
|
|
14
|
+
* * `url` is optional in both the app manifest {@link Application.start Application.start} and but is usually given
|
|
15
|
+
* (defaults to `"about:blank"` when omitted).
|
|
16
|
+
*
|
|
17
|
+
* _This jsdoc typedef mirrors the `ApplicationOption` TypeScript interface in `@types/openfin`._
|
|
18
|
+
*
|
|
19
|
+
* **IMPORTANT NOTE:**
|
|
20
|
+
* This object inherits all the properties of the window creation {@link Window~options options} object,
|
|
21
|
+
* which will take priority over those of the same name that may be provided in `mainWindowOptions`.
|
|
22
|
+
*
|
|
23
|
+
* @property {boolean} [disableIabSecureLogging=false]
|
|
24
|
+
* When set to `true` it will disable IAB secure logging for the app.
|
|
25
|
+
*
|
|
26
|
+
* @property {string} [loadErrorMessage="There was an error loading the application."]
|
|
27
|
+
* An error message to display when the application (launched via manifest) fails to load.
|
|
28
|
+
* A dialog box will be launched with the error message just before the runtime exits.
|
|
29
|
+
* Load fails such as failed DNS resolutions or aborted connections as well as cancellations, _e.g.,_ `window.stop()`,
|
|
30
|
+
* will trigger this dialog.
|
|
31
|
+
* Client response codes such as `404 Not Found` are not treated as fails as they are valid server responses.
|
|
32
|
+
*
|
|
33
|
+
* @property {Window~options} [mainWindowOptions]
|
|
34
|
+
* The options of the main window of the application.
|
|
35
|
+
* For a description of these options, click the link (in the Type column).
|
|
36
|
+
*
|
|
37
|
+
* @property {number} [maxViewPoolSize=1000]
|
|
38
|
+
* Platforms Only. The maximum number of "detached" or "pooled" Views that can exist in the Platform before being closed.
|
|
39
|
+
* If you do not wish for views to be pooled on your platform, set this property to zero.
|
|
40
|
+
*
|
|
41
|
+
* @property {boolean} [preventQuitOnLastWindowClosed=false]
|
|
42
|
+
* Platforms Only. Prevent the Platform Provider from quitting automatically when the last Platform Window is closed.
|
|
43
|
+
* Note: if the Platform Provider is showing, it won't close automatically.
|
|
44
|
+
* If you want a hidden Platform Provider to remain open after the last Platform Window has been closed, set this property to true.
|
|
45
|
+
*
|
|
46
|
+
* @property {string} [name]
|
|
47
|
+
* The name of the application (and the application's main window).
|
|
48
|
+
*
|
|
49
|
+
* If provided, _must_ match `uuid`.
|
|
50
|
+
*
|
|
51
|
+
* @property {boolean} [nonPersistent=false]
|
|
52
|
+
* A flag to configure the application as non-persistent.
|
|
53
|
+
* Runtime exits when there are no persistent apps running.
|
|
54
|
+
*
|
|
55
|
+
* @property {boolean} [plugins=false]
|
|
56
|
+
* Enable Flash at the application level.
|
|
57
|
+
*
|
|
58
|
+
* @property {boolean} [spellCheck=false]
|
|
59
|
+
* Enable spell check at the application level.
|
|
60
|
+
*
|
|
61
|
+
* @property {string} [url="about:blank"]
|
|
62
|
+
* The url to the application (specifically the application's main window).
|
|
63
|
+
*
|
|
64
|
+
* @property {boolean} [enableJumpList=false]
|
|
65
|
+
* Enables the use of the Jumplists API and the 'pin to taskbar' functionality.
|
|
66
|
+
* Only relevant in Windows.
|
|
67
|
+
*
|
|
68
|
+
* @property {string} uuid
|
|
69
|
+
* The _Unique Universal Identifier_ (UUID) of the application, unique within the set of all other applications
|
|
70
|
+
* running in the OpenFin Runtime.
|
|
71
|
+
*
|
|
72
|
+
* Note that `name` and `uuid` must match.
|
|
73
|
+
*
|
|
74
|
+
* @property {boolean} [webSecurity=true]
|
|
75
|
+
* When set to `false` it will disable the same-origin policy for the app.
|
|
76
|
+
*/
|
|
77
|
+
/**
|
|
78
|
+
* @lends Application
|
|
79
|
+
*/
|
|
80
|
+
class ApplicationModule extends base_1.Base {
|
|
81
|
+
/**
|
|
82
|
+
* Asynchronously returns an Application object that represents an existing application.
|
|
83
|
+
* @param { Identity } identity
|
|
84
|
+
* @return {Promise.<Application>}
|
|
85
|
+
* @tutorial Application.wrap
|
|
86
|
+
* @static
|
|
87
|
+
*/
|
|
88
|
+
async wrap(identity) {
|
|
89
|
+
this.wire.sendAction('wrap-application').catch((e) => {
|
|
90
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
91
|
+
});
|
|
92
|
+
const errorMsg = validate_1.validateIdentity(identity);
|
|
93
|
+
if (errorMsg) {
|
|
94
|
+
throw new Error(errorMsg);
|
|
95
|
+
}
|
|
96
|
+
return new Instance_1.Application(this.wire, identity);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Synchronously returns an Application object that represents an existing application.
|
|
100
|
+
* @param { Identity } identity
|
|
101
|
+
* @return {Application}
|
|
102
|
+
* @tutorial Application.wrapSync
|
|
103
|
+
* @static
|
|
104
|
+
*/
|
|
105
|
+
wrapSync(identity) {
|
|
106
|
+
this.wire.sendAction('wrap-application-sync').catch((e) => {
|
|
107
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
108
|
+
});
|
|
109
|
+
const errorMsg = validate_1.validateIdentity(identity);
|
|
110
|
+
if (errorMsg) {
|
|
111
|
+
throw new Error(errorMsg);
|
|
112
|
+
}
|
|
113
|
+
return new Instance_1.Application(this.wire, identity);
|
|
114
|
+
}
|
|
115
|
+
async _create(appOptions) {
|
|
116
|
+
// set defaults:
|
|
117
|
+
if (appOptions.waitForPageLoad === undefined) {
|
|
118
|
+
appOptions.waitForPageLoad = false;
|
|
119
|
+
}
|
|
120
|
+
if (appOptions.autoShow === undefined && appOptions.isPlatformController === undefined) {
|
|
121
|
+
appOptions.autoShow = true;
|
|
122
|
+
}
|
|
123
|
+
await this.wire.sendAction('create-application', appOptions);
|
|
124
|
+
return this.wrap({ uuid: appOptions.uuid });
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* DEPRECATED method to create a new Application. Use {@link Application.start} instead.
|
|
128
|
+
* @param { ApplicationOption } appOptions
|
|
129
|
+
* @return {Promise.<Application>}
|
|
130
|
+
* @tutorial Application.create
|
|
131
|
+
* @ignore
|
|
132
|
+
*/
|
|
133
|
+
create(appOptions) {
|
|
134
|
+
console.warn('Deprecation Warning: fin.Application.create is deprecated. Please use fin.Application.start');
|
|
135
|
+
this.wire.sendAction('application-create').catch((e) => {
|
|
136
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
137
|
+
});
|
|
138
|
+
return this._create(appOptions);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Creates and starts a new Application.
|
|
142
|
+
* @param { ApplicationOption } appOptions
|
|
143
|
+
* @return {Promise.<Application>}
|
|
144
|
+
* @tutorial Application.start
|
|
145
|
+
* @static
|
|
146
|
+
*/
|
|
147
|
+
async start(appOptions) {
|
|
148
|
+
this.wire.sendAction('start-application').catch((e) => {
|
|
149
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
150
|
+
});
|
|
151
|
+
const app = await this._create(appOptions);
|
|
152
|
+
await this.wire.sendAction('run-application', { uuid: appOptions.uuid });
|
|
153
|
+
return app;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls.
|
|
157
|
+
* Returns once the RVM is finished attempting to launch the applications.
|
|
158
|
+
* @param { Array.<ManifestInfo> } applications
|
|
159
|
+
* @return {Promise.<void>}
|
|
160
|
+
* @static
|
|
161
|
+
* @tutorial Application.startManyManifests
|
|
162
|
+
* @experimental
|
|
163
|
+
*/
|
|
164
|
+
async startManyManifests(applications) {
|
|
165
|
+
return this.wire.sendAction('run-applications', { applications }).then(() => undefined);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Asynchronously returns an Application object that represents the current application
|
|
169
|
+
* @return {Promise.<Application>}
|
|
170
|
+
* @tutorial Application.getCurrent
|
|
171
|
+
* @static
|
|
172
|
+
*/
|
|
173
|
+
getCurrent() {
|
|
174
|
+
this.wire.sendAction('get-current-application').catch((e) => {
|
|
175
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
176
|
+
});
|
|
177
|
+
return this.wrap({ uuid: this.wire.me.uuid });
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Synchronously returns an Application object that represents the current application
|
|
181
|
+
* @return {Application}
|
|
182
|
+
* @tutorial Application.getCurrentSync
|
|
183
|
+
* @static
|
|
184
|
+
*/
|
|
185
|
+
getCurrentSync() {
|
|
186
|
+
this.wire.sendAction('get-current-application-sync').catch((e) => {
|
|
187
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
188
|
+
});
|
|
189
|
+
return this.wrapSync({ uuid: this.wire.me.uuid });
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Retrieves application's manifest and returns a running instance of the application.
|
|
193
|
+
* @param {string} manifestUrl - The URL of app's manifest.
|
|
194
|
+
* @param {RvmLaunchOptions} [opts] - Parameters that the RVM will use.
|
|
195
|
+
* @return {Promise.<Application>}
|
|
196
|
+
* @tutorial Application.startFromManifest
|
|
197
|
+
* @static
|
|
198
|
+
*/
|
|
199
|
+
async startFromManifest(manifestUrl, opts) {
|
|
200
|
+
this.wire.sendAction('application-start-from-manifest').catch((e) => {
|
|
201
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
202
|
+
});
|
|
203
|
+
const app = await this._createFromManifest(manifestUrl);
|
|
204
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
205
|
+
// @ts-ignore using private method without warning.
|
|
206
|
+
await app._run(opts); // eslint-disable-line no-underscore-dangle
|
|
207
|
+
return app;
|
|
208
|
+
}
|
|
209
|
+
createFromManifest(manifestUrl) {
|
|
210
|
+
console.warn('Deprecation Warning: fin.Application.createFromManifest is deprecated. Please use fin.Application.startFromManifest');
|
|
211
|
+
this.wire.sendAction('application-create-from-manifest').catch((e) => {
|
|
212
|
+
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
213
|
+
});
|
|
214
|
+
return this._createFromManifest(manifestUrl);
|
|
215
|
+
}
|
|
216
|
+
_createFromManifest(manifestUrl) {
|
|
217
|
+
return this.wire
|
|
218
|
+
.sendAction('get-application-manifest', { manifestUrl })
|
|
219
|
+
.then(({ payload }) => {
|
|
220
|
+
const uuid = payload.data.platform ? payload.data.platform.uuid : payload.data.startup_app.uuid;
|
|
221
|
+
return this.wrap({ uuid });
|
|
222
|
+
})
|
|
223
|
+
.then((app) => {
|
|
224
|
+
app._manifestUrl = manifestUrl; // eslint-disable-line no-underscore-dangle
|
|
225
|
+
return app;
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
exports.default = ApplicationModule;
|