warframe-worldstate-parser 2.20.3 → 2.22.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/CambionCycle.js +2 -0
- package/lib/SentientOutpost.js +3 -1
- package/lib/SteelPathOffering.js +1 -1
- package/lib/SyndicateJob.js +26 -105
- package/lib/VoidTrader.js +9 -1
- package/lib/VoidTraderItem.js +1 -1
- package/lib/VoidTraderSchedule.js +8 -0
- package/lib/WorldEvent.js +1 -1
- package/lib/WorldState.js +2 -3
- package/package.json +22 -6
- package/types/lib/Alert.d.ts +3 -3
- package/types/lib/CetusCycle.d.ts +2 -2
- package/types/lib/ChallengeInstance.d.ts +1 -1
- package/types/lib/ConclaveChallenge.d.ts +3 -3
- package/types/lib/ConstructionProgress.d.ts +1 -1
- package/types/lib/DailyDeal.d.ts +3 -3
- package/types/lib/DarkSector.d.ts +8 -8
- package/types/lib/Fissure.d.ts +2 -2
- package/types/lib/FlashSale.d.ts +3 -3
- package/types/lib/GlobalUpgrade.d.ts +3 -3
- package/types/lib/Invasion.d.ts +7 -7
- package/types/lib/Mission.d.ts +4 -4
- package/types/lib/News.d.ts +1 -1
- package/types/lib/Nightwave.d.ts +5 -5
- package/types/lib/NightwaveChallenge.d.ts +2 -2
- package/types/lib/PersistentEnemy.d.ts +2 -2
- package/types/lib/Reward.d.ts +1 -1
- package/types/lib/SentientOutpost.d.ts +1 -1
- package/types/lib/Simaris.d.ts +2 -2
- package/types/lib/Sortie.d.ts +5 -5
- package/types/lib/SortieVariant.d.ts +2 -2
- package/types/lib/SyndicateJob.d.ts +1 -1
- package/types/lib/SyndicateMission.d.ts +3 -3
- package/types/lib/VoidTrader.d.ts +6 -3
- package/types/lib/VoidTraderItem.d.ts +2 -2
- package/types/lib/VoidTraderSchedule.d.ts +10 -0
- package/types/lib/WeeklyChallenge.d.ts +3 -3
- package/types/lib/WorldEvent.d.ts +9 -9
- package/types/lib/WorldState.d.ts +1 -1
- package/types/lib/Dependency.d.ts +0 -35
- package/types/lib/ExternalMission.d.ts +0 -36
- package/types/lib/MarkdownSettings.d.ts +0 -22
package/lib/CambionCycle.js
CHANGED
|
@@ -5,6 +5,7 @@ const WorldstateObject = require('./WorldstateObject');
|
|
|
5
5
|
/**
|
|
6
6
|
* Represents the current Cambion Drift Fass/Vome Cycle
|
|
7
7
|
* @extends {WorldstateObject}
|
|
8
|
+
* @property {string} timeLeft time rendering of amount of time left
|
|
8
9
|
*/
|
|
9
10
|
module.exports = class CambionCycle extends WorldstateObject {
|
|
10
11
|
/**
|
|
@@ -18,6 +19,7 @@ module.exports = class CambionCycle extends WorldstateObject {
|
|
|
18
19
|
({
|
|
19
20
|
activation: this.activation,
|
|
20
21
|
expiry: this.expiry,
|
|
22
|
+
timeLeft: this.timeLeft,
|
|
21
23
|
} = cetusCycle);
|
|
22
24
|
|
|
23
25
|
this.active = cetusCycle.isDay ? 'fass' : 'vome';
|
package/lib/SentientOutpost.js
CHANGED
|
@@ -40,9 +40,11 @@ const sat = () => {
|
|
|
40
40
|
* @property {Date} previous.expiry When the mission became or becomes inactive
|
|
41
41
|
*/
|
|
42
42
|
class SentientOutpost {
|
|
43
|
-
constructor(data
|
|
43
|
+
constructor(data, {
|
|
44
44
|
translator, locale, sentientData, logger,
|
|
45
45
|
}) {
|
|
46
|
+
// eslint-disable-next-line no-param-reassign
|
|
47
|
+
if (!data) data = '{"sfn":000}';
|
|
46
48
|
const node = (data.match(/\d{3}/g) || ['000'])[0];
|
|
47
49
|
const id = `CrewBattleNode${node}`;
|
|
48
50
|
if (node === '000') {
|
package/lib/SteelPathOffering.js
CHANGED
|
@@ -15,7 +15,7 @@ function getFirstDayOfWeek() {
|
|
|
15
15
|
|
|
16
16
|
function getLastDayOfWeek() {
|
|
17
17
|
const last = new Date(getFirstDayOfWeek());
|
|
18
|
-
last.setUTCDate(last.getUTCDate() +
|
|
18
|
+
last.setUTCDate(last.getUTCDate() + 6);
|
|
19
19
|
last.setUTCHours(23);
|
|
20
20
|
last.setUTCMinutes(59);
|
|
21
21
|
last.setUTCSeconds(59);
|
package/lib/SyndicateJob.js
CHANGED
|
@@ -5,95 +5,17 @@ const fetch = require('node-fetch');
|
|
|
5
5
|
const WorldstateObject = require('./WorldstateObject');
|
|
6
6
|
|
|
7
7
|
const apiBase = process.env.API_BASE_URL || 'https://api.warframestat.us';
|
|
8
|
-
const bountyRewardRegex = /Tier(
|
|
9
|
-
const ghoulRewardRegex = /GhoulBountyTable(
|
|
8
|
+
const bountyRewardRegex = /Tier([ABCDE])Table([ABC])Rewards/i;
|
|
9
|
+
const ghoulRewardRegex = /GhoulBountyTable([AB])Rewards/i;
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Determine the level string for the bounty
|
|
13
|
-
* @param {
|
|
14
|
-
* @param {string} tier bounty tier identifier
|
|
15
|
-
* @param {boolean} cambion whether or not the bounty is a cambion bounty
|
|
16
|
-
* @param {boolean} isVault whether or not the bounty is a vault run
|
|
13
|
+
* @param {Object} job Original raw job data
|
|
17
14
|
* @returns {string} level range string
|
|
18
15
|
*/
|
|
19
|
-
const getLevelString = (
|
|
20
|
-
let levelString = '';
|
|
21
|
-
if (bountyMatches && bountyMatches.length) {
|
|
22
|
-
if (!cambion) {
|
|
23
|
-
switch (tier) {
|
|
24
|
-
case 'A':
|
|
25
|
-
levelString = '5 - 15';
|
|
26
|
-
break;
|
|
27
|
-
case 'B':
|
|
28
|
-
levelString = '10 - 30';
|
|
29
|
-
break;
|
|
30
|
-
case 'C':
|
|
31
|
-
levelString = '20 - 40';
|
|
32
|
-
break;
|
|
33
|
-
case 'D':
|
|
34
|
-
levelString = '30 - 50';
|
|
35
|
-
break;
|
|
36
|
-
case 'E':
|
|
37
|
-
levelString = '40 - 60';
|
|
38
|
-
break;
|
|
39
|
-
default:
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
} else if (isVault) {
|
|
43
|
-
switch (tier) {
|
|
44
|
-
case 'A':
|
|
45
|
-
levelString = '30 - 40';
|
|
46
|
-
break;
|
|
47
|
-
case 'B':
|
|
48
|
-
levelString = '40 - 50';
|
|
49
|
-
break;
|
|
50
|
-
case 'C':
|
|
51
|
-
levelString = '50 - 60';
|
|
52
|
-
break;
|
|
53
|
-
default:
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
} else {
|
|
57
|
-
switch (tier) {
|
|
58
|
-
case 'A':
|
|
59
|
-
levelString = '5 - 15';
|
|
60
|
-
break;
|
|
61
|
-
case 'B':
|
|
62
|
-
levelString = '15 - 25';
|
|
63
|
-
break;
|
|
64
|
-
case 'C':
|
|
65
|
-
levelString = '25 - 30';
|
|
66
|
-
break;
|
|
67
|
-
case 'D':
|
|
68
|
-
levelString = '30 - 40';
|
|
69
|
-
break;
|
|
70
|
-
case 'E':
|
|
71
|
-
levelString = '40 - 60';
|
|
72
|
-
break;
|
|
73
|
-
case 'F':
|
|
74
|
-
levelString = '100 - 100';
|
|
75
|
-
break;
|
|
76
|
-
default:
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
} else {
|
|
81
|
-
switch (tier) {
|
|
82
|
-
case 'A':
|
|
83
|
-
levelString = '15 - 25';
|
|
84
|
-
break;
|
|
85
|
-
case 'B':
|
|
86
|
-
levelString = '40 - 50';
|
|
87
|
-
break;
|
|
88
|
-
default:
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
16
|
+
const getLevelString = (job) => `${job.minEnemyLevel} - ${job.maxEnemyLevel}`;
|
|
92
17
|
|
|
93
|
-
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
const determineLocation = (i18n, isVault) => {
|
|
18
|
+
const determineLocation = (i18n, isVault, raw) => {
|
|
97
19
|
const last = String(i18n).split('/').slice(-1)[0];
|
|
98
20
|
|
|
99
21
|
const bountyMatches = last.match(bountyRewardRegex);
|
|
@@ -104,11 +26,8 @@ const determineLocation = (i18n, isVault) => {
|
|
|
104
26
|
const isCetus = /eidolonjob/i.test(i18n);
|
|
105
27
|
const isVallis = /venusjob/i.test(i18n);
|
|
106
28
|
const isDeimos = /deimosmissionrewards/i.test(i18n);
|
|
107
|
-
|
|
108
|
-
// eslint-disable-next-line no-nested-ternary
|
|
109
|
-
const tier = isBounty ? bountyMatches[1] : (isGhoul ? ghoulMatches[1] : '');
|
|
110
29
|
const rotation = isBounty ? bountyMatches[2] : '';
|
|
111
|
-
const levelString = getLevelString(
|
|
30
|
+
const levelString = getLevelString(raw);
|
|
112
31
|
|
|
113
32
|
let location;
|
|
114
33
|
let levelClause;
|
|
@@ -133,24 +52,26 @@ const determineLocation = (i18n, isVault) => {
|
|
|
133
52
|
return { location, locationWRot };
|
|
134
53
|
};
|
|
135
54
|
|
|
136
|
-
const getBountyRewards = async (i18n, isVault) => {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
55
|
+
const getBountyRewards = async (i18n, isVault, raw) => {
|
|
56
|
+
let location;
|
|
57
|
+
let locationWRot;
|
|
58
|
+
if (i18n.endsWith('PlagueStarTableRewards')) {
|
|
59
|
+
location = 'plague star';
|
|
60
|
+
locationWRot = 'Earth/Cetus (Level 15 - 25 Plague Star), Rot A';
|
|
61
|
+
}
|
|
62
|
+
if (!location || !locationWRot) {
|
|
63
|
+
({ location, locationWRot } = determineLocation(i18n, isVault, raw));
|
|
64
|
+
}
|
|
65
|
+
const url = `${apiBase}/drops/search/${encodeURIComponent(location)}?grouped_by=location`;
|
|
66
|
+
const reply = await fetch(url).then((res) => res.json()).catch(() => {}); // swallow errors
|
|
67
|
+
const pool = (reply || {})[locationWRot];
|
|
68
|
+
if (!pool) {
|
|
69
|
+
return ['Pattern Mismatch. Results inaccurate.'];
|
|
70
|
+
}
|
|
71
|
+
const results = pool.rewards;
|
|
72
|
+
if (results) {
|
|
73
|
+
return Array.from(new Set(results.map((result) => result.item)));
|
|
152
74
|
}
|
|
153
|
-
|
|
154
75
|
return [];
|
|
155
76
|
};
|
|
156
77
|
|
|
@@ -174,7 +95,7 @@ class SyndicateJob extends WorldstateObject {
|
|
|
174
95
|
* @type {Array.<String>}
|
|
175
96
|
*/
|
|
176
97
|
this.rewardPool = [];
|
|
177
|
-
getBountyRewards(data.rewards, data.isVault)
|
|
98
|
+
getBountyRewards(data.rewards, data.isVault, data)
|
|
178
99
|
.then((rewards) => {
|
|
179
100
|
this.rewardPool = rewards;
|
|
180
101
|
});
|
package/lib/VoidTrader.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const WorldstateObject = require('./WorldstateObject');
|
|
4
4
|
const VoidTraderItem = require('./VoidTraderItem');
|
|
5
|
+
const VoidTraderSchedule = require('./VoidTraderSchedule');
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Represents a void trader
|
|
@@ -53,7 +54,7 @@ class VoidTrader extends WorldstateObject {
|
|
|
53
54
|
* The void trader's name
|
|
54
55
|
* @type {string}
|
|
55
56
|
*/
|
|
56
|
-
this.character = data.Character.replace('Baro\'Ki Teel', 'Baro Ki\'Teer');
|
|
57
|
+
this.character = data.Character ? data.Character.replace('Baro\'Ki Teel', 'Baro Ki\'Teer') : '';
|
|
57
58
|
|
|
58
59
|
/**
|
|
59
60
|
* The node at which the Void Trader appears
|
|
@@ -94,6 +95,13 @@ class VoidTrader extends WorldstateObject {
|
|
|
94
95
|
* @type {string}
|
|
95
96
|
*/
|
|
96
97
|
this.endString = this.getEndString();
|
|
98
|
+
|
|
99
|
+
this.initialStart = timeDate.parseDate(data.InitialStartDate);
|
|
100
|
+
this.completed = data.Completed;
|
|
101
|
+
this.schedule = data.ScheduleInfo
|
|
102
|
+
? data.ScheduleInfo
|
|
103
|
+
.map((i) => new VoidTraderSchedule(i, { timeDate, translator, locale }))
|
|
104
|
+
: [];
|
|
97
105
|
}
|
|
98
106
|
|
|
99
107
|
/**
|
package/lib/VoidTraderItem.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
class VoidTraderItem {
|
|
10
10
|
/**
|
|
11
|
-
* @param {Object} data The
|
|
11
|
+
* @param {Object} data The void trader item data
|
|
12
12
|
* @param {string} data.ItemType Worldstate Item i18n path
|
|
13
13
|
* @param {string} data.PrimePrice Ducat cost of the item
|
|
14
14
|
* @param {string} data.RegularPrice Credit price of the item
|
package/lib/WorldEvent.js
CHANGED
package/lib/WorldState.js
CHANGED
|
@@ -89,9 +89,6 @@ function parseArray(ParserClass, dataArray, deps, uniqueField) {
|
|
|
89
89
|
if (Object.prototype.hasOwnProperty.call(obj, 'active')) {
|
|
90
90
|
return obj.active;
|
|
91
91
|
}
|
|
92
|
-
if (Object.prototype.hasOwnProperty.call(obj, 'expired')) {
|
|
93
|
-
return obj.expired;
|
|
94
|
-
}
|
|
95
92
|
return true;
|
|
96
93
|
});
|
|
97
94
|
}
|
|
@@ -304,5 +301,7 @@ module.exports = class WorldState {
|
|
|
304
301
|
* @type {SteelPathOffering}
|
|
305
302
|
*/
|
|
306
303
|
this.steelPath = new SteelPathOffering(deps);
|
|
304
|
+
|
|
305
|
+
[this.vaultTrader] = parseArray(deps.VoidTrader, data.PrimeVaultTraders, deps);
|
|
307
306
|
}
|
|
308
307
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "warframe-worldstate-parser",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.22.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",
|
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
"test": "test"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"node-fetch": "^2.6.1"
|
|
12
|
-
|
|
11
|
+
"node-fetch": "^2.6.1"
|
|
12
|
+
},
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"warframe-worldstate-data": ">=1.0"
|
|
13
15
|
},
|
|
14
16
|
"devDependencies": {
|
|
15
17
|
"@types/chai": "^4.2.11",
|
|
@@ -18,15 +20,15 @@
|
|
|
18
20
|
"@types/sinon-chai": "^3.2.5",
|
|
19
21
|
"chai": "^4.2.0",
|
|
20
22
|
"coveralls": "^3.1.0",
|
|
21
|
-
"eslint": "^
|
|
22
|
-
"eslint-config-airbnb-base": "^
|
|
23
|
+
"eslint": "^8.2.0",
|
|
24
|
+
"eslint-config-airbnb-base": "^15.0.0",
|
|
23
25
|
"eslint-plugin-import": "^2.20.1",
|
|
24
26
|
"greenkeeper-lockfile": "^1.15.1",
|
|
25
27
|
"mocha": "^9.0.2",
|
|
26
28
|
"nyc": "^15.1.0",
|
|
27
29
|
"precommit-hook": "^3.0.0",
|
|
28
30
|
"rewire": "^5.0.0",
|
|
29
|
-
"sinon": "^
|
|
31
|
+
"sinon": "^12.0.1",
|
|
30
32
|
"sinon-chai": "^3.5.0",
|
|
31
33
|
"typescript": "^4.0.5"
|
|
32
34
|
},
|
|
@@ -131,5 +133,19 @@
|
|
|
131
133
|
"text"
|
|
132
134
|
],
|
|
133
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
|
+
]
|
|
134
150
|
}
|
|
135
151
|
}
|
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}
|
|
@@ -24,7 +24,7 @@ declare class Alert extends WorldstateObject {
|
|
|
24
24
|
* The mission that the players have to complete
|
|
25
25
|
* @type {Mission}
|
|
26
26
|
*/
|
|
27
|
-
mission:
|
|
27
|
+
mission: MarkdownSettings;
|
|
28
28
|
/**
|
|
29
29
|
* ETA string (at time of object creation)
|
|
30
30
|
* @type {String}
|
|
@@ -49,7 +49,7 @@ declare class Alert extends WorldstateObject {
|
|
|
49
49
|
* Get the alert's reward
|
|
50
50
|
* @returns {Reward}
|
|
51
51
|
*/
|
|
52
|
-
getReward():
|
|
52
|
+
getReward(): Reward;
|
|
53
53
|
/**
|
|
54
54
|
* Get a string indicating how much time is left before the alert expires
|
|
55
55
|
* @returns {string}
|
|
@@ -11,8 +11,8 @@ declare class CetusCycle extends WorldstateObject {
|
|
|
11
11
|
* @param {TimeDateFunctions} deps.timeDate The time and date functions
|
|
12
12
|
*/
|
|
13
13
|
constructor(bountiesEndDate: Date, { mdConfig, timeDate }: {
|
|
14
|
-
mdConfig:
|
|
15
|
-
timeDate:
|
|
14
|
+
mdConfig: MarkdownSettings;
|
|
15
|
+
timeDate: TimeDateFunctions;
|
|
16
16
|
});
|
|
17
17
|
/**
|
|
18
18
|
* The markdown settings
|
|
@@ -9,7 +9,7 @@ declare class ChallengeInstance {
|
|
|
9
9
|
* @param {Translator} deps.translator The string translator
|
|
10
10
|
* @param {string} deps.locale Locale to use for translations
|
|
11
11
|
*/
|
|
12
|
-
constructor(data: any, { translator, locale }:
|
|
12
|
+
constructor(data: any, { translator, locale }: Dependency);
|
|
13
13
|
/**
|
|
14
14
|
* Type of challenge
|
|
15
15
|
* @type {string}
|
|
@@ -13,9 +13,9 @@ declare class ConclaveChallenge extends WorldstateObject {
|
|
|
13
13
|
* @param {string} deps.locale Locale to use for translations
|
|
14
14
|
*/
|
|
15
15
|
constructor(data: any, { mdConfig, translator, timeDate, locale, }: {
|
|
16
|
-
mdConfig:
|
|
17
|
-
translator:
|
|
18
|
-
timeDate:
|
|
16
|
+
mdConfig: MarkdownSettings;
|
|
17
|
+
translator: Translator;
|
|
18
|
+
timeDate: TimeDateFunctions;
|
|
19
19
|
locale: string;
|
|
20
20
|
});
|
|
21
21
|
/**
|
|
@@ -10,7 +10,7 @@ declare class ConstructionProgress extends WorldstateObject {
|
|
|
10
10
|
* @param {MarkdownSettings} deps.mdConfig The markdown settings
|
|
11
11
|
*/
|
|
12
12
|
constructor(data: any, { mdConfig, timeDate }: {
|
|
13
|
-
mdConfig:
|
|
13
|
+
mdConfig: MarkdownSettings;
|
|
14
14
|
});
|
|
15
15
|
/**
|
|
16
16
|
* The markdown settings
|
package/types/lib/DailyDeal.d.ts
CHANGED
|
@@ -12,9 +12,9 @@ declare class DailyDeal {
|
|
|
12
12
|
* @param {string} deps.locale Locale to use for translations
|
|
13
13
|
*/
|
|
14
14
|
constructor(data: any, { mdConfig, translator, timeDate, locale, }: {
|
|
15
|
-
mdConfig:
|
|
16
|
-
translator:
|
|
17
|
-
timeDate:
|
|
15
|
+
mdConfig: MarkdownSettings;
|
|
16
|
+
translator: Translator;
|
|
17
|
+
timeDate: TimeDateFunctions;
|
|
18
18
|
locale: string;
|
|
19
19
|
});
|
|
20
20
|
/**
|
|
@@ -16,12 +16,12 @@ declare class DarkSector extends WorldstateObject {
|
|
|
16
16
|
* @param {string} deps.locale Locale to use for translations
|
|
17
17
|
*/
|
|
18
18
|
constructor(data: any, { mdConfig, translator, timeDate, Mission, DarkSectorBattle, Reward, locale, }: {
|
|
19
|
-
mdConfig:
|
|
20
|
-
translator:
|
|
21
|
-
timeDate:
|
|
22
|
-
Mission:
|
|
23
|
-
DarkSectorBattle:
|
|
24
|
-
Reward:
|
|
19
|
+
mdConfig: MarkdownSettings;
|
|
20
|
+
translator: Translator;
|
|
21
|
+
timeDate: TimeDateFunctions;
|
|
22
|
+
Mission: Mission;
|
|
23
|
+
DarkSectorBattle: DarkSectorBattle;
|
|
24
|
+
Reward: Reward;
|
|
25
25
|
locale: string;
|
|
26
26
|
});
|
|
27
27
|
/**
|
|
@@ -96,7 +96,7 @@ declare class DarkSector extends WorldstateObject {
|
|
|
96
96
|
* The dark sector's mission
|
|
97
97
|
* @type {?Mission}
|
|
98
98
|
*/
|
|
99
|
-
mission:
|
|
99
|
+
mission: Mission;
|
|
100
100
|
battlePayReserve: any;
|
|
101
101
|
/**
|
|
102
102
|
* The battle pay per mission offered to players
|
|
@@ -127,6 +127,6 @@ declare class DarkSector extends WorldstateObject {
|
|
|
127
127
|
* The history of the dark sector
|
|
128
128
|
* @type {Array.<DarkSectorBattle>}
|
|
129
129
|
*/
|
|
130
|
-
history: Array<
|
|
130
|
+
history: Array<DarkSectorBattle>;
|
|
131
131
|
}
|
|
132
132
|
import WorldstateObject = require("./WorldstateObject");
|
package/types/lib/Fissure.d.ts
CHANGED
|
@@ -12,8 +12,8 @@ declare class Fissure extends WorldstateObject {
|
|
|
12
12
|
* @param {string} deps.locale Locale to use for translations
|
|
13
13
|
*/
|
|
14
14
|
constructor(data: any, { translator, timeDate, locale }: {
|
|
15
|
-
translator:
|
|
16
|
-
timeDate:
|
|
15
|
+
translator: Translator;
|
|
16
|
+
timeDate: TimeDateFunctions;
|
|
17
17
|
locale: string;
|
|
18
18
|
});
|
|
19
19
|
/**
|
package/types/lib/FlashSale.d.ts
CHANGED
|
@@ -12,9 +12,9 @@ declare class FlashSale {
|
|
|
12
12
|
* @param {string} deps.locale Locale to use for translations
|
|
13
13
|
*/
|
|
14
14
|
constructor(data: any, { translator, mdConfig, timeDate, locale, }: {
|
|
15
|
-
mdConfig:
|
|
16
|
-
translator:
|
|
17
|
-
timeDate:
|
|
15
|
+
mdConfig: MarkdownSettings;
|
|
16
|
+
translator: Translator;
|
|
17
|
+
timeDate: TimeDateFunctions;
|
|
18
18
|
locale: string;
|
|
19
19
|
});
|
|
20
20
|
/**
|
|
@@ -12,9 +12,9 @@ declare class GlobalUpgrade {
|
|
|
12
12
|
* @param {string} deps.locale Locale to use for translations
|
|
13
13
|
*/
|
|
14
14
|
constructor(data: any, { translator, timeDate, mdConfig, locale, }: {
|
|
15
|
-
translator:
|
|
16
|
-
timeDate:
|
|
17
|
-
mdConfig:
|
|
15
|
+
translator: Translator;
|
|
16
|
+
timeDate: TimeDateFunctions;
|
|
17
|
+
mdConfig: MarkdownSettings;
|
|
18
18
|
locale: string;
|
|
19
19
|
});
|
|
20
20
|
/**
|
package/types/lib/Invasion.d.ts
CHANGED
|
@@ -20,10 +20,10 @@ declare class Invasion extends WorldstateObject {
|
|
|
20
20
|
* @param {string} deps.locale Locale to use for translations
|
|
21
21
|
*/
|
|
22
22
|
constructor(data: any, { mdConfig, translator, timeDate, Reward, locale, }: {
|
|
23
|
-
mdConfig:
|
|
24
|
-
translator:
|
|
25
|
-
timeDate:
|
|
26
|
-
Reward:
|
|
23
|
+
mdConfig: MarkdownSettings;
|
|
24
|
+
translator: Translator;
|
|
25
|
+
timeDate: TimeDateFunctions;
|
|
26
|
+
Reward: Reward;
|
|
27
27
|
locale: string;
|
|
28
28
|
});
|
|
29
29
|
/**
|
|
@@ -51,7 +51,7 @@ declare class Invasion extends WorldstateObject {
|
|
|
51
51
|
* The attacker's reward
|
|
52
52
|
* @type {Reward}
|
|
53
53
|
*/
|
|
54
|
-
attackerReward:
|
|
54
|
+
attackerReward: Reward;
|
|
55
55
|
/**
|
|
56
56
|
* The attacking faction
|
|
57
57
|
* @type {string}
|
|
@@ -66,7 +66,7 @@ declare class Invasion extends WorldstateObject {
|
|
|
66
66
|
* The defender's reward
|
|
67
67
|
* @type {Reward}
|
|
68
68
|
*/
|
|
69
|
-
defenderReward:
|
|
69
|
+
defenderReward: Reward;
|
|
70
70
|
/**
|
|
71
71
|
* The defending faction
|
|
72
72
|
* @type {string}
|
|
@@ -76,7 +76,7 @@ declare class Invasion extends WorldstateObject {
|
|
|
76
76
|
* Invasion defender
|
|
77
77
|
* @type {Partipant}
|
|
78
78
|
*/
|
|
79
|
-
defender:
|
|
79
|
+
defender: Partipant;
|
|
80
80
|
/**
|
|
81
81
|
* Whether this invasion is against the infestation
|
|
82
82
|
* @type {boolean}
|
package/types/lib/Mission.d.ts
CHANGED
|
@@ -12,9 +12,9 @@ declare class Mission {
|
|
|
12
12
|
* @param {string} deps.locale Locale to use for translations
|
|
13
13
|
*/
|
|
14
14
|
constructor(data: any, { mdConfig, translator, Reward, locale, }: {
|
|
15
|
-
mdConfig:
|
|
16
|
-
translator:
|
|
17
|
-
Reward:
|
|
15
|
+
mdConfig: MarkdownSettings;
|
|
16
|
+
translator: Translator;
|
|
17
|
+
Reward: Reward;
|
|
18
18
|
locale: string;
|
|
19
19
|
});
|
|
20
20
|
/**
|
|
@@ -47,7 +47,7 @@ declare class Mission {
|
|
|
47
47
|
* The mission's reward
|
|
48
48
|
* @type {?Reward}
|
|
49
49
|
*/
|
|
50
|
-
reward:
|
|
50
|
+
reward: Reward;
|
|
51
51
|
/**
|
|
52
52
|
* The minimum level of the enemies in the mission
|
|
53
53
|
* @type {number}
|
package/types/lib/News.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare class News extends WorldstateObject {
|
|
|
11
11
|
* @param {TimeDateFunctions} deps.timeDate The time and date functions
|
|
12
12
|
* @param {locale} deps.locale Locale to use for determining language
|
|
13
13
|
*/
|
|
14
|
-
constructor(data: any, { mdConfig, timeDate, locale }:
|
|
14
|
+
constructor(data: any, { mdConfig, timeDate, locale }: Dependency);
|
|
15
15
|
/**
|
|
16
16
|
* The markdown settings
|
|
17
17
|
* @type {MarkdownSettings}
|
package/types/lib/Nightwave.d.ts
CHANGED
|
@@ -15,11 +15,11 @@ declare class Nightwave extends WorldstateObject {
|
|
|
15
15
|
* @param {string} deps.locale Locale to use for translations
|
|
16
16
|
*/
|
|
17
17
|
constructor(data: any, { mdConfig, translator, timeDate, Mission, Reward, locale, }: {
|
|
18
|
-
mdConfig:
|
|
19
|
-
translator:
|
|
20
|
-
timeDate:
|
|
21
|
-
Mission:
|
|
22
|
-
Reward:
|
|
18
|
+
mdConfig: MarkdownSettings;
|
|
19
|
+
translator: Translator;
|
|
20
|
+
timeDate: TimeDateFunctions;
|
|
21
|
+
Mission: Mission;
|
|
22
|
+
Reward: Reward;
|
|
23
23
|
locale: string;
|
|
24
24
|
});
|
|
25
25
|
/**
|
|
@@ -12,8 +12,8 @@ declare class NightwaveChallenge extends WorldstateObject {
|
|
|
12
12
|
* @param {string} deps.locale Locale to use for translations
|
|
13
13
|
*/
|
|
14
14
|
constructor(data: any, { translator, timeDate, locale, }: {
|
|
15
|
-
translator:
|
|
16
|
-
timeDate:
|
|
15
|
+
translator: Translator;
|
|
16
|
+
timeDate: TimeDateFunctions;
|
|
17
17
|
locale: string;
|
|
18
18
|
});
|
|
19
19
|
/**
|
|
@@ -12,8 +12,8 @@ declare class PersistentEnemy extends WorldstateObject {
|
|
|
12
12
|
* @param {string} deps.locale Locale to use for translations
|
|
13
13
|
*/
|
|
14
14
|
constructor(data: any, { mdConfig, translator, timeDate, locale, }: {
|
|
15
|
-
mdConfig:
|
|
16
|
-
translator:
|
|
15
|
+
mdConfig: MarkdownSettings;
|
|
16
|
+
translator: Translator;
|
|
17
17
|
locale: string;
|
|
18
18
|
});
|
|
19
19
|
/**
|
package/types/lib/Reward.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export = SentientOutpost;
|
|
|
20
20
|
* @property {Date} previous.expiry When the mission became or becomes inactive
|
|
21
21
|
*/
|
|
22
22
|
declare class SentientOutpost {
|
|
23
|
-
constructor(data:
|
|
23
|
+
constructor(data: any, { translator, locale, sentientData, logger, }: {
|
|
24
24
|
translator: any;
|
|
25
25
|
locale: any;
|
|
26
26
|
sentientData: any;
|
package/types/lib/Simaris.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ declare class Simaris {
|
|
|
11
11
|
* @param {string} deps.locale Locale to use for translations
|
|
12
12
|
*/
|
|
13
13
|
constructor(data: any, { mdConfig, translator, locale }: {
|
|
14
|
-
mdConfig:
|
|
15
|
-
translator:
|
|
14
|
+
mdConfig: MarkdownSettings;
|
|
15
|
+
translator: Translator;
|
|
16
16
|
locale: string;
|
|
17
17
|
});
|
|
18
18
|
/**
|
package/types/lib/Sortie.d.ts
CHANGED
|
@@ -15,11 +15,11 @@ declare class Sortie extends WorldstateObject {
|
|
|
15
15
|
* @param {string} deps.locale Locale to use for translations
|
|
16
16
|
*/
|
|
17
17
|
constructor(data: any, { mdConfig, translator, timeDate, sortieData, SortieVariant, locale, }: {
|
|
18
|
-
mdConfig:
|
|
19
|
-
translator:
|
|
20
|
-
timeDate:
|
|
18
|
+
mdConfig: MarkdownSettings;
|
|
19
|
+
translator: Translator;
|
|
20
|
+
timeDate: TimeDateFunctions;
|
|
21
21
|
sortieData: any;
|
|
22
|
-
SortieVariant:
|
|
22
|
+
SortieVariant: SortieVariant;
|
|
23
23
|
locale: string;
|
|
24
24
|
});
|
|
25
25
|
/**
|
|
@@ -37,7 +37,7 @@ declare class Sortie extends WorldstateObject {
|
|
|
37
37
|
* The sortie's variants
|
|
38
38
|
* @type {Array.<SortieVariant>}
|
|
39
39
|
*/
|
|
40
|
-
variants: Array<
|
|
40
|
+
variants: Array<SortieVariant>;
|
|
41
41
|
/**
|
|
42
42
|
* The sortie's boss
|
|
43
43
|
* @type {string}
|
|
@@ -12,8 +12,8 @@ declare class SortieVariant {
|
|
|
12
12
|
* @param {string} deps.locale Locale to use for translations
|
|
13
13
|
*/
|
|
14
14
|
constructor(data: any, { mdConfig, translator, locale, }: {
|
|
15
|
-
mdConfig:
|
|
16
|
-
translator:
|
|
15
|
+
mdConfig: MarkdownSettings;
|
|
16
|
+
translator: Translator;
|
|
17
17
|
sortieData: any;
|
|
18
18
|
locale: string;
|
|
19
19
|
});
|
|
@@ -12,7 +12,7 @@ declare class SyndicateJob extends WorldstateObject {
|
|
|
12
12
|
* @param {string} deps.locale Locale to use for translations
|
|
13
13
|
*/
|
|
14
14
|
constructor(data: any, expiry: Date, { translator, timeDate, locale }: {
|
|
15
|
-
translator:
|
|
15
|
+
translator: Translator;
|
|
16
16
|
locale: string;
|
|
17
17
|
});
|
|
18
18
|
/**
|
|
@@ -13,9 +13,9 @@ declare class SyndicateMission extends WorldstateObject {
|
|
|
13
13
|
* @param {string} deps.locale Locale to use for translations
|
|
14
14
|
*/
|
|
15
15
|
constructor(data: any, { mdConfig, translator, timeDate, locale, }: {
|
|
16
|
-
mdConfig:
|
|
17
|
-
translator:
|
|
18
|
-
timeDate:
|
|
16
|
+
mdConfig: MarkdownSettings;
|
|
17
|
+
translator: Translator;
|
|
18
|
+
timeDate: TimeDateFunctions;
|
|
19
19
|
locale: string;
|
|
20
20
|
});
|
|
21
21
|
/**
|
|
@@ -13,9 +13,9 @@ declare class VoidTrader extends WorldstateObject {
|
|
|
13
13
|
* @param {string} deps.locale Locale to use for translations
|
|
14
14
|
*/
|
|
15
15
|
constructor(data: any, { mdConfig, translator, timeDate, locale, }: {
|
|
16
|
-
mdConfig:
|
|
17
|
-
translator:
|
|
18
|
-
timeDate:
|
|
16
|
+
mdConfig: MarkdownSettings;
|
|
17
|
+
translator: Translator;
|
|
18
|
+
timeDate: TimeDateFunctions;
|
|
19
19
|
locale: string;
|
|
20
20
|
});
|
|
21
21
|
/**
|
|
@@ -50,6 +50,9 @@ declare class VoidTrader extends WorldstateObject {
|
|
|
50
50
|
* @type {string}
|
|
51
51
|
*/
|
|
52
52
|
endString: string;
|
|
53
|
+
initialStart: any;
|
|
54
|
+
completed: any;
|
|
55
|
+
schedule: any;
|
|
53
56
|
}
|
|
54
57
|
import WorldstateObject = require("./WorldstateObject");
|
|
55
58
|
import VoidTraderItem = require("./VoidTraderItem");
|
|
@@ -7,7 +7,7 @@ export = VoidTraderItem;
|
|
|
7
7
|
*/
|
|
8
8
|
declare class VoidTraderItem {
|
|
9
9
|
/**
|
|
10
|
-
* @param {Object} data The
|
|
10
|
+
* @param {Object} data The void trader item data
|
|
11
11
|
* @param {string} data.ItemType Worldstate Item i18n path
|
|
12
12
|
* @param {string} data.PrimePrice Ducat cost of the item
|
|
13
13
|
* @param {string} data.RegularPrice Credit price of the item
|
|
@@ -19,7 +19,7 @@ declare class VoidTraderItem {
|
|
|
19
19
|
ItemType: string;
|
|
20
20
|
PrimePrice: string;
|
|
21
21
|
RegularPrice: string;
|
|
22
|
-
}, { translator, locale }:
|
|
22
|
+
}, { translator, locale }: Dependency);
|
|
23
23
|
item: any;
|
|
24
24
|
ducats: number;
|
|
25
25
|
credits: number;
|
|
@@ -12,9 +12,9 @@ declare class WeeklyChallenge extends WorldstateObject {
|
|
|
12
12
|
* @param {TimeDateFunctions} deps.timeDate The time and date functions
|
|
13
13
|
*/
|
|
14
14
|
constructor(data: any, { timeDate, translator }: {
|
|
15
|
-
mdConfig:
|
|
16
|
-
translator:
|
|
17
|
-
timeDate:
|
|
15
|
+
mdConfig: MarkdownSettings;
|
|
16
|
+
translator: Translator;
|
|
17
|
+
timeDate: TimeDateFunctions;
|
|
18
18
|
});
|
|
19
19
|
challenges: any;
|
|
20
20
|
}
|
|
@@ -10,7 +10,7 @@ export = WorldEvent;
|
|
|
10
10
|
*/
|
|
11
11
|
/**
|
|
12
12
|
* Progress for one of multiple stages
|
|
13
|
-
* @typedef {Object}
|
|
13
|
+
* @typedef {Object} ProgressStep
|
|
14
14
|
*
|
|
15
15
|
* @property {string} type
|
|
16
16
|
* @property {Number} progressAmt
|
|
@@ -31,10 +31,10 @@ declare class WorldEvent extends WorldstateObject {
|
|
|
31
31
|
* @param {string} deps.locale Locale to use for translations
|
|
32
32
|
*/
|
|
33
33
|
constructor(data: any, { mdConfig, translator, timeDate, Reward, locale, }: {
|
|
34
|
-
mdConfig:
|
|
35
|
-
translator:
|
|
36
|
-
timeDate:
|
|
37
|
-
Reward:
|
|
34
|
+
mdConfig: MarkdownSettings;
|
|
35
|
+
translator: Translator;
|
|
36
|
+
timeDate: TimeDateFunctions;
|
|
37
|
+
Reward: Reward;
|
|
38
38
|
locale: string;
|
|
39
39
|
});
|
|
40
40
|
/**
|
|
@@ -102,7 +102,7 @@ declare class WorldEvent extends WorldstateObject {
|
|
|
102
102
|
* The event's rewards
|
|
103
103
|
* @type {Reward[]}
|
|
104
104
|
*/
|
|
105
|
-
rewards:
|
|
105
|
+
rewards: Reward[];
|
|
106
106
|
/**
|
|
107
107
|
* Whether or not this is expired (at time of object creation)
|
|
108
108
|
* @type {boolean}
|
|
@@ -186,7 +186,7 @@ declare class WorldEvent extends WorldstateObject {
|
|
|
186
186
|
getExpired(): boolean;
|
|
187
187
|
}
|
|
188
188
|
declare namespace WorldEvent {
|
|
189
|
-
export { InterimStep,
|
|
189
|
+
export { InterimStep, ProgressStep };
|
|
190
190
|
}
|
|
191
191
|
import WorldstateObject = require("./WorldstateObject");
|
|
192
192
|
/**
|
|
@@ -200,7 +200,7 @@ type InterimStep = {
|
|
|
200
200
|
/**
|
|
201
201
|
* Reward for reaching the step
|
|
202
202
|
*/
|
|
203
|
-
reward:
|
|
203
|
+
reward: Reward;
|
|
204
204
|
/**
|
|
205
205
|
* Amount of players at this step
|
|
206
206
|
*/
|
|
@@ -213,7 +213,7 @@ type InterimStep = {
|
|
|
213
213
|
/**
|
|
214
214
|
* Progress for one of multiple stages
|
|
215
215
|
*/
|
|
216
|
-
type
|
|
216
|
+
type ProgressStep = {
|
|
217
217
|
type: string;
|
|
218
218
|
progressAmt: number;
|
|
219
219
|
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export = Dependency;
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Dependency Object
|
|
5
|
-
*/
|
|
6
|
-
declare type Dependency = {
|
|
7
|
-
/**
|
|
8
|
-
* The markdown settings
|
|
9
|
-
*/
|
|
10
|
-
mdConfig: import("./MarkdownSettings");
|
|
11
|
-
/**
|
|
12
|
-
* The string translator
|
|
13
|
-
*/
|
|
14
|
-
translator: any;
|
|
15
|
-
/**
|
|
16
|
-
* The time and date functions
|
|
17
|
-
*/
|
|
18
|
-
timeDate: any;
|
|
19
|
-
/**
|
|
20
|
-
* The Mission parser
|
|
21
|
-
*/
|
|
22
|
-
Mission: import("./Mission.js");
|
|
23
|
-
/**
|
|
24
|
-
* The Reward parser
|
|
25
|
-
*/
|
|
26
|
-
Reward: import("./Reward.js");
|
|
27
|
-
/**
|
|
28
|
-
* Locale to use for translations
|
|
29
|
-
*/
|
|
30
|
-
locale: string;
|
|
31
|
-
/**
|
|
32
|
-
* Generic logger to use if needed
|
|
33
|
-
*/
|
|
34
|
-
logger: object;
|
|
35
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export = ExternalMission;
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* External mission data retrieved from https://10o.io/kuvalog.json
|
|
5
|
-
*/
|
|
6
|
-
declare type ExternalMission = {
|
|
7
|
-
/**
|
|
8
|
-
* start time
|
|
9
|
-
*/
|
|
10
|
-
activation: Date;
|
|
11
|
-
/**
|
|
12
|
-
* end timer
|
|
13
|
-
*/
|
|
14
|
-
expiry: Date;
|
|
15
|
-
/**
|
|
16
|
-
* formatted node name with planet
|
|
17
|
-
*/
|
|
18
|
-
node: string;
|
|
19
|
-
/**
|
|
20
|
-
* Enemy on tile
|
|
21
|
-
*/
|
|
22
|
-
enemy: string;
|
|
23
|
-
/**
|
|
24
|
-
* Mission type of node
|
|
25
|
-
*/
|
|
26
|
-
type: string;
|
|
27
|
-
/**
|
|
28
|
-
* whether or not the tile requires archwing
|
|
29
|
-
*/
|
|
30
|
-
archwing: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* whether or not the tile requires
|
|
33
|
-
sumbersible archwing
|
|
34
|
-
*/
|
|
35
|
-
sharkwing: boolean;
|
|
36
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export = MarkdownSettings;
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A collection of strings that are used by the parser to produce markdown-formatted text
|
|
5
|
-
*/
|
|
6
|
-
declare type MarkdownSettings = {
|
|
7
|
-
/**
|
|
8
|
-
* Line return character
|
|
9
|
-
*/
|
|
10
|
-
lineEnd: String;
|
|
11
|
-
blockEnd: String;
|
|
12
|
-
doubleReturn: String;
|
|
13
|
-
linkBegin: String;
|
|
14
|
-
linkMid: String;
|
|
15
|
-
linkEnd: String;
|
|
16
|
-
bold: String;
|
|
17
|
-
italic: String;
|
|
18
|
-
underline: String;
|
|
19
|
-
strike: String;
|
|
20
|
-
codeLine: String;
|
|
21
|
-
codeBlock: String;
|
|
22
|
-
};
|