all repos — stealth-developers @ a78eed8b66665f02ed3de6a3c6749c475061b59e

pkgs/api/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
export type DateString = string;

export type User = {
	id: string;
	name: string;
	avatarUrl: string;
	isModerator: boolean;
};

export type Ticket = {
	number: string;
	status: "open" | "closed" | "archived";

	closedBy: User | null;
	closedAt: DateString | null;

	/** the reason the ticket was opened if it was not opened by the subject */
	topic: string | null;
	closeReason: string | null;
	privateReason: string | null;

	openedAt: DateString;
	/** the user who opened the ticket, if it was not opened by the subject */
	openedBy: User | null;
	/** the user who is the subject of the ticket, i.e. the reporter */
	subject: User;
};

export type Message = {
	id: number;
	messageId: string | null;

	createdAt: DateString;
	updatedAt: DateString | null;
	deletedAt: DateString | null;

	author: User;
	authorType: "user" | "staff" | "system";

	content: string;
	attachments: Attachment[];
	mentions: User[];
};

export type Attachment = {
	id: string;
	ownerType: "ticket" | "ticket_message" | "bug";
	owner: User | null;

	fileName: string;
	contentType: string;
	size: number;

	bucket: string;
	key: string;
	url: string;

	uploadedAt: DateString;
};