@openfin/node-adapter 46.100.40 → 46.100.42

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.
@@ -853,6 +853,33 @@ class WebContents extends EmitterBase {
853
853
  setZoomLevel(level) {
854
854
  return this.wire.sendAction('set-zoom-level', { ...this.identity, level }).then(() => undefined);
855
855
  }
856
+ /**
857
+ * Translates the WebContents from the source language to the target language.
858
+ *
859
+ * Translation requires a translation API key to be configured on the machine. If translation is
860
+ * unavailable, the call is a no-op and a `translation-state-changed` event is emitted describing
861
+ * the failure.
862
+ *
863
+ * @param options Source and target languages for the translation.
864
+ */
865
+ async translatePage(options) {
866
+ await this.wire.sendAction('translate-page', { ...this.identity, ...options });
867
+ }
868
+ /**
869
+ * Reverts a previously translated WebContents back to its original language.
870
+ *
871
+ * If the WebContents is not currently translated, this is a no-op and resolves successfully.
872
+ */
873
+ async revertTranslation() {
874
+ await this.wire.sendAction('revert-translation', this.identity);
875
+ }
876
+ /**
877
+ * Gets the current content-translation state of the WebContents.
878
+ */
879
+ async getTranslationState() {
880
+ const { payload } = await this.wire.sendAction('get-translation-state', this.identity);
881
+ return payload.data;
882
+ }
856
883
  /**
857
884
  * Navigates the WebContents to a specified URL.
858
885
  *
@@ -17006,7 +17033,7 @@ const getRvmLocalPath = () => {
17006
17033
  case 'darwin':
17007
17034
  return path__namespace.resolve(__dirname, '..', 'resources', 'darwin', 'OpenFinRVM.app', 'Contents', 'MacOS', 'OpenFinRVM');
17008
17035
  case 'win32':
17009
- return path__namespace.resolve(__dirname, '..', 'resources', 'win', os__namespace.arch() === 'x64' ? 'x64' : 'x86', 'OpenFinRVM.exe');
17036
+ return path__namespace.resolve(__dirname, '..', 'resources', 'win', 'x64', 'OpenFinRVM.exe');
17010
17037
  default:
17011
17038
  throw new Error(`Unsupported platform: ${process.platform}`);
17012
17039
  }
@@ -17419,7 +17446,7 @@ class NodeEnvironment extends BaseEnvironment {
17419
17446
  };
17420
17447
  }
17421
17448
  getAdapterVersionSync() {
17422
- return "46.100.40";
17449
+ return "46.100.42";
17423
17450
  }
17424
17451
  observeBounds(element, onChange) {
17425
17452
  throw new Error('Method not implemented.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/node-adapter",
3
- "version": "46.100.40",
3
+ "version": "46.100.42",
4
4
  "description": "See README.md",
5
5
  "main": "out/node-adapter.js",
6
6
  "types": "out/node-adapter.d.ts",
@@ -20,7 +20,7 @@
20
20
  "es-toolkit": "^1.39.3",
21
21
  "ws": "^7.5.10",
22
22
  "tslib": "2.8.1",
23
- "@openfin/core": "46.100.40"
23
+ "@openfin/core": "46.100.42"
24
24
  },
25
25
  "scripts": {
26
26
  "prebuild": "rimraf ./out",