-
Notifications
You must be signed in to change notification settings - Fork 29
/
exports.js
144 lines (133 loc) · 6.46 KB
/
exports.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import safeImport from './safeImport.js';
const locales = ['de', 'es', 'fr', 'it', 'ko', 'pl', 'pt', 'ru', 'zh', 'cs', 'sr', 'uk'];
/**
* Synthesis target information
* @typedef {Object} SynthesisTarget
* @property {string} name Name of the target
* @property {Object[]} locations Array of verified locations
* @property {string} locations.last_verified Date string for the last verified date
* @property {string} locations.level Level range for enemies on the node.
* @property {string} locations.spawn_rate Plain text Spawn rate for enemy.
* @property {string} locations.mission Mission node for the location
* @property {string} locations.planet Planet the node is on
* @property {string} locations.type Mission type at this location
* @property {string} locations.faction Enemy faction that spawns in this location
*/
/**
* Arcane Data
* @typedef {Object} Arcane
* @deprecated
* @property {string} regex regex string to allow mapping
* @property {string} name name of Arcane
* @property {string} effect what the arcane does
* @property {string} rarity How rare the arcane is
* @property {string} location Where it drops
* @property {string} thumbnail Wiki thumbnail url
* @property {string} info Wiki Page URL
*/
/**
* Conclave Data
* @typedef {Object} Conclave
*/
/**
* Steel Path Offering
* @typedef {Object} SteelPathOffering
* @property {string} name The item being offered
* @property {string} cost The cost of the item
*/
/**
* Steel Path
* @typedef {Object} SteelPath
* @property {Array<SteelPathOffering>} rotation A list of offerings for the Steel Path
* @property {Array<SteelPathOffering>} evergreen Constantly available list of items
*/
/**
* Bundles all the data for a particular language
* @typedef {Object} WorldstateLangBundle
* @property {Arcane[]} arcanes Deprecated: Array of arcane data
* @property {Conclave} conclave Data for translating PvP categories and types
* @property {Object} events Deprecated: Data for converting event tags to useable event data.
* Deprecated in favor of keeping values in languages.json
* @property {Object} factions Faction universal name to plain-usage name
* @property {Object} fissureModifiers Map of fissures to "Warframeified" tier names and numbers
* @property {Object} languages Map of "internal" Warframe strings to useable language strings
* @property {Object} missionTypes Map of Mission Type identifiers to their corresponding values
* @property {Object} operationTypes Global modifiers for applying operations to things like
* credits, affinity, etc.
* @property {Object} persistentEnemy Region mapping for indicies to planets
* @property {Object} solNodes Nodes in the Sol system, with enemy type and node information
* @property {Object} sortie Sortie-specific mapping for modifier type, description, and boss
* @property {Array<Object>} tutorials Official tutorials.
* Not many have been released in a long time.
* @property {Object} upgradeTypes Global upgrade types that are modified by #operationTypes
* @property {Array<SynthesisTarget>} synthTargets Synthesis target data for
* optimal locations to find targets.
* @property {Object<string, Record<'name', string>>} syndicates Syndicate data
* @property {SteelPath} steelPath Steel Path mission type translations
*/
const makeBundle = async () => {
/**
* English United States translations bundle,
* default translations
* @type {WorldstateLangBundle}
*/
const enUS = {
arcanes: await safeImport('./data/arcanes.json'),
archonShards: await safeImport('./data/archonShards.json'),
conclave: await safeImport('./data/conclaveData.json'),
events: await safeImport('./data/eventsData.json'),
factions: await safeImport('./data/factionsData.json'),
fissureModifiers: await safeImport('./data/fissureModifiers.json'),
languages: await safeImport('./data/languages.json'),
missionTypes: await safeImport('./data/missionTypes.json'),
operationTypes: await safeImport('./data/operationTypes.json'),
persistentEnemy: await safeImport('./data/persistentEnemyData.json'),
solNodes: await safeImport('./data/solNodes.json'),
sortie: await safeImport('./data/sortieData.json'),
syndicates: await safeImport('./data/syndicatesData.json'),
tutorials: await safeImport('./data/tutorials.json'),
upgradeTypes: await safeImport('./data/upgradeTypes.json'),
synthTargets: await safeImport('./data/synthTargets.json'),
steelPath: await safeImport('./data/steelPath.json'),
};
/* eslint-enable global-require */
const bundle = {
/**
* English United States translations
* @type {WorldstateLangBundle}
*/
en_US: enUS,
en: enUS,
...enUS,
locales,
};
// eslint-disable-next-line no-restricted-syntax
for await (const locale of locales) {
/**
* Translations bundle for $locale
* @type {WorldstateLangBundle}
*/
bundle[locale] = {
arcanes: await safeImport(`./data/${locale}/arcanes.json`, enUS.arcanes),
archonShards: await safeImport('./data/archonShards.json', enUS.archonShards),
conclave: await safeImport(`./data/${locale}/conclaveData.json`, enUS.conclave),
events: await safeImport(`./data/${locale}/eventsData.json`, enUS.events),
factions: await safeImport(`./data/${locale}/factionsData.json`, enUS.factions),
fissureModifiers: await safeImport(`./data/${locale}/fissureModifiers.json`, enUS.fissureModifiers),
languages: await safeImport(`./data/${locale}/languages.json`, enUS.languages),
missionTypes: await safeImport(`./data/${locale}/missionTypes.json`, enUS.missionTypes),
operationTypes: await safeImport(`./data/${locale}/operationTypes.json`, enUS.operationTypes),
persistentEnemy: await safeImport(`./data/${locale}/persistentEnemyData.json`, enUS.persistentEnemy),
solNodes: await safeImport(`./data/${locale}/solNodes.json`, enUS.solNodes),
sortie: await safeImport(`./data/${locale}/sortieData.json`, enUS.sortie),
syndicates: await safeImport(`./data/${locale}/syndicatesData.json`, enUS.syndicates),
tutorials: await safeImport(`./data/${locale}/tutorials.json`, enUS.tutorials),
upgradeTypes: await safeImport(`./data/${locale}/upgradeTypes.json`, enUS.upgradeTypes),
synthTargets: await safeImport(`./data/${locale}/synthTargets.json`, enUS.synthTargets),
steelPath: await safeImport(`./data/${locale}/steelPath.json`, enUS.steelPath),
};
}
locales.push('en');
return bundle;
};
export default await makeBundle();