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,9 +1,211 @@
1
- import "../../RewardTypes-DUrR7H3G.mjs";
2
- import "../../Reward-3FBJF_hS.mjs";
3
- import "../../WorldStateObject-45dbRgp7.mjs";
4
- import "../../FetchProxy-Bkdk15SX.mjs";
5
- import "../../supporting-BLSXhlWM.mjs";
6
- import "../../SyndicateJob-R89tWqvT.mjs";
7
- import { t as WorldEvent } from "../../WorldEvent-C-LaV2ug.mjs";
8
-
9
- export { WorldEvent };
1
+ import { Reward } from "./Reward.mjs";
2
+ import { WorldStateObject } from "./WorldStateObject.mjs";
3
+ import { SyndicateJob } from "./SyndicateJob.mjs";
4
+ import { faction, fromNow, languageString, node, parseDate, syndicate } from "warframe-worldstate-data/utilities";
5
+ //#region lib/models/WorldEvent.ts
6
+ /**
7
+ * Represents an in-game special event
8
+ * @augments {WorldStateObject}
9
+ */
10
+ var WorldEvent = class WorldEvent extends WorldStateObject {
11
+ jobs;
12
+ previousJobs;
13
+ /**
14
+ * The event's main score goal
15
+ */
16
+ maximumScore;
17
+ /**
18
+ * The current score on the event
19
+ */
20
+ currentScore;
21
+ /**
22
+ * The first intermediate score goal
23
+ */
24
+ smallInterval;
25
+ /**
26
+ * The second intermediate score goal
27
+ */
28
+ largeInterval;
29
+ /**
30
+ * The faction that the players must fight in the event
31
+ */
32
+ faction;
33
+ /**
34
+ * The description of the event
35
+ */
36
+ description;
37
+ /**
38
+ * Tooltip for the event
39
+ */
40
+ tooltip;
41
+ /**
42
+ * The node where the event takes place
43
+ */
44
+ node;
45
+ /**
46
+ * The other nodes where the event takes place
47
+ */
48
+ concurrentNodes;
49
+ /**
50
+ * The victim node
51
+ */
52
+ victimNode;
53
+ /**
54
+ * The score description
55
+ */
56
+ scoreLocTag;
57
+ /**
58
+ * The event's rewards
59
+ */
60
+ rewards;
61
+ /**
62
+ * Health remaining for the target
63
+ */
64
+ health;
65
+ /**
66
+ * Previous job id
67
+ */
68
+ previousId;
69
+ /**
70
+ * Array of steps
71
+ */
72
+ interimSteps;
73
+ /**
74
+ * Progress Steps, if any are present
75
+ */
76
+ progressSteps;
77
+ /**
78
+ * Total of all MultiProgress
79
+ */
80
+ progressTotal;
81
+ /**
82
+ * Whether to show the total score at the end of the mission
83
+ */
84
+ showTotalAtEndOfMission;
85
+ /**
86
+ * Whether the event is personal
87
+ */
88
+ isPersonal;
89
+ /**
90
+ * Whether the event is community
91
+ */
92
+ isCommunity;
93
+ regionDrops;
94
+ /**
95
+ * Archwing Drops in effect while this event is active
96
+ */
97
+ archwingDrops;
98
+ /**
99
+ * Metadata provided by DE
100
+ */
101
+ metadata;
102
+ /**
103
+ * Bonuses given for completion
104
+ */
105
+ completionBonuses;
106
+ scoreVar;
107
+ altExpiry;
108
+ altActivation;
109
+ nextAlt;
110
+ affiliatedWith;
111
+ /**
112
+ * The event's tag
113
+ */
114
+ tag;
115
+ victim;
116
+ /**
117
+ * Asynchronously build a new WorldEvent
118
+ * @param data The event data
119
+ * @param deps The dependencies object
120
+ * @returns The created WorldEvent object
121
+ */
122
+ static async build(data, deps) {
123
+ const event = new WorldEvent(data, deps);
124
+ if (data.Jobs) {
125
+ const jobs = [];
126
+ for await (const job of data.Jobs ?? []) jobs.push(await SyndicateJob.build(job, event.expiry, deps));
127
+ event.jobs = jobs;
128
+ }
129
+ if (data.PreviousJobs) {
130
+ const previousJobs = [];
131
+ for await (const job of data.PreviousJobs ?? []) previousJobs.push(await SyndicateJob.build(job, event.expiry, deps));
132
+ event.previousJobs = previousJobs;
133
+ }
134
+ return event;
135
+ }
136
+ /**
137
+ * @param data The event data
138
+ * @param deps The dependencies object
139
+ */
140
+ constructor(data, { locale = "en" } = { locale: "en" }) {
141
+ super(data);
142
+ const opts = { locale };
143
+ this.maximumScore = Number.parseInt(String(data.Goal), 10);
144
+ this.currentScore = Number.parseInt(String(data.Count), 10);
145
+ this.smallInterval = Number.parseInt(String(data.GoalInterim), 10);
146
+ this.largeInterval = Number.parseInt(String(data.GoalInterim2), 10);
147
+ this.faction = data.Faction ? faction(data.Faction, locale) : void 0;
148
+ this.description = languageString(data.Desc, locale);
149
+ this.tooltip = data.ToolTip ? languageString(data.ToolTip, locale) : void 0;
150
+ this.node = data.Node ? node(data.Node, locale) : void 0;
151
+ this.concurrentNodes = data.ConcurrentNodes ? data.ConcurrentNodes.map((n) => node(n, locale)) : [];
152
+ this.victimNode = data.VictimNode ? node(data.VictimNode, locale) : void 0;
153
+ this.scoreLocTag = data.ScoreLocTag ? languageString(data.ScoreLocTag, locale) : void 0;
154
+ if (data.Fomorian) this.scoreLocTag = "Fomorian Assault Score";
155
+ this.rewards = Object.keys(data).filter((k) => k.includes("Reward") || k.includes("reward")).map((k) => new Reward(data[k], opts)).filter((r) => r.items.length > 0);
156
+ this.health = typeof data.HealthPct !== "undefined" ? Number.parseFloat(((data.HealthPct || 0) * 100).toFixed(2)) : void 0;
157
+ this.jobs = [];
158
+ this.previousJobs = [];
159
+ this.previousId = data.JobPreviousVersion?.$oid;
160
+ this.interimSteps = [];
161
+ (data.InterimRewards || []).forEach((reward, index) => {
162
+ const msg = (data.InterimRewardMessages || [])[index] || {};
163
+ this.interimSteps[index] = {
164
+ goal: Number.parseInt(String(data.InterimGoals[index]), 10),
165
+ reward: reward ? new Reward(reward, opts) : void 0,
166
+ message: {
167
+ sender: languageString(msg.sender, locale),
168
+ subject: languageString(msg.subject, locale),
169
+ message: languageString(msg.message, locale),
170
+ senderIcon: msg.senderIcon,
171
+ attachments: msg.attachments
172
+ },
173
+ winnerCount: (data._interimWinnerCounts || [])[index]
174
+ };
175
+ });
176
+ this.progressSteps = [];
177
+ if (data.IsMultiProgress) {
178
+ data.Types?.forEach((type, index) => {
179
+ this.progressSteps[index] = {
180
+ type: languageString(type, locale),
181
+ progressAmt: Number.parseInt(String(data.MultiProgress[index]), 10)
182
+ };
183
+ });
184
+ this.progressTotal = Number.parseFloat(String(data.MultiProgress.reduce((acc, val) => acc + Number.parseFloat(val), 0)));
185
+ }
186
+ this.showTotalAtEndOfMission = data.ShowTotalAtEOM ?? false;
187
+ this.isPersonal = data.Personal;
188
+ this.isCommunity = data.Community ?? false;
189
+ this.regionDrops = (data.RegionDrops || []).map((drop) => languageString(drop, locale));
190
+ this.archwingDrops = (data.ArchwingDrops || []).map((drop) => languageString(drop, locale));
191
+ this.metadata = JSON.parse((data.Metadata || "{}").replace("\" ", "\""));
192
+ this.completionBonuses = data.CompletionBonus || [];
193
+ this.scoreVar = data.ScoreVar;
194
+ this.altExpiry = parseDate(data.AltExpiry);
195
+ this.altActivation = parseDate(data.AltActivation);
196
+ this.nextAlt = {
197
+ expiry: parseDate(data.NextAltExpiry),
198
+ activation: parseDate(data.NextAltActivation)
199
+ };
200
+ if (data.JobAffiliationTag) this.affiliatedWith = syndicate(data.JobAffiliationTag, locale);
201
+ this.tag = data.Tag;
202
+ }
203
+ /**
204
+ * Whether the event has expired
205
+ */
206
+ get expired() {
207
+ return fromNow(this.expiry) < 0;
208
+ }
209
+ };
210
+ //#endregion
211
+ export { WorldEvent };
@@ -1,2 +1,2 @@
1
- import { n as Identifier, r as WorldStateObject, t as BaseContentObject } from "../../WorldStateObject-C1HEDkH7.mjs";
1
+ import { n as Identifier, r as WorldStateObject, t as BaseContentObject } from "../../WorldStateObject-C2KjQZjd.mjs";
2
2
  export { BaseContentObject, Identifier, WorldStateObject };
@@ -1,3 +1,52 @@
1
- import { t as WorldStateObject } from "../../WorldStateObject-45dbRgp7.mjs";
2
-
3
- export { WorldStateObject };
1
+ import { fromNow, insist, parseDate, timeDeltaToString } from "warframe-worldstate-data/utilities";
2
+ //#region lib/models/WorldStateObject.ts
3
+ /**
4
+ * Represents a generic object from WorldState
5
+ */
6
+ var WorldStateObject = class {
7
+ /**
8
+ * The object's id field
9
+ */
10
+ id;
11
+ /**
12
+ * The date and time at which the WorldStateObject started
13
+ */
14
+ activation;
15
+ /**
16
+ * The date and time at which the WorldStateObject ends
17
+ */
18
+ expiry;
19
+ /**
20
+ * @param data The object data
21
+ */
22
+ constructor(data) {
23
+ insist({ ...data });
24
+ this.id = data._id ? data._id.$oid || data._id.$id : void 0;
25
+ if (data.Activation) this.activation = parseDate(data.Activation);
26
+ if (data.Expiry) this.expiry = parseDate(data.Expiry);
27
+ }
28
+ /**
29
+ * Whether the void trader is active (at time of object creation)
30
+ */
31
+ get active() {
32
+ if (!this.activation && !this.expiry) return false;
33
+ return fromNow(this.activation) < 0 && fromNow(this.expiry) > 0;
34
+ }
35
+ /**
36
+ * A string indicating how long it will take for the trader to arrive
37
+ * (at time of object creation)
38
+ */
39
+ get startString() {
40
+ if (!this.activation) return void 0;
41
+ return timeDeltaToString(fromNow(this.activation));
42
+ }
43
+ /**
44
+ * Time delta string from now to the end
45
+ */
46
+ get endString() {
47
+ if (!this.expiry) return void 0;
48
+ return timeDeltaToString(fromNow(this.expiry));
49
+ }
50
+ };
51
+ //#endregion
52
+ export { WorldStateObject };
@@ -1,3 +1,2 @@
1
- import "../../WorldStateObject-C1HEDkH7.mjs";
2
- import { n as ZarimanCycle, t as CurrentZarimanCycle } from "../../ZarimanCycle-BrSLIWhD.mjs";
1
+ import { n as ZarimanCycle, t as CurrentZarimanCycle } from "../../ZarimanCycle-DyYiVfyG.mjs";
3
2
  export { CurrentZarimanCycle, ZarimanCycle };
@@ -1,4 +1,77 @@
1
- import "../../WorldStateObject-45dbRgp7.mjs";
2
- import { t as ZarimanCycle } from "../../ZarimanCycle-DoAPwgaM.mjs";
3
-
4
- export { ZarimanCycle };
1
+ import { WorldStateObject } from "./WorldStateObject.mjs";
2
+ import { fromNow, timeDeltaToString } from "warframe-worldstate-data/utilities";
3
+ //#region lib/models/ZarimanCycle.ts
4
+ const corpusTimeMillis = 16551828e5;
5
+ const fullCycle = 18e6;
6
+ const stateMaximum = 9e6;
7
+ /**
8
+ * Represents the current Zariman Corpus/Grineer Cycle
9
+ * @augments {WorldStateObject}
10
+ */
11
+ var ZarimanCycle = class extends WorldStateObject {
12
+ /**
13
+ * Whether or not this it's corpus or grineer
14
+ */
15
+ isCorpus;
16
+ /**
17
+ * Current cycle state. One of `corpus`, `grineer`
18
+ */
19
+ state;
20
+ /**
21
+ * Time remaining string
22
+ */
23
+ timeLeft;
24
+ /**
25
+ * The current zariman cycle, for calculating the other fields
26
+ */
27
+ #ec;
28
+ /**
29
+ * The end of the Zariman bounties timer, the faction changes exactly half way through
30
+ */
31
+ #bountiesEndDate;
32
+ /**
33
+ * @param {Date} bountiesEndDate The current Zariman cycle expiry
34
+ */
35
+ constructor(bountiesEndDate) {
36
+ super({ _id: { $oid: "zarimanCycle0" } });
37
+ this.#bountiesEndDate = bountiesEndDate;
38
+ this.#ec = this.getCurrentZarimanCycle();
39
+ this.expiry = this.#ec.expiry;
40
+ this.activation = new Date(this.#ec.start);
41
+ this.isCorpus = this.#ec.isCorpus;
42
+ this.state = this.#ec.state;
43
+ this.timeLeft = this.#ec.timeLeft;
44
+ this.id = `zarimanCycle${this.expiry.getTime()}`;
45
+ }
46
+ /**
47
+ * Whether this is expired
48
+ */
49
+ get expired() {
50
+ return this.expiry ? fromNow(this.expiry) < 0 : true;
51
+ }
52
+ getCurrentZarimanCycle() {
53
+ const now = Date.now();
54
+ const bountiesClone = this.#bountiesEndDate.getTime() - 5e3;
55
+ const millisLeft = fromNow(new Date(bountiesClone));
56
+ const isCorpus = fullCycle - ((bountiesClone - corpusTimeMillis) % fullCycle + fullCycle) % fullCycle > stateMaximum;
57
+ const minutesCoef = 1e3 * 60;
58
+ const expiry = new Date(Math.round((now + millisLeft) / minutesCoef) * minutesCoef);
59
+ const state = isCorpus ? "corpus" : "grineer";
60
+ return {
61
+ isCorpus,
62
+ timeLeft: timeDeltaToString(millisLeft),
63
+ expiry,
64
+ expiresIn: millisLeft,
65
+ state,
66
+ start: expiry.getTime() - stateMaximum
67
+ };
68
+ }
69
+ /**
70
+ * The event's string representation
71
+ */
72
+ get shortString() {
73
+ return `${this.timeLeft.replace(/\s\d*s/gi, "")} to ${this.isCorpus ? "grineer" : "corpus"}`;
74
+ }
75
+ };
76
+ //#endregion
77
+ export { ZarimanCycle };
@@ -1,19 +1,18 @@
1
- import "../../Dependency-CNqXngHD.mjs";
2
- import { $ as Difficulty, A as InvasionParticipant, B as DefenderInfo, C as SortieVariant, D as SentientOutpost, E as OutpostMission, F as RawFlashSale, G as RawChallenge, H as DailyDeal, I as Fissure, J as Archimedea, K as ChallengeInstance, L as RawFissure, M as GlobalUpgrade, N as RawGlobalUpgrade, O as Kuva, P as FlashSale, Q as DeepArchimedea, R as DuviriCycle, S as RawSortieVariant, T as Simaris, U as RawDailyDeal, V as RawDarkSector, W as ConclaveChallenge, X as ArchimedeaMissionDifficulty, Y as ArchimedeaMission, Z as ArchimedeaMissionDifficultyRisk, _ as RawSyndicateJob, a as WorldEvent, at as RawMission, b as RawSortie, c as RawVoidTrader, ct as getItemType, d as RawVoidTraderItem, et as RawArchimedea, f as VoidTraderItem, g as SyndicateMission, h as RawSyndicateMission, i as RawWorldEvent, it as Mission, j as RawInvasion, k as Invasion, l as VoidTrader, lt as getItemTypeFull, m as Tmp, n as InterimStep, nt as Alert, o as RawWeeklyChallenge, ot as RawReward, p as InitialTmp, q as RawChallengeInstance, r as ProgressStep, rt as RawAlert, s as WeeklyChallenge, st as Reward, t as InterimRewardMessage, tt as RawArchimedeaMission, u as VoidTraderSchedule, v as RewardDrop, w as LibraryInfo, x as Sortie, y as SyndicateJob, z as DarkSector } from "../../index-Bgx8kIDy.mjs";
3
- import { n as Identifier, r as WorldStateObject, t as BaseContentObject } from "../../WorldStateObject-C1HEDkH7.mjs";
4
- import { i as RawDay, n as DayEvent, r as RawCalender, t as Calendar } from "../../Calendar-CRM0XhAy.mjs";
5
- import { n as CurrentCetusCycle, t as CetusCycle } from "../../CetusCycle-DQ4n05vO.mjs";
6
- import { t as CambionCycle } from "../../CambionCycle-OI3v1knd.mjs";
7
- import { t as ConstructionProgress } from "../../ConstructionProgress-DG2KzS0X.mjs";
8
- import { n as RawDarkSectorBattle, t as DarkSectorBattle } from "../../DarkSectorBattle-CiSe3kFm.mjs";
9
- import { n as EarthCycleType, t as EarthCycle } from "../../EarthCycle-CxtijnVV.mjs";
10
- import { t as Kinepage } from "../../Kinepage-B-Ym_VW5.mjs";
11
- import { t as MidrathCycle } from "../../MidrathCycle-E0gMF3AR.mjs";
12
- import { n as RawNews, t as News } from "../../News-DxEm-q6V.mjs";
13
- import { n as RawNightwaveChallenge, t as NightwaveChallenge } from "../../NightwaveChallenge-CG3uychc.mjs";
14
- import { n as RawNightwave, t as Nightwave } from "../../Nightwave-CPqMSqGK.mjs";
15
- import { n as RawPersistentEnemy, t as PersistentEnemy } from "../../PersistentEnemy-DnnnreSz.mjs";
16
- import { n as SteelPathOfferings, t as Incursion } from "../../SteelPathOffering-CQkoKi5T.mjs";
17
- import { t as VallisCycle } from "../../VallisCycle-6DCaWFoR.mjs";
18
- import { n as ZarimanCycle, t as CurrentZarimanCycle } from "../../ZarimanCycle-BrSLIWhD.mjs";
1
+ import { $ as Difficulty, A as InvasionParticipant, B as DefenderInfo, C as SortieVariant, D as SentientOutpost, E as OutpostMission, F as RawFlashSale, G as RawChallenge, H as DailyDeal, I as Fissure, J as Archimedea, K as ChallengeInstance, L as RawFissure, M as GlobalUpgrade, N as RawGlobalUpgrade, O as Kuva, P as FlashSale, Q as DeepArchimedea, R as DuviriCycle, S as RawSortieVariant, T as Simaris, U as RawDailyDeal, V as RawDarkSector, W as ConclaveChallenge, X as ArchimedeaMissionDifficulty, Y as ArchimedeaMission, Z as ArchimedeaMissionDifficultyRisk, _ as RawSyndicateJob, a as WorldEvent, at as RawMission, b as RawSortie, c as RawVoidTrader, ct as getItemType, d as RawVoidTraderItem, et as RawArchimedea, f as VoidTraderItem, g as SyndicateMission, h as RawSyndicateMission, i as RawWorldEvent, it as Mission, j as RawInvasion, k as Invasion, l as VoidTrader, lt as getItemTypeFull, m as Tmp, n as InterimStep, nt as Alert, o as RawWeeklyChallenge, ot as RawReward, p as InitialTmp, q as RawChallengeInstance, r as ProgressStep, rt as RawAlert, s as WeeklyChallenge, st as Reward, t as InterimRewardMessage, tt as RawArchimedeaMission, u as VoidTraderSchedule, v as RewardDrop, w as LibraryInfo, x as Sortie, y as SyndicateJob, z as DarkSector } from "../../index-C4EJ_Mpd.mjs";
2
+ import { n as Identifier, r as WorldStateObject, t as BaseContentObject } from "../../WorldStateObject-C2KjQZjd.mjs";
3
+ import { i as RawDay, n as DayEvent, r as RawCalender, t as Calendar } from "../../Calendar-C-rbmV_t.mjs";
4
+ import { n as CurrentCetusCycle, t as CetusCycle } from "../../CetusCycle-DaqfF4J1.mjs";
5
+ import { t as CambionCycle } from "../../CambionCycle-BzR_MfPH.mjs";
6
+ import { t as ConstructionProgress } from "../../ConstructionProgress-BRxmro3-.mjs";
7
+ import { n as RawDarkSectorBattle, t as DarkSectorBattle } from "../../DarkSectorBattle-DHRl5tG1.mjs";
8
+ import { n as EarthCycleType, t as EarthCycle } from "../../EarthCycle-C_oB5gDc.mjs";
9
+ import { t as Kinepage } from "../../Kinepage-CKBuvbv5.mjs";
10
+ import { t as MidrathCycle } from "../../MidrathCycle-CxveqDtx.mjs";
11
+ import { n as RawNews, t as News } from "../../News-CJ3lD7_g.mjs";
12
+ import { n as RawNightwaveChallenge, t as NightwaveChallenge } from "../../NightwaveChallenge-j_m4hVQU.mjs";
13
+ import { n as RawNightwave, t as Nightwave } from "../../Nightwave-BLHH02ht.mjs";
14
+ import { n as RawPersistentEnemy, t as PersistentEnemy } from "../../PersistentEnemy-BJ4twtUY.mjs";
15
+ import { n as SteelPathOfferings, t as Incursion } from "../../SteelPathOffering-DYjZ29sT.mjs";
16
+ import { t as VallisCycle } from "../../VallisCycle-as7DM4a-.mjs";
17
+ import { n as ZarimanCycle, t as CurrentZarimanCycle } from "../../ZarimanCycle-DyYiVfyG.mjs";
19
18
  export { Alert, Archimedea, ArchimedeaMission, ArchimedeaMissionDifficulty, ArchimedeaMissionDifficultyRisk, BaseContentObject, Calendar, CambionCycle, CetusCycle, ChallengeInstance, ConclaveChallenge, ConstructionProgress, CurrentCetusCycle, CurrentZarimanCycle, DailyDeal, DarkSector, DarkSectorBattle, DayEvent, DeepArchimedea, DefenderInfo, Difficulty, DuviriCycle, EarthCycle, EarthCycleType, Fissure, FlashSale, GlobalUpgrade, Identifier, Incursion, InitialTmp, InterimRewardMessage, InterimStep, Invasion, InvasionParticipant, Kinepage, Kuva, LibraryInfo, MidrathCycle, Mission, News, Nightwave, NightwaveChallenge, OutpostMission, PersistentEnemy, ProgressStep, RawAlert, RawArchimedea, RawArchimedeaMission, RawCalender, RawChallenge, RawChallengeInstance, RawDailyDeal, RawDarkSector, RawDarkSectorBattle, RawDay, RawFissure, RawFlashSale, RawGlobalUpgrade, RawInvasion, RawMission, RawNews, RawNightwave, RawNightwaveChallenge, RawPersistentEnemy, RawReward, RawSortie, RawSortieVariant, RawSyndicateJob, RawSyndicateMission, RawVoidTrader, RawVoidTraderItem, RawWeeklyChallenge, RawWorldEvent, Reward, RewardDrop, SentientOutpost, Simaris, Sortie, SortieVariant, SteelPathOfferings, SyndicateJob, SyndicateMission, Tmp, VallisCycle, VoidTrader, VoidTraderItem, VoidTraderSchedule, WeeklyChallenge, WorldEvent, WorldStateObject, ZarimanCycle, getItemType, getItemTypeFull };
@@ -1,47 +1,43 @@
1
- import "../../RewardTypes-DUrR7H3G.mjs";
2
- import { n as getItemType, r as getItemTypeFull, t as Reward } from "../../Reward-3FBJF_hS.mjs";
3
- import { t as Mission } from "../../Mission-b8KP-YDf.mjs";
4
- import { t as WorldStateObject } from "../../WorldStateObject-45dbRgp7.mjs";
5
- import { t as Alert } from "../../Alert-CPT2sBmd.mjs";
6
- import { n as ArchimedeaMission, t as Archimedea } from "../../Archimedea-Vo36QE99.mjs";
7
- import { n as DayEvent, t as Calendar } from "../../Calendar-_gEQ9BEd.mjs";
8
- import { t as CambionCycle } from "../../CambionCycle-B1pqIgks.mjs";
9
- import { t as CetusCycle } from "../../CetusCycle-Ct51M2pd.mjs";
10
- import { t as ChallengeInstance } from "../../ChallengeInstance-BOu_e7ML.mjs";
11
- import { t as ConclaveChallenge } from "../../ConclaveChallenge-BTN6UyV6.mjs";
12
- import { t as ConstructionProgress } from "../../ConstructionProgress-BoF2P9fx.mjs";
13
- import { t as DailyDeal } from "../../DailyDeal-aoNeCFWT.mjs";
14
- import { t as DarkSectorBattle } from "../../DarkSectorBattle-CqRYeNpe.mjs";
15
- import { t as DarkSector } from "../../DarkSector-D0uJWCg7.mjs";
16
- import { t as DuviriCycle } from "../../DuviriCycle-Do7mMnoC.mjs";
17
- import { t as EarthCycle } from "../../EarthCycle-BOAlcAuQ.mjs";
18
- import { t as Fissure } from "../../Fissure-diM4hyi3.mjs";
19
- import { t as FlashSale } from "../../FlashSale-CNfRaZhM.mjs";
20
- import { t as GlobalUpgrade } from "../../GlobalUpgrade-CUtZw05z.mjs";
21
- import { t as Invasion } from "../../Invasion-Corx1lxf.mjs";
22
- import { t as Kinepage } from "../../Kinepage-CbSzge67.mjs";
23
- import { t as Kuva } from "../../Kuva-Ijy2ZGBL.mjs";
24
- import { t as MidrathCycle } from "../../MidrathCycle-XD2T8Dx5.mjs";
25
- import { t as News } from "../../News-zAK-sYRg.mjs";
26
- import { t as NightwaveChallenge } from "../../NightwaveChallenge-C8ARG7LC.mjs";
27
- import { t as Nightwave } from "../../Nightwave-cTRmlbwH.mjs";
28
- import { t as PersistentEnemy } from "../../PersistentEnemy-3Sw5E8AN.mjs";
29
- import { t as SentientOutpost } from "../../SentientOutpost-Cadk-pIW.mjs";
30
- import { t as Simaris } from "../../Simaris-D6etEQp_.mjs";
31
- import { t as SortieVariant } from "../../SortieVariant-CnuLkkNZ.mjs";
32
- import { t as Sortie } from "../../Sortie-rSBgJc6U.mjs";
33
- import { t as SteelPathOfferings } from "../../SteelPathOffering--wm-7hwb.mjs";
34
- import "../../FetchProxy-Bkdk15SX.mjs";
35
- import "../../supporting-BLSXhlWM.mjs";
36
- import { t as SyndicateJob } from "../../SyndicateJob-R89tWqvT.mjs";
37
- import { t as SyndicateMission } from "../../SyndicateMission-CKZDWNyf.mjs";
38
- import { t as Tmp } from "../../Tmp-BYL_mYIG.mjs";
39
- import { t as VallisCycle } from "../../VallisCycle-BW2g49wB.mjs";
40
- import { t as VoidTraderItem } from "../../VoidTraderItem-Cz6x1KTF.mjs";
41
- import { t as VoidTraderSchedule } from "../../VoidTraderSchedule-BsJLu50V.mjs";
42
- import { t as VoidTrader } from "../../VoidTrader-DtjtVUgR.mjs";
43
- import { t as WeeklyChallenge } from "../../WeeklyChallenge-Dl2ekl6X.mjs";
44
- import { t as WorldEvent } from "../../WorldEvent-C-LaV2ug.mjs";
45
- import { t as ZarimanCycle } from "../../ZarimanCycle-DoAPwgaM.mjs";
46
-
47
- export { Alert, Archimedea, ArchimedeaMission, Calendar, CambionCycle, CetusCycle, ChallengeInstance, ConclaveChallenge, ConstructionProgress, DailyDeal, DarkSector, DarkSectorBattle, DayEvent, DuviriCycle, EarthCycle, Fissure, FlashSale, GlobalUpgrade, Invasion, Kinepage, Kuva, MidrathCycle, Mission, News, Nightwave, NightwaveChallenge, PersistentEnemy, Reward, SentientOutpost, Simaris, Sortie, SortieVariant, SteelPathOfferings, SyndicateJob, SyndicateMission, Tmp, VallisCycle, VoidTrader, VoidTraderItem, VoidTraderSchedule, WeeklyChallenge, WorldEvent, WorldStateObject, ZarimanCycle, getItemType, getItemTypeFull };
1
+ import { Reward, getItemType, getItemTypeFull } from "./Reward.mjs";
2
+ import { Mission } from "./Mission.mjs";
3
+ import { WorldStateObject } from "./WorldStateObject.mjs";
4
+ import { Alert } from "./Alert.mjs";
5
+ import { Archimedea, ArchimedeaMission } from "./Archimedea.mjs";
6
+ import { Calendar, DayEvent } from "./Calendar.mjs";
7
+ import { CambionCycle } from "./CambionCycle.mjs";
8
+ import { CetusCycle } from "./CetusCycle.mjs";
9
+ import { ChallengeInstance } from "./ChallengeInstance.mjs";
10
+ import { ConclaveChallenge } from "./ConclaveChallenge.mjs";
11
+ import { ConstructionProgress } from "./ConstructionProgress.mjs";
12
+ import { DailyDeal } from "./DailyDeal.mjs";
13
+ import { DarkSectorBattle } from "./DarkSectorBattle.mjs";
14
+ import { DarkSector } from "./DarkSector.mjs";
15
+ import { DuviriCycle } from "./DuviriCycle.mjs";
16
+ import { EarthCycle } from "./EarthCycle.mjs";
17
+ import { Fissure } from "./Fissure.mjs";
18
+ import { FlashSale } from "./FlashSale.mjs";
19
+ import { GlobalUpgrade } from "./GlobalUpgrade.mjs";
20
+ import { Invasion } from "./Invasion.mjs";
21
+ import { Kinepage } from "./Kinepage.mjs";
22
+ import { Kuva } from "./Kuva.mjs";
23
+ import { MidrathCycle } from "./MidrathCycle.mjs";
24
+ import { News } from "./News.mjs";
25
+ import { NightwaveChallenge } from "./NightwaveChallenge.mjs";
26
+ import { Nightwave } from "./Nightwave.mjs";
27
+ import { PersistentEnemy } from "./PersistentEnemy.mjs";
28
+ import { SentientOutpost } from "./SentientOutpost.mjs";
29
+ import { Simaris } from "./Simaris.mjs";
30
+ import { SortieVariant } from "./SortieVariant.mjs";
31
+ import { Sortie } from "./Sortie.mjs";
32
+ import { SteelPathOfferings } from "./SteelPathOffering.mjs";
33
+ import { SyndicateJob } from "./SyndicateJob.mjs";
34
+ import { SyndicateMission } from "./SyndicateMission.mjs";
35
+ import { Tmp } from "./Tmp.mjs";
36
+ import { VallisCycle } from "./VallisCycle.mjs";
37
+ import { VoidTraderItem } from "./VoidTraderItem.mjs";
38
+ import { VoidTraderSchedule } from "./VoidTraderSchedule.mjs";
39
+ import { VoidTrader } from "./VoidTrader.mjs";
40
+ import { WeeklyChallenge } from "./WeeklyChallenge.mjs";
41
+ import { WorldEvent } from "./WorldEvent.mjs";
42
+ import { ZarimanCycle } from "./ZarimanCycle.mjs";
43
+ export { Alert, Archimedea, ArchimedeaMission, Calendar, CambionCycle, CetusCycle, ChallengeInstance, ConclaveChallenge, ConstructionProgress, DailyDeal, DarkSector, DarkSectorBattle, DayEvent, DuviriCycle, EarthCycle, Fissure, FlashSale, GlobalUpgrade, Invasion, Kinepage, Kuva, MidrathCycle, Mission, News, Nightwave, NightwaveChallenge, PersistentEnemy, Reward, SentientOutpost, Simaris, Sortie, SortieVariant, SteelPathOfferings, SyndicateJob, SyndicateMission, Tmp, VallisCycle, VoidTrader, VoidTraderItem, VoidTraderSchedule, WeeklyChallenge, WorldEvent, WorldStateObject, ZarimanCycle, getItemType, getItemTypeFull };
@@ -1,2 +1,2 @@
1
- import { t as Dependency } from "../../Dependency-CNqXngHD.mjs";
1
+ import { t as Dependency } from "../../Dependency-Cd-TxBJy.mjs";
2
2
  export { Dependency };
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -1,18 +1,2 @@
1
- import "../../Dependency-CNqXngHD.mjs";
2
- import { dt as RawChoice, ut as DuviriChoice } 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 { dt as RawChoice, ut as DuviriChoice } from "../../index-C4EJ_Mpd.mjs";
18
2
  export { DuviriChoice, RawChoice };
@@ -1,3 +1,24 @@
1
- import { t as DuviriChoice } from "../../DuviriChoice-BEBiWA-g.mjs";
2
-
3
- export { DuviriChoice };
1
+ //#region lib/supporting/DuviriChoice.ts
2
+ /**
3
+ * Single category of duviri choices
4
+ */
5
+ var DuviriChoice = class {
6
+ category;
7
+ categoryKey;
8
+ choices;
9
+ constructor(data) {
10
+ switch (data.Category) {
11
+ case "EXC_NORMAL":
12
+ this.category = "normal";
13
+ break;
14
+ case "EXC_HARD":
15
+ this.category = "hard";
16
+ break;
17
+ default: throw new Error(`Unknown category ${data.Category}`);
18
+ }
19
+ this.categoryKey = data.Category;
20
+ this.choices = data.Choices;
21
+ }
22
+ };
23
+ //#endregion
24
+ export { DuviriChoice };
@@ -1,2 +1,2 @@
1
- import { t as ExternalMission } from "../../ExternalMission-C82w4uMq.mjs";
1
+ import { t as ExternalMission } from "../../ExternalMission-CT__oi7Q.mjs";
2
2
  export { ExternalMission };
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -1,2 +1,2 @@
1
- import { t as fetchProxy } from "../../FetchProxy-DfSTUgkf.mjs";
1
+ import { t as fetchProxy } from "../../FetchProxy-DHSI4JPP.mjs";
2
2
  export { fetchProxy };
@@ -1,3 +1,45 @@
1
- import { t as fetchProxy } from "../../FetchProxy-Bkdk15SX.mjs";
2
-
3
- export { fetchProxy };
1
+ //#region lib/supporting/FetchProxy.ts
2
+ const proxyUrl = process.env.PROXY_URL ?? void 0;
3
+ const isCI = process.env.CI === "true";
4
+ const ciTimeout = process.env.CI_TIMEOUT ? parseInt(process.env.CI_TIMEOUT, 10) : 6e4;
5
+ const localTimeout = process.env.LOCAL_TIMEOUT ? parseInt(process.env.LOCAL_TIMEOUT, 10) : 12e6;
6
+ const fetchProxy = async (url, { session = "parser-session", contentType = "application/json" } = {
7
+ session: "parser-session",
8
+ contentType: "application/json"
9
+ }) => {
10
+ if (proxyUrl) {
11
+ const text = await (await fetch(`${proxyUrl}/v1`, {
12
+ method: "POST",
13
+ headers: { "Content-Type": "application/json" },
14
+ body: JSON.stringify({
15
+ cmd: "request.get",
16
+ url,
17
+ session,
18
+ maxTimeout: isCI ? ciTimeout : localTimeout,
19
+ returnOnlyCookies: false,
20
+ returnPageContent: true
21
+ })
22
+ })).text();
23
+ const { solution } = JSON.parse(text);
24
+ if (!solution?.response) throw solution;
25
+ if (contentType === "application/json") return {
26
+ ok: solution.responseCode === 200,
27
+ status: solution.responseCode,
28
+ json: async () => {
29
+ try {
30
+ return JSON.parse(solution.response);
31
+ } catch (_error) {
32
+ return {};
33
+ }
34
+ }
35
+ };
36
+ if (contentType === "text/html") return {
37
+ ok: solution.responseCode === 200,
38
+ status: solution.responseCode,
39
+ text: async () => solution.response.replace(/<\/?[^>]+(>|$)/g, "")
40
+ };
41
+ return solution.response;
42
+ } else return fetch(url);
43
+ };
44
+ //#endregion
45
+ export { fetchProxy };
@@ -1,2 +1,2 @@
1
- import { n as deProxy, r as wfCdn, t as cdn } from "../../ImgCdn-D0hSGSB1.mjs";
1
+ import { n as deProxy, r as wfCdn, t as cdn } from "../../ImgCdn-DIhZrwap.mjs";
2
2
  export { cdn, deProxy, wfCdn };
@@ -1,3 +1,6 @@
1
- import { n as deProxy, r as wfCdn, t as cdn } from "../../ImgCdn-BJOdWAbU.mjs";
2
-
3
- export { cdn, deProxy, wfCdn };
1
+ //#region lib/supporting/ImgCdn.ts
2
+ const cdn = (path) => `https://cdn.warframestat.us/genesis/${path}`;
3
+ const wfCdn = (path) => `https://cdn.warframestat.us/img/${path}`;
4
+ const deProxy = (url) => url.replace("https://forums.warframe.com/applications/core/interface/imageproxy/imageproxy.php?img=", "").replace(/&key=\w*/gi, "").replace("http://", "https://");
5
+ //#endregion
6
+ export { cdn, deProxy, wfCdn };