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,143 +0,0 @@
1
- import wsData from 'warframe-worldstate-data';
2
- import {
3
- fromNow,
4
- parseDate,
5
- timeDeltaToString,
6
- languageString,
7
- sortieBoss,
8
- sortieFaction,
9
- } from 'warframe-worldstate-data/utilities';
10
-
11
- import mdConfig from '../supporting/MarkdownSettings.js';
12
-
13
- import WorldstateObject from './WorldstateObject.js';
14
- import SortieVariant from './SortieVariant.js';
15
- import Mission from './Mission.js';
16
-
17
- const { sortie: sortieData } = wsData;
18
-
19
- /**
20
- * Represents a daily sortie
21
- * @augments {WorldstateObject}
22
- */
23
- export default class Sortie extends WorldstateObject {
24
- /**
25
- * @param {object} data The data for all daily sorties
26
- * @param {object} deps The dependencies object
27
- * @param {string} deps.locale Locale to use for translations
28
- */
29
- constructor(data, { locale = 'en' } = { locale: 'en' }) {
30
- super(data);
31
-
32
- const opts = {
33
- mdConfig,
34
- sortieData,
35
- locale,
36
- };
37
-
38
- /**
39
- * The date and time at which the sortie starts
40
- * @type {Date}
41
- */
42
- this.activation = parseDate(data.Activation);
43
-
44
- /**
45
- * The date and time at which the sortie ends
46
- * @type {Date}
47
- */
48
- this.expiry = parseDate(data.Expiry);
49
-
50
- /**
51
- * The sortie's reward pool
52
- * @type {string}
53
- */
54
- this.rewardPool = languageString(data.Reward, locale);
55
-
56
- /**
57
- * The sortie's variants
58
- * @type {Array.<SortieVariant>}
59
- */
60
- this.variants = (data.Variants ?? []).map((v) => new SortieVariant(v, opts));
61
-
62
- this.missions = (data.Missions ?? []).map((v) => new Mission(v, opts));
63
-
64
- /**
65
- * The sortie's boss
66
- * @type {string}
67
- */
68
- this.boss = sortieBoss(data.Boss, locale);
69
-
70
- /**
71
- * The sortie's faction
72
- * @type {string}
73
- */
74
- this.faction = sortieFaction(data.Boss, locale);
75
-
76
- /**
77
- * The sortie's faction
78
- * @type {string}
79
- */
80
- this.factionKey = sortieFaction(data.Boss, 'en');
81
-
82
- /**
83
- * Whether this is expired (at time of object creation)
84
- * @type {boolean}
85
- */
86
- this.expired = this.isExpired();
87
-
88
- /**
89
- * ETA string (at time of object creation)
90
- * @type {string}
91
- */
92
- this.eta = this.getETAString();
93
- }
94
-
95
- /**
96
- * Get the sortie's boss
97
- * @returns {string} the sortie's boss
98
- */
99
- getBoss() {
100
- return this.boss;
101
- }
102
-
103
- /**
104
- * Get the sortie's faction
105
- * @returns {string} the sortie's faction
106
- */
107
- getFaction() {
108
- return this.faction;
109
- }
110
-
111
- /**
112
- * Gets a string indicating how long it will take for the sortie to end
113
- * @returns {string} estimated time of arrival
114
- */
115
- getETAString() {
116
- return timeDeltaToString(fromNow(this.expiry));
117
- }
118
-
119
- /**
120
- * Get whether or not the sortie has expired
121
- * @returns {boolean} whether the sortie has expired
122
- */
123
- isExpired() {
124
- return fromNow(this.expiry) < 0;
125
- }
126
-
127
- /**
128
- * Returns the sortie's string representation
129
- * @returns {string} the string representation
130
- */
131
- toString() {
132
- if (this.isExpired()) {
133
- return `${mdConfig.codeBlock}There's currently no sortie${mdConfig.blockEnd}`;
134
- }
135
-
136
- const variantString = this.variants.map((v) => v.toString()).join('');
137
-
138
- return (
139
- `${mdConfig.codeBlock}${this.getBoss()}: ends in ${this.getETAString()}` +
140
- `${mdConfig.doubleReturn}${variantString}${mdConfig.blockEnd}`
141
- );
142
- }
143
- }
@@ -1,57 +0,0 @@
1
- import { missionType, node, sortieModDesc, sortieModifier, insist } from 'warframe-worldstate-data/utilities';
2
-
3
- import mdConfig from '../supporting/MarkdownSettings.js';
4
-
5
- /**
6
- * Represents a sortie variant
7
- * @class
8
- */
9
- export default class SortieVariant {
10
- /**
11
- * Make the SortieVariant
12
- * @class
13
- * @param {object} data Sortie variant data
14
- * @param {object} deps Dependencies
15
- * @param {string} deps.locale Locale to use for translations
16
- */
17
- constructor(data, { locale = 'en' } = { locale: 'en' }) {
18
- insist(data);
19
- /**
20
- * The variant's mission type
21
- * @type {string}
22
- */
23
- this.missionType = missionType(data.missionType, locale);
24
-
25
- this.missionTypeKey = missionType(data.missionType, 'en');
26
-
27
- /**
28
- * The variant's modifier
29
- * @type {string}
30
- */
31
- this.modifier = sortieModifier(data.modifierType, locale);
32
-
33
- /**
34
- * The variant's modifier description
35
- * @type {string}
36
- */
37
- this.modifierDescription = sortieModDesc(data.modifierType, locale);
38
-
39
- /**
40
- * The node where the variant takes place
41
- * @type {string}
42
- */
43
- this.node = node(data.node, locale);
44
-
45
- this.nodeKey = node(data.node, 'en');
46
- }
47
-
48
- /**
49
- * Returns a string representation of the sortie variant
50
- * @returns {string} string representation
51
- */
52
- toString() {
53
- return this.modifier
54
- ? `${this.node.padEnd(25, ' ')} | ${this.modifier.padEnd(20, ' ')} | ${this.missionType}${mdConfig.lineEnd}`
55
- : `${this.node.padEnd(25, ' ')} | ${this.missionType}${mdConfig.lineEnd}`;
56
- }
57
- }
@@ -1,99 +0,0 @@
1
- import { timeDeltaToString, steelPath } from 'warframe-worldstate-data/utilities';
2
-
3
- const monday = 1;
4
-
5
- /**
6
- * Gets the first day of the week
7
- * @returns {Date} first day of the week
8
- */
9
- function getFirstDayOfWeek() {
10
- const resultDate = new Date();
11
- /* istanbul ignore next */
12
- const offset = resultDate.getUTCDay() === 0 ? 6 : resultDate.getUTCDay() - monday;
13
- resultDate.setUTCDate(resultDate.getUTCDate() - offset);
14
- resultDate.setUTCHours(0);
15
- resultDate.setUTCMinutes(0);
16
- resultDate.setUTCSeconds(0);
17
- resultDate.setUTCMilliseconds(0);
18
- return resultDate;
19
- }
20
-
21
- /**
22
- * Get the last day of the week
23
- * @returns {Date} last day of the week
24
- */
25
- function getLastDayOfWeek() {
26
- const last = new Date(getFirstDayOfWeek());
27
- last.setUTCDate(last.getUTCDate() + 6);
28
- last.setUTCHours(23);
29
- last.setUTCMinutes(59);
30
- last.setUTCSeconds(59);
31
- last.setUTCMilliseconds(0);
32
- return last;
33
- }
34
-
35
- /**
36
- * When was the start of the day
37
- * @returns {Date} start of the day
38
- */
39
- function getStartOfDay() {
40
- const today = new Date();
41
- today.setUTCHours(0);
42
- today.setUTCMinutes(0);
43
- today.setUTCSeconds(0);
44
- today.setUTCMilliseconds(0);
45
- return today;
46
- }
47
-
48
- /**
49
- * When was the end of the day
50
- * @returns {Date} end of the day
51
- */
52
- function getEndOfDay() {
53
- const last = new Date();
54
- last.setUTCHours(23);
55
- last.setUTCMinutes(59);
56
- last.setUTCSeconds(59);
57
- last.setUTCMilliseconds(0);
58
- return last;
59
- }
60
-
61
- /**
62
- * Start of Steel Path cycle calculations
63
- * @type {Date}
64
- */
65
- const start = new Date('2020-11-16T00:00:00.000Z');
66
-
67
- export default class SteelPathOffering {
68
- constructor({ locale }) {
69
- const sSinceStart = (Date.now() - start.getTime()) / 1000;
70
- const eightWeeks = 4838400;
71
- const sevenDays = 604800;
72
-
73
- const ind = Math.floor((sSinceStart % eightWeeks) / sevenDays);
74
-
75
- this.currentReward = steelPath(locale).rotation[ind];
76
-
77
- this.activation = getFirstDayOfWeek();
78
-
79
- this.expiry = getLastDayOfWeek();
80
-
81
- this.remaining = timeDeltaToString(this.expiry.getTime() - Date.now());
82
-
83
- this.rotation = steelPath(locale).rotation;
84
- this.evergreens = steelPath(locale).evergreen;
85
-
86
- /**
87
- * General data pertaining to incursions
88
- * @type {object}
89
- * @property {string} id Identifier for steel path incursion based on start of day.
90
- * @property {Date} activation when the current incursions became active
91
- * @property {Date} expiry when the current incursions become inactive
92
- */
93
- this.incursions = {
94
- id: `spi:${getStartOfDay().getTime()}`,
95
- activation: getStartOfDay(),
96
- expiry: getEndOfDay(),
97
- };
98
- }
99
- }
@@ -1,185 +0,0 @@
1
- import { languageString } from 'warframe-worldstate-data/utilities';
2
-
3
- import WorldstateObject from './WorldstateObject.js';
4
-
5
- const apiBase = process.env.API_BASE_URL || 'https://api.warframestat.us';
6
- const bountyRewardRegex = /(?:Tier([ABCDE])|Narmer)Table([ABC])Rewards/i;
7
- const ghoulRewardRegex = /GhoulBountyTable([AB])Rewards/i;
8
-
9
- /**
10
- * Determine the level string for the bounty
11
- * @param {object} job Original raw job data
12
- * @returns {string} level range string
13
- */
14
- const getLevelString = (job) => `${job.minEnemyLevel} - ${job.maxEnemyLevel}`;
15
-
16
- const determineLocation = (i18n, isVault, raw) => {
17
- const last = String(i18n).split('/').slice(-1)[0];
18
-
19
- const bountyMatches = last.match(bountyRewardRegex);
20
- const ghoulMatches = last.match(ghoulRewardRegex);
21
-
22
- const isBounty = bountyMatches && bountyMatches.length;
23
- const isGhoul = ghoulMatches && ghoulMatches.length;
24
- const isCetus = /eidolonjob/i.test(i18n);
25
- const isVallis = /venusjob/i.test(i18n);
26
- const isDeimos = /deimosmissionrewards/i.test(i18n);
27
- const rotation = isBounty ? bountyMatches[2] : '';
28
- const levelString = getLevelString(raw);
29
-
30
- let location;
31
- let levelClause;
32
- if (isCetus) {
33
- location = 'Earth/Cetus ';
34
- if (isGhoul) {
35
- levelClause = `(Level ${levelString} Ghoul Bounty)`;
36
- } else {
37
- levelClause = `(Level ${levelString} Cetus Bounty)`;
38
- }
39
- }
40
- if (isVallis) {
41
- location = 'Venus/Orb Vallis ';
42
- levelClause = `(Level ${levelString} Orb Vallis Bounty)`;
43
- }
44
- if (isDeimos) {
45
- location = 'Deimos/Cambion Drift '; // this will need to be updated when the actual drops are released
46
- const variant = isVault ? 'Isolation Vault' : 'Cambion Drift Bounty';
47
- levelClause = `(Level ${levelString} ${variant})`;
48
- }
49
- const locationWRot = `${location}${levelClause}, Rot ${rotation.length ? rotation : 'A'}`;
50
- return { location, locationWRot };
51
- };
52
-
53
- const getBountyRewards = async (i18n, isVault, raw) => {
54
- let location;
55
- let locationWRot;
56
- if (i18n.endsWith('PlagueStarTableRewards')) {
57
- location = 'plague star';
58
- locationWRot = 'Earth/Cetus (Level 15 - 25 Plague Star), Rot A';
59
- }
60
- if (!location || !locationWRot) {
61
- ({ location, locationWRot } = determineLocation(i18n, isVault, raw));
62
- }
63
- const url = `${apiBase}/drops/search/${encodeURIComponent(location)}?grouped_by=location`;
64
- const reply = await fetch(url)
65
- .then((res) => res.json())
66
- .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)));
74
- }
75
- /* istanbul ignore next */
76
- return [];
77
- };
78
-
79
- const FIFTY_MINUTES = 3000000;
80
-
81
- /**
82
- * Represents a syndicate daily mission
83
- * @augments {WorldstateObject}
84
- */
85
- export default class SyndicateJob extends WorldstateObject {
86
- /**
87
- * Generate a job with async data (reward pool)
88
- * @param {object} data The syndicate mission data
89
- * @param {Date} expiry The syndicate job expiration
90
- * @param {object} deps The dependencies object
91
- * @param {string} deps.locale Locale to use for translations
92
- * @returns {Promise<SyndicateJob>} The created SyndicateJob object with rewardPool
93
- */
94
- static async build(data, expiry, deps) {
95
- const job = new SyndicateJob(data, expiry, deps);
96
- job.rewardPool = await getBountyRewards(data.rewards, data.isVault, data);
97
-
98
- return job;
99
- }
100
-
101
- /**
102
- * Construct a job without async data (reward pool)
103
- * @param {object} data The syndicate mission data
104
- * @param {Date} expiry The syndicate job expiration
105
- * @param {object} deps The dependencies object
106
- * @param {string} deps.locale Locale to use for translations
107
- *
108
- * This DOES NOT populate the reward pool
109
- */
110
- constructor(data, expiry, { locale = 'en' }) {
111
- super({
112
- _id: {
113
- $oid: data.JobCurrentVersion
114
- ? data.JobCurrentVersion.$oid
115
- : `${(data.jobType || '').split('/').slice(-1)[0]}${expiry.getTime()}`,
116
- },
117
- });
118
-
119
- /**
120
- * Array of strings describing rewards
121
- * @type {Array.<string>}
122
- */
123
- this.rewardPool = [];
124
-
125
- const chamber = ((data.locationTag || '').match(/[A-Z]+(?![a-z])|[A-Z]?[a-z]+|\d+/g) || []).join(' ');
126
-
127
- /**
128
- * The type of job this is
129
- * @type {string}
130
- */
131
- this.type = languageString(data.jobType, locale) || `${data.isVault ? 'Isolation Vault' : ''} ${chamber}`;
132
-
133
- /**
134
- * Array of enemy levels
135
- * @type {Array.<number>}
136
- */
137
- this.enemyLevels = [data.minEnemyLevel, data.maxEnemyLevel];
138
-
139
- /**
140
- * Array of standing gains per stage of job
141
- * @type {Array.<number>}
142
- */
143
- this.standingStages = data.xpAmounts;
144
-
145
- /**
146
- * Minimum mastery required to participate
147
- * @type {number}
148
- */
149
- this.minMR = data.masteryReq || 0;
150
-
151
- /**
152
- * Whether or not this is a Vault job.
153
- * No indication for difference of normal vs arcana vaults.
154
- * @type {boolean}
155
- */
156
- this.isVault = data.isVault;
157
-
158
- /**
159
- * Corresponding chamber. Nullable
160
- * @type {string|null}
161
- */
162
- this.locationTag = data.locationTag;
163
-
164
- /**
165
- * End time for the syndicate mission.
166
- * Should be inherited from the Syndicate, but some are timebound.
167
- * @type {Date}
168
- */
169
- this.expiry = expiry;
170
-
171
- /**
172
- * What time phase this bounty is bound to
173
- * @type {string}
174
- */
175
- this.timeBound = undefined;
176
- if (data.jobType && data.jobType.toLowerCase().includes('narmer')) {
177
- if (data.jobType.toLowerCase().includes('eidolon')) {
178
- this.timeBound = 'day';
179
- this.expiry = new Date(this.expiry.getTime() - FIFTY_MINUTES);
180
- } else {
181
- this.timeBoound = 'night';
182
- }
183
- }
184
- }
185
- }
@@ -1,111 +0,0 @@
1
- import { fromNow, parseDate, timeDeltaToString, node, syndicate } from 'warframe-worldstate-data/utilities';
2
-
3
- import mdConfig from '../supporting/MarkdownSettings.js';
4
-
5
- import SyndicateJob from './SyndicateJob.js';
6
- import WorldstateObject from './WorldstateObject.js';
7
-
8
- /**
9
- * Represents a syndicate daily mission
10
- * @augments {WorldstateObject}
11
- */
12
- export default class SyndicateMission extends WorldstateObject {
13
- /**
14
- * Build a new SyndicateMission with async operations & data
15
- * @param {object} data The syndicate mission data
16
- * @param {object} deps The dependencies object
17
- * @param {string} deps.locale Locale to use for translations
18
- * @returns {Promise.<SyndicateMission>} SyndicateMission object w/ async resolution of jobs
19
- */
20
- static async build(data, deps) {
21
- const syndicateMission = new SyndicateMission(data, deps);
22
- if (data.Jobs) {
23
- const jobs = [];
24
- // eslint-disable-next-line no-restricted-syntax
25
- for await (const job of data.Jobs ?? []) {
26
- jobs.push(await SyndicateJob.build(job, syndicateMission.expiry, deps));
27
- }
28
- syndicateMission.jobs = jobs;
29
- }
30
-
31
- return syndicateMission;
32
- }
33
-
34
- /**
35
- * @param {object} data The syndicate mission data
36
- * @param {object} deps The dependencies object
37
- * @param {string} deps.locale Locale to use for translations
38
- */
39
- constructor(data, { locale = 'en' } = { locale: 'en' }) {
40
- super(data);
41
-
42
- /**
43
- * The date and time at which the syndicate mission starts
44
- * @type {Date}
45
- */
46
- this.activation = parseDate(data.Activation);
47
-
48
- /**
49
- * The date and time at which the syndicate mission ends
50
- * @type {Date}
51
- */
52
- this.expiry = parseDate(data.Expiry);
53
-
54
- /**
55
- * The syndicate that is offering the mission
56
- * @type {string}
57
- */
58
- this.syndicate = syndicate(data.Tag, locale);
59
-
60
- /**
61
- * The syndicate that is offering the mission
62
- * @type {string}
63
- */
64
- this.syndicateKey = syndicate(data.Tag, 'en');
65
-
66
- /**
67
- * The nodes on which the missions are taking place
68
- * @type {Array.<string>}
69
- */
70
- this.nodes = data.Nodes.map((n) => node(n), locale);
71
-
72
- /**
73
- * The jobs for this syndicate. Will normally be []
74
- * @type {Array.<SyndicateJob>}
75
- */
76
- this.jobs = [];
77
-
78
- /**
79
- * Unique identifier for this mission set built from the end time and syndicate
80
- * @type {string}
81
- */
82
- this.id = `${this.expiry.getTime()}${data.Tag}`;
83
-
84
- /**
85
- * ETA string (at time of object creation)
86
- * @type {string} time delta string from now to the expiry
87
- */
88
- this.eta = this.getETAString();
89
- }
90
-
91
- /**
92
- * Get a string indicating how much time is left before the syndicate mission expries
93
- * @returns {string} time delta string from now to the expiry
94
- */
95
- getETAString() {
96
- return timeDeltaToString(fromNow(this.expiry));
97
- }
98
-
99
- /**
100
- * Returns a string representation of the syndicate mission
101
- * @returns {string} the string representation
102
- */
103
- toString() {
104
- if (this.nodes.length > 0) {
105
- const missions = this.nodes.map((n) => ` \u2022${n.toString()}`).join(mdConfig.lineEnd);
106
- return `[${this.getETAString()}] ${this.syndicate} currently has missions on:${mdConfig.lineEnd}${missions}`;
107
- }
108
-
109
- return `No missions available for ${this.syndicate}`;
110
- }
111
- }