@openfin/node-adapter 36.79.15 → 36.79.18

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.
@@ -88,12 +88,21 @@ declare type Api = {
88
88
  iframe?: {
89
89
  /**
90
90
  * Inject OpenFin API into cross-origin iframes
91
+ *
92
+ * @defaultValue false
91
93
  */
92
94
  crossOriginInjection?: boolean;
93
95
  /**
94
96
  * Inject OpenFin API into same-origin iframes
97
+ *
98
+ * @defaultValue true
95
99
  */
96
100
  sameOriginInjection?: boolean;
101
+ /**
102
+ * @deprecated Shared names should not be used; support is provided purely for back-compat reasons.
103
+ *
104
+ * When `true`, iframes will have the same name as their parent WebContents.
105
+ */
97
106
  enableDeprecatedSharedName?: boolean;
98
107
  };
99
108
  /**
@@ -1668,9 +1677,9 @@ declare class Base {
1668
1677
  * on the context in which the devtools panel was opened.
1669
1678
  */
1670
1679
  get me(): Identity;
1671
- protected isNodeEnvironment: () => boolean;
1672
- protected isOpenFinEnvironment: () => boolean;
1673
- protected isBrowserEnvironment: () => boolean;
1680
+ /* Excluded from this release type: isNodeEnvironment */
1681
+ /* Excluded from this release type: isOpenFinEnvironment */
1682
+ /* Excluded from this release type: isBrowserEnvironment */
1674
1683
  }
1675
1684
 
1676
1685
  /**
@@ -5206,8 +5215,14 @@ declare interface Environment {
5206
5215
  getRtcPeer(): RTCPeerConnection;
5207
5216
  getWsConstructor(): typeof WebSocket;
5208
5217
  whenReady(): Promise<void>;
5218
+ getInteropInfo(fin: OpenFin.Fin<OpenFin.EntityType>): Promise<InternalInteropBrokerOptions & {
5219
+ fdc3Version?: Fdc3Version;
5220
+ }>;
5221
+ readonly type: EnvironmentType;
5209
5222
  }
5210
5223
 
5224
+ declare type EnvironmentType = 'node' | 'openfin' | 'other';
5225
+
5211
5226
  declare type ErrorMiddleware = OpenFin.ErrorMiddleware;
5212
5227
 
5213
5228
  declare type ErrorMiddleware_2 = (topic: string, error: Error, id: ProviderIdentity_7 | ClientIdentity) => unknown;
@@ -5615,6 +5630,8 @@ declare namespace FDC3 {
5615
5630
  }
5616
5631
  }
5617
5632
 
5633
+ declare type Fdc3Version = '1.2' | '2.0';
5634
+
5618
5635
  /**
5619
5636
  * @interface
5620
5637
  */
@@ -6994,6 +7011,15 @@ declare class InterApplicationBus extends Base {
6994
7011
 
6995
7012
  declare type InternalConnectConfig = ExistingConnectConfig | NewConnectConfig;
6996
7013
 
7014
+ declare type InternalFDC3Info = {
7015
+ providerVersion: string;
7016
+ provider: string;
7017
+ };
7018
+
7019
+ declare type InternalInteropBrokerOptions = OpenFin.InteropBrokerOptions & {
7020
+ fdc3Info: InternalFDC3Info;
7021
+ };
7022
+
6997
7023
  /**
6998
7024
  * Define whether to enable interop action logging.
6999
7025
  *
@@ -7122,6 +7148,7 @@ declare type InteropActionLoggingOption = {
7122
7148
  *
7123
7149
  */
7124
7150
  declare class InteropBroker extends Base {
7151
+ #private;
7125
7152
  private getProvider;
7126
7153
  private interopClients;
7127
7154
  private contextGroupsById;
@@ -88,12 +88,21 @@ declare type Api = {
88
88
  iframe?: {
89
89
  /**
90
90
  * Inject OpenFin API into cross-origin iframes
91
+ *
92
+ * @defaultValue false
91
93
  */
92
94
  crossOriginInjection?: boolean;
93
95
  /**
94
96
  * Inject OpenFin API into same-origin iframes
97
+ *
98
+ * @defaultValue true
95
99
  */
96
100
  sameOriginInjection?: boolean;
101
+ /**
102
+ * @deprecated Shared names should not be used; support is provided purely for back-compat reasons.
103
+ *
104
+ * When `true`, iframes will have the same name as their parent WebContents.
105
+ */
97
106
  enableDeprecatedSharedName?: boolean;
98
107
  };
99
108
  /**
@@ -1668,9 +1677,9 @@ declare class Base {
1668
1677
  * on the context in which the devtools panel was opened.
1669
1678
  */
1670
1679
  get me(): Identity;
1671
- protected isNodeEnvironment: () => boolean;
1672
- protected isOpenFinEnvironment: () => boolean;
1673
- protected isBrowserEnvironment: () => boolean;
1680
+ /* Excluded from this release type: isNodeEnvironment */
1681
+ /* Excluded from this release type: isOpenFinEnvironment */
1682
+ /* Excluded from this release type: isBrowserEnvironment */
1674
1683
  }
1675
1684
 
1676
1685
  /**
@@ -5206,8 +5215,14 @@ declare interface Environment {
5206
5215
  getRtcPeer(): RTCPeerConnection;
5207
5216
  getWsConstructor(): typeof WebSocket;
5208
5217
  whenReady(): Promise<void>;
5218
+ getInteropInfo(fin: OpenFin.Fin<OpenFin.EntityType>): Promise<InternalInteropBrokerOptions & {
5219
+ fdc3Version?: Fdc3Version;
5220
+ }>;
5221
+ readonly type: EnvironmentType;
5209
5222
  }
5210
5223
 
5224
+ declare type EnvironmentType = 'node' | 'openfin' | 'other';
5225
+
5211
5226
  declare type ErrorMiddleware = OpenFin.ErrorMiddleware;
5212
5227
 
5213
5228
  declare type ErrorMiddleware_2 = (topic: string, error: Error, id: ProviderIdentity_7 | ClientIdentity) => unknown;
@@ -5615,6 +5630,8 @@ declare namespace FDC3 {
5615
5630
  }
5616
5631
  }
5617
5632
 
5633
+ declare type Fdc3Version = '1.2' | '2.0';
5634
+
5618
5635
  /**
5619
5636
  * @interface
5620
5637
  */
@@ -6994,6 +7011,15 @@ declare class InterApplicationBus extends Base {
6994
7011
 
6995
7012
  declare type InternalConnectConfig = ExistingConnectConfig | NewConnectConfig;
6996
7013
 
7014
+ declare type InternalFDC3Info = {
7015
+ providerVersion: string;
7016
+ provider: string;
7017
+ };
7018
+
7019
+ declare type InternalInteropBrokerOptions = OpenFin.InteropBrokerOptions & {
7020
+ fdc3Info: InternalFDC3Info;
7021
+ };
7022
+
6997
7023
  /**
6998
7024
  * Define whether to enable interop action logging.
6999
7025
  *
@@ -7122,6 +7148,7 @@ declare type InteropActionLoggingOption = {
7122
7148
  *
7123
7149
  */
7124
7150
  declare class InteropBroker extends Base {
7151
+ #private;
7125
7152
  private getProvider;
7126
7153
  private interopClients;
7127
7154
  private contextGroupsById;
@@ -88,12 +88,21 @@ declare type Api = {
88
88
  iframe?: {
89
89
  /**
90
90
  * Inject OpenFin API into cross-origin iframes
91
+ *
92
+ * @defaultValue false
91
93
  */
92
94
  crossOriginInjection?: boolean;
93
95
  /**
94
96
  * Inject OpenFin API into same-origin iframes
97
+ *
98
+ * @defaultValue true
95
99
  */
96
100
  sameOriginInjection?: boolean;
101
+ /**
102
+ * @deprecated Shared names should not be used; support is provided purely for back-compat reasons.
103
+ *
104
+ * When `true`, iframes will have the same name as their parent WebContents.
105
+ */
97
106
  enableDeprecatedSharedName?: boolean;
98
107
  };
99
108
  /**
@@ -1668,9 +1677,9 @@ declare class Base {
1668
1677
  * on the context in which the devtools panel was opened.
1669
1678
  */
1670
1679
  get me(): Identity;
1671
- protected isNodeEnvironment: () => boolean;
1672
- protected isOpenFinEnvironment: () => boolean;
1673
- protected isBrowserEnvironment: () => boolean;
1680
+ /* Excluded from this release type: isNodeEnvironment */
1681
+ /* Excluded from this release type: isOpenFinEnvironment */
1682
+ /* Excluded from this release type: isBrowserEnvironment */
1674
1683
  }
1675
1684
 
1676
1685
  /**
@@ -5206,8 +5215,14 @@ declare interface Environment {
5206
5215
  getRtcPeer(): RTCPeerConnection;
5207
5216
  getWsConstructor(): typeof WebSocket;
5208
5217
  whenReady(): Promise<void>;
5218
+ getInteropInfo(fin: OpenFin.Fin<OpenFin.EntityType>): Promise<InternalInteropBrokerOptions & {
5219
+ fdc3Version?: Fdc3Version;
5220
+ }>;
5221
+ readonly type: EnvironmentType;
5209
5222
  }
5210
5223
 
5224
+ declare type EnvironmentType = 'node' | 'openfin' | 'other';
5225
+
5211
5226
  declare type ErrorMiddleware = OpenFin.ErrorMiddleware;
5212
5227
 
5213
5228
  declare type ErrorMiddleware_2 = (topic: string, error: Error, id: ProviderIdentity_7 | ClientIdentity) => unknown;
@@ -5615,6 +5630,8 @@ declare namespace FDC3 {
5615
5630
  }
5616
5631
  }
5617
5632
 
5633
+ declare type Fdc3Version = '1.2' | '2.0';
5634
+
5618
5635
  /**
5619
5636
  * @interface
5620
5637
  */
@@ -6994,6 +7011,15 @@ declare class InterApplicationBus extends Base {
6994
7011
 
6995
7012
  declare type InternalConnectConfig = ExistingConnectConfig | NewConnectConfig;
6996
7013
 
7014
+ declare type InternalFDC3Info = {
7015
+ providerVersion: string;
7016
+ provider: string;
7017
+ };
7018
+
7019
+ declare type InternalInteropBrokerOptions = OpenFin.InteropBrokerOptions & {
7020
+ fdc3Info: InternalFDC3Info;
7021
+ };
7022
+
6997
7023
  /**
6998
7024
  * Define whether to enable interop action logging.
6999
7025
  *
@@ -7122,6 +7148,7 @@ declare type InteropActionLoggingOption = {
7122
7148
  *
7123
7149
  */
7124
7150
  declare class InteropBroker extends Base {
7151
+ #private;
7125
7152
  private getProvider;
7126
7153
  private interopClients;
7127
7154
  private contextGroupsById;
@@ -88,12 +88,21 @@ declare type Api = {
88
88
  iframe?: {
89
89
  /**
90
90
  * Inject OpenFin API into cross-origin iframes
91
+ *
92
+ * @defaultValue false
91
93
  */
92
94
  crossOriginInjection?: boolean;
93
95
  /**
94
96
  * Inject OpenFin API into same-origin iframes
97
+ *
98
+ * @defaultValue true
95
99
  */
96
100
  sameOriginInjection?: boolean;
101
+ /**
102
+ * @deprecated Shared names should not be used; support is provided purely for back-compat reasons.
103
+ *
104
+ * When `true`, iframes will have the same name as their parent WebContents.
105
+ */
97
106
  enableDeprecatedSharedName?: boolean;
98
107
  };
99
108
  /**
@@ -1688,8 +1697,20 @@ declare class Base {
1688
1697
  * on the context in which the devtools panel was opened.
1689
1698
  */
1690
1699
  get me(): Identity;
1700
+ /**
1701
+ * @internal
1702
+ * @deprecated
1703
+ */
1691
1704
  protected isNodeEnvironment: () => boolean;
1705
+ /**
1706
+ * @internal
1707
+ * @deprecated
1708
+ */
1692
1709
  protected isOpenFinEnvironment: () => boolean;
1710
+ /**
1711
+ * @internal
1712
+ * @deprecated
1713
+ */
1693
1714
  protected isBrowserEnvironment: () => boolean;
1694
1715
  }
1695
1716
 
@@ -5254,8 +5275,14 @@ declare interface Environment {
5254
5275
  getRtcPeer(): RTCPeerConnection;
5255
5276
  getWsConstructor(): typeof WebSocket;
5256
5277
  whenReady(): Promise<void>;
5278
+ getInteropInfo(fin: OpenFin.Fin<OpenFin.EntityType>): Promise<InternalInteropBrokerOptions & {
5279
+ fdc3Version?: Fdc3Version;
5280
+ }>;
5281
+ readonly type: EnvironmentType;
5257
5282
  }
5258
5283
 
5284
+ declare type EnvironmentType = 'node' | 'openfin' | 'other';
5285
+
5259
5286
  declare type ErrorMiddleware = OpenFin.ErrorMiddleware;
5260
5287
 
5261
5288
  declare type ErrorMiddleware_2 = (topic: string, error: Error, id: ProviderIdentity_7 | ClientIdentity) => unknown;
@@ -5684,6 +5711,8 @@ declare namespace FDC3 {
5684
5711
  }
5685
5712
  }
5686
5713
 
5714
+ declare type Fdc3Version = '1.2' | '2.0';
5715
+
5687
5716
  /**
5688
5717
  * @interface
5689
5718
  */
@@ -7106,6 +7135,15 @@ declare class InterAppPayload {
7106
7135
 
7107
7136
  declare type InternalConnectConfig = ExistingConnectConfig | NewConnectConfig;
7108
7137
 
7138
+ declare type InternalFDC3Info = {
7139
+ providerVersion: string;
7140
+ provider: string;
7141
+ };
7142
+
7143
+ declare type InternalInteropBrokerOptions = OpenFin.InteropBrokerOptions & {
7144
+ fdc3Info: InternalFDC3Info;
7145
+ };
7146
+
7109
7147
  /**
7110
7148
  * Define whether to enable interop action logging.
7111
7149
  *
@@ -7234,6 +7272,7 @@ declare type InteropActionLoggingOption = {
7234
7272
  *
7235
7273
  */
7236
7274
  declare class InteropBroker extends Base {
7275
+ #private;
7237
7276
  private getProvider;
7238
7277
  private interopClients;
7239
7278
  private contextGroupsById;
@@ -7245,7 +7284,7 @@ declare class InteropBroker extends Base {
7245
7284
  /**
7246
7285
  * @internal
7247
7286
  */
7248
- constructor(wire: Transport, getProvider: () => Promise<OpenFin.ChannelProvider>, options?: any);
7287
+ constructor(wire: Transport, getProvider: () => Promise<OpenFin.ChannelProvider>, options: InternalInteropBrokerOptions);
7249
7288
  static createClosedConstructor(...args: ConstructorParameters<typeof InteropBroker>): {
7250
7289
  new (): InteropBroker;
7251
7290
  };
@@ -92,14 +92,26 @@ class Base {
92
92
  * @internal
93
93
  */
94
94
  constructor(wire) {
95
+ /**
96
+ * @internal
97
+ * @deprecated
98
+ */
95
99
  this.isNodeEnvironment = () => {
96
- return this.wire.environment.constructor.name === 'NodeEnvironment';
100
+ return this.wire.environment.type === 'node';
97
101
  };
102
+ /**
103
+ * @internal
104
+ * @deprecated
105
+ */
98
106
  this.isOpenFinEnvironment = () => {
99
- return this.wire.environment.constructor.name === 'OpenFinEnvironment';
107
+ return this.wire.environment.type === 'openfin';
100
108
  };
109
+ /**
110
+ * @internal
111
+ * @deprecated
112
+ */
101
113
  this.isBrowserEnvironment = () => {
102
- return this.wire.environment.constructor.name === 'BrowserEnvironment';
114
+ return this.wire.environment.type === 'other';
103
115
  };
104
116
  this.wire = wire;
105
117
  }
@@ -6661,7 +6673,7 @@ class System extends base_1$j.EmitterBase {
6661
6673
  reject = n;
6662
6674
  });
6663
6675
  // node.js environment not supported
6664
- if (this.wire.environment.constructor.name === 'NodeEnvironment') {
6676
+ if (this.wire.environment.type !== 'openfin') {
6665
6677
  throw new transport_errors_1$2.NotSupportedError('downloadAsset only supported in an OpenFin Render process');
6666
6678
  }
6667
6679
  const callSite = transport_errors_1$2.RuntimeError.getCallSite();
@@ -6738,7 +6750,7 @@ class System extends base_1$j.EmitterBase {
6738
6750
  const callsites = transport_errors_1$2.RuntimeError.getCallSite();
6739
6751
  return new Promise((resolve, reject) => {
6740
6752
  // node.js environment not supported
6741
- if (this.wire.environment.constructor.name === 'NodeEnvironment') {
6753
+ if (this.wire.environment.type !== 'openfin') {
6742
6754
  reject(new transport_errors_1$2.NotSupportedError('downloadRuntime only supported in an OpenFin Render process'));
6743
6755
  return;
6744
6756
  }
@@ -9084,7 +9096,7 @@ class ConnectionManager extends base_1$g.Base {
9084
9096
  return false;
9085
9097
  };
9086
9098
  this.providerMap = new Map();
9087
- this.protocolManager = new protocol_manager_1.ProtocolManager(this.isNodeEnvironment() ? ['classic'] : ['rtc', 'classic']);
9099
+ this.protocolManager = new protocol_manager_1.ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
9088
9100
  __classPrivateFieldSet$6(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
9089
9101
  __classPrivateFieldSet$6(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
9090
9102
  wire.registerMessageHandler(this.onmessage.bind(this));
@@ -9668,14 +9680,12 @@ class InterApplicationBus extends base_1$e.Base {
9668
9680
  * fin.InterApplicationBus.publish('topic', 'hello').then(() => console.log('Published')).catch(err => console.log(err));
9669
9681
  * ```
9670
9682
  */
9671
- publish(topic, message) {
9672
- return this.wire
9673
- .sendAction('publish-message', {
9683
+ async publish(topic, message) {
9684
+ await this.wire.sendAction('publish-message', {
9674
9685
  topic,
9675
9686
  message,
9676
9687
  sourceWindowName: this.me.name
9677
- })
9678
- .then(() => undefined);
9688
+ });
9679
9689
  }
9680
9690
  /**
9681
9691
  * Sends a message to a specific application on a specific topic.
@@ -9724,8 +9734,8 @@ class InterApplicationBus extends base_1$e.Base {
9724
9734
  */
9725
9735
  subscribe(source, topic, listener) {
9726
9736
  const subKey = this.createSubscriptionKey(source.uuid, source.name || '*', topic);
9727
- const sendSubscription = () => {
9728
- return this.wire.sendAction('subscribe', {
9737
+ const sendSubscription = async () => {
9738
+ await this.wire.sendAction('subscribe', {
9729
9739
  sourceUuid: source.uuid,
9730
9740
  sourceWindowName: source.name || '*',
9731
9741
  topic,
@@ -9765,8 +9775,8 @@ class InterApplicationBus extends base_1$e.Base {
9765
9775
  unsubscribe(source, topic, listener) {
9766
9776
  const sourceWindowName = source.name || '*';
9767
9777
  const subKey = this.createSubscriptionKey(source.uuid, sourceWindowName, topic);
9768
- const sendUnsubscription = () => {
9769
- return this.wire.sendAction('unsubscribe', {
9778
+ const sendUnsubscription = async () => {
9779
+ await this.wire.sendAction('unsubscribe', {
9770
9780
  sourceUuid: source.uuid,
9771
9781
  sourceWindowName,
9772
9782
  topic,
@@ -12914,6 +12924,18 @@ var hasRequiredInteropBroker;
12914
12924
  function requireInteropBroker () {
12915
12925
  if (hasRequiredInteropBroker) return InteropBroker;
12916
12926
  hasRequiredInteropBroker = 1;
12927
+ var __classPrivateFieldSet = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
12928
+ if (kind === "m") throw new TypeError("Private method is not writable");
12929
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
12930
+ 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");
12931
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12932
+ };
12933
+ var __classPrivateFieldGet = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12934
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
12935
+ 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");
12936
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12937
+ };
12938
+ var _InteropBroker_fdc3Info, _InteropBroker_contextGroups;
12917
12939
  Object.defineProperty(InteropBroker, "__esModule", { value: true });
12918
12940
  InteropBroker.InteropBroker = void 0;
12919
12941
  const base_1 = base$1;
@@ -12921,7 +12943,7 @@ function requireInteropBroker () {
12921
12943
  const utils_1 = utils$1;
12922
12944
  const lodash_1 = require$$3;
12923
12945
  const PrivateChannelProvider_1 = requirePrivateChannelProvider();
12924
- let contextGroups = [
12946
+ const defaultContextGroups = [
12925
12947
  {
12926
12948
  id: 'green',
12927
12949
  displayMetadata: {
@@ -13092,11 +13114,12 @@ function requireInteropBroker () {
13092
13114
  // Tip from Pierre and Michael from the overrideCheck work: Don't use bound methods for overrideable InteropBroker functions.
13093
13115
  super(wire);
13094
13116
  this.getProvider = getProvider;
13117
+ _InteropBroker_fdc3Info.set(this, void 0);
13118
+ _InteropBroker_contextGroups.set(this, void 0);
13095
13119
  this.interopClients = new Map();
13096
13120
  this.contextGroupsById = new Map();
13097
- if (options?.contextGroups) {
13098
- contextGroups = options.contextGroups;
13099
- }
13121
+ __classPrivateFieldSet(this, _InteropBroker_contextGroups, options.contextGroups ?? [...defaultContextGroups], "f");
13122
+ __classPrivateFieldSet(this, _InteropBroker_fdc3Info, options.fdc3Info, "f");
13100
13123
  if (options?.logging) {
13101
13124
  this.logging = options.logging;
13102
13125
  }
@@ -13360,7 +13383,7 @@ function requireInteropBroker () {
13360
13383
  // don't expose, analytics-only call
13361
13384
  });
13362
13385
  // Create copy for immutability
13363
- return contextGroups.map((contextGroup) => {
13386
+ return __classPrivateFieldGet(this, _InteropBroker_contextGroups, "f").map((contextGroup) => {
13364
13387
  return { ...contextGroup };
13365
13388
  });
13366
13389
  }
@@ -13771,8 +13794,7 @@ function requireInteropBroker () {
13771
13794
  const { fdc3Version } = payload;
13772
13795
  return {
13773
13796
  fdc3Version,
13774
- provider: 'OpenFin',
13775
- providerVersion: await this.fin.System.getVersion(),
13797
+ ...__classPrivateFieldGet(this, _InteropBroker_fdc3Info, "f"),
13776
13798
  optionalFeatures: {
13777
13799
  OriginatingAppMetadata: false,
13778
13800
  UserChannelMembershipAPIs: true
@@ -14041,23 +14063,25 @@ function requireInteropBroker () {
14041
14063
  }
14042
14064
  }
14043
14065
  async setCurrentContextGroupInClientOptions(clientIdentity, contextGroupId) {
14044
- const entityInfo = await this.fin.System.getEntityInfo(clientIdentity.uuid, clientIdentity.name);
14045
- let entity;
14046
- if (entityInfo.entityType === 'view') {
14047
- entity = await this.fin.View.wrap(clientIdentity);
14048
- }
14049
- else if (entityInfo.entityType === 'window') {
14050
- entity = await this.fin.Window.wrap(clientIdentity);
14051
- }
14052
- if (entity) {
14053
- await entity.updateOptions({
14054
- interop: {
14055
- currentContextGroup: contextGroupId
14056
- }
14057
- });
14066
+ try {
14067
+ const entityInfo = await this.fin.System.getEntityInfo(clientIdentity.uuid, clientIdentity.name);
14068
+ let entity;
14069
+ if (entityInfo.entityType === 'view') {
14070
+ entity = await this.fin.View.wrap(clientIdentity);
14071
+ }
14072
+ else if (entityInfo.entityType === 'window') {
14073
+ entity = await this.fin.Window.wrap(clientIdentity);
14074
+ }
14075
+ if (entity) {
14076
+ await entity.updateOptions({
14077
+ interop: {
14078
+ currentContextGroup: contextGroupId
14079
+ }
14080
+ });
14081
+ }
14058
14082
  }
14059
- else {
14060
- console.warn(`Setting Current Context Group: Entity with identity ${clientIdentity.uuid}, ${clientIdentity.name} is not a window or view. It is a ${entityInfo.entityType} instead.`);
14083
+ catch (error) {
14084
+ // May file in interop
14061
14085
  }
14062
14086
  }
14063
14087
  async setupChannelProvider() {
@@ -14175,6 +14199,7 @@ function requireInteropBroker () {
14175
14199
  }
14176
14200
  };
14177
14201
  InteropBroker.InteropBroker = InteropBroker$1;
14202
+ _InteropBroker_fdc3Info = new WeakMap(), _InteropBroker_contextGroups = new WeakMap();
14178
14203
  return InteropBroker;
14179
14204
  }
14180
14205
 
@@ -14875,7 +14900,7 @@ function requireOverrideCheck () {
14875
14900
  overrideCheck.overrideCheck = overrideCheck.checkFDC32Overrides = overrideCheck.getDefaultViewFdc3VersionFromAppInfo = void 0;
14876
14901
  const InteropBroker_1 = requireInteropBroker();
14877
14902
  function getDefaultViewFdc3VersionFromAppInfo({ manifest, initialOptions }) {
14878
- const setVersion = manifest.platform?.defaultViewOptions?.fdc3InteropApi ?? initialOptions.defaultViewOptions?.fdc3InteropApi;
14903
+ const setVersion = manifest?.platform?.defaultViewOptions?.fdc3InteropApi ?? initialOptions.defaultViewOptions?.fdc3InteropApi;
14879
14904
  return ['1.2', '2.0'].includes(setVersion ?? '') ? setVersion : undefined;
14880
14905
  }
14881
14906
  overrideCheck.getDefaultViewFdc3VersionFromAppInfo = getDefaultViewFdc3VersionFromAppInfo;
@@ -14950,10 +14975,9 @@ function requireFactory () {
14950
14975
  // don't expose, analytics-only call
14951
14976
  });
14952
14977
  // Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
14953
- const options = await this.fin.Application.getCurrentSync().getInfo();
14954
- const opts = options.initialOptions.interopBrokerConfiguration ?? {};
14978
+ const options = await this.wire.environment.getInteropInfo(this.wire.getFin());
14955
14979
  const objectThatThrows = (0, inaccessibleObject_1.createUnusableObject)(BrokerParamAccessError);
14956
- const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (0, lodash_1.cloneDeep)(opts));
14980
+ const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (0, lodash_1.cloneDeep)(options));
14957
14981
  let provider;
14958
14982
  const getProvider = () => {
14959
14983
  if (!provider) {
@@ -14965,7 +14989,7 @@ function requireFactory () {
14965
14989
  // eslint-disable-next-line no-console
14966
14990
  throw new Error(BrokerParamAccessError);
14967
14991
  };
14968
- const OverrideableBroker = InteropBroker_1.InteropBroker.createClosedConstructor(this.wire, getProvider, opts);
14992
+ const OverrideableBroker = InteropBroker_1.InteropBroker.createClosedConstructor(this.wire, getProvider, options);
14969
14993
  let broker;
14970
14994
  if (Array.isArray(override)) {
14971
14995
  const BrokerConstructor = (0, common_utils_1.overrideFromComposables)(...override)(OverrideableBroker);
@@ -14978,7 +15002,7 @@ function requireFactory () {
14978
15002
  // @ts-expect-error
14979
15003
  broker = await override(OverrideableBroker, objectThatThrows, throwingGetProvider, warningOptsClone);
14980
15004
  }
14981
- (0, overrideCheck_1.overrideCheck)(broker, (0, overrideCheck_1.getDefaultViewFdc3VersionFromAppInfo)(options));
15005
+ (0, overrideCheck_1.overrideCheck)(broker, options.fdc3Version);
14982
15006
  return broker;
14983
15007
  }
14984
15008
  /**
@@ -16200,6 +16224,30 @@ function requirePortDiscovery () {
16200
16224
  return portDiscovery;
16201
16225
  }
16202
16226
 
16227
+ var baseEnv = {};
16228
+
16229
+ Object.defineProperty(baseEnv, "__esModule", { value: true });
16230
+ baseEnv.BaseEnvironment = void 0;
16231
+ const overrideCheck_1 = requireOverrideCheck();
16232
+ class BaseEnvironment {
16233
+ async getInteropInfo(fin) {
16234
+ const appInfo = await fin.Application.getCurrentSync()
16235
+ .getInfo()
16236
+ .catch(() => null);
16237
+ const brokerConfig = appInfo?.initialOptions?.interopBrokerConfiguration ?? {};
16238
+ const fdc3Version = appInfo ? (0, overrideCheck_1.getDefaultViewFdc3VersionFromAppInfo)(appInfo) : undefined;
16239
+ return {
16240
+ fdc3Version,
16241
+ ...brokerConfig,
16242
+ fdc3Info: {
16243
+ providerVersion: await fin.System.getVersion(),
16244
+ provider: 'OpenFin'
16245
+ }
16246
+ };
16247
+ }
16248
+ }
16249
+ baseEnv.BaseEnvironment = BaseEnvironment;
16250
+
16203
16251
  var hasRequiredNodeEnv;
16204
16252
 
16205
16253
  function requireNodeEnv () {
@@ -16213,13 +16261,16 @@ function requireNodeEnv () {
16213
16261
  const environment_1 = environment;
16214
16262
  const port_discovery_1 = requirePortDiscovery();
16215
16263
  const transport_errors_1 = transportErrors;
16264
+ const base_env_1 = baseEnv;
16216
16265
  // Due to https://github.com/rollup/rollup/issues/1267, we need this guard
16217
16266
  // to ensure the import works with and without the 'esModuleInterop' ts flag.
16218
16267
  // This is due to our mocha tests not being compatible with esModuleInterop,
16219
16268
  // whereas rollup enforces it.
16220
16269
  const WS = _WS.default || _WS;
16221
- class NodeEnvironment {
16270
+ class NodeEnvironment extends base_env_1.BaseEnvironment {
16222
16271
  constructor() {
16272
+ super(...arguments);
16273
+ this.type = 'node';
16223
16274
  this.messageCounter = 0;
16224
16275
  this.childViews = false;
16225
16276
  this.writeToken = (path, token) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/node-adapter",
3
- "version": "36.79.15",
3
+ "version": "36.79.18",
4
4
  "description": "See README.md",
5
5
  "main": "out/node-adapter.js",
6
6
  "types": "out/node-adapter.d.ts",