@overwolf/ow-electron 39.8.10-beta.0 → 39.8.10-beta.10
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 +8 -8
- package/install.js +24 -10
- package/ow-electron.d.ts +138 -153
- package/package.json +2 -2
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.
|
|
5
|
-
"ow-electron-v39.8.10-beta.
|
|
6
|
-
"ow-electron-v39.8.10-beta.
|
|
7
|
-
"ow-electron-v39.8.10-beta.
|
|
8
|
-
"ow-electron-v39.8.10-beta.
|
|
9
|
-
"ow-electron-v39.8.10-beta.
|
|
10
|
-
"ow-electron-v39.8.10-beta.
|
|
11
|
-
"ow-electron-v39.8.10-beta.
|
|
4
|
+
"ow-electron-v39.8.10-beta.10-darwin-arm64.zip": "ee6d5aaede2d638b0ff7470d366093ba7cef508b0b69132c756ced97b08753d5",
|
|
5
|
+
"ow-electron-v39.8.10-beta.10-darwin-x64.zip": "166ad42073185540efd628344e5a229e4d9cb18a4ce1cdc0e3f76618f9c6e442",
|
|
6
|
+
"ow-electron-v39.8.10-beta.10-linux-arm64.zip": "b7f255d4e3c6ac67f18aa11a59bc04194ef5ded9c48249053af96ecaf2ed33f3",
|
|
7
|
+
"ow-electron-v39.8.10-beta.10-linux-armv7l.zip": "6e4d0d96b5ed98b9973868b8ea6234a5511cae866f15e586be7003a753b7afcc",
|
|
8
|
+
"ow-electron-v39.8.10-beta.10-linux-x64.zip": "5a1a3474e6718a9629cdeb425da3936a349a484bd40b0df663aa6354c99c45fa",
|
|
9
|
+
"ow-electron-v39.8.10-beta.10-win32-arm64.zip": "bff199e35ef75181dd65db2386df20444e876b8adc604d0778099a2baa3dc0b7",
|
|
10
|
+
"ow-electron-v39.8.10-beta.10-win32-ia32.zip": "9d5957e472682389b732e611854fba8a189590fd36b04385c045df1085baad8f",
|
|
11
|
+
"ow-electron-v39.8.10-beta.10-win32-x64.zip": "bea45b586ba3cbfc4253bd7f87f18c73089918d7b98ce23af5ced4a4add324c6"
|
|
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
|
-
|
|
12
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
84
|
-
|
|
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
|
-
|
|
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,42 @@ declare namespace overwolf {
|
|
|
175
188
|
};
|
|
176
189
|
|
|
177
190
|
/**
|
|
178
|
-
*
|
|
191
|
+
* Result returned by `setChannel()`.
|
|
192
|
+
* `error` is `'invalid-package'` when the package is not found on the server,
|
|
193
|
+
* or `'invalid-channel'` when the channel does not exist for that package.
|
|
194
|
+
*/
|
|
195
|
+
type SetChannelResult = {
|
|
196
|
+
success: boolean;
|
|
197
|
+
error?: 'invalid-package' | 'invalid-channel';
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Passed to the `ready` callback of `setChannel()`.
|
|
202
|
+
* Identifies the downloaded package that is pending a restart.
|
|
203
|
+
*/
|
|
204
|
+
interface ChannelPackageInfo {
|
|
205
|
+
name: string;
|
|
206
|
+
version: string;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Returned by `getAvailableChannels()`.
|
|
211
|
+
* Maps each package name to the list of channel names available on the server.
|
|
212
|
+
* Packages with no channels defined return an empty array.
|
|
213
|
+
*/
|
|
214
|
+
type AvailableChannelsResult = Record<string, string[]>;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Returned by `getChannel()`.
|
|
218
|
+
* Maps each package name to its currently active channel.
|
|
219
|
+
* `'public'` means the package is on the default public release.
|
|
220
|
+
*/
|
|
221
|
+
type CurrentChannelsResult = Record<string, string>;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Overwolf Package Manager interface.
|
|
225
|
+
*
|
|
226
|
+
* For package-specific API types, see `@overwolf/ow-electron-packages-types`.
|
|
179
227
|
*/
|
|
180
228
|
interface OverwolfPackageManager extends NodeJS.EventEmitter {
|
|
181
229
|
/**
|
|
@@ -238,6 +286,19 @@ declare namespace overwolf {
|
|
|
238
286
|
listener: (event: Event, packageName: PackageName) => void
|
|
239
287
|
): this;
|
|
240
288
|
|
|
289
|
+
/**
|
|
290
|
+
* Register listener for when an Overwolf Package begins its load sequence.
|
|
291
|
+
* Fires before 'ready'.
|
|
292
|
+
*
|
|
293
|
+
* @param {string} eventName Name of the node event ('loading')
|
|
294
|
+
* @param {(Event, PackageName) => void} listener The listener that will be invoked when this event is fired
|
|
295
|
+
* @returns {this} The current instance of the Overwolf Package Manager
|
|
296
|
+
*/
|
|
297
|
+
on(
|
|
298
|
+
eventName: 'loading',
|
|
299
|
+
listener: (event: Event, packageName: PackageName) => void
|
|
300
|
+
): this;
|
|
301
|
+
|
|
241
302
|
/**
|
|
242
303
|
* Relaunch the Overwolf Package Manager. Call it to force all pending Overwolf Package updates.
|
|
243
304
|
*
|
|
@@ -253,180 +314,104 @@ declare namespace overwolf {
|
|
|
253
314
|
hasPendingUpdates(): PendingUpdatesResult;
|
|
254
315
|
|
|
255
316
|
/**
|
|
256
|
-
*
|
|
317
|
+
* Switches a package to a named release channel and immediately triggers a
|
|
318
|
+
* download of that channel's version.
|
|
257
319
|
*
|
|
258
|
-
*
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
*
|
|
263
|
-
*
|
|
264
|
-
|
|
265
|
-
|
|
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
|
|
320
|
+
* - Channel preferences are persisted in storage and applied on every subsequent
|
|
321
|
+
* update check, including the next app launch.
|
|
322
|
+
* - Pass `undefined`, `null`, an empty string, or `'public'` to restore the
|
|
323
|
+
* default public release.
|
|
324
|
+
* - The optional `ready` callback is invoked with `{ name, version }` once the
|
|
325
|
+
* download completes and the app must restart to apply the new version.
|
|
326
|
+
* - If the package is already at the requested channel version, `ready` never fires.
|
|
327
|
+
* - Throws if `packageName` is not listed in the app's `package.json`
|
|
328
|
+
* `overwolf.packages` array.
|
|
281
329
|
*
|
|
282
|
-
* @param {
|
|
283
|
-
* @
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
* Sets the requires Game Event Features for a given game ID
|
|
330
|
+
* @param {PackageName} packageName The package to switch.
|
|
331
|
+
* @param {string} [channel] Target channel name. Omit or pass `'public'` /
|
|
332
|
+
* empty string to restore the public release.
|
|
333
|
+
* @param {Function} [ready] Invoked when the download completes and a
|
|
334
|
+
* restart is required.
|
|
335
|
+
* @returns {Promise<SetChannelResult>}
|
|
289
336
|
*
|
|
290
|
-
* @
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Returns an array of Game Events supported games
|
|
337
|
+
* @example
|
|
338
|
+
* ```typescript
|
|
339
|
+
* const result = await api.setChannel('overlay', 'pre-release', (pkg) => {
|
|
340
|
+
* console.log(`overlay v${pkg.version} ready - restart required`);
|
|
341
|
+
* api.relaunch();
|
|
342
|
+
* });
|
|
343
|
+
* if (!result.success) console.error('setChannel failed:', result.error);
|
|
344
|
+
* ```
|
|
301
345
|
*
|
|
302
|
-
* @
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
346
|
+
* @example
|
|
347
|
+
* ```typescript
|
|
348
|
+
* // Restore the public release - all four are equivalent
|
|
349
|
+
* await api.setChannel('overlay');
|
|
350
|
+
* await api.setChannel('overlay', undefined);
|
|
351
|
+
* await api.setChannel('overlay', '');
|
|
352
|
+
* await api.setChannel('overlay', 'public');
|
|
353
|
+
* ```
|
|
306
354
|
*/
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
355
|
+
setChannel(
|
|
356
|
+
packageName: PackageName,
|
|
357
|
+
channel?: string | 'public',
|
|
358
|
+
ready?: (packageInfo: ChannelPackageInfo) => void
|
|
359
|
+
): Promise<SetChannelResult>;
|
|
311
360
|
|
|
312
361
|
/**
|
|
313
|
-
* Returns the
|
|
362
|
+
* Returns the list of release channels available on the server for one or more packages.
|
|
314
363
|
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* Register listener for Game Info Updates
|
|
364
|
+
* - Pass no arguments to query all packages registered in the app's `overwolf.packages` list.
|
|
365
|
+
* - Pass one or more package names to query a specific subset.
|
|
366
|
+
* - Packages with no channels defined return an empty array `[]`.
|
|
367
|
+
* - Throws if any supplied name is not in the registered packages list.
|
|
322
368
|
*
|
|
323
|
-
* @param {
|
|
324
|
-
* @
|
|
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
|
|
369
|
+
* @param {...PackageName} packageNames Optional package names to query.
|
|
370
|
+
* @returns {Promise<AvailableChannelsResult>}
|
|
334
371
|
*
|
|
335
|
-
* @
|
|
336
|
-
*
|
|
337
|
-
*
|
|
372
|
+
* @example
|
|
373
|
+
* ```typescript
|
|
374
|
+
* const channels = await api.getAvailableChannels();
|
|
375
|
+
* // { overlay: ['pre-release', 'beta'], gep: ['pre-release'], utility: [] }
|
|
376
|
+
*
|
|
377
|
+
* const { overlay } = await api.getAvailableChannels('overlay');
|
|
378
|
+
* // overlay: ['pre-release', 'beta']
|
|
379
|
+
* ```
|
|
338
380
|
*/
|
|
339
|
-
|
|
340
|
-
eventName: 'new-game-event',
|
|
341
|
-
listener: (event: Event, gameId: number, data: gep.GameEvent) => void,
|
|
342
|
-
): this;
|
|
381
|
+
getAvailableChannels(...packageNames: PackageName[]): Promise<AvailableChannelsResult>;
|
|
343
382
|
|
|
344
383
|
/**
|
|
345
|
-
*
|
|
346
|
-
* Calling `event.enable()` to start gep for this game.
|
|
384
|
+
* Returns the currently active release channel for one or more packages.
|
|
347
385
|
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
*
|
|
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.
|
|
386
|
+
* - `'public'` means the package is on the default public release.
|
|
387
|
+
* - Pass no arguments to query all registered packages (plus any package with a
|
|
388
|
+
* non-public channel stored, even if not in `package.json`).
|
|
389
|
+
* - Unknown package names are silently omitted from the result (no error thrown).
|
|
359
390
|
*
|
|
360
|
-
* @param {
|
|
361
|
-
* @
|
|
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.
|
|
391
|
+
* @param {...PackageName} packageNames Optional package names to query.
|
|
392
|
+
* @returns {Promise<CurrentChannelsResult>}
|
|
372
393
|
*
|
|
373
|
-
* @
|
|
374
|
-
*
|
|
375
|
-
*
|
|
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
|
|
394
|
+
* @example
|
|
395
|
+
* ```typescript
|
|
396
|
+
* const current = await api.getChannel();
|
|
397
|
+
* // { overlay: 'pre-release', gep: 'public', utility: 'public' }
|
|
384
398
|
*
|
|
385
|
-
*
|
|
386
|
-
*
|
|
387
|
-
*
|
|
399
|
+
* const { overlay } = await api.getChannel('overlay');
|
|
400
|
+
* // 'pre-release'
|
|
401
|
+
* ```
|
|
388
402
|
*/
|
|
389
|
-
|
|
390
|
-
eventName: error,
|
|
391
|
-
listener: (event: Event, gameId: number, error: string, ...args: any[]) => void,
|
|
392
|
-
): this;
|
|
393
|
-
}
|
|
403
|
+
getChannel(...packageNames: PackageName[]): Promise<CurrentChannelsResult>;
|
|
394
404
|
|
|
395
|
-
/**
|
|
396
|
-
* Namespace for GEP-related interfaces
|
|
397
|
-
*/
|
|
398
|
-
namespace gep {
|
|
399
405
|
/**
|
|
400
|
-
*
|
|
401
|
-
|
|
402
|
-
|
|
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
|
-
}
|
|
406
|
+
* @property returns the path to the application's logs folder.
|
|
407
|
+
*
|
|
408
|
+
* */
|
|
409
|
+
readonly logsFolderPath: string;
|
|
420
410
|
|
|
421
411
|
/**
|
|
422
|
-
*
|
|
412
|
+
* @property returns the ow-electron phase percentage (used by package manager).
|
|
423
413
|
*/
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* @property {string} category The category the Info Item belongs to
|
|
427
|
-
*/
|
|
428
|
-
category: string;
|
|
429
|
-
}
|
|
414
|
+
readonly phasePercent: number;
|
|
430
415
|
}
|
|
431
416
|
}
|
|
432
417
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@overwolf/ow-electron",
|
|
3
|
-
"version": "39.8.10-beta.
|
|
4
|
-
"owElectronVersion": "39.8.10-beta.
|
|
3
|
+
"version": "39.8.10-beta.10",
|
|
4
|
+
"owElectronVersion": "39.8.10-beta.10",
|
|
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",
|