naolib_trips 1.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.
Files changed (60) hide show
  1. package/.github/workflows/ci.yml +36 -0
  2. package/.github/workflows/pages.yml +33 -0
  3. package/.github/workflows/publish.yml +79 -0
  4. package/dist/index.d.ts +4 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +29 -0
  7. package/dist/infotrafic/index.d.ts +3 -0
  8. package/dist/infotrafic/index.d.ts.map +1 -0
  9. package/dist/infotrafic/index.js +5 -0
  10. package/dist/infotrafic/infotrafic.d.ts +3 -0
  11. package/dist/infotrafic/infotrafic.d.ts.map +1 -0
  12. package/dist/infotrafic/infotrafic.js +24 -0
  13. package/dist/infotrafic/infotrafic.test.d.ts +2 -0
  14. package/dist/infotrafic/infotrafic.test.d.ts.map +1 -0
  15. package/dist/infotrafic/infotrafic.test.js +59 -0
  16. package/dist/infotrafic/types.d.ts +44 -0
  17. package/dist/infotrafic/types.d.ts.map +1 -0
  18. package/dist/infotrafic/types.js +2 -0
  19. package/dist/search/index.d.ts +3 -0
  20. package/dist/search/index.d.ts.map +1 -0
  21. package/dist/search/index.js +5 -0
  22. package/dist/search/search.d.ts +3 -0
  23. package/dist/search/search.d.ts.map +1 -0
  24. package/dist/search/search.js +24 -0
  25. package/dist/search/search.test.d.ts +2 -0
  26. package/dist/search/search.test.d.ts.map +1 -0
  27. package/dist/search/search.test.js +44 -0
  28. package/dist/search/types.d.ts +24 -0
  29. package/dist/search/types.d.ts.map +1 -0
  30. package/dist/search/types.js +2 -0
  31. package/dist/trip/index.d.ts +3 -0
  32. package/dist/trip/index.d.ts.map +1 -0
  33. package/dist/trip/index.js +5 -0
  34. package/dist/trip/trip.d.ts +3 -0
  35. package/dist/trip/trip.d.ts.map +1 -0
  36. package/dist/trip/trip.js +24 -0
  37. package/dist/trip/trip.test.d.ts +2 -0
  38. package/dist/trip/trip.test.d.ts.map +1 -0
  39. package/dist/trip/trip.test.js +84 -0
  40. package/dist/trip/types.d.ts +324 -0
  41. package/dist/trip/types.d.ts.map +1 -0
  42. package/dist/trip/types.js +2 -0
  43. package/docs/api_doc.md +377 -0
  44. package/docs/index.html +656 -0
  45. package/eslint.config.mjs +7 -0
  46. package/package.json +32 -0
  47. package/src/index.ts +3 -0
  48. package/src/infotrafic/index.ts +8 -0
  49. package/src/infotrafic/infotrafic.test.ts +56 -0
  50. package/src/infotrafic/infotrafic.ts +9 -0
  51. package/src/infotrafic/types.ts +47 -0
  52. package/src/search/index.ts +8 -0
  53. package/src/search/search.test.ts +35 -0
  54. package/src/search/search.ts +11 -0
  55. package/src/search/types.ts +27 -0
  56. package/src/trip/index.ts +29 -0
  57. package/src/trip/trip.test.ts +79 -0
  58. package/src/trip/trip.ts +9 -0
  59. package/src/trip/types.ts +326 -0
  60. package/tsconfig.json +16 -0
@@ -0,0 +1,324 @@
1
+ export type TripParams = {
2
+ from: string;
3
+ from_lat: number;
4
+ from_lng: number;
5
+ to: string;
6
+ to_lat: number;
7
+ to_lng: number;
8
+ type?: "now" | "departure" | "arrival";
9
+ /** Format hh:mm */
10
+ time?: string;
11
+ /** Format yyyy-mm-dd */
12
+ date?: string;
13
+ avoid_dis?: boolean;
14
+ access?: boolean;
15
+ };
16
+ export type Position = {
17
+ Lat: number;
18
+ Long: number;
19
+ };
20
+ export type Site = {
21
+ id: string;
22
+ Position: Position;
23
+ Name: string | null;
24
+ CityCode: string;
25
+ CityName: string;
26
+ Language: string | null;
27
+ LogicalId: string | null;
28
+ ImportId: string | null;
29
+ RoadNumber: number;
30
+ Type: string;
31
+ TimeSourceType: string | null;
32
+ Category: number;
33
+ TransportMode: string | null;
34
+ };
35
+ export type StopEndpoint = {
36
+ Site: Site;
37
+ AccessPoint: unknown | null;
38
+ GuidanceInfo: unknown | null;
39
+ Extension: unknown | null;
40
+ DisruptionIds: string[] | null;
41
+ Time: string;
42
+ };
43
+ export type CarbonFootprint = {
44
+ TripCO2: number;
45
+ CarCO2: number;
46
+ Ratio: number;
47
+ };
48
+ export type AdditionalInfo = {
49
+ Cost: number;
50
+ ReturnJourney: number;
51
+ ExternalServices: unknown[];
52
+ Kcal: number;
53
+ };
54
+ export type SolutionApi = {
55
+ CarbonFootprint: CarbonFootprint;
56
+ Departure: StopEndpoint;
57
+ Arrival: StopEndpoint;
58
+ TripKey: string;
59
+ TripTitle: string;
60
+ TripTags: unknown[];
61
+ Disruption: boolean;
62
+ DepartureTime: string;
63
+ ArrivalTime: string;
64
+ Duration: string;
65
+ Distance: number;
66
+ InterchangeNumber: number;
67
+ KmlOverview: unknown | null;
68
+ AdditionalInfo: AdditionalInfo;
69
+ };
70
+ export type GeoJsonProperties = {
71
+ type: string;
72
+ color?: string;
73
+ background_color?: string;
74
+ couleur_border?: string;
75
+ };
76
+ export type GeoJsonLineString = {
77
+ type: "LineString";
78
+ coordinates: [string, string][];
79
+ };
80
+ export type GeoJsonInfos = {
81
+ additionalGeoJson: GeoJsonLineString;
82
+ properties: GeoJsonProperties;
83
+ distance?: number;
84
+ };
85
+ export type Elevation = {
86
+ Altitude: number;
87
+ Distance: number;
88
+ };
89
+ export type PathLink = {
90
+ id: string;
91
+ Access: unknown | null;
92
+ Departure: StopEndpoint;
93
+ Arrival: StopEndpoint;
94
+ Duration: string;
95
+ Distance: number;
96
+ Geometry: string;
97
+ Extension: unknown | null;
98
+ Speed: number;
99
+ direction: number;
100
+ Type: string;
101
+ SubType: string;
102
+ Elevations: Elevation[] | null;
103
+ MergeStreetsId: number[] | null;
104
+ MergeStreetsSpeed: number[] | null;
105
+ MergeStreetsDirection: number[] | null;
106
+ TimeSourceType: string;
107
+ TrafficState: string;
108
+ RelativeDirection: string;
109
+ MagneticDirection: string;
110
+ };
111
+ export type WalkingLeg = {
112
+ CoVPInformation: unknown | null;
113
+ TADInformation: unknown | null;
114
+ Departure: StopEndpoint;
115
+ Arrival: StopEndpoint;
116
+ Duration: string;
117
+ TransportCenter: unknown | null;
118
+ VehicleForHireInformation: unknown | null;
119
+ SharedVehicleInformation: unknown | null;
120
+ SharedVehicleProvider: unknown | null;
121
+ ComputeProvider: {
122
+ Name: string;
123
+ Url: string | null;
124
+ };
125
+ TrafficRoadSituation: unknown | null;
126
+ pathLinks: {
127
+ PathLink: PathLink[];
128
+ };
129
+ IsSharedVehicle: boolean;
130
+ IsVehicleForHire: boolean;
131
+ KmlOverview: unknown | null;
132
+ Extension: unknown | null;
133
+ TransportMode: "WALK" | string;
134
+ };
135
+ export type StopPlace = {
136
+ importId: string;
137
+ Parent: unknown | null;
138
+ idcomment: unknown | null;
139
+ StopPlaceAttributes: unknown | null;
140
+ id: string;
141
+ Position: Position;
142
+ Name: string;
143
+ CityCode: string;
144
+ CityName: string;
145
+ Language: string | null;
146
+ LogicalId: string;
147
+ ImportId: string | null;
148
+ RoadNumber: number;
149
+ TheoreticalTime: string;
150
+ Type: string;
151
+ TimeSourceType: string;
152
+ Category: number;
153
+ TransportMode: string;
154
+ };
155
+ export type TransitEndpoint = {
156
+ StopPlace: StopPlace;
157
+ Extension: unknown | null;
158
+ DisruptionIds: string[] | null;
159
+ Time: string;
160
+ PassThrough: boolean;
161
+ };
162
+ export type RideStep = {
163
+ id: string | null;
164
+ Departure: TransitEndpoint;
165
+ Arrival: TransitEndpoint;
166
+ Geometry: string;
167
+ Duration: string;
168
+ Distance: number;
169
+ Extension: unknown | null;
170
+ };
171
+ export type TransitLine = {
172
+ id: string;
173
+ companyRef: unknown | null;
174
+ ptNetworkRef: string;
175
+ groupOfLineRef: unknown | null;
176
+ Name: string;
177
+ Number: string;
178
+ PublishedName: string;
179
+ RegistrationNumber: string;
180
+ Comment: unknown | null;
181
+ Color: string;
182
+ TextColor: string;
183
+ };
184
+ export type PTRide = {
185
+ SectionDisruptionIds: string[];
186
+ Direction: {
187
+ Id: string;
188
+ Name: string;
189
+ };
190
+ Attribute: {
191
+ Value: string;
192
+ Name: string;
193
+ }[];
194
+ PlatformDeparture: string;
195
+ PlatformArrival: string;
196
+ IsLastCourse: boolean;
197
+ DontGetOut: boolean;
198
+ Departure: TransitEndpoint;
199
+ Arrival: TransitEndpoint;
200
+ Operator: {
201
+ id: string;
202
+ Name: string;
203
+ Code: string;
204
+ };
205
+ Picto: unknown | null;
206
+ Access: {
207
+ UFR: number;
208
+ DM: number;
209
+ NV: number;
210
+ ME: number;
211
+ };
212
+ DepartureAccess: unknown | null;
213
+ ArrivalAccess: unknown | null;
214
+ LineAccess: {
215
+ UFR: number;
216
+ DM: number;
217
+ NV: number;
218
+ ME: number;
219
+ };
220
+ Notes: unknown | null;
221
+ CodeActivity: unknown | null;
222
+ IsDateExtended: boolean;
223
+ GetOnWaitingTime: number;
224
+ ComputeProvider: {
225
+ Name: string;
226
+ Url: string | null;
227
+ };
228
+ WagonPosition: unknown | null;
229
+ lineRef: unknown | null;
230
+ companyRef: unknown | null;
231
+ ptNetworkRef: unknown | null;
232
+ vehicleJourneyRef: string;
233
+ groupeOfLineRef: unknown | null;
234
+ StopHeadSign: unknown | null;
235
+ JourneyPatternName: string;
236
+ Destination: string;
237
+ Line: TransitLine;
238
+ SalesInfo: unknown | null;
239
+ GroupOfLine: unknown | null;
240
+ PTNetwork: {
241
+ id: string;
242
+ Name: string;
243
+ VersionDate: unknown | null;
244
+ RegistrationNumber: string;
245
+ Comment: unknown | null;
246
+ };
247
+ Company: unknown | null;
248
+ Duration: string;
249
+ Distance: number;
250
+ KmlOverview: unknown | null;
251
+ Comment: unknown | null;
252
+ steps: {
253
+ Step: RideStep[];
254
+ };
255
+ Code: string;
256
+ Extension: unknown | null;
257
+ Disruption: boolean;
258
+ LastStopId: number;
259
+ TransportMode: string;
260
+ Diversion: unknown | null;
261
+ TripGeometry: string;
262
+ };
263
+ export type LineDirection = {
264
+ name: string;
265
+ direction: number;
266
+ };
267
+ export type SectionLine = {
268
+ external_id: string;
269
+ name: string;
270
+ number: string;
271
+ direction: LineDirection;
272
+ type: number;
273
+ };
274
+ export type ConcernedStop = {
275
+ is_accessible?: boolean;
276
+ external_id: string;
277
+ physical_id: string;
278
+ name: string;
279
+ lat: number;
280
+ lng: number;
281
+ duration: string;
282
+ startAt: string;
283
+ endAt: string;
284
+ disruption_ids: string[] | null;
285
+ };
286
+ export type WalkSection = {
287
+ duration: string;
288
+ startAt: string;
289
+ endAt: string;
290
+ distance: number;
291
+ voieBicycle: number;
292
+ voieBicycleDescription: unknown[];
293
+ geojson_infos: GeoJsonInfos;
294
+ api: {
295
+ PTRide: null;
296
+ Leg: WalkingLeg;
297
+ };
298
+ };
299
+ export type TransitSection = {
300
+ duration: string;
301
+ startAt: string;
302
+ endAt: string;
303
+ line: SectionLine;
304
+ concernedStops: ConcernedStop[];
305
+ geojson_infos: GeoJsonInfos;
306
+ api: {
307
+ PTRide: PTRide;
308
+ Leg: null;
309
+ };
310
+ };
311
+ export type Section = WalkSection | TransitSection;
312
+ export type TripSolution = {
313
+ startAt: string;
314
+ endAt: string;
315
+ duration: string;
316
+ mode: string;
317
+ solution_accessible?: boolean;
318
+ api: SolutionApi;
319
+ sections: Section[];
320
+ };
321
+ export type TripResponse = {
322
+ solutions: TripSolution[];
323
+ };
324
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/trip/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,GAAG,WAAW,GAAG,SAAS,CAAC;IACvC,mBAAmB;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM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MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB,EAAE,OAAO,EAAE,CAAC;IAClC,aAAa,EAAE,YAAY,CAAC;IAC5B,GAAG,EAAE;QAAE,MAAM,EAAE,IAAI,CAAC;QAAC,GAAG,EAAE,UAAU,CAAA;KAAE,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,CAAC;IAClB,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,aAAa,EAAE,YAAY,CAAC;IAC5B,GAAG,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,IAAI,CAAA;KAAE,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG,cAAc,CAAC;AAInD,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,GAAG,EAAE,WAAW,CAAC;IACjB,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,YAAY,EAAE,CAAC;CAC3B,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,377 @@
1
+ # Naolib API
2
+
3
+ Unofficial documentation for the two APIs backing Naolib's (Nantes) trip planner.
4
+
5
+ ---
6
+
7
+ ## Search
8
+
9
+ Search for stops and points of interest by name.
10
+
11
+ ```
12
+ GET https://tanv4.cartographie.pro/api/autocomplete/itinerary
13
+ ```
14
+
15
+ ### Query Parameters
16
+
17
+ | Parameter | Type | Required | Description |
18
+ |-----------|--------|----------|--------------------|
19
+ | `q` | string | yes | Search query term |
20
+
21
+ ### Response
22
+
23
+ ```ts
24
+ {
25
+ result: AutocompleteResult[];
26
+ recent: AutocompleteResult[];
27
+ }
28
+ ```
29
+
30
+ ```ts
31
+ type AutocompleteResult = {
32
+ name: string; // e.g. "Viarme-Talensac (Nantes)"
33
+ lat: number;
34
+ lng: number;
35
+ category: "STOPAREA" | "POI";
36
+ stop: {
37
+ stop_id: string; // e.g. "VIAR1"
38
+ linked_lines: {
39
+ name: string; // e.g. "Marcel Paul - Neustrie"
40
+ number: string; // e.g. "3"
41
+ sort: number;
42
+ }[];
43
+ } | null; // null for POI results
44
+ }
45
+ ```
46
+
47
+ > `recent` follows the same shape as `result` and reflects recently searched items (usually empty for unauthenticated requests).
48
+
49
+ ---
50
+
51
+ ## Trip Search
52
+
53
+ Find itinerary solutions between two points.
54
+
55
+ ```
56
+ GET https://plan.naolib.fr/api/itinerary/search
57
+ ```
58
+
59
+ ### Query Parameters
60
+
61
+ | Parameter | Type | Required | Description |
62
+ |--------------|---------|----------|------------------------------------------------------|
63
+ | `from` | string | yes | Name of origin stop or place |
64
+ | `from_lat` | number | yes | Latitude of origin |
65
+ | `from_lng` | number | yes | Longitude of origin |
66
+ | `to` | string | yes | Name of destination stop or place |
67
+ | `to_lat` | number | yes | Latitude of destination |
68
+ | `to_lng` | number | yes | Longitude of destination |
69
+ | `type` | string | no | `"now"` \| `"departure"` \| `"arrival"` |
70
+ | `time` | string | no | Time for departure/arrival planning, e.g. `"10:36"` |
71
+ | `date` | string | no | Date for departure/arrival planning, e.g. `"2026-04-05"` |
72
+ | `avoid_dis` | boolean | no | Avoid disrupted routes |
73
+ | `access` | boolean | no | Filter for wheelchair-accessible routes |
74
+
75
+ ### Response
76
+
77
+ ```ts
78
+ {
79
+ solutions: TripSolution[];
80
+ }
81
+ ```
82
+
83
+ #### TripSolution
84
+
85
+ ```ts
86
+ type TripSolution = {
87
+ startAt: string; // e.g. "12:53"
88
+ endAt: string; // e.g. "13:11"
89
+ duration: string; // minutes, e.g. "17"
90
+ mode: string; // e.g. "bus", "tramway"
91
+ solution_accessible?: boolean;
92
+ api: {
93
+ CarbonFootprint: {
94
+ TripCO2: number; // grams CO2 for this trip
95
+ CarCO2: number; // grams CO2 by car equivalent
96
+ Ratio: number;
97
+ };
98
+ Departure: StopEndpoint;
99
+ Arrival: StopEndpoint;
100
+ TripKey: string; // UUID
101
+ TripTitle: string;
102
+ TripTags: unknown[];
103
+ Disruption: boolean;
104
+ DepartureTime: string;
105
+ ArrivalTime: string;
106
+ Duration: string; // ISO 8601, e.g. "PT17M31S"
107
+ Distance: number; // metres
108
+ InterchangeNumber: number;
109
+ KmlOverview: unknown | null;
110
+ AdditionalInfo: {
111
+ Cost: number;
112
+ ReturnJourney: number;
113
+ ExternalServices: unknown[];
114
+ Kcal: number;
115
+ };
116
+ };
117
+ sections: Section[];
118
+ }
119
+ ```
120
+
121
+ #### Section
122
+
123
+ Each solution is broken into sections. A section is either a **walking leg** or a **transit ride**.
124
+
125
+ **Walk section**
126
+
127
+ ```ts
128
+ type WalkSection = {
129
+ duration: string; // minutes
130
+ startAt: string;
131
+ endAt: string;
132
+ distance: number; // metres
133
+ voieBicycle: number;
134
+ voieBicycleDescription: unknown[];
135
+ geojson_infos: GeoJsonInfos;
136
+ api: { PTRide: null; Leg: WalkingLeg };
137
+ }
138
+
139
+ type WalkingLeg = {
140
+ TransportMode: "WALK" | string;
141
+ Departure: StopEndpoint;
142
+ Arrival: StopEndpoint;
143
+ Duration: string; // ISO 8601
144
+ pathLinks: { PathLink: PathLink[] };
145
+ CoVPInformation: unknown | null;
146
+ TADInformation: unknown | null;
147
+ TransportCenter: unknown | null;
148
+ VehicleForHireInformation: unknown | null;
149
+ SharedVehicleInformation: unknown | null;
150
+ SharedVehicleProvider: unknown | null;
151
+ ComputeProvider: { Name: string; Url: string | null };
152
+ TrafficRoadSituation: unknown | null;
153
+ IsSharedVehicle: boolean;
154
+ IsVehicleForHire: boolean;
155
+ KmlOverview: unknown | null;
156
+ Extension: unknown | null;
157
+ }
158
+ ```
159
+
160
+ **Transit ride section**
161
+
162
+ ```ts
163
+ type TransitSection = {
164
+ duration: string; // minutes
165
+ startAt: string;
166
+ endAt: string;
167
+ line: SectionLine;
168
+ concernedStops: ConcernedStop[];
169
+ geojson_infos: GeoJsonInfos;
170
+ api: { PTRide: PTRide; Leg: null };
171
+ }
172
+
173
+ type SectionLine = {
174
+ external_id: string;
175
+ name: string; // e.g. "Marcel Paul - Neustrie"
176
+ number: string; // e.g. "3"
177
+ direction: { name: string; direction: number };
178
+ type: number;
179
+ }
180
+
181
+ type ConcernedStop = {
182
+ external_id: string;
183
+ physical_id: string;
184
+ name: string;
185
+ lat: number;
186
+ lng: number;
187
+ duration: string;
188
+ startAt: string;
189
+ endAt: string;
190
+ is_accessible?: boolean;
191
+ disruption_ids: string[] | null;
192
+ }
193
+ ```
194
+
195
+ #### GeoJSON types
196
+
197
+ ```ts
198
+ type GeoJsonLineString = {
199
+ type: "LineString";
200
+ coordinates: [string, string][]; // [lng, lat] pairs as strings
201
+ }
202
+
203
+ type GeoJsonProperties = {
204
+ type: string; // e.g. "WALK", "TRAMWAY", "BUS"
205
+ color?: string; // foreground hex, e.g. "#FFFFFF"
206
+ background_color?: string; // e.g. "#2581C4"
207
+ couleur_border?: string; // walk sections only
208
+ }
209
+
210
+ type GeoJsonInfos = {
211
+ additionalGeoJson: GeoJsonLineString;
212
+ properties: GeoJsonProperties;
213
+ distance?: number; // metres; present on transit sections
214
+ }
215
+ ```
216
+
217
+ ---
218
+
219
+ ## Infotrafic
220
+
221
+ Fetch current traffic disruptions affecting stops and parking POIs.
222
+
223
+ ```
224
+ GET https://plan.naolib.fr/api/poi/infotrafic
225
+ ```
226
+
227
+ No query parameters.
228
+
229
+ ### Response
230
+
231
+ ```ts
232
+ {
233
+ pois: InfotraficEntry[]; // disruptions attached to specific POIs (e.g. bike stations, parkings)
234
+ types: InfotraficTypeEntry[]; // event-based disruptions (e.g. carnival, public works)
235
+ }
236
+ ```
237
+
238
+ #### InfotraficEntry
239
+
240
+ ```ts
241
+ type InfotraficEntry = {
242
+ id: number;
243
+ title: string; // e.g. "81 Mangin - Travaux de réaménagement"
244
+ content: string; // HTML-formatted description
245
+ startAt: string; // e.g. "01/01/2026 à 00:00"
246
+ endAt: string; // e.g. "01/12/2026 à 23:59"
247
+ pois: Poi[] | null;
248
+ }
249
+ ```
250
+
251
+ #### InfotraficTypeEntry
252
+
253
+ Same shape as `InfotraficEntry` with one additional field:
254
+
255
+ ```ts
256
+ type InfotraficTypeEntry = InfotraficEntry & {
257
+ type: string; // e.g. "Carnaval de Nantes"
258
+ }
259
+ ```
260
+
261
+ #### Poi
262
+
263
+ ```ts
264
+ type Poi = {
265
+ id: number;
266
+ type: string; // e.g. "Bicloo Plus", "Parking centre-ville"
267
+ real_type: string;
268
+ name: string;
269
+ lat: number;
270
+ lng: number;
271
+ options: PoiOptions;
272
+ icon_poi: string;
273
+ instance: string;
274
+ }
275
+ ```
276
+
277
+ #### PoiOptions
278
+
279
+ Fields vary by POI type. Common fields for parkings:
280
+
281
+ ```ts
282
+ type PoiOptions = {
283
+ adresse?: string;
284
+ site_web?: string;
285
+ acces_pmr?: "OUI" | "NON";
286
+ capacite_pmr?: number;
287
+ presentation?: string;
288
+ url_redirect?: string;
289
+ capacite_moto?: number | string;
290
+ capacite_velo?: number | string;
291
+ grp_disponible?: number;
292
+ moyen_paiement?: string;
293
+ capacite_voiture?: number;
294
+ infos_complementaires?: string;
295
+ stationnement_velo_securise?: "OUI" | "NON";
296
+ capacite_vehicule_electrique?: number | string;
297
+ [key: string]: unknown;
298
+ }
299
+ ```
300
+
301
+ ---
302
+
303
+ #### PTRide (transit ride detail)
304
+
305
+ ```ts
306
+ type PTRide = {
307
+ TransportMode: string; // e.g. "TRAMWAY", "BUS"
308
+ Departure: TransitEndpoint;
309
+ Arrival: TransitEndpoint;
310
+ Duration: string; // ISO 8601
311
+ Distance: number; // metres
312
+ Destination: string;
313
+ JourneyPatternName: string;
314
+ Line: TransitLine;
315
+ PTNetwork: {
316
+ id: string;
317
+ Name: string; // e.g. "Naolib"
318
+ VersionDate: unknown | null;
319
+ RegistrationNumber: string;
320
+ Comment: unknown | null;
321
+ };
322
+ Operator: { id: string; Name: string; Code: string };
323
+ Direction: { Id: string; Name: string };
324
+ Attribute: { Value: string; Name: string }[];
325
+ PlatformDeparture: string;
326
+ PlatformArrival: string;
327
+ IsLastCourse: boolean;
328
+ DontGetOut: boolean;
329
+ Access: { UFR: number; DM: number; NV: number; ME: number };
330
+ LineAccess: { UFR: number; DM: number; NV: number; ME: number };
331
+ GetOnWaitingTime: number;
332
+ ComputeProvider: { Name: string; Url: string | null };
333
+ steps: { Step: RideStep[] };
334
+ vehicleJourneyRef: string;
335
+ Disruption: boolean;
336
+ LastStopId: number;
337
+ TripGeometry: string; // WKT LINESTRING
338
+ SectionDisruptionIds: string[];
339
+ Code: string;
340
+ KmlOverview: unknown | null;
341
+ SalesInfo: unknown | null;
342
+ GroupOfLine: unknown | null;
343
+ Company: unknown | null;
344
+ Extension: unknown | null;
345
+ }
346
+
347
+ type TransitLine = {
348
+ id: string;
349
+ Name: string;
350
+ Number: string;
351
+ PublishedName: string;
352
+ Color: string; // hex without #, e.g. "2581C4"
353
+ TextColor: string;
354
+ RegistrationNumber: string;
355
+ ptNetworkRef: string;
356
+ companyRef: unknown | null;
357
+ groupOfLineRef: unknown | null;
358
+ Comment: unknown | null;
359
+ }
360
+
361
+ type TransitEndpoint = {
362
+ StopPlace: StopPlace;
363
+ Extension: unknown | null;
364
+ DisruptionIds: string[] | null;
365
+ Time: string;
366
+ PassThrough: boolean;
367
+ }
368
+
369
+ type StopEndpoint = {
370
+ Site: Site;
371
+ AccessPoint: unknown | null;
372
+ GuidanceInfo: unknown | null;
373
+ Extension: unknown | null;
374
+ DisruptionIds: string[] | null;
375
+ Time: string;
376
+ }
377
+ ```