warframe-worldstate-data 2.25.0 → 3.0.0
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.
- package/.lintstagedrc.yml +5 -5
- package/.mocharc.yml +7 -1
- package/biome.json +51 -0
- package/data/synthTargets.json +1 -1
- package/dist/data/arcanes.json +461 -0
- package/dist/data/archonShards.json +224 -0
- package/dist/data/conclaveData.json +425 -0
- package/dist/data/cs/arcanes.json +461 -0
- package/dist/data/cs/archonShards.json +224 -0
- package/dist/data/cs/conclaveData.json +425 -0
- package/dist/data/cs/eventsData.json +27 -0
- package/dist/data/cs/factionsData.json +26 -0
- package/dist/data/cs/fissureModifiers.json +26 -0
- package/dist/data/cs/languages.json +19240 -0
- package/dist/data/cs/missionTypes.json +77 -0
- package/dist/data/cs/operationTypes.json +6 -0
- package/dist/data/cs/persistentEnemyData.json +21 -0
- package/dist/data/cs/solNodes.json +2237 -0
- package/dist/data/cs/sortieData.json +4253 -0
- package/dist/data/cs/steelPath.json +114 -0
- package/dist/data/cs/syndicatesData.json +86 -0
- package/dist/data/cs/synthTargets.json +1262 -0
- package/dist/data/cs/tutorials.json +17 -0
- package/dist/data/cs/upgradeTypes.json +14 -0
- package/dist/data/de/arcanes.json +461 -0
- package/dist/data/de/archonShards.json +224 -0
- package/dist/data/de/conclaveData.json +425 -0
- package/dist/data/de/eventsData.json +27 -0
- package/dist/data/de/factionsData.json +26 -0
- package/dist/data/de/fissureModifiers.json +26 -0
- package/dist/data/de/languages.json +19240 -0
- package/dist/data/de/missionTypes.json +77 -0
- package/dist/data/de/operationTypes.json +6 -0
- package/dist/data/de/persistentEnemyData.json +21 -0
- package/dist/data/de/solNodes.json +2237 -0
- package/dist/data/de/sortieData.json +4253 -0
- package/dist/data/de/steelPath.json +114 -0
- package/dist/data/de/syndicatesData.json +86 -0
- package/dist/data/de/synthTargets.json +1262 -0
- package/dist/data/de/tutorials.json +17 -0
- package/dist/data/de/upgradeTypes.json +14 -0
- package/dist/data/es/arcanes.json +461 -0
- package/dist/data/es/archonShards.json +224 -0
- package/dist/data/es/conclaveData.json +425 -0
- package/dist/data/es/eventsData.json +27 -0
- package/dist/data/es/factionsData.json +26 -0
- package/dist/data/es/fissureModifiers.json +26 -0
- package/dist/data/es/languages.json +19240 -0
- package/dist/data/es/missionTypes.json +77 -0
- package/dist/data/es/operationTypes.json +6 -0
- package/dist/data/es/persistentEnemyData.json +21 -0
- package/dist/data/es/solNodes.json +2237 -0
- package/dist/data/es/sortieData.json +4253 -0
- package/dist/data/es/steelPath.json +114 -0
- package/dist/data/es/syndicatesData.json +86 -0
- package/dist/data/es/synthTargets.json +1262 -0
- package/dist/data/es/tutorials.json +17 -0
- package/dist/data/es/upgradeTypes.json +14 -0
- package/dist/data/eventsData.json +27 -0
- package/dist/data/factionsData.json +26 -0
- package/dist/data/fissureModifiers.json +26 -0
- package/dist/data/fr/arcanes.json +461 -0
- package/dist/data/fr/archonShards.json +224 -0
- package/dist/data/fr/conclaveData.json +425 -0
- package/dist/data/fr/eventsData.json +27 -0
- package/dist/data/fr/factionsData.json +26 -0
- package/dist/data/fr/fissureModifiers.json +26 -0
- package/dist/data/fr/languages.json +19240 -0
- package/dist/data/fr/missionTypes.json +77 -0
- package/dist/data/fr/operationTypes.json +6 -0
- package/dist/data/fr/persistentEnemyData.json +21 -0
- package/dist/data/fr/solNodes.json +2237 -0
- package/dist/data/fr/sortieData.json +4253 -0
- package/dist/data/fr/steelPath.json +114 -0
- package/dist/data/fr/syndicatesData.json +86 -0
- package/dist/data/fr/synthTargets.json +1262 -0
- package/dist/data/fr/tutorials.json +17 -0
- package/dist/data/fr/upgradeTypes.json +14 -0
- package/dist/data/index.html +13 -0
- package/dist/data/it/arcanes.json +461 -0
- package/dist/data/it/archonShards.json +224 -0
- package/dist/data/it/conclaveData.json +425 -0
- package/dist/data/it/eventsData.json +27 -0
- package/dist/data/it/factionsData.json +26 -0
- package/dist/data/it/fissureModifiers.json +26 -0
- package/dist/data/it/languages.json +19240 -0
- package/dist/data/it/missionTypes.json +77 -0
- package/dist/data/it/operationTypes.json +6 -0
- package/dist/data/it/persistentEnemyData.json +21 -0
- package/dist/data/it/solNodes.json +2237 -0
- package/dist/data/it/sortieData.json +4253 -0
- package/dist/data/it/steelPath.json +114 -0
- package/dist/data/it/syndicatesData.json +86 -0
- package/dist/data/it/synthTargets.json +1262 -0
- package/dist/data/it/tutorials.json +17 -0
- package/dist/data/it/upgradeTypes.json +14 -0
- package/dist/data/ko/arcanes.json +461 -0
- package/dist/data/ko/archonShards.json +224 -0
- package/dist/data/ko/conclaveData.json +425 -0
- package/dist/data/ko/eventsData.json +27 -0
- package/dist/data/ko/factionsData.json +26 -0
- package/dist/data/ko/fissureModifiers.json +26 -0
- package/dist/data/ko/languages.json +19240 -0
- package/dist/data/ko/missionTypes.json +77 -0
- package/dist/data/ko/operationTypes.json +6 -0
- package/dist/data/ko/persistentEnemyData.json +21 -0
- package/dist/data/ko/solNodes.json +2237 -0
- package/dist/data/ko/sortieData.json +4253 -0
- package/dist/data/ko/steelPath.json +114 -0
- package/dist/data/ko/syndicatesData.json +86 -0
- package/dist/data/ko/synthTargets.json +1262 -0
- package/dist/data/ko/tutorials.json +17 -0
- package/dist/data/ko/upgradeTypes.json +14 -0
- package/dist/data/languages.json +19249 -0
- package/dist/data/missionTypes.json +77 -0
- package/dist/data/operationTypes.json +6 -0
- package/dist/data/persistentEnemyData.json +21 -0
- package/dist/data/pl/arcanes.json +461 -0
- package/dist/data/pl/archonShards.json +224 -0
- package/dist/data/pl/conclaveData.json +425 -0
- package/dist/data/pl/eventsData.json +27 -0
- package/dist/data/pl/factionsData.json +26 -0
- package/dist/data/pl/fissureModifiers.json +26 -0
- package/dist/data/pl/languages.json +19240 -0
- package/dist/data/pl/missionTypes.json +77 -0
- package/dist/data/pl/operationTypes.json +6 -0
- package/dist/data/pl/persistentEnemyData.json +21 -0
- package/dist/data/pl/solNodes.json +2237 -0
- package/dist/data/pl/sortieData.json +4253 -0
- package/dist/data/pl/steelPath.json +114 -0
- package/dist/data/pl/syndicatesData.json +86 -0
- package/dist/data/pl/synthTargets.json +1262 -0
- package/dist/data/pl/tutorials.json +17 -0
- package/dist/data/pl/upgradeTypes.json +14 -0
- package/dist/data/pt/arcanes.json +461 -0
- package/dist/data/pt/archonShards.json +224 -0
- package/dist/data/pt/conclaveData.json +425 -0
- package/dist/data/pt/eventsData.json +27 -0
- package/dist/data/pt/factionsData.json +26 -0
- package/dist/data/pt/fissureModifiers.json +26 -0
- package/dist/data/pt/languages.json +19240 -0
- package/dist/data/pt/missionTypes.json +77 -0
- package/dist/data/pt/operationTypes.json +6 -0
- package/dist/data/pt/persistentEnemyData.json +21 -0
- package/dist/data/pt/solNodes.json +2237 -0
- package/dist/data/pt/sortieData.json +4253 -0
- package/dist/data/pt/steelPath.json +114 -0
- package/dist/data/pt/syndicatesData.json +86 -0
- package/dist/data/pt/synthTargets.json +1262 -0
- package/dist/data/pt/tutorials.json +17 -0
- package/dist/data/pt/upgradeTypes.json +14 -0
- package/dist/data/ru/arcanes.json +461 -0
- package/dist/data/ru/archonShards.json +224 -0
- package/dist/data/ru/conclaveData.json +425 -0
- package/dist/data/ru/eventsData.json +27 -0
- package/dist/data/ru/factionsData.json +26 -0
- package/dist/data/ru/fissureModifiers.json +26 -0
- package/dist/data/ru/languages.json +19240 -0
- package/dist/data/ru/missionTypes.json +77 -0
- package/dist/data/ru/operationTypes.json +6 -0
- package/dist/data/ru/persistentEnemyData.json +21 -0
- package/dist/data/ru/solNodes.json +2237 -0
- package/dist/data/ru/sortieData.json +4253 -0
- package/dist/data/ru/steelPath.json +114 -0
- package/dist/data/ru/syndicatesData.json +86 -0
- package/dist/data/ru/synthTargets.json +1262 -0
- package/dist/data/ru/tutorials.json +17 -0
- package/dist/data/ru/upgradeTypes.json +14 -0
- package/dist/data/solNodes.json +2237 -0
- package/dist/data/sortieData.json +4253 -0
- package/dist/data/sr/arcanes.json +461 -0
- package/dist/data/sr/archonShards.json +224 -0
- package/dist/data/sr/conclaveData.json +425 -0
- package/dist/data/sr/eventsData.json +27 -0
- package/dist/data/sr/factionsData.json +26 -0
- package/dist/data/sr/fissureModifiers.json +26 -0
- package/dist/data/sr/languages.json +19240 -0
- package/dist/data/sr/missionTypes.json +77 -0
- package/dist/data/sr/operationTypes.json +6 -0
- package/dist/data/sr/persistentEnemyData.json +21 -0
- package/dist/data/sr/solNodes.json +2237 -0
- package/dist/data/sr/sortieData.json +4253 -0
- package/dist/data/sr/steelPath.json +114 -0
- package/dist/data/sr/syndicatesData.json +86 -0
- package/dist/data/sr/synthTargets.json +1262 -0
- package/dist/data/sr/tutorials.json +17 -0
- package/dist/data/sr/upgradeTypes.json +14 -0
- package/dist/data/steelPath.json +33 -0
- package/dist/data/syndicatesData.json +86 -0
- package/dist/data/synthTargets.json +1262 -0
- package/dist/data/tr/arcanes.json +461 -0
- package/dist/data/tr/archonShards.json +224 -0
- package/dist/data/tr/conclaveData.json +425 -0
- package/dist/data/tr/eventsData.json +27 -0
- package/dist/data/tr/factionsData.json +26 -0
- package/dist/data/tr/fissureModifiers.json +26 -0
- package/dist/data/tr/languages.json +19240 -0
- package/dist/data/tr/missionTypes.json +77 -0
- package/dist/data/tr/operationTypes.json +6 -0
- package/dist/data/tr/persistentEnemyData.json +21 -0
- package/dist/data/tr/solNodes.json +2237 -0
- package/dist/data/tr/sortieData.json +4253 -0
- package/dist/data/tr/steelPath.json +114 -0
- package/dist/data/tr/syndicatesData.json +86 -0
- package/dist/data/tr/synthTargets.json +1262 -0
- package/dist/data/tr/tutorials.json +17 -0
- package/dist/data/tr/upgradeTypes.json +14 -0
- package/dist/data/tutorials.json +17 -0
- package/dist/data/uk/arcanes.json +461 -0
- package/dist/data/uk/archonShards.json +224 -0
- package/dist/data/uk/conclaveData.json +425 -0
- package/dist/data/uk/eventsData.json +27 -0
- package/dist/data/uk/factionsData.json +26 -0
- package/dist/data/uk/fissureModifiers.json +26 -0
- package/dist/data/uk/languages.json +19240 -0
- package/dist/data/uk/missionTypes.json +77 -0
- package/dist/data/uk/operationTypes.json +6 -0
- package/dist/data/uk/persistentEnemyData.json +21 -0
- package/dist/data/uk/solNodes.json +2237 -0
- package/dist/data/uk/sortieData.json +4253 -0
- package/dist/data/uk/steelPath.json +114 -0
- package/dist/data/uk/syndicatesData.json +86 -0
- package/dist/data/uk/synthTargets.json +1262 -0
- package/dist/data/uk/tutorials.json +17 -0
- package/dist/data/uk/upgradeTypes.json +14 -0
- package/dist/data/upgradeTypes.json +14 -0
- package/dist/data/zh/arcanes.json +461 -0
- package/dist/data/zh/archonShards.json +224 -0
- package/dist/data/zh/conclaveData.json +425 -0
- package/dist/data/zh/eventsData.json +27 -0
- package/dist/data/zh/factionsData.json +26 -0
- package/dist/data/zh/fissureModifiers.json +26 -0
- package/dist/data/zh/languages.json +19240 -0
- package/dist/data/zh/missionTypes.json +77 -0
- package/dist/data/zh/operationTypes.json +6 -0
- package/dist/data/zh/persistentEnemyData.json +21 -0
- package/dist/data/zh/solNodes.json +2237 -0
- package/dist/data/zh/sortieData.json +4253 -0
- package/dist/data/zh/steelPath.json +114 -0
- package/dist/data/zh/syndicatesData.json +86 -0
- package/dist/data/zh/synthTargets.json +1262 -0
- package/dist/data/zh/tutorials.json +17 -0
- package/dist/data/zh/upgradeTypes.json +14 -0
- package/dist/exports-D0bYygo0.d.ts +122 -0
- package/dist/exports-DOwA1rwv.js +78 -0
- package/dist/exports.d.ts +3 -0
- package/dist/exports.js +4 -0
- package/dist/integrity-Cp6DXUCT.js +15 -0
- package/dist/integrity-hhdd4nAB.d.ts +9 -0
- package/dist/safeImport-BXmqy9V4.js +21 -0
- package/dist/safeImport.d.ts +10 -0
- package/dist/safeImport.js +3 -0
- package/dist/timeDate-B78E0z0S.js +74 -0
- package/dist/timeDate-BZaZFq86.d.ts +48 -0
- package/dist/tools/integrity.d.ts +2 -0
- package/dist/tools/integrity.js +3 -0
- package/dist/tools/timeDate.d.ts +2 -0
- package/dist/tools/timeDate.js +3 -0
- package/dist/tools/translation.d.ts +4 -0
- package/dist/tools/translation.js +5 -0
- package/dist/tools/utilities.d.ts +6 -0
- package/dist/tools/utilities.js +7 -0
- package/dist/translation-BbEpzl6v.js +342 -0
- package/dist/translation-CMA-O2tP.d.ts +292 -0
- package/dist/types-Clh1x9kB.d.ts +94 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.js +0 -0
- package/exports.ts +153 -0
- package/package.json +31 -18
- package/{safeImport.js → safeImport.ts} +8 -4
- package/tools/integrity.ts +16 -0
- package/tools/sortLanguages.ts +44 -0
- package/tools/{timeDate.js → timeDate.ts} +12 -8
- package/tools/{translation.js → translation.ts} +79 -52
- package/tools/utilities.ts +3 -0
- package/tsconfig.json +13 -0
- package/tsdown.config.ts +15 -0
- package/types.ts +69 -0
- package/.eslintignore +0 -3
- package/.eslintrc.yml +0 -19
- package/exports.js +0 -144
- package/tools/integrity.js +0 -15
- package/tools/utilities.js +0 -3
@@ -0,0 +1,94 @@
|
|
1
|
+
//#region types.d.ts
|
2
|
+
interface Arcane {
|
3
|
+
regex: string;
|
4
|
+
name: string;
|
5
|
+
effect: string;
|
6
|
+
rarity: string;
|
7
|
+
location: string;
|
8
|
+
thumbnail: string;
|
9
|
+
}
|
10
|
+
interface ArchonShard {
|
11
|
+
value: string;
|
12
|
+
upgradeTypes: Record<string, {
|
13
|
+
value: string;
|
14
|
+
}>;
|
15
|
+
}
|
16
|
+
interface Conclave {
|
17
|
+
modes: Record<string, {
|
18
|
+
value: string;
|
19
|
+
}>;
|
20
|
+
categories: Record<string, {
|
21
|
+
value: string;
|
22
|
+
description: string;
|
23
|
+
}>;
|
24
|
+
challenges: Record<string, {
|
25
|
+
title: string;
|
26
|
+
description: string;
|
27
|
+
standing: number;
|
28
|
+
}>;
|
29
|
+
affectors: Record<string, {
|
30
|
+
title: string;
|
31
|
+
description: string;
|
32
|
+
standing: number;
|
33
|
+
}>;
|
34
|
+
}
|
35
|
+
interface Events {
|
36
|
+
tags: Record<string, {
|
37
|
+
value: string;
|
38
|
+
}>;
|
39
|
+
scoreVariables: Record<string, {
|
40
|
+
value: {
|
41
|
+
value: string;
|
42
|
+
};
|
43
|
+
}>;
|
44
|
+
scoreMaxTags: Record<string, {
|
45
|
+
value: {
|
46
|
+
value: string;
|
47
|
+
};
|
48
|
+
}>;
|
49
|
+
}
|
50
|
+
interface SteelPath {
|
51
|
+
rotation: SteelPathOffering[];
|
52
|
+
evergreen: SteelPathOffering[];
|
53
|
+
}
|
54
|
+
interface SteelPathOffering {
|
55
|
+
name: string;
|
56
|
+
cost: string;
|
57
|
+
}
|
58
|
+
interface SynthesisTarget {
|
59
|
+
name: string;
|
60
|
+
locations: SynthesisTargetLocation[];
|
61
|
+
}
|
62
|
+
interface SynthesisTargetLocation {
|
63
|
+
last_verified: string;
|
64
|
+
level: string;
|
65
|
+
spawn_rate: string;
|
66
|
+
mission: string;
|
67
|
+
planet: string;
|
68
|
+
type: string;
|
69
|
+
faction: string;
|
70
|
+
}
|
71
|
+
interface SolNode {
|
72
|
+
value: string;
|
73
|
+
enemy: string;
|
74
|
+
type: string;
|
75
|
+
}
|
76
|
+
interface SortieEndState {
|
77
|
+
bossName: string;
|
78
|
+
regions: {
|
79
|
+
name: string;
|
80
|
+
missions: string[];
|
81
|
+
}[];
|
82
|
+
}
|
83
|
+
interface SortieData {
|
84
|
+
modifierTypes: Record<string, string>;
|
85
|
+
modifierDescriptions: Record<string, string>;
|
86
|
+
bosses: Record<string, {
|
87
|
+
name: string;
|
88
|
+
faction: string;
|
89
|
+
}>;
|
90
|
+
endStates: SortieEndState[];
|
91
|
+
modifiers: string[];
|
92
|
+
}
|
93
|
+
//#endregion
|
94
|
+
export { Arcane, ArchonShard, Conclave, Events, SolNode, SortieData, SteelPath, SynthesisTarget };
|
package/dist/types.d.ts
ADDED
package/dist/types.js
ADDED
File without changes
|
package/exports.ts
ADDED
@@ -0,0 +1,153 @@
|
|
1
|
+
import safeImport from './safeImport';
|
2
|
+
import { Arcane, ArchonShard, Conclave, Events, SolNode, SortieData, SteelPath, SynthesisTarget } from './types';
|
3
|
+
|
4
|
+
export type Locale = 'de' | 'en' | 'es' | 'fr' | 'it' | 'ko' | 'pl' | 'pt' | 'ru' | 'zh' | 'cs' | 'sr' | 'uk';
|
5
|
+
|
6
|
+
const locales: Locale[] = ['de', 'es', 'fr', 'it', 'ko', 'pl', 'pt', 'ru', 'zh', 'cs', 'sr', 'uk'];
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Bundles all the data for a particular language
|
10
|
+
*/
|
11
|
+
export interface WorldstateLangBundle {
|
12
|
+
/**
|
13
|
+
* Deprecated: Array of arcane data
|
14
|
+
*/
|
15
|
+
arcanes: Arcane[];
|
16
|
+
/**
|
17
|
+
* Data for Archon shard colors
|
18
|
+
*/
|
19
|
+
archonShards: Record<string, ArchonShard>;
|
20
|
+
/**
|
21
|
+
* Data for translating PvP categories and types
|
22
|
+
*/
|
23
|
+
conclave: Conclave;
|
24
|
+
/**
|
25
|
+
* Deprecated: Data for converting event tags to useable event data.
|
26
|
+
* Deprecated in favor of keeping values in languages.json
|
27
|
+
*/
|
28
|
+
events: Events;
|
29
|
+
/**
|
30
|
+
* Faction universal name to plain-usage name
|
31
|
+
*/
|
32
|
+
factions: Record<string, { value: string }>;
|
33
|
+
/**
|
34
|
+
* Map of fissures to "Warframeified" tier names and numbers
|
35
|
+
*/
|
36
|
+
fissureModifiers: Record<string, { value: string; num: number }>;
|
37
|
+
/**
|
38
|
+
* Map of "internal" Warframe strings to useable language strings
|
39
|
+
*/
|
40
|
+
languages: Record<string, { value: string; desc: string }>;
|
41
|
+
/**
|
42
|
+
* Map of Mission Type identifiers to their corresponding values
|
43
|
+
*/
|
44
|
+
missionTypes: Record<string, { value: string }>;
|
45
|
+
/**
|
46
|
+
* Global modifiers for applying operations to things like
|
47
|
+
* credits, affinity, etc.
|
48
|
+
*/
|
49
|
+
operationTypes: Record<string, { value: string; symbol: string }>;
|
50
|
+
/**
|
51
|
+
* Region mapping for indicies to planets
|
52
|
+
*/
|
53
|
+
persistentEnemy: { regions: string[] };
|
54
|
+
/**
|
55
|
+
* Nodes in the Sol system, with enemy type and node information
|
56
|
+
*/
|
57
|
+
solNodes: Record<string, SolNode>;
|
58
|
+
/**
|
59
|
+
* Sortie-specific mapping for modifier type, description, and boss
|
60
|
+
*/
|
61
|
+
sortie: SortieData;
|
62
|
+
/**
|
63
|
+
* Steel Path mission type translations
|
64
|
+
*/
|
65
|
+
steelPath: SteelPath;
|
66
|
+
/**
|
67
|
+
* Syndicate data
|
68
|
+
*/
|
69
|
+
syndicates: Record<string, { name: string }>;
|
70
|
+
/**
|
71
|
+
* Synthesis target data for optimal locations to find targets.
|
72
|
+
*/
|
73
|
+
synthTargets: SynthesisTarget[];
|
74
|
+
/**
|
75
|
+
* Official tutorials.
|
76
|
+
* Not many have been released in a long time.
|
77
|
+
*/
|
78
|
+
tutorials: { regex: string; name: string; url: string }[];
|
79
|
+
/**
|
80
|
+
* Global upgrade types that are modified by #operationTypes
|
81
|
+
*/
|
82
|
+
upgradeTypes: Record<string, { value: string }>;
|
83
|
+
}
|
84
|
+
|
85
|
+
const makeBundle = async () => {
|
86
|
+
/**
|
87
|
+
* English United States translations bundle,
|
88
|
+
* default translations
|
89
|
+
* @type {WorldstateLangBundle}
|
90
|
+
*/
|
91
|
+
const enUS: WorldstateLangBundle = {
|
92
|
+
arcanes: await safeImport('./data/arcanes.json'),
|
93
|
+
archonShards: await safeImport('./data/archonShards.json'),
|
94
|
+
conclave: await safeImport('./data/conclaveData.json'),
|
95
|
+
events: await safeImport('./data/eventsData.json'),
|
96
|
+
factions: await safeImport('./data/factionsData.json'),
|
97
|
+
fissureModifiers: await safeImport('./data/fissureModifiers.json'),
|
98
|
+
languages: await safeImport('./data/languages.json'),
|
99
|
+
missionTypes: await safeImport('./data/missionTypes.json'),
|
100
|
+
operationTypes: await safeImport('./data/operationTypes.json'),
|
101
|
+
persistentEnemy: await safeImport('./data/persistentEnemyData.json'),
|
102
|
+
solNodes: await safeImport('./data/solNodes.json'),
|
103
|
+
sortie: await safeImport('./data/sortieData.json'),
|
104
|
+
syndicates: await safeImport('./data/syndicatesData.json'),
|
105
|
+
tutorials: await safeImport('./data/tutorials.json'),
|
106
|
+
upgradeTypes: await safeImport('./data/upgradeTypes.json'),
|
107
|
+
synthTargets: await safeImport('./data/synthTargets.json'),
|
108
|
+
steelPath: await safeImport('./data/steelPath.json'),
|
109
|
+
};
|
110
|
+
/* eslint-enable global-require */
|
111
|
+
|
112
|
+
type WorldstateData = WorldstateLangBundle & {
|
113
|
+
[K in Locale]?: WorldstateLangBundle;
|
114
|
+
} & { locales: Locale[] };
|
115
|
+
|
116
|
+
const bundle: WorldstateData = {
|
117
|
+
en: enUS,
|
118
|
+
...enUS,
|
119
|
+
locales
|
120
|
+
};
|
121
|
+
|
122
|
+
// eslint-disable-next-line no-restricted-syntax
|
123
|
+
for await (const locale of locales) {
|
124
|
+
/**
|
125
|
+
* Translations bundle for $locale
|
126
|
+
* @type {WorldstateLangBundle}
|
127
|
+
*/
|
128
|
+
bundle[locale] = {
|
129
|
+
arcanes: await safeImport(`./data/${locale}/arcanes.json`, enUS.arcanes),
|
130
|
+
archonShards: await safeImport(`./data/${locale}/archonShards.json`, enUS.archonShards),
|
131
|
+
conclave: await safeImport(`./data/${locale}/conclaveData.json`, enUS.conclave),
|
132
|
+
events: await safeImport(`./data/${locale}/eventsData.json`, enUS.events),
|
133
|
+
factions: await safeImport(`./data/${locale}/factionsData.json`, enUS.factions),
|
134
|
+
fissureModifiers: await safeImport(`./data/${locale}/fissureModifiers.json`, enUS.fissureModifiers),
|
135
|
+
languages: await safeImport(`./data/${locale}/languages.json`, enUS.languages),
|
136
|
+
missionTypes: await safeImport(`./data/${locale}/missionTypes.json`, enUS.missionTypes),
|
137
|
+
operationTypes: await safeImport(`./data/${locale}/operationTypes.json`, enUS.operationTypes),
|
138
|
+
persistentEnemy: await safeImport(`./data/${locale}/persistentEnemyData.json`, enUS.persistentEnemy),
|
139
|
+
solNodes: await safeImport(`./data/${locale}/solNodes.json`, enUS.solNodes),
|
140
|
+
sortie: await safeImport(`./data/${locale}/sortieData.json`, enUS.sortie),
|
141
|
+
syndicates: await safeImport(`./data/${locale}/syndicatesData.json`, enUS.syndicates),
|
142
|
+
tutorials: await safeImport(`./data/${locale}/tutorials.json`, enUS.tutorials),
|
143
|
+
upgradeTypes: await safeImport(`./data/${locale}/upgradeTypes.json`, enUS.upgradeTypes),
|
144
|
+
synthTargets: await safeImport(`./data/${locale}/synthTargets.json`, enUS.synthTargets),
|
145
|
+
steelPath: await safeImport(`./data/${locale}/steelPath.json`, enUS.steelPath),
|
146
|
+
};
|
147
|
+
}
|
148
|
+
|
149
|
+
locales.push('en');
|
150
|
+
return bundle;
|
151
|
+
};
|
152
|
+
|
153
|
+
export default await makeBundle();
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "warframe-worldstate-data",
|
3
|
-
"version": "
|
3
|
+
"version": "3.0.0",
|
4
4
|
"description": "Warframe data for use with warframe-worldstate-parser",
|
5
5
|
"keywords": [
|
6
6
|
"warframe-worldstate",
|
@@ -39,47 +39,60 @@
|
|
39
39
|
],
|
40
40
|
"type": "module",
|
41
41
|
"exports": {
|
42
|
-
".": "./exports.js",
|
43
|
-
"./utilities": "./tools/utilities.js"
|
42
|
+
".": "./dist/exports.js",
|
43
|
+
"./utilities": "./dist/tools/utilities.js",
|
44
|
+
"./types": "./dist/types.js"
|
44
45
|
},
|
45
|
-
"main": "exports.js",
|
46
|
+
"main": "./dist/exports.js",
|
46
47
|
"directories": {
|
47
48
|
"test": "test"
|
48
49
|
},
|
49
50
|
"scripts": {
|
51
|
+
"build": "tsdown",
|
50
52
|
"coverage": "npm test && c8 report --reporter=text-lcov | coveralls",
|
51
|
-
"lint": "
|
52
|
-
"lint:fix": "
|
53
|
+
"lint": "biome lint",
|
54
|
+
"lint:fix": "biome lint --write",
|
53
55
|
"prepare": "husky && npx install-peerdeps @wfcd/eslint-config@latest -S",
|
54
|
-
"
|
56
|
+
"prepublishOnly": "npm run build",
|
57
|
+
"sort": "tsx ./tools/sortLanguages.ts",
|
55
58
|
"test": "c8 mocha",
|
56
59
|
"validate": "npm run lint:fix && npm run test && git add -u ."
|
57
60
|
},
|
58
61
|
"prettier": "@wfcd/eslint-config/prettier",
|
62
|
+
"overrides": {
|
63
|
+
"sinon-chai": {
|
64
|
+
"chai": "^5.0.3"
|
65
|
+
}
|
66
|
+
},
|
59
67
|
"devDependencies": {
|
68
|
+
"@biomejs/biome": "2.0.6",
|
60
69
|
"@commitlint/cli": "^19.2.1",
|
61
70
|
"@commitlint/config-conventional": "^19.1.0",
|
62
71
|
"@types/chai": "^5.0.0",
|
63
|
-
"@types/
|
64
|
-
"
|
65
|
-
"
|
72
|
+
"@types/mocha": "^10.0.10",
|
73
|
+
"@types/node": "^24.0.7",
|
74
|
+
"@types/sinon": "^17.0.4",
|
75
|
+
"@types/sinon-chai": "^4.0.0",
|
76
|
+
"@types/yargs": "^17.0.33",
|
77
|
+
"ajv": "^8.17.1",
|
78
|
+
"ajv-formats": "^3.0.1",
|
79
|
+
"c8": "^10.1.3",
|
80
|
+
"chai": "^5.2.0",
|
66
81
|
"chai-json": "^1.0.0",
|
67
82
|
"chai-json-schema-ajv": "^5.2.4",
|
68
83
|
"coveralls": "^3.1.1",
|
69
84
|
"husky": "^9.0.11",
|
70
85
|
"lint-staged": "^16.0.0",
|
71
|
-
"mocha": "^11.
|
72
|
-
"prettier": "^3.2
|
86
|
+
"mocha": "^11.7.1",
|
87
|
+
"prettier": "^3.6.2",
|
73
88
|
"sinon": "^21.0.0",
|
74
89
|
"sinon-chai": "^4.0.0",
|
75
|
-
"
|
90
|
+
"tsdown": "^0.12.9",
|
91
|
+
"tsx": "^4.20.3",
|
92
|
+
"typescript": "^5.8.3",
|
93
|
+
"yargs": "^17.7.2"
|
76
94
|
},
|
77
95
|
"engines": {
|
78
96
|
"node": ">=18.19.0"
|
79
|
-
},
|
80
|
-
"overrides": {
|
81
|
-
"sinon-chai": {
|
82
|
-
"chai": "^5.0.3"
|
83
|
-
}
|
84
97
|
}
|
85
98
|
}
|
@@ -1,19 +1,23 @@
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
2
|
+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
3
|
+
|
1
4
|
/**
|
2
5
|
* Safely require path, fall back to fallback if module cannot load
|
3
6
|
* @param {string} path Path to attempt to load
|
4
7
|
* @param {Object} fallback fallback response if error or no module
|
5
8
|
* @returns {Promise<any>} module or the default object
|
6
9
|
*/
|
7
|
-
const safeImport = async (path, fallback = {}) => {
|
10
|
+
const safeImport = async <T>(path: string, fallback: T = {} as T): Promise<T> => {
|
8
11
|
try {
|
9
|
-
const mod = await import(path, path.includes('.json') ? { with: { type: 'json' } } : {});
|
10
|
-
if (mod?.default) return mod.default;
|
11
|
-
return mod;
|
12
|
+
const mod: any = await import(path, path.includes('.json') ? { with: { type: 'json' } } : {});
|
13
|
+
if (mod?.default) return mod.default as T;
|
14
|
+
return mod as T;
|
12
15
|
} catch (error) {
|
13
16
|
if ((process.env.LOG_LEVEL || 'ERROR').toUpperCase() === 'DEBUG') {
|
14
17
|
// eslint-disable-next-line no-console
|
15
18
|
console.debug(`Failed to load module at ${path} ... returning fallback`);
|
16
19
|
}
|
20
|
+
|
17
21
|
return fallback;
|
18
22
|
}
|
19
23
|
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/**
|
2
|
+
* @description Insist that the provided data has the required properties.
|
3
|
+
* @param thing to encourage to have data
|
4
|
+
* @param args arguments to ensure
|
5
|
+
*/
|
6
|
+
export const insist = (thing: Record<string, unknown>, ...args: string[]) => {
|
7
|
+
if (!thing || !Object.keys(thing).length) {
|
8
|
+
throw new TypeError('The provided data does not have the required properties.');
|
9
|
+
}
|
10
|
+
|
11
|
+
args.forEach((arg) => {
|
12
|
+
if (!thing[arg]) {
|
13
|
+
throw new TypeError('The provided data does not have the required properties.');
|
14
|
+
}
|
15
|
+
});
|
16
|
+
};
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
|
3
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
4
|
+
import { dirname, join } from 'node:path';
|
5
|
+
import { fileURLToPath } from 'node:url';
|
6
|
+
|
7
|
+
import yargs from 'yargs/yargs';
|
8
|
+
|
9
|
+
const options = yargs(process.argv)
|
10
|
+
.usage('Usage -c')
|
11
|
+
.option('c', { alias: 'check', describe: "Check only, don't write file", type: 'boolean', demandOption: false })
|
12
|
+
.parse();
|
13
|
+
|
14
|
+
const checkOnly = (await options).c;
|
15
|
+
|
16
|
+
const dirName: string = dirname(fileURLToPath(import.meta.url));
|
17
|
+
const sort = (obj: Record<string, { value: string; desc?: string }>) => {
|
18
|
+
return Object.keys(obj)
|
19
|
+
.sort()
|
20
|
+
.reduce(
|
21
|
+
function (result, key: string) {
|
22
|
+
result[key] = obj[key];
|
23
|
+
return result;
|
24
|
+
},
|
25
|
+
{} as Record<string, { value: string; desc?: string }>
|
26
|
+
);
|
27
|
+
};
|
28
|
+
|
29
|
+
const dataDir = join(dirName, '..', 'data');
|
30
|
+
const data = JSON.parse(await readFile(join(dataDir, 'languages.json'), 'utf8'));
|
31
|
+
|
32
|
+
const sortedData = sort(data);
|
33
|
+
|
34
|
+
if (JSON.stringify(sortedData, undefined, 2) !== JSON.stringify(data, undefined, 2)) {
|
35
|
+
console.error('Data not sorted');
|
36
|
+
if (checkOnly) { process.exit(1); }
|
37
|
+
}
|
38
|
+
|
39
|
+
if (checkOnly) { process.exit(0); }
|
40
|
+
|
41
|
+
await writeFile(join(dataDir, 'languages.json.bak'), JSON.stringify(data, undefined, 2));
|
42
|
+
await writeFile(join(dataDir, 'languages.json'), JSON.stringify(sortedData, undefined, 2));
|
43
|
+
|
44
|
+
console.log('language.json has been sorted!');
|
@@ -1,10 +1,10 @@
|
|
1
|
-
const epochZero = {
|
1
|
+
const epochZero: WorldStateDate = {
|
2
2
|
$date: {
|
3
3
|
$numberLong: 0,
|
4
4
|
},
|
5
5
|
};
|
6
6
|
|
7
|
-
const pieceIsSmoller = (seconds, ceiling, label, timePieces) => {
|
7
|
+
const pieceIsSmoller = (seconds: number, ceiling: number, label: string, timePieces: string[]) => {
|
8
8
|
if (seconds >= ceiling) {
|
9
9
|
timePieces.push(`${Math.floor(seconds / ceiling)}${label}`);
|
10
10
|
seconds = Math.floor(seconds) % ceiling;
|
@@ -16,12 +16,12 @@ const pieceIsSmoller = (seconds, ceiling, label, timePieces) => {
|
|
16
16
|
* @param {number} millis The number of milliseconds in the time delta
|
17
17
|
* @returns {string} formatted time delta
|
18
18
|
*/
|
19
|
-
export const timeDeltaToString = (millis) => {
|
19
|
+
export const timeDeltaToString = (millis: number): string => {
|
20
20
|
if (typeof millis !== 'number') {
|
21
21
|
throw new TypeError('millis should be a number');
|
22
22
|
}
|
23
23
|
|
24
|
-
let timePieces = [];
|
24
|
+
let timePieces: string[] = [];
|
25
25
|
const prefix = millis < 0 ? '-' : '';
|
26
26
|
let seconds = Math.abs(millis / 1000);
|
27
27
|
|
@@ -47,7 +47,7 @@ export const timeDeltaToString = (millis) => {
|
|
47
47
|
* @param {function} [now] A function that returns the current UNIX time in milliseconds
|
48
48
|
* @returns {number} The number of milliseconds after the given date to now
|
49
49
|
*/
|
50
|
-
export const fromNow = (d, now = Date.now) => {
|
50
|
+
export const fromNow = (d: Date, now: () => number = Date.now): number => {
|
51
51
|
return d.getTime() - now();
|
52
52
|
};
|
53
53
|
|
@@ -57,19 +57,23 @@ export const fromNow = (d, now = Date.now) => {
|
|
57
57
|
* @param {function} [now] A function that returns the current UNIX time in milliseconds
|
58
58
|
* @returns {number} The number of milliseconds after now to the given date
|
59
59
|
*/
|
60
|
-
export const toNow = (d, now = Date.now) => {
|
60
|
+
export const toNow = (d: Date, now: () => number = Date.now): number => {
|
61
61
|
return now() - d.getTime();
|
62
62
|
};
|
63
63
|
|
64
|
+
export interface WorldStateDate {
|
65
|
+
$date?: { $numberLong: number };
|
66
|
+
}
|
67
|
+
|
64
68
|
/**
|
65
69
|
* Returns a new Date constructed from a worldState date object
|
66
70
|
* @param {Object} d The worldState date object
|
67
71
|
* @returns {Date} parsed date from DE date format
|
68
72
|
*/
|
69
|
-
export const parseDate = (d) => {
|
73
|
+
export const parseDate = (d?: WorldStateDate): Date => {
|
70
74
|
const safeD = d || epochZero;
|
71
75
|
const dt = safeD.$date || epochZero.$date;
|
72
|
-
return new Date(safeD.$date ? Number(dt
|
76
|
+
return new Date(safeD.$date ? Number(dt!.$numberLong) : 1000 * (d as {sec: number}).sec);
|
73
77
|
};
|
74
78
|
|
75
79
|
/**
|