warframe-worldstate-parser 4.6.2 → 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,125 +0,0 @@
1
- import { fromNow, timeDeltaToString } from 'warframe-worldstate-data/utilities';
2
-
3
- import mdConfig from '../supporting/MarkdownSettings.js';
4
-
5
- import WorldstateObject from './WorldstateObject.js';
6
-
7
- const lStart = new Date('November 10, 2018 08:13:48 UTC');
8
- const loopTime = 1600000;
9
- const warmTime = 400000;
10
- const coldTime = loopTime - warmTime;
11
-
12
- /**
13
- * @typedef {object} CurrentCycle
14
- * @property {string} state - Current cycle state. One of `warm`, `cold`
15
- * @property {number} toNextMinor - Time remaining in the current cycle state
16
- * @property {number} toNextFull - Time remaining until the next cycle
17
- * @property {Date} timeAtPrevious - Date and time at which the event started
18
- * @property {Date} timeAtNext - Date and time at which the event start
19
- */
20
-
21
- /**
22
- * Get the current cycle state for Orb Vallis
23
- * @returns {CurrentCycle} current cycle state
24
- */
25
- function getCurrentCycle() {
26
- const sinceLast = (Date.now() - lStart) % loopTime;
27
- const toNextFull = loopTime - sinceLast;
28
- let state = 'cold';
29
- if (toNextFull > coldTime) {
30
- state = 'warm';
31
- }
32
- let toNextMinor;
33
- if (toNextFull < coldTime) {
34
- toNextMinor = toNextFull;
35
- } else {
36
- toNextMinor = toNextFull - coldTime;
37
- }
38
- const milliAtNext = Date.now() + toNextMinor;
39
- const milliAtPrev = Date.now() + toNextFull - (state === 'warm' ? loopTime : coldTime);
40
- const timeAtPrevious = new Date(milliAtPrev);
41
- timeAtPrevious.setSeconds(0);
42
-
43
- return {
44
- state,
45
- toNextMinor,
46
- toNextFull,
47
- timeAtNext: new Date(milliAtNext),
48
- timeAtPrevious,
49
- };
50
- }
51
-
52
- /**
53
- * Represents the current Earth Day/Night Cycle
54
- * @augments {WorldstateObject}
55
- */
56
- export default class VallisCycle extends WorldstateObject {
57
- /**
58
- * The current cetus cycle, for calculating the other fields
59
- * @property {string} state - Current cycle state. One of `warm`, `cold`
60
- * @property {number} toNextMinor - Time remaining in the current cycle state
61
- * @property {number} toNextFull - Time remaining until the next cycle
62
- * @property {Date} timeAtPrevious - Date and time at which the event started
63
- * @private
64
- */
65
- #ec = getCurrentCycle();
66
-
67
- constructor() {
68
- super({ _id: { $oid: 'vallisCycle0' } });
69
-
70
- /**
71
- * The date and time at which the event ends
72
- * @type {Date}
73
- */
74
- this.expiry = this.#ec.timeAtNext;
75
-
76
- /**
77
- * Whether or not this it's daytime
78
- * @type {boolean}
79
- */
80
- this.isWarm = this.#ec.state === 'warm';
81
-
82
- /**
83
- * Current cycle state. One of `warm`, `cold`
84
- * @type {string}
85
- */
86
- this.state = this.#ec.state;
87
-
88
- /**
89
- * Date and time at which the event started
90
- * @type {Date}
91
- */
92
- this.activation = this.#ec.timeAtPrevious;
93
-
94
- /**
95
- * Time remaining string
96
- * @type {string}
97
- */
98
- this.timeLeft = timeDeltaToString(this.#ec.toNextMinor);
99
-
100
- this.id = `vallisCycle${this.#ec.timeAtPrevious.getTime()}`;
101
-
102
- this.shortString = `${this.timeLeft.replace(/\s\d*s/gi, '')} to ${this.isWarm ? 'Cold' : 'Warm'}`;
103
- }
104
-
105
- /**
106
- * Get whether or not the event has expired
107
- * @returns {boolean} whether this event has expired
108
- */
109
- getExpired() {
110
- return fromNow(this.expiry) < 0;
111
- }
112
-
113
- /**
114
- * The event's string representation
115
- * @returns {string} the event's string representation
116
- */
117
- toString() {
118
- const lines = [
119
- `Operator, the Orb Vallis is currently ${this.isWarm ? 'Warm' : 'Cold'}`,
120
- `Time remaining until ${this.isWarm ? 'Cold' : 'Warm'}: ${this.timeLeft}`,
121
- ];
122
-
123
- return lines.join(mdConfig.lineEnd);
124
- }
125
- }
@@ -1,134 +0,0 @@
1
- import { fromNow, parseDate, timeDeltaToString, node, insist } from 'warframe-worldstate-data/utilities';
2
-
3
- import mdConfig from '../supporting/MarkdownSettings.js';
4
-
5
- import WorldstateObject from './WorldstateObject.js';
6
- import VoidTraderItem from './VoidTraderItem.js';
7
- import VoidTraderSchedule from './VoidTraderSchedule.js';
8
-
9
- /**
10
- * Represents a void trader
11
- * @augments {WorldstateObject}
12
- */
13
- export default class VoidTrader extends WorldstateObject {
14
- /**
15
- * @param {object} data The Void trader data
16
- * @param {object} deps The dependencies object
17
- * @param {string} deps.locale Locale to use for translations
18
- */
19
- constructor(data, { locale = 'en' } = { locale: 'en' }) {
20
- super(data);
21
- insist(data, 'Activation', 'Expiry');
22
-
23
- /**
24
- * The date and time at which the void trader arrives
25
- * @type {Date}
26
- */
27
- this.activation = parseDate(data.Activation);
28
-
29
- /**
30
- * The date and time at which the void trader leaves
31
- * @type {Date}
32
- */
33
- this.expiry = parseDate(data.Expiry);
34
-
35
- /**
36
- * The void trader's name
37
- * @type {string}
38
- */
39
- this.character = data.Character ? data.Character.replace("Baro'Ki Teel", "Baro Ki'Teer") : '';
40
-
41
- /**
42
- * The node at which the Void Trader appears
43
- * @type {string}
44
- */
45
- this.location = node(data.Node, locale);
46
-
47
- /**
48
- * The trader's inventory
49
- * @type {VoidTraderItem[]}
50
- */
51
- this.inventory = data.Manifest ? data.Manifest.map((i) => new VoidTraderItem(i, { locale })) : [];
52
-
53
- /**
54
- * Pseudo Identifier for identifying changes in inventory
55
- * @type {string}
56
- */
57
- this.psId = `${this.id}${this.inventory.length}`;
58
-
59
- /**
60
- * Whether or not the void trader is active (at time of object creation)
61
- * @type {boolean}
62
- */
63
- this.active = this.isActive();
64
-
65
- /**
66
- * A string indicating how long it will take for the trader to arrive
67
- * (at time of object creation)
68
- * @type {string}
69
- */
70
- this.startString = this.getStartString();
71
-
72
- /**
73
- * A string indicating how long it will take for the trader to leave
74
- * (at time of object creation)
75
- * @type {string}
76
- */
77
- this.endString = this.getEndString();
78
-
79
- this.initialStart = parseDate(data.InitialStartDate);
80
- this.completed = data.Completed;
81
- this.schedule = data.ScheduleInfo ? data.ScheduleInfo.map((i) => new VoidTraderSchedule(i, { locale })) : [];
82
- }
83
-
84
- /**
85
- * Get whether or not the trader is currently active
86
- * @returns {boolean} whether the trader is active
87
- */
88
- isActive() {
89
- return fromNow(this.activation) < 0 && fromNow(this.expiry) > 0;
90
- }
91
-
92
- /**
93
- * Get a string indicating how long it will take for the trader to arrive
94
- * @returns {string} time delta string from now to the start
95
- */
96
- getStartString() {
97
- return timeDeltaToString(fromNow(this.activation));
98
- }
99
-
100
- /**
101
- * Get a string indicating how long it will take for the trader to leave
102
- * @returns {string} time delta string from now to the end
103
- */
104
- getEndString() {
105
- return timeDeltaToString(fromNow(this.expiry));
106
- }
107
-
108
- /**
109
- * Returns a string representation of the trader
110
- * @returns {string} string representation
111
- */
112
- toString() {
113
- if (!this.isActive()) {
114
- const timeDelta = fromNow(this.activation);
115
- const nextArrivalTime = timeDeltaToString(timeDelta);
116
- return (
117
- `${mdConfig.codeBlock}${this.character} is not here yet, he will arrive in ` +
118
- `${nextArrivalTime} at ${this.location}${mdConfig.blockEnd}`
119
- );
120
- }
121
-
122
- const inventoryString = this.inventory
123
- .map((i) => ` ${i.item} - ${i.ducats} ducats + ${i.credits}cr%s`)
124
- .join(mdConfig.lineEnd);
125
-
126
- const lines = [
127
- `${mdConfig.codeBlock}Void Trader at ${this.location}`,
128
- inventoryString,
129
- `Trader departing in ${this.getEndString()}${mdConfig.blockEnd}`,
130
- ];
131
-
132
- return lines.join(mdConfig.lineEnd);
133
- }
134
- }
@@ -1,24 +0,0 @@
1
- import { languageString } from 'warframe-worldstate-data/utilities';
2
-
3
- /**
4
- * A void trader inventory item
5
- * @property {string} item The name of the inventory item
6
- * @property {number|string} ducats Ducat cost of the item
7
- * @property {number|string} credits Credit cost of the item
8
- */
9
- export default class VoidTraderItem {
10
- /**
11
- * @param {object} data The void trader item data
12
- * @param {string} data.ItemType Worldstate Item i18n path
13
- * @param {string} data.PrimePrice Ducat cost of the item
14
- * @param {string} data.RegularPrice Credit price of the item
15
- * @param {Dependency} deps The dependencies object
16
- * @param {string} deps.locale Locale to use for translations
17
- */
18
- constructor({ ItemType, PrimePrice, RegularPrice }, { locale = 'en' } = { locale: 'en' }) {
19
- this.uniqueName = ItemType;
20
- this.item = languageString(ItemType, locale);
21
- this.ducats = Number.parseInt(PrimePrice, 10);
22
- this.credits = Number.parseInt(RegularPrice, 10);
23
- }
24
- }
@@ -1,8 +0,0 @@
1
- import { parseDate, languageString } from 'warframe-worldstate-data/utilities';
2
-
3
- export default class VoidTraderSchedule {
4
- constructor(data, { locale = 'en' } = { locale: 'en' }) {
5
- this.expiry = parseDate(data.Expiry);
6
- this.item = languageString(data.FeaturedItem, locale);
7
- }
8
- }
@@ -1,27 +0,0 @@
1
- import WorldstateObject from './WorldstateObject.js';
2
- import ChallengeInstance from './ChallengeInstance.js';
3
-
4
- /**
5
- * Represents a void trader
6
- * @augments {WorldstateObject}
7
- */
8
- export default class WeeklyChallenge extends WorldstateObject {
9
- /**
10
- * @param {object} data The Void trader data
11
- */
12
- constructor(data) {
13
- super(data);
14
-
15
- this.challenges = data.Challenges.map((challengeData) => new ChallengeInstance(challengeData));
16
- }
17
-
18
- /**
19
- * Returns a string representation of the trader
20
- * @returns {string} string representation
21
- */
22
- toString() {
23
- return `Starts: ${this.getStartString()}\nEnds: ${this.getEndString()}\nChallenges:\n${this.challenges
24
- .map((challenge) => `\t${challenge.toString()}`)
25
- .join('\n')}`;
26
- }
27
- }
@@ -1,326 +0,0 @@
1
- import { fromNow, parseDate, faction, languageString, node, syndicate } from 'warframe-worldstate-data/utilities';
2
-
3
- import mdConfig from '../supporting/MarkdownSettings.js';
4
-
5
- import WorldstateObject from './WorldstateObject.js';
6
- import SyndicateJob from './SyndicateJob.js';
7
- import Reward from './Reward.js';
8
-
9
- /**
10
- * Interim step for an event reward system.
11
- * @typedef {object} InterimStep
12
- * @property {number} goal Goal amount
13
- * @property {Reward} reward Reward for reaching the step
14
- * @property {number} winnerCount Amount of players at this step
15
- * @property {object} message Message received when reaching the interim step
16
- */
17
-
18
- /**
19
- * Progress for one of multiple stages
20
- * @typedef {object} ProgressStep
21
- * @property {string} type Type of progress
22
- * @property {number} progressAmt Amount of progress
23
- */
24
-
25
- /**
26
- * Represents an in-game special event
27
- * @augments {WorldstateObject}
28
- */
29
- export default class WorldEvent extends WorldstateObject {
30
- /**
31
- * Asynchronously build a new WorldEvent
32
- * @param {object} data The event data
33
- * @param {object} deps The dependencies object
34
- * @param {string} deps.locale Locale to use for translations
35
- * @returns {Promise.<WorldEvent>} The created WorldEvent object
36
- */
37
- static async build(data, deps) {
38
- const event = new WorldEvent(data, deps);
39
- if (data.Jobs) {
40
- const jobs = [];
41
- // eslint-disable-next-line no-restricted-syntax
42
- for await (const job of data.Jobs ?? []) {
43
- jobs.push(await SyndicateJob.build(job, event.expiry, deps));
44
- }
45
- event.jobs = jobs;
46
- }
47
- if (data.PreviousJobs) {
48
- const previousJobs = [];
49
- // eslint-disable-next-line no-restricted-syntax
50
- for await (const job of data.PreviousJobs ?? []) {
51
- previousJobs.push(await SyndicateJob.build(job, event.expiry, deps));
52
- }
53
- event.previousJobs = previousJobs;
54
- }
55
- return event;
56
- }
57
-
58
- /**
59
- * @param {object} data The event data
60
- * @param {object} deps The dependencies object
61
- * @param {string} deps.locale Locale to use for translations
62
- */
63
- constructor(data, { locale = 'en' } = { locale: 'en' }) {
64
- super(data);
65
-
66
- const opts = {
67
- locale,
68
- };
69
-
70
- /**
71
- * The date and time at which the event ends
72
- * @type {Date}
73
- */
74
- this.expiry = parseDate(data.Expiry);
75
-
76
- /**
77
- * The event's main score goal
78
- * @type {number}
79
- */
80
- this.maximumScore = Number.parseInt(data.Goal, 10);
81
-
82
- /**
83
- * The current score on the event
84
- * @type {number}
85
- */
86
- this.currentScore = Number.parseInt(data.Count, 10);
87
-
88
- /**
89
- * The first intermediate score goal
90
- * @type {?number}
91
- */
92
- this.smallInterval = Number.parseInt(data.GoalInterim, 10);
93
-
94
- /**
95
- * The second intermediate score goal
96
- * @type {?number}
97
- */
98
- this.largeInterval = Number.parseInt(data.GoalInterim2, 10);
99
-
100
- /**
101
- * The faction that the players must fight in the event
102
- * @type {string}
103
- */
104
- this.faction = faction(data.Faction, locale);
105
-
106
- /**
107
- * The description of the event
108
- * @type {string}
109
- */
110
- this.description = languageString(data.Desc, locale);
111
-
112
- /**
113
- * Tooltip for the event
114
- * @type {?string}
115
- */
116
- this.tooltip = languageString(data.ToolTip, locale);
117
-
118
- /**
119
- * The node where the event takes place
120
- * @type {?string}
121
- */
122
- this.node = node(data.Node, locale);
123
-
124
- /**
125
- * The other nodes where the event takes place
126
- * @type {string[]}
127
- */
128
- this.concurrentNodes = data.ConcurrentNodes ? data.ConcurrentNodes.map((n) => node(n), locale) : [];
129
-
130
- /**
131
- * The victim node
132
- * @type {?string}
133
- */
134
- this.victimNode = node(data.VictimNode, locale);
135
-
136
- /**
137
- * The score description
138
- * @type {?string}
139
- */
140
- this.scoreLocTag = data.Fomorian ? 'Fomorian Assault Score' : languageString(data.ScoreLocTag, locale);
141
-
142
- /**
143
- * The event's rewards
144
- * @type {Reward[]}
145
- */
146
- this.rewards = Object.keys(data)
147
- .filter((k) => k.includes('Reward') || k.includes('reward'))
148
- .map((k) => new Reward(data[k], opts));
149
-
150
- /**
151
- * Whether or not this is expired (at time of object creation)
152
- * @type {boolean}
153
- */
154
- this.expired = this.getExpired();
155
-
156
- /**
157
- * Health remaining for the target
158
- * @type {number}
159
- */
160
- this.health =
161
- typeof data.HealthPct !== 'undefined' ? Number.parseFloat(((data.HealthPct || 0.0) * 100).toFixed(2)) : undefined;
162
-
163
- this.jobs = [];
164
- this.previousJobs = [];
165
-
166
- /**
167
- * Previous job id
168
- * @type {string}
169
- */
170
- this.previousId = (data.JobPreviousVersion || {}).$oid;
171
-
172
- /**
173
- * Array of steps
174
- * @type {InterimStep[]}
175
- */
176
- this.interimSteps = [];
177
-
178
- (data.InterimRewards || []).forEach((reward, index) => {
179
- const msg = (data.InterimRewardMessages || [])[index] || {};
180
- this.interimSteps[index] = {
181
- goal: Number.parseInt(data.InterimGoals[index], 10),
182
- reward: reward ? new Reward(reward, opts) : undefined,
183
- message: {
184
- sender: languageString(msg.sender, locale),
185
- subject: languageString(msg.subject, locale),
186
- message: languageString(msg.message, locale),
187
- senderIcon: msg.senderIcon,
188
- attachments: msg.attachments,
189
- },
190
- // eslint-disable-next-line no-underscore-dangle
191
- winnerCount: (data._interimWinnerCounts || [])[index],
192
- };
193
- });
194
-
195
- /**
196
- * Progress Steps, if any are present
197
- * @type {ProgressStep[]}
198
- */
199
- this.progressSteps = [];
200
-
201
- if (data.IsMultiProgress) {
202
- data.Types.forEach((type, index) => {
203
- this.progressSteps[index] = {
204
- type: languageString(type, locale),
205
- progressAmt: Number.parseInt(data.MultiProgress[index], 10),
206
- };
207
- });
208
-
209
- /**
210
- * Total of all MultiProgress
211
- * @type {number}
212
- */
213
- this.progressTotal = Number.parseFloat(data.MultiProgress.reduce((accumulator, val) => accumulator + val));
214
- }
215
-
216
- /**
217
- * Whether to show the total score at the end of the mission
218
- * @type {boolean}
219
- */
220
- this.showTotalAtEndOfMission = data.ShowTotalAtEOM;
221
- /**
222
- * Whether the event is personal
223
- * @type {boolean}
224
- */
225
- this.isPersonal = data.Personal;
226
- /**
227
- * Whether the event is community
228
- * @type {boolean}
229
- */
230
- this.isCommunity = data.Community;
231
-
232
- /*
233
- * Affectors for this mission
234
- * @type {string[]}
235
- */
236
- this.regionDrops = (data.RegionDrops || []).map((drop) => languageString(drop, locale));
237
-
238
- /**
239
- * Archwing Drops in effect while this event is active
240
- * @type {string[]}
241
- */
242
- this.archwingDrops = (data.ArchwingDrops || []).map((drop) => languageString(drop, locale));
243
-
244
- this.asString = this.toString();
245
-
246
- /**
247
- * Metadata provided by DE
248
- * @type {object}
249
- */
250
- this.metadata = JSON.parse((data.Metadata || '{}').replace('" ', '"'));
251
-
252
- /**
253
- * Bonuses given for completion
254
- * @type {Array.<number>}
255
- */
256
- this.completionBonuses = data.CompletionBonus || [];
257
-
258
- this.scoreVar = data.ScoreVar;
259
-
260
- this.altExpiry = parseDate(data.AltExpiry);
261
- this.altActivation = parseDate(data.AltActivation);
262
-
263
- this.nextAlt = {
264
- expiry: parseDate(data.NextAltExpiry),
265
- activation: parseDate(data.NextAltActivation),
266
- };
267
-
268
- if (data.JobAffiliationTag) {
269
- this.affiliatedWith = syndicate(data.JobAffiliationTag, locale);
270
- }
271
-
272
- /**
273
- * The event's tag
274
- * @type {string}
275
- */
276
- this.tag = data.Tag;
277
- }
278
-
279
- /**
280
- * Get whether the event has expired
281
- * @returns {boolean} whether the event has expired
282
- */
283
- getExpired() {
284
- return fromNow(this.expiry) < 0;
285
- }
286
-
287
- /**
288
- * The event's string representation
289
- * @returns {string} the event's string representation
290
- */
291
- toString() {
292
- let lines = [];
293
- if (this.faction) {
294
- lines.push(`${this.description} : ${this.faction}`);
295
- } else {
296
- lines.push(this.description);
297
- }
298
-
299
- if (this.scoreLocTag && this.maximumScore) {
300
- lines.push(`${this.scoreLocTag} : ${this.maximumScore}`);
301
- }
302
-
303
- if (this.rewards.length) {
304
- lines.push('Rewards:');
305
- lines = lines.concat(this.rewards.map((r) => r.toString()));
306
- }
307
- if (this.node) {
308
- lines.push(`Battle on ${this.node}`);
309
- }
310
- if (this.victim) {
311
- lines.push(`Protect ${this.victimNode}`);
312
- }
313
- if (this.health) {
314
- lines.push(`${this.health}% Remaining`);
315
- }
316
-
317
- if (this.affiliatedWith && this.jobs) {
318
- lines.push(
319
- `${this.affiliatedWith} will reward you for performing ` +
320
- `${this.jobs.map((job) => job.type).join(', ')} job${this.jobs.length > 1 ? 's' : ''}`
321
- );
322
- }
323
-
324
- return lines.join(mdConfig.lineEnd);
325
- }
326
- }