Files
worldmonitor/docs/api/InfrastructureService.openapi.json
Elie Habib 97f5aa8af7 refactor(proto): extract new Sebuf RPCs from #1399 (lspassos1) (#1888)
* feat(proto): add new RPCs for satellites, oref alerts, telegram, GPS interference, company enrichment

Extracted from #1399 (originally by @lspassos1). Adds 12 new proto message/service
files and updates service.proto for intelligence, aviation, and infrastructure domains.

Intelligence:
- ListSatellites + satellite.proto (TLE orbit data)
- ListOrefAlerts (Israeli Home Front Command alerts)
- ListTelegramFeed (Telegram intelligence feed)
- ListGpsInterference + gps_jamming.proto
- GetCompanyEnrichment (GitHub/SEC/HN enrichment)
- ListCompanySignals

Aviation:
- GetYoutubeLiveStreamInfo

Infrastructure:
- GetBootstrapData
- GetIpGeo
- ReverseGeocode

Co-authored-by: Lucas Passos <lspassos1@users.noreply.github.com>

* chore(proto): regenerate clients/servers/openapi after new RPC additions

* fix(proto): restore GetCountryFacts and ListSecurityAdvisories RPCs removed by contributor

* chore(handlers): add stub implementations for new proto RPCs

* fix(handler): correct stub shapes for GetCompanyEnrichment and ListCompanySignals

* fix(proto): fix handler stub shapes for listOrefAlerts, listTelegramFeed, listGpsInterference

* fix(proto): fix remaining handler stub shapes for aviation and infrastructure

* fix(proto): add cache tier entries for new generated GET routes, remove stale classify-event entry

* fix(pr1888): restore rpc contracts and real handlers

* fix(oref): read history from Redis instead of re-calling relay

relay:oref:history:v1 is seeded by ais-relay on every poll cycle.
History mode now reads directly from Redis (no relay hit).
Live alerts still call relay (in-memory only), with Redis counts as fallback.

* fix(gateway): change youtube-live-stream-info tier from no-store to fast

Matches existing api/youtube/live.js which caches at s-maxage=600.
fast tier = s-maxage=300 stale-while-revalidate=60 — appropriate for
live detection that changes at most every few minutes.

* fix(geocode): await setCachedJson to prevent edge isolate termination race

* fix(youtube): use CHROME_UA constant in fallback fetch paths

* fix(pr1888): address P1/P2 review findings

- gateway: oref+telegram slow->fast (matches legacy s-maxage=300/120)
- gateway: ip-geo slow->no-store (per-request user data, must not share)
- list-gps-interference: recompute stats from filtered hexes when region filter active
- get-company-enrichment: throw ValidationError(400) on missing domain+name
- list-company-signals: throw ValidationError(400) on missing company

* fix(validation): use FieldViolation.description, remove unused buildEmptyResponse

---------

Co-authored-by: Lucas Passos <lspassos1@users.noreply.github.com>
Co-authored-by: lspassos1 <lspassos@icloud.com>
2026-03-21 12:24:59 +04:00

1 line
22 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"components":{"schemas":{"BaselineAnomaly":{"description":"BaselineAnomaly describes a detected deviation from historical baseline.","properties":{"multiplier":{"description":"Ratio of current count to baseline mean.","format":"double","type":"number"},"severity":{"description":"Severity label: \"critical\", \"high\", \"medium\", \"normal\".","type":"string"},"zScore":{"description":"Number of standard deviations from the mean.","format":"double","type":"number"}},"type":"object"},"BaselineStats":{"description":"BaselineStats contains the running statistics for a baseline key.","properties":{"mean":{"description":"Running mean of observed counts.","format":"double","type":"number"},"sampleCount":{"description":"Number of samples incorporated so far.","format":"int32","type":"integer"},"stdDev":{"description":"Standard deviation derived from Welford's M2.","format":"double","type":"number"}},"type":"object"},"BaselineUpdate":{"description":"BaselineUpdate is a single metric observation to incorporate into the running baseline.","properties":{"count":{"description":"Observed count value.","format":"double","type":"number"},"region":{"description":"Geographic region key, defaults to \"global\".","type":"string"},"type":{"description":"Activity type key.","minLength":1,"type":"string"}},"required":["type"],"type":"object"},"CableHealthEvidence":{"description":"CableHealthEvidence represents a single piece of evidence supporting a health assessment.","properties":{"source":{"description":"Evidence source (e.g. \"NGA\").","type":"string"},"summary":{"description":"Human-readable summary of the evidence.","type":"string"},"ts":{"description":"Evidence timestamp, as Unix epoch milliseconds.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"}},"type":"object"},"CableHealthRecord":{"description":"CableHealthRecord contains the computed health status and supporting evidence for a cable.","properties":{"confidence":{"description":"Confidence in the health assessment (0.01.0).","format":"double","type":"number"},"evidence":{"items":{"$ref":"#/components/schemas/CableHealthEvidence"},"type":"array"},"lastUpdated":{"description":"Last signal update time, as Unix epoch milliseconds.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"},"score":{"description":"Composite health score (0.0 = healthy, 1.0 = confirmed fault).","format":"double","type":"number"},"status":{"description":"CableHealthStatus represents the computed health status of a submarine cable.","enum":["CABLE_HEALTH_STATUS_UNSPECIFIED","CABLE_HEALTH_STATUS_OK","CABLE_HEALTH_STATUS_DEGRADED","CABLE_HEALTH_STATUS_FAULT"],"type":"string"}},"type":"object"},"CablesEntry":{"properties":{"key":{"type":"string"},"value":{"$ref":"#/components/schemas/CableHealthRecord"}},"type":"object"},"DataEntry":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"Error":{"description":"Error is returned when a handler encounters an error. It contains a simple error message that the developer can customize.","properties":{"message":{"description":"Error message (e.g., 'user not found', 'database connection failed')","type":"string"}},"type":"object"},"FieldViolation":{"description":"FieldViolation describes a single validation error for a specific field.","properties":{"description":{"description":"Human-readable description of the validation violation (e.g., 'must be a valid email address', 'required field missing')","type":"string"},"field":{"description":"The field path that failed validation (e.g., 'user.email' for nested fields). For header validation, this will be the header name (e.g., 'X-API-Key')","type":"string"}},"required":["field","description"],"type":"object"},"GeoCoordinates":{"description":"GeoCoordinates represents a geographic location using WGS84 coordinates.","properties":{"latitude":{"description":"Latitude in decimal degrees (-90 to 90).","format":"double","maximum":90,"minimum":-90,"type":"number"},"longitude":{"description":"Longitude in decimal degrees (-180 to 180).","format":"double","maximum":180,"minimum":-180,"type":"number"}},"type":"object"},"GetBootstrapDataRequest":{"description":"GetBootstrapDataRequest parameters for multi-key fetching.","properties":{"keys":{"items":{"type":"string"},"type":"array"},"tier":{"description":"Predefined tiers or specific keys.","type":"string"}},"type":"object"},"GetBootstrapDataResponse":{"description":"GetBootstrapDataResponse containing pooled data objects.","properties":{"data":{"additionalProperties":{"type":"string"},"description":"Map of keys to JSON-encoded data strings.","type":"object"},"missing":{"items":{"description":"List of keys that were not found in cache.","type":"string"},"type":"array"}},"type":"object"},"GetCableHealthRequest":{"description":"GetCableHealthRequest requests the current health status of all monitored submarine cables.","type":"object"},"GetCableHealthResponse":{"description":"GetCableHealthResponse contains health status for submarine cables with active signals.","properties":{"cables":{"additionalProperties":{"$ref":"#/components/schemas/CableHealthRecord"},"description":"Health records keyed by cable identifier.","type":"object"},"generatedAt":{"description":"Generation timestamp, as Unix epoch milliseconds.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"}},"type":"object"},"GetIpGeoRequest":{"description":"GetIpGeoRequest defined for future parameters (e.g., specific IP).","type":"object"},"GetIpGeoResponse":{"description":"GetIpGeoResponse contains geographic information derived from the request IP.","properties":{"city":{"type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"region":{"description":"Region or city (if available).","type":"string"}},"type":"object"},"GetTemporalBaselineRequest":{"description":"GetTemporalBaselineRequest checks current activity count against stored baseline.","properties":{"count":{"description":"Current observed count to compare against baseline.","format":"double","type":"number"},"region":{"description":"Geographic region key, defaults to \"global\".","type":"string"},"type":{"description":"Activity type: \"military_flights\", \"vessels\", \"protests\", \"news\", \"ais_gaps\", \"satellite_fires\".","minLength":1,"type":"string"}},"required":["type"],"type":"object"},"GetTemporalBaselineResponse":{"description":"GetTemporalBaselineResponse returns anomaly info or learning status.","properties":{"anomaly":{"$ref":"#/components/schemas/BaselineAnomaly"},"baseline":{"$ref":"#/components/schemas/BaselineStats"},"error":{"description":"Error message if request was invalid.","type":"string"},"learning":{"description":"True if insufficient samples have been collected.","type":"boolean"},"sampleCount":{"description":"Current number of samples stored.","format":"int32","type":"integer"},"samplesNeeded":{"description":"Minimum samples required before anomaly detection activates.","format":"int32","type":"integer"}},"type":"object"},"InternetOutage":{"description":"InternetOutage represents a detected internet outage event from Cloudflare Radar.","properties":{"categories":{"items":{"description":"Affected infrastructure categories.","type":"string"},"type":"array"},"cause":{"description":"Root cause, if determined.","type":"string"},"country":{"description":"Affected country (ISO 3166-1 alpha-2).","type":"string"},"description":{"description":"Outage description.","type":"string"},"detectedAt":{"description":"Detection time, as Unix epoch milliseconds.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"},"endedAt":{"description":"End time of the outage, as Unix epoch milliseconds. Zero if ongoing.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"},"id":{"description":"Unique outage identifier.","minLength":1,"type":"string"},"link":{"description":"URL to the outage report.","type":"string"},"location":{"$ref":"#/components/schemas/GeoCoordinates"},"outageType":{"description":"Outage type classification.","type":"string"},"region":{"description":"Affected region within the country.","type":"string"},"severity":{"description":"OutageSeverity represents the severity of an internet outage.\n Maps to TS union: 'partial' | 'major' | 'total'.","enum":["OUTAGE_SEVERITY_UNSPECIFIED","OUTAGE_SEVERITY_PARTIAL","OUTAGE_SEVERITY_MAJOR","OUTAGE_SEVERITY_TOTAL"],"type":"string"},"title":{"description":"Outage title.","type":"string"}},"required":["id"],"type":"object"},"ListInternetOutagesRequest":{"description":"ListInternetOutagesRequest specifies filters for retrieving internet outages.","properties":{"country":{"description":"Optional country filter (ISO 3166-1 alpha-2).","type":"string"},"cursor":{"description":"Cursor for next page.","type":"string"},"end":{"description":"End of time range (inclusive), Unix epoch milliseconds.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"},"pageSize":{"description":"Maximum items per page.","format":"int32","type":"integer"},"start":{"description":"Start of time range (inclusive), Unix epoch milliseconds.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"}},"type":"object"},"ListInternetOutagesResponse":{"description":"ListInternetOutagesResponse contains internet outages matching the request.","properties":{"outages":{"items":{"$ref":"#/components/schemas/InternetOutage"},"type":"array"},"pagination":{"$ref":"#/components/schemas/PaginationResponse"}},"type":"object"},"ListServiceStatusesRequest":{"description":"ListServiceStatusesRequest specifies filters for retrieving service statuses.","properties":{"status":{"description":"ServiceOperationalStatus represents the current status of a service.","enum":["SERVICE_OPERATIONAL_STATUS_UNSPECIFIED","SERVICE_OPERATIONAL_STATUS_OPERATIONAL","SERVICE_OPERATIONAL_STATUS_DEGRADED","SERVICE_OPERATIONAL_STATUS_PARTIAL_OUTAGE","SERVICE_OPERATIONAL_STATUS_MAJOR_OUTAGE","SERVICE_OPERATIONAL_STATUS_MAINTENANCE"],"type":"string"}},"type":"object"},"ListServiceStatusesResponse":{"description":"ListServiceStatusesResponse contains service operational statuses.","properties":{"statuses":{"items":{"$ref":"#/components/schemas/ServiceStatus"},"type":"array"}},"type":"object"},"ListTemporalAnomaliesRequest":{"type":"object"},"ListTemporalAnomaliesResponse":{"properties":{"anomalies":{"items":{"$ref":"#/components/schemas/TemporalAnomaly"},"type":"array"},"computedAt":{"type":"string"},"trackedTypes":{"items":{"type":"string"},"type":"array"}},"type":"object"},"PaginationResponse":{"description":"PaginationResponse contains pagination metadata returned alongside list results.","properties":{"nextCursor":{"description":"Cursor for fetching the next page. Empty string indicates no more pages.","type":"string"},"totalCount":{"description":"Total count of items matching the query, if known. Zero if the total is unknown.","format":"int32","type":"integer"}},"type":"object"},"RecordBaselineSnapshotRequest":{"description":"RecordBaselineSnapshotRequest batch-updates baselines using Welford's online algorithm.","properties":{"updates":{"items":{"$ref":"#/components/schemas/BaselineUpdate"},"type":"array"}},"type":"object"},"RecordBaselineSnapshotResponse":{"description":"RecordBaselineSnapshotResponse reports how many baselines were successfully updated.","properties":{"error":{"description":"Error message if the request was invalid.","type":"string"},"updated":{"description":"Number of baselines that were written.","format":"int32","type":"integer"}},"type":"object"},"ReverseGeocodeRequest":{"description":"ReverseGeocodeRequest parameters for coordinate-to-address lookups.","properties":{"lat":{"format":"double","type":"number"},"lon":{"format":"double","type":"number"}},"type":"object"},"ReverseGeocodeResponse":{"description":"ReverseGeocodeResponse containing the resolved location details.","properties":{"code":{"description":"ISO country code.","type":"string"},"country":{"description":"Human-readable country name.","type":"string"},"displayName":{"description":"Full display name/address.","type":"string"},"error":{"description":"Optional error message.","type":"string"}},"type":"object"},"ServiceStatus":{"description":"ServiceStatus represents the operational status of a monitored external service.","properties":{"checkedAt":{"description":"Last status check time, as Unix epoch milliseconds.. Warning: Values \u003e 2^53 may lose precision in JavaScript","format":"int64","type":"integer"},"description":{"description":"Status description.","type":"string"},"id":{"description":"Service identifier.","type":"string"},"latencyMs":{"description":"Response latency in milliseconds.","format":"int32","type":"integer"},"name":{"description":"Service display name.","type":"string"},"status":{"description":"ServiceOperationalStatus represents the current status of a service.","enum":["SERVICE_OPERATIONAL_STATUS_UNSPECIFIED","SERVICE_OPERATIONAL_STATUS_OPERATIONAL","SERVICE_OPERATIONAL_STATUS_DEGRADED","SERVICE_OPERATIONAL_STATUS_PARTIAL_OUTAGE","SERVICE_OPERATIONAL_STATUS_MAJOR_OUTAGE","SERVICE_OPERATIONAL_STATUS_MAINTENANCE"],"type":"string"},"url":{"description":"Service URL or homepage.","type":"string"}},"type":"object"},"TemporalAnomaly":{"properties":{"currentCount":{"format":"int32","type":"integer"},"expectedCount":{"format":"int32","type":"integer"},"message":{"type":"string"},"multiplier":{"format":"double","type":"number"},"region":{"type":"string"},"severity":{"type":"string"},"type":{"type":"string"},"zScore":{"format":"double","type":"number"}},"type":"object"},"ValidationError":{"description":"ValidationError is returned when request validation fails. It contains a list of field violations describing what went wrong.","properties":{"violations":{"description":"List of validation violations","items":{"$ref":"#/components/schemas/FieldViolation"},"type":"array"}},"required":["violations"],"type":"object"}}},"info":{"title":"InfrastructureService API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/api/infrastructure/v1/get-bootstrap-data":{"get":{"description":"GetBootstrapData fetches multiple data points from the system cache in a single call.","operationId":"GetBootstrapData","parameters":[{"description":"Predefined tiers or specific keys.","in":"query","name":"tier","required":false,"schema":{"type":"string"}},{"in":"query","name":"keys","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBootstrapDataResponse"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error response"}},"summary":"GetBootstrapData","tags":["InfrastructureService"]}},"/api/infrastructure/v1/get-cable-health":{"get":{"description":"GetCableHealth computes health status for submarine cables from NGA maritime warning signals.","operationId":"GetCableHealth","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCableHealthResponse"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error response"}},"summary":"GetCableHealth","tags":["InfrastructureService"]}},"/api/infrastructure/v1/get-ip-geo":{"get":{"description":"GetIpGeo retrieves geographic information based on the caller's IP address.","operationId":"GetIpGeo","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetIpGeoResponse"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error response"}},"summary":"GetIpGeo","tags":["InfrastructureService"]}},"/api/infrastructure/v1/get-temporal-baseline":{"get":{"description":"GetTemporalBaseline retrieves historical baseline data for a specific signal.","operationId":"GetTemporalBaseline","parameters":[{"description":"Activity type: \"military_flights\", \"vessels\", \"protests\", \"news\", \"ais_gaps\", \"satellite_fires\".","in":"query","name":"type","required":false,"schema":{"type":"string"}},{"description":"Geographic region key, defaults to \"global\".","in":"query","name":"region","required":false,"schema":{"type":"string"}},{"description":"Current observed count to compare against baseline.","in":"query","name":"count","required":false,"schema":{"format":"double","type":"number"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTemporalBaselineResponse"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error response"}},"summary":"GetTemporalBaseline","tags":["InfrastructureService"]}},"/api/infrastructure/v1/list-internet-outages":{"get":{"description":"ListInternetOutages retrieves detected internet outages from Cloudflare Radar.","operationId":"ListInternetOutages","parameters":[{"description":"Start of time range (inclusive), Unix epoch milliseconds.","in":"query","name":"start","required":false,"schema":{"format":"int64","type":"string"}},{"description":"End of time range (inclusive), Unix epoch milliseconds.","in":"query","name":"end","required":false,"schema":{"format":"int64","type":"string"}},{"description":"Maximum items per page.","in":"query","name":"page_size","required":false,"schema":{"format":"int32","type":"integer"}},{"description":"Cursor for next page.","in":"query","name":"cursor","required":false,"schema":{"type":"string"}},{"description":"Optional country filter (ISO 3166-1 alpha-2).","in":"query","name":"country","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListInternetOutagesResponse"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error response"}},"summary":"ListInternetOutages","tags":["InfrastructureService"]}},"/api/infrastructure/v1/list-service-statuses":{"get":{"description":"ListServiceStatuses retrieves operational status of monitored external services.","operationId":"ListServiceStatuses","parameters":[{"description":"Optional status filter. Returns only services in this state.","in":"query","name":"status","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListServiceStatusesResponse"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error response"}},"summary":"ListServiceStatuses","tags":["InfrastructureService"]}},"/api/infrastructure/v1/list-temporal-anomalies":{"get":{"description":"ListTemporalAnomalies returns server-computed temporal anomalies for news and satellite_fires.","operationId":"ListTemporalAnomalies","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTemporalAnomaliesResponse"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error response"}},"summary":"ListTemporalAnomalies","tags":["InfrastructureService"]}},"/api/infrastructure/v1/record-baseline-snapshot":{"post":{"description":"RecordBaselineSnapshot batch-updates baseline statistics using Welford's online algorithm.","operationId":"RecordBaselineSnapshot","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordBaselineSnapshotRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordBaselineSnapshotResponse"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error response"}},"summary":"RecordBaselineSnapshot","tags":["InfrastructureService"]}},"/api/infrastructure/v1/reverse-geocode":{"get":{"description":"ReverseGeocode resolves geographic coordinates to a postal address/country.","operationId":"ReverseGeocode","parameters":[{"in":"query","name":"lat","required":false,"schema":{"format":"double","type":"number"}},{"in":"query","name":"lon","required":false,"schema":{"format":"double","type":"number"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReverseGeocodeResponse"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error response"}},"summary":"ReverseGeocode","tags":["InfrastructureService"]}}}}