@openfin/core 30.73.8 → 30.73.10

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 (54) hide show
  1. package/OpenFin.d.ts +2 -0
  2. package/package.json +1 -1
  3. package/src/api/application/Factory.js +3 -3
  4. package/src/api/application/index.js +7 -3
  5. package/src/api/base.js +18 -20
  6. package/src/api/external-application/index.js +7 -3
  7. package/src/api/fin.js +2 -2
  8. package/src/api/frame/Factory.js +2 -2
  9. package/src/api/frame/index.js +7 -3
  10. package/src/api/interappbus/channel/client.js +24 -26
  11. package/src/api/interappbus/channel/connection-manager.js +24 -26
  12. package/src/api/interappbus/channel/index.js +16 -18
  13. package/src/api/interappbus/channel/protocols/classic/strategy.js +21 -22
  14. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +24 -26
  15. package/src/api/interappbus/channel/protocols/rtc/strategy.js +29 -31
  16. package/src/api/interappbus/channel/provider.js +134 -139
  17. package/src/api/interappbus/index.js +1 -1
  18. package/src/api/interop/InteropBroker.js +9 -9
  19. package/src/api/interop/InteropClient.js +38 -40
  20. package/src/api/interop/SessionContextGroupClient.js +22 -24
  21. package/src/api/interop/fdc3/PrivateChannelClient.js +6 -6
  22. package/src/api/interop/fdc3/fdc3-1.2.js +1 -1
  23. package/src/api/interop/fdc3/fdc3-2.0.js +4 -4
  24. package/src/api/interop/fdc3/utils.js +12 -8
  25. package/src/api/interop/index.js +7 -3
  26. package/src/api/interop/utils.js +20 -14
  27. package/src/api/platform/Factory.js +5 -5
  28. package/src/api/platform/Instance.js +11 -12
  29. package/src/api/platform/index.js +7 -3
  30. package/src/api/platform/layout/Factory.js +18 -20
  31. package/src/api/platform/layout/Instance.js +2 -2
  32. package/src/api/platform/layout/controllers/splitter-controller.js +1 -1
  33. package/src/api/platform/layout/controllers/tab-drag-controller.js +1 -1
  34. package/src/api/platform/layout/index.js +7 -3
  35. package/src/api/platform/layout/utils/bounds-observer.js +5 -3
  36. package/src/api/snapshot-source/Factory.js +1 -1
  37. package/src/api/snapshot-source/Instance.js +33 -35
  38. package/src/api/snapshot-source/index.js +7 -3
  39. package/src/api/snapshot-source/utils.js +2 -1
  40. package/src/api/view/Factory.js +2 -2
  41. package/src/api/view/index.js +7 -3
  42. package/src/api/window/Factory.js +2 -2
  43. package/src/api/window/Instance.d.ts +3 -0
  44. package/src/api/window/Instance.js +3 -0
  45. package/src/api/window/index.js +7 -3
  46. package/src/environment/node-env.js +2 -2
  47. package/src/environment/openfin-env.js +15 -17
  48. package/src/fdc3.js +1 -1
  49. package/src/mock.js +1 -2
  50. package/src/transport/transport.js +26 -28
  51. package/src/transport/wire.d.ts +9 -7
  52. package/src/util/http.d.ts +1 -1
  53. package/src/util/http.js +16 -11
  54. package/src/util/normalize-config.js +5 -5
@@ -513,7 +513,7 @@ class InteropBroker extends base_1.Base {
513
513
  */
514
514
  // eslint-disable-next-line class-methods-use-this
515
515
  async handleFiredIntent(intent, clientIdentity) {
516
- const warning = utils_1.generateOverrideWarning('fdc3.raiseIntent', 'InteropBroker.handleFiredIntent', clientIdentity, 'interopClient.fireIntent');
516
+ const warning = (0, utils_1.generateOverrideWarning)('fdc3.raiseIntent', 'InteropBroker.handleFiredIntent', clientIdentity, 'interopClient.fireIntent');
517
517
  console.warn(warning);
518
518
  throw new Error(utils_1.BROKER_ERRORS.fireIntent);
519
519
  }
@@ -571,7 +571,7 @@ class InteropBroker extends base_1.Base {
571
571
  */
572
572
  // eslint-disable-next-line class-methods-use-this
573
573
  async handleInfoForIntent(options, clientIdentity) {
574
- const warning = utils_1.generateOverrideWarning('fdc3.findIntent', 'InteropBroker.handleInfoForIntent', clientIdentity, 'interopClient.getInfoForIntent');
574
+ const warning = (0, utils_1.generateOverrideWarning)('fdc3.findIntent', 'InteropBroker.handleInfoForIntent', clientIdentity, 'interopClient.getInfoForIntent');
575
575
  console.warn(warning);
576
576
  throw new Error(utils_1.BROKER_ERRORS.getInfoForIntent);
577
577
  }
@@ -586,7 +586,7 @@ class InteropBroker extends base_1.Base {
586
586
  */
587
587
  // eslint-disable-next-line class-methods-use-this
588
588
  async handleInfoForIntentsByContext(context, clientIdentity) {
589
- const warning = utils_1.generateOverrideWarning('fdc3.findIntentsByContext', 'InteropBroker.handleInfoForIntentsByContext', clientIdentity, 'interopClient.getInfoForIntentsByContext');
589
+ const warning = (0, utils_1.generateOverrideWarning)('fdc3.findIntentsByContext', 'InteropBroker.handleInfoForIntentsByContext', clientIdentity, 'interopClient.getInfoForIntentsByContext');
590
590
  console.warn(warning);
591
591
  throw new Error(utils_1.BROKER_ERRORS.getInfoForIntentsByContext);
592
592
  }
@@ -601,7 +601,7 @@ class InteropBroker extends base_1.Base {
601
601
  */
602
602
  // eslint-disable-next-line class-methods-use-this
603
603
  async handleFiredIntentForContext(contextForIntent, clientIdentity) {
604
- const warning = utils_1.generateOverrideWarning('fdc3.raiseIntentForContext', 'InteropBroker.handleFiredIntentForContext', clientIdentity, 'interopClient.fireIntentForContext');
604
+ const warning = (0, utils_1.generateOverrideWarning)('fdc3.raiseIntentForContext', 'InteropBroker.handleFiredIntentForContext', clientIdentity, 'interopClient.fireIntentForContext');
605
605
  console.warn(warning);
606
606
  throw new Error(utils_1.BROKER_ERRORS.fireIntentForContext);
607
607
  }
@@ -624,7 +624,7 @@ class InteropBroker extends base_1.Base {
624
624
  */
625
625
  // eslint-disable-next-line class-methods-use-this
626
626
  async fdc3HandleOpen({ app, context }, clientIdentity) {
627
- const warning = utils_1.generateOverrideWarning('fdc3.open', 'InteropBroker.fdc3HandleOpen', clientIdentity);
627
+ const warning = (0, utils_1.generateOverrideWarning)('fdc3.open', 'InteropBroker.fdc3HandleOpen', clientIdentity);
628
628
  console.warn(warning);
629
629
  throw new Error(utils_1.BROKER_ERRORS.fdc3Open);
630
630
  }
@@ -636,7 +636,7 @@ class InteropBroker extends base_1.Base {
636
636
  */
637
637
  // eslint-disable-next-line class-methods-use-this
638
638
  async fdc3HandleFindInstances(app, clientIdentity) {
639
- const warning = utils_1.generateOverrideWarning('fdc3.open', 'InteropBroker.fdc3HandleFindInstances', clientIdentity);
639
+ const warning = (0, utils_1.generateOverrideWarning)('fdc3.open', 'InteropBroker.fdc3HandleFindInstances', clientIdentity);
640
640
  console.warn(warning);
641
641
  throw new Error(utils_1.BROKER_ERRORS.fdc3FindInstances);
642
642
  }
@@ -648,7 +648,7 @@ class InteropBroker extends base_1.Base {
648
648
  */
649
649
  // eslint-disable-next-line class-methods-use-this
650
650
  async fdc3HandleGetAppMetadata(app, clientIdentity) {
651
- const warning = utils_1.generateOverrideWarning('fdc3.getAppMetadata', 'InteropBroker.fdc3HandleGetAppMetadata', clientIdentity);
651
+ const warning = (0, utils_1.generateOverrideWarning)('fdc3.getAppMetadata', 'InteropBroker.fdc3HandleGetAppMetadata', clientIdentity);
652
652
  console.warn(warning);
653
653
  throw new Error(utils_1.BROKER_ERRORS.fdc3GetAppMetadata);
654
654
  }
@@ -696,7 +696,7 @@ class InteropBroker extends base_1.Base {
696
696
  */
697
697
  // eslint-disable-next-line class-methods-use-this
698
698
  async fdc3HandleGetInfo(clientIdentity) {
699
- const warning = utils_1.generateOverrideWarning('fdc3.getInfo', 'InteropBroker.fdc3GetInfo', clientIdentity);
699
+ const warning = (0, utils_1.generateOverrideWarning)('fdc3.getInfo', 'InteropBroker.fdc3GetInfo', clientIdentity);
700
700
  console.warn(warning);
701
701
  throw new Error(utils_1.BROKER_ERRORS.fdc3GetInfo);
702
702
  }
@@ -971,7 +971,7 @@ class InteropBroker extends base_1.Base {
971
971
  });
972
972
  this.clientDisconnected(clientIdentity);
973
973
  });
974
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
974
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
975
975
  // @ts-ignore
976
976
  channel.beforeAction(async (action, payload, clientIdentity) => {
977
977
  if (!(await this.isActionAuthorized(action, payload, clientIdentity))) {
@@ -1,18 +1,16 @@
1
1
  "use strict";
2
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
3
- if (!privateMap.has(receiver)) {
4
- throw new TypeError("attempted to set private field on non-instance");
5
- }
6
- privateMap.set(receiver, value);
7
- return value;
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
8
7
  };
9
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
10
- if (!privateMap.has(receiver)) {
11
- throw new TypeError("attempted to get private field on non-instance");
12
- }
13
- return privateMap.get(receiver);
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
14
12
  };
15
- var _clientPromise, _sessionContextGroups;
13
+ var _InteropClient_clientPromise, _InteropClient_sessionContextGroups;
16
14
  Object.defineProperty(exports, "__esModule", { value: true });
17
15
  exports.InteropClient = void 0;
18
16
  const base_1 = require("../base");
@@ -157,14 +155,14 @@ const utils_1 = require("./utils");
157
155
  class InteropClient extends base_1.Base {
158
156
  constructor(wire, name, interopConfig = {}) {
159
157
  super(wire);
160
- _clientPromise.set(this, void 0);
161
- _sessionContextGroups.set(this, void 0);
162
- __classPrivateFieldSet(this, _sessionContextGroups, new Map());
163
- __classPrivateFieldSet(this, _clientPromise, this.wire.environment.whenReady().then(() => {
158
+ _InteropClient_clientPromise.set(this, void 0);
159
+ _InteropClient_sessionContextGroups.set(this, void 0);
160
+ __classPrivateFieldSet(this, _InteropClient_sessionContextGroups, new Map(), "f");
161
+ __classPrivateFieldSet(this, _InteropClient_clientPromise, this.wire.environment.whenReady().then(() => {
164
162
  return this.fin.InterApplicationBus.Channel.connect(`interop-broker-${name}`, {
165
163
  payload: interopConfig
166
164
  });
167
- }));
165
+ }), "f");
168
166
  }
169
167
  /*
170
168
  Client APIs
@@ -179,7 +177,7 @@ class InteropClient extends base_1.Base {
179
177
  this.wire.sendAction('interop-client-set-context').catch((e) => {
180
178
  // don't expose, analytics-only call
181
179
  });
182
- const client = await __classPrivateFieldGet(this, _clientPromise);
180
+ const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
183
181
  return client.dispatch('setContext', { context });
184
182
  }
185
183
  /**
@@ -196,16 +194,16 @@ class InteropClient extends base_1.Base {
196
194
  if (typeof handler !== 'function') {
197
195
  throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
198
196
  }
199
- const client = await __classPrivateFieldGet(this, _clientPromise);
197
+ const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
200
198
  let handlerId;
201
199
  if (contextType) {
202
- handlerId = `invokeContextHandler-${contextType}-${utils_1.generateId()}`;
200
+ handlerId = `invokeContextHandler-${contextType}-${(0, utils_1.generateId)()}`;
203
201
  console.warn(`Warning: By providing a contextType (${contextType}), you are using the experimental addContextHandler. To avoid issues, make sure you are adding your context handlers at the top level in your application.`);
204
202
  }
205
203
  else {
206
204
  handlerId = 'invokeContextHandler';
207
205
  }
208
- const wrappedHandler = utils_1.wrapContextHandler(handler, handlerId);
206
+ const wrappedHandler = (0, utils_1.wrapContextHandler)(handler, handlerId);
209
207
  client.register(handlerId, wrappedHandler);
210
208
  await client.dispatch('contextHandlerRegistered', { handlerId, contextType });
211
209
  return {
@@ -228,7 +226,7 @@ class InteropClient extends base_1.Base {
228
226
  this.wire.sendAction('interop-client-get-context-groups').catch((e) => {
229
227
  // don't expose, analytics-only call
230
228
  });
231
- const client = await __classPrivateFieldGet(this, _clientPromise);
229
+ const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
232
230
  return client.dispatch('getContextGroups');
233
231
  }
234
232
  /**
@@ -247,7 +245,7 @@ class InteropClient extends base_1.Base {
247
245
  this.wire.sendAction('interop-client-join-context-group').catch((e) => {
248
246
  // don't expose, analytics-only call
249
247
  });
250
- const client = await __classPrivateFieldGet(this, _clientPromise);
248
+ const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
251
249
  if (!contextGroupId) {
252
250
  throw new Error('No contextGroupId specified for joinContextGroup.');
253
251
  }
@@ -265,7 +263,7 @@ class InteropClient extends base_1.Base {
265
263
  this.wire.sendAction('interop-client-remove-from-context-group').catch((e) => {
266
264
  // don't expose, analytics-only call
267
265
  });
268
- const client = await __classPrivateFieldGet(this, _clientPromise);
266
+ const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
269
267
  return client.dispatch('removeFromContextGroup', { target });
270
268
  }
271
269
  /**
@@ -279,7 +277,7 @@ class InteropClient extends base_1.Base {
279
277
  this.wire.sendAction('interop-client-get-all-clients-in-context-group').catch((e) => {
280
278
  // don't expose, analytics-only call
281
279
  });
282
- const client = await __classPrivateFieldGet(this, _clientPromise);
280
+ const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
283
281
  if (!contextGroupId) {
284
282
  throw new Error('No contextGroupId specified for getAllClientsInContextGroup.');
285
283
  }
@@ -296,7 +294,7 @@ class InteropClient extends base_1.Base {
296
294
  this.wire.sendAction('interop-client-get-info-for-context-group').catch((e) => {
297
295
  // don't expose, analytics-only call
298
296
  });
299
- const client = await __classPrivateFieldGet(this, _clientPromise);
297
+ const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
300
298
  if (!contextGroupId) {
301
299
  throw new Error('No contextGroupId specified for getInfoForContextGroup.');
302
300
  }
@@ -313,7 +311,7 @@ class InteropClient extends base_1.Base {
313
311
  this.wire.sendAction('interop-client-fire-intent').catch((e) => {
314
312
  // don't expose, this is only for api analytics purposes
315
313
  });
316
- const client = await __classPrivateFieldGet(this, _clientPromise);
314
+ const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
317
315
  return client.dispatch('fireIntent', intent);
318
316
  }
319
317
  /**
@@ -328,9 +326,9 @@ class InteropClient extends base_1.Base {
328
326
  this.wire.sendAction('interop-client-register-intent-handler').catch((e) => {
329
327
  // don't expose, this is only for api analytics purposes
330
328
  });
331
- const client = await __classPrivateFieldGet(this, _clientPromise);
329
+ const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
332
330
  const handlerId = `intent-handler-${intentName}`;
333
- const wrappedHandler = utils_1.wrapIntentHandler(handler, handlerId);
331
+ const wrappedHandler = (0, utils_1.wrapIntentHandler)(handler, handlerId);
334
332
  try {
335
333
  await client.register(handlerId, wrappedHandler);
336
334
  await client.dispatch('intentHandlerRegistered', { handlerId, ...options });
@@ -356,7 +354,7 @@ class InteropClient extends base_1.Base {
356
354
  this.wire.sendAction('interop-client-get-current-context').catch((e) => {
357
355
  // don't expose, analytics-only call
358
356
  });
359
- const client = await __classPrivateFieldGet(this, _clientPromise);
357
+ const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
360
358
  return client.dispatch('getCurrentContext', { contextType });
361
359
  }
362
360
  /**
@@ -370,7 +368,7 @@ class InteropClient extends base_1.Base {
370
368
  this.wire.sendAction('interop-client-get-info-for-intent').catch((e) => {
371
369
  // don't expose, analytics-only call
372
370
  });
373
- const client = await __classPrivateFieldGet(this, _clientPromise);
371
+ const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
374
372
  return client.dispatch('getInfoForIntent', options);
375
373
  }
376
374
  /**
@@ -384,7 +382,7 @@ class InteropClient extends base_1.Base {
384
382
  this.wire.sendAction('interop-client-get-info-for-intents-by-context').catch((e) => {
385
383
  // don't expose, analytics-only call
386
384
  });
387
- const client = await __classPrivateFieldGet(this, _clientPromise);
385
+ const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
388
386
  return client.dispatch('getInfoForIntentsByContext', context);
389
387
  }
390
388
  /**
@@ -399,7 +397,7 @@ class InteropClient extends base_1.Base {
399
397
  this.wire.sendAction('interop-client-fire-intent-for-context').catch((e) => {
400
398
  // don't expose, analytics-only call
401
399
  });
402
- const client = await __classPrivateFieldGet(this, _clientPromise);
400
+ const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
403
401
  return client.dispatch('fireIntentForContext', context);
404
402
  }
405
403
  /**
@@ -413,19 +411,19 @@ class InteropClient extends base_1.Base {
413
411
  */
414
412
  async joinSessionContextGroup(sessionContextGroupId) {
415
413
  try {
416
- const currentSessionContextGroup = __classPrivateFieldGet(this, _sessionContextGroups).get(sessionContextGroupId);
414
+ const currentSessionContextGroup = __classPrivateFieldGet(this, _InteropClient_sessionContextGroups, "f").get(sessionContextGroupId);
417
415
  if (currentSessionContextGroup) {
418
416
  return currentSessionContextGroup.getUserInstance();
419
417
  }
420
- const client = await __classPrivateFieldGet(this, _clientPromise);
418
+ const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
421
419
  const { hasConflict } = await client.dispatch('sessionContextGroup:createIfNeeded', {
422
420
  sessionContextGroupId
423
421
  });
424
422
  if (hasConflict) {
425
423
  console.warn(`A (non-session) context group with the name "${sessionContextGroupId}" already exists. If you are trying to join a Context Group, call joinContextGroup instead.`);
426
424
  }
427
- const newSessionContextGroup = new SessionContextGroupClient_1.default(this.wire, __classPrivateFieldGet(this, _clientPromise), sessionContextGroupId);
428
- __classPrivateFieldGet(this, _sessionContextGroups).set(sessionContextGroupId, newSessionContextGroup);
425
+ const newSessionContextGroup = new SessionContextGroupClient_1.default(this.wire, __classPrivateFieldGet(this, _InteropClient_clientPromise, "f"), sessionContextGroupId);
426
+ __classPrivateFieldGet(this, _InteropClient_sessionContextGroups, "f").set(sessionContextGroupId, newSessionContextGroup);
429
427
  return newSessionContextGroup.getUserInstance();
430
428
  }
431
429
  catch (error) {
@@ -444,7 +442,7 @@ class InteropClient extends base_1.Base {
444
442
  this.wire.sendAction('interop-client-add-ondisconnection-listener').catch((e) => {
445
443
  // don't expose, analytics-only call
446
444
  });
447
- const client = await __classPrivateFieldGet(this, _clientPromise);
445
+ const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
448
446
  return client.onDisconnection((event) => {
449
447
  const { uuid } = event;
450
448
  listener({ type: 'interop-broker', topic: 'disconnected', brokerName: uuid });
@@ -452,9 +450,9 @@ class InteropClient extends base_1.Base {
452
450
  }
453
451
  // used to ferry fdc3-only calls from the fdc3 shim to the Interop Broker
454
452
  static async ferryFdc3Call(interopClient, action, payload) {
455
- const client = await __classPrivateFieldGet(interopClient, _clientPromise);
453
+ const client = await __classPrivateFieldGet(interopClient, _InteropClient_clientPromise, "f");
456
454
  return client.dispatch(action, payload || null);
457
455
  }
458
456
  }
459
457
  exports.InteropClient = InteropClient;
460
- _clientPromise = new WeakMap(), _sessionContextGroups = new WeakMap();
458
+ _InteropClient_clientPromise = new WeakMap(), _InteropClient_sessionContextGroups = new WeakMap();
@@ -1,27 +1,25 @@
1
1
  "use strict";
2
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
3
- if (!privateMap.has(receiver)) {
4
- throw new TypeError("attempted to set private field on non-instance");
5
- }
6
- privateMap.set(receiver, value);
7
- return value;
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
8
7
  };
9
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
10
- if (!privateMap.has(receiver)) {
11
- throw new TypeError("attempted to get private field on non-instance");
12
- }
13
- return privateMap.get(receiver);
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
14
12
  };
15
- var _clientPromise;
13
+ var _SessionContextGroupClient_clientPromise;
16
14
  Object.defineProperty(exports, "__esModule", { value: true });
17
15
  const base_1 = require("../base");
18
16
  const utils_1 = require("./utils");
19
17
  class SessionContextGroupClient extends base_1.Base {
20
18
  constructor(wire, client, id) {
21
19
  super(wire);
22
- _clientPromise.set(this, void 0);
20
+ _SessionContextGroupClient_clientPromise.set(this, void 0);
23
21
  this.id = id;
24
- __classPrivateFieldSet(this, _clientPromise, client);
22
+ __classPrivateFieldSet(this, _SessionContextGroupClient_clientPromise, client, "f");
25
23
  }
26
24
  /**
27
25
  * Sets a context for the session context group.
@@ -33,7 +31,7 @@ class SessionContextGroupClient extends base_1.Base {
33
31
  this.wire.sendAction('interop-session-context-group-set-context').catch((e) => {
34
32
  // don't expose, analytics-only call
35
33
  });
36
- const client = await __classPrivateFieldGet(this, _clientPromise);
34
+ const client = await __classPrivateFieldGet(this, _SessionContextGroupClient_clientPromise, "f");
37
35
  return client.dispatch(`sessionContextGroup:setContext-${this.id}`, {
38
36
  sessionContextGroupId: this.id,
39
37
  context
@@ -43,7 +41,7 @@ class SessionContextGroupClient extends base_1.Base {
43
41
  this.wire.sendAction('interop-session-context-group-get-context').catch((e) => {
44
42
  // don't expose, analytics-only call
45
43
  });
46
- const client = await __classPrivateFieldGet(this, _clientPromise);
44
+ const client = await __classPrivateFieldGet(this, _SessionContextGroupClient_clientPromise, "f");
47
45
  return client.dispatch(`sessionContextGroup:getContext-${this.id}`, {
48
46
  sessionContextGroupId: this.id,
49
47
  type
@@ -56,20 +54,20 @@ class SessionContextGroupClient extends base_1.Base {
56
54
  if (typeof contextHandler !== 'function') {
57
55
  throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
58
56
  }
59
- const client = await __classPrivateFieldGet(this, _clientPromise);
57
+ const client = await __classPrivateFieldGet(this, _SessionContextGroupClient_clientPromise, "f");
60
58
  let handlerId;
61
59
  if (contextType) {
62
- handlerId = `sessionContextHandler:invoke-${this.id}-${contextType}-${utils_1.generateId()}`;
60
+ handlerId = `sessionContextHandler:invoke-${this.id}-${contextType}-${(0, utils_1.generateId)()}`;
63
61
  }
64
62
  else {
65
63
  handlerId = `sessionContextHandler:invoke-${this.id}`;
66
64
  }
67
- client.register(handlerId, utils_1.wrapContextHandler(contextHandler, handlerId));
65
+ client.register(handlerId, (0, utils_1.wrapContextHandler)(contextHandler, handlerId));
68
66
  client.dispatch(`sessionContextGroup:handlerAdded-${this.id}`, { handlerId, contextType });
69
67
  return { unsubscribe: await this.createUnsubscribeCb(handlerId) };
70
68
  }
71
69
  async createUnsubscribeCb(handlerId) {
72
- const client = await __classPrivateFieldGet(this, _clientPromise);
70
+ const client = await __classPrivateFieldGet(this, _SessionContextGroupClient_clientPromise, "f");
73
71
  return async () => {
74
72
  client.remove(handlerId);
75
73
  await client.dispatch(`sessionContextGroup:handlerRemoved-${this.id}`, { handlerId });
@@ -78,11 +76,11 @@ class SessionContextGroupClient extends base_1.Base {
78
76
  getUserInstance() {
79
77
  return {
80
78
  id: this.id,
81
- setContext: utils_1.wrapInTryCatch(this.setContext.bind(this), 'Failed to set context: '),
82
- getCurrentContext: utils_1.wrapInTryCatch(this.getCurrentContext.bind(this), 'Failed to get context: '),
83
- addContextHandler: utils_1.wrapInTryCatch(this.addContextHandler.bind(this), 'Failed to add context handler: ')
79
+ setContext: (0, utils_1.wrapInTryCatch)(this.setContext.bind(this), 'Failed to set context: '),
80
+ getCurrentContext: (0, utils_1.wrapInTryCatch)(this.getCurrentContext.bind(this), 'Failed to get context: '),
81
+ addContextHandler: (0, utils_1.wrapInTryCatch)(this.addContextHandler.bind(this), 'Failed to add context handler: ')
84
82
  };
85
83
  }
86
84
  }
87
85
  exports.default = SessionContextGroupClient;
88
- _clientPromise = new WeakMap();
86
+ _SessionContextGroupClient_clientPromise = new WeakMap();
@@ -20,12 +20,12 @@ class PrivateChannelClient {
20
20
  }
21
21
  let handlerId;
22
22
  if (contextType) {
23
- handlerId = `contextHandler:invoke-${this.id}-${contextType}-${utils_1.generateId()}`;
23
+ handlerId = `contextHandler:invoke-${this.id}-${contextType}-${(0, utils_1.generateId)()}`;
24
24
  }
25
25
  else {
26
- handlerId = `contextHandler:invoke-${this.id}-${utils_1.generateId()}`;
26
+ handlerId = `contextHandler:invoke-${this.id}-${(0, utils_1.generateId)()}`;
27
27
  }
28
- this.client.register(handlerId, utils_1.wrapContextHandler(handler, handlerId));
28
+ this.client.register(handlerId, (0, utils_1.wrapContextHandler)(handler, handlerId));
29
29
  const listener = { unsubscribe: await this.createContextUnsubscribeCb(handlerId) };
30
30
  this.listeners.set(handlerId, listener);
31
31
  await this.client.dispatch(`contextHandlerAdded`, { handlerId, contextType });
@@ -46,7 +46,7 @@ class PrivateChannelClient {
46
46
  };
47
47
  }
48
48
  onAddContextListener(handler) {
49
- const handlerId = `onContextHandlerAdded:invoke-${this.id}-${utils_1.generateId()}`;
49
+ const handlerId = `onContextHandlerAdded:invoke-${this.id}-${(0, utils_1.generateId)()}`;
50
50
  this.client.register(handlerId, handler);
51
51
  const listener = { unsubscribe: this.createNonStandardUnsubscribeCb(handlerId) };
52
52
  this.listeners.set(handlerId, listener);
@@ -54,7 +54,7 @@ class PrivateChannelClient {
54
54
  return listener;
55
55
  }
56
56
  onDisconnect(handler) {
57
- const handlerId = `onDisconnect:invoke-${this.id}-${utils_1.generateId()}`;
57
+ const handlerId = `onDisconnect:invoke-${this.id}-${(0, utils_1.generateId)()}`;
58
58
  this.client.register(handlerId, handler);
59
59
  const listener = { unsubscribe: this.createNonStandardUnsubscribeCb(handlerId) };
60
60
  this.listeners.set(handlerId, listener);
@@ -62,7 +62,7 @@ class PrivateChannelClient {
62
62
  return listener;
63
63
  }
64
64
  onUnsubscribe(handler) {
65
- const handlerId = `onUnsubscribe:invoke-${this.id}-${utils_1.generateId()}`;
65
+ const handlerId = `onUnsubscribe:invoke-${this.id}-${(0, utils_1.generateId)()}`;
66
66
  this.client.register(handlerId, handler);
67
67
  const listener = { unsubscribe: this.createNonStandardUnsubscribeCb(handlerId) };
68
68
  this.listeners.set(handlerId, listener);
@@ -329,7 +329,7 @@ class Fdc3Module extends base_1.Base {
329
329
  // we do not want to expose this error, just continue if this analytics-only call fails
330
330
  });
331
331
  const sessionContextGroup = await this.fin.me.interop.joinSessionContextGroup(channelId);
332
- return utils_1.buildAppChannelObject(sessionContextGroup);
332
+ return (0, utils_1.buildAppChannelObject)(sessionContextGroup);
333
333
  }
334
334
  /**
335
335
  * Returns metadata relating to the FDC3 object and its provider, including the supported version of the FDC3 specification and the name of the provider of the implementation.
@@ -305,7 +305,7 @@ class Fdc3Module2 extends base_1.Base {
305
305
  // we do not want to expose this error, just continue if this analytics-only call fails
306
306
  });
307
307
  try {
308
- return utils_2.getIntentResolution(this.fin.me.interop, context, app, intent);
308
+ return (0, utils_2.getIntentResolution)(this.fin.me.interop, context, app, intent);
309
309
  }
310
310
  catch (error) {
311
311
  const errorToThrow = error.message === utils_1.BROKER_ERRORS.fireIntent ? 'ResolverUnavailable' : error;
@@ -325,7 +325,7 @@ class Fdc3Module2 extends base_1.Base {
325
325
  // we do not want to expose this error, just continue if this analytics-only call fails
326
326
  });
327
327
  try {
328
- return utils_2.getIntentResolution(this.fin.me.interop, context, app);
328
+ return (0, utils_2.getIntentResolution)(this.fin.me.interop, context, app);
329
329
  }
330
330
  catch (error) {
331
331
  const errorToThrow = error.message === utils_1.BROKER_ERRORS.fireIntent ? 'ResolverUnavailable' : error;
@@ -388,12 +388,12 @@ class Fdc3Module2 extends base_1.Base {
388
388
  * @tutorial fdc3v2.createPrivateChannel
389
389
  */
390
390
  async createPrivateChannel() {
391
- const channelId = utils_1.generateId();
391
+ const channelId = (0, utils_1.generateId)();
392
392
  const channelProvider = await this.fin.InterApplicationBus.Channel.create(channelId);
393
393
  const newPrivateChannelProvider = new PrivateChannelProvider_1.PrivateChannelProvider(channelProvider, channelId);
394
394
  const channelClient = await this.fin.InterApplicationBus.Channel.connect(channelId);
395
395
  const newPrivateChannelClient = new PrivateChannelClient_1.PrivateChannelClient(channelClient, channelId);
396
- return utils_2.buildPrivateChannelObject(newPrivateChannelClient);
396
+ return (0, utils_2.buildPrivateChannelObject)(newPrivateChannelClient);
397
397
  }
398
398
  /**
399
399
  * Retrieves a list of the User Channels available for the app to join.
@@ -21,7 +21,7 @@ var ResultError;
21
21
  */
22
22
  ResultError["IntentHandlerRejected"] = "IntentHandlerRejected";
23
23
  })(ResultError = exports.ResultError || (exports.ResultError = {}));
24
- exports.buildPrivateChannelObject = (privateChannelClient) => {
24
+ const buildPrivateChannelObject = (privateChannelClient) => {
25
25
  let clientDisconnected = false;
26
26
  const checkIfClientDisconnected = () => {
27
27
  if (clientDisconnected) {
@@ -70,7 +70,8 @@ exports.buildPrivateChannelObject = (privateChannelClient) => {
70
70
  }
71
71
  };
72
72
  };
73
- exports.buildAppChannelObject = (sessionContextGroup) => {
73
+ exports.buildPrivateChannelObject = buildPrivateChannelObject;
74
+ const buildAppChannelObject = (sessionContextGroup) => {
74
75
  return {
75
76
  id: sessionContextGroup.id,
76
77
  type: 'app',
@@ -95,20 +96,22 @@ exports.buildAppChannelObject = (sessionContextGroup) => {
95
96
  }
96
97
  };
97
98
  };
98
- exports.connectPrivateChannel = async (channelId) => {
99
+ exports.buildAppChannelObject = buildAppChannelObject;
100
+ const connectPrivateChannel = async (channelId) => {
99
101
  try {
100
102
  const channelClient = await fin.InterApplicationBus.Channel.connect(channelId);
101
103
  const privateChannelClient = new PrivateChannelClient_1.PrivateChannelClient(channelClient, channelId);
102
- return exports.buildPrivateChannelObject(privateChannelClient);
104
+ return (0, exports.buildPrivateChannelObject)(privateChannelClient);
103
105
  }
104
106
  catch (error) {
105
107
  throw new Error(`Private Channel with id: ${channelId} doesn't exist`);
106
108
  }
107
109
  };
108
- exports.getIntentResolution = async (interopModule, context, app, intent) => {
110
+ exports.connectPrivateChannel = connectPrivateChannel;
111
+ const getIntentResolution = async (interopModule, context, app, intent) => {
109
112
  // Generate an ID to make a session context group with. We will pass that ID to the Broker.
110
113
  // The broker will then setContext on that session context group later with our Intent Result,
111
- const guid = utils_1.generateId();
114
+ const guid = (0, utils_1.generateId)();
112
115
  // Promise we'll use in getResult
113
116
  const getResultPromise = new Promise((resolve) => {
114
117
  fin.InterApplicationBus.subscribe({ uuid: '*' }, guid, (intentResult) => {
@@ -132,12 +135,12 @@ exports.getIntentResolution = async (interopModule, context, app, intent) => {
132
135
  if (type && id && typeof id === 'string') {
133
136
  switch (type) {
134
137
  case 'private': {
135
- intentResult = await exports.connectPrivateChannel(id);
138
+ intentResult = await (0, exports.connectPrivateChannel)(id);
136
139
  break;
137
140
  }
138
141
  case 'app': {
139
142
  const sessionContextGroup = await interopModule.joinSessionContextGroup(id);
140
- intentResult = exports.buildAppChannelObject(sessionContextGroup);
143
+ intentResult = (0, exports.buildAppChannelObject)(sessionContextGroup);
141
144
  break;
142
145
  }
143
146
  default: {
@@ -165,3 +168,4 @@ exports.getIntentResolution = async (interopModule, context, app, intent) => {
165
168
  }
166
169
  return { ...intentResolutionInfoFromBroker, getResult };
167
170
  };
171
+ exports.getIntentResolution = getIntentResolution;
@@ -1,14 +1,18 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
8
12
  }));
9
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
11
- }
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
13
17
  const Factory_1 = require("./Factory");
14
18
  exports.default = Factory_1.default;