@ooneex/app 1.3.7 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -101,7 +101,7 @@ OPENAI_API_KEY=your_openai_key
101
101
  ANTHROPIC_API_KEY=your_anthropic_key
102
102
  CACHE_REDIS_URL=redis://localhost:6379
103
103
  DATABASE_URL=postgresql://user:pass@localhost:5432/db
104
- ANALYTICS_POSTHOG_API_KEY=your_posthog_key
104
+ ANALYTICS_POSTHOG_PROJECT_TOKEN=your_posthog_key
105
105
  ```
106
106
 
107
107
  ### Creating a Module
package/dist/index.js CHANGED
@@ -211,8 +211,8 @@ var validateResponse = (route, data) => {
211
211
  }
212
212
  return null;
213
213
  };
214
- var buildExceptionResponse = (context, message, status, env) => {
215
- return context.response.exception(message, { status }).get(env);
214
+ var buildExceptionResponse = (context, message, status, env, key) => {
215
+ return context.response.exception(message, { status, ...key ? { key } : {} }).get(env);
216
216
  };
217
217
  var logRequest = (context) => {
218
218
  const path = context.route?.path || "";
@@ -262,7 +262,7 @@ var executeController = async (controller, context) => {
262
262
  return [response, null];
263
263
  } catch (error) {
264
264
  if (error instanceof Exception) {
265
- return [null, { message: error.message, status: error.status }];
265
+ return [null, { message: error.message, status: error.status, key: error.key }];
266
266
  }
267
267
  if (error instanceof Error) {
268
268
  return [null, { message: error.message, status: HttpStatus.Code.InternalServerError }];
@@ -281,7 +281,7 @@ var httpRouteHandler = async ({ context, route }) => {
281
281
  const controller = container.get(route.controller);
282
282
  const [response, controllerError] = await executeController(controller, context);
283
283
  if (controllerError) {
284
- const httpResponse2 = buildExceptionResponse(context, controllerError.message, controllerError.status, currentEnv);
284
+ const httpResponse2 = buildExceptionResponse(context, controllerError.message, controllerError.status, currentEnv, controllerError.key);
285
285
  logRequest(context);
286
286
  return httpResponse2;
287
287
  }
@@ -317,7 +317,8 @@ var formatHttpRoutes = (httpRoutes, middlewares = [], prefix) => {
317
317
  } catch (error) {
318
318
  const env = context.env.APP_ENV;
319
319
  const status = error instanceof Exception ? error.status : HttpStatus.Code.InternalServerError;
320
- const httpResponse = buildExceptionResponse(context, error.message, status, env);
320
+ const key = error instanceof Exception ? error.key : null;
321
+ const httpResponse = buildExceptionResponse(context, error.message, status, env, key);
321
322
  logRequest(context);
322
323
  return httpResponse;
323
324
  }
@@ -418,8 +419,8 @@ var runMiddlewares2 = async (context, middlewares) => {
418
419
  }
419
420
  return currentContext;
420
421
  };
421
- var sendException = (context, message, status) => {
422
- context.response.exception(message, { status });
422
+ var sendException = (context, message, status, key) => {
423
+ context.response.exception(message, { status, ...key ? { key } : {} });
423
424
  return context.channel.send(context.response);
424
425
  };
425
426
  var logSocketRequest = (context, status, path) => {
@@ -500,8 +501,9 @@ var socketRouteHandler = async ({
500
501
  context = await runMiddlewares2(context, middlewares);
501
502
  } catch (error) {
502
503
  const status = error instanceof Exception2 ? error.status : HttpStatus2.Code.InternalServerError;
504
+ const key = error instanceof Exception2 ? error.key : null;
503
505
  logSocketRequest(context, status, route.path);
504
- return sendException(context, error.message, status);
506
+ return sendException(context, error.message, status, key);
505
507
  }
506
508
  const allowedUsersError = checkAllowedUsers(context);
507
509
  if (allowedUsersError) {
@@ -522,9 +524,10 @@ var socketRouteHandler = async ({
522
524
  context.response = await controller.index(context);
523
525
  } catch (error) {
524
526
  const status = error instanceof Exception2 ? error.status : HttpStatus2.Code.InternalServerError;
527
+ const key = error instanceof Exception2 ? error.key : null;
525
528
  const message2 = error instanceof Error ? error.message : "An unknown error occurred";
526
529
  logSocketRequest(context, status, route.path);
527
- return sendException(context, message2, status);
530
+ return sendException(context, message2, status, key);
528
531
  }
529
532
  const responseValidationError = validateResponse(route, context.response.getData());
530
533
  if (responseValidationError) {
@@ -687,9 +690,9 @@ class App {
687
690
  if (hostname === "0.0.0.0") {
688
691
  hostname = "localhost";
689
692
  }
690
- logger2.info(`Server running at ${server.protocol}://${hostname}:${server.port}`);
693
+ logger2.info(`Server running at ${server.protocol}//${hostname}:${server.port}`);
691
694
  if (this.config.check?.health) {
692
- const healthCheckUrl = `${server.protocol}://${hostname}:${server.port}${prefix ?? ""}${this.config.check.health}`;
695
+ const healthCheckUrl = `${server.protocol}//${hostname}:${server.port}${prefix ?? ""}${this.config.check.health}`;
693
696
  const response = await fetch(healthCheckUrl);
694
697
  if (response.ok) {
695
698
  logger2.info(`Health check passed at ${this.config.check.health}`);
@@ -730,4 +733,4 @@ export {
730
733
  App
731
734
  };
732
735
 
733
- //# debugId=860D356ACC3C1F8364756E2164756E21
736
+ //# debugId=5E685958EA4DE75664756E2164756E21
package/dist/index.js.map CHANGED
@@ -2,14 +2,14 @@
2
2
  "version": 3,
3
3
  "sources": ["src/App.ts", "src/httpRouteUtils.ts", "src/logger.ts", "src/socketRouteUtils.ts", "src/generateRouteDoc.ts", "src/generateRouteType.ts"],
4
4
  "sourcesContent": [
5
- "import { AppEnv, type IAppEnv } from \"@ooneex/app-env\";\nimport { container } from \"@ooneex/container\";\nimport type { ICron } from \"@ooneex/cron\";\nimport { Exception, type IException } from \"@ooneex/exception\";\nimport { HttpStatus } from \"@ooneex/http-status\";\nimport { type ILogger, type LogsEntity, TerminalLogger } from \"@ooneex/logger\";\nimport type { MiddlewareClassType, SocketMiddlewareClassType } from \"@ooneex/middleware\";\nimport type { IPubSub } from \"@ooneex/pub-sub\";\nimport { router } from \"@ooneex/routing\";\nimport type { ScalarType } from \"@ooneex/types\";\nimport { AssertAppEnv, AssertHostname, AssertPort } from \"@ooneex/validation/constraints\";\nimport type { BunRequest, Server, ServerWebSocket } from \"bun\";\nimport { buildHttpContext, formatHttpRoutes, logRequest, runMiddlewares } from \"./httpRouteUtils\";\nimport { logger as loggerFunc } from \"./logger\";\nimport { formatSocketRoutes, socketRouteHandler } from \"./socketRouteUtils\";\nimport type { AppConfigType } from \"./types\";\n\nexport class App {\n constructor(private readonly config: AppConfigType) {\n const { loggers, cronJobs, events, analytics, cache, database, storage, mailer, rateLimiter, onException } =\n this.config;\n\n if (!container.has(AppEnv)) {\n container.add(AppEnv);\n }\n\n loggers.forEach((log) => {\n if (!container.has(log)) {\n container.add(log);\n }\n const logger = container.get<ILogger<Record<string, ScalarType>> | ILogger<LogsEntity>>(log);\n logger.init();\n });\n container.addConstant(\"logger\", loggerFunc(loggers, container));\n\n if (!container.has(database)) {\n container.add(database);\n }\n container.addAlias(\"database\", database);\n\n if (onException) {\n if (!container.has(onException)) {\n container.add(onException);\n }\n container.addConstant(\"exception.logger\", onException);\n }\n\n if (analytics) {\n if (!container.has(analytics)) {\n container.add(analytics);\n }\n container.addAlias(\"analytics\", analytics);\n }\n\n if (cache) {\n if (!container.has(cache)) {\n container.add(cache);\n }\n container.addAlias(\"cache\", cache);\n }\n\n if (storage) {\n if (!container.has(storage)) {\n container.add(storage);\n }\n container.addAlias(\"storage\", storage);\n }\n\n if (mailer) {\n if (!container.has(mailer)) {\n container.add(mailer);\n }\n container.addAlias(\"mailer\", mailer);\n }\n\n if (rateLimiter) {\n if (!container.has(rateLimiter)) {\n container.add(rateLimiter);\n }\n container.addAlias(\"rateLimiter\", rateLimiter);\n }\n\n cronJobs?.forEach((cronJob) => {\n if (!container.has(cronJob)) {\n container.add(cronJob);\n }\n const cron = container.get<ICron>(cronJob);\n cron.start();\n });\n\n events?.forEach((event) => {\n if (!container.has(event)) {\n container.add(event);\n }\n const e = container.get<IPubSub>(event);\n e.subscribe();\n });\n }\n\n public async init(): Promise<App> {\n const env = container.get<IAppEnv>(AppEnv);\n\n const appEnvValidator = new AssertAppEnv();\n const appEnvResult = appEnvValidator.validate(env.APP_ENV);\n if (!appEnvResult.isValid) {\n throw new Exception(`Invalid APP_ENV: ${appEnvResult.message}`, {\n status: HttpStatus.Code.InternalServerError,\n data: { appEnv: env.APP_ENV },\n });\n }\n\n const portValidator = new AssertPort();\n const portResult = portValidator.validate(env.PORT);\n if (!portResult.isValid) {\n throw new Exception(`Invalid PORT: ${portResult.message}`, {\n status: HttpStatus.Code.InternalServerError,\n data: { port: env.PORT },\n });\n }\n\n const hostnameValidator = new AssertHostname();\n const hostnameResult = hostnameValidator.validate(env.HOST_NAME);\n if (!hostnameResult.isValid) {\n throw new Exception(`Invalid HOST_NAME: ${hostnameResult.message}`, {\n status: HttpStatus.Code.InternalServerError,\n data: { hostname: env.HOST_NAME },\n });\n }\n\n return this;\n }\n\n public async run(): Promise<App> {\n const logger = new TerminalLogger();\n\n try {\n await this.init();\n } catch (error: unknown) {\n logger.error(error as IException);\n process.exit(1);\n }\n\n const env = container.get<IAppEnv>(AppEnv);\n let hostname = env.HOST_NAME;\n\n const { middlewares = [], routing } = this.config;\n const prefix = routing?.prefix;\n\n const routes = {\n ...formatHttpRoutes(router.getHttpRoutes(), middlewares as MiddlewareClassType[], prefix),\n ...formatSocketRoutes(router.getSocketRoutes(), prefix),\n };\n\n const port = env.PORT;\n\n const server = Bun.serve({\n port,\n hostname,\n development: env.isLocal,\n routes: {\n ...routes,\n \"/*\": async (req: BunRequest, server: Server<unknown>) => {\n let context = await buildHttpContext({ req, server });\n context.response.notFound(\"Not Found\");\n\n if (this.config.cors) {\n context = await runMiddlewares(context, [this.config.cors]);\n }\n\n logRequest(context);\n\n return context.response.get();\n },\n },\n websocket: {\n perMessageDeflate: true,\n async message(ws: ServerWebSocket<{ id: string }>, message: string) {\n await socketRouteHandler({\n message,\n ws,\n server,\n middlewares: middlewares as SocketMiddlewareClassType[],\n });\n },\n async close(ws: ServerWebSocket<{ id: string }>) {\n container.removeConstant(ws.data.id);\n },\n },\n });\n\n hostname = server.hostname || \"0.0.0.0\";\n\n if (hostname === \"0.0.0.0\") {\n hostname = \"localhost\";\n }\n\n logger.info(`Server running at ${server.protocol}://${hostname}:${server.port}`);\n\n if (this.config.check?.health) {\n const healthCheckUrl = `${server.protocol}://${hostname}:${server.port}${prefix ?? \"\"}${this.config.check.health}`;\n const response = await fetch(healthCheckUrl);\n\n if (response.ok) {\n logger.info(`Health check passed at ${this.config.check.health}`);\n } else {\n logger.warn(`Health check failed at ${this.config.check.health} with status ${response.status}`);\n }\n }\n\n return this;\n }\n}\n",
6
- "import type { IAnalytics } from \"@ooneex/analytics\";\nimport { AppEnv, type EnvironmentNameType, type IAppEnv } from \"@ooneex/app-env\";\nimport type { ICache } from \"@ooneex/cache\";\nimport { container } from \"@ooneex/container\";\nimport type { ContextType } from \"@ooneex/controller\";\nimport type { IDatabase } from \"@ooneex/database\";\nimport { Exception } from \"@ooneex/exception\";\nimport { HttpRequest } from \"@ooneex/http-request\";\nimport { HttpResponse, type IResponse } from \"@ooneex/http-response\";\nimport { HttpStatus, type StatusCodeType } from \"@ooneex/http-status\";\nimport type { ILogger } from \"@ooneex/logger\";\nimport { LogsEntity } from \"@ooneex/logger\";\nimport type { IMailer } from \"@ooneex/mailer\";\nimport type { IMiddleware, MiddlewareClassType } from \"@ooneex/middleware\";\nimport type { IRateLimiter } from \"@ooneex/rate-limit\";\nimport { ERole, Role } from \"@ooneex/role\";\nimport type { RouteConfigType } from \"@ooneex/routing\";\nimport type { IStorage } from \"@ooneex/storage\";\nimport type { ScalarType } from \"@ooneex/types\";\nimport { type AssertType, type IAssert, type } from \"@ooneex/validation\";\nimport type { BunRequest, Server } from \"bun\";\n\nexport const checkAllowedUsers = (context: ContextType): RouteValidationError | null => {\n if (!context.user) {\n return null;\n }\n\n const systemUsers = context.env.SYSTEM_USERS;\n if (systemUsers?.includes(context.user.email)) {\n if (!context.user.roles.includes(ERole.SYSTEM)) {\n context.user.roles.push(ERole.SYSTEM);\n }\n }\n\n const superAdminUsers = context.env.SUPER_ADMIN_USERS;\n if (superAdminUsers?.includes(context.user.email)) {\n if (!context.user.roles.includes(ERole.SUPER_ADMIN)) {\n context.user.roles.push(ERole.SUPER_ADMIN);\n }\n }\n\n const adminUsers = context.env.ADMIN_USERS;\n if (adminUsers?.includes(context.user.email)) {\n if (!context.user.roles.includes(ERole.ADMIN)) {\n context.user.roles.push(ERole.ADMIN);\n }\n }\n\n const allowedUsersKey = `${context.env.APP_ENV.toUpperCase()}_ALLOWED_USERS` as keyof typeof context.env;\n const allowedUsers = context.env[allowedUsersKey] as string[] | undefined;\n\n if (allowedUsers && allowedUsers.length > 0 && !allowedUsers.includes(context.user.email)) {\n return {\n message: `User \"${context.user.email}\" is not allowed in \"${context.env.APP_ENV}\" environment`,\n status: HttpStatus.Code.Forbidden,\n };\n }\n\n return null;\n};\n\ntype HttpRouteHandler = (req: BunRequest, server: Server<unknown>) => Promise<Response>;\ntype HttpMethodHandlers = Partial<Record<string, HttpRouteHandler | Response>>;\ntype HttpRoutesMap = Record<string, HttpMethodHandlers>;\n\nexport const validateConstraint = (constraint: AssertType | IAssert, value: unknown): string | null => {\n if (\n constraint !== null &&\n typeof constraint === \"object\" &&\n \"validate\" in constraint &&\n typeof constraint.validate === \"function\"\n ) {\n const result = constraint.validate(value);\n if (!result.isValid) {\n return result.message || \"Validation failed\";\n }\n } else if (typeof constraint === \"function\") {\n const result = constraint(value);\n if (result instanceof type.errors) {\n return result.summary;\n }\n }\n\n return null;\n};\n\nexport const buildHttpContext = async (ctx: {\n req: BunRequest;\n server: Server<unknown>;\n route?: RouteConfigType;\n}): Promise<ContextType> => {\n const { req, server, route } = ctx;\n\n const address = server.requestIP(req);\n const ip = address?.address ?? \"unknown\";\n\n const response = new HttpResponse();\n\n let payload = {};\n let form: FormData | null = null;\n const contentType = req.headers.get(\"content-type\");\n if (contentType?.includes(\"application/json\")) {\n try {\n payload = await req.json();\n } catch (_e) {}\n } else {\n try {\n form = await req.formData();\n } catch (_e) {}\n }\n\n const request = new HttpRequest(req, {\n params: req.params,\n payload,\n form,\n ip,\n });\n\n const tryGet = <T>(key: string): T | undefined => {\n try {\n return container.get<T>(key);\n } catch {\n return undefined;\n }\n };\n\n const exceptionLogger = container.hasConstant(\"exception.logger\")\n ? container.getConstant<ILogger>(\"exception.logger\")\n : undefined;\n const analytics = tryGet<IAnalytics>(\"analytics\");\n const cache = tryGet<ICache>(\"cache\");\n const storage = tryGet<IStorage>(\"storage\");\n const mailer = tryGet<IMailer>(\"mailer\");\n const rateLimiter = tryGet<IRateLimiter>(\"rateLimiter\");\n const database: IDatabase = container.get(\"database\");\n\n const context: ContextType = {\n logger: container.get(\"logger\"),\n ...(exceptionLogger && { exceptionLogger }),\n ...(analytics && { analytics }),\n ...(cache && { cache }),\n ...(storage && { storage }),\n ...(mailer && { mailer }),\n ...(rateLimiter && { rateLimiter }),\n database,\n route: route\n ? {\n name: route.name,\n path: route.path,\n method: route.method,\n version: route.version,\n description: route.description ?? \"\",\n }\n : null,\n env: container.get<IAppEnv>(AppEnv),\n response,\n request,\n params: request.params,\n payload: request.payload,\n queries: request.queries,\n method: request.method,\n header: request.header,\n files: request.files,\n ip: request.ip,\n host: request.host,\n language: request.language,\n user: null,\n };\n\n return context;\n};\n\ntype ControllerError = { message: string; status: StatusCodeType };\ntype RouteValidationError = { message: string; status: StatusCodeType };\n\nexport const validateRouteAccess = async (\n context: ContextType,\n route: RouteConfigType,\n currentEnv: EnvironmentNameType,\n): Promise<RouteValidationError | null> => {\n // Check params\n if (route.params) {\n for (const [paramName, constraint] of Object.entries(route.params)) {\n const error = validateConstraint(constraint, context.params?.[paramName]);\n if (error) {\n return {\n message: `Invalid parameter \"${paramName}\": ${error}`,\n status: HttpStatus.Code.BadRequest,\n };\n }\n }\n }\n\n // Check queries\n if (route.queries) {\n const error = validateConstraint(route.queries, context.queries);\n if (error) {\n return {\n message: `Invalid query parameters: ${error}`,\n status: HttpStatus.Code.BadRequest,\n };\n }\n }\n\n // Check payload\n if (route.payload) {\n const error = validateConstraint(route.payload, context.payload);\n if (error) {\n return {\n message: `Invalid payload: ${error}`,\n status: HttpStatus.Code.BadRequest,\n };\n }\n }\n\n // Check env\n if (route.env && route.env.length > 0 && !route.env.includes(currentEnv)) {\n return {\n message: `Route \"${route.name}\" is not available in \"${currentEnv}\" environment`,\n status: HttpStatus.Code.NotAcceptable,\n };\n }\n\n // Check ip\n if (route.ip && route.ip.length > 0 && (!context.ip || !route.ip.includes(context.ip))) {\n return {\n message: `Route \"${route.name}\" is not available for IP \"${context.ip}\"`,\n status: HttpStatus.Code.NotAcceptable,\n };\n }\n\n // Check host\n if (route.host && route.host.length > 0 && !route.host.includes(context.host)) {\n return {\n message: `Route \"${route.name}\" is not available for host \"${context.host}\"`,\n status: HttpStatus.Code.NotAcceptable,\n };\n }\n\n // Check roles\n if (route.roles && route.roles.length > 0) {\n if (!context.user || !context.user.roles || context.user.roles.length === 0) {\n return {\n message: `Route \"${route.name}\" requires authentication`,\n status: HttpStatus.Code.Forbidden,\n };\n }\n\n const role = new Role();\n const hasRequiredRole = route.roles.some((requiredRole) =>\n context.user?.roles.some((userRole) => role.hasRole(userRole, requiredRole)),\n );\n\n if (!hasRequiredRole) {\n return {\n message: `Route \"${route.name}\" is not accessible for user roles`,\n status: HttpStatus.Code.NotAcceptable,\n };\n }\n }\n\n return null;\n};\n\nexport const validateResponse = (route: RouteConfigType, data: unknown): RouteValidationError | null => {\n if (route.response) {\n const error = validateConstraint(route.response, data);\n if (error) {\n return {\n message: `Invalid response: ${error}`,\n status: HttpStatus.Code.NotAcceptable,\n };\n }\n }\n return null;\n};\n\nconst buildExceptionResponse = (\n context: ContextType,\n message: string,\n status: StatusCodeType,\n env: EnvironmentNameType,\n): Response => {\n return context.response.exception(message, { status }).get(env);\n};\n\nexport const logRequest = (context: ContextType): void => {\n const path = context.route?.path || \"\";\n const logger = context.logger as {\n success: (message: string, data?: LogsEntity) => void;\n info: (message: string, data?: LogsEntity) => void;\n warn: (message: string, data?: LogsEntity) => void;\n error: (message: string, data?: LogsEntity) => void;\n };\n\n if (!logger) {\n return;\n }\n\n const status = context.response.getStatus();\n const logData = new LogsEntity();\n logData.date = new Date();\n logData.status = status;\n logData.method = context.method;\n logData.path = path;\n logData.params = context.params as Record<string, ScalarType>;\n logData.payload = context.payload as Record<string, unknown>;\n logData.queries = context.queries as Record<string, ScalarType>;\n\n if (context.ip) logData.ip = context.ip;\n\n const userAgent = context.header.get(\"User-Agent\");\n if (userAgent) logData.userAgent = userAgent;\n\n const referer = context.header.getReferer();\n if (referer) logData.referer = referer;\n\n if (context.user?.id) logData.userId = context.user.id;\n if (context.user?.email) logData.email = context.user.email;\n if (context.user?.lastName) logData.lastName = context.user.lastName;\n if (context.user?.firstName) logData.firstName = context.user.firstName;\n\n const message = `${context.method} ${path}`;\n\n if (status >= 500) {\n logger.error(message, logData);\n } else if (status >= 400) {\n logger.warn(message, logData);\n } else if (status >= 300) {\n logger.info(message, logData);\n } else {\n logger.success(message, logData);\n }\n};\n\nconst executeController = async (\n controller: { index: (context: ContextType) => Promise<IResponse> | IResponse },\n context: ContextType,\n): Promise<[IResponse, null] | [null, ControllerError]> => {\n try {\n const response = await controller.index(context);\n return [response, null];\n } catch (error: unknown) {\n if (error instanceof Exception) {\n return [null, { message: error.message, status: error.status as StatusCodeType }];\n }\n if (error instanceof Error) {\n return [null, { message: error.message, status: HttpStatus.Code.InternalServerError }];\n }\n return [null, { message: \"An unknown error occurred\", status: HttpStatus.Code.InternalServerError }];\n }\n};\n\ntype HttpRouteHandlerOptions = {\n context: ContextType;\n route: RouteConfigType;\n};\n\nexport const httpRouteHandler = async ({ context, route }: HttpRouteHandlerOptions): Promise<Response> => {\n const currentEnv = context.env.APP_ENV;\n\n const validationError = await validateRouteAccess(context, route, currentEnv);\n if (validationError) {\n const httpResponse = buildExceptionResponse(context, validationError.message, validationError.status, currentEnv);\n logRequest(context);\n return httpResponse;\n }\n\n const controller = container.get(route.controller);\n\n const [response, controllerError] = await executeController(controller, context);\n if (controllerError) {\n const httpResponse = buildExceptionResponse(context, controllerError.message, controllerError.status, currentEnv);\n logRequest(context);\n return httpResponse;\n }\n\n const responseValidationError = validateResponse(route, response.getData());\n if (responseValidationError) {\n const httpResponse = buildExceptionResponse(\n context,\n responseValidationError.message,\n responseValidationError.status,\n currentEnv,\n );\n logRequest(context);\n return httpResponse;\n }\n\n const httpResponse = response.get(currentEnv);\n logRequest(context);\n\n return httpResponse;\n};\n\nexport const runMiddlewares = async (\n context: ContextType,\n middlewares: MiddlewareClassType[],\n): Promise<ContextType> => {\n let currentContext = context;\n\n for (const MiddlewareClass of middlewares) {\n const middleware = container.get<IMiddleware>(MiddlewareClass);\n currentContext = await middleware.handler(currentContext);\n }\n\n return currentContext;\n};\n\nexport const formatHttpRoutes = (\n httpRoutes: Map<string, RouteConfigType[]>,\n middlewares: MiddlewareClassType[] = [],\n prefix?: string,\n): HttpRoutesMap => {\n const routes: HttpRoutesMap = {};\n\n for (const [path, routeConfigs] of httpRoutes) {\n for (const route of routeConfigs) {\n const versionedPath = `/${prefix ? `${prefix}/` : \"\"}v${route.version}${path}`;\n\n routes[versionedPath] ??= {};\n const methodHandlers = routes[versionedPath];\n\n methodHandlers[route.method] = async (req: BunRequest, server: Server<unknown>) => {\n let context = await buildHttpContext({ req, server, route });\n\n try {\n context = await runMiddlewares(context, middlewares);\n } catch (error: unknown) {\n const env: EnvironmentNameType = context.env.APP_ENV;\n const status = (\n error instanceof Exception ? error.status : HttpStatus.Code.InternalServerError\n ) as StatusCodeType;\n const httpResponse = buildExceptionResponse(context, (error as Error).message, status, env);\n logRequest(context);\n return httpResponse;\n }\n\n // Check allowed users\n const allowedUsersError = checkAllowedUsers(context);\n if (allowedUsersError) {\n const httpResponse = buildExceptionResponse(\n context,\n allowedUsersError.message,\n allowedUsersError.status,\n context.env.APP_ENV,\n );\n logRequest(context);\n return httpResponse;\n }\n\n if (route.permission) {\n const permission = container.get(route.permission);\n context.permission = permission.allow().setUserPermissions(context.user).build();\n }\n\n return httpRouteHandler({ context, route });\n };\n }\n }\n\n return routes;\n};\n",
5
+ "import { AppEnv, type IAppEnv } from \"@ooneex/app-env\";\nimport { container } from \"@ooneex/container\";\nimport type { ICron } from \"@ooneex/cron\";\nimport { Exception, type IException } from \"@ooneex/exception\";\nimport { HttpStatus } from \"@ooneex/http-status\";\nimport { type ILogger, type LogsEntity, TerminalLogger } from \"@ooneex/logger\";\nimport type { MiddlewareClassType, SocketMiddlewareClassType } from \"@ooneex/middleware\";\nimport type { IPubSub } from \"@ooneex/pub-sub\";\nimport { router } from \"@ooneex/routing\";\nimport type { ScalarType } from \"@ooneex/types\";\nimport { AssertAppEnv, AssertHostname, AssertPort } from \"@ooneex/validation/constraints\";\nimport type { BunRequest, Server, ServerWebSocket } from \"bun\";\nimport { buildHttpContext, formatHttpRoutes, logRequest, runMiddlewares } from \"./httpRouteUtils\";\nimport { logger as loggerFunc } from \"./logger\";\nimport { formatSocketRoutes, socketRouteHandler } from \"./socketRouteUtils\";\nimport type { AppConfigType } from \"./types\";\n\nexport class App {\n constructor(private readonly config: AppConfigType) {\n const { loggers, cronJobs, events, analytics, cache, database, storage, mailer, rateLimiter, onException } =\n this.config;\n\n if (!container.has(AppEnv)) {\n container.add(AppEnv);\n }\n\n loggers.forEach((log) => {\n if (!container.has(log)) {\n container.add(log);\n }\n const logger = container.get<ILogger<Record<string, ScalarType>> | ILogger<LogsEntity>>(log);\n logger.init();\n });\n container.addConstant(\"logger\", loggerFunc(loggers, container));\n\n if (!container.has(database)) {\n container.add(database);\n }\n container.addAlias(\"database\", database);\n\n if (onException) {\n if (!container.has(onException)) {\n container.add(onException);\n }\n container.addConstant(\"exception.logger\", onException);\n }\n\n if (analytics) {\n if (!container.has(analytics)) {\n container.add(analytics);\n }\n container.addAlias(\"analytics\", analytics);\n }\n\n if (cache) {\n if (!container.has(cache)) {\n container.add(cache);\n }\n container.addAlias(\"cache\", cache);\n }\n\n if (storage) {\n if (!container.has(storage)) {\n container.add(storage);\n }\n container.addAlias(\"storage\", storage);\n }\n\n if (mailer) {\n if (!container.has(mailer)) {\n container.add(mailer);\n }\n container.addAlias(\"mailer\", mailer);\n }\n\n if (rateLimiter) {\n if (!container.has(rateLimiter)) {\n container.add(rateLimiter);\n }\n container.addAlias(\"rateLimiter\", rateLimiter);\n }\n\n cronJobs?.forEach((cronJob) => {\n if (!container.has(cronJob)) {\n container.add(cronJob);\n }\n const cron = container.get<ICron>(cronJob);\n cron.start();\n });\n\n events?.forEach((event) => {\n if (!container.has(event)) {\n container.add(event);\n }\n const e = container.get<IPubSub>(event);\n e.subscribe();\n });\n }\n\n public async init(): Promise<App> {\n const env = container.get<IAppEnv>(AppEnv);\n\n const appEnvValidator = new AssertAppEnv();\n const appEnvResult = appEnvValidator.validate(env.APP_ENV);\n if (!appEnvResult.isValid) {\n throw new Exception(`Invalid APP_ENV: ${appEnvResult.message}`, {\n status: HttpStatus.Code.InternalServerError,\n data: { appEnv: env.APP_ENV },\n });\n }\n\n const portValidator = new AssertPort();\n const portResult = portValidator.validate(env.PORT);\n if (!portResult.isValid) {\n throw new Exception(`Invalid PORT: ${portResult.message}`, {\n status: HttpStatus.Code.InternalServerError,\n data: { port: env.PORT },\n });\n }\n\n const hostnameValidator = new AssertHostname();\n const hostnameResult = hostnameValidator.validate(env.HOST_NAME);\n if (!hostnameResult.isValid) {\n throw new Exception(`Invalid HOST_NAME: ${hostnameResult.message}`, {\n status: HttpStatus.Code.InternalServerError,\n data: { hostname: env.HOST_NAME },\n });\n }\n\n return this;\n }\n\n public async run(): Promise<App> {\n const logger = new TerminalLogger();\n\n try {\n await this.init();\n } catch (error: unknown) {\n logger.error(error as IException);\n process.exit(1);\n }\n\n const env = container.get<IAppEnv>(AppEnv);\n let hostname = env.HOST_NAME;\n\n const { middlewares = [], routing } = this.config;\n const prefix = routing?.prefix;\n\n const routes = {\n ...formatHttpRoutes(router.getHttpRoutes(), middlewares as MiddlewareClassType[], prefix),\n ...formatSocketRoutes(router.getSocketRoutes(), prefix),\n };\n\n const port = env.PORT;\n\n const server = Bun.serve({\n port,\n hostname,\n development: env.isLocal,\n routes: {\n ...routes,\n \"/*\": async (req: BunRequest, server: Server<unknown>) => {\n let context = await buildHttpContext({ req, server });\n context.response.notFound(\"Not Found\");\n\n if (this.config.cors) {\n context = await runMiddlewares(context, [this.config.cors]);\n }\n\n logRequest(context);\n\n return context.response.get();\n },\n },\n websocket: {\n perMessageDeflate: true,\n async message(ws: ServerWebSocket<{ id: string }>, message: string) {\n await socketRouteHandler({\n message,\n ws,\n server,\n middlewares: middlewares as SocketMiddlewareClassType[],\n });\n },\n async close(ws: ServerWebSocket<{ id: string }>) {\n container.removeConstant(ws.data.id);\n },\n },\n });\n\n hostname = server.hostname || \"0.0.0.0\";\n\n if (hostname === \"0.0.0.0\") {\n hostname = \"localhost\";\n }\n\n logger.info(`Server running at ${server.protocol}//${hostname}:${server.port}`);\n\n if (this.config.check?.health) {\n const healthCheckUrl = `${server.protocol}//${hostname}:${server.port}${prefix ?? \"\"}${this.config.check.health}`;\n const response = await fetch(healthCheckUrl);\n\n if (response.ok) {\n logger.info(`Health check passed at ${this.config.check.health}`);\n } else {\n logger.warn(`Health check failed at ${this.config.check.health} with status ${response.status}`);\n }\n }\n\n return this;\n }\n}\n",
6
+ "import type { IAnalytics } from \"@ooneex/analytics\";\nimport { AppEnv, type EnvironmentNameType, type IAppEnv } from \"@ooneex/app-env\";\nimport type { ICache } from \"@ooneex/cache\";\nimport { container } from \"@ooneex/container\";\nimport type { ContextType } from \"@ooneex/controller\";\nimport type { IDatabase } from \"@ooneex/database\";\nimport { Exception } from \"@ooneex/exception\";\nimport { HttpRequest } from \"@ooneex/http-request\";\nimport { HttpResponse, type IResponse } from \"@ooneex/http-response\";\nimport { HttpStatus, type StatusCodeType } from \"@ooneex/http-status\";\nimport type { ILogger } from \"@ooneex/logger\";\nimport { LogsEntity } from \"@ooneex/logger\";\nimport type { IMailer } from \"@ooneex/mailer\";\nimport type { IMiddleware, MiddlewareClassType } from \"@ooneex/middleware\";\nimport type { IRateLimiter } from \"@ooneex/rate-limit\";\nimport { ERole, Role } from \"@ooneex/role\";\nimport type { RouteConfigType } from \"@ooneex/routing\";\nimport type { IStorage } from \"@ooneex/storage\";\nimport type { ScalarType } from \"@ooneex/types\";\nimport { type AssertType, type IAssert, type } from \"@ooneex/validation\";\nimport type { BunRequest, Server } from \"bun\";\n\nexport const checkAllowedUsers = (context: ContextType): RouteValidationError | null => {\n if (!context.user) {\n return null;\n }\n\n const systemUsers = context.env.SYSTEM_USERS;\n if (systemUsers?.includes(context.user.email)) {\n if (!context.user.roles.includes(ERole.SYSTEM)) {\n context.user.roles.push(ERole.SYSTEM);\n }\n }\n\n const superAdminUsers = context.env.SUPER_ADMIN_USERS;\n if (superAdminUsers?.includes(context.user.email)) {\n if (!context.user.roles.includes(ERole.SUPER_ADMIN)) {\n context.user.roles.push(ERole.SUPER_ADMIN);\n }\n }\n\n const adminUsers = context.env.ADMIN_USERS;\n if (adminUsers?.includes(context.user.email)) {\n if (!context.user.roles.includes(ERole.ADMIN)) {\n context.user.roles.push(ERole.ADMIN);\n }\n }\n\n const allowedUsersKey = `${context.env.APP_ENV.toUpperCase()}_ALLOWED_USERS` as keyof typeof context.env;\n const allowedUsers = context.env[allowedUsersKey] as string[] | undefined;\n\n if (allowedUsers && allowedUsers.length > 0 && !allowedUsers.includes(context.user.email)) {\n return {\n message: `User \"${context.user.email}\" is not allowed in \"${context.env.APP_ENV}\" environment`,\n status: HttpStatus.Code.Forbidden,\n };\n }\n\n return null;\n};\n\ntype HttpRouteHandler = (req: BunRequest, server: Server<unknown>) => Promise<Response>;\ntype HttpMethodHandlers = Partial<Record<string, HttpRouteHandler | Response>>;\ntype HttpRoutesMap = Record<string, HttpMethodHandlers>;\n\nexport const validateConstraint = (constraint: AssertType | IAssert, value: unknown): string | null => {\n if (\n constraint !== null &&\n typeof constraint === \"object\" &&\n \"validate\" in constraint &&\n typeof constraint.validate === \"function\"\n ) {\n const result = constraint.validate(value);\n if (!result.isValid) {\n return result.message || \"Validation failed\";\n }\n } else if (typeof constraint === \"function\") {\n const result = constraint(value);\n if (result instanceof type.errors) {\n return result.summary;\n }\n }\n\n return null;\n};\n\nexport const buildHttpContext = async (ctx: {\n req: BunRequest;\n server: Server<unknown>;\n route?: RouteConfigType;\n}): Promise<ContextType> => {\n const { req, server, route } = ctx;\n\n const address = server.requestIP(req);\n const ip = address?.address ?? \"unknown\";\n\n const response = new HttpResponse();\n\n let payload = {};\n let form: FormData | null = null;\n const contentType = req.headers.get(\"content-type\");\n if (contentType?.includes(\"application/json\")) {\n try {\n payload = await req.json();\n } catch (_e) {}\n } else {\n try {\n form = await req.formData();\n } catch (_e) {}\n }\n\n const request = new HttpRequest(req, {\n params: req.params,\n payload,\n form,\n ip,\n });\n\n const tryGet = <T>(key: string): T | undefined => {\n try {\n return container.get<T>(key);\n } catch {\n return undefined;\n }\n };\n\n const exceptionLogger = container.hasConstant(\"exception.logger\")\n ? container.getConstant<ILogger>(\"exception.logger\")\n : undefined;\n const analytics = tryGet<IAnalytics>(\"analytics\");\n const cache = tryGet<ICache>(\"cache\");\n const storage = tryGet<IStorage>(\"storage\");\n const mailer = tryGet<IMailer>(\"mailer\");\n const rateLimiter = tryGet<IRateLimiter>(\"rateLimiter\");\n const database: IDatabase = container.get(\"database\");\n\n const context: ContextType = {\n logger: container.get(\"logger\"),\n ...(exceptionLogger && { exceptionLogger }),\n ...(analytics && { analytics }),\n ...(cache && { cache }),\n ...(storage && { storage }),\n ...(mailer && { mailer }),\n ...(rateLimiter && { rateLimiter }),\n database,\n route: route\n ? {\n name: route.name,\n path: route.path,\n method: route.method,\n version: route.version,\n description: route.description ?? \"\",\n }\n : null,\n env: container.get<IAppEnv>(AppEnv),\n response,\n request,\n params: request.params,\n payload: request.payload,\n queries: request.queries,\n method: request.method,\n header: request.header,\n files: request.files,\n ip: request.ip,\n host: request.host,\n language: request.language,\n user: null,\n };\n\n return context;\n};\n\ntype ControllerError = { message: string; status: StatusCodeType; key?: string | null };\ntype RouteValidationError = { message: string; status: StatusCodeType; key?: string | null };\n\nexport const validateRouteAccess = async (\n context: ContextType,\n route: RouteConfigType,\n currentEnv: EnvironmentNameType,\n): Promise<RouteValidationError | null> => {\n // Check params\n if (route.params) {\n for (const [paramName, constraint] of Object.entries(route.params)) {\n const error = validateConstraint(constraint, context.params?.[paramName]);\n if (error) {\n return {\n message: `Invalid parameter \"${paramName}\": ${error}`,\n status: HttpStatus.Code.BadRequest,\n };\n }\n }\n }\n\n // Check queries\n if (route.queries) {\n const error = validateConstraint(route.queries, context.queries);\n if (error) {\n return {\n message: `Invalid query parameters: ${error}`,\n status: HttpStatus.Code.BadRequest,\n };\n }\n }\n\n // Check payload\n if (route.payload) {\n const error = validateConstraint(route.payload, context.payload);\n if (error) {\n return {\n message: `Invalid payload: ${error}`,\n status: HttpStatus.Code.BadRequest,\n };\n }\n }\n\n // Check env\n if (route.env && route.env.length > 0 && !route.env.includes(currentEnv)) {\n return {\n message: `Route \"${route.name}\" is not available in \"${currentEnv}\" environment`,\n status: HttpStatus.Code.NotAcceptable,\n };\n }\n\n // Check ip\n if (route.ip && route.ip.length > 0 && (!context.ip || !route.ip.includes(context.ip))) {\n return {\n message: `Route \"${route.name}\" is not available for IP \"${context.ip}\"`,\n status: HttpStatus.Code.NotAcceptable,\n };\n }\n\n // Check host\n if (route.host && route.host.length > 0 && !route.host.includes(context.host)) {\n return {\n message: `Route \"${route.name}\" is not available for host \"${context.host}\"`,\n status: HttpStatus.Code.NotAcceptable,\n };\n }\n\n // Check roles\n if (route.roles && route.roles.length > 0) {\n if (!context.user || !context.user.roles || context.user.roles.length === 0) {\n return {\n message: `Route \"${route.name}\" requires authentication`,\n status: HttpStatus.Code.Forbidden,\n };\n }\n\n const role = new Role();\n const hasRequiredRole = route.roles.some((requiredRole) =>\n context.user?.roles.some((userRole) => role.hasRole(userRole, requiredRole)),\n );\n\n if (!hasRequiredRole) {\n return {\n message: `Route \"${route.name}\" is not accessible for user roles`,\n status: HttpStatus.Code.NotAcceptable,\n };\n }\n }\n\n return null;\n};\n\nexport const validateResponse = (route: RouteConfigType, data: unknown): RouteValidationError | null => {\n if (route.response) {\n const error = validateConstraint(route.response, data);\n if (error) {\n return {\n message: `Invalid response: ${error}`,\n status: HttpStatus.Code.NotAcceptable,\n };\n }\n }\n return null;\n};\n\nconst buildExceptionResponse = (\n context: ContextType,\n message: string,\n status: StatusCodeType,\n env: EnvironmentNameType,\n key?: string | null,\n): Response => {\n return context.response.exception(message, { status, ...(key ? { key } : {}) }).get(env);\n};\n\nexport const logRequest = (context: ContextType): void => {\n const path = context.route?.path || \"\";\n const logger = context.logger as {\n success: (message: string, data?: LogsEntity) => void;\n info: (message: string, data?: LogsEntity) => void;\n warn: (message: string, data?: LogsEntity) => void;\n error: (message: string, data?: LogsEntity) => void;\n };\n\n if (!logger) {\n return;\n }\n\n const status = context.response.getStatus();\n const logData = new LogsEntity();\n logData.date = new Date();\n logData.status = status;\n logData.method = context.method;\n logData.path = path;\n logData.params = context.params as Record<string, ScalarType>;\n logData.payload = context.payload as Record<string, unknown>;\n logData.queries = context.queries as Record<string, ScalarType>;\n\n if (context.ip) logData.ip = context.ip;\n\n const userAgent = context.header.get(\"User-Agent\");\n if (userAgent) logData.userAgent = userAgent;\n\n const referer = context.header.getReferer();\n if (referer) logData.referer = referer;\n\n if (context.user?.id) logData.userId = context.user.id;\n if (context.user?.email) logData.email = context.user.email;\n if (context.user?.lastName) logData.lastName = context.user.lastName;\n if (context.user?.firstName) logData.firstName = context.user.firstName;\n\n const message = `${context.method} ${path}`;\n\n if (status >= 500) {\n logger.error(message, logData);\n } else if (status >= 400) {\n logger.warn(message, logData);\n } else if (status >= 300) {\n logger.info(message, logData);\n } else {\n logger.success(message, logData);\n }\n};\n\nconst executeController = async (\n controller: { index: (context: ContextType) => Promise<IResponse> | IResponse },\n context: ContextType,\n): Promise<[IResponse, null] | [null, ControllerError]> => {\n try {\n const response = await controller.index(context);\n return [response, null];\n } catch (error: unknown) {\n if (error instanceof Exception) {\n return [null, { message: error.message, status: error.status as StatusCodeType, key: error.key }];\n }\n if (error instanceof Error) {\n return [null, { message: error.message, status: HttpStatus.Code.InternalServerError }];\n }\n return [null, { message: \"An unknown error occurred\", status: HttpStatus.Code.InternalServerError }];\n }\n};\n\ntype HttpRouteHandlerOptions = {\n context: ContextType;\n route: RouteConfigType;\n};\n\nexport const httpRouteHandler = async ({ context, route }: HttpRouteHandlerOptions): Promise<Response> => {\n const currentEnv = context.env.APP_ENV;\n\n const validationError = await validateRouteAccess(context, route, currentEnv);\n if (validationError) {\n const httpResponse = buildExceptionResponse(context, validationError.message, validationError.status, currentEnv);\n logRequest(context);\n return httpResponse;\n }\n\n const controller = container.get(route.controller);\n\n const [response, controllerError] = await executeController(controller, context);\n if (controllerError) {\n const httpResponse = buildExceptionResponse(\n context,\n controllerError.message,\n controllerError.status,\n currentEnv,\n controllerError.key,\n );\n logRequest(context);\n return httpResponse;\n }\n\n const responseValidationError = validateResponse(route, response.getData());\n if (responseValidationError) {\n const httpResponse = buildExceptionResponse(\n context,\n responseValidationError.message,\n responseValidationError.status,\n currentEnv,\n );\n logRequest(context);\n return httpResponse;\n }\n\n const httpResponse = response.get(currentEnv);\n logRequest(context);\n\n return httpResponse;\n};\n\nexport const runMiddlewares = async (\n context: ContextType,\n middlewares: MiddlewareClassType[],\n): Promise<ContextType> => {\n let currentContext = context;\n\n for (const MiddlewareClass of middlewares) {\n const middleware = container.get<IMiddleware>(MiddlewareClass);\n currentContext = await middleware.handler(currentContext);\n }\n\n return currentContext;\n};\n\nexport const formatHttpRoutes = (\n httpRoutes: Map<string, RouteConfigType[]>,\n middlewares: MiddlewareClassType[] = [],\n prefix?: string,\n): HttpRoutesMap => {\n const routes: HttpRoutesMap = {};\n\n for (const [path, routeConfigs] of httpRoutes) {\n for (const route of routeConfigs) {\n const versionedPath = `/${prefix ? `${prefix}/` : \"\"}v${route.version}${path}`;\n\n routes[versionedPath] ??= {};\n const methodHandlers = routes[versionedPath];\n\n methodHandlers[route.method] = async (req: BunRequest, server: Server<unknown>) => {\n let context = await buildHttpContext({ req, server, route });\n\n try {\n context = await runMiddlewares(context, middlewares);\n } catch (error: unknown) {\n const env: EnvironmentNameType = context.env.APP_ENV;\n const status = (\n error instanceof Exception ? error.status : HttpStatus.Code.InternalServerError\n ) as StatusCodeType;\n const key = error instanceof Exception ? error.key : null;\n const httpResponse = buildExceptionResponse(context, (error as Error).message, status, env, key);\n logRequest(context);\n return httpResponse;\n }\n\n // Check allowed users\n const allowedUsersError = checkAllowedUsers(context);\n if (allowedUsersError) {\n const httpResponse = buildExceptionResponse(\n context,\n allowedUsersError.message,\n allowedUsersError.status,\n context.env.APP_ENV,\n );\n logRequest(context);\n return httpResponse;\n }\n\n if (route.permission) {\n const permission = container.get(route.permission);\n context.permission = permission.allow().setUserPermissions(context.user).build();\n }\n\n return httpRouteHandler({ context, route });\n };\n }\n }\n\n return routes;\n};\n",
7
7
  "import type { IContainer } from \"@ooneex/container\";\nimport type { IException } from \"@ooneex/exception\";\nimport type { ILogger, LoggerClassType, LogsEntity } from \"@ooneex/logger\";\nimport type { ScalarType } from \"@ooneex/types\";\n\nexport const logger = (loggers: LoggerClassType[], container: IContainer) => ({\n error: (message: string | IException, data?: Record<string, ScalarType> & LogsEntity) => {\n loggers.forEach((logger) => {\n const log = container.get<ILogger<Record<string, ScalarType>> | ILogger<LogsEntity>>(logger);\n if (log) {\n log.error(message, data);\n }\n });\n },\n warn: (message: string, data?: Record<string, ScalarType> & LogsEntity) => {\n loggers.forEach((logger) => {\n const log = container.get<ILogger<Record<string, ScalarType>> | ILogger<LogsEntity>>(logger);\n if (log) {\n log.warn(message, data);\n }\n });\n },\n info: (message: string, data?: Record<string, ScalarType> & LogsEntity) => {\n loggers.forEach((logger) => {\n const log = container.get<ILogger<Record<string, ScalarType>> | ILogger<LogsEntity>>(logger);\n if (log) {\n log.info(message, data);\n }\n });\n },\n debug: (message: string, data?: Record<string, ScalarType> & LogsEntity) => {\n loggers.forEach((logger) => {\n const log = container.get<ILogger<Record<string, ScalarType>> | ILogger<LogsEntity>>(logger);\n if (log) {\n log.debug(message, data);\n }\n });\n },\n log: (message: string, data?: Record<string, ScalarType> & LogsEntity) => {\n loggers.forEach((logger) => {\n const log = container.get<ILogger<Record<string, ScalarType>> | ILogger<LogsEntity>>(logger);\n if (log) {\n log.log(message, data);\n }\n });\n },\n success: (message: string, data?: Record<string, ScalarType> & LogsEntity) => {\n loggers.forEach((logger) => {\n const log = container.get<ILogger<Record<string, ScalarType>> | ILogger<LogsEntity>>(logger);\n if (log) {\n log.success(message, data);\n }\n });\n },\n});\n",
8
- "import type { EnvironmentNameType } from \"@ooneex/app-env\";\nimport { container } from \"@ooneex/container\";\nimport { Exception } from \"@ooneex/exception\";\nimport type { IResponse } from \"@ooneex/http-response\";\nimport { HttpStatus, type StatusCodeType } from \"@ooneex/http-status\";\nimport { LogsEntity } from \"@ooneex/logger\";\nimport type { ISocketMiddleware, SocketMiddlewareClassType } from \"@ooneex/middleware\";\nimport type { RouteConfigType } from \"@ooneex/routing\";\nimport type { ContextType } from \"@ooneex/socket\";\nimport type { RequestDataType } from \"@ooneex/socket-client\";\nimport type { LocaleInfoType } from \"@ooneex/translation\";\nimport type { ScalarType } from \"@ooneex/types\";\nimport { random } from \"@ooneex/utils\";\nimport type { BunRequest, Server, ServerWebSocket } from \"bun\";\nimport { buildHttpContext, checkAllowedUsers, validateResponse, validateRouteAccess } from \"./httpRouteUtils\";\n\ntype SocketRouteHandler = (req: BunRequest, server: Server<unknown>) => Promise<undefined>;\ntype SocketRoutesMap = Record<string, SocketRouteHandler>;\n\nexport const formatSocketRoutes = (socketRoutes: Map<string, RouteConfigType>, prefix?: string): SocketRoutesMap => {\n const routes: SocketRoutesMap = {};\n\n for (const [path, route] of socketRoutes) {\n const versionedPath = `/${prefix ? `${prefix}/` : \"\"}v${route.version}${path}`;\n routes[versionedPath] = async (req: BunRequest, server: Server<unknown>) => {\n const context = await buildHttpContext({ req, server, route });\n const id = random.nanoid(30);\n container.addConstant(id, { context, route });\n server.upgrade(req, { data: { id } });\n\n return undefined;\n };\n }\n\n return routes;\n};\n\nconst runMiddlewares = async (context: ContextType, middlewares: SocketMiddlewareClassType[]): Promise<ContextType> => {\n let currentContext = context;\n\n for (const MiddlewareClass of middlewares) {\n const middleware = container.get<ISocketMiddleware>(MiddlewareClass);\n currentContext = await middleware.handler(currentContext);\n }\n\n return currentContext;\n};\n\nconst sendException = (context: ContextType, message: string, status: StatusCodeType): Promise<void> => {\n context.response.exception(message, { status });\n return context.channel.send(context.response);\n};\n\nconst logSocketRequest = (context: ContextType, status: number, path: string): void => {\n const logger = context.logger as {\n success: (message: string, data?: LogsEntity) => void;\n info: (message: string, data?: LogsEntity) => void;\n warn: (message: string, data?: LogsEntity) => void;\n error: (message: string, data?: LogsEntity) => void;\n };\n\n if (!logger) {\n return;\n }\n\n const logData = new LogsEntity();\n logData.date = new Date();\n logData.status = status;\n logData.method = \"GET\";\n logData.path = path;\n logData.params = context.params as Record<string, ScalarType>;\n logData.payload = context.payload as Record<string, unknown>;\n logData.queries = context.queries as Record<string, ScalarType>;\n\n if (context.ip) logData.ip = context.ip;\n\n const userAgent = context.header.get(\"User-Agent\");\n if (userAgent) logData.userAgent = userAgent;\n\n const referer = context.header.getReferer();\n if (referer) logData.referer = referer;\n\n if (context.user?.id) logData.userId = context.user.id;\n if (context.user?.email) logData.email = context.user.email;\n if (context.user?.lastName) logData.lastName = context.user.lastName;\n if (context.user?.firstName) logData.firstName = context.user.firstName;\n\n const message = `WS ${path}`;\n\n if (status >= 500) {\n logger.error(message, logData);\n } else if (status >= 400) {\n logger.warn(message, logData);\n } else if (status >= 300) {\n logger.info(message, logData);\n } else {\n logger.success(message, logData);\n }\n};\n\ntype SocketRouteHandlerOptions = {\n message: string;\n ws: ServerWebSocket<{ id: string }>;\n server: Server<{ id: string }>;\n middlewares?: SocketMiddlewareClassType[];\n};\n\nexport const socketRouteHandler = async ({\n message,\n ws,\n server,\n middlewares = [],\n}: SocketRouteHandlerOptions): Promise<void> => {\n let { context, route } = container.getConstant<{ context: ContextType; route: RouteConfigType }>(ws.data.id);\n const currentEnv: EnvironmentNameType = context.env.APP_ENV;\n\n context.channel = {\n send: async (response: IResponse): Promise<void> => {\n const data = await response.get(currentEnv).json();\n ws.send(JSON.stringify(data));\n },\n close: (code?: number, reason?: string): void => {\n ws.close(code, reason);\n },\n subscribe: async (): Promise<void> => {\n ws.subscribe(route.name);\n },\n isSubscribed: (): boolean => {\n return ws.isSubscribed(route.name);\n },\n unsubscribe: async (): Promise<void> => {\n ws.unsubscribe(route.name);\n },\n publish: async (response: IResponse): Promise<void> => {\n const data = await response.get(currentEnv).json();\n\n server.publish(route.name, data);\n },\n };\n\n const requestData = JSON.parse(message) as RequestDataType;\n context.queries = requestData.queries as Record<string, ScalarType>;\n context.payload = requestData.payload as Record<string, ScalarType>;\n context.language = requestData.language as LocaleInfoType;\n\n try {\n context = await runMiddlewares(context, middlewares);\n } catch (error: unknown) {\n const status = (error instanceof Exception ? error.status : HttpStatus.Code.InternalServerError) as number;\n logSocketRequest(context, status, route.path);\n return sendException(context, (error as Error).message, status as StatusCodeType);\n }\n\n // Check allowed users\n const allowedUsersError = checkAllowedUsers(context);\n if (allowedUsersError) {\n logSocketRequest(context, allowedUsersError.status, route.path);\n return sendException(context, allowedUsersError.message, allowedUsersError.status);\n }\n\n const validationError = await validateRouteAccess(context, route, currentEnv);\n if (validationError) {\n logSocketRequest(context, validationError.status, route.path);\n return sendException(context, validationError.message, validationError.status);\n }\n\n if (route.permission) {\n const permission = container.get(route.permission);\n context.permission = permission.allow().setUserPermissions(context.user).build();\n }\n\n const controller = container.get(route.controller);\n\n try {\n context.response = await controller.index(context);\n } catch (error: unknown) {\n const status = (error instanceof Exception ? error.status : HttpStatus.Code.InternalServerError) as number;\n const message = error instanceof Error ? error.message : \"An unknown error occurred\";\n logSocketRequest(context, status, route.path);\n return sendException(context, message, status as StatusCodeType);\n }\n\n const responseValidationError = validateResponse(route, context.response.getData());\n if (responseValidationError) {\n logSocketRequest(context, responseValidationError.status, route.path);\n return sendException(context, responseValidationError.message, responseValidationError.status);\n }\n\n logSocketRequest(context, HttpStatus.Code.OK, route.path);\n return context.channel.send(context.response);\n};\n",
8
+ "import type { EnvironmentNameType } from \"@ooneex/app-env\";\nimport { container } from \"@ooneex/container\";\nimport { Exception } from \"@ooneex/exception\";\nimport type { IResponse } from \"@ooneex/http-response\";\nimport { HttpStatus, type StatusCodeType } from \"@ooneex/http-status\";\nimport { LogsEntity } from \"@ooneex/logger\";\nimport type { ISocketMiddleware, SocketMiddlewareClassType } from \"@ooneex/middleware\";\nimport type { RouteConfigType } from \"@ooneex/routing\";\nimport type { ContextType } from \"@ooneex/socket\";\nimport type { RequestDataType } from \"@ooneex/socket-client\";\nimport type { LocaleInfoType } from \"@ooneex/translation\";\nimport type { ScalarType } from \"@ooneex/types\";\nimport { random } from \"@ooneex/utils\";\nimport type { BunRequest, Server, ServerWebSocket } from \"bun\";\nimport { buildHttpContext, checkAllowedUsers, validateResponse, validateRouteAccess } from \"./httpRouteUtils\";\n\ntype SocketRouteHandler = (req: BunRequest, server: Server<unknown>) => Promise<undefined>;\ntype SocketRoutesMap = Record<string, SocketRouteHandler>;\n\nexport const formatSocketRoutes = (socketRoutes: Map<string, RouteConfigType>, prefix?: string): SocketRoutesMap => {\n const routes: SocketRoutesMap = {};\n\n for (const [path, route] of socketRoutes) {\n const versionedPath = `/${prefix ? `${prefix}/` : \"\"}v${route.version}${path}`;\n routes[versionedPath] = async (req: BunRequest, server: Server<unknown>) => {\n const context = await buildHttpContext({ req, server, route });\n const id = random.nanoid(30);\n container.addConstant(id, { context, route });\n server.upgrade(req, { data: { id } });\n\n return undefined;\n };\n }\n\n return routes;\n};\n\nconst runMiddlewares = async (context: ContextType, middlewares: SocketMiddlewareClassType[]): Promise<ContextType> => {\n let currentContext = context;\n\n for (const MiddlewareClass of middlewares) {\n const middleware = container.get<ISocketMiddleware>(MiddlewareClass);\n currentContext = await middleware.handler(currentContext);\n }\n\n return currentContext;\n};\n\nconst sendException = (\n context: ContextType,\n message: string,\n status: StatusCodeType,\n key?: string | null,\n): Promise<void> => {\n context.response.exception(message, { status, ...(key ? { key } : {}) });\n return context.channel.send(context.response);\n};\n\nconst logSocketRequest = (context: ContextType, status: number, path: string): void => {\n const logger = context.logger as {\n success: (message: string, data?: LogsEntity) => void;\n info: (message: string, data?: LogsEntity) => void;\n warn: (message: string, data?: LogsEntity) => void;\n error: (message: string, data?: LogsEntity) => void;\n };\n\n if (!logger) {\n return;\n }\n\n const logData = new LogsEntity();\n logData.date = new Date();\n logData.status = status;\n logData.method = \"GET\";\n logData.path = path;\n logData.params = context.params as Record<string, ScalarType>;\n logData.payload = context.payload as Record<string, unknown>;\n logData.queries = context.queries as Record<string, ScalarType>;\n\n if (context.ip) logData.ip = context.ip;\n\n const userAgent = context.header.get(\"User-Agent\");\n if (userAgent) logData.userAgent = userAgent;\n\n const referer = context.header.getReferer();\n if (referer) logData.referer = referer;\n\n if (context.user?.id) logData.userId = context.user.id;\n if (context.user?.email) logData.email = context.user.email;\n if (context.user?.lastName) logData.lastName = context.user.lastName;\n if (context.user?.firstName) logData.firstName = context.user.firstName;\n\n const message = `WS ${path}`;\n\n if (status >= 500) {\n logger.error(message, logData);\n } else if (status >= 400) {\n logger.warn(message, logData);\n } else if (status >= 300) {\n logger.info(message, logData);\n } else {\n logger.success(message, logData);\n }\n};\n\ntype SocketRouteHandlerOptions = {\n message: string;\n ws: ServerWebSocket<{ id: string }>;\n server: Server<{ id: string }>;\n middlewares?: SocketMiddlewareClassType[];\n};\n\nexport const socketRouteHandler = async ({\n message,\n ws,\n server,\n middlewares = [],\n}: SocketRouteHandlerOptions): Promise<void> => {\n let { context, route } = container.getConstant<{ context: ContextType; route: RouteConfigType }>(ws.data.id);\n const currentEnv: EnvironmentNameType = context.env.APP_ENV;\n\n context.channel = {\n send: async (response: IResponse): Promise<void> => {\n const data = await response.get(currentEnv).json();\n ws.send(JSON.stringify(data));\n },\n close: (code?: number, reason?: string): void => {\n ws.close(code, reason);\n },\n subscribe: async (): Promise<void> => {\n ws.subscribe(route.name);\n },\n isSubscribed: (): boolean => {\n return ws.isSubscribed(route.name);\n },\n unsubscribe: async (): Promise<void> => {\n ws.unsubscribe(route.name);\n },\n publish: async (response: IResponse): Promise<void> => {\n const data = await response.get(currentEnv).json();\n\n server.publish(route.name, data);\n },\n };\n\n const requestData = JSON.parse(message) as RequestDataType;\n context.queries = requestData.queries as Record<string, ScalarType>;\n context.payload = requestData.payload as Record<string, ScalarType>;\n context.language = requestData.language as LocaleInfoType;\n\n try {\n context = await runMiddlewares(context, middlewares);\n } catch (error: unknown) {\n const status = (error instanceof Exception ? error.status : HttpStatus.Code.InternalServerError) as number;\n const key = error instanceof Exception ? error.key : null;\n logSocketRequest(context, status, route.path);\n return sendException(context, (error as Error).message, status as StatusCodeType, key);\n }\n\n // Check allowed users\n const allowedUsersError = checkAllowedUsers(context);\n if (allowedUsersError) {\n logSocketRequest(context, allowedUsersError.status, route.path);\n return sendException(context, allowedUsersError.message, allowedUsersError.status);\n }\n\n const validationError = await validateRouteAccess(context, route, currentEnv);\n if (validationError) {\n logSocketRequest(context, validationError.status, route.path);\n return sendException(context, validationError.message, validationError.status);\n }\n\n if (route.permission) {\n const permission = container.get(route.permission);\n context.permission = permission.allow().setUserPermissions(context.user).build();\n }\n\n const controller = container.get(route.controller);\n\n try {\n context.response = await controller.index(context);\n } catch (error: unknown) {\n const status = (error instanceof Exception ? error.status : HttpStatus.Code.InternalServerError) as number;\n const key = error instanceof Exception ? error.key : null;\n const message = error instanceof Error ? error.message : \"An unknown error occurred\";\n logSocketRequest(context, status, route.path);\n return sendException(context, message, status as StatusCodeType, key);\n }\n\n const responseValidationError = validateResponse(route, context.response.getData());\n if (responseValidationError) {\n logSocketRequest(context, responseValidationError.status, route.path);\n return sendException(context, responseValidationError.message, responseValidationError.status);\n }\n\n logSocketRequest(context, HttpStatus.Code.OK, route.path);\n return context.channel.send(context.response);\n};\n",
9
9
  "import { join } from \"node:path\";\nimport type { RouteConfigType } from \"@ooneex/routing\";\nimport { routeConfigToJsonDoc } from \"@ooneex/routing\";\n\nexport const generateRouteDoc = async (config: RouteConfigType): Promise<void> => {\n const outputDir = \"docs/routes\";\n const jsonDoc = routeConfigToJsonDoc(config);\n const fileName = `${config.name}.json`;\n const filePath = join(process.cwd(), outputDir, fileName);\n\n await Bun.write(filePath, JSON.stringify(jsonDoc, null, 2));\n};\n",
10
10
  "import { join } from \"node:path\";\nimport type { RouteConfigType } from \"@ooneex/routing\";\nimport { routeConfigToTypeString } from \"@ooneex/routing\";\nimport { toPascalCase } from \"@ooneex/utils\";\n\nexport const generateRouteType = async (config: RouteConfigType): Promise<void> => {\n const outputDir = \"src/types/routes\";\n const typeString = routeConfigToTypeString(config);\n const fileName = `${config.name}.ts`;\n const filePath = join(process.cwd(), outputDir, fileName);\n\n const typeName = toPascalCase(config.name);\n\n const fileContent = `export type ${typeName}RouteType = ${typeString};\n`;\n\n await Bun.write(filePath, fileContent);\n};\n"
11
11
  ],
12
- "mappings": ";;AAAA,mBAAS;AACT,sBAAS;AAET,sBAAS;AACT,uBAAS;AACT;AAGA;AAEA;;;ACTA;AAEA;AAGA;AACA;AACA;AACA;AAEA;AAIA;AAIA;AAGO,IAAM,oBAAoB,CAAC,YAAsD;AAAA,EACtF,IAAI,CAAC,QAAQ,MAAM;AAAA,IACjB,OAAO;AAAA,EACT;AAAA,EAEA,MAAM,cAAc,QAAQ,IAAI;AAAA,EAChC,IAAI,aAAa,SAAS,QAAQ,KAAK,KAAK,GAAG;AAAA,IAC7C,IAAI,CAAC,QAAQ,KAAK,MAAM,SAAS,MAAM,MAAM,GAAG;AAAA,MAC9C,QAAQ,KAAK,MAAM,KAAK,MAAM,MAAM;AAAA,IACtC;AAAA,EACF;AAAA,EAEA,MAAM,kBAAkB,QAAQ,IAAI;AAAA,EACpC,IAAI,iBAAiB,SAAS,QAAQ,KAAK,KAAK,GAAG;AAAA,IACjD,IAAI,CAAC,QAAQ,KAAK,MAAM,SAAS,MAAM,WAAW,GAAG;AAAA,MACnD,QAAQ,KAAK,MAAM,KAAK,MAAM,WAAW;AAAA,IAC3C;AAAA,EACF;AAAA,EAEA,MAAM,aAAa,QAAQ,IAAI;AAAA,EAC/B,IAAI,YAAY,SAAS,QAAQ,KAAK,K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,EAChF,MAAM,YAAY;AAAA,EAClB,MAAM,UAAU,qBAAqB,MAAM;AAAA,EAC3C,MAAM,WAAW,GAAG,OAAO;AAAA,EAC3B,MAAM,WAAW,KAAK,QAAQ,IAAI,GAAG,WAAW,QAAQ;AAAA,EAExD,MAAM,IAAI,MAAM,UAAU,KAAK,UAAU,SAAS,MAAM,CAAC,CAAC;AAAA;;ACV5D,iBAAS;AAET;AACA;AAEO,IAAM,oBAAoB,OAAO,WAA2C;AAAA,EACjF,MAAM,YAAY;AAAA,EAClB,MAAM,aAAa,wBAAwB,MAAM;AAAA,EACjD,MAAM,WAAW,GAAG,OAAO;AAAA,EAC3B,MAAM,WAAW,MAAK,QAAQ,IAAI,GAAG,WAAW,QAAQ;AAAA,EAExD,MAAM,WAAW,aAAa,OAAO,IAAI;AAAA,EAEzC,MAAM,cAAc,eAAe,uBAAuB;AAAA;AAAA,EAG1D,MAAM,IAAI,MAAM,UAAU,WAAW;AAAA;",
13
+ "debugId": "5E685958EA4DE75664756E2164756E21",
14
14
  "names": []
15
15
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ooneex/app",
3
3
  "description": "Full-featured application framework for Bun — orchestrates routing, middleware pipelines, dependency injection, caching, logging, and WebSocket support in a modular architecture",
4
- "version": "1.3.7",
4
+ "version": "1.4.0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -37,7 +37,7 @@
37
37
  "@ooneex/http-request": "1.2.4",
38
38
  "@ooneex/http-response": "1.2.3",
39
39
  "@ooneex/http-status": "1.1.3",
40
- "@ooneex/logger": "1.2.4",
40
+ "@ooneex/logger": "1.2.5",
41
41
  "@ooneex/mailer": "1.1.4",
42
42
  "@ooneex/rate-limit": "1.1.3",
43
43
  "@ooneex/role": "1.1.3",