mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-08 22:51:30 -07:00
remove old routes, enable cache for cdn
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
import { Hono } from 'hono'
|
||||
|
||||
import { authedId, parseFormIds, unauthorized } from '../http'
|
||||
|
||||
import type { App } from '../context'
|
||||
|
||||
// ---- Accounts --------------------------------------------------------------
|
||||
export const accountRoutes = new Hono<App>({ strict: false })
|
||||
.get('/api/accounts/v1/getBio', async (c) => {
|
||||
const id = await authedId(c)
|
||||
if (id === null) return unauthorized(c)
|
||||
return c.json([]) // TODO: query PlayerBios
|
||||
})
|
||||
.post('/api/accounts/v1/forplatformids', async (c) => {
|
||||
await parseFormIds(c) // reads `Ids` then looks up CachedLogins
|
||||
return c.json([])
|
||||
})
|
||||
@@ -1,32 +1,19 @@
|
||||
import { Hono } from 'hono'
|
||||
|
||||
import { authedId, unauthorized } from '../http'
|
||||
|
||||
import type { App } from '../context'
|
||||
|
||||
// ---- 2023 client loading-path endpoints ------------------------------------
|
||||
// NUX checklist, text sanitization, keepsakes, objectives/events/rewards, and
|
||||
// the misc analytics/subscription sinks the client hits during load.
|
||||
// Text sanitization, keepsakes, objectives/events/rewards, and the misc
|
||||
// analytics/subscription sinks the client hits during load.
|
||||
export const gameplayRoutes = new Hono<App>({ strict: false })
|
||||
// NUX checklist — empty list with no DB.
|
||||
.get('/api/checklist/v1/current', async (c) => {
|
||||
const id = await authedId(c)
|
||||
if (id === null) return unauthorized(c)
|
||||
return c.json([])
|
||||
})
|
||||
|
||||
// Text sanitization (display names, room names, chat). `v1` echoes the input
|
||||
// value back; `isPure` reports the text is clean. The client sanitizes text
|
||||
// during load/display, so a 404 here can stall room entry.
|
||||
// value back; `isPure` reports the text is clean.
|
||||
.post('/api/sanitize/v1', async (c) => {
|
||||
const body = await c.req.json<{ Value?: unknown }>().catch(() => ({}) as { Value?: unknown })
|
||||
return c.json(typeof body.Value === 'string' ? body.Value : '')
|
||||
})
|
||||
.post('/api/sanitize/v1/isPure', (c) => c.json({ IsPure: true }))
|
||||
|
||||
// Keepsakes (room mementos). Shapes from the 2025 reference; categories isn't
|
||||
// in any reference, so it's stubbed empty. The client fetches these on room
|
||||
// entry — a 404 stalls the load.
|
||||
// Keepsakes (room mementos). Stubbed empty.
|
||||
.get('/api/keepsakes/globalconfig', (c) =>
|
||||
c.json({ KeepsakeFeatureEnabled: true, KeepsakeRoomLimit: 10, SocialXpBoostEnabled: false })
|
||||
)
|
||||
@@ -34,12 +21,9 @@ export const gameplayRoutes = new Hono<App>({ strict: false })
|
||||
.get('/api/keepsakes/categories', (c) => c.json([]))
|
||||
|
||||
// ---- Objectives / events / rewards ---------------------------------------
|
||||
.get('/api/objectives/v1/myprogress', (c) => c.json({})) // TODO: hydrate from JSON/tempmyprogress.json
|
||||
.post('/api/objectives/v1/updateobjective', (c) => c.body(null, 200))
|
||||
.get('/api/gamerewards/v1/pending', (c) => c.json([]))
|
||||
.get('/api/communityboard/v2/current', (c) => c.json({})) // TODO: hydrate from JSON/communityboard.json
|
||||
.get('/api/playerevents/v1/all', (c) => c.json({ Created: [], Responses: [] }))
|
||||
.get('/api/challenge/v2/getCurrent', (c) => c.json({})) // TODO: hydrate from JSON/weeklychallenge.json
|
||||
.get('/api/announcement/v1/get', (c) => c.json([])) // TODO: hydrate from JSON/announcements.json
|
||||
|
||||
// GameSight attribution/analytics event sink. Accept and ack without persisting.
|
||||
|
||||
@@ -1,27 +1,11 @@
|
||||
import { Hono } from 'hono'
|
||||
|
||||
import { defaultSettings } from '../default-settings'
|
||||
import { authedId, unauthorized } from '../http'
|
||||
|
||||
import type { App } from '../context'
|
||||
|
||||
// ---- Settings / inventory --------------------------------------------------
|
||||
// ---- Inventory -------------------------------------------------------------
|
||||
export const inventoryRoutes = new Hono<App>({ strict: false })
|
||||
// ---- Settings -------------------------------------------------------------
|
||||
.get('/api/settings/v2', async (c) => {
|
||||
const id = await authedId(c)
|
||||
if (id === null) return unauthorized(c)
|
||||
// TODO: load stored settings; seed defaults on first access.
|
||||
return c.json(defaultSettings(id))
|
||||
})
|
||||
.post('/api/settings/v2/set', async (c) => {
|
||||
const id = await authedId(c)
|
||||
if (id === null) return unauthorized(c)
|
||||
// TODO: replace stored settings for `id`.
|
||||
return c.body(null, 200)
|
||||
})
|
||||
|
||||
// ---- Inventory ------------------------------------------------------------
|
||||
.get('/api/equipment/v2/getUnlocked', (c) => c.json([]))
|
||||
.get('/api/consumables/v2/getUnlocked', async (c) => {
|
||||
const id = await authedId(c)
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import { Hono } from 'hono'
|
||||
|
||||
import storefrontGiftDrop2 from '../../static/storefronts-v3-giftdropstore-2.json'
|
||||
import storefrontGiftDrop3 from '../../static/storefronts-v3-giftdropstore-3.json'
|
||||
import storefrontGiftDrop300 from '../../static/storefronts-v3-giftdropstore-300.json'
|
||||
import { authedId, unauthorized } from '../http'
|
||||
|
||||
import type { App } from '../context'
|
||||
|
||||
// ---- Storefronts -----------------------------------------------------------
|
||||
export const storefrontRoutes = new Hono<App>({ strict: false })
|
||||
.get('/api/storefronts/v4/balance/2', async (c) => {
|
||||
const id = await authedId(c)
|
||||
if (id === null) return unauthorized(c)
|
||||
return c.json([]) // TODO: query TokenBalances
|
||||
})
|
||||
.get('/api/storefronts/v1/p2p/betaEnabled', (c) => c.json(false))
|
||||
.get('/api/storefronts/v3/giftdropstore/3', (c) => c.json(storefrontGiftDrop3))
|
||||
.get('/api/storefronts/v3/giftdropstore/300', (c) => c.json(storefrontGiftDrop300))
|
||||
.get('/api/storefronts/v3/giftdropstore/2', (c) => c.json(storefrontGiftDrop2))
|
||||
.post('/api/storefronts/v2/buyItem', async (c) => {
|
||||
const id = await authedId(c)
|
||||
if (id === null) return unauthorized(c)
|
||||
// No StorefrontItems binding → item can never be found.
|
||||
return c.json({ error: 'Item not found' }, 404)
|
||||
})
|
||||
Reference in New Issue
Block a user