warframe-worldstate-parser 4.6.1 → 5.0.1

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.
Files changed (311) hide show
  1. package/dist/Alert-BS8PWPP3.d.ts +45 -0
  2. package/dist/Alert-DH1kglDU.js +52 -0
  3. package/dist/Archidemea-C0EMRUKc.js +59 -0
  4. package/dist/Archidemea-DOh4trTM.d.ts +55 -0
  5. package/dist/Calendar-CgEkm6e6.d.ts +78 -0
  6. package/dist/Calendar-CtzZQXj7.js +81 -0
  7. package/dist/CambionCycle-C6NHUjOU.js +30 -0
  8. package/dist/CambionCycle-uEBpbMim.d.ts +23 -0
  9. package/dist/CetusCycle-DIZdevob.js +90 -0
  10. package/dist/CetusCycle-ooMM7hkg.d.ts +49 -0
  11. package/dist/ChallengeInstance-Bi2zg4q-.d.ts +53 -0
  12. package/dist/ChallengeInstance-DHwTTwMH.js +48 -0
  13. package/dist/ConclaveChallenge-Dp5yOxVu.js +80 -0
  14. package/dist/ConclaveChallenge-JbcEcL4s.d.ts +76 -0
  15. package/dist/ConstructionProgress-DfcpaGL5.js +25 -0
  16. package/dist/ConstructionProgress-FAySTEod.d.ts +19 -0
  17. package/dist/DailyDeal-BGqZAp-j.js +66 -0
  18. package/dist/DailyDeal-Na-EaiFS.d.ts +66 -0
  19. package/dist/DarkSector-BQ97_8h6.js +138 -0
  20. package/dist/DarkSector-zkCUywz1.d.ts +142 -0
  21. package/dist/DarkSectorBattle-5PyUPhxY.js +53 -0
  22. package/dist/DarkSectorBattle-DY33Bfuq.d.ts +53 -0
  23. package/dist/Dependency-DkOHLql6.d.ts +38 -0
  24. package/dist/DuviriChoice-DRNDUbyc.js +22 -0
  25. package/dist/DuviriChoice-MIHsOBS7.d.ts +18 -0
  26. package/dist/DuviriCycle-B0zp0KxS.d.ts +25 -0
  27. package/dist/DuviriCycle-CmHJStJo.js +58 -0
  28. package/dist/EarthCycle-B9aIOAEY.js +75 -0
  29. package/dist/EarthCycle-RELuZL01.d.ts +60 -0
  30. package/dist/ExternalMission-DCzJkPC8.d.ts +49 -0
  31. package/dist/Fissure-7yFmOet3.js +85 -0
  32. package/dist/Fissure-Bj61i8dc.d.ts +78 -0
  33. package/dist/FlashSale-BxVI0J6A.js +75 -0
  34. package/dist/FlashSale-PDG4uQq4.d.ts +71 -0
  35. package/dist/GlobalUpgrade-BRQXf3JM.d.ts +55 -0
  36. package/dist/GlobalUpgrade-B_TKK1m_.js +58 -0
  37. package/dist/ImgCdn-BnbJ9K-0.js +7 -0
  38. package/dist/Invasion-BMic1K12.js +110 -0
  39. package/dist/Invasion-BskF60zh.d.ts +113 -0
  40. package/dist/Kinepage-CRRKVulq.d.ts +22 -0
  41. package/dist/Kinepage-iWFwTZtr.js +24 -0
  42. package/dist/Kuva-DqkxvPUg.js +85 -0
  43. package/dist/KuvaLogEntry-d5fskHaK.d.ts +21 -0
  44. package/dist/MidrathCycle-BfQtfG4p.d.ts +25 -0
  45. package/dist/MidrathCycle-DDfT7zVx.js +69 -0
  46. package/dist/Mission-CWE16ouO.d.ts +138 -0
  47. package/dist/Mission-ZuSsAYNm.js +140 -0
  48. package/dist/News-7F8Nbp4A.js +122 -0
  49. package/dist/News-BfAgbYSY.d.ts +101 -0
  50. package/dist/Nightwave-DDX0_zJU.js +60 -0
  51. package/dist/Nightwave-_0RzWikV.d.ts +59 -0
  52. package/dist/NightwaveChallenge-DDdrqvge.d.ts +51 -0
  53. package/dist/NightwaveChallenge-DwilvXfi.js +53 -0
  54. package/dist/PersistentEnemy-DRcO4V2r.d.ts +79 -0
  55. package/dist/PersistentEnemy-axYxYzv_.js +76 -0
  56. package/dist/Reward-5VIpHu9A.d.ts +68 -0
  57. package/dist/Reward-OauJ45jJ.js +73 -0
  58. package/dist/RewardData-qEvfHYxA.js +76 -0
  59. package/dist/RewardTypes-Cfq9FeIl.js +328 -0
  60. package/dist/RewardTypes-DYaUn77A.d.ts +34 -0
  61. package/dist/SentientOutpost-B2KZUJ7H.js +65 -0
  62. package/dist/SentientOutpost-DmlClvel.d.ts +47 -0
  63. package/dist/Simaris-B9Mvso2q.js +35 -0
  64. package/dist/Simaris-Bc-jNhED.d.ts +37 -0
  65. package/dist/Sortie-DPv-7SQ-.d.ts +60 -0
  66. package/dist/Sortie-DcoAnEaJ.js +73 -0
  67. package/dist/SortieVariant-BFkYiBho.d.ts +49 -0
  68. package/dist/SortieVariant-eWuI1uh9.js +51 -0
  69. package/dist/SteelPathOffering-DyAzr3P9.js +85 -0
  70. package/dist/SteelPathOffering-OHNTCFo5.d.ts +38 -0
  71. package/dist/SyndicateJob-BK7OMLmv.js +141 -0
  72. package/dist/SyndicateJob-DOtXWjRF.d.ts +76 -0
  73. package/dist/SyndicateMission-5PZIEM8P.js +66 -0
  74. package/dist/SyndicateMission-DmGG5lGy.d.ts +58 -0
  75. package/dist/Tmp-DkQq1arD.js +21 -0
  76. package/dist/VallisCycle-BX8yyKx3.js +76 -0
  77. package/dist/VallisCycle-BXcmzqqG.d.ts +31 -0
  78. package/dist/VoidTrader-CbLMfEVj.js +77 -0
  79. package/dist/VoidTrader-CihLWgSV.d.ts +74 -0
  80. package/dist/VoidTraderItem-BzeD-S6-.js +38 -0
  81. package/dist/VoidTraderItem-CkYAKAEn.d.ts +43 -0
  82. package/dist/VoidTraderSchedule-C-K8Zdfk.js +14 -0
  83. package/dist/VoidTraderSchedule-DKDtu-9d.d.ts +16 -0
  84. package/dist/WeeklyChallenge-C6sc4j7i.d.ts +20 -0
  85. package/dist/WeeklyChallenge-MzUEZAjv.js +21 -0
  86. package/dist/WorldEvent-BS9QHG_f.d.ts +205 -0
  87. package/dist/WorldEvent-nis9w9cn.js +213 -0
  88. package/dist/WorldState-DNSPrZR_.d.ts +257 -0
  89. package/dist/WorldState-uppX0Xt1.js +330 -0
  90. package/dist/WorldstateObject-BSTYuZwm.js +54 -0
  91. package/dist/WorldstateObject-wfRTeGpm.d.ts +48 -0
  92. package/dist/ZarimanCycle-BJ84QUFg.js +81 -0
  93. package/dist/ZarimanCycle-CjNQXhVO.d.ts +45 -0
  94. package/dist/lib/Tmp.d.ts +24 -0
  95. package/dist/lib/Tmp.js +6 -0
  96. package/dist/lib/WorldState.d.ts +47 -0
  97. package/dist/lib/WorldState.js +49 -0
  98. package/dist/lib/models/Alert.d.ts +8 -0
  99. package/dist/lib/models/Alert.js +9 -0
  100. package/dist/lib/models/Archidemea.d.ts +2 -0
  101. package/dist/lib/models/Archidemea.js +3 -0
  102. package/dist/lib/models/Calendar.d.ts +3 -0
  103. package/dist/lib/models/Calendar.js +4 -0
  104. package/dist/lib/models/CambionCycle.d.ts +4 -0
  105. package/dist/lib/models/CambionCycle.js +4 -0
  106. package/dist/lib/models/CetusCycle.d.ts +3 -0
  107. package/dist/lib/models/CetusCycle.js +4 -0
  108. package/dist/lib/models/ChallengeInstance.d.ts +4 -0
  109. package/dist/lib/models/ChallengeInstance.js +3 -0
  110. package/dist/lib/models/ConclaveChallenge.d.ts +5 -0
  111. package/dist/lib/models/ConclaveChallenge.js +4 -0
  112. package/dist/lib/models/ConstructionProgress.d.ts +3 -0
  113. package/dist/lib/models/ConstructionProgress.js +4 -0
  114. package/dist/lib/models/DailyDeal.d.ts +5 -0
  115. package/dist/lib/models/DailyDeal.js +4 -0
  116. package/dist/lib/models/DarkSector.d.ts +9 -0
  117. package/dist/lib/models/DarkSector.js +10 -0
  118. package/dist/lib/models/DarkSectorBattle.d.ts +3 -0
  119. package/dist/lib/models/DarkSectorBattle.js +3 -0
  120. package/dist/lib/models/DuviriCycle.d.ts +4 -0
  121. package/dist/lib/models/DuviriCycle.js +4 -0
  122. package/dist/lib/models/EarthCycle.d.ts +3 -0
  123. package/dist/lib/models/EarthCycle.js +4 -0
  124. package/dist/lib/models/Fissure.d.ts +5 -0
  125. package/dist/lib/models/Fissure.js +4 -0
  126. package/dist/lib/models/FlashSale.d.ts +5 -0
  127. package/dist/lib/models/FlashSale.js +4 -0
  128. package/dist/lib/models/GlobalUpgrade.d.ts +5 -0
  129. package/dist/lib/models/GlobalUpgrade.js +4 -0
  130. package/dist/lib/models/Invasion.d.ts +7 -0
  131. package/dist/lib/models/Invasion.js +8 -0
  132. package/dist/lib/models/Kinepage.d.ts +2 -0
  133. package/dist/lib/models/Kinepage.js +3 -0
  134. package/dist/lib/models/Kuva.d.ts +22 -0
  135. package/dist/lib/models/Kuva.js +3 -0
  136. package/dist/lib/models/MidrathCycle.d.ts +3 -0
  137. package/dist/lib/models/MidrathCycle.js +4 -0
  138. package/dist/lib/models/Mission.d.ts +6 -0
  139. package/dist/lib/models/Mission.js +7 -0
  140. package/dist/lib/models/News.d.ts +3 -0
  141. package/dist/lib/models/News.js +5 -0
  142. package/dist/lib/models/Nightwave.d.ts +4 -0
  143. package/dist/lib/models/Nightwave.js +5 -0
  144. package/dist/lib/models/NightwaveChallenge.d.ts +3 -0
  145. package/dist/lib/models/NightwaveChallenge.js +4 -0
  146. package/dist/lib/models/PersistentEnemy.d.ts +3 -0
  147. package/dist/lib/models/PersistentEnemy.js +4 -0
  148. package/dist/lib/models/Reward.d.ts +5 -0
  149. package/dist/lib/models/Reward.js +6 -0
  150. package/dist/lib/models/SentientOutpost.d.ts +4 -0
  151. package/dist/lib/models/SentientOutpost.js +3 -0
  152. package/dist/lib/models/Simaris.d.ts +4 -0
  153. package/dist/lib/models/Simaris.js +3 -0
  154. package/dist/lib/models/Sortie.d.ts +9 -0
  155. package/dist/lib/models/Sortie.js +10 -0
  156. package/dist/lib/models/SortieVariant.d.ts +4 -0
  157. package/dist/lib/models/SortieVariant.js +3 -0
  158. package/dist/lib/models/SteelPathOffering.d.ts +2 -0
  159. package/dist/lib/models/SteelPathOffering.js +3 -0
  160. package/dist/lib/models/SyndicateJob.d.ts +5 -0
  161. package/dist/lib/models/SyndicateJob.js +4 -0
  162. package/dist/lib/models/SyndicateMission.d.ts +6 -0
  163. package/dist/lib/models/SyndicateMission.js +5 -0
  164. package/dist/lib/models/VallisCycle.d.ts +3 -0
  165. package/dist/lib/models/VallisCycle.js +4 -0
  166. package/dist/lib/models/VoidTrader.d.ts +7 -0
  167. package/dist/lib/models/VoidTrader.js +6 -0
  168. package/dist/lib/models/VoidTraderItem.d.ts +4 -0
  169. package/dist/lib/models/VoidTraderItem.js +3 -0
  170. package/dist/lib/models/VoidTraderSchedule.d.ts +4 -0
  171. package/dist/lib/models/VoidTraderSchedule.js +3 -0
  172. package/dist/lib/models/WeeklyChallenge.d.ts +6 -0
  173. package/dist/lib/models/WeeklyChallenge.js +5 -0
  174. package/dist/lib/models/WorldEvent.d.ts +8 -0
  175. package/dist/lib/models/WorldEvent.js +9 -0
  176. package/dist/lib/models/WorldstateObject.d.ts +2 -0
  177. package/dist/lib/models/WorldstateObject.js +3 -0
  178. package/dist/lib/models/ZarimanCycle.d.ts +3 -0
  179. package/dist/lib/models/ZarimanCycle.js +4 -0
  180. package/dist/lib/supporting/Dependency.d.ts +3 -0
  181. package/dist/lib/supporting/Dependency.js +1 -0
  182. package/dist/lib/supporting/DuviriChoice.d.ts +3 -0
  183. package/dist/lib/supporting/DuviriChoice.js +3 -0
  184. package/dist/lib/supporting/ExternalMission.d.ts +2 -0
  185. package/dist/lib/supporting/ExternalMission.js +1 -0
  186. package/dist/lib/supporting/ImgCdn.d.ts +6 -0
  187. package/dist/lib/supporting/ImgCdn.js +3 -0
  188. package/dist/lib/supporting/KuvaLogEntry.d.ts +2 -0
  189. package/dist/lib/supporting/KuvaLogEntry.js +1 -0
  190. package/dist/lib/supporting/RewardData.d.ts +11 -0
  191. package/dist/lib/supporting/RewardData.js +3 -0
  192. package/dist/lib/supporting/RewardTypes.d.ts +2 -0
  193. package/dist/lib/supporting/RewardTypes.js +5 -0
  194. package/dist/main.d.ts +47 -0
  195. package/dist/main.js +49 -0
  196. package/dist/resources/.gitkeep +1 -0
  197. package/dist/resources/alt_helmet_thumb.png +0 -0
  198. package/dist/resources/aura_thumb.png +0 -0
  199. package/dist/resources/clantech_thmb.png +0 -0
  200. package/dist/resources/endo_thumb.png +0 -0
  201. package/dist/resources/exilus_thumb.png +0 -0
  202. package/dist/resources/forma_thumb.png +0 -0
  203. package/dist/resources/glaive_thumb.png +0 -0
  204. package/dist/resources/mutalist_thumb.png +0 -0
  205. package/dist/resources/nightmare_thumb.png +0 -0
  206. package/dist/resources/nitain_thumb.png +0 -0
  207. package/dist/resources/potato_thumb.png +0 -0
  208. package/dist/resources/resource_thumb.png +0 -0
  209. package/dist/resources/vauban_thumb.png +0 -0
  210. package/dist/resources/weapon_skin_thumb.png +0 -0
  211. package/package.json +9 -11
  212. package/lib/WorldState.js +0 -404
  213. package/lib/models/Alert.js +0 -90
  214. package/lib/models/Calendar.js +0 -74
  215. package/lib/models/CambionCycle.js +0 -32
  216. package/lib/models/CetusCycle.js +0 -126
  217. package/lib/models/ChallengeInstance.js +0 -57
  218. package/lib/models/ConclaveChallenge.js +0 -154
  219. package/lib/models/ConstructionProgress.js +0 -31
  220. package/lib/models/DailyDeal.js +0 -103
  221. package/lib/models/DarkSector.js +0 -154
  222. package/lib/models/DarkSectorBattle.js +0 -56
  223. package/lib/models/DeepArchidemea.js +0 -33
  224. package/lib/models/DuviriCycle.js +0 -65
  225. package/lib/models/EarthCycle.js +0 -119
  226. package/lib/models/Fissure.js +0 -136
  227. package/lib/models/FlashSale.js +0 -123
  228. package/lib/models/GlobalUpgrade.js +0 -122
  229. package/lib/models/Invasion.js +0 -183
  230. package/lib/models/Kinepage.js +0 -11
  231. package/lib/models/Kuva.js +0 -122
  232. package/lib/models/MidrathCycle.js +0 -94
  233. package/lib/models/Mission.js +0 -179
  234. package/lib/models/News.js +0 -174
  235. package/lib/models/Nightwave.js +0 -91
  236. package/lib/models/NightwaveChallenge.js +0 -63
  237. package/lib/models/PersistentEnemy.js +0 -100
  238. package/lib/models/Reward.js +0 -111
  239. package/lib/models/SentientOutpost.js +0 -68
  240. package/lib/models/Simaris.js +0 -47
  241. package/lib/models/Sortie.js +0 -143
  242. package/lib/models/SortieVariant.js +0 -57
  243. package/lib/models/SteelPathOffering.js +0 -99
  244. package/lib/models/SyndicateJob.js +0 -185
  245. package/lib/models/SyndicateMission.js +0 -111
  246. package/lib/models/VallisCycle.js +0 -125
  247. package/lib/models/VoidTrader.js +0 -134
  248. package/lib/models/VoidTraderItem.js +0 -24
  249. package/lib/models/VoidTraderSchedule.js +0 -8
  250. package/lib/models/WeeklyChallenge.js +0 -27
  251. package/lib/models/WorldEvent.js +0 -326
  252. package/lib/models/WorldstateObject.js +0 -106
  253. package/lib/models/ZarimanCycle.js +0 -124
  254. package/lib/supporting/Dependency.js +0 -6
  255. package/lib/supporting/DuviriChoice.js +0 -16
  256. package/lib/supporting/ExternalMission.js +0 -13
  257. package/lib/supporting/ImgCdn.js +0 -9
  258. package/lib/supporting/MarkdownSettings.js +0 -30
  259. package/lib/supporting/RewardData.js +0 -77
  260. package/lib/supporting/RewardTypes.js +0 -327
  261. package/main.js +0 -4
  262. package/types/lib/WorldState.d.ts +0 -199
  263. package/types/lib/models/Alert.d.ts +0 -53
  264. package/types/lib/models/Calendar.d.ts +0 -16
  265. package/types/lib/models/CambionCycle.d.ts +0 -20
  266. package/types/lib/models/CetusCycle.d.ts +0 -47
  267. package/types/lib/models/ChallengeInstance.d.ts +0 -42
  268. package/types/lib/models/ConclaveChallenge.d.ts +0 -90
  269. package/types/lib/models/ConstructionProgress.d.ts +0 -14
  270. package/types/lib/models/DailyDeal.d.ts +0 -78
  271. package/types/lib/models/DarkSector.d.ts +0 -121
  272. package/types/lib/models/DarkSectorBattle.d.ts +0 -44
  273. package/types/lib/models/DeepArchidemea.d.ts +0 -8
  274. package/types/lib/models/DuviriCycle.d.ts +0 -21
  275. package/types/lib/models/EarthCycle.d.ts +0 -64
  276. package/types/lib/models/Fissure.d.ts +0 -83
  277. package/types/lib/models/FlashSale.d.ts +0 -86
  278. package/types/lib/models/GlobalUpgrade.d.ts +0 -86
  279. package/types/lib/models/Invasion.d.ts +0 -124
  280. package/types/lib/models/Kinepage.d.ts +0 -6
  281. package/types/lib/models/Kuva.d.ts +0 -60
  282. package/types/lib/models/MidrathCycle.d.ts +0 -39
  283. package/types/lib/models/Mission.d.ts +0 -136
  284. package/types/lib/models/News.d.ts +0 -104
  285. package/types/lib/models/Nightwave.d.ts +0 -53
  286. package/types/lib/models/NightwaveChallenge.d.ts +0 -45
  287. package/types/lib/models/PersistentEnemy.d.ts +0 -70
  288. package/types/lib/models/Reward.d.ts +0 -95
  289. package/types/lib/models/SentientOutpost.d.ts +0 -54
  290. package/types/lib/models/Simaris.d.ts +0 -33
  291. package/types/lib/models/Sortie.d.ts +0 -72
  292. package/types/lib/models/SortieVariant.d.ts +0 -43
  293. package/types/lib/models/SteelPathOffering.d.ts +0 -19
  294. package/types/lib/models/SyndicateJob.d.ts +0 -72
  295. package/types/lib/models/SyndicateMission.d.ts +0 -56
  296. package/types/lib/models/VallisCycle.d.ts +0 -53
  297. package/types/lib/models/VoidTrader.d.ts +0 -45
  298. package/types/lib/models/VoidTraderItem.d.ts +0 -25
  299. package/types/lib/models/VoidTraderSchedule.d.ts +0 -7
  300. package/types/lib/models/WeeklyChallenge.d.ts +0 -12
  301. package/types/lib/models/WorldEvent.d.ts +0 -216
  302. package/types/lib/models/WorldstateObject.d.ts +0 -120
  303. package/types/lib/models/ZarimanCycle.d.ts +0 -42
  304. package/types/lib/supporting/Dependency.d.ts +0 -7
  305. package/types/lib/supporting/DuviriChoice.d.ts +0 -9
  306. package/types/lib/supporting/ExternalMission.d.ts +0 -48
  307. package/types/lib/supporting/ImgCdn.d.ts +0 -3
  308. package/types/lib/supporting/MarkdownSettings.d.ts +0 -30
  309. package/types/lib/supporting/RewardData.d.ts +0 -9
  310. package/types/lib/supporting/RewardTypes.d.ts +0 -8
  311. package/types/main.d.ts +0 -3
@@ -1,122 +0,0 @@
1
- import {
2
- parseDate,
3
- fromNow,
4
- timeDeltaToString,
5
- upgrade,
6
- operation,
7
- operationSymbol,
8
- } from 'warframe-worldstate-data/utilities';
9
-
10
- import mdConfig from '../supporting/MarkdownSettings.js';
11
- /**
12
- * Represents an upgrade that applies to all players
13
- */
14
- export default class GlobalUpgrade {
15
- /**
16
- * @param {object} data The global upgrade data
17
- * @param {object} deps The dependencies object
18
- * @param {string} deps.locale Locale to use for translations
19
- */
20
- constructor(data, { locale = 'en' } = { locale: 'en' }) {
21
- if (!data.Activation || !data.ExpiryDate) {
22
- throw new TypeError('The provided data does not have the required properties.');
23
- }
24
-
25
- /**
26
- * The time and date at which the global upgrade starts being active
27
- * @type {Date}
28
- */
29
- this.activation = parseDate(data.Activation);
30
- /**
31
- * @deprecated Use `activation` instead
32
- */
33
- this.start = this.activation;
34
-
35
- /**
36
- * The time and date at which the global upgrade stops being active
37
- * @type {Date}
38
- */
39
- this.expiry = parseDate(data.ExpiryDate);
40
- /**
41
- * @deprecated Use `expiry` instead
42
- */
43
- this.end = parseDate(data.ExpiryDate);
44
-
45
- /**
46
- * The effect of the upgrade
47
- * @type {string}
48
- */
49
- this.upgrade = upgrade(data.UpgradeType, locale);
50
-
51
- /**
52
- * The operation type
53
- * @type {string}
54
- */
55
- this.operation = operation(data.OperationType, locale);
56
-
57
- /**
58
- * Symbol for operation
59
- * @type {string}
60
- */
61
- this.operationSymbol = operationSymbol(data.OperationType, locale);
62
-
63
- /**
64
- * The operation value
65
- * @type {string}
66
- */
67
- this.upgradeOperationValue = data.Value;
68
-
69
- /**
70
- * Whether or not this is expired (at time of object creation)
71
- * @type {boolean}
72
- */
73
- this.expired = this.getExpired();
74
-
75
- /**
76
- * ETA string (at time of object creation)
77
- * @type {string}
78
- */
79
- this.eta = this.getETAString();
80
-
81
- /**
82
- * Plaintext description of upgrade
83
- * @type {string}
84
- */
85
- this.desc = this.compileDesription();
86
- }
87
-
88
- /**
89
- * Get whether or not the event has expired
90
- * @returns {boolean} whether the event has expired
91
- */
92
- getExpired() {
93
- return fromNow(this.end) < 0;
94
- }
95
-
96
- /**
97
- * Get a string indicating how long it will take for the upgrade to expire
98
- * @returns {string} estimated timer of the upgrade
99
- */
100
- getETAString() {
101
- return timeDeltaToString(fromNow(this.end));
102
- }
103
-
104
- /**
105
- * Turn the global upgrade into a plain text description
106
- * @returns {string} Descriptio
107
- */
108
- compileDesription() {
109
- return `${this.upgradeOperationValue}${this.operationSymbol} ${this.upgrade} for ${this.eta}`;
110
- }
111
-
112
- /**
113
- * Returns a string representation of the upgrade
114
- * @returns {string} string representation
115
- */
116
- toString() {
117
- return (
118
- `${mdConfig.codeBlock}[${this.getETAString()}] ${this.upgrade}` +
119
- `${this.operation} ${this.upgradeOperationValue}${mdConfig.blockEnd}`
120
- );
121
- }
122
- }
@@ -1,183 +0,0 @@
1
- import { parseDate, timeDeltaToString, toNow, node, languageString, faction } from 'warframe-worldstate-data/utilities';
2
-
3
- import mdConfig from '../supporting/MarkdownSettings.js';
4
-
5
- import Reward from './Reward.js';
6
- import WorldstateObject from './WorldstateObject.js';
7
- /**
8
- * An invasion participant
9
- * @typedef {object} InvasionParticipant
10
- * @property {string} reward Reward for supporting this participant in the invasion
11
- * @property {string} faction Faction of this participant (localized)
12
- * @property {string} factionKey Faction of this participant (always English)
13
- */
14
-
15
- /**
16
- * Represents an invasion
17
- */
18
- export default class Invasion extends WorldstateObject {
19
- /**
20
- * @param {object} data The invasion data
21
- * @param {Dependency} deps The dependencies object
22
- * @param {string} deps.locale Locale to use for translations
23
- */
24
- constructor(data, { locale = 'en' } = { locale: 'en' }) {
25
- super(data);
26
-
27
- const opts = {
28
- locale,
29
- };
30
-
31
- /**
32
- * The node where the invasion is taking place
33
- * @type {string}
34
- */
35
- this.node = node(data.Node, locale);
36
-
37
- /**
38
- * The node key where the invasion is taking place
39
- * @type {string}
40
- */
41
- this.nodeKey = node(data.Node);
42
-
43
- /**
44
- * The invasion's description
45
- * @type {string}
46
- */
47
- this.desc = languageString(data.LocTag, locale);
48
-
49
- /**
50
- * The attacking faction
51
- * @type {string}
52
- */
53
- this.attackingFaction = faction(data.DefenderMissionInfo.faction, locale);
54
-
55
- /**
56
- * Invasion attacker
57
- * @type {InvasionParticipant}
58
- */
59
- this.attacker = {
60
- reward: Object.keys(data?.AttackerReward || {})?.length ? new Reward(data.AttackerReward, opts) : undefined,
61
- faction: faction(data.DefenderMissionInfo.faction, locale),
62
- factionKey: faction(data.DefenderMissionInfo.faction, 'en'),
63
- };
64
-
65
- /**
66
- * Invasion defender
67
- * @type {InvasionParticipant}
68
- */
69
- this.defender = {
70
- reward: Object.keys(data?.DefenderReward || {})?.length ? new Reward(data.DefenderReward, opts) : undefined,
71
- faction: faction(data.AttackerMissionInfo.faction, locale),
72
- factionKey: faction(data.AttackerMissionInfo.faction, 'en'),
73
- };
74
-
75
- /**
76
- * Whether this invasion is against the infestation
77
- * @type {boolean}
78
- */
79
- this.vsInfestation = /infest/i.test(data.DefenderMissionInfo.faction);
80
-
81
- /**
82
- * The time at which the invasion starts
83
- * @type {Date}
84
- */
85
- this.activation = parseDate(data.Activation);
86
-
87
- /**
88
- * The signed count of completed runs. Supporting the attackers makes the count go up,
89
- * supporting the defenders makes it go down
90
- * @type {number}
91
- */
92
- this.count = data.Count;
93
-
94
- /**
95
- * The number of runs that one side needs to win
96
- * @type {number}
97
- */
98
- this.requiredRuns = data.Goal;
99
-
100
- /**
101
- * The invasion's completion percentage. Defenders win if it gets to 0
102
- * Grineer vs. Corpus invasions start at 50, Infested invasions start at 100
103
- * @type {number}
104
- */
105
- this.completion = (1 + data.Count / data.Goal) * (this.vsInfestation ? 100 : 50);
106
-
107
- /**
108
- * Whether the invasion has finished
109
- * @type {boolean}
110
- */
111
- this.completed = data.Completed;
112
-
113
- /**
114
- * ETA string (at time of object creation)
115
- * @type {string}
116
- */
117
- this.eta = this.getETAString();
118
-
119
- /**
120
- * An array containing the types of all of the invasions's rewards
121
- * @type {Array.<string>}
122
- */
123
- this.rewardTypes = this.getRewardTypes();
124
- }
125
-
126
- /**
127
- * Whether or not the attackers are winning.
128
- * This is always false when the infestation is attacking
129
- * @returns {boolean} whether the attacker is winning
130
- */
131
- isAttackerWinning() {
132
- return this.count > 0;
133
- }
134
-
135
- /**
136
- * Get an estimation of how much time is left before the invasion ends in milliseconds
137
- * @returns {number} remaining time in ms
138
- */
139
- getRemainingTime() {
140
- const completedRuns = Math.abs(this.count);
141
- const elapsedMillis = toNow(this.activation);
142
- const remainingRuns = this.requiredRuns - completedRuns;
143
- return remainingRuns * (elapsedMillis / completedRuns);
144
- }
145
-
146
- /**
147
- * Get a string estimating how much time is left before the invasion ends
148
- * @returns {string} time delta string from now to the end
149
- */
150
- getETAString() {
151
- return timeDeltaToString(this.getRemainingTime());
152
- }
153
-
154
- /**
155
- * Get the types of the items being rewarded in the invasion
156
- * @returns {Array<string>} types of items being rewarded
157
- */
158
- getRewardTypes() {
159
- return [...(this.attacker.reward?.getTypes() ?? []), ...(this.defender.reward?.getTypes() ?? [])];
160
- }
161
-
162
- /**
163
- * The invasion's string representation
164
- * @returns {string} string representation of the invasion
165
- */
166
- toString() {
167
- let lines = [];
168
- if (this.vsInfestation) {
169
- lines = [
170
- this.defender.reward?.toString(),
171
- `${this.desc} on ${this.node}`,
172
- `${Math.round(this.completion * 100) / 100}% - ETA: ${this.getETAString()}`,
173
- ].filter(Boolean);
174
- } else {
175
- lines = [
176
- `${this.attackingFaction} (${this.attacker.reward}) vs. ${this.defender.faction} (${this.defender.reward})`,
177
- `${this.node} - ${this.desc}`,
178
- `${Math.round(this.completion * 100) / 100}% - ETA: ${this.getETAString()}`,
179
- ];
180
- }
181
- return `${mdConfig.codeBlock}${lines.join(mdConfig.lineEnd)}${mdConfig.blockEnd}`;
182
- }
183
- }
@@ -1,11 +0,0 @@
1
- export default class Kinepage {
2
- constructor(data, locale = 'en') {
3
- this.timestamp = new Date(Number(data.ts) * 1000);
4
-
5
- const translations = Object.fromEntries(Object.entries(data).filter(([key]) => key !== 'ts'));
6
-
7
- this.message = translations[locale] || data.en;
8
-
9
- this.translations = Object.fromEntries(Object.entries(translations).filter(([key]) => key !== locale));
10
- }
11
- }
@@ -1,122 +0,0 @@
1
- import { createHash } from 'node:crypto';
2
-
3
- import { node, nodeMissionType } from 'warframe-worldstate-data/utilities';
4
-
5
- /**
6
- * External mission data retrieved from https://10o.io/kuvalog.json
7
- * @typedef {object} ExternalMission
8
- * @property {Date} activation start time
9
- * @property {Date} expiry end timer
10
- * @property {string} node formatted node name with planet
11
- * @property {string} enemy Enemy on tile
12
- * @property {string} type Mission type of node
13
- * @property {boolean} archwing whether or not the tile requires archwing
14
- * @property {boolean} sharkwing whether or not the tile requires
15
- * sumbersible archwing
16
- */
17
-
18
- /**
19
- * Stores and parses kuva data from https://10o.io/kuvalog.json
20
- * @typedef {object} Kuva
21
- * @property {ExternalMission[]} kuva currently active kuva missions
22
- * @property {ExternalMission} arbitration current arbitration
23
- */
24
-
25
- const HOURS_2 = 7200000;
26
-
27
- /**
28
- * Truncate time for a semlar-provided mission
29
- * @param {object} mission parsed mission with re-aligned field names
30
- */
31
- const truncateTime = (mission) => {
32
- mission.expiry.setHours(mission.activation.getHours() + 1);
33
- mission.expiry.setMinutes(4);
34
- mission.expiry.setSeconds(0);
35
- mission.expiry.setMilliseconds(0);
36
- mission.activation.setMinutes(mission.activation.getMinutes() + 5.1);
37
- };
38
-
39
- /**
40
- * Scrub unnecessary details from the mission
41
- * @param {object} mission parsed mission with re-aligned field names
42
- */
43
- const scrub = (mission) => {
44
- /* eslint-disable no-param-reassign */
45
- delete mission.solnode;
46
- delete mission.name;
47
- delete mission.node_type;
48
- delete mission.tile;
49
- delete mission.planet;
50
- /* eslint-enable no-param-reassign */
51
- };
52
-
53
- const hash = (str) => createHash('sha256').update(str, 'utf8').digest('hex');
54
-
55
- /**
56
- * Parse kuva & arbitration data
57
- * @param {object} data Data to split for kuva/arbitration
58
- * @param {string} locale locale to translate
59
- * @returns {Kuva} Split parsed data
60
- */
61
- const parse = (data, locale) => {
62
- const parsed = { kuva: [], arbitration: {} };
63
- const now = new Date();
64
- if (!data) return undefined;
65
- data?.forEach?.((mission) => {
66
- const p = {
67
- activation: new Date(mission.start),
68
- expiry: new Date(mission.end),
69
- ...mission.solnodedata,
70
- node: node(mission.solnode, locale),
71
- nodeKey: node(mission.solnode, 'en'),
72
- type: nodeMissionType(mission.solnode, locale),
73
- typeKey: nodeMissionType(mission.solnode, 'en'),
74
- };
75
- truncateTime(p);
76
- p.id = hash(JSON.stringify(p));
77
- p.expired = Date.now() - p.expiry.getTime() < 0;
78
-
79
- if (
80
- p.activation < now &&
81
- now < p.expiry &&
82
- new Date(p.activation.getTime() + HOURS_2) > now &&
83
- new Date(p.expiry.getTime() - HOURS_2) < now
84
- ) {
85
- if (mission.missiontype === 'EliteAlertMission') {
86
- // if the diff is less than 2 hours?
87
- parsed.arbitration = p;
88
- }
89
- if (mission.missiontype.startsWith('KuvaMission')) parsed.kuva.push(p);
90
- }
91
- scrub(p);
92
- });
93
- parsed.kuva = Array.from(new Set(parsed.kuva));
94
-
95
- return parsed;
96
- };
97
-
98
- /**
99
- * Stores and parses kuva data from https://10o.io/kuvalog.json
100
- * @property {ExternalMission[]} kuva currently active kuva missions
101
- * @property {ExternalMission} arbitration current arbitration
102
- */
103
- export default class Kuva {
104
- #locale;
105
-
106
- constructor({ kuvaData, locale, logger }) {
107
- /**
108
- * The locale to leverage for translations
109
- * @type {string}
110
- * @private
111
- */
112
- this.#locale = locale;
113
-
114
- if (!kuvaData) {
115
- // eslint-ignore-next-line no-console
116
- logger.debug('No defined kuva data, skipping data');
117
- } else {
118
- const parsed = parse(kuvaData, this.locale);
119
- ({ kuva: this.kuva, arbitration: this.arbitration } = parsed);
120
- }
121
- }
122
- }
@@ -1,94 +0,0 @@
1
- import { timeDeltaToString, fromNow } from 'warframe-worldstate-data/utilities';
2
-
3
- import mdConfig from '../supporting/MarkdownSettings.js';
4
-
5
- import WorldstateObject from './WorldstateObject.js';
6
-
7
- /**
8
- * @typedef {object} MidrathCycle
9
- * @property {Date} expiry The date and time at which the event ends
10
- * @property {Date} activation The date and time at which the event started
11
- * @property {boolean} isDay Whether or not this it's daytime
12
- * @property {string} state Current cycle state. One of `day`, `night`
13
- * @property {string} timeLeft Time remaining string
14
- * @property {boolean} expired Whether or not the event has expired
15
- */
16
-
17
- /**
18
- * Get the current Midrath cycle time
19
- * @returns {MidrathCycle} Current midrath cycle time
20
- */
21
- function getCurrentMidrathCycle() {
22
- const dayDuration = 32 * 60 * 1000; // 32 minutes in milliseconds
23
- const nightDuration = 16 * 60 * 1000; // 16 minutes in milliseconds
24
- const totalDuration = dayDuration + nightDuration;
25
-
26
- const refPoint = Date.parse('2025-08-07T16:05:29Z');
27
- const now = Date.now();
28
- const elapsedInCycle = (now - refPoint) % totalDuration;
29
- const isDay = elapsedInCycle < dayDuration;
30
-
31
- let phase = {
32
- name: 'night',
33
- remaining: totalDuration - elapsedInCycle,
34
- duration: nightDuration,
35
- };
36
-
37
- if (isDay) {
38
- phase = {
39
- name: 'day',
40
- remaining: dayDuration - elapsedInCycle,
41
- duration: dayDuration,
42
- };
43
- }
44
-
45
- const activation = new Date(now - (phase.duration - phase.remaining));
46
- const expiry = new Date(activation.getTime() + phase.duration);
47
- const timeLeft = timeDeltaToString(phase.remaining);
48
-
49
- return {
50
- activation,
51
- expiry,
52
- state: phase.name,
53
- timeLeft,
54
- isDay,
55
- };
56
- }
57
-
58
- export default class MidrathCycle extends WorldstateObject {
59
- #mc = getCurrentMidrathCycle();
60
- constructor() {
61
- super({ _id: { $oid: 'midrathCycle0' } });
62
-
63
- this.activation = this.#mc.activation;
64
-
65
- this.expiry = this.#mc.expiry;
66
-
67
- this.isDay = this.#mc.isDay;
68
-
69
- this.state = this.#mc.state;
70
-
71
- this.timeLeft = this.#mc.timeLeft;
72
- }
73
-
74
- /**
75
- * Get whether or not the event has expired
76
- * @returns {boolean} Whether or not the event has expired
77
- */
78
- getExpired() {
79
- return fromNow(this.expiry) < 0;
80
- }
81
-
82
- /**
83
- * The event's string representation
84
- * @returns {string} The string representation of the event
85
- */
86
- toString() {
87
- const lines = [
88
- `Envoy, it is currently ${this.isDay ? 'Day' : 'Night'}time in Midrath`,
89
- `Time remaining until ${this.isDay ? 'night' : 'day'}: ${this.timeLeft}`,
90
- ];
91
-
92
- return lines.join(mdConfig.lineEnd);
93
- }
94
- }
@@ -1,179 +0,0 @@
1
- import { languageString, faction, missionType, node, insist } from 'warframe-worldstate-data/utilities';
2
-
3
- import mdConfig from '../supporting/MarkdownSettings.js';
4
-
5
- import Reward from './Reward.js';
6
-
7
- /**
8
- * Represents an in-game mission
9
- */
10
- export default class Mission {
11
- /**
12
- * @param {object} data The mission data
13
- * @param {string} locale Locale to use for translations
14
- */
15
- constructor(data, { locale = 'en' } = { locale: 'en' }) {
16
- const deps = {
17
- locale,
18
- };
19
- insist(data);
20
-
21
- /**
22
- * The mission's description
23
- * @type {?string}
24
- */
25
- this.description = languageString(data.descText, locale);
26
-
27
- /**
28
- * The node where the mission takes place
29
- * @type {string}
30
- */
31
- this.node = node(data.location || data.node, locale);
32
-
33
- /**
34
- * Unlocalized {@link mission#node}
35
- * @type {string}
36
- */
37
- this.nodeKey = node(data.location || data.node, 'en');
38
-
39
- /**
40
- * The mission's type
41
- * @type {string}
42
- */
43
- this.type = missionType(data.missionType, locale);
44
-
45
- /**
46
- * The mission's type
47
- * @type {string}
48
- */
49
- this.typeKey = missionType(data.missionType, 'en');
50
-
51
- /**
52
- * The factions that the players must fight in the mission
53
- * @type {string}
54
- */
55
- this.faction = faction(data.faction, locale);
56
-
57
- /**
58
- * The factions that the players must fight in the mission
59
- * @type {string}
60
- */
61
- this.factionKey = faction(data.faction, 'en');
62
-
63
- /**
64
- * The mission's reward
65
- * @type {?Reward}
66
- */
67
- this.reward = data.missionReward ? new Reward(data.missionReward, deps) : undefined;
68
-
69
- /**
70
- * The minimum level of the enemies in the mission
71
- * @type {number}
72
- */
73
- this.minEnemyLevel = data.minEnemyLevel;
74
-
75
- /**
76
- * The maximum level of the enemies in the mission
77
- * @type {number}
78
- */
79
- this.maxEnemyLevel = data.maxEnemyLevel;
80
-
81
- /**
82
- * The number of waves that the players need to complete (undefined if not applicable)
83
- * @type {?number}
84
- */
85
- this.maxWaveNum = data.maxWaveNum;
86
-
87
- /**
88
- * The Mission's nightmare boolean
89
- * @type {boolean}
90
- */
91
- this.nightmare = data.nightmare || false;
92
-
93
- /**
94
- * The Mission's archwing requirement
95
- * @type {boolean}
96
- */
97
- this.archwingRequired = data.archwingRequired || false;
98
-
99
- /**
100
- * The Mission's sharkwing requirement
101
- * @type {boolean}
102
- */
103
- this.isSharkwing = data.isSharkwingMission || false;
104
-
105
- /**
106
- * Override for the map on this mission
107
- * @type {string}
108
- */
109
- this.levelOverride = languageString(data.levelOverride, locale);
110
-
111
- /**
112
- * Enemy specification for the mission
113
- * @type {string}
114
- */
115
- this.enemySpec = languageString(data.enemySpec, locale);
116
-
117
- /**
118
- * Array of strings denoting extra spawners for a mission
119
- * @type {string[]}
120
- */
121
- this.advancedSpawners = (data.advancedSpawners || []).map((spawner) => languageString(spawner, locale));
122
-
123
- /**
124
- * Items required to enter the mission
125
- * @type {string[]}
126
- */
127
- this.requiredItems = (data.requiredItems || []).map((reqItem) => languageString(reqItem, locale));
128
-
129
- /**
130
- * Whether or not the required items are consumed
131
- * @type {boolean}
132
- */
133
- this.consumeRequiredItems = data.consumeRequiredItems;
134
-
135
- /**
136
- * Target for the mission
137
- * @type {string}
138
- */
139
- this.target = languageString(data.vipAgent, locale);
140
-
141
- /**
142
- * Whether or not leaders are always allowed
143
- * @type {boolean}
144
- */
145
- this.leadersAlwaysAllowed = data.leadersAlwaysAllowed;
146
-
147
- /**
148
- * A tag for the event that this corresponds to
149
- * @type {string}
150
- */
151
- this.goalTag = data.goalTag;
152
-
153
- /**
154
- * Affectors for this mission
155
- * @type {string[]}
156
- */
157
- this.levelAuras = (data.levelAuras || []).map((aura) => languageString(aura, locale));
158
-
159
- /**
160
- * Only weapon allowed for the mission
161
- * @type {string}
162
- */
163
- this.exclusiveWeapon = languageString(data.exclusiveWeapon, locale);
164
- }
165
-
166
- /**
167
- * The Mission's string representation
168
- * @returns {string} Mission's string representation
169
- */
170
- toString() {
171
- const lines = [this.reward.toString()];
172
-
173
- lines.push(`${this.faction} (${this.type})`);
174
- lines.push(this.node);
175
- lines.push(`level ${this.minEnemyLevel} - ${this.maxEnemyLevel}`);
176
-
177
- return lines.join(mdConfig.lineEnd);
178
- }
179
- }