mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-26 01:24:59 +02:00
* feat: convert 52 API endpoints from POST to GET for edge caching Convert all cacheable sebuf RPC endpoints to HTTP GET with query/path parameters, enabling CDN edge caching to reduce costs. Flatten nested request types (TimeRange, PaginationRequest, BoundingBox) into scalar query params. Add path params for resource lookups (GetFredSeries, GetHumanitarianSummary, GetCountryStockIndex, GetCountryIntelBrief, GetAircraftDetails). Rewrite router with hybrid static/dynamic matching for path param support. Kept as POST: SummarizeArticle, ClassifyEvent, RecordBaselineSnapshot, GetAircraftDetailsBatch, RegisterInterest. Generated with sebuf v0.9.0 (protoc-gen-ts-client, protoc-gen-ts-server). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: add rate_limited field to market response protos The rateLimited field was hand-patched into generated files on main but never declared in the proto definitions. Regenerating wiped it out, breaking the build. Now properly defined in both ListEtfFlowsResponse and ListMarketQuotesResponse protos. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: remove accidentally committed .planning files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 line
16 KiB
JSON
1 line
16 KiB
JSON
{"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.0–1.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"},"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"},"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"},"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"},"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"},"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"},"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-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-temporal-baseline":{"get":{"description":"GetTemporalBaseline checks current activity count against stored baseline for anomaly detection.","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/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"]}}}} |