@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
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const base_1 = require("../base");
|
|
4
|
+
const InteropBroker_1 = require("./InteropBroker");
|
|
5
|
+
const InteropClient_1 = require("./InteropClient");
|
|
6
|
+
const defaultOverride = (Class, ...args) => new Class(...args);
|
|
7
|
+
/**
|
|
8
|
+
* @typedef { object } InteropConfig
|
|
9
|
+
* @summary Information relevant to the Interop Broker.
|
|
10
|
+
* @property {string} [currentContextGroup] Context Group for the client. (green, yellow, red, etc.)
|
|
11
|
+
* @property {string} [providerId] When provided, automatically connects the client to the specified provider uuid
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Manages creation of Interop Brokers and Interop Clients. These APIs are called under-the-hood in Platforms.
|
|
15
|
+
* @namespace
|
|
16
|
+
* @alias Interop
|
|
17
|
+
*/
|
|
18
|
+
class InteropModule extends base_1.Base {
|
|
19
|
+
/**
|
|
20
|
+
* Initializes an Interop Broker. This is called under-the-hood for Platforms.
|
|
21
|
+
* @param { string } name - Name of the Interop Broker.
|
|
22
|
+
* @param { OverrideCallback<InteropBroker> } [override] - A callback function that can be used to extend or replace default Interop Broker behavior.
|
|
23
|
+
* @return {Promise.<InteropBroker>}
|
|
24
|
+
* @tutorial Interop.init
|
|
25
|
+
* @experimental
|
|
26
|
+
* @static
|
|
27
|
+
*/
|
|
28
|
+
async init(name, override = defaultOverride) {
|
|
29
|
+
this.wire.sendAction('interop-init').catch((e) => {
|
|
30
|
+
// don't expose, analytics-only call
|
|
31
|
+
});
|
|
32
|
+
const provider = await this.fin.InterApplicationBus.Channel.create(`interop-broker-${name}`);
|
|
33
|
+
// Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
|
|
34
|
+
const options = await this.fin.Application.getCurrentSync().getInfo();
|
|
35
|
+
return override(InteropBroker_1.InteropBroker, this.wire, provider, options.initialOptions.interopBrokerConfiguration || {});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Connects a client to an Interop broker. This is called under-the-hood for Views in a Platform.
|
|
39
|
+
* @param { string } name - The name of the Interop Broker to connect to. For Platforms, this will default to the uuid of the Platform.
|
|
40
|
+
* @param { InteropConfig } [interopConfig] - Information relevant to the Interop Broker. Typically a declaration of
|
|
41
|
+
* what context(s) the entity wants to subscribe to, and the current Context Group of the entity.
|
|
42
|
+
* @return {InteropClient}
|
|
43
|
+
* @tutorial Interop.connectSync
|
|
44
|
+
* @experimental
|
|
45
|
+
* @static
|
|
46
|
+
*/
|
|
47
|
+
connectSync(name, interopConfig) {
|
|
48
|
+
this.wire.sendAction('interop-connect-sync').catch((e) => {
|
|
49
|
+
// don't expose, analytics-only call
|
|
50
|
+
});
|
|
51
|
+
return new InteropClient_1.InteropClient(this.wire, name, interopConfig);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.default = InteropModule;
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { Base } from '../base';
|
|
2
|
+
import type Transport from '../../transport/transport';
|
|
3
|
+
import Identity = OpenFin.Identity;
|
|
4
|
+
/**
|
|
5
|
+
* {@link https://developers.openfin.co/of-docs/docs/enable-color-linking **THE INTEROP API IS EXPERIMENTAL. IF YOU WOULD LIKE TO USE IT, PLEASE USE OUR DEFAULT IMPLEMENTATION IN BROWSER**}
|
|
6
|
+
*
|
|
7
|
+
* The Interop Broker is responsible for keeping track of the Interop state of the Platform, and for directing messages to the proper locations.
|
|
8
|
+
*
|
|
9
|
+
* ---
|
|
10
|
+
*
|
|
11
|
+
* There are 2 ways to inject custom functionality into the Interop Broker:
|
|
12
|
+
*
|
|
13
|
+
* **1. Configuration**
|
|
14
|
+
*
|
|
15
|
+
* At the moment, you can configure the default context groups for the Interop Broker without having to override it. To do so, include the `interopBrokerConfiguration` `contextGroups` option in your `platform` options in your manifest. This is the preferred method.
|
|
16
|
+
* ```js
|
|
17
|
+
* {
|
|
18
|
+
* "runtime": {
|
|
19
|
+
* "arguments": "--v=1 --inspect",
|
|
20
|
+
* "version": "alpha-v19"
|
|
21
|
+
* },
|
|
22
|
+
* "platform": {
|
|
23
|
+
* "uuid": "platform_customization_local",
|
|
24
|
+
* "applicationIcon": "https://openfin.github.io/golden-prototype/favicon.ico",
|
|
25
|
+
* "autoShow": false,
|
|
26
|
+
* "providerUrl": "http://localhost:5555/provider.html",
|
|
27
|
+
* "interopBrokerConfiguration": {
|
|
28
|
+
* "contextGroups": [
|
|
29
|
+
* {
|
|
30
|
+
* "id": "green",
|
|
31
|
+
* "displayMetadata": {
|
|
32
|
+
* "color": "#00CC88",
|
|
33
|
+
* "name": "green"
|
|
34
|
+
* }
|
|
35
|
+
* },
|
|
36
|
+
* {
|
|
37
|
+
* "id": "purple",
|
|
38
|
+
* "displayMetadata": {
|
|
39
|
+
* "color": "#8C61FF",
|
|
40
|
+
* "name": "purple"
|
|
41
|
+
* }
|
|
42
|
+
* },
|
|
43
|
+
* ]
|
|
44
|
+
* }
|
|
45
|
+
* }
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* ---
|
|
50
|
+
* **2. Overriding**
|
|
51
|
+
*
|
|
52
|
+
* Similarly to how [Platform Overriding]{@link https://developers.openfin.co/docs/platform-customization#section-customizing-platform-behavior} works, you can override functions in the Interop Broker in `fin.Platform.init`. An example of that is shown below. Overriding `isConnectionAuthorized` and `isActionAuthorized` will allow you to control allowed connections and allowed actions.
|
|
53
|
+
*
|
|
54
|
+
* However, if there is custom functionality you wish to include in the Interop Broker, please let us know. We would like to provide better configuration options so that you don't have to continually maintain your own override code.
|
|
55
|
+
*
|
|
56
|
+
* ```js
|
|
57
|
+
* fin.Platform.init({
|
|
58
|
+
* overrideCallback: async (Provider) => {
|
|
59
|
+
* class Override extends Provider {
|
|
60
|
+
* async getSnapshot() {
|
|
61
|
+
* console.log('before getSnapshot')
|
|
62
|
+
* const snapshot = await super.getSnapshot();
|
|
63
|
+
* console.log('after getSnapshot')
|
|
64
|
+
* return snapshot;
|
|
65
|
+
* }
|
|
66
|
+
*
|
|
67
|
+
* async applySnapshot({ snapshot, options }) {
|
|
68
|
+
* console.log('before applySnapshot')
|
|
69
|
+
* const originalPromise = super.applySnapshot({ snapshot, options });
|
|
70
|
+
* console.log('after applySnapshot')
|
|
71
|
+
*
|
|
72
|
+
* return originalPromise;
|
|
73
|
+
* }
|
|
74
|
+
* };
|
|
75
|
+
* return new Override();
|
|
76
|
+
* },
|
|
77
|
+
* interopOverride: async (InteropBroker, provider, options, ...args) => {
|
|
78
|
+
* class Override extends InteropBroker {
|
|
79
|
+
* async joinContextGroup(channelName = 'default', target) {
|
|
80
|
+
* console.log('before super joinContextGroup')
|
|
81
|
+
* super.joinContextGroup(channelName, target);
|
|
82
|
+
* console.log('after super joinContextGroup')
|
|
83
|
+
* }
|
|
84
|
+
* }
|
|
85
|
+
*
|
|
86
|
+
* options.contextGroups = [
|
|
87
|
+
* {
|
|
88
|
+
* id: 'green',
|
|
89
|
+
* displayMetadata: {
|
|
90
|
+
* color: '#00CC88',
|
|
91
|
+
* name: 'green'
|
|
92
|
+
* }
|
|
93
|
+
* },
|
|
94
|
+
* {
|
|
95
|
+
* id: 'purple',
|
|
96
|
+
* displayMetadata: {
|
|
97
|
+
* color: '#8C61FF',
|
|
98
|
+
* name: 'purple'
|
|
99
|
+
* }
|
|
100
|
+
* },
|
|
101
|
+
* {
|
|
102
|
+
* id: 'orange',
|
|
103
|
+
* displayMetadata: {
|
|
104
|
+
* color: '#FF8C4C',
|
|
105
|
+
* name: 'orange'
|
|
106
|
+
* }
|
|
107
|
+
* },
|
|
108
|
+
* {
|
|
109
|
+
* id: 'red',
|
|
110
|
+
* displayMetadata: {
|
|
111
|
+
* color: '#FF5E60',
|
|
112
|
+
* name: 'red'
|
|
113
|
+
* }
|
|
114
|
+
* }
|
|
115
|
+
* ];
|
|
116
|
+
* return new Override(provider, options, ...args);
|
|
117
|
+
* }
|
|
118
|
+
* });
|
|
119
|
+
* ```
|
|
120
|
+
*
|
|
121
|
+
* ---
|
|
122
|
+
*
|
|
123
|
+
* @hideconstructor
|
|
124
|
+
* @class
|
|
125
|
+
*/
|
|
126
|
+
export declare class InteropBroker extends Base {
|
|
127
|
+
private channel;
|
|
128
|
+
private interopClients;
|
|
129
|
+
private contextGroupsById;
|
|
130
|
+
private intentClientMap;
|
|
131
|
+
private lastContextMap;
|
|
132
|
+
private sessionContextGroupMap;
|
|
133
|
+
constructor(wire: Transport, channel: OpenFin.ChannelProvider, options?: any);
|
|
134
|
+
/**
|
|
135
|
+
* SetContextOptions interface
|
|
136
|
+
* @typedef { object } SetContextOptions
|
|
137
|
+
* @property { Context } {context} - New context to set.
|
|
138
|
+
*/
|
|
139
|
+
/**
|
|
140
|
+
* GetContextOptions interface
|
|
141
|
+
* @typedef { object } GetContextOptions
|
|
142
|
+
* @property { string } [contextType] - Context Type
|
|
143
|
+
*/
|
|
144
|
+
/**
|
|
145
|
+
* JoinContextGroupOptions interface
|
|
146
|
+
* @typedef { object } JoinContextGroupOptions
|
|
147
|
+
* @property { string } contextGroupId - Id of the context group.
|
|
148
|
+
* @property { Identity | ClientIdentity } [target] - Identity of the entity you wish to join to a context group.
|
|
149
|
+
*/
|
|
150
|
+
/**
|
|
151
|
+
* AddClientToContextGroupOptions interface
|
|
152
|
+
* @typedef { object } AddClientToContextGroupOptions
|
|
153
|
+
* @property { string } contextGroupId - Name of the context group.
|
|
154
|
+
*/
|
|
155
|
+
/**
|
|
156
|
+
* RemoveFromContextGroupOptions interface
|
|
157
|
+
* @typedef { object } RemoveFromContextGroupOptions
|
|
158
|
+
* @property { Identity | ClientIdentity } target - Identity of the entity you wish to join to a context group.
|
|
159
|
+
*/
|
|
160
|
+
/**
|
|
161
|
+
* GetInfoForContextGroupOptions interface
|
|
162
|
+
* @typedef { object } GetInfoForContextGroupOptions
|
|
163
|
+
* @property { string } contextGroupId - Name of the context group to get info for.
|
|
164
|
+
*/
|
|
165
|
+
/**
|
|
166
|
+
* GetAllClientsInContextGroupOptions interface
|
|
167
|
+
* @typedef { object } GetAllClientsInContextGroupOptions
|
|
168
|
+
* @property { string } contextGroupId - Name of the context group to get info for.
|
|
169
|
+
*/
|
|
170
|
+
/**
|
|
171
|
+
* InfoForIntentOptions interface
|
|
172
|
+
* @typedef { object } InfoForIntentOptions
|
|
173
|
+
* @property { string } name Name of the intent to get info for.
|
|
174
|
+
* @property { Context } [context] Optional context.
|
|
175
|
+
*/
|
|
176
|
+
/**
|
|
177
|
+
* Sets a context for the context group of the incoming current entity.
|
|
178
|
+
* @param { SetContextOptions } setContextOptions - New context to set.
|
|
179
|
+
* @param { ClientIdentity } clientIdentity - Identity of the client sender.
|
|
180
|
+
* @return { void }
|
|
181
|
+
* @experimental
|
|
182
|
+
*/
|
|
183
|
+
setContext({ context }: {
|
|
184
|
+
context: OpenFin.Context;
|
|
185
|
+
}, clientIdentity: OpenFin.ClientIdentity): void;
|
|
186
|
+
/**
|
|
187
|
+
* Get current context for a client subscribed to a Context Group.
|
|
188
|
+
* @param { GetContextOptions } getContextOptions - Options for getting context
|
|
189
|
+
* @param { ClientIdentity } clientIdentity - Identity of the client sender.
|
|
190
|
+
* @return { Context }
|
|
191
|
+
*/
|
|
192
|
+
getCurrentContext(getCurrentContextOptions: {
|
|
193
|
+
contextType: string;
|
|
194
|
+
}, clientIdentity: OpenFin.ClientIdentity): OpenFin.Context | undefined;
|
|
195
|
+
/**
|
|
196
|
+
* Join all connections at the given identity (or just one if endpointId provided) to context group `contextGroupId`.
|
|
197
|
+
* If no target is specified, it adds the sender to the context group.
|
|
198
|
+
* joinContextGroup is responsible for checking connections at the incoming identity. It calls {@link InteropBroker#addClientToContextGroup InteropBroker.addClientToContextGroup} to actually group the client.
|
|
199
|
+
* Used by Platform Windows.
|
|
200
|
+
* @return { Promise<void> }
|
|
201
|
+
* @param { JoinContextGroupOptions } joinContextGroupOptions - Id of the Context Group and identity of the entity to join to the group.
|
|
202
|
+
* @param { ClientIdentity } senderIdentity - Identity of the client sender.
|
|
203
|
+
* @experimental
|
|
204
|
+
*/
|
|
205
|
+
joinContextGroup({ contextGroupId, target }: {
|
|
206
|
+
contextGroupId: string;
|
|
207
|
+
target?: OpenFin.ClientIdentity | OpenFin.Identity;
|
|
208
|
+
}, senderIdentity: OpenFin.ClientIdentity): Promise<void>;
|
|
209
|
+
/**
|
|
210
|
+
* Helper function for {@link InteropBroker#joinContextGroup InteropBroker.joinContextGroup}. Does the work of actually adding the client to the Context Group.
|
|
211
|
+
* Used by Platform Windows.
|
|
212
|
+
* @return { Promise<void> }
|
|
213
|
+
* @param { AddClientToContextGroupOptions } addClientToContextGroupOptions - Contains the contextGroupId
|
|
214
|
+
* @param { ClientIdentity } clientIdentity - Identity of the client sender.
|
|
215
|
+
* @experimental
|
|
216
|
+
*/
|
|
217
|
+
addClientToContextGroup({ contextGroupId }: {
|
|
218
|
+
contextGroupId: string;
|
|
219
|
+
}, clientIdentity: OpenFin.ClientIdentity): Promise<void>;
|
|
220
|
+
/**
|
|
221
|
+
* Removes the specified target from a context group.
|
|
222
|
+
* If no target is specified, it removes the sender from their context group.
|
|
223
|
+
* removeFromContextGroup is responsible for checking connections at the incoming identity. It calls {@link InteropBroker#removeClientFromContextGroup InteropBroker.removeClientFromContextGroup} to actually ungroup the client.
|
|
224
|
+
* Used by Platform Windows.
|
|
225
|
+
* @return { Promise<void> }
|
|
226
|
+
* @param { RemoveFromContextGroupOptions } removeFromContextGroupOptions - Contains the target identity to remove.
|
|
227
|
+
* @param { ClientIdentity } senderIdentity - Identity of the client sender.
|
|
228
|
+
* @experimental
|
|
229
|
+
*/
|
|
230
|
+
removeFromContextGroup({ target }: {
|
|
231
|
+
target: OpenFin.Identity;
|
|
232
|
+
}, senderIdentity: OpenFin.ClientIdentity): Promise<void>;
|
|
233
|
+
/**
|
|
234
|
+
* Helper function for {@link InteropBroker#removeFromContextGroup InteropBroker.removeFromContextGroup}. Does the work of actually removing the client from the Context Group.
|
|
235
|
+
* Used by Platform Windows.
|
|
236
|
+
* @return { Promise<void> }
|
|
237
|
+
* @property { ClientIdentity } clientIdentity - Identity of the client sender.
|
|
238
|
+
* @experimental
|
|
239
|
+
*/
|
|
240
|
+
removeClientFromContextGroup(clientIdentity: OpenFin.ClientIdentity): Promise<void>;
|
|
241
|
+
/**
|
|
242
|
+
* Returns the Interop-Broker-defined context groups available for an entity to join. Because this function is used in the rest of the Interop Broker to fetch the Context Groups, overriding this allows you to customize the Context Groups for the Interop Broker. However, we recommend customizing the context groups through configuration instead.
|
|
243
|
+
* Used by Platform Windows.
|
|
244
|
+
* @return { Promise<ContextGroupInfo[]>}
|
|
245
|
+
* @experimental
|
|
246
|
+
*/
|
|
247
|
+
getContextGroups(): Readonly<OpenFin.ContextGroupInfo[]>;
|
|
248
|
+
/**
|
|
249
|
+
* Gets display info for a context group
|
|
250
|
+
* Used by Platform Windows.
|
|
251
|
+
* @param { GetInfoForContextGroupOptions } getInfoForContextGroupOptions - Contains contextGroupId, the context group you wish to get display info for.
|
|
252
|
+
* @return { Promise<ContextGroupInfo>}
|
|
253
|
+
* @experimental
|
|
254
|
+
*/
|
|
255
|
+
getInfoForContextGroup({ contextGroupId }: {
|
|
256
|
+
contextGroupId: string;
|
|
257
|
+
}): OpenFin.ContextGroupInfo | undefined;
|
|
258
|
+
/**
|
|
259
|
+
* Gets all clients for a context group.
|
|
260
|
+
* Used by Platform Windows.
|
|
261
|
+
* @param { GetAllClientsInContextGroupOptions } getAllClientsInContextGroupOptions - Contains contextGroupId, the context group you wish to get clients for.
|
|
262
|
+
* @return { Promise<ClientIdentity[]>}
|
|
263
|
+
* @experimental
|
|
264
|
+
*/
|
|
265
|
+
getAllClientsInContextGroup({ contextGroupId }: {
|
|
266
|
+
contextGroupId: string;
|
|
267
|
+
}): OpenFin.ClientIdentity[];
|
|
268
|
+
/**
|
|
269
|
+
* Responsible for launching of applications that can handle a given intent, and delegation of intents to those applications.
|
|
270
|
+
* Must be overridden.
|
|
271
|
+
* @param { Intent } intent The combination of an action and a context that is passed to an application for resolution.
|
|
272
|
+
* @param { ClientIdentity } clientIdentity Identity of the Client making the request.
|
|
273
|
+
* @return { Promise<unknown> }
|
|
274
|
+
* @tutorial interop.handleFiredIntent
|
|
275
|
+
* @experimental
|
|
276
|
+
*/
|
|
277
|
+
handleFiredIntent(intent: OpenFin.Intent, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
|
|
278
|
+
/**
|
|
279
|
+
* Should be called in {@link InteropBroker#handleFiredIntent InteropBroker.handleFiredIntent}.
|
|
280
|
+
* While handleFiredIntent is responsible for launching applications, setIntentTarget is used to tell the InteropBroker which application should receive the intent when it is ready.
|
|
281
|
+
* @param { Intent } intent The combination of an action and a context that is passed to an application for resolution.
|
|
282
|
+
* @param { Identity } target - Identity of the target that will handle the intent.
|
|
283
|
+
* @return { Promise<void> }
|
|
284
|
+
* @experimental
|
|
285
|
+
*/
|
|
286
|
+
setIntentTarget(intent: OpenFin.Intent, target: OpenFin.Identity): Promise<void>;
|
|
287
|
+
/**
|
|
288
|
+
* Responsible for returning information on a particular Intent.
|
|
289
|
+
* Must be overridden.
|
|
290
|
+
* @param { InfoForIntentOptions } options
|
|
291
|
+
* @param { ClientIdentity } clientIdentity Identity of the Client making the request.
|
|
292
|
+
* @return { Promise<unknown> }
|
|
293
|
+
* @tutorial interop.handleInfoForIntent
|
|
294
|
+
* @experimental
|
|
295
|
+
*/
|
|
296
|
+
handleInfoForIntent(options: OpenFin.InfoForIntentOptions, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
|
|
297
|
+
/**
|
|
298
|
+
* Responsible for returning information on which Intents are meant to handle a specific Context.
|
|
299
|
+
* Must be overridden.
|
|
300
|
+
* @param { Context } context Data passed between entities and applications.
|
|
301
|
+
* @param { ClientIdentity } clientIdentity Identity of the Client making the request.
|
|
302
|
+
* @return { Promise<unknown> }
|
|
303
|
+
* @tutorial interop.handleInfoForIntentsByContext
|
|
304
|
+
* @experimental
|
|
305
|
+
*/
|
|
306
|
+
handleInfoForIntentsByContext(context: OpenFin.Context, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
|
|
307
|
+
/**
|
|
308
|
+
* Responsible for resolving an Intent based on a specific Context.
|
|
309
|
+
* Must be overridden.
|
|
310
|
+
* @param { ContextForIntent } contextForIntent Data passed between entities and applications.
|
|
311
|
+
* @param { ClientIdentity } clientIdentity Identity of the Client making the request.
|
|
312
|
+
* @return { Promise<unknown> }
|
|
313
|
+
* @tutorial interop.handleFiredIntentForContext
|
|
314
|
+
* @experimental
|
|
315
|
+
*/
|
|
316
|
+
handleFiredIntentForContext(contextForIntent: OpenFin.ContextForIntent, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
|
|
317
|
+
decorateSnapshot(snapshot: OpenFin.Snapshot): OpenFin.Snapshot;
|
|
318
|
+
applySnapshot(snapshot: OpenFin.Snapshot, options: OpenFin.ApplySnapshotOptions): void;
|
|
319
|
+
updateExistingClients(contextGroupStates: OpenFin.ContextGroupStates): void;
|
|
320
|
+
getContextGroupStates(): OpenFin.ContextGroupStates;
|
|
321
|
+
rehydrateContextGroupStates(incomingContextGroupStates: OpenFin.ContextGroupStates): void;
|
|
322
|
+
contextHandlerRegistered({ contextType, handlerId }: {
|
|
323
|
+
contextType: string | undefined;
|
|
324
|
+
handlerId: string;
|
|
325
|
+
}, clientIdentity: OpenFin.ClientIdentity): void;
|
|
326
|
+
intentHandlerRegistered(payload: any, clientIdentity: OpenFin.ClientIdentity): Promise<void>;
|
|
327
|
+
protected invokeContextHandler(clientIdentity: OpenFin.ClientIdentity, handlerId: string, context: OpenFin.Context): void;
|
|
328
|
+
removeContextHandler({ handlerId }: {
|
|
329
|
+
handlerId: string;
|
|
330
|
+
}, clientIdentity: OpenFin.ClientIdentity): void;
|
|
331
|
+
handleJoinSessionContextGroup({ sessionContextGroupId }: {
|
|
332
|
+
sessionContextGroupId: string;
|
|
333
|
+
}, clientIdentity: OpenFin.ClientIdentity): {
|
|
334
|
+
hasConflict: boolean;
|
|
335
|
+
};
|
|
336
|
+
private getClientState;
|
|
337
|
+
private static toObject;
|
|
338
|
+
static checkContextIntegrity(context: OpenFin.Context): {
|
|
339
|
+
isValid: true;
|
|
340
|
+
} | {
|
|
341
|
+
isValid: false;
|
|
342
|
+
reason: string;
|
|
343
|
+
};
|
|
344
|
+
private static hasEndpointId;
|
|
345
|
+
static isContextTypeCompatible(contextType: string, registeredContextType: string | undefined): boolean;
|
|
346
|
+
private setContextGroupMap;
|
|
347
|
+
private static setCurrentContextGroupInClientOptions;
|
|
348
|
+
private wireChannel;
|
|
349
|
+
/**
|
|
350
|
+
* Can be used to completely prevent a connection. Return false to prevent connections. Allows all connections by default.
|
|
351
|
+
* @param _id the identity tryinc to connect
|
|
352
|
+
* @param _connectionPayload optional payload to use in custom implementations, will be undefined by default
|
|
353
|
+
*/
|
|
354
|
+
isConnectionAuthorized(_id: Identity, _connectionPayload?: any): Promise<boolean>;
|
|
355
|
+
/**
|
|
356
|
+
* Called before every action to check if this entity should be allowed to take the action.
|
|
357
|
+
* Return false to prevent the action
|
|
358
|
+
* @param _action the string action to authorize in camel case
|
|
359
|
+
* @param _payload the data being sent for this action
|
|
360
|
+
* @param _identity the connection attempting to dispatch this action
|
|
361
|
+
*/
|
|
362
|
+
isActionAuthorized(_action: string, _payload: any, _identity: OpenFin.ClientIdentity): Promise<boolean>;
|
|
363
|
+
}
|