Commit Graph

2 Commits

Author SHA1 Message Date
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
Sebastien Melki
6669d373cf feat: convert 52 API endpoints from POST to GET for edge caching (#468)
* 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>
2026-02-27 19:44:40 +04:00