@hupu-tech/shaper 0.2.11 → 0.2.13
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/CHANGELOG.md +12 -0
- package/README.md +6 -0
- package/dist/cli.js +2 -2
- package/dist/cloud/client.d.ts +1 -2
- package/dist/cloud/service-build.d.ts +5 -7
- package/dist/index.js +1 -1
- package/dist/project/create.d.ts +9 -3
- package/dist/project/delivery.d.ts +5 -5
- package/dist/runtime.d.ts +2 -1
- package/dist/runtime.js +1 -1
- package/dist/shared-2WDEQ3AQ.js +19 -0
- package/package.json +1 -3
- package/skills/business/SKILL.md +158 -0
- package/skills/business/activity/README.md +14 -0
- package/skills/business/activity/hupu-leaderboard-template/SKILL.md +52 -0
- package/skills/business/activity/hupu-leaderboard-template/example/README.md +20 -0
- package/skills/business/activity/hupu-leaderboard-template/example/cloudfunctions/activity_api/.cloudignore +3 -0
- package/skills/business/activity/hupu-leaderboard-template/example/cloudfunctions/activity_api/index.js +218 -0
- package/skills/business/activity/hupu-leaderboard-template/example/cloudfunctions/activity_api/package.json +15 -0
- package/skills/business/activity/hupu-leaderboard-template/example/cloudfunctions/activity_api/scf_bootstrap +3 -0
- package/skills/business/activity/hupu-leaderboard-template/example/index.html +291 -0
- package/skills/business/activity/hupu-leaderboard-template/example/migrations/20260828210000_create_leaderboard.sql +54 -0
- package/skills/business/activity/hupu-lottery-draw/SKILL.md +50 -0
- package/skills/business/activity/hupu-lottery-draw/example/README.md +21 -0
- package/skills/business/activity/hupu-lottery-draw/example/cloudfunctions/activity_api/.cloudignore +3 -0
- package/skills/business/activity/hupu-lottery-draw/example/cloudfunctions/activity_api/index.js +142 -0
- package/skills/business/activity/hupu-lottery-draw/example/cloudfunctions/activity_api/package.json +9 -0
- package/skills/business/activity/hupu-lottery-draw/example/cloudfunctions/activity_api/scf_bootstrap +3 -0
- package/skills/business/activity/hupu-lottery-draw/example/index.html +178 -0
- package/skills/business/activity/hupu-lottery-draw/example/migrations/20260828220000_create_draw.sql +193 -0
- package/skills/business/activity/hupu-pk-voting/SKILL.md +54 -0
- package/skills/business/activity/hupu-pk-voting/example/README.md +44 -0
- package/skills/business/activity/hupu-pk-voting/example/cloudfunctions/activity_api/.cloudignore +3 -0
- package/skills/business/activity/hupu-pk-voting/example/cloudfunctions/activity_api/index.js +370 -0
- package/skills/business/activity/hupu-pk-voting/example/cloudfunctions/activity_api/package.json +15 -0
- package/skills/business/activity/hupu-pk-voting/example/cloudfunctions/activity_api/scf_bootstrap +2 -0
- package/skills/business/activity/hupu-pk-voting/example/index.html +729 -0
- package/skills/business/activity/hupu-pk-voting/example/migrations/20260828220000_create_pk_vote.sql +168 -0
- package/skills/business/activity/hupu-request-activity-execute-vote-task/SKILL.md +77 -0
- package/skills/business/activity/hupu-request-activity-get-vote-detail/SKILL.md +84 -0
- package/skills/business/activity/hupu-request-activity-get-vote-task-list/SKILL.md +86 -0
- package/skills/business/activity/hupu-request-activity-list-by-biz-keys/SKILL.md +153 -0
- package/skills/business/activity/hupu-request-activity-report-vote-task/SKILL.md +58 -0
- package/skills/business/activity/hupu-request-activity-submit-vote/SKILL.md +58 -0
- package/skills/business/activity/hupu-vote-task/SKILL.md +47 -0
- package/skills/business/community/README.md +13 -0
- package/skills/business/community/hupu-request-bbs-detail/SKILL.md +197 -0
- package/skills/business/community/hupu-request-bbs-get-tag-thread-list/SKILL.md +257 -0
- package/skills/business/community/hupu-request-bbs-get-topic-threads/SKILL.md +159 -0
- package/skills/business/community/hupu-request-bbs-gets-thread-post-list/SKILL.md +124 -0
- package/skills/business/community/hupu-request-bbs-open-post-editor/SKILL.md +75 -0
- package/skills/business/community/hupu-request-bbs-reply-post/SKILL.md +59 -0
- package/skills/business/community/hupu-score-add-score/SKILL.md +57 -0
- package/skills/business/community/hupu-score-get-item-detail/SKILL.md +173 -0
- package/skills/business/community/hupu-score-get-score/SKILL.md +263 -0
- package/skills/business/quality/README.md +7 -0
- package/skills/business/quality/hupu-security-check-audit/SKILL.md +39 -0
- package/skills/business/quality/hupu-wasm-compression/SKILL.md +69 -0
- package/skills/business/quality/hupu-wasm-compression/agents/openai.yaml +4 -0
- package/skills/business/quality/hupu-wasm-compression/tool/checks.mjs +90 -0
- package/skills/business/quality/hupu-wasm-compression/tool/compress-worker.mjs +40 -0
- package/skills/business/quality/hupu-wasm-compression/tool/public/app.js +84 -0
- package/skills/business/quality/hupu-wasm-compression/tool/public/index.html +80 -0
- package/skills/business/quality/hupu-wasm-compression/tool/public/style.css +3 -0
- package/skills/business/quality/hupu-wasm-compression/tool/server.mjs +126 -0
- package/skills/business/quality/hupu-web-security-audit/SKILL.md +45 -0
- package/skills/business/quality/hupu-web-security-audit/agents/openai.yaml +4 -0
- package/skills/business/rewards/README.md +13 -0
- package/skills/business/rewards/hupu-vacoin/SKILL.md +70 -0
- package/skills/business/rewards/hupu-vacoin-consume-coins/SKILL.md +47 -0
- package/skills/business/rewards/hupu-vacoin-get-coin-overview/SKILL.md +52 -0
- package/skills/business/rewards/hupu-vacoin-get-session-coins/SKILL.md +44 -0
- package/skills/business/rewards/hupu-vacoin-reset-session-id/SKILL.md +39 -0
- package/skills/business/rewards/hupu-vatask/SKILL.md +63 -0
- package/skills/business/rewards/hupu-vatask-complete-reward-video/SKILL.md +43 -0
- package/skills/business/rewards/hupu-vatask-consume-activity-chance/SKILL.md +48 -0
- package/skills/business/rewards/hupu-vatask-get-activity-task-state/SKILL.md +49 -0
- package/skills/business/runtime/README.md +13 -0
- package/skills/business/runtime/hupu-add-to-desktop/SKILL.md +51 -0
- package/skills/business/runtime/hupu-close-webview/SKILL.md +48 -0
- package/skills/business/runtime/hupu-cloud-auth/SKILL.md +43 -0
- package/skills/business/runtime/hupu-cloud-request/SKILL.md +56 -0
- package/skills/business/runtime/hupu-fullscreen-safe-top/SKILL.md +33 -0
- package/skills/business/runtime/hupu-navigate-to/SKILL.md +45 -0
- package/skills/business/runtime/hupu-request/SKILL.md +67 -0
- package/skills/business/runtime/hupu-seer-chat/SKILL.md +183 -0
- package/skills/business/runtime/hupu-track-report/SKILL.md +71 -0
- package/skills/business/sharing/README.md +7 -0
- package/skills/business/sharing/hupu-oss-upload-file/SKILL.md +40 -0
- package/skills/business/sharing/hupu-result-poster-posting/SKILL.md +37 -0
- package/skills/business/sharing/hupu-result-poster-posting/example/README.md +14 -0
- package/skills/business/sharing/hupu-result-poster-posting/example/cloudfunctions/activity_api/.cloudignore +3 -0
- package/skills/business/sharing/hupu-result-poster-posting/example/cloudfunctions/activity_api/index.js +187 -0
- package/skills/business/sharing/hupu-result-poster-posting/example/cloudfunctions/activity_api/package.json +15 -0
- package/skills/business/sharing/hupu-result-poster-posting/example/cloudfunctions/activity_api/scf_bootstrap +3 -0
- package/skills/business/sharing/hupu-result-poster-posting/example/index.html +256 -0
- package/skills/business/sharing/hupu-result-poster-posting/example/migrations/20260828213000_create_result_poster_results.sql +60 -0
- package/skills/business/sharing/hupu-result-poster-posting/references/api-contract.md +46 -0
- package/skills/business/sharing/hupu-social-share/SKILL.md +27 -0
- package/skills/business/sports/README.md +27 -0
- package/skills/business/sports/hupu-request-basketball-player-info/SKILL.md +131 -0
- package/skills/business/sports/hupu-request-basketball-single-match/SKILL.md +158 -0
- package/skills/business/sports/hupu-request-basketball-team-info/SKILL.md +96 -0
- package/skills/business/sports/hupu-request-basketball-team-player-list/SKILL.md +108 -0
- package/skills/business/sports/hupu-request-basketball-team-salary-info/SKILL.md +85 -0
- package/skills/business/sports/hupu-request-football-coach-info/SKILL.md +76 -0
- package/skills/business/sports/hupu-request-football-live-room-news-list/SKILL.md +85 -0
- package/skills/business/sports/hupu-request-football-match-info/SKILL.md +126 -0
- package/skills/business/sports/hupu-request-football-player-info/SKILL.md +82 -0
- package/skills/business/sports/hupu-request-football-team-info/SKILL.md +83 -0
- package/skills/business/sports/hupu-request-football-team-player-season-stats/SKILL.md +73 -0
- package/skills/business/sports/hupu-request-football-team-season-year/SKILL.md +68 -0
- package/skills/business/sports/hupu-request-kog-playbyplay/SKILL.md +77 -0
- package/skills/business/sports/hupu-request-live-tab-info-list/SKILL.md +85 -0
- package/skills/business/sports/hupu-request-live-tab-list/SKILL.md +66 -0
- package/skills/business/sports/hupu-request-lol-playbyplay/SKILL.md +77 -0
- package/skills/business/sports/hupu-request-match-get-tab-detail-schedule-list/SKILL.md +113 -0
- package/skills/business/sports/hupu-request-match-query-all-diagram-info-by-id/SKILL.md +79 -0
- package/skills/business/sports/hupu-request-match-query-match-stats-by-match-info/SKILL.md +85 -0
- package/skills/business/sports/hupu-request-news-news-common-list/SKILL.md +90 -0
- package/skills/business/sports/hupu-request-news-player-news-list/SKILL.md +79 -0
- package/skills/business/sports/hupu-request-news-subject-news/SKILL.md +89 -0
- package/skills/business/sports/hupu-request-news-team-news-list/SKILL.md +76 -0
- package/skills/business/storage/README.md +9 -0
- package/skills/business/storage/hupu-cloud-save/SKILL.md +129 -0
- package/skills/business/storage/hupu-cloud-save/references/legacy-migration.md +111 -0
- package/skills/business/storage/hupu-cloud-save-load/SKILL.md +41 -0
- package/skills/business/storage/hupu-cloud-save-save/SKILL.md +45 -0
- package/skills/business/storage/hupu-storage-get-value/SKILL.md +26 -0
- package/skills/business/storage/hupu-storage-set-value/SKILL.md +42 -0
- package/skills/business/user/README.md +6 -0
- package/skills/business/user/hupu-auth-get-user-info/SKILL.md +47 -0
- package/skills/business/user/hupu-game-auth/SKILL.md +46 -0
- package/skills/core/hupu-business/SKILL.md +1 -1
- package/skills/core/hupu-business/references/runtime.md +17 -11
- package/skills/core/shaper-backend/SKILL.md +1 -1
- package/skills/core/shaper-backend/references/database.md +2 -2
- package/skills/core/shaper-backend/references/legacy.md +1 -1
- package/skills/core/shaper-backend/references/node-server.md +29 -20
- package/skills/core/shaper-development/SKILL.md +5 -1
- package/skills/core/shaper-development/references/project-setup.md +1 -1
- package/skills/core/shaper-game-development/SKILL.md +1 -1
- package/skills/core/shaper-release/SKILL.md +1 -1
- package/templates/cloud-service/README.md +4 -30
- package/templates/cloud-service/cloud.json +6 -9
- package/templates/cloud-service/package-lock.json +1090 -0
- package/templates/cloud-service/release.json +11 -0
- package/templates/cloud-service/server.cjs +37 -0
- package/templates/h5/package-lock.json +40 -40
- package/templates/leaderboard/README.md +3 -0
- package/templates/leaderboard/cloud/database/migrations/202611130001_leaderboard.sql +6 -0
- package/templates/leaderboard/cloud/functions/api/cloud.json +10 -0
- package/templates/leaderboard/cloud/functions/api/leaderboard.cjs +49 -0
- package/templates/leaderboard/cloud/functions/api/package-lock.json +1093 -0
- package/templates/leaderboard/cloud/functions/api/package.json +19 -0
- package/templates/leaderboard/cloud/functions/api/server.cjs +25 -0
- package/templates/leaderboard/cloud/gateway/routes.json +15 -0
- package/templates/leaderboard/docs/design.md +1 -0
- package/templates/leaderboard/docs/integration.md +12 -0
- package/templates/leaderboard/docs/product.md +1 -0
- package/templates/leaderboard/docs/validation.md +1 -0
- package/templates/leaderboard/index.html +12 -0
- package/templates/leaderboard/package-lock.json +828 -0
- package/templates/leaderboard/package.json +17 -0
- package/templates/leaderboard/public/.gitkeep +1 -0
- package/templates/leaderboard/shaper.config.json +7 -0
- package/templates/leaderboard/src/main.js +67 -0
- package/templates/leaderboard/src/style.css +69 -0
- package/templates/leaderboard/test/leaderboard.test.cjs +93 -0
- package/templates/offline-game/README.md +3 -0
- package/templates/offline-game/docs/design.md +1 -0
- package/templates/offline-game/docs/integration.md +10 -0
- package/templates/offline-game/docs/product.md +1 -0
- package/templates/offline-game/docs/validation.md +1 -0
- package/templates/offline-game/index.html +1 -0
- package/templates/offline-game/package-lock.json +828 -0
- package/templates/offline-game/package.json +16 -0
- package/templates/offline-game/public/.gitkeep +1 -0
- package/templates/offline-game/shaper.config.json +7 -0
- package/templates/offline-game/src/game.js +11 -0
- package/templates/offline-game/src/main.js +12 -0
- package/templates/offline-game/src/style.css +1 -0
- package/templates/offline-game/test/game.test.js +7 -0
- package/templates/phaser/package-lock.json +70 -70
- package/templates/react/package-lock.json +74 -74
- package/dist/shared-F5CQJEWB.js +0 -19
- package/templates/cloud-service/handlers.cjs +0 -46
- package/vendor/cloud-server/hupu-cloud-server-0.1.0.tgz +0 -0
- package/vendor/cloud-server/release.json +0 -12
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hupu-tech/shaper-cloud",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"templateHashes": {
|
|
5
|
+
"server.cjs": "b74441aeed0bd1e854c1937aade33e7fcb44cabee63bf823a97f35630254f60d",
|
|
6
|
+
"cloud.json": "fa341fc122cd881743b4bbfe7ad85e3e3381ff34463313e5534130f5cce0e7fa",
|
|
7
|
+
"package-lock.json": "577ea025ec81b660651fa0d8e584d946d870aacef7c6da561c717deb6a017120",
|
|
8
|
+
"migrations/202610250001_init.sql": "38f9a69e1f0f4967e20d1f07c02e2d0b719ddb284ddee7b3136a0dc016766797",
|
|
9
|
+
"migrations/202610250002_events.sql": "bb9a198a7babe4040cf09c7c29def25f4d7bcbeaf1dcad4a396b3778251dd19b"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const { randomUUID } = require('node:crypto');
|
|
3
|
+
const { createClient, ShaperCloudError } = require('@hupu-tech/shaper-cloud');
|
|
4
|
+
const cloud = createClient();
|
|
5
|
+
const app = express();
|
|
6
|
+
app.use(express.json({limit:'64kb'}));
|
|
7
|
+
app.get('/api/leaderboard', async (_req,res,next) => {
|
|
8
|
+
try { res.json({ sdk:'0.3.0', protocol:'shaper-player', rows:(await cloud.db.query('SELECT score FROM progress ORDER BY score DESC LIMIT 10')).rows }); }
|
|
9
|
+
catch(e){next(e);}
|
|
10
|
+
});
|
|
11
|
+
app.get('/api/me', async (req,res,next) => {
|
|
12
|
+
try {
|
|
13
|
+
const user=await cloud.auth.requireUser({authorization:req.get('authorization')});
|
|
14
|
+
res.json({sdk:'0.3.0',protocol:'shaper-player',puid:user.puid,rows:(await cloud.db.query('SELECT score FROM progress WHERE puid=$1',[user.puid])).rows});
|
|
15
|
+
}catch(e){next(e);}
|
|
16
|
+
});
|
|
17
|
+
app.post('/api/progress', async (req,res,next) => {
|
|
18
|
+
try {
|
|
19
|
+
const user=await cloud.auth.requireUser({authorization:req.get('authorization')});
|
|
20
|
+
const score=req.body?.score, id=req.body?.submissionId??randomUUID();
|
|
21
|
+
if(!Number.isSafeInteger(score)||score<0||score>1000000) return res.status(400).json({code:'INVALID_SCORE'});
|
|
22
|
+
if(typeof id!=='string'||!/^[-a-zA-Z0-9_]{1,64}$/.test(id))return res.status(400).json({code:'INVALID_SUBMISSION_ID'});
|
|
23
|
+
const progress=await cloud.db.transaction(async tx=>{
|
|
24
|
+
const inserted=await tx.query('INSERT INTO progress_events(puid,submission_id,score) VALUES($1,$2,$3) ON CONFLICT(puid,submission_id) DO NOTHING RETURNING submission_id',[user.puid,id,score]);
|
|
25
|
+
if(!inserted.rowCount)return null;
|
|
26
|
+
return (await tx.query('INSERT INTO progress(puid,score) VALUES($1,$2) ON CONFLICT(puid) DO UPDATE SET score=excluded.score RETURNING score',[user.puid,score])).rows[0];
|
|
27
|
+
});
|
|
28
|
+
if(!progress)return res.status(409).json({code:'DUPLICATE_SUBMISSION'});
|
|
29
|
+
res.json({sdk:'0.3.0',progress});
|
|
30
|
+
}catch(e){next(e);}
|
|
31
|
+
});
|
|
32
|
+
app.use((error,_req,res,_next)=>{
|
|
33
|
+
if(error instanceof ShaperCloudError)return res.status(error.status).json({code:error.code,message:error.publicMessage});
|
|
34
|
+
res.status(error.status===400?400:500).json({code:error.status===400?'INVALID_JSON':'INTERNAL_ERROR'});
|
|
35
|
+
});
|
|
36
|
+
const server=app.listen(Number(process.env.PORT??9000),'0.0.0.0');
|
|
37
|
+
process.once('SIGTERM',()=>server.close(()=>{void cloud.close();}));
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"node_modules/@oxc-project/types": {
|
|
15
15
|
"version": "0.154.0",
|
|
16
|
-
"resolved": "
|
|
16
|
+
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.154.0.tgz",
|
|
17
17
|
"integrity": "sha512-KYOUGQFlLWR+s4QMV2Q9ko38TZm7EdO87Qm7rvZLqk/webse/cDjtyxKhg/47l0byCbs/k46LT8qc4PKjAikzA==",
|
|
18
18
|
"dev": true,
|
|
19
19
|
"license": "MIT",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"node_modules/@rolldown/binding-android-arm-eabi": {
|
|
25
25
|
"version": "1.2.14",
|
|
26
|
-
"resolved": "
|
|
26
|
+
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.14.tgz",
|
|
27
27
|
"integrity": "sha512-aWR+XKH9+rW7m5fWq/5360J3mHycrx/o6xZM2DQFdJnTMdyP7/WzxPjhtLbVWdKo2y612/4U1bWqb3HQhiF7vg==",
|
|
28
28
|
"cpu": [
|
|
29
29
|
"arm"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"node_modules/@rolldown/binding-android-arm64": {
|
|
42
42
|
"version": "1.2.14",
|
|
43
|
-
"resolved": "
|
|
43
|
+
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.14.tgz",
|
|
44
44
|
"integrity": "sha512-QiVxHofl6A8lQU7WAtOUY4QMVZXohxwz7WJJoeh8NBEUyKfIkMRKhYyq8az/1RypNiIXzNTtiS6KwHz0erxYRQ==",
|
|
45
45
|
"cpu": [
|
|
46
46
|
"arm64"
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"node_modules/@rolldown/binding-darwin-arm64": {
|
|
59
59
|
"version": "1.2.14",
|
|
60
|
-
"resolved": "
|
|
60
|
+
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.14.tgz",
|
|
61
61
|
"integrity": "sha512-lTQOzHuBIooh3jIr5XINQkjPGEuGy+Dsy0meXDr6Sjty0b99kYgGh4uBC/8mJX1T0kC8d6S0aPP1Y+bHkh6aBw==",
|
|
62
62
|
"cpu": [
|
|
63
63
|
"arm64"
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
},
|
|
75
75
|
"node_modules/@rolldown/binding-darwin-x64": {
|
|
76
76
|
"version": "1.2.14",
|
|
77
|
-
"resolved": "
|
|
77
|
+
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.14.tgz",
|
|
78
78
|
"integrity": "sha512-hyMKEGatjmBYCs/Q4sbIcL/GqpFEqsX3wc+HYVQ/85A4rxc1o7rPm4DUI4GV4k/h0ITddwFSGpqQunI14GXjTA==",
|
|
79
79
|
"cpu": [
|
|
80
80
|
"x64"
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
},
|
|
92
92
|
"node_modules/@rolldown/binding-freebsd-x64": {
|
|
93
93
|
"version": "1.2.14",
|
|
94
|
-
"resolved": "
|
|
94
|
+
"resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.14.tgz",
|
|
95
95
|
"integrity": "sha512-u371GbXoVXrEgP20PwzoGNOdAOqAMhzo19JzzY+V4YmmnC+DTOoqdbMu+O+54emM59Mik/UdrtWgcuEDKWRPKA==",
|
|
96
96
|
"cpu": [
|
|
97
97
|
"x64"
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
},
|
|
109
109
|
"node_modules/@rolldown/binding-linux-arm-gnueabihf": {
|
|
110
110
|
"version": "1.2.14",
|
|
111
|
-
"resolved": "
|
|
111
|
+
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.14.tgz",
|
|
112
112
|
"integrity": "sha512-BqwKsdZQf6EqVWr8fv2MrDYzAvOZ7+NYFSJESRGs87fkseEhs0TU9TXgRJTkZoRRkxTizyEg1LKUXfU3/78uqg==",
|
|
113
113
|
"cpu": [
|
|
114
114
|
"arm"
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
},
|
|
126
126
|
"node_modules/@rolldown/binding-linux-arm64-gnu": {
|
|
127
127
|
"version": "1.2.14",
|
|
128
|
-
"resolved": "
|
|
128
|
+
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.14.tgz",
|
|
129
129
|
"integrity": "sha512-SD9kY8M009x/7s57Z1dgUVlP5+uYBgKQK0Tkr1WIWngrtUJmRCW1RJFMY7QDla2khXhmg2i5Io7MUjcmZNZ/KQ==",
|
|
130
130
|
"cpu": [
|
|
131
131
|
"arm64"
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
},
|
|
146
146
|
"node_modules/@rolldown/binding-linux-arm64-musl": {
|
|
147
147
|
"version": "1.2.14",
|
|
148
|
-
"resolved": "
|
|
148
|
+
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.14.tgz",
|
|
149
149
|
"integrity": "sha512-BJ2CL19M6uuWesMgnqJzgxoI+N+eV7b0A9O9vLV42y+gitC41fNa8KElau1tHVzuLWX5GzEuxMPhAO0tQXQMkg==",
|
|
150
150
|
"cpu": [
|
|
151
151
|
"arm64"
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
},
|
|
166
166
|
"node_modules/@rolldown/binding-linux-ppc64-gnu": {
|
|
167
167
|
"version": "1.2.14",
|
|
168
|
-
"resolved": "
|
|
168
|
+
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.14.tgz",
|
|
169
169
|
"integrity": "sha512-4+Kl8daPV8NDHaD7mfCcc1pRM+Qg7ab8DyMm5FG5WoZgv4h2i3KFN1CybYBNbQqmuYm7ftJLvmMI1eHYJ22S/Q==",
|
|
170
170
|
"cpu": [
|
|
171
171
|
"ppc64"
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
},
|
|
186
186
|
"node_modules/@rolldown/binding-linux-s390x-gnu": {
|
|
187
187
|
"version": "1.2.14",
|
|
188
|
-
"resolved": "
|
|
188
|
+
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.14.tgz",
|
|
189
189
|
"integrity": "sha512-V/h8ePq1fKDrmtFMz6xcCN3DKvuvMRrwwD1q0PkBeeo4DpK64biaKvqWGVxqCeYKqeRk7gE7/iKPxLCn08O97A==",
|
|
190
190
|
"cpu": [
|
|
191
191
|
"s390x"
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
},
|
|
206
206
|
"node_modules/@rolldown/binding-linux-x64-gnu": {
|
|
207
207
|
"version": "1.2.14",
|
|
208
|
-
"resolved": "
|
|
208
|
+
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.14.tgz",
|
|
209
209
|
"integrity": "sha512-WxalXzgrLVpKC93xfpaJ3gCXUWzeCr+FRCbDVD2mUAy4L6Vo3lNVz0epUEUpxPWJkLNYUwM4OSIikv36OJ9mLg==",
|
|
210
210
|
"cpu": [
|
|
211
211
|
"x64"
|
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
},
|
|
226
226
|
"node_modules/@rolldown/binding-linux-x64-musl": {
|
|
227
227
|
"version": "1.2.14",
|
|
228
|
-
"resolved": "
|
|
228
|
+
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.14.tgz",
|
|
229
229
|
"integrity": "sha512-3G3tnAmTpdk9jO3GQtyHXqeFD2SlecfTws/Y3M2mmj9nMBwwuLT4kur8sZKeu7ENUHSpVO3cIsm5A52LEWWwlg==",
|
|
230
230
|
"cpu": [
|
|
231
231
|
"x64"
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
},
|
|
246
246
|
"node_modules/@rolldown/binding-openharmony-arm64": {
|
|
247
247
|
"version": "1.2.14",
|
|
248
|
-
"resolved": "
|
|
248
|
+
"resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.14.tgz",
|
|
249
249
|
"integrity": "sha512-qyr5XiNGxm2ytx17vvtcJ9nXn6v1gENETi503bJx3OGwZ1tSonj7BosxbMa/xeAfSl5iS9X6KjEWYXLu6v1L7Q==",
|
|
250
250
|
"cpu": [
|
|
251
251
|
"arm64"
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
},
|
|
263
263
|
"node_modules/@rolldown/binding-win32-arm64-msvc": {
|
|
264
264
|
"version": "1.2.14",
|
|
265
|
-
"resolved": "
|
|
265
|
+
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.14.tgz",
|
|
266
266
|
"integrity": "sha512-oA4o5o0S2yB199YyYXDzKUv1Z56Rc+mgOjwm7Z/vJ9Z8igiDPYvoOuDyo6g7AK/ZaF09nPhDKVnGBcYHO11GXA==",
|
|
267
267
|
"cpu": [
|
|
268
268
|
"arm64"
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
},
|
|
280
280
|
"node_modules/@rolldown/binding-win32-x64-msvc": {
|
|
281
281
|
"version": "1.2.14",
|
|
282
|
-
"resolved": "
|
|
282
|
+
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.14.tgz",
|
|
283
283
|
"integrity": "sha512-9mE94bf2GZUaR/fUSXCMpBoWkctu421Mi0ORpm4zqfbkjKep7RxzPFa5etcGs5h+2KApoWBOA/hAJa/7saGgEQ==",
|
|
284
284
|
"cpu": [
|
|
285
285
|
"x64"
|
|
@@ -296,14 +296,14 @@
|
|
|
296
296
|
},
|
|
297
297
|
"node_modules/@rolldown/pluginutils": {
|
|
298
298
|
"version": "1.0.1",
|
|
299
|
-
"resolved": "
|
|
299
|
+
"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz",
|
|
300
300
|
"integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==",
|
|
301
301
|
"dev": true,
|
|
302
302
|
"license": "MIT"
|
|
303
303
|
},
|
|
304
304
|
"node_modules/detect-libc": {
|
|
305
305
|
"version": "2.1.2",
|
|
306
|
-
"resolved": "
|
|
306
|
+
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
|
|
307
307
|
"integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
|
|
308
308
|
"dev": true,
|
|
309
309
|
"license": "Apache-2.0",
|
|
@@ -313,7 +313,7 @@
|
|
|
313
313
|
},
|
|
314
314
|
"node_modules/fdir": {
|
|
315
315
|
"version": "6.5.0",
|
|
316
|
-
"resolved": "
|
|
316
|
+
"resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
|
|
317
317
|
"integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
|
|
318
318
|
"dev": true,
|
|
319
319
|
"license": "MIT",
|
|
@@ -331,7 +331,7 @@
|
|
|
331
331
|
},
|
|
332
332
|
"node_modules/fsevents": {
|
|
333
333
|
"version": "2.3.3",
|
|
334
|
-
"resolved": "
|
|
334
|
+
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
|
335
335
|
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
|
336
336
|
"dev": true,
|
|
337
337
|
"hasInstallScript": true,
|
|
@@ -346,7 +346,7 @@
|
|
|
346
346
|
},
|
|
347
347
|
"node_modules/lightningcss": {
|
|
348
348
|
"version": "1.33.0",
|
|
349
|
-
"resolved": "
|
|
349
|
+
"resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz",
|
|
350
350
|
"integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==",
|
|
351
351
|
"dev": true,
|
|
352
352
|
"license": "MPL-2.0",
|
|
@@ -376,7 +376,7 @@
|
|
|
376
376
|
},
|
|
377
377
|
"node_modules/lightningcss-android-arm64": {
|
|
378
378
|
"version": "1.33.0",
|
|
379
|
-
"resolved": "
|
|
379
|
+
"resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz",
|
|
380
380
|
"integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==",
|
|
381
381
|
"cpu": [
|
|
382
382
|
"arm64"
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
},
|
|
398
398
|
"node_modules/lightningcss-darwin-arm64": {
|
|
399
399
|
"version": "1.33.0",
|
|
400
|
-
"resolved": "
|
|
400
|
+
"resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz",
|
|
401
401
|
"integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==",
|
|
402
402
|
"cpu": [
|
|
403
403
|
"arm64"
|
|
@@ -418,7 +418,7 @@
|
|
|
418
418
|
},
|
|
419
419
|
"node_modules/lightningcss-darwin-x64": {
|
|
420
420
|
"version": "1.33.0",
|
|
421
|
-
"resolved": "
|
|
421
|
+
"resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz",
|
|
422
422
|
"integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==",
|
|
423
423
|
"cpu": [
|
|
424
424
|
"x64"
|
|
@@ -439,7 +439,7 @@
|
|
|
439
439
|
},
|
|
440
440
|
"node_modules/lightningcss-freebsd-x64": {
|
|
441
441
|
"version": "1.33.0",
|
|
442
|
-
"resolved": "
|
|
442
|
+
"resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz",
|
|
443
443
|
"integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==",
|
|
444
444
|
"cpu": [
|
|
445
445
|
"x64"
|
|
@@ -460,7 +460,7 @@
|
|
|
460
460
|
},
|
|
461
461
|
"node_modules/lightningcss-linux-arm-gnueabihf": {
|
|
462
462
|
"version": "1.33.0",
|
|
463
|
-
"resolved": "
|
|
463
|
+
"resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz",
|
|
464
464
|
"integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==",
|
|
465
465
|
"cpu": [
|
|
466
466
|
"arm"
|
|
@@ -481,7 +481,7 @@
|
|
|
481
481
|
},
|
|
482
482
|
"node_modules/lightningcss-linux-arm64-gnu": {
|
|
483
483
|
"version": "1.33.0",
|
|
484
|
-
"resolved": "
|
|
484
|
+
"resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz",
|
|
485
485
|
"integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==",
|
|
486
486
|
"cpu": [
|
|
487
487
|
"arm64"
|
|
@@ -505,7 +505,7 @@
|
|
|
505
505
|
},
|
|
506
506
|
"node_modules/lightningcss-linux-arm64-musl": {
|
|
507
507
|
"version": "1.33.0",
|
|
508
|
-
"resolved": "
|
|
508
|
+
"resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz",
|
|
509
509
|
"integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==",
|
|
510
510
|
"cpu": [
|
|
511
511
|
"arm64"
|
|
@@ -529,7 +529,7 @@
|
|
|
529
529
|
},
|
|
530
530
|
"node_modules/lightningcss-linux-x64-gnu": {
|
|
531
531
|
"version": "1.33.0",
|
|
532
|
-
"resolved": "
|
|
532
|
+
"resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz",
|
|
533
533
|
"integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==",
|
|
534
534
|
"cpu": [
|
|
535
535
|
"x64"
|
|
@@ -553,7 +553,7 @@
|
|
|
553
553
|
},
|
|
554
554
|
"node_modules/lightningcss-linux-x64-musl": {
|
|
555
555
|
"version": "1.33.0",
|
|
556
|
-
"resolved": "
|
|
556
|
+
"resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz",
|
|
557
557
|
"integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==",
|
|
558
558
|
"cpu": [
|
|
559
559
|
"x64"
|
|
@@ -577,7 +577,7 @@
|
|
|
577
577
|
},
|
|
578
578
|
"node_modules/lightningcss-win32-arm64-msvc": {
|
|
579
579
|
"version": "1.33.0",
|
|
580
|
-
"resolved": "
|
|
580
|
+
"resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz",
|
|
581
581
|
"integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==",
|
|
582
582
|
"cpu": [
|
|
583
583
|
"arm64"
|
|
@@ -598,7 +598,7 @@
|
|
|
598
598
|
},
|
|
599
599
|
"node_modules/lightningcss-win32-x64-msvc": {
|
|
600
600
|
"version": "1.33.0",
|
|
601
|
-
"resolved": "
|
|
601
|
+
"resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz",
|
|
602
602
|
"integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==",
|
|
603
603
|
"cpu": [
|
|
604
604
|
"x64"
|
|
@@ -619,7 +619,7 @@
|
|
|
619
619
|
},
|
|
620
620
|
"node_modules/nanoid": {
|
|
621
621
|
"version": "3.3.20",
|
|
622
|
-
"resolved": "
|
|
622
|
+
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",
|
|
623
623
|
"integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==",
|
|
624
624
|
"dev": true,
|
|
625
625
|
"funding": [
|
|
@@ -638,14 +638,14 @@
|
|
|
638
638
|
},
|
|
639
639
|
"node_modules/picocolors": {
|
|
640
640
|
"version": "1.1.1",
|
|
641
|
-
"resolved": "
|
|
641
|
+
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
|
|
642
642
|
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
|
|
643
643
|
"dev": true,
|
|
644
644
|
"license": "ISC"
|
|
645
645
|
},
|
|
646
646
|
"node_modules/picomatch": {
|
|
647
647
|
"version": "4.0.7",
|
|
648
|
-
"resolved": "
|
|
648
|
+
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz",
|
|
649
649
|
"integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==",
|
|
650
650
|
"dev": true,
|
|
651
651
|
"license": "MIT",
|
|
@@ -658,7 +658,7 @@
|
|
|
658
658
|
},
|
|
659
659
|
"node_modules/postcss": {
|
|
660
660
|
"version": "8.5.31",
|
|
661
|
-
"resolved": "
|
|
661
|
+
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.31.tgz",
|
|
662
662
|
"integrity": "sha512-YUbWYCgErwnMAVkjUnYa+KlMBzGpHwiIt/DE7f0G33AuX2LH9UcTk6KgWxd3zRU+pN3u/C+Xl3EnMLM4Hea7Sg==",
|
|
663
663
|
"dev": true,
|
|
664
664
|
"funding": [
|
|
@@ -687,7 +687,7 @@
|
|
|
687
687
|
},
|
|
688
688
|
"node_modules/rolldown": {
|
|
689
689
|
"version": "1.2.14",
|
|
690
|
-
"resolved": "
|
|
690
|
+
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.14.tgz",
|
|
691
691
|
"integrity": "sha512-eTBTTqMR6uHKLgcUqpJP8ntzDI6V4LYA8negAMBEI7gkgVvOdrx6VsvS2Ym+83KhOPdLCHWJu0w7UQFJZhHKNw==",
|
|
692
692
|
"dev": true,
|
|
693
693
|
"license": "MIT",
|
|
@@ -721,7 +721,7 @@
|
|
|
721
721
|
},
|
|
722
722
|
"node_modules/source-map-js": {
|
|
723
723
|
"version": "1.2.2",
|
|
724
|
-
"resolved": "
|
|
724
|
+
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz",
|
|
725
725
|
"integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==",
|
|
726
726
|
"dev": true,
|
|
727
727
|
"license": "BSD-3-Clause",
|
|
@@ -731,7 +731,7 @@
|
|
|
731
731
|
},
|
|
732
732
|
"node_modules/tinyglobby": {
|
|
733
733
|
"version": "0.2.17",
|
|
734
|
-
"resolved": "
|
|
734
|
+
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",
|
|
735
735
|
"integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",
|
|
736
736
|
"dev": true,
|
|
737
737
|
"license": "MIT",
|
|
@@ -748,7 +748,7 @@
|
|
|
748
748
|
},
|
|
749
749
|
"node_modules/vite": {
|
|
750
750
|
"version": "8.3.4",
|
|
751
|
-
"resolved": "
|
|
751
|
+
"resolved": "https://registry.npmjs.org/vite/-/vite-8.3.4.tgz",
|
|
752
752
|
"integrity": "sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ==",
|
|
753
753
|
"dev": true,
|
|
754
754
|
"license": "MIT",
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
CREATE TABLE leaderboard_scores (
|
|
2
|
+
puid text PRIMARY KEY, public_id uuid NOT NULL UNIQUE,
|
|
3
|
+
display_name varchar(24) NOT NULL, score integer NOT NULL CHECK(score>=0 AND score<=1000000),
|
|
4
|
+
updated_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
5
|
+
);
|
|
6
|
+
CREATE INDEX leaderboard_scores_ranking ON leaderboard_scores(score DESC,updated_at ASC,public_id ASC);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const { randomUUID } = require("node:crypto");
|
|
2
|
+
// The host owns Express, authentication and database configuration.
|
|
3
|
+
function registerLeaderboard(app, cloud) {
|
|
4
|
+
app.get("/api/leaderboard", async (_req, res, next) => {
|
|
5
|
+
try {
|
|
6
|
+
res.json({
|
|
7
|
+
rows: (
|
|
8
|
+
await cloud.db.query(
|
|
9
|
+
"SELECT display_name,score FROM leaderboard_scores ORDER BY score DESC,updated_at ASC,public_id ASC LIMIT 20",
|
|
10
|
+
)
|
|
11
|
+
).rows,
|
|
12
|
+
});
|
|
13
|
+
} catch (e) {
|
|
14
|
+
next(e);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
app.post("/api/leaderboard", async (req, res, next) => {
|
|
18
|
+
try {
|
|
19
|
+
const user = await cloud.auth.requireUser({
|
|
20
|
+
authorization: req.get("authorization"),
|
|
21
|
+
});
|
|
22
|
+
const { score, displayName } = req.body ?? {};
|
|
23
|
+
if (
|
|
24
|
+
!Number.isSafeInteger(score) ||
|
|
25
|
+
score < 0 ||
|
|
26
|
+
score > 1000000 ||
|
|
27
|
+
typeof displayName !== "string" ||
|
|
28
|
+
displayName.trim().length < 1 ||
|
|
29
|
+
displayName.trim().length > 24
|
|
30
|
+
)
|
|
31
|
+
return res
|
|
32
|
+
.status(400)
|
|
33
|
+
.json({
|
|
34
|
+
code: "INVALID_SCORE",
|
|
35
|
+
message: "请填写昵称和 0–1000000 的整数成绩",
|
|
36
|
+
});
|
|
37
|
+
const result = await cloud.db.query(
|
|
38
|
+
`INSERT INTO leaderboard_scores(puid,public_id,display_name,score) VALUES($1,$2,$3,$4)
|
|
39
|
+
ON CONFLICT(puid) DO UPDATE SET score=excluded.score,display_name=excluded.display_name,updated_at=CURRENT_TIMESTAMP
|
|
40
|
+
WHERE excluded.score>leaderboard_scores.score RETURNING score`,
|
|
41
|
+
[user.puid, randomUUID(), displayName.trim(), score],
|
|
42
|
+
);
|
|
43
|
+
res.json({ improved: result.rowCount > 0 });
|
|
44
|
+
} catch (e) {
|
|
45
|
+
next(e);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
module.exports = { registerLeaderboard };
|