@openfin/node-adapter 41.102.8 → 41.103.3

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
@@ -8737,7 +8737,7 @@ var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateF
8737
8737
  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");
8738
8738
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
8739
8739
  };
8740
- var __importDefault$5 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
8740
+ var __importDefault$6 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
8741
8741
  return (mod && mod.__esModule) ? mod : { "default": mod };
8742
8742
  };
8743
8743
  var _ConnectionManager_messageReceiver, _ConnectionManager_rtcConnectionManager;
@@ -8751,7 +8751,7 @@ const ice_manager_1 = iceManager;
8751
8751
  const provider_1$1 = provider;
8752
8752
  const message_receiver_1 = messageReceiver$1;
8753
8753
  const protocol_manager_1 = protocolManager;
8754
- const strategy_3 = __importDefault$5(strategy);
8754
+ const strategy_3 = __importDefault$6(strategy);
8755
8755
  class ConnectionManager extends base_1$i.Base {
8756
8756
  static getProtocolOptionsFromStrings(protocols) {
8757
8757
  return protocols.map((protocol) => {
@@ -13451,16 +13451,16 @@ var __classPrivateFieldGet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateF
13451
13451
  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");
13452
13452
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
13453
13453
  };
13454
- var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
13454
+ var __importDefault$5 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
13455
13455
  return (mod && mod.__esModule) ? mod : { "default": mod };
13456
13456
  };
13457
13457
  var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
13458
13458
  Object.defineProperty(InteropBroker$1, "__esModule", { value: true });
13459
13459
  InteropBroker$1.InteropBroker = void 0;
13460
13460
  const base_1$5 = base;
13461
- const SessionContextGroupBroker_1 = __importDefault$4(SessionContextGroupBroker$1);
13461
+ const SessionContextGroupBroker_1 = __importDefault$5(SessionContextGroupBroker$1);
13462
13462
  const utils_1$7 = utils$3;
13463
- const isEqual_1$1 = __importDefault$4(require$$3);
13463
+ const isEqual_1$2 = __importDefault$5(require$$3);
13464
13464
  const PrivateChannelProvider_1 = PrivateChannelProvider$1;
13465
13465
  const lazy_1 = lazy;
13466
13466
  const defaultContextGroups = [
@@ -13659,7 +13659,7 @@ class InteropBroker extends base_1$5.Base {
13659
13659
  constructor(...unused) {
13660
13660
  if (unused.length) {
13661
13661
  const [_ignore1, ignore2, opts] = unused;
13662
- if (opts && typeof opts === 'object' && !(0, isEqual_1$1.default)(opts, args[2])) {
13662
+ if (opts && typeof opts === 'object' && !(0, isEqual_1$2.default)(opts, args[2])) {
13663
13663
  // eslint-disable-next-line no-console
13664
13664
  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.');
13665
13665
  super(args[0], args[1], opts);
@@ -14811,14 +14811,14 @@ var __classPrivateFieldGet$3 = (commonjsGlobal && commonjsGlobal.__classPrivateF
14811
14811
  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");
14812
14812
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
14813
14813
  };
14814
- var __importDefault$3 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
14814
+ var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
14815
14815
  return (mod && mod.__esModule) ? mod : { "default": mod };
14816
14816
  };
14817
14817
  var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory;
14818
14818
  Object.defineProperty(InteropClient$1, "__esModule", { value: true });
14819
14819
  InteropClient$1.InteropClient = void 0;
14820
14820
  const base_1$3 = base;
14821
- const SessionContextGroupClient_1 = __importDefault$3(SessionContextGroupClient$1);
14821
+ const SessionContextGroupClient_1 = __importDefault$4(SessionContextGroupClient$1);
14822
14822
  const utils_1$5 = utils$3;
14823
14823
  /**
14824
14824
  * The Interop Client API is broken up into two groups:
@@ -15560,15 +15560,86 @@ class PrivateChannelClient {
15560
15560
  }
15561
15561
  PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
15562
15562
 
15563
+ var fdc3Channels2_0 = {};
15564
+
15565
+ var fdc3Channels1_2 = {};
15566
+
15567
+ var __importDefault$3 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
15568
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15569
+ };
15570
+ Object.defineProperty(fdc3Channels1_2, "__esModule", { value: true });
15571
+ fdc3Channels1_2.createV1Channel = void 0;
15572
+ const isEqual_1$1 = __importDefault$3(require$$3);
15573
+ const createV1Channel = (sessionContextGroup) => {
15574
+ return {
15575
+ id: sessionContextGroup.id,
15576
+ type: 'app',
15577
+ broadcast: sessionContextGroup.setContext,
15578
+ getCurrentContext: async (contextType) => {
15579
+ const context = await sessionContextGroup.getCurrentContext(contextType);
15580
+ return context === undefined ? null : context;
15581
+ },
15582
+ // @ts-expect-error TODO [CORE-1524]
15583
+ addContextListener: (contextType, handler) => {
15584
+ let realHandler;
15585
+ let realType;
15586
+ if (typeof contextType === 'function') {
15587
+ console.warn('addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)');
15588
+ realHandler = contextType;
15589
+ }
15590
+ else {
15591
+ realHandler = handler;
15592
+ if (typeof contextType === 'string') {
15593
+ realType = contextType;
15594
+ }
15595
+ }
15596
+ const listener = (async () => {
15597
+ let first = true;
15598
+ const currentContext = await sessionContextGroup.getCurrentContext(realType);
15599
+ const wrappedHandler = (context, contextMetadata) => {
15600
+ if (first) {
15601
+ first = false;
15602
+ if ((0, isEqual_1$1.default)(currentContext, context)) {
15603
+ return;
15604
+ }
15605
+ }
15606
+ // eslint-disable-next-line consistent-return
15607
+ return realHandler(context, contextMetadata);
15608
+ };
15609
+ return sessionContextGroup.addContextHandler(wrappedHandler, realType);
15610
+ })();
15611
+ return {
15612
+ ...listener,
15613
+ unsubscribe: () => listener.then((l) => l.unsubscribe())
15614
+ };
15615
+ }
15616
+ };
15617
+ };
15618
+ fdc3Channels1_2.createV1Channel = createV1Channel;
15619
+
15620
+ Object.defineProperty(fdc3Channels2_0, "__esModule", { value: true });
15621
+ fdc3Channels2_0.createV2Channel = void 0;
15622
+ const fdc3_channels_1_2_1$1 = fdc3Channels1_2;
15623
+ const createV2Channel = (sessionContextGroup) => {
15624
+ const channel = (0, fdc3_channels_1_2_1$1.createV1Channel)(sessionContextGroup);
15625
+ return {
15626
+ ...channel,
15627
+ // @ts-expect-error Type incompatibility on signature.
15628
+ addContextListener: async (...args) => channel.addContextListener(...args)
15629
+ };
15630
+ };
15631
+ fdc3Channels2_0.createV2Channel = createV2Channel;
15632
+
15563
15633
  (function (exports) {
15564
15634
  var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
15565
15635
  return (mod && mod.__esModule) ? mod : { "default": mod };
15566
15636
  };
15567
15637
  Object.defineProperty(exports, "__esModule", { value: true });
15568
- exports.getIntentResolution = exports.isChannel = exports.isContext = exports.connectPrivateChannel = exports.buildAppChannelObject = exports.buildPrivateChannelObject = exports.ChannelError = exports.ResultError = exports.UnsupportedChannelApiError = exports.getUnsupportedChannelApis = void 0;
15638
+ exports.getIntentResolution = exports.isChannel = exports.isContext = exports.connectPrivateChannel = exports.buildPrivateChannelObject = exports.ChannelError = exports.ResultError = exports.UnsupportedChannelApiError = exports.getUnsupportedChannelApis = void 0;
15569
15639
  const utils_1 = utils$3;
15570
15640
  const PrivateChannelClient_1 = PrivateChannelClient$1;
15571
- const isEqual_1 = __importDefault(require$$3);
15641
+ __importDefault(require$$3);
15642
+ const fdc3_channels_2_0_1 = fdc3Channels2_0;
15572
15643
  const getUnsupportedChannelApis = (channelType) => {
15573
15644
  return {
15574
15645
  addContextListener: () => {
@@ -15667,52 +15738,6 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
15667
15738
  };
15668
15739
  };
15669
15740
  exports.buildPrivateChannelObject = buildPrivateChannelObject;
15670
- const buildAppChannelObject = (sessionContextGroup) => {
15671
- return {
15672
- id: sessionContextGroup.id,
15673
- type: 'app',
15674
- broadcast: sessionContextGroup.setContext,
15675
- getCurrentContext: async (contextType) => {
15676
- const context = await sessionContextGroup.getCurrentContext(contextType);
15677
- return context === undefined ? null : context;
15678
- },
15679
- // @ts-expect-error TODO [CORE-1524]
15680
- addContextListener: (contextType, handler) => {
15681
- let realHandler;
15682
- let realType;
15683
- if (typeof contextType === 'function') {
15684
- console.warn('addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)');
15685
- realHandler = contextType;
15686
- }
15687
- else {
15688
- realHandler = handler;
15689
- if (typeof contextType === 'string') {
15690
- realType = contextType;
15691
- }
15692
- }
15693
- const listener = (async () => {
15694
- let first = true;
15695
- const currentContext = await sessionContextGroup.getCurrentContext(realType);
15696
- const wrappedHandler = (context, contextMetadata) => {
15697
- if (first) {
15698
- first = false;
15699
- if ((0, isEqual_1.default)(currentContext, context)) {
15700
- return;
15701
- }
15702
- }
15703
- // eslint-disable-next-line consistent-return
15704
- return realHandler(context, contextMetadata);
15705
- };
15706
- return sessionContextGroup.addContextHandler(wrappedHandler, realType);
15707
- })();
15708
- return {
15709
- ...listener,
15710
- unsubscribe: () => listener.then((l) => l.unsubscribe())
15711
- };
15712
- }
15713
- };
15714
- };
15715
- exports.buildAppChannelObject = buildAppChannelObject;
15716
15741
  const connectPrivateChannel = async (channelId) => {
15717
15742
  try {
15718
15743
  const channelClient = await fin.InterApplicationBus.Channel.connect(channelId);
@@ -15744,6 +15769,10 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
15744
15769
  // Generate an ID to make a session context group with. We will pass that ID to the Broker.
15745
15770
  // The broker will then setContext on that session context group later with our Intent Result,
15746
15771
  const guid = (0, utils_1.generateId)(); // TODO make this undefined in web
15772
+ let isPromiseSettled = false;
15773
+ // Adding the intentResolutionResultId to the intentObj. Because fireIntent only accepts a single arg, we have to slap it in here.
15774
+ const metadata = app ? { target: app, intentResolutionResultId: guid } : { intentResolutionResultId: guid };
15775
+ const intentObj = intent ? { name: intent, context, metadata } : { ...context, metadata };
15747
15776
  // Promise we'll use in getResult
15748
15777
  const getResultPromise = new Promise((resolve, reject) => {
15749
15778
  fin.InterApplicationBus.subscribe({ uuid: '*' }, guid, (intentResult) => {
@@ -15756,13 +15785,24 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
15756
15785
  reject(new Error('getResult is not supported in this environment'));
15757
15786
  });
15758
15787
  });
15759
- // Adding the intentResolutionResultId to the intentObj. Because fireIntent only accepts a single arg, we have to slap it in here.
15760
- const metadata = app ? { target: app, intentResolutionResultId: guid } : { intentResolutionResultId: guid };
15761
- const intentObj = intent ? { name: intent, context, metadata } : { ...context, metadata };
15788
+ getResultPromise
15789
+ .then(() => {
15790
+ isPromiseSettled = true;
15791
+ })
15792
+ .catch(() => {
15793
+ isPromiseSettled = true;
15794
+ });
15762
15795
  // Set up the getResult call.
15763
15796
  const getResult = async () => {
15797
+ // All this mumbo jumbo is needed to make sure that getResult resolves correctly and conforms to the FDC3 spec.
15798
+ if (!isPromiseSettled) {
15799
+ return undefined;
15800
+ }
15764
15801
  let intentResult = await getResultPromise;
15765
- if (!intentResult || typeof intentResult !== 'object') {
15802
+ if (isPromiseSettled && !intentResult) {
15803
+ return undefined;
15804
+ }
15805
+ if (typeof intentResult !== 'object') {
15766
15806
  throw new Error(ResultError.NoResultReturned);
15767
15807
  }
15768
15808
  const { error } = intentResult;
@@ -15778,7 +15818,7 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
15778
15818
  }
15779
15819
  case 'app': {
15780
15820
  const sessionContextGroup = await interopModule.joinSessionContextGroup(id);
15781
- intentResult = (0, exports.buildAppChannelObject)(sessionContextGroup);
15821
+ intentResult = (0, fdc3_channels_2_0_1.createV2Channel)(sessionContextGroup);
15782
15822
  break;
15783
15823
  }
15784
15824
  }
@@ -15888,7 +15928,7 @@ class FDC3ModuleBase {
15888
15928
  *
15889
15929
  * @tutorial fdc3.getOrCreateChannel
15890
15930
  */
15891
- async getOrCreateChannel(channelId) {
15931
+ async getOrCreateChannel(channelId, fdc3Factory) {
15892
15932
  this.wire.sendAction('fdc3-get-or-create-channel').catch((e) => {
15893
15933
  // we do not want to expose this error, just continue if this analytics-only call fails
15894
15934
  });
@@ -15905,7 +15945,7 @@ class FDC3ModuleBase {
15905
15945
  }
15906
15946
  try {
15907
15947
  const sessionContextGroup = await this.client.joinSessionContextGroup(channelId);
15908
- return (0, utils_1$4.buildAppChannelObject)(sessionContextGroup);
15948
+ return fdc3Factory(sessionContextGroup);
15909
15949
  }
15910
15950
  catch (error) {
15911
15951
  console.error(error.message);
@@ -16055,6 +16095,7 @@ Object.defineProperty(fdc31_2, "__esModule", { value: true });
16055
16095
  fdc31_2.Fdc3Module = void 0;
16056
16096
  const utils_1$3 = utils$3;
16057
16097
  const fdc3_common_1$1 = fdc3Common;
16098
+ const fdc3_channels_1_2_1 = fdc3Channels1_2;
16058
16099
  /**
16059
16100
  * @version 1.2
16060
16101
  * The FDC3 Client Library provides a set APIs to be used for FDC3 compliance,
@@ -16237,7 +16278,7 @@ class Fdc3Module extends fdc3_common_1$1.FDC3ModuleBase {
16237
16278
  * @tutorial fdc3.getOrCreateChannel
16238
16279
  */
16239
16280
  async getOrCreateChannel(channelId) {
16240
- return super.getOrCreateChannel(channelId);
16281
+ return super.getOrCreateChannel(channelId, fdc3_channels_1_2_1.createV1Channel);
16241
16282
  }
16242
16283
  /**
16243
16284
  * 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.
@@ -16267,6 +16308,7 @@ const utils_1$2 = utils$3;
16267
16308
  const InteropClient_1$1 = InteropClient$1;
16268
16309
  const utils_2 = utils$2;
16269
16310
  const PrivateChannelClient_1 = PrivateChannelClient$1;
16311
+ const fdc3_channels_2_0_1 = fdc3Channels2_0;
16270
16312
  /**
16271
16313
  * @version 2.0
16272
16314
  * The FDC3 Client Library provides a set APIs to be used for FDC3 compliance,
@@ -16518,7 +16560,7 @@ class Fdc3Module2 extends fdc3_common_1.FDC3ModuleBase {
16518
16560
  * @tutorial fdc3.getOrCreateChannel
16519
16561
  */
16520
16562
  async getOrCreateChannel(channelId) {
16521
- return super.getOrCreateChannel(channelId);
16563
+ return super.getOrCreateChannel(channelId, fdc3_channels_2_0_1.createV2Channel);
16522
16564
  }
16523
16565
  /**
16524
16566
  * 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.
@@ -17840,7 +17882,7 @@ class NodeEnvironment extends BaseEnvironment_1 {
17840
17882
  };
17841
17883
  }
17842
17884
  getAdapterVersionSync() {
17843
- return "41.102.8";
17885
+ return "41.103.3";
17844
17886
  }
17845
17887
  observeBounds(element, onChange) {
17846
17888
  throw new Error('Method not implemented.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/node-adapter",
3
- "version": "41.102.8",
3
+ "version": "41.103.3",
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": "41.102.8",
27
+ "@openfin/core": "41.103.3",
28
28
  "lodash": "^4.17.21",
29
29
  "ws": "^7.3.0"
30
30
  }