@openfin/core 43.100.91 → 43.100.92

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/stub.js +107 -65
  2. package/package.json +1 -1
package/out/stub.js CHANGED
@@ -9035,7 +9035,7 @@ var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateF
9035
9035
  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");
9036
9036
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
9037
9037
  };
9038
- var __importDefault$5 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
9038
+ var __importDefault$6 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
9039
9039
  return (mod && mod.__esModule) ? mod : { "default": mod };
9040
9040
  };
9041
9041
  var _ConnectionManager_messageReceiver, _ConnectionManager_rtcConnectionManager;
@@ -9049,7 +9049,7 @@ const ice_manager_1 = iceManager;
9049
9049
  const provider_1$1 = provider;
9050
9050
  const message_receiver_1 = messageReceiver;
9051
9051
  const protocol_manager_1 = protocolManager;
9052
- const strategy_3 = __importDefault$5(strategy);
9052
+ const strategy_3 = __importDefault$6(strategy);
9053
9053
  class ConnectionManager extends base_1$j.Base {
9054
9054
  static getProtocolOptionsFromStrings(protocols) {
9055
9055
  return protocols.map((protocol) => {
@@ -13716,16 +13716,16 @@ var __classPrivateFieldGet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateF
13716
13716
  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");
13717
13717
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
13718
13718
  };
13719
- var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
13719
+ var __importDefault$5 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
13720
13720
  return (mod && mod.__esModule) ? mod : { "default": mod };
13721
13721
  };
13722
13722
  var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
13723
13723
  Object.defineProperty(InteropBroker$1, "__esModule", { value: true });
13724
13724
  InteropBroker$1.InteropBroker = void 0;
13725
13725
  const base_1$6 = base;
13726
- const SessionContextGroupBroker_1 = __importDefault$4(SessionContextGroupBroker$1);
13726
+ const SessionContextGroupBroker_1 = __importDefault$5(SessionContextGroupBroker$1);
13727
13727
  const utils_1$7 = utils$3;
13728
- const isEqual_1$1 = __importDefault$4(require$$3);
13728
+ const isEqual_1$2 = __importDefault$5(require$$3);
13729
13729
  const PrivateChannelProvider_1 = PrivateChannelProvider$1;
13730
13730
  const lazy_1$1 = lazy;
13731
13731
  const defaultContextGroups = [
@@ -13924,7 +13924,7 @@ class InteropBroker extends base_1$6.Base {
13924
13924
  constructor(...unused) {
13925
13925
  if (unused.length) {
13926
13926
  const [_ignore1, ignore2, opts] = unused;
13927
- if (opts && typeof opts === 'object' && !(0, isEqual_1$1.default)(opts, args[2])) {
13927
+ if (opts && typeof opts === 'object' && !(0, isEqual_1$2.default)(opts, args[2])) {
13928
13928
  // eslint-disable-next-line no-console
13929
13929
  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.');
13930
13930
  super(args[0], args[1], opts);
@@ -15076,14 +15076,14 @@ var __classPrivateFieldGet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
15076
15076
  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");
15077
15077
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15078
15078
  };
15079
- var __importDefault$3 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
15079
+ var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
15080
15080
  return (mod && mod.__esModule) ? mod : { "default": mod };
15081
15081
  };
15082
15082
  var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory;
15083
15083
  Object.defineProperty(InteropClient$1, "__esModule", { value: true });
15084
15084
  InteropClient$1.InteropClient = void 0;
15085
15085
  const base_1$4 = base;
15086
- const SessionContextGroupClient_1 = __importDefault$3(SessionContextGroupClient$1);
15086
+ const SessionContextGroupClient_1 = __importDefault$4(SessionContextGroupClient$1);
15087
15087
  const utils_1$5 = utils$3;
15088
15088
  /**
15089
15089
  * The Interop Client API is broken up into two groups:
@@ -15825,15 +15825,86 @@ class PrivateChannelClient {
15825
15825
  }
15826
15826
  PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
15827
15827
 
15828
+ var fdc3Channels2_0 = {};
15829
+
15830
+ var fdc3Channels1_2 = {};
15831
+
15832
+ var __importDefault$3 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
15833
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15834
+ };
15835
+ Object.defineProperty(fdc3Channels1_2, "__esModule", { value: true });
15836
+ fdc3Channels1_2.createV1Channel = void 0;
15837
+ const isEqual_1$1 = __importDefault$3(require$$3);
15838
+ const createV1Channel = (sessionContextGroup) => {
15839
+ return {
15840
+ id: sessionContextGroup.id,
15841
+ type: 'app',
15842
+ broadcast: sessionContextGroup.setContext,
15843
+ getCurrentContext: async (contextType) => {
15844
+ const context = await sessionContextGroup.getCurrentContext(contextType);
15845
+ return context === undefined ? null : context;
15846
+ },
15847
+ // @ts-expect-error TODO [CORE-1524]
15848
+ addContextListener: (contextType, handler) => {
15849
+ let realHandler;
15850
+ let realType;
15851
+ if (typeof contextType === 'function') {
15852
+ console.warn('addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)');
15853
+ realHandler = contextType;
15854
+ }
15855
+ else {
15856
+ realHandler = handler;
15857
+ if (typeof contextType === 'string') {
15858
+ realType = contextType;
15859
+ }
15860
+ }
15861
+ const listener = (async () => {
15862
+ let first = true;
15863
+ const currentContext = await sessionContextGroup.getCurrentContext(realType);
15864
+ const wrappedHandler = (context, contextMetadata) => {
15865
+ if (first) {
15866
+ first = false;
15867
+ if ((0, isEqual_1$1.default)(currentContext, context)) {
15868
+ return;
15869
+ }
15870
+ }
15871
+ // eslint-disable-next-line consistent-return
15872
+ return realHandler(context, contextMetadata);
15873
+ };
15874
+ return sessionContextGroup.addContextHandler(wrappedHandler, realType);
15875
+ })();
15876
+ return {
15877
+ ...listener,
15878
+ unsubscribe: () => listener.then((l) => l.unsubscribe())
15879
+ };
15880
+ }
15881
+ };
15882
+ };
15883
+ fdc3Channels1_2.createV1Channel = createV1Channel;
15884
+
15885
+ Object.defineProperty(fdc3Channels2_0, "__esModule", { value: true });
15886
+ fdc3Channels2_0.createV2Channel = void 0;
15887
+ const fdc3_channels_1_2_1$1 = fdc3Channels1_2;
15888
+ const createV2Channel = (sessionContextGroup) => {
15889
+ const channel = (0, fdc3_channels_1_2_1$1.createV1Channel)(sessionContextGroup);
15890
+ return {
15891
+ ...channel,
15892
+ // @ts-expect-error Type incompatibility on signature.
15893
+ addContextListener: async (...args) => channel.addContextListener(...args)
15894
+ };
15895
+ };
15896
+ fdc3Channels2_0.createV2Channel = createV2Channel;
15897
+
15828
15898
  (function (exports) {
15829
15899
  var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
15830
15900
  return (mod && mod.__esModule) ? mod : { "default": mod };
15831
15901
  };
15832
15902
  Object.defineProperty(exports, "__esModule", { value: true });
15833
- exports.getIntentResolution = exports.isChannel = exports.isContext = exports.connectPrivateChannel = exports.buildAppChannelObject = exports.buildPrivateChannelObject = exports.ChannelError = exports.ResultError = exports.UnsupportedChannelApiError = exports.getUnsupportedChannelApis = void 0;
15903
+ exports.getIntentResolution = exports.isChannel = exports.isContext = exports.connectPrivateChannel = exports.buildPrivateChannelObject = exports.ChannelError = exports.ResultError = exports.UnsupportedChannelApiError = exports.getUnsupportedChannelApis = void 0;
15834
15904
  const utils_1 = utils$3;
15835
15905
  const PrivateChannelClient_1 = PrivateChannelClient$1;
15836
- const isEqual_1 = __importDefault(require$$3);
15906
+ __importDefault(require$$3);
15907
+ const fdc3_channels_2_0_1 = fdc3Channels2_0;
15837
15908
  const getUnsupportedChannelApis = (channelType) => {
15838
15909
  return {
15839
15910
  addContextListener: () => {
@@ -15932,52 +16003,6 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
15932
16003
  };
15933
16004
  };
15934
16005
  exports.buildPrivateChannelObject = buildPrivateChannelObject;
15935
- const buildAppChannelObject = (sessionContextGroup) => {
15936
- return {
15937
- id: sessionContextGroup.id,
15938
- type: 'app',
15939
- broadcast: sessionContextGroup.setContext,
15940
- getCurrentContext: async (contextType) => {
15941
- const context = await sessionContextGroup.getCurrentContext(contextType);
15942
- return context === undefined ? null : context;
15943
- },
15944
- // @ts-expect-error TODO [CORE-1524]
15945
- addContextListener: (contextType, handler) => {
15946
- let realHandler;
15947
- let realType;
15948
- if (typeof contextType === 'function') {
15949
- console.warn('addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)');
15950
- realHandler = contextType;
15951
- }
15952
- else {
15953
- realHandler = handler;
15954
- if (typeof contextType === 'string') {
15955
- realType = contextType;
15956
- }
15957
- }
15958
- const listener = (async () => {
15959
- let first = true;
15960
- const currentContext = await sessionContextGroup.getCurrentContext(realType);
15961
- const wrappedHandler = (context, contextMetadata) => {
15962
- if (first) {
15963
- first = false;
15964
- if ((0, isEqual_1.default)(currentContext, context)) {
15965
- return;
15966
- }
15967
- }
15968
- // eslint-disable-next-line consistent-return
15969
- return realHandler(context, contextMetadata);
15970
- };
15971
- return sessionContextGroup.addContextHandler(wrappedHandler, realType);
15972
- })();
15973
- return {
15974
- ...listener,
15975
- unsubscribe: () => listener.then((l) => l.unsubscribe())
15976
- };
15977
- }
15978
- };
15979
- };
15980
- exports.buildAppChannelObject = buildAppChannelObject;
15981
16006
  const connectPrivateChannel = async (channelId) => {
15982
16007
  try {
15983
16008
  const channelClient = await fin.InterApplicationBus.Channel.connect(channelId);
@@ -16009,6 +16034,10 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
16009
16034
  // Generate an ID to make a session context group with. We will pass that ID to the Broker.
16010
16035
  // The broker will then setContext on that session context group later with our Intent Result,
16011
16036
  const guid = (0, utils_1.generateId)(); // TODO make this undefined in web
16037
+ let isPromiseSettled = false;
16038
+ // Adding the intentResolutionResultId to the intentObj. Because fireIntent only accepts a single arg, we have to slap it in here.
16039
+ const metadata = app ? { target: app, intentResolutionResultId: guid } : { intentResolutionResultId: guid };
16040
+ const intentObj = intent ? { name: intent, context, metadata } : { ...context, metadata };
16012
16041
  // Promise we'll use in getResult
16013
16042
  const getResultPromise = new Promise((resolve, reject) => {
16014
16043
  fin.InterApplicationBus.subscribe({ uuid: '*' }, guid, (intentResult) => {
@@ -16021,13 +16050,24 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
16021
16050
  reject(new Error('getResult is not supported in this environment'));
16022
16051
  });
16023
16052
  });
16024
- // Adding the intentResolutionResultId to the intentObj. Because fireIntent only accepts a single arg, we have to slap it in here.
16025
- const metadata = app ? { target: app, intentResolutionResultId: guid } : { intentResolutionResultId: guid };
16026
- const intentObj = intent ? { name: intent, context, metadata } : { ...context, metadata };
16053
+ getResultPromise
16054
+ .then(() => {
16055
+ isPromiseSettled = true;
16056
+ })
16057
+ .catch(() => {
16058
+ isPromiseSettled = true;
16059
+ });
16027
16060
  // Set up the getResult call.
16028
16061
  const getResult = async () => {
16062
+ // All this mumbo jumbo is needed to make sure that getResult resolves correctly and conforms to the FDC3 spec.
16063
+ if (!isPromiseSettled) {
16064
+ return undefined;
16065
+ }
16029
16066
  let intentResult = await getResultPromise;
16030
- if (!intentResult || typeof intentResult !== 'object') {
16067
+ if (isPromiseSettled && !intentResult) {
16068
+ return undefined;
16069
+ }
16070
+ if (typeof intentResult !== 'object') {
16031
16071
  throw new Error(ResultError.NoResultReturned);
16032
16072
  }
16033
16073
  const { error } = intentResult;
@@ -16043,7 +16083,7 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
16043
16083
  }
16044
16084
  case 'app': {
16045
16085
  const sessionContextGroup = await interopModule.joinSessionContextGroup(id);
16046
- intentResult = (0, exports.buildAppChannelObject)(sessionContextGroup);
16086
+ intentResult = (0, fdc3_channels_2_0_1.createV2Channel)(sessionContextGroup);
16047
16087
  break;
16048
16088
  }
16049
16089
  }
@@ -16153,7 +16193,7 @@ class FDC3ModuleBase {
16153
16193
  *
16154
16194
  * @tutorial fdc3.getOrCreateChannel
16155
16195
  */
16156
- async getOrCreateChannel(channelId) {
16196
+ async getOrCreateChannel(channelId, fdc3Factory) {
16157
16197
  this.wire.sendAction('fdc3-get-or-create-channel').catch((e) => {
16158
16198
  // we do not want to expose this error, just continue if this analytics-only call fails
16159
16199
  });
@@ -16170,7 +16210,7 @@ class FDC3ModuleBase {
16170
16210
  }
16171
16211
  try {
16172
16212
  const sessionContextGroup = await this.client.joinSessionContextGroup(channelId);
16173
- return (0, utils_1$4.buildAppChannelObject)(sessionContextGroup);
16213
+ return fdc3Factory(sessionContextGroup);
16174
16214
  }
16175
16215
  catch (error) {
16176
16216
  console.error(error.message);
@@ -16320,6 +16360,7 @@ Object.defineProperty(fdc31_2, "__esModule", { value: true });
16320
16360
  fdc31_2.Fdc3Module = void 0;
16321
16361
  const utils_1$3 = utils$3;
16322
16362
  const fdc3_common_1$1 = fdc3Common;
16363
+ const fdc3_channels_1_2_1 = fdc3Channels1_2;
16323
16364
  /**
16324
16365
  * @version 1.2
16325
16366
  * The FDC3 Client Library provides a set APIs to be used for FDC3 compliance,
@@ -16502,7 +16543,7 @@ class Fdc3Module extends fdc3_common_1$1.FDC3ModuleBase {
16502
16543
  * @tutorial fdc3.getOrCreateChannel
16503
16544
  */
16504
16545
  async getOrCreateChannel(channelId) {
16505
- return super.getOrCreateChannel(channelId);
16546
+ return super.getOrCreateChannel(channelId, fdc3_channels_1_2_1.createV1Channel);
16506
16547
  }
16507
16548
  /**
16508
16549
  * 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.
@@ -16532,6 +16573,7 @@ const utils_1$2 = utils$3;
16532
16573
  const InteropClient_1$1 = InteropClient$1;
16533
16574
  const utils_2 = utils$2;
16534
16575
  const PrivateChannelClient_1 = PrivateChannelClient$1;
16576
+ const fdc3_channels_2_0_1 = fdc3Channels2_0;
16535
16577
  /**
16536
16578
  * @version 2.0
16537
16579
  * The FDC3 Client Library provides a set APIs to be used for FDC3 compliance,
@@ -16783,7 +16825,7 @@ class Fdc3Module2 extends fdc3_common_1.FDC3ModuleBase {
16783
16825
  * @tutorial fdc3.getOrCreateChannel
16784
16826
  */
16785
16827
  async getOrCreateChannel(channelId) {
16786
- return super.getOrCreateChannel(channelId);
16828
+ return super.getOrCreateChannel(channelId, fdc3_channels_2_0_1.createV2Channel);
16787
16829
  }
16788
16830
  /**
16789
16831
  * 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/core",
3
- "version": "43.100.91",
3
+ "version": "43.100.92",
4
4
  "description": "The core renderer entry point of OpenFin",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "out/stub.js",