@overwolf/ow-electron 34.5.8-beta.0 → 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.8
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
  /**
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@overwolf/ow-electron",
3
- "version": "34.5.8-beta.0",
4
- "owElectronVersion": "34.5.8-beta.0",
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",
@@ -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);