Files
speckle-server/packages/server/modules/comments/domain/events.ts
T
Kristaps Fabians Geikins 4b06f42db7 chore(server): run TS files directly (no compilation) (#5134)
* sort of works

* type fixes

* added option to run old way too
2025-07-23 11:20:40 +02:00

34 lines
1.0 KiB
TypeScript

import type {
CommentCreatedActivityInput,
ReplyCreatedActivityInput
} from '@/modules/activitystream/domain/types'
import type { ViewerResourceItem } from '@/modules/comments/domain/types'
import type { CommentRecord } from '@/modules/comments/helpers/types'
import type { MutationCommentArchiveArgs } from '@/modules/core/graph/generated/graphql'
export const commentEventsNamespace = 'comments' as const
export const CommentEvents = {
Created: `${commentEventsNamespace}.created`,
Updated: `${commentEventsNamespace}.updated`,
Archived: `${commentEventsNamespace}.archived`
} as const
export type CommentEventsPayloads = {
[CommentEvents.Created]: {
comment: CommentRecord
isThread: boolean
input: CommentCreatedActivityInput | ReplyCreatedActivityInput
resourceItems: ViewerResourceItem[]
}
[CommentEvents.Updated]: {
previousComment: CommentRecord
newComment: CommentRecord
}
[CommentEvents.Archived]: {
userId: string
input: MutationCommentArchiveArgs
comment: CommentRecord
}
}