@adonisjs/http-server 6.0.0-0 → 6.0.1-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/build/src/cookies/client.d.ts +1 -1
- package/build/src/cookies/drivers/encrypted.d.ts +1 -1
- package/build/src/cookies/drivers/signed.d.ts +1 -1
- package/build/src/cookies/parser.d.ts +1 -1
- package/build/src/cookies/serializer.d.ts +1 -1
- package/build/src/request.d.ts +1 -1
- package/build/src/response.d.ts +1 -1
- package/build/src/router/brisk.d.ts +1 -1
- package/build/src/router/executor.d.ts +1 -1
- package/build/src/router/lookup_store/main.d.ts +1 -1
- package/build/src/router/lookup_store/url_builder.d.ts +1 -1
- package/build/src/router/main.d.ts +2 -2
- package/build/src/router/resource.d.ts +1 -1
- package/build/src/router/route.d.ts +1 -1
- package/build/src/server/factories/final_handler.d.ts +1 -1
- package/build/src/server/factories/middleware_handler.d.ts +1 -1
- package/build/src/server/main.d.ts +2 -2
- package/build/src/types/main.d.ts +7 -0
- package/build/src/types/main.js +7 -0
- package/build/src/types/middleware.d.ts +1 -1
- package/build/src/types/route.d.ts +2 -2
- package/package.json +14 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type Encryption from '@adonisjs/encryption';
|
|
1
|
+
import type { Encryption } from '@adonisjs/encryption';
|
|
2
2
|
export declare function pack(key: string, value: any, encryption: Encryption): null | string;
|
|
3
3
|
export declare function canUnpack(encryptedValue: string): boolean;
|
|
4
4
|
export declare function unpack(key: string, encryptedValue: string, encryption: Encryption): null | any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type Encryption from '@adonisjs/encryption';
|
|
1
|
+
import type { Encryption } from '@adonisjs/encryption';
|
|
2
2
|
export declare function pack(key: string, value: any, encryption: Encryption): null | string;
|
|
3
3
|
export declare function canUnpack(signedValue: string): boolean;
|
|
4
4
|
export declare function unpack(key: string, signedValue: string, encryption: Encryption): null | any;
|
package/build/src/request.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
/// <reference types="node" resolution-mode="require"/>
|
|
3
3
|
import { Macroable } from '@poppinss/macroable';
|
|
4
|
-
import type Encryption from '@adonisjs/encryption';
|
|
4
|
+
import type { Encryption } from '@adonisjs/encryption';
|
|
5
5
|
import { UrlWithStringQuery } from 'node:url';
|
|
6
6
|
import { ServerResponse, IncomingMessage, IncomingHttpHeaders } from 'node:http';
|
|
7
7
|
import type { Qs } from './qs.js';
|
package/build/src/response.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
/// <reference types="node" resolution-mode="require"/>
|
|
3
3
|
import { Macroable } from '@poppinss/macroable';
|
|
4
|
-
import type Encryption from '@adonisjs/encryption';
|
|
4
|
+
import type { Encryption } from '@adonisjs/encryption';
|
|
5
5
|
import { ServerResponse, IncomingMessage } from 'node:http';
|
|
6
6
|
import type { Qs } from './qs.js';
|
|
7
7
|
import { Redirect } from './redirect.js';
|
|
@@ -8,7 +8,7 @@ import type { MakeUrlOptions, RouteFn, RouteMatchers } from '../types/route.js';
|
|
|
8
8
|
export declare class BriskRoute<NamedMiddleware extends Record<string, LazyImport<MiddlewareAsClass>> = any> extends Macroable {
|
|
9
9
|
#private;
|
|
10
10
|
route: null | Route<NamedMiddleware>;
|
|
11
|
-
constructor(app: Application, middlewareStore: MiddlewareStore<NamedMiddleware>, options: {
|
|
11
|
+
constructor(app: Application<any, any, any>, middlewareStore: MiddlewareStore<NamedMiddleware>, options: {
|
|
12
12
|
pattern: string;
|
|
13
13
|
globalMatchers: RouteMatchers;
|
|
14
14
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ContainerResolver } from '@adonisjs/fold';
|
|
2
2
|
import type { StoreRouteNode } from '../types/route.js';
|
|
3
3
|
import type { HttpContext } from '../http_context/main.js';
|
|
4
|
-
export declare function execute(route: StoreRouteNode, resolver: ContainerResolver
|
|
4
|
+
export declare function execute(route: StoreRouteNode, resolver: ContainerResolver<any>, ctx: HttpContext): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type Encryption from '@adonisjs/encryption';
|
|
1
|
+
import type { Encryption } from '@adonisjs/encryption';
|
|
2
2
|
import type { Application } from '@adonisjs/application';
|
|
3
3
|
import type { Qs } from '../qs.js';
|
|
4
4
|
import { Route } from './route.js';
|
|
@@ -16,7 +16,7 @@ export declare class Router<NamedMiddleware extends Record<string, LazyImport<Mi
|
|
|
16
16
|
routes: (Route<NamedMiddleware> | RouteResource<NamedMiddleware> | RouteGroup<NamedMiddleware> | BriskRoute<NamedMiddleware>)[];
|
|
17
17
|
usingDomains: boolean;
|
|
18
18
|
matchers: Matchers;
|
|
19
|
-
constructor(app: Application, encryption: Encryption, middlewareStore: MiddlewareStore<NamedMiddleware>, qsParser: Qs);
|
|
19
|
+
constructor(app: Application<any, any, any>, encryption: Encryption, middlewareStore: MiddlewareStore<NamedMiddleware>, qsParser: Qs);
|
|
20
20
|
route(pattern: string, methods: string[], handler: string | RouteFn): Route<NamedMiddleware>;
|
|
21
21
|
any(pattern: string, handler: string | RouteFn): Route<NamedMiddleware>;
|
|
22
22
|
get(pattern: string, handler: string | RouteFn): Route<NamedMiddleware>;
|
|
@@ -8,7 +8,7 @@ import type { ResourceActionNames, RouteMatcher, RouteMatchers } from '../types/
|
|
|
8
8
|
export declare class RouteResource<NamedMiddleware extends Record<string, LazyImport<MiddlewareAsClass>> = any> extends Macroable {
|
|
9
9
|
#private;
|
|
10
10
|
routes: Route[];
|
|
11
|
-
constructor(app: Application, middlewareStore: MiddlewareStore<NamedMiddleware>, options: {
|
|
11
|
+
constructor(app: Application<any, any, any>, middlewareStore: MiddlewareStore<NamedMiddleware>, options: {
|
|
12
12
|
resource: string;
|
|
13
13
|
controller: string;
|
|
14
14
|
globalMatchers: RouteMatchers;
|
|
@@ -6,7 +6,7 @@ import type { GetMiddlewareArgs, MiddlewareAsClass, MiddlewareFn } from '../type
|
|
|
6
6
|
import type { RouteFn, RouteJSON, RouteMatcher, RouteMatchers, StoreRouteMiddleware } from '../types/route.js';
|
|
7
7
|
export declare class Route<NamedMiddleware extends Record<string, LazyImport<MiddlewareAsClass>> = any> extends Macroable {
|
|
8
8
|
#private;
|
|
9
|
-
constructor(app: Application, middlewareStore: MiddlewareStore<NamedMiddleware>, options: {
|
|
9
|
+
constructor(app: Application<any, any, any>, middlewareStore: MiddlewareStore<NamedMiddleware>, options: {
|
|
10
10
|
pattern: string;
|
|
11
11
|
methods: string[];
|
|
12
12
|
handler: RouteFn | string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ContainerResolver } from '@adonisjs/fold';
|
|
2
2
|
import type { Router } from '../../router/main.js';
|
|
3
3
|
import type { HttpContext } from '../../http_context/main.js';
|
|
4
|
-
export declare function finalHandler(router: Router, resolver: ContainerResolver
|
|
4
|
+
export declare function finalHandler(router: Router, resolver: ContainerResolver<any>, ctx: HttpContext): () => any;
|
|
@@ -2,4 +2,4 @@ import type { NextFn } from '@poppinss/middleware/types';
|
|
|
2
2
|
import type { ContainerResolver } from '@adonisjs/fold';
|
|
3
3
|
import type { HttpContext } from '../../http_context/main.js';
|
|
4
4
|
import { ParsedGlobalMiddleware } from '../../types/middleware.js';
|
|
5
|
-
export declare function middlewareHandler(resolver: ContainerResolver
|
|
5
|
+
export declare function middlewareHandler(resolver: ContainerResolver<any>, ctx: HttpContext): (fn: ParsedGlobalMiddleware, next: NextFn) => any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import type Encryption from '@adonisjs/encryption';
|
|
3
|
+
import type { Encryption } from '@adonisjs/encryption';
|
|
4
4
|
import type { Application } from '@adonisjs/application';
|
|
5
5
|
import type { Server as HttpsServer } from 'node:https';
|
|
6
6
|
import type { ServerResponse, IncomingMessage, Server as HttpServer } from 'node:http';
|
|
@@ -11,7 +11,7 @@ import { Router } from '../router/main.js';
|
|
|
11
11
|
export declare class Server<NamedMiddleware extends Record<string, LazyImport<MiddlewareAsClass>> = any> {
|
|
12
12
|
#private;
|
|
13
13
|
get usingAsyncLocalStorage(): boolean;
|
|
14
|
-
constructor(app: Application, encryption: Encryption, config: ServerConfig);
|
|
14
|
+
constructor(app: Application<any, any, any>, encryption: Encryption, config: ServerConfig);
|
|
15
15
|
use(serverMiddleware: LazyImport<MiddlewareAsClass>[], routerMiddleware: LazyImport<MiddlewareAsClass>[], namedMiddleware: NamedMiddleware): this;
|
|
16
16
|
errorHandler(handler: LazyImport<ErrorHandlerAsAClass>): this;
|
|
17
17
|
boot(): Promise<void>;
|
|
@@ -9,6 +9,6 @@ type HasUndefined<T> = T extends NonNullable<T> ? true : false;
|
|
|
9
9
|
export type GetMiddlewareArgs<Middleware extends MiddlewareAsClass> = HasUndefined<Parameters<InstanceType<Middleware>['handle']>[2]> extends true ? [Parameters<InstanceType<Middleware>['handle']>[2]] : [Parameters<InstanceType<Middleware>['handle']>[2]?];
|
|
10
10
|
export type MiddlewareFn = (ctx: HttpContext, next: NextFn) => any;
|
|
11
11
|
export type ParsedGlobalMiddleware = {
|
|
12
|
-
handle: (resolver: ContainerResolver
|
|
12
|
+
handle: (resolver: ContainerResolver<any>, ...args: [ctx: HttpContext, next: NextFn, params?: any]) => any;
|
|
13
13
|
};
|
|
14
14
|
export {};
|
|
@@ -11,14 +11,14 @@ export type MatchItRouteToken = RouteMatcher & {
|
|
|
11
11
|
export type RouteFn = (ctx: HttpContext) => any;
|
|
12
12
|
export type StoreRouteHandler = RouteFn | {
|
|
13
13
|
name: string;
|
|
14
|
-
handle: (resolver: ContainerResolver
|
|
14
|
+
handle: (resolver: ContainerResolver<any>, ...args: [ctx: HttpContext, ...injections: any[]]) => any;
|
|
15
15
|
};
|
|
16
16
|
export type StoreRouteMiddleware = MiddlewareFn | ({
|
|
17
17
|
name?: string;
|
|
18
18
|
args?: any[];
|
|
19
19
|
} & ParsedGlobalMiddleware);
|
|
20
20
|
export type StoreRouteNode = {
|
|
21
|
-
execute: (route: StoreRouteNode, resolver: ContainerResolver
|
|
21
|
+
execute: (route: StoreRouteNode, resolver: ContainerResolver<any>, ctx: HttpContext) => any;
|
|
22
22
|
name?: string;
|
|
23
23
|
pattern: string;
|
|
24
24
|
handler: StoreRouteHandler;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/http-server",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.1-0",
|
|
4
4
|
"description": "AdonisJS HTTP server with support packed with Routing and Cookies",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
],
|
|
12
12
|
"exports": {
|
|
13
13
|
".": "./build/index.js",
|
|
14
|
-
"./types": "./build/src/types.js"
|
|
14
|
+
"./types": "./build/src/types/main.js"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"pretest": "npm run lint",
|
|
@@ -37,22 +37,22 @@
|
|
|
37
37
|
"author": "virk,adonisjs",
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@adonisjs/application": "^6.
|
|
40
|
+
"@adonisjs/application": "^6.2.0-0",
|
|
41
41
|
"@adonisjs/config": "^4.1.1-0",
|
|
42
|
-
"@adonisjs/encryption": "^5.0.
|
|
42
|
+
"@adonisjs/encryption": "^5.0.2-0",
|
|
43
43
|
"@adonisjs/env": "^4.0.3-0",
|
|
44
|
-
"@adonisjs/fold": "^9.
|
|
45
|
-
"@adonisjs/logger": "^5.0
|
|
44
|
+
"@adonisjs/fold": "^9.5.0-0",
|
|
45
|
+
"@adonisjs/logger": "^5.1.0-0",
|
|
46
46
|
"@commitlint/cli": "^17.3.0",
|
|
47
47
|
"@commitlint/config-conventional": "^17.3.0",
|
|
48
|
-
"@fastify/middie": "^8.
|
|
48
|
+
"@fastify/middie": "^8.1.0",
|
|
49
49
|
"@japa/api-client": "^1.4.2",
|
|
50
50
|
"@japa/assert": "^1.3.6",
|
|
51
51
|
"@japa/expect-type": "^1.0.2",
|
|
52
52
|
"@japa/run-failed-tests": "^1.1.0",
|
|
53
53
|
"@japa/runner": "^2.2.2",
|
|
54
54
|
"@japa/spec-reporter": "^1.3.2",
|
|
55
|
-
"@swc/core": "^1.3.
|
|
55
|
+
"@swc/core": "^1.3.22",
|
|
56
56
|
"@types/accepts": "^1.3.5",
|
|
57
57
|
"@types/content-disposition": "^0.5.5",
|
|
58
58
|
"@types/cookie": "^0.5.1",
|
|
@@ -85,11 +85,11 @@
|
|
|
85
85
|
"husky": "^8.0.2",
|
|
86
86
|
"np": "^7.6.2",
|
|
87
87
|
"pem": "^1.14.6",
|
|
88
|
-
"prettier": "^2.8.
|
|
88
|
+
"prettier": "^2.8.1",
|
|
89
89
|
"reflect-metadata": "^0.1.13",
|
|
90
|
-
"supertest": "^6.3.
|
|
90
|
+
"supertest": "^6.3.3",
|
|
91
91
|
"ts-node": "^10.9.1",
|
|
92
|
-
"typescript": "^4.9.
|
|
92
|
+
"typescript": "^4.9.4"
|
|
93
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
95
|
"@poppinss/macroable": "^1.0.0-0",
|
|
@@ -114,9 +114,9 @@
|
|
|
114
114
|
"vary": "^1.1.2"
|
|
115
115
|
},
|
|
116
116
|
"peerDependencies": {
|
|
117
|
-
"@adonisjs/application": "^6.
|
|
118
|
-
"@adonisjs/encryption": "^5.0.
|
|
119
|
-
"@adonisjs/fold": "^9.
|
|
117
|
+
"@adonisjs/application": "^6.2.0-0",
|
|
118
|
+
"@adonisjs/encryption": "^5.0.2-0",
|
|
119
|
+
"@adonisjs/fold": "^9.5.0-0"
|
|
120
120
|
},
|
|
121
121
|
"repository": {
|
|
122
122
|
"type": "git",
|