@openfin/core 30.73.28 → 31.74.5

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 (80) hide show
  1. package/LICENSE.md +4 -0
  2. package/package.json +2 -2
  3. package/src/OpenFin.d.ts +1664 -173
  4. package/src/api/application/Factory.d.ts +1 -0
  5. package/src/api/application/Factory.js +1 -0
  6. package/src/api/application/Instance.d.ts +2 -1
  7. package/src/api/application/Instance.js +1 -0
  8. package/src/api/base.d.ts +2 -2
  9. package/src/api/clipboard/index.d.ts +1 -0
  10. package/src/api/clipboard/index.js +1 -0
  11. package/src/api/events/platform.d.ts +4 -5
  12. package/src/api/events/system.d.ts +5 -6
  13. package/src/api/events/webcontents.d.ts +23 -3
  14. package/src/api/external-application/Instance.d.ts +1 -1
  15. package/src/api/fin.d.ts +1 -1
  16. package/src/api/frame/Instance.d.ts +1 -1
  17. package/src/api/global-hotkey/index.d.ts +1 -1
  18. package/src/api/interappbus/channel/channel.d.ts +1 -1
  19. package/src/api/interappbus/channel/channels-docs.d.ts +7 -0
  20. package/src/api/interappbus/channel/channels-docs.js +7 -0
  21. package/src/api/interappbus/channel/client.d.ts +3 -2
  22. package/src/api/interappbus/channel/client.js +12 -5
  23. package/src/api/interappbus/channel/connection-manager.d.ts +1 -1
  24. package/src/api/interappbus/channel/index.d.ts +1 -1
  25. package/src/api/interappbus/channel/index.js +5 -7
  26. package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +1 -1
  27. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +1 -1
  28. package/src/api/interappbus/channel/protocols/index.d.ts +3 -0
  29. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +10 -2
  30. package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +1 -1
  31. package/src/api/interappbus/channel/protocols/rtc/strategy.js +1 -1
  32. package/src/api/interappbus/channel/provider.d.ts +1 -1
  33. package/src/api/interappbus/index.d.ts +1 -1
  34. package/src/api/interop/Factory.d.ts +1 -2
  35. package/src/api/interop/Factory.js +20 -4
  36. package/src/api/interop/InteropBroker.d.ts +15 -47
  37. package/src/api/interop/InteropBroker.js +32 -46
  38. package/src/api/interop/InteropClient.d.ts +10 -9
  39. package/src/api/interop/InteropClient.js +9 -8
  40. package/src/api/interop/SessionContextGroupClient.d.ts +1 -1
  41. package/src/api/interop/fdc3/fdc3-1.2.js +8 -8
  42. package/src/api/interop/fdc3/fdc3-2.0.d.ts +2 -2
  43. package/src/api/interop/fdc3/fdc3-2.0.js +15 -7
  44. package/src/api/interop/fdc3/fdc3.d.ts +4 -5
  45. package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
  46. package/src/api/interop/fdc3/overrideCheck.js +32 -0
  47. package/src/api/interop/fdc3/versions.d.ts +1 -0
  48. package/src/api/interop/fdc3/versions.js +2 -0
  49. package/src/api/me.d.ts +1 -1
  50. package/src/api/platform/Factory.d.ts +6 -1
  51. package/src/api/platform/Factory.js +5 -0
  52. package/src/api/platform/Instance.d.ts +4 -2
  53. package/src/api/platform/Instance.js +4 -2
  54. package/src/api/platform/layout/Factory.d.ts +4 -0
  55. package/src/api/platform/layout/Factory.js +4 -0
  56. package/src/api/platform/layout/Instance.d.ts +1 -1
  57. package/src/api/platform/layout/utils/view-overlay.d.ts +1 -1
  58. package/src/api/platform/provider.d.ts +162 -0
  59. package/src/api/platform/provider.js +2 -0
  60. package/src/api/snapshot-source/Factory.d.ts +1 -0
  61. package/src/api/snapshot-source/Factory.js +1 -0
  62. package/src/api/snapshot-source/Instance.d.ts +1 -1
  63. package/src/api/system/index.d.ts +1 -471
  64. package/src/api/system/index.js +6 -476
  65. package/src/api/view/Instance.d.ts +7 -3
  66. package/src/api/view/Instance.js +7 -4
  67. package/src/api/webcontents/main.d.ts +18 -4
  68. package/src/api/window/Instance.d.ts +21 -1
  69. package/src/api/window/Instance.js +20 -0
  70. package/src/browser.js +1 -1
  71. package/src/mock.js +1 -1
  72. package/src/namespaces.d.ts +21 -0
  73. package/src/namespaces.js +24 -0
  74. package/src/transport/fin_store.d.ts +1 -1
  75. package/src/transport/transport-errors.d.ts +6 -1
  76. package/src/transport/transport-errors.js +1 -2
  77. package/src/transport/transport.d.ts +9 -6
  78. package/src/transport/transport.js +11 -2
  79. package/src/util/inaccessibleObject.d.ts +2 -0
  80. package/src/util/inaccessibleObject.js +49 -0
@@ -1,6 +1,7 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
2
  import { Base } from '../base';
3
3
  /**
4
+ * @PORTED
4
5
  * @typedef {object} ApplicationOptions
5
6
  * @summary Application creation options.
6
7
  * @desc This is the options object required by {@link Application.start Application.start}.
@@ -4,6 +4,7 @@ const base_1 = require("../base");
4
4
  const validate_1 = require("../../util/validate");
5
5
  const Instance_1 = require("./Instance");
6
6
  /**
7
+ * @PORTED
7
8
  * @typedef {object} ApplicationOptions
8
9
  * @summary Application creation options.
9
10
  * @desc This is the options object required by {@link Application.start Application.start}.
@@ -1,6 +1,6 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
2
  import { EmitterBase } from '../base';
3
- import Transport from '../../transport/transport';
3
+ import { Transport } from '../../transport/transport';
4
4
  /**
5
5
  * @classdesc An object representing an application. Allows the developer to create,
6
6
  * execute, show/close an application as well as listen to <a href="tutorial-Application.EventEmitter.html">application events</a>.
@@ -102,6 +102,7 @@ export declare class Application extends EmitterBase<OpenFin.ApplicationEvent> {
102
102
  * @property { JumpListItem[] } items Array of JumpListItem objects
103
103
  */
104
104
  /**
105
+ * @PORTED
105
106
  * JumpListItem interface
106
107
  * @typedef { object } JumpListItem
107
108
  * @property { string } type One of the following: "task" or "separator". Defaults to task.
@@ -119,6 +119,7 @@ class Application extends base_1.EmitterBase {
119
119
  * @property { JumpListItem[] } items Array of JumpListItem objects
120
120
  */
121
121
  /**
122
+ * @PORTED
122
123
  * JumpListItem interface
123
124
  * @typedef { object } JumpListItem
124
125
  * @property { string } type One of the following: "task" or "separator". Defaults to task.
package/src/api/base.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { EventEmitter } from 'events';
3
- import Transport from '../transport/transport';
3
+ import { Transport } from '../transport/transport';
4
4
  import type * as OpenFin from '../OpenFin';
5
5
  import Fin from './fin';
6
6
  import { BaseEvent, EventHandler } from './events/base';
@@ -31,7 +31,7 @@ export declare class EmitterBase<EmitterEvent extends BaseEvent, EmitterEventTyp
31
31
  protected registerEventListener: (eventType: EmitterEventType, options: OpenFin.SubscriptionOptions, applySubscription: (emitter: EventEmitter) => void, undoSubscription: (emitter: EventEmitter) => void) => Promise<void>;
32
32
  protected deregisterEventListener: (eventType: EmitterEventType, options?: OpenFin.SubscriptionOptions) => Promise<void | EventEmitter>;
33
33
  on<EventType extends EmitterEventType>(eventType: EventType, listener: EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions): Promise<this>;
34
- addListener: <EventType extends EmitterEventType>(eventType: EventType, listener: EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions) => Promise<this>;
34
+ addListener: <EventType extends EmitterEventType>(eventType: EventType, listener: OpenFin.BaseEvents.EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions) => Promise<this>;
35
35
  once<EventType extends EmitterEventType>(eventType: EventType, listener: EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions): Promise<this>;
36
36
  prependListener<EventType extends EmitterEventType>(eventType: EventType, listener: EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions): Promise<this>;
37
37
  prependOnceListener<EventType extends EmitterEventType>(eventType: EventType, listener: EventHandler<EmitterEvent, EventType>, options?: OpenFin.SubscriptionOptions): Promise<this>;
@@ -1,6 +1,7 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
2
  import { Base } from '../base';
3
3
  /**
4
+ * @PORTED
4
5
  * WriteRequestType interface
5
6
  * @typedef { object } WriteRequestType
6
7
  * @property { string } data Data to be written
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const base_1 = require("../base");
4
4
  /**
5
+ * @PORTED
5
6
  * WriteRequestType interface
6
7
  * @typedef { object } WriteRequestType
7
8
  * @property { string } data Data to be written
@@ -1,12 +1,11 @@
1
+ import { ApplicationEvent } from './application';
1
2
  import { BaseEvent } from './base';
2
- import { PropagatedViewEvent } from './view';
3
- import { PropagatedWindowEvent } from './window';
4
3
  export declare type PlatformApiReadyEvent = BaseEvent & {
4
+ topic: 'application';
5
5
  type: 'platform-api-ready';
6
6
  };
7
7
  export declare type PlatformSnapshotAppliedEvent = BaseEvent & {
8
+ topic: 'application';
8
9
  type: 'platform-snapshot-applied';
9
10
  };
10
- export declare type PlatformEvent = {
11
- topic: 'platform';
12
- } & (PropagatedWindowEvent | PropagatedViewEvent | PlatformApiReadyEvent | PlatformSnapshotAppliedEvent);
11
+ export declare type PlatformEvent = ApplicationEvent | PlatformApiReadyEvent | PlatformSnapshotAppliedEvent;
@@ -4,12 +4,12 @@ import { BaseEvent } from './base';
4
4
  import { PropagatedViewEvent } from './view';
5
5
  import { PropagatedWindowEvent } from './window';
6
6
  import { AppVersionCompleteEvent, AppVersionErrorEvent, AppVersionProgressEvent, AppVersionRuntimeStatusEvent } from '../../OpenFin';
7
- declare type NotRequested<EventType> = EventType extends `${infer U}-requested` ? never : EventType;
8
- declare type ExcludeRequested<Event extends {
7
+ export declare type NotRequested<EventType> = EventType extends `${infer U}-requested` ? never : EventType;
8
+ export declare type ExcludeRequested<Event extends {
9
9
  type: string;
10
- }> = Event & {
10
+ }> = Extract<Event, {
11
11
  type: NotRequested<Event['type']>;
12
- };
12
+ }>;
13
13
  export declare type IdleEvent = {
14
14
  type: 'idle-state-changed';
15
15
  elapsedTime: number;
@@ -46,6 +46,5 @@ export declare type DesktopIconClickedEvent = BaseEvent & {
46
46
  };
47
47
  export declare type SystemEvent = {
48
48
  topic: 'system';
49
- } & (ExcludeRequested<PropagatedWindowEvent> | ExcludeRequested<PropagatedViewEvent> | PropagatedApplicationEvent | ApplicationCreatedEvent | DesktopIconClickedEvent | IdleEvent | MonitorEvent | SessionChangedEvent | AppVersionEventWithId);
49
+ } & (ExcludeRequested<PropagatedWindowEvent> | PropagatedViewEvent | PropagatedApplicationEvent | ApplicationCreatedEvent | DesktopIconClickedEvent | IdleEvent | MonitorEvent | SessionChangedEvent | AppVersionEventWithId);
50
50
  export declare type SystemEventType = SystemEvent['type'];
51
- export {};
@@ -1,13 +1,15 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
2
  import { NamedEvent } from './base';
3
3
  import { CrashedEvent } from './application';
4
- export declare type ResourceLoadFailedEvent = NamedEvent & {
5
- type: 'resource-load-failed';
4
+ declare type BaseLoadFailedEvent = NamedEvent & {
6
5
  errorCode: number;
7
6
  errorDescription: string;
8
7
  validatedURL: string;
9
8
  isMainFrame: boolean;
10
9
  };
10
+ export declare type ResourceLoadFailedEvent = BaseLoadFailedEvent & {
11
+ type: 'resource-load-failed';
12
+ };
11
13
  export declare type ResourceResponseReceivedEvent = NamedEvent & {
12
14
  type: 'response-received';
13
15
  status: boolean;
@@ -43,6 +45,23 @@ export declare type NavigationRejectedEvent = NamedEvent & {
43
45
  sourceName?: string;
44
46
  url: string;
45
47
  };
48
+ declare type BaseUrlEvent = NamedEvent & {
49
+ type: 'url-changed';
50
+ url: string;
51
+ };
52
+ export declare type UrlChangedEvent = BaseUrlEvent & ({
53
+ isInPage: true;
54
+ } | {
55
+ isInPage: false;
56
+ httpResponseCode: number;
57
+ httpStatusText: string;
58
+ });
59
+ export declare type DidFinishLoadEvent = NamedEvent & {
60
+ type: 'did-finish-load';
61
+ };
62
+ export declare type DidFailLoadEvent = BaseLoadFailedEvent & {
63
+ type: 'did-fail-load';
64
+ };
46
65
  export declare type FoundInPageEvent = NamedEvent & {
47
66
  type: 'found-in-page';
48
67
  };
@@ -71,5 +90,6 @@ export declare type ChildViewCreatedEvent = NamedEvent & {
71
90
  /**
72
91
  * A WebContents event that does propagate to (republish on) parent topics.
73
92
  */
74
- export declare type WillPropagateWebContentsEvent = BlurredEvent | CertificateSelectionShownEvent | CrashedEvent | DidChangeThemeColorEvent | FocusedEvent | NavigationRejectedEvent | FaviconUpdatedEvent | PageTitleUpdatedEvent | ResourceLoadFailedEvent | ResourceResponseReceivedEvent | ChildContentBlockedEvent | ChildContentOpenedInBrowserEvent | ChildViewCreatedEvent;
93
+ export declare type WillPropagateWebContentsEvent = BlurredEvent | CertificateSelectionShownEvent | CrashedEvent | DidChangeThemeColorEvent | FocusedEvent | NavigationRejectedEvent | UrlChangedEvent | DidFailLoadEvent | DidFinishLoadEvent | FaviconUpdatedEvent | PageTitleUpdatedEvent | ResourceLoadFailedEvent | ResourceResponseReceivedEvent | ChildContentBlockedEvent | ChildContentOpenedInBrowserEvent | ChildViewCreatedEvent;
75
94
  export declare type WebContentsEvent = NonPropagatedWebContentsEvent | WillPropagateWebContentsEvent;
95
+ export {};
@@ -1,6 +1,6 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
2
  import { EmitterBase } from '../base';
3
- import Transport from '../../transport/transport';
3
+ import { Transport } from '../../transport/transport';
4
4
  /**
5
5
  * @classdesc An ExternalApplication object representing native language adapter connections to the runtime. Allows
6
6
  * the developer to listen to <a href="tutorial-ExternalApplication.EventEmitter.html">application events.</a>
package/src/api/fin.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { EventEmitter } from 'events';
3
3
  import type * as OpenFin from '../OpenFin';
4
- import Transport from '../transport/transport';
4
+ import { Transport } from '../transport/transport';
5
5
  import System from './system/index';
6
6
  import _WindowModule from './window/index';
7
7
  import ApplicationModule from './application/index';
@@ -1,6 +1,6 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
2
  import { EmitterBase } from '../base';
3
- import Transport from '../../transport/transport';
3
+ import { Transport } from '../../transport/transport';
4
4
  declare type FrameEvents = OpenFin.FrameEvent;
5
5
  /**
6
6
  * @classdesc
@@ -1,6 +1,6 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
2
  import { EmitterBase } from '../base';
3
- import Transport from '../../transport/transport';
3
+ import { Transport } from '../../transport/transport';
4
4
  /**
5
5
  * The GlobalHotkey module can register/unregister a global hotkeys.
6
6
  * @namespace
@@ -1,5 +1,5 @@
1
1
  import type * as OpenFin from '../../../OpenFin';
2
- import Transport from '../../../transport/transport';
2
+ import { Transport } from '../../../transport/transport';
3
3
  declare type ProviderIdentity = OpenFin.ProviderIdentity;
4
4
  declare type ChannelMiddleware = OpenFin.ChannelMiddleware;
5
5
  declare type ErrorMiddleware = OpenFin.ErrorMiddleware;
@@ -278,6 +278,7 @@ declare class ChannelClient {
278
278
  * @param {any} payload - Payload sent with connection request.
279
279
  */
280
280
  /**
281
+ * @REMOVED
281
282
  * Callback for onChannelConnect or onChannelDisconnect.
282
283
  * @typedef {object} InterApplicationBus.Channel~ConnectionEvent
283
284
  * @property {string} channelId - Identifier of the channel.
@@ -286,17 +287,20 @@ declare class ChannelClient {
286
287
  * @property {string} channelName - Name of the channel.
287
288
  */
288
289
  /**
290
+ * @PORTED
289
291
  * Protocol values for determining channel messaging strategy.
290
292
  * @typedef {('classic' | 'rtc')} InterApplicationBus.Channel~MessagingProtocols - EXPERIMENTAL
291
293
  *
292
294
  */
293
295
  /**
296
+ * @PORTED
294
297
  * Channel provider creation options.
295
298
  * @typedef {object} InterApplicationBus.Channel~ChannelCreateOptions
296
299
  * @property {InterApplicationBus.Channel~MessagingProtocols[]} [protocols=['classic']] - EXPERIMENTAL: Messaging protocols supported by the channel provider.
297
300
  *
298
301
  */
299
302
  /**
303
+ * @PORTED
300
304
  * Options provided on a client connection to a channel.
301
305
  * @typedef {object} InterApplicationBus.Channel~ChannelConnectOptions
302
306
  * @property {InterApplicationBus.Channel~MessagingProtocols[]} [protocols=['classic']] - EXPERIMENTAL: Messaging protocols requested by the client, connection will fail if the provider protocols are not compatible.
@@ -305,6 +309,7 @@ declare class ChannelClient {
305
309
  *
306
310
  */
307
311
  /**
312
+ * @PORTED
308
313
  * Provider Identity.
309
314
  * @typedef {object} InterApplicationBus.Channel~ProviderIdentity
310
315
  * @property {string} uuid - Channel provider uuid.
@@ -315,6 +320,7 @@ declare class ChannelClient {
315
320
  *
316
321
  */
317
322
  /**
323
+ * @PORTED
318
324
  * Client Identity.
319
325
  * @typedef {object} InterApplicationBus.Channel~ClientIdentity
320
326
  * @property {string} uuid - Channel client uuid.
@@ -323,6 +329,7 @@ declare class ChannelClient {
323
329
  *
324
330
  */
325
331
  /**
332
+ * @PORTED
326
333
  * Extended Client Information
327
334
  * @typedef {object} InterApplicationBus.Channel~ClientInfo
328
335
  * @property {string} uuid - Channel client uuid
@@ -336,6 +336,7 @@ class ChannelClient {
336
336
  * @param {any} payload - Payload sent with connection request.
337
337
  */
338
338
  /**
339
+ * @REMOVED
339
340
  * Callback for onChannelConnect or onChannelDisconnect.
340
341
  * @typedef {object} InterApplicationBus.Channel~ConnectionEvent
341
342
  * @property {string} channelId - Identifier of the channel.
@@ -344,17 +345,20 @@ class ChannelClient {
344
345
  * @property {string} channelName - Name of the channel.
345
346
  */
346
347
  /**
348
+ * @PORTED
347
349
  * Protocol values for determining channel messaging strategy.
348
350
  * @typedef {('classic' | 'rtc')} InterApplicationBus.Channel~MessagingProtocols - EXPERIMENTAL
349
351
  *
350
352
  */
351
353
  /**
354
+ * @PORTED
352
355
  * Channel provider creation options.
353
356
  * @typedef {object} InterApplicationBus.Channel~ChannelCreateOptions
354
357
  * @property {InterApplicationBus.Channel~MessagingProtocols[]} [protocols=['classic']] - EXPERIMENTAL: Messaging protocols supported by the channel provider.
355
358
  *
356
359
  */
357
360
  /**
361
+ * @PORTED
358
362
  * Options provided on a client connection to a channel.
359
363
  * @typedef {object} InterApplicationBus.Channel~ChannelConnectOptions
360
364
  * @property {InterApplicationBus.Channel~MessagingProtocols[]} [protocols=['classic']] - EXPERIMENTAL: Messaging protocols requested by the client, connection will fail if the provider protocols are not compatible.
@@ -363,6 +367,7 @@ class ChannelClient {
363
367
  *
364
368
  */
365
369
  /**
370
+ * @PORTED
366
371
  * Provider Identity.
367
372
  * @typedef {object} InterApplicationBus.Channel~ProviderIdentity
368
373
  * @property {string} uuid - Channel provider uuid.
@@ -373,6 +378,7 @@ class ChannelClient {
373
378
  *
374
379
  */
375
380
  /**
381
+ * @PORTED
376
382
  * Client Identity.
377
383
  * @typedef {object} InterApplicationBus.Channel~ClientIdentity
378
384
  * @property {string} uuid - Channel client uuid.
@@ -381,6 +387,7 @@ class ChannelClient {
381
387
  *
382
388
  */
383
389
  /**
390
+ * @PORTED
384
391
  * Extended Client Information
385
392
  * @typedef {object} InterApplicationBus.Channel~ClientInfo
386
393
  * @property {string} uuid - Channel client uuid
@@ -1,6 +1,6 @@
1
1
  import type * as OpenFin from '../../../OpenFin';
2
2
  import { ChannelBase } from './channel';
3
- import Transport from '../../../transport/transport';
3
+ import { Transport } from '../../../transport/transport';
4
4
  import { AnyStrategy } from './protocols/strategy-types';
5
5
  declare type ProviderIdentity = OpenFin.ProviderIdentity;
6
6
  declare type DisconnectionListener = (providerIdentity: ProviderIdentity) => any;
@@ -12,12 +12,13 @@ export default class ChannelClient extends ChannelBase {
12
12
  private disconnectListener;
13
13
  private endpointId;
14
14
  static closeChannelByEndpointId(id: string): void;
15
- static handleProviderDisconnect(channel: ChannelClient, eventPayload: ProviderIdentity): void;
15
+ static handleProviderDisconnect(eventPayload: ProviderIdentity): void;
16
16
  constructor(routingInfo: RoutingInfo, wire: Transport, strategy: AnyStrategy);
17
17
  protected processAction: (action: string, payload: any, senderIdentity: ProviderIdentity | OpenFin.ClientIdentity) => Promise<any>;
18
18
  get providerIdentity(): ProviderIdentity;
19
19
  dispatch(action: string, payload?: any): Promise<any>;
20
20
  onDisconnection(listener: DisconnectionListener): void;
21
21
  disconnect(): Promise<void>;
22
+ sendDisconnectAction(): Promise<void>;
22
23
  }
23
24
  export {};
@@ -38,10 +38,14 @@ class ChannelClient extends channel_1.ChannelBase {
38
38
  __classPrivateFieldGet(channel, _ChannelClient_close, "f").call(channel);
39
39
  }
40
40
  }
41
- // closes the channel and invokes the disconnect listener if an event payload is passed.
42
- static handleProviderDisconnect(channel, eventPayload) {
43
- channel.disconnectListener(eventPayload);
44
- __classPrivateFieldGet(channel, _ChannelClient_close, "f").call(channel);
41
+ // closes the corresponding channel and invokes the disconnect listener if an event payload is passed.
42
+ static handleProviderDisconnect(eventPayload) {
43
+ for (const channelClient of channelClientsByEndpointId.values()) {
44
+ if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
45
+ channelClient.disconnectListener(eventPayload);
46
+ __classPrivateFieldGet(channelClient, _ChannelClient_close, "f").call(channelClient);
47
+ }
48
+ }
45
49
  }
46
50
  get providerIdentity() {
47
51
  const protectedObj = __classPrivateFieldGet(this, _ChannelClient_protectedObj, "f");
@@ -67,6 +71,10 @@ class ChannelClient extends channel_1.ChannelBase {
67
71
  };
68
72
  }
69
73
  async disconnect() {
74
+ await this.sendDisconnectAction();
75
+ __classPrivateFieldGet(this, _ChannelClient_close, "f").call(this);
76
+ }
77
+ async sendDisconnectAction() {
70
78
  const protectedObj = __classPrivateFieldGet(this, _ChannelClient_protectedObj, "f");
71
79
  const { channelName, uuid, name } = protectedObj.providerIdentity;
72
80
  await protectedObj.wire.sendAction('disconnect-from-channel', {
@@ -75,7 +83,6 @@ class ChannelClient extends channel_1.ChannelBase {
75
83
  name,
76
84
  endpointId: this.endpointId
77
85
  });
78
- __classPrivateFieldGet(this, _ChannelClient_close, "f").call(this);
79
86
  }
80
87
  }
81
88
  exports.default = ChannelClient;
@@ -1,6 +1,6 @@
1
1
  import type * as OpenFin from '../../../OpenFin';
2
2
  import { ChannelMessage } from '.';
3
- import Transport from '../../../transport/transport';
3
+ import { Transport } from '../../../transport/transport';
4
4
  import { Base } from '../../base';
5
5
  import { ClientOffer, LocalSupportedProtocol } from './protocols/index';
6
6
  import { RTCPacket } from './protocols/rtc/endpoint';
@@ -2,7 +2,7 @@ import type * as OpenFin from '../../../OpenFin';
2
2
  import ChannelClient from './client';
3
3
  import { ChannelProvider } from './provider';
4
4
  import { EmitterBase } from '../../base';
5
- import Transport, { Message } from '../../../transport/transport';
5
+ import { Transport, Message } from '../../../transport/transport';
6
6
  import { ChannelEvent } from '../../events/channel';
7
7
  declare type ProviderIdentity = OpenFin.ProviderIdentity;
8
8
  declare type Identity = OpenFin.Identity;
@@ -25,6 +25,9 @@ class Channel extends base_1.EmitterBase {
25
25
  super(wire, 'channel');
26
26
  _Channel_connectionManager.set(this, void 0);
27
27
  __classPrivateFieldSet(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
28
+ this.on('disconnected', (eventPayload) => {
29
+ client_1.default.handleProviderDisconnect(eventPayload);
30
+ }).catch((e) => console.error('Error setting up a disconnected listener:', e));
28
31
  }
29
32
  async getAllChannels() {
30
33
  return this.wire.sendAction('get-all-channels').then(({ payload }) => payload.data);
@@ -83,18 +86,13 @@ class Channel extends base_1.EmitterBase {
83
86
  // The provider does not care about endpoint disconnection.
84
87
  strategy.onEndpointDisconnect(routingInfo.channelId, async () => {
85
88
  try {
86
- await channel.disconnect();
89
+ await channel.sendDisconnectAction();
87
90
  }
88
91
  catch (error) {
89
92
  console.warn(`Something went wrong during disconnect for client with uuid: ${routingInfo.uuid} / name: ${routingInfo.name} / endpointId: ${routingInfo.endpointId}.`);
90
93
  }
91
94
  finally {
92
- client_1.default.handleProviderDisconnect(channel, routingInfo);
93
- }
94
- });
95
- this.on('disconnected', (eventPayload) => {
96
- if (eventPayload.channelName === channelName) {
97
- client_1.default.handleProviderDisconnect(channel, eventPayload);
95
+ client_1.default.handleProviderDisconnect(routingInfo);
98
96
  }
99
97
  });
100
98
  return channel;
@@ -1,4 +1,4 @@
1
- import Transport from '../../../../../transport/transport';
1
+ import { Transport } from '../../../../../transport/transport';
2
2
  import { Base } from '../../../../base';
3
3
  import { ChannelBase } from '../../channel';
4
4
  export declare class MessageReceiver extends Base {
@@ -1,5 +1,5 @@
1
1
  import type * as OpenFin from '../../../../../OpenFin';
2
- import Transport from '../../../../../transport/transport';
2
+ import { Transport } from '../../../../../transport/transport';
3
3
  import { MessageReceiver } from './message-receiver';
4
4
  import { ChannelStrategy, EndpointPayload } from '../strategy';
5
5
  import { LocalSupportedProtocol } from '..';
@@ -15,6 +15,9 @@ export interface RTCProtocolOffer extends ProtocolPacketBase {
15
15
  };
16
16
  }
17
17
  export declare type ProtocolOffer = ClassicProtocolOffer | RTCProtocolOffer;
18
+ /**
19
+ * Protocol values for determining channel messaging strategy.
20
+ */
18
21
  export declare type MessagingProtocols = ProtocolOffer['type'];
19
22
  export declare type LocalSupportedProtocol = {
20
23
  type: MessagingProtocols;
@@ -51,7 +51,11 @@ class RTCEndpoint {
51
51
  };
52
52
  this.rtc.channels.response.addEventListener('message', (e) => {
53
53
  var _a;
54
- const { messageId, payload, success, error } = JSON.parse(e.data);
54
+ let { data } = e;
55
+ if (e.data instanceof ArrayBuffer) {
56
+ data = new TextDecoder().decode(e.data);
57
+ }
58
+ const { messageId, payload, success, error } = JSON.parse(data);
55
59
  const { resolve, reject } = (_a = this.responseMap.get(messageId)) !== null && _a !== void 0 ? _a : {};
56
60
  if (resolve && reject) {
57
61
  this.responseMap.delete(messageId);
@@ -68,7 +72,11 @@ class RTCEndpoint {
68
72
  }
69
73
  });
70
74
  this.rtc.channels.request.addEventListener('message', async (e) => {
71
- const { messageId, action, payload } = JSON.parse(e.data);
75
+ let { data } = e;
76
+ if (e.data instanceof ArrayBuffer) {
77
+ data = new TextDecoder().decode(e.data);
78
+ }
79
+ const { messageId, action, payload } = JSON.parse(data);
72
80
  if (__classPrivateFieldGet(this, _RTCEndpoint_processAction, "f")) {
73
81
  try {
74
82
  const res = await __classPrivateFieldGet(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
@@ -1,4 +1,4 @@
1
- import Transport from '../../../../../transport/transport';
1
+ import { Transport } from '../../../../../transport/transport';
2
2
  import { EmitterBase } from '../../../../base';
3
3
  import { RTCEndpointChannels } from './endpoint';
4
4
  export declare class RTCICEManager extends EmitterBase<any> {
@@ -82,4 +82,4 @@ class RTCStrategy {
82
82
  }
83
83
  exports.RTCStrategy = RTCStrategy;
84
84
  _RTCStrategy_processAction = new WeakMap(), _RTCStrategy_rtcEndpointMap = new WeakMap(), _RTCStrategy_connected = new WeakMap();
85
- exports.RTCInfo = { version: 1, minimumVersion: 0, type: 'rtc' };
85
+ exports.RTCInfo = { version: 2, minimumVersion: 0, type: 'rtc' };
@@ -1,6 +1,6 @@
1
1
  import type * as OpenFin from '../../../OpenFin';
2
2
  import { ChannelBase } from './channel';
3
- import Transport from '../../../transport/transport';
3
+ import { Transport } from '../../../transport/transport';
4
4
  import { AnyStrategy } from './protocols/strategy-types';
5
5
  declare type ProviderIdentity = OpenFin.ProviderIdentity;
6
6
  declare type ClientIdentity = OpenFin.ClientIdentity;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { EventEmitter } from 'events';
3
3
  import { Base } from '../base';
4
- import Transport, { Message } from '../../transport/transport';
4
+ import { Transport, Message } from '../../transport/transport';
5
5
  import { Channel } from './channel/index';
6
6
  /**
7
7
  * A messaging bus that allows for pub/sub messaging between different applications.
@@ -3,6 +3,7 @@ import { Base } from '../base';
3
3
  import { InteropBroker } from './InteropBroker';
4
4
  import { InteropClient } from './InteropClient';
5
5
  /**
6
+ * @PORTED
6
7
  * @typedef { object } InteropConfig
7
8
  * @summary Information relevant to the Interop Broker.
8
9
  * @property {string} [currentContextGroup] Context Group for the client. (green, yellow, red, etc.)
@@ -20,7 +21,6 @@ export default class InteropModule extends Base {
20
21
  * @param { OverrideCallback<InteropBroker> } [override] - A callback function that can be used to extend or replace default Interop Broker behavior.
21
22
  * @return {Promise.<InteropBroker>}
22
23
  * @tutorial Interop.init
23
- * @experimental
24
24
  * @static
25
25
  */
26
26
  init(name: string, override?: OpenFin.OverrideCallback<InteropBroker>): Promise<InteropBroker>;
@@ -31,7 +31,6 @@ export default class InteropModule extends Base {
31
31
  * what context(s) the entity wants to subscribe to, and the current Context Group of the entity.
32
32
  * @return {InteropClient}
33
33
  * @tutorial Interop.connectSync
34
- * @experimental
35
34
  * @static
36
35
  */
37
36
  connectSync(name: string, interopConfig?: OpenFin.InteropConfig): InteropClient;
@@ -1,10 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const lodash_1 = require("lodash");
4
+ const inaccessibleObject_1 = require("../../util/inaccessibleObject");
3
5
  const base_1 = require("../base");
4
6
  const InteropBroker_1 = require("./InteropBroker");
5
7
  const InteropClient_1 = require("./InteropClient");
6
- const defaultOverride = (Class, ...args) => new Class(...args);
8
+ const overrideCheck_1 = require("./fdc3/overrideCheck");
9
+ const defaultOverride = (Class) => new Class();
10
+ const BrokerParamAccessError = 'You have attempted to use or modify InteropBroker parameters, which is not allowed. You are likely using an older InteropBroker override scheme. Please consult our Interop docs for guidance on migrating to the new override scheme.';
7
11
  /**
12
+ * @PORTED
8
13
  * @typedef { object } InteropConfig
9
14
  * @summary Information relevant to the Interop Broker.
10
15
  * @property {string} [currentContextGroup] Context Group for the client. (green, yellow, red, etc.)
@@ -22,15 +27,18 @@ class InteropModule extends base_1.Base {
22
27
  * @param { OverrideCallback<InteropBroker> } [override] - A callback function that can be used to extend or replace default Interop Broker behavior.
23
28
  * @return {Promise.<InteropBroker>}
24
29
  * @tutorial Interop.init
25
- * @experimental
26
30
  * @static
27
31
  */
28
32
  async init(name, override = defaultOverride) {
33
+ var _a;
29
34
  this.wire.sendAction('interop-init').catch((e) => {
30
35
  // don't expose, analytics-only call
31
36
  });
32
37
  // Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
33
38
  const options = await this.fin.Application.getCurrentSync().getInfo();
39
+ const opts = (_a = options.initialOptions.interopBrokerConfiguration) !== null && _a !== void 0 ? _a : {};
40
+ const objectThatThrows = (0, inaccessibleObject_1.createUnusableObject)(BrokerParamAccessError);
41
+ const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (0, lodash_1.cloneDeep)(opts));
34
42
  let provider;
35
43
  const getProvider = () => {
36
44
  if (!provider) {
@@ -38,7 +46,16 @@ class InteropModule extends base_1.Base {
38
46
  }
39
47
  return provider;
40
48
  };
41
- return override(InteropBroker_1.InteropBroker, this.wire, getProvider, options.initialOptions.interopBrokerConfiguration);
49
+ const throwingGetProvider = async () => {
50
+ // eslint-disable-next-line no-console
51
+ throw new Error(BrokerParamAccessError);
52
+ };
53
+ const OverrideableBroker = InteropBroker_1.InteropBroker.createClosedConstructor(this.wire, getProvider, opts);
54
+ // We need to use these objects because removing them entirely would be a breaking change and we want an informative error
55
+ // @ts-expect-error
56
+ const broker = await override(OverrideableBroker, objectThatThrows, throwingGetProvider, warningOptsClone);
57
+ (0, overrideCheck_1.overrideCheck)(broker, (0, overrideCheck_1.getDefaultViewFdc3VersionFromAppInfo)(options));
58
+ return broker;
42
59
  }
43
60
  /**
44
61
  * Connects a client to an Interop broker. This is called under-the-hood for Views in a Platform.
@@ -47,7 +64,6 @@ class InteropModule extends base_1.Base {
47
64
  * what context(s) the entity wants to subscribe to, and the current Context Group of the entity.
48
65
  * @return {InteropClient}
49
66
  * @tutorial Interop.connectSync
50
- * @experimental
51
67
  * @static
52
68
  */
53
69
  connectSync(name, interopConfig) {