all repos — stealth-developers @ 7a84b741bc2c10def09e4d5e05151d8224e8220d

frontend/src/types.ts (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
import type { APIGuildMember } from 'discord-api-types/v10'
export type User = APIGuildMember

export type Attachment = {
	id: string
	ownerType: 'ticket' | 'ticket_message' | 'bug'
	ownerId: number
	authorId: string | null
	fileName: string
	contentType: string
	size: number
	bucket: string
	key: string
	url: string
	uploadedAt: string
}

export type Ticket = {
	id: number
	anonymousId: string
	ticketNumber: number
	guildId: string
	channelId: string

	type: 'general'
	status: 'open' | 'archived' | 'closed'
	topic: string | null

	authorId: User
	openedBy: User
	addedUsers: string[]

	claimedBy: User | null
	claimedAt: string | null
	closedAt: string
	closedBy: User | 'reporter' | null
	closeReason: string | null
	privateReason: string | null

	thankedAt: string | null
	warnedAt: string | null

	createdAt: string
	attachments?: Attachment[]
}

export type Message = {
	id: number
	ticketId: number
	messageId: string | null
	authorId: string
	authorType: 'system' | 'staff' | 'reporter'
	content: string
	createdAt: string
	editedAt: string | null
	deletedAt: string | null
	author: User
	attachments?: Attachment[]
	mentions?: Record<string, User>
}