miqro 5.0.2 → 5.0.3
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/cli.js +0 -0
- package/build/utils/doc/md.d.ts +1 -0
- package/build/utils/doc/md.js +25 -20
- package/package.json +3 -3
package/build/cli.js
CHANGED
|
File without changes
|
package/build/utils/doc/md.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare function getMDDoc(args: {
|
|
|
7
7
|
subPath: string;
|
|
8
8
|
}, logger?: Logger): Promise<string>;
|
|
9
9
|
export declare function parserToString(parser: {
|
|
10
|
+
status?: number | number[];
|
|
10
11
|
headers?: string | SchemaProperties | SchemaProperties[];
|
|
11
12
|
headersMode?: ParserMode;
|
|
12
13
|
query?: string | SchemaProperties | boolean | SchemaProperties[];
|
package/build/utils/doc/md.js
CHANGED
|
@@ -12,26 +12,28 @@ export async function getMDDoc(args, logger) {
|
|
|
12
12
|
const pathData = jsonDOC[path];
|
|
13
13
|
const methods = Object.keys(pathData);
|
|
14
14
|
for (const method of methods) {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
15
|
+
const apiDataList = pathData[method];
|
|
16
|
+
for (const apiData of apiDataList) {
|
|
17
|
+
outMD += `## ${apiData.identifier}${args.showFilePath ? apiData.___filePath : ""}\n\n`;
|
|
18
|
+
if (apiData.name) {
|
|
19
|
+
outMD += `${apiData.name}\n\n`;
|
|
20
|
+
}
|
|
21
|
+
if (apiData.description) {
|
|
22
|
+
outMD += `${apiData.description}\n\n`;
|
|
23
|
+
}
|
|
24
|
+
outMD += `[${method}] ${path}\n\n`;
|
|
25
|
+
if (apiData.policy) {
|
|
26
|
+
outMD += `### policy\n\n`;
|
|
27
|
+
outMD += policyToString(apiData.policy);
|
|
28
|
+
}
|
|
29
|
+
if (apiData.request) {
|
|
30
|
+
const requestOutMD = parserToString(apiData.request);
|
|
31
|
+
outMD += requestOutMD !== "" ? `### request\n\n${requestOutMD}` : "";
|
|
32
|
+
}
|
|
33
|
+
if (apiData.response && typeof apiData.response !== "boolean") {
|
|
34
|
+
const responseOutMD = parserToString(apiData.response);
|
|
35
|
+
outMD += responseOutMD !== "" ? `### response\n\n${responseOutMD}` : "";
|
|
36
|
+
}
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
}
|
|
@@ -45,6 +47,9 @@ function policyToString(policy) {
|
|
|
45
47
|
}
|
|
46
48
|
export function parserToString(parser) {
|
|
47
49
|
let outMD = "";
|
|
50
|
+
if (parser.status) {
|
|
51
|
+
outMD += `#### status\n\n${parser.status instanceof Array ? parser.status.join(",") : parser.status}\n\n`;
|
|
52
|
+
}
|
|
48
53
|
if (parser.params && typeof parser.params !== "boolean") {
|
|
49
54
|
outMD += `#### path params\n\n`;
|
|
50
55
|
outMD += parserPartToString(parser.params, parser.paramsMode);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "miqro",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"author": "claukers",
|
|
20
20
|
"license": "ISC",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@miqro/core": "^5.0.
|
|
23
|
-
"@miqro/parser": "^2.0.
|
|
22
|
+
"@miqro/core": "^5.0.10",
|
|
23
|
+
"@miqro/parser": "^2.0.3",
|
|
24
24
|
"@miqro/runner": "^2.0.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|