rhythia-api 233.0.0 → 235.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex +0 -0
- package/.env +1 -12
- package/README.md +4 -4
- package/api/acceptInvite.ts +1 -1
- package/api/addCollectionMap.ts +1 -1
- package/api/chartPublicStats.ts +1 -1
- package/api/checkQualified.ts +93 -93
- package/api/createBeatmap.ts +53 -62
- package/api/createBeatmapPage.ts +1 -1
- package/api/createClan.ts +1 -1
- package/api/createCollection.ts +1 -1
- package/api/createInvite.ts +1 -1
- package/api/createSupporter.ts +1 -1
- package/api/deleteBeatmapPage.ts +2 -5
- package/api/deleteCollection.ts +1 -1
- package/api/deleteCollectionMap.ts +1 -1
- package/api/editAboutMe.ts +1 -1
- package/api/editClan.ts +1 -1
- package/api/editCollection.ts +1 -2
- package/api/editProfile.ts +1 -1
- package/api/enhancedSearch.ts +113 -113
- package/api/executeAdminOperation.ts +1 -22
- package/api/getAvatarUploadUrl.ts +1 -1
- package/api/getBadgeLeaders.ts +1 -1
- package/api/getBadgedUsers.ts +1 -1
- package/api/getBeatmapComments.ts +1 -1
- package/api/getBeatmapPage.ts +74 -106
- package/api/getBeatmapPageById.ts +70 -109
- package/api/getBeatmapStarRating.ts +1 -1
- package/api/getBeatmaps.ts +123 -93
- package/api/getClan.ts +1 -1
- package/api/getClans.ts +1 -1
- package/api/getCollection.ts +1 -1
- package/api/getCollections.ts +1 -1
- package/api/getInventory.ts +1 -1
- package/api/getLeaderboard.ts +1 -1
- package/api/getMapUploadUrl.ts +2 -2
- package/api/getOnlinePlayers.ts +1 -1
- package/api/getPassToken.ts +1 -1
- package/api/getProfile.ts +51 -31
- package/api/getPublicStats.ts +5 -5
- package/api/getRawStarRating.ts +1 -1
- package/api/getScore.ts +1 -1
- package/api/getStoryBeatmaps.ts +1 -1
- package/api/getTimestamp.ts +1 -1
- package/api/getUserScores.ts +19 -19
- package/api/getVerified.ts +1 -1
- package/api/getVideoUploadUrl.ts +1 -1
- package/api/postBeatmapComment.ts +1 -1
- package/api/qualifyMap.ts +97 -92
- package/api/rankMapsArchive.ts +20 -20
- package/api/searchUsers.ts +1 -1
- package/api/setPasskey.ts +1 -1
- package/api/submitScore.ts +1 -6
- package/api/submitScoreInternal.ts +461 -449
- package/api/updateBeatmapPage.ts +1 -1
- package/api/vetoMap.ts +101 -101
- package/index.ts +180 -167
- package/package.json +7 -12
- package/queries/admin_delete_user.sql +39 -39
- package/queries/admin_exclude_user.sql +21 -21
- package/queries/admin_invalidate_ranked_scores.sql +18 -18
- package/queries/admin_log_action.sql +10 -10
- package/queries/admin_profanity_clear.sql +29 -29
- package/queries/admin_remove_all_scores.sql +29 -29
- package/queries/admin_restrict_user.sql +21 -21
- package/queries/admin_search_users.sql +24 -24
- package/queries/admin_silence_user.sql +21 -21
- package/queries/admin_unban_user.sql +21 -21
- package/queries/enhanced_search.sql +217 -217
- package/queries/get_badge_leaderboard.sql +50 -50
- package/queries/get_clan_leaderboard.sql +68 -68
- package/queries/get_collections_v4.sql +109 -109
- package/queries/get_top_scores_for_beatmap.sql +44 -44
- package/queries/get_top_scores_for_beatmap3.sql +38 -0
- package/queries/get_user_by_email.sql +32 -32
- package/queries/get_user_scores_lastday.sql +47 -47
- package/queries/get_user_scores_reign.sql +31 -31
- package/queries/get_user_scores_top_and_stats.sql +84 -84
- package/queries/grant_special_badges.sql +69 -69
- package/types/database.ts +1288 -1248
- package/utils/beatmapTopScores.ts +84 -0
- package/utils/mapLifecycleWebhook.ts +287 -277
- package/utils/requestGeo.ts +13 -0
- package/utils/requestUtils.ts +127 -127
- package/utils/response.ts +11 -0
- package/worker.ts +189 -0
- package/wrangler.jsonc +10 -0
- package/index.html +0 -3
- package/vercel.json +0 -13
package/api/updateBeatmapPage.ts
CHANGED
package/api/vetoMap.ts
CHANGED
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
import { NextResponse } from "
|
|
2
|
-
import z from "zod";
|
|
3
|
-
import { protectedApi, validUser } from "../utils/requestUtils";
|
|
4
|
-
import { supabase } from "../utils/supabase";
|
|
5
|
-
import { getUserBySession } from "../utils/getUserBySession";
|
|
6
|
-
import { User } from "@supabase/supabase-js";
|
|
7
|
-
import { postMapLifecycleWebhook } from "../utils/mapLifecycleWebhook";
|
|
8
|
-
|
|
9
|
-
const VETO_BADGES = ["Team Ranked"];
|
|
10
|
-
|
|
11
|
-
export const Schema = {
|
|
12
|
-
input: z.strictObject({
|
|
13
|
-
session: z.string(),
|
|
14
|
-
mapId: z.number(),
|
|
15
|
-
reason: z.string().min(1).max(1000),
|
|
16
|
-
}),
|
|
17
|
-
output: z.object({
|
|
18
|
-
error: z.string().optional(),
|
|
19
|
-
}),
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export async function POST(request: Request) {
|
|
23
|
-
return protectedApi({
|
|
24
|
-
request,
|
|
25
|
-
schema: Schema,
|
|
26
|
-
authorization: validUser,
|
|
27
|
-
activity: handler,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export async function handler(data: (typeof Schema)["input"]["_type"]) {
|
|
32
|
-
const user = (await getUserBySession(data.session)) as User;
|
|
33
|
-
const { data: queryUserData } = await supabase
|
|
34
|
-
.from("profiles")
|
|
35
|
-
.select("*")
|
|
36
|
-
.eq("uid", user.id)
|
|
37
|
-
.single();
|
|
38
|
-
|
|
39
|
-
if (!queryUserData) {
|
|
40
|
-
return NextResponse.json({ error: "Can't find user" });
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const tags = (queryUserData?.badges || []) as string[];
|
|
44
|
-
const hasVetoAccess = VETO_BADGES.some((badge) => tags.includes(badge));
|
|
45
|
-
|
|
46
|
-
if (!hasVetoAccess) {
|
|
47
|
-
return NextResponse.json({ error: "Only management can veto maps!" });
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const { data: mapData } = await supabase
|
|
51
|
-
.from("beatmapPages")
|
|
52
|
-
.select("id,qualified")
|
|
53
|
-
.eq("id", data.mapId)
|
|
54
|
-
.single();
|
|
55
|
-
|
|
56
|
-
if (!mapData) {
|
|
57
|
-
return NextResponse.json({ error: "Bad map" });
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (!mapData.qualified) {
|
|
61
|
-
return NextResponse.json({
|
|
62
|
-
error: "Only qualified maps can be vetoed",
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const { data: vetoData, error: vetoError } = await supabase
|
|
67
|
-
.from("vetos")
|
|
68
|
-
.insert({
|
|
69
|
-
beatmapPage: data.mapId,
|
|
70
|
-
user: queryUserData.id,
|
|
71
|
-
veto_reason: data.reason,
|
|
72
|
-
})
|
|
73
|
-
.select("id")
|
|
74
|
-
.single();
|
|
75
|
-
|
|
76
|
-
if (vetoError) {
|
|
77
|
-
return NextResponse.json({ error: vetoError.message });
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const { error: updateError } = await supabase.from("beatmapPages").upsert({
|
|
81
|
-
id: data.mapId,
|
|
82
|
-
qualified: false,
|
|
83
|
-
qualifiedAt: null,
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
if (updateError) {
|
|
87
|
-
if (vetoData?.id) {
|
|
88
|
-
await supabase.from("vetos").delete().eq("id", vetoData.id);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return NextResponse.json({ error: updateError.message });
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
await postMapLifecycleWebhook({
|
|
95
|
-
mapId: data.mapId,
|
|
96
|
-
event: "vetoed",
|
|
97
|
-
vetoReason: data.reason,
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
return NextResponse.json({});
|
|
101
|
-
}
|
|
1
|
+
import { NextResponse } from "../utils/response";
|
|
2
|
+
import z from "zod";
|
|
3
|
+
import { protectedApi, validUser } from "../utils/requestUtils";
|
|
4
|
+
import { supabase } from "../utils/supabase";
|
|
5
|
+
import { getUserBySession } from "../utils/getUserBySession";
|
|
6
|
+
import { User } from "@supabase/supabase-js";
|
|
7
|
+
import { postMapLifecycleWebhook } from "../utils/mapLifecycleWebhook";
|
|
8
|
+
|
|
9
|
+
const VETO_BADGES = ["Team Ranked"];
|
|
10
|
+
|
|
11
|
+
export const Schema = {
|
|
12
|
+
input: z.strictObject({
|
|
13
|
+
session: z.string(),
|
|
14
|
+
mapId: z.number(),
|
|
15
|
+
reason: z.string().min(1).max(1000),
|
|
16
|
+
}),
|
|
17
|
+
output: z.object({
|
|
18
|
+
error: z.string().optional(),
|
|
19
|
+
}),
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export async function POST(request: Request) {
|
|
23
|
+
return protectedApi({
|
|
24
|
+
request,
|
|
25
|
+
schema: Schema,
|
|
26
|
+
authorization: validUser,
|
|
27
|
+
activity: handler,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export async function handler(data: (typeof Schema)["input"]["_type"]) {
|
|
32
|
+
const user = (await getUserBySession(data.session)) as User;
|
|
33
|
+
const { data: queryUserData } = await supabase
|
|
34
|
+
.from("profiles")
|
|
35
|
+
.select("*")
|
|
36
|
+
.eq("uid", user.id)
|
|
37
|
+
.single();
|
|
38
|
+
|
|
39
|
+
if (!queryUserData) {
|
|
40
|
+
return NextResponse.json({ error: "Can't find user" });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const tags = (queryUserData?.badges || []) as string[];
|
|
44
|
+
const hasVetoAccess = VETO_BADGES.some((badge) => tags.includes(badge));
|
|
45
|
+
|
|
46
|
+
if (!hasVetoAccess) {
|
|
47
|
+
return NextResponse.json({ error: "Only management can veto maps!" });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const { data: mapData } = await supabase
|
|
51
|
+
.from("beatmapPages")
|
|
52
|
+
.select("id,qualified")
|
|
53
|
+
.eq("id", data.mapId)
|
|
54
|
+
.single();
|
|
55
|
+
|
|
56
|
+
if (!mapData) {
|
|
57
|
+
return NextResponse.json({ error: "Bad map" });
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (!mapData.qualified) {
|
|
61
|
+
return NextResponse.json({
|
|
62
|
+
error: "Only qualified maps can be vetoed",
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const { data: vetoData, error: vetoError } = await supabase
|
|
67
|
+
.from("vetos")
|
|
68
|
+
.insert({
|
|
69
|
+
beatmapPage: data.mapId,
|
|
70
|
+
user: queryUserData.id,
|
|
71
|
+
veto_reason: data.reason,
|
|
72
|
+
})
|
|
73
|
+
.select("id")
|
|
74
|
+
.single();
|
|
75
|
+
|
|
76
|
+
if (vetoError) {
|
|
77
|
+
return NextResponse.json({ error: vetoError.message });
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const { error: updateError } = await supabase.from("beatmapPages").upsert({
|
|
81
|
+
id: data.mapId,
|
|
82
|
+
qualified: false,
|
|
83
|
+
qualifiedAt: null,
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
if (updateError) {
|
|
87
|
+
if (vetoData?.id) {
|
|
88
|
+
await supabase.from("vetos").delete().eq("id", vetoData.id);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return NextResponse.json({ error: updateError.message });
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
await postMapLifecycleWebhook({
|
|
95
|
+
mapId: data.mapId,
|
|
96
|
+
event: "vetoed",
|
|
97
|
+
vetoReason: data.reason,
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
return NextResponse.json({});
|
|
101
|
+
}
|
package/index.ts
CHANGED
|
@@ -47,14 +47,14 @@ export const chartPublicStats = handleApi({url:"/api/chartPublicStats",...ChartP
|
|
|
47
47
|
// ./api/checkQualified.ts API
|
|
48
48
|
|
|
49
49
|
/*
|
|
50
|
-
export const Schema = {
|
|
51
|
-
input: z.strictObject({
|
|
52
|
-
secret: z.string(),
|
|
53
|
-
}),
|
|
54
|
-
output: z.object({
|
|
55
|
-
error: z.string().optional(),
|
|
56
|
-
updated: z.number(),
|
|
57
|
-
}),
|
|
50
|
+
export const Schema = {
|
|
51
|
+
input: z.strictObject({
|
|
52
|
+
secret: z.string(),
|
|
53
|
+
}),
|
|
54
|
+
output: z.object({
|
|
55
|
+
error: z.string().optional(),
|
|
56
|
+
updated: z.number(),
|
|
57
|
+
}),
|
|
58
58
|
};*/
|
|
59
59
|
import { Schema as CheckQualified } from "./api/checkQualified"
|
|
60
60
|
export { Schema as SchemaCheckQualified } from "./api/checkQualified"
|
|
@@ -63,7 +63,17 @@ export const checkQualified = handleApi({url:"/api/checkQualified",...CheckQuali
|
|
|
63
63
|
// ./api/createBeatmap.ts API
|
|
64
64
|
|
|
65
65
|
/*
|
|
66
|
-
|
|
66
|
+
export const Schema = {
|
|
67
|
+
input: z.strictObject({
|
|
68
|
+
url: z.string(),
|
|
69
|
+
session: z.string(),
|
|
70
|
+
updateFlag: z.boolean().optional(),
|
|
71
|
+
}),
|
|
72
|
+
output: z.strictObject({
|
|
73
|
+
hash: z.string().optional(),
|
|
74
|
+
error: z.string().optional(),
|
|
75
|
+
}),
|
|
76
|
+
};*/
|
|
67
77
|
import { Schema as CreateBeatmap } from "./api/createBeatmap"
|
|
68
78
|
export { Schema as SchemaCreateBeatmap } from "./api/createBeatmap"
|
|
69
79
|
export const createBeatmap = handleApi({url:"/api/createBeatmap",...CreateBeatmap})
|
|
@@ -311,39 +321,39 @@ export const editProfile = handleApi({url:"/api/editProfile",...EditProfile})
|
|
|
311
321
|
// ./api/enhancedSearch.ts API
|
|
312
322
|
|
|
313
323
|
/*
|
|
314
|
-
export const Schema = {
|
|
315
|
-
input: z.strictObject({
|
|
316
|
-
text: z.string().trim().min(1),
|
|
317
|
-
limit: z.number().int().min(1).max(25).default(10),
|
|
318
|
-
}),
|
|
319
|
-
output: z.object({
|
|
320
|
-
error: z.string().optional(),
|
|
321
|
-
users: z.array(
|
|
322
|
-
z.object({
|
|
323
|
-
id: z.number(),
|
|
324
|
-
username: z.string().nullable(),
|
|
325
|
-
avatar_url: z.string().nullable(),
|
|
326
|
-
about_me: z.string().nullable(),
|
|
327
|
-
flag: z.string().nullable(),
|
|
328
|
-
})
|
|
329
|
-
),
|
|
330
|
-
beatmaps: z.array(
|
|
331
|
-
z.object({
|
|
332
|
-
id: z.number(),
|
|
333
|
-
mapId: z.string().nullable(),
|
|
334
|
-
title: z.string().nullable(),
|
|
335
|
-
description: z.string().nullable(),
|
|
336
|
-
image: z.string().nullable(),
|
|
337
|
-
starRating: z.number().nullable(),
|
|
338
|
-
length: z.number().nullable(),
|
|
339
|
-
status: z.string().nullable(),
|
|
340
|
-
tags: z.string().nullable(),
|
|
341
|
-
owner: z.number().nullable(),
|
|
342
|
-
ownerUsername: z.string().nullable(),
|
|
343
|
-
ownerAvatar: z.string().nullable(),
|
|
344
|
-
})
|
|
345
|
-
),
|
|
346
|
-
}),
|
|
324
|
+
export const Schema = {
|
|
325
|
+
input: z.strictObject({
|
|
326
|
+
text: z.string().trim().min(1),
|
|
327
|
+
limit: z.number().int().min(1).max(25).default(10),
|
|
328
|
+
}),
|
|
329
|
+
output: z.object({
|
|
330
|
+
error: z.string().optional(),
|
|
331
|
+
users: z.array(
|
|
332
|
+
z.object({
|
|
333
|
+
id: z.number(),
|
|
334
|
+
username: z.string().nullable(),
|
|
335
|
+
avatar_url: z.string().nullable(),
|
|
336
|
+
about_me: z.string().nullable(),
|
|
337
|
+
flag: z.string().nullable(),
|
|
338
|
+
})
|
|
339
|
+
),
|
|
340
|
+
beatmaps: z.array(
|
|
341
|
+
z.object({
|
|
342
|
+
id: z.number(),
|
|
343
|
+
mapId: z.string().nullable(),
|
|
344
|
+
title: z.string().nullable(),
|
|
345
|
+
description: z.string().nullable(),
|
|
346
|
+
image: z.string().nullable(),
|
|
347
|
+
starRating: z.number().nullable(),
|
|
348
|
+
length: z.number().nullable(),
|
|
349
|
+
status: z.string().nullable(),
|
|
350
|
+
tags: z.string().nullable(),
|
|
351
|
+
owner: z.number().nullable(),
|
|
352
|
+
ownerUsername: z.string().nullable(),
|
|
353
|
+
ownerAvatar: z.string().nullable(),
|
|
354
|
+
})
|
|
355
|
+
),
|
|
356
|
+
}),
|
|
347
357
|
};*/
|
|
348
358
|
import { Schema as EnhancedSearch } from "./api/enhancedSearch"
|
|
349
359
|
export { Schema as SchemaEnhancedSearch } from "./api/enhancedSearch"
|
|
@@ -510,30 +520,30 @@ export const Schema = {
|
|
|
510
520
|
image: z.string().nullable().optional(),
|
|
511
521
|
imageLarge: z.string().nullable().optional(),
|
|
512
522
|
starRating: z.number().nullable().optional(),
|
|
513
|
-
owner: z.number().nullable().optional(),
|
|
514
|
-
ownerUsername: z.string().nullable().optional(),
|
|
515
|
-
ownerAvatar: z.string().nullable().optional(),
|
|
516
|
-
status: z.string().nullable().optional(),
|
|
517
|
-
qualified: z.boolean().nullable().optional(),
|
|
518
|
-
qualifiedAt: z.string().nullable().optional(),
|
|
519
|
-
description: z.string().nullable().optional(),
|
|
520
|
-
tags: z.string().nullable().optional(),
|
|
521
|
-
videoUrl: z.string().nullable().optional(),
|
|
522
|
-
vetos: z
|
|
523
|
-
.array(
|
|
524
|
-
z.object({
|
|
525
|
-
id: z.number(),
|
|
526
|
-
userId: z.number().nullable().optional(),
|
|
527
|
-
username: z.string().nullable().optional(),
|
|
528
|
-
avatar_url: z.string().nullable().optional(),
|
|
529
|
-
veto_reason: z.string().nullable().optional(),
|
|
530
|
-
created_at: z.string().nullable().optional(),
|
|
531
|
-
})
|
|
532
|
-
)
|
|
533
|
-
.optional(),
|
|
534
|
-
})
|
|
535
|
-
.optional(),
|
|
536
|
-
}),
|
|
523
|
+
owner: z.number().nullable().optional(),
|
|
524
|
+
ownerUsername: z.string().nullable().optional(),
|
|
525
|
+
ownerAvatar: z.string().nullable().optional(),
|
|
526
|
+
status: z.string().nullable().optional(),
|
|
527
|
+
qualified: z.boolean().nullable().optional(),
|
|
528
|
+
qualifiedAt: z.string().nullable().optional(),
|
|
529
|
+
description: z.string().nullable().optional(),
|
|
530
|
+
tags: z.string().nullable().optional(),
|
|
531
|
+
videoUrl: z.string().nullable().optional(),
|
|
532
|
+
vetos: z
|
|
533
|
+
.array(
|
|
534
|
+
z.object({
|
|
535
|
+
id: z.number(),
|
|
536
|
+
userId: z.number().nullable().optional(),
|
|
537
|
+
username: z.string().nullable().optional(),
|
|
538
|
+
avatar_url: z.string().nullable().optional(),
|
|
539
|
+
veto_reason: z.string().nullable().optional(),
|
|
540
|
+
created_at: z.string().nullable().optional(),
|
|
541
|
+
})
|
|
542
|
+
)
|
|
543
|
+
.optional(),
|
|
544
|
+
})
|
|
545
|
+
.optional(),
|
|
546
|
+
}),
|
|
537
547
|
};*/
|
|
538
548
|
import { Schema as GetBeatmapPage } from "./api/getBeatmapPage"
|
|
539
549
|
export { Schema as SchemaGetBeatmapPage } from "./api/getBeatmapPage"
|
|
@@ -565,6 +575,7 @@ export const Schema = {
|
|
|
565
575
|
userId: z.number().nullable(),
|
|
566
576
|
username: z.string().nullable(),
|
|
567
577
|
avatar_url: z.string().nullable(),
|
|
578
|
+
accuracy: z.number().nullable(),
|
|
568
579
|
})
|
|
569
580
|
)
|
|
570
581
|
.optional(),
|
|
@@ -583,28 +594,28 @@ export const Schema = {
|
|
|
583
594
|
beatmapFile: z.string().nullable().optional(),
|
|
584
595
|
image: z.string().nullable().optional(),
|
|
585
596
|
starRating: z.number().nullable().optional(),
|
|
586
|
-
owner: z.number().nullable().optional(),
|
|
587
|
-
ownerUsername: z.string().nullable().optional(),
|
|
588
|
-
ownerAvatar: z.string().nullable().optional(),
|
|
589
|
-
status: z.string().nullable().optional(),
|
|
590
|
-
qualified: z.boolean().nullable().optional(),
|
|
591
|
-
qualifiedAt: z.string().nullable().optional(),
|
|
592
|
-
videoUrl: z.string().nullable(),
|
|
593
|
-
vetos: z
|
|
594
|
-
.array(
|
|
595
|
-
z.object({
|
|
596
|
-
id: z.number(),
|
|
597
|
-
userId: z.number().nullable().optional(),
|
|
598
|
-
username: z.string().nullable().optional(),
|
|
599
|
-
avatar_url: z.string().nullable().optional(),
|
|
600
|
-
veto_reason: z.string().nullable().optional(),
|
|
601
|
-
created_at: z.string().nullable().optional(),
|
|
602
|
-
})
|
|
603
|
-
)
|
|
604
|
-
.optional(),
|
|
605
|
-
})
|
|
606
|
-
.optional(),
|
|
607
|
-
}),
|
|
597
|
+
owner: z.number().nullable().optional(),
|
|
598
|
+
ownerUsername: z.string().nullable().optional(),
|
|
599
|
+
ownerAvatar: z.string().nullable().optional(),
|
|
600
|
+
status: z.string().nullable().optional(),
|
|
601
|
+
qualified: z.boolean().nullable().optional(),
|
|
602
|
+
qualifiedAt: z.string().nullable().optional(),
|
|
603
|
+
videoUrl: z.string().nullable(),
|
|
604
|
+
vetos: z
|
|
605
|
+
.array(
|
|
606
|
+
z.object({
|
|
607
|
+
id: z.number(),
|
|
608
|
+
userId: z.number().nullable().optional(),
|
|
609
|
+
username: z.string().nullable().optional(),
|
|
610
|
+
avatar_url: z.string().nullable().optional(),
|
|
611
|
+
veto_reason: z.string().nullable().optional(),
|
|
612
|
+
created_at: z.string().nullable().optional(),
|
|
613
|
+
})
|
|
614
|
+
)
|
|
615
|
+
.optional(),
|
|
616
|
+
})
|
|
617
|
+
.optional(),
|
|
618
|
+
}),
|
|
608
619
|
};*/
|
|
609
620
|
import { Schema as GetBeatmapPageById } from "./api/getBeatmapPageById"
|
|
610
621
|
export { Schema as SchemaGetBeatmapPageById } from "./api/getBeatmapPageById"
|
|
@@ -633,11 +644,11 @@ export const Schema = {
|
|
|
633
644
|
viewPerPage: z.number(),
|
|
634
645
|
currentPage: z.number(),
|
|
635
646
|
beatmaps: z
|
|
636
|
-
.array(
|
|
637
|
-
z.object({
|
|
638
|
-
id: z.number(),
|
|
639
|
-
playcount: z.number().nullable().optional(),
|
|
640
|
-
created_at: z.string().nullable().optional(),
|
|
647
|
+
.array(
|
|
648
|
+
z.object({
|
|
649
|
+
id: z.number(),
|
|
650
|
+
playcount: z.number().nullable().optional(),
|
|
651
|
+
created_at: z.string().nullable().optional(),
|
|
641
652
|
difficulty: z.number().nullable().optional(),
|
|
642
653
|
noteCount: z.number().nullable().optional(),
|
|
643
654
|
length: z.number().nullable().optional(),
|
|
@@ -646,15 +657,16 @@ export const Schema = {
|
|
|
646
657
|
beatmapFile: z.string().nullable().optional(),
|
|
647
658
|
image: z.string().nullable().optional(),
|
|
648
659
|
starRating: z.number().nullable().optional(),
|
|
649
|
-
owner: z.number().nullable().optional(),
|
|
650
|
-
ownerUsername: z.string().nullable().optional(),
|
|
651
|
-
ownerAvatar: z.string().nullable().optional(),
|
|
652
|
-
status: z.string().nullable().optional(),
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
660
|
+
owner: z.number().nullable().optional(),
|
|
661
|
+
ownerUsername: z.string().nullable().optional(),
|
|
662
|
+
ownerAvatar: z.string().nullable().optional(),
|
|
663
|
+
status: z.string().nullable().optional(),
|
|
664
|
+
qualified: z.boolean().nullable().optional(),
|
|
665
|
+
tags: z.string().nullable().optional(),
|
|
666
|
+
videoUrl: z.string().nullable().optional(),
|
|
667
|
+
})
|
|
668
|
+
)
|
|
669
|
+
.optional(),
|
|
658
670
|
}),
|
|
659
671
|
};*/
|
|
660
672
|
import { Schema as GetBeatmaps } from "./api/getBeatmaps"
|
|
@@ -981,15 +993,16 @@ export const Schema = {
|
|
|
981
993
|
verified: z.boolean().nullable(),
|
|
982
994
|
verificationDeadline: z.number().nullable(),
|
|
983
995
|
play_count: z.number().nullable(),
|
|
984
|
-
skill_points: z.number().nullable(),
|
|
985
|
-
squares_hit: z.number().nullable(),
|
|
986
|
-
total_score: z.number().nullable(),
|
|
987
|
-
position: z.number().nullable(),
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
996
|
+
skill_points: z.number().nullable(),
|
|
997
|
+
squares_hit: z.number().nullable(),
|
|
998
|
+
total_score: z.number().nullable(),
|
|
999
|
+
position: z.number().nullable(),
|
|
1000
|
+
country_position: z.number().nullable(),
|
|
1001
|
+
activity_status: z.enum(["active", "inactive"]),
|
|
1002
|
+
is_online: z.boolean(),
|
|
1003
|
+
clans: z
|
|
1004
|
+
.object({
|
|
1005
|
+
id: z.number(),
|
|
993
1006
|
acronym: z.string(),
|
|
994
1007
|
})
|
|
995
1008
|
.optional()
|
|
@@ -1185,12 +1198,12 @@ export const Schema = {
|
|
|
1185
1198
|
awarded_sp: z.number().nullable(),
|
|
1186
1199
|
beatmapHash: z.string().nullable(),
|
|
1187
1200
|
created_at: z.string(),
|
|
1188
|
-
id: z.number(),
|
|
1189
|
-
misses: z.number().nullable(),
|
|
1190
|
-
passed: z.boolean().nullable(),
|
|
1191
|
-
replay_url: z.string().nullable().optional(),
|
|
1192
|
-
songId: z.string().nullable(),
|
|
1193
|
-
userId: z.number().nullable(),
|
|
1201
|
+
id: z.number(),
|
|
1202
|
+
misses: z.number().nullable(),
|
|
1203
|
+
passed: z.boolean().nullable(),
|
|
1204
|
+
replay_url: z.string().nullable().optional(),
|
|
1205
|
+
songId: z.string().nullable(),
|
|
1206
|
+
userId: z.number().nullable(),
|
|
1194
1207
|
beatmapDifficulty: z.number().optional().nullable(),
|
|
1195
1208
|
beatmapNotes: z.number().optional().nullable(),
|
|
1196
1209
|
beatmapTitle: z.string().optional().nullable(),
|
|
@@ -1205,12 +1218,12 @@ export const Schema = {
|
|
|
1205
1218
|
id: z.number(),
|
|
1206
1219
|
awarded_sp: z.number().nullable(),
|
|
1207
1220
|
created_at: z.string(),
|
|
1208
|
-
misses: z.number().nullable(),
|
|
1209
|
-
mods: z.record(z.unknown()),
|
|
1210
|
-
passed: z.boolean().nullable(),
|
|
1211
|
-
replay_url: z.string().nullable().optional(),
|
|
1212
|
-
songId: z.string().nullable(),
|
|
1213
|
-
speed: z.number().nullable(),
|
|
1221
|
+
misses: z.number().nullable(),
|
|
1222
|
+
mods: z.record(z.unknown()),
|
|
1223
|
+
passed: z.boolean().nullable(),
|
|
1224
|
+
replay_url: z.string().nullable().optional(),
|
|
1225
|
+
songId: z.string().nullable(),
|
|
1226
|
+
speed: z.number().nullable(),
|
|
1214
1227
|
spin: z.boolean(),
|
|
1215
1228
|
beatmapHash: z.string().nullable(),
|
|
1216
1229
|
beatmapTitle: z.string().nullable(),
|
|
@@ -1225,12 +1238,12 @@ export const Schema = {
|
|
|
1225
1238
|
awarded_sp: z.number().nullable(),
|
|
1226
1239
|
beatmapHash: z.string().nullable(),
|
|
1227
1240
|
created_at: z.string(),
|
|
1228
|
-
id: z.number(),
|
|
1229
|
-
misses: z.number().nullable(),
|
|
1230
|
-
passed: z.boolean().nullable(),
|
|
1231
|
-
replay_url: z.string().nullable().optional(),
|
|
1232
|
-
rank: z.string().nullable(),
|
|
1233
|
-
songId: z.string().nullable(),
|
|
1241
|
+
id: z.number(),
|
|
1242
|
+
misses: z.number().nullable(),
|
|
1243
|
+
passed: z.boolean().nullable(),
|
|
1244
|
+
replay_url: z.string().nullable().optional(),
|
|
1245
|
+
rank: z.string().nullable(),
|
|
1246
|
+
songId: z.string().nullable(),
|
|
1234
1247
|
userId: z.number().nullable(),
|
|
1235
1248
|
beatmapDifficulty: z.number().optional().nullable(),
|
|
1236
1249
|
beatmapNotes: z.number().optional().nullable(),
|
|
@@ -1305,15 +1318,15 @@ export const postBeatmapComment = handleApi({url:"/api/postBeatmapComment",...Po
|
|
|
1305
1318
|
// ./api/qualifyMap.ts API
|
|
1306
1319
|
|
|
1307
1320
|
/*
|
|
1308
|
-
export const Schema = {
|
|
1309
|
-
input: z.strictObject({
|
|
1310
|
-
session: z.string(),
|
|
1311
|
-
mapId: z.number(),
|
|
1312
|
-
}),
|
|
1313
|
-
output: z.object({
|
|
1314
|
-
error: z.string().optional(),
|
|
1315
|
-
qualifiedAt: z.string().optional(),
|
|
1316
|
-
}),
|
|
1321
|
+
export const Schema = {
|
|
1322
|
+
input: z.strictObject({
|
|
1323
|
+
session: z.string(),
|
|
1324
|
+
mapId: z.number(),
|
|
1325
|
+
}),
|
|
1326
|
+
output: z.object({
|
|
1327
|
+
error: z.string().optional(),
|
|
1328
|
+
qualifiedAt: z.string().optional(),
|
|
1329
|
+
}),
|
|
1317
1330
|
};*/
|
|
1318
1331
|
import { Schema as QualifyMap } from "./api/qualifyMap"
|
|
1319
1332
|
export { Schema as SchemaQualifyMap } from "./api/qualifyMap"
|
|
@@ -1408,26 +1421,26 @@ export const submitScore = handleApi({url:"/api/submitScore",...SubmitScore})
|
|
|
1408
1421
|
// ./api/submitScoreInternal.ts API
|
|
1409
1422
|
|
|
1410
1423
|
/*
|
|
1411
|
-
export const Schema = {
|
|
1412
|
-
input: z.strictObject({
|
|
1413
|
-
session: z.string(),
|
|
1414
|
-
secret: z.string(),
|
|
1415
|
-
token: z.string(),
|
|
1416
|
-
data: z.strictObject({
|
|
1417
|
-
onlineMapId: z.number(),
|
|
1418
|
-
misses: z.number(),
|
|
1419
|
-
hits: z.number(),
|
|
1420
|
-
speed: z.number(),
|
|
1421
|
-
mods: z.array(z.string()),
|
|
1422
|
-
spin: z.boolean(),
|
|
1423
|
-
replayBytes: z.string().nullable().optional(),
|
|
1424
|
-
pauses: z.number().nullable().optional(),
|
|
1425
|
-
failTime: z.number().nullable().optional(),
|
|
1426
|
-
}),
|
|
1427
|
-
}),
|
|
1428
|
-
output: z.object({
|
|
1429
|
-
error: z.string().optional(),
|
|
1430
|
-
}),
|
|
1424
|
+
export const Schema = {
|
|
1425
|
+
input: z.strictObject({
|
|
1426
|
+
session: z.string(),
|
|
1427
|
+
secret: z.string(),
|
|
1428
|
+
token: z.string(),
|
|
1429
|
+
data: z.strictObject({
|
|
1430
|
+
onlineMapId: z.number(),
|
|
1431
|
+
misses: z.number(),
|
|
1432
|
+
hits: z.number(),
|
|
1433
|
+
speed: z.number(),
|
|
1434
|
+
mods: z.array(z.string()),
|
|
1435
|
+
spin: z.boolean(),
|
|
1436
|
+
replayBytes: z.string().nullable().optional(),
|
|
1437
|
+
pauses: z.number().nullable().optional(),
|
|
1438
|
+
failTime: z.number().nullable().optional(),
|
|
1439
|
+
}),
|
|
1440
|
+
}),
|
|
1441
|
+
output: z.object({
|
|
1442
|
+
error: z.string().optional(),
|
|
1443
|
+
}),
|
|
1431
1444
|
};*/
|
|
1432
1445
|
import { Schema as SubmitScoreInternal } from "./api/submitScoreInternal"
|
|
1433
1446
|
export { Schema as SchemaSubmitScoreInternal } from "./api/submitScoreInternal"
|
|
@@ -1456,15 +1469,15 @@ export const updateBeatmapPage = handleApi({url:"/api/updateBeatmapPage",...Upda
|
|
|
1456
1469
|
// ./api/vetoMap.ts API
|
|
1457
1470
|
|
|
1458
1471
|
/*
|
|
1459
|
-
export const Schema = {
|
|
1460
|
-
input: z.strictObject({
|
|
1461
|
-
session: z.string(),
|
|
1462
|
-
mapId: z.number(),
|
|
1463
|
-
reason: z.string().min(1).max(1000),
|
|
1464
|
-
}),
|
|
1465
|
-
output: z.object({
|
|
1466
|
-
error: z.string().optional(),
|
|
1467
|
-
}),
|
|
1472
|
+
export const Schema = {
|
|
1473
|
+
input: z.strictObject({
|
|
1474
|
+
session: z.string(),
|
|
1475
|
+
mapId: z.number(),
|
|
1476
|
+
reason: z.string().min(1).max(1000),
|
|
1477
|
+
}),
|
|
1478
|
+
output: z.object({
|
|
1479
|
+
error: z.string().optional(),
|
|
1480
|
+
}),
|
|
1468
1481
|
};*/
|
|
1469
1482
|
import { Schema as VetoMap } from "./api/vetoMap"
|
|
1470
1483
|
export { Schema as SchemaVetoMap } from "./api/vetoMap"
|