warframe-worldstate-data 3.9.0 → 3.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,347 +1,3 @@
1
- import exports_default from "../exports.mjs";
2
-
3
- //#region tools/translation.ts
4
- /**
5
- * Rough Titlecase!
6
- * @param {string} str string to be titlecased
7
- * @returns {string} titlecased string
8
- */
9
- const toTitleCase = (str) => {
10
- return str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substring(1).toLowerCase());
11
- };
12
- /**
13
- * Utility function to split the resource name and return somewhat human-readable string
14
- * @param {string} str localization resource key
15
- * @returns {string} human-readable string
16
- */
17
- const splitResourceName = (str) => str.split(/([A-Z]?[^A-Z]*)/g).filter(Boolean).join(" ");
18
- const lastResourceName = (str) => str ? str.split?.("/").reverse()[0] : str;
19
- const i18n = (locale = "en") => exports_default[locale] || exports_default;
20
- const keyInData = (key, dataOverride) => key in i18n(dataOverride) ? i18n(dataOverride)[key] : key;
21
- /**
22
- *
23
- * @param {string} color - The internal color name
24
- * @param {string} dataOverride locale for use with translation
25
- * @returns {Object | undefined}
26
- */
27
- const archonShard = (color, dataOverride = "en") => {
28
- return keyInData("archonShards", dataOverride)[color];
29
- };
30
- /**
31
- *
32
- * @param {string} color - The internal color name
33
- * @param {string} dataOverride locale for use with translation
34
- * @returns {string}
35
- */
36
- const archonShardColor = (color, dataOverride = "en") => archonShard(color, dataOverride)?.value ?? color;
37
- /**
38
- *
39
- * @param {string} color - The internal color name
40
- * @param {string} upgradeType - The upgrade type
41
- * @param {string} dataOverride locale for use with translation
42
- * @returns {string}
43
- */
44
- const archonShardUpgradeType = (color, upgradeType, dataOverride = "en") => archonShard(color, dataOverride)?.upgradeTypes[upgradeType]?.value ?? lastResourceName(upgradeType);
45
- /**
46
- *
47
- * @param {string} key - The data key
48
- * @param {string} dataOverride locale for use with translation
49
- * @returns {string} faction name
50
- */
51
- const faction = (key, dataOverride = "en") => keyInData("factions", dataOverride)[key]?.value ?? key;
52
- const solNode = (key, thing, dataOverride = "en") => keyInData("solNodes", dataOverride)?.[key]?.[thing] ?? lastResourceName(key) ?? key;
53
- /**
54
- *
55
- * @param {string} key - The data key
56
- * @param {string} dataOverride locale for use with translation
57
- * @returns {string} node name
58
- */
59
- const node = (key, dataOverride = "en") => solNode(key, "value", dataOverride);
60
- /**
61
- *
62
- * @param {string} key - The data key
63
- * @param {string} dataOverride locale for use with translation
64
- * @returns {string} mission type of the node
65
- */
66
- const nodeMissionType = (key, dataOverride = "en") => solNode(key, "type", dataOverride);
67
- /**
68
- *
69
- * @param {string} key - The data key
70
- * @param {string} dataOverride locale for use with translation
71
- * @returns {string} faction that controls the node
72
- */
73
- const nodeEnemy = (key, dataOverride = "en") => {
74
- return key in i18n(dataOverride).solNodes ? i18n(dataOverride).solNodes[key].enemy : lastResourceName(key) ?? key;
75
- };
76
- /**
77
- *
78
- * @param {string} key - The data key
79
- * @param {string} dataOverride locale for use with translation
80
- * @returns {string} localization for language string
81
- */
82
- const languageString = (key, dataOverride = "en") => {
83
- const lowerKey = String(key).toLowerCase();
84
- return i18n(dataOverride).languages[lowerKey]?.value ?? i18n(dataOverride).languages[key]?.value ?? (key ? toTitleCase(splitResourceName(lastResourceName(String(key)) ?? "")) : key);
85
- };
86
- /**
87
- *
88
- * @param {string} key - The data key
89
- * @param {string} dataOverride locale for use with translation
90
- * @returns {string} localization for language description
91
- */
92
- const languageDesc = (key, dataOverride = "en") => {
93
- const lowerKey = String(key).toLowerCase();
94
- return i18n(dataOverride).languages[lowerKey]?.desc ?? i18n(dataOverride).languages[key]?.desc ?? (key ? `[PH] ${toTitleCase(splitResourceName(lastResourceName(String(key)) ?? ""))} Desc` : key);
95
- };
96
- /**
97
- *
98
- * @param {string} key - The data key
99
- * @param {string} dataOverride locale for use with translation
100
- * @returns {string} translation for mission type
101
- */
102
- const missionType = (key, dataOverride = "en") => {
103
- const keyBased = key && typeof key === "string" && toTitleCase((key ?? "").replace(/^MT_/, ""));
104
- return key in i18n(dataOverride).missionTypes ? i18n(dataOverride).missionTypes[key].value : keyBased;
105
- };
106
- const conclave = (key, thing, dataOverride = "en") => keyInData("conclave", dataOverride)?.[thing]?.[key];
107
- /**
108
- *
109
- * @param {string} key - The data key
110
- * @param {string} dataOverride locale for use with translation
111
- * @returns {string} conclave mode
112
- */
113
- const conclaveMode = (key, dataOverride = "en") => conclave(key, "modes", dataOverride)?.value ?? key;
114
- /**
115
- *
116
- * @param {string} key - The data key
117
- * @param {string} dataOverride locale for use with translation
118
- * @returns {{ value: string; description: string }} conclave category
119
- */
120
- const conclaveCategory = (key, dataOverride = "en") => conclave(key, "categories", dataOverride)?.value ?? key;
121
- const fissure = (key, dataOverride = "en") => keyInData("fissureModifiers", dataOverride)?.[key] ?? key;
122
- /**
123
- *
124
- * @param {string} key - The data key
125
- * @param {string} dataOverride locale for use with translation
126
- * @returns {string} fissure modifier data
127
- */
128
- const fissureModifier = (key, dataOverride = "en") => fissure(key, dataOverride)?.value ?? key;
129
- /**
130
- *
131
- * @param {string} key - The data key
132
- * @param {string} dataOverride locale for use with translation
133
- * @returns {number | string} fissure tier
134
- */
135
- const fissureTier = (key, dataOverride = "en") => fissure(key, dataOverride).num ?? key;
136
- /**
137
- *
138
- * @param {string} key - The data key
139
- * @param {string} dataOverride locale for use with translation
140
- * @returns {string} syndicate name
141
- */
142
- const syndicate = (key, dataOverride = "en") => i18n(dataOverride).syndicates[key]?.name ?? key;
143
- /**
144
- *
145
- * @param {string} key - The data key
146
- * @param {string} dataOverride locale for use with translation
147
- * @returns {string} upgrade type
148
- */
149
- const upgrade = (key, dataOverride = "en") => i18n(dataOverride).upgradeTypes[key]?.value ?? key;
150
- const oppo = (key, dataOverride = "en") => i18n(dataOverride).operationTypes[key];
151
- /**
152
- *
153
- * @param {string} key - The data key
154
- * @param {string} dataOverride locale for use with translation
155
- * @returns {string} mathematical operation value
156
- */
157
- const operation = (key, dataOverride = "en") => oppo(key, dataOverride)?.value ?? key;
158
- /**
159
- *
160
- * @param {string} key - The data key
161
- * @param {string} dataOverride locale for use with translation
162
- * @returns {string} symbol of mathematical operation
163
- */
164
- const operationSymbol = (key, dataOverride = "en") => oppo(key, dataOverride)?.symbol ?? key;
165
- const sortie = (key, dataOverride = "en") => i18n(dataOverride).sortie.bosses[key];
166
- /**
167
- * @param {string} key - The data key
168
- * @param {string} dataOverride locale for use with translation
169
- * @returns {string} sortie boss name
170
- */
171
- const sortieBoss = (key, dataOverride = "en") => sortie(key, dataOverride)?.name ?? key;
172
- /**
173
- * @param {string} key - The data key
174
- * @param {string} dataOverride locale for use with translation
175
- * @returns {string} faction for a sortie based on the boss
176
- */
177
- const sortieFaction = (key, dataOverride = "en") => sortie(key, dataOverride)?.faction ?? key;
178
- /**
179
- *
180
- * @param {string} key - The data key
181
- * @param {string} dataOverride locale for use with translation
182
- * @returns {string} sortie modifier data
183
- */
184
- const sortieModifier = (key, dataOverride = "en") => i18n(dataOverride).sortie.modifierTypes?.[key] ?? key;
185
- /**
186
- * @param {string} key - The data key
187
- * @param {string} dataOverride locale for use with translation
188
- * @returns {string} sortie modifier description
189
- */
190
- const sortieModDesc = (key, dataOverride = "en") => i18n(dataOverride).sortie.modifierDescriptions?.[key] ?? key;
191
- /**
192
- * Retrieve the localized region for a given key
193
- * @param {string | number} key - The region key
194
- * @param {string} dataOverride - The locale to use for translations
195
- * @returns {string} localized region name
196
- */
197
- const region = (key, dataOverride = "en") => (key && i18n(dataOverride).persistentEnemy?.regions[key]) ?? key;
198
- /**
199
- * Retrieve conclave challenge name for the given key and locale
200
- * @param {string} key key to retrieve
201
- * @param {string} dataOverride locale key override
202
- * @returns {{
203
- * title: string,
204
- * description: string,
205
- * standing: number,
206
- * }} - The conclave challenge name for the given key
207
- */
208
- const conclaveChallenge = (key, dataOverride = "en") => {
209
- const splitKey = lastResourceName(String(key));
210
- if (splitKey !== void 0 && i18n(dataOverride).conclave?.challenges?.[splitKey]) return i18n(dataOverride).conclave.challenges[splitKey];
211
- return {
212
- title: toTitleCase(splitResourceName(splitKey)),
213
- description: toTitleCase(splitResourceName(splitKey)),
214
- standing: 0
215
- };
216
- };
217
- /**
218
- * Get the steel path data for given key
219
- * @param {string} dataOverride - The locale to use for translations
220
- * @returns {string} - The steel path data for the given key
221
- */
222
- const steelPath = (dataOverride = "en") => (i18n(dataOverride) || exports_default).steelPath;
223
- const valMapping = (key, map) => {
224
- let val = "None";
225
- Object.keys(map).forEach((k) => {
226
- if (key.includes(k)) val = map[k];
227
- });
228
- return val;
229
- };
230
- const focusMap = {
231
- "Focus/Attack": "Madurai",
232
- "Focus/Defense": "Vazarin",
233
- "Focus/Tactic": "Naramon",
234
- "Focus/Power": "Zenurik",
235
- "Focus/Ward": "Unairu"
236
- };
237
- /**
238
- * Translate the given focus school
239
- * @param {string} focus The focus school to translate
240
- * @returns {string} The translated focus school
241
- */
242
- const translateFocus = (focus = "") => valMapping(focus, focusMap);
243
- const polarityMap = {
244
- AP_ATTACK: "Madurai",
245
- AP_DEFENSE: "Vazarin",
246
- AP_TACTIC: "Naramon",
247
- AP_POWER: "Zenurik",
248
- AP_WARD: "Unairu",
249
- AP_UMBRA: "Umbra",
250
- AP_ANY: "Aura"
251
- };
252
- /**
253
- * Translate the given polarity
254
- * @param {string?} pol The polarity to translate
255
- * @returns {string} The translated polarity
256
- */
257
- const translatePolarity = (pol = "") => valMapping(pol, polarityMap);
258
- const eventTypeMap = {
259
- CET_CHALLENGE: "To Do",
260
- CET_UPGRADE: "Override",
261
- CET_REWARD: "Big Prize!",
262
- CET_PLOT: "Birthday"
263
- };
264
- /**
265
- * Translate the given event key
266
- * @param {string} key Unique event type
267
- * @returns {string}
268
- */
269
- const translateCalendarEvent = (key) => valMapping(key, eventTypeMap);
270
- /**
271
- * Translate the given season name to a non-unique string
272
- * @param {string} season Unique season name
273
- * @returns {string}
274
- */
275
- const translateSeason = (season) => toTitleCase(season.replace("CST_", ""));
276
- const archimedeaTypes = {
277
- CT_LAB: "Deep Archimedea",
278
- CT_HEX: "Temporal Archimedea"
279
- };
280
- const translateArchimedeaType = (type) => valMapping(type, archimedeaTypes);
281
- /**
282
- * An object containing functions to convert in-game names to their localizations
283
- * @typedef {Record<string, function>} Translator
284
- * @property {function} faction - Converts faction names
285
- * @property {function} node - Converts star map node names
286
- * @property {function} nodeMissionType - Returns the mission type of given node
287
- * @property {function} nodeEnemy - Returns the faction that controls a given node
288
- * @property {function} languageString - Converts generic language strings
289
- * @property {function} languageDesc - Converts generic language strings
290
- * and retrieves the description
291
- * @property {function} missionType - Converts mission types
292
- * @property {function} conclaveMode - Converts conclave modes
293
- * @property {function} conclaveCategory - Converts conclave challenge categories
294
- * @property {function} fissureModifier - Converts fissure mission modifiers
295
- * @property {function} syndicate - Converts syndicate names
296
- * @property {function} upgrade - Converts upgrade types
297
- * @property {function} operation - Converts operation types
298
- * @property {function} sortieBoss - Converts sortie boss names
299
- * @property {function} sortieModifier - Converts sortie modifier types
300
- * @property {function} sortieModDesc - Converts sortie modifier type descriptions
301
- * @property {function} region - Converts persistent enemy region indicies
302
- * @property {function} conclaveChallenge - Convert conclave identifiers into standing data
303
- * @property {function} steelPath - Retrieve Steel Path rotation data for locale
304
- * @property {function} toTitleCase - Format provided string as titlecase
305
- * @property {function} translateFocus - Translate focus schools
306
- * @property {function} translatePolarity - Translate polarities
307
- * @property {function} archonShard - Converts archon shard names
308
- * @property {function} archonShardColor - Converts archon shard names to in-game color values
309
- * @property {function} archonShardUpgradeType - Convert archon shard upgrade type
310
- * @property {function} translateCalendarEvent - Translate the given event key
311
- * @property {function} translateSeason - Translate the given season name to a non-unique string
312
- */
313
- var translation_default = {
314
- faction,
315
- node,
316
- nodeMissionType,
317
- nodeEnemy,
318
- languageString,
319
- languageDesc,
320
- missionType,
321
- conclaveMode,
322
- conclaveCategory,
323
- fissureModifier,
324
- fissureTier,
325
- syndicate,
326
- upgrade,
327
- operation,
328
- operationSymbol,
329
- sortieBoss,
330
- sortieModifier,
331
- sortieModDesc,
332
- sortieFaction,
333
- region,
334
- conclaveChallenge,
335
- steelPath,
336
- toTitleCase,
337
- translateFocus,
338
- translatePolarity,
339
- archonShard,
340
- archonShardColor,
341
- archonShardUpgradeType,
342
- translateCalendarEvent,
343
- translateSeason
344
- };
345
-
346
- //#endregion
347
- export { archonShard, archonShardColor, archonShardUpgradeType, conclaveCategory, conclaveChallenge, conclaveMode, translation_default as default, faction, fissureModifier, fissureTier, languageDesc, languageString, lastResourceName, missionType, node, nodeEnemy, nodeMissionType, operation, operationSymbol, region, sortieBoss, sortieFaction, sortieModDesc, sortieModifier, splitResourceName, steelPath, syndicate, toTitleCase, translateArchimedeaType, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade };
1
+ import "../exports-RIRl0WJ7.mjs";
2
+ import { A as translateFocus, C as sortieModifier, D as toTitleCase, E as syndicate, M as translateSeason, N as translation_default, O as translateArchimedeaType, P as upgrade, S as sortieModDesc, T as steelPath, _ as operation, a as conclaveChallenge, b as sortieBoss, c as fissureModifier, d as languageString, f as lastResourceName, g as nodeMissionType, h as nodeEnemy, i as conclaveCategory, j as translatePolarity, k as translateCalendarEvent, l as fissureTier, m as node, n as archonShardColor, o as conclaveMode, p as missionType, r as archonShardUpgradeType, s as faction, t as archonShard, u as languageDesc, v as operationSymbol, w as splitResourceName, x as sortieFaction, y as region } from "../translation-RrgsNYPn.mjs";
3
+ export { archonShard, archonShardColor, archonShardUpgradeType, conclaveCategory, conclaveChallenge, conclaveMode, translation_default as default, faction, fissureModifier, fissureTier, languageDesc, languageString, lastResourceName, missionType, node, nodeEnemy, nodeMissionType, operation, operationSymbol, region, sortieBoss, sortieFaction, sortieModDesc, sortieModifier, splitResourceName, steelPath, syndicate, toTitleCase, translateArchimedeaType, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade };
@@ -1,5 +1,5 @@
1
- import { ContentTimestamp, LegacyTimestamp, dailyReset, fromNow, parseDate, pieceIsSmoller, timeDeltaToString, toNow, weeklyReset } from "./timeDate.mjs";
2
- import { archonShard, archonShardColor, archonShardUpgradeType, conclaveCategory, conclaveChallenge, conclaveMode, faction, fissureModifier, fissureTier, languageDesc, languageString, lastResourceName, missionType, node, nodeEnemy, nodeMissionType, operation, operationSymbol, region, sortieBoss, sortieFaction, sortieModDesc, sortieModifier, splitResourceName, steelPath, syndicate, toTitleCase, translateArchimedeaType, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade } from "./translation.mjs";
1
+ import { a as fromNow, c as timeDeltaToString, i as dailyReset, l as toNow, n as LegacyTimestamp, o as parseDate, s as pieceIsSmoller, t as ContentTimestamp, u as weeklyReset } from "../timeDate-qOqkfAEd.mjs";
2
+ import { A as translateCalendarEvent, C as sortieModDesc, D as syndicate, E as steelPath, M as translatePolarity, N as translateSeason, O as toTitleCase, P as upgrade, S as sortieFaction, T as splitResourceName, _ as nodeMissionType, a as conclaveCategory, b as region, c as faction, d as languageDesc, f as languageString, g as nodeEnemy, h as node, i as archonShardUpgradeType, j as translateFocus, k as translateArchimedeaType, l as fissureModifier, m as missionType, n as archonShard, o as conclaveChallenge, p as lastResourceName, r as archonShardColor, s as conclaveMode, u as fissureTier, v as operation, w as sortieModifier, x as sortieBoss, y as operationSymbol } from "../translation-aa6j-J6e.mjs";
3
3
 
4
4
  //#region tools/integrity.d.ts
5
5
  /**
@@ -1,6 +1,6 @@
1
- import { dailyReset, fromNow, parseDate, pieceIsSmoller, timeDeltaToString, toNow, weeklyReset } from "./timeDate.mjs";
2
- import { archonShard, archonShardColor, archonShardUpgradeType, conclaveCategory, conclaveChallenge, conclaveMode, faction, fissureModifier, fissureTier, languageDesc, languageString, lastResourceName, missionType, node, nodeEnemy, nodeMissionType, operation, operationSymbol, region, sortieBoss, sortieFaction, sortieModDesc, sortieModifier, splitResourceName, steelPath, syndicate, toTitleCase, translateArchimedeaType, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade } from "./translation.mjs";
3
-
1
+ import "../exports-RIRl0WJ7.mjs";
2
+ import { c as weeklyReset, i as pieceIsSmoller, n as fromNow, o as timeDeltaToString, r as parseDate, s as toNow, t as dailyReset } from "../timeDate-CAsNbBQV.mjs";
3
+ import { A as translateFocus, C as sortieModifier, D as toTitleCase, E as syndicate, M as translateSeason, O as translateArchimedeaType, P as upgrade, S as sortieModDesc, T as steelPath, _ as operation, a as conclaveChallenge, b as sortieBoss, c as fissureModifier, d as languageString, f as lastResourceName, g as nodeMissionType, h as nodeEnemy, i as conclaveCategory, j as translatePolarity, k as translateCalendarEvent, l as fissureTier, m as node, n as archonShardColor, o as conclaveMode, p as missionType, r as archonShardUpgradeType, s as faction, t as archonShard, u as languageDesc, v as operationSymbol, w as splitResourceName, x as sortieFaction, y as region } from "../translation-RrgsNYPn.mjs";
4
4
  //#region tools/integrity.ts
5
5
  /**
6
6
  * @description Insist that the provided data has the required properties.
@@ -13,6 +13,5 @@ const insist = (thing, ...args) => {
13
13
  if (!(arg in thing)) throw new TypeError(`Missing required property: '${arg}'.`);
14
14
  });
15
15
  };
16
-
17
16
  //#endregion
18
- export { archonShard, archonShardColor, archonShardUpgradeType, conclaveCategory, conclaveChallenge, conclaveMode, dailyReset, faction, fissureModifier, fissureTier, fromNow, insist, languageDesc, languageString, lastResourceName, missionType, node, nodeEnemy, nodeMissionType, operation, operationSymbol, parseDate, pieceIsSmoller, region, sortieBoss, sortieFaction, sortieModDesc, sortieModifier, splitResourceName, steelPath, syndicate, timeDeltaToString, toNow, toTitleCase, translateArchimedeaType, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade, weeklyReset };
17
+ export { archonShard, archonShardColor, archonShardUpgradeType, conclaveCategory, conclaveChallenge, conclaveMode, dailyReset, faction, fissureModifier, fissureTier, fromNow, insist, languageDesc, languageString, lastResourceName, missionType, node, nodeEnemy, nodeMissionType, operation, operationSymbol, parseDate, pieceIsSmoller, region, sortieBoss, sortieFaction, sortieModDesc, sortieModifier, splitResourceName, steelPath, syndicate, timeDeltaToString, toNow, toTitleCase, translateArchimedeaType, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade, weeklyReset };