clear-router 2.6.6 → 2.7.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 +2 -2
- package/dist/core/index.cjs +7 -1
- package/dist/core/index.d.cts +1 -1
- package/dist/core/index.d.mts +1 -1
- package/dist/core/index.mjs +7 -1
- package/dist/decorators/setup.cjs +1 -1
- package/dist/decorators/setup.mjs +1 -1
- package/dist/express/index.cjs +2 -2
- package/dist/express/index.d.cts +2 -2
- package/dist/express/index.d.mts +2 -2
- package/dist/express/index.mjs +2 -2
- package/dist/fastify/index.cjs +2 -2
- package/dist/fastify/index.d.cts +2 -2
- package/dist/fastify/index.d.mts +2 -2
- package/dist/fastify/index.mjs +2 -2
- package/dist/h3/index.cjs +2 -2
- package/dist/h3/index.d.cts +2 -2
- package/dist/h3/index.d.mts +2 -2
- package/dist/h3/index.mjs +2 -2
- package/dist/hono/index.cjs +2 -2
- package/dist/hono/index.d.cts +2 -2
- package/dist/hono/index.d.mts +2 -2
- package/dist/hono/index.mjs +2 -2
- package/dist/index.cjs +28 -1
- package/dist/index.d.cts +77 -7
- package/dist/index.d.mts +77 -7
- package/dist/index.mjs +28 -1
- package/dist/koa/index.cjs +2 -2
- package/dist/koa/index.d.cts +2 -2
- package/dist/koa/index.d.mts +2 -2
- package/dist/koa/index.mjs +2 -2
- package/dist/{router-Cs8cC5zd.d.mts → router-1hB-k4No.d.mts} +77 -7
- package/dist/{router-CB7Duy0X.cjs → router-C6W-k6sS.cjs} +22 -1
- package/dist/{router-BITqScD_.d.cts → router-Cl6q9Od3.d.cts} +77 -7
- package/dist/{router-CTzjojnD.mjs → router-Dc9w86Wn.mjs} +22 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/clear-router)
|
|
4
4
|
[](https://www.npmjs.com/package/clear-router)
|
|
5
|
-
[](https://github.com/
|
|
5
|
+
[](https://github.com/arkstack-tmp/clear-router/blob/main/LICENSE)
|
|
6
6
|
[](https://github.com/arkstack-tmp/clear-router/actions/workflows/npm-publish.yml)
|
|
7
7
|
[](https://github.com/arkstack-tmp/clear-router/actions/workflows/ci.yml)
|
|
8
8
|
|
|
@@ -146,4 +146,4 @@ MIT License © 2026 ToneFlix Technologies Limited
|
|
|
146
146
|
|
|
147
147
|
## Repository
|
|
148
148
|
|
|
149
|
-
https://github.com/
|
|
149
|
+
https://github.com/arkstack-tmp/clear-router
|
package/dist/core/index.cjs
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_bindings = require('../bindings-CLsZjOEy.cjs');
|
|
3
|
-
const require_router = require('../router-
|
|
3
|
+
const require_router = require('../router-C6W-k6sS.cjs');
|
|
4
4
|
|
|
5
5
|
//#region src/core/plugins.ts
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new plugin
|
|
8
|
+
*
|
|
9
|
+
* @param plugin
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
6
12
|
function definePlugin(plugin) {
|
|
7
13
|
return plugin;
|
|
8
14
|
}
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { L as Response, a as ClearRouterPluginInput, c as PluginBind, d as PluginSetupResult, f as definePlugin, i as ClearRouterPluginContext, l as PluginBindFactory, n as ClearRouterPlugin, o as ClearRouterPluginRequestContext, p as Request, r as ClearRouterPluginArgumentsContext, s as PluginArgumentsResolver, t as CoreRouter, u as PluginBindValue } from "../router-
|
|
1
|
+
import { L as Response, a as ClearRouterPluginInput, c as PluginBind, d as PluginSetupResult, f as definePlugin, i as ClearRouterPluginContext, l as PluginBindFactory, n as ClearRouterPlugin, o as ClearRouterPluginRequestContext, p as Request, r as ClearRouterPluginArgumentsContext, s as PluginArgumentsResolver, t as CoreRouter, u as PluginBindValue } from "../router-Cl6q9Od3.cjs";
|
|
2
2
|
export { ClearRouterPlugin, ClearRouterPluginArgumentsContext, ClearRouterPluginContext, ClearRouterPluginInput, ClearRouterPluginRequestContext, CoreRouter, PluginArgumentsResolver, PluginBind, PluginBindFactory, PluginBindValue, PluginSetupResult, Request, Response, definePlugin };
|
package/dist/core/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { L as Response, a as ClearRouterPluginInput, c as PluginBind, d as PluginSetupResult, f as definePlugin, i as ClearRouterPluginContext, l as PluginBindFactory, n as ClearRouterPlugin, o as ClearRouterPluginRequestContext, p as Request, r as ClearRouterPluginArgumentsContext, s as PluginArgumentsResolver, t as CoreRouter, u as PluginBindValue } from "../router-
|
|
1
|
+
import { L as Response, a as ClearRouterPluginInput, c as PluginBind, d as PluginSetupResult, f as definePlugin, i as ClearRouterPluginContext, l as PluginBindFactory, n as ClearRouterPlugin, o as ClearRouterPluginRequestContext, p as Request, r as ClearRouterPluginArgumentsContext, s as PluginArgumentsResolver, t as CoreRouter, u as PluginBindValue } from "../router-1hB-k4No.mjs";
|
|
2
2
|
export { ClearRouterPlugin, ClearRouterPluginArgumentsContext, ClearRouterPluginContext, ClearRouterPluginInput, ClearRouterPluginRequestContext, CoreRouter, PluginArgumentsResolver, PluginBind, PluginBindFactory, PluginBindValue, PluginSetupResult, Request, Response, definePlugin };
|
package/dist/core/index.mjs
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { c as Request, s as Response } from "../bindings-XLDXFpHZ.mjs";
|
|
2
|
-
import { t as CoreRouter } from "../router-
|
|
2
|
+
import { t as CoreRouter } from "../router-Dc9w86Wn.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/core/plugins.ts
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new plugin
|
|
7
|
+
*
|
|
8
|
+
* @param plugin
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
5
11
|
function definePlugin(plugin) {
|
|
6
12
|
return plugin;
|
|
7
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_bindings = require('../bindings-CLsZjOEy.cjs');
|
|
3
|
-
const require_router = require('../router-
|
|
3
|
+
const require_router = require('../router-C6W-k6sS.cjs');
|
|
4
4
|
require('./index.cjs');
|
|
5
5
|
require("reflect-metadata");
|
|
6
6
|
|
package/dist/express/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
require('../bindings-CLsZjOEy.cjs');
|
|
3
|
-
const require_router = require('../router-
|
|
3
|
+
const require_router = require('../router-C6W-k6sS.cjs');
|
|
4
4
|
const require_responses = require('../responses-Bvnk0uvc.cjs');
|
|
5
5
|
|
|
6
6
|
//#region src/express/router.ts
|
|
@@ -9,7 +9,7 @@ const require_responses = require('../responses-Bvnk0uvc.cjs');
|
|
|
9
9
|
* @description Laravel-style routing system for Express.js and H3 with support for CommonJS, ESM, and TypeScript
|
|
10
10
|
* @author Refkinscallv
|
|
11
11
|
* @author 3m1n3nc3
|
|
12
|
-
* @repository https://github.com/
|
|
12
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
13
13
|
*/
|
|
14
14
|
var Router = class Router extends require_router.CoreRouter {
|
|
15
15
|
static routerStateNamespace = "clear-router:express";
|
package/dist/express/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as ControllerAction, I as HttpMethod, M as HttpContext, N as Middleware, P as ApiResourceMiddleware, j as Handler, m as Route, t as CoreRouter } from "../router-
|
|
1
|
+
import { F as ControllerAction, I as HttpMethod, M as HttpContext, N as Middleware, P as ApiResourceMiddleware, j as Handler, m as Route, t as CoreRouter } from "../router-Cl6q9Od3.cjs";
|
|
2
2
|
import { Router as Router$1 } from "express";
|
|
3
3
|
|
|
4
4
|
//#region src/express/router.d.ts
|
|
@@ -7,7 +7,7 @@ import { Router as Router$1 } from "express";
|
|
|
7
7
|
* @description Laravel-style routing system for Express.js and H3 with support for CommonJS, ESM, and TypeScript
|
|
8
8
|
* @author Refkinscallv
|
|
9
9
|
* @author 3m1n3nc3
|
|
10
|
-
* @repository https://github.com/
|
|
10
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
11
11
|
*/
|
|
12
12
|
declare class Router extends CoreRouter {
|
|
13
13
|
protected static routerStateNamespace: string;
|
package/dist/express/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as ControllerAction, I as HttpMethod, M as HttpContext, N as Middleware, P as ApiResourceMiddleware, j as Handler, m as Route, t as CoreRouter } from "../router-
|
|
1
|
+
import { F as ControllerAction, I as HttpMethod, M as HttpContext, N as Middleware, P as ApiResourceMiddleware, j as Handler, m as Route, t as CoreRouter } from "../router-1hB-k4No.mjs";
|
|
2
2
|
import { Router as Router$1 } from "express";
|
|
3
3
|
|
|
4
4
|
//#region src/express/router.d.ts
|
|
@@ -7,7 +7,7 @@ import { Router as Router$1 } from "express";
|
|
|
7
7
|
* @description Laravel-style routing system for Express.js and H3 with support for CommonJS, ESM, and TypeScript
|
|
8
8
|
* @author Refkinscallv
|
|
9
9
|
* @author 3m1n3nc3
|
|
10
|
-
* @repository https://github.com/
|
|
10
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
11
11
|
*/
|
|
12
12
|
declare class Router extends CoreRouter {
|
|
13
13
|
protected static routerStateNamespace: string;
|
package/dist/express/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../bindings-XLDXFpHZ.mjs";
|
|
2
|
-
import { t as CoreRouter } from "../router-
|
|
2
|
+
import { t as CoreRouter } from "../router-Dc9w86Wn.mjs";
|
|
3
3
|
import { n as resolveResponseMeta, r as responseWasSent, t as isFetchResponse } from "../responses-BvETUeDL.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/express/router.ts
|
|
@@ -8,7 +8,7 @@ import { n as resolveResponseMeta, r as responseWasSent, t as isFetchResponse }
|
|
|
8
8
|
* @description Laravel-style routing system for Express.js and H3 with support for CommonJS, ESM, and TypeScript
|
|
9
9
|
* @author Refkinscallv
|
|
10
10
|
* @author 3m1n3nc3
|
|
11
|
-
* @repository https://github.com/
|
|
11
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
12
12
|
*/
|
|
13
13
|
var Router = class Router extends CoreRouter {
|
|
14
14
|
static routerStateNamespace = "clear-router:express";
|
package/dist/fastify/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
require('../bindings-CLsZjOEy.cjs');
|
|
3
|
-
const require_router = require('../router-
|
|
3
|
+
const require_router = require('../router-C6W-k6sS.cjs');
|
|
4
4
|
const require_responses = require('../responses-Bvnk0uvc.cjs');
|
|
5
5
|
|
|
6
6
|
//#region src/fastify/router.ts
|
|
@@ -8,7 +8,7 @@ const require_responses = require('../responses-Bvnk0uvc.cjs');
|
|
|
8
8
|
* @class clear-router Fastify Router
|
|
9
9
|
* @description Laravel-style routing system for Fastify using shared clear-router core
|
|
10
10
|
* @author 3m1n3nc3
|
|
11
|
-
* @repository https://github.com/
|
|
11
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
12
12
|
*/
|
|
13
13
|
var Router = class Router extends require_router.CoreRouter {
|
|
14
14
|
static routerStateNamespace = "clear-router:fastify";
|
package/dist/fastify/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A as Middleware, D as FastifyApp, F as ControllerAction, I as HttpMethod, O as Handler, P as ApiResourceMiddleware, k as HttpContext, m as Route, t as CoreRouter } from "../router-
|
|
1
|
+
import { A as Middleware, D as FastifyApp, F as ControllerAction, I as HttpMethod, O as Handler, P as ApiResourceMiddleware, k as HttpContext, m as Route, t as CoreRouter } from "../router-Cl6q9Od3.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/fastify/router.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* @class clear-router Fastify Router
|
|
6
6
|
* @description Laravel-style routing system for Fastify using shared clear-router core
|
|
7
7
|
* @author 3m1n3nc3
|
|
8
|
-
* @repository https://github.com/
|
|
8
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
9
9
|
*/
|
|
10
10
|
declare class Router extends CoreRouter {
|
|
11
11
|
protected static routerStateNamespace: string;
|
package/dist/fastify/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A as Middleware, D as FastifyApp, F as ControllerAction, I as HttpMethod, O as Handler, P as ApiResourceMiddleware, k as HttpContext, m as Route, t as CoreRouter } from "../router-
|
|
1
|
+
import { A as Middleware, D as FastifyApp, F as ControllerAction, I as HttpMethod, O as Handler, P as ApiResourceMiddleware, k as HttpContext, m as Route, t as CoreRouter } from "../router-1hB-k4No.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/fastify/router.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* @class clear-router Fastify Router
|
|
6
6
|
* @description Laravel-style routing system for Fastify using shared clear-router core
|
|
7
7
|
* @author 3m1n3nc3
|
|
8
|
-
* @repository https://github.com/
|
|
8
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
9
9
|
*/
|
|
10
10
|
declare class Router extends CoreRouter {
|
|
11
11
|
protected static routerStateNamespace: string;
|
package/dist/fastify/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../bindings-XLDXFpHZ.mjs";
|
|
2
|
-
import { t as CoreRouter } from "../router-
|
|
2
|
+
import { t as CoreRouter } from "../router-Dc9w86Wn.mjs";
|
|
3
3
|
import { n as resolveResponseMeta, r as responseWasSent, t as isFetchResponse } from "../responses-BvETUeDL.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/fastify/router.ts
|
|
@@ -7,7 +7,7 @@ import { n as resolveResponseMeta, r as responseWasSent, t as isFetchResponse }
|
|
|
7
7
|
* @class clear-router Fastify Router
|
|
8
8
|
* @description Laravel-style routing system for Fastify using shared clear-router core
|
|
9
9
|
* @author 3m1n3nc3
|
|
10
|
-
* @repository https://github.com/
|
|
10
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
11
11
|
*/
|
|
12
12
|
var Router = class Router extends CoreRouter {
|
|
13
13
|
static routerStateNamespace = "clear-router:fastify";
|
package/dist/h3/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
require('../bindings-CLsZjOEy.cjs');
|
|
3
|
-
const require_router = require('../router-
|
|
3
|
+
const require_router = require('../router-C6W-k6sS.cjs');
|
|
4
4
|
const require_responses = require('../responses-Bvnk0uvc.cjs');
|
|
5
5
|
let h3 = require("h3");
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ let h3 = require("h3");
|
|
|
9
9
|
* @class clear-router H3 Router
|
|
10
10
|
* @description Laravel-style routing system for Express.js and H3 with support for CommonJS, ESM, and TypeScript
|
|
11
11
|
* @author 3m1n3nc3
|
|
12
|
-
* @repository https://github.com/
|
|
12
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
13
13
|
*/
|
|
14
14
|
var Router = class Router extends require_router.CoreRouter {
|
|
15
15
|
static routerStateNamespace = "clear-router:h3";
|
package/dist/h3/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as H3App, E as Middleware, F as ControllerAction, I as HttpMethod, P as ApiResourceMiddleware, T as HttpContext, m as Route, t as CoreRouter, w as Handler } from "../router-
|
|
1
|
+
import { C as H3App, E as Middleware, F as ControllerAction, I as HttpMethod, P as ApiResourceMiddleware, T as HttpContext, m as Route, t as CoreRouter, w as Handler } from "../router-Cl6q9Od3.cjs";
|
|
2
2
|
import { H3 } from "h3";
|
|
3
3
|
|
|
4
4
|
//#region src/h3/router.d.ts
|
|
@@ -6,7 +6,7 @@ import { H3 } from "h3";
|
|
|
6
6
|
* @class clear-router H3 Router
|
|
7
7
|
* @description Laravel-style routing system for Express.js and H3 with support for CommonJS, ESM, and TypeScript
|
|
8
8
|
* @author 3m1n3nc3
|
|
9
|
-
* @repository https://github.com/
|
|
9
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
10
10
|
*/
|
|
11
11
|
declare class Router extends CoreRouter {
|
|
12
12
|
protected static routerStateNamespace: string;
|
package/dist/h3/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as H3App, E as Middleware, F as ControllerAction, I as HttpMethod, P as ApiResourceMiddleware, T as HttpContext, m as Route, t as CoreRouter, w as Handler } from "../router-
|
|
1
|
+
import { C as H3App, E as Middleware, F as ControllerAction, I as HttpMethod, P as ApiResourceMiddleware, T as HttpContext, m as Route, t as CoreRouter, w as Handler } from "../router-1hB-k4No.mjs";
|
|
2
2
|
import { H3 } from "h3";
|
|
3
3
|
|
|
4
4
|
//#region src/h3/router.d.ts
|
|
@@ -6,7 +6,7 @@ import { H3 } from "h3";
|
|
|
6
6
|
* @class clear-router H3 Router
|
|
7
7
|
* @description Laravel-style routing system for Express.js and H3 with support for CommonJS, ESM, and TypeScript
|
|
8
8
|
* @author 3m1n3nc3
|
|
9
|
-
* @repository https://github.com/
|
|
9
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
10
10
|
*/
|
|
11
11
|
declare class Router extends CoreRouter {
|
|
12
12
|
protected static routerStateNamespace: string;
|
package/dist/h3/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../bindings-XLDXFpHZ.mjs";
|
|
2
|
-
import { t as CoreRouter } from "../router-
|
|
2
|
+
import { t as CoreRouter } from "../router-Dc9w86Wn.mjs";
|
|
3
3
|
import { n as resolveResponseMeta } from "../responses-BvETUeDL.mjs";
|
|
4
4
|
import { HTTPResponse, getQuery, getRouterParams, readBody } from "h3";
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ import { HTTPResponse, getQuery, getRouterParams, readBody } from "h3";
|
|
|
8
8
|
* @class clear-router H3 Router
|
|
9
9
|
* @description Laravel-style routing system for Express.js and H3 with support for CommonJS, ESM, and TypeScript
|
|
10
10
|
* @author 3m1n3nc3
|
|
11
|
-
* @repository https://github.com/
|
|
11
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
12
12
|
*/
|
|
13
13
|
var Router = class Router extends CoreRouter {
|
|
14
14
|
static routerStateNamespace = "clear-router:h3";
|
package/dist/hono/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
require('../bindings-CLsZjOEy.cjs');
|
|
3
|
-
const require_router = require('../router-
|
|
3
|
+
const require_router = require('../router-C6W-k6sS.cjs');
|
|
4
4
|
const require_responses = require('../responses-Bvnk0uvc.cjs');
|
|
5
5
|
|
|
6
6
|
//#region src/hono/router.ts
|
|
@@ -8,7 +8,7 @@ const require_responses = require('../responses-Bvnk0uvc.cjs');
|
|
|
8
8
|
* @class clear-router Hono Router
|
|
9
9
|
* @description Laravel-style routing system for Hono using shared clear-router core
|
|
10
10
|
* @author 3m1n3nc3
|
|
11
|
-
* @repository https://github.com/
|
|
11
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
12
12
|
*/
|
|
13
13
|
var Router = class Router extends require_router.CoreRouter {
|
|
14
14
|
static routerStateNamespace = "clear-router:hono";
|
package/dist/hono/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { F as ControllerAction, I as HttpMethod, P as ApiResourceMiddleware, S as Middleware, b as HonoApp, m as Route, t as CoreRouter, x as HttpContext, y as Handler } from "../router-
|
|
1
|
+
import { F as ControllerAction, I as HttpMethod, P as ApiResourceMiddleware, S as Middleware, b as HonoApp, m as Route, t as CoreRouter, x as HttpContext, y as Handler } from "../router-Cl6q9Od3.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/hono/router.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* @class clear-router Hono Router
|
|
6
6
|
* @description Laravel-style routing system for Hono using shared clear-router core
|
|
7
7
|
* @author 3m1n3nc3
|
|
8
|
-
* @repository https://github.com/
|
|
8
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
9
9
|
*/
|
|
10
10
|
declare class Router extends CoreRouter {
|
|
11
11
|
protected static routerStateNamespace: string;
|
package/dist/hono/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { F as ControllerAction, I as HttpMethod, P as ApiResourceMiddleware, S as Middleware, b as HonoApp, m as Route, t as CoreRouter, x as HttpContext, y as Handler } from "../router-
|
|
1
|
+
import { F as ControllerAction, I as HttpMethod, P as ApiResourceMiddleware, S as Middleware, b as HonoApp, m as Route, t as CoreRouter, x as HttpContext, y as Handler } from "../router-1hB-k4No.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/hono/router.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* @class clear-router Hono Router
|
|
6
6
|
* @description Laravel-style routing system for Hono using shared clear-router core
|
|
7
7
|
* @author 3m1n3nc3
|
|
8
|
-
* @repository https://github.com/
|
|
8
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
9
9
|
*/
|
|
10
10
|
declare class Router extends CoreRouter {
|
|
11
11
|
protected static routerStateNamespace: string;
|
package/dist/hono/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../bindings-XLDXFpHZ.mjs";
|
|
2
|
-
import { t as CoreRouter } from "../router-
|
|
2
|
+
import { t as CoreRouter } from "../router-Dc9w86Wn.mjs";
|
|
3
3
|
import { n as resolveResponseMeta } from "../responses-BvETUeDL.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/hono/router.ts
|
|
@@ -7,7 +7,7 @@ import { n as resolveResponseMeta } from "../responses-BvETUeDL.mjs";
|
|
|
7
7
|
* @class clear-router Hono Router
|
|
8
8
|
* @description Laravel-style routing system for Hono using shared clear-router core
|
|
9
9
|
* @author 3m1n3nc3
|
|
10
|
-
* @repository https://github.com/
|
|
10
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
11
11
|
*/
|
|
12
12
|
var Router = class Router extends CoreRouter {
|
|
13
13
|
static routerStateNamespace = "clear-router:hono";
|
package/dist/index.cjs
CHANGED
|
@@ -179,6 +179,12 @@ var Response = class {
|
|
|
179
179
|
|
|
180
180
|
//#endregion
|
|
181
181
|
//#region src/core/plugins.ts
|
|
182
|
+
/**
|
|
183
|
+
* Creates a new plugin
|
|
184
|
+
*
|
|
185
|
+
* @param plugin
|
|
186
|
+
* @returns
|
|
187
|
+
*/
|
|
182
188
|
function definePlugin(plugin) {
|
|
183
189
|
return plugin;
|
|
184
190
|
}
|
|
@@ -290,7 +296,7 @@ function isClass(value) {
|
|
|
290
296
|
* @class clear-router CoreRouter
|
|
291
297
|
* @description Core routing logic for clear-router, shared between all supported adapters (Express.js, H3, etc.)
|
|
292
298
|
* @author 3m1n3nc3
|
|
293
|
-
* @repository https://github.com/
|
|
299
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
294
300
|
*/
|
|
295
301
|
var CoreRouter = class {
|
|
296
302
|
static routerStateNamespace = "clear-router:core";
|
|
@@ -299,6 +305,7 @@ var CoreRouter = class {
|
|
|
299
305
|
static defaultConfigKey = Symbol.for("clear-router:default-config");
|
|
300
306
|
static pluginStoreKey = Symbol.for("clear-router:plugins");
|
|
301
307
|
static pluginPendingKey = Symbol.for("clear-router:plugin-promises");
|
|
308
|
+
static pluginHttpCtxResolversKey = Symbol.for("clear-router:plugin-http-ctx");
|
|
302
309
|
static pluginArgumentResolversKey = Symbol.for("clear-router:plugin-argument-resolvers");
|
|
303
310
|
static requestProvider;
|
|
304
311
|
static responseProvider;
|
|
@@ -394,6 +401,11 @@ var CoreRouter = class {
|
|
|
394
401
|
if (!g[this.pluginArgumentResolversKey]) g[this.pluginArgumentResolversKey] = /* @__PURE__ */ new Set();
|
|
395
402
|
return g[this.pluginArgumentResolversKey];
|
|
396
403
|
}
|
|
404
|
+
static getPluginHttpCtxResolvers() {
|
|
405
|
+
const g = globalThis;
|
|
406
|
+
if (!g[this.pluginHttpCtxResolversKey]) g[this.pluginHttpCtxResolversKey] = /* @__PURE__ */ new Set();
|
|
407
|
+
return g[this.pluginHttpCtxResolversKey];
|
|
408
|
+
}
|
|
397
409
|
static createDefaultState() {
|
|
398
410
|
return {
|
|
399
411
|
config: this.getDefaultConfig(),
|
|
@@ -475,6 +487,11 @@ var CoreRouter = class {
|
|
|
475
487
|
}
|
|
476
488
|
};
|
|
477
489
|
}
|
|
490
|
+
/**
|
|
491
|
+
* Default configuration used for everytime the router is reset
|
|
492
|
+
*
|
|
493
|
+
* @param options
|
|
494
|
+
*/
|
|
478
495
|
static configureDefaults(options) {
|
|
479
496
|
const g = globalThis;
|
|
480
497
|
const defaults = this.mergeConfig(g[this.defaultConfigKey] || this.createBaseConfig(), options);
|
|
@@ -502,6 +519,9 @@ var CoreRouter = class {
|
|
|
502
519
|
resolveArguments: (resolver) => {
|
|
503
520
|
this.getPluginArgumentResolvers().add(resolver);
|
|
504
521
|
},
|
|
522
|
+
useHttpContext: (resolver) => {
|
|
523
|
+
this.getPluginHttpCtxResolvers().add(resolver);
|
|
524
|
+
},
|
|
505
525
|
bindings: Container.bindings(),
|
|
506
526
|
configure: this.configure.bind(this),
|
|
507
527
|
configureDefaults: this.configureDefaults.bind(this),
|
|
@@ -572,6 +592,12 @@ var CoreRouter = class {
|
|
|
572
592
|
if (Array.isArray(args)) return args;
|
|
573
593
|
}
|
|
574
594
|
}
|
|
595
|
+
static async resolvePluginHttpCtx(ctx) {
|
|
596
|
+
const resolvers = Array.from(this.getPluginHttpCtxResolvers());
|
|
597
|
+
if (!resolvers.length) return void 0;
|
|
598
|
+
const pluginContext = this.createPluginRequestContext(ctx);
|
|
599
|
+
for (const resolver of resolvers) await resolver(pluginContext);
|
|
600
|
+
}
|
|
575
601
|
static ensureState() {
|
|
576
602
|
this.bindStateAccessors();
|
|
577
603
|
if (!this.config) this.config = { methodOverride: {
|
|
@@ -995,6 +1021,7 @@ var CoreRouter = class {
|
|
|
995
1021
|
static async callHandler(handlerFunction, ctx, bindingTarget, bindingMethod, bindingHandler, bindingMetadata) {
|
|
996
1022
|
return this.pluginRequestContext.run(this.createPluginRequestContext(ctx), async () => {
|
|
997
1023
|
await this.pluginsReady();
|
|
1024
|
+
await this.resolvePluginHttpCtx(ctx);
|
|
998
1025
|
if (!this.config.container?.enabled) return handlerFunction(ctx, ctx.clearRequest);
|
|
999
1026
|
const designTokens = [...bindingTarget ? getDesignParamTypes(bindingTarget, bindingMethod) : [], ...bindingHandler ? getDesignParamTypes(bindingHandler) : []];
|
|
1000
1027
|
const metadata = getBindingMetadataFromTargets([
|
package/dist/index.d.cts
CHANGED
|
@@ -207,32 +207,94 @@ type PluginBindFactory<T = any> = (ctx: ClearRouterPluginRequestContext) => T |
|
|
|
207
207
|
type PluginBindValue<T = any> = BindValue<T> | PluginBindFactory<T>;
|
|
208
208
|
type PluginBind = <T>(token: BindToken<T>, value: PluginBindValue<T>) => void;
|
|
209
209
|
type PluginArgumentsResolver = (ctx: ClearRouterPluginArgumentsContext) => any[] | undefined | Promise<any[] | undefined>;
|
|
210
|
-
interface ClearRouterPluginContext<Options = any> {
|
|
210
|
+
interface ClearRouterPluginContext<Options = any, _HttpContext = any> {
|
|
211
|
+
/**
|
|
212
|
+
* The service container
|
|
213
|
+
*/
|
|
211
214
|
container: typeof Container;
|
|
215
|
+
/**
|
|
216
|
+
* Register service container bindings
|
|
217
|
+
*/
|
|
212
218
|
bind: PluginBind;
|
|
219
|
+
/**
|
|
220
|
+
* Replace all controller method arguments
|
|
221
|
+
* @param resolver
|
|
222
|
+
* @returns
|
|
223
|
+
*/
|
|
213
224
|
resolveArguments: (resolver: PluginArgumentsResolver) => void;
|
|
225
|
+
/**
|
|
226
|
+
* Use the current http context
|
|
227
|
+
*/
|
|
228
|
+
useHttpContext: (resolver: PluginArgumentsResolver) => void;
|
|
229
|
+
/**
|
|
230
|
+
* All registered service container bindings
|
|
231
|
+
*/
|
|
214
232
|
bindings: Record<string, BindValue>;
|
|
233
|
+
/**
|
|
234
|
+
* Configures the router with the given options, such as method override settings
|
|
235
|
+
*
|
|
236
|
+
* @param options
|
|
237
|
+
* @returns
|
|
238
|
+
*/
|
|
215
239
|
configure: (options: RouterConfig) => void;
|
|
240
|
+
/**
|
|
241
|
+
* Default configuration used for everytime the router is reset
|
|
242
|
+
*
|
|
243
|
+
* @param options
|
|
244
|
+
*/
|
|
216
245
|
configureDefaults: (options: RouterConfig) => void;
|
|
246
|
+
/**
|
|
247
|
+
* The current Request instance
|
|
248
|
+
*/
|
|
217
249
|
readonly request?: Request;
|
|
250
|
+
/**
|
|
251
|
+
* The current Response instance
|
|
252
|
+
* @returns
|
|
253
|
+
*/
|
|
218
254
|
readonly response?: Response$1;
|
|
255
|
+
/**
|
|
256
|
+
* Get the current Request instance
|
|
257
|
+
* @returns
|
|
258
|
+
*/
|
|
219
259
|
getRequest: () => Request | undefined;
|
|
260
|
+
/**
|
|
261
|
+
* Get the current Response instance
|
|
262
|
+
* @returns
|
|
263
|
+
*/
|
|
220
264
|
getResponse: () => Response$1 | undefined;
|
|
265
|
+
/**
|
|
266
|
+
* Plugin configuration options
|
|
267
|
+
*/
|
|
221
268
|
options: Options;
|
|
222
269
|
}
|
|
223
|
-
interface ClearRouterPlugin<Options = any> {
|
|
270
|
+
interface ClearRouterPlugin<Options = any, HttpContext = any> {
|
|
271
|
+
/**
|
|
272
|
+
* The name of the plugin
|
|
273
|
+
*/
|
|
224
274
|
name?: string;
|
|
225
|
-
|
|
275
|
+
/**
|
|
276
|
+
* Plugin setup an implemnetation
|
|
277
|
+
*
|
|
278
|
+
* @param ctx
|
|
279
|
+
* @returns
|
|
280
|
+
*/
|
|
281
|
+
setup: (ctx: ClearRouterPluginContext<Options, HttpContext>) => PluginSetupResult;
|
|
226
282
|
}
|
|
227
|
-
type ClearRouterPluginInput<Options = any> = ClearRouterPlugin<Options> | ((ctx: ClearRouterPluginContext<Options>) => PluginSetupResult);
|
|
228
|
-
|
|
283
|
+
type ClearRouterPluginInput<Options = any, HttpContext = any> = ClearRouterPlugin<Options> | ((ctx: ClearRouterPluginContext<Options, HttpContext>) => PluginSetupResult);
|
|
284
|
+
/**
|
|
285
|
+
* Creates a new plugin
|
|
286
|
+
*
|
|
287
|
+
* @param plugin
|
|
288
|
+
* @returns
|
|
289
|
+
*/
|
|
290
|
+
declare function definePlugin<Options = any, HttpContext = any>(plugin: ClearRouterPlugin<Options, HttpContext>): ClearRouterPlugin<Options, HttpContext>;
|
|
229
291
|
//#endregion
|
|
230
292
|
//#region src/core/router.d.ts
|
|
231
293
|
/**
|
|
232
294
|
* @class clear-router CoreRouter
|
|
233
295
|
* @description Core routing logic for clear-router, shared between all supported adapters (Express.js, H3, etc.)
|
|
234
296
|
* @author 3m1n3nc3
|
|
235
|
-
* @repository https://github.com/
|
|
297
|
+
* @repository https://github.com/arkstack-tmp/clear-router
|
|
236
298
|
*/
|
|
237
299
|
declare abstract class CoreRouter {
|
|
238
300
|
protected static routerStateNamespace: string;
|
|
@@ -241,6 +303,7 @@ declare abstract class CoreRouter {
|
|
|
241
303
|
private static readonly defaultConfigKey;
|
|
242
304
|
private static readonly pluginStoreKey;
|
|
243
305
|
private static readonly pluginPendingKey;
|
|
306
|
+
private static readonly pluginHttpCtxResolversKey;
|
|
244
307
|
private static readonly pluginArgumentResolversKey;
|
|
245
308
|
private static requestProvider?;
|
|
246
309
|
private static responseProvider?;
|
|
@@ -269,6 +332,7 @@ declare abstract class CoreRouter {
|
|
|
269
332
|
protected static getPluginStore(): Set<string>;
|
|
270
333
|
protected static getPluginPendingStore(): Set<Promise<void>>;
|
|
271
334
|
protected static getPluginArgumentResolvers(): Set<PluginArgumentsResolver>;
|
|
335
|
+
protected static getPluginHttpCtxResolvers(): Set<PluginArgumentsResolver>;
|
|
272
336
|
protected static createDefaultState(): {
|
|
273
337
|
config: RouterConfig;
|
|
274
338
|
groupContext: AsyncLocalStorage<{
|
|
@@ -285,6 +349,11 @@ declare abstract class CoreRouter {
|
|
|
285
349
|
};
|
|
286
350
|
protected static bindStateAccessors(): void;
|
|
287
351
|
protected static createDefaultOptionsHandler(): any;
|
|
352
|
+
/**
|
|
353
|
+
* Default configuration used for everytime the router is reset
|
|
354
|
+
*
|
|
355
|
+
* @param options
|
|
356
|
+
*/
|
|
288
357
|
static configureDefaults(options?: RouterConfig): void;
|
|
289
358
|
/**
|
|
290
359
|
* Use a registered plugin
|
|
@@ -299,7 +368,8 @@ declare abstract class CoreRouter {
|
|
|
299
368
|
protected static getCurrentPluginRequestContext(): ClearRouterPluginRequestContext | undefined;
|
|
300
369
|
protected static createPluginRequestContext(ctx: any): ClearRouterPluginRequestContext;
|
|
301
370
|
protected static createPluginBind(): PluginBind;
|
|
302
|
-
protected static resolvePluginArguments(
|
|
371
|
+
protected static resolvePluginArguments(ctx: any, routeContext: Omit<ClearRouterPluginArgumentsContext, keyof ClearRouterPluginRequestContext>): Promise<any[] | undefined>;
|
|
372
|
+
protected static resolvePluginHttpCtx(ctx: any): Promise<void>;
|
|
303
373
|
protected static ensureState(): void;
|
|
304
374
|
/**
|
|
305
375
|
* Normalizes a path by ensuring it starts with a single slash and does not have trailing
|