@openfin/core 33.76.31 → 33.76.38
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.d.ts +1 -1
- package/README.md +29 -4
- package/fin.d.ts +2 -2
- package/{src → out}/GlobalOpenFin.d.ts +1 -1
- package/out/mock-alpha.d.ts +16112 -0
- package/out/mock-beta.d.ts +16112 -0
- package/out/mock-public.d.ts +16112 -0
- package/out/mock.d.ts +16797 -0
- package/out/mock.js +17104 -0
- package/package.json +30 -23
- package/LICENSE +0 -13
- package/NOTICE +0 -16
- package/openfin-core-33.76.31.tgz +0 -0
- package/src/OpenFin.d.ts +0 -3080
- package/src/OpenFin.js +0 -2
- package/src/api/api-exposer/api-consumer.d.ts +0 -28
- package/src/api/api-exposer/api-consumer.js +0 -28
- package/src/api/api-exposer/api-exposer.d.ts +0 -35
- package/src/api/api-exposer/api-exposer.js +0 -38
- package/src/api/api-exposer/decorators.d.ts +0 -10
- package/src/api/api-exposer/decorators.js +0 -18
- package/src/api/api-exposer/index.d.ts +0 -4
- package/src/api/api-exposer/index.js +0 -20
- package/src/api/api-exposer/strategies/index.d.ts +0 -1
- package/src/api/api-exposer/strategies/index.js +0 -17
- package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.d.ts +0 -14
- package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.js +0 -20
- package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.d.ts +0 -20
- package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.js +0 -23
- package/src/api/api-exposer/strategies/openfin-channels/index.d.ts +0 -2
- package/src/api/api-exposer/strategies/openfin-channels/index.js +0 -18
- package/src/api/application/Factory.d.ts +0 -148
- package/src/api/application/Factory.js +0 -230
- package/src/api/application/Instance.d.ts +0 -321
- package/src/api/application/Instance.js +0 -453
- package/src/api/application/index.d.ts +0 -3
- package/src/api/application/index.js +0 -19
- package/src/api/base.d.ts +0 -48
- package/src/api/base.js +0 -177
- package/src/api/clipboard/index.d.ts +0 -92
- package/src/api/clipboard/index.js +0 -120
- package/src/api/events/application.d.ts +0 -146
- package/src/api/events/application.js +0 -2
- package/src/api/events/base.d.ts +0 -42
- package/src/api/events/base.js +0 -2
- package/src/api/events/channel.d.ts +0 -30
- package/src/api/events/channel.js +0 -2
- package/src/api/events/emitterMap.d.ts +0 -11
- package/src/api/events/emitterMap.js +0 -35
- package/src/api/events/eventAggregator.d.ts +0 -5
- package/src/api/events/eventAggregator.js +0 -35
- package/src/api/events/externalApplication.d.ts +0 -19
- package/src/api/events/externalApplication.js +0 -2
- package/src/api/events/frame.d.ts +0 -30
- package/src/api/events/frame.js +0 -2
- package/src/api/events/globalHotkey.d.ts +0 -20
- package/src/api/events/globalHotkey.js +0 -2
- package/src/api/events/platform.d.ts +0 -26
- package/src/api/events/platform.js +0 -2
- package/src/api/events/system.d.ts +0 -113
- package/src/api/events/system.js +0 -2
- package/src/api/events/typedEventEmitter.d.ts +0 -20
- package/src/api/events/typedEventEmitter.js +0 -2
- package/src/api/events/view.d.ts +0 -82
- package/src/api/events/view.js +0 -2
- package/src/api/events/webcontents.d.ts +0 -266
- package/src/api/events/webcontents.js +0 -2
- package/src/api/events/window.d.ts +0 -352
- package/src/api/events/window.js +0 -2
- package/src/api/external-application/Factory.d.ts +0 -27
- package/src/api/external-application/Factory.js +0 -40
- package/src/api/external-application/Instance.d.ts +0 -102
- package/src/api/external-application/Instance.js +0 -109
- package/src/api/external-application/index.d.ts +0 -3
- package/src/api/external-application/index.js +0 -19
- package/src/api/fin.d.ts +0 -51
- package/src/api/fin.js +0 -42
- package/src/api/frame/Factory.d.ts +0 -37
- package/src/api/frame/Factory.js +0 -69
- package/src/api/frame/Instance.d.ts +0 -123
- package/src/api/frame/Instance.js +0 -130
- package/src/api/frame/index.d.ts +0 -3
- package/src/api/frame/index.js +0 -19
- package/src/api/global-hotkey/index.d.ts +0 -38
- package/src/api/global-hotkey/index.js +0 -64
- package/src/api/interappbus/channel/channel.d.ts +0 -28
- package/src/api/interappbus/channel/channel.js +0 -77
- package/src/api/interappbus/channel/channels-docs.d.ts +0 -340
- package/src/api/interappbus/channel/channels-docs.js +0 -398
- package/src/api/interappbus/channel/client.d.ts +0 -24
- package/src/api/interappbus/channel/client.js +0 -89
- package/src/api/interappbus/channel/connection-manager.d.ts +0 -29
- package/src/api/interappbus/channel/connection-manager.js +0 -246
- package/src/api/interappbus/channel/index.d.ts +0 -25
- package/src/api/interappbus/channel/index.js +0 -169
- package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +0 -13
- package/src/api/interappbus/channel/protocols/classic/message-receiver.js +0 -73
- package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +0 -24
- package/src/api/interappbus/channel/protocols/classic/strategy.js +0 -101
- package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +0 -20
- package/src/api/interappbus/channel/protocols/combined/strategy.js +0 -58
- package/src/api/interappbus/channel/protocols/index.d.ts +0 -47
- package/src/api/interappbus/channel/protocols/index.js +0 -2
- package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +0 -10
- package/src/api/interappbus/channel/protocols/protocol-manager.js +0 -43
- package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +0 -25
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +0 -141
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +0 -30
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +0 -130
- package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +0 -24
- package/src/api/interappbus/channel/protocols/rtc/strategy.js +0 -85
- package/src/api/interappbus/channel/protocols/strategy-types.d.ts +0 -13
- package/src/api/interappbus/channel/protocols/strategy-types.js +0 -2
- package/src/api/interappbus/channel/protocols/strategy.d.ts +0 -17
- package/src/api/interappbus/channel/protocols/strategy.js +0 -2
- package/src/api/interappbus/channel/provider.d.ts +0 -34
- package/src/api/interappbus/channel/provider.js +0 -166
- package/src/api/interappbus/index.d.ts +0 -85
- package/src/api/interappbus/index.js +0 -175
- package/src/api/interop/Factory.d.ts +0 -37
- package/src/api/interop/Factory.js +0 -76
- package/src/api/interop/InteropBroker.d.ts +0 -437
- package/src/api/interop/InteropBroker.js +0 -1085
- package/src/api/interop/InteropClient.d.ts +0 -278
- package/src/api/interop/InteropClient.js +0 -459
- package/src/api/interop/SessionContextGroupBroker.d.ts +0 -27
- package/src/api/interop/SessionContextGroupBroker.js +0 -108
- package/src/api/interop/SessionContextGroupClient.d.ts +0 -21
- package/src/api/interop/SessionContextGroupClient.js +0 -86
- package/src/api/interop/fdc3/PrivateChannelClient.d.ts +0 -20
- package/src/api/interop/fdc3/PrivateChannelClient.js +0 -90
- package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +0 -55
- package/src/api/interop/fdc3/PrivateChannelProvider.js +0 -276
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +0 -208
- package/src/api/interop/fdc3/fdc3-1.2.js +0 -438
- package/src/api/interop/fdc3/fdc3-2.0.d.ts +0 -301
- package/src/api/interop/fdc3/fdc3-2.0.js +0 -482
- package/src/api/interop/fdc3/fdc3.d.ts +0 -12
- package/src/api/interop/fdc3/fdc3.js +0 -35
- package/src/api/interop/fdc3/overrideCheck.d.ts +0 -4
- package/src/api/interop/fdc3/overrideCheck.js +0 -32
- package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +0 -53
- package/src/api/interop/fdc3/shapes/fdc3v1.js +0 -4
- package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +0 -75
- package/src/api/interop/fdc3/shapes/fdc3v2.js +0 -2
- package/src/api/interop/fdc3/utils.d.ts +0 -45
- package/src/api/interop/fdc3/utils.js +0 -239
- package/src/api/interop/fdc3/versions.d.ts +0 -1
- package/src/api/interop/fdc3/versions.js +0 -2
- package/src/api/interop/index.d.ts +0 -4
- package/src/api/interop/index.js +0 -20
- package/src/api/interop/utils.d.ts +0 -18
- package/src/api/interop/utils.js +0 -61
- package/src/api/me.d.ts +0 -40
- package/src/api/me.js +0 -134
- package/src/api/platform/Factory.d.ts +0 -115
- package/src/api/platform/Factory.js +0 -184
- package/src/api/platform/Instance.d.ts +0 -150
- package/src/api/platform/Instance.js +0 -332
- package/src/api/platform/common-utils.d.ts +0 -7
- package/src/api/platform/common-utils.js +0 -16
- package/src/api/platform/index.d.ts +0 -3
- package/src/api/platform/index.js +0 -19
- package/src/api/platform/layout/Factory.d.ts +0 -114
- package/src/api/platform/layout/Factory.js +0 -174
- package/src/api/platform/layout/Instance.d.ts +0 -57
- package/src/api/platform/layout/Instance.js +0 -126
- package/src/api/platform/layout/controllers/layout-content-cache.d.ts +0 -9
- package/src/api/platform/layout/controllers/layout-content-cache.js +0 -54
- package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +0 -119
- package/src/api/platform/layout/controllers/layout-entities-controller.js +0 -287
- package/src/api/platform/layout/entities/layout-entities.d.ts +0 -235
- package/src/api/platform/layout/entities/layout-entities.js +0 -312
- package/src/api/platform/layout/entities/shapes.d.ts +0 -6
- package/src/api/platform/layout/entities/shapes.js +0 -2
- package/src/api/platform/layout/index.d.ts +0 -2
- package/src/api/platform/layout/index.js +0 -18
- package/src/api/platform/layout/layout.constants.d.ts +0 -1
- package/src/api/platform/layout/layout.constants.js +0 -4
- package/src/api/platform/layout/shapes.d.ts +0 -16
- package/src/api/platform/layout/shapes.js +0 -2
- package/src/api/platform/layout/utils/layout-traversal.d.ts +0 -4
- package/src/api/platform/layout/utils/layout-traversal.js +0 -65
- package/src/api/platform/provider.d.ts +0 -163
- package/src/api/platform/provider.js +0 -2
- package/src/api/snapshot-source/Factory.d.ts +0 -38
- package/src/api/snapshot-source/Factory.js +0 -66
- package/src/api/snapshot-source/Instance.d.ts +0 -31
- package/src/api/snapshot-source/Instance.js +0 -132
- package/src/api/snapshot-source/index.d.ts +0 -3
- package/src/api/snapshot-source/index.js +0 -19
- package/src/api/snapshot-source/utils.d.ts +0 -2
- package/src/api/snapshot-source/utils.js +0 -6
- package/src/api/system/index.d.ts +0 -517
- package/src/api/system/index.js +0 -895
- package/src/api/view/Factory.d.ts +0 -50
- package/src/api/view/Factory.js +0 -103
- package/src/api/view/Instance.d.ts +0 -487
- package/src/api/view/Instance.js +0 -557
- package/src/api/view/index.d.ts +0 -3
- package/src/api/view/index.js +0 -19
- package/src/api/webcontents/main.d.ts +0 -32
- package/src/api/webcontents/main.js +0 -156
- package/src/api/window/Factory.d.ts +0 -45
- package/src/api/window/Factory.js +0 -91
- package/src/api/window/Instance.d.ts +0 -1090
- package/src/api/window/Instance.js +0 -1349
- package/src/api/window/index.d.ts +0 -3
- package/src/api/window/index.js +0 -19
- package/src/browser.d.ts +0 -10
- package/src/browser.js +0 -36
- package/src/environment/browser.d.ts +0 -29
- package/src/environment/browser.js +0 -60
- package/src/environment/environment.d.ts +0 -33
- package/src/environment/environment.js +0 -4
- package/src/environment/mockEnvironment.d.ts +0 -27
- package/src/environment/mockEnvironment.js +0 -61
- package/src/environment/node-env.d.ts +0 -29
- package/src/environment/node-env.js +0 -72
- package/src/fdc3.d.ts +0 -3
- package/src/fdc3.js +0 -9
- package/src/mock.d.ts +0 -3
- package/src/mock.js +0 -18
- package/src/namespaces.d.ts +0 -21
- package/src/namespaces.js +0 -24
- package/src/shapes/ERROR_BOX_TYPES.d.ts +0 -1
- package/src/shapes/ERROR_BOX_TYPES.js +0 -2
- package/src/shapes/WebOptions.d.ts +0 -13
- package/src/shapes/WebOptions.js +0 -2
- package/src/shapes/WindowOptions.d.ts +0 -43
- package/src/shapes/WindowOptions.js +0 -2
- package/src/shapes/protocol.d.ts +0 -200
- package/src/shapes/protocol.js +0 -2
- package/src/transport/mockWire.d.ts +0 -11
- package/src/transport/mockWire.js +0 -26
- package/src/transport/transport-errors.d.ts +0 -31
- package/src/transport/transport-errors.js +0 -79
- package/src/transport/transport.d.ts +0 -73
- package/src/transport/transport.js +0 -219
- package/src/transport/wire.d.ts +0 -77
- package/src/transport/wire.js +0 -36
- package/src/util/asyncFilter.d.ts +0 -1
- package/src/util/asyncFilter.js +0 -7
- package/src/util/channel-api-relay.d.ts +0 -13
- package/src/util/channel-api-relay.js +0 -47
- package/src/util/errors.d.ts +0 -10
- package/src/util/errors.js +0 -12
- package/src/util/exhaustive.d.ts +0 -1
- package/src/util/exhaustive.js +0 -7
- package/src/util/http.d.ts +0 -11
- package/src/util/http.js +0 -90
- package/src/util/inaccessibleObject.d.ts +0 -2
- package/src/util/inaccessibleObject.js +0 -49
- package/src/util/lazy.d.ts +0 -34
- package/src/util/lazy.js +0 -54
- package/src/util/normalize-config.d.ts +0 -3
- package/src/util/normalize-config.js +0 -52
- package/src/util/promises.d.ts +0 -5
- package/src/util/promises.js +0 -27
- package/src/util/ref-counter.d.ts +0 -7
- package/src/util/ref-counter.js +0 -52
- package/src/util/reversible-map.d.ts +0 -11
- package/src/util/reversible-map.js +0 -49
- package/src/util/runtimeVersioning.d.ts +0 -3
- package/src/util/runtimeVersioning.js +0 -25
- package/src/util/utilTypes.d.ts +0 -8
- package/src/util/utilTypes.js +0 -2
- package/src/util/validate.d.ts +0 -3
- package/src/util/validate.js +0 -11
|
@@ -1,482 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const base_1 = require("../../base");
|
|
4
|
-
const utils_1 = require("../utils");
|
|
5
|
-
const InteropClient_1 = require("../InteropClient");
|
|
6
|
-
const utils_2 = require("./utils");
|
|
7
|
-
const fdc3_1_2_1 = require("./fdc3-1.2");
|
|
8
|
-
const PrivateChannelClient_1 = require("./PrivateChannelClient");
|
|
9
|
-
/**
|
|
10
|
-
* @typedef { object } AppIdentifier
|
|
11
|
-
* @summary Identifies an application, or instance of an application, and is used to target FDC3 API calls at specific applications.
|
|
12
|
-
* @property { string } appId The unique application identifier located within a specific application directory instance. An example of an appId might be 'app@sub.root'.
|
|
13
|
-
* @property { string } [instancedId] An optional instance identifier, indicating that this object represents a specific instance of the application described. The endpointId should be used as the instanceId. The most convenient way to get this would be to use the InteropBroker.getAllClientInfo API.
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* @typedef { Context | Channel } IntentResult
|
|
17
|
-
* @summary Describes results that an Intent handler may optionally return that should be communicated back to the app that raised the intent, via the IntentResolution.
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* @typedef { object } Icon
|
|
21
|
-
* @summary Metadata relating to a single icon image at a remote URL, used to represent an application in a user interface.
|
|
22
|
-
* @property { string } src The fully qualified url to the icon.
|
|
23
|
-
* @property { string } [size] The dimensions of the Icon formatted as <height>x<width>.
|
|
24
|
-
* @property { string } [type] The media type of the icon. If not provided the Desktop Agent may refer to the src file extension.
|
|
25
|
-
*/
|
|
26
|
-
/**
|
|
27
|
-
* @typedef { object } Image
|
|
28
|
-
* @summary Metadata relating to a single image at a remote URL, used to represent screenshot images.
|
|
29
|
-
* @property { string } src The fully qualified url to the image.
|
|
30
|
-
* @property { string } [size] The dimensions of the image formatted as <height>x<width>.
|
|
31
|
-
* @property { string } [type] The media type of the image. If not provided the Desktop Agent may refer to the src file extension.
|
|
32
|
-
* @property { string } [label]
|
|
33
|
-
*/
|
|
34
|
-
/**
|
|
35
|
-
* @typedef { object } AppMetadata
|
|
36
|
-
* @variation 2
|
|
37
|
-
* @summary Extends an AppIdentifier, describing an application or instance of an application, with additional descriptive metadata that is usually provided by an FDC3 App Directory that the desktop agent connects to.
|
|
38
|
-
* @property { string } appId The unique application identifier located within a specific application directory instance. An example of an appId might be 'app@sub.root'.
|
|
39
|
-
* @property { string } [instanceId] An optional instance identifier, indicating that this object represents a specific instance of the application described. The endpointId should be used as the instanceId. The most convenient way to get this would be to use the InteropBroker.getAllClientInfo API.
|
|
40
|
-
* @property { string } [name] The 'friendly' app name. This field was used with the `open` and `raiseIntent` calls in FDC3 <2.0, which now require an `AppIdentifier` with `appId` set. Note that for display purposes the `title` field should be used, if set, in preference to this field.
|
|
41
|
-
* @property { string } [version] The version of the application.
|
|
42
|
-
* @property { Record<string, any> } [instanceMetadata]
|
|
43
|
-
* @property { string } [title] A more user-friendly application title that can be used to render UI elements.
|
|
44
|
-
* @property { string } [tooltip] A tooltip for the application that can be used to render UI elements.
|
|
45
|
-
* @property { string } [description] A longer, multi-paragraph description for the application that could include mark-up.
|
|
46
|
-
* @property { Array<Icon> } [icons] A list of icon URLs for the application that can be used to render UI elements.
|
|
47
|
-
* @property { Array<Image> } [screenshots] Images representing the app in common usage scenarios that can be used to render UI elements.
|
|
48
|
-
* @property { string | null } [resultType] The type of result returned for any intent specified during resolution. May express a particular context type (e.g. "fdc3.instrument"), channel (e.g. "channel") or a channel that will receive a specified type (e.g. "channel<fdc3.instrument>").
|
|
49
|
-
*/
|
|
50
|
-
/**
|
|
51
|
-
* @typedef { object } ContextMetadata
|
|
52
|
-
* @summary Metadata relating to a context or intent & context received through the addContextListener and addIntentListener functions. Currently identifies the app that originated the context or intent message.
|
|
53
|
-
* @property { AppIdentifier } source Identifier for the app instance that sent the context and/or intent.
|
|
54
|
-
*/
|
|
55
|
-
/**
|
|
56
|
-
* @typedef { object } ImplementationMetadataOptionalFeatures
|
|
57
|
-
* @property { boolean } originatingAppMetadata Used to indicate whether the exposure of 'originating app metadata' for context and intent messages is supported by the Desktop Agent.
|
|
58
|
-
* @property { boolean } userChannelMembershipAPIs Used to indicate whether the optional `fdc3.joinUserChannel`, `fdc3.getCurrentChannel` and `fdc3.leaveCurrentChannel` are implemented by the Desktop Agent.
|
|
59
|
-
*/
|
|
60
|
-
/**
|
|
61
|
-
* @typedef { object } ImplementationMetadata
|
|
62
|
-
* @variation 2
|
|
63
|
-
* @summary Metadata relating to the FDC3 DesktopAgent object and its provider, including the supported version of the FDC3 specification, the name of the provider of the implementation, its own version number and the metadata of the calling application according to the desktop agent.
|
|
64
|
-
* @property { string } fdc3Version The FDC3 version
|
|
65
|
-
* @property { string } provider The provider's uuid prepended with 'openfin' (e.g. 'openfin-myUuid').
|
|
66
|
-
* @property { string } [providerVersion] The provider runtime version
|
|
67
|
-
* @property { ImplementationMetadataOptionalFeatures } optionalFeatures
|
|
68
|
-
* @property { AppMetadata } appMetadata The calling application instance's own metadata, according to the Desktop Agent (MUST include at least the `appId` and `instanceId`).
|
|
69
|
-
*/
|
|
70
|
-
/**
|
|
71
|
-
* @callback ContextHandler
|
|
72
|
-
* @variation 2
|
|
73
|
-
* @param { Context } context
|
|
74
|
-
* @param { ContextMetadata } [contextMetadata]
|
|
75
|
-
* @returns { void }
|
|
76
|
-
*/
|
|
77
|
-
/**
|
|
78
|
-
* @callback IntentHandler
|
|
79
|
-
* @variation 2
|
|
80
|
-
* @param { Context } context
|
|
81
|
-
* @param { ContextMetadata } [contextMetadata]
|
|
82
|
-
* @returns { Promise<IntentResult> | void }
|
|
83
|
-
*/
|
|
84
|
-
/**
|
|
85
|
-
* @typedef { object } IntentMetadata
|
|
86
|
-
* @summary The interface used to describe an intent within the platform.
|
|
87
|
-
* @property { string } name The unique name of the intent that can be invoked by the raiseIntent call.
|
|
88
|
-
* @property { string } displayName A friendly display name for the intent that should be used to render UI elements.
|
|
89
|
-
*/
|
|
90
|
-
/**
|
|
91
|
-
* @typedef { object } AppIntent
|
|
92
|
-
* @variation 2
|
|
93
|
-
* @summary An interface that represents the binding of an intent to apps, returned as part of intent discovery. For each intent, it references the applications that support that intent.
|
|
94
|
-
* @property { IntentMetadata } intent Details of the intent whose relationship to resolving applications is being described
|
|
95
|
-
* @property { Array<AppMetadata> } apps
|
|
96
|
-
*/
|
|
97
|
-
/**
|
|
98
|
-
* @name getResult
|
|
99
|
-
* @function
|
|
100
|
-
* @returns { Promise<IntentResult> }
|
|
101
|
-
*/
|
|
102
|
-
/**
|
|
103
|
-
* @typedef { object } IntentResolution
|
|
104
|
-
* @variation 2
|
|
105
|
-
* @summary Provides a standard format for data returned upon resolving an intent.
|
|
106
|
-
* @property { AppIdentifier } source Identifier for the app instance that was selected (or started) to resolve the intent.
|
|
107
|
-
* @property { string } Intent Intent name
|
|
108
|
-
* @property { string } [version] The version number of the Intents schema being used.
|
|
109
|
-
* @property { Function } getResult {@link getResult Function} that returns a promise that will resolve to either `Context` data returned by the application that resolves the raised intent or a `Channel` established and returned by the app resolving the intent.
|
|
110
|
-
*/
|
|
111
|
-
/**
|
|
112
|
-
* @typedef { object } PrivateChannel
|
|
113
|
-
* @summary Object representing a private context channel, which is intended to support secure communication between applications, and extends the Channel interface with event handlers which provide information on the connection state of both parties, ensuring that desktop agents do not need to queue or retain messages that are broadcast before a context listener is added and that applications are able to stop broadcasting messages when the other party has disconnected.
|
|
114
|
-
* @property { string } id Private Channel Id
|
|
115
|
-
* @property { string } type Channel Type
|
|
116
|
-
* @property { DisplayMetadata } [displayMetadata]
|
|
117
|
-
* @property { function } broadcast
|
|
118
|
-
* @property { function } getCurrentContext
|
|
119
|
-
* @property { function } addContextListener
|
|
120
|
-
* @property { function } onAddContextListener
|
|
121
|
-
* @property { function } onUnsubscribe
|
|
122
|
-
* @property { function } onDisconnect
|
|
123
|
-
* @property { function } disconnect
|
|
124
|
-
*/
|
|
125
|
-
/**
|
|
126
|
-
* @class
|
|
127
|
-
* @alias fdc3v2
|
|
128
|
-
* @version 2.0
|
|
129
|
-
* @hideconstructor
|
|
130
|
-
* @desc The FDC3 Client Library provides a set APIs to be used for FDC3 compliance,
|
|
131
|
-
* while using our Interop API under the hood. In order to use this set of APIs
|
|
132
|
-
* you will need to set up your own {@link InteropBroker InteropBroker} or use a Platform application, which does the setup for you. Refer to our documentation on
|
|
133
|
-
* our {@link https://developers.openfin.co/of-docs/docs/enable-context-sharing Interop API}.
|
|
134
|
-
*
|
|
135
|
-
* To enable the FDC3 APIs in a {@link Window Window} or {@link View View}, add the fdc3InteropApi
|
|
136
|
-
* property to its options:
|
|
137
|
-
*
|
|
138
|
-
* ```js
|
|
139
|
-
* {
|
|
140
|
-
* autoShow: false,
|
|
141
|
-
* saveWindowState: true,
|
|
142
|
-
* url: 'https://openfin.co',
|
|
143
|
-
* fdc3InteropApi: '2.0'
|
|
144
|
-
* }
|
|
145
|
-
* ```
|
|
146
|
-
*
|
|
147
|
-
* If using a {@link Platform Platform } application, you can set this property in defaultWindowOptions and defaultViewOptions.
|
|
148
|
-
*
|
|
149
|
-
* In order to ensure that the FDC3 Api is ready before use, you can use the 'fdc3Ready' event fired on the DOM Window object:
|
|
150
|
-
*
|
|
151
|
-
* ```js
|
|
152
|
-
* function fdc3Action() {
|
|
153
|
-
* // Make some fdc3 API calls here
|
|
154
|
-
* }
|
|
155
|
-
*
|
|
156
|
-
* if (window.fdc3) {
|
|
157
|
-
* fdc3Action();
|
|
158
|
-
* } else {
|
|
159
|
-
* window.addEventListener('fdc3Ready', fdc3Action);
|
|
160
|
-
* }
|
|
161
|
-
* ```
|
|
162
|
-
*/
|
|
163
|
-
class Fdc3Module2 extends base_1.Base {
|
|
164
|
-
constructor(wire) {
|
|
165
|
-
super(wire);
|
|
166
|
-
// we get the module for fdc 1.2 here so we can reuse it wherever we can
|
|
167
|
-
this.fdc3Module = new fdc3_1_2_1.default(this.wire);
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Launches an app, specified via an AppIdentifier object.
|
|
171
|
-
* @param { AppIdentifier | TargetApp } app
|
|
172
|
-
* @param { Context } [context]
|
|
173
|
-
* @returns { Promise<AppIdentifier> }
|
|
174
|
-
* @tutorial fdc3.open
|
|
175
|
-
*/
|
|
176
|
-
async open(app, context) {
|
|
177
|
-
if (typeof app === 'string') {
|
|
178
|
-
console.warn('Passing a string as the app parameter is deprecated, please use an AppIdentifier ({ appId: string; instanceId?: string }).');
|
|
179
|
-
}
|
|
180
|
-
return this.fdc3Module.open(app, context);
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Find all the available instances for a particular application.
|
|
184
|
-
* @param { AppIdentifier } app
|
|
185
|
-
* @returns { Promise<Array<AppIdentifier>> }
|
|
186
|
-
* @tutorial fdc3v2.findInstances
|
|
187
|
-
*/
|
|
188
|
-
async findInstances(app) {
|
|
189
|
-
this.wire.sendAction('fdc3-find-instances').catch((e) => {
|
|
190
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
191
|
-
});
|
|
192
|
-
try {
|
|
193
|
-
return await InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'fdc3FindInstances', app);
|
|
194
|
-
}
|
|
195
|
-
catch (error) {
|
|
196
|
-
const errorToThrow = error.message === utils_1.BROKER_ERRORS.fdc3FindInstances ? 'ResolverUnavailable' : error.message;
|
|
197
|
-
throw new Error(errorToThrow);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Retrieves the AppMetadata for an AppIdentifier, which provides additional metadata (such as icons, a title and description) from the App Directory record for the application, that may be used for display purposes.
|
|
202
|
-
* @param { AppIdentifier } app
|
|
203
|
-
* @returns { Promise<AppMetadata(2)> }
|
|
204
|
-
* @tutorial fdc3v2.getAppMetadata
|
|
205
|
-
*/
|
|
206
|
-
async getAppMetadata(app) {
|
|
207
|
-
this.wire.sendAction('fdc3-get-app-metadata').catch((e) => {
|
|
208
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
209
|
-
});
|
|
210
|
-
try {
|
|
211
|
-
return await InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'fdc3GetAppMetadata', app);
|
|
212
|
-
}
|
|
213
|
-
catch (error) {
|
|
214
|
-
const errorToThrow = error.message === utils_1.BROKER_ERRORS.fdc3GetAppMetadata ? 'ResolverUnavailable' : error.message;
|
|
215
|
-
throw new Error(errorToThrow);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Broadcasts a context for the channel of the current entity.
|
|
220
|
-
* @param { Context } context - New context to set.
|
|
221
|
-
* @returns { Promise<void> }
|
|
222
|
-
* @tutorial fdc3.broadcast
|
|
223
|
-
*/
|
|
224
|
-
async broadcast(context) {
|
|
225
|
-
return this.fdc3Module.broadcast(context);
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Add a context handler for incoming context. If an entity is part of a context group, and then sets its context handler, it will receive all of its declared contexts. If you wish to listen for all incoming contexts, pass `null` for the contextType argument.
|
|
229
|
-
* @param { string | null } contextType
|
|
230
|
-
* @param { ContextHandler(2) } handler
|
|
231
|
-
* @returns { Listener }
|
|
232
|
-
* @tutorial fdc3.addContextListener
|
|
233
|
-
*/
|
|
234
|
-
async addContextListener(contextType, handler) {
|
|
235
|
-
this.wire.sendAction('fdc3-add-context-listener').catch((e) => {
|
|
236
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
237
|
-
});
|
|
238
|
-
// The FDC3 ContextHandler only expects the context and optional ContextMetadata, so we wrap the handler
|
|
239
|
-
// here so it only gets passed these parameters
|
|
240
|
-
const getWrappedHandler = (handlerToWrap) => {
|
|
241
|
-
return (context) => {
|
|
242
|
-
const { contextMetadata, ...rest } = context;
|
|
243
|
-
const args = contextMetadata ? [{ ...rest }, contextMetadata] : [context, null];
|
|
244
|
-
handlerToWrap(...args);
|
|
245
|
-
};
|
|
246
|
-
};
|
|
247
|
-
let actualHandler = handler;
|
|
248
|
-
let wrappedHandler = getWrappedHandler(actualHandler);
|
|
249
|
-
if (typeof contextType === 'function') {
|
|
250
|
-
console.warn('addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)');
|
|
251
|
-
actualHandler = contextType;
|
|
252
|
-
wrappedHandler = getWrappedHandler(actualHandler);
|
|
253
|
-
return this.fin.me.interop.addContextHandler(wrappedHandler);
|
|
254
|
-
}
|
|
255
|
-
return this.fin.me.interop.addContextHandler(wrappedHandler, contextType === null ? undefined : contextType);
|
|
256
|
-
}
|
|
257
|
-
/**
|
|
258
|
-
* Find out more information about a particular intent by passing its name, and optionally its context and resultType.
|
|
259
|
-
* @param { string } intent Name of the Intent
|
|
260
|
-
* @param { Context } [context] Context
|
|
261
|
-
* @param { string } [resultType] The type of result returned for any intent specified during resolution.
|
|
262
|
-
* @returns { Promise<AppIntent(2)> }
|
|
263
|
-
* @tutorial fdc3.findIntent
|
|
264
|
-
*/
|
|
265
|
-
async findIntent(intent, context, resultType) {
|
|
266
|
-
this.wire.sendAction('fdc3-find-intent').catch((e) => {
|
|
267
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
268
|
-
});
|
|
269
|
-
try {
|
|
270
|
-
return await this.fin.me.interop.getInfoForIntent({ name: intent, context, metadata: { resultType } });
|
|
271
|
-
}
|
|
272
|
-
catch (error) {
|
|
273
|
-
const errorToThrow = error.message === utils_1.BROKER_ERRORS.getInfoForIntent ? 'ResolverUnavailable' : error.message;
|
|
274
|
-
throw new Error(errorToThrow);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Find all the available intents for a particular context.
|
|
279
|
-
* @param { Context } context
|
|
280
|
-
* @param { string } [resultType] The type of result returned for any intent specified during resolution.
|
|
281
|
-
* @returns { Promise<Array<AppIntent(2)>> }
|
|
282
|
-
* @tutorial fdc3v2.findIntentsByContext
|
|
283
|
-
*/
|
|
284
|
-
async findIntentsByContext(context, resultType) {
|
|
285
|
-
this.wire.sendAction('fdc3-find-intents-by-context').catch((e) => {
|
|
286
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
287
|
-
});
|
|
288
|
-
const payload = resultType ? { context, metadata: { resultType } } : context;
|
|
289
|
-
try {
|
|
290
|
-
return await InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'fdc3v2FindIntentsByContext', payload);
|
|
291
|
-
}
|
|
292
|
-
catch (error) {
|
|
293
|
-
const errorToThrow = error.message === utils_1.BROKER_ERRORS.getInfoForIntentsByContext ? 'ResolverUnavailable' : error.message;
|
|
294
|
-
throw new Error(errorToThrow);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* Raises a specific intent for resolution against apps registered with the desktop agent.
|
|
299
|
-
* @param { string } intent Name of the Intent
|
|
300
|
-
* @param { Context } context Context associated with the Intent
|
|
301
|
-
* @param { AppIdentifier | TargetApp } [app]
|
|
302
|
-
* @returns { Promise<IntentResolution(2)> }
|
|
303
|
-
* @tutorial fdc3v2.raiseIntent
|
|
304
|
-
*/
|
|
305
|
-
async raiseIntent(intent, context, app) {
|
|
306
|
-
this.wire.sendAction('fdc3-raise-intent').catch((e) => {
|
|
307
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
308
|
-
});
|
|
309
|
-
try {
|
|
310
|
-
if (typeof app === 'string') {
|
|
311
|
-
console.warn('Passing a string as the app parameter is deprecated, please use an AppIdentifier ({ appId: string; instanceId?: string }).');
|
|
312
|
-
}
|
|
313
|
-
return (0, utils_2.getIntentResolution)(this.fin.me.interop, context, app, intent);
|
|
314
|
-
}
|
|
315
|
-
catch (error) {
|
|
316
|
-
const errorToThrow = error.message === utils_1.BROKER_ERRORS.fireIntent ? 'ResolverUnavailable' : error.message;
|
|
317
|
-
throw new Error(errorToThrow);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
/**
|
|
321
|
-
* Finds and raises an intent against apps registered with the desktop agent based purely on the type of the context data.
|
|
322
|
-
* @param { Context } context Context associated with the Intent
|
|
323
|
-
* @param { AppIdentifier | TargetApp } [app]
|
|
324
|
-
* @returns { Promise<IntentResolution(2)> }
|
|
325
|
-
* @tutorial fdc3v2.raiseIntentForContext
|
|
326
|
-
*/
|
|
327
|
-
async raiseIntentForContext(context, app) {
|
|
328
|
-
// TODO: We have to do the same thing we do for raiseIntent here as well.
|
|
329
|
-
this.wire.sendAction('fdc3-raise-intent-for-context').catch((e) => {
|
|
330
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
331
|
-
});
|
|
332
|
-
try {
|
|
333
|
-
if (typeof app === 'string') {
|
|
334
|
-
console.warn('Passing a string as the app parameter is deprecated, please use an AppIdentifier ({ appId: string; instanceId?: string }).');
|
|
335
|
-
}
|
|
336
|
-
return (0, utils_2.getIntentResolution)(this.fin.me.interop, context, app);
|
|
337
|
-
}
|
|
338
|
-
catch (error) {
|
|
339
|
-
const errorToThrow = error.message === utils_1.BROKER_ERRORS.fireIntent ? 'ResolverUnavailable' : error.message;
|
|
340
|
-
throw new Error(errorToThrow);
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
/**
|
|
344
|
-
* Adds a listener for incoming intents.
|
|
345
|
-
* @param { string } intent Name of the Intent
|
|
346
|
-
* @param { IntentHandler(2) } handler A callback that handles a context event and may return a promise of a Context or Channel object to be returned to the application that raised the intent.
|
|
347
|
-
* @returns { Promise<Listener> }
|
|
348
|
-
* @tutorial fdc3.addIntentListener
|
|
349
|
-
*/
|
|
350
|
-
async addIntentListener(intent, handler) {
|
|
351
|
-
this.wire.sendAction('fdc3-add-intent-listener').catch((e) => {
|
|
352
|
-
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
353
|
-
});
|
|
354
|
-
if (typeof intent !== 'string') {
|
|
355
|
-
throw new Error('First argument must be an Intent name');
|
|
356
|
-
}
|
|
357
|
-
// The FDC3 Intenter handler only expects the context and contextMetadata to be passed to the handler,
|
|
358
|
-
// so we wrap it here and only pass those paramaters.
|
|
359
|
-
const contextHandler = async (raisedIntent) => {
|
|
360
|
-
let intentResult;
|
|
361
|
-
let intentResultToSend;
|
|
362
|
-
const { context, metadata: intentMetadata } = raisedIntent;
|
|
363
|
-
const { contextMetadata, metadata, ...rest } = context;
|
|
364
|
-
const intentResolutionResultId = (intentMetadata === null || intentMetadata === void 0 ? void 0 : intentMetadata.intentResolutionResultId) || (metadata === null || metadata === void 0 ? void 0 : metadata.intentResolutionResultId);
|
|
365
|
-
try {
|
|
366
|
-
const newContext = metadata ? { metadata, ...rest } : { ...rest };
|
|
367
|
-
intentResult = await handler(newContext, contextMetadata);
|
|
368
|
-
intentResultToSend = intentResult;
|
|
369
|
-
}
|
|
370
|
-
catch (error) {
|
|
371
|
-
intentResult = error;
|
|
372
|
-
intentResultToSend = { error: true };
|
|
373
|
-
}
|
|
374
|
-
if (intentResolutionResultId) {
|
|
375
|
-
this.fin.InterApplicationBus.publish(intentResolutionResultId, intentResultToSend);
|
|
376
|
-
}
|
|
377
|
-
if (intentResult instanceof Error) {
|
|
378
|
-
throw new Error(intentResult.message);
|
|
379
|
-
}
|
|
380
|
-
return intentResult;
|
|
381
|
-
};
|
|
382
|
-
return this.fin.me.interop.registerIntentHandler(contextHandler, intent, { fdc3Version: '2.0' });
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Returns a Channel object for the specified channel, creating it as an App Channel if it does not exist.
|
|
386
|
-
* @param channelId
|
|
387
|
-
* @returns { Promise<Channel> }
|
|
388
|
-
* @tutorial fdc3.getOrCreateChannel
|
|
389
|
-
*/
|
|
390
|
-
async getOrCreateChannel(channelId) {
|
|
391
|
-
return this.fdc3Module.getOrCreateChannel(channelId);
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* Returns a Channel with an auto-generated identity that is intended for private communication between applications. Primarily used to create channels that will be returned to other applications via an IntentResolution for a raised intent.
|
|
395
|
-
* @returns { Promise<PrivateChannel> }
|
|
396
|
-
* @tutorial fdc3v2.createPrivateChannel
|
|
397
|
-
*/
|
|
398
|
-
async createPrivateChannel() {
|
|
399
|
-
const channelId = (0, utils_1.generateId)();
|
|
400
|
-
await InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'createPrivateChannelProvider', { channelId });
|
|
401
|
-
const channelClient = await this.fin.InterApplicationBus.Channel.connect(channelId);
|
|
402
|
-
const newPrivateChannelClient = new PrivateChannelClient_1.PrivateChannelClient(channelClient, channelId);
|
|
403
|
-
return (0, utils_2.buildPrivateChannelObject)(newPrivateChannelClient);
|
|
404
|
-
}
|
|
405
|
-
/**
|
|
406
|
-
* Retrieves a list of the User Channels available for the app to join.
|
|
407
|
-
* @returns { Promise<Channel[]>}
|
|
408
|
-
* @tutorial fdc3v2.getUserChannels
|
|
409
|
-
*/
|
|
410
|
-
async getUserChannels() {
|
|
411
|
-
const channels = await this.fin.me.interop.getContextGroups();
|
|
412
|
-
// fdc3 implementation of getUserChannels returns on array of channels, have to decorate over
|
|
413
|
-
// this so people know that these APIs are not supported
|
|
414
|
-
return channels.map((channel) => {
|
|
415
|
-
return { ...channel, type: 'user', ...(0, utils_2.getUnsupportedChannelApis)('User') };
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
* Retrieves a list of the User Channels available for the app to join.
|
|
420
|
-
* @returns { Promise<Channel[]>}
|
|
421
|
-
* @deprecated Please use {@link fdc3.getUserChannels fdc3.getUserChannels} instead
|
|
422
|
-
* @tutorial fdc3.getSystemChannels
|
|
423
|
-
*/
|
|
424
|
-
async getSystemChannels() {
|
|
425
|
-
console.warn('This API has been deprecated. Please use fdc3.getUserChannels instead.');
|
|
426
|
-
return this.fdc3Module.getSystemChannels();
|
|
427
|
-
}
|
|
428
|
-
/**
|
|
429
|
-
* Join an app to a specified User channel.
|
|
430
|
-
* @param { string } channelId Channel name
|
|
431
|
-
* @returns { Promise<void> }
|
|
432
|
-
* @tutorial fdc3v2.joinUserChannel
|
|
433
|
-
*/
|
|
434
|
-
async joinUserChannel(channelId) {
|
|
435
|
-
return this.fdc3Module.joinChannel(channelId);
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Join an app to a specified User channel.
|
|
439
|
-
* @param { string } channelId Channel name
|
|
440
|
-
* @deprecated Please use {@link fdc3.joinUserChannel fdc3.joinUserChannel} instead
|
|
441
|
-
* @returns { Promise<void> }
|
|
442
|
-
* @tutorial fdc3.joinChannel
|
|
443
|
-
*/
|
|
444
|
-
async joinChannel(channelId) {
|
|
445
|
-
console.warn('This API has been deprecated. Please use fdc3.joinUserChannel instead.');
|
|
446
|
-
return this.fdc3Module.joinChannel(channelId);
|
|
447
|
-
}
|
|
448
|
-
/**
|
|
449
|
-
* Returns the Channel object for the current User channel membership
|
|
450
|
-
* @returns { Promise<FDC3.Channel | null> }
|
|
451
|
-
* @tutorial fdc3.getCurrentChannel
|
|
452
|
-
*/
|
|
453
|
-
async getCurrentChannel() {
|
|
454
|
-
const currentChannel = await this.fdc3Module.getCurrentChannel();
|
|
455
|
-
if (!currentChannel) {
|
|
456
|
-
return null;
|
|
457
|
-
}
|
|
458
|
-
return {
|
|
459
|
-
...currentChannel,
|
|
460
|
-
type: 'user',
|
|
461
|
-
broadcast: this.broadcast.bind(this)
|
|
462
|
-
};
|
|
463
|
-
}
|
|
464
|
-
/**
|
|
465
|
-
* Removes the app from any User channel membership.
|
|
466
|
-
* @returns { Promise<void> }
|
|
467
|
-
* @tutorial fdc3.leaveCurrentChannel
|
|
468
|
-
*/
|
|
469
|
-
async leaveCurrentChannel() {
|
|
470
|
-
return this.fdc3Module.leaveCurrentChannel();
|
|
471
|
-
}
|
|
472
|
-
/**
|
|
473
|
-
* Retrieves information about the FDC3 implementation, including the supported version of the FDC3 specification, the name of the provider of the implementation, its own version number, details of whether optional API features are implemented and the metadata of the calling application according to the desktop agent.
|
|
474
|
-
* fdc3HandleGetInfo must be overridden in the InteropBroker so that the ImplementationMetadata will have the appMetadata info.
|
|
475
|
-
* @returns { Promise<ImplementationMetadata(2)> }
|
|
476
|
-
* @tutorial fdc3v2.getInfo
|
|
477
|
-
*/
|
|
478
|
-
async getInfo() {
|
|
479
|
-
return InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'fdc3v2GetInfo', { fdc3Version: '2.0' });
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
exports.default = Fdc3Module2;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import Fdc3Module from './fdc3-1.2';
|
|
2
|
-
import Fdc3Module2 from './fdc3-2.0';
|
|
3
|
-
import type { Transport } from '../../../transport/transport';
|
|
4
|
-
import { Fdc3Version } from './versions';
|
|
5
|
-
declare global {
|
|
6
|
-
interface Window {
|
|
7
|
-
fdc3: Fdc3Module | Fdc3Module2;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export declare const versionMap: Record<Fdc3Version, typeof Fdc3Module | typeof Fdc3Module2>;
|
|
11
|
-
export declare function registerFdc3Shim(version: string, transport: Transport): void;
|
|
12
|
-
export declare function getFdc3(transport: Transport, version?: Fdc3Version): Fdc3Module | Fdc3Module2;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFdc3 = exports.registerFdc3Shim = exports.versionMap = void 0;
|
|
4
|
-
/* eslint-disable no-console */
|
|
5
|
-
/* eslint-disable no-param-reassign */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
7
|
-
const fdc3_1_2_1 = require("./fdc3-1.2");
|
|
8
|
-
const fdc3_2_0_1 = require("./fdc3-2.0");
|
|
9
|
-
exports.versionMap = {
|
|
10
|
-
'1.2': fdc3_1_2_1.default,
|
|
11
|
-
'2.0': fdc3_2_0_1.default
|
|
12
|
-
};
|
|
13
|
-
const latestVersion = '2.0';
|
|
14
|
-
function registerFdc3Shim(version, transport) {
|
|
15
|
-
if (Object.keys(exports.versionMap).includes(version)) {
|
|
16
|
-
const Api = exports.versionMap[version];
|
|
17
|
-
window.fdc3 = new Api(transport);
|
|
18
|
-
window.dispatchEvent(new CustomEvent('fdc3Ready'));
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
console.error(`FDC3 API version ${version} is not supported`);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.registerFdc3Shim = registerFdc3Shim;
|
|
25
|
-
function getFdc3(transport, version = latestVersion) {
|
|
26
|
-
if (!(version in exports.versionMap)) {
|
|
27
|
-
console.warn(`FDC3 API version: ${version} is not supported. Defaulting to latest version: ${latestVersion}.`);
|
|
28
|
-
version = latestVersion;
|
|
29
|
-
}
|
|
30
|
-
const Fdc3Api = exports.versionMap[version];
|
|
31
|
-
const fdc3 = new Fdc3Api(transport);
|
|
32
|
-
window.dispatchEvent(new CustomEvent('fdc3Ready'));
|
|
33
|
-
return fdc3;
|
|
34
|
-
}
|
|
35
|
-
exports.getFdc3 = getFdc3;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import * as OpenFin from '../../../OpenFin';
|
|
2
|
-
import { Fdc3Version } from './versions';
|
|
3
|
-
export declare function getDefaultViewFdc3VersionFromAppInfo({ manifest, initialOptions }: Awaited<ReturnType<OpenFin.Application['getInfo']>>): Fdc3Version | undefined;
|
|
4
|
-
export declare function overrideCheck(overriddenBroker: OpenFin.InteropBroker, fdc3InteropApi?: Fdc3Version): void;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.overrideCheck = exports.getDefaultViewFdc3VersionFromAppInfo = void 0;
|
|
4
|
-
const InteropBroker_1 = require("../InteropBroker");
|
|
5
|
-
function getDefaultViewFdc3VersionFromAppInfo({ manifest, initialOptions }) {
|
|
6
|
-
var _a, _b, _c, _d;
|
|
7
|
-
const setVersion = (_c = (_b = (_a = manifest.platform) === null || _a === void 0 ? void 0 : _a.defaultViewOptions) === null || _b === void 0 ? void 0 : _b.fdc3InteropApi) !== null && _c !== void 0 ? _c : (_d = initialOptions.defaultViewOptions) === null || _d === void 0 ? void 0 : _d.fdc3InteropApi;
|
|
8
|
-
return ['1.2', '2.0'].includes(setVersion !== null && setVersion !== void 0 ? setVersion : '') ? setVersion : undefined;
|
|
9
|
-
}
|
|
10
|
-
exports.getDefaultViewFdc3VersionFromAppInfo = getDefaultViewFdc3VersionFromAppInfo;
|
|
11
|
-
// TODO: Unit test this
|
|
12
|
-
function overrideCheck(overriddenBroker, fdc3InteropApi) {
|
|
13
|
-
if (fdc3InteropApi && fdc3InteropApi === '2.0') {
|
|
14
|
-
const mustOverrideAPIs = [
|
|
15
|
-
'fdc3HandleFindInstances',
|
|
16
|
-
'handleInfoForIntent',
|
|
17
|
-
'handleInfoForIntentsByContext',
|
|
18
|
-
'fdc3HandleGetAppMetadata',
|
|
19
|
-
'fdc3HandleGetInfo',
|
|
20
|
-
'fdc3HandleOpen',
|
|
21
|
-
'handleFiredIntent',
|
|
22
|
-
'handleFiredIntentForContext'
|
|
23
|
-
];
|
|
24
|
-
const notOverridden = mustOverrideAPIs.filter((api) => {
|
|
25
|
-
return overriddenBroker[api] === InteropBroker_1.InteropBroker.prototype[api];
|
|
26
|
-
});
|
|
27
|
-
if (notOverridden.length > 0) {
|
|
28
|
-
console.warn(`WARNING: FDC3 2.0 has been set as a default option for Views in this Platform, but the required InteropBroker APIs for FDC3 2.0 compliance have not all been overridden.\nThe following APIs need to be overridden:\n${notOverridden.join('\n')}`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.overrideCheck = overrideCheck;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { DisplayMetadata } from 'fdc3v1/dist/api/DisplayMetadata';
|
|
2
|
-
import type { Listener } from 'fdc3v1/dist/api/Listener';
|
|
3
|
-
import type { AppMetadata } from 'fdc3v1/dist/api/AppMetadata';
|
|
4
|
-
import type { AppIntent } from 'fdc3v1/dist/api/AppIntent';
|
|
5
|
-
import type { ImplementationMetadata } from 'fdc3v1/dist/api/ImplementationMetadata';
|
|
6
|
-
export type { DisplayMetadata } from 'fdc3v1/dist/api/DisplayMetadata';
|
|
7
|
-
export type { Listener } from 'fdc3v1/dist/api/Listener';
|
|
8
|
-
export type { AppMetadata } from 'fdc3v1/dist/api/AppMetadata';
|
|
9
|
-
export type { AppIntent } from 'fdc3v1/dist/api/AppIntent';
|
|
10
|
-
export type { ImplementationMetadata } from 'fdc3v1/dist/api/ImplementationMetadata';
|
|
11
|
-
export type ContextHandler = (context: Context) => void;
|
|
12
|
-
export type TargetApp = string | AppMetadata;
|
|
13
|
-
export interface Context {
|
|
14
|
-
id?: {
|
|
15
|
-
[key: string]: string;
|
|
16
|
-
};
|
|
17
|
-
name?: string;
|
|
18
|
-
type: string;
|
|
19
|
-
}
|
|
20
|
-
export interface IntentResolution {
|
|
21
|
-
source: TargetApp;
|
|
22
|
-
data?: object;
|
|
23
|
-
version: string;
|
|
24
|
-
}
|
|
25
|
-
export interface Channel {
|
|
26
|
-
id: string;
|
|
27
|
-
type: string;
|
|
28
|
-
displayMetadata?: DisplayMetadata;
|
|
29
|
-
broadcast(context: Context): void;
|
|
30
|
-
getCurrentContext(contextType?: string): Promise<Context | null>;
|
|
31
|
-
addContextListener(contextType: string | null, handler: ContextHandler): Listener & Promise<Listener>;
|
|
32
|
-
}
|
|
33
|
-
export type SystemChannel = Omit<Channel, 'addContextListener' | 'broadcast' | 'getCurrentContext'> & {
|
|
34
|
-
addContextListener(): Error;
|
|
35
|
-
broadcast(): Error;
|
|
36
|
-
getCurrentContext(): Error;
|
|
37
|
-
};
|
|
38
|
-
export interface DesktopAgent {
|
|
39
|
-
open(app: TargetApp, context?: Context): Promise<void>;
|
|
40
|
-
findIntent(intent: string, context?: Context): Promise<AppIntent>;
|
|
41
|
-
findIntentsByContext(context: Context): Promise<Array<AppIntent>>;
|
|
42
|
-
broadcast(context: Context): void;
|
|
43
|
-
raiseIntent(intent: string, context: Context, app?: TargetApp): Promise<IntentResolution>;
|
|
44
|
-
raiseIntentForContext(context: Context, app?: TargetApp): Promise<IntentResolution>;
|
|
45
|
-
addIntentListener(intent: string, handler: ContextHandler): Listener;
|
|
46
|
-
joinChannel(channelId: string): Promise<void>;
|
|
47
|
-
leaveCurrentChannel(): Promise<void>;
|
|
48
|
-
getInfo(): ImplementationMetadata;
|
|
49
|
-
addContextListener(contextType: string | null, handler: ContextHandler): Listener & Promise<Listener>;
|
|
50
|
-
getOrCreateChannel(channelId: string): Promise<Channel>;
|
|
51
|
-
getSystemChannels(): Promise<SystemChannel[]>;
|
|
52
|
-
getCurrentChannel(): Promise<Channel | null>;
|
|
53
|
-
}
|