refactor: add missing schema definitions (#7917)

This commit is contained in:
Antoine Cormouls
2022-04-04 01:40:29 +02:00
committed by Manuel Trezza
parent e47b61de46
commit a169663304
5 changed files with 116 additions and 69 deletions

View File

@@ -1,5 +1,15 @@
// @flow
export interface SchemaOptions {
definitions: JSONSchema[];
strict: ?boolean;
deleteExtraFields: ?boolean;
recreateModifiedFields: ?boolean;
lockSchemas: ?boolean;
beforeMigration: ?() => void | Promise<void>;
afterMigration: ?() => void | Promise<void>;
}
export type FieldValueType =
| 'String'
| 'Boolean'
@@ -35,17 +45,6 @@ export interface IndexesInterface {
[key: string]: IndexInterface;
}
export interface SchemaOptions {
definitions: JSONSchema[];
strict: ?boolean;
deleteExtraFields: ?boolean;
recreateModifiedFields: ?boolean;
lockSchemas: ?boolean;
/* Callback when server has started and before running schemas migration operations if schemas key provided */
beforeMigration: ?() => void | Promise<void>;
afterMigration: ?() => void | Promise<void>;
}
export type CLPOperation = 'find' | 'count' | 'get' | 'update' | 'create' | 'delete';
// @Typescript 4.1+ // type CLPPermission = 'requiresAuthentication' | '*' | `user:${string}` | `role:${string}`