mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-04 21:08:09 +03:00
feat: add challenge types
This commit is contained in:
@@ -10,4 +10,5 @@ export const ALL_PERMISSIONS: Record<APIPermissions, true> = {
|
||||
manage_rivals: true,
|
||||
manage_targets: true,
|
||||
submit_score: true,
|
||||
manage_challenges: true,
|
||||
};
|
||||
|
||||
@@ -1392,6 +1392,7 @@ export type APIPermissions =
|
||||
| "customise_score"
|
||||
| "customise_session"
|
||||
| "delete_score"
|
||||
| "manage_challenges"
|
||||
| "manage_rivals"
|
||||
| "manage_targets"
|
||||
| "submit_score";
|
||||
@@ -1579,6 +1580,19 @@ interface BaseNotification {
|
||||
}
|
||||
|
||||
export type NotificationBody =
|
||||
| {
|
||||
type: "CHALLENGE_BEAT";
|
||||
content: {
|
||||
userID: integer;
|
||||
challengeSub: ChallengeSubscriptionDocument;
|
||||
};
|
||||
}
|
||||
| {
|
||||
type: "CHALLENGE_RECEIVED";
|
||||
content: {
|
||||
challenge: ChallengeWallDocument;
|
||||
};
|
||||
}
|
||||
| {
|
||||
type: "MILESTONE_CHANGED"; // Emitted when a milestone the user is subscribed to changed.
|
||||
content: {
|
||||
@@ -1597,3 +1611,25 @@ export type NotificationBody =
|
||||
export type NotificationDocument = BaseNotification & {
|
||||
body: NotificationBody;
|
||||
};
|
||||
|
||||
export interface ChallengeSubscriptionDocument {
|
||||
chartID: string;
|
||||
authorID: integer;
|
||||
type: "lamp" | "score";
|
||||
|
||||
game: Game;
|
||||
playtype: Playtype;
|
||||
|
||||
userID: integer;
|
||||
achieved: boolean;
|
||||
achievedAt: number | null;
|
||||
}
|
||||
|
||||
export interface ChallengeWallDocument {
|
||||
chartID: string;
|
||||
authorID: integer;
|
||||
type: "lamp" | "score";
|
||||
|
||||
game: Game;
|
||||
playtype: Playtype;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user