mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-12 01:08:29 +03:00
Update webhook events to fire game and playtype
This commit is contained in:
@@ -118,6 +118,8 @@ export async function ProcessGoal(
|
||||
goalID: goal.goalID,
|
||||
old: oldData,
|
||||
new: newData,
|
||||
game: goal.game,
|
||||
playtype: goal.playtype,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -136,6 +136,8 @@ export async function UpdateUsersMilestones(
|
||||
content: {
|
||||
userID,
|
||||
...milestoneInfo,
|
||||
game,
|
||||
playtype: milestone.playtype,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -175,6 +175,9 @@ router.get("/:clientID", GetClientFromID, (req, res) => {
|
||||
*
|
||||
* @param name - Change the name of this client.
|
||||
* @param webhookUri - Change a bound webhookUri for this client.
|
||||
* @param redirectUri - Change a bound redirectUri for this client.
|
||||
* @param apiKeyFormat - Change the APIKeyFormat for this client.
|
||||
* @param apiKeyFilename - Change the APIKeyFilename for this client.
|
||||
*
|
||||
* @name PATCH /api/v1/clients/:clientID
|
||||
*/
|
||||
@@ -184,6 +187,18 @@ router.patch(
|
||||
RequireOwnershipOfClient,
|
||||
prValidate({
|
||||
name: p.optional(p.isBoundedString(3, 80)),
|
||||
apiKeyFormat: optNull((self) => {
|
||||
if (typeof self !== "string") {
|
||||
return "Expected a string.";
|
||||
}
|
||||
|
||||
if (!self.includes("%%TACHI_KEY%%")) {
|
||||
return "Must contain a %%TACHI_KEY%% placeholder.";
|
||||
}
|
||||
|
||||
return true;
|
||||
}),
|
||||
apiKeyFilename: p.optional(p.isBoundedString(3, 80)),
|
||||
webhookUri: optNull((self) => {
|
||||
if (typeof self !== "string") {
|
||||
return "Expected a string.";
|
||||
|
||||
@@ -72,7 +72,7 @@ export async function UpdateClassIfGreater(
|
||||
if (isGreater === null) {
|
||||
EmitWebhookEvent({
|
||||
type: "class-update/v1",
|
||||
content: { userID, new: classVal, old: null, set: classSet },
|
||||
content: { userID, new: classVal, old: null, set: classSet, game, playtype },
|
||||
});
|
||||
|
||||
return null;
|
||||
@@ -84,6 +84,8 @@ export async function UpdateClassIfGreater(
|
||||
new: classVal,
|
||||
old: userGameStats!.classes[classSet]!,
|
||||
set: classSet,
|
||||
game,
|
||||
playtype,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user