diesel-core 1.4.4 → 1.4.7

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/main.d.ts CHANGED
@@ -26,12 +26,14 @@ export default class Diesel {
26
26
  routeNotFoundFunc: (c: ContextType) => void | Promise<void> | Promise<Response> | Response;
27
27
  private prefixApiUrl;
28
28
  compileConfig: CompileConfig | null;
29
- constructor({ jwtSecret, baseApiUrl, enableFileRouting, idleTimeOut, prefixApiUrl, }?: {
29
+ constructor({ jwtSecret, baseApiUrl, enableFileRouting, idleTimeOut, prefixApiUrl, onError, logger, }?: {
30
30
  jwtSecret?: string;
31
31
  baseApiUrl?: string;
32
32
  enableFileRouting?: boolean;
33
33
  idleTimeOut?: number;
34
34
  prefixApiUrl?: string;
35
+ onError?: boolean;
36
+ logger?: boolean;
35
37
  });
36
38
  static router(prefix: string): Diesel;
37
39
  /**
@@ -84,7 +86,7 @@ export default class Diesel {
84
86
  * - app.use(["/home", "/user"], [h1, h2]) -> Adds `h1` and `h2` to `/home` and `/user`.
85
87
  * - app.use(h1, [h2, h1]) -> Runs `h1`, then `h2`, and `h1` again as specified.
86
88
  */
87
- use(pathORHandler?: string | string[] | middlewareFunc | middlewareFunc[], handlers?: middlewareFunc | middlewareFunc[]): this;
89
+ use(pathORHandler?: string | string[] | middlewareFunc | middlewareFunc[] | Function | Function[], handlers?: middlewareFunc | middlewareFunc[] | Function | Function[]): this;
88
90
  get(path: string, ...handlers: handlerFunction[]): this;
89
91
  post(path: string, ...handlers: handlerFunction[]): this;
90
92
  put(path: string, ...handlers: handlerFunction[]): this;
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { Server } from "bun";
1
+ import { BunRequest, Server } from "bun";
2
2
  export type listenCalllBackType = () => void;
3
3
  export type handlerFunction = (ctx: ContextType, server?: Server) => Response | Promise<Response>;
4
- export type middlewareFunc = (ctx: ContextType, server?: Server) => void | Response | Promise<void | Response>;
4
+ export type middlewareFunc = (ctx: ContextType | BunRequest, server?: Server) => void | Response | Promise<void | Response>;
5
5
  export type HookFunction = (ctx: ContextType, result?: Response | null, server?: Server) => void | null | Response | Promise<void | null | Response>;
6
6
  export type RouteNotFoundHandler = (ctx: ContextType) => Promise<Response>;
7
7
  export type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "OPTIONS" | "HEAD" | "ANY" | "PROPFIND";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diesel-core",
3
- "version": "1.4.4",
3
+ "version": "1.4.7",
4
4
  "description": "Web framework built on Web Standards",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",