File tree Expand file tree Collapse file tree 5 files changed +16
-9
lines changed Expand file tree Collapse file tree 5 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 19
19
"@hey-api/openapi-ts" : " ^0.64.13" ,
20
20
"@hono/swagger-ui" : " ^0.5.1" ,
21
21
"@hono/zod-openapi" : " ^0.19.2" ,
22
+ "consola" : " ^3.4.2" ,
22
23
"core" : " workspace:*" ,
23
24
"es-toolkit" : " ^1.33.0" ,
24
25
"hono" : " ^4.7.5" ,
28
29
"packages/core" : {
29
30
"name" : " core" ,
30
31
"dependencies" : {
31
- "consola" : " ^3.4.2" ,
32
32
"es-toolkit" : " ^1.33.0" ,
33
33
"fdir" : " ^6.4.3" ,
34
34
"filesystem-notify" : " ^0.0.3" ,
Original file line number Diff line number Diff line change 13
13
"core" : " workspace:*" ,
14
14
"es-toolkit" : " ^1.33.0" ,
15
15
"nypm" : " ^0.6.0" ,
16
+ "consola" : " ^3.4.2" ,
16
17
"@hey-api/openapi-ts" : " ^0.64.13"
17
18
},
18
19
"dependencies" : {
Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ import {
4
4
DifyKnowledgeResponseRecordSchema ,
5
5
} from "./schemas" ;
6
6
7
- // dify 外部知识库搜索
7
+ // Dify external knowledge base search
8
8
export default createRoute ( {
9
9
tags : [ "search" ] ,
10
10
method : "post" ,
11
11
path : "/retrieval" ,
12
- summary : "作为 dify 外部知识库搜索 " ,
12
+ summary : "Search as an external knowledge base for Dify " ,
13
13
security : [
14
14
{
15
15
Bearer : [ ] ,
@@ -26,7 +26,7 @@ export default createRoute({
26
26
} ,
27
27
responses : {
28
28
200 : {
29
- description : "搜索结果 " ,
29
+ description : "Search results " ,
30
30
content : {
31
31
"application/json" : {
32
32
schema : z . object ( {
Original file line number Diff line number Diff line change 1
1
import { createRoute } from "@hono/zod-openapi" ;
2
2
import { SearchParamSchema , SearchResultsSchema } from "./schemas" ;
3
3
4
- // 搜索
4
+ // Search
5
5
export default createRoute ( {
6
6
tags : [ "search" ] ,
7
7
method : "post" ,
8
8
path : "/search" ,
9
- summary : "知识库搜索 " ,
9
+ summary : "Knowledge base search " ,
10
10
security : [
11
11
{
12
12
Bearer : [ ] ,
@@ -28,7 +28,7 @@ export default createRoute({
28
28
schema : SearchResultsSchema ,
29
29
} ,
30
30
} ,
31
- description : "搜索结果 " ,
31
+ description : "Search results " ,
32
32
} ,
33
33
} ,
34
34
} ) ;
Original file line number Diff line number Diff line change
1
+ import { createConsola } from "consola" ;
1
2
import { OpenAPIHono } from "@hono/zod-openapi" ;
2
3
import { swaggerUI } from "@hono/swagger-ui" ;
3
4
import apis from "./apis" ;
4
5
import { version , name } from "~/package.json" ;
5
- import docBase from "./docbase" ;
6
6
import { type DocBase } from "core/src" ;
7
7
import { serveStatic } from "hono/bun" ;
8
8
import webdav from "./webdav" ;
9
9
import { pkgManager } from "./plugins" ;
10
10
import { PackageManager } from "./plugins/pkgManager" ;
11
11
12
+ createConsola ( {
13
+ level : import . meta. env . NODE_ENV === "production" ? 2 : 5 ,
14
+ } ) . wrapAll ( ) ;
15
+
16
+ const docBase = await import ( "./docbase" )
17
+
12
18
// 路由版本
13
19
export const routeVersion = `v${ version . split ( "." ) [ 0 ] } ` ;
14
20
@@ -28,7 +34,7 @@ const app = new OpenAPIHono();
28
34
// 启动 docbase 实例
29
35
app . use ( async ( c , next ) => {
30
36
c . set ( "pkgManager" , pkgManager ) ;
31
- c . set ( "docbase" , docBase ) ;
37
+ c . set ( "docbase" , docBase . default ) ;
32
38
await next ( ) ;
33
39
} ) ;
34
40
You can’t perform that action at this time.
0 commit comments