Observability Server
Functions
Functions
createApp
Signature:
createApp(): Promise<CreateAppResult>
Returns:
Promise<CreateAppResult> -
initDatabase
Signature:
initDatabase(dbName?: string): Promise<ObsDatabase>
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dbName | string | No |
Returns:
Promise<ObsDatabase> -
getDatabase
Signature:
getDatabase(): Promise<ObsDatabase>
Returns:
Promise<ObsDatabase> -
closeDatabase
Signature:
closeDatabase(): Promise<void>
Returns:
Promise<void> -
authenticateApiKey
API Key Authentication Middleware Validates X-API-Key header against configured API keys
Signature:
authenticateApiKey(req: Request<import("/Users/sthornock/code/epic/epic-flowstate/node_modules/@types/express/node_modules/@types/express-serve-static-core/index").ParamsDictionary, any, any, import("/Users/sthornock/code/epic/epic-flowstate/node_modules/@types/qs/index").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: NextFunction): Response<any, Record<string, any>> | undefined
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
req | Request<import("/Users/sthornock/code/epic/epic-flowstate/node_modules/@types/express/node_modules/@types/express-serve-static-core/index").ParamsDictionary, any, any, import("/Users/sthornock/code/epic/epic-flowstate/node_modules/@types/qs/index").ParsedQs, Record<string, any>> | Yes | |
res | Response<any, Record<string, any>> | Yes | |
next | NextFunction | Yes |
Returns:
Response<any, Record<string, any>> \| undefined -
extractProjectFromApiKey
Optional: Extract project ID from API key for validation
Signature:
extractProjectFromApiKey(apiKey: string): string | null
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes |
Returns:
string \| null -
authorizeProject
Project Authorization Middleware Validates that the API key belongs to the queried project SECURITY: Prevents API keys from accessing data from other projects
Signature:
authorizeProject(req: Request<import("/Users/sthornock/code/epic/epic-flowstate/node_modules/@types/express/node_modules/@types/express-serve-static-core/index").ParamsDictionary, any, any, import("/Users/sthornock/code/epic/epic-flowstate/node_modules/@types/qs/index").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: NextFunction): Response<any, Record<string, any>> | undefined
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
req | Request<import("/Users/sthornock/code/epic/epic-flowstate/node_modules/@types/express/node_modules/@types/express-serve-static-core/index").ParamsDictionary, any, any, import("/Users/sthornock/code/epic/epic-flowstate/node_modules/@types/qs/index").ParsedQs, Record<string, any>> | Yes | |
res | Response<any, Record<string, any>> | Yes | |
next | NextFunction | Yes |
Returns:
Response<any, Record<string, any>> \| undefined -
createRateLimitMiddleware
Rate Limiting Middleware Uses the existing RateLimiter class to enforce rate limits per API key
Signature:
createRateLimitMiddleware(maxRequests?: number, windowMs?: number): (req: Request, res: Response, next: NextFunction) => Response<any, Record<string, any>> | undefined
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
maxRequests | number | No | |
windowMs | number | No |
Returns:
(req: Request, res: Response, next: NextFunction) => Response<any, Record<string, any>> \| undefined -
validateQuery
Generic validation middleware factory
Signature:
validateQuery(schema: z.ZodType<any, z.ZodTypeDef, any>): (req: Request, res: Response, next: NextFunction) => Response<any, Record<string, any>> | undefined
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
schema | z.ZodType<any, z.ZodTypeDef, any> | Yes |
Returns:
(req: Request, res: Response, next: NextFunction) => Response<any, Record<string, any>> \| undefined -