warframe-worldstate-parser 2.23.2 → 2.25.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/lib/Alert.js +8 -8
- package/lib/CambionCycle.js +1 -5
- package/lib/CetusCycle.js +3 -3
- package/lib/ChallengeInstance.js +6 -6
- package/lib/ConclaveChallenge.js +2 -5
- package/lib/ConstructionProgress.js +4 -2
- package/lib/DailyDeal.js +1 -3
- package/lib/DarkSector.js +11 -8
- package/lib/EarthCycle.js +4 -4
- package/lib/Fissure.js +18 -10
- package/lib/FlashSale.js +2 -7
- package/lib/GlobalUpgrade.js +5 -5
- package/lib/Invasion.js +11 -10
- package/lib/Kuva.js +16 -10
- package/lib/Mission.js +31 -21
- package/lib/News.js +13 -15
- package/lib/Nightwave.js +7 -4
- package/lib/NightwaveChallenge.js +2 -4
- package/lib/PersistentEnemy.js +1 -3
- package/lib/Reward.js +64 -60
- package/lib/SentientOutpost.js +7 -8
- package/lib/Simaris.js +5 -3
- package/lib/Sortie.js +22 -16
- package/lib/SortieVariant.js +17 -18
- package/lib/SteelPathOffering.js +1 -0
- package/lib/SyndicateJob.js +20 -11
- package/lib/SyndicateMission.js +6 -6
- package/lib/VallisCycle.js +2 -2
- package/lib/VoidTrader.js +9 -13
- package/lib/WeeklyChallenge.js +4 -3
- package/lib/WorldEvent.js +23 -29
- package/lib/WorldState.js +50 -28
- package/lib/WorldstateObject.js +35 -12
- package/lib/ZarimanCycle.js +141 -0
- package/lib/timeDate.js +13 -12
- package/lib/translation.js +47 -38
- package/package.json +3 -118
- package/types/lib/Alert.d.ts +1 -1
- package/types/lib/CambionCycle.d.ts +9 -0
- package/types/lib/CetusCycle.d.ts +1 -0
- package/types/lib/ConclaveChallenge.d.ts +1 -1
- package/types/lib/DailyDeal.d.ts +1 -1
- package/types/lib/DarkSector.d.ts +1 -1
- package/types/lib/EarthCycle.d.ts +1 -0
- package/types/lib/Fissure.d.ts +11 -10
- package/types/lib/FlashSale.d.ts +1 -1
- package/types/lib/GlobalUpgrade.d.ts +1 -1
- package/types/lib/Invasion.d.ts +4 -4
- package/types/lib/Kuva.d.ts +1 -6
- package/types/lib/Mission.d.ts +11 -4
- package/types/lib/News.d.ts +4 -4
- package/types/lib/Nightwave.d.ts +2 -1
- package/types/lib/NightwaveChallenge.d.ts +7 -1
- package/types/lib/PersistentEnemy.d.ts +1 -1
- package/types/lib/SentientOutpost.d.ts +1 -1
- package/types/lib/Sortie.d.ts +10 -16
- package/types/lib/SortieVariant.d.ts +14 -20
- package/types/lib/SyndicateMission.d.ts +6 -1
- package/types/lib/VallisCycle.d.ts +1 -0
- package/types/lib/VoidTrader.d.ts +1 -1
- package/types/lib/WorldEvent.d.ts +3 -3
- package/types/lib/WorldState.d.ts +5 -1
- package/types/lib/WorldstateObject.d.ts +43 -11
- package/types/lib/ZarimanCycle.d.ts +56 -0
- package/types/main.d.ts +1 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const WorldstateObject = require('./WorldstateObject');
|
|
4
|
+
|
|
5
|
+
// This is a confirmed starting time for Corpus (in millis)
|
|
6
|
+
// All faction operation should use this as a calculation point
|
|
7
|
+
// Unless there's a better logic
|
|
8
|
+
const corpusTimeMillis = 1655182800000;
|
|
9
|
+
const fullCycle = 18000000;
|
|
10
|
+
const stateMaximum = 9000000;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Represents the current Zariman Corpus/Grineer Cycle
|
|
14
|
+
* @extends {WorldstateObject}
|
|
15
|
+
*/
|
|
16
|
+
module.exports = class ZarimanCycle extends WorldstateObject {
|
|
17
|
+
/**
|
|
18
|
+
* @param {Date} bountiesEndDate The current zariman cycle expiry
|
|
19
|
+
* @param {Object} deps The dependencies object
|
|
20
|
+
* @param {MarkdownSettings} deps.mdConfig The markdown settings
|
|
21
|
+
* @param {TimeDateFunctions} deps.timeDate The time and date functions
|
|
22
|
+
*/
|
|
23
|
+
constructor(bountiesEndDate, { mdConfig, timeDate }) {
|
|
24
|
+
super({ _id: { $oid: 'zarimanCycle0' } }, { timeDate });
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The markdown settings
|
|
28
|
+
* @type {MarkdownSettings}
|
|
29
|
+
* @private
|
|
30
|
+
*/
|
|
31
|
+
this.mdConfig = mdConfig;
|
|
32
|
+
Object.defineProperty(this, 'mdConfig', { enumerable: false, configurable: false });
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The end of the Zariman bounties timer, the faction changes exactly half way through
|
|
36
|
+
* @type {Date}
|
|
37
|
+
* @private
|
|
38
|
+
*/
|
|
39
|
+
this.bountiesEndDate = bountiesEndDate;
|
|
40
|
+
Object.defineProperty(this, 'currentTime', { enumerable: false, configurable: false });
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The time and date functions
|
|
44
|
+
* @type {TimeDateFunctions}
|
|
45
|
+
* @private
|
|
46
|
+
*/
|
|
47
|
+
this.timeDate = timeDate;
|
|
48
|
+
Object.defineProperty(this, 'timeDate', { enumerable: false, configurable: false });
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The current zariman cycle, for calculating the other fields
|
|
52
|
+
* @type {Object}
|
|
53
|
+
* @private
|
|
54
|
+
*/
|
|
55
|
+
const ec = this.getCurrentZarimanCycle();
|
|
56
|
+
Object.defineProperty(this, 'ec', { enumerable: false, configurable: false });
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The date and time at which the event ends
|
|
60
|
+
* @type {Date}
|
|
61
|
+
*/
|
|
62
|
+
this.expiry = ec.expiry;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The date and time at which the event started
|
|
66
|
+
* @type {Date}
|
|
67
|
+
*/
|
|
68
|
+
this.activation = new Date(ec.start);
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Whether or not this it's corpus or grineer
|
|
72
|
+
* @type {boolean}
|
|
73
|
+
*/
|
|
74
|
+
this.isCorpus = ec.isCorpus;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Current cycle state. One of `corpus`, `grineer`
|
|
78
|
+
* @type {string}
|
|
79
|
+
*/
|
|
80
|
+
this.state = ec.state;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Time remaining string
|
|
84
|
+
* @type {string}
|
|
85
|
+
*/
|
|
86
|
+
this.timeLeft = ec.timeLeft;
|
|
87
|
+
|
|
88
|
+
this.id = `zarimanCycle${this.expiry.getTime()}`;
|
|
89
|
+
|
|
90
|
+
this.shortString = `${this.timeLeft.replace(/\s\d*s/gi, '')} to ${this.isCorpus ? 'grineer' : 'corpus'}`;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Get whether the event has expired
|
|
95
|
+
* @returns {boolean}
|
|
96
|
+
*/
|
|
97
|
+
getExpired() {
|
|
98
|
+
return this.expiry ? this.timeDate.fromNow(this.expiry) < 0 : /* istanbul ignore next */ true;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
getCurrentZarimanCycle() {
|
|
102
|
+
const now = Date.now();
|
|
103
|
+
// determine if it is corpus cycle or grineer cycle based on bounty end time
|
|
104
|
+
// we subtract 5000 millis (5 seconds) to ensure the corpus/grineer calculation is correct
|
|
105
|
+
const bountiesClone = this.bountiesEndDate.getTime() - 5000;
|
|
106
|
+
const millisLeft = this.timeDate.fromNow(new Date(bountiesClone));
|
|
107
|
+
// the following line is a modulus operation
|
|
108
|
+
// this ensures that our calculation is correct if bountiesClone is before corpusTimeMillis
|
|
109
|
+
// if you really care, read https://torstencurdt.com/tech/posts/modulo-of-negative-numbers/
|
|
110
|
+
const cycleTimeElapsed = (((bountiesClone - corpusTimeMillis) % fullCycle) + fullCycle) % fullCycle;
|
|
111
|
+
const cycleTimeLeft = fullCycle - cycleTimeElapsed;
|
|
112
|
+
// if timeInCycle is more than 2.5 hours, it is corpus, otherwise it is grineer
|
|
113
|
+
const isCorpus = cycleTimeLeft > stateMaximum;
|
|
114
|
+
|
|
115
|
+
const minutesCoef = 1000 * 60;
|
|
116
|
+
const expiry = new Date(Math.round((now + millisLeft) / minutesCoef) * minutesCoef);
|
|
117
|
+
const state = isCorpus ? 'corpus' : 'grineer';
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
isCorpus,
|
|
121
|
+
timeLeft: this.timeDate.timeDeltaToString(millisLeft),
|
|
122
|
+
expiry,
|
|
123
|
+
expiresIn: millisLeft,
|
|
124
|
+
state,
|
|
125
|
+
start: expiry.getTime() - stateMaximum,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* The event's string representation
|
|
131
|
+
* @returns {string}
|
|
132
|
+
*/
|
|
133
|
+
toString() {
|
|
134
|
+
const lines = [
|
|
135
|
+
`Operator, Zariman Ten Zero is currently occupied by ${this.state}`,
|
|
136
|
+
`Time remaining until ${this.isCorpus ? 'grineer' : 'corpus'} takeover: ${this.timeLeft}`,
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
return lines.join(this.mdConfig.lineEnd);
|
|
140
|
+
}
|
|
141
|
+
};
|
package/lib/timeDate.js
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* An object containing functions to format dates and times
|
|
5
|
-
* @typedef {Object.<function>} TimeDateFunctions
|
|
6
|
-
* @property {function} timeDeltaToString - Converts a time difference to a string
|
|
7
|
-
* @property {function} fromNow - Returns the number of milliseconds between now and
|
|
8
|
-
* a given date
|
|
9
|
-
* @property {function} toNow - Returns the number of milliseconds between a given
|
|
10
|
-
* date and now
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
3
|
const epochZero = {
|
|
14
4
|
$date: {
|
|
15
5
|
$numberLong: 0,
|
|
@@ -42,6 +32,8 @@ function timeDeltaToString(millis) {
|
|
|
42
32
|
timePieces.push(`${Math.floor(seconds / 60)}m`);
|
|
43
33
|
seconds = Math.floor(seconds) % 60;
|
|
44
34
|
}
|
|
35
|
+
|
|
36
|
+
/* istanbul ignore else */
|
|
45
37
|
if (seconds >= 0) {
|
|
46
38
|
timePieces.push(`${Math.floor(seconds)}s`);
|
|
47
39
|
}
|
|
@@ -74,11 +66,20 @@ function toNow(d, now = Date.now) {
|
|
|
74
66
|
* @returns {Date}
|
|
75
67
|
*/
|
|
76
68
|
function parseDate(d) {
|
|
77
|
-
const safeD =
|
|
78
|
-
const dt =
|
|
69
|
+
const safeD = d || epochZero;
|
|
70
|
+
const dt = safeD.$date || epochZero.$date;
|
|
79
71
|
return new Date(safeD.$date ? Number(dt.$numberLong) : 1000 * d.sec);
|
|
80
72
|
}
|
|
81
73
|
|
|
74
|
+
/**
|
|
75
|
+
* An object containing functions to format dates and times
|
|
76
|
+
* @typedef {Object.<function>} TimeDateFunctions
|
|
77
|
+
* @property {function} timeDeltaToString - Converts a time difference to a string
|
|
78
|
+
* @property {function} fromNow - Returns the number of milliseconds between now and
|
|
79
|
+
* a given date
|
|
80
|
+
* @property {function} toNow - Returns the number of milliseconds between a given
|
|
81
|
+
* date and now
|
|
82
|
+
*/
|
|
82
83
|
module.exports = {
|
|
83
84
|
timeDeltaToString,
|
|
84
85
|
fromNow,
|
package/lib/translation.js
CHANGED
|
@@ -1,30 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* An object containing functions to convert in-game names to their localizations
|
|
5
|
-
* @typedef {Object.<function>} Translator
|
|
6
|
-
* @property {function} faction - Converts faction names
|
|
7
|
-
* @property {function} node - Converts star map node names
|
|
8
|
-
* @property {function} nodeMissionType - Returns the mission type of a given node
|
|
9
|
-
* @property {function} nodeEnemy - Returns the faction that controls a given node
|
|
10
|
-
* @property {function} languageString - Converts generic language strings
|
|
11
|
-
* @property {function} languageDesc - Converts generic language strings
|
|
12
|
-
* and retrieves the description
|
|
13
|
-
* @property {function} missionType - Converts mission types
|
|
14
|
-
* @property {function} conclaveMode - Converts conclave modes
|
|
15
|
-
* @property {function} conclaveCategory - Converts conclave challenge categories
|
|
16
|
-
* @property {function} fissureModifier - Converts fissure mission modifiers
|
|
17
|
-
* @property {function} syndicate - Converts syndicate names
|
|
18
|
-
* @property {function} upgrade - Converts upgrade types
|
|
19
|
-
* @property {function} operation - Converts operation types
|
|
20
|
-
* @property {function} sortieBoss - Converts sortie boss names
|
|
21
|
-
* @property {function} sortieModifer - Converts sortie modifier types
|
|
22
|
-
* @property {function} sortieModDesc - Converts sortie modifier type descriptions
|
|
23
|
-
* @property {function} region - Converts persistent enemy region indicies
|
|
24
|
-
* @property {function} conclaveChallenge - Convert conclave identifiers into standing data
|
|
25
|
-
* @property {function} steelPath - Retrieve Steel Path rotation data for locale
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
3
|
const data = require('warframe-worldstate-data');
|
|
29
4
|
|
|
30
5
|
function toTitleCase(str) {
|
|
@@ -32,7 +7,10 @@ function toTitleCase(str) {
|
|
|
32
7
|
}
|
|
33
8
|
|
|
34
9
|
function splitResourceName(str) {
|
|
35
|
-
return str
|
|
10
|
+
return str
|
|
11
|
+
.split(/([A-Z]?[^A-Z]*)/g)
|
|
12
|
+
.filter((item) => item)
|
|
13
|
+
.join(' ');
|
|
36
14
|
}
|
|
37
15
|
|
|
38
16
|
const i18n = (locale = 'en') => data[locale] || data;
|
|
@@ -47,7 +25,8 @@ function faction(key, dataOverride) {
|
|
|
47
25
|
function node(key, dataOverride) {
|
|
48
26
|
if (key in i18n(dataOverride).solNodes) {
|
|
49
27
|
return i18n(dataOverride).solNodes[key].value;
|
|
50
|
-
}
|
|
28
|
+
}
|
|
29
|
+
if (key) {
|
|
51
30
|
return key.split('/').slice(-1)[0];
|
|
52
31
|
}
|
|
53
32
|
return key;
|
|
@@ -56,7 +35,8 @@ function node(key, dataOverride) {
|
|
|
56
35
|
function nodeMissionType(key, dataOverride) {
|
|
57
36
|
if (key in i18n(dataOverride).solNodes) {
|
|
58
37
|
return i18n(dataOverride).solNodes[key].type;
|
|
59
|
-
}
|
|
38
|
+
}
|
|
39
|
+
if (key) {
|
|
60
40
|
return key.split('/').slice(-1)[0];
|
|
61
41
|
}
|
|
62
42
|
return key;
|
|
@@ -65,7 +45,8 @@ function nodeMissionType(key, dataOverride) {
|
|
|
65
45
|
function nodeEnemy(key, dataOverride) {
|
|
66
46
|
if (key in i18n(dataOverride).solNodes) {
|
|
67
47
|
return i18n(dataOverride).solNodes[key].enemy;
|
|
68
|
-
}
|
|
48
|
+
}
|
|
49
|
+
if (key) {
|
|
69
50
|
return key.split('/').slice(-1)[0];
|
|
70
51
|
}
|
|
71
52
|
return key;
|
|
@@ -75,7 +56,8 @@ function languageString(key, dataOverride) {
|
|
|
75
56
|
const lowerKey = String(key).toLowerCase();
|
|
76
57
|
if (lowerKey in i18n(dataOverride).languages) {
|
|
77
58
|
return i18n(dataOverride).languages[lowerKey].value;
|
|
78
|
-
}
|
|
59
|
+
}
|
|
60
|
+
if (key) {
|
|
79
61
|
return toTitleCase(splitResourceName(String(key).split('/').slice(-1)[0]));
|
|
80
62
|
}
|
|
81
63
|
return key;
|
|
@@ -85,7 +67,8 @@ function languageDesc(key, dataOverride) {
|
|
|
85
67
|
const lowerKey = String(key).toLowerCase();
|
|
86
68
|
if (lowerKey in i18n(dataOverride).languages) {
|
|
87
69
|
return i18n(dataOverride).languages[lowerKey].desc;
|
|
88
|
-
}
|
|
70
|
+
}
|
|
71
|
+
if (key) {
|
|
89
72
|
return `[PH] ${toTitleCase(splitResourceName(String(key).split('/').slice(-1)[0]))} Desc`;
|
|
90
73
|
}
|
|
91
74
|
return key;
|
|
@@ -94,7 +77,8 @@ function languageDesc(key, dataOverride) {
|
|
|
94
77
|
function missionType(key, dataOverride) {
|
|
95
78
|
if (key in i18n(dataOverride).missionTypes) {
|
|
96
79
|
return i18n(dataOverride).missionTypes[key].value;
|
|
97
|
-
}
|
|
80
|
+
}
|
|
81
|
+
if (key) {
|
|
98
82
|
return toTitleCase(key.replace(/^MT_/, ''));
|
|
99
83
|
}
|
|
100
84
|
return key;
|
|
@@ -178,8 +162,7 @@ function sortieModifier(key, dataOverride) {
|
|
|
178
162
|
}
|
|
179
163
|
|
|
180
164
|
function sortieModDesc(key, dataOverride) {
|
|
181
|
-
if (i18n(dataOverride).sortie.modifierDescriptions
|
|
182
|
-
&& key in i18n(dataOverride).sortie.modifierDescriptions) {
|
|
165
|
+
if (i18n(dataOverride).sortie.modifierDescriptions && key in i18n(dataOverride).sortie.modifierDescriptions) {
|
|
183
166
|
return i18n(dataOverride).sortie.modifierDescriptions[key];
|
|
184
167
|
}
|
|
185
168
|
return key;
|
|
@@ -195,9 +178,11 @@ function region(key, dataOverride) {
|
|
|
195
178
|
function conclaveChallenge(key, dataOverride) {
|
|
196
179
|
const splitKey = String(key).split('/').slice(-1)[0];
|
|
197
180
|
|
|
198
|
-
if (
|
|
199
|
-
|
|
200
|
-
|
|
181
|
+
if (
|
|
182
|
+
i18n(dataOverride).conclave &&
|
|
183
|
+
i18n(dataOverride).conclave.challenges &&
|
|
184
|
+
i18n(dataOverride).conclave.challenges[splitKey]
|
|
185
|
+
) {
|
|
201
186
|
return i18n(dataOverride).conclave.challenges[splitKey];
|
|
202
187
|
}
|
|
203
188
|
return {
|
|
@@ -208,9 +193,33 @@ function conclaveChallenge(key, dataOverride) {
|
|
|
208
193
|
}
|
|
209
194
|
|
|
210
195
|
function steelPath(dataOverride) {
|
|
211
|
-
return (i18n(dataOverride) || data).steelPath;
|
|
196
|
+
return (i18n(dataOverride) || /* istanbul ignore next */ data).steelPath;
|
|
212
197
|
}
|
|
213
198
|
|
|
199
|
+
/**
|
|
200
|
+
* An object containing functions to convert in-game names to their localizations
|
|
201
|
+
* @typedef {Object.<function>} Translator
|
|
202
|
+
* @property {function} faction - Converts faction names
|
|
203
|
+
* @property {function} node - Converts star map node names
|
|
204
|
+
* @property {function} nodeMissionType - Returns the mission type of a given node
|
|
205
|
+
* @property {function} nodeEnemy - Returns the faction that controls a given node
|
|
206
|
+
* @property {function} languageString - Converts generic language strings
|
|
207
|
+
* @property {function} languageDesc - Converts generic language strings
|
|
208
|
+
* and retrieves the description
|
|
209
|
+
* @property {function} missionType - Converts mission types
|
|
210
|
+
* @property {function} conclaveMode - Converts conclave modes
|
|
211
|
+
* @property {function} conclaveCategory - Converts conclave challenge categories
|
|
212
|
+
* @property {function} fissureModifier - Converts fissure mission modifiers
|
|
213
|
+
* @property {function} syndicate - Converts syndicate names
|
|
214
|
+
* @property {function} upgrade - Converts upgrade types
|
|
215
|
+
* @property {function} operation - Converts operation types
|
|
216
|
+
* @property {function} sortieBoss - Converts sortie boss names
|
|
217
|
+
* @property {function} sortieModifier - Converts sortie modifier types
|
|
218
|
+
* @property {function} sortieModDesc - Converts sortie modifier type descriptions
|
|
219
|
+
* @property {function} region - Converts persistent enemy region indicies
|
|
220
|
+
* @property {function} conclaveChallenge - Convert conclave identifiers into standing data
|
|
221
|
+
* @property {function} steelPath - Retrieve Steel Path rotation data for locale
|
|
222
|
+
*/
|
|
214
223
|
module.exports = {
|
|
215
224
|
faction,
|
|
216
225
|
node,
|
package/package.json
CHANGED
|
@@ -1,59 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "warframe-worldstate-parser",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.25.0",
|
|
4
4
|
"description": "An Open parser for Warframe's Worldstate in Javascript",
|
|
5
5
|
"types": "./types/main.d.ts",
|
|
6
6
|
"main": "main.js",
|
|
7
|
-
"directories": {
|
|
8
|
-
"test": "test"
|
|
9
|
-
},
|
|
10
7
|
"dependencies": {
|
|
11
8
|
"node-fetch": "^2.6.1"
|
|
12
9
|
},
|
|
13
10
|
"peerDependencies": {
|
|
14
11
|
"warframe-worldstate-data": ">=1.0"
|
|
15
12
|
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@types/chai": "^4.2.11",
|
|
18
|
-
"@types/node-fetch": "^2.5.8",
|
|
19
|
-
"@types/rewire": "^2.5.28",
|
|
20
|
-
"@types/sinon-chai": "^3.2.5",
|
|
21
|
-
"chai": "^4.2.0",
|
|
22
|
-
"coveralls": "^3.1.0",
|
|
23
|
-
"eslint": "^8.2.0",
|
|
24
|
-
"eslint-config-airbnb-base": "^15.0.0",
|
|
25
|
-
"eslint-plugin-import": "^2.20.1",
|
|
26
|
-
"greenkeeper-lockfile": "^1.15.1",
|
|
27
|
-
"mocha": "^10.0.0",
|
|
28
|
-
"nyc": "^15.1.0",
|
|
29
|
-
"precommit-hook": "^3.0.0",
|
|
30
|
-
"rewire": "^6.0.0",
|
|
31
|
-
"sinon": "^13.0.0",
|
|
32
|
-
"sinon-chai": "^3.5.0",
|
|
33
|
-
"typescript": "^4.0.5"
|
|
34
|
-
},
|
|
35
13
|
"engines": {
|
|
36
14
|
"node": ">=8.9.0"
|
|
37
15
|
},
|
|
38
|
-
"scripts": {
|
|
39
|
-
"test": "nyc mocha",
|
|
40
|
-
"test:integration": "npm run test -- -g 'should parse live worldstate data'",
|
|
41
|
-
"printcov": "nyc report",
|
|
42
|
-
"coverage": "npm test && nyc report --reporter=text-lcov | coveralls",
|
|
43
|
-
"build-docs": "jsdoc -c jsdoc-config.json -d docs",
|
|
44
|
-
"lint": "eslint main.js lib/ test/",
|
|
45
|
-
"lint:fix": "eslint main.js lib/ test/ --fix",
|
|
46
|
-
"prepublishOnly": "npm run build:types",
|
|
47
|
-
"build:types": "tsc -p tsconfig.declaration.json",
|
|
48
|
-
"validate": "npm run lint:fix && git add -u ."
|
|
49
|
-
},
|
|
50
16
|
"files": [
|
|
51
17
|
"lib",
|
|
52
18
|
"main.js",
|
|
53
19
|
"LICENSE",
|
|
54
20
|
"types"
|
|
55
21
|
],
|
|
56
|
-
"repository": "wfcd/warframe-worldstate-parser",
|
|
22
|
+
"repository": "github:wfcd/warframe-worldstate-parser",
|
|
57
23
|
"keywords": [
|
|
58
24
|
"warframe-worldstate",
|
|
59
25
|
"warframe"
|
|
@@ -66,86 +32,5 @@
|
|
|
66
32
|
"bugs": {
|
|
67
33
|
"url": "https://github.com/wfcd/warframe-worldstate-parser/issues"
|
|
68
34
|
},
|
|
69
|
-
"homepage": "https://github.com/wfcd/warframe-worldstate-parser#readme"
|
|
70
|
-
"release": {
|
|
71
|
-
"branch": "master"
|
|
72
|
-
},
|
|
73
|
-
"eslintIgnore": [
|
|
74
|
-
".github/**",
|
|
75
|
-
"docs/**",
|
|
76
|
-
"resources/**",
|
|
77
|
-
"types/**"
|
|
78
|
-
],
|
|
79
|
-
"eslintConfig": {
|
|
80
|
-
"extends": "airbnb-base",
|
|
81
|
-
"parserOptions": {
|
|
82
|
-
"sourceType": "script"
|
|
83
|
-
},
|
|
84
|
-
"rules": {
|
|
85
|
-
"valid-jsdoc": [
|
|
86
|
-
"error",
|
|
87
|
-
{
|
|
88
|
-
"requireReturn": false,
|
|
89
|
-
"requireReturnDescription": false,
|
|
90
|
-
"preferType": {
|
|
91
|
-
"String": "string",
|
|
92
|
-
"Number": "number",
|
|
93
|
-
"Boolean": "boolean",
|
|
94
|
-
"Function": "function",
|
|
95
|
-
"object": "Object",
|
|
96
|
-
"date": "Date",
|
|
97
|
-
"error": "Error"
|
|
98
|
-
},
|
|
99
|
-
"prefer": {
|
|
100
|
-
"return": "returns"
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
],
|
|
104
|
-
"no-underscore-dangle": "off",
|
|
105
|
-
"strict": [
|
|
106
|
-
"error",
|
|
107
|
-
"safe"
|
|
108
|
-
],
|
|
109
|
-
"linebreak-style": "off",
|
|
110
|
-
"import/no-unresolved": 0
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
"pre-commit": [
|
|
114
|
-
"validate"
|
|
115
|
-
],
|
|
116
|
-
"mocha": {
|
|
117
|
-
"exit": true,
|
|
118
|
-
"spec": "test/**/*.spec.js",
|
|
119
|
-
"timeout": 10000
|
|
120
|
-
},
|
|
121
|
-
"nyc": {
|
|
122
|
-
"exclude": [
|
|
123
|
-
"test/**",
|
|
124
|
-
"lib/DarkSector*.js",
|
|
125
|
-
"lib/Alert.js",
|
|
126
|
-
"lib/PersistentEnemy.js",
|
|
127
|
-
"lib/GlobalUpgrade.js",
|
|
128
|
-
"lib/ChallengeInstance.js",
|
|
129
|
-
"lib/WeeklyChallenge.js"
|
|
130
|
-
],
|
|
131
|
-
"reporter": [
|
|
132
|
-
"lcov",
|
|
133
|
-
"text"
|
|
134
|
-
],
|
|
135
|
-
"skip-full": true
|
|
136
|
-
},
|
|
137
|
-
"clean-package": {
|
|
138
|
-
"remove": [
|
|
139
|
-
"devDependencies",
|
|
140
|
-
"scripts",
|
|
141
|
-
"release",
|
|
142
|
-
"eslintIgnore",
|
|
143
|
-
"eslintConfig",
|
|
144
|
-
"pre-commit",
|
|
145
|
-
"nyc",
|
|
146
|
-
"mocha",
|
|
147
|
-
"clean-package",
|
|
148
|
-
"directories"
|
|
149
|
-
]
|
|
150
|
-
}
|
|
35
|
+
"homepage": "https://github.com/wfcd/warframe-worldstate-parser#readme"
|
|
151
36
|
}
|
package/types/lib/Alert.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare class Alert extends WorldstateObject {
|
|
|
13
13
|
* @param {Reward} Reward The Reward parser
|
|
14
14
|
* @param {string} locale Locale to use for translations
|
|
15
15
|
*/
|
|
16
|
-
constructor(data: any, { mdConfig, translator, timeDate, Mission, Reward, locale
|
|
16
|
+
constructor(data: any, { mdConfig, translator, timeDate, Mission, Reward, locale }: MarkdownSettings);
|
|
17
17
|
/**
|
|
18
18
|
* The markdown settings
|
|
19
19
|
* @type {MarkdownSettings}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
export = CambionCycle;
|
|
2
2
|
declare class CambionCycle extends WorldstateObject {
|
|
3
|
+
/**
|
|
4
|
+
* @param {CetusCycle} cetusCycle Match data from cetus cycle for data
|
|
5
|
+
* @param {Object} deps The dependencies object
|
|
6
|
+
* @param {TimeDateFunctions} deps.timeDate The time and date functions
|
|
7
|
+
*/
|
|
8
|
+
constructor(cetusCycle: CetusCycle, { timeDate }: {
|
|
9
|
+
timeDate: TimeDateFunctions;
|
|
10
|
+
});
|
|
3
11
|
active: string;
|
|
12
|
+
id: string;
|
|
4
13
|
/**
|
|
5
14
|
* Get whether or not the event has expired
|
|
6
15
|
* @returns {boolean}
|
|
@@ -12,7 +12,7 @@ declare class ConclaveChallenge extends WorldstateObject {
|
|
|
12
12
|
* @param {TimeDateFunctions} deps.timeDate The time and date functions
|
|
13
13
|
* @param {string} deps.locale Locale to use for translations
|
|
14
14
|
*/
|
|
15
|
-
constructor(data: any, { mdConfig, translator, timeDate, locale
|
|
15
|
+
constructor(data: any, { mdConfig, translator, timeDate, locale }: {
|
|
16
16
|
mdConfig: MarkdownSettings;
|
|
17
17
|
translator: Translator;
|
|
18
18
|
timeDate: TimeDateFunctions;
|
package/types/lib/DailyDeal.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare class DailyDeal {
|
|
|
11
11
|
* @param {TimeDateFunctions} deps.timeDate The time and date functions
|
|
12
12
|
* @param {string} deps.locale Locale to use for translations
|
|
13
13
|
*/
|
|
14
|
-
constructor(data: any, { mdConfig, translator, timeDate, locale
|
|
14
|
+
constructor(data: any, { mdConfig, translator, timeDate, locale }: {
|
|
15
15
|
mdConfig: MarkdownSettings;
|
|
16
16
|
translator: Translator;
|
|
17
17
|
timeDate: TimeDateFunctions;
|
|
@@ -15,7 +15,7 @@ declare class DarkSector extends WorldstateObject {
|
|
|
15
15
|
* @param {Reward} deps.Reward The reward parser
|
|
16
16
|
* @param {string} deps.locale Locale to use for translations
|
|
17
17
|
*/
|
|
18
|
-
constructor(data: any, { mdConfig, translator, timeDate, Mission, DarkSectorBattle, Reward, locale
|
|
18
|
+
constructor(data: any, { mdConfig, translator, timeDate, Mission, DarkSectorBattle, Reward, locale }: {
|
|
19
19
|
mdConfig: MarkdownSettings;
|
|
20
20
|
translator: Translator;
|
|
21
21
|
timeDate: TimeDateFunctions;
|
package/types/lib/Fissure.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
export = Fissure;
|
|
2
|
-
/**
|
|
3
|
-
* Represents a fissure mission
|
|
4
|
-
* @extends {WorldstateObject}
|
|
5
|
-
*/
|
|
6
2
|
declare class Fissure extends WorldstateObject {
|
|
7
3
|
/**
|
|
8
4
|
* @param {Object} data The fissure data
|
|
@@ -42,9 +38,9 @@ declare class Fissure extends WorldstateObject {
|
|
|
42
38
|
*/
|
|
43
39
|
enemyKey: string;
|
|
44
40
|
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
* The node key where the fissure has appeared
|
|
42
|
+
* @type {string}
|
|
43
|
+
*/
|
|
48
44
|
nodeKey: string;
|
|
49
45
|
/**
|
|
50
46
|
* The fissure's tier
|
|
@@ -57,7 +53,7 @@ declare class Fissure extends WorldstateObject {
|
|
|
57
53
|
*/
|
|
58
54
|
tierNum: number;
|
|
59
55
|
/**
|
|
60
|
-
* Whether
|
|
56
|
+
* Whether this is expired (at time of object creation)
|
|
61
57
|
* @type {boolean}
|
|
62
58
|
*/
|
|
63
59
|
expired: boolean;
|
|
@@ -67,12 +63,17 @@ declare class Fissure extends WorldstateObject {
|
|
|
67
63
|
*/
|
|
68
64
|
eta: string;
|
|
69
65
|
/**
|
|
70
|
-
* Whether
|
|
66
|
+
* Whether this fissure corresponds to a RailJack Void Storm
|
|
71
67
|
* @type {Boolean}
|
|
72
68
|
*/
|
|
73
69
|
isStorm: boolean;
|
|
74
70
|
/**
|
|
75
|
-
*
|
|
71
|
+
* Whether this fissure is a Steel Path fissure
|
|
72
|
+
* @type {boolean}
|
|
73
|
+
*/
|
|
74
|
+
isHard: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Get whether this deal has expired
|
|
76
77
|
* @returns {boolean}
|
|
77
78
|
*/
|
|
78
79
|
getExpired(): boolean;
|
package/types/lib/FlashSale.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare class FlashSale {
|
|
|
11
11
|
* @param {TimeDateFunctions} deps.timeDate The time and date functions
|
|
12
12
|
* @param {string} deps.locale Locale to use for translations
|
|
13
13
|
*/
|
|
14
|
-
constructor(data: any, { translator, mdConfig, timeDate, locale
|
|
14
|
+
constructor(data: any, { translator, mdConfig, timeDate, locale }: {
|
|
15
15
|
mdConfig: MarkdownSettings;
|
|
16
16
|
translator: Translator;
|
|
17
17
|
timeDate: TimeDateFunctions;
|
|
@@ -11,7 +11,7 @@ declare class GlobalUpgrade {
|
|
|
11
11
|
* @param {MarkdownSettings} deps.mdConfig The markdown settings
|
|
12
12
|
* @param {string} deps.locale Locale to use for translations
|
|
13
13
|
*/
|
|
14
|
-
constructor(data: any, { translator, timeDate, mdConfig, locale
|
|
14
|
+
constructor(data: any, { translator, timeDate, mdConfig, locale }: {
|
|
15
15
|
translator: Translator;
|
|
16
16
|
timeDate: TimeDateFunctions;
|
|
17
17
|
mdConfig: MarkdownSettings;
|
package/types/lib/Invasion.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ declare class Invasion extends WorldstateObject {
|
|
|
19
19
|
* @param {Reward} deps.Reward The Reward parser
|
|
20
20
|
* @param {string} deps.locale Locale to use for translations
|
|
21
21
|
*/
|
|
22
|
-
constructor(data: any, { mdConfig, translator, timeDate, Reward, locale
|
|
22
|
+
constructor(data: any, { mdConfig, translator, timeDate, Reward, locale }: {
|
|
23
23
|
mdConfig: MarkdownSettings;
|
|
24
24
|
translator: Translator;
|
|
25
25
|
timeDate: TimeDateFunctions;
|
|
@@ -38,9 +38,9 @@ declare class Invasion extends WorldstateObject {
|
|
|
38
38
|
*/
|
|
39
39
|
node: string;
|
|
40
40
|
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
* The node key where the invasion is taking place
|
|
42
|
+
* @type {string}
|
|
43
|
+
*/
|
|
44
44
|
nodeKey: string;
|
|
45
45
|
/**
|
|
46
46
|
* The invasion's description
|
package/types/lib/Kuva.d.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
export = Kuva;
|
|
2
|
-
/**
|
|
3
|
-
* Stores and parses kuva data from https://10o.io/kuvalog.json
|
|
4
|
-
* @property {ExternalMission[]} kuva currently active kuva missions
|
|
5
|
-
* @property {ExternalMission} arbitration current arbitration
|
|
6
|
-
*/
|
|
7
2
|
declare class Kuva {
|
|
8
|
-
constructor({ kuvaData, translator, locale, logger
|
|
3
|
+
constructor({ kuvaData, translator, locale, logger }: {
|
|
9
4
|
kuvaData: any;
|
|
10
5
|
translator: any;
|
|
11
6
|
locale: any;
|