@sierragridteam/sdk 0.0.0-stage → 0.1.1

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 (42) hide show
  1. package/README.md +49 -2
  2. package/dist/fixtures-data.d.ts +609 -0
  3. package/dist/fixtures-data.js +2676 -0
  4. package/dist/fixtures.d.ts +12 -0
  5. package/dist/fixtures.js +139 -0
  6. package/dist/generated/client/client.gen.d.ts +2 -0
  7. package/dist/generated/client/client.gen.js +216 -0
  8. package/dist/generated/client/index.d.ts +10 -0
  9. package/dist/generated/client/index.js +6 -0
  10. package/dist/generated/client/types.gen.d.ts +120 -0
  11. package/dist/generated/client/types.gen.js +2 -0
  12. package/dist/generated/client/utils.gen.d.ts +37 -0
  13. package/dist/generated/client/utils.gen.js +228 -0
  14. package/dist/generated/client.gen.d.ts +12 -0
  15. package/dist/generated/client.gen.js +3 -0
  16. package/dist/generated/core/auth.gen.d.ts +25 -0
  17. package/dist/generated/core/auth.gen.js +14 -0
  18. package/dist/generated/core/bodySerializer.gen.d.ts +25 -0
  19. package/dist/generated/core/bodySerializer.gen.js +57 -0
  20. package/dist/generated/core/params.gen.d.ts +43 -0
  21. package/dist/generated/core/params.gen.js +109 -0
  22. package/dist/generated/core/pathSerializer.gen.d.ts +33 -0
  23. package/dist/generated/core/pathSerializer.gen.js +106 -0
  24. package/dist/generated/core/queryKeySerializer.gen.d.ts +18 -0
  25. package/dist/generated/core/queryKeySerializer.gen.js +92 -0
  26. package/dist/generated/core/serverSentEvents.gen.d.ts +71 -0
  27. package/dist/generated/core/serverSentEvents.gen.js +132 -0
  28. package/dist/generated/core/types.gen.d.ts +83 -0
  29. package/dist/generated/core/types.gen.js +2 -0
  30. package/dist/generated/core/utils.gen.d.ts +19 -0
  31. package/dist/generated/core/utils.gen.js +87 -0
  32. package/dist/generated/index.d.ts +2 -0
  33. package/dist/generated/index.js +2 -0
  34. package/dist/generated/sdk.gen.d.ts +210 -0
  35. package/dist/generated/sdk.gen.js +336 -0
  36. package/dist/generated/types.gen.d.ts +3474 -0
  37. package/dist/generated/types.gen.js +2 -0
  38. package/dist/generated/zod.gen.d.ts +6537 -0
  39. package/dist/generated/zod.gen.js +1849 -0
  40. package/dist/index.d.ts +1287 -0
  41. package/dist/index.js +99 -0
  42. package/package.json +42 -4
@@ -0,0 +1,3474 @@
1
+ export type ClientOptions = {
2
+ baseUrl: 'https://data.sierragridteam.org' | (string & {});
3
+ };
4
+ export type BurnLineReading = {
5
+ cleaned_transcription?: string;
6
+ confidence?: number;
7
+ /**
8
+ * A configured line id (grid.burn.lines); unknown ids are warnings.
9
+ */
10
+ line_id: string;
11
+ message?: string;
12
+ /**
13
+ * When the line was called. Required; future stamps are clamped.
14
+ */
15
+ observed_at: string;
16
+ /**
17
+ * green = permissive burn day.
18
+ */
19
+ status: 'green' | 'red' | 'orange';
20
+ };
21
+ /**
22
+ * `burn.line` (schema_version 1): readings of the county burn-day phone
23
+ * recordings, sent as ONE batched report per run (the per-reporter rate
24
+ * limit would 429 a second push). Each reading is staged durably.
25
+ *
26
+ */
27
+ export type BurnLineReport = {
28
+ generated_at?: string;
29
+ readings: Array<BurnLineReading>;
30
+ schema_version: 1;
31
+ };
32
+ /**
33
+ * An RFC 7946 geometry object, the same shape as a map feature's
34
+ * `geometry` (MapGeometry) but never `null`: an event's or place's
35
+ * `geometry.object` when the request passes `geometryFormat=OBJECT`.
36
+ * A position is `[longitude, latitude]`, longitude first.
37
+ *
38
+ */
39
+ export type GeoJsonGeometry = MapGeometry;
40
+ /**
41
+ * The 202 body. Validated and queued, not yet stored; it lands on the next ingest cycle (about a minute).
42
+ */
43
+ export type IngestAccepted = {
44
+ /**
45
+ * mesh.repeater: nodes accepted. mesh.packet: ADVERTs applied (not packets received). burn.line: readings staged.
46
+ */
47
+ accepted: number;
48
+ receivedAt: string;
49
+ /**
50
+ * The reporter the token belongs to.
51
+ */
52
+ reporterId: string;
53
+ stream: string;
54
+ /**
55
+ * Entries skipped without failing the report (bad id, duplicate, unknown line, bad signature). Fix your output if present. mesh.packet lists at most 25, then a count.
56
+ */
57
+ warnings?: Array<string>;
58
+ };
59
+ /**
60
+ * A JSON-RPC 2.0 request. Omit `id` for a notification (answered 202, no body).
61
+ */
62
+ export type JsonRpcRequest = {
63
+ /**
64
+ * Request id (string or number), echoed in the response.
65
+ */
66
+ id?: unknown;
67
+ jsonrpc: '2.0';
68
+ method: 'initialize' | 'ping' | 'tools/list' | 'tools/call' | 'resources/list' | 'resources/read' | 'prompts/list' | 'prompts/get' | 'notifications/initialized';
69
+ params?: {
70
+ [key: string]: unknown;
71
+ };
72
+ };
73
+ export type JsonRpcResponse = {
74
+ /**
75
+ * Present on failure. -32700 parse error, -32601 method not found, -32602 invalid params, -32603 internal error.
76
+ */
77
+ error?: {
78
+ code: number;
79
+ message: string;
80
+ };
81
+ /**
82
+ * The request's id; null when the request could not be parsed.
83
+ */
84
+ id?: unknown;
85
+ jsonrpc: '2.0';
86
+ /**
87
+ * Present on success.
88
+ */
89
+ result?: {
90
+ [key: string]: unknown;
91
+ };
92
+ };
93
+ /**
94
+ * camera block - a Caltrans CCTV camera, same data as GET /api/v1/cameras?place=. Load the image and stream directly from Caltrans; they are not proxied.
95
+ */
96
+ export type MapCameraProps = {
97
+ county?: string;
98
+ direction?: string;
99
+ /**
100
+ * Distance from the requested place; 0 = inside it.
101
+ */
102
+ distanceMeters: number;
103
+ elevationFeet?: number;
104
+ /**
105
+ * How often Caltrans refreshes the snapshot. Absent = not reported.
106
+ */
107
+ imageRefreshMinutes?: number;
108
+ /**
109
+ * Snapshot JPEG.
110
+ */
111
+ imageUrl: string;
112
+ route?: string;
113
+ /**
114
+ * HLS .m3u8 live stream. Absent = image only.
115
+ */
116
+ streamUrl?: string;
117
+ };
118
+ /**
119
+ * chain_control block. Severity follows the level (R1 MINOR, R2 MODERATE, R3 SEVERE); a seasonal pass closure (`category` closed) is MINOR.
120
+ */
121
+ export type MapChainControlProps = {
122
+ direction?: string;
123
+ highway?: string;
124
+ /**
125
+ * Absent on a closure.
126
+ */
127
+ level?: 'R1' | 'R2' | 'R3';
128
+ };
129
+ /**
130
+ * Set on Caltrans planned lane closures (category `closure`) only. One
131
+ * feature per work window. `plannedEnd` is an estimate crews overrun: an
132
+ * ACTIVE closure past it is still on the road until Caltrans records it
133
+ * picked up.
134
+ *
135
+ */
136
+ export type MapClosureProps = {
137
+ closureType?: string;
138
+ estimatedDelayMinutes?: number;
139
+ /**
140
+ * Caltrans's lane list, verbatim., example: "1, 2, LShoulder, RShoulder"
141
+ */
142
+ lanesClosed?: string;
143
+ plannedEnd?: string;
144
+ plannedStart?: string;
145
+ /**
146
+ * When the crew reported the closure set up. Absent while SCHEDULED.
147
+ */
148
+ setUpAt?: string;
149
+ totalLanes?: number;
150
+ windowId: string;
151
+ workType?: string;
152
+ };
153
+ /**
154
+ * earthquake block (USGS).
155
+ */
156
+ export type MapEarthquakeProps = {
157
+ depthKm: number;
158
+ /**
159
+ * USGS "Did You Feel It?" reports.
160
+ */
161
+ felt?: number;
162
+ magnitude: number;
163
+ };
164
+ /**
165
+ * evacuation block (Cal OES / Genasys zones). Life-safety; reference only, link `source.url`.
166
+ */
167
+ export type MapEvacuationProps = {
168
+ county?: string;
169
+ eventType?: string;
170
+ level: 'ORDER' | 'WARNING' | 'ADVISORY' | 'SHELTER_IN_PLACE';
171
+ zoneId?: string;
172
+ };
173
+ /**
174
+ * An RFC 7946 Feature.
175
+ */
176
+ export type MapFeature = {
177
+ geometry: MapGeometry;
178
+ properties: MapFeatureProperties;
179
+ type: 'Feature';
180
+ };
181
+ /**
182
+ * An RFC 7946 FeatureCollection for one place and one layer. `metadata` is
183
+ * an RFC 7946 §6.1 foreign member that map libraries ignore; read it for
184
+ * source health and attribution before drawing.
185
+ *
186
+ */
187
+ export type MapFeatureCollection = {
188
+ /**
189
+ * Possibly empty. Empty with `sourceStatus` OK means confirmed-empty; empty with UNAVAILABLE means unknown.
190
+ */
191
+ features: Array<MapFeature>;
192
+ metadata: MapLayerMetadata;
193
+ type: 'FeatureCollection';
194
+ };
195
+ /**
196
+ * The envelope shared by every feature of every layer, plus exactly one
197
+ * per-kind block named after the layer (`incident`, `road`,
198
+ * `chainControl`, `messageSign`, `weather`, `fireWeather`, `earthquake`,
199
+ * `wildfire`, `evacuation`, `power`, `mesh`, `meshLink`, `camera`).
200
+ * Optional members are omitted, never `""` or `0`, when they have no value.
201
+ *
202
+ */
203
+ export type MapFeatureProperties = {
204
+ /**
205
+ * Where, in words ("SR 4 at Country Club Drive", "Murphys, CA").
206
+ */
207
+ areaLabel?: string;
208
+ camera?: MapCameraProps;
209
+ /**
210
+ * Sub-type within the layer. Values by layer:
211
+ * road_incident `incident` (CHP) | `closure` (Caltrans planned lane closure);
212
+ * chain_control `r1` | `r2` | `r3` | `closed`;
213
+ * message_sign `message` | `blank` | `unknown`;
214
+ * weather_alert the NWS event name (`Heat Advisory`, `Red Flag Warning`);
215
+ * fire_weather banner `normal` | `elevated` | `red-flag` (absent on forecast points);
216
+ * wildfire `wildfire`; evacuation the lowercase level (`order`, `warning`, …);
217
+ * power `unplanned` | `planned` | `psps`;
218
+ * mesh_node the node type `repeater` | `companion` | `room_server` | `sensor`.
219
+ * Absent on road_segment, camera and mesh_link edges.
220
+ *
221
+ */
222
+ category?: string;
223
+ chainControl?: MapChainControlProps;
224
+ /**
225
+ * Longer text. road_incident: the readable narrative (AI-enhanced for
226
+ * CHP, composed from Caltrans fields for closures). evacuation: Cal OES
227
+ * public info, verbatim, never paraphrase. weather_alert: the NWS text,
228
+ * verbatim. road_segment: why a road is not OPEN.
229
+ *
230
+ */
231
+ description?: string;
232
+ earthquake?: MapEarthquakeProps;
233
+ /**
234
+ * When it began or takes effect (a SCHEDULED feature's start).
235
+ */
236
+ effective?: string;
237
+ evacuation?: MapEvacuationProps;
238
+ /**
239
+ * Upstream expiry (weather alerts, fire-weather products). Not set from PG&E restoration estimates.
240
+ */
241
+ expires?: string;
242
+ fireWeather?: MapFireWeatherProps;
243
+ /**
244
+ * One-line label for a popup or list row.
245
+ */
246
+ headline: string;
247
+ /**
248
+ * Stable feature id. On event-backed layers it IS the event id, so
249
+ * `GET /api/v1/events/{id}` returns the full record and its history
250
+ * (`wildfire`, `evacuation`, `weather_alert`, `earthquake`,
251
+ * `road_incident`, `power`, `mesh_node`). Condition layers use their
252
+ * own ids (`road:…`, `cc:…`, `cms:…`, `fw:…`, `mesh_link:…`, `d10-…`).
253
+ *
254
+ */
255
+ id: string;
256
+ incident?: MapIncidentProps;
257
+ /**
258
+ * Human label for the feature type.
259
+ */
260
+ kind: 'Road incident' | 'Chain control' | 'Road segment' | 'Message sign' | 'Weather alert' | 'Fire weather' | 'Fire-weather forecast' | 'Earthquake' | 'Wildfire' | 'Evacuation' | 'Power outage' | 'Public Safety Power Shutoff' | 'Mesh node' | 'Relay link' | 'Traffic camera';
261
+ /**
262
+ * UPPERCASE layer of THIS feature. Usually the URL layer upper-cased,
263
+ * except that the `mesh_link` layer mixes `MESH_LINK` edges and
264
+ * `MESH_NODE` points. Only some values equal an Event `layer` enum
265
+ * (`v1Layer`): WILDFIRE, EVACUATION, WEATHER_ALERT, EARTHQUAKE,
266
+ * ROAD_INCIDENT and POWER do. MESH_NODE is the Event layer `MESH`.
267
+ * ROAD_SEGMENT, CHAIN_CONTROL, MESSAGE_SIGN, MESH_LINK and CAMERA are
268
+ * map-only. FIRE_WEATHER exists in the enum but these features are
269
+ * conditions, not events.
270
+ *
271
+ */
272
+ layer: 'ROAD_INCIDENT' | 'CHAIN_CONTROL' | 'ROAD_SEGMENT' | 'MESSAGE_SIGN' | 'WEATHER_ALERT' | 'FIRE_WEATHER' | 'EARTHQUAKE' | 'WILDFIRE' | 'EVACUATION' | 'POWER' | 'MESH_NODE' | 'MESH_LINK' | 'CAMERA';
273
+ mesh?: MapMeshProps;
274
+ meshLink?: MapMeshLinkProps;
275
+ messageSign?: MapMessageSignProps;
276
+ power?: MapPowerProps;
277
+ road?: MapRoadProps;
278
+ /**
279
+ * Unified severity. `message_sign`, `camera`, `mesh_node`, `mesh_link`
280
+ * and fire-weather forecast points are always `INFO` (context, not
281
+ * hazards). Most power outages are INFO too: the median outage affects
282
+ * one customer.
283
+ *
284
+ */
285
+ severity: 'INFO' | 'MINOR' | 'MODERATE' | 'SEVERE' | 'EXTREME';
286
+ /**
287
+ * Numeric severity for sorting and styling: INFO 0, MINOR 1, MODERATE 2, SEVERE 3, EXTREME 4.
288
+ */
289
+ severityRank: number;
290
+ source: MapFeatureSource;
291
+ /**
292
+ * Meaning depends on the layer, and it is NOT always the Event
293
+ * `EventStatus`:
294
+ * - wildfire, weather_alert, earthquake, road_incident, power,
295
+ * mesh_node: the lifecycle `ACTIVE` or `SCHEDULED` (an advance watch,
296
+ * a planned closure window not yet set up, a planned shutoff). Map
297
+ * layers never carry RESOLVED or EXPIRED features; those are in
298
+ * `/api/v1/history`.
299
+ * - evacuation: the evacuation LEVEL `ORDER` | `WARNING` | `ADVISORY` |
300
+ * `SHELTER_IN_PLACE`.
301
+ * - road_segment: the road status `OPEN` | `CLOSED` | `RESTRICTED` |
302
+ * `MAINTENANCE` (absent until the road has been measured).
303
+ * - absent on chain_control, message_sign, fire_weather, camera and
304
+ * mesh_link edges.
305
+ *
306
+ */
307
+ status?: 'ACTIVE' | 'SCHEDULED' | 'ORDER' | 'WARNING' | 'ADVISORY' | 'SHELTER_IN_PLACE' | 'OPEN' | 'CLOSED' | 'RESTRICTED' | 'MAINTENANCE' | 'UNSPECIFIED';
308
+ /**
309
+ * AI-written plain-language summary (same as Event.summary). Absent when the event has none; fall back to `description`.
310
+ */
311
+ summary?: string;
312
+ /**
313
+ * Present with `summary` when a model wrote it, so a UI can label it as machine-written.
314
+ */
315
+ summaryEnhanced?: {
316
+ enhancedAt?: string;
317
+ };
318
+ /**
319
+ * Last content revision. For mesh nodes this is NOT liveness; use mesh.lastHeardAt / lastRelayedAt.
320
+ */
321
+ updatedAt?: string;
322
+ weather?: MapWeatherProps;
323
+ wildfire?: MapWildfireProps;
324
+ };
325
+ /**
326
+ * The upstream feed this feature came from. Render `attribution` with the feature.
327
+ */
328
+ export type MapFeatureSource = {
329
+ attribution?: string;
330
+ fetchedAt?: string;
331
+ /**
332
+ * The upstream's id. Values today: `calfire`, `firis`, `caloes`,
333
+ * `nws`, `usgs`, `chp`, `caltrans`, `google`, `pge`, `psps`,
334
+ * `meshcore`. On the event-backed layers (`wildfire`,
335
+ * `evacuation`, `weather_alert`, `earthquake`, `road_incident`,
336
+ * `power`, `mesh_node`) it is the event's `provenance.sourceId` and
337
+ * has a row in `GET /api/v1/sources` whose `status` is that feed's
338
+ * health.
339
+ *
340
+ * The condition layers (`road_segment`, `chain_control`,
341
+ * `message_sign`, `fire_weather`), and `camera` and `mesh_link`, are
342
+ * fetched or computed on request, outside the ingest scheduler that
343
+ * writes the registry. `google` (on `road_segment`) has no registry
344
+ * row at all. `caltrans` and `nws` do have rows, but those track the
345
+ * scheduled lane-closure and alert polls, not the live fetch behind
346
+ * these layers. For these layers judge health by the layer's
347
+ * `metadata.sourceStatus` (the summary's `roads` and `fire` domains
348
+ * fold the same statuses in), never by a missing or unrelated
349
+ * registry row.
350
+ *
351
+ */
352
+ id: string;
353
+ name: string;
354
+ /**
355
+ * Deep link to the upstream record or viewer, when there is one.
356
+ */
357
+ url?: string;
358
+ };
359
+ /**
360
+ * fire_weather block. The region banner (id `fw:region`, null geometry)
361
+ * carries the ISSUED `state`; only NWS products set it (Fire Weather Watch
362
+ * -> elevated, Red Flag Warning -> red-flag). Forecast points (id
363
+ * `fw:forecast:<location>`) carry `forecast` instead, are always INFO and
364
+ * never imply a warning.
365
+ *
366
+ */
367
+ export type MapFireWeatherProps = {
368
+ forecast?: {
369
+ horizonHours?: number;
370
+ issuedAt?: string;
371
+ minHumidityPercent?: number;
372
+ peakWindGustAt?: string;
373
+ peakWindGustKmh?: number;
374
+ source?: string;
375
+ };
376
+ /**
377
+ * The NWS product behind the state, e.g. Red Flag Warning.
378
+ */
379
+ sourceEvent?: string;
380
+ state?: 'normal' | 'elevated' | 'red-flag';
381
+ zones?: Array<string>;
382
+ };
383
+ /**
384
+ * An RFC 7946 geometry, or `null` for a feature with no location (NWS zone
385
+ * alerts and the fire-weather region banner): render those as a banner
386
+ * or list row, not a shape.
387
+ *
388
+ * A position is `[longitude, latitude]`, longitude FIRST (RFC 7946
389
+ * §3.1.1), the reverse of the `{lat, lng}` objects on the JSON RPCs.
390
+ * Store-derived positions are trimmed to 5 decimals (~1 m).
391
+ *
392
+ * Which types appear: Point (most layers: incidents, signs, cameras,
393
+ * chain controls, quakes, mesh nodes, forecast points, unmapped fires);
394
+ * LineString (road_segment routes, mesh_link edges); Polygon or
395
+ * MultiPolygon (power outage areas, evacuation zones, fire perimeters).
396
+ * Geometry passed through from an upstream ArcGIS feed may be any RFC 7946
397
+ * type except GeometryCollection.
398
+ *
399
+ */
400
+ export type MapGeometry = {
401
+ /**
402
+ * Nesting depends on `type`:
403
+ * Point `[lng, lat]`;
404
+ * MultiPoint and LineString `[[lng, lat], ...]` (a LineString has 2+);
405
+ * MultiLineString and Polygon `[[[lng, lat], ...], ...]` (a Polygon's
406
+ * first ring is the exterior; every ring closes on its first position);
407
+ * MultiPolygon `[[[[lng, lat], ...], ...], ...]`.
408
+ *
409
+ */
410
+ coordinates: Array<unknown>;
411
+ type: 'Point' | 'MultiPoint' | 'LineString' | 'MultiLineString' | 'Polygon' | 'MultiPolygon';
412
+ } | null;
413
+ /**
414
+ * road_incident block.
415
+ */
416
+ export type MapIncidentProps = {
417
+ closure?: MapClosureProps;
418
+ /**
419
+ * CHP log number, or the Caltrans closure id.
420
+ */
421
+ logNumber?: string;
422
+ };
423
+ /**
424
+ * Provenance and freshness of the whole layer.
425
+ */
426
+ export type MapLayerMetadata = {
427
+ /**
428
+ * Slug of the requested place (even when it was requested by id).
429
+ */
430
+ area: string;
431
+ /**
432
+ * Credit line to render with the layer whenever it is drawn. Parts are joined with " · ".
433
+ */
434
+ attribution?: string;
435
+ /**
436
+ * When this body was rendered. Not part of the ETag.
437
+ */
438
+ generatedAt: string;
439
+ /**
440
+ * Last successful upstream fetch. Present only when `sourceStatus` is not OK and a success is on record.
441
+ */
442
+ lastSourceUpdate?: string;
443
+ /**
444
+ * The lowercase layer slug from the URL (not the UPPERCASE `properties.layer`).
445
+ */
446
+ layer: 'road_incident' | 'chain_control' | 'road_segment' | 'message_sign' | 'weather_alert' | 'fire_weather' | 'earthquake' | 'wildfire' | 'evacuation' | 'power' | 'mesh_node' | 'mesh_link' | 'camera';
447
+ /**
448
+ * Envelope schema version; bumps only on a breaking envelope change.
449
+ */
450
+ schemaVersion: 1;
451
+ /**
452
+ * Health of the feeds behind this layer, the fail-loud contract:
453
+ * `OK` - current and complete. `STALE` - upstream is failing (or one
454
+ * of two feeds is); these features are the last good data, as of
455
+ * `lastSourceUpdate`. Show them with a caveat. `UNAVAILABLE` - nothing
456
+ * trustworthy to show; `features` is always empty and the layer's
457
+ * state is UNKNOWN. Never render it as "no hazards".
458
+ *
459
+ */
460
+ sourceStatus: 'OK' | 'STALE' | 'UNAVAILABLE';
461
+ /**
462
+ * The authoritative viewer for the layer, where one exists. Always set on `evacuation` (Genasys Protect), in every state.
463
+ */
464
+ sourceUrl?: string;
465
+ };
466
+ /**
467
+ * The last sample an operator monitor read off the node itself. Gauges the device did not report are absent, never 0.
468
+ */
469
+ export type MapMeshAdminProps = {
470
+ airtimeMs?: number;
471
+ batteryPercent?: number;
472
+ batteryPercentSource?: string;
473
+ batteryVolts?: number;
474
+ lastSuccessAt?: string;
475
+ noiseFloorDbm?: number;
476
+ packetsReceived?: number;
477
+ packetsSent?: number;
478
+ recvErrors?: number;
479
+ reportedAt?: string;
480
+ reporterId: string;
481
+ rxAirtimeMs?: number;
482
+ temperatureC?: number;
483
+ txQueueLen?: number;
484
+ uptimeSeconds?: number;
485
+ };
486
+ /**
487
+ * mesh_link edge block - one undirected relay link between two located nodes. Weight by `daysActive`/`observations`, fade by `lastSeen`.
488
+ */
489
+ export type MapMeshLinkProps = {
490
+ /**
491
+ * Public key of one end (a < b).
492
+ */
493
+ a: string;
494
+ /**
495
+ * Public key of the other end.
496
+ */
497
+ b: string;
498
+ /**
499
+ * Peak SNR of an advert over the link. Absent when 0.
500
+ */
501
+ bestSnr?: number;
502
+ /**
503
+ * Distinct days the link was observed.
504
+ */
505
+ daysActive: number;
506
+ firstSeen?: string;
507
+ lastSeen?: string;
508
+ /**
509
+ * Packets seen traversing the link in the window.
510
+ */
511
+ observations: number;
512
+ };
513
+ /**
514
+ * mesh_node block (MeshCore node presence; also on the MESH_NODE points of
515
+ * the mesh_link layer). Signal readings are absent when no bridge heard the
516
+ * node; a present 0 is a reading. A node's freshness is the later of
517
+ * `lastHeardAt` and `lastRelayedAt`, never the feature's `updatedAt`.
518
+ *
519
+ */
520
+ export type MapMeshProps = {
521
+ admin?: MapMeshAdminProps;
522
+ /**
523
+ * Public keys of the observers that heard the node.
524
+ */
525
+ gateways?: Array<string>;
526
+ /**
527
+ * Hops on the last heard path. 0 = heard direct.
528
+ */
529
+ hopCount?: number;
530
+ /**
531
+ * mesh_link layer only: true = inside the requested place, false = a neighbour outside it, included because it links in.
532
+ */
533
+ inRegion?: boolean;
534
+ /**
535
+ * When the node's own signed advert last reached the Grid.
536
+ */
537
+ lastHeardAt?: string;
538
+ /**
539
+ * When a packet this node relayed last reached the Grid.
540
+ */
541
+ lastRelayedAt?: string;
542
+ name?: string;
543
+ nodeType?: 'companion' | 'repeater' | 'room_server' | 'sensor';
544
+ /**
545
+ * 64-hex Ed25519 public key; joins to MeshLink a/b.
546
+ */
547
+ publicKey: string;
548
+ /**
549
+ * An operator monitor's verdict on the node's admin interface. Absent when no monitor watches it.
550
+ */
551
+ reachability?: 'REACHABLE' | 'UNREACHABLE';
552
+ /**
553
+ * Last-heard RSSI, dBm.
554
+ */
555
+ rssi?: number;
556
+ /**
557
+ * Last-heard SNR, dB.
558
+ */
559
+ snr?: number;
560
+ };
561
+ /**
562
+ * message_sign block - what a Caltrans changeable message sign is showing, verbatim. Context, not a hazard.
563
+ */
564
+ export type MapMessageSignProps = {
565
+ direction?: string;
566
+ district: number;
567
+ inService: boolean;
568
+ /**
569
+ * One or two pages of exactly three lines; a blank line is "". Absent when the sign is blank or unreadable.
570
+ */
571
+ pages?: Array<[
572
+ string,
573
+ string,
574
+ string
575
+ ]>;
576
+ route?: string;
577
+ signId: string;
578
+ };
579
+ /**
580
+ * power block, both PG&E feeds. `category` unplanned|planned sets the
581
+ * outage fields; `psps` (Public Safety Power Shutoff) sets the PSPS fields.
582
+ * `estimatedRestoration`, `deEnergizationEnd` and `allClear` are PG&E
583
+ * ESTIMATES that are routinely overrun; label them as estimates.
584
+ *
585
+ */
586
+ export type MapPowerProps = {
587
+ /**
588
+ * PG&E's PLANNED all-clear, not proof the shutoff ended.
589
+ */
590
+ allClear?: string;
591
+ /**
592
+ * Raw PG&E cause code, often blank.
593
+ */
594
+ cause?: string;
595
+ crewStatus?: string;
596
+ customersAffected?: number;
597
+ deEnergizationEnd?: string;
598
+ deEnergizationStart?: string;
599
+ estimatedRestoration?: string;
600
+ eventName?: string;
601
+ /**
602
+ * Customers whose medical equipment depends on grid power.
603
+ */
604
+ medicalBaselineAffected?: number;
605
+ outageId?: string;
606
+ stage?: 'Watch' | 'Warning';
607
+ };
608
+ /**
609
+ * road_segment block (Google Routes travel time over a configured route). The numbers are absent, not 0, until the route has been measured.
610
+ */
611
+ export type MapRoadProps = {
612
+ congestion?: 'CLEAR' | 'LIGHT' | 'MODERATE' | 'HEAVY' | 'SEVERE' | 'UNSPECIFIED';
613
+ /**
614
+ * Minutes over free-flow. 0 is a real reading.
615
+ */
616
+ delayMinutes?: number;
617
+ distanceKm?: number;
618
+ durationMinutes?: number;
619
+ roadId: string;
620
+ };
621
+ /**
622
+ * weather_alert block. The NWS CAP fields are verbatim; `nwsSeverity` is NWS's own scale, distinct from the unified `severity`.
623
+ */
624
+ export type MapWeatherProps = {
625
+ certainty?: string;
626
+ event?: string;
627
+ /**
628
+ * NWS instruction text. Never paraphrase.
629
+ */
630
+ instruction?: string;
631
+ nwsSeverity?: 'Extreme' | 'Severe' | 'Moderate' | 'Minor' | 'Unknown';
632
+ source?: 'NWS';
633
+ urgency?: string;
634
+ zones?: Array<string>;
635
+ };
636
+ /**
637
+ * wildfire block (CAL FIRE incidents and FIRIS perimeters).
638
+ */
639
+ export type MapWildfireProps = {
640
+ acres?: number;
641
+ cause?: string;
642
+ /**
643
+ * Percent contained.
644
+ */
645
+ containment: number;
646
+ county?: string;
647
+ /**
648
+ * True when the geometry is a mapped perimeter rather than a point.
649
+ */
650
+ hasPerimeter: boolean;
651
+ };
652
+ /**
653
+ * One undirected relay link. Every member is always present.
654
+ */
655
+ export type MeshLink = {
656
+ /**
657
+ * Public key (64 hex) of one end; a < b.
658
+ */
659
+ a: string;
660
+ /**
661
+ * Public key of the other end.
662
+ */
663
+ b: string;
664
+ /**
665
+ * Peak SNR (dB) of an advert seen traversing it; 0 when none was measured.
666
+ */
667
+ bestSnr: number;
668
+ /**
669
+ * Distinct days observed; a reliability weight.
670
+ */
671
+ daysActive: number;
672
+ firstSeen: string;
673
+ /**
674
+ * Drive recency fade from this.
675
+ */
676
+ lastSeen: string;
677
+ /**
678
+ * Packets seen traversing the link in the window.
679
+ */
680
+ observations: number;
681
+ };
682
+ export type MeshLinkList = {
683
+ generatedAt: string;
684
+ links: Array<MeshLink>;
685
+ /**
686
+ * The window applied, e.g. 72h., example: 72h
687
+ */
688
+ window: string;
689
+ };
690
+ /**
691
+ * One reception. Extra bridge fields are accepted and ignored.
692
+ */
693
+ export type MeshPacket = {
694
+ /**
695
+ * Reception RSSI in dBm (number or numeric string).
696
+ */
697
+ RSSI?: unknown;
698
+ /**
699
+ * Reception SNR in dB (number or numeric string).
700
+ */
701
+ SNR?: unknown;
702
+ /**
703
+ * Receiving radio's public key, if different from `observer`.
704
+ */
705
+ origin_id?: string;
706
+ /**
707
+ * MeshCore payload type; only 4 (ADVERT) updates a node.
708
+ */
709
+ packet_type: number;
710
+ /**
711
+ * The full over-the-air frame as hex (header, path, payload), or a meshcore://<hex> link.
712
+ */
713
+ raw: string;
714
+ /**
715
+ * Ignored; the server stamps its own receive time.
716
+ */
717
+ timestamp?: string;
718
+ };
719
+ /**
720
+ * `mesh.packet` (schema_version 1): raw MeshCore frames a companion radio
721
+ * heard, in the per-packet envelope the MQTT bridges publish. ADVERTs
722
+ * (packet_type 4) update a node after its Ed25519 signature verifies;
723
+ * other flood-routed packets credit relays. Answers 400 when MeshCore
724
+ * ingest is off on the server.
725
+ *
726
+ */
727
+ export type MeshPacketReport = {
728
+ generated_at?: string;
729
+ /**
730
+ * Public key (or 4+ byte prefix) of the receiving radio. Defaults to the reporter id.
731
+ */
732
+ observer?: string;
733
+ packets: Array<MeshPacket>;
734
+ schema_version: 1;
735
+ };
736
+ export type MeshRepeaterReading = {
737
+ airtime_ms?: number | null;
738
+ battery_percent?: number | null;
739
+ battery_percent_source?: string;
740
+ battery_voltage?: number | null;
741
+ direct_dups?: number | null;
742
+ flood_dups?: number | null;
743
+ full_evts?: number | null;
744
+ humidity?: number | null;
745
+ /**
746
+ * Node public key or a prefix of it (8-64 hex). A bad id is a warning; the rest of the report still lands.
747
+ */
748
+ id: string;
749
+ /**
750
+ * Unix seconds of the monitor's last attempt on this node.
751
+ */
752
+ last_attempt?: number | null;
753
+ last_rssi_dbm?: number | null;
754
+ last_snr_db?: number | null;
755
+ /**
756
+ * Unix seconds of the last successful read; null if never. Reachability is derived from its age.
757
+ */
758
+ last_success?: number | null;
759
+ name?: string;
760
+ nb_recv?: number | null;
761
+ nb_sent?: number | null;
762
+ noise_floor_dbm?: number | null;
763
+ /**
764
+ * Accepted and logged, but not used; reachability comes from last_success.
765
+ */
766
+ online?: boolean | null;
767
+ pressure?: number | null;
768
+ recv_direct?: number | null;
769
+ recv_errors?: number | null;
770
+ recv_flood?: number | null;
771
+ rx_airtime_ms?: number | null;
772
+ sent_direct?: number | null;
773
+ sent_flood?: number | null;
774
+ temperature_c?: number | null;
775
+ tx_queue_len?: number | null;
776
+ uptime_s?: number | null;
777
+ };
778
+ /**
779
+ * `mesh.repeater` (schema_version 1): an operator monitor's COMPLETE
780
+ * current set of MeshCore repeaters it logged into. A report replaces the
781
+ * reporter's previous set; a node left out is no longer monitored. Request
782
+ * bodies are snake_case. Unknown fields are ignored. Unread values are
783
+ * `null`, never `0`.
784
+ *
785
+ */
786
+ export type MeshRepeaterReport = {
787
+ /**
788
+ * When the report was built. Clamped to the server's clock.
789
+ */
790
+ generated_at?: string;
791
+ repeaters: Array<MeshRepeaterReading>;
792
+ schema_version: 1;
793
+ };
794
+ export type ProtobufAny = {
795
+ '@type'?: string;
796
+ [key: string]: unknown;
797
+ };
798
+ /**
799
+ * The error body of every JSON route: the RPCs (gRPC-Gateway rendering of
800
+ * google.rpc.Status) and the hand-built GeoJSON, mesh-links and ingest
801
+ * routes alike. Served with the HTTP status mapped from `code`
802
+ * (3 INVALID_ARGUMENT -> 400, 5 NOT_FOUND -> 404, 13 INTERNAL -> 500,
803
+ * 14 UNAVAILABLE -> 503, ...). All four members are always present.
804
+ *
805
+ */
806
+ export type RpcStatus = {
807
+ /**
808
+ * Numeric gRPC status code (5 = NOT_FOUND).
809
+ */
810
+ code?: number;
811
+ /**
812
+ * Canonical gRPC code name for `code`, e.g. `NOT_FOUND`,
813
+ * `INVALID_ARGUMENT`, `INTERNAL`. Branch on this rather than the
814
+ * message.
815
+ *
816
+ */
817
+ codeName?: 'OK' | 'CANCELLED' | 'UNKNOWN' | 'INVALID_ARGUMENT' | 'DEADLINE_EXCEEDED' | 'NOT_FOUND' | 'ALREADY_EXISTS' | 'PERMISSION_DENIED' | 'RESOURCE_EXHAUSTED' | 'FAILED_PRECONDITION' | 'ABORTED' | 'OUT_OF_RANGE' | 'UNIMPLEMENTED' | 'INTERNAL' | 'UNAVAILABLE' | 'DATA_LOSS' | 'UNAUTHENTICATED';
818
+ /**
819
+ * Structured error details. Usually empty.
820
+ */
821
+ details?: Array<ProtobufAny>;
822
+ /**
823
+ * Human-readable explanation. Not stable; do not parse.
824
+ */
825
+ message?: string;
826
+ };
827
+ /**
828
+ * BoundingBox is a WGS 84 bounding box in decimal degrees.
829
+ */
830
+ export type V1BoundingBox = {
831
+ /**
832
+ * Northern edge, degrees latitude.
833
+ */
834
+ maxLat: number;
835
+ /**
836
+ * Eastern edge, degrees longitude.
837
+ */
838
+ maxLng: number;
839
+ /**
840
+ * Southern edge, degrees latitude.
841
+ */
842
+ minLat: number;
843
+ /**
844
+ * Western edge, degrees longitude (negative in California).
845
+ */
846
+ minLng: number;
847
+ };
848
+ /**
849
+ * BurnDay is the county air district's call for today.
850
+ *
851
+ * - BURN_DAY_UNKNOWN: Not read, unreadable, or older than 36 hours. Never treat as permissive.
852
+ * - BURN_DAY_YES: Permissive burn day: burning allowed (subject to CAL FIRE's status).
853
+ * - BURN_DAY_NO: No-burn day: burning prohibited.
854
+ * - BURN_DAY_MARGINAL: Restricted or partial day (for example elevation limits). Treated as a
855
+ * restriction, not a yes.
856
+ */
857
+ export type V1BurnDay = 'BURN_DAY_UNKNOWN' | 'BURN_DAY_YES' | 'BURN_DAY_NO' | 'BURN_DAY_MARGINAL';
858
+ /**
859
+ * BurnLineReading is one recorded phone line's answer for today.
860
+ */
861
+ export type V1BurnLineReading = {
862
+ /**
863
+ * This line's own answer. BURN_DAY_UNKNOWN if not read or stale. A change
864
+ * writes a revision.
865
+ */
866
+ burnDay: V1BurnDay;
867
+ /**
868
+ * Stable line id.
869
+ */
870
+ id: string;
871
+ /**
872
+ * Display name of the line.
873
+ */
874
+ name: string;
875
+ /**
876
+ * The latest call: message, transcript, confidence and time. `null` when the
877
+ * line has never been read. Changes daily without writing a revision.
878
+ *
879
+ */
880
+ observation: V1BurnObservation | null;
881
+ /**
882
+ * The number a resident can call, E.164.
883
+ */
884
+ phone: string;
885
+ };
886
+ /**
887
+ * BurnObservation is the latest reading of one burn line. The line's message
888
+ * names the date, so it changes every day even when the answer does not; that
889
+ * is why it writes no revision.
890
+ *
891
+ */
892
+ export type V1BurnObservation = {
893
+ /**
894
+ * The model's confidence in the reading, 0-100. Shown rather than
895
+ * thresholded: this is an AI reading of phone audio, so show it when it is low.
896
+ */
897
+ confidence: number;
898
+ /**
899
+ * The line's answer in plain language, extracted by a model from the
900
+ * transcript.
901
+ */
902
+ message: string;
903
+ /**
904
+ * When the line was called.
905
+ */
906
+ observedAt: string;
907
+ /**
908
+ * Cleaned machine transcript of the recording.
909
+ */
910
+ transcript: string;
911
+ };
912
+ /**
913
+ * BurnPermission is the combined answer, deliberately pessimistic.
914
+ *
915
+ * - BURN_PERMISSION_UNKNOWN: At least one facet is unknown or stale and none prohibits: assume nothing.
916
+ * - BURN_PERMISSION_ALLOWED: Both facets are known and permit burning today.
917
+ * - BURN_PERMISSION_PROHIBITED: At least one facet prohibits burning today.
918
+ */
919
+ export type V1BurnPermission = 'BURN_PERMISSION_UNKNOWN' | 'BURN_PERMISSION_ALLOWED' | 'BURN_PERMISSION_PROHIBITED';
920
+ /**
921
+ * BurnStatusDetail is the BURN_STATUS detail block: whether residential/outdoor
922
+ * burning is allowed today in one county.
923
+ *
924
+ * Two independent authorities must BOTH permit a burn, and each is a separate
925
+ * facet because they fail independently: `burnDay`, the county air district's
926
+ * daily permissive-burn-day call (read from its recorded phone line), and
927
+ * `calfireStatus`, CAL FIRE's seasonal suspension of burn permits on State
928
+ * Responsibility Area land (changes about twice a year). `permission` combines
929
+ * them pessimistically.
930
+ *
931
+ * The event exists for each tracked county at all times, is always INFO and
932
+ * ACTIVE, and is left out of the summary's hazard rollup (it has its own `burn`
933
+ * domain). `GET /api/v1/events/burn:{county slug}/history` shows when it changed.
934
+ */
935
+ export type V1BurnStatusDetail = {
936
+ /**
937
+ * The county line's answer for today, merged across `burnLines` taking the
938
+ * most restrictive (any NO wins, then any MARGINAL; YES needs every dialed
939
+ * line to answer). BURN_DAY_UNKNOWN when unread or the reading is older than
940
+ * 36 hours.
941
+ */
942
+ burnDay: V1BurnDay;
943
+ /**
944
+ * --- county facet (source `burnline`) ---
945
+ * Every recorded phone line that speaks for this county, each with its own
946
+ * reading. One line can serve several counties, and a county can have several
947
+ * lines. A line we could not read still appears, with `burnDay`
948
+ * BURN_DAY_UNKNOWN and its phone number, so a reader can call it.
949
+ */
950
+ burnLines: Array<V1BurnLineReading>;
951
+ /**
952
+ * Land classes CAL FIRE's status covers.
953
+ */
954
+ calfireArea: string;
955
+ /**
956
+ * --- CAL FIRE facet (source `calfire-burn`) ---
957
+ * When CAL FIRE's current status took effect (the county line only ever says
958
+ * "until further notice"). `null` when CAL FIRE gives no date.
959
+ */
960
+ calfireEffective: string | null;
961
+ /**
962
+ * When CAL FIRE's page was last read successfully. The only way to tell that
963
+ * `calfireStatus` is being carried forward rather than freshly confirmed. Can
964
+ * be `null`.
965
+ *
966
+ */
967
+ calfireObservedAt: string | null;
968
+ /**
969
+ * CAL FIRE's permit status for the county's SRA land. Carried forward from the
970
+ * last good read while CAL FIRE's page is unreachable; check
971
+ * `calfireObservedAt`.
972
+ */
973
+ calfireStatus: V1CalfireBurnStatus;
974
+ /**
975
+ * The answer to "may I burn today?": PROHIBITED if either facet prohibits
976
+ * burning (no-burn day, marginal day, or CAL FIRE suspension); ALLOWED only
977
+ * when both facets are known and permissive; otherwise UNKNOWN. A missing
978
+ * answer never reads as ALLOWED.
979
+ */
980
+ permission: V1BurnPermission;
981
+ };
982
+ /**
983
+ * CalfireBurnStatus is CAL FIRE's permit status for State Responsibility Area
984
+ * land in the county.
985
+ *
986
+ * - CALFIRE_BURN_STATUS_UNKNOWN: Unknown: CAL FIRE's page has not been read.
987
+ * - CALFIRE_BURNING_SUSPENDED: Permits suspended: no residential burning.
988
+ * - CALFIRE_PERMIT_REQUIRED: Burning allowed with a valid CAL FIRE permit.
989
+ * - CALFIRE_NO_PERMIT_REQUIRED: Off-season: no permit needed.
990
+ */
991
+ export type V1CalfireBurnStatus = 'CALFIRE_BURN_STATUS_UNKNOWN' | 'CALFIRE_BURNING_SUSPENDED' | 'CALFIRE_PERMIT_REQUIRED' | 'CALFIRE_NO_PERMIT_REQUIRED';
992
+ /**
993
+ * Camera is one Caltrans CCTV camera. Every listed camera is in service and has
994
+ * an image; an out-of-service camera is dropped, not flagged.
995
+ */
996
+ export type V1Camera = {
997
+ /**
998
+ * County, per Caltrans.
999
+ */
1000
+ county: string;
1001
+ /**
1002
+ * Caltrans's note on the view, e.g. "Looking South". Usually an empty string.
1003
+ */
1004
+ description: string;
1005
+ /**
1006
+ * Direction the camera faces along the route. Empty string when not given.
1007
+ */
1008
+ direction: '' | 'North' | 'South' | 'East' | 'West';
1009
+ /**
1010
+ * Metres from the requested place, or, without `place`, from the nearest
1011
+ * coverage area. 0 means inside it.
1012
+ */
1013
+ distanceMeters: number;
1014
+ /**
1015
+ * Elevation in feet.
1016
+ */
1017
+ elevationFeet: number;
1018
+ /**
1019
+ * Camera id, `d{district}-{index}`.
1020
+ */
1021
+ id: string;
1022
+ /**
1023
+ * How often Caltrans replaces the snapshot, in minutes. 0 when not reported.
1024
+ */
1025
+ imageRefreshMinutes: number;
1026
+ /**
1027
+ * Current snapshot JPEG, hosted by Caltrans (cwwp2.dot.ca.gov).
1028
+ */
1029
+ imageUrl: string;
1030
+ /**
1031
+ * Camera position.
1032
+ */
1033
+ location: V1LatLng;
1034
+ /**
1035
+ * Caltrans's camera name.
1036
+ */
1037
+ name: string;
1038
+ /**
1039
+ * Nearest community, per Caltrans.
1040
+ */
1041
+ nearbyPlace: string;
1042
+ /**
1043
+ * Route, e.g. "SR-108", "US-395".
1044
+ */
1045
+ route: string;
1046
+ /**
1047
+ * HLS playlist (.m3u8) for live video. Empty string for an image-only camera.
1048
+ */
1049
+ streamUrl: string;
1050
+ };
1051
+ /**
1052
+ * CameraList is the camera directory.
1053
+ */
1054
+ export type V1CameraList = {
1055
+ /**
1056
+ * Attribution to display.
1057
+ */
1058
+ attribution: string;
1059
+ /**
1060
+ * Cameras, nearest first, then by id. Empty when none is nearby.
1061
+ */
1062
+ cameras: Array<V1Camera>;
1063
+ /**
1064
+ * When the served list was fetched. `null` when `sourceStatus` is OK.
1065
+ */
1066
+ lastSourceUpdate: string | null;
1067
+ /**
1068
+ * Health of the camera list. STALE: served from an older fetch, or a
1069
+ * configured district is missing. UNAVAILABLE: no list fetched yet, or no
1070
+ * camera districts configured.
1071
+ */
1072
+ sourceStatus: 'OK' | 'STALE' | 'UNAVAILABLE';
1073
+ };
1074
+ /**
1075
+ * Conditions is current, non-event state.
1076
+ */
1077
+ export type V1Conditions = {
1078
+ /**
1079
+ * The region's fire-weather state. Region-wide, whatever `place` was asked.
1080
+ * Can be `null` when the weather service has no fire-weather reading.
1081
+ */
1082
+ fireWeather: V1FireWeatherConditions | null;
1083
+ /**
1084
+ * Per-location forecasts, joined to `weather` by `locationId`. A location
1085
+ * whose forecast could not be fetched is simply missing here.
1086
+ */
1087
+ forecast: Array<V1WeatherForecast>;
1088
+ /**
1089
+ * When the weather data was last refreshed.
1090
+ */
1091
+ lastUpdated: string | null;
1092
+ /**
1093
+ * Current weather per location.
1094
+ */
1095
+ weather: Array<V1WeatherConditions>;
1096
+ };
1097
+ /**
1098
+ * EarthquakeDetail is the EARTHQUAKE detail block. The USGS event page is the
1099
+ * envelope `canonicalUrl`.
1100
+ */
1101
+ export type V1EarthquakeDetail = {
1102
+ /**
1103
+ * Hypocentre depth in kilometres.
1104
+ */
1105
+ depthKm: number;
1106
+ /**
1107
+ * Number of USGS "Did You Feel It?" reports. 0 when none.
1108
+ */
1109
+ felt: number;
1110
+ /**
1111
+ * Magnitude.
1112
+ */
1113
+ magnitude: number;
1114
+ };
1115
+ /**
1116
+ * Enhancement marks AI-generated text so a client can badge it. The model
1117
+ * translates and summarizes the upstream text; it never asserts new facts, and
1118
+ * the original stays in `description`.
1119
+ */
1120
+ export type V1Enhancement = {
1121
+ /**
1122
+ * When the text was generated.
1123
+ */
1124
+ enhancedAt: string | null;
1125
+ /**
1126
+ * Which Event fields the model wrote, by JSON name: any of `headline`,
1127
+ * `summary`, `severity`.
1128
+ */
1129
+ fields: Array<string>;
1130
+ /**
1131
+ * Model that produced the text, e.g. "gpt-5-mini".
1132
+ */
1133
+ model: string;
1134
+ /**
1135
+ * The incident-specific prompt sent to the model (the static system prompt is
1136
+ * not included). Empty string unless the request set `enhancementIo=true`.
1137
+ *
1138
+ */
1139
+ request: string;
1140
+ /**
1141
+ * The raw structured JSON the model returned. Empty string unless the request
1142
+ * set `enhancementIo=true`.
1143
+ */
1144
+ response: string;
1145
+ };
1146
+ /**
1147
+ * EvacuationDetail is the EVACUATION detail block, one Cal OES / Genasys zone.
1148
+ */
1149
+ export type V1EvacuationDetail = {
1150
+ /**
1151
+ * County as Cal OES spells it (uppercase).
1152
+ */
1153
+ county: string;
1154
+ /**
1155
+ * Upstream event type, often an empty string.
1156
+ */
1157
+ eventType: string;
1158
+ /**
1159
+ * Coded level. An unrecognized upstream status is coded WARNING, never
1160
+ * dropped. ORDER and WARNING and SHELTER_IN_PLACE put the place summary in
1161
+ * ACTIVE mode; ADVISORY puts it in WATCH.
1162
+ */
1163
+ level: 'ORDER' | 'WARNING' | 'ADVISORY' | 'SHELTER_IN_PLACE';
1164
+ /**
1165
+ * Genasys zone id. `provenance.sourceUrl` links the zone's Genasys page.
1166
+ */
1167
+ zoneId: string;
1168
+ };
1169
+ /**
1170
+ * Event is one item from one upstream source: a hazard, or a piece of ambient
1171
+ * state such as a mesh node or a county's burn status.
1172
+ *
1173
+ * The envelope fields are the same for every layer, so a client can render a
1174
+ * card from `headline`, `severity`, `status` and `provenance` without knowing the
1175
+ * layer. Layer-specific fields are in exactly one detail block (`wildfire`,
1176
+ * `evacuation`, `weatherAlert`, `earthquake`, `roadIncident`, `mesh`, `power` or
1177
+ * `burnStatus`), chosen by `layer`; the other blocks are absent. `fireWeather`
1178
+ * is never populated on an event.
1179
+ */
1180
+ export type V1Event = {
1181
+ /**
1182
+ * Human-readable location ("SR 4 at Country Club Drive", "Calaveras County").
1183
+ * Empty string when the source gives none.
1184
+ */
1185
+ areaLabel: string;
1186
+ /**
1187
+ * BURN_STATUS detail (one county's residential burning status).
1188
+ */
1189
+ burnStatus?: V1BurnStatusDetail;
1190
+ /**
1191
+ * Link to the authoritative page for THIS item: a USGS event page, a CAL FIRE
1192
+ * incident page, a mesh node's CoreScope page, PG&E's outage or PSPS page, the
1193
+ * CAL FIRE burn-permit page for burn status. Always http(s) when set. Empty
1194
+ * string when the source has no per-item page, which today means CHP
1195
+ * incidents, Caltrans lane closures, FIRIS perimeters, NWS alerts and
1196
+ * evacuation zones. Fall back to `provenance.sourceUrl`, then to the source's
1197
+ * `homepageUrl` (`GET /api/v1/sources`, joined on `provenance.sourceId`).
1198
+ */
1199
+ canonicalUrl: string;
1200
+ /**
1201
+ * Source sub-type, lowercase except for weather alerts. By layer: WILDFIRE
1202
+ * `wildfire`; EVACUATION `order` | `warning` | `advisory` | `shelter_in_place`;
1203
+ * WEATHER_ALERT the NWS event name verbatim (`Red Flag Warning`, `Winter Storm
1204
+ * Watch`, ...); EARTHQUAKE `earthquake`; ROAD_INCIDENT `incident` | `closure` |
1205
+ * `construction` | `weather` (CHP types) or `closure` (Caltrans windows);
1206
+ * POWER `unplanned` | `planned` | `psps`; MESH the node type (`repeater`,
1207
+ * `companion`, `room_server`, `sensor`); BURN_STATUS `burn_status`.
1208
+ */
1209
+ category: string;
1210
+ /**
1211
+ * Long-form original text from the upstream (CHP log, NWS product body,
1212
+ * evacuation instructions, closure description). May contain newlines. Empty
1213
+ * string when the source has none, or when it would only repeat the headline.
1214
+ */
1215
+ description: string;
1216
+ /**
1217
+ * EARTHQUAKE detail.
1218
+ */
1219
+ earthquake?: V1EarthquakeDetail;
1220
+ /**
1221
+ * When the event took or takes effect: alert onset, incident start, outage
1222
+ * start, closure set-up time. `null` when the source does not say.
1223
+ */
1224
+ effective: string | null;
1225
+ /**
1226
+ * Present when an AI model generated some of this event's text; lists which
1227
+ * fields. `null` for events with no AI involvement.
1228
+ */
1229
+ enhancement: V1Enhancement | null;
1230
+ /**
1231
+ * EVACUATION detail.
1232
+ */
1233
+ evacuation?: V1EvacuationDetail;
1234
+ /**
1235
+ * The upstream's declared end, such as an NWS alert's expiry. `null` for most
1236
+ * layers. Restoration estimates and planned closure ends are never put here
1237
+ * (they are routinely overrun); they live in the detail blocks.
1238
+ */
1239
+ expires: string | null;
1240
+ /**
1241
+ * Never populated on an event: fire weather is a condition
1242
+ * (`GET /api/v1/conditions`, the `fire_weather` map layer).
1243
+ */
1244
+ fireWeather?: V1FireWeatherDetail;
1245
+ /**
1246
+ * Where the event is. `null` for events with no footprint of their own: NWS
1247
+ * zone alerts (they attach to places by zone instead) and burn status (a fact
1248
+ * about a county).
1249
+ */
1250
+ geometry: V1Geometry | null;
1251
+ /**
1252
+ * One-line, card-ready title. Present on every event. For CHP incidents it
1253
+ * may be AI-written (see `enhancement.fields`); for NWS alerts it is composed
1254
+ * from the product, never by AI.
1255
+ */
1256
+ headline: string;
1257
+ /**
1258
+ * Stable event id, `{source}:{native id}`. It never changes over the event's
1259
+ * life, so it is safe as a client key. Namespaces: `calfire:`, `firis:`
1260
+ * (wildfire), `evac:` (evacuation zone), `wx:` (NWS alert), `usgs:`
1261
+ * (earthquake), `chp:` (CHP incident), `caltrans:` (Caltrans lane-closure
1262
+ * window), `pge:` (outage), `psps:` (power shutoff), `meshcore:` (mesh node),
1263
+ * `burn:` (county burn status). Ids can contain colons; URL-encode them in a
1264
+ * path.
1265
+ */
1266
+ id: string;
1267
+ /**
1268
+ * When the Grid stored this revision.
1269
+ */
1270
+ ingestedAt: string;
1271
+ /**
1272
+ * Which layer this event belongs to. It decides which detail block is
1273
+ * populated.
1274
+ */
1275
+ layer: V1Layer;
1276
+ /**
1277
+ * MESH detail (one MeshCore radio node).
1278
+ */
1279
+ mesh?: V1MeshDetail;
1280
+ /**
1281
+ * When the upstream last changed this event's content. It moves only when a
1282
+ * new revision is written, so it is NOT "last seen". For a mesh node's
1283
+ * liveness use `mesh.telemetry.lastHeardAt` / `lastRelayedAt`; for burn
1284
+ * status it follows each new phone-line reading.
1285
+ */
1286
+ observedAt: string | null;
1287
+ /**
1288
+ * Ids of every place this event attaches to, e.g. `["county:calaveras-county",
1289
+ * "town:arnold"]`. Point events attach to the polygon places that contain them
1290
+ * and to corridors within about 1.5 km. Polygon events attach to places they
1291
+ * overlap. Wildfires also attach to AREA and TOWN places within 20 km. Empty
1292
+ * when the event is outside every place (common for mesh nodes).
1293
+ */
1294
+ placeIds: Array<string>;
1295
+ /**
1296
+ * POWER detail (PG&E outage or Public Safety Power Shutoff).
1297
+ */
1298
+ power?: V1PowerDetail;
1299
+ /**
1300
+ * Which source published it, with attribution text to display.
1301
+ */
1302
+ provenance: V1Provenance;
1303
+ /**
1304
+ * Revision number, starting at 1. It increases by one on every content change
1305
+ * or status transition. `/api/v1/events/{id}/history` lists every revision.
1306
+ */
1307
+ revision: number;
1308
+ /**
1309
+ * ROAD_INCIDENT detail (CHP incidents and Caltrans lane closures).
1310
+ */
1311
+ roadIncident?: V1RoadIncidentDetail;
1312
+ /**
1313
+ * Unified severity, INFO..EXTREME. Response urgency, not magnitude. See the
1314
+ * Severity enum for how each layer is graded. `enhancement.fields` lists
1315
+ * `severity` when an AI model assessed it (CHP incidents).
1316
+ */
1317
+ severity: V1Severity;
1318
+ /**
1319
+ * Lifecycle status. `/api/v1/events` returns ACTIVE and SCHEDULED unless you
1320
+ * ask for others.
1321
+ */
1322
+ status: V1EventStatus;
1323
+ /**
1324
+ * AI-written plain-language summary of two or three sentences, for CHP
1325
+ * incidents and NWS alerts. Empty string when none was generated. The original
1326
+ * text is always kept in `description`.
1327
+ */
1328
+ summary: string;
1329
+ /**
1330
+ * WEATHER_ALERT detail.
1331
+ */
1332
+ weatherAlert?: V1WeatherAlertDetail;
1333
+ /**
1334
+ * WILDFIRE detail.
1335
+ */
1336
+ wildfire?: V1WildfireDetail;
1337
+ };
1338
+ /**
1339
+ * EventList is one page of events.
1340
+ */
1341
+ export type V1EventList = {
1342
+ /**
1343
+ * Events on this page, ordered by severity (highest first), then
1344
+ * `observedAt` (newest first), then id.
1345
+ */
1346
+ events: Array<V1Event>;
1347
+ /**
1348
+ * Token for the next page; pass it as `pageToken` with the same filters.
1349
+ * Empty string on the last page.
1350
+ */
1351
+ nextPageToken: string;
1352
+ };
1353
+ /**
1354
+ * EventRevision is one stored snapshot of an event.
1355
+ */
1356
+ export type V1EventRevision = {
1357
+ /**
1358
+ * The full event as it was at this revision. Mesh activity clocks
1359
+ * (`lastHeardAt`, `lastRelayedAt`) are not filled on history snapshots.
1360
+ */
1361
+ event: V1Event;
1362
+ /**
1363
+ * When the Grid stored this revision.
1364
+ */
1365
+ ingestedAt: string;
1366
+ /**
1367
+ * The upstream content time of this revision (`event.observedAt`).
1368
+ */
1369
+ observedAt: string;
1370
+ /**
1371
+ * Revision number, from 1.
1372
+ */
1373
+ revision: number;
1374
+ };
1375
+ /**
1376
+ * EventRevisionList is one page of revisions.
1377
+ */
1378
+ export type V1EventRevisionList = {
1379
+ /**
1380
+ * Token for the next page; pass it as `pageToken` with the same filters.
1381
+ * Empty string on the last page.
1382
+ */
1383
+ nextPageToken: string;
1384
+ /**
1385
+ * Revisions on this page. Per-event history: newest revision first. The
1386
+ * archive (`/api/v1/history`): `observedAt` newest first, then event id, then
1387
+ * revision newest first.
1388
+ */
1389
+ revisions: Array<V1EventRevision>;
1390
+ };
1391
+ /**
1392
+ * EventStatus is an event's lifecycle state. Every transition is a revision, so
1393
+ * the history keeps when an event started and ended.
1394
+ *
1395
+ * - EVENT_STATUS_UNSPECIFIED: Never returned.
1396
+ * - SCHEDULED: Planned or forecast and not yet in effect, e.g. a Caltrans lane-closure
1397
+ * window the crew has not set up yet.
1398
+ * - ACTIVE: In effect now.
1399
+ * - RESOLVED: Over: an authoritatively active-only feed (CAL FIRE, Cal OES, CHP, Caltrans,
1400
+ * PG&E) stopped listing it after a successful poll, or a closure passed its
1401
+ * planned end plus an overrun grace without a pickup call.
1402
+ * - EXPIRED: Aged out: past its own `expires`, or unseen for longer than the source's
1403
+ * grace (`Source.expireAfterSeconds`). Used where a feed going quiet proves
1404
+ * nothing (NWS alerts, FIRIS perimeters, mesh nodes).
1405
+ */
1406
+ export type V1EventStatus = 'EVENT_STATUS_UNSPECIFIED' | 'SCHEDULED' | 'ACTIVE' | 'RESOLVED' | 'EXPIRED';
1407
+ /**
1408
+ * FireWeatherConditions is the region's fire-weather state, from issued NWS
1409
+ * products only. It never claims a Red Flag Warning that NWS has not issued.
1410
+ */
1411
+ export type V1FireWeatherConditions = {
1412
+ /**
1413
+ * The NWS product's headline. Empty string when the state is normal.
1414
+ */
1415
+ headline: string;
1416
+ /**
1417
+ * LOWERCASE state: `normal`, `elevated` (a Fire Weather Watch is in effect)
1418
+ * or `red-flag` (a Red Flag Warning is in effect). Empty string when the
1419
+ * state could not be determined.
1420
+ */
1421
+ state: 'normal' | 'elevated' | 'red-flag' | '';
1422
+ /**
1423
+ * NWS fire-weather zones under the product. Empty when normal.
1424
+ */
1425
+ zones: Array<string>;
1426
+ };
1427
+ /**
1428
+ * FireWeatherDetail is never populated on an event. Fire weather is a condition,
1429
+ * served by `GET /api/v1/conditions` (`fireWeather`) and the `fire_weather` map
1430
+ * layer.
1431
+ *
1432
+ */
1433
+ export type V1FireWeatherDetail = {
1434
+ /**
1435
+ * NWS product driving the state.
1436
+ */
1437
+ sourceEvent: string;
1438
+ /**
1439
+ * `normal`, `elevated` (Fire Weather Watch) or `red-flag` (Red Flag Warning).
1440
+ * Lowercase.
1441
+ */
1442
+ state: 'normal' | 'elevated' | 'red-flag';
1443
+ /**
1444
+ * NWS fire-weather zones it covers.
1445
+ */
1446
+ zones: Array<string>;
1447
+ };
1448
+ /**
1449
+ * ForecastPeriod is one hour of a location's forecast (NWS gridpoint data),
1450
+ * rounded to whole numbers. A value NWS did not give is 0.
1451
+ */
1452
+ export type V1ForecastPeriod = {
1453
+ /**
1454
+ * Relative humidity, percent.
1455
+ */
1456
+ humidityPercent: number;
1457
+ /**
1458
+ * Temperature, degrees Celsius.
1459
+ */
1460
+ temperatureCelsius: number;
1461
+ /**
1462
+ * Start of the hour, UTC.
1463
+ */
1464
+ time: string | null;
1465
+ /**
1466
+ * Direction the wind blows FROM, degrees clockwise from north.
1467
+ */
1468
+ windDirectionDegrees: number;
1469
+ /**
1470
+ * Wind gust, km/h.
1471
+ */
1472
+ windGustKmh: number;
1473
+ /**
1474
+ * Sustained wind speed, km/h.
1475
+ */
1476
+ windSpeedKmh: number;
1477
+ };
1478
+ /**
1479
+ * Geometry is an event's or place's footprint.
1480
+ *
1481
+ * The GeoJSON comes in one of two forms, chosen per request with
1482
+ * `geometryFormat`: `BASE64` (the default and legacy form) fills `geojson`;
1483
+ * `OBJECT` fills `object` and leaves `geojson` empty. `bbox` and `centroid`
1484
+ * are the same in both.
1485
+ */
1486
+ export type V1Geometry = {
1487
+ /**
1488
+ * Bounding box of the geometry, in decimal degrees. Always set when geometry
1489
+ * is present.
1490
+ */
1491
+ bbox: V1BoundingBox;
1492
+ /**
1493
+ * Representative point for markers and list views: the point itself for a
1494
+ * Point, otherwise the middle of the bounding box (which can fall outside an
1495
+ * irregular polygon).
1496
+ */
1497
+ centroid: V1LatLng;
1498
+ /**
1499
+ * LEGACY FORM (the default, `geometryFormat=BASE64`). The RFC 7946 GeoJSON
1500
+ * geometry object (Point, LineString, Polygon, MultiPolygon, ...) as UTF-8
1501
+ * JSON, BASE64-ENCODED in this JSON response because the field is protobuf
1502
+ * `bytes`. Decode with `JSON.parse(atob(geojson))`. Coordinates are
1503
+ * `[longitude, latitude]`. Empty in the `OBJECT` form. Kept unchanged for existing clients; new clients should
1504
+ * request `geometryFormat=OBJECT` and read `object` instead. Perimeters,
1505
+ * evacuation zones and outage areas run from kilobytes to about a megabyte.
1506
+ */
1507
+ geojson: string;
1508
+ /**
1509
+ * The same RFC 7946 geometry as a plain JSON object, e.g.
1510
+ * `{"type": "Point", "coordinates": [-120.36108, 38.24239]}`, ready for
1511
+ * MapLibre, Leaflet or turf with no decoding. Sent only when the request
1512
+ * asks for `geometryFormat=OBJECT`, and then only when the event has
1513
+ * GeoJSON; otherwise the key is absent (never `null`).
1514
+ */
1515
+ object?: GeoJsonGeometry;
1516
+ };
1517
+ /**
1518
+ * LaneClosureDetail is one Caltrans planned lane-closure WINDOW from the CWWP2
1519
+ * data portal. Every field is Caltrans data; none of it is AI-generated.
1520
+ *
1521
+ * A multi-day job is one window (one event) per day, and neither `closureId`
1522
+ * nor `logNumber` identifies a job; `windowId` is the only unique key. A window
1523
+ * is SCHEDULED until the crew radios it set up (`setUpAt`), then ACTIVE until
1524
+ * they radio it picked up, or until `plannedEnd` plus a 12-hour overrun grace
1525
+ * passes with no pickup call, when it is presumed over and RESOLVED. The
1526
+ * planned end is an estimate crews overrun, so it is never mapped onto the
1527
+ * envelope `expires`.
1528
+ */
1529
+ export type V1LaneClosureDetail = {
1530
+ /**
1531
+ * Start point.
1532
+ */
1533
+ begin: V1LatLng | null;
1534
+ /**
1535
+ * Where the closure starts, verbatim, e.g. "Avery".
1536
+ */
1537
+ beginLocation: string;
1538
+ /**
1539
+ * How the closure runs.
1540
+ */
1541
+ closureDuration: 'Standard' | 'Long Term' | 'Intermittent';
1542
+ /**
1543
+ * Route-level project id. Not unique.
1544
+ */
1545
+ closureId: string;
1546
+ /**
1547
+ * Closure type, verbatim: "Full", "Lane", "One-Way Traffic", "Alternating
1548
+ * Lanes", "Moving", ...
1549
+ */
1550
+ closureType: string;
1551
+ /**
1552
+ * Travel direction, verbatim, e.g. "East / West", "North".
1553
+ */
1554
+ direction: string;
1555
+ /**
1556
+ * Caltrans district whose feed listed it (3 or 10 here).
1557
+ */
1558
+ district: number;
1559
+ /**
1560
+ * End point.
1561
+ */
1562
+ end: V1LatLng | null;
1563
+ /**
1564
+ * True when the window has no planned end.
1565
+ */
1566
+ endIndefinite: boolean;
1567
+ /**
1568
+ * Where it ends; equals `beginLocation` for a closure at one spot.
1569
+ */
1570
+ endLocation: string;
1571
+ /**
1572
+ * Caltrans's delay estimate in minutes. 0 when none or not reported.
1573
+ */
1574
+ estimatedDelayMinutes: number;
1575
+ /**
1576
+ * Facility, verbatim: "Conventional Hwy", "On Ramp", "Off Ramp", ...
1577
+ */
1578
+ facility: string;
1579
+ /**
1580
+ * Lanes closed, verbatim: "1, RShoulder", "All", "Rt Turn Ln".
1581
+ */
1582
+ lanesClosed: string;
1583
+ /**
1584
+ * Per-project request number. Not unique.
1585
+ */
1586
+ logNumber: string;
1587
+ /**
1588
+ * Planned end of the window. `null` when `endIndefinite`.
1589
+ */
1590
+ plannedEnd: string | null;
1591
+ /**
1592
+ * Planned start of the window.
1593
+ */
1594
+ plannedStart: string;
1595
+ /**
1596
+ * Route, e.g. "SR-4", "US-50".
1597
+ */
1598
+ route: string;
1599
+ /**
1600
+ * When the crew radioed the closure set up (the 10-97 call). `null` while it
1601
+ * is SCHEDULED.
1602
+ */
1603
+ setUpAt: string | null;
1604
+ /**
1605
+ * Number of lanes at the site. 0 when not reported.
1606
+ */
1607
+ totalLanes: number;
1608
+ /**
1609
+ * CWWP2 window id, unique per window.
1610
+ */
1611
+ windowId: string;
1612
+ /**
1613
+ * Work being done, e.g. "Drainage Work", "Tree Work".
1614
+ */
1615
+ workType: string;
1616
+ };
1617
+ /**
1618
+ * LatLng is one WGS 84 point in decimal degrees. Note the order: unlike GeoJSON
1619
+ * coordinates, this is latitude first.
1620
+ */
1621
+ export type V1LatLng = {
1622
+ /**
1623
+ * Degrees latitude.
1624
+ */
1625
+ lat: number;
1626
+ /**
1627
+ * Degrees longitude (negative in California).
1628
+ */
1629
+ lng: number;
1630
+ };
1631
+ /**
1632
+ * Layer is the event taxonomy. Response values are these UPPERCASE names; the
1633
+ * `layer` query parameter also accepts lowercase slugs (`road_incident`).
1634
+ *
1635
+ * Only event layers appear here. The condition layers (`road_segment`,
1636
+ * `chain_control`, `fire_weather`, `message_sign`) are map layers and summary
1637
+ * inputs, never events.
1638
+ *
1639
+ * - LAYER_UNSPECIFIED: Never returned.
1640
+ * - WILDFIRE: Wildfires: CAL FIRE incidents joined with FIRIS/NIFC perimeters (sources
1641
+ * `calfire`, `firis`). Scoped wider than other layers, so a fire approaching
1642
+ * the region shows up before it arrives.
1643
+ * - EVACUATION: Evacuation zones under an order, warning, advisory or shelter-in-place,
1644
+ * from Cal OES / Genasys (source `caloes`). Life-safety: see the summary's
1645
+ * `activeEvacuations`.
1646
+ * - WEATHER_ALERT: National Weather Service watches, warnings and advisories for the region's
1647
+ * forecast zones (source `nws`). No geometry; attached to places by zone.
1648
+ * - FIRE_WEATHER: Reserved. Fire weather is a condition (`GET /api/v1/conditions`), not an
1649
+ * event layer; no event carries it.
1650
+ * - EARTHQUAKE: USGS earthquakes of magnitude 2.5 or more in the last 7 days (source `usgs`).
1651
+ * - ROAD_INCIDENT: CHP traffic incidents (source `chp`, AI-summarized) and Caltrans planned
1652
+ * lane-closure windows (source `caltrans`). Planned windows not yet set up are
1653
+ * SCHEDULED.
1654
+ * - POWER:
1655
+ * PG&E electric outages (source `pge`) and Public Safety Power Shutoffs
1656
+ * (source `psps`). Most outages affect one customer and are INFO.
1657
+ * - GAUGE: Reserved for stream gauges; no events today.
1658
+ * - AIR_QUALITY: Reserved for air quality; no events today.
1659
+ * - MESH: MeshCore community radio nodes (source `meshcore`), one event per node.
1660
+ * Ambient INFO state, not a hazard. It dominates an unscoped event query.
1661
+ * - ANNOUNCEMENT: Reserved for announcements; no events today.
1662
+ * - BURN_STATUS: One event per tracked county saying whether residential burning is allowed
1663
+ * today (sources `burnline`, `calfire-burn`). Ambient, permanently ACTIVE,
1664
+ * always INFO; its revision history is the record of changes.
1665
+ */
1666
+ export type V1Layer = 'LAYER_UNSPECIFIED' | 'WILDFIRE' | 'EVACUATION' | 'WEATHER_ALERT' | 'FIRE_WEATHER' | 'EARTHQUAKE' | 'ROAD_INCIDENT' | 'POWER' | 'GAUGE' | 'AIR_QUALITY' | 'MESH' | 'ANNOUNCEMENT' | 'BURN_STATUS';
1667
+ /**
1668
+ * MeshAdminTelemetry is one reading taken from a node's own admin interface by an
1669
+ * operator-run monitor. It is the node's self-reported view, which is why it
1670
+ * sits beside rather than replaces the gateway-reported `snr`/`rssi`: those are
1671
+ * what a distant listener heard, these are what the node measured.
1672
+ *
1673
+ * Gauges are nullable: `null` means the monitor could not read it, which is not
1674
+ * the same as 0 (a 0% battery and an unknown battery must not render alike).
1675
+ * Counters are plain, count since the node's last boot (they reset at a
1676
+ * reboot), and are 64-bit, so they arrive as JSON STRINGS.
1677
+ */
1678
+ export type V1MeshAdminTelemetry = {
1679
+ /**
1680
+ * Milliseconds spent transmitting since boot.
1681
+ */
1682
+ airtimeMs: string;
1683
+ /**
1684
+ * Battery charge in percent, 0-100. Nullable. See `batteryPercentSource`.
1685
+ */
1686
+ batteryPercent: number | null;
1687
+ /**
1688
+ * Whether `batteryPercent` was measured by the node or estimated from
1689
+ * voltage. Empty string when no percentage is reported.
1690
+ */
1691
+ batteryPercentSource: '' | 'measured' | 'estimated';
1692
+ /**
1693
+ * Battery voltage in volts. Nullable.
1694
+ */
1695
+ batteryVolts: number | null;
1696
+ /**
1697
+ * Duplicate direct-routed packets dropped since boot.
1698
+ */
1699
+ directDups: string;
1700
+ /**
1701
+ * Duplicate flood-routed packets dropped since boot.
1702
+ */
1703
+ floodDups: string;
1704
+ /**
1705
+ * Transmit-queue overflow events since boot.
1706
+ */
1707
+ fullEvents: string;
1708
+ /**
1709
+ * Relative humidity in percent. Nullable (most nodes have no sensor).
1710
+ */
1711
+ humidity: number | null;
1712
+ /**
1713
+ * The monitor's last attempt to read this node, successful or not. Can be
1714
+ * `null` (always `null` on archived samples).
1715
+ */
1716
+ lastAttemptAt: string | null;
1717
+ /**
1718
+ * RSSI of the last packet the node itself received, in dBm. Nullable.
1719
+ */
1720
+ lastRssiDbm: number | null;
1721
+ /**
1722
+ * SNR of the last packet the node itself received, in dB. Nullable.
1723
+ */
1724
+ lastSnrDb: number | null;
1725
+ /**
1726
+ * The monitor's last successful read of this node. Can be `null` (always
1727
+ * `null` on archived samples).
1728
+ */
1729
+ lastSuccessAt: string | null;
1730
+ /**
1731
+ * Radio noise floor in dBm. Nullable.
1732
+ */
1733
+ noiseFloorDbm: number | null;
1734
+ /**
1735
+ * Packets received since boot.
1736
+ */
1737
+ packetsReceived: string;
1738
+ /**
1739
+ * Packets sent since boot.
1740
+ */
1741
+ packetsSent: string;
1742
+ /**
1743
+ * Barometric pressure in hPa. Nullable (most nodes have no sensor).
1744
+ */
1745
+ pressure: number | null;
1746
+ /**
1747
+ * Direct-routed packets received since boot.
1748
+ */
1749
+ recvDirect: string;
1750
+ /**
1751
+ * Receive errors (undecodable packets) since boot.
1752
+ */
1753
+ recvErrors: string;
1754
+ /**
1755
+ * Flood-routed packets received since boot.
1756
+ */
1757
+ recvFlood: string;
1758
+ /**
1759
+ * When the monitor produced the report. In the archive this is the sample's
1760
+ * own time.
1761
+ */
1762
+ reportedAt: string | null;
1763
+ /**
1764
+ * Which monitor reported it (its registry id, also a row on `/api/v1/sources`).
1765
+ */
1766
+ reporterId: string;
1767
+ /**
1768
+ * Milliseconds spent receiving since boot.
1769
+ */
1770
+ rxAirtimeMs: string;
1771
+ /**
1772
+ * Direct-routed packets sent since boot.
1773
+ */
1774
+ sentDirect: string;
1775
+ /**
1776
+ * Flood-routed packets sent since boot.
1777
+ */
1778
+ sentFlood: string;
1779
+ /**
1780
+ * Temperature in degrees Celsius. Nullable.
1781
+ */
1782
+ temperatureC: number | null;
1783
+ /**
1784
+ * Packets waiting in the transmit queue. Nullable.
1785
+ */
1786
+ txQueueLen: number | null;
1787
+ /**
1788
+ * Seconds since the node booted. A decrease between samples is a reboot.
1789
+ */
1790
+ uptimeSeconds: string;
1791
+ };
1792
+ /**
1793
+ * MeshDetail is the MESH detail block, for one MeshCore radio node, keyed by its
1794
+ * Ed25519 public key.
1795
+ *
1796
+ * Identity, location and reachability changes write a revision. The volatile
1797
+ * signal readings in `telemetry` change constantly without one.
1798
+ *
1799
+ */
1800
+ export type V1MeshDetail = {
1801
+ /**
1802
+ * Name the node advertises. Free text and can include emoji.
1803
+ */
1804
+ name: string;
1805
+ /**
1806
+ * Node role as advertised. Repeaters and room servers relay traffic;
1807
+ * companions and sensors do not.
1808
+ */
1809
+ nodeType: 'companion' | 'repeater' | 'room_server' | 'sensor';
1810
+ /**
1811
+ * Full Ed25519 public key, 64 lowercase hex characters. It is also the native
1812
+ * half of the event id (`meshcore:{publicKey}`) and the `node` parameter of
1813
+ * `GET /api/v1/mesh/telemetry`.
1814
+ */
1815
+ publicKey: string;
1816
+ /**
1817
+ * Whether an operator-run monitor can reach this node's admin interface.
1818
+ * MESH_REACHABILITY_UNSPECIFIED for the many nodes no monitor watches. A
1819
+ * change writes a revision, so the history answers "how often is this
1820
+ * repeater down?".
1821
+ *
1822
+ */
1823
+ reachability: V1MeshReachability;
1824
+ /**
1825
+ * Signal readings and activity clocks. These change without a new revision.
1826
+ *
1827
+ */
1828
+ telemetry: V1MeshTelemetry | null;
1829
+ };
1830
+ /**
1831
+ * MeshReachability is an operator monitor's verdict on a node's admin interface,
1832
+ * smoothed so a marginal link does not flap.
1833
+ *
1834
+ * - MESH_REACHABILITY_UNSPECIFIED: No monitor watches this node (most nodes). Says nothing about liveness.
1835
+ * - REACHABLE: A monitor reached it recently.
1836
+ * - UNREACHABLE: A monitor has been failing to reach it for longer than its window.
1837
+ */
1838
+ export type V1MeshReachability = 'MESH_REACHABILITY_UNSPECIFIED' | 'REACHABLE' | 'UNREACHABLE';
1839
+ /**
1840
+ * MeshTelemetry is a mesh node's volatile signal state and activity clocks. None
1841
+ * of it writes a revision, so history snapshots do not reflect it.
1842
+ *
1843
+ * For "is this node up right now", use `lastRelayedAt` (repeaters relay
1844
+ * constantly but advertise only every day or two), then `lastHeardAt`; never
1845
+ * the event's `observedAt`.
1846
+ *
1847
+ */
1848
+ export type V1MeshTelemetry = {
1849
+ /**
1850
+ * Latest reading from an operator-run monitor that logs into the node's admin
1851
+ * interface. `null` for nodes no monitor watches. The full series is at
1852
+ * `GET /api/v1/mesh/telemetry?node={publicKey}`.
1853
+ *
1854
+ */
1855
+ admin: V1MeshAdminTelemetry | null;
1856
+ /**
1857
+ * Ids of the gateways (observer node keys, uppercase hex) that heard the node.
1858
+ */
1859
+ gateways: Array<string>;
1860
+ /**
1861
+ * Hops the last-heard advert travelled; 0 means heard directly. Nullable,
1862
+ * like `snr`: `null` is unknown, not zero hops.
1863
+ */
1864
+ hopCount: number | null;
1865
+ /**
1866
+ * Time stamped by the node itself on its last advert (the node's clock, which
1867
+ * can be wrong). `null` if no bridge has heard an advert.
1868
+ */
1869
+ lastAdvertAt: string | null;
1870
+ /**
1871
+ * When the Grid last received one of this node's own adverts, by our clock
1872
+ * (compare `lastAdvertAt`, the node's clock). Answers "when did the node last
1873
+ * speak". `null` when no advert has been received since activity tracking
1874
+ * began. Filled at read time on current events only; history revisions do not
1875
+ * carry it.
1876
+ *
1877
+ */
1878
+ lastHeardAt: string | null;
1879
+ /**
1880
+ * When the Grid last received a packet this node RELAYED, by our clock. A
1881
+ * repeater advertises every day or two but relays constantly, so this is the
1882
+ * clock that says it is up right now. `null` when no relay has been
1883
+ * attributed. Read-time only, like `lastHeardAt`.
1884
+ *
1885
+ * A hop is credited only when exactly one relay-capable node fits it, so a
1886
+ * node whose traffic is ambiguous gets no relay time (it reads older than on
1887
+ * other mesh tools). Flood-routed packets of any type credit every hop; a
1888
+ * direct-routed packet's remaining route credits its 2- and 3-byte hops only.
1889
+ * A relay also keeps a known node ACTIVE for a while after it, the way an
1890
+ * advert does; it never creates a node or changes its name or position.
1891
+ *
1892
+ */
1893
+ lastRelayedAt: string | null;
1894
+ /**
1895
+ * Received signal strength of the last advert, in dBm, gateway-reported.
1896
+ * Nullable, like `snr`.
1897
+ */
1898
+ rssi: number | null;
1899
+ /**
1900
+ * Signal-to-noise ratio of the last advert, in dB, as a listening gateway
1901
+ * reported it. Nullable: `null` unless an MQTT bridge heard the advert (then
1902
+ * `lastAdvertAt` is set too).
1903
+ *
1904
+ */
1905
+ snr: number | null;
1906
+ };
1907
+ /**
1908
+ * MeshTelemetryArchive is one node's samples over a window, with what a chart
1909
+ * needs in order not to lie about them.
1910
+ */
1911
+ export type V1MeshTelemetryArchive = {
1912
+ /**
1913
+ * Median gap between samples in the window, in seconds, so a chart knows which
1914
+ * gaps are abnormal enough to break a line on. 64-bit, so a JSON STRING
1915
+ * (`"1831"`). Nullable: `null` with fewer than two samples.
1916
+ *
1917
+ */
1918
+ cadenceSeconds: string | null;
1919
+ /**
1920
+ * What the archive holds for this node at all, whatever window was asked
1921
+ * for. A window outside it has no samples because we do not have them, which
1922
+ * is not the same as the node being quiet.
1923
+ */
1924
+ coverage: V1MeshTelemetryCoverage;
1925
+ /**
1926
+ * Window start actually used (after defaults and clamping).
1927
+ */
1928
+ from: string;
1929
+ /**
1930
+ * The requested node, normalized to the bare lowercase key (no `meshcore:`
1931
+ * prefix).
1932
+ */
1933
+ node: string;
1934
+ /**
1935
+ * Sample times where the node's uptime went backwards, i.e. it rebooted. Every
1936
+ * counter restarts there, so break counter lines at these times. Empty list
1937
+ * when none.
1938
+ */
1939
+ reboots: Array<string>;
1940
+ /**
1941
+ * Samples in the window, oldest first.
1942
+ */
1943
+ samples: Array<V1MeshTelemetrySample>;
1944
+ /**
1945
+ * Window end actually used.
1946
+ */
1947
+ to: string;
1948
+ /**
1949
+ * True when the window held more than the 20,000 samples one response carries;
1950
+ * the series ends early. Narrow the window to see the rest.
1951
+ */
1952
+ truncated: boolean;
1953
+ };
1954
+ /**
1955
+ * MeshTelemetryCoverage is the span of the whole archive for one node.
1956
+ */
1957
+ export type V1MeshTelemetryCoverage = {
1958
+ /**
1959
+ * Oldest archived sample. `null` when the archive holds none.
1960
+ */
1961
+ from: string | null;
1962
+ /**
1963
+ * Number of archived samples in total.
1964
+ */
1965
+ samples: number;
1966
+ /**
1967
+ * Newest archived sample. `null` when the archive holds none.
1968
+ */
1969
+ to: string | null;
1970
+ };
1971
+ /**
1972
+ * MeshTelemetrySample is one archived report.
1973
+ *
1974
+ */
1975
+ export type V1MeshTelemetrySample = {
1976
+ /**
1977
+ * The reading. `reading.reportedAt` is the sample's own time; gauges are
1978
+ * nullable exactly as on the live event.
1979
+ */
1980
+ reading: V1MeshAdminTelemetry;
1981
+ /**
1982
+ * When the Grid first stored it.
1983
+ */
1984
+ receivedAt: string;
1985
+ };
1986
+ /**
1987
+ * Place is a named geography that events attach to.
1988
+ */
1989
+ export type V1Place = {
1990
+ /**
1991
+ * The place's shape: a Polygon for counties and areas, a LineString for
1992
+ * corridors, a Point for towns.
1993
+ */
1994
+ geometry: V1Geometry;
1995
+ /**
1996
+ * Namespaced id, `{kind}:{slug}`.
1997
+ */
1998
+ id: string;
1999
+ /**
2000
+ * What kind of place this is.
2001
+ */
2002
+ kind: V1PlaceKind;
2003
+ /**
2004
+ * Display name.
2005
+ */
2006
+ name: string;
2007
+ /**
2008
+ * Id of the containing place (a town's county). Empty string when none.
2009
+ */
2010
+ parentId: string;
2011
+ /**
2012
+ * URL-safe short name, unique across all kinds. Use it in paths and the
2013
+ * `place` parameter.
2014
+ */
2015
+ slug: string;
2016
+ };
2017
+ /**
2018
+ * PlaceKind is the type of a place.
2019
+ *
2020
+ * - PLACE_KIND_UNSPECIFIED: Never returned.
2021
+ * - AREA: A configured coverage area such as `ebbetts-pass` (the Highway 4 corridor
2022
+ * region). Area places own the scanner feeds and the fire-weather zones.
2023
+ * - COUNTY: A county, from Census polygons.
2024
+ * - TOWN: A town, stored as a Point. `places:resolve` matches a town within 3 km of
2025
+ * its point. Events attach to a town only by overlapping polygons (and
2026
+ * wildfires by proximity), never by that radius.
2027
+ * - EVAC_ZONE: Reserved for evacuation zones as places; none exist today.
2028
+ * - CORRIDOR: A highway segment, stored as a LineString. Point events within about 1.5 km
2029
+ * of the line attach to it.
2030
+ * - SITE: Reserved for individual sites; none exist today.
2031
+ */
2032
+ export type V1PlaceKind = 'PLACE_KIND_UNSPECIFIED' | 'AREA' | 'COUNTY' | 'TOWN' | 'EVAC_ZONE' | 'CORRIDOR' | 'SITE';
2033
+ /**
2034
+ * PlaceList is the place directory.
2035
+ */
2036
+ export type V1PlaceList = {
2037
+ /**
2038
+ * Places, ordered by kind and then name.
2039
+ */
2040
+ places: Array<V1Place>;
2041
+ };
2042
+ /**
2043
+ * PlaceSummary is the one-call rollup for a place.
2044
+ *
2045
+ * `summary` covers hazards only. Each entry in `domains` covers one subject
2046
+ * area, including the ambient ones (`burn`, `comms`) that the hazard rollup
2047
+ * leaves out.
2048
+ */
2049
+ export type V1PlaceSummary = {
2050
+ /**
2051
+ * One block per domain, always in this order: `fire`, `evacuation`,
2052
+ * `weather`, `roads`, `seismic`, `power`, then `burn` (when burn counties are
2053
+ * configured) and `comms` (when the mesh source is enabled). Both are
2054
+ * configured in production.
2055
+ */
2056
+ domains: Array<V1SummaryDomain>;
2057
+ /**
2058
+ * When this summary was computed.
2059
+ */
2060
+ generatedAt: string;
2061
+ /**
2062
+ * Overall posture. The rules below are checked in order and the first match
2063
+ * wins.
2064
+ *
2065
+ * - `ACTIVE`: an active evacuation at ORDER, WARNING or SHELTER_IN_PLACE; or
2066
+ * any active EXTREME event; or an active wildfire at SEVERE or above.
2067
+ * - `WATCH`: any active SEVERE event; or an active evacuation ADVISORY; or
2068
+ * fire weather `elevated` (Fire Weather Watch) or `red-flag` (Red Flag
2069
+ * Warning) for a place inside a coverage area; or the evacuation source
2070
+ * UNAVAILABLE (unknown is never quiet); or any layer feeding the
2071
+ * summary UNAVAILABLE while an active event is MODERATE or above.
2072
+ * - `QUIET`: otherwise. A MODERATE or lower event on its own leaves the
2073
+ * place QUIET.
2074
+ *
2075
+ * Only these inputs can raise it: ACTIVE events on the WILDFIRE,
2076
+ * EVACUATION, WEATHER_ALERT, EARTHQUAKE, ROAD_INCIDENT and POWER layers
2077
+ * (by severity), the fire-weather state, and source health. These never
2078
+ * raise it: SCHEDULED events (a planned closure, a watch or PSPS not yet in
2079
+ * effect), MESH nodes, BURN_STATUS, INFO POWER outages, and every condition
2080
+ * other than fire weather. A CLOSED `road_segment` or a chain control
2081
+ * raises the `roads` domain's `highestSeverity`, not `mode`, so a place can
2082
+ * be QUIET with a closed highway. Show each domain's `status` and
2083
+ * `highestSeverity` alongside `mode`.
2084
+ */
2085
+ mode: 'QUIET' | 'WATCH' | 'ACTIVE';
2086
+ /**
2087
+ * The place's slug.
2088
+ */
2089
+ place: string;
2090
+ /**
2091
+ * The place's namespaced id.
2092
+ */
2093
+ placeId: string;
2094
+ /**
2095
+ * The place's display name.
2096
+ */
2097
+ placeName: string;
2098
+ /**
2099
+ * Health of the sources behind the summary's layers. Region-wide, not
2100
+ * specific to the place.
2101
+ */
2102
+ sources: Array<V1SummarySourceHealth>;
2103
+ /**
2104
+ * Cross-layer hazard rollup.
2105
+ */
2106
+ summary: V1SummaryStats;
2107
+ };
2108
+ /**
2109
+ * PowerDetail is the POWER detail block, for a PG&E outage or a Public Safety
2110
+ * Power Shutoff (PSPS). The envelope `category` says which: `unplanned` and
2111
+ * `planned` outages fill the outage fields; `psps` fills the PSPS fields. The
2112
+ * other group is zero, empty or `null`.
2113
+ *
2114
+ * Every PG&E time here is an estimate PG&E often overruns, so none of them is
2115
+ * mapped onto the envelope `expires` or drives the lifecycle.
2116
+ */
2117
+ export type V1PowerDetail = {
2118
+ /**
2119
+ * PG&E's planned all-clear time. A plan, not proof the shutoff ended: it is
2120
+ * set even while the stage is still Watch. Never use it to decide the power
2121
+ * is back; use `status`.
2122
+ *
2123
+ */
2124
+ allClear: string | null;
2125
+ /**
2126
+ * Raw PG&E cause code, e.g. "PLNND SHUTDOWN", "TREE CONTACT", "EMERG REPAIRS".
2127
+ * Empty string for PSPS.
2128
+ */
2129
+ cause: string;
2130
+ /**
2131
+ * PG&E crew status, verbatim: "Awaiting T-Man", "T-Man On Site", "Crew On
2132
+ * Site", "No Access", ... Empty string for PSPS.
2133
+ */
2134
+ crewStatus: string;
2135
+ /**
2136
+ * Estimated customers without power. 0 means PG&E gave no count. Statewide,
2137
+ * the median outage affects one customer.
2138
+ */
2139
+ customersAffected: number;
2140
+ /**
2141
+ * Planned end of de-energization (an estimate). `null` for outages.
2142
+ */
2143
+ deEnergizationEnd: string | null;
2144
+ /**
2145
+ * Planned start of de-energization. `null` for outages.
2146
+ */
2147
+ deEnergizationStart: string | null;
2148
+ /**
2149
+ * PG&E's estimated time of restoration. An estimate that is often missed;
2150
+ * `null` when not given.
2151
+ *
2152
+ */
2153
+ estimatedRestoration: string | null;
2154
+ /**
2155
+ * --- PSPS (source `psps`) ---
2156
+ * PG&E PSPS event id. Empty string for outages.
2157
+ */
2158
+ eventId: string;
2159
+ /**
2160
+ * PG&E PSPS event name. Empty string for outages.
2161
+ */
2162
+ eventName: string;
2163
+ /**
2164
+ * Medical-baseline customers in the shutoff footprint: people whose medical
2165
+ * equipment depends on grid power. No other feed reports this.
2166
+ */
2167
+ medicalBaselineAffected: number;
2168
+ /**
2169
+ * --- outage (source `pge`) ---
2170
+ * PG&E outage id, the native half of `pge:{id}`. Empty string for PSPS.
2171
+ */
2172
+ outageId: string;
2173
+ /**
2174
+ * PSPS stage: `Watch` (shutoff under consideration, MODERATE) or `Warning`
2175
+ * (shutoff committed, SEVERE). Empty string for outages.
2176
+ */
2177
+ stage: '' | 'Watch' | 'Warning';
2178
+ /**
2179
+ * The de-energization time-period slice this event covers. Empty string for
2180
+ * outages.
2181
+ */
2182
+ timePeriod: string;
2183
+ };
2184
+ /**
2185
+ * Provenance says which upstream published an event. Show `attribution` next to
2186
+ * the data.
2187
+ */
2188
+ export type V1Provenance = {
2189
+ /**
2190
+ * Attribution text to display, e.g. "CAL FIRE / FIRIS / NIFC". Can be an
2191
+ * empty string.
2192
+ */
2193
+ attribution: string;
2194
+ /**
2195
+ * When the Grid fetched the upstream data behind this revision.
2196
+ */
2197
+ fetchedAt: string;
2198
+ /**
2199
+ * Source registry id; joins to `Source.id` on `/api/v1/sources`.
2200
+ */
2201
+ sourceId: 'calfire' | 'firis' | 'caloes' | 'nws' | 'usgs' | 'chp' | 'caltrans' | 'pge' | 'psps' | 'meshcore' | 'burnline' | 'calfire-burn';
2202
+ /**
2203
+ * Display name of the publisher, e.g. "CAL FIRE", "NWS Sacramento CA",
2204
+ * "CHP / Caltrans".
2205
+ */
2206
+ sourceName: string;
2207
+ /**
2208
+ * Link to the publisher's page for this item or feed (for evacuations, the
2209
+ * Genasys or county zone viewer). Empty string when none, which today means
2210
+ * CHP incidents, Caltrans lane closures, FIRIS perimeters, NWS alerts and
2211
+ * burn status. Fall back to `Source.homepageUrl` for `sourceId`.
2212
+ */
2213
+ sourceUrl: string;
2214
+ };
2215
+ /**
2216
+ * ResolvePlaceResponse lists the places containing a point.
2217
+ */
2218
+ export type V1ResolvePlaceResponse = {
2219
+ /**
2220
+ * Containing places, most specific first. Empty when the point is outside
2221
+ * every place.
2222
+ */
2223
+ places: Array<V1Place>;
2224
+ /**
2225
+ * The point that was resolved.
2226
+ */
2227
+ query: V1ResolveQuery;
2228
+ };
2229
+ /**
2230
+ * ResolveQuery echoes the point that was resolved.
2231
+ */
2232
+ export type V1ResolveQuery = {
2233
+ /**
2234
+ * Latitude used for the lookup (the geocoded point for an address).
2235
+ */
2236
+ lat: number;
2237
+ /**
2238
+ * Longitude used for the lookup.
2239
+ */
2240
+ lng: number;
2241
+ /**
2242
+ * The address the geocoder matched, normalized. Empty string for a lat/lng
2243
+ * query.
2244
+ */
2245
+ matchedAddress: string;
2246
+ };
2247
+ /**
2248
+ * RoadIncidentDetail is the ROAD_INCIDENT detail block, for a CHP incident or a
2249
+ * Caltrans lane-closure window. The incident type is the envelope `category`,
2250
+ * the location is `areaLabel`, and the short line is `headline`.
2251
+ */
2252
+ export type V1RoadIncidentDetail = {
2253
+ /**
2254
+ * The Caltrans closure window, for source `caltrans` only; `null` for CHP
2255
+ * incidents.
2256
+ */
2257
+ closure: V1LaneClosureDetail | null;
2258
+ /**
2259
+ * AI-estimated duration (CHP incidents only). Empty string when not assessed.
2260
+ */
2261
+ duration: '' | 'unknown' | '< 1 hour' | 'several hours' | 'ongoing';
2262
+ /**
2263
+ * AI-assessed traffic impact (CHP incidents only); it drives `severity`.
2264
+ * Empty string for Caltrans closures and when not yet assessed.
2265
+ */
2266
+ impact: '' | 'none' | 'light' | 'moderate' | 'severe';
2267
+ /**
2268
+ * CHP log number for an incident; for a Caltrans closure, its closure id.
2269
+ */
2270
+ logNumber: string;
2271
+ /**
2272
+ * Free-form extras from the AI analysis, string to string (keys such as
2273
+ * `incident_type`, `lanes_blocked`, `injuries`). Keys vary; treat as display
2274
+ * only. Empty object when none.
2275
+ */
2276
+ metadata: {
2277
+ [key: string]: string;
2278
+ };
2279
+ };
2280
+ /**
2281
+ * Scanner is one Broadcastify audio feed.
2282
+ */
2283
+ export type V1Scanner = {
2284
+ /**
2285
+ * Agencies heard on it.
2286
+ */
2287
+ agency: string;
2288
+ /**
2289
+ * Listening page on Broadcastify.
2290
+ */
2291
+ broadcastifyUrl: string;
2292
+ /**
2293
+ * What the feed carries.
2294
+ */
2295
+ channelLabel: string;
2296
+ /**
2297
+ * Broadcastify feed id.
2298
+ */
2299
+ feedId: string;
2300
+ };
2301
+ /**
2302
+ * ScannerList is the scanner feeds.
2303
+ */
2304
+ export type V1ScannerList = {
2305
+ /**
2306
+ * Feeds, in configuration order.
2307
+ */
2308
+ scanners: Array<V1Scanner>;
2309
+ };
2310
+ /**
2311
+ * Severity is the unified 5-level scale shared by every layer: how urgently the
2312
+ * public should respond, not physical magnitude. The enum number is the rank
2313
+ * (`severityRank`, 0-4), for sorting and colour ramps.
2314
+ *
2315
+ * How each layer is graded. WILDFIRE: the worse of a containment floor (under
2316
+ * 50% contained SEVERE, 50-99% MODERATE, 100% MINOR) and size (1,000+ acres
2317
+ * under 50% contained EXTREME, 100+ acres SEVERE). EVACUATION: ORDER EXTREME,
2318
+ * WARNING and SHELTER_IN_PLACE SEVERE, ADVISORY MODERATE. WEATHER_ALERT: the NWS
2319
+ * severity (Extreme..Minor) one-to-one, otherwise INFO. EARTHQUAKE: M5+ SEVERE,
2320
+ * M4+ MODERATE, M2.5+ MINOR. ROAD_INCIDENT: a CHP incident by its AI-assessed
2321
+ * impact (severe SEVERE, moderate MODERATE, light MINOR, none INFO); a Caltrans
2322
+ * closure by its structure (full closure SEVERE, a travel lane or one-way
2323
+ * traffic MODERATE, shoulder only MINOR). POWER: 1,000+ customers SEVERE, 100+
2324
+ * MODERATE, 10+ MINOR, fewer INFO, unknown count MINOR, planned outages one rank
2325
+ * lower; PSPS Warning SEVERE, Watch MODERATE. MESH and BURN_STATUS: always INFO.
2326
+ * Condition layers on the map: road segment CLOSED SEVERE, restricted or heavy
2327
+ * congestion MODERATE; chain control R3 SEVERE, R2 MODERATE, R1 MINOR, road
2328
+ * closed MINOR; fire weather red-flag SEVERE, elevated MODERATE.
2329
+ *
2330
+ * - INFO: Rank 0. Informational: ambient state, single-customer outages, small quakes,
2331
+ * clear roads. Also the default when a source gives no grade.
2332
+ * - MINOR: Rank 1. Minor impact.
2333
+ * - MODERATE: Rank 2. Moderate impact; worth attention.
2334
+ * - SEVERE: Rank 3. Severe; act or prepare now.
2335
+ * - EXTREME: Rank 4. Extreme; life-safety (evacuation orders, large uncontained fires).
2336
+ */
2337
+ export type V1Severity = 'INFO' | 'MINOR' | 'MODERATE' | 'SEVERE' | 'EXTREME';
2338
+ /**
2339
+ * Source is one row of the source registry, with its health.
2340
+ *
2341
+ * Two kinds of row, told apart by `kind`: a FEED is an upstream the Grid
2342
+ * fetches on a schedule, and its id is what events carry in
2343
+ * `provenance.sourceId`. A REPORTER is an operator-run monitor that pushes data
2344
+ * to the Grid (`alanpi`, `relay`, `burn-line`); its row carries health only and
2345
+ * no event names it as its source.
2346
+ *
2347
+ * To judge health, read `status`. It is rewritten at every attempt, so as a
2348
+ * second check against the Grid itself stalling, treat a row as suspect when
2349
+ * `lastAttemptAt` is older than `staleAfterSeconds`. Do not compare
2350
+ * `lastAttemptAt` with `pollIntervalSeconds`: that misfires for reporters.
2351
+ *
2352
+ * Not every source id that appears in the API has a row. The live condition
2353
+ * layers fetch on request, outside the scheduler that writes this registry, so
2354
+ * `google` (the `road_segment` layer's travel times) has no row, and the
2355
+ * `caltrans` and `nws` rows describe the scheduled lane-closure and alert
2356
+ * polls, not the live `chain_control`, `message_sign`, `road_segment` and
2357
+ * `fire_weather` fetches. For those layers read the map layer's
2358
+ * `metadata.sourceStatus` or the summary domain's `status`.
2359
+ */
2360
+ export type V1Source = {
2361
+ /**
2362
+ * Attribution text to display.
2363
+ */
2364
+ attribution: string;
2365
+ /**
2366
+ * For sources whose silence proves nothing (NWS, FIRIS, MeshCore): how long,
2367
+ * in seconds, an event may go unseen before it is EXPIRED. 0 means the source
2368
+ * never auto-expires; its events are RESOLVED when a good poll stops listing
2369
+ * them.
2370
+ */
2371
+ expireAfterSeconds: number;
2372
+ /**
2373
+ * Public page for the upstream. Use it as the fallback link for an event
2374
+ * whose `canonicalUrl` and `provenance.sourceUrl` are empty (join on
2375
+ * `provenance.sourceId`). Empty string for REPORTER rows, and for a feed with
2376
+ * no public page.
2377
+ */
2378
+ homepageUrl: string;
2379
+ /**
2380
+ * Registry id; `Provenance.sourceId` on events joins to it (FEED rows only).
2381
+ */
2382
+ id: string;
2383
+ /**
2384
+ * Whether this row is a scheduled feed or a push reporter.
2385
+ */
2386
+ kind: V1SourceKind;
2387
+ /**
2388
+ * When the row was last evaluated, successfully or not. `null` if never.
2389
+ * `status` is rewritten at each attempt, so if this is older than
2390
+ * `staleAfterSeconds`, the Grid itself has stopped checking: treat the
2391
+ * source as STALE whatever `status` says.
2392
+ */
2393
+ lastAttemptAt: string | null;
2394
+ /**
2395
+ * The last attempt's error text. Empty string after a success.
2396
+ */
2397
+ lastError: string;
2398
+ /**
2399
+ * When an attempt last succeeded. `null` if never. For a REPORTER this is the
2400
+ * last check that found it reporting on time, not the time of its last
2401
+ * report (`lastError` names that once it goes quiet).
2402
+ */
2403
+ lastSuccessAt: string | null;
2404
+ /**
2405
+ * Display name, e.g. "CHP (traffic incidents)".
2406
+ */
2407
+ name: string;
2408
+ /**
2409
+ * How often, in seconds, the Grid re-evaluates this row. For a FEED that is
2410
+ * its poll interval. For a REPORTER it is the cadence of the Grid's check on
2411
+ * the reporter, not how often the reporter reports.
2412
+ */
2413
+ pollIntervalSeconds: number;
2414
+ /**
2415
+ * For a FEED: seconds after the last success during which a failing source
2416
+ * still reads STALE rather than UNAVAILABLE (default three poll intervals).
2417
+ * For a REPORTER: how long it may go without reporting before it stops
2418
+ * reading OK (it then reads STALE for this long again, then UNAVAILABLE).
2419
+ */
2420
+ staleAfterSeconds: number;
2421
+ /**
2422
+ * Health of this source. This is the field to judge it by; see the message
2423
+ * description.
2424
+ */
2425
+ status: V1SourceStatus;
2426
+ };
2427
+ /**
2428
+ * SourceKind says what a source registry row describes.
2429
+ *
2430
+ * - SOURCE_KIND_UNSPECIFIED: Never returned.
2431
+ * - FEED: An upstream feed the Grid fetches on a schedule (CAL FIRE, NWS, PG&E, ...).
2432
+ * Events name it in `provenance.sourceId`.
2433
+ * - REPORTER: An operator-run monitor that pushes to the Grid's ingest endpoint. Health
2434
+ * only: no event carries its id, and `homepageUrl` is empty.
2435
+ */
2436
+ export type V1SourceKind = 'SOURCE_KIND_UNSPECIFIED' | 'FEED' | 'REPORTER';
2437
+ /**
2438
+ * SourceList is the source registry.
2439
+ */
2440
+ export type V1SourceList = {
2441
+ /**
2442
+ * Every source, ordered by id, including the health-only push-reporter rows.
2443
+ */
2444
+ sources: Array<V1Source>;
2445
+ };
2446
+ /**
2447
+ * SourceStatus is a source's health. The same three values appear as strings in
2448
+ * the summary's domains and sidecar, on `/api/v1/cameras`, and on the map
2449
+ * layers' `metadata.sourceStatus`.
2450
+ *
2451
+ * - SOURCE_STATUS_UNSPECIFIED: Not polled yet since the registry row was created. Treat as UNAVAILABLE.
2452
+ * - OK: The last attempt succeeded.
2453
+ * - STALE: The last attempt failed, but the last success is within
2454
+ * `staleAfterSeconds`; what is served is last-good data.
2455
+ * - UNAVAILABLE: Failing beyond `staleAfterSeconds`, or never succeeded. Nothing current can
2456
+ * be vouched for: render "unknown", never "none".
2457
+ */
2458
+ export type V1SourceStatus = 'SOURCE_STATUS_UNSPECIFIED' | 'OK' | 'STALE' | 'UNAVAILABLE';
2459
+ /**
2460
+ * SummaryDomain is one subject area's status for the place.
2461
+ *
2462
+ * Domain inputs: `fire` = WILDFIRE events + the fire_weather condition;
2463
+ * `evacuation` = EVACUATION; `weather` = WEATHER_ALERT; `roads` = ROAD_INCIDENT
2464
+ * events (not SCHEDULED roadwork) + the chain_control and road_segment
2465
+ * conditions; `seismic` = EARTHQUAKE; `power` = POWER (including INFO
2466
+ * outages); `burn` = BURN_STATUS; `comms` = MESH. A domain counts every one of
2467
+ * its ACTIVE and SCHEDULED events at any severity, but a condition only when it
2468
+ * is above INFO (an open road or normal fire weather is not "active").
2469
+ */
2470
+ export type V1SummaryDomain = {
2471
+ /**
2472
+ * Number of counted items (events plus above-INFO conditions). It can be
2473
+ * non-zero while `summary.totalActive` is 0: `comms` counts mesh nodes,
2474
+ * `burn` counts burn status, and `power` counts INFO outages.
2475
+ */
2476
+ activeCount: number;
2477
+ /**
2478
+ * Domain name.
2479
+ */
2480
+ domain: 'fire' | 'evacuation' | 'weather' | 'roads' | 'seismic' | 'power' | 'burn' | 'comms';
2481
+ /**
2482
+ * Up to three counted items, most severe first (events before conditions on
2483
+ * ties). An item is an event OR a condition-layer feature; check `kind`.
2484
+ */
2485
+ headlines: Array<V1SummaryDomainHeadline>;
2486
+ /**
2487
+ * Highest severity among the domain's counted items; `INFO` when none.
2488
+ */
2489
+ highestSeverity: 'INFO' | 'MINOR' | 'MODERATE' | 'SEVERE' | 'EXTREME';
2490
+ /**
2491
+ * The WORST source status across the domain's layers, so partial data never
2492
+ * presents as complete. A failing source with stored events reads STALE.
2493
+ */
2494
+ status: 'OK' | 'STALE' | 'UNAVAILABLE';
2495
+ };
2496
+ /**
2497
+ * SummaryDomainHeadline is one item in a domain's headline list: an event, or a
2498
+ * live condition-layer feature (a closed road segment, a chain control, a fire
2499
+ * weather banner). Use `kind` to tell them apart before following `id`.
2500
+ */
2501
+ export type V1SummaryDomainHeadline = {
2502
+ /**
2503
+ * The item's headline.
2504
+ */
2505
+ headline: string;
2506
+ /**
2507
+ * The item's id. For `kind: EVENT` an event id, fetchable at
2508
+ * `GET /api/v1/events/{id}`. For `kind: CONDITION` a map-feature id
2509
+ * (`road:{segment}`, `cc:{checkpoint}`, `fw:region`): it is NOT an event and
2510
+ * `GET /api/v1/events/{id}` returns 404. Find it as `properties.id` in the
2511
+ * place's `{layer}.geojson` map layer (the layer slug is `layer` lowercased).
2512
+ */
2513
+ id: string;
2514
+ /**
2515
+ * `EVENT` when `id` is a stored event, `CONDITION` when it is a live
2516
+ * condition-layer map feature with no event record.
2517
+ */
2518
+ kind: 'EVENT' | 'CONDITION';
2519
+ /**
2520
+ * The item's layer, UPPERCASE. For an event, its `Event.layer`. For a
2521
+ * condition, the condition layer (`ROAD_SEGMENT`, `CHAIN_CONTROL`,
2522
+ * `FIRE_WEATHER`); lowercase it for the `.geojson` map-layer path.
2523
+ */
2524
+ layer: 'WILDFIRE' | 'EVACUATION' | 'WEATHER_ALERT' | 'EARTHQUAKE' | 'ROAD_INCIDENT' | 'POWER' | 'MESH' | 'BURN_STATUS' | 'ROAD_SEGMENT' | 'CHAIN_CONTROL' | 'FIRE_WEATHER';
2525
+ /**
2526
+ * The item's severity.
2527
+ */
2528
+ severity: 'INFO' | 'MINOR' | 'MODERATE' | 'SEVERE' | 'EXTREME';
2529
+ };
2530
+ /**
2531
+ * SummarySourceHealth is one source registry row behind the summary's layers.
2532
+ */
2533
+ export type V1SummarySourceHealth = {
2534
+ /**
2535
+ * Source id, as on `/api/v1/sources`.
2536
+ */
2537
+ id: string;
2538
+ /**
2539
+ * When the source last polled successfully. `null` if never.
2540
+ */
2541
+ lastSuccessAt: string | null;
2542
+ /**
2543
+ * The source's health. A source never polled reads `UNAVAILABLE`.
2544
+ */
2545
+ status: 'OK' | 'STALE' | 'UNAVAILABLE';
2546
+ };
2547
+ /**
2548
+ * SummaryStats is the place's hazard rollup.
2549
+ *
2550
+ * It counts the place's ACTIVE and SCHEDULED events except four carve-outs:
2551
+ * MESH nodes and BURN_STATUS (ambient state, shown in their own domains), POWER
2552
+ * outages at INFO (single-customer service calls), and SCHEDULED road closures
2553
+ * (planned roadwork). A SCHEDULED weather watch or PSPS still counts. Condition
2554
+ * layers never count here.
2555
+ */
2556
+ export type V1SummaryStats = {
2557
+ /**
2558
+ * ACTIVE evacuation zones attached to the place. NULLABLE: `null` when the
2559
+ * evacuation source is UNAVAILABLE with nothing stored (unknown: render
2560
+ * "unknown, check Genasys", never "none"). `0` means a healthy fetch found no
2561
+ * active zone ("no active evacuations reported", not a guarantee). Never
2562
+ * coerce `null` to 0.
2563
+ */
2564
+ activeEvacuations: number | null;
2565
+ /**
2566
+ * The authoritative evacuation viewer (Genasys Protect), the same link as
2567
+ * the `evacuation` map layer's `metadata.sourceUrl`. Always set, whatever
2568
+ * `evacuationStatus` says: it is where to send people when the count is
2569
+ * `null` ("unknown, check Genasys") and the place to confirm a 0 or an N.
2570
+ * For one zone's own page use the event's `provenance.sourceUrl`.
2571
+ */
2572
+ evacuationSourceUrl: string;
2573
+ /**
2574
+ * Health of the evacuation source as served: `OK`, `STALE` (source failing
2575
+ * but stored zones are served; the count is last-good) or `UNAVAILABLE`
2576
+ * (then `activeEvacuations` is `null`).
2577
+ */
2578
+ evacuationStatus: 'OK' | 'STALE' | 'UNAVAILABLE';
2579
+ /**
2580
+ * Highest severity among the counted events; `INFO` when there are none.
2581
+ */
2582
+ highestSeverity: 'INFO' | 'MINOR' | 'MODERATE' | 'SEVERE' | 'EXTREME';
2583
+ /**
2584
+ * Rank of `highestSeverity`, 0 (INFO) to 4 (EXTREME).
2585
+ */
2586
+ highestSeverityRank: number;
2587
+ /**
2588
+ * Count of counted events per severity name (`INFO` .. `EXTREME`). A severity
2589
+ * with no events is absent rather than 0.
2590
+ */
2591
+ severityCounts: {
2592
+ [key: string]: number;
2593
+ };
2594
+ /**
2595
+ * Up to five counted events, most severe first, then most recently observed.
2596
+ * Every id here is an event (`GET /api/v1/events/{id}`).
2597
+ */
2598
+ topEvents: Array<V1SummaryTopEvent>;
2599
+ /**
2600
+ * Number of counted events (ACTIVE and SCHEDULED, after the carve-outs).
2601
+ */
2602
+ totalActive: number;
2603
+ };
2604
+ /**
2605
+ * SummaryTopEvent is one of the place's most urgent hazard events.
2606
+ */
2607
+ export type V1SummaryTopEvent = {
2608
+ /**
2609
+ * The event's headline.
2610
+ */
2611
+ headline: string;
2612
+ /**
2613
+ * Event id, fetchable at `GET /api/v1/events/{id}`.
2614
+ */
2615
+ id: string;
2616
+ /**
2617
+ * The event's layer as the UPPERCASE enum name, the same value as
2618
+ * `Event.layer`. Never MESH or BURN_STATUS (excluded from the rollup).
2619
+ */
2620
+ layer: 'WILDFIRE' | 'EVACUATION' | 'WEATHER_ALERT' | 'EARTHQUAKE' | 'ROAD_INCIDENT' | 'POWER';
2621
+ /**
2622
+ * The event's severity.
2623
+ */
2624
+ severity: 'INFO' | 'MINOR' | 'MODERATE' | 'SEVERE' | 'EXTREME';
2625
+ /**
2626
+ * Rank of `severity`, 0-4.
2627
+ */
2628
+ severityRank: number;
2629
+ /**
2630
+ * The event's source id (`provenance.sourceId`).
2631
+ */
2632
+ source: string;
2633
+ };
2634
+ /**
2635
+ * WeatherAlertDetail is the WEATHER_ALERT detail block, for one NWS product.
2636
+ *
2637
+ * It carries only fields the envelope lacks: the NWS event name is the
2638
+ * envelope `category`, and the issuing office is `provenance.sourceName`.
2639
+ */
2640
+ export type V1WeatherAlertDetail = {
2641
+ /**
2642
+ * NWS free-text list of the affected zones.
2643
+ */
2644
+ areaDesc: string;
2645
+ /**
2646
+ * NWS certainty.
2647
+ */
2648
+ certainty: 'Observed' | 'Likely' | 'Possible' | 'Unlikely' | 'Unknown';
2649
+ /**
2650
+ * NWS recommended actions, verbatim, with newlines. Empty string when none.
2651
+ */
2652
+ instruction: string;
2653
+ /**
2654
+ * NWS's own severity word, distinct from the unified `severity` it maps to.
2655
+ */
2656
+ nwsSeverity: 'Extreme' | 'Severe' | 'Moderate' | 'Minor' | 'Unknown';
2657
+ /**
2658
+ * NWS urgency.
2659
+ */
2660
+ urgency: 'Immediate' | 'Expected' | 'Future' | 'Past' | 'Unknown';
2661
+ /**
2662
+ * NWS forecast zone codes the alert covers, e.g. "CAZ138".
2663
+ */
2664
+ zones: Array<string>;
2665
+ };
2666
+ /**
2667
+ * WeatherConditions is current weather at one location, from OpenWeatherMap.
2668
+ * Whole numbers, metric units. A value that could not be read is 0.
2669
+ */
2670
+ export type V1WeatherConditions = {
2671
+ /**
2672
+ * Feels-like temperature, degrees Celsius.
2673
+ */
2674
+ feelsLikeCelsius: number;
2675
+ /**
2676
+ * Relative humidity, percent.
2677
+ */
2678
+ humidityPercent: number;
2679
+ /**
2680
+ * Location id; joins to `WeatherForecast.locationId`.
2681
+ */
2682
+ locationId: string;
2683
+ /**
2684
+ * Display name.
2685
+ */
2686
+ locationName: string;
2687
+ /**
2688
+ * Air temperature, degrees Celsius.
2689
+ */
2690
+ temperatureCelsius: number;
2691
+ /**
2692
+ * Visibility, km (OpenWeatherMap caps it at 10).
2693
+ */
2694
+ visibilityKm: number;
2695
+ /**
2696
+ * OpenWeatherMap description, lowercase, e.g. "clear sky".
2697
+ */
2698
+ weatherDescription: string;
2699
+ /**
2700
+ * OpenWeatherMap icon code; the image is
2701
+ * `https://openweathermap.org/img/wn/{icon}@2x.png`.
2702
+ */
2703
+ weatherIcon: string;
2704
+ /**
2705
+ * OpenWeatherMap condition group: "Clear", "Clouds", "Rain", "Snow",
2706
+ * "Thunderstorm", "Drizzle", "Mist", ...
2707
+ */
2708
+ weatherMain: string;
2709
+ /**
2710
+ * Direction the wind blows FROM, degrees clockwise from north.
2711
+ */
2712
+ windDirectionDegrees: number;
2713
+ /**
2714
+ * Wind speed, km/h.
2715
+ */
2716
+ windSpeedKmh: number;
2717
+ };
2718
+ /**
2719
+ * WeatherForecast is a location's short-range forecast: the hourly NWS gridpoint
2720
+ * series (wind, gust, humidity, temperature) plus an at-a-glance summary.
2721
+ * Informational only: it never implies a fire-weather warning (issued products
2722
+ * are in `fireWeather`).
2723
+ *
2724
+ */
2725
+ export type V1WeatherForecast = {
2726
+ /**
2727
+ * Hours covered by `periods`.
2728
+ */
2729
+ horizonHours: number;
2730
+ /**
2731
+ * When NWS last updated the grid. Can be `null`.
2732
+ */
2733
+ issuedAt: string | null;
2734
+ /**
2735
+ * Location id; joins to `WeatherConditions.locationId`.
2736
+ */
2737
+ locationId: string;
2738
+ /**
2739
+ * Lowest relative humidity over the horizon, percent. 0 when NWS gave none.
2740
+ */
2741
+ minHumidityPercent: number;
2742
+ /**
2743
+ * When that peak gust is forecast. Can be `null`.
2744
+ */
2745
+ peakWindGustAt: string | null;
2746
+ /**
2747
+ * Highest wind gust over the horizon, km/h.
2748
+ */
2749
+ peakWindGustKmh: number;
2750
+ /**
2751
+ * Hourly periods, in time order.
2752
+ */
2753
+ periods: Array<V1ForecastPeriod>;
2754
+ /**
2755
+ * Data source and NWS grid cell.
2756
+ */
2757
+ source: string;
2758
+ };
2759
+ /**
2760
+ * WildfireDetail is the WILDFIRE detail block.
2761
+ */
2762
+ export type V1WildfireDetail = {
2763
+ /**
2764
+ * Burned area in acres: CAL FIRE's figure, or the FIRIS perimeter's area when
2765
+ * only a perimeter is known. Fractional.
2766
+ */
2767
+ acres: number;
2768
+ /**
2769
+ * Cause as reported. Empty string when unknown.
2770
+ */
2771
+ cause: string;
2772
+ /**
2773
+ * Percent contained, 0-100. 0 also when unknown (perimeter-only fires).
2774
+ */
2775
+ containment: number;
2776
+ /**
2777
+ * County named by CAL FIRE. Empty string for perimeter-only fires.
2778
+ */
2779
+ county: string;
2780
+ /**
2781
+ * True when `geometry` is a FIRIS perimeter polygon; false when it is CAL
2782
+ * FIRE's single origin point.
2783
+ */
2784
+ hasPerimeter: boolean;
2785
+ };
2786
+ /**
2787
+ * An `ETag` from an earlier response, for a `304` revalidation.
2788
+ */
2789
+ export type IfNoneMatch = string;
2790
+ /**
2791
+ * Recency window for relay links: a positive Go duration. The documented
2792
+ * choices are `24h`, `72h` (the default), `168h` and `720h`; any positive
2793
+ * duration works (`90m`), and values above `9600h` (400 days) are
2794
+ * clamped. Anything else (`abc`, `0`, `-1h`) is a `400
2795
+ * INVALID_ARGUMENT`. `/api/v1/mesh/links` echoes the applied window in
2796
+ * `window`.
2797
+ *
2798
+ */
2799
+ export type MeshWindow = string;
2800
+ /**
2801
+ * A place slug (`calaveras-county`, `ebbetts-pass`, `hwy4-murphys-arnold`)
2802
+ * or namespaced id (`county:calaveras-county`). Slugs are globally unique.
2803
+ * `GET /api/v1/places` lists them; `GET /api/v1/places:resolve` maps an
2804
+ * address or lat/lng to the places containing it.
2805
+ *
2806
+ */
2807
+ export type Place = string;
2808
+ export type GridServiceListCamerasData = {
2809
+ body?: never;
2810
+ path?: never;
2811
+ query?: {
2812
+ /**
2813
+ * Only cameras within 25 km of this place (slug or id), nearest first.
2814
+ * Default: every camera near any coverage area.
2815
+ */
2816
+ place?: string;
2817
+ };
2818
+ url: '/api/v1/cameras';
2819
+ };
2820
+ export type GridServiceListCamerasErrors = {
2821
+ /**
2822
+ * NOT_FOUND: unknown place.
2823
+ */
2824
+ 404: RpcStatus;
2825
+ /**
2826
+ * An unexpected error response.
2827
+ */
2828
+ default: RpcStatus;
2829
+ };
2830
+ export type GridServiceListCamerasError = GridServiceListCamerasErrors[keyof GridServiceListCamerasErrors];
2831
+ export type GridServiceListCamerasResponses = {
2832
+ /**
2833
+ * A successful response.
2834
+ */
2835
+ 200: V1CameraList;
2836
+ };
2837
+ export type GridServiceListCamerasResponse = GridServiceListCamerasResponses[keyof GridServiceListCamerasResponses];
2838
+ export type GridServiceGetConditionsData = {
2839
+ body?: never;
2840
+ path?: never;
2841
+ query?: {
2842
+ /**
2843
+ * Only weather locations inside this place's bounding box (slug or id). Does
2844
+ * not filter `fireWeather`.
2845
+ */
2846
+ place?: string;
2847
+ };
2848
+ url: '/api/v1/conditions';
2849
+ };
2850
+ export type GridServiceGetConditionsErrors = {
2851
+ /**
2852
+ * NOT_FOUND: unknown place.
2853
+ */
2854
+ 404: RpcStatus;
2855
+ /**
2856
+ * An unexpected error response.
2857
+ */
2858
+ default: RpcStatus;
2859
+ };
2860
+ export type GridServiceGetConditionsError = GridServiceGetConditionsErrors[keyof GridServiceGetConditionsErrors];
2861
+ export type GridServiceGetConditionsResponses = {
2862
+ /**
2863
+ * A successful response.
2864
+ */
2865
+ 200: V1Conditions;
2866
+ };
2867
+ export type GridServiceGetConditionsResponse = GridServiceGetConditionsResponses[keyof GridServiceGetConditionsResponses];
2868
+ export type GridServiceListEventsData = {
2869
+ body?: never;
2870
+ path?: never;
2871
+ query?: {
2872
+ /**
2873
+ * Only events attached to this place: slug (`arnold`) or namespaced id
2874
+ * (`town:arnold`). Omit for every place, including events outside all places.
2875
+ */
2876
+ place?: string;
2877
+ /**
2878
+ * Only these layers. Repeat the parameter or comma-separate. Case-insensitive;
2879
+ * lowercase slugs (`road_incident`) and the aliases `mesh_node` and `network`
2880
+ * (for MESH) also work. FIRE_WEATHER, GAUGE, AIR_QUALITY and ANNOUNCEMENT are
2881
+ * accepted but no events carry them. Default: every layer.
2882
+ */
2883
+ layer?: Array<'WILDFIRE' | 'EVACUATION' | 'WEATHER_ALERT' | 'EARTHQUAKE' | 'ROAD_INCIDENT' | 'POWER' | 'MESH' | 'BURN_STATUS'>;
2884
+ /**
2885
+ * Only these statuses. Repeat the parameter or comma-separate.
2886
+ * Case-insensitive. Default: ACTIVE and SCHEDULED. Pass `ACTIVE` alone to drop
2887
+ * planned roadwork; add RESOLVED and EXPIRED to include ended events.
2888
+ */
2889
+ status?: Array<'ACTIVE' | 'SCHEDULED' | 'RESOLVED' | 'EXPIRED'>;
2890
+ /**
2891
+ * Only events at this severity or above. Case-insensitive. Default: no
2892
+ * minimum (same as INFO). `MINOR` drops mesh nodes, burn status and
2893
+ * single-customer outages.
2894
+ */
2895
+ severityMin?: 'INFO' | 'MINOR' | 'MODERATE' | 'SEVERE' | 'EXTREME';
2896
+ /**
2897
+ * Only events whose `observedAt` is at or after this RFC 3339 time, e.g.
2898
+ * `2026-11-06T00:00:00Z`.
2899
+ */
2900
+ since?: string;
2901
+ /**
2902
+ * Most events per page. 0 or omitted means the default of 50; values over
2903
+ * 200 are clamped to 200; a negative value is a 400 INVALID_ARGUMENT. A page
2904
+ * can hold FEWER events than this, because it also stops before its encoded
2905
+ * size passes about 3 MiB (perimeter-heavy events): keep requesting while
2906
+ * `nextPageToken` is non-empty, and never treat a short page as the end.
2907
+ */
2908
+ pageSize?: number;
2909
+ /**
2910
+ * The previous page's `nextPageToken`. Omit for the first page.
2911
+ */
2912
+ pageToken?: string;
2913
+ /**
2914
+ * Include the AI model's full prompt and response (`enhancement.request` and
2915
+ * `enhancement.response`). Large; default false, which returns them as empty
2916
+ * strings.
2917
+ */
2918
+ enhancementIo?: boolean;
2919
+ /**
2920
+ * How each event's `geometry` carries its GeoJSON. `BASE64` (default, the
2921
+ * legacy form): the base64 `geometry.geojson` string. `OBJECT`: a plain
2922
+ * JSON object in `geometry.object`, with `geometry.geojson` empty.
2923
+ * Case-insensitive; anything else is a 400.
2924
+ */
2925
+ geometryFormat?: 'BASE64' | 'OBJECT';
2926
+ };
2927
+ url: '/api/v1/events';
2928
+ };
2929
+ export type GridServiceListEventsErrors = {
2930
+ /**
2931
+ * INVALID_ARGUMENT: an unknown layer, status, severity or geometryFormat, a timestamp that is not RFC 3339, a negative page size, or a bad page token.
2932
+ */
2933
+ 400: RpcStatus;
2934
+ /**
2935
+ * NOT_FOUND: unknown place.
2936
+ */
2937
+ 404: RpcStatus;
2938
+ /**
2939
+ * An unexpected error response.
2940
+ */
2941
+ default: RpcStatus;
2942
+ };
2943
+ export type GridServiceListEventsError = GridServiceListEventsErrors[keyof GridServiceListEventsErrors];
2944
+ export type GridServiceListEventsResponses = {
2945
+ /**
2946
+ * A successful response.
2947
+ */
2948
+ 200: V1EventList;
2949
+ };
2950
+ export type GridServiceListEventsResponse = GridServiceListEventsResponses[keyof GridServiceListEventsResponses];
2951
+ export type GridServiceGetEventData = {
2952
+ body?: never;
2953
+ path: {
2954
+ /**
2955
+ * Event id, e.g. `chp:261106ST0341` or `burn:calaveras-county`.
2956
+ */
2957
+ id: string;
2958
+ };
2959
+ query?: {
2960
+ /**
2961
+ * Include `enhancement.request` and `enhancement.response`. Default false.
2962
+ */
2963
+ enhancementIo?: boolean;
2964
+ /**
2965
+ * `BASE64` (default, legacy) or `OBJECT`; same as on `/api/v1/events`.
2966
+ */
2967
+ geometryFormat?: 'BASE64' | 'OBJECT';
2968
+ };
2969
+ url: '/api/v1/events/{id}';
2970
+ };
2971
+ export type GridServiceGetEventErrors = {
2972
+ /**
2973
+ * INVALID_ARGUMENT: an unknown geometryFormat.
2974
+ */
2975
+ 400: RpcStatus;
2976
+ /**
2977
+ * NOT_FOUND: no event has this id.
2978
+ */
2979
+ 404: RpcStatus;
2980
+ /**
2981
+ * An unexpected error response.
2982
+ */
2983
+ default: RpcStatus;
2984
+ };
2985
+ export type GridServiceGetEventError = GridServiceGetEventErrors[keyof GridServiceGetEventErrors];
2986
+ export type GridServiceGetEventResponses = {
2987
+ /**
2988
+ * A successful response.
2989
+ */
2990
+ 200: V1Event;
2991
+ };
2992
+ export type GridServiceGetEventResponse = GridServiceGetEventResponses[keyof GridServiceGetEventResponses];
2993
+ export type GridServiceGetEventHistoryData = {
2994
+ body?: never;
2995
+ path: {
2996
+ /**
2997
+ * Event id.
2998
+ */
2999
+ id: string;
3000
+ };
3001
+ query?: {
3002
+ /**
3003
+ * Most revisions per page. 0 or omitted means the default of 50; values
3004
+ * over 200 are clamped to 200; a negative value is a 400 INVALID_ARGUMENT. A
3005
+ * page can hold fewer (it stops at about 3 MiB encoded): follow
3006
+ * `nextPageToken` until it is empty.
3007
+ */
3008
+ pageSize?: number;
3009
+ /**
3010
+ * The previous page's `nextPageToken`. Omit for the first page.
3011
+ */
3012
+ pageToken?: string;
3013
+ /**
3014
+ * Include `enhancement.request` and `enhancement.response`. Default false.
3015
+ */
3016
+ enhancementIo?: boolean;
3017
+ /**
3018
+ * `BASE64` (default, legacy) or `OBJECT`; same as on `/api/v1/events`.
3019
+ */
3020
+ geometryFormat?: 'BASE64' | 'OBJECT';
3021
+ };
3022
+ url: '/api/v1/events/{id}/history';
3023
+ };
3024
+ export type GridServiceGetEventHistoryErrors = {
3025
+ /**
3026
+ * INVALID_ARGUMENT: a negative page size, a bad page token, or an unknown geometryFormat.
3027
+ */
3028
+ 400: RpcStatus;
3029
+ /**
3030
+ * NOT_FOUND: no event has this id.
3031
+ */
3032
+ 404: RpcStatus;
3033
+ /**
3034
+ * An unexpected error response.
3035
+ */
3036
+ default: RpcStatus;
3037
+ };
3038
+ export type GridServiceGetEventHistoryError = GridServiceGetEventHistoryErrors[keyof GridServiceGetEventHistoryErrors];
3039
+ export type GridServiceGetEventHistoryResponses = {
3040
+ /**
3041
+ * A successful response.
3042
+ */
3043
+ 200: V1EventRevisionList;
3044
+ };
3045
+ export type GridServiceGetEventHistoryResponse = GridServiceGetEventHistoryResponses[keyof GridServiceGetEventHistoryResponses];
3046
+ export type GridServiceListHistoryData = {
3047
+ body?: never;
3048
+ path?: never;
3049
+ query?: {
3050
+ /**
3051
+ * Only revisions of events currently attached to this place (slug or id).
3052
+ */
3053
+ place?: string;
3054
+ /**
3055
+ * Only these layers; same rules as on `/api/v1/events`.
3056
+ */
3057
+ layer?: Array<'WILDFIRE' | 'EVACUATION' | 'WEATHER_ALERT' | 'EARTHQUAKE' | 'ROAD_INCIDENT' | 'POWER' | 'MESH' | 'BURN_STATUS'>;
3058
+ /**
3059
+ * Window start on each revision's `observedAt`, RFC 3339, inclusive. Default:
3060
+ * no lower bound.
3061
+ */
3062
+ from?: string;
3063
+ /**
3064
+ * Window end, RFC 3339, exclusive. Default: no upper bound.
3065
+ */
3066
+ to?: string;
3067
+ /**
3068
+ * Most revisions per page. 0 or omitted means the default of 50; values
3069
+ * over 200 are clamped to 200; a negative value is a 400 INVALID_ARGUMENT. A
3070
+ * page can hold fewer (it stops at about 3 MiB encoded): follow
3071
+ * `nextPageToken` until it is empty.
3072
+ */
3073
+ pageSize?: number;
3074
+ /**
3075
+ * The previous page's `nextPageToken`. Omit for the first page.
3076
+ */
3077
+ pageToken?: string;
3078
+ /**
3079
+ * Include `enhancement.request` and `enhancement.response`. Default false.
3080
+ */
3081
+ enhancementIo?: boolean;
3082
+ /**
3083
+ * `BASE64` (default, legacy) or `OBJECT`; same as on `/api/v1/events`.
3084
+ */
3085
+ geometryFormat?: 'BASE64' | 'OBJECT';
3086
+ };
3087
+ url: '/api/v1/history';
3088
+ };
3089
+ export type GridServiceListHistoryErrors = {
3090
+ /**
3091
+ * INVALID_ARGUMENT: an unknown layer or geometryFormat, a timestamp that is not RFC 3339, a negative page size, or a bad page token.
3092
+ */
3093
+ 400: RpcStatus;
3094
+ /**
3095
+ * NOT_FOUND: unknown place.
3096
+ */
3097
+ 404: RpcStatus;
3098
+ /**
3099
+ * An unexpected error response.
3100
+ */
3101
+ default: RpcStatus;
3102
+ };
3103
+ export type GridServiceListHistoryError = GridServiceListHistoryErrors[keyof GridServiceListHistoryErrors];
3104
+ export type GridServiceListHistoryResponses = {
3105
+ /**
3106
+ * A successful response.
3107
+ */
3108
+ 200: V1EventRevisionList;
3109
+ };
3110
+ export type GridServiceListHistoryResponse = GridServiceListHistoryResponses[keyof GridServiceListHistoryResponses];
3111
+ export type ListMeshLinksData = {
3112
+ body?: never;
3113
+ headers?: {
3114
+ /**
3115
+ * An `ETag` from an earlier response, for a `304` revalidation.
3116
+ */
3117
+ 'If-None-Match'?: string;
3118
+ };
3119
+ path?: never;
3120
+ query?: {
3121
+ /**
3122
+ * Recency window for relay links: a positive Go duration. The documented
3123
+ * choices are `24h`, `72h` (the default), `168h` and `720h`; any positive
3124
+ * duration works (`90m`), and values above `9600h` (400 days) are
3125
+ * clamped. Anything else (`abc`, `0`, `-1h`) is a `400
3126
+ * INVALID_ARGUMENT`. `/api/v1/mesh/links` echoes the applied window in
3127
+ * `window`.
3128
+ *
3129
+ */
3130
+ window?: string;
3131
+ };
3132
+ url: '/api/v1/mesh/links';
3133
+ };
3134
+ export type ListMeshLinksErrors = {
3135
+ /**
3136
+ * `window` is not a positive Go duration (`abc`, `0`, `-1h`).
3137
+ */
3138
+ 400: RpcStatus;
3139
+ /**
3140
+ * Server-side failure. The real error is logged, never sent.
3141
+ */
3142
+ 500: RpcStatus;
3143
+ /**
3144
+ * The server is handing over to a new instance during a deploy. Retry after
3145
+ * `Retry-After` seconds. Plain text, not JSON.
3146
+ *
3147
+ */
3148
+ 503: string;
3149
+ };
3150
+ export type ListMeshLinksError = ListMeshLinksErrors[keyof ListMeshLinksErrors];
3151
+ export type ListMeshLinksResponses = {
3152
+ /**
3153
+ * The links, possibly empty.
3154
+ */
3155
+ 200: MeshLinkList;
3156
+ };
3157
+ export type ListMeshLinksResponse = ListMeshLinksResponses[keyof ListMeshLinksResponses];
3158
+ export type GridServiceGetMeshTelemetryData = {
3159
+ body?: never;
3160
+ path?: never;
3161
+ query: {
3162
+ /**
3163
+ * Required. The node's public key (`Event.mesh.publicKey`) or its event id
3164
+ * (`meshcore:{key}`), case-insensitive. 8 to 64 hex characters, even length:
3165
+ * a monitor-only node known by a 16-character key prefix is valid. Anything
3166
+ * else is a 400 INVALID_ARGUMENT. A well-formed key the archive does not know
3167
+ * returns 200 with `coverage.samples: 0` and no samples.
3168
+ */
3169
+ node: string;
3170
+ /**
3171
+ * Window start, RFC 3339, inclusive. Default: 24 hours before `to`.
3172
+ */
3173
+ from?: string;
3174
+ /**
3175
+ * Window end, RFC 3339, exclusive. Default: now.
3176
+ */
3177
+ to?: string;
3178
+ };
3179
+ url: '/api/v1/mesh/telemetry';
3180
+ };
3181
+ export type GridServiceGetMeshTelemetryErrors = {
3182
+ /**
3183
+ * INVALID_ARGUMENT: `node` missing or not 8-64 even-length hex (optionally prefixed `meshcore:`), or `from` not before `to`.
3184
+ */
3185
+ 400: RpcStatus;
3186
+ /**
3187
+ * An unexpected error response.
3188
+ */
3189
+ default: RpcStatus;
3190
+ };
3191
+ export type GridServiceGetMeshTelemetryError = GridServiceGetMeshTelemetryErrors[keyof GridServiceGetMeshTelemetryErrors];
3192
+ export type GridServiceGetMeshTelemetryResponses = {
3193
+ /**
3194
+ * A successful response.
3195
+ */
3196
+ 200: V1MeshTelemetryArchive;
3197
+ };
3198
+ export type GridServiceGetMeshTelemetryResponse = GridServiceGetMeshTelemetryResponses[keyof GridServiceGetMeshTelemetryResponses];
3199
+ export type GridServiceListPlacesData = {
3200
+ body?: never;
3201
+ path?: never;
3202
+ query?: {
3203
+ /**
3204
+ * Only places of this kind. Case-insensitive. EVAC_ZONE and SITE are accepted
3205
+ * but no places of those kinds exist today. Default: every kind.
3206
+ */
3207
+ kind?: 'AREA' | 'COUNTY' | 'TOWN' | 'CORRIDOR' | 'EVAC_ZONE' | 'SITE';
3208
+ /**
3209
+ * Case-insensitive substring of the place name, e.g. `calav`.
3210
+ */
3211
+ q?: string;
3212
+ /**
3213
+ * `BASE64` (default, legacy) or `OBJECT` for each place's `geometry`; same
3214
+ * as on `/api/v1/events`.
3215
+ */
3216
+ geometryFormat?: 'BASE64' | 'OBJECT';
3217
+ };
3218
+ url: '/api/v1/places';
3219
+ };
3220
+ export type GridServiceListPlacesErrors = {
3221
+ /**
3222
+ * INVALID_ARGUMENT: unknown kind or geometryFormat.
3223
+ */
3224
+ 400: RpcStatus;
3225
+ /**
3226
+ * An unexpected error response.
3227
+ */
3228
+ default: RpcStatus;
3229
+ };
3230
+ export type GridServiceListPlacesError = GridServiceListPlacesErrors[keyof GridServiceListPlacesErrors];
3231
+ export type GridServiceListPlacesResponses = {
3232
+ /**
3233
+ * A successful response.
3234
+ */
3235
+ 200: V1PlaceList;
3236
+ };
3237
+ export type GridServiceListPlacesResponse = GridServiceListPlacesResponses[keyof GridServiceListPlacesResponses];
3238
+ export type GridServiceGetPlaceData = {
3239
+ body?: never;
3240
+ path: {
3241
+ /**
3242
+ * Place slug (`arnold`) or namespaced id (`town:arnold`).
3243
+ */
3244
+ place: string;
3245
+ };
3246
+ query?: {
3247
+ /**
3248
+ * `BASE64` (default, legacy) or `OBJECT`; same as on `/api/v1/events`.
3249
+ */
3250
+ geometryFormat?: 'BASE64' | 'OBJECT';
3251
+ };
3252
+ url: '/api/v1/places/{place}';
3253
+ };
3254
+ export type GridServiceGetPlaceErrors = {
3255
+ /**
3256
+ * INVALID_ARGUMENT: an unknown geometryFormat.
3257
+ */
3258
+ 400: RpcStatus;
3259
+ /**
3260
+ * NOT_FOUND: unknown place.
3261
+ */
3262
+ 404: RpcStatus;
3263
+ /**
3264
+ * An unexpected error response.
3265
+ */
3266
+ default: RpcStatus;
3267
+ };
3268
+ export type GridServiceGetPlaceError = GridServiceGetPlaceErrors[keyof GridServiceGetPlaceErrors];
3269
+ export type GridServiceGetPlaceResponses = {
3270
+ /**
3271
+ * A successful response.
3272
+ */
3273
+ 200: V1Place;
3274
+ };
3275
+ export type GridServiceGetPlaceResponse = GridServiceGetPlaceResponses[keyof GridServiceGetPlaceResponses];
3276
+ export type GetMapLayerData = {
3277
+ body?: never;
3278
+ headers?: {
3279
+ /**
3280
+ * An `ETag` from an earlier response, for a `304` revalidation.
3281
+ */
3282
+ 'If-None-Match'?: string;
3283
+ };
3284
+ path: {
3285
+ /**
3286
+ * A place slug (`calaveras-county`, `ebbetts-pass`, `hwy4-murphys-arnold`)
3287
+ * or namespaced id (`county:calaveras-county`). Slugs are globally unique.
3288
+ * `GET /api/v1/places` lists them; `GET /api/v1/places:resolve` maps an
3289
+ * address or lat/lng to the places containing it.
3290
+ *
3291
+ */
3292
+ place: string;
3293
+ /**
3294
+ * Layer slug (lowercase).
3295
+ */
3296
+ layer: 'road_incident' | 'chain_control' | 'road_segment' | 'message_sign' | 'weather_alert' | 'fire_weather' | 'earthquake' | 'wildfire' | 'evacuation' | 'power' | 'mesh_node' | 'mesh_link' | 'camera';
3297
+ };
3298
+ query?: {
3299
+ /**
3300
+ * Recency window for relay links: a positive Go duration. The documented
3301
+ * choices are `24h`, `72h` (the default), `168h` and `720h`; any positive
3302
+ * duration works (`90m`), and values above `9600h` (400 days) are
3303
+ * clamped. Anything else (`abc`, `0`, `-1h`) is a `400
3304
+ * INVALID_ARGUMENT`. `/api/v1/mesh/links` echoes the applied window in
3305
+ * `window`.
3306
+ *
3307
+ */
3308
+ window?: string;
3309
+ };
3310
+ url: '/api/v1/places/{place}/map/{layer}.geojson';
3311
+ };
3312
+ export type GetMapLayerErrors = {
3313
+ /**
3314
+ * `window` is not a positive Go duration (`abc`, `0`, `-1h`).
3315
+ */
3316
+ 400: RpcStatus;
3317
+ /**
3318
+ * Unknown place or unknown layer.
3319
+ */
3320
+ 404: RpcStatus;
3321
+ /**
3322
+ * Server-side failure. The real error is logged, never sent.
3323
+ */
3324
+ 500: RpcStatus;
3325
+ /**
3326
+ * A condition-backed layer is not wired in this deployment (never in production).
3327
+ */
3328
+ 501: RpcStatus;
3329
+ /**
3330
+ * The server is handing over to a new instance during a deploy. Retry after
3331
+ * `Retry-After` seconds. Plain text, not JSON.
3332
+ *
3333
+ */
3334
+ 503: string;
3335
+ };
3336
+ export type GetMapLayerError = GetMapLayerErrors[keyof GetMapLayerErrors];
3337
+ export type GetMapLayerResponses = {
3338
+ /**
3339
+ * The layer. Empty `features` is a valid answer; read `metadata.sourceStatus` to know whether it is confirmed-empty or unknown.
3340
+ */
3341
+ 200: MapFeatureCollection;
3342
+ };
3343
+ export type GetMapLayerResponse = GetMapLayerResponses[keyof GetMapLayerResponses];
3344
+ export type GridServiceGetPlaceSummaryData = {
3345
+ body?: never;
3346
+ path: {
3347
+ /**
3348
+ * Place slug (`calaveras-county`) or namespaced id (`county:calaveras-county`).
3349
+ */
3350
+ place: string;
3351
+ };
3352
+ query?: never;
3353
+ url: '/api/v1/places/{place}/summary';
3354
+ };
3355
+ export type GridServiceGetPlaceSummaryErrors = {
3356
+ /**
3357
+ * NOT_FOUND: unknown place.
3358
+ */
3359
+ 404: RpcStatus;
3360
+ /**
3361
+ * An unexpected error response.
3362
+ */
3363
+ default: RpcStatus;
3364
+ };
3365
+ export type GridServiceGetPlaceSummaryError = GridServiceGetPlaceSummaryErrors[keyof GridServiceGetPlaceSummaryErrors];
3366
+ export type GridServiceGetPlaceSummaryResponses = {
3367
+ /**
3368
+ * A successful response.
3369
+ */
3370
+ 200: V1PlaceSummary;
3371
+ };
3372
+ export type GridServiceGetPlaceSummaryResponse = GridServiceGetPlaceSummaryResponses[keyof GridServiceGetPlaceSummaryResponses];
3373
+ export type GridServiceResolvePlaceData = {
3374
+ body?: never;
3375
+ path?: never;
3376
+ query?: {
3377
+ /**
3378
+ * Latitude in decimal degrees, -90 to 90. Requires `lng`.
3379
+ */
3380
+ lat?: number;
3381
+ /**
3382
+ * Longitude in decimal degrees, -180 to 180 (negative in California).
3383
+ * Requires `lat`.
3384
+ */
3385
+ lng?: number;
3386
+ /**
3387
+ * A US street address, geocoded with the Census geocoder. Include the city,
3388
+ * state or ZIP for a reliable match.
3389
+ */
3390
+ address?: string;
3391
+ /**
3392
+ * `BASE64` (default, legacy) or `OBJECT` for each place's `geometry`; same
3393
+ * as on `/api/v1/events`.
3394
+ */
3395
+ geometryFormat?: 'BASE64' | 'OBJECT';
3396
+ };
3397
+ url: '/api/v1/places:resolve';
3398
+ };
3399
+ export type GridServiceResolvePlaceErrors = {
3400
+ /**
3401
+ * INVALID_ARGUMENT: neither or both of lat+lng and address, only one of lat/lng, a value out of range, or an unknown geometryFormat.
3402
+ */
3403
+ 400: RpcStatus;
3404
+ /**
3405
+ * NOT_FOUND: the geocoder found no match for the address (add city, state or ZIP).
3406
+ */
3407
+ 404: RpcStatus;
3408
+ /**
3409
+ * UNAVAILABLE: the address geocoder is down; retry later or resolve by lat/lng.
3410
+ */
3411
+ 503: RpcStatus;
3412
+ /**
3413
+ * An unexpected error response.
3414
+ */
3415
+ default: RpcStatus;
3416
+ };
3417
+ export type GridServiceResolvePlaceError = GridServiceResolvePlaceErrors[keyof GridServiceResolvePlaceErrors];
3418
+ export type GridServiceResolvePlaceResponses = {
3419
+ /**
3420
+ * A successful response.
3421
+ */
3422
+ 200: V1ResolvePlaceResponse;
3423
+ };
3424
+ export type GridServiceResolvePlaceResponse = GridServiceResolvePlaceResponses[keyof GridServiceResolvePlaceResponses];
3425
+ export type GridServiceListScannersData = {
3426
+ body?: never;
3427
+ path?: never;
3428
+ query?: {
3429
+ /**
3430
+ * An AREA place (slug or id) returns that area's feeds. Any other place, or
3431
+ * none, returns every feed.
3432
+ */
3433
+ place?: string;
3434
+ };
3435
+ url: '/api/v1/scanners';
3436
+ };
3437
+ export type GridServiceListScannersErrors = {
3438
+ /**
3439
+ * NOT_FOUND: unknown place.
3440
+ */
3441
+ 404: RpcStatus;
3442
+ /**
3443
+ * An unexpected error response.
3444
+ */
3445
+ default: RpcStatus;
3446
+ };
3447
+ export type GridServiceListScannersError = GridServiceListScannersErrors[keyof GridServiceListScannersErrors];
3448
+ export type GridServiceListScannersResponses = {
3449
+ /**
3450
+ * A successful response.
3451
+ */
3452
+ 200: V1ScannerList;
3453
+ };
3454
+ export type GridServiceListScannersResponse = GridServiceListScannersResponses[keyof GridServiceListScannersResponses];
3455
+ export type GridServiceListSourcesData = {
3456
+ body?: never;
3457
+ path?: never;
3458
+ query?: never;
3459
+ url: '/api/v1/sources';
3460
+ };
3461
+ export type GridServiceListSourcesErrors = {
3462
+ /**
3463
+ * An unexpected error response.
3464
+ */
3465
+ default: RpcStatus;
3466
+ };
3467
+ export type GridServiceListSourcesError = GridServiceListSourcesErrors[keyof GridServiceListSourcesErrors];
3468
+ export type GridServiceListSourcesResponses = {
3469
+ /**
3470
+ * A successful response.
3471
+ */
3472
+ 200: V1SourceList;
3473
+ };
3474
+ export type GridServiceListSourcesResponse = GridServiceListSourcesResponses[keyof GridServiceListSourcesResponses];