@ooneex/app 1.4.0 → 1.5.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 +4 -1
- package/dist/index.js +37 -21
- package/dist/index.js.map +5 -5
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -114,7 +114,10 @@ import type { ModuleType } from '@ooneex/module';
|
|
|
114
114
|
|
|
115
115
|
export const UserModule: ModuleType = {
|
|
116
116
|
controllers: [UserController],
|
|
117
|
-
entities: [UserEntity]
|
|
117
|
+
entities: [UserEntity],
|
|
118
|
+
middlewares: [],
|
|
119
|
+
cronJobs: [],
|
|
120
|
+
events: [],
|
|
118
121
|
};
|
|
119
122
|
```
|
|
120
123
|
|
package/dist/index.js
CHANGED
|
@@ -45,7 +45,8 @@ var checkAllowedUsers = (context) => {
|
|
|
45
45
|
if (allowedUsers && allowedUsers.length > 0 && !allowedUsers.includes(context.user.email)) {
|
|
46
46
|
return {
|
|
47
47
|
message: `User "${context.user.email}" is not allowed in "${context.env.APP_ENV}" environment`,
|
|
48
|
-
status: HttpStatus.Code.Forbidden
|
|
48
|
+
status: HttpStatus.Code.Forbidden,
|
|
49
|
+
key: "USER_NOT_ALLOWED"
|
|
49
50
|
};
|
|
50
51
|
}
|
|
51
52
|
return null;
|
|
@@ -128,7 +129,7 @@ var buildHttpContext = async (ctx) => {
|
|
|
128
129
|
files: request.files,
|
|
129
130
|
ip: request.ip,
|
|
130
131
|
host: request.host,
|
|
131
|
-
|
|
132
|
+
lang: request.lang,
|
|
132
133
|
user: null
|
|
133
134
|
};
|
|
134
135
|
return context;
|
|
@@ -140,7 +141,8 @@ var validateRouteAccess = async (context, route, currentEnv) => {
|
|
|
140
141
|
if (error) {
|
|
141
142
|
return {
|
|
142
143
|
message: `Invalid parameter "${paramName}": ${error}`,
|
|
143
|
-
status: HttpStatus.Code.BadRequest
|
|
144
|
+
status: HttpStatus.Code.BadRequest,
|
|
145
|
+
key: "INVALID_PARAMETER"
|
|
144
146
|
};
|
|
145
147
|
}
|
|
146
148
|
}
|
|
@@ -150,7 +152,8 @@ var validateRouteAccess = async (context, route, currentEnv) => {
|
|
|
150
152
|
if (error) {
|
|
151
153
|
return {
|
|
152
154
|
message: `Invalid query parameters: ${error}`,
|
|
153
|
-
status: HttpStatus.Code.BadRequest
|
|
155
|
+
status: HttpStatus.Code.BadRequest,
|
|
156
|
+
key: "INVALID_QUERY"
|
|
154
157
|
};
|
|
155
158
|
}
|
|
156
159
|
}
|
|
@@ -159,33 +162,38 @@ var validateRouteAccess = async (context, route, currentEnv) => {
|
|
|
159
162
|
if (error) {
|
|
160
163
|
return {
|
|
161
164
|
message: `Invalid payload: ${error}`,
|
|
162
|
-
status: HttpStatus.Code.BadRequest
|
|
165
|
+
status: HttpStatus.Code.BadRequest,
|
|
166
|
+
key: "INVALID_PAYLOAD"
|
|
163
167
|
};
|
|
164
168
|
}
|
|
165
169
|
}
|
|
166
170
|
if (route.env && route.env.length > 0 && !route.env.includes(currentEnv)) {
|
|
167
171
|
return {
|
|
168
172
|
message: `Route "${route.name}" is not available in "${currentEnv}" environment`,
|
|
169
|
-
status: HttpStatus.Code.NotAcceptable
|
|
173
|
+
status: HttpStatus.Code.NotAcceptable,
|
|
174
|
+
key: "ROUTE_ENV_NOT_ALLOWED"
|
|
170
175
|
};
|
|
171
176
|
}
|
|
172
177
|
if (route.ip && route.ip.length > 0 && (!context.ip || !route.ip.includes(context.ip))) {
|
|
173
178
|
return {
|
|
174
179
|
message: `Route "${route.name}" is not available for IP "${context.ip}"`,
|
|
175
|
-
status: HttpStatus.Code.NotAcceptable
|
|
180
|
+
status: HttpStatus.Code.NotAcceptable,
|
|
181
|
+
key: "ROUTE_IP_NOT_ALLOWED"
|
|
176
182
|
};
|
|
177
183
|
}
|
|
178
184
|
if (route.host && route.host.length > 0 && !route.host.includes(context.host)) {
|
|
179
185
|
return {
|
|
180
186
|
message: `Route "${route.name}" is not available for host "${context.host}"`,
|
|
181
|
-
status: HttpStatus.Code.NotAcceptable
|
|
187
|
+
status: HttpStatus.Code.NotAcceptable,
|
|
188
|
+
key: "ROUTE_HOST_NOT_ALLOWED"
|
|
182
189
|
};
|
|
183
190
|
}
|
|
184
191
|
if (route.roles && route.roles.length > 0) {
|
|
185
192
|
if (!context.user || !context.user.roles || context.user.roles.length === 0) {
|
|
186
193
|
return {
|
|
187
194
|
message: `Route "${route.name}" requires authentication`,
|
|
188
|
-
status: HttpStatus.Code.Forbidden
|
|
195
|
+
status: HttpStatus.Code.Forbidden,
|
|
196
|
+
key: "AUTHENTICATION_REQUIRED"
|
|
189
197
|
};
|
|
190
198
|
}
|
|
191
199
|
const role = new Role;
|
|
@@ -193,7 +201,8 @@ var validateRouteAccess = async (context, route, currentEnv) => {
|
|
|
193
201
|
if (!hasRequiredRole) {
|
|
194
202
|
return {
|
|
195
203
|
message: `Route "${route.name}" is not accessible for user roles`,
|
|
196
|
-
status: HttpStatus.Code.NotAcceptable
|
|
204
|
+
status: HttpStatus.Code.NotAcceptable,
|
|
205
|
+
key: "ROLE_NOT_ALLOWED"
|
|
197
206
|
};
|
|
198
207
|
}
|
|
199
208
|
}
|
|
@@ -205,7 +214,8 @@ var validateResponse = (route, data) => {
|
|
|
205
214
|
if (error) {
|
|
206
215
|
return {
|
|
207
216
|
message: `Invalid response: ${error}`,
|
|
208
|
-
status: HttpStatus.Code.NotAcceptable
|
|
217
|
+
status: HttpStatus.Code.NotAcceptable,
|
|
218
|
+
key: "INVALID_RESPONSE"
|
|
209
219
|
};
|
|
210
220
|
}
|
|
211
221
|
}
|
|
@@ -265,16 +275,19 @@ var executeController = async (controller, context) => {
|
|
|
265
275
|
return [null, { message: error.message, status: error.status, key: error.key }];
|
|
266
276
|
}
|
|
267
277
|
if (error instanceof Error) {
|
|
268
|
-
return [null, { message: error.message, status: HttpStatus.Code.InternalServerError }];
|
|
278
|
+
return [null, { message: error.message, status: HttpStatus.Code.InternalServerError, key: "INTERNAL_ERROR" }];
|
|
269
279
|
}
|
|
270
|
-
return [
|
|
280
|
+
return [
|
|
281
|
+
null,
|
|
282
|
+
{ message: "An unknown error occurred", status: HttpStatus.Code.InternalServerError, key: "UNKNOWN_ERROR" }
|
|
283
|
+
];
|
|
271
284
|
}
|
|
272
285
|
};
|
|
273
286
|
var httpRouteHandler = async ({ context, route }) => {
|
|
274
287
|
const currentEnv = context.env.APP_ENV;
|
|
275
288
|
const validationError = await validateRouteAccess(context, route, currentEnv);
|
|
276
289
|
if (validationError) {
|
|
277
|
-
const httpResponse2 = buildExceptionResponse(context, validationError.message, validationError.status, currentEnv);
|
|
290
|
+
const httpResponse2 = buildExceptionResponse(context, validationError.message, validationError.status, currentEnv, validationError.key);
|
|
278
291
|
logRequest(context);
|
|
279
292
|
return httpResponse2;
|
|
280
293
|
}
|
|
@@ -287,7 +300,7 @@ var httpRouteHandler = async ({ context, route }) => {
|
|
|
287
300
|
}
|
|
288
301
|
const responseValidationError = validateResponse(route, response.getData());
|
|
289
302
|
if (responseValidationError) {
|
|
290
|
-
const httpResponse2 = buildExceptionResponse(context, responseValidationError.message, responseValidationError.status, currentEnv);
|
|
303
|
+
const httpResponse2 = buildExceptionResponse(context, responseValidationError.message, responseValidationError.status, currentEnv, responseValidationError.key);
|
|
291
304
|
logRequest(context);
|
|
292
305
|
return httpResponse2;
|
|
293
306
|
}
|
|
@@ -324,7 +337,7 @@ var formatHttpRoutes = (httpRoutes, middlewares = [], prefix) => {
|
|
|
324
337
|
}
|
|
325
338
|
const allowedUsersError = checkAllowedUsers(context);
|
|
326
339
|
if (allowedUsersError) {
|
|
327
|
-
const httpResponse = buildExceptionResponse(context, allowedUsersError.message, allowedUsersError.status, context.env.APP_ENV);
|
|
340
|
+
const httpResponse = buildExceptionResponse(context, allowedUsersError.message, allowedUsersError.status, context.env.APP_ENV, allowedUsersError.key);
|
|
328
341
|
logRequest(context);
|
|
329
342
|
return httpResponse;
|
|
330
343
|
}
|
|
@@ -496,7 +509,7 @@ var socketRouteHandler = async ({
|
|
|
496
509
|
const requestData = JSON.parse(message);
|
|
497
510
|
context.queries = requestData.queries;
|
|
498
511
|
context.payload = requestData.payload;
|
|
499
|
-
context.
|
|
512
|
+
context.lang = requestData.lang;
|
|
500
513
|
try {
|
|
501
514
|
context = await runMiddlewares2(context, middlewares);
|
|
502
515
|
} catch (error) {
|
|
@@ -508,12 +521,12 @@ var socketRouteHandler = async ({
|
|
|
508
521
|
const allowedUsersError = checkAllowedUsers(context);
|
|
509
522
|
if (allowedUsersError) {
|
|
510
523
|
logSocketRequest(context, allowedUsersError.status, route.path);
|
|
511
|
-
return sendException(context, allowedUsersError.message, allowedUsersError.status);
|
|
524
|
+
return sendException(context, allowedUsersError.message, allowedUsersError.status, allowedUsersError.key);
|
|
512
525
|
}
|
|
513
526
|
const validationError = await validateRouteAccess(context, route, currentEnv);
|
|
514
527
|
if (validationError) {
|
|
515
528
|
logSocketRequest(context, validationError.status, route.path);
|
|
516
|
-
return sendException(context, validationError.message, validationError.status);
|
|
529
|
+
return sendException(context, validationError.message, validationError.status, validationError.key);
|
|
517
530
|
}
|
|
518
531
|
if (route.permission) {
|
|
519
532
|
const permission = container2.get(route.permission);
|
|
@@ -532,7 +545,7 @@ var socketRouteHandler = async ({
|
|
|
532
545
|
const responseValidationError = validateResponse(route, context.response.getData());
|
|
533
546
|
if (responseValidationError) {
|
|
534
547
|
logSocketRequest(context, responseValidationError.status, route.path);
|
|
535
|
-
return sendException(context, responseValidationError.message, responseValidationError.status);
|
|
548
|
+
return sendException(context, responseValidationError.message, responseValidationError.status, responseValidationError.key);
|
|
536
549
|
}
|
|
537
550
|
logSocketRequest(context, HttpStatus2.Code.OK, route.path);
|
|
538
551
|
return context.channel.send(context.response);
|
|
@@ -616,6 +629,7 @@ class App {
|
|
|
616
629
|
const appEnvResult = appEnvValidator.validate(env.APP_ENV);
|
|
617
630
|
if (!appEnvResult.isValid) {
|
|
618
631
|
throw new Exception3(`Invalid APP_ENV: ${appEnvResult.message}`, {
|
|
632
|
+
key: "INVALID_APP_ENV",
|
|
619
633
|
status: HttpStatus3.Code.InternalServerError,
|
|
620
634
|
data: { appEnv: env.APP_ENV }
|
|
621
635
|
});
|
|
@@ -624,6 +638,7 @@ class App {
|
|
|
624
638
|
const portResult = portValidator.validate(env.PORT);
|
|
625
639
|
if (!portResult.isValid) {
|
|
626
640
|
throw new Exception3(`Invalid PORT: ${portResult.message}`, {
|
|
641
|
+
key: "INVALID_PORT",
|
|
627
642
|
status: HttpStatus3.Code.InternalServerError,
|
|
628
643
|
data: { port: env.PORT }
|
|
629
644
|
});
|
|
@@ -632,6 +647,7 @@ class App {
|
|
|
632
647
|
const hostnameResult = hostnameValidator.validate(env.HOST_NAME);
|
|
633
648
|
if (!hostnameResult.isValid) {
|
|
634
649
|
throw new Exception3(`Invalid HOST_NAME: ${hostnameResult.message}`, {
|
|
650
|
+
key: "INVALID_HOST_NAME",
|
|
635
651
|
status: HttpStatus3.Code.InternalServerError,
|
|
636
652
|
data: { hostname: env.HOST_NAME }
|
|
637
653
|
});
|
|
@@ -733,4 +749,4 @@ export {
|
|
|
733
749
|
App
|
|
734
750
|
};
|
|
735
751
|
|
|
736
|
-
//# debugId=
|
|
752
|
+
//# debugId=B3D952CDB8F3E74864756E2164756E21
|
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; 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",
|
|
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 key: \"INVALID_APP_ENV\",\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 key: \"INVALID_PORT\",\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 key: \"INVALID_HOST_NAME\",\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 key: \"USER_NOT_ALLOWED\",\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 lang: request.lang,\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 key: \"INVALID_PARAMETER\",\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 key: \"INVALID_QUERY\",\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 key: \"INVALID_PAYLOAD\",\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 key: \"ROUTE_ENV_NOT_ALLOWED\",\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 key: \"ROUTE_IP_NOT_ALLOWED\",\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 key: \"ROUTE_HOST_NOT_ALLOWED\",\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 key: \"AUTHENTICATION_REQUIRED\",\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 key: \"ROLE_NOT_ALLOWED\",\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 key: \"INVALID_RESPONSE\",\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, key: \"INTERNAL_ERROR\" }];\n }\n return [\n null,\n { message: \"An unknown error occurred\", status: HttpStatus.Code.InternalServerError, key: \"UNKNOWN_ERROR\" },\n ];\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(\n context,\n validationError.message,\n validationError.status,\n currentEnv,\n validationError.key,\n );\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 responseValidationError.key,\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 allowedUsersError.key,\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 = (\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.
|
|
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.lang = requestData.lang 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, allowedUsersError.key);\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, validationError.key);\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(\n context,\n responseValidationError.message,\n responseValidationError.status,\n responseValidationError.key,\n );\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,kB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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": "B3D952CDB8F3E74864756E2164756E21",
|
|
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.
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -29,32 +29,32 @@
|
|
|
29
29
|
"dev": "bun run src/dev.ts"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@ooneex/analytics": "1.1.
|
|
33
|
-
"@ooneex/app-env": "1.
|
|
34
|
-
"@ooneex/cache": "1.
|
|
35
|
-
"@ooneex/container": "1.2.
|
|
36
|
-
"@ooneex/exception": "1.
|
|
32
|
+
"@ooneex/analytics": "1.1.6",
|
|
33
|
+
"@ooneex/app-env": "1.3.0",
|
|
34
|
+
"@ooneex/cache": "1.2.0",
|
|
35
|
+
"@ooneex/container": "1.2.2",
|
|
36
|
+
"@ooneex/exception": "1.2.0",
|
|
37
37
|
"@ooneex/http-request": "1.2.4",
|
|
38
|
-
"@ooneex/http-response": "1.
|
|
38
|
+
"@ooneex/http-response": "1.3.0",
|
|
39
39
|
"@ooneex/http-status": "1.1.3",
|
|
40
|
-
"@ooneex/logger": "1.2.
|
|
41
|
-
"@ooneex/mailer": "1.1.
|
|
42
|
-
"@ooneex/rate-limit": "1.
|
|
40
|
+
"@ooneex/logger": "1.2.6",
|
|
41
|
+
"@ooneex/mailer": "1.1.5",
|
|
42
|
+
"@ooneex/rate-limit": "1.2.0",
|
|
43
43
|
"@ooneex/role": "1.1.3",
|
|
44
|
-
"@ooneex/routing": "1.3.
|
|
45
|
-
"@ooneex/storage": "1.1.
|
|
44
|
+
"@ooneex/routing": "1.3.2",
|
|
45
|
+
"@ooneex/storage": "1.1.5",
|
|
46
46
|
"@ooneex/utils": "0.4.1",
|
|
47
47
|
"@ooneex/validation": "1.1.3"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@ooneex/controller": "1.3.3",
|
|
51
|
-
"@ooneex/cron": "1.1.
|
|
52
|
-
"@ooneex/pub-sub": "1.1.
|
|
51
|
+
"@ooneex/cron": "1.1.5",
|
|
52
|
+
"@ooneex/pub-sub": "1.1.5",
|
|
53
53
|
"@ooneex/middleware": "1.2.5",
|
|
54
54
|
"@ooneex/module": "1.2.3",
|
|
55
55
|
"@ooneex/socket": "1.2.4",
|
|
56
|
-
"@ooneex/socket-client": "1.2.
|
|
57
|
-
"@ooneex/translation": "1.1.
|
|
56
|
+
"@ooneex/socket-client": "1.2.4",
|
|
57
|
+
"@ooneex/translation": "1.1.4",
|
|
58
58
|
"@ooneex/types": "1.1.3"
|
|
59
59
|
},
|
|
60
60
|
"keywords": [
|