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 (#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>
This commit is contained in:
@@ -4,18 +4,19 @@ info:
|
||||
version: 1.0.0
|
||||
paths:
|
||||
/api/market/v1/list-market-quotes:
|
||||
post:
|
||||
get:
|
||||
tags:
|
||||
- MarketService
|
||||
summary: ListMarketQuotes
|
||||
description: ListMarketQuotes retrieves stock and index quotes.
|
||||
operationId: ListMarketQuotes
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ListMarketQuotesRequest'
|
||||
required: true
|
||||
parameters:
|
||||
- name: symbols
|
||||
in: query
|
||||
description: Ticker symbols to retrieve (e.g., ["AAPL", "^GSPC"]). Empty returns defaults.
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: Successful response
|
||||
@@ -36,18 +37,19 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
/api/market/v1/list-crypto-quotes:
|
||||
post:
|
||||
get:
|
||||
tags:
|
||||
- MarketService
|
||||
summary: ListCryptoQuotes
|
||||
description: ListCryptoQuotes retrieves cryptocurrency quotes from CoinGecko.
|
||||
operationId: ListCryptoQuotes
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ListCryptoQuotesRequest'
|
||||
required: true
|
||||
parameters:
|
||||
- name: ids
|
||||
in: query
|
||||
description: Cryptocurrency IDs to retrieve (CoinGecko IDs). Empty returns defaults.
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: Successful response
|
||||
@@ -68,18 +70,19 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
/api/market/v1/list-commodity-quotes:
|
||||
post:
|
||||
get:
|
||||
tags:
|
||||
- MarketService
|
||||
summary: ListCommodityQuotes
|
||||
description: ListCommodityQuotes retrieves commodity price quotes from Yahoo Finance.
|
||||
operationId: ListCommodityQuotes
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ListCommodityQuotesRequest'
|
||||
required: true
|
||||
parameters:
|
||||
- name: symbols
|
||||
in: query
|
||||
description: Commodity symbols to retrieve (Yahoo symbols). Empty returns defaults.
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: Successful response
|
||||
@@ -100,18 +103,19 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
/api/market/v1/get-sector-summary:
|
||||
post:
|
||||
get:
|
||||
tags:
|
||||
- MarketService
|
||||
summary: GetSectorSummary
|
||||
description: GetSectorSummary retrieves market sector performance data from Finnhub.
|
||||
operationId: GetSectorSummary
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/GetSectorSummaryRequest'
|
||||
required: true
|
||||
parameters:
|
||||
- name: period
|
||||
in: query
|
||||
description: Time period for performance calculation (e.g., "1d", "1w", "1m"). Defaults to "1d".
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: Successful response
|
||||
@@ -132,18 +136,19 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
/api/market/v1/list-stablecoin-markets:
|
||||
post:
|
||||
get:
|
||||
tags:
|
||||
- MarketService
|
||||
summary: ListStablecoinMarkets
|
||||
description: ListStablecoinMarkets retrieves stablecoin peg health and market data from CoinGecko.
|
||||
operationId: ListStablecoinMarkets
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ListStablecoinMarketsRequest'
|
||||
required: true
|
||||
parameters:
|
||||
- name: coins
|
||||
in: query
|
||||
description: CoinGecko IDs to retrieve (e.g. "tether,usd-coin"). Empty returns defaults.
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: Successful response
|
||||
@@ -164,18 +169,12 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
/api/market/v1/list-etf-flows:
|
||||
post:
|
||||
get:
|
||||
tags:
|
||||
- MarketService
|
||||
summary: ListEtfFlows
|
||||
description: ListEtfFlows retrieves BTC spot ETF flow estimates from Yahoo Finance.
|
||||
operationId: ListEtfFlows
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ListEtfFlowsRequest'
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: Successful response
|
||||
@@ -195,19 +194,20 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
/api/market/v1/get-country-stock-index:
|
||||
post:
|
||||
/api/market/v1/get-country-stock-index/{country_code}:
|
||||
get:
|
||||
tags:
|
||||
- MarketService
|
||||
summary: GetCountryStockIndex
|
||||
description: GetCountryStockIndex retrieves the primary stock index for a country from Yahoo Finance.
|
||||
operationId: GetCountryStockIndex
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/GetCountryStockIndexRequest'
|
||||
required: true
|
||||
parameters:
|
||||
- name: country_code
|
||||
in: path
|
||||
description: ISO 3166-1 alpha-2 country code (e.g., "US", "GB", "JP").
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: Successful response
|
||||
@@ -282,6 +282,9 @@ components:
|
||||
skipReason:
|
||||
type: string
|
||||
description: Human-readable reason when Finnhub was skipped (e.g., "FINNHUB_API_KEY not configured").
|
||||
rateLimited:
|
||||
type: boolean
|
||||
description: True when the upstream API rate-limited the request.
|
||||
description: ListMarketQuotesResponse contains stock and index quotes.
|
||||
MarketQuote:
|
||||
type: object
|
||||
@@ -545,6 +548,9 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/EtfFlow'
|
||||
rateLimited:
|
||||
type: boolean
|
||||
description: True when the upstream API rate-limited the request.
|
||||
description: ListEtfFlowsResponse contains BTC spot ETF flow data.
|
||||
EtfFlowsSummary:
|
||||
type: object
|
||||
|
||||
Reference in New Issue
Block a user