@openfin/core 33.76.36 → 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.
Files changed (271) hide show
  1. package/OpenFin.d.ts +1 -1
  2. package/README.md +29 -4
  3. package/fin.d.ts +2 -2
  4. package/{src → out}/GlobalOpenFin.d.ts +1 -1
  5. package/out/mock-alpha.d.ts +16112 -0
  6. package/out/mock-beta.d.ts +16112 -0
  7. package/out/mock-public.d.ts +16112 -0
  8. package/out/mock.d.ts +16797 -0
  9. package/out/mock.js +17104 -0
  10. package/package.json +30 -23
  11. package/LICENSE +0 -13
  12. package/NOTICE +0 -16
  13. package/openfin-core-33.76.36.tgz +0 -0
  14. package/src/OpenFin.d.ts +0 -3091
  15. package/src/OpenFin.js +0 -2
  16. package/src/api/api-exposer/api-consumer.d.ts +0 -28
  17. package/src/api/api-exposer/api-consumer.js +0 -28
  18. package/src/api/api-exposer/api-exposer.d.ts +0 -35
  19. package/src/api/api-exposer/api-exposer.js +0 -38
  20. package/src/api/api-exposer/decorators.d.ts +0 -10
  21. package/src/api/api-exposer/decorators.js +0 -18
  22. package/src/api/api-exposer/index.d.ts +0 -4
  23. package/src/api/api-exposer/index.js +0 -20
  24. package/src/api/api-exposer/strategies/index.d.ts +0 -1
  25. package/src/api/api-exposer/strategies/index.js +0 -17
  26. package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.d.ts +0 -14
  27. package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.js +0 -20
  28. package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.d.ts +0 -20
  29. package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.js +0 -23
  30. package/src/api/api-exposer/strategies/openfin-channels/index.d.ts +0 -2
  31. package/src/api/api-exposer/strategies/openfin-channels/index.js +0 -18
  32. package/src/api/application/Factory.d.ts +0 -196
  33. package/src/api/application/Factory.js +0 -278
  34. package/src/api/application/Instance.d.ts +0 -692
  35. package/src/api/application/Instance.js +0 -821
  36. package/src/api/application/index.d.ts +0 -12
  37. package/src/api/application/index.js +0 -28
  38. package/src/api/base.d.ts +0 -117
  39. package/src/api/base.js +0 -246
  40. package/src/api/clipboard/index.d.ts +0 -172
  41. package/src/api/clipboard/index.js +0 -200
  42. package/src/api/events/application.d.ts +0 -158
  43. package/src/api/events/application.js +0 -14
  44. package/src/api/events/base.d.ts +0 -42
  45. package/src/api/events/base.js +0 -2
  46. package/src/api/events/channel.d.ts +0 -35
  47. package/src/api/events/channel.js +0 -7
  48. package/src/api/events/emitterMap.d.ts +0 -11
  49. package/src/api/events/emitterMap.js +0 -35
  50. package/src/api/events/eventAggregator.d.ts +0 -5
  51. package/src/api/events/eventAggregator.js +0 -35
  52. package/src/api/events/externalApplication.d.ts +0 -24
  53. package/src/api/events/externalApplication.js +0 -7
  54. package/src/api/events/frame.d.ts +0 -35
  55. package/src/api/events/frame.js +0 -2
  56. package/src/api/events/globalHotkey.d.ts +0 -25
  57. package/src/api/events/globalHotkey.js +0 -2
  58. package/src/api/events/platform.d.ts +0 -34
  59. package/src/api/events/platform.js +0 -10
  60. package/src/api/events/system.d.ts +0 -126
  61. package/src/api/events/system.js +0 -15
  62. package/src/api/events/typedEventEmitter.d.ts +0 -20
  63. package/src/api/events/typedEventEmitter.js +0 -2
  64. package/src/api/events/view.d.ts +0 -92
  65. package/src/api/events/view.js +0 -12
  66. package/src/api/events/webcontents.d.ts +0 -277
  67. package/src/api/events/webcontents.js +0 -13
  68. package/src/api/events/window.d.ts +0 -421
  69. package/src/api/events/window.js +0 -12
  70. package/src/api/external-application/Factory.d.ts +0 -34
  71. package/src/api/external-application/Factory.js +0 -47
  72. package/src/api/external-application/Instance.d.ts +0 -110
  73. package/src/api/external-application/Instance.js +0 -117
  74. package/src/api/external-application/index.d.ts +0 -12
  75. package/src/api/external-application/index.js +0 -28
  76. package/src/api/fin.d.ts +0 -54
  77. package/src/api/fin.js +0 -45
  78. package/src/api/frame/Factory.d.ts +0 -54
  79. package/src/api/frame/Factory.js +0 -86
  80. package/src/api/frame/Instance.d.ts +0 -136
  81. package/src/api/frame/Instance.js +0 -143
  82. package/src/api/frame/index.d.ts +0 -14
  83. package/src/api/frame/index.js +0 -30
  84. package/src/api/global-hotkey/index.d.ts +0 -106
  85. package/src/api/global-hotkey/index.js +0 -132
  86. package/src/api/interappbus/channel/channel.d.ts +0 -285
  87. package/src/api/interappbus/channel/channel.js +0 -334
  88. package/src/api/interappbus/channel/channels-docs.d.ts +0 -342
  89. package/src/api/interappbus/channel/channels-docs.js +0 -401
  90. package/src/api/interappbus/channel/client.d.ts +0 -117
  91. package/src/api/interappbus/channel/client.js +0 -181
  92. package/src/api/interappbus/channel/connection-manager.d.ts +0 -29
  93. package/src/api/interappbus/channel/connection-manager.js +0 -246
  94. package/src/api/interappbus/channel/index.d.ts +0 -189
  95. package/src/api/interappbus/channel/index.js +0 -333
  96. package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +0 -13
  97. package/src/api/interappbus/channel/protocols/classic/message-receiver.js +0 -73
  98. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +0 -24
  99. package/src/api/interappbus/channel/protocols/classic/strategy.js +0 -101
  100. package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +0 -20
  101. package/src/api/interappbus/channel/protocols/combined/strategy.js +0 -58
  102. package/src/api/interappbus/channel/protocols/index.d.ts +0 -47
  103. package/src/api/interappbus/channel/protocols/index.js +0 -2
  104. package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +0 -10
  105. package/src/api/interappbus/channel/protocols/protocol-manager.js +0 -43
  106. package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +0 -25
  107. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +0 -141
  108. package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +0 -30
  109. package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +0 -130
  110. package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +0 -24
  111. package/src/api/interappbus/channel/protocols/rtc/strategy.js +0 -85
  112. package/src/api/interappbus/channel/protocols/strategy-types.d.ts +0 -13
  113. package/src/api/interappbus/channel/protocols/strategy-types.js +0 -2
  114. package/src/api/interappbus/channel/protocols/strategy.d.ts +0 -17
  115. package/src/api/interappbus/channel/protocols/strategy.js +0 -2
  116. package/src/api/interappbus/channel/provider.d.ts +0 -206
  117. package/src/api/interappbus/channel/provider.js +0 -338
  118. package/src/api/interappbus/index.d.ts +0 -120
  119. package/src/api/interappbus/index.js +0 -210
  120. package/src/api/interop/Factory.d.ts +0 -57
  121. package/src/api/interop/Factory.js +0 -96
  122. package/src/api/interop/InteropBroker.d.ts +0 -665
  123. package/src/api/interop/InteropBroker.js +0 -1313
  124. package/src/api/interop/InteropClient.d.ts +0 -502
  125. package/src/api/interop/InteropClient.js +0 -683
  126. package/src/api/interop/SessionContextGroupBroker.d.ts +0 -27
  127. package/src/api/interop/SessionContextGroupBroker.js +0 -108
  128. package/src/api/interop/SessionContextGroupClient.d.ts +0 -21
  129. package/src/api/interop/SessionContextGroupClient.js +0 -86
  130. package/src/api/interop/fdc3/PrivateChannelClient.d.ts +0 -20
  131. package/src/api/interop/fdc3/PrivateChannelClient.js +0 -90
  132. package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +0 -55
  133. package/src/api/interop/fdc3/PrivateChannelProvider.js +0 -276
  134. package/src/api/interop/fdc3/documentationStub.d.ts +0 -14
  135. package/src/api/interop/fdc3/documentationStub.js +0 -17
  136. package/src/api/interop/fdc3/fdc3-1.2.d.ts +0 -205
  137. package/src/api/interop/fdc3/fdc3-1.2.js +0 -435
  138. package/src/api/interop/fdc3/fdc3-2.0.d.ts +0 -298
  139. package/src/api/interop/fdc3/fdc3-2.0.js +0 -479
  140. package/src/api/interop/fdc3/fdc3.d.ts +0 -12
  141. package/src/api/interop/fdc3/fdc3.js +0 -35
  142. package/src/api/interop/fdc3/overrideCheck.d.ts +0 -4
  143. package/src/api/interop/fdc3/overrideCheck.js +0 -32
  144. package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +0 -53
  145. package/src/api/interop/fdc3/shapes/fdc3v1.js +0 -4
  146. package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +0 -75
  147. package/src/api/interop/fdc3/shapes/fdc3v2.js +0 -2
  148. package/src/api/interop/fdc3/utils.d.ts +0 -45
  149. package/src/api/interop/fdc3/utils.js +0 -239
  150. package/src/api/interop/fdc3/versions.d.ts +0 -1
  151. package/src/api/interop/fdc3/versions.js +0 -2
  152. package/src/api/interop/index.d.ts +0 -12
  153. package/src/api/interop/index.js +0 -28
  154. package/src/api/interop/utils.d.ts +0 -18
  155. package/src/api/interop/utils.js +0 -61
  156. package/src/api/me.d.ts +0 -40
  157. package/src/api/me.js +0 -134
  158. package/src/api/platform/Factory.d.ts +0 -171
  159. package/src/api/platform/Factory.js +0 -240
  160. package/src/api/platform/Instance.d.ts +0 -653
  161. package/src/api/platform/Instance.js +0 -834
  162. package/src/api/platform/common-utils.d.ts +0 -7
  163. package/src/api/platform/common-utils.js +0 -16
  164. package/src/api/platform/index.d.ts +0 -12
  165. package/src/api/platform/index.js +0 -28
  166. package/src/api/platform/layout/Factory.d.ts +0 -91
  167. package/src/api/platform/layout/Factory.js +0 -151
  168. package/src/api/platform/layout/Instance.d.ts +0 -192
  169. package/src/api/platform/layout/Instance.js +0 -224
  170. package/src/api/platform/layout/controllers/layout-content-cache.d.ts +0 -9
  171. package/src/api/platform/layout/controllers/layout-content-cache.js +0 -54
  172. package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +0 -119
  173. package/src/api/platform/layout/controllers/layout-entities-controller.js +0 -287
  174. package/src/api/platform/layout/entities/layout-entities.d.ts +0 -427
  175. package/src/api/platform/layout/entities/layout-entities.js +0 -504
  176. package/src/api/platform/layout/entities/shapes.d.ts +0 -6
  177. package/src/api/platform/layout/entities/shapes.js +0 -2
  178. package/src/api/platform/layout/index.d.ts +0 -11
  179. package/src/api/platform/layout/index.js +0 -27
  180. package/src/api/platform/layout/layout.constants.d.ts +0 -1
  181. package/src/api/platform/layout/layout.constants.js +0 -4
  182. package/src/api/platform/layout/shapes.d.ts +0 -16
  183. package/src/api/platform/layout/shapes.js +0 -2
  184. package/src/api/platform/layout/utils/layout-traversal.d.ts +0 -4
  185. package/src/api/platform/layout/utils/layout-traversal.js +0 -65
  186. package/src/api/platform/provider.d.ts +0 -510
  187. package/src/api/platform/provider.js +0 -2
  188. package/src/api/snapshot-source/Factory.d.ts +0 -53
  189. package/src/api/snapshot-source/Factory.js +0 -81
  190. package/src/api/snapshot-source/Instance.d.ts +0 -53
  191. package/src/api/snapshot-source/Instance.js +0 -154
  192. package/src/api/snapshot-source/index.d.ts +0 -12
  193. package/src/api/snapshot-source/index.js +0 -28
  194. package/src/api/snapshot-source/utils.d.ts +0 -2
  195. package/src/api/snapshot-source/utils.js +0 -6
  196. package/src/api/system/index.d.ts +0 -1468
  197. package/src/api/system/index.js +0 -1851
  198. package/src/api/view/Factory.d.ts +0 -88
  199. package/src/api/view/Factory.js +0 -141
  200. package/src/api/view/Instance.d.ts +0 -601
  201. package/src/api/view/Instance.js +0 -671
  202. package/src/api/view/index.d.ts +0 -12
  203. package/src/api/view/index.js +0 -28
  204. package/src/api/webcontents/main.d.ts +0 -922
  205. package/src/api/webcontents/main.js +0 -1046
  206. package/src/api/window/Factory.d.ts +0 -96
  207. package/src/api/window/Factory.js +0 -142
  208. package/src/api/window/Instance.d.ts +0 -1598
  209. package/src/api/window/Instance.js +0 -1851
  210. package/src/api/window/index.d.ts +0 -14
  211. package/src/api/window/index.js +0 -30
  212. package/src/browser.d.ts +0 -10
  213. package/src/browser.js +0 -36
  214. package/src/environment/browser.d.ts +0 -29
  215. package/src/environment/browser.js +0 -60
  216. package/src/environment/environment.d.ts +0 -33
  217. package/src/environment/environment.js +0 -4
  218. package/src/environment/mockEnvironment.d.ts +0 -27
  219. package/src/environment/mockEnvironment.js +0 -61
  220. package/src/environment/node-env.d.ts +0 -29
  221. package/src/environment/node-env.js +0 -72
  222. package/src/fdc3.d.ts +0 -3
  223. package/src/fdc3.js +0 -9
  224. package/src/mock.d.ts +0 -3
  225. package/src/mock.js +0 -18
  226. package/src/namespaces.d.ts +0 -22
  227. package/src/namespaces.js +0 -26
  228. package/src/shapes/ERROR_BOX_TYPES.d.ts +0 -1
  229. package/src/shapes/ERROR_BOX_TYPES.js +0 -2
  230. package/src/shapes/WebOptions.d.ts +0 -13
  231. package/src/shapes/WebOptions.js +0 -2
  232. package/src/shapes/WindowOptions.d.ts +0 -43
  233. package/src/shapes/WindowOptions.js +0 -2
  234. package/src/shapes/protocol.d.ts +0 -204
  235. package/src/shapes/protocol.js +0 -2
  236. package/src/transport/mockWire.d.ts +0 -11
  237. package/src/transport/mockWire.js +0 -26
  238. package/src/transport/transport-errors.d.ts +0 -31
  239. package/src/transport/transport-errors.js +0 -79
  240. package/src/transport/transport.d.ts +0 -73
  241. package/src/transport/transport.js +0 -219
  242. package/src/transport/wire.d.ts +0 -77
  243. package/src/transport/wire.js +0 -36
  244. package/src/util/asyncFilter.d.ts +0 -1
  245. package/src/util/asyncFilter.js +0 -7
  246. package/src/util/channel-api-relay.d.ts +0 -13
  247. package/src/util/channel-api-relay.js +0 -47
  248. package/src/util/errors.d.ts +0 -10
  249. package/src/util/errors.js +0 -12
  250. package/src/util/exhaustive.d.ts +0 -1
  251. package/src/util/exhaustive.js +0 -7
  252. package/src/util/http.d.ts +0 -11
  253. package/src/util/http.js +0 -90
  254. package/src/util/inaccessibleObject.d.ts +0 -2
  255. package/src/util/inaccessibleObject.js +0 -49
  256. package/src/util/lazy.d.ts +0 -34
  257. package/src/util/lazy.js +0 -54
  258. package/src/util/normalize-config.d.ts +0 -3
  259. package/src/util/normalize-config.js +0 -52
  260. package/src/util/promises.d.ts +0 -5
  261. package/src/util/promises.js +0 -27
  262. package/src/util/ref-counter.d.ts +0 -7
  263. package/src/util/ref-counter.js +0 -52
  264. package/src/util/reversible-map.d.ts +0 -11
  265. package/src/util/reversible-map.js +0 -49
  266. package/src/util/runtimeVersioning.d.ts +0 -3
  267. package/src/util/runtimeVersioning.js +0 -25
  268. package/src/util/utilTypes.d.ts +0 -8
  269. package/src/util/utilTypes.js +0 -2
  270. package/src/util/validate.d.ts +0 -3
  271. package/src/util/validate.js +0 -11
@@ -1,479 +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
74
- * @param contextMetadata
75
- *
76
- */
77
- /**
78
- * @callback IntentHandler
79
- * @variation 2
80
- * @param context
81
- * @param contextMetadata
82
- *
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
- *
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
- * @version 2.0
127
- * The FDC3 Client Library provides a set APIs to be used for FDC3 compliance,
128
- * while using our Interop API under the hood. In order to use this set of APIs
129
- * 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
130
- * our {@link https://developers.openfin.co/of-docs/docs/enable-context-sharing Interop API}.
131
- *
132
- * To enable the FDC3 APIs in a {@link Window Window} or {@link View View}, add the fdc3InteropApi
133
- * property to its options:
134
- *
135
- * ```js
136
- * {
137
- * autoShow: false,
138
- * saveWindowState: true,
139
- * url: 'https://openfin.co',
140
- * fdc3InteropApi: '2.0'
141
- * }
142
- * ```
143
- *
144
- * If using a {@link Platform Platform } application, you can set this property in defaultWindowOptions and defaultViewOptions.
145
- *
146
- * In order to ensure that the FDC3 Api is ready before use, you can use the 'fdc3Ready' event fired on the DOM Window object:
147
- *
148
- * ```js
149
- * function fdc3Action() {
150
- * // Make some fdc3 API calls here
151
- * }
152
- *
153
- * if (window.fdc3) {
154
- * fdc3Action();
155
- * } else {
156
- * window.addEventListener('fdc3Ready', fdc3Action);
157
- * }
158
- * ```
159
- */
160
- class Fdc3Module2 extends base_1.Base {
161
- constructor(wire) {
162
- super(wire);
163
- // we get the module for fdc 1.2 here so we can reuse it wherever we can
164
- this.fdc3Module = new fdc3_1_2_1.default(this.wire);
165
- }
166
- /**
167
- * Launches an app, specified via an AppIdentifier object.
168
- * @param app
169
- * @param context
170
- *
171
- * @tutorial fdc3.open
172
- */
173
- async open(app, context) {
174
- if (typeof app === 'string') {
175
- console.warn('Passing a string as the app parameter is deprecated, please use an AppIdentifier ({ appId: string; instanceId?: string }).');
176
- }
177
- return this.fdc3Module.open(app, context);
178
- }
179
- /**
180
- * Find all the available instances for a particular application.
181
- * @param app
182
- *
183
- * @tutorial fdc3v2.findInstances
184
- */
185
- async findInstances(app) {
186
- this.wire.sendAction('fdc3-find-instances').catch((e) => {
187
- // we do not want to expose this error, just continue if this analytics-only call fails
188
- });
189
- try {
190
- return await InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'fdc3FindInstances', app);
191
- }
192
- catch (error) {
193
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.fdc3FindInstances ? 'ResolverUnavailable' : error.message;
194
- throw new Error(errorToThrow);
195
- }
196
- }
197
- /**
198
- * 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.
199
- * @param app
200
- *
201
- * @tutorial fdc3v2.getAppMetadata
202
- */
203
- async getAppMetadata(app) {
204
- this.wire.sendAction('fdc3-get-app-metadata').catch((e) => {
205
- // we do not want to expose this error, just continue if this analytics-only call fails
206
- });
207
- try {
208
- return await InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'fdc3GetAppMetadata', app);
209
- }
210
- catch (error) {
211
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.fdc3GetAppMetadata ? 'ResolverUnavailable' : error.message;
212
- throw new Error(errorToThrow);
213
- }
214
- }
215
- /**
216
- * Broadcasts a context for the channel of the current entity.
217
- * @param context - New context to set.
218
- *
219
- * @tutorial fdc3.broadcast
220
- */
221
- async broadcast(context) {
222
- return this.fdc3Module.broadcast(context);
223
- }
224
- /**
225
- * 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.
226
- * @param contextType
227
- * @param handler
228
- *
229
- * @tutorial fdc3.addContextListener
230
- */
231
- async addContextListener(contextType, handler) {
232
- this.wire.sendAction('fdc3-add-context-listener').catch((e) => {
233
- // we do not want to expose this error, just continue if this analytics-only call fails
234
- });
235
- // The FDC3 ContextHandler only expects the context and optional ContextMetadata, so we wrap the handler
236
- // here so it only gets passed these parameters
237
- const getWrappedHandler = (handlerToWrap) => {
238
- return (context) => {
239
- const { contextMetadata, ...rest } = context;
240
- const args = contextMetadata ? [{ ...rest }, contextMetadata] : [context, null];
241
- handlerToWrap(...args);
242
- };
243
- };
244
- let actualHandler = handler;
245
- let wrappedHandler = getWrappedHandler(actualHandler);
246
- if (typeof contextType === 'function') {
247
- console.warn('addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)');
248
- actualHandler = contextType;
249
- wrappedHandler = getWrappedHandler(actualHandler);
250
- return this.fin.me.interop.addContextHandler(wrappedHandler);
251
- }
252
- return this.fin.me.interop.addContextHandler(wrappedHandler, contextType === null ? undefined : contextType);
253
- }
254
- /**
255
- * Find out more information about a particular intent by passing its name, and optionally its context and resultType.
256
- * @param intent Name of the Intent
257
- * @param context Context
258
- * @param resultType The type of result returned for any intent specified during resolution.
259
- *
260
- * @tutorial fdc3.findIntent
261
- */
262
- async findIntent(intent, context, resultType) {
263
- this.wire.sendAction('fdc3-find-intent').catch((e) => {
264
- // we do not want to expose this error, just continue if this analytics-only call fails
265
- });
266
- try {
267
- return await this.fin.me.interop.getInfoForIntent({ name: intent, context, metadata: { resultType } });
268
- }
269
- catch (error) {
270
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.getInfoForIntent ? 'ResolverUnavailable' : error.message;
271
- throw new Error(errorToThrow);
272
- }
273
- }
274
- /**
275
- * Find all the available intents for a particular context.
276
- * @param context
277
- * @param resultType The type of result returned for any intent specified during resolution.
278
- *
279
- * @tutorial fdc3v2.findIntentsByContext
280
- */
281
- async findIntentsByContext(context, resultType) {
282
- this.wire.sendAction('fdc3-find-intents-by-context').catch((e) => {
283
- // we do not want to expose this error, just continue if this analytics-only call fails
284
- });
285
- const payload = resultType ? { context, metadata: { resultType } } : context;
286
- try {
287
- return await InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'fdc3v2FindIntentsByContext', payload);
288
- }
289
- catch (error) {
290
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.getInfoForIntentsByContext ? 'ResolverUnavailable' : error.message;
291
- throw new Error(errorToThrow);
292
- }
293
- }
294
- /**
295
- * Raises a specific intent for resolution against apps registered with the desktop agent.
296
- * @param intent Name of the Intent
297
- * @param context Context associated with the Intent
298
- * @param app
299
- *
300
- * @tutorial fdc3v2.raiseIntent
301
- */
302
- async raiseIntent(intent, context, app) {
303
- this.wire.sendAction('fdc3-raise-intent').catch((e) => {
304
- // we do not want to expose this error, just continue if this analytics-only call fails
305
- });
306
- try {
307
- if (typeof app === 'string') {
308
- console.warn('Passing a string as the app parameter is deprecated, please use an AppIdentifier ({ appId: string; instanceId?: string }).');
309
- }
310
- return (0, utils_2.getIntentResolution)(this.fin.me.interop, context, app, intent);
311
- }
312
- catch (error) {
313
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.fireIntent ? 'ResolverUnavailable' : error.message;
314
- throw new Error(errorToThrow);
315
- }
316
- }
317
- /**
318
- * Finds and raises an intent against apps registered with the desktop agent based purely on the type of the context data.
319
- * @param context Context associated with the Intent
320
- * @param app
321
- *
322
- * @tutorial fdc3v2.raiseIntentForContext
323
- */
324
- async raiseIntentForContext(context, app) {
325
- // TODO: We have to do the same thing we do for raiseIntent here as well.
326
- this.wire.sendAction('fdc3-raise-intent-for-context').catch((e) => {
327
- // we do not want to expose this error, just continue if this analytics-only call fails
328
- });
329
- try {
330
- if (typeof app === 'string') {
331
- console.warn('Passing a string as the app parameter is deprecated, please use an AppIdentifier ({ appId: string; instanceId?: string }).');
332
- }
333
- return (0, utils_2.getIntentResolution)(this.fin.me.interop, context, app);
334
- }
335
- catch (error) {
336
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.fireIntent ? 'ResolverUnavailable' : error.message;
337
- throw new Error(errorToThrow);
338
- }
339
- }
340
- /**
341
- * Adds a listener for incoming intents.
342
- * @param intent Name of the Intent
343
- * @param 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.
344
- *
345
- * @tutorial fdc3.addIntentListener
346
- */
347
- async addIntentListener(intent, handler) {
348
- this.wire.sendAction('fdc3-add-intent-listener').catch((e) => {
349
- // we do not want to expose this error, just continue if this analytics-only call fails
350
- });
351
- if (typeof intent !== 'string') {
352
- throw new Error('First argument must be an Intent name');
353
- }
354
- // The FDC3 Intenter handler only expects the context and contextMetadata to be passed to the handler,
355
- // so we wrap it here and only pass those paramaters.
356
- const contextHandler = async (raisedIntent) => {
357
- let intentResult;
358
- let intentResultToSend;
359
- const { context, metadata: intentMetadata } = raisedIntent;
360
- const { contextMetadata, metadata, ...rest } = context;
361
- const intentResolutionResultId = (intentMetadata === null || intentMetadata === void 0 ? void 0 : intentMetadata.intentResolutionResultId) || (metadata === null || metadata === void 0 ? void 0 : metadata.intentResolutionResultId);
362
- try {
363
- const newContext = metadata ? { metadata, ...rest } : { ...rest };
364
- intentResult = await handler(newContext, contextMetadata);
365
- intentResultToSend = intentResult;
366
- }
367
- catch (error) {
368
- intentResult = error;
369
- intentResultToSend = { error: true };
370
- }
371
- if (intentResolutionResultId) {
372
- this.fin.InterApplicationBus.publish(intentResolutionResultId, intentResultToSend);
373
- }
374
- if (intentResult instanceof Error) {
375
- throw new Error(intentResult.message);
376
- }
377
- return intentResult;
378
- };
379
- return this.fin.me.interop.registerIntentHandler(contextHandler, intent, { fdc3Version: '2.0' });
380
- }
381
- /**
382
- * Returns a Channel object for the specified channel, creating it as an App Channel if it does not exist.
383
- * @param channelId
384
- *
385
- * @tutorial fdc3.getOrCreateChannel
386
- */
387
- async getOrCreateChannel(channelId) {
388
- return this.fdc3Module.getOrCreateChannel(channelId);
389
- }
390
- /**
391
- * 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.
392
- *
393
- * @tutorial fdc3v2.createPrivateChannel
394
- */
395
- async createPrivateChannel() {
396
- const channelId = (0, utils_1.generateId)();
397
- await InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'createPrivateChannelProvider', { channelId });
398
- const channelClient = await this.fin.InterApplicationBus.Channel.connect(channelId);
399
- const newPrivateChannelClient = new PrivateChannelClient_1.PrivateChannelClient(channelClient, channelId);
400
- return (0, utils_2.buildPrivateChannelObject)(newPrivateChannelClient);
401
- }
402
- /**
403
- * Retrieves a list of the User Channels available for the app to join.
404
- *
405
- * @tutorial fdc3v2.getUserChannels
406
- */
407
- async getUserChannels() {
408
- const channels = await this.fin.me.interop.getContextGroups();
409
- // fdc3 implementation of getUserChannels returns on array of channels, have to decorate over
410
- // this so people know that these APIs are not supported
411
- return channels.map((channel) => {
412
- return { ...channel, type: 'user', ...(0, utils_2.getUnsupportedChannelApis)('User') };
413
- });
414
- }
415
- /**
416
- * Retrieves a list of the User Channels available for the app to join.
417
- *
418
- * @deprecated Please use {@link fdc3.getUserChannels fdc3.getUserChannels} instead
419
- * @tutorial fdc3.getSystemChannels
420
- */
421
- async getSystemChannels() {
422
- console.warn('This API has been deprecated. Please use fdc3.getUserChannels instead.');
423
- return this.fdc3Module.getSystemChannels();
424
- }
425
- /**
426
- * Join an app to a specified User channel.
427
- * @param channelId Channel name
428
- *
429
- * @tutorial fdc3v2.joinUserChannel
430
- */
431
- async joinUserChannel(channelId) {
432
- return this.fdc3Module.joinChannel(channelId);
433
- }
434
- /**
435
- * Join an app to a specified User channel.
436
- * @param channelId Channel name
437
- * @deprecated Please use {@link fdc3.joinUserChannel fdc3.joinUserChannel} instead
438
- *
439
- * @tutorial fdc3.joinChannel
440
- */
441
- async joinChannel(channelId) {
442
- console.warn('This API has been deprecated. Please use fdc3.joinUserChannel instead.');
443
- return this.fdc3Module.joinChannel(channelId);
444
- }
445
- /**
446
- * Returns the Channel object for the current User channel membership
447
- *
448
- * @tutorial fdc3.getCurrentChannel
449
- */
450
- async getCurrentChannel() {
451
- const currentChannel = await this.fdc3Module.getCurrentChannel();
452
- if (!currentChannel) {
453
- return null;
454
- }
455
- return {
456
- ...currentChannel,
457
- type: 'user',
458
- broadcast: this.broadcast.bind(this)
459
- };
460
- }
461
- /**
462
- * Removes the app from any User channel membership.
463
- *
464
- * @tutorial fdc3.leaveCurrentChannel
465
- */
466
- async leaveCurrentChannel() {
467
- return this.fdc3Module.leaveCurrentChannel();
468
- }
469
- /**
470
- * 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.
471
- * fdc3HandleGetInfo must be overridden in the InteropBroker so that the ImplementationMetadata will have the appMetadata info.
472
- *
473
- * @tutorial fdc3v2.getInfo
474
- */
475
- async getInfo() {
476
- return InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'fdc3v2GetInfo', { fdc3Version: '2.0' });
477
- }
478
- }
479
- 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
- }
@@ -1,4 +0,0 @@
1
- "use strict";
2
- /* eslint-disable import/no-extraneous-dependencies */
3
- /* eslint-disable no-restricted-imports */
4
- Object.defineProperty(exports, "__esModule", { value: true });