very-express 0.4.5 → 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.
@@ -1,8 +1,6 @@
1
1
  {
2
2
  "type": "object",
3
3
  "x-documentConfig": {
4
- "documentName": "user",
5
- "interfaceName": "User",
6
4
  "methods": [
7
5
  "get",
8
6
  "getList",
@@ -11,7 +11,7 @@ export interface openapi {
11
11
  export interface paths {
12
12
  [key: string]: {
13
13
  "x-collection"?: string;
14
- "x-interface"?: string;
14
+ "x-documentName"?: string;
15
15
  summary?: string;
16
16
  get?: method;
17
17
  post?: method;
@@ -63,7 +63,6 @@ export interface jsonSchemaPropsItem {
63
63
  }
64
64
  export interface documentConfig {
65
65
  documentName: string;
66
- interfaceName: string;
67
66
  keyPrefix?: string;
68
67
  methods: schemaMethod[];
69
68
  }
@@ -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;
@@ -1,2 +1,6 @@
1
1
  import * as types from "~/types/types";
2
2
  export declare function checkConfigValid(options: types.compilerOptions): void;
3
+ declare const _default: {
4
+ checkConfigValid: typeof checkConfigValid;
5
+ };
6
+ export default _default;
@@ -1,5 +1,30 @@
1
- export * from "./common";
2
- export * from "./generator";
3
- export * from "./jsonSchema";
4
- export * from "./logger";
5
- export * from "./configChecker";
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 of **collection** or **table**, also used at `Model`, camel case recomended. |
7
- | interfaceName | `string` | - | use to name `endpoint`, `Class`, `Interface`, `File`. |
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "very-express",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "description": "based on json schema and openapi, generate Express RestApi server with mongoDb ",
5
5
  "author": "justin26l",
6
6
  "license": "MIT",
@@ -11,7 +11,7 @@
11
11
  "scripts": {
12
12
  "start": "node ./dist/index.js",
13
13
  "dev": "npm run compile && npm run start",
14
- "build": "npm run lint && npm run compile",
14
+ "build": "npm run lint && npm run compile && npm run minify",
15
15
  "lint": "eslint ./src --ext .ts --fix",
16
16
  "compile": "ncc build ./src/cli.ts -o dist && node ./src/copyTsTemplates.js",
17
17
  "minify": "uglifyjs ./dist/index.js -c -m -o ./dist/index.js"