@openfin/core 34.78.18 → 34.78.20

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.
package/out/mock.js CHANGED
@@ -560,7 +560,7 @@ class InternalError extends Error {
560
560
  const { message, name, stack, ...rest } = err;
561
561
  super(message);
562
562
  this.name = name || 'Error';
563
- this.stack = stack !== null && stack !== void 0 ? stack : this.toString();
563
+ this.stack = stack ?? this.toString();
564
564
  Object.keys(rest).forEach(key => {
565
565
  this[key] = rest[key];
566
566
  });
@@ -569,7 +569,6 @@ class InternalError extends Error {
569
569
  // For documentation of the error methods being used see here: https://v8.dev/docs/stack-trace-api
570
570
  class RuntimeError extends Error {
571
571
  static getCallSite(callsToRemove = 0) {
572
- var _a, _b;
573
572
  const length = Error.stackTraceLimit;
574
573
  const realCallsToRemove = callsToRemove + 1; // remove this call;
575
574
  Error.stackTraceLimit = length + realCallsToRemove;
@@ -578,7 +577,7 @@ class RuntimeError extends Error {
578
577
  // This will be called when we access the `stack` property
579
578
  Error.prepareStackTrace = (_, stack) => stack;
580
579
  // stack is optional in non chromium contexts
581
- const stack = (_b = (_a = new Error().stack) === null || _a === void 0 ? void 0 : _a.slice(realCallsToRemove)) !== null && _b !== void 0 ? _b : [];
580
+ const stack = new Error().stack?.slice(realCallsToRemove) ?? [];
582
581
  Error.prepareStackTrace = _prepareStackTrace;
583
582
  Error.stackTraceLimit = length;
584
583
  return stack;
@@ -600,7 +599,7 @@ class RuntimeError extends Error {
600
599
  const { reason, error } = payload;
601
600
  super(reason);
602
601
  this.name = 'RuntimeError';
603
- if (error === null || error === void 0 ? void 0 : error.stack) {
602
+ if (error?.stack) {
604
603
  this.cause = new InternalError(error);
605
604
  }
606
605
  if (callSites) {
@@ -973,7 +972,7 @@ class ChannelsExposer {
973
972
  this.exposeFunction = async (target, config) => {
974
973
  const { key, options, meta } = config;
975
974
  const { id } = meta;
976
- const action = `${id}.${(options === null || options === void 0 ? void 0 : options.action) || key}`;
975
+ const action = `${id}.${options?.action || key}`;
977
976
  await this.channelProviderOrClient.register(action, async ({ args }) => {
978
977
  return target(...args);
979
978
  });
@@ -2607,7 +2606,7 @@ class WebContents extends base_1$k.EmitterBase {
2607
2606
  this.wire.sendAction(`${this.entityType}-show-popup-window`, this.identity).catch(() => {
2608
2607
  // we do not want to expose this error, just continue if this analytics-only call fails
2609
2608
  });
2610
- if (options === null || options === void 0 ? void 0 : options.onPopupReady) {
2609
+ if (options?.onPopupReady) {
2611
2610
  const readyListener = async ({ popupName }) => {
2612
2611
  try {
2613
2612
  const popupWindow = this.fin.Window.wrapSync({ uuid: this.fin.me.uuid, name: popupName });
@@ -2626,8 +2625,8 @@ class WebContents extends base_1$k.EmitterBase {
2626
2625
  ...options,
2627
2626
  // Internal use only.
2628
2627
  // @ts-expect-error
2629
- hasResultCallback: !!(options === null || options === void 0 ? void 0 : options.onPopupResult),
2630
- hasReadyCallback: !!(options === null || options === void 0 ? void 0 : options.onPopupReady)
2628
+ hasResultCallback: !!options?.onPopupResult,
2629
+ hasReadyCallback: !!options?.onPopupReady
2631
2630
  },
2632
2631
  ...this.identity
2633
2632
  });
@@ -2652,7 +2651,7 @@ class WebContents extends base_1$k.EmitterBase {
2652
2651
  }
2653
2652
  return popupResult;
2654
2653
  };
2655
- if (options === null || options === void 0 ? void 0 : options.onPopupResult) {
2654
+ if (options?.onPopupResult) {
2656
2655
  const dispatchResultListener = async (payload) => {
2657
2656
  await options.onPopupResult(normalizePopupResult(payload));
2658
2657
  };
@@ -8532,7 +8531,7 @@ class ChannelBase {
8532
8531
  try {
8533
8532
  const mainAction = this.subscriptions.has(topic)
8534
8533
  ? this.subscriptions.get(topic)
8535
- : (currentPayload, id) => { var _a; return ((_a = this.defaultAction) !== null && _a !== void 0 ? _a : ChannelBase.defaultAction)(topic, currentPayload, id); };
8534
+ : (currentPayload, id) => (this.defaultAction ?? ChannelBase.defaultAction)(topic, currentPayload, id);
8536
8535
  const preActionProcessed = this.preAction ? await this.preAction(topic, payload, senderIdentity) : payload;
8537
8536
  const actionProcessed = await mainAction(preActionProcessed, senderIdentity);
8538
8537
  return this.postAction ? await this.postAction(topic, actionProcessed, senderIdentity) : actionProcessed;
@@ -9065,7 +9064,6 @@ class ClassicStrategy {
9065
9064
  // connection problems occur
9066
9065
  _ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map);
9067
9066
  this.send = async (endpointId, action, payload) => {
9068
- var _a;
9069
9067
  const to = __classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
9070
9068
  if (!to) {
9071
9069
  throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
@@ -9085,13 +9083,12 @@ class ClassicStrategy {
9085
9083
  action,
9086
9084
  payload
9087
9085
  });
9088
- (_a = __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)) === null || _a === void 0 ? void 0 : _a.add(p);
9086
+ __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
9089
9087
  const raw = await p.catch((error) => {
9090
9088
  throw new Error(error.message);
9091
9089
  }).finally(() => {
9092
- var _a;
9093
9090
  // clean up the pending promise
9094
- (_a = __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)) === null || _a === void 0 ? void 0 : _a.delete(p);
9091
+ __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
9095
9092
  });
9096
9093
  return raw.payload.data.result;
9097
9094
  };
@@ -9112,8 +9109,8 @@ class ClassicStrategy {
9112
9109
  const id = __classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
9113
9110
  __classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
9114
9111
  const pendingSet = __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
9115
- pendingSet === null || pendingSet === void 0 ? void 0 : pendingSet.forEach((p) => {
9116
- const errorMsg = `Channel connection with identity uuid: ${id === null || id === void 0 ? void 0 : id.uuid} / name: ${id === null || id === void 0 ? void 0 : id.name} / endpointId: ${endpointId} no longer connected.`;
9112
+ pendingSet?.forEach((p) => {
9113
+ const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
9117
9114
  p.cancel(new Error(errorMsg));
9118
9115
  });
9119
9116
  }
@@ -9125,9 +9122,8 @@ class ClassicStrategy {
9125
9122
  __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
9126
9123
  }
9127
9124
  isValidEndpointPayload(payload) {
9128
- var _a, _b;
9129
- return (typeof ((_a = payload === null || payload === void 0 ? void 0 : payload.endpointIdentity) === null || _a === void 0 ? void 0 : _a.endpointId) === 'string' ||
9130
- typeof ((_b = payload === null || payload === void 0 ? void 0 : payload.endpointIdentity) === null || _b === void 0 ? void 0 : _b.channelId) === 'string');
9125
+ return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
9126
+ typeof payload?.endpointIdentity?.channelId === 'string');
9131
9127
  }
9132
9128
  }
9133
9129
  strategy$2.ClassicStrategy = ClassicStrategy;
@@ -9204,13 +9200,12 @@ class RTCEndpoint {
9204
9200
  this.rtc.rtcClient.close();
9205
9201
  };
9206
9202
  this.rtc.channels.response.addEventListener('message', (e) => {
9207
- var _a;
9208
9203
  let { data } = e;
9209
9204
  if (e.data instanceof ArrayBuffer) {
9210
9205
  data = new TextDecoder().decode(e.data);
9211
9206
  }
9212
9207
  const { messageId, payload, success, error } = JSON.parse(data);
9213
- const { resolve, reject } = (_a = this.responseMap.get(messageId)) !== null && _a !== void 0 ? _a : {};
9208
+ const { resolve, reject } = this.responseMap.get(messageId) ?? {};
9214
9209
  if (resolve && reject) {
9215
9210
  this.responseMap.delete(messageId);
9216
9211
  if (success) {
@@ -9459,9 +9454,8 @@ class RTCICEManager extends base_1$i.EmitterBase {
9459
9454
  const rtcConnectionId = Math.random().toString();
9460
9455
  const rtcClient = this.createRtcPeer();
9461
9456
  rtcClient.addEventListener('icecandidate', async (e) => {
9462
- var _a;
9463
9457
  if (e.candidate) {
9464
- await this.raiseClientIce(rtcConnectionId, { candidate: (_a = e.candidate) === null || _a === void 0 ? void 0 : _a.toJSON() });
9458
+ await this.raiseClientIce(rtcConnectionId, { candidate: e.candidate?.toJSON() });
9465
9459
  }
9466
9460
  });
9467
9461
  await this.listenForProviderIce(rtcConnectionId, async (payload) => {
@@ -9486,9 +9480,8 @@ class RTCICEManager extends base_1$i.EmitterBase {
9486
9480
  const requestChannelPromise = RTCICEManager.createDataChannelPromise('request', rtcClient);
9487
9481
  const responseChannelPromise = RTCICEManager.createDataChannelPromise('response', rtcClient);
9488
9482
  rtcClient.addEventListener('icecandidate', async (e) => {
9489
- var _a;
9490
9483
  if (e.candidate) {
9491
- await this.raiseProviderIce(rtcConnectionId, { candidate: (_a = e.candidate) === null || _a === void 0 ? void 0 : _a.toJSON() });
9484
+ await this.raiseProviderIce(rtcConnectionId, { candidate: e.candidate?.toJSON() });
9492
9485
  }
9493
9486
  });
9494
9487
  await this.listenForClientIce(rtcConnectionId, async (payload) => {
@@ -9670,8 +9663,7 @@ class ChannelProvider extends channel_1.ChannelBase {
9670
9663
  * ```
9671
9664
  */
9672
9665
  dispatch(to, action, payload) {
9673
- var _a;
9674
- const endpointId = (_a = to.endpointId) !== null && _a !== void 0 ? _a : this.getEndpointIdForOpenFinId(to, action);
9666
+ const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
9675
9667
  if (endpointId && __classPrivateFieldGet$9(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
9676
9668
  return __classPrivateFieldGet$9(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload);
9677
9669
  }
@@ -9847,13 +9839,12 @@ class ChannelProvider extends channel_1.ChannelBase {
9847
9839
  }
9848
9840
  }
9849
9841
  getEndpointIdForOpenFinId(clientIdentity, action) {
9850
- var _a;
9851
9842
  const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
9852
9843
  if (matchingConnections.length >= 2) {
9853
9844
  const protectedObj = __classPrivateFieldGet$9(this, _ChannelProvider_protectedObj, "f");
9854
9845
  const { uuid, name } = clientIdentity;
9855
- const providerUuid = protectedObj === null || protectedObj === void 0 ? void 0 : protectedObj.providerIdentity.uuid;
9856
- const providerName = protectedObj === null || protectedObj === void 0 ? void 0 : protectedObj.providerIdentity.name;
9846
+ const providerUuid = protectedObj?.providerIdentity.uuid;
9847
+ const providerName = protectedObj?.providerIdentity.name;
9857
9848
  // eslint-disable-next-line no-console
9858
9849
  console.warn(`WARNING: Dispatch call may have unintended results. The "to" argument of your dispatch call is missing the
9859
9850
  "endpointId" parameter. The identity you are dispatching to ({uuid: ${uuid}, name: ${name}})
@@ -9861,7 +9852,7 @@ class ChannelProvider extends channel_1.ChannelBase {
9861
9852
  ({uuid: ${providerUuid}, name: ${providerName}}) will only be processed by the most recently-created client.`);
9862
9853
  }
9863
9854
  // Pop to return the most recently created endpointId.
9864
- return (_a = matchingConnections.pop()) === null || _a === void 0 ? void 0 : _a.endpointId;
9855
+ return matchingConnections.pop()?.endpointId;
9865
9856
  }
9866
9857
  // eslint-disable-next-line class-methods-use-this
9867
9858
  static clientIdentityIncludesEndpointId(subscriptionIdentity) {
@@ -9904,9 +9895,10 @@ class MessageReceiver extends base_1$h.Base {
9904
9895
  wire.registerMessageHandler(this.onmessage.bind(this));
9905
9896
  }
9906
9897
  async processChannelMessage(msg) {
9907
- var _a, _b;
9908
9898
  const { senderIdentity, providerIdentity, action, ackToSender, payload, intendedTargetIdentity } = msg.payload;
9909
- const key = (_b = (_a = intendedTargetIdentity.channelId) !== null && _a !== void 0 ? _a : intendedTargetIdentity.endpointId) !== null && _b !== void 0 ? _b : this.latestEndpointIdByChannelId.get(providerIdentity.channelId); // No endpointId was passed, make best attempt
9899
+ const key = intendedTargetIdentity.channelId ?? // The recipient is a provider
9900
+ intendedTargetIdentity.endpointId ?? // The recipient is a client
9901
+ this.latestEndpointIdByChannelId.get(providerIdentity.channelId); // No endpointId was passed, make best attempt
9910
9902
  const handler = this.endpointMap.get(key);
9911
9903
  if (!handler) {
9912
9904
  ackToSender.payload.success = false;
@@ -9986,12 +9978,9 @@ class ProtocolManager {
9986
9978
  return supported;
9987
9979
  };
9988
9980
  this.getCompatibleProtocols = (providerProtocols, clientOffer) => {
9989
- const supported = clientOffer.supportedProtocols.filter((clientProtocol) => providerProtocols.some((providerProtocol) => {
9990
- var _a;
9991
- return providerProtocol.type === clientProtocol.type &&
9992
- clientProtocol.version >= providerProtocol.minimumVersion &&
9993
- providerProtocol.version >= ((_a = clientProtocol.minimumVersion) !== null && _a !== void 0 ? _a : 0);
9994
- }));
9981
+ const supported = clientOffer.supportedProtocols.filter((clientProtocol) => providerProtocols.some((providerProtocol) => providerProtocol.type === clientProtocol.type &&
9982
+ clientProtocol.version >= providerProtocol.minimumVersion &&
9983
+ providerProtocol.version >= (clientProtocol.minimumVersion ?? 0)));
9995
9984
  return supported.slice(0, clientOffer.maxProtocols);
9996
9985
  };
9997
9986
  }
@@ -10116,7 +10105,7 @@ class ConnectionManager extends base_1$g.Base {
10116
10105
  }
10117
10106
  createProvider(options, providerIdentity) {
10118
10107
  const opts = Object.assign(this.wire.environment.getDefaultChannelOptions().create, options || {});
10119
- const protocols = this.protocolManager.getProviderProtocols(opts === null || opts === void 0 ? void 0 : opts.protocols);
10108
+ const protocols = this.protocolManager.getProviderProtocols(opts?.protocols);
10120
10109
  const createSingleStrategy = (stratType) => {
10121
10110
  switch (stratType) {
10122
10111
  case 'rtc':
@@ -10153,7 +10142,7 @@ class ConnectionManager extends base_1$g.Base {
10153
10142
  return channel;
10154
10143
  }
10155
10144
  async createClientOffer(options) {
10156
- const protocols = this.protocolManager.getClientProtocols(options === null || options === void 0 ? void 0 : options.protocols);
10145
+ const protocols = this.protocolManager.getClientProtocols(options?.protocols);
10157
10146
  let rtcPacket;
10158
10147
  const supportedProtocols = await Promise.all(protocols.map(async (type) => {
10159
10148
  switch (type) {
@@ -10181,14 +10170,13 @@ class ConnectionManager extends base_1$g.Base {
10181
10170
  };
10182
10171
  }
10183
10172
  async createClientStrategy(rtcPacket, routingInfo) {
10184
- var _a;
10185
10173
  if (!routingInfo.endpointId) {
10186
10174
  routingInfo.endpointId = this.wire.environment.getNextMessageId();
10187
10175
  // For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
10188
10176
  // clients that are in the same context as the newly-connected client.
10189
10177
  __classPrivateFieldGet$8(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
10190
10178
  }
10191
- const answer = (_a = routingInfo.answer) !== null && _a !== void 0 ? _a : {
10179
+ const answer = routingInfo.answer ?? {
10192
10180
  supportedProtocols: [{ type: 'classic', version: 1 }]
10193
10181
  };
10194
10182
  const createStrategyFromAnswer = async (protocol) => {
@@ -10246,7 +10234,7 @@ class ConnectionManager extends base_1$g.Base {
10246
10234
  if (!(provider instanceof provider_1$1.ChannelProvider)) {
10247
10235
  throw Error('Cannot connect to a channel client');
10248
10236
  }
10249
- const offer = clientOffer !== null && clientOffer !== void 0 ? clientOffer : {
10237
+ const offer = clientOffer ?? {
10250
10238
  supportedProtocols: [{ type: 'classic', version: 1 }],
10251
10239
  maxProtocols: 1
10252
10240
  };
@@ -12065,7 +12053,6 @@ class Platform extends base_1$7.EmitterBase {
12065
12053
  *
12066
12054
  */
12067
12055
  async reparentView(viewIdentity, target) {
12068
- var _a;
12069
12056
  // eslint-disable-next-line no-console
12070
12057
  console.warn('Platform.reparentView has been deprecated, please use Platform.createView');
12071
12058
  this.wire.sendAction('platform-reparent-view', this.identity).catch((e) => {
@@ -12073,7 +12060,7 @@ class Platform extends base_1$7.EmitterBase {
12073
12060
  });
12074
12061
  const normalizedViewIdentity = {
12075
12062
  ...viewIdentity,
12076
- uuid: (_a = viewIdentity.uuid) !== null && _a !== void 0 ? _a : this.identity.uuid
12063
+ uuid: viewIdentity.uuid ?? this.identity.uuid
12077
12064
  };
12078
12065
  const view = await this.fin.View.wrap(normalizedViewIdentity);
12079
12066
  const viewOptions = await view.getOptions();
@@ -13606,9 +13593,8 @@ function requireSessionContextGroupBroker () {
13606
13593
  this.lastContext = context;
13607
13594
  const clientSubscriptionStates = Array.from(this.clients.values());
13608
13595
  clientSubscriptionStates.forEach((client) => {
13609
- var _a;
13610
13596
  // eslint-disable-next-line no-unused-expressions
13611
- (_a = client.contextHandlers.get(context.type)) === null || _a === void 0 ? void 0 : _a.forEach((handlerId) => {
13597
+ client.contextHandlers.get(context.type)?.forEach((handlerId) => {
13612
13598
  this.provider.dispatch(client.clientIdentity, handlerId, context);
13613
13599
  });
13614
13600
  if (client.globalHandler) {
@@ -14215,10 +14201,10 @@ function requireInteropBroker () {
14215
14201
  this.getProvider = getProvider;
14216
14202
  this.interopClients = new Map();
14217
14203
  this.contextGroupsById = new Map();
14218
- if (options === null || options === void 0 ? void 0 : options.contextGroups) {
14204
+ if (options?.contextGroups) {
14219
14205
  contextGroups = options.contextGroups;
14220
14206
  }
14221
- if (options === null || options === void 0 ? void 0 : options.logging) {
14207
+ if (options?.logging) {
14222
14208
  this.logging = options.logging;
14223
14209
  }
14224
14210
  this.intentClientMap = new Map();
@@ -14353,18 +14339,17 @@ function requireInteropBroker () {
14353
14339
  *
14354
14340
  */
14355
14341
  getCurrentContext(getCurrentContextOptions, clientIdentity) {
14356
- var _a;
14357
14342
  this.wire.sendAction('interop-broker-get-current-context').catch((e) => {
14358
14343
  // don't expose, analytics-only call
14359
14344
  });
14360
14345
  const clientState = this.getClientState(clientIdentity);
14361
- if (!(clientState === null || clientState === void 0 ? void 0 : clientState.contextGroupId)) {
14346
+ if (!clientState?.contextGroupId) {
14362
14347
  throw new Error('You must be a member of a context group to call getCurrentContext');
14363
14348
  }
14364
14349
  const { contextGroupId } = clientState;
14365
14350
  const contextGroupState = this.contextGroupsById.get(contextGroupId);
14366
14351
  const lastContextType = this.lastContextMap.get(contextGroupId);
14367
- const contextType = (_a = getCurrentContextOptions === null || getCurrentContextOptions === void 0 ? void 0 : getCurrentContextOptions.contextType) !== null && _a !== void 0 ? _a : lastContextType;
14352
+ const contextType = getCurrentContextOptions?.contextType ?? lastContextType;
14368
14353
  return contextGroupState && contextType ? contextGroupState.get(contextType) : undefined;
14369
14354
  }
14370
14355
  /*
@@ -15015,10 +15000,9 @@ function requireInteropBroker () {
15015
15000
  }
15016
15001
  // Used to restore interop broker state in snapshots.
15017
15002
  applySnapshot(snapshot, options) {
15018
- var _a;
15019
- const contextGroupStates = (_a = snapshot === null || snapshot === void 0 ? void 0 : snapshot.interopSnapshotDetails) === null || _a === void 0 ? void 0 : _a.contextGroupStates;
15003
+ const contextGroupStates = snapshot?.interopSnapshotDetails?.contextGroupStates;
15020
15004
  if (contextGroupStates) {
15021
- if (!(options === null || options === void 0 ? void 0 : options.closeExistingWindows)) {
15005
+ if (!options?.closeExistingWindows) {
15022
15006
  this.updateExistingClients(contextGroupStates);
15023
15007
  }
15024
15008
  this.rehydrateContextGroupStates(contextGroupStates);
@@ -15069,7 +15053,7 @@ function requireInteropBroker () {
15069
15053
  contextHandlerRegistered({ contextType, handlerId }, clientIdentity) {
15070
15054
  const handlerInfo = { contextType, handlerId };
15071
15055
  const clientState = this.getClientState(clientIdentity);
15072
- clientState === null || clientState === void 0 ? void 0 : clientState.contextHandlers.set(handlerId, handlerInfo);
15056
+ clientState?.contextHandlers.set(handlerId, handlerInfo);
15073
15057
  if (clientState && clientState.contextGroupId) {
15074
15058
  const { contextGroupId } = clientState;
15075
15059
  const contextGroupMap = this.contextGroupsById.get(contextGroupId);
@@ -15091,7 +15075,7 @@ function requireInteropBroker () {
15091
15075
  async intentHandlerRegistered(payload, clientIdentity) {
15092
15076
  const { handlerId } = payload;
15093
15077
  const clientIntentInfo = this.intentClientMap.get(clientIdentity.name);
15094
- const handlerInfo = clientIntentInfo === null || clientIntentInfo === void 0 ? void 0 : clientIntentInfo.get(handlerId);
15078
+ const handlerInfo = clientIntentInfo?.get(handlerId);
15095
15079
  if (!clientIntentInfo) {
15096
15080
  this.intentClientMap.set(clientIdentity.name, new Map());
15097
15081
  const newHandlerInfoMap = this.intentClientMap.get(clientIdentity.name);
@@ -15260,8 +15244,8 @@ function requireInteropBroker () {
15260
15244
  clientIdentity
15261
15245
  };
15262
15246
  // Only allow the client to join a contextGroup that actually exists.
15263
- if ((payload === null || payload === void 0 ? void 0 : payload.currentContextGroup) && this.contextGroupsById.has(payload.currentContextGroup)) {
15264
- clientSubscriptionState.contextGroupId = payload === null || payload === void 0 ? void 0 : payload.currentContextGroup;
15247
+ if (payload?.currentContextGroup && this.contextGroupsById.has(payload.currentContextGroup)) {
15248
+ clientSubscriptionState.contextGroupId = payload?.currentContextGroup;
15265
15249
  }
15266
15250
  this.interopClients.set(clientIdentity.endpointId, clientSubscriptionState);
15267
15251
  });
@@ -15279,17 +15263,15 @@ function requireInteropBroker () {
15279
15263
  this.clientDisconnected(clientIdentity);
15280
15264
  });
15281
15265
  channel.beforeAction(async (action, payload, clientIdentity) => {
15282
- var _a, _b;
15283
15266
  if (!(await this.isActionAuthorized(action, payload, clientIdentity))) {
15284
15267
  throw new Error(`Action (${action}) not authorized for ${clientIdentity.uuid}, ${clientIdentity.name}`);
15285
15268
  }
15286
- if ((_b = (_a = this.logging) === null || _a === void 0 ? void 0 : _a.beforeAction) === null || _b === void 0 ? void 0 : _b.enabled) {
15269
+ if (this.logging?.beforeAction?.enabled) {
15287
15270
  console.log(action, payload, clientIdentity);
15288
15271
  }
15289
15272
  });
15290
15273
  channel.afterAction((action, payload, clientIdentity) => {
15291
- var _a, _b;
15292
- if ((_b = (_a = this.logging) === null || _a === void 0 ? void 0 : _a.afterAction) === null || _b === void 0 ? void 0 : _b.enabled) {
15274
+ if (this.logging?.afterAction?.enabled) {
15293
15275
  console.log(action, payload, clientIdentity);
15294
15276
  }
15295
15277
  });
@@ -16138,9 +16120,8 @@ function requireOverrideCheck () {
16138
16120
  overrideCheck.overrideCheck = overrideCheck.getDefaultViewFdc3VersionFromAppInfo = void 0;
16139
16121
  const InteropBroker_1 = requireInteropBroker();
16140
16122
  function getDefaultViewFdc3VersionFromAppInfo({ manifest, initialOptions }) {
16141
- var _a, _b, _c, _d;
16142
- 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;
16143
- return ['1.2', '2.0'].includes(setVersion !== null && setVersion !== void 0 ? setVersion : '') ? setVersion : undefined;
16123
+ const setVersion = manifest.platform?.defaultViewOptions?.fdc3InteropApi ?? initialOptions.defaultViewOptions?.fdc3InteropApi;
16124
+ return ['1.2', '2.0'].includes(setVersion ?? '') ? setVersion : undefined;
16144
16125
  }
16145
16126
  overrideCheck.getDefaultViewFdc3VersionFromAppInfo = getDefaultViewFdc3VersionFromAppInfo;
16146
16127
  // TODO: Unit test this
@@ -16213,13 +16194,12 @@ function requireFactory () {
16213
16194
  * ```
16214
16195
  */
16215
16196
  async init(name, override = defaultOverride) {
16216
- var _a;
16217
16197
  this.wire.sendAction('interop-init').catch(() => {
16218
16198
  // don't expose, analytics-only call
16219
16199
  });
16220
16200
  // Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
16221
16201
  const options = await this.fin.Application.getCurrentSync().getInfo();
16222
- const opts = (_a = options.initialOptions.interopBrokerConfiguration) !== null && _a !== void 0 ? _a : {};
16202
+ const opts = options.initialOptions.interopBrokerConfiguration ?? {};
16223
16203
  const objectThatThrows = (0, inaccessibleObject_1.createUnusableObject)(BrokerParamAccessError);
16224
16204
  const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (0, lodash_1.cloneDeep)(opts));
16225
16205
  let provider;
@@ -17080,7 +17060,7 @@ const fin_1 = fin;
17080
17060
  const transport_1 = transport;
17081
17061
  const mockEnvironment_1 = mockEnvironment;
17082
17062
  const mockWire_1 = mockWire;
17083
- exports.fin = mock.fin = ((typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.fin)) ||
17063
+ exports.fin = mock.fin = ((typeof window !== 'undefined' && window?.fin) ||
17084
17064
  (() => {
17085
17065
  const environment = new mockEnvironment_1.MockEnvironment();
17086
17066
  const transport = new transport_1.Transport(mockWire_1.MockWire, environment, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/core",
3
- "version": "34.78.18",
3
+ "version": "34.78.20",
4
4
  "description": "The core renderer entry point of OpenFin",
5
5
  "license": "SEE LICENSE IN LICENSE.MD",
6
6
  "main": "out/mock.js",