diesel-core 1.7.2 → 1.7.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.
Files changed (37) hide show
  1. package/dist/constant.js +1 -11
  2. package/dist/ctx.d.ts +7 -8
  3. package/dist/ctx.js +217 -323
  4. package/dist/handleRequest.js +218 -81
  5. package/dist/http-exception.js +1 -20
  6. package/dist/main.d.ts +4 -2
  7. package/dist/main.js +217 -616
  8. package/dist/router/find-my-way.js +102 -18
  9. package/dist/router/interface.d.ts +1 -1
  10. package/dist/router/interface.js +102 -22
  11. package/dist/router/trie.js +1 -148
  12. package/dist/router/trie2.d.ts +2 -2
  13. package/package.json +1 -1
  14. package/dist/http-exception.test.js +0 -50
  15. package/dist/middlewares/cors/index.test.js +0 -94
  16. package/dist/middlewares/file-route/index.js +0 -69
  17. package/dist/middlewares/filesave/index.test.js +0 -73
  18. package/dist/middlewares/jwt/index.test.js +0 -74
  19. package/dist/middlewares/powered-by/index.test.js +0 -46
  20. package/dist/middlewares/ratelimit/index.test.js +0 -104
  21. package/dist/middlewares/request-id/index.js +0 -50
  22. package/dist/middlewares/request-id/index.test.js +0 -1
  23. package/dist/middlewares/security/index.test.js +0 -50
  24. package/dist/request_pipeline.js +0 -331
  25. package/dist/router/regex.js +0 -3
  26. package/dist/router/trie2.js +0 -151
  27. package/dist/router/trie2.test.js +0 -162
  28. package/dist/src/constant.js +0 -1
  29. package/dist/src/ctx.js +0 -54
  30. package/dist/src/handleRequest.js +0 -54
  31. package/dist/src/http-exception.js +0 -1
  32. package/dist/src/main.js +0 -273
  33. package/dist/src/request_pipeline.js +0 -170
  34. package/dist/src/router/find-my-way.js +0 -102
  35. package/dist/src/router/interface.js +0 -102
  36. package/dist/src/router/trie.js +0 -1
  37. package/dist/types.js +0 -1
package/dist/constant.js CHANGED
@@ -1,11 +1 @@
1
- export const supportedMethods = [
2
- "GET",
3
- "POST",
4
- "PUT",
5
- "PATCH",
6
- "DELETE",
7
- "ANY",
8
- "HEAD",
9
- "OPTIONS",
10
- "PROPFIND",
11
- ];
1
+ var A=Object.create;var{getPrototypeOf:D,defineProperty:t,getOwnPropertyNames:p,getOwnPropertyDescriptor:N}=Object,s=Object.prototype.hasOwnProperty;var d=(P,T,E)=>{E=P!=null?A(D(P)):{};let o=T||!P||!P.__esModule?t(E,"default",{value:P,enumerable:!0}):E;for(let O of p(P))if(!s.call(o,O))t(o,O,{get:()=>P[O],enumerable:!0});return o},e=new WeakMap,r=(P)=>{var T=e.get(P),E;if(T)return T;if(T=t({},"__esModule",{value:!0}),P&&typeof P==="object"||typeof P==="function")p(P).map((o)=>!s.call(T,o)&&t(T,o,{get:()=>P[o],enumerable:!(E=N(P,o))||E.enumerable}));return e.set(P,T),T},H=(P,T)=>()=>(T||P((T={exports:{}}).exports,T),T.exports);var I=(P,T)=>{for(var E in T)t(P,E,{get:T[E],enumerable:!0,configurable:!0,set:(o)=>T[E]=()=>o})};var S=(P,T)=>()=>(P&&(T=P(P=0)),T);var h=["GET","POST","PUT","PATCH","DELETE","ANY","HEAD","OPTIONS","PROPFIND"];export{h as supportedMethods};
package/dist/ctx.d.ts CHANGED
@@ -2,12 +2,11 @@ import { Server } from "bun";
2
2
  import type { CookieOptions } from "./types";
3
3
  export declare class Context {
4
4
  req: Request;
5
- server?: Server | undefined;
6
- path?: string | undefined;
7
- routePattern?: string;
8
- paramNames?: string[] | Record<string, string>;
9
- env?: Record<string, any>;
10
- executionContext?: any | undefined;
5
+ server: Server | null;
6
+ path: string | null;
7
+ paramNames: string[] | Record<string, string>;
8
+ env: Record<string, any> | null;
9
+ executionContext: any | null;
11
10
  headers: Headers;
12
11
  private parsedQuery;
13
12
  private parsedParams;
@@ -15,7 +14,7 @@ export declare class Context {
15
14
  private parsedBody;
16
15
  private contextData;
17
16
  private urlObject;
18
- constructor(req: Request, server?: Server, path?: string, routePattern?: string, paramNames?: string[] | Record<string, string>, env?: Record<string, any>, executionContext?: any);
17
+ constructor(req: Request, server: Server | null, path: string | null, paramNames: string[] | Record<string, string>, env: Record<string, any> | null, executionContext: any | null);
19
18
  setHeader(key: string, value: string): this;
20
19
  removeHeader(key: string): this;
21
20
  set<T>(key: string, value: T): this;
@@ -29,7 +28,7 @@ export declare class Context {
29
28
  send<T>(data: T, status?: number, customHeaders?: HeadersInit): Response;
30
29
  json<T>(object: T, status?: number, customHeaders?: HeadersInit): Response;
31
30
  file(filePath: string, mimeType?: string, status?: number, customHeaders?: HeadersInit): Response;
32
- ejs(viewPath: string, data?: {}, status?: number): Promise<Response>;
31
+ ejs(viewPath: string, data?: {}, status?: number): Promise<void>;
33
32
  redirect(path: string, status?: number): Response;
34
33
  setCookie(name: string, value: string, options?: CookieOptions): this;
35
34
  get cookies(): Record<string, string>;