From 8443662844fb72fcb4f73dc997821a6a559f064f Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Mon, 24 Jun 2024 08:28:49 +0000 Subject: [PATCH] fix(nc-gui): revert audit type changes --- packages/nocodb/src/models/Audit.ts | 45 +++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/models/Audit.ts b/packages/nocodb/src/models/Audit.ts index 2c027e3e0e..7ed16024b7 100644 --- a/packages/nocodb/src/models/Audit.ts +++ b/packages/nocodb/src/models/Audit.ts @@ -4,6 +4,47 @@ import Noco from '~/Noco'; import { extractProps } from '~/helpers/extractProps'; import { MetaTable, RootScopes } from '~/utils/globals'; +const opTypes = [ + 'COMMENT', + 'DATA', + 'PROJECT', + 'VIRTUAL_RELATION', + 'RELATION', + 'TABLE_VIEW', + 'TABLE', + 'VIEW', + 'META', + 'WEBHOOKS', + 'AUTHENTICATION', + 'TABLE_COLUMN', + 'ORG_USER', +]; + +const opSubTypes = [ + 'UPDATE', + 'INSERT', + 'BULK_INSERT', + 'BULK_UPDATE', + 'BULK_DELETE', + 'LINK_RECORD', + 'UNLINK_RECORD', + 'DELETE', + 'CREATE', + 'RENAME', + 'IMPORT_FROM_ZIP', + 'EXPORT_TO_FS', + 'EXPORT_TO_ZIP', + 'SIGNIN', + 'SIGNUP', + 'PASSWORD_RESET', + 'PASSWORD_FORGOT', + 'PASSWORD_CHANGE', + 'EMAIL_VERIFICATION', + 'ROLES_MANAGEMENT', + 'INVITE', + 'RESEND_INVITE', +]; + export default class Audit implements AuditType { id?: string; user?: string; @@ -13,8 +54,8 @@ export default class Audit implements AuditType { base_id?: string; fk_model_id?: string; row_id?: string; - op_type?: AuditOperationTypes; - op_sub_type?: AuditOperationSubTypes; + op_type?: (typeof opTypes)[number]; + op_sub_type?: (typeof opSubTypes)[number]; status?: string; description?: string; details?: string;