@openfin/node-adapter 36.78.18 → 36.78.19

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 +30 -20
  2. package/package.json +1 -1
@@ -11735,7 +11735,7 @@ 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_getBackCompatLayoutManager, _LayoutModule_getSafeLayoutManager;
11738
+ var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_waitForBackCompatLayoutManager, _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;
@@ -11799,12 +11799,17 @@ class LayoutModule extends base_1$5.Base {
11799
11799
  }
11800
11800
  __classPrivateFieldSet$4(this, _LayoutModule_layoutInitializationAttempted, true, "f");
11801
11801
  __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
+ }
11802
11807
  // apply the initial snapshot which in turn will call fin.Platform.Layout.create()
11803
11808
  const platformClient = await this.fin.Platform.getCurrentSync().getClient();
11804
11809
  const snapshot = await platformClient.dispatch('get-initial-layout-snapshot');
11805
11810
  await __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f").applyLayoutSnapshot(snapshot);
11806
- if (!options.layoutManagerOverride) {
11807
- return __classPrivateFieldGet$4(this, _LayoutModule_getBackCompatLayoutManager, "f").call(this, this.fin);
11811
+ if (backCompatLayoutPromise) {
11812
+ return backCompatLayoutPromise;
11808
11813
  }
11809
11814
  // warn user if they do not call create() in the next 30 seconds
11810
11815
  setTimeout(() => {
@@ -11815,7 +11820,8 @@ class LayoutModule extends base_1$5.Base {
11815
11820
  }, 30000);
11816
11821
  return this.wrapSync(this.fin.me.identity);
11817
11822
  };
11818
- _LayoutModule_getBackCompatLayoutManager.set(this, async (fin) => {
11823
+ // deprecate with CORE-1081
11824
+ _LayoutModule_waitForBackCompatLayoutManager.set(this, async (fin) => {
11819
11825
  let layoutManager;
11820
11826
  let resolve;
11821
11827
  const layoutResolved = new Promise((r) => {
@@ -11940,7 +11946,7 @@ class LayoutModule extends base_1$5.Base {
11940
11946
  }
11941
11947
  }
11942
11948
  Factory$2.LayoutModule = LayoutModule;
11943
- _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_getBackCompatLayoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
11949
+ _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_waitForBackCompatLayoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
11944
11950
  if (!__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f")) {
11945
11951
  throw new Error(`You must call init before using the API ${method}`);
11946
11952
  }
@@ -14868,29 +14874,33 @@ function requireOverrideCheck () {
14868
14874
  if (hasRequiredOverrideCheck) return overrideCheck;
14869
14875
  hasRequiredOverrideCheck = 1;
14870
14876
  Object.defineProperty(overrideCheck, "__esModule", { value: true });
14871
- overrideCheck.overrideCheck = overrideCheck.getDefaultViewFdc3VersionFromAppInfo = void 0;
14877
+ overrideCheck.overrideCheck = overrideCheck.checkFDC32Overrides = overrideCheck.getDefaultViewFdc3VersionFromAppInfo = void 0;
14872
14878
  const InteropBroker_1 = requireInteropBroker();
14873
14879
  function getDefaultViewFdc3VersionFromAppInfo({ manifest, initialOptions }) {
14874
14880
  const setVersion = manifest.platform?.defaultViewOptions?.fdc3InteropApi ?? initialOptions.defaultViewOptions?.fdc3InteropApi;
14875
14881
  return ['1.2', '2.0'].includes(setVersion ?? '') ? setVersion : undefined;
14876
14882
  }
14877
14883
  overrideCheck.getDefaultViewFdc3VersionFromAppInfo = getDefaultViewFdc3VersionFromAppInfo;
14878
- // TODO: Unit test this
14884
+ function checkFDC32Overrides(overriddenBroker) {
14885
+ // These are the APIs that must be overridden for FDC3 2.0 compliance
14886
+ const mustOverrideAPIs = [
14887
+ 'fdc3HandleFindInstances',
14888
+ 'handleInfoForIntent',
14889
+ 'handleInfoForIntentsByContext',
14890
+ 'fdc3HandleGetAppMetadata',
14891
+ 'fdc3HandleGetInfo',
14892
+ 'fdc3HandleOpen',
14893
+ 'handleFiredIntent',
14894
+ 'handleFiredIntentForContext'
14895
+ ];
14896
+ return mustOverrideAPIs.filter((api) => {
14897
+ return overriddenBroker[api] === InteropBroker_1.InteropBroker.prototype[api];
14898
+ });
14899
+ }
14900
+ overrideCheck.checkFDC32Overrides = checkFDC32Overrides;
14879
14901
  function overrideCheck$1(overriddenBroker, fdc3InteropApi) {
14880
14902
  if (fdc3InteropApi && fdc3InteropApi === '2.0') {
14881
- const mustOverrideAPIs = [
14882
- 'fdc3HandleFindInstances',
14883
- 'handleInfoForIntent',
14884
- 'handleInfoForIntentsByContext',
14885
- 'fdc3HandleGetAppMetadata',
14886
- 'fdc3HandleGetInfo',
14887
- 'fdc3HandleOpen',
14888
- 'handleFiredIntent',
14889
- 'handleFiredIntentForContext'
14890
- ];
14891
- const notOverridden = mustOverrideAPIs.filter((api) => {
14892
- return overriddenBroker[api] === InteropBroker_1.InteropBroker.prototype[api];
14893
- });
14903
+ const notOverridden = checkFDC32Overrides(overriddenBroker);
14894
14904
  if (notOverridden.length > 0) {
14895
14905
  console.warn(`WARNING: FDC3 2.0 has been set as a default option for Views in this Platform, but the required InteropBroker APIs for FDC3 2.0 compliance have not all been overridden.\nThe following APIs need to be overridden:\n${notOverridden.join('\n')}`);
14896
14906
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/node-adapter",
3
- "version": "36.78.18",
3
+ "version": "36.78.19",
4
4
  "description": "See README.md",
5
5
  "main": "out/node-adapter.js",
6
6
  "types": "out/node-adapter.d.ts",