warframe-worldstate-parser 5.2.16 → 5.2.18

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 (184) hide show
  1. package/dist/{Calendar-CRM0XhAy.d.mts → Calendar-C-rbmV_t.d.mts} +1 -1
  2. package/dist/{CambionCycle-OI3v1knd.d.mts → CambionCycle-BzR_MfPH.d.mts} +2 -2
  3. package/dist/{CetusCycle-DQ4n05vO.d.mts → CetusCycle-DaqfF4J1.d.mts} +1 -1
  4. package/dist/{ConstructionProgress-DG2KzS0X.d.mts → ConstructionProgress-BRxmro3-.d.mts} +1 -1
  5. package/dist/{DarkSectorBattle-CiSe3kFm.d.mts → DarkSectorBattle-DHRl5tG1.d.mts} +1 -1
  6. package/dist/{Dependency-CNqXngHD.d.mts → Dependency-Cd-TxBJy.d.mts} +1 -1
  7. package/dist/{EarthCycle-CxtijnVV.d.mts → EarthCycle-C_oB5gDc.d.mts} +1 -1
  8. package/dist/{MidrathCycle-E0gMF3AR.d.mts → MidrathCycle-CxveqDtx.d.mts} +1 -1
  9. package/dist/{News-DxEm-q6V.d.mts → News-CJ3lD7_g.d.mts} +1 -1
  10. package/dist/{Nightwave-CPqMSqGK.d.mts → Nightwave-BLHH02ht.d.mts} +2 -2
  11. package/dist/{NightwaveChallenge-CG3uychc.d.mts → NightwaveChallenge-j_m4hVQU.d.mts} +1 -1
  12. package/dist/{PersistentEnemy-DnnnreSz.d.mts → PersistentEnemy-BJ4twtUY.d.mts} +1 -1
  13. package/dist/{VallisCycle-6DCaWFoR.d.mts → VallisCycle-as7DM4a-.d.mts} +1 -1
  14. package/dist/{ZarimanCycle-BrSLIWhD.d.mts → ZarimanCycle-DyYiVfyG.d.mts} +1 -1
  15. package/dist/{index-Bgx8kIDy.d.mts → index-C4EJ_Mpd.d.mts} +6 -6
  16. package/dist/lib/WorldState.d.mts +16 -19
  17. package/dist/lib/WorldState.mjs +32 -48
  18. package/dist/lib/models/Alert.d.mts +1 -17
  19. package/dist/lib/models/Alert.mjs +49 -7
  20. package/dist/lib/models/Archimedea.d.mts +1 -17
  21. package/dist/lib/models/Archimedea.mjs +88 -4
  22. package/dist/lib/models/Calendar.d.mts +1 -2
  23. package/dist/lib/models/Calendar.mjs +79 -4
  24. package/dist/lib/models/CambionCycle.d.mts +1 -3
  25. package/dist/lib/models/CambionCycle.mjs +28 -4
  26. package/dist/lib/models/CetusCycle.d.mts +1 -2
  27. package/dist/lib/models/CetusCycle.mjs +87 -4
  28. package/dist/lib/models/ChallengeInstance.d.mts +1 -17
  29. package/dist/lib/models/ChallengeInstance.mjs +46 -3
  30. package/dist/lib/models/ConclaveChallenge.d.mts +1 -17
  31. package/dist/lib/models/ConclaveChallenge.mjs +77 -4
  32. package/dist/lib/models/ConstructionProgress.d.mts +1 -2
  33. package/dist/lib/models/ConstructionProgress.mjs +23 -4
  34. package/dist/lib/models/DailyDeal.d.mts +1 -17
  35. package/dist/lib/models/DailyDeal.mjs +64 -4
  36. package/dist/lib/models/DarkSector.d.mts +1 -17
  37. package/dist/lib/models/DarkSector.mjs +136 -8
  38. package/dist/lib/models/DarkSectorBattle.d.mts +1 -2
  39. package/dist/lib/models/DarkSectorBattle.mjs +49 -3
  40. package/dist/lib/models/DuviriCycle.d.mts +1 -17
  41. package/dist/lib/models/DuviriCycle.mjs +55 -4
  42. package/dist/lib/models/EarthCycle.d.mts +1 -2
  43. package/dist/lib/models/EarthCycle.mjs +73 -4
  44. package/dist/lib/models/Fissure.d.mts +1 -17
  45. package/dist/lib/models/Fissure.mjs +83 -4
  46. package/dist/lib/models/FlashSale.d.mts +1 -17
  47. package/dist/lib/models/FlashSale.mjs +73 -4
  48. package/dist/lib/models/GlobalUpgrade.d.mts +1 -17
  49. package/dist/lib/models/GlobalUpgrade.mjs +56 -4
  50. package/dist/lib/models/Invasion.d.mts +1 -17
  51. package/dist/lib/models/Invasion.mjs +106 -6
  52. package/dist/lib/models/Kinepage.d.mts +1 -1
  53. package/dist/lib/models/Kinepage.mjs +23 -3
  54. package/dist/lib/models/Kuva.d.mts +1 -17
  55. package/dist/lib/models/Kuva.mjs +85 -3
  56. package/dist/lib/models/MidrathCycle.d.mts +1 -2
  57. package/dist/lib/models/MidrathCycle.mjs +66 -4
  58. package/dist/lib/models/Mission.d.mts +1 -17
  59. package/dist/lib/models/Mission.mjs +138 -5
  60. package/dist/lib/models/News.d.mts +1 -2
  61. package/dist/lib/models/News.mjs +116 -4
  62. package/dist/lib/models/Nightwave.d.mts +1 -3
  63. package/dist/lib/models/Nightwave.mjs +58 -5
  64. package/dist/lib/models/NightwaveChallenge.d.mts +1 -2
  65. package/dist/lib/models/NightwaveChallenge.mjs +51 -4
  66. package/dist/lib/models/PersistentEnemy.d.mts +1 -2
  67. package/dist/lib/models/PersistentEnemy.mjs +74 -4
  68. package/dist/lib/models/Reward.d.mts +1 -17
  69. package/dist/lib/models/Reward.mjs +71 -4
  70. package/dist/lib/models/SentientOutpost.d.mts +1 -17
  71. package/dist/lib/models/SentientOutpost.mjs +63 -3
  72. package/dist/lib/models/Simaris.d.mts +1 -17
  73. package/dist/lib/models/Simaris.mjs +33 -3
  74. package/dist/lib/models/Sortie.d.mts +1 -17
  75. package/dist/lib/models/Sortie.mjs +71 -8
  76. package/dist/lib/models/SortieVariant.d.mts +1 -17
  77. package/dist/lib/models/SortieVariant.mjs +49 -3
  78. package/dist/lib/models/SteelPathOffering.d.mts +1 -1
  79. package/dist/lib/models/SteelPathOffering.mjs +81 -3
  80. package/dist/lib/models/SyndicateJob.d.mts +1 -17
  81. package/dist/lib/models/SyndicateJob.mjs +161 -7
  82. package/dist/lib/models/SyndicateMission.d.mts +1 -17
  83. package/dist/lib/models/SyndicateMission.mjs +64 -8
  84. package/dist/lib/models/Tmp.d.mts +1 -17
  85. package/dist/lib/models/Tmp.mjs +28 -4
  86. package/dist/lib/models/VallisCycle.d.mts +1 -2
  87. package/dist/lib/models/VallisCycle.mjs +72 -4
  88. package/dist/lib/models/VoidTrader.d.mts +1 -17
  89. package/dist/lib/models/VoidTrader.mjs +76 -6
  90. package/dist/lib/models/VoidTraderItem.d.mts +1 -17
  91. package/dist/lib/models/VoidTraderItem.mjs +36 -3
  92. package/dist/lib/models/VoidTraderSchedule.d.mts +1 -17
  93. package/dist/lib/models/VoidTraderSchedule.mjs +12 -3
  94. package/dist/lib/models/WeeklyChallenge.d.mts +1 -17
  95. package/dist/lib/models/WeeklyChallenge.mjs +19 -5
  96. package/dist/lib/models/WorldEvent.d.mts +1 -17
  97. package/dist/lib/models/WorldEvent.mjs +211 -9
  98. package/dist/lib/models/WorldStateObject.d.mts +1 -1
  99. package/dist/lib/models/WorldStateObject.mjs +52 -3
  100. package/dist/lib/models/ZarimanCycle.d.mts +1 -2
  101. package/dist/lib/models/ZarimanCycle.mjs +77 -4
  102. package/dist/lib/models/index.d.mts +17 -18
  103. package/dist/lib/models/index.mjs +43 -47
  104. package/dist/lib/supporting/Dependency.d.mts +1 -1
  105. package/dist/lib/supporting/Dependency.mjs +1 -1
  106. package/dist/lib/supporting/DuviriChoice.d.mts +1 -17
  107. package/dist/lib/supporting/DuviriChoice.mjs +24 -3
  108. package/dist/lib/supporting/ExternalMission.d.mts +1 -1
  109. package/dist/lib/supporting/ExternalMission.mjs +1 -1
  110. package/dist/lib/supporting/FetchProxy.d.mts +1 -1
  111. package/dist/lib/supporting/FetchProxy.mjs +45 -3
  112. package/dist/lib/supporting/ImgCdn.d.mts +1 -1
  113. package/dist/lib/supporting/ImgCdn.mjs +6 -3
  114. package/dist/lib/supporting/KuvaLogEntry.d.mts +1 -1
  115. package/dist/lib/supporting/KuvaLogEntry.mjs +1 -1
  116. package/dist/lib/supporting/RewardData.d.mts +1 -1
  117. package/dist/lib/supporting/RewardData.mjs +75 -3
  118. package/dist/lib/supporting/RewardTypes.d.mts +1 -1
  119. package/dist/lib/supporting/RewardTypes.mjs +326 -3
  120. package/dist/lib/supporting/index.d.mts +8 -23
  121. package/dist/lib/supporting/index.mjs +6 -8
  122. package/dist/main.d.mts +24 -24
  123. package/dist/main.mjs +48 -51
  124. package/package.json +1 -1
  125. package/dist/Alert-CPT2sBmd.mjs +0 -51
  126. package/dist/Archimedea-Vo36QE99.mjs +0 -90
  127. package/dist/Calendar-_gEQ9BEd.mjs +0 -81
  128. package/dist/CambionCycle-B1pqIgks.mjs +0 -30
  129. package/dist/CetusCycle-Ct51M2pd.mjs +0 -89
  130. package/dist/ChallengeInstance-BOu_e7ML.mjs +0 -48
  131. package/dist/ConclaveChallenge-BTN6UyV6.mjs +0 -79
  132. package/dist/ConstructionProgress-BoF2P9fx.mjs +0 -25
  133. package/dist/DailyDeal-aoNeCFWT.mjs +0 -66
  134. package/dist/DarkSector-D0uJWCg7.mjs +0 -138
  135. package/dist/DarkSectorBattle-CqRYeNpe.mjs +0 -51
  136. package/dist/Dependency-BR-dAeHI.mjs +0 -1
  137. package/dist/DuviriChoice-BEBiWA-g.mjs +0 -25
  138. package/dist/DuviriCycle-Do7mMnoC.mjs +0 -57
  139. package/dist/EarthCycle-BOAlcAuQ.mjs +0 -75
  140. package/dist/ExternalMission-D3MSZgnN.mjs +0 -1
  141. package/dist/FetchProxy-Bkdk15SX.mjs +0 -46
  142. package/dist/Fissure-diM4hyi3.mjs +0 -85
  143. package/dist/FlashSale-CNfRaZhM.mjs +0 -75
  144. package/dist/GlobalUpgrade-CUtZw05z.mjs +0 -58
  145. package/dist/ImgCdn-BJOdWAbU.mjs +0 -7
  146. package/dist/Invasion-Corx1lxf.mjs +0 -108
  147. package/dist/Kinepage-CbSzge67.mjs +0 -24
  148. package/dist/Kuva-Ijy2ZGBL.mjs +0 -87
  149. package/dist/KuvaLogEntry-D_VzIT3W.mjs +0 -1
  150. package/dist/MidrathCycle-XD2T8Dx5.mjs +0 -68
  151. package/dist/Mission-b8KP-YDf.mjs +0 -140
  152. package/dist/News-zAK-sYRg.mjs +0 -118
  153. package/dist/Nightwave-cTRmlbwH.mjs +0 -60
  154. package/dist/NightwaveChallenge-C8ARG7LC.mjs +0 -53
  155. package/dist/PersistentEnemy-3Sw5E8AN.mjs +0 -76
  156. package/dist/Reward-3FBJF_hS.mjs +0 -73
  157. package/dist/RewardData-C_9b8Yhi.mjs +0 -76
  158. package/dist/RewardTypes-DUrR7H3G.mjs +0 -328
  159. package/dist/SentientOutpost-Cadk-pIW.mjs +0 -65
  160. package/dist/Simaris-D6etEQp_.mjs +0 -35
  161. package/dist/Sortie-rSBgJc6U.mjs +0 -73
  162. package/dist/SortieVariant-CnuLkkNZ.mjs +0 -51
  163. package/dist/SteelPathOffering--wm-7hwb.mjs +0 -83
  164. package/dist/SyndicateJob-R89tWqvT.mjs +0 -162
  165. package/dist/SyndicateMission-CKZDWNyf.mjs +0 -66
  166. package/dist/Tmp-BYL_mYIG.mjs +0 -30
  167. package/dist/VallisCycle-BW2g49wB.mjs +0 -74
  168. package/dist/VoidTrader-DtjtVUgR.mjs +0 -78
  169. package/dist/VoidTraderItem-Cz6x1KTF.mjs +0 -38
  170. package/dist/VoidTraderSchedule-BsJLu50V.mjs +0 -14
  171. package/dist/WeeklyChallenge-Dl2ekl6X.mjs +0 -21
  172. package/dist/WorldEvent-C-LaV2ug.mjs +0 -213
  173. package/dist/WorldStateObject-45dbRgp7.mjs +0 -54
  174. package/dist/ZarimanCycle-DoAPwgaM.mjs +0 -79
  175. package/dist/supporting-BLSXhlWM.mjs +0 -1
  176. /package/dist/{ExternalMission-C82w4uMq.d.mts → ExternalMission-CT__oi7Q.d.mts} +0 -0
  177. /package/dist/{FetchProxy-DfSTUgkf.d.mts → FetchProxy-DHSI4JPP.d.mts} +0 -0
  178. /package/dist/{ImgCdn-D0hSGSB1.d.mts → ImgCdn-DIhZrwap.d.mts} +0 -0
  179. /package/dist/{Kinepage-B-Ym_VW5.d.mts → Kinepage-CKBuvbv5.d.mts} +0 -0
  180. /package/dist/{KuvaLogEntry-cftxhjfU.d.mts → KuvaLogEntry-f4ZBn2Xf.d.mts} +0 -0
  181. /package/dist/{RewardData-DWCgJ3UT.d.mts → RewardData-BdtdUFnh.d.mts} +0 -0
  182. /package/dist/{RewardTypes-Y3tHrtIJ.d.mts → RewardTypes-BnGaD7VF.d.mts} +0 -0
  183. /package/dist/{SteelPathOffering-CQkoKi5T.d.mts → SteelPathOffering-DYjZ29sT.d.mts} +0 -0
  184. /package/dist/{WorldStateObject-C1HEDkH7.d.mts → WorldStateObject-C2KjQZjd.d.mts} +0 -0
@@ -1,4 +1,55 @@
1
- import "../../WorldStateObject-45dbRgp7.mjs";
2
- import { t as DuviriCycle } from "../../DuviriCycle-Do7mMnoC.mjs";
3
-
4
- export { DuviriCycle };
1
+ import { WorldStateObject } from "./WorldStateObject.mjs";
2
+ //#region lib/models/DuviriCycle.ts
3
+ const cycleTime = 36e3;
4
+ const stateTime = 7200;
5
+ const states = [
6
+ "sorrow",
7
+ "fear",
8
+ "joy",
9
+ "anger",
10
+ "envy"
11
+ ];
12
+ const getStageInfo = () => {
13
+ const cycleDelta = (Math.floor(Date.now() / 1e3) - 52) % cycleTime;
14
+ const stateInd = Math.floor(cycleDelta / stateTime);
15
+ const untilNext = stateTime - cycleDelta % stateTime;
16
+ const expiry = new Date(Date.now() + untilNext * 1e3);
17
+ expiry.setSeconds(0);
18
+ expiry.setMilliseconds(0);
19
+ const activation = /* @__PURE__ */ new Date(expiry.getTime() - stateTime * 1e3);
20
+ activation.setSeconds(0);
21
+ activation.setMilliseconds(0);
22
+ return {
23
+ state: states[stateInd],
24
+ expiry,
25
+ activation
26
+ };
27
+ };
28
+ /**
29
+ * @typedef {WorldStateObject} DuviriCycle
30
+ * @augments {WorldStateObject}
31
+ */
32
+ var DuviriCycle = class extends WorldStateObject {
33
+ /**
34
+ * Current stage key
35
+ */
36
+ state;
37
+ /**
38
+ * Choice options for this Cycle
39
+ */
40
+ choices;
41
+ /**
42
+ * @param duviriChoices The current circuit choices
43
+ */
44
+ constructor(duviriChoices) {
45
+ super({ _id: { $oid: "duviriCycle0" } });
46
+ const { activation, expiry, state } = getStageInfo();
47
+ this.activation = activation;
48
+ this.expiry = expiry;
49
+ this.state = state;
50
+ this.choices = duviriChoices;
51
+ this.id = `duviriCycle${this.state}${this.expiry.getTime()}`;
52
+ }
53
+ };
54
+ //#endregion
55
+ export { DuviriCycle };
@@ -1,3 +1,2 @@
1
- import "../../WorldStateObject-C1HEDkH7.mjs";
2
- import { n as EarthCycleType, t as EarthCycle } from "../../EarthCycle-CxtijnVV.mjs";
1
+ import { n as EarthCycleType, t as EarthCycle } from "../../EarthCycle-C_oB5gDc.mjs";
3
2
  export { EarthCycle, EarthCycleType };
@@ -1,4 +1,73 @@
1
- import "../../WorldStateObject-45dbRgp7.mjs";
2
- import { t as EarthCycle } from "../../EarthCycle-BOAlcAuQ.mjs";
3
-
4
- export { EarthCycle };
1
+ import { WorldStateObject } from "./WorldStateObject.mjs";
2
+ import { fromNow } from "warframe-worldstate-data/utilities";
3
+ //#region lib/models/EarthCycle.ts
4
+ /**
5
+ * Get the current Earth Day/Night Cycle
6
+ * @returns {EarthCycle} The current Earth Day/Night Cycle
7
+ */
8
+ function getCurrentEarthCycle() {
9
+ const now = Date.now();
10
+ const cycleSeconds = Math.floor(now / 1e3) % 28800;
11
+ const dayTime = cycleSeconds < 14400;
12
+ let secondsLeft = 14400 - cycleSeconds % 14400;
13
+ const millisLeft = secondsLeft * 1e3;
14
+ const expiry = new Date(now + secondsLeft * 1e3);
15
+ const minutesCoef = 1e3 * 60;
16
+ const rounded = new Date(Math.round((now + millisLeft) / minutesCoef) * minutesCoef);
17
+ const timePieces = [];
18
+ if (secondsLeft > 3600) {
19
+ timePieces.push(`${Math.floor(secondsLeft / 3600)}h`);
20
+ secondsLeft %= 3600;
21
+ }
22
+ if (secondsLeft > 60) {
23
+ timePieces.push(`${Math.floor(secondsLeft / 60)}m`);
24
+ secondsLeft %= 60;
25
+ }
26
+ timePieces.push(`${secondsLeft}s`);
27
+ return {
28
+ dayTime,
29
+ timeLeft: timePieces.join(" "),
30
+ expiry,
31
+ expiresIn: millisLeft,
32
+ rounded,
33
+ state: dayTime ? "day" : "night",
34
+ start: /* @__PURE__ */ new Date(expiry.getTime() - 1e3 * 60 * 60 * 4)
35
+ };
36
+ }
37
+ /**
38
+ * Represents the current Earth Day/Night Cycle
39
+ * @augments {WorldStateObject}
40
+ */
41
+ var EarthCycle = class extends WorldStateObject {
42
+ #ec = getCurrentEarthCycle();
43
+ /**
44
+ * Whether or not this it's daytime
45
+ */
46
+ isDay;
47
+ /**
48
+ * Current cycle state. One of `day`, `night`
49
+ */
50
+ state;
51
+ /**
52
+ * Time remaining string
53
+ */
54
+ timeLeft;
55
+ constructor() {
56
+ super({ _id: { $oid: "earthCycle0" } });
57
+ this.expiry = this.#ec.expiry;
58
+ this.activation = this.#ec.start;
59
+ this.isDay = this.#ec.dayTime;
60
+ this.state = this.#ec.state;
61
+ this.timeLeft = this.#ec.timeLeft;
62
+ this.id = `earthCycle${this.#ec.rounded.getTime()}`;
63
+ }
64
+ /**
65
+ * Get whether or not the event has expired
66
+ * @returns {boolean} Whether or not the event has expired
67
+ */
68
+ get expired() {
69
+ return fromNow(this.expiry) < 0;
70
+ }
71
+ };
72
+ //#endregion
73
+ export { EarthCycle };
@@ -1,18 +1,2 @@
1
- import "../../Dependency-CNqXngHD.mjs";
2
- import { I as Fissure, L as RawFissure } from "../../index-Bgx8kIDy.mjs";
3
- import "../../WorldStateObject-C1HEDkH7.mjs";
4
- import "../../Calendar-CRM0XhAy.mjs";
5
- import "../../CetusCycle-DQ4n05vO.mjs";
6
- import "../../CambionCycle-OI3v1knd.mjs";
7
- import "../../ConstructionProgress-DG2KzS0X.mjs";
8
- import "../../DarkSectorBattle-CiSe3kFm.mjs";
9
- import "../../EarthCycle-CxtijnVV.mjs";
10
- import "../../MidrathCycle-E0gMF3AR.mjs";
11
- import "../../News-DxEm-q6V.mjs";
12
- import "../../NightwaveChallenge-CG3uychc.mjs";
13
- import "../../Nightwave-CPqMSqGK.mjs";
14
- import "../../PersistentEnemy-DnnnreSz.mjs";
15
- import "../../SteelPathOffering-CQkoKi5T.mjs";
16
- import "../../VallisCycle-6DCaWFoR.mjs";
17
- import "../../ZarimanCycle-BrSLIWhD.mjs";
1
+ import { I as Fissure, L as RawFissure } from "../../index-C4EJ_Mpd.mjs";
18
2
  export { Fissure, RawFissure };
@@ -1,4 +1,83 @@
1
- import "../../WorldStateObject-45dbRgp7.mjs";
2
- import { t as Fissure } from "../../Fissure-diM4hyi3.mjs";
3
-
4
- export { Fissure };
1
+ import { WorldStateObject } from "./WorldStateObject.mjs";
2
+ import { fissureModifier, fissureTier, fromNow, missionType, node, nodeEnemy, nodeMissionType, parseDate, timeDeltaToString } from "warframe-worldstate-data/utilities";
3
+ //#region lib/models/Fissure.ts
4
+ /**
5
+ * Represents a fissure mission
6
+ * @augments {WorldStateObject}
7
+ */
8
+ var Fissure = class extends WorldStateObject {
9
+ /**
10
+ * The node where the fissure has appeared
11
+ */
12
+ node;
13
+ /**
14
+ * The fissure mission type
15
+ */
16
+ missionType;
17
+ /**
18
+ * The fissure mission type key
19
+ */
20
+ missionTypeKey;
21
+ /**
22
+ * The faction controlling the node where the fissure has appeared
23
+ */
24
+ enemy;
25
+ /**
26
+ * Faction enum for the faction controlling the node where the fissure has appeared
27
+ */
28
+ enemyKey;
29
+ /**
30
+ * The node key where the fissure has appeared
31
+ */
32
+ nodeKey;
33
+ /**
34
+ * The fissure's tier
35
+ */
36
+ tier;
37
+ /**
38
+ * The fissure's tier as a number
39
+ */
40
+ tierNum;
41
+ /**
42
+ * Whether this fissure corresponds to a RailJack Void Storm
43
+ */
44
+ isStorm;
45
+ /**
46
+ * Whether this fissure is a Steel Path fissure
47
+ */
48
+ isHard;
49
+ /**
50
+ * @param {object} data The fissure data
51
+ * @param {Dependency} deps The dependencies object
52
+ * @param {string} deps.locale Locale to use for translations
53
+ */
54
+ constructor(data, { locale = "en" } = { locale: "en" }) {
55
+ super(data);
56
+ this.node = node(data.Node, locale);
57
+ this.missionType = data.MissionType ? missionType(data.MissionType, locale) : nodeMissionType(data.Node, locale);
58
+ this.missionTypeKey = data.MissionType ? missionType(data.MissionType) : nodeMissionType(data.Node);
59
+ this.enemy = nodeEnemy(data.Node, locale);
60
+ this.enemyKey = nodeEnemy(data.Node);
61
+ this.nodeKey = node(data.Node);
62
+ this.tier = fissureModifier(data.Modifier || data.ActiveMissionTier, locale);
63
+ this.tierNum = fissureTier(data.Modifier || data.ActiveMissionTier, locale);
64
+ this.activation = parseDate(data.Activation);
65
+ this.expiry = parseDate(data.Expiry);
66
+ this.isStorm = Boolean(data.ActiveMissionTier);
67
+ this.isHard = Boolean(data.Hard);
68
+ }
69
+ /**
70
+ * Whether this is expired (at time of object creation)
71
+ */
72
+ get expired() {
73
+ return fromNow(this.expiry) < 0;
74
+ }
75
+ /**
76
+ * ETA string (at time of object creation)
77
+ */
78
+ get eta() {
79
+ return timeDeltaToString(fromNow(this.expiry));
80
+ }
81
+ };
82
+ //#endregion
83
+ export { Fissure };
@@ -1,18 +1,2 @@
1
- import "../../Dependency-CNqXngHD.mjs";
2
- import { F as RawFlashSale, P as FlashSale } from "../../index-Bgx8kIDy.mjs";
3
- import "../../WorldStateObject-C1HEDkH7.mjs";
4
- import "../../Calendar-CRM0XhAy.mjs";
5
- import "../../CetusCycle-DQ4n05vO.mjs";
6
- import "../../CambionCycle-OI3v1knd.mjs";
7
- import "../../ConstructionProgress-DG2KzS0X.mjs";
8
- import "../../DarkSectorBattle-CiSe3kFm.mjs";
9
- import "../../EarthCycle-CxtijnVV.mjs";
10
- import "../../MidrathCycle-E0gMF3AR.mjs";
11
- import "../../News-DxEm-q6V.mjs";
12
- import "../../NightwaveChallenge-CG3uychc.mjs";
13
- import "../../Nightwave-CPqMSqGK.mjs";
14
- import "../../PersistentEnemy-DnnnreSz.mjs";
15
- import "../../SteelPathOffering-CQkoKi5T.mjs";
16
- import "../../VallisCycle-6DCaWFoR.mjs";
17
- import "../../ZarimanCycle-BrSLIWhD.mjs";
1
+ import { F as RawFlashSale, P as FlashSale } from "../../index-C4EJ_Mpd.mjs";
18
2
  export { FlashSale, RawFlashSale };
@@ -1,4 +1,73 @@
1
- import "../../WorldStateObject-45dbRgp7.mjs";
2
- import { t as FlashSale } from "../../FlashSale-CNfRaZhM.mjs";
3
-
4
- export { FlashSale };
1
+ import { WorldStateObject } from "./WorldStateObject.mjs";
2
+ import { fromNow, languageString, timeDeltaToString } from "warframe-worldstate-data/utilities";
3
+ //#region lib/models/FlashSale.ts
4
+ /**
5
+ * Represents a flash sale
6
+ */
7
+ var FlashSale = class extends WorldStateObject {
8
+ /**
9
+ * The item being offered in the flash sale
10
+ */
11
+ item;
12
+ /**
13
+ * The item's discount percentage
14
+ */
15
+ discount;
16
+ /**
17
+ * The item's discounted credit price
18
+ */
19
+ regularOverride;
20
+ /**
21
+ * The item's discounted platinum price
22
+ */
23
+ premiumOverride;
24
+ /**
25
+ * Whether this item is show in the in-game market
26
+ */
27
+ isShownInMarket;
28
+ /**
29
+ * Whether this item is featured in the in-game market
30
+ */
31
+ isFeatured;
32
+ /**
33
+ * Whether this item is marked as popular in the in-game market
34
+ */
35
+ isPopular;
36
+ /**
37
+ * Unique identifier for this sale built from the end time and reward
38
+ */
39
+ id;
40
+ /**
41
+ * @param {object} data The flash sale data
42
+ * @param {Dependency} deps The dependencies object
43
+ * @param {string} deps.locale Locale to use for translations
44
+ */
45
+ constructor(data, { locale = "en" } = { locale: "en" }) {
46
+ super({
47
+ Activation: data.StartDate,
48
+ Expiry: data.EndDate
49
+ });
50
+ this.item = languageString(data.TypeName, locale);
51
+ this.discount = data.Discount;
52
+ this.regularOverride = data.RegularOverride;
53
+ this.premiumOverride = data.PremiumOverride;
54
+ this.isShownInMarket = data.ShowInMarket;
55
+ this.isFeatured = data.Featured;
56
+ this.isPopular = data.Popular;
57
+ this.id = `${data.TypeName.split("/").slice(-1)[0]}${this.expiry.getTime()}`;
58
+ }
59
+ /**
60
+ * ETA string (at time of object creation)
61
+ */
62
+ get eta() {
63
+ return timeDeltaToString(fromNow(this.expiry));
64
+ }
65
+ /**
66
+ * Whether or not this is expired (at time of object creation)
67
+ */
68
+ get expired() {
69
+ return fromNow(this.expiry) < 0;
70
+ }
71
+ };
72
+ //#endregion
73
+ export { FlashSale };
@@ -1,18 +1,2 @@
1
- import "../../Dependency-CNqXngHD.mjs";
2
- import { M as GlobalUpgrade, N as RawGlobalUpgrade } from "../../index-Bgx8kIDy.mjs";
3
- import "../../WorldStateObject-C1HEDkH7.mjs";
4
- import "../../Calendar-CRM0XhAy.mjs";
5
- import "../../CetusCycle-DQ4n05vO.mjs";
6
- import "../../CambionCycle-OI3v1knd.mjs";
7
- import "../../ConstructionProgress-DG2KzS0X.mjs";
8
- import "../../DarkSectorBattle-CiSe3kFm.mjs";
9
- import "../../EarthCycle-CxtijnVV.mjs";
10
- import "../../MidrathCycle-E0gMF3AR.mjs";
11
- import "../../News-DxEm-q6V.mjs";
12
- import "../../NightwaveChallenge-CG3uychc.mjs";
13
- import "../../Nightwave-CPqMSqGK.mjs";
14
- import "../../PersistentEnemy-DnnnreSz.mjs";
15
- import "../../SteelPathOffering-CQkoKi5T.mjs";
16
- import "../../VallisCycle-6DCaWFoR.mjs";
17
- import "../../ZarimanCycle-BrSLIWhD.mjs";
1
+ import { M as GlobalUpgrade, N as RawGlobalUpgrade } from "../../index-C4EJ_Mpd.mjs";
18
2
  export { GlobalUpgrade, RawGlobalUpgrade };
@@ -1,4 +1,56 @@
1
- import "../../WorldStateObject-45dbRgp7.mjs";
2
- import { t as GlobalUpgrade } from "../../GlobalUpgrade-CUtZw05z.mjs";
3
-
4
- export { GlobalUpgrade };
1
+ import { WorldStateObject } from "./WorldStateObject.mjs";
2
+ import { fromNow, operation, operationSymbol, timeDeltaToString, upgrade } from "warframe-worldstate-data/utilities";
3
+ //#region lib/models/GlobalUpgrade.ts
4
+ /**
5
+ * Represents an upgrade that applies to all players
6
+ */
7
+ var GlobalUpgrade = class extends WorldStateObject {
8
+ /**
9
+ * The effect of the upgrade
10
+ */
11
+ upgrade;
12
+ /**
13
+ * The operation type
14
+ */
15
+ operation;
16
+ /**
17
+ * Symbol for operation
18
+ */
19
+ operationSymbol;
20
+ /**
21
+ * The operation value
22
+ */
23
+ upgradeOperationValue;
24
+ /**
25
+ * @param {object} data The global upgrade data
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
+ this.upgrade = upgrade(data.UpgradeType, locale);
32
+ this.operation = operation(data.OperationType, locale);
33
+ this.operationSymbol = operationSymbol(data.OperationType, locale);
34
+ this.upgradeOperationValue = data.Value;
35
+ }
36
+ /**
37
+ * Plaintext description of upgrade
38
+ */
39
+ get desc() {
40
+ return `${this.upgradeOperationValue}${this.operationSymbol} ${this.upgrade} for ${this.eta}`;
41
+ }
42
+ /**
43
+ * ETA string (at time of object creation)
44
+ */
45
+ get eta() {
46
+ return timeDeltaToString(fromNow(this.expiry));
47
+ }
48
+ /**
49
+ * Whether or not this is expired (at time of object creation)
50
+ */
51
+ get expired() {
52
+ return fromNow(this.expiry) < 0;
53
+ }
54
+ };
55
+ //#endregion
56
+ export { GlobalUpgrade };
@@ -1,18 +1,2 @@
1
- import "../../Dependency-CNqXngHD.mjs";
2
- import { A as InvasionParticipant, j as RawInvasion, k as Invasion } from "../../index-Bgx8kIDy.mjs";
3
- import "../../WorldStateObject-C1HEDkH7.mjs";
4
- import "../../Calendar-CRM0XhAy.mjs";
5
- import "../../CetusCycle-DQ4n05vO.mjs";
6
- import "../../CambionCycle-OI3v1knd.mjs";
7
- import "../../ConstructionProgress-DG2KzS0X.mjs";
8
- import "../../DarkSectorBattle-CiSe3kFm.mjs";
9
- import "../../EarthCycle-CxtijnVV.mjs";
10
- import "../../MidrathCycle-E0gMF3AR.mjs";
11
- import "../../News-DxEm-q6V.mjs";
12
- import "../../NightwaveChallenge-CG3uychc.mjs";
13
- import "../../Nightwave-CPqMSqGK.mjs";
14
- import "../../PersistentEnemy-DnnnreSz.mjs";
15
- import "../../SteelPathOffering-CQkoKi5T.mjs";
16
- import "../../VallisCycle-6DCaWFoR.mjs";
17
- import "../../ZarimanCycle-BrSLIWhD.mjs";
1
+ import { A as InvasionParticipant, j as RawInvasion, k as Invasion } from "../../index-C4EJ_Mpd.mjs";
18
2
  export { Invasion, InvasionParticipant, RawInvasion };
@@ -1,6 +1,106 @@
1
- import "../../RewardTypes-DUrR7H3G.mjs";
2
- import "../../Reward-3FBJF_hS.mjs";
3
- import "../../WorldStateObject-45dbRgp7.mjs";
4
- import { t as Invasion } from "../../Invasion-Corx1lxf.mjs";
5
-
6
- export { Invasion };
1
+ import { Reward } from "./Reward.mjs";
2
+ import { WorldStateObject } from "./WorldStateObject.mjs";
3
+ import { faction, languageString, node, timeDeltaToString, toNow } from "warframe-worldstate-data/utilities";
4
+ //#region lib/models/Invasion.ts
5
+ /**
6
+ * Represents an invasion
7
+ */
8
+ var Invasion = class extends WorldStateObject {
9
+ /**
10
+ * The node where the invasion is taking place
11
+ */
12
+ node;
13
+ /**
14
+ * The node key where the invasion is taking place
15
+ */
16
+ nodeKey;
17
+ /**
18
+ * The invasion's description
19
+ */
20
+ desc;
21
+ /**
22
+ * Invasion attacker
23
+ */
24
+ attacker;
25
+ /**
26
+ * Invasion defender
27
+ */
28
+ defender;
29
+ /**
30
+ * Whether this invasion is against the infestation
31
+ */
32
+ vsInfestation;
33
+ /**
34
+ * The signed count of completed runs. Supporting the attackers makes the count go up,
35
+ * supporting the defenders makes it go down
36
+ */
37
+ count;
38
+ /**
39
+ * The number of runs that one side needs to win
40
+ */
41
+ requiredRuns;
42
+ /**
43
+ * The invasion's completion percentage. Defenders win if it gets to 0
44
+ * Grineer vs. Corpus invasions start at 50, Infested invasions start at 100
45
+ */
46
+ completion;
47
+ /**
48
+ * Whether the invasion has finished
49
+ */
50
+ completed;
51
+ /**
52
+ * An array containing the types of all of the invasions's rewards
53
+ */
54
+ rewardTypes;
55
+ /**
56
+ * @param {object} data The invasion data
57
+ * @param {Dependency} deps The dependencies object
58
+ * @param {string} deps.locale Locale to use for translations
59
+ */
60
+ constructor(data, { locale = "en" } = { locale: "en" }) {
61
+ super(data);
62
+ const opts = { locale };
63
+ this.node = node(data.Node, locale);
64
+ this.nodeKey = node(data.Node);
65
+ this.desc = languageString(data.LocTag, locale);
66
+ this.attacker = {
67
+ reward: Object.keys(data?.AttackerReward || {})?.length ? new Reward(data.AttackerReward, opts) : void 0,
68
+ faction: faction(data.DefenderMissionInfo.faction, locale),
69
+ factionKey: faction(data.DefenderMissionInfo.faction, "en")
70
+ };
71
+ this.defender = {
72
+ reward: Object.keys(data?.DefenderReward || {})?.length ? new Reward(data.DefenderReward, opts) : void 0,
73
+ faction: faction(data.AttackerMissionInfo.faction, locale),
74
+ factionKey: faction(data.AttackerMissionInfo.faction, "en")
75
+ };
76
+ this.vsInfestation = /infest/i.test(data.DefenderMissionInfo.faction);
77
+ this.count = data.Count;
78
+ this.requiredRuns = data.Goal;
79
+ this.completion = (1 + data.Count / data.Goal) * (this.vsInfestation ? 100 : 50);
80
+ this.completed = data.Completed;
81
+ this.rewardTypes = [...this.attacker.reward?.getTypes() ?? [], ...this.defender.reward?.getTypes() ?? []];
82
+ }
83
+ /**
84
+ * Whether or not the attackers are winning.
85
+ * This is always false when the infestation is attacking
86
+ */
87
+ get isAttackerWinning() {
88
+ return this.count > 0;
89
+ }
90
+ /**
91
+ * ETA string (at time of object creation)
92
+ */
93
+ get eta() {
94
+ return timeDeltaToString(this.getRemainingTime());
95
+ }
96
+ /**
97
+ * Get an estimation of how much time is left before the invasion ends in milliseconds
98
+ */
99
+ getRemainingTime() {
100
+ const completedRuns = Math.abs(this.count);
101
+ const elapsedMillis = toNow(this.activation);
102
+ return (this.requiredRuns - completedRuns) * (elapsedMillis / completedRuns);
103
+ }
104
+ };
105
+ //#endregion
106
+ export { Invasion };
@@ -1,2 +1,2 @@
1
- import { t as Kinepage } from "../../Kinepage-B-Ym_VW5.mjs";
1
+ import { t as Kinepage } from "../../Kinepage-CKBuvbv5.mjs";
2
2
  export { Kinepage };
@@ -1,3 +1,23 @@
1
- import { t as Kinepage } from "../../Kinepage-CbSzge67.mjs";
2
-
3
- export { Kinepage };
1
+ //#region lib/models/Kinepage.ts
2
+ var Kinepage = class {
3
+ /**
4
+ * Timestamp of when the message appeared on
5
+ */
6
+ timestamp;
7
+ /**
8
+ * The message itself
9
+ */
10
+ message;
11
+ /**
12
+ * Message translations
13
+ */
14
+ translations;
15
+ constructor(data, locale = "en") {
16
+ this.timestamp = /* @__PURE__ */ new Date(Number(data.ts) * 1e3);
17
+ const translations = Object.fromEntries(Object.entries(data).filter(([key]) => key !== "ts"));
18
+ this.message = String(translations[locale] || data.en);
19
+ this.translations = Object.fromEntries(Object.entries(translations).filter(([key]) => key !== locale));
20
+ }
21
+ };
22
+ //#endregion
23
+ export { Kinepage };
@@ -1,18 +1,2 @@
1
- import "../../Dependency-CNqXngHD.mjs";
2
- import { O as Kuva } from "../../index-Bgx8kIDy.mjs";
3
- import "../../WorldStateObject-C1HEDkH7.mjs";
4
- import "../../Calendar-CRM0XhAy.mjs";
5
- import "../../CetusCycle-DQ4n05vO.mjs";
6
- import "../../CambionCycle-OI3v1knd.mjs";
7
- import "../../ConstructionProgress-DG2KzS0X.mjs";
8
- import "../../DarkSectorBattle-CiSe3kFm.mjs";
9
- import "../../EarthCycle-CxtijnVV.mjs";
10
- import "../../MidrathCycle-E0gMF3AR.mjs";
11
- import "../../News-DxEm-q6V.mjs";
12
- import "../../NightwaveChallenge-CG3uychc.mjs";
13
- import "../../Nightwave-CPqMSqGK.mjs";
14
- import "../../PersistentEnemy-DnnnreSz.mjs";
15
- import "../../SteelPathOffering-CQkoKi5T.mjs";
16
- import "../../VallisCycle-6DCaWFoR.mjs";
17
- import "../../ZarimanCycle-BrSLIWhD.mjs";
1
+ import { O as Kuva } from "../../index-C4EJ_Mpd.mjs";
18
2
  export { Kuva };