From 810e3b8f27b7a770250994ba25eb05e07aaf644f Mon Sep 17 00:00:00 2001 From: Devin Zuczek Date: Tue, 13 Oct 2026 10:49:08 -0400 Subject: [PATCH] [econ] stub out new consumables endpoint --- apps/econ/src/econ.app.ts | 16 ++++++++++++++++ apps/econ/src/test/integration/api.test.ts | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/apps/econ/src/econ.app.ts b/apps/econ/src/econ.app.ts index 360b419..df406cd 100644 --- a/apps/econ/src/econ.app.ts +++ b/apps/econ/src/econ.app.ts @@ -4975,6 +4975,22 @@ const app = new Hono({ strict: false }) } ) + // The consumable DEFINITIONS the client knows how to use (`?supportedVersion=2`), as + // opposed to the ones a player owns. A stub: none are served yet, so the list is empty. + // A real row is `{ ConsumableItemDesc, InitialCount, CreatedAt, ThumbnailImageName, + // FriendlyName, RoomieCategory, ConsumableToolName, ConfigurationData }`, where + // `ConfigurationData` is JSON escaped into a STRING (`"{\"MeshConfigurationData\":null,…}"`). + .get( + '/api/consumables/v1/all', + describeRoute({ + tags: ['Consumables'], + summary: 'All consumable definitions (stub)', + description: 'Always [] — no consumable definitions are served yet.', + responses: { 200: json(JsonArray, 'The consumable definitions (always empty)') }, + }), + (c) => c.json([]) + ) + // Unlocked consumables. [Authorize]. The consumables the player has bought (from // `buyItem`, stored in the `consumable` table), grouped by item into the client's // unlocked-consumable DTO. A player who has bought none gets an empty list. diff --git a/apps/econ/src/test/integration/api.test.ts b/apps/econ/src/test/integration/api.test.ts index 70f7ca2..61f0ceb 100644 --- a/apps/econ/src/test/integration/api.test.ts +++ b/apps/econ/src/test/integration/api.test.ts @@ -3772,6 +3772,12 @@ describe('econ endpoints', () => { } }) + test('GET /api/consumables/v1/all is a stub: returns []', async () => { + const res = await exports.default.fetch(`${ORIGIN}/api/consumables/v1/all?supportedVersion=2`) + expect(res.status).toBe(200) + expect(await res.json()).toEqual([]) + }) + test('GET /api/consumables/v2/getUnlocked 401s without a token, returns []', async () => { const anon = await exports.default.fetch(`${ORIGIN}/api/consumables/v2/getUnlocked`) expect(anon.status).toBe(401) @@ -7329,6 +7335,7 @@ describe('econ endpoints', () => { 'GET /api/challenge/v2/getCurrent', 'GET /api/checklist/v1/current', 'GET /api/checklist/v2/current', + 'GET /api/consumables/v1/all', 'GET /api/consumables/v2/getUnlocked', 'GET /api/equipment/v2/getUnlocked', 'GET /api/gamerewards/v1/pending',