diff --git a/apps/studio/src/studio.app.ts b/apps/studio/src/studio.app.ts index 9299b59..a2848db 100644 --- a/apps/studio/src/studio.app.ts +++ b/apps/studio/src/studio.app.ts @@ -178,6 +178,19 @@ const app = new Hono() // Local Windows + Android bundles from the editor button under Upload. .post('/cloud-builds/from-editor', (c) => postLocalCloudBuild(c)) + // Studio asks how often it may request cloud builds. Stubbed: this server + // never queues a real cloud build (every build is local, see from-editor), + // so the numbers are permissive placeholders. The field names are an + // ASSUMPTION — what the editor reads from this response has not been + // observed; adjust once it has. + .get('/cloud-builds/get-rate-limit-config', (c) => + c.json({ + maxBuildsPerHour: 100, + maxConcurrentBuilds: 10, + cooldownSeconds: 0, + }) + ) + // Who of this room's co-owners is standing in this subroom right now. Studio // shows them as "Co-owners in Room" and reads a Result>: `success` // must be true and `error` null, or the editor throws; `value` is those diff --git a/apps/studio/src/test/integration/api.test.ts b/apps/studio/src/test/integration/api.test.ts index a5779de..c49c2f1 100644 --- a/apps/studio/src/test/integration/api.test.ts +++ b/apps/studio/src/test/integration/api.test.ts @@ -106,6 +106,16 @@ it('lists no cloud builds for a room', async () => { expect(await res.json()).toEqual({ results: [], totalResults: 0 }) }) +it('serves a stubbed cloud build rate limit config', async () => { + const res = await SELF.fetch('https://example.com/cloud-builds/get-rate-limit-config') + expect(res.status).toBe(200) + expect(await res.json()).toEqual({ + maxBuildsPerHour: 100, + maxConcurrentBuilds: 10, + cooldownSeconds: 0, + }) +}) + describe('GET /collaboration/owners-in-room', () => { const roomId = 1106 const subRoomId = 22941