@openfin/node-adapter 41.102.6 → 41.102.8

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.
@@ -13166,7 +13166,7 @@ Object.defineProperty(PrivateChannelProvider$1, "__esModule", { value: true });
13166
13166
  PrivateChannelProvider$1.PrivateChannelProvider = void 0;
13167
13167
  const utils_1$8 = utils$3;
13168
13168
  class PrivateChannelProvider {
13169
- constructor(provider, id) {
13169
+ constructor(provider, id, removePrivateChannelProvider) {
13170
13170
  this.provider = provider;
13171
13171
  this.id = id;
13172
13172
  this.clients = new Map();
@@ -13174,6 +13174,7 @@ class PrivateChannelProvider {
13174
13174
  this.contextByContextType = new Map();
13175
13175
  this.lastContext = undefined;
13176
13176
  this.provider.onConnection((clientIdentity) => this.registerNewClient(clientIdentity));
13177
+ this.removePrivateChannelProvider = removePrivateChannelProvider;
13177
13178
  this.provider.onDisconnection(async (clientIdentity) => {
13178
13179
  const { endpointId } = clientIdentity;
13179
13180
  if (this.clients.has(endpointId)) {
@@ -13181,6 +13182,7 @@ class PrivateChannelProvider {
13181
13182
  }
13182
13183
  if ((await this.provider.getAllClientInfo()).length === 0) {
13183
13184
  this.provider.destroy();
13185
+ this.removePrivateChannelProvider(this.id);
13184
13186
  }
13185
13187
  });
13186
13188
  }
@@ -13432,8 +13434,8 @@ class PrivateChannelProvider {
13432
13434
  });
13433
13435
  });
13434
13436
  }
13435
- static init(channelProvider, id) {
13436
- return new PrivateChannelProvider(channelProvider, id);
13437
+ static init(channelProvider, id, removePrivateChannelProvider) {
13438
+ return new PrivateChannelProvider(channelProvider, id, removePrivateChannelProvider);
13437
13439
  }
13438
13440
  }
13439
13441
  PrivateChannelProvider$1.PrivateChannelProvider = PrivateChannelProvider;
@@ -13647,6 +13649,7 @@ class InteropBroker extends base_1$5.Base {
13647
13649
  this.intentClientMap = new Map();
13648
13650
  this.lastContextMap = new Map();
13649
13651
  this.sessionContextGroupMap = new Map();
13652
+ this.privateChannelProviderMap = new Map();
13650
13653
  __classPrivateFieldSet$5(this, _InteropBroker_providerPromise, new lazy_1.Lazy(createProvider), "f");
13651
13654
  this.setContextGroupMap();
13652
13655
  this.setupChannelProvider();
@@ -14667,7 +14670,15 @@ class InteropBroker extends base_1$5.Base {
14667
14670
  channel.register('createPrivateChannelProvider', async (payload) => {
14668
14671
  const { channelId } = payload;
14669
14672
  const channelProvider = await this.fin.InterApplicationBus.Channel.create(channelId);
14670
- PrivateChannelProvider_1.PrivateChannelProvider.init(channelProvider, channelId);
14673
+ const removePrivateChannelProvider = (channelId) => {
14674
+ this.privateChannelProviderMap.delete(channelId);
14675
+ };
14676
+ const privateChannelProvider = PrivateChannelProvider_1.PrivateChannelProvider.init(channelProvider, channelId, removePrivateChannelProvider);
14677
+ this.privateChannelProviderMap.set(channelId, privateChannelProvider);
14678
+ });
14679
+ channel.register('isIdUsedByPrivateChannel', async (payload) => {
14680
+ const { channelId } = payload;
14681
+ return this.privateChannelProviderMap.has(channelId);
14671
14682
  });
14672
14683
  }
14673
14684
  /**
@@ -15881,6 +15892,12 @@ class FDC3ModuleBase {
15881
15892
  this.wire.sendAction('fdc3-get-or-create-channel').catch((e) => {
15882
15893
  // we do not want to expose this error, just continue if this analytics-only call fails
15883
15894
  });
15895
+ const hasChannelIdBeenUsed = await InteropClient_1$2.InteropClient.ferryFdc3Call(this.client, 'isIdUsedByPrivateChannel', {
15896
+ channelId
15897
+ });
15898
+ if (hasChannelIdBeenUsed) {
15899
+ throw new Error(utils_1$4.ChannelError.AccessDenied);
15900
+ }
15884
15901
  const systemChannels = await this._getChannels();
15885
15902
  const userChannel = systemChannels.find((channel) => channel.id === channelId);
15886
15903
  if (userChannel) {
@@ -17823,7 +17840,7 @@ class NodeEnvironment extends BaseEnvironment_1 {
17823
17840
  };
17824
17841
  }
17825
17842
  getAdapterVersionSync() {
17826
- return "41.102.6";
17843
+ return "41.102.8";
17827
17844
  }
17828
17845
  observeBounds(element, onChange) {
17829
17846
  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.6",
3
+ "version": "41.102.8",
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.6",
27
+ "@openfin/core": "41.102.8",
28
28
  "lodash": "^4.17.21",
29
29
  "ws": "^7.3.0"
30
30
  }