@openfin/core 30.73.23 → 30.73.25

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 (93) hide show
  1. package/LICENSE.md +4 -0
  2. package/package.json +2 -2
  3. package/src/OpenFin.d.ts +1678 -188
  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 +3 -2
  7. package/src/api/application/Instance.js +1 -0
  8. package/src/api/base.d.ts +16 -14
  9. package/src/api/base.js +2 -2
  10. package/src/api/clipboard/index.d.ts +1 -0
  11. package/src/api/clipboard/index.js +1 -0
  12. package/src/api/events/application.d.ts +65 -56
  13. package/src/api/events/base.d.ts +33 -15
  14. package/src/api/events/channel.d.ts +13 -8
  15. package/src/api/events/eventAggregator.js +1 -9
  16. package/src/api/events/externalApplication.d.ts +10 -5
  17. package/src/api/events/frame.d.ts +13 -7
  18. package/src/api/events/globalHotkey.d.ts +11 -12
  19. package/src/api/events/platform.d.ts +10 -16
  20. package/src/api/events/system.d.ts +41 -29
  21. package/src/api/events/typedEventEmitter.d.ts +15 -8
  22. package/src/api/events/view.d.ts +37 -54
  23. package/src/api/events/webcontents.d.ts +74 -28
  24. package/src/api/events/window.d.ts +147 -134
  25. package/src/api/external-application/Instance.d.ts +2 -2
  26. package/src/api/fin.d.ts +1 -1
  27. package/src/api/frame/Instance.d.ts +2 -2
  28. package/src/api/global-hotkey/index.d.ts +2 -4
  29. package/src/api/global-hotkey/index.js +6 -0
  30. package/src/api/interappbus/channel/channel.d.ts +1 -1
  31. package/src/api/interappbus/channel/channels-docs.d.ts +7 -0
  32. package/src/api/interappbus/channel/channels-docs.js +7 -0
  33. package/src/api/interappbus/channel/client.d.ts +3 -2
  34. package/src/api/interappbus/channel/client.js +12 -5
  35. package/src/api/interappbus/channel/connection-manager.d.ts +1 -1
  36. package/src/api/interappbus/channel/index.d.ts +3 -3
  37. package/src/api/interappbus/channel/index.js +7 -7
  38. package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +1 -1
  39. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +1 -1
  40. package/src/api/interappbus/channel/protocols/index.d.ts +3 -0
  41. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +10 -2
  42. package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +1 -1
  43. package/src/api/interappbus/channel/protocols/rtc/strategy.js +1 -1
  44. package/src/api/interappbus/channel/provider.d.ts +1 -1
  45. package/src/api/interappbus/index.d.ts +1 -1
  46. package/src/api/interop/Factory.d.ts +1 -2
  47. package/src/api/interop/Factory.js +20 -4
  48. package/src/api/interop/InteropBroker.d.ts +16 -48
  49. package/src/api/interop/InteropBroker.js +33 -47
  50. package/src/api/interop/InteropClient.d.ts +10 -9
  51. package/src/api/interop/InteropClient.js +9 -8
  52. package/src/api/interop/SessionContextGroupClient.d.ts +1 -1
  53. package/src/api/interop/fdc3/fdc3-1.2.js +8 -8
  54. package/src/api/interop/fdc3/fdc3-2.0.d.ts +2 -2
  55. package/src/api/interop/fdc3/fdc3-2.0.js +15 -7
  56. package/src/api/interop/fdc3/fdc3.d.ts +4 -5
  57. package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
  58. package/src/api/interop/fdc3/overrideCheck.js +32 -0
  59. package/src/api/interop/fdc3/versions.d.ts +1 -0
  60. package/src/api/interop/fdc3/versions.js +2 -0
  61. package/src/api/me.d.ts +1 -1
  62. package/src/api/platform/Factory.d.ts +6 -1
  63. package/src/api/platform/Factory.js +9 -0
  64. package/src/api/platform/Instance.d.ts +7 -6
  65. package/src/api/platform/Instance.js +6 -3
  66. package/src/api/platform/layout/Factory.d.ts +4 -0
  67. package/src/api/platform/layout/Factory.js +4 -0
  68. package/src/api/platform/layout/Instance.d.ts +1 -1
  69. package/src/api/platform/layout/utils/view-overlay.d.ts +1 -1
  70. package/src/api/platform/provider.d.ts +162 -0
  71. package/src/api/platform/provider.js +2 -0
  72. package/src/api/snapshot-source/Factory.d.ts +1 -0
  73. package/src/api/snapshot-source/Factory.js +1 -0
  74. package/src/api/snapshot-source/Instance.d.ts +1 -1
  75. package/src/api/system/index.d.ts +2 -3
  76. package/src/api/system/index.js +22 -6
  77. package/src/api/view/Instance.d.ts +9 -5
  78. package/src/api/view/Instance.js +7 -4
  79. package/src/api/webcontents/main.d.ts +20 -6
  80. package/src/api/webcontents/main.js +10 -0
  81. package/src/api/window/Instance.d.ts +22 -4
  82. package/src/api/window/Instance.js +22 -0
  83. package/src/browser.js +1 -1
  84. package/src/mock.js +1 -1
  85. package/src/namespaces.d.ts +21 -0
  86. package/src/namespaces.js +24 -0
  87. package/src/transport/fin_store.d.ts +1 -1
  88. package/src/transport/transport-errors.d.ts +6 -1
  89. package/src/transport/transport-errors.js +1 -2
  90. package/src/transport/transport.d.ts +12 -9
  91. package/src/transport/transport.js +11 -2
  92. package/src/util/inaccessibleObject.d.ts +2 -0
  93. package/src/util/inaccessibleObject.js +49 -0
@@ -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',
@@ -49,7 +50,7 @@ let contextGroups = [
49
50
  }
50
51
  ];
51
52
  /**
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**}
53
+ * {@link https://developers.openfin.co/of-docs/docs/enable-color-linking}
53
54
  *
54
55
  * The Interop Broker is responsible for keeping track of the Interop state of the Platform, and for directing messages to the proper locations.
55
56
  *
@@ -147,7 +148,7 @@ let contextGroups = [
147
148
  * };
148
149
  * return new Override();
149
150
  * },
150
- * interopOverride: async (InteropBroker, provider, options, ...args) => {
151
+ * interopOverride: async (InteropBroker) => {
151
152
  * class Override extends InteropBroker {
152
153
  * async joinContextGroup(channelName = 'default', target) {
153
154
  * console.log('before super joinContextGroup')
@@ -156,37 +157,7 @@ let contextGroups = [
156
157
  * }
157
158
  * }
158
159
  *
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);
160
+ * return new Override();
190
161
  * }
191
162
  * });
192
163
  * ```
@@ -198,6 +169,7 @@ let contextGroups = [
198
169
  */
199
170
  class InteropBroker extends base_1.Base {
200
171
  constructor(wire, getProvider, options) {
172
+ // Tip from Pierre and Michael from the overrideCheck work: Don't use bound methods for overrideable InteropBroker functions.
201
173
  super(wire);
202
174
  this.getProvider = getProvider;
203
175
  this.interopClients = new Map();
@@ -214,46 +186,73 @@ class InteropBroker extends base_1.Base {
214
186
  this.setContextGroupMap();
215
187
  this.setupChannelProvider();
216
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
+ }
217
207
  /*
218
208
  Client API
219
209
  */
220
210
  /**
211
+ * @REMOVED
221
212
  * SetContextOptions interface
222
213
  * @typedef { object } SetContextOptions
223
214
  * @property { Context } {context} - New context to set.
224
215
  */
225
216
  /**
217
+ * @REMOVED
226
218
  * GetContextOptions interface
227
219
  * @typedef { object } GetContextOptions
228
220
  * @property { string } [contextType] - Context Type
229
221
  */
222
+ // TODO: extract inline type and do proper comments
230
223
  /**
224
+ * @REMOVED
231
225
  * JoinContextGroupOptions interface
232
226
  * @typedef { object } JoinContextGroupOptions
233
227
  * @property { string } contextGroupId - Id of the context group.
234
228
  * @property { Identity | ClientIdentity } [target] - Identity of the entity you wish to join to a context group.
235
229
  */
236
230
  /**
231
+ * @REMOVED
237
232
  * AddClientToContextGroupOptions interface
238
233
  * @typedef { object } AddClientToContextGroupOptions
239
234
  * @property { string } contextGroupId - Name of the context group.
240
235
  */
241
236
  /**
237
+ * @REMOVED
242
238
  * RemoveFromContextGroupOptions interface
243
239
  * @typedef { object } RemoveFromContextGroupOptions
244
240
  * @property { Identity | ClientIdentity } target - Identity of the entity you wish to join to a context group.
245
241
  */
246
242
  /**
243
+ * @REMOVED
247
244
  * GetInfoForContextGroupOptions interface
248
245
  * @typedef { object } GetInfoForContextGroupOptions
249
246
  * @property { string } contextGroupId - Name of the context group to get info for.
250
247
  */
251
248
  /**
249
+ * @REMOVED
252
250
  * GetAllClientsInContextGroupOptions interface
253
251
  * @typedef { object } GetAllClientsInContextGroupOptions
254
252
  * @property { string } contextGroupId - Name of the context group to get info for.
255
253
  */
256
254
  /**
255
+ * @PORTED
257
256
  * InfoForIntentOptions interface
258
257
  * @typedef { object } InfoForIntentOptions
259
258
  * @property { string } name Name of the intent to get info for.
@@ -264,7 +263,6 @@ class InteropBroker extends base_1.Base {
264
263
  * @param { SetContextOptions } setContextOptions - New context to set.
265
264
  * @param { ClientIdentity } clientIdentity - Identity of the client sender.
266
265
  * @return { void }
267
- * @experimental
268
266
  */
269
267
  setContext({ context }, clientIdentity) {
270
268
  this.wire.sendAction('interop-broker-set-context').catch((e) => {
@@ -338,7 +336,6 @@ class InteropBroker extends base_1.Base {
338
336
  * @return { Promise<void> }
339
337
  * @param { JoinContextGroupOptions } joinContextGroupOptions - Id of the Context Group and identity of the entity to join to the group.
340
338
  * @param { ClientIdentity } senderIdentity - Identity of the client sender.
341
- * @experimental
342
339
  */
343
340
  async joinContextGroup({ contextGroupId, target }, senderIdentity) {
344
341
  this.wire.sendAction('interop-broker-join-context-group').catch((e) => {
@@ -384,7 +381,6 @@ class InteropBroker extends base_1.Base {
384
381
  * @return { Promise<void> }
385
382
  * @param { AddClientToContextGroupOptions } addClientToContextGroupOptions - Contains the contextGroupId
386
383
  * @param { ClientIdentity } clientIdentity - Identity of the client sender.
387
- * @experimental
388
384
  */
389
385
  async addClientToContextGroup({ contextGroupId }, clientIdentity) {
390
386
  this.wire.sendAction('interop-broker-add-client-to-context-group').catch((e) => {
@@ -428,7 +424,6 @@ class InteropBroker extends base_1.Base {
428
424
  * @return { Promise<void> }
429
425
  * @param { RemoveFromContextGroupOptions } removeFromContextGroupOptions - Contains the target identity to remove.
430
426
  * @param { ClientIdentity } senderIdentity - Identity of the client sender.
431
- * @experimental
432
427
  */
433
428
  async removeFromContextGroup({ target }, senderIdentity) {
434
429
  this.wire.sendAction('interop-broker-remove-from-context-group').catch((e) => {
@@ -469,7 +464,6 @@ class InteropBroker extends base_1.Base {
469
464
  * Used by Platform Windows.
470
465
  * @return { Promise<void> }
471
466
  * @property { ClientIdentity } clientIdentity - Identity of the client sender.
472
- * @experimental
473
467
  */
474
468
  async removeClientFromContextGroup(clientIdentity) {
475
469
  this.wire.sendAction('interop-broker-remove-client-from-context-group').catch((e) => {
@@ -486,7 +480,6 @@ class InteropBroker extends base_1.Base {
486
480
  * 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
481
  * Used by Platform Windows.
488
482
  * @return { Promise<ContextGroupInfo[]>}
489
- * @experimental
490
483
  */
491
484
  // eslint-disable-next-line class-methods-use-this
492
485
  getContextGroups() {
@@ -504,7 +497,6 @@ class InteropBroker extends base_1.Base {
504
497
  * Used by Platform Windows.
505
498
  * @param { GetInfoForContextGroupOptions } getInfoForContextGroupOptions - Contains contextGroupId, the context group you wish to get display info for.
506
499
  * @return { Promise<ContextGroupInfo>}
507
- * @experimental
508
500
  */
509
501
  getInfoForContextGroup({ contextGroupId }) {
510
502
  this.wire.sendAction('interop-broker-get-info-for-context-group').catch((e) => {
@@ -518,7 +510,6 @@ class InteropBroker extends base_1.Base {
518
510
  * Used by Platform Windows.
519
511
  * @param { GetAllClientsInContextGroupOptions } getAllClientsInContextGroupOptions - Contains contextGroupId, the context group you wish to get clients for.
520
512
  * @return { Promise<ClientIdentity[]>}
521
- * @experimental
522
513
  */
523
514
  getAllClientsInContextGroup({ contextGroupId }) {
524
515
  this.wire.sendAction('interop-broker-get-all-clients-in-context-group').catch((e) => {
@@ -538,7 +529,6 @@ class InteropBroker extends base_1.Base {
538
529
  * @param { ClientIdentity } clientIdentity Identity of the Client making the request.
539
530
  * @return { Promise<unknown> }
540
531
  * @tutorial interop.handleFiredIntent
541
- * @experimental
542
532
  */
543
533
  // eslint-disable-next-line class-methods-use-this
544
534
  async handleFiredIntent(intent, clientIdentity) {
@@ -552,7 +542,6 @@ class InteropBroker extends base_1.Base {
552
542
  * @param { Intent } intent The combination of an action and a context that is passed to an application for resolution.
553
543
  * @param { Identity } target - Identity of the target that will handle the intent.
554
544
  * @return { Promise<void> }
555
- * @experimental
556
545
  */
557
546
  async setIntentTarget(intent, target) {
558
547
  this.wire.sendAction('interop-broker-set-intent-target').catch((e) => {
@@ -596,7 +585,6 @@ class InteropBroker extends base_1.Base {
596
585
  * @param { ClientIdentity } clientIdentity Identity of the Client making the request.
597
586
  * @return { Promise<unknown> }
598
587
  * @tutorial interop.handleInfoForIntent
599
- * @experimental
600
588
  */
601
589
  // eslint-disable-next-line class-methods-use-this
602
590
  async handleInfoForIntent(options, clientIdentity) {
@@ -611,7 +599,6 @@ class InteropBroker extends base_1.Base {
611
599
  * @param { ClientIdentity } clientIdentity Identity of the Client making the request.
612
600
  * @return { Promise<unknown> }
613
601
  * @tutorial interop.handleInfoForIntentsByContext
614
- * @experimental
615
602
  */
616
603
  // eslint-disable-next-line class-methods-use-this
617
604
  async handleInfoForIntentsByContext(context, clientIdentity) {
@@ -626,7 +613,6 @@ class InteropBroker extends base_1.Base {
626
613
  * @param { ClientIdentity } clientIdentity Identity of the Client making the request.
627
614
  * @return { Promise<unknown> }
628
615
  * @tutorial interop.handleFiredIntentForContext
629
- * @experimental
630
616
  */
631
617
  // eslint-disable-next-line class-methods-use-this
632
618
  async handleFiredIntentForContext(contextForIntent, clientIdentity) {
@@ -746,7 +732,7 @@ class InteropBroker extends base_1.Base {
746
732
  * FDC3 2.0: Use the endpointId in the ClientInfo as the instanceId when generating
747
733
  * an AppIdentifier.
748
734
  * @return { Promise<Array<ClientInfo>> }
749
- * @tutorial interop.getAllClientInfo()
735
+ * @tutorial interop.getAllClientInfo
750
736
  */
751
737
  async getAllClientInfo() {
752
738
  const provider = await this.getProvider();
@@ -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;
@@ -130,7 +130,7 @@ class Fdc3Module extends base_1.Base {
130
130
  this.wire.sendAction('fdc3-broadcast').catch((e) => {
131
131
  // we do not want to expose this error, just continue if this analytics-only call fails
132
132
  });
133
- this.fin.me.interop.setContext(context);
133
+ return this.fin.me.interop.setContext(context);
134
134
  }
135
135
  /**
136
136
  * Returns the Interop-Broker-defined context groups available for an entity to join.
@@ -165,7 +165,7 @@ class Fdc3Module extends base_1.Base {
165
165
  // we do not want to expose this error, just continue if this analytics-only call fails
166
166
  });
167
167
  try {
168
- await this.fin.me.interop.joinContextGroup(channelId);
168
+ return await this.fin.me.interop.joinContextGroup(channelId);
169
169
  }
170
170
  catch (error) {
171
171
  if (error.message === utils_2.BROKER_ERRORS.joinSessionContextGroupWithJoinContextGroup) {
@@ -187,7 +187,7 @@ class Fdc3Module extends base_1.Base {
187
187
  this.wire.sendAction('fdc3-leave-current-channel').catch((e) => {
188
188
  // we do not want to expose this error, just continue if this analytics-only call fails
189
189
  });
190
- this.fin.me.interop.removeFromContextGroup();
190
+ return this.fin.me.interop.removeFromContextGroup();
191
191
  }
192
192
  /**
193
193
  * Adds a listener for incoming Intents.
@@ -232,7 +232,7 @@ class Fdc3Module extends base_1.Base {
232
232
  return await this.fin.me.interop.fireIntent(intentObj);
233
233
  }
234
234
  catch (error) {
235
- const errorToThrow = error.message === utils_2.BROKER_ERRORS.fireIntent ? 'ResolverUnavailable' : error;
235
+ const errorToThrow = error.message === utils_2.BROKER_ERRORS.fireIntent ? 'ResolverUnavailable' : error.message;
236
236
  throw new Error(errorToThrow);
237
237
  }
238
238
  }
@@ -266,7 +266,7 @@ class Fdc3Module extends base_1.Base {
266
266
  return await this.fin.me.interop.getInfoForIntent({ name: intent, context });
267
267
  }
268
268
  catch (error) {
269
- const errorToThrow = error.message === utils_2.BROKER_ERRORS.getInfoForIntent ? 'ResolverUnavailable' : error;
269
+ const errorToThrow = error.message === utils_2.BROKER_ERRORS.getInfoForIntent ? 'ResolverUnavailable' : error.message;
270
270
  throw new Error(errorToThrow);
271
271
  }
272
272
  }
@@ -284,7 +284,7 @@ class Fdc3Module extends base_1.Base {
284
284
  return await this.fin.me.interop.getInfoForIntentsByContext(context);
285
285
  }
286
286
  catch (error) {
287
- const errorToThrow = error.message === utils_2.BROKER_ERRORS.getInfoForIntentsByContext ? 'ResolverUnavailable' : error;
287
+ const errorToThrow = error.message === utils_2.BROKER_ERRORS.getInfoForIntentsByContext ? 'ResolverUnavailable' : error.message;
288
288
  throw new Error(errorToThrow);
289
289
  }
290
290
  }
@@ -303,7 +303,7 @@ class Fdc3Module extends base_1.Base {
303
303
  return await this.fin.me.interop.fireIntentForContext({ ...context, metadata: { target: app } });
304
304
  }
305
305
  catch (error) {
306
- const errorToThrow = error.message === utils_2.BROKER_ERRORS.fireIntentForContext ? 'ResolverUnavailable' : error;
306
+ const errorToThrow = error.message === utils_2.BROKER_ERRORS.fireIntentForContext ? 'ResolverUnavailable' : error.message;
307
307
  throw new Error(errorToThrow);
308
308
  }
309
309
  }
@@ -354,7 +354,7 @@ class Fdc3Module extends base_1.Base {
354
354
  return await InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'fdc3Open', { app, context });
355
355
  }
356
356
  catch (error) {
357
- const errorToThrow = error.message === utils_2.BROKER_ERRORS.fdc3Open ? 'ResolverUnavailable' : error;
357
+ const errorToThrow = error.message === utils_2.BROKER_ERRORS.fdc3Open ? 'ResolverUnavailable' : error.message;
358
358
  throw new Error(errorToThrow);
359
359
  }
360
360
  }
@@ -1,7 +1,7 @@
1
1
  import type * as FDC3v1 from './shapes/fdc3v1';
2
2
  import type * as FDC3v2 from './shapes/fdc3v2';
3
3
  import { Base } from '../../base';
4
- import Transport from '../../../transport/transport';
4
+ import { Transport } from '../../../transport/transport';
5
5
  /**
6
6
  * @typedef { object } AppIdentifier
7
7
  * @summary Identifies an application, or instance of an application, and is used to target FDC3 API calls at specific applications.
@@ -283,7 +283,7 @@ export default class Fdc3Module2 extends Base implements FDC3v2.DesktopAgent {
283
283
  * Returns the Channel object for the current User channel membership
284
284
  * @returns { Promise<FDC3.Channel | null> }
285
285
  */
286
- getCurrentChannel(): Promise<FDC3v1.Channel | null>;
286
+ getCurrentChannel(): Promise<FDC3v2.Channel | null>;
287
287
  /**
288
288
  * Removes the app from any User channel membership.
289
289
  * @returns { Promise<void> }
@@ -191,7 +191,7 @@ class Fdc3Module2 extends base_1.Base {
191
191
  return await InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'fdc3FindInstances', app);
192
192
  }
193
193
  catch (error) {
194
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.fdc3FindInstances ? 'ResolverUnavailable' : error;
194
+ const errorToThrow = error.message === utils_1.BROKER_ERRORS.fdc3FindInstances ? 'ResolverUnavailable' : error.message;
195
195
  throw new Error(errorToThrow);
196
196
  }
197
197
  }
@@ -209,7 +209,7 @@ class Fdc3Module2 extends base_1.Base {
209
209
  return await InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'fdc3GetAppMetadata', app);
210
210
  }
211
211
  catch (error) {
212
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.fdc3GetAppMetadata ? 'ResolverUnavailable' : error;
212
+ const errorToThrow = error.message === utils_1.BROKER_ERRORS.fdc3GetAppMetadata ? 'ResolverUnavailable' : error.message;
213
213
  throw new Error(errorToThrow);
214
214
  }
215
215
  }
@@ -268,7 +268,7 @@ class Fdc3Module2 extends base_1.Base {
268
268
  return await this.fin.me.interop.getInfoForIntent({ name: intent, context, metadata: { resultType } });
269
269
  }
270
270
  catch (error) {
271
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.getInfoForIntent ? 'ResolverUnavailable' : error;
271
+ const errorToThrow = error.message === utils_1.BROKER_ERRORS.getInfoForIntent ? 'ResolverUnavailable' : error.message;
272
272
  throw new Error(errorToThrow);
273
273
  }
274
274
  }
@@ -288,7 +288,7 @@ class Fdc3Module2 extends base_1.Base {
288
288
  return await InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'fdc3v2FindIntentsByContext', payload);
289
289
  }
290
290
  catch (error) {
291
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.getInfoForIntentsByContext ? 'ResolverUnavailable' : error;
291
+ const errorToThrow = error.message === utils_1.BROKER_ERRORS.getInfoForIntentsByContext ? 'ResolverUnavailable' : error.message;
292
292
  throw new Error(errorToThrow);
293
293
  }
294
294
  }
@@ -308,7 +308,7 @@ class Fdc3Module2 extends base_1.Base {
308
308
  return (0, utils_2.getIntentResolution)(this.fin.me.interop, context, app, intent);
309
309
  }
310
310
  catch (error) {
311
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.fireIntent ? 'ResolverUnavailable' : error;
311
+ const errorToThrow = error.message === utils_1.BROKER_ERRORS.fireIntent ? 'ResolverUnavailable' : error.message;
312
312
  throw new Error(errorToThrow);
313
313
  }
314
314
  }
@@ -328,7 +328,7 @@ class Fdc3Module2 extends base_1.Base {
328
328
  return (0, utils_2.getIntentResolution)(this.fin.me.interop, context, app);
329
329
  }
330
330
  catch (error) {
331
- const errorToThrow = error.message === utils_1.BROKER_ERRORS.fireIntent ? 'ResolverUnavailable' : error;
331
+ const errorToThrow = error.message === utils_1.BROKER_ERRORS.fireIntent ? 'ResolverUnavailable' : error.message;
332
332
  throw new Error(errorToThrow);
333
333
  }
334
334
  }
@@ -443,7 +443,15 @@ class Fdc3Module2 extends base_1.Base {
443
443
  * @returns { Promise<FDC3.Channel | null> }
444
444
  */
445
445
  async getCurrentChannel() {
446
- return this.fdc3Module.getCurrentChannel();
446
+ const currentChannel = await this.fdc3Module.getCurrentChannel();
447
+ if (!currentChannel) {
448
+ return null;
449
+ }
450
+ return {
451
+ ...currentChannel,
452
+ type: 'user',
453
+ broadcast: this.broadcast.bind(this)
454
+ };
447
455
  }
448
456
  /**
449
457
  * Removes the app from any User channel membership.