very-express 0.4.10 → 0.4.12
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/.eslintrc.json +37 -37
- package/.gitattributes +2 -2
- package/.github/workflows/npm-publish.yml +38 -0
- package/LICENSE +21 -21
- package/README.md +61 -52
- package/docs/developmentNote.md +23 -16
- package/docs/roadMap/RoadMap.md +30 -30
- package/docs/roadMap/v0-5-0.md +19 -19
- package/docs/roadMap/v0-6-0.md +6 -6
- package/docs/roadMap/v0-7-0.md +3 -3
- package/docs/vexJsonSchema.md +54 -40
- package/package.json +59 -65
- package/scripts/build.js +14 -0
- package/scripts/copyTsTemplates.js +24 -0
- package/tsconfig.json +121 -121
- package/vex.config.json +1 -1
- package/dist/_plugins/PassportGoogle.ts +0 -87
- package/dist/_plugins/oauthVerify.ts +0 -39
- package/dist/_roles/_RoleFactory.ts +0 -22
- package/dist/_services/VexDbConnector.ts +0 -70
- package/dist/_types/responseMsg.ts +0 -20
- package/dist/_utils/common.ts +0 -53
- package/dist/_utils/index.ts +0 -11
- package/dist/_utils/logger.ts +0 -50
- package/dist/_utils/response.ts +0 -27
- package/dist/cli.d.ts +0 -1
- package/dist/generators/app/openapi.generator.d.ts +0 -3
- package/dist/generators/app/server.generator.d.ts +0 -2
- package/dist/generators/app/server.template.d.ts +0 -5
- package/dist/generators/controller/controller.template.d.ts +0 -14
- package/dist/generators/controller/controllers.generator.d.ts +0 -7
- package/dist/generators/index.d.ts +0 -9
- package/dist/generators/middlewares/RBACmiddleware.generator.d.ts +0 -6
- package/dist/generators/middlewares/RBACmiddlewares.template.d.ts +0 -6
- package/dist/generators/project/packageJson.generator.d.ts +0 -6
- package/dist/generators/project/userSchema.generator.d.ts +0 -4
- package/dist/generators/role/role.generator.d.ts +0 -8
- package/dist/generators/role/role.template.d.ts +0 -8
- package/dist/generators/routes/oauth.generator.d.ts +0 -2
- package/dist/generators/routes/routes.generator.d.ts +0 -11
- package/dist/generators/routes/routes.template.d.ts +0 -11
- package/dist/generators/routes/swagger.generator.d.ts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -1031
- package/dist/preprocess/jsonschemaFormat.d.ts +0 -2
- package/dist/preprocess/roleSetupFile.d.ts +0 -9
- package/dist/templates/_plugins/PassportGoogle.ts +0 -87
- package/dist/templates/_plugins/oauthVerify.ts +0 -39
- package/dist/templates/_roles/_RoleFactory.d.ts +0 -10
- package/dist/templates/_roles/_RoleFactory.ts +0 -22
- package/dist/templates/_services/VexDbConnector.ts +0 -70
- package/dist/templates/_types/responseMsg.ts +0 -20
- package/dist/templates/_utils/common.ts +0 -53
- package/dist/templates/_utils/index.ts +0 -11
- package/dist/templates/_utils/logger.ts +0 -50
- package/dist/templates/_utils/response.ts +0 -27
- package/dist/templates/jsonSchema/User.json +0 -56
- package/dist/templates/root/.env +0 -5
- package/dist/templates/root/package.json +0 -40
- package/dist/templates/root/tsconfig.json +0 -22
- package/dist/types/openapi.d.ts +0 -108
- package/dist/types/types.d.ts +0 -75
- package/dist/utils/common.d.ts +0 -13
- package/dist/utils/configChecker.d.ts +0 -6
- package/dist/utils/generator.d.ts +0 -12
- package/dist/utils/index.d.ts +0 -30
- package/dist/utils/jsonSchema.d.ts +0 -14
- package/dist/utils/logger.d.ts +0 -13
package/dist/types/types.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
export interface compilerOptions {
|
|
2
|
-
commitBeforeGenerate: boolean;
|
|
3
|
-
headerComment: string;
|
|
4
|
-
jsonSchemaDir: string;
|
|
5
|
-
openapiDir: string;
|
|
6
|
-
rootDir: string;
|
|
7
|
-
srcDir: string;
|
|
8
|
-
sysDir: string;
|
|
9
|
-
writtedDir: string[];
|
|
10
|
-
app: {
|
|
11
|
-
enableSwagger: boolean;
|
|
12
|
-
useUserSchema: boolean;
|
|
13
|
-
useObjectID: boolean;
|
|
14
|
-
allowApiCreateUpdate_id: boolean;
|
|
15
|
-
};
|
|
16
|
-
useRBAC?: {
|
|
17
|
-
roles: string[];
|
|
18
|
-
default: string;
|
|
19
|
-
schemaIncluded: string[];
|
|
20
|
-
};
|
|
21
|
-
useOauth?: {
|
|
22
|
-
google?: boolean;
|
|
23
|
-
microsoft?: boolean;
|
|
24
|
-
apple?: boolean;
|
|
25
|
-
github?: boolean;
|
|
26
|
-
[key: string]: boolean | undefined;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
export interface roleJson {
|
|
30
|
-
[key: string]: string[];
|
|
31
|
-
}
|
|
32
|
-
export interface jsonSchema {
|
|
33
|
-
type: string;
|
|
34
|
-
"x-documentConfig": documentConfig;
|
|
35
|
-
properties: {
|
|
36
|
-
[key: string]: jsonSchemaPropsItem;
|
|
37
|
-
};
|
|
38
|
-
required?: string[];
|
|
39
|
-
index?: string[];
|
|
40
|
-
[key: string]: any;
|
|
41
|
-
}
|
|
42
|
-
export interface jsonSchemaPropsItem {
|
|
43
|
-
type: string;
|
|
44
|
-
description?: string;
|
|
45
|
-
format?: string;
|
|
46
|
-
properties?: {
|
|
47
|
-
[key: string]: jsonSchemaPropsItem;
|
|
48
|
-
};
|
|
49
|
-
items?: jsonSchemaPropsItem;
|
|
50
|
-
enum?: any[];
|
|
51
|
-
required?: boolean | string[];
|
|
52
|
-
index?: boolean;
|
|
53
|
-
example?: any;
|
|
54
|
-
minLength?: number;
|
|
55
|
-
maxLength?: number;
|
|
56
|
-
minimum?: number;
|
|
57
|
-
maximum?: number;
|
|
58
|
-
"x-format"?: string;
|
|
59
|
-
"x-vexData"?: string;
|
|
60
|
-
[key: string]: string | boolean | number | string[] | jsonSchemaPropsItem | {
|
|
61
|
-
[key: string]: jsonSchemaPropsItem;
|
|
62
|
-
} | any[] | undefined;
|
|
63
|
-
}
|
|
64
|
-
export interface documentConfig {
|
|
65
|
-
documentName: string;
|
|
66
|
-
keyPrefix?: string;
|
|
67
|
-
methods: schemaMethod[];
|
|
68
|
-
}
|
|
69
|
-
export interface additionalKeyObj {
|
|
70
|
-
[key: string]: string;
|
|
71
|
-
}
|
|
72
|
-
export type schemaMethod = "get" | "getList" | "post" | "put" | "patch" | "delete" | "options" | "head" | "trace";
|
|
73
|
-
export declare const schemaMethodArr: schemaMethod[];
|
|
74
|
-
export type httpMethod = "get" | "post" | "put" | "patch" | "delete" | "options" | "head" | "trace";
|
|
75
|
-
export declare const httpMethodArr: httpMethod[];
|
package/dist/utils/common.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as types from "../types/types";
|
|
2
|
-
export declare const writtedFiles: string[];
|
|
3
|
-
export declare const relativePath: (fromPath: string, toPath: string) => string;
|
|
4
|
-
export declare function loadJson<T = any>(filePath: string, fileNotExistHandler?: () => T): T;
|
|
5
|
-
export declare function writeFile(title: string, destination: string, newContent: string): boolean;
|
|
6
|
-
export declare function copyDir(source: string, destination: string, compilerOptions: types.compilerOptions, overwrite?: boolean): void;
|
|
7
|
-
declare const _default: {
|
|
8
|
-
relativePath: (fromPath: string, toPath: string) => string;
|
|
9
|
-
copyDir: typeof copyDir;
|
|
10
|
-
loadJson: typeof loadJson;
|
|
11
|
-
writeFile: typeof writeFile;
|
|
12
|
-
};
|
|
13
|
-
export default _default;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as types from "../types/types";
|
|
2
|
-
export declare function getGenaratorHeaderComment(): string;
|
|
3
|
-
export declare function getSimpleHeaderComment(): string;
|
|
4
|
-
export declare function isUseOAuth(compilerOptions: types.compilerOptions): string[];
|
|
5
|
-
export declare const defaultCompilerOptions: types.compilerOptions;
|
|
6
|
-
declare const _default: {
|
|
7
|
-
defaultCompilerOptions: types.compilerOptions;
|
|
8
|
-
getGenaratorHeaderComment: typeof getGenaratorHeaderComment;
|
|
9
|
-
getSimpleHeaderComment: typeof getSimpleHeaderComment;
|
|
10
|
-
isUseOAuth: typeof isUseOAuth;
|
|
11
|
-
};
|
|
12
|
-
export default _default;
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
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,14 +0,0 @@
|
|
|
1
|
-
import * as types from "../types/types";
|
|
2
|
-
export declare function loadJsonSchema(jsonSchemaPath: string): types.jsonSchema | never;
|
|
3
|
-
export declare function cleanXcustomValue(schemaObj: {
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
}, additionalKeyArr?: string[] | types.additionalKeyObj): {
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
};
|
|
8
|
-
export declare function httpMethod(jsonSchemaMethod: string, documentName: string): types.httpMethod;
|
|
9
|
-
declare const _default: {
|
|
10
|
-
cleanXcustomValue: typeof cleanXcustomValue;
|
|
11
|
-
httpMethod: typeof httpMethod;
|
|
12
|
-
loadJsonSchema: typeof loadJsonSchema;
|
|
13
|
-
};
|
|
14
|
-
export default _default;
|
package/dist/utils/logger.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare function processing(msg: any, ...optionalParams: any[]): void;
|
|
2
|
-
export declare function writing(msg: any, ...optionalParams: any[]): void;
|
|
3
|
-
export declare function info(msg: any, ...optionalParams: any[]): void;
|
|
4
|
-
export declare function warn(msg: any, ...optionalParams: any[]): void;
|
|
5
|
-
export declare function error(msg: any, ...optionalParams: any[]): never;
|
|
6
|
-
declare const _default: {
|
|
7
|
-
process: typeof processing;
|
|
8
|
-
writing: typeof writing;
|
|
9
|
-
info: typeof info;
|
|
10
|
-
warn: typeof warn;
|
|
11
|
-
error: typeof error;
|
|
12
|
-
};
|
|
13
|
-
export default _default;
|