warframe-worldstate-data 3.0.1 → 3.1.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/dist/{exports-D0bYygo0.d.ts → exports-0BwYdqwz.d.ts} +1 -1
- package/dist/exports.d.ts +2 -2
- package/dist/{timeDate-BZaZFq86.d.ts → timeDate-BPFhOMfU.d.ts} +26 -4
- package/dist/{timeDate-B78E0z0S.js → timeDate-D4snMbmG.js} +36 -2
- package/dist/tools/timeDate.d.ts +2 -2
- package/dist/tools/timeDate.js +2 -2
- package/dist/tools/translation.d.ts +3 -3
- package/dist/tools/utilities.d.ts +5 -5
- package/dist/tools/utilities.js +2 -2
- package/dist/{translation-CMA-O2tP.d.ts → translation-DGiDGVss.d.ts} +2 -2
- package/dist/{types-Clh1x9kB.d.ts → types-CU1MHyQQ.d.ts} +2 -2
- package/dist/types.d.ts +2 -2
- package/package.json +4 -4
- package/tools/timeDate.ts +40 -4
- package/types.ts +3 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Arcane, ArchonShard, Conclave, Events, SolNode, SortieData, SteelPath, SynthesisTarget } from "./types-
|
1
|
+
import { Arcane, ArchonShard, Conclave, Events, SolNode, SortieData, SteelPath, SynthesisTarget } from "./types-CU1MHyQQ.js";
|
2
2
|
|
3
3
|
//#region exports.d.ts
|
4
4
|
type Locale = 'de' | 'en' | 'es' | 'fr' | 'it' | 'ko' | 'pl' | 'pt' | 'ru' | 'zh' | 'cs' | 'sr' | 'uk';
|
package/dist/exports.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
import "./types-
|
2
|
-
import { Locale, WorldstateLangBundle, _default } from "./exports-
|
1
|
+
import "./types-CU1MHyQQ.js";
|
2
|
+
import { Locale, WorldstateLangBundle, _default } from "./exports-0BwYdqwz.js";
|
3
3
|
export { Locale, WorldstateLangBundle, _default as default };
|
@@ -18,7 +18,7 @@ declare const fromNow: (d: Date, now?: () => number) => number;
|
|
18
18
|
* @returns {number} The number of milliseconds after now to the given date
|
19
19
|
*/
|
20
20
|
declare const toNow: (d: Date, now?: () => number) => number;
|
21
|
-
interface
|
21
|
+
interface ContentTimestamp {
|
22
22
|
$date?: {
|
23
23
|
$numberLong: number;
|
24
24
|
};
|
@@ -28,7 +28,21 @@ interface WorldStateDate {
|
|
28
28
|
* @param {Object} d The worldState date object
|
29
29
|
* @returns {Date} parsed date from DE date format
|
30
30
|
*/
|
31
|
-
declare const parseDate: (d?:
|
31
|
+
declare const parseDate: (d?: ContentTimestamp) => Date;
|
32
|
+
/**
|
33
|
+
* Get a weekly reset timestamp
|
34
|
+
*/
|
35
|
+
declare const weeklyReset: () => {
|
36
|
+
activation: Date;
|
37
|
+
expiry: Date;
|
38
|
+
};
|
39
|
+
/**
|
40
|
+
* Get a daily reset timestamp
|
41
|
+
*/
|
42
|
+
declare const dailyReset: () => {
|
43
|
+
activation: Date;
|
44
|
+
expiry: Date;
|
45
|
+
};
|
32
46
|
/**
|
33
47
|
* An object containing functions to format dates and times
|
34
48
|
* @typedef {Record<string, Function>} TimeDateFunctions
|
@@ -42,7 +56,15 @@ declare const _default: {
|
|
42
56
|
timeDeltaToString: (millis: number) => string;
|
43
57
|
fromNow: (d: Date, now?: () => number) => number;
|
44
58
|
toNow: (d: Date, now?: () => number) => number;
|
45
|
-
parseDate: (d?:
|
59
|
+
parseDate: (d?: ContentTimestamp) => Date;
|
60
|
+
dailyReset: () => {
|
61
|
+
activation: Date;
|
62
|
+
expiry: Date;
|
63
|
+
};
|
64
|
+
weeklyReset: () => {
|
65
|
+
activation: Date;
|
66
|
+
expiry: Date;
|
67
|
+
};
|
46
68
|
};
|
47
69
|
//#endregion
|
48
|
-
export {
|
70
|
+
export { ContentTimestamp, _default, dailyReset, fromNow, parseDate, timeDeltaToString, toNow, weeklyReset };
|
@@ -55,6 +55,38 @@ const parseDate = (d) => {
|
|
55
55
|
return new Date(safeD.$date ? Number(dt.$numberLong) : 1e3 * d.sec);
|
56
56
|
};
|
57
57
|
/**
|
58
|
+
* Get a weekly reset timestamp
|
59
|
+
*/
|
60
|
+
const weeklyReset = () => {
|
61
|
+
const now = /* @__PURE__ */ new Date();
|
62
|
+
const currentDay = now.getUTCDay();
|
63
|
+
const daysUntilNextMonday = currentDay === 0 ? 1 : 8 - currentDay;
|
64
|
+
const expiry = new Date(now.getTime());
|
65
|
+
expiry.setUTCDate(now.getUTCDate() + daysUntilNextMonday);
|
66
|
+
expiry.setUTCHours(0, 0, 0, 0);
|
67
|
+
const activation = new Date(expiry.getTime());
|
68
|
+
activation.setUTCDate(expiry.getUTCDate() - 7);
|
69
|
+
return {
|
70
|
+
activation,
|
71
|
+
expiry
|
72
|
+
};
|
73
|
+
};
|
74
|
+
/**
|
75
|
+
* Get a daily reset timestamp
|
76
|
+
*/
|
77
|
+
const dailyReset = () => {
|
78
|
+
const now = /* @__PURE__ */ new Date();
|
79
|
+
const activation = new Date(now.getTime());
|
80
|
+
activation.setUTCHours(0, 0, 0, 0);
|
81
|
+
const expiry = new Date(now.getTime());
|
82
|
+
expiry.setUTCDate(now.getUTCDate() + 1);
|
83
|
+
expiry.setUTCHours(0, 0, 0, 0);
|
84
|
+
return {
|
85
|
+
activation,
|
86
|
+
expiry
|
87
|
+
};
|
88
|
+
};
|
89
|
+
/**
|
58
90
|
* An object containing functions to format dates and times
|
59
91
|
* @typedef {Record<string, Function>} TimeDateFunctions
|
60
92
|
* @property {Function} timeDeltaToString - Converts a time difference to a string
|
@@ -67,8 +99,10 @@ var timeDate_default = {
|
|
67
99
|
timeDeltaToString,
|
68
100
|
fromNow,
|
69
101
|
toNow,
|
70
|
-
parseDate
|
102
|
+
parseDate,
|
103
|
+
dailyReset,
|
104
|
+
weeklyReset
|
71
105
|
};
|
72
106
|
|
73
107
|
//#endregion
|
74
|
-
export { fromNow, parseDate, timeDate_default, timeDeltaToString, toNow };
|
108
|
+
export { dailyReset, fromNow, parseDate, timeDate_default, timeDeltaToString, toNow, weeklyReset };
|
package/dist/tools/timeDate.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import {
|
2
|
-
export {
|
1
|
+
import { ContentTimestamp, _default, dailyReset, fromNow, parseDate, timeDeltaToString, toNow, weeklyReset } from "../timeDate-BPFhOMfU.js";
|
2
|
+
export { ContentTimestamp, dailyReset, _default as default, fromNow, parseDate, timeDeltaToString, toNow, weeklyReset };
|
package/dist/tools/timeDate.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
import { fromNow, parseDate, timeDate_default, timeDeltaToString, toNow } from "../timeDate-
|
1
|
+
import { dailyReset, fromNow, parseDate, timeDate_default, timeDeltaToString, toNow, weeklyReset } from "../timeDate-D4snMbmG.js";
|
2
2
|
|
3
|
-
export { timeDate_default as default, fromNow, parseDate, timeDeltaToString, toNow };
|
3
|
+
export { dailyReset, timeDate_default as default, fromNow, parseDate, timeDeltaToString, toNow, weeklyReset };
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import "../types-
|
2
|
-
import "../exports-
|
3
|
-
import { _default, 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, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade } from "../translation-
|
1
|
+
import "../types-CU1MHyQQ.js";
|
2
|
+
import "../exports-0BwYdqwz.js";
|
3
|
+
import { _default, 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, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade } from "../translation-DGiDGVss.js";
|
4
4
|
export { archonShard, archonShardColor, archonShardUpgradeType, conclaveCategory, conclaveChallenge, conclaveMode, _default as default, faction, fissureModifier, fissureTier, languageDesc, languageString, lastResourceName, missionType, node, nodeEnemy, nodeMissionType, operation, operationSymbol, region, sortieBoss, sortieFaction, sortieModDesc, sortieModifier, splitResourceName, steelPath, syndicate, toTitleCase, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade };
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import "../types-
|
2
|
-
import "../exports-
|
1
|
+
import "../types-CU1MHyQQ.js";
|
2
|
+
import "../exports-0BwYdqwz.js";
|
3
3
|
import { insist } from "../integrity-hhdd4nAB.js";
|
4
|
-
import {
|
5
|
-
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, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade } from "../translation-
|
6
|
-
export {
|
4
|
+
import { ContentTimestamp, dailyReset, fromNow, parseDate, timeDeltaToString, toNow, weeklyReset } from "../timeDate-BPFhOMfU.js";
|
5
|
+
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, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade } from "../translation-DGiDGVss.js";
|
6
|
+
export { ContentTimestamp, archonShard, archonShardColor, archonShardUpgradeType, conclaveCategory, conclaveChallenge, conclaveMode, dailyReset, faction, fissureModifier, fissureTier, fromNow, insist, languageDesc, languageString, lastResourceName, missionType, node, nodeEnemy, nodeMissionType, operation, operationSymbol, parseDate, region, sortieBoss, sortieFaction, sortieModDesc, sortieModifier, splitResourceName, steelPath, syndicate, timeDeltaToString, toNow, toTitleCase, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade, weeklyReset };
|
package/dist/tools/utilities.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import "../safeImport-BXmqy9V4.js";
|
2
2
|
import "../exports-DOwA1rwv.js";
|
3
3
|
import { insist } from "../integrity-Cp6DXUCT.js";
|
4
|
-
import { fromNow, parseDate, timeDeltaToString, toNow } from "../timeDate-
|
4
|
+
import { dailyReset, fromNow, parseDate, timeDeltaToString, toNow, weeklyReset } from "../timeDate-D4snMbmG.js";
|
5
5
|
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, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade } from "../translation-BbEpzl6v.js";
|
6
6
|
|
7
|
-
export { archonShard, archonShardColor, archonShardUpgradeType, conclaveCategory, conclaveChallenge, conclaveMode, faction, fissureModifier, fissureTier, fromNow, insist, languageDesc, languageString, lastResourceName, missionType, node, nodeEnemy, nodeMissionType, operation, operationSymbol, parseDate, region, sortieBoss, sortieFaction, sortieModDesc, sortieModifier, splitResourceName, steelPath, syndicate, timeDeltaToString, toNow, toTitleCase, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade };
|
7
|
+
export { archonShard, archonShardColor, archonShardUpgradeType, conclaveCategory, conclaveChallenge, conclaveMode, dailyReset, faction, fissureModifier, fissureTier, fromNow, insist, languageDesc, languageString, lastResourceName, missionType, node, nodeEnemy, nodeMissionType, operation, operationSymbol, parseDate, region, sortieBoss, sortieFaction, sortieModDesc, sortieModifier, splitResourceName, steelPath, syndicate, timeDeltaToString, toNow, toTitleCase, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade, weeklyReset };
|
@@ -53,7 +53,7 @@ interface SteelPath {
|
|
53
53
|
}
|
54
54
|
interface SteelPathOffering {
|
55
55
|
name: string;
|
56
|
-
cost:
|
56
|
+
cost: number;
|
57
57
|
}
|
58
58
|
interface SynthesisTarget {
|
59
59
|
name: string;
|
@@ -91,4 +91,4 @@ interface SortieData {
|
|
91
91
|
modifiers: string[];
|
92
92
|
}
|
93
93
|
//#endregion
|
94
|
-
export { Arcane, ArchonShard, Conclave, Events, SolNode, SortieData, SteelPath, SynthesisTarget };
|
94
|
+
export { Arcane, ArchonShard, Conclave, Events, SolNode, SortieData, SteelPath, SteelPathOffering, SynthesisTarget };
|
package/dist/types.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Arcane, ArchonShard, Conclave, Events, SolNode, SortieData, SteelPath, SynthesisTarget } from "./types-
|
2
|
-
export { Arcane, ArchonShard, Conclave, Events, SolNode, SortieData, SteelPath, SynthesisTarget };
|
1
|
+
import { Arcane, ArchonShard, Conclave, Events, SolNode, SortieData, SteelPath, SteelPathOffering, SynthesisTarget } from "./types-CU1MHyQQ.js";
|
2
|
+
export { Arcane, ArchonShard, Conclave, Events, SolNode, SortieData, SteelPath, SteelPathOffering, SynthesisTarget };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "warframe-worldstate-data",
|
3
|
-
"version": "3.0
|
3
|
+
"version": "3.1.0",
|
4
4
|
"description": "Warframe data for use with warframe-worldstate-parser",
|
5
5
|
"keywords": [
|
6
6
|
"warframe-worldstate",
|
@@ -65,7 +65,7 @@
|
|
65
65
|
}
|
66
66
|
},
|
67
67
|
"devDependencies": {
|
68
|
-
"@biomejs/biome": "2.
|
68
|
+
"@biomejs/biome": "2.1.3",
|
69
69
|
"@commitlint/cli": "^19.2.1",
|
70
70
|
"@commitlint/config-conventional": "^19.1.0",
|
71
71
|
"@types/chai": "^5.0.0",
|
@@ -87,10 +87,10 @@
|
|
87
87
|
"prettier": "^3.6.2",
|
88
88
|
"sinon": "^21.0.0",
|
89
89
|
"sinon-chai": "^4.0.0",
|
90
|
-
"tsdown": "^0.
|
90
|
+
"tsdown": "^0.13.0",
|
91
91
|
"tsx": "^4.20.3",
|
92
92
|
"typescript": "^5.8.3",
|
93
|
-
"yargs": "^
|
93
|
+
"yargs": "^18.0.0"
|
94
94
|
},
|
95
95
|
"engines": {
|
96
96
|
"node": ">=18.19.0"
|
package/tools/timeDate.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
const epochZero:
|
1
|
+
const epochZero: ContentTimestamp = {
|
2
2
|
$date: {
|
3
3
|
$numberLong: 0,
|
4
4
|
},
|
@@ -61,7 +61,7 @@ export const toNow = (d: Date, now: () => number = Date.now): number => {
|
|
61
61
|
return now() - d.getTime();
|
62
62
|
};
|
63
63
|
|
64
|
-
export interface
|
64
|
+
export interface ContentTimestamp {
|
65
65
|
$date?: { $numberLong: number };
|
66
66
|
}
|
67
67
|
|
@@ -70,10 +70,44 @@ export interface WorldStateDate {
|
|
70
70
|
* @param {Object} d The worldState date object
|
71
71
|
* @returns {Date} parsed date from DE date format
|
72
72
|
*/
|
73
|
-
export const parseDate = (d?:
|
73
|
+
export const parseDate = (d?: ContentTimestamp): Date => {
|
74
74
|
const safeD = d || epochZero;
|
75
75
|
const dt = safeD.$date || epochZero.$date;
|
76
|
-
return new Date(safeD.$date ? Number(dt!.$numberLong) : 1000 * (d as {sec: number}).sec);
|
76
|
+
return new Date(safeD.$date ? Number(dt!.$numberLong) : 1000 * (d as { sec: number }).sec);
|
77
|
+
};
|
78
|
+
|
79
|
+
/**
|
80
|
+
* Get a weekly reset timestamp
|
81
|
+
*/
|
82
|
+
export const weeklyReset = (): { activation: Date; expiry: Date } => {
|
83
|
+
const now = new Date();
|
84
|
+
const currentDay = now.getUTCDay();
|
85
|
+
const daysUntilNextMonday = currentDay === 0 ? 1 : 8 - currentDay;
|
86
|
+
|
87
|
+
const expiry = new Date(now.getTime());
|
88
|
+
expiry.setUTCDate(now.getUTCDate() + daysUntilNextMonday);
|
89
|
+
expiry.setUTCHours(0, 0, 0, 0);
|
90
|
+
|
91
|
+
const activation = new Date(expiry.getTime());
|
92
|
+
activation.setUTCDate(expiry.getUTCDate() - 7);
|
93
|
+
|
94
|
+
return { activation, expiry };
|
95
|
+
};
|
96
|
+
|
97
|
+
/**
|
98
|
+
* Get a daily reset timestamp
|
99
|
+
*/
|
100
|
+
export const dailyReset = (): { activation: Date; expiry: Date } => {
|
101
|
+
const now = new Date();
|
102
|
+
|
103
|
+
const activation = new Date(now.getTime());
|
104
|
+
activation.setUTCHours(0, 0, 0, 0);
|
105
|
+
|
106
|
+
const expiry = new Date(now.getTime());
|
107
|
+
expiry.setUTCDate(now.getUTCDate() + 1);
|
108
|
+
expiry.setUTCHours(0, 0, 0, 0);
|
109
|
+
|
110
|
+
return {activation, expiry};
|
77
111
|
};
|
78
112
|
|
79
113
|
/**
|
@@ -90,4 +124,6 @@ export default {
|
|
90
124
|
fromNow,
|
91
125
|
toNow,
|
92
126
|
parseDate,
|
127
|
+
dailyReset,
|
128
|
+
weeklyReset,
|
93
129
|
};
|
package/types.ts
CHANGED
@@ -29,9 +29,10 @@ export interface SteelPath {
|
|
29
29
|
rotation: SteelPathOffering[];
|
30
30
|
evergreen: SteelPathOffering[];
|
31
31
|
}
|
32
|
-
|
32
|
+
|
33
|
+
export interface SteelPathOffering {
|
33
34
|
name: string;
|
34
|
-
cost:
|
35
|
+
cost: number;
|
35
36
|
}
|
36
37
|
|
37
38
|
export interface SynthesisTarget {
|