very-express 0.4.6 → 0.4.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.
- package/README.md +1 -1
- package/dist/generators/controller/controller.template.d.ts +1 -1
- package/dist/generators/routes/routes.generator.d.ts +1 -1
- package/dist/generators/routes/routes.template.d.ts +1 -1
- package/dist/index.js +86567 -940
- package/dist/templates/jsonSchema/User.json +0 -2
- package/dist/types/openapi.d.ts +1 -1
- package/dist/types/types.d.ts +0 -1
- package/dist/utils/common.d.ts +2 -0
- package/dist/utils/configChecker.d.ts +4 -0
- package/dist/utils/index.d.ts +30 -5
- package/docs/{defineJsonSchema.md → vexJsonSchema.md} +5 -6
- package/package.json +1 -1
package/dist/types/openapi.d.ts
CHANGED
package/dist/types/types.d.ts
CHANGED
package/dist/utils/common.d.ts
CHANGED
|
@@ -7,5 +7,7 @@ export declare function copyDir(source: string, destination: string, compilerOpt
|
|
|
7
7
|
declare const _default: {
|
|
8
8
|
relativePath: (fromPath: string, toPath: string) => string;
|
|
9
9
|
copyDir: typeof copyDir;
|
|
10
|
+
loadJson: typeof loadJson;
|
|
11
|
+
writeFile: typeof writeFile;
|
|
10
12
|
};
|
|
11
13
|
export default _default;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
declare const _default: {
|
|
2
|
+
common: {
|
|
3
|
+
relativePath: (fromPath: string, toPath: string) => string;
|
|
4
|
+
copyDir: typeof import("./common").copyDir;
|
|
5
|
+
loadJson: typeof import("./common").loadJson;
|
|
6
|
+
writeFile: typeof import("./common").writeFile;
|
|
7
|
+
};
|
|
8
|
+
generator: {
|
|
9
|
+
defaultCompilerOptions: import("../types/types").compilerOptions;
|
|
10
|
+
getGenaratorHeaderComment: typeof import("./generator").getGenaratorHeaderComment;
|
|
11
|
+
getSimpleHeaderComment: typeof import("./generator").getSimpleHeaderComment;
|
|
12
|
+
isUseOAuth: typeof import("./generator").isUseOAuth;
|
|
13
|
+
};
|
|
14
|
+
jsonSchema: {
|
|
15
|
+
cleanXcustomValue: typeof import("./jsonSchema").cleanXcustomValue;
|
|
16
|
+
httpMethod: typeof import("./jsonSchema").httpMethod;
|
|
17
|
+
loadJsonSchema: typeof import("./jsonSchema").loadJsonSchema;
|
|
18
|
+
};
|
|
19
|
+
logger: {
|
|
20
|
+
process: typeof import("./logger").processing;
|
|
21
|
+
writing: typeof import("./logger").writing;
|
|
22
|
+
info: typeof import("./logger").info;
|
|
23
|
+
warn: typeof import("./logger").warn;
|
|
24
|
+
error: typeof import("./logger").error;
|
|
25
|
+
};
|
|
26
|
+
configChecker: {
|
|
27
|
+
checkConfigValid: typeof import("./configChecker").checkConfigValid;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export default _default;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Define Json Schema
|
|
2
|
+
this document tell how very express process the json schema.
|
|
2
3
|
### x-documentConfig:
|
|
3
4
|
|
|
4
5
|
| Fields | Data Type | Options | Description |
|
|
5
6
|
| - | - | - | - |
|
|
6
|
-
| documentName | `string` | - | name
|
|
7
|
-
|
|
|
8
|
-
| methods | `array<string>` | `get`, `post`, `put`, `patch`, `delete` | available method of REST API. |
|
|
7
|
+
| documentName | `string` | - | auto generated as file name. used to name **Collection**, **TS Interface**, **ODM Model** etc. |
|
|
8
|
+
| methods | `array<string>` | `get`, `post`, `put`, `patch`, `delete` | array of **REST API Method** to be generated. |
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
### Properties Mandatory Value:
|
|
@@ -13,15 +13,14 @@
|
|
|
13
13
|
| Fields | Data Type | Required | Description |
|
|
14
14
|
| - | - | - | - |
|
|
15
15
|
| type | `string` | true | [JsonSchema's type field](https://json-schema.org/understanding-json-schema/reference/type) |
|
|
16
|
-
| required | `boolean` | false | api will check field must be defined. |
|
|
16
|
+
| required | `boolean` | false | generated api will check field must be defined. |
|
|
17
17
|
| x-foreignKey | `string` | false | `documentName` from other JsonSchema, plan to implemented on [v0.5.0](./RoadMap/v0-5-0.md) |
|
|
18
18
|
<!-- | format | `string` | false | veryExpress did not handle this field | -->
|
|
19
19
|
|
|
20
20
|
```JSON
|
|
21
21
|
{
|
|
22
22
|
"x-documentConfig": {
|
|
23
|
-
"documentName": "user",
|
|
24
|
-
"interfaceName": "User",
|
|
23
|
+
"documentName": "user", // auto generate as file name
|
|
25
24
|
"methods": [
|
|
26
25
|
"get",
|
|
27
26
|
"post",
|