@carrismetropolitana/api-types 1.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.
@@ -0,0 +1,248 @@
1
+ import { GTFSBool } from 'gtfs-types';
2
+ import * as GtfsCore from 'gtfs-types';
3
+ /**
4
+ * Type for GTFS routes.txt file.
5
+ */
6
+ export interface Route extends GtfsCore.Route {
7
+ line_id: string;
8
+ line_long_name: string;
9
+ line_short_name: string;
10
+ }
11
+ /**
12
+ * Type for GTFS calendar_dates.txt file.
13
+ */
14
+ export interface CalendarDate extends GtfsCore.CalendarDates {
15
+ day_type: string;
16
+ holiday: string;
17
+ period: string;
18
+ }
19
+ /**
20
+ * Type for GTFS dates.txt file.
21
+ */
22
+ export interface Date {
23
+ date: string;
24
+ day_type: string;
25
+ description: string;
26
+ holiday: string;
27
+ period: string;
28
+ }
29
+ /**
30
+ * Type for GTFS periods.txt file.
31
+ */
32
+ export interface Period {
33
+ period_id: string;
34
+ period_name: string;
35
+ }
36
+ /**
37
+ * Type for GTFS trips.txt file.
38
+ */
39
+ export interface Trip extends GtfsCore.Trip {
40
+ calendar_desc: string;
41
+ pattern_id: string;
42
+ }
43
+ /**
44
+ * Type for GTFS stop_times.txt file.
45
+ */
46
+ export type StopTime = GtfsCore.StopTime;
47
+ /**
48
+ * Type for GTFS shapes.txt file.
49
+ */
50
+ export type Shape = GtfsCore.Shapes;
51
+ /**
52
+ * Type for GTFS stops.txt file.
53
+ */
54
+ export interface Stop extends GtfsCore.Stop {
55
+ airport: boolean;
56
+ bike_parking: boolean;
57
+ bike_sharing: boolean;
58
+ boat: boolean;
59
+ car_parking: boolean;
60
+ district_id: string;
61
+ district_name: string;
62
+ light_rail: boolean;
63
+ locality: string;
64
+ municipality_id: string;
65
+ municipality_name: string;
66
+ near_fire_station: boolean;
67
+ near_health_clinic: boolean;
68
+ near_historic_building: boolean;
69
+ near_hospital: boolean;
70
+ near_police_station: boolean;
71
+ near_school: boolean;
72
+ near_shopping: boolean;
73
+ near_transit_office: boolean;
74
+ near_university: boolean;
75
+ operational_status: string;
76
+ parish_id: null;
77
+ parish_name: null;
78
+ region_id: string;
79
+ region_name: string;
80
+ stop_id: string;
81
+ stop_lat: number;
82
+ stop_lon: number;
83
+ stop_name: string;
84
+ stop_short_name: string;
85
+ subway: boolean;
86
+ train: boolean;
87
+ tts_stop_name: string;
88
+ wheelchair_boarding: GtfsCore.WheelchairBoardingType;
89
+ }
90
+ /**
91
+ * Type for GTFS vehicles.txt file.
92
+ */
93
+ export interface Vehicle {
94
+ agency_id: string;
95
+ bikes_allowed: GTFSBool;
96
+ capacity_seated: number;
97
+ capacity_standing: number;
98
+ emission_class: string;
99
+ license_plate: string;
100
+ make: string;
101
+ model: string;
102
+ owner: string;
103
+ passenger_counting: GTFSBool;
104
+ propulsion: string;
105
+ registration_date: string;
106
+ vehicle_id: string;
107
+ wheelchair_accessible: GTFSBool;
108
+ }
109
+ export interface VehicleEvent {
110
+ content: VehicleEventContent;
111
+ millis: number;
112
+ }
113
+ export interface VehicleEventContent {
114
+ entity: VehicleEventEntity[];
115
+ header: GtfsCore.FeedHeader;
116
+ }
117
+ export interface VehicleEventEntity {
118
+ _id: string;
119
+ vehicle: VehiclePosition;
120
+ }
121
+ export interface VehiclePosition {
122
+ agencyId: string;
123
+ currentStatus: GtfsCore.VehicleStopStatus;
124
+ operationPlanId: string;
125
+ passengerCounting: VehiclePositionPassengerCounting;
126
+ position: GtfsCore.Position;
127
+ stopId: string;
128
+ timestamp: number;
129
+ trigger: VehiclePositionTrigger;
130
+ trip: VehiclePositionTrip;
131
+ vehicle: VehiclePositionVehicle;
132
+ }
133
+ export interface VehiclePositionTrigger {
134
+ activity: string;
135
+ door: string;
136
+ }
137
+ export interface VehiclePositionTrip {
138
+ lineId: string;
139
+ patternId: string;
140
+ routeId: string;
141
+ scheduleRelationship: GtfsCore.TripScheduleRelationship;
142
+ tripId: string;
143
+ }
144
+ export interface VehiclePositionVehicle {
145
+ _id: string;
146
+ blockId: string;
147
+ driverId: string;
148
+ shiftId: string;
149
+ }
150
+ export interface VehiclePositionPassengerCounting {
151
+ counting: VehiclePositionPassengerCountingCount[];
152
+ }
153
+ export interface VehiclePositionPassengerCountingCount {
154
+ classId: 'adult' | 'children';
155
+ incoming: number;
156
+ outgoing: number;
157
+ }
158
+ /**
159
+ * GTFS Realtime Feed Message Types
160
+ */
161
+ export interface FeedHeader {
162
+ gtfsRealtimeVersion: '2.0';
163
+ incrementality: 'FULL_DATASET';
164
+ timestamp: number;
165
+ }
166
+ export interface TranslatedString {
167
+ translation: Translation[];
168
+ }
169
+ /**
170
+ * A translation of a string. Exactly one of text or file must be present.
171
+ * The language field must be a valid BCP 47 language tag.
172
+ *
173
+ * More info: https://gtfs.org/realtime/reference/#message-translation
174
+ *
175
+ * @param language - The language of the text. Must be a valid BCP 47 language tag.
176
+ * @param text - The translated text.
177
+ *
178
+ */
179
+ interface Translation {
180
+ language: string;
181
+ text: string;
182
+ }
183
+ export interface TranslatedImage {
184
+ localizedImage: LocalizedImage[];
185
+ }
186
+ /**
187
+ * A localized image. At least one translation must be provided.
188
+ * The image type must be a valid MIME type. The URL must be a valid URL.
189
+ * The language field must be a valid BCP 47 language tag.
190
+ *
191
+ * More info: https://gtfs.org/realtime/reference/#message-localizedimage
192
+ *
193
+ * @param language - The language of the image. Must be a valid BCP 47 language tag.
194
+ * @param mediaType - The MIME type of the image.
195
+ * @param url - The URL of the image.
196
+ *
197
+ */
198
+ interface LocalizedImage {
199
+ language: string;
200
+ mediaType: string;
201
+ url: string;
202
+ }
203
+ /**
204
+ * POSIX time (i.e., number of seconds since January 1st 1970 00:00:00 UTC). If start or end is missing,
205
+ * the interval starts at minus or plus infinity. If a TimeRange is provided, either start or end must
206
+ * be provided - both fields cannot be empty.
207
+ *
208
+ * Here, it is expected that a TimeRange object will always be provided with a start value.
209
+ *
210
+ * More info: https://gtfs.org/realtime/reference/#message-timerange
211
+ *
212
+ * @param start - Start time in POSIX time.
213
+ * @param end - End time in POSIX time. If not provided, the interval ends at plus infinity.
214
+ *
215
+ */
216
+ export interface TimeRange {
217
+ end?: number;
218
+ start: number;
219
+ }
220
+ /**
221
+ * A selector for an entity in a GTFS feed. The values of the fields should correspond to the appropriate fields in the GTFS feed.
222
+ * At least one specifier must be given. If several are given, they should be interpreted as being joined by the logical AND operator.
223
+ * Additionally, the combination of specifiers must match the corresponding information in the GTFS feed.
224
+ * In other words, in order for an alert to apply to an entity in GTFS it must match all of the provided EntitySelector fields.
225
+ * For example, an EntitySelector that includes the fields route_id: "5" and route_type: "3" applies only
226
+ * to the route_id: "5" bus - it does not apply to any other routes of route_type: "3". If a producer wants an alert
227
+ * to apply to route_id: "5" as well as route_type: "3", it should provide two separate EntitySelectors,
228
+ * one referencing route_id: "5" and another referencing route_type: "3".
229
+ *
230
+ * More info: https://gtfs.org/realtime/reference/#message-entityselector
231
+ *
232
+ * @param agencyId - The agency_id of the agency that operates the entity. Required if the entity is not identified by a specific route_id.
233
+ * @param lineId - The line_id of the line that the entity belongs to. Non-standard.
234
+ * @param routeId - The route_id of the route that the entity belongs to.
235
+ * @param stopId - The stop_id of the stop that the entity is associated with. Optional.
236
+ * @param tripId - The trip_id of the trip that the entity belongs to. Required if the entity is not identified by route_id.
237
+ *
238
+ */
239
+ export interface EntitySelector {
240
+ agencyId?: string;
241
+ lineId?: string;
242
+ routeId?: string;
243
+ stopId?: string;
244
+ tripId?: string;
245
+ }
246
+ export declare function convertGTFSBoolToBoolean(value: GTFSBool): boolean;
247
+ export {};
248
+ //# sourceMappingURL=extended.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extended.d.ts","sourceRoot":"","sources":["../../src/gtfs/extended.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAIvC;;GAEG;AACH,MAAM,WAAW,KAAM,SAAQ,QAAQ,CAAC,KAA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AAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CAChB;AAID;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,mBAAmB,EAAE,KAAK,CAAA;IAC1B,cAAc,EAAE,cAAc,CAAA;IAC9B,SAAS,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,gBAAgB;IAChC,WAAW,EAAE,WAAW,EAAE,CAAA;CAC1B;AAED;;;;;;;;;GASG;AACH,UAAU,WAAW;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,eAAe;IAC/B,cAAc,EAAE,cAAc,EAAE,CAAA;CAChC;AAED;;;;;;;;;;;GAWG;AACH,UAAU,cAAc;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,MAAM,CAAA;CACX;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,SAAS;IACzB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;CACf;AAID,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAEjE"}
@@ -0,0 +1,6 @@
1
+ /* * */
2
+ import { GTFSBool } from 'gtfs-types';
3
+ /* * */
4
+ export function convertGTFSBoolToBoolean(value) {
5
+ return Number(value) === GTFSBool.YES ? true : false;
6
+ }
@@ -0,0 +1,102 @@
1
+ export interface TrinoValidations {
2
+ id: string;
3
+ createdat?: string;
4
+ rawloaddate?: string;
5
+ rawloaddateiso?: string;
6
+ issignaturecorrect?: boolean;
7
+ isfraud?: boolean;
8
+ batchid?: string;
9
+ operator?: string;
10
+ csvtransaction?: string;
11
+ apextransactiontype?: number;
12
+ apextransactionversion?: string;
13
+ transactionid?: string;
14
+ transactiongroupid?: string;
15
+ transactiondate?: string;
16
+ apexversion?: string;
17
+ vivaversion?: string;
18
+ technicalparametersversion?: string;
19
+ commercialofferversion?: string;
20
+ networkversion?: string;
21
+ actionlistsversion?: string;
22
+ operatorlongid?: string;
23
+ networkid?: string;
24
+ channelid?: string;
25
+ deviceid?: string;
26
+ cardtypeid?: string;
27
+ cardphysicaltype?: number;
28
+ cardnetworkid?: string;
29
+ cardissuer?: number;
30
+ cardnumber?: bigint;
31
+ cardserialnumber?: string;
32
+ operationplanid?: string;
33
+ vehicleplanid?: string;
34
+ vehicleid?: number;
35
+ driverplanid?: string;
36
+ timetableid?: string;
37
+ unfoldingid?: string;
38
+ validatorid?: number;
39
+ zonelongid?: string;
40
+ routelongid?: string;
41
+ runlongid?: string;
42
+ stoplongid?: string;
43
+ validationtype?: number;
44
+ productlongid?: string;
45
+ tickloaddate?: string;
46
+ tickloadmachcode?: number;
47
+ tickloadnumbdaily?: number;
48
+ unitsquantity?: number;
49
+ unitsremaining?: number;
50
+ contractnumber?: number;
51
+ eventtype?: number;
52
+ validationstatus?: number;
53
+ whitelistitemid?: string;
54
+ calendarid?: string;
55
+ validityperiodid?: string;
56
+ spatialvaliditylongid?: string;
57
+ productmatrixelementid?: string;
58
+ validationdatalongid?: string;
59
+ profilesusedcount?: number;
60
+ profilelongid?: string;
61
+ amounttodebit?: number;
62
+ greylistitemscount?: number;
63
+ greylistitemid?: string;
64
+ signeddata?: string;
65
+ mac?: string;
66
+ blockid?: string;
67
+ dutyid?: string;
68
+ journeyid?: string;
69
+ extrajourneyid?: string;
70
+ linelongid?: string;
71
+ patternlongid?: string;
72
+ isok?: boolean;
73
+ isunique?: boolean;
74
+ errorlist?: string;
75
+ signeddatafields_raw?: string;
76
+ signeddatafields_eventbinaryread?: string;
77
+ signeddatafields_eventbinarywritten?: string;
78
+ signeddatafields_contractbinaryread?: string;
79
+ signeddatafields_contractbinarywritten?: string;
80
+ signeddatafields_environmentbinaryread?: string;
81
+ signeddatafields_environmentbinarywritten?: string;
82
+ macdatafields_raw?: string;
83
+ macdatafields_interruptedstatus?: number;
84
+ macdatafields_macversion?: number;
85
+ macdatafields_binarydatamask?: number;
86
+ macdatafields_sammodel?: number;
87
+ macdatafields_samworkingmode?: number;
88
+ macdatafields_samtypeversion?: number;
89
+ macdatafields_fullmacflag?: number;
90
+ macdatafields_samserialnumber?: bigint;
91
+ macdatafields_bruteforcecounter?: string;
92
+ macdatafields_asecountervalue?: number;
93
+ macdatafields_ticcountervalue?: number;
94
+ macdatafields_ticcounterceiling?: number;
95
+ macdatafields_rldupdcountervalue?: number;
96
+ macdatafields_rldupdcounterceiling?: number;
97
+ macdatafields_transactioncounter?: number;
98
+ outofboundstype?: number;
99
+ outofboundsstoplongid?: string;
100
+ isreprocessed?: boolean;
101
+ }
102
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/trino/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAA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,MAAM,CAAC;IAChD,yCAAyC,CAAC,EAAE,MAAM,CAAC;IACnD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,gCAAgC,CAAC,EAAE,MAAM,CAAC;IAC1C,kCAAkC,CAAC,EAAE,MAAM,CAAC;IAC5C,gCAAgC,CAAC,EAAE,MAAM,CAAC;IAC1C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B"}
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,86 @@
1
+ {
2
+ "name": "@carrismetropolitana/api-types",
3
+ "version": "1.0.0",
4
+ "license": "AGPL-3.0-or-later",
5
+ "homepage": "https://github.com/carrismetropolitana/api#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/carrismetropolitana/api/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/carrismetropolitana/api.git"
12
+ },
13
+ "keywords": [
14
+ "public transit",
15
+ "lisboa",
16
+ "api"
17
+ ],
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "type": "module",
22
+ "main": "dist/index.js",
23
+ "types": "dist/index.d.ts",
24
+ "exports": {
25
+ "./alerts": {
26
+ "import": "./dist/api/alerts.js",
27
+ "require": "./dist/api/alerts.js",
28
+ "types": "./dist/api/alerts.d.ts"
29
+ },
30
+ "./facilities": {
31
+ "import": "./dist/api/facilities.js",
32
+ "require": "./dist/api/facilities.js",
33
+ "types": "./dist/api/facilities.d.ts"
34
+ },
35
+ "./gtfs-core": {
36
+ "import": "./dist/gtfs/core.js",
37
+ "require": "./dist/gtfs/core.js",
38
+ "types": "./dist/gtfs/core.d.ts"
39
+ },
40
+ "./gtfs-extended": {
41
+ "import": "./dist/gtfs/extended.js",
42
+ "require": "./dist/gtfs/extended.js",
43
+ "types": "./dist/gtfs/extended.d.ts"
44
+ },
45
+ "./locations": {
46
+ "import": "./dist/api/locations.js",
47
+ "require": "./dist/api/locations.js",
48
+ "types": "./dist/api/locations.d.ts"
49
+ },
50
+ "./metrics": {
51
+ "import": "./dist/api/metrics.js",
52
+ "require": "./dist/api/metrics.js",
53
+ "types": "./dist/api/metrics.d.ts"
54
+ },
55
+ "./network": {
56
+ "import": "./dist/api/network.js",
57
+ "require": "./dist/api/network.js",
58
+ "types": "./dist/api/network.d.ts"
59
+ },
60
+ "./trino": {
61
+ "import": "./dist/trino/index.js",
62
+ "require": "./dist/trino/index.js",
63
+ "types": "./dist/trino/index.d.ts"
64
+ },
65
+ "./vehicles": {
66
+ "import": "./dist/api/vehicles.js",
67
+ "require": "./dist/api/vehicles.js",
68
+ "types": "./dist/api/vehicles.d.ts"
69
+ }
70
+ },
71
+ "scripts": {
72
+ "build": "npm run clean && tsc && resolve-tspaths",
73
+ "clean": "rm -rf dist"
74
+ },
75
+ "dependencies": {
76
+ "@types/geojson": "7946.0.14",
77
+ "gtfs-types": "4.0.0"
78
+ },
79
+ "devDependencies": {
80
+ "@carrismetropolitana/api-tsconfig": "*",
81
+ "@carrismetropolitana/eslint": "20241024.1600.5",
82
+ "@types/node": "22.8.4",
83
+ "resolve-tspaths": "0.8.22",
84
+ "typescript": "5.6.3"
85
+ }
86
+ }
@@ -0,0 +1,78 @@
1
+ /* * */
2
+
3
+ import { Cause, Effect, EntitySelector, TimeRange, TranslatedString } from 'gtfs-types';
4
+
5
+ /* * */
6
+
7
+ export interface TranslatedImage {
8
+ localized_image: LocalizedImage[]
9
+ }
10
+
11
+ /**
12
+ * A localized image. At least one translation must be provided.
13
+ * The image type must be a valid MIME type. The URL must be a valid URL.
14
+ * The language field must be a valid BCP 47 language tag.
15
+ *
16
+ * More info: https://gtfs.org/realtime/reference/#message-localizedimage
17
+ *
18
+ * @param language - The language of the image. Must be a valid BCP 47 language tag.
19
+ * @param mediaType - The MIME type of the image.
20
+ * @param url - The URL of the image.
21
+ *
22
+ */
23
+ interface LocalizedImage {
24
+ language: string
25
+ media_type: string
26
+ url: string
27
+ }
28
+
29
+ /* * */
30
+
31
+ /**
32
+ * An Alert is the JSON equivalent of a GTFS-RT Service Alert message.
33
+ * Please use a SimplifiedAlert as many convenience operations are already correctly applied.
34
+ */
35
+ export interface Alert {
36
+ active_period: TimeRange[]
37
+ cause: Cause
38
+ description_text: TranslatedString
39
+ effect: Effect
40
+ header_text: TranslatedString
41
+ id: string
42
+ image: TranslatedImage
43
+ informed_entity: EntitySelector[]
44
+ url: TranslatedString
45
+ }
46
+
47
+ /* * */
48
+
49
+ /**
50
+ * A Simplified Alert is the same as an Alert, but with the following differences:
51
+ * - The description is a string instead of a TranslatedString
52
+ * - The image URL is a string instead of a TranslatedImage
53
+ * - The URL is a string instead of a TranslatedString
54
+ * - The start_date and end_date are Date objects instead of TimeRange objects
55
+ * - All fields with translatable content are returned in the current app locale
56
+ */
57
+ export interface SimplifiedAlert {
58
+ cause: Cause
59
+ description: string
60
+ effect: Effect
61
+ end_date: Date
62
+ id: string
63
+ image_url: null | string
64
+ informed_entity: EntitySelector[]
65
+ locale: string
66
+ start_date: Date
67
+ title: string
68
+ url: null | string
69
+ }
70
+
71
+ /* * */
72
+
73
+ export interface AlertGroupByDate {
74
+ items: Alert[]
75
+ label?: string
76
+ title: string
77
+ value: string
78
+ }
@@ -0,0 +1,115 @@
1
+ /* * */
2
+
3
+ export interface FacilitySource {
4
+ district_id: string
5
+ district_name: string
6
+ id: string
7
+ lat: string
8
+ locality: string
9
+ lon: string
10
+ municipality_id: string
11
+ municipality_name: string
12
+ name: string
13
+ parish_id: string
14
+ parish_name: string
15
+ region_id: string
16
+ region_name: string
17
+ stops: string
18
+ }
19
+
20
+ export interface Facility {
21
+ district_id: string
22
+ district_name: string
23
+ id: string
24
+ lat: number
25
+ locality: string
26
+ lon: number
27
+ municipality_id: string
28
+ municipality_name: string
29
+ name: string
30
+ parish_id: string
31
+ parish_name: string
32
+ region_id: string
33
+ region_name: string
34
+ stop_ids: string[]
35
+ }
36
+
37
+ /* * */
38
+
39
+ export interface SchoolsSource extends FacilitySource {
40
+ address: string
41
+ cicles: string
42
+ email: string
43
+ grouping: string
44
+ nature: string
45
+ phone: string
46
+ postal_code: string
47
+ url: string
48
+ }
49
+
50
+ export interface School extends Facility {
51
+ address: string
52
+ cicles: string
53
+ email: string
54
+ grouping: string
55
+ nature: string
56
+ phone: string
57
+ url: string
58
+ }
59
+
60
+ export interface StoresSource extends FacilitySource {
61
+ address: string
62
+ brand_name: string
63
+ email: string
64
+ google_place_id: string
65
+ hours_friday: string
66
+ hours_monday: string
67
+ hours_saturday: string
68
+ hours_special: string
69
+ hours_sunday: string
70
+ hours_thursday: string
71
+ hours_tuesday: string
72
+ hours_wednesday: string
73
+ phone: string
74
+ postal_code: string
75
+ short_name: string
76
+ url: string
77
+ }
78
+
79
+ /* * */
80
+
81
+ export interface StoreMetadata extends Facility {
82
+ address: string
83
+ brand_name: string
84
+ email: string
85
+ google_place_id: string
86
+ hours_friday: string[]
87
+ hours_monday: string[]
88
+ hours_saturday: string[]
89
+ hours_special: string
90
+ hours_sunday: string[]
91
+ hours_thursday: string[]
92
+ hours_tuesday: string[]
93
+ hours_wednesday: string[]
94
+ phone: string
95
+ postal_code: string
96
+ short_name: string
97
+ url: string
98
+ }
99
+
100
+ export interface StoreRealtime {
101
+ active_counters: number
102
+ current_ratio: number
103
+ current_status: CurrentStoreStatus
104
+ currently_waiting: number
105
+ expected_wait_time: number
106
+ is_open: boolean
107
+ }
108
+
109
+ export enum CurrentStoreStatus {
110
+ busy = 'busy',
111
+ closed = 'closed',
112
+ open = 'open',
113
+ }
114
+
115
+ export type Store = StoreMetadata & StoreRealtime;
@@ -0,0 +1,28 @@
1
+ /* * */
2
+
3
+ export interface Region {
4
+ id: string
5
+ name: string
6
+ }
7
+
8
+ export interface District {
9
+ id: string
10
+ name: string
11
+ region_id: string
12
+ }
13
+
14
+ export interface Municipality {
15
+ district_id: string
16
+ id: string
17
+ name: string
18
+ region_id: string
19
+ }
20
+
21
+ export interface Locality {
22
+ display: string
23
+ district_id: string
24
+ id: string
25
+ municipality_id: string
26
+ name: string
27
+ region_id: string
28
+ }