@interopio/browser 3.3.2 → 3.3.4

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.
@@ -6118,7 +6118,7 @@
6118
6118
  }
6119
6119
  }
6120
6120
 
6121
- var version$1 = "3.3.2";
6121
+ var version$1 = "3.3.4";
6122
6122
 
6123
6123
  const createFactoryFunction = (coreFactoryFunction) => {
6124
6124
  return async (userConfig) => {
@@ -9075,7 +9075,7 @@
9075
9075
  }
9076
9076
  };
9077
9077
 
9078
- var version = "6.3.2";
9078
+ var version = "6.3.4";
9079
9079
 
9080
9080
  function prepareConfig (configuration, ext, glue42gd) {
9081
9081
  let nodeStartingContext;
@@ -13045,6 +13045,10 @@
13045
13045
  return unsubscribeFunc;
13046
13046
  }
13047
13047
  getServerById(id) {
13048
+ const server = this.servers[id];
13049
+ if (!server) {
13050
+ return undefined;
13051
+ }
13048
13052
  return this.hideServerMethodSystemFlags(this.servers[id]);
13049
13053
  }
13050
13054
  reset() {
@@ -13357,7 +13361,7 @@
13357
13361
  }
13358
13362
  handleAddInterest(msg) {
13359
13363
  const caller = this.repository.getServerById(msg.caller_id);
13360
- const instance = caller.instance;
13364
+ const instance = caller?.instance ?? {};
13361
13365
  const requestContext = {
13362
13366
  msg,
13363
13367
  arguments: msg.arguments_kv || {},
@@ -13529,7 +13533,7 @@
13529
13533
  if (method === undefined) {
13530
13534
  return;
13531
13535
  }
13532
- const client = this.clientRepository.getServerById(callerId).instance;
13536
+ const client = this.clientRepository.getServerById(callerId)?.instance;
13533
13537
  const invocationArgs = { args, instance: client };
13534
13538
  this.callbacks.execute("onInvoked", method, invocationId, invocationArgs);
13535
13539
  }
@@ -13542,9 +13546,15 @@
13542
13546
  return this.subscriptionData.params.arguments || {};
13543
13547
  }
13544
13548
  get servers() {
13545
- return this.subscriptionData.trackedServers
13546
- .filter((pair) => pair.subscriptionId)
13547
- .map((pair) => this.repository.getServerById(pair.serverId).instance);
13549
+ return this.subscriptionData.trackedServers.reduce((servers, pair) => {
13550
+ if (pair.subscriptionId) {
13551
+ const server = this.repository.getServerById(pair.serverId)?.instance;
13552
+ if (server) {
13553
+ servers.push(server);
13554
+ }
13555
+ }
13556
+ return servers;
13557
+ }, []);
13548
13558
  }
13549
13559
  get serverInstance() {
13550
13560
  return this.servers[0];
@@ -13834,18 +13844,19 @@
13834
13844
  if (typeof subscription !== "object") {
13835
13845
  return;
13836
13846
  }
13837
- const trackedServersFound = subscription.trackedServers.filter((server) => {
13838
- return server.subscriptionId === msg.subscription_id;
13847
+ const trackedServersFound = subscription.trackedServers.filter((s) => {
13848
+ return s.subscriptionId === msg.subscription_id;
13839
13849
  });
13840
13850
  if (trackedServersFound.length !== 1) {
13841
13851
  return;
13842
13852
  }
13843
13853
  const isPrivateData = msg.oob;
13844
13854
  const sendingServerId = trackedServersFound[0].serverId;
13855
+ const server = this.repository.getServerById(sendingServerId);
13845
13856
  const receivedStreamData = () => {
13846
13857
  return {
13847
13858
  data: msg.data,
13848
- server: this.repository.getServerById(sendingServerId).instance,
13859
+ server: server?.instance ?? {},
13849
13860
  requestArguments: subscription.params.arguments,
13850
13861
  message: undefined,
13851
13862
  private: isPrivateData,
@@ -13899,7 +13910,7 @@
13899
13910
  const closingServerId = (closersCount > 0) ? subscription.queued.closers[closersCount - 1] : null;
13900
13911
  let closingServer;
13901
13912
  if (closingServerId !== undefined && typeof closingServerId === "string") {
13902
- closingServer = this.repository.getServerById(closingServerId).instance;
13913
+ closingServer = this.repository.getServerById(closingServerId)?.instance ?? {};
13903
13914
  }
13904
13915
  subscription.handlers.onClosed.forEach((callback) => {
13905
13916
  if (typeof callback !== "function") {
@@ -14011,13 +14022,15 @@
14011
14022
  const serverId = msg.server_id;
14012
14023
  const methodIdList = msg.methods;
14013
14024
  const server = this.repository.getServerById(serverId);
14014
- const serverMethodKeys = Object.keys(server.methods);
14015
- serverMethodKeys.forEach((methodKey) => {
14016
- const method = server.methods[methodKey];
14017
- if (methodIdList.indexOf(method.gatewayId) > -1) {
14018
- this.repository.removeServerMethod(serverId, methodKey);
14019
- }
14020
- });
14025
+ if (server) {
14026
+ const serverMethodKeys = Object.keys(server.methods);
14027
+ serverMethodKeys.forEach((methodKey) => {
14028
+ const method = server.methods[methodKey];
14029
+ if (methodIdList.indexOf(method.gatewayId) > -1) {
14030
+ this.repository.removeServerMethod(serverId, methodKey);
14031
+ }
14032
+ });
14033
+ }
14021
14034
  }
14022
14035
  handleResultMessage(msg) {
14023
14036
  const invocationId = msg._tag.invocationId;
@@ -14027,7 +14040,7 @@
14027
14040
  return {
14028
14041
  invocationId,
14029
14042
  result,
14030
- instance: server.instance,
14043
+ instance: server?.instance,
14031
14044
  status: InvokeStatus.Success,
14032
14045
  message: ""
14033
14046
  };
@@ -14043,7 +14056,7 @@
14043
14056
  return {
14044
14057
  invocationId,
14045
14058
  result: context,
14046
- instance: server.instance,
14059
+ instance: server?.instance,
14047
14060
  status: InvokeStatus.Error,
14048
14061
  message
14049
14062
  };