mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-11 08:48:15 +03:00
Add new webhook code
This commit is contained in:
@@ -5,3 +5,4 @@ export * as gameClasses from "./game-classes";
|
||||
export * as ESDCore from "./lib/esd";
|
||||
export * as StaticConfig from "./config/static-config";
|
||||
export * from "./utils/util";
|
||||
export * from "./webhooks";
|
||||
|
||||
+1
-24
@@ -1,6 +1,6 @@
|
||||
import { IObjectID } from "monk";
|
||||
import { FilterQuery } from "mongodb";
|
||||
import { AllClassSets, GameClasses, GameClassSets } from "./game-classes";
|
||||
import { AllClassSets, GameClasses } from "./game-classes";
|
||||
|
||||
export interface CounterDocument {
|
||||
counterName: string;
|
||||
@@ -1256,29 +1256,6 @@ export interface BMSCourseDocument {
|
||||
value: integer;
|
||||
}
|
||||
|
||||
export type RedisIPCChannels = "class-update" | "goal-achieved" | "milestone-achieved";
|
||||
|
||||
export type RedisIPCData = {
|
||||
"class-update": {
|
||||
userID: integer;
|
||||
set: GameClassSets[IDStrings];
|
||||
old: integer | null;
|
||||
new: integer | null;
|
||||
};
|
||||
"goal-achieved": {
|
||||
userID: integer;
|
||||
goalID: string;
|
||||
old: GoalImportStat;
|
||||
new: GoalImportStat;
|
||||
};
|
||||
"milestone-achieved": {
|
||||
userID: integer;
|
||||
milestoneID: string;
|
||||
old: MilestoneImportStat;
|
||||
new: MilestoneImportStat;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* All the permissions a token may have.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
import { GameClassSets } from "./game-classes";
|
||||
import { GoalImportStat, IDStrings, integer, MilestoneImportStat } from "./types";
|
||||
|
||||
/**
|
||||
* An event fired when a users class improves.
|
||||
*/
|
||||
export interface WebhookEventClassUpdateV1 {
|
||||
type: "class-update/v1";
|
||||
content: {
|
||||
userID: integer;
|
||||
set: GameClassSets[IDStrings];
|
||||
old: integer | null;
|
||||
new: integer | null;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* An event fired when a goal is achieved.
|
||||
*/
|
||||
export interface WebhookEventGoalAchievedV1 {
|
||||
type: "goal-achieved/v1";
|
||||
content: {
|
||||
userID: integer;
|
||||
goalID: string;
|
||||
old: GoalImportStat;
|
||||
new: GoalImportStat;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* An event fired when a milestone is achieved.
|
||||
*/
|
||||
export interface WebhookEventMilestoneAchievedV1 {
|
||||
type: "milestone-achieved/v1";
|
||||
content: {
|
||||
userID: integer;
|
||||
milestoneID: string;
|
||||
old: MilestoneImportStat;
|
||||
new: MilestoneImportStat;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* An event used for debugging. Contains information about the
|
||||
* registered client and the server.
|
||||
*/
|
||||
export interface WebhookEventStatusV1 {
|
||||
type: "status/v1";
|
||||
content: {
|
||||
clientName: string;
|
||||
clientID: string;
|
||||
serverVersion: string;
|
||||
};
|
||||
}
|
||||
|
||||
export type WebhookEvents =
|
||||
| WebhookEventClassUpdateV1
|
||||
| WebhookEventGoalAchievedV1
|
||||
| WebhookEventMilestoneAchievedV1;
|
||||
Reference in New Issue
Block a user