@carrismetropolitana/api-types 20251001.1707.13 → 20251007.1444.4
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/api/metrics.d.ts +27 -0
- package/package.json +2 -1
- package/src/api/metrics.ts +28 -0
package/dist/api/metrics.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Cause, Effect } from '@tmlmobilidade/types';
|
|
1
2
|
export interface ServiceMetrics {
|
|
2
3
|
agency_id: string;
|
|
3
4
|
line_id: number;
|
|
@@ -57,4 +58,30 @@ export interface ComplaintMetrics {
|
|
|
57
58
|
total: number;
|
|
58
59
|
type: string;
|
|
59
60
|
}
|
|
61
|
+
export interface AlertsSummary {
|
|
62
|
+
external_causes_percentage: number;
|
|
63
|
+
people_affected: number;
|
|
64
|
+
total_alerts: number;
|
|
65
|
+
}
|
|
66
|
+
export interface AlertsCauseEffect {
|
|
67
|
+
cause: Cause;
|
|
68
|
+
effects: {
|
|
69
|
+
type: Effect;
|
|
70
|
+
value: number;
|
|
71
|
+
}[];
|
|
72
|
+
total: number;
|
|
73
|
+
}
|
|
74
|
+
export interface AlertsEvolution {
|
|
75
|
+
day_group: string;
|
|
76
|
+
lines_affected: number;
|
|
77
|
+
people_affected: number;
|
|
78
|
+
}
|
|
79
|
+
export interface AlertsByMunicipality {
|
|
80
|
+
causes: {
|
|
81
|
+
type: Cause;
|
|
82
|
+
value: number;
|
|
83
|
+
}[];
|
|
84
|
+
municipality_id: string;
|
|
85
|
+
total: number;
|
|
86
|
+
}
|
|
60
87
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carrismetropolitana/api-types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20251007.1444.04",
|
|
4
4
|
"license": "AGPL-3.0-or-later",
|
|
5
5
|
"homepage": "https://github.com/carrismetropolitana/api#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@carrismetropolitana/eslint": "20250622.1204.50",
|
|
89
89
|
"@tmlmobilidade/tsconfig": "20251001.1613.56",
|
|
90
|
+
"@tmlmobilidade/types": "20251001.1613.56",
|
|
90
91
|
"@types/node": "24.6.1",
|
|
91
92
|
"resolve-tspaths": "0.8.23",
|
|
92
93
|
"typescript": "5.9.3"
|
package/src/api/metrics.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* * */
|
|
2
2
|
|
|
3
|
+
import { Cause, Effect } from '@tmlmobilidade/types';
|
|
4
|
+
|
|
3
5
|
export interface ServiceMetrics {
|
|
4
6
|
agency_id: string
|
|
5
7
|
line_id: number
|
|
@@ -76,3 +78,29 @@ export interface ComplaintMetrics {
|
|
|
76
78
|
total: number
|
|
77
79
|
type: string
|
|
78
80
|
}
|
|
81
|
+
|
|
82
|
+
/* ALERT METRICS */
|
|
83
|
+
|
|
84
|
+
export interface AlertsSummary {
|
|
85
|
+
external_causes_percentage: number
|
|
86
|
+
people_affected: number
|
|
87
|
+
total_alerts: number
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface AlertsCauseEffect {
|
|
91
|
+
cause: Cause
|
|
92
|
+
effects: { type: Effect, value: number }[]
|
|
93
|
+
total: number
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface AlertsEvolution {
|
|
97
|
+
day_group: string
|
|
98
|
+
lines_affected: number
|
|
99
|
+
people_affected: number
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface AlertsByMunicipality {
|
|
103
|
+
causes: { type: Cause, value: number }[]
|
|
104
|
+
municipality_id: string
|
|
105
|
+
total: number
|
|
106
|
+
}
|