@overwolf/ow-electron 34.5.7 → 37.2.6-beta.0

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.
package/ow-electron.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for ow-electron 34.5.7
1
+ // Type definitions for ow-electron 37.2.6
2
2
 
3
3
  import { App, BrowserWindow, Event, WebviewTag } from 'electron';
4
4
  import { errorMonitor } from 'events';
@@ -66,7 +66,7 @@ declare namespace overwolf {
66
66
  * See https://www.chromium.org/developers/design-documents/accessibility for more
67
67
  * details how to normalize email before creating hash
68
68
  */
69
- setUserEmailHashes(emailHashes: EmailHashes): void;
69
+ setUserEmailHashes(emailHashes?: EmailHashes): void;
70
70
 
71
71
  /**
72
72
  * Client persistence phasing precent
@@ -143,9 +143,9 @@ declare namespace overwolf {
143
143
  }
144
144
 
145
145
  interface EmailHashes {
146
- readonly sha1: string;
147
- readonly sha256: string;
148
- readonly md5: string;
146
+ readonly sha1?: string;
147
+ readonly sha256?: string;
148
+ readonly md5?: string;
149
149
  }
150
150
 
151
151
  /**
@@ -354,7 +354,7 @@ declare namespace overwolf {
354
354
  eventName: 'game-detected',
355
355
  listener: (event: GepGameLaunchEvent, gameId: number, name: string, ...args: any[]) => void,
356
356
  ): this;
357
-
357
+
358
358
  /**
359
359
  * Register listener for a game exit event.
360
360
  *
@@ -364,12 +364,12 @@ declare namespace overwolf {
364
364
  */
365
365
  on(
366
366
  eventName: 'game-exit',
367
- listener: (event: Event, gameId: number, gameName: string, pid: number, processName: string, processPath: string, commandLine: string) => void,
367
+ listener: (event: Event, gameId: number, name: string, pid: number) => void,
368
368
  ): this;
369
369
 
370
370
  /**
371
- * Register listener for when a detected game is ran as administrator.
372
- * If this fires, it means the app must also run as administrator in order for Game Events to be detected.
371
+ * Register listener for when a detected game is ran as adminstrator.
372
+ * If this fires, it means the app must also run as adminstrator in order for Game Events to be detected.
373
373
  *
374
374
  * @param {string | symbol} eventName Name of the node event ('elevated-privileges-required')
375
375
  * @param {(Event, any[]) => void} listener The listener that will be invoked when this event is fired
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@overwolf/ow-electron",
3
- "version": "34.5.7",
4
- "owElectronVersion": "34.5.7",
5
- "electronVersion": "34.5.7",
3
+ "version": "37.2.6-beta.0",
4
+ "owElectronVersion": "37.2.6-beta.0",
5
+ "electronVersion": "37.2.6",
6
6
  "repository": "https://github.com/electron/electron",
7
7
  "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
8
8
  "license": "MIT",
@@ -26,5 +26,8 @@
26
26
  },
27
27
  "engines": {
28
28
  "node": ">= 10.17.0"
29
+ },
30
+ "publishConfig": {
31
+ "tag": "beta"
29
32
  }
30
33
  }
@@ -1,72 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const crypto = require('crypto');
4
-
5
- function calculateFileHash(filePath) {
6
- return new Promise((resolve, reject) => {
7
- const hash = crypto.createHash('sha256');
8
- const stream = fs.createReadStream(filePath);
9
-
10
- stream.on('error', err => reject(err));
11
- stream.on('data', chunk => hash.update(chunk));
12
- stream.on('end', () => resolve(hash.digest('hex')));
13
- });
14
- }
15
-
16
- async function validateChecksums(folderPath) {
17
- try {
18
- // Read checksums.json from current directory
19
- const checksumPath = path.join(process.cwd(), 'checksums.json');
20
- const checksums = JSON.parse(fs.readFileSync(checksumPath, 'utf8'));
21
- let hasUpdates = false;
22
-
23
- // Check each file
24
- for (const [fileName, expectedHash] of Object.entries(checksums)) {
25
- const filePath = path.join(folderPath, fileName);
26
-
27
- if (fs.existsSync(filePath)) {
28
- const actualHash = await calculateFileHash(filePath);
29
- const matches = actualHash === expectedHash;
30
- if (!matches) {
31
- console.log(`Actual hash: ${actualHash}`);
32
- console.log(`File: ${fileName}`);
33
- console.log(`Expected hash: ${expectedHash}`);
34
- console.log(`Match: ${matches}`);
35
- // Update checksums.json if hashes don't match
36
- console.log('Updating checksums.json with new hash...');
37
- checksums[fileName] = actualHash;
38
- hasUpdates = true;
39
- } else {
40
- console.log(`File: ${fileName} match`);
41
- }
42
- } else {
43
- console.log(`File: ${fileName} not found in specified directory`);
44
- }
45
- }
46
-
47
- // Write updated checksums back to file if there were any changes
48
- if (hasUpdates) {
49
- fs.writeFileSync(
50
- checksumPath,
51
- JSON.stringify(checksums, null, 2), // Pretty print with 2 spaces
52
- 'utf8'
53
- );
54
- console.log('\nChecksums.json has been updated with new hashes.');
55
- } else {
56
- console.log('\nNo updates were necessary.');
57
- }
58
-
59
- } catch (error) {
60
- console.error('Error:', error.message);
61
- }
62
- }
63
-
64
- // Check if folder path is provided as command line argument
65
- const folderPath = process.argv[2];
66
- if (!folderPath) {
67
- console.error('Please provide a folder path as an argument');
68
- console.error('Usage: node checksum-validator.js <folder-path>');
69
- process.exit(1);
70
- }
71
-
72
- validateChecksums(folderPath);