koa-ts-core 0.0.5 → 0.0.6
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/README.md +18 -2
- package/dist/index.cjs.js +37049 -1
- package/dist/index.esm.js +37038 -1
- package/dist/init/address.d.ts +1 -1
- package/dist/middleware/request_params_middleware.d.ts +7 -0
- package/dist/types/meta_data.d.ts +16 -0
- package/dist/types/route.d.ts +1 -0
- package/dist/utils/path.d.ts +3 -3
- package/package.json +6 -2
package/dist/init/address.d.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface IMetaData {
|
|
2
|
+
method: string;
|
|
3
|
+
description: string;
|
|
4
|
+
path: string;
|
|
5
|
+
request: Request;
|
|
6
|
+
response: Response;
|
|
7
|
+
}
|
|
8
|
+
interface Response {
|
|
9
|
+
body: any;
|
|
10
|
+
}
|
|
11
|
+
interface Request {
|
|
12
|
+
header: Record<string, string>;
|
|
13
|
+
body: any;
|
|
14
|
+
query: any;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
package/dist/types/route.d.ts
CHANGED
package/dist/utils/path.d.ts
CHANGED
|
@@ -22,12 +22,12 @@ export declare const getDefaultExportFromFile: <T = any>(filePath: string) => T
|
|
|
22
22
|
*/
|
|
23
23
|
export declare function walkDirectorySync(currentDirPath: string, callback: WalkSyncHandler): void;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* 根据文件路径和关键字部分生成路径的模块选项
|
|
26
26
|
* @param {FilePathMeta} filePath - 文件路径元数据
|
|
27
27
|
* @returns {Object} 包含控制器前缀、模块名和文件名的对象
|
|
28
28
|
*/
|
|
29
|
-
export declare const
|
|
30
|
-
|
|
29
|
+
export declare const generateOptionsByKeyPart: (filePath: FilePathMeta, keyPart: string) => {
|
|
30
|
+
pathPrefix: string;
|
|
31
31
|
moduleName: string;
|
|
32
32
|
name: string;
|
|
33
33
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koa-ts-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "koa-ts-core",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -26,17 +26,21 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"dotenv": "^16.4.7",
|
|
28
28
|
"koa": "^2.15.4",
|
|
29
|
+
"koa-bodyparser": "^4.4.1",
|
|
29
30
|
"koa-router": "^13.0.1",
|
|
31
|
+
"koa-ts-core": "link:",
|
|
30
32
|
"portfinder": "^1.0.37",
|
|
31
33
|
"pug": "^3.0.3",
|
|
32
34
|
"rollup-plugin-pug": "^1.1.1"
|
|
33
35
|
},
|
|
34
36
|
"devDependencies": {
|
|
35
37
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
38
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
36
39
|
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
37
40
|
"@rollup/plugin-terser": "^0.4.4",
|
|
38
41
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
39
42
|
"@types/koa": "^2.15.0",
|
|
43
|
+
"@types/koa-bodyparser": "^4.3.12",
|
|
40
44
|
"@types/koa-router": "^7.4.8",
|
|
41
45
|
"@types/node": "^22.13.4",
|
|
42
46
|
"@types/pug": "^2.0.10",
|
|
@@ -50,4 +54,4 @@
|
|
|
50
54
|
"engines": {
|
|
51
55
|
"node": ">=14.0.0"
|
|
52
56
|
}
|
|
53
|
-
}
|
|
57
|
+
}
|