@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
@@ -4,6 +4,7 @@ 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");
7
8
  let contextGroups = [
8
9
  {
9
10
  id: 'green',
@@ -93,6 +94,32 @@ let contextGroups = [
93
94
  * }
94
95
  * ```
95
96
  *
97
+ * By default the Interop Broker logs all actions to the console. You can disable this by using the logging option in `interopBrokerConfiguration`:
98
+ * ```js
99
+ * {
100
+ * "runtime": {
101
+ * "arguments": "--v=1 --inspect",
102
+ * "version": "alpha-v19"
103
+ * },
104
+ * "platform": {
105
+ * "uuid": "platform_customization_local",
106
+ * "applicationIcon": "https://openfin.github.io/golden-prototype/favicon.ico",
107
+ * "autoShow": false,
108
+ * "providerUrl": "http://localhost:5555/provider.html",
109
+ * "interopBrokerConfiguration": {
110
+ * "logging": {
111
+ * "beforeAction": {
112
+ * "enabled": false
113
+ * },
114
+ * "afterAction": {
115
+ * "enabled": false
116
+ * }
117
+ * }
118
+ * }
119
+ * }
120
+ * }
121
+ * ```
122
+ *
96
123
  * ---
97
124
  * **2. Overriding**
98
125
  *
@@ -121,7 +148,7 @@ let contextGroups = [
121
148
  * };
122
149
  * return new Override();
123
150
  * },
124
- * interopOverride: async (InteropBroker, provider, options, ...args) => {
151
+ * interopOverride: async (InteropBroker) => {
125
152
  * class Override extends InteropBroker {
126
153
  * async joinContextGroup(channelName = 'default', target) {
127
154
  * console.log('before super joinContextGroup')
@@ -130,37 +157,7 @@ let contextGroups = [
130
157
  * }
131
158
  * }
132
159
  *
133
- * options.contextGroups = [
134
- * {
135
- * id: 'green',
136
- * displayMetadata: {
137
- * color: '#00CC88',
138
- * name: 'green'
139
- * }
140
- * },
141
- * {
142
- * id: 'purple',
143
- * displayMetadata: {
144
- * color: '#8C61FF',
145
- * name: 'purple'
146
- * }
147
- * },
148
- * {
149
- * id: 'orange',
150
- * displayMetadata: {
151
- * color: '#FF8C4C',
152
- * name: 'orange'
153
- * }
154
- * },
155
- * {
156
- * id: 'red',
157
- * displayMetadata: {
158
- * color: '#FF5E60',
159
- * name: 'red'
160
- * }
161
- * }
162
- * ];
163
- * return new Override(provider, options, ...args);
160
+ * return new Override();
164
161
  * }
165
162
  * });
166
163
  * ```
@@ -172,59 +169,90 @@ let contextGroups = [
172
169
  */
173
170
  class InteropBroker extends base_1.Base {
174
171
  constructor(wire, getProvider, options) {
172
+ // Tip from Pierre and Michael from the overrideCheck work: Don't use bound methods for overrideable InteropBroker functions.
175
173
  super(wire);
176
174
  this.getProvider = getProvider;
177
175
  this.interopClients = new Map();
178
176
  this.contextGroupsById = new Map();
179
- if (options.contextGroups) {
177
+ if (options === null || options === void 0 ? void 0 : options.contextGroups) {
180
178
  contextGroups = options.contextGroups;
181
179
  }
180
+ if (options === null || options === void 0 ? void 0 : options.logging) {
181
+ this.logging = options.logging;
182
+ }
182
183
  this.intentClientMap = new Map();
183
184
  this.lastContextMap = new Map();
184
185
  this.sessionContextGroupMap = new Map();
185
186
  this.setContextGroupMap();
186
187
  this.setupChannelProvider();
187
188
  }
189
+ static createClosedConstructor(...args) {
190
+ return class OverrideableBroker extends InteropBroker {
191
+ constructor(...unused) {
192
+ if (unused.length) {
193
+ const [_ignore1, ignore2, opts] = unused;
194
+ if (opts && typeof opts === 'object' && !(0, lodash_1.isEqual)(opts, args[2])) {
195
+ // eslint-disable-next-line no-console
196
+ 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.');
197
+ super(args[0], args[1], opts);
198
+ return;
199
+ }
200
+ // eslint-disable-next-line no-console
201
+ 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.');
202
+ }
203
+ super(...args);
204
+ }
205
+ };
206
+ }
188
207
  /*
189
208
  Client API
190
209
  */
191
210
  /**
211
+ * @REMOVED
192
212
  * SetContextOptions interface
193
213
  * @typedef { object } SetContextOptions
194
214
  * @property { Context } {context} - New context to set.
195
215
  */
196
216
  /**
217
+ * @REMOVED
197
218
  * GetContextOptions interface
198
219
  * @typedef { object } GetContextOptions
199
220
  * @property { string } [contextType] - Context Type
200
221
  */
222
+ // TODO: extract inline type and do proper comments
201
223
  /**
224
+ * @REMOVED
202
225
  * JoinContextGroupOptions interface
203
226
  * @typedef { object } JoinContextGroupOptions
204
227
  * @property { string } contextGroupId - Id of the context group.
205
228
  * @property { Identity | ClientIdentity } [target] - Identity of the entity you wish to join to a context group.
206
229
  */
207
230
  /**
231
+ * @REMOVED
208
232
  * AddClientToContextGroupOptions interface
209
233
  * @typedef { object } AddClientToContextGroupOptions
210
234
  * @property { string } contextGroupId - Name of the context group.
211
235
  */
212
236
  /**
237
+ * @REMOVED
213
238
  * RemoveFromContextGroupOptions interface
214
239
  * @typedef { object } RemoveFromContextGroupOptions
215
240
  * @property { Identity | ClientIdentity } target - Identity of the entity you wish to join to a context group.
216
241
  */
217
242
  /**
243
+ * @REMOVED
218
244
  * GetInfoForContextGroupOptions interface
219
245
  * @typedef { object } GetInfoForContextGroupOptions
220
246
  * @property { string } contextGroupId - Name of the context group to get info for.
221
247
  */
222
248
  /**
249
+ * @REMOVED
223
250
  * GetAllClientsInContextGroupOptions interface
224
251
  * @typedef { object } GetAllClientsInContextGroupOptions
225
252
  * @property { string } contextGroupId - Name of the context group to get info for.
226
253
  */
227
254
  /**
255
+ * @PORTED
228
256
  * InfoForIntentOptions interface
229
257
  * @typedef { object } InfoForIntentOptions
230
258
  * @property { string } name Name of the intent to get info for.
@@ -371,7 +399,7 @@ class InteropBroker extends base_1.Base {
371
399
  const oldContextGroupId = clientSubscriptionState.contextGroupId;
372
400
  if (oldContextGroupId !== contextGroupId) {
373
401
  clientSubscriptionState.contextGroupId = contextGroupId;
374
- await InteropBroker.setCurrentContextGroupInClientOptions(clientIdentity, contextGroupId);
402
+ await this.setCurrentContextGroupInClientOptions(clientIdentity, contextGroupId);
375
403
  const contextGroupMap = this.contextGroupsById.get(contextGroupId);
376
404
  for (const [, handlerInfo] of clientSubscriptionState.contextHandlers) {
377
405
  const { contextType, handlerId } = handlerInfo;
@@ -450,7 +478,7 @@ class InteropBroker extends base_1.Base {
450
478
  if (clientState) {
451
479
  clientState.contextGroupId = undefined;
452
480
  }
453
- await InteropBroker.setCurrentContextGroupInClientOptions(clientIdentity, null);
481
+ await this.setCurrentContextGroupInClientOptions(clientIdentity, null);
454
482
  }
455
483
  // Used by platform windows to know what client groups the provider has declared. Also used internally to access context groups. Overrideable so that the platform developer can modify it.
456
484
  /**
@@ -513,7 +541,7 @@ class InteropBroker extends base_1.Base {
513
541
  */
514
542
  // eslint-disable-next-line class-methods-use-this
515
543
  async handleFiredIntent(intent, clientIdentity) {
516
- const warning = utils_1.generateOverrideWarning('fdc3.raiseIntent', 'InteropBroker.handleFiredIntent', clientIdentity, 'interopClient.fireIntent');
544
+ const warning = (0, utils_1.generateOverrideWarning)('fdc3.raiseIntent', 'InteropBroker.handleFiredIntent', clientIdentity, 'interopClient.fireIntent');
517
545
  console.warn(warning);
518
546
  throw new Error(utils_1.BROKER_ERRORS.fireIntent);
519
547
  }
@@ -571,7 +599,7 @@ class InteropBroker extends base_1.Base {
571
599
  */
572
600
  // eslint-disable-next-line class-methods-use-this
573
601
  async handleInfoForIntent(options, clientIdentity) {
574
- const warning = utils_1.generateOverrideWarning('fdc3.findIntent', 'InteropBroker.handleInfoForIntent', clientIdentity, 'interopClient.getInfoForIntent');
602
+ const warning = (0, utils_1.generateOverrideWarning)('fdc3.findIntent', 'InteropBroker.handleInfoForIntent', clientIdentity, 'interopClient.getInfoForIntent');
575
603
  console.warn(warning);
576
604
  throw new Error(utils_1.BROKER_ERRORS.getInfoForIntent);
577
605
  }
@@ -586,7 +614,7 @@ class InteropBroker extends base_1.Base {
586
614
  */
587
615
  // eslint-disable-next-line class-methods-use-this
588
616
  async handleInfoForIntentsByContext(context, clientIdentity) {
589
- const warning = utils_1.generateOverrideWarning('fdc3.findIntentsByContext', 'InteropBroker.handleInfoForIntentsByContext', clientIdentity, 'interopClient.getInfoForIntentsByContext');
617
+ const warning = (0, utils_1.generateOverrideWarning)('fdc3.findIntentsByContext', 'InteropBroker.handleInfoForIntentsByContext', clientIdentity, 'interopClient.getInfoForIntentsByContext');
590
618
  console.warn(warning);
591
619
  throw new Error(utils_1.BROKER_ERRORS.getInfoForIntentsByContext);
592
620
  }
@@ -601,7 +629,7 @@ class InteropBroker extends base_1.Base {
601
629
  */
602
630
  // eslint-disable-next-line class-methods-use-this
603
631
  async handleFiredIntentForContext(contextForIntent, clientIdentity) {
604
- const warning = utils_1.generateOverrideWarning('fdc3.raiseIntentForContext', 'InteropBroker.handleFiredIntentForContext', clientIdentity, 'interopClient.fireIntentForContext');
632
+ const warning = (0, utils_1.generateOverrideWarning)('fdc3.raiseIntentForContext', 'InteropBroker.handleFiredIntentForContext', clientIdentity, 'interopClient.fireIntentForContext');
605
633
  console.warn(warning);
606
634
  throw new Error(utils_1.BROKER_ERRORS.fireIntentForContext);
607
635
  }
@@ -624,7 +652,7 @@ class InteropBroker extends base_1.Base {
624
652
  */
625
653
  // eslint-disable-next-line class-methods-use-this
626
654
  async fdc3HandleOpen({ app, context }, clientIdentity) {
627
- const warning = utils_1.generateOverrideWarning('fdc3.open', 'InteropBroker.fdc3HandleOpen', clientIdentity);
655
+ const warning = (0, utils_1.generateOverrideWarning)('fdc3.open', 'InteropBroker.fdc3HandleOpen', clientIdentity);
628
656
  console.warn(warning);
629
657
  throw new Error(utils_1.BROKER_ERRORS.fdc3Open);
630
658
  }
@@ -636,7 +664,7 @@ class InteropBroker extends base_1.Base {
636
664
  */
637
665
  // eslint-disable-next-line class-methods-use-this
638
666
  async fdc3HandleFindInstances(app, clientIdentity) {
639
- const warning = utils_1.generateOverrideWarning('fdc3.open', 'InteropBroker.fdc3HandleFindInstances', clientIdentity);
667
+ const warning = (0, utils_1.generateOverrideWarning)('fdc3.open', 'InteropBroker.fdc3HandleFindInstances', clientIdentity);
640
668
  console.warn(warning);
641
669
  throw new Error(utils_1.BROKER_ERRORS.fdc3FindInstances);
642
670
  }
@@ -648,7 +676,7 @@ class InteropBroker extends base_1.Base {
648
676
  */
649
677
  // eslint-disable-next-line class-methods-use-this
650
678
  async fdc3HandleGetAppMetadata(app, clientIdentity) {
651
- const warning = utils_1.generateOverrideWarning('fdc3.getAppMetadata', 'InteropBroker.fdc3HandleGetAppMetadata', clientIdentity);
679
+ const warning = (0, utils_1.generateOverrideWarning)('fdc3.getAppMetadata', 'InteropBroker.fdc3HandleGetAppMetadata', clientIdentity);
652
680
  console.warn(warning);
653
681
  throw new Error(utils_1.BROKER_ERRORS.fdc3GetAppMetadata);
654
682
  }
@@ -695,10 +723,33 @@ class InteropBroker extends base_1.Base {
695
723
  * @returns { Promise<ImplementationMetadata(2)> }
696
724
  */
697
725
  // eslint-disable-next-line class-methods-use-this
698
- async fdc3HandleGetInfo(clientIdentity) {
699
- const warning = utils_1.generateOverrideWarning('fdc3.getInfo', 'InteropBroker.fdc3GetInfo', clientIdentity);
700
- console.warn(warning);
701
- throw new Error(utils_1.BROKER_ERRORS.fdc3GetInfo);
726
+ async fdc3HandleGetInfo(payload, clientIdentity) {
727
+ const { fdc3Version } = payload;
728
+ return {
729
+ fdc3Version,
730
+ provider: 'OpenFin',
731
+ providerVersion: await this.fin.System.getVersion(),
732
+ optionalFeatures: {
733
+ OriginatingAppMetadata: false,
734
+ UserChannelMembershipAPIs: true
735
+ },
736
+ appMetadata: {
737
+ appId: '',
738
+ instanceId: ''
739
+ }
740
+ };
741
+ }
742
+ /**
743
+ * Returns an array of info for each Interop Client connected to the Interop Broker.
744
+ *
745
+ * FDC3 2.0: Use the endpointId in the ClientInfo as the instanceId when generating
746
+ * an AppIdentifier.
747
+ * @return { Promise<Array<ClientInfo>> }
748
+ * @tutorial interop.getAllClientInfo
749
+ */
750
+ async getAllClientInfo() {
751
+ const provider = await this.getProvider();
752
+ return provider.getAllClientInfo();
702
753
  }
703
754
  /*
704
755
  Snapshot APIs
@@ -908,14 +959,14 @@ class InteropBroker extends base_1.Base {
908
959
  this.contextGroupsById.set(contextGroupInfo.id, new Map());
909
960
  }
910
961
  }
911
- static async setCurrentContextGroupInClientOptions(clientIdentity, contextGroupId) {
912
- const entityInfo = await fin.System.getEntityInfo(clientIdentity.uuid, clientIdentity.name);
962
+ async setCurrentContextGroupInClientOptions(clientIdentity, contextGroupId) {
963
+ const entityInfo = await this.fin.System.getEntityInfo(clientIdentity.uuid, clientIdentity.name);
913
964
  let entity;
914
965
  if (entityInfo.entityType === 'view') {
915
- entity = await fin.View.wrap(clientIdentity);
966
+ entity = await this.fin.View.wrap(clientIdentity);
916
967
  }
917
968
  else if (entityInfo.entityType === 'window') {
918
- entity = await fin.Window.wrap(clientIdentity);
969
+ entity = await this.fin.Window.wrap(clientIdentity);
919
970
  }
920
971
  if (entity) {
921
972
  await entity.updateOptions({
@@ -961,7 +1012,7 @@ class InteropBroker extends base_1.Base {
961
1012
  channel.onDisconnection((clientIdentity) => {
962
1013
  this.interopClients.delete(clientIdentity.endpointId);
963
1014
  const targetInfo = this.intentClientMap.get(clientIdentity.name);
964
- if (targetInfo && clientIdentity.uuid === fin.me.identity.uuid) {
1015
+ if (targetInfo && clientIdentity.uuid === this.fin.me.uuid) {
965
1016
  targetInfo.forEach((handler) => {
966
1017
  handler.isReady = false;
967
1018
  });
@@ -971,15 +1022,23 @@ class InteropBroker extends base_1.Base {
971
1022
  });
972
1023
  this.clientDisconnected(clientIdentity);
973
1024
  });
974
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
1025
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
975
1026
  // @ts-ignore
976
1027
  channel.beforeAction(async (action, payload, clientIdentity) => {
1028
+ var _a, _b;
977
1029
  if (!(await this.isActionAuthorized(action, payload, clientIdentity))) {
978
1030
  throw new Error(`Action (${action}) not authorized for ${clientIdentity.uuid}, ${clientIdentity.name}`);
979
1031
  }
980
- console.log(action, payload, clientIdentity);
1032
+ if ((_b = (_a = this.logging) === null || _a === void 0 ? void 0 : _a.beforeAction) === null || _b === void 0 ? void 0 : _b.enabled) {
1033
+ console.log(action, payload, clientIdentity);
1034
+ }
1035
+ });
1036
+ channel.afterAction((action, payload, clientIdentity) => {
1037
+ var _a, _b;
1038
+ if ((_b = (_a = this.logging) === null || _a === void 0 ? void 0 : _a.afterAction) === null || _b === void 0 ? void 0 : _b.enabled) {
1039
+ console.log(action, payload, clientIdentity);
1040
+ }
981
1041
  });
982
- channel.afterAction(console.log);
983
1042
  // Client functions
984
1043
  channel.register('setContext', this.setContext.bind(this));
985
1044
  channel.register('fireIntent', this.handleFiredIntent.bind(this));
@@ -1004,7 +1063,7 @@ class InteropBroker extends base_1.Base {
1004
1063
  channel.register('fdc3FindInstances', this.fdc3HandleFindInstances.bind(this));
1005
1064
  channel.register('fdc3GetAppMetadata', this.fdc3HandleGetAppMetadata.bind(this));
1006
1065
  channel.register('fdc3v2GetInfo', async (payload, clientIdentity) => {
1007
- return this.fdc3HandleGetInfo.bind(this)(clientIdentity);
1066
+ return this.fdc3HandleGetInfo.bind(this)(payload, clientIdentity);
1008
1067
  });
1009
1068
  }
1010
1069
  /**
@@ -1,12 +1,15 @@
1
+ import type * as OpenFin from '../../OpenFin';
1
2
  import Transport from '../../transport/transport';
2
3
  import { Base } from '../base';
3
4
  /**
5
+ * @PORTED
4
6
  * @typedef { object } Intent
5
7
  * @summary The combination of an action and a context that is passed to an application for resolution.
6
8
  * @property { string } name Name of the intent.
7
9
  * @property { Context } context Data associated with the intent
8
10
  */
9
11
  /**
12
+ * @REMOVED
10
13
  * @typedef { object } Subscription
11
14
  * @summary Object returned when subscribing a handler.
12
15
  * @property { function } unsubscribe Function to unsubscribe the handler.
@@ -20,6 +23,7 @@ import { Base } from '../base';
20
23
  * @summary Subscription function for registerIntentHandler
21
24
  */
22
25
  /**
26
+ * @PORTED
23
27
  * @typedef { object } ClientIdentity
24
28
  * @summary The Identity for a Channel Client. Includes endpointId to differentiate between different connections for an entity.
25
29
  * @property {string} uuid GUID of an application.
@@ -27,12 +31,14 @@ import { Base } from '../base';
27
31
  * @property {string} endpointId Unique differentiator for different Channel connections for an entity.
28
32
  */
29
33
  /**
34
+ * @PORTED
30
35
  * @typedef { object } ContextGroupInfo
31
36
  * @summary Information for a Context Group. Contains metadata for displaying the group properly.
32
37
  * @property {string} id Name of the context group
33
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.
34
39
  */
35
40
  /**
41
+ * @PORTED
36
42
  * @typedef { object } DisplayMetadata
37
43
  * @summary The display data for a Context Group.
38
44
  * @property {string} name A user-readable name for this context group, e.g: `"Red"`
@@ -40,6 +46,7 @@ import { Base } from '../base';
40
46
  * @property {string} [glyph] A URL of an image that can be used to display this context group
41
47
  */
42
48
  /**
49
+ * @PORTED
43
50
  * @typedef { object } Context
44
51
  * @summary Data passed between entities and applications.
45
52
  * @property {object} [id] An object containing string key-value pairs for the bulk of the data for the context. Differs between context types.
@@ -47,6 +54,7 @@ import { Base } from '../base';
47
54
  * @property {string} type Conserved type for the context (e.g. `instrument` or `country`)
48
55
  */
49
56
  /**
57
+ * @REMOVED
50
58
  * @typedef { object } ContextForIntent
51
59
  * @summary Data passed between entities and applications, including an optional metadata.
52
60
  * @property {object} [id] An object containing string key-value pairs for the bulk of the data for the context. Differs between context types.
@@ -55,6 +63,7 @@ import { Base } from '../base';
55
63
  * @property {any} [metadata]
56
64
  */
57
65
  /**
66
+ * @REMOVED
58
67
  * @typedef { object } SessionContextGroup
59
68
  * @summary An instance of a SessionContextGroup
60
69
  * @property {string} id The SessionContextGroup's id.