fixed up qm and added types to BaseHandler for typesafety

This commit is contained in:
Boki 2025-06-28 21:49:33 -04:00
parent 87b1cad4f5
commit 2e86598262
20 changed files with 164 additions and 109 deletions

View file

@ -0,0 +1,25 @@
/**
* Web API Service Types
* Defines required services for web API handlers
*/
import type { ServiceTypes } from '@stock-bot/types';
/**
* Services required by web API handlers
* Makes specific services non-nullable since they're always enabled
*/
export type WebApiServices = ServiceTypes & {
// Always required services
logger: NonNullable<ServiceTypes['logger']>;
mongodb: NonNullable<ServiceTypes['mongodb']>;
postgres: NonNullable<ServiceTypes['postgres']>;
cache: NonNullable<ServiceTypes['cache']>;
queue: NonNullable<ServiceTypes['queue']>;
queueManager: NonNullable<ServiceTypes['queueManager']>;
// Optional services remain optional
browser: ServiceTypes['browser'];
proxy: ServiceTypes['proxy'];
questdb: ServiceTypes['questdb'];
globalCache: ServiceTypes['globalCache'];
};

View file

@ -1,14 +1,14 @@
{
"extends": "../../tsconfig.app.json",
"extends": "../../../tsconfig.app.json",
"references": [
{ "path": "../../libs/core/types" },
{ "path": "../../libs/core/config" },
{ "path": "../../libs/core/logger" },
{ "path": "../../libs/data/cache" },
{ "path": "../../libs/services/queue" },
{ "path": "../../libs/data/mongodb" },
{ "path": "../../libs/data/postgres" },
{ "path": "../../libs/data/questdb" },
{ "path": "../../libs/services/shutdown" }
{ "path": "../../../libs/core/types" },
{ "path": "../../../libs/core/config" },
{ "path": "../../../libs/core/logger" },
{ "path": "../../../libs/core/cache" },
{ "path": "../../../libs/core/queue" },
{ "path": "../../../libs/data/mongodb" },
{ "path": "../../../libs/data/postgres" },
{ "path": "../../../libs/data/questdb" },
{ "path": "../../../libs/core/shutdown" }
]
}