@kiyasov/platform-hono 1.5.6 → 1.5.8
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/.claude/settings.local.json +5 -2
- package/dist/cjs/src/adapters/hono-adapter.js +11 -11
- package/dist/cjs/src/adapters/hono-adapter.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/adapters/hono-adapter.js +11 -11
- package/dist/esm/src/adapters/hono-adapter.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +14 -13
- package/src/adapters/hono-adapter.ts +24 -29
- package/src/interfaces/nest-hono-application.interface.ts +3 -2
- package/dist/build.d.ts +0 -1
- package/dist/build.js +0 -28
- package/dist/build.js.map +0 -1
- package/dist/cjs/src/multer/crypto/index.d.ts +0 -1
- package/dist/cjs/src/multer/crypto/index.js +0 -7
- package/dist/cjs/src/multer/crypto/index.js.map +0 -1
- package/dist/cjs/src/multer/stream/index.d.ts +0 -2
- package/dist/cjs/src/multer/stream/index.js +0 -7
- package/dist/cjs/src/multer/stream/index.js.map +0 -1
- package/dist/esm/build.d.ts +0 -1
- package/dist/esm/build.js +0 -28
- package/dist/esm/build.js.map +0 -1
- package/dist/esm/src/multer/crypto/index.d.ts +0 -1
- package/dist/esm/src/multer/crypto/index.js +0 -4
- package/dist/esm/src/multer/crypto/index.js.map +0 -1
- package/dist/esm/src/multer/stream/index.d.ts +0 -2
- package/dist/esm/src/multer/stream/index.js +0 -4
- package/dist/esm/src/multer/stream/index.js.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -5
- package/dist/index.js.map +0 -1
- package/dist/src/adapters/hono-adapter.d.ts +0 -66
- package/dist/src/adapters/hono-adapter.js +0 -270
- package/dist/src/adapters/hono-adapter.js.map +0 -1
- package/dist/src/adapters/index.d.ts +0 -1
- package/dist/src/adapters/index.js +0 -2
- package/dist/src/adapters/index.js.map +0 -1
- package/dist/src/drivers/constants/apollo.constants.d.ts +0 -1
- package/dist/src/drivers/constants/apollo.constants.js +0 -2
- package/dist/src/drivers/constants/apollo.constants.js.map +0 -1
- package/dist/src/drivers/constants/index.d.ts +0 -1
- package/dist/src/drivers/constants/index.js +0 -2
- package/dist/src/drivers/constants/index.js.map +0 -1
- package/dist/src/drivers/graphQLUpload/GraphQLUpload.d.ts +0 -3
- package/dist/src/drivers/graphQLUpload/GraphQLUpload.js +0 -18
- package/dist/src/drivers/graphQLUpload/GraphQLUpload.js.map +0 -1
- package/dist/src/drivers/graphQLUpload/Upload.d.ts +0 -16
- package/dist/src/drivers/graphQLUpload/Upload.js +0 -17
- package/dist/src/drivers/graphQLUpload/Upload.js.map +0 -1
- package/dist/src/drivers/graphQLUpload/fs-capacitor.d.ts +0 -42
- package/dist/src/drivers/graphQLUpload/fs-capacitor.js +0 -185
- package/dist/src/drivers/graphQLUpload/fs-capacitor.js.map +0 -1
- package/dist/src/drivers/graphQLUpload/index.d.ts +0 -4
- package/dist/src/drivers/graphQLUpload/index.js +0 -5
- package/dist/src/drivers/graphQLUpload/index.js.map +0 -1
- package/dist/src/drivers/graphQLUpload/processRequest.d.ts +0 -2
- package/dist/src/drivers/graphQLUpload/processRequest.js +0 -47
- package/dist/src/drivers/graphQLUpload/processRequest.js.map +0 -1
- package/dist/src/drivers/graphql.driver.d.ts +0 -20
- package/dist/src/drivers/graphql.driver.js +0 -125
- package/dist/src/drivers/graphql.driver.js.map +0 -1
- package/dist/src/drivers/index.d.ts +0 -2
- package/dist/src/drivers/index.js +0 -3
- package/dist/src/drivers/index.js.map +0 -1
- package/dist/src/drivers/services/plugins-explorer.service.d.ts +0 -9
- package/dist/src/drivers/services/plugins-explorer.service.js +0 -22
- package/dist/src/drivers/services/plugins-explorer.service.js.map +0 -1
- package/dist/src/interfaces/hono.interface.d.ts +0 -4
- package/dist/src/interfaces/hono.interface.js +0 -2
- package/dist/src/interfaces/hono.interface.js.map +0 -1
- package/dist/src/interfaces/index.d.ts +0 -2
- package/dist/src/interfaces/index.js +0 -3
- package/dist/src/interfaces/index.js.map +0 -1
- package/dist/src/interfaces/nest-hono-application.interface.d.ts +0 -18
- package/dist/src/interfaces/nest-hono-application.interface.js +0 -2
- package/dist/src/interfaces/nest-hono-application.interface.js.map +0 -1
- package/dist/src/multer/decorators/index.d.ts +0 -2
- package/dist/src/multer/decorators/index.js +0 -3
- package/dist/src/multer/decorators/index.js.map +0 -1
- package/dist/src/multer/decorators/uploaded-file-decorator.d.ts +0 -1
- package/dist/src/multer/decorators/uploaded-file-decorator.js +0 -7
- package/dist/src/multer/decorators/uploaded-file-decorator.js.map +0 -1
- package/dist/src/multer/decorators/uploaded-files-decorator.d.ts +0 -1
- package/dist/src/multer/decorators/uploaded-files-decorator.js +0 -7
- package/dist/src/multer/decorators/uploaded-files-decorator.js.map +0 -1
- package/dist/src/multer/fs/index.d.ts +0 -2
- package/dist/src/multer/fs/index.js +0 -18
- package/dist/src/multer/fs/index.js.map +0 -1
- package/dist/src/multer/index.d.ts +0 -4
- package/dist/src/multer/index.js +0 -5
- package/dist/src/multer/index.js.map +0 -1
- package/dist/src/multer/interceptors/any-files-interceptor.d.ts +0 -3
- package/dist/src/multer/interceptors/any-files-interceptor.js +0 -27
- package/dist/src/multer/interceptors/any-files-interceptor.js.map +0 -1
- package/dist/src/multer/interceptors/file-fields-interceptor.d.ts +0 -4
- package/dist/src/multer/interceptors/file-fields-interceptor.js +0 -29
- package/dist/src/multer/interceptors/file-fields-interceptor.js.map +0 -1
- package/dist/src/multer/interceptors/file-interceptor.d.ts +0 -3
- package/dist/src/multer/interceptors/file-interceptor.js +0 -27
- package/dist/src/multer/interceptors/file-interceptor.js.map +0 -1
- package/dist/src/multer/interceptors/files-interceptor.d.ts +0 -3
- package/dist/src/multer/interceptors/files-interceptor.js +0 -27
- package/dist/src/multer/interceptors/files-interceptor.js.map +0 -1
- package/dist/src/multer/interceptors/index.d.ts +0 -4
- package/dist/src/multer/interceptors/index.js +0 -5
- package/dist/src/multer/interceptors/index.js.map +0 -1
- package/dist/src/multer/multipart/exceptions.d.ts +0 -1
- package/dist/src/multer/multipart/exceptions.js +0 -18
- package/dist/src/multer/multipart/exceptions.js.map +0 -1
- package/dist/src/multer/multipart/file.d.ts +0 -9
- package/dist/src/multer/multipart/file.js +0 -6
- package/dist/src/multer/multipart/file.js.map +0 -1
- package/dist/src/multer/multipart/filter.d.ts +0 -6
- package/dist/src/multer/multipart/filter.js +0 -18
- package/dist/src/multer/multipart/filter.js.map +0 -1
- package/dist/src/multer/multipart/handlers/any-files.d.ts +0 -10
- package/dist/src/multer/multipart/handlers/any-files.js +0 -29
- package/dist/src/multer/multipart/handlers/any-files.js.map +0 -1
- package/dist/src/multer/multipart/handlers/file-fields.d.ts +0 -17
- package/dist/src/multer/multipart/handlers/file-fields.js +0 -40
- package/dist/src/multer/multipart/handlers/file-fields.js.map +0 -1
- package/dist/src/multer/multipart/handlers/index.d.ts +0 -1
- package/dist/src/multer/multipart/handlers/index.js +0 -2
- package/dist/src/multer/multipart/handlers/index.js.map +0 -1
- package/dist/src/multer/multipart/handlers/multiple-files.d.ts +0 -10
- package/dist/src/multer/multipart/handlers/multiple-files.js +0 -36
- package/dist/src/multer/multipart/handlers/multiple-files.js.map +0 -1
- package/dist/src/multer/multipart/handlers/single-file.d.ts +0 -10
- package/dist/src/multer/multipart/handlers/single-file.js +0 -41
- package/dist/src/multer/multipart/handlers/single-file.js.map +0 -1
- package/dist/src/multer/multipart/index.d.ts +0 -3
- package/dist/src/multer/multipart/index.js +0 -3
- package/dist/src/multer/multipart/index.js.map +0 -1
- package/dist/src/multer/multipart/options.d.ts +0 -21
- package/dist/src/multer/multipart/options.js +0 -19
- package/dist/src/multer/multipart/options.js.map +0 -1
- package/dist/src/multer/multipart/request.d.ts +0 -15
- package/dist/src/multer/multipart/request.js +0 -17
- package/dist/src/multer/multipart/request.js.map +0 -1
- package/dist/src/multer/storage/disk-storage.d.ts +0 -31
- package/dist/src/multer/storage/disk-storage.js +0 -59
- package/dist/src/multer/storage/disk-storage.js.map +0 -1
- package/dist/src/multer/storage/index.d.ts +0 -3
- package/dist/src/multer/storage/index.js +0 -4
- package/dist/src/multer/storage/index.js.map +0 -1
- package/dist/src/multer/storage/memory-storage.d.ts +0 -19
- package/dist/src/multer/storage/memory-storage.js +0 -23
- package/dist/src/multer/storage/memory-storage.js.map +0 -1
- package/dist/src/multer/storage/storage.d.ts +0 -13
- package/dist/src/multer/storage/storage.js +0 -2
- package/dist/src/multer/storage/storage.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiyasov/platform-hono",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.8",
|
|
4
4
|
"description": "Nest adapter for Hono",
|
|
5
5
|
"author": "Islam Kiiasov",
|
|
6
6
|
"repository": {
|
|
@@ -43,41 +43,41 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@apollo/server": "^5.2.0",
|
|
46
|
-
"@hono/node-server": "^1.19.
|
|
47
|
-
"@nestjs/apollo": "^13.2.
|
|
48
|
-
"@nestjs/graphql": "^13.2.
|
|
49
|
-
"hono": "^4.
|
|
46
|
+
"@hono/node-server": "^1.19.7",
|
|
47
|
+
"@nestjs/apollo": "^13.2.3",
|
|
48
|
+
"@nestjs/graphql": "^13.2.3",
|
|
49
|
+
"hono": "^4.11.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@eslint/js": "^9.39.
|
|
52
|
+
"@eslint/js": "^9.39.2",
|
|
53
53
|
"@nestjs/cli": "^11.0.14",
|
|
54
54
|
"@nestjs/common": "^11.1.9",
|
|
55
55
|
"@nestjs/core": "^11.1.9",
|
|
56
56
|
"@nestjs/swagger": "^11.2.3",
|
|
57
57
|
"@swc/cli": "^0.7.9",
|
|
58
|
-
"@swc/core": "^1.15.
|
|
58
|
+
"@swc/core": "^1.15.4",
|
|
59
59
|
"@types/autocannon": "^7.12.7",
|
|
60
|
-
"@types/bun": "^1.3.
|
|
60
|
+
"@types/bun": "^1.3.4",
|
|
61
61
|
"@types/busboy": "^1.5.4",
|
|
62
62
|
"autocannon": "^8.0.0",
|
|
63
|
-
"bun": "^1.3.
|
|
63
|
+
"bun": "^1.3.4",
|
|
64
64
|
"class-transformer": "^0.5.1",
|
|
65
65
|
"class-validator": "^0.14.3",
|
|
66
|
-
"eslint": "^9.39.
|
|
66
|
+
"eslint": "^9.39.2",
|
|
67
67
|
"eslint-config-prettier": "^10.1.8",
|
|
68
68
|
"eslint-plugin-perfectionist": "^4.15.1",
|
|
69
69
|
"eslint-plugin-prettier": "^5.5.4",
|
|
70
70
|
"globals": "^16.5.0",
|
|
71
71
|
"graphql": "^16.12.0",
|
|
72
72
|
"graphql-subscriptions": "^3.0.0",
|
|
73
|
-
"prettier": "^3.7.
|
|
73
|
+
"prettier": "^3.7.4",
|
|
74
74
|
"reflect-metadata": "^0.2.2",
|
|
75
75
|
"rimraf": "^6.1.2",
|
|
76
76
|
"rxjs": "^7.8.2",
|
|
77
77
|
"sharp": "^0.34.5",
|
|
78
78
|
"tsc": "^2.0.4",
|
|
79
79
|
"typescript": "^5.9.3",
|
|
80
|
-
"typescript-eslint": "^8.
|
|
80
|
+
"typescript-eslint": "^8.49.0",
|
|
81
81
|
"undici": "^7.16.0"
|
|
82
82
|
},
|
|
83
83
|
"scripts": {
|
|
@@ -93,5 +93,6 @@
|
|
|
93
93
|
"@nestjs/core",
|
|
94
94
|
"@swc/core",
|
|
95
95
|
"bun"
|
|
96
|
-
]
|
|
96
|
+
],
|
|
97
|
+
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
|
|
97
98
|
}
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
NestApplicationOptions,
|
|
12
12
|
RequestHandler,
|
|
13
13
|
} from '@nestjs/common/interfaces';
|
|
14
|
+
import { isObject } from '@nestjs/common/utils/shared.utils';
|
|
14
15
|
import { AbstractHttpAdapter } from '@nestjs/core/adapters/http-adapter';
|
|
15
16
|
import { Context, Next, Hono } from 'hono';
|
|
16
17
|
import { bodyLimit } from 'hono/body-limit';
|
|
@@ -24,9 +25,17 @@ import * as https from 'https';
|
|
|
24
25
|
import { HonoRequest, TypeBodyParser } from '../interfaces';
|
|
25
26
|
|
|
26
27
|
type HonoHandler = RequestHandler<HonoRequest, Context>;
|
|
27
|
-
|
|
28
28
|
type ServerType = http.Server | http2.Http2Server | http2.Http2SecureServer;
|
|
29
29
|
type Ctx = Context | (() => Promise<Context>);
|
|
30
|
+
type Method =
|
|
31
|
+
| 'all'
|
|
32
|
+
| 'get'
|
|
33
|
+
| 'post'
|
|
34
|
+
| 'put'
|
|
35
|
+
| 'delete'
|
|
36
|
+
| 'use'
|
|
37
|
+
| 'patch'
|
|
38
|
+
| 'options';
|
|
30
39
|
|
|
31
40
|
/**
|
|
32
41
|
* Adapter for using Hono with NestJS.
|
|
@@ -80,22 +89,28 @@ export class HonoAdapter extends AbstractHttpAdapter<
|
|
|
80
89
|
private async getBody(ctx: Ctx, body?: Data) {
|
|
81
90
|
ctx = await this.normalizeContext(ctx);
|
|
82
91
|
|
|
92
|
+
if (body === undefined && ctx.res && ctx.res.body !== null) {
|
|
93
|
+
return ctx.res;
|
|
94
|
+
}
|
|
95
|
+
|
|
83
96
|
let responseContentType = await this.getHeader(ctx, 'Content-Type');
|
|
84
97
|
|
|
85
98
|
if (!responseContentType || responseContentType.startsWith('text/plain')) {
|
|
86
|
-
if (
|
|
99
|
+
if (
|
|
100
|
+
body instanceof Buffer ||
|
|
101
|
+
body instanceof Uint8Array ||
|
|
102
|
+
body instanceof ArrayBuffer ||
|
|
103
|
+
body instanceof ReadableStream
|
|
104
|
+
) {
|
|
87
105
|
responseContentType = 'application/octet-stream';
|
|
88
|
-
} else if (
|
|
106
|
+
} else if (isObject(body)) {
|
|
89
107
|
responseContentType = 'application/json';
|
|
90
108
|
}
|
|
91
109
|
|
|
92
|
-
this.setHeader(ctx, 'Content-Type', responseContentType);
|
|
110
|
+
await this.setHeader(ctx, 'Content-Type', responseContentType);
|
|
93
111
|
}
|
|
94
112
|
|
|
95
|
-
if (
|
|
96
|
-
responseContentType === 'application/json' &&
|
|
97
|
-
typeof body === 'object'
|
|
98
|
-
) {
|
|
113
|
+
if (responseContentType === 'application/json' && isObject(body)) {
|
|
99
114
|
return ctx.json(body);
|
|
100
115
|
} else if (body === undefined) {
|
|
101
116
|
return ctx.newResponse(null);
|
|
@@ -105,15 +120,7 @@ export class HonoAdapter extends AbstractHttpAdapter<
|
|
|
105
120
|
}
|
|
106
121
|
|
|
107
122
|
private registerRoute(
|
|
108
|
-
method:
|
|
109
|
-
| 'all'
|
|
110
|
-
| 'get'
|
|
111
|
-
| 'post'
|
|
112
|
-
| 'put'
|
|
113
|
-
| 'delete'
|
|
114
|
-
| 'use'
|
|
115
|
-
| 'patch'
|
|
116
|
-
| 'options',
|
|
123
|
+
method: Method,
|
|
117
124
|
pathOrHandler: string | HonoHandler,
|
|
118
125
|
handler?: HonoHandler,
|
|
119
126
|
) {
|
|
@@ -191,18 +198,6 @@ export class HonoAdapter extends AbstractHttpAdapter<
|
|
|
191
198
|
ctx.status(statusCode);
|
|
192
199
|
}
|
|
193
200
|
|
|
194
|
-
const responseContentType = await this.getHeader(ctx, 'Content-Type');
|
|
195
|
-
|
|
196
|
-
if (
|
|
197
|
-
!responseContentType?.startsWith('application/json') &&
|
|
198
|
-
body?.statusCode >= HttpStatus.BAD_REQUEST
|
|
199
|
-
) {
|
|
200
|
-
Logger.warn(
|
|
201
|
-
"Content-Type doesn't match Reply body, you might need a custom ExceptionFilter for non-JSON responses",
|
|
202
|
-
);
|
|
203
|
-
this.setHeader(ctx, 'Content-Type', 'application/json');
|
|
204
|
-
}
|
|
205
|
-
|
|
206
201
|
ctx.res = await this.getBody(ctx, body);
|
|
207
202
|
}
|
|
208
203
|
|
|
@@ -15,8 +15,9 @@ interface HonoViewOptions {
|
|
|
15
15
|
/**
|
|
16
16
|
* @publicApi
|
|
17
17
|
*/
|
|
18
|
-
export interface NestHonoApplication<
|
|
19
|
-
extends
|
|
18
|
+
export interface NestHonoApplication<
|
|
19
|
+
TServer extends Hono = Hono,
|
|
20
|
+
> extends INestApplication<TServer> {
|
|
20
21
|
/**
|
|
21
22
|
* Returns the underlying HTTP adapter bounded to a Hono app.
|
|
22
23
|
*
|
package/dist/build.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/build.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import BunTypeDeclarations from 'bun-plugin-type-declarations';
|
|
2
|
-
await Bun.build({
|
|
3
|
-
entrypoints: [
|
|
4
|
-
'./index.ts',
|
|
5
|
-
'./src/adapters/index.ts',
|
|
6
|
-
'./src/drivers/index.ts',
|
|
7
|
-
'./src/multer/index.ts',
|
|
8
|
-
],
|
|
9
|
-
target: 'node',
|
|
10
|
-
sourcemap: 'external',
|
|
11
|
-
outdir: '.build',
|
|
12
|
-
format: 'cjs',
|
|
13
|
-
splitting: true,
|
|
14
|
-
root: '.',
|
|
15
|
-
plugins: [BunTypeDeclarations('tsconfig.json')],
|
|
16
|
-
packages: 'external',
|
|
17
|
-
external: [
|
|
18
|
-
'class-validator',
|
|
19
|
-
'class-transformer',
|
|
20
|
-
'class-transformer/storage',
|
|
21
|
-
'@nestjs/platform-express',
|
|
22
|
-
'@nestjs/microservices',
|
|
23
|
-
'@apollo/subgraph',
|
|
24
|
-
'@nestjs/websockets/socket-module',
|
|
25
|
-
'ts-morph',
|
|
26
|
-
],
|
|
27
|
-
});
|
|
28
|
-
//# sourceMappingURL=build.js.map
|
package/dist/build.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../build.ts"],"names":[],"mappings":"AACA,OAAO,mBAAmB,MAAM,8BAA8B,CAAC;AAE/D,MAAM,GAAG,CAAC,KAAK,CAAC;IACd,WAAW,EAAE;QACX,YAAY;QACZ,yBAAyB;QACzB,wBAAwB;QACxB,uBAAuB;KACxB;IACD,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,UAAU;IACrB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,IAAI;IACf,IAAI,EAAE,GAAG;IACT,OAAO,EAAE,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAC/C,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE;QACR,iBAAiB;QACjB,mBAAmB;QACnB,2BAA2B;QAC3B,0BAA0B;QAC1B,uBAAuB;QACvB,kBAAkB;QAClB,kCAAkC;QAClC,UAAU;KACX;CACF,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const randomBytes: (arg1: number) => Promise<Buffer>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.randomBytes = void 0;
|
|
4
|
-
const node_util_1 = require("node:util");
|
|
5
|
-
const node_crypto_1 = require("node:crypto");
|
|
6
|
-
exports.randomBytes = (0, node_util_1.promisify)(node_crypto_1.randomBytes);
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/multer/crypto/index.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AACtC,6CAA+D;AAElD,QAAA,WAAW,GAAG,IAAA,qBAAS,EAAC,yBAAiB,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pump = void 0;
|
|
4
|
-
const node_util_1 = require("node:util");
|
|
5
|
-
const node_stream_1 = require("node:stream");
|
|
6
|
-
exports.pump = (0, node_util_1.promisify)(node_stream_1.pipeline);
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/multer/stream/index.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AACtC,6CAAuC;AAE1B,QAAA,IAAI,GAAG,IAAA,qBAAS,EAAC,sBAAQ,CAAC,CAAC"}
|
package/dist/esm/build.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/esm/build.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import BunTypeDeclarations from 'bun-plugin-type-declarations';
|
|
2
|
-
await Bun.build({
|
|
3
|
-
entrypoints: [
|
|
4
|
-
'./index.ts',
|
|
5
|
-
'./src/adapters/index.ts',
|
|
6
|
-
'./src/drivers/index.ts',
|
|
7
|
-
'./src/multer/index.ts',
|
|
8
|
-
],
|
|
9
|
-
target: 'node',
|
|
10
|
-
sourcemap: 'external',
|
|
11
|
-
outdir: '.build',
|
|
12
|
-
format: 'cjs',
|
|
13
|
-
splitting: true,
|
|
14
|
-
root: '.',
|
|
15
|
-
plugins: [BunTypeDeclarations('tsconfig.json')],
|
|
16
|
-
packages: 'external',
|
|
17
|
-
external: [
|
|
18
|
-
'class-validator',
|
|
19
|
-
'class-transformer',
|
|
20
|
-
'class-transformer/storage',
|
|
21
|
-
'@nestjs/platform-express',
|
|
22
|
-
'@nestjs/microservices',
|
|
23
|
-
'@apollo/subgraph',
|
|
24
|
-
'@nestjs/websockets/socket-module',
|
|
25
|
-
'ts-morph',
|
|
26
|
-
],
|
|
27
|
-
});
|
|
28
|
-
//# sourceMappingURL=build.js.map
|
package/dist/esm/build.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../build.ts"],"names":[],"mappings":"AACA,OAAO,mBAAmB,MAAM,8BAA8B,CAAC;AAE/D,MAAM,GAAG,CAAC,KAAK,CAAC;IACd,WAAW,EAAE;QACX,YAAY;QACZ,yBAAyB;QACzB,wBAAwB;QACxB,uBAAuB;KACxB;IACD,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,UAAU;IACrB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,IAAI;IACf,IAAI,EAAE,GAAG;IACT,OAAO,EAAE,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAC/C,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE;QACR,iBAAiB;QACjB,mBAAmB;QACnB,2BAA2B;QAC3B,0BAA0B;QAC1B,uBAAuB;QACvB,kBAAkB;QAClB,kCAAkC;QAClC,UAAU;KACX;CACF,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const randomBytes: (arg1: number) => Promise<Buffer>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/multer/crypto/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE/D,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/multer/stream/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,CAAC,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC"}
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { HttpBindings } from '@hono/node-server';
|
|
2
|
-
import { ServeStaticOptions } from '@hono/node-server/serve-static';
|
|
3
|
-
import { RequestMethod } from '@nestjs/common';
|
|
4
|
-
import { ErrorHandler, NestApplicationOptions, RequestHandler } from '@nestjs/common/interfaces';
|
|
5
|
-
import { AbstractHttpAdapter } from '@nestjs/core/adapters/http-adapter';
|
|
6
|
-
import { Context, Hono } from 'hono';
|
|
7
|
-
import { RedirectStatusCode, StatusCode } from 'hono/utils/http-status';
|
|
8
|
-
import { Http2SecureServer, Http2Server } from 'http2';
|
|
9
|
-
import { Server } from 'node:net';
|
|
10
|
-
import { HonoRequest, TypeBodyParser } from '../interfaces';
|
|
11
|
-
type HonoHandler = RequestHandler<HonoRequest, Context>;
|
|
12
|
-
type ServerType = Server | Http2Server | Http2SecureServer;
|
|
13
|
-
type Ctx = Context | (() => Promise<Context>);
|
|
14
|
-
export declare class HonoAdapter extends AbstractHttpAdapter<ServerType, HonoRequest, Context> {
|
|
15
|
-
protected readonly instance: Hono<{
|
|
16
|
-
Bindings: HttpBindings;
|
|
17
|
-
}>;
|
|
18
|
-
private _isParserRegistered;
|
|
19
|
-
constructor();
|
|
20
|
-
get isParserRegistered(): boolean;
|
|
21
|
-
private getRouteAndHandler;
|
|
22
|
-
private createRouteHandler;
|
|
23
|
-
private send;
|
|
24
|
-
all(pathOrHandler: string | HonoHandler, handler?: HonoHandler): void;
|
|
25
|
-
get(pathOrHandler: string | HonoHandler, handler?: HonoHandler): void;
|
|
26
|
-
post(pathOrHandler: string | HonoHandler, handler?: HonoHandler): void;
|
|
27
|
-
put(pathOrHandler: string | HonoHandler, handler?: HonoHandler): void;
|
|
28
|
-
delete(pathOrHandler: string | HonoHandler, handler?: HonoHandler): void;
|
|
29
|
-
use(pathOrHandler: string | HonoHandler, handler?: HonoHandler): void;
|
|
30
|
-
patch(pathOrHandler: string | HonoHandler, handler?: HonoHandler): void;
|
|
31
|
-
options(pathOrHandler: string | HonoHandler, handler?: HonoHandler): void;
|
|
32
|
-
reply(ctx: Ctx, body: any, statusCode?: StatusCode): Promise<void>;
|
|
33
|
-
status(ctx: Ctx, statusCode: StatusCode): Promise<void>;
|
|
34
|
-
end(): Promise<Response>;
|
|
35
|
-
render(): void;
|
|
36
|
-
redirect(ctx: Ctx, statusCode: RedirectStatusCode, url: string): Promise<void>;
|
|
37
|
-
setErrorHandler(handler: ErrorHandler): void;
|
|
38
|
-
setNotFoundHandler(handler: RequestHandler): void;
|
|
39
|
-
useStaticAssets(path: string, options: ServeStaticOptions): void;
|
|
40
|
-
setViewEngine(): void;
|
|
41
|
-
isHeadersSent(ctx: Ctx): Promise<boolean>;
|
|
42
|
-
getHeader?(ctx: Ctx, name: string): Promise<string>;
|
|
43
|
-
setHeader(ctx: Ctx, name: string, value: string): Promise<void>;
|
|
44
|
-
appendHeader?(ctx: Ctx, name: string, value: string): Promise<void>;
|
|
45
|
-
getRequestHostname(ctx: Ctx): Promise<string>;
|
|
46
|
-
getRequestMethod(request: HonoRequest): string;
|
|
47
|
-
getRequestUrl(request: HonoRequest): string;
|
|
48
|
-
enableCors(options: {
|
|
49
|
-
origin: string | string[] | ((origin: string, c: Context) => string | undefined | null);
|
|
50
|
-
allowMethods?: string[];
|
|
51
|
-
allowHeaders?: string[];
|
|
52
|
-
maxAge?: number;
|
|
53
|
-
credentials?: boolean;
|
|
54
|
-
exposeHeaders?: string[];
|
|
55
|
-
}): void;
|
|
56
|
-
useBodyParser(type: TypeBodyParser, rawBody?: boolean, bodyLimit?: number): void;
|
|
57
|
-
close(): Promise<void>;
|
|
58
|
-
initHttpServer(options: NestApplicationOptions): void;
|
|
59
|
-
getType(): string;
|
|
60
|
-
registerParserMiddleware(_prefix?: string, rawBody?: boolean): void;
|
|
61
|
-
createMiddlewareFactory(requestMethod: RequestMethod): Promise<(path: string, callback: Function) => void>;
|
|
62
|
-
applyVersionFilter(): () => () => unknown;
|
|
63
|
-
listen(port: string | number, ...args: any[]): ServerType;
|
|
64
|
-
bodyLimit(maxSize: number): import("hono").MiddlewareHandler;
|
|
65
|
-
}
|
|
66
|
-
export {};
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import { createAdaptorServer } from '@hono/node-server';
|
|
2
|
-
import { serveStatic, } from '@hono/node-server/serve-static';
|
|
3
|
-
import { RESPONSE_ALREADY_SENT } from '@hono/node-server/utils/response';
|
|
4
|
-
import { RequestMethod } from '@nestjs/common';
|
|
5
|
-
import { HttpStatus, Logger } from '@nestjs/common';
|
|
6
|
-
import { AbstractHttpAdapter } from '@nestjs/core/adapters/http-adapter';
|
|
7
|
-
import { Hono } from 'hono';
|
|
8
|
-
import { bodyLimit } from 'hono/body-limit';
|
|
9
|
-
import { cors } from 'hono/cors';
|
|
10
|
-
import * as http from 'http';
|
|
11
|
-
import * as https from 'https';
|
|
12
|
-
export class HonoAdapter extends AbstractHttpAdapter {
|
|
13
|
-
instance;
|
|
14
|
-
_isParserRegistered;
|
|
15
|
-
constructor() {
|
|
16
|
-
super(new Hono());
|
|
17
|
-
}
|
|
18
|
-
get isParserRegistered() {
|
|
19
|
-
return !!this._isParserRegistered;
|
|
20
|
-
}
|
|
21
|
-
getRouteAndHandler(pathOrHandler, handler) {
|
|
22
|
-
const path = typeof pathOrHandler === 'function' ? '' : pathOrHandler;
|
|
23
|
-
handler = typeof pathOrHandler === 'function' ? pathOrHandler : handler;
|
|
24
|
-
return [path, handler];
|
|
25
|
-
}
|
|
26
|
-
createRouteHandler(routeHandler) {
|
|
27
|
-
return async (ctx, next) => {
|
|
28
|
-
ctx.req['params'] = ctx.req.param();
|
|
29
|
-
await routeHandler(ctx.req, ctx, next);
|
|
30
|
-
return this.send(ctx);
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
async send(ctx) {
|
|
34
|
-
if (typeof ctx === 'function') {
|
|
35
|
-
ctx = await ctx();
|
|
36
|
-
}
|
|
37
|
-
const body = ctx.get('body');
|
|
38
|
-
let responseContentType = await this.getHeader(ctx, 'Content-Type');
|
|
39
|
-
if (!responseContentType || responseContentType.startsWith('text/plain')) {
|
|
40
|
-
if (body instanceof Buffer) {
|
|
41
|
-
responseContentType = 'application/octet-stream';
|
|
42
|
-
}
|
|
43
|
-
else if (typeof body === 'object') {
|
|
44
|
-
responseContentType = 'application/json';
|
|
45
|
-
}
|
|
46
|
-
this.setHeader(ctx, 'Content-Type', responseContentType);
|
|
47
|
-
}
|
|
48
|
-
if (responseContentType === 'application/json' &&
|
|
49
|
-
typeof body === 'object') {
|
|
50
|
-
return ctx.json(body);
|
|
51
|
-
}
|
|
52
|
-
return ctx.body(body);
|
|
53
|
-
}
|
|
54
|
-
all(pathOrHandler, handler) {
|
|
55
|
-
const [routePath, routeHandler] = this.getRouteAndHandler(pathOrHandler, handler);
|
|
56
|
-
this.instance.all(routePath, this.createRouteHandler(routeHandler));
|
|
57
|
-
}
|
|
58
|
-
get(pathOrHandler, handler) {
|
|
59
|
-
const [routePath, routeHandler] = this.getRouteAndHandler(pathOrHandler, handler);
|
|
60
|
-
this.instance.get(routePath, this.createRouteHandler(routeHandler));
|
|
61
|
-
}
|
|
62
|
-
post(pathOrHandler, handler) {
|
|
63
|
-
const [routePath, routeHandler] = this.getRouteAndHandler(pathOrHandler, handler);
|
|
64
|
-
this.instance.post(routePath, this.createRouteHandler(routeHandler));
|
|
65
|
-
}
|
|
66
|
-
put(pathOrHandler, handler) {
|
|
67
|
-
const [routePath, routeHandler] = this.getRouteAndHandler(pathOrHandler, handler);
|
|
68
|
-
this.instance.put(routePath, this.createRouteHandler(routeHandler));
|
|
69
|
-
}
|
|
70
|
-
delete(pathOrHandler, handler) {
|
|
71
|
-
const [routePath, routeHandler] = this.getRouteAndHandler(pathOrHandler, handler);
|
|
72
|
-
this.instance.delete(routePath, this.createRouteHandler(routeHandler));
|
|
73
|
-
}
|
|
74
|
-
use(pathOrHandler, handler) {
|
|
75
|
-
const [routePath, routeHandler] = this.getRouteAndHandler(pathOrHandler, handler);
|
|
76
|
-
this.instance.use(routePath, this.createRouteHandler(routeHandler));
|
|
77
|
-
}
|
|
78
|
-
patch(pathOrHandler, handler) {
|
|
79
|
-
const [routePath, routeHandler] = this.getRouteAndHandler(pathOrHandler, handler);
|
|
80
|
-
this.instance.patch(routePath, this.createRouteHandler(routeHandler));
|
|
81
|
-
}
|
|
82
|
-
options(pathOrHandler, handler) {
|
|
83
|
-
const [routePath, routeHandler] = this.getRouteAndHandler(pathOrHandler, handler);
|
|
84
|
-
this.instance.options(routePath, this.createRouteHandler(routeHandler));
|
|
85
|
-
}
|
|
86
|
-
async reply(ctx, body, statusCode) {
|
|
87
|
-
if (typeof ctx === 'function') {
|
|
88
|
-
ctx = await ctx();
|
|
89
|
-
}
|
|
90
|
-
if (statusCode)
|
|
91
|
-
ctx.status(statusCode);
|
|
92
|
-
const responseContentType = await this.getHeader(ctx, 'Content-Type');
|
|
93
|
-
if (!responseContentType?.startsWith('application/json') &&
|
|
94
|
-
body?.statusCode >= HttpStatus.BAD_REQUEST) {
|
|
95
|
-
Logger.warn("Content-Type doesn't match Reply body, you might need a custom ExceptionFilter for non-JSON responses");
|
|
96
|
-
this.setHeader(ctx, 'Content-Type', 'application/json');
|
|
97
|
-
}
|
|
98
|
-
ctx.set('body', body);
|
|
99
|
-
}
|
|
100
|
-
async status(ctx, statusCode) {
|
|
101
|
-
if (typeof ctx === 'function') {
|
|
102
|
-
ctx = await ctx();
|
|
103
|
-
}
|
|
104
|
-
ctx.status(statusCode);
|
|
105
|
-
}
|
|
106
|
-
async end() {
|
|
107
|
-
return RESPONSE_ALREADY_SENT;
|
|
108
|
-
}
|
|
109
|
-
render() {
|
|
110
|
-
throw new Error('Method not implemented.');
|
|
111
|
-
}
|
|
112
|
-
async redirect(ctx, statusCode, url) {
|
|
113
|
-
if (typeof ctx === 'function') {
|
|
114
|
-
ctx = await ctx();
|
|
115
|
-
}
|
|
116
|
-
ctx.redirect(url, statusCode);
|
|
117
|
-
}
|
|
118
|
-
setErrorHandler(handler) {
|
|
119
|
-
this.instance.onError(async (err, ctx) => {
|
|
120
|
-
await handler(err, ctx.req, ctx);
|
|
121
|
-
return this.send(ctx);
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
setNotFoundHandler(handler) {
|
|
125
|
-
this.instance.notFound(async (ctx) => {
|
|
126
|
-
await handler(ctx.req, ctx);
|
|
127
|
-
return this.send(ctx);
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
useStaticAssets(path, options) {
|
|
131
|
-
Logger.log('Registering static assets middleware');
|
|
132
|
-
this.instance.use(path, serveStatic(options));
|
|
133
|
-
}
|
|
134
|
-
setViewEngine() {
|
|
135
|
-
throw new Error('Method not implemented.');
|
|
136
|
-
}
|
|
137
|
-
async isHeadersSent(ctx) {
|
|
138
|
-
if (typeof ctx === 'function') {
|
|
139
|
-
ctx = await ctx();
|
|
140
|
-
}
|
|
141
|
-
return ctx.finalized;
|
|
142
|
-
}
|
|
143
|
-
async getHeader(ctx, name) {
|
|
144
|
-
if (typeof ctx === 'function') {
|
|
145
|
-
ctx = await ctx();
|
|
146
|
-
}
|
|
147
|
-
return ctx.res.headers.get(name);
|
|
148
|
-
}
|
|
149
|
-
async setHeader(ctx, name, value) {
|
|
150
|
-
if (typeof ctx === 'function') {
|
|
151
|
-
ctx = await ctx();
|
|
152
|
-
}
|
|
153
|
-
ctx.res.headers.set(name, value);
|
|
154
|
-
}
|
|
155
|
-
async appendHeader(ctx, name, value) {
|
|
156
|
-
if (typeof ctx === 'function') {
|
|
157
|
-
ctx = await ctx();
|
|
158
|
-
}
|
|
159
|
-
ctx.res.headers.append(name, value);
|
|
160
|
-
}
|
|
161
|
-
async getRequestHostname(ctx) {
|
|
162
|
-
if (typeof ctx === 'function') {
|
|
163
|
-
ctx = await ctx();
|
|
164
|
-
}
|
|
165
|
-
return ctx.req.header().host;
|
|
166
|
-
}
|
|
167
|
-
getRequestMethod(request) {
|
|
168
|
-
return request.method;
|
|
169
|
-
}
|
|
170
|
-
getRequestUrl(request) {
|
|
171
|
-
return request.url;
|
|
172
|
-
}
|
|
173
|
-
enableCors(options) {
|
|
174
|
-
this.instance.use(cors(options));
|
|
175
|
-
}
|
|
176
|
-
useBodyParser(type, rawBody, bodyLimit) {
|
|
177
|
-
Logger.log(`Registering body parser middleware for type: ${type} | bodyLimit: ${bodyLimit}`);
|
|
178
|
-
this.instance.use(this.bodyLimit(bodyLimit));
|
|
179
|
-
this._isParserRegistered = true;
|
|
180
|
-
}
|
|
181
|
-
close() {
|
|
182
|
-
return new Promise((resolve) => this.httpServer.close(() => resolve()));
|
|
183
|
-
}
|
|
184
|
-
initHttpServer(options) {
|
|
185
|
-
this.instance.use(async (ctx, next) => {
|
|
186
|
-
ctx.req['ip'] =
|
|
187
|
-
ctx.req.header('cf-connecting-ip') ??
|
|
188
|
-
ctx.req.header('x-forwarded-for') ??
|
|
189
|
-
ctx.req.header('x-real-ip') ??
|
|
190
|
-
ctx.req.header('forwarded') ??
|
|
191
|
-
ctx.req.header('true-client-ip') ??
|
|
192
|
-
ctx.req.header('x-client-ip') ??
|
|
193
|
-
ctx.req.header('x-cluster-client-ip') ??
|
|
194
|
-
ctx.req.header('x-forwarded') ??
|
|
195
|
-
ctx.req.header('forwarded-for') ??
|
|
196
|
-
ctx.req.header('via');
|
|
197
|
-
ctx.req['query'] = ctx.req.query();
|
|
198
|
-
ctx.req['headers'] = Object.fromEntries(ctx.req.raw.headers);
|
|
199
|
-
const contentType = ctx.req.header('content-type');
|
|
200
|
-
if (contentType?.startsWith('multipart/form-data') ||
|
|
201
|
-
contentType?.startsWith('application/x-www-form-urlencoded')) {
|
|
202
|
-
ctx.req.body = await ctx.req.parseBody({
|
|
203
|
-
all: true,
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
else if (contentType?.startsWith('application/json') ||
|
|
207
|
-
contentType?.startsWith('text/plain')) {
|
|
208
|
-
if (options.rawBody) {
|
|
209
|
-
ctx.req.rawBody = Buffer.from(await ctx.req.text());
|
|
210
|
-
}
|
|
211
|
-
ctx.req.body = await ctx.req.json();
|
|
212
|
-
}
|
|
213
|
-
await next();
|
|
214
|
-
});
|
|
215
|
-
const isHttpsEnabled = options?.httpsOptions;
|
|
216
|
-
const createServer = isHttpsEnabled
|
|
217
|
-
? https.createServer
|
|
218
|
-
: http.createServer;
|
|
219
|
-
this.httpServer = createAdaptorServer({
|
|
220
|
-
fetch: this.instance.fetch,
|
|
221
|
-
createServer,
|
|
222
|
-
overrideGlobalObjects: false,
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
getType() {
|
|
226
|
-
return 'hono';
|
|
227
|
-
}
|
|
228
|
-
registerParserMiddleware(_prefix, rawBody) {
|
|
229
|
-
if (this._isParserRegistered) {
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
|
-
Logger.log('Registering parser middleware');
|
|
233
|
-
this.useBodyParser('application/x-www-form-urlencoded', rawBody);
|
|
234
|
-
this.useBodyParser('application/json', rawBody);
|
|
235
|
-
this.useBodyParser('text/plain', rawBody);
|
|
236
|
-
this._isParserRegistered = true;
|
|
237
|
-
}
|
|
238
|
-
async createMiddlewareFactory(requestMethod) {
|
|
239
|
-
return (path, callback) => {
|
|
240
|
-
const routeMethodsMap = {
|
|
241
|
-
[RequestMethod.ALL]: this.instance.all,
|
|
242
|
-
[RequestMethod.DELETE]: this.instance.delete,
|
|
243
|
-
[RequestMethod.GET]: this.instance.get,
|
|
244
|
-
[RequestMethod.OPTIONS]: this.instance.options,
|
|
245
|
-
[RequestMethod.PATCH]: this.instance.patch,
|
|
246
|
-
[RequestMethod.POST]: this.instance.post,
|
|
247
|
-
[RequestMethod.PUT]: this.instance.put,
|
|
248
|
-
};
|
|
249
|
-
const routeMethod = (routeMethodsMap[requestMethod] || this.instance.get).bind(this.instance);
|
|
250
|
-
routeMethod(path, async (ctx, next) => {
|
|
251
|
-
await callback(ctx.req, ctx, next);
|
|
252
|
-
});
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
applyVersionFilter() {
|
|
256
|
-
throw new Error('Versioning not yet supported in Hono');
|
|
257
|
-
}
|
|
258
|
-
listen(port, ...args) {
|
|
259
|
-
return this.httpServer.listen(port, ...args);
|
|
260
|
-
}
|
|
261
|
-
bodyLimit(maxSize) {
|
|
262
|
-
return bodyLimit({
|
|
263
|
-
maxSize,
|
|
264
|
-
onError: () => {
|
|
265
|
-
throw new Error('Body too large');
|
|
266
|
-
},
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
//# sourceMappingURL=hono-adapter.js.map
|