warframe-worldstate-parser 2.23.2 → 2.25.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.
Files changed (65) hide show
  1. package/lib/Alert.js +8 -8
  2. package/lib/CambionCycle.js +1 -5
  3. package/lib/CetusCycle.js +3 -3
  4. package/lib/ChallengeInstance.js +6 -6
  5. package/lib/ConclaveChallenge.js +2 -5
  6. package/lib/ConstructionProgress.js +4 -2
  7. package/lib/DailyDeal.js +1 -3
  8. package/lib/DarkSector.js +11 -8
  9. package/lib/EarthCycle.js +4 -4
  10. package/lib/Fissure.js +18 -10
  11. package/lib/FlashSale.js +2 -7
  12. package/lib/GlobalUpgrade.js +5 -5
  13. package/lib/Invasion.js +11 -10
  14. package/lib/Kuva.js +16 -10
  15. package/lib/Mission.js +31 -21
  16. package/lib/News.js +13 -15
  17. package/lib/Nightwave.js +7 -4
  18. package/lib/NightwaveChallenge.js +2 -4
  19. package/lib/PersistentEnemy.js +1 -3
  20. package/lib/Reward.js +64 -60
  21. package/lib/SentientOutpost.js +7 -8
  22. package/lib/Simaris.js +5 -3
  23. package/lib/Sortie.js +22 -16
  24. package/lib/SortieVariant.js +17 -18
  25. package/lib/SteelPathOffering.js +1 -0
  26. package/lib/SyndicateJob.js +20 -11
  27. package/lib/SyndicateMission.js +6 -6
  28. package/lib/VallisCycle.js +2 -2
  29. package/lib/VoidTrader.js +9 -13
  30. package/lib/WeeklyChallenge.js +4 -3
  31. package/lib/WorldEvent.js +23 -29
  32. package/lib/WorldState.js +50 -28
  33. package/lib/WorldstateObject.js +35 -12
  34. package/lib/ZarimanCycle.js +141 -0
  35. package/lib/timeDate.js +13 -12
  36. package/lib/translation.js +47 -38
  37. package/package.json +3 -118
  38. package/types/lib/Alert.d.ts +1 -1
  39. package/types/lib/CambionCycle.d.ts +9 -0
  40. package/types/lib/CetusCycle.d.ts +1 -0
  41. package/types/lib/ConclaveChallenge.d.ts +1 -1
  42. package/types/lib/DailyDeal.d.ts +1 -1
  43. package/types/lib/DarkSector.d.ts +1 -1
  44. package/types/lib/EarthCycle.d.ts +1 -0
  45. package/types/lib/Fissure.d.ts +11 -10
  46. package/types/lib/FlashSale.d.ts +1 -1
  47. package/types/lib/GlobalUpgrade.d.ts +1 -1
  48. package/types/lib/Invasion.d.ts +4 -4
  49. package/types/lib/Kuva.d.ts +1 -6
  50. package/types/lib/Mission.d.ts +11 -4
  51. package/types/lib/News.d.ts +4 -4
  52. package/types/lib/Nightwave.d.ts +2 -1
  53. package/types/lib/NightwaveChallenge.d.ts +7 -1
  54. package/types/lib/PersistentEnemy.d.ts +1 -1
  55. package/types/lib/SentientOutpost.d.ts +1 -1
  56. package/types/lib/Sortie.d.ts +10 -16
  57. package/types/lib/SortieVariant.d.ts +14 -20
  58. package/types/lib/SyndicateMission.d.ts +6 -1
  59. package/types/lib/VallisCycle.d.ts +1 -0
  60. package/types/lib/VoidTrader.d.ts +1 -1
  61. package/types/lib/WorldEvent.d.ts +3 -3
  62. package/types/lib/WorldState.d.ts +5 -1
  63. package/types/lib/WorldstateObject.d.ts +43 -11
  64. package/types/lib/ZarimanCycle.d.ts +56 -0
  65. package/types/main.d.ts +1 -1
@@ -1,7 +1,4 @@
1
1
  export = Mission;
2
- /**
3
- * Represents an in-game mission
4
- */
5
2
  declare class Mission {
6
3
  /**
7
4
  * @param {Object} data The mission data
@@ -11,7 +8,7 @@ declare class Mission {
11
8
  * @param {Reward} deps.Reward The Reward parser
12
9
  * @param {string} deps.locale Locale to use for translations
13
10
  */
14
- constructor(data: any, { mdConfig, translator, Reward, locale, }: {
11
+ constructor(data: any, { mdConfig, translator, Reward, locale }: {
15
12
  mdConfig: MarkdownSettings;
16
13
  translator: Translator;
17
14
  Reward: Reward;
@@ -33,11 +30,21 @@ declare class Mission {
33
30
  * @type {string}
34
31
  */
35
32
  node: string;
33
+ /**
34
+ * Unlocalized {@link mission#node}
35
+ * @type {string}
36
+ */
37
+ nodeKey: string;
36
38
  /**
37
39
  * The mission's type
38
40
  * @type {string}
39
41
  */
40
42
  type: string;
43
+ /**
44
+ * The mission's type
45
+ * @type {string}
46
+ */
47
+ typeKey: string;
41
48
  /**
42
49
  * The factions that the players must fight in the mission
43
50
  * @type {string}
@@ -107,10 +107,10 @@ declare class News extends WorldstateObject {
107
107
  */
108
108
  isStream(): boolean;
109
109
  /**
110
- * The title of the news item in the specified language
111
- * @param {string} langCode Ex. 'es', 'de', 'fr'
112
- * @returns {string}
113
- */
110
+ * The title of the news item in the specified language
111
+ * @param {string} langCode Ex. 'es', 'de', 'fr'
112
+ * @returns {string}
113
+ */
114
114
  getTitle(langCode: string): string;
115
115
  }
116
116
  import WorldstateObject = require("./WorldstateObject");
@@ -14,7 +14,7 @@ declare class Nightwave extends WorldstateObject {
14
14
  * @param {Reward} deps.Reward The Reward parser
15
15
  * @param {string} deps.locale Locale to use for translations
16
16
  */
17
- constructor(data: any, { mdConfig, translator, timeDate, Mission, Reward, locale, }: {
17
+ constructor(data: any, { mdConfig, translator, timeDate, Mission, Reward, locale }: {
18
18
  mdConfig: MarkdownSettings;
19
19
  translator: Translator;
20
20
  timeDate: TimeDateFunctions;
@@ -22,6 +22,7 @@ declare class Nightwave extends WorldstateObject {
22
22
  Reward: Reward;
23
23
  locale: string;
24
24
  });
25
+ id: string;
25
26
  /**
26
27
  * The markdown settings
27
28
  * @type {MarkdownSettings}
@@ -11,7 +11,7 @@ declare class NightwaveChallenge extends WorldstateObject {
11
11
  * @param {TimeDateFunctions} deps.timeDate The time and date functions
12
12
  * @param {string} deps.locale Locale to use for translations
13
13
  */
14
- constructor(data: any, { translator, timeDate, locale, }: {
14
+ constructor(data: any, { translator, timeDate, locale }: {
15
15
  translator: Translator;
16
16
  timeDate: TimeDateFunctions;
17
17
  locale: string;
@@ -36,6 +36,12 @@ declare class NightwaveChallenge extends WorldstateObject {
36
36
  * @type {string}
37
37
  */
38
38
  title: string;
39
+ /**
40
+ * Generated id from expiry, challenge string,
41
+ * and whether or not it has `[PH]` (designating placeholder text)
42
+ * @type {string}
43
+ */
44
+ id: string;
39
45
  /**
40
46
  * Reputation reward for ranking up in the Nightwave
41
47
  * @type {Number}
@@ -11,7 +11,7 @@ declare class PersistentEnemy extends WorldstateObject {
11
11
  * @param {Translator} deps.translator The string translator
12
12
  * @param {string} deps.locale Locale to use for translations
13
13
  */
14
- constructor(data: any, { mdConfig, translator, timeDate, locale, }: {
14
+ constructor(data: any, { mdConfig, translator, timeDate, locale }: {
15
15
  mdConfig: MarkdownSettings;
16
16
  translator: Translator;
17
17
  locale: string;
@@ -20,7 +20,7 @@ export = SentientOutpost;
20
20
  * @property {Date} previous.expiry When the mission became or becomes inactive
21
21
  */
22
22
  declare class SentientOutpost {
23
- constructor(data: any, { translator, locale, sentientData, logger, }: {
23
+ constructor(data: any, { translator, locale, sentientData, logger }: {
24
24
  translator: any;
25
25
  locale: any;
26
26
  sentientData: any;
@@ -7,21 +7,14 @@ declare class Sortie extends WorldstateObject {
7
7
  /**
8
8
  * @param {Object} data The data for all daily sorties
9
9
  * @param {Object} deps The dependencies object
10
- * @param {MarkdownSettings} deps.mdConfig The markdown settings
11
- * @param {Translator} deps.translator The string translator
12
- * @param {TimeDateFunctions} deps.timeDate The time and date functions
13
- * @param {Object} deps.sortieData The data used to parse sorties
14
- * @param {SortieVariant} deps.SortieVariant The sortie variant parser
15
- * @param {string} deps.locale Locale to use for translations
10
+ * @param {MarkdownSettings} mdConfig The markdown settings
11
+ * @param {Translator} translator The string translator
12
+ * @param {TimeDateFunctions} timeDate The time and date functions
13
+ * @param {Object} sortieData The data used to parse sorties
14
+ * @param {SortieVariant} SortieVariant The sortie variant parser
15
+ * @param {string} locale Locale to use for translations
16
16
  */
17
- constructor(data: any, { mdConfig, translator, timeDate, sortieData, SortieVariant, locale, }: {
18
- mdConfig: MarkdownSettings;
19
- translator: Translator;
20
- timeDate: TimeDateFunctions;
21
- sortieData: any;
22
- SortieVariant: SortieVariant;
23
- locale: string;
24
- });
17
+ constructor(data: any, { mdConfig, translator, timeDate, sortieData, SortieVariant, locale, Mission }: any);
25
18
  /**
26
19
  * The markdown settings
27
20
  * @type {MarkdownSettings}
@@ -37,7 +30,8 @@ declare class Sortie extends WorldstateObject {
37
30
  * The sortie's variants
38
31
  * @type {Array.<SortieVariant>}
39
32
  */
40
- variants: Array<SortieVariant>;
33
+ variants: Array<any>;
34
+ missions: any;
41
35
  /**
42
36
  * The sortie's boss
43
37
  * @type {string}
@@ -54,7 +48,7 @@ declare class Sortie extends WorldstateObject {
54
48
  */
55
49
  factionKey: string;
56
50
  /**
57
- * Whether or not this is expired (at time of object creation)
51
+ * Whether this is expired (at time of object creation)
58
52
  * @type {boolean}
59
53
  */
60
54
  expired: boolean;
@@ -5,18 +5,12 @@ export = SortieVariant;
5
5
  declare class SortieVariant {
6
6
  /**
7
7
  * @param {Object} data Sortie variant data
8
- * @param {Object} deps The dependencies object
9
- * @param {MarkdownSettings} deps.mdConfig The markdown settings
10
- * @param {Translator} deps.translator The string translator
11
- * @param {Object} deps.sortieData The data used to parse sorties
12
- * @param {string} deps.locale Locale to use for translations
8
+ * @param {MarkdownSettings} mdConfig The markdown settings
9
+ * @param {Translator} translator The string translator
10
+ * @param {Object} sortieData The data used to parse sorties
11
+ * @param {string} locale Locale to use for translations
13
12
  */
14
- constructor(data: any, { mdConfig, translator, locale, }: {
15
- mdConfig: MarkdownSettings;
16
- translator: Translator;
17
- sortieData: any;
18
- locale: string;
19
- });
13
+ constructor(data: any, { mdConfig, translator, locale }: MarkdownSettings);
20
14
  /**
21
15
  * The markdown settings
22
16
  * @type {MarkdownSettings}
@@ -24,19 +18,19 @@ declare class SortieVariant {
24
18
  */
25
19
  private mdConfig;
26
20
  /**
27
- * The variant's mission type
28
- * @type {string}
29
- */
21
+ * The variant's mission type
22
+ * @type {string}
23
+ */
30
24
  missionType: string;
31
25
  /**
32
- * The variant's modifier
33
- * @type {string}
34
- */
26
+ * The variant's modifier
27
+ * @type {string}
28
+ */
35
29
  modifier: string;
36
30
  /**
37
- * The variant's modifier description
38
- * @type {string}
39
- */
31
+ * The variant's modifier description
32
+ * @type {string}
33
+ */
40
34
  modifierDescription: string;
41
35
  /**
42
36
  * The node where the variant takes place
@@ -12,7 +12,7 @@ declare class SyndicateMission extends WorldstateObject {
12
12
  * @param {TimeDateFunctions} deps.timeDate The time and date functions
13
13
  * @param {string} deps.locale Locale to use for translations
14
14
  */
15
- constructor(data: any, { mdConfig, translator, timeDate, locale, }: {
15
+ constructor(data: any, { mdConfig, translator, timeDate, locale }: {
16
16
  mdConfig: MarkdownSettings;
17
17
  translator: Translator;
18
18
  timeDate: TimeDateFunctions;
@@ -50,6 +50,11 @@ declare class SyndicateMission extends WorldstateObject {
50
50
  * @type {Array.<SyndicateJob>}
51
51
  */
52
52
  jobs: Array<SyndicateJob>;
53
+ /**
54
+ * Unique identifier for this mission set built from the end time and syndicate
55
+ * @type {string}
56
+ */
57
+ id: string;
53
58
  /**
54
59
  * ETA string (at time of object creation)
55
60
  * @type {String}
@@ -32,6 +32,7 @@ declare class VallisCycle extends WorldstateObject {
32
32
  * @type {string}
33
33
  */
34
34
  timeLeft: string;
35
+ id: string;
35
36
  shortString: string;
36
37
  /**
37
38
  * Get whether or not the event has expired
@@ -12,7 +12,7 @@ declare class VoidTrader extends WorldstateObject {
12
12
  * @param {TimeDateFunctions} deps.timeDate The time and date functions
13
13
  * @param {string} deps.locale Locale to use for translations
14
14
  */
15
- constructor(data: any, { mdConfig, translator, timeDate, locale, }: {
15
+ constructor(data: any, { mdConfig, translator, timeDate, locale }: {
16
16
  mdConfig: MarkdownSettings;
17
17
  translator: Translator;
18
18
  timeDate: TimeDateFunctions;
@@ -30,7 +30,7 @@ declare class WorldEvent extends WorldstateObject {
30
30
  * @param {Reward} deps.Reward The Reward parser
31
31
  * @param {string} deps.locale Locale to use for translations
32
32
  */
33
- constructor(data: any, { mdConfig, translator, timeDate, Reward, locale, }: {
33
+ constructor(data: any, { mdConfig, translator, timeDate, Reward, locale }: {
34
34
  mdConfig: MarkdownSettings;
35
35
  translator: Translator;
36
36
  timeDate: TimeDateFunctions;
@@ -128,9 +128,9 @@ declare class WorldEvent extends WorldstateObject {
128
128
  interimSteps: InterimStep[];
129
129
  /**
130
130
  * Progress Steps, if any are present
131
- * @type {ProgessStep[]}
131
+ * @type {ProgressStep[]}
132
132
  */
133
- progressSteps: ProgessStep[];
133
+ progressSteps: ProgressStep[];
134
134
  /**
135
135
  * Total of all MultiProgress
136
136
  * @type {Number}
@@ -91,6 +91,11 @@ declare class WorldState {
91
91
  * @type {CambionCycle}
92
92
  */
93
93
  cambionCycle: CambionCycle;
94
+ /**
95
+ * The current Zariman cycle based off current time
96
+ * @type {ZarimanCycle}
97
+ */
98
+ zarimanCycle: ZarimanCycle;
94
99
  /**
95
100
  * Weekly challenges
96
101
  * @type {Array.<WeeklyChallenge>}
@@ -142,4 +147,3 @@ import VallisCycle = require("./VallisCycle");
142
147
  import Nightwave = require("./Nightwave");
143
148
  import SentientOutpost = require("./SentientOutpost");
144
149
  import SteelPathOffering = require("./SteelPathOffering");
145
- import Dependency = require("./supporting/Dependency");
@@ -1,19 +1,15 @@
1
1
  export = WorldstateObject;
2
- /**
3
- * Represents a generic ojbect from Worldstate
4
- */
5
2
  declare class WorldstateObject {
6
3
  /**
7
- * @param {Object} data The object data
4
+ * @param {BaseContentObject} data The object data
5
+ * @param {TimeDateFunctions} timeDate time date functions
8
6
  */
9
- constructor(data: any, { timeDate }: {
10
- timeDate: any;
11
- });
7
+ constructor(data: BaseContentObject, { timeDate }: TimeDateFunctions);
12
8
  /**
13
9
  * The object's id field
14
- * @type {string}
10
+ * @type {Identifier.$id|Identifier.$oid}
15
11
  */
16
- id: string;
12
+ id: Identifier.$id | Identifier.$oid;
17
13
  /**
18
14
  * The time and date functions
19
15
  * @type {TimeDateFunctions}
@@ -37,7 +33,7 @@ declare class WorldstateObject {
37
33
  */
38
34
  expiry: Date;
39
35
  /**
40
- * Whether or not the void trader is active (at time of object creation)
36
+ * Whether the void trader is active (at time of object creation)
41
37
  * @type {boolean}
42
38
  */
43
39
  active: boolean;
@@ -47,7 +43,7 @@ declare class WorldstateObject {
47
43
  */
48
44
  toString(): string;
49
45
  /**
50
- * Get whether or not the trader is currently active
46
+ * Get whether the trader is currently active
51
47
  * @returns {boolean}
52
48
  */
53
49
  isActive(): boolean;
@@ -62,3 +58,39 @@ declare class WorldstateObject {
62
58
  */
63
59
  getEndString(): string;
64
60
  }
61
+ declare namespace WorldstateObject {
62
+ export { Identifier, LegacyTimestamp, Timestamp, ContentTimestamp, BaseContentObject };
63
+ }
64
+ type BaseContentObject = {
65
+ _id: Identifier;
66
+ Activation: ContentTimestamp;
67
+ Expiry: ContentTimestamp;
68
+ };
69
+ type Identifier = {
70
+ /**
71
+ * older identifier schema
72
+ */
73
+ $id: string;
74
+ /**
75
+ * newer global identifier schema
76
+ */
77
+ $oid: string;
78
+ };
79
+ type LegacyTimestamp = {
80
+ /**
81
+ * second-based timestamp
82
+ */
83
+ sec: number;
84
+ };
85
+ type Timestamp = {
86
+ /**
87
+ * millisecond-based timestamp
88
+ */
89
+ $numberLong: number;
90
+ };
91
+ type ContentTimestamp = {
92
+ /**
93
+ * timestamp number wrapper
94
+ */
95
+ $date: LegacyTimestamp | Timestamp;
96
+ };
@@ -0,0 +1,56 @@
1
+ export = ZarimanCycle;
2
+ declare class ZarimanCycle extends WorldstateObject {
3
+ /**
4
+ * @param {Date} bountiesEndDate The current zariman cycle expiry
5
+ * @param {Object} deps The dependencies object
6
+ * @param {MarkdownSettings} deps.mdConfig The markdown settings
7
+ * @param {TimeDateFunctions} deps.timeDate The time and date functions
8
+ */
9
+ constructor(bountiesEndDate: Date, { mdConfig, timeDate }: {
10
+ mdConfig: MarkdownSettings;
11
+ timeDate: TimeDateFunctions;
12
+ });
13
+ /**
14
+ * The markdown settings
15
+ * @type {MarkdownSettings}
16
+ * @private
17
+ */
18
+ private mdConfig;
19
+ /**
20
+ * The end of the Zariman bounties timer, the faction changes exactly half way through
21
+ * @type {Date}
22
+ * @private
23
+ */
24
+ private bountiesEndDate;
25
+ /**
26
+ * Whether or not this it's corpus or grineer
27
+ * @type {boolean}
28
+ */
29
+ isCorpus: boolean;
30
+ /**
31
+ * Current cycle state. One of `corpus`, `grineer`
32
+ * @type {string}
33
+ */
34
+ state: string;
35
+ /**
36
+ * Time remaining string
37
+ * @type {string}
38
+ */
39
+ timeLeft: string;
40
+ id: string;
41
+ shortString: string;
42
+ /**
43
+ * Get whether the event has expired
44
+ * @returns {boolean}
45
+ */
46
+ getExpired(): boolean;
47
+ getCurrentZarimanCycle(): {
48
+ isCorpus: boolean;
49
+ timeLeft: any;
50
+ expiry: Date;
51
+ expiresIn: any;
52
+ state: string;
53
+ start: number;
54
+ };
55
+ }
56
+ import WorldstateObject = require("./WorldstateObject");
package/types/main.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  declare const _exports: {
2
- new (json: string, deps?: import("./lib/supporting/Dependency")): import("./lib/WorldState");
2
+ new (json: string, deps?: Dependency): import("./lib/WorldState");
3
3
  };
4
4
  export = _exports;