miqro 1.6.6 → 1.6.7
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.
|
@@ -7,6 +7,7 @@ export declare const getDOCJSON: ({ dirname, subPath }: {
|
|
|
7
7
|
method?: Method | Method[];
|
|
8
8
|
description?: string;
|
|
9
9
|
policy?: GroupPolicy;
|
|
10
|
+
headers?: ParseOptions | ParseOptions[];
|
|
10
11
|
session?: false | true | SessionHandlerOptions;
|
|
11
12
|
params?: false | ParseOptions | ParseOptions[];
|
|
12
13
|
query?: false | ParseOptions | ParseOptions[];
|
package/dist/utils/doc/index.js
CHANGED
|
@@ -7,10 +7,14 @@ const path_1 = require("path");
|
|
|
7
7
|
const getDOCJSON = ({ dirname, subPath }, logger) => {
|
|
8
8
|
const apiTraverse = (0, api_router_utils_1.traverseAPIRouteDir)((0, path_1.basename)(dirname).toUpperCase(), (0, path_1.resolve)(core_1.ConfigPathResolver.getBaseDirname(), dirname), subPath, undefined, logger);
|
|
9
9
|
const docJSON = Object.keys(apiTraverse).map(featureName => {
|
|
10
|
-
const {
|
|
10
|
+
const { path, method, options } = apiTraverse[featureName];
|
|
11
|
+
const { session, policy, description } = options ? options : { session: undefined, policy: undefined, description: undefined };
|
|
12
|
+
const { params, query, body, headers } = options && options.request ? options.request : { params: undefined, query: undefined, body: undefined, headers: undefined };
|
|
13
|
+
const result = options && options.response !== true ? options.response : undefined;
|
|
11
14
|
return {
|
|
12
15
|
path,
|
|
13
16
|
method,
|
|
17
|
+
headers,
|
|
14
18
|
session: session ? typeof session === "function" ? true : session : false,
|
|
15
19
|
policy,
|
|
16
20
|
params,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/doc/index.ts"],"names":[],"mappings":";;;AAAA,sCAAmH;AACnH,gFAAgF;AAChF,+BAAyC;AAElC,MAAM,UAAU,GAAG,CAAC,EAAE,OAAO,EAAE,OAAO,EAAyC,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,IAAI;YACJ,MAAM;YACN,OAAO;YACP,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK;YACzE,MAAM;YACN,MAAM;YACN,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM;YAChC,WAAW;SACZ,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC,CAAA;AA/BY,QAAA,UAAU,cA+BtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "miqro",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"author": "claukers",
|
|
19
19
|
"license": "ISC",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@miqro/core": "^1.3.
|
|
21
|
+
"@miqro/core": "^1.3.5",
|
|
22
22
|
"@miqro/runner": "^1.1.6"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
package/src/utils/doc/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export const getDOCJSON = ({ dirname, subPath }: { dirname: string; subPath: str
|
|
|
7
7
|
method?: Method | Method[];
|
|
8
8
|
description?: string;
|
|
9
9
|
policy?: GroupPolicy;
|
|
10
|
+
headers?: ParseOptions | ParseOptions[];
|
|
10
11
|
session?: false | true | SessionHandlerOptions;
|
|
11
12
|
params?: false | ParseOptions | ParseOptions[];
|
|
12
13
|
query?: false | ParseOptions | ParseOptions[];
|
|
@@ -16,10 +17,14 @@ export const getDOCJSON = ({ dirname, subPath }: { dirname: string; subPath: str
|
|
|
16
17
|
}[] => {
|
|
17
18
|
const apiTraverse = traverseAPIRouteDir(basename(dirname).toUpperCase(), resolve(ConfigPathResolver.getBaseDirname(), dirname), subPath, undefined, logger);
|
|
18
19
|
const docJSON = Object.keys(apiTraverse).map(featureName => {
|
|
19
|
-
const {
|
|
20
|
+
const { path, method, options } = apiTraverse[featureName];
|
|
21
|
+
const { session, policy, description } = options ? options : { session: undefined, policy: undefined, description: undefined };
|
|
22
|
+
const { params, query, body, headers } = options && options.request ? options.request : { params: undefined, query: undefined, body: undefined, headers: undefined };
|
|
23
|
+
const result = options && options.response !== true ? options.response : undefined;
|
|
20
24
|
return {
|
|
21
25
|
path,
|
|
22
26
|
method,
|
|
27
|
+
headers,
|
|
23
28
|
session: session ? typeof session === "function" ? true : session : false,
|
|
24
29
|
policy,
|
|
25
30
|
params,
|