@openfin/core 30.73.28 → 31.74.2

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 (160) hide show
  1. package/LICENSE.md +4 -0
  2. package/package.json +2 -2
  3. package/src/OpenFin.d.ts +1929 -407
  4. package/src/OpenFin.js +0 -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 +2 -2
  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 +4 -4
  26. package/src/api/clipboard/index.d.ts +1 -0
  27. package/src/api/clipboard/index.js +1 -0
  28. package/src/api/events/application.d.ts +22 -22
  29. package/src/api/events/base.d.ts +6 -9
  30. package/src/api/events/channel.d.ts +5 -5
  31. package/src/api/events/emitterMap.d.ts +1 -1
  32. package/src/api/events/externalApplication.d.ts +3 -3
  33. package/src/api/events/frame.d.ts +5 -5
  34. package/src/api/events/globalHotkey.d.ts +3 -3
  35. package/src/api/events/platform.d.ts +6 -7
  36. package/src/api/events/system.d.ts +20 -21
  37. package/src/api/events/typedEventEmitter.d.ts +1 -1
  38. package/src/api/events/view.d.ts +17 -14
  39. package/src/api/events/webcontents.d.ts +40 -18
  40. package/src/api/events/window.d.ts +65 -57
  41. package/src/api/external-application/Instance.d.ts +1 -1
  42. package/src/api/fin.d.ts +2 -2
  43. package/src/api/frame/Instance.d.ts +2 -2
  44. package/src/api/global-hotkey/index.d.ts +1 -1
  45. package/src/api/interappbus/channel/channel.d.ts +5 -5
  46. package/src/api/interappbus/channel/channel.js +3 -3
  47. package/src/api/interappbus/channel/channels-docs.d.ts +7 -0
  48. package/src/api/interappbus/channel/channels-docs.js +7 -0
  49. package/src/api/interappbus/channel/client.d.ts +5 -4
  50. package/src/api/interappbus/channel/client.js +24 -17
  51. package/src/api/interappbus/channel/connection-manager.d.ts +2 -2
  52. package/src/api/interappbus/channel/connection-manager.js +12 -12
  53. package/src/api/interappbus/channel/index.d.ts +3 -3
  54. package/src/api/interappbus/channel/index.js +6 -8
  55. package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +1 -1
  56. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +2 -2
  57. package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +2 -2
  58. package/src/api/interappbus/channel/protocols/combined/strategy.js +5 -5
  59. package/src/api/interappbus/channel/protocols/index.d.ts +7 -4
  60. package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +1 -1
  61. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +10 -2
  62. package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +1 -1
  63. package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +1 -1
  64. package/src/api/interappbus/channel/protocols/rtc/strategy.js +1 -1
  65. package/src/api/interappbus/channel/protocols/strategy-types.d.ts +4 -4
  66. package/src/api/interappbus/channel/protocols/strategy.d.ts +3 -3
  67. package/src/api/interappbus/channel/provider.d.ts +6 -6
  68. package/src/api/interappbus/channel/provider.js +24 -24
  69. package/src/api/interappbus/index.d.ts +1 -1
  70. package/src/api/interop/Factory.d.ts +1 -2
  71. package/src/api/interop/Factory.js +20 -4
  72. package/src/api/interop/InteropBroker.d.ts +16 -48
  73. package/src/api/interop/InteropBroker.js +38 -48
  74. package/src/api/interop/InteropClient.d.ts +10 -9
  75. package/src/api/interop/InteropClient.js +9 -8
  76. package/src/api/interop/SessionContextGroupClient.d.ts +1 -1
  77. package/src/api/interop/fdc3/PrivateChannelClient.d.ts +2 -1
  78. package/src/api/interop/fdc3/PrivateChannelClient.js +15 -7
  79. package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +16 -2
  80. package/src/api/interop/fdc3/PrivateChannelProvider.js +80 -21
  81. package/src/api/interop/fdc3/fdc3-1.2.js +27 -12
  82. package/src/api/interop/fdc3/fdc3-2.0.d.ts +13 -12
  83. package/src/api/interop/fdc3/fdc3-2.0.js +33 -26
  84. package/src/api/interop/fdc3/fdc3.d.ts +4 -5
  85. package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
  86. package/src/api/interop/fdc3/overrideCheck.js +32 -0
  87. package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +3 -3
  88. package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +5 -5
  89. package/src/api/interop/fdc3/utils.d.ts +17 -0
  90. package/src/api/interop/fdc3/utils.js +52 -18
  91. package/src/api/interop/fdc3/versions.d.ts +1 -0
  92. package/src/api/interop/fdc3/versions.js +2 -0
  93. package/src/api/interop/utils.d.ts +0 -1
  94. package/src/api/interop/utils.js +1 -9
  95. package/src/api/me.d.ts +4 -4
  96. package/src/api/platform/Factory.d.ts +6 -1
  97. package/src/api/platform/Factory.js +10 -9
  98. package/src/api/platform/Instance.d.ts +5 -3
  99. package/src/api/platform/Instance.js +5 -3
  100. package/src/api/platform/common-utils.d.ts +1 -1
  101. package/src/api/platform/layout/Factory.d.ts +5 -1
  102. package/src/api/platform/layout/Factory.js +15 -3
  103. package/src/api/platform/layout/Instance.d.ts +10 -4
  104. package/src/api/platform/layout/Instance.js +26 -1
  105. package/src/api/platform/layout/controllers/layout-content-cache.d.ts +9 -0
  106. package/src/api/platform/layout/controllers/layout-content-cache.js +54 -0
  107. package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +117 -0
  108. package/src/api/platform/layout/controllers/layout-entities-controller.js +270 -0
  109. package/src/api/platform/layout/controllers/splitter-controller.d.ts +1 -1
  110. package/src/api/platform/layout/entities/layout-entities.d.ts +144 -0
  111. package/src/api/platform/layout/entities/layout-entities.js +216 -0
  112. package/src/api/platform/layout/entities/shapes.d.ts +6 -0
  113. package/src/api/platform/layout/entities/shapes.js +2 -0
  114. package/src/api/platform/layout/layout.constants.d.ts +1 -0
  115. package/src/api/platform/layout/layout.constants.js +4 -0
  116. package/src/api/platform/layout/shapes.d.ts +4 -1
  117. package/src/api/platform/layout/utils/layout-traversal.d.ts +4 -0
  118. package/src/api/platform/layout/utils/layout-traversal.js +65 -0
  119. package/src/api/platform/layout/utils/view-overlay.d.ts +1 -1
  120. package/src/api/platform/provider.d.ts +162 -0
  121. package/src/api/platform/provider.js +2 -0
  122. package/src/api/snapshot-source/Factory.d.ts +1 -0
  123. package/src/api/snapshot-source/Factory.js +1 -0
  124. package/src/api/snapshot-source/Instance.d.ts +1 -1
  125. package/src/api/system/index.d.ts +14 -484
  126. package/src/api/system/index.js +6 -476
  127. package/src/api/view/Instance.d.ts +20 -6
  128. package/src/api/view/Instance.js +48 -8
  129. package/src/api/webcontents/main.d.ts +18 -4
  130. package/src/api/window/Instance.d.ts +21 -1
  131. package/src/api/window/Instance.js +20 -0
  132. package/src/browser.js +1 -1
  133. package/src/environment/browser.d.ts +1 -1
  134. package/src/environment/environment.d.ts +1 -1
  135. package/src/environment/node-env.d.ts +1 -1
  136. package/src/environment/openfin-env.d.ts +1 -1
  137. package/src/mock.d.ts +1 -1
  138. package/src/mock.js +6 -3
  139. package/src/namespaces.d.ts +21 -0
  140. package/src/namespaces.js +24 -0
  141. package/src/shapes/ERROR_BOX_TYPES.d.ts +1 -1
  142. package/src/shapes/protocol.d.ts +3 -3
  143. package/src/transport/fin_store.d.ts +1 -1
  144. package/src/transport/transport-errors.d.ts +7 -2
  145. package/src/transport/transport-errors.js +1 -2
  146. package/src/transport/transport.d.ts +11 -8
  147. package/src/transport/transport.js +12 -6
  148. package/src/transport/wire.d.ts +14 -13
  149. package/src/util/channel-api-relay.d.ts +13 -0
  150. package/src/util/channel-api-relay.js +37 -0
  151. package/src/util/errors.d.ts +2 -2
  152. package/src/util/http.js +4 -2
  153. package/src/util/inaccessibleObject.d.ts +2 -0
  154. package/src/util/inaccessibleObject.js +49 -0
  155. package/src/util/lazy.d.ts +16 -0
  156. package/src/util/lazy.js +26 -0
  157. package/src/util/promises.d.ts +1 -1
  158. package/src/util/reversible-map.d.ts +11 -0
  159. package/src/util/reversible-map.js +49 -0
  160. package/src/util/utilTypes.d.ts +1 -1
@@ -1,10 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const lodash_1 = require("lodash");
4
+ const inaccessibleObject_1 = require("../../util/inaccessibleObject");
3
5
  const base_1 = require("../base");
4
6
  const InteropBroker_1 = require("./InteropBroker");
5
7
  const InteropClient_1 = require("./InteropClient");
6
- const defaultOverride = (Class, ...args) => new Class(...args);
8
+ const overrideCheck_1 = require("./fdc3/overrideCheck");
9
+ const defaultOverride = (Class) => new Class();
10
+ const BrokerParamAccessError = 'You have attempted to use or modify InteropBroker parameters, which is not allowed. You are likely using an older InteropBroker override scheme. Please consult our Interop docs for guidance on migrating to the new override scheme.';
7
11
  /**
12
+ * @PORTED
8
13
  * @typedef { object } InteropConfig
9
14
  * @summary Information relevant to the Interop Broker.
10
15
  * @property {string} [currentContextGroup] Context Group for the client. (green, yellow, red, etc.)
@@ -22,15 +27,18 @@ class InteropModule extends base_1.Base {
22
27
  * @param { OverrideCallback<InteropBroker> } [override] - A callback function that can be used to extend or replace default Interop Broker behavior.
23
28
  * @return {Promise.<InteropBroker>}
24
29
  * @tutorial Interop.init
25
- * @experimental
26
30
  * @static
27
31
  */
28
32
  async init(name, override = defaultOverride) {
33
+ var _a;
29
34
  this.wire.sendAction('interop-init').catch((e) => {
30
35
  // don't expose, analytics-only call
31
36
  });
32
37
  // Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
33
38
  const options = await this.fin.Application.getCurrentSync().getInfo();
39
+ const opts = (_a = options.initialOptions.interopBrokerConfiguration) !== null && _a !== void 0 ? _a : {};
40
+ const objectThatThrows = (0, inaccessibleObject_1.createUnusableObject)(BrokerParamAccessError);
41
+ const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (0, lodash_1.cloneDeep)(opts));
34
42
  let provider;
35
43
  const getProvider = () => {
36
44
  if (!provider) {
@@ -38,7 +46,16 @@ class InteropModule extends base_1.Base {
38
46
  }
39
47
  return provider;
40
48
  };
41
- return override(InteropBroker_1.InteropBroker, this.wire, getProvider, options.initialOptions.interopBrokerConfiguration);
49
+ const throwingGetProvider = async () => {
50
+ // eslint-disable-next-line no-console
51
+ throw new Error(BrokerParamAccessError);
52
+ };
53
+ const OverrideableBroker = InteropBroker_1.InteropBroker.createClosedConstructor(this.wire, getProvider, opts);
54
+ // We need to use these objects because removing them entirely would be a breaking change and we want an informative error
55
+ // @ts-expect-error
56
+ const broker = await override(OverrideableBroker, objectThatThrows, throwingGetProvider, warningOptsClone);
57
+ (0, overrideCheck_1.overrideCheck)(broker, (0, overrideCheck_1.getDefaultViewFdc3VersionFromAppInfo)(options));
58
+ return broker;
42
59
  }
43
60
  /**
44
61
  * Connects a client to an Interop broker. This is called under-the-hood for Views in a Platform.
@@ -47,7 +64,6 @@ class InteropModule extends base_1.Base {
47
64
  * what context(s) the entity wants to subscribe to, and the current Context Group of the entity.
48
65
  * @return {InteropClient}
49
66
  * @tutorial Interop.connectSync
50
- * @experimental
51
67
  * @static
52
68
  */
53
69
  connectSync(name, interopConfig) {
@@ -2,10 +2,10 @@ import { TargetApp } from './fdc3/shapes/fdc3v1';
2
2
  import { AppIdentifier } from './fdc3/shapes/fdc3v2';
3
3
  import type * as OpenFin from '../../OpenFin';
4
4
  import { Base } from '../base';
5
- import type Transport from '../../transport/transport';
6
- declare type Identity = OpenFin.Identity;
5
+ import type { Transport } from '../../transport/transport';
6
+ type Identity = OpenFin.Identity;
7
7
  /**
8
- * {@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**}
8
+ * {@link https://developers.openfin.co/of-docs/docs/enable-color-linking}
9
9
  *
10
10
  * The Interop Broker is responsible for keeping track of the Interop state of the Platform, and for directing messages to the proper locations.
11
11
  *
@@ -103,7 +103,7 @@ declare type Identity = OpenFin.Identity;
103
103
  * };
104
104
  * return new Override();
105
105
  * },
106
- * interopOverride: async (InteropBroker, provider, options, ...args) => {
106
+ * interopOverride: async (InteropBroker) => {
107
107
  * class Override extends InteropBroker {
108
108
  * async joinContextGroup(channelName = 'default', target) {
109
109
  * console.log('before super joinContextGroup')
@@ -112,37 +112,7 @@ declare type Identity = OpenFin.Identity;
112
112
  * }
113
113
  * }
114
114
  *
115
- * options.contextGroups = [
116
- * {
117
- * id: 'green',
118
- * displayMetadata: {
119
- * color: '#00CC88',
120
- * name: 'green'
121
- * }
122
- * },
123
- * {
124
- * id: 'purple',
125
- * displayMetadata: {
126
- * color: '#8C61FF',
127
- * name: 'purple'
128
- * }
129
- * },
130
- * {
131
- * id: 'orange',
132
- * displayMetadata: {
133
- * color: '#FF8C4C',
134
- * name: 'orange'
135
- * }
136
- * },
137
- * {
138
- * id: 'red',
139
- * displayMetadata: {
140
- * color: '#FF5E60',
141
- * name: 'red'
142
- * }
143
- * }
144
- * ];
145
- * return new Override(provider, options, ...args);
115
+ * return new Override();
146
116
  * }
147
117
  * });
148
118
  * ```
@@ -162,43 +132,54 @@ export declare class InteropBroker extends Base {
162
132
  private channel;
163
133
  private logging;
164
134
  constructor(wire: Transport, getProvider: () => Promise<OpenFin.ChannelProvider>, options?: any);
135
+ static createClosedConstructor(...args: ConstructorParameters<typeof InteropBroker>): {
136
+ new (): InteropBroker;
137
+ };
165
138
  /**
139
+ * @REMOVED
166
140
  * SetContextOptions interface
167
141
  * @typedef { object } SetContextOptions
168
142
  * @property { Context } {context} - New context to set.
169
143
  */
170
144
  /**
145
+ * @REMOVED
171
146
  * GetContextOptions interface
172
147
  * @typedef { object } GetContextOptions
173
148
  * @property { string } [contextType] - Context Type
174
149
  */
175
150
  /**
151
+ * @REMOVED
176
152
  * JoinContextGroupOptions interface
177
153
  * @typedef { object } JoinContextGroupOptions
178
154
  * @property { string } contextGroupId - Id of the context group.
179
155
  * @property { Identity | ClientIdentity } [target] - Identity of the entity you wish to join to a context group.
180
156
  */
181
157
  /**
158
+ * @REMOVED
182
159
  * AddClientToContextGroupOptions interface
183
160
  * @typedef { object } AddClientToContextGroupOptions
184
161
  * @property { string } contextGroupId - Name of the context group.
185
162
  */
186
163
  /**
164
+ * @REMOVED
187
165
  * RemoveFromContextGroupOptions interface
188
166
  * @typedef { object } RemoveFromContextGroupOptions
189
167
  * @property { Identity | ClientIdentity } target - Identity of the entity you wish to join to a context group.
190
168
  */
191
169
  /**
170
+ * @REMOVED
192
171
  * GetInfoForContextGroupOptions interface
193
172
  * @typedef { object } GetInfoForContextGroupOptions
194
173
  * @property { string } contextGroupId - Name of the context group to get info for.
195
174
  */
196
175
  /**
176
+ * @REMOVED
197
177
  * GetAllClientsInContextGroupOptions interface
198
178
  * @typedef { object } GetAllClientsInContextGroupOptions
199
179
  * @property { string } contextGroupId - Name of the context group to get info for.
200
180
  */
201
181
  /**
182
+ * @PORTED
202
183
  * InfoForIntentOptions interface
203
184
  * @typedef { object } InfoForIntentOptions
204
185
  * @property { string } name Name of the intent to get info for.
@@ -209,7 +190,6 @@ export declare class InteropBroker extends Base {
209
190
  * @param { SetContextOptions } setContextOptions - New context to set.
210
191
  * @param { ClientIdentity } clientIdentity - Identity of the client sender.
211
192
  * @return { void }
212
- * @experimental
213
193
  */
214
194
  setContext({ context }: {
215
195
  context: OpenFin.Context;
@@ -231,7 +211,6 @@ export declare class InteropBroker extends Base {
231
211
  * @return { Promise<void> }
232
212
  * @param { JoinContextGroupOptions } joinContextGroupOptions - Id of the Context Group and identity of the entity to join to the group.
233
213
  * @param { ClientIdentity } senderIdentity - Identity of the client sender.
234
- * @experimental
235
214
  */
236
215
  joinContextGroup({ contextGroupId, target }: {
237
216
  contextGroupId: string;
@@ -243,7 +222,6 @@ export declare class InteropBroker extends Base {
243
222
  * @return { Promise<void> }
244
223
  * @param { AddClientToContextGroupOptions } addClientToContextGroupOptions - Contains the contextGroupId
245
224
  * @param { ClientIdentity } clientIdentity - Identity of the client sender.
246
- * @experimental
247
225
  */
248
226
  addClientToContextGroup({ contextGroupId }: {
249
227
  contextGroupId: string;
@@ -256,7 +234,6 @@ export declare class InteropBroker extends Base {
256
234
  * @return { Promise<void> }
257
235
  * @param { RemoveFromContextGroupOptions } removeFromContextGroupOptions - Contains the target identity to remove.
258
236
  * @param { ClientIdentity } senderIdentity - Identity of the client sender.
259
- * @experimental
260
237
  */
261
238
  removeFromContextGroup({ target }: {
262
239
  target: OpenFin.Identity;
@@ -266,14 +243,12 @@ export declare class InteropBroker extends Base {
266
243
  * Used by Platform Windows.
267
244
  * @return { Promise<void> }
268
245
  * @property { ClientIdentity } clientIdentity - Identity of the client sender.
269
- * @experimental
270
246
  */
271
247
  removeClientFromContextGroup(clientIdentity: OpenFin.ClientIdentity): Promise<void>;
272
248
  /**
273
249
  * 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.
274
250
  * Used by Platform Windows.
275
251
  * @return { Promise<ContextGroupInfo[]>}
276
- * @experimental
277
252
  */
278
253
  getContextGroups(): Readonly<OpenFin.ContextGroupInfo[]>;
279
254
  /**
@@ -281,7 +256,6 @@ export declare class InteropBroker extends Base {
281
256
  * Used by Platform Windows.
282
257
  * @param { GetInfoForContextGroupOptions } getInfoForContextGroupOptions - Contains contextGroupId, the context group you wish to get display info for.
283
258
  * @return { Promise<ContextGroupInfo>}
284
- * @experimental
285
259
  */
286
260
  getInfoForContextGroup({ contextGroupId }: {
287
261
  contextGroupId: string;
@@ -291,7 +265,6 @@ export declare class InteropBroker extends Base {
291
265
  * Used by Platform Windows.
292
266
  * @param { GetAllClientsInContextGroupOptions } getAllClientsInContextGroupOptions - Contains contextGroupId, the context group you wish to get clients for.
293
267
  * @return { Promise<ClientIdentity[]>}
294
- * @experimental
295
268
  */
296
269
  getAllClientsInContextGroup({ contextGroupId }: {
297
270
  contextGroupId: string;
@@ -303,7 +276,6 @@ export declare class InteropBroker extends Base {
303
276
  * @param { ClientIdentity } clientIdentity Identity of the Client making the request.
304
277
  * @return { Promise<unknown> }
305
278
  * @tutorial interop.handleFiredIntent
306
- * @experimental
307
279
  */
308
280
  handleFiredIntent(intent: OpenFin.Intent, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
309
281
  /**
@@ -312,7 +284,6 @@ export declare class InteropBroker extends Base {
312
284
  * @param { Intent } intent The combination of an action and a context that is passed to an application for resolution.
313
285
  * @param { Identity } target - Identity of the target that will handle the intent.
314
286
  * @return { Promise<void> }
315
- * @experimental
316
287
  */
317
288
  setIntentTarget(intent: OpenFin.Intent, target: OpenFin.Identity): Promise<void>;
318
289
  /**
@@ -322,7 +293,6 @@ export declare class InteropBroker extends Base {
322
293
  * @param { ClientIdentity } clientIdentity Identity of the Client making the request.
323
294
  * @return { Promise<unknown> }
324
295
  * @tutorial interop.handleInfoForIntent
325
- * @experimental
326
296
  */
327
297
  handleInfoForIntent(options: OpenFin.InfoForIntentOptions, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
328
298
  /**
@@ -332,7 +302,6 @@ export declare class InteropBroker extends Base {
332
302
  * @param { ClientIdentity } clientIdentity Identity of the Client making the request.
333
303
  * @return { Promise<unknown> }
334
304
  * @tutorial interop.handleInfoForIntentsByContext
335
- * @experimental
336
305
  */
337
306
  handleInfoForIntentsByContext(context: OpenFin.Context | OpenFin.FindIntentsByContextOptions, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
338
307
  /**
@@ -342,7 +311,6 @@ export declare class InteropBroker extends Base {
342
311
  * @param { ClientIdentity } clientIdentity Identity of the Client making the request.
343
312
  * @return { Promise<unknown> }
344
313
  * @tutorial interop.handleFiredIntentForContext
345
- * @experimental
346
314
  */
347
315
  handleFiredIntentForContext(contextForIntent: OpenFin.ContextForIntent, clientIdentity: OpenFin.ClientIdentity): Promise<unknown>;
348
316
  /**
@@ -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) {
@@ -1023,8 +1010,6 @@ class InteropBroker extends base_1.Base {
1023
1010
  });
1024
1011
  this.clientDisconnected(clientIdentity);
1025
1012
  });
1026
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1027
- // @ts-ignore
1028
1013
  channel.beforeAction(async (action, payload, clientIdentity) => {
1029
1014
  var _a, _b;
1030
1015
  if (!(await this.isActionAuthorized(action, payload, clientIdentity))) {
@@ -1066,6 +1051,11 @@ class InteropBroker extends base_1.Base {
1066
1051
  channel.register('fdc3v2GetInfo', async (payload, clientIdentity) => {
1067
1052
  return this.fdc3HandleGetInfo.bind(this)(payload, clientIdentity);
1068
1053
  });
1054
+ channel.register('createPrivateChannelProvider', async (payload) => {
1055
+ const { channelId } = payload;
1056
+ const channelProvider = await this.fin.InterApplicationBus.Channel.create(channelId);
1057
+ PrivateChannelProvider_1.PrivateChannelProvider.init(channelProvider, channelId);
1058
+ });
1069
1059
  }
1070
1060
  /**
1071
1061
  * 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
  /**