* Add field options to mongo schema metadata * Add/fix test with fields options * Add required validation failing test * Add more tests * Only set default value if field is undefined * Fix redis test * Fix tests * Test for creating a new class with field options * Validate default value type * fix lint (weird) * Fix lint another way * Add tests for beforeSave trigger and solve small issue regarding the use of unset in the beforeSave trigger
33 lines
751 B
JavaScript
33 lines
751 B
JavaScript
export type LoadSchemaOptions = {
|
|
clearCache: boolean,
|
|
};
|
|
|
|
export type SchemaField = {
|
|
type: string,
|
|
targetClass?: ?string,
|
|
required?: ?boolean,
|
|
defaultValue?: ?any,
|
|
};
|
|
|
|
export type SchemaFields = { [string]: SchemaField };
|
|
|
|
export type Schema = {
|
|
className: string,
|
|
fields: SchemaFields,
|
|
classLevelPermissions: ClassLevelPermissions,
|
|
indexes?: ?any,
|
|
};
|
|
|
|
export type ClassLevelPermissions = {
|
|
find?: { [string]: boolean },
|
|
count?: { [string]: boolean },
|
|
get?: { [string]: boolean },
|
|
create?: { [string]: boolean },
|
|
update?: { [string]: boolean },
|
|
delete?: { [string]: boolean },
|
|
addField?: { [string]: boolean },
|
|
readUserFields?: string[],
|
|
writeUserFields?: string[],
|
|
protectedFields?: { [string]: string[] },
|
|
};
|