@openfin/node-adapter 36.79.3 → 36.79.5

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
 
@@ -11362,7 +11362,7 @@ const validate_1 = validate;
11362
11362
  const base_1$6 = base$1;
11363
11363
  const common_utils_1 = commonUtils;
11364
11364
  const layout_entities_1 = layoutEntities;
11365
- const layout_constants_1 = layout_constants;
11365
+ const layout_constants_1$1 = layout_constants;
11366
11366
  /**
11367
11367
  *
11368
11368
  * Layouts give app providers the ability to embed multiple views in a single window. The Layout namespace
@@ -11507,7 +11507,7 @@ class Layout extends base_1$6.Base {
11507
11507
  * Lazily constructed {@link LayoutEntitiesClient} bound to this platform's client and identity
11508
11508
  * The client is for {@link LayoutEntitiesController}
11509
11509
  */
11510
- _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)));
11510
+ _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)));
11511
11511
  /**
11512
11512
  * Replaces a Platform window's layout with a new layout.
11513
11513
  *
@@ -11735,11 +11735,12 @@ var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
11735
11735
  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");
11736
11736
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11737
11737
  };
11738
- var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_waitForBackCompatLayoutManager, _LayoutModule_getSafeLayoutManager;
11738
+ var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_getSafeLayoutManager;
11739
11739
  Object.defineProperty(Factory$2, "__esModule", { value: true });
11740
11740
  Factory$2.LayoutModule = void 0;
11741
11741
  const base_1$5 = base$1;
11742
11742
  const Instance_1$2 = Instance$1;
11743
+ const layout_constants_1 = layout_constants;
11743
11744
  /**
11744
11745
  * Static namespace for OpenFin API methods that interact with the {@link Layout} class, available under `fin.Platform.Layout`.
11745
11746
  */
@@ -11799,17 +11800,15 @@ class LayoutModule extends base_1$5.Base {
11799
11800
  }
11800
11801
  __classPrivateFieldSet$4(this, _LayoutModule_layoutInitializationAttempted, true, "f");
11801
11802
  __classPrivateFieldSet$4(this, _LayoutModule_layoutManager, await this.wire.environment.initLayoutManager(this.fin, this.wire, options), "f");
11802
- // in single-layout case, we return the undocumented layoutManager type (deprecate with CORE-1081)
11803
- let backCompatLayoutPromise;
11804
- if (!options.layoutManagerOverride) {
11805
- backCompatLayoutPromise = __classPrivateFieldGet$4(this, _LayoutModule_waitForBackCompatLayoutManager, "f").call(this, this.fin);
11806
- }
11807
11803
  // apply the initial snapshot which in turn will call fin.Platform.Layout.create()
11808
11804
  const platformClient = await this.fin.Platform.getCurrentSync().getClient();
11809
11805
  const snapshot = await platformClient.dispatch('get-initial-layout-snapshot');
11810
11806
  await __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f").applyLayoutSnapshot(snapshot);
11811
- if (backCompatLayoutPromise) {
11812
- return backCompatLayoutPromise;
11807
+ if (!options.layoutManagerOverride) {
11808
+ // in single-layout case, we return the undocumented layoutManager type (deprecate with CORE-1081)
11809
+ const layoutIdentity = { layoutName: layout_constants_1.DEFAULT_LAYOUT_KEY, ...this.fin.me.identity };
11810
+ const layoutManager = await this.wire.environment.resolveLayout(__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), layoutIdentity);
11811
+ return Object.assign(this.wrapSync(layoutIdentity), { layoutManager });
11813
11812
  }
11814
11813
  // warn user if they do not call create() in the next 30 seconds
11815
11814
  setTimeout(() => {
@@ -11820,23 +11819,6 @@ class LayoutModule extends base_1$5.Base {
11820
11819
  }, 30000);
11821
11820
  return this.wrapSync(this.fin.me.identity);
11822
11821
  };
11823
- // deprecate with CORE-1081
11824
- _LayoutModule_waitForBackCompatLayoutManager.set(this, async (fin) => {
11825
- let layoutManager;
11826
- let resolve;
11827
- const layoutResolved = new Promise((r) => {
11828
- resolve = r;
11829
- });
11830
- // wait for a layout to be created
11831
- await fin.me.once('layout-ready', async ({ layoutIdentity }) => {
11832
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11833
- layoutManager = await this.wire.environment.resolveLayout(__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), layoutIdentity);
11834
- // Backward compat - undocumented / not typed openfin-layout as layoutManager
11835
- // TODO: eventually deprecate this
11836
- resolve(Object.assign(this.wrapSync(layoutIdentity), { layoutManager }));
11837
- });
11838
- return layoutResolved;
11839
- });
11840
11822
  /**
11841
11823
  * Returns the layout manager for the current window
11842
11824
  * @returns
@@ -11946,7 +11928,7 @@ class LayoutModule extends base_1$5.Base {
11946
11928
  }
11947
11929
  }
11948
11930
  Factory$2.LayoutModule = LayoutModule;
11949
- _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_waitForBackCompatLayoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
11931
+ _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
11950
11932
  if (!__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f")) {
11951
11933
  throw new Error(`You must call init before using the API ${method}`);
11952
11934
  }
@@ -12060,6 +12042,9 @@ class PlatformModule extends base_1$4.Base {
12060
12042
  * @experimental
12061
12043
  */
12062
12044
  async init(options) {
12045
+ if (!fin.__internal_.isPlatform || fin.me.name !== fin.me.uuid) {
12046
+ throw new Error('fin.Platform.init should only be called from a custom platform provider running in the main window of the application.');
12047
+ }
12063
12048
  return this.wire.environment.initPlatform(this.fin, options);
12064
12049
  }
12065
12050
  /**
@@ -15334,8 +15319,8 @@ Factory.SnapshotSourceModule = SnapshotSourceModule;
15334
15319
  __exportStar(Instance, exports);
15335
15320
  } (snapshotSource));
15336
15321
 
15337
- Object.defineProperty(fin, "__esModule", { value: true });
15338
- fin.Fin = void 0;
15322
+ Object.defineProperty(fin$1, "__esModule", { value: true });
15323
+ fin$1.Fin = void 0;
15339
15324
  const events_1$3 = require$$0;
15340
15325
  // Import from the file rather than the directory in case someone consuming types is using module resolution other than "node"
15341
15326
  const index_1 = system$1;
@@ -15381,7 +15366,7 @@ class Fin extends events_1$3.EventEmitter {
15381
15366
  });
15382
15367
  }
15383
15368
  }
15384
- fin.Fin = Fin;
15369
+ fin$1.Fin = Fin;
15385
15370
 
15386
15371
  var wire = {};
15387
15372
 
@@ -16734,7 +16719,7 @@ function requireMain () {
16734
16719
  (function (exports) {
16735
16720
  Object.defineProperty(exports, "__esModule", { value: true });
16736
16721
  exports.ChannelProvider = exports.ChannelClient = exports.Frame = exports.View = exports.System = exports.Window = exports.Application = exports.Fin = exports.launch = exports.connect = void 0;
16737
- const fin_1 = fin;
16722
+ const fin_1 = fin$1;
16738
16723
  Object.defineProperty(exports, "Fin", { enumerable: true, get: function () { return fin_1.Fin; } });
16739
16724
  const index_1 = requireApplication();
16740
16725
  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": "36.79.3",
3
+ "version": "36.79.5",
4
4
  "description": "See README.md",
5
5
  "main": "out/node-adapter.js",
6
6
  "types": "out/node-adapter.d.ts",