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.
Files changed (68) hide show
  1. package/.eslintrc.json +37 -37
  2. package/.gitattributes +2 -2
  3. package/.github/workflows/npm-publish.yml +38 -0
  4. package/LICENSE +21 -21
  5. package/README.md +61 -52
  6. package/docs/developmentNote.md +23 -16
  7. package/docs/roadMap/RoadMap.md +30 -30
  8. package/docs/roadMap/v0-5-0.md +19 -19
  9. package/docs/roadMap/v0-6-0.md +6 -6
  10. package/docs/roadMap/v0-7-0.md +3 -3
  11. package/docs/vexJsonSchema.md +54 -40
  12. package/package.json +59 -65
  13. package/scripts/build.js +14 -0
  14. package/scripts/copyTsTemplates.js +24 -0
  15. package/tsconfig.json +121 -121
  16. package/vex.config.json +1 -1
  17. package/dist/_plugins/PassportGoogle.ts +0 -87
  18. package/dist/_plugins/oauthVerify.ts +0 -39
  19. package/dist/_roles/_RoleFactory.ts +0 -22
  20. package/dist/_services/VexDbConnector.ts +0 -70
  21. package/dist/_types/responseMsg.ts +0 -20
  22. package/dist/_utils/common.ts +0 -53
  23. package/dist/_utils/index.ts +0 -11
  24. package/dist/_utils/logger.ts +0 -50
  25. package/dist/_utils/response.ts +0 -27
  26. package/dist/cli.d.ts +0 -1
  27. package/dist/generators/app/openapi.generator.d.ts +0 -3
  28. package/dist/generators/app/server.generator.d.ts +0 -2
  29. package/dist/generators/app/server.template.d.ts +0 -5
  30. package/dist/generators/controller/controller.template.d.ts +0 -14
  31. package/dist/generators/controller/controllers.generator.d.ts +0 -7
  32. package/dist/generators/index.d.ts +0 -9
  33. package/dist/generators/middlewares/RBACmiddleware.generator.d.ts +0 -6
  34. package/dist/generators/middlewares/RBACmiddlewares.template.d.ts +0 -6
  35. package/dist/generators/project/packageJson.generator.d.ts +0 -6
  36. package/dist/generators/project/userSchema.generator.d.ts +0 -4
  37. package/dist/generators/role/role.generator.d.ts +0 -8
  38. package/dist/generators/role/role.template.d.ts +0 -8
  39. package/dist/generators/routes/oauth.generator.d.ts +0 -2
  40. package/dist/generators/routes/routes.generator.d.ts +0 -11
  41. package/dist/generators/routes/routes.template.d.ts +0 -11
  42. package/dist/generators/routes/swagger.generator.d.ts +0 -2
  43. package/dist/index.d.ts +0 -2
  44. package/dist/index.js +0 -1031
  45. package/dist/preprocess/jsonschemaFormat.d.ts +0 -2
  46. package/dist/preprocess/roleSetupFile.d.ts +0 -9
  47. package/dist/templates/_plugins/PassportGoogle.ts +0 -87
  48. package/dist/templates/_plugins/oauthVerify.ts +0 -39
  49. package/dist/templates/_roles/_RoleFactory.d.ts +0 -10
  50. package/dist/templates/_roles/_RoleFactory.ts +0 -22
  51. package/dist/templates/_services/VexDbConnector.ts +0 -70
  52. package/dist/templates/_types/responseMsg.ts +0 -20
  53. package/dist/templates/_utils/common.ts +0 -53
  54. package/dist/templates/_utils/index.ts +0 -11
  55. package/dist/templates/_utils/logger.ts +0 -50
  56. package/dist/templates/_utils/response.ts +0 -27
  57. package/dist/templates/jsonSchema/User.json +0 -56
  58. package/dist/templates/root/.env +0 -5
  59. package/dist/templates/root/package.json +0 -40
  60. package/dist/templates/root/tsconfig.json +0 -22
  61. package/dist/types/openapi.d.ts +0 -108
  62. package/dist/types/types.d.ts +0 -75
  63. package/dist/utils/common.d.ts +0 -13
  64. package/dist/utils/configChecker.d.ts +0 -6
  65. package/dist/utils/generator.d.ts +0 -12
  66. package/dist/utils/index.d.ts +0 -30
  67. package/dist/utils/jsonSchema.d.ts +0 -14
  68. package/dist/utils/logger.d.ts +0 -13
@@ -1,2 +0,0 @@
1
- import * as types from "./../types/types";
2
- export declare function formatJsonSchema(jsonSchemaPath: string, compilerOptions: types.compilerOptions): types.jsonSchema;
@@ -1,9 +0,0 @@
1
- import * as types from "./../types/types";
2
- export declare function roleSetupFile(options: {
3
- collectionList: string[];
4
- roleSetupDir: string;
5
- compilerOptions: types.compilerOptions;
6
- }): void;
7
- export declare function roleSchemaFormat(options: {
8
- compilerOptions: types.compilerOptions;
9
- }): void;
@@ -1,87 +0,0 @@
1
- // {{headerComment}}
2
-
3
- import { Router } from "express";
4
- import passport, { PassportStatic, Profile } from "passport";
5
- import { AuthenticateOptionsGoogle, Strategy as GoogleStrategy, StrategyOptions, VerifyCallback } from "passport-google-oauth20";
6
- import log from "./../../system/_utils/logger.gen";
7
- import { UserModel } from "./../_models/UserModel.gen";
8
-
9
- export type { Profile };
10
-
11
- export interface passportGoogleConfig {
12
- strategyConfig: {
13
- options?: StrategyOptions,
14
- verify: (accessToken: string, refreshToken: string, profile: Profile, done: VerifyCallback) => void
15
- },
16
- authenticateOptionsGoogle?: AuthenticateOptionsGoogle,
17
- }
18
-
19
- /** Provides a router and passport instance for Google OAuth */
20
- export default class PassportGoogle {
21
-
22
- private config: passportGoogleConfig;
23
- public router: Router = Router();
24
- public passport: PassportStatic = passport;
25
-
26
- constructor(config: passportGoogleConfig ) {
27
-
28
- this.config = config;
29
-
30
- this.passport.use(new GoogleStrategy(
31
- this.config.strategyConfig.options || {
32
- clientID: process.env.OAUTH_GOOGLE_CLIENTID || "",
33
- clientSecret: process.env.OAUTH_GOOGLE_CLIENTSECRET || "",
34
- callbackURL: `${process.env.APP_HOST}/auth/google/callback`,
35
- },
36
- this.config.strategyConfig.verify
37
- ));
38
-
39
- // redirect to google login
40
- this.router.get("/auth/google",
41
- this.passport.authenticate("google", this.config.authenticateOptionsGoogle || { scope: ["profile", "email"] })
42
- );
43
-
44
- // back from google login
45
- this.router.get("/auth/google/callback",
46
- this.passport.authenticate("google", { failureRedirect: "/login" }),
47
- (req, res) => {
48
- res.redirect("/profile");
49
- }
50
- );
51
- }
52
-
53
- public passportSerializeUser() {
54
- this.passport.serializeUser(async (user, done) => {
55
- log.info("passportGoogle().serializeUser", user);
56
- // Here, you can choose what data to store in the session.
57
- // This data will be used in `deserializeUser` to retrieve the full user object.
58
- // This is typically just the user's ID.
59
-
60
- // store role in session for access control
61
- const DbUser = await UserModel.findById(user);
62
- if (DbUser) {
63
- done(null, DbUser);
64
- } else {
65
- done(new Error("User not found"));
66
- }
67
-
68
- done(null, user);
69
- });
70
- }
71
-
72
- public async passportDeserializeUser() {
73
- this.passport.deserializeUser(async (id, done) => {
74
- log.info("passportGoogle().deserializeUser", id);
75
-
76
- const user = await UserModel.findById(id);
77
- if (user) {
78
- done(null, user);
79
- }
80
- else {
81
- done(new Error("User not found"));
82
- }
83
-
84
- });
85
- }
86
-
87
- }
@@ -1,39 +0,0 @@
1
- // {{headerComment}}
2
-
3
- import { Profile } from "passport";
4
- import { UserModel } from "./../_models/UserModel.gen";
5
-
6
- interface IProfile extends Profile {
7
- [key: string]: any;
8
- }
9
-
10
- export default async function oauthVerify(accessToken: string, refreshToken: string, profile: IProfile, done: (error: any, user?: any) => void) : Promise<void> {
11
- try {
12
-
13
- // find or create user
14
- const existingUser = await UserModel.findOne({ email: profile.emails?.[0].value });
15
-
16
- if( existingUser ){
17
- // log.info('OAuthVerify ExistingUser');
18
- return done(null, existingUser);
19
- }
20
- else {
21
- // log.info('OAuthVerify NewUser');
22
- const newUser = new UserModel({
23
- authProvider: profile.provider,
24
- email: profile.emails?.[0].value || "",
25
- authId: profile.id,
26
- name: profile.displayName,
27
- familyName: profile.name?.familyName,
28
- givenName: profile.name?.givenName,
29
- isActive: true,
30
- locale: profile._json?.locale,
31
- });
32
- newUser.save();
33
- return done(null, newUser);
34
- }
35
- }
36
- catch(err) {
37
- return done(err);
38
- }
39
- }
@@ -1,10 +0,0 @@
1
- export type accessAction = "create" | "read" | "update" | "delete" | "search";
2
- export declare const accessActionArr: accessAction[];
3
- export interface accessControl<T = accessAction> {
4
- [key: string]: T[];
5
- }
6
- export declare class _RoleFactory<T = accessAction> {
7
- private accessControl;
8
- constructor(accessControl: accessControl<T>);
9
- checkAccess(document: string, access: string): boolean;
10
- }
@@ -1,22 +0,0 @@
1
- export type accessAction = "create" | "read" | "update" | "delete" | "search";
2
- export const accessActionArr: accessAction[] = ["create", "read", "update", "delete", "search"];
3
-
4
- export interface accessControl< T = accessAction > {
5
- [key:string]: T[]
6
- }
7
-
8
- export class _RoleFactory<T = accessAction> {
9
- private accessControl: accessControl<T> = {};
10
-
11
- constructor(accessControl: accessControl<T>) {
12
- this.accessControl = accessControl;
13
- }
14
-
15
- public checkAccess(document: string, access: string): boolean {
16
- if (this.accessControl[document]) {
17
- return this.accessControl[document].includes(access as T);
18
- }
19
- return false;
20
- }
21
-
22
- }
@@ -1,70 +0,0 @@
1
- // {{headerComment}}
2
-
3
- import mongoose from "mongoose";
4
- import { Request, Response, NextFunction } from "express";
5
- import vex from "./../_utils/index.gen";
6
-
7
- export default class VexDbConnector {
8
- private mongoUrl: string;
9
- private sqlUrl: string;
10
-
11
-
12
- constructor(options:{
13
- mongoUrl?: string;
14
- sqlUrl?: string;
15
- }){
16
- this.mongoUrl = options.mongoUrl || "";
17
- this.sqlUrl = options.sqlUrl || "";
18
- }
19
-
20
- connectMongo() : mongoose.Connection | void {
21
- if ( !this.mongoUrl ){
22
- vex.log.error(`VexDbConnector : MongoUrl is not invalid "${this.mongoUrl}"`);
23
- return;
24
- }
25
- /**
26
- * @param retryTime time in second
27
- */
28
- const connectWithRetry = (retryTime: number = 10) : Promise<void | typeof mongoose> => {
29
- // vex.log.infoMongo("Connection with retry");
30
- return mongoose.connect(this.mongoUrl, {
31
- autoCreate: true,
32
- connectTimeoutMS: 5000,
33
- })
34
- .catch((err) => {
35
- vex.log.errorMongo(`Failed to Connect DB, Retrying in ${retryTime} seconds.`, err);
36
- setTimeout(connectWithRetry, retryTime*1000);
37
- });
38
- };
39
- connectWithRetry(10);
40
-
41
- mongoose.connection.on("open", () => {
42
- vex.log.infoMongo("MongoDB Connection open : " + this.mongoUrl);
43
- });
44
-
45
- mongoose.connection.on("error", (err: any) => {
46
- vex.log.errorMongo("MongoDB Connection error:", err.message, err);
47
- });
48
-
49
- return mongoose.connection;
50
- }
51
-
52
- middleware(req: Request, res: Response, next: NextFunction) {
53
- if (mongoose.connection.readyState !== 1) {
54
- vex.response.send(res, 503, "Database Connection Down");
55
- }
56
- else {
57
- mongoose.connection.collection("accessLogs").insertOne({
58
- timestamp: new Date().getTime(),
59
- ipa: req.socket.remoteAddress || req.headers["x-forwarded-for"],
60
- method: req.method,
61
- url: req.url.split("?")[0],
62
- headers: req.headers,
63
- // body: req.body,
64
- query: req.query,
65
- });
66
-
67
- next();
68
- }
69
- }
70
- }
@@ -1,20 +0,0 @@
1
- export enum responseMsg {
2
- permissionDeny = "Permission Denied",
3
- ok = "OK",
4
- notFound = "Not Found",
5
- queryError = "Query Error",
6
- validateError = "Validation Error",
7
- unexpectedError = "Unexpected Error",
8
- createFail = "Create Fail",
9
- updateFail = "Update Fail",
10
- deleteFail = "Delete Fail",
11
- }
12
-
13
- export interface responseObject<T>{
14
- ret_code : number,
15
- ret_msg : string,
16
- ret_time?: number,
17
- result: T,
18
- }
19
-
20
- export default responseMsg;
@@ -1,53 +0,0 @@
1
- // {{headerComment}}
2
-
3
- import jsYaml from "js-yaml";
4
- import fs from "fs";
5
-
6
- export function loadYaml(yamlFilePath: string) {
7
- try {
8
- return jsYaml.load(fs.readFileSync(yamlFilePath, "utf8"));
9
- } catch (e: any) {
10
- console.log("\x1b[41m%s\x1b[0m", "[ERROR]", "Error Load OpenApi File :\n", e);
11
- process.exit(0);
12
- }
13
- }
14
-
15
- /**
16
- * build mongoose select object
17
- * @param fieldsString json stringified array of string
18
- * @error may throw an error if the fieldsString is not a valid JSON
19
- */
20
- export function parseFieldsSelect(selectString: any) : { [key: string]: number } | undefined {
21
- const ErrorArrStrMsg = "Invalid select string, only array of string accepted";
22
-
23
- if (typeof selectString === "undefined" || selectString === "") {
24
- return undefined;
25
- }
26
- else if (typeof selectString !== "string") {
27
- throw new Error(ErrorArrStrMsg);
28
- }
29
-
30
- const fieldArr: string[] = JSON.parse(selectString);
31
-
32
- if (!Array.isArray(fieldArr)) {
33
- throw new Error(ErrorArrStrMsg);
34
- }
35
-
36
- for (let i = 0; i < fieldArr.length; i++) {
37
- if (typeof fieldArr[i] !== "string") {
38
- throw new Error(ErrorArrStrMsg);
39
- }
40
- }
41
- // Convert the fieldArr to an object that can be used in the select method
42
- const selectFields = fieldArr.reduce((obj: any, field: string) => {
43
- obj[field] = 1;
44
- return obj;
45
- }, {} as Record<string, number>);
46
-
47
- return selectFields;
48
- }
49
-
50
- export default {
51
- loadYaml,
52
- parseFieldsSelect
53
- };
@@ -1,11 +0,0 @@
1
- import logger from "./logger.gen";
2
- import response from "./response.gen";
3
- import { responseMsg } from "./../_types/responseMsg.gen";
4
- import common from "./common.gen";
5
-
6
- export default {
7
- log : logger,
8
- response,
9
- responseMsg : responseMsg ,
10
- common
11
- };
@@ -1,50 +0,0 @@
1
- export function processing(msg: any, ...optionalParams: any[]): void {
2
- console.log("\x1b[34m%s\x1b[0m", "[PROCESSING]", msg, optionalParams.length > 0 ? optionalParams : "");
3
- }
4
-
5
- export function ok(msg: any, ...optionalParams: any[]): void {
6
- console.log("\x1b[32m%s\x1b[0m", "[OK]", msg, optionalParams.length > 0 ? optionalParams : "");
7
- }
8
-
9
- export function info(msg: any, ...optionalParams: any[]): void {
10
- console.log("\x1b[36m%s\x1b[0m", "[INFO]", msg, optionalParams.length > 0 ? optionalParams : "");
11
- }
12
-
13
- export function warn(msg: any, ...optionalParams: any[]): void {
14
- console.log("\x1b[33m%s\x1b[0m", "[WARN]", msg, optionalParams.length > 0 ? optionalParams : "");
15
- }
16
-
17
- export function error(msg: any, ...optionalParams: any[]): never {
18
- console.log("\x1b[41m%s\x1b[0m", "[ERROR]", msg, optionalParams.length > 0 ? optionalParams : "");
19
- process.exit(1);
20
- }
21
-
22
- // wrapper
23
- export function infoMongo(msg: any, ...optionalParams: any[]): void {
24
- info("[MONGO]", msg, optionalParams);
25
- }
26
-
27
- export function errorMongo(msg: any, ...optionalParams: any[]): never {
28
- error("[MONGO]", msg, optionalParams);
29
- }
30
-
31
- export function infoSql(msg: any, ...optionalParams: any[]): void {
32
- info("[SQL]", msg, optionalParams);
33
- }
34
-
35
- export function errorSql(msg: any, ...optionalParams: any[]): never {
36
- error("[SQL]", msg, optionalParams);
37
- }
38
-
39
- export default {
40
- process : processing,
41
- ok,
42
- info,
43
- warn,
44
- error,
45
-
46
- infoMongo,
47
- errorMongo,
48
- infoSql,
49
- errorSql,
50
- };
@@ -1,27 +0,0 @@
1
- import { Response } from "express";
2
- // import { responseObject } from "./../_types/responseMsg.gen";
3
-
4
- /**
5
- * @param res express response object
6
- * @param code http status
7
- * @param message response data message
8
- * @param result response data result
9
- * @returns express response object
10
- */
11
- export function send<T = undefined>(
12
- res: Response,
13
- code: number = 200,
14
- message: string = "OK",
15
- result?: T,
16
- ): Response<any, Record<string, any>> {
17
- return res.status(code).json({
18
- ret_code: code,
19
- ret_msg: message,
20
- ret_time: new Date().getTime(),
21
- result: result,
22
- });
23
- }
24
-
25
- export default {
26
- send
27
- };
@@ -1,56 +0,0 @@
1
- {
2
- "type": "object",
3
- "x-documentConfig": {
4
- "methods": [
5
- "get",
6
- "getList",
7
- "post",
8
- "patch"
9
- ]
10
- },
11
- "properties": {
12
- "_id": {
13
- "type": "string",
14
- "index": true
15
- },
16
- "authProvider": {
17
- "type": "string"
18
- },
19
- "authId": {
20
- "type": "string",
21
- "index": true
22
- },
23
- "email": {
24
- "type": "string",
25
- "format": "email",
26
- "index": true,
27
- "required": true
28
- },
29
- "name": {
30
- "type": "string",
31
- "maxLength": 64,
32
- "required": true
33
- },
34
- "active": {
35
- "type": "boolean",
36
- "default": true,
37
- "required": true
38
- },
39
- "locale": {
40
- "type": "string",
41
- "maxLength": 8
42
- },
43
- "roles":{
44
- "type": "array",
45
- "x-vexData": "role",
46
- "items": {
47
- "type": "string",
48
- "default": "user",
49
- "required": true,
50
- "enum": [
51
- "user"
52
- ]
53
- }
54
- }
55
- }
56
- }
@@ -1,5 +0,0 @@
1
- APP_HOST=http://localhost:3000
2
- MONGODB_URI=mongodb://localhost:27017/veryExpressDB
3
-
4
- OAUTH_GOOGLE_CLIENTID=
5
- OAUTH_GOOGLE_CLIENTSECRET=
@@ -1,40 +0,0 @@
1
- {
2
- "main": "index.js",
3
- "scripts": {
4
- "build": "tsc -p .",
5
- "start": "node dist/server.js",
6
- "dev": "nodemon --watch src --exec ts-node src/server.ts"
7
- },
8
- "dependencies": {
9
- "dotenv": "^16.4.4",
10
- "express": "^4.18.2",
11
- "express-session": "^1.18.0",
12
- "express-validator": "^7.0.1",
13
- "helmet": "^7.1.0",
14
- "js-yaml": "^4.1.0",
15
- "mongo-ts-querystring": "^1.0.4",
16
- "mongodb": "^5.6.0",
17
- "mongoose": "^7.4.0",
18
- "passport": "^0.7.0",
19
- "passport-google-oauth20": "^2.0.0",
20
- "swagger-ui-express": "^5.0.0"
21
- },
22
- "devDependencies": {
23
- "@types/crypto-js": "^4.1.2",
24
- "@types/dotenv": "^8.2.0",
25
- "@types/express": "^4.17.17",
26
- "@types/express-session": "^1.17.10",
27
- "@types/express-validator": "^3.0.0",
28
- "@types/js-yaml": "^4.0.9",
29
- "@types/mongodb": "^4.0.7",
30
- "@types/node": "^20.4.2",
31
- "@types/passport": "^1.0.16",
32
- "@types/passport-google-oauth20": "^2.0.14",
33
- "@types/sequelize": "^4.28.15",
34
- "@types/swagger-ui-express": "^4.1.6",
35
- "@types/ws": "^8.5.5",
36
- "nodemon": "^2.0.22",
37
- "ts-node": "^10.9.1",
38
- "typescript": "^5.1.6"
39
- }
40
- }
@@ -1,22 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- /* Visit https://aka.ms/tsconfig to read more about this file */
4
-
5
- /* Language and Environment */
6
- "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
7
-
8
- /* Modules */
9
- "module": "commonjs", /* Specify what module code is generated. */
10
-
11
- /* Emit */
12
- "outDir": "./dist", /* Specify an output folder for all emitted files. */
13
- "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
14
- "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
15
- "allowArbitraryExtensions": true, /* Allow arbitrary file extensions. */
16
-
17
- /* Type Checking */
18
- "strict": true, /* Enable all strict type-checking options. */
19
- "skipLibCheck": true /* Skip type checking all .d.ts files. */
20
- }
21
- }
22
-
@@ -1,108 +0,0 @@
1
- export interface openapi {
2
- openapi: string;
3
- info: {
4
- title: string;
5
- description: string;
6
- version: string;
7
- };
8
- paths: paths;
9
- components: components;
10
- }
11
- export interface paths {
12
- [key: string]: {
13
- "x-collection"?: string;
14
- "x-documentName"?: string;
15
- summary?: string;
16
- get?: method;
17
- post?: method;
18
- put?: method;
19
- patch?: method;
20
- delete?: method;
21
- options?: method;
22
- head?: method;
23
- trace?: method;
24
- };
25
- }
26
- export interface method {
27
- summary?: string;
28
- operationId: string;
29
- tags: string[];
30
- parameters: parameter[];
31
- requestBody?: requestBody;
32
- responses: responses;
33
- }
34
- export interface parameter {
35
- name: string;
36
- in: "query" | "header" | "path" | "cookie";
37
- description?: string;
38
- required?: boolean;
39
- deprecated?: boolean;
40
- allowEmptyValue?: boolean;
41
- style?: string;
42
- explode?: boolean;
43
- allowReserved?: boolean;
44
- schema: {
45
- type: string;
46
- format?: string;
47
- "x-format"?: string;
48
- required?: string[];
49
- minLength?: number;
50
- maxLength?: number;
51
- minimum?: number;
52
- maximum?: number;
53
- enum?: string[];
54
- };
55
- example?: any;
56
- examples?: any;
57
- }
58
- export interface requestBody {
59
- description: string;
60
- required: boolean;
61
- content?: {
62
- "application/json": {
63
- schema: {
64
- $ref: string;
65
- };
66
- };
67
- };
68
- }
69
- export interface responses {
70
- [key: number]: responseItem;
71
- }
72
- export interface responseItem {
73
- description: string;
74
- content?: {
75
- "application/json"?: {
76
- schema: {
77
- $ref?: string;
78
- [key: string]: any;
79
- };
80
- };
81
- };
82
- }
83
- export interface components {
84
- schemas: {
85
- [key: string]: componentsSchemaValue;
86
- };
87
- }
88
- export interface componentsSchemaValue {
89
- type: string;
90
- items?: any;
91
- required?: string[];
92
- properties?: {
93
- [key: string]: fieldsItem;
94
- };
95
- }
96
- export interface fieldsItem {
97
- type: string;
98
- format?: string;
99
- minimum?: number;
100
- maximum?: number;
101
- minLength?: number;
102
- maxLength?: number;
103
- maxItems?: number;
104
- maxProperties?: number;
105
- uniqueItems?: boolean;
106
- enum?: string[];
107
- [key: string]: any;
108
- }