20 lines
581 B
TypeScript
20 lines
581 B
TypeScript
import { Request, Response } from 'express';
|
|
import ControlModel from '@scode/modelling';
|
|
|
|
type Authorization = {
|
|
(req: Request, res: Response): Promise<boolean>;
|
|
(req: Request, res: Response, next: Function): unknown;
|
|
}
|
|
|
|
interface DatabaseCrudOptions {
|
|
general_authorization?: Authorization;
|
|
create_authorization?: Authorization;
|
|
read_authorization?: Authorization;
|
|
update_authorization?: Authorization;
|
|
delete_authorization?: Authorization;
|
|
optional_columns?: Array<string>;
|
|
control_model?: Type<ControlModel>;
|
|
}
|
|
|
|
export { Authorization, DatabaseCrudOptions };
|