@ooneex/routing 1.3.1 → 1.3.2
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/dist/index.d.ts +1 -1
- package/dist/index.js +9 -8
- package/dist/index.js.map +4 -4
- package/package.json +12 -12
package/dist/index.d.ts
CHANGED
|
@@ -120,7 +120,7 @@ declare class Router implements IRouter {
|
|
|
120
120
|
declare const router: Router;
|
|
121
121
|
import { Exception } from "@ooneex/exception";
|
|
122
122
|
declare class RouterException extends Exception {
|
|
123
|
-
constructor(message: string, data?: Record<string, unknown>);
|
|
123
|
+
constructor(message: string, key: string, data?: Record<string, unknown>);
|
|
124
124
|
}
|
|
125
125
|
declare const isValidRoutePath: (path: string) => path is ValidRoutePath;
|
|
126
126
|
/**
|
package/dist/index.js
CHANGED
|
@@ -7,8 +7,9 @@ import { Exception } from "@ooneex/exception";
|
|
|
7
7
|
import { HttpStatus } from "@ooneex/http-status";
|
|
8
8
|
|
|
9
9
|
class RouterException extends Exception {
|
|
10
|
-
constructor(message, data = {}) {
|
|
10
|
+
constructor(message, key, data = {}) {
|
|
11
11
|
super(message, {
|
|
12
|
+
key,
|
|
12
13
|
status: HttpStatus.Code.InternalServerError,
|
|
13
14
|
data
|
|
14
15
|
});
|
|
@@ -24,15 +25,15 @@ class Router {
|
|
|
24
25
|
for (const item of this.routes[Symbol.iterator]()) {
|
|
25
26
|
const existingRoute = item[1].find((r) => r.name === name);
|
|
26
27
|
if (existingRoute) {
|
|
27
|
-
throw new RouterException(`Route with name '${name}' already exists`, route);
|
|
28
|
+
throw new RouterException(`Route with name '${name}' already exists`, "ROUTE_NAME_EXISTS", route);
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
const routes = this.routes.get(route.path) ?? [];
|
|
31
32
|
if (route.isSocket && routes.find((r) => r.isSocket)) {
|
|
32
|
-
throw new RouterException(`Socket route with path '${route.path}' already exists`, route);
|
|
33
|
+
throw new RouterException(`Socket route with path '${route.path}' already exists`, "SOCKET_PATH_EXISTS", route);
|
|
33
34
|
}
|
|
34
35
|
if (!route.isSocket && routes.find((r) => !r.isSocket && r.method === route.method)) {
|
|
35
|
-
throw new RouterException(`Route with path '${route.path}' and method '${route.method}' already exists`, route);
|
|
36
|
+
throw new RouterException(`Route with path '${route.path}' and method '${route.method}' already exists`, "ROUTE_PATH_EXISTS", route);
|
|
36
37
|
}
|
|
37
38
|
routes.push(route);
|
|
38
39
|
this.routes.set(route.path, routes);
|
|
@@ -77,18 +78,18 @@ class Router {
|
|
|
77
78
|
generate(name, params) {
|
|
78
79
|
const route = this.findRouteByName(name);
|
|
79
80
|
if (!route) {
|
|
80
|
-
throw new RouterException(`Route with name '${name}' not found
|
|
81
|
+
throw new RouterException(`Route with name '${name}' not found`, "ROUTE_NOT_FOUND");
|
|
81
82
|
}
|
|
82
83
|
let path = route.path;
|
|
83
84
|
const paramMatches = path.match(/:[a-zA-Z0-9_]+/g) || [];
|
|
84
85
|
if (paramMatches.length > 0) {
|
|
85
86
|
if (!params || typeof params !== "object" || params === null) {
|
|
86
|
-
throw new RouterException(`Route '${name}' requires parameters, but none were provided
|
|
87
|
+
throw new RouterException(`Route '${name}' requires parameters, but none were provided`, "ROUTE_PARAMS_REQUIRED");
|
|
87
88
|
}
|
|
88
89
|
for (const match of paramMatches) {
|
|
89
90
|
const paramName = match.substring(1);
|
|
90
91
|
if (!(paramName in params)) {
|
|
91
|
-
throw new RouterException(`Missing required parameter '${paramName}' for route '${name}'
|
|
92
|
+
throw new RouterException(`Missing required parameter '${paramName}' for route '${name}'`, "ROUTE_PARAM_MISSING");
|
|
92
93
|
}
|
|
93
94
|
path = path.replace(match, String(params[paramName]));
|
|
94
95
|
}
|
|
@@ -341,4 +342,4 @@ export {
|
|
|
341
342
|
Route
|
|
342
343
|
};
|
|
343
344
|
|
|
344
|
-
//# debugId=
|
|
345
|
+
//# debugId=00BB46926DE228AA64756E2164756E21
|
package/dist/index.js.map
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["src/Router.ts", "src/RouterException.ts", "src/decorators.ts", "src/utils.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import { container, EContainerScope } from \"@ooneex/container\";\nimport { RouterException } from \"./RouterException\";\nimport type { IRouter, RouteConfigType } from \"./types\";\n\nexport class Router implements IRouter {\n private routes: Map<string, RouteConfigType[]> = new Map();\n\n public addRoute(route: RouteConfigType): this {\n const name = route.name;\n\n for (const item of this.routes[Symbol.iterator]()) {\n const existingRoute = item[1].find((r) => r.name === name);\n\n if (existingRoute) {\n throw new RouterException(`Route with name '${name}' already exists`, route);\n }\n }\n\n const routes = this.routes.get(route.path) ?? [];\n\n if (route.isSocket && routes.find((r) => r.isSocket)) {\n throw new RouterException(`Socket route with path '${route.path}' already exists`, route);\n }\n\n if (!route.isSocket && routes.find((r) => !r.isSocket && r.method === route.method)) {\n throw new RouterException(`Route with path '${route.path}' and method '${route.method}' already exists`, route);\n }\n\n routes.push(route);\n this.routes.set(route.path, routes);\n container.add(route.controller, EContainerScope.Singleton);\n\n return this;\n }\n\n public findRouteByPath(path: string): RouteConfigType[] | null {\n return this.routes.get(path) ?? null;\n }\n\n public findRouteByName(name: string): RouteConfigType | null {\n for (const item of this.routes[Symbol.iterator]()) {\n const existingRoute = item[1].find((r) => r.name === name);\n\n if (existingRoute) {\n return existingRoute;\n }\n }\n\n return null;\n }\n\n public getRoutes(): Map<string, RouteConfigType[]> {\n return this.routes;\n }\n\n public getSocketRoutes(): Map<string, RouteConfigType> {\n const socketRoutes = new Map<string, RouteConfigType>();\n\n for (const [path, routes] of this.routes) {\n const socketRoute = routes.find((route): route is RouteConfigType => route.isSocket);\n if (socketRoute) {\n socketRoutes.set(path, socketRoute);\n }\n }\n\n return socketRoutes;\n }\n\n public getHttpRoutes(): Map<string, RouteConfigType[]> {\n const httpRoutes = new Map<string, RouteConfigType[]>();\n\n for (const [path, routes] of this.routes) {\n const filteredRoutes = routes.filter((route): route is RouteConfigType => !route.isSocket);\n if (filteredRoutes.length > 0) {\n httpRoutes.set(path, filteredRoutes);\n }\n }\n\n return httpRoutes;\n }\n\n public generate<P extends Record<string, string | number> = Record<string, string | number>>(\n name: string,\n params?: P,\n ): string {\n const route = this.findRouteByName(name);\n\n if (!route) {\n throw new RouterException(`Route with name '${name}' not found
|
|
6
|
-
"import { Exception } from \"@ooneex/exception\";\nimport { HttpStatus } from \"@ooneex/http-status\";\n\nexport class RouterException extends Exception {\n constructor(message: string, data: Record<string, unknown> = {}) {\n super(message, {\n status: HttpStatus.Code.InternalServerError,\n data,\n });\n this.name = \"RouterException\";\n }\n}\n",
|
|
5
|
+
"import { container, EContainerScope } from \"@ooneex/container\";\nimport { RouterException } from \"./RouterException\";\nimport type { IRouter, RouteConfigType } from \"./types\";\n\nexport class Router implements IRouter {\n private routes: Map<string, RouteConfigType[]> = new Map();\n\n public addRoute(route: RouteConfigType): this {\n const name = route.name;\n\n for (const item of this.routes[Symbol.iterator]()) {\n const existingRoute = item[1].find((r) => r.name === name);\n\n if (existingRoute) {\n throw new RouterException(`Route with name '${name}' already exists`, \"ROUTE_NAME_EXISTS\", route);\n }\n }\n\n const routes = this.routes.get(route.path) ?? [];\n\n if (route.isSocket && routes.find((r) => r.isSocket)) {\n throw new RouterException(`Socket route with path '${route.path}' already exists`, \"SOCKET_PATH_EXISTS\", route);\n }\n\n if (!route.isSocket && routes.find((r) => !r.isSocket && r.method === route.method)) {\n throw new RouterException(`Route with path '${route.path}' and method '${route.method}' already exists`, \"ROUTE_PATH_EXISTS\", route);\n }\n\n routes.push(route);\n this.routes.set(route.path, routes);\n container.add(route.controller, EContainerScope.Singleton);\n\n return this;\n }\n\n public findRouteByPath(path: string): RouteConfigType[] | null {\n return this.routes.get(path) ?? null;\n }\n\n public findRouteByName(name: string): RouteConfigType | null {\n for (const item of this.routes[Symbol.iterator]()) {\n const existingRoute = item[1].find((r) => r.name === name);\n\n if (existingRoute) {\n return existingRoute;\n }\n }\n\n return null;\n }\n\n public getRoutes(): Map<string, RouteConfigType[]> {\n return this.routes;\n }\n\n public getSocketRoutes(): Map<string, RouteConfigType> {\n const socketRoutes = new Map<string, RouteConfigType>();\n\n for (const [path, routes] of this.routes) {\n const socketRoute = routes.find((route): route is RouteConfigType => route.isSocket);\n if (socketRoute) {\n socketRoutes.set(path, socketRoute);\n }\n }\n\n return socketRoutes;\n }\n\n public getHttpRoutes(): Map<string, RouteConfigType[]> {\n const httpRoutes = new Map<string, RouteConfigType[]>();\n\n for (const [path, routes] of this.routes) {\n const filteredRoutes = routes.filter((route): route is RouteConfigType => !route.isSocket);\n if (filteredRoutes.length > 0) {\n httpRoutes.set(path, filteredRoutes);\n }\n }\n\n return httpRoutes;\n }\n\n public generate<P extends Record<string, string | number> = Record<string, string | number>>(\n name: string,\n params?: P,\n ): string {\n const route = this.findRouteByName(name);\n\n if (!route) {\n throw new RouterException(`Route with name '${name}' not found`, \"ROUTE_NOT_FOUND\");\n }\n\n let path: string = route.path;\n const paramMatches = path.match(/:[a-zA-Z0-9_]+/g) || [];\n\n if (paramMatches.length > 0) {\n if (!params || typeof params !== \"object\" || params === null) {\n throw new RouterException(`Route '${name}' requires parameters, but none were provided`, \"ROUTE_PARAMS_REQUIRED\");\n }\n\n for (const match of paramMatches) {\n const paramName = match.substring(1);\n if (!(paramName in params)) {\n throw new RouterException(`Missing required parameter '${paramName}' for route '${name}'`, \"ROUTE_PARAM_MISSING\");\n }\n\n path = path.replace(match, String(params[paramName]));\n }\n }\n\n return path;\n }\n}\n\nexport const router: Router = new Router();\n",
|
|
6
|
+
"import { Exception } from \"@ooneex/exception\";\nimport { HttpStatus } from \"@ooneex/http-status\";\n\nexport class RouterException extends Exception {\n constructor(message: string, key: string, data: Record<string, unknown> = {}) {\n super(message, {\n key,\n status: HttpStatus.Code.InternalServerError,\n data,\n });\n this.name = \"RouterException\";\n }\n}\n",
|
|
7
7
|
"import type { ControllerClassType } from \"@ooneex/controller\";\nimport type { HttpMethodType } from \"@ooneex/types\";\nimport type { AssertType } from \"@ooneex/validation\";\nimport { router } from \"./Router\";\nimport type { ExtractParameters, RouteConfigType, RoutePathType } from \"./types\";\n\ntype TypedRouteConfig<T extends string> = Omit<\n RouteConfigType,\n \"method\" | \"path\" | \"isSocket\" | \"controller\" | \"params\"\n> & {\n params?: ExtractParameters<T> extends never ? never : Record<ExtractParameters<T>, AssertType>;\n};\n\ntype InferredRouteDecorator = (target: ControllerClassType) => void;\n\ntype RouteDecoratorFunction = <T extends string>(\n path: RoutePathType<T>,\n config: TypedRouteConfig<T>,\n) => InferredRouteDecorator;\n\nconst createRouteDecorator = (method: HttpMethodType) => {\n return <T extends string>(path: RoutePathType<T>, config: TypedRouteConfig<T>): InferredRouteDecorator => {\n return (target: ControllerClassType): void => {\n const route: RouteConfigType = {\n ...config,\n path,\n method,\n isSocket: false,\n controller: target,\n };\n\n router.addRoute(route);\n };\n };\n};\n\nconst createSocketDecorator = () => {\n return <T extends string>(path: RoutePathType<T>, config: TypedRouteConfig<T>): InferredRouteDecorator => {\n return (target: ControllerClassType): void => {\n const route: RouteConfigType = {\n ...config,\n path,\n method: \"GET\",\n isSocket: true,\n controller: target,\n };\n\n router.addRoute(route);\n };\n };\n};\n\nexport const Route = {\n get: createRouteDecorator(\"GET\") as RouteDecoratorFunction,\n post: createRouteDecorator(\"POST\") as RouteDecoratorFunction,\n put: createRouteDecorator(\"PUT\") as RouteDecoratorFunction,\n delete: createRouteDecorator(\"DELETE\") as RouteDecoratorFunction,\n patch: createRouteDecorator(\"PATCH\") as RouteDecoratorFunction,\n options: createRouteDecorator(\"OPTIONS\") as RouteDecoratorFunction,\n head: createRouteDecorator(\"HEAD\") as RouteDecoratorFunction,\n socket: createSocketDecorator() as RouteDecoratorFunction,\n};\n",
|
|
8
8
|
"import { jsonSchemaToTypeString } from \"@ooneex/validation\";\nimport type { RouteConfigType, ValidRoutePath } from \"./types\";\n\n// Type guards and validation helpers\nexport const isValidRoutePath = (path: string): path is ValidRoutePath => {\n // Runtime validation\n if (!path.startsWith(\"/\")) return false;\n if (path.includes(\"//\")) return false;\n if (path.includes(\"::\")) return false;\n if (path.endsWith(\":\")) return false;\n if (path.includes(\"/:\")) {\n // Check for malformed parameters\n const segments = path.split(\"/\");\n for (const segment of segments) {\n if (segment.startsWith(\":\") && segment.length === 1) return false;\n if (segment.includes(\":\") && !segment.startsWith(\":\")) return false;\n }\n }\n return true;\n};\n\n/**\n * Extract parameter names from a route path at runtime\n */\nexport const extractParameterNames = (path: string): string[] => {\n const matches = path.match(/:([^/]+)/g);\n return matches ? matches.map((match) => match.slice(1)) : [];\n};\n\n/**\n * Convert RouteConfigType to TypeScript type string representation\n *\n * @param config - Route configuration object\n * @returns TypeScript type definition as a string\n *\n * @example\n * ```ts\n * const config = {\n * params: {\n * id: Assert(\"string\"),\n * emailId: Assert(\"string\"),\n * },\n * payload: Assert({ name: \"string\" }),\n * queries: Assert({ limit: \"number\" }),\n * response: Assert({ success: \"boolean\", message: \"string\" }),\n * };\n *\n * const typeString = routeConfigToTypeString(config);\n * // Returns:\n * // {\n * // response: { success: boolean; message: string };\n * // params: { id: string; emailId: string };\n * // payload: { name: string };\n * // queries: { limit: number };\n * // }\n * ```\n */\nexport const routeConfigToTypeString = (\n config: Pick<RouteConfigType, \"params\" | \"queries\" | \"payload\" | \"response\">,\n): string => {\n if (!config.response && !config.params && !config.payload && !config.queries) {\n return \"never\";\n }\n\n const typeProperties: string[] = [];\n\n if (config.response) {\n try {\n const constraint = \"getConstraint\" in config.response ? config.response.getConstraint() : config.response;\n const schema = constraint.toJsonSchema();\n let typeStr = jsonSchemaToTypeString(schema);\n if (typeStr === \"unknown\" || typeStr === \"{ }\" || typeStr === \"Record<string, unknown>\") {\n typeStr = \"never\";\n }\n typeProperties.push(`response: ${typeStr}`);\n } catch {\n typeProperties.push(\"response: never\");\n }\n }\n\n if (config.params) {\n const paramProps: string[] = [];\n\n for (const [key, assert] of Object.entries(config.params)) {\n try {\n const constraint = \"getConstraint\" in assert ? assert.getConstraint() : assert;\n const schema = constraint.toJsonSchema();\n let typeStr = jsonSchemaToTypeString(schema);\n if (typeStr === \"unknown\" || typeStr === \"{ }\" || typeStr === \"Record<string, unknown>\") {\n typeStr = \"never\";\n }\n paramProps.push(`${key}: ${typeStr}`);\n } catch {\n paramProps.push(`${key}: never`);\n }\n }\n\n if (paramProps.length > 0) {\n const paramsType = `{ ${paramProps.join(\"; \")} }`;\n typeProperties.push(`params: ${paramsType}`);\n } else {\n typeProperties.push(\"params: never\");\n }\n }\n\n if (config.payload) {\n try {\n const constraint = \"getConstraint\" in config.payload ? config.payload.getConstraint() : config.payload;\n const schema = constraint.toJsonSchema();\n let typeStr = jsonSchemaToTypeString(schema);\n if (typeStr === \"unknown\" || typeStr === \"{ }\" || typeStr === \"Record<string, unknown>\") {\n typeStr = \"never\";\n }\n typeProperties.push(`payload: ${typeStr}`);\n } catch {\n typeProperties.push(\"payload: never\");\n }\n }\n\n if (config.queries) {\n try {\n const constraint = \"getConstraint\" in config.queries ? config.queries.getConstraint() : config.queries;\n const schema = constraint.toJsonSchema();\n let typeStr = jsonSchemaToTypeString(schema);\n if (typeStr === \"unknown\" || typeStr === \"{ }\" || typeStr === \"Record<string, unknown>\") {\n typeStr = \"never\";\n }\n typeProperties.push(`queries: ${typeStr}`);\n } catch {\n typeProperties.push(\"queries: never\");\n }\n }\n\n return `{\\n ${typeProperties.join(\";\\n \")};\\n}`;\n};\n\n/**\n * Helper function to convert AssertType/IAssert to JSON Schema\n */\nconst assertToJsonSchema = (assert: unknown): Record<string, unknown> => {\n try {\n const constraint =\n assert && typeof assert === \"object\" && \"getConstraint\" in assert\n ? (assert as { getConstraint: () => { toJsonSchema: () => Record<string, unknown> } }).getConstraint()\n : (assert as { toJsonSchema: () => Record<string, unknown> });\n return constraint.toJsonSchema();\n } catch {\n return { type: \"unknown\" };\n }\n};\n\n/**\n * Convert RouteConfigType to JSON documentation format\n *\n * @param config - Route configuration object\n * @returns JSON documentation object with route metadata and schemas\n *\n * @example\n * ```ts\n * const config = {\n * name: \"api.users.delete\",\n * path: \"/users/:id/emails/:emailId\",\n * method: \"DELETE\",\n * description: \"Delete a user by ID\",\n * params: {\n * id: Assert(\"string\"),\n * emailId: Assert(\"string\"),\n * },\n * payload: Assert({ name: \"string\" }),\n * queries: Assert({ limit: \"number\" }),\n * response: Assert({ success: \"boolean\", message: \"string\" }),\n * env: [Environment.LOCAL],\n * roles: [ERole.ADMIN],\n * isSocket: false,\n * };\n *\n * const jsonDoc = routeConfigToJsonDoc(config);\n * // Returns:\n * // {\n * // name: \"api.users.delete\",\n * // path: \"/users/:id/emails/:emailId\",\n * // method: \"DELETE\",\n * // description: \"Delete a user by ID\",\n * // isSocket: false,\n * // parameters: [\"id\", \"emailId\"],\n * // schemas: {\n * // params: { type: \"object\", properties: { id: { type: \"string\" }, emailId: { type: \"string\" } } },\n * // queries: { type: \"object\", properties: { limit: { type: \"number\" } } },\n * // payload: { type: \"object\", properties: { name: { type: \"string\" } } },\n * // response: { type: \"object\", properties: { success: { type: \"boolean\" }, message: { type: \"string\" } } }\n * // },\n * // security: {\n * // environments: [\"LOCAL\"],\n * // roles: [\"ADMIN\"],\n * // allowedIPs: [],\n * // allowedHosts: []\n * // }\n * // }\n * ```\n */\nexport const routeConfigToJsonDoc = (config: RouteConfigType): Record<string, unknown> => {\n const doc: Record<string, unknown> = {\n name: config.name,\n path: config.path,\n method: config.method,\n version: config.version,\n description: config.description,\n controller: config.controller.name,\n isSocket: config.isSocket,\n parameters: extractParameterNames(config.path),\n };\n\n const schemas: Record<string, Record<string, unknown>> = {};\n\n if (config.params) {\n const paramsSchema: Record<string, unknown> = {\n type: \"object\",\n properties: {},\n };\n\n for (const [key, assert] of Object.entries(config.params)) {\n const schema = assertToJsonSchema(assert);\n // Remove $schema from the schema object\n delete schema.$schema;\n // Add required field to each property\n schema.required = true;\n (paramsSchema.properties as Record<string, unknown>)[key] = schema;\n }\n\n schemas.params = paramsSchema;\n }\n\n if (config.queries) {\n const schema = assertToJsonSchema(config.queries);\n delete schema.$schema;\n if (schema.type === \"object\" && schema.properties) {\n const requiredFields = (schema.required as string[]) || [];\n const properties = schema.properties as Record<string, unknown>;\n for (const key of Object.keys(properties)) {\n const propSchema = properties[key] as Record<string, unknown>;\n propSchema.required = requiredFields.includes(key);\n }\n delete schema.required;\n }\n schemas.queries = schema;\n }\n\n if (config.payload) {\n const schema = assertToJsonSchema(config.payload);\n delete schema.$schema;\n if (schema.type === \"object\" && schema.properties) {\n const requiredFields = (schema.required as string[]) || [];\n const properties = schema.properties as Record<string, unknown>;\n for (const key of Object.keys(properties)) {\n const propSchema = properties[key] as Record<string, unknown>;\n propSchema.required = requiredFields.includes(key);\n }\n delete schema.required;\n }\n schemas.payload = schema;\n }\n\n if (config.response) {\n const schema = assertToJsonSchema(config.response);\n delete schema.$schema;\n if (schema.type === \"object\" && schema.properties) {\n const requiredFields = (schema.required as string[]) || [];\n const properties = schema.properties as Record<string, unknown>;\n for (const key of Object.keys(properties)) {\n const propSchema = properties[key] as Record<string, unknown>;\n propSchema.required = requiredFields.includes(key);\n }\n delete schema.required;\n }\n schemas.response = schema;\n }\n\n if (Object.keys(schemas).length > 0) {\n doc.schemas = schemas;\n }\n\n const security: Record<string, unknown> = {};\n\n if (config.env && config.env.length > 0) {\n security.environments = config.env;\n }\n\n if (config.roles && config.roles.length > 0) {\n security.roles = config.roles;\n }\n\n if (config.ip && config.ip.length > 0) {\n security.allowedIPs = config.ip;\n }\n\n if (config.host && config.host.length > 0) {\n security.allowedHosts = config.host;\n }\n\n if (Object.keys(security).length > 0) {\n doc.security = security;\n }\n\n return doc;\n};\n"
|
|
9
9
|
],
|
|
10
|
-
"mappings": ";;AAAA;;;ACAA;AACA;AAAA;AAEO,MAAM,wBAAwB,UAAU;AAAA,EAC7C,WAAW,CAAC,SAAiB,OAAgC,CAAC,GAAG;AAAA,
|
|
11
|
-
"debugId": "
|
|
10
|
+
"mappings": ";;AAAA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G;AAAA,MACnD;AAAA,MACA,OAAO,OAAO;AAAA,IAChB;AAAA,IACA,QAAQ,WAAW;AAAA,EACrB;AAAA,EAEA,IAAI,OAAO,KAAK,OAAO,EAAE,SAAS,GAAG;AAAA,IACnC,IAAI,UAAU;AAAA,EAChB;AAAA,EAEA,MAAM,WAAoC,CAAC;AAAA,EAE3C,IAAI,OAAO,OAAO,OAAO,IAAI,SAAS,GAAG;AAAA,IACvC,SAAS,eAAe,OAAO;AAAA,EACjC;AAAA,EAEA,IAAI,OAAO,SAAS,OAAO,MAAM,SAAS,GAAG;AAAA,IAC3C,SAAS,QAAQ,OAAO;AAAA,EAC1B;AAAA,EAEA,IAAI,OAAO,MAAM,OAAO,GAAG,SAAS,GAAG;AAAA,IACrC,SAAS,aAAa,OAAO;AAAA,EAC/B;AAAA,EAEA,IAAI,OAAO,QAAQ,OAAO,KAAK,SAAS,GAAG;AAAA,IACzC,SAAS,eAAe,OAAO;AAAA,EACjC;AAAA,EAEA,IAAI,OAAO,KAAK,QAAQ,EAAE,SAAS,GAAG;AAAA,IACpC,IAAI,WAAW;AAAA,EACjB;AAAA,EAEA,OAAO;AAAA;",
|
|
11
|
+
"debugId": "00BB46926DE228AA64756E2164756E21",
|
|
12
12
|
"names": []
|
|
13
13
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ooneex/routing",
|
|
3
3
|
"description": "Decorator-driven HTTP routing with path parameters, validation constraints, permission guards, and named route generation",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -28,19 +28,19 @@
|
|
|
28
28
|
"npm:publish": "bun publish --tolerate-republish --force --production --access public"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@ooneex/container": "1.1
|
|
32
|
-
"@ooneex/exception": "1.1.
|
|
33
|
-
"@ooneex/http-status": "1.1.
|
|
34
|
-
"@ooneex/validation": "1.1.
|
|
31
|
+
"@ooneex/container": "1.2.1",
|
|
32
|
+
"@ooneex/exception": "1.1.3",
|
|
33
|
+
"@ooneex/http-status": "1.1.3",
|
|
34
|
+
"@ooneex/validation": "1.1.3"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@ooneex/app-env": "1.2.
|
|
38
|
-
"@ooneex/controller": "1.3.
|
|
39
|
-
"@ooneex/http-response": "1.2.
|
|
40
|
-
"@ooneex/permission": "1.1.
|
|
41
|
-
"@ooneex/role": "1.1.
|
|
42
|
-
"@ooneex/translation": "1.1.
|
|
43
|
-
"@ooneex/types": "1.1.
|
|
37
|
+
"@ooneex/app-env": "1.2.1",
|
|
38
|
+
"@ooneex/controller": "1.3.3",
|
|
39
|
+
"@ooneex/http-response": "1.2.3",
|
|
40
|
+
"@ooneex/permission": "1.1.4",
|
|
41
|
+
"@ooneex/role": "1.1.3",
|
|
42
|
+
"@ooneex/translation": "1.1.3",
|
|
43
|
+
"@ooneex/types": "1.1.3"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
|
46
46
|
"bun",
|