@adonisjs/http-server 8.0.0-next.2 → 8.0.0-next.4

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.
@@ -956,7 +956,9 @@ var Route = class extends Macroable4 {
956
956
  const moduleRefId = parts.join(".");
957
957
  return {
958
958
  handler: {
959
+ method,
959
960
  reference: handler,
961
+ importExpression: moduleRefId,
960
962
  ...moduleImporter(() => this.#app.import(moduleRefId), method).toHandleMethod(),
961
963
  name: handler
962
964
  },
@@ -969,7 +971,9 @@ var Route = class extends Macroable4 {
969
971
  if (is.class(controller)) {
970
972
  return {
971
973
  handler: {
974
+ method,
972
975
  reference: handler,
976
+ importExpression: null,
973
977
  ...moduleCaller(controller, method).toHandleMethod()
974
978
  },
975
979
  routeName: `${new StringBuilder(controller.name).removeSuffix("controller").snakeCase()}.${string2.snakeCase(method)}`
@@ -977,10 +981,12 @@ var Route = class extends Macroable4 {
977
981
  }
978
982
  return {
979
983
  handler: {
984
+ method,
980
985
  reference: handler,
986
+ importExpression: String(controller),
981
987
  ...moduleImporter(controller, method).toHandleMethod()
982
988
  },
983
- routeName: `${new StringBuilder(controller.name).removeSuffix("controller").snakeCase()}.${string2.snakeCase(method)}`
989
+ routeName: controller.name ? `${new StringBuilder(controller.name).removeSuffix("controller").snakeCase()}.${string2.snakeCase(method)}` : void 0
984
990
  };
985
991
  }
986
992
  return { handler };
@@ -4290,7 +4296,7 @@ var Router = class {
4290
4296
  });
4291
4297
  }
4292
4298
  const domains = Object.keys(this.routes).filter((domain) => domain !== "root");
4293
- this.routes["root"].forEach((route) => trackRoute.bind(this)(route));
4299
+ this.routes["root"]?.forEach((route) => trackRoute.bind(this)(route));
4294
4300
  domains.forEach(
4295
4301
  (domain) => this.routes[domain].forEach((route) => trackRoute.bind(this)(route, domain))
4296
4302
  );
@@ -6,7 +6,7 @@ import {
6
6
  Router,
7
7
  Server,
8
8
  defineConfig
9
- } from "../chunk-Z5EN426L.js";
9
+ } from "../chunk-BFGF3A5X.js";
10
10
  import "../chunk-ASX56VAK.js";
11
11
 
12
12
  // factories/router.ts
package/build/index.js CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  errors_exports,
21
21
  parseRange,
22
22
  tracing_channels_exports
23
- } from "./chunk-Z5EN426L.js";
23
+ } from "./chunk-BFGF3A5X.js";
24
24
  import "./chunk-ASX56VAK.js";
25
25
 
26
26
  // src/exception_handler.ts
@@ -35,6 +35,9 @@ export type RouteFn = (ctx: HttpContext) => any;
35
35
  * Route handler persisted with the route store
36
36
  */
37
37
  export type StoreRouteHandler = RouteFn | {
38
+ name?: string;
39
+ method: string;
40
+ importExpression: string | null;
38
41
  reference: string | [LazyImport<Constructor<any>> | Constructor<any>, any?];
39
42
  handle: (resolver: ContainerResolver<any>, ...args: [ctx: HttpContext, ...injections: any[]]) => any;
40
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adonisjs/http-server",
3
- "version": "8.0.0-next.2",
3
+ "version": "8.0.0-next.4",
4
4
  "description": "AdonisJS HTTP server with support packed with Routing and Cookies",
5
5
  "main": "build/index.js",
6
6
  "type": "module",