@openfin/core 30.73.6 → 30.73.7

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 (158) hide show
  1. package/OpenFin.d.ts +1 -1729
  2. package/fin.d.ts +3 -4
  3. package/package.json +1 -1
  4. package/src/GlobalOpenFin.d.ts +4 -0
  5. package/src/OpenFin.d.ts +2938 -0
  6. package/src/OpenFin.js +4 -0
  7. package/src/api/application/Factory.d.ts +2 -0
  8. package/src/api/application/Factory.js +4 -3
  9. package/src/api/application/Instance.d.ts +3 -1
  10. package/src/api/application/Instance.js +1 -0
  11. package/src/api/application/index.js +7 -3
  12. package/src/api/base.d.ts +19 -15
  13. package/src/api/base.js +20 -22
  14. package/src/api/clipboard/index.d.ts +2 -0
  15. package/src/api/clipboard/index.js +1 -0
  16. package/src/api/events/application.d.ts +66 -56
  17. package/src/api/events/base.d.ts +33 -15
  18. package/src/api/events/channel.d.ts +13 -8
  19. package/src/api/events/eventAggregator.js +1 -9
  20. package/src/api/events/externalApplication.d.ts +10 -5
  21. package/src/api/events/frame.d.ts +13 -7
  22. package/src/api/events/globalHotkey.d.ts +11 -10
  23. package/src/api/events/platform.d.ts +10 -16
  24. package/src/api/events/system.d.ts +48 -18
  25. package/src/api/events/typedEventEmitter.d.ts +20 -0
  26. package/src/api/events/typedEventEmitter.js +2 -0
  27. package/src/api/events/view.d.ts +38 -54
  28. package/src/api/events/webcontents.d.ts +55 -28
  29. package/src/api/events/window.d.ts +148 -134
  30. package/src/api/external-application/Factory.d.ts +1 -0
  31. package/src/api/external-application/Instance.d.ts +2 -1
  32. package/src/api/external-application/index.js +7 -3
  33. package/src/api/fin.d.ts +3 -1
  34. package/src/api/fin.js +2 -2
  35. package/src/api/frame/Factory.d.ts +1 -0
  36. package/src/api/frame/Factory.js +2 -2
  37. package/src/api/frame/Instance.d.ts +3 -1
  38. package/src/api/frame/index.js +7 -3
  39. package/src/api/global-hotkey/index.d.ts +2 -2
  40. package/src/api/global-hotkey/index.js +6 -0
  41. package/src/api/interappbus/channel/channel.d.ts +6 -4
  42. package/src/api/interappbus/channel/channels-docs.d.ts +22 -0
  43. package/src/api/interappbus/channel/channels-docs.js +22 -0
  44. package/src/api/interappbus/channel/client.d.ts +2 -1
  45. package/src/api/interappbus/channel/client.js +24 -26
  46. package/src/api/interappbus/channel/connection-manager.d.ts +1 -0
  47. package/src/api/interappbus/channel/connection-manager.js +30 -28
  48. package/src/api/interappbus/channel/index.d.ts +6 -4
  49. package/src/api/interappbus/channel/index.js +34 -19
  50. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +3 -1
  51. package/src/api/interappbus/channel/protocols/classic/strategy.js +21 -22
  52. package/src/api/interappbus/channel/protocols/index.d.ts +3 -0
  53. package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +1 -1
  54. package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +3 -1
  55. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +25 -27
  56. package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +0 -1
  57. package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +3 -1
  58. package/src/api/interappbus/channel/protocols/rtc/strategy.js +29 -31
  59. package/src/api/interappbus/channel/protocols/strategy.d.ts +3 -1
  60. package/src/api/interappbus/channel/provider.d.ts +8 -4
  61. package/src/api/interappbus/channel/provider.js +140 -139
  62. package/src/api/interappbus/index.js +1 -1
  63. package/src/api/interop/Factory.d.ts +2 -0
  64. package/src/api/interop/Factory.js +20 -2
  65. package/src/api/interop/InteropBroker.d.ts +62 -39
  66. package/src/api/interop/InteropBroker.js +114 -55
  67. package/src/api/interop/InteropClient.d.ts +9 -0
  68. package/src/api/interop/InteropClient.js +46 -40
  69. package/src/api/interop/SessionContextGroupBroker.d.ts +1 -0
  70. package/src/api/interop/SessionContextGroupClient.d.ts +1 -0
  71. package/src/api/interop/SessionContextGroupClient.js +22 -24
  72. package/src/api/interop/fdc3/PrivateChannelClient.d.ts +9 -7
  73. package/src/api/interop/fdc3/PrivateChannelClient.js +6 -6
  74. package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +1 -0
  75. package/src/api/interop/fdc3/fdc3-1.2.d.ts +14 -13
  76. package/src/api/interop/fdc3/fdc3-1.2.js +3 -14
  77. package/src/api/interop/fdc3/fdc3-2.0.d.ts +24 -21
  78. package/src/api/interop/fdc3/fdc3-2.0.js +27 -27
  79. package/src/api/interop/fdc3/fdc3.d.ts +12 -0
  80. package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
  81. package/src/api/interop/fdc3/overrideCheck.js +32 -0
  82. package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +53 -0
  83. package/src/api/interop/fdc3/shapes/fdc3v1.js +4 -0
  84. package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +75 -0
  85. package/src/api/interop/fdc3/shapes/fdc3v2.js +2 -0
  86. package/src/api/interop/fdc3/utils.d.ts +15 -5
  87. package/src/api/interop/fdc3/utils.js +29 -11
  88. package/src/api/interop/fdc3/versions.d.ts +1 -0
  89. package/src/api/interop/fdc3/versions.js +2 -0
  90. package/src/api/interop/index.js +7 -3
  91. package/src/api/interop/utils.d.ts +2 -0
  92. package/src/api/interop/utils.js +29 -15
  93. package/src/api/me.d.ts +3 -1
  94. package/src/api/platform/Factory.d.ts +6 -0
  95. package/src/api/platform/Factory.js +14 -5
  96. package/src/api/platform/Instance.d.ts +18 -3
  97. package/src/api/platform/Instance.js +30 -13
  98. package/src/api/platform/common-utils.d.ts +2 -1
  99. package/src/api/platform/index.js +7 -3
  100. package/src/api/platform/layout/Factory.d.ts +7 -1
  101. package/src/api/platform/layout/Factory.js +22 -20
  102. package/src/api/platform/layout/Instance.d.ts +6 -4
  103. package/src/api/platform/layout/Instance.js +2 -3
  104. package/src/api/platform/layout/controllers/splitter-controller.js +1 -1
  105. package/src/api/platform/layout/controllers/tab-drag-controller.d.ts +1 -0
  106. package/src/api/platform/layout/controllers/tab-drag-controller.js +1 -1
  107. package/src/api/platform/layout/index.js +7 -3
  108. package/src/api/platform/layout/shapes.d.ts +3 -1
  109. package/src/api/platform/layout/utils/bounds-observer.d.ts +1 -1
  110. package/src/api/platform/layout/utils/bounds-observer.js +7 -5
  111. package/src/api/platform/layout/utils/view-overlay.d.ts +1 -0
  112. package/src/api/platform/provider.d.ts +162 -0
  113. package/src/api/platform/provider.js +2 -0
  114. package/src/api/snapshot-source/Factory.d.ts +2 -0
  115. package/src/api/snapshot-source/Factory.js +2 -1
  116. package/src/api/snapshot-source/Instance.d.ts +1 -0
  117. package/src/api/snapshot-source/Instance.js +33 -35
  118. package/src/api/snapshot-source/index.js +7 -3
  119. package/src/api/snapshot-source/utils.d.ts +1 -0
  120. package/src/api/snapshot-source/utils.js +2 -1
  121. package/src/api/system/index.d.ts +76 -16
  122. package/src/api/system/index.js +127 -3
  123. package/src/api/view/Factory.d.ts +1 -0
  124. package/src/api/view/Factory.js +2 -2
  125. package/src/api/view/Instance.d.ts +17 -3
  126. package/src/api/view/Instance.js +20 -0
  127. package/src/api/view/index.js +7 -3
  128. package/src/api/webcontents/main.d.ts +20 -5
  129. package/src/api/webcontents/main.js +10 -0
  130. package/src/api/window/Factory.d.ts +1 -0
  131. package/src/api/window/Factory.js +2 -2
  132. package/src/api/window/Instance.d.ts +26 -3
  133. package/src/api/window/Instance.js +26 -1
  134. package/src/api/window/index.js +7 -3
  135. package/src/browser.d.ts +4 -4
  136. package/src/environment/browser.d.ts +3 -1
  137. package/src/environment/environment.d.ts +3 -1
  138. package/src/environment/node-env.d.ts +3 -1
  139. package/src/environment/node-env.js +2 -2
  140. package/src/environment/openfin-env.d.ts +3 -1
  141. package/src/environment/openfin-env.js +15 -17
  142. package/src/fdc3.d.ts +3 -0
  143. package/src/fdc3.js +1 -1
  144. package/src/mock.d.ts +2 -2
  145. package/src/mock.js +3 -3
  146. package/src/namespaces.d.ts +21 -0
  147. package/src/namespaces.js +24 -0
  148. package/src/shapes/WebOptions.d.ts +1 -0
  149. package/src/shapes/WindowOptions.d.ts +1 -0
  150. package/src/shapes/protocol.d.ts +34 -26
  151. package/src/transport/transport.d.ts +6 -5
  152. package/src/transport/transport.js +26 -28
  153. package/src/transport/wire.d.ts +9 -7
  154. package/src/util/http.d.ts +1 -1
  155. package/src/util/http.js +16 -11
  156. package/src/util/inaccessibleObject.d.ts +2 -0
  157. package/src/util/inaccessibleObject.js +49 -0
  158. package/src/util/normalize-config.js +5 -5
@@ -1,14 +1,18 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
8
12
  }));
9
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
11
- }
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
13
17
  const Factory_1 = require("./Factory");
14
18
  exports.default = Factory_1.default;
package/src/api/fin.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { EventEmitter } from 'events';
3
+ import type * as OpenFin from '../OpenFin';
3
4
  import Transport from '../transport/transport';
4
5
  import System from './system/index';
5
6
  import _WindowModule from './window/index';
@@ -14,7 +15,7 @@ import PlatformModule from './platform/index';
14
15
  import { Me } from './me';
15
16
  import InteropModule from './interop';
16
17
  import SnapshotSourceModule from './snapshot-source';
17
- import EntityType = OpenFin.EntityType;
18
+ declare type EntityType = OpenFin.EntityType;
18
19
  export interface FinApi<MeType extends EntityType> {
19
20
  readonly System: System;
20
21
  readonly Window: _WindowModule;
@@ -47,3 +48,4 @@ export default class Fin<MeType extends EntityType = EntityType> extends EventEm
47
48
  readonly me: Me<MeType>;
48
49
  constructor(wire: Transport<MeType>);
49
50
  }
51
+ export {};
package/src/api/fin.js CHANGED
@@ -19,7 +19,7 @@ const snapshot_source_1 = require("./snapshot-source");
19
19
  class Fin extends events_1.EventEmitter {
20
20
  constructor(wire) {
21
21
  super();
22
- fin_store_1.registerFin(wire, this);
22
+ (0, fin_store_1.registerFin)(wire, this);
23
23
  this.wire = wire;
24
24
  this.System = new index_1.default(wire);
25
25
  this.Window = new index_2.default(wire);
@@ -33,7 +33,7 @@ class Fin extends events_1.EventEmitter {
33
33
  this.View = new index_9.default(wire);
34
34
  this.Interop = new interop_1.default(wire);
35
35
  this.SnapshotSource = new snapshot_source_1.default(wire);
36
- this.me = me_1.getMe(wire);
36
+ this.me = (0, me_1.getMe)(wire);
37
37
  // Handle disconnect events
38
38
  wire.on('disconnected', () => {
39
39
  this.emit('disconnected');
@@ -1,3 +1,4 @@
1
+ import type * as OpenFin from '../../OpenFin';
1
2
  import { Base } from '../base';
2
3
  /**
3
4
  * @lends Frame
@@ -18,7 +18,7 @@ class _FrameModule extends base_1.Base {
18
18
  this.wire.sendAction('frame-wrap').catch((e) => {
19
19
  // we do not want to expose this error, just continue if this analytics-only call fails
20
20
  });
21
- const errorMsg = validate_1.validateIdentity(identity);
21
+ const errorMsg = (0, validate_1.validateIdentity)(identity);
22
22
  if (errorMsg) {
23
23
  throw new Error(errorMsg);
24
24
  }
@@ -35,7 +35,7 @@ class _FrameModule extends base_1.Base {
35
35
  this.wire.sendAction('frame-wrap-sync').catch((e) => {
36
36
  // we do not want to expose this error, just continue if this analytics-only call fails
37
37
  });
38
- const errorMsg = validate_1.validateIdentity(identity);
38
+ const errorMsg = (0, validate_1.validateIdentity)(identity);
39
39
  if (errorMsg) {
40
40
  throw new Error(errorMsg);
41
41
  }
@@ -1,6 +1,7 @@
1
+ import type * as OpenFin from '../../OpenFin';
1
2
  import { EmitterBase } from '../base';
2
3
  import Transport from '../../transport/transport';
3
- import FrameEvents = OpenFin.FrameEvents;
4
+ declare type FrameEvents = OpenFin.FrameEvent;
4
5
  /**
5
6
  * @classdesc
6
7
  * An iframe represents an embedded HTML page within a parent HTML page. Because this embedded page
@@ -119,3 +120,4 @@ export declare class _Frame extends EmitterBase<FrameEvents> {
119
120
  */
120
121
  getParentWindow(): Promise<OpenFin.FrameInfo>;
121
122
  }
123
+ export {};
@@ -1,14 +1,18 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
8
12
  }));
9
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
11
- }
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
13
17
  const Factory_1 = require("./Factory");
14
18
  exports.default = Factory_1.default;
@@ -1,11 +1,11 @@
1
+ import type * as OpenFin from '../../OpenFin';
1
2
  import { EmitterBase } from '../base';
2
3
  import Transport from '../../transport/transport';
3
- import GlobalHotkeyEvents = OpenFin.GlobalHotkeyEvents;
4
4
  /**
5
5
  * The GlobalHotkey module can register/unregister a global hotkeys.
6
6
  * @namespace
7
7
  */
8
- export default class GlobalHotkey extends EmitterBase<GlobalHotkeyEvents> {
8
+ export default class GlobalHotkey extends EmitterBase<OpenFin.GlobalHotkeyEvent> {
9
9
  constructor(wire: Transport);
10
10
  /**
11
11
  * Registers a global hotkey with the operating system.
@@ -17,6 +17,8 @@ class GlobalHotkey extends base_1.EmitterBase {
17
17
  * @tutorial GlobalHotkey.register
18
18
  */
19
19
  async register(hotkey, listener) {
20
+ // TODO: fix typing (hotkey events are not typed)
21
+ // @ts-expect-error
20
22
  await this.on(hotkey, listener);
21
23
  await this.wire.sendAction('global-hotkey-register', { hotkey });
22
24
  return undefined;
@@ -28,6 +30,8 @@ class GlobalHotkey extends base_1.EmitterBase {
28
30
  * @tutorial GlobalHotkey.unregister
29
31
  */
30
32
  async unregister(hotkey) {
33
+ // TODO: fix typing (hotkey events are not typed)
34
+ // @ts-expect-error
31
35
  await this.removeAllListeners(hotkey);
32
36
  await this.wire.sendAction('global-hotkey-unregister', { hotkey });
33
37
  return undefined;
@@ -40,6 +44,8 @@ class GlobalHotkey extends base_1.EmitterBase {
40
44
  async unregisterAll() {
41
45
  await Promise.all(this.eventNames()
42
46
  .filter((name) => !(name === 'registered' || name === 'unregistered'))
47
+ // TODO: fix typing (hotkey events are not typed)
48
+ // @ts-expect-error
43
49
  .map((name) => this.removeAllListeners(name)));
44
50
  await this.wire.sendAction('global-hotkey-unregister-all', {});
45
51
  return undefined;
@@ -1,8 +1,9 @@
1
+ import type * as OpenFin from '../../../OpenFin';
1
2
  import Transport from '../../../transport/transport';
2
- import ProviderIdentity = OpenFin.ProviderIdentity;
3
- import ChannelMiddleware = OpenFin.ChannelMiddleware;
4
- import ErrorMiddleware = OpenFin.ErrorMiddleware;
5
- import ChannelAction = OpenFin.ChannelAction;
3
+ declare type ProviderIdentity = OpenFin.ProviderIdentity;
4
+ declare type ChannelMiddleware = OpenFin.ChannelMiddleware;
5
+ declare type ErrorMiddleware = OpenFin.ErrorMiddleware;
6
+ declare type ChannelAction = OpenFin.ChannelAction;
6
7
  export declare class ProtectedItems {
7
8
  providerIdentity: ProviderIdentity;
8
9
  wire: Transport;
@@ -24,3 +25,4 @@ export declare class ChannelBase {
24
25
  setDefaultAction(func: ChannelMiddleware): void;
25
26
  register(topic: string, listener: ChannelAction): boolean;
26
27
  }
28
+ export {};
@@ -18,6 +18,7 @@ declare const InterApplicationBus: any;
18
18
  * ##### Asynchronous Methods
19
19
  * * {@link Channel#ChannelProvider#destroy destroy()}
20
20
  * * {@link Channel#ChannelProvider#dispatch dispatch(to, action, payload)}
21
+ * * {@link Channel#ChannelProvider#getAllClientInfo getAllClientInfo()}
21
22
  *
22
23
  * ##### Middleware
23
24
  * Middleware functions receive the following arguments: (action, payload, senderId).
@@ -131,6 +132,11 @@ declare class ChannelProvider {
131
132
  * @tutorial ChannelMiddleware.setDefaultAction
132
133
  */
133
134
  setDefaultAction(): void;
135
+ /** Returns an array with info on every Client connected to the Provider
136
+ * @returns { Promise<Array<ClientInfo>> }
137
+ * @tutorial Channel.getAllClientInfo
138
+ */
139
+ getAllClientInfo(): void;
134
140
  }
135
141
  /**
136
142
  * Instance created to enable use of a channel as a client. Allows for communication with the
@@ -272,6 +278,7 @@ declare class ChannelClient {
272
278
  * @param {any} payload - Payload sent with connection request.
273
279
  */
274
280
  /**
281
+ * @REMOVED
275
282
  * Callback for onChannelConnect or onChannelDisconnect.
276
283
  * @typedef {object} InterApplicationBus.Channel~ConnectionEvent
277
284
  * @property {string} channelId - Identifier of the channel.
@@ -280,17 +287,20 @@ declare class ChannelClient {
280
287
  * @property {string} channelName - Name of the channel.
281
288
  */
282
289
  /**
290
+ * @PORTED
283
291
  * Protocol values for determining channel messaging strategy.
284
292
  * @typedef {('classic' | 'rtc')} InterApplicationBus.Channel~MessagingProtocols - EXPERIMENTAL
285
293
  *
286
294
  */
287
295
  /**
296
+ * @PORTED
288
297
  * Channel provider creation options.
289
298
  * @typedef {object} InterApplicationBus.Channel~ChannelCreateOptions
290
299
  * @property {InterApplicationBus.Channel~MessagingProtocols[]} [protocols=['classic']] - EXPERIMENTAL: Messaging protocols supported by the channel provider.
291
300
  *
292
301
  */
293
302
  /**
303
+ * @PORTED
294
304
  * Options provided on a client connection to a channel.
295
305
  * @typedef {object} InterApplicationBus.Channel~ChannelConnectOptions
296
306
  * @property {InterApplicationBus.Channel~MessagingProtocols[]} [protocols=['classic']] - EXPERIMENTAL: Messaging protocols requested by the client, connection will fail if the provider protocols are not compatible.
@@ -299,6 +309,7 @@ declare class ChannelClient {
299
309
  *
300
310
  */
301
311
  /**
312
+ * @PORTED
302
313
  * Provider Identity.
303
314
  * @typedef {object} InterApplicationBus.Channel~ProviderIdentity
304
315
  * @property {string} uuid - Channel provider uuid.
@@ -309,6 +320,7 @@ declare class ChannelClient {
309
320
  *
310
321
  */
311
322
  /**
323
+ * @PORTED
312
324
  * Client Identity.
313
325
  * @typedef {object} InterApplicationBus.Channel~ClientIdentity
314
326
  * @property {string} uuid - Channel client uuid.
@@ -316,3 +328,13 @@ declare class ChannelClient {
316
328
  * @property {string} endpointId - Unique identifier for a client, because there can be multiple clients at one name/uuid entity.
317
329
  *
318
330
  */
331
+ /**
332
+ * @PORTED
333
+ * Extended Client Information
334
+ * @typedef {object} InterApplicationBus.Channel~ClientInfo
335
+ * @property {string} uuid - Channel client uuid
336
+ * @property {string} name - Channel client name
337
+ * @property {string} endpointId - Unique identifier for a client, because there can be multiple clients at one name/uuid entity.
338
+ * @property {string} entityType - Indicates if the client belongs to a Window or View
339
+ * @property {string} connectionUrl - URL of the View or Window at the time of connection to the Channel Provider.
340
+ */
@@ -76,6 +76,7 @@ InterApplicationBus.Channel.onChannelDisconnect = function () { };
76
76
  * ##### Asynchronous Methods
77
77
  * * {@link Channel#ChannelProvider#destroy destroy()}
78
78
  * * {@link Channel#ChannelProvider#dispatch dispatch(to, action, payload)}
79
+ * * {@link Channel#ChannelProvider#getAllClientInfo getAllClientInfo()}
79
80
  *
80
81
  * ##### Middleware
81
82
  * Middleware functions receive the following arguments: (action, payload, senderId).
@@ -189,6 +190,11 @@ class ChannelProvider {
189
190
  * @tutorial ChannelMiddleware.setDefaultAction
190
191
  */
191
192
  setDefaultAction() { }
193
+ /** Returns an array with info on every Client connected to the Provider
194
+ * @returns { Promise<Array<ClientInfo>> }
195
+ * @tutorial Channel.getAllClientInfo
196
+ */
197
+ getAllClientInfo() { }
192
198
  }
193
199
  /**
194
200
  * Instance created to enable use of a channel as a client. Allows for communication with the
@@ -330,6 +336,7 @@ class ChannelClient {
330
336
  * @param {any} payload - Payload sent with connection request.
331
337
  */
332
338
  /**
339
+ * @REMOVED
333
340
  * Callback for onChannelConnect or onChannelDisconnect.
334
341
  * @typedef {object} InterApplicationBus.Channel~ConnectionEvent
335
342
  * @property {string} channelId - Identifier of the channel.
@@ -338,17 +345,20 @@ class ChannelClient {
338
345
  * @property {string} channelName - Name of the channel.
339
346
  */
340
347
  /**
348
+ * @PORTED
341
349
  * Protocol values for determining channel messaging strategy.
342
350
  * @typedef {('classic' | 'rtc')} InterApplicationBus.Channel~MessagingProtocols - EXPERIMENTAL
343
351
  *
344
352
  */
345
353
  /**
354
+ * @PORTED
346
355
  * Channel provider creation options.
347
356
  * @typedef {object} InterApplicationBus.Channel~ChannelCreateOptions
348
357
  * @property {InterApplicationBus.Channel~MessagingProtocols[]} [protocols=['classic']] - EXPERIMENTAL: Messaging protocols supported by the channel provider.
349
358
  *
350
359
  */
351
360
  /**
361
+ * @PORTED
352
362
  * Options provided on a client connection to a channel.
353
363
  * @typedef {object} InterApplicationBus.Channel~ChannelConnectOptions
354
364
  * @property {InterApplicationBus.Channel~MessagingProtocols[]} [protocols=['classic']] - EXPERIMENTAL: Messaging protocols requested by the client, connection will fail if the provider protocols are not compatible.
@@ -357,6 +367,7 @@ class ChannelClient {
357
367
  *
358
368
  */
359
369
  /**
370
+ * @PORTED
360
371
  * Provider Identity.
361
372
  * @typedef {object} InterApplicationBus.Channel~ProviderIdentity
362
373
  * @property {string} uuid - Channel provider uuid.
@@ -367,6 +378,7 @@ class ChannelClient {
367
378
  *
368
379
  */
369
380
  /**
381
+ * @PORTED
370
382
  * Client Identity.
371
383
  * @typedef {object} InterApplicationBus.Channel~ClientIdentity
372
384
  * @property {string} uuid - Channel client uuid.
@@ -374,3 +386,13 @@ class ChannelClient {
374
386
  * @property {string} endpointId - Unique identifier for a client, because there can be multiple clients at one name/uuid entity.
375
387
  *
376
388
  */
389
+ /**
390
+ * @PORTED
391
+ * Extended Client Information
392
+ * @typedef {object} InterApplicationBus.Channel~ClientInfo
393
+ * @property {string} uuid - Channel client uuid
394
+ * @property {string} name - Channel client name
395
+ * @property {string} endpointId - Unique identifier for a client, because there can be multiple clients at one name/uuid entity.
396
+ * @property {string} entityType - Indicates if the client belongs to a Window or View
397
+ * @property {string} connectionUrl - URL of the View or Window at the time of connection to the Channel Provider.
398
+ */
@@ -1,7 +1,8 @@
1
+ import type * as OpenFin from '../../../OpenFin';
1
2
  import { ChannelBase } from './channel';
2
3
  import Transport from '../../../transport/transport';
3
4
  import { AnyStrategy } from './protocols/strategy-types';
4
- import ProviderIdentity = OpenFin.ProviderIdentity;
5
+ declare type ProviderIdentity = OpenFin.ProviderIdentity;
5
6
  declare type DisconnectionListener = (providerIdentity: ProviderIdentity) => any;
6
7
  interface RoutingInfo extends ProviderIdentity {
7
8
  endpointId: string;
@@ -1,57 +1,55 @@
1
1
  "use strict";
2
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
3
- if (!privateMap.has(receiver)) {
4
- throw new TypeError("attempted to set private field on non-instance");
5
- }
6
- privateMap.set(receiver, value);
7
- return value;
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
8
7
  };
9
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
10
- if (!privateMap.has(receiver)) {
11
- throw new TypeError("attempted to get private field on non-instance");
12
- }
13
- return privateMap.get(receiver);
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
14
12
  };
15
- var _protectedObj, _strategy, _close;
13
+ var _ChannelClient_protectedObj, _ChannelClient_strategy, _ChannelClient_close;
16
14
  Object.defineProperty(exports, "__esModule", { value: true });
17
15
  const channel_1 = require("./channel");
18
16
  const channelClientsByEndpointId = new Map();
19
17
  class ChannelClient extends channel_1.ChannelBase {
20
18
  constructor(routingInfo, wire, strategy) {
21
19
  super();
22
- _protectedObj.set(this, void 0);
23
- _strategy.set(this, void 0);
20
+ _ChannelClient_protectedObj.set(this, void 0);
21
+ _ChannelClient_strategy.set(this, void 0);
24
22
  // needs to be bound;
25
23
  this.processAction = (action, payload, senderIdentity) => super.processAction(action, payload, senderIdentity);
26
- _close.set(this, () => {
24
+ _ChannelClient_close.set(this, () => {
27
25
  channelClientsByEndpointId.delete(this.endpointId);
28
- __classPrivateFieldGet(this, _strategy).close();
26
+ __classPrivateFieldGet(this, _ChannelClient_strategy, "f").close();
29
27
  });
30
- __classPrivateFieldSet(this, _protectedObj, new channel_1.ProtectedItems(routingInfo, wire));
28
+ __classPrivateFieldSet(this, _ChannelClient_protectedObj, new channel_1.ProtectedItems(routingInfo, wire), "f");
31
29
  this.disconnectListener = () => undefined;
32
30
  this.endpointId = routingInfo.endpointId;
33
- __classPrivateFieldSet(this, _strategy, strategy);
31
+ __classPrivateFieldSet(this, _ChannelClient_strategy, strategy, "f");
34
32
  channelClientsByEndpointId.set(this.endpointId, this);
35
33
  strategy.receive(this.processAction);
36
34
  }
37
35
  static closeChannelByEndpointId(id) {
38
36
  const channel = channelClientsByEndpointId.get(id);
39
37
  if (channel) {
40
- __classPrivateFieldGet(channel, _close).call(channel);
38
+ __classPrivateFieldGet(channel, _ChannelClient_close, "f").call(channel);
41
39
  }
42
40
  }
43
41
  // closes the channel and invokes the disconnect listener if an event payload is passed.
44
42
  static handleProviderDisconnect(channel, eventPayload) {
45
43
  channel.disconnectListener(eventPayload);
46
- __classPrivateFieldGet(channel, _close).call(channel);
44
+ __classPrivateFieldGet(channel, _ChannelClient_close, "f").call(channel);
47
45
  }
48
46
  get providerIdentity() {
49
- const protectedObj = __classPrivateFieldGet(this, _protectedObj);
47
+ const protectedObj = __classPrivateFieldGet(this, _ChannelClient_protectedObj, "f");
50
48
  return protectedObj.providerIdentity;
51
49
  }
52
50
  async dispatch(action, payload) {
53
- if (__classPrivateFieldGet(this, _strategy).isEndpointConnected(this.providerIdentity.channelId)) {
54
- return __classPrivateFieldGet(this, _strategy).send(this.providerIdentity.channelId, action, payload);
51
+ if (__classPrivateFieldGet(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
52
+ return __classPrivateFieldGet(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload);
55
53
  }
56
54
  throw new Error('The client you are trying to dispatch from is disconnected from the target provider.');
57
55
  }
@@ -69,7 +67,7 @@ class ChannelClient extends channel_1.ChannelBase {
69
67
  };
70
68
  }
71
69
  async disconnect() {
72
- const protectedObj = __classPrivateFieldGet(this, _protectedObj);
70
+ const protectedObj = __classPrivateFieldGet(this, _ChannelClient_protectedObj, "f");
73
71
  const { channelName, uuid, name } = protectedObj.providerIdentity;
74
72
  await protectedObj.wire.sendAction('disconnect-from-channel', {
75
73
  channelName,
@@ -77,8 +75,8 @@ class ChannelClient extends channel_1.ChannelBase {
77
75
  name,
78
76
  endpointId: this.endpointId
79
77
  });
80
- __classPrivateFieldGet(this, _close).call(this);
78
+ __classPrivateFieldGet(this, _ChannelClient_close, "f").call(this);
81
79
  }
82
80
  }
83
81
  exports.default = ChannelClient;
84
- _protectedObj = new WeakMap(), _strategy = new WeakMap(), _close = new WeakMap();
82
+ _ChannelClient_protectedObj = new WeakMap(), _ChannelClient_strategy = new WeakMap(), _ChannelClient_close = new WeakMap();
@@ -1,3 +1,4 @@
1
+ import type * as OpenFin from '../../../OpenFin';
1
2
  import { ChannelMessage } from '.';
2
3
  import Transport from '../../../transport/transport';
3
4
  import { Base } from '../../base';
@@ -1,18 +1,16 @@
1
1
  "use strict";
2
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
3
- if (!privateMap.has(receiver)) {
4
- throw new TypeError("attempted to set private field on non-instance");
5
- }
6
- privateMap.set(receiver, value);
7
- return value;
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
8
7
  };
9
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
10
- if (!privateMap.has(receiver)) {
11
- throw new TypeError("attempted to get private field on non-instance");
12
- }
13
- return privateMap.get(receiver);
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
14
12
  };
15
- var _messageReceiver, _rtcConnectionManager;
13
+ var _ConnectionManager_messageReceiver, _ConnectionManager_rtcConnectionManager;
16
14
  Object.defineProperty(exports, "__esModule", { value: true });
17
15
  exports.ConnectionManager = void 0;
18
16
  const exhaustive_1 = require("../../../util/exhaustive");
@@ -27,8 +25,8 @@ const strategy_3 = require("./protocols/combined/strategy");
27
25
  class ConnectionManager extends base_1.Base {
28
26
  constructor(wire) {
29
27
  super(wire);
30
- _messageReceiver.set(this, void 0);
31
- _rtcConnectionManager.set(this, void 0);
28
+ _ConnectionManager_messageReceiver.set(this, void 0);
29
+ _ConnectionManager_rtcConnectionManager.set(this, void 0);
32
30
  this.removeChannelFromProviderMap = (channelId) => {
33
31
  this.providerMap.delete(channelId);
34
32
  };
@@ -41,19 +39,19 @@ class ConnectionManager extends base_1.Base {
41
39
  };
42
40
  this.providerMap = new Map();
43
41
  this.protocolManager = new protocol_manager_1.ProtocolManager(this.isNodeEnvironment() ? ['classic'] : ['rtc', 'classic']);
44
- __classPrivateFieldSet(this, _messageReceiver, new message_receiver_1.MessageReceiver(wire));
45
- __classPrivateFieldSet(this, _rtcConnectionManager, new ice_manager_1.RTCICEManager(wire));
42
+ __classPrivateFieldSet(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
43
+ __classPrivateFieldSet(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
46
44
  wire.registerMessageHandler(this.onmessage.bind(this));
47
45
  }
48
46
  static getProtocolOptionsFromStrings(protocols) {
49
- return protocols.map(protocol => {
47
+ return protocols.map((protocol) => {
50
48
  switch (protocol) {
51
49
  case 'rtc':
52
50
  return strategy_2.RTCInfo;
53
51
  case 'classic':
54
52
  return strategy_1.ClassicInfo;
55
53
  default:
56
- return exhaustive_1.exhaustiveCheck(protocol, ['rtc', 'classic']);
54
+ return (0, exhaustive_1.exhaustiveCheck)(protocol, ['rtc', 'classic']);
57
55
  }
58
56
  });
59
57
  }
@@ -65,11 +63,11 @@ class ConnectionManager extends base_1.Base {
65
63
  case 'rtc':
66
64
  return new strategy_2.RTCStrategy();
67
65
  case 'classic':
68
- return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet(this, _messageReceiver),
66
+ return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet(this, _ConnectionManager_messageReceiver, "f"),
69
67
  // Providers do not have an endpointId, use channelId as endpointId in the strategy.
70
68
  providerIdentity.channelId, providerIdentity);
71
69
  default:
72
- return exhaustive_1.exhaustiveCheck(stratType, ['rtc', 'classic']);
70
+ return (0, exhaustive_1.exhaustiveCheck)(stratType, ['rtc', 'classic']);
73
71
  }
74
72
  };
75
73
  const strategies = protocols.map(createSingleStrategy);
@@ -87,7 +85,11 @@ class ConnectionManager extends base_1.Base {
87
85
  }
88
86
  const channel = new provider_1.ChannelProvider(providerIdentity, this.wire, strategy);
89
87
  const key = providerIdentity.channelId;
90
- this.providerMap.set(key, { provider: channel, strategy, supportedProtocols: ConnectionManager.getProtocolOptionsFromStrings(protocols) });
88
+ this.providerMap.set(key, {
89
+ provider: channel,
90
+ strategy,
91
+ supportedProtocols: ConnectionManager.getProtocolOptionsFromStrings(protocols)
92
+ });
91
93
  provider_1.ChannelProvider.setProviderRemoval(channel, this.removeChannelFromProviderMap.bind(this));
92
94
  return channel;
93
95
  }
@@ -97,7 +99,7 @@ class ConnectionManager extends base_1.Base {
97
99
  const supportedProtocols = await Promise.all(protocols.map(async (type) => {
98
100
  switch (type) {
99
101
  case 'rtc': {
100
- const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet(this, _rtcConnectionManager).startClientOffer();
102
+ const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
101
103
  rtcPacket = { rtcClient, channels, channelsOpened };
102
104
  return {
103
105
  type: 'rtc',
@@ -108,7 +110,7 @@ class ConnectionManager extends base_1.Base {
108
110
  case 'classic':
109
111
  return { type: 'classic', version: strategy_1.ClassicInfo.version };
110
112
  default:
111
- return exhaustive_1.exhaustiveCheck(type, ['rtc', 'classic']);
113
+ return (0, exhaustive_1.exhaustiveCheck)(type, ['rtc', 'classic']);
112
114
  }
113
115
  }));
114
116
  return {
@@ -125,18 +127,18 @@ class ConnectionManager extends base_1.Base {
125
127
  routingInfo.endpointId = this.wire.environment.getNextMessageId();
126
128
  // For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
127
129
  // clients that are in the same context as the newly-connected client.
128
- __classPrivateFieldGet(this, _messageReceiver).checkForPreviousClientConnection(routingInfo.channelId);
130
+ __classPrivateFieldGet(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
129
131
  }
130
132
  const answer = (_a = routingInfo.answer) !== null && _a !== void 0 ? _a : {
131
133
  supportedProtocols: [{ type: 'classic', version: 1 }]
132
134
  };
133
135
  const createStrategyFromAnswer = async (protocol) => {
134
136
  if (protocol.type === 'rtc' && rtcPacket) {
135
- await __classPrivateFieldGet(this, _rtcConnectionManager).finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
137
+ await __classPrivateFieldGet(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
136
138
  return new strategy_2.RTCStrategy();
137
139
  }
138
140
  if (protocol.type === 'classic') {
139
- return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet(this, _messageReceiver), routingInfo.endpointId, routingInfo);
141
+ return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
140
142
  }
141
143
  return null;
142
144
  };
@@ -204,7 +206,7 @@ class ConnectionManager extends base_1.Base {
204
206
  clientAnswer = await overlappingProtocols.reduce(async (accumP, protocolToUse) => {
205
207
  const answer = await accumP;
206
208
  if (protocolToUse.type === 'rtc') {
207
- const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet(this, _rtcConnectionManager).createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
209
+ const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
208
210
  answer.supportedProtocols.push({
209
211
  type: 'rtc',
210
212
  version: strategy_2.RTCInfo.version,
@@ -241,4 +243,4 @@ class ConnectionManager extends base_1.Base {
241
243
  }
242
244
  }
243
245
  exports.ConnectionManager = ConnectionManager;
244
- _messageReceiver = new WeakMap(), _rtcConnectionManager = new WeakMap();
246
+ _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnectionManager = new WeakMap();
@@ -1,17 +1,18 @@
1
+ import type * as OpenFin from '../../../OpenFin';
1
2
  import ChannelClient from './client';
2
3
  import { ChannelProvider } from './provider';
3
4
  import { EmitterBase } from '../../base';
4
5
  import Transport, { Message } from '../../../transport/transport';
5
- import { ChannelEvents } from '../../events/channel';
6
- import ProviderIdentity = OpenFin.ProviderIdentity;
7
- import Identity = OpenFin.Identity;
6
+ import { ChannelEvent } from '../../events/channel';
7
+ declare type ProviderIdentity = OpenFin.ProviderIdentity;
8
+ declare type Identity = OpenFin.Identity;
8
9
  export interface ChannelMessage extends Message<any> {
9
10
  senderIdentity: Identity;
10
11
  ackToSender: any;
11
12
  providerIdentity: ProviderIdentity;
12
13
  connectAction: boolean;
13
14
  }
14
- export declare class Channel extends EmitterBase<ChannelEvents> {
15
+ export declare class Channel extends EmitterBase<ChannelEvent> {
15
16
  #private;
16
17
  constructor(wire: Transport);
17
18
  getAllChannels(): Promise<ProviderIdentity[]>;
@@ -20,3 +21,4 @@ export declare class Channel extends EmitterBase<ChannelEvents> {
20
21
  connect(channelName: string, options?: OpenFin.ChannelConnectOptions): Promise<ChannelClient>;
21
22
  create(channelName: string, options?: OpenFin.ChannelCreateOptions): Promise<ChannelProvider>;
22
23
  }
24
+ export {};