From f40c3975fb0f87b3f2ad6fda912d4ce85aaa26d6 Mon Sep 17 00:00:00 2001 From: JoshiCodes <55353244+JoshiCodes@users.noreply.github.com> Date: Fri, 27 Nov 2026 21:48:41 +0100 Subject: [PATCH] Make the dev mock a module --- src/dev/mock.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dev/mock.ts b/src/dev/mock.ts index 9ffa2bc..d89d09b 100644 --- a/src/dev/mock.ts +++ b/src/dev/mock.ts @@ -138,7 +138,7 @@ const vars = [ { name: 'token', value: 'eyJhbGciOi…', scope: 'runtime', source: 'runtime', secret: false, problem: null } ]; -const history = [ +const historyEntries = [ { id: 3, at: new Date(Date.now() - 60_000).toISOString(), collection: 'demo', request_id: 'auth/login.yaml', name: 'Login', method: 'POST', url: 'http://localhost:5173/api/login', status: 200, duration_ms: 41.7, size: 734, error: null, has_body: true }, { id: 2, at: new Date(Date.now() - 600_000).toISOString(), collection: 'demo', request_id: null, name: 'User Info', method: 'GET', url: 'http://localhost:8080/oauth2/userinfo', status: 401, duration_ms: 12, size: 64, error: null, has_body: true }, { id: 1, at: new Date(Date.now() - 3_600_000).toISOString(), collection: 'demo', request_id: null, name: 'Delete user', method: 'DELETE', url: 'http://localhost:5173/api/users/7', status: 204, duration_ms: 18, size: 0, error: null, has_body: false } @@ -170,7 +170,7 @@ function handle(cmd: string, args: Record): unknown { case 'request_preview': return { request: response.output.request, auth: response.output.auth, missing: [], error: null }; case 'history_list': - return history; + return historyEntries; case 'env_get': return { name: args.id === 'prod' ? 'Production' : 'local', vars: { BASE: 'http://localhost:5173', clientId: 'knock', clientSecret: { secret: true } } }; case 'env_secrets': @@ -220,3 +220,4 @@ try { } catch { /* storage blocked */ } +export {};