@openfin/core 30.73.28 → 31.74.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/LICENSE.md +4 -0
  2. package/package.json +2 -2
  3. package/src/OpenFin.d.ts +1664 -173
  4. package/src/api/application/Factory.d.ts +1 -0
  5. package/src/api/application/Factory.js +1 -0
  6. package/src/api/application/Instance.d.ts +2 -1
  7. package/src/api/application/Instance.js +1 -0
  8. package/src/api/base.d.ts +2 -2
  9. package/src/api/clipboard/index.d.ts +1 -0
  10. package/src/api/clipboard/index.js +1 -0
  11. package/src/api/events/platform.d.ts +4 -5
  12. package/src/api/events/system.d.ts +5 -6
  13. package/src/api/events/webcontents.d.ts +23 -3
  14. package/src/api/external-application/Instance.d.ts +1 -1
  15. package/src/api/fin.d.ts +1 -1
  16. package/src/api/frame/Instance.d.ts +1 -1
  17. package/src/api/global-hotkey/index.d.ts +1 -1
  18. package/src/api/interappbus/channel/channel.d.ts +1 -1
  19. package/src/api/interappbus/channel/channels-docs.d.ts +7 -0
  20. package/src/api/interappbus/channel/channels-docs.js +7 -0
  21. package/src/api/interappbus/channel/client.d.ts +3 -2
  22. package/src/api/interappbus/channel/client.js +12 -5
  23. package/src/api/interappbus/channel/connection-manager.d.ts +1 -1
  24. package/src/api/interappbus/channel/index.d.ts +1 -1
  25. package/src/api/interappbus/channel/index.js +5 -7
  26. package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +1 -1
  27. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +1 -1
  28. package/src/api/interappbus/channel/protocols/index.d.ts +3 -0
  29. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +10 -2
  30. package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +1 -1
  31. package/src/api/interappbus/channel/protocols/rtc/strategy.js +1 -1
  32. package/src/api/interappbus/channel/provider.d.ts +1 -1
  33. package/src/api/interappbus/index.d.ts +1 -1
  34. package/src/api/interop/Factory.d.ts +1 -2
  35. package/src/api/interop/Factory.js +20 -4
  36. package/src/api/interop/InteropBroker.d.ts +15 -47
  37. package/src/api/interop/InteropBroker.js +32 -46
  38. package/src/api/interop/InteropClient.d.ts +10 -9
  39. package/src/api/interop/InteropClient.js +9 -8
  40. package/src/api/interop/SessionContextGroupClient.d.ts +1 -1
  41. package/src/api/interop/fdc3/fdc3-1.2.js +8 -8
  42. package/src/api/interop/fdc3/fdc3-2.0.d.ts +2 -2
  43. package/src/api/interop/fdc3/fdc3-2.0.js +15 -7
  44. package/src/api/interop/fdc3/fdc3.d.ts +4 -5
  45. package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
  46. package/src/api/interop/fdc3/overrideCheck.js +32 -0
  47. package/src/api/interop/fdc3/versions.d.ts +1 -0
  48. package/src/api/interop/fdc3/versions.js +2 -0
  49. package/src/api/me.d.ts +1 -1
  50. package/src/api/platform/Factory.d.ts +6 -1
  51. package/src/api/platform/Factory.js +5 -0
  52. package/src/api/platform/Instance.d.ts +4 -2
  53. package/src/api/platform/Instance.js +4 -2
  54. package/src/api/platform/layout/Factory.d.ts +4 -0
  55. package/src/api/platform/layout/Factory.js +4 -0
  56. package/src/api/platform/layout/Instance.d.ts +1 -1
  57. package/src/api/platform/layout/utils/view-overlay.d.ts +1 -1
  58. package/src/api/platform/provider.d.ts +162 -0
  59. package/src/api/platform/provider.js +2 -0
  60. package/src/api/snapshot-source/Factory.d.ts +1 -0
  61. package/src/api/snapshot-source/Factory.js +1 -0
  62. package/src/api/snapshot-source/Instance.d.ts +1 -1
  63. package/src/api/system/index.d.ts +1 -471
  64. package/src/api/system/index.js +6 -476
  65. package/src/api/view/Instance.d.ts +7 -3
  66. package/src/api/view/Instance.js +7 -4
  67. package/src/api/webcontents/main.d.ts +18 -4
  68. package/src/api/window/Instance.d.ts +21 -1
  69. package/src/api/window/Instance.js +20 -0
  70. package/src/browser.js +1 -1
  71. package/src/mock.js +1 -1
  72. package/src/namespaces.d.ts +21 -0
  73. package/src/namespaces.js +24 -0
  74. package/src/transport/fin_store.d.ts +1 -1
  75. package/src/transport/transport-errors.d.ts +6 -1
  76. package/src/transport/transport-errors.js +1 -2
  77. package/src/transport/transport.d.ts +9 -6
  78. package/src/transport/transport.js +11 -2
  79. package/src/util/inaccessibleObject.d.ts +2 -0
  80. package/src/util/inaccessibleObject.js +49 -0
@@ -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.
@@ -1,13 +1,12 @@
1
1
  import Fdc3Module from './fdc3-1.2';
2
2
  import Fdc3Module2 from './fdc3-2.0';
3
- import type Transport from '../../../transport/transport';
3
+ import type { Transport } from '../../../transport/transport';
4
+ import { Fdc3Version } from './versions';
4
5
  declare global {
5
6
  interface Window {
6
7
  fdc3: Fdc3Module | Fdc3Module2;
7
8
  }
8
9
  }
9
- declare type Fdc3Versions = '1.2' | '2.0';
10
- export declare const versionMap: Record<Fdc3Versions, typeof Fdc3Module | typeof Fdc3Module2>;
10
+ export declare const versionMap: Record<Fdc3Version, typeof Fdc3Module | typeof Fdc3Module2>;
11
11
  export declare function registerFdc3Shim(version: string, transport: Transport): void;
12
- export declare function getFdc3(transport: Transport, version?: Fdc3Versions): Fdc3Module | Fdc3Module2;
13
- export {};
12
+ export declare function getFdc3(transport: Transport, version?: Fdc3Version): Fdc3Module | Fdc3Module2;
@@ -0,0 +1,4 @@
1
+ import * as OpenFin from '../../../OpenFin';
2
+ import { Fdc3Version } from './versions';
3
+ export declare function getDefaultViewFdc3VersionFromAppInfo({ manifest, initialOptions }: Awaited<ReturnType<OpenFin.Application['getInfo']>>): Fdc3Version | undefined;
4
+ export declare function overrideCheck(overriddenBroker: OpenFin.InteropBroker, fdc3InteropApi?: Fdc3Version): void;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.overrideCheck = exports.getDefaultViewFdc3VersionFromAppInfo = void 0;
4
+ const InteropBroker_1 = require("../InteropBroker");
5
+ function getDefaultViewFdc3VersionFromAppInfo({ manifest, initialOptions }) {
6
+ var _a, _b, _c, _d;
7
+ const setVersion = (_c = (_b = (_a = manifest.platform) === null || _a === void 0 ? void 0 : _a.defaultViewOptions) === null || _b === void 0 ? void 0 : _b.fdc3InteropApi) !== null && _c !== void 0 ? _c : (_d = initialOptions.defaultViewOptions) === null || _d === void 0 ? void 0 : _d.fdc3InteropApi;
8
+ return ['1.2', '2.0'].includes(setVersion !== null && setVersion !== void 0 ? setVersion : '') ? setVersion : undefined;
9
+ }
10
+ exports.getDefaultViewFdc3VersionFromAppInfo = getDefaultViewFdc3VersionFromAppInfo;
11
+ // TODO: Unit test this
12
+ function overrideCheck(overriddenBroker, fdc3InteropApi) {
13
+ if (fdc3InteropApi && fdc3InteropApi === '2.0') {
14
+ const mustOverrideAPIs = [
15
+ 'fdc3HandleFindInstances',
16
+ 'handleInfoForIntent',
17
+ 'handleInfoForIntentsByContext',
18
+ 'fdc3HandleGetAppMetadata',
19
+ 'fdc3HandleGetInfo',
20
+ 'fdc3HandleOpen',
21
+ 'handleFiredIntent',
22
+ 'handleFiredIntentForContext'
23
+ ];
24
+ const notOverridden = mustOverrideAPIs.filter((api) => {
25
+ return overriddenBroker[api] === InteropBroker_1.InteropBroker.prototype[api];
26
+ });
27
+ if (notOverridden.length > 0) {
28
+ console.warn(`WARNING: FDC3 2.0 has been set as a default option for Views in this Platform, but the required InteropBroker APIs for FDC3 2.0 compliance have not all been overridden.\nThe following APIs need to be overridden:\n${notOverridden.join('\n')}`);
29
+ }
30
+ }
31
+ }
32
+ exports.overrideCheck = overrideCheck;
@@ -0,0 +1 @@
1
+ export declare type Fdc3Version = '1.2' | '2.0';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/src/api/me.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type * as OpenFin from '../OpenFin';
2
- import type Transport from '../transport/transport';
2
+ import type { Transport } from '../transport/transport';
3
3
  import type { InteropClient } from './interop';
4
4
  export declare const environmentUnsupportedMessage = "You are not running in OpenFin.";
5
5
  declare type EntityType = OpenFin.EntityType;
@@ -1,20 +1,23 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
2
  import { Base } from '../base';
3
3
  import { Channel } from '../interappbus/channel/index';
4
- import Transport from '../../transport/transport';
4
+ import { Transport } from '../../transport/transport';
5
5
  import { LayoutModule } from './layout/index';
6
6
  /**
7
+ * @PORTED
7
8
  * InitPlatformOptions interface
8
9
  * @typedef { object } InitPlatformOptions
9
10
  * @property { OverrideCallback } [overrideCallback] a callback function that can be used to extend or replace default Provider behavior.
10
11
  */
11
12
  /**
13
+ * @PORTED
12
14
  * @typedef { same | different } ProcessAffinityStrategy
13
15
  * @summary Strategy to place views that share a domain into different process affinities or the same process affinity.
14
16
  * @property { string } same views in the same domain will have the same process affinity.
15
17
  * @property { string } different views in the same domain will have different process affinities.
16
18
  */
17
19
  /**
20
+ * @PORTED
18
21
  * @typedef { object } PlatformOptions
19
22
  * @summary The options object required by {@link Platform#start Platform.start}
20
23
  * Any {@link ApplicationOptions Application option} is also a valid platform option
@@ -25,6 +28,7 @@ import { LayoutModule } from './layout/index';
25
28
  * @property {ProcessAffinityStrategy} [viewProcessAffinityStrategy] 'same' | 'different'.
26
29
  */
27
30
  /**
31
+ * @PORTED
28
32
  * @typedef { object } DefaultWindowOptions
29
33
  * @summary Default window options apply to all platform windows.
30
34
  * Any {@link Window~options Window option} is also a valid Default Window option
@@ -36,6 +40,7 @@ import { LayoutModule } from './layout/index';
36
40
  * Windows with a specified url (Custom Windows) will not be affected by this option.
37
41
  */
38
42
  /**
43
+ * @DELETED
39
44
  * Snapshot interface
40
45
  * @typedef { object } Snapshot
41
46
  * @property { WindowOption[] } windows The array of window options objects
@@ -5,17 +5,20 @@ const base_1 = require("../base");
5
5
  const index_1 = require("./layout/index");
6
6
  const Instance_1 = require("./Instance");
7
7
  /**
8
+ * @PORTED
8
9
  * InitPlatformOptions interface
9
10
  * @typedef { object } InitPlatformOptions
10
11
  * @property { OverrideCallback } [overrideCallback] a callback function that can be used to extend or replace default Provider behavior.
11
12
  */
12
13
  /**
14
+ * @PORTED
13
15
  * @typedef { same | different } ProcessAffinityStrategy
14
16
  * @summary Strategy to place views that share a domain into different process affinities or the same process affinity.
15
17
  * @property { string } same views in the same domain will have the same process affinity.
16
18
  * @property { string } different views in the same domain will have different process affinities.
17
19
  */
18
20
  /**
21
+ * @PORTED
19
22
  * @typedef { object } PlatformOptions
20
23
  * @summary The options object required by {@link Platform#start Platform.start}
21
24
  * Any {@link ApplicationOptions Application option} is also a valid platform option
@@ -26,6 +29,7 @@ const Instance_1 = require("./Instance");
26
29
  * @property {ProcessAffinityStrategy} [viewProcessAffinityStrategy] 'same' | 'different'.
27
30
  */
28
31
  /**
32
+ * @PORTED
29
33
  * @typedef { object } DefaultWindowOptions
30
34
  * @summary Default window options apply to all platform windows.
31
35
  * Any {@link Window~options Window option} is also a valid Default Window option
@@ -37,6 +41,7 @@ const Instance_1 = require("./Instance");
37
41
  * Windows with a specified url (Custom Windows) will not be affected by this option.
38
42
  */
39
43
  /**
44
+ * @DELETED
40
45
  * Snapshot interface
41
46
  * @typedef { object } Snapshot
42
47
  * @property { WindowOption[] } windows The array of window options objects
@@ -66,14 +66,16 @@ export declare class Platform extends EmitterBase<OpenFin.PlatformEvent> {
66
66
  */
67
67
  getSnapshot(): Promise<OpenFin.Snapshot>;
68
68
  /**
69
+ * **NOTE**: Internal use only. It is not recommended to manage the state of individual views.
70
+ *
69
71
  * Returns a snapshot of a single view's options in its current state.
70
72
  *
71
73
  * Can be used to restore a view to a previous state.
72
74
  *
73
- * NOTE: this method is meant for advanced usage only, it is not recommended to manage the state of individual views.
74
- *
75
75
  * @param { Identity } viewIdentity View identity
76
76
  * @returns { Promise<ViewState> }
77
+ * @internal
78
+ * @experimental
77
79
  * @tutorial Platform.getViewSnapshot
78
80
  */
79
81
  getViewSnapshot(viewIdentity: OpenFin.Identity): Promise<OpenFin.ViewState>;
@@ -175,14 +175,16 @@ class Platform extends base_1.EmitterBase {
175
175
  return client.dispatch('get-snapshot');
176
176
  }
177
177
  /**
178
+ * **NOTE**: Internal use only. It is not recommended to manage the state of individual views.
179
+ *
178
180
  * Returns a snapshot of a single view's options in its current state.
179
181
  *
180
182
  * Can be used to restore a view to a previous state.
181
183
  *
182
- * NOTE: this method is meant for advanced usage only, it is not recommended to manage the state of individual views.
183
- *
184
184
  * @param { Identity } viewIdentity View identity
185
185
  * @returns { Promise<ViewState> }
186
+ * @internal
187
+ * @experimental
186
188
  * @tutorial Platform.getViewSnapshot
187
189
  */
188
190
  async getViewSnapshot(viewIdentity) {
@@ -3,12 +3,14 @@ import { Layout } from './Instance';
3
3
  import { Base } from '../../base';
4
4
  declare type InitLayoutOptions = OpenFin.InitLayoutOptions;
5
5
  /**
6
+ * @PORTED
6
7
  * InitLayoutOptions interface
7
8
  * @typedef { object } InitLayoutOptions
8
9
  * @property { string } [containerId] The id attribute of the container where the window's Layout should be initialized. If not provided
9
10
  * then an element with id `layout-container` is used. We recommend using a div element.
10
11
  */
11
12
  /**
13
+ * @PORTED
12
14
  * PresetLayoutOptions interface
13
15
  * @typedef { object } PresetLayoutOptions
14
16
  * @property { LayoutPresetTypes } presetType Which preset layout arrangement to use.
@@ -23,6 +25,7 @@ declare type InitLayoutOptions = OpenFin.InitLayoutOptions;
23
25
  * @property { LayoutSettings } settings Configuration for certain Layout behaviors. See the LayoutSettings interface.
24
26
  */
25
27
  /**
28
+ * @PORTED
26
29
  * LayoutItem Interface
27
30
  * @typedef { object } LayoutItem Represents the arrangement of Views within a Platform window's Layout. We do not recommend trying
28
31
  * to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our
@@ -34,6 +37,7 @@ declare type InitLayoutOptions = OpenFin.InitLayoutOptions;
34
37
  * options of a given component.
35
38
  */
36
39
  /**
40
+ * @PORTED
37
41
  * LayoutSettings Interface
38
42
  * @typedef { object } LayoutSettings Represents a potential ways to customize behavior of your Layout
39
43
  * @property { boolean } [constrainDragToHeaders=false] Limits the area to which tabs can be dragged.
@@ -20,12 +20,14 @@ const base_1 = require("../../base");
20
20
  const splitter_controller_1 = require("./controllers/splitter-controller");
21
21
  const view_overlay_1 = require("./utils/view-overlay");
22
22
  /**
23
+ * @PORTED
23
24
  * InitLayoutOptions interface
24
25
  * @typedef { object } InitLayoutOptions
25
26
  * @property { string } [containerId] The id attribute of the container where the window's Layout should be initialized. If not provided
26
27
  * then an element with id `layout-container` is used. We recommend using a div element.
27
28
  */
28
29
  /**
30
+ * @PORTED
29
31
  * PresetLayoutOptions interface
30
32
  * @typedef { object } PresetLayoutOptions
31
33
  * @property { LayoutPresetTypes } presetType Which preset layout arrangement to use.
@@ -40,6 +42,7 @@ const view_overlay_1 = require("./utils/view-overlay");
40
42
  * @property { LayoutSettings } settings Configuration for certain Layout behaviors. See the LayoutSettings interface.
41
43
  */
42
44
  /**
45
+ * @PORTED
43
46
  * LayoutItem Interface
44
47
  * @typedef { object } LayoutItem Represents the arrangement of Views within a Platform window's Layout. We do not recommend trying
45
48
  * to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our
@@ -51,6 +54,7 @@ const view_overlay_1 = require("./utils/view-overlay");
51
54
  * options of a given component.
52
55
  */
53
56
  /**
57
+ * @PORTED
54
58
  * LayoutSettings Interface
55
59
  * @typedef { object } LayoutSettings Represents a potential ways to customize behavior of your Layout
56
60
  * @property { boolean } [constrainDragToHeaders=false] Limits the area to which tabs can be dragged.
@@ -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
  declare type Identity = OpenFin.Identity;
5
5
  declare type InitLayoutOptions = OpenFin.InitLayoutOptions;
@@ -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
  /**
4
4
  * Api client allowing an empty electron BrowserView to be rendered
5
5
  * in the current window with the specified bounds.