Browse Source

refactor(nocodb): add opTypes & opSubTypes

pull/5222/head
Wing-Kam Wong 2 years ago
parent
commit
111bd85fa8
  1. 1
      packages/nocodb-sdk/src/lib/Api.ts
  2. 47
      packages/nocodb/src/lib/models/Audit.ts

1
packages/nocodb-sdk/src/lib/Api.ts

@ -38,6 +38,7 @@ export interface ApiTokenReqType {
* Model for Attachment
*/
export interface AttachmentType {
/** Data for uploading */
data?: any;
icon?: string;
mimetype?: string;

47
packages/nocodb/src/lib/models/Audit.ts

@ -4,6 +4,49 @@ import Noco from '../Noco';
import Model from './Model';
import { extractProps } from '../meta/helpers/extractProps';
const opTypes = <const>[
'COMMENT',
'DATA',
'PROJECT',
'VIRTUAL_RELATION',
'RELATION',
'TABLE_VIEW',
'TABLE',
'VIEW',
'META',
'WEBHOOKS',
'AUTHENTICATION',
'TABLE_COLUMN',
'ORG_USER',
];
const opSubTypes = <const>[
'UPDATE',
'INSERT',
'BULK_INSERT',
'BULK_UPDATE',
'BULK_DELETE',
'LINK_RECORD',
'UNLINK_RECORD',
'DELETE',
'CREATED',
'DELETED',
'RENAMED',
'IMPORT_FROM_ZIP',
'EXPORT_TO_FS',
'EXPORT_TO_ZIP',
'UPDATED',
'SIGNIN',
'SIGN',
'PASSWORD_RESET',
'PASSWORD_FORGOT',
'PASSWORD_CHANGE',
'EMAIL_VERIFICATION',
'ROLES_MANAGEMENT',
'INVITE',
'RESEND_INVITE',
];
export default class Audit implements AuditType {
id?: string;
user?: string;
@ -12,8 +55,8 @@ export default class Audit implements AuditType {
project_id?: string;
fk_model_id?: string;
row_id?: string;
op_type?: string;
op_sub_type?: string;
op_type?: typeof opTypes[number];
op_sub_type?: typeof opSubTypes[number];
status?: string;
description?: string;
details?: string;

Loading…
Cancel
Save