@openfin/node-adapter 43.100.91 → 43.100.93

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 (2) hide show
  1. package/out/node-adapter.js +108 -66
  2. package/package.json +2 -2
@@ -8747,7 +8747,7 @@ var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateF
8747
8747
  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");
8748
8748
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
8749
8749
  };
8750
- var __importDefault$5 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
8750
+ var __importDefault$6 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
8751
8751
  return (mod && mod.__esModule) ? mod : { "default": mod };
8752
8752
  };
8753
8753
  var _ConnectionManager_messageReceiver, _ConnectionManager_rtcConnectionManager;
@@ -8761,7 +8761,7 @@ const ice_manager_1 = iceManager;
8761
8761
  const provider_1$1 = provider;
8762
8762
  const message_receiver_1 = messageReceiver$1;
8763
8763
  const protocol_manager_1 = protocolManager;
8764
- const strategy_3 = __importDefault$5(strategy);
8764
+ const strategy_3 = __importDefault$6(strategy);
8765
8765
  class ConnectionManager extends base_1$j.Base {
8766
8766
  static getProtocolOptionsFromStrings(protocols) {
8767
8767
  return protocols.map((protocol) => {
@@ -13428,16 +13428,16 @@ var __classPrivateFieldGet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateF
13428
13428
  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");
13429
13429
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
13430
13430
  };
13431
- var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
13431
+ var __importDefault$5 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
13432
13432
  return (mod && mod.__esModule) ? mod : { "default": mod };
13433
13433
  };
13434
13434
  var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
13435
13435
  Object.defineProperty(InteropBroker$1, "__esModule", { value: true });
13436
13436
  InteropBroker$1.InteropBroker = void 0;
13437
13437
  const base_1$6 = base;
13438
- const SessionContextGroupBroker_1 = __importDefault$4(SessionContextGroupBroker$1);
13438
+ const SessionContextGroupBroker_1 = __importDefault$5(SessionContextGroupBroker$1);
13439
13439
  const utils_1$7 = utils$3;
13440
- const isEqual_1$1 = __importDefault$4(require$$3);
13440
+ const isEqual_1$2 = __importDefault$5(require$$3);
13441
13441
  const PrivateChannelProvider_1 = PrivateChannelProvider$1;
13442
13442
  const lazy_1$1 = lazy;
13443
13443
  const defaultContextGroups = [
@@ -13636,7 +13636,7 @@ class InteropBroker extends base_1$6.Base {
13636
13636
  constructor(...unused) {
13637
13637
  if (unused.length) {
13638
13638
  const [_ignore1, ignore2, opts] = unused;
13639
- if (opts && typeof opts === 'object' && !(0, isEqual_1$1.default)(opts, args[2])) {
13639
+ if (opts && typeof opts === 'object' && !(0, isEqual_1$2.default)(opts, args[2])) {
13640
13640
  // eslint-disable-next-line no-console
13641
13641
  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.');
13642
13642
  super(args[0], args[1], opts);
@@ -14788,14 +14788,14 @@ var __classPrivateFieldGet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
14788
14788
  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");
14789
14789
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
14790
14790
  };
14791
- var __importDefault$3 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
14791
+ var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
14792
14792
  return (mod && mod.__esModule) ? mod : { "default": mod };
14793
14793
  };
14794
14794
  var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory;
14795
14795
  Object.defineProperty(InteropClient$1, "__esModule", { value: true });
14796
14796
  InteropClient$1.InteropClient = void 0;
14797
14797
  const base_1$4 = base;
14798
- const SessionContextGroupClient_1 = __importDefault$3(SessionContextGroupClient$1);
14798
+ const SessionContextGroupClient_1 = __importDefault$4(SessionContextGroupClient$1);
14799
14799
  const utils_1$5 = utils$3;
14800
14800
  /**
14801
14801
  * The Interop Client API is broken up into two groups:
@@ -15537,15 +15537,86 @@ class PrivateChannelClient {
15537
15537
  }
15538
15538
  PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
15539
15539
 
15540
+ var fdc3Channels2_0 = {};
15541
+
15542
+ var fdc3Channels1_2 = {};
15543
+
15544
+ var __importDefault$3 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
15545
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15546
+ };
15547
+ Object.defineProperty(fdc3Channels1_2, "__esModule", { value: true });
15548
+ fdc3Channels1_2.createV1Channel = void 0;
15549
+ const isEqual_1$1 = __importDefault$3(require$$3);
15550
+ const createV1Channel = (sessionContextGroup) => {
15551
+ return {
15552
+ id: sessionContextGroup.id,
15553
+ type: 'app',
15554
+ broadcast: sessionContextGroup.setContext,
15555
+ getCurrentContext: async (contextType) => {
15556
+ const context = await sessionContextGroup.getCurrentContext(contextType);
15557
+ return context === undefined ? null : context;
15558
+ },
15559
+ // @ts-expect-error TODO [CORE-1524]
15560
+ addContextListener: (contextType, handler) => {
15561
+ let realHandler;
15562
+ let realType;
15563
+ if (typeof contextType === 'function') {
15564
+ console.warn('addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)');
15565
+ realHandler = contextType;
15566
+ }
15567
+ else {
15568
+ realHandler = handler;
15569
+ if (typeof contextType === 'string') {
15570
+ realType = contextType;
15571
+ }
15572
+ }
15573
+ const listener = (async () => {
15574
+ let first = true;
15575
+ const currentContext = await sessionContextGroup.getCurrentContext(realType);
15576
+ const wrappedHandler = (context, contextMetadata) => {
15577
+ if (first) {
15578
+ first = false;
15579
+ if ((0, isEqual_1$1.default)(currentContext, context)) {
15580
+ return;
15581
+ }
15582
+ }
15583
+ // eslint-disable-next-line consistent-return
15584
+ return realHandler(context, contextMetadata);
15585
+ };
15586
+ return sessionContextGroup.addContextHandler(wrappedHandler, realType);
15587
+ })();
15588
+ return {
15589
+ ...listener,
15590
+ unsubscribe: () => listener.then((l) => l.unsubscribe())
15591
+ };
15592
+ }
15593
+ };
15594
+ };
15595
+ fdc3Channels1_2.createV1Channel = createV1Channel;
15596
+
15597
+ Object.defineProperty(fdc3Channels2_0, "__esModule", { value: true });
15598
+ fdc3Channels2_0.createV2Channel = void 0;
15599
+ const fdc3_channels_1_2_1$1 = fdc3Channels1_2;
15600
+ const createV2Channel = (sessionContextGroup) => {
15601
+ const channel = (0, fdc3_channels_1_2_1$1.createV1Channel)(sessionContextGroup);
15602
+ return {
15603
+ ...channel,
15604
+ // @ts-expect-error Type incompatibility on signature.
15605
+ addContextListener: async (...args) => channel.addContextListener(...args)
15606
+ };
15607
+ };
15608
+ fdc3Channels2_0.createV2Channel = createV2Channel;
15609
+
15540
15610
  (function (exports) {
15541
15611
  var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
15542
15612
  return (mod && mod.__esModule) ? mod : { "default": mod };
15543
15613
  };
15544
15614
  Object.defineProperty(exports, "__esModule", { value: true });
15545
- exports.getIntentResolution = exports.isChannel = exports.isContext = exports.connectPrivateChannel = exports.buildAppChannelObject = exports.buildPrivateChannelObject = exports.ChannelError = exports.ResultError = exports.UnsupportedChannelApiError = exports.getUnsupportedChannelApis = void 0;
15615
+ exports.getIntentResolution = exports.isChannel = exports.isContext = exports.connectPrivateChannel = exports.buildPrivateChannelObject = exports.ChannelError = exports.ResultError = exports.UnsupportedChannelApiError = exports.getUnsupportedChannelApis = void 0;
15546
15616
  const utils_1 = utils$3;
15547
15617
  const PrivateChannelClient_1 = PrivateChannelClient$1;
15548
- const isEqual_1 = __importDefault(require$$3);
15618
+ __importDefault(require$$3);
15619
+ const fdc3_channels_2_0_1 = fdc3Channels2_0;
15549
15620
  const getUnsupportedChannelApis = (channelType) => {
15550
15621
  return {
15551
15622
  addContextListener: () => {
@@ -15644,52 +15715,6 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
15644
15715
  };
15645
15716
  };
15646
15717
  exports.buildPrivateChannelObject = buildPrivateChannelObject;
15647
- const buildAppChannelObject = (sessionContextGroup) => {
15648
- return {
15649
- id: sessionContextGroup.id,
15650
- type: 'app',
15651
- broadcast: sessionContextGroup.setContext,
15652
- getCurrentContext: async (contextType) => {
15653
- const context = await sessionContextGroup.getCurrentContext(contextType);
15654
- return context === undefined ? null : context;
15655
- },
15656
- // @ts-expect-error TODO [CORE-1524]
15657
- addContextListener: (contextType, handler) => {
15658
- let realHandler;
15659
- let realType;
15660
- if (typeof contextType === 'function') {
15661
- console.warn('addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)');
15662
- realHandler = contextType;
15663
- }
15664
- else {
15665
- realHandler = handler;
15666
- if (typeof contextType === 'string') {
15667
- realType = contextType;
15668
- }
15669
- }
15670
- const listener = (async () => {
15671
- let first = true;
15672
- const currentContext = await sessionContextGroup.getCurrentContext(realType);
15673
- const wrappedHandler = (context, contextMetadata) => {
15674
- if (first) {
15675
- first = false;
15676
- if ((0, isEqual_1.default)(currentContext, context)) {
15677
- return;
15678
- }
15679
- }
15680
- // eslint-disable-next-line consistent-return
15681
- return realHandler(context, contextMetadata);
15682
- };
15683
- return sessionContextGroup.addContextHandler(wrappedHandler, realType);
15684
- })();
15685
- return {
15686
- ...listener,
15687
- unsubscribe: () => listener.then((l) => l.unsubscribe())
15688
- };
15689
- }
15690
- };
15691
- };
15692
- exports.buildAppChannelObject = buildAppChannelObject;
15693
15718
  const connectPrivateChannel = async (channelId) => {
15694
15719
  try {
15695
15720
  const channelClient = await fin.InterApplicationBus.Channel.connect(channelId);
@@ -15721,6 +15746,10 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
15721
15746
  // Generate an ID to make a session context group with. We will pass that ID to the Broker.
15722
15747
  // The broker will then setContext on that session context group later with our Intent Result,
15723
15748
  const guid = (0, utils_1.generateId)(); // TODO make this undefined in web
15749
+ let isPromiseSettled = false;
15750
+ // Adding the intentResolutionResultId to the intentObj. Because fireIntent only accepts a single arg, we have to slap it in here.
15751
+ const metadata = app ? { target: app, intentResolutionResultId: guid } : { intentResolutionResultId: guid };
15752
+ const intentObj = intent ? { name: intent, context, metadata } : { ...context, metadata };
15724
15753
  // Promise we'll use in getResult
15725
15754
  const getResultPromise = new Promise((resolve, reject) => {
15726
15755
  fin.InterApplicationBus.subscribe({ uuid: '*' }, guid, (intentResult) => {
@@ -15733,13 +15762,24 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
15733
15762
  reject(new Error('getResult is not supported in this environment'));
15734
15763
  });
15735
15764
  });
15736
- // Adding the intentResolutionResultId to the intentObj. Because fireIntent only accepts a single arg, we have to slap it in here.
15737
- const metadata = app ? { target: app, intentResolutionResultId: guid } : { intentResolutionResultId: guid };
15738
- const intentObj = intent ? { name: intent, context, metadata } : { ...context, metadata };
15765
+ getResultPromise
15766
+ .then(() => {
15767
+ isPromiseSettled = true;
15768
+ })
15769
+ .catch(() => {
15770
+ isPromiseSettled = true;
15771
+ });
15739
15772
  // Set up the getResult call.
15740
15773
  const getResult = async () => {
15774
+ // All this mumbo jumbo is needed to make sure that getResult resolves correctly and conforms to the FDC3 spec.
15775
+ if (!isPromiseSettled) {
15776
+ return undefined;
15777
+ }
15741
15778
  let intentResult = await getResultPromise;
15742
- if (!intentResult || typeof intentResult !== 'object') {
15779
+ if (isPromiseSettled && !intentResult) {
15780
+ return undefined;
15781
+ }
15782
+ if (typeof intentResult !== 'object') {
15743
15783
  throw new Error(ResultError.NoResultReturned);
15744
15784
  }
15745
15785
  const { error } = intentResult;
@@ -15755,7 +15795,7 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
15755
15795
  }
15756
15796
  case 'app': {
15757
15797
  const sessionContextGroup = await interopModule.joinSessionContextGroup(id);
15758
- intentResult = (0, exports.buildAppChannelObject)(sessionContextGroup);
15798
+ intentResult = (0, fdc3_channels_2_0_1.createV2Channel)(sessionContextGroup);
15759
15799
  break;
15760
15800
  }
15761
15801
  }
@@ -15865,7 +15905,7 @@ class FDC3ModuleBase {
15865
15905
  *
15866
15906
  * @tutorial fdc3.getOrCreateChannel
15867
15907
  */
15868
- async getOrCreateChannel(channelId) {
15908
+ async getOrCreateChannel(channelId, fdc3Factory) {
15869
15909
  this.wire.sendAction('fdc3-get-or-create-channel').catch((e) => {
15870
15910
  // we do not want to expose this error, just continue if this analytics-only call fails
15871
15911
  });
@@ -15882,7 +15922,7 @@ class FDC3ModuleBase {
15882
15922
  }
15883
15923
  try {
15884
15924
  const sessionContextGroup = await this.client.joinSessionContextGroup(channelId);
15885
- return (0, utils_1$4.buildAppChannelObject)(sessionContextGroup);
15925
+ return fdc3Factory(sessionContextGroup);
15886
15926
  }
15887
15927
  catch (error) {
15888
15928
  console.error(error.message);
@@ -16032,6 +16072,7 @@ Object.defineProperty(fdc31_2, "__esModule", { value: true });
16032
16072
  fdc31_2.Fdc3Module = void 0;
16033
16073
  const utils_1$3 = utils$3;
16034
16074
  const fdc3_common_1$1 = fdc3Common;
16075
+ const fdc3_channels_1_2_1 = fdc3Channels1_2;
16035
16076
  /**
16036
16077
  * @version 1.2
16037
16078
  * The FDC3 Client Library provides a set APIs to be used for FDC3 compliance,
@@ -16214,7 +16255,7 @@ class Fdc3Module extends fdc3_common_1$1.FDC3ModuleBase {
16214
16255
  * @tutorial fdc3.getOrCreateChannel
16215
16256
  */
16216
16257
  async getOrCreateChannel(channelId) {
16217
- return super.getOrCreateChannel(channelId);
16258
+ return super.getOrCreateChannel(channelId, fdc3_channels_1_2_1.createV1Channel);
16218
16259
  }
16219
16260
  /**
16220
16261
  * 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.
@@ -16244,6 +16285,7 @@ const utils_1$2 = utils$3;
16244
16285
  const InteropClient_1$1 = InteropClient$1;
16245
16286
  const utils_2 = utils$2;
16246
16287
  const PrivateChannelClient_1 = PrivateChannelClient$1;
16288
+ const fdc3_channels_2_0_1 = fdc3Channels2_0;
16247
16289
  /**
16248
16290
  * @version 2.0
16249
16291
  * The FDC3 Client Library provides a set APIs to be used for FDC3 compliance,
@@ -16495,7 +16537,7 @@ class Fdc3Module2 extends fdc3_common_1.FDC3ModuleBase {
16495
16537
  * @tutorial fdc3.getOrCreateChannel
16496
16538
  */
16497
16539
  async getOrCreateChannel(channelId) {
16498
- return super.getOrCreateChannel(channelId);
16540
+ return super.getOrCreateChannel(channelId, fdc3_channels_2_0_1.createV2Channel);
16499
16541
  }
16500
16542
  /**
16501
16543
  * Returns a Channel with an auto-generated identity that is intended for private communication between applications. Primarily used to create channels that will be returned to other applications via an IntentResolution for a raised intent.
@@ -18016,7 +18058,7 @@ class NodeEnvironment extends BaseEnvironment_1 {
18016
18058
  };
18017
18059
  }
18018
18060
  getAdapterVersionSync() {
18019
- return "43.100.91";
18061
+ return "43.100.93";
18020
18062
  }
18021
18063
  observeBounds(element, onChange) {
18022
18064
  throw new Error('Method not implemented.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/node-adapter",
3
- "version": "43.100.91",
3
+ "version": "43.100.93",
4
4
  "description": "See README.md",
5
5
  "main": "out/node-adapter.js",
6
6
  "types": "out/node-adapter.d.ts",
@@ -24,7 +24,7 @@
24
24
  "author": "OpenFin",
25
25
  "dependencies": {
26
26
  "@types/node": "^20.14.2",
27
- "@openfin/core": "43.100.91",
27
+ "@openfin/core": "43.100.93",
28
28
  "lodash": "^4.17.21",
29
29
  "ws": "^7.3.0"
30
30
  }