@@ -92,6 +92,14 @@ export const computeWebhooks = (
|
||||
type: 'string',
|
||||
example: '872cfcf1-c79f-42bc-877d-5829f06eb3f9',
|
||||
},
|
||||
userId: {
|
||||
type: 'string',
|
||||
example: '170ba418-85a2-4f91-8565-9cd714c6703a',
|
||||
},
|
||||
workspaceMemberId: {
|
||||
type: 'string',
|
||||
example: '9062a1e3-e066-49ba-8c4a-d869b6a0ca12',
|
||||
},
|
||||
webhookId: {
|
||||
type: 'string',
|
||||
example: '90056586-1228-4e03-a507-70140aa85c05',
|
||||
|
||||
@@ -19,6 +19,8 @@ export type CallWebhookJobData = {
|
||||
workspaceId: string;
|
||||
webhookId: string;
|
||||
eventDate: Date;
|
||||
userId?: string;
|
||||
workspaceMemberId?: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
record: any;
|
||||
updatedFields?: string[];
|
||||
|
||||
+2
@@ -38,6 +38,8 @@ export const transformEventBatchToWebhookEvents = ({
|
||||
workspaceId,
|
||||
webhookId,
|
||||
eventDate,
|
||||
userId: eventData.userId,
|
||||
workspaceMemberId: eventData.workspaceMemberId,
|
||||
record,
|
||||
...(updatedFields && { updatedFields }),
|
||||
secret,
|
||||
|
||||
+5
@@ -56,6 +56,7 @@ export const formatTwentyOrmEventToDatabaseBatchEvent = <
|
||||
const event = new ObjectRecordCreateEvent<T>();
|
||||
|
||||
event.userId = authContext?.user?.id;
|
||||
event.workspaceMemberId = authContext?.workspaceMemberId;
|
||||
event.recordId = after.id;
|
||||
event.properties = { after };
|
||||
|
||||
@@ -88,6 +89,7 @@ export const formatTwentyOrmEventToDatabaseBatchEvent = <
|
||||
const event = new ObjectRecordUpdateEvent<T>();
|
||||
|
||||
event.userId = authContext?.user?.id;
|
||||
event.workspaceMemberId = authContext?.workspaceMemberId;
|
||||
event.recordId = after.id;
|
||||
event.properties = {
|
||||
before,
|
||||
@@ -105,6 +107,7 @@ export const formatTwentyOrmEventToDatabaseBatchEvent = <
|
||||
const event = new ObjectRecordDeleteEvent<T>();
|
||||
|
||||
event.userId = authContext?.user?.id;
|
||||
event.workspaceMemberId = authContext?.workspaceMemberId;
|
||||
event.recordId = before.id;
|
||||
event.properties = { before };
|
||||
|
||||
@@ -116,6 +119,7 @@ export const formatTwentyOrmEventToDatabaseBatchEvent = <
|
||||
const event = new ObjectRecordDestroyEvent<T>();
|
||||
|
||||
event.userId = authContext?.user?.id;
|
||||
event.workspaceMemberId = authContext?.workspaceMemberId;
|
||||
event.recordId = before.id;
|
||||
event.properties = { before };
|
||||
|
||||
@@ -127,6 +131,7 @@ export const formatTwentyOrmEventToDatabaseBatchEvent = <
|
||||
const event = new ObjectRecordUpsertEvent<T>();
|
||||
|
||||
event.userId = authContext?.user?.id;
|
||||
event.workspaceMemberId = authContext?.workspaceMemberId;
|
||||
event.recordId = after.id;
|
||||
|
||||
const before = beforeEntities
|
||||
|
||||
Reference in New Issue
Block a user