@openfin/core 33.76.27 → 33.76.36
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/openfin-core-33.76.36.tgz +0 -0
- package/package.json +1 -1
- package/src/OpenFin.d.ts +27 -16
- package/src/api/application/Factory.d.ts +148 -100
- package/src/api/application/Factory.js +148 -100
- package/src/api/application/Instance.d.ts +477 -106
- package/src/api/application/Instance.js +474 -106
- package/src/api/application/index.d.ts +9 -0
- package/src/api/application/index.js +9 -0
- package/src/api/base.d.ts +69 -0
- package/src/api/base.js +69 -0
- package/src/api/clipboard/index.d.ts +111 -31
- package/src/api/clipboard/index.js +111 -31
- package/src/api/events/application.d.ts +12 -0
- package/src/api/events/application.js +12 -0
- package/src/api/events/channel.d.ts +5 -0
- package/src/api/events/channel.js +5 -0
- package/src/api/events/externalApplication.d.ts +5 -0
- package/src/api/events/externalApplication.js +5 -0
- package/src/api/events/frame.d.ts +5 -0
- package/src/api/events/globalHotkey.d.ts +5 -0
- package/src/api/events/platform.d.ts +9 -1
- package/src/api/events/platform.js +8 -0
- package/src/api/events/system.d.ts +13 -0
- package/src/api/events/system.js +13 -0
- package/src/api/events/view.d.ts +19 -9
- package/src/api/events/view.js +10 -0
- package/src/api/events/webcontents.d.ts +21 -10
- package/src/api/events/webcontents.js +11 -0
- package/src/api/events/window.d.ts +70 -1
- package/src/api/events/window.js +10 -0
- package/src/api/external-application/Factory.d.ts +16 -9
- package/src/api/external-application/Factory.js +16 -9
- package/src/api/external-application/Instance.d.ts +40 -32
- package/src/api/external-application/Instance.js +40 -32
- package/src/api/external-application/index.d.ts +9 -0
- package/src/api/external-application/index.js +9 -0
- package/src/api/fin.d.ts +3 -0
- package/src/api/fin.js +3 -0
- package/src/api/frame/Factory.d.ts +30 -13
- package/src/api/frame/Factory.js +30 -13
- package/src/api/frame/Instance.d.ts +51 -38
- package/src/api/frame/Instance.js +51 -38
- package/src/api/frame/index.d.ts +11 -0
- package/src/api/frame/index.js +11 -0
- package/src/api/global-hotkey/index.d.ts +81 -13
- package/src/api/global-hotkey/index.js +81 -13
- package/src/api/interappbus/channel/channel.d.ts +257 -0
- package/src/api/interappbus/channel/channel.js +257 -0
- package/src/api/interappbus/channel/channels-docs.d.ts +59 -57
- package/src/api/interappbus/channel/channels-docs.js +71 -68
- package/src/api/interappbus/channel/client.d.ts +93 -0
- package/src/api/interappbus/channel/client.js +93 -1
- package/src/api/interappbus/channel/index.d.ts +164 -0
- package/src/api/interappbus/channel/index.js +165 -1
- package/src/api/interappbus/channel/provider.d.ts +172 -0
- package/src/api/interappbus/channel/provider.js +172 -0
- package/src/api/interappbus/index.d.ts +55 -20
- package/src/api/interappbus/index.js +55 -20
- package/src/api/interop/Factory.d.ts +30 -10
- package/src/api/interop/Factory.js +30 -10
- package/src/api/interop/InteropBroker.d.ts +298 -70
- package/src/api/interop/InteropBroker.js +298 -70
- package/src/api/interop/InteropClient.d.ts +286 -62
- package/src/api/interop/InteropClient.js +286 -62
- package/src/api/interop/SessionContextGroupClient.d.ts +2 -2
- package/src/api/interop/SessionContextGroupClient.js +2 -2
- package/src/api/interop/fdc3/documentationStub.d.ts +14 -0
- package/src/api/interop/fdc3/documentationStub.js +17 -0
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +31 -34
- package/src/api/interop/fdc3/fdc3-1.2.js +31 -34
- package/src/api/interop/fdc3/fdc3-2.0.d.ts +48 -51
- package/src/api/interop/fdc3/fdc3-2.0.js +48 -51
- package/src/api/interop/index.d.ts +8 -0
- package/src/api/interop/index.js +8 -0
- package/src/api/platform/Factory.d.ts +121 -65
- package/src/api/platform/Factory.js +122 -66
- package/src/api/platform/Instance.d.ts +551 -48
- package/src/api/platform/Instance.js +551 -49
- package/src/api/platform/index.d.ts +9 -0
- package/src/api/platform/index.js +9 -0
- package/src/api/platform/layout/Factory.d.ts +53 -76
- package/src/api/platform/layout/Factory.js +53 -76
- package/src/api/platform/layout/Instance.d.ts +158 -23
- package/src/api/platform/layout/Instance.js +118 -20
- package/src/api/platform/layout/entities/layout-entities.d.ts +222 -30
- package/src/api/platform/layout/entities/layout-entities.js +222 -30
- package/src/api/platform/layout/index.d.ts +9 -0
- package/src/api/platform/layout/index.js +9 -0
- package/src/api/platform/provider.d.ts +398 -51
- package/src/api/snapshot-source/Factory.d.ts +33 -18
- package/src/api/snapshot-source/Factory.js +33 -18
- package/src/api/snapshot-source/Instance.d.ts +30 -8
- package/src/api/snapshot-source/Instance.js +30 -8
- package/src/api/snapshot-source/index.d.ts +9 -0
- package/src/api/snapshot-source/index.js +9 -0
- package/src/api/system/index.d.ts +1137 -186
- package/src/api/system/index.js +1142 -186
- package/src/api/view/Factory.d.ts +54 -16
- package/src/api/view/Factory.js +54 -16
- package/src/api/view/Instance.d.ts +330 -216
- package/src/api/view/Instance.js +331 -217
- package/src/api/view/index.d.ts +9 -0
- package/src/api/view/index.js +9 -0
- package/src/api/webcontents/main.d.ts +890 -0
- package/src/api/webcontents/main.js +890 -0
- package/src/api/window/Factory.d.ts +67 -16
- package/src/api/window/Factory.js +67 -16
- package/src/api/window/Instance.d.ts +824 -316
- package/src/api/window/Instance.js +822 -320
- package/src/api/window/index.d.ts +11 -0
- package/src/api/window/index.js +11 -0
- package/src/namespaces.d.ts +1 -0
- package/src/namespaces.js +3 -1
- package/src/shapes/protocol.d.ts +4 -0
- package/openfin-core-33.76.27.tgz +0 -0
|
@@ -17,18 +17,21 @@ type PrinterInfo = OpenFin.PrinterInfo;
|
|
|
17
17
|
/**
|
|
18
18
|
* An object representing the core of OpenFin Runtime. Allows the developer
|
|
19
19
|
* to perform system-level actions, such as accessing logs, viewing processes,
|
|
20
|
-
* clearing the cache and exiting the runtime as well as listen to
|
|
21
|
-
*
|
|
20
|
+
* clearing the cache and exiting the runtime as well as listen to {@link OpenFin.SystemEvents system events}.
|
|
21
|
+
*
|
|
22
22
|
*/
|
|
23
23
|
export default class System extends EmitterBase<OpenFin.SystemEvent> {
|
|
24
|
+
/**
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
24
27
|
constructor(wire: Transport);
|
|
25
28
|
private sendExternalProcessRequest;
|
|
26
29
|
/**
|
|
27
30
|
* Adds a listener to the end of the listeners array for the specified event.
|
|
28
|
-
* @param
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
*
|
|
31
|
+
* @param eventType - The type of the event.
|
|
32
|
+
* @param listener - Called whenever an event of the specified type occurs.
|
|
33
|
+
* @param options - Option to support event timestamps.
|
|
34
|
+
*
|
|
32
35
|
* @function addListener
|
|
33
36
|
* @memberof System
|
|
34
37
|
* @instance
|
|
@@ -36,10 +39,10 @@ export default class System extends EmitterBase<OpenFin.SystemEvent> {
|
|
|
36
39
|
*/
|
|
37
40
|
/**
|
|
38
41
|
* Adds a listener to the end of the listeners array for the specified event.
|
|
39
|
-
* @param
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
42
|
-
*
|
|
42
|
+
* @param eventType - The type of the event.
|
|
43
|
+
* @param listener - Called whenever an event of the specified type occurs.
|
|
44
|
+
* @param options - Option to support event timestamps.
|
|
45
|
+
*
|
|
43
46
|
* @function on
|
|
44
47
|
* @memberof System
|
|
45
48
|
* @instance
|
|
@@ -47,10 +50,10 @@ export default class System extends EmitterBase<OpenFin.SystemEvent> {
|
|
|
47
50
|
*/
|
|
48
51
|
/**
|
|
49
52
|
* Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
53
|
-
*
|
|
53
|
+
* @param eventType - The type of the event.
|
|
54
|
+
* @param listener - The callback function.
|
|
55
|
+
* @param options - Option to support event timestamps.
|
|
56
|
+
*
|
|
54
57
|
* @function once
|
|
55
58
|
* @memberof System
|
|
56
59
|
* @instance
|
|
@@ -58,10 +61,10 @@ export default class System extends EmitterBase<OpenFin.SystemEvent> {
|
|
|
58
61
|
*/
|
|
59
62
|
/**
|
|
60
63
|
* Adds a listener to the beginning of the listeners array for the specified event.
|
|
61
|
-
* @param
|
|
62
|
-
* @param
|
|
63
|
-
* @param
|
|
64
|
-
*
|
|
64
|
+
* @param eventType - The type of the event.
|
|
65
|
+
* @param listener - The callback function.
|
|
66
|
+
* @param options - Option to support event timestamps.
|
|
67
|
+
*
|
|
65
68
|
* @function prependListener
|
|
66
69
|
* @memberof System
|
|
67
70
|
* @instance
|
|
@@ -70,10 +73,10 @@ export default class System extends EmitterBase<OpenFin.SystemEvent> {
|
|
|
70
73
|
/**
|
|
71
74
|
* Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.
|
|
72
75
|
* The listener is added to the beginning of the listeners array.
|
|
73
|
-
* @param
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
76
|
-
*
|
|
76
|
+
* @param eventType - The type of the event.
|
|
77
|
+
* @param listener - The callback function.
|
|
78
|
+
* @param options - Option to support event timestamps.
|
|
79
|
+
*
|
|
77
80
|
* @function prependOnceListener
|
|
78
81
|
* @memberof System
|
|
79
82
|
* @instance
|
|
@@ -82,10 +85,10 @@ export default class System extends EmitterBase<OpenFin.SystemEvent> {
|
|
|
82
85
|
/**
|
|
83
86
|
* Remove a listener from the listener array for the specified event.
|
|
84
87
|
* Caution: Calling this method changes the array indices in the listener array behind the listener.
|
|
85
|
-
* @param
|
|
86
|
-
* @param
|
|
87
|
-
* @param
|
|
88
|
-
*
|
|
88
|
+
* @param eventType - The type of the event.
|
|
89
|
+
* @param listener - The callback function.
|
|
90
|
+
* @param options - Option to support event timestamps.
|
|
91
|
+
*
|
|
89
92
|
* @function removeListener
|
|
90
93
|
* @memberof System
|
|
91
94
|
* @instance
|
|
@@ -93,8 +96,8 @@ export default class System extends EmitterBase<OpenFin.SystemEvent> {
|
|
|
93
96
|
*/
|
|
94
97
|
/**
|
|
95
98
|
* Removes all listeners, or those of the specified event.
|
|
96
|
-
* @param
|
|
97
|
-
*
|
|
99
|
+
* @param eventType - The type of the event.
|
|
100
|
+
*
|
|
98
101
|
* @function removeAllListeners
|
|
99
102
|
* @memberof System
|
|
100
103
|
* @instance
|
|
@@ -103,73 +106,126 @@ export default class System extends EmitterBase<OpenFin.SystemEvent> {
|
|
|
103
106
|
/**
|
|
104
107
|
* Returns the version of the runtime. The version contains the major, minor,
|
|
105
108
|
* build and revision numbers.
|
|
106
|
-
*
|
|
107
|
-
* @
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```js
|
|
112
|
+
* fin.System.getVersion().then(v => console.log(v)).catch(err => console.log(err));
|
|
113
|
+
* ```
|
|
108
114
|
*/
|
|
109
115
|
getVersion(): Promise<string>;
|
|
110
116
|
/**
|
|
111
117
|
* Clears cached data containing application resource
|
|
112
118
|
* files (images, HTML, JavaScript files), cookies, and items stored in the
|
|
113
119
|
* Local Storage.
|
|
114
|
-
* @param
|
|
115
|
-
*
|
|
116
|
-
* @
|
|
120
|
+
* @param options - See below for details.
|
|
121
|
+
*
|
|
122
|
+
* @remarks For more information on the accepted options, see the following pages:
|
|
123
|
+
* * cache: browsing data cache for html files and images ([caching](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching))
|
|
124
|
+
* * cookies: browser [cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies)
|
|
125
|
+
* * localStorage: browser data that can be used across sessions ([local storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage))
|
|
126
|
+
* * appcache: html5 [application cache](https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache)
|
|
127
|
+
* @example
|
|
128
|
+
* ```js
|
|
129
|
+
* const clearCacheOptions = {
|
|
130
|
+
* appcache: true,
|
|
131
|
+
* cache: true,
|
|
132
|
+
* cookies: true,
|
|
133
|
+
* localStorage: true
|
|
134
|
+
* };
|
|
135
|
+
* fin.System.clearCache(clearCacheOptions).then(() => console.log('Cache cleared')).catch(err => console.log(err));
|
|
136
|
+
* ```
|
|
137
|
+
*
|
|
117
138
|
*/
|
|
118
139
|
clearCache(options: OpenFin.ClearCacheOption): Promise<void>;
|
|
119
140
|
/**
|
|
120
141
|
* Clears all cached data when OpenFin Runtime exits.
|
|
121
|
-
*
|
|
122
|
-
* @
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```js
|
|
145
|
+
* fin.System.deleteCacheOnExit().then(() => console.log('Deleted Cache')).catch(err => console.log(err));
|
|
146
|
+
* ```
|
|
123
147
|
*/
|
|
124
148
|
deleteCacheOnExit(): Promise<void>;
|
|
125
149
|
/**
|
|
126
150
|
* Exits the Runtime.
|
|
127
|
-
*
|
|
128
|
-
* @
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```js
|
|
154
|
+
* fin.System.exit().then(() => console.log('exit')).catch(err => console.log(err));
|
|
155
|
+
* ```
|
|
129
156
|
*/
|
|
130
157
|
exit(): Promise<void>;
|
|
131
158
|
/**
|
|
132
159
|
* Fetches a JSON manifest using the browser process and returns a Javascript object.
|
|
133
|
-
* @param
|
|
134
|
-
*
|
|
135
|
-
* @
|
|
160
|
+
* @param manifestUrl The URL of the manifest to fetch.
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```js
|
|
164
|
+
* const manifest = await fin.System.fetchManifest('https://www.path-to-manifest.com');
|
|
165
|
+
* console.log(manifest);
|
|
166
|
+
* ```
|
|
136
167
|
*/
|
|
137
168
|
fetchManifest(manifestUrl: string): Promise<any>;
|
|
138
169
|
/**
|
|
139
170
|
* Writes any unwritten cookies data to disk.
|
|
140
|
-
*
|
|
141
|
-
* @
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```js
|
|
174
|
+
* fin.System.flushCookieStore()
|
|
175
|
+
* .then(() => console.log('success'))
|
|
176
|
+
* .catch(err => console.error(err));
|
|
177
|
+
* ```
|
|
142
178
|
*/
|
|
143
179
|
flushCookieStore(): Promise<void>;
|
|
144
180
|
/**
|
|
145
181
|
* Retrieves an array of data (name, ids, bounds) for all application windows.
|
|
146
|
-
*
|
|
147
|
-
* @
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```js
|
|
185
|
+
* fin.System.getAllWindows().then(wins => console.log(wins)).catch(err => console.log(err));
|
|
186
|
+
* ```
|
|
148
187
|
*/
|
|
149
188
|
getAllWindows(): Promise<Array<ApplicationWindowInfo>>;
|
|
150
189
|
/**
|
|
151
190
|
* Retrieves an array of data for all applications.
|
|
152
|
-
*
|
|
153
|
-
* @
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```js
|
|
194
|
+
* fin.System.getAllApplications().then(apps => console.log(apps)).catch(err => console.log(err));
|
|
195
|
+
* ```
|
|
154
196
|
*/
|
|
155
197
|
getAllApplications(): Promise<Array<ApplicationState>>;
|
|
156
198
|
/**
|
|
157
199
|
* Retrieves the command line argument string that started OpenFin Runtime.
|
|
158
|
-
*
|
|
159
|
-
* @
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```js
|
|
203
|
+
* fin.System.getCommandLineArguments().then(args => console.log(args)).catch(err => console.log(err));
|
|
204
|
+
* ```
|
|
160
205
|
*/
|
|
161
206
|
getCommandLineArguments(): Promise<string>;
|
|
162
207
|
/**
|
|
163
208
|
* Get the current state of the crash reporter.
|
|
164
|
-
*
|
|
165
|
-
* @
|
|
209
|
+
*
|
|
210
|
+
* @example
|
|
211
|
+
* ```js
|
|
212
|
+
* fin.System.getCrashReporterState().then(state => console.log(state)).catch(err => console.log(err));
|
|
213
|
+
* ```
|
|
166
214
|
*/
|
|
167
215
|
getCrashReporterState(): Promise<OpenFin.CrashReporterState>;
|
|
168
216
|
/**
|
|
169
217
|
* Start the crash reporter if not already running.
|
|
170
|
-
* @param
|
|
171
|
-
*
|
|
172
|
-
* @
|
|
218
|
+
* @param options - configure crash reporter
|
|
219
|
+
*
|
|
220
|
+
* @remarks You can optionally specify `diagnosticsMode` to have the logs sent to
|
|
221
|
+
* OpenFin on runtime close. (NOTE: `diagnosticsMode` will turn on verbose logging and disable the sandbox
|
|
222
|
+
* for newly launched renderer processes. See https://developers.openfin.co/of-docs/docs/debugging#diagnostics-mode for
|
|
223
|
+
* more details.)
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* ```js
|
|
227
|
+
* fin.System.startCrashReporter({diagnosticsMode: true}).then(reporter => console.log(reporter)).catch(err => console.log(err));
|
|
228
|
+
* ```
|
|
173
229
|
*/
|
|
174
230
|
startCrashReporter(options: OpenFin.CrashReporterOptions | {
|
|
175
231
|
diagnosticMode: boolean;
|
|
@@ -177,80 +233,145 @@ export default class System extends EmitterBase<OpenFin.SystemEvent> {
|
|
|
177
233
|
/**
|
|
178
234
|
* Returns a hex encoded hash of the machine id and the currently logged in user name.
|
|
179
235
|
* This is the recommended way to uniquely identify a user / machine combination.
|
|
180
|
-
*
|
|
181
|
-
* @
|
|
236
|
+
*
|
|
237
|
+
* @remarks For Windows systems this is a sha256 hash of the machine ID set in the registry key:
|
|
238
|
+
* `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\MachineGuid` and `USERNAME`.
|
|
239
|
+
*
|
|
240
|
+
* For OSX systems, a native-level call is used to get the machine ID.
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* ```js
|
|
244
|
+
* fin.System.getUniqueUserId().then(id => console.log(id)).catch(err => console.log(err));
|
|
245
|
+
* ```
|
|
182
246
|
* @static
|
|
183
247
|
*/
|
|
184
248
|
getUniqueUserId(): Promise<string>;
|
|
185
249
|
/**
|
|
186
250
|
* Retrieves a frame info object for the uuid and name passed in
|
|
187
|
-
* @param
|
|
188
|
-
* @param
|
|
189
|
-
*
|
|
190
|
-
* @
|
|
251
|
+
* @param uuid - The UUID of the target.
|
|
252
|
+
* @param name - The name of the target.
|
|
253
|
+
*
|
|
254
|
+
* @remarks The possible types are 'window', 'iframe', 'external connection' or 'unknown'.
|
|
255
|
+
* @example
|
|
256
|
+
* ```js
|
|
257
|
+
* const entityUuid = 'OpenfinPOC';
|
|
258
|
+
* const entityName = '40c74b5d-ed98-40f7-853f-e3d3c2699175';
|
|
259
|
+
* fin.System.getEntityInfo(entityUuid, entityName).then(info => console.log(info)).catch(err => console.log(err));
|
|
260
|
+
*
|
|
261
|
+
* // example info shape
|
|
262
|
+
* {
|
|
263
|
+
* "uuid": "OpenfinPOC",
|
|
264
|
+
* "name": "40c74b5d-ed98-40f7-853f-e3d3c2699175",
|
|
265
|
+
* "parent": {
|
|
266
|
+
* "uuid": "OpenfinPOC",
|
|
267
|
+
* "name": "OpenfinPOC"
|
|
268
|
+
* },
|
|
269
|
+
* "entityType": "iframe"
|
|
270
|
+
* }
|
|
271
|
+
* ```
|
|
191
272
|
*/
|
|
192
273
|
getEntityInfo(uuid: string, name: string): Promise<EntityInfo>;
|
|
193
274
|
/**
|
|
194
275
|
* Gets the value of a given environment variable on the computer on which the runtime is installed
|
|
195
|
-
*
|
|
196
|
-
* @
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* ```js
|
|
279
|
+
* fin.System.getEnvironmentVariable('HOME').then(env => console.log(env)).catch(err => console.log(err));
|
|
280
|
+
* ```
|
|
197
281
|
*/
|
|
198
282
|
getEnvironmentVariable(envName: string): Promise<string>;
|
|
199
283
|
/**
|
|
200
284
|
* Get current focused window.
|
|
201
|
-
*
|
|
202
|
-
* @
|
|
285
|
+
*
|
|
286
|
+
* @example
|
|
287
|
+
* ```js
|
|
288
|
+
* fin.System.getFocusedWindow().then(winInfo => console.log(winInfo)).catch(err => console.log(err));
|
|
289
|
+
* ```
|
|
203
290
|
*/
|
|
204
291
|
getFocusedWindow(): Promise<OpenFin.Identity | null>;
|
|
205
292
|
/**
|
|
206
293
|
* Returns information about the given app's certification status
|
|
207
|
-
*
|
|
208
|
-
* @
|
|
294
|
+
*
|
|
295
|
+
* @example
|
|
296
|
+
* ```js
|
|
297
|
+
* const manifestUrl = "http://localhost:1234/app.json"
|
|
298
|
+
* try {
|
|
299
|
+
* const certificationInfo = await fin.System.isAppCertified(manifestUrl);
|
|
300
|
+
* } catch(err) {
|
|
301
|
+
* console.error(err)
|
|
302
|
+
* }
|
|
303
|
+
* ```
|
|
209
304
|
*/
|
|
210
305
|
isAppCertified(manifestUrl: string): Promise<OpenFin.CertifiedAppInfo>;
|
|
211
306
|
/**
|
|
212
307
|
* Returns an array of all the installed runtime versions in an object.
|
|
213
|
-
*
|
|
214
|
-
* @
|
|
308
|
+
*
|
|
309
|
+
* @example
|
|
310
|
+
* ```js
|
|
311
|
+
* fin.System.getInstalledRuntimes().then(runtimes => console.log(runtimes)).catch(err => console.log(err));
|
|
312
|
+
* ```
|
|
215
313
|
*/
|
|
216
314
|
getInstalledRuntimes(): Promise<string[]>;
|
|
217
315
|
getInstalledApps(): Promise<InstalledApps>;
|
|
218
316
|
/**
|
|
219
317
|
* Retrieves the contents of the log with the specified filename.
|
|
220
|
-
* @param
|
|
221
|
-
*
|
|
222
|
-
* @
|
|
318
|
+
* @param options A object that id defined by the GetLogRequestType interface
|
|
319
|
+
*
|
|
320
|
+
* @example
|
|
321
|
+
* ```js
|
|
322
|
+
* async function getLog() {
|
|
323
|
+
* const logs = await fin.System.getLogList();
|
|
324
|
+
* return await fin.System.getLog(logs[0]);
|
|
325
|
+
* }
|
|
326
|
+
*
|
|
327
|
+
* getLog().then(log => console.log(log)).catch(err => console.log(err));
|
|
328
|
+
* ```
|
|
223
329
|
*/
|
|
224
330
|
getLog(options: GetLogRequestType): Promise<string>;
|
|
225
331
|
/**
|
|
226
332
|
* Returns a unique identifier (UUID) provided by the machine.
|
|
227
|
-
*
|
|
228
|
-
* @
|
|
333
|
+
*
|
|
334
|
+
* @example
|
|
335
|
+
* ```js
|
|
336
|
+
* fin.System.getMachineId().then(id => console.log(id)).catch(err => console.log(err));
|
|
337
|
+
* ```
|
|
229
338
|
*/
|
|
230
339
|
getMachineId(): Promise<string>;
|
|
231
340
|
/**
|
|
232
341
|
* Returns the minimum (inclusive) logging level that is currently being written to the log.
|
|
233
|
-
*
|
|
234
|
-
* @
|
|
342
|
+
*
|
|
343
|
+
* @example
|
|
344
|
+
* ```js
|
|
345
|
+
* fin.System.getMinLogLevel().then(level => console.log(level)).catch(err => console.log(err));
|
|
346
|
+
* ```
|
|
235
347
|
*/
|
|
236
348
|
getMinLogLevel(): Promise<LogLevel>;
|
|
237
349
|
/**
|
|
238
350
|
* Retrieves an array containing information for each log file.
|
|
239
|
-
*
|
|
240
|
-
* @
|
|
351
|
+
*
|
|
352
|
+
* @example
|
|
353
|
+
* ```js
|
|
354
|
+
* fin.System.getLogList().then(logList => console.log(logList)).catch(err => console.log(err));
|
|
355
|
+
* ```
|
|
241
356
|
*/
|
|
242
357
|
getLogList(): Promise<Array<LogInfo>>;
|
|
243
358
|
/**
|
|
244
359
|
* Retrieves an object that contains data about the monitor setup of the
|
|
245
360
|
* computer that the runtime is running on.
|
|
246
|
-
*
|
|
247
|
-
* @
|
|
361
|
+
*
|
|
362
|
+
* @example
|
|
363
|
+
* ```js
|
|
364
|
+
* fin.System.getMonitorInfo().then(monitorInfo => console.log(monitorInfo)).catch(err => console.log(err));
|
|
365
|
+
* ```
|
|
248
366
|
*/
|
|
249
367
|
getMonitorInfo(): Promise<OpenFin.MonitorInfo>;
|
|
250
368
|
/**
|
|
251
369
|
* Returns the mouse in virtual screen coordinates (left, top).
|
|
252
|
-
*
|
|
253
|
-
* @
|
|
370
|
+
*
|
|
371
|
+
* @example
|
|
372
|
+
* ```js
|
|
373
|
+
* fin.System.getMousePosition().then(mousePosition => console.log(mousePosition)).catch(err => console.log(err));
|
|
374
|
+
* ```
|
|
254
375
|
*/
|
|
255
376
|
getMousePosition(): Promise<OpenFin.PointTopLeft>;
|
|
256
377
|
/**
|
|
@@ -258,43 +379,78 @@ export default class System extends EmitterBase<OpenFin.SystemEvent> {
|
|
|
258
379
|
* running. Each element in the array is an object containing the uuid
|
|
259
380
|
* and the name of the application to which the process belongs.
|
|
260
381
|
* @deprecated Please use our new set of process APIs:
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
* @
|
|
382
|
+
* {@link Window._Window#getProcessInfo Window.getProcessInfo}
|
|
383
|
+
* {@link View.View#getProcessInfo View.getProcessInfo}
|
|
384
|
+
* {@link Application.Application#getProcessInfo Application.getProcessInfo}
|
|
385
|
+
* {@link System#getAllProcessInfo System.getAllProcessInfo}
|
|
386
|
+
*
|
|
387
|
+
* @example
|
|
388
|
+
* ```js
|
|
389
|
+
* fin.System.getProcessList().then(ProcessList => console.log(ProcessList)).catch(err => console.log(err));
|
|
390
|
+
* ```
|
|
267
391
|
*/
|
|
268
392
|
getProcessList(): Promise<Array<any>>;
|
|
269
393
|
/**
|
|
270
|
-
* Retrieves all process information.
|
|
271
|
-
*
|
|
272
|
-
* @
|
|
394
|
+
* Retrieves all process information.
|
|
395
|
+
*
|
|
396
|
+
* @remarks This includes the browser process and every process associated to all entities (windows and views).
|
|
397
|
+
*
|
|
398
|
+
* @example
|
|
399
|
+
* ```js
|
|
400
|
+
* const allProcessInfo = await fin.System.getAllProcessInfo();
|
|
401
|
+
* ```
|
|
273
402
|
* @experimental
|
|
274
403
|
*/
|
|
275
404
|
getAllProcessInfo(): Promise<OpenFin.SystemProcessInfo>;
|
|
276
405
|
/**
|
|
277
406
|
* Retrieves the Proxy settings.
|
|
278
|
-
*
|
|
279
|
-
* @
|
|
407
|
+
*
|
|
408
|
+
* @example
|
|
409
|
+
* ```js
|
|
410
|
+
* fin.System.getProxySettings().then(ProxySetting => console.log(ProxySetting)).catch(err => console.log(err));
|
|
411
|
+
*
|
|
412
|
+
* //This response has the following shape:
|
|
413
|
+
* {
|
|
414
|
+
* config: {
|
|
415
|
+
* proxyAddress: "proxyAddress", //the configured Proxy Address
|
|
416
|
+
* proxyPort: 0, //the configured Proxy port
|
|
417
|
+
* type: "system" //Proxy Type
|
|
418
|
+
* },
|
|
419
|
+
* system: {
|
|
420
|
+
* autoConfigUrl: "",
|
|
421
|
+
* bypass: "",
|
|
422
|
+
* enabled: false,
|
|
423
|
+
* proxy: ""
|
|
424
|
+
* }
|
|
425
|
+
* }
|
|
426
|
+
* ```
|
|
280
427
|
*/
|
|
281
428
|
getProxySettings(): Promise<ProxyInfo>;
|
|
282
429
|
/**
|
|
283
430
|
* Returns information about the running Runtime in an object.
|
|
284
|
-
*
|
|
285
|
-
* @
|
|
431
|
+
*
|
|
432
|
+
* @example
|
|
433
|
+
* ```js
|
|
434
|
+
* fin.System.getRuntimeInfo().then(RuntimeInfo => console.log(RuntimeInfo)).catch(err => console.log(err));
|
|
435
|
+
* ```
|
|
286
436
|
*/
|
|
287
437
|
getRuntimeInfo(): Promise<OpenFin.RuntimeInfo>;
|
|
288
438
|
/**
|
|
289
439
|
* Returns information about the running RVM in an object.
|
|
290
|
-
*
|
|
291
|
-
* @
|
|
440
|
+
*
|
|
441
|
+
* @example
|
|
442
|
+
* ```js
|
|
443
|
+
* fin.System.getRvmInfo().then(RvmInfo => console.log(RvmInfo)).catch(err => console.log(err));
|
|
444
|
+
* ```
|
|
292
445
|
*/
|
|
293
446
|
getRvmInfo(): Promise<OpenFin.RVMInfo>;
|
|
294
447
|
/**
|
|
295
448
|
* Retrieves system information.
|
|
296
|
-
*
|
|
297
|
-
* @
|
|
449
|
+
*
|
|
450
|
+
* @example
|
|
451
|
+
* ```js
|
|
452
|
+
* fin.System.getHostSpecs().then(specs => console.log(specs)).catch(err => console.log(err));
|
|
453
|
+
* ```
|
|
298
454
|
*/
|
|
299
455
|
getHostSpecs(): Promise<OpenFin.HostSpecs>;
|
|
300
456
|
/**
|
|
@@ -302,49 +458,416 @@ export default class System extends EmitterBase<OpenFin.SystemEvent> {
|
|
|
302
458
|
* <br> A uuid may be optionally provided. If not provided, OpenFin will create a uuid for the new process.
|
|
303
459
|
* <br> Note: This method is restricted by default and must be enabled via
|
|
304
460
|
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>. Also, this api has an enhanced permission set to make it less dangerous. So application owners can only allow to launch the assets owned by the application, the enabled downloaded files or the restricted executables.
|
|
305
|
-
* @param
|
|
306
|
-
*
|
|
307
|
-
* @
|
|
461
|
+
* @param options A object that is defined in the ExternalProcessRequestType interface
|
|
462
|
+
*
|
|
463
|
+
* @remarks If an unused UUID is provided in options, it will be used. If no UUID is provided, OpenFin will assign one.
|
|
464
|
+
* This api has an enhanced permission set to make it less dangerous. So application owners can only allow to launch the
|
|
465
|
+
* assets owned by the application, the enabled downloaded files or the restricted executables.
|
|
466
|
+
*
|
|
467
|
+
* **Note:** Since _appAssets_ relies on the RVM, which is missing on MAC_OS, 'alias' is not available. Instead provide
|
|
468
|
+
* the full path e.g. _/Applications/Calculator.app/Contents/MacOS/Calculator_.
|
|
469
|
+
*
|
|
470
|
+
* @example
|
|
471
|
+
* Basic Example:
|
|
472
|
+
* ```js
|
|
473
|
+
* fin.System.launchExternalProcess({
|
|
474
|
+
* path: 'notepad',
|
|
475
|
+
* arguments: '',
|
|
476
|
+
* listener: function (result) {
|
|
477
|
+
* console.log('the exit code', result.exitCode);
|
|
478
|
+
* }
|
|
479
|
+
* }).then(processIdentity => {
|
|
480
|
+
* console.log(processIdentity);
|
|
481
|
+
* }).catch(error => {
|
|
482
|
+
* console.log(error);
|
|
483
|
+
* });
|
|
484
|
+
* ```
|
|
485
|
+
*
|
|
486
|
+
* Promise resolution:
|
|
487
|
+
*
|
|
488
|
+
* ```js
|
|
489
|
+
* //This response has the following shape:
|
|
490
|
+
* {
|
|
491
|
+
* uuid: "FB3E6E36-0976-4C2B-9A09-FB2E54D2F1BB" // The mapped UUID which identifies the launched process
|
|
492
|
+
* }
|
|
493
|
+
* ```
|
|
494
|
+
*
|
|
495
|
+
* Listener callback:
|
|
496
|
+
* ```js
|
|
497
|
+
* //This response has the following shape:
|
|
498
|
+
* {
|
|
499
|
+
* topic: "exited", // Or "released" on a call to releaseExternalProcess
|
|
500
|
+
* uuid: "FB3E6E36-0976-4C2B-9A09-FB2E54D2F1BB", // The mapped UUID which identifies the launched process
|
|
501
|
+
* exitCode: 0 // Process exit code
|
|
502
|
+
* }
|
|
503
|
+
* ```
|
|
504
|
+
*
|
|
505
|
+
* By specifying a lifetime, an external process can live as long the window/application that launched it or
|
|
506
|
+
* persist after the application exits. The default value is null, which is equivalent to 'persist', meaning
|
|
507
|
+
* the process lives on after the application exits:
|
|
508
|
+
*
|
|
509
|
+
* ```js
|
|
510
|
+
* fin.System.launchExternalProcess({
|
|
511
|
+
* path: 'notepad',
|
|
512
|
+
* arguments: '',
|
|
513
|
+
* listener: (result) => {
|
|
514
|
+
* console.log('the exit code', result.exitCode);
|
|
515
|
+
* },
|
|
516
|
+
* lifetime: 'window'
|
|
517
|
+
* }).then(processIdentity => {
|
|
518
|
+
* console.log(processIdentity);
|
|
519
|
+
* }).catch(error => {
|
|
520
|
+
* console.log(error);
|
|
521
|
+
* });
|
|
522
|
+
* ```
|
|
523
|
+
*
|
|
524
|
+
* Note: A process that exits when the window/application exits cannot be released via fin.desktop.System.releaseExternalProcess.
|
|
525
|
+
*
|
|
526
|
+
* By specifying a cwd, it will set current working directory when launching an external process:
|
|
527
|
+
*
|
|
528
|
+
* ```js
|
|
529
|
+
* fin.System.launchExternalProcess({
|
|
530
|
+
* path: 'cmd.exe',
|
|
531
|
+
* cwd: 'c:\\temp',
|
|
532
|
+
* arguments: '',
|
|
533
|
+
* listener: (result) => {
|
|
534
|
+
* console.log('the exit code', result.exitCode);
|
|
535
|
+
* }
|
|
536
|
+
* }).then(processIdentity => {
|
|
537
|
+
* console.log(processIdentity);
|
|
538
|
+
* }).catch(error => {
|
|
539
|
+
* console.log(error);
|
|
540
|
+
* });
|
|
541
|
+
* ```
|
|
542
|
+
*
|
|
543
|
+
* Example using an alias from app.json appAssets property:
|
|
544
|
+
*
|
|
545
|
+
* ```json
|
|
546
|
+
* "appAssets": [
|
|
547
|
+
* {
|
|
548
|
+
* "src": "exe.zip",
|
|
549
|
+
* "alias": "myApp",
|
|
550
|
+
* "version": "4.12.8",
|
|
551
|
+
* "target": "myApp.exe",
|
|
552
|
+
* "args": "a b c d"
|
|
553
|
+
* },
|
|
554
|
+
* ]
|
|
555
|
+
* ```
|
|
556
|
+
*
|
|
557
|
+
* ```js
|
|
558
|
+
* // When called, if no arguments are passed then the arguments (if any)
|
|
559
|
+
* // are taken from the 'app.json' file, from the 'args' parameter
|
|
560
|
+
* // of the 'appAssets' Object with the relevant 'alias'.
|
|
561
|
+
* fin.System.launchExternalProcess({
|
|
562
|
+
* //Additionally note that the executable found in the zip file specified in appAssets
|
|
563
|
+
* //will default to the one mentioned by appAssets.target
|
|
564
|
+
* //If the the path below refers to a specific path it will override this default
|
|
565
|
+
* alias: 'myApp',
|
|
566
|
+
* listener: (result) => {
|
|
567
|
+
* console.log('the exit code', result.exitCode);
|
|
568
|
+
* }
|
|
569
|
+
* }).then(processIdentity => {
|
|
570
|
+
* console.log(processIdentity);
|
|
571
|
+
* }).catch(error => {
|
|
572
|
+
* console.log(error);
|
|
573
|
+
* });
|
|
574
|
+
* ```
|
|
575
|
+
*
|
|
576
|
+
* Example using an alias but overriding the arguments:
|
|
577
|
+
*
|
|
578
|
+
* ```json
|
|
579
|
+
* "appAssets": [
|
|
580
|
+
* {
|
|
581
|
+
* "src": "exe.zip",
|
|
582
|
+
* "alias": "myApp",
|
|
583
|
+
* "version": "4.12.8",
|
|
584
|
+
* "target": "myApp.exe",
|
|
585
|
+
* "args": "a b c d"
|
|
586
|
+
* },
|
|
587
|
+
* ]
|
|
588
|
+
* ```
|
|
589
|
+
*
|
|
590
|
+
* ```js
|
|
591
|
+
* // If 'arguments' is passed as a parameter it takes precedence
|
|
592
|
+
* // over any 'args' set in the 'app.json'.
|
|
593
|
+
* fin.System.launchExternalProcess({
|
|
594
|
+
* alias: 'myApp',
|
|
595
|
+
* arguments: 'e f g',
|
|
596
|
+
* listener: (result) => {
|
|
597
|
+
* console.log('the exit code', result.exitCode);
|
|
598
|
+
* }
|
|
599
|
+
* }).then(processIdentity => {
|
|
600
|
+
* console.log(processIdentity);
|
|
601
|
+
* }).catch(error => {
|
|
602
|
+
* console.log(error);
|
|
603
|
+
* });
|
|
604
|
+
* ```
|
|
605
|
+
*
|
|
606
|
+
* It is now possible to optionally perform any combination of the following certificate checks
|
|
607
|
+
* against an absolute target via `fin.desktop.System.launchExternalProcess()`:
|
|
608
|
+
*
|
|
609
|
+
* ```js
|
|
610
|
+
* "certificate": {
|
|
611
|
+
* "serial": "3c a5 ...", // A hex string with or without spaces
|
|
612
|
+
* "subject": "O=OpenFin INC., L=New York, ...", // An internally tokenized and comma delimited string allowing partial or full checks of the subject fields
|
|
613
|
+
* "publickey": "3c a5 ...", // A hex string with or without spaces
|
|
614
|
+
* "thumbprint": "3c a5 ...", // A hex string with or without spaces
|
|
615
|
+
* "trusted": true // A boolean indicating that the certificate is trusted and not revoked
|
|
616
|
+
* }
|
|
617
|
+
* ```
|
|
618
|
+
*
|
|
619
|
+
* Providing this information as part of the default configurations for assets in an application's manifest
|
|
620
|
+
* will be added in a future RVM update:
|
|
621
|
+
*
|
|
622
|
+
* ```js
|
|
623
|
+
* fin.System.launchExternalProcess({
|
|
624
|
+
* path: 'C:\\Users\\ExampleUser\\AppData\\Local\\OpenFin\\OpenFinRVM.exe',
|
|
625
|
+
* arguments: '--version',
|
|
626
|
+
* certificate: {
|
|
627
|
+
* trusted: true,
|
|
628
|
+
* subject: 'O=OpenFin INC., L=New York, S=NY, C=US',
|
|
629
|
+
* thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b'
|
|
630
|
+
* },
|
|
631
|
+
* listener: (result) => {
|
|
632
|
+
* console.log('the exit code', result.exitCode);
|
|
633
|
+
* }
|
|
634
|
+
* }).then(processIdentity => {
|
|
635
|
+
* console.log(processIdentity);
|
|
636
|
+
* }).catch(error => {
|
|
637
|
+
* console.log(error);
|
|
638
|
+
* });
|
|
639
|
+
* ```
|
|
640
|
+
*
|
|
641
|
+
* It is possible to launch files that have been downloaded by the user by listening to the window
|
|
642
|
+
* `file-download-completed` event and using the `fileUuid` provided by the event:
|
|
643
|
+
*
|
|
644
|
+
* ```js
|
|
645
|
+
* const win = fin.Window.getCurrentSync();
|
|
646
|
+
* win.addListener('file-download-completed', (evt) => {
|
|
647
|
+
* if (evt.state === 'completed') {
|
|
648
|
+
* fin.System.launchExternalProcess({
|
|
649
|
+
* fileUuid: evt.fileUuid,
|
|
650
|
+
* arguments: '',
|
|
651
|
+
* listener: (result) => {
|
|
652
|
+
* console.log('the exit code', result.exitCode);
|
|
653
|
+
* }
|
|
654
|
+
* }).then(processIdentity => {
|
|
655
|
+
* console.log(processIdentity);
|
|
656
|
+
* }).catch(error => {
|
|
657
|
+
* console.log(error);
|
|
658
|
+
* });
|
|
659
|
+
* }
|
|
660
|
+
* });
|
|
661
|
+
* ```
|
|
662
|
+
*
|
|
663
|
+
* Launching assets specified in the app manifest:
|
|
664
|
+
*
|
|
665
|
+
* Sample appAssets section in app.json
|
|
666
|
+
* ```js
|
|
667
|
+
* "appAssets": [
|
|
668
|
+
* {
|
|
669
|
+
* "src": "http://filesamples.com/exe.zip",
|
|
670
|
+
* "alias": "myApp",
|
|
671
|
+
* "version": "4.12.8",
|
|
672
|
+
* "target": "myApp.exe",
|
|
673
|
+
* "args": "a b c d"
|
|
674
|
+
* },
|
|
675
|
+
* {
|
|
676
|
+
* "src": "http://examples.com/exe.zip",
|
|
677
|
+
* "alias": "myApp2",
|
|
678
|
+
* "version": "5.12.8",
|
|
679
|
+
* "target": "myApp2.exe",
|
|
680
|
+
* "args": "a b c"
|
|
681
|
+
* }
|
|
682
|
+
* ]
|
|
683
|
+
* ```
|
|
684
|
+
*
|
|
685
|
+
* This permission allows for launching of all assets specified in the above appAssets section. ("myApp" and "myApp2"):
|
|
686
|
+
*
|
|
687
|
+
* ```js
|
|
688
|
+
* "permissions": {
|
|
689
|
+
* "System": {
|
|
690
|
+
* "launchExternalProcess": {
|
|
691
|
+
* "enabled": true,
|
|
692
|
+
* "assets": {
|
|
693
|
+
* "enabled": true
|
|
694
|
+
* }
|
|
695
|
+
* }
|
|
696
|
+
* }
|
|
697
|
+
* }
|
|
698
|
+
* ```
|
|
699
|
+
*
|
|
700
|
+
* This permission allows for launching of _only_ the "myApp" asset in the above appAssets section, as defined in `srcRules`:
|
|
701
|
+
* ```js
|
|
702
|
+
* "permissions": {
|
|
703
|
+
* "System": {
|
|
704
|
+
* "launchExternalProcess": {
|
|
705
|
+
* "enabled": true,
|
|
706
|
+
* "assets": {
|
|
707
|
+
* "enabled": true
|
|
708
|
+
* "srcRules": [
|
|
709
|
+
* {
|
|
710
|
+
* "match": [
|
|
711
|
+
* "*://filesamples.com/*"
|
|
712
|
+
* ],
|
|
713
|
+
* "behavior": "allow"
|
|
714
|
+
* },
|
|
715
|
+
* {
|
|
716
|
+
* "match": [
|
|
717
|
+
* "<all_urls>"
|
|
718
|
+
* ],
|
|
719
|
+
* "behavior": "block"
|
|
720
|
+
* }
|
|
721
|
+
* ]
|
|
722
|
+
* }
|
|
723
|
+
* }
|
|
724
|
+
* }
|
|
725
|
+
* }
|
|
726
|
+
* ```
|
|
727
|
+
*
|
|
728
|
+
* Launching downloaded files:
|
|
729
|
+
* ```js
|
|
730
|
+
* "permissions": {
|
|
731
|
+
* "System": {
|
|
732
|
+
* "launchExternalProcess": {
|
|
733
|
+
* "enabled": true,
|
|
734
|
+
* "downloads": {
|
|
735
|
+
* "enabled": true
|
|
736
|
+
* }
|
|
737
|
+
* }
|
|
738
|
+
* }
|
|
739
|
+
* }
|
|
740
|
+
* ```
|
|
741
|
+
*
|
|
742
|
+
* This permission allows to launch all the executables:
|
|
743
|
+
* ```js
|
|
744
|
+
* "permissions": {
|
|
745
|
+
* "System": {
|
|
746
|
+
* "launchExternalProcess": {
|
|
747
|
+
* "enabled": true,
|
|
748
|
+
* "executables": {
|
|
749
|
+
* "enabled": true
|
|
750
|
+
* }
|
|
751
|
+
* }
|
|
752
|
+
* }
|
|
753
|
+
* }
|
|
754
|
+
* ```
|
|
755
|
+
*
|
|
756
|
+
*
|
|
757
|
+
* This permission only allows launching of executables whose file paths match the corresponding `pathRules`:
|
|
758
|
+
* ```js
|
|
759
|
+
* "permissions": {
|
|
760
|
+
* "System": {
|
|
761
|
+
* "launchExternalProcess": {
|
|
762
|
+
* "enabled": true,
|
|
763
|
+
* "executables": {
|
|
764
|
+
* "enabled": true
|
|
765
|
+
* "pathRules": [
|
|
766
|
+
* {
|
|
767
|
+
* "match": [
|
|
768
|
+
* "/Windows/System32/*.exe"
|
|
769
|
+
* ],
|
|
770
|
+
* "behavior": "allow"
|
|
771
|
+
* },
|
|
772
|
+
* {
|
|
773
|
+
* "match": [
|
|
774
|
+
* "*.exe"
|
|
775
|
+
* ],
|
|
776
|
+
* "behavior": "block"
|
|
777
|
+
* }
|
|
778
|
+
* ]
|
|
779
|
+
* }
|
|
780
|
+
* }
|
|
781
|
+
* }
|
|
782
|
+
* }
|
|
783
|
+
* ```
|
|
308
784
|
*/
|
|
309
785
|
launchExternalProcess(options: OpenFin.ExternalProcessRequestType): Promise<Identity>;
|
|
310
786
|
/**
|
|
311
787
|
* Monitors a running process. A pid for the process must be included in options.
|
|
312
788
|
* <br> A uuid may be optionally provided. If not provided, OpenFin will create a uuid for the new process.
|
|
313
|
-
* @param
|
|
314
|
-
*
|
|
315
|
-
* @
|
|
789
|
+
* @param options See tutorial for more details
|
|
790
|
+
*
|
|
791
|
+
* @remarks If an unused uuid is provided in options, it will be used. If no uuid is provided, OpefinFin will assign a uuid.
|
|
792
|
+
* @example
|
|
793
|
+
* ```js
|
|
794
|
+
* fin.System.monitorExternalProcess({
|
|
795
|
+
* pid: 10208,
|
|
796
|
+
* uuid: 'my-external-process', // optional
|
|
797
|
+
* listener: function (result) {
|
|
798
|
+
* console.log('the exit code', result.exitCode);
|
|
799
|
+
* }
|
|
800
|
+
* }).then(processIdentity => console.log(processIdentity)).catch(err => console.log(err));
|
|
801
|
+
* ```
|
|
316
802
|
*/
|
|
317
803
|
monitorExternalProcess(options: OpenFin.ExternalProcessInfo): Promise<Identity>;
|
|
318
804
|
/**
|
|
319
805
|
* Writes the passed message into both the log file and the console.
|
|
320
|
-
* @param
|
|
321
|
-
* @param
|
|
322
|
-
*
|
|
323
|
-
* @
|
|
806
|
+
* @param level The log level for the entry. Can be either "info", "warning" or "error"
|
|
807
|
+
* @param message The log message text
|
|
808
|
+
*
|
|
809
|
+
* @example
|
|
810
|
+
* ```js
|
|
811
|
+
* fin.System.log("info", "An example log message").then(() => console.log('Log info message')).catch(err => console.log(err));
|
|
812
|
+
* ```
|
|
324
813
|
*/
|
|
325
814
|
log(level: string, message: string): Promise<void>;
|
|
326
815
|
/**
|
|
327
|
-
* Opens the passed URL in the default web browser.
|
|
816
|
+
* Opens the passed URL in the default web browser.
|
|
817
|
+
*
|
|
818
|
+
* @remarks It only supports http(s) and fin(s) protocols by default.
|
|
328
819
|
* In order to use other custom protocols, they have to be enabled via
|
|
329
|
-
*
|
|
820
|
+
* [API security settings](https://developers.openfin.co/docs/api-security).
|
|
330
821
|
* File protocol and file path are not supported.
|
|
331
|
-
* @param
|
|
332
|
-
*
|
|
333
|
-
* @
|
|
822
|
+
* @param url The URL to open
|
|
823
|
+
*
|
|
824
|
+
* @example
|
|
825
|
+
* ```js
|
|
826
|
+
* fin.System.openUrlWithBrowser('https://cdn.openfin.co/docs/javascript/stable/tutorial-System.openUrlWithBrowser.html')
|
|
827
|
+
* .then(() => console.log('Opened URL'))
|
|
828
|
+
* .catch(err => console.log(err));
|
|
829
|
+
* ```
|
|
830
|
+
*
|
|
831
|
+
* Example of permission definition to enable non-default protocols:
|
|
832
|
+
*
|
|
833
|
+
* Note: permission definition should be specified in an app manifest file if there is no DOS settings.
|
|
834
|
+
* Otherwise it has to be specified in both DOS and app manifest files.
|
|
835
|
+
*
|
|
836
|
+
* ```js
|
|
837
|
+
* "permissions": {
|
|
838
|
+
* "System": {
|
|
839
|
+
* "openUrlWithBrowser": {
|
|
840
|
+
* "enabled": true,
|
|
841
|
+
* "protocols": [ "msteams", "slack"]
|
|
842
|
+
* }
|
|
843
|
+
* }
|
|
844
|
+
* }
|
|
845
|
+
* ```
|
|
334
846
|
*/
|
|
335
847
|
openUrlWithBrowser(url: string): Promise<void>;
|
|
336
848
|
/**
|
|
337
849
|
* Removes the process entry for the passed UUID obtained from a prior call
|
|
338
850
|
* of fin.System.launchExternalProcess().
|
|
339
|
-
* @param
|
|
340
|
-
*
|
|
341
|
-
* @
|
|
851
|
+
* @param uuid The UUID for a process obtained from a prior call to fin.desktop.System.launchExternalProcess()
|
|
852
|
+
*
|
|
853
|
+
* @example
|
|
854
|
+
* ```js
|
|
855
|
+
* fin.System.launchExternalProcess({
|
|
856
|
+
* path: "notepad",
|
|
857
|
+
* listener: function (result) {
|
|
858
|
+
* console.log("The exit code", result.exitCode);
|
|
859
|
+
* }
|
|
860
|
+
* })
|
|
861
|
+
* .then(identity => fin.System.releaseExternalProcess(identity.uuid))
|
|
862
|
+
* .then(() => console.log('Process has been unmapped!'))
|
|
863
|
+
* .catch(err => console.log(err));
|
|
864
|
+
* ```
|
|
342
865
|
*/
|
|
343
866
|
releaseExternalProcess(uuid: string): Promise<void>;
|
|
344
867
|
/**
|
|
345
868
|
* Shows the Chromium Developer Tools for the specified window
|
|
346
|
-
* @param
|
|
347
|
-
*
|
|
869
|
+
* @param identity This is a object that is defined by the Identity interface
|
|
870
|
+
*
|
|
348
871
|
* @tutorial System.showDeveloperTools
|
|
349
872
|
*/
|
|
350
873
|
showDeveloperTools(identity: Identity): Promise<void>;
|
|
@@ -353,165 +876,593 @@ export default class System extends EmitterBase<OpenFin.SystemEvent> {
|
|
|
353
876
|
* has not closed after the elapsed timeout in milliseconds.<br>
|
|
354
877
|
* Note: This method is restricted by default and must be enabled via
|
|
355
878
|
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
356
|
-
* @param
|
|
357
|
-
*
|
|
358
|
-
* @
|
|
879
|
+
* @param options A object defined in the TerminateExternalRequestType interface
|
|
880
|
+
*
|
|
881
|
+
* @example
|
|
882
|
+
* ```js
|
|
883
|
+
* fin.System.launchExternalProcess({
|
|
884
|
+
* path: "notepad",
|
|
885
|
+
* listener: function (result) {
|
|
886
|
+
* console.log("The exit code", result.exitCode);
|
|
887
|
+
* }
|
|
888
|
+
* })
|
|
889
|
+
* .then(identity => fin.System.terminateExternalProcess({uuid: identity.uuid, timeout:2000, killTree: false}))
|
|
890
|
+
* .then(() => console.log('Terminate the process'))
|
|
891
|
+
* .catch(err => console.log(err));
|
|
892
|
+
* ```
|
|
359
893
|
*/
|
|
360
894
|
terminateExternalProcess(options: OpenFin.TerminateExternalRequestType): Promise<void>;
|
|
361
895
|
/**
|
|
362
896
|
* Update the OpenFin Runtime Proxy settings.
|
|
363
|
-
* @param
|
|
364
|
-
*
|
|
365
|
-
* @
|
|
897
|
+
* @param options A config object defined in the ProxyConfig interface
|
|
898
|
+
*
|
|
899
|
+
* @example
|
|
900
|
+
* ```js
|
|
901
|
+
* fin.System.updateProxySettings({proxyAddress:'127.0.0.1', proxyPort:8080, type:'http'})
|
|
902
|
+
* .then(() => console.log('Update proxy successfully'))
|
|
903
|
+
* .catch(err => console.error(err));
|
|
904
|
+
* ```
|
|
366
905
|
*/
|
|
367
906
|
updateProxySettings(options: ProxyConfig): Promise<void>;
|
|
368
907
|
/**
|
|
369
908
|
* Downloads the given application asset<br>
|
|
370
909
|
* Note: This method is restricted by default and must be enabled via
|
|
371
910
|
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
372
|
-
* @param
|
|
373
|
-
*
|
|
374
|
-
* @
|
|
911
|
+
* @param appAsset App asset object
|
|
912
|
+
*
|
|
913
|
+
* @example
|
|
914
|
+
* ```js
|
|
915
|
+
* async function downloadAsset() {
|
|
916
|
+
* const appAsset = {
|
|
917
|
+
* src: `${ location.origin }/assets.zip`,
|
|
918
|
+
* alias: 'dirApp',
|
|
919
|
+
* version: '1.23.24',
|
|
920
|
+
* target: 'assets/run.bat'
|
|
921
|
+
* };
|
|
922
|
+
*
|
|
923
|
+
* return fin.System.downloadAsset(appAsset, (progress => {
|
|
924
|
+
* //Print progress as we download the asset.
|
|
925
|
+
* const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100);
|
|
926
|
+
* console.log(`Downloaded ${downloadedPercent}%`);
|
|
927
|
+
* }));
|
|
928
|
+
* }
|
|
929
|
+
*
|
|
930
|
+
* downloadAsset()
|
|
931
|
+
* .then(() => console.log('Success'))
|
|
932
|
+
* .catch(err => console.error(err));
|
|
933
|
+
*
|
|
934
|
+
* ```
|
|
375
935
|
*/
|
|
376
936
|
downloadAsset(appAsset: OpenFin.AppAssetInfo, progressListener: (progress: OpenFin.RuntimeDownloadProgress) => void): Promise<void>;
|
|
377
937
|
/**
|
|
378
938
|
* Downloads a version of the runtime.
|
|
379
|
-
* @param
|
|
380
|
-
* @param
|
|
381
|
-
*
|
|
382
|
-
* @
|
|
939
|
+
* @param options - Download options.
|
|
940
|
+
* @param progressListener - called as the runtime is downloaded with progress information.
|
|
941
|
+
*
|
|
942
|
+
* @remarks Only supported in an OpenFin Render process.
|
|
943
|
+
*
|
|
944
|
+
* @example
|
|
945
|
+
* ```js
|
|
946
|
+
* var downloadOptions = {
|
|
947
|
+
* //Specific version number required, if given a release channel the call will produce an error.
|
|
948
|
+
* version: '9.61.30.1'
|
|
949
|
+
* };
|
|
950
|
+
*
|
|
951
|
+
* function onProgress(progress) {
|
|
952
|
+
* console.log(`${Math.floor((progress.downloadedBytes / progress.totalBytes) * 100)}%`);
|
|
953
|
+
* }
|
|
954
|
+
*
|
|
955
|
+
* fin.System.downloadRuntime(downloadOptions, onProgress).then(() => {
|
|
956
|
+
* console.log('Download complete');
|
|
957
|
+
* }).catch(err => {
|
|
958
|
+
* console.log(`Download Failed, we could retry: ${err.message}`);
|
|
959
|
+
* console.log(err);
|
|
960
|
+
* });
|
|
961
|
+
* ```
|
|
383
962
|
*/
|
|
384
963
|
downloadRuntime(options: OpenFin.RuntimeDownloadOptions, progressListener: (progress: OpenFin.RuntimeDownloadProgress) => void): Promise<void>;
|
|
385
964
|
/**
|
|
386
965
|
* Download preload scripts from given URLs
|
|
387
|
-
* @param
|
|
388
|
-
*
|
|
389
|
-
* @
|
|
966
|
+
* @param scripts - URLs of preload scripts. See tutorial for more details.
|
|
967
|
+
*
|
|
968
|
+
* @example
|
|
969
|
+
* ```js
|
|
970
|
+
* const scripts = [
|
|
971
|
+
* { url: 'http://.../preload.js' },
|
|
972
|
+
* { url: 'http://.../preload2.js' }
|
|
973
|
+
* ];
|
|
974
|
+
*
|
|
975
|
+
* fin.System.downloadPreloadScripts(scripts).then(results => {
|
|
976
|
+
* results.forEach(({url, success, error}) => {
|
|
977
|
+
* console.log(`URL: ${url}`);
|
|
978
|
+
* console.log(`Success: ${success}`);
|
|
979
|
+
* if (error) {
|
|
980
|
+
* console.log(`Error: ${error}`);
|
|
981
|
+
* }
|
|
982
|
+
* });
|
|
983
|
+
* });
|
|
984
|
+
* ```
|
|
390
985
|
*/
|
|
391
986
|
downloadPreloadScripts(scripts: Array<OpenFin.DownloadPreloadOption>): Promise<Array<OpenFin.DownloadPreloadInfo>>;
|
|
392
987
|
/**
|
|
393
988
|
* Retrieves an array of data (name, ids, bounds) for all application windows.
|
|
394
|
-
*
|
|
395
|
-
* @
|
|
989
|
+
*
|
|
990
|
+
* @example
|
|
991
|
+
* ```js
|
|
992
|
+
* fin.System.getAllExternalApplications()
|
|
993
|
+
* .then(externalApps => console.log('Total external apps: ' + externalApps.length))
|
|
994
|
+
* .catch(err => console.log(err));
|
|
995
|
+
* ```
|
|
396
996
|
*/
|
|
397
997
|
getAllExternalApplications(): Promise<Array<Identity>>;
|
|
398
998
|
/**
|
|
399
999
|
* Retrieves app asset information.
|
|
400
|
-
* @param
|
|
401
|
-
*
|
|
402
|
-
* @
|
|
1000
|
+
* @param options
|
|
1001
|
+
*
|
|
1002
|
+
* @example
|
|
1003
|
+
* ```js
|
|
1004
|
+
* fin.System.getAppAssetInfo({alias:'procexp'}).then(assetInfo => console.log(assetInfo)).catch(err => console.log(err));
|
|
1005
|
+
* ```
|
|
403
1006
|
*/
|
|
404
1007
|
getAppAssetInfo(options: OpenFin.AppAssetRequest): Promise<OpenFin.AppAssetInfo>;
|
|
405
1008
|
/**
|
|
406
1009
|
* Get additional info of cookies.
|
|
407
|
-
* @param
|
|
408
|
-
*
|
|
409
|
-
* @
|
|
1010
|
+
* @param options - See tutorial for more details.
|
|
1011
|
+
*
|
|
1012
|
+
* @example
|
|
1013
|
+
* ```js
|
|
1014
|
+
* fin.System.getCookies({name: 'myCookie'}).then(cookies => console.log(cookies)).catch(err => console.log(err));
|
|
1015
|
+
* ```
|
|
410
1016
|
*/
|
|
411
1017
|
getCookies(options: OpenFin.CookieOption): Promise<Array<OpenFin.CookieInfo>>;
|
|
412
1018
|
/**
|
|
413
1019
|
* Set the minimum log level above which logs will be written to the OpenFin log
|
|
414
|
-
* @param
|
|
415
|
-
*
|
|
416
|
-
* @
|
|
1020
|
+
* @param The minimum level (inclusive) above which all calls to log will be written
|
|
1021
|
+
*
|
|
1022
|
+
* @example
|
|
1023
|
+
* ```js
|
|
1024
|
+
* fin.System.setMinLogLevel("verbose").then(() => console.log("log level is set to verbose")).catch(err => console.log(err));
|
|
1025
|
+
* ```
|
|
417
1026
|
*/
|
|
418
1027
|
setMinLogLevel(level: LogLevel): Promise<void>;
|
|
419
1028
|
/**
|
|
420
1029
|
* Retrieves the UUID of the computer on which the runtime is installed
|
|
421
|
-
* @param
|
|
422
|
-
*
|
|
423
|
-
* @
|
|
1030
|
+
* @param uuid The uuid of the running application
|
|
1031
|
+
*
|
|
1032
|
+
* @example
|
|
1033
|
+
* ```js
|
|
1034
|
+
* fin.System.resolveUuid('OpenfinPOC').then(entity => console.log(entity)).catch(err => console.log(err));
|
|
1035
|
+
* ```
|
|
424
1036
|
*/
|
|
425
1037
|
resolveUuid(uuid: string): Promise<Entity>;
|
|
426
1038
|
/**
|
|
427
1039
|
* Retrieves an array of data for all external applications
|
|
428
|
-
* @param
|
|
429
|
-
* @param
|
|
430
|
-
*
|
|
1040
|
+
* @param requestingIdentity This object is described in the Identity typedef
|
|
1041
|
+
* @param data Any data type to pass to the method
|
|
1042
|
+
*
|
|
431
1043
|
* @ignore
|
|
432
1044
|
*/
|
|
433
1045
|
executeOnRemote(requestingIdentity: Identity, data: any): Promise<any>;
|
|
434
1046
|
/**
|
|
435
|
-
* Reads the specifed value from the registry
|
|
436
|
-
*
|
|
437
|
-
*
|
|
438
|
-
* @param
|
|
439
|
-
* @param
|
|
440
|
-
* @param
|
|
441
|
-
*
|
|
442
|
-
* @
|
|
1047
|
+
* Reads the specifed value from the registry.
|
|
1048
|
+
* @remarks This method is restricted by default and must be enabled via
|
|
1049
|
+
* [API security settings](https://developers.openfin.co/docs/api-security).
|
|
1050
|
+
* @param rootKey - The registry root key.
|
|
1051
|
+
* @param subkey - The registry key.
|
|
1052
|
+
* @param value - The registry value name.
|
|
1053
|
+
*
|
|
1054
|
+
* @example
|
|
1055
|
+
* ```js
|
|
1056
|
+
* fin.System.readRegistryValue("HKEY_LOCAL_MACHINE", "HARDWARE\\DESCRIPTION\\System", "BootArchitecture").then(val => console.log(val)).catch(err => console.log(err));
|
|
1057
|
+
* ```
|
|
1058
|
+
*
|
|
1059
|
+
* See {@link https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx here} for Window's error code definitions.
|
|
1060
|
+
*
|
|
1061
|
+
* Example payloads of different registry types:
|
|
1062
|
+
*
|
|
1063
|
+
* See list of types {@link https://msdn.microsoft.com/en-us/library/windows/desktop/ms724884(v=vs.85).aspx here}.
|
|
1064
|
+
*
|
|
1065
|
+
* ```js
|
|
1066
|
+
* // REG_DWORD
|
|
1067
|
+
* {
|
|
1068
|
+
* data: 1,
|
|
1069
|
+
* rootKey: "HKEY_LOCAL_MACHINE",
|
|
1070
|
+
* subkey: "Foo\Bar",
|
|
1071
|
+
* type: "REG_DWORD",
|
|
1072
|
+
* value: "Baz"
|
|
1073
|
+
* }
|
|
1074
|
+
*
|
|
1075
|
+
* // REG_QWORD
|
|
1076
|
+
* {
|
|
1077
|
+
* data: 13108146671334112,
|
|
1078
|
+
* rootKey: "HKEY_LOCAL_MACHINE",
|
|
1079
|
+
* subkey: "Foo\Bar",
|
|
1080
|
+
* type: "REG_QWORD",
|
|
1081
|
+
* value: "Baz"
|
|
1082
|
+
* }
|
|
1083
|
+
*
|
|
1084
|
+
* // REG_SZ
|
|
1085
|
+
* {
|
|
1086
|
+
* data: "FooBarBaz",
|
|
1087
|
+
* rootKey: "HKEY_LOCAL_MACHINE",
|
|
1088
|
+
* subkey: "Foo\Bar",
|
|
1089
|
+
* type: "REG_SZ",
|
|
1090
|
+
* value: "Baz"
|
|
1091
|
+
* }
|
|
1092
|
+
*
|
|
1093
|
+
* // REG_EXPAND_SZ
|
|
1094
|
+
* {
|
|
1095
|
+
* data: "C:\User\JohnDoe\AppData\Local",
|
|
1096
|
+
* rootKey: "HKEY_CURRENT_USER",
|
|
1097
|
+
* subkey: "Foo\Bar",
|
|
1098
|
+
* type: "REG_EXPAND_SZ",
|
|
1099
|
+
* value: "Baz"
|
|
1100
|
+
* }
|
|
1101
|
+
*
|
|
1102
|
+
* // REG_MULTI_SZ
|
|
1103
|
+
* {
|
|
1104
|
+
* data: [
|
|
1105
|
+
* "Foo",
|
|
1106
|
+
* "Bar",
|
|
1107
|
+
* "Baz"
|
|
1108
|
+
* ],
|
|
1109
|
+
* rootKey: "HKEY_CURRENT_USER",
|
|
1110
|
+
* subkey: "Foo\Bar",
|
|
1111
|
+
* type: "REG_MULTI_SZ",
|
|
1112
|
+
* value: "Baz"
|
|
1113
|
+
* }
|
|
1114
|
+
*
|
|
1115
|
+
* // REG_BINARY
|
|
1116
|
+
* {
|
|
1117
|
+
* data: {
|
|
1118
|
+
* data: [
|
|
1119
|
+
* 255,
|
|
1120
|
+
* 255,
|
|
1121
|
+
* 0,
|
|
1122
|
+
* 43,
|
|
1123
|
+
* 55,
|
|
1124
|
+
* 0,
|
|
1125
|
+
* 0,
|
|
1126
|
+
* 255,
|
|
1127
|
+
* 255
|
|
1128
|
+
* ],
|
|
1129
|
+
* type: "Buffer"
|
|
1130
|
+
* },
|
|
1131
|
+
* rootKey: "HKEY_CURRENT_USER",
|
|
1132
|
+
* subkey: "Foo\Bar",
|
|
1133
|
+
* type: "REG_BINARY",
|
|
1134
|
+
* value: "Baz"
|
|
1135
|
+
* }
|
|
1136
|
+
* ```
|
|
443
1137
|
*/
|
|
444
1138
|
readRegistryValue(rootKey: string, subkey: string, value: string): Promise<RegistryInfo>;
|
|
445
1139
|
/**
|
|
446
1140
|
* This function call will register a unique id and produce a token.
|
|
447
1141
|
* The token can be used to broker an external connection.
|
|
448
|
-
* @param
|
|
449
|
-
*
|
|
450
|
-
* @
|
|
1142
|
+
* @param uuid - A UUID for the remote connection.
|
|
1143
|
+
*
|
|
1144
|
+
* @example
|
|
1145
|
+
* ```js
|
|
1146
|
+
* fin.System.registerExternalConnection("remote-connection-uuid").then(conn => console.log(conn)).catch(err => console.log(err));
|
|
1147
|
+
*
|
|
1148
|
+
*
|
|
1149
|
+
* // object comes back with
|
|
1150
|
+
* // token: "0489EAC5-6404-4F0D-993B-92BB8EAB445D", // this will be unique each time
|
|
1151
|
+
* // uuid: "remote-connection-uuid"
|
|
1152
|
+
*
|
|
1153
|
+
* ```
|
|
451
1154
|
*/
|
|
452
1155
|
registerExternalConnection(uuid: string): Promise<OpenFin.ExternalConnection>;
|
|
453
1156
|
/**
|
|
454
1157
|
* Returns the json blob found in the [desktop owner settings](https://openfin.co/documentation/desktop-owner-settings/)
|
|
455
1158
|
* for the specified service.
|
|
456
|
-
*
|
|
457
|
-
*
|
|
458
|
-
* @
|
|
459
|
-
*
|
|
1159
|
+
* @param serviceIdentifier An object containing a name key that identifies the service.
|
|
1160
|
+
*
|
|
1161
|
+
* @remarks More information about desktop services can be found [here](https://developers.openfin.co/docs/desktop-services).
|
|
1162
|
+
* This call will reject if the desktop owner settings file is not present, not correctly formatted, or if the service requested is not configured or configured incorrectly.
|
|
1163
|
+
*
|
|
1164
|
+
* @example
|
|
1165
|
+
* ```js
|
|
1166
|
+
* // Here we are using the [layouts](https://github.com/HadoukenIO/layouts-service) service.
|
|
1167
|
+
* fin.System.getServiceConfiguration({name:'layouts'}).then(console.log).catch(console.error);
|
|
1168
|
+
* ```
|
|
460
1169
|
*/
|
|
461
1170
|
getServiceConfiguration(serviceIdentifier: OpenFin.ServiceIdentifier): Promise<OpenFin.ServiceConfiguration>;
|
|
462
1171
|
protected getSystemAppConfig(name: string): Promise<any>;
|
|
463
1172
|
/**
|
|
464
1173
|
* Registers a system shutdown handler so user can do some cleanup before system is shutting down.
|
|
465
|
-
*
|
|
466
|
-
* @param
|
|
467
|
-
*
|
|
468
|
-
* @
|
|
1174
|
+
* @remarks Once system shutdown starts, you are unable to cancel it.
|
|
1175
|
+
* @param handler system shutdown handler
|
|
1176
|
+
*
|
|
1177
|
+
* @example
|
|
1178
|
+
* ```js
|
|
1179
|
+
* fin.System.registerShutdownHandler((shutdownEvent) => {
|
|
1180
|
+
* // save state or cleanup
|
|
1181
|
+
* console.log('do some cleanup before shutdown');
|
|
1182
|
+
* // Notify app is ready for termination.
|
|
1183
|
+
* shutdownEvent.proceed();
|
|
1184
|
+
* })
|
|
1185
|
+
* .then(() => console.log('Shutdown handler registered!'))
|
|
1186
|
+
* .catch(err => console.log(err));
|
|
1187
|
+
* ```
|
|
469
1188
|
* @experimental
|
|
470
1189
|
*/
|
|
471
1190
|
registerShutdownHandler(handler: OpenFin.SystemShutdownHandler): Promise<void>;
|
|
472
1191
|
/**
|
|
473
1192
|
* Signals the RVM to perform a health check and returns the results as json.
|
|
474
|
-
*
|
|
475
|
-
* @
|
|
1193
|
+
*
|
|
1194
|
+
* @remarks Requires RVM 5.5+
|
|
1195
|
+
*
|
|
1196
|
+
* @example
|
|
1197
|
+
* ```js
|
|
1198
|
+
* try {
|
|
1199
|
+
* const results = await fin.System.runRvmHealthCheck();
|
|
1200
|
+
* console.log(results);
|
|
1201
|
+
* } catch(e) {
|
|
1202
|
+
* console.error(e);
|
|
1203
|
+
* }
|
|
1204
|
+
* ```
|
|
476
1205
|
*/
|
|
477
1206
|
runRvmHealthCheck(): Promise<string[]>;
|
|
478
1207
|
/**
|
|
479
1208
|
* Launch application using a manifest URL/path. It differs from Application.startFromManifest in that this API can accept a manifest using the fin protocol.
|
|
480
|
-
* @param
|
|
481
|
-
* @param
|
|
482
|
-
*
|
|
1209
|
+
* @param manifestUrl - The manifest's URL or path.
|
|
1210
|
+
* @param opts - Parameters that the RVM will use.
|
|
1211
|
+
*
|
|
483
1212
|
* @experimental
|
|
484
|
-
* @
|
|
1213
|
+
* @remarks Supports protocols http/s and fin/s, and also a local path.
|
|
1214
|
+
*
|
|
1215
|
+
* Note: This API is Windows only.
|
|
1216
|
+
*
|
|
1217
|
+
* @example
|
|
1218
|
+
*
|
|
1219
|
+
* This API can handle most manifest types. Some examples below.
|
|
1220
|
+
*
|
|
1221
|
+
* Traditional:
|
|
1222
|
+
* ```js
|
|
1223
|
+
* const manifest = await fin.System.launchManifest(
|
|
1224
|
+
* 'https://demoappdirectory.openf.in/desktop/config/apps/OpenFin/HelloOpenFin/app.json');
|
|
1225
|
+
* console.log(manifest);
|
|
1226
|
+
* ```
|
|
1227
|
+
*
|
|
1228
|
+
* Platform:
|
|
1229
|
+
* ```js
|
|
1230
|
+
* const manifest = await fin.System.launchManifest('https://openfin.github.io/platform-api-project-seed/public.json');
|
|
1231
|
+
* console.log(manifest);
|
|
1232
|
+
* ```
|
|
1233
|
+
*
|
|
1234
|
+
* Launching traditional manifest into a platform:
|
|
1235
|
+
* ```js
|
|
1236
|
+
* const manifest = await fin.System.launchManifest(
|
|
1237
|
+
* 'https://openfin.github.io/platform-api-project-seed/public.json?\
|
|
1238
|
+
* $$appManifestUrl=https://demoappdirectory.openf.in/desktop/config/\
|
|
1239
|
+
* apps/OpenFin/HelloOpenFin/app.json');
|
|
1240
|
+
* console.log(manifest);
|
|
1241
|
+
* ```
|
|
1242
|
+
*
|
|
1243
|
+
* Launching with RVM options:
|
|
1244
|
+
* ```js
|
|
1245
|
+
* const manifest = await fin.System.launchManifest('https://openfin.github.io/platform-api-project-seed/public.json',
|
|
1246
|
+
* { noUi: true, userAppConfigArgs: { abc: '123', xyz: '789' } });
|
|
1247
|
+
* console.log(manifest);
|
|
1248
|
+
* ```
|
|
1249
|
+
*
|
|
1250
|
+
* Local Path:
|
|
1251
|
+
* ```js
|
|
1252
|
+
* const manifest = await fin.System.launchManifest('file://c:\\path\\to\\manifest\\file.json');
|
|
1253
|
+
* console.log(manifest);
|
|
1254
|
+
* ```
|
|
1255
|
+
*
|
|
1256
|
+
* Launching with RVM 'subscribe' option:
|
|
1257
|
+
*
|
|
1258
|
+
* This option allows users to subscribe to app version resolver events when
|
|
1259
|
+
* calling launchManifest with fallbackManifests specified.
|
|
1260
|
+
*
|
|
1261
|
+
* ```js
|
|
1262
|
+
* fin.System.launchManifest('fins://system-apps/notifications/app.json', { subscribe: (launch) => {
|
|
1263
|
+
* launch.on('app-version-progress', (progress) => {
|
|
1264
|
+
* console.log("Trying manifest " + progress.manifest)
|
|
1265
|
+
* });
|
|
1266
|
+
*
|
|
1267
|
+
* launch.on('runtime-status', (status) => {
|
|
1268
|
+
* console.log("Runtime status: " + JSON.stringify(status));
|
|
1269
|
+
* });
|
|
1270
|
+
*
|
|
1271
|
+
* // RVM has successfully found the target runtime version
|
|
1272
|
+
* launch.on('app-version-complete', (complete) => {
|
|
1273
|
+
* console.log("Parent app " + complete.srcManifest + " resolved to " + complete.manifest);
|
|
1274
|
+
* launch.removeAllListeners();
|
|
1275
|
+
* });
|
|
1276
|
+
*
|
|
1277
|
+
* // RVM failed to find an available runtime version
|
|
1278
|
+
* launch.on('app-version-error', (error) => {
|
|
1279
|
+
* console.log("Failed to resolve " + error.srcManifest + " from the fallbackManifests");
|
|
1280
|
+
* launch.removeAllListeners();
|
|
1281
|
+
* });
|
|
1282
|
+
* }
|
|
1283
|
+
* });
|
|
1284
|
+
* ```
|
|
485
1285
|
* @static
|
|
486
1286
|
*/
|
|
487
1287
|
launchManifest(manifestUrl: string, opts?: OpenFin.RvmLaunchOptions): Promise<OpenFin.Manifest>;
|
|
488
1288
|
/**
|
|
489
1289
|
* Query permission of a secured api in current context.
|
|
490
|
-
* @param
|
|
491
|
-
*
|
|
492
|
-
* @
|
|
1290
|
+
* @param apiName - The full name of a secured API.
|
|
1291
|
+
*
|
|
1292
|
+
* @example
|
|
1293
|
+
* ```js
|
|
1294
|
+
* fin.System.queryPermissionForCurrentContext('System.launchExternalProcess').then(result => console.log(result)).catch(err => console.log(err));
|
|
1295
|
+
*
|
|
1296
|
+
* //This response has the following shape:
|
|
1297
|
+
* {
|
|
1298
|
+
* permission: 'System.launchExternalProcess', // api full name
|
|
1299
|
+
* state: 'granted', // state of permission
|
|
1300
|
+
* granted: true
|
|
1301
|
+
* }
|
|
1302
|
+
* ```
|
|
493
1303
|
*/
|
|
494
1304
|
queryPermissionForCurrentContext(apiName: string): Promise<OpenFin.QueryPermissionResult>;
|
|
495
1305
|
enableNativeWindowIntegrationProvider(permissions: any): Promise<OpenFin.NativeWindowIntegrationProviderAuthorization>;
|
|
496
1306
|
/**
|
|
497
1307
|
* (Internal) Register the usage of a component with a platform
|
|
498
|
-
* @param
|
|
499
|
-
*
|
|
500
|
-
* @
|
|
1308
|
+
* @param options - Object with data and type
|
|
1309
|
+
*
|
|
1310
|
+
* @example
|
|
1311
|
+
* ```js
|
|
1312
|
+
* async function registerUsage() {
|
|
1313
|
+
* const app = await fin.System.getCurrent();
|
|
1314
|
+
* return await fin.System.registerUsage({
|
|
1315
|
+
* type: 'workspace-licensing',
|
|
1316
|
+
* // example values for the following data object
|
|
1317
|
+
* data: {
|
|
1318
|
+
* apiVersion: '1.0',
|
|
1319
|
+
* componentName: 'home',
|
|
1320
|
+
* componentVersion: '1.0',
|
|
1321
|
+
* allowed: true,
|
|
1322
|
+
* rejectionCode: ''
|
|
1323
|
+
* }
|
|
1324
|
+
* });
|
|
1325
|
+
* }
|
|
1326
|
+
*
|
|
1327
|
+
* registerUsage().then(() => console.log('Successfully registered component application')).catch(err => console.log(err));
|
|
1328
|
+
* ```
|
|
501
1329
|
*/
|
|
502
1330
|
registerUsage({ data, type }: OpenFin.RegisterUsageData): Promise<void>;
|
|
503
1331
|
/**
|
|
504
1332
|
* Returns an array with all printers of the caller and not all the printers on the desktop.
|
|
505
|
-
*
|
|
506
|
-
* @
|
|
1333
|
+
*
|
|
1334
|
+
* @example
|
|
1335
|
+
* ```js
|
|
1336
|
+
* fin.System.getPrinters()
|
|
1337
|
+
* .then((printers) => {
|
|
1338
|
+
* printers.forEach((printer) => {
|
|
1339
|
+
* if (printer.isDefault) {
|
|
1340
|
+
* console.log(printer);
|
|
1341
|
+
* }
|
|
1342
|
+
* });
|
|
1343
|
+
* })
|
|
1344
|
+
* .catch((err) => {
|
|
1345
|
+
* console.log(err);
|
|
1346
|
+
* });
|
|
1347
|
+
* ```
|
|
507
1348
|
*/
|
|
508
1349
|
getPrinters(): Promise<PrinterInfo[]>;
|
|
509
1350
|
/**
|
|
510
1351
|
* Updates Process Logging values: periodic interval and outlier detection entries and interval.
|
|
511
|
-
* @param
|
|
512
|
-
*
|
|
513
|
-
* @
|
|
1352
|
+
* @param options Process Logging updatable options.
|
|
1353
|
+
*
|
|
1354
|
+
* @remarks When enabling verbose mode, additional process information is logged to the debug.log:
|
|
1355
|
+
*
|
|
1356
|
+
* 1. Periodically process usage (memory, cpu, etc) will be logged for each PID along with the windows, views and
|
|
1357
|
+
* iframes that belong to them. The default is every 30 seconds. Updatable by passing the interval option.
|
|
1358
|
+
* 2. When Windows and Views are created or navigated the PID they belong to and their options will be logged.
|
|
1359
|
+
* 3. When Windows and Views are destroyed their last known process usage will be logged.
|
|
1360
|
+
* 4. Whenever an outlier memory usage is detected it will be logged. By default, on an interval of 5 seconds we will
|
|
1361
|
+
* collect process usage for all PIDs and when 144 such entries are collected, we will start analyzing the data for any
|
|
1362
|
+
* possible outliers in the following entries. The interval and maximum number of entries stored in the running buffer
|
|
1363
|
+
* can be updatable by passing the outlierDetection.interval and outlierDetection.entries options.
|
|
1364
|
+
*
|
|
1365
|
+
* @example
|
|
1366
|
+
*
|
|
1367
|
+
* ```js
|
|
1368
|
+
* await fin.System.updateProcessLoggingOptions({
|
|
1369
|
+
* interval: 10,
|
|
1370
|
+
* outlierDetection: {
|
|
1371
|
+
* interval: 15,
|
|
1372
|
+
* entries: 200
|
|
1373
|
+
* }
|
|
1374
|
+
* });
|
|
1375
|
+
* ```
|
|
514
1376
|
*/
|
|
515
1377
|
updateProcessLoggingOptions(options: OpenFin.ProcessLoggingOptions): Promise<void>;
|
|
1378
|
+
/**
|
|
1379
|
+
* Returns domain settings for the current application.
|
|
1380
|
+
* Initial settings are configured with the defaultDomainSettings application option via manifest.
|
|
1381
|
+
* Domain settings can be overwritten during runtime with System.setDomainSettings.
|
|
1382
|
+
* @example
|
|
1383
|
+
* ```js
|
|
1384
|
+
* const domainSettings = await fin.System.getDomainSettings();
|
|
1385
|
+
* // {
|
|
1386
|
+
* // "rules": [
|
|
1387
|
+
* // {
|
|
1388
|
+
* // "match": [
|
|
1389
|
+
* // "https://openfin.co"
|
|
1390
|
+
* // ],
|
|
1391
|
+
* // "options": {
|
|
1392
|
+
* // "downloadSettings": {
|
|
1393
|
+
* // "rules": [
|
|
1394
|
+
* // {
|
|
1395
|
+
* // "match": [
|
|
1396
|
+
* // "<all_urls>"
|
|
1397
|
+
* // ],
|
|
1398
|
+
* // "behavior": "prompt"
|
|
1399
|
+
* // }
|
|
1400
|
+
* // ]
|
|
1401
|
+
* // }
|
|
1402
|
+
* // }
|
|
1403
|
+
* // }
|
|
1404
|
+
* // ]
|
|
1405
|
+
* // }
|
|
1406
|
+
* ```
|
|
1407
|
+
*/
|
|
1408
|
+
getDomainSettings(): Promise<OpenFin.DefaultDomainSettings>;
|
|
1409
|
+
/**
|
|
1410
|
+
* Sets the domain settings for the current application.
|
|
1411
|
+
* @param domainSettings - domain settings object
|
|
1412
|
+
* @example
|
|
1413
|
+
* ```js
|
|
1414
|
+
* const domainSettings = await fin.System.getDomainSettings();
|
|
1415
|
+
* // {
|
|
1416
|
+
* // "rules": [
|
|
1417
|
+
* // {
|
|
1418
|
+
* // "match": [
|
|
1419
|
+
* // "https://openfin.co"
|
|
1420
|
+
* // ],
|
|
1421
|
+
* // "options": {
|
|
1422
|
+
* // "downloadSettings": {
|
|
1423
|
+
* // "rules": [
|
|
1424
|
+
* // {
|
|
1425
|
+
* // "match": [
|
|
1426
|
+
* // "<all_urls>"
|
|
1427
|
+
* // ],
|
|
1428
|
+
* // "behavior": "prompt"
|
|
1429
|
+
* // }
|
|
1430
|
+
* // ]
|
|
1431
|
+
* // }
|
|
1432
|
+
* // }
|
|
1433
|
+
* // }
|
|
1434
|
+
* // ]
|
|
1435
|
+
* // }
|
|
1436
|
+
*
|
|
1437
|
+
* // Valid rule behaviors are 'prompt' and 'no-prompt'
|
|
1438
|
+
* domainSettings.rules[0].options.downloadSettings.rules[0].behavior = 'no-prompt';
|
|
1439
|
+
*
|
|
1440
|
+
* await fin.System.setDomainSettings(domainSettings);
|
|
1441
|
+
*
|
|
1442
|
+
* const newDomainSettings = await fin.System.getDomainSettings();
|
|
1443
|
+
* // {
|
|
1444
|
+
* // "rules": [
|
|
1445
|
+
* // {
|
|
1446
|
+
* // "match": [
|
|
1447
|
+
* // "https://openfin.co"
|
|
1448
|
+
* // ],
|
|
1449
|
+
* // "options": {
|
|
1450
|
+
* // "downloadSettings": {
|
|
1451
|
+
* // "rules": [
|
|
1452
|
+
* // {
|
|
1453
|
+
* // "match": [
|
|
1454
|
+
* // "<all_urls>"
|
|
1455
|
+
* // ],
|
|
1456
|
+
* // "behavior": "no-prompt"
|
|
1457
|
+
* // }
|
|
1458
|
+
* // ]
|
|
1459
|
+
* // }
|
|
1460
|
+
* // }
|
|
1461
|
+
* // }
|
|
1462
|
+
* // ]
|
|
1463
|
+
* // }
|
|
1464
|
+
* ```
|
|
1465
|
+
*/
|
|
1466
|
+
setDomainSettings(domainSettings: OpenFin.DefaultDomainSettings): Promise<void>;
|
|
516
1467
|
}
|
|
517
1468
|
export {};
|