@openfin/node-adapter 34.78.67 → 34.78.73

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.
Files changed (2) hide show
  1. package/out/node-adapter.js +18 -33
  2. package/package.json +1 -1
@@ -37,7 +37,7 @@ function getDefaultExportFromCjs (x) {
37
37
 
38
38
  var main$1 = {};
39
39
 
40
- var fin = {};
40
+ var fin$1 = {};
41
41
 
42
42
  var system$1 = {};
43
43
 
@@ -12382,7 +12382,7 @@ const validate_1 = validate;
12382
12382
  const base_1$6 = base$1;
12383
12383
  const common_utils_1 = commonUtils;
12384
12384
  const layout_entities_1 = layoutEntities;
12385
- const layout_constants_1 = layout_constants;
12385
+ const layout_constants_1$1 = layout_constants;
12386
12386
  /**
12387
12387
  *
12388
12388
  * Layouts give app providers the ability to embed multiple views in a single window. The Layout namespace
@@ -12527,7 +12527,7 @@ class Layout extends base_1$6.Base {
12527
12527
  * Lazily constructed {@link LayoutEntitiesClient} bound to this platform's client and identity
12528
12528
  * The client is for {@link LayoutEntitiesController}
12529
12529
  */
12530
- _Layout_layoutClient.set(this, new lazy_1.Lazy(async () => layout_entities_1.LayoutNode.newLayoutEntitiesClient(await this.platform.getClient(), layout_constants_1.LAYOUT_CONTROLLER_ID, this.identity)));
12530
+ _Layout_layoutClient.set(this, new lazy_1.Lazy(async () => layout_entities_1.LayoutNode.newLayoutEntitiesClient(await this.platform.getClient(), layout_constants_1$1.LAYOUT_CONTROLLER_ID, this.identity)));
12531
12531
  /**
12532
12532
  * Replaces a Platform window's layout with a new layout.
12533
12533
  *
@@ -12755,11 +12755,12 @@ var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
12755
12755
  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");
12756
12756
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12757
12757
  };
12758
- var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_waitForBackCompatLayoutManager, _LayoutModule_throwIfLayoutManagerNotInitialized;
12758
+ var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_throwIfLayoutManagerNotInitialized;
12759
12759
  Object.defineProperty(Factory$2, "__esModule", { value: true });
12760
12760
  Factory$2.LayoutModule = void 0;
12761
12761
  const base_1$5 = base$1;
12762
12762
  const Instance_1$2 = Instance$1;
12763
+ const layout_constants_1 = layout_constants;
12763
12764
  /**
12764
12765
  * Static namespace for OpenFin API methods that interact with the {@link Layout} class, available under `fin.Platform.Layout`.
12765
12766
  */
@@ -12819,17 +12820,15 @@ class LayoutModule extends base_1$5.Base {
12819
12820
  }
12820
12821
  __classPrivateFieldSet$4(this, _LayoutModule_layoutInitializationAttempted, true, "f");
12821
12822
  __classPrivateFieldSet$4(this, _LayoutModule_layoutManager, await this.wire.environment.initLayoutManager(this.fin, this.wire, options), "f");
12822
- // in single-layout case, we return the undocumented layoutManager type (deprecate with CORE-1081)
12823
- let backCompatLayoutPromise;
12824
- if (!options.layoutManagerOverride) {
12825
- backCompatLayoutPromise = __classPrivateFieldGet$4(this, _LayoutModule_waitForBackCompatLayoutManager, "f").call(this, this.fin);
12826
- }
12827
12823
  // apply the initial snapshot which in turn will call fin.Platform.Layout.create()
12828
12824
  const platformClient = await this.fin.Platform.getCurrentSync().getClient();
12829
12825
  const snapshot = await platformClient.dispatch('get-initial-layout-snapshot');
12830
12826
  await __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f").applyLayoutSnapshot(snapshot);
12831
- if (backCompatLayoutPromise) {
12832
- return backCompatLayoutPromise;
12827
+ if (!options.layoutManagerOverride) {
12828
+ // in single-layout case, we return the undocumented layoutManager type (deprecate with CORE-1081)
12829
+ const layoutIdentity = { layoutName: layout_constants_1.DEFAULT_LAYOUT_KEY, ...this.fin.me.identity };
12830
+ const layoutManager = await this.wire.environment.resolveLayout(__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), layoutIdentity);
12831
+ return Object.assign(this.wrapSync(layoutIdentity), { layoutManager });
12833
12832
  }
12834
12833
  // warn user if they do not call create() in the next 30 seconds
12835
12834
  setTimeout(() => {
@@ -12840,23 +12839,6 @@ class LayoutModule extends base_1$5.Base {
12840
12839
  }, 30000);
12841
12840
  return this.wrapSync(this.fin.me.identity);
12842
12841
  };
12843
- // deprecate with CORE-1081
12844
- _LayoutModule_waitForBackCompatLayoutManager.set(this, async (fin) => {
12845
- let layoutManager;
12846
- let resolve;
12847
- const layoutResolved = new Promise((r) => {
12848
- resolve = r;
12849
- });
12850
- // wait for a layout to be created
12851
- await fin.me.once('layout-ready', async ({ layoutIdentity }) => {
12852
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
12853
- layoutManager = await this.wire.environment.resolveLayout(__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), layoutIdentity);
12854
- // Backward compat - undocumented / not typed openfin-layout as layoutManager
12855
- // TODO: eventually deprecate this
12856
- resolve(Object.assign(this.wrapSync(layoutIdentity), { layoutManager }));
12857
- });
12858
- return layoutResolved;
12859
- });
12860
12842
  /**
12861
12843
  * Returns the layout manager for the current window
12862
12844
  * @returns
@@ -12970,7 +12952,7 @@ class LayoutModule extends base_1$5.Base {
12970
12952
  }
12971
12953
  }
12972
12954
  Factory$2.LayoutModule = LayoutModule;
12973
- _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_waitForBackCompatLayoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_throwIfLayoutManagerNotInitialized = function _LayoutModule_throwIfLayoutManagerNotInitialized(method) {
12955
+ _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_throwIfLayoutManagerNotInitialized = function _LayoutModule_throwIfLayoutManagerNotInitialized(method) {
12974
12956
  if (!__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f")) {
12975
12957
  throw new Error(`You must call init before using the API ${method}`);
12976
12958
  }
@@ -13083,6 +13065,9 @@ class PlatformModule extends base_1$4.Base {
13083
13065
  * @experimental
13084
13066
  */
13085
13067
  async init(options) {
13068
+ if (!fin.__internal_.isPlatform || fin.me.name !== fin.me.uuid) {
13069
+ throw new Error('fin.Platform.init should only be called from a custom platform provider running in the main window of the application.');
13070
+ }
13086
13071
  return this.wire.environment.initPlatform(this.fin, options);
13087
13072
  }
13088
13073
  /**
@@ -16504,8 +16489,8 @@ Factory.SnapshotSourceModule = SnapshotSourceModule;
16504
16489
  __exportStar(Instance, exports);
16505
16490
  } (snapshotSource));
16506
16491
 
16507
- Object.defineProperty(fin, "__esModule", { value: true });
16508
- fin.Fin = void 0;
16492
+ Object.defineProperty(fin$1, "__esModule", { value: true });
16493
+ fin$1.Fin = void 0;
16509
16494
  const events_1$3 = require$$0;
16510
16495
  // Import from the file rather than the directory in case someone consuming types is using module resolution other than "node"
16511
16496
  const index_1 = system$1;
@@ -16551,7 +16536,7 @@ class Fin extends events_1$3.EventEmitter {
16551
16536
  });
16552
16537
  }
16553
16538
  }
16554
- fin.Fin = Fin;
16539
+ fin$1.Fin = Fin;
16555
16540
 
16556
16541
  var wire = {};
16557
16542
 
@@ -17893,7 +17878,7 @@ function requireMain () {
17893
17878
  (function (exports) {
17894
17879
  Object.defineProperty(exports, "__esModule", { value: true });
17895
17880
  exports.ChannelProvider = exports.ChannelClient = exports.Frame = exports.View = exports.System = exports.Window = exports.Application = exports.Fin = exports.launch = exports.connect = void 0;
17896
- const fin_1 = fin;
17881
+ const fin_1 = fin$1;
17897
17882
  Object.defineProperty(exports, "Fin", { enumerable: true, get: function () { return fin_1.Fin; } });
17898
17883
  const index_1 = requireApplication();
17899
17884
  Object.defineProperty(exports, "Application", { enumerable: true, get: function () { return index_1.Application; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/node-adapter",
3
- "version": "34.78.67",
3
+ "version": "34.78.73",
4
4
  "description": "See README.md",
5
5
  "main": "out/node-adapter.js",
6
6
  "types": "out/node-adapter.d.ts",