@overwolf/ow-electron 39.8.10-beta.0 → 39.8.10-beta.2

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/checksums.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "electron-api.json": "d3c769853e7cac1098c3e33b0f5743ad3f890cf5003e738abb27aa7e9157d944",
3
3
  "electron.d.ts": "a332d5d3fafb45e224218d44c5c471d215dca76889956d5f36f59ec0f8716d10",
4
- "ow-electron-v39.8.10-beta.0-darwin-arm64.zip": "469a72f74a0a52de3555391324d4fc6a4cef26d920208603c2502aedcc92a329",
5
- "ow-electron-v39.8.10-beta.0-darwin-x64.zip": "f3e00cf49ca8779bab61917d78c2a5de630e58945753c89a1f1fe5c6a7cc5ad4",
6
- "ow-electron-v39.8.10-beta.0-linux-arm64.zip": "aa90bc87e7f3452831aa4687e71d2bfb0d1c08ffef9533472383dc3d361ae758",
7
- "ow-electron-v39.8.10-beta.0-linux-armv7l.zip": "6e4d0d96b5ed98b9973868b8ea6234a5511cae866f15e586be7003a753b7afcc",
8
- "ow-electron-v39.8.10-beta.0-linux-x64.zip": "16b0450e045a634067303a27896ba38f98f663b5fbdf5e8d6cb181baff249fff",
9
- "ow-electron-v39.8.10-beta.0-win32-arm64.zip": "bff199e35ef75181dd65db2386df20444e876b8adc604d0778099a2baa3dc0b7",
10
- "ow-electron-v39.8.10-beta.0-win32-ia32.zip": "9d5957e472682389b732e611854fba8a189590fd36b04385c045df1085baad8f",
11
- "ow-electron-v39.8.10-beta.0-win32-x64.zip": "2e3601b11bc2c696127cd5ce708b08b8e2d324a5cc9e3b74cac944e23e2784ac"
4
+ "ow-electron-v39.8.10-beta.2-darwin-arm64.zip": "ee6d5aaede2d638b0ff7470d366093ba7cef508b0b69132c756ced97b08753d5",
5
+ "ow-electron-v39.8.10-beta.2-darwin-x64.zip": "166ad42073185540efd628344e5a229e4d9cb18a4ce1cdc0e3f76618f9c6e442",
6
+ "ow-electron-v39.8.10-beta.2-linux-arm64.zip": "b7f255d4e3c6ac67f18aa11a59bc04194ef5ded9c48249053af96ecaf2ed33f3",
7
+ "ow-electron-v39.8.10-beta.2-linux-armv7l.zip": "6e4d0d96b5ed98b9973868b8ea6234a5511cae866f15e586be7003a753b7afcc",
8
+ "ow-electron-v39.8.10-beta.2-linux-x64.zip": "5a1a3474e6718a9629cdeb425da3936a349a484bd40b0df663aa6354c99c45fa",
9
+ "ow-electron-v39.8.10-beta.2-win32-arm64.zip": "bff199e35ef75181dd65db2386df20444e876b8adc604d0778099a2baa3dc0b7",
10
+ "ow-electron-v39.8.10-beta.2-win32-ia32.zip": "9d5957e472682389b732e611854fba8a189590fd36b04385c045df1085baad8f",
11
+ "ow-electron-v39.8.10-beta.2-win32-x64.zip": "cf4fc5d39809dc43ebcae51328716fde8995801585807721b360c97c3d856d6f"
12
12
  }
package/install.js CHANGED
@@ -2,14 +2,15 @@
2
2
 
3
3
  const { downloadArtifact } = require('@electron/get');
4
4
 
5
+ const { owElectronVersion } = require('./package');
5
6
  const extract = require('extract-zip');
6
7
 
7
8
  const childProcess = require('child_process');
8
9
  const fs = require('fs');
9
10
  const os = require('os');
10
11
  const path = require('path');
11
- const { owElectronVersion } = require('./package');
12
- // const { version } = require('./package');
12
+
13
+ const { version } = require('./package');
13
14
 
14
15
  if (process.env.ELECTRON_SKIP_BINARY_DOWNLOAD) {
15
16
  process.exit(0);
@@ -76,16 +77,29 @@ function isInstalled () {
76
77
 
77
78
  // unzips and makes path.txt point at the correct executable
78
79
  function extractFile (zipPath) {
79
- return new Promise((resolve, reject) => {
80
- extract(zipPath, { dir: path.join(__dirname, 'dist') }, err => {
81
- if (err) return reject(err);
80
+ const distPath = process.env.ELECTRON_OVERRIDE_DIST_PATH || path.join(__dirname, 'dist');
81
+
82
+ return extract(zipPath, { dir: path.join(__dirname, 'dist') }).then(() => {
83
+ // If the zip contains an "electron.d.ts" file,
84
+ // move that up
85
+ const srcTypeDefPath = path.join(distPath, 'electron.d.ts');
86
+ const targetTypeDefPath = path.join(__dirname, 'electron.d.ts');
87
+ const hasTypeDefinitions = fs.existsSync(srcTypeDefPath);
82
88
 
83
- fs.writeFile(path.join(__dirname, 'path.txt'), platformPath, err => {
84
- if (err) return reject(err);
89
+ if (hasTypeDefinitions) {
90
+ fs.renameSync(srcTypeDefPath, targetTypeDefPath);
91
+ }
92
+
93
+ const owsrcTypeDefPath = path.join(distPath, 'ow-electron.d.ts');
94
+ const owtargetTypeDefPath = path.join(__dirname, 'ow-electron.d.ts');
95
+ const hasOwTypeDefinitions = fs.existsSync(owsrcTypeDefPath);
96
+
97
+ if (hasOwTypeDefinitions) {
98
+ fs.renameSync(owsrcTypeDefPath, owtargetTypeDefPath);
99
+ }
85
100
 
86
- resolve();
87
- });
88
- });
101
+ // Write a "path.txt" file.
102
+ return fs.promises.writeFile(path.join(__dirname, 'path.txt'), platformPath);
89
103
  });
90
104
  }
91
105
 
package/ow-electron.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  // Type definitions for ow-electron 39.8.10
2
+ // Note: if your project also has the `electron` package installed as a devDependency,
3
+ // add `"skipLibCheck": true` to your tsconfig.json to avoid duplicate module declaration conflicts.
4
+ /// <reference path="./electron.d.ts" />
2
5
  import { App, BrowserWindow, Event } from 'electron';
3
6
  import { errorMonitor } from 'events';
4
7
 
@@ -76,6 +79,16 @@ declare namespace overwolf {
76
79
  * Overwolf installer provided UTM params
77
80
  */
78
81
  readonly utmParams: any;
82
+
83
+ /**
84
+ * @property returns a unique identifier for the user machine
85
+ */
86
+ readonly muid: string;
87
+
88
+ /**
89
+ * @property returns the ow-electron uid (Overwolf App Id)
90
+ */
91
+ readonly uid: string;
79
92
  }
80
93
 
81
94
  interface CMPWindowOptions {
@@ -159,7 +172,7 @@ declare namespace overwolf {
159
172
  /**
160
173
  * A fake enum for all built-in packIge names
161
174
  */
162
- type PackageName = 'gep' | 'overlay' | 'recorder' | 'utility' | string;
175
+ type PackageName = 'gep' | 'overlay' | 'recorder' | 'utility' | 'crn' | string;
163
176
 
164
177
  /**
165
178
  * Package info
@@ -175,7 +188,9 @@ declare namespace overwolf {
175
188
  };
176
189
 
177
190
  /**
178
- * Overwolf Package Manager interface
191
+ * Overwolf Package Manager interface.
192
+ *
193
+ * For package-specific API types, see `@overwolf/ow-electron-packages-types`.
179
194
  */
180
195
  interface OverwolfPackageManager extends NodeJS.EventEmitter {
181
196
  /**
@@ -259,174 +274,9 @@ declare namespace overwolf {
259
274
  readonly logsFolderPath: string;
260
275
 
261
276
  /**
262
- * @property {packages.OverwolfGameEventPackage} gep The Game Events Provider Package Instance
263
- * note: available once 'ready' is fired.
264
- */
265
- readonly gep: packages.OverwolfGameEventPackage;
266
- }
267
-
268
- /**
269
- * Game Events game detection Event
270
- */
271
- export interface GepGameLaunchEvent {
272
- enable: () => void;
273
- }
274
-
275
- /**
276
- * Game Events Package interface
277
- */
278
- interface OverwolfGameEventPackage extends NodeJS.EventEmitter {
279
- /**
280
- * Returns an array of supported Game Event Features for a game
281
- *
282
- * @param {number} gameId Game ID of the targeted game
283
- * @returns {Promise<string[]>} Promise resolving to an array of supported game features
284
- */
285
- getFeatures(gameId: number): Promise<string[]>;
286
-
287
- /**
288
- * Sets the requires Game Event Features for a given game ID
289
- *
290
- * @param {number} gameId Game ID of the targeted game
291
- * @param {string[] | undefined} features Array of required Game Event Features
292
- * @returns {Promise<void>} Promise reporting the success of the operation
293
- */
294
- setRequiredFeatures(
295
- gameId: number,
296
- features: string[] | undefined
297
- ): Promise<void>;
298
-
299
- /**
300
- * Returns an array of Game Events supported games
301
- *
302
- * @returns {Promise<{
303
- * name: string;
304
- * id: number;
305
- * }[]>} Promise resolving to an array of supported games
306
- */
307
- getSupportedGames(): Promise<{
308
- name: string;
309
- id: number;
310
- }[]>;
311
-
312
- /**
313
- * Returns the target game's current Game Info
314
- *
315
- * @param {number} gameId Game ID of the targeted game
316
- * @returns {Promise<any>} Promise resolving to the targeted game's current Game Info
317
- */
318
- getInfo(gameId: number): Promise<any>;
319
-
320
- /**
321
- * Register listener for Game Info Updates
322
- *
323
- * @param {string | symbol} eventName Name of the node event ('new-info-update')
324
- * @param {(Event, any[]) => void} listener The listener that will be invoked when this event is fired
325
- * @returns {this} The current instance of the Overwolf Game Events Package
326
- */
327
- on(
328
- eventName: 'new-info-update',
329
- listener: (event: Event, gameId: number, data: gep.InfoUpdate) => void
330
- ): this;
331
-
332
- /**
333
- * Register listener for New Game Events
334
- *
335
- * @param {string | symbol} eventName Name of the node event ('new-game-event')
336
- * @param {(Event, any[]) => void} listener The listener that will be invoked when this event is fired
337
- * @returns {this} The current instance of the Overwolf Game Events Package
338
- */
339
- on(
340
- eventName: 'new-game-event',
341
- listener: (event: Event, gameId: number, data: gep.GameEvent) => void,
342
- ): this;
343
-
344
- /**
345
- * Register listener for a game being detected.
346
- * Calling `event.enable()` to start gep for this game.
347
- *
348
- * @param {string | symbol} eventName Name of the node event ('game-detected')
349
- * @param {(Event, any[]) => void} listener The listener that will be invoked when this event is fired
350
- * @returns {this} The current instance of the Overwolf Game Events Package
351
- */
352
- on(
353
- eventName: 'game-detected',
354
- listener: (event: GepGameLaunchEvent, gameId: number, name: string, ...args: any[]) => void,
355
- ): this;
356
-
357
- /**
358
- * Register listener for a game exit event.
359
- *
360
- * @param {string | symbol} eventName Name of the node event ('game-exit')
361
- * @param {(Event, any[]) => void} listener The listener that will be invoked when this event is fired
362
- * @returns {this} The current instance of the Overwolf Game Events Package
363
- */
364
- on(
365
- eventName: 'game-exit',
366
- listener: (event: Event, gameId: number, name: string, pid: number) => void,
367
- ): this;
368
-
369
- /**
370
- * Register listener for when a detected game is ran as adminstrator.
371
- * If this fires, it means the app must also run as adminstrator in order for Game Events to be detected.
372
- *
373
- * @param {string | symbol} eventName Name of the node event ('elevated-privileges-required')
374
- * @param {(Event, any[]) => void} listener The listener that will be invoked when this event is fired
375
- * @returns {this} The current instance of the Overwolf Game Events Package
376
- */
377
- on(
378
- eventName: 'elevated-privileges-required',
379
- listener: (event: Event, gameId: number, name: string, pid: number) => void,
380
- ): this;
381
-
382
- /**
383
- * Register listener for errors thrown by the Game Events Provider Package
384
- *
385
- * @param {string | symbol} eventName Name of the node event ('error' or the `errorMonitor` symbol)
386
- * @param {(Event, any[]) => void} listener The listener that will be invoked when this event is fired
387
- * @returns {this} The current instance of the Overwolf Game Events Package
388
- */
389
- on(
390
- eventName: error,
391
- listener: (event: Event, gameId: number, error: string, ...args: any[]) => void,
392
- ): this;
393
- }
394
-
395
- /**
396
- * Namespace for GEP-related interfaces
397
- */
398
- namespace gep {
399
- /**
400
- * Interface defining a Game Event's structure
401
- */
402
- interface GameEvent {
403
- /**
404
- * @property {number} gameId The game id of the game the Event comes from
405
- */
406
- gameId: number;
407
- /**
408
- * @property {string} feature The feature the Event belongs to
409
- */
410
- feature: string;
411
- /**
412
- * @property {string} key The name of the Event
413
- */
414
- key: string;
415
- /**
416
- * @property {any} value The value of the Event
417
- */
418
- value: any;
419
- }
420
-
421
- /**
422
- * Interface defining an Info Update's structure
277
+ * @property returns the ow-electron phase percentage (used by package manager).
423
278
  */
424
- interface InfoUpdate extends GameEvent {
425
- /**
426
- * @property {string} category The category the Info Item belongs to
427
- */
428
- category: string;
429
- }
279
+ readonly phasePercent: number;
430
280
  }
431
281
  }
432
282
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@overwolf/ow-electron",
3
- "version": "39.8.10-beta.0",
4
- "owElectronVersion": "39.8.10-beta.0",
3
+ "version": "39.8.10-beta.2",
4
+ "owElectronVersion": "39.8.10-beta.2",
5
5
  "electronVersion": "39.8.10",
6
6
  "repository": "https://github.com/electron/electron",
7
7
  "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",