worldstate-emitter 2.2.10 → 2.2.12
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/.mocharc.yml +1 -1
- package/.releaserc.yml +1 -0
- package/handlers/Worldstate.js +4 -6
- package/index.js +6 -7
- package/nodemon.json +2 -1
- package/package.json +10 -10
- package/resources/config.js +7 -6
package/.mocharc.yml
CHANGED
package/.releaserc.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
branches: master
|
package/handlers/Worldstate.js
CHANGED
|
@@ -3,14 +3,12 @@ import wsData from 'warframe-worldstate-data';
|
|
|
3
3
|
import WSCache from '../utilities/WSCache.js';
|
|
4
4
|
import { logger, lastUpdated } from '../utilities/index.js';
|
|
5
5
|
import Cache from '../utilities/Cache.js';
|
|
6
|
-
import {
|
|
6
|
+
import { sentientUrl, kuvaUrl, worldstateUrl, externalCron, worldstateCron } from '../resources/config.js';
|
|
7
7
|
|
|
8
8
|
import parseNew from './events/parse.js';
|
|
9
9
|
|
|
10
10
|
const { locales } = wsData;
|
|
11
|
-
|
|
12
11
|
const debugEvents = ['arbitration', 'kuva', 'nightwave'];
|
|
13
|
-
const smCron = `0 */10 * * * *`;
|
|
14
12
|
|
|
15
13
|
/**
|
|
16
14
|
* Handler for worldstate data
|
|
@@ -38,9 +36,9 @@ export default class Worldstate {
|
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
async init() {
|
|
41
|
-
this.#wsRawCache = await Cache.make(
|
|
42
|
-
this.#kuvaCache = await Cache.make(
|
|
43
|
-
this.#sentientCache = await Cache.make(
|
|
39
|
+
this.#wsRawCache = await Cache.make(worldstateUrl, worldstateCron);
|
|
40
|
+
this.#kuvaCache = await Cache.make(kuvaUrl, externalCron);
|
|
41
|
+
this.#sentientCache = await Cache.make(sentientUrl, externalCron);
|
|
44
42
|
|
|
45
43
|
await this.setUpRawEmitters();
|
|
46
44
|
this.setupParsedEvents();
|
package/index.js
CHANGED
|
@@ -12,9 +12,9 @@ export default class WorldstateEmitter extends EventEmitter {
|
|
|
12
12
|
#twitter;
|
|
13
13
|
#rss;
|
|
14
14
|
|
|
15
|
-
static async make({ locale } = { locale: undefined }) {
|
|
15
|
+
static async make({ locale, features } = { locale: undefined, features: [] }) {
|
|
16
16
|
const emitter = new WorldstateEmitter({ locale });
|
|
17
|
-
await emitter.#init();
|
|
17
|
+
await emitter.#init(features?.length ? features : FEATURES);
|
|
18
18
|
return emitter;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -24,19 +24,18 @@ export default class WorldstateEmitter extends EventEmitter {
|
|
|
24
24
|
*/
|
|
25
25
|
constructor({ locale } = { locale: undefined }) {
|
|
26
26
|
super();
|
|
27
|
-
|
|
28
27
|
this.#locale = locale;
|
|
29
28
|
}
|
|
30
29
|
|
|
31
|
-
async #init() {
|
|
32
|
-
if (
|
|
30
|
+
async #init(/** @type {string[]} */ features) {
|
|
31
|
+
if (features.includes('rss')) {
|
|
33
32
|
this.#rss = new RSS(this);
|
|
34
33
|
}
|
|
35
|
-
if (
|
|
34
|
+
if (features.includes('worldstate')) {
|
|
36
35
|
this.#worldstate = new Worldstate(this, this.#locale);
|
|
37
36
|
await this.#worldstate.init();
|
|
38
37
|
}
|
|
39
|
-
if (
|
|
38
|
+
if (features.includes('twitter')) {
|
|
40
39
|
this.#twitter = new Twitter(this);
|
|
41
40
|
}
|
|
42
41
|
|
package/nodemon.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "worldstate-emitter",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.12",
|
|
4
4
|
"description": "Event emitter for worldstate & other warframe events",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"warframe",
|
|
@@ -38,29 +38,29 @@
|
|
|
38
38
|
"test": "c8 mocha"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"cron": "^4.3.
|
|
42
|
-
"rss-feed-emitter": "^3.2.
|
|
41
|
+
"cron": "^4.3.4",
|
|
42
|
+
"rss-feed-emitter": "^3.2.4",
|
|
43
43
|
"twitter": "^1.7.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@commitlint/cli": "^20.
|
|
46
|
+
"@commitlint/cli": "^20.1.0",
|
|
47
47
|
"@commitlint/config-conventional": "^20.0.0",
|
|
48
48
|
"@wfcd/eslint-config": "latest",
|
|
49
49
|
"c8": "^10.1.3",
|
|
50
|
-
"chai": "^6.
|
|
50
|
+
"chai": "^6.2.1",
|
|
51
51
|
"husky": "^9.1.7",
|
|
52
52
|
"install-peerdeps": "^3.0.7",
|
|
53
|
-
"lint-staged": "^16.
|
|
54
|
-
"mocha": "^11.7.
|
|
55
|
-
"nodemon": "^3.1.
|
|
56
|
-
"prettier": "^3.
|
|
53
|
+
"lint-staged": "^16.2.7",
|
|
54
|
+
"mocha": "^11.7.5",
|
|
55
|
+
"nodemon": "^3.1.11",
|
|
56
|
+
"prettier": "^3.7.2"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"warframe-worldstate-data": "^3.x",
|
|
60
60
|
"warframe-worldstate-parser": "^5.x"
|
|
61
61
|
},
|
|
62
62
|
"optionalDependencies": {
|
|
63
|
-
"winston": "^3.
|
|
63
|
+
"winston": "^3.18.3"
|
|
64
64
|
},
|
|
65
65
|
"engines": {
|
|
66
66
|
"node": ">= 18.19.0"
|
package/resources/config.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export const
|
|
2
|
-
export const
|
|
3
|
-
export const
|
|
1
|
+
export const worldstateUrl = process.env.WORLDSTATE_URL ?? 'https://api.warframe.com/cdn/worldState.php';
|
|
2
|
+
export const kuvaUrl = process.env.KUVA_URL ?? 'https://10o.io/arbitrations.json';
|
|
3
|
+
export const sentientUrl = process.env.SENTIENT_URL ?? 'https://semlar.com/anomaly.json';
|
|
4
4
|
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
export const worldstateCron = process.env.WORLDSTATE_CRON ?? '25 */5 * * * *';
|
|
6
|
+
export const externalCron = process.env.WS_EXTERNAL_CRON ?? '0 */10 * * * *';
|
|
7
|
+
|
|
8
|
+
export const FEATURES = process.env.WS_EMITTER_FEATURES ? process.env.WS_EMITTER_FEATURES.split(',') : [];
|