warframe-worldstate-parser 5.2.12 → 5.2.13

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 (98) hide show
  1. package/dist/{Alert-DmPDiTMU.d.mts → Alert-CXF2Z-1T.d.mts} +4 -4
  2. package/dist/{Archidemea-D87NgPnh.d.mts → Archidemea-Cz5f5mO4.d.mts} +2 -2
  3. package/dist/{Calendar-bmnOPyG8.d.mts → Calendar-DYcJQeUa.d.mts} +1 -1
  4. package/dist/{CambionCycle-BqqaE-K-.d.mts → CambionCycle-BWvDFHKA.d.mts} +2 -2
  5. package/dist/{CetusCycle-eDOf8_NN.d.mts → CetusCycle-yvOEjkgM.d.mts} +1 -1
  6. package/dist/{ChallengeInstance-DB56npsp.d.mts → ChallengeInstance-B_3KnbyT.d.mts} +1 -1
  7. package/dist/{ConclaveChallenge-B4zjsE6H.d.mts → ConclaveChallenge-uZ0oYk9e.d.mts} +2 -2
  8. package/dist/{ConstructionProgress-Y5M4kY6i.d.mts → ConstructionProgress-Df9wkF6v.d.mts} +1 -1
  9. package/dist/{DailyDeal-YPfZAtZm.d.mts → DailyDeal-oEVS6ilW.d.mts} +2 -2
  10. package/dist/{DarkSector-BgUzu7ji.d.mts → DarkSector-CKfnMGsZ.d.mts} +4 -4
  11. package/dist/{DarkSectorBattle-Dv8NzJV7.d.mts → DarkSectorBattle-6Rn7YpT7.d.mts} +1 -1
  12. package/dist/{Dependency-CNDia70k.d.mts → Dependency-CSKUY3rf.d.mts} +1 -1
  13. package/dist/{DuviriChoice-Dzw114Vc.d.mts → DuviriChoice-DYsa_ggn.d.mts} +1 -1
  14. package/dist/{DuviriCycle-RSsB4KI3.d.mts → DuviriCycle-CXL7Lztx.d.mts} +2 -2
  15. package/dist/{EarthCycle-COO7wlLW.d.mts → EarthCycle-LH8s0Lhw.d.mts} +1 -1
  16. package/dist/{Fissure-DMHOvKp4.d.mts → Fissure-C0kjA66u.d.mts} +2 -2
  17. package/dist/{FlashSale-BlLg7pGm.d.mts → FlashSale-CnfQLuVA.d.mts} +2 -2
  18. package/dist/{GlobalUpgrade-8xZ7QLIe.d.mts → GlobalUpgrade-CGIiG66-.d.mts} +2 -2
  19. package/dist/{Invasion-CmYbho4F.d.mts → Invasion-D8U6YHiR.d.mts} +3 -3
  20. package/dist/{Mission-EUB_O6c1.d.mts → Mission-BJlVA-sm.d.mts} +2 -2
  21. package/dist/{News-BAIxF_MP.d.mts → News-CGpkrc6F.d.mts} +1 -1
  22. package/dist/{Nightwave-cYL4PyAv.d.mts → Nightwave-DTQksQJ1.d.mts} +2 -2
  23. package/dist/{NightwaveChallenge-D6Tr17Yw.d.mts → NightwaveChallenge-DAMnDdda.d.mts} +1 -1
  24. package/dist/{PersistentEnemy-DBPQGf3A.d.mts → PersistentEnemy-BndRTL7c.d.mts} +1 -1
  25. package/dist/{Reward-CtK9c0sX.d.mts → Reward-CQ5fnfGv.d.mts} +2 -2
  26. package/dist/{SentientOutpost-uqJtS--v.d.mts → SentientOutpost-DtFyMZgh.d.mts} +1 -1
  27. package/dist/{Simaris-owdTviJJ.d.mts → Simaris-CfajVEDs.d.mts} +1 -1
  28. package/dist/{Sortie-D6nJhiyi.d.mts → Sortie-CcmgVhMp.d.mts} +4 -4
  29. package/dist/{SortieVariant-1fo_ZNCj.d.mts → SortieVariant-Dq1ap8Vj.d.mts} +1 -1
  30. package/dist/{SyndicateJob-nU_LYWIG.d.mts → SyndicateJob-BShg8By1.d.mts} +2 -2
  31. package/dist/{SyndicateMission-DKjOQMTr.d.mts → SyndicateMission-CCyl4jtq.d.mts} +3 -3
  32. package/dist/{VallisCycle-Do8kWk0_.d.mts → VallisCycle-CfUcMlno.d.mts} +1 -1
  33. package/dist/{VoidTrader-LuPERTUa.d.mts → VoidTrader-CyW5f24k.d.mts} +4 -4
  34. package/dist/{VoidTraderItem-83an95lh.d.mts → VoidTraderItem-Bg8_rReH.d.mts} +1 -1
  35. package/dist/{VoidTraderSchedule-DYRSLebw.d.mts → VoidTraderSchedule-D_oo6wbz.d.mts} +1 -1
  36. package/dist/{WeeklyChallenge-C2oTkgtR.d.mts → WeeklyChallenge-y44JasTT.d.mts} +2 -2
  37. package/dist/{WorldEvent-DoHnEWZL.d.mts → WorldEvent-CWpEcJtK.d.mts} +4 -4
  38. package/dist/{ZarimanCycle-BCxG1i_j.d.mts → ZarimanCycle-D7E0AeuR.d.mts} +1 -1
  39. package/dist/lib/Tmp.d.mts +3 -3
  40. package/dist/lib/WorldState.d.mts +275 -41
  41. package/dist/lib/WorldState.mjs +334 -30
  42. package/dist/lib/models/Alert.d.mts +5 -5
  43. package/dist/lib/models/Archidemea.d.mts +3 -3
  44. package/dist/lib/models/Calendar.d.mts +2 -2
  45. package/dist/lib/models/CambionCycle.d.mts +3 -3
  46. package/dist/lib/models/CetusCycle.d.mts +2 -2
  47. package/dist/lib/models/ChallengeInstance.d.mts +2 -2
  48. package/dist/lib/models/ConclaveChallenge.d.mts +3 -3
  49. package/dist/lib/models/ConstructionProgress.d.mts +2 -2
  50. package/dist/lib/models/DailyDeal.d.mts +3 -3
  51. package/dist/lib/models/DarkSector.d.mts +6 -6
  52. package/dist/lib/models/DarkSectorBattle.d.mts +2 -2
  53. package/dist/lib/models/DuviriCycle.d.mts +3 -3
  54. package/dist/lib/models/EarthCycle.d.mts +2 -2
  55. package/dist/lib/models/Fissure.d.mts +3 -3
  56. package/dist/lib/models/FlashSale.d.mts +3 -3
  57. package/dist/lib/models/GlobalUpgrade.d.mts +3 -3
  58. package/dist/lib/models/Invasion.d.mts +4 -4
  59. package/dist/lib/models/Kinepage.d.mts +1 -1
  60. package/dist/lib/models/Kuva.d.mts +2 -2
  61. package/dist/lib/models/MidrathCycle.d.mts +1 -1
  62. package/dist/lib/models/Mission.d.mts +3 -3
  63. package/dist/lib/models/News.d.mts +2 -2
  64. package/dist/lib/models/Nightwave.d.mts +3 -3
  65. package/dist/lib/models/NightwaveChallenge.d.mts +2 -2
  66. package/dist/lib/models/PersistentEnemy.d.mts +2 -2
  67. package/dist/lib/models/Reward.d.mts +2 -2
  68. package/dist/lib/models/SentientOutpost.d.mts +2 -2
  69. package/dist/lib/models/Simaris.d.mts +2 -2
  70. package/dist/lib/models/Sortie.d.mts +6 -6
  71. package/dist/lib/models/SortieVariant.d.mts +2 -2
  72. package/dist/lib/models/SteelPathOffering.d.mts +1 -1
  73. package/dist/lib/models/SyndicateJob.d.mts +3 -3
  74. package/dist/lib/models/SyndicateMission.d.mts +4 -4
  75. package/dist/lib/models/VallisCycle.d.mts +2 -2
  76. package/dist/lib/models/VoidTrader.d.mts +5 -5
  77. package/dist/lib/models/VoidTraderItem.d.mts +2 -2
  78. package/dist/lib/models/VoidTraderSchedule.d.mts +2 -2
  79. package/dist/lib/models/WeeklyChallenge.d.mts +4 -4
  80. package/dist/lib/models/WorldEvent.d.mts +5 -5
  81. package/dist/lib/models/WorldstateObject.d.mts +1 -1
  82. package/dist/lib/models/ZarimanCycle.d.mts +2 -2
  83. package/dist/lib/supporting/Dependency.d.mts +1 -1
  84. package/dist/lib/supporting/DuviriChoice.d.mts +2 -2
  85. package/dist/lib/supporting/ExternalMission.d.mts +1 -1
  86. package/dist/lib/supporting/KuvaLogEntry.d.mts +1 -1
  87. package/dist/lib/supporting/RewardTypes.d.mts +1 -1
  88. package/dist/main.d.mts +41 -41
  89. package/dist/main.mjs +1 -1
  90. package/package.json +1 -1
  91. package/dist/WorldState-CBf4G0xk.d.mts +0 -268
  92. package/dist/WorldState-D6TgRJLd.mjs +0 -336
  93. /package/dist/{ExternalMission-Do2VcpoL.d.mts → ExternalMission-DeoVC7ra.d.mts} +0 -0
  94. /package/dist/{Kinepage-B5KWyc4P.d.mts → Kinepage-yW6FgpW4.d.mts} +0 -0
  95. /package/dist/{KuvaLogEntry-CZ94k8nV.d.mts → KuvaLogEntry-CBItxLlZ.d.mts} +0 -0
  96. /package/dist/{RewardTypes-BjS_ZS-W.d.mts → RewardTypes-nWMw8qZb.d.mts} +0 -0
  97. /package/dist/{SteelPathOffering-BpsSBlnS.d.mts → SteelPathOffering-CHBuC34b.d.mts} +0 -0
  98. /package/dist/{WorldstateObject-D9aUaGek.d.mts → WorldstateObject-C5n5EJvt.d.mts} +0 -0
@@ -1,42 +1,276 @@
1
- import "../Dependency-CNDia70k.mjs";
2
- import "../SentientOutpost-uqJtS--v.mjs";
3
- import "../Reward-CtK9c0sX.mjs";
4
- import "../Mission-EUB_O6c1.mjs";
5
- import "../WorldstateObject-D9aUaGek.mjs";
6
- import "../Alert-DmPDiTMU.mjs";
7
- import "../Archidemea-D87NgPnh.mjs";
8
- import "../Calendar-bmnOPyG8.mjs";
9
- import "../CetusCycle-eDOf8_NN.mjs";
10
- import "../CambionCycle-BqqaE-K-.mjs";
11
- import "../ConclaveChallenge-B4zjsE6H.mjs";
12
- import "../ConstructionProgress-Y5M4kY6i.mjs";
13
- import "../DailyDeal-YPfZAtZm.mjs";
14
- import "../DarkSectorBattle-Dv8NzJV7.mjs";
15
- import "../DarkSector-BgUzu7ji.mjs";
16
- import "../DuviriChoice-Dzw114Vc.mjs";
17
- import "../DuviriCycle-RSsB4KI3.mjs";
18
- import "../EarthCycle-COO7wlLW.mjs";
19
- import "../Fissure-DMHOvKp4.mjs";
20
- import "../FlashSale-BlLg7pGm.mjs";
21
- import "../GlobalUpgrade-8xZ7QLIe.mjs";
22
- import "../Invasion-CmYbho4F.mjs";
23
- import "../News-BAIxF_MP.mjs";
24
- import "../NightwaveChallenge-D6Tr17Yw.mjs";
25
- import "../Nightwave-cYL4PyAv.mjs";
26
- import "../PersistentEnemy-DBPQGf3A.mjs";
27
- import "../Simaris-owdTviJJ.mjs";
28
- import "../SortieVariant-1fo_ZNCj.mjs";
29
- import "../Sortie-D6nJhiyi.mjs";
30
- import "../SteelPathOffering-BpsSBlnS.mjs";
31
- import "../SyndicateJob-nU_LYWIG.mjs";
32
- import "../SyndicateMission-DKjOQMTr.mjs";
33
- import "../VallisCycle-Do8kWk0_.mjs";
34
- import "../VoidTraderItem-83an95lh.mjs";
35
- import "../VoidTraderSchedule-DYRSLebw.mjs";
36
- import "../VoidTrader-LuPERTUa.mjs";
37
- import "../ChallengeInstance-DB56npsp.mjs";
38
- import "../WeeklyChallenge-C2oTkgtR.mjs";
39
- import "../WorldEvent-DoHnEWZL.mjs";
40
- import "../ZarimanCycle-BCxG1i_j.mjs";
41
- import { a as parseAsyncArray, i as parseArray, n as WorldState, r as _default, t as InitialWorldState } from "../WorldState-CBf4G0xk.mjs";
1
+ import { t as Kinepage } from "../Kinepage-yW6FgpW4.mjs";
2
+ import { t as Dependency } from "../Dependency-CSKUY3rf.mjs";
3
+ import { n as SentientOutpost } from "../SentientOutpost-DtFyMZgh.mjs";
4
+ import "../Reward-CQ5fnfGv.mjs";
5
+ import "../Mission-BJlVA-sm.mjs";
6
+ import { r as WorldstateObject, t as BaseContentObject } from "../WorldstateObject-C5n5EJvt.mjs";
7
+ import { n as RawAlert, t as Alert } from "../Alert-CXF2Z-1T.mjs";
8
+ import { i as RawArchimedea, t as Archimedea } from "../Archidemea-Cz5f5mO4.mjs";
9
+ import { r as RawCalender, t as Calendar } from "../Calendar-DYcJQeUa.mjs";
10
+ import { t as CetusCycle } from "../CetusCycle-yvOEjkgM.mjs";
11
+ import { t as CambionCycle } from "../CambionCycle-BWvDFHKA.mjs";
12
+ import { n as RawChallenge, t as ConclaveChallenge } from "../ConclaveChallenge-uZ0oYk9e.mjs";
13
+ import { t as ConstructionProgress } from "../ConstructionProgress-Df9wkF6v.mjs";
14
+ import { n as RawDailyDeal, t as DailyDeal } from "../DailyDeal-oEVS6ilW.mjs";
15
+ import "../DarkSectorBattle-6Rn7YpT7.mjs";
16
+ import { r as RawDarkSector, t as DarkSector } from "../DarkSector-CKfnMGsZ.mjs";
17
+ import { n as RawChoice } from "../DuviriChoice-DYsa_ggn.mjs";
18
+ import { t as DuviriCycle } from "../DuviriCycle-CXL7Lztx.mjs";
19
+ import { t as EarthCycle } from "../EarthCycle-LH8s0Lhw.mjs";
20
+ import { n as RawFissure, t as Fissure } from "../Fissure-C0kjA66u.mjs";
21
+ import { n as RawFlashSale, t as FlashSale } from "../FlashSale-CnfQLuVA.mjs";
22
+ import { n as RawGlobalUpgrade, t as GlobalUpgrade } from "../GlobalUpgrade-CGIiG66-.mjs";
23
+ import { r as RawInvasion, t as Invasion } from "../Invasion-D8U6YHiR.mjs";
24
+ import { n as RawNews, t as News } from "../News-CGpkrc6F.mjs";
25
+ import "../NightwaveChallenge-DAMnDdda.mjs";
26
+ import { n as RawNightwave, t as Nightwave } from "../Nightwave-DTQksQJ1.mjs";
27
+ import { n as RawPersistentEnemy, t as PersistentEnemy } from "../PersistentEnemy-BndRTL7c.mjs";
28
+ import { n as Simaris, t as LibraryInfo } from "../Simaris-CfajVEDs.mjs";
29
+ import "../SortieVariant-Dq1ap8Vj.mjs";
30
+ import { n as Sortie, t as RawSortie } from "../Sortie-CcmgVhMp.mjs";
31
+ import { n as SteelPathOfferings } from "../SteelPathOffering-CHBuC34b.mjs";
32
+ import "../SyndicateJob-BShg8By1.mjs";
33
+ import { n as SyndicateMission, t as RawSyndicateMission } from "../SyndicateMission-CCyl4jtq.mjs";
34
+ import { t as VallisCycle } from "../VallisCycle-CfUcMlno.mjs";
35
+ import "../VoidTraderItem-Bg8_rReH.mjs";
36
+ import "../VoidTraderSchedule-D_oo6wbz.mjs";
37
+ import { n as VoidTrader, t as RawVoidTrader } from "../VoidTrader-CyW5f24k.mjs";
38
+ import "../ChallengeInstance-B_3KnbyT.mjs";
39
+ import { n as WeeklyChallenge, t as RawWeeklyChallenge } from "../WeeklyChallenge-y44JasTT.mjs";
40
+ import { a as WorldEvent, i as RawWorldEvent } from "../WorldEvent-CWpEcJtK.mjs";
41
+ import { n as ZarimanCycle } from "../ZarimanCycle-D7E0AeuR.mjs";
42
+ import { t as ExternalMission } from "../ExternalMission-DeoVC7ra.mjs";
43
+
44
+ //#region lib/WorldState.d.ts
45
+ /**
46
+ *
47
+ * @param ParserClass class for parsing data
48
+ * @param dataArray array of raw data
49
+ * @param deps shared dependency object
50
+ * @param uniqueField field to treat as unique
51
+ * @returns array of parsed objects
52
+ */
53
+ declare function parseArray<T, D extends BaseContentObject>(
54
+ // Not all instances of T extend WorldstateObject
55
+ ParserClass: new (data: D, deps: Dependency) => T, dataArray: Array<D>, deps: Dependency, uniqueField?: keyof T): T[];
56
+ /**
57
+ * Parse array of objects that requires async parsing
58
+ * @param ParserClass class for parsing data - must expose a static build method
59
+ * @param dataArray array of raw data
60
+ * @param deps shared dependency object
61
+ * @param uniqueField field to treat as unique
62
+ * @returns array of parsed objects
63
+ */
64
+ declare function parseAsyncArray<T extends WorldstateObject, D extends BaseContentObject>(ParserClass: {
65
+ build: (data: D, deps: Dependency) => Promise<T>;
66
+ }, dataArray: Array<D>, deps: Dependency, uniqueField?: keyof T): Promise<T[]>;
67
+ interface InitialWorldState {
68
+ Time: number;
69
+ BuildLabel: string;
70
+ Events: RawNews[];
71
+ Goals: RawWorldEvent[];
72
+ Alerts: RawAlert[];
73
+ Sorties: RawSortie[];
74
+ LiteSorties: RawSortie[];
75
+ SyndicateMissions: RawSyndicateMission[];
76
+ ActiveMissions: RawFissure[];
77
+ VoidStorms: RawFissure[];
78
+ GlobalUpgrades: RawGlobalUpgrade[];
79
+ FlashSales: RawFlashSale[];
80
+ Invasions: RawInvasion[];
81
+ BadlandNodes: RawDarkSector[];
82
+ VoidTraders: RawVoidTrader[];
83
+ DailyDeals: RawDailyDeal[];
84
+ LibraryInfo?: LibraryInfo;
85
+ PVPChallengeInstances: RawChallenge[];
86
+ PersistentEnemies: RawPersistentEnemy[];
87
+ WeeklyChallenges?: RawWeeklyChallenge;
88
+ ProjectPct: number[];
89
+ SeasonInfo: RawNightwave;
90
+ PrimeVaultTraders: RawVoidTrader[];
91
+ EndlessXpChoices: RawChoice[];
92
+ KnownCalendarSeasons: RawCalender[];
93
+ Conquests: RawArchimedea[];
94
+ Tmp: string;
95
+ }
96
+ /**
97
+ * Parses Warframe Worldstate JSON
98
+ */
99
+ declare class WorldState {
100
+ /**
101
+ * The date and time at which the World State was generated
102
+ */
103
+ timestamp: Date;
104
+ /**
105
+ * Current Warframe version
106
+ */
107
+ buildLabel: string;
108
+ /**
109
+ * The in-game news
110
+ */
111
+ news: News[];
112
+ /**
113
+ * The current events
114
+ */
115
+ events: WorldEvent[];
116
+ /**
117
+ * The current alerts
118
+ */
119
+ alerts: Alert[];
120
+ /**
121
+ * The current sortie
122
+ */
123
+ sortie: Sortie;
124
+ /**
125
+ * The current syndicate missions
126
+ */
127
+ syndicateMissions: SyndicateMission[];
128
+ /**
129
+ * The current fissures: 'ActiveMissions' & 'VoidStorms'
130
+ */
131
+ fissures: Fissure[];
132
+ /**
133
+ * The current global upgrades
134
+ */
135
+ globalUpgrades: GlobalUpgrade[];
136
+ /**
137
+ * The current flash sales
138
+ */
139
+ flashSales: FlashSale[];
140
+ /**
141
+ * The current invasions
142
+ */
143
+ invasions: Invasion[];
144
+ /**
145
+ * The state of the dark sectors
146
+ */
147
+ darkSectors: DarkSector[];
148
+ /**
149
+ * The state of all Void Traders
150
+ */
151
+ voidTraders: VoidTrader[];
152
+ /**
153
+ * The first entry for voidTraders
154
+ * @deprecated
155
+ */
156
+ voidTrader: VoidTrader;
157
+ /**
158
+ * The current daily deals
159
+ */
160
+ dailyDeals: DailyDeal[];
161
+ /**
162
+ * The state of the sanctuary synthesis targets
163
+ */
164
+ simaris: Simaris;
165
+ /**
166
+ * The current conclave challenges
167
+ */
168
+ conclaveChallenges: ConclaveChallenge[];
169
+ /**
170
+ * The currently active persistent enemies
171
+ */
172
+ persistentEnemies: PersistentEnemy[];
173
+ /**
174
+ * The current earth cycle
175
+ */
176
+ earthCycle: EarthCycle;
177
+ /**
178
+ * The current Cetus cycle
179
+ */
180
+ cetusCycle: CetusCycle;
181
+ /**
182
+ * Cambion Drift Cycle
183
+ */
184
+ cambionCycle: CambionCycle;
185
+ /**
186
+ * The current Zariman cycle based off current time
187
+ */
188
+ zarimanCycle: ZarimanCycle;
189
+ /**
190
+ * Midrath cycle (soulframe)
191
+ * Game seems to desync while you play and appearntly it changes between updates.
192
+ */
193
+ /**
194
+ * Weekly challenges
195
+ */
196
+ weeklyChallenges?: WeeklyChallenge;
197
+ /**
198
+ * The Current construction progress for Fomorians/Razorback/etc.
199
+ */
200
+ constructionProgress: ConstructionProgress;
201
+ /**
202
+ * The current Orb Vallis cycle state
203
+ */
204
+ vallisCycle: VallisCycle;
205
+ /**
206
+ * The current nightwave season
207
+ */
208
+ nightwave?: Nightwave;
209
+ /**
210
+ * Kuva missions array
211
+ */
212
+ kuva?: ExternalMission[];
213
+ /**
214
+ * Arbitration mission
215
+ */
216
+ arbitration?: ExternalMission;
217
+ /**
218
+ * Current sentient outposts
219
+ */
220
+ sentientOutposts: SentientOutpost;
221
+ /**
222
+ * Steel path offering rotation
223
+ */
224
+ steelPath: SteelPathOfferings;
225
+ /**
226
+ * The current prime resurgence
227
+ */
228
+ vaultTrader: VoidTrader;
229
+ /**
230
+ * The current archon hunt
231
+ */
232
+ archonHunt: Sortie;
233
+ /**
234
+ * Current Duviri circuit choices
235
+ */
236
+ duviriCycle: DuviriCycle;
237
+ /**
238
+ * Current kinepage message
239
+ */
240
+ kinepage: Kinepage;
241
+ /**
242
+ * The current Archimedea missions and modifiers
243
+ */
244
+ archimedeas: Archimedea[];
245
+ /**
246
+ * The current calendar for 1999
247
+ */
248
+ calendar: Calendar;
249
+ /**
250
+ * Faceoff bonus current state
251
+ */
252
+ faceoffBonus?: {
253
+ activation: Date;
254
+ expiry: Date;
255
+ next: Date;
256
+ };
257
+ /**
258
+ * Warframe's annual Quest to Conquer Cancer donation count and next tier goal
259
+ */
260
+ questToConquerCancer?: {
261
+ count: number;
262
+ goal: number;
263
+ };
264
+ /**
265
+ * Generates the worldstate json as a string into usable objects
266
+ */
267
+ static build(json: string, deps?: Dependency): Promise<WorldState>;
268
+ /**
269
+ * @param data The worldstate JSON string
270
+ * @param deps The options object
271
+ */
272
+ constructor(data: InitialWorldState, deps?: Dependency);
273
+ }
274
+ declare const _default: (json: string, deps: Dependency) => Promise<WorldState>;
275
+ //#endregion
42
276
  export { InitialWorldState, WorldState, _default as default, parseArray, parseAsyncArray };
@@ -2,44 +2,348 @@ import "../RewardTypes-C6zFAcZ1.mjs";
2
2
  import "../Reward-CjwLb2gj.mjs";
3
3
  import "../Mission-BBCUFfnN.mjs";
4
4
  import "../WorldstateObject-CIQkveJ1.mjs";
5
- import "../Alert-DdertJK5.mjs";
6
- import "../Archidemea-6_LmmSCn.mjs";
7
- import "../Calendar-BIT29qag.mjs";
8
- import "../CambionCycle-zr8UYAii.mjs";
9
- import "../CetusCycle-DduQI2fw.mjs";
10
- import "../ConclaveChallenge-CXZ5q0ym.mjs";
11
- import "../ConstructionProgress-hOBhqNeN.mjs";
12
- import "../DailyDeal-B_-51xgg.mjs";
5
+ import { t as Alert } from "../Alert-DdertJK5.mjs";
6
+ import { t as Archimedea } from "../Archidemea-6_LmmSCn.mjs";
7
+ import { t as Calendar } from "../Calendar-BIT29qag.mjs";
8
+ import { t as CambionCycle } from "../CambionCycle-zr8UYAii.mjs";
9
+ import { t as CetusCycle } from "../CetusCycle-DduQI2fw.mjs";
10
+ import { t as ConclaveChallenge } from "../ConclaveChallenge-CXZ5q0ym.mjs";
11
+ import { t as ConstructionProgress } from "../ConstructionProgress-hOBhqNeN.mjs";
12
+ import { t as DailyDeal } from "../DailyDeal-B_-51xgg.mjs";
13
13
  import "../DarkSectorBattle-DEqEgOOi.mjs";
14
- import "../DarkSector-DiE6QETB.mjs";
15
- import "../DuviriCycle-B450OsF9.mjs";
16
- import "../EarthCycle-IzR2qmA5.mjs";
17
- import "../Fissure-DJYjBf1K.mjs";
18
- import "../FlashSale-CQQ51ZyI.mjs";
19
- import "../GlobalUpgrade-CECXB3Yf.mjs";
20
- import "../Invasion-e0UPwE-J.mjs";
21
- import "../Kuva-CPoswpEP.mjs";
22
- import "../News-DZVYtsd3.mjs";
14
+ import { t as DarkSector } from "../DarkSector-DiE6QETB.mjs";
15
+ import { t as DuviriCycle } from "../DuviriCycle-B450OsF9.mjs";
16
+ import { t as EarthCycle } from "../EarthCycle-IzR2qmA5.mjs";
17
+ import { t as Fissure } from "../Fissure-DJYjBf1K.mjs";
18
+ import { t as FlashSale } from "../FlashSale-CQQ51ZyI.mjs";
19
+ import { t as GlobalUpgrade } from "../GlobalUpgrade-CECXB3Yf.mjs";
20
+ import { t as Invasion } from "../Invasion-e0UPwE-J.mjs";
21
+ import { t as Kuva } from "../Kuva-CPoswpEP.mjs";
22
+ import { t as News } from "../News-DZVYtsd3.mjs";
23
23
  import "../NightwaveChallenge-BjTpO8Mh.mjs";
24
- import "../Nightwave-sW1Cry-L.mjs";
25
- import "../PersistentEnemy-BogypbtV.mjs";
26
- import "../Simaris-Dpbxjfex.mjs";
24
+ import { t as Nightwave } from "../Nightwave-sW1Cry-L.mjs";
25
+ import { t as PersistentEnemy } from "../PersistentEnemy-BogypbtV.mjs";
26
+ import { t as Simaris } from "../Simaris-Dpbxjfex.mjs";
27
27
  import "../SortieVariant-CULYYgY1.mjs";
28
- import "../Sortie-BWrQosyz.mjs";
29
- import "../SteelPathOffering-hc8I6jT8.mjs";
28
+ import { t as Sortie } from "../Sortie-BWrQosyz.mjs";
29
+ import { t as SteelPathOfferings } from "../SteelPathOffering-hc8I6jT8.mjs";
30
30
  import "../FetchProxy-DTHjN-NQ.mjs";
31
31
  import "../SyndicateJob-BdKRf7qq.mjs";
32
- import "../SyndicateMission-Dif5Lp-C.mjs";
33
- import "../VallisCycle-BUg8cwKo.mjs";
32
+ import { t as SyndicateMission } from "../SyndicateMission-Dif5Lp-C.mjs";
33
+ import { t as VallisCycle } from "../VallisCycle-BUg8cwKo.mjs";
34
34
  import "../VoidTraderItem-B0waOIHJ.mjs";
35
35
  import "../VoidTraderSchedule-CK_ciC_O.mjs";
36
- import "../VoidTrader-6aBnhs9P.mjs";
36
+ import { t as VoidTrader } from "../VoidTrader-6aBnhs9P.mjs";
37
37
  import "../ChallengeInstance-DjZAJQQG.mjs";
38
- import "../WeeklyChallenge-BNlgGlbI.mjs";
39
- import "../WorldEvent-D5RguRlU.mjs";
40
- import "../ZarimanCycle-Cq3E8Dp2.mjs";
38
+ import { t as WeeklyChallenge } from "../WeeklyChallenge-BNlgGlbI.mjs";
39
+ import { t as WorldEvent } from "../WorldEvent-D5RguRlU.mjs";
40
+ import { t as ZarimanCycle } from "../ZarimanCycle-Cq3E8Dp2.mjs";
41
+ import { t as DuviriChoice } from "../DuviriChoice-CDdk3VSm.mjs";
41
42
  import "../SentientOutpost-D8iqaZqS.mjs";
42
- import "../Tmp-DuhaXk2g.mjs";
43
- import { i as parseAsyncArray, n as WorldState_default, r as parseArray, t as WorldState } from "../WorldState-D6TgRJLd.mjs";
43
+ import { t as Tmp } from "../Tmp-DuhaXk2g.mjs";
44
+ import { createHash } from "node:crypto";
45
+ import wsData from "warframe-worldstate-data";
46
+ import { parseDate } from "warframe-worldstate-data/utilities";
44
47
 
48
+ //#region lib/WorldState.ts
49
+ const { sortie } = wsData;
50
+ const safeArray = (arr) => arr ?? [];
51
+ const safeObj = (obj) => obj ?? {};
52
+ /**
53
+ * Default Dependency object
54
+ * @type {Dependency}
55
+ */
56
+ const defaultDeps = {
57
+ sortieData: sortie,
58
+ locale: "en",
59
+ logger: console
60
+ };
61
+ /**
62
+ *
63
+ * @param ParserClass class for parsing data
64
+ * @param dataArray array of raw data
65
+ * @param deps shared dependency object
66
+ * @param uniqueField field to treat as unique
67
+ * @returns array of parsed objects
68
+ */
69
+ function parseArray(ParserClass, dataArray, deps, uniqueField) {
70
+ const arr = (dataArray || []).map((d) => new ParserClass(d, deps));
71
+ if (uniqueField) {
72
+ const utemp = {};
73
+ arr.sort((a, b) => (a.id || "").localeCompare(b.id || ""));
74
+ arr.forEach((obj) => {
75
+ const key = String(obj[uniqueField]);
76
+ utemp[key] = obj;
77
+ });
78
+ return Array.from(arr).filter((obj) => {
79
+ if (obj?.active && typeof obj.active !== "undefined") return obj.active;
80
+ return true;
81
+ });
82
+ }
83
+ return arr;
84
+ }
85
+ /**
86
+ * Parse array of objects that requires async parsing
87
+ * @param ParserClass class for parsing data - must expose a static build method
88
+ * @param dataArray array of raw data
89
+ * @param deps shared dependency object
90
+ * @param uniqueField field to treat as unique
91
+ * @returns array of parsed objects
92
+ */
93
+ async function parseAsyncArray(ParserClass, dataArray, deps, uniqueField) {
94
+ const arr = [];
95
+ for await (const d of dataArray ?? []) arr.push(await ParserClass.build(d, deps));
96
+ if (uniqueField) {
97
+ const utemp = {};
98
+ arr.sort((a, b) => (a.id ?? "").localeCompare(b.id ?? ""));
99
+ arr.forEach((obj) => {
100
+ const key = String(obj[uniqueField]);
101
+ utemp[key] = obj;
102
+ });
103
+ return Array.from(arr).filter((obj) => {
104
+ if (obj?.active && typeof obj.active !== "undefined") return obj.active;
105
+ return true;
106
+ });
107
+ }
108
+ return arr;
109
+ }
110
+ /**
111
+ * Parses Warframe Worldstate JSON
112
+ */
113
+ var WorldState = class WorldState {
114
+ /**
115
+ * The date and time at which the World State was generated
116
+ */
117
+ timestamp;
118
+ /**
119
+ * Current Warframe version
120
+ */
121
+ buildLabel;
122
+ /**
123
+ * The in-game news
124
+ */
125
+ news;
126
+ /**
127
+ * The current events
128
+ */
129
+ events;
130
+ /**
131
+ * The current alerts
132
+ */
133
+ alerts;
134
+ /**
135
+ * The current sortie
136
+ */
137
+ sortie;
138
+ /**
139
+ * The current syndicate missions
140
+ */
141
+ syndicateMissions;
142
+ /**
143
+ * The current fissures: 'ActiveMissions' & 'VoidStorms'
144
+ */
145
+ fissures;
146
+ /**
147
+ * The current global upgrades
148
+ */
149
+ globalUpgrades;
150
+ /**
151
+ * The current flash sales
152
+ */
153
+ flashSales;
154
+ /**
155
+ * The current invasions
156
+ */
157
+ invasions;
158
+ /**
159
+ * The state of the dark sectors
160
+ */
161
+ darkSectors;
162
+ /**
163
+ * The state of all Void Traders
164
+ */
165
+ voidTraders;
166
+ /**
167
+ * The first entry for voidTraders
168
+ * @deprecated
169
+ */
170
+ voidTrader;
171
+ /**
172
+ * The current daily deals
173
+ */
174
+ dailyDeals;
175
+ /**
176
+ * The state of the sanctuary synthesis targets
177
+ */
178
+ simaris;
179
+ /**
180
+ * The current conclave challenges
181
+ */
182
+ conclaveChallenges;
183
+ /**
184
+ * The currently active persistent enemies
185
+ */
186
+ persistentEnemies;
187
+ /**
188
+ * The current earth cycle
189
+ */
190
+ earthCycle;
191
+ /**
192
+ * The current Cetus cycle
193
+ */
194
+ cetusCycle;
195
+ /**
196
+ * Cambion Drift Cycle
197
+ */
198
+ cambionCycle;
199
+ /**
200
+ * The current Zariman cycle based off current time
201
+ */
202
+ zarimanCycle;
203
+ /**
204
+ * Midrath cycle (soulframe)
205
+ * Game seems to desync while you play and appearntly it changes between updates.
206
+ */
207
+ /**
208
+ * Weekly challenges
209
+ */
210
+ weeklyChallenges;
211
+ /**
212
+ * The Current construction progress for Fomorians/Razorback/etc.
213
+ */
214
+ constructionProgress;
215
+ /**
216
+ * The current Orb Vallis cycle state
217
+ */
218
+ vallisCycle;
219
+ /**
220
+ * The current nightwave season
221
+ */
222
+ nightwave;
223
+ /**
224
+ * Kuva missions array
225
+ */
226
+ kuva;
227
+ /**
228
+ * Arbitration mission
229
+ */
230
+ arbitration;
231
+ /**
232
+ * Current sentient outposts
233
+ */
234
+ sentientOutposts;
235
+ /**
236
+ * Steel path offering rotation
237
+ */
238
+ steelPath;
239
+ /**
240
+ * The current prime resurgence
241
+ */
242
+ vaultTrader;
243
+ /**
244
+ * The current archon hunt
245
+ */
246
+ archonHunt;
247
+ /**
248
+ * Current Duviri circuit choices
249
+ */
250
+ duviriCycle;
251
+ /**
252
+ * Current kinepage message
253
+ */
254
+ kinepage;
255
+ /**
256
+ * The current Archimedea missions and modifiers
257
+ */
258
+ archimedeas;
259
+ /**
260
+ * The current calendar for 1999
261
+ */
262
+ calendar;
263
+ /**
264
+ * Faceoff bonus current state
265
+ */
266
+ faceoffBonus;
267
+ /**
268
+ * Warframe's annual Quest to Conquer Cancer donation count and next tier goal
269
+ */
270
+ questToConquerCancer;
271
+ /**
272
+ * Generates the worldstate json as a string into usable objects
273
+ */
274
+ static async build(json, deps = defaultDeps) {
275
+ if (typeof json !== "string") throw new TypeError(`json needs to be a string, provided ${typeof json} : ${JSON.stringify(json)}`);
276
+ const data = JSON.parse(json);
277
+ const ws = new WorldState(data, deps);
278
+ ws.events = await parseAsyncArray(WorldEvent, data.Goals, deps);
279
+ ws.syndicateMissions = await parseAsyncArray(SyndicateMission, data.SyndicateMissions, deps, "syndicate");
280
+ return ws;
281
+ }
282
+ /**
283
+ * @param data The worldstate JSON string
284
+ * @param deps The options object
285
+ */
286
+ constructor(data, deps = defaultDeps) {
287
+ deps = {
288
+ ...defaultDeps,
289
+ ...deps
290
+ };
291
+ this.timestamp = /* @__PURE__ */ new Date(data.Time * 1e3);
292
+ this.buildLabel = data.BuildLabel;
293
+ this.news = parseArray(News, safeArray(data.Events).filter((e) => typeof e.Messages.find((msg) => msg.LanguageCode === deps.locale) !== "undefined"), deps);
294
+ this.events = [];
295
+ this.alerts = parseArray(Alert, data.Alerts, deps);
296
+ [this.sortie] = parseArray(Sortie, data.Sorties, deps);
297
+ this.syndicateMissions = [];
298
+ this.fissures = parseArray(Fissure, data.ActiveMissions, deps).concat(parseArray(Fissure, data.VoidStorms, deps));
299
+ this.globalUpgrades = parseArray(GlobalUpgrade, data.GlobalUpgrades, deps);
300
+ this.flashSales = parseArray(FlashSale, data.FlashSales, deps);
301
+ this.invasions = parseArray(Invasion, data.Invasions, deps);
302
+ this.darkSectors = parseArray(DarkSector, data.BadlandNodes, deps);
303
+ this.voidTraders = parseArray(VoidTrader, data.VoidTraders, deps).sort((a, b) => a.activation.getTime() - b.activation.getTime());
304
+ [this.voidTrader] = this.voidTraders;
305
+ this.dailyDeals = parseArray(DailyDeal, data.DailyDeals, deps);
306
+ this.simaris = new Simaris(safeObj(data.LibraryInfo), deps);
307
+ this.conclaveChallenges = parseArray(ConclaveChallenge, data.PVPChallengeInstances, deps);
308
+ this.persistentEnemies = parseArray(PersistentEnemy, data.PersistentEnemies, deps);
309
+ this.earthCycle = new EarthCycle();
310
+ const cetusSynd = safeArray(data.SyndicateMissions).filter((syndicate$1) => syndicate$1.Tag === "CetusSyndicate");
311
+ const bountyEnd = parseDate(cetusSynd.length > 0 ? cetusSynd[0].Expiry : { $date: { $numberLong: 0 } });
312
+ this.cetusCycle = new CetusCycle(bountyEnd);
313
+ this.cambionCycle = new CambionCycle(this.cetusCycle);
314
+ this.zarimanCycle = new ZarimanCycle(bountyEnd);
315
+ this.weeklyChallenges = data.WeeklyChallenges ? new WeeklyChallenge(data.WeeklyChallenges) : void 0;
316
+ this.constructionProgress = new ConstructionProgress(data.ProjectPct);
317
+ this.vallisCycle = new VallisCycle();
318
+ if (data.SeasonInfo) this.nightwave = new Nightwave(data.SeasonInfo, deps);
319
+ const externalMissions = new Kuva(deps);
320
+ ({kuva: this.kuva, arbitration: this.arbitration} = externalMissions);
321
+ if (!this.arbitration || !Object.keys(this.arbitration).length) this.arbitration = {
322
+ id: createHash("sha256").update("SolNode000", "utf8").digest("hex"),
323
+ node: "SolNode000",
324
+ nodeKey: "SolNode000",
325
+ activation: /* @__PURE__ */ new Date(0),
326
+ expiry: /* @__PURE__ */ new Date(864e13),
327
+ enemy: "Tenno",
328
+ type: "Unknown",
329
+ typeKey: "Unknown",
330
+ archwing: false,
331
+ sharkwing: false,
332
+ expired: true
333
+ };
334
+ this.steelPath = new SteelPathOfferings(deps);
335
+ [this.vaultTrader] = parseArray(VoidTrader, data.PrimeVaultTraders, {
336
+ ...deps,
337
+ character: "Varzia"
338
+ });
339
+ [this.archonHunt] = parseArray(Sortie, data.LiteSorties, deps);
340
+ this.duviriCycle = new DuviriCycle(parseArray(DuviriChoice, data.EndlessXpChoices, deps));
341
+ [this.calendar] = parseArray(Calendar, data.KnownCalendarSeasons, deps);
342
+ this.archimedeas = parseArray(Archimedea, data.Conquests, deps);
343
+ ({kinepage: this.kinepage, sentientOutposts: this.sentientOutposts, faceoffBonus: this.faceoffBonus, questToConquerCancer: this.questToConquerCancer} = new Tmp(data.Tmp, deps));
344
+ }
345
+ };
346
+ var WorldState_default = async (json, deps) => WorldState.build(json, deps);
347
+
348
+ //#endregion
45
349
  export { WorldState, WorldState_default as default, parseArray, parseAsyncArray };