@openfin/node-adapter 34.78.69 → 34.78.74

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.
@@ -5093,6 +5093,7 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
5093
5093
 
5094
5094
  declare interface Environment {
5095
5095
  initLayoutManager(fin: OpenFin.Fin<OpenFin.EntityType>, wire: Transport, options: OpenFin.InitLayoutOptions): Promise<OpenFin.LayoutManager<OpenFin.LayoutSnapshot>>;
5096
+ applyLayoutSnapshot(fin: OpenFin.Fin<OpenFin.EntityType>, layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.InitLayoutOptions): Promise<void>;
5096
5097
  createLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.CreateLayoutOptions): Promise<void>;
5097
5098
  destroyLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<void>;
5098
5099
  resolveLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<any>;
@@ -8873,16 +8874,17 @@ declare type LayoutIdentity = Identity_5 & {
8873
8874
  };
8874
8875
 
8875
8876
  /**
8876
- * Generated when the window is created, and all of its layout's views have either finished or failed
8877
- * navigation, once per layout. Does not emit for any layouts added via Layout.create() call.
8877
+ * Generated after a layout is created and all of its views have either finished or failed navigation
8878
+ * once per layout. Does not emit for layouts created using Layout.replace() API.
8878
8879
  * @interface
8879
8880
  */
8880
8881
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8881
8882
  type: 'layout-initialized';
8882
8883
  layoutIdentity: OpenFin.LayoutIdentity;
8883
- ofViews: (OpenFin.Identity & {
8884
+ ofViews: {
8885
+ identity: OpenFin.Identity;
8884
8886
  entityType: 'view';
8885
- })[];
8887
+ }[];
8886
8888
  };
8887
8889
 
8888
8890
  /**
@@ -9250,9 +9252,11 @@ declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
9250
9252
  declare type LayoutReadyEvent = BaseEvent_5 & {
9251
9253
  type: 'layout-ready';
9252
9254
  layoutIdentity: OpenFin.LayoutIdentity;
9253
- views: (OpenFin.Identity & {
9255
+ views: {
9256
+ identity: OpenFin.Identity;
9254
9257
  success: boolean;
9255
- })[];
9258
+ error?: Error;
9259
+ }[];
9256
9260
  };
9257
9261
 
9258
9262
  /**
@@ -5093,6 +5093,7 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
5093
5093
 
5094
5094
  declare interface Environment {
5095
5095
  initLayoutManager(fin: OpenFin.Fin<OpenFin.EntityType>, wire: Transport, options: OpenFin.InitLayoutOptions): Promise<OpenFin.LayoutManager<OpenFin.LayoutSnapshot>>;
5096
+ applyLayoutSnapshot(fin: OpenFin.Fin<OpenFin.EntityType>, layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.InitLayoutOptions): Promise<void>;
5096
5097
  createLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.CreateLayoutOptions): Promise<void>;
5097
5098
  destroyLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<void>;
5098
5099
  resolveLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<any>;
@@ -8873,16 +8874,17 @@ declare type LayoutIdentity = Identity_5 & {
8873
8874
  };
8874
8875
 
8875
8876
  /**
8876
- * Generated when the window is created, and all of its layout's views have either finished or failed
8877
- * navigation, once per layout. Does not emit for any layouts added via Layout.create() call.
8877
+ * Generated after a layout is created and all of its views have either finished or failed navigation
8878
+ * once per layout. Does not emit for layouts created using Layout.replace() API.
8878
8879
  * @interface
8879
8880
  */
8880
8881
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8881
8882
  type: 'layout-initialized';
8882
8883
  layoutIdentity: OpenFin.LayoutIdentity;
8883
- ofViews: (OpenFin.Identity & {
8884
+ ofViews: {
8885
+ identity: OpenFin.Identity;
8884
8886
  entityType: 'view';
8885
- })[];
8887
+ }[];
8886
8888
  };
8887
8889
 
8888
8890
  /**
@@ -9250,9 +9252,11 @@ declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
9250
9252
  declare type LayoutReadyEvent = BaseEvent_5 & {
9251
9253
  type: 'layout-ready';
9252
9254
  layoutIdentity: OpenFin.LayoutIdentity;
9253
- views: (OpenFin.Identity & {
9255
+ views: {
9256
+ identity: OpenFin.Identity;
9254
9257
  success: boolean;
9255
- })[];
9258
+ error?: Error;
9259
+ }[];
9256
9260
  };
9257
9261
 
9258
9262
  /**
@@ -5093,6 +5093,7 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
5093
5093
 
5094
5094
  declare interface Environment {
5095
5095
  initLayoutManager(fin: OpenFin.Fin<OpenFin.EntityType>, wire: Transport, options: OpenFin.InitLayoutOptions): Promise<OpenFin.LayoutManager<OpenFin.LayoutSnapshot>>;
5096
+ applyLayoutSnapshot(fin: OpenFin.Fin<OpenFin.EntityType>, layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.InitLayoutOptions): Promise<void>;
5096
5097
  createLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.CreateLayoutOptions): Promise<void>;
5097
5098
  destroyLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<void>;
5098
5099
  resolveLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<any>;
@@ -8873,16 +8874,17 @@ declare type LayoutIdentity = Identity_5 & {
8873
8874
  };
8874
8875
 
8875
8876
  /**
8876
- * Generated when the window is created, and all of its layout's views have either finished or failed
8877
- * navigation, once per layout. Does not emit for any layouts added via Layout.create() call.
8877
+ * Generated after a layout is created and all of its views have either finished or failed navigation
8878
+ * once per layout. Does not emit for layouts created using Layout.replace() API.
8878
8879
  * @interface
8879
8880
  */
8880
8881
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8881
8882
  type: 'layout-initialized';
8882
8883
  layoutIdentity: OpenFin.LayoutIdentity;
8883
- ofViews: (OpenFin.Identity & {
8884
+ ofViews: {
8885
+ identity: OpenFin.Identity;
8884
8886
  entityType: 'view';
8885
- })[];
8887
+ }[];
8886
8888
  };
8887
8889
 
8888
8890
  /**
@@ -9250,9 +9252,11 @@ declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
9250
9252
  declare type LayoutReadyEvent = BaseEvent_5 & {
9251
9253
  type: 'layout-ready';
9252
9254
  layoutIdentity: OpenFin.LayoutIdentity;
9253
- views: (OpenFin.Identity & {
9255
+ views: {
9256
+ identity: OpenFin.Identity;
9254
9257
  success: boolean;
9255
- })[];
9258
+ error?: Error;
9259
+ }[];
9256
9260
  };
9257
9261
 
9258
9262
  /**
@@ -5141,6 +5141,7 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
5141
5141
 
5142
5142
  declare interface Environment {
5143
5143
  initLayoutManager(fin: OpenFin.Fin<OpenFin.EntityType>, wire: Transport, options: OpenFin.InitLayoutOptions): Promise<OpenFin.LayoutManager<OpenFin.LayoutSnapshot>>;
5144
+ applyLayoutSnapshot(fin: OpenFin.Fin<OpenFin.EntityType>, layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.InitLayoutOptions): Promise<void>;
5144
5145
  createLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.CreateLayoutOptions): Promise<void>;
5145
5146
  destroyLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<void>;
5146
5147
  resolveLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<any>;
@@ -9002,16 +9003,17 @@ declare type LayoutIdentity = Identity_5 & {
9002
9003
  };
9003
9004
 
9004
9005
  /**
9005
- * Generated when the window is created, and all of its layout's views have either finished or failed
9006
- * navigation, once per layout. Does not emit for any layouts added via Layout.create() call.
9006
+ * Generated after a layout is created and all of its views have either finished or failed navigation
9007
+ * once per layout. Does not emit for layouts created using Layout.replace() API.
9007
9008
  * @interface
9008
9009
  */
9009
9010
  declare type LayoutInitializedEvent = BaseEvent_5 & {
9010
9011
  type: 'layout-initialized';
9011
9012
  layoutIdentity: OpenFin.LayoutIdentity;
9012
- ofViews: (OpenFin.Identity & {
9013
+ ofViews: {
9014
+ identity: OpenFin.Identity;
9013
9015
  entityType: 'view';
9014
- })[];
9016
+ }[];
9015
9017
  };
9016
9018
 
9017
9019
  /**
@@ -9549,9 +9551,11 @@ declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
9549
9551
  declare type LayoutReadyEvent = BaseEvent_5 & {
9550
9552
  type: 'layout-ready';
9551
9553
  layoutIdentity: OpenFin.LayoutIdentity;
9552
- views: (OpenFin.Identity & {
9554
+ views: {
9555
+ identity: OpenFin.Identity;
9553
9556
  success: boolean;
9554
- })[];
9557
+ error?: Error;
9558
+ }[];
9555
9559
  };
9556
9560
 
9557
9561
  /**
@@ -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
 
@@ -12819,24 +12819,16 @@ class LayoutModule extends base_1$5.Base {
12819
12819
  throw new Error('Layout.init was already called, please use Layout.create to add additional layouts.');
12820
12820
  }
12821
12821
  __classPrivateFieldSet$4(this, _LayoutModule_layoutInitializationAttempted, true, "f");
12822
+ // preload the client
12823
+ await this.fin.Platform.getCurrentSync().getClient();
12822
12824
  __classPrivateFieldSet$4(this, _LayoutModule_layoutManager, await this.wire.environment.initLayoutManager(this.fin, this.wire, options), "f");
12823
- // apply the initial snapshot which in turn will call fin.Platform.Layout.create()
12824
- const platformClient = await this.fin.Platform.getCurrentSync().getClient();
12825
- const snapshot = await platformClient.dispatch('get-initial-layout-snapshot');
12826
- await __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f").applyLayoutSnapshot(snapshot);
12825
+ await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), options);
12827
12826
  if (!options.layoutManagerOverride) {
12828
12827
  // in single-layout case, we return the undocumented layoutManager type (deprecate with CORE-1081)
12829
12828
  const layoutIdentity = { layoutName: layout_constants_1.DEFAULT_LAYOUT_KEY, ...this.fin.me.identity };
12830
12829
  const layoutManager = await this.wire.environment.resolveLayout(__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), layoutIdentity);
12831
12830
  return Object.assign(this.wrapSync(layoutIdentity), { layoutManager });
12832
12831
  }
12833
- // warn user if they do not call create() in the next 30 seconds
12834
- setTimeout(() => {
12835
- if (__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f").size() === 0) {
12836
- console.warn(`[Layout.init] Layout.init was called 30s ago, but no layouts have been created yet. Make sure you ` +
12837
- `override LayoutManager.applyLayoutSnapshot, and then call fin.Platform.Layout.create()`);
12838
- }
12839
- }, 30000);
12840
12832
  return this.wrapSync(this.fin.me.identity);
12841
12833
  };
12842
12834
  /**
@@ -13065,6 +13057,9 @@ class PlatformModule extends base_1$4.Base {
13065
13057
  * @experimental
13066
13058
  */
13067
13059
  async init(options) {
13060
+ if (!fin.__internal_.isPlatform || fin.me.name !== fin.me.uuid) {
13061
+ throw new Error('fin.Platform.init should only be called from a custom platform provider running in the main window of the application.');
13062
+ }
13068
13063
  return this.wire.environment.initPlatform(this.fin, options);
13069
13064
  }
13070
13065
  /**
@@ -16486,8 +16481,8 @@ Factory.SnapshotSourceModule = SnapshotSourceModule;
16486
16481
  __exportStar(Instance, exports);
16487
16482
  } (snapshotSource));
16488
16483
 
16489
- Object.defineProperty(fin, "__esModule", { value: true });
16490
- fin.Fin = void 0;
16484
+ Object.defineProperty(fin$1, "__esModule", { value: true });
16485
+ fin$1.Fin = void 0;
16491
16486
  const events_1$3 = require$$0;
16492
16487
  // Import from the file rather than the directory in case someone consuming types is using module resolution other than "node"
16493
16488
  const index_1 = system$1;
@@ -16533,7 +16528,7 @@ class Fin extends events_1$3.EventEmitter {
16533
16528
  });
16534
16529
  }
16535
16530
  }
16536
- fin.Fin = Fin;
16531
+ fin$1.Fin = Fin;
16537
16532
 
16538
16533
  var wire = {};
16539
16534
 
@@ -17409,6 +17404,9 @@ function requireNodeEnv () {
17409
17404
  async initLayoutManager() {
17410
17405
  throw new Error('Method not implemented.');
17411
17406
  }
17407
+ async applyLayoutSnapshot() {
17408
+ throw new Error('Method not implemented.');
17409
+ }
17412
17410
  async createLayout() {
17413
17411
  throw new Error('Method not implemented.');
17414
17412
  }
@@ -17875,7 +17873,7 @@ function requireMain () {
17875
17873
  (function (exports) {
17876
17874
  Object.defineProperty(exports, "__esModule", { value: true });
17877
17875
  exports.ChannelProvider = exports.ChannelClient = exports.Frame = exports.View = exports.System = exports.Window = exports.Application = exports.Fin = exports.launch = exports.connect = void 0;
17878
- const fin_1 = fin;
17876
+ const fin_1 = fin$1;
17879
17877
  Object.defineProperty(exports, "Fin", { enumerable: true, get: function () { return fin_1.Fin; } });
17880
17878
  const index_1 = requireApplication();
17881
17879
  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.69",
3
+ "version": "34.78.74",
4
4
  "description": "See README.md",
5
5
  "main": "out/node-adapter.js",
6
6
  "types": "out/node-adapter.d.ts",