@openfin/node-adapter 40.82.17 → 40.82.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/out/node-adapter.js +71 -54
  2. package/package.json +2 -2
@@ -73,7 +73,7 @@ async function promiseMapSerial(arr, func) {
73
73
  }
74
74
  promises.promiseMapSerial = promiseMapSerial;
75
75
 
76
- var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
76
+ var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
77
77
  if (kind === "m") throw new TypeError("Private method is not writable");
78
78
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
79
79
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -202,7 +202,7 @@ class EmitterBase extends Base {
202
202
  // This will only be reached if unsubscribe from event that does not exist but do not want to error here
203
203
  return Promise.resolve();
204
204
  };
205
- __classPrivateFieldSet$c(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
205
+ __classPrivateFieldSet$d(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
206
206
  this.listeners = (event) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(event) : [];
207
207
  }
208
208
  /**
@@ -1021,7 +1021,7 @@ const createRelayedDispatch = (client, target, relayId, relayErrorMsg) => async
1021
1021
  };
1022
1022
  channelApiRelay.createRelayedDispatch = createRelayedDispatch;
1023
1023
 
1024
- var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
1024
+ var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
1025
1025
  if (kind === "m") throw new TypeError("Private method is not writable");
1026
1026
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
1027
1027
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -1215,7 +1215,7 @@ class LayoutNode {
1215
1215
  entityId: stack.entityId
1216
1216
  }, __classPrivateFieldGet$d(this, _LayoutNode_client, "f")));
1217
1217
  };
1218
- __classPrivateFieldSet$b(this, _LayoutNode_client, client, "f");
1218
+ __classPrivateFieldSet$c(this, _LayoutNode_client, client, "f");
1219
1219
  this.entityId = entityId;
1220
1220
  }
1221
1221
  }
@@ -1374,7 +1374,7 @@ class TabStack extends LayoutNode {
1374
1374
  this.setActiveView = async (view) => {
1375
1375
  await __classPrivateFieldGet$d(this, _TabStack_client, "f").setStackActiveView(this.entityId, view);
1376
1376
  };
1377
- __classPrivateFieldSet$b(this, _TabStack_client, client, "f");
1377
+ __classPrivateFieldSet$c(this, _TabStack_client, client, "f");
1378
1378
  }
1379
1379
  }
1380
1380
  layoutEntities.TabStack = TabStack;
@@ -1416,7 +1416,7 @@ class ColumnOrRow extends LayoutNode {
1416
1416
  const contentItemEntities = await __classPrivateFieldGet$d(this, _ColumnOrRow_client, "f").getContent(this.entityId);
1417
1417
  return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet$d(this, _ColumnOrRow_client, "f")));
1418
1418
  };
1419
- __classPrivateFieldSet$b(this, _ColumnOrRow_client, client, "f");
1419
+ __classPrivateFieldSet$c(this, _ColumnOrRow_client, client, "f");
1420
1420
  this.type = type;
1421
1421
  }
1422
1422
  }
@@ -2991,7 +2991,7 @@ function requireInstance$2 () {
2991
2991
  });
2992
2992
  try {
2993
2993
  const layout = await this.getParentLayout();
2994
- return layout.getStackByView(this.identity);
2994
+ return layout.getStackByViewIdentity(this.identity);
2995
2995
  }
2996
2996
  catch (error) {
2997
2997
  throw new transport_errors_1.RuntimeError({ reason: 'This view does not belong to a stack.', error });
@@ -8029,7 +8029,7 @@ var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateF
8029
8029
  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");
8030
8030
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
8031
8031
  };
8032
- var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8032
+ var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8033
8033
  if (kind === "m") throw new TypeError("Private method is not writable");
8034
8034
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
8035
8035
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -8101,10 +8101,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
8101
8101
  channelClientsByEndpointId.delete(this.endpointId);
8102
8102
  __classPrivateFieldGet$c(this, _ChannelClient_strategy, "f").close();
8103
8103
  });
8104
- __classPrivateFieldSet$a(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
8104
+ __classPrivateFieldSet$b(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
8105
8105
  this.disconnectListener = () => undefined;
8106
8106
  this.endpointId = routingInfo.endpointId;
8107
- __classPrivateFieldSet$a(this, _ChannelClient_strategy, strategy, "f");
8107
+ __classPrivateFieldSet$b(this, _ChannelClient_strategy, strategy, "f");
8108
8108
  channelClientsByEndpointId.set(this.endpointId, this);
8109
8109
  strategy.receive(this.processAction);
8110
8110
  }
@@ -8231,7 +8231,7 @@ exhaustive.exhaustiveCheck = exhaustiveCheck;
8231
8231
 
8232
8232
  var strategy$3 = {};
8233
8233
 
8234
- var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8234
+ var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8235
8235
  if (kind === "m") throw new TypeError("Private method is not writable");
8236
8236
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
8237
8237
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -8297,9 +8297,9 @@ class ClassicStrategy {
8297
8297
  this.close = async () => {
8298
8298
  this.messageReceiver.removeEndpoint(this.providerIdentity.channelId, this.endpointId);
8299
8299
  [...__classPrivateFieldGet$b(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
8300
- __classPrivateFieldSet$9(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
8300
+ __classPrivateFieldSet$a(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
8301
8301
  };
8302
- __classPrivateFieldSet$9(this, _ClassicStrategy_wire, wire, "f");
8302
+ __classPrivateFieldSet$a(this, _ClassicStrategy_wire, wire, "f");
8303
8303
  }
8304
8304
  onEndpointDisconnect(endpointId, listener) {
8305
8305
  // Never fires for 'classic'.
@@ -8361,7 +8361,7 @@ var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateF
8361
8361
  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");
8362
8362
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
8363
8363
  };
8364
- var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8364
+ var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8365
8365
  if (kind === "m") throw new TypeError("Private method is not writable");
8366
8366
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
8367
8367
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -8489,7 +8489,7 @@ class RTCEndpoint {
8489
8489
  }
8490
8490
  onDisconnect(listener) {
8491
8491
  if (!__classPrivateFieldGet$a(this, _RTCEndpoint_disconnectListener, "f")) {
8492
- __classPrivateFieldSet$8(this, _RTCEndpoint_disconnectListener, listener, "f");
8492
+ __classPrivateFieldSet$9(this, _RTCEndpoint_disconnectListener, listener, "f");
8493
8493
  }
8494
8494
  else {
8495
8495
  throw new Error('RTCEndpoint disconnectListener cannot be set twice.');
@@ -8499,7 +8499,7 @@ class RTCEndpoint {
8499
8499
  if (__classPrivateFieldGet$a(this, _RTCEndpoint_processAction, "f")) {
8500
8500
  throw new Error('You have already set a listener for this RTC Endpoint.');
8501
8501
  }
8502
- __classPrivateFieldSet$8(this, _RTCEndpoint_processAction, listener, "f");
8502
+ __classPrivateFieldSet$9(this, _RTCEndpoint_processAction, listener, "f");
8503
8503
  }
8504
8504
  get connected() {
8505
8505
  return this.rtc.rtcClient.connectionState === 'connected';
@@ -8515,7 +8515,7 @@ var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateF
8515
8515
  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");
8516
8516
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
8517
8517
  };
8518
- var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8518
+ var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8519
8519
  if (kind === "m") throw new TypeError("Private method is not writable");
8520
8520
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
8521
8521
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -8538,9 +8538,9 @@ class EndpointStrategy {
8538
8538
  this.close = async () => {
8539
8539
  if (__classPrivateFieldGet$9(this, _EndpointStrategy_connected, "f")) {
8540
8540
  __classPrivateFieldGet$9(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
8541
- __classPrivateFieldSet$7(this, _EndpointStrategy_endpointMap, new Map(), "f");
8541
+ __classPrivateFieldSet$8(this, _EndpointStrategy_endpointMap, new Map(), "f");
8542
8542
  }
8543
- __classPrivateFieldSet$7(this, _EndpointStrategy_connected, false, "f");
8543
+ __classPrivateFieldSet$8(this, _EndpointStrategy_connected, false, "f");
8544
8544
  };
8545
8545
  this.isValidEndpointPayload = validateEndpoint;
8546
8546
  }
@@ -8551,7 +8551,7 @@ class EndpointStrategy {
8551
8551
  if (__classPrivateFieldGet$9(this, _EndpointStrategy_processAction, "f")) {
8552
8552
  throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);
8553
8553
  }
8554
- __classPrivateFieldSet$7(this, _EndpointStrategy_processAction, listener, "f");
8554
+ __classPrivateFieldSet$8(this, _EndpointStrategy_processAction, listener, "f");
8555
8555
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
8556
8556
  __classPrivateFieldGet$9(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$9(this, _EndpointStrategy_processAction, "f")));
8557
8557
  }
@@ -8767,7 +8767,7 @@ var __classPrivateFieldGet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateF
8767
8767
  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");
8768
8768
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
8769
8769
  };
8770
- var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8770
+ var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8771
8771
  if (kind === "m") throw new TypeError("Private method is not writable");
8772
8772
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
8773
8773
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -8840,7 +8840,7 @@ class ChannelProvider extends channel_1.ChannelBase {
8840
8840
  _ChannelProvider_removeEndpoint.set(this, (identity) => {
8841
8841
  const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
8842
8842
  __classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
8843
- __classPrivateFieldSet$6(this, _ChannelProvider_connections, remainingConnections, "f");
8843
+ __classPrivateFieldSet$7(this, _ChannelProvider_connections, remainingConnections, "f");
8844
8844
  });
8845
8845
  // Must be bound.
8846
8846
  this.processAction = async (action, payload, senderIdentity) => {
@@ -8860,11 +8860,11 @@ class ChannelProvider extends channel_1.ChannelBase {
8860
8860
  remove();
8861
8861
  }
8862
8862
  });
8863
- __classPrivateFieldSet$6(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
8863
+ __classPrivateFieldSet$7(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
8864
8864
  this.connectListener = () => undefined;
8865
8865
  this.disconnectListener = () => undefined;
8866
- __classPrivateFieldSet$6(this, _ChannelProvider_connections, [], "f");
8867
- __classPrivateFieldSet$6(this, _ChannelProvider_strategy, strategy, "f");
8866
+ __classPrivateFieldSet$7(this, _ChannelProvider_connections, [], "f");
8867
+ __classPrivateFieldSet$7(this, _ChannelProvider_strategy, strategy, "f");
8868
8868
  strategy.receive(this.processAction);
8869
8869
  }
8870
8870
  /**
@@ -9003,7 +9003,7 @@ class ChannelProvider extends channel_1.ChannelBase {
9003
9003
  async destroy() {
9004
9004
  const protectedObj = __classPrivateFieldGet$8(this, _ChannelProvider_protectedObj, "f");
9005
9005
  protectedObj.providerIdentity;
9006
- __classPrivateFieldSet$6(this, _ChannelProvider_connections, [], "f");
9006
+ __classPrivateFieldSet$7(this, _ChannelProvider_connections, [], "f");
9007
9007
  await protectedObj.close();
9008
9008
  __classPrivateFieldGet$8(this, _ChannelProvider_close, "f").call(this);
9009
9009
  }
@@ -9287,7 +9287,7 @@ class CombinedStrategy {
9287
9287
  }
9288
9288
  strategy.default = CombinedStrategy;
9289
9289
 
9290
- var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9290
+ var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9291
9291
  if (kind === "m") throw new TypeError("Private method is not writable");
9292
9292
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9293
9293
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -9342,8 +9342,8 @@ class ConnectionManager extends base_1$f.Base {
9342
9342
  };
9343
9343
  this.providerMap = new Map();
9344
9344
  this.protocolManager = new protocol_manager_1.ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
9345
- __classPrivateFieldSet$5(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
9346
- __classPrivateFieldSet$5(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
9345
+ __classPrivateFieldSet$6(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
9346
+ __classPrivateFieldSet$6(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
9347
9347
  wire.registerMessageHandler(this.onmessage.bind(this));
9348
9348
  }
9349
9349
  createProvider(options, providerIdentity) {
@@ -9544,7 +9544,7 @@ _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnec
9544
9544
  *
9545
9545
  * @packageDocumentation
9546
9546
  */
9547
- var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9547
+ var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9548
9548
  if (kind === "m") throw new TypeError("Private method is not writable");
9549
9549
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9550
9550
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -9611,7 +9611,7 @@ class Channel extends base_1$e.EmitterBase {
9611
9611
  })
9612
9612
  ]).catch(() => new Error('error setting up channel connection listeners'));
9613
9613
  }));
9614
- __classPrivateFieldSet$4(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
9614
+ __classPrivateFieldSet$5(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
9615
9615
  }
9616
9616
  /**
9617
9617
  *
@@ -10754,19 +10754,23 @@ var Factory$3 = {};
10754
10754
 
10755
10755
  var Instance$2 = {};
10756
10756
 
10757
+ var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
10758
+ if (kind === "m") throw new TypeError("Private method is not writable");
10759
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
10760
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10761
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
10762
+ };
10757
10763
  var __classPrivateFieldGet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
10758
10764
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10759
10765
  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");
10760
10766
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
10761
10767
  };
10762
- var _Platform_connectToProvider;
10768
+ var _Platform_channelName, _Platform_connectToProvider;
10763
10769
  Object.defineProperty(Instance$2, "__esModule", { value: true });
10764
10770
  Instance$2.Platform = void 0;
10765
10771
  /* eslint-disable import/prefer-default-export, no-undef */
10766
10772
  const base_1$6 = base;
10767
10773
  const validate_1$1 = validate;
10768
- // Reuse clients to avoid overwriting already-registered client in provider
10769
- const clientMap = new Map();
10770
10774
  /** Manages the life cycle of windows and views in the application.
10771
10775
  *
10772
10776
  * Enables taking snapshots of itself and applying them to restore a previous configuration
@@ -10777,34 +10781,40 @@ class Platform extends base_1$6.EmitterBase {
10777
10781
  * @internal
10778
10782
  */
10779
10783
  // eslint-disable-next-line no-shadow
10780
- constructor(identity, channel) {
10784
+ constructor(wire, identity, channelName = `custom-frame-${identity.uuid}`) {
10781
10785
  // we piggyback off of application event emitter because from the core's perspective platform is just an app.
10782
- super(channel.wire, 'application', identity.uuid);
10783
- this.getClient = (identity) => {
10786
+ super(wire, 'application', identity.uuid);
10787
+ /**
10788
+ * @internal
10789
+ */
10790
+ _Platform_channelName.set(this, void 0);
10791
+ this.getClient = (identity = this.identity) => {
10792
+ if (identity.uuid !== this.identity.uuid) {
10793
+ // I have no idea why we allow passing in a different identity, but we do.
10794
+ // Doing this above the analytics call so we only register one call.
10795
+ return new Platform(this.wire, identity).getClient();
10796
+ }
10784
10797
  this.wire.sendAction('platform-get-client', this.identity).catch((e) => {
10785
10798
  // don't expose
10786
10799
  });
10787
- const target = identity || this.identity;
10788
- const { uuid } = target;
10789
- if (!clientMap.has(uuid)) {
10790
- const clientPromise = __classPrivateFieldGet$5(this, _Platform_connectToProvider, "f").call(this, uuid);
10791
- clientMap.set(uuid, clientPromise);
10800
+ if (!Platform.clientMap.has(__classPrivateFieldGet$5(this, _Platform_channelName, "f"))) {
10801
+ const clientPromise = __classPrivateFieldGet$5(this, _Platform_connectToProvider, "f").call(this);
10802
+ Platform.clientMap.set(__classPrivateFieldGet$5(this, _Platform_channelName, "f"), clientPromise);
10792
10803
  }
10793
10804
  // we set it above
10794
10805
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
10795
- return clientMap.get(uuid);
10806
+ return Platform.clientMap.get(__classPrivateFieldGet$5(this, _Platform_channelName, "f"));
10796
10807
  };
10797
- _Platform_connectToProvider.set(this, async (uuid) => {
10808
+ _Platform_connectToProvider.set(this, async () => {
10798
10809
  try {
10799
- const channelName = `custom-frame-${uuid}`;
10800
- const client = await this._channel.connect(channelName, { wait: false });
10810
+ const client = await this._channel.connect(__classPrivateFieldGet$5(this, _Platform_channelName, "f"), { wait: false });
10801
10811
  client.onDisconnection(() => {
10802
- clientMap.delete(uuid);
10812
+ Platform.clientMap.delete(__classPrivateFieldGet$5(this, _Platform_channelName, "f"));
10803
10813
  });
10804
10814
  return client;
10805
10815
  }
10806
10816
  catch (e) {
10807
- clientMap.delete(uuid);
10817
+ Platform.clientMap.delete(__classPrivateFieldGet$5(this, _Platform_channelName, "f"));
10808
10818
  throw new Error('The targeted Platform is not currently running. Listen for application-started event for the given Uuid.');
10809
10819
  }
10810
10820
  });
@@ -10817,7 +10827,8 @@ class Platform extends base_1$6.EmitterBase {
10817
10827
  if (errorMsg) {
10818
10828
  throw new Error(errorMsg);
10819
10829
  }
10820
- this._channel = channel;
10830
+ __classPrivateFieldSet$4(this, _Platform_channelName, channelName, "f");
10831
+ this._channel = this.fin.InterApplicationBus.Channel;
10821
10832
  this.identity = { uuid: identity.uuid };
10822
10833
  this.Layout = this.fin.Platform.Layout;
10823
10834
  this.Application = this.fin.Application.wrapSync(this.identity);
@@ -11582,7 +11593,13 @@ class Platform extends base_1$6.EmitterBase {
11582
11593
  }
11583
11594
  }
11584
11595
  Instance$2.Platform = Platform;
11585
- _Platform_connectToProvider = new WeakMap();
11596
+ _Platform_channelName = new WeakMap(), _Platform_connectToProvider = new WeakMap();
11597
+ /**
11598
+ * @internal
11599
+ * Reuse clients to avoid overwriting already-registered client in provider
11600
+ * This ensures that only channel client is created per channel name per `fin` instance
11601
+ */
11602
+ Platform.clientMap = new Map();
11586
11603
 
11587
11604
  var layout = {};
11588
11605
 
@@ -11983,7 +12000,7 @@ class Layout extends base_1$5.Base {
11983
12000
  const root = await client.getRoot('layoutName' in this.identity ? this.identity : undefined);
11984
12001
  return layout_entities_1.LayoutNode.getEntity(root, client);
11985
12002
  }
11986
- async getStackByView(identity) {
12003
+ async getStackByViewIdentity(identity) {
11987
12004
  this.wire.sendAction('layout-get-stack-by-view').catch(() => {
11988
12005
  // don't expose
11989
12006
  });
@@ -12352,7 +12369,7 @@ class PlatformModule extends base_1$3.Base {
12352
12369
  this.wire.sendAction('platform-wrap').catch((e) => {
12353
12370
  // don't expose
12354
12371
  });
12355
- return new Instance_1$1.Platform({ uuid: identity.uuid }, this._channel);
12372
+ return new Instance_1$1.Platform(this.wire, { uuid: identity.uuid });
12356
12373
  }
12357
12374
  /**
12358
12375
  * Synchronously returns a Platform object that represents an existing platform.
@@ -12369,7 +12386,7 @@ class PlatformModule extends base_1$3.Base {
12369
12386
  this.wire.sendAction('platform-wrap-sync').catch((e) => {
12370
12387
  // don't expose
12371
12388
  });
12372
- return new Instance_1$1.Platform({ uuid: identity.uuid }, this._channel);
12389
+ return new Instance_1$1.Platform(this.wire, { uuid: identity.uuid });
12373
12390
  }
12374
12391
  /**
12375
12392
  * Asynchronously returns a Platform object that represents the current platform.
@@ -17639,7 +17656,7 @@ class NodeEnvironment extends BaseEnvironment_1 {
17639
17656
  };
17640
17657
  }
17641
17658
  getAdapterVersionSync() {
17642
- return "40.82.17";
17659
+ return "40.82.19";
17643
17660
  }
17644
17661
  observeBounds(element, onChange) {
17645
17662
  throw new Error('Method not implemented.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/node-adapter",
3
- "version": "40.82.17",
3
+ "version": "40.82.19",
4
4
  "description": "See README.md",
5
5
  "main": "out/node-adapter.js",
6
6
  "types": "out/node-adapter.d.ts",
@@ -23,7 +23,7 @@
23
23
  "author": "OpenFin",
24
24
  "dependencies": {
25
25
  "@types/node": "^20.14.2",
26
- "@openfin/core": "40.82.17",
26
+ "@openfin/core": "40.82.19",
27
27
  "lodash": "^4.17.21",
28
28
  "ws": "^7.3.0"
29
29
  }