Merge branch 'main' into feat/audit-logs-saas-app

This commit is contained in:
Kiran K 2024-01-04 16:11:18 +05:30
commit e0c7592f33
3 changed files with 2400 additions and 1302 deletions

View File

@ -68,9 +68,9 @@ const adminPortalGroup = {
let client: Retraced.Client | null = null;
// Check if audit log is enabled for a given group
const auditLogEnabledFor = (groupId: string) => {
return auditLogEnabledGroup.includes(groupId);
};
// const auditLogEnabledFor = (groupId: string) => {
// return auditLogEnabledGroup.includes(groupId);
// };
// Create a Retraced client
const getClient = async () => {
@ -150,11 +150,16 @@ const reportEvent = async (params: ReportEventParams) => {
}
}
// Skip reporting if audit log is not enabled for the team
if (retracedEvent.group?.id && !auditLogEnabledFor(retracedEvent.group?.id)) {
if (!retracedEvent.group?.id) {
return;
}
if (auditLogEnabledGroup.length && !auditLogEnabledGroup.includes(retracedEvent.group?.id)) {
return;
}
console.log(retracedEvent);
await retracedClient.reportEvent(retracedEvent);
} catch (error: any) {
console.error('Error reporting event to Retraced', error);

3685
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -66,7 +66,7 @@
"chroma-js": "2.4.2",
"classnames": "2.5.1",
"cors": "2.8.5",
"daisyui": "4.4.24",
"daisyui": "4.5.0",
"i18next": "22.5.1",
"medium-zoom": "1.1.0",
"micromatch": "4.0.5",