Update what is being audit logged (#11833)
No need to audit log workflow runs as it's already a form of audit log. Add more audit log for other objects Rename MessagingTelemetry to MessagingMonitoring Merge Analytics and Audit in one (Audit) --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
@ -0,0 +1,54 @@
|
||||
import { CUSTOM_DOMAIN_ACTIVATED_EVENT } from 'src/engine/core-modules/audit/utils/events/track/custom-domain/custom-domain-activated';
|
||||
import { CUSTOM_DOMAIN_DEACTIVATED_EVENT } from 'src/engine/core-modules/audit/utils/events/track/custom-domain/custom-domain-deactivated';
|
||||
import { OBJECT_RECORD_CREATED_EVENT } from 'src/engine/core-modules/audit/utils/events/track/object-record/object-record-created';
|
||||
import { OBJECT_RECORD_DELETED_EVENT } from 'src/engine/core-modules/audit/utils/events/track/object-record/object-record-delete';
|
||||
import { OBJECT_RECORD_UPDATED_EVENT } from 'src/engine/core-modules/audit/utils/events/track/object-record/object-record-updated';
|
||||
import { GenericTrackEvent } from 'src/engine/core-modules/audit/utils/events/track/track';
|
||||
|
||||
export const fixtures: Array<GenericTrackEvent> = [
|
||||
{
|
||||
type: 'track',
|
||||
event: CUSTOM_DOMAIN_ACTIVATED_EVENT,
|
||||
timestamp: '2024-10-24T15:55:35.177',
|
||||
version: '1',
|
||||
userId: '20202020-9e3b-46d4-a556-88b9ddc2b034',
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
properties: {},
|
||||
},
|
||||
{
|
||||
type: 'track',
|
||||
event: CUSTOM_DOMAIN_DEACTIVATED_EVENT,
|
||||
timestamp: '2024-10-24T15:55:35.177',
|
||||
version: '1',
|
||||
userId: '20202020-9e3b-46d4-a556-88b9ddc2b034',
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
properties: {},
|
||||
},
|
||||
{
|
||||
type: 'track',
|
||||
event: OBJECT_RECORD_CREATED_EVENT,
|
||||
timestamp: '2024-10-24T15:55:35.177',
|
||||
version: '1',
|
||||
userId: '20202020-9e3b-46d4-a556-88b9ddc2b034',
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
properties: {},
|
||||
},
|
||||
{
|
||||
type: 'track',
|
||||
event: OBJECT_RECORD_UPDATED_EVENT,
|
||||
timestamp: '2024-10-24T15:55:35.177',
|
||||
version: '1',
|
||||
userId: '20202020-9e3b-46d4-a556-88b9ddc2b034',
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
properties: {},
|
||||
},
|
||||
{
|
||||
type: 'track',
|
||||
event: OBJECT_RECORD_DELETED_EVENT,
|
||||
timestamp: '2024-10-24T15:55:35.177',
|
||||
version: '1',
|
||||
userId: '20202020-9e3b-46d4-a556-88b9ddc2b034',
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
properties: {},
|
||||
},
|
||||
];
|
||||
@ -0,0 +1,38 @@
|
||||
/* eslint-disable no-console */
|
||||
import { createClient } from '@clickhouse/client';
|
||||
import { config } from 'dotenv';
|
||||
|
||||
import { fixtures } from './fixtures';
|
||||
|
||||
config({
|
||||
path: process.env.NODE_ENV === 'test' ? '.env.test' : '.env',
|
||||
override: true,
|
||||
});
|
||||
|
||||
const client = createClient({
|
||||
url: process.env.CLICKHOUSE_URL,
|
||||
});
|
||||
|
||||
async function seedEvents() {
|
||||
try {
|
||||
console.log(`⚡ Seeding ${fixtures.length} events...`);
|
||||
|
||||
await client.insert({
|
||||
table: 'auditEvent',
|
||||
values: fixtures,
|
||||
format: 'JSONEachRow',
|
||||
});
|
||||
|
||||
console.log('✅ All events seeded successfully');
|
||||
} catch (error) {
|
||||
console.error('Error seeding events:', error);
|
||||
throw error;
|
||||
} finally {
|
||||
await client.close();
|
||||
}
|
||||
}
|
||||
|
||||
seedEvents().catch((err) => {
|
||||
console.error('Seeding error:', err);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user