@openfin/core 30.73.28 → 30.74.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 (127) hide show
  1. package/LICENSE.md +4 -0
  2. package/package.json +2 -2
  3. package/src/OpenFin.d.ts +1726 -189
  4. package/src/OpenFin.js +3 -2
  5. package/src/api/api-exposer/api-consumer.d.ts +28 -0
  6. package/src/api/api-exposer/api-consumer.js +28 -0
  7. package/src/api/api-exposer/api-exposer.d.ts +35 -0
  8. package/src/api/api-exposer/api-exposer.js +38 -0
  9. package/src/api/api-exposer/decorators.d.ts +10 -0
  10. package/src/api/api-exposer/decorators.js +18 -0
  11. package/src/api/api-exposer/index.d.ts +4 -0
  12. package/src/api/api-exposer/index.js +20 -0
  13. package/src/api/api-exposer/strategies/index.d.ts +1 -0
  14. package/src/api/api-exposer/strategies/index.js +17 -0
  15. package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.d.ts +14 -0
  16. package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.js +20 -0
  17. package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.d.ts +20 -0
  18. package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.js +23 -0
  19. package/src/api/api-exposer/strategies/openfin-channels/index.d.ts +2 -0
  20. package/src/api/api-exposer/strategies/openfin-channels/index.js +18 -0
  21. package/src/api/application/Factory.d.ts +1 -0
  22. package/src/api/application/Factory.js +1 -0
  23. package/src/api/application/Instance.d.ts +2 -1
  24. package/src/api/application/Instance.js +1 -0
  25. package/src/api/base.d.ts +2 -2
  26. package/src/api/clipboard/index.d.ts +1 -0
  27. package/src/api/clipboard/index.js +1 -0
  28. package/src/api/events/base.d.ts +0 -3
  29. package/src/api/events/platform.d.ts +4 -5
  30. package/src/api/events/system.d.ts +5 -6
  31. package/src/api/events/view.d.ts +6 -3
  32. package/src/api/events/webcontents.d.ts +25 -3
  33. package/src/api/events/window.d.ts +21 -13
  34. package/src/api/external-application/Instance.d.ts +1 -1
  35. package/src/api/fin.d.ts +1 -1
  36. package/src/api/frame/Instance.d.ts +1 -1
  37. package/src/api/global-hotkey/index.d.ts +1 -1
  38. package/src/api/interappbus/channel/channel.d.ts +1 -1
  39. package/src/api/interappbus/channel/channels-docs.d.ts +7 -0
  40. package/src/api/interappbus/channel/channels-docs.js +7 -0
  41. package/src/api/interappbus/channel/client.d.ts +3 -2
  42. package/src/api/interappbus/channel/client.js +12 -5
  43. package/src/api/interappbus/channel/connection-manager.d.ts +1 -1
  44. package/src/api/interappbus/channel/index.d.ts +1 -1
  45. package/src/api/interappbus/channel/index.js +6 -8
  46. package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +1 -1
  47. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +1 -1
  48. package/src/api/interappbus/channel/protocols/index.d.ts +3 -0
  49. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +10 -2
  50. package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +1 -1
  51. package/src/api/interappbus/channel/protocols/rtc/strategy.js +1 -1
  52. package/src/api/interappbus/channel/provider.d.ts +1 -1
  53. package/src/api/interappbus/index.d.ts +1 -1
  54. package/src/api/interop/Factory.d.ts +1 -2
  55. package/src/api/interop/Factory.js +20 -4
  56. package/src/api/interop/InteropBroker.d.ts +15 -47
  57. package/src/api/interop/InteropBroker.js +38 -46
  58. package/src/api/interop/InteropClient.d.ts +10 -9
  59. package/src/api/interop/InteropClient.js +9 -8
  60. package/src/api/interop/SessionContextGroupClient.d.ts +1 -1
  61. package/src/api/interop/fdc3/PrivateChannelClient.d.ts +1 -0
  62. package/src/api/interop/fdc3/PrivateChannelClient.js +15 -7
  63. package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +15 -1
  64. package/src/api/interop/fdc3/PrivateChannelProvider.js +80 -21
  65. package/src/api/interop/fdc3/fdc3-1.2.js +27 -12
  66. package/src/api/interop/fdc3/fdc3-2.0.d.ts +13 -12
  67. package/src/api/interop/fdc3/fdc3-2.0.js +33 -26
  68. package/src/api/interop/fdc3/fdc3.d.ts +4 -5
  69. package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
  70. package/src/api/interop/fdc3/overrideCheck.js +32 -0
  71. package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +1 -1
  72. package/src/api/interop/fdc3/utils.d.ts +17 -0
  73. package/src/api/interop/fdc3/utils.js +52 -18
  74. package/src/api/interop/fdc3/versions.d.ts +1 -0
  75. package/src/api/interop/fdc3/versions.js +2 -0
  76. package/src/api/me.d.ts +1 -1
  77. package/src/api/platform/Factory.d.ts +6 -1
  78. package/src/api/platform/Factory.js +5 -0
  79. package/src/api/platform/Instance.d.ts +5 -3
  80. package/src/api/platform/Instance.js +5 -3
  81. package/src/api/platform/layout/Factory.d.ts +4 -0
  82. package/src/api/platform/layout/Factory.js +15 -3
  83. package/src/api/platform/layout/Instance.d.ts +7 -1
  84. package/src/api/platform/layout/Instance.js +26 -1
  85. package/src/api/platform/layout/controllers/layout-content-cache.d.ts +9 -0
  86. package/src/api/platform/layout/controllers/layout-content-cache.js +54 -0
  87. package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +117 -0
  88. package/src/api/platform/layout/controllers/layout-entities-controller.js +270 -0
  89. package/src/api/platform/layout/entities/layout-entities.d.ts +144 -0
  90. package/src/api/platform/layout/entities/layout-entities.js +216 -0
  91. package/src/api/platform/layout/entities/shapes.d.ts +6 -0
  92. package/src/api/platform/layout/entities/shapes.js +2 -0
  93. package/src/api/platform/layout/layout.constants.d.ts +1 -0
  94. package/src/api/platform/layout/layout.constants.js +4 -0
  95. package/src/api/platform/layout/shapes.d.ts +3 -0
  96. package/src/api/platform/layout/utils/layout-traversal.d.ts +4 -0
  97. package/src/api/platform/layout/utils/layout-traversal.js +65 -0
  98. package/src/api/platform/layout/utils/view-overlay.d.ts +1 -1
  99. package/src/api/platform/provider.d.ts +162 -0
  100. package/src/api/platform/provider.js +2 -0
  101. package/src/api/snapshot-source/Factory.d.ts +1 -0
  102. package/src/api/snapshot-source/Factory.js +1 -0
  103. package/src/api/snapshot-source/Instance.d.ts +1 -1
  104. package/src/api/system/index.d.ts +1 -471
  105. package/src/api/system/index.js +6 -476
  106. package/src/api/view/Instance.d.ts +24 -5
  107. package/src/api/view/Instance.js +53 -8
  108. package/src/api/webcontents/main.d.ts +18 -4
  109. package/src/api/window/Instance.d.ts +26 -1
  110. package/src/api/window/Instance.js +25 -0
  111. package/src/browser.js +1 -1
  112. package/src/mock.js +1 -1
  113. package/src/namespaces.d.ts +21 -0
  114. package/src/namespaces.js +24 -0
  115. package/src/transport/fin_store.d.ts +1 -1
  116. package/src/transport/transport-errors.d.ts +6 -1
  117. package/src/transport/transport-errors.js +1 -2
  118. package/src/transport/transport.d.ts +9 -6
  119. package/src/transport/transport.js +11 -2
  120. package/src/util/channel-api-relay.d.ts +13 -0
  121. package/src/util/channel-api-relay.js +37 -0
  122. package/src/util/inaccessibleObject.d.ts +2 -0
  123. package/src/util/inaccessibleObject.js +49 -0
  124. package/src/util/lazy.d.ts +16 -0
  125. package/src/util/lazy.js +26 -0
  126. package/src/util/reversible-map.d.ts +11 -0
  127. package/src/util/reversible-map.js +49 -0
@@ -4,6 +4,8 @@ exports.InteropBroker = void 0;
4
4
  const base_1 = require("../base");
5
5
  const SessionContextGroupBroker_1 = require("./SessionContextGroupBroker");
6
6
  const utils_1 = require("./utils");
7
+ const lodash_1 = require("lodash");
8
+ const PrivateChannelProvider_1 = require("./fdc3/PrivateChannelProvider");
7
9
  let contextGroups = [
8
10
  {
9
11
  id: 'green',
@@ -49,7 +51,7 @@ let contextGroups = [
49
51
  }
50
52
  ];
51
53
  /**
52
- * {@link https://developers.openfin.co/of-docs/docs/enable-color-linking **THE INTEROP API IS EXPERIMENTAL. IF YOU WOULD LIKE TO USE IT, PLEASE USE OUR DEFAULT IMPLEMENTATION IN BROWSER**}
54
+ * {@link https://developers.openfin.co/of-docs/docs/enable-color-linking}
53
55
  *
54
56
  * The Interop Broker is responsible for keeping track of the Interop state of the Platform, and for directing messages to the proper locations.
55
57
  *
@@ -147,7 +149,7 @@ let contextGroups = [
147
149
  * };
148
150
  * return new Override();
149
151
  * },
150
- * interopOverride: async (InteropBroker, provider, options, ...args) => {
152
+ * interopOverride: async (InteropBroker) => {
151
153
  * class Override extends InteropBroker {
152
154
  * async joinContextGroup(channelName = 'default', target) {
153
155
  * console.log('before super joinContextGroup')
@@ -156,37 +158,7 @@ let contextGroups = [
156
158
  * }
157
159
  * }
158
160
  *
159
- * options.contextGroups = [
160
- * {
161
- * id: 'green',
162
- * displayMetadata: {
163
- * color: '#00CC88',
164
- * name: 'green'
165
- * }
166
- * },
167
- * {
168
- * id: 'purple',
169
- * displayMetadata: {
170
- * color: '#8C61FF',
171
- * name: 'purple'
172
- * }
173
- * },
174
- * {
175
- * id: 'orange',
176
- * displayMetadata: {
177
- * color: '#FF8C4C',
178
- * name: 'orange'
179
- * }
180
- * },
181
- * {
182
- * id: 'red',
183
- * displayMetadata: {
184
- * color: '#FF5E60',
185
- * name: 'red'
186
- * }
187
- * }
188
- * ];
189
- * return new Override(provider, options, ...args);
161
+ * return new Override();
190
162
  * }
191
163
  * });
192
164
  * ```
@@ -198,6 +170,7 @@ let contextGroups = [
198
170
  */
199
171
  class InteropBroker extends base_1.Base {
200
172
  constructor(wire, getProvider, options) {
173
+ // Tip from Pierre and Michael from the overrideCheck work: Don't use bound methods for overrideable InteropBroker functions.
201
174
  super(wire);
202
175
  this.getProvider = getProvider;
203
176
  this.interopClients = new Map();
@@ -214,46 +187,73 @@ class InteropBroker extends base_1.Base {
214
187
  this.setContextGroupMap();
215
188
  this.setupChannelProvider();
216
189
  }
190
+ static createClosedConstructor(...args) {
191
+ return class OverrideableBroker extends InteropBroker {
192
+ constructor(...unused) {
193
+ if (unused.length) {
194
+ const [_ignore1, ignore2, opts] = unused;
195
+ if (opts && typeof opts === 'object' && !(0, lodash_1.isEqual)(opts, args[2])) {
196
+ // eslint-disable-next-line no-console
197
+ console.warn('You have modified the parameters of the InteropOverride constructor. This behavior is deprecated and will be removed in a future version. You can modify these options in your manifest. Please consult our Interop docs for guidance on migrating to the new override scheme.');
198
+ super(args[0], args[1], opts);
199
+ return;
200
+ }
201
+ // eslint-disable-next-line no-console
202
+ console.warn('You are attempting to pass arguments to the InteropOverride constructor. This is not necessary, and these passed arguments will be ignored. You are likely using an older InteropBroker override scheme. Please consult our Interop docs for guidance on migrating to the new override scheme.');
203
+ }
204
+ super(...args);
205
+ }
206
+ };
207
+ }
217
208
  /*
218
209
  Client API
219
210
  */
220
211
  /**
212
+ * @REMOVED
221
213
  * SetContextOptions interface
222
214
  * @typedef { object } SetContextOptions
223
215
  * @property { Context } {context} - New context to set.
224
216
  */
225
217
  /**
218
+ * @REMOVED
226
219
  * GetContextOptions interface
227
220
  * @typedef { object } GetContextOptions
228
221
  * @property { string } [contextType] - Context Type
229
222
  */
223
+ // TODO: extract inline type and do proper comments
230
224
  /**
225
+ * @REMOVED
231
226
  * JoinContextGroupOptions interface
232
227
  * @typedef { object } JoinContextGroupOptions
233
228
  * @property { string } contextGroupId - Id of the context group.
234
229
  * @property { Identity | ClientIdentity } [target] - Identity of the entity you wish to join to a context group.
235
230
  */
236
231
  /**
232
+ * @REMOVED
237
233
  * AddClientToContextGroupOptions interface
238
234
  * @typedef { object } AddClientToContextGroupOptions
239
235
  * @property { string } contextGroupId - Name of the context group.
240
236
  */
241
237
  /**
238
+ * @REMOVED
242
239
  * RemoveFromContextGroupOptions interface
243
240
  * @typedef { object } RemoveFromContextGroupOptions
244
241
  * @property { Identity | ClientIdentity } target - Identity of the entity you wish to join to a context group.
245
242
  */
246
243
  /**
244
+ * @REMOVED
247
245
  * GetInfoForContextGroupOptions interface
248
246
  * @typedef { object } GetInfoForContextGroupOptions
249
247
  * @property { string } contextGroupId - Name of the context group to get info for.
250
248
  */
251
249
  /**
250
+ * @REMOVED
252
251
  * GetAllClientsInContextGroupOptions interface
253
252
  * @typedef { object } GetAllClientsInContextGroupOptions
254
253
  * @property { string } contextGroupId - Name of the context group to get info for.
255
254
  */
256
255
  /**
256
+ * @PORTED
257
257
  * InfoForIntentOptions interface
258
258
  * @typedef { object } InfoForIntentOptions
259
259
  * @property { string } name Name of the intent to get info for.
@@ -264,7 +264,6 @@ class InteropBroker extends base_1.Base {
264
264
  * @param { SetContextOptions } setContextOptions - New context to set.
265
265
  * @param { ClientIdentity } clientIdentity - Identity of the client sender.
266
266
  * @return { void }
267
- * @experimental
268
267
  */
269
268
  setContext({ context }, clientIdentity) {
270
269
  this.wire.sendAction('interop-broker-set-context').catch((e) => {
@@ -338,7 +337,6 @@ class InteropBroker extends base_1.Base {
338
337
  * @return { Promise<void> }
339
338
  * @param { JoinContextGroupOptions } joinContextGroupOptions - Id of the Context Group and identity of the entity to join to the group.
340
339
  * @param { ClientIdentity } senderIdentity - Identity of the client sender.
341
- * @experimental
342
340
  */
343
341
  async joinContextGroup({ contextGroupId, target }, senderIdentity) {
344
342
  this.wire.sendAction('interop-broker-join-context-group').catch((e) => {
@@ -384,7 +382,6 @@ class InteropBroker extends base_1.Base {
384
382
  * @return { Promise<void> }
385
383
  * @param { AddClientToContextGroupOptions } addClientToContextGroupOptions - Contains the contextGroupId
386
384
  * @param { ClientIdentity } clientIdentity - Identity of the client sender.
387
- * @experimental
388
385
  */
389
386
  async addClientToContextGroup({ contextGroupId }, clientIdentity) {
390
387
  this.wire.sendAction('interop-broker-add-client-to-context-group').catch((e) => {
@@ -428,7 +425,6 @@ class InteropBroker extends base_1.Base {
428
425
  * @return { Promise<void> }
429
426
  * @param { RemoveFromContextGroupOptions } removeFromContextGroupOptions - Contains the target identity to remove.
430
427
  * @param { ClientIdentity } senderIdentity - Identity of the client sender.
431
- * @experimental
432
428
  */
433
429
  async removeFromContextGroup({ target }, senderIdentity) {
434
430
  this.wire.sendAction('interop-broker-remove-from-context-group').catch((e) => {
@@ -469,7 +465,6 @@ class InteropBroker extends base_1.Base {
469
465
  * Used by Platform Windows.
470
466
  * @return { Promise<void> }
471
467
  * @property { ClientIdentity } clientIdentity - Identity of the client sender.
472
- * @experimental
473
468
  */
474
469
  async removeClientFromContextGroup(clientIdentity) {
475
470
  this.wire.sendAction('interop-broker-remove-client-from-context-group').catch((e) => {
@@ -486,7 +481,6 @@ class InteropBroker extends base_1.Base {
486
481
  * Returns the Interop-Broker-defined context groups available for an entity to join. Because this function is used in the rest of the Interop Broker to fetch the Context Groups, overriding this allows you to customize the Context Groups for the Interop Broker. However, we recommend customizing the context groups through configuration instead.
487
482
  * Used by Platform Windows.
488
483
  * @return { Promise<ContextGroupInfo[]>}
489
- * @experimental
490
484
  */
491
485
  // eslint-disable-next-line class-methods-use-this
492
486
  getContextGroups() {
@@ -504,7 +498,6 @@ class InteropBroker extends base_1.Base {
504
498
  * Used by Platform Windows.
505
499
  * @param { GetInfoForContextGroupOptions } getInfoForContextGroupOptions - Contains contextGroupId, the context group you wish to get display info for.
506
500
  * @return { Promise<ContextGroupInfo>}
507
- * @experimental
508
501
  */
509
502
  getInfoForContextGroup({ contextGroupId }) {
510
503
  this.wire.sendAction('interop-broker-get-info-for-context-group').catch((e) => {
@@ -518,7 +511,6 @@ class InteropBroker extends base_1.Base {
518
511
  * Used by Platform Windows.
519
512
  * @param { GetAllClientsInContextGroupOptions } getAllClientsInContextGroupOptions - Contains contextGroupId, the context group you wish to get clients for.
520
513
  * @return { Promise<ClientIdentity[]>}
521
- * @experimental
522
514
  */
523
515
  getAllClientsInContextGroup({ contextGroupId }) {
524
516
  this.wire.sendAction('interop-broker-get-all-clients-in-context-group').catch((e) => {
@@ -538,7 +530,6 @@ class InteropBroker extends base_1.Base {
538
530
  * @param { ClientIdentity } clientIdentity Identity of the Client making the request.
539
531
  * @return { Promise<unknown> }
540
532
  * @tutorial interop.handleFiredIntent
541
- * @experimental
542
533
  */
543
534
  // eslint-disable-next-line class-methods-use-this
544
535
  async handleFiredIntent(intent, clientIdentity) {
@@ -552,7 +543,6 @@ class InteropBroker extends base_1.Base {
552
543
  * @param { Intent } intent The combination of an action and a context that is passed to an application for resolution.
553
544
  * @param { Identity } target - Identity of the target that will handle the intent.
554
545
  * @return { Promise<void> }
555
- * @experimental
556
546
  */
557
547
  async setIntentTarget(intent, target) {
558
548
  this.wire.sendAction('interop-broker-set-intent-target').catch((e) => {
@@ -596,7 +586,6 @@ class InteropBroker extends base_1.Base {
596
586
  * @param { ClientIdentity } clientIdentity Identity of the Client making the request.
597
587
  * @return { Promise<unknown> }
598
588
  * @tutorial interop.handleInfoForIntent
599
- * @experimental
600
589
  */
601
590
  // eslint-disable-next-line class-methods-use-this
602
591
  async handleInfoForIntent(options, clientIdentity) {
@@ -611,7 +600,6 @@ class InteropBroker extends base_1.Base {
611
600
  * @param { ClientIdentity } clientIdentity Identity of the Client making the request.
612
601
  * @return { Promise<unknown> }
613
602
  * @tutorial interop.handleInfoForIntentsByContext
614
- * @experimental
615
603
  */
616
604
  // eslint-disable-next-line class-methods-use-this
617
605
  async handleInfoForIntentsByContext(context, clientIdentity) {
@@ -626,7 +614,6 @@ class InteropBroker extends base_1.Base {
626
614
  * @param { ClientIdentity } clientIdentity Identity of the Client making the request.
627
615
  * @return { Promise<unknown> }
628
616
  * @tutorial interop.handleFiredIntentForContext
629
- * @experimental
630
617
  */
631
618
  // eslint-disable-next-line class-methods-use-this
632
619
  async handleFiredIntentForContext(contextForIntent, clientIdentity) {
@@ -1066,6 +1053,11 @@ class InteropBroker extends base_1.Base {
1066
1053
  channel.register('fdc3v2GetInfo', async (payload, clientIdentity) => {
1067
1054
  return this.fdc3HandleGetInfo.bind(this)(payload, clientIdentity);
1068
1055
  });
1056
+ channel.register('createPrivateChannelProvider', async (payload) => {
1057
+ const { channelId } = payload;
1058
+ const channelProvider = await this.fin.InterApplicationBus.Channel.create(channelId);
1059
+ PrivateChannelProvider_1.PrivateChannelProvider.init(channelProvider, channelId);
1060
+ });
1069
1061
  }
1070
1062
  /**
1071
1063
  * Can be used to completely prevent a connection. Return false to prevent connections. Allows all connections by default.
@@ -1,13 +1,15 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
- import Transport from '../../transport/transport';
2
+ import { Transport } from '../../transport/transport';
3
3
  import { Base } from '../base';
4
4
  /**
5
+ * @PORTED
5
6
  * @typedef { object } Intent
6
7
  * @summary The combination of an action and a context that is passed to an application for resolution.
7
8
  * @property { string } name Name of the intent.
8
9
  * @property { Context } context Data associated with the intent
9
10
  */
10
11
  /**
12
+ * @REMOVED
11
13
  * @typedef { object } Subscription
12
14
  * @summary Object returned when subscribing a handler.
13
15
  * @property { function } unsubscribe Function to unsubscribe the handler.
@@ -21,6 +23,7 @@ import { Base } from '../base';
21
23
  * @summary Subscription function for registerIntentHandler
22
24
  */
23
25
  /**
26
+ * @PORTED
24
27
  * @typedef { object } ClientIdentity
25
28
  * @summary The Identity for a Channel Client. Includes endpointId to differentiate between different connections for an entity.
26
29
  * @property {string} uuid GUID of an application.
@@ -28,12 +31,14 @@ import { Base } from '../base';
28
31
  * @property {string} endpointId Unique differentiator for different Channel connections for an entity.
29
32
  */
30
33
  /**
34
+ * @PORTED
31
35
  * @typedef { object } ContextGroupInfo
32
36
  * @summary Information for a Context Group. Contains metadata for displaying the group properly.
33
37
  * @property {string} id Name of the context group
34
38
  * @property {DisplayMetadata} displayMetadata Metadata for the Context Group. Contains the group's human-readable name, color, and an image, as defined by the Interop Broker.
35
39
  */
36
40
  /**
41
+ * @PORTED
37
42
  * @typedef { object } DisplayMetadata
38
43
  * @summary The display data for a Context Group.
39
44
  * @property {string} name A user-readable name for this context group, e.g: `"Red"`
@@ -41,6 +46,7 @@ import { Base } from '../base';
41
46
  * @property {string} [glyph] A URL of an image that can be used to display this context group
42
47
  */
43
48
  /**
49
+ * @PORTED
44
50
  * @typedef { object } Context
45
51
  * @summary Data passed between entities and applications.
46
52
  * @property {object} [id] An object containing string key-value pairs for the bulk of the data for the context. Differs between context types.
@@ -48,6 +54,7 @@ import { Base } from '../base';
48
54
  * @property {string} type Conserved type for the context (e.g. `instrument` or `country`)
49
55
  */
50
56
  /**
57
+ * @REMOVED
51
58
  * @typedef { object } ContextForIntent
52
59
  * @summary Data passed between entities and applications, including an optional metadata.
53
60
  * @property {object} [id] An object containing string key-value pairs for the bulk of the data for the context. Differs between context types.
@@ -56,6 +63,7 @@ import { Base } from '../base';
56
63
  * @property {any} [metadata]
57
64
  */
58
65
  /**
66
+ * @REMOVED
59
67
  * @typedef { object } SessionContextGroup
60
68
  * @summary An instance of a SessionContextGroup
61
69
  * @property {string} id The SessionContextGroup's id.
@@ -83,7 +91,7 @@ import { Base } from '../base';
83
91
  * @return {Promise<void>}
84
92
  */
85
93
  /**
86
- * {@link https://developers.openfin.co/of-docs/docs/enable-color-linking **THE INTEROP API IS EXPERIMENTAL. IF YOU WOULD LIKE TO USE IT, PLEASE USE OUR DEFAULT IMPLEMENTATION IN BROWSER**}
94
+ * {@link https://developers.openfin.co/of-docs/docs/enable-color-linking}
87
95
  *
88
96
  * The Interop Client API is broken up into two groups:
89
97
  *
@@ -207,7 +215,6 @@ export declare class InteropClient extends Base {
207
215
  * @param { Intent } intent - The combination of an action and a context that is passed to an application for resolution.
208
216
  * @return { Promise<unknown>}
209
217
  * @tutorial interop.fireIntent
210
- * @experimental
211
218
  */
212
219
  fireIntent<T = unknown>(intent: OpenFin.Intent): Promise<T>;
213
220
  /**
@@ -216,7 +223,6 @@ export declare class InteropClient extends Base {
216
223
  * @param { string } intentName - The name of an intent.
217
224
  * @return { Promise<Subscription> }
218
225
  * @tutorial interop.registerIntentHandler
219
- * @experimental
220
226
  */
221
227
  registerIntentHandler(handler: OpenFin.IntentHandler, intentName: string, options?: any): Promise<{
222
228
  unsubscribe: () => Promise<void>;
@@ -227,7 +233,6 @@ export declare class InteropClient extends Base {
227
233
  * @param { string } [contextType]
228
234
  * @return { Promise<Context> }
229
235
  * @tutorial interop.getCurrentContext
230
- * @experimental
231
236
  */
232
237
  getCurrentContext(contextType?: string): Promise<OpenFin.Context>;
233
238
  /**
@@ -235,7 +240,6 @@ export declare class InteropClient extends Base {
235
240
  * @param { InfoForIntentOptions } options
236
241
  * @return { Promise<unknown> }
237
242
  * @tutorial interop.getInfoForIntent
238
- * @experimental
239
243
  */
240
244
  getInfoForIntent<T = unknown>(options: OpenFin.InfoForIntentOptions): Promise<T>;
241
245
  /**
@@ -243,7 +247,6 @@ export declare class InteropClient extends Base {
243
247
  * @param { Context } context
244
248
  * @return { Promise<unknown> }
245
249
  * @tutorial interop.getInfoForIntentsByContext
246
- * @experimental
247
250
  */
248
251
  getInfoForIntentsByContext<T = unknown>(context: OpenFin.Context): Promise<T>;
249
252
  /**
@@ -252,7 +255,6 @@ export declare class InteropClient extends Base {
252
255
  * @param { ContextForIntent } context
253
256
  * @return { Promise<unknown> }
254
257
  * @tutorial interop.fireIntentForContext
255
- * @experimental
256
258
  */
257
259
  fireIntentForContext<T = unknown>(context: OpenFin.ContextForIntent): Promise<T>;
258
260
  /**
@@ -262,7 +264,6 @@ export declare class InteropClient extends Base {
262
264
  * @param { string } sessionContextGroupId - Id of the context group.
263
265
  * @return { Promise<SessionContextGroup>}
264
266
  * @tutorial interop.joinSessionContextGroup
265
- * @experimental
266
267
  */
267
268
  joinSessionContextGroup(sessionContextGroupId: string): Promise<OpenFin.SessionContextGroup>;
268
269
  /**
@@ -17,12 +17,14 @@ const base_1 = require("../base");
17
17
  const SessionContextGroupClient_1 = require("./SessionContextGroupClient");
18
18
  const utils_1 = require("./utils");
19
19
  /**
20
+ * @PORTED
20
21
  * @typedef { object } Intent
21
22
  * @summary The combination of an action and a context that is passed to an application for resolution.
22
23
  * @property { string } name Name of the intent.
23
24
  * @property { Context } context Data associated with the intent
24
25
  */
25
26
  /**
27
+ * @REMOVED
26
28
  * @typedef { object } Subscription
27
29
  * @summary Object returned when subscribing a handler.
28
30
  * @property { function } unsubscribe Function to unsubscribe the handler.
@@ -36,6 +38,7 @@ const utils_1 = require("./utils");
36
38
  * @summary Subscription function for registerIntentHandler
37
39
  */
38
40
  /**
41
+ * @PORTED
39
42
  * @typedef { object } ClientIdentity
40
43
  * @summary The Identity for a Channel Client. Includes endpointId to differentiate between different connections for an entity.
41
44
  * @property {string} uuid GUID of an application.
@@ -43,12 +46,14 @@ const utils_1 = require("./utils");
43
46
  * @property {string} endpointId Unique differentiator for different Channel connections for an entity.
44
47
  */
45
48
  /**
49
+ * @PORTED
46
50
  * @typedef { object } ContextGroupInfo
47
51
  * @summary Information for a Context Group. Contains metadata for displaying the group properly.
48
52
  * @property {string} id Name of the context group
49
53
  * @property {DisplayMetadata} displayMetadata Metadata for the Context Group. Contains the group's human-readable name, color, and an image, as defined by the Interop Broker.
50
54
  */
51
55
  /**
56
+ * @PORTED
52
57
  * @typedef { object } DisplayMetadata
53
58
  * @summary The display data for a Context Group.
54
59
  * @property {string} name A user-readable name for this context group, e.g: `"Red"`
@@ -56,6 +61,7 @@ const utils_1 = require("./utils");
56
61
  * @property {string} [glyph] A URL of an image that can be used to display this context group
57
62
  */
58
63
  /**
64
+ * @PORTED
59
65
  * @typedef { object } Context
60
66
  * @summary Data passed between entities and applications.
61
67
  * @property {object} [id] An object containing string key-value pairs for the bulk of the data for the context. Differs between context types.
@@ -63,6 +69,7 @@ const utils_1 = require("./utils");
63
69
  * @property {string} type Conserved type for the context (e.g. `instrument` or `country`)
64
70
  */
65
71
  /**
72
+ * @REMOVED
66
73
  * @typedef { object } ContextForIntent
67
74
  * @summary Data passed between entities and applications, including an optional metadata.
68
75
  * @property {object} [id] An object containing string key-value pairs for the bulk of the data for the context. Differs between context types.
@@ -71,6 +78,7 @@ const utils_1 = require("./utils");
71
78
  * @property {any} [metadata]
72
79
  */
73
80
  /**
81
+ * @REMOVED
74
82
  * @typedef { object } SessionContextGroup
75
83
  * @summary An instance of a SessionContextGroup
76
84
  * @property {string} id The SessionContextGroup's id.
@@ -98,7 +106,7 @@ const utils_1 = require("./utils");
98
106
  * @return {Promise<void>}
99
107
  */
100
108
  /**
101
- * {@link https://developers.openfin.co/of-docs/docs/enable-color-linking **THE INTEROP API IS EXPERIMENTAL. IF YOU WOULD LIKE TO USE IT, PLEASE USE OUR DEFAULT IMPLEMENTATION IN BROWSER**}
109
+ * {@link https://developers.openfin.co/of-docs/docs/enable-color-linking}
102
110
  *
103
111
  * The Interop Client API is broken up into two groups:
104
112
  *
@@ -305,7 +313,6 @@ class InteropClient extends base_1.Base {
305
313
  * @param { Intent } intent - The combination of an action and a context that is passed to an application for resolution.
306
314
  * @return { Promise<unknown>}
307
315
  * @tutorial interop.fireIntent
308
- * @experimental
309
316
  */
310
317
  async fireIntent(intent) {
311
318
  this.wire.sendAction('interop-client-fire-intent').catch((e) => {
@@ -320,7 +327,6 @@ class InteropClient extends base_1.Base {
320
327
  * @param { string } intentName - The name of an intent.
321
328
  * @return { Promise<Subscription> }
322
329
  * @tutorial interop.registerIntentHandler
323
- * @experimental
324
330
  */
325
331
  async registerIntentHandler(handler, intentName, options) {
326
332
  this.wire.sendAction('interop-client-register-intent-handler').catch((e) => {
@@ -348,7 +354,6 @@ class InteropClient extends base_1.Base {
348
354
  * @param { string } [contextType]
349
355
  * @return { Promise<Context> }
350
356
  * @tutorial interop.getCurrentContext
351
- * @experimental
352
357
  */
353
358
  async getCurrentContext(contextType) {
354
359
  this.wire.sendAction('interop-client-get-current-context').catch((e) => {
@@ -362,7 +367,6 @@ class InteropClient extends base_1.Base {
362
367
  * @param { InfoForIntentOptions } options
363
368
  * @return { Promise<unknown> }
364
369
  * @tutorial interop.getInfoForIntent
365
- * @experimental
366
370
  */
367
371
  async getInfoForIntent(options) {
368
372
  this.wire.sendAction('interop-client-get-info-for-intent').catch((e) => {
@@ -376,7 +380,6 @@ class InteropClient extends base_1.Base {
376
380
  * @param { Context } context
377
381
  * @return { Promise<unknown> }
378
382
  * @tutorial interop.getInfoForIntentsByContext
379
- * @experimental
380
383
  */
381
384
  async getInfoForIntentsByContext(context) {
382
385
  this.wire.sendAction('interop-client-get-info-for-intents-by-context').catch((e) => {
@@ -391,7 +394,6 @@ class InteropClient extends base_1.Base {
391
394
  * @param { ContextForIntent } context
392
395
  * @return { Promise<unknown> }
393
396
  * @tutorial interop.fireIntentForContext
394
- * @experimental
395
397
  */
396
398
  async fireIntentForContext(context) {
397
399
  this.wire.sendAction('interop-client-fire-intent-for-context').catch((e) => {
@@ -407,7 +409,6 @@ class InteropClient extends base_1.Base {
407
409
  * @param { string } sessionContextGroupId - Id of the context group.
408
410
  * @return { Promise<SessionContextGroup>}
409
411
  * @tutorial interop.joinSessionContextGroup
410
- * @experimental
411
412
  */
412
413
  async joinSessionContextGroup(sessionContextGroupId) {
413
414
  try {
@@ -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 { Base } from '../base';
4
4
  export default class SessionContextGroupClient extends Base {
5
5
  #private;
@@ -14,6 +14,7 @@ export declare class PrivateChannelClient {
14
14
  onAddContextListener(handler: (contextType?: string) => void): Listener;
15
15
  onDisconnect(handler: () => void): Listener;
16
16
  onUnsubscribe(handler: (contextType?: string) => void): Listener;
17
+ cleanUpAllSubs(): Promise<void>;
17
18
  disconnect(): Promise<void>;
18
19
  }
19
20
  export {};
@@ -69,14 +69,22 @@ class PrivateChannelClient {
69
69
  this.client.dispatch(`onUnsubscribeHandlerAdded`, { handlerId });
70
70
  return listener;
71
71
  }
72
- async disconnect() {
73
- const listenerUnsubscribers = Array.from(this.listeners.values());
74
- const promises = listenerUnsubscribers.map(async (listenerUnsubscriber) => {
75
- await listenerUnsubscriber.unsubscribe();
72
+ async cleanUpAllSubs() {
73
+ const listenerUnsubscribers = Array.from(this.listeners.keys());
74
+ listenerUnsubscribers.forEach((handlerId) => {
75
+ this.client.remove(handlerId);
76
+ this.listeners.delete(handlerId);
76
77
  });
77
- await Promise.all(promises);
78
- await this.client.dispatch('clientDisconnecting');
79
- await this.client.disconnect();
78
+ }
79
+ async disconnect() {
80
+ try {
81
+ await this.client.dispatch('clientDisconnecting');
82
+ await this.cleanUpAllSubs();
83
+ await this.client.disconnect();
84
+ }
85
+ catch (error) {
86
+ throw new Error(error.message);
87
+ }
80
88
  }
81
89
  }
82
90
  exports.PrivateChannelClient = PrivateChannelClient;
@@ -1,6 +1,15 @@
1
1
  import type * as OpenFin from '../../../OpenFin';
2
2
  import { ChannelProvider } from '../../interappbus/channel/provider';
3
3
  declare type HandlerId = string;
4
+ declare type ContextType = string;
5
+ interface PrivateChannelClientState {
6
+ clientIdentity: OpenFin.ClientIdentity;
7
+ handlerIdsByContextTypes: Map<ContextType, HandlerId[]>;
8
+ globalHandler: HandlerId | undefined;
9
+ onAddContextListenerHandlerId: HandlerId | undefined;
10
+ onUnsubscribeHandlerId: HandlerId | undefined;
11
+ onDisconnectHandlerId: HandlerId | undefined;
12
+ }
4
13
  export declare class PrivateChannelProvider {
5
14
  id: string;
6
15
  private provider;
@@ -35,7 +44,12 @@ export declare class PrivateChannelProvider {
35
44
  onUnsubscribeHandlerAdded(payload: {
36
45
  handlerId: HandlerId;
37
46
  }, id: OpenFin.ClientIdentity): void;
38
- clientDisconnecting(payload: {}, disconnectingClientIdentity: OpenFin.ClientIdentity): Promise<void>;
47
+ removeClient(disconnectingClientIdentity: OpenFin.ClientIdentity): void;
48
+ fireOnDisconnectForOtherClients(disconnectingClientIdentity: OpenFin.ClientIdentity): Promise<void>;
49
+ unsubscribeAll(clientIdentity: OpenFin.ClientIdentity): Promise<void>;
50
+ handleClientDisconnecting(disconnectingClientIdentity: OpenFin.ClientIdentity): Promise<void>;
39
51
  registerNewClient(clientIdentity: OpenFin.ClientIdentity): void;
52
+ getConnectedClients(): Promise<PrivateChannelClientState[]>;
53
+ static init(channelProvider: OpenFin.ChannelProvider, id: string): PrivateChannelProvider;
40
54
  }
41
55
  export {};