import { ActivitySummary, ResourceType, StreamActionType } from '@/modules/activitystream/domain/types' import { StreamActivityRecord, StreamScopeActivity } from '@/modules/activitystream/helpers/types' import { CommitCreateInput, CommitUpdateInput, ProjectUpdateInput, StreamUpdateInput, UpdateVersionInput } from '@/modules/core/graph/generated/graphql' import { CommitRecord, StreamAclRecord, StreamRecord } from '@/modules/core/helpers/types' export type GetActivity = ( streamId: string, start: Date, end: Date, filteredUser: string | null ) => Promise export type GetActiveUserStreams = ( start: Date, end: Date ) => Promise< { userId: string streamIds: string[] }[] > export type GetStreamActivity = (args: { streamId: string actionType: StreamActionType after?: Date before?: Date cursor?: Date limit?: number }) => Promise<{ items: StreamActivityRecord[]; cursor: string | null }> export type GetActivityCountByStreamId = ({ streamId, actionType, before, after }: { streamId: string actionType?: StreamActionType after?: Date before?: Date }) => Promise export type GetActivityCountByUserId = ({ userId, actionType, before, after }: { userId: string actionType?: StreamActionType after?: Date before?: Date }) => Promise export type GetTimelineCount = ({ userId, before, after }: { userId: string after?: Date before?: Date }) => Promise export type GetActivityCountByResourceId = ({ resourceId, actionType, before, after }: { resourceId: string actionType?: StreamActionType after?: Date before?: Date }) => Promise export type GetUserTimeline = ({ userId, before, after, cursor, limit }: { userId: string after?: Date before?: Date cursor?: Date limit?: number }) => Promise<{ cursor: string | null items: (StreamActivityRecord & StreamAclRecord)[] }> export type GetResourceActivity = ({ resourceType, resourceId, actionType, before, after, cursor, limit }: { resourceType: ResourceType resourceId: string actionType: StreamActionType after?: Date before?: Date cursor?: Date limit?: number }) => Promise<{ cursor: string | null items: StreamActivityRecord[] }> export type GetUserActivity = ({ userId, actionType, before, after, cursor, limit }: { userId: string actionType: StreamActionType after?: Date before?: Date cursor?: Date limit?: number }) => Promise<{ cursor: string | null items: StreamActivityRecord[] }> export type SaveActivity = (args: Omit) => Promise export type CreateActivitySummary = (args: { userId: string streamIds: string[] start: Date end: Date }) => Promise export type AddStreamCommentMentionActivity = (params: { streamId: string mentionAuthorId: string mentionTargetId: string commentId: string threadId: string }) => Promise export type AddStreamInviteDeclinedActivity = (params: { streamId: string inviteTargetId: string inviterId: string stream: StreamRecord }) => Promise export type AddStreamInviteSentOutActivity = (params: { streamId: string inviteTargetId: string | null inviterId: string inviteTargetEmail: string | null stream: StreamRecord }) => Promise export type AddStreamDeletedActivity = (params: { streamId: string deleterId: string }) => Promise export type AddStreamUpdatedActivity = (params: { streamId: string updaterId: string oldStream: StreamRecord newStream: StreamRecord update: ProjectUpdateInput | StreamUpdateInput }) => Promise export type AddStreamAccessRequestedActivity = (params: { streamId: string requesterId: string }) => Promise export type AddStreamAccessRequestDeclinedActivity = (params: { streamId: string requesterId: string declinerId: string }) => Promise export type AddCommitCreatedActivity = (params: { commitId: string streamId: string userId: string input: CommitCreateInput branchName: string modelId: string commit: CommitRecord }) => Promise export type AddCommitUpdatedActivity = (params: { commitId: string streamId: string userId: string originalCommit: CommitRecord update: CommitUpdateInput | UpdateVersionInput newCommit: CommitRecord }) => Promise export type AddCommitMovedActivity = (params: { commitId: string streamId: string userId: string originalBranchId: string newBranchId: string commit: CommitRecord }) => Promise export type AddCommitDeletedActivity = (params: { commitId: string streamId: string userId: string commit: CommitRecord branchId: string }) => Promise