@axiapps/bridge-metrics 0.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/aggregationTypes.cjs +18 -0
- package/dist/aggregationTypes.d.cts +21 -0
- package/dist/aggregationTypes.d.ts +21 -0
- package/dist/aggregationTypes.js +1 -0
- package/dist/boonGeneration.cjs +308 -0
- package/dist/boonGeneration.d.cts +65 -0
- package/dist/boonGeneration.d.ts +65 -0
- package/dist/boonGeneration.js +16 -0
- package/dist/chunk-42DVJJLC.js +106 -0
- package/dist/chunk-4F55Q6K2.js +0 -0
- package/dist/chunk-ELKDB763.js +349 -0
- package/dist/chunk-FU74LJEM.js +77 -0
- package/dist/chunk-J3YCFY3C.js +37 -0
- package/dist/chunk-JP2ZL44R.js +18 -0
- package/dist/chunk-K2SRAMGC.js +0 -0
- package/dist/chunk-KRHODGVU.js +48 -0
- package/dist/chunk-LIGIXSSA.js +1383 -0
- package/dist/chunk-M2WR3JBQ.js +0 -0
- package/dist/chunk-PMVLNDZZ.js +279 -0
- package/dist/chunk-R5EJF5AW.js +147 -0
- package/dist/chunk-RGXSI3AI.js +298 -0
- package/dist/chunk-UFJJ6WLD.js +197 -0
- package/dist/chunk-WW5XFXGC.js +234 -0
- package/dist/chunk-ZFZS7JFU.js +10 -0
- package/dist/combatMetrics.cjs +251 -0
- package/dist/combatMetrics.d.cts +26 -0
- package/dist/combatMetrics.d.ts +26 -0
- package/dist/combatMetrics.js +21 -0
- package/dist/computePlayerAggregation.cjs +2042 -0
- package/dist/computePlayerAggregation.d.cts +249 -0
- package/dist/computePlayerAggregation.d.ts +249 -0
- package/dist/computePlayerAggregation.js +30 -0
- package/dist/conditionsMetrics.cjs +328 -0
- package/dist/conditionsMetrics.d.cts +67 -0
- package/dist/conditionsMetrics.d.ts +67 -0
- package/dist/conditionsMetrics.js +18 -0
- package/dist/constants.cjs +36 -0
- package/dist/constants.d.cts +18 -0
- package/dist/constants.d.ts +18 -0
- package/dist/constants.js +10 -0
- package/dist/dashboardMetrics.cjs +226 -0
- package/dist/dashboardMetrics.d.cts +29 -0
- package/dist/dashboardMetrics.d.ts +29 -0
- package/dist/dashboardMetrics.js +42 -0
- package/dist/dpsReportTypes.cjs +18 -0
- package/dist/dpsReportTypes.d.cts +294 -0
- package/dist/dpsReportTypes.d.ts +294 -0
- package/dist/dpsReportTypes.js +1 -0
- package/dist/index.cjs +2902 -0
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +152 -0
- package/dist/metrics-methods.json +38 -0
- package/dist/metricsSettings.cjs +75 -0
- package/dist/metricsSettings.d.cts +23 -0
- package/dist/metricsSettings.d.ts +23 -0
- package/dist/metricsSettings.js +8 -0
- package/dist/professionUtils.cjs +265 -0
- package/dist/professionUtils.d.cts +10 -0
- package/dist/professionUtils.d.ts +10 -0
- package/dist/professionUtils.js +20 -0
- package/dist/reportMetrics.cjs +224 -0
- package/dist/reportMetrics.d.cts +85 -0
- package/dist/reportMetrics.d.ts +85 -0
- package/dist/reportMetrics.js +12 -0
- package/dist/resUtility.cjs +52 -0
- package/dist/resUtility.d.cts +5 -0
- package/dist/resUtility.d.ts +5 -0
- package/dist/resUtility.js +8 -0
- package/dist/roles.cjs +18 -0
- package/dist/roles.d.cts +17 -0
- package/dist/roles.d.ts +17 -0
- package/dist/roles.js +1 -0
- package/dist/rollup.cjs +378 -0
- package/dist/rollup.d.cts +103 -0
- package/dist/rollup.d.ts +103 -0
- package/dist/rollup.js +16 -0
- package/dist/statsMetrics.cjs +153 -0
- package/dist/statsMetrics.d.cts +39 -0
- package/dist/statsMetrics.d.ts +39 -0
- package/dist/statsMetrics.js +22 -0
- package/dist/timestampUtils.cjs +63 -0
- package/dist/timestampUtils.d.cts +12 -0
- package/dist/timestampUtils.d.ts +12 -0
- package/dist/timestampUtils.js +9 -0
- package/package.json +44 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/statsMetrics.ts
|
|
21
|
+
var statsMetrics_exports = {};
|
|
22
|
+
__export(statsMetrics_exports, {
|
|
23
|
+
DAMAGE_MITIGATION_METRICS: () => DAMAGE_MITIGATION_METRICS,
|
|
24
|
+
DEFENSE_METRICS: () => DEFENSE_METRICS,
|
|
25
|
+
HEALING_METRICS: () => HEALING_METRICS,
|
|
26
|
+
NON_DAMAGING_CONDITIONS: () => NON_DAMAGING_CONDITIONS,
|
|
27
|
+
OFFENSE_METRICS: () => OFFENSE_METRICS,
|
|
28
|
+
RES_UTILITY_IDS: () => RES_UTILITY_IDS,
|
|
29
|
+
RES_UTILITY_NAME_MATCHES: () => RES_UTILITY_NAME_MATCHES,
|
|
30
|
+
SUPPORT_METRICS: () => SUPPORT_METRICS
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(statsMetrics_exports);
|
|
33
|
+
|
|
34
|
+
// src/conditionsMetrics.ts
|
|
35
|
+
var NON_DAMAGING_CONDITIONS = /* @__PURE__ */ new Set([
|
|
36
|
+
"Vulnerability",
|
|
37
|
+
"Weakness",
|
|
38
|
+
"Blind",
|
|
39
|
+
"Cripple",
|
|
40
|
+
"Chill",
|
|
41
|
+
"Immobilize",
|
|
42
|
+
"Slow",
|
|
43
|
+
"Fear",
|
|
44
|
+
"Taunt"
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
// src/statsMetrics.ts
|
|
48
|
+
var OFFENSE_METRICS = [
|
|
49
|
+
{ id: "damage", label: "Damage", field: "damage", source: "dpsAll" },
|
|
50
|
+
{ id: "directDmg", label: "Direct Damage", field: "directDmg", source: "statsTargets" },
|
|
51
|
+
{ id: "connectedDamageCount", label: "Connected Damage Count", field: "connectedDamageCount", source: "statsTargets" },
|
|
52
|
+
{ id: "connectedDirectDamageCount", label: "Connected Direct Damage Count", field: "connectedDirectDamageCount", source: "statsTargets" },
|
|
53
|
+
{ id: "battleStandardHits", label: "Battle Standard Tracking" },
|
|
54
|
+
{ id: "criticalRate", label: "Critical Rate", field: "criticalRate", isRate: true, isPercent: true, denomField: "critableDirectDamageCount", source: "statsTargets" },
|
|
55
|
+
{ id: "criticalDmg", label: "Critical Damage", field: "criticalDmg", source: "statsTargets" },
|
|
56
|
+
{ id: "flankingRate", label: "Flanking Rate", field: "flankingRate", isRate: true, isPercent: true, denomField: "connectedDirectDamageCount", source: "statsTargets" },
|
|
57
|
+
{ id: "glanceRate", label: "Glance Rate", field: "glanceRate", isRate: true, isPercent: true, denomField: "connectedDirectDamageCount", source: "statsTargets" },
|
|
58
|
+
{ id: "missed", label: "Missed", field: "missed", source: "statsTargets" },
|
|
59
|
+
{ id: "evaded", label: "Evaded (enemy)", field: "evaded", source: "statsTargets" },
|
|
60
|
+
{ id: "blocked", label: "Blocked (enemy)", field: "blocked", source: "statsTargets" },
|
|
61
|
+
{ id: "interrupts", label: "Interrupts", field: "interrupts", source: "statsTargets" },
|
|
62
|
+
{ id: "invulned", label: "Invulned", field: "invulned", source: "statsTargets" },
|
|
63
|
+
{ id: "killed", label: "Killed", field: "killed", source: "statsTargets" },
|
|
64
|
+
{ id: "downed", label: "Downed", field: "downed", source: "statsTargets" },
|
|
65
|
+
{ id: "downContribution", label: "Down Contribution", field: "downContribution", source: "statsTargets" },
|
|
66
|
+
{ id: "downContributionPercent", label: "Down Contribution %", isRate: true, isPercent: true },
|
|
67
|
+
{ id: "againstDownedDamage", label: "Against Downed Damage", field: "againstDownedDamage", source: "statsTargets" },
|
|
68
|
+
{ id: "appliedCrowdControl", label: "Applied CC", field: "appliedCrowdControl", source: "statsTargets" },
|
|
69
|
+
{ id: "appliedCrowdControlDuration", label: "Applied CC Duration", field: "appliedCrowdControlDuration", source: "statsTargets" },
|
|
70
|
+
{ id: "appliedCrowdControlDownContribution", label: "Applied CC Down Contribution", field: "appliedCrowdControlDownContribution", source: "statsTargets" },
|
|
71
|
+
{ id: "appliedCrowdControlDurationDownContribution", label: "Applied CC Duration Down Contribution", field: "appliedCrowdControlDurationDownContribution", source: "statsTargets" },
|
|
72
|
+
{ id: "boonStrips", label: "Boon Strips", field: "boonStrips", source: "support" }
|
|
73
|
+
];
|
|
74
|
+
var DEFENSE_METRICS = [
|
|
75
|
+
{ id: "damageTaken", label: "Damage Taken", field: "damageTaken" },
|
|
76
|
+
{ id: "minionDamageTaken", label: "Minion Damage Taken" },
|
|
77
|
+
{ id: "damageTakenCount", label: "Damage Taken Count", field: "damageTakenCount" },
|
|
78
|
+
{ id: "conditionDamageTaken", label: "Condition Damage Taken", field: "conditionDamageTaken" },
|
|
79
|
+
{ id: "conditionDamageTakenCount", label: "Condition Damage Taken Count", field: "conditionDamageTakenCount" },
|
|
80
|
+
{ id: "powerDamageTaken", label: "Power Damage Taken", field: "powerDamageTaken" },
|
|
81
|
+
{ id: "powerDamageTakenCount", label: "Power Damage Taken Count", field: "powerDamageTakenCount" },
|
|
82
|
+
{ id: "downedDamageTaken", label: "Downed Damage Taken", field: "downedDamageTaken" },
|
|
83
|
+
{ id: "downedDamageTakenCount", label: "Downed Damage Taken Count", field: "downedDamageTakenCount" },
|
|
84
|
+
{ id: "damageBarrier", label: "Damage Barrier", field: "damageBarrier" },
|
|
85
|
+
{ id: "damageBarrierCount", label: "Damage Barrier Count", field: "damageBarrierCount" },
|
|
86
|
+
{ id: "blockedCount", label: "Blocked Count", field: "blockedCount" },
|
|
87
|
+
{ id: "evadedCount", label: "Evaded Count", field: "evadedCount" },
|
|
88
|
+
{ id: "missedCount", label: "Missed Count", field: "missedCount" },
|
|
89
|
+
{ id: "dodgeCount", label: "Dodge Count", field: "dodgeCount" },
|
|
90
|
+
{ id: "invulnedCount", label: "Invulnerable Count", field: "invulnedCount" },
|
|
91
|
+
{ id: "interruptedCount", label: "Interrupted Count", field: "interruptedCount" },
|
|
92
|
+
{ id: "downCount", label: "Down Count", field: "downCount" },
|
|
93
|
+
{ id: "deadCount", label: "Death Count", field: "deadCount" },
|
|
94
|
+
{ id: "boonStrips", label: "Boon Strips (Incoming)", field: "boonStrips" },
|
|
95
|
+
{ id: "conditionCleanses", label: "Cleanses (Incoming)", field: "conditionCleanses" },
|
|
96
|
+
{ id: "receivedCrowdControl", label: "Crowd Control (Incoming)", field: "receivedCrowdControl" }
|
|
97
|
+
];
|
|
98
|
+
var DAMAGE_MITIGATION_METRICS = [
|
|
99
|
+
{ id: "totalHits", label: "Total Hits" },
|
|
100
|
+
{ id: "evaded", label: "Evaded" },
|
|
101
|
+
{ id: "blocked", label: "Blocked" },
|
|
102
|
+
{ id: "glanced", label: "Glanced" },
|
|
103
|
+
{ id: "missed", label: "Missed" },
|
|
104
|
+
{ id: "invulned", label: "Invulned" },
|
|
105
|
+
{ id: "interrupted", label: "Interrupted" },
|
|
106
|
+
{ id: "totalMitigation", label: "Damage Mitigation" },
|
|
107
|
+
{ id: "minMitigation", label: "Min Damage Mitigation" }
|
|
108
|
+
];
|
|
109
|
+
var SUPPORT_METRICS = [
|
|
110
|
+
{ id: "condiCleanse", label: "Condition Cleanses", field: "condiCleanse" },
|
|
111
|
+
{ id: "condiCleanseTime", label: "Condition Cleanse Time", field: "condiCleanseTime", isTime: true },
|
|
112
|
+
{ id: "condiCleanseSelf", label: "Condition Cleanse Self", field: "condiCleanseSelf" },
|
|
113
|
+
{ id: "condiCleanseTimeSelf", label: "Condition Cleanse Time Self", field: "condiCleanseTimeSelf", isTime: true },
|
|
114
|
+
{ id: "boonStrips", label: "Boon Strips", field: "boonStrips" },
|
|
115
|
+
{ id: "boonStripsTime", label: "Boon Strips Time", field: "boonStripsTime", isTime: true },
|
|
116
|
+
{ id: "boonStripDownContribution", label: "Boon Strip Down Contribution", field: "boonStripDownContribution" },
|
|
117
|
+
{ id: "boonStripDownContributionTime", label: "Boon Strip Down Contribution Time", field: "boonStripDownContributionTime", isTime: true },
|
|
118
|
+
{ id: "stunBreak", label: "Stun Breaks", field: "stunBreak" },
|
|
119
|
+
{ id: "removedStunDuration", label: "Removed Stun Duration", field: "removedStunDuration", isTime: true },
|
|
120
|
+
{ id: "resurrects", label: "Resurrects", field: "resurrects" },
|
|
121
|
+
{ id: "resurrectTime", label: "Resurrect Time", field: "resurrectTime", isTime: true }
|
|
122
|
+
];
|
|
123
|
+
var HEALING_METRICS = [
|
|
124
|
+
{ id: "healing", label: "Healing", baseField: "healing", perSecond: false, decimals: 0 },
|
|
125
|
+
{ id: "healingPerSecond", label: "Healing Per Second", baseField: "healing", perSecond: true, decimals: 2 },
|
|
126
|
+
{ id: "barrier", label: "Barrier", baseField: "barrier", perSecond: false, decimals: 0 },
|
|
127
|
+
{ id: "barrierPerSecond", label: "Barrier Per Second", baseField: "barrier", perSecond: true, decimals: 2 },
|
|
128
|
+
{ id: "downedHealing", label: "Downed Healing", baseField: "downedHealing", perSecond: false, decimals: 0 },
|
|
129
|
+
{ id: "downedHealingPerSecond", label: "Downed Healing Per Second", baseField: "downedHealing", perSecond: true, decimals: 1 },
|
|
130
|
+
{ id: "resUtility", label: "Resurrect Utility", baseField: "resUtility", perSecond: false, decimals: 0 }
|
|
131
|
+
];
|
|
132
|
+
var RES_UTILITY_NAME_MATCHES = [
|
|
133
|
+
"battle standard",
|
|
134
|
+
"glyph of renewal",
|
|
135
|
+
"glyph of the stars",
|
|
136
|
+
"illusion of life",
|
|
137
|
+
"spirit of nature",
|
|
138
|
+
"nature spirit",
|
|
139
|
+
"search and rescue",
|
|
140
|
+
"signet of mercy"
|
|
141
|
+
];
|
|
142
|
+
var RES_UTILITY_IDS = /* @__PURE__ */ new Set([10244]);
|
|
143
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
144
|
+
0 && (module.exports = {
|
|
145
|
+
DAMAGE_MITIGATION_METRICS,
|
|
146
|
+
DEFENSE_METRICS,
|
|
147
|
+
HEALING_METRICS,
|
|
148
|
+
NON_DAMAGING_CONDITIONS,
|
|
149
|
+
OFFENSE_METRICS,
|
|
150
|
+
RES_UTILITY_IDS,
|
|
151
|
+
RES_UTILITY_NAME_MATCHES,
|
|
152
|
+
SUPPORT_METRICS
|
|
153
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export { NON_DAMAGING_CONDITIONS } from './conditionsMetrics.cjs';
|
|
2
|
+
|
|
3
|
+
declare const OFFENSE_METRICS: Array<{
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
field?: string;
|
|
7
|
+
isRate?: boolean;
|
|
8
|
+
isPercent?: boolean;
|
|
9
|
+
weightField?: string;
|
|
10
|
+
denomField?: string;
|
|
11
|
+
source?: 'statsTargets' | 'dpsTargets' | 'statsAll' | 'dpsAll' | 'support';
|
|
12
|
+
}>;
|
|
13
|
+
declare const DEFENSE_METRICS: Array<{
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
field?: string;
|
|
17
|
+
isTimeMs?: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
declare const DAMAGE_MITIGATION_METRICS: Array<{
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
}>;
|
|
23
|
+
declare const SUPPORT_METRICS: Array<{
|
|
24
|
+
id: string;
|
|
25
|
+
label: string;
|
|
26
|
+
field: string;
|
|
27
|
+
isTime?: boolean;
|
|
28
|
+
}>;
|
|
29
|
+
declare const HEALING_METRICS: Array<{
|
|
30
|
+
id: string;
|
|
31
|
+
label: string;
|
|
32
|
+
baseField: 'healing' | 'barrier' | 'downedHealing' | 'resUtility';
|
|
33
|
+
perSecond: boolean;
|
|
34
|
+
decimals: number;
|
|
35
|
+
}>;
|
|
36
|
+
declare const RES_UTILITY_NAME_MATCHES: string[];
|
|
37
|
+
declare const RES_UTILITY_IDS: Set<number>;
|
|
38
|
+
|
|
39
|
+
export { DAMAGE_MITIGATION_METRICS, DEFENSE_METRICS, HEALING_METRICS, OFFENSE_METRICS, RES_UTILITY_IDS, RES_UTILITY_NAME_MATCHES, SUPPORT_METRICS };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export { NON_DAMAGING_CONDITIONS } from './conditionsMetrics.js';
|
|
2
|
+
|
|
3
|
+
declare const OFFENSE_METRICS: Array<{
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
field?: string;
|
|
7
|
+
isRate?: boolean;
|
|
8
|
+
isPercent?: boolean;
|
|
9
|
+
weightField?: string;
|
|
10
|
+
denomField?: string;
|
|
11
|
+
source?: 'statsTargets' | 'dpsTargets' | 'statsAll' | 'dpsAll' | 'support';
|
|
12
|
+
}>;
|
|
13
|
+
declare const DEFENSE_METRICS: Array<{
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
field?: string;
|
|
17
|
+
isTimeMs?: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
declare const DAMAGE_MITIGATION_METRICS: Array<{
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
}>;
|
|
23
|
+
declare const SUPPORT_METRICS: Array<{
|
|
24
|
+
id: string;
|
|
25
|
+
label: string;
|
|
26
|
+
field: string;
|
|
27
|
+
isTime?: boolean;
|
|
28
|
+
}>;
|
|
29
|
+
declare const HEALING_METRICS: Array<{
|
|
30
|
+
id: string;
|
|
31
|
+
label: string;
|
|
32
|
+
baseField: 'healing' | 'barrier' | 'downedHealing' | 'resUtility';
|
|
33
|
+
perSecond: boolean;
|
|
34
|
+
decimals: number;
|
|
35
|
+
}>;
|
|
36
|
+
declare const RES_UTILITY_NAME_MATCHES: string[];
|
|
37
|
+
declare const RES_UTILITY_IDS: Set<number>;
|
|
38
|
+
|
|
39
|
+
export { DAMAGE_MITIGATION_METRICS, DEFENSE_METRICS, HEALING_METRICS, OFFENSE_METRICS, RES_UTILITY_IDS, RES_UTILITY_NAME_MATCHES, SUPPORT_METRICS };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DAMAGE_MITIGATION_METRICS,
|
|
3
|
+
DEFENSE_METRICS,
|
|
4
|
+
HEALING_METRICS,
|
|
5
|
+
OFFENSE_METRICS,
|
|
6
|
+
RES_UTILITY_IDS,
|
|
7
|
+
RES_UTILITY_NAME_MATCHES,
|
|
8
|
+
SUPPORT_METRICS
|
|
9
|
+
} from "./chunk-42DVJJLC.js";
|
|
10
|
+
import {
|
|
11
|
+
NON_DAMAGING_CONDITIONS
|
|
12
|
+
} from "./chunk-RGXSI3AI.js";
|
|
13
|
+
export {
|
|
14
|
+
DAMAGE_MITIGATION_METRICS,
|
|
15
|
+
DEFENSE_METRICS,
|
|
16
|
+
HEALING_METRICS,
|
|
17
|
+
NON_DAMAGING_CONDITIONS,
|
|
18
|
+
OFFENSE_METRICS,
|
|
19
|
+
RES_UTILITY_IDS,
|
|
20
|
+
RES_UTILITY_NAME_MATCHES,
|
|
21
|
+
SUPPORT_METRICS
|
|
22
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/timestampUtils.ts
|
|
21
|
+
var timestampUtils_exports = {};
|
|
22
|
+
__export(timestampUtils_exports, {
|
|
23
|
+
parseTimestamp: () => parseTimestamp,
|
|
24
|
+
resolveFightTimestamp: () => resolveFightTimestamp
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(timestampUtils_exports);
|
|
27
|
+
|
|
28
|
+
// src/constants.ts
|
|
29
|
+
var TIMESTAMP_MS_THRESHOLD = 1e12;
|
|
30
|
+
|
|
31
|
+
// src/timestampUtils.ts
|
|
32
|
+
var parseTimestamp = (value) => {
|
|
33
|
+
if (value === void 0 || value === null || value === "") return 0;
|
|
34
|
+
if (typeof value === "number") {
|
|
35
|
+
if (!Number.isFinite(value) || value <= 0) return 0;
|
|
36
|
+
return value > TIMESTAMP_MS_THRESHOLD ? value : value * 1e3;
|
|
37
|
+
}
|
|
38
|
+
if (value instanceof Date) {
|
|
39
|
+
const ms = value.getTime();
|
|
40
|
+
return Number.isFinite(ms) && ms > 0 ? ms : 0;
|
|
41
|
+
}
|
|
42
|
+
const str = String(value).trim();
|
|
43
|
+
if (!str) return 0;
|
|
44
|
+
const numeric = Number(str);
|
|
45
|
+
if (Number.isFinite(numeric) && numeric > 0) {
|
|
46
|
+
return numeric > TIMESTAMP_MS_THRESHOLD ? numeric : numeric * 1e3;
|
|
47
|
+
}
|
|
48
|
+
const parsed = Date.parse(str);
|
|
49
|
+
if (Number.isFinite(parsed) && parsed > 0) return parsed;
|
|
50
|
+
const normalized = str.replace(/([+-]\d{2})$/, "$1:00");
|
|
51
|
+
const reparsed = Date.parse(normalized);
|
|
52
|
+
return Number.isFinite(reparsed) && reparsed > 0 ? reparsed : 0;
|
|
53
|
+
};
|
|
54
|
+
var resolveFightTimestamp = (details, log) => {
|
|
55
|
+
return parseTimestamp(
|
|
56
|
+
details?.timeStartStd ?? details?.timeStart ?? details?.timeEndStd ?? details?.timeEnd ?? details?.timeStartText ?? details?.timeEndText ?? details?.uploadTime ?? log?.uploadTime
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
parseTimestamp,
|
|
62
|
+
resolveFightTimestamp
|
|
63
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts any timestamp-like value to a millisecond epoch number.
|
|
3
|
+
* Returns 0 for unresolvable inputs.
|
|
4
|
+
*/
|
|
5
|
+
declare const parseTimestamp: (value: any) => number;
|
|
6
|
+
/**
|
|
7
|
+
* Resolves a fight's start timestamp (ms epoch) from the EI details object,
|
|
8
|
+
* falling back through several fields and then to the log's uploadTime.
|
|
9
|
+
*/
|
|
10
|
+
declare const resolveFightTimestamp: (details: any, log: any) => number;
|
|
11
|
+
|
|
12
|
+
export { parseTimestamp, resolveFightTimestamp };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts any timestamp-like value to a millisecond epoch number.
|
|
3
|
+
* Returns 0 for unresolvable inputs.
|
|
4
|
+
*/
|
|
5
|
+
declare const parseTimestamp: (value: any) => number;
|
|
6
|
+
/**
|
|
7
|
+
* Resolves a fight's start timestamp (ms epoch) from the EI details object,
|
|
8
|
+
* falling back through several fields and then to the log's uploadTime.
|
|
9
|
+
*/
|
|
10
|
+
declare const resolveFightTimestamp: (details: any, log: any) => number;
|
|
11
|
+
|
|
12
|
+
export { parseTimestamp, resolveFightTimestamp };
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@axiapps/bridge-metrics",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "AxiBridge report aggregation core: player aggregation, rollup builder, metric extractors",
|
|
6
|
+
"license": "GPL-3.0-only",
|
|
7
|
+
"main": "./dist/index.cjs",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": { "types": "./dist/index.d.ts", "import": "./dist/index.js", "require": "./dist/index.cjs" },
|
|
12
|
+
"./dpsReportTypes": { "types": "./dist/dpsReportTypes.d.ts", "import": "./dist/dpsReportTypes.js", "require": "./dist/dpsReportTypes.cjs" },
|
|
13
|
+
"./metricsSettings": { "types": "./dist/metricsSettings.d.ts", "import": "./dist/metricsSettings.js", "require": "./dist/metricsSettings.cjs" },
|
|
14
|
+
"./dashboardMetrics": { "types": "./dist/dashboardMetrics.d.ts", "import": "./dist/dashboardMetrics.js", "require": "./dist/dashboardMetrics.cjs" },
|
|
15
|
+
"./combatMetrics": { "types": "./dist/combatMetrics.d.ts", "import": "./dist/combatMetrics.js", "require": "./dist/combatMetrics.cjs" },
|
|
16
|
+
"./conditionsMetrics": { "types": "./dist/conditionsMetrics.d.ts", "import": "./dist/conditionsMetrics.js", "require": "./dist/conditionsMetrics.cjs" },
|
|
17
|
+
"./professionUtils": { "types": "./dist/professionUtils.d.ts", "import": "./dist/professionUtils.js", "require": "./dist/professionUtils.cjs" },
|
|
18
|
+
"./computePlayerAggregation": { "types": "./dist/computePlayerAggregation.d.ts", "import": "./dist/computePlayerAggregation.js", "require": "./dist/computePlayerAggregation.cjs" },
|
|
19
|
+
"./rollup": { "types": "./dist/rollup.d.ts", "import": "./dist/rollup.js", "require": "./dist/rollup.cjs" },
|
|
20
|
+
"./aggregationTypes": { "types": "./dist/aggregationTypes.d.ts", "import": "./dist/aggregationTypes.js", "require": "./dist/aggregationTypes.cjs" },
|
|
21
|
+
"./roles": { "types": "./dist/roles.d.ts", "import": "./dist/roles.js", "require": "./dist/roles.cjs" },
|
|
22
|
+
"./resUtility": { "types": "./dist/resUtility.d.ts", "import": "./dist/resUtility.js", "require": "./dist/resUtility.cjs" },
|
|
23
|
+
"./timestampUtils": { "types": "./dist/timestampUtils.d.ts", "import": "./dist/timestampUtils.js", "require": "./dist/timestampUtils.cjs" },
|
|
24
|
+
"./reportMetrics": { "types": "./dist/reportMetrics.d.ts", "import": "./dist/reportMetrics.js", "require": "./dist/reportMetrics.cjs" },
|
|
25
|
+
"./statsMetrics": { "types": "./dist/statsMetrics.d.ts", "import": "./dist/statsMetrics.js", "require": "./dist/statsMetrics.cjs" },
|
|
26
|
+
"./boonGeneration": { "types": "./dist/boonGeneration.d.ts", "import": "./dist/boonGeneration.js", "require": "./dist/boonGeneration.cjs" },
|
|
27
|
+
"./constants": { "types": "./dist/constants.d.ts", "import": "./dist/constants.js", "require": "./dist/constants.cjs" }
|
|
28
|
+
},
|
|
29
|
+
"typesVersions": {
|
|
30
|
+
"*": { "*": ["dist/*.d.ts"] }
|
|
31
|
+
},
|
|
32
|
+
"files": ["dist"],
|
|
33
|
+
"publishConfig": { "access": "public" },
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsup",
|
|
36
|
+
"prepublishOnly": "tsup",
|
|
37
|
+
"test": "vitest run --maxWorkers=2"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"tsup": "^8.5.1",
|
|
41
|
+
"typescript": "^5.2.2",
|
|
42
|
+
"vitest": "^4.0.17"
|
|
43
|
+
}
|
|
44
|
+
}
|