feat(33-03): add market prices API, exchange rates endpoint, currency context
- Create market-price.service.ts with getMarketPrices, upsertMarketPrice - Create exchange-rates route (GET /api/exchange-rates, public) - Create market-prices route (GET/POST /api/market-prices/global-items/:id/prices) - Register new routes in server index with public GET access - Add priceCurrency to item service getAllItems/getItemById/createItem - Add foundPriceCents/Currency/Date to thread candidate select and create/update Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -15,9 +15,11 @@ import { accountRoutes } from "./routes/account.ts";
|
||||
import { authRoutes } from "./routes/auth.ts";
|
||||
import { categoryRoutes } from "./routes/categories.ts";
|
||||
import { discoveryRoutes } from "./routes/discovery.ts";
|
||||
import { exchangeRateRoutes } from "./routes/exchange-rates.ts";
|
||||
import { globalItemRoutes } from "./routes/global-items.ts";
|
||||
import { imageRoutes } from "./routes/images.ts";
|
||||
import { itemRoutes } from "./routes/items.ts";
|
||||
import { marketPriceRoutes } from "./routes/market-prices.ts";
|
||||
import { oauthRoutes, wellKnownRoute } from "./routes/oauth.ts";
|
||||
import { onboardingRoutes } from "./routes/onboarding.ts";
|
||||
import { profileRoutes } from "./routes/profiles.ts";
|
||||
@@ -211,6 +213,12 @@ app.use("/api/*", async (c, next) => {
|
||||
// Skip public global-items endpoint (GET /api/global-items)
|
||||
if (c.req.path.startsWith("/api/global-items") && c.req.method === "GET")
|
||||
return next();
|
||||
// Skip public exchange rates endpoint (GET /api/exchange-rates)
|
||||
if (c.req.path.startsWith("/api/exchange-rates") && c.req.method === "GET")
|
||||
return next();
|
||||
// Skip public market prices read endpoint (GET /api/market-prices)
|
||||
if (c.req.path.startsWith("/api/market-prices") && c.req.method === "GET")
|
||||
return next();
|
||||
// All other methods require auth for userId resolution
|
||||
return requireAuth(c, next);
|
||||
});
|
||||
@@ -230,6 +238,8 @@ app.route("/api/discovery", discoveryRoutes);
|
||||
app.route("/api/global-items", globalItemRoutes);
|
||||
app.route("/api/onboarding", onboardingRoutes);
|
||||
app.route("/api/tags", tagRoutes);
|
||||
app.route("/api/exchange-rates", exchangeRateRoutes);
|
||||
app.route("/api/market-prices", marketPriceRoutes);
|
||||
|
||||
// MCP server (conditionally mounted)
|
||||
if (process.env.GEARBOX_MCP !== "false") {
|
||||
|
||||
Reference in New Issue
Block a user